@aindy/ui-kit 1.0.6 → 2.1.0
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/api/_core.d.ts +3 -0
- package/dist/api/_core.test.d.ts +1 -0
- package/dist/api/_routes.d.ts +4 -0
- package/dist/api/auth.d.ts +32 -0
- package/dist/api/index.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1765 -1696
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),$=require("react"),Ne=require("react-router-dom"),zr=require("react-dom");function hn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const f=hn($),bn=hn(zr);function jr(e){return Array.isArray(e)?e:e==null?[]:[]}function vt(e,t){return Array.isArray(e)?e.map(t):(console.warn("safeMap prevented crash. Value:",e),[])}const Et="".replace(/\/$/,""),Pt="token",_t="aindy_token",yn=globalThis.__AINDY_APP_VERSION_OVERRIDE__||"1.0.6",Ur=new Set(["agents","allowed_auto_grant_tools","allowed_capabilities","analyses","drop_points","end","error_rate_series","events","feedback","fields","findings","flows","generations","granted_tools","history","items","jobs","logs","memories","nodes","plans","pings","recent","recent_authors","recent_changes","recent_errors","recent_ripples","results","runs","steps","strategies","suggestions","tags","timeline","tools"]);class J extends Error{constructor(t,n,r){super(n),this.name="ApiError",this.status=t,this.body=r}}function Fr(e,t){return function(...n){return t(...n).catch(r=>{throw r instanceof J&&(r.domain=e),r})}}function it(e){if(e&&typeof e=="object"&&"data"in e){if("error"in e&&e.error)throw new J(200,e.error,e);return e.data!==void 0?e.data:e}return e}function Ue(e){if(Array.isArray(e))return vt(e,n=>Ue(n));if(!e||typeof e!="object")return e;const t={};for(const[n,r]of Object.entries(e)){if(Ur.has(n)){t[n]=Array.isArray(r)?vt(r,o=>Ue(o)):[];continue}t[n]=Ue(r)}return t}function pe(){return localStorage.getItem(Pt)||localStorage.getItem(_t)||""}function At(e){localStorage.setItem(Pt,e),localStorage.setItem(_t,e)}function ke(){localStorage.removeItem(Pt),localStorage.removeItem(_t)}function xn(e){return/^https?:\/\//i.test(e)?e:Et?`${Et}${e}`:e}function wn(){typeof window>"u"||typeof window.dispatchEvent!="function"||window.dispatchEvent(new CustomEvent("aindy:session-expired"))}function vn(e){typeof window>"u"||typeof window.dispatchEvent!="function"||window.dispatchEvent(new CustomEvent("aindy:version-warning",{detail:{message:e}}))}async function Ee(e,t={}){const n=xn(e),r=pe(),o=new AbortController,{_isRetry:s=!1,...i}=t,l=typeof window<"u"?setTimeout(()=>o.abort(),3e4):null;i.signal&&(i.signal.aborted?o.abort():i.signal.addEventListener("abort",()=>o.abort(),{once:!0}));try{const c=await fetch(n,{...i,signal:o.signal,headers:{"Content-Type":"application/json","X-Client-Version":yn,...r?{Authorization:`Bearer ${r}`}:{},...i.headers||{}}}),a=c.headers?.get?.("X-Version-Warning");if(a&&typeof window<"u"&&(console.warn("[API Version Warning]",a),vn(a)),c.status===503){const d=parseInt(c.headers.get("Retry-After")||"0",10);if(d>0&&d<=60&&!s)return await new Promise(m=>setTimeout(m,d*1e3)),Ee(e,{...i,_isRetry:!0})}if(!c.ok){const d=await c.text(),m=new J(c.status,`API Error (${c.status}): ${d}`,d);throw c.status===401&&wn(),m}const u=await c.text();try{return Ue(JSON.parse(u))}catch{return u}}catch(c){throw c?.name==="AbortError"?new J(408,"Request timed out after 30 seconds.",null):c instanceof TypeError&&!c.status?new J(0,"Network error. Check your connection.",null):c}finally{l&&clearTimeout(l)}}function En(e,t={}){return Ee(e,{...t})}function Gr(e,t={}){const n=pe();let r=!1;if(n)try{const[,o=""]=n.split("."),s=o.replace(/-/g,"+").replace(/_/g,"/"),i=s.padEnd(Math.ceil(s.length/4)*4,"=");r=JSON.parse(atob(i))?.is_admin===!0}catch{r=!1}return r?En(e,t):Promise.reject(new J(403,"Admin privileges required for this operation.",null))}async function $t(e,t={}){const n=pe(),r=new AbortController,{_isRetry:o=!1,...s}=t,i=typeof window<"u"?setTimeout(()=>r.abort(),3e4):null;s.signal&&(s.signal.aborted?r.abort():s.signal.addEventListener("abort",()=>r.abort(),{once:!0}));try{const l=await fetch(e,{...s,signal:r.signal,headers:{"Content-Type":"application/json","X-Client-Version":yn,...n?{Authorization:`Bearer ${n}`}:{},...s.headers||{}}}),c=l.headers?.get?.("X-Version-Warning");if(c&&typeof window<"u"&&(console.warn("[API Version Warning]",c),vn(c)),l.status===503){const u=parseInt(l.headers.get("Retry-After")||"0",10);if(u>0&&u<=60&&!o)return await new Promise(d=>setTimeout(d,u*1e3)),$t(e,{...s,_isRetry:!0})}if(!l.ok){const u=await l.text(),d=new J(l.status,`API Error (${l.status}): ${u}`,u);throw l.status===401&&wn(),d}const a=await l.text();try{return Ue(JSON.parse(a))}catch{return a}}catch(l){throw l?.name==="AbortError"?new J(408,"Request timed out after 30 seconds.",null):l instanceof TypeError&&!l.status?new J(0,"Network error. Check your connection.",null):l}finally{i&&clearTimeout(i)}}function Vr(e,t={}){return $t(e,{...t})}const g="",j=`${g}/apps`,te=`${g}/platform`,Wr=Object.freeze({OPERATOR_FLOW_STRATEGIES:!0,OPERATOR_AUTOMATION_LOGS:!1,OPERATOR_SCHEDULER_STATUS:!1,RIPPLETRACE_VIEWER:!1}),Hr=Object.freeze({LOGIN:`${g}/auth/login`,REGISTER:`${g}/auth/register`,LOGOUT:`${g}/auth/logout`}),Br=Object.freeze({LIST:`${g}/tasks/list`,CREATE:`${g}/tasks/create`,COMPLETE:`${g}/tasks/complete`,START:`${g}/tasks/start`}),Yr=Object.freeze({ANALYZE:`${g}/arm/analyze`,GENERATE:`${g}/arm/generate`,LOGS:`${g}/arm/logs`,CONFIG:`${g}/arm/config`,METRICS:`${g}/arm/metrics`,CONFIG_SUGGESTIONS:`${g}/arm/config/suggest`}),qr=Object.freeze({CREATE_RUN:`${j}/agent/run`,RUNS:`${j}/agent/runs`,RUN:e=>`${j}/agent/runs/${e}`,APPROVE:e=>`${j}/agent/runs/${e}/approve`,REJECT:e=>`${j}/agent/runs/${e}/reject`,RECOVER:e=>`${j}/agent/runs/${e}/recover`,REPLAY:e=>`${j}/agent/runs/${e}/replay`,STEPS:e=>`${j}/agent/runs/${e}/steps`,EVENTS:e=>`${j}/agent/runs/${e}/events`,TOOLS:`${j}/agent/tools`,TRUST:`${j}/agent/trust`,SUGGESTIONS:`${j}/agent/suggestions`}),Kr=Object.freeze({LINKEDIN_MANUAL:`${g}/analytics/linkedin/manual`,MASTERPLAN_SUMMARY:e=>`${g}/analytics/masterplan/${e}/summary`,CALCULATE_TWR:`${g}/calculate_twr`,CALCULATE_ENGAGEMENT:`${g}/calculate_engagement`,CALCULATE_AI_EFFICIENCY:`${g}/calculate_ai_efficiency`,CALCULATE_IMPACT_SCORE:`${g}/calculate_impact_score`,CALCULATE_INCOME_EFFICIENCY:`${g}/income_efficiency`,CALCULATE_REVENUE_SCALING:`${g}/revenue_scaling`,CALCULATE_EXECUTION_SPEED:`${g}/execution_speed`,CALCULATE_ATTENTION_VALUE:`${g}/attention_value`,CALCULATE_ENGAGEMENT_RATE:`${g}/engagement_rate`,CALCULATE_BUSINESS_GROWTH:`${g}/business_growth`,CALCULATE_MONETIZATION_EFFICIENCY:`${g}/monetization_efficiency`,CALCULATE_AI_PRODUCTIVITY_BOOST:`${g}/ai_productivity_boost`,CALCULATE_DECISION_EFFICIENCY:`${g}/decision_efficiency`,CALCULATE_LOST_POTENTIAL:`${g}/lost_potential`,SCORES_ME:`${g}/scores/me`,SCORES_RECALCULATE:`${g}/scores/me/recalculate`,SCORES_HISTORY:`${g}/scores/me/history`,SCORES_FEEDBACK:`${g}/scores/feedback`}),Xr=Object.freeze({ORDERS:`${g}/freelance/orders`,FEEDBACK:`${g}/freelance/feedback`,METRICS_LATEST:`${g}/freelance/metrics/latest`}),Jr=Object.freeze({BOOT:`${g}/identity/boot`,PROFILE:`${g}/identity/`,EVOLUTION:`${g}/identity/evolution`,CONTEXT:`${g}/identity/context`}),Zr=Object.freeze({GENESIS_SESSION:`${g}/genesis/session`,GENESIS_MESSAGE:`${g}/genesis/message`,GENESIS_SESSION_BY_ID:e=>`${g}/genesis/session/${e}`,GENESIS_SYNTHESIZE:`${g}/genesis/synthesize`,GENESIS_DRAFT:e=>`${g}/genesis/draft/${e}`,GENESIS_LOCK:`${g}/genesis/lock`,GENESIS_AUDIT:`${g}/genesis/audit`,PLANS:`${g}/masterplans/`,PLAN:e=>`${g}/masterplans/${e}`,PLAN_ACTIVATE:e=>`${g}/masterplans/${e}/activate`,PLAN_ANCHOR:e=>`${g}/masterplans/${e}/anchor`,PLAN_PROJECTION:e=>`${g}/masterplans/${e}/projection`}),Qr=Object.freeze({AGENTS:`${j}/memory/agents`,AGENT_RECALL:e=>`${j}/memory/agents/${e}/recall`,FEDERATED_RECALL:`${j}/memory/federated/recall`,NODES:`${j}/memory/nodes`,RECALL_V3:`${j}/memory/recall/v3`,SUGGEST:`${j}/memory/suggest`,NODE_FEEDBACK:e=>`${j}/memory/nodes/${e}/feedback`,NODE_PERFORMANCE:e=>`${j}/memory/nodes/${e}/performance`,NODE_TRAVERSE:e=>`${j}/memory/nodes/${e}/traverse`,NODE_HISTORY:e=>`${j}/memory/nodes/${e}/history`,NODE_SHARE:e=>`${j}/memory/nodes/${e}/share`,METRICS_DASHBOARD:`${j}/memory/metrics/dashboard`}),eo=Object.freeze({RESEARCH_QUERY:`${g}/research/query`,HISTORY:`${g}/search/history`,HISTORY_ITEM:e=>`${g}/search/history/${e}`,LEAD_GEN:`${g}/leadgen/`,ANALYZE_SEO:`${g}/analyze_seo/`,GENERATE_META:`${g}/generate_meta/`,SUGGEST_IMPROVEMENTS:`${g}/suggest_improvements/`}),to=Object.freeze({PROFILE_BY_USERNAME:e=>`${g}/social/profile/${e}`,PROFILE:`${g}/social/profile`,FEED:`${g}/social/feed`,POST:`${g}/social/post`,ANALYTICS:`${g}/social/analytics`,INTERACT:e=>`${g}/social/posts/${e}/interact`}),no=Object.freeze({DROP_POINTS:`${g}/rippletrace/drop_points`,PINGS:`${g}/rippletrace/pings`,RECENT:`${g}/rippletrace/recent`,TRACE:e=>`${g}/rippletrace/ripples/${e}`,TRACE_GRAPH:e=>`${g}/rippletrace/${encodeURIComponent(e)}`,CAUSAL_GRAPH:`${g}/rippletrace/causal/graph`,CAUSAL_CHAIN:e=>`${g}/rippletrace/causal/chain/${encodeURIComponent(e)}`,NARRATIVE_SUMMARY:`${g}/rippletrace/narrative/summary`,DROP_POINT_NARRATIVE:e=>`${g}/rippletrace/narrative/${encodeURIComponent(e)}`,PREDICTIONS_SUMMARY:`${g}/rippletrace/predictions/summary`,DROP_POINT_PREDICTION:e=>`${g}/rippletrace/predictions/${encodeURIComponent(e)}`,SYSTEM_RECOMMENDATIONS:`${g}/rippletrace/recommendations/system`,RECOMMENDATIONS_SUMMARY:`${g}/rippletrace/recommendations/summary`,DROP_POINT_RECOMMENDATION:e=>`${g}/rippletrace/recommendations/${encodeURIComponent(e)}`,LEARNING_STATS:`${g}/rippletrace/learning/stats`,EVALUATE_LEARNING_OUTCOME:e=>`${g}/rippletrace/learning/evaluate/${encodeURIComponent(e)}`,ADJUST_LEARNING_THRESHOLDS:`${g}/rippletrace/learning/adjust`,PLAYBOOKS:`${g}/rippletrace/playbooks`,PLAYBOOK:e=>`${g}/rippletrace/playbooks/${encodeURIComponent(e)}`,MATCH_PLAYBOOKS:e=>`${g}/rippletrace/playbooks/match/${encodeURIComponent(e)}`,STRATEGIES:`${g}/rippletrace/strategies`,BUILD_STRATEGIES:`${g}/rippletrace/strategies/build`,STRATEGY:e=>`${g}/rippletrace/strategies/${encodeURIComponent(e)}`,MATCH_STRATEGIES:e=>`${g}/rippletrace/strategies/match/${encodeURIComponent(e)}`,EVENT_DOWNSTREAM:e=>`${g}/rippletrace/event/${encodeURIComponent(e)}/downstream`,EVENT_UPSTREAM:e=>`${g}/rippletrace/event/${encodeURIComponent(e)}/upstream`}),ro=Object.freeze({FLOW_RUNS:`${te}/flows/runs`,FLOW_RUN:e=>`${te}/flows/runs/${e}`,FLOW_RUN_HISTORY:e=>`${te}/flows/runs/${e}/history`,FLOW_RUN_RESUME:e=>`${te}/flows/runs/${e}/resume`,FLOW_REGISTRY:`${te}/flows/registry`,FLOW_STRATEGIES:`${te}/flows/strategies`,RIPPLETRACE_STATUS:`${te}/observability/rippletrace/status`,OBSERVABILITY_REQUESTS:`${te}/observability/requests`,OBSERVABILITY_DASHBOARD:`${te}/observability/dashboard`,CLIENT_ERROR:`${g}/client/error`,CLIENT_VITALS:`${g}/client/vitals`,AUTOMATION_LOGS:`${g}/automation/logs`,AUTOMATION_LOG:e=>`${g}/automation/logs/${e}`,AUTOMATION_REPLAY:e=>`${g}/automation/logs/${e}/replay`,SCHEDULER_STATUS:`${te}/observability/scheduler/status`}),oo=Object.freeze({DASHBOARD_OVERVIEW:`${g}/dashboard/overview`,HEALTH_DETAILS:`${g}/health/details`,INFLUENCE_GRAPH:`${g}/influence_graph`,CAUSAL_GRAPH:`${g}/causal_graph`,NARRATIVE:e=>`${g}/narrative/${e}`,HEALTH:`${g}/health`,HEALTH_DEEP:`${g}/health/deep`,HEALTH_DOMAINS:`${g}/health/domains`,VERSION:`${g}/api/version`}),Ve=Object.freeze({AUTH:Hr,TASKS:Br,ARM:Yr,AGENT:qr,ANALYTICS:Kr,FREELANCE:Xr,IDENTITY:Jr,MASTERPLAN:Zr,MEMORY:Qr,SEARCH:eo,SOCIAL:to,RIPPLETRACE:no,OPERATOR:ro,PLATFORM:oo});function An(e){return Ee(Ve.AUTH.LOGIN,{method:"POST",body:JSON.stringify(e)}).then(it)}function Cn(e){return Ee(Ve.AUTH.REGISTER,{method:"POST",body:JSON.stringify(e)}).then(it)}function so(e=pe()){return Ee(Ve.AUTH.LOGOUT,{method:"POST",headers:e?{Authorization:`Bearer ${e}`}:{}}).catch(()=>null)}function Rn(e=pe()){return Ee(Ve.IDENTITY.BOOT,{method:"GET",headers:e?{Authorization:`Bearer ${e}`}:{}}).then(it)}const Sn=$.createContext(null);function Tn(e){if(!e)return null;try{const[,t=""]=e.split("."),n=t.replace(/-/g,"+").replace(/_/g,"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return JSON.parse(window.atob(r))}catch{return null}}function ht(e){const t=Tn(e);return!t||typeof t.exp!="number"?!1:Date.now()/1e3>t.exp-30}function io({children:e}){const[t,n]=$.useState(()=>{const a=pe();return a&&ht(a)?(ke(),null):a||null}),r=$.useMemo(()=>{const a=Tn(t);return a?{...a,is_admin:a?.is_admin===!0}:null},[t]),o=r?.is_admin===!0;$.useEffect(()=>{const a=pe();if(a&&ht(a)){ke(),n(null);return}n(a||null)},[]),$.useEffect(()=>{if(!t)return;const a=setInterval(()=>{ht(t)&&(ke(),n(null))},6e4);return()=>clearInterval(a)},[t]),$.useEffect(()=>{const a=()=>{ke(),n(null)};return window.addEventListener("aindy:session-expired",a),()=>window.removeEventListener("aindy:session-expired",a)},[]);const s=async(a,u)=>{const m=(await An({email:a,password:u}))?.access_token;if(!m)throw new Error("Authentication did not return an access token.");return At(m),n(m),m},i=async(a,u,d=null)=>{const p=(await Cn({email:a,password:u,username:d}))?.access_token;if(!p)throw new Error("Authentication did not return an access token.");return At(p),n(p),p},l=()=>{so(),ke(),n(null)},c=$.useMemo(()=>({token:t,user:r,isAdmin:o,isAuthenticated:!!t,login:s,register:i,logout:l,setToken:n}),[t,r,o]);return h.jsx(Sn.Provider,{value:c,children:e})}function at(){const e=$.useContext(Sn);if(!e)throw new Error("useAuth must be used within AuthProvider.");return e}const On=$.createContext(null),Oe={user_id:null,memory:[],runs:[],metrics:null,flows:[],runtime:{boot_mode:"unknown",boot_profile:"unknown",boot_profile_source:"unknown",app_plugins_loaded:!1,app_plugin_count:0,ui_mode:"app-profile",default_route:"/dashboard",platform_home:"/platform/agent"},system_state:{memory_count:0,active_runs:0,score:null,active_flows:0}};function ao({children:e,skipBoot:t=!1}){const{token:n,logout:r}=at(),[o,s]=$.useState(Oe),[i,l]=$.useState(!1),[c,a]=$.useState(!1),[u,d]=$.useState(""),m=$.useRef(null),p=()=>{s(Oe),a(!1),d(""),m.current=null},b=async(w=n)=>{if(!w)return p(),Oe;l(!0),d("");try{const x=await Rn(w);return s({...Oe,...x,memory:x?.memory||[],runs:x?.runs||[],flows:x?.flows||[],metrics:x?.metrics||null,runtime:{...Oe.runtime,...x?.runtime||{}},system_state:{...Oe.system_state,...x?.system_state||{}}}),a(!0),m.current=w,x}catch(x){const E=x instanceof Error?x.message:"Failed to boot identity context.";throw d(E),a(!1),x instanceof J&&x.status===401&&r(),x}finally{l(!1)}};$.useEffect(()=>{if(t){if(!n){p();return}a(!0),d(""),m.current=n;return}if(!n){p();return}m.current===n&&c||b(n).catch(()=>{})},[n,c,t]);const y=$.useMemo(()=>({system:o,setSystem:s,clearSystem:p,bootSystem:b,booting:i,booted:c,bootError:u}),[o,i,c,u]);return h.jsx(On.Provider,{value:y,children:e})}function kn(){const e=$.useContext(On);if(!e)throw new Error("useSystem must be used within SystemProvider.");return e}const lo="/platform",co=e=>`${lo}${e}`,uo=[{title:"PLATFORM",adminOnly:!0,runtimeOnlySafe:!0,links:[{to:"/agent",label:"Agent Console",external:!0},{to:"/flows",label:"Flow Engine",external:!0},{to:"/observability",label:"Observability",external:!0},{to:"/health",label:"Health",external:!0},{to:"/approvals",label:"Approvals",external:!0},{to:"/registry",label:"Registry",external:!0},{to:"/executions",label:"Executions",external:!0,runtimeOnlySafe:!1},{to:"/trace",label:"Ripple Trace",external:!0,runtimeOnlySafe:!1}]},{title:"WORKSPACE",runtimeOnlySafe:!1,links:[{to:"/dashboard",label:"Dashboard"},{to:"/tasks",label:"Tasks"},{to:"/masterplan",label:"MasterPlan"}]},{title:"ANALYTICS",runtimeOnlySafe:!1,links:[{to:"/analytics",label:"Analytics"},{to:"/kpi",label:"KPI Snapshot"}]},{title:"GROWTH",runtimeOnlySafe:!1,links:[{to:"/search/research",label:"Research"},{to:"/search/leadgen",label:"Lead Gen"},{to:"/social",label:"Social Feed"},{to:"/freelance",label:"Freelance"}]},{title:"AI TOOLS",runtimeOnlySafe:!1,links:[{to:"/arm/analyze",label:"ARM Analyze"},{to:"/arm/config",label:"ARM Config"},{to:"/arm/config/suggest",label:"ARM Suggest"},{to:"/arm/config/generate",label:"ARM Generate"},{to:"/arm/config/logs",label:"ARM Logs"},{to:"/arm/config/metrics",label:"ARM Metrics"}]},{title:"RUNTIME",runtimeOnlySafe:!0,links:[{to:"/identity",label:"Identity"},{to:"/memory",label:"Memory"}]}];function fo({to:e,label:t,onNavigate:n,external:r=!1}){const o=["block rounded-2xl border px-3 py-2 text-sm transition-colors","border-zinc-800/60 bg-zinc-950/40 text-zinc-400 hover:border-zinc-700 hover:bg-zinc-900/70 hover:text-zinc-100"];if(r){const s=typeof window<"u"&&window.location.pathname.startsWith("/platform");return h.jsx("a",{href:co(e),onClick:n,target:"_self",className:["block rounded-2xl border px-3 py-2 text-sm transition-colors",s?"border-[#00ffaa]/30 bg-[#00ffaa]/10 text-[#00ffaa]":"border-zinc-800/60 bg-zinc-950/40 text-zinc-400 hover:border-zinc-700 hover:bg-zinc-900/70 hover:text-zinc-100"].join(" "),children:t})}return h.jsx(Ne.NavLink,{to:e,onClick:n,className:({isActive:s})=>[...o,s?"border-[#00ffaa]/30 bg-[#00ffaa]/10 text-[#00ffaa]":""].join(" "),children:t})}function mo(){const{isAdmin:e,logout:t,user:n}=at(),{system:r}=kn(),[o,s]=$.useState(!1),i=r?.runtime?.boot_mode==="runtime-only",l=$.useMemo(()=>uo.filter(c=>!c.adminOnly||e).filter(c=>!i||c.runtimeOnlySafe!==!1).map(c=>({...c,title:c.title==="RUNTIME"&&!i?"IDENTITY":c.title,links:c.links.filter(a=>!i||a.runtimeOnlySafe!==!1)})),[e,i]);return h.jsxs("div",{className:"min-h-screen bg-[#09090b] text-[#fafafa] selection:bg-[#00ffaa]/30 lg:flex",children:[h.jsx("aside",{className:["fixed inset-y-0 left-0 z-40 w-80 border-r border-zinc-800/60 bg-zinc-950/95 backdrop-blur transition-transform lg:static lg:translate-x-0",o?"translate-x-0":"-translate-x-full"].join(" "),children:h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsx("div",{className:"border-b border-zinc-800/60 px-5 py-5",children:h.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.3em] text-[#00ffaa]",children:"Control Surface"}),h.jsx("h1",{className:"mt-3 text-2xl font-black tracking-tight text-white",children:"A.I.N.D.Y."}),h.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:i?"Runtime-only mode. Platform, memory, and identity surfaces are active.":"Route the workspace, analytics, growth, and platform surfaces."}),i?h.jsx("p",{className:"mt-3 inline-flex rounded-full border border-[#00ffaa]/30 bg-[#00ffaa]/10 px-3 py-1 text-[10px] font-bold uppercase tracking-[0.2em] text-[#00ffaa]",children:"Runtime-Only"}):null]}),h.jsx("button",{type:"button",className:"rounded-xl border border-zinc-800 px-3 py-2 text-xs uppercase tracking-[0.18em] text-zinc-400 lg:hidden",onClick:()=>s(!1),children:"Close"})]})}),h.jsx("nav",{className:"flex-1 space-y-6 overflow-y-auto px-4 py-5 custom-scrollbar",children:l.map(c=>h.jsxs("div",{children:[h.jsx("p",{className:"mb-3 px-2 text-[10px] font-bold uppercase tracking-[0.3em] text-zinc-600",children:c.title}),h.jsx("div",{className:"space-y-2",children:c.links.map(a=>h.jsx(fo,{to:a.to,label:a.label,external:a.external,onNavigate:()=>s(!1)},a.to))})]},c.title))})]})}),o?h.jsx("button",{type:"button",className:"fixed inset-0 z-30 bg-black/60 lg:hidden",onClick:()=>s(!1)}):null,h.jsxs("div",{className:"flex min-h-screen flex-1 flex-col lg:ml-0",children:[h.jsx("header",{className:"sticky top-0 z-20 border-b border-zinc-800/60 bg-[#09090b]/95 backdrop-blur",children:h.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-4 sm:px-6 lg:px-8",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("button",{type:"button",className:"rounded-2xl border border-zinc-800 bg-zinc-950/70 px-3 py-2 text-[10px] font-bold uppercase tracking-[0.18em] text-zinc-300 lg:hidden",onClick:()=>s(!0),children:"Menu"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.3em] text-zinc-600",children:"Navigation Shell"}),h.jsx("p",{className:"text-sm text-zinc-300",children:i?"Intentional platform surface":"Unified workspace routing"})]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"hidden rounded-2xl border border-zinc-800 bg-zinc-950/70 px-4 py-2 text-right sm:block",children:[h.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-zinc-600",children:"Active Identity"}),h.jsx("p",{className:"text-sm text-zinc-200",children:n?.email||"Unknown user"})]}),h.jsx("button",{type:"button",onClick:t,className:"rounded-2xl bg-[#00ffaa] px-4 py-2 text-[10px] font-black uppercase tracking-[0.18em] text-black transition-colors hover:bg-[#00ffaa]/80",children:"Logout"})]})]})}),h.jsx("main",{className:"flex-1 overflow-y-auto px-4 py-6 sm:px-6 lg:px-8",children:h.jsx("div",{className:"min-h-full rounded-[28px] border border-zinc-800/60 bg-zinc-950/40 p-4 shadow-2xl shadow-black/20 sm:p-6 lg:p-8",children:h.jsx(Ne.Outlet,{})})})]})]})}function po({requireAdmin:e=!1}){const t=Ne.useLocation(),{isAdmin:n,isAuthenticated:r}=at();return r?e&&!n?h.jsx(Ne.Navigate,{to:"/dashboard",replace:!0}):h.jsx(Ne.Outlet,{}):h.jsx(Ne.Navigate,{to:"/login",replace:!0,state:{from:t}})}const go={major_mismatch:{bg:"#b91c1c",label:"Incompatible version",message:(e,t)=>`This page (v${t}) is incompatible with the current API (v${e}). Please reload.`,dismissable:!1},minor_mismatch:{bg:"#b45309",label:"API updated",message:(e,t)=>`API updated to v${e} (you have v${t}). Some features may not work correctly.`,dismissable:!0},patch_mismatch:{bg:"#1d4ed8",label:"Minor update available",message:(e,t)=>`API v${e} is available (you have v${t}). Reload when convenient.`,dismissable:!0},client_ahead:{bg:"#4b5563",label:"Client ahead of API",message:(e,t)=>`Client v${t} is ahead of API v${e}. This may indicate a partial rollback.`,dismissable:!0}};function ho({status:e,apiVersion:t,clientVersion:n,onDismiss:r}){const o=go[e];return o?h.jsxs("div",{role:"alert","aria-live":"polite",style:{position:"fixed",top:0,left:0,right:0,zIndex:9999,background:o.bg,color:"white",padding:"12px 16px",textAlign:"center",fontSize:"14px",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px"},children:[h.jsxs("strong",{children:[o.label,":"]}),h.jsx("span",{children:o.message(t,n)}),h.jsx("button",{onClick:()=>window.location.reload(),style:{textDecoration:"underline",cursor:"pointer",background:"none",border:"none",color:"white"},children:"Reload"}),o.dismissable&&r?h.jsx("button",{onClick:r,"aria-label":"Dismiss version warning",style:{marginLeft:8,cursor:"pointer",background:"none",border:"none",color:"white",fontSize:"18px",lineHeight:1},children:"×"}):null]}):null}const Bt={error:"border-red-500/30 bg-red-950/80 text-red-200",success:"border-emerald-500/30 bg-emerald-950/80 text-emerald-200",info:"border-zinc-600/30 bg-zinc-900/90 text-zinc-200"};function bo({toast:e,onDismiss:t}){return e?h.jsxs("div",{role:"alert","aria-live":"assertive",className:`fixed bottom-6 right-6 z-50 max-w-sm rounded-xl border px-4 py-3 text-sm shadow-xl backdrop-blur-sm ${Bt[e.type]||Bt.error}`,children:[h.jsx("span",{children:e.message}),h.jsx("button",{onClick:t,className:"ml-3 text-xs underline opacity-60 hover:opacity-100","aria-label":"Dismiss",children:"Dismiss"})]}):null}function yo({lines:e=3,label:t}){const n=["w-full","w-3/4","w-1/2"];return h.jsxs("div",{className:"rounded-2xl border border-zinc-800/50 bg-zinc-950/50 p-6",children:[h.jsx("div",{className:"space-y-3",children:Array.from({length:e},(r,o)=>h.jsx("div",{"data-testid":"loading-panel-line",className:`h-3 rounded bg-zinc-800 animate-pulse ${n[o%n.length]}`},o))}),t?h.jsx("p",{className:"mt-4 text-center text-xs text-zinc-500",children:t}):null]})}function xo({error:e,domain:t,onRetry:n}){if(!e)return null;const r=e?.status??"unknown",o=t||e?.domain||"server";let s=`${o} returned an unexpected error (${r}).`;return r===408?s=`${o} timed out. Check your connection and try again.`:r===429?s=`${o} is rate-limited. Wait a moment and try again.`:r===500?s=`${o} encountered an error. Our team has been notified.`:r===503&&(s=`${o} is temporarily unavailable. Try again in a moment.`),h.jsxs("div",{className:"rounded-2xl border border-zinc-800/30 bg-zinc-950/30 p-6 text-center",children:[h.jsx("p",{className:"text-sm text-zinc-400",children:s}),n?h.jsx("button",{type:"button",className:"mt-3 text-xs text-zinc-500 underline",onClick:n,children:"Try again"}):null]})}function wo(e){const[t,n]=$.useState(!1);return $.useEffect(()=>{e||n(!0)},[e]),t}function vo(){return h.jsx("div",{role:"alert",className:"flex min-h-[200px] items-center justify-center rounded-2xl border border-red-500/20 bg-zinc-950/80 p-8 text-center",children:h.jsxs("div",{children:[h.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.3em] text-red-400",children:"Admin Access Required"}),h.jsx("p",{className:"mt-2 text-sm text-zinc-400",children:"This panel is only available to administrator accounts."})]})})}function Eo({message:e,hint:t}){return h.jsxs("div",{className:"flex flex-col items-center justify-center rounded-2xl border border-zinc-800/30 bg-zinc-950/30 p-8 text-center",children:[h.jsx("p",{className:"text-sm text-zinc-400",children:e}),t?h.jsx("p",{className:"mt-1 text-xs text-zinc-600",children:t}):null]})}function Yt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function It(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Yt(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Yt(e[o],null)}}}}function Ae(...e){return f.useCallback(It(...e),e)}var Ao=Symbol.for("react.lazy"),et=f[" use ".trim().toString()];function Co(e){return typeof e=="object"&&e!==null&&"then"in e}function Nn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Ao&&"_payload"in e&&Co(e._payload)}function Ro(e){const t=To(e),n=f.forwardRef((r,o)=>{let{children:s,...i}=r;Nn(s)&&typeof et=="function"&&(s=et(s._payload));const l=f.Children.toArray(s),c=l.find(ko);if(c){const a=c.props.children,u=l.map(d=>d===c?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:d);return h.jsx(t,{...i,ref:o,children:f.isValidElement(a)?f.cloneElement(a,void 0,u):null})}return h.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var So=Ro("Slot");function To(e){const t=f.forwardRef((n,r)=>{let{children:o,...s}=n;if(Nn(o)&&typeof et=="function"&&(o=et(o._payload)),f.isValidElement(o)){const i=Po(o),l=No(s,o.props);return o.type!==f.Fragment&&(l.ref=r?It(r,i):i),f.cloneElement(o,l)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oo=Symbol("radix.slottable");function ko(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oo}function No(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const c=s(...l);return o(...l),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Po(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Pn(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Pn(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _n(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Pn(e))&&(r&&(r+=" "),r+=t);return r}const qt=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Kt=_n,_o=(e,t)=>n=>{var r;if(t?.variants==null)return Kt(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(a=>{const u=n?.[a],d=s?.[a];if(u===null)return null;const m=qt(u)||qt(d);return o[a][m]}),l=n&&Object.entries(n).reduce((a,u)=>{let[d,m]=u;return m===void 0||(a[d]=m),a},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((a,u)=>{let{class:d,className:m,...p}=u;return Object.entries(p).every(b=>{let[y,w]=b;return Array.isArray(w)?w.includes({...s,...l}[y]):{...s,...l}[y]===w})?[...a,d,m]:a},[]);return Kt(e,i,c,n?.class,n?.className)},$o=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Io=(e,t)=>({classGroupId:e,validator:t}),$n=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),tt="-",Xt=[],Lo="arbitrary..",Mo=e=>{const t=zo(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Do(i);const l=i.split(tt),c=l[0]===""&&l.length>1?1:0;return In(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=r[i],a=n[i];return c?a?$o(a,c):c:a||Xt}return n[i]||Xt}}},In=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const a=In(e,t+1,s);if(a)return a}const i=n.validators;if(i===null)return;const l=t===0?e.join(tt):e.slice(t).join(tt),c=i.length;for(let a=0;a<c;a++){const u=i[a];if(u.validator(l))return u.classGroupId}},Do=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Lo+r:void 0})(),zo=e=>{const{theme:t,classGroups:n}=e;return jo(n,t)},jo=(e,t)=>{const n=$n();for(const r in e){const o=e[r];Lt(o,n,r,t)}return n},Lt=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];Uo(i,t,n,r)}},Uo=(e,t,n,r)=>{if(typeof e=="string"){Fo(e,t,n);return}if(typeof e=="function"){Go(e,t,n,r);return}Vo(e,t,n,r)},Fo=(e,t,n)=>{const r=e===""?t:Ln(t,e);r.classGroupId=n},Go=(e,t,n,r)=>{if(Wo(e)){Lt(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Io(n,e))},Vo=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[l,c]=o[i];Lt(c,Ln(t,l),n,r)}},Ln=(e,t)=>{let n=e;const r=t.split(tt),o=r.length;for(let s=0;s<o;s++){const i=r[s];let l=n.nextPart.get(i);l||(l=$n(),n.nextPart.set(i,l)),n=l}return n},Wo=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Ho=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},Ct="!",Jt=":",Bo=[],Zt=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Yo=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,l=0,c=0,a;const u=o.length;for(let y=0;y<u;y++){const w=o[y];if(i===0&&l===0){if(w===Jt){s.push(o.slice(c,y)),c=y+1;continue}if(w==="/"){a=y;continue}}w==="["?i++:w==="]"?i--:w==="("?l++:w===")"&&l--}const d=s.length===0?o:o.slice(c);let m=d,p=!1;d.endsWith(Ct)?(m=d.slice(0,-1),p=!0):d.startsWith(Ct)&&(m=d.slice(1),p=!0);const b=a&&a>c?a-c:void 0;return Zt(s,p,m,b)};if(t){const o=t+Jt,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):Zt(Bo,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},qo=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],l=i[0]==="[",c=t.has(i);l||c?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},Ko=e=>({cache:Ho(e.cacheSize),parseClassName:Yo(e),sortModifiers:qo(e),postfixLookupClassGroupIds:Xo(e),...Mo(e)}),Xo=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},Jo=/\s+/,Zo=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:i}=t,l=[],c=e.trim().split(Jo);let a="";for(let u=c.length-1;u>=0;u-=1){const d=c[u],{isExternal:m,modifiers:p,hasImportantModifier:b,baseClassName:y,maybePostfixModifierPosition:w}=n(d);if(m){a=d+(a.length>0?" "+a:a);continue}let x=!!w,E;if(x){const T=y.substring(0,w);E=r(T);const v=E&&i[E]?r(y):void 0;v&&v!==E&&(E=v,x=!1)}else E=r(y);if(!E){if(!x){a=d+(a.length>0?" "+a:a);continue}if(E=r(y),!E){a=d+(a.length>0?" "+a:a);continue}x=!1}const O=p.length===0?"":p.length===1?p[0]:s(p).join(":"),S=b?O+Ct:O,k=S+E;if(l.indexOf(k)>-1)continue;l.push(k);const N=o(E,x);for(let T=0;T<N.length;++T){const v=N[T];l.push(S+v)}a=d+(a.length>0?" "+a:a)}return a},Qo=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Mn(n))&&(o&&(o+=" "),o+=r);return o},Mn=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Mn(e[r]))&&(n&&(n+=" "),n+=t);return n},es=(e,...t)=>{let n,r,o,s;const i=c=>{const a=t.reduce((u,d)=>d(u),e());return n=Ko(a),r=n.cache.get,o=n.cache.set,s=l,l(c)},l=c=>{const a=r(c);if(a)return a;const u=Zo(c,n);return o(c,u),u};return s=i,(...c)=>s(Qo(...c))},ts=[],H=e=>{const t=n=>n[e]||ts;return t.isThemeGetter=!0,t},Dn=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,zn=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ns=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,rs=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,os=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ss=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,is=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,as=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,me=e=>ns.test(e),P=e=>!!e&&!Number.isNaN(Number(e)),ne=e=>!!e&&Number.isInteger(Number(e)),bt=e=>e.endsWith("%")&&P(e.slice(0,-1)),ie=e=>rs.test(e),jn=()=>!0,ls=e=>os.test(e)&&!ss.test(e),Mt=()=>!1,cs=e=>is.test(e),us=e=>as.test(e),ds=e=>!A(e)&&!C(e),fs=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),ms=e=>be(e,Gn,Mt),A=e=>Dn.test(e),ye=e=>be(e,Vn,ls),Qt=e=>be(e,vs,P),ps=e=>be(e,Hn,jn),gs=e=>be(e,Wn,Mt),en=e=>be(e,Un,Mt),hs=e=>be(e,Fn,us),Ke=e=>be(e,Bn,cs),C=e=>zn.test(e),je=e=>Ce(e,Vn),bs=e=>Ce(e,Wn),tn=e=>Ce(e,Un),ys=e=>Ce(e,Gn),xs=e=>Ce(e,Fn),Xe=e=>Ce(e,Bn,!0),ws=e=>Ce(e,Hn,!0),be=(e,t,n)=>{const r=Dn.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ce=(e,t,n=!1)=>{const r=zn.exec(e);return r?r[1]?t(r[1]):n:!1},Un=e=>e==="position"||e==="percentage",Fn=e=>e==="image"||e==="url",Gn=e=>e==="length"||e==="size"||e==="bg-size",Vn=e=>e==="length",vs=e=>e==="number",Wn=e=>e==="family-name",Hn=e=>e==="number"||e==="weight",Bn=e=>e==="shadow",Es=()=>{const e=H("color"),t=H("font"),n=H("text"),r=H("font-weight"),o=H("tracking"),s=H("leading"),i=H("breakpoint"),l=H("container"),c=H("spacing"),a=H("radius"),u=H("shadow"),d=H("inset-shadow"),m=H("text-shadow"),p=H("drop-shadow"),b=H("blur"),y=H("perspective"),w=H("aspect"),x=H("ease"),E=H("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...S(),C,A],N=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],v=()=>[C,A,c],I=()=>[me,"full","auto",...v()],D=()=>[ne,"none","subgrid",C,A],B=()=>["auto",{span:["full",ne,C,A]},ne,C,A],F=()=>[ne,"auto",C,A],U=()=>["auto","min","max","fr",C,A],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...v()],M=()=>[me,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...v()],_=()=>[me,"screen","full","dvw","lvw","svw","min","max","fit",...v()],V=()=>[me,"screen","full","lh","dvh","lvh","svh","min","max","fit",...v()],R=()=>[e,C,A],Me=()=>[...S(),tn,en,{position:[C,A]}],He=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Be=()=>["auto","cover","contain",ys,ms,{size:[C,A]}],De=()=>[bt,je,ye],Y=()=>["","none","full",a,C,A],q=()=>["",P,je,ye],ee=()=>["solid","dashed","dotted","double"],ze=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[P,bt,tn,en],Ye=()=>["","none",b,C,A],Se=()=>["none",P,C,A],Te=()=>["none",P,C,A],fe=()=>[P,C,A],qe=()=>[me,"full",...v()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ie],breakpoint:[ie],color:[jn],container:[ie],"drop-shadow":[ie],ease:["in","out","in-out"],font:[ds],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ie],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ie],shadow:[ie],spacing:["px",P],text:[ie],"text-shadow":[ie],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",me,A,C,w]}],container:["container"],"container-type":[{"@container":["","normal","size",C,A]}],"container-named":[fs],columns:[{columns:[P,A,C,l]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:k()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[ne,"auto",C,A]}],basis:[{basis:[me,"full","auto",l,...v()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[P,me,"auto","initial","none",A]}],grow:[{grow:["",P,C,A]}],shrink:[{shrink:["",P,C,A]}],order:[{order:[ne,"first","last","none",C,A]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:v()}],"gap-x":[{"gap-x":v()}],"gap-y":[{"gap-y":v()}],"justify-content":[{justify:[...z(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:v()}],px:[{px:v()}],py:[{py:v()}],ps:[{ps:v()}],pe:[{pe:v()}],pbs:[{pbs:v()}],pbe:[{pbe:v()}],pt:[{pt:v()}],pr:[{pr:v()}],pb:[{pb:v()}],pl:[{pl:v()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mbs:[{mbs:L()}],mbe:[{mbe:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":v()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":v()}],"space-y-reverse":["space-y-reverse"],size:[{size:M()}],"inline-size":[{inline:["auto",..._()]}],"min-inline-size":[{"min-inline":["auto",..._()]}],"max-inline-size":[{"max-inline":["none",..._()]}],"block-size":[{block:["auto",...V()]}],"min-block-size":[{"min-block":["auto",...V()]}],"max-block-size":[{"max-block":["none",...V()]}],w:[{w:[l,"screen",...M()]}],"min-w":[{"min-w":[l,"screen","none",...M()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...M()]}],h:[{h:["screen","lh",...M()]}],"min-h":[{"min-h":["screen","lh","none",...M()]}],"max-h":[{"max-h":["screen","lh",...M()]}],"font-size":[{text:["base",n,je,ye]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ws,ps]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",bt,A]}],"font-family":[{font:[bs,gs,t]}],"font-features":[{"font-features":[A]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,C,A]}],"line-clamp":[{"line-clamp":[P,"none",C,Qt]}],leading:[{leading:[s,...v()]}],"list-image":[{"list-image":["none",C,A]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",C,A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:[P,"from-font","auto",C,ye]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[P,"auto",C,A]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:v()}],"tab-size":[{tab:[ne,C,A]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",C,A]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",C,A]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Me()}],"bg-repeat":[{bg:He()}],"bg-size":[{bg:Be()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ne,C,A],radial:["",C,A],conic:[ne,C,A]},xs,hs]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:De()}],"gradient-via-pos":[{via:De()}],"gradient-to-pos":[{to:De()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-bs":[{"border-bs":q()}],"border-w-be":[{"border-be":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ee(),"hidden","none"]}],"divide-style":[{divide:[...ee(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...ee(),"none","hidden"]}],"outline-offset":[{"outline-offset":[P,C,A]}],"outline-w":[{outline:["",P,je,ye]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",u,Xe,Ke]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",d,Xe,Ke]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[P,ye]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",m,Xe,Ke]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[P,C,A]}],"mix-blend":[{"mix-blend":[...ze(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ze()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[P]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[C,A]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[P]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Me()}],"mask-repeat":[{mask:He()}],"mask-size":[{mask:Be()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",C,A]}],filter:[{filter:["","none",C,A]}],blur:[{blur:Ye()}],brightness:[{brightness:[P,C,A]}],contrast:[{contrast:[P,C,A]}],"drop-shadow":[{"drop-shadow":["","none",p,Xe,Ke]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",P,C,A]}],"hue-rotate":[{"hue-rotate":[P,C,A]}],invert:[{invert:["",P,C,A]}],saturate:[{saturate:[P,C,A]}],sepia:[{sepia:["",P,C,A]}],"backdrop-filter":[{"backdrop-filter":["","none",C,A]}],"backdrop-blur":[{"backdrop-blur":Ye()}],"backdrop-brightness":[{"backdrop-brightness":[P,C,A]}],"backdrop-contrast":[{"backdrop-contrast":[P,C,A]}],"backdrop-grayscale":[{"backdrop-grayscale":["",P,C,A]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[P,C,A]}],"backdrop-invert":[{"backdrop-invert":["",P,C,A]}],"backdrop-opacity":[{"backdrop-opacity":[P,C,A]}],"backdrop-saturate":[{"backdrop-saturate":[P,C,A]}],"backdrop-sepia":[{"backdrop-sepia":["",P,C,A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":v()}],"border-spacing-x":[{"border-spacing-x":v()}],"border-spacing-y":[{"border-spacing-y":v()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",C,A]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[P,"initial",C,A]}],ease:[{ease:["linear","initial",x,C,A]}],delay:[{delay:[P,C,A]}],animate:[{animate:["none",E,C,A]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,C,A]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[C,A,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:qe()}],"translate-x":[{"translate-x":qe()}],"translate-y":[{"translate-y":qe()}],"translate-z":[{"translate-z":qe()}],"translate-none":["translate-none"],zoom:[{zoom:[ne,C,A]}],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",C,A]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":R()}],"scrollbar-track-color":[{"scrollbar-track":R()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":v()}],"scroll-mx":[{"scroll-mx":v()}],"scroll-my":[{"scroll-my":v()}],"scroll-ms":[{"scroll-ms":v()}],"scroll-me":[{"scroll-me":v()}],"scroll-mbs":[{"scroll-mbs":v()}],"scroll-mbe":[{"scroll-mbe":v()}],"scroll-mt":[{"scroll-mt":v()}],"scroll-mr":[{"scroll-mr":v()}],"scroll-mb":[{"scroll-mb":v()}],"scroll-ml":[{"scroll-ml":v()}],"scroll-p":[{"scroll-p":v()}],"scroll-px":[{"scroll-px":v()}],"scroll-py":[{"scroll-py":v()}],"scroll-ps":[{"scroll-ps":v()}],"scroll-pe":[{"scroll-pe":v()}],"scroll-pbs":[{"scroll-pbs":v()}],"scroll-pbe":[{"scroll-pbe":v()}],"scroll-pt":[{"scroll-pt":v()}],"scroll-pr":[{"scroll-pr":v()}],"scroll-pb":[{"scroll-pb":v()}],"scroll-pl":[{"scroll-pl":v()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",C,A]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[P,je,ye,Qt]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},As=es(Es);function ue(...e){return As(_n(e))}const Yn=_o("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),qn=f.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?So:"button";return h.jsx(i,{className:ue(Yn({variant:t,size:n,className:e})),ref:s,...o})});qn.displayName="Button";const Kn=f.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ue("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Kn.displayName="Card";const Xn=f.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ue("flex flex-col space-y-1.5 p-6",e),...t}));Xn.displayName="CardHeader";const Jn=f.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ue("text-2xl font-semibold leading-none tracking-tight",e),...t}));Jn.displayName="CardTitle";const Zn=f.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));Zn.displayName="CardDescription";const Qn=f.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ue("p-6 pt-0",e),...t}));Qn.displayName="CardContent";const er=f.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ue("flex items-center p-6 pt-0",e),...t}));er.displayName="CardFooter";function ae(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function tr(e,t=[]){let n=[];function r(s,i){const l=f.createContext(i),c=n.length;n=[...n,i];const a=d=>{const{scope:m,children:p,...b}=d,y=m?.[e]?.[c]||l,w=f.useMemo(()=>b,Object.values(b));return h.jsx(y.Provider,{value:w,children:p})};a.displayName=s+"Provider";function u(d,m){const p=m?.[e]?.[c]||l,b=f.useContext(p);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[a,u]}const o=()=>{const s=n.map(i=>f.createContext(i));return function(l){const c=l?.[e]||s;return f.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[r,Cs(o,...t)]}function Cs(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((l,{useScope:c,scopeName:a})=>{const d=c(s)[`__scope${a}`];return{...l,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Rs(e){const t=Ss(e),n=f.forwardRef((r,o)=>{const{children:s,...i}=r,l=f.Children.toArray(s),c=l.find(Os);if(c){const a=c.props.children,u=l.map(d=>d===c?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:d);return h.jsx(t,{...i,ref:o,children:f.isValidElement(a)?f.cloneElement(a,void 0,u):null})}return h.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Ss(e){const t=f.forwardRef((n,r)=>{const{children:o,...s}=n;if(f.isValidElement(o)){const i=Ns(o),l=ks(s,o.props);return o.type!==f.Fragment&&(l.ref=r?It(r,i):i),f.cloneElement(o,l)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ts=Symbol("radix.slottable");function Os(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ts}function ks(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const c=s(...l);return o(...l),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Ns(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ps=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Re=Ps.reduce((e,t)=>{const n=Rs(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:i,...l}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(c,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function _s(e,t){e&&bn.flushSync(()=>e.dispatchEvent(t))}function lt(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>t.current?.(...n),[])}function $s(e,t=globalThis?.document){const n=lt(e);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Is="DismissableLayer",Rt="dismissableLayer.update",Ls="dismissableLayer.pointerDownOutside",Ms="dismissableLayer.focusOutside",nn,nr=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rr=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:l,...c}=e,a=f.useContext(nr),[u,d]=f.useState(null),m=u?.ownerDocument??globalThis?.document,[,p]=f.useState({}),b=Ae(t,T=>d(T)),y=Array.from(a.layers),[w]=[...a.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(w),E=u?y.indexOf(u):-1,O=a.layersWithOutsidePointerEventsDisabled.size>0,S=E>=x,k=js(T=>{const v=T.target,I=[...a.branches].some(D=>D.contains(v));!S||I||(o?.(T),i?.(T),T.defaultPrevented||l?.())},m),N=Us(T=>{const v=T.target;[...a.branches].some(D=>D.contains(v))||(s?.(T),i?.(T),T.defaultPrevented||l?.())},m);return $s(T=>{E===a.layers.size-1&&(r?.(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},m),f.useEffect(()=>{if(u)return n&&(a.layersWithOutsidePointerEventsDisabled.size===0&&(nn=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),a.layersWithOutsidePointerEventsDisabled.add(u)),a.layers.add(u),rn(),()=>{n&&a.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=nn)}},[u,m,n,a]),f.useEffect(()=>()=>{u&&(a.layers.delete(u),a.layersWithOutsidePointerEventsDisabled.delete(u),rn())},[u,a]),f.useEffect(()=>{const T=()=>p({});return document.addEventListener(Rt,T),()=>document.removeEventListener(Rt,T)},[]),h.jsx(Re.div,{...c,ref:b,style:{pointerEvents:O?S?"auto":"none":void 0,...e.style},onFocusCapture:ae(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ae(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ae(e.onPointerDownCapture,k.onPointerDownCapture)})});rr.displayName=Is;var Ds="DismissableLayerBranch",zs=f.forwardRef((e,t)=>{const n=f.useContext(nr),r=f.useRef(null),o=Ae(t,r);return f.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),h.jsx(Re.div,{...e,ref:o})});zs.displayName=Ds;function js(e,t=globalThis?.document){const n=lt(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const s=l=>{if(l.target&&!r.current){let c=function(){or(Ls,n,a,{discrete:!0})};const a={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Us(e,t=globalThis?.document){const n=lt(e),r=f.useRef(!1);return f.useEffect(()=>{const o=s=>{s.target&&!r.current&&or(Ms,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function rn(){const e=new CustomEvent(Rt);document.dispatchEvent(e)}function or(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?_s(o,s):o.dispatchEvent(s)}var we=globalThis?.document?f.useLayoutEffect:()=>{},Fs=f[" useId ".trim().toString()]||(()=>{}),Gs=0;function Vs(e){const[t,n]=f.useState(Fs());return we(()=>{n(r=>r??String(Gs++))},[e]),t?`radix-${t}`:""}const Ws=["top","right","bottom","left"],ge=Math.min,K=Math.max,nt=Math.round,Je=Math.floor,oe=e=>({x:e,y:e}),Hs={left:"right",right:"left",bottom:"top",top:"bottom"};function St(e,t,n){return K(e,ge(t,n))}function le(e,t){return typeof e=="function"?e(t):e}function ce(e){return e.split("-")[0]}function Ie(e){return e.split("-")[1]}function Dt(e){return e==="x"?"y":"x"}function zt(e){return e==="y"?"height":"width"}function re(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function jt(e){return Dt(re(e))}function Bs(e,t,n){n===void 0&&(n=!1);const r=Ie(e),o=jt(e),s=zt(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=rt(i)),[i,rt(i)]}function Ys(e){const t=rt(e);return[Tt(e),t,Tt(t)]}function Tt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const on=["left","right"],sn=["right","left"],qs=["top","bottom"],Ks=["bottom","top"];function Xs(e,t,n){switch(e){case"top":case"bottom":return n?t?sn:on:t?on:sn;case"left":case"right":return t?qs:Ks;default:return[]}}function Js(e,t,n,r){const o=Ie(e);let s=Xs(ce(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Tt)))),s}function rt(e){const t=ce(e);return Hs[t]+e.slice(t.length)}function Zs(e){return{top:0,right:0,bottom:0,left:0,...e}}function sr(e){return typeof e!="number"?Zs(e):{top:e,right:e,bottom:e,left:e}}function ot(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function an(e,t,n){let{reference:r,floating:o}=e;const s=re(t),i=jt(t),l=zt(i),c=ce(t),a=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,m=r[l]/2-o[l]/2;let p;switch(c){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Ie(t)){case"start":p[i]-=m*(n&&a?-1:1);break;case"end":p[i]+=m*(n&&a?-1:1);break}return p}async function Qs(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:l,strategy:c}=e,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:p=0}=le(t,e),b=sr(p),w=l[m?d==="floating"?"reference":"floating":d],x=ot(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:a,rootBoundary:u,strategy:c})),E=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),S=await(s.isElement==null?void 0:s.isElement(O))?await(s.getScale==null?void 0:s.getScale(O))||{x:1,y:1}:{x:1,y:1},k=ot(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:O,strategy:c}):E);return{top:(x.top-k.top+b.top)/S.y,bottom:(k.bottom-x.bottom+b.bottom)/S.y,left:(x.left-k.left+b.left)/S.x,right:(k.right-x.right+b.right)/S.x}}const ei=50,ti=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:Qs},c=await(i.isRTL==null?void 0:i.isRTL(t));let a=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=an(a,r,c),m=r,p=0;const b={};for(let y=0;y<s.length;y++){const w=s[y];if(!w)continue;const{name:x,fn:E}=w,{x:O,y:S,data:k,reset:N}=await E({x:u,y:d,initialPlacement:r,placement:m,strategy:o,middlewareData:b,rects:a,platform:l,elements:{reference:e,floating:t}});u=O??u,d=S??d,b[x]={...b[x],...k},N&&p<ei&&(p++,typeof N=="object"&&(N.placement&&(m=N.placement),N.rects&&(a=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:u,y:d}=an(a,m,c)),y=-1)}return{x:u,y:d,placement:m,strategy:o,middlewareData:b}},ni=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:l,middlewareData:c}=t,{element:a,padding:u=0}=le(e,t)||{};if(a==null)return{};const d=sr(u),m={x:n,y:r},p=jt(o),b=zt(p),y=await i.getDimensions(a),w=p==="y",x=w?"top":"left",E=w?"bottom":"right",O=w?"clientHeight":"clientWidth",S=s.reference[b]+s.reference[p]-m[p]-s.floating[b],k=m[p]-s.reference[p],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a));let T=N?N[O]:0;(!T||!await(i.isElement==null?void 0:i.isElement(N)))&&(T=l.floating[O]||s.floating[b]);const v=S/2-k/2,I=T/2-y[b]/2-1,D=ge(d[x],I),B=ge(d[E],I),F=D,U=T-y[b]-B,z=T/2-y[b]/2+v,G=St(F,z,U),L=!c.arrow&&Ie(o)!=null&&z!==G&&s.reference[b]/2-(z<F?D:B)-y[b]/2<0,M=L?z<F?z-F:z-U:0;return{[p]:m[p]+M,data:{[p]:G,centerOffset:z-G-M,...L&&{alignmentOffset:M}},reset:L}}}),ri=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:a}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:y=!0,...w}=le(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=ce(o),E=re(l),O=ce(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(a.floating)),k=m||(O||!y?[rt(l)]:Ys(l)),N=b!=="none";!m&&N&&k.push(...Js(l,y,b,S));const T=[l,...k],v=await c.detectOverflow(t,w),I=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&I.push(v[x]),d){const z=Bs(o,i,S);I.push(v[z[0]],v[z[1]])}if(D=[...D,{placement:o,overflows:I}],!I.every(z=>z<=0)){var B,F;const z=(((B=s.flip)==null?void 0:B.index)||0)+1,G=T[z];if(G&&(!(d==="alignment"?E!==re(G):!1)||D.every(_=>re(_.placement)===E?_.overflows[0]>0:!0)))return{data:{index:z,overflows:D},reset:{placement:G}};let L=(F=D.filter(M=>M.overflows[0]<=0).sort((M,_)=>M.overflows[1]-_.overflows[1])[0])==null?void 0:F.placement;if(!L)switch(p){case"bestFit":{var U;const M=(U=D.filter(_=>{if(N){const V=re(_.placement);return V===E||V==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(V=>V>0).reduce((V,R)=>V+R,0)]).sort((_,V)=>_[1]-V[1])[0])==null?void 0:U[0];M&&(L=M);break}case"initialPlacement":L=l;break}if(o!==L)return{reset:{placement:L}}}return{}}}};function ln(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cn(e){return Ws.some(t=>e[t]>=0)}const oi=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=le(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),l=ln(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:cn(l)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),l=ln(i,n.floating);return{data:{escapedOffsets:l,escaped:cn(l)}}}default:return{}}}}},ir=new Set(["left","top"]);async function si(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ce(n),l=Ie(n),c=re(n)==="y",a=ir.has(i)?-1:1,u=s&&c?-1:1,d=le(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof b=="number"&&(p=l==="end"?b*-1:b),c?{x:p*u,y:m*a}:{x:m*a,y:p*u}}const ii=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:l}=t,c=await si(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},ai=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:x=>{let{x:E,y:O}=x;return{x:E,y:O}}},...a}=le(e,t),u={x:n,y:r},d=await s.detectOverflow(t,a),m=re(ce(o)),p=Dt(m);let b=u[p],y=u[m];if(i){const x=p==="y"?"top":"left",E=p==="y"?"bottom":"right",O=b+d[x],S=b-d[E];b=St(O,b,S)}if(l){const x=m==="y"?"top":"left",E=m==="y"?"bottom":"right",O=y+d[x],S=y-d[E];y=St(O,y,S)}const w=c.fn({...t,[p]:b,[m]:y});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[p]:i,[m]:l}}}}}},li=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:c=!0,crossAxis:a=!0}=le(e,t),u={x:n,y:r},d=re(o),m=Dt(d);let p=u[m],b=u[d];const y=le(l,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const O=m==="y"?"height":"width",S=s.reference[m]-s.floating[O]+w.mainAxis,k=s.reference[m]+s.reference[O]-w.mainAxis;p<S?p=S:p>k&&(p=k)}if(a){var x,E;const O=m==="y"?"width":"height",S=ir.has(ce(o)),k=s.reference[d]-s.floating[O]+(S&&((x=i.offset)==null?void 0:x[d])||0)+(S?0:w.crossAxis),N=s.reference[d]+s.reference[O]+(S?0:((E=i.offset)==null?void 0:E[d])||0)-(S?w.crossAxis:0);b<k?b=k:b>N&&(b=N)}return{[m]:p,[d]:b}}}},ci=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:l}=t,{apply:c=()=>{},...a}=le(e,t),u=await i.detectOverflow(t,a),d=ce(o),m=Ie(o),p=re(o)==="y",{width:b,height:y}=s.floating;let w,x;d==="top"||d==="bottom"?(w=d,x=m===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(x=d,w=m==="end"?"top":"bottom");const E=y-u.top-u.bottom,O=b-u.left-u.right,S=ge(y-u[w],E),k=ge(b-u[x],O),N=!t.middlewareData.shift;let T=S,v=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(v=O),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=E),N&&!m){const D=K(u.left,0),B=K(u.right,0),F=K(u.top,0),U=K(u.bottom,0);p?v=b-2*(D!==0||B!==0?D+B:K(u.left,u.right)):T=y-2*(F!==0||U!==0?F+U:K(u.top,u.bottom))}await c({...t,availableWidth:v,availableHeight:T});const I=await i.getDimensions(l.floating);return b!==I.width||y!==I.height?{reset:{rects:!0}}:{}}}};function ct(){return typeof window<"u"}function Le(e){return ar(e)?(e.nodeName||"").toLowerCase():"#document"}function X(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function se(e){var t;return(t=(ar(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ar(e){return ct()?e instanceof Node||e instanceof X(e).Node:!1}function Z(e){return ct()?e instanceof Element||e instanceof X(e).Element:!1}function de(e){return ct()?e instanceof HTMLElement||e instanceof X(e).HTMLElement:!1}function un(e){return!ct()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof X(e).ShadowRoot}function We(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function ui(e){return/^(table|td|th)$/.test(Le(e))}function ut(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const di=/transform|translate|scale|rotate|perspective|filter/,fi=/paint|layout|strict|content/,xe=e=>!!e&&e!=="none";let yt;function Ut(e){const t=Z(e)?Q(e):e;return xe(t.transform)||xe(t.translate)||xe(t.scale)||xe(t.rotate)||xe(t.perspective)||!Ft()&&(xe(t.backdropFilter)||xe(t.filter))||di.test(t.willChange||"")||fi.test(t.contain||"")}function mi(e){let t=he(e);for(;de(t)&&!_e(t);){if(Ut(t))return t;if(ut(t))return null;t=he(t)}return null}function Ft(){return yt==null&&(yt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),yt}function _e(e){return/^(html|body|#document)$/.test(Le(e))}function Q(e){return X(e).getComputedStyle(e)}function dt(e){return Z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function he(e){if(Le(e)==="html")return e;const t=e.assignedSlot||e.parentNode||un(e)&&e.host||se(e);return un(t)?t.host:t}function lr(e){const t=he(e);return _e(t)?e.ownerDocument?e.ownerDocument.body:e.body:de(t)&&We(t)?t:lr(t)}function Fe(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=lr(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=X(o);if(s){const l=Ot(i);return t.concat(i,i.visualViewport||[],We(o)?o:[],l&&n?Fe(l):[])}else return t.concat(o,Fe(o,[],n))}function Ot(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cr(e){const t=Q(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=de(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=nt(n)!==s||nt(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function Gt(e){return Z(e)?e:e.contextElement}function Pe(e){const t=Gt(e);if(!de(t))return oe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=cr(t);let i=(s?nt(n.width):n.width)/r,l=(s?nt(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const pi=oe(0);function ur(e){const t=X(e);return!Ft()||!t.visualViewport?pi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gi(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==X(e)?!1:t}function ve(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Gt(e);let i=oe(1);t&&(r?Z(r)&&(i=Pe(r)):i=Pe(e));const l=gi(s,n,r)?ur(s):oe(0);let c=(o.left+l.x)/i.x,a=(o.top+l.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const m=X(s),p=r&&Z(r)?X(r):r;let b=m,y=Ot(b);for(;y&&r&&p!==b;){const w=Pe(y),x=y.getBoundingClientRect(),E=Q(y),O=x.left+(y.clientLeft+parseFloat(E.paddingLeft))*w.x,S=x.top+(y.clientTop+parseFloat(E.paddingTop))*w.y;c*=w.x,a*=w.y,u*=w.x,d*=w.y,c+=O,a+=S,b=X(y),y=Ot(b)}}return ot({width:u,height:d,x:c,y:a})}function ft(e,t){const n=dt(e).scrollLeft;return t?t.left+n:ve(se(e)).left+n}function dr(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ft(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function hi(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=se(r),l=t?ut(t.floating):!1;if(r===i||l&&s)return n;let c={scrollLeft:0,scrollTop:0},a=oe(1);const u=oe(0),d=de(r);if((d||!d&&!s)&&((Le(r)!=="body"||We(i))&&(c=dt(r)),d)){const p=ve(r);a=Pe(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const m=i&&!d&&!s?dr(i,c):oe(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-c.scrollLeft*a.x+u.x+m.x,y:n.y*a.y-c.scrollTop*a.y+u.y+m.y}}function bi(e){return Array.from(e.getClientRects())}function yi(e){const t=se(e),n=dt(e),r=e.ownerDocument.body,o=K(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=K(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ft(e);const l=-n.scrollTop;return Q(r).direction==="rtl"&&(i+=K(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:l}}const dn=25;function xi(e,t){const n=X(e),r=se(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,c=0;if(o){s=o.width,i=o.height;const u=Ft();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const a=ft(r);if(a<=0){const u=r.ownerDocument,d=u.body,m=getComputedStyle(d),p=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(r.clientWidth-d.clientWidth-p);b<=dn&&(s-=b)}else a<=dn&&(s+=a);return{width:s,height:i,x:l,y:c}}function wi(e,t){const n=ve(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=de(e)?Pe(e):oe(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,c=o*s.x,a=r*s.y;return{width:i,height:l,x:c,y:a}}function fn(e,t,n){let r;if(t==="viewport")r=xi(e,n);else if(t==="document")r=yi(se(e));else if(Z(t))r=wi(t,n);else{const o=ur(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ot(r)}function fr(e,t){const n=he(e);return n===t||!Z(n)||_e(n)?!1:Q(n).position==="fixed"||fr(n,t)}function vi(e,t){const n=t.get(e);if(n)return n;let r=Fe(e,[],!1).filter(l=>Z(l)&&Le(l)!=="body"),o=null;const s=Q(e).position==="fixed";let i=s?he(e):e;for(;Z(i)&&!_e(i);){const l=Q(i),c=Ut(i);!c&&l.position==="fixed"&&(o=null),(s?!c&&!o:!c&&l.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||We(i)&&!c&&fr(e,i))?r=r.filter(u=>u!==i):o=l,i=he(i)}return t.set(e,r),r}function Ei(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?ut(t)?[]:vi(t,this._c):[].concat(n),r],l=fn(t,i[0],o);let c=l.top,a=l.right,u=l.bottom,d=l.left;for(let m=1;m<i.length;m++){const p=fn(t,i[m],o);c=K(p.top,c),a=ge(p.right,a),u=ge(p.bottom,u),d=K(p.left,d)}return{width:a-d,height:u-c,x:d,y:c}}function Ai(e){const{width:t,height:n}=cr(e);return{width:t,height:n}}function Ci(e,t,n){const r=de(t),o=se(t),s=n==="fixed",i=ve(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=oe(0);function a(){c.x=ft(o)}if(r||!r&&!s)if((Le(t)!=="body"||We(o))&&(l=dt(t)),r){const p=ve(t,!0,s,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else o&&a();s&&!r&&o&&a();const u=o&&!r&&!s?dr(o,l):oe(0),d=i.left+l.scrollLeft-c.x-u.x,m=i.top+l.scrollTop-c.y-u.y;return{x:d,y:m,width:i.width,height:i.height}}function xt(e){return Q(e).position==="static"}function mn(e,t){if(!de(e)||Q(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return se(e)===n&&(n=n.ownerDocument.body),n}function mr(e,t){const n=X(e);if(ut(e))return n;if(!de(e)){let o=he(e);for(;o&&!_e(o);){if(Z(o)&&!xt(o))return o;o=he(o)}return n}let r=mn(e,t);for(;r&&ui(r)&&xt(r);)r=mn(r,t);return r&&_e(r)&&xt(r)&&!Ut(r)?n:r||mi(e)||n}const Ri=async function(e){const t=this.getOffsetParent||mr,n=this.getDimensions,r=await n(e.floating);return{reference:Ci(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Si(e){return Q(e).direction==="rtl"}const Ti={convertOffsetParentRelativeRectToViewportRelativeRect:hi,getDocumentElement:se,getClippingRect:Ei,getOffsetParent:mr,getElementRects:Ri,getClientRects:bi,getDimensions:Ai,getScale:Pe,isElement:Z,isRTL:Si};function pr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Oi(e,t){let n=null,r;const o=se(e);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const a=e.getBoundingClientRect(),{left:u,top:d,width:m,height:p}=a;if(l||t(),!m||!p)return;const b=Je(d),y=Je(o.clientWidth-(u+m)),w=Je(o.clientHeight-(d+p)),x=Je(u),O={rootMargin:-b+"px "+-y+"px "+-w+"px "+-x+"px",threshold:K(0,ge(1,c))||1};let S=!0;function k(N){const T=N[0].intersectionRatio;if(T!==c){if(!S)return i();T?i(!1,T):r=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!pr(a,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(k,{...O,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,O)}n.observe(e)}return i(!0),s}function ki(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,a=Gt(e),u=o||s?[...a?Fe(a):[],...t?Fe(t):[]]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const d=a&&l?Oi(a,n):null;let m=-1,p=null;i&&(p=new ResizeObserver(x=>{let[E]=x;E&&E.target===a&&p&&t&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var O;(O=p)==null||O.observe(t)})),n()}),a&&!c&&p.observe(a),t&&p.observe(t));let b,y=c?ve(e):null;c&&w();function w(){const x=ve(e);y&&!pr(y,x)&&n(),y=x,b=requestAnimationFrame(w)}return n(),()=>{var x;u.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),d?.(),(x=p)==null||x.disconnect(),p=null,c&&cancelAnimationFrame(b)}}const Ni=ii,Pi=ai,_i=ri,$i=ci,Ii=oi,pn=ni,Li=li,Mi=(e,t,n)=>{const r=new Map,o={platform:Ti,...n},s={...o.platform,_c:r};return ti(e,t,{...o,platform:s})};var Di=typeof document<"u",zi=function(){},Qe=Di?$.useLayoutEffect:zi;function st(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!st(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!st(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function gr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gn(e,t){const n=gr(e);return Math.round(t*n)/n}function wt(e){const t=f.useRef(e);return Qe(()=>{t.current=e}),t}function ji(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:c,open:a}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=f.useState(r);st(m,r)||p(r);const[b,y]=f.useState(null),[w,x]=f.useState(null),E=f.useCallback(_=>{_!==N.current&&(N.current=_,y(_))},[]),O=f.useCallback(_=>{_!==T.current&&(T.current=_,x(_))},[]),S=s||b,k=i||w,N=f.useRef(null),T=f.useRef(null),v=f.useRef(u),I=c!=null,D=wt(c),B=wt(o),F=wt(a),U=f.useCallback(()=>{if(!N.current||!T.current)return;const _={placement:t,strategy:n,middleware:m};B.current&&(_.platform=B.current),Mi(N.current,T.current,_).then(V=>{const R={...V,isPositioned:F.current!==!1};z.current&&!st(v.current,R)&&(v.current=R,bn.flushSync(()=>{d(R)}))})},[m,t,n,B,F]);Qe(()=>{a===!1&&v.current.isPositioned&&(v.current.isPositioned=!1,d(_=>({..._,isPositioned:!1})))},[a]);const z=f.useRef(!1);Qe(()=>(z.current=!0,()=>{z.current=!1}),[]),Qe(()=>{if(S&&(N.current=S),k&&(T.current=k),S&&k){if(D.current)return D.current(S,k,U);U()}},[S,k,U,D,I]);const G=f.useMemo(()=>({reference:N,floating:T,setReference:E,setFloating:O}),[E,O]),L=f.useMemo(()=>({reference:S,floating:k}),[S,k]),M=f.useMemo(()=>{const _={position:n,left:0,top:0};if(!L.floating)return _;const V=gn(L.floating,u.x),R=gn(L.floating,u.y);return l?{..._,transform:"translate("+V+"px, "+R+"px)",...gr(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:R}},[n,l,L.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:U,refs:G,elements:L,floatingStyles:M}),[u,U,G,L,M])}const Ui=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?pn({element:r.current,padding:o}).fn(n):{}:r?pn({element:r,padding:o}).fn(n):{}}}},Fi=(e,t)=>{const n=Ni(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gi=(e,t)=>{const n=Pi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vi=(e,t)=>({fn:Li(e).fn,options:[e,t]}),Wi=(e,t)=>{const n=_i(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hi=(e,t)=>{const n=$i(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bi=(e,t)=>{const n=Ii(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yi=(e,t)=>{const n=Ui(e);return{name:n.name,fn:n.fn,options:[e,t]}};var qi="Arrow",hr=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return h.jsx(Re.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});hr.displayName=qi;var Ki=hr;function Xi(e){const[t,n]=f.useState(void 0);return we(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,l;if("borderBoxSize"in s){const c=s.borderBoxSize,a=Array.isArray(c)?c[0]:c;i=a.inlineSize,l=a.blockSize}else i=e.offsetWidth,l=e.offsetHeight;n({width:i,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Vt="Popper",[br,yr]=tr(Vt),[Ji,xr]=br(Vt),wr=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return h.jsx(Ji,{scope:t,anchor:r,onAnchorChange:o,children:n})};wr.displayName=Vt;var vr="PopperAnchor",Er=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=xr(vr,n),i=f.useRef(null),l=Ae(t,i),c=f.useRef(null);return f.useEffect(()=>{const a=c.current;c.current=r?.current||i.current,a!==c.current&&s.onAnchorChange(c.current)}),r?null:h.jsx(Re.div,{...o,ref:l})});Er.displayName=vr;var Wt="PopperContent",[Zi,Qi]=br(Wt),Ar=f.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:a=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:b,...y}=e,w=xr(Wt,n),[x,E]=f.useState(null),O=Ae(t,ee=>E(ee)),[S,k]=f.useState(null),N=Xi(S),T=N?.width??0,v=N?.height??0,I=r+(s!=="center"?"-"+s:""),D=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},B=Array.isArray(a)?a:[a],F=B.length>0,U={padding:D,boundary:B.filter(ta),altBoundary:F},{refs:z,floatingStyles:G,placement:L,isPositioned:M,middlewareData:_}=ji({strategy:"fixed",placement:I,whileElementsMounted:(...ee)=>ki(...ee,{animationFrame:p==="always"}),elements:{reference:w.anchor},middleware:[Fi({mainAxis:o+v,alignmentAxis:i}),c&&Gi({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Vi():void 0,...U}),c&&Wi({...U}),Hi({...U,apply:({elements:ee,rects:ze,availableWidth:W,availableHeight:Ye})=>{const{width:Se,height:Te}=ze.reference,fe=ee.floating.style;fe.setProperty("--radix-popper-available-width",`${W}px`),fe.setProperty("--radix-popper-available-height",`${Ye}px`),fe.setProperty("--radix-popper-anchor-width",`${Se}px`),fe.setProperty("--radix-popper-anchor-height",`${Te}px`)}}),S&&Yi({element:S,padding:l}),na({arrowWidth:T,arrowHeight:v}),m&&Bi({strategy:"referenceHidden",...U})]}),[V,R]=Sr(L),Me=lt(b);we(()=>{M&&Me?.()},[M,Me]);const He=_.arrow?.x,Be=_.arrow?.y,De=_.arrow?.centerOffset!==0,[Y,q]=f.useState();return we(()=>{x&&q(window.getComputedStyle(x).zIndex)},[x]),h.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:M?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[_.transformOrigin?.x,_.transformOrigin?.y].join(" "),..._.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(Zi,{scope:n,placedSide:V,onArrowChange:k,arrowX:He,arrowY:Be,shouldHideArrow:De,children:h.jsx(Re.div,{"data-side":V,"data-align":R,...y,ref:O,style:{...y.style,animation:M?void 0:"none"}})})})});Ar.displayName=Wt;var Cr="PopperArrow",ea={top:"bottom",right:"left",bottom:"top",left:"right"},Rr=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Qi(Cr,r),i=ea[s.placedSide];return h.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:h.jsx(Ki,{...o,ref:n,style:{...o.style,display:"block"}})})});Rr.displayName=Cr;function ta(e){return e!==null}var na=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,l=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[a,u]=Sr(n),d={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,p=(o.arrow?.y??0)+c/2;let b="",y="";return a==="bottom"?(b=i?d:`${m}px`,y=`${-c}px`):a==="top"?(b=i?d:`${m}px`,y=`${r.floating.height+c}px`):a==="right"?(b=`${-c}px`,y=i?d:`${p}px`):a==="left"&&(b=`${r.floating.width+c}px`,y=i?d:`${p}px`),{data:{x:b,y}}}});function Sr(e){const[t,n="center"]=e.split("-");return[t,n]}var ra=wr,oa=Er,sa=Ar,ia=Rr;function aa(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var Tr=e=>{const{present:t,children:n}=e,r=la(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),s=Ae(r.ref,ca(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:s}):null};Tr.displayName="Presence";function la(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),s=f.useRef("none"),i=e?"mounted":"unmounted",[l,c]=aa(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const a=Ze(r.current);s.current=l==="mounted"?a:"none"},[l]),we(()=>{const a=r.current,u=o.current;if(u!==e){const m=s.current,p=Ze(a);e?c("MOUNT"):p==="none"||a?.display==="none"?c("UNMOUNT"):c(u&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),we(()=>{if(t){let a;const u=t.ownerDocument.defaultView??window,d=p=>{const y=Ze(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&y&&(c("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",a=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},m=p=>{p.target===t&&(s.current=Ze(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(a),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:f.useCallback(a=>{r.current=a?getComputedStyle(a):null,n(a)},[])}}function Ze(e){return e?.animationName||"none"}function ca(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ua=Symbol("radix.slottable");function da(e){const t=({children:n})=>h.jsx(h.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=ua,t}var fa=f[" useInsertionEffect ".trim().toString()]||we;function ma({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=pa({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:o;{const u=f.useRef(e!==void 0);f.useEffect(()=>{const d=u.current;d!==l&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,r])}const a=f.useCallback(u=>{if(l){const d=ga(u)?u(e):u;d!==e&&i.current?.(d)}else s(u)},[l,e,s,i]);return[c,a]}function pa({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),s=f.useRef(t);return fa(()=>{s.current=t},[t]),f.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function ga(e){return typeof e=="function"}var ha=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ba="VisuallyHidden",Or=f.forwardRef((e,t)=>h.jsx(Re.span,{...e,ref:t,style:{...ha,...e.style}}));Or.displayName=ba;var ya=Or,[mt]=tr("Tooltip",[yr]),pt=yr(),kr="TooltipProvider",xa=700,kt="tooltip.open",[wa,Ht]=mt(kr),Nr=e=>{const{__scopeTooltip:t,delayDuration:n=xa,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=f.useRef(!0),l=f.useRef(!1),c=f.useRef(0);return f.useEffect(()=>{const a=c.current;return()=>window.clearTimeout(a)},[]),h.jsx(wa,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:f.useCallback(a=>{l.current=a},[]),disableHoverableContent:o,children:s})};Nr.displayName=kr;var Ge="Tooltip",[va,gt]=mt(Ge),Pr=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:l}=e,c=Ht(Ge,e.__scopeTooltip),a=pt(t),[u,d]=f.useState(null),m=Vs(),p=f.useRef(0),b=i??c.disableHoverableContent,y=l??c.delayDuration,w=f.useRef(!1),[x,E]=ma({prop:r,defaultProp:o??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(kt))):c.onClose(),s?.(T)},caller:Ge}),O=f.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),S=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,w.current=!1,E(!0)},[E]),k=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,E(!1)},[E]),N=f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{w.current=!0,E(!0),p.current=0},y)},[y,E]);return f.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),h.jsx(ra,{...a,children:h.jsx(va,{scope:t,contentId:m,open:x,stateAttribute:O,trigger:u,onTriggerChange:d,onTriggerEnter:f.useCallback(()=>{c.isOpenDelayedRef.current?N():S()},[c.isOpenDelayedRef,N,S]),onTriggerLeave:f.useCallback(()=>{b?k():(window.clearTimeout(p.current),p.current=0)},[k,b]),onOpen:S,onClose:k,disableHoverableContent:b,children:n})})};Pr.displayName=Ge;var Nt="TooltipTrigger",_r=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=gt(Nt,n),s=Ht(Nt,n),i=pt(n),l=f.useRef(null),c=Ae(t,l,o.onTriggerChange),a=f.useRef(!1),u=f.useRef(!1),d=f.useCallback(()=>a.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),h.jsx(oa,{asChild:!0,...i,children:h.jsx(Re.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:ae(e.onPointerMove,m=>{m.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:ae(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:ae(e.onPointerDown,()=>{o.open&&o.onClose(),a.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:ae(e.onFocus,()=>{a.current||o.onOpen()}),onBlur:ae(e.onBlur,o.onClose),onClick:ae(e.onClick,o.onClose)})})});_r.displayName=Nt;var Ea="TooltipPortal",[Ha,Aa]=mt(Ea,{forceMount:void 0}),$e="TooltipContent",$r=f.forwardRef((e,t)=>{const n=Aa($e,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=gt($e,e.__scopeTooltip);return h.jsx(Tr,{present:r||i.open,children:i.disableHoverableContent?h.jsx(Ir,{side:o,...s,ref:t}):h.jsx(Ca,{side:o,...s,ref:t})})}),Ca=f.forwardRef((e,t)=>{const n=gt($e,e.__scopeTooltip),r=Ht($e,e.__scopeTooltip),o=f.useRef(null),s=Ae(t,o),[i,l]=f.useState(null),{trigger:c,onClose:a}=n,u=o.current,{onPointerInTransitChange:d}=r,m=f.useCallback(()=>{l(null),d(!1)},[d]),p=f.useCallback((b,y)=>{const w=b.currentTarget,x={x:b.clientX,y:b.clientY},E=ka(x,w.getBoundingClientRect()),O=Na(x,E),S=Pa(y.getBoundingClientRect()),k=$a([...O,...S]);l(k),d(!0)},[d]);return f.useEffect(()=>()=>m(),[m]),f.useEffect(()=>{if(c&&u){const b=w=>p(w,u),y=w=>p(w,c);return c.addEventListener("pointerleave",b),u.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",b),u.removeEventListener("pointerleave",y)}}},[c,u,p,m]),f.useEffect(()=>{if(i){const b=y=>{const w=y.target,x={x:y.clientX,y:y.clientY},E=c?.contains(w)||u?.contains(w),O=!_a(x,i);E?m():O&&(m(),a())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,u,i,a,m]),h.jsx(Ir,{...e,ref:s})}),[Ra,Sa]=mt(Ge,{isInside:!1}),Ta=da("TooltipContent"),Ir=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...l}=e,c=gt($e,n),a=pt(n),{onClose:u}=c;return f.useEffect(()=>(document.addEventListener(kt,u),()=>document.removeEventListener(kt,u)),[u]),f.useEffect(()=>{if(c.trigger){const d=m=>{m.target?.contains(c.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,u]),h.jsx(rr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:h.jsxs(sa,{"data-state":c.stateAttribute,...a,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(Ta,{children:r}),h.jsx(Ra,{scope:n,isInside:!0,children:h.jsx(ya,{id:c.contentId,role:"tooltip",children:o||r})})]})})});$r.displayName=$e;var Lr="TooltipArrow",Oa=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=pt(n);return Sa(Lr,n).isInside?null:h.jsx(ia,{...o,...r,ref:t})});Oa.displayName=Lr;function ka(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Na(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Pa(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function _a(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const l=t[s],c=t[i],a=l.x,u=l.y,d=c.x,m=c.y;u>r!=m>r&&n<(d-a)*(r-u)/(m-u)+a&&(o=!o)}return o}function $a(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Ia(t)}function Ia(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var La=Nr,Ma=Pr,Da=_r,Mr=$r;const za=La,ja=Ma,Ua=Da,Dr=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(Mr,{ref:r,sideOffset:t,className:ue("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n}));Dr.displayName=Mr.displayName;const Fa="agent-approval-count-changed";function Ga(e,t){if(e.length>0){const n=e[e.length-1];if(n&&typeof n=="object"&&!Array.isArray(n))return[...e.slice(0,-1),{...n,signal:t}]}return[...e,{signal:t}]}function Va(e,t={}){const{domain:n="server",onSuccess:r,onError:o}=t,[s,i]=$.useState(!1),[l,c]=$.useState(null),[a,u]=$.useState(null),d=$.useRef(!0),m=$.useRef(null);$.useEffect(()=>(d.current=!0,()=>{d.current=!1,m.current&&m.current.abort()}),[]);const p=$.useCallback(()=>{d.current&&(c(null),u(null))},[]),b=$.useCallback(async(...y)=>{m.current&&m.current.abort();const w=new AbortController;m.current=w,d.current&&(i(!0),c(null));try{const x=await e(...Ga(y,w.signal));return!d.current||w.signal.aborted?null:(u(x),r?.(x),x)}catch(x){if(!d.current||w.signal.aborted)return null;if(x instanceof J){if(x.domain=n,x.status===401)return null;x.status===408&&(x.message=`${n} timed out. Check your connection and try again.`)}return c(x),o?.(x),null}finally{m.current===w&&(m.current=null),d.current&&!w.signal.aborted&&i(!1)}},[e,n,o,r]);return{loading:s,error:l,data:a,execute:b,reset:p}}function Wa(){const[e,t]=$.useState(null),n=$.useCallback((o,s="error")=>{t({message:String(o),type:s}),setTimeout(()=>t(null),4e3)},[]),r=$.useCallback(()=>t(null),[]);return{toast:e,showToast:n,clearToast:r}}exports.API_BASE=Et;exports.APPROVAL_EVENT=Fa;exports.AdminAccessRequired=vo;exports.ApiError=J;exports.AppShell=mo;exports.AuthProvider=io;exports.Button=qn;exports.Card=Kn;exports.CardContent=Qn;exports.CardDescription=Zn;exports.CardFooter=er;exports.CardHeader=Xn;exports.CardTitle=Jn;exports.DomainError=xo;exports.EmptyState=Eo;exports.FEATURE_FLAGS=Wr;exports.LoadingPanel=yo;exports.ProtectedRoute=po;exports.ROUTES=Ve;exports.SystemProvider=ao;exports.Toast=bo;exports.Tooltip=ja;exports.TooltipContent=Dr;exports.TooltipProvider=za;exports.TooltipTrigger=Ua;exports.VersionMismatchBanner=ho;exports.adminRequest=Gr;exports.authRequest=En;exports.authRequestExternal=Vr;exports.bootIdentity=Rn;exports.buildApiUrl=xn;exports.buttonVariants=Yn;exports.clearStoredToken=ke;exports.cn=ue;exports.getStoredToken=pe;exports.loginUser=An;exports.registerUser=Cn;exports.request=Ee;exports.requestAbsolute=$t;exports.safeArray=jr;exports.safeMap=vt;exports.setStoredToken=At;exports.taggedRequest=Fr;exports.unwrapEnvelope=it;exports.useAdminApiGuard=wo;exports.useApiCall=Va;exports.useAuth=at;exports.useSystem=kn;exports.useToast=Wa;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),$=require("react"),Ne=require("react-router-dom"),Vr=require("react-dom");function yn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const f=yn($),xn=yn(Vr);function Hr(e){return Array.isArray(e)?e:e==null?[]:[]}function Et(e,t){return Array.isArray(e)?e.map(t):(console.warn("safeMap prevented crash. Value:",e),[])}const At="".replace(/\/$/,""),_t="token",Nt="aindy_token",wn=globalThis.__AINDY_APP_VERSION_OVERRIDE__||"2.1.0",Br=new Set(["agents","allowed_auto_grant_tools","allowed_capabilities","analyses","drop_points","end","error_rate_series","events","feedback","fields","findings","flows","generations","granted_tools","history","items","jobs","logs","memories","nodes","plans","pings","recent","recent_authors","recent_changes","recent_errors","recent_ripples","results","runs","steps","strategies","suggestions","tags","timeline","tools"]);class K extends Error{constructor(t,n,r){super(n),this.name="ApiError",this.status=t,this.body=r}}function Yr(e,t){return function(...n){return t(...n).catch(r=>{throw r instanceof K&&(r.domain=e),r})}}const qr="X-AINDY-Envelope",vn=Symbol.for("aindy.ui-kit.envelope.resolved");let Bt=!1;function Yt(e,t){return e!==null&&typeof e=="object"&&Object.defineProperty(e,vn,{value:t,enumerable:!1,configurable:!0}),e}function Xr(e){if(e&&typeof e=="object"){if("error"in e&&e.error)throw new K(200,e.error,e);return e.data!==void 0?e.data:null}return e}function En(e,t){const n=e.headers?.get?.(qr);return n?(Bt=!0,Yt(Xr(t),n)):Bt?Yt(t,null):t}function xe(e){if(e!==null&&typeof e=="object"&&vn in e)return e;if(e&&typeof e=="object"&&"data"in e){if("error"in e&&e.error)throw new K(200,e.error,e);return e.data!==void 0?e.data:e}return e}function We(e){if(Array.isArray(e))return Et(e,n=>We(n));if(!e||typeof e!="object")return e;const t={};for(const[n,r]of Object.entries(e)){if(Br.has(n)){t[n]=Array.isArray(r)?Et(r,o=>We(o)):[];continue}t[n]=We(r)}return t}function ce(){return localStorage.getItem(_t)||localStorage.getItem(Nt)||""}function Ge(e){localStorage.setItem(_t,e),localStorage.setItem(Nt,e)}function _e(){localStorage.removeItem(_t),localStorage.removeItem(Nt)}function An(e){return/^https?:\/\//i.test(e)?e:At?`${At}${e}`:e}function Sn(){typeof window>"u"||typeof window.dispatchEvent!="function"||window.dispatchEvent(new CustomEvent("aindy:session-expired"))}function Rn(e){typeof window>"u"||typeof window.dispatchEvent!="function"||window.dispatchEvent(new CustomEvent("aindy:version-warning",{detail:{message:e}}))}async function ee(e,t={}){const n=An(e),r=ce(),o=new AbortController,{_isRetry:s=!1,...i}=t,a=typeof window<"u"?setTimeout(()=>o.abort(),3e4):null;i.signal&&(i.signal.aborted?o.abort():i.signal.addEventListener("abort",()=>o.abort(),{once:!0}));try{const l=await fetch(n,{...i,signal:o.signal,headers:{"Content-Type":"application/json","X-Client-Version":wn,...r?{Authorization:`Bearer ${r}`}:{},...i.headers||{}}}),c=l.headers?.get?.("X-Version-Warning");if(c&&typeof window<"u"&&(console.warn("[API Version Warning]",c),Rn(c)),l.status===503){const m=parseInt(l.headers.get("Retry-After")||"0",10);if(m>0&&m<=60&&!s)return await new Promise(p=>setTimeout(p,m*1e3)),ee(e,{...i,_isRetry:!0})}if(!l.ok){const m=await l.text(),p=new K(l.status,`API Error (${l.status}): ${m}`,m);throw l.status===401&&Sn(),p}const d=await l.text();let u;try{u=We(JSON.parse(d))}catch{return d}return En(l,u)}catch(l){throw l?.name==="AbortError"?new K(408,"Request timed out after 30 seconds.",null):l instanceof TypeError&&!l.status?new K(0,"Network error. Check your connection.",null):l}finally{a&&clearTimeout(a)}}function Cn(e,t={}){return ee(e,{...t})}function Kr(e,t={}){const n=ce();let r=!1;if(n)try{const[,o=""]=n.split("."),s=o.replace(/-/g,"+").replace(/_/g,"/"),i=s.padEnd(Math.ceil(s.length/4)*4,"=");r=JSON.parse(atob(i))?.is_admin===!0}catch{r=!1}return r?Cn(e,t):Promise.reject(new K(403,"Admin privileges required for this operation.",null))}async function $t(e,t={}){const n=ce(),r=new AbortController,{_isRetry:o=!1,...s}=t,i=typeof window<"u"?setTimeout(()=>r.abort(),3e4):null;s.signal&&(s.signal.aborted?r.abort():s.signal.addEventListener("abort",()=>r.abort(),{once:!0}));try{const a=await fetch(e,{...s,signal:r.signal,headers:{"Content-Type":"application/json","X-Client-Version":wn,...n?{Authorization:`Bearer ${n}`}:{},...s.headers||{}}}),l=a.headers?.get?.("X-Version-Warning");if(l&&typeof window<"u"&&(console.warn("[API Version Warning]",l),Rn(l)),a.status===503){const u=parseInt(a.headers.get("Retry-After")||"0",10);if(u>0&&u<=60&&!o)return await new Promise(m=>setTimeout(m,u*1e3)),$t(e,{...s,_isRetry:!0})}if(!a.ok){const u=await a.text(),m=new K(a.status,`API Error (${a.status}): ${u}`,u);throw a.status===401&&Sn(),m}const c=await a.text();let d;try{d=We(JSON.parse(c))}catch{return c}return En(a,d)}catch(a){throw a?.name==="AbortError"?new K(408,"Request timed out after 30 seconds.",null):a instanceof TypeError&&!a.status?new K(0,"Network error. Check your connection.",null):a}finally{i&&clearTimeout(i)}}function Jr(e,t={}){return $t(e,{...t})}const h="",z=`${h}/apps`,ne=`${h}/platform`,Zr=Object.freeze({OPERATOR_FLOW_STRATEGIES:!0,OPERATOR_AUTOMATION_LOGS:!1,OPERATOR_SCHEDULER_STATUS:!1,RIPPLETRACE_VIEWER:!1}),Qr=Object.freeze({LOGIN:`${h}/auth/login`,REGISTER:`${h}/auth/register`,LOGOUT:`${h}/auth/logout`,VERIFY_EMAIL:`${h}/auth/verify-email`,PASSWORD_CHANGE:`${h}/auth/password/change`,PASSWORD_FORGOT:`${h}/auth/password/forgot`,PASSWORD_RESET:`${h}/auth/password/reset`}),eo=Object.freeze({LIST:`${h}/tasks/list`,CREATE:`${h}/tasks/create`,COMPLETE:`${h}/tasks/complete`,START:`${h}/tasks/start`}),to=Object.freeze({ANALYZE:`${h}/arm/analyze`,GENERATE:`${h}/arm/generate`,LOGS:`${h}/arm/logs`,CONFIG:`${h}/arm/config`,METRICS:`${h}/arm/metrics`,CONFIG_SUGGESTIONS:`${h}/arm/config/suggest`}),no=Object.freeze({CREATE_RUN:`${z}/agent/run`,RUNS:`${z}/agent/runs`,RUN:e=>`${z}/agent/runs/${e}`,APPROVE:e=>`${z}/agent/runs/${e}/approve`,REJECT:e=>`${z}/agent/runs/${e}/reject`,RECOVER:e=>`${z}/agent/runs/${e}/recover`,REPLAY:e=>`${z}/agent/runs/${e}/replay`,STEPS:e=>`${z}/agent/runs/${e}/steps`,EVENTS:e=>`${z}/agent/runs/${e}/events`,TOOLS:`${z}/agent/tools`,TRUST:`${z}/agent/trust`,SUGGESTIONS:`${z}/agent/suggestions`}),ro=Object.freeze({LINKEDIN_MANUAL:`${h}/analytics/linkedin/manual`,MASTERPLAN_SUMMARY:e=>`${h}/analytics/masterplan/${e}/summary`,CALCULATE_TWR:`${h}/calculate_twr`,CALCULATE_ENGAGEMENT:`${h}/calculate_engagement`,CALCULATE_AI_EFFICIENCY:`${h}/calculate_ai_efficiency`,CALCULATE_IMPACT_SCORE:`${h}/calculate_impact_score`,CALCULATE_INCOME_EFFICIENCY:`${h}/income_efficiency`,CALCULATE_REVENUE_SCALING:`${h}/revenue_scaling`,CALCULATE_EXECUTION_SPEED:`${h}/execution_speed`,CALCULATE_ATTENTION_VALUE:`${h}/attention_value`,CALCULATE_ENGAGEMENT_RATE:`${h}/engagement_rate`,CALCULATE_BUSINESS_GROWTH:`${h}/business_growth`,CALCULATE_MONETIZATION_EFFICIENCY:`${h}/monetization_efficiency`,CALCULATE_AI_PRODUCTIVITY_BOOST:`${h}/ai_productivity_boost`,CALCULATE_DECISION_EFFICIENCY:`${h}/decision_efficiency`,CALCULATE_LOST_POTENTIAL:`${h}/lost_potential`,SCORES_ME:`${h}/scores/me`,SCORES_RECALCULATE:`${h}/scores/me/recalculate`,SCORES_HISTORY:`${h}/scores/me/history`,SCORES_FEEDBACK:`${h}/scores/feedback`}),oo=Object.freeze({ORDERS:`${h}/freelance/orders`,FEEDBACK:`${h}/freelance/feedback`,METRICS_LATEST:`${h}/freelance/metrics/latest`}),so=Object.freeze({BOOT:`${h}/identity/boot`,PROFILE:`${h}/identity/`,EVOLUTION:`${h}/identity/evolution`,CONTEXT:`${h}/identity/context`}),io=Object.freeze({GENESIS_SESSION:`${h}/genesis/session`,GENESIS_MESSAGE:`${h}/genesis/message`,GENESIS_SESSION_BY_ID:e=>`${h}/genesis/session/${e}`,GENESIS_SYNTHESIZE:`${h}/genesis/synthesize`,GENESIS_DRAFT:e=>`${h}/genesis/draft/${e}`,GENESIS_LOCK:`${h}/genesis/lock`,GENESIS_AUDIT:`${h}/genesis/audit`,PLANS:`${h}/masterplans/`,PLAN:e=>`${h}/masterplans/${e}`,PLAN_ACTIVATE:e=>`${h}/masterplans/${e}/activate`,PLAN_ANCHOR:e=>`${h}/masterplans/${e}/anchor`,PLAN_PROJECTION:e=>`${h}/masterplans/${e}/projection`}),ao=Object.freeze({AGENTS:`${z}/memory/agents`,AGENT_RECALL:e=>`${z}/memory/agents/${e}/recall`,FEDERATED_RECALL:`${z}/memory/federated/recall`,NODES:`${z}/memory/nodes`,RECALL_V3:`${z}/memory/recall/v3`,SUGGEST:`${z}/memory/suggest`,NODE_FEEDBACK:e=>`${z}/memory/nodes/${e}/feedback`,NODE_PERFORMANCE:e=>`${z}/memory/nodes/${e}/performance`,NODE_TRAVERSE:e=>`${z}/memory/nodes/${e}/traverse`,NODE_HISTORY:e=>`${z}/memory/nodes/${e}/history`,NODE_SHARE:e=>`${z}/memory/nodes/${e}/share`,METRICS_DASHBOARD:`${z}/memory/metrics/dashboard`}),lo=Object.freeze({RESEARCH_QUERY:`${h}/research/query`,HISTORY:`${h}/search/history`,HISTORY_ITEM:e=>`${h}/search/history/${e}`,LEAD_GEN:`${h}/leadgen/`,ANALYZE_SEO:`${h}/analyze_seo/`,GENERATE_META:`${h}/generate_meta/`,SUGGEST_IMPROVEMENTS:`${h}/suggest_improvements/`}),co=Object.freeze({PROFILE_BY_USERNAME:e=>`${h}/social/profile/${e}`,PROFILE:`${h}/social/profile`,FEED:`${h}/social/feed`,POST:`${h}/social/post`,ANALYTICS:`${h}/social/analytics`,INTERACT:e=>`${h}/social/posts/${e}/interact`}),uo=Object.freeze({DROP_POINTS:`${h}/rippletrace/drop_points`,PINGS:`${h}/rippletrace/pings`,RECENT:`${h}/rippletrace/recent`,TRACE:e=>`${h}/rippletrace/ripples/${e}`,TRACE_GRAPH:e=>`${h}/rippletrace/${encodeURIComponent(e)}`,CAUSAL_GRAPH:`${h}/rippletrace/causal/graph`,CAUSAL_CHAIN:e=>`${h}/rippletrace/causal/chain/${encodeURIComponent(e)}`,NARRATIVE_SUMMARY:`${h}/rippletrace/narrative/summary`,DROP_POINT_NARRATIVE:e=>`${h}/rippletrace/narrative/${encodeURIComponent(e)}`,PREDICTIONS_SUMMARY:`${h}/rippletrace/predictions/summary`,DROP_POINT_PREDICTION:e=>`${h}/rippletrace/predictions/${encodeURIComponent(e)}`,SYSTEM_RECOMMENDATIONS:`${h}/rippletrace/recommendations/system`,RECOMMENDATIONS_SUMMARY:`${h}/rippletrace/recommendations/summary`,DROP_POINT_RECOMMENDATION:e=>`${h}/rippletrace/recommendations/${encodeURIComponent(e)}`,LEARNING_STATS:`${h}/rippletrace/learning/stats`,EVALUATE_LEARNING_OUTCOME:e=>`${h}/rippletrace/learning/evaluate/${encodeURIComponent(e)}`,ADJUST_LEARNING_THRESHOLDS:`${h}/rippletrace/learning/adjust`,PLAYBOOKS:`${h}/rippletrace/playbooks`,PLAYBOOK:e=>`${h}/rippletrace/playbooks/${encodeURIComponent(e)}`,MATCH_PLAYBOOKS:e=>`${h}/rippletrace/playbooks/match/${encodeURIComponent(e)}`,STRATEGIES:`${h}/rippletrace/strategies`,BUILD_STRATEGIES:`${h}/rippletrace/strategies/build`,STRATEGY:e=>`${h}/rippletrace/strategies/${encodeURIComponent(e)}`,MATCH_STRATEGIES:e=>`${h}/rippletrace/strategies/match/${encodeURIComponent(e)}`,EVENT_DOWNSTREAM:e=>`${h}/rippletrace/event/${encodeURIComponent(e)}/downstream`,EVENT_UPSTREAM:e=>`${h}/rippletrace/event/${encodeURIComponent(e)}/upstream`}),fo=Object.freeze({FLOW_RUNS:`${ne}/flows/runs`,FLOW_RUN:e=>`${ne}/flows/runs/${e}`,FLOW_RUN_HISTORY:e=>`${ne}/flows/runs/${e}/history`,FLOW_RUN_RESUME:e=>`${ne}/flows/runs/${e}/resume`,FLOW_REGISTRY:`${ne}/flows/registry`,FLOW_STRATEGIES:`${ne}/flows/strategies`,RIPPLETRACE_STATUS:`${ne}/observability/rippletrace/status`,OBSERVABILITY_REQUESTS:`${ne}/observability/requests`,OBSERVABILITY_DASHBOARD:`${ne}/observability/dashboard`,CLIENT_ERROR:`${h}/client/error`,CLIENT_VITALS:`${h}/client/vitals`,AUTOMATION_LOGS:`${h}/automation/logs`,AUTOMATION_LOG:e=>`${h}/automation/logs/${e}`,AUTOMATION_REPLAY:e=>`${h}/automation/logs/${e}/replay`,SCHEDULER_STATUS:`${ne}/observability/scheduler/status`}),mo=Object.freeze({DASHBOARD_OVERVIEW:`${h}/dashboard/overview`,HEALTH_DETAILS:`${h}/health/details`,INFLUENCE_GRAPH:`${h}/influence_graph`,CAUSAL_GRAPH:`${h}/causal_graph`,NARRATIVE:e=>`${h}/narrative/${e}`,HEALTH:`${h}/health`,HEALTH_DEEP:`${h}/health/deep`,HEALTH_DOMAINS:`${h}/health/domains`,VERSION:`${h}/api/version`}),fe=Object.freeze({AUTH:Qr,TASKS:eo,ARM:to,AGENT:no,ANALYTICS:ro,FREELANCE:oo,IDENTITY:so,MASTERPLAN:io,MEMORY:ao,SEARCH:lo,SOCIAL:co,RIPPLETRACE:uo,OPERATOR:fo,PLATFORM:mo});function Tn(e){return ee(fe.AUTH.LOGIN,{method:"POST",body:JSON.stringify(e)}).then(xe)}function On(e){return ee(fe.AUTH.REGISTER,{method:"POST",body:JSON.stringify(e)}).then(xe)}function kn(e){return ee(fe.AUTH.VERIFY_EMAIL,{method:"POST",body:JSON.stringify({token:e})}).then(xe)}function Pn(e,t,n=ce()){return ee(fe.AUTH.PASSWORD_CHANGE,{method:"POST",headers:n?{Authorization:`Bearer ${n}`}:{},body:JSON.stringify({current_password:e,new_password:t})}).then(xe)}function po(e){return ee(fe.AUTH.PASSWORD_FORGOT,{method:"POST",body:JSON.stringify({email:e})}).then(xe)}function go(e,t){return ee(fe.AUTH.PASSWORD_RESET,{method:"POST",body:JSON.stringify({token:e,new_password:t})}).then(xe)}function ho(e=ce()){return ee(fe.AUTH.LOGOUT,{method:"POST",headers:e?{Authorization:`Bearer ${e}`}:{}}).catch(()=>null)}function _n(e=ce()){return ee(fe.IDENTITY.BOOT,{method:"GET",headers:e?{Authorization:`Bearer ${e}`}:{}}).then(xe)}const Nn=$.createContext(null);function $n(e){if(!e)return null;try{const[,t=""]=e.split("."),n=t.replace(/-/g,"+").replace(/_/g,"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return JSON.parse(window.atob(r))}catch{return null}}function bt(e){const t=$n(e);return!t||typeof t.exp!="number"?!1:Date.now()/1e3>t.exp-30}function bo({children:e}){const[t,n]=$.useState(()=>{const u=ce();return u&&bt(u)?(_e(),null):u||null}),r=$.useMemo(()=>{const u=$n(t);return u?{...u,is_admin:u?.is_admin===!0}:null},[t]),o=r?.is_admin===!0;$.useEffect(()=>{const u=ce();if(u&&bt(u)){_e(),n(null);return}n(u||null)},[]),$.useEffect(()=>{if(!t)return;const u=setInterval(()=>{bt(t)&&(_e(),n(null))},6e4);return()=>clearInterval(u)},[t]),$.useEffect(()=>{const u=()=>{_e(),n(null)};return window.addEventListener("aindy:session-expired",u),()=>window.removeEventListener("aindy:session-expired",u)},[]);const s=async(u,m)=>{const g=(await Tn({email:u,password:m}))?.access_token;if(!g)throw new Error("Authentication did not return an access token.");return Ge(g),n(g),g},i=async(u,m,p=null)=>{const y=(await On({email:u,password:m,username:p}))?.access_token;return y?(Ge(y),n(y),{verificationSent:!1,token:y}):{verificationSent:!0,token:null}},a=async u=>{const p=(await kn(u))?.access_token;if(!p)throw new Error("Verification did not return an access token.");return Ge(p),n(p),p},l=async(u,m)=>{const g=(await Pn(u,m))?.access_token;return g&&(Ge(g),n(g)),g??null},c=()=>{ho(),_e(),n(null)},d=$.useMemo(()=>({token:t,user:r,isAdmin:o,isAuthenticated:!!t,login:s,register:i,verify:a,changeOwnPassword:l,logout:c,setToken:n}),[t,r,o]);return b.jsx(Nn.Provider,{value:d,children:e})}function lt(){const e=$.useContext(Nn);if(!e)throw new Error("useAuth must be used within AuthProvider.");return e}const In=$.createContext(null),Pe={user_id:null,memory:[],runs:[],metrics:null,flows:[],runtime:{boot_mode:"unknown",boot_profile:"unknown",boot_profile_source:"unknown",app_plugins_loaded:!1,app_plugin_count:0,ui_mode:"app-profile",default_route:"/dashboard",platform_home:"/platform/agent"},system_state:{memory_count:0,active_runs:0,score:null,active_flows:0}};function yo({children:e,skipBoot:t=!1}){const{token:n,logout:r}=lt(),[o,s]=$.useState(Pe),[i,a]=$.useState(!1),[l,c]=$.useState(!1),[d,u]=$.useState(""),m=$.useRef(null),p=()=>{s(Pe),c(!1),u(""),m.current=null},g=async(w=n)=>{if(!w)return p(),Pe;a(!0),u("");try{const x=await _n(w);return s({...Pe,...x,memory:x?.memory||[],runs:x?.runs||[],flows:x?.flows||[],metrics:x?.metrics||null,runtime:{...Pe.runtime,...x?.runtime||{}},system_state:{...Pe.system_state,...x?.system_state||{}}}),c(!0),m.current=w,x}catch(x){const E=x instanceof Error?x.message:"Failed to boot identity context.";throw u(E),c(!1),x instanceof K&&x.status===401&&r(),x}finally{a(!1)}};$.useEffect(()=>{if(t){if(!n){p();return}c(!0),u(""),m.current=n;return}if(!n){p();return}m.current===n&&l||g(n).catch(()=>{})},[n,l,t]);const y=$.useMemo(()=>({system:o,setSystem:s,clearSystem:p,bootSystem:g,booting:i,booted:l,bootError:d}),[o,i,l,d]);return b.jsx(In.Provider,{value:y,children:e})}function Ln(){const e=$.useContext(In);if(!e)throw new Error("useSystem must be used within SystemProvider.");return e}const xo="/platform",wo=e=>`${xo}${e}`,vo=[{title:"PLATFORM",adminOnly:!0,runtimeOnlySafe:!0,links:[{to:"/agent",label:"Agent Console",external:!0},{to:"/flows",label:"Flow Engine",external:!0},{to:"/observability",label:"Observability",external:!0},{to:"/health",label:"Health",external:!0},{to:"/approvals",label:"Approvals",external:!0},{to:"/registry",label:"Registry",external:!0},{to:"/executions",label:"Executions",external:!0,runtimeOnlySafe:!1},{to:"/trace",label:"Ripple Trace",external:!0,runtimeOnlySafe:!1}]},{title:"WORKSPACE",runtimeOnlySafe:!1,links:[{to:"/dashboard",label:"Dashboard"},{to:"/tasks",label:"Tasks"},{to:"/masterplan",label:"MasterPlan"}]},{title:"ANALYTICS",runtimeOnlySafe:!1,links:[{to:"/analytics",label:"Analytics"},{to:"/kpi",label:"KPI Snapshot"}]},{title:"GROWTH",runtimeOnlySafe:!1,links:[{to:"/search/research",label:"Research"},{to:"/search/leadgen",label:"Lead Gen"},{to:"/social",label:"Social Feed"},{to:"/freelance",label:"Freelance"}]},{title:"AI TOOLS",runtimeOnlySafe:!1,links:[{to:"/arm/analyze",label:"ARM Analyze"},{to:"/arm/config",label:"ARM Config"},{to:"/arm/config/suggest",label:"ARM Suggest"},{to:"/arm/config/generate",label:"ARM Generate"},{to:"/arm/config/logs",label:"ARM Logs"},{to:"/arm/config/metrics",label:"ARM Metrics"}]},{title:"RUNTIME",runtimeOnlySafe:!0,links:[{to:"/identity",label:"Identity"},{to:"/memory",label:"Memory"}]}];function Eo({to:e,label:t,onNavigate:n,external:r=!1}){const o=["block rounded-2xl border px-3 py-2 text-sm transition-colors","border-zinc-800/60 bg-zinc-950/40 text-zinc-400 hover:border-zinc-700 hover:bg-zinc-900/70 hover:text-zinc-100"];if(r){const s=typeof window<"u"&&window.location.pathname.startsWith("/platform");return b.jsx("a",{href:wo(e),onClick:n,target:"_self",className:["block rounded-2xl border px-3 py-2 text-sm transition-colors",s?"border-[#00ffaa]/30 bg-[#00ffaa]/10 text-[#00ffaa]":"border-zinc-800/60 bg-zinc-950/40 text-zinc-400 hover:border-zinc-700 hover:bg-zinc-900/70 hover:text-zinc-100"].join(" "),children:t})}return b.jsx(Ne.NavLink,{to:e,onClick:n,className:({isActive:s})=>[...o,s?"border-[#00ffaa]/30 bg-[#00ffaa]/10 text-[#00ffaa]":""].join(" "),children:t})}function Ao(){const{isAdmin:e,logout:t,user:n}=lt(),{system:r}=Ln(),[o,s]=$.useState(!1),i=r?.runtime?.boot_mode==="runtime-only",a=$.useMemo(()=>vo.filter(l=>!l.adminOnly||e).filter(l=>!i||l.runtimeOnlySafe!==!1).map(l=>({...l,title:l.title==="RUNTIME"&&!i?"IDENTITY":l.title,links:l.links.filter(c=>!i||c.runtimeOnlySafe!==!1)})),[e,i]);return b.jsxs("div",{className:"min-h-screen bg-[#09090b] text-[#fafafa] selection:bg-[#00ffaa]/30 lg:flex",children:[b.jsx("aside",{className:["fixed inset-y-0 left-0 z-40 w-80 border-r border-zinc-800/60 bg-zinc-950/95 backdrop-blur transition-transform lg:static lg:translate-x-0",o?"translate-x-0":"-translate-x-full"].join(" "),children:b.jsxs("div",{className:"flex h-full flex-col",children:[b.jsx("div",{className:"border-b border-zinc-800/60 px-5 py-5",children:b.jsxs("div",{className:"flex items-start justify-between gap-4",children:[b.jsxs("div",{children:[b.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.3em] text-[#00ffaa]",children:"Control Surface"}),b.jsx("h1",{className:"mt-3 text-2xl font-black tracking-tight text-white",children:"A.I.N.D.Y."}),b.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:i?"Runtime-only mode. Platform, memory, and identity surfaces are active.":"Route the workspace, analytics, growth, and platform surfaces."}),i?b.jsx("p",{className:"mt-3 inline-flex rounded-full border border-[#00ffaa]/30 bg-[#00ffaa]/10 px-3 py-1 text-[10px] font-bold uppercase tracking-[0.2em] text-[#00ffaa]",children:"Runtime-Only"}):null]}),b.jsx("button",{type:"button",className:"rounded-xl border border-zinc-800 px-3 py-2 text-xs uppercase tracking-[0.18em] text-zinc-400 lg:hidden",onClick:()=>s(!1),children:"Close"})]})}),b.jsx("nav",{className:"flex-1 space-y-6 overflow-y-auto px-4 py-5 custom-scrollbar",children:a.map(l=>b.jsxs("div",{children:[b.jsx("p",{className:"mb-3 px-2 text-[10px] font-bold uppercase tracking-[0.3em] text-zinc-600",children:l.title}),b.jsx("div",{className:"space-y-2",children:l.links.map(c=>b.jsx(Eo,{to:c.to,label:c.label,external:c.external,onNavigate:()=>s(!1)},c.to))})]},l.title))})]})}),o?b.jsx("button",{type:"button",className:"fixed inset-0 z-30 bg-black/60 lg:hidden",onClick:()=>s(!1)}):null,b.jsxs("div",{className:"flex min-h-screen flex-1 flex-col lg:ml-0",children:[b.jsx("header",{className:"sticky top-0 z-20 border-b border-zinc-800/60 bg-[#09090b]/95 backdrop-blur",children:b.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-4 sm:px-6 lg:px-8",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("button",{type:"button",className:"rounded-2xl border border-zinc-800 bg-zinc-950/70 px-3 py-2 text-[10px] font-bold uppercase tracking-[0.18em] text-zinc-300 lg:hidden",onClick:()=>s(!0),children:"Menu"}),b.jsxs("div",{children:[b.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.3em] text-zinc-600",children:"Navigation Shell"}),b.jsx("p",{className:"text-sm text-zinc-300",children:i?"Intentional platform surface":"Unified workspace routing"})]})]}),b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsxs("div",{className:"hidden rounded-2xl border border-zinc-800 bg-zinc-950/70 px-4 py-2 text-right sm:block",children:[b.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-zinc-600",children:"Active Identity"}),b.jsx("p",{className:"text-sm text-zinc-200",children:n?.email||"Unknown user"})]}),b.jsx("button",{type:"button",onClick:t,className:"rounded-2xl bg-[#00ffaa] px-4 py-2 text-[10px] font-black uppercase tracking-[0.18em] text-black transition-colors hover:bg-[#00ffaa]/80",children:"Logout"})]})]})}),b.jsx("main",{className:"flex-1 overflow-y-auto px-4 py-6 sm:px-6 lg:px-8",children:b.jsx("div",{className:"min-h-full rounded-[28px] border border-zinc-800/60 bg-zinc-950/40 p-4 shadow-2xl shadow-black/20 sm:p-6 lg:p-8",children:b.jsx(Ne.Outlet,{})})})]})]})}function So({requireAdmin:e=!1}){const t=Ne.useLocation(),{isAdmin:n,isAuthenticated:r}=lt();return r?e&&!n?b.jsx(Ne.Navigate,{to:"/dashboard",replace:!0}):b.jsx(Ne.Outlet,{}):b.jsx(Ne.Navigate,{to:"/login",replace:!0,state:{from:t}})}const Ro={major_mismatch:{bg:"#b91c1c",label:"Incompatible version",message:(e,t)=>`This page (v${t}) is incompatible with the current API (v${e}). Please reload.`,dismissable:!1},minor_mismatch:{bg:"#b45309",label:"API updated",message:(e,t)=>`API updated to v${e} (you have v${t}). Some features may not work correctly.`,dismissable:!0},patch_mismatch:{bg:"#1d4ed8",label:"Minor update available",message:(e,t)=>`API v${e} is available (you have v${t}). Reload when convenient.`,dismissable:!0},client_ahead:{bg:"#4b5563",label:"Client ahead of API",message:(e,t)=>`Client v${t} is ahead of API v${e}. This may indicate a partial rollback.`,dismissable:!0}};function Co({status:e,apiVersion:t,clientVersion:n,onDismiss:r}){const o=Ro[e];return o?b.jsxs("div",{role:"alert","aria-live":"polite",style:{position:"fixed",top:0,left:0,right:0,zIndex:9999,background:o.bg,color:"white",padding:"12px 16px",textAlign:"center",fontSize:"14px",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px"},children:[b.jsxs("strong",{children:[o.label,":"]}),b.jsx("span",{children:o.message(t,n)}),b.jsx("button",{onClick:()=>window.location.reload(),style:{textDecoration:"underline",cursor:"pointer",background:"none",border:"none",color:"white"},children:"Reload"}),o.dismissable&&r?b.jsx("button",{onClick:r,"aria-label":"Dismiss version warning",style:{marginLeft:8,cursor:"pointer",background:"none",border:"none",color:"white",fontSize:"18px",lineHeight:1},children:"×"}):null]}):null}const qt={error:"border-red-500/30 bg-red-950/80 text-red-200",success:"border-emerald-500/30 bg-emerald-950/80 text-emerald-200",info:"border-zinc-600/30 bg-zinc-900/90 text-zinc-200"};function To({toast:e,onDismiss:t}){return e?b.jsxs("div",{role:"alert","aria-live":"assertive",className:`fixed bottom-6 right-6 z-50 max-w-sm rounded-xl border px-4 py-3 text-sm shadow-xl backdrop-blur-sm ${qt[e.type]||qt.error}`,children:[b.jsx("span",{children:e.message}),b.jsx("button",{onClick:t,className:"ml-3 text-xs underline opacity-60 hover:opacity-100","aria-label":"Dismiss",children:"Dismiss"})]}):null}function Oo({lines:e=3,label:t}){const n=["w-full","w-3/4","w-1/2"];return b.jsxs("div",{className:"rounded-2xl border border-zinc-800/50 bg-zinc-950/50 p-6",children:[b.jsx("div",{className:"space-y-3",children:Array.from({length:e},(r,o)=>b.jsx("div",{"data-testid":"loading-panel-line",className:`h-3 rounded bg-zinc-800 animate-pulse ${n[o%n.length]}`},o))}),t?b.jsx("p",{className:"mt-4 text-center text-xs text-zinc-500",children:t}):null]})}function ko({error:e,domain:t,onRetry:n}){if(!e)return null;const r=e?.status??"unknown",o=t||e?.domain||"server";let s=`${o} returned an unexpected error (${r}).`;return r===408?s=`${o} timed out. Check your connection and try again.`:r===429?s=`${o} is rate-limited. Wait a moment and try again.`:r===500?s=`${o} encountered an error. Our team has been notified.`:r===503&&(s=`${o} is temporarily unavailable. Try again in a moment.`),b.jsxs("div",{className:"rounded-2xl border border-zinc-800/30 bg-zinc-950/30 p-6 text-center",children:[b.jsx("p",{className:"text-sm text-zinc-400",children:s}),n?b.jsx("button",{type:"button",className:"mt-3 text-xs text-zinc-500 underline",onClick:n,children:"Try again"}):null]})}function Po(e){const[t,n]=$.useState(!1);return $.useEffect(()=>{e||n(!0)},[e]),t}function _o(){return b.jsx("div",{role:"alert",className:"flex min-h-[200px] items-center justify-center rounded-2xl border border-red-500/20 bg-zinc-950/80 p-8 text-center",children:b.jsxs("div",{children:[b.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.3em] text-red-400",children:"Admin Access Required"}),b.jsx("p",{className:"mt-2 text-sm text-zinc-400",children:"This panel is only available to administrator accounts."})]})})}function No({message:e,hint:t}){return b.jsxs("div",{className:"flex flex-col items-center justify-center rounded-2xl border border-zinc-800/30 bg-zinc-950/30 p-8 text-center",children:[b.jsx("p",{className:"text-sm text-zinc-400",children:e}),t?b.jsx("p",{className:"mt-1 text-xs text-zinc-600",children:t}):null]})}function Xt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function It(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Xt(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Xt(e[o],null)}}}}function Re(...e){return f.useCallback(It(...e),e)}var $o=Symbol.for("react.lazy"),nt=f[" use ".trim().toString()];function Io(e){return typeof e=="object"&&e!==null&&"then"in e}function Mn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===$o&&"_payload"in e&&Io(e._payload)}function Lo(e){const t=Do(e),n=f.forwardRef((r,o)=>{let{children:s,...i}=r;Mn(s)&&typeof nt=="function"&&(s=nt(s._payload));const a=f.Children.toArray(s),l=a.find(zo);if(l){const c=l.props.children,d=a.map(u=>u===l?f.Children.count(c)>1?f.Children.only(null):f.isValidElement(c)?c.props.children:null:u);return b.jsx(t,{...i,ref:o,children:f.isValidElement(c)?f.cloneElement(c,void 0,d):null})}return b.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var Mo=Lo("Slot");function Do(e){const t=f.forwardRef((n,r)=>{let{children:o,...s}=n;if(Mn(o)&&typeof nt=="function"&&(o=nt(o._payload)),f.isValidElement(o)){const i=Fo(o),a=Uo(s,o.props);return o.type!==f.Fragment&&(a.ref=r?It(r,i):i),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var jo=Symbol("radix.slottable");function zo(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jo}function Uo(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Fo(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Dn(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Dn(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function jn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Dn(e))&&(r&&(r+=" "),r+=t);return r}const Kt=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Jt=jn,Go=(e,t)=>n=>{var r;if(t?.variants==null)return Jt(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(c=>{const d=n?.[c],u=s?.[c];if(d===null)return null;const m=Kt(d)||Kt(u);return o[c][m]}),a=n&&Object.entries(n).reduce((c,d)=>{let[u,m]=d;return m===void 0||(c[u]=m),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:u,className:m,...p}=d;return Object.entries(p).every(g=>{let[y,w]=g;return Array.isArray(w)?w.includes({...s,...a}[y]):{...s,...a}[y]===w})?[...c,u,m]:c},[]);return Jt(e,i,l,n?.class,n?.className)},Wo=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Vo=(e,t)=>({classGroupId:e,validator:t}),zn=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),rt="-",Zt=[],Ho="arbitrary..",Bo=e=>{const t=qo(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Yo(i);const a=i.split(rt),l=a[0]===""&&a.length>1?1:0;return Un(a,l,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const l=r[i],c=n[i];return l?c?Wo(c,l):l:c||Zt}return n[i]||Zt}}},Un=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const c=Un(e,t+1,s);if(c)return c}const i=n.validators;if(i===null)return;const a=t===0?e.join(rt):e.slice(t).join(rt),l=i.length;for(let c=0;c<l;c++){const d=i[c];if(d.validator(a))return d.classGroupId}},Yo=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Ho+r:void 0})(),qo=e=>{const{theme:t,classGroups:n}=e;return Xo(n,t)},Xo=(e,t)=>{const n=zn();for(const r in e){const o=e[r];Lt(o,n,r,t)}return n},Lt=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];Ko(i,t,n,r)}},Ko=(e,t,n,r)=>{if(typeof e=="string"){Jo(e,t,n);return}if(typeof e=="function"){Zo(e,t,n,r);return}Qo(e,t,n,r)},Jo=(e,t,n)=>{const r=e===""?t:Fn(t,e);r.classGroupId=n},Zo=(e,t,n,r)=>{if(es(e)){Lt(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Vo(n,e))},Qo=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[a,l]=o[i];Lt(l,Fn(t,a),n,r)}},Fn=(e,t)=>{let n=e;const r=t.split(rt),o=r.length;for(let s=0;s<o;s++){const i=r[s];let a=n.nextPart.get(i);a||(a=zn(),n.nextPart.set(i,a)),n=a}return n},es=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ts=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},St="!",Qt=":",ns=[],en=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),rs=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,l=0,c;const d=o.length;for(let y=0;y<d;y++){const w=o[y];if(i===0&&a===0){if(w===Qt){s.push(o.slice(l,y)),l=y+1;continue}if(w==="/"){c=y;continue}}w==="["?i++:w==="]"?i--:w==="("?a++:w===")"&&a--}const u=s.length===0?o:o.slice(l);let m=u,p=!1;u.endsWith(St)?(m=u.slice(0,-1),p=!0):u.startsWith(St)&&(m=u.slice(1),p=!0);const g=c&&c>l?c-l:void 0;return en(s,p,m,g)};if(t){const o=t+Qt,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):en(ns,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},os=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],a=i[0]==="[",l=t.has(i);a||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},ss=e=>({cache:ts(e.cacheSize),parseClassName:rs(e),sortModifiers:os(e),postfixLookupClassGroupIds:is(e),...Bo(e)}),is=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},as=/\s+/,ls=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:i}=t,a=[],l=e.trim().split(as);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:m,modifiers:p,hasImportantModifier:g,baseClassName:y,maybePostfixModifierPosition:w}=n(u);if(m){c=u+(c.length>0?" "+c:c);continue}let x=!!w,E;if(x){const T=y.substring(0,w);E=r(T);const v=E&&i[E]?r(y):void 0;v&&v!==E&&(E=v,x=!1)}else E=r(y);if(!E){if(!x){c=u+(c.length>0?" "+c:c);continue}if(E=r(y),!E){c=u+(c.length>0?" "+c:c);continue}x=!1}const O=p.length===0?"":p.length===1?p[0]:s(p).join(":"),C=g?O+St:O,k=C+E;if(a.indexOf(k)>-1)continue;a.push(k);const P=o(E,x);for(let T=0;T<P.length;++T){const v=P[T];a.push(C+v)}c=u+(c.length>0?" "+c:c)}return c},cs=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Gn(n))&&(o&&(o+=" "),o+=r);return o},Gn=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Gn(e[r]))&&(n&&(n+=" "),n+=t);return n},us=(e,...t)=>{let n,r,o,s;const i=l=>{const c=t.reduce((d,u)=>u(d),e());return n=ss(c),r=n.cache.get,o=n.cache.set,s=a,a(l)},a=l=>{const c=r(l);if(c)return c;const d=ls(l,n);return o(l,d),d};return s=i,(...l)=>s(cs(...l))},ds=[],H=e=>{const t=n=>n[e]||ds;return t.isThemeGetter=!0,t},Wn=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Vn=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fs=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ms=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ps=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,gs=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,hs=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bs=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,he=e=>fs.test(e),_=e=>!!e&&!Number.isNaN(Number(e)),re=e=>!!e&&Number.isInteger(Number(e)),yt=e=>e.endsWith("%")&&_(e.slice(0,-1)),ae=e=>ms.test(e),Hn=()=>!0,ys=e=>ps.test(e)&&!gs.test(e),Mt=()=>!1,xs=e=>hs.test(e),ws=e=>bs.test(e),vs=e=>!A(e)&&!S(e),Es=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),As=e=>we(e,qn,Mt),A=e=>Wn.test(e),ve=e=>we(e,Xn,ys),tn=e=>we(e,_s,_),Ss=e=>we(e,Jn,Hn),Rs=e=>we(e,Kn,Mt),nn=e=>we(e,Bn,Mt),Cs=e=>we(e,Yn,ws),Je=e=>we(e,Zn,xs),S=e=>Vn.test(e),Fe=e=>Ce(e,Xn),Ts=e=>Ce(e,Kn),rn=e=>Ce(e,Bn),Os=e=>Ce(e,qn),ks=e=>Ce(e,Yn),Ze=e=>Ce(e,Zn,!0),Ps=e=>Ce(e,Jn,!0),we=(e,t,n)=>{const r=Wn.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ce=(e,t,n=!1)=>{const r=Vn.exec(e);return r?r[1]?t(r[1]):n:!1},Bn=e=>e==="position"||e==="percentage",Yn=e=>e==="image"||e==="url",qn=e=>e==="length"||e==="size"||e==="bg-size",Xn=e=>e==="length",_s=e=>e==="number",Kn=e=>e==="family-name",Jn=e=>e==="number"||e==="weight",Zn=e=>e==="shadow",Ns=()=>{const e=H("color"),t=H("font"),n=H("text"),r=H("font-weight"),o=H("tracking"),s=H("leading"),i=H("breakpoint"),a=H("container"),l=H("spacing"),c=H("radius"),d=H("shadow"),u=H("inset-shadow"),m=H("text-shadow"),p=H("drop-shadow"),g=H("blur"),y=H("perspective"),w=H("aspect"),x=H("ease"),E=H("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...C(),S,A],P=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],v=()=>[S,A,l],I=()=>[he,"full","auto",...v()],D=()=>[re,"none","subgrid",S,A],B=()=>["auto",{span:["full",re,S,A]},re,S,A],F=()=>[re,"auto",S,A],U=()=>["auto","min","max","fr",S,A],j=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...v()],M=()=>[he,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...v()],N=()=>[he,"screen","full","dvw","lvw","svw","min","max","fit",...v()],W=()=>[he,"screen","full","lh","dvh","lvh","svh","min","max","fit",...v()],R=()=>[e,S,A],je=()=>[...C(),rn,nn,{position:[S,A]}],Ye=()=>["no-repeat",{repeat:["","x","y","space","round"]}],qe=()=>["auto","cover","contain",Os,As,{size:[S,A]}],ze=()=>[yt,Fe,ve],Y=()=>["","none","full",c,S,A],q=()=>["",_,Fe,ve],te=()=>["solid","dashed","dotted","double"],Ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>[_,yt,rn,nn],Xe=()=>["","none",g,S,A],Oe=()=>["none",_,S,A],ke=()=>["none",_,S,A],ge=()=>[_,S,A],Ke=()=>[he,"full",...v()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ae],breakpoint:[ae],color:[Hn],container:[ae],"drop-shadow":[ae],ease:["in","out","in-out"],font:[vs],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ae],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ae],shadow:[ae],spacing:["px",_],text:[ae],"text-shadow":[ae],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",he,A,S,w]}],container:["container"],"container-type":[{"@container":["","normal","size",S,A]}],"container-named":[Es],columns:[{columns:[_,A,S,a]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:k()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[re,"auto",S,A]}],basis:[{basis:[he,"full","auto",a,...v()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_,he,"auto","initial","none",A]}],grow:[{grow:["",_,S,A]}],shrink:[{shrink:["",_,S,A]}],order:[{order:[re,"first","last","none",S,A]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:v()}],"gap-x":[{"gap-x":v()}],"gap-y":[{"gap-y":v()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:v()}],px:[{px:v()}],py:[{py:v()}],ps:[{ps:v()}],pe:[{pe:v()}],pbs:[{pbs:v()}],pbe:[{pbe:v()}],pt:[{pt:v()}],pr:[{pr:v()}],pb:[{pb:v()}],pl:[{pl:v()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mbs:[{mbs:L()}],mbe:[{mbe:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":v()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":v()}],"space-y-reverse":["space-y-reverse"],size:[{size:M()}],"inline-size":[{inline:["auto",...N()]}],"min-inline-size":[{"min-inline":["auto",...N()]}],"max-inline-size":[{"max-inline":["none",...N()]}],"block-size":[{block:["auto",...W()]}],"min-block-size":[{"min-block":["auto",...W()]}],"max-block-size":[{"max-block":["none",...W()]}],w:[{w:[a,"screen",...M()]}],"min-w":[{"min-w":[a,"screen","none",...M()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...M()]}],h:[{h:["screen","lh",...M()]}],"min-h":[{"min-h":["screen","lh","none",...M()]}],"max-h":[{"max-h":["screen","lh",...M()]}],"font-size":[{text:["base",n,Fe,ve]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ps,Ss]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yt,A]}],"font-family":[{font:[Ts,Rs,t]}],"font-features":[{"font-features":[A]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,S,A]}],"line-clamp":[{"line-clamp":[_,"none",S,tn]}],leading:[{leading:[s,...v()]}],"list-image":[{"list-image":["none",S,A]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",S,A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[_,"from-font","auto",S,ve]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[_,"auto",S,A]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:v()}],"tab-size":[{tab:[re,S,A]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",S,A]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",S,A]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:je()}],"bg-repeat":[{bg:Ye()}],"bg-size":[{bg:qe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},re,S,A],radial:["",S,A],conic:[re,S,A]},ks,Cs]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:ze()}],"gradient-via-pos":[{via:ze()}],"gradient-to-pos":[{to:ze()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-bs":[{"border-bs":q()}],"border-w-be":[{"border-be":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_,S,A]}],"outline-w":[{outline:["",_,Fe,ve]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",d,Ze,Je]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",u,Ze,Je]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[_,ve]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",m,Ze,Je]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[_,S,A]}],"mix-blend":[{"mix-blend":[...Ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_]}],"mask-image-linear-from-pos":[{"mask-linear-from":V()}],"mask-image-linear-to-pos":[{"mask-linear-to":V()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":V()}],"mask-image-t-to-pos":[{"mask-t-to":V()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":V()}],"mask-image-r-to-pos":[{"mask-r-to":V()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":V()}],"mask-image-b-to-pos":[{"mask-b-to":V()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":V()}],"mask-image-l-to-pos":[{"mask-l-to":V()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":V()}],"mask-image-x-to-pos":[{"mask-x-to":V()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":V()}],"mask-image-y-to-pos":[{"mask-y-to":V()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[S,A]}],"mask-image-radial-from-pos":[{"mask-radial-from":V()}],"mask-image-radial-to-pos":[{"mask-radial-to":V()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[_]}],"mask-image-conic-from-pos":[{"mask-conic-from":V()}],"mask-image-conic-to-pos":[{"mask-conic-to":V()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:je()}],"mask-repeat":[{mask:Ye()}],"mask-size":[{mask:qe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",S,A]}],filter:[{filter:["","none",S,A]}],blur:[{blur:Xe()}],brightness:[{brightness:[_,S,A]}],contrast:[{contrast:[_,S,A]}],"drop-shadow":[{"drop-shadow":["","none",p,Ze,Je]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",_,S,A]}],"hue-rotate":[{"hue-rotate":[_,S,A]}],invert:[{invert:["",_,S,A]}],saturate:[{saturate:[_,S,A]}],sepia:[{sepia:["",_,S,A]}],"backdrop-filter":[{"backdrop-filter":["","none",S,A]}],"backdrop-blur":[{"backdrop-blur":Xe()}],"backdrop-brightness":[{"backdrop-brightness":[_,S,A]}],"backdrop-contrast":[{"backdrop-contrast":[_,S,A]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_,S,A]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_,S,A]}],"backdrop-invert":[{"backdrop-invert":["",_,S,A]}],"backdrop-opacity":[{"backdrop-opacity":[_,S,A]}],"backdrop-saturate":[{"backdrop-saturate":[_,S,A]}],"backdrop-sepia":[{"backdrop-sepia":["",_,S,A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":v()}],"border-spacing-x":[{"border-spacing-x":v()}],"border-spacing-y":[{"border-spacing-y":v()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",S,A]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_,"initial",S,A]}],ease:[{ease:["linear","initial",x,S,A]}],delay:[{delay:[_,S,A]}],animate:[{animate:["none",E,S,A]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,S,A]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:Oe()}],"rotate-x":[{"rotate-x":Oe()}],"rotate-y":[{"rotate-y":Oe()}],"rotate-z":[{"rotate-z":Oe()}],scale:[{scale:ke()}],"scale-x":[{"scale-x":ke()}],"scale-y":[{"scale-y":ke()}],"scale-z":[{"scale-z":ke()}],"scale-3d":["scale-3d"],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[S,A,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ke()}],"translate-x":[{"translate-x":Ke()}],"translate-y":[{"translate-y":Ke()}],"translate-z":[{"translate-z":Ke()}],"translate-none":["translate-none"],zoom:[{zoom:[re,S,A]}],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",S,A]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":R()}],"scrollbar-track-color":[{"scrollbar-track":R()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":v()}],"scroll-mx":[{"scroll-mx":v()}],"scroll-my":[{"scroll-my":v()}],"scroll-ms":[{"scroll-ms":v()}],"scroll-me":[{"scroll-me":v()}],"scroll-mbs":[{"scroll-mbs":v()}],"scroll-mbe":[{"scroll-mbe":v()}],"scroll-mt":[{"scroll-mt":v()}],"scroll-mr":[{"scroll-mr":v()}],"scroll-mb":[{"scroll-mb":v()}],"scroll-ml":[{"scroll-ml":v()}],"scroll-p":[{"scroll-p":v()}],"scroll-px":[{"scroll-px":v()}],"scroll-py":[{"scroll-py":v()}],"scroll-ps":[{"scroll-ps":v()}],"scroll-pe":[{"scroll-pe":v()}],"scroll-pbs":[{"scroll-pbs":v()}],"scroll-pbe":[{"scroll-pbe":v()}],"scroll-pt":[{"scroll-pt":v()}],"scroll-pr":[{"scroll-pr":v()}],"scroll-pb":[{"scroll-pb":v()}],"scroll-pl":[{"scroll-pl":v()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",S,A]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[_,Fe,ve,tn]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},$s=us(Ns);function me(...e){return $s(jn(e))}const Qn=Go("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),er=f.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?Mo:"button";return b.jsx(i,{className:me(Qn({variant:t,size:n,className:e})),ref:s,...o})});er.displayName="Button";const tr=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));tr.displayName="Card";const nr=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("flex flex-col space-y-1.5 p-6",e),...t}));nr.displayName="CardHeader";const rr=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("text-2xl font-semibold leading-none tracking-tight",e),...t}));rr.displayName="CardTitle";const or=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("text-sm text-muted-foreground",e),...t}));or.displayName="CardDescription";const sr=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("p-6 pt-0",e),...t}));sr.displayName="CardContent";const ir=f.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:me("flex items-center p-6 pt-0",e),...t}));ir.displayName="CardFooter";function le(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function ar(e,t=[]){let n=[];function r(s,i){const a=f.createContext(i),l=n.length;n=[...n,i];const c=u=>{const{scope:m,children:p,...g}=u,y=m?.[e]?.[l]||a,w=f.useMemo(()=>g,Object.values(g));return b.jsx(y.Provider,{value:w,children:p})};c.displayName=s+"Provider";function d(u,m){const p=m?.[e]?.[l]||a,g=f.useContext(p);if(g)return g;if(i!==void 0)return i;throw new Error(`\`${u}\` must be used within \`${s}\``)}return[c,d]}const o=()=>{const s=n.map(i=>f.createContext(i));return function(a){const l=a?.[e]||s;return f.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Is(o,...t)]}function Is(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const u=l(s)[`__scope${c}`];return{...a,...u}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Ls(e){const t=Ms(e),n=f.forwardRef((r,o)=>{const{children:s,...i}=r,a=f.Children.toArray(s),l=a.find(js);if(l){const c=l.props.children,d=a.map(u=>u===l?f.Children.count(c)>1?f.Children.only(null):f.isValidElement(c)?c.props.children:null:u);return b.jsx(t,{...i,ref:o,children:f.isValidElement(c)?f.cloneElement(c,void 0,d):null})}return b.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Ms(e){const t=f.forwardRef((n,r)=>{const{children:o,...s}=n;if(f.isValidElement(o)){const i=Us(o),a=zs(s,o.props);return o.type!==f.Fragment&&(a.ref=r?It(r,i):i),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ds=Symbol("radix.slottable");function js(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ds}function zs(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Us(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Fs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Te=Fs.reduce((e,t)=>{const n=Ls(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Gs(e,t){e&&xn.flushSync(()=>e.dispatchEvent(t))}function ct(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>t.current?.(...n),[])}function Ws(e,t=globalThis?.document){const n=ct(e);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Vs="DismissableLayer",Rt="dismissableLayer.update",Hs="dismissableLayer.pointerDownOutside",Bs="dismissableLayer.focusOutside",on,lr=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cr=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,c=f.useContext(lr),[d,u]=f.useState(null),m=d?.ownerDocument??globalThis?.document,[,p]=f.useState({}),g=Re(t,T=>u(T)),y=Array.from(c.layers),[w]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(w),E=d?y.indexOf(d):-1,O=c.layersWithOutsidePointerEventsDisabled.size>0,C=E>=x,k=Xs(T=>{const v=T.target,I=[...c.branches].some(D=>D.contains(v));!C||I||(o?.(T),i?.(T),T.defaultPrevented||a?.())},m),P=Ks(T=>{const v=T.target;[...c.branches].some(D=>D.contains(v))||(s?.(T),i?.(T),T.defaultPrevented||a?.())},m);return Ws(T=>{E===c.layers.size-1&&(r?.(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},m),f.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(on=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),sn(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=on)}},[d,m,n,c]),f.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),sn())},[d,c]),f.useEffect(()=>{const T=()=>p({});return document.addEventListener(Rt,T),()=>document.removeEventListener(Rt,T)},[]),b.jsx(Te.div,{...l,ref:g,style:{pointerEvents:O?C?"auto":"none":void 0,...e.style},onFocusCapture:le(e.onFocusCapture,P.onFocusCapture),onBlurCapture:le(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:le(e.onPointerDownCapture,k.onPointerDownCapture)})});cr.displayName=Vs;var Ys="DismissableLayerBranch",qs=f.forwardRef((e,t)=>{const n=f.useContext(lr),r=f.useRef(null),o=Re(t,r);return f.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),b.jsx(Te.div,{...e,ref:o})});qs.displayName=Ys;function Xs(e,t=globalThis?.document){const n=ct(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){ur(Hs,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ks(e,t=globalThis?.document){const n=ct(e),r=f.useRef(!1);return f.useEffect(()=>{const o=s=>{s.target&&!r.current&&ur(Bs,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function sn(){const e=new CustomEvent(Rt);document.dispatchEvent(e)}function ur(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Gs(o,s):o.dispatchEvent(s)}var Ae=globalThis?.document?f.useLayoutEffect:()=>{},Js=f[" useId ".trim().toString()]||(()=>{}),Zs=0;function Qs(e){const[t,n]=f.useState(Js());return Ae(()=>{n(r=>r??String(Zs++))},[e]),t?`radix-${t}`:""}const ei=["top","right","bottom","left"],be=Math.min,X=Math.max,ot=Math.round,Qe=Math.floor,se=e=>({x:e,y:e}),ti={left:"right",right:"left",bottom:"top",top:"bottom"};function Ct(e,t,n){return X(e,be(t,n))}function ue(e,t){return typeof e=="function"?e(t):e}function de(e){return e.split("-")[0]}function Me(e){return e.split("-")[1]}function Dt(e){return e==="x"?"y":"x"}function jt(e){return e==="y"?"height":"width"}function oe(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function zt(e){return Dt(oe(e))}function ni(e,t,n){n===void 0&&(n=!1);const r=Me(e),o=zt(e),s=jt(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=st(i)),[i,st(i)]}function ri(e){const t=st(e);return[Tt(e),t,Tt(t)]}function Tt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const an=["left","right"],ln=["right","left"],oi=["top","bottom"],si=["bottom","top"];function ii(e,t,n){switch(e){case"top":case"bottom":return n?t?ln:an:t?an:ln;case"left":case"right":return t?oi:si;default:return[]}}function ai(e,t,n,r){const o=Me(e);let s=ii(de(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Tt)))),s}function st(e){const t=de(e);return ti[t]+e.slice(t.length)}function li(e){return{top:0,right:0,bottom:0,left:0,...e}}function dr(e){return typeof e!="number"?li(e):{top:e,right:e,bottom:e,left:e}}function it(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function cn(e,t,n){let{reference:r,floating:o}=e;const s=oe(t),i=zt(t),a=jt(i),l=de(t),c=s==="y",d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(Me(t)){case"start":p[i]-=m*(n&&c?-1:1);break;case"end":p[i]+=m*(n&&c?-1:1);break}return p}async function ci(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:m=!1,padding:p=0}=ue(t,e),g=dr(p),w=a[m?u==="floating"?"reference":"floating":u],x=it(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),E=u==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),C=await(s.isElement==null?void 0:s.isElement(O))?await(s.getScale==null?void 0:s.getScale(O))||{x:1,y:1}:{x:1,y:1},k=it(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:O,strategy:l}):E);return{top:(x.top-k.top+g.top)/C.y,bottom:(k.bottom-x.bottom+g.bottom)/C.y,left:(x.left-k.left+g.left)/C.x,right:(k.right-x.right+g.right)/C.x}}const ui=50,di=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:ci},l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=cn(c,r,l),m=r,p=0;const g={};for(let y=0;y<s.length;y++){const w=s[y];if(!w)continue;const{name:x,fn:E}=w,{x:O,y:C,data:k,reset:P}=await E({x:d,y:u,initialPlacement:r,placement:m,strategy:o,middlewareData:g,rects:c,platform:a,elements:{reference:e,floating:t}});d=O??d,u=C??u,g[x]={...g[x],...k},P&&p<ui&&(p++,typeof P=="object"&&(P.placement&&(m=P.placement),P.rects&&(c=P.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:d,y:u}=cn(c,m,l)),y=-1)}return{x:d,y:u,placement:m,strategy:o,middlewareData:g}},fi=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=ue(e,t)||{};if(c==null)return{};const u=dr(d),m={x:n,y:r},p=zt(o),g=jt(p),y=await i.getDimensions(c),w=p==="y",x=w?"top":"left",E=w?"bottom":"right",O=w?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[p]-m[p]-s.floating[g],k=m[p]-s.reference[p],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let T=P?P[O]:0;(!T||!await(i.isElement==null?void 0:i.isElement(P)))&&(T=a.floating[O]||s.floating[g]);const v=C/2-k/2,I=T/2-y[g]/2-1,D=be(u[x],I),B=be(u[E],I),F=D,U=T-y[g]-B,j=T/2-y[g]/2+v,G=Ct(F,j,U),L=!l.arrow&&Me(o)!=null&&j!==G&&s.reference[g]/2-(j<F?D:B)-y[g]/2<0,M=L?j<F?j-F:j-U:0;return{[p]:m[p]+M,data:{[p]:G,centerOffset:j-G-M,...L&&{alignmentOffset:M}},reset:L}}}),mi=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...w}=ue(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=de(o),E=oe(a),O=de(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=m||(O||!y?[st(a)]:ri(a)),P=g!=="none";!m&&P&&k.push(...ai(a,y,g,C));const T=[a,...k],v=await l.detectOverflow(t,w),I=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&I.push(v[x]),u){const j=ni(o,i,C);I.push(v[j[0]],v[j[1]])}if(D=[...D,{placement:o,overflows:I}],!I.every(j=>j<=0)){var B,F;const j=(((B=s.flip)==null?void 0:B.index)||0)+1,G=T[j];if(G&&(!(u==="alignment"?E!==oe(G):!1)||D.every(N=>oe(N.placement)===E?N.overflows[0]>0:!0)))return{data:{index:j,overflows:D},reset:{placement:G}};let L=(F=D.filter(M=>M.overflows[0]<=0).sort((M,N)=>M.overflows[1]-N.overflows[1])[0])==null?void 0:F.placement;if(!L)switch(p){case"bestFit":{var U;const M=(U=D.filter(N=>{if(P){const W=oe(N.placement);return W===E||W==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(W=>W>0).reduce((W,R)=>W+R,0)]).sort((N,W)=>N[1]-W[1])[0])==null?void 0:U[0];M&&(L=M);break}case"initialPlacement":L=a;break}if(o!==L)return{reset:{placement:L}}}return{}}}};function un(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function dn(e){return ei.some(t=>e[t]>=0)}const pi=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=ue(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=un(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:dn(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=un(i,n.floating);return{data:{escapedOffsets:a,escaped:dn(a)}}}default:return{}}}}},fr=new Set(["left","top"]);async function gi(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=de(n),a=Me(n),l=oe(n)==="y",c=fr.has(i)?-1:1,d=s&&l?-1:1,u=ue(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),l?{x:p*d,y:m*c}:{x:m*c,y:p*d}}const hi=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await gi(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},bi=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:x=>{let{x:E,y:O}=x;return{x:E,y:O}}},...c}=ue(e,t),d={x:n,y:r},u=await s.detectOverflow(t,c),m=oe(de(o)),p=Dt(m);let g=d[p],y=d[m];if(i){const x=p==="y"?"top":"left",E=p==="y"?"bottom":"right",O=g+u[x],C=g-u[E];g=Ct(O,g,C)}if(a){const x=m==="y"?"top":"left",E=m==="y"?"bottom":"right",O=y+u[x],C=y-u[E];y=Ct(O,y,C)}const w=l.fn({...t,[p]:g,[m]:y});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[p]:i,[m]:a}}}}}},yi=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=ue(e,t),d={x:n,y:r},u=oe(o),m=Dt(u);let p=d[m],g=d[u];const y=ue(a,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const O=m==="y"?"height":"width",C=s.reference[m]-s.floating[O]+w.mainAxis,k=s.reference[m]+s.reference[O]-w.mainAxis;p<C?p=C:p>k&&(p=k)}if(c){var x,E;const O=m==="y"?"width":"height",C=fr.has(de(o)),k=s.reference[u]-s.floating[O]+(C&&((x=i.offset)==null?void 0:x[u])||0)+(C?0:w.crossAxis),P=s.reference[u]+s.reference[O]+(C?0:((E=i.offset)==null?void 0:E[u])||0)-(C?w.crossAxis:0);g<k?g=k:g>P&&(g=P)}return{[m]:p,[u]:g}}}},xi=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=ue(e,t),d=await i.detectOverflow(t,c),u=de(o),m=Me(o),p=oe(o)==="y",{width:g,height:y}=s.floating;let w,x;u==="top"||u==="bottom"?(w=u,x=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=u,w=m==="end"?"top":"bottom");const E=y-d.top-d.bottom,O=g-d.left-d.right,C=be(y-d[w],E),k=be(g-d[x],O),P=!t.middlewareData.shift;let T=C,v=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(v=O),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=E),P&&!m){const D=X(d.left,0),B=X(d.right,0),F=X(d.top,0),U=X(d.bottom,0);p?v=g-2*(D!==0||B!==0?D+B:X(d.left,d.right)):T=y-2*(F!==0||U!==0?F+U:X(d.top,d.bottom))}await l({...t,availableWidth:v,availableHeight:T});const I=await i.getDimensions(a.floating);return g!==I.width||y!==I.height?{reset:{rects:!0}}:{}}}};function ut(){return typeof window<"u"}function De(e){return mr(e)?(e.nodeName||"").toLowerCase():"#document"}function J(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ie(e){var t;return(t=(mr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function mr(e){return ut()?e instanceof Node||e instanceof J(e).Node:!1}function Z(e){return ut()?e instanceof Element||e instanceof J(e).Element:!1}function pe(e){return ut()?e instanceof HTMLElement||e instanceof J(e).HTMLElement:!1}function fn(e){return!ut()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof J(e).ShadowRoot}function Be(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function wi(e){return/^(table|td|th)$/.test(De(e))}function dt(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const vi=/transform|translate|scale|rotate|perspective|filter/,Ei=/paint|layout|strict|content/,Ee=e=>!!e&&e!=="none";let xt;function Ut(e){const t=Z(e)?Q(e):e;return Ee(t.transform)||Ee(t.translate)||Ee(t.scale)||Ee(t.rotate)||Ee(t.perspective)||!Ft()&&(Ee(t.backdropFilter)||Ee(t.filter))||vi.test(t.willChange||"")||Ei.test(t.contain||"")}function Ai(e){let t=ye(e);for(;pe(t)&&!Ie(t);){if(Ut(t))return t;if(dt(t))return null;t=ye(t)}return null}function Ft(){return xt==null&&(xt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),xt}function Ie(e){return/^(html|body|#document)$/.test(De(e))}function Q(e){return J(e).getComputedStyle(e)}function ft(e){return Z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ye(e){if(De(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fn(e)&&e.host||ie(e);return fn(t)?t.host:t}function pr(e){const t=ye(e);return Ie(t)?e.ownerDocument?e.ownerDocument.body:e.body:pe(t)&&Be(t)?t:pr(t)}function Ve(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=pr(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=J(o);if(s){const a=Ot(i);return t.concat(i,i.visualViewport||[],Be(o)?o:[],a&&n?Ve(a):[])}else return t.concat(o,Ve(o,[],n))}function Ot(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gr(e){const t=Q(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=pe(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=ot(n)!==s||ot(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Gt(e){return Z(e)?e:e.contextElement}function $e(e){const t=Gt(e);if(!pe(t))return se(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=gr(t);let i=(s?ot(n.width):n.width)/r,a=(s?ot(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Si=se(0);function hr(e){const t=J(e);return!Ft()||!t.visualViewport?Si:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ri(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==J(e)?!1:t}function Se(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Gt(e);let i=se(1);t&&(r?Z(r)&&(i=$e(r)):i=$e(e));const a=Ri(s,n,r)?hr(s):se(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(s){const m=J(s),p=r&&Z(r)?J(r):r;let g=m,y=Ot(g);for(;y&&r&&p!==g;){const w=$e(y),x=y.getBoundingClientRect(),E=Q(y),O=x.left+(y.clientLeft+parseFloat(E.paddingLeft))*w.x,C=x.top+(y.clientTop+parseFloat(E.paddingTop))*w.y;l*=w.x,c*=w.y,d*=w.x,u*=w.y,l+=O,c+=C,g=J(y),y=Ot(g)}}return it({width:d,height:u,x:l,y:c})}function mt(e,t){const n=ft(e).scrollLeft;return t?t.left+n:Se(ie(e)).left+n}function br(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-mt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Ci(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=ie(r),a=t?dt(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=se(1);const d=se(0),u=pe(r);if((u||!u&&!s)&&((De(r)!=="body"||Be(i))&&(l=ft(r)),u)){const p=Se(r);c=$e(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const m=i&&!u&&!s?br(i,l):se(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+m.x,y:n.y*c.y-l.scrollTop*c.y+d.y+m.y}}function Ti(e){return Array.from(e.getClientRects())}function Oi(e){const t=ie(e),n=ft(e),r=e.ownerDocument.body,o=X(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=X(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+mt(e);const a=-n.scrollTop;return Q(r).direction==="rtl"&&(i+=X(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const mn=25;function ki(e,t){const n=J(e),r=ie(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const d=Ft();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=mt(r);if(c<=0){const d=r.ownerDocument,u=d.body,m=getComputedStyle(u),p=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(r.clientWidth-u.clientWidth-p);g<=mn&&(s-=g)}else c<=mn&&(s+=c);return{width:s,height:i,x:a,y:l}}function Pi(e,t){const n=Se(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=pe(e)?$e(e):se(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function pn(e,t,n){let r;if(t==="viewport")r=ki(e,n);else if(t==="document")r=Oi(ie(e));else if(Z(t))r=Pi(t,n);else{const o=hr(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return it(r)}function yr(e,t){const n=ye(e);return n===t||!Z(n)||Ie(n)?!1:Q(n).position==="fixed"||yr(n,t)}function _i(e,t){const n=t.get(e);if(n)return n;let r=Ve(e,[],!1).filter(a=>Z(a)&&De(a)!=="body"),o=null;const s=Q(e).position==="fixed";let i=s?ye(e):e;for(;Z(i)&&!Ie(i);){const a=Q(i),l=Ut(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Be(i)&&!l&&yr(e,i))?r=r.filter(d=>d!==i):o=a,i=ye(i)}return t.set(e,r),r}function Ni(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?dt(t)?[]:_i(t,this._c):[].concat(n),r],a=pn(t,i[0],o);let l=a.top,c=a.right,d=a.bottom,u=a.left;for(let m=1;m<i.length;m++){const p=pn(t,i[m],o);l=X(p.top,l),c=be(p.right,c),d=be(p.bottom,d),u=X(p.left,u)}return{width:c-u,height:d-l,x:u,y:l}}function $i(e){const{width:t,height:n}=gr(e);return{width:t,height:n}}function Ii(e,t,n){const r=pe(t),o=ie(t),s=n==="fixed",i=Se(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=se(0);function c(){l.x=mt(o)}if(r||!r&&!s)if((De(t)!=="body"||Be(o))&&(a=ft(t)),r){const p=Se(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&c();s&&!r&&o&&c();const d=o&&!r&&!s?br(o,a):se(0),u=i.left+a.scrollLeft-l.x-d.x,m=i.top+a.scrollTop-l.y-d.y;return{x:u,y:m,width:i.width,height:i.height}}function wt(e){return Q(e).position==="static"}function gn(e,t){if(!pe(e)||Q(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ie(e)===n&&(n=n.ownerDocument.body),n}function xr(e,t){const n=J(e);if(dt(e))return n;if(!pe(e)){let o=ye(e);for(;o&&!Ie(o);){if(Z(o)&&!wt(o))return o;o=ye(o)}return n}let r=gn(e,t);for(;r&&wi(r)&&wt(r);)r=gn(r,t);return r&&Ie(r)&&wt(r)&&!Ut(r)?n:r||Ai(e)||n}const Li=async function(e){const t=this.getOffsetParent||xr,n=this.getDimensions,r=await n(e.floating);return{reference:Ii(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Mi(e){return Q(e).direction==="rtl"}const Di={convertOffsetParentRelativeRectToViewportRelativeRect:Ci,getDocumentElement:ie,getClippingRect:Ni,getOffsetParent:xr,getElementRects:Li,getClientRects:Ti,getDimensions:$i,getScale:$e,isElement:Z,isRTL:Mi};function wr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ji(e,t){let n=null,r;const o=ie(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:d,top:u,width:m,height:p}=c;if(a||t(),!m||!p)return;const g=Qe(u),y=Qe(o.clientWidth-(d+m)),w=Qe(o.clientHeight-(u+p)),x=Qe(d),O={rootMargin:-g+"px "+-y+"px "+-w+"px "+-x+"px",threshold:X(0,be(1,l))||1};let C=!0;function k(P){const T=P[0].intersectionRatio;if(T!==l){if(!C)return i();T?i(!1,T):r=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!wr(c,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(k,{...O,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,O)}n.observe(e)}return i(!0),s}function zi(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Gt(e),d=o||s?[...c?Ve(c):[],...t?Ve(t):[]]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const u=c&&a?ji(c,n):null;let m=-1,p=null;i&&(p=new ResizeObserver(x=>{let[E]=x;E&&E.target===c&&p&&t&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var O;(O=p)==null||O.observe(t)})),n()}),c&&!l&&p.observe(c),t&&p.observe(t));let g,y=l?Se(e):null;l&&w();function w(){const x=Se(e);y&&!wr(y,x)&&n(),y=x,g=requestAnimationFrame(w)}return n(),()=>{var x;d.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),u?.(),(x=p)==null||x.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const Ui=hi,Fi=bi,Gi=mi,Wi=xi,Vi=pi,hn=fi,Hi=yi,Bi=(e,t,n)=>{const r=new Map,o={platform:Di,...n},s={...o.platform,_c:r};return di(e,t,{...o,platform:s})};var Yi=typeof document<"u",qi=function(){},tt=Yi?$.useLayoutEffect:qi;function at(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!at(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!at(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function vr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bn(e,t){const n=vr(e);return Math.round(t*n)/n}function vt(e){const t=f.useRef(e);return tt(()=>{t.current=e}),t}function Xi(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,u]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=f.useState(r);at(m,r)||p(r);const[g,y]=f.useState(null),[w,x]=f.useState(null),E=f.useCallback(N=>{N!==P.current&&(P.current=N,y(N))},[]),O=f.useCallback(N=>{N!==T.current&&(T.current=N,x(N))},[]),C=s||g,k=i||w,P=f.useRef(null),T=f.useRef(null),v=f.useRef(d),I=l!=null,D=vt(l),B=vt(o),F=vt(c),U=f.useCallback(()=>{if(!P.current||!T.current)return;const N={placement:t,strategy:n,middleware:m};B.current&&(N.platform=B.current),Bi(P.current,T.current,N).then(W=>{const R={...W,isPositioned:F.current!==!1};j.current&&!at(v.current,R)&&(v.current=R,xn.flushSync(()=>{u(R)}))})},[m,t,n,B,F]);tt(()=>{c===!1&&v.current.isPositioned&&(v.current.isPositioned=!1,u(N=>({...N,isPositioned:!1})))},[c]);const j=f.useRef(!1);tt(()=>(j.current=!0,()=>{j.current=!1}),[]),tt(()=>{if(C&&(P.current=C),k&&(T.current=k),C&&k){if(D.current)return D.current(C,k,U);U()}},[C,k,U,D,I]);const G=f.useMemo(()=>({reference:P,floating:T,setReference:E,setFloating:O}),[E,O]),L=f.useMemo(()=>({reference:C,floating:k}),[C,k]),M=f.useMemo(()=>{const N={position:n,left:0,top:0};if(!L.floating)return N;const W=bn(L.floating,d.x),R=bn(L.floating,d.y);return a?{...N,transform:"translate("+W+"px, "+R+"px)",...vr(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:R}},[n,a,L.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:U,refs:G,elements:L,floatingStyles:M}),[d,U,G,L,M])}const Ki=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?hn({element:r.current,padding:o}).fn(n):{}:r?hn({element:r,padding:o}).fn(n):{}}}},Ji=(e,t)=>{const n=Ui(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zi=(e,t)=>{const n=Fi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qi=(e,t)=>({fn:Hi(e).fn,options:[e,t]}),ea=(e,t)=>{const n=Gi(e);return{name:n.name,fn:n.fn,options:[e,t]}},ta=(e,t)=>{const n=Wi(e);return{name:n.name,fn:n.fn,options:[e,t]}},na=(e,t)=>{const n=Vi(e);return{name:n.name,fn:n.fn,options:[e,t]}},ra=(e,t)=>{const n=Ki(e);return{name:n.name,fn:n.fn,options:[e,t]}};var oa="Arrow",Er=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return b.jsx(Te.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:b.jsx("polygon",{points:"0,0 30,0 15,10"})})});Er.displayName=oa;var sa=Er;function ia(e){const[t,n]=f.useState(void 0);return Ae(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Wt="Popper",[Ar,Sr]=ar(Wt),[aa,Rr]=Ar(Wt),Cr=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return b.jsx(aa,{scope:t,anchor:r,onAnchorChange:o,children:n})};Cr.displayName=Wt;var Tr="PopperAnchor",Or=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Rr(Tr,n),i=f.useRef(null),a=Re(t,i),l=f.useRef(null);return f.useEffect(()=>{const c=l.current;l.current=r?.current||i.current,c!==l.current&&s.onAnchorChange(l.current)}),r?null:b.jsx(Te.div,{...o,ref:a})});Or.displayName=Tr;var Vt="PopperContent",[la,ca]=Ar(Vt),kr=f.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:g,...y}=e,w=Rr(Vt,n),[x,E]=f.useState(null),O=Re(t,te=>E(te)),[C,k]=f.useState(null),P=ia(C),T=P?.width??0,v=P?.height??0,I=r+(s!=="center"?"-"+s:""),D=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},B=Array.isArray(c)?c:[c],F=B.length>0,U={padding:D,boundary:B.filter(da),altBoundary:F},{refs:j,floatingStyles:G,placement:L,isPositioned:M,middlewareData:N}=Xi({strategy:"fixed",placement:I,whileElementsMounted:(...te)=>zi(...te,{animationFrame:p==="always"}),elements:{reference:w.anchor},middleware:[Ji({mainAxis:o+v,alignmentAxis:i}),l&&Zi({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Qi():void 0,...U}),l&&ea({...U}),ta({...U,apply:({elements:te,rects:Ue,availableWidth:V,availableHeight:Xe})=>{const{width:Oe,height:ke}=Ue.reference,ge=te.floating.style;ge.setProperty("--radix-popper-available-width",`${V}px`),ge.setProperty("--radix-popper-available-height",`${Xe}px`),ge.setProperty("--radix-popper-anchor-width",`${Oe}px`),ge.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),C&&ra({element:C,padding:a}),fa({arrowWidth:T,arrowHeight:v}),m&&na({strategy:"referenceHidden",...U})]}),[W,R]=Nr(L),je=ct(g);Ae(()=>{M&&je?.()},[M,je]);const Ye=N.arrow?.x,qe=N.arrow?.y,ze=N.arrow?.centerOffset!==0,[Y,q]=f.useState();return Ae(()=>{x&&q(window.getComputedStyle(x).zIndex)},[x]),b.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:M?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(" "),...N.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:b.jsx(la,{scope:n,placedSide:W,onArrowChange:k,arrowX:Ye,arrowY:qe,shouldHideArrow:ze,children:b.jsx(Te.div,{"data-side":W,"data-align":R,...y,ref:O,style:{...y.style,animation:M?void 0:"none"}})})})});kr.displayName=Vt;var Pr="PopperArrow",ua={top:"bottom",right:"left",bottom:"top",left:"right"},_r=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=ca(Pr,r),i=ua[s.placedSide];return b.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:b.jsx(sa,{...o,ref:n,style:{...o.style,display:"block"}})})});_r.displayName=Pr;function da(e){return e!==null}var fa=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,d]=Nr(n),u={start:"0%",center:"50%",end:"100%"}[d],m=(o.arrow?.x??0)+a/2,p=(o.arrow?.y??0)+l/2;let g="",y="";return c==="bottom"?(g=i?u:`${m}px`,y=`${-l}px`):c==="top"?(g=i?u:`${m}px`,y=`${r.floating.height+l}px`):c==="right"?(g=`${-l}px`,y=i?u:`${p}px`):c==="left"&&(g=`${r.floating.width+l}px`,y=i?u:`${p}px`),{data:{x:g,y}}}});function Nr(e){const[t,n="center"]=e.split("-");return[t,n]}var ma=Cr,pa=Or,ga=kr,ha=_r;function ba(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var $r=e=>{const{present:t,children:n}=e,r=ya(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),s=Re(r.ref,xa(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:s}):null};$r.displayName="Presence";function ya(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),s=f.useRef("none"),i=e?"mounted":"unmounted",[a,l]=ba(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const c=et(r.current);s.current=a==="mounted"?c:"none"},[a]),Ae(()=>{const c=r.current,d=o.current;if(d!==e){const m=s.current,p=et(c);e?l("MOUNT"):p==="none"||c?.display==="none"?l("UNMOUNT"):l(d&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ae(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,u=p=>{const y=et(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&y&&(l("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},m=p=>{p.target===t&&(s.current=et(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:f.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function et(e){return e?.animationName||"none"}function xa(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wa=Symbol("radix.slottable");function va(e){const t=({children:n})=>b.jsx(b.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=wa,t}var Ea=f[" useInsertionEffect ".trim().toString()]||Ae;function Aa({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=Sa({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const d=f.useRef(e!==void 0);f.useEffect(()=>{const u=d.current;u!==a&&console.warn(`${r} is changing from ${u?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const c=f.useCallback(d=>{if(a){const u=Ra(d)?d(e):d;u!==e&&i.current?.(u)}else s(d)},[a,e,s,i]);return[l,c]}function Sa({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),s=f.useRef(t);return Ea(()=>{s.current=t},[t]),f.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function Ra(e){return typeof e=="function"}var Ca=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Ta="VisuallyHidden",Ir=f.forwardRef((e,t)=>b.jsx(Te.span,{...e,ref:t,style:{...Ca,...e.style}}));Ir.displayName=Ta;var Oa=Ir,[pt]=ar("Tooltip",[Sr]),gt=Sr(),Lr="TooltipProvider",ka=700,kt="tooltip.open",[Pa,Ht]=pt(Lr),Mr=e=>{const{__scopeTooltip:t,delayDuration:n=ka,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=f.useRef(!0),a=f.useRef(!1),l=f.useRef(0);return f.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),b.jsx(Pa,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:f.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:s})};Mr.displayName=Lr;var He="Tooltip",[_a,ht]=pt(He),Dr=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,l=Ht(He,e.__scopeTooltip),c=gt(t),[d,u]=f.useState(null),m=Qs(),p=f.useRef(0),g=i??l.disableHoverableContent,y=a??l.delayDuration,w=f.useRef(!1),[x,E]=Aa({prop:r,defaultProp:o??!1,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(kt))):l.onClose(),s?.(T)},caller:He}),O=f.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),C=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,w.current=!1,E(!0)},[E]),k=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,E(!1)},[E]),P=f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{w.current=!0,E(!0),p.current=0},y)},[y,E]);return f.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),b.jsx(ma,{...c,children:b.jsx(_a,{scope:t,contentId:m,open:x,stateAttribute:O,trigger:d,onTriggerChange:u,onTriggerEnter:f.useCallback(()=>{l.isOpenDelayedRef.current?P():C()},[l.isOpenDelayedRef,P,C]),onTriggerLeave:f.useCallback(()=>{g?k():(window.clearTimeout(p.current),p.current=0)},[k,g]),onOpen:C,onClose:k,disableHoverableContent:g,children:n})})};Dr.displayName=He;var Pt="TooltipTrigger",jr=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ht(Pt,n),s=Ht(Pt,n),i=gt(n),a=f.useRef(null),l=Re(t,a,o.onTriggerChange),c=f.useRef(!1),d=f.useRef(!1),u=f.useCallback(()=>c.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),b.jsx(pa,{asChild:!0,...i,children:b.jsx(Te.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:le(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:le(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:le(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:le(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:le(e.onBlur,o.onClose),onClick:le(e.onClick,o.onClose)})})});jr.displayName=Pt;var Na="TooltipPortal",[tl,$a]=pt(Na,{forceMount:void 0}),Le="TooltipContent",zr=f.forwardRef((e,t)=>{const n=$a(Le,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=ht(Le,e.__scopeTooltip);return b.jsx($r,{present:r||i.open,children:i.disableHoverableContent?b.jsx(Ur,{side:o,...s,ref:t}):b.jsx(Ia,{side:o,...s,ref:t})})}),Ia=f.forwardRef((e,t)=>{const n=ht(Le,e.__scopeTooltip),r=Ht(Le,e.__scopeTooltip),o=f.useRef(null),s=Re(t,o),[i,a]=f.useState(null),{trigger:l,onClose:c}=n,d=o.current,{onPointerInTransitChange:u}=r,m=f.useCallback(()=>{a(null),u(!1)},[u]),p=f.useCallback((g,y)=>{const w=g.currentTarget,x={x:g.clientX,y:g.clientY},E=za(x,w.getBoundingClientRect()),O=Ua(x,E),C=Fa(y.getBoundingClientRect()),k=Wa([...O,...C]);a(k),u(!0)},[u]);return f.useEffect(()=>()=>m(),[m]),f.useEffect(()=>{if(l&&d){const g=w=>p(w,d),y=w=>p(w,l);return l.addEventListener("pointerleave",g),d.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",y)}}},[l,d,p,m]),f.useEffect(()=>{if(i){const g=y=>{const w=y.target,x={x:y.clientX,y:y.clientY},E=l?.contains(w)||d?.contains(w),O=!Ga(x,i);E?m():O&&(m(),c())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,d,i,c,m]),b.jsx(Ur,{...e,ref:s})}),[La,Ma]=pt(He,{isInside:!1}),Da=va("TooltipContent"),Ur=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,l=ht(Le,n),c=gt(n),{onClose:d}=l;return f.useEffect(()=>(document.addEventListener(kt,d),()=>document.removeEventListener(kt,d)),[d]),f.useEffect(()=>{if(l.trigger){const u=m=>{m.target?.contains(l.trigger)&&d()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[l.trigger,d]),b.jsx(cr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:u=>u.preventDefault(),onDismiss:d,children:b.jsxs(ga,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[b.jsx(Da,{children:r}),b.jsx(La,{scope:n,isInside:!0,children:b.jsx(Oa,{id:l.contentId,role:"tooltip",children:o||r})})]})})});zr.displayName=Le;var Fr="TooltipArrow",ja=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=gt(n);return Ma(Fr,n).isInside?null:b.jsx(ha,{...o,...r,ref:t})});ja.displayName=Fr;function za(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ua(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Fa(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Ga(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],l=t[i],c=a.x,d=a.y,u=l.x,m=l.y;d>r!=m>r&&n<(u-c)*(r-d)/(m-d)+c&&(o=!o)}return o}function Wa(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Va(t)}function Va(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Ha=Mr,Ba=Dr,Ya=jr,Gr=zr;const qa=Ha,Xa=Ba,Ka=Ya,Wr=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>b.jsx(Gr,{ref:r,sideOffset:t,className:me("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n}));Wr.displayName=Gr.displayName;const Ja="agent-approval-count-changed";function Za(e,t){if(e.length>0){const n=e[e.length-1];if(n&&typeof n=="object"&&!Array.isArray(n))return[...e.slice(0,-1),{...n,signal:t}]}return[...e,{signal:t}]}function Qa(e,t={}){const{domain:n="server",onSuccess:r,onError:o}=t,[s,i]=$.useState(!1),[a,l]=$.useState(null),[c,d]=$.useState(null),u=$.useRef(!0),m=$.useRef(null);$.useEffect(()=>(u.current=!0,()=>{u.current=!1,m.current&&m.current.abort()}),[]);const p=$.useCallback(()=>{u.current&&(l(null),d(null))},[]),g=$.useCallback(async(...y)=>{m.current&&m.current.abort();const w=new AbortController;m.current=w,u.current&&(i(!0),l(null));try{const x=await e(...Za(y,w.signal));return!u.current||w.signal.aborted?null:(d(x),r?.(x),x)}catch(x){if(!u.current||w.signal.aborted)return null;if(x instanceof K){if(x.domain=n,x.status===401)return null;x.status===408&&(x.message=`${n} timed out. Check your connection and try again.`)}return l(x),o?.(x),null}finally{m.current===w&&(m.current=null),u.current&&!w.signal.aborted&&i(!1)}},[e,n,o,r]);return{loading:s,error:a,data:c,execute:g,reset:p}}function el(){const[e,t]=$.useState(null),n=$.useCallback((o,s="error")=>{t({message:String(o),type:s}),setTimeout(()=>t(null),4e3)},[]),r=$.useCallback(()=>t(null),[]);return{toast:e,showToast:n,clearToast:r}}exports.API_BASE=At;exports.APPROVAL_EVENT=Ja;exports.AdminAccessRequired=_o;exports.ApiError=K;exports.AppShell=Ao;exports.AuthProvider=bo;exports.Button=er;exports.Card=tr;exports.CardContent=sr;exports.CardDescription=or;exports.CardFooter=ir;exports.CardHeader=nr;exports.CardTitle=rr;exports.DomainError=ko;exports.EmptyState=No;exports.FEATURE_FLAGS=Zr;exports.LoadingPanel=Oo;exports.ProtectedRoute=So;exports.ROUTES=fe;exports.SystemProvider=yo;exports.Toast=To;exports.Tooltip=Xa;exports.TooltipContent=Wr;exports.TooltipProvider=qa;exports.TooltipTrigger=Ka;exports.VersionMismatchBanner=Co;exports.adminRequest=Kr;exports.authRequest=Cn;exports.authRequestExternal=Jr;exports.bootIdentity=_n;exports.buildApiUrl=An;exports.buttonVariants=Qn;exports.changePassword=Pn;exports.clearStoredToken=_e;exports.cn=me;exports.forgotPassword=po;exports.getStoredToken=ce;exports.loginUser=Tn;exports.registerUser=On;exports.request=ee;exports.requestAbsolute=$t;exports.resetPassword=go;exports.safeArray=Hr;exports.safeMap=Et;exports.setStoredToken=Ge;exports.taggedRequest=Yr;exports.unwrapEnvelope=xe;exports.useAdminApiGuard=Po;exports.useApiCall=Qa;exports.useAuth=lt;exports.useSystem=Ln;exports.useToast=el;exports.verifyEmail=kn;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|