plainframe-ui 0.1.71 → 0.1.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import pe,{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"}},Ur={0:"#ffffff",50:"#f9f9f9",100:"#f5f5f5",200:"#eeeeee",300:"#e5e5e5",400:"#d7d7d7ff",500:"#b3b3b3",600:"#737373",700:"#4a4a4a",800:"#2b2b2b",900:"#111111"},qr={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"},sky:{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"},sky:{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,sky:e.sky,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:{}}),hc=["danger","success","warning","info","red","amber","orange","yellow","lime","green","teal","cyan","sky","blue","indigo","purple","magenta","pink","rose","mono"],wa=e=>hc.reduce((t,n)=>(t[n]=e[n]??"#FFFFFF",t),{}),jo={spacing:xa,radius:va,componentHeights:Ca,typography:Ra,neutral:Ur,palette:{...Ta(ha),primary:ha.mono},surface:Jn("light",Ur),text:{...Ko(Ur),onColors:{primary:"#FFFFFF",...wa({yellow:"#000000"})}}},Ea={spacing:xa,radius:va,componentHeights:Ca,typography:Ra,neutral:qr,palette:{...Ta(ya),primary:ya.mono},surface:Jn("dark",qr),text:{..._o(qr),onColors:{primary:"#000000",...wa({yellow:"#000000",mono:"#000000"})}}};function ka(e){let t=e,n=new Set;return {get:()=>t,set:o=>{t=o,n.forEach(r=>r());},subscribe:o=>(n.add(o),()=>{n.delete(o);})}}var Ma={destructive:"danger",error:"danger",violet:"purple",fuchsia:"magenta",gray:"mono",grey:"mono",neutral:"mono"},Vt=e=>Ma[e]??e;function Ut(e){let t={...e};return Object.entries(Ma).forEach(([n,o])=>{t[o]!=null&&t[n]==null&&(t[n]=t[o]);}),t}var Yr=pe.createContext(null),Fa=pe.createContext(null),Jr=pe.createContext({setMode:e=>{},toggleMode:()=>{}}),Aa=pe.createContext({setPrimary:e=>{}}),Pa=pe.createContext(null);function U(){return useTheme()}function vc(){let e=pe.useContext(Yr);if(!e)throw new Error("useColorMode must be used within ThemeProvider");let t=pe.useContext(Jr),[n,o]=pe.useState(()=>e.get());return pe.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{mode:n,setMode:t.setMode,toggleMode:t.toggleMode}}function Cc(){let e=pe.useContext(Fa);if(!e)throw new Error("usePrimary must be used within ThemeProvider");let t=pe.useContext(Aa),[n,o]=pe.useState(()=>e.get());return pe.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{primary:n,setPrimary:t.setPrimary}}function db(e){let t=pe.useContext(Pa);if(!t)throw new Error("usePrimitives must be used within ThemeProvider");let{mode:n}=vc(),{primary:o}=Cc(),r=pe.useMemo(()=>{let s=n==="light"?t.light:t.dark,a=s.palette[Vt(o)]??s.palette.primary,c=Ut(s.text.onColors)[Vt(o)]??Xo(a[600]);return {...s,palette:{...s.palette,primary:a},text:{...s.text,onColors:{...Ut(s.text.onColors),primary:c,[Vt(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 Xo(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 Gr(e,t){if(e.current)return;let n=document.createElement("style");n.id=t,document.head.appendChild(n),e.current=n;}function Xr(e){return e?`[data-pfui-scope="${e}"]`:":root"}function Rc(e,t){let n=[],o=s=>s.startsWith("var(")?s.replace(/^var\([^,]+,\s*/,"").replace(/\)\s*$/,"").trim():s;n.push(`--pf-font-sans:${o(e.typography.fonts.sans)};`),n.push(`--pf-font-mono:${o(e.typography.fonts.mono)};`),n.push(`--pf-text-primary:${e.text.primary};`),n.push(`--pf-text-secondary:${e.text.secondary};`),n.push(`--pf-text-muted:${e.text.muted};`),Object.entries(e.text.onColors).forEach(([s,a])=>n.push(`--pf-text-on-${s}:${a};`)),Object.entries(e.spacing).forEach(([s,a])=>n.push(`--pf-space-${s}:${typeof a=="number"?`${a}px`:a};`)),Object.entries(e.radius).forEach(([s,a])=>n.push(`--pf-radius-${s}:${typeof a=="number"?`${a}px`:a};`)),Object.entries(e.typography.sizes).forEach(([s,a])=>n.push(`--pf-fontSize-${s}:${typeof a=="number"?`${a}px`:a};`)),Object.entries(e.componentHeights).forEach(([s,a])=>n.push(`--pf-cmph-${s}:${typeof a=="number"?`${a}px`:a};`)),Object.entries(e.neutral).forEach(([s,a])=>n.push(`--pf-neutral-${s}:${a};`)),n.push(`--pf-surface-appBg:${e.surface.appBg};`),n.push(`--pf-surface-panelBg:${e.surface.panelBg};`),n.push(`--pf-surface-subtleBg:${e.surface.subtleBg};`),n.push(`--pf-surface-panelHover:${e.surface.panelHover};`),n.push(`--pf-surface-subtleHover:${e.surface.subtleHover};`),n.push(`--pf-surface-overlayBg:${e.surface.overlayBg};`),n.push(`--pf-surface-border:${e.surface.border};`),n.push("--pf-focus-main:var(--pf-neutral-400);"),n.push(t==="dark"?"--pf-focus-soft:var(--pf-neutral-200);":"--pf-focus-soft:var(--pf-neutral-300);"),Object.entries(e.palette).forEach(([s,a])=>{Object.entries(a).forEach(([c,i])=>{n.push(`--pf-palette-${s}-${c}:${i};`);});});let r="300";return Object.keys(e.palette).forEach(s=>{n.push(`--pf-focus-${s}-main: var(--pf-palette-${s}-${r});`),n.push(`--pf-focus-${s}-soft: transparent;`);}),n.push(`color-scheme:${t==="dark"?"dark":"light"};`),n}function Tc(e,t){let n=[],o=Vt(t);[0,50,100,200,300,400,500,600,700,800,900].forEach(s=>n.push(`--pf-primary-${s}:var(--pf-palette-${o}-${s});`)),n.push("--pf-focus-accent-main:var(--pf-primary-300);"),n.push("--pf-focus-accent-soft: transparent;");let r=e.text.onColors[o]??(()=>{let s=e.palette[o]?.[600]??e.palette.primary[600];return Xo(s)})();return n.push(`--pf-text-on-primary:${r};`),n.push(`--pf-text-on-${o}:${r};`),n}function Ia(e,t){return Rc(e,t).join("")}function Uo(e,t){return Tc(e,t).join("")}var qo=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);}},Go=(e,t)=>{e.classList.toggle("pf-light",t==="light"),e.classList.toggle("pf-dark",t==="dark");};function wc(e){let t=(l,p)=>Object.fromEntries(Object.keys(l).map(b=>[b,p(b)])),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={};Object.keys(e.palette).forEach(l=>{i[l]={},Object.keys(e.palette[l]).forEach(p=>{i[l][p]=`var(--pf-palette-${l}-${p})`;});}),i.primary=Object.fromEntries(["0","50","100","200","300","400","500","600","700","800","900"].map(l=>[l,`var(--pf-primary-${l})`]));let f=Object.keys(Ut(e.text.onColors));return {...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(f.map(l=>[l,`var(--pf-text-on-${l})`]))}}}function Ec(e){let t=Object.keys(e.palette).sort(),n=`p:${t.join("|")};`;for(let o of t)n+=`${o}:${Object.keys(e.palette[o]??{}).sort().join(",")};`;return n+=`n:${Object.keys(e.neutral??{}).sort().join(",")};`,n+=`s:${Object.keys(e.spacing??{}).sort().join(",")};`,n+=`r:${Object.keys(e.radius??{}).sort().join(",")};`,n+=`fs:${Object.keys(e.typography?.sizes??{}).sort().join(",")};`,n+=`ch:${Object.keys(e.componentHeights??{}).sort().join(",")};`,n+=`oc:${Object.keys(Ut(e.text?.onColors??{})).sort().join(",")};`,n}var Da=({children:e,theme:t,initialMode:n="light",storageKey:o="pfui:pref",scope:r})=>{let s=!!r,a=t?.primaryKey??"mono",c=pe.useContext(Yr),i=pe.useContext(Jr),f=!!c,p=useRef((()=>{if(!s)try{let T=JSON.parse(localStorage.getItem(o)||"null");if(T?.mode==="light"||T?.mode==="dark")return T.mode}catch{}return n==="system"?window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light":n??"light"})()),b=pe.useMemo(()=>c??ka(p.current),[c]),m=pe.useMemo(()=>ka(a),[]);pe.useLayoutEffect(()=>{m.get()!==a&&m.set(a);},[a,m]);let C=useRef(null),F=useRef(0),h=useRef(r??"__root__");pe.useLayoutEffect(()=>{let T=0,I=C.current;for(;I&&I!==document.body;)I.hasAttribute("data-pfui-scope")&&T++,I=I.parentElement;F.current=T;},[r]);let y=useMemo(()=>{let T=Vo(jo,t),I=Vo(T,t?.light),z=t?.light?.primaryKey??a,P=Vt(z),j=I.palette.primary??I.palette[P]??I.palette.mono,q=Ut({...Ko(I.neutral).onColors,...I.text.onColors}),te=q[P]??Xo(j[600]),V=t?.surface||t?.light?.surface?I.surface:Jn("light",I.neutral),ie={...t?.text||t?.light?.text?I.text:Ko(I.neutral),onColors:Ut({...q,primary:te,[P]:te})};return {...I,palette:{...I.palette,primary:j},surface:V,text:ie}},[t,a]),g=useMemo(()=>{let T=Vo(Ea,t),I=Vo(T,t?.dark),z=t?.dark?.primaryKey??a,P=Vt(z),j=I.palette.primary??I.palette[P]??I.palette.mono,q=Ut({..._o(I.neutral).onColors,...I.text.onColors}),te=q[P]??Xo(j[600]),V=t?.surface||t?.dark?.surface?I.surface:Jn("dark",I.neutral),ie={...t?.text||t?.dark?.text?I.text:_o(I.neutral),onColors:Ut({...q,primary:te,[P]:te})};return {...I,palette:{...I.palette,primary:j},surface:V,text:ie}},[t,a]),u=useRef(null),d=useRef(null),x=useRef(null),N=pe.useInsertionEffect||pe.useLayoutEffect,v=useCallback(()=>{let T=Xr(r);Gr(x,s?`pfui-guard-${r}`:"pfui-guard-root"),x.current.textContent=`${T} *{transition:none!important;animation:none!important}`,requestAnimationFrame(()=>{x.current.textContent="";});},[r,s]);N(()=>{Gr(u,s?`pfui-vars-${r}`:"pfui-vars-root"),Gr(d,s?`pfui-primary-${r}`:"pfui-primary-root");t?.light?.primaryKey??t?.primaryKey??a;t?.dark?.primaryKey??t?.primaryKey??a;let z=Xr(r),P=s?`[data-pfui-portal-owner="${h.current}"]`:"",j=s?`${z}.pf-light,${P}.pf-light`:`${z}.pf-light`,q=s?`${z}.pf-dark,${P}.pf-dark`:`${z}.pf-dark`,te=Ia(y,"light"),V=Ia(g,"dark");u.current.textContent=`${j}{${te}}
|
|
2
|
-
${
|
|
3
|
-
${
|
|
4
|
-
${
|
|
5
|
-
${j}{${V}}`);let Y=b.get();if(w(Y),(s?C.current:document.documentElement)?.setAttribute("data-pfui-primary",T),!s)try{let ce=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...ce,primary:T}));}catch{}},[y,g,r,s,b,m,w,o]),O=f?i:{setMode:D,toggleMode:H},$=useRef(null),S=useRef(""),k=Ec(y);(!$.current||S.current!==k)&&($.current=wc(y),S.current=k);let W=jsx(Pa.Provider,{value:{light:y,dark:g},children:jsx(Yr.Provider,{value:b,children:jsx(Fa.Provider,{value:m,children:jsx(Jr.Provider,{value:O,children:jsx(Aa.Provider,{value:{setPrimary:L},children:jsx(ThemeProvider,{theme:$.current,children:e})})})})})});return s?jsx("div",{ref:C,"data-pfui-scope":r,style:{background:"var(--pf-surface-appBg)",color:"var(--pf-text-primary)"},children:W}):jsx("div",{ref:C,children:W})};var Sc=(e,t)=>{let n=e?.palette??{};return !t||t==="neutral"?"neutral":n[t]?t:"neutral"},Na=(e,t)=>{let n=Sc(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 ye(){let e=U();return t=>{if(!((t?.enabled??true)&&!t?.disabled)||t?.mode==="none")return css({});let{soft:o,main:r}=Na(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 Jo(){let e=U();return t=>{if(!((t?.enabled??true)&&!t?.disabled)||t?.mode==="none")return css({});let{soft:o,main:r}=Na(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 $a=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,za=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=U(),f=i.typography.sizes.sm,l=20,p=10,b=i.spacing.lg,m=i.spacing.md,C=Number(i.componentHeights?.md),F=i.text,h=css({display:"flex",alignItems:"center",outline:"none",userSelect:"none",fontWeight:500,minHeight:C,padding:`${m} ${b}`,gap:p,fontSize:f,color:F.primary}),y=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",gap:8}),g=css({marginRight:0,marginLeft:-2,lineHeight:0,color:i.text.secondary}),u=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:[h,s],children:[!o&&n==="left"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-left",css:[g,a],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:l,height:l}})}),jsx("span",{className:"plainframe-ui-accordion-content",css:y,children:e}),!o&&n==="right"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-right",css:[u,a],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:l,height:l}})})]})});ts.__PFUI_SLOT="AccordionSummary";ts.displayName="AccordionSummary";var ns=({children:e,className:t,css:n})=>{let o=U(),r=o.typography.sizes.sm,s=o.spacing.lg,a="0.15rem",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 Oa=({open:e,defaultOpen:t=false,onChange:n,className:o,variant:r="subtle",disabled:s=false,width:a,fullWidth:c=false,css:i,children:f})=>{let l=U(),p=useId(),b=useId(),m=l.radius?.md,C=l.text,F=l.componentHeights?.border??1,h=$a(F)??"1px",y=e!==void 0,[g,u]=useState(!!t),d=y?!!e:g,x=ye(),[N,v]=useState(0),[R,M]=useState(false),B=useRef(null),_=useRef(null),K=useRef(null),E=()=>{if(!d)return;let P=document.activeElement;_.current?.contains(P)&&K.current?.focus();},A=()=>{s||(E(),y?n?.(!e):u(P=>{let j=!P;return n?.(j),j}));},w=pe.Children.toArray(f).filter(P=>isValidElement(P)),D=w.findIndex(P=>za(P)==="AccordionSummary"),H=w.findIndex(P=>za(P)==="AccordionDetails");D===-1&&w.length&&(D=0),H===-1&&(H=w.findIndex((P,j)=>j!==D),H===-1&&w.length>=2&&(H=1));let L=w[D]??null,O=w[H]??null,$=r==="subtle"?l.surface.subtleBg:r==="outlined"?l.surface.panelBg:"transparent",S=css({backgroundColor:$,color:C.primary,borderRadius:m,border:r==="outlined"?`${h} solid ${l.surface.border}`:"none",outline:"none",marginBottom:l.spacing.sm,maxWidth:a!=null?$a(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 P=B.current;P&&v(P.scrollHeight);},[d,f]),useEffect(()=>{let P=B.current;if(!P)return;let j=new ResizeObserver(()=>v(P.scrollHeight));return j.observe(P),()=>j.disconnect()},[]),useEffect(()=>{N>0&&!R&&M(true);},[N,R]),useLayoutEffect(()=>{if(!d&&_.current){let P=document.activeElement;_.current.contains(P)&&K.current?.focus();}},[d]),useLayoutEffect(()=>{let P=_.current;if(!P)return;let j=Array.from(P.querySelectorAll("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, [tabindex]"));d?(j.forEach(q=>{let te=q.dataset.accordionTabindex;te!=null&&(te===""?q.removeAttribute("tabindex"):q.tabIndex=Number(te),delete q.dataset.accordionTabindex);}),P.removeAttribute("inert")):(j.forEach(q=>{q.dataset.accordionTabindex==null&&(q.dataset.accordionTabindex=q.hasAttribute("tabindex")?q.getAttribute("tabindex")??"":""),q.tabIndex=-1;}),P.setAttribute("inert",""));},[d]);let k=css({maxHeight:d?N||"none":0,overflow:d&&!R?"visible":"hidden",transition:R?"max-height 0.36s cubic-bezier(.25,.8,.4,1)":"none",willChange:R?"max-height":void 0}),W=css({opacity:d?1:0,transform:d?"translateY(0)":"translateY(1rem)",transition:R?"transform 0.28s ease, opacity 0.28s ease":"none"}),T=css({"& .plainframe-ui-accordion-icon":{transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1)",transform:d?"rotate(180deg)":"rotate(0deg)"}}),I=L&&cloneElement(L,{...typeof L.props=="object"&&L.props?L.props:{},className:[L.props?.className,"plainframe-ui-accordion-summary-managed"].filter(Boolean).join(" ")}),z=O;return jsxs("div",{className:["plainframe-ui-accordion",`plainframe-ui-accordion-${r}`,o||""].join(" ").trim(),"data-variant":r,"data-open":d?"true":"false","data-disabled":s?"true":"false",css:[x(),S,i],tabIndex:s?-1:0,ref:K,role:"button","aria-expanded":d,"aria-controls":p,"aria-labelledby":b,"aria-disabled":s||void 0,onClick:P=>{P.detail===0&&document.activeElement!==K.current||A();},onKeyDown:P=>{s||document.activeElement===K.current&&P.target===K.current&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),A());},children:[jsx("div",{id:b,className:"plainframe-ui-accordion-summary-wrapper",css:[css({cursor:s?"not-allowed":"pointer"}),T],children:I}),jsx("div",{id:p,"aria-hidden":!d,className:"plainframe-ui-accordion-details-clip",css:k,tabIndex:-1,ref:_,onClick:P=>P.stopPropagation(),children:jsx("div",{ref:B,className:"plainframe-ui-accordion-details-inner",css:W,children:z})})]})};Oa.displayName="Accordion";var Bc=e=>isValidElement(e),$c=e=>Bc(e)?e.type?.displayName||e.type?.name:void 0,Ka=e=>$c(e)==="Accordion",zc=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Oc=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,_a=({children:e,attached:t=false,variant:n,exclusive:o=false,openIndex:r,defaultOpenIndex:s,onOpenIndexChange:a,disabled:c=false,width:i,fullWidth:f=false,className:l,role:p="group",css:b})=>{let m=U(),C=useRef(null),F=Children.toArray(e),h=F.filter(Ka),y=h.length,g=o&&r!==void 0,[u,d]=useState(()=>{if(!o)return null;if(s!==void 0)return s;for(let A=0;A<h.length;A++){let w=h[A].props;if(w.open||w.defaultOpen)return A}return null}),x=o?g?r??null:u:null,N=Oc(m.componentHeights?.border,1),v=m.surface.border,R=m.radius.md,M=n,B=M==="outlined";useEffect(()=>{let A=C.current;if(!A)return;let w=D=>{if(D.key!=="ArrowDown"&&D.key!=="ArrowUp"&&D.key!=="Home"&&D.key!=="End")return;let L=Array.from(A.querySelectorAll(".plainframe-ui-accordion")).filter(k=>k.getAttribute("data-disabled")!=="true");if(L.length===0)return;let O=document.activeElement,$=L.findIndex(k=>k.contains(O));if($===-1)return;D.preventDefault();let S=$;D.key==="ArrowDown"?S=($+1)%L.length:D.key==="ArrowUp"?S=($-1+L.length)%L.length:D.key==="Home"?S=0:D.key==="End"&&(S=L.length-1),L[S]?.focus();};return A.addEventListener("keydown",w),()=>A.removeEventListener("keydown",w)},[y]);let _=css({display:"flex",flexDirection:"column",maxWidth:i!=null?zc(i):void 0,width:f?"100%":i!=null?void 0:"auto",gap:t?0:m.spacing.sm,border:t&&B?`${N} solid ${v}`:"none",borderRadius:t&&B?R:void 0,background:t&&B?m.surface.panelBg:"transparent"}),K=0,E=[];return F.forEach((A,w)=>{if(!Ka(A)){E.push(A);return}let D=A.props,H=K++,L=H===0,O=H===y-1,$=c||!!D.disabled,S=M??D.variant,k=t?css({width:"100%",marginBottom:0,borderTopLeftRadius:L?R:0,borderTopRightRadius:L?R:0,borderBottomLeftRadius:O?R:0,borderBottomRightRadius:O?R:0}):css({width:"100%",marginBottom:0}),W=!L&&y>1&&t?css({borderTop:`${N} solid ${v}`}):null,T=B?css({border:"1px solid transparent"}):null,I={variant:S,disabled:$,width:"100%",css:[D.css,k,T,W],className:[D.className,"plainframe-ui-accordion-group-item"].filter(Boolean).join(" ")};if(o){let z=D.onChange,P=x===H;I.open=P,I.defaultOpen=void 0,I.onChange=j=>{let q=j?H:null;g||d(q),a?.(q),z?.(j);};}E.push(cloneElement(A,{...D,...I,key:A?.key??w}));}),jsx("div",{ref:C,role:p,"aria-orientation":"vertical","data-attached":t||void 0,"data-exclusive":o||void 0,className:["plainframe-ui-accordion-group",l||""].join(" ").trim(),css:[_,b],children:E})};_a.displayName="AccordionGroup";var qt=e=>typeof e=="number"?`${e}px`:e,Va=({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:f=0,elevated:l=true,unstyled:p=false,fullWidth:b=false,width:m,height:C,role:F="toolbar","aria-label":h,onClose:y})=>{let g=U(),u=useRef(null),d=useRef(null),x=useRef(false),N=useRef(t),v=n.horizontal??"center",R=n.vertical??"bottom",M=S=>typeof S=="string"?g.spacing[S]??S:S,B=S=>typeof S=="string"?g.radius[S]??S:S,_=qt(M(c)),K=qt(M(i)),E=qt(M(f)),A={position:"fixed",left:0,right:0,top:0,bottom:0,display:"flex",pointerEvents:"none",zIndex:1e3,justifyContent:v==="left"?"flex-start":v==="right"?"flex-end":"center",alignItems:R==="top"?"flex-start":R==="bottom"?"flex-end":"center"},w=()=>`${v==="left"?"left":v==="right"?"right":"center"} ${R==="top"?"top":R==="bottom"?"bottom":"center"}`,D=()=>R==="top"||R==="bottom"?`translateY(${R==="bottom"?100:-100}px) scale(0.98)`:R==="center"?v==="left"?"translateX(-100px) scale(0.98)":v==="right"?"translateX(100px) scale(0.98)":"scale(0.95)":"scale(0.98)",H=()=>R==="center"&&v==="center"?"scale(1)":"translateX(0) translateY(0) scale(1)",L=24,O={margin:L,marginTop:R==="top"?`calc(${L}px + ${_} + ${E})`:L,marginBottom:R==="bottom"?`calc(${L}px + ${_} + ${E})`:L,marginLeft:v==="left"?`calc(${L}px + ${_} + ${K})`:L,marginRight:v==="right"?`calc(${L}px + ${_} + ${K})`:L,padding:p?0:qt(M(r)),background:p?"transparent":g.surface.panelBg,border:p?"none":`1px solid ${g.surface.border}`,borderRadius:p?0:qt(B(a)),boxShadow:p||!l?"none":"0 20px 40px rgba(0,0,0,.08)",display:"flex",flexDirection:o==="vertical"?"column":"row",gap:qt(M(s)),transformOrigin:w(),pointerEvents:t?"auto":"none",width:b?"calc(100% - 48px)":m?qt(m):"auto",height:C?qt(C):"auto",maxWidth:b?"100%":"none"},$=css({"& .plainframe-ui-textfield":{flex:1,minWidth:0}});return useLayoutEffect(()=>{let S=u.current;if(!S)return;let k=D(),W=H();if(!x.current){x.current=true,N.current=t,S.style.opacity=t?"1":"0",S.style.transform=t?W:k;return}if(N.current===t){S.style.opacity=t?"1":"0",S.style.transform=t?W:k;return}N.current=t,d.current&&d.current.cancel();let T=t?[{opacity:0,transform:k},{opacity:1,transform:W}]:[{opacity:1,transform:W},{opacity:0,transform:k}];return d.current=S.animate(T,{duration:250,easing:"ease",fill:"forwards"}),()=>{d.current&&d.current.cancel();}},[t,v,R]),useEffect(()=>{if(!t||!y)return;let S=k=>{k.key==="Escape"&&y();};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[t,y]),jsx("div",{css:A,children:jsx("div",{ref:u,css:$,style:O,role:F,"aria-label":h,"aria-hidden":!t,...!t&&{inert:true},children:e})})};Va.displayName="ActionBar";var qa=(e,t,n)=>Math.min(n,Math.max(t,e)),os=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Ua=1,Uc=keyframes`100% { transform: rotate(360deg); }`,qc=keyframes`
|
|
1
|
+
import me,{forwardRef,createContext,useId,useMemo,useState,useCallback,useRef,useEffect,useContext,isValidElement,cloneElement,useLayoutEffect,Children,memo,useSyncExternalStore}from'react';import {css,keyframes,useTheme,ThemeProvider,Global}from'@emotion/react';import {jsxs,jsx,Fragment}from'@emotion/react/jsx-runtime';import {ChevronDown,CircleAlert,TriangleAlert,CircleCheckBig,Info,X,Eye,EyeOff,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"},jr={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"},sky:{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"},sky:{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,sky:e.sky,blue:e.blue,indigo:e.indigo,purple:e.purple,violet:e.purple,magenta:e.magenta,fuchsia:e.magenta,pink:e.pink,rose:e.rose,gray:e.mono,grey:e.mono,neutral:e.mono}),Qn=(e,t)=>e==="light"?{appBg:t[0],panelBg:t[0],subtleBg:t[100],panelHover:t[50],subtleHover:t[200],overlayBg:"linear-gradient(rgba(0,0,0,.15),rgba(0,0,0,.525))",border:t[300]}:{appBg:t[0],panelBg:t[0],subtleBg:t[50],panelHover:t[50],subtleHover:t[100],overlayBg:"linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.75))",border:t[200]},Ko=e=>({primary:e[900],secondary:e[600],muted:e[500],onColors:{}}),_o=e=>({primary:e[900],secondary:e[700],muted:e[600],onColors:{}}),xc=["danger","success","warning","info","red","amber","orange","yellow","lime","green","teal","cyan","sky","blue","indigo","purple","magenta","pink","rose","mono"],wa=e=>xc.reduce((t,n)=>(t[n]=e[n]??"#FFFFFF",t),{}),Vo={spacing:xa,radius:va,componentHeights:Ca,typography:Ra,neutral:Vr,palette:{...Ta(ha),primary:ha.mono},surface:Qn("light",Vr),text:{...Ko(Vr),onColors:{primary:"#FFFFFF",...wa({yellow:"#000000"})}}},Ea={spacing:xa,radius:va,componentHeights:Ca,typography:Ra,neutral:jr,palette:{...Ta(ya),primary:ya.mono},surface:Qn("dark",jr),text:{..._o(jr),onColors:{primary:"#000000",...wa({yellow:"#000000",mono:"#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"},ht=e=>Fa[e]??e;function cn(e){let t={...e};return Object.entries(Fa).forEach(([n,o])=>{t[o]!=null&&t[n]==null&&(t[n]=t[o]);}),t}var qr=me.createContext(null),Ma=me.createContext(null),Gr=me.createContext({setMode:e=>{},toggleMode:()=>{}}),Pa=me.createContext({setPrimary:e=>{}}),Da=me.createContext(null);function V(){return useTheme()}function Rc(){let e=me.useContext(qr);if(!e)throw new Error("useColorMode must be used within ThemeProvider");let t=me.useContext(Gr),[n,o]=me.useState(()=>e.get());return me.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{mode:n,setMode:t.setMode,toggleMode:t.toggleMode}}function Tc(){let e=me.useContext(Ma);if(!e)throw new Error("usePrimary must be used within ThemeProvider");let t=me.useContext(Pa),[n,o]=me.useState(()=>e.get());return me.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{primary:n,setPrimary:t.setPrimary}}function db(e){let t=me.useContext(Da);if(!t)throw new Error("usePrimitives must be used within ThemeProvider");let{mode:n}=Rc(),{primary:o}=Tc(),r=me.useMemo(()=>{let s=n==="light"?t.light:t.dark,a=s.palette[ht(o)]??s.palette.primary,c=cn(s.text.onColors)[ht(o)]??Xr(a[600]);return {...s,palette:{...s.palette,primary:a},text:{...s.text,onColors:{...cn(s.text.onColors),primary:c,[ht(o)]:c,[o]:c}}}},[t,n,o]);return e?e(r):r}function jo(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);}},Aa=(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=me.useContext(qr),i=me.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=me.useMemo(()=>c??Ia(m.current),[c]),f=me.useMemo(()=>Ia(a),[]);me.useLayoutEffect(()=>{f.get()!==a&&f.set(a);},[a,f]);let T=useRef(null),k=useRef(0),y=useRef(r??"__root__");me.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=jo(Vo,t),g=jo(E,t?.light),v=t?.light?.primaryKey??a,L=ht(v),H=g.palette.primary??g.palette[L]??g.palette.mono,O=cn({...Ko(g.neutral).onColors,...g.text.onColors}),_=O[L]??Xr(H[600]),N=t?.surface||t?.light?.surface?g.surface:Qn("light",g.neutral),G={...t?.text||t?.light?.text?g.text:Ko(g.neutral),onColors:cn({...O,primary:_,[L]:_})};return {...g,palette:{...g.palette,primary:H},surface:N,text:G}},[t,a]),b=useMemo(()=>{let E=jo(Ea,t),g=jo(E,t?.dark),v=t?.dark?.primaryKey??a,L=ht(v),H=g.palette.primary??g.palette[L]??g.palette.mono,O=cn({..._o(g.neutral).onColors,...g.text.onColors}),_=O[L]??Xr(H[600]),N=t?.surface||t?.dark?.surface?g.surface:Qn("dark",g.neutral),G={...t?.text||t?.dark?.text?g.text:_o(g.neutral),onColors:cn({...O,primary:_,[L]:_})};return {...g,palette:{...g.palette,primary:H},surface:N,text:G}},[t,a]),d=useRef(null),p=useRef(null),C=me.useInsertionEffect||me.useLayoutEffect,M=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,ht(E),"light"),H=Uo(b,ht(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);me.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()};},[]),A=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,ht(H),L);Aa(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()},[$]);me.useEffect(()=>{let E=A(),g=W();return ()=>{E(),g();}},[A,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]),F=useCallback(E=>{let g=ht(f.get()),L=Yr(E==="light"?x:b,g,E);document.querySelectorAll(`[data-pfui-portal-owner="${y.current}"]`).forEach(H=>{Aa(H,L),qo(H,E),H.setAttribute("data-pfui-mode",E),H.setAttribute("data-pfui-primary",g);});},[x,b,f]);me.useLayoutEffect(()=>{F(h.get());},[F,x,b,a,h]),me.useLayoutEffect(()=>{if(!l)return;let E=()=>{let v=h.get();M(),S(v),F(v);};E();let g=h.subscribe(E);return ()=>g()},[l,h,M,S,F]);let I=useCallback(E=>{if(h.get()!==E&&(M(),h.set(E),S(E),F(E),!s))try{let g=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...g,mode:E}));}catch{}},[h,s,o,M,S,F]),P=useCallback(()=>I(h.get()==="light"?"dark":"light"),[I,h]),D=useCallback(E=>{f.set(E);let g=Ur(r),v=Uo(x,ht(E),"light"),L=Uo(b,ht(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);}`:"")),M();let H=h.get();if(S(H),F(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,M,S,F]),B=l?i:{setMode:I,toggleMode:P},z=jsx(Da.Provider,{value:{light:x,dark:b},children:jsx(qr.Provider,{value:h,children:jsx(Ma.Provider,{value:f,children:jsx(Gr.Provider,{value:B,children:jsx(Pa.Provider,{value:{setPrimary:D},children:jsx(ThemeProvider,{theme:wc(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 wc(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(cn(e.text.onColors)).map(l=>[l,`var(--pf-text-on-${l})`]))}}}var Ec=(e,t)=>{let n=e?.palette??{};return !t||t==="neutral"?"neutral":n[t]?t:"neutral"},Ha=(e,t)=>{let n=Ec(e,t);if(n==="neutral")return {soft:"var(--pf-focus-soft)",main:"var(--pf-focus-main)"};let o=e?.palette?.[n];return o?{soft:o[300]??"transparent",main:o[600]??o[500]??"currentColor"}:{soft:"var(--pf-focus-soft)",main:"var(--pf-focus-main)"}};function xe(){let e=V();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=V();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=V(),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=V(),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=V(),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=xe(),[M,R]=useState(0),[w,A]=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();},F=()=>{s||(S(),x?n?.(!e):d(N=>{let U=!N;return n?.(U),U}));},I=me.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(()=>{M>0&&!w&&A(true);},[M,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?M||"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||F();},onKeyDown:N=>{s||document.activeElement===W.current&&N.target===W.current&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),F());},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 Lc=e=>isValidElement(e),Bc=e=>Lc(e)?e.type?.displayName||e.type?.name:void 0,_a=e=>Bc(e)==="Accordion",$c=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,zc=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,Va=({children:e,attached:t=false,variant:n,exclusive:o=false,openIndex:r,defaultOpenIndex:s,onOpenIndexChange:a,disabled:c=false,width:i,fullWidth:l=false,className:u,role:m="group",css:h})=>{let f=V(),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 F=0;F<y.length;F++){let I=y[F].props;if(I.open||I.defaultOpen)return F}return null}),C=o?b?r??null:d:null,M=zc(f.componentHeights?.border,1),R=f.surface.border,w=f.radius.md,A=n,$=A==="outlined";useEffect(()=>{let F=T.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,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 F.addEventListener("keydown",I),()=>F.removeEventListener("keydown",I)},[x]);let K=css({display:"flex",flexDirection:"column",maxWidth:i!=null?$c(i):void 0,width:l?"100%":i!=null?void 0:"auto",gap:t?0:f.spacing.sm,border:t&&$?`${M} solid ${R}`:"none",borderRadius:t&&$?w: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,E=c||!!P.disabled,g=A??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:`${M} 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(F,{...P,...O,key:F?.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})};Va.displayName="AccordionGroup";var Ut=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=V(),d=useRef(null),p=useRef(null),C=useRef(false),M=useRef(t),R=n.horizontal??"center",w=n.vertical??"bottom",A=g=>typeof g=="string"?b.spacing[g]??g:g,$=g=>typeof g=="string"?b.radius[g]??g:g,K=Ut(A(c)),W=Ut(A(i)),S=Ut(A(l)),F={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:Ut(A(r)),background:m?"transparent":b.surface.panelBg,border:m?"none":`1px solid ${b.surface.border}`,borderRadius:m?0:Ut($(a)),boxShadow:m||!u?"none":"0 20px 40px rgba(0,0,0,.08)",display:"flex",flexDirection:o==="vertical"?"column":"row",gap:Ut(A(s)),transformOrigin:I(),pointerEvents:t?"auto":"none",width:h?"calc(100% - 48px)":f?Ut(f):"auto",height:T?Ut(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,M.current=t,g.style.opacity=t?"1":"0",g.style.transform=t?L:v;return}if(M.current===t){g.style.opacity=t?"1":"0",g.style.transform=t?L:v;return}M.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:F,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); }`,Uc=keyframes`
|
|
6
6
|
0% { left: -35%; right: 100%; }
|
|
7
7
|
60% { left: 100%; right: -90%; }
|
|
8
8
|
100% { left: 100%; right: -90%; }
|
|
9
|
-
`,
|
|
9
|
+
`,qc=keyframes`
|
|
10
10
|
0% { left: -200%; right: 100%; }
|
|
11
11
|
60% { left: 107%; right: -8%; }
|
|
12
12
|
100% { left: 107%; right: -8%; }
|
|
13
|
-
`,Xc=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("),Yc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Jc(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(Xc(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]&&Yc.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=pe.memo(({variant:e="circular",value:t,min:n=0,max:o=100,color:r,size:s,thickness:a,spinDuration:c=.75,wrapperCss:i,trackCss:f,barCss:l,circleCss:p,"aria-label":b})=>{let m=U(),C=typeof t=="number",F=Math.max(o-n,1),h=C?qa(t,n,o):void 0,y=C?(h-n)/F*100:void 0,g=Jc(m,r),u=m.surface.subtleBg,d=m.radius?.md;return e==="circular"?jsx(Qc,{size:s,active:g,isDeterminate:C,percent:y,spinDuration:c,wrapperCss:i,trackCss:f,circleCss:p,ariaLabel:b,thickness:a}):jsx(Zc,{thickness:a,active:g,track:u,radius:d,isDeterminate:C,percent:y,wrapperCss:i,trackCss:f,barCss:l,ariaLabel:b,min:n,max:o,value:h})}),Zc=({thickness:e=4,active:t,track:n,radius:o,isDeterminate:r,percent:s,wrapperCss:a,trackCss:c,barCss:i,ariaLabel:f,min:l,max:p,value:b})=>{let m=o==null?"8px":typeof o=="number"?`${o}px`:String(o),C=css([{display:"inline-block",width:"100%"},...Array.isArray(a)?a:a?[a]:[]]),F=css([{position:"relative",width:"100%",height:os(e,"6px"),backgroundColor:n,borderRadius:m,overflow:"hidden"},...Array.isArray(c)?c:c?[c]:[]]),h=r?Math.max(s??0,Ua):Ua,y=css([{position:"absolute",inset:0,backgroundColor:t,borderRadius:"inherit",transformOrigin:"left",transform:`scaleX(${h/100})`,transition:"transform 160ms cubic-bezier(.2,0,.2,1)",willChange:"transform"},...Array.isArray(i)?i:i?[i]:[]]),g={position:"absolute",top:0,bottom:0,backgroundColor:t,borderRadius:"inherit",willChange:"left,right","@media (prefers-reduced-motion: reduce)":{animation:"none"}},u=css([{...g,left:"-35%",right:"100%",animation:`${qc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(i)?i:i?[i]:[]]),d=css([{...g,left:"-200%",right:"100%",animation:`${Gc} 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite`},...Array.isArray(i)?i:i?[i]:[]]),x=r?{role:"progressbar","aria-valuemin":l,"aria-valuemax":p,"aria-valuenow":b}:{role:"progressbar","aria-busy":true};return f&&(x["aria-label"]=f),jsx("span",{css:C,...x,children:jsx("div",{className:"plainframe-ui-progress-linear-track",css:F,children:r?jsx("div",{className:"plainframe-ui-progress-linear-fill",css:y}):jsxs(Fragment,{children:[jsx("div",{className:"plainframe-ui-progress-linear-runner1",css:u}),jsx("div",{className:"plainframe-ui-progress-linear-runner2",css:d})]})})})},Qc=({size:e,thickness:t=4,active:n,isDeterminate:o,percent:r,spinDuration:s,wrapperCss:a,trackCss:c,circleCss:i,ariaLabel:f})=>{let l=U(),p=40,b=(p-t)/2,m=2*Math.PI*b,F=`${(o?qa((r??0)/100,.01,1):.7)*m} ${m}`,h=css([{display:"inline-block",width:os(e,`${l.componentHeights.md}`),height:os(e,`${l.componentHeights.md}`)},...Array.isArray(a)?a:a?[a]:[]]),y=css([{width:"100%",height:"100%",transform:"rotate(-90deg)",transformBox:"fill-box",transformOrigin:"50% 50%"},...Array.isArray(c)?c:c?[c]:[]]),g=css([{stroke:n,strokeLinecap:"butt",strokeDasharray:F,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":`${Uc} ${s}s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}},...Array.isArray(i)?i:i?[i]:[]]),u=o?{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r??0)}:{role:"progressbar","aria-busy":true};return f&&(u["aria-label"]=f),jsx("span",{css:h,className:"plainframe-ui-progress-circular",...u,children:jsx("svg",{css:y,viewBox:`0 0 ${p} ${p}`,focusable:"false","aria-hidden":true,children:jsx("circle",{cx:p/2,cy:p/2,r:b,strokeWidth:t,css:g})})})};var Ya=createContext(null),Ja=()=>{let e=useContext(Ya);if(!e)throw new Error("AlertTitle and AlertDescription must be used inside <Alert>.");return e},cu=css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),uu=css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto"}),du=css({display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none",background:"transparent",padding:0,cursor:"pointer",lineHeight:0,transition:"opacity 140ms ease","&:disabled":{cursor:"not-allowed",opacity:.5}}),Za=forwardRef(function({intent:t="neutral",variant:n="soft",intentIcon:o,closeIcon:r,onClose:s,width:a="100%",size:c="md",loading:i=false,css:f,children:l,...p},b){let m=U(),C=useId(),F=useId(),h=useMemo(()=>{let A={sm:{paddingX:m.spacing?.md,paddingY:m.spacing?.md,gap:m.spacing?.sm,radius:m.radius?.md,fontSize:m.typography?.sizes?.xs,titleWeight:600,iconSize:16},md:{paddingX:m.spacing?.lg,paddingY:m.spacing?.lg,gap:m.spacing?.md,radius:m.radius?.md,fontSize:m.typography?.sizes?.sm,titleWeight:600,iconSize:20},lg:{paddingX:m.spacing?.lg,paddingY:m.spacing?.lg,gap:m.spacing?.md,radius:m.radius?.md,fontSize:m.typography?.sizes?.md,titleWeight:600,iconSize:24}};return ["sm","md","lg"].includes(c)?A[c]:A.md},[c,m.typography,m.radius,m.spacing]),y=m.palette??{},g=m.neutral??{},u=useMemo(()=>{let w=(k=>k==="danger"?y.danger??y.error??g:k==="warning"?y.warning??g:k==="success"?y.success??g:k==="info"?y.info??y.primary??g:g)(t),D=w?.[50]??g[50],H=w?.[300]??g[300],L=w?.[600]??w?.[500]??g[600],O=w?.[700]??L,$=w?.[800]??m.text?.primary??"#000",S=m.text?.onColors?.[t]??m.text?.onColors?.primary??m.text?.primary??"#fff";return n==="filled"?{bg:L,fg:S,border:void 0,iconColor:S}:n==="outlined"?{bg:D,fg:$,border:`1px solid ${H}`,iconColor:$}:n==="ghost"?{bg:"transparent",fg:O,border:"none",iconColor:O}:{bg:D,fg:$,border:void 0,iconColor:O}},[t,n,g,y,m.text]),d=t==="danger"||t==="warning"?"alert":"status",x=useMemo(()=>i?jsx(Qn,{variant:"circular",color:u.iconColor,size:h.iconSize/1.25,thickness:4.5}):o??(t==="danger"?jsx(CircleAlert,{css:{width:h.iconSize,height:h.iconSize},color:u.iconColor}):t==="warning"?jsx(TriangleAlert,{css:{width:h.iconSize,height:h.iconSize},color:u.iconColor}):t==="success"?jsx(CircleCheckBig,{css:{width:h.iconSize,height:h.iconSize},color:u.iconColor}):jsx(Info,{css:{width:h.iconSize,height:h.iconSize},color:u.iconColor})),[i,o,t,h.iconSize,u.iconColor]),N=useMemo(()=>css({display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:`${h.paddingY} ${h.paddingX}`,gap:h.gap,borderRadius:h.radius,backgroundColor:u.bg,color:u.fg,border:u.border,fontSize:h.fontSize,fontWeight:500,maxWidth:typeof a=="number"?`${a}px`:a,width:"100%"}),[u.bg,u.border,u.fg,h.fontSize,h.gap,h.paddingX,h.paddingY,h.radius,a]),v=useMemo(()=>css({display:"flex",alignItems:"flex-start",gap:h.gap,minWidth:0,flex:1}),[h.gap]),R=useMemo(()=>[uu,{color:u.iconColor}],[u.iconColor]),M=useMemo(()=>css({display:"flex",alignItems:"center",gap:h.gap,marginLeft:h.gap,flex:"0 0 auto"}),[h.gap]),B=useMemo(()=>[du,{color:u.fg}],[u.fg]),_=useMemo(()=>({fg:u.fg,iconColor:u.iconColor,s:h,titleId:C,descId:F}),[u.fg,u.iconColor,h,C,F]),K=pe.Children.toArray(l).some(A=>pe.isValidElement(A)&&A.type===as),E=pe.Children.toArray(l).some(A=>pe.isValidElement(A)&&A.type===is);return jsx(Ya.Provider,{value:_,children:jsxs("div",{ref:b,role:d,"aria-live":d==="alert"?"assertive":"polite","aria-atomic":"true","aria-busy":i,"aria-labelledby":K?C:void 0,"aria-describedby":E?F:void 0,className:`plainframe-ui-alert plainframe-ui-alert-${t} plainframe-ui-alert-${n}`,css:[N,f],...p,children:[jsxs("div",{className:"plainframe-ui-alert-left",css:v,children:[x&&jsx("span",{className:"plainframe-ui-alert-icon",css:R,children:x}),jsx("div",{className:"plainframe-ui-alert-content",css:cu,children:l})]}),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:B,children:r??jsx(X,{strokeWidth:2,size:h.iconSize-2})})})]})})});Za.displayName="Alert";var as=forwardRef(function({children:t,css:n,...o},r){let{fg:s,s:a,titleId:c}=Ja(),i=useMemo(()=>css({color:s,fontWeight:a.titleWeight,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),[s,a.titleWeight]);return jsx("span",{ref:r,id:c,className:"plainframe-ui-alert-title",css:[i,n],...o,children:t})});as.displayName="AlertTitle";var is=forwardRef(function({children:t,css:n,...o},r){let{fg:s,descId:a}=Ja(),c=useMemo(()=>css({color:s,marginTop:2,lineHeight:1.35,wordBreak:"break-word"}),[s]);return jsx("span",{ref:r,id:a,className:"plainframe-ui-alert-desc",css:[c,n],...o,children:t})});is.displayName="AlertDescription";var ls=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Jt=e=>e==null?[]:Array.isArray(e)?e:[e],Zt=(...e)=>css(e.filter(Boolean));function ei(e,t,n="currentColor"){if(!isValidElement(e))return e;let o=e.props,r={};o.size==null&&(r.size=t),o.color==null&&(r.color=n);let s=o.style;return s?.fontSize==null&&(r.style={...s||{},fontSize:t}),cloneElement(e,{...o,...r})}var er=pe.memo(forwardRef(function({label:t,value:n,defaultValue:o="",onChange:r,placeholder:s,error:a,helperText:c,disabled:i=false,fullWidth:f=false,width:l=250,size:p="md",variant:b="subtle",rounded:m=false,startIcon:C,endIcon:F,togglePasswordVisible:h=false,showClear:y,type:g="text",step:u,focusRingMode:d="always",className:x,wrapperCss:N,inputCss:v,labelCss:R,helperRowCss:M,helperTextCss:B,startIconCss:_,endIconCss:K,css:E,onBlur:A,onFocus:w,onKeyDown:D,autoFocus:H,name:L,id:O,tabIndex:$,autoComplete:S,readOnly:k,required:W,maxLength:T,onSurfaceClick:I},z){let P=U(),j=Jo(),q=useId(),te=useMemo(()=>{let ue={sm:{fontSize:P.typography.sizes.sm,minHeight:P.componentHeights.sm,labelFont:P.typography.sizes.xs,helperFont:P.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:P.spacing.md,iconSize:P.typography.sizes.xs,codeFontSize:21},md:{fontSize:P.typography.sizes.sm,minHeight:P.componentHeights.md,labelFont:P.typography.sizes.sm,helperFont:P.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:P.spacing.md,iconSize:P.typography.sizes.xs,codeFontSize:24},lg:{fontSize:P.typography.sizes.sm,minHeight:P.componentHeights.lg,labelFont:P.typography.sizes.md,helperFont:P.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:P.spacing.md,iconSize:P.typography.sizes.xs,codeFontSize:28}},Ee=["sm","md","lg"].includes(p)?p:"md";return ue[Ee]},[p,P]),V=P.neutral,Y=P.text,ie=g==="number",ce=g==="password",me=n!==void 0,[De,Re]=useState(o),Ce=me?n:De,ke=useCallback(ue=>{me||Re(ue),r?.(ue);},[me,r]),Te=/^-?\d*(?:[.,]\d*)?$/,Q=ie&&(u!=null&&String(u).includes(".")||/[.,]/.test(Ce??"")),le=ie?Q?"decimal":"numeric":void 0,he=ie?Q?"[0-9]*[.,]?[0-9]*":"[0-9]*":void 0,J=useCallback(ue=>{(ue===""||Te.test(ue))&&ke(ue);},[ke]),xe=i?V[200]:a&&b==="outlined"?P.palette.danger?.[50]??P.surface.panelBg:a&&b==="subtle"?P.palette.danger?.[50]??P.surface.subtleBg:b==="outlined"?P.surface.panelBg:b==="subtle"?P.surface.subtleBg:"transparent",ee=P.componentHeights.border,re=b==="outlined"?`${ee} solid ${a?P.palette.danger?.[300]??P.surface.border:P.surface.border}`:"none",ae=Zt({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:f?"100%":l!=null?ls(l):void 0,flex:"0 0 auto",fontWeight:500}),fe=useMemo(()=>Zt({fontSize:te.labelFont,fontWeight:500,color:a?P.palette.danger?.[700]??Y.primary:i?V[500]:Y.primary,marginBottom:4,display:"inline-block"},...Jt(R)),[te.labelFont,a,i,V,Y,P.palette.danger,R]),He=useMemo(()=>Zt({display:"flex",alignItems:"center",gap:P.spacing.sm,padding:`${ls(te.paddingY)} ${ls(te.paddingX)}`,background:xe,border:re,borderRadius:m?P.radius.full:P.radius.md,minHeight:te.minHeight,boxSizing:"border-box",width:"100%",cursor:i?"not-allowed":"text",opacity:i?.65:1,transition:"box-shadow .18s, border-color .16s"},...Jt(N),...Jt(E)),[P,te.minHeight,te.paddingX,te.paddingY,xe,re,m,i,N,E]),Oe=useMemo(()=>Zt({flex:1,minWidth:0,fontSize:te.fontSize,fontWeight:500,fontFamily:"inherit",color:i?V[500]:a?P.palette.danger?.[800]??Y.primary:Y.primary,background:"transparent",border:"none",outline:"none",padding:0,lineHeight:1.25,cursor:i?"not-allowed":"text",appearance:ie?"textfield":"auto","&::placeholder":{color:a?P.palette.danger?.[700]??Y.secondary:Y.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${a?P.palette.danger?.[800]??Y.primary:Y.primary} !important`,boxShadow:`0 0 0 1000px ${xe} inset !important`,transition:"opacity 99999s ease-out",caretColor:a?P.palette.danger?.[800]??Y.primary:Y.primary},":focus-within":{outline:"none",border:"none",boxShadow:"none"}},...Jt(v)),[te.fontSize,i,V,Y,a,P.palette.danger,ie,xe,v]),X$1=useMemo(()=>Zt({display:"inline-flex",alignItems:"center",color:a?P.palette.danger?.[800]??Y.secondary:Y.secondary,marginLeft:-3},...Jt(_)),[a,P.palette.danger,Y.secondary,_]),se=useMemo(()=>Zt({display:"inline-flex",alignItems:"center",color:a?P.palette.danger?.[800]??Y.secondary:Y.secondary,border:"none",background:"transparent",lineHeight:0,cursor:"inherit",padding:0},...Jt(K)),[a,P.palette.danger,Y.secondary,i,K]),Z=useMemo(()=>Zt({minHeight:16,fontSize:te.helperFont,color:a?P.palette.danger?.[700]??Y.secondary:Y.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Jt(M)),[te.helperFont,a,P.palette.danger,Y.secondary,M]),de=useMemo(()=>Zt({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},...Jt(B)),[B]),we=useRef(null),Le=useCallback(ue=>{we.current=ue,z&&(typeof z=="function"?z(ue):z.current=ue);},[z]),lt=useCallback(ue=>{let Ee=ue.target.value;if(ie){J(Ee);return}T&&Ee.length>T||ke(Ee);},[ie,T,ke,J]),[Ie,et]=useState(false),Me=useCallback(()=>{i||et(ue=>!ue);},[i]),ct=useCallback(()=>{i||(ke(""),we.current?.focus());},[i,ke]),Ue=useMemo(()=>{let ue=te.fontSize;if(typeof ue=="number")return ue;let Ee=parseFloat(String(ue));return Number.isFinite(Ee)?Ee:16},[te.fontSize]),tt=useMemo(()=>C?jsx("span",{css:X$1,children:ei(C,Ue)}):null,[C,X$1,Ue]),At=useMemo(()=>css({display:"flex",alignItems:"center",gap:4}),[]),Po=useMemo(()=>{let ue=[];if(ce&&h){let ft=Ie?jsx(Eye,{strokeWidth:2.5,size:Ue}):jsx(EyeOff,{strokeWidth:2.5,size:Ue});ue.push(jsx("button",{type:"button",css:se,onMouseDown:Yn=>Yn.preventDefault(),onClick:Yn=>{Yn.stopPropagation(),Me();},tabIndex:-1,"aria-label":Ie?"Hide password":"Show password",disabled:i,children:ft},"pw-toggle"));}y&&Ce&&Ce.length>0&&!i&&ue.push(jsx("button",{type:"button",css:se,onMouseDown:ft=>ft.preventDefault(),onClick:ft=>{ft.stopPropagation(),ct();},tabIndex:-1,"aria-label":"Clear",children:jsx(X,{strokeWidth:2.5,size:Ue})},"clear"));let Ee=F?jsx("span",{css:se,children:ei(F,Ue)},"user-end"):null,rt=ue.length>0,Ne=!!Ee;return !rt&&!Ne?null:!rt&&Ne?Ee:rt&&!Ne?ue.length===1?ue[0]:jsx("span",{css:At,children:ue}):jsxs("span",{css:At,children:[ue,Ee]})},[ce,h,Ie,Ue,se,At,i,y,Ce,F,Me,ct]),Do=c!=null?`${O??q}-help`:void 0,Xn=O??q,Xe=useCallback(ue=>{if(i)return;ue.stopPropagation();let Ee=we.current;if(!Ee)return;let rt=ue.target;if(!(Ee.contains(rt)||rt.closest("button,[role='button']"))){if(document.activeElement===Ee){ue.preventDefault();return}ue.preventDefault();}},[i]),bt=useCallback(ue=>{if(i)return;let Ee=we.current;if(Ee&&(I?.(ue),document.activeElement!==Ee)){Ee.focus({preventScroll:true});try{let rt=Ee.value?.length??0;Ee.setSelectionRange?.(rt,rt);}catch{}}},[i,I]);return jsxs("div",{className:["plainframe-ui-textfield",x||""].join(" ").trim(),css:ae,children:[t&&jsx("label",{htmlFor:Xn,className:"plainframe-ui-textfield-label",css:fe,children:t}),jsxs("div",{className:"plainframe-ui-textfield-surface",css:[j({enabled:d!=="none",color:a?"danger":void 0}),He],onPointerDownCapture:Xe,onClick:bt,"aria-invalid":!!a||void 0,children:[tt,jsx("input",{ref:Le,id:Xn,className:"plainframe-ui-textfield-input",css:Oe,type:ce?Ie?"text":"password":g==="number"?"text":g,inputMode:le,pattern:he,value:Ce,maxLength:ie?void 0:T,onChange:ie?ue=>J(ue.target.value):lt,placeholder:s||"",disabled:i,onBlur:A,onFocus:w,onKeyDown:D,autoFocus:H,name:L,tabIndex:$,autoComplete:S,readOnly:k,required:W,"aria-invalid":!!a||void 0,"aria-describedby":Do}),Po]}),c!=null&&jsx("div",{className:"plainframe-ui-textfield-helper-row",css:Z,children:jsx("span",{id:Do,className:"plainframe-ui-textfield-helper-text",css:de,children:c})})]})}));er.displayName="TextField";var tr=pe.createContext("ghost"),Ct=pe.createContext(false),si=forwardRef(function({variant:t="ghost",size:n="md",width:o,maxHeight:r,unstyled:s=false,className:a,css:c,children:i,label:f,allItemsTabbable:l=false,...p},b){let m=U(),[C,F]=useState(false),h=useRef(null),y=typeof m.spacing.xs=="number"?`${m.spacing.xs}px`:String(m.spacing.xs),g=t==="outlined"?m.surface.panelBg:t==="subtle"?m.surface.subtleBg??m.neutral[50]:"transparent",u=s?void 0:css({background:g,border:t==="outlined"?`${m.componentHeights.border} solid ${m.surface.border}`:"none",borderRadius:m.radius.lg,"--pfui-panel-pad":y,padding:t==="ghost"?0:"var(--pfui-panel-pad)",color:m.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"}}),d=n==="sm",x=useMemo(()=>({isKeyboardNav:C,setIsKeyboardNav:F}),[C]),N=useMemo(()=>({allItemsTabbable:l}),[l]),v=useCallback(w=>Array.from(w.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(D=>{if(D.closest('[role="menu"]')!==w)return false;let H=window.getComputedStyle(D);return H.display!=="none"&&H.visibility!=="hidden"}),[]),R=useCallback(w=>{w.removeAttribute("data-keyboard-nav"),w.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),F(false);},[]),M=useRef(false),B=useCallback(w=>{if(w.target!==w.currentTarget)return;if(M.current){M.current=false;return}let D=w.currentTarget,H=v(D);H.length>0&&(F(true),D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(L=>L.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(L=>L.removeAttribute("data-hovered")),H[0].setAttribute("data-highlighted",""),H[0].focus({preventScroll:true}));},[v]),_=useCallback(w=>{let D=w.currentTarget,H=v(D);if(H.length===0)return;if(w.key==="Tab"){M.current=true,D.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(k=>k.removeAttribute("data-highlighted")),F(false),D.tabIndex=-1,requestAnimationFrame(()=>{D.tabIndex=0,M.current=false;});return}let L=D.querySelector("[data-highlighted]"),O=D.querySelector("[data-hovered]"),$=L||O,S=$?H.indexOf($):-1;if(w.key==="ArrowDown"||w.key==="ArrowUp"){w.preventDefault(),w.stopPropagation(),F(true),D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(T=>T.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(T=>T.removeAttribute("data-hovered")),S===-1&&(S=w.key==="ArrowDown"?-1:H.length);let k=w.key==="ArrowDown"?1:-1,W=(S+k+H.length)%H.length;H[W].setAttribute("data-highlighted",""),H[W].focus({preventScroll:true});return}if(w.key==="Home"){w.preventDefault(),w.stopPropagation(),F(true),D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(k=>k.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(k=>k.removeAttribute("data-hovered")),H[0].setAttribute("data-highlighted",""),H[0].focus({preventScroll:true});return}if(w.key==="End"){w.preventDefault(),w.stopPropagation(),F(true),D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(k=>k.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(k=>k.removeAttribute("data-hovered")),H[H.length-1].setAttribute("data-highlighted",""),H[H.length-1].focus({preventScroll:true});return}if(w.key==="Escape"){w.preventDefault(),D.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(k=>k.removeAttribute("data-highlighted")),F(false),D.blur();return}},[v]),K=useCallback(w=>{let D=w.currentTarget;D.hasAttribute("data-keyboard-nav")&&R(D);},[R]),E=useCallback(w=>{let D=w.currentTarget;D.hasAttribute("data-keyboard-nav")&&R(D);},[R]),A=useCallback(w=>{h.current=w,typeof b=="function"?b(w):b&&(b.current=w);},[b]);return jsx(eo.Provider,{value:x,children:jsx(to.Provider,{value:N,children:jsx(Ct.Provider,{value:d,children:jsx(tr.Provider,{value:t,children:jsxs("div",{css:{display:"flex",flexDirection:"column",gap:m.spacing.sm,width:"100%",maxWidth:o},children:[f?jsx("div",{css:{width:"100%",textAlign:"left"},children:jsx("span",{css:{display:"block",color:m.text.secondary,fontSize:m.typography.sizes.xs,fontWeight:600,textTransform:"uppercase",letterSpacing:".04em",padding:typeof m.spacing.sm=="number"?`${m.spacing.sm}px`:m.spacing.sm,paddingTop:0},children:f})}):null,jsx("div",{ref:A,role:"menu","data-keyboard-nav":C?"":void 0,tabIndex:0,"aria-label":f||void 0,className:["plainframe-ui-menu",a||""].join(" ").trim(),css:[u,c],onFocus:B,onKeyDown:_,onPointerMove:K,onPointerDown:E,...p,children:i})]})})})})})});si.displayName="Menu";var ii=createContext(null),rr=()=>{let e=useContext(ii);if(!e)throw new Error("Popover components must be used inside <Popover>.");return e};function Ou(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var ro=(...e)=>t=>{for(let n of e)Ou(n,t);},us=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Wu=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]);},nr=(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}},Ku=({open:e,defaultOpen:t,onOpenChange:n,triggerOn:o="click",lockScroll:r=true,trapFocus:s=true,children:a})=>{let[c,i]=useState(!!t),f=e??c,l=h=>{e===void 0&&i(h),n?.(h);},p=useRef(null),b=useRef(null),m=(h=120)=>{b.current!=null&&window.clearTimeout(b.current),b.current=window.setTimeout(()=>l(false),h);},C=()=>{b.current!=null&&(window.clearTimeout(b.current),b.current=null);};Wu(r&&f),useEffect(()=>{if(!s||!f||typeof document>"u")return;let h=y=>{if(y.key!=="Tab")return;let g=document.querySelector(".plainframe-ui-popover");if(!g)return;let u=Array.from(g.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), [role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(v=>{let R=window.getComputedStyle(v);return R.display!=="none"&&R.visibility!=="hidden"});if(u.length===0)return;let d=u[0],x=u[u.length-1],N=document.activeElement;y.shiftKey&&N===d?(y.preventDefault(),x.focus()):!y.shiftKey&&N===x&&(y.preventDefault(),d.focus());};return document.addEventListener("keydown",h,true),()=>document.removeEventListener("keydown",h,true)},[s,f]);let F=useMemo(()=>({open:f,setOpen:l,triggerOn:o,referenceRef:p,scheduleClose:m,cancelClose:C}),[f,o]);return jsx(ii.Provider,{value:F,children:a})},li=forwardRef(({asChild:e=true,children:t,css:n},o)=>{let{open:r,setOpen:s,triggerOn:a,referenceRef:c,scheduleClose:i,cancelClose:f}=rr(),l=pe.Children.only(t),p=l.props||{},b=ro(c,o,l.ref),m=a==="click"?{onClick:F=>{F.stopPropagation(),s(!r),p.onClick?.(F);}}:{onMouseEnter:F=>{f(),r||s(true),p.onMouseEnter?.(F);},onMouseLeave:F=>{i(),p.onMouseLeave?.(F);}},C={"aria-haspopup":"dialog","aria-expanded":r};if(e){let F=l.props?.css;return pe.cloneElement(l,{...m,...C,ref:b,css:[F,n].filter(Boolean)})}return pe.createElement("button",{ref:b,type:"button",css:[n],...m,...C,children:l})});li.displayName="PopoverTrigger";var ci=forwardRef(({asChild:e=true,width:t,css:n,children:o},r)=>{let{referenceRef:s}=rr(),a=pe.Children.only(o),c=ro(s,r,a.ref);if(e){let f=a.props?.css;return pe.cloneElement(a,{ref:c,css:[f,n].filter(Boolean)})}let i=css({display:"inline-block",width:us(t),verticalAlign:"middle",...n});return jsx("span",{ref:c,css:i,children:a})});ci.displayName="PopoverAnchor";function _u(e){let t=e?.vertical??"bottom",n=e?.horizontal??"center";if(t==="top"||t==="bottom"){let s=t,a=n==="left"?"start":n==="right"?"end":"center";return a==="center"?s:`${s}-${a}`}let o=n==="left"?"left":"right",r="center";return r==="center"?o:`${o}-${r}`}var ui=forwardRef(({anchorOrigin:e={vertical:"bottom",horizontal:"center"},sideOffset:t=8,alignOffset:n=0,collisionPadding:o=8,unstyled:r=false,children:s,width:a,height:c,padding:i,paddingX:f,paddingY:l,radius:p="lg",css:b,...m},C)=>{let{open:F,setOpen:h,triggerOn:y,referenceRef:g,scheduleClose:u,cancelClose:d}=rr(),x=U(),N=_u(e),{refs:v,x:R,y:M,strategy:B,context:_}=useFloating({open:F,onOpenChange:h,whileElementsMounted:autoUpdate,placement:N,strategy:"fixed",middleware:[offset({mainAxis:t,crossAxis:n}),flip({padding:o}),shift({padding:o})]});useEffect(()=>{g.current&&v.setReference(g.current);},[v,g]);let K=useDismiss(_,{outsidePressEvent:"pointerdown",escapeKey:true}),E=useRole(_,{role:"dialog"}),{getFloatingProps:A}=useInteractions([K,E]),[w]=_.placement.split("-"),D=w,H=`${D==="left"?"right":D==="right"?"left":"center"} ${D==="top"?"bottom":D==="bottom"?"top":"center"}`,L=8,O=D==="top"?{y:L}:D==="bottom"?{y:-L}:D==="left"?{x:L}:{x:-L},$={initial:{opacity:0,scale:.96,...O},animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.96,...O},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"}}},S=x.surface.panelBg,k=x.text.primary,W=`${x.componentHeights.border} solid ${x.surface.border}`,T=nr(i,x.spacing),I=nr(f,x.spacing),z=nr(l,x.spacing),P={};T&&(P.padding=T),I&&(P.paddingInline=I),z&&(P.paddingBlock=z);let j=nr(p,x.radius)??x.radius.md,q="0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)",te=css({position:B,top:M??0,left:R??0,zIndex:1e3,transformOrigin:H,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:S,color:k,border:W,borderRadius:j,boxShadow:q,...P,...P.padding||P.paddingInline||P.paddingBlock?{}:{padding:typeof x.spacing?.sm=="number"?`${x.spacing.sm}px ${x.spacing.md}px`:`${x.spacing?.sm??"0.5rem"} ${x.spacing?.md??"1rem"}`}}),Y=y==="hover"?{onMouseEnter:d,onMouseLeave:()=>u()}:{},ie=ro(v.setFloating,C),ce=jsx(motion.div,{className:"plainframe-ui-popover",...A({...m,ref:ie,...Y}),...$,css:[te,V,b],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:F?ce:null})})});ui.displayName="PopoverContent";var ju=()=>{let e=rr();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var fs=pe.memo(forwardRef(function({checked:t,defaultChecked:n=false,onChange:o,disabled:r=false,size:s="md",label:a,className:c,css:i,trackCss:f,thumbCss:l,labelCss:p,...b},m){let C=U(),F=ye(),h={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}},y={slideMs:250,pressMs:150,easing:"ease"},g=t!==void 0,[u,d]=useState(n),x=g?!!t:u,[N,v]=useState(false);useEffect(()=>{if(r)return;v(true);let I=setTimeout(()=>v(false),y.pressMs);return ()=>clearTimeout(I)},[x,r]);let R=["sm","md","lg"].includes(s)?s:"md",M=h[R],B=`${y.slideMs}ms ${y.easing}`,_=C.palette?.primary?.[600]??C.neutral[900],K=C.neutral[300],E=x?_:K,A=x?C.text.onColors.primary:"#ffffff",{trackW:w,trackH:D,thumb:H}=M,L=(D-H)/2,O=css({display:"inline-flex",alignItems:"center",gap:M.labelGap,cursor:r?"not-allowed":"pointer",width:"fit-content",padding:C.spacing.xs,borderRadius:C.radius.sm,outline:"none"}),$=css({position:"relative",width:w,height:D,backgroundColor:E,borderRadius:C.radius.xl,transition:`background-color ${B}, opacity 120ms ease`,willChange:"background-color",cursor:r?"not-allowed":"pointer",opacity:r?.5:1}),S=css({position:"absolute",top:L,left:x?w-H-L:L,width:H,height:H,backgroundColor:A,borderRadius:C.radius.xl,transition:`left ${B}, transform ${B}, background-color 0.25s ease`,transform:N?"scaleX(1.2)":"scaleX(1)",transformOrigin:x?"right center":"left center"}),k=css({fontSize:C.typography.sizes.sm,fontWeight:500,color:r?C.text.muted:C.text.primary}),W=()=>{if(r)return;let I=!x;g||d(I),o?.(I);};return jsxs("label",{ref:m,role:"switch","aria-checked":x,"aria-disabled":r||void 0,"data-checked":x?"":void 0,"data-disabled":r?"":void 0,tabIndex:r?-1:0,onClick:W,onKeyDown:I=>{r||(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),W());},className:["plainframe-ui-switch",c||""].join(" ").trim(),css:[O,F({color:x?"primary":"neutral"}),i],...b,children:[jsx("div",{className:"plainframe-ui-switch-track",css:[$,f],children:jsx("div",{className:"plainframe-ui-switch-thumb",css:[S,l]})}),a!=null&&jsx("span",{className:"plainframe-ui-switch-label",css:[k,p],children:a})]})}));var Zu=(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},ar=pe.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:f="primary",css:l,boxCss:p,checkCss:b,labelCss:m,descriptionCss:C,className:F,...h},y)=>{let g=U(),u=ye(),d=typeof e=="boolean",[x,N]=useState(t),v=d?e:x,R=r==="sm"||r==="lg"?r:"md",M=useMemo(()=>Zu(g,R),[g,R]),{checkedBg:B,checkColor:_,borderCol:K,hoverBg:E,gapPx:A}=useMemo(()=>{let I=g.palette||{},z=g.neutral||{},P=g.text?.onColors||{},j,q;f==="neutral"||f==="secondary"?(j=z,q="neutral"):typeof f=="string"&&Object.prototype.hasOwnProperty.call(I,f)?(j=I[f]||I.primary||z,q=f):(j=I.primary||z,q="primary");let te=j[600]??j[500]??j[400]??Object.values(j)[0]??g.palette.primary[600],V=P[q]??P.primary??g.text?.onColors?.primary??g.text.primary,Y=typeof M.gap=="number"?M.gap+2:M.gap;return {checkedBg:te,checkColor:V,borderCol:g.surface.border,hoverBg:g.surface.panelHover,gapPx:Y}},[M.gap,f,g]),w=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:g.radius.sm,padding:g.spacing.xs,transition:"background-color .16s ease, color .16s ease, opacity .16s ease",'&:not([data-disabled="true"]):hover input:not(:checked) + .plainframe-ui-checkbox-box':{outlineColor:K,backgroundColor:E},"input:checked + .plainframe-ui-checkbox-box":{backgroundColor:B,outlineColor:B,"--pfui-bleed":B},'&:not([data-disabled="true"]):hover input:checked + .plainframe-ui-checkbox-box':{outlineColor:B,backgroundColor:B,"--pfui-bleed":B},".plainframe-ui-checkbox-check":{opacity:0,transform:"scale(0.2)"},"input:checked + .plainframe-ui-checkbox-box .plainframe-ui-checkbox-check":{opacity:1,transform:"scale(1)"}}),[K,B,a,o,A,E,s,g.radius.sm,g.spacing.xs]),D=useMemo(()=>css({position:"absolute",opacity:0,width:0,height:0,margin:0,padding:0,pointerEvents:"none"}),[]),H=useMemo(()=>css({width:M.box,height:M.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${M.borderWidth} solid ${K}`,outlineOffset:`-${M.borderWidth}`,boxShadow:"inset 0 0 0 0.5px var(--pfui-bleed, transparent)",borderRadius:c?g.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,K,c,g.radius.full]),L=useMemo(()=>({w:Math.round(M.box*M.iconRatioW),h:Math.round(M.box*M.iconRatioH)}),[M.box,M.iconRatioH,M.iconRatioW]),O=useMemo(()=>css({width:L.w,height:L.h,transition:"opacity .14s ease, transform .14s ease",color:_,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,pointerEvents:"none","& > svg, & > img":{width:"100%",height:"100%",display:"block"}}),[_,L.h,L.w]),$=useMemo(()=>css({display:"flex",flexDirection:"column",minWidth:0,userSelect:"text",WebkitUserSelect:"text"}),[]),S=useMemo(()=>css({fontSize:M.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:g.text.primary}),[M.labelFont,g.text.primary]),k=useMemo(()=>css({fontSize:M.labelFont,lineHeight:1.25,color:g.text.secondary,fontWeight:400,marginTop:s&&a?g.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[M.labelFont,a,s,g.spacing.xs,g.text.secondary]),W=useCallback(()=>{o||(d?n?.(!v):N(I=>{let z=!I;return n?.(z),z}));},[o,d,v,n]),T=useCallback(I=>{o||(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),W());},[o,W]);return jsxs("label",{ref:y,role:"checkbox","aria-checked":v,"aria-disabled":o||void 0,"data-state":v?"checked":"unchecked",className:["plainframe-ui-checkbox",F||""].join(" ").trim(),css:[w,u({color:v?"primary":"neutral"}),l,o?css({opacity:.6}):null],"data-disabled":o?"true":"false",tabIndex:o?-1:0,onKeyDown:T,children:[jsx("input",{type:"checkbox",checked:v,onChange:W,disabled:o,css:D,...h,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[H,p],"aria-hidden":"true",children:jsx("span",{className:"plainframe-ui-checkbox-check",css:[O,b],children:v&&(i||jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:_,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:$,children:[s&&jsx("span",{className:"plainframe-ui-checkbox-label",css:[S,m],children:s}),a&&jsx("span",{className:"plainframe-ui-checkbox-description",css:[k,C],children:a})]})]})}));ar.displayName="Checkbox";var td=()=>useContext(mn),nd=()=>useContext(to),od=()=>useContext(ur),dn=null,gi=(e,t=35)=>{dn!==null&&window.clearTimeout(dn),dn=window.setTimeout(()=>{e(),dn=null;},t);},so=()=>{dn!==null&&(window.clearTimeout(dn),dn=null);},Nt=pe.forwardRef(function({disabled:t=false,destructive:n=false,inset:o,closeOnSelect:r=true,onSelect:s,children:a,className:c,css:i,startIcon:f,endIcon:l,selected:p=false,active:b,meta:m,__index:C,__skipListReg:F,...h},y){let g=td(),u=od(),d=cr(),x=io(),N=nd(),v=U(),M=!!useContext(Ct),B=h["data-subtrigger"]!==void 0,_=B&&l===void 0?jsx(ChevronRight,{size:18,strokeWidth:2.5}):l,E=typeof o=="number"?o:o===false?0:0,A=useContext(tr),w=A==="subtle"?v.surface?.subtleHover??v.neutral[100]:v.surface?.subtleBg??v.neutral[100],D=useMemo(()=>css({width:"100%",borderRadius:v.radius.md,padding:`${v.spacing.sm} ${v.spacing.sm}`,paddingLeft:E>0?`calc(${v.spacing.md} + (${v.spacing.xl} * ${E}))`:v.spacing.md,minHeight:M?v.componentHeights.sm:v.componentHeights.md,display:"flex",alignItems:"center",gap:v.spacing.sm,fontWeight:500,fontSize:v.typography.sizes.sm,cursor:t?"not-allowed":"pointer",opacity:t?.55:1,userSelect:"none",background:"transparent",color:n?v.palette.danger[800]:v.text.primary,transition:"background-color .16s ease, color .16s ease",outline:"none","[role='menu']:not([data-keyboard-nav]) &:hover":t?{}:{background:n?v.palette.danger[50]:w},"&[data-highlighted]":t?{}:{background:n?v.palette.danger[50]:w},"&[data-active]":t?{}:{background:n?v.palette.danger[50]:w},"&[data-subtrigger][aria-expanded='true']":t?{}:{background:n?v.palette.danger[50]:w},"[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:v.surface.border},"& > [data-label]":{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),[v,M,E,t,n,w]),H=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,"& > *":{flexShrink:0},"& > svg:only-child":{width:16,height:16,display:"block"}}),[]),L=useMemo(()=>css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,whiteSpace:"nowrap",lineHeight:0,gap:v.spacing.sm,"& > svg":{width:16,height:16,display:"block"},color:v.text.secondary}),[v.text.secondary,v.spacing.sm]),O=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:v.palette.primary[600],"& > svg":{width:16,height:16,display:"block"}}),[v.palette.primary]),$=[];M&&$.push({minHeight:v.componentHeights.sm,paddingLeft:v.spacing.sm,paddingRight:v.spacing.xs,paddingTop:v.spacing.xs,paddingBottom:v.spacing.xs});let S=()=>{s?.(),r&&!B&&u?.closeAll();},k=(T,I)=>{let z=T.closest('[role="menu"]');if(!z)return;let P=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(Y=>{if(Y.closest('[role="menu"]')!==z)return false;let ie=window.getComputedStyle(Y);return ie.display!=="none"&&ie.visibility!=="hidden"});if(!P.length)return;let j=P.indexOf(T),q=j>=0?j:0,te=I(P.length,q),V=P[te];V&&(document.querySelectorAll("[data-highlighted]").forEach(Y=>{Y.removeAttribute("data-highlighted");}),V.setAttribute("data-highlighted",""),V.focus(),g&&C!=null&&g.setActiveIndex(te));},W=t?-1:N?.allItemsTabbable?0:-1;return jsxs("div",{role:"menuitem","aria-disabled":t||void 0,"data-disabled":t?"":void 0,"data-active":b?"":void 0,tabIndex:W,ref:T=>{if(g&&!F){let I=g.listRef.current;T&&(C!=null?I[C]=T:I.includes(T)||I.push(T));}typeof y=="function"?y(T):y&&"current"in y&&(y.current=T);},onMouseMove:T=>{if(T.currentTarget.hasAttribute("data-hovered"))return;let I=!!T.currentTarget.closest("[data-submenu-content]");!B&&d&&!I&&gi(d.closeAllSubMenus),document.querySelectorAll("[data-hovered]").forEach(P=>{P.removeAttribute("data-hovered");}),document.querySelectorAll("[data-highlighted]").forEach(P=>{P.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-active]").forEach(P=>{P.removeAttribute("data-active");}),T.currentTarget.setAttribute("data-hovered","");let z=T.currentTarget.closest("[data-menu-id]")||T.currentTarget.closest('[role="menu"]');z?.hasAttribute("data-keyboard-nav")&&z.removeAttribute("data-keyboard-nav"),!t&&g&&C!=null&&g.setActiveIndex(C),!t&&!N?.allItemsTabbable&&T.currentTarget.focus({preventScroll:true});},onMouseEnter:T=>{if(B)so();else {let P=!!T.currentTarget.closest("[data-submenu-content]");d&&!P&&gi(d.closeAllSubMenus);}T.currentTarget.hasAttribute("data-hovered")||(document.querySelectorAll("[data-highlighted]").forEach(P=>{P.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-hovered]").forEach(P=>{P.removeAttribute("data-hovered");}),document.querySelectorAll("[data-active]").forEach(P=>{P.removeAttribute("data-active");})),T.currentTarget.setAttribute("data-hovered","");let z=T.currentTarget.closest("[data-menu-id]")||T.currentTarget.closest('[role="menu"]');!t&&g&&C!=null&&(z?.hasAttribute("data-keyboard-nav")&&(z.removeAttribute("data-keyboard-nav"),x&&x.setIsKeyboardNav(false)),g.setActiveIndex(C)),!t&&!N?.allItemsTabbable&&T.currentTarget.focus({preventScroll:true});},onFocus:()=>{},onMouseLeave:()=>{g&&g.setActiveIndex(null);},onKeyDown:T=>{if(t)return;let I=T.currentTarget;if(T.key==="Tab"&&g&&!N?.allItemsTabbable){T.preventDefault();return}if(T.key==="Tab"&&!g){let z=I.closest('[role="menu"]');if(z){z.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(j=>j.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(j=>j.removeAttribute("data-hovered"));let P=z.tabIndex;z.tabIndex=-1,requestAnimationFrame(()=>{z.tabIndex=P>=0?P:0;});}x&&x.setIsKeyboardNav(false);return}if(T.key==="Enter"||T.key===" "||T.key==="ArrowRight"){B||T.key!=="ArrowRight"&&(T.preventDefault(),T.stopPropagation(),S());return}if(T.key==="ArrowLeft"&&I.closest('[role="menu"]')?.closest("[data-submenu-content]")){T.preventDefault(),T.stopPropagation();let j=document.querySelector('[data-subtrigger][aria-expanded="true"]');if(j){let q=j.__pfuiCloseSubmenu;q&&q(),document.querySelectorAll("[data-highlighted]").forEach(V=>V.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(V=>V.removeAttribute("data-hovered")),j.setAttribute("data-highlighted",""),j.focus();let te=j.closest("[data-menu-id]");te&&te.setAttribute("data-keyboard-nav","");}return}if(T.key==="Escape"){T.preventDefault(),T.stopPropagation(),u?.closeAll(),I.closest('[role="menu"]')&&document.querySelector('[aria-expanded="true"][aria-haspopup="menu"]')?.focus();return}if(T.key==="ArrowDown"){T.preventDefault(),T.stopPropagation();let z=I.closest("[data-menu-id]")||I.closest('[role="menu"]');if(!z)return;z.setAttribute("data-keyboard-nav",""),x&&x.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(P=>P.removeAttribute("data-hovered")),k(I,(P,j)=>(j+1)%P);return}if(T.key==="ArrowUp"){T.preventDefault(),T.stopPropagation();let z=I.closest("[data-menu-id]")||I.closest('[role="menu"]');if(!z)return;z.setAttribute("data-keyboard-nav",""),x&&x.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(P=>P.removeAttribute("data-hovered")),k(I,(P,j)=>(j-1+P)%P);return}if(T.key==="Home"){T.preventDefault(),T.stopPropagation();let z=I.closest("[data-menu-id]")||I.closest('[role="menu"]');z&&z.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(P=>P.removeAttribute("data-hovered")),k(I,()=>0);return}if(T.key==="End"){T.preventDefault(),T.stopPropagation();let z=I.closest("[data-menu-id]")||I.closest('[role="menu"]');z&&z.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(P=>P.removeAttribute("data-hovered")),k(I,P=>P-1);return}},className:["plainframe-ui-menu-item",c||""].join(" ").trim(),css:css(...[D,...$,i].flat()),...h,onClick:T=>{t||(T.currentTarget.removeAttribute("data-highlighted"),S());},children:[f&&jsx("span",{className:"plainframe-ui-menu-item-start",css:H,children:f}),a,(m!=null||_||p)&&jsxs("span",{className:"plainframe-ui-menu-item-end",css:L,children:[m!=null?jsx("span",{className:"plainframe-ui-menu-item-meta",css:css({lineHeight:1,fontSize:v.typography.sizes.sm,color:v.text.secondary,whiteSpace:"nowrap"}),children:m}):null,_,p&&jsx("span",{className:"plainframe-ui-menu-item-selected",css:O,children:jsx(Check,{size:16,strokeWidth:2.5})})]})]})}),hi=pe.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 f=useRef(n);f.current=n;let l=useCallback(b=>{let m=i.current,F=m.some(h=>Object.is(h,b))?m.filter(h=>!Object.is(h,b)):[...m,b];a||s(F),f.current?.(F);},[a]),p=useMemo(()=>({values:c,toggle:l}),[c,l]);return jsx(hi.Provider,{value:p,children:o})},ao=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,value:r,children:s,__index:a,disabled:c=false,css:i,className:f,startIcon:l,endIcon:p,...b},m){let C=useContext(hi),F=!!C&&r!==void 0,h=!F&&t!==void 0,[y,g]=useState(()=>F?C.values.some(K=>Object.is(K,r)):!!n),u=F?C.values.some(K=>Object.is(K,r)):h?!!t:y,d=U(),N=!!useContext(Ct),v=()=>{if(!c)if(F)C.toggle(r);else {let K=!u;h||g(K),o?.(K);}},R=css({width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,marginLeft:N?-1:-3,borderRadius:d.radius.xs,transition:"background-color .12s ease"}),M=css({pointerEvents:"none"}),B=useCallback(K=>{K&&(K.querySelectorAll("[tabindex]").forEach(E=>{E.tabIndex=-1;}),K.querySelectorAll('input, button, a, [role="checkbox"]').forEach(E=>{E.tabIndex=-1;}));},[]),_=jsxs(Fragment,{children:[jsx("span",{ref:B,"data-menu-checkbox-wrapper":true,className:"plainframe-ui-menu-checkbox-wrapper",css:R,"aria-hidden":"true",children:jsx(ar,{size:"sm",checked:u,css:M})}),l]});return jsx(Nt,{...b,className:["plainframe-ui-menu-checkbox-item",f||""].join(" ").trim(),ref:m,__index:a,role:"menuitemcheckbox","aria-checked":u,closeOnSelect:false,onSelect:v,disabled:c,startIcon:_,endIcon:p,css:i,selected:false,children:s})});ao.displayName="MenuCheckboxItem";var yi=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,children:r,__index:s,disabled:a=false,css:c,switchSize:i="md",switchCss:f,startIcon:l,className:p,...b},m){let C=t!==void 0,[F,h]=useState(!!n),y=C?!!t:F,u=!!useContext(Ct),d=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),x=css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,paddingRight:u?2:void 0}),N=()=>{if(a)return;let R=!y;C||h(R),o?.(R);},v=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(Nt,{...b,className:["plainframe-ui-menu-switch-item",p||""].join(" ").trim(),ref:m,__index:s,disabled:a,closeOnSelect:false,onSelect:N,css:c,selected:false,children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:v,children:l}),jsx("span",{"data-label":true,css:d,className:"plainframe-ui-menu-item-label",children:r}),jsx("span",{className:"plainframe-ui-menu-switch-wrap",css:x,children:jsx(fs,{checked:y,css:css({pointerEvents:"none",padding:0,marginRight:-1},f),className:"plainframe-ui-menu-switch",tabIndex:-1,size:i})})]})});yi.displayName="MenuSwitchItem";var xi=pe.createContext(null),vi=({value:e,defaultValue:t,onValueChange:n,children:o})=>{let[r,s]=useState(t),a=e??r,c=f=>{e!==void 0||s(f),n?.(f);},i=useMemo(()=>({value:a,onChange:c}),[a]);return jsx(xi.Provider,{value:i,children:o})};vi.displayName="MenuRadioGroup";var rd=forwardRef(function({value:t,children:n,__index:o,disabled:r=false,css:s,className:a,...c},i){let f=useContext(xi),l=f?.value===t,p=U(),b=css({width:p.spacing.md,display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:-1}),m=css({width:7,height:7,borderRadius:"100%",backgroundColor:p.palette.primary[600],transform:l?"scale(1)":"scale(0.4)",opacity:l?1:0,transition:"transform 140ms ease-out, opacity 140ms linear",transformOrigin:"center center"}),C=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"});return jsxs(Nt,{...c,className:["plainframe-ui-menu-radio-item",a||""].join(" ").trim(),ref:i,__index:o,role:"menuitemradio","aria-checked":l,closeOnSelect:false,onSelect:()=>{r||f?.onChange?.(t);},disabled:r,css:s,selected:false,children:[jsx("span",{className:"plainframe-ui-menu-radio-dotbox",css:b,children:jsx("span",{className:"plainframe-ui-menu-radio-dot",css:m})}),jsx("span",{className:"plainframe-ui-menu-item-label",css:C,children:n})]})}),pn=forwardRef(function({inset:t,className:n,css:o,children:r,startIcon:s,endIcon:a,wrap:c=false,color:i="primary",...f},l){let p=U(),m=!!useContext(Ct),C=i==="primary"?p.text.primary:i==="secondary"?p.text.secondary:p.palette[i]?.[700]??p.text.primary,F=css({display:"flex",alignItems:"center",padding:m?`${p.spacing.sm} ${p.spacing.md}`:`${p.spacing.sm} ${p.spacing.md}`,fontSize:p.typography.sizes.sm,color:C,fontWeight:500,...t?{paddingLeft:`calc(${p.spacing.lg} * 2)`}:null,gap:p.spacing.xs}),h=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:c?"normal":"nowrap"}),y=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,padding:"0 3px 0 2px",marginLeft:-2,"& > svg":{width:16,height:16,display:"block"}}),g=css({display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,lineHeight:0,"& > svg":{width:16,height:16,display:"block"}});return jsxs("div",{ref:l,role:"presentation",className:["plainframe-ui-menu-label",n||""].join(" ").trim(),css:css(F,o),...f,children:[s&&jsx("span",{className:"plainframe-ui-menu-label-start",css:y,children:s}),jsx("span",{className:"plainframe-ui-menu-label-text",css:h,children:r}),a&&jsx("span",{className:"plainframe-ui-menu-label-end",css:g,children:a})]})});pn.displayName="MenuLabel";var sd=({className:e,css:t,variant:n="full",...o})=>{let r=U(),s=`var(--pfui-panel-pad, ${typeof r.spacing.xs=="number"?r.spacing.xs+"px":String(r.spacing.xs)})`,a=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:"calc(var(--pfui-panel-pad, 0px) * -1)",marginRight:"calc(var(--pfui-panel-pad, 0px) * -1)"}),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}),f=n==="full"?a:n==="middle"?c:i;return jsx("div",{role:"separator",className:["plainframe-ui-menu-separator",e||""].join(" ").trim(),css:css(f,t),...o})};var hs=ro,lo=0,dr=null,pr=null,yd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function xd(){if(!(typeof document>"u")){if(lo===0){let e=document.body;dr=e.style.overflow||"",pr=e.style.paddingRight||"";let t=yd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}lo+=1;}}function vd(){if(!(typeof document>"u")&&(lo>0&&(lo-=1),lo===0)){let e=document.body;dr!==null&&(e.style.overflow=dr),pr!==null&&(e.style.paddingRight=pr),dr=null,pr=null;}}var mn=createContext(null),mr=()=>{let e=useContext(mn);if(!e)throw new Error("DropdownMenu components must be used inside <DropdownMenu>.");return e},co=createContext(null),Cd=()=>useContext(co),eo=createContext(null),io=()=>useContext(eo),Ri=createContext(null),cr=()=>useContext(Ri),Ti=createContext(false),Rd=()=>useContext(Ti),to=createContext({allItemsTabbable:true}),ur=pe.createContext(null),ys=()=>useContext(ur);function Td(){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 wd=()=>Cd()?.activeIndex??null,wi=0,Nn=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="click",lockScroll:r=true,size:s="md",children:a})=>{let[c,i]=useState(!!t),f=e??c,l=useCallback(A=>{e===void 0&&i(A),n?.(A);},[e,n]),p=useRef(`pfui-menu-${++wi}`),b=useRef(null),m=useRef([]),C=useRef(null),[F,h]=useState(null),[y,g]=useState(false);useEffect(()=>{f||(h(null),m.current=[],g(false));},[f]);let u=useRef(null),d=useCallback((A,w)=>{if(o!=="hover")return;window.clearTimeout(u.current??0);let D=w??20;u.current=window.setTimeout(()=>l(A),D);},[o,l]),x=useCallback(()=>{u.current&&(window.clearTimeout(u.current),u.current=null);},[]);useEffect(()=>()=>x(),[x]),useEffect(()=>{if(!(!r||!f))return xd(),()=>vd()},[f,r]);let N=ys(),[v]=useState(()=>N??Td()),R=useRef(new Set),M=useMemo(()=>({registerSubMenu:A=>(R.current.add(A),()=>R.current.delete(A)),closeAllSubMenus:()=>{R.current.forEach(A=>A());}}),[]),B=useMemo(()=>({open:f,setOpen:l,trigger:o,referenceRef:b,listRef:m,floatingRef:C,setActiveIndex:h,scheduleSubmenuHover:d,clearSubmenuHover:x,menuId:p.current}),[f,l,o,h,d,x]),_=useMemo(()=>({activeIndex:F,setActiveIndex:h}),[F,h]),K=useMemo(()=>({isKeyboardNav:y,setIsKeyboardNav:g}),[y]),E=s==="sm";return jsx(ur.Provider,{value:v,children:jsx(Ct.Provider,{value:E,children:jsx(eo.Provider,{value:K,children:jsx(Ri.Provider,{value:M,children:jsx(co.Provider,{value:_,children:jsx(mn.Provider,{value:B,children:a})})})})})})};Nn.displayName="DropdownMenu";var Hn=pe.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:f,referenceRef:l,listRef:p,setActiveIndex:b,scheduleSubmenuHover:m,clearSubmenuHover:C,floatingRef:F,menuId:h}=mr(),y=io(),g=cr(),u=!!e&&isValidElement(t),d=u?t:null,x=d&&d.props&&typeof d.props=="object"&&"onKeyDown"in d.props?d.props.onKeyDown:void 0,N=d&&d.props&&typeof d.props=="object"&&"onClick"in d.props?d.props.onClick:void 0,{onKeyDown:v,onClick:R,...M}=s,B=useMemo(()=>hs(a,u&&isValidElement(t)&&"ref"in t?t.ref:void 0,l),[a,u,t,l]),_=useCallback(()=>p.current.filter(Boolean),[p]),K=useCallback(H=>{let L=_();requestAnimationFrame(()=>L[H]?.focus());},[_]),E=useCallback(H=>{if(H.key==="Tab"&&c){H.preventDefault(),y?.setIsKeyboardNav(true);let L=F?.current;if(L){L.setAttribute("data-keyboard-nav","");let O=L.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])');O&&(document.querySelectorAll("[data-highlighted]").forEach($=>$.removeAttribute("data-highlighted")),O.setAttribute("data-highlighted",""),O.focus());}return}if(H.key==="ArrowRight"&&c){let L=document.querySelector("[data-subtrigger][data-hovered]");if(L){H.preventDefault(),H.stopPropagation(),y?.setIsKeyboardNav(true),L.removeAttribute("data-hovered"),L.setAttribute("data-highlighted",""),L.focus(),requestAnimationFrame(()=>{let O=new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:true,cancelable:true});L.dispatchEvent(O);});return}}if(H.key==="ArrowDown"||H.key==="ArrowUp"){if(y?.setIsKeyboardNav(true),!c){H.preventDefault(),i(true),requestAnimationFrame(()=>{let L=h?document.querySelector(`[data-menu-id="${h}"]`):F?.current;if(L){L.setAttribute("data-keyboard-nav","");let O=Array.from(L.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($=>{let S=$.closest("[data-submenu-content]");if(S&&S!==L)return false;let k=window.getComputedStyle($);return k.display!=="none"&&k.visibility!=="hidden"});if(O.length>0){let $=H.key==="ArrowDown"?0:O.length-1;b($),O[$]?.setAttribute("data-highlighted",""),O[$]?.focus();}}}),x?.(H),v?.(H);return}if(c){H.preventDefault();let L=document.querySelectorAll("[data-hovered]");for(let $ of Array.from(L))if($.closest("[data-submenu-content]")){let k=$.closest('[role="menu"]');if(k){k.setAttribute("data-keyboard-nav","");let W=Array.from(k.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled])')).filter(I=>{if(I.closest('[role="menu"]')!==k)return false;let z=window.getComputedStyle(I);return z.display!=="none"&&z.visibility!=="hidden"}),T=W.indexOf($);if(document.querySelectorAll("[data-highlighted]").forEach(I=>I.removeAttribute("data-highlighted")),$.removeAttribute("data-hovered"),T!==-1&&W.length>0){let I=H.key==="ArrowDown"?1:-1,z=(T+I+W.length)%W.length;W[z]?.setAttribute("data-highlighted",""),W[z]?.focus();}return}}let O=h?document.querySelector(`[data-menu-id="${h}"]`):F?.current;if(O){O.setAttribute("data-keyboard-nav",""),g?.closeAllSubMenus();let $=Array.from(O.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(S=>{if(S.closest('[role="menu"]')!==O)return false;let k=window.getComputedStyle(S);return k.display!=="none"&&k.visibility!=="hidden"});if($.length>0){let S=O.querySelector("[data-highlighted]"),k=O.querySelector("[data-hovered]"),W=-1;S?W=$.indexOf(S):k&&(W=$.indexOf(k)),document.querySelectorAll("[data-highlighted]").forEach(z=>z.removeAttribute("data-highlighted")),k&&k.removeAttribute("data-hovered"),W===-1&&(W=H.key==="ArrowDown"?-1:$.length);let T=H.key==="ArrowDown"?1:-1,I=(W+T+$.length)%$.length;b(I),$[I]?.setAttribute("data-highlighted",""),$[I]?.focus();}}x?.(H),v?.(H);return}}if((H.key==="Enter"||H.key===" ")&&!c){H.preventDefault(),y?.setIsKeyboardNav(true),i(true),requestAnimationFrame(()=>{let L=h?document.querySelector(`[data-menu-id="${h}"]`):F?.current;if(L){L.setAttribute("data-keyboard-nav","");let O=Array.from(L.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($=>{let S=$.closest("[data-submenu-content]");if(S&&S!==L)return false;let k=window.getComputedStyle($);return k.display!=="none"&&k.visibility!=="hidden"});O.length>0&&(b(0),O[0]?.setAttribute("data-highlighted",""),O[0]?.focus());}}),x?.(H),v?.(H);return}x?.(H),v?.(H);},[c,i,b,x,v,_,K,p,y,h,F,g]),A=useCallback(H=>{f==="click"&&((H.nativeEvent.composedPath?.()??[]).some(S=>{let k=S;if(!k||!("tagName"in k))return false;let W=String(k.tagName).toUpperCase();if(W==="INPUT"||W==="TEXTAREA"||"isContentEditable"in k&&k.isContentEditable)return true;let T="getAttribute"in k?k.getAttribute("role"):null;return T==="textbox"||T==="combobox"})||(H.stopPropagation(),i(!c))),N?.(H),R?.(H);},[f,c,i,N,R]),w=f==="hover"?{onMouseEnter:()=>{C(),i(true);},onMouseLeave:()=>{m(false);}}:{},D=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0;if(u&&d){let H=d.props,L=H.css,O=typeof H.className=="string"?H.className:void 0,$=typeof H.tabIndex=="number"?H.tabIndex:0,S={ref:B,tabIndex:$,className:[O,o].filter(Boolean).join(" ")||void 0,css:[L,D,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,onClick:A,onKeyDown:E,...w,...M};return cloneElement(d,S)}return jsx("button",{ref:B,className:o,css:[css({display:"inline-block"}),D,r],type:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":c,onClick:A,onKeyDown:E,...w,...M,children:t})});Hn.displayName="DropdownMenuTrigger";var bn=pe.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:f,unstyled:l=false,closeOnBlur:p=false,allItemsTabbable:b=false,className:m,css:C,children:F,exitPlacement:h,animateOnBusClose:y=true,gap:g,ignoreOutsidePressRefs:u,disableOutsidePressDismiss:d=false,returnFocus:x=false,...N},v)=>{let{open:R,setOpen:M,referenceRef:B,clearSubmenuHover:_,setActiveIndex:K,floatingRef:E,menuId:A}=mr(),w=U(),D=ys(),H=io();useEffect(()=>{if(!D)return;let X=D.registerCloser(()=>M(false));return ()=>{X&&X();}},[D,M]);let L=typeof o=="string"?parseFloat(o):o,O=typeof r=="string"?parseFloat(r):r,$=typeof s=="string"?parseFloat(s):s,S=`${t}${n==="center"?"":`-${n}`}`,k=useCallback(X=>({getBoundingClientRect:()=>{let se=Math.round(X.x),Z=Math.round(X.y);return {x:se,y:Z,left:se,top:Z,right:se,bottom:Z,width:0,height:0,toJSON:()=>({x:se,y:Z,left:se,top:Z,right:se,bottom:Z,width:0,height:0})}},contextElement:void 0}),[]),W=useMemo(()=>{if(!e)return null;if(e instanceof HTMLElement||typeof e=="object"&&e!==null&&"getBoundingClientRect"in e&&typeof e.getBoundingClientRect=="function")return e;let X=e;return k({x:X.x,y:X.y})},[e,k]),{refs:T,x:I,y:z,strategy:P,context:j,update:q}=useFloating({open:R,onOpenChange:M,placement:S,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:L??0,crossAxis:O??0}),flip({padding:$??8}),shift({padding:$??8}),size({apply({rects:X,elements:se}){let Z=se.floating;Z.style.boxSizing="border-box",i!=null?Z.style.height=typeof i=="number"?`${i}px`:String(i):Z.style.removeProperty("height"),c!=null?Z.style.width=typeof c=="number"?`${c}px`:String(c):a?Z.style.width=`${Math.round(X.reference.width)}px`:Z.style.width="200px",f!=null?Z.style.maxHeight=typeof f=="number"?`${f}px`:String(f):Z.style.removeProperty("max-height");}})]});useEffect(()=>{W?T.setReference(W):B.current&&T.setReference(B.current);},[T,W,B]),useEffect(()=>{if(!R)return;let X=W||B.current,se=T.floating.current;if(!(!X||!se))return autoUpdate(X,se,q)},[R,W,B,T,q]),useEffect(()=>{q();},[q,a,c,i,f]),useEffect(()=>{R&&!b&&K(0);},[R,b,K]),useEffect(()=>{if(!p||!R)return;let X=()=>{let se=document.activeElement,Z=B.current,de=T.floating.current;se&&(Z?.contains(se)||de?.contains(se)||M(false));};return document.addEventListener("focusin",X,true),()=>document.removeEventListener("focusin",X,true)},[p,R,M,B,T.floating]);let te=useDismiss(j,{outsidePressEvent:"pointerdown",escapeKey:true,outsidePress:d?false:X=>{if(u?.length){let se=X.target;for(let Z of u)if(Z.current?.contains(se))return false}return true}}),V=useRole(j,{role:"menu"}),{getFloatingProps:Y}=useInteractions([te,V]),ie=useRef(false);useEffect(()=>{R?ie.current=true:ie.current&&B.current&&x&&(D?.isBusClosingRef.current||requestAnimationFrame(()=>{B.current?.focus();}));},[R,B,D,x]),useEffect(()=>{if(!R)return;let X=()=>{let de=E?.current;if(!de)return false;let we=B.current;if(!we)return false;let Le=we.closest("[data-pfui-portal-owner]");if(Le){let et=Le.getAttribute("data-pfui-portal-owner");if(!et)return false;if(de.getAttribute("data-pfui-portal-owner")===et)return true;de.setAttribute("data-pfui-portal-owner",et);let Me=Le.getAttribute("data-pfui-mode"),ct=Le.getAttribute("data-pfui-primary");Me&&de.setAttribute("data-pfui-mode",Me),ct&&de.setAttribute("data-pfui-primary",ct);for(let Ue=0;Ue<Le.style.length;Ue++){let tt=Le.style[Ue];tt.startsWith("--pf-")&&de.style.setProperty(tt,Le.style.getPropertyValue(tt));}return de.classList.remove("pf-light","pf-dark"),Le.classList.contains("pf-light")&&de.classList.add("pf-light"),Le.classList.contains("pf-dark")&&de.classList.add("pf-dark"),true}let lt=we.closest('[data-floating-ui-portal="true"]');if(lt&&!lt.hasAttribute("data-pfui-portal-owner"))return false;let Ie=we.closest("[data-pfui-scope]");if(Ie){let et=Ie.getAttribute("data-pfui-scope");if(!et)return false;let Me=document.querySelector(`[data-pfui-portal-owner="${et}"]`);if(Me&&Me!==de){de.setAttribute("data-pfui-portal-owner",et);let ct=Me.getAttribute("data-pfui-mode"),Ue=Me.getAttribute("data-pfui-primary");ct&&de.setAttribute("data-pfui-mode",ct),Ue&&de.setAttribute("data-pfui-primary",Ue);for(let tt=0;tt<Me.style.length;tt++){let At=Me.style[tt];At.startsWith("--pf-")&&de.style.setProperty(At,Me.style.getPropertyValue(At));}return de.classList.remove("pf-light","pf-dark"),Me.classList.contains("pf-light")&&de.classList.add("pf-light"),Me.classList.contains("pf-dark")&&de.classList.add("pf-dark"),true}}return false},se=[0,5,15,30,60,100,150,250],Z=[];return se.forEach(de=>{Z.push(window.setTimeout(()=>{X();},de));}),()=>{Z.forEach(de=>window.clearTimeout(de));}},[R,B,E]);let ce=typeof w.spacing.xs=="number"?`${w.spacing.xs}px`:String(w.spacing.xs),me=g===void 0?void 0:typeof g=="number"?g:w.spacing[g]??g,De=l?void 0:css({boxSizing:"border-box",background:w.surface.panelBg,border:`${w.componentHeights.border} solid ${w.surface.border}`,borderRadius:w.radius.lg,boxShadow:"0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)","--pfui-panel-pad":ce,padding:"var(--pfui-panel-pad)",color:w.text.primary,maxHeight:f,overflowY:"auto",display:"flex",flexDirection:"column",gap:me,"& > *":{flexShrink:0},"&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),Re=-1,Ce=X=>{if(!X||typeof X!="object"||!isValidElement(X))return X;let Z=X.type?.displayName;if(Z==="DropdownMenu"||Z==="DropdownMenuSub")return X;if(Z==="MenuItem"||Z==="MenuCheckboxItem"||Z==="MenuRadioItem"||Z==="MenuSwitchItem")return Re+=1,cloneElement(X,{__index:Re,key:X.key??Re});if(Z==="DropdownMenuTrigger"){let we=X.props.children;return cloneElement(X,{children:pe.Children.map(we,Ce)})}if(Z==="DropdownMenuSubTrigger"){Re+=1;let we=Re;return cloneElement(X,{__index:we,key:X.key??we})}let de=X.props.children;return de==null?X:cloneElement(X,{children:pe.Children.map(de,Ce)})},ke=pe.Children.map(F,Ce),Q=j.placement.split("-")[0]||"bottom",le=Q==="bottom"?"center top":Q==="top"?"center bottom":Q==="left"?"right center":"left center",he=Q==="bottom"?{opacity:0,y:-8,scale:.96}:Q==="top"?{opacity:0,y:8,scale:.96}:Q==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},J=h??Q,xe=J==="bottom"?{opacity:0,y:-8,scale:.96}:J==="top"?{opacity:0,y:8,scale:.96}:J==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},re=!!D?.isBusClosingRef.current&&!y?{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:P,top:z??0,left:I??0,zIndex:1e3,transformOrigin:le}),fe=useCallback(X=>{if(X.key==="Tab"){X.preventDefault();return}if(X.key==="ArrowDown"||X.key==="ArrowUp"){X.preventDefault(),H?.setIsKeyboardNav(true);let se=X.currentTarget;se.setAttribute("data-keyboard-nav","");let Z=Array.from(se.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(de=>{if(de.closest('[role="menu"]')!==se)return false;let we=window.getComputedStyle(de);return we.display!=="none"&&we.visibility!=="hidden"});if(Z.length>0){let de=se.querySelector("[data-highlighted]"),we=se.querySelector("[data-hovered]"),Le=-1;de?Le=Z.indexOf(de):we&&(Le=Z.indexOf(we)),document.querySelectorAll("[data-highlighted]").forEach(et=>et.removeAttribute("data-highlighted")),we&&we.removeAttribute("data-hovered"),Le===-1&&(Le=X.key==="ArrowDown"?-1:Z.length);let lt=X.key==="ArrowDown"?1:-1,Ie=(Le+lt+Z.length)%Z.length;K(Ie),Z[Ie]?.setAttribute("data-highlighted",""),Z[Ie]?.focus();}}},[H,K]),He=useCallback(X=>{let se=X.currentTarget;se.removeAttribute("data-keyboard-nav"),se.querySelectorAll("[data-highlighted]").forEach(Z=>Z.removeAttribute("data-highlighted")),H?.isKeyboardNav&&H.setIsKeyboardNav(false);},[H]),Oe=useCallback(X=>{X.removeAttribute("data-keyboard-nav"),X.querySelectorAll("[data-highlighted]").forEach(se=>se.removeAttribute("data-highlighted")),H?.isKeyboardNav&&H.setIsKeyboardNav(false);},[H]);return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:R?jsx(to.Provider,{value:{allItemsTabbable:b},children:jsx(motion.div,{...Y({...N,ref:hs(v,T.setFloating,X=>{if(E&&(E.current=X),X&&B.current){let Z=B.current.closest("[data-pfui-portal-owner]");if(Z){let de=Z.getAttribute("data-pfui-portal-owner");if(de){X.setAttribute("data-pfui-portal-owner",de);let we=Z.getAttribute("data-pfui-mode"),Le=Z.getAttribute("data-pfui-primary");we&&X.setAttribute("data-pfui-mode",we),Le&&X.setAttribute("data-pfui-primary",Le);for(let lt=0;lt<Z.style.length;lt++){let Ie=Z.style[lt];Ie.startsWith("--pf-")&&X.style.setProperty(Ie,Z.style.getPropertyValue(Ie));}Z.classList.contains("pf-light")&&X.classList.add("pf-light"),Z.classList.contains("pf-dark")&&X.classList.add("pf-dark");}}}})}),"data-menu-id":A,"data-keyboard-nav":H?.isKeyboardNav?"":void 0,className:m,css:[De,ae,C],initial:he,animate:{opacity:1,x:0,y:0,scale:1},exit:xe,transition:re,onPointerMove:X=>Oe(X.currentTarget),onPointerDown:X=>Oe(X.currentTarget),onKeyDown:fe,onMouseMove:He,onMouseEnter:()=>{_(),D?.clearAllHover();},onMouseLeave:()=>{document.querySelectorAll("[data-hovered]").forEach(X=>X.removeAttribute("data-hovered"));},children:ke})}):null})})});bn.displayName="DropdownMenuContent";var Ei=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let a=Rd(),[c,i]=useState(!!t),f=e??c,l=useCallback(E=>{e===void 0&&i(E),n?.(E);},[e,n]),p=useRef(null),b=useRef(false),m=useCallback((E,A)=>{if(o!=="hover")return;window.clearTimeout(p.current??0),b.current=E;let w=A??20;p.current=window.setTimeout(()=>{b.current=false,l(E);},w);},[o,l]),C=useCallback(()=>{p.current&&(window.clearTimeout(p.current),p.current=null,b.current=false);},[]);useEffect(()=>()=>C(),[C]);let F=cr();useEffect(()=>{if(!F)return;let E=()=>{C(),l(false);};return F.registerSubMenu(E)},[F,l,C]);let h=useRef(`pfui-submenu-${++wi}`),y=useRef(null),g=useRef([]),u=useRef(null),[d,x]=useState(null),[N,v]=useState(false);useEffect(()=>{f||(x(null),g.current=[],v(false));},[f]);let R=useContext(Ct),M=r??R,B=useMemo(()=>({open:f,setOpen:l,trigger:o,referenceRef:y,listRef:g,floatingRef:u,setActiveIndex:x,scheduleSubmenuHover:m,clearSubmenuHover:C,pendingOpenRef:b,menuId:h.current}),[f,l,o,x,m,C]),_=useMemo(()=>({activeIndex:d,setActiveIndex:x}),[d,x]),K=useMemo(()=>({isKeyboardNav:N,setIsKeyboardNav:v}),[N]);return a?(console.warn("[DropdownMenu] Nested submenus are not supported. DropdownMenuSub can only be used one level deep inside DropdownMenu. The nested submenu content will not be rendered."),jsx(Fragment,{children:pe.Children.map(s,E=>{if(!isValidElement(E))return E;let A=E.type;return A?.displayName==="DropdownMenuSubTrigger"||A?.displayName==="DropdownMenuSubContent"?null:E})})):jsx(Ti.Provider,{value:true,children:jsx(Ct.Provider,{value:M,children:jsx(co.Provider,{value:_,children:jsx(eo.Provider,{value:K,children:jsx(mn.Provider,{value:B,children:s})})})})})};Ei.displayName="DropdownMenuSub";var Si=pe.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:f,referenceRef:l,scheduleSubmenuHover:p,clearSubmenuHover:b,pendingOpenRef:m,menuId:C}=mr(),F=io(),h=useCallback(E=>{E&&(E.__pfuiCloseSubmenu=()=>i(false));},[i]),y=!!e&&isValidElement(t),g=y?t:null,u=g?.props,d=u?.onKeyDown,x=u?.onClick,{onKeyDown:N,onClick:v,...R}=s,M=useMemo(()=>hs(a,y&&isValidElement(t)&&"ref"in t?t.ref:void 0,l,h),[a,y,t,l,h]),B=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0,_=useCallback(E=>{if(E.key==="Tab"){E.preventDefault();return}let A=E.currentTarget,w=D=>{F?.setIsKeyboardNav(true);let H=A.closest("[data-menu-id]");if(!H)return;H.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(k=>k.removeAttribute("data-highlighted"));let L=Array.from(H.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(k=>{if(k.closest("[data-menu-id]")!==H)return false;let W=window.getComputedStyle(k);return W.display!=="none"&&W.visibility!=="hidden"});if(!L.length)return;let O=L.indexOf(A),$=O>=0?O:0,S=D==="next"?($+1)%L.length:($-1+L.length)%L.length;L[S]?.setAttribute("data-highlighted",""),L[S]?.focus();};if(E.key==="ArrowDown"){E.preventDefault(),E.stopPropagation(),c&&i(false),w("next");return}if(E.key==="ArrowUp"){E.preventDefault(),E.stopPropagation(),c&&i(false),w("prev");return}if(E.key==="ArrowRight"||E.key==="Enter"||E.key===" "){E.preventDefault(),E.stopPropagation(),F?.setIsKeyboardNav(true);let D=E.currentTarget;i(true),requestAnimationFrame(()=>{let H=C?document.querySelector(`[data-menu-id="${C}"]`):document.querySelector("[data-submenu-content]");if(H){H.setAttribute("data-keyboard-nav",""),D.removeAttribute("data-highlighted"),D.removeAttribute("data-hovered");let L=H.querySelector('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]):not([data-subtrigger]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])');L&&(L.setAttribute("data-highlighted",""),L.focus());}});return}if(E.key==="ArrowLeft"){E.preventDefault(),E.stopPropagation(),c&&i(false);let D=A.closest("[data-menu-id]");D&&D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),A.setAttribute("data-highlighted",""),A.focus(),F&&F.setIsKeyboardNav(true);return}if(E.key==="Escape"){E.preventDefault(),E.stopPropagation(),d?.(E);return}d?.(E),N?.(E);},[c,i,d,N,l,F,C]),K=f==="hover"?{onMouseEnter:E=>{let A=E.currentTarget;so(),b(),document.querySelectorAll("[data-hovered]").forEach(D=>D.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),A.setAttribute("data-hovered",""),A.focus({preventScroll:true});let w=A.closest("[data-menu-id]");w?.hasAttribute("data-keyboard-nav")&&w.removeAttribute("data-keyboard-nav"),F&&F.setIsKeyboardNav(false),c||p(true,90);},onMouseMove:E=>{let A=E.currentTarget;so(),A.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(w=>w.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(w=>w.removeAttribute("data-highlighted")),A.setAttribute("data-hovered","")),!c&&!m?.current&&p(true,90);},onMouseLeave:()=>{p(false,60);}}:{onClick:E=>{E.stopPropagation(),i(!c),x?.(E),v?.(E);}};if(y&&g){let E=u?.css,A=typeof u?.className=="string"?u.className:void 0,w=typeof u?.tabIndex=="number"?u.tabIndex:0,D={ref:M,tabIndex:w,className:[A,o].filter(Boolean).join(" ")||void 0,css:[E,B,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",__skipListReg:true,onKeyDown:_,onFocus:H=>{if(H.target.hasAttribute("data-highlighted")){let L=H.target.closest("[data-menu-id]");L&&!L.hasAttribute("data-keyboard-nav")&&(L.setAttribute("data-keyboard-nav",""),F&&F.setIsKeyboardNav(true));}u&&"onFocus"in u&&typeof u.onFocus=="function"&&u.onFocus(H);},...K,...R};return cloneElement(g,D)}return jsx("div",{ref:M,role:"menuitem",tabIndex:0,className:o,css:[css({display:"flex",alignItems:"center",gap:8,cursor:"pointer"}),B,r],"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",onKeyDown:_,onFocus:E=>{if(E.currentTarget.hasAttribute("data-highlighted")){let A=E.currentTarget.closest("[data-menu-id]");A&&!A.hasAttribute("data-keyboard-nav")&&(A.setAttribute("data-keyboard-nav",""),F&&F.setIsKeyboardNav(true));}},...K,...R,children:t})});Si.displayName="DropdownMenuSubTrigger";var ki=pe.forwardRef((e,t)=>{let n=ys(),{referenceRef:o,clearSubmenuHover:r,scheduleSubmenuHover:s}=mr(),a=[e.className,"plainframe-ui-submenu-content"].filter(Boolean).join(" ");return jsx(bn,{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 fr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),kd=css({display:"inline"}),Mi=css({display:"inline",fontWeight:700}),Id=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),Md=css({display:"flex",alignItems:"center",gap:4}),Fd=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"}),Ad=css({fontSize:"0.875em",overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400}),Pd=()=>{},Dd=e=>e,Nd=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Hd=e=>{e.preventDefault(),e.stopPropagation();},Ld=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},Bd=e=>{e.preventDefault(),e.stopPropagation();},Ai=pe.memo(({onCapture:e})=>{let t=useContext(mn),n=useContext(co),o=useMemo(()=>({...t,activeIndex:n?.activeIndex??null,setActiveIndex:n?.setActiveIndex??t?.setActiveIndex}),[t,n]);return useEffect(()=>{e(o);},[o,e]),null});Ai.displayName="CtxCapture";var xs=pe.memo(({item:e,absIndex:t,multiple:n,getCurrentMulti:o,isSelected:r,renderItem:s,paint:a,cls:c,closeOnSelect:i,pickSingle:f,handleItemKeyDown:l,handleItemMouseDown:p,descriptionColor:b})=>{let m=o(),C=useMemo(()=>{let y=String(e.title??e.value);return s?y:a(y)},[a,e.title,e.value,s]),F=useMemo(()=>e.description?jsxs("span",{className:"plainframe-ui-autocomplete-item-content",css:Fd,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Fi,children:C}),jsx("span",{className:"plainframe-ui-autocomplete-item-description",css:[Ad,{color:b}],children:e.description})]}):jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Fi,children:C}),[C,e.description,b]),h=useCallback(()=>{e.disabled||f(e.value);},[e.disabled,e.value,f]);if(n){let y=m.some(g=>Object.is(g,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:p,children:s(e,y)},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:F},e.value)}return s?jsx(Nt,{__index:t,onClick:h,onSelect:h,onKeyDown:l,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:p,selected:r,children:s(e,r)},e.value):jsx(Nt,{startIcon:e.startIcon,endIcon:e.endIcon,__index:t,onClick:h,onSelect:h,onKeyDown:l,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:p,selected:r,children:F},e.value)},(e,t)=>!(e.item.value!==t.item.value||e.item.disabled!==t.item.disabled||e.item.description!==t.item.description||e.absIndex!==t.absIndex||e.multiple!==t.multiple||e.closeOnSelect!==t.closeOnSelect||e.renderItem!==t.renderItem||e.pickSingle!==t.pickSingle||e.isSelected!==t.isSelected||e.paint!==t.paint||e.descriptionColor!==t.descriptionColor));xs.displayName="AutocompleteRow";var Pi=pe.memo(({items:e=[],onSelect:t,width:n=300,fullWidth:o=false,placeholder:r,renderItem:s,focusRingMode:a,css:c,inputCss:i,containerCss:f,label:l,helperText:p,variant:b,startIcon:m,endIcon:C,size:F,disabled:h=false,error:y=false,showClear:g=false,open:u,onOpenChange:d,openOnFocus:x=false,openOnType:N=true,openOnClick:v=true,closeOnSelect:R=true,closeOnBlur:M=true,blurOnSelect:B=false,freeSolo:_=false,customValueLabel:K=false,maxHeight:E,maxItems:A,noResultsText:w="No Items Found",highlightTypedValue:D,typedValueHighlightCss:H,showNoResults:L=true,noResultsLabelCss:O,loadingLabelCss:$,loadItems:S,loading:k,loadingText:W="Loading\u2026",debounceMs:T=200,multiple:I=false,selectedValues:z,defaultSelectedValues:P,onChangeSelected:j,expandIcon:q,showExpandIcon:te=true,expandIconCss:V,textFieldWrapperCss:Y,textFieldInputCss:ie,textFieldLabelCss:ce,textFieldHelperRowCss:me,textFieldHelperTextCss:De,textFieldStartIconCss:Re,textFieldEndIconCss:Ce,menuContentCss:ke})=>{let Q=U().text.secondary,[le,he]=useState(""),J=typeof u=="boolean",[xe,ee]=useState(false),re=J?u:xe,ae=useRef(null),fe=useRef(null),He=useRef(null),Oe=useRef(null),X=useRef(false),se=useRef(null),Z=useRef(false),de=useRef(0),we=useMemo(()=>[fe],[]),[Le,lt]=useState(P??[]),Ie=z??Le,et=useRef(Ie);et.current=Ie;let[Me,ct]=useState(null),Ue=useRef(Me);Ue.current=Me;let tt=useCallback(()=>et.current,[]),[At,Po]=useState([]),[Do,Xn]=useState(false),Xe=typeof S=="function",bt=Xe?At:e,ue=useRef(bt);ue.current=bt;let Ee=!!k||Do&&Xe,rt=useRef(d);useEffect(()=>{rt.current=d;},[d]);let Ne=useCallback(G=>{J||ee(G),rt.current?.(G);},[J]),ft=useRef(null);useEffect(()=>{if(!Xe)return;ft.current&&window.clearTimeout(ft.current);let G=le;return ft.current=window.setTimeout(async()=>{Xn(true);try{let oe=await S(G)||[];Po(Array.isArray(oe)?oe:[]);}catch{Po([]);}finally{Xn(false);}},Math.max(0,T)),()=>{ft.current&&window.clearTimeout(ft.current);}},[le,Xe,S,T]);let Yn=useMemo(()=>{let G=fr(le);return G?bt.some(oe=>fr(oe.title??oe.value)===G):false},[bt,le]),ia=_&&!!K&&le.trim().length>0&&!Yn,sc=G=>{if(typeof K=="object"){let oe=Object.prototype.hasOwnProperty.call(K,"prefix"),ve=Object.prototype.hasOwnProperty.call(K,"suffix");if(oe||ve){let Fe=oe?K.prefix??"":"",ge=ve?K.suffix??"":"";return `${Fe}${G}${ge}`}return `Add "${G}"`}return `Add "${G}"`},zr=useMemo(()=>{if(Xe)return bt;let G=fr(le);if(!G)return bt;let oe=[],ve=[];for(let Fe of bt){let ge=fr(Fe.title??Fe.value);ge.split(" ").some(Ye=>Ye.startsWith(G))?oe.push(Fe):ge.includes(G)&&ve.push(Fe);}return oe.length>0?oe:ve},[bt,le,Xe]),la=useMemo(()=>{if(ia){let G=le.trim();return [...zr,{value:G,title:sc(G),__pfui_free__:true}]}return zr},[zr,ia,le]),_t=useMemo(()=>{let G=[],oe=new Map;for(let ut of la){let Ye=ut.group??"__ungrouped__";oe.has(Ye)||(oe.set(Ye,[]),G.push(Ye)),oe.get(Ye).push(ut);}let Fe=typeof A=="number"?Math.max(0,A):1/0,ge=[];for(let ut of G){if(Fe<=0)break;let an=oe.get(ut).slice(0,Fe);an.length>0&&(ge.push({label:ut==="__ungrouped__"?void 0:ut,items:an}),Fe-=an.length);}return ge},[la,A]),Sn=useMemo(()=>_t.reduce((G,oe)=>(G.push(...oe.items),G),[]),[_t]),No=Sn.length>0,Or=!No&&!!L&&!Ee&&le.trim().length>0,kn=Ee||No||Or,Ho=kn||Xe;useEffect(()=>{!Xe&&re&&!kn&&(Z.current=true,Ne(false),setTimeout(()=>{Z.current=false;},150));},[Xe,re,kn,Ne]);let Wr=useRef(null),Kr=useRef(false);useEffect(()=>{if(_&&!I){if(Kr.current){Kr.current=false;return}let G=le.trim();if(Wr.current===G)return;Wr.current=G,t?.({value:G,title:G});}},[le,_,I,t]);let _r=useCallback(G=>{let oe=ue.current,ve=new Map(oe.map(ge=>[ge.value,ge])),Fe=G.map(ge=>ve.get(ge)??{value:ge,title:ge});j?.(Fe);},[j]),Lo=useCallback(G=>{let oe=G.map(String);z||lt(oe),_r(oe);},[z,_r]),ca=useCallback(G=>{let ve=Ie.includes(G)?Ie.filter(Fe=>Fe!==G):[...Ie,G];Lo(ve);},[Ie,Lo]),Bo=useCallback(G=>{let oe=ue.current.find(ve=>ve.value===G)??{value:G,title:G};oe.disabled||(Kr.current=true,Wr.current=(oe.title??oe.value).trim(),ct(oe),he(oe.title??oe.value),t?.(oe),J||(R?(X.current=false,Z.current=true,ee(false),rt.current?.(false),setTimeout(()=>{Z.current=false;},150)):X.current=true),!R&&He.current?.setActiveIndex&&He.current.setActiveIndex(null),B?(X.current=false,setTimeout(()=>{Oe.current&&ae.current?(Oe.current.tabIndex=0,Oe.current.focus(),Oe.current.blur(),Oe.current.tabIndex=-1):ae.current?.blur();},0)):requestAnimationFrame(()=>ae.current?.focus()));},[t,J,R,B]),ac=useCallback(G=>{if(h)return;he(G);let oe=!G.trim();I||(oe?(ct(null),t?.(null)):_&&ct(null)),!J&&!oe&&N&&!re&&Ne(true);},[I,J,N,re,Ne,h,_,t]),st=Nd,ua=Pd,ic=Dd,da=useMemo(()=>H?[Mi,H]:Mi,[H]),lc=useCallback(G=>{let oe=le.trim();if(!oe||oe.length<1)return G;let ve=oe.toLowerCase(),ge=G.toLowerCase().indexOf(ve);return ge<0?G:jsxs("span",{className:"plainframe-ui-autocomplete-highlight-wrap",css:kd,children:[G.slice(0,ge),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:da,children:G.slice(ge,ge+oe.length)}),G.slice(ge+oe.length)]})},[le,da]),$o=D?lc:ic,cc=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),zo=Hd,Oo=Ld,uc=useCallback(G=>{He.current=G;},[]),pa=useCallback(G=>{let oe=He.current;if(!oe)return;let ve=Sn.length;if(ve===0)return;let Fe=fe.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]"),ge=-1;if(Fe){let Ye=Fe.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]'),an=Fe.querySelector("[data-active]")||Fe.querySelector("[data-hovered]");an&&(ge=Array.from(Ye).indexOf(an));}ge<0&&typeof oe.activeIndex=="number"&&(ge=oe.activeIndex);let ut=ge<0?G===1?0:ve-1:(ge+G+ve)%ve;oe.setActiveIndex?.(ut),requestAnimationFrame(()=>{let Ye=fe.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]");if(!Ye)return;Ye.setAttribute("data-keyboard-nav",""),Ye.querySelectorAll("[data-active]").forEach(Vr=>Vr.removeAttribute("data-active")),Ye.querySelectorAll("[data-hovered]").forEach(Vr=>Vr.removeAttribute("data-hovered"));let jr=Ye.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]')[ut];jr&&(jr.setAttribute("data-active",""),jr.scrollIntoView?.({block:"nearest"}));});},[Sn.length]),dc=useCallback(G=>{if(G.key===" "||G.code==="Space"||G.key==="Spacebar"){G.stopPropagation();return}if(G.key==="ArrowDown"||G.key==="ArrowUp"){if(h||!kn&&!Xe)return;G.preventDefault(),!re&&!J&&Ne(true),pa(G.key==="ArrowDown"?1:-1);return}if(G.key==="Enter"){if(h)return;let oe=He.current&&typeof He.current.activeIndex=="number"?He.current.activeIndex:-1,ve=oe>=0&&oe<Sn.length?Sn[oe]:null;if(re&&ve&&oe>=0){G.preventDefault(),G.stopPropagation(),I?(ca(ve.value),R||requestAnimationFrame(()=>ae.current?.focus())):Bo(ve.value);return}}else G.key==="Escape"?(G.preventDefault(),G.stopPropagation(),re&&!J&&(Z.current=true,Ne(false),G.target.focus(),setTimeout(()=>{Z.current=false;},150))):G.key==="Tab"&&re&&!J&&Ne(false);},[kn,Xe,re,J,Sn,I,R,pa,ca,Bo,Ne,h]),pc=useCallback(()=>{h||Z.current||x&&Ho&&(de.current=Date.now(),J||Ne(true));},[J,x,Ho,Ne,h]),mc=useCallback(()=>{if(X.current){X.current=false;return}M&&Ne(false),!_&&!I&&(Me?he(Me.title??Me.value):le.trim()&&he(""));},[M,_,I,Me,le,Ne]),ma=useCallback(()=>{let G=[],oe=0;return _t.forEach((ve,Fe)=>{ve.label&&G.push(jsx(pn,{className:st("group-label"),children:ve.label},`g-${Fe}`)),ve.items.forEach(ge=>{G.push(jsx(xs,{item:ge,absIndex:oe,multiple:true,getCurrentMulti:tt,isSelected:false,renderItem:s,paint:$o,cls:st,closeOnSelect:false,pickSingle:ua,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:Q},`${ge.group??"__"}|${ge.value}`)),oe+=1;});}),jsx(bs,{values:Ie,onValuesChange:Lo,children:G},"multi-group")},[_t,st,tt,s,$o,Ie,Lo,ua,Oo,zo,Q]),fa=useCallback(()=>{let G=[],oe=0;return _t.forEach((ve,Fe)=>{ve.label&&G.push(jsx(pn,{className:st("group-label"),children:ve.label},`g-${Fe}`)),ve.items.forEach(ge=>{let ut=Me?.value===ge.value;G.push(jsx(xs,{item:ge,absIndex:oe,multiple:false,getCurrentMulti:tt,isSelected:ut,renderItem:s,paint:$o,cls:st,closeOnSelect:R,pickSingle:Bo,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:Q},`${ge.group??"__"}|${ge.value}`)),oe+=1;});}),G},[_t,st,Me,tt,s,$o,R,Bo,Oo,zo,Q]),fc=useMemo(()=>Ee?jsx(pn,{css:$,className:st("label-loading"),children:W},"loading"):Or?jsx(pn,{css:O,className:st("label-empty"),children:w},"empty"):_t.length===0?null:I?ma():fa(),[Ee,Or,_t.length,st,W,w,I,ma,fa]),sn=re?false:h||!Xe&&!No&&!L,ga=useCallback(G=>{G.preventDefault(),G.stopPropagation(),!(sn||h)&&(J||(re?(Z.current=true,Ne(false),queueMicrotask(()=>ae.current?.focus()),setTimeout(()=>{Z.current=false;},150)):(Ne(true),queueMicrotask(()=>ae.current?.focus()))));},[re,No,Xe,Ne,sn,h,J]),ba=useMemo(()=>css({transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1), opacity 0.15s ease",transform:re?"rotate(180deg)":"rotate(0deg)",display:"flex",alignItems:"center",justifyContent:"center",cursor:sn?"not-allowed":"pointer",userSelect:"none",opacity:sn?.5:1}),[re,sn]),Wo=useMemo(()=>te?jsx("span",{ref:se,role:"button",tabIndex:-1,css:[ba,V],"aria-disabled":sn||void 0,onMouseDown:Bd,onClick:ga,children:q??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[te,ba,V,sn,ga,q]),gc=useMemo(()=>C&&Wo?jsxs("span",{css:Md,children:[C,Wo]}):C??Wo,[C,Wo]),bc=useCallback(G=>{if(!(se.current&&se.current.contains(G.target)||Z.current||h||Date.now()-de.current<300)){if(re){!le.trim()&&!J&&(Z.current=true,Ne(false),setTimeout(()=>{Z.current=false;},150));return}v&&Ho&&(!J||v)&&Ne(true);}},[re,le,v,Ho,Ne,h,J]);return jsx("div",{ref:fe,className:st(""),css:[cc,f,c],children:jsxs(Nn,{open:h?false:re,onOpenChange:h?void 0:Ne,children:[jsx(Ai,{onCapture:uc}),jsx(Hn,{asChild:true,children:jsx("span",{className:st("anchor"),css:Id,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(er,{ref:ae,className:st("input"),focusRingMode:a,value:le,onChange:ac,onKeyDown:dc,onFocus:pc,onBlur:mc,onSurfaceClick:bc,placeholder:r,label:l,helperText:p,variant:b,startIcon:m,endIcon:gc,size:F,width:n,fullWidth:o,disabled:h,error:y,showClear:g,css:i,wrapperCss:Y,inputCss:ie,labelCss:ce,helperRowCss:me,helperTextCss:De,startIconCss:Re,endIconCss:Ce}),jsx("span",{ref:Oe,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}}),kn&&jsx(bn,{className:st("menu"),side:"bottom",align:"start",sameWidth:true,allItemsTabbable:true,maxHeight:typeof E=="number"?`${E}px`:E,css:ke,ignoreOutsidePressRefs:we,disableOutsidePressDismiss:J,returnFocus:!B,children:fc})]})})});Pi.displayName="Autocomplete";var Kd=["sm","md","lg"],_d=(e,t)=>typeof e=="number"?e:Kd.includes(e)?t.componentHeights[e]:t.componentHeights.md,jd=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},Vd=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},Ud=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),Di=pe.memo(forwardRef(({src:e,alt:t,size:n="md",color:o="primary",rounded:r=true,className:s,css:a,children:c,...i},f)=>{let l=U(),[p,b]=useState(!!e);useEffect(()=>{b(!!e);},[e]);let m=_d(n,l),C=typeof m=="number"?m:Number.parseFloat(String(m))||0,F=C?Math.round(C*(C<=28?.55:.52)):void 0,h=r?l.radius.full:l.radius.md,y=jd(l,o),g=Vd(l,o),u=Ud(c,t),d=css({width:m,height:m,borderRadius:h,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:p?"transparent":y,color:p?"inherit":g,boxSizing:"border-box",userSelect:"none"}),x=css({width:"100%",height:"100%",display:"block",objectFit:"cover"}),N=css({fontSize:F,lineHeight:1,fontWeight:600,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",marginTop:-1});return jsx("div",{ref:f,className:["plainframe-ui-avatar",s||""].join(" ").trim(),css:[d,a],role:p?void 0:"img","aria-label":p?void 0:t,...i,children:p&&e?jsx("img",{className:"plainframe-ui-avatar-img",src:e,alt:t,css:x,onError:()=>b(false),decoding:"async",loading:"lazy"}):typeof c=="string"?jsx("span",{className:"plainframe-ui-avatar-initials",css:N,children:c}):c||jsx("span",{className:"plainframe-ui-avatar-initials",css:N,children:u})})}));Di.displayName="Avatar";var Ni=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Yd=({children:e,max:t,size:n="md",overlap:o=-7,css:r,rounded:s=true,bgColor:a,extraLabelCss:c,outlineThickness:i=4,className:f})=>{let l=U(),p=ye(),m=(()=>{if(typeof n=="number")return `${n}px`;if(typeof n=="string"){let v=(l.componentHeights&&l.componentHeights[n])??(l.spacing&&l.spacing[n]);return Ni(v??n)}return "32px"})(),C=Children.toArray(e).filter(Boolean),F=typeof t=="number"&&t>=0,h=F&&C.length>t?C.slice(0,t):C,y=F&&C.length>t?C.length-t:0,g=a==="panel"?l.surface.panelBg:a==="subtle"?l.surface.subtleBg:a??l.surface.appBg,u=Ni(i)??"4px",d=css({display:"flex",alignItems:"center"}),x=v=>css({marginLeft:v===0?0:o,zIndex:h.length-v,boxShadow:`0 0 0 ${u} ${g}`,backgroundColor:g,borderRadius:s?l.radius.full:l.radius.md,display:"inline-flex",width:m,height:m,overflow:"hidden",alignItems:"center",justifyContent:"center",lineHeight:0,flex:"0 0 auto"}),N=css({width:"100%",height:"100%",display:"inline-flex",alignItems:"center",justifyContent:"center",objectFit:"cover",boxSizing:"border-box"});return jsxs("div",{role:"group",tabIndex:-1,"aria-label":"Avatar group",className:`plainframe-ui-avatar-group${f?` ${f}`:""}`,css:[d,r,p()],children:[h.map((v,R)=>{if(!isValidElement(v))return jsx("div",{className:"plainframe-ui-avatar-group-item",css:x(R),children:jsx("span",{css:N,children:v})},R);let M=v,B=M.props?.css,_=B==null?N:[N,B],K=cloneElement(M,{size:n,rounded:s,css:_,style:{...M.props?.style,width:"100%",height:"100%",objectFit:M.props?.objectFit??"cover"}});return jsx("div",{className:"plainframe-ui-avatar-group-item",css:x(R),children:K},R)}),y>0&&jsxs("span",{className:"plainframe-ui-avatar-group-extra",css:[css({marginLeft:5,fontSize:l.typography.sizes.sm,fontWeight:600,lineHeight:1,padding:"2px 1px",zIndex:2,color:l.text.secondary}),c],"aria-label":`+${y} more`,children:["+",y]})]})};var Bi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Zd=(e,t)=>{let n=e,o=n.palette||{},r=n.neutral||{};return t==="neutral"||t==="secondary"?{scale:r,onKey:"neutral"}:typeof t=="string"&&o[t]?{scale:o[t],onKey:t}:{scale:n.primary||r,onKey:"primary"}},Qd=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",ep=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",tp=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",np=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),op=pe.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:f={vertical:"top",horizontal:"right"},overlap:l="rectangular",children:p,animate:b=true,size:m,outline:C=false,outlineColor:F,className:h,badgeClassName:y,css:g,badgeCss:u,offsetX:d,offsetY:x})=>{let N=U(),v=s==="dot",R=m??(v?8:17),M=r??(v?0:10),{scale:B,onKey:_}=Zd(N,t),K=Qd(B),E=N.text?.onColors||{},A=ep(N,E,_,n),w=tp(e,a,s),D=np(i,s,e,c),H=css({position:"relative",display:"inline-block"}),L=l==="circular"?v?"12.5%":"5%":v?"5%":"2.5%",O=Bi(d??L),$=Bi(x??L),S=f.vertical||"top",k=f.horizontal||"right",W={},T="0",I="0";S==="center"?(W.top="50%",I="-50%"):S==="top"?(W.top=$,I="-45%"):(W.bottom=$,I="45%"),k==="center"?(W.left="50%",T="-50%"):k==="right"?(W.right=O,T="45%"):(W.left=O,T="-45%");let z=D?1:.8,P=css({minWidth:v?R:R/2,height:R,background:K,color:A,fontSize:typeof M=="number"?`${M}px`:M,fontWeight:o,borderRadius:999,padding:v?0:`0 ${R/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",...C?{boxShadow:`0 0 0 2px ${F??N.surface?.appBg}`}:{},opacity:D?1:0,transform:`translate(${T}, ${I}) scale(${D?z:.5})`,...b?{transition:"opacity .18s cubic-bezier(.4,1.6,.6,1), transform .18s cubic-bezier(.4,1.6,.6,1)"}:{},...W});return jsxs("div",{className:["plainframe-ui-badge-wrapper",h||""].join(" ").trim(),css:[H,g],children:[p,jsx("span",{"aria-hidden":!D,className:["plainframe-ui-badge",y||""].join(" ").trim(),css:[P,u],children:w})]})});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:f,transitionDuration:l=300,keepMounted:p=true,className:b,contentClassName:m,lockScroll:C=true,...F})=>{let h=U(),y=useMemo(()=>r??h.surface.overlayBg,[r,h.surface.overlayBg]),[g,u]=useState(e),[d,x]=useState(e),N=useRef(null),v=useRef(null),R=useRef(null);useEffect(()=>(N.current&&(clearTimeout(N.current),N.current=null),v.current!=null&&(cancelAnimationFrame(v.current),v.current=null),e?(u(true),v.current=requestAnimationFrame(()=>{x(true),v.current=null;})):(x(false),N.current=setTimeout(()=>{u(false),N.current=null;},l)),()=>{N.current&&(clearTimeout(N.current),N.current=null),v.current!=null&&(cancelAnimationFrame(v.current),v.current=null);}),[e,l]),useEffect(()=>{if(!C||!e)return;let A=document.body,w=A.style.overflow,D=A.style.paddingRight,H=window.innerWidth-document.documentElement.clientWidth,L=parseFloat(getComputedStyle(A).paddingRight||"0");return A.style.overflow="hidden",H>0&&(A.style.paddingRight=`${L+H}px`),()=>{A.style.overflow=w,A.style.paddingRight=D;}},[e,C]),useEffect(()=>{if(!d||!t)return;let A=w=>{w.key==="Escape"&&t();};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[d,t]);let M=A=>{if(!d||!t||!R.current)return;let w=A.target;w&&!R.current.contains(w)&&t();},B=n&&o?typeof o=="number"?`${o}px`:o:void 0;if(!p&&!g)return null;let _=css({position:"fixed",inset:0,width:"100vw",height:"100vh",zIndex:s,display:"grid",placeItems:"center",pointerEvents:d?"auto":"none",visibility:g?"visible":"hidden"}),K=css({position:"absolute",inset:0,background:y,backdropFilter:B?`blur(${B})`:void 0,WebkitBackdropFilter:B?`blur(${B})`:void 0,opacity:d?1:0,transition:`opacity ${l}ms cubic-bezier(.4,0,.2,1)`,pointerEvents:d?"auto":"none"}),E=css({position:"relative",zIndex:1,pointerEvents:d?"auto":"none"});return jsxs("div",{"aria-hidden":!g||void 0,className:["plainframe-ui-backdrop",b||""].join(" ").trim(),css:[_,a],onPointerDown:M,...F,children:[jsx("div",{className:"plainframe-ui-backdrop-overlay",css:[K,i],role:"presentation"}),jsx("div",{ref:R,className:["plainframe-ui-backdrop-content",m||""].join(" ").trim(),css:[E,c],children:f})]})};var yr=()=>null;Object.defineProperty(yr,"displayName",{value:"PF.BreadCrumbItem",configurable:true});function lp(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 cp=pe.memo(({children:e,separator:t="/",css:n,crumbCss:o,activeCrumbCss:r,inactiveCrumbCss:s,linkCrumbCss:a,separatorCss:c,hover:i=true,className:f,...l})=>{let p=U(),b=ye(),m=pe.useMemo(()=>pe.Children.toArray(e).flatMap(u=>{if(!pe.isValidElement(u))return [];let{type:d,props:x}=lp(u);if(!(d===yr||typeof d=="function"&&"displayName"in d&&d.displayName===yr.displayName))return [];let v=x;return [{href:v.href,disabled:v.disabled,node:v.children,className:v.className,css:v.css,onClick:v.onClick,startIcon:v.startIcon,endIcon:v.endIcon}]}),[e]),C=pe.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:p.typography.sizes.sm,fontWeight:500,gap:p.spacing.xs,cursor:"default"}),[p]),F=pe.useMemo(()=>css({margin:"0 0.15rem",color:p.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[p]),h=pe.useCallback((u,d,x)=>{let N=u?p.text.primary:p.text.secondary,v=i&&d&&!x;return css({display:"inline-flex",alignItems:"center",gap:p.spacing.xs,color:N,cursor:d&&!x?"pointer":"default",textDecoration:"none",borderRadius:p.radius.xs,fontWeight:500,outline:"none",transition:"all .16s ease !important","&:hover":v?{textDecoration:"underline",color:p.text.primary}:{textDecoration:"none"}})},[p,i]),y=pe.useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0}),[]),g=pe.useMemo(()=>css({display:"inline-block"}),[]);return jsx("nav",{"aria-label":"Breadcrumb",className:["plainframe-ui-breadcrumbs",f||""].join(" ").trim(),css:[C,n],...l,children:m.map((u,d)=>{let x=d===m.length-1,N=!!u.href&&!u.disabled&&!x,v=["plainframe-ui-breadcrumb",x?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",N?"plainframe-ui-breadcrumb--link":"",u.className||""].join(" ").trim(),R=[h(x,N,u.disabled),o,x?r:s,N?a:void 0,b(),u.css],M=jsxs(Fragment,{children:[u.startIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-start",css:y,children:u.startIcon}),jsx("span",{className:"plainframe-ui-breadcrumb-label",css:g,children:u.node}),u.endIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-end",css:y,children:u.endIcon})]});return jsxs(pe.Fragment,{children:[d!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[F,c],children:t}),N?jsx("a",{href:u.href,onClick:u.onClick,tabIndex:0,"data-active":x?"true":"false","data-link":"true",className:v,css:R,children:M}):jsx("span",{"aria-current":x?"page":void 0,tabIndex:x?-1:0,"data-active":x?"true":"false","data-link":"false",className:v,css:R,children:M})]},d)})})});var ks=(e,t)=>{if(!isValidElement(e))return e;let n=e.props,o={};return n.size===void 0&&(o.size=t),n.color===void 0&&(o.color="currentColor"),cloneElement(e,{...n,...o})},Is=e=>typeof e=="number"?`${e}px`:e,Wi=e=>{let t=false;return pe.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&Wi(n)&&(t=true));}),t};function mp(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 fp(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,f=c.danger??i,l=(p,b,m)=>p&&p[b]||m;if(t==="primary"){let p=s,b=l(p,600,n[900])||l(p,500,n[900]),m=l(p,500,n[800])||l(p,600,n[800]);return {bg:b,fg:i,hoverBg:m,border:"none"}}if(t==="destructive"){let p=a,b=l(p,600,n[900])||l(p,500,n[900]),m=l(p,500,n[800])||l(p,600,n[800]);return {bg:b,fg:f,hoverBg:m,border:"none"}}return t==="ghost-destructive"?{bg:"transparent",fg:a[700],hoverBg:e.palette.danger[50],border:"none"}:t==="subtle"?{bg:e.surface.subtleBg,fg:o.primary,hoverBg:e.surface.subtleHover,border:"none"}:t==="outlined"?{bg:e.surface.panelBg,fg:o.primary,hoverBg:e.surface.panelHover,border:`${e.componentHeights.border} solid ${e.surface.border}`}:t==="ghost"?{bg:"transparent",fg:e.text.primary,hoverBg:e.surface.subtleBg,border:"none"}:t==="quiet"?{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}:{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}}var Ki=pe.memo(pe.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:f="center",children:l,className:p,hoverEffect:b=true,icon:m,onClick:C,css:F,...h},y)=>{let g=U(),u=ye(),d=useMemo(()=>mp(g,t),[g,t]),x=useMemo(()=>fp(g,e),[g,e]),N=useMemo(()=>m===true?true:m===false?false:!n&&!o&&!Wi(l)&&pe.Children.count(l)===1,[m,n,o,l]),v=d.iconSize,R=useMemo(()=>ks(n,v),[n,v]),M=useMemo(()=>ks(o,v),[o,v]),B=useMemo(()=>i??jsx(Qn,{color:x.fg,variant:"circular",size:14,thickness:5}),[i,x]),_=useMemo(()=>N?"center":f??"center",[N,f]),K=!!c&&_==="center",E=!!c&&_==="start",A=!!c&&_==="end",w=a||c,D=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:0,width:s?"100%":"auto",minHeight:d.minHeight,lineHeight:1,fontWeight:600,cursor:w?"not-allowed":"pointer",opacity:w?.5:1,userSelect:"none",position:"relative",borderRadius:r?g.radius.full:d.radius,outline:"none",willChange:"box-shadow, transform, outline-offset",transition:"box-shadow 140ms ease, transform 90ms ease, outline-offset 140ms ease"}),[s,d,r,g,w]),H=useMemo(()=>css({backgroundColor:x.bg,color:x.fg,border:x.border}),[x]),L=useMemo(()=>css({overflow:"hidden","::before":{content:'""',position:"absolute",inset:0,backgroundColor:x.hoverBg,opacity:0,pointerEvents:"none",transition:"opacity 140ms ease",zIndex:0},"@media (hover: hover) and (pointer: fine)":b&&!w?{":hover::before":{opacity:1}}:{}}),[x,b,w]),O=useMemo(()=>css(N&&!s?{width:"100%",height:"100%",maxWidth:d.minHeight,minWidth:d.minHeight,maxHeight:d.minHeight,display:"flex",alignItems:"center",justifyContent:"center",fontSize:Is(d.iconSize)}:{fontSize:Is(d.fontSize),padding:n||o?`${d.paddingY} ${d.paddingXIcon}`:`${d.paddingY} ${d.paddingX}`}),[N,s,d,n,o]),$=useMemo(()=>css({position:"relative",zIndex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:Is(g.spacing.sm),opacity:K?0:1,transition:"opacity 140ms ease"}),[g,K]),S=useMemo(()=>css({height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}),[]),k=useMemo(()=>typeof d.iconSize=="number"?d.iconSize:Math.max(12,Math.round(parseFloat(String(d.iconSize))||16)),[d.iconSize]),W=useMemo(()=>css({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:k,minWidth:k,maxWidth:k,height:"1em"}),[k]),T=useMemo(()=>q=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:q?1:0,transition:"opacity 140ms ease"}),[]),I=useMemo(()=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:K?1:0,pointerEvents:"none",zIndex:2,transition:"opacity 140ms ease"}),[K]),z=useMemo(()=>()=>{if(N)return null;let q=!!n;return !q&&!E?null:jsxs("span",{css:W,"aria-hidden":c?true:void 0,children:[jsx("span",{css:T(!E),children:q?R||n:null}),jsx("span",{css:T(!!E),children:B})]})},[N,n,E,W,T,R,c,B]),P=useMemo(()=>()=>{if(N)return null;let q=!!o;return !q&&!A?null:jsxs("span",{css:W,"aria-hidden":c?true:void 0,children:[jsx("span",{css:T(!A),children:q?M||o:null}),jsx("span",{css:T(!!A),children:B})]})},[N,o,A,W,T,M,c,B]),j=!(a||c);return jsxs("button",{ref:y,type:"type"in h&&h.type?h.type:"button","data-variant":e,className:["plainframe-ui-button",p||""].join(" ").trim(),css:[D,u({color:e==="primary"?"primary":e==="destructive"||e==="ghost-destructive"?"danger":"neutral"}),H,L,O,F],onClick:j?C:void 0,disabled:a||void 0,tabIndex:c?-1:void 0,"aria-disabled":a||void 0,"aria-busy":c||void 0,...h,children:[jsxs("span",{className:"plainframe-ui-button-content",css:$,children:[z(),jsx("span",{className:"plainframe-ui-button-label",css:S,children:N?c?B:ks(l,d.iconSize):l}),P()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:I,"aria-hidden":"true",children:K?B:null})]})}));Ki.displayName="Button";var Rr=e=>isValidElement(e),gp=e=>{let t=e.type;return t.displayName??t.name},Ps=(e,t)=>gp(e)===t,Vi=e=>Ps(e,"ButtonGroup"),Ui=e=>Ps(e,"DropdownMenu"),Fs=e=>Ps(e,"DropdownMenuTrigger"),$n=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,bp=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,hp=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),As=(e,t)=>{if(!Rr(e))return null;if(Vi(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?As(t?n[0]:n[n.length-1],t):null}if(Ui(e)){let o=Children.toArray(e.props.children).filter(isValidElement).find(Fs);return o?As(o,t):null}if(Fs(e)){let n=Children.toArray(e.props.children??[]).filter(isValidElement);return n.length?n[0]:null}return e},ji=(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 hp(o)},qi=pe.memo(pe.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:f,className:l,role:p="group",css:b,__clipLeft:m,__clipRight:C,...F},h){let y=U(),g=a==="sm"?y.radius.sm:y.radius.md,u=c?y.radius.full:g,d=o==="vertical",x=bp(y.componentHeights.border,1),N=y.surface.border,v=n&&!!m,R=n&&!!C,M=css({display:"flex",flexDirection:d?"column":"row",width:r?"100%":f!=null?$n(f):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:$n(i??y.spacing.sm)}),B=Children.toArray(t),K=B.filter(Rr).length,E=0,A=false,w=[];for(let D of B){if(!Rr(D)){w.push(D);continue}let H=E===0,L=E===K-1,O=D.props??{},$=O.disabled??s,S=O.size??a,k=0,W=0,T=0,I=0;n&&(d?(k=H?v?0:u:0,W=H?R?0:u:0,I=L?v?0:u:0,T=L?R?0:u:0):(k=H?v?0:u:0,I=H?v?0:u:0,W=L?R?0:u:0,T=L?R?0:u:0));let z=ji(D,"left"),P=ji(D,"right"),te=n&&!H&&!(A&&z)&&!(A||z)?css({[d?"borderTop":"borderLeft"]:`${x} solid ${N}`}):null,V=n&&!H&&A&&z?css(d?{borderTopWidth:0}:{borderLeftWidth:0}):null,Y=n?css({borderTopLeftRadius:$n(k),borderTopRightRadius:$n(W),borderBottomRightRadius:$n(T),borderBottomLeftRadius:$n(I)}):null,ie=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,ce=css([Y,te,V,ie]);if(!Ui(D)){let Ce=O.css,ke=[O.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),Te=Vi(D)&&n?{__clipLeft:!H,__clipRight:!L}:{},Q=cloneElement(D,{...O,disabled:$,size:S,className:ke,css:[Ce,ce],...Te});w.push(Q),A=P,E+=1;continue}let me=O.children,De=Children.map(me,Ce=>{if(!Rr(Ce)||!Fs(Ce))return Ce;let ke=Ce.props,Te=[ke.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" ");return cloneElement(Ce,{...ke,css:[ke.css,ce],className:Te,disabled:$,size:S})}),Re=cloneElement(D,{...O,children:De});w.push(Re),A=P,E+=1;}return jsx("div",{ref:h,role:p,"aria-orientation":d?"vertical":"horizontal","data-attached":n||void 0,"data-direction":o,className:["plainframe-ui-button-group",l||""].join(" ").trim(),css:[M,b],...F,children:w})}));qi.displayName="ButtonGroup";var Tr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Tp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;return Tr(n?.[e]??e)}}},wp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius??t.radii;return Tr(n?.[e]??e)}}},Ep=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},Sp=(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},zn=pe.memo(forwardRef(function({children:t,css:n,variant:o="ghost",padding:r,radius:s,className:a,hoverable:c,selectable:i,selected:f,defaultSelected:l,onSelectedChange:p,width:b,height:m,onClick:C,onKeyDown:F,role:h,tabIndex:y,...g},u){let d=U(),x=d.surface??{},[N,v]=useState(!!l),R=f!=null,M=R?!!f:N,B=useMemo(()=>Ep(o,d),[o,d]),_=useMemo(()=>Sp(o,d,B),[o,d,B]),K=_,E=useMemo(()=>Tp(r,d),[r,d]),A=useMemo(()=>wp(s,d),[s,d]),w=!!c||!!i,D=useMemo(()=>css({backgroundColor:B,padding:E,borderRadius:A,border:o==="outlined"?`${d.componentHeights?.border??"1px"} solid ${x.border??"transparent"}`:void 0,backgroundClip:"padding-box",boxSizing:"border-box",width:b?"100%":void 0,maxWidth:Tr(b),height:Tr(m),outline:"none",transition:"background-color .16s ease, border-color .16s ease",cursor:w?"pointer":void 0,...w?{"&:hover":{backgroundColor:_}}:{},'&[data-selected="true"]':{backgroundColor:K},...w?{'&[data-selected="true"]:hover':{backgroundColor:K}}:{}}),[B,E,A,o,d.componentHeights,x.border,b,m,w,_,K]),H=useCallback(()=>{if(!i)return;let S=!M;R||v(S),p?.(S);},[R,p,i,M]),L=useCallback(S=>{i&&H(),C?.(S);},[i,H,C]),O=useCallback(S=>{i&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),H()),F?.(S);},[i,H,F]),$=ye();return jsx("div",{ref:u,"data-variant":o,"data-selected":i&&M?"true":void 0,"aria-pressed":i?M:void 0,className:["plainframe-ui-container",a||""].join(" ").trim(),css:[$(),D,n],onClick:L,onKeyDown:O,role:i?h??"button":h,tabIndex:i?y??0:y,...g,children:t})}));zn.displayName="Container";var Ip=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 Ip(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 Mp(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 Gi(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Xi=pe.createContext("horizontal"),Ls=()=>pe.useContext(Xi),Yi=pe.memo(pe.forwardRef(({children:e,css:t,variant:n="ghost",padding:o="md",radius:r="lg",hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:f,width:l="100%",height:p,gap:b,direction:m="horizontal",className:C,onClick:F,...h},y)=>{let g=U(),u=ye(),d=m==="vertical",x=css({position:"relative",display:"flex",flexDirection:d?"column":"row",gap:Mp(b,g),alignItems:d?"stretch":"center",transition:"all .16s ease"});return jsx(Xi.Provider,{value:m,children:jsx(zn,{ref:y,variant:n,padding:o,radius:r,hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:f,width:l,height:p,className:["plainframe-ui-card",C||""].join(" ").trim(),css:[u(),x,t],onClick:F,tabIndex:F?0:void 0,...h,children:e})})}));Yi.displayName="Card";var Fp=pe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=U(),l=Ls()==="vertical",p=css({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:go(o),textAlign:Hs(o),...l?{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:[p,t],...c,children:e})}),Ap=pe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=U(),l=Ls()==="vertical",p=css({display:"flex",flexShrink:0,justifyContent:go(o),alignItems:go(o),...l?{width:"100%"}:{},...bo(i,r,s,a)});return jsx("div",{"data-slot":"card-start",className:["plainframe-ui-card-start",n||""].join(" ").trim(),css:[p,t],...c,children:e})}),Pp=pe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=U(),l=Ls()==="vertical",p=css({display:"flex",flexShrink:0,justifyContent:go(o),alignItems:go(o),...l?{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:[p,t],...c,children:e})}),Dp=pe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:f,...l})=>{let p=U(),b=css({fontWeight:c??500,fontSize:i??(p.typography?.sizes?.sm!==void 0?p.typography.sizes.sm:"1rem"),color:Gi(p,f)??p.text?.primary,textAlign:Hs(o),...bo(p,r,s,a),display:"flex",alignItems:"center",gap:p.spacing?.xs??6});return jsx("div",{"data-slot":"card-title",className:["plainframe-ui-card-title",n||""].join(" ").trim(),css:[b,t],...l,children:e})}),Np=pe.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:f,...l})=>{let p=U(),b=css({fontWeight:c??400,fontSize:i??(p.typography?.sizes?.sm!==void 0?p.typography.sizes.sm:"0.875rem"),color:Gi(p,f)??p.text?.secondary,marginTop:p.spacing?.xxs??2,textAlign:Hs(o),...bo(p,r,s,a)});return jsx("div",{"data-slot":"card-description",className:["plainframe-ui-card-description",n||""].join(" ").trim(),css:[b,t],...l,children:e})});var Zi=e=>isValidElement(e),$p=e=>Zi(e)?e.type?.displayName||e.type?.name:void 0,Ji=e=>$p(e)==="Card",zp=e=>typeof e=="number"?`${e}px`:e,Qi=({children:e,attached:t=false,gap:n,width:o,direction:r="vertical",variant:s,className:a,role:c="group",css:i})=>{let f=U(),l=r==="vertical",p=String(f.componentHeights?.border??"1px"),b=f.surface.border,m={display:"flex",flexDirection:l?"column":"row",width:typeof o=="string"||typeof o=="number"?zp(o):"auto",maxWidth:"none",gap:t?0:n??f.spacing?.sm},C=Children.toArray(e),h=C.filter(Ji).length,y=0,g=C.map((u,d)=>{if(!Ji(u)||!Zi(u))return u;let x=u.props,N=y++,v=N===0,R=N===h-1,M=s??x.variant,B=t?l?{borderTopLeftRadius:v?x.radius:0,borderTopRightRadius:v?x.radius:0,borderBottomLeftRadius:R?x.radius:0,borderBottomRightRadius:R?x.radius:0}:{borderTopLeftRadius:v?x.radius:0,borderBottomLeftRadius:v?x.radius:0,borderTopRightRadius:R?x.radius:0,borderBottomRightRadius:R?x.radius:0}:void 0,_=t&&!v?l?{borderTopWidth:0}:{borderLeftWidth:0}:void 0,K=M==="subtle"&&h>1&&!v?l?{borderTop:`${p} solid ${b}`}:{borderLeft:`${p} solid ${b}`}:null,A=[B,_,K,t?{width:"100%"}:{width:"100%",marginBottom:l?0:void 0,marginRight:l?void 0:0}].filter(Boolean),w=[x.className,"plainframe-ui-card-group-item"].filter(Boolean).join(" ");return cloneElement(u,{...x,variant:M??x.variant,css:[x.css,...A],className:w,key:typeof u=="object"&&"key"in u?u.key:d})});return jsx("div",{role:c,"aria-orientation":l?"vertical":"horizontal","data-attached":t||void 0,"data-direction":r,className:["plainframe-ui-card-group",a||""].join(" ").trim(),css:[m,i],children:g})};Qi.displayName="CardGroup";var Be=e=>typeof e=="number"?`${e}px`:e,tl=e=>{let t=false;return pe.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&tl(n)&&(t=true));}),t},_p=(e,t)=>t==="sm"?{fontSize:e.typography.sizes.xs,paddingX:`calc(${e.spacing.sm} * 0.7)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.xs,radius:`calc(${e.radius.sm} * 0.8)`,soloPadding:e.spacing.xs,iconOffset:"0px",iconOffsetRounded:"-2px"}:t==="lg"?{fontSize:e.typography.sizes.md,paddingX:e.spacing.sm,paddingY:`calc(${e.spacing.sm} * 0.6)`,gap:e.spacing.xs,iconSize:e.typography.sizes.md,radius:e.radius.md,soloPadding:e.spacing.sm,iconOffset:"0px",iconOffsetRounded:"-3px"}:{fontSize:e.typography.sizes.sm,paddingX:`calc(${e.spacing.sm} * 0.9)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.sm,radius:e.radius.sm,soloPadding:e.spacing.xs,iconOffset:"-1px",iconOffsetRounded:"-3px"},nl=pe.memo(forwardRef(function({children:t,labelCss:n,variant:o="soft",color:r="primary",rounded:s=false,startIcon:a,endIcon:c,size:i="md",onClick:f,onDelete:l,deleteIcon:p,disabled:b,cursor:m,className:C,css:F},h){let y=U(),g=ye(),u=["sm","md","lg"].includes(i)?i:"md",d=useMemo(()=>_p(y,u),[y,u]),x=!!f&&!b,N=b?"not-allowed":m||(x?"pointer":"inherit"),v=String(y.componentHeights?.border??"1px"),R=useMemo(()=>{let q=y.palette;return r==="secondary"||r==="neutral"?"neutral":r&&q[r]?r:"primary"},[r,y.palette]),M=useCallback(q=>{let te=y.palette;return (R==="neutral"?y.neutral[q]:te[R]?.[q])??te.primary?.[q]},[R,y.neutral,y.palette]),B=useMemo(()=>R==="neutral"?y.neutral[100]:M(50),[R,M,y.neutral]),_=useMemo(()=>R==="neutral"?y.text.secondary:M(800),[R,M,y.text.secondary]),K=useMemo(()=>R==="neutral"?y.neutral[100]:M(50),[R,M,y.neutral]),E=useMemo(()=>R==="neutral"?y.text.secondary:M(800),[R,M,y.text.secondary]),A=useMemo(()=>R==="neutral"?y.neutral[400]:M(300),[R,M,y.neutral]),w=useMemo(()=>R==="neutral"?y.surface.subtleBg:M(600),[R,M,y.surface.subtleBg]),D=useMemo(()=>(y.text.onColors??{})[R]??(R==="neutral"?y.neutral[900]:y.neutral[0]??"#fff"),[R,y.text.onColors,y.neutral]),H="transparent",L=useMemo(()=>R==="neutral"?y.text.secondary:M(700)??y.text.primary,[R,M,y.text.primary,y.text.secondary]),O=useMemo(()=>!a&&!c&&t!=null&&!tl(t)&&pe.Children.count(t)===1,[a,c,t]),$=useMemo(()=>o==="filled"?css({backgroundColor:w,color:D,border:"none",boxShadow:"none"}):o==="outlined"?css({backgroundColor:K,color:E,border:"none",boxShadow:`inset 0 0 0 ${v} ${A}`}):o==="ghost"?css({backgroundColor:H,color:L,border:"none",boxShadow:"none"}):css({backgroundColor:B,color:_,border:"none",boxShadow:"none"}),[w,D,L,K,E,A,B,_,v,o]),S=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:Be(d.gap),padding:o==="ghost"?0:O||t==null?Be(d.soloPadding):`${Be(d.paddingY)} ${Be(d.paddingX)}`,borderRadius:s?y.radius.full:d.radius,fontWeight:600,cursor:N,opacity:b?.55:1,transition:"outline .16s ease, outline-offset .16s ease",overflow:o==="ghost"?"visible":"hidden",...O?{lineHeight:1,minWidth:`calc(${Be(d.iconSize)} + ${Be(d.soloPadding)} * 2)`,minHeight:`calc(${Be(d.iconSize)} + ${Be(d.soloPadding)} * 2)`,justifyContent:"center"}:null}),[d,N,t,b,O,s,y.radius.full,o]),k=useMemo(()=>css({fontSize:Be(O?d.iconSize:d.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:O?Be(d.iconSize):void 0,height:O?Be(d.iconSize):void 0,display:O?"block":void 0}}),[d.fontSize,d.iconSize,O]),W=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:Be(d.iconSize),lineHeight:0,"& > svg":{width:Be(d.iconSize),height:Be(d.iconSize),display:"block"}}),[d.iconSize]),T=useMemo(()=>css({marginRight:O||t==null?0:Be(d.gap),marginLeft:O||t==null?0:Be(d.iconOffset)}),[d.gap,d.iconOffset,t,O]),I=useMemo(()=>css({marginLeft:O||t==null?0:Be(d.gap),marginRight:O||t==null?0:Be(s?d.iconOffsetRounded:d.iconOffset)}),[d.gap,d.iconOffset,d.iconOffsetRounded,t,O,s]),z=useMemo(()=>css({marginRight:s?0:Be(d.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:Be(d.iconSize),borderRadius:y.radius.xs}),[d.iconOffset,d.iconSize,b,s,y.radius.xs]),P=useCallback(q=>{x&&(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),f?.());},[x,f]),j=useMemo(()=>jsx(X,{css:{width:d.iconSize,height:d.iconSize},strokeWidth:2.5}),[d.iconSize]);return jsxs("div",{ref:h,className:["plainframe-ui-chip",x?"plainframe-ui-chip-clickable":"",C||""].join(" ").trim(),css:[S,$,x?g({color:r??"primary"}):null,F],onClick:x?f:void 0,onKeyDown:P,role:x?"button":void 0,tabIndex:x?0:void 0,"aria-disabled":b||void 0,"data-variant":o,"data-color":R,"data-size":i,"data-icon-only":O||void 0,children:[a&&jsx("span",{css:[W,T],className:"plainframe-ui-chip-icon-left",children:a}),t!=null&&jsx("span",{css:[k,n],className:"plainframe-ui-chip-label",children:t}),c&&jsx("span",{css:[W,I],className:"plainframe-ui-chip-icon-right",children:c}),l&&jsx("button",{type:"button","aria-label":"Delete",disabled:b,tabIndex:0,onClick:q=>{q.stopPropagation(),b||l?.();},css:[z,g({color:r??"primary"})],className:"plainframe-ui-chip-delete",children:p||j})]})}));nl.displayName="Chip";var qp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Gp=pe.memo(function({value:t,onChange:n,len:o,theme:r,sizeKey:s,s:a,variant:c,error:i,disabled:f,ringEnabled:l,focusRingMode:p,placeholder:b,separator:m,gapPx:C}){let F=ye(),h=r.neutral,y=r.text,g=r.componentHeights.border,u=useRef([]),[d,x]=useState(0),N=useMemo(()=>(t??"").padEnd(o,"").slice(0,o).split(""),[t,o]),v=useMemo(()=>{if(!b)return Array(o).fill("");if(b.length===1)return Array(o).fill(b);let O=b.slice(0,o).split("");for(;O.length<o;)O.push("");return O},[b,o]),R=useMemo(()=>{let O=r.componentHeights[s];return `calc(${typeof O=="number"?`${O}px`:O} * 1.5)`},[r.componentHeights,s]),M=f?h[200]:i&&c==="outlined"?r.palette.danger?.[50]??r.surface.panelBg:i&&c==="subtle"?r.palette.danger?.[50]??r.surface.subtleBg:c==="subtle"?r.surface.subtleBg:c==="outlined"?r.surface.panelBg:"transparent",B=c==="outlined"?`${g} solid ${i?r.palette.danger?.[300]??r.surface.border:r.surface.border}`:"none",_=O=>css({width:R,height:R,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:M,border:B,borderRadius:r.radius.lg,transition:"box-shadow .16s, border-color .16s, background .16s",fontSize:a.codeFontSize,fontWeight:600,color:f?h[500]:i?r.palette.danger?.[800]??y.primary:y.primary,textAlign:"center",backgroundClip:"padding-box",appearance:"textfield",outline:"none",caretColor:i?r.palette.danger?.[800]??y.primary:y.primary,"&::placeholder":{color:i?r.palette.danger?.[700]??y.secondary:y.secondary,opacity:.85}},l?F({enabled:true,disabled:f,mode:p==="always"?"always":"visible",color:i?"danger":void 0}):void 0,O?css({}):null),K=css({display:"flex",gap:C,justifyContent:"center",width:"auto",pointerEvents:f?"none":"auto",opacity:f?.65:1}),E=css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:y.secondary,userSelect:"none"}),A=O=>O.replace(/[^a-zA-Z0-9]/g,"").toUpperCase(),w=useCallback(O=>{let $=Math.max(0,Math.min(o-1,O));x($),u.current[$]?.focus();},[o]),D=useCallback((O,$)=>{let S=A($).slice(0,1),k=[...N];k[O]=S,n(k.join("")),S&&O<o-1&&w(O+1);},[N,o,n,w]),H=useCallback((O,$)=>{if($.key==="Backspace")if(!N[O]&&O>0){let S=[...N];S[O-1]="",n(S.join("")),w(O-1),$.preventDefault();return}else {let S=[...N];S[O]="",n(S.join(""));return}if($.key==="ArrowLeft"&&O>0){$.preventDefault(),w(O-1);return}if($.key==="ArrowRight"&&O<o-1){$.preventDefault(),w(O+1);return}if($.key==="Home"){$.preventDefault(),w(0);return}if($.key==="End"){$.preventDefault(),w(o-1);return}},[N,o,n,w]),L=useCallback(O=>{let $=A(O.clipboardData.getData("text")).slice(0,o);$&&(n($),requestAnimationFrame(()=>{let S=Math.min($.length,o-1);w(S);}),O.preventDefault());},[o,n,w]);return jsx("div",{className:"plainframe-ui-code-boxes",css:K,children:Array.from({length:o}).map((O,$)=>jsxs(pe.Fragment,{children:[jsx("input",{ref:S=>{u.current[$]=S;},type:"text",inputMode:"text",maxLength:1,value:N[$]||"",placeholder:N[$]?"":v[$]||"",disabled:f,onChange:S=>D($,S.target.value),onKeyDown:S=>H($,S),onFocus:()=>x($),onPaste:$===0?L:void 0,className:"plainframe-ui-code-box",css:_($===d),"aria-label":`Code character ${$+1}`,tabIndex:$===d?0:-1}),m&&$<o-1?jsx("span",{"aria-hidden":true,role:"presentation",css:E,children:m}):null]},$))})}),Xp=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,separator:s,error:a,helperText:c,disabled:i=false,gap:f,size:l="md",variant:p="subtle",length:b=4,focusRingMode:m="always",className:C,wrapperCss:F,labelCss:h,helperRowCss:y,helperTextCss:g,css:u})=>{let d=U(),x=useId(),N=useMemo(()=>({sm:{labelFont:d.typography.sizes.xs,helperFont:d.typography.sizes.xs,minHeight:d.componentHeights.sm,paddingY:0,paddingX:d.spacing.md,codeFontSize:21},md:{labelFont:d.typography.sizes.sm,helperFont:d.typography.sizes.xs,minHeight:d.componentHeights.md,paddingY:0,paddingX:d.spacing.md,codeFontSize:24},lg:{labelFont:d.typography.sizes.md,helperFont:d.typography.sizes.sm,minHeight:d.componentHeights.lg,paddingY:0,paddingX:d.spacing.md,codeFontSize:28}}),[d]),v=["sm","md","lg"].includes(l)?l:"md",R=N[v],M=d.neutral,B=d.text,_=t!=null,[K,E]=useState(n),A=_?t:K,w=T=>{_||E(T),o?.(T);},D=Math.max(2,Math.min(b,10)),H=d.spacing.sm,L=qp(f??H)??"0px",O=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(F)?F:F?[F]:[]),$=css({fontSize:R.labelFont,fontWeight:500,color:a?d.palette.danger?.[700]??B.primary:i?M[500]:B.primary,marginBottom:4,display:"block",cursor:i?"not-allowed":"auto"},...Array.isArray(h)?h:h?[h]:[]),S=css({display:"flex",alignItems:"center",justifyContent:"center",gap:L,width:"auto",background:"transparent",outline:"none",boxShadow:"none"},...Array.isArray(u)?u:u?[u]:[]),k=css({minHeight:16,fontSize:R.helperFont,color:a?d.palette.danger?.[700]??B.secondary:B.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Array.isArray(y)?y:y?[y]:[]),W=css({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400,color:a?d.palette.danger?.[700]??B.primary:i?M[500]:B.primary},...Array.isArray(g)?g:g?[g]:[]);return jsxs("div",{className:["plainframe-ui-codefield",C||""].join(" ").trim(),css:O,children:[e&&jsx("span",{id:x,className:"plainframe-ui-codefield-label",css:$,children:e}),jsx("div",{className:"plainframe-ui-codefield-row",css:S,role:"group","aria-labelledby":e?x:void 0,tabIndex:-1,children:jsx(Gp,{value:A||"",onChange:w,len:D,theme:d,sizeKey:v,s:{codeFontSize:R.codeFontSize},variant:p,error:!!a,disabled:i,ringEnabled:m!=="none",focusRingMode:m,placeholder:r,separator:s,gapPx:L})}),c!=null&&jsx("div",{className:"plainframe-ui-codefield-helper",css:k,children:jsx("span",{className:"plainframe-ui-codefield-helper-text",css:W,children:c})})]})};var il=e=>{if(typeof e=="object"&&e!==null&&"type"in e&&e.type){let t=e.type;return (typeof t=="object"&&t!==null||typeof t=="function")&&(t?.displayName||t?.name)||""}return ""},$s=e=>{if(!e||typeof e!="object")return false;let t=il(e);if(t==="DropdownMenu"||t==="DropdownMenuContent")return true;let n=e?.props,o=n&&typeof n=="object"&&n!==null&&"children"in n?n.children:void 0;return o==null?false:Array.isArray(o)?o.some($s):$s(o)},Jp=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:s=10})=>{let a=pe.useRef(null),[c,i]=pe.useState(false),f=pe.useCallback(k=>{i(k),o?.(k);},[o]),l=pe.useCallback(()=>f(false),[f]),p=pe.useRef({x:0,y:0}),b=pe.useRef(null),m=pe.useRef(null),C=pe.useCallback(()=>{m.current=null;let k=b.current;if(!k)return;let W=Math.round(p.current.x),T=Math.round(p.current.y);k.style.transform=`translate3d(${W}px, ${T}px, 0)`;},[]),F=pe.useCallback(()=>{m.current==null&&(m.current=requestAnimationFrame(C));},[C]);pe.useEffect(()=>()=>{m.current&&cancelAnimationFrame(m.current);},[]);let h=pe.useMemo(()=>({getBoundingClientRect:()=>{let k=Math.round(p.current.x),W=Math.round(p.current.y);return {x:k,y:W,left:k,top:W,right:k,bottom:W,width:0,height:0,toJSON:()=>({x:k,y:W})}}}),[]),y=pe.useRef(`cz-${Math.random().toString(36).slice(2)}`),g=pe.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${y.current}"]`):null,[]),u=pe.useRef(null),d=pe.useRef(null),x=pe.useCallback(()=>{u.current!=null&&clearTimeout(u.current),u.current=null;},[]),N=pe.useCallback(()=>{d.current!=null&&clearTimeout(d.current),d.current=null;},[]),v=pe.useCallback(()=>{N(),d.current=window.setTimeout(()=>f(false),0);},[N,f]),R=pe.useCallback(()=>{let k=a.current?.getBoundingClientRect();return k?{x:k.left+k.width/2,y:k.top+k.height/2}:{x:0,y:0}},[]),M=pe.useCallback((k,W)=>{p.current={x:k,y:W},F(),f(true);},[F,f]),B=typeof t=="function"?t({close:l}):t,_=$s(B),K=k=>{if(!pe.isValidElement(k))return k;let W=il(k),T=k,I=T.props.children,z=I==null?I:Array.isArray(I)?I.map(P=>pe.isValidElement(P)?K(P):P):pe.isValidElement(I)?K(I):I;if(W==="DropdownMenu"){let P=T.props.onOpenChange;return pe.cloneElement(T,{...T.props,open:c,onOpenChange:j=>{P?.(j),f(j);},children:z})}if(W==="DropdownMenuContent"){let P=T.props.onMouseEnter,j=T.props.onMouseLeave;return pe.cloneElement(T,{...T.props,anchor:h,"data-cz-id":y.current,onMouseEnter:q=>{N(),P?.(q);},onMouseLeave:q=>{v(),j?.(q);},children:z})}return z===I?T:pe.cloneElement(T,{...T.props,children:z})},E=_?K(B):B,A=pe.useCallback(k=>{k.preventDefault(),M(k.clientX,k.clientY);},[M]),w=pe.useCallback(k=>{n==="contextmenu"&&A(k);},[n,A]),D=pe.useCallback(k=>{n==="dblclick"&&A(k);},[n,A]),H=pe.useCallback(k=>{n==="click"&&A(k);},[n,A]),L=pe.useCallback(k=>{if(n!=="hover")return;x(),N();let W=r==="center"?R():{x:k.clientX,y:k.clientY};u.current=window.setTimeout(()=>{let T=W.x+(r==="cursor"?s:0),I=W.y+(r==="cursor"?s:0);M(T,I);},0);},[n,r,s,R,M,x,N]),O=pe.useCallback(k=>{n==="hover"&&c&&r==="cursor"&&!_&&(p.current={x:k.clientX+s,y:k.clientY+s},F());},[n,c,r,_,s,F]),$=pe.useCallback(()=>{n==="hover"&&(x(),v());},[n,x,v]);pe.useEffect(()=>{if(n!=="hover")return;let k=()=>{if(!c)return;let W=a.current?.matches(":hover"),T=g()?.matches?.(":hover");W||T?N():v();};return window.addEventListener("pointermove",k,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",k,{capture:true})},[c,n,g,N,v]),pe.useEffect(()=>{let k=()=>{if(c)if(n==="hover"){let W=a.current?.matches(":hover"),T=g()?.matches?.(":hover");if(W||T?N():v(),r==="center"&&a.current){let I=R();p.current={x:I.x,y:I.y},F();}}else f(false);};return window.addEventListener("scroll",k,true),window.addEventListener("resize",k,true),()=>{window.removeEventListener("scroll",k,true),window.removeEventListener("resize",k,true);}},[c,n,r,R,F,f,N,v,g]),pe.useEffect(()=>()=>{x(),N();},[x,N]);let S=({children:k})=>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"&&N(),onMouseLeave:()=>n==="hover"&&v(),children:k}):null;return jsxs("div",{ref:a,onContextMenu:w,onDoubleClick:D,onClick:H,onMouseEnter:L,onMouseMove:O,onMouseLeave:$,css:css({position:"relative"}),className:"plainframe-ui-context-zone-wrapper",children:[e,_?E:jsx(S,{children:E})]})};var Wn=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,tm=pe.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:f=false,chipVariant:l="subtle",rounded:p=false,margin:b=10,css:m,labelCss:C,strokeCss:F,className:h,...y},g){let u=U(),{t:d,strokeColor:x,labelTextColor:N,chipSubtleBg:v,chipOutlinedBg:R,outerM:M,padX:B,verticalStrokeMargin:_}=useMemo(()=>{let D=typeof s=="number"?`${s}px`:s,H=u.surface.border,L=u.text.secondary,O=u.surface.subtleBg,$=u.surface.panelBg,S=Wn(b,"10px"),k=o==="horizontal"?n==="middle"?Wn(c):n==="inset"?Wn(i,"0px"):"0":"0",W=o==="vertical"?n==="middle"?Wn(c):n==="inset"?Wn(i,"0px"):"0":"0";return {t:D,strokeColor:H,labelTextColor:L,chipSubtleBg:O,chipOutlinedBg:$,outerM:S,padX:k,verticalStrokeMargin:W}},[s,u,o,n,c,i,b]),K=useMemo(()=>css([{display:"flex",alignItems:"center"},o==="vertical"?{flexDirection:"column",alignSelf:"stretch",width:t?"max-content":d,minWidth:t?"max-content":d,marginLeft:M,marginRight:M}:{flexDirection:"row",width:a?Wn(a):"100%",minWidth:0,paddingLeft:B,paddingRight:n==="middle"?B:"0",marginTop:M,marginBottom:M},...Array.isArray(m)?m:m?[m]:[]]),[o,t,d,M,a,B,n,m]),E=useMemo(()=>css([{background:x,borderRadius:p?u.radius.full:u.radius.xs},o==="vertical"?{width:d,minHeight:18,flex:1,marginTop:_,marginBottom:_}:{height:d,flex:1}]),[x,p,u.radius.full,u.radius.xs,o,d,_]),A=useMemo(()=>css([{margin:f?o==="vertical"?"4px 0":0:o==="vertical"?"2px 0":0,padding:f?"3px 7px":0,borderRadius:f?p?u.radius.full:`calc(${u.radius.sm} * 0.75)`:`calc(${u.radius.sm} * 0.75)`,color:N,fontWeight:500,fontSize:13,textAlign:"center",alignSelf:"center",whiteSpace:o==="vertical"?"normal":"pre",wordBreak:o==="vertical"?"break-all":void 0,...f?l==="subtle"?{background:v,border:"none"}:{background:R,border:`${d} solid ${x}`}:{}},...Array.isArray(C)?C:C?[C]:[]]),[f,o,p,u.radius.full,u.radius.sm,N,l,v,R,d,x,C]),w=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[E,F]}),[E,F]);return o==="vertical"?jsxs("div",{ref:g,"data-direction":"vertical","data-variant":n,"data-chip":f?"true":void 0,className:["plainframe-ui-divider-wrapper","is-vertical",h||""].join(" ").trim(),css:K,...y,children:[t&&r!=="top"&&w,t&&jsx("span",{className:"plainframe-ui-divider-label",css:A,children:t}),t&&r!=="bottom"&&w,!t&&w]}):jsxs("div",{ref:g,"data-direction":"horizontal","data-variant":n,"data-chip":f?"true":void 0,className:["plainframe-ui-divider-wrapper",h||""].join(" ").trim(),css:K,...y,children:[t&&r!=="left"&&w,t&&jsx("span",{className:"plainframe-ui-divider-label",css:A,children:t}),t&&r!=="right"&&w,!t&&w]})}));var fl=pe.createContext(null),gl=()=>{let e=useContext(fl);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},bl=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,f=useCallback(p=>{t===void 0&&c(p),o?.(p);},[t,o]),l=useMemo(()=>({open:i,setOpen:f,lockScroll:r,closeOnEscape:s}),[i,f,r,s]);return jsx(fl.Provider,{value:l,children:e})},rm=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=gl(),c=!!e&&pe.isValidElement(t),i=useCallback(l=>{if(c){let p;pe.isValidElement(t)&&(p=t.props.onClick),p?.(l);}r.onClick?.(l),l.defaultPrevented||a(true);},[c,t,r.onClick,a]),f=useCallback(l=>{if((l.key==="Enter"||l.key===" ")&&(l.preventDefault(),a(true)),c){let p;pe.isValidElement(t)&&(p=t.props.onKeyDown),p?.(l);}r.onKeyDown?.(l);},[c,t,r.onKeyDown,a]);if(c){let l=t,p=l.props.css;return pe.cloneElement(l,{...l.props||{},className:[l.props.className,n].filter(Boolean).join(" ")||void 0,css:[p,o].filter(Boolean),onClick:i,onKeyDown:f,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,onClick:i,onKeyDown:f,...r,children:t})});rm.displayName="DrawerTrigger";var vo=0,hl="",yl="",sm=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function am(){if(!(typeof document>"u")){if(vo===0){let e=document.body;hl=e.style.overflow||"",yl=e.style.paddingRight||"";let t=sm();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}vo+=1;}}function im(){if(!(typeof document>"u")&&(vo>0&&(vo-=1),vo===0)){let e=document.body;e.style.overflow=hl,e.style.paddingRight=yl;}}var lm=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,xl=forwardRef(function({children:t,width:n,height:o,position:r="left",variant:s="inset",margin:a=10,radius:c,backdropBlur:i=true,backdropBlurDepth:f,closeOnClickAway:l=true,transitionMs:p,snapClosePct:b=.33,velocityClosePxS:m=950,dragElasticOut:C=.2,className:F,css:h,...y},g){let u=U(),{open:d,setOpen:x,lockScroll:N,closeOnEscape:v}=gl();useEffect(()=>{if(!(!N||!d))return am(),()=>im()},[d,N]);let R=useMemo(()=>lm(a,0),[a]),M=useMemo(()=>r==="left"||r==="right"?"x":"y",[r]),B=useMemo(()=>r==="left"||r==="top"?-1:1,[r]),_=useMemo(()=>n??(r==="left"||r==="right"?320:s==="inset"?`calc(100% - ${R*2}px)`:"100%"),[n,r,s,R]),K=useMemo(()=>o??(r==="top"||r==="bottom"?420:s==="inset"?`calc(100% - ${R*2}px)`:"100%"),[o,r,s,R]),E=useMemo(()=>{let V=String(u.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,u.radius.lg]),A=useMemo(()=>c??(s==="inset"?u.radius.lg:E),[c,s,u.radius.lg,E]),w=useMemo(()=>s==="inset"?{top:r==="bottom"?void 0:R,bottom:r==="top"?void 0:R,left:r==="right"?void 0:R,right:r==="left"?void 0:R}:{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,R]),D=useRef(null),H=useCallback(()=>{let V=D.current;if(!V)return 1;let Y=V.getBoundingClientRect();return M==="x"?Y.width:Y.height},[M]),L=useMemo(()=>({type:"spring",stiffness:520,damping:40,mass:.7}),[]),O=useMemo(()=>({duration:(p??280)/1e3,ease:[.22,1,.36,1]}),[p]),$=useMemo(()=>B*1.1,[B]),S=useMemo(()=>M==="x"?{x:`${$*100}%`,y:0}:{y:`${$*100}%`,x:0},[M,$]),k=useMemo(()=>css({position:"fixed",zIndex:1100,...w,width:_,height:K,backgroundColor:u.surface.panelBg,borderRadius:A,overflowY:"auto",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"transform, box-shadow, opacity",backfaceVisibility:"hidden",pointerEvents:d?"auto":"none",touchAction:M==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[w,_,K,u.surface,A,d,M]),W=useMemo(()=>css({position:"fixed",inset:0,zIndex:1099,background:u.surface.overlayBg,transition:"all .3s ease",...i?{backdropFilter:`blur(${f??"2px"})`}:null}),[i,f,u.surface]),T=useCallback(()=>{l&&x(false);},[l,x]),I=useMemo(()=>M==="x"?{left:B===-1?C:0,right:B===1?C:0}:{top:B===-1?C:0,bottom:B===1?C:0},[M,B,C]),z=useMemo(()=>M==="x"?{left:0,right:0}:{top:0,bottom:0},[M]),P=useMemo(()=>Math.max(0,Math.min(1,b)),[b]),j=useCallback((V,Y)=>{let ie=M==="x"?Y.offset.x:Y.offset.y,ce=M==="x"?Y.velocity.x:Y.velocity.y,me=B*ie>0,De=Math.abs(ie)>=H()*P,Re=B*ce>m;me&&(De||Re)&&x(false);},[M,B,H,P,m,x]),q=useRef(null);useEffect(()=>{if(!d)return;q.current=document.activeElement;let V=setTimeout(()=>{let ce=D.current;if(!ce)return;let me=ce.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');me.length>0?me[0].focus():ce.focus();},100),Y=ce=>{let me=D.current;if(!me||!ce.target)return;let De=ce.target;if(!me.contains(De)){ce.preventDefault();let Re=me.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');Re.length>0?Re[0].focus():me.focus();}},ie=ce=>{ce.key==="Escape"&&v&&(ce.stopPropagation(),x(false));};return document.addEventListener("focusin",Y,true),window.addEventListener("keydown",ie),()=>{clearTimeout(V),document.removeEventListener("focusin",Y,true),window.removeEventListener("keydown",ie),q.current&&typeof q.current.focus=="function"&&q.current.focus();}},[d,x,v]);let{...te}=y;return jsx(AnimatePresence,{children:d?jsxs(Fragment,{children:[jsx(motion.div,{role:"presentation","aria-hidden":true,css:W,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:p?O:{duration:.18,ease:"linear"},onClick:T},"overlay"),jsx(motion.div,{ref:V=>{D.current=V,typeof g=="function"?g(V):g&&(g.current=V);},role:"dialog","aria-modal":"true",tabIndex:-1,"data-position":r,"data-variant":s,className:["plainframe-ui-drawer",F||""].join(" ").trim(),css:[k,h],drag:M,dragConstraints:z,dragElastic:I,dragMomentum:false,dragDirectionLock:true,onDragEnd:j,initial:{...S,opacity:.98},animate:{x:0,y:0,opacity:1},exit:{...S,opacity:.98},transition:p?O:L,...te,children:t},"panel")]}):null})});xl.displayName="DrawerContent";var cm=forwardRef(function({open:t,on:n,defaultOpen:o,defaultOn:r,onOpenChange:s,onClose:a,children:c,...i},f){let l=t!==void 0?t:n,p=o!==void 0?o:r,b=l!==void 0,[m,C]=useState(!!p),F=b?!!l:m,h=useCallback(y=>{b||C(y),y||a?.(),s?.(y);},[b,a,s]);return jsx(bl,{open:F,onOpenChange:h,children:jsx(xl,{ref:f,...i,children:c})})});cm.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"},f=p=>b=>{b.target===b.currentTarget&&(b.propertyName==="opacity"||b.propertyName==="filter")&&r?.(),p?.(b);};if(s&&isValidElement(e)){let p=e,b=p.props.css,m=Array.isArray(b)?[...b,i]:b?[b,i]:[i],C=["plainframe-ui-transition-fade",p.props.className||"",a||""].join(" ").trim(),F=p.props.onTransitionEnd;return cloneElement(p,{...p.props,css:m,className:C,onTransitionEnd:f(F)})}let l=css(i);return jsx("div",{className:["plainframe-ui-transition-fade",a||""].join(" ").trim(),css:l,onTransitionEnd:f(),children:e})};var vl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Cl=pe.memo(({direction:e="row",gap:t="sm",justify:n,align:o="center",className:r,css:s,children:a,width:c,height:i,...f})=>{let l=U(),p=e==="vertical"||e==="column"?"column":"row",b=t===void 0?void 0:typeof t=="number"?t:l.spacing[t]??t,m=css({display:"flex",flexDirection:p,gap:b,justifyContent:n,alignItems:o,maxWidth:vl(c),width:c?"100%":void 0,maxHeight:vl(i),height:i?"100%":void 0,boxSizing:"border-box"});return jsx("div",{className:["plainframe-ui-flex",r||""].join(" ").trim(),css:[m,s],...f,children:a})});Cl.displayName="Flex";var _s=({children:e,duration:t=300,delay:n=0,on:o=false,initialScale:r=0,finalScale:s=1,onAnimationEnd:a,asChild:c=false,className:i})=>{let f={transform:o?`scale(${s})`:`scale(${r})`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},l=b=>m=>{m.target===m.currentTarget&&m.propertyName==="transform"&&a?.(),b?.(m);};if(c&&isValidElement(e)){let b=e,m=b.props.css,C=Array.isArray(m)?[...m,f]:m?[m,f]:[f],F=b.props.onTransitionEnd,h=["plainframe-ui-transition-grow",b.props.className||"",i||""].join(" ").trim();return cloneElement(b,{...b.props,css:C,className:h,onTransitionEnd:l(F)})}let p=css(f);return jsx("div",{className:["plainframe-ui-transition-grow",i||""].join(" ").trim(),css:p,onTransitionEnd:l(),children:e})};var Rl={h1:{size:"2.25rem",weight:800,lh:1.1,ls:"-0.02em"},h2:{size:"1.875rem",weight:700,lh:1.15,ls:"-0.01em"},h3:{size:"1.5rem",weight:600,lh:1.2,ls:"-0.005em"},h4:{size:"1.25rem",weight:500,lh:1.2,ls:"0"},h5:{size:"1.125rem",weight:500,lh:1.3,ls:"0"},h6:{size:"1rem",weight:500,lh:1.3,ls:"0"},body:{size:"sm",weight:400,lh:1.4,ls:"0"},caption:{size:"xs",weight:400,lh:1.4,ls:"0.01em"}},wm=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),Em={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"span",caption:"span"},Kn=pe.memo(({variant:e="body",children:t,color:n,size:o,weight:r,lineHeight:s,letterSpacing:a,align:c="left",textTransform:i="none",whiteSpace:f="normal",decoration:l="none",decorationStyle:p="solid",decorationThickness:b=1,decorationColor:m,italic:C,className:F,style:h,as:y})=>{let g=U(),u=Rl[e]??Rl.body,d=y??Em[e]??"span",x=A=>A==null?u.size:typeof A=="number"?A:g?.typography?.sizes?.[A]??A,N=x(o)??x(u.size),v=r??u.weight,R=s??u.lh,M=a??u.ls,B=n==="secondary"?g.text.secondary:n==="primary"?g.text.primary:n??"inherit",_=m??g.surface.border,K=css({boxSizing:"border-box",display:c==="left"?"inline":"block",textAlign:c==="left"?void 0:c,fontFamily:g?.typography?.fonts?.sans||"inherit",fontSize:N,fontWeight:v,lineHeight:R,letterSpacing:M,color:B,textTransform:i,whiteSpace:f,fontStyle:C?"italic":"normal",margin:0,padding:0}),E=l==="none"?css({textDecoration:"none"}):css({textDecorationLine:l,textDecorationStyle:p,textDecorationColor:_,textDecorationThickness:wm(b),textDecorationSkipInk:"auto"});return jsx(d,{className:[`pfui-typo-${e}`,F||""].join(" ").trim(),css:[K,E],style:h,"data-variant":e,children:t})});Kn.displayName="Typography";var qs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Im=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){if(["xs","sm","md","lg","xl","full"].includes(e)){let n=t.radius&&t.radius[e]||t.radii&&t.radii[e];return qs(typeof n=="number"||typeof n=="string"?n:e)}return e}}},wl=forwardRef(function({src:t,alt:n="",width:o,height:r,radius:s="md",shadow:a=false,hoverEffect:c="none",label:i,labelAlign:f="center",aspectRatio:l,loading:p="lazy",decoding:b="async",fetchPriority:m,srcSet:C,sizes:F,placeholder:h,blurDataURL:y,placeholderColor:g="#f1f1f1",fallbackSrc:u,className:d,css:x,onClick:N,onLoad:v,onError:R,...M},B){let[_,K]=useState(false),[E,A]=useState(false),[w,D]=useState(false),H=U(),L=Im(s,H)??"0px",O=i?"figure":"div",$=css({display:"flex",flexDirection:"column",gap:i?H.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${L})`}),S=css({position:"relative",borderRadius:`var(--pfui-image-radius, ${L})`,maxWidth:o?qs(o):"100%",maxHeight:r?qs(r):void 0,width:o?"100%":void 0,height:r?"100%":void 0,aspectRatio:l,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:_&&(c==="rotate"||c==="scale-rotate")?"rotate(3deg)":"none",cursor:N?"pointer":void 0}),k=css({position:"absolute",inset:0,background:h==="color"?g:void 0,backgroundImage:h==="blur"&&y?`url(${y})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:h==="blur"?"blur(8px)":void 0,transition:"opacity 0.3s ease",opacity:w?0:1,pointerEvents:"none"}),W=css({width:"100%",height:"100%",display:"block",objectFit:"cover",transform:_&&(c==="scale"||c==="scale-rotate")?"scale(1.08)":"none",transition:"transform 0.3s ease",willChange:"transform"});return jsxs(O,{className:["plainframe-ui-image",d||""].join(" ").trim(),css:[$,x],tabIndex:-1,children:[jsxs("div",{className:"plainframe-ui-image-frame",css:S,onMouseEnter:()=>K(true),onMouseLeave:()=>K(false),onClick:N,children:[!w&&h&&jsx("div",{"aria-hidden":true,className:"plainframe-ui-image-placeholder",css:k}),jsx("img",{ref:B,className:"plainframe-ui-image-img",css:W,src:E&&u?u:t,alt:n,srcSet:C,sizes:F,loading:p,decoding:b,fetchPriority:m,onLoad:T=>{D(true),v?.(T);},onError:T=>{A(true),R?.(T);},...M})]}),i&&jsx(Kn,{as:"figcaption",variant:"caption",align:f,children:i})]})});wl.displayName="Image";var El=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Pm=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}},Dm=e=>e*Math.PI/180,Nm=(e,t,n)=>{let o=Math.abs(Dm(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 Hm(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 Lm=(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,Sl=[1.02,1.03,1.02],kl=[1.06,1.08,1.06],Bm={sm:150,md:200,lg:260,xl:340},$m=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function zm(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 $m(typeof n=="number"||typeof n=="string"?n:e)}return e}}}var Om=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:f=false,cursor:l,outline:p,outlineColor:b,outlineWidth:m=3,outlineOffset:C=0,radius:F="md",label:h,labelAlign:y="center",css:g,className:u,...d}){let x=U(),N=Pm(r)??4/5,v=typeof o=="string"?o:void 0,R=typeof o=="number"?o:v&&/px$/.test(v)?parseFloat(v):Bm[s],M=Math.max(1,R/N),_=Children.toArray(t).filter(isValidElement).slice(0,i),K=_.length,E=Hm(n,K),A=_.map((V,Y)=>Lm(n,K,Y)),w=V=>M*.6*A[V],D=V=>w(V)*N,H=0,L=0;for(let V=0;V<K;V++){let Y=D(V),ie=w(V),ce=Math.max(Math.abs(E.base.ang[V]??0),Math.abs(E.exp.ang[V]??0)),me=Math.max(Math.abs(E.base.dx[V]??0),Math.abs(E.exp.dx[V]??0)),De=Math.max(Math.abs(E.base.dy[V]??0),Math.abs(E.exp.dy[V]??0)),Re=a==="expand"?kl[V]??1.08:a==="reveal"?Sl[V]??1.03:1,Ce=Nm(Y,ie,ce),ke=Ce.w*Re,Te=Ce.h*Re,Q=me/100*Y*Re,le=De/100*ie*Re;H=Math.max(H,ke/2+Q),L=Math.max(L,Te/2+le);}let O=Math.max(1,2*H),$=Math.max(1,2*L),S=Math.min(1,R/O,M/$),k=c===void 0?"pointer":"controlled",W=c?"true":void 0,T=css({display:"flex",flexDirection:"column",cursor:l||"auto",lineHeight:0,position:"relative",isolation:"isolate",gap:h?x.spacing.xs:0}),I=css({position:"relative",width:El(typeof o=="number"?o:R)??(typeof o=="string"?o:void 0),height:El(M)}),z=css({position:"absolute",inset:0,left:"50%",top:"50%",width:`${O}px`,height:`${$}px`,transform:`translate(-50%, -50%) scale(${S})`,transformOrigin:"center center"}),P=zm(F,x)??"0px",j=V=>{let Y=n==="fan"?`rotate(${E.base.ang[V]}deg) translate(${E.base.dx[V]}%, ${E.base.dy[V]}%)`:n==="slide"?`translate(${E.base.dx[V]}%, ${E.base.dy[V]}%) rotate(${E.base.ang[V]}deg)`:n==="domino"?`translate(0%, ${E.base.dy[V]}%)`:`translate(${E.base.dx[V]}%, ${E.base.dy[V]}%) rotate(${E.base.ang[V]}deg)`,ie=n==="fan"?`rotate(${E.exp.ang[V]}deg) translate(${E.exp.dx[V]}%, ${E.exp.dy[V]}%)`:n==="slide"?`translate(${E.exp.dx[V]}%, ${E.exp.dy[V]}%) rotate(${E.exp.ang[V]}deg)`:n==="domino"?`translate(0%, ${E.exp.dy[V]}%)`:`translate(${E.exp.dx[V]}%, ${E.exp.dy[V]}%) rotate(${E.exp.ang[V]}deg)`,ce=a==="reveal"?"translate(0,0) rotate(0) scale(1)":`${Y} scale(1)`,me=a==="expand"?`${ie} scale(${kl[V]??1.06})`:a==="reveal"?`${Y} scale(${Sl[V]??1.03})`:`${Y} scale(1)`;return css({position:"absolute",top:"50%",left:"50%",transform:`translate(-50%, -50%) ${ce}`,transition:"transform .22s ease",willChange:"transform",backfaceVisibility:"hidden",zIndex:n==="fan"&&V===1?10:V+1,lineHeight:0,boxShadow:f?"rgba(0,0,0,.12) 0 8px 20px":"none",outline:p?`${m}px solid ${b??x.surface.appBg}`:void 0,outlineOffset:p?C:void 0,pointerEvents:"auto",".plainframe-ui-image-stack-wrapper[data-hover-mode='pointer']:hover &":{transform:`translate(-50%, -50%) ${me}`},".plainframe-ui-image-stack-wrapper[data-hover-mode='controlled'][data-hovered='true'] &":{transform:`translate(-50%, -50%) ${me}`}})},q=V=>css({width:`${D(V)}px`,aspectRatio:`${N}`,position:"relative",overflow:"hidden",borderRadius:P,"--pfui-image-radius":P,"& > *":{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(h?"figure":"div",{className:["plainframe-ui-image-stack-wrapper",u||""].join(" ").trim(),"data-hover-mode":k,"data-hovered":W,css:[T,g],tabIndex:-1,...d,children:[jsx("div",{className:"plainframe-ui-image-stack",css:I,children:jsx("div",{className:"plainframe-ui-image-stack-stage",css:z,children:_.map((V,Y)=>jsx("div",{className:"plainframe-ui-image-stack-item",css:j(Y),children:jsx("div",{className:"plainframe-ui-image-stack-frame",css:q(Y),children:V})},Y))})}),h&&jsx(Kn,{as:"figcaption",variant:"caption",align:y,children:h})]})});var Il=e=>typeof e=="number"?`${e}px`:e,Ml={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function _m(e,t){if(e==null){let n=t.radius?.xs??t.radius?.sm??3;return Il(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Il(n)}return e}function jm(e){if(typeof e!="string")return false;let t=e.trim();return !(!t||t.length>4||/[A-Za-z0-9]/.test(t))}var Vm=forwardRef(function({children:t,variant:n="outlined",size:o="sm",radius:r,mono:s=true,uppercase:a=false,symbolBoost:c=2,css:i,className:f="plainframe-ui-kbd",...l},p){let b=U(),m=ye(),C=Ml[o]??Ml.sm,F=_m(r,b),h={br:b.neutral[300],txt:b.neutral[800],inset:b.neutral[0]},y=css({all:"unset",boxSizing:"border-box",display:"inline-flex !important",alignItems:"center",justifyContent:"center",minHeight:n==="ghost"?void 0:`${C.h}px !important`,paddingInline:n==="ghost"?0:`${C.px}px !important`,paddingBlock:"0 !important",fontFamily:s?b.typography.fonts.mono:"inherit",fontSize:`${C.font}px !important`,fontWeight:600,letterSpacing:.2,textTransform:a?"uppercase":"none",borderRadius:F,userSelect:"none",verticalAlign:"baseline",position:"relative",outline:"none"}),g=css({"&&":{background:b.surface.subtleBg,border:"none",boxShadow:"none",color:h.txt}}),u=css({"&&":{background:"transparent",color:h.txt,border:"none",boxShadow:"none"}}),d=css({"&&":{background:b.surface.panelBg,color:h.txt,border:`1px solid ${h.br}`,boxShadow:`inset 0 1px 0 ${h.inset}AA, 0 1px 0 rgba(0,0,0,0.03)`}}),x=n==="subtle"?g:n==="ghost"?u:d,v=s&&c>0&&jm(t)?jsx("span",{css:css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:`${C.font+c}px`,lineHeight:1}),children:t}):t;return jsx("kbd",{ref:p,className:f,css:[m(),y,x,i],...l,children:v})});var Xm=(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 l=Xm(i,t==="left"||t==="right"?"100vw":"100vh"),p=t==="left"?`-${l}`:t==="right"?l:"0",b=t==="up"?l:t==="down"?`-${l}`:"0",m={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"},C=h=>y=>{y.target===y.currentTarget&&y.propertyName==="transform"&&s?.(),h?.(y);};if(a&&isValidElement(e)){let h=e,y=h.props.css,g=Array.isArray(y)?[...y,m]:y?[y,m]:[m],u=["plainframe-ui-transition-slide",h.props.className||"",c||""].join(" ").trim(),d=h.props.onTransitionEnd;return cloneElement(h,{...h.props,css:g,className:u,onTransitionEnd:C(d)})}let F=css(m);return jsx("div",{className:["plainframe-ui-transition-slide",c||""].join(" ").trim(),css:F,onTransitionEnd:C(),children:e})};var Xs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Dl=pe.createContext(null),Nl=()=>{let e=useContext(Dl);if(!e)throw new Error("Modal components must be used within <Modal>.");return e},tf=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,f=useCallback(p=>{t===void 0&&c(p),o?.(p);},[t,o]);useEffect(()=>{if(!i||!s)return;let p=b=>{b.key==="Escape"&&(b.stopPropagation(),f(false));};return window.addEventListener("keydown",p,true),()=>window.removeEventListener("keydown",p,true)},[i,s,f]);let l=useMemo(()=>({open:i,setOpen:f,lockScroll:r,closeOnEscape:s}),[i,f,r,s]);return jsx(Dl.Provider,{value:l,children:e})},Hl=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=Nl(),c=!!e&&pe.isValidElement(t),i=useCallback(l=>{if(c){let p;pe.isValidElement(t)&&(p=t.props.onClick),p?.(l);}r.onClick?.(l),l.defaultPrevented||a(true);},[c,t,r.onClick,a]),f=useCallback(l=>{if((l.key==="Enter"||l.key===" ")&&(l.preventDefault(),a(true)),c){let p;pe.isValidElement(t)&&(p=t.props.onKeyDown),p?.(l);}r.onKeyDown?.(l);},[c,t,r.onKeyDown,a]);if(c){let l=t,p=l.props.css;return pe.cloneElement(l,{...l.props||{},className:[l.props.className,n].filter(Boolean).join(" ")||void 0,css:[p,o].filter(Boolean),"aria-haspopup":"dialog",onClick:i,onKeyDown:f,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,"aria-haspopup":"dialog",onClick:i,onKeyDown:f,...r,children:t})});Hl.displayName="ModalTrigger";var Ll=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:f=true,transitionVariant:l="fade",direction:p="up",transitionDuration:b=300,containerCss:m,backdropCss:C,className:F,...h},y)=>{let g=U(),{open:u,setOpen:d,lockScroll:x}=Nl(),N=pe.useRef(null),v=pe.useRef(null);pe.useEffect(()=>{if(!u)return;v.current=document.activeElement;let E=setTimeout(()=>{let w=N.current;if(!w)return;let D=w.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');D.length>0?D[0].focus():w.focus();},100),A=w=>{let D=N.current;if(!D||!w.target)return;let H=w.target;if(!D.contains(H)){w.preventDefault();let L=D.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');L.length>0?L[0].focus():D.focus();}};return document.addEventListener("focusin",A,true),()=>{clearTimeout(E),document.removeEventListener("focusin",A,true),v.current&&typeof v.current.focus=="function"&&v.current.focus();}},[u]);let R=typeof g.spacing.sm=="number"?`${g.spacing.sm}px`:String(g.spacing.sm),M=css({width:"100%",height:Xs(o),maxWidth:t==="inset"?`min(${Xs(n)||"100%"}, calc(100% - ${R} * 2))`:Xs(n),maxHeight:t==="inset"?`calc(100% - ${R} * 2)`:"100%",margin:t==="inset"?R:void 0}),B=jsx(zn,{role:"dialog","aria-modal":"true",tabIndex:-1,className:["plainframe-ui-modal",F||""].join(" ").trim(),padding:s,radius:r,variant:"panel",css:[M,m],ref:E=>{N.current=E,typeof y=="function"?y(E):y&&(y.current=E);},...h,children:e}),_=l==="none"?B:l==="slide"?jsx(Gs,{on:u,direction:p,duration:b,children:B}):l==="grow"?jsx(_s,{initialScale:.75,on:u,duration:b,children:B}):jsx(Ks,{on:u,duration:b,children:B});if(!a)return jsx(Fragment,{children:_});let K=css(t==="full"?{alignItems:"start",justifyItems:"start",justifyContent:"start"}:{alignItems:"center",justifyItems:"center",justifyContent:"center"});return jsx(Ss,{on:u,blur:c,blurDepth:i,onClickAway:f?()=>d(false):void 0,css:[K,C].filter(Boolean),contentCss:K,lockScroll:x,children:_})});Ll.displayName="ModalContent";var uf=({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:f="subtle",gap:l,className:p,css:b})=>{let m=U(),C=ye(),F=t!==void 0,[h,y]=useState(n),g=Math.max(1,e),u=Ir(F?t:h,1,g),d=useCallback(S=>{let k=Ir(S,1,g);F||y(k),o?.(k);},[F,g,o]),x=useMemo(()=>df({count:g,page:u,siblingCount:r,boundaryCount:s}),[g,u,r,s]),N=m.palette?.primary?.[600],v=m.surface?.border,R=f==="subtle"?m.surface.subtleHover:f==="ghost"?m.surface?.subtleBg:m.surface.panelHover,M=m.text?.primary??"#111",B=f==="subtle"?m.surface?.subtleBg:"transparent",_=css({display:"inline-flex",alignItems:"center",gap:l??6,flexWrap:"wrap",borderRadius:m.radius?.md,background:B,padding:f==="subtle"?m.spacing.xs:0,userSelect:"none"},...Array.isArray(b)?b:b?[b]:[]),K=css({minWidth:28,height:28,padding:"0 10px",borderRadius:m.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}),E=css({width:28,minWidth:28,height:28,padding:0}),A=(S=false)=>css([K,C({color:S?"primary":"neutral"}),f==="outlined"?S?{background:N,color:m.text.onColors.primary,borderColor:N}:{background:"transparent",borderColor:v,":hover":{background:R}}:f==="ghost"?S?{background:N,color:m.text.onColors.primary}:{":hover":{background:R}}:S?{background:N,color:m.text.onColors.primary,borderColor:N}:{":hover":{background:R}}]),w=useCallback(()=>d(1),[d]),D=useCallback(()=>d(g),[d,g]),H=useCallback(()=>{u===1?i&&d(g):d(u-1);},[u,i,g,d]),L=useCallback(()=>{u===g?i&&d(1):d(u+1);},[u,i,g,d]),O=a||u===1&&!i,$=a||u===g&&!i;return jsxs("nav",{"aria-label":"Pagination",className:["plainframe-ui-pagination",p||""].join(" ").trim(),css:_,onKeyDown:S=>{a||(S.key==="ArrowLeft"&&(S.preventDefault(),H()),S.key==="ArrowRight"&&(S.preventDefault(),L()),S.key==="Home"&&(S.preventDefault(),w()),S.key==="End"&&(S.preventDefault(),D()));},children:[c&&jsx("button",{className:"plainframe-ui-pagination-first-button",type:"button","aria-label":"First page","aria-disabled":O,disabled:O,css:[A(false),E],onClick:w,style:{backgroundColor:f==="subtle"?m.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":O,disabled:O,css:[A(false),E],onClick:H,style:{backgroundColor:f==="subtle"?m.surface?.panelBg:void 0},children:jsx(ChevronLeft,{strokeWidth:3,css:{width:14,height:14}})}),x.map((S,k)=>typeof S=="number"?jsx("button",{className:"plainframe-ui-pagination-page-button",type:"button","aria-label":S===u?`Page ${S}, current page`:`Go to page ${S}`,"aria-current":S===u?"page":void 0,css:A(S===u),onClick:()=>d(S),children:S},S):jsx("span",{className:"plainframe-ui-pagination-ellipsis","aria-hidden":true,css:css([K,C(),{borderColor:"transparent",cursor:"default",opacity:.8,padding:0,minWidth:28}]),children:"\u2026"},`e${k}`)),jsx("button",{className:"plainframe-ui-pagination-next-button",type:"button","aria-label":"Next page","aria-disabled":$,disabled:$,css:[A(false),E],onClick:L,style:{backgroundColor:f==="subtle"?m.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":$,disabled:$,css:[A(false),E],onClick:D,style:{backgroundColor:f==="subtle"?m.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 df({count:e,page:t,siblingCount:n,boundaryCount:o}){if(e<=0)return [1];let r=2*o+2*n+3;if(e<=r)return kr(1,e);let s=kr(1,Math.min(o,e)),a=kr(Math.max(e-o+1,o+1),e),c=Ir(t-n,o+2,Math.max(o+2,e-o-2*n-1)),i=Ir(t+n,Math.min(o+2+2*n,e-o-1),e-o-1),f=[],l=p=>{let b=f[f.length-1];b!==p&&(b==="ellipsis"&&p==="ellipsis"||f.push(p));};return s.forEach(l),c>o+2?l("ellipsis"):o+1<c&&l(o+1),kr(c,i).forEach(l),i<e-o-1?l("ellipsis"):e-o>i&&l(e-o),a.forEach(l),f}function kr(e,t){if(t<e)return [];let n=[];for(let o=e;o<=t;o++)n.push(o);return n}var gf=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,bf=pe.memo(({children:e,direction:t="left",width:n,variant:o="solid",className:r,css:s})=>{let a=U(),c=a.surface.border,i=css({display:"inline-block",boxSizing:"border-box",maxWidth:gf(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 Ol=createContext(null),vf=()=>{let e=useContext(Ol);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},Cf=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},Rf=({value:e,defaultValue:t,onChange:n,disabled:o=false,size:r="md",direction:s="horizontal",variant:a="filled",className:c,children:i,anchorOrigin:f,css:l})=>{let p=U(),b=e!==void 0&&n!==void 0,[m,C]=useState(t),F=b?e:m,h=useRef([]),[y,g]=useState(0),u=()=>g(A=>A+1),d=useCallback(A=>{b||C(A),n?.(A);},[b,n]),x=useCallback(A=>(h.current.push(A),u(),h.current.length-1),[]),N=useCallback((A,w)=>{let D=h.current[A];D&&(h.current[A]={...D,...w},u());},[]),v=()=>h.current.map((A,w)=>({it:A,i:w})).filter(({it:A})=>A.ref&&!A.disabled).map(({i:A})=>A),R=useCallback((A,w)=>{let D=v();if(!D.length)return;let H=Math.max(0,D.indexOf(A)),L=D[(H+w+D.length)%D.length],O=h.current[L]?.ref;if(O){O.focus();let $=h.current[L]?.value;$!==void 0&&d($);}},[d]),M=useCallback(A=>{let w=v();if(!w.length)return;let D=A==="first"?w[0]:w[w.length-1],H=h.current[D]?.ref;if(H){H.focus();let L=h.current[D]?.value;L!==void 0&&d(L);}},[d]),B=useMemo(()=>{let A=h.current.filter(D=>D.ref&&!D.disabled);return A.length?A.some(D=>D.value===F)?F:A[0]?.value:void 0},[F,y]),_=useMemo(()=>({selected:F,setSelected:d,disabled:o,size:r,direction:s,variant:a,register:x,update:N,moveFocusBy:R,moveToEdge:M,focusValue:B,theme:p,anchorOrigin:Cf(f)}),[F,d,o,r,s,a,x,N,R,M,B,p,f]),K=css({width:"fit-content"}),E=css({display:"flex",flexDirection:s==="vertical"?"column":"row",gap:p.spacing.sm,width:"fit-content",alignItems:s==="vertical"?"stretch":"center"});return jsx("div",{className:c??"plainframe-ui-radio-group",css:[K,l],children:jsx("div",{className:"plainframe-ui-radio-row",role:"radiogroup","aria-disabled":o||void 0,css:E,children:jsx(Ol.Provider,{value:_,children:i})})})},Tf=({value:e,disabled:t=false,className:n,children:o,css:r})=>{let{selected:s,setSelected:a,disabled:c,size:i,register:f,update:l,moveFocusBy:p,moveToEdge:b,theme:m,variant:C,focusValue:F,anchorOrigin:h}=vf(),y=c||t,g=s===e,u=["sm","md","lg"].includes(i)?i:"md",d=u==="sm"?16:u==="lg"?24:20,x=I=>m.palette?.primary?.[I],N=x(600),v=x(100),R=m.neutral[300],M=m.palette.primary[300],B=m.text.onColors?.primary??m.neutral[0],_="transparent",K=M,E=B;C==="soft"?(_=v,K=null,E=N):C==="outlined"?(_=x(50),K=M,E=N):(_=m.neutral[200],K="transparent",E=B),g&&(C==="outlined"?(_=v,K=M,E=N):C==="filled"?(_=N,K=null,E=B):(_=v,K=null,E=N));let A=C==="filled"?R:m.palette.primary[100],w=useRef(null),D=useRef(-1);useEffect(()=>{D.current=f({ref:w.current,value:e,disabled:!!y});},[f]),useEffect(()=>{l(D.current,{ref:w.current,value:e,disabled:!!y});},[l,y,e]);let H=css({border:"none",background:"transparent",display:"inline-grid",gridTemplateColumns:"auto auto auto",gridTemplateRows:"auto auto auto",columnGap:h.vertical==="center"?m.spacing.sm:0,rowGap:h.vertical==="center"?0:m.spacing.xs,justifyItems:"center",alignItems:"center",opacity:y?.5:1,borderRadius:m.radius.md,cursor:y?"not-allowed":"pointer",transition:"transform .16s ease",fontSize:m.typography.sizes.sm,fontWeight:500,padding:m.spacing.sm,"&:hover .plainframe-ui-radio-circle-outer":y||g?{}:{background:A,boxShadow:C==="outlined"?`inset 0 0 0 ${m.componentHeights.border} ${M}`:"none"},"&:focus-visible .plainframe-ui-radio-circle-outer":{outline:"none"}}),L=css({width:d,height:d,minWidth:d,minHeight:d,borderRadius:m.radius.full,background:_,boxShadow:K?`inset 0 0 0 ${m.componentHeights.border} ${K}`:"none",transition:"background-color .16s ease, box-shadow .16s ease, filter .16s ease",display:"inline-flex",alignItems:"center",justifyContent:"center"}),O=css({width:g?d*.45:0,height:g?d*.45:0,borderRadius:m.radius.full,background:g?E:"transparent",transition:"all 250ms cubic-bezier(.72,1.6,.32,1)",transform:g?"scale(1)":"scale(0.6)",opacity:g?1:0}),$=css({gridColumn:2,gridRow:2,minWidth:0,maxWidth:"100%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",textAlign:"left"}),S=(()=>{let I=h.horizontal,z=h.vertical;return z==="center"?{col:I==="right"?3:1,row:2}:{col:2,row:z==="top"?1:3}})(),W=!y&&F===e?0:-1,T=ye();return jsxs("button",{ref:w,className:n??"plainframe-ui-radio-item",type:"button",role:"radio","aria-checked":g,"aria-disabled":y||void 0,disabled:y,tabIndex:W,onClick:()=>{y||a(e);},onKeyDown:I=>{y||(I.key==="Enter"||I.key===" "?(I.preventDefault(),a(e)):I.key==="ArrowRight"||I.key==="ArrowDown"?(I.preventDefault(),p(D.current,1)):I.key==="ArrowLeft"||I.key==="ArrowUp"?(I.preventDefault(),p(D.current,-1)):I.key==="Home"?(I.preventDefault(),b("first")):I.key==="End"&&(I.preventDefault(),b("last")));},css:[H,T({color:"primary"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[L,css({gridColumn:S.col,gridRow:S.row})],children:jsx("span",{className:"plainframe-ui-radio-circle-dot",css:O})}),o!=null&&jsx("span",{className:"plainframe-ui-radio-label",css:$,children:o})]})};var If=({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 f={transform:`rotate(${o?s:r}deg)`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",transformOrigin:"center center",willChange:"transform",backfaceVisibility:"hidden"},l=b=>m=>{m.target===m.currentTarget&&m.propertyName==="transform"&&a?.(),b?.(m);};if(c&&isValidElement(e)){let b=e,m=b.props.css,C=Array.isArray(m)?[...m,f]:m?[m,f]:[f],F=["plainframe-ui-transition-rotate",b.props.className||"",i||""].join(" ").trim(),h=b.props.onTransitionEnd;return cloneElement(b,{...b.props,css:C,className:F,onTransitionEnd:l(h)})}let p=css(f);return jsx("div",{className:["plainframe-ui-transition-rotate",i||""].join(" ").trim(),css:p,onTransitionEnd:l(),children:e})};var Qs=e=>null;Qs.displayName="SelectItem";var ko=(...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(pe.isValidElement(e)){if(e.type===Qs){t.push(e);return}if(e.type===pe.Fragment){Zs(e.props.children,t);return}}}}var Kl=({value:e,defaultValue:t,onChange:n,label:o,placeholder:r="Select\u2026",startIcon:s,endIcon:a,multiple:c=false,disabled:i=false,size:f="md",variant:l="subtle",fullWidth:p,width:b=200,menuAlign:m="left",menuWidth:C,menuMaxHeight:F=280,wrapperCss:h,labelCss:y,triggerCss:g,menuCss:u,optionCss:d,children:x,className:N,menuSize:v="md",triggerRender:R})=>{let M=U(),B=ye(),_=pe.useId(),K=`${_}-label`,E=`${_}-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}},w=A[f]||A.md,[D,H]=pe.useState(false),L=Q=>H(!!Q),O=typeof e<"u",$=c||Array.isArray(e)||Array.isArray(t),[S,k]=pe.useState(()=>typeof t<"u"?t:$?[]:void 0),W=O?e:S,T=Q=>{O||k(Q),n?.(Q);},I=[];Zs(x,I);let z=I.map((Q,le)=>{let he=Q.props,J=typeof he.children=="string"||typeof he.children=="number"?String(he.children):void 0;return {key:Q.key??le,value:he.value,startIcon:he.startIcon,endIcon:he.endIcon,node:he.children,labelText:J}}),P=Q=>$?(Array.isArray(W)?W:[]).some(he=>Object.is(he,Q)):Object.is(W,Q),j=pe.useMemo(()=>{if($){let le=Array.isArray(W)?W:[];return z.filter(J=>le.some(xe=>Object.is(xe,J.value))).map(J=>J.labelText??J.node)}let Q=z.find(le=>Object.is(le.value,W));if(Q)return Q.labelText??Q.node},[W,$,z]),q=Q=>{i||(Object.is(Q,W)||T(Q),L(false));},te=Q=>{if(i)return;let le=Array.isArray(W)?W:[],J=le.some(xe=>Object.is(xe,Q))?le.filter(xe=>!Object.is(xe,Q)):[...le,Q];T(J);},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:w.radius,minHeight:w.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"},ie=l==="subtle"?{background:M.surface.subtleBg}:l==="outlined"?{background:M.surface.panelBg,border:`1px solid ${M.surface.border}`}:{background:"transparent"},ce={flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",textAlign:"left",gap:8},me={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},De={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},Re=jsx(ChevronsUpDown,{size:16,css:css({color:M.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),Ce=()=>{if(R)return R(j);if(Array.isArray(j)){let le=j.map(J=>typeof J=="string"?J:"").filter(Boolean),he=le.length>0?le.join(", "):j.length>0?`${j.length} selected`:String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(me),children:s}),jsx("span",{css:css(De),title:he,children:he})]})}let Q=j??String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(me),children:s}),jsx("span",{css:css(De),title:typeof Q=="string"?Q:void 0,children:Q})]})},ke={left:"start",center:"center",right:"end"},Te=Q=>{i||(Q.key==="ArrowDown"||Q.key==="ArrowUp"||Q.key==="Enter"||Q.key===" ")&&(Q.preventDefault(),L(true));};return jsxs("div",{css:ko(V,h),className:["plainframe-ui-select-wrapper",N||""].join(" ").trim(),children:[o&&jsx("div",{id:K,className:"plainframe-ui-select-label",css:ko({marginBottom:6,fontSize:M.typography.sizes.sm,fontWeight:500,color:M.text.secondary},y),children:o}),jsxs(Nn,{size:v,open:D,onOpenChange:L,children:[jsx(Hn,{width:"100%",asChild:true,children:jsxs("button",{type:"button",disabled:i,"aria-haspopup":"menu","aria-expanded":D||void 0,"aria-controls":E,"aria-labelledby":o?K:void 0,onKeyDown:Te,onClick:()=>L(!D),className:"plainframe-ui-select-trigger",css:ko(css(Y),css(ie),g,B()),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(ce),children:Ce()}),a??Re]})}),jsx(bn,{id:E,gap:"xs",align:ke[m],sameWidth:C==null,width:C??b,className:"plainframe-ui-select-menu",css:ko({maxHeight:typeof F=="number"?`${F}px`:F,overflowY:"auto"},u),children:z.map((Q,le)=>{let he=P(Q.value);return jsx(Nt,{startIcon:Q.startIcon,endIcon:Q.endIcon,selected:he,disabled:i,closeOnSelect:!$,onSelect:()=>$?te(Q.value):q(Q.value),css:ko(d),className:"plainframe-ui-select-option",children:Q.node},Q.key??le)})})]})]})};Kl.displayName="Select";var ea=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Pf=keyframes`
|
|
13
|
+
`,Gc=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("),Xc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Yc(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(Gc(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]&&Xc.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 to=me.memo(({variant:e="circular",value:t,min:n=0,max:o=100,color:r,size:s,thickness:a,spinDuration:c=.75,wrapperCss:i,trackCss:l,barCss:u,circleCss:m,"aria-label":h})=>{let f=V(),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=Yc(f,r),d=f.surface.subtleBg,p=f.radius?.md;return e==="circular"?jsx(Zc,{size:s,active:b,isDeterminate:T,percent:x,spinDuration:c,wrapperCss:i,trackCss:l,circleCss:m,ariaLabel:h,thickness:a}):jsx(Jc,{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})}),Jc=({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:`${Uc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(i)?i:i?[i]:[]]),p=css([{...b,left:"-200%",right:"100%",animation:`${qc} 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})]})})})},Zc=({size:e,thickness:t=4,active:n,isDeterminate:o,percent:r,spinDuration:s,wrapperCss:a,trackCss:c,circleCss:i,ariaLabel:l})=>{let u=V(),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},lu=css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),cu=css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto"}),uu=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=V(),T=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??{},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(to,{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]),M=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(()=>[cu,{color:d.iconColor}],[d.iconColor]),A=useMemo(()=>css({display:"flex",alignItems:"center",gap:y.gap,marginLeft:y.gap,flex:"0 0 auto"}),[y.gap]),$=useMemo(()=>[uu,{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=me.Children.toArray(u).some(F=>me.isValidElement(F)&&F.type===as),S=me.Children.toArray(u).some(F=>me.isValidElement(F)&&F.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:[M,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:lu,children:u})]}),s&&jsx("div",{className:"plainframe-ui-alert-actions",css:A,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,Yt=e=>e==null?[]:Array.isArray(e)?e:[e],Jt=(...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=me.memo(forwardRef(function({label:t,value:n,defaultValue:o="",onChange:r,placeholder:s,error:a,helperText:c,disabled:i=false,fullWidth:l=false,width:u=250,size: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:M,inputCss:R,labelCss:w,helperRowCss:A,helperTextCss:$,startIconCss:K,endIconCss:W,css:S,onBlur:F,onFocus:I,onKeyDown:P,autoFocus:D,name:B,id:z,tabIndex:E,autoComplete:g,readOnly:v,required:L,maxLength:H,onSurfaceClick:O},_){let N=V(),U=Xo(),G=useId(),se=useMemo(()=>{let ue={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}},Ee=["sm","md","lg"].includes(m)?m:"md";return ue[Ee]},[m,N]),j=N.neutral,J=N.text,le=b==="number",de=b==="password",fe=n!==void 0,[Pe,Te]=useState(o),Re=fe?n:Pe,Ie=useCallback(ue=>{fe||Te(ue),r?.(ue);},[fe,r]),we=/^-?\d*(?:[.,]\d*)?$/,Q=le&&(d!=null&&String(d).includes(".")||/[.,]/.test(Re??"")),ie=le?Q?"decimal":"numeric":void 0,ye=le?Q?"[0-9]*[.,]?[0-9]*":"[0-9]*":void 0,Y=useCallback(ue=>{(ue===""||we.test(ue))&&Ie(ue);},[Ie]),ve=i?j[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",ee=N.componentHeights.border,oe=h==="outlined"?`${ee} solid ${a?N.palette.danger?.[300]??N.surface.border:N.surface.border}`:"none",ae=Jt({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:l?"100%":u!=null?ls(u):void 0,flex:"0 0 auto",fontWeight:500}),ge=useMemo(()=>Jt({fontSize:se.labelFont,fontWeight:500,color:a?N.palette.danger?.[700]??J.primary:i?j[500]:J.primary,marginBottom:4,display:"inline-block"},...Yt(w)),[se.labelFont,a,i,j,J,N.palette.danger,w]),Ne=useMemo(()=>Jt({display:"flex",alignItems:"center",gap:N.spacing.sm,padding:`${ls(se.paddingY)} ${ls(se.paddingX)}`,background:ve,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"},...Yt(M),...Yt(S)),[N,se.minHeight,se.paddingX,se.paddingY,ve,oe,f,i,M,S]),ze=useMemo(()=>Jt({flex:1,minWidth:0,fontSize:se.fontSize,fontWeight:500,fontFamily:"inherit",color:i?j[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 ${ve} 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"}},...Yt(R)),[se.fontSize,i,j,J,a,N.palette.danger,le,ve,R]),X$1=useMemo(()=>Jt({display:"inline-flex",alignItems:"center",color:a?N.palette.danger?.[800]??J.secondary:J.secondary,marginLeft:-3},...Yt(K)),[a,N.palette.danger,J.secondary,K]),re=useMemo(()=>Jt({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},...Yt(W)),[a,N.palette.danger,J.secondary,i,W]),Z=useMemo(()=>Jt({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%"},...Yt(A)),[se.helperFont,a,N.palette.danger,J.secondary,A]),ce=useMemo(()=>Jt({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},...Yt($)),[$]),pe=useRef(null),Ue=useCallback(ue=>{pe.current=ue,_&&(typeof _=="function"?_(ue):_.current=ue);},[_]),Oe=useCallback(ue=>{let Ee=ue.target.value;if(le){Y(Ee);return}H&&Ee.length>H||Ie(Ee);},[le,H,Ie,Y]),[ke,st]=useState(false),He=useCallback(()=>{i||st(ue=>!ue);},[i]),nt=useCallback(()=>{i||(Ie(""),pe.current?.focus());},[i,Ie]),qe=useMemo(()=>{let ue=se.fontSize;if(typeof ue=="number")return ue;let Ee=parseFloat(String(ue));return Number.isFinite(Ee)?Ee:16},[se.fontSize]),Ge=useMemo(()=>T?jsx("span",{css:X$1,children:ti(T,qe)}):null,[T,X$1,qe]),ot=useMemo(()=>css({display:"flex",alignItems:"center",gap:4}),[]),dt=useMemo(()=>{let ue=[];if(de&&y){let bt=ke?jsx(Eye,{strokeWidth:2.5,size:qe}):jsx(EyeOff,{strokeWidth:2.5,size:qe});ue.push(jsx("button",{type:"button",css:re,onMouseDown:Zn=>Zn.preventDefault(),onClick:Zn=>{Zn.stopPropagation(),He();},tabIndex:-1,"aria-label":ke?"Hide password":"Show password",disabled:i,children:bt},"pw-toggle"));}x&&Re&&Re.length>0&&!i&&ue.push(jsx("button",{type:"button",css:re,onMouseDown:bt=>bt.preventDefault(),onClick:bt=>{bt.stopPropagation(),nt();},tabIndex:-1,"aria-label":"Clear",children:jsx(X,{strokeWidth:2.5,size:qe})},"clear"));let Ee=k?jsx("span",{css:re,children:ti(k,qe)},"user-end"):null,at=ue.length>0,De=!!Ee;return !at&&!De?null:!at&&De?Ee:at&&!De?ue.length===1?ue[0]:jsx("span",{css:ot,children:ue}):jsxs("span",{css:ot,children:[ue,Ee]})},[de,y,ke,qe,re,ot,i,x,Re,k,He,nt]),rn=c!=null?`${z??G}-help`:void 0,Jn=z??G,Je=useCallback(ue=>{if(i)return;ue.stopPropagation();let Ee=pe.current;if(!Ee)return;let at=ue.target;if(!(Ee.contains(at)||at.closest("button,[role='button']"))){if(document.activeElement===Ee){ue.preventDefault();return}ue.preventDefault();}},[i]),xt=useCallback(ue=>{if(i)return;let Ee=pe.current;if(Ee&&(O?.(ue),document.activeElement!==Ee)){Ee.focus({preventScroll:true});try{let at=Ee.value?.length??0;Ee.setSelectionRange?.(at,at);}catch{}}},[i,O]);return jsxs("div",{className:["plainframe-ui-textfield",C||""].join(" ").trim(),css:ae,children:[t&&jsx("label",{htmlFor:Jn,className:"plainframe-ui-textfield-label",css:ge,children:t}),jsxs("div",{className:"plainframe-ui-textfield-surface",css:[U({enabled:p!=="none",color:a?"danger":void 0}),Ne],onPointerDownCapture:Je,onClick:xt,"aria-invalid":!!a||void 0,children:[Ge,jsx("input",{ref:Ue,id:Jn,className:"plainframe-ui-textfield-input",css:ze,type:de?ke?"text":"password":b==="number"?"text":b,inputMode:ie,pattern:ye,value:Re,maxLength:le?void 0:H,onChange:le?ue=>Y(ue.target.value):Oe,placeholder:s||"",disabled:i,onBlur:F,onFocus:I,onKeyDown:P,autoFocus:D,name:B,tabIndex:E,autoComplete:g,readOnly:v,required:L,"aria-invalid":!!a||void 0,"aria-describedby":rn}),dt]}),c!=null&&jsx("div",{className:"plainframe-ui-textfield-helper-row",css:Z,children:jsx("span",{id:rn,className:"plainframe-ui-textfield-helper-text",css:ce,children:c})})]})}));Zo.displayName="TextField";var Qo=me.createContext("ghost"),Tt=me.createContext(false),ai=forwardRef(function({variant:t="ghost",size:n="md",width:o,maxHeight:r,unstyled:s=false,className:a,css:c,children:i,label:l,allItemsTabbable:u=false,...m},h){let f=V(),[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]),M=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);},[]),A=useRef(false),$=useCallback(I=>{if(I.target!==I.currentTarget)return;if(A.current){A.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"){A.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,A.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]),F=useCallback(I=>{y.current=I,typeof h=="function"?h(I):h&&(h.current=I);},[h]);return jsx(no.Provider,{value:C,children:jsx(oo.Provider,{value:M,children:jsx(Tt.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:F,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 zu(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var ao=(...e)=>t=>{for(let n of e)zu(n,t);},us=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Ou=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}},Wu=({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);};Ou(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],M=document.activeElement;x.shiftKey&&M===p?(x.preventDefault(),C.focus()):!x.shiftKey&&M===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=me.Children.only(t),m=u.props||{},h=ao(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 me.cloneElement(u,{...f,...T,ref:h,css:[k,n].filter(Boolean)})}return me.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=me.Children.only(o),c=ao(s,r,a.ref);if(e){let l=a.props?.css;return me.cloneElement(a,{ref:c,css:[l,n].filter(Boolean)})}let i=css({display:"inline-block",width:us(t),verticalAlign:"middle",...n});return jsx("span",{ref:c,css:i,children:a})});ui.displayName="PopoverAnchor";function Ku(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=V(),M=Ku(e),{refs:R,x:w,y:A,strategy:$,context:K}=useFloating({open:k,onOpenChange:y,whileElementsMounted:autoUpdate,placement:M,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: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},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:A??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"}),j=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=ao(R.setFloating,T),de=jsx(motion.div,{className:"plainframe-ui-popover",...F({...f,ref:le,...J}),...E,css:[se,j,h],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:k?de:null})})});di.displayName="PopoverContent";var _u=()=>{let e=nr();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var fs=me.memo(forwardRef(function({checked:t,defaultChecked:n=false,onChange:o,disabled:r=false,size:s="md",label:a,className:c,css:i,trackCss:l,thumbCss:u,labelCss:m,...h},f){let T=V(),k=xe(),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,[M,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",A=y[w],$=`${x.slideMs}ms ${x.easing}`,K=T.palette?.primary?.[600]??T.neutral[900],W=T.neutral[300],S=C?K:W,F=C?T.text.onColors.primary:"#ffffff",{trackW:I,trackH:P,thumb:D}=A,B=(P-D)/2,z=css({display:"inline-flex",alignItems:"center",gap:A.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:F,borderRadius:T.radius.xl,transition:`left ${$}, transform ${$}, background-color 0.25s ease`,transform:M?"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 Ju=(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=me.memo(forwardRef(({checked:e,defaultChecked:t=false,onChange:n,disabled:o=false,size:r="md",label:s,description:a,rounded:c=false,checkedIcon:i,color:l="primary",css:u,boxCss:m,checkCss:h,labelCss:f,descriptionCss:T,className:k,...y},x)=>{let b=V(),d=xe(),p=typeof e=="boolean",[C,M]=useState(t),R=p?e:C,w=r==="sm"||r==="lg"?r:"md",A=useMemo(()=>Ju(b,w),[b,w]),{checkedBg:$,checkColor:K,borderCol:W,hoverBg:S,gapPx:F}=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],j=N[G]??N.primary??b.text?.onColors?.primary??b.text.primary,J=typeof A.gap=="number"?A.gap+2:A.gap;return {checkedBg:se,checkColor:j,borderCol:b.surface.border,hoverBg:b.surface.panelHover,gapPx:J}},[A.gap,l,b]),I=useMemo(()=>css({display:"inline-flex",alignItems:s&&a?"flex-start":"center",gap:F,cursor:o?"not-allowed":"pointer",userSelect:"auto",position:"relative",width:"fit-content",borderRadius: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,F,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:A.box,height:A.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${A.borderWidth} solid ${W}`,outlineOffset:`-${A.borderWidth}`,boxShadow:"inset 0 0 0 0.5px var(--pfui-bleed, transparent)",borderRadius:c?b.radius.full:A.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"}),[A.box,A.borderRadius,A.borderWidth,W,c,b.radius.full]),B=useMemo(()=>({w:Math.round(A.box*A.iconRatioW),h:Math.round(A.box*A.iconRatioH)}),[A.box,A.iconRatioH,A.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:A.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:b.text.primary}),[A.labelFont,b.text.primary]),v=useMemo(()=>css({fontSize:A.labelFont,lineHeight:1.25,color:b.text.secondary,fontWeight:400,marginTop:s&&a?b.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[A.labelFont,a,s,b.spacing.xs,b.text.secondary]),L=useCallback(()=>{o||(p?n?.(!R):M(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 ed=()=>useContext(gn),td=()=>useContext(oo),nd=()=>useContext(lr),mn=null,bi=(e,t=35)=>{mn!==null&&window.clearTimeout(mn),mn=window.setTimeout(()=>{e(),mn=null;},t);},io=()=>{mn!==null&&(window.clearTimeout(mn),mn=null);},Ht=me.forwardRef(function({disabled:t=false,destructive:n=false,inset:o,closeOnSelect:r=true,onSelect:s,children:a,className:c,css:i,startIcon:l,endIcon:u,selected:m=false,active:h,meta:f,__index:T,__skipListReg:k,...y},x){let b=ed(),d=nd(),p=ir(),C=co(),M=td(),R=V(),A=!!useContext(Tt),$=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"?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:A?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,A,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=[];A&&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),j=N[se];j&&(document.querySelectorAll("[data-highlighted]").forEach(J=>{J.removeAttribute("data-highlighted");}),j.setAttribute("data-highlighted",""),j.focus(),b&&T!=null&&b.setActiveIndex(se));},L=t?-1:M?.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&&!M?.allItemsTabbable&&H.currentTarget.focus({preventScroll:true});},onMouseEnter:H=>{if($)io();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&&!M?.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&&!M?.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(j=>j.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(j=>j.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=me.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})},lo=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=V(),M=!!useContext(Tt),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:M?-1:-3,borderRadius:p.radius.xs,transition:"background-color .12s ease"}),A=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:A})}),u]});return jsx(Ht,{...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})});lo.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(Tt),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}),M=()=>{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(Ht,{...h,className:["plainframe-ui-menu-switch-item",m||""].join(" ").trim(),ref:f,__index:s,disabled:a,closeOnSelect:false,onSelect:M,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=me.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 od=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=V(),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(Ht,{...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})]})}),fn=forwardRef(function({inset:t,className:n,css:o,children:r,startIcon:s,endIcon:a,wrap:c=false,color:i="primary",...l},u){let m=V(),f=!!useContext(Tt),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})]})});fn.displayName="MenuLabel";var rd=({className:e,css:t,variant:n="full",...o})=>{let r=V(),s=`var(--pfui-panel-pad, ${typeof r.spacing.xs=="number"?r.spacing.xs+"px":String(r.spacing.xs)})`,a=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:"calc(var(--pfui-panel-pad, 0px) * -1)",marginRight:"calc(var(--pfui-panel-pad, 0px) * -1)"}),c=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.md}`,marginRight:`${r.spacing.md}`}),i=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.lg}`,marginRight:0}),l=n==="full"?a:n==="middle"?c:i;return jsx("div",{role:"separator",className:["plainframe-ui-menu-separator",e||""].join(" ").trim(),css:css(l,t),...o})};var Ti=e=>{if(!e||typeof window>"u")return;let t=e.closest("[data-pfui-portal-owner]"),n=e.closest("[data-pfui-scope]"),o=t?.getAttribute("data-pfui-portal-owner")??n?.getAttribute("data-pfui-scope")??void 0;o&&(window.__pfuiActiveScope={id:o,depth:0,ts:Date.now()});},hs=ao,uo=0,cr=null,ur=null,yd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function xd(){if(!(typeof document>"u")){if(uo===0){let e=document.body;cr=e.style.overflow||"",ur=e.style.paddingRight||"";let t=yd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}uo+=1;}}function vd(){if(!(typeof document>"u")&&(uo>0&&(uo-=1),uo===0)){let e=document.body;cr!==null&&(e.style.overflow=cr),ur!==null&&(e.style.paddingRight=ur),cr=null,ur=null;}}var gn=createContext(null),dr=()=>{let e=useContext(gn);if(!e)throw new Error("DropdownMenu components must be used inside <DropdownMenu>.");return e},po=createContext(null),Cd=()=>useContext(po),no=createContext(null),co=()=>useContext(no),wi=createContext(null),ir=()=>useContext(wi),Ei=createContext(false),Rd=()=>useContext(Ei),oo=createContext({allItemsTabbable:true}),lr=me.createContext(null),ys=()=>useContext(lr);function Td(){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 wd=()=>Cd()?.activeIndex??null,Si=0,Ln=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="click",lockScroll:r=true,size:s="md",children:a})=>{let[c,i]=useState(!!t),l=e??c,u=useCallback(F=>{F&&Ti(h.current),e===void 0&&i(F),n?.(F);},[e,n]),m=useRef(`pfui-menu-${++Si}`),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((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 xd(),()=>vd()},[l,r]);let M=ys(),[R]=useState(()=>M??Td()),w=useRef(new Set),A=useMemo(()=>({registerSubMenu:F=>(w.current.add(F),()=>w.current.delete(F)),closeAllSubMenus:()=>{w.current.forEach(F=>F());}}),[]),$=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(Tt.Provider,{value:S,children:jsx(no.Provider,{value:W,children:jsx(wi.Provider,{value:A,children:jsx(po.Provider,{value:K,children:jsx(gn.Provider,{value:$,children:a})})})})})})};Ln.displayName="DropdownMenu";var Bn=me.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,listRef:m,setActiveIndex:h,scheduleSubmenuHover:f,clearSubmenuHover:T,floatingRef:k,menuId:y}=dr(),x=co(),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,M=p&&p.props&&typeof p.props=="object"&&"onClick"in p.props?p.props.onClick:void 0,{onKeyDown:R,onClick:w,...A}=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]),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(),i(!c))),M?.(D),w?.(D);},[l,c,i,M,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:F,onKeyDown:S,...I,...A};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:F,onKeyDown:S,...I,...A,children:t})});Bn.displayName="DropdownMenuTrigger";var yn=me.forwardRef(({anchor:e,side:t="bottom",align:n="start",sideOffset:o=6,alignOffset:r=0,collisionPadding:s=8,sameWidth:a=false,width:c,height:i,maxHeight:l,unstyled:u=false,closeOnBlur: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,...M},R)=>{let{open:w,setOpen:A,referenceRef:$,clearSubmenuHover:K,setActiveIndex:W,floatingRef:S,menuId:F}=dr(),I=V(),P=ys(),D=co();useEffect(()=>{if(!P)return;let X=P.registerCloser(()=>A(false));return ()=>{X&&X();}},[P,A]);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 re=Math.round(X.x),Z=Math.round(X.y);return {x:re,y:Z,left:re,top:Z,right:re,bottom:Z,width:0,height:0,toJSON:()=>({x:re,y:Z,left:re,top:Z,right:re,bottom:Z,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:A,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:re}){let Z=re.floating;Z.style.boxSizing="border-box",i!=null?Z.style.height=typeof i=="number"?`${i}px`:String(i):Z.style.removeProperty("height"),c!=null?Z.style.width=typeof c=="number"?`${c}px`:String(c):a?Z.style.width=`${Math.round(X.reference.width)}px`:Z.style.width="200px",l!=null?Z.style.maxHeight=typeof l=="number"?`${l}px`:String(l):Z.style.removeProperty("max-height");}})]});useEffect(()=>{L?H.setReference(L):$.current&&H.setReference($.current);},[H,L,$]),useEffect(()=>{if(!w)return;let X=L||$.current,re=H.floating.current;if(!(!X||!re))return autoUpdate(X,re,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 re=document.activeElement,Z=$.current,ce=H.floating.current;re&&(Z?.contains(re)||ce?.contains(re)||A(false));};return document.addEventListener("focusin",X,true),()=>document.removeEventListener("focusin",X,true)},[m,w,A,$,H.floating]);let se=useDismiss(U,{outsidePressEvent:"pointerdown",escapeKey:true,outsidePress:p?false:X=>{if(d?.length){let re=X.target;for(let Z of d)if(Z.current?.contains(re))return false}return true}}),j=useRole(U,{role:"menu"}),{getFloatingProps:J}=useInteractions([se,j]),le=useRef(false);useEffect(()=>{w?le.current=true:le.current&&$.current&&C&&(P?.isBusClosingRef.current||requestAnimationFrame(()=>{$.current?.focus();}));},[w,$,P,C]),useLayoutEffect(()=>{if(!w)return;let X=()=>{let ce=S?.current;if(!ce)return false;let pe=ce.closest('[data-floating-ui-portal="true"]')??ce,Ue=$?.current;if(!Ue)return false;let Oe=Ue.closest("[data-pfui-portal-owner]");if(Oe){let He=Oe.getAttribute("data-pfui-portal-owner");if(!He)return false;if(pe.getAttribute("data-pfui-portal-owner")===He&&ce.getAttribute("data-pfui-portal-owner")===He)return true;pe.setAttribute("data-pfui-portal-owner",He),ce.setAttribute("data-pfui-portal-owner",He);let nt=Oe.getAttribute("data-pfui-mode"),qe=Oe.getAttribute("data-pfui-primary");nt&&(pe.setAttribute("data-pfui-mode",nt),ce.setAttribute("data-pfui-mode",nt)),qe&&(pe.setAttribute("data-pfui-primary",qe),ce.setAttribute("data-pfui-primary",qe));for(let Ge=0;Ge<Oe.style.length;Ge++){let ot=Oe.style[Ge];if(ot.startsWith("--pf-")){let dt=Oe.style.getPropertyValue(ot);pe.style.setProperty(ot,dt),ce.style.setProperty(ot,dt);}}return pe.classList.remove("pf-light","pf-dark"),ce.classList.remove("pf-light","pf-dark"),Oe.classList.contains("pf-light")&&(pe.classList.add("pf-light"),ce.classList.add("pf-light")),Oe.classList.contains("pf-dark")&&(pe.classList.add("pf-dark"),ce.classList.add("pf-dark")),true}let ke=Ue.closest('[data-floating-ui-portal="true"]');if(ke&&!ke.getAttribute("data-pfui-portal-owner"))return false;let st=Ue.closest("[data-pfui-scope]");if(st){let He=st.getAttribute("data-pfui-scope");if(!He)return false;pe.setAttribute("data-pfui-portal-owner",He),ce.setAttribute("data-pfui-portal-owner",He);let nt=st.getAttribute("data-pfui-mode"),qe=st.getAttribute("data-pfui-primary");nt&&(pe.setAttribute("data-pfui-mode",nt),ce.setAttribute("data-pfui-mode",nt)),qe&&(pe.setAttribute("data-pfui-primary",qe),ce.setAttribute("data-pfui-primary",qe)),pe.classList.remove("pf-light","pf-dark"),ce.classList.remove("pf-light","pf-dark"),st.classList.contains("pf-light")&&(pe.classList.add("pf-light"),ce.classList.add("pf-light")),st.classList.contains("pf-dark")&&(pe.classList.add("pf-dark"),ce.classList.add("pf-dark"));let Ge=document.querySelector(`[data-pfui-portal-owner="${He}"]`);if(Ge&&Ge!==pe)for(let ot=0;ot<Ge.style.length;ot++){let dt=Ge.style[ot];if(dt.startsWith("--pf-")){let rn=Ge.style.getPropertyValue(dt);pe.style.setProperty(dt,rn),ce.style.setProperty(dt,rn);}}return true}return false},re=[0,5,15,30,60,100,150,250],Z=[];for(let ce of re)Z.push(window.setTimeout(()=>X(),ce));return ()=>{for(let ce of Z)window.clearTimeout(ce);}},[w,$]);let de=typeof I.spacing.xs=="number"?`${I.spacing.xs}px`:String(I.spacing.xs),fe=b===void 0?void 0:typeof b=="number"?b:I.spacing[b]??b,Pe=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":de,padding:"var(--pfui-panel-pad)",color:I.text.primary,maxHeight:l,overflowY:"auto",display:"flex",flexDirection:"column",gap:fe,"& > *":{flexShrink:0},"&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),Te=-1,Re=X=>{if(!X||typeof X!="object"||!isValidElement(X))return X;let Z=X.type?.displayName;if(Z==="DropdownMenu"||Z==="DropdownMenuSub")return X;if(Z==="MenuItem"||Z==="MenuCheckboxItem"||Z==="MenuRadioItem"||Z==="MenuSwitchItem")return Te+=1,cloneElement(X,{__index:Te,key:X.key??Te});if(Z==="DropdownMenuTrigger"){let pe=X.props.children;return cloneElement(X,{children:me.Children.map(pe,Re)})}if(Z==="DropdownMenuSubTrigger"){Te+=1;let pe=Te;return cloneElement(X,{__index:pe,key:X.key??pe})}let ce=X.props.children;return ce==null?X:cloneElement(X,{children:me.Children.map(ce,Re)})},Ie=me.Children.map(k,Re),Q=U.placement.split("-")[0]||"bottom",ie=Q==="bottom"?"center top":Q==="top"?"center bottom":Q==="left"?"right center":"left center",ye=Q==="bottom"?{opacity:0,y:-8,scale:.96}:Q==="top"?{opacity:0,y:8,scale:.96}:Q==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},Y=y??Q,ve=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}),ge=useCallback(X=>{if(X.key==="Tab"){X.preventDefault();return}if(X.key==="ArrowDown"||X.key==="ArrowUp"){X.preventDefault(),D?.setIsKeyboardNav(true);let re=X.currentTarget;re.setAttribute("data-keyboard-nav","");let Z=Array.from(re.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(ce=>{if(ce.closest('[role="menu"]')!==re)return false;let pe=window.getComputedStyle(ce);return pe.display!=="none"&&pe.visibility!=="hidden"});if(Z.length>0){let ce=re.querySelector("[data-highlighted]"),pe=re.querySelector("[data-hovered]"),Ue=-1;ce?Ue=Z.indexOf(ce):pe&&(Ue=Z.indexOf(pe)),document.querySelectorAll("[data-highlighted]").forEach(st=>st.removeAttribute("data-highlighted")),pe&&pe.removeAttribute("data-hovered"),Ue===-1&&(Ue=X.key==="ArrowDown"?-1:Z.length);let Oe=X.key==="ArrowDown"?1:-1,ke=(Ue+Oe+Z.length)%Z.length;W(ke),Z[ke]?.setAttribute("data-highlighted",""),Z[ke]?.focus();}}},[D,W]),Ne=useCallback(X=>{let re=X.currentTarget;re.removeAttribute("data-keyboard-nav"),re.querySelectorAll("[data-highlighted]").forEach(Z=>Z.removeAttribute("data-highlighted")),D?.isKeyboardNav&&D.setIsKeyboardNav(false);},[D]),ze=useCallback(X=>{X.removeAttribute("data-keyboard-nav"),X.querySelectorAll("[data-highlighted]").forEach(re=>re.removeAttribute("data-highlighted")),D?.isKeyboardNav&&D.setIsKeyboardNav(false);},[D]);return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:w?jsx(oo.Provider,{value:{allItemsTabbable:h},children:jsx(motion.div,{...J({...M,ref:hs(R,H.setFloating,X=>{if(S&&(S.current=X),X&&$.current){let Z=$.current.closest("[data-pfui-portal-owner]");if(Z){let ce=Z.getAttribute("data-pfui-portal-owner");if(ce){X.setAttribute("data-pfui-portal-owner",ce);let pe=Z.getAttribute("data-pfui-mode"),Ue=Z.getAttribute("data-pfui-primary");pe&&X.setAttribute("data-pfui-mode",pe),Ue&&X.setAttribute("data-pfui-primary",Ue);for(let Oe=0;Oe<Z.style.length;Oe++){let ke=Z.style[Oe];ke.startsWith("--pf-")&&X.style.setProperty(ke,Z.style.getPropertyValue(ke));}Z.classList.contains("pf-light")&&X.classList.add("pf-light"),Z.classList.contains("pf-dark")&&X.classList.add("pf-dark");}}}})}),"data-menu-id":F,"data-keyboard-nav":D?.isKeyboardNav?"":void 0,className:f,css:[Pe,ae,T],initial:ye,animate:{opacity:1,x:0,y:0,scale:1},exit:ve,transition:oe,onPointerMove:X=>ze(X.currentTarget),onPointerDown:X=>ze(X.currentTarget),onKeyDown:ge,onMouseMove:Ne,onMouseEnter:()=>{K(),P?.clearAllHover();},onMouseLeave:()=>{document.querySelectorAll("[data-hovered]").forEach(X=>X.removeAttribute("data-hovered"));},children:Ie})}):null})})});yn.displayName="DropdownMenuContent";var Ii=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let a=Rd(),[c,i]=useState(!!t),l=e??c,u=useCallback(S=>{S&&Ti(x.current),e===void 0&&i(S),n?.(S);},[e,n]),m=useRef(null),h=useRef(false),f=useCallback((S,F)=>{if(o!=="hover")return;window.clearTimeout(m.current??0),h.current=S;let I=F??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-${++Si}`),x=useRef(null),b=useRef([]),d=useRef(null),[p,C]=useState(null),[M,R]=useState(false);useEffect(()=>{l||(C(null),b.current=[],R(false));},[l]);let w=useContext(Tt),A=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:M,setIsKeyboardNav:R}),[M]);return a?(console.warn("[DropdownMenu] Nested submenus are not supported. DropdownMenuSub can only be used one level deep inside DropdownMenu. The nested submenu content will not be rendered."),jsx(Fragment,{children:me.Children.map(s,S=>{if(!isValidElement(S))return S;let F=S.type;return F?.displayName==="DropdownMenuSubTrigger"||F?.displayName==="DropdownMenuSubContent"?null:S})})):jsx(Ei.Provider,{value:true,children:jsx(Tt.Provider,{value:A,children:jsx(po.Provider,{value:K,children:jsx(no.Provider,{value:W,children:jsx(gn.Provider,{value:$,children:s})})})})})};Ii.displayName="DropdownMenuSub";var ki=me.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,scheduleSubmenuHover:m,clearSubmenuHover:h,pendingOpenRef:f,menuId:T}=dr(),k=co(),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:M,onClick:R,...w}=s,A=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 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),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=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(),p?.(S);return}p?.(S),M?.(S);},[c,i,p,M,u,k,T]),W=l==="hover"?{onMouseEnter:S=>{let F=S.currentTarget;io(),h(),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||m(true,90);},onMouseMove:S=>{let F=S.currentTarget;io(),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&&m(true,90);},onMouseLeave:()=>{m(false,60);}}:{onClick:S=>{S.stopPropagation(),i(!c),C?.(S),R?.(S);}};if(x&&b){let S=d?.css,F=typeof d?.className=="string"?d.className:void 0,I=typeof d?.tabIndex=="number"?d.tabIndex:0,P={ref:A,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,...w};return cloneElement(b,P)}return jsx("div",{ref:A,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,...w,children:t})});ki.displayName="DropdownMenuSubTrigger";var Ai=me.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(yn,{ref:t,side:"right",align:"start",exitPlacement:"bottom",animateOnBusClose:true,...e,className:a,"data-submenu-content":"",anchor:o.current,onMouseEnter:c=>{r(),n?.clearAllHover(),io(),e.onMouseEnter?.(c);},onMouseLeave:c=>{s(false,60),e.onMouseLeave?.(c);}})});Ai.displayName="DropdownMenuSubContent";var pr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),Id=css({display:"inline"}),Mi=css({display:"inline",fontWeight:700}),kd=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),Ad=css({display:"flex",alignItems:"center",gap:4}),Fd=css({flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2}),Pi=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}),Pd=()=>{},Dd=e=>e,Nd=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Hd=e=>{e.preventDefault(),e.stopPropagation();},Ld=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},Bd=e=>{e.preventDefault(),e.stopPropagation();},Di=me.memo(({onCapture:e})=>{let t=useContext(gn),n=useContext(po),o=useMemo(()=>({...t,activeIndex:n?.activeIndex??null,setActiveIndex:n?.setActiveIndex??t?.setActiveIndex}),[t,n]);return useEffect(()=>{e(o);},[o,e]),null});Di.displayName="CtxCapture";var xs=me.memo(({item:e,absIndex:t,multiple:n,getCurrentMulti:o,isSelected:r,renderItem:s,paint:a,cls:c,closeOnSelect:i,pickSingle:l,handleItemKeyDown:u,handleItemMouseDown: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:Fd,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Pi,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:Pi,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(lo,{__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(lo,{__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(Ht,{__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(Ht,{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 Ni=me.memo(({items:e=[],onSelect:t,width:n=300,fullWidth:o=false,placeholder:r,renderItem:s,focusRingMode:a,css:c,inputCss:i,containerCss:l,label:u,helperText: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:M=true,openOnClick:R=true,closeOnSelect:w=true,closeOnBlur:A=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: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:j,textFieldWrapperCss:J,textFieldInputCss:le,textFieldLabelCss:de,textFieldHelperRowCss:fe,textFieldHelperTextCss:Pe,textFieldStartIconCss:Te,textFieldEndIconCss:Re,menuContentCss:Ie})=>{let Q=V().text.secondary,[ie,ye]=useState(""),Y=typeof d=="boolean",[ve,ee]=useState(false),oe=Y?d:ve,ae=useRef(null),ge=useRef(null),Ne=useRef(null),ze=useRef(null),X=useRef(false),re=useRef(null),Z=useRef(false),ce=useRef(0),pe=useMemo(()=>[ge],[]),[Ue,Oe]=useState(N??[]),ke=_??Ue,st=useRef(ke);st.current=ke;let[He,nt]=useState(null),qe=useRef(He);qe.current=He;let Ge=useCallback(()=>st.current,[]),[ot,dt]=useState([]),[rn,Jn]=useState(false),Je=typeof g=="function",xt=Je?ot:e,ue=useRef(xt);ue.current=xt;let Ee=!!v||rn&&Je,at=useRef(p);useEffect(()=>{at.current=p;},[p]);let De=useCallback(q=>{Y||ee(q),at.current?.(q);},[Y]),bt=useRef(null);useEffect(()=>{if(!Je)return;bt.current&&window.clearTimeout(bt.current);let q=ie;return bt.current=window.setTimeout(async()=>{Jn(true);try{let ne=await g(q)||[];dt(Array.isArray(ne)?ne:[]);}catch{dt([]);}finally{Jn(false);}},Math.max(0,H)),()=>{bt.current&&window.clearTimeout(bt.current);}},[ie,Je,g,H]);let Zn=useMemo(()=>{let q=pr(ie);return q?xt.some(ne=>pr(ne.title??ne.value)===q):false},[xt,ie]),ia=K&&!!W&&ie.trim().length>0&&!Zn,ic=q=>{if(typeof W=="object"){let ne=Object.prototype.hasOwnProperty.call(W,"prefix"),Ce=Object.prototype.hasOwnProperty.call(W,"suffix");if(ne||Ce){let Ae=ne?W.prefix??"":"",be=Ce?W.suffix??"":"";return `${Ae}${q}${be}`}return `Add "${q}"`}return `Add "${q}"`},Br=useMemo(()=>{if(Je)return xt;let q=pr(ie);if(!q)return xt;let ne=[],Ce=[];for(let Ae of xt){let be=pr(Ae.title??Ae.value);be.split(" ").some(Ze=>Ze.startsWith(q))?ne.push(Ae):be.includes(q)&&Ce.push(Ae);}return ne.length>0?ne:Ce},[xt,ie,Je]),la=useMemo(()=>{if(ia){let q=ie.trim();return [...Br,{value:q,title:ic(q),__pfui_free__:true}]}return Br},[Br,ia,ie]),Vt=useMemo(()=>{let q=[],ne=new Map;for(let pt of la){let Ze=pt.group??"__ungrouped__";ne.has(Ze)||(ne.set(Ze,[]),q.push(Ze)),ne.get(Ze).push(pt);}let Ae=typeof F=="number"?Math.max(0,F):1/0,be=[];for(let pt of q){if(Ae<=0)break;let an=ne.get(pt).slice(0,Ae);an.length>0&&(be.push({label:pt==="__ungrouped__"?void 0:pt,items:an}),Ae-=an.length);}return be},[la,F]),kn=useMemo(()=>Vt.reduce((q,ne)=>(q.push(...ne.items),q),[]),[Vt]),No=kn.length>0,$r=!No&&!!B&&!Ee&&ie.trim().length>0,An=Ee||No||$r,Ho=An||Je;useEffect(()=>{!Je&&oe&&!An&&(Z.current=true,De(false),setTimeout(()=>{Z.current=false;},150));},[Je,oe,An,De]);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=ue.current,Ce=new Map(ne.map(be=>[be.value,be])),Ae=q.map(be=>Ce.get(be)??{value:be,title:be});U?.(Ae);},[U]),Lo=useCallback(q=>{let ne=q.map(String);_||Oe(ne),Wr(ne);},[_,Wr]),ca=useCallback(q=>{let Ce=ke.includes(q)?ke.filter(Ae=>Ae!==q):[...ke,q];Lo(Ce);},[ke,Lo]),Bo=useCallback(q=>{let ne=ue.current.find(Ce=>Ce.value===q)??{value:q,title:q};ne.disabled||(Or.current=true,zr.current=(ne.title??ne.value).trim(),nt(ne),ye(ne.title??ne.value),t?.(ne),Y||(w?(X.current=false,Z.current=true,ee(false),at.current?.(false),setTimeout(()=>{Z.current=false;},150)):X.current=true),!w&&Ne.current?.setActiveIndex&&Ne.current.setActiveIndex(null),$?(X.current=false,setTimeout(()=>{ze.current&&ae.current?(ze.current.tabIndex=0,ze.current.focus(),ze.current.blur(),ze.current.tabIndex=-1):ae.current?.blur();},0)):requestAnimationFrame(()=>ae.current?.focus()));},[t,Y,w,$]),lc=useCallback(q=>{if(y)return;ye(q);let ne=!q.trim();O||(ne?(nt(null),t?.(null)):K&&nt(null)),!Y&&!ne&&M&&!oe&&De(true);},[O,Y,M,oe,De,y,K,t]),it=Nd,ua=Pd,cc=Dd,da=useMemo(()=>D?[Mi,D]:Mi,[D]),uc=useCallback(q=>{let ne=ie.trim();if(!ne||ne.length<1)return q;let Ce=ne.toLowerCase(),be=q.toLowerCase().indexOf(Ce);return be<0?q:jsxs("span",{className:"plainframe-ui-autocomplete-highlight-wrap",css:Id,children:[q.slice(0,be),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:da,children:q.slice(be,be+ne.length)}),q.slice(be+ne.length)]})},[ie,da]),$o=P?uc:cc,dc=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),zo=Hd,Oo=Ld,pc=useCallback(q=>{Ne.current=q;},[]),pa=useCallback(q=>{let ne=Ne.current;if(!ne)return;let Ce=kn.length;if(Ce===0)return;let Ae=ge.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]"),be=-1;if(Ae){let Ze=Ae.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]'),an=Ae.querySelector("[data-active]")||Ae.querySelector("[data-hovered]");an&&(be=Array.from(Ze).indexOf(an));}be<0&&typeof ne.activeIndex=="number"&&(be=ne.activeIndex);let pt=be<0?q===1?0:Ce-1:(be+q+Ce)%Ce;ne.setActiveIndex?.(pt),requestAnimationFrame(()=>{let Ze=ge.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]");if(!Ze)return;Ze.setAttribute("data-keyboard-nav",""),Ze.querySelectorAll("[data-active]").forEach(_r=>_r.removeAttribute("data-active")),Ze.querySelectorAll("[data-hovered]").forEach(_r=>_r.removeAttribute("data-hovered"));let Kr=Ze.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]')[pt];Kr&&(Kr.setAttribute("data-active",""),Kr.scrollIntoView?.({block:"nearest"}));});},[kn.length]),mc=useCallback(q=>{if(q.key===" "||q.code==="Space"||q.key==="Spacebar"){q.stopPropagation();return}if(q.key==="ArrowDown"||q.key==="ArrowUp"){if(y||!An&&!Je)return;q.preventDefault(),!oe&&!Y&&De(true),pa(q.key==="ArrowDown"?1:-1);return}if(q.key==="Enter"){if(y)return;let ne=Ne.current&&typeof Ne.current.activeIndex=="number"?Ne.current.activeIndex:-1,Ce=ne>=0&&ne<kn.length?kn[ne]:null;if(oe&&Ce&&ne>=0){q.preventDefault(),q.stopPropagation(),O?(ca(Ce.value),w||requestAnimationFrame(()=>ae.current?.focus())):Bo(Ce.value);return}}else q.key==="Escape"?(q.preventDefault(),q.stopPropagation(),oe&&!Y&&(Z.current=true,De(false),q.target.focus(),setTimeout(()=>{Z.current=false;},150))):q.key==="Tab"&&oe&&!Y&&De(false);},[An,Je,oe,Y,kn,O,w,pa,ca,Bo,De,y]),fc=useCallback(()=>{y||Z.current||C&&Ho&&(ce.current=Date.now(),Y||De(true));},[Y,C,Ho,De,y]),gc=useCallback(()=>{if(X.current){X.current=false;return}A&&De(false),!K&&!O&&(He?ye(He.title??He.value):ie.trim()&&ye(""));},[A,K,O,He,ie,De]),ma=useCallback(()=>{let q=[],ne=0;return Vt.forEach((Ce,Ae)=>{Ce.label&&q.push(jsx(fn,{className:it("group-label"),children:Ce.label},`g-${Ae}`)),Ce.items.forEach(be=>{q.push(jsx(xs,{item:be,absIndex:ne,multiple:true,getCurrentMulti:Ge,isSelected:false,renderItem:s,paint:$o,cls:it,closeOnSelect:false,pickSingle:ua,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:Q},`${be.group??"__"}|${be.value}`)),ne+=1;});}),jsx(bs,{values:ke,onValuesChange:Lo,children:q},"multi-group")},[Vt,it,Ge,s,$o,ke,Lo,ua,Oo,zo,Q]),fa=useCallback(()=>{let q=[],ne=0;return Vt.forEach((Ce,Ae)=>{Ce.label&&q.push(jsx(fn,{className:it("group-label"),children:Ce.label},`g-${Ae}`)),Ce.items.forEach(be=>{let pt=He?.value===be.value;q.push(jsx(xs,{item:be,absIndex:ne,multiple:false,getCurrentMulti:Ge,isSelected:pt,renderItem:s,paint:$o,cls:it,closeOnSelect:w,pickSingle:Bo,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:Q},`${be.group??"__"}|${be.value}`)),ne+=1;});}),q},[Vt,it,He,Ge,s,$o,w,Bo,Oo,zo,Q]),bc=useMemo(()=>Ee?jsx(fn,{css:E,className:it("label-loading"),children:L},"loading"):$r?jsx(fn,{css:z,className:it("label-empty"),children:I},"empty"):Vt.length===0?null:O?ma():fa(),[Ee,$r,Vt.length,it,L,I,O,ma,fa]),sn=oe?false:y||!Je&&!No&&!B,ga=useCallback(q=>{q.preventDefault(),q.stopPropagation(),!(sn||y)&&(Y||(oe?(Z.current=true,De(false),queueMicrotask(()=>ae.current?.focus()),setTimeout(()=>{Z.current=false;},150)):(De(true),queueMicrotask(()=>ae.current?.focus()))));},[oe,No,Je,De,sn,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:sn?"not-allowed":"pointer",userSelect:"none",opacity:sn?.5:1}),[oe,sn]),Wo=useMemo(()=>se?jsx("span",{ref:re,role:"button",tabIndex:-1,css:[ba,j],"aria-disabled":sn||void 0,onMouseDown:Bd,onClick:ga,children:G??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[se,ba,j,sn,ga,G]),hc=useMemo(()=>T&&Wo?jsxs("span",{css:Ad,children:[T,Wo]}):T??Wo,[T,Wo]),yc=useCallback(q=>{if(!(re.current&&re.current.contains(q.target)||Z.current||y||Date.now()-ce.current<300)){if(oe){!ie.trim()&&!Y&&(Z.current=true,De(false),setTimeout(()=>{Z.current=false;},150));return}R&&Ho&&(!Y||R)&&De(true);}},[oe,ie,R,Ho,De,y,Y]);return jsx("div",{ref:ge,className:it(""),css:[dc,l,c],children:jsxs(Ln,{open:y?false:oe,onOpenChange:y?void 0:De,children:[jsx(Di,{onCapture:pc}),jsx(Bn,{asChild:true,children:jsx("span",{className:it("anchor"),css:kd,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(Zo,{ref:ae,className:it("input"),focusRingMode:a,value:ie,onChange:lc,onKeyDown:mc,onFocus:fc,onBlur:gc,onSurfaceClick:yc,placeholder:r,label:u,helperText:m,variant:h,startIcon:f,endIcon:hc,size:k,width:n,fullWidth:o,disabled:y,error:x,showClear:b,css:i,wrapperCss:J,inputCss:le,labelCss:de,helperRowCss:fe,helperTextCss:Pe,startIconCss:Te,endIconCss:Re}),jsx("span",{ref:ze,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}}),An&&jsx(yn,{className:it("menu"),side:"bottom",align:"start",sameWidth:true,allItemsTabbable:true,maxHeight:typeof S=="number"?`${S}px`:S,css:Ie,ignoreOutsidePressRefs:pe,disableOutsidePressDismiss:Y,returnFocus:!$,children:bc})]})})});Ni.displayName="Autocomplete";var Kd=["sm","md","lg"],_d=(e,t)=>typeof e=="number"?e:Kd.includes(e)?t.componentHeights[e]:t.componentHeights.md,Vd=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},jd=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},Ud=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),Hi=me.memo(forwardRef(({src:e,alt:t,size:n="md",color:o="primary",rounded:r=true,className:s,css:a,children:c,...i},l)=>{let u=V(),[m,h]=useState(!!e);useEffect(()=>{h(!!e);},[e]);let f=_d(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=Vd(u,o),b=jd(u,o),d=Ud(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"}),M=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:M,children:c}):c||jsx("span",{className:"plainframe-ui-avatar-initials",css:M,children:d})})}));Hi.displayName="Avatar";var Li=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Yd=({children:e,max:t,size:n="md",overlap:o=-7,css:r,rounded:s=true,bgColor:a,extraLabelCss:c,outlineThickness:i=4,className:l})=>{let u=V(),m=xe(),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 Li(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=Li(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"}),M=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:M,children:R})},w);let A=R,$=A.props?.css,K=$==null?M:[M,$],W=cloneElement(A,{size:n,rounded:s,css:K,style:{...A.props?.style,width:"100%",height:"100%",objectFit:A.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 zi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Zd=(e,t)=>{let n=e,o=n.palette||{},r=n.neutral||{};return t==="neutral"||t==="secondary"?{scale:r,onKey:"neutral"}:typeof t=="string"&&o[t]?{scale:o[t],onKey:t}:{scale:n.primary||r,onKey:"primary"}},Qd=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",ep=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",tp=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",np=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),op=me.memo(({content:e,color:t="primary",fontColor:n,fontWeight:o=600,fontSize:r,variant:s="dot",max:a=99,showZero:c=false,visible:i=true,anchorOrigin:l={vertical:"top",horizontal:"right"},overlap:u="rectangular",children:m,animate:h=true,size:f,outline:T=false,outlineColor:k,className:y,badgeClassName:x,css:b,badgeCss:d,offsetX:p,offsetY:C})=>{let M=V(),R=s==="dot",w=f??(R?8:17),A=r??(R?0:10),{scale:$,onKey:K}=Zd(M,t),W=Qd($),S=M.text?.onColors||{},F=ep(M,S,K,n),I=tp(e,a,s),P=np(i,s,e,c),D=css({position:"relative",display:"inline-block"}),B=u==="circular"?R?"12.5%":"5%":R?"5%":"2.5%",z=zi(p??B),E=zi(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:F,fontSize:typeof A=="number"?`${A}px`:A,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??M.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=V(),x=useMemo(()=>r??y.surface.overlayBg,[r,y.surface.overlayBg]),[b,d]=useState(e),[p,C]=useState(e),M=useRef(null),R=useRef(null),w=useRef(null);useEffect(()=>(M.current&&(clearTimeout(M.current),M.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null),e?(d(true),R.current=requestAnimationFrame(()=>{C(true),R.current=null;})):(C(false),M.current=setTimeout(()=>{d(false),M.current=null;},u)),()=>{M.current&&(clearTimeout(M.current),M.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null);}),[e,u]),useEffect(()=>{if(!T||!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,T]),useEffect(()=>{if(!p||!t)return;let F=I=>{I.key==="Escape"&&t();};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[p,t]);let A=F=>{if(!p||!t||!w.current)return;let I=F.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:A,...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 lp(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 cp=me.memo(({children:e,separator:t="/",css:n,crumbCss:o,activeCrumbCss:r,inactiveCrumbCss:s,linkCrumbCss:a,separatorCss:c,hover:i=true,className:l,...u})=>{let m=V(),h=xe(),f=me.useMemo(()=>me.Children.toArray(e).flatMap(d=>{if(!me.isValidElement(d))return [];let{type:p,props:C}=lp(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=me.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:m.typography.sizes.sm,fontWeight:500,gap:m.spacing.xs,cursor:"default"}),[m]),k=me.useMemo(()=>css({margin:"0 0.15rem",color:m.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[m]),y=me.useCallback((d,p,C)=>{let M=d?m.text.primary:m.text.secondary,R=i&&p&&!C;return css({display:"inline-flex",alignItems:"center",gap:m.spacing.xs,color:M,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=me.useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0}),[]),b=me.useMemo(()=>css({display:"inline-block"}),[]);return jsx("nav",{"aria-label":"Breadcrumb",className:["plainframe-ui-breadcrumbs",l||""].join(" ").trim(),css:[T,n],...u,children:f.map((d,p)=>{let C=p===f.length-1,M=!!d.href&&!d.disabled&&!C,R=["plainframe-ui-breadcrumb",C?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",M?"plainframe-ui-breadcrumb--link":"",d.className||""].join(" ").trim(),w=[y(C,M,d.disabled),o,C?r:s,M?a:void 0,h(),d.css],A=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(me.Fragment,{children:[p!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[k,c],children:t}),M?jsx("a",{href:d.href,onClick:d.onClick,tabIndex:0,"data-active":C?"true":"false","data-link":"true",className:R,css:w,children:A}):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:A})]},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,_i=e=>{let t=false;return me.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&_i(n)&&(t=true));}),t};function mp(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 fp(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 Vi=me.memo(me.forwardRef(({variant:e="primary",size:t="md",startIcon:n,endIcon:o,rounded:r=false,fullWidth:s=false,disabled:a=false,loading:c=false,loadingIndicator:i,loadingPosition:l="center",children:u,className:m,hoverEffect:h=true,icon:f,onClick:T,css:k,...y},x)=>{let b=V(),d=xe(),p=useMemo(()=>mp(b,t),[b,t]),C=useMemo(()=>fp(b,e),[b,e]),M=useMemo(()=>f===true?true:f===false?false:!n&&!o&&!_i(u)&&me.Children.count(u)===1,[f,n,o,u]),R=p.iconSize,w=useMemo(()=>Is(n,R),[n,R]),A=useMemo(()=>Is(o,R),[o,R]),$=useMemo(()=>i??jsx(to,{color:C.fg,variant:"circular",size:14,thickness:5}),[i,C]),K=useMemo(()=>M?"center":l??"center",[M,l]),W=!!c&&K==="center",S=!!c&&K==="start",F=!!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(M&&!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}`}),[M,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(M)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:$})]})},[M,n,S,L,H,w,c,$]),N=useMemo(()=>()=>{if(M)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?A||o:null}),jsx("span",{css:H(!!F),children:$})]})},[M,o,F,L,H,A,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:M?c?$:Is(u,p.iconSize):u}),N()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:O,"aria-hidden":"true",children:W?$:null})]})}));Vi.displayName="Button";var vr=e=>isValidElement(e),gp=e=>{let t=e.type;return t.displayName??t.name},Ps=(e,t)=>gp(e)===t,qi=e=>Ps(e,"ButtonGroup"),Gi=e=>Ps(e,"DropdownMenu"),Fs=e=>Ps(e,"DropdownMenuTrigger"),On=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,bp=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,hp=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),Ms=(e,t)=>{if(!vr(e))return null;if(qi(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?Ms(t?n[0]:n[n.length-1],t):null}if(Gi(e)){let o=Children.toArray(e.props.children).filter(isValidElement).find(Fs);return o?Ms(o,t):null}if(Fs(e)){let n=Children.toArray(e.props.children??[]).filter(isValidElement);return n.length?n[0]:null}return e},Ui=(e,t)=>{if(!e)return false;let n=Ms(e,t==="left"),o=n&&n.props&&typeof n.props=="object"?n.props.variant:void 0;return hp(o)},Xi=me.memo(me.forwardRef(function({children:t,attached:n=false,direction:o="horizontal",fullWidth:r=false,disabled:s=false,size:a="md",rounded:c=false,gap:i,width:l,className:u,role:m="group",css:h,__clipLeft:f,__clipRight:T,...k},y){let x=V(),b=a==="sm"?x.radius.sm:x.radius.md,d=c?x.radius.full:b,p=o==="vertical",C=bp(x.componentHeights.border,1),M=x.surface.border,R=n&&!!f,w=n&&!!T,A=css({display:"flex",flexDirection:p?"column":"row",width:r?"100%":l!=null?On(l):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:On(i??x.spacing.sm)}),$=Children.toArray(t),W=$.filter(vr).length,S=0,F=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 _=Ui(P,"left"),N=Ui(P,"right"),se=n&&!D&&!(F&&_)&&!(F||_)?css({[p?"borderTop":"borderLeft"]:`${C} solid ${M}`}):null,j=n&&!D&&F&&_?css(p?{borderTopWidth:0}:{borderLeftWidth:0}):null,J=n?css({borderTopLeftRadius:On(v),borderTopRightRadius:On(L),borderBottomRightRadius:On(H),borderBottomLeftRadius:On(O)}):null,le=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,de=css([J,se,j,le]);if(!Gi(P)){let Re=z.css,Ie=[z.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),we=qi(P)&&n?{__clipLeft:!D,__clipRight:!B}:{},Q=cloneElement(P,{...z,disabled:E,size:g,className:Ie,css:[Re,de],...we});I.push(Q),F=N,S+=1;continue}let fe=z.children,Pe=Children.map(fe,Re=>{if(!vr(Re)||!Fs(Re))return Re;let Ie=Re.props,we=[Ie.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" ");return cloneElement(Re,{...Ie,css:[Ie.css,de],className:we,disabled:E,size:g})}),Te=cloneElement(P,{...z,children:Pe});I.push(Te),F=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:[A,h],...k,children:I})}));Xi.displayName="ButtonGroup";var Cr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Tp=(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)}}},wp=(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)}}},Ep=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},Sp=(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},Wn=me.memo(forwardRef(function({children:t,css:n,variant:o="ghost",padding:r,radius:s,className:a,hoverable:c,selectable:i,selected:l,defaultSelected:u,onSelectedChange:m,width:h,height:f,onClick:T,onKeyDown:k,role:y,tabIndex:x,...b},d){let p=V(),C=p.surface??{},[M,R]=useState(!!u),w=l!=null,A=w?!!l:M,$=useMemo(()=>Ep(o,p),[o,p]),K=useMemo(()=>Sp(o,p,$),[o,p,$]),W=K,S=useMemo(()=>Tp(r,p),[r,p]),F=useMemo(()=>wp(s,p),[s,p]),I=!!c||!!i,P=useMemo(()=>css({backgroundColor:$,padding:S,borderRadius:F,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,F,o,p.componentHeights,C.border,h,f,I,K,W]),D=useCallback(()=>{if(!i)return;let g=!A;w||R(g),m?.(g);},[w,m,i,A]),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=xe();return jsx("div",{ref:d,"data-variant":o,"data-selected":i&&A?"true":void 0,"aria-pressed":i?A: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})}));Wn.displayName="Container";var kp=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 kp(o)}return e}}}function ho(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 Ap(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 yo(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 Yi(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Ji=me.createContext("horizontal"),Ls=()=>me.useContext(Ji),Zi=me.memo(me.forwardRef(({children:e,css:t,variant:n="ghost",padding:o="md",radius:r="lg",hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u="100%",height:m,gap:h,direction:f="horizontal",className:T,onClick:k,...y},x)=>{let b=V(),d=xe(),p=f==="vertical",C=css({position:"relative",display:"flex",flexDirection:p?"column":"row",gap:Ap(h,b),alignItems:p?"stretch":"center",transition:"all .16s ease"});return jsx(Ji.Provider,{value:f,children:jsx(Wn,{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})})}));Zi.displayName="Card";var Fp=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Ls()==="vertical",m=css({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:ho(o),textAlign:Hs(o),...u?{width:"100%"}:{flex:1,minWidth:0},...yo(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=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Ls()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:ho(o),alignItems:ho(o),...u?{width:"100%"}:{},...yo(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})}),Pp=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Ls()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:ho(o),alignItems:ho(o),...u?{width:"100%"}:{},gap:i.spacing.xs,color:i.text.secondary,...yo(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})}),Dp=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let m=V(),h=css({fontWeight:c??500,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"1rem"),color:Yi(m,l)??m.text?.primary,textAlign:Hs(o),...yo(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})}),Np=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let m=V(),h=css({fontWeight:c??400,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"0.875rem"),color:Yi(m,l)??m.text?.secondary,marginTop:m.spacing?.xxs??2,textAlign:Hs(o),...yo(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 el=e=>isValidElement(e),$p=e=>el(e)?e.type?.displayName||e.type?.name:void 0,Qi=e=>$p(e)==="Card",zp=e=>typeof e=="number"?`${e}px`:e,tl=({children:e,attached:t=false,gap:n,width:o,direction:r="vertical",variant:s,className:a,role:c="group",css:i})=>{let l=V(),u=r==="vertical",m=String(l.componentHeights?.border??"1px"),h=l.surface.border,f={display:"flex",flexDirection:u?"column":"row",width:typeof o=="string"||typeof o=="number"?zp(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},T=Children.toArray(e),y=T.filter(Qi).length,x=0,b=T.map((d,p)=>{if(!Qi(d)||!el(d))return d;let C=d.props,M=x++,R=M===0,w=M===y-1,A=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=A==="subtle"&&y>1&&!R?u?{borderTop:`${m} solid ${h}`}:{borderLeft:`${m} solid ${h}`}: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:A??C.variant,css:[C.css,...F],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})};tl.displayName="CardGroup";var Le=e=>typeof e=="number"?`${e}px`:e,ol=e=>{let t=false;return me.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&ol(n)&&(t=true));}),t},_p=(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"},rl=me.memo(forwardRef(function({children:t,labelCss:n,variant:o="soft",color:r="primary",rounded:s=false,startIcon:a,endIcon:c,size:i="md",onClick:l,onDelete:u,deleteIcon:m,disabled:h,cursor:f,className:T,css:k},y){let x=V(),b=xe(),d=["sm","md","lg"].includes(i)?i:"md",p=useMemo(()=>_p(x,d),[x,d]),C=!!l&&!h,M=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]),A=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]:A(50),[w,A,x.neutral]),K=useMemo(()=>w==="neutral"?x.text.secondary:A(800),[w,A,x.text.secondary]),W=useMemo(()=>w==="neutral"?x.neutral[100]:A(50),[w,A,x.neutral]),S=useMemo(()=>w==="neutral"?x.text.secondary:A(800),[w,A,x.text.secondary]),F=useMemo(()=>w==="neutral"?x.neutral[400]:A(300),[w,A,x.neutral]),I=useMemo(()=>w==="neutral"?x.surface.subtleBg:A(600),[w,A,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:A(700)??x.text.primary,[w,A,x.text.primary,x.text.secondary]),z=useMemo(()=>!a&&!c&&t!=null&&!ol(t)&&me.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} ${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,R,o]),g=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:Le(p.gap),padding:o==="ghost"?0:z||t==null?Le(p.soloPadding):`${Le(p.paddingY)} ${Le(p.paddingX)}`,borderRadius:s?x.radius.full:p.radius,fontWeight:600,cursor:M,opacity:h?.55:1,transition:"outline .16s ease, outline-offset .16s ease",overflow:o==="ghost"?"visible":"hidden",...z?{lineHeight:1,minWidth:`calc(${Le(p.iconSize)} + ${Le(p.soloPadding)} * 2)`,minHeight:`calc(${Le(p.iconSize)} + ${Le(p.soloPadding)} * 2)`,justifyContent:"center"}:null}),[p,M,t,h,z,s,x.radius.full,o]),v=useMemo(()=>css({fontSize:Le(z?p.iconSize:p.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:z?Le(p.iconSize):void 0,height:z?Le(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:Le(p.iconSize),lineHeight:0,"& > svg":{width:Le(p.iconSize),height:Le(p.iconSize),display:"block"}}),[p.iconSize]),H=useMemo(()=>css({marginRight:z||t==null?0:Le(p.gap),marginLeft:z||t==null?0:Le(p.iconOffset)}),[p.gap,p.iconOffset,t,z]),O=useMemo(()=>css({marginLeft:z||t==null?0:Le(p.gap),marginRight:z||t==null?0:Le(s?p.iconOffsetRounded:p.iconOffset)}),[p.gap,p.iconOffset,p.iconOffsetRounded,t,z,s]),_=useMemo(()=>css({marginRight:s?0:Le(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:Le(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})]})}));rl.displayName="Chip";var qp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Gp=me.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=xe(),y=r.neutral,x=r.text,b=r.componentHeights.border,d=useRef([]),[p,C]=useState(0),M=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]),A=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:A,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"}),F=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=F(E).slice(0,1),v=[...M];v[z]=g,n(v.join("")),g&&z<o-1&&I(z+1);},[M,o,n,I]),D=useCallback((z,E)=>{if(E.key==="Backspace")if(!M[z]&&z>0){let g=[...M];g[z-1]="",n(g.join("")),I(z-1),E.preventDefault();return}else {let g=[...M];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}},[M,o,n,I]),B=useCallback(z=>{let E=F(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(me.Fragment,{children:[jsx("input",{ref:g=>{d.current[E]=g;},type:"text",inputMode:"text",maxLength:1,value:M[E]||"",placeholder:M[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))})}),Xp=({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=V(),C=useId(),M=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=M[R],A=p.neutral,$=p.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(h,10)),D=p.spacing.sm,B=qp(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?A[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?A[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(Gp,{value:F||"",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 cl=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=cl(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)},Jp=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:s=10})=>{let a=me.useRef(null),[c,i]=me.useState(false),l=me.useCallback(v=>{i(v),o?.(v);},[o]),u=me.useCallback(()=>l(false),[l]),m=me.useRef({x:0,y:0}),h=me.useRef(null),f=me.useRef(null),T=me.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=me.useCallback(()=>{f.current==null&&(f.current=requestAnimationFrame(T));},[T]);me.useEffect(()=>()=>{f.current&&cancelAnimationFrame(f.current);},[]);let y=me.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=me.useRef(`cz-${Math.random().toString(36).slice(2)}`),b=me.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${x.current}"]`):null,[]),d=me.useRef(null),p=me.useRef(null),C=me.useCallback(()=>{d.current!=null&&clearTimeout(d.current),d.current=null;},[]),M=me.useCallback(()=>{p.current!=null&&clearTimeout(p.current),p.current=null;},[]),R=me.useCallback(()=>{M(),p.current=window.setTimeout(()=>l(false),0);},[M,l]),w=me.useCallback(()=>{let v=a.current?.getBoundingClientRect();return v?{x:v.left+v.width/2,y:v.top+v.height/2}:{x:0,y:0}},[]),A=me.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(!me.isValidElement(v))return v;let L=cl(v),H=v,O=H.props.children,_=O==null?O:Array.isArray(O)?O.map(N=>me.isValidElement(N)?W(N):N):me.isValidElement(O)?W(O):O;if(L==="DropdownMenu"){let N=H.props.onOpenChange;return me.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 me.cloneElement(H,{...H.props,anchor:y,"data-cz-id":x.current,onMouseEnter:G=>{M(),N?.(G);},onMouseLeave:G=>{R(),U?.(G);},children:_})}return _===O?H:me.cloneElement(H,{...H.props,children:_})},S=K?W($):$,F=me.useCallback(v=>{v.preventDefault(),A(v.clientX,v.clientY);},[A]),I=me.useCallback(v=>{n==="contextmenu"&&F(v);},[n,F]),P=me.useCallback(v=>{n==="dblclick"&&F(v);},[n,F]),D=me.useCallback(v=>{n==="click"&&F(v);},[n,F]),B=me.useCallback(v=>{if(n!=="hover")return;C(),M();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);A(H,O);},0);},[n,r,s,w,A,C,M]),z=me.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=me.useCallback(()=>{n==="hover"&&(C(),R());},[n,C,R]);me.useEffect(()=>{if(n!=="hover")return;let v=()=>{if(!c)return;let L=a.current?.matches(":hover"),H=b()?.matches?.(":hover");L||H?M():R();};return window.addEventListener("pointermove",v,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",v,{capture:true})},[c,n,b,M,R]),me.useEffect(()=>{let v=()=>{if(c)if(n==="hover"){let L=a.current?.matches(":hover"),H=b()?.matches?.(":hover");if(L||H?M():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,M,R,b]),me.useEffect(()=>()=>{C(),M();},[C,M]);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"&&M(),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 _n=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,tm=me.memo(forwardRef(function({label:t,variant:n="full",direction:o="horizontal",labelPosition:r="center",thickness:s=1,width:a,middleMargin:c="5px",insetMargin:i="10px",chip:l=false,chipVariant:u="subtle",rounded:m=false,margin:h=10,css:f,labelCss:T,strokeCss:k,className:y,...x},b){let d=V(),{t:p,strokeColor:C,labelTextColor:M,chipSubtleBg:R,chipOutlinedBg:w,outerM:A,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=_n(h,"10px"),v=o==="horizontal"?n==="middle"?_n(c):n==="inset"?_n(i,"0px"):"0":"0",L=o==="vertical"?n==="middle"?_n(c):n==="inset"?_n(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:A,marginRight:A}:{flexDirection:"row",width:a?_n(a):"100%",minWidth:0,paddingLeft:$,paddingRight:n==="middle"?$:"0",marginTop:A,marginBottom:A},...Array.isArray(f)?f:f?[f]:[]]),[o,t,p,A,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]),F=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:M,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,M,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:F,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:F,children:t}),t&&r!=="right"&&I,!t&&I]})}));var bl=me.createContext(null),hl=()=>{let e=useContext(bl);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},yl=({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(bl.Provider,{value:u,children:e})},rm=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=hl(),c=!!e&&me.isValidElement(t),i=useCallback(u=>{if(c){let m;me.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;me.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 me.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})});rm.displayName="DrawerTrigger";var Ro=0,xl="",vl="",sm=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function am(){if(!(typeof document>"u")){if(Ro===0){let e=document.body;xl=e.style.overflow||"",vl=e.style.paddingRight||"";let t=sm();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}Ro+=1;}}function im(){if(!(typeof document>"u")&&(Ro>0&&(Ro-=1),Ro===0)){let e=document.body;e.style.overflow=xl,e.style.paddingRight=vl;}}var lm=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,Cl=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=V(),{open:p,setOpen:C,lockScroll:M,closeOnEscape:R}=hl();useEffect(()=>{if(!(!M||!p))return am(),()=>im()},[p,M]);let w=useMemo(()=>lm(a,0),[a]),A=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 j=String(d.radius.lg);switch(r){case "left":return `0 ${j} ${j} 0`;case "right":return `${j} 0 0 ${j}`;case "top":return `0 0 ${j} ${j}`;default:return `${j} ${j} 0 0`}},[r,d.radius.lg]),F=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 j=P.current;if(!j)return 1;let J=j.getBoundingClientRect();return A==="x"?J.width:J.height},[A]),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(()=>A==="x"?{x:`${E*100}%`,y:0}:{y:`${E*100}%`,x:0},[A,E]),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:p?"auto":"none",touchAction:A==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[I,K,W,d.surface,F,p,A]),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(()=>A==="x"?{left:$===-1?T:0,right:$===1?T:0}:{top:$===-1?T:0,bottom:$===1?T:0},[A,$,T]),_=useMemo(()=>A==="x"?{left:0,right:0}:{top:0,bottom:0},[A]),N=useMemo(()=>Math.max(0,Math.min(1,h)),[h]),U=useCallback((j,J)=>{let le=A==="x"?J.offset.x:J.offset.y,de=A==="x"?J.velocity.x:J.velocity.y,fe=$*le>0,Pe=Math.abs(le)>=D()*N,Te=$*de>f;fe&&(Pe||Te)&&C(false);},[A,$,D,N,f,C]),G=useRef(null);useEffect(()=>{if(!p)return;G.current=document.activeElement;let j=setTimeout(()=>{let de=P.current;if(!de)return;let fe=de.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');fe.length>0?fe[0].focus():de.focus();},100),J=de=>{let fe=P.current;if(!fe||!de.target)return;let Pe=de.target;if(!fe.contains(Pe)){de.preventDefault();let Te=fe.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');Te.length>0?Te[0].focus():fe.focus();}},le=de=>{de.key==="Escape"&&R&&(de.stopPropagation(),C(false));};return document.addEventListener("focusin",J,true),window.addEventListener("keydown",le),()=>{clearTimeout(j),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:j=>{P.current=j,typeof b=="function"?b(j):b&&(b.current=j);},role:"dialog","aria-modal":"true",tabIndex:-1,"data-position":r,"data-variant":s,className:["plainframe-ui-drawer",k||""].join(" ").trim(),css:[v,y],drag:A,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})});Cl.displayName="DrawerContent";var cm=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(yl,{open:k,onOpenChange:y,children:jsx(Cl,{ref:l,...i,children:c})})});cm.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 Rl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Tl=me.memo(({direction:e="row",gap:t="sm",justify:n,align:o="center",className:r,css:s,children:a,width:c,height:i,...l})=>{let u=V(),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:Rl(c),width:c?"100%":void 0,maxHeight:Rl(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})});Tl.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 wl={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"}},wm=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),Em={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"span",caption:"span"},Vn=me.memo(({variant:e="body",children:t,color:n,size:o,weight:r,lineHeight:s,letterSpacing:a,align:c="left",textTransform:i="none",whiteSpace:l="normal",decoration:u="none",decorationStyle:m="solid",decorationThickness:h=1,decorationColor:f,italic:T,className:k,style:y,as:x})=>{let b=V(),d=wl[e]??wl.body,p=x??Em[e]??"span",C=F=>F==null?d.size:typeof F=="number"?F:b?.typography?.sizes?.[F]??F,M=C(o)??C(d.size),R=r??d.weight,w=s??d.lh,A=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:M,fontWeight:R,lineHeight:w,letterSpacing:A,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:wm(h),textDecorationSkipInk:"auto"});return jsx(p,{className:[`pfui-typo-${e}`,k||""].join(" ").trim(),css:[W,S],style:y,"data-variant":e,children:t})});Vn.displayName="Typography";var qs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,km=(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}}},Sl=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:M,onLoad:R,onError:w,...A},$){let[K,W]=useState(false),[S,F]=useState(false),[I,P]=useState(false),D=V(),B=km(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:M?"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:M,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=>{F(true),w?.(H);},...A})]}),i&&jsx(Vn,{as:"figcaption",variant:"caption",align:l,children:i})]})});Sl.displayName="Image";var Il=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Pm=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}},Dm=e=>e*Math.PI/180,Nm=(e,t,n)=>{let o=Math.abs(Dm(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 Hm(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 Lm=(e,t,n)=>e==="fan"?t===2?[.9,1.08][n]??1:[.8,1,.8][n]??1:e==="slide"?t===2?[.8,1][n]??1:[.7,.85,1][n]??1:e==="domino"?t===2?[.9,1][n]??1:[.85,.95,1][n]??1:1,kl=[1.02,1.03,1.02],Al=[1.06,1.08,1.06],Bm={sm:150,md:200,lg:260,xl:340},$m=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function zm(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 $m(typeof n=="number"||typeof n=="string"?n:e)}return e}}}var Om=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=V(),M=Pm(r)??4/5,R=typeof o=="string"?o:void 0,w=typeof o=="number"?o:R&&/px$/.test(R)?parseFloat(R):Bm[s],A=Math.max(1,w/M),K=Children.toArray(t).filter(isValidElement).slice(0,i),W=K.length,S=Hm(n,W),F=K.map((j,J)=>Lm(n,W,J)),I=j=>A*.6*F[j],P=j=>I(j)*M,D=0,B=0;for(let j=0;j<W;j++){let J=P(j),le=I(j),de=Math.max(Math.abs(S.base.ang[j]??0),Math.abs(S.exp.ang[j]??0)),fe=Math.max(Math.abs(S.base.dx[j]??0),Math.abs(S.exp.dx[j]??0)),Pe=Math.max(Math.abs(S.base.dy[j]??0),Math.abs(S.exp.dy[j]??0)),Te=a==="expand"?Al[j]??1.08:a==="reveal"?kl[j]??1.03:1,Re=Nm(J,le,de),Ie=Re.w*Te,we=Re.h*Te,Q=fe/100*J*Te,ie=Pe/100*le*Te;D=Math.max(D,Ie/2+Q),B=Math.max(B,we/2+ie);}let z=Math.max(1,2*D),E=Math.max(1,2*B),g=Math.min(1,w/z,A/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:Il(typeof o=="number"?o:w)??(typeof o=="string"?o:void 0),height:Il(A)}),_=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=zm(k,C)??"0px",U=j=>{let J=n==="fan"?`rotate(${S.base.ang[j]}deg) translate(${S.base.dx[j]}%, ${S.base.dy[j]}%)`:n==="slide"?`translate(${S.base.dx[j]}%, ${S.base.dy[j]}%) rotate(${S.base.ang[j]}deg)`:n==="domino"?`translate(0%, ${S.base.dy[j]}%)`:`translate(${S.base.dx[j]}%, ${S.base.dy[j]}%) rotate(${S.base.ang[j]}deg)`,le=n==="fan"?`rotate(${S.exp.ang[j]}deg) translate(${S.exp.dx[j]}%, ${S.exp.dy[j]}%)`:n==="slide"?`translate(${S.exp.dx[j]}%, ${S.exp.dy[j]}%) rotate(${S.exp.ang[j]}deg)`:n==="domino"?`translate(0%, ${S.exp.dy[j]}%)`:`translate(${S.exp.dx[j]}%, ${S.exp.dy[j]}%) rotate(${S.exp.ang[j]}deg)`,de=a==="reveal"?"translate(0,0) rotate(0) scale(1)":`${J} scale(1)`,fe=a==="expand"?`${le} scale(${Al[j]??1.06})`:a==="reveal"?`${J} scale(${kl[j]??1.03})`:`${J} scale(1)`;return css({position:"absolute",top:"50%",left:"50%",transform:`translate(-50%, -50%) ${de}`,transition:"transform .22s ease",willChange:"transform",backfaceVisibility:"hidden",zIndex:n==="fan"&&j===1?10:j+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%) ${fe}`},".plainframe-ui-image-stack-wrapper[data-hover-mode='controlled'][data-hovered='true'] &":{transform:`translate(-50%, -50%) ${fe}`}})},G=j=>css({width:`${P(j)}px`,aspectRatio:`${M}`,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((j,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:j})},J))})}),y&&jsx(Vn,{as:"figcaption",variant:"caption",align:x,children:y})]})});var Fl=e=>typeof e=="number"?`${e}px`:e,Ml={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function _m(e,t){if(e==null){let n=t.radius?.xs??t.radius?.sm??3;return Fl(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Fl(n)}return e}function Vm(e){if(typeof e!="string")return false;let t=e.trim();return !(!t||t.length>4||/[A-Za-z0-9]/.test(t))}var jm=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=V(),f=xe(),T=Ml[o]??Ml.sm,k=_m(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&&Vm(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 Xm=(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=Xm(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,Hl=me.createContext(null),Ll=()=>{let e=useContext(Hl);if(!e)throw new Error("Modal components must be used within <Modal>.");return e},tf=({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(Hl.Provider,{value:u,children:e})},Bl=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=Ll(),c=!!e&&me.isValidElement(t),i=useCallback(u=>{if(c){let m;me.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;me.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 me.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})});Bl.displayName="ModalTrigger";var $l=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=V(),{open:d,setOpen:p,lockScroll:C}=Ll(),M=me.useRef(null),R=me.useRef(null);me.useEffect(()=>{if(!d)return;R.current=document.activeElement;let S=setTimeout(()=>{let I=M.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=M.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),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),A=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(Wn,{role:"dialog","aria-modal":"true",tabIndex:-1,className:["plainframe-ui-modal",k||""].join(" ").trim(),padding:s,radius:r,variant:"panel",css:[A,f],ref:S=>{M.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})});$l.displayName="ModalContent";var uf=({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=V(),T=xe(),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(()=>df({count:b,page:d,siblingCount:r,boundaryCount:s}),[b,d,r,s]),M=f.palette?.primary?.[600],R=f.surface?.border,w=l==="subtle"?f.surface.subtleHover:l==="ghost"?f.surface?.subtleBg:f.surface.panelHover,A=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:A,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:a?"not-allowed":"pointer",outline:"none",transition:"all .16s ease !important","&[aria-disabled='true']":{opacity:.55,pointerEvents:"none",cursor:"not-allowed"},fontWeight:600}),S=css({width:28,minWidth:28,height:28,padding:0}),F=(g=false)=>css([W,T({color:g?"primary":"neutral"}),l==="outlined"?g?{background:M,color:f.text.onColors.primary,borderColor:M}:{background:"transparent",borderColor:R,":hover":{background:w}}:l==="ghost"?g?{background:M,color:f.text.onColors.primary}:{":hover":{background:w}}:g?{background:M,color:f.text.onColors.primary,borderColor:M}:{":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:[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:()=>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:[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":E,disabled:E,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 Sr(e,t,n){return Math.max(t,Math.min(n,e))}function df({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 gf=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,bf=me.memo(({children:e,direction:t="left",width:n,variant:o="solid",className:r,css:s})=>{let a=V(),c=a.surface.border,i=css({display:"inline-block",boxSizing:"border-box",maxWidth:gf(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 Kl=createContext(null),vf=()=>{let e=useContext(Kl);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},Cf=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},Rf=({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=V(),h=e!==void 0&&n!==void 0,[f,T]=useState(t),k=h?e:f,y=useRef([]),[x,b]=useState(0),d=()=>b(F=>F+1),p=useCallback(F=>{h||T(F),n?.(F);},[h,n]),C=useCallback(F=>(y.current.push(F),d(),y.current.length-1),[]),M=useCallback((F,I)=>{let P=y.current[F];P&&(y.current[F]={...P,...I},d());},[]),R=()=>y.current.map((F,I)=>({it:F,i:I})).filter(({it:F})=>F.ref&&!F.disabled).map(({i:F})=>F),w=useCallback((F,I)=>{let P=R();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 E=y.current[B]?.value;E!==void 0&&p(E);}},[p]),A=useCallback(F=>{let I=R();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&&p(B);}},[p]),$=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:p,disabled:o,size:r,direction:s,variant:a,register:C,update:M,moveFocusBy:w,moveToEdge:A,focusValue:$,theme:m,anchorOrigin:Cf(l)}),[k,p,o,r,s,a,C,M,w,A,$,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(Kl.Provider,{value:K,children:i})})})},Tf=({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}=vf(),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],M=C(600),R=C(100),w=f.neutral[300],A=f.palette.primary[300],$=f.text.onColors?.primary??f.neutral[0],K="transparent",W=A,S=$;T==="soft"?(K=R,W=null,S=M):T==="outlined"?(K=C(50),W=A,S=M):(K=f.neutral[200],W="transparent",S=$),b&&(T==="outlined"?(K=R,W=A,S=M):T==="filled"?(K=M,W=null,S=$):(K=R,W=null,S=M));let F=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:F,boxShadow:T==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${A}`:"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=xe();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 kf=({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 Ao=(...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(me.isValidElement(e)){if(e.type===Qs){t.push(e);return}if(e.type===me.Fragment){Zs(e.props.children,t);return}}}}var Vl=({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:M,menuSize:R="md",triggerRender:w})=>{let A=V(),$=xe(),K=me.useId(),W=`${K}-label`,S=`${K}-menu`,F={sm:{minHeight:A.componentHeights.sm,radius:A.radius.sm},md:{minHeight:A.componentHeights.md,radius:A.radius.md},lg:{minHeight:A.componentHeights.lg,radius:A.radius.md}},I=F[l]||F.md,[P,D]=me.useState(false),B=Q=>D(!!Q),z=typeof e<"u",E=c||Array.isArray(e)||Array.isArray(t),[g,v]=me.useState(()=>typeof t<"u"?t:E?[]:void 0),L=z?e:g,H=Q=>{z||v(Q),n?.(Q);},O=[];Zs(C,O);let _=O.map((Q,ie)=>{let ye=Q.props,Y=typeof ye.children=="string"||typeof ye.children=="number"?String(ye.children):void 0;return {key:Q.key??ie,value:ye.value,startIcon:ye.startIcon,endIcon:ye.endIcon,node:ye.children,labelText:Y}}),N=Q=>E?(Array.isArray(L)?L:[]).some(ye=>Object.is(ye,Q)):Object.is(L,Q),U=me.useMemo(()=>{if(E){let ie=Array.isArray(L)?L:[];return _.filter(Y=>ie.some(ve=>Object.is(ve,Y.value))).map(Y=>Y.labelText??Y.node)}let Q=_.find(ie=>Object.is(ie.value,L));if(Q)return Q.labelText??Q.node},[L,E,_]),G=Q=>{i||(Object.is(Q,L)||H(Q),B(false));},se=Q=>{if(i)return;let ie=Array.isArray(L)?L:[],Y=ie.some(ve=>Object.is(ve,Q))?ie.filter(ve=>!Object.is(ve,Q)):[...ie,Q];H(Y);},j={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:A.typography.sizes.sm,padding:`0 ${typeof A.spacing.sm=="number"?`${A.spacing.sm}px`:A.spacing.sm} 0 ${typeof A.spacing.md=="number"?`${A.spacing.md}px`:A.spacing.md}`,fontWeight:500,lineHeight:1,userSelect:"none",cursor:i?"not-allowed":"pointer",border:"none",outline:"none",transition:"box-shadow .16s ease",color:A.text.primary,background:"transparent",whiteSpace:"nowrap"},le=u==="subtle"?{background:A.surface.subtleBg}:u==="outlined"?{background:A.surface.panelBg,border:`1px solid ${A.surface.border}`}:{background:"transparent"},de={flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",textAlign:"left",gap:8},fe={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},Pe={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},Te=jsx(ChevronsUpDown,{size:16,css:css({color:A.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),Re=()=>{if(w)return w(U);if(Array.isArray(U)){let ie=U.map(Y=>typeof Y=="string"?Y:"").filter(Boolean),ye=ie.length>0?ie.join(", "):U.length>0?`${U.length} selected`:String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(fe),children:s}),jsx("span",{css:css(Pe),title:ye,children:ye})]})}let Q=U??String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(fe),children:s}),jsx("span",{css:css(Pe),title:typeof Q=="string"?Q:void 0,children:Q})]})},Ie={left:"start",center:"center",right:"end"},we=Q=>{i||(Q.key==="ArrowDown"||Q.key==="ArrowUp"||Q.key==="Enter"||Q.key===" ")&&(Q.preventDefault(),B(true));};return jsxs("div",{css:Ao(j,y),className:["plainframe-ui-select-wrapper",M||""].join(" ").trim(),children:[o&&jsx("div",{id:W,className:"plainframe-ui-select-label",css:Ao({marginBottom:6,fontSize:A.typography.sizes.sm,fontWeight:500,color:A.text.secondary},x),children:o}),jsxs(Ln,{size:R,open:P,onOpenChange:B,children:[jsx(Bn,{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:we,onClick:()=>B(!P),className:"plainframe-ui-select-trigger",css:Ao(css(J),css(le),b,$()),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(de),children:Re()}),a??Te]})}),jsx(yn,{id:S,gap:"xs",align:Ie[f],sameWidth:T==null,width:T??h,className:"plainframe-ui-select-menu",css:Ao({maxHeight:typeof k=="number"?`${k}px`:k,overflowY:"auto"},d),children:_.map((Q,ie)=>{let ye=N(Q.value);return jsx(Ht,{startIcon:Q.startIcon,endIcon:Q.endIcon,selected:ye,disabled:i,closeOnSelect:!E,onSelect:()=>E?se(Q.value):G(Q.value),css:Ao(p),className:"plainframe-ui-select-option",children:Q.node},Q.key??ie)})})]})]})};Vl.displayName="Select";var ea=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Pf=keyframes`
|
|
14
14
|
0% { background-position: -200% 0; }
|
|
15
15
|
100% { background-position: 200% 0; }
|
|
16
16
|
`,Df=keyframes`
|
|
17
17
|
0% { opacity: .6; }
|
|
18
18
|
50% { opacity: 1; }
|
|
19
19
|
100% { opacity: .6; }
|
|
20
|
-
`,Nf=pe.memo(({isLoading:e=true,radius:t,animation:n="wave",children:o,width:r,height:s,style:a,className:c,css:i})=>{let f=U(),l=f.surface.subtleBg,p=f.neutral[200],b=ea(t??f.radius?.lg??8,"8px"),m=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))}),C=css({position:"absolute",inset:0,borderRadius:b,pointerEvents:"none",background:l,willChange:"background-position, opacity"}),F=n==="wave"?css({backgroundImage:`linear-gradient(90deg, ${l} 25%, ${p} 50%, ${l} 75%)`,backgroundSize:"200% 100%",animation:`${Pf} 1.4s ease-in-out infinite`}):n==="pulse"?css({animation:`${Df} 1.2s ease-in-out infinite`}):css({}),h=css({visibility:e?"hidden":"visible",display:"inline-block",borderRadius:b});return jsxs("span",{className:["plainframe-ui-skeleton",c||""].join(" ").trim(),css:[m,i],style:a,"aria-busy":e||void 0,children:[e&&jsx("span",{"aria-hidden":true,css:[C,F]}),jsx("span",{className:"plainframe-ui-skeleton-content",css:h,children:o})]})});var Fr=8,ta=20,Un=4,ql=({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:f=false,label:l,fullWidth:p=false,css:b,trackCss:m,thumbCss:C,direction:F="horizontal",className:h,...y})=>{let g=U(),u=F==="vertical",d=useRef(null),[x,N]=useState(false),[v,R]=useState(false),[M,B]=useState(false),_=e!==void 0,K=useCallback(J=>Math.min(r,Math.max(o,J)),[o,r]),E=useCallback(J=>K(Math.round((J-o)/s)*s+o),[o,s,K]),[A,w]=useState(()=>E(t??o)),D=_?E(e):A;useEffect(()=>{_||w(J=>E(J));},[o,r,s,_,E]);let H=g.palette.primary[600];g.surface.panelBg;let O=g.neutral[500],$=useMemo(()=>{let J=r-o||1;return (D-o)/J*100},[D,o,r]),S=useCallback(J=>{_||w(J),n?.(J);},[_,n]),k=useCallback((J,xe)=>{let ee=d.current;if(!ee)return D;let re=ee.getBoundingClientRect(),ae=u?(re.bottom-xe)/re.height:(J-re.left)/re.width;return ae=Math.max(0,Math.min(1,ae)),E(o+ae*(r-o))},[D,u,o,r,E]),W=useCallback(J=>{a||(J.currentTarget.setPointerCapture?.(J.pointerId),S(k(J.clientX,J.clientY)),N(true));},[a,S,k]),T=useCallback(J=>{a||(J.currentTarget.setPointerCapture?.(J.pointerId),N(true));},[a]),I=useCallback(J=>{!x||a||S(k(J.clientX,J.clientY));},[x,a,S,k]),z=useCallback(()=>N(false),[]);useEffect(()=>{if(x)return window.addEventListener("pointermove",I),window.addEventListener("pointerup",z),window.addEventListener("pointercancel",z),()=>{window.removeEventListener("pointermove",I),window.removeEventListener("pointerup",z),window.removeEventListener("pointercancel",z);}},[x,I,z]);let P=useCallback(J=>{if(a)return;let xe=D;if(J.key==="ArrowRight"||J.key==="ArrowUp")xe=D+s;else if(J.key==="ArrowLeft"||J.key==="ArrowDown")xe=D-s;else if(J.key==="Home")xe=o;else if(J.key==="End")xe=r;else return;J.preventDefault(),S(E(xe));},[a,D,s,o,r,S,E]),j=x||v||M,q=(v||x)&&!a,te=`color-mix(in srgb, ${H} 25%, transparent)`,V=css({display:"flex",flexDirection:u?"row":"column",alignItems:"center",padding:u?"1rem":"1rem 0",width:u?"fit-content":p?"100%":350,height:u?250:"auto",boxSizing:"border-box"}),Y=css({marginBottom:u?0:4,marginRight:u?8:0,color:g.text.primary,userSelect:"none"}),ie=css({position:"relative",width:u?Fr:"100%",height:u?"100%":Fr,backgroundColor:g.neutral[200],borderRadius:g.radius.xs,cursor:a?"not-allowed":"pointer",touchAction:"none",outline:"none",overflow:"visible"}),ce=css({position:"absolute",left:u?"50%":0,top:u?2:"50%",transform:u?"translateX(-50%)":"translateY(-50%)",width:u?Fr:`calc(100% - ${Un*.5}px)`,height:u?`calc(100% - ${Un*.5}px)`:Fr,display:"flex",flexDirection:u?"column":"row",justifyContent:"space-between",alignItems:"center",pointerEvents:"none",zIndex:0,padding:0}),me=css({width:Un,height:Un,borderRadius:"50%",backgroundColor:g.text.primary,opacity:.15,flex:"0 0 auto"}),De=css({position:"absolute",left:0,top:u?`calc(${100-$}% )`:0,bottom:0,width:u?"100%":`${$}%`,height:u?`${$}%`:"100%",backgroundColor:a?O:H,borderRadius:g.radius.sm,zIndex:1,transition:"none",pointerEvents:"none"}),Re=css({position:"absolute",appearance:"none",WebkitAppearance:"none",background:g.text.onColors.primary,width:ta,height:ta,left:u?"50%":`calc(${$}% - ${ta/2}px)`,bottom:u?`${$}%`:"auto",top:u?"auto":"50%",transform:u?"translate(-50%, 50%)":"translateY(-50%)",borderRadius:c?g.radius.full:`calc(${g.radius.md} * 0.75)`,border:`2px solid ${a?O:H}`,cursor:a?"not-allowed":"grab",zIndex:5,padding:0,lineHeight:0,transition:"box-shadow .16s ease",boxShadow:q?`0 0 0 ${x?4:8}px ${te}`:`0 0 0 0px ${te}`,"&:focus-visible":{boxShadow:`0 0 0 4px ${te}`,outline:"none"}}),Ce=css({position:"relative",backgroundColor:"transparent",padding:"1rem",top:u?-7.5:-28,left:u?9:-7.5,pointerEvents:"none"}),ke=css({position:"absolute",top:u?`calc(50% - ${Un*2.5}px)`:0,left:u?"auto":`calc(50% - ${Un*3}px)`,transform:u?"translateY(-50%)":"translateX(-50%)",backgroundColor:g.neutral[800],color:g.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:g.neutral[800],borderRadius:2,bottom:u?"50%":-2,left:u?-2.5:"50%",transform:u?"translateY(50%) rotate(45deg)":"translateX(-50%) rotate(45deg)"}}),Te=b,Q=m,le=C,he=Math.floor((r-o)/s)+1;return jsxs("div",{...y,role:"group","aria-label":l,className:["plainframe-ui-slider",h||""].join(" ").trim(),css:[V,Te],"data-orientation":u?"vertical":"horizontal",children:[l&&!u&&jsx("div",{className:"plainframe-ui-slider-label",css:Y,children:l}),jsxs("div",{ref:d,className:"plainframe-ui-slider-track",css:[ie,Q],onPointerDown:W,children:[f&&s>0&&jsx("div",{className:"plainframe-ui-slider-stepper",css:ce,children:Array.from({length:he}).map((J,xe)=>jsx("span",{className:"plainframe-ui-slider-step-dot",css:me},xe))}),jsx("div",{className:"plainframe-ui-slider-fill",css:De}),jsxs("button",{type:"button",role:"slider","aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":D,"aria-disabled":a||void 0,tabIndex:a?-1:0,onKeyDown:P,onPointerDown:T,onPointerUp:z,onPointerCancel:z,onMouseEnter:()=>R(true),onMouseLeave:()=>R(false),className:"plainframe-ui-slider-thumb",css:[Re,le],children:[jsx(AnimatePresence,{children:j&&jsx(motion.div,{className:"plainframe-ui-slider-tooltip-anchor",css:Ce,initial:{opacity:0,scale:.9,y:u?0:4,x:u?4:0},animate:{opacity:1,scale:1,y:0,x:0},exit:{opacity:0,scale:.9,y:u?0:4,x:u?4:0},transition:{duration:.16,ease:"easeOut"},children:jsx(motion.div,{className:"plainframe-ui-slider-tooltip",css:ke,initial:{opacity:0,y:u?0:4,x:u?-4:0},animate:{opacity:1,y:0,x:0},exit:{opacity:0,y:u?0:4,x:u?-4:0},transition:{duration:.16,ease:"easeOut"},onMouseEnter:()=>B(true),onMouseLeave:()=>B(false),children:D})})}),null]})]}),l&&u&&jsx("div",{className:"plainframe-ui-slider-label",css:[Y,{marginLeft:8}],children:l})]})};ql.displayName="Slider";var Of=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%"}),Wf=css({display:"flex",alignItems:"center",width:"100%",gap:12}),Kf=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"}),_f=e=>css({position:"relative",flex:"1 1 24px",minWidth:6,height:2,borderRadius:1,background:e,overflow:"hidden"}),jf=(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"}),Vf=css({flex:"1 1 24px",minWidth:2,display:"flex",alignItems:"center",justifyContent:"center"}),Uf=(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"}}),qf=css({fontWeight:700,fontSize:14,lineHeight:1,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"}),Gl=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"}),Gf=(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}),Xf=pe.memo(function({i:t,item:n,size:o,tokens:r,variant:s,titlePosition:a,isActive:c,completed:i,disabled:f,connectorColor:l,showConnector:p,animate:b,separator:m,canGoToIndex:C,setSelected:F}){let h=U(),y=ye(),{MAIN:g,ACTIVE_TEXT:u,ACTIVE_TEXT_OUTLINED:d,COMPLETE_BG:x,COMPLETE_FG:N,UPCOMING_BG_FILLED:v,UPCOMING_OUTLINE:R,UPCOMING_FG:M}=r,B="transparent",_=M,K=R;s==="subtle"?i?(B=x,_=N,K=x):c?(B=g,_=u,K=g):(B=v,_=M,K=v):i?(B=x,_=N,K=x):c?(B="transparent",_=d,K=g):(B="transparent",_=M,K=R);let E=n.label,A=n.icon??jsx("span",{css:qf,children:typeof E=="number"?E:t+1}),w=n.completedIcon??jsx(Check,{strokeWidth:3.25,size:16});return jsxs(Fragment,{children:[jsxs("div",{className:"plainframe-ui-step",css:Kf(a),children:[jsxs("button",{className:"plainframe-ui-step-node",css:[Uf(o,B,_,K,String(h.radius.full)),!f&&y({color:c?"primary":"neutral"})],onClick:()=>{!f&&C(t)&&F(n.value);},tabIndex:f?-1:0,"aria-current":c?"step":void 0,"aria-disabled":f||void 0,disabled:f,"aria-label":typeof E=="string"?E:`Step ${t+1}`,children:[jsx("span",{className:"plainframe-ui-step-content",css:Gl(!i),children:A}),jsx("span",{className:"plainframe-ui-step-check",css:Gl(!!i),children:w})]}),E&&jsx("span",{className:"plainframe-ui-step-label",css:Gf(i||c,h.text.primary,h.text.secondary,String(h.radius.xs),Number(h.spacing.xs)),children:E})]}),p&&(m?jsx("div",{className:"plainframe-ui-stepper-separator",css:Vf,children:m}):jsx("div",{className:"plainframe-ui-step-connector",css:_f(h.neutral[300]),children:jsx("div",{className:"plainframe-ui-step-connector-fill",css:jf(i?1:0,l,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 Yf=({variant:e="subtle",value:t,defaultValue:n,onChange:o,disabled:r=false,allowForward:s=true,allComplete:a=false,color:c,activeBgColor:i,activeColor:f,completeBgColor:l,completeColor:p,separator:b,titlePosition:m="right",width:C,css:F,className:h,children:y,...g})=>{let u=U(),d=e==="outlined"?"outlined":"subtle",x=pe.useMemo(()=>{let k=pe.Children.toArray(y).filter(W=>pe.isValidElement(W)&&W.type===ra);return k.length?k.map((W,T)=>({index:T,...W.props})):[{value:1},{value:2},{value:3}]},[y]),N=pe.useCallback((k,W)=>k?u.palette?.[k]??k:W,[u.palette]),v=pe.useMemo(()=>({MAIN:String(N(i,typeof u.palette.primary[600]=="string"?u.palette.primary[600]:"")),ACTIVE_TEXT:String(N(f,typeof u.text.onColors?.primary=="string"?u.text.onColors?.primary:"")),ACTIVE_TEXT_OUTLINED:String(N(f,typeof u.text.primary=="string"?u.text.primary:"")),COMPLETE_BG:String(N(l,typeof u.palette.primary[600]=="string"?u.palette.primary[600]:"")),COMPLETE_FG:String(N(p,typeof u.text.onColors?.primary=="string"?u.text.onColors?.primary:"")),UPCOMING_BG_FILLED:String(typeof u.neutral[100]=="string"?u.neutral[100]:""),UPCOMING_OUTLINE:String(typeof u.neutral[300]=="string"?u.neutral[300]:""),UPCOMING_FG:String(typeof u.text.secondary=="string"?u.text.secondary:"")}),[N,i,f,l,p,u.palette.primary,u.neutral,u.text]),R=pe.useMemo(()=>{let k=N(c,u.palette.primary[600]);return typeof k=="string"?k:String(k)},[N,c,u.palette.primary]),[M,B]=pe.useState(()=>x.some(W=>W?.value===n)?n:x[0]?.value),_=t!==void 0,K=_?t:M,{activeIndex:E,afterLast:A}=pe.useMemo(()=>{let k=x.findIndex(W=>W.value===K);if(k!==-1)return {activeIndex:k,afterLast:false};if(typeof K=="number"){let W=Math.floor(K)-1;if(W>=x.length)return {activeIndex:x.length-1,afterLast:true};if(W>=0)return {activeIndex:W,afterLast:false}}return {activeIndex:0,afterLast:false}},[x,K]),w=pe.useCallback(k=>{r||(_||B(k),o?.(k));},[r,_,o]),D=pe.useCallback(k=>a||!!x[k]?.complete||(A?true:k<E),[a,x,A,E]),H=pe.useCallback(k=>{if(r)return false;let W=x[k];if(!W||W.disabled)return false;if(typeof s=="boolean"){if(s===false&&k>E)return false}else if(typeof s=="function"&&!s(E,k))return false;return true},[r,x,s,E]),[L,O]=pe.useState(false);pe.useEffect(()=>{let k=requestAnimationFrame(()=>O(true));return ()=>cancelAnimationFrame(k)},[]);let $=pe.useCallback(k=>{if(!x.length||r)return;let W=E;if(k.key==="ArrowRight")W=Math.min(x.length-1,E+1);else if(k.key==="ArrowLeft")W=Math.max(0,E-1);else if(k.key==="Home")W=0;else if(k.key==="End")W=x.length-1;else return;k.preventDefault(),H(W)&&w(x[W].value);},[x,r,E,H,w]),S=34;return jsx("div",{tabIndex:-1,className:["plainframe-ui-stepper",h||""].join(" ").trim(),css:[Of(C),F],...g,children:jsx("div",{tabIndex:-1,className:"plainframe-ui-stepper-track",role:"list",onKeyDown:$,css:Wf,children:x.map((k,W)=>jsx(pe.Fragment,{children:jsx(Xf,{i:W,item:k,size:S,tokens:v,variant:d,titlePosition:m,isActive:!A&&W===E,completed:D(W),disabled:r||!!k.disabled,connectorColor:R,showConnector:W<x.length-1,animate:L,separator:b,canGoToIndex:H,setSelected:w})},String(k.value??W)))})})};var Pr=()=>null;Pr.displayName="PF.Tab";var Dr=()=>null;Dr.displayName="PF.TabContent";function Zf(e){let t=e.props;return {type:t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__??e.type,props:t}}var Qf=({children:e,defaultValue:t,value:n,onChange:o,variant:r="subtle",direction:s="horizontal",className:a,shadow:c=false,width:i,fullWidth:f=false,rounded:l=false,titlePosition:p="right",align:b,css:m,trackCss:C,thumbCss:F,activeTabCss:h,activeIndicatorCss:y})=>{let g=U(),u=ye(),d=s==="vertical",x=f||i!=null,N=b??(d?"left":"center"),v={left:"flex-start",center:"center",right:"flex-end"},{tabs:R,contents:M}=pe.useMemo(()=>{let ee=[],re=[];return pe.Children.forEach(e,ae=>{if(!pe.isValidElement(ae))return;let{type:fe,props:He}=Zf(ae),Oe=fe===Pr||fe?.displayName===Pr.displayName,X=fe===Dr||fe?.displayName===Dr.displayName;if(Oe){let se=He;if(se?.value===void 0)return;ee.push({value:se.value,disabled:se.disabled,node:se.children,className:se.className,css:se.css,activeCss:se.activeCss});}else if(X){let se=He;if(se?.value===void 0)return;re.push({value:se.value,node:se.children,className:se.className,css:se.css});}}),{tabs:ee,contents:re}},[e]),B=pe.useMemo(()=>R.find(ee=>!ee.disabled)?.value,[R]),[_,K]=pe.useState(()=>t!==void 0&&R.some(re=>re.value===t&&!re.disabled)?t:B),E=n!==void 0,A=E?n:_,w=pe.useRef(null),D=pe.useRef([]),H=Math.max(0,R.findIndex(ee=>ee.value===A)),[L,O]=pe.useState({left:0,top:0,width:0,height:0}),[$,S]=pe.useState(false),[k,W]=pe.useState(false),T=pe.useCallback(()=>{let ee=w.current,re=D.current[H];if(!ee||!re)return;let ae=ee.getBoundingClientRect(),fe=re.getBoundingClientRect();O({left:fe.left-ae.left,top:fe.top-ae.top,width:fe.width,height:fe.height});},[H]);pe.useLayoutEffect(()=>{T(),$||(S(true),requestAnimationFrame(()=>W(true)));},[T,$]),pe.useEffect(()=>{let ee=new ResizeObserver(()=>T());w.current&&ee.observe(w.current);let re=D.current[H];re&&ee.observe(re);let ae=()=>T();return window.addEventListener("resize",ae),()=>{ee.disconnect(),window.removeEventListener("resize",ae);}},[T,H]);let I=(ee,re)=>{if(!R.length)return ee;let ae=ee;for(let fe=0;fe<R.length;fe++)if(ae=(ae+re+R.length)%R.length,!R[ae].disabled)return ae;return ee},z=ee=>{E||K(ee),o?.(ee);},P=ee=>{if(!R.length)return;let re=H;if(ee.key===(d?"ArrowDown":"ArrowRight"))re=I(H,1);else if(ee.key===(d?"ArrowUp":"ArrowLeft"))re=I(H,-1);else if(ee.key==="Home")re=R.findIndex(fe=>!fe.disabled);else if(ee.key==="End"){let fe=[...R].reverse().findIndex(He=>!He.disabled);re=fe===-1?H:R.length-1-fe;}else return;ee.preventDefault();let ae=R[re]?.value;ae!==void 0&&z(ae),requestAnimationFrame(()=>D.current[re]?.focus());},j=g.text.primary,q=g.text.secondary,te=g.neutral[500],V=r==="subtle"?g.surface.subtleBg:"transparent",Y=r==="subtle"?g.surface.panelBg??g.surface.panelBg:r==="ghost"?g.surface.subtleBg:"transparent",ie=g.text.primary,ce=r==="subtle"||r==="ghost"||r==="underlined",me=css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",width:f?"100%":i==null?"auto":typeof i=="number"?`${i}px`:i}),De=r==="subtle",Re=css({position:"relative",display:x?"flex":"inline-flex",width:x?"100%":"auto",flexDirection:d?"column":"row",alignItems:d?"stretch":"center",flexWrap:"nowrap",gap:g.spacing.xs,padding:De?g.spacing.xs:0,background:V,borderRadius:r==="subtle"?l?d?g.radius.lg:g.radius.full:g.radius.lg:"none"}),Ce=css({position:"absolute",zIndex:0,pointerEvents:"none",opacity:$?1:0,visibility:$?"visible":"hidden",transition:k?`${d?"top":"left"} .24s var(--pf-ease), ${d?"height":"width"} .24s var(--pf-ease), background-color .18s var(--pf-ease)`:"none",borderRadius:r==="subtle"||r==="ghost"?l?g.radius.full:g.radius.md:0,background:r==="underlined"?"transparent":Y,...d?{top:`${L.top}px`,height:`${L.height}px`,left:g.spacing.xs,right:g.spacing.xs}:{left:`${L.left}px`,width:`${L.width}px`,top:g.spacing.xs,bottom:g.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"}),ke=css(r!=="underlined"?{}:d?{background:"transparent",top:`${L.top}px`,height:`${L.height}px`,left:0,width:0,borderLeft:`2px solid ${ie}`,borderBottom:"none",borderRadius:2}:{background:"transparent",left:`${L.left}px`,width:`${L.width}px`,bottom:0,top:"auto",height:0,borderBottom:`2px solid ${ie}`,borderLeft:"none",borderRadius:2}),Te=css({position:"relative",zIndex:1,border:"none",background:"transparent",padding:r==="underlined"&&s!=="vertical"?`${g.spacing.md}`:r==="ghost"&&s!=="vertical"?`${g.spacing.md}`:`${g.spacing.xs} ${g.spacing.md}`,borderRadius:(r==="subtle"||r==="ghost")&&l?g.radius.full:g.radius.md,minHeight:g.componentHeights.sm,outline:"none",transition:"color .16s ease !important",display:"flex",alignItems:"center",justifyContent:"center",...d?{width:x?"100%":"auto",flex:"0 0 auto",textAlign:N}:x?{flex:"1 1 0",minWidth:0,textAlign:"center"}:{flex:"0 0 auto",minWidth:"max-content",textAlign:"center"},whiteSpace:"nowrap",boxSizing:"border-box",cursor:"pointer",userSelect:"none",fontSize:g.typography.sizes.sm,fontWeight:600,color:q,"&[aria-selected='true']":{color:j},"&:hover":{color:j},"&[aria-disabled='true'], &:disabled":{opacity:.55,cursor:"not-allowed",color:te}}),Q=css({display:"inline-flex",alignItems:"center",justifyContent:d?v[N]:"center",gap:6,width:"100%",flexDirection:p==="top"?"column-reverse":p==="bottom"?"column":p==="left"?"row-reverse":"row"}),le=css({marginTop:g.spacing.sm,width:"100%"}),he=pe.useId(),J=new Map;M.forEach((ee,re)=>J.set(ee.value,`${he}-panel-${re}`));let xe=ee=>`${he}-tab-${ee}`;return jsxs("div",{className:["plainframe-ui-tabs",a||""].join(" ").trim(),css:[me,m],children:[jsxs("div",{className:"plainframe-ui-tabs-track",ref:w,role:"tablist","aria-orientation":d?"vertical":"horizontal",onKeyDown:P,css:[Re,C],children:[ce&&jsx("div",{className:"plainframe-ui-tabs-thumb",css:[Ce,ke,F,y]}),R.map((ee,re)=>{let ae=A===ee.value;return jsx("button",{ref:fe=>{D.current[re]=fe;},role:"tab",id:xe(re),"aria-selected":ae,"aria-controls":J.get(ee.value),"aria-disabled":ee.disabled||void 0,disabled:ee.disabled,tabIndex:ee.disabled?-1:re===H?0:-1,className:["plainframe-ui-tab",ee.className||""].join(" ").trim(),onClick:()=>{ee.disabled||z(ee.value);},css:[Te,!ee.disabled&&u(),ee.css,ae?ee.activeCss??h:void 0],children:jsx("span",{className:"plainframe-ui-tab-content",css:Q,children:ee.node})},String(ee.value??re))})]}),M.map((ee,re)=>{if(!(ee.value===A))return null;let fe=R.findIndex(Oe=>Oe.value===ee.value),He=fe>=0?xe(fe):void 0;return jsx("div",{role:"tabpanel",id:J.get(ee.value),"aria-labelledby":He,className:["plainframe-ui-tab-panel",ee.className||""].join(" ").trim(),css:[le,ee.css],children:ee.node},re)})]})};var Mo=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,wn=e=>e==null?[]:Array.isArray(e)?e:[e],Fo=(...e)=>css(e.filter(Boolean)),sg=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,error:s,helperText:a,disabled:c=false,fullWidth:i=false,width:f=235,size:l="md",variant:p="subtle",rounded:b=false,rows:m=3,maxRows:C,maxLength:F,showCharCount:h,focusRingMode:y="always",resizable:g=false,className:u,wrapperCss:d,inputCss:x,labelCss:N,helperRowCss:v,helperTextCss:R,charCountCss:M,css:B,onBlur:_,onFocus:K,onKeyDown:E,autoFocus:A,name:w,id:D,tabIndex:H,autoComplete:L,readOnly:O,required:$})=>{let S=U(),k=Jo(),W=useId(),T=useMemo(()=>({sm:{fontSize:S.typography.sizes.sm,minHeight:S.componentHeights.sm,labelFont:S.typography.sizes.xs,helperFont:S.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:S.spacing.md},md:{fontSize:S.typography.sizes.sm,minHeight:S.componentHeights.md,labelFont:S.typography.sizes.sm,helperFont:S.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:S.spacing.md},lg:{fontSize:S.typography.sizes.sm,minHeight:S.componentHeights.lg,labelFont:S.typography.sizes.md,helperFont:S.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:S.spacing.md}}),[S]),I=["sm","md","lg"].includes(l)?l:"md",z=T[I],P=S.neutral,j=S.text,q=t!==void 0,[te,V]=useState(n),Y=q?t:te,ie=useCallback(ae=>{q||V(ae),o?.(ae);},[q,o]),ce=useMemo(()=>c?P[200]:s&&p==="outlined"?S.palette.danger?.[50]??S.surface.panelBg:s&&p==="subtle"?S.palette.danger?.[50]??S.surface.subtleBg:p==="outlined"?S.surface.panelBg:p==="subtle"?S.surface.subtleBg:"transparent",[c,s,p,P,S.surface,S.palette.danger]),me=S.componentHeights.border,De=useMemo(()=>p==="outlined"?`${me} solid ${s?S.palette.danger?.[300]??S.surface.border:S.surface.border}`:"none",[p,me,s,S.palette.danger,S.surface.border]),Re=useMemo(()=>css({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:i?"100%":f!=null?Mo(f):void 0,flex:"0 0 auto",fontWeight:500}),[i,f]),Ce=useMemo(()=>Fo({fontSize:z.labelFont,fontWeight:500,color:s?S.palette.danger?.[700]??j.primary:c?P[500]:j.primary,marginBottom:4,display:"inline-block"},...wn(N)),[z.labelFont,s,c,P,j,S.palette.danger,N]),ke=useMemo(()=>[{display:"flex",alignItems:"stretch",gap:S.spacing.sm,padding:`${Mo(z.paddingY)} 0 ${Mo(z.paddingY)} ${Mo(z.paddingX)}`,background:ce,border:De,borderRadius:b?S.radius.full:S.radius.md,minHeight:z.minHeight,width:"100%",cursor:c?"not-allowed":"text",opacity:c?.65:1,transition:"box-shadow .18s, border-color .16s"},...wn(d),...wn(B)],[S,z,ce,De,me,b,c,d,B]),Te=typeof z.minHeight=="number"?`${z.minHeight}px`:z.minHeight,Q=useMemo(()=>Fo({width:"100%",minWidth:0,flex:1,resize:g?"vertical":"none",font:"inherit",fontWeight:500,fontSize:z.fontSize,lineHeight:1.5,color:c?P[500]:s?S.palette.danger?.[800]??j.primary:j.primary,background:"transparent",border:"none",outline:"none",padding:0,paddingRight:Mo(z.paddingX),overflowY:"auto",minHeight:Te,"&::placeholder":{color:s?S.palette.danger?.[700]??j.secondary:j.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${s?S.palette.danger?.[800]??j.primary:j.primary} !important`,boxShadow:`0 0 0 1000px ${ce} inset !important`,transition:"opacity 99999s ease-out",caretColor:s?S.palette.danger?.[800]??j.primary:j.primary},":focus-within":{outline:"none",boxShadow:"none"},...m===1?{paddingBlock:`calc((${Te} - 1.5em) / 2)`}:{paddingBlock:"clamp(4px, 0.5em, 12px)"}},...wn(x)),[g,z,c,s,P,j,S.palette.danger,Te,ce,m,x]),le=useMemo(()=>Fo({display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8,paddingTop:3},...wn(v)),[v]),he=useMemo(()=>Fo({fontSize:z.helperFont,color:s?S.palette.danger?.[700]??j.secondary:j.secondary,flex:1,minWidth:0},...wn(R)),[z.helperFont,s,S.palette.danger,j,R]),J=useMemo(()=>Fo({fontSize:z.helperFont,color:F&&Y.length>F?S.palette.danger?.[700]??j.secondary:j.secondary,flexShrink:0},...wn(M)),[z.helperFont,F,Y.length,S.palette.danger,j,M]),xe=useRef(null);useLayoutEffect(()=>{if(typeof window>"u")return;let ae=xe.current;if(!ae)return;if(g){let He=window.getComputedStyle(ae),Oe=parseFloat(He.lineHeight||"20"),X=typeof z.minHeight=="number"?z.minHeight:parseFloat(String(z.minHeight)),se=Math.max(Oe*(m??1),X);ae.style.setProperty("--pf-minh",`${se}px`);return}(()=>{let He=window.getComputedStyle(ae),Oe=parseFloat(He.lineHeight||"20"),X=typeof z.minHeight=="number"?z.minHeight:parseFloat(String(z.minHeight)),se=Math.max(Oe*(m??1),X);ae.style.setProperty("--pf-minh",`${se}px`);let Z=C?Oe*C:1/0;ae.style.height="auto",ae.style.height=`${Math.min(ae.scrollHeight,Z)}px`;})();},[Y,m,C,z.minHeight,g]);let ee=a!=null||h?`${D??W}-help`:void 0,re=D??W;return jsxs("div",{className:["plainframe-ui-textarea",u||""].join(" ").trim(),css:Re,children:[e&&jsx("label",{htmlFor:re,className:"plainframe-ui-textarea-label",css:Ce,children:e}),jsx("div",{className:"plainframe-ui-textarea-surface",css:[k({enabled:y!=="none",disabled:c,color:s?"danger":void 0}),ke],"aria-invalid":!!s||void 0,"aria-disabled":c||void 0,onClick:()=>!c&&xe.current?.focus(),children:jsx("textarea",{ref:xe,id:re,className:"plainframe-ui-textarea-input",css:Q,rows:m,value:Y,onChange:ae=>{let fe=ae.target.value;F&&fe.length>F||ie(fe);},placeholder:r||"",disabled:c,onBlur:_,onFocus:K,onKeyDown:E,autoFocus:A,name:w,tabIndex:H,autoComplete:L,readOnly:O,required:$,"aria-invalid":!!s||void 0,"aria-describedby":ee})}),(a!=null||h&&F!=null)&&jsxs("div",{className:"plainframe-ui-textarea-helper-row",css:le,children:[jsx("span",{id:ee,className:"plainframe-ui-textarea-helper-text",css:he,children:a}),h&&F!=null&&jsxs("span",{className:"plainframe-ui-textarea-char-count",css:J,children:[Y.length,"/",F]})]})]})};var mg=jo,fg={type:"spring",stiffness:920,damping:100},Jl="__toast_root__",gg=(e,t)=>t.split(".").reduce((n,o)=>n!=null&&typeof n=="object"?n[o]:void 0,e),Hr=(e,t)=>{for(let n of t){let o=gg(e,n);if(o!=null&&o!=="")return o}},aa=(e,t)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:String(e);function bg(e){let t=Hr(e,["radius.md","shape.borderRadius","radii.md"]),n=Hr(e,["spacing.lg","space.4","spacing.4"]),o=Hr(e,["spacing.md","space.3","spacing.3"]),r=Hr(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 hg=bg(mg),Kt=null,qn=null,be={max:5,position:"bottom-right",gutter:5,zIndex:1e3,duration:5e3,showDismiss:"hover",styles:{},renderer:void 0,bareRenderer:false};function ec(){typeof document>"u"||(Kt||(Kt=document.getElementById("toast-host"),Kt||(Kt=document.createElement("div"),Kt.id="toast-host",document.body.appendChild(Kt))),qn||(qn=Kt[Jl]??null,qn||(qn=createRoot(Kt),Kt[Jl]=qn,qn.render(jsx(Da,{children:jsx(Ig,{})})))));}var ne={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}};}},En=()=>{ne.sync(),ne.notify();},yg=()=>typeof crypto<"u"&&"randomUUID"in crypto&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(36).slice(2);function Lr(e,t){if(t===null)return;let n=t??e.duration;if(n==null||ne.timers.has(e.id))return;let o=Date.now(),r=ne.remaining.get(e.id),s=r!=null?Math.max(0,r):n;ne.expiry.set(e.id,o+s);let a=window.setTimeout(()=>$e.dismiss(e.id),s);ne.timers.set(e.id,a);}function Br(e){let t=ne.timers.get(e);t&&(clearTimeout(t),ne.timers.delete(e));}function xg(){let e=false;for(;ne.displayed.length<be.max&&ne.queue.length;){let t=ne.queue.shift();ne.displayed=[t,...ne.displayed],ne.enterFrom[t.id]="head",ne.entering[t.id]=true,e=true,requestAnimationFrame(()=>{delete ne.entering[t.id],En();}),Lr(t);}e&&En();}function vg(){if(ne.displayed.length<be.max)return;let e=ne.displayed.filter(o=>!ne.exiting[o.id]);if(!e.length)return;let t=e.reduce((o,r)=>o.createdAt<=r.createdAt?o:r),n=ne.expiry.get(t.id);n!=null&&ne.remaining.set(t.id,Math.max(0,n-Date.now())),Br(t.id),ne.exiting[t.id]=true,ne.displayed=ne.displayed.filter(o=>o.id!==t.id),delete ne.enterFrom[t.id],ne.queue.push(t),En();}var Cg=e=>e==="danger"?"error":["default","success","error","warning","info"].includes(e)?e:"default";function Rg(e,t){let n=Cg(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 f=s?.onColors??{},l=(p,b,m)=>{let C=o.colors,F=o.palette;return {bg:C?.[p]??F?.[p]?.[700]??b,fg:f?.[p]??m,border:"transparent"}};return n==="success"?l("success","#22C55E","#fff"):n==="warning"?l("warning","#F59E0B","#fff"):n==="error"?l("error","#EF4444","#fff"):{bg:a,fg:c,border:i}}var $e=Object.assign((e,t)=>{ec();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&&!pe.isValidElement(e)&&!n(e)&&!o(e)?r=e:r={content:(pe.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??yg(),a=i=>{let f=i.findIndex(b=>b.id===s);if(f===-1)return false;let l=i[f],p={...l,status:r.status??l.status,content:r.content??l.content,title:r.title??l.title,description:r.description??l.description,startIcon:r.startIcon??l.startIcon,endIcon:r.endIcon??l.endIcon,action:r.action??l.action,onClose:r.onClose??l.onClose,duration:r.duration===void 0?l.duration:r.duration,pauseOnHover:r.pauseOnHover??l.pauseOnHover,showDismiss:r.showDismiss??l.showDismiss,render:r.render??l.render,bare:r.bare??l.bare,onClick:r.onClick??l.onClick,width:r.width??l.width};return i[f]=p,Br(s),ne.remaining.delete(s),ne.paused.has(s)||Lr(p),En(),true};if(a(ne.displayed)||a(ne.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?be.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 ne.displayed.length>=be.max&&vg(),ne.displayed=[...ne.displayed,c],ne.enterFrom[c.id]="tail",ne.entering[c.id]=true,requestAnimationFrame(()=>{delete ne.entering[c.id],En();}),En(),Lr(c),s},{success:(e,t={})=>$e(e,{...t,status:"success"}),error:(e,t={})=>$e(e,{...t,status:"error"}),warning:(e,t={})=>$e(e,{...t,status:"warning"}),info:(e,t={})=>$e(e,{...t,status:"info"}),custom:(e,t={})=>$e(e,{...t}),update:(e,t)=>$e({id:e,...t}),dismiss:e=>{if(!e){let n=ne.displayed.find(o=>!ne.exiting[o.id])?.id;n&&$e.dismiss(n);return}Br(e),ne.remaining.delete(e),ne.paused.delete(e),ne.exiting[e]=true;let t=ne.displayed.find(n=>n.id===e);ne.displayed=ne.displayed.filter(n=>n.id!==e),delete ne.enterFrom[e],En(),window.setTimeout(()=>t?.onClose?.(),120),xg();},clear:()=>{[...ne.displayed.map(t=>t.id)].forEach(t=>$e.dismiss(t));},pause:e=>{if(ne.paused.has(e))return;let t=ne.expiry.get(e);t!=null&&ne.remaining.set(e,Math.max(0,t-Date.now())),ne.paused.add(e),Br(e);},resume:e=>{if(!ne.paused.has(e))return;ne.paused.delete(e);let t=ne.displayed.find(o=>o.id===e)??ne.queue.find(o=>o.id===e),n=ne.remaining.get(e);t&&Lr(t,n??void 0),ne.remaining.delete(e);},pauseLatest:()=>{let e=ne.displayed.at(-1);e&&$e.pause(e.id);},resumeLatest:()=>{let e=ne.displayed.at(-1);e&&$e.resume(e.id);},promise:(e,t,n={})=>{let o=$e(t.loading,{...n,status:"info",duration:null});return e.then(r=>{$e.update(o,{status:"success",content:t.success(r),duration:n.duration??2500});}).catch(r=>{$e.update(o,{status:"error",content:t.error(r),duration:n.duration??3e3});}),e},config:e=>{e.max!=null&&(be.max=e.max),e.position&&(be.position=e.position),e.gutter!=null&&(be.gutter=e.gutter),e.zIndex!=null&&(be.zIndex=e.zIndex),e.duration!==void 0&&(be.duration=e.duration),e.showDismiss&&(be.showDismiss=e.showDismiss),e.styles&&(be.styles={...be.styles,...e.styles}),e.renderer!==void 0&&(be.renderer=e.renderer),e.bareRenderer!==void 0&&(be.bareRenderer=e.bareRenderer);}});function Tg(e){return typeof e=="string"?e:e===true?"always":e===false?"never":be.showDismiss}function wg(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 Eg=css({display:"flex",alignItems:"flex-start",gap:10}),Zl=css({flex:"0 0 auto",paddingTop:1,lineHeight:0,marginLeft:-3,"& svg, & img, & canvas, & video":{display:"block"}}),Sg=css({fontSize:14,lineHeight:1.4,fontWeight:500,flex:1,minWidth:0}),kg=css({display:"flex",alignItems:"center",gap:6,marginRight:-2}),Ig=pe.memo(function(){let t=useSyncExternalStore(ne.subscribe.bind(ne),()=>ne.snapshot,()=>ne.snapshot),n=U(),o=be.position.startsWith("bottom"),r=pe.useMemo(()=>o?t.displayed:[...t.displayed].reverse(),[t.displayed,o]),s=pe.useMemo(()=>({position:"fixed",zIndex:be.zIndex,pointerEvents:"none",width:"100%",display:"flex",flexDirection:"column",...wg(be.position),...be.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",f=o?i==="head"?-16:16:i==="head"?16:-16,l=c>0?be.gutter:0,p={toast:a,close:$e.dismiss,pause:$e.pause,resume:$e.resume},{bg:b,fg:m,border:C}=Rg(n,a.status),F={position:"relative",overflow:"hidden",borderRadius:n.radius.md,boxShadow:hg.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:m,cursor:a.onClick?"pointer":"default",border:C?`1px solid ${C}`:"1px solid transparent"},h=typeof be.styles.surface=="function"?be.styles.surface(a):be.styles.surface??{},y=Tg(a.showDismiss),g={},u="& .plainframe-ui-toast-close",d="&:hover .plainframe-ui-toast-close";y==="hover"?(g[u]={opacity:0,pointerEvents:"none"},g[d]={opacity:1,pointerEvents:"auto"}):y==="always"?g[u]={opacity:1,pointerEvents:"auto"}:y==="never"&&(g[u]={display:"none"});let x=css({...F,...h,...g}),N=css({position:"absolute",top:8,right:8,appearance:"none",border:0,background:"transparent",color:m,width:28,height:28,borderRadius:8,cursor:"pointer",lineHeight:1,transition:"opacity .12s ease",display:"grid",placeItems:"center",...be.styles.close??{}}),v;if(a.bare&&a.render){let R=typeof a.render=="function"?a.render(p):a.render;v=jsx("div",{style:{pointerEvents:"auto"},onClick:M=>a.onClick?.(a.id,M),children:R});}else if(be.bareRenderer&&be.renderer){let R=typeof be.renderer=="function"?be.renderer(p):be.renderer;v=jsx("div",{style:{pointerEvents:"auto"},onClick:M=>a.onClick?.(a.id,M),children:R});}else {let R;be.renderer?R=typeof be.renderer=="function"?be.renderer(p):be.renderer:a.render&&!a.bare?R=typeof a.render=="function"?a.render(p):a.render:R=jsxs(Fragment,{children:[jsxs("div",{css:Eg,children:[a.startIcon&&jsx("div",{css:Zl,children:a.startIcon}),jsx("div",{css:Sg,children:a.content}),a.endIcon&&jsx("div",{css:Zl,children:a.endIcon})]}),a.action&&jsx("div",{css:kg,children:a.action})]}),v=jsxs("div",{css:x,onClick:M=>a.onClick?.(a.id,M),children:[R,jsx("button",{className:"plainframe-ui-toast-close","aria-label":"Close",css:N,onClick:M=>{M.stopPropagation(),$e.dismiss(a.id);},children:jsx(X,{strokeWidth:2.5,size:14})})]});}return jsx(Mg,{id:a.id,isBottom:o,mt:l,enterY:f,width:a.width,pauseOnHover:a.pauseOnHover!==false,children:v},a.id)})})})}),Mg=pe.memo(function(t){let{id:n,isBottom:o,mt:r,enterY:s,width:a,pauseOnHover:c,children:i}=t,f=useAnimationControls();useEffect(()=>{f.start({opacity:1,y:0,height:"auto",x:0,transition:fg});},[f]);let l={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",...be.styles.item??{}};return jsx(motion.div,{layout:"position",className:"plainframe-ui-toast-item",css:css(l),initial:{opacity:0,y:s,height:"auto",x:0},animate:f,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 m=Math.abs(b.offset.x),C=Math.abs(b.velocity.x);if(!(m>60||C>600)){f.start({x:0,opacity:1,transition:{type:"spring",stiffness:700,damping:40}});return}let y=(b.offset.x!==0?Math.sign(b.offset.x):Math.sign(b.velocity.x||1))*(window.innerWidth+160),g=typeof b.velocity.x=="number"?b.velocity.x/10:0;f.start({x:y,opacity:.9,transition:{type:"spring",stiffness:280,damping:24,velocity:g}}).then(()=>$e.dismiss(n));},onMouseEnter:c?()=>$e.pause(n):void 0,onMouseLeave:c?()=>$e.resume(n):void 0,children:i})}),Ql=false;(function(){Ql||(Ql=true,ec());})();var Zg=(...e)=>t=>{for(let n of e)if(n)if(typeof n=="function")n(t);else try{n.current=t;}catch{}},oc=createContext(null),rc=()=>{let e=useContext(oc);if(!e)throw new Error("TooltipTrigger/TooltipContent must be inside <Tooltip>.");return e},Qg=({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[f,l]=useState(!!o),p=n??f,b=v=>{n===void 0&&l(v),r?.(v);},m=useRef(null),C=useFloating({placement:t,open:p,onOpenChange:b,whileElementsMounted:autoUpdate,strategy:"fixed",transform:false,middleware:[offset(8),flip({padding:8}),shift({padding:8}),a?arrow({element:m,padding:4}):void 0].filter(Boolean)}),F=useHover(C.context,{enabled:!i,delay:{open:s,close:60},handleClose:safePolygon(),restMs:20}),h=useFocus(C.context),y=useDismiss(C.context,{escapeKey:true,outsidePress:true}),g=useRole(C.context,{role:"tooltip"}),{getReferenceProps:u,getFloatingProps:d}=useInteractions([F,h,y,g]),x=useId(),N=useMemo(()=>({open:p,setOpen:b,id:x,placement:C.placement,autoWidth:c,allowArrow:!!a,refs:C.refs,floatingStyles:C.floatingStyles,middlewareData:C.middlewareData,getReferenceProps:u,getFloatingProps:d,arrowRef:m}),[p,c,a,C.placement,C.refs,C.floatingStyles,C.middlewareData,u,d]);return jsx(oc.Provider,{value:N,children:e})},eb=({asChild:e=true,children:t,className:n,css:o})=>{let{refs:r,getReferenceProps:s,id:a}=rc(),c=pe.isValidElement(t),i=c&&typeof t.type=="string";if(e&&c&&i){let f=t,l="ref"in f?f.ref:void 0,p=s({...f.props,"aria-describedby":a,ref:Zg(l,r.setReference),className:[f.props?.className||"",n||""].join(" ").trim()||void 0}),b=[f.props?.css||void 0,o].filter(Boolean);return pe.cloneElement(f,{...p,css:b})}return jsx("span",{ref:r.setReference,className:n,css:o,style:{display:"inline-flex"},...s({"aria-describedby":a}),children:t})},tb=({children:e,className:t,css:n,arrowCss:o})=>{let {open:r,refs:s,floatingStyles:a,middlewareData:c,getFloatingProps:i,placement:f,id:l,autoWidth:p,allowArrow:b,arrowRef:m}=rc(),C=U(),F=f.split("-")[0]||"top",y=F==="bottom"?{opacity:0,y:-8,scale:.98}:F==="top"?{opacity:0,y:8,scale:.98}:F==="left"?{opacity:0,x:8,scale:.98}:{opacity:0,x:-8,scale:.98},g=y,u=F==="bottom"?"center top":F==="top"?"center bottom":F==="left"?"right center":"left center",d=css({zIndex:1300,backgroundColor:C.neutral[900],color:C.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:u}),x=css({position:"absolute",width:10,height:10,borderRadius:2,backgroundColor:C.neutral[900],transform:"rotate(45deg)",pointerEvents:"none"}),N=c.arrow,v={top:"bottom",bottom:"top",left:"right",right:"left"}[F];return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:r&&jsxs(motion.div,{id:l,ref:s.setFloating,role:"tooltip","data-state":"open",className:["plainframe-ui-tooltip",t||""].join(" ").trim(),css:[d,n],style:a,initial:y,animate:{opacity:1,x:0,y:0,scale:1},exit:g,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,b&&jsx("div",{ref:m,className:"plainframe-ui-tooltip-arrow",css:[x,o],style:{left:N?.x!=null?`${N.x}px`:void 0,top:N?.y!=null?`${N.y}px`:void 0,[v]:"-3px"}})]})})})};function sb(){let e=U();return jsx(Global,{styles:css`
|
|
20
|
+
`,Nf=me.memo(({isLoading:e=true,radius:t,animation:n="wave",children:o,width:r,height:s,style:a,className:c,css:i})=>{let l=V(),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:`${Pf} 1.4s ease-in-out infinite`}):n==="pulse"?css({animation:`${Df} 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,Gn=4,Xl=({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=V(),d=k==="vertical",p=useRef(null),[C,M]=useState(false),[R,w]=useState(false),[A,$]=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]),[F,I]=useState(()=>S(t??o)),P=K?S(e):F;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,ve)=>{let ee=p.current;if(!ee)return P;let oe=ee.getBoundingClientRect(),ae=d?(oe.bottom-ve)/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)),M(true));},[a,g,v]),H=useCallback(Y=>{a||(Y.currentTarget.setPointerCapture?.(Y.pointerId),M(true));},[a]),O=useCallback(Y=>{!C||a||g(v(Y.clientX,Y.clientY));},[C,a,g,v]),_=useCallback(()=>M(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 ve=P;if(Y.key==="ArrowRight"||Y.key==="ArrowUp")ve=P+s;else if(Y.key==="ArrowLeft"||Y.key==="ArrowDown")ve=P-s;else if(Y.key==="Home")ve=o;else if(Y.key==="End")ve=r;else return;Y.preventDefault(),g(S(ve));},[a,P,s,o,r,g,S]),U=C||R||A,G=(R||C)&&!a,se=`color-mix(in srgb, ${D} 25%, transparent)`,j=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"}),de=css({position:"absolute",left:d?"50%":0,top:d?2:"50%",transform:d?"translateX(-50%)":"translateY(-50%)",width:d?kr:`calc(100% - ${Gn*.5}px)`,height:d?`calc(100% - ${Gn*.5}px)`:kr,display:"flex",flexDirection:d?"column":"row",justifyContent:"space-between",alignItems:"center",pointerEvents:"none",zIndex:0,padding:0}),fe=css({width:Gn,height:Gn,borderRadius:"50%",backgroundColor:b.text.primary,opacity:.15,flex:"0 0 auto"}),Pe=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"}),Te=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"}}),Re=css({position:"relative",backgroundColor:"transparent",padding:"1rem",top:d?-7.5:-28,left:d?9:-7.5,pointerEvents:"none"}),Ie=css({position:"absolute",top:d?`calc(50% - ${Gn*2.5}px)`:0,left:d?"auto":`calc(50% - ${Gn*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)"}}),we=h,Q=f,ie=T,ye=Math.floor((r-o)/s)+1;return jsxs("div",{...x,role:"group","aria-label":u,className:["plainframe-ui-slider",y||""].join(" ").trim(),css:[j,we],"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,Q],onPointerDown:L,children:[l&&s>0&&jsx("div",{className:"plainframe-ui-slider-stepper",css:de,children:Array.from({length:ye}).map((Y,ve)=>jsx("span",{className:"plainframe-ui-slider-step-dot",css:fe},ve))}),jsx("div",{className:"plainframe-ui-slider-fill",css:Pe}),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:[Te,ie],children:[jsx(AnimatePresence,{children:U&&jsx(motion.div,{className:"plainframe-ui-slider-tooltip-anchor",css:Re,initial:{opacity:0,scale:.9,y:d?0:4,x:d?4:0},animate:{opacity:1,scale:1,y:0,x:0},exit:{opacity:0,scale:.9,y:d?0:4,x:d?4:0},transition:{duration:.16,ease:"easeOut"},children:jsx(motion.div,{className:"plainframe-ui-slider-tooltip",css:Ie,initial:{opacity:0,y:d?0:4,x:d?-4:0},animate:{opacity:1,y:0,x:0},exit:{opacity:0,y:d?0:4,x:d?-4:0},transition:{duration:.16,ease:"easeOut"},onMouseEnter:()=>$(true),onMouseLeave:()=>$(false),children:P})})}),null]})]}),u&&d&&jsx("div",{className:"plainframe-ui-slider-label",css:[J,{marginLeft:8}],children:u})]})};Xl.displayName="Slider";var Of=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%"}),Wf=css({display:"flex",alignItems:"center",width:"100%",gap:12}),Kf=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"}),_f=e=>css({position:"relative",flex:"1 1 24px",minWidth:6,height:2,borderRadius:1,background:e,overflow:"hidden"}),Vf=(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"}),jf=css({flex:"1 1 24px",minWidth:2,display:"flex",alignItems:"center",justifyContent:"center"}),Uf=(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"}}),qf=css({fontWeight:700,fontSize:14,lineHeight:1,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"}),Yl=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"}),Gf=(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}),Xf=me.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=V(),x=xe(),{MAIN:b,ACTIVE_TEXT:d,ACTIVE_TEXT_OUTLINED:p,COMPLETE_BG:C,COMPLETE_FG:M,UPCOMING_BG_FILLED:R,UPCOMING_OUTLINE:w,UPCOMING_FG:A}=r,$="transparent",K=A,W=w;s==="subtle"?i?($=C,K=M,W=C):c?($=b,K=d,W=b):($=R,K=A,W=R):i?($=C,K=M,W=C):c?($="transparent",K=p,W=b):($="transparent",K=A,W=w);let S=n.label,F=n.icon??jsx("span",{css:qf,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:Kf(a),children:[jsxs("button",{className:"plainframe-ui-step-node",css:[Uf(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:Yl(!i),children:F}),jsx("span",{className:"plainframe-ui-step-check",css:Yl(!!i),children:I})]}),S&&jsx("span",{className:"plainframe-ui-step-label",css:Gf(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:jf,children:f}):jsx("div",{className:"plainframe-ui-step-connector",css:_f(y.neutral[300]),children:jsx("div",{className:"plainframe-ui-step-connector-fill",css:Vf(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 Yf=({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=V(),p=e==="outlined"?"outlined":"subtle",C=me.useMemo(()=>{let v=me.Children.toArray(x).filter(L=>me.isValidElement(L)&&L.type===ra);return v.length?v.map((L,H)=>({index:H,...L.props})):[{value:1},{value:2},{value:3}]},[x]),M=me.useCallback((v,L)=>v?d.palette?.[v]??v:L,[d.palette]),R=me.useMemo(()=>({MAIN:String(M(i,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),ACTIVE_TEXT:String(M(l,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),ACTIVE_TEXT_OUTLINED:String(M(l,typeof d.text.primary=="string"?d.text.primary:"")),COMPLETE_BG:String(M(u,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),COMPLETE_FG:String(M(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:"")}),[M,i,l,u,m,d.palette.primary,d.neutral,d.text]),w=me.useMemo(()=>{let v=M(c,d.palette.primary[600]);return typeof v=="string"?v:String(v)},[M,c,d.palette.primary]),[A,$]=me.useState(()=>C.some(L=>L?.value===n)?n:C[0]?.value),K=t!==void 0,W=K?t:A,{activeIndex:S,afterLast:F}=me.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=me.useCallback(v=>{r||(K||$(v),o?.(v));},[r,K,o]),P=me.useCallback(v=>a||!!C[v]?.complete||(F?true:v<S),[a,C,F,S]),D=me.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]=me.useState(false);me.useEffect(()=>{let v=requestAnimationFrame(()=>z(true));return ()=>cancelAnimationFrame(v)},[]);let E=me.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:[Of(T),k],...b,children:jsx("div",{tabIndex:-1,className:"plainframe-ui-stepper-track",role:"list",onKeyDown:E,css:Wf,children:C.map((v,L)=>jsx(me.Fragment,{children:jsx(Xf,{i:L,item:v,size:g,tokens:R,variant:p,titlePosition:f,isActive:!F&&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 Fr=()=>null;Fr.displayName="PF.Tab";var Mr=()=>null;Mr.displayName="PF.TabContent";function Zf(e){let t=e.props;return {type:t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__??e.type,props:t}}var Qf=({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=V(),d=xe(),p=s==="vertical",C=l||i!=null,M=h??(p?"left":"center"),R={left:"flex-start",center:"center",right:"flex-end"},{tabs:w,contents:A}=me.useMemo(()=>{let ee=[],oe=[];return me.Children.forEach(e,ae=>{if(!me.isValidElement(ae))return;let{type:ge,props:Ne}=Zf(ae),ze=ge===Fr||ge?.displayName===Fr.displayName,X=ge===Mr||ge?.displayName===Mr.displayName;if(ze){let re=Ne;if(re?.value===void 0)return;ee.push({value:re.value,disabled:re.disabled,node:re.children,className:re.className,css:re.css,activeCss:re.activeCss});}else if(X){let re=Ne;if(re?.value===void 0)return;oe.push({value:re.value,node:re.children,className:re.className,css:re.css});}}),{tabs:ee,contents:oe}},[e]),$=me.useMemo(()=>w.find(ee=>!ee.disabled)?.value,[w]),[K,W]=me.useState(()=>t!==void 0&&w.some(oe=>oe.value===t&&!oe.disabled)?t:$),S=n!==void 0,F=S?n:K,I=me.useRef(null),P=me.useRef([]),D=Math.max(0,w.findIndex(ee=>ee.value===F)),[B,z]=me.useState({left:0,top:0,width:0,height:0}),[E,g]=me.useState(false),[v,L]=me.useState(false),H=me.useCallback(()=>{let ee=I.current,oe=P.current[D];if(!ee||!oe)return;let ae=ee.getBoundingClientRect(),ge=oe.getBoundingClientRect();z({left:ge.left-ae.left,top:ge.top-ae.top,width:ge.width,height:ge.height});},[D]);me.useLayoutEffect(()=>{H(),E||(g(true),requestAnimationFrame(()=>L(true)));},[H,E]),me.useEffect(()=>{let ee=new ResizeObserver(()=>H());I.current&&ee.observe(I.current);let oe=P.current[D];oe&&ee.observe(oe);let ae=()=>H();return window.addEventListener("resize",ae),()=>{ee.disconnect(),window.removeEventListener("resize",ae);}},[H,D]);let O=(ee,oe)=>{if(!w.length)return ee;let ae=ee;for(let ge=0;ge<w.length;ge++)if(ae=(ae+oe+w.length)%w.length,!w[ae].disabled)return ae;return ee},_=ee=>{S||W(ee),o?.(ee);},N=ee=>{if(!w.length)return;let oe=D;if(ee.key===(p?"ArrowDown":"ArrowRight"))oe=O(D,1);else if(ee.key===(p?"ArrowUp":"ArrowLeft"))oe=O(D,-1);else if(ee.key==="Home")oe=w.findIndex(ge=>!ge.disabled);else if(ee.key==="End"){let ge=[...w].reverse().findIndex(Ne=>!Ne.disabled);oe=ge===-1?D:w.length-1-ge;}else return;ee.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],j=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,de=r==="subtle"||r==="ghost"||r==="underlined",fe=css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",width:l?"100%":i==null?"auto":typeof i=="number"?`${i}px`:i}),Pe=r==="subtle",Te=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:Pe?b.spacing.xs:0,background:j,borderRadius:r==="subtle"?u?p?b.radius.lg:b.radius.full:b.radius.lg:"none"}),Re=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"}),Ie=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}),we=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:M}: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}}),Q=css({display:"inline-flex",alignItems:"center",justifyContent:p?R[M]:"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%"}),ye=me.useId(),Y=new Map;A.forEach((ee,oe)=>Y.set(ee.value,`${ye}-panel-${oe}`));let ve=ee=>`${ye}-tab-${ee}`;return jsxs("div",{className:["plainframe-ui-tabs",a||""].join(" ").trim(),css:[fe,f],children:[jsxs("div",{className:"plainframe-ui-tabs-track",ref:I,role:"tablist","aria-orientation":p?"vertical":"horizontal",onKeyDown:N,css:[Te,T],children:[de&&jsx("div",{className:"plainframe-ui-tabs-thumb",css:[Re,Ie,k,x]}),w.map((ee,oe)=>{let ae=F===ee.value;return jsx("button",{ref:ge=>{P.current[oe]=ge;},role:"tab",id:ve(oe),"aria-selected":ae,"aria-controls":Y.get(ee.value),"aria-disabled":ee.disabled||void 0,disabled:ee.disabled,tabIndex:ee.disabled?-1:oe===D?0:-1,className:["plainframe-ui-tab",ee.className||""].join(" ").trim(),onClick:()=>{ee.disabled||_(ee.value);},css:[we,!ee.disabled&&d(),ee.css,ae?ee.activeCss??y:void 0],children:jsx("span",{className:"plainframe-ui-tab-content",css:Q,children:ee.node})},String(ee.value??oe))})]}),A.map((ee,oe)=>{if(!(ee.value===F))return null;let ge=w.findIndex(ze=>ze.value===ee.value),Ne=ge>=0?ve(ge):void 0;return jsx("div",{role:"tabpanel",id:Y.get(ee.value),"aria-labelledby":Ne,className:["plainframe-ui-tab-panel",ee.className||""].join(" ").trim(),css:[ie,ee.css],children:ee.node},oe)})]})};var Mo=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Sn=e=>e==null?[]:Array.isArray(e)?e:[e],Po=(...e)=>css(e.filter(Boolean)),sg=({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:M,helperRowCss:R,helperTextCss:w,charCountCss:A,css:$,onBlur:K,onFocus:W,onKeyDown:S,autoFocus:F,name:I,id:P,tabIndex:D,autoComplete:B,readOnly:z,required:E})=>{let g=V(),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,j]=useState(n),J=G?t:se,le=useCallback(ae=>{G||j(ae),o?.(ae);},[G,o]),de=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]),fe=g.componentHeights.border,Pe=useMemo(()=>m==="outlined"?`${fe} solid ${s?g.palette.danger?.[300]??g.surface.border:g.surface.border}`:"none",[m,fe,s,g.palette.danger,g.surface.border]),Te=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]),Re=useMemo(()=>Po({fontSize:_.labelFont,fontWeight:500,color:s?g.palette.danger?.[700]??U.primary:c?N[500]:U.primary,marginBottom:4,display:"inline-block"},...Sn(M)),[_.labelFont,s,c,N,U,g.palette.danger,M]),Ie=useMemo(()=>[{display:"flex",alignItems:"stretch",gap:g.spacing.sm,padding:`${Mo(_.paddingY)} 0 ${Mo(_.paddingY)} ${Mo(_.paddingX)}`,background:de,border:Pe,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"},...Sn(p),...Sn($)],[g,_,de,Pe,fe,h,c,p,$]),we=typeof _.minHeight=="number"?`${_.minHeight}px`:_.minHeight,Q=useMemo(()=>Po({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:we,"&::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 ${de} 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((${we} - 1.5em) / 2)`}:{paddingBlock:"clamp(4px, 0.5em, 12px)"}},...Sn(C)),[b,_,c,s,N,U,g.palette.danger,we,de,f,C]),ie=useMemo(()=>Po({display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8,paddingTop:3},...Sn(R)),[R]),ye=useMemo(()=>Po({fontSize:_.helperFont,color:s?g.palette.danger?.[700]??U.secondary:U.secondary,flex:1,minWidth:0},...Sn(w)),[_.helperFont,s,g.palette.danger,U,w]),Y=useMemo(()=>Po({fontSize:_.helperFont,color:k&&J.length>k?g.palette.danger?.[700]??U.secondary:U.secondary,flexShrink:0},...Sn(A)),[_.helperFont,k,J.length,g.palette.danger,U,A]),ve=useRef(null);useLayoutEffect(()=>{if(typeof window>"u")return;let ae=ve.current;if(!ae)return;if(b){let Ne=window.getComputedStyle(ae),ze=parseFloat(Ne.lineHeight||"20"),X=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),re=Math.max(ze*(f??1),X);ae.style.setProperty("--pf-minh",`${re}px`);return}(()=>{let Ne=window.getComputedStyle(ae),ze=parseFloat(Ne.lineHeight||"20"),X=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),re=Math.max(ze*(f??1),X);ae.style.setProperty("--pf-minh",`${re}px`);let Z=T?ze*T:1/0;ae.style.height="auto",ae.style.height=`${Math.min(ae.scrollHeight,Z)}px`;})();},[J,f,T,_.minHeight,b]);let ee=a!=null||y?`${P??L}-help`:void 0,oe=P??L;return jsxs("div",{className:["plainframe-ui-textarea",d||""].join(" ").trim(),css:Te,children:[e&&jsx("label",{htmlFor:oe,className:"plainframe-ui-textarea-label",css:Re,children:e}),jsx("div",{className:"plainframe-ui-textarea-surface",css:[v({enabled:x!=="none",disabled:c,color:s?"danger":void 0}),Ie],"aria-invalid":!!s||void 0,"aria-disabled":c||void 0,onClick:()=>!c&&ve.current?.focus(),children:jsx("textarea",{ref:ve,id:oe,className:"plainframe-ui-textarea-input",css:Q,rows:f,value:J,onChange:ae=>{let ge=ae.target.value;k&&ge.length>k||le(ge);},placeholder:r||"",disabled:c,onBlur:K,onFocus:W,onKeyDown:S,autoFocus:F,name:I,tabIndex:D,autoComplete:B,readOnly:z,required:E,"aria-invalid":!!s||void 0,"aria-describedby":ee})}),(a!=null||y&&k!=null)&&jsxs("div",{className:"plainframe-ui-textarea-helper-row",css:ie,children:[jsx("span",{id:ee,className:"plainframe-ui-textarea-helper-text",css:ye,children:a}),y&&k!=null&&jsxs("span",{className:"plainframe-ui-textarea-char-count",css:Y,children:[J.length,"/",k]})]})]})};var mg=Vo,fg={type:"spring",stiffness:920,damping:100},Ql="__toast_root__",gg=(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=gg(e,n);if(o!=null&&o!=="")return o}},aa=(e,t)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:String(e);function bg(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 hg=bg(mg),_t=null,Xn=null,he={max:5,position:"bottom-right",gutter:5,zIndex:1e3,duration:5e3,showDismiss:"hover",styles:{},renderer:void 0,bareRenderer:false};function nc(){typeof document>"u"||(_t||(_t=document.getElementById("toast-host"),_t||(_t=document.createElement("div"),_t.id="toast-host",document.body.appendChild(_t))),Xn||(Xn=_t[Ql]??null,Xn||(Xn=createRoot(_t),_t[Ql]=Xn,Xn.render(jsx(Na,{children:jsx(kg,{})})))));}var te={displayed:[],queue:[],entering:{},exiting:{},enterFrom:{},timers:new Map,expiry:new Map,remaining:new Map,paused:new Set,listeners:new Set,snapshot:{displayed:[],entering:{},exiting:{},enterFrom:{}},subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)},notify(){this.listeners.forEach(e=>e());},sync(){this.snapshot={displayed:[...this.displayed],entering:{...this.entering},exiting:{...this.exiting},enterFrom:{...this.enterFrom}};}},In=()=>{te.sync(),te.notify();},yg=()=>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(()=>Be.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 xg(){let e=false;for(;te.displayed.length<he.max&&te.queue.length;){let t=te.queue.shift();te.displayed=[t,...te.displayed],te.enterFrom[t.id]="head",te.entering[t.id]=true,e=true,requestAnimationFrame(()=>{delete te.entering[t.id],In();}),Nr(t);}e&&In();}function vg(){if(te.displayed.length<he.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),In();}var Cg=e=>e==="danger"?"error":["default","success","error","warning","info"].includes(e)?e:"default";function Rg(e,t){let n=Cg(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 Be=Object.assign((e,t)=>{nc();let n=i=>i!=null&&typeof i[Symbol.iterator]=="function",o=i=>!!i&&(typeof i=="object"||typeof i=="function")&&typeof i.then=="function",r;typeof e=="object"&&e!=null&&!me.isValidElement(e)&&!n(e)&&!o(e)?r=e:r={content:(me.isValidElement(e),e),...t||{}},r.content==null&&(r.title!=null||r.description!=null)&&(r.content=jsxs("div",{children:[r.title&&jsx("strong",{style:{display:"block",marginBottom:2},children:r.title}),r.description]}));let s=r.id??yg(),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),In(),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?he.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>=he.max&&vg(),te.displayed=[...te.displayed,c],te.enterFrom[c.id]="tail",te.entering[c.id]=true,requestAnimationFrame(()=>{delete te.entering[c.id],In();}),In(),Nr(c),s},{success:(e,t={})=>Be(e,{...t,status:"success"}),error:(e,t={})=>Be(e,{...t,status:"error"}),warning:(e,t={})=>Be(e,{...t,status:"warning"}),info:(e,t={})=>Be(e,{...t,status:"info"}),custom:(e,t={})=>Be(e,{...t}),update:(e,t)=>Be({id:e,...t}),dismiss:e=>{if(!e){let n=te.displayed.find(o=>!te.exiting[o.id])?.id;n&&Be.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],In(),window.setTimeout(()=>t?.onClose?.(),120),xg();},clear:()=>{[...te.displayed.map(t=>t.id)].forEach(t=>Be.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&&Be.pause(e.id);},resumeLatest:()=>{let e=te.displayed.at(-1);e&&Be.resume(e.id);},promise:(e,t,n={})=>{let o=Be(t.loading,{...n,status:"info",duration:null});return e.then(r=>{Be.update(o,{status:"success",content:t.success(r),duration:n.duration??2500});}).catch(r=>{Be.update(o,{status:"error",content:t.error(r),duration:n.duration??3e3});}),e},config:e=>{e.max!=null&&(he.max=e.max),e.position&&(he.position=e.position),e.gutter!=null&&(he.gutter=e.gutter),e.zIndex!=null&&(he.zIndex=e.zIndex),e.duration!==void 0&&(he.duration=e.duration),e.showDismiss&&(he.showDismiss=e.showDismiss),e.styles&&(he.styles={...he.styles,...e.styles}),e.renderer!==void 0&&(he.renderer=e.renderer),e.bareRenderer!==void 0&&(he.bareRenderer=e.bareRenderer);}});function Tg(e){return typeof e=="string"?e:e===true?"always":e===false?"never":he.showDismiss}function wg(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 Eg=css({display:"flex",alignItems:"flex-start",gap:10}),ec=css({flex:"0 0 auto",paddingTop:1,lineHeight:0,marginLeft:-3,"& svg, & img, & canvas, & video":{display:"block"}}),Sg=css({fontSize:14,lineHeight:1.4,fontWeight:500,flex:1,minWidth:0}),Ig=css({display:"flex",alignItems:"center",gap:6,marginRight:-2}),kg=me.memo(function(){let t=useSyncExternalStore(te.subscribe.bind(te),()=>te.snapshot,()=>te.snapshot),n=V(),o=he.position.startsWith("bottom"),r=me.useMemo(()=>o?t.displayed:[...t.displayed].reverse(),[t.displayed,o]),s=me.useMemo(()=>({position:"fixed",zIndex:he.zIndex,pointerEvents:"none",width:"100%",display:"flex",flexDirection:"column",...wg(he.position),...he.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?he.gutter:0,m={toast:a,close:Be.dismiss,pause:Be.pause,resume:Be.resume},{bg:h,fg:f,border:T}=Rg(n,a.status),k={position:"relative",overflow:"hidden",borderRadius:n.radius.md,boxShadow:hg.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 he.styles.surface=="function"?he.styles.surface(a):he.styles.surface??{},x=Tg(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}),M=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",...he.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:A=>a.onClick?.(a.id,A),children:w});}else if(he.bareRenderer&&he.renderer){let w=typeof he.renderer=="function"?he.renderer(m):he.renderer;R=jsx("div",{style:{pointerEvents:"auto"},onClick:A=>a.onClick?.(a.id,A),children:w});}else {let w;he.renderer?w=typeof he.renderer=="function"?he.renderer(m):he.renderer:a.render&&!a.bare?w=typeof a.render=="function"?a.render(m):a.render:w=jsxs(Fragment,{children:[jsxs("div",{css:Eg,children:[a.startIcon&&jsx("div",{css:ec,children:a.startIcon}),jsx("div",{css:Sg,children:a.content}),a.endIcon&&jsx("div",{css:ec,children:a.endIcon})]}),a.action&&jsx("div",{css:Ig,children:a.action})]}),R=jsxs("div",{css:C,onClick:A=>a.onClick?.(a.id,A),children:[w,jsx("button",{className:"plainframe-ui-toast-close","aria-label":"Close",css:M,onClick:A=>{A.stopPropagation(),Be.dismiss(a.id);},children:jsx(X,{strokeWidth:2.5,size:14})})]});}return jsx(Ag,{id:a.id,isBottom:o,mt:u,enterY:l,width:a.width,pauseOnHover:a.pauseOnHover!==false,children:R},a.id)})})})}),Ag=me.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:fg});},[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",...he.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(()=>Be.dismiss(n));},onMouseEnter:c?()=>Be.pause(n):void 0,onMouseLeave:c?()=>Be.resume(n):void 0,children:i})}),tc=false;(function(){tc||(tc=true,nc());})();var Zg=(...e)=>t=>{for(let n of e)if(n)if(typeof n=="function")n(t);else try{n.current=t;}catch{}},sc=createContext(null),ac=()=>{let e=useContext(sc);if(!e)throw new Error("TooltipTrigger/TooltipContent must be inside <Tooltip>.");return e},Qg=({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(),M=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(sc.Provider,{value:M,children:e})},eb=({asChild:e=true,children:t,className:n,css:o})=>{let{refs:r,getReferenceProps:s,id:a}=ac(),c=me.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:Zg(u,r.setReference),className:[l.props?.className||"",n||""].join(" ").trim()||void 0}),h=[l.props?.css||void 0,o].filter(Boolean);return me.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})},tb=({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}=ac(),T=V(),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"}),M=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:M?.x!=null?`${M.x}px`:void 0,top:M?.y!=null?`${M.y}px`:void 0,[R]:"-3px"}})]})})})};function sb(){let e=V();return jsx(Global,{styles:css`
|
|
21
21
|
*,*::before,*::after{box-sizing:border-box}
|
|
22
22
|
|
|
23
23
|
body{
|
|
@@ -45,4 +45,4 @@ ${j}{${V}}`);let Y=b.get();if(w(Y),(s?C.current:document.documentElement)?.setAt
|
|
|
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{
|
|
48
|
+
`})}export{Wa as Accordion,ns as AccordionDetails,Va as AccordionGroup,ts as AccordionSummary,Ua as ActionBar,Qa as Alert,is as AlertDescription,as as AlertTitle,Ni as Autocomplete,Hi as Avatar,Yd as AvatarGroup,Ss as Backdrop,op as Badge,br as BreadCrumbItem,cp as BreadCrumbs,Vi as Button,Xi as ButtonGroup,Zi as Card,Fp as CardContent,Np as CardDescription,Pp as CardEnd,tl as CardGroup,Mp as CardStart,Dp as CardTitle,rr as Checkbox,rl as Chip,Xp as CodeField,Wn as Container,Jp as ContextZone,sb as CssBaseline,tm as Divider,yl as Drawer,Ln as DropdownMenu,yn as DropdownMenuContent,Ii as DropdownMenuSub,Ai as DropdownMenuSubContent,ki as DropdownMenuSubTrigger,Bn as DropdownMenuTrigger,Ks as Fade,Tl as Flex,_s as Grow,Sl as Image,Om as ImageStack,jm as Kbd,ai as Menu,bs as MenuCheckboxGroup,lo as MenuCheckboxItem,Ht as MenuItem,fn as MenuLabel,Ci as MenuRadioGroup,od as MenuRadioItem,rd as MenuSeparator,xi as MenuSwitchItem,Qo as MenuVariantCtx,tf as Modal,$l as ModalContent,Bl as ModalTrigger,uf as Pagination,Wu as Popover,ui as PopoverAnchor,di as PopoverContent,ci as PopoverTrigger,to as Progress,bf as Quote,Rf as RadioGroup,Tf as RadioItem,kf as Rotate,Vl as Select,Qs as SelectItem,Nf as Skeleton,Gs as Slide,Xl as Slider,ra as Step,Yf as Stepper,fs as Switch,Fr as Tab,Mr as TabContent,Qf as Tabs,sg as TextArea,Zo as TextField,Na as ThemeProvider,Qg as Tooltip,tb as TooltipContent,eb as TooltipTrigger,Vn as Typography,Ea as defaultDarkTheme,Vo as defaultLightTheme,Qn as surfaceFromNeutral,_o as textDark,Ko as textLight,Be as toast,Rc as useColorMode,wd as useDropdownMenuActiveIndex,V as usePlainframeUITheme,_u as usePopoverContext,Tc as usePrimary,db as usePrimitives};
|