clankie 0.2.10 → 0.2.12

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.
@@ -1,4 +1,4 @@
1
- import{c as Dt,j as f,B as ti,X as gv,f as Kt,m as Hn,M as Os,r as g,N as bv,O as vv,Q as yv,R as sc,T as lc,U as Ao,V as cc,W as uc,Y as dc,Z as fc,p as ni,_ as xv,$ as wv,a0 as _v,a1 as Ev,a2 as Ms,a3 as H,a4 as Ps,a5 as Sd,a6 as Sv,a7 as kv,a8 as Nv,a9 as Cv,aa as Tv,ab as Av,ac as Iv,ad as Rv,ae as Ov,af as Mv,ag as Pv,ah as Dv,ai as Lv,J as io,aj as $v,ak as zv,al as jv,am as Fv,an as Bv,K as Uv,q as Hv,A as Vv,H as pc,L as Gv}from"./main-DUT2mAkp.js";import{L as Ds}from"./loader-circle-CO83p2nq.js";const Zv=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],mc=Dt("check",Zv);const Kv=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ls=Dt("chevron-down",Kv);const Wv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],qv=Dt("clock-3",Wv);const Yv=[["path",{d:"M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z",key:"ukzhwg"}],["path",{d:"M14.487 7.858A1 1 0 0 1 14 7V2",key:"1klhew"}],["path",{d:"M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516",key:"rxaxab"}],["path",{d:"M8 18h1",key:"13wk12"}]],Xv=Dt("file-pen-line",Yv);const Jv=[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],Qv=Dt("file-plus-corner",Jv);const ey=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ty=Dt("file-text",ey);const ny=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],kd=Dt("file",ny);const ry=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],oy=Dt("folder-open",ry);const iy=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],ay=Dt("folder-tree",iy);const sy=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],ly=Dt("paperclip",sy);const cy=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],uy=Dt("search",cy);const dy=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],fy=Dt("send",dy);const py=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],my=Dt("terminal",py);const hy=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],gy=Dt("wrench",hy);function by({attachments:e,onRemove:t}){return e.length===0?null:f.jsx("div",{className:"flex flex-wrap gap-2 pb-2",children:e.map(n=>{const r=n.mimeType.startsWith("image/");return f.jsxs("div",{className:Kt("group relative flex items-center gap-2 rounded-lg border border-border bg-muted px-3 py-2","hover:bg-muted/80 transition-colors"),children:[r&&n.preview?f.jsx("div",{className:"relative h-12 w-12 shrink-0 overflow-hidden rounded",children:f.jsx("img",{src:n.preview,alt:n.file.name,className:"h-full w-full object-cover"})}):f.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded bg-background",children:f.jsx(kd,{className:"h-6 w-6 text-muted-foreground"})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("p",{className:"text-sm font-medium truncate",children:n.file.name}),f.jsx("p",{className:"text-xs text-muted-foreground",children:vy(n.file.size)})]}),f.jsxs(ti,{type:"button",variant:"ghost",size:"icon-xs",onClick:()=>t(n.id),className:"shrink-0",title:"Remove attachment",children:[f.jsx(gv,{className:"h-3 w-3"}),f.jsxs("span",{className:"sr-only",children:["Remove ",n.file.name]})]})]},n.id)})})}function vy(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${Math.round(e/t**r*100)/100} ${n[r]}`}function pa(e){return{anthropic:"Anthropic",openai:"OpenAI",google:"Google","amazon-bedrock":"Amazon Bedrock",openrouter:"OpenRouter","vercel-ai-gateway":"Vercel AI Gateway",xai:"xAI",mistral:"Mistral",groq:"Groq",huggingface:"Hugging Face","google-vertex":"Google Vertex AI","google-antigravity":"Google Antigravity","google-gemini-cli":"Google Gemini CLI","azure-openai-responses":"Azure OpenAI","github-copilot":"GitHub Copilot",cerebras:"Cerebras",opencode:"OpenCode",zai:"Z.ai",minimax:"MiniMax","minimax-cn":"MiniMax (CN)","kimi-coding":"Kimi"}[e]||e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function hc(e){const t=e.replace(/\s+\((EU|US|Global|latest|free|exacto|thinking|Antigravity)\)$/i,"").trim(),n=t.match(/\s+([\d.]+)$/);if(n){const r=n[1],o=parseFloat(r);if(!isNaN(o))return{family:t.substring(0,t.length-n[0].length).trim(),version:o}}return{family:t,version:null}}function yy(e){const t=new Map;for(const o of e){const{family:i}=hc(o.name);t.has(i)||t.set(i,[]),t.get(i).push(o)}const n=[],r=[];for(const[o,i]of t){if(i.length===1){n.push(i[0]);continue}const a=i.map(c=>({model:c,...hc(c.name)})),s=a.filter(c=>c.version===null),l=a.filter(c=>c.version!==null);if(l.length===0)n.push(...i);else{const c=Math.max(...l.map(p=>p.version)),u=l.filter(p=>p.version===c),d=l.filter(p=>p.version!==c);n.push(...u.map(p=>p.model)),n.push(...s.map(p=>p.model)),r.push(...d.map(p=>p.model))}}return{latest:n,older:r}}function xy(e){const t=new Map;for(const n of e)t.has(n.provider)||t.set(n.provider,[]),t.get(n.provider).push(n);for(const[n,r]of t)r.sort((o,i)=>o.name.localeCompare(i.name));return t}function wy(){const{sessionId:e,model:t,availableModels:n,thinkingLevel:r,isStreaming:o}=Hn(Os,h=>({sessionId:h.sessionId,model:h.model,availableModels:h.availableModels,thinkingLevel:h.thinkingLevel,isStreaming:h.isStreaming})),[i,a]=g.useState(!1),{latestModels:s,olderModels:l,shouldShowSubmenu:c}=g.useMemo(()=>{if(n.length===0)return{latestModels:[],olderModels:[],shouldShowSubmenu:!1};if(n.length<=10)return{latestModels:[...n].sort((x,w)=>x.name.localeCompare(w.name)),olderModels:[],shouldShowSubmenu:!1};const{latest:h,older:y}=yy(n);return h.sort((v,x)=>v.name.localeCompare(x.name)),{latestModels:h,olderModels:y,shouldShowSubmenu:y.length>0}},[n]),u=g.useMemo(()=>xy(l),[l]),d=async(h,y)=>{if(!e){console.log("[ModelSelector] No sessionId");return}console.log("[ModelSelector] Changing model:",{provider:h,modelId:y,sessionId:e});const v=ni.getClient();if(v)try{const x=await v.setModel(e,h,y);console.log("[ModelSelector] Model changed successfully:",x),wv(x),a(!1)}catch(x){console.error("[ModelSelector] Failed to set model:",x)}else console.error("[ModelSelector] No client available")},p=async h=>{if(!e)return;const y=ni.getClient();if(y)try{await y.setThinkingLevel(e,h),xv(h)}catch(v){console.error("Failed to set thinking level:",v)}},m=[{value:"off",label:"Off"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"XHigh"}];if(!t)return null;const b=h=>{const y=t.provider===h.provider&&t.id===h.id;return f.jsxs(fc,{onClick:()=>d(h.provider,h.id),className:"flex items-start gap-2 py-2",children:[f.jsx("div",{className:"flex h-5 w-5 items-center justify-center shrink-0",children:y&&f.jsx(mc,{className:"h-4 w-4"})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"font-medium",children:h.name}),f.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:_y(h)})]})]},`${h.provider}/${h.id}`)};return f.jsxs(bv,{open:i,onOpenChange:a,children:[f.jsxs(vv,{type:"button",disabled:o||!e,className:Kt("flex flex-col items-start gap-0.5 rounded-lg border border-border bg-background px-3 py-1.5 text-sm transition-colors","hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[f.jsxs("div",{className:"flex items-center gap-1.5 w-full",children:[f.jsx("span",{className:"font-medium",children:t.name}),f.jsx(Ls,{className:"h-4 w-4 text-muted-foreground ml-auto"})]}),r!=="medium"&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:["thinking: ",r]})]}),f.jsxs(yv,{align:"end",className:"w-80",children:[f.jsx(sc,{children:f.jsx(lc,{children:"Select Model"})}),f.jsx(Ao,{}),f.jsx("div",{className:"max-h-96 overflow-y-auto",children:s.map(b)}),c&&f.jsxs(f.Fragment,{children:[f.jsx(Ao,{}),f.jsxs(cc,{children:[f.jsx(uc,{children:f.jsx("span",{children:"Other models"})}),f.jsx(dc,{className:"w-80 max-h-96 overflow-y-auto",children:Array.from(u.entries()).sort(([h],[y])=>pa(h).localeCompare(pa(y))).map(([h,y])=>f.jsxs("div",{children:[f.jsx(sc,{children:f.jsx(lc,{className:"sticky top-0 bg-popover z-10",children:pa(h)})}),y.map(b),f.jsx(Ao,{className:"my-1"})]},h))})]})]}),f.jsx(Ao,{}),f.jsxs(cc,{children:[f.jsx(uc,{children:f.jsx("span",{children:"Thinking Level"})}),f.jsx(dc,{children:m.map(h=>f.jsxs(fc,{onClick:()=>p(h.value),className:"flex items-center gap-2",children:[f.jsx("div",{className:"flex h-5 w-5 items-center justify-center shrink-0",children:r===h.value&&f.jsx(mc,{className:"h-4 w-4"})}),f.jsx("span",{children:h.label})]},h.value))})]})]})]})}function _y(e){const t=e.name.toLowerCase();return t.includes("opus")?"Most capable for ambitious work":t.includes("sonnet")?"Most efficient for everyday tasks":t.includes("haiku")?"Fastest for quick answers":t.includes("gpt-4")?"Advanced reasoning and analysis":t.includes("gpt-3.5")?"Fast and efficient":t.includes("gemini")?"Google's multimodal AI":t.includes("claude")?"Anthropic's AI assistant":`${e.provider}/${e.id}`}const gc=10*1024*1024,bc=20*1024*1024;function Ey(){const{sessionId:e,isStreaming:t}=Hn(Os,C=>({sessionId:C.sessionId,isStreaming:C.isStreaming})),[n,r]=g.useState(""),[o,i]=g.useState([]),[a,s]=g.useState(!1),l=g.useRef(null),c=g.useRef(null),u=g.useCallback(C=>new Promise((E,A)=>{const R=new FileReader;R.onload=()=>{const T=R.result.split(",")[1];E(T)},R.onerror=A,R.readAsDataURL(C)}),[]),d=g.useCallback(C=>C.type.startsWith("image/")?new Promise(E=>{const A=new FileReader;A.onload=()=>E(A.result),A.onerror=()=>E(void 0),A.readAsDataURL(C)}):Promise.resolve(void 0),[]),p=g.useCallback(async C=>{const E=Array.from(C),A=o.reduce((M,T)=>M+T.file.size,0),R=E.reduce((M,T)=>M+T.size,0);if(A+R>bc){alert(`Total attachment size cannot exceed ${bc/1024/1024}MB`);return}for(const M of E){if(M.size>gc){alert(`File "${M.name}" is too large. Maximum size is ${gc/1024/1024}MB`);continue}try{const T=await u(M),I=await d(M),O={id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,file:M,preview:I,base64:T,mimeType:M.type};i(D=>[...D,O])}catch(T){console.error(`Failed to process file "${M.name}":`,T),alert(`Failed to process file "${M.name}"`)}}},[o,u,d]),m=g.useCallback(C=>{const E=C.target.files;E&&E.length>0&&p(E),c.current&&(c.current.value="")},[p]),b=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),s(!0)},[]),h=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),s(!1)},[]),y=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),s(!1);const E=C.dataTransfer.files;E.length>0&&p(E)},[p]),v=g.useCallback(C=>{const E=C.clipboardData.items,A=[];for(const R of Array.from(E))if(R.kind==="file"){const M=R.getAsFile();M&&A.push(M)}A.length>0&&(C.preventDefault(),p(A))},[p]),x=g.useCallback(C=>{i(E=>E.filter(A=>A.id!==C))},[]),w=async()=>{if(!n.trim()&&o.length===0||!e||t)return;const C=n.trim(),E=[...o];r(""),i([]);const A=E.map(O=>({type:O.mimeType.startsWith("image/")?"image":"file",name:O.file.name,mimeType:O.mimeType,previewUrl:O.preview})),R=E.filter(O=>O.mimeType.startsWith("image/")).map(O=>({type:"image",data:O.base64,mimeType:O.mimeType})),M=E.filter(O=>!O.mimeType.startsWith("image/")),T=ni.getClient();if(!T){console.error("No client available");return}let I=C;try{for(const D of M)try{const L=await T.uploadAttachment(e,D.file.name,D.base64,D.mimeType);I+=`
1
+ import{c as Dt,j as f,B as ti,X as gv,f as Kt,m as Hn,M as Os,r as g,N as bv,O as vv,Q as yv,R as sc,T as lc,U as Ao,V as cc,W as uc,Y as dc,Z as fc,p as ni,_ as xv,$ as wv,a0 as _v,a1 as Ev,a2 as Ms,a3 as H,a4 as Ps,a5 as Sd,a6 as Sv,a7 as kv,a8 as Nv,a9 as Cv,aa as Tv,ab as Av,ac as Iv,ad as Rv,ae as Ov,af as Mv,ag as Pv,ah as Dv,ai as Lv,J as io,aj as $v,ak as zv,al as jv,am as Fv,an as Bv,K as Uv,q as Hv,A as Vv,H as pc,L as Gv}from"./main-UkFzTTck.js";import{L as Ds}from"./loader-circle-DJwIWnWV.js";const Zv=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],mc=Dt("check",Zv);const Kv=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ls=Dt("chevron-down",Kv);const Wv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],qv=Dt("clock-3",Wv);const Yv=[["path",{d:"M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z",key:"ukzhwg"}],["path",{d:"M14.487 7.858A1 1 0 0 1 14 7V2",key:"1klhew"}],["path",{d:"M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516",key:"rxaxab"}],["path",{d:"M8 18h1",key:"13wk12"}]],Xv=Dt("file-pen-line",Yv);const Jv=[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],Qv=Dt("file-plus-corner",Jv);const ey=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ty=Dt("file-text",ey);const ny=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],kd=Dt("file",ny);const ry=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],oy=Dt("folder-open",ry);const iy=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],ay=Dt("folder-tree",iy);const sy=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],ly=Dt("paperclip",sy);const cy=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],uy=Dt("search",cy);const dy=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],fy=Dt("send",dy);const py=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],my=Dt("terminal",py);const hy=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],gy=Dt("wrench",hy);function by({attachments:e,onRemove:t}){return e.length===0?null:f.jsx("div",{className:"flex flex-wrap gap-2 pb-2",children:e.map(n=>{const r=n.mimeType.startsWith("image/");return f.jsxs("div",{className:Kt("group relative flex items-center gap-2 rounded-lg border border-border bg-muted px-3 py-2","hover:bg-muted/80 transition-colors"),children:[r&&n.preview?f.jsx("div",{className:"relative h-12 w-12 shrink-0 overflow-hidden rounded",children:f.jsx("img",{src:n.preview,alt:n.file.name,className:"h-full w-full object-cover"})}):f.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded bg-background",children:f.jsx(kd,{className:"h-6 w-6 text-muted-foreground"})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("p",{className:"text-sm font-medium truncate",children:n.file.name}),f.jsx("p",{className:"text-xs text-muted-foreground",children:vy(n.file.size)})]}),f.jsxs(ti,{type:"button",variant:"ghost",size:"icon-xs",onClick:()=>t(n.id),className:"shrink-0",title:"Remove attachment",children:[f.jsx(gv,{className:"h-3 w-3"}),f.jsxs("span",{className:"sr-only",children:["Remove ",n.file.name]})]})]},n.id)})})}function vy(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${Math.round(e/t**r*100)/100} ${n[r]}`}function pa(e){return{anthropic:"Anthropic",openai:"OpenAI",google:"Google","amazon-bedrock":"Amazon Bedrock",openrouter:"OpenRouter","vercel-ai-gateway":"Vercel AI Gateway",xai:"xAI",mistral:"Mistral",groq:"Groq",huggingface:"Hugging Face","google-vertex":"Google Vertex AI","google-antigravity":"Google Antigravity","google-gemini-cli":"Google Gemini CLI","azure-openai-responses":"Azure OpenAI","github-copilot":"GitHub Copilot",cerebras:"Cerebras",opencode:"OpenCode",zai:"Z.ai",minimax:"MiniMax","minimax-cn":"MiniMax (CN)","kimi-coding":"Kimi"}[e]||e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function hc(e){const t=e.replace(/\s+\((EU|US|Global|latest|free|exacto|thinking|Antigravity)\)$/i,"").trim(),n=t.match(/\s+([\d.]+)$/);if(n){const r=n[1],o=parseFloat(r);if(!isNaN(o))return{family:t.substring(0,t.length-n[0].length).trim(),version:o}}return{family:t,version:null}}function yy(e){const t=new Map;for(const o of e){const{family:i}=hc(o.name);t.has(i)||t.set(i,[]),t.get(i).push(o)}const n=[],r=[];for(const[o,i]of t){if(i.length===1){n.push(i[0]);continue}const a=i.map(c=>({model:c,...hc(c.name)})),s=a.filter(c=>c.version===null),l=a.filter(c=>c.version!==null);if(l.length===0)n.push(...i);else{const c=Math.max(...l.map(p=>p.version)),u=l.filter(p=>p.version===c),d=l.filter(p=>p.version!==c);n.push(...u.map(p=>p.model)),n.push(...s.map(p=>p.model)),r.push(...d.map(p=>p.model))}}return{latest:n,older:r}}function xy(e){const t=new Map;for(const n of e)t.has(n.provider)||t.set(n.provider,[]),t.get(n.provider).push(n);for(const[n,r]of t)r.sort((o,i)=>o.name.localeCompare(i.name));return t}function wy(){const{sessionId:e,model:t,availableModels:n,thinkingLevel:r,isStreaming:o}=Hn(Os,h=>({sessionId:h.sessionId,model:h.model,availableModels:h.availableModels,thinkingLevel:h.thinkingLevel,isStreaming:h.isStreaming})),[i,a]=g.useState(!1),{latestModels:s,olderModels:l,shouldShowSubmenu:c}=g.useMemo(()=>{if(n.length===0)return{latestModels:[],olderModels:[],shouldShowSubmenu:!1};if(n.length<=10)return{latestModels:[...n].sort((x,w)=>x.name.localeCompare(w.name)),olderModels:[],shouldShowSubmenu:!1};const{latest:h,older:y}=yy(n);return h.sort((v,x)=>v.name.localeCompare(x.name)),{latestModels:h,olderModels:y,shouldShowSubmenu:y.length>0}},[n]),u=g.useMemo(()=>xy(l),[l]),d=async(h,y)=>{if(!e){console.log("[ModelSelector] No sessionId");return}console.log("[ModelSelector] Changing model:",{provider:h,modelId:y,sessionId:e});const v=ni.getClient();if(v)try{const x=await v.setModel(e,h,y);console.log("[ModelSelector] Model changed successfully:",x),wv(x),a(!1)}catch(x){console.error("[ModelSelector] Failed to set model:",x)}else console.error("[ModelSelector] No client available")},p=async h=>{if(!e)return;const y=ni.getClient();if(y)try{await y.setThinkingLevel(e,h),xv(h)}catch(v){console.error("Failed to set thinking level:",v)}},m=[{value:"off",label:"Off"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"XHigh"}];if(!t)return null;const b=h=>{const y=t.provider===h.provider&&t.id===h.id;return f.jsxs(fc,{onClick:()=>d(h.provider,h.id),className:"flex items-start gap-2 py-2",children:[f.jsx("div",{className:"flex h-5 w-5 items-center justify-center shrink-0",children:y&&f.jsx(mc,{className:"h-4 w-4"})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"font-medium",children:h.name}),f.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:_y(h)})]})]},`${h.provider}/${h.id}`)};return f.jsxs(bv,{open:i,onOpenChange:a,children:[f.jsxs(vv,{type:"button",disabled:o||!e,className:Kt("flex flex-col items-start gap-0.5 rounded-lg border border-border bg-background px-3 py-1.5 text-sm transition-colors","hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[f.jsxs("div",{className:"flex items-center gap-1.5 w-full",children:[f.jsx("span",{className:"font-medium",children:t.name}),f.jsx(Ls,{className:"h-4 w-4 text-muted-foreground ml-auto"})]}),r!=="medium"&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:["thinking: ",r]})]}),f.jsxs(yv,{align:"end",className:"w-80",children:[f.jsx(sc,{children:f.jsx(lc,{children:"Select Model"})}),f.jsx(Ao,{}),f.jsx("div",{className:"max-h-96 overflow-y-auto",children:s.map(b)}),c&&f.jsxs(f.Fragment,{children:[f.jsx(Ao,{}),f.jsxs(cc,{children:[f.jsx(uc,{children:f.jsx("span",{children:"Other models"})}),f.jsx(dc,{className:"w-80 max-h-96 overflow-y-auto",children:Array.from(u.entries()).sort(([h],[y])=>pa(h).localeCompare(pa(y))).map(([h,y])=>f.jsxs("div",{children:[f.jsx(sc,{children:f.jsx(lc,{className:"sticky top-0 bg-popover z-10",children:pa(h)})}),y.map(b),f.jsx(Ao,{className:"my-1"})]},h))})]})]}),f.jsx(Ao,{}),f.jsxs(cc,{children:[f.jsx(uc,{children:f.jsx("span",{children:"Thinking Level"})}),f.jsx(dc,{children:m.map(h=>f.jsxs(fc,{onClick:()=>p(h.value),className:"flex items-center gap-2",children:[f.jsx("div",{className:"flex h-5 w-5 items-center justify-center shrink-0",children:r===h.value&&f.jsx(mc,{className:"h-4 w-4"})}),f.jsx("span",{children:h.label})]},h.value))})]})]})]})}function _y(e){const t=e.name.toLowerCase();return t.includes("opus")?"Most capable for ambitious work":t.includes("sonnet")?"Most efficient for everyday tasks":t.includes("haiku")?"Fastest for quick answers":t.includes("gpt-4")?"Advanced reasoning and analysis":t.includes("gpt-3.5")?"Fast and efficient":t.includes("gemini")?"Google's multimodal AI":t.includes("claude")?"Anthropic's AI assistant":`${e.provider}/${e.id}`}const gc=10*1024*1024,bc=20*1024*1024;function Ey(){const{sessionId:e,isStreaming:t}=Hn(Os,C=>({sessionId:C.sessionId,isStreaming:C.isStreaming})),[n,r]=g.useState(""),[o,i]=g.useState([]),[a,s]=g.useState(!1),l=g.useRef(null),c=g.useRef(null),u=g.useCallback(C=>new Promise((E,A)=>{const R=new FileReader;R.onload=()=>{const T=R.result.split(",")[1];E(T)},R.onerror=A,R.readAsDataURL(C)}),[]),d=g.useCallback(C=>C.type.startsWith("image/")?new Promise(E=>{const A=new FileReader;A.onload=()=>E(A.result),A.onerror=()=>E(void 0),A.readAsDataURL(C)}):Promise.resolve(void 0),[]),p=g.useCallback(async C=>{const E=Array.from(C),A=o.reduce((M,T)=>M+T.file.size,0),R=E.reduce((M,T)=>M+T.size,0);if(A+R>bc){alert(`Total attachment size cannot exceed ${bc/1024/1024}MB`);return}for(const M of E){if(M.size>gc){alert(`File "${M.name}" is too large. Maximum size is ${gc/1024/1024}MB`);continue}try{const T=await u(M),I=await d(M),O={id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,file:M,preview:I,base64:T,mimeType:M.type};i(D=>[...D,O])}catch(T){console.error(`Failed to process file "${M.name}":`,T),alert(`Failed to process file "${M.name}"`)}}},[o,u,d]),m=g.useCallback(C=>{const E=C.target.files;E&&E.length>0&&p(E),c.current&&(c.current.value="")},[p]),b=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),s(!0)},[]),h=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),s(!1)},[]),y=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),s(!1);const E=C.dataTransfer.files;E.length>0&&p(E)},[p]),v=g.useCallback(C=>{const E=C.clipboardData.items,A=[];for(const R of Array.from(E))if(R.kind==="file"){const M=R.getAsFile();M&&A.push(M)}A.length>0&&(C.preventDefault(),p(A))},[p]),x=g.useCallback(C=>{i(E=>E.filter(A=>A.id!==C))},[]),w=async()=>{if(!n.trim()&&o.length===0||!e||t)return;const C=n.trim(),E=[...o];r(""),i([]);const A=E.map(O=>({type:O.mimeType.startsWith("image/")?"image":"file",name:O.file.name,mimeType:O.mimeType,previewUrl:O.preview})),R=E.filter(O=>O.mimeType.startsWith("image/")).map(O=>({type:"image",data:O.base64,mimeType:O.mimeType})),M=E.filter(O=>!O.mimeType.startsWith("image/")),T=ni.getClient();if(!T){console.error("No client available");return}let I=C;try{for(const D of M)try{const L=await T.uploadAttachment(e,D.file.name,D.base64,D.mimeType);I+=`
2
2
  [Attached: ${L.fileName}]`}catch(L){console.error(`Failed to upload ${D.file.name}:`,L)}const O=I.replace(/(?:^|\n)\[Attached: [^\]]+\]/g,"").replace(/\n{3,}/g,`
3
3
 
4
4
  `).trim();Ev(O,A),await T.prompt(e,I,R.length>0?R:void 0)}catch(O){console.error("Failed to send message:",O)}l.current?.focus()},_=C=>{C.key==="Enter"&&(C.ctrlKey||C.metaKey)&&(C.preventDefault(),w())};return f.jsx("div",{className:"border-t border-border bg-card p-4",onDragOver:b,onDragLeave:h,onDrop:y,children:f.jsx("div",{className:"mx-auto w-full max-w-3xl",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(by,{attachments:o,onRemove:x}),f.jsxs("div",{className:"relative",children:[f.jsx(_v,{ref:l,id:"chat-input",name:"message",value:n,onChange:C=>r(C.target.value),onKeyDown:_,onPaste:v,placeholder:"Send a message... (Ctrl+Enter to send)",className:"min-h-[80px] resize-none focus-glow",disabled:!e||t}),a&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-lg border-2 border-dashed border-primary bg-background/80 backdrop-blur-sm",children:f.jsx("p",{className:"text-sm font-medium text-primary",children:"Drop files here"})})]}),f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{ref:c,type:"file",multiple:!0,onChange:m,className:"hidden",accept:"image/*,application/pdf,text/*"}),f.jsxs(ti,{type:"button",variant:"ghost",size:"icon-sm",disabled:!e||t,onClick:()=>c.current?.click(),title:"Attach files",children:[f.jsx(ly,{className:"h-4 w-4"}),f.jsx("span",{className:"sr-only",children:"Attach files"})]}),f.jsxs("p",{className:"text-xs text-muted-foreground",children:[f.jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5",children:"Ctrl+Enter"})," ","to send"]})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(wy,{}),f.jsxs(ti,{onClick:w,disabled:!n.trim()&&o.length===0||!e||t,size:"icon",className:"transition-transform hover:scale-105 active:scale-95",children:[f.jsx(fy,{className:"h-4 w-4"}),f.jsx("span",{className:"sr-only",children:"Send message"})]})]})]})]})})})}function Sy(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ky=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ny=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Cy={};function vc(e,t){return(Cy.jsx?Ny:ky).test(e)}const Ty=/[ \t\n\f\r]/g;function Ay(e){return typeof e=="object"?e.type==="text"?yc(e.value):!1:yc(e)}function yc(e){return e.replace(Ty,"")===""}class ao{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ao.prototype.normal={};ao.prototype.property={};ao.prototype.space=void 0;function Nd(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new ao(n,r,t)}function Ya(e){return e.toLowerCase()}class Lt{constructor(t,n){this.attribute=n,this.property=t}}Lt.prototype.attribute="";Lt.prototype.booleanish=!1;Lt.prototype.boolean=!1;Lt.prototype.commaOrSpaceSeparated=!1;Lt.prototype.commaSeparated=!1;Lt.prototype.defined=!1;Lt.prototype.mustUseProperty=!1;Lt.prototype.number=!1;Lt.prototype.overloadedBoolean=!1;Lt.prototype.property="";Lt.prototype.spaceSeparated=!1;Lt.prototype.space=void 0;let Iy=0;const Ne=Yn(),it=Yn(),Xa=Yn(),Z=Yn(),We=Yn(),br=Yn(),Ft=Yn();function Yn(){return 2**++Iy}const Ja=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ne,booleanish:it,commaOrSpaceSeparated:Ft,commaSeparated:br,number:Z,overloadedBoolean:Xa,spaceSeparated:We},Symbol.toStringTag,{value:"Module"})),ma=Object.keys(Ja);class $s extends Lt{constructor(t,n,r,o){let i=-1;if(super(t,n),xc(this,"space",o),typeof r=="number")for(;++i<ma.length;){const a=ma[i];xc(this,ma[i],(r&Ja[a])===Ja[a])}}}$s.prototype.defined=!0;function xc(e,t,n){n&&(e[t]=n)}function kr(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new $s(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Ya(r)]=r,n[Ya(i.attribute)]=r}return new ao(t,n,e.space)}const Cd=kr({properties:{ariaActiveDescendant:null,ariaAtomic:it,ariaAutoComplete:null,ariaBusy:it,ariaChecked:it,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:We,ariaCurrent:null,ariaDescribedBy:We,ariaDetails:null,ariaDisabled:it,ariaDropEffect:We,ariaErrorMessage:null,ariaExpanded:it,ariaFlowTo:We,ariaGrabbed:it,ariaHasPopup:null,ariaHidden:it,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:We,ariaLevel:Z,ariaLive:null,ariaModal:it,ariaMultiLine:it,ariaMultiSelectable:it,ariaOrientation:null,ariaOwns:We,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:it,ariaReadOnly:it,ariaRelevant:null,ariaRequired:it,ariaRoleDescription:We,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:it,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Td(e,t){return t in e?e[t]:t}function Ad(e,t){return Td(e,t.toLowerCase())}const Ry=kr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:br,acceptCharset:We,accessKey:We,action:null,allow:null,allowFullScreen:Ne,allowPaymentRequest:Ne,allowUserMedia:Ne,alt:null,as:null,async:Ne,autoCapitalize:null,autoComplete:We,autoFocus:Ne,autoPlay:Ne,blocking:We,capture:null,charSet:null,checked:Ne,cite:null,className:We,cols:Z,colSpan:null,content:null,contentEditable:it,controls:Ne,controlsList:We,coords:Z|br,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ne,defer:Ne,dir:null,dirName:null,disabled:Ne,download:Xa,draggable:it,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ne,formTarget:null,headers:We,height:Z,hidden:Xa,high:Z,href:null,hrefLang:null,htmlFor:We,httpEquiv:We,id:null,imageSizes:null,imageSrcSet:null,inert:Ne,inputMode:null,integrity:null,is:null,isMap:Ne,itemId:null,itemProp:We,itemRef:We,itemScope:Ne,itemType:We,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ne,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:Ne,muted:Ne,name:null,nonce:null,noModule:Ne,noValidate:Ne,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ne,optimum:Z,pattern:null,ping:We,placeholder:null,playsInline:Ne,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ne,referrerPolicy:null,rel:We,required:Ne,reversed:Ne,rows:Z,rowSpan:Z,sandbox:We,scope:null,scoped:Ne,seamless:Ne,selected:Ne,shadowRootClonable:Ne,shadowRootDelegatesFocus:Ne,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:it,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:Ne,useMap:null,value:it,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:We,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ne,declare:Ne,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:Ne,noHref:Ne,noShade:Ne,noWrap:Ne,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:it,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ne,disableRemotePlayback:Ne,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:Ad}),Oy=kr({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ft,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:We,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:Ne,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:br,g2:br,glyphName:br,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:Ft,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:We,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ft,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ft,rev:Ft,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ft,requiredFeatures:Ft,requiredFonts:Ft,requiredFormats:Ft,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:Ft,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ft,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ft,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Td}),Id=kr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Rd=kr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ad}),Od=kr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),My={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Py=/[A-Z]/g,wc=/-[a-z]/g,Dy=/^data[-\w.:]+$/i;function Ly(e,t){const n=Ya(t);let r=t,o=Lt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Dy.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(wc,zy);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!wc.test(i)){let a=i.replace(Py,$y);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}o=$s}return new o(r,t)}function $y(e){return"-"+e.toLowerCase()}function zy(e){return e.charAt(1).toUpperCase()}const jy=Nd([Cd,Ry,Id,Rd,Od],"html"),zs=Nd([Cd,Oy,Id,Rd,Od],"svg");function Fy(e){return e.join(" ").trim()}var tr={},ha,_c;function By(){if(_c)return ha;_c=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,l=`
@@ -128,4 +128,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
128
128
 
129
129
  Defaulting to \`null\`.`}var FD=Qh,BD=tg,$l="Radio",[UD,rg]=lt($l),[HD,VD]=UD($l),og=g.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:a,value:s="on",onCheck:l,form:c,...u}=e,[d,p]=g.useState(null),m=_e(t,y=>p(y)),b=g.useRef(!1),h=d?c||!!d.closest("form"):!0;return f.jsxs(HD,{scope:n,checked:o,disabled:a,children:[f.jsx(oe.button,{type:"button",role:"radio","aria-checked":o,"data-state":lg(o),"data-disabled":a?"":void 0,disabled:a,value:s,...u,ref:m,onClick:J(e.onClick,y=>{o||l?.(),h&&(b.current=y.isPropagationStopped(),b.current||y.stopPropagation())})}),h&&f.jsx(sg,{control:d,bubbles:!b.current,name:r,value:s,checked:o,required:i,disabled:a,form:c,style:{transform:"translateX(-100%)"}})]})});og.displayName=$l;var ig="RadioIndicator",ag=g.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=VD(ig,n);return f.jsx(Nt,{present:r||i.checked,children:f.jsx(oe.span,{"data-state":lg(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});ag.displayName=ig;var GD="RadioBubbleInput",sg=g.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},i)=>{const a=g.useRef(null),s=_e(a,i),l=mo(n),c=ho(t);return g.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&m){const b=new Event("click",{bubbles:r});m.call(u,n),u.dispatchEvent(b)}},[l,n,r]),f.jsx(oe.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...o.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});sg.displayName=GD;function lg(e){return e?"checked":"unchecked"}var ZD=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Yi="RadioGroup",[KD]=lt(Yi,[Pn,rg]),cg=Pn(),ug=rg(),[WD,qD]=KD(Yi),dg=g.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:a=!1,disabled:s=!1,orientation:l,dir:c,loop:u=!0,onValueChange:d,...p}=e,m=cg(n),b=On(c),[h,y]=vt({prop:i,defaultProp:o??null,onChange:d,caller:Yi});return f.jsx(WD,{scope:n,name:r,required:a,disabled:s,value:h,onValueChange:y,children:f.jsx(Vi,{asChild:!0,...m,orientation:l,dir:b,loop:u,children:f.jsx(oe.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":s?"":void 0,dir:b,...p,ref:t})})})});dg.displayName=Yi;var fg="RadioGroupItem",pg=g.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=qD(fg,n),a=i.disabled||r,s=cg(n),l=ug(n),c=g.useRef(null),u=_e(t,c),d=i.value===o.value,p=g.useRef(!1);return g.useEffect(()=>{const m=h=>{ZD.includes(h.key)&&(p.current=!0)},b=()=>p.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",b)}},[]),f.jsx(Gi,{asChild:!0,...s,focusable:!a,active:d,children:f.jsx(og,{disabled:a,required:i.required,checked:d,...l,...o,name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:J(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:J(o.onFocus,()=>{p.current&&c.current?.click()})})})});pg.displayName=fg;var YD="RadioGroupIndicator",mg=g.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=ug(n);return f.jsx(ag,{...o,...r,ref:t})});mg.displayName=YD;var XD=dg,JD=pg,QD=mg,eL=[" ","Enter","ArrowUp","ArrowDown"],tL=[" ","Enter"],Kn="Select",[Xi,Ji,nL]=uo(Kn),[Ir]=lt(Kn,[nL,Mn]),Qi=Mn(),[rL,Ln]=Ir(Kn),[oL,iL]=Ir(Kn),hg=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:p,required:m,form:b}=e,h=Qi(t),[y,v]=g.useState(null),[x,w]=g.useState(null),[_,C]=g.useState(!1),E=On(c),[A,R]=vt({prop:r,defaultProp:o??!1,onChange:i,caller:Kn}),[M,T]=vt({prop:a,defaultProp:s,onChange:l,caller:Kn}),I=g.useRef(null),O=y?b||!!y.closest("form"):!0,[D,L]=g.useState(new Set),P=Array.from(D).map(F=>F.props.value).join(";");return f.jsx(Bi,{...h,children:f.jsxs(rL,{required:m,scope:t,trigger:y,onTriggerChange:v,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:Pt(),value:M,onValueChange:T,open:A,onOpenChange:R,dir:E,triggerPointerDownPosRef:I,disabled:p,children:[f.jsx(Xi.Provider,{scope:t,children:f.jsx(oL,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(F=>{L(K=>new Set(K).add(F))},[]),onNativeOptionRemove:g.useCallback(F=>{L(K=>{const V=new Set(K);return V.delete(F),V})},[]),children:n})}),O?f.jsxs($g,{"aria-hidden":!0,required:m,tabIndex:-1,name:u,autoComplete:d,value:M,onChange:F=>T(F.target.value),disabled:p,form:b,children:[M===void 0?f.jsx("option",{value:""}):null,Array.from(D)]},P):null]})})};hg.displayName=Kn;var gg="SelectTrigger",bg=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Qi(n),a=Ln(gg,n),s=a.disabled||r,l=_e(t,a.onTriggerChange),c=Ji(n),u=g.useRef("touch"),[d,p,m]=jg(h=>{const y=c().filter(w=>!w.disabled),v=y.find(w=>w.value===a.value),x=Fg(y,h,v);x!==void 0&&a.onValueChange(x.value)}),b=h=>{s||(a.onOpenChange(!0),m()),h&&(a.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return f.jsx(go,{asChild:!0,...i,children:f.jsx(oe.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":zg(a.value)?"":void 0,...o,ref:l,onClick:J(o.onClick,h=>{h.currentTarget.focus(),u.current!=="mouse"&&b(h)}),onPointerDown:J(o.onPointerDown,h=>{u.current=h.pointerType;const y=h.target;y.hasPointerCapture(h.pointerId)&&y.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(b(h),h.preventDefault())}),onKeyDown:J(o.onKeyDown,h=>{const y=d.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&p(h.key),!(y&&h.key===" ")&&eL.includes(h.key)&&(b(),h.preventDefault())})})})});bg.displayName=gg;var vg="SelectValue",yg=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...s}=e,l=Ln(vg,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=_e(t,l.onValueNodeChange);return st(()=>{c(u)},[c,u]),f.jsx(oe.span,{...s,ref:d,style:{pointerEvents:"none"},children:zg(l.value)?f.jsx(f.Fragment,{children:a}):i})});yg.displayName=vg;var aL="SelectIcon",xg=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return f.jsx(oe.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});xg.displayName=aL;var sL="SelectPortal",wg=e=>f.jsx(Ar,{asChild:!0,...e});wg.displayName=sL;var Wn="SelectContent",_g=g.forwardRef((e,t)=>{const n=Ln(Wn,e.__scopeSelect),[r,o]=g.useState();if(st(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Ps.createPortal(f.jsx(Eg,{scope:e.__scopeSelect,children:f.jsx(Xi.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),i):null}return f.jsx(Sg,{...e,ref:t})});_g.displayName=Wn;var Jt=10,[Eg,$n]=Ir(Wn),lL="SelectContentImpl",cL=Tn("SelectContent.RemoveScroll"),Sg=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:b,hideWhenDetached:h,avoidCollisions:y,...v}=e,x=Ln(Wn,n),[w,_]=g.useState(null),[C,E]=g.useState(null),A=_e(t,G=>_(G)),[R,M]=g.useState(null),[T,I]=g.useState(null),O=Ji(n),[D,L]=g.useState(!1),P=g.useRef(!1);g.useEffect(()=>{if(w)return zi(w)},[w]),Li();const F=g.useCallback(G=>{const[se,...Ce]=O().map(X=>X.ref.current),[fe]=Ce.slice(-1),ie=document.activeElement;for(const X of G)if(X===ie||(X?.scrollIntoView({block:"nearest"}),X===se&&C&&(C.scrollTop=0),X===fe&&C&&(C.scrollTop=C.scrollHeight),X?.focus(),document.activeElement!==ie))return},[O,C]),K=g.useCallback(()=>F([R,w]),[F,R,w]);g.useEffect(()=>{D&&K()},[D,K]);const{onOpenChange:V,triggerPointerDownPosRef:B}=x;g.useEffect(()=>{if(w){let G={x:0,y:0};const se=fe=>{G={x:Math.abs(Math.round(fe.pageX)-(B.current?.x??0)),y:Math.abs(Math.round(fe.pageY)-(B.current?.y??0))}},Ce=fe=>{G.x<=10&&G.y<=10?fe.preventDefault():w.contains(fe.target)||V(!1),document.removeEventListener("pointermove",se),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",se),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",se),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[w,V,B]),g.useEffect(()=>{const G=()=>V(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[V]);const[S,le]=jg(G=>{const se=O().filter(ie=>!ie.disabled),Ce=se.find(ie=>ie.ref.current===document.activeElement),fe=Fg(se,G,Ce);fe&&setTimeout(()=>fe.ref.current.focus())}),be=g.useCallback((G,se,Ce)=>{const fe=!P.current&&!Ce;(x.value!==void 0&&x.value===se||fe)&&(M(G),fe&&(P.current=!0))},[x.value]),k=g.useCallback(()=>w?.focus(),[w]),Ee=g.useCallback((G,se,Ce)=>{const fe=!P.current&&!Ce;(x.value!==void 0&&x.value===se||fe)&&I(G)},[x.value]),Le=r==="popper"?vs:kg,we=Le===vs?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:b,hideWhenDetached:h,avoidCollisions:y}:{};return f.jsx(Eg,{scope:n,content:w,viewport:C,onViewportChange:E,itemRefCallback:be,selectedItem:R,onItemLeave:k,itemTextRefCallback:Ee,focusSelectedItem:K,selectedItemText:T,position:r,isPositioned:D,searchRef:S,children:f.jsx(po,{as:cL,allowPinchZoom:!0,children:f.jsx(fo,{asChild:!0,trapped:x.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:J(o,G=>{x.trigger?.focus({preventScroll:!0}),G.preventDefault()}),children:f.jsx(Tr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:f.jsx(Le,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:G=>G.preventDefault(),...v,...we,onPlaced:()=>L(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:J(v.onKeyDown,G=>{const se=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!se&&G.key.length===1&&le(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let fe=O().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);if(["ArrowUp","End"].includes(G.key)&&(fe=fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const ie=G.target,X=fe.indexOf(ie);fe=fe.slice(X+1)}setTimeout(()=>F(fe)),G.preventDefault()}})})})})})})});Sg.displayName=lL;var uL="SelectItemAlignedPosition",kg=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Ln(Wn,n),a=$n(Wn,n),[s,l]=g.useState(null),[c,u]=g.useState(null),d=_e(t,A=>u(A)),p=Ji(n),m=g.useRef(!1),b=g.useRef(!0),{viewport:h,selectedItem:y,selectedItemText:v,focusSelectedItem:x}=a,w=g.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&c&&h&&y&&v){const A=i.trigger.getBoundingClientRect(),R=c.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),T=v.getBoundingClientRect();if(i.dir!=="rtl"){const ie=T.left-R.left,X=M.left-ie,xe=A.left-X,Q=A.width+xe,Fe=Math.max(Q,R.width),ve=window.innerWidth-Jt,Ve=vi(X,[Jt,Math.max(Jt,ve-Fe)]);s.style.minWidth=Q+"px",s.style.left=Ve+"px"}else{const ie=R.right-T.right,X=window.innerWidth-M.right-ie,xe=window.innerWidth-A.right-X,Q=A.width+xe,Fe=Math.max(Q,R.width),ve=window.innerWidth-Jt,Ve=vi(X,[Jt,Math.max(Jt,ve-Fe)]);s.style.minWidth=Q+"px",s.style.right=Ve+"px"}const I=p(),O=window.innerHeight-Jt*2,D=h.scrollHeight,L=window.getComputedStyle(c),P=parseInt(L.borderTopWidth,10),F=parseInt(L.paddingTop,10),K=parseInt(L.borderBottomWidth,10),V=parseInt(L.paddingBottom,10),B=P+F+D+V+K,S=Math.min(y.offsetHeight*5,B),le=window.getComputedStyle(h),be=parseInt(le.paddingTop,10),k=parseInt(le.paddingBottom,10),Ee=A.top+A.height/2-Jt,Le=O-Ee,we=y.offsetHeight/2,G=y.offsetTop+we,se=P+F+G,Ce=B-se;if(se<=Ee){const ie=I.length>0&&y===I[I.length-1].ref.current;s.style.bottom="0px";const X=c.clientHeight-h.offsetTop-h.offsetHeight,xe=Math.max(Le,we+(ie?k:0)+X+K),Q=se+xe;s.style.height=Q+"px"}else{const ie=I.length>0&&y===I[0].ref.current;s.style.top="0px";const xe=Math.max(Ee,P+h.offsetTop+(ie?be:0)+we)+Ce;s.style.height=xe+"px",h.scrollTop=se-Ee+h.offsetTop}s.style.margin=`${Jt}px 0`,s.style.minHeight=S+"px",s.style.maxHeight=O+"px",r?.(),requestAnimationFrame(()=>m.current=!0)}},[p,i.trigger,i.valueNode,s,c,h,y,v,i.dir,r]);st(()=>w(),[w]);const[_,C]=g.useState();st(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const E=g.useCallback(A=>{A&&b.current===!0&&(w(),x?.(),b.current=!1)},[w,x]);return f.jsx(fL,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:E,children:f.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:f.jsx(oe.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});kg.displayName=uL;var dL="SelectPopperPosition",vs=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Jt,...i}=e,a=Qi(n);return f.jsx(Ui,{...a,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});vs.displayName=dL;var[fL,zl]=Ir(Wn,{}),ys="SelectViewport",Ng=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=$n(ys,n),a=zl(ys,n),s=_e(t,i.onViewportChange),l=g.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),f.jsx(Xi.Slot,{scope:n,children:f.jsx(oe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:J(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=a;if(p?.current&&d){const m=Math.abs(l.current-u.scrollTop);if(m>0){const b=window.innerHeight-Jt*2,h=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),v=Math.max(h,y);if(v<b){const x=v+m,w=Math.min(b,x),_=x-w;d.style.height=w+"px",d.style.bottom==="0px"&&(u.scrollTop=_>0?_:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});Ng.displayName=ys;var Cg="SelectGroup",[pL,mL]=Ir(Cg),hL=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Pt();return f.jsx(pL,{scope:n,id:o,children:f.jsx(oe.div,{role:"group","aria-labelledby":o,...r,ref:t})})});hL.displayName=Cg;var Tg="SelectLabel",gL=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=mL(Tg,n);return f.jsx(oe.div,{id:o.id,...r,ref:t})});gL.displayName=Tg;var xi="SelectItem",[bL,Ag]=Ir(xi),Ig=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=e,s=Ln(xi,n),l=$n(xi,n),c=s.value===r,[u,d]=g.useState(i??""),[p,m]=g.useState(!1),b=_e(t,x=>l.itemRefCallback?.(x,r,o)),h=Pt(),y=g.useRef("touch"),v=()=>{o||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return f.jsx(bL,{scope:n,value:r,disabled:o,textId:h,isSelected:c,onItemTextChange:g.useCallback(x=>{d(w=>w||(x?.textContent??"").trim())},[]),children:f.jsx(Xi.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:f.jsx(oe.div,{role:"option","aria-labelledby":h,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:b,onFocus:J(a.onFocus,()=>m(!0)),onBlur:J(a.onBlur,()=>m(!1)),onClick:J(a.onClick,()=>{y.current!=="mouse"&&v()}),onPointerUp:J(a.onPointerUp,()=>{y.current==="mouse"&&v()}),onPointerDown:J(a.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:J(a.onPointerMove,x=>{y.current=x.pointerType,o?l.onItemLeave?.():y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(a.onPointerLeave,x=>{x.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:J(a.onKeyDown,x=>{l.searchRef?.current!==""&&x.key===" "||(tL.includes(x.key)&&v(),x.key===" "&&x.preventDefault())})})})})});Ig.displayName=xi;var Hr="SelectItemText",Rg=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,a=Ln(Hr,n),s=$n(Hr,n),l=Ag(Hr,n),c=iL(Hr,n),[u,d]=g.useState(null),p=_e(t,v=>d(v),l.onItemTextChange,v=>s.itemTextRefCallback?.(v,l.value,l.disabled)),m=u?.textContent,b=g.useMemo(()=>f.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:h,onNativeOptionRemove:y}=c;return st(()=>(h(b),()=>y(b)),[h,y,b]),f.jsxs(f.Fragment,{children:[f.jsx(oe.span,{id:l.textId,...i,ref:p}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Ps.createPortal(i.children,a.valueNode):null]})});Rg.displayName=Hr;var Og="SelectItemIndicator",Mg=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Ag(Og,n).isSelected?f.jsx(oe.span,{"aria-hidden":!0,...r,ref:t}):null});Mg.displayName=Og;var xs="SelectScrollUpButton",Pg=g.forwardRef((e,t)=>{const n=$n(xs,e.__scopeSelect),r=zl(xs,e.__scopeSelect),[o,i]=g.useState(!1),a=_e(t,r.onScrollButtonChange);return st(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?f.jsx(Lg,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});Pg.displayName=xs;var ws="SelectScrollDownButton",Dg=g.forwardRef((e,t)=>{const n=$n(ws,e.__scopeSelect),r=zl(ws,e.__scopeSelect),[o,i]=g.useState(!1),a=_e(t,r.onScrollButtonChange);return st(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?f.jsx(Lg,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});Dg.displayName=ws;var Lg=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=$n("SelectScrollButton",n),a=g.useRef(null),s=Ji(n),l=g.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return g.useEffect(()=>()=>l(),[l]),st(()=>{s().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),f.jsx(oe.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:J(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:J(o.onPointerMove,()=>{i.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:J(o.onPointerLeave,()=>{l()})})}),vL="SelectSeparator",yL=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(oe.div,{"aria-hidden":!0,...r,ref:t})});yL.displayName=vL;var _s="SelectArrow",xL=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Qi(n),i=Ln(_s,n),a=$n(_s,n);return i.open&&a.position==="popper"?f.jsx(Hi,{...o,...r,ref:t}):null});xL.displayName=_s;var wL="SelectBubbleInput",$g=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=g.useRef(null),i=_e(r,o),a=mo(t);return g.useEffect(()=>{const s=o.current;if(!s)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&u){const d=new Event("change",{bubbles:!0});u.call(s,t),s.dispatchEvent(d)}},[a,t]),f.jsx(oe.select,{...n,style:{...Bp,...n.style},ref:i,defaultValue:t})});$g.displayName=wL;function zg(e){return e===""||e===void 0}function jg(e){const t=nn(e),n=g.useRef(""),r=g.useRef(0),o=g.useCallback(a=>{const s=n.current+a;t(s),(function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(s)},[t]),i=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Fg(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=_L(e,Math.max(i,0));o.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function _L(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var EL=hg,SL=bg,kL=yg,NL=xg,CL=wg,TL=_g,AL=Ng,IL=Ig,RL=Rg,OL=Mg,ML=Pg,PL=Dg,DL="Separator",ld="horizontal",LL=["horizontal","vertical"],Bg=g.forwardRef((e,t)=>{const{decorative:n,orientation:r=ld,...o}=e,i=$L(r)?r:ld,s=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return f.jsx(oe.div,{"data-orientation":i,...s,...o,ref:t})});Bg.displayName=DL;function $L(e){return LL.includes(e)}var zL=Bg,Ug=["PageUp","PageDown"],Hg=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Vg={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Rr="Slider",[Es,jL,FL]=uo(Rr),[Gg]=lt(Rr,[FL]),[BL,ea]=Gg(Rr),Zg=g.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:a="horizontal",disabled:s=!1,minStepsBetweenThumbs:l=0,defaultValue:c=[r],value:u,onValueChange:d=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:b,...h}=e,y=g.useRef(new Set),v=g.useRef(0),w=a==="horizontal"?UL:HL,[_=[],C]=vt({prop:u,defaultProp:c,onChange:I=>{[...y.current][v.current]?.focus(),d(I)}}),E=g.useRef(_);function A(I){const O=WL(_,I);T(I,O)}function R(I){T(I,v.current)}function M(){const I=E.current[v.current];_[v.current]!==I&&p(_)}function T(I,O,{commit:D}={commit:!1}){const L=JL(i),P=QL(Math.round((I-r)/i)*i+r,L),F=vi(P,[r,o]);C((K=[])=>{const V=ZL(K,F,O);if(XL(V,l*i)){v.current=V.indexOf(F);const B=String(V)!==String(K);return B&&D&&p(V),B?V:K}else return K})}return f.jsx(BL,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:o,valueIndexToChangeRef:v,thumbs:y.current,values:_,orientation:a,form:b,children:f.jsx(Es.Provider,{scope:e.__scopeSlider,children:f.jsx(Es.Slot,{scope:e.__scopeSlider,children:f.jsx(w,{"aria-disabled":s,"data-disabled":s?"":void 0,...h,ref:t,onPointerDown:J(h.onPointerDown,()=>{s||(E.current=_)}),min:r,max:o,inverted:m,onSlideStart:s?void 0:A,onSlideMove:s?void 0:R,onSlideEnd:s?void 0:M,onHomeKeyDown:()=>!s&&T(r,0,{commit:!0}),onEndKeyDown:()=>!s&&T(o,_.length-1,{commit:!0}),onStepKeyDown:({event:I,direction:O})=>{if(!s){const P=Ug.includes(I.key)||I.shiftKey&&Hg.includes(I.key)?10:1,F=v.current,K=_[F],V=i*P*O;T(K+V,F,{commit:!0})}}})})})})});Zg.displayName=Rr;var[Kg,Wg]=Gg(Rr,{startEdge:"left",endEdge:"right",size:"width",direction:1}),UL=g.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:a,onSlideMove:s,onSlideEnd:l,onStepKeyDown:c,...u}=e,[d,p]=g.useState(null),m=_e(t,w=>p(w)),b=g.useRef(void 0),h=On(o),y=h==="ltr",v=y&&!i||!y&&i;function x(w){const _=b.current||d.getBoundingClientRect(),C=[0,_.width],A=jl(C,v?[n,r]:[r,n]);return b.current=_,A(w-_.left)}return f.jsx(Kg,{scope:e.__scopeSlider,startEdge:v?"left":"right",endEdge:v?"right":"left",direction:v?1:-1,size:"width",children:f.jsx(qg,{dir:h,"data-orientation":"horizontal",...u,ref:m,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const _=x(w.clientX);a?.(_)},onSlideMove:w=>{const _=x(w.clientX);s?.(_)},onSlideEnd:()=>{b.current=void 0,l?.()},onStepKeyDown:w=>{const C=Vg[v?"from-left":"from-right"].includes(w.key);c?.({event:w,direction:C?-1:1})}})})}),HL=g.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:a,onSlideEnd:s,onStepKeyDown:l,...c}=e,u=g.useRef(null),d=_e(t,u),p=g.useRef(void 0),m=!o;function b(h){const y=p.current||u.current.getBoundingClientRect(),v=[0,y.height],w=jl(v,m?[r,n]:[n,r]);return p.current=y,w(h-y.top)}return f.jsx(Kg,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:f.jsx(qg,{"data-orientation":"vertical",...c,ref:d,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:h=>{const y=b(h.clientY);i?.(y)},onSlideMove:h=>{const y=b(h.clientY);a?.(y)},onSlideEnd:()=>{p.current=void 0,s?.()},onStepKeyDown:h=>{const v=Vg[m?"from-bottom":"from-top"].includes(h.key);l?.({event:h,direction:v?-1:1})}})})}),qg=g.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:s,onStepKeyDown:l,...c}=e,u=ea(Rr,n);return f.jsx(oe.span,{...c,ref:t,onKeyDown:J(e.onKeyDown,d=>{d.key==="Home"?(a(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):Ug.concat(Hg).includes(d.key)&&(l(d),d.preventDefault())}),onPointerDown:J(e.onPointerDown,d=>{const p=d.target;p.setPointerCapture(d.pointerId),d.preventDefault(),u.thumbs.has(p)?p.focus():r(d)}),onPointerMove:J(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&o(d)}),onPointerUp:J(e.onPointerUp,d=>{const p=d.target;p.hasPointerCapture(d.pointerId)&&(p.releasePointerCapture(d.pointerId),i(d))})})}),Yg="SliderTrack",Xg=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=ea(Yg,n);return f.jsx(oe.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});Xg.displayName=Yg;var Ss="SliderRange",Jg=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=ea(Ss,n),i=Wg(Ss,n),a=g.useRef(null),s=_e(t,a),l=o.values.length,c=o.values.map(p=>tb(p,o.min,o.max)),u=l>1?Math.min(...c):0,d=100-Math.max(...c);return f.jsx(oe.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:s,style:{...e.style,[i.startEdge]:u+"%",[i.endEdge]:d+"%"}})});Jg.displayName=Ss;var ks="SliderThumb",Qg=g.forwardRef((e,t)=>{const n=jL(e.__scopeSlider),[r,o]=g.useState(null),i=_e(t,s=>o(s)),a=g.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return f.jsx(VL,{...e,ref:i,index:a})}),VL=g.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,a=ea(ks,n),s=Wg(ks,n),[l,c]=g.useState(null),u=_e(t,x=>c(x)),d=l?a.form||!!l.closest("form"):!0,p=ho(l),m=a.values[r],b=m===void 0?0:tb(m,a.min,a.max),h=KL(r,a.values.length),y=p?.[s.size],v=y?qL(y,b,s.direction):0;return g.useEffect(()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}},[l,a.thumbs]),f.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${b}% + ${v}px)`},children:[f.jsx(Es.ItemSlot,{scope:e.__scopeSlider,children:f.jsx(oe.span,{role:"slider","aria-label":e["aria-label"]||h,"aria-valuemin":a.min,"aria-valuenow":m,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:u,style:m===void 0?{display:"none"}:e.style,onFocus:J(e.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),d&&f.jsx(eb,{name:o??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:m},r)]})});Qg.displayName=ks;var GL="RadioBubbleInput",eb=g.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=g.useRef(null),i=_e(o,r),a=mo(t);return g.useEffect(()=>{const s=o.current;if(!s)return;const l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&u){const d=new Event("input",{bubbles:!0});u.call(s,t),s.dispatchEvent(d)}},[a,t]),f.jsx(oe.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});eb.displayName=GL;function ZL(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function tb(e,t,n){const i=100/(n-t)*(e-t);return vi(i,[0,100])}function KL(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function WL(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function qL(e,t,n){const r=e/2,i=jl([0,50],[0,r]);return(r-i(t)*n)*n}function YL(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function XL(e,t){if(t>0){const n=YL(e);return Math.min(...n)>=t}return!0}function jl(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function JL(e){return(String(e).split(".")[1]||"").length}function QL(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var e$=Zg,t$=Xg,n$=Jg,r$=Qg,ta="Switch",[o$]=lt(ta),[i$,a$]=o$(ta),nb=g.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=e,[p,m]=g.useState(null),b=_e(t,w=>m(w)),h=g.useRef(!1),y=p?u||!!p.closest("form"):!0,[v,x]=vt({prop:o,defaultProp:i??!1,onChange:c,caller:ta});return f.jsxs(i$,{scope:n,checked:v,disabled:s,children:[f.jsx(oe.button,{type:"button",role:"switch","aria-checked":v,"aria-required":a,"data-state":ab(v),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:b,onClick:J(e.onClick,w=>{x(_=>!_),y&&(h.current=w.isPropagationStopped(),h.current||w.stopPropagation())})}),y&&f.jsx(ib,{control:p,bubbles:!h.current,name:r,value:l,checked:v,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});nb.displayName=ta;var rb="SwitchThumb",ob=g.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=a$(rb,n);return f.jsx(oe.span,{"data-state":ab(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});ob.displayName=rb;var s$="SwitchBubbleInput",ib=g.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},i)=>{const a=g.useRef(null),s=_e(a,i),l=mo(n),c=ho(t);return g.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&m){const b=new Event("click",{bubbles:r});m.call(u,n),u.dispatchEvent(b)}},[l,n,r]),f.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...o.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ib.displayName=s$;function ab(e){return e?"checked":"unchecked"}var l$=nb,c$=ob,na="Tabs",[u$]=lt(na,[Pn]),sb=Pn(),[d$,Fl]=u$(na),lb=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:l="automatic",...c}=e,u=On(s),[d,p]=vt({prop:r,onChange:o,defaultProp:i??"",caller:na});return f.jsx(d$,{scope:n,baseId:Pt(),value:d,onValueChange:p,orientation:a,dir:u,activationMode:l,children:f.jsx(oe.div,{dir:u,"data-orientation":a,...c,ref:t})})});lb.displayName=na;var cb="TabsList",ub=g.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Fl(cb,n),a=sb(n);return f.jsx(Vi,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:f.jsx(oe.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});ub.displayName=cb;var db="TabsTrigger",fb=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,a=Fl(db,n),s=sb(n),l=mb(a.baseId,r),c=hb(a.baseId,r),u=r===a.value;return f.jsx(Gi,{asChild:!0,...s,focusable:!o,active:u,children:f.jsx(oe.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:J(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?a.onValueChange(r):d.preventDefault()}),onKeyDown:J(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(r)}),onFocus:J(e.onFocus,()=>{const d=a.activationMode!=="manual";!u&&!o&&d&&a.onValueChange(r)})})})});fb.displayName=db;var pb="TabsContent",f$=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=e,s=Fl(pb,n),l=mb(s.baseId,r),c=hb(s.baseId,r),u=r===s.value,d=g.useRef(u);return g.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),f.jsx(Nt,{present:o||u,children:({present:p})=>f.jsx(oe.div,{"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:p&&i})})});f$.displayName=pb;function mb(e,t){return`${e}-trigger-${t}`}function hb(e,t){return`${e}-content-${t}`}var p$=lb,m$=ub,h$=fb,gb="Toggle",Bl=g.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...i}=e,[a,s]=vt({prop:n,onChange:o,defaultProp:r??!1,caller:gb});return f.jsx(oe.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:J(e.onClick,()=>{e.disabled||s(!a)})})});Bl.displayName=gb;var g$=Bl,zn="ToggleGroup",[bb]=lt(zn,[Pn]),vb=Pn(),Ul=H.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return f.jsx(b$,{...o,ref:t})}if(n==="multiple"){const o=r;return f.jsx(v$,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${zn}\``)});Ul.displayName=zn;var[yb,xb]=bb(zn),b$=H.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a,s]=vt({prop:n,defaultProp:r??"",onChange:o,caller:zn});return f.jsx(yb,{scope:e.__scopeToggleGroup,type:"single",value:H.useMemo(()=>a?[a]:[],[a]),onItemActivate:s,onItemDeactivate:H.useCallback(()=>s(""),[s]),children:f.jsx(wb,{...i,ref:t})})}),v$=H.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a,s]=vt({prop:n,defaultProp:r??[],onChange:o,caller:zn}),l=H.useCallback(u=>s((d=[])=>[...d,u]),[s]),c=H.useCallback(u=>s((d=[])=>d.filter(p=>p!==u)),[s]);return f.jsx(yb,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:l,onItemDeactivate:c,children:f.jsx(wb,{...i,ref:t})})});Ul.displayName=zn;var[y$,x$]=bb(zn),wb=H.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:i,dir:a,loop:s=!0,...l}=e,c=vb(n),u=On(a),d={role:"group",dir:u,...l};return f.jsx(y$,{scope:n,rovingFocus:o,disabled:r,children:o?f.jsx(Vi,{asChild:!0,...c,orientation:i,dir:u,loop:s,children:f.jsx(oe.div,{...d,ref:t})}):f.jsx(oe.div,{...d,ref:t})})}),wi="ToggleGroupItem",_b=H.forwardRef((e,t)=>{const n=xb(wi,e.__scopeToggleGroup),r=x$(wi,e.__scopeToggleGroup),o=vb(e.__scopeToggleGroup),i=n.value.includes(e.value),a=r.disabled||e.disabled,s={...e,pressed:i,disabled:a},l=H.useRef(null);return r.rovingFocus?f.jsx(Gi,{asChild:!0,...o,focusable:!a,active:i,ref:l,children:f.jsx(cd,{...s,ref:t})}):f.jsx(cd,{...s,ref:t})});_b.displayName=wi;var cd=H.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,i=xb(wi,n),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},s=i.type==="single"?a:void 0;return f.jsx(Bl,{...s,...o,ref:t,onPressedChange:l=>{l?i.onItemActivate(r):i.onItemDeactivate(r)}})}),w$=Ul,_$=_b,[ra]=lt("Tooltip",[Mn]),oa=Mn(),Eb="TooltipProvider",E$=700,Ns="tooltip.open",[S$,Hl]=ra(Eb),Sb=e=>{const{__scopeTooltip:t,delayDuration:n=E$,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,a=g.useRef(!0),s=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),f.jsx(S$,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:g.useCallback(c=>{s.current=c},[]),disableHoverableContent:o,children:i})};Sb.displayName=Eb;var to="Tooltip",[k$,wo]=ra(to),kb=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,l=Hl(to,e.__scopeTooltip),c=oa(t),[u,d]=g.useState(null),p=Pt(),m=g.useRef(0),b=a??l.disableHoverableContent,h=s??l.delayDuration,y=g.useRef(!1),[v,x]=vt({prop:r,defaultProp:o??!1,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(Ns))):l.onClose(),i?.(A)},caller:to}),w=g.useMemo(()=>v?y.current?"delayed-open":"instant-open":"closed",[v]),_=g.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,x(!0)},[x]),C=g.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),E=g.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,x(!0),m.current=0},h)},[h,x]);return g.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),f.jsx(Bi,{...c,children:f.jsx(k$,{scope:t,contentId:p,open:v,stateAttribute:w,trigger:u,onTriggerChange:d,onTriggerEnter:g.useCallback(()=>{l.isOpenDelayedRef.current?E():_()},[l.isOpenDelayedRef,E,_]),onTriggerLeave:g.useCallback(()=>{b?C():(window.clearTimeout(m.current),m.current=0)},[C,b]),onOpen:_,onClose:C,disableHoverableContent:b,children:n})})};kb.displayName=to;var Cs="TooltipTrigger",Nb=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=wo(Cs,n),i=Hl(Cs,n),a=oa(n),s=g.useRef(null),l=_e(t,s,o.onTriggerChange),c=g.useRef(!1),u=g.useRef(!1),d=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),f.jsx(go,{asChild:!0,...a,children:f.jsx(oe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:J(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:J(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:J(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:J(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:J(e.onBlur,o.onClose),onClick:J(e.onClick,o.onClose)})})});Nb.displayName=Cs;var Vl="TooltipPortal",[N$,C$]=ra(Vl,{forceMount:void 0}),Cb=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=wo(Vl,t);return f.jsx(N$,{scope:t,forceMount:n,children:f.jsx(Nt,{present:n||i.open,children:f.jsx(Ar,{asChild:!0,container:o,children:r})})})};Cb.displayName=Vl;var Sr="TooltipContent",Tb=g.forwardRef((e,t)=>{const n=C$(Sr,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=wo(Sr,e.__scopeTooltip);return f.jsx(Nt,{present:r||a.open,children:a.disableHoverableContent?f.jsx(Ab,{side:o,...i,ref:t}):f.jsx(T$,{side:o,...i,ref:t})})}),T$=g.forwardRef((e,t)=>{const n=wo(Sr,e.__scopeTooltip),r=Hl(Sr,e.__scopeTooltip),o=g.useRef(null),i=_e(t,o),[a,s]=g.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,p=g.useCallback(()=>{s(null),d(!1)},[d]),m=g.useCallback((b,h)=>{const y=b.currentTarget,v={x:b.clientX,y:b.clientY},x=O$(v,y.getBoundingClientRect()),w=M$(v,x),_=P$(h.getBoundingClientRect()),C=L$([...w,..._]);s(C),d(!0)},[d]);return g.useEffect(()=>()=>p(),[p]),g.useEffect(()=>{if(l&&u){const b=y=>m(y,u),h=y=>m(y,l);return l.addEventListener("pointerleave",b),u.addEventListener("pointerleave",h),()=>{l.removeEventListener("pointerleave",b),u.removeEventListener("pointerleave",h)}}},[l,u,m,p]),g.useEffect(()=>{if(a){const b=h=>{const y=h.target,v={x:h.clientX,y:h.clientY},x=l?.contains(y)||u?.contains(y),w=!D$(v,a);x?p():w&&(p(),c())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[l,u,a,c,p]),f.jsx(Ab,{...e,ref:i})}),[A$,I$]=ra(to,{isInside:!1}),R$=AO("TooltipContent"),Ab=g.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,l=wo(Sr,n),c=oa(n),{onClose:u}=l;return g.useEffect(()=>(document.addEventListener(Ns,u),()=>document.removeEventListener(Ns,u)),[u]),g.useEffect(()=>{if(l.trigger){const d=p=>{p.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),f.jsx(Tr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:f.jsxs(Ui,{"data-state":l.stateAttribute,...c,...s,ref:t,style:{...s.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:[f.jsx(R$,{children:r}),f.jsx(A$,{scope:n,isInside:!0,children:f.jsx(DO,{id:l.contentId,role:"tooltip",children:o||r})})]})})});Tb.displayName=Sr;var Ib="TooltipArrow",Rb=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=oa(n);return I$(Ib,n).isInside?null:f.jsx(Hi,{...o,...r,ref:t})});Rb.displayName=Ib;function O$(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function M$(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 P$(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 D$(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i],l=t[a],c=s.x,u=s.y,d=l.x,p=l.y;u>r!=p>r&&n<(d-c)*(r-u)/(p-u)+c&&(o=!o)}return o}function L$(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),$$(t)}function $$(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 i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.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 i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.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 z$=Sb,j$=kb,F$=Nb,B$=Cb,U$=Tb,H$=Rb;const Ob=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const V$=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const G$=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const ud=e=>{const t=G$(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Z$={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const K$=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const W$=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...s},l)=>g.createElement("svg",{ref:l,...Z$,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ob("lucide",o),...!i&&!K$(s)&&{"aria-hidden":"true"},...s},[...a.map(([c,u])=>g.createElement(c,u)),...Array.isArray(i)?i:[i]]));const hn=(e,t)=>{const n=g.forwardRef(({className:r,...o},i)=>g.createElement(W$,{ref:i,iconNode:t,className:Ob(`lucide-${V$(ud(e))}`,`lucide-${e}`,r),...o}));return n.displayName=ud(e),n};const q$=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Y$=hn("arrow-left",q$);const X$=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],J$=hn("arrow-right",X$);const Q$=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Mb=hn("check",Q$);const ez=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Gl=hn("chevron-down",ez);const tz=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],nz=hn("chevron-left",tz);const rz=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],oz=hn("chevron-right",rz);const iz=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],az=hn("chevron-up",iz);const sz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],lz=hn("circle",sz);const cz=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],uz=hn("ellipsis",cz);const dz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fz=hn("x",dz);function pz(e){return Object.prototype.toString.call(e)==="[object Object]"}function dd(e){return pz(e)||Array.isArray(e)}function mz(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Zl(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const o=JSON.stringify(Object.keys(e.breakpoints||{})),i=JSON.stringify(Object.keys(t.breakpoints||{}));return o!==i?!1:n.every(a=>{const s=e[a],l=t[a];return typeof s=="function"?`${s}`==`${l}`:!dd(s)||!dd(l)?s===l:Zl(s,l)})}function fd(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function hz(e,t){if(e.length!==t.length)return!1;const n=fd(e),r=fd(t);return n.every((o,i)=>{const a=r[i];return Zl(o,a)})}function Kl(e){return typeof e=="number"}function Ts(e){return typeof e=="string"}function ia(e){return typeof e=="boolean"}function pd(e){return Object.prototype.toString.call(e)==="[object Object]"}function et(e){return Math.abs(e)}function Wl(e){return Math.sign(e)}function Wr(e,t){return et(e-t)}function gz(e,t){if(e===0||t===0||et(e)<=et(t))return 0;const n=Wr(et(e),et(t));return et(n/e)}function bz(e){return Math.round(e*100)/100}function no(e){return ro(e).map(Number)}function tn(e){return e[_o(e)]}function _o(e){return Math.max(0,e.length-1)}function ql(e,t){return t===_o(e)}function md(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function ro(e){return Object.keys(e)}function Pb(e,t){return[e,t].reduce((n,r)=>(ro(r).forEach(o=>{const i=n[o],a=r[o],s=pd(i)&&pd(a);n[o]=s?Pb(i,a):a}),n),{})}function As(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function vz(e,t){const n={start:r,center:o,end:i};function r(){return 0}function o(l){return i(l)/2}function i(l){return t-l}function a(l,c){return Ts(e)?n[e](l):e(t,l,c)}return{measure:a}}function oo(){let e=[];function t(o,i,a,s={passive:!0}){let l;if("addEventListener"in o)o.addEventListener(i,a,s),l=()=>o.removeEventListener(i,a,s);else{const c=o;c.addListener(a),l=()=>c.removeListener(a)}return e.push(l),r}function n(){e=e.filter(o=>o())}const r={add:t,clear:n};return r}function yz(e,t,n,r){const o=oo(),i=1e3/60;let a=null,s=0,l=0;function c(){o.add(e,"visibilitychange",()=>{e.hidden&&b()})}function u(){m(),o.clear()}function d(y){if(!l)return;a||(a=y,n(),n());const v=y-a;for(a=y,s+=v;s>=i;)n(),s-=i;const x=s/i;r(x),l&&(l=t.requestAnimationFrame(d))}function p(){l||(l=t.requestAnimationFrame(d))}function m(){t.cancelAnimationFrame(l),a=null,s=0,l=0}function b(){a=null,s=0}return{init:c,destroy:u,start:p,stop:m,update:n,render:r}}function xz(e,t){const n=t==="rtl",r=e==="y",o=r?"y":"x",i=r?"x":"y",a=!r&&n?-1:1,s=u(),l=d();function c(b){const{height:h,width:y}=b;return r?h:y}function u(){return r?"top":n?"right":"left"}function d(){return r?"bottom":n?"left":"right"}function p(b){return b*a}return{scroll:o,cross:i,startEdge:s,endEdge:l,measureSize:c,direction:p}}function qn(e=0,t=0){const n=et(e-t);function r(c){return c<e}function o(c){return c>t}function i(c){return r(c)||o(c)}function a(c){return i(c)?r(c)?e:t:c}function s(c){return n?c-n*Math.ceil((c-t)/n):c}return{length:n,max:t,min:e,constrain:a,reachedAny:i,reachedMax:o,reachedMin:r,removeOffset:s}}function Db(e,t,n){const{constrain:r}=qn(0,e),o=e+1;let i=a(t);function a(p){return n?et((o+p)%o):r(p)}function s(){return i}function l(p){return i=a(p),d}function c(p){return u().set(s()+p)}function u(){return Db(e,s(),n)}const d={get:s,set:l,add:c,clone:u};return d}function wz(e,t,n,r,o,i,a,s,l,c,u,d,p,m,b,h,y,v,x){const{cross:w,direction:_}=e,C=["INPUT","SELECT","TEXTAREA"],E={passive:!1},A=oo(),R=oo(),M=qn(50,225).constrain(m.measure(20)),T={mouse:300,touch:400},I={mouse:500,touch:600},O=b?43:25;let D=!1,L=0,P=0,F=!1,K=!1,V=!1,B=!1;function S(X){if(!x)return;function xe(Fe){(ia(x)||x(X,Fe))&&we(Fe)}const Q=t;A.add(Q,"dragstart",Fe=>Fe.preventDefault(),E).add(Q,"touchmove",()=>{},E).add(Q,"touchend",()=>{}).add(Q,"touchstart",xe).add(Q,"mousedown",xe).add(Q,"touchcancel",se).add(Q,"contextmenu",se).add(Q,"click",Ce,!0)}function le(){A.clear(),R.clear()}function be(){const X=B?n:t;R.add(X,"touchmove",G,E).add(X,"touchend",se).add(X,"mousemove",G,E).add(X,"mouseup",se)}function k(X){const xe=X.nodeName||"";return C.includes(xe)}function Ee(){return(b?I:T)[B?"mouse":"touch"]}function Le(X,xe){const Q=d.add(Wl(X)*-1),Fe=u.byDistance(X,!b).distance;return b||et(X)<M?Fe:y&&xe?Fe*.5:u.byIndex(Q.get(),0).distance}function we(X){const xe=As(X,r);B=xe,V=b&&xe&&!X.buttons&&D,D=Wr(o.get(),a.get())>=2,!(xe&&X.button!==0)&&(k(X.target)||(F=!0,i.pointerDown(X),c.useFriction(0).useDuration(0),o.set(a),be(),L=i.readPoint(X),P=i.readPoint(X,w),p.emit("pointerDown")))}function G(X){if(!As(X,r)&&X.touches.length>=2)return se(X);const Q=i.readPoint(X),Fe=i.readPoint(X,w),ve=Wr(Q,L),Ve=Wr(Fe,P);if(!K&&!B&&(!X.cancelable||(K=ve>Ve,!K)))return se(X);const ct=i.pointerMove(X);ve>h&&(V=!0),c.useFriction(.3).useDuration(.75),s.start(),o.add(_(ct)),X.preventDefault()}function se(X){const Q=u.byDistance(0,!1).index!==d.get(),Fe=i.pointerUp(X)*Ee(),ve=Le(_(Fe),Q),Ve=gz(Fe,ve),ct=O-10*Ve,yt=v+Ve/50;K=!1,F=!1,R.clear(),c.useDuration(ct).useFriction(yt),l.distance(ve,!b),B=!1,p.emit("pointerUp")}function Ce(X){V&&(X.stopPropagation(),X.preventDefault(),V=!1)}function fe(){return F}return{init:S,destroy:le,pointerDown:fe}}function _z(e,t){let r,o;function i(d){return d.timeStamp}function a(d,p){const b=`client${(p||e.scroll)==="x"?"X":"Y"}`;return(As(d,t)?d:d.touches[0])[b]}function s(d){return r=d,o=d,a(d)}function l(d){const p=a(d)-a(o),m=i(d)-i(r)>170;return o=d,m&&(r=d),p}function c(d){if(!r||!o)return 0;const p=a(o)-a(r),m=i(d)-i(r),b=i(d)-i(o)>170,h=p/m;return m&&!b&&et(h)>.1?h:0}return{pointerDown:s,pointerMove:l,pointerUp:c,readPoint:a}}function Ez(){function e(n){const{offsetTop:r,offsetLeft:o,offsetWidth:i,offsetHeight:a}=n;return{top:r,right:o+i,bottom:r+a,left:o,width:i,height:a}}return{measure:e}}function Sz(e){function t(r){return e*(r/100)}return{measure:t}}function kz(e,t,n,r,o,i,a){const s=[e].concat(r);let l,c,u=[],d=!1;function p(y){return o.measureSize(a.measure(y))}function m(y){if(!i)return;c=p(e),u=r.map(p);function v(x){for(const w of x){if(d)return;const _=w.target===e,C=r.indexOf(w.target),E=_?c:u[C],A=p(_?e:r[C]);if(et(A-E)>=.5){y.reInit(),t.emit("resize");break}}}l=new ResizeObserver(x=>{(ia(i)||i(y,x))&&v(x)}),n.requestAnimationFrame(()=>{s.forEach(x=>l.observe(x))})}function b(){d=!0,l&&l.disconnect()}return{init:m,destroy:b}}function Nz(e,t,n,r,o,i){let a=0,s=0,l=o,c=i,u=e.get(),d=0;function p(){const E=r.get()-e.get(),A=!l;let R=0;return A?(a=0,n.set(r),e.set(r),R=E):(n.set(e),a+=E/l,a*=c,u+=a,e.add(a),R=u-d),s=Wl(R),d=u,C}function m(){const E=r.get()-t.get();return et(E)<.001}function b(){return l}function h(){return s}function y(){return a}function v(){return w(o)}function x(){return _(i)}function w(E){return l=E,C}function _(E){return c=E,C}const C={direction:h,duration:b,velocity:y,seek:p,settled:m,useBaseFriction:x,useBaseDuration:v,useFriction:_,useDuration:w};return C}function Cz(e,t,n,r,o){const i=o.measure(10),a=o.measure(50),s=qn(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function u(m){if(!c())return;const b=e.reachedMin(t.get())?"min":"max",h=et(e[b]-t.get()),y=n.get()-t.get(),v=s.constrain(h/a);n.subtract(y*v),!m&&et(y)<i&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function d(m){l=!m}return{shouldConstrain:c,constrain:u,toggleActive:d}}function Tz(e,t,n,r,o){const i=qn(-t+e,0),a=d(),s=u(),l=p();function c(b,h){return Wr(b,h)<=1}function u(){const b=a[0],h=tn(a),y=a.lastIndexOf(b),v=a.indexOf(h)+1;return qn(y,v)}function d(){return n.map((b,h)=>{const{min:y,max:v}=i,x=i.constrain(b),w=!h,_=ql(n,h);return w?v:_||c(y,x)?y:c(v,x)?v:x}).map(b=>parseFloat(b.toFixed(3)))}function p(){if(t<=e+o)return[i.max];if(r==="keepSnaps")return a;const{min:b,max:h}=s;return a.slice(b,h)}return{snapsContained:l,scrollContainLimit:s}}function Az(e,t,n){const r=t[0],o=n?r-e:tn(t);return{limit:qn(o,r)}}function Iz(e,t,n,r){const i=t.min+.1,a=t.max+.1,{reachedMin:s,reachedMax:l}=qn(i,a);function c(p){return p===1?l(n.get()):p===-1?s(n.get()):!1}function u(p){if(!c(p))return;const m=e*(p*-1);r.forEach(b=>b.add(m))}return{loop:u}}function Rz(e){const{max:t,length:n}=e;function r(i){const a=i-t;return n?a/-n:0}return{get:r}}function Oz(e,t,n,r,o){const{startEdge:i,endEdge:a}=e,{groupSlides:s}=o,l=d().map(t.measure),c=p(),u=m();function d(){return s(r).map(h=>tn(h)[a]-h[0][i]).map(et)}function p(){return r.map(h=>n[i]-h[i]).map(h=>-et(h))}function m(){return s(c).map(h=>h[0]).map((h,y)=>h+l[y])}return{snaps:c,snapsAligned:u}}function Mz(e,t,n,r,o,i){const{groupSlides:a}=o,{min:s,max:l}=r,c=u();function u(){const p=a(i),m=!e||t==="keepSnaps";return n.length===1?[i]:m?p:p.slice(s,l).map((b,h,y)=>{const v=!h,x=ql(y,h);if(v){const w=tn(y[0])+1;return md(w)}if(x){const w=_o(i)-tn(y)[0]+1;return md(w,tn(y)[0])}return b})}return{slideRegistry:c}}function Pz(e,t,n,r,o){const{reachedAny:i,removeOffset:a,constrain:s}=r;function l(b){return b.concat().sort((h,y)=>et(h)-et(y))[0]}function c(b){const h=e?a(b):s(b),y=t.map((x,w)=>({diff:u(x-h,0),index:w})).sort((x,w)=>et(x.diff)-et(w.diff)),{index:v}=y[0];return{index:v,distance:h}}function u(b,h){const y=[b,b+n,b-n];if(!e)return b;if(!h)return l(y);const v=y.filter(x=>Wl(x)===h);return v.length?l(v):tn(y)-n}function d(b,h){const y=t[b]-o.get(),v=u(y,h);return{index:b,distance:v}}function p(b,h){const y=o.get()+b,{index:v,distance:x}=c(y),w=!e&&i(y);if(!h||w)return{index:v,distance:b};const _=t[v]-x,C=b+u(_,0);return{index:v,distance:C}}return{byDistance:p,byIndex:d,shortcut:u}}function Dz(e,t,n,r,o,i,a){function s(d){const p=d.distance,m=d.index!==t.get();i.add(p),p&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),m&&(n.set(t.get()),t.set(d.index),a.emit("select"))}function l(d,p){const m=o.byDistance(d,p);s(m)}function c(d,p){const m=t.clone().set(d),b=o.byIndex(m.get(),p);s(b)}return{distance:l,index:c}}function Lz(e,t,n,r,o,i,a,s){const l={passive:!0,capture:!0};let c=0;function u(m){if(!s)return;function b(h){if(new Date().getTime()-c>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const x=n.findIndex(w=>w.includes(h));Kl(x)&&(o.useDuration(0),r.index(x,0),a.emit("slideFocus"))}i.add(document,"keydown",d,!1),t.forEach((h,y)=>{i.add(h,"focus",v=>{(ia(s)||s(m,v))&&b(y)},l)})}function d(m){m.code==="Tab"&&(c=new Date().getTime())}return{init:u}}function Vr(e){let t=e;function n(){return t}function r(l){t=a(l)}function o(l){t+=a(l)}function i(l){t-=a(l)}function a(l){return Kl(l)?l:l.get()}return{get:n,set:r,add:o,subtract:i}}function Lb(e,t){const n=e.scroll==="x"?a:s,r=t.style;let o=null,i=!1;function a(p){return`translate3d(${p}px,0px,0px)`}function s(p){return`translate3d(0px,${p}px,0px)`}function l(p){if(i)return;const m=bz(e.direction(p));m!==o&&(r.transform=n(m),o=m)}function c(p){i=!p}function u(){i||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:u,to:l,toggleActive:c}}function $z(e,t,n,r,o,i,a,s,l){const u=no(o),d=no(o).reverse(),p=v().concat(x());function m(A,R){return A.reduce((M,T)=>M-o[T],R)}function b(A,R){return A.reduce((M,T)=>m(M,R)>0?M.concat([T]):M,[])}function h(A){return i.map((R,M)=>({start:R-r[M]+.5+A,end:R+t-.5+A}))}function y(A,R,M){const T=h(R);return A.map(I=>{const O=M?0:-n,D=M?n:0,L=M?"end":"start",P=T[I][L];return{index:I,loopPoint:P,slideLocation:Vr(-1),translate:Lb(e,l[I]),target:()=>s.get()>P?O:D}})}function v(){const A=a[0],R=b(d,A);return y(R,n,!1)}function x(){const A=t-a[0]-1,R=b(u,A);return y(R,-n,!0)}function w(){return p.every(({index:A})=>{const R=u.filter(M=>M!==A);return m(R,t)<=.1})}function _(){p.forEach(A=>{const{target:R,translate:M,slideLocation:T}=A,I=R();I!==T.get()&&(M.to(I),T.set(I))})}function C(){p.forEach(A=>A.translate.clear())}return{canLoop:w,clear:C,loop:_,loopPoints:p}}function zz(e,t,n){let r,o=!1;function i(l){if(!n)return;function c(u){for(const d of u)if(d.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(u=>{o||(ia(n)||n(l,u))&&c(u)}),r.observe(e,{childList:!0})}function a(){r&&r.disconnect(),o=!0}return{init:i,destroy:a}}function jz(e,t,n,r){const o={};let i=null,a=null,s,l=!1;function c(){s=new IntersectionObserver(b=>{l||(b.forEach(h=>{const y=t.indexOf(h.target);o[y]=h}),i=null,a=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(b=>s.observe(b))}function u(){s&&s.disconnect(),l=!0}function d(b){return ro(o).reduce((h,y)=>{const v=parseInt(y),{isIntersecting:x}=o[v];return(b&&x||!b&&!x)&&h.push(v),h},[])}function p(b=!0){if(b&&i)return i;if(!b&&a)return a;const h=d(b);return b&&(i=h),b||(a=h),h}return{init:c,destroy:u,get:p}}function Fz(e,t,n,r,o,i){const{measureSize:a,startEdge:s,endEdge:l}=e,c=n[0]&&o,u=b(),d=h(),p=n.map(a),m=y();function b(){if(!c)return 0;const x=n[0];return et(t[s]-x[s])}function h(){if(!c)return 0;const x=i.getComputedStyle(tn(r));return parseFloat(x.getPropertyValue(`margin-${l}`))}function y(){return n.map((x,w,_)=>{const C=!w,E=ql(_,w);return C?p[w]+u:E?p[w]+d:_[w+1][s]-x[s]}).map(et)}return{slideSizes:p,slideSizesWithGaps:m,startGap:u,endGap:d}}function Bz(e,t,n,r,o,i,a,s,l){const{startEdge:c,endEdge:u,direction:d}=e,p=Kl(n);function m(v,x){return no(v).filter(w=>w%x===0).map(w=>v.slice(w,w+x))}function b(v){return v.length?no(v).reduce((x,w,_)=>{const C=tn(x)||0,E=C===0,A=w===_o(v),R=o[c]-i[C][c],M=o[c]-i[w][u],T=!r&&E?d(a):0,I=!r&&A?d(s):0,O=et(M-I-(R+T));return _&&O>t+l&&x.push(w),A&&x.push(v.length),x},[]).map((x,w,_)=>{const C=Math.max(_[w-1]||0);return v.slice(C,x)}):[]}function h(v){return p?m(v,n):b(v)}return{groupSlides:h}}function Uz(e,t,n,r,o,i,a){const{align:s,axis:l,direction:c,startIndex:u,loop:d,duration:p,dragFree:m,dragThreshold:b,inViewThreshold:h,slidesToScroll:y,skipSnaps:v,containScroll:x,watchResize:w,watchSlides:_,watchDrag:C,watchFocus:E}=i,A=2,R=Ez(),M=R.measure(t),T=n.map(R.measure),I=xz(l,c),O=I.measureSize(M),D=Sz(O),L=vz(s,O),P=!d&&!!x,F=d||!!x,{slideSizes:K,slideSizesWithGaps:V,startGap:B,endGap:S}=Fz(I,M,T,n,F,o),le=Bz(I,O,y,d,M,T,B,S,A),{snaps:be,snapsAligned:k}=Oz(I,L,M,T,le),Ee=-tn(be)+tn(V),{snapsContained:Le,scrollContainLimit:we}=Tz(O,Ee,k,x,A),G=P?Le:k,{limit:se}=Az(Ee,G,d),Ce=Db(_o(G),u,d),fe=Ce.clone(),ie=no(n),X=({dragHandler:Te,scrollBody:ut,scrollBounds:dt,options:{loop:ft}})=>{ft||dt.constrain(Te.pointerDown()),ut.seek()},xe=({scrollBody:Te,translate:ut,location:dt,offsetLocation:ft,previousLocation:Ht,scrollLooper:Yt,slideLooper:pt,dragHandler:Vt,animation:xt,eventHandler:he,scrollBounds:Me,options:{loop:$e}},Ie)=>{const ze=Te.settled(),N=!Me.shouldConstrain(),$=$e?ze:ze&&N,q=$&&!Vt.pointerDown();q&&xt.stop();const ce=dt.get()*Ie+Ht.get()*(1-Ie);ft.set(ce),$e&&(Yt.loop(Te.direction()),pt.loop()),ut.to(ft.get()),q&&he.emit("settle"),$||he.emit("scroll")},Q=yz(r,o,()=>X(Se),Te=>xe(Se,Te)),Fe=.68,ve=G[Ce.get()],Ve=Vr(ve),ct=Vr(ve),yt=Vr(ve),rt=Vr(ve),Ut=Nz(Ve,yt,ct,rt,p,Fe),gn=Pz(d,G,Ee,se,rt),Rt=Dz(Q,Ce,fe,Ut,gn,rt,a),Ot=Rz(se),an=oo(),z=jz(t,n,a,h),{slideRegistry:W}=Mz(P,x,G,we,le,ie),me=Lz(e,n,W,Rt,Ut,an,a,E),Se={ownerDocument:r,ownerWindow:o,eventHandler:a,containerRect:M,slideRects:T,animation:Q,axis:I,dragHandler:wz(I,e,r,o,rt,_z(I,o),Ve,Q,Rt,Ut,gn,Ce,a,D,m,b,v,Fe,C),eventStore:an,percentOfView:D,index:Ce,indexPrevious:fe,limit:se,location:Ve,offsetLocation:yt,previousLocation:ct,options:i,resizeHandler:kz(t,a,o,n,I,w,R),scrollBody:Ut,scrollBounds:Cz(se,yt,rt,Ut,D),scrollLooper:Iz(Ee,se,yt,[Ve,yt,ct,rt]),scrollProgress:Ot,scrollSnapList:G.map(Ot.get),scrollSnaps:G,scrollTarget:gn,scrollTo:Rt,slideLooper:$z(I,O,Ee,K,V,be,G,yt,n),slideFocus:me,slidesHandler:zz(t,a,_),slidesInView:z,slideIndexes:ie,slideRegistry:W,slidesToScroll:le,target:rt,translate:Lb(I,t)};return Se}function Hz(){let e={},t;function n(c){t=c}function r(c){return e[c]||[]}function o(c){return r(c).forEach(u=>u(t,c)),l}function i(c,u){return e[c]=r(c).concat([u]),l}function a(c,u){return e[c]=r(c).filter(d=>d!==u),l}function s(){e={}}const l={init:n,emit:o,off:a,on:i,clear:s};return l}const Vz={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function Gz(e){function t(i,a){return Pb(i,a||{})}function n(i){const a=i.breakpoints||{},s=ro(a).filter(l=>e.matchMedia(l).matches).map(l=>a[l]).reduce((l,c)=>t(l,c),{});return t(i,s)}function r(i){return i.map(a=>ro(a.breakpoints||{})).reduce((a,s)=>a.concat(s),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function Zz(e){let t=[];function n(i,a){return t=a.filter(({options:s})=>e.optionsAtMedia(s).active!==!1),t.forEach(s=>s.init(i,e)),a.reduce((s,l)=>Object.assign(s,{[l.name]:l}),{})}function r(){t=t.filter(i=>i.destroy())}return{init:n,destroy:r}}function _i(e,t,n){const r=e.ownerDocument,o=r.defaultView,i=Gz(o),a=Zz(i),s=oo(),l=Hz(),{mergeOptions:c,optionsAtMedia:u,optionsMediaQueries:d}=i,{on:p,off:m,emit:b}=l,h=I;let y=!1,v,x=c(Vz,_i.globalOptions),w=c(x),_=[],C,E,A;function R(){const{container:ie,slides:X}=w;E=(Ts(ie)?e.querySelector(ie):ie)||e.children[0];const Q=Ts(X)?E.querySelectorAll(X):X;A=[].slice.call(Q||E.children)}function M(ie){const X=Uz(e,E,A,r,o,ie,l);if(ie.loop&&!X.slideLooper.canLoop()){const xe=Object.assign({},ie,{loop:!1});return M(xe)}return X}function T(ie,X){y||(x=c(x,ie),w=u(x),_=X||_,R(),v=M(w),d([x,..._.map(({options:xe})=>xe)]).forEach(xe=>s.add(xe,"change",I)),w.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(fe),v.eventHandler.init(fe),v.resizeHandler.init(fe),v.slidesHandler.init(fe),v.options.loop&&v.slideLooper.loop(),E.offsetParent&&A.length&&v.dragHandler.init(fe),C=a.init(fe,_)))}function I(ie,X){const xe=le();O(),T(c({startIndex:xe},ie),X),l.emit("reInit")}function O(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),a.destroy(),s.clear()}function D(){y||(y=!0,s.clear(),O(),l.emit("destroy"),l.clear())}function L(ie,X,xe){!w.active||y||(v.scrollBody.useBaseFriction().useDuration(X===!0?0:w.duration),v.scrollTo.index(ie,xe||0))}function P(ie){const X=v.index.add(1).get();L(X,ie,-1)}function F(ie){const X=v.index.add(-1).get();L(X,ie,1)}function K(){return v.index.add(1).get()!==le()}function V(){return v.index.add(-1).get()!==le()}function B(){return v.scrollSnapList}function S(){return v.scrollProgress.get(v.offsetLocation.get())}function le(){return v.index.get()}function be(){return v.indexPrevious.get()}function k(){return v.slidesInView.get()}function Ee(){return v.slidesInView.get(!1)}function Le(){return C}function we(){return v}function G(){return e}function se(){return E}function Ce(){return A}const fe={canScrollNext:K,canScrollPrev:V,containerNode:se,internalEngine:we,destroy:D,off:m,on:p,emit:b,plugins:Le,previousScrollSnap:be,reInit:h,rootNode:G,scrollNext:P,scrollPrev:F,scrollProgress:S,scrollSnapList:B,scrollTo:L,selectedScrollSnap:le,slideNodes:Ce,slidesInView:k,slidesNotInView:Ee};return T(t,n),setTimeout(()=>l.emit("init"),0),fe}_i.globalOptions=void 0;function Yl(e={},t=[]){const n=g.useRef(e),r=g.useRef(t),[o,i]=g.useState(),[a,s]=g.useState(),l=g.useCallback(()=>{o&&o.reInit(n.current,r.current)},[o]);return g.useEffect(()=>{Zl(n.current,e)||(n.current=e,l())},[e,l]),g.useEffect(()=>{hz(r.current,t)||(r.current=t,l())},[t,l]),g.useEffect(()=>{if(mz()&&a){_i.globalOptions=Yl.globalOptions;const c=_i(a,n.current,r.current);return i(c),()=>c.destroy()}else i(void 0)},[a,i]),[s,o]}Yl.globalOptions=void 0;function Kz(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const $b=H.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Eo=()=>{const e=H.useContext($b);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Kz(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
130
130
  [data-state=closed]
131
- ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function Wz(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function qz(){return Xl(/^Mac/)}function Yz(){return Xl(/^iPhone/)}function hd(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Xz(){return Xl(/^iPad/)||qz()&&navigator.maxTouchPoints>1}function zb(){return Yz()||Xz()}function Xl(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const Jz=24,Qz=typeof window<"u"?g.useLayoutEffect:g.useEffect;function gd(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Za=typeof document<"u"&&window.visualViewport;function bd(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function jb(e){for(bd(e)&&(e=e.parentElement);e&&!bd(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const ej=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Wo=0,Ka;function tj(e={}){let{isDisabled:t}=e;Qz(()=>{if(!t)return Wo++,Wo===1&&zb()&&(Ka=nj()),()=>{Wo--,Wo===0&&Ka?.()}},[t])}function nj(){let e,t=0,n=d=>{e=jb(d.target),!(e===document.documentElement&&e===document.body)&&(t=d.changedTouches[0].pageY)},r=d=>{if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}let p=d.changedTouches[0].pageY,m=e.scrollTop,b=e.scrollHeight-e.clientHeight;b!==0&&((m<=0&&p>t||m>=b&&p<t)&&d.preventDefault(),t=p)},o=d=>{let p=d.target;Is(p)&&p!==document.activeElement&&(d.preventDefault(),p.style.transform="translateY(-2000px)",p.focus(),requestAnimationFrame(()=>{p.style.transform=""}))},i=d=>{let p=d.target;Is(p)&&(p.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{p.style.transform="",Za&&(Za.height<window.innerHeight?requestAnimationFrame(()=>{vd(p)}):Za.addEventListener("resize",()=>vd(p),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=gd(rj(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=gd(jr(document,"touchstart",n,{passive:!1,capture:!0}),jr(document,"touchmove",r,{passive:!1,capture:!0}),jr(document,"touchend",o,{passive:!1,capture:!0}),jr(document,"focus",i,!0),jr(window,"scroll",a));return()=>{c(),u(),window.scrollTo(s,l)}}function rj(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function jr(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function vd(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=jb(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const a=n.getBoundingClientRect().bottom+Jz;i>a&&(n.scrollTop+=o-r)}e=n.parentElement}}function Is(e){return e instanceof HTMLInputElement&&!ej.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function oj(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ij(...e){return t=>e.forEach(n=>oj(n,t))}function Fb(...e){return g.useCallback(ij(...e),e)}const Bb=new WeakMap;function ht(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,i])=>{if(o.startsWith("--")){e.style.setProperty(o,i);return}r[o]=e.style[o],e.style[o]=i}),!n&&Bb.set(e,r)}function aj(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Bb.get(e);n&&(e.style[t]=n[t])}const at=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function qo(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[at(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[at(t)?5:4]):null)}function sj(e){return 8*(Math.log(e+1)-2)}function Wa(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function lj(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const Qe={DURATION:.5,EASE:[.32,.72,0,1]},Ub=.4,cj=.25,uj=100,Hb=8,Bn=16,Rs=26,qa="vaul-dragging";function Vb(e){const t=H.useRef(e);return H.useEffect(()=>{t.current=e}),H.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function dj({defaultProp:e,onChange:t}){const n=H.useState(e),[r]=n,o=H.useRef(r),i=Vb(t);return H.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function Gb({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=dj({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=Vb(n),l=H.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&s(d)}else o(c)},[i,e,o,s]);return[a,l]}function fj({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:i,onSnapPointChange:a,direction:s="bottom",container:l,snapToSequentialPoint:c}){const[u,d]=Gb({prop:e,defaultProp:n?.[0],onChange:t}),[p,m]=H.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);H.useEffect(()=>{function A(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)},[]);const b=H.useMemo(()=>u===n?.[n.length-1]||null,[n,u]),h=H.useMemo(()=>{var A;return(A=n?.findIndex(R=>R===u))!=null?A:null},[n,u]),y=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===u||!n,v=H.useMemo(()=>{const A=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var R;return(R=n?.map(M=>{const T=typeof M=="string";let I=0;if(T&&(I=parseInt(M,10)),at(s)){const D=T?I:p?M*A.height:0;return p?s==="bottom"?A.height-D:-A.height+D:D}const O=T?I:p?M*A.width:0;return p?s==="right"?A.width-O:-A.width+O:O}))!=null?R:[]},[n,p,l]),x=H.useMemo(()=>h!==null?v?.[h]:null,[v,h]),w=H.useCallback(A=>{var R;const M=(R=v?.findIndex(T=>T===A))!=null?R:null;a(M),ht(r.current,{transition:`transform ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,transform:at(s)?`translate3d(0, ${A}px, 0)`:`translate3d(${A}px, 0, 0)`}),v&&M!==v.length-1&&i!==void 0&&M!==i&&M<i?ht(o.current,{transition:`opacity ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,opacity:"0"}):ht(o.current,{transition:`opacity ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,opacity:"1"}),d(n?.[Math.max(M,0)])},[r.current,n,v,i,o,d]);H.useEffect(()=>{if(u||e){var A;const R=(A=n?.findIndex(M=>M===e||M===u))!=null?A:-1;v&&R!==-1&&typeof v[R]=="number"&&w(v[R])}},[u,e,n,v,w]);function _({draggedDistance:A,closeDrawer:R,velocity:M,dismissible:T}){if(i===void 0)return;const I=s==="bottom"||s==="right"?(x??0)-A:(x??0)+A,O=h===i-1,D=h===0,L=A>0;if(O&&ht(o.current,{transition:`opacity ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`}),!c&&M>2&&!L){T?R():w(v[0]);return}if(!c&&M>2&&L&&v&&n){w(v[n.length-1]);return}const P=v?.reduce((K,V)=>typeof K!="number"||typeof V!="number"?K:Math.abs(V-I)<Math.abs(K-I)?V:K),F=at(s)?window.innerHeight:window.innerWidth;if(M>Ub&&Math.abs(A)<F*.4){const K=L?1:-1;if(K>0&&b&&n){w(v[n.length-1]);return}if(D&&K<0&&T&&R(),h===null)return;w(v[h+K]);return}w(P)}function C({draggedDistance:A}){if(x===null)return;const R=s==="bottom"||s==="right"?x-A:x+A;(s==="bottom"||s==="right")&&R<v[v.length-1]||(s==="top"||s==="left")&&R>v[v.length-1]||ht(r.current,{transform:at(s)?`translate3d(0, ${R}px, 0)`:`translate3d(${R}px, 0, 0)`})}function E(A,R){if(!n||typeof h!="number"||!v||i===void 0)return null;const M=h===i-1;if(h>=i&&R)return 0;if(M&&!R)return 1;if(!y&&!M)return null;const I=M?h+1:h-1,O=M?v[I]-v[I-1]:v[I+1]-v[I],D=A/Math.abs(O);return M?1-D:D}return{isLastSnapPoint:b,activeSnapPoint:u,shouldFade:y,getPercentageDragged:E,setActiveSnapPoint:d,activeSnapPointIndex:h,onRelease:_,onDrag:C,snapPointsOffset:v}}const pj=()=>()=>{};function mj(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=Eo(),i=H.useRef(null),a=g.useMemo(()=>document.body.style.backgroundColor,[]);function s(){return(window.innerWidth-Rs)/window.innerWidth}H.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const l=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!l)return;lj(r&&!o?Wa(document.body,{background:"black"}):pj,Wa(l,{transformOrigin:at(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Qe.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Qe.EASE.join(",")})`}));const c=Wa(l,{borderRadius:`${Hb}px`,overflow:"hidden",...at(e)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{c(),i.current=window.setTimeout(()=>{a?document.body.style.background=a:document.body.style.removeProperty("background")},Qe.DURATION*1e3)}}},[t,n,a])}let Fr=null;function hj({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:i}){const[a,s]=H.useState(()=>typeof window<"u"?window.location.href:""),l=H.useRef(0),c=H.useCallback(()=>{if(hd()&&Fr===null&&e&&!i){Fr={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:p}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const m=p-window.innerHeight;m&&l.current>=p&&(document.body.style.top=`${-(l.current+m)}px`)}),300)}},[e]),u=H.useCallback(()=>{if(hd()&&Fr!==null&&!i){const d=-parseInt(document.body.style.top,10),p=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Fr),window.requestAnimationFrame(()=>{if(o&&a!==window.location.href){s(window.location.href);return}window.scrollTo(p,d)}),Fr=null}},[a]);return H.useEffect(()=>{function d(){l.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),H.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[t,u]),H.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&c(),t||window.setTimeout(()=>{u()},500)):u())},[e,r,a,t,n,c,u]),{restorePositionSetting:u}}function gj({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:i,shouldScaleBackground:a=!1,setBackgroundColorOnScale:s=!0,closeThreshold:l=cj,scrollLockTimeout:c=uj,dismissible:u=!0,handleOnly:d=!1,fadeFromIndex:p=i&&i.length-1,activeSnapPoint:m,setActiveSnapPoint:b,fixed:h,modal:y=!0,onClose:v,nested:x,noBodyStyles:w=!1,direction:_="bottom",defaultOpen:C=!1,disablePreventScroll:E=!0,snapToSequentialPoint:A=!1,preventScrollRestoration:R=!1,repositionInputs:M=!0,onAnimationEnd:T,container:I,autoFocus:O=!1}){var D,L;const[P=!1,F]=Gb({defaultProp:C,prop:e,onChange:he=>{t?.(he),!he&&!x&&W(),setTimeout(()=>{T?.(he)},Qe.DURATION*1e3),he&&!y&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),he||(document.body.style.pointerEvents="auto")}}),[K,V]=H.useState(!1),[B,S]=H.useState(!1),[le,be]=H.useState(!1),k=H.useRef(null),Ee=H.useRef(null),Le=H.useRef(null),we=H.useRef(null),G=H.useRef(null),se=H.useRef(!1),Ce=H.useRef(null),fe=H.useRef(0),ie=H.useRef(!1),X=H.useRef(!C),xe=H.useRef(0),Q=H.useRef(null),Fe=H.useRef(((D=Q.current)==null?void 0:D.getBoundingClientRect().height)||0),ve=H.useRef(((L=Q.current)==null?void 0:L.getBoundingClientRect().width)||0),Ve=H.useRef(0),ct=H.useCallback(he=>{i&&he===Rt.length-1&&(Ee.current=new Date)},[]),{activeSnapPoint:yt,activeSnapPointIndex:rt,setActiveSnapPoint:Ut,onRelease:gn,snapPointsOffset:Rt,onDrag:Ot,shouldFade:an,getPercentageDragged:z}=fj({snapPoints:i,activeSnapPointProp:m,setActiveSnapPointProp:b,drawerRef:Q,fadeFromIndex:p,overlayRef:k,onSnapPointChange:ct,direction:_,container:I,snapToSequentialPoint:A});tj({isDisabled:!P||B||!y||le||!K||!M||!E});const{restorePositionSetting:W}=hj({isOpen:P,modal:y,nested:x??!1,hasBeenOpened:K,preventScrollRestoration:R,noBodyStyles:w});function me(){return(window.innerWidth-Rs)/window.innerWidth}function Se(he){var Me,$e;!u&&!i||Q.current&&!Q.current.contains(he.target)||(Fe.current=((Me=Q.current)==null?void 0:Me.getBoundingClientRect().height)||0,ve.current=(($e=Q.current)==null?void 0:$e.getBoundingClientRect().width)||0,S(!0),Le.current=new Date,zb()&&window.addEventListener("touchend",()=>se.current=!1,{once:!0}),he.target.setPointerCapture(he.pointerId),fe.current=at(_)?he.pageY:he.pageX)}function Te(he,Me){var $e;let Ie=he;const ze=($e=window.getSelection())==null?void 0:$e.toString(),N=Q.current?qo(Q.current,_):null,$=new Date;if(Ie.tagName==="SELECT"||Ie.hasAttribute("data-vaul-no-drag")||Ie.closest("[data-vaul-no-drag]"))return!1;if(_==="right"||_==="left")return!0;if(Ee.current&&$.getTime()-Ee.current.getTime()<500)return!1;if(N!==null&&(_==="bottom"?N>0:N<0))return!0;if(ze&&ze.length>0)return!1;if(G.current&&$.getTime()-G.current.getTime()<c&&N===0||Me)return G.current=$,!1;for(;Ie;){if(Ie.scrollHeight>Ie.clientHeight){if(Ie.scrollTop!==0)return G.current=new Date,!1;if(Ie.getAttribute("role")==="dialog")return!0}Ie=Ie.parentNode}return!0}function ut(he){if(Q.current&&B){const Me=_==="bottom"||_==="right"?1:-1,$e=(fe.current-(at(_)?he.pageY:he.pageX))*Me,Ie=$e>0,ze=i&&!u&&!Ie;if(ze&&rt===0)return;const N=Math.abs($e),$=document.querySelector("[data-vaul-drawer-wrapper]"),q=_==="bottom"||_==="top"?Fe.current:ve.current;let ce=N/q;const Be=z(N,Ie);if(Be!==null&&(ce=Be),ze&&ce>=1||!se.current&&!Te(he.target,Ie))return;if(Q.current.classList.add(qa),se.current=!0,ht(Q.current,{transition:"none"}),ht(k.current,{transition:"none"}),i&&Ot({draggedDistance:$e}),Ie&&!i){const ne=sj($e),re=Math.min(ne*-1,0)*Me;ht(Q.current,{transform:at(_)?`translate3d(0, ${re}px, 0)`:`translate3d(${re}px, 0, 0)`});return}const je=1-ce;if((an||p&&rt===p-1)&&(r?.(he,ce),ht(k.current,{opacity:`${je}`,transition:"none"},!0)),$&&k.current&&a){const ne=Math.min(me()+ce*(1-me()),1),re=8-ce*8,ye=Math.max(0,14-ce*14);ht($,{borderRadius:`${re}px`,transform:at(_)?`scale(${ne}) translate3d(0, ${ye}px, 0)`:`scale(${ne}) translate3d(${ye}px, 0, 0)`,transition:"none"},!0)}if(!i){const ne=N*Me;ht(Q.current,{transform:at(_)?`translate3d(0, ${ne}px, 0)`:`translate3d(${ne}px, 0, 0)`})}}}H.useEffect(()=>{window.requestAnimationFrame(()=>{X.current=!0})},[]),H.useEffect(()=>{var he;function Me(){if(!Q.current||!M)return;const $e=document.activeElement;if(Is($e)||ie.current){var Ie;const ze=((Ie=window.visualViewport)==null?void 0:Ie.height)||0,N=window.innerHeight;let $=N-ze;const q=Q.current.getBoundingClientRect().height||0,ce=q>N*.8;Ve.current||(Ve.current=q);const Be=Q.current.getBoundingClientRect().top;if(Math.abs(xe.current-$)>60&&(ie.current=!ie.current),i&&i.length>0&&Rt&&rt){const je=Rt[rt]||0;$+=je}if(xe.current=$,q>ze||ie.current){const je=Q.current.getBoundingClientRect().height;let ne=je;je>ze&&(ne=ze-(ce?Be:Rs)),h?Q.current.style.height=`${je-Math.max($,0)}px`:Q.current.style.height=`${Math.max(ne,ze-Be)}px`}else Wz()||(Q.current.style.height=`${Ve.current}px`);i&&i.length>0&&!ie.current?Q.current.style.bottom="0px":Q.current.style.bottom=`${Math.max($,0)}px`}}return(he=window.visualViewport)==null||he.addEventListener("resize",Me),()=>{var $e;return($e=window.visualViewport)==null?void 0:$e.removeEventListener("resize",Me)}},[rt,i,Rt]);function dt(he){Ht(),v?.(),he||F(!1),setTimeout(()=>{i&&Ut(i[0])},Qe.DURATION*1e3)}function ft(){if(!Q.current)return;const he=document.querySelector("[data-vaul-drawer-wrapper]"),Me=qo(Q.current,_);ht(Q.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`}),ht(k.current,{transition:`opacity ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,opacity:"1"}),a&&Me&&Me>0&&P&&ht(he,{borderRadius:`${Hb}px`,overflow:"hidden",...at(_)?{transform:`scale(${me()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${me()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Qe.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Qe.EASE.join(",")})`},!0)}function Ht(){!B||!Q.current||(Q.current.classList.remove(qa),se.current=!1,S(!1),we.current=new Date)}function Yt(he){if(!B||!Q.current)return;Q.current.classList.remove(qa),se.current=!1,S(!1),we.current=new Date;const Me=qo(Q.current,_);if(!he||!Te(he.target,!1)||!Me||Number.isNaN(Me)||Le.current===null)return;const $e=we.current.getTime()-Le.current.getTime(),Ie=fe.current-(at(_)?he.pageY:he.pageX),ze=Math.abs(Ie)/$e;if(ze>.05&&(be(!0),setTimeout(()=>{be(!1)},200)),i){gn({draggedDistance:Ie*(_==="bottom"||_==="right"?1:-1),closeDrawer:dt,velocity:ze,dismissible:u}),o?.(he,!0);return}if(_==="bottom"||_==="right"?Ie>0:Ie<0){ft(),o?.(he,!0);return}if(ze>Ub){dt(),o?.(he,!1);return}var N;const $=Math.min((N=Q.current.getBoundingClientRect().height)!=null?N:0,window.innerHeight);var q;const ce=Math.min((q=Q.current.getBoundingClientRect().width)!=null?q:0,window.innerWidth),Be=_==="left"||_==="right";if(Math.abs(Me)>=(Be?ce:$)*l){dt(),o?.(he,!1);return}o?.(he,!0),ft()}H.useEffect(()=>(P&&(ht(document.documentElement,{scrollBehavior:"auto"}),Ee.current=new Date),()=>{aj(document.documentElement,"scrollBehavior")}),[P]);function pt(he){const Me=he?(window.innerWidth-Bn)/window.innerWidth:1,$e=he?-Bn:0;Ce.current&&window.clearTimeout(Ce.current),ht(Q.current,{transition:`transform ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,transform:at(_)?`scale(${Me}) translate3d(0, ${$e}px, 0)`:`scale(${Me}) translate3d(${$e}px, 0, 0)`}),!he&&Q.current&&(Ce.current=setTimeout(()=>{const Ie=qo(Q.current,_);ht(Q.current,{transition:"none",transform:at(_)?`translate3d(0, ${Ie}px, 0)`:`translate3d(${Ie}px, 0, 0)`})},500))}function Vt(he,Me){if(Me<0)return;const $e=(window.innerWidth-Bn)/window.innerWidth,Ie=$e+Me*(1-$e),ze=-Bn+Me*Bn;ht(Q.current,{transform:at(_)?`scale(${Ie}) translate3d(0, ${ze}px, 0)`:`scale(${Ie}) translate3d(${ze}px, 0, 0)`,transition:"none"})}function xt(he,Me){const $e=at(_)?window.innerHeight:window.innerWidth,Ie=Me?($e-Bn)/$e:1,ze=Me?-Bn:0;Me&&ht(Q.current,{transition:`transform ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,transform:at(_)?`scale(${Ie}) translate3d(0, ${ze}px, 0)`:`scale(${Ie}) translate3d(${ze}px, 0, 0)`})}return H.useEffect(()=>{y||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[y]),H.createElement(Im,{defaultOpen:C,onOpenChange:he=>{!u&&!he||(he?V(!0):dt(!0),F(he))},open:P},H.createElement($b.Provider,{value:{activeSnapPoint:yt,snapPoints:i,setActiveSnapPoint:Ut,drawerRef:Q,overlayRef:k,onOpenChange:t,onPress:Se,onRelease:Yt,onDrag:ut,dismissible:u,shouldAnimate:X,handleOnly:d,isOpen:P,isDragging:B,shouldFade:an,closeDrawer:dt,onNestedDrag:Vt,onNestedOpenChange:pt,onNestedRelease:xt,keyboardIsOpen:ie,modal:y,snapPointsOffset:Rt,activeSnapPointIndex:rt,direction:_,shouldScaleBackground:a,setBackgroundColorOnScale:s,noBodyStyles:w,container:I,autoFocus:O}},n))}const Zb=H.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:i,isOpen:a,modal:s,shouldAnimate:l}=Eo(),c=Fb(t,n),u=r&&r.length>0;if(!s)return null;const d=H.useCallback(p=>o(p),[o]);return H.createElement(Om,{onMouseUp:d,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":a&&u?"true":"false","data-vaul-snap-points-overlay":a&&i?"true":"false","data-vaul-animate":l?.current?"true":"false",...e})});Zb.displayName="Drawer.Overlay";const Kb=H.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:i,onPress:a,onRelease:s,onDrag:l,keyboardIsOpen:c,snapPointsOffset:u,activeSnapPointIndex:d,modal:p,isOpen:m,direction:b,snapPoints:h,container:y,handleOnly:v,shouldAnimate:x,autoFocus:w}=Eo(),[_,C]=H.useState(!1),E=Fb(o,i),A=H.useRef(null),R=H.useRef(null),M=H.useRef(!1),T=h&&h.length>0;mj();const I=(D,L,P=0)=>{if(M.current)return!0;const F=Math.abs(D.y),K=Math.abs(D.x),V=K>F,B=["bottom","right"].includes(L)?1:-1;if(L==="left"||L==="right"){if(!(D.x*B<0)&&K>=0&&K<=P)return V}else if(!(D.y*B<0)&&F>=0&&F<=P)return!V;return M.current=!0,!0};H.useEffect(()=>{T&&window.requestAnimationFrame(()=>{C(!0)})},[]);function O(D){A.current=null,M.current=!1,s(D)}return H.createElement(Mm,{"data-vaul-drawer-direction":b,"data-vaul-drawer":"","data-vaul-delayed-snap-points":_?"true":"false","data-vaul-snap-points":m&&T?"true":"false","data-vaul-custom-container":y?"true":"false","data-vaul-animate":x?.current?"true":"false",...r,ref:E,style:u&&u.length>0?{"--snap-point-height":`${u[d??0]}px`,...t}:t,onPointerDown:D=>{v||(r.onPointerDown==null||r.onPointerDown.call(r,D),A.current={x:D.pageX,y:D.pageY},a(D))},onOpenAutoFocus:D=>{n?.(D),w||D.preventDefault()},onPointerDownOutside:D=>{if(e?.(D),!p||D.defaultPrevented){D.preventDefault();return}c.current&&(c.current=!1)},onFocusOutside:D=>{if(!p){D.preventDefault();return}},onPointerMove:D=>{if(R.current=D,v||(r.onPointerMove==null||r.onPointerMove.call(r,D),!A.current))return;const L=D.pageY-A.current.y,P=D.pageX-A.current.x,F=D.pointerType==="touch"?10:2;I({x:P,y:L},b,F)?l(D):(Math.abs(P)>F||Math.abs(L)>F)&&(A.current=null)},onPointerUp:D=>{r.onPointerUp==null||r.onPointerUp.call(r,D),A.current=null,M.current=!1,s(D)},onPointerOut:D=>{r.onPointerOut==null||r.onPointerOut.call(r,D),O(R.current)},onContextMenu:D=>{r.onContextMenu==null||r.onContextMenu.call(r,D),R.current&&O(R.current)}})});Kb.displayName="Drawer.Content";const bj=250,vj=120,yj=H.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:i,snapPoints:a,activeSnapPoint:s,setActiveSnapPoint:l,dismissible:c,handleOnly:u,isOpen:d,onPress:p,onDrag:m}=Eo(),b=H.useRef(null),h=H.useRef(!1);function y(){if(h.current){w();return}window.setTimeout(()=>{v()},vj)}function v(){if(i||e||h.current){w();return}if(w(),!a||a.length===0){c||o();return}if(s===a[a.length-1]&&c){o();return}const C=a.findIndex(A=>A===s);if(C===-1)return;const E=a[C+1];l(E)}function x(){b.current=window.setTimeout(()=>{h.current=!0},bj)}function w(){b.current&&window.clearTimeout(b.current),h.current=!1}return H.createElement("div",{onClick:y,onPointerCancel:w,onPointerDown:_=>{u&&p(_),x()},onPointerMove:_=>{u&&m(_)},ref:r,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},H.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});yj.displayName="Drawer.Handle";function xj(e){const t=Eo(),{container:n=t.container,...r}=e;return H.createElement(Rm,{container:n,...r})}const Or={Root:gj,Content:Kb,Overlay:Zb,Portal:xj,Title:Pm,Description:Dm};function ee(...e){return Dv(Lv(e))}var Wb=io("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function qr({className:e,variant:t="default",size:n="default",asChild:r=!1,...o}){const i=r?zp:"button";return f.jsx(i,{"data-slot":"button","data-variant":t,"data-size":n,className:ee(Wb({variant:t,size:n,className:e})),...o})}function wj({className:e,...t}){return f.jsx("div",{"data-slot":"card",className:ee("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function _j({className:e,...t}){return f.jsx("div",{"data-slot":"card-header",className:ee("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Ej({className:e,...t}){return f.jsx("div",{"data-slot":"card-title",className:ee("leading-none font-semibold",e),...t})}function Sj({className:e,...t}){return f.jsx("div",{"data-slot":"card-description",className:ee("text-muted-foreground text-sm",e),...t})}function kj({className:e,...t}){return f.jsx("div",{"data-slot":"card-content",className:ee("px-6",e),...t})}function Nj({className:e,type:t,...n}){return f.jsx("input",{type:t,"data-slot":"input",className:ee("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}function vn({className:e,...t}){return f.jsx(yD,{"data-slot":"label",className:ee("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Cj({className:e,...t}){return f.jsx("textarea",{"data-slot":"textarea",className:ee("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}function Tj({className:e,...t}){return f.jsx(Vm,{"data-slot":"checkbox",className:ee("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:f.jsx(Zm,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:f.jsx(Mb,{className:"size-3.5"})})})}function Aj({className:e,size:t="default",...n}){return f.jsx(l$,{"data-slot":"switch","data-size":t,className:ee("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...n,children:f.jsx(c$,{"data-slot":"switch-thumb",className:ee("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function Ij({className:e,value:t,...n}){return f.jsx(FD,{"data-slot":"progress",className:ee("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...n,children:f.jsx(BD,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function Rj({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return f.jsx(zL,{"data-slot":"separator",decorative:n,orientation:t,className:ee("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}var Oj=io("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function Mj({className:e,variant:t,...n}){return f.jsx("div",{"data-slot":"alert",role:"alert",className:ee(Oj({variant:t}),e),...n})}function Pj({className:e,...t}){return f.jsx("div",{"data-slot":"alert-title",className:ee("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function Dj({className:e,...t}){return f.jsx("div",{"data-slot":"alert-description",className:ee("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function Lj({...e}){return f.jsx(Im,{"data-slot":"dialog",...e})}function $j({...e}){return f.jsx(Rm,{"data-slot":"dialog-portal",...e})}function zj({className:e,...t}){return f.jsx(Om,{"data-slot":"dialog-overlay",className:ee("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function jj({className:e,children:t,showCloseButton:n=!0,...r}){return f.jsxs($j,{"data-slot":"dialog-portal",children:[f.jsx(zj,{}),f.jsxs(Mm,{"data-slot":"dialog-content",className:ee("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",e),...r,children:[t,n&&f.jsxs(EM,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[f.jsx(fz,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Fj({className:e,...t}){return f.jsx("div",{"data-slot":"dialog-header",className:ee("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Bj({className:e,...t}){return f.jsx(Pm,{"data-slot":"dialog-title",className:ee("text-lg leading-none font-semibold",e),...t})}function Uj({className:e,...t}){return f.jsx(Dm,{"data-slot":"dialog-description",className:ee("text-muted-foreground text-sm",e),...t})}function yd({...e}){return f.jsx(s1,{"data-slot":"accordion",...e})}function Hj({className:e,...t}){return f.jsx(l1,{"data-slot":"accordion-item",className:ee("border-b last:border-b-0",e),...t})}function Vj({className:e,children:t,...n}){return f.jsx(c1,{className:"flex",children:f.jsxs(u1,{"data-slot":"accordion-trigger",className:ee("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,f.jsx(Gl,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function Gj({className:e,children:t,...n}){return f.jsx(d1,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...n,children:f.jsx("div",{className:ee("pt-0 pb-4",e),children:t})})}function Zj({className:e,...t}){return f.jsx(AM,{"data-slot":"avatar",className:ee("relative flex size-10 shrink-0 overflow-hidden rounded-full",e),...t})}function Kj({className:e,...t}){return f.jsx(IM,{"data-slot":"avatar-image",className:ee("aspect-square size-full",e),...t})}function Wj({className:e,...t}){return f.jsx(RM,{"data-slot":"avatar-fallback",className:ee("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var qj=io("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Yj({className:e,variant:t="default",asChild:n=!1,...r}){const o=n?zp:"span";return f.jsx(o,{"data-slot":"badge","data-variant":t,className:ee(qj({variant:t}),e),...r})}function Xj({className:e,...t}){return f.jsx(XD,{"data-slot":"radio-group",className:ee("grid gap-3",e),...t})}function Jj({className:e,...t}){return f.jsx(JD,{"data-slot":"radio-group-item",className:ee("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:f.jsx(QD,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:f.jsx(lz,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function Qj({...e}){return f.jsx(EL,{"data-slot":"select",...e})}function eF({...e}){return f.jsx(kL,{"data-slot":"select-value",...e})}function tF({className:e,size:t="default",children:n,...r}){return f.jsxs(SL,{"data-slot":"select-trigger","data-size":t,className:ee("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,f.jsx(NL,{asChild:!0,children:f.jsx(Gl,{className:"size-4 opacity-50"})})]})}function nF({className:e,children:t,position:n="item-aligned",align:r="center",...o}){return f.jsx(CL,{children:f.jsxs(TL,{"data-slot":"select-content",className:ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...o,children:[f.jsx(oF,{}),f.jsx(AL,{className:ee("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),f.jsx(iF,{})]})})}function rF({className:e,children:t,...n}){return f.jsxs(IL,{"data-slot":"select-item",className:ee("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[f.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(OL,{children:f.jsx(Mb,{className:"size-4"})})}),f.jsx(RL,{children:t})]})}function oF({className:e,...t}){return f.jsx(ML,{"data-slot":"select-scroll-up-button",className:ee("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(az,{className:"size-4"})})}function iF({className:e,...t}){return f.jsx(PL,{"data-slot":"select-scroll-down-button",className:ee("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(Gl,{className:"size-4"})})}var qb=g.createContext(null);function aa(){const e=g.useContext(qb);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function aF({orientation:e="horizontal",opts:t,setApi:n,plugins:r,className:o,children:i,...a}){const[s,l]=Yl({...t,axis:e==="horizontal"?"x":"y"},r),[c,u]=g.useState(!1),[d,p]=g.useState(!1),m=g.useCallback(v=>{v&&(u(v.canScrollPrev()),p(v.canScrollNext()))},[]),b=g.useCallback(()=>{l?.scrollPrev()},[l]),h=g.useCallback(()=>{l?.scrollNext()},[l]),y=g.useCallback(v=>{v.key==="ArrowLeft"?(v.preventDefault(),b()):v.key==="ArrowRight"&&(v.preventDefault(),h())},[b,h]);return g.useEffect(()=>{!l||!n||n(l)},[l,n]),g.useEffect(()=>{if(l)return m(l),l.on("reInit",m),l.on("select",m),()=>{l?.off("select",m)}},[l,m]),f.jsx(qb.Provider,{value:{carouselRef:s,api:l,opts:t,orientation:e||(t?.axis==="y"?"vertical":"horizontal"),scrollPrev:b,scrollNext:h,canScrollPrev:c,canScrollNext:d},children:f.jsx("div",{onKeyDownCapture:y,className:ee("relative",o),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...a,children:i})})}function sF({className:e,...t}){const{carouselRef:n,orientation:r}=aa();return f.jsx("div",{ref:n,className:"overflow-hidden","data-slot":"carousel-content",children:f.jsx("div",{className:ee("flex",r==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})}function lF({className:e,...t}){const{orientation:n}=aa();return f.jsx("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:ee("min-w-0 shrink-0 grow-0 basis-full",n==="horizontal"?"pl-4":"pt-4",e),...t})}function cF({className:e,variant:t="outline",size:n="icon",...r}){const{orientation:o,scrollPrev:i,canScrollPrev:a}=aa();return f.jsxs(qr,{"data-slot":"carousel-previous",variant:t,size:n,className:ee("absolute size-8 rounded-full",o==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!a,onClick:i,...r,children:[f.jsx(Y$,{}),f.jsx("span",{className:"sr-only",children:"Previous slide"})]})}function uF({className:e,variant:t="outline",size:n="icon",...r}){const{orientation:o,scrollNext:i,canScrollNext:a}=aa();return f.jsxs(qr,{"data-slot":"carousel-next",variant:t,size:n,className:ee("absolute size-8 rounded-full",o==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!a,onClick:i,...r,children:[f.jsx(J$,{}),f.jsx("span",{className:"sr-only",children:"Next slide"})]})}function dF({...e}){return f.jsx(Zp,{"data-slot":"collapsible",...e})}function fF({...e}){return f.jsx(pl,{"data-slot":"collapsible-trigger",...e})}function pF({...e}){return f.jsx(hl,{"data-slot":"collapsible-content",...e})}function mF({className:e,...t}){return f.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:f.jsx("table",{"data-slot":"table",className:ee("w-full caption-bottom text-sm",e),...t})})}function hF({className:e,...t}){return f.jsx("thead",{"data-slot":"table-header",className:ee("[&_tr]:border-b",e),...t})}function gF({className:e,...t}){return f.jsx("tbody",{"data-slot":"table-body",className:ee("[&_tr:last-child]:border-0",e),...t})}function xd({className:e,...t}){return f.jsx("tr",{"data-slot":"table-row",className:ee("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function bF({className:e,...t}){return f.jsx("th",{"data-slot":"table-head",className:ee("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function vF({className:e,...t}){return f.jsx("td",{"data-slot":"table-cell",className:ee("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function yF({className:e,...t}){return f.jsx("caption",{"data-slot":"table-caption",className:ee("text-muted-foreground mt-4 text-sm",e),...t})}function xF({...e}){return f.jsx(Or.Root,{"data-slot":"drawer",...e})}function wF({...e}){return f.jsx(Or.Portal,{"data-slot":"drawer-portal",...e})}function _F({className:e,...t}){return f.jsx(Or.Overlay,{"data-slot":"drawer-overlay",className:ee("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function EF({className:e,children:t,...n}){return f.jsxs(wF,{"data-slot":"drawer-portal",children:[f.jsx(_F,{}),f.jsxs(Or.Content,{"data-slot":"drawer-content",className:ee("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...n,children:[f.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),t]})]})}function SF({className:e,...t}){return f.jsx("div",{"data-slot":"drawer-header",className:ee("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",e),...t})}function kF({className:e,...t}){return f.jsx(Or.Title,{"data-slot":"drawer-title",className:ee("text-foreground font-semibold",e),...t})}function NF({className:e,...t}){return f.jsx(Or.Description,{"data-slot":"drawer-description",className:ee("text-muted-foreground text-sm",e),...t})}function CF({...e}){return f.jsx(pD,{"data-slot":"dropdown-menu",...e})}function TF({...e}){return f.jsx(mD,{"data-slot":"dropdown-menu-trigger",...e})}function AF({className:e,sideOffset:t=4,...n}){return f.jsx(hD,{children:f.jsx(gD,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function IF({className:e,inset:t,variant:n="default",...r}){return f.jsx(bD,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ee("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function RF({className:e,...t}){return f.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:ee("mx-auto flex w-full justify-center",e),...t})}function OF({className:e,...t}){return f.jsx("ul",{"data-slot":"pagination-content",className:ee("flex flex-row items-center gap-1",e),...t})}function Yo({...e}){return f.jsx("li",{"data-slot":"pagination-item",...e})}function Jl({className:e,isActive:t,size:n="icon",...r}){return f.jsx("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:ee(Wb({variant:t?"outline":"ghost",size:n}),e),...r})}function MF({className:e,...t}){return f.jsxs(Jl,{"aria-label":"Go to previous page",size:"default",className:ee("gap-1 px-2.5 sm:pl-2.5",e),...t,children:[f.jsx(nz,{}),f.jsx("span",{className:"hidden sm:block",children:"Previous"})]})}function PF({className:e,...t}){return f.jsxs(Jl,{"aria-label":"Go to next page",size:"default",className:ee("gap-1 px-2.5 sm:pr-2.5",e),...t,children:[f.jsx("span",{className:"hidden sm:block",children:"Next"}),f.jsx(oz,{})]})}function DF({className:e,...t}){return f.jsxs("span",{"aria-hidden":!0,"data-slot":"pagination-ellipsis",className:ee("flex size-9 items-center justify-center",e),...t,children:[f.jsx(uz,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"More pages"})]})}function LF({...e}){return f.jsx(ID,{"data-slot":"popover",...e})}function $F({...e}){return f.jsx(RD,{"data-slot":"popover-trigger",...e})}function zF({className:e,align:t="center",sideOffset:n=4,...r}){return f.jsx(OD,{children:f.jsx(MD,{"data-slot":"popover-content",align:t,sideOffset:n,className:ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function jF({className:e,...t}){return f.jsx("div",{"data-slot":"skeleton",className:ee("bg-accent animate-pulse rounded-md",e),...t})}function FF({className:e,defaultValue:t,value:n,min:r=0,max:o=100,...i}){const a=g.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,o],[n,t,r,o]);return f.jsxs(e$,{"data-slot":"slider",defaultValue:t,value:n,min:r,max:o,className:ee("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...i,children:[f.jsx(t$,{"data-slot":"slider-track",className:ee("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:f.jsx(n$,{"data-slot":"slider-range",className:ee("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:a.length},(s,l)=>f.jsx(r$,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},l))]})}function BF({className:e,orientation:t="horizontal",...n}){return f.jsx(p$,{"data-slot":"tabs","data-orientation":t,orientation:t,className:ee("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}var UF=io("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function HF({className:e,variant:t="default",...n}){return f.jsx(m$,{"data-slot":"tabs-list","data-variant":t,className:ee(UF({variant:t}),e),...n})}function VF({className:e,...t}){return f.jsx(h$,{"data-slot":"tabs-trigger",className:ee("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}var Yb=io("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function GF({className:e,variant:t,size:n,...r}){return f.jsx(g$,{"data-slot":"toggle",className:ee(Yb({variant:t,size:n,className:e})),...r})}var Xb=g.createContext({size:"default",variant:"default",spacing:0});function wd({className:e,variant:t,size:n,spacing:r=0,children:o,...i}){return f.jsx(w$,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":r,style:{"--gap":r},className:ee("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",e),...i,children:f.jsx(Xb.Provider,{value:{variant:t,size:n,spacing:r},children:o})})}function _d({className:e,children:t,variant:n,size:r,...o}){const i=g.useContext(Xb);return f.jsx(_$,{"data-slot":"toggle-group-item","data-variant":i.variant||n,"data-size":i.size||r,"data-spacing":i.spacing,className:ee(Yb({variant:i.variant||n,size:i.size||r}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",e),...o,children:t})}function ZF({delayDuration:e=0,...t}){return f.jsx(z$,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function KF({...e}){return f.jsx(j$,{"data-slot":"tooltip",...e})}function WF({...e}){return f.jsx(F$,{"data-slot":"tooltip-trigger",...e})}function qF({className:e,sideOffset:t=0,children:n,...r}){return f.jsx(B$,{children:f.jsxs(U$,{"data-slot":"tooltip-content",sideOffset:t,className:ee("bg-foreground text-background 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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[n,f.jsx(H$,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function YF(e,t){if(t<=7)return Array.from({length:t},(i,a)=>a+1);const n=[];n.push(1),e>3&&n.push("ellipsis");const r=Math.max(2,e-1),o=Math.min(t-1,e+1);for(let i=r;i<=o;i++)n.push(i);return e<t-2&&n.push("ellipsis"),n.push(t),n}var XF={Card:({props:e,children:t})=>{const n=e.maxWidth==="sm"?"max-w-xs sm:min-w-[280px]":e.maxWidth==="md"?"max-w-sm sm:min-w-[320px]":e.maxWidth==="lg"?"max-w-md sm:min-w-[360px]":"w-full",r=e.centered?"mx-auto":"";return f.jsxs(wj,{className:ee(n,r),children:[(e.title||e.description)&&f.jsxs(_j,{children:[e.title&&f.jsx(Ej,{children:e.title}),e.description&&f.jsx(Sj,{children:e.description})]}),f.jsx(kj,{className:"flex flex-col gap-3",children:t})]})},Stack:({props:e,children:t})=>{const n=e.direction==="horizontal",r={none:"gap-0",sm:"gap-2",md:"gap-3",lg:"gap-4"},o={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"},i={start:"",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"},a=r[e.gap??"md"]??"gap-3",s=o[e.align??"start"]??"items-start",l=i[e.justify??""]??"";return f.jsx("div",{className:`flex ${n?"flex-row flex-wrap":"flex-col"} ${a} ${s} ${l}`,children:t})},Grid:({props:e,children:t})=>{const n={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6"},r={sm:"gap-2",md:"gap-3",lg:"gap-4"},o=Math.max(1,Math.min(6,e.columns??1)),i=n[o]??"grid-cols-1",a=r[e.gap??"md"]??"gap-3";return f.jsx("div",{className:`grid ${i} ${a}`,children:t})},Separator:({props:e})=>f.jsx(Rj,{orientation:e.orientation??"horizontal",className:e.orientation==="vertical"?"h-full mx-2":"my-3"}),Tabs:({props:e,children:t,bindings:n,emit:r})=>{const o=e.tabs??[],[i,a]=jt(e.value,n?.value),[s,l]=g.useState(e.defaultValue??o[0]?.value??""),c=!!n?.value,u=c?i??o[0]?.value??"":s,d=c?a:l;return f.jsxs(BF,{value:u,onValueChange:p=>{d(p),r("change")},children:[f.jsx(HF,{children:o.map(p=>f.jsx(VF,{value:p.value,children:p.label},p.value))}),t]})},Accordion:({props:e})=>{const t=e.items??[],n=e.type==="multiple",r=t.map((o,i)=>f.jsxs(Hj,{value:`item-${i}`,children:[f.jsx(Vj,{children:o.title}),f.jsx(Gj,{children:o.content})]},i));return n?f.jsx(yd,{type:"multiple",className:"w-full",children:r}):f.jsx(yd,{type:"single",collapsible:!0,className:"w-full",children:r})},Collapsible:({props:e,children:t})=>{const[n,r]=g.useState(e.defaultOpen??!1);return f.jsxs(dF,{open:n,onOpenChange:r,className:"w-full",children:[f.jsx(fF,{asChild:!0,children:f.jsxs("button",{className:"flex w-full items-center justify-between rounded-md border border-border px-4 py-2 text-sm font-medium hover:bg-muted transition-colors",children:[e.title,f.jsx("svg",{className:`h-4 w-4 transition-transform ${n?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]})}),f.jsx(pF,{className:"pt-2",children:t})]})},Dialog:({props:e,children:t})=>{const[n,r]=Vu(e.openPath??"");return f.jsx(Lj,{open:n??!1,onOpenChange:o=>r(o),children:f.jsxs(jj,{children:[f.jsxs(Fj,{children:[f.jsx(Bj,{children:e.title}),e.description&&f.jsx(Uj,{children:e.description})]}),t]})})},Drawer:({props:e,children:t})=>{const[n,r]=Vu(e.openPath??"");return f.jsx(xF,{open:n??!1,onOpenChange:o=>r(o),children:f.jsxs(EF,{children:[f.jsxs(SF,{children:[f.jsx(kF,{children:e.title}),e.description&&f.jsx(NF,{children:e.description})]}),f.jsx("div",{className:"p-4",children:t})]})})},Carousel:({props:e})=>{const t=e.items??[];return f.jsxs(aF,{className:"w-full",children:[f.jsx(sF,{children:t.map((n,r)=>f.jsx(lF,{className:"basis-3/4 md:basis-1/2 lg:basis-1/3",children:f.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card h-full",children:[n.title&&f.jsx("h4",{className:"font-semibold text-sm mb-1",children:n.title}),n.description&&f.jsx("p",{className:"text-sm text-muted-foreground",children:n.description})]})},r))}),f.jsx(cF,{}),f.jsx(uF,{})]})},Table:({props:e})=>{const t=e.columns??[],n=(e.rows??[]).map(r=>r.map(String));return f.jsx("div",{className:"rounded-md border border-border overflow-hidden",children:f.jsxs(mF,{children:[e.caption&&f.jsx(yF,{children:e.caption}),f.jsx(hF,{children:f.jsx(xd,{children:t.map(r=>f.jsx(bF,{children:r},r))})}),f.jsx(gF,{children:n.map((r,o)=>f.jsx(xd,{children:r.map((i,a)=>f.jsx(vF,{children:i},a))},o))})]})})},Heading:({props:e})=>{const t=e.level??"h2",n=t==="h1"?"text-2xl font-bold":t==="h3"?"text-base font-semibold":t==="h4"?"text-sm font-semibold":"text-lg font-semibold";return t==="h1"?f.jsx("h1",{className:`${n} text-left`,children:e.text}):t==="h3"?f.jsx("h3",{className:`${n} text-left`,children:e.text}):t==="h4"?f.jsx("h4",{className:`${n} text-left`,children:e.text}):f.jsx("h2",{className:`${n} text-left`,children:e.text})},Text:({props:e})=>{const t=e.variant==="caption"?"text-xs":e.variant==="muted"?"text-sm text-muted-foreground":e.variant==="lead"?"text-xl text-muted-foreground":e.variant==="code"?"font-mono text-sm bg-muted px-1.5 py-0.5 rounded":"text-sm";return e.variant==="code"?f.jsx("code",{className:`${t} text-left`,children:e.text}):f.jsx("p",{className:`${t} text-left`,children:e.text})},Image:({props:e})=>e.src?f.jsx("img",{src:e.src,alt:e.alt??"",width:e.width??void 0,height:e.height??void 0,className:"rounded max-w-full"}):f.jsx("div",{className:"bg-muted border border-border rounded flex items-center justify-center text-xs text-muted-foreground",style:{width:e.width??80,height:e.height??60},children:e.alt||"img"}),Avatar:({props:e})=>{const t=e.name||"?",n=t.split(" ").map(o=>o[0]).join("").slice(0,2).toUpperCase(),r=e.size==="lg"?"h-12 w-12":e.size==="sm"?"h-8 w-8":"h-10 w-10";return f.jsxs(Zj,{className:r,children:[e.src&&f.jsx(Kj,{src:e.src,alt:t}),f.jsx(Wj,{children:n})]})},Badge:({props:e})=>f.jsx(Yj,{variant:e.variant??"default",children:e.text}),Alert:({props:e})=>{const t=e.type==="error"?"destructive":"default",n=e.type==="success"?"border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-950 dark:text-green-100":e.type==="warning"?"border-yellow-200 bg-yellow-50 text-yellow-900 dark:border-yellow-800 dark:bg-yellow-950 dark:text-yellow-100":e.type==="info"?"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100":"";return f.jsxs(Mj,{variant:t,className:n,children:[f.jsx(Pj,{children:e.title}),e.message&&f.jsx(Dj,{children:e.message})]})},Progress:({props:e})=>{const t=Math.min(100,Math.max(0,e.value||0));return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(vn,{className:"text-sm text-muted-foreground",children:e.label}),f.jsx(Ij,{value:t})]})},Skeleton:({props:e})=>f.jsx(jF,{className:e.rounded?"rounded-full":"rounded-md",style:{width:e.width??"100%",height:e.height??"1.25rem"}}),Spinner:({props:e})=>{const t=e.size==="lg"?"h-8 w-8":e.size==="sm"?"h-4 w-4":"h-6 w-6";return f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("svg",{className:`${t} animate-spin text-muted-foreground`,viewBox:"0 0 24 24",fill:"none",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),e.label&&f.jsx("span",{className:"text-sm text-muted-foreground",children:e.label})]})},Tooltip:({props:e})=>f.jsx(ZF,{children:f.jsxs(KF,{children:[f.jsx(WF,{asChild:!0,children:f.jsx("span",{className:"text-sm underline decoration-dotted cursor-help",children:e.text})}),f.jsx(qF,{children:f.jsx("p",{children:e.content})})]})}),Popover:({props:e})=>f.jsxs(LF,{children:[f.jsx($F,{asChild:!0,children:f.jsx(qr,{variant:"outline",className:"text-sm",children:e.trigger})}),f.jsx(zF,{className:"w-64",children:f.jsx("p",{className:"text-sm",children:e.content})})]}),Input:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.value,t?.value),[i,a]=g.useState(""),s=!!t?.value,l=s?r??"":i,c=s?o:a,u=e.validateOn??"blur",d=!!(t?.value&&e.checks?.length),{errors:p,validate:m}=or(t?.value??"",d?{checks:e.checks??[],validateOn:u}:void 0);return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(vn,{htmlFor:e.name??void 0,children:e.label}),f.jsx(Nj,{id:e.name??void 0,name:e.name??void 0,type:e.type??"text",placeholder:e.placeholder??"",value:l,onChange:b=>{c(b.target.value),d&&u==="change"&&m()},onKeyDown:b=>{b.key==="Enter"&&n("submit")},onFocus:()=>n("focus"),onBlur:()=>{d&&u==="blur"&&m(),n("blur")}}),p.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:p[0]})]})},Textarea:({props:e,bindings:t})=>{const[n,r]=jt(e.value,t?.value),[o,i]=g.useState(""),a=!!t?.value,s=a?n??"":o,l=a?r:i,c=e.validateOn??"blur",u=!!(t?.value&&e.checks?.length),{errors:d,validate:p}=or(t?.value??"",u?{checks:e.checks??[],validateOn:c}:void 0);return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(vn,{htmlFor:e.name??void 0,children:e.label}),f.jsx(Cj,{id:e.name??void 0,name:e.name??void 0,placeholder:e.placeholder??"",rows:e.rows??3,value:s,onChange:m=>{l(m.target.value),u&&c==="change"&&p()},onBlur:()=>{u&&c==="blur"&&p()}}),d.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:d[0]})]})},Select:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.value,t?.value),[i,a]=g.useState(""),s=!!t?.value,l=s?r??"":i,c=s?o:a,d=(e.options??[]).map(y=>typeof y=="string"?y:String(y??"")),p=e.validateOn??"change",m=!!(t?.value&&e.checks?.length),{errors:b,validate:h}=or(t?.value??"",m?{checks:e.checks??[],validateOn:p}:void 0);return f.jsxs("div",{className:"space-y-2",children:[f.jsx(vn,{children:e.label}),f.jsxs(Qj,{value:l,onValueChange:y=>{c(y),m&&p==="change"&&h(),n("change")},children:[f.jsx(tF,{className:"w-full",children:f.jsx(eF,{placeholder:e.placeholder??"Select..."})}),f.jsx(nF,{children:d.map((y,v)=>f.jsx(rF,{value:y||`option-${v}`,children:y},`${v}-${y}`))})]}),b.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:b[0]})]})},Checkbox:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.checked,t?.checked),[i,a]=g.useState(!!e.checked),s=!!t?.checked,l=s?r??!1:i,c=s?o:a,u=e.validateOn??"change",d=!!(t?.checked&&e.checks?.length),{errors:p,validate:m}=or(t?.checked??"",d?{checks:e.checks??[],validateOn:u}:void 0);return f.jsxs("div",{className:"space-y-1",children:[f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(Tj,{id:e.name??void 0,checked:l,onCheckedChange:b=>{c(b===!0),d&&u==="change"&&m(),n("change")}}),f.jsx(vn,{htmlFor:e.name??void 0,className:"cursor-pointer",children:e.label})]}),p.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:p[0]})]})},Radio:({props:e,bindings:t,emit:n})=>{const o=(e.options??[]).map(y=>typeof y=="string"?y:String(y??"")),[i,a]=jt(e.value,t?.value),[s,l]=g.useState(o[0]??""),c=!!t?.value,u=c?i??"":s,d=c?a:l,p=e.validateOn??"change",m=!!(t?.value&&e.checks?.length),{errors:b,validate:h}=or(t?.value??"",m?{checks:e.checks??[],validateOn:p}:void 0);return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(vn,{children:e.label}),f.jsx(Xj,{value:u,onValueChange:y=>{d(y),m&&p==="change"&&h(),n("change")},children:o.map((y,v)=>f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(Jj,{value:y||`option-${v}`,id:`${e.name}-${v}-${y}`}),f.jsx(vn,{htmlFor:`${e.name}-${v}-${y}`,className:"cursor-pointer",children:y})]},`${v}-${y}`))}),b.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:b[0]})]})},Switch:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.checked,t?.checked),[i,a]=g.useState(!!e.checked),s=!!t?.checked,l=s?r??!1:i,c=s?o:a,u=e.validateOn??"change",d=!!(t?.checked&&e.checks?.length),{errors:p,validate:m}=or(t?.checked??"",d?{checks:e.checks??[],validateOn:u}:void 0);return f.jsxs("div",{className:"space-y-1",children:[f.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[f.jsx(vn,{htmlFor:e.name??void 0,className:"cursor-pointer",children:e.label}),f.jsx(Aj,{id:e.name??void 0,checked:l,onCheckedChange:b=>{c(b),d&&u==="change"&&m(),n("change")}})]}),p.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:p[0]})]})},Slider:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.value,t?.value),[i,a]=g.useState(e.min??0),s=!!t?.value,l=s?r??e.min??0:i,c=s?o:a;return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsxs("div",{className:"flex justify-between",children:[f.jsx(vn,{className:"text-sm",children:e.label}),f.jsx("span",{className:"text-sm text-muted-foreground",children:l})]}),f.jsx(FF,{value:[l],min:e.min??0,max:e.max??100,step:e.step??1,onValueChange:u=>{c(u[0]??0),n("change")}})]})},Button:({props:e,emit:t})=>{const n=e.variant==="danger"?"destructive":e.variant==="secondary"?"secondary":"default";return f.jsx(qr,{variant:n,disabled:e.disabled??!1,onClick:()=>t("press"),children:e.label})},Link:({props:e,on:t})=>f.jsx("a",{href:e.href??"#",className:"text-primary underline-offset-4 hover:underline text-sm font-medium",onClick:n=>{const r=t("press");r.shouldPreventDefault&&n.preventDefault(),r.emit()},children:e.label}),DropdownMenu:({props:e,bindings:t,emit:n})=>{const r=e.items??[],[,o]=jt(e.value,t?.value);return f.jsxs(CF,{children:[f.jsx(TF,{asChild:!0,children:f.jsx(qr,{variant:"outline",children:e.label})}),f.jsx(AF,{children:r.map(i=>f.jsx(IF,{onClick:()=>{o(i.value),n("select")},children:i.label},i.value))})]})},Toggle:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.pressed,t?.pressed),[i,a]=g.useState(e.pressed??!1),s=!!t?.pressed,l=s?r??!1:i,c=s?o:a;return f.jsx(GF,{variant:e.variant??"default",pressed:l,onPressedChange:u=>{c(u),n("change")},children:e.label})},ToggleGroup:({props:e,bindings:t,emit:n})=>{const r=e.type??"single",o=e.items??[],[i,a]=jt(e.value,t?.value),[s,l]=g.useState(o[0]?.value??""),c=!!t?.value,u=c?i??"":s,d=c?a:l;if(r==="multiple"){const p=u?u.split(",").filter(Boolean):[];return f.jsx(wd,{type:"multiple",value:p,onValueChange:m=>{d(m.join(",")),n("change")},children:o.map(m=>f.jsx(_d,{value:m.value,children:m.label},m.value))})}return f.jsx(wd,{type:"single",value:u,onValueChange:p=>{p&&(d(p),n("change"))},children:o.map(p=>f.jsx(_d,{value:p.value,children:p.label},p.value))})},ButtonGroup:({props:e,bindings:t,emit:n})=>{const r=e.buttons??[],[o,i]=jt(e.selected,t?.selected),[a,s]=g.useState(r[0]?.value??""),l=!!t?.selected,c=l?o??"":a,u=l?i:s;return f.jsx("div",{className:"inline-flex rounded-md border border-border",children:r.map((d,p)=>f.jsx("button",{className:`px-3 py-1.5 text-sm transition-colors ${c===d.value?"bg-primary text-primary-foreground":"bg-background hover:bg-muted"} ${p>0?"border-l border-border":""} ${p===0?"rounded-l-md":""} ${p===r.length-1?"rounded-r-md":""}`,onClick:()=>{u(d.value),n("change")},children:d.label},d.value))})},Pagination:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.page,t?.page),i=r??1,a=e.totalPages??1,s=YF(i,a);return f.jsx(RF,{children:f.jsxs(OF,{children:[f.jsx(Yo,{children:f.jsx(MF,{href:"#",onClick:l=>{l.preventDefault(),i>1&&(o(i-1),n("change"))}})}),s.map((l,c)=>l==="ellipsis"?f.jsx(Yo,{children:f.jsx(DF,{})},`ellipsis-${c}`):f.jsx(Yo,{children:f.jsx(Jl,{href:"#",isActive:l===i,onClick:u=>{u.preventDefault(),o(l),n("change")},children:l})},l)),f.jsx(Yo,{children:f.jsx(PF,{href:"#",onClick:l=>{l.preventDefault(),i<a&&(o(i+1),n("change"))}})})]})})}};const JF=cO(uO,{components:CO,actions:{}}),{registry:QF}=NO(JF,{components:XF});function e2({spec:e}){return f.jsx(kO,{spec:e,registry:QF})}function t2(e){return typeof e=="string"?e:JSON.stringify(e,null,2)}function n2({hint:e,data:t}){const n=t2(t);if(e.type==="markdown")return f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:f.jsx(lf,{remarkPlugins:[Qf],children:n})});if(e.type==="json")return f.jsx("pre",{className:"text-xs whitespace-pre-wrap",children:n});if(e.type==="list")try{const r=Array.isArray(t)?t:JSON.parse(n);if(!Array.isArray(r))throw new Error("not an array");return e.ordered?f.jsx("ol",{className:"list-decimal pl-5 text-sm space-y-1",children:r.map((o,i)=>f.jsx("li",{children:String(o)},i))}):f.jsx("ul",{className:"list-disc pl-5 text-sm space-y-1",children:r.map((o,i)=>f.jsx("li",{children:String(o)},i))})}catch{return f.jsx("pre",{className:"text-xs whitespace-pre-wrap",children:n})}return f.jsx("pre",{className:"text-xs whitespace-pre-wrap",children:n})}function r2({execution:e}){const[t,n]=g.useState(e.status!=="completed"),r=DN(e),o=r.icon,i=LN(e),a=e.result?.details??e.partialResult?.details??{},s=a.renderHint,l=a.uiSpec,c=!!(s||l);return f.jsxs("div",{className:Kt("group text-xs",e.status==="error"&&"text-destructive"),children:[f.jsxs("button",{type:"button",onClick:()=>n(u=>!u),className:Kt("flex w-full items-center gap-1.5 rounded px-2 py-1 text-left transition-colors","hover:bg-muted/50",e.status==="error"&&"hover:bg-destructive/10"),children:[f.jsx($v,{className:Kt("h-3 w-3 shrink-0 transition-transform text-muted-foreground",t&&"rotate-90")}),f.jsx(o,{className:Kt("h-3.5 w-3.5 shrink-0",e.toolName==="bash"&&"text-emerald-500",e.toolName==="read"&&"text-blue-500",e.toolName==="write"&&"text-emerald-500",e.toolName==="edit"&&"text-amber-500",e.toolName==="grep"&&"text-violet-500",e.toolName==="find"&&"text-cyan-500",e.toolName==="ls"&&"text-indigo-500",!["bash","read","write","edit","grep","find","ls"].includes(e.toolName)&&"text-muted-foreground")}),f.jsx("span",{className:"font-mono",children:e.toolName}),r.command&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-muted-foreground",children:"›"}),f.jsx("span",{className:"truncate font-mono text-muted-foreground",children:r.command})]}),e.status==="running"&&f.jsx(Ds,{className:"ml-auto h-3 w-3 shrink-0 animate-spin text-muted-foreground"}),e.status==="error"&&f.jsx("span",{className:"ml-auto shrink-0 text-destructive",children:"failed"})]}),t&&f.jsx("div",{className:"mt-1 ml-5 rounded-md border border-border bg-muted/30 p-2 animate-in fade-in slide-in-from-top-2 duration-200",children:c?f.jsxs(f.Fragment,{children:[s&&f.jsx(n2,{hint:s,data:a.data??a.content??a}),l&&f.jsx(e2,{spec:l})]}):f.jsx("pre",{className:"max-h-64 overflow-auto whitespace-pre-wrap text-xs",children:i||"(no output)"})})]})}function o2({messageId:e}){const t=Hn(jv,n=>zv(e,n));return t.length===0?null:f.jsx("div",{className:"space-y-2 mb-2",children:t.map(n=>f.jsx(r2,{execution:n},n.toolCallId))})}function i2(e){const t=e.trim().replace(/\s+/g," ");return t?t.length<=50?t:`${t.slice(0,50)}…`:"Assistant response"}function a2({message:e}){const[t,n]=g.useState(!1),r=e.thinkingContent??e.persistedThinkingContent??"",o=r.length>0;return f.jsxs(f.Fragment,{children:[o&&f.jsxs("div",{className:"mb-3",children:[f.jsxs("button",{className:"flex w-full items-center justify-between rounded-md border border-border bg-background/60 px-3 py-2 text-left text-sm",onClick:()=>n(i=>!i),type:"button",children:[f.jsx("span",{className:"font-medium text-foreground",children:i2(e.content)}),f.jsx(Ls,{className:Kt("h-4 w-4 text-muted-foreground transition-transform",t&&"rotate-180")})]}),t&&f.jsx("div",{className:"mt-2 space-y-3 rounded-md border border-border bg-background/40 p-3",children:f.jsxs("div",{className:"space-y-1.5 text-xs",children:[f.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[f.jsx(qv,{className:"h-3.5 w-3.5"}),f.jsx("span",{className:"font-medium",children:e.isThinking?"Thinking...":"Thinking"}),e.isThinking&&f.jsx(Ds,{className:"h-3 w-3 animate-spin"})]}),f.jsx("p",{className:"whitespace-pre-wrap italic text-muted-foreground",children:r})]})})]}),f.jsx(o2,{messageId:e.id}),e.content.trim().length>0?f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:f.jsx(lf,{remarkPlugins:[Qf],rehypePlugins:[kk],children:e.content})}):e.isStreaming?f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none text-muted-foreground",children:"..."}):null]})}function s2({attachments:e}){return!e||e.length===0?null:f.jsx("div",{className:"mb-2 flex flex-wrap gap-2",children:e.map((t,n)=>{const r=`${t.type}-${t.name??"unnamed"}-${n}`;return t.type==="image"&&t.previewUrl?f.jsx("a",{href:t.previewUrl,target:"_blank",rel:"noreferrer",className:"block",children:f.jsx("img",{src:t.previewUrl,alt:t.name??"Attached image",className:"h-20 w-20 rounded-md border border-primary-foreground/25 object-cover transition-opacity hover:opacity-90"})},r):f.jsxs("div",{className:Kt("inline-flex max-w-full items-center gap-2 rounded-md border px-2 py-1","border-primary-foreground/25 bg-primary-foreground/10 text-primary-foreground"),children:[f.jsx(kd,{className:"h-3.5 w-3.5 shrink-0"}),f.jsx("span",{className:"truncate text-xs font-medium",children:t.name??"Attached file"})]},r)})})}function l2({message:e}){const t=e.role==="user";return f.jsx("div",{className:Kt("flex w-full animate-message-enter",t?"justify-end":"justify-start"),children:f.jsxs("div",{className:Kt(t?"max-w-[75%] rounded-2xl bg-primary px-4 py-2.5 text-primary-foreground":"w-full text-foreground"),children:[t?f.jsxs(f.Fragment,{children:[f.jsx(s2,{attachments:e.attachments}),e.content?f.jsx("p",{className:"whitespace-pre-wrap",children:e.content}):null]}):f.jsx(a2,{message:e}),e.isStreaming&&!t&&f.jsxs("span",{className:"ml-2 inline-flex gap-1",children:[f.jsx("span",{className:"typing-dot inline-block h-1.5 w-1.5 rounded-full bg-current"}),f.jsx("span",{className:"typing-dot inline-block h-1.5 w-1.5 rounded-full bg-current"}),f.jsx("span",{className:"typing-dot inline-block h-1.5 w-1.5 rounded-full bg-current"})]})]})})}function Ed(e){return e.thinkingContent??e.persistedThinkingContent??""}function c2(e,t=50){const n=e.trim().replace(/\s+/g," ");return n.length<=t?n:`${n.slice(0,t)}…`}function u2({messages:e}){const[t,n]=g.useState(!1),r=e.some(l=>l.isThinking||l.isStreaming),o=e[e.length-1],i=Ed(o),a=c2(i),s=e.length;return f.jsxs("div",{className:"relative w-full",children:[f.jsxs("button",{type:"button",onClick:()=>n(l=>!l),className:Kt("flex w-full min-w-0 items-center gap-2 rounded-lg border border-dashed px-3 py-2 text-left transition-colors","border-border/60 bg-muted/30 hover:bg-muted/50",t&&"bg-muted/50"),children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[f.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground",children:[f.jsx("span",{children:"💭 Thinking"}),r&&f.jsx(Ds,{className:"h-3 w-3 animate-spin"})]}),!t&&i&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),f.jsx("span",{className:"min-w-0 truncate text-xs italic text-muted-foreground",children:a})]})]}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[f.jsxs("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:[s," ",s===1?"step":"steps"]}),f.jsx(Ls,{className:Kt("h-3.5 w-3.5 text-muted-foreground transition-transform",t&&"rotate-180")})]})]}),t&&f.jsx("div",{className:"mt-2 rounded-lg border border-border/60 bg-card/95 p-3 shadow-sm backdrop-blur-sm animate-in fade-in slide-in-from-top-2 duration-200",children:f.jsx("ol",{className:"space-y-2 text-xs",children:e.map((l,c)=>{const u=Ed(l);return f.jsxs("li",{className:"flex gap-2 text-muted-foreground",children:[f.jsxs("span",{className:"shrink-0 font-medium text-primary",children:[c+1,"."]}),f.jsx("span",{className:"whitespace-pre-wrap italic",children:u||"(empty)"})]},l.id)})})})]})}function d2(e){if(e.role!=="assistant")return!1;const t=e.content.trim().length>0,n=(e.thinkingContent??e.persistedThinkingContent??"").trim().length>0;return!t&&n}function f2(e){const t=[];let n=[];for(const r of e)d2(r)?n.push(r):(n.length>0&&(t.push({type:"thinking-steps",messages:n}),n=[]),t.push({type:"message",message:r}));return n.length>0&&t.push({type:"thinking-steps",messages:n}),t}function p2(){const{messages:e}=Hn(Fv,r=>({messages:r.messages})),t=g.useRef(null);if(g.useEffect(()=>{t.current?.scrollIntoView({behavior:"smooth"})},[e]),e.length===0)return f.jsx("div",{className:"flex h-full items-center justify-center p-8 chat-background",children:f.jsxs("div",{className:"text-center space-y-4 max-w-md",children:[f.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-primary/10 border border-primary/20 mb-2",children:f.jsx("span",{className:"text-3xl font-mono font-bold text-primary",children:"c/"})}),f.jsx("p",{className:"text-xl font-semibold",children:"Start a conversation"}),f.jsxs("p",{className:"text-sm text-muted-foreground leading-relaxed",children:["Send a message to begin chatting with"," ",f.jsx("span",{className:"font-mono text-primary",children:"clankie"}),", your personal AI assistant that lives in your workspace."]}),f.jsxs("div",{className:"pt-2 flex flex-wrap gap-2 justify-center text-xs text-muted-foreground",children:[f.jsx("span",{className:"px-3 py-1 rounded-full bg-muted/50",children:"💬 Natural language"}),f.jsx("span",{className:"px-3 py-1 rounded-full bg-muted/50",children:"🔧 Tools & commands"}),f.jsx("span",{className:"px-3 py-1 rounded-full bg-muted/50",children:"📎 File uploads"})]})]})});const n=f2(e);return f.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-6 chat-background",children:f.jsxs("div",{className:"mx-auto w-full max-w-3xl space-y-4",children:[n.map(r=>r.type==="message"?f.jsx(l2,{message:r.message},r.message.id):f.jsx(u2,{messages:r.messages},r.messages[0].id)),f.jsx("div",{ref:t})]})})}function v2(){const{sessionId:e}=Bv.useParams(),t=Uv(),{status:n}=Hn(Hv,i=>({status:i.status})),{sessionId:r}=Hn(Os,i=>({sessionId:i.sessionId}));Hn(Vv,i=>i);const o=n==="connected";return g.useEffect(()=>{if(o){if(r===e){console.log(`[session-page] Already on session ${e}, no switch needed`);return}console.log(`[session-page] URL sessionId changed to ${e}, switching...`),ni.switchSession(e).catch(i=>{console.error(`[session-page] Failed to load session ${e}:`,i),t({to:"/"})})}},[e,o,r,t]),o?r!==e?f.jsx("div",{className:"flex h-full items-center justify-center chat-background",children:f.jsxs("div",{className:"text-center space-y-3",children:[f.jsxs("div",{className:"inline-flex gap-1 mb-2",children:[f.jsx("span",{className:"typing-dot inline-block h-3 w-3 rounded-full bg-primary"}),f.jsx("span",{className:"typing-dot inline-block h-3 w-3 rounded-full bg-primary"}),f.jsx("span",{className:"typing-dot inline-block h-3 w-3 rounded-full bg-primary"})]}),f.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading session"," ",f.jsx("span",{className:"font-mono text-primary",children:e.slice(0,8)})]})]})}):f.jsxs("div",{className:"flex h-full flex-col",children:[f.jsx(p2,{}),f.jsx(Ey,{})]}):f.jsx("div",{className:"flex h-full items-center justify-center chat-background",children:f.jsxs("div",{className:"text-center space-y-4 max-w-md p-8",children:[f.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-destructive/10 border border-destructive/20 mb-2",children:f.jsx(pc,{className:"h-8 w-8 text-destructive"})}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("h2",{className:"text-2xl font-semibold",children:"Not Connected"}),f.jsx("p",{className:"text-muted-foreground",children:"Configure your connection to get started"})]}),f.jsx(Gv,{to:"/settings",children:f.jsxs(ti,{className:"transition-transform hover:scale-105 active:scale-95",children:[f.jsx(pc,{className:"mr-2 h-4 w-4"}),"Go to Settings"]})})]})})}export{v2 as component};
131
+ ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function Wz(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function qz(){return Xl(/^Mac/)}function Yz(){return Xl(/^iPhone/)}function hd(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Xz(){return Xl(/^iPad/)||qz()&&navigator.maxTouchPoints>1}function zb(){return Yz()||Xz()}function Xl(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const Jz=24,Qz=typeof window<"u"?g.useLayoutEffect:g.useEffect;function gd(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Za=typeof document<"u"&&window.visualViewport;function bd(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function jb(e){for(bd(e)&&(e=e.parentElement);e&&!bd(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const ej=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Wo=0,Ka;function tj(e={}){let{isDisabled:t}=e;Qz(()=>{if(!t)return Wo++,Wo===1&&zb()&&(Ka=nj()),()=>{Wo--,Wo===0&&Ka?.()}},[t])}function nj(){let e,t=0,n=d=>{e=jb(d.target),!(e===document.documentElement&&e===document.body)&&(t=d.changedTouches[0].pageY)},r=d=>{if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}let p=d.changedTouches[0].pageY,m=e.scrollTop,b=e.scrollHeight-e.clientHeight;b!==0&&((m<=0&&p>t||m>=b&&p<t)&&d.preventDefault(),t=p)},o=d=>{let p=d.target;Is(p)&&p!==document.activeElement&&(d.preventDefault(),p.style.transform="translateY(-2000px)",p.focus(),requestAnimationFrame(()=>{p.style.transform=""}))},i=d=>{let p=d.target;Is(p)&&(p.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{p.style.transform="",Za&&(Za.height<window.innerHeight?requestAnimationFrame(()=>{vd(p)}):Za.addEventListener("resize",()=>vd(p),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=gd(rj(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=gd(jr(document,"touchstart",n,{passive:!1,capture:!0}),jr(document,"touchmove",r,{passive:!1,capture:!0}),jr(document,"touchend",o,{passive:!1,capture:!0}),jr(document,"focus",i,!0),jr(window,"scroll",a));return()=>{c(),u(),window.scrollTo(s,l)}}function rj(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function jr(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function vd(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=jb(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const a=n.getBoundingClientRect().bottom+Jz;i>a&&(n.scrollTop+=o-r)}e=n.parentElement}}function Is(e){return e instanceof HTMLInputElement&&!ej.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function oj(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ij(...e){return t=>e.forEach(n=>oj(n,t))}function Fb(...e){return g.useCallback(ij(...e),e)}const Bb=new WeakMap;function ht(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,i])=>{if(o.startsWith("--")){e.style.setProperty(o,i);return}r[o]=e.style[o],e.style[o]=i}),!n&&Bb.set(e,r)}function aj(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Bb.get(e);n&&(e.style[t]=n[t])}const at=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function qo(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[at(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[at(t)?5:4]):null)}function sj(e){return 8*(Math.log(e+1)-2)}function Wa(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function lj(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const Qe={DURATION:.5,EASE:[.32,.72,0,1]},Ub=.4,cj=.25,uj=100,Hb=8,Bn=16,Rs=26,qa="vaul-dragging";function Vb(e){const t=H.useRef(e);return H.useEffect(()=>{t.current=e}),H.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function dj({defaultProp:e,onChange:t}){const n=H.useState(e),[r]=n,o=H.useRef(r),i=Vb(t);return H.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function Gb({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=dj({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=Vb(n),l=H.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&s(d)}else o(c)},[i,e,o,s]);return[a,l]}function fj({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:i,onSnapPointChange:a,direction:s="bottom",container:l,snapToSequentialPoint:c}){const[u,d]=Gb({prop:e,defaultProp:n?.[0],onChange:t}),[p,m]=H.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);H.useEffect(()=>{function A(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)},[]);const b=H.useMemo(()=>u===n?.[n.length-1]||null,[n,u]),h=H.useMemo(()=>{var A;return(A=n?.findIndex(R=>R===u))!=null?A:null},[n,u]),y=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===u||!n,v=H.useMemo(()=>{const A=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var R;return(R=n?.map(M=>{const T=typeof M=="string";let I=0;if(T&&(I=parseInt(M,10)),at(s)){const D=T?I:p?M*A.height:0;return p?s==="bottom"?A.height-D:-A.height+D:D}const O=T?I:p?M*A.width:0;return p?s==="right"?A.width-O:-A.width+O:O}))!=null?R:[]},[n,p,l]),x=H.useMemo(()=>h!==null?v?.[h]:null,[v,h]),w=H.useCallback(A=>{var R;const M=(R=v?.findIndex(T=>T===A))!=null?R:null;a(M),ht(r.current,{transition:`transform ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,transform:at(s)?`translate3d(0, ${A}px, 0)`:`translate3d(${A}px, 0, 0)`}),v&&M!==v.length-1&&i!==void 0&&M!==i&&M<i?ht(o.current,{transition:`opacity ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,opacity:"0"}):ht(o.current,{transition:`opacity ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,opacity:"1"}),d(n?.[Math.max(M,0)])},[r.current,n,v,i,o,d]);H.useEffect(()=>{if(u||e){var A;const R=(A=n?.findIndex(M=>M===e||M===u))!=null?A:-1;v&&R!==-1&&typeof v[R]=="number"&&w(v[R])}},[u,e,n,v,w]);function _({draggedDistance:A,closeDrawer:R,velocity:M,dismissible:T}){if(i===void 0)return;const I=s==="bottom"||s==="right"?(x??0)-A:(x??0)+A,O=h===i-1,D=h===0,L=A>0;if(O&&ht(o.current,{transition:`opacity ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`}),!c&&M>2&&!L){T?R():w(v[0]);return}if(!c&&M>2&&L&&v&&n){w(v[n.length-1]);return}const P=v?.reduce((K,V)=>typeof K!="number"||typeof V!="number"?K:Math.abs(V-I)<Math.abs(K-I)?V:K),F=at(s)?window.innerHeight:window.innerWidth;if(M>Ub&&Math.abs(A)<F*.4){const K=L?1:-1;if(K>0&&b&&n){w(v[n.length-1]);return}if(D&&K<0&&T&&R(),h===null)return;w(v[h+K]);return}w(P)}function C({draggedDistance:A}){if(x===null)return;const R=s==="bottom"||s==="right"?x-A:x+A;(s==="bottom"||s==="right")&&R<v[v.length-1]||(s==="top"||s==="left")&&R>v[v.length-1]||ht(r.current,{transform:at(s)?`translate3d(0, ${R}px, 0)`:`translate3d(${R}px, 0, 0)`})}function E(A,R){if(!n||typeof h!="number"||!v||i===void 0)return null;const M=h===i-1;if(h>=i&&R)return 0;if(M&&!R)return 1;if(!y&&!M)return null;const I=M?h+1:h-1,O=M?v[I]-v[I-1]:v[I+1]-v[I],D=A/Math.abs(O);return M?1-D:D}return{isLastSnapPoint:b,activeSnapPoint:u,shouldFade:y,getPercentageDragged:E,setActiveSnapPoint:d,activeSnapPointIndex:h,onRelease:_,onDrag:C,snapPointsOffset:v}}const pj=()=>()=>{};function mj(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=Eo(),i=H.useRef(null),a=g.useMemo(()=>document.body.style.backgroundColor,[]);function s(){return(window.innerWidth-Rs)/window.innerWidth}H.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const l=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!l)return;lj(r&&!o?Wa(document.body,{background:"black"}):pj,Wa(l,{transformOrigin:at(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Qe.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Qe.EASE.join(",")})`}));const c=Wa(l,{borderRadius:`${Hb}px`,overflow:"hidden",...at(e)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{c(),i.current=window.setTimeout(()=>{a?document.body.style.background=a:document.body.style.removeProperty("background")},Qe.DURATION*1e3)}}},[t,n,a])}let Fr=null;function hj({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:i}){const[a,s]=H.useState(()=>typeof window<"u"?window.location.href:""),l=H.useRef(0),c=H.useCallback(()=>{if(hd()&&Fr===null&&e&&!i){Fr={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:p}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const m=p-window.innerHeight;m&&l.current>=p&&(document.body.style.top=`${-(l.current+m)}px`)}),300)}},[e]),u=H.useCallback(()=>{if(hd()&&Fr!==null&&!i){const d=-parseInt(document.body.style.top,10),p=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Fr),window.requestAnimationFrame(()=>{if(o&&a!==window.location.href){s(window.location.href);return}window.scrollTo(p,d)}),Fr=null}},[a]);return H.useEffect(()=>{function d(){l.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),H.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[t,u]),H.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&c(),t||window.setTimeout(()=>{u()},500)):u())},[e,r,a,t,n,c,u]),{restorePositionSetting:u}}function gj({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:i,shouldScaleBackground:a=!1,setBackgroundColorOnScale:s=!0,closeThreshold:l=cj,scrollLockTimeout:c=uj,dismissible:u=!0,handleOnly:d=!1,fadeFromIndex:p=i&&i.length-1,activeSnapPoint:m,setActiveSnapPoint:b,fixed:h,modal:y=!0,onClose:v,nested:x,noBodyStyles:w=!1,direction:_="bottom",defaultOpen:C=!1,disablePreventScroll:E=!0,snapToSequentialPoint:A=!1,preventScrollRestoration:R=!1,repositionInputs:M=!0,onAnimationEnd:T,container:I,autoFocus:O=!1}){var D,L;const[P=!1,F]=Gb({defaultProp:C,prop:e,onChange:he=>{t?.(he),!he&&!x&&W(),setTimeout(()=>{T?.(he)},Qe.DURATION*1e3),he&&!y&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),he||(document.body.style.pointerEvents="auto")}}),[K,V]=H.useState(!1),[B,S]=H.useState(!1),[le,be]=H.useState(!1),k=H.useRef(null),Ee=H.useRef(null),Le=H.useRef(null),we=H.useRef(null),G=H.useRef(null),se=H.useRef(!1),Ce=H.useRef(null),fe=H.useRef(0),ie=H.useRef(!1),X=H.useRef(!C),xe=H.useRef(0),Q=H.useRef(null),Fe=H.useRef(((D=Q.current)==null?void 0:D.getBoundingClientRect().height)||0),ve=H.useRef(((L=Q.current)==null?void 0:L.getBoundingClientRect().width)||0),Ve=H.useRef(0),ct=H.useCallback(he=>{i&&he===Rt.length-1&&(Ee.current=new Date)},[]),{activeSnapPoint:yt,activeSnapPointIndex:rt,setActiveSnapPoint:Ut,onRelease:gn,snapPointsOffset:Rt,onDrag:Ot,shouldFade:an,getPercentageDragged:z}=fj({snapPoints:i,activeSnapPointProp:m,setActiveSnapPointProp:b,drawerRef:Q,fadeFromIndex:p,overlayRef:k,onSnapPointChange:ct,direction:_,container:I,snapToSequentialPoint:A});tj({isDisabled:!P||B||!y||le||!K||!M||!E});const{restorePositionSetting:W}=hj({isOpen:P,modal:y,nested:x??!1,hasBeenOpened:K,preventScrollRestoration:R,noBodyStyles:w});function me(){return(window.innerWidth-Rs)/window.innerWidth}function Se(he){var Me,$e;!u&&!i||Q.current&&!Q.current.contains(he.target)||(Fe.current=((Me=Q.current)==null?void 0:Me.getBoundingClientRect().height)||0,ve.current=(($e=Q.current)==null?void 0:$e.getBoundingClientRect().width)||0,S(!0),Le.current=new Date,zb()&&window.addEventListener("touchend",()=>se.current=!1,{once:!0}),he.target.setPointerCapture(he.pointerId),fe.current=at(_)?he.pageY:he.pageX)}function Te(he,Me){var $e;let Ie=he;const ze=($e=window.getSelection())==null?void 0:$e.toString(),N=Q.current?qo(Q.current,_):null,$=new Date;if(Ie.tagName==="SELECT"||Ie.hasAttribute("data-vaul-no-drag")||Ie.closest("[data-vaul-no-drag]"))return!1;if(_==="right"||_==="left")return!0;if(Ee.current&&$.getTime()-Ee.current.getTime()<500)return!1;if(N!==null&&(_==="bottom"?N>0:N<0))return!0;if(ze&&ze.length>0)return!1;if(G.current&&$.getTime()-G.current.getTime()<c&&N===0||Me)return G.current=$,!1;for(;Ie;){if(Ie.scrollHeight>Ie.clientHeight){if(Ie.scrollTop!==0)return G.current=new Date,!1;if(Ie.getAttribute("role")==="dialog")return!0}Ie=Ie.parentNode}return!0}function ut(he){if(Q.current&&B){const Me=_==="bottom"||_==="right"?1:-1,$e=(fe.current-(at(_)?he.pageY:he.pageX))*Me,Ie=$e>0,ze=i&&!u&&!Ie;if(ze&&rt===0)return;const N=Math.abs($e),$=document.querySelector("[data-vaul-drawer-wrapper]"),q=_==="bottom"||_==="top"?Fe.current:ve.current;let ce=N/q;const Be=z(N,Ie);if(Be!==null&&(ce=Be),ze&&ce>=1||!se.current&&!Te(he.target,Ie))return;if(Q.current.classList.add(qa),se.current=!0,ht(Q.current,{transition:"none"}),ht(k.current,{transition:"none"}),i&&Ot({draggedDistance:$e}),Ie&&!i){const ne=sj($e),re=Math.min(ne*-1,0)*Me;ht(Q.current,{transform:at(_)?`translate3d(0, ${re}px, 0)`:`translate3d(${re}px, 0, 0)`});return}const je=1-ce;if((an||p&&rt===p-1)&&(r?.(he,ce),ht(k.current,{opacity:`${je}`,transition:"none"},!0)),$&&k.current&&a){const ne=Math.min(me()+ce*(1-me()),1),re=8-ce*8,ye=Math.max(0,14-ce*14);ht($,{borderRadius:`${re}px`,transform:at(_)?`scale(${ne}) translate3d(0, ${ye}px, 0)`:`scale(${ne}) translate3d(${ye}px, 0, 0)`,transition:"none"},!0)}if(!i){const ne=N*Me;ht(Q.current,{transform:at(_)?`translate3d(0, ${ne}px, 0)`:`translate3d(${ne}px, 0, 0)`})}}}H.useEffect(()=>{window.requestAnimationFrame(()=>{X.current=!0})},[]),H.useEffect(()=>{var he;function Me(){if(!Q.current||!M)return;const $e=document.activeElement;if(Is($e)||ie.current){var Ie;const ze=((Ie=window.visualViewport)==null?void 0:Ie.height)||0,N=window.innerHeight;let $=N-ze;const q=Q.current.getBoundingClientRect().height||0,ce=q>N*.8;Ve.current||(Ve.current=q);const Be=Q.current.getBoundingClientRect().top;if(Math.abs(xe.current-$)>60&&(ie.current=!ie.current),i&&i.length>0&&Rt&&rt){const je=Rt[rt]||0;$+=je}if(xe.current=$,q>ze||ie.current){const je=Q.current.getBoundingClientRect().height;let ne=je;je>ze&&(ne=ze-(ce?Be:Rs)),h?Q.current.style.height=`${je-Math.max($,0)}px`:Q.current.style.height=`${Math.max(ne,ze-Be)}px`}else Wz()||(Q.current.style.height=`${Ve.current}px`);i&&i.length>0&&!ie.current?Q.current.style.bottom="0px":Q.current.style.bottom=`${Math.max($,0)}px`}}return(he=window.visualViewport)==null||he.addEventListener("resize",Me),()=>{var $e;return($e=window.visualViewport)==null?void 0:$e.removeEventListener("resize",Me)}},[rt,i,Rt]);function dt(he){Ht(),v?.(),he||F(!1),setTimeout(()=>{i&&Ut(i[0])},Qe.DURATION*1e3)}function ft(){if(!Q.current)return;const he=document.querySelector("[data-vaul-drawer-wrapper]"),Me=qo(Q.current,_);ht(Q.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`}),ht(k.current,{transition:`opacity ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,opacity:"1"}),a&&Me&&Me>0&&P&&ht(he,{borderRadius:`${Hb}px`,overflow:"hidden",...at(_)?{transform:`scale(${me()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${me()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Qe.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Qe.EASE.join(",")})`},!0)}function Ht(){!B||!Q.current||(Q.current.classList.remove(qa),se.current=!1,S(!1),we.current=new Date)}function Yt(he){if(!B||!Q.current)return;Q.current.classList.remove(qa),se.current=!1,S(!1),we.current=new Date;const Me=qo(Q.current,_);if(!he||!Te(he.target,!1)||!Me||Number.isNaN(Me)||Le.current===null)return;const $e=we.current.getTime()-Le.current.getTime(),Ie=fe.current-(at(_)?he.pageY:he.pageX),ze=Math.abs(Ie)/$e;if(ze>.05&&(be(!0),setTimeout(()=>{be(!1)},200)),i){gn({draggedDistance:Ie*(_==="bottom"||_==="right"?1:-1),closeDrawer:dt,velocity:ze,dismissible:u}),o?.(he,!0);return}if(_==="bottom"||_==="right"?Ie>0:Ie<0){ft(),o?.(he,!0);return}if(ze>Ub){dt(),o?.(he,!1);return}var N;const $=Math.min((N=Q.current.getBoundingClientRect().height)!=null?N:0,window.innerHeight);var q;const ce=Math.min((q=Q.current.getBoundingClientRect().width)!=null?q:0,window.innerWidth),Be=_==="left"||_==="right";if(Math.abs(Me)>=(Be?ce:$)*l){dt(),o?.(he,!1);return}o?.(he,!0),ft()}H.useEffect(()=>(P&&(ht(document.documentElement,{scrollBehavior:"auto"}),Ee.current=new Date),()=>{aj(document.documentElement,"scrollBehavior")}),[P]);function pt(he){const Me=he?(window.innerWidth-Bn)/window.innerWidth:1,$e=he?-Bn:0;Ce.current&&window.clearTimeout(Ce.current),ht(Q.current,{transition:`transform ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,transform:at(_)?`scale(${Me}) translate3d(0, ${$e}px, 0)`:`scale(${Me}) translate3d(${$e}px, 0, 0)`}),!he&&Q.current&&(Ce.current=setTimeout(()=>{const Ie=qo(Q.current,_);ht(Q.current,{transition:"none",transform:at(_)?`translate3d(0, ${Ie}px, 0)`:`translate3d(${Ie}px, 0, 0)`})},500))}function Vt(he,Me){if(Me<0)return;const $e=(window.innerWidth-Bn)/window.innerWidth,Ie=$e+Me*(1-$e),ze=-Bn+Me*Bn;ht(Q.current,{transform:at(_)?`scale(${Ie}) translate3d(0, ${ze}px, 0)`:`scale(${Ie}) translate3d(${ze}px, 0, 0)`,transition:"none"})}function xt(he,Me){const $e=at(_)?window.innerHeight:window.innerWidth,Ie=Me?($e-Bn)/$e:1,ze=Me?-Bn:0;Me&&ht(Q.current,{transition:`transform ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,transform:at(_)?`scale(${Ie}) translate3d(0, ${ze}px, 0)`:`scale(${Ie}) translate3d(${ze}px, 0, 0)`})}return H.useEffect(()=>{y||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[y]),H.createElement(Im,{defaultOpen:C,onOpenChange:he=>{!u&&!he||(he?V(!0):dt(!0),F(he))},open:P},H.createElement($b.Provider,{value:{activeSnapPoint:yt,snapPoints:i,setActiveSnapPoint:Ut,drawerRef:Q,overlayRef:k,onOpenChange:t,onPress:Se,onRelease:Yt,onDrag:ut,dismissible:u,shouldAnimate:X,handleOnly:d,isOpen:P,isDragging:B,shouldFade:an,closeDrawer:dt,onNestedDrag:Vt,onNestedOpenChange:pt,onNestedRelease:xt,keyboardIsOpen:ie,modal:y,snapPointsOffset:Rt,activeSnapPointIndex:rt,direction:_,shouldScaleBackground:a,setBackgroundColorOnScale:s,noBodyStyles:w,container:I,autoFocus:O}},n))}const Zb=H.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:i,isOpen:a,modal:s,shouldAnimate:l}=Eo(),c=Fb(t,n),u=r&&r.length>0;if(!s)return null;const d=H.useCallback(p=>o(p),[o]);return H.createElement(Om,{onMouseUp:d,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":a&&u?"true":"false","data-vaul-snap-points-overlay":a&&i?"true":"false","data-vaul-animate":l?.current?"true":"false",...e})});Zb.displayName="Drawer.Overlay";const Kb=H.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:i,onPress:a,onRelease:s,onDrag:l,keyboardIsOpen:c,snapPointsOffset:u,activeSnapPointIndex:d,modal:p,isOpen:m,direction:b,snapPoints:h,container:y,handleOnly:v,shouldAnimate:x,autoFocus:w}=Eo(),[_,C]=H.useState(!1),E=Fb(o,i),A=H.useRef(null),R=H.useRef(null),M=H.useRef(!1),T=h&&h.length>0;mj();const I=(D,L,P=0)=>{if(M.current)return!0;const F=Math.abs(D.y),K=Math.abs(D.x),V=K>F,B=["bottom","right"].includes(L)?1:-1;if(L==="left"||L==="right"){if(!(D.x*B<0)&&K>=0&&K<=P)return V}else if(!(D.y*B<0)&&F>=0&&F<=P)return!V;return M.current=!0,!0};H.useEffect(()=>{T&&window.requestAnimationFrame(()=>{C(!0)})},[]);function O(D){A.current=null,M.current=!1,s(D)}return H.createElement(Mm,{"data-vaul-drawer-direction":b,"data-vaul-drawer":"","data-vaul-delayed-snap-points":_?"true":"false","data-vaul-snap-points":m&&T?"true":"false","data-vaul-custom-container":y?"true":"false","data-vaul-animate":x?.current?"true":"false",...r,ref:E,style:u&&u.length>0?{"--snap-point-height":`${u[d??0]}px`,...t}:t,onPointerDown:D=>{v||(r.onPointerDown==null||r.onPointerDown.call(r,D),A.current={x:D.pageX,y:D.pageY},a(D))},onOpenAutoFocus:D=>{n?.(D),w||D.preventDefault()},onPointerDownOutside:D=>{if(e?.(D),!p||D.defaultPrevented){D.preventDefault();return}c.current&&(c.current=!1)},onFocusOutside:D=>{if(!p){D.preventDefault();return}},onPointerMove:D=>{if(R.current=D,v||(r.onPointerMove==null||r.onPointerMove.call(r,D),!A.current))return;const L=D.pageY-A.current.y,P=D.pageX-A.current.x,F=D.pointerType==="touch"?10:2;I({x:P,y:L},b,F)?l(D):(Math.abs(P)>F||Math.abs(L)>F)&&(A.current=null)},onPointerUp:D=>{r.onPointerUp==null||r.onPointerUp.call(r,D),A.current=null,M.current=!1,s(D)},onPointerOut:D=>{r.onPointerOut==null||r.onPointerOut.call(r,D),O(R.current)},onContextMenu:D=>{r.onContextMenu==null||r.onContextMenu.call(r,D),R.current&&O(R.current)}})});Kb.displayName="Drawer.Content";const bj=250,vj=120,yj=H.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:i,snapPoints:a,activeSnapPoint:s,setActiveSnapPoint:l,dismissible:c,handleOnly:u,isOpen:d,onPress:p,onDrag:m}=Eo(),b=H.useRef(null),h=H.useRef(!1);function y(){if(h.current){w();return}window.setTimeout(()=>{v()},vj)}function v(){if(i||e||h.current){w();return}if(w(),!a||a.length===0){c||o();return}if(s===a[a.length-1]&&c){o();return}const C=a.findIndex(A=>A===s);if(C===-1)return;const E=a[C+1];l(E)}function x(){b.current=window.setTimeout(()=>{h.current=!0},bj)}function w(){b.current&&window.clearTimeout(b.current),h.current=!1}return H.createElement("div",{onClick:y,onPointerCancel:w,onPointerDown:_=>{u&&p(_),x()},onPointerMove:_=>{u&&m(_)},ref:r,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},H.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});yj.displayName="Drawer.Handle";function xj(e){const t=Eo(),{container:n=t.container,...r}=e;return H.createElement(Rm,{container:n,...r})}const Or={Root:gj,Content:Kb,Overlay:Zb,Portal:xj,Title:Pm,Description:Dm};function ee(...e){return Dv(Lv(e))}var Wb=io("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function qr({className:e,variant:t="default",size:n="default",asChild:r=!1,...o}){const i=r?zp:"button";return f.jsx(i,{"data-slot":"button","data-variant":t,"data-size":n,className:ee(Wb({variant:t,size:n,className:e})),...o})}function wj({className:e,...t}){return f.jsx("div",{"data-slot":"card",className:ee("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function _j({className:e,...t}){return f.jsx("div",{"data-slot":"card-header",className:ee("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Ej({className:e,...t}){return f.jsx("div",{"data-slot":"card-title",className:ee("leading-none font-semibold",e),...t})}function Sj({className:e,...t}){return f.jsx("div",{"data-slot":"card-description",className:ee("text-muted-foreground text-sm",e),...t})}function kj({className:e,...t}){return f.jsx("div",{"data-slot":"card-content",className:ee("px-6",e),...t})}function Nj({className:e,type:t,...n}){return f.jsx("input",{type:t,"data-slot":"input",className:ee("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}function vn({className:e,...t}){return f.jsx(yD,{"data-slot":"label",className:ee("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Cj({className:e,...t}){return f.jsx("textarea",{"data-slot":"textarea",className:ee("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}function Tj({className:e,...t}){return f.jsx(Vm,{"data-slot":"checkbox",className:ee("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:f.jsx(Zm,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:f.jsx(Mb,{className:"size-3.5"})})})}function Aj({className:e,size:t="default",...n}){return f.jsx(l$,{"data-slot":"switch","data-size":t,className:ee("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...n,children:f.jsx(c$,{"data-slot":"switch-thumb",className:ee("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function Ij({className:e,value:t,...n}){return f.jsx(FD,{"data-slot":"progress",className:ee("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...n,children:f.jsx(BD,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function Rj({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return f.jsx(zL,{"data-slot":"separator",decorative:n,orientation:t,className:ee("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}var Oj=io("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function Mj({className:e,variant:t,...n}){return f.jsx("div",{"data-slot":"alert",role:"alert",className:ee(Oj({variant:t}),e),...n})}function Pj({className:e,...t}){return f.jsx("div",{"data-slot":"alert-title",className:ee("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function Dj({className:e,...t}){return f.jsx("div",{"data-slot":"alert-description",className:ee("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function Lj({...e}){return f.jsx(Im,{"data-slot":"dialog",...e})}function $j({...e}){return f.jsx(Rm,{"data-slot":"dialog-portal",...e})}function zj({className:e,...t}){return f.jsx(Om,{"data-slot":"dialog-overlay",className:ee("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function jj({className:e,children:t,showCloseButton:n=!0,...r}){return f.jsxs($j,{"data-slot":"dialog-portal",children:[f.jsx(zj,{}),f.jsxs(Mm,{"data-slot":"dialog-content",className:ee("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",e),...r,children:[t,n&&f.jsxs(EM,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[f.jsx(fz,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Fj({className:e,...t}){return f.jsx("div",{"data-slot":"dialog-header",className:ee("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Bj({className:e,...t}){return f.jsx(Pm,{"data-slot":"dialog-title",className:ee("text-lg leading-none font-semibold",e),...t})}function Uj({className:e,...t}){return f.jsx(Dm,{"data-slot":"dialog-description",className:ee("text-muted-foreground text-sm",e),...t})}function yd({...e}){return f.jsx(s1,{"data-slot":"accordion",...e})}function Hj({className:e,...t}){return f.jsx(l1,{"data-slot":"accordion-item",className:ee("border-b last:border-b-0",e),...t})}function Vj({className:e,children:t,...n}){return f.jsx(c1,{className:"flex",children:f.jsxs(u1,{"data-slot":"accordion-trigger",className:ee("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,f.jsx(Gl,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function Gj({className:e,children:t,...n}){return f.jsx(d1,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...n,children:f.jsx("div",{className:ee("pt-0 pb-4",e),children:t})})}function Zj({className:e,...t}){return f.jsx(AM,{"data-slot":"avatar",className:ee("relative flex size-10 shrink-0 overflow-hidden rounded-full",e),...t})}function Kj({className:e,...t}){return f.jsx(IM,{"data-slot":"avatar-image",className:ee("aspect-square size-full",e),...t})}function Wj({className:e,...t}){return f.jsx(RM,{"data-slot":"avatar-fallback",className:ee("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var qj=io("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Yj({className:e,variant:t="default",asChild:n=!1,...r}){const o=n?zp:"span";return f.jsx(o,{"data-slot":"badge","data-variant":t,className:ee(qj({variant:t}),e),...r})}function Xj({className:e,...t}){return f.jsx(XD,{"data-slot":"radio-group",className:ee("grid gap-3",e),...t})}function Jj({className:e,...t}){return f.jsx(JD,{"data-slot":"radio-group-item",className:ee("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:f.jsx(QD,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:f.jsx(lz,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function Qj({...e}){return f.jsx(EL,{"data-slot":"select",...e})}function eF({...e}){return f.jsx(kL,{"data-slot":"select-value",...e})}function tF({className:e,size:t="default",children:n,...r}){return f.jsxs(SL,{"data-slot":"select-trigger","data-size":t,className:ee("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,f.jsx(NL,{asChild:!0,children:f.jsx(Gl,{className:"size-4 opacity-50"})})]})}function nF({className:e,children:t,position:n="item-aligned",align:r="center",...o}){return f.jsx(CL,{children:f.jsxs(TL,{"data-slot":"select-content",className:ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...o,children:[f.jsx(oF,{}),f.jsx(AL,{className:ee("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),f.jsx(iF,{})]})})}function rF({className:e,children:t,...n}){return f.jsxs(IL,{"data-slot":"select-item",className:ee("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[f.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(OL,{children:f.jsx(Mb,{className:"size-4"})})}),f.jsx(RL,{children:t})]})}function oF({className:e,...t}){return f.jsx(ML,{"data-slot":"select-scroll-up-button",className:ee("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(az,{className:"size-4"})})}function iF({className:e,...t}){return f.jsx(PL,{"data-slot":"select-scroll-down-button",className:ee("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(Gl,{className:"size-4"})})}var qb=g.createContext(null);function aa(){const e=g.useContext(qb);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function aF({orientation:e="horizontal",opts:t,setApi:n,plugins:r,className:o,children:i,...a}){const[s,l]=Yl({...t,axis:e==="horizontal"?"x":"y"},r),[c,u]=g.useState(!1),[d,p]=g.useState(!1),m=g.useCallback(v=>{v&&(u(v.canScrollPrev()),p(v.canScrollNext()))},[]),b=g.useCallback(()=>{l?.scrollPrev()},[l]),h=g.useCallback(()=>{l?.scrollNext()},[l]),y=g.useCallback(v=>{v.key==="ArrowLeft"?(v.preventDefault(),b()):v.key==="ArrowRight"&&(v.preventDefault(),h())},[b,h]);return g.useEffect(()=>{!l||!n||n(l)},[l,n]),g.useEffect(()=>{if(l)return m(l),l.on("reInit",m),l.on("select",m),()=>{l?.off("select",m)}},[l,m]),f.jsx(qb.Provider,{value:{carouselRef:s,api:l,opts:t,orientation:e||(t?.axis==="y"?"vertical":"horizontal"),scrollPrev:b,scrollNext:h,canScrollPrev:c,canScrollNext:d},children:f.jsx("div",{onKeyDownCapture:y,className:ee("relative",o),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...a,children:i})})}function sF({className:e,...t}){const{carouselRef:n,orientation:r}=aa();return f.jsx("div",{ref:n,className:"overflow-hidden","data-slot":"carousel-content",children:f.jsx("div",{className:ee("flex",r==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})}function lF({className:e,...t}){const{orientation:n}=aa();return f.jsx("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:ee("min-w-0 shrink-0 grow-0 basis-full",n==="horizontal"?"pl-4":"pt-4",e),...t})}function cF({className:e,variant:t="outline",size:n="icon",...r}){const{orientation:o,scrollPrev:i,canScrollPrev:a}=aa();return f.jsxs(qr,{"data-slot":"carousel-previous",variant:t,size:n,className:ee("absolute size-8 rounded-full",o==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!a,onClick:i,...r,children:[f.jsx(Y$,{}),f.jsx("span",{className:"sr-only",children:"Previous slide"})]})}function uF({className:e,variant:t="outline",size:n="icon",...r}){const{orientation:o,scrollNext:i,canScrollNext:a}=aa();return f.jsxs(qr,{"data-slot":"carousel-next",variant:t,size:n,className:ee("absolute size-8 rounded-full",o==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!a,onClick:i,...r,children:[f.jsx(J$,{}),f.jsx("span",{className:"sr-only",children:"Next slide"})]})}function dF({...e}){return f.jsx(Zp,{"data-slot":"collapsible",...e})}function fF({...e}){return f.jsx(pl,{"data-slot":"collapsible-trigger",...e})}function pF({...e}){return f.jsx(hl,{"data-slot":"collapsible-content",...e})}function mF({className:e,...t}){return f.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:f.jsx("table",{"data-slot":"table",className:ee("w-full caption-bottom text-sm",e),...t})})}function hF({className:e,...t}){return f.jsx("thead",{"data-slot":"table-header",className:ee("[&_tr]:border-b",e),...t})}function gF({className:e,...t}){return f.jsx("tbody",{"data-slot":"table-body",className:ee("[&_tr:last-child]:border-0",e),...t})}function xd({className:e,...t}){return f.jsx("tr",{"data-slot":"table-row",className:ee("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function bF({className:e,...t}){return f.jsx("th",{"data-slot":"table-head",className:ee("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function vF({className:e,...t}){return f.jsx("td",{"data-slot":"table-cell",className:ee("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function yF({className:e,...t}){return f.jsx("caption",{"data-slot":"table-caption",className:ee("text-muted-foreground mt-4 text-sm",e),...t})}function xF({...e}){return f.jsx(Or.Root,{"data-slot":"drawer",...e})}function wF({...e}){return f.jsx(Or.Portal,{"data-slot":"drawer-portal",...e})}function _F({className:e,...t}){return f.jsx(Or.Overlay,{"data-slot":"drawer-overlay",className:ee("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function EF({className:e,children:t,...n}){return f.jsxs(wF,{"data-slot":"drawer-portal",children:[f.jsx(_F,{}),f.jsxs(Or.Content,{"data-slot":"drawer-content",className:ee("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...n,children:[f.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),t]})]})}function SF({className:e,...t}){return f.jsx("div",{"data-slot":"drawer-header",className:ee("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",e),...t})}function kF({className:e,...t}){return f.jsx(Or.Title,{"data-slot":"drawer-title",className:ee("text-foreground font-semibold",e),...t})}function NF({className:e,...t}){return f.jsx(Or.Description,{"data-slot":"drawer-description",className:ee("text-muted-foreground text-sm",e),...t})}function CF({...e}){return f.jsx(pD,{"data-slot":"dropdown-menu",...e})}function TF({...e}){return f.jsx(mD,{"data-slot":"dropdown-menu-trigger",...e})}function AF({className:e,sideOffset:t=4,...n}){return f.jsx(hD,{children:f.jsx(gD,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function IF({className:e,inset:t,variant:n="default",...r}){return f.jsx(bD,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ee("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function RF({className:e,...t}){return f.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:ee("mx-auto flex w-full justify-center",e),...t})}function OF({className:e,...t}){return f.jsx("ul",{"data-slot":"pagination-content",className:ee("flex flex-row items-center gap-1",e),...t})}function Yo({...e}){return f.jsx("li",{"data-slot":"pagination-item",...e})}function Jl({className:e,isActive:t,size:n="icon",...r}){return f.jsx("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:ee(Wb({variant:t?"outline":"ghost",size:n}),e),...r})}function MF({className:e,...t}){return f.jsxs(Jl,{"aria-label":"Go to previous page",size:"default",className:ee("gap-1 px-2.5 sm:pl-2.5",e),...t,children:[f.jsx(nz,{}),f.jsx("span",{className:"hidden sm:block",children:"Previous"})]})}function PF({className:e,...t}){return f.jsxs(Jl,{"aria-label":"Go to next page",size:"default",className:ee("gap-1 px-2.5 sm:pr-2.5",e),...t,children:[f.jsx("span",{className:"hidden sm:block",children:"Next"}),f.jsx(oz,{})]})}function DF({className:e,...t}){return f.jsxs("span",{"aria-hidden":!0,"data-slot":"pagination-ellipsis",className:ee("flex size-9 items-center justify-center",e),...t,children:[f.jsx(uz,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"More pages"})]})}function LF({...e}){return f.jsx(ID,{"data-slot":"popover",...e})}function $F({...e}){return f.jsx(RD,{"data-slot":"popover-trigger",...e})}function zF({className:e,align:t="center",sideOffset:n=4,...r}){return f.jsx(OD,{children:f.jsx(MD,{"data-slot":"popover-content",align:t,sideOffset:n,className:ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function jF({className:e,...t}){return f.jsx("div",{"data-slot":"skeleton",className:ee("bg-accent animate-pulse rounded-md",e),...t})}function FF({className:e,defaultValue:t,value:n,min:r=0,max:o=100,...i}){const a=g.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,o],[n,t,r,o]);return f.jsxs(e$,{"data-slot":"slider",defaultValue:t,value:n,min:r,max:o,className:ee("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...i,children:[f.jsx(t$,{"data-slot":"slider-track",className:ee("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:f.jsx(n$,{"data-slot":"slider-range",className:ee("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:a.length},(s,l)=>f.jsx(r$,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},l))]})}function BF({className:e,orientation:t="horizontal",...n}){return f.jsx(p$,{"data-slot":"tabs","data-orientation":t,orientation:t,className:ee("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}var UF=io("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function HF({className:e,variant:t="default",...n}){return f.jsx(m$,{"data-slot":"tabs-list","data-variant":t,className:ee(UF({variant:t}),e),...n})}function VF({className:e,...t}){return f.jsx(h$,{"data-slot":"tabs-trigger",className:ee("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}var Yb=io("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function GF({className:e,variant:t,size:n,...r}){return f.jsx(g$,{"data-slot":"toggle",className:ee(Yb({variant:t,size:n,className:e})),...r})}var Xb=g.createContext({size:"default",variant:"default",spacing:0});function wd({className:e,variant:t,size:n,spacing:r=0,children:o,...i}){return f.jsx(w$,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":r,style:{"--gap":r},className:ee("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",e),...i,children:f.jsx(Xb.Provider,{value:{variant:t,size:n,spacing:r},children:o})})}function _d({className:e,children:t,variant:n,size:r,...o}){const i=g.useContext(Xb);return f.jsx(_$,{"data-slot":"toggle-group-item","data-variant":i.variant||n,"data-size":i.size||r,"data-spacing":i.spacing,className:ee(Yb({variant:i.variant||n,size:i.size||r}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",e),...o,children:t})}function ZF({delayDuration:e=0,...t}){return f.jsx(z$,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function KF({...e}){return f.jsx(j$,{"data-slot":"tooltip",...e})}function WF({...e}){return f.jsx(F$,{"data-slot":"tooltip-trigger",...e})}function qF({className:e,sideOffset:t=0,children:n,...r}){return f.jsx(B$,{children:f.jsxs(U$,{"data-slot":"tooltip-content",sideOffset:t,className:ee("bg-foreground text-background 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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[n,f.jsx(H$,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function YF(e,t){if(t<=7)return Array.from({length:t},(i,a)=>a+1);const n=[];n.push(1),e>3&&n.push("ellipsis");const r=Math.max(2,e-1),o=Math.min(t-1,e+1);for(let i=r;i<=o;i++)n.push(i);return e<t-2&&n.push("ellipsis"),n.push(t),n}var XF={Card:({props:e,children:t})=>{const n=e.maxWidth==="sm"?"max-w-xs sm:min-w-[280px]":e.maxWidth==="md"?"max-w-sm sm:min-w-[320px]":e.maxWidth==="lg"?"max-w-md sm:min-w-[360px]":"w-full",r=e.centered?"mx-auto":"";return f.jsxs(wj,{className:ee(n,r),children:[(e.title||e.description)&&f.jsxs(_j,{children:[e.title&&f.jsx(Ej,{children:e.title}),e.description&&f.jsx(Sj,{children:e.description})]}),f.jsx(kj,{className:"flex flex-col gap-3",children:t})]})},Stack:({props:e,children:t})=>{const n=e.direction==="horizontal",r={none:"gap-0",sm:"gap-2",md:"gap-3",lg:"gap-4"},o={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"},i={start:"",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"},a=r[e.gap??"md"]??"gap-3",s=o[e.align??"start"]??"items-start",l=i[e.justify??""]??"";return f.jsx("div",{className:`flex ${n?"flex-row flex-wrap":"flex-col"} ${a} ${s} ${l}`,children:t})},Grid:({props:e,children:t})=>{const n={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6"},r={sm:"gap-2",md:"gap-3",lg:"gap-4"},o=Math.max(1,Math.min(6,e.columns??1)),i=n[o]??"grid-cols-1",a=r[e.gap??"md"]??"gap-3";return f.jsx("div",{className:`grid ${i} ${a}`,children:t})},Separator:({props:e})=>f.jsx(Rj,{orientation:e.orientation??"horizontal",className:e.orientation==="vertical"?"h-full mx-2":"my-3"}),Tabs:({props:e,children:t,bindings:n,emit:r})=>{const o=e.tabs??[],[i,a]=jt(e.value,n?.value),[s,l]=g.useState(e.defaultValue??o[0]?.value??""),c=!!n?.value,u=c?i??o[0]?.value??"":s,d=c?a:l;return f.jsxs(BF,{value:u,onValueChange:p=>{d(p),r("change")},children:[f.jsx(HF,{children:o.map(p=>f.jsx(VF,{value:p.value,children:p.label},p.value))}),t]})},Accordion:({props:e})=>{const t=e.items??[],n=e.type==="multiple",r=t.map((o,i)=>f.jsxs(Hj,{value:`item-${i}`,children:[f.jsx(Vj,{children:o.title}),f.jsx(Gj,{children:o.content})]},i));return n?f.jsx(yd,{type:"multiple",className:"w-full",children:r}):f.jsx(yd,{type:"single",collapsible:!0,className:"w-full",children:r})},Collapsible:({props:e,children:t})=>{const[n,r]=g.useState(e.defaultOpen??!1);return f.jsxs(dF,{open:n,onOpenChange:r,className:"w-full",children:[f.jsx(fF,{asChild:!0,children:f.jsxs("button",{className:"flex w-full items-center justify-between rounded-md border border-border px-4 py-2 text-sm font-medium hover:bg-muted transition-colors",children:[e.title,f.jsx("svg",{className:`h-4 w-4 transition-transform ${n?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]})}),f.jsx(pF,{className:"pt-2",children:t})]})},Dialog:({props:e,children:t})=>{const[n,r]=Vu(e.openPath??"");return f.jsx(Lj,{open:n??!1,onOpenChange:o=>r(o),children:f.jsxs(jj,{children:[f.jsxs(Fj,{children:[f.jsx(Bj,{children:e.title}),e.description&&f.jsx(Uj,{children:e.description})]}),t]})})},Drawer:({props:e,children:t})=>{const[n,r]=Vu(e.openPath??"");return f.jsx(xF,{open:n??!1,onOpenChange:o=>r(o),children:f.jsxs(EF,{children:[f.jsxs(SF,{children:[f.jsx(kF,{children:e.title}),e.description&&f.jsx(NF,{children:e.description})]}),f.jsx("div",{className:"p-4",children:t})]})})},Carousel:({props:e})=>{const t=e.items??[];return f.jsxs(aF,{className:"w-full",children:[f.jsx(sF,{children:t.map((n,r)=>f.jsx(lF,{className:"basis-3/4 md:basis-1/2 lg:basis-1/3",children:f.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card h-full",children:[n.title&&f.jsx("h4",{className:"font-semibold text-sm mb-1",children:n.title}),n.description&&f.jsx("p",{className:"text-sm text-muted-foreground",children:n.description})]})},r))}),f.jsx(cF,{}),f.jsx(uF,{})]})},Table:({props:e})=>{const t=e.columns??[],n=(e.rows??[]).map(r=>r.map(String));return f.jsx("div",{className:"rounded-md border border-border overflow-hidden",children:f.jsxs(mF,{children:[e.caption&&f.jsx(yF,{children:e.caption}),f.jsx(hF,{children:f.jsx(xd,{children:t.map(r=>f.jsx(bF,{children:r},r))})}),f.jsx(gF,{children:n.map((r,o)=>f.jsx(xd,{children:r.map((i,a)=>f.jsx(vF,{children:i},a))},o))})]})})},Heading:({props:e})=>{const t=e.level??"h2",n=t==="h1"?"text-2xl font-bold":t==="h3"?"text-base font-semibold":t==="h4"?"text-sm font-semibold":"text-lg font-semibold";return t==="h1"?f.jsx("h1",{className:`${n} text-left`,children:e.text}):t==="h3"?f.jsx("h3",{className:`${n} text-left`,children:e.text}):t==="h4"?f.jsx("h4",{className:`${n} text-left`,children:e.text}):f.jsx("h2",{className:`${n} text-left`,children:e.text})},Text:({props:e})=>{const t=e.variant==="caption"?"text-xs":e.variant==="muted"?"text-sm text-muted-foreground":e.variant==="lead"?"text-xl text-muted-foreground":e.variant==="code"?"font-mono text-sm bg-muted px-1.5 py-0.5 rounded":"text-sm";return e.variant==="code"?f.jsx("code",{className:`${t} text-left`,children:e.text}):f.jsx("p",{className:`${t} text-left`,children:e.text})},Image:({props:e})=>e.src?f.jsx("img",{src:e.src,alt:e.alt??"",width:e.width??void 0,height:e.height??void 0,className:"rounded max-w-full"}):f.jsx("div",{className:"bg-muted border border-border rounded flex items-center justify-center text-xs text-muted-foreground",style:{width:e.width??80,height:e.height??60},children:e.alt||"img"}),Avatar:({props:e})=>{const t=e.name||"?",n=t.split(" ").map(o=>o[0]).join("").slice(0,2).toUpperCase(),r=e.size==="lg"?"h-12 w-12":e.size==="sm"?"h-8 w-8":"h-10 w-10";return f.jsxs(Zj,{className:r,children:[e.src&&f.jsx(Kj,{src:e.src,alt:t}),f.jsx(Wj,{children:n})]})},Badge:({props:e})=>f.jsx(Yj,{variant:e.variant??"default",children:e.text}),Alert:({props:e})=>{const t=e.type==="error"?"destructive":"default",n=e.type==="success"?"border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-950 dark:text-green-100":e.type==="warning"?"border-yellow-200 bg-yellow-50 text-yellow-900 dark:border-yellow-800 dark:bg-yellow-950 dark:text-yellow-100":e.type==="info"?"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100":"";return f.jsxs(Mj,{variant:t,className:n,children:[f.jsx(Pj,{children:e.title}),e.message&&f.jsx(Dj,{children:e.message})]})},Progress:({props:e})=>{const t=Math.min(100,Math.max(0,e.value||0));return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(vn,{className:"text-sm text-muted-foreground",children:e.label}),f.jsx(Ij,{value:t})]})},Skeleton:({props:e})=>f.jsx(jF,{className:e.rounded?"rounded-full":"rounded-md",style:{width:e.width??"100%",height:e.height??"1.25rem"}}),Spinner:({props:e})=>{const t=e.size==="lg"?"h-8 w-8":e.size==="sm"?"h-4 w-4":"h-6 w-6";return f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("svg",{className:`${t} animate-spin text-muted-foreground`,viewBox:"0 0 24 24",fill:"none",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),e.label&&f.jsx("span",{className:"text-sm text-muted-foreground",children:e.label})]})},Tooltip:({props:e})=>f.jsx(ZF,{children:f.jsxs(KF,{children:[f.jsx(WF,{asChild:!0,children:f.jsx("span",{className:"text-sm underline decoration-dotted cursor-help",children:e.text})}),f.jsx(qF,{children:f.jsx("p",{children:e.content})})]})}),Popover:({props:e})=>f.jsxs(LF,{children:[f.jsx($F,{asChild:!0,children:f.jsx(qr,{variant:"outline",className:"text-sm",children:e.trigger})}),f.jsx(zF,{className:"w-64",children:f.jsx("p",{className:"text-sm",children:e.content})})]}),Input:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.value,t?.value),[i,a]=g.useState(""),s=!!t?.value,l=s?r??"":i,c=s?o:a,u=e.validateOn??"blur",d=!!(t?.value&&e.checks?.length),{errors:p,validate:m}=or(t?.value??"",d?{checks:e.checks??[],validateOn:u}:void 0);return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(vn,{htmlFor:e.name??void 0,children:e.label}),f.jsx(Nj,{id:e.name??void 0,name:e.name??void 0,type:e.type??"text",placeholder:e.placeholder??"",value:l,onChange:b=>{c(b.target.value),d&&u==="change"&&m()},onKeyDown:b=>{b.key==="Enter"&&n("submit")},onFocus:()=>n("focus"),onBlur:()=>{d&&u==="blur"&&m(),n("blur")}}),p.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:p[0]})]})},Textarea:({props:e,bindings:t})=>{const[n,r]=jt(e.value,t?.value),[o,i]=g.useState(""),a=!!t?.value,s=a?n??"":o,l=a?r:i,c=e.validateOn??"blur",u=!!(t?.value&&e.checks?.length),{errors:d,validate:p}=or(t?.value??"",u?{checks:e.checks??[],validateOn:c}:void 0);return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(vn,{htmlFor:e.name??void 0,children:e.label}),f.jsx(Cj,{id:e.name??void 0,name:e.name??void 0,placeholder:e.placeholder??"",rows:e.rows??3,value:s,onChange:m=>{l(m.target.value),u&&c==="change"&&p()},onBlur:()=>{u&&c==="blur"&&p()}}),d.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:d[0]})]})},Select:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.value,t?.value),[i,a]=g.useState(""),s=!!t?.value,l=s?r??"":i,c=s?o:a,d=(e.options??[]).map(y=>typeof y=="string"?y:String(y??"")),p=e.validateOn??"change",m=!!(t?.value&&e.checks?.length),{errors:b,validate:h}=or(t?.value??"",m?{checks:e.checks??[],validateOn:p}:void 0);return f.jsxs("div",{className:"space-y-2",children:[f.jsx(vn,{children:e.label}),f.jsxs(Qj,{value:l,onValueChange:y=>{c(y),m&&p==="change"&&h(),n("change")},children:[f.jsx(tF,{className:"w-full",children:f.jsx(eF,{placeholder:e.placeholder??"Select..."})}),f.jsx(nF,{children:d.map((y,v)=>f.jsx(rF,{value:y||`option-${v}`,children:y},`${v}-${y}`))})]}),b.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:b[0]})]})},Checkbox:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.checked,t?.checked),[i,a]=g.useState(!!e.checked),s=!!t?.checked,l=s?r??!1:i,c=s?o:a,u=e.validateOn??"change",d=!!(t?.checked&&e.checks?.length),{errors:p,validate:m}=or(t?.checked??"",d?{checks:e.checks??[],validateOn:u}:void 0);return f.jsxs("div",{className:"space-y-1",children:[f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(Tj,{id:e.name??void 0,checked:l,onCheckedChange:b=>{c(b===!0),d&&u==="change"&&m(),n("change")}}),f.jsx(vn,{htmlFor:e.name??void 0,className:"cursor-pointer",children:e.label})]}),p.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:p[0]})]})},Radio:({props:e,bindings:t,emit:n})=>{const o=(e.options??[]).map(y=>typeof y=="string"?y:String(y??"")),[i,a]=jt(e.value,t?.value),[s,l]=g.useState(o[0]??""),c=!!t?.value,u=c?i??"":s,d=c?a:l,p=e.validateOn??"change",m=!!(t?.value&&e.checks?.length),{errors:b,validate:h}=or(t?.value??"",m?{checks:e.checks??[],validateOn:p}:void 0);return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(vn,{children:e.label}),f.jsx(Xj,{value:u,onValueChange:y=>{d(y),m&&p==="change"&&h(),n("change")},children:o.map((y,v)=>f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(Jj,{value:y||`option-${v}`,id:`${e.name}-${v}-${y}`}),f.jsx(vn,{htmlFor:`${e.name}-${v}-${y}`,className:"cursor-pointer",children:y})]},`${v}-${y}`))}),b.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:b[0]})]})},Switch:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.checked,t?.checked),[i,a]=g.useState(!!e.checked),s=!!t?.checked,l=s?r??!1:i,c=s?o:a,u=e.validateOn??"change",d=!!(t?.checked&&e.checks?.length),{errors:p,validate:m}=or(t?.checked??"",d?{checks:e.checks??[],validateOn:u}:void 0);return f.jsxs("div",{className:"space-y-1",children:[f.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[f.jsx(vn,{htmlFor:e.name??void 0,className:"cursor-pointer",children:e.label}),f.jsx(Aj,{id:e.name??void 0,checked:l,onCheckedChange:b=>{c(b),d&&u==="change"&&m(),n("change")}})]}),p.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:p[0]})]})},Slider:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.value,t?.value),[i,a]=g.useState(e.min??0),s=!!t?.value,l=s?r??e.min??0:i,c=s?o:a;return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsxs("div",{className:"flex justify-between",children:[f.jsx(vn,{className:"text-sm",children:e.label}),f.jsx("span",{className:"text-sm text-muted-foreground",children:l})]}),f.jsx(FF,{value:[l],min:e.min??0,max:e.max??100,step:e.step??1,onValueChange:u=>{c(u[0]??0),n("change")}})]})},Button:({props:e,emit:t})=>{const n=e.variant==="danger"?"destructive":e.variant==="secondary"?"secondary":"default";return f.jsx(qr,{variant:n,disabled:e.disabled??!1,onClick:()=>t("press"),children:e.label})},Link:({props:e,on:t})=>f.jsx("a",{href:e.href??"#",className:"text-primary underline-offset-4 hover:underline text-sm font-medium",onClick:n=>{const r=t("press");r.shouldPreventDefault&&n.preventDefault(),r.emit()},children:e.label}),DropdownMenu:({props:e,bindings:t,emit:n})=>{const r=e.items??[],[,o]=jt(e.value,t?.value);return f.jsxs(CF,{children:[f.jsx(TF,{asChild:!0,children:f.jsx(qr,{variant:"outline",children:e.label})}),f.jsx(AF,{children:r.map(i=>f.jsx(IF,{onClick:()=>{o(i.value),n("select")},children:i.label},i.value))})]})},Toggle:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.pressed,t?.pressed),[i,a]=g.useState(e.pressed??!1),s=!!t?.pressed,l=s?r??!1:i,c=s?o:a;return f.jsx(GF,{variant:e.variant??"default",pressed:l,onPressedChange:u=>{c(u),n("change")},children:e.label})},ToggleGroup:({props:e,bindings:t,emit:n})=>{const r=e.type??"single",o=e.items??[],[i,a]=jt(e.value,t?.value),[s,l]=g.useState(o[0]?.value??""),c=!!t?.value,u=c?i??"":s,d=c?a:l;if(r==="multiple"){const p=u?u.split(",").filter(Boolean):[];return f.jsx(wd,{type:"multiple",value:p,onValueChange:m=>{d(m.join(",")),n("change")},children:o.map(m=>f.jsx(_d,{value:m.value,children:m.label},m.value))})}return f.jsx(wd,{type:"single",value:u,onValueChange:p=>{p&&(d(p),n("change"))},children:o.map(p=>f.jsx(_d,{value:p.value,children:p.label},p.value))})},ButtonGroup:({props:e,bindings:t,emit:n})=>{const r=e.buttons??[],[o,i]=jt(e.selected,t?.selected),[a,s]=g.useState(r[0]?.value??""),l=!!t?.selected,c=l?o??"":a,u=l?i:s;return f.jsx("div",{className:"inline-flex rounded-md border border-border",children:r.map((d,p)=>f.jsx("button",{className:`px-3 py-1.5 text-sm transition-colors ${c===d.value?"bg-primary text-primary-foreground":"bg-background hover:bg-muted"} ${p>0?"border-l border-border":""} ${p===0?"rounded-l-md":""} ${p===r.length-1?"rounded-r-md":""}`,onClick:()=>{u(d.value),n("change")},children:d.label},d.value))})},Pagination:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.page,t?.page),i=r??1,a=e.totalPages??1,s=YF(i,a);return f.jsx(RF,{children:f.jsxs(OF,{children:[f.jsx(Yo,{children:f.jsx(MF,{href:"#",onClick:l=>{l.preventDefault(),i>1&&(o(i-1),n("change"))}})}),s.map((l,c)=>l==="ellipsis"?f.jsx(Yo,{children:f.jsx(DF,{})},`ellipsis-${c}`):f.jsx(Yo,{children:f.jsx(Jl,{href:"#",isActive:l===i,onClick:u=>{u.preventDefault(),o(l),n("change")},children:l})},l)),f.jsx(Yo,{children:f.jsx(PF,{href:"#",onClick:l=>{l.preventDefault(),i<a&&(o(i+1),n("change"))}})})]})})}};const JF=cO(uO,{components:CO,actions:{}}),{registry:QF}=NO(JF,{components:XF});function e2({spec:e}){return f.jsx(kO,{spec:e,registry:QF})}function t2(e){return typeof e=="string"?e:JSON.stringify(e,null,2)}function n2({hint:e,data:t}){const n=t2(t);if(e.type==="markdown")return f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:f.jsx(lf,{remarkPlugins:[Qf],children:n})});if(e.type==="json")return f.jsx("pre",{className:"text-xs whitespace-pre-wrap",children:n});if(e.type==="list")try{const r=Array.isArray(t)?t:JSON.parse(n);if(!Array.isArray(r))throw new Error("not an array");return e.ordered?f.jsx("ol",{className:"list-decimal pl-5 text-sm space-y-1",children:r.map((o,i)=>f.jsx("li",{children:String(o)},i))}):f.jsx("ul",{className:"list-disc pl-5 text-sm space-y-1",children:r.map((o,i)=>f.jsx("li",{children:String(o)},i))})}catch{return f.jsx("pre",{className:"text-xs whitespace-pre-wrap",children:n})}return f.jsx("pre",{className:"text-xs whitespace-pre-wrap",children:n})}function r2({execution:e}){const[t,n]=g.useState(e.status!=="completed"),r=DN(e),o=r.icon,i=LN(e),a=e.result?.details??e.partialResult?.details??{},s=a.renderHint,l=a.uiSpec,c=!!(s||l);return f.jsxs("div",{className:Kt("group text-xs",e.status==="error"&&"text-destructive"),children:[f.jsxs("button",{type:"button",onClick:()=>n(u=>!u),className:Kt("flex w-full items-center gap-1.5 rounded px-2 py-1 text-left transition-colors","hover:bg-muted/50",e.status==="error"&&"hover:bg-destructive/10"),children:[f.jsx($v,{className:Kt("h-3 w-3 shrink-0 transition-transform text-muted-foreground",t&&"rotate-90")}),f.jsx(o,{className:Kt("h-3.5 w-3.5 shrink-0",e.toolName==="bash"&&"text-emerald-500",e.toolName==="read"&&"text-blue-500",e.toolName==="write"&&"text-emerald-500",e.toolName==="edit"&&"text-amber-500",e.toolName==="grep"&&"text-violet-500",e.toolName==="find"&&"text-cyan-500",e.toolName==="ls"&&"text-indigo-500",!["bash","read","write","edit","grep","find","ls"].includes(e.toolName)&&"text-muted-foreground")}),f.jsx("span",{className:"font-mono",children:e.toolName}),r.command&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-muted-foreground",children:"›"}),f.jsx("span",{className:"truncate font-mono text-muted-foreground",children:r.command})]}),e.status==="running"&&f.jsx(Ds,{className:"ml-auto h-3 w-3 shrink-0 animate-spin text-muted-foreground"}),e.status==="error"&&f.jsx("span",{className:"ml-auto shrink-0 text-destructive",children:"failed"})]}),t&&f.jsx("div",{className:"mt-1 ml-5 rounded-md border border-border bg-muted/30 p-2 animate-in fade-in slide-in-from-top-2 duration-200",children:c?f.jsxs(f.Fragment,{children:[s&&f.jsx(n2,{hint:s,data:a.data??a.content??a}),l&&f.jsx(e2,{spec:l})]}):f.jsx("pre",{className:"max-h-64 overflow-auto whitespace-pre-wrap text-xs",children:i||"(no output)"})})]})}function o2({messageId:e}){const t=Hn(jv,n=>zv(e,n));return t.length===0?null:f.jsx("div",{className:"space-y-2 mb-2",children:t.map(n=>f.jsx(r2,{execution:n},n.toolCallId))})}function i2(e){const t=e.trim().replace(/\s+/g," ");return t?t.length<=50?t:`${t.slice(0,50)}…`:"Assistant response"}function a2({message:e}){const[t,n]=g.useState(!1),r=e.thinkingContent??e.persistedThinkingContent??"",o=r.length>0;return f.jsxs(f.Fragment,{children:[o&&f.jsxs("div",{className:"mb-3",children:[f.jsxs("button",{className:"flex w-full items-center justify-between rounded-md border border-border bg-background/60 px-3 py-2 text-left text-sm",onClick:()=>n(i=>!i),type:"button",children:[f.jsx("span",{className:"font-medium text-foreground",children:i2(e.content)}),f.jsx(Ls,{className:Kt("h-4 w-4 text-muted-foreground transition-transform",t&&"rotate-180")})]}),t&&f.jsx("div",{className:"mt-2 space-y-3 rounded-md border border-border bg-background/40 p-3",children:f.jsxs("div",{className:"space-y-1.5 text-xs",children:[f.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[f.jsx(qv,{className:"h-3.5 w-3.5"}),f.jsx("span",{className:"font-medium",children:e.isThinking?"Thinking...":"Thinking"}),e.isThinking&&f.jsx(Ds,{className:"h-3 w-3 animate-spin"})]}),f.jsx("p",{className:"whitespace-pre-wrap italic text-muted-foreground",children:r})]})})]}),f.jsx(o2,{messageId:e.id}),e.content.trim().length>0?f.jsx("div",{className:"prose prose-base dark:prose-invert max-w-none",children:f.jsx(lf,{remarkPlugins:[Qf],rehypePlugins:[kk],children:e.content})}):e.isStreaming?f.jsx("div",{className:"prose prose-base dark:prose-invert max-w-none text-muted-foreground",children:"..."}):null]})}function s2({attachments:e}){return!e||e.length===0?null:f.jsx("div",{className:"mb-2 flex flex-wrap gap-2",children:e.map((t,n)=>{const r=`${t.type}-${t.name??"unnamed"}-${n}`;return t.type==="image"&&t.previewUrl?f.jsx("a",{href:t.previewUrl,target:"_blank",rel:"noreferrer",className:"block",children:f.jsx("img",{src:t.previewUrl,alt:t.name??"Attached image",className:"h-20 w-20 rounded-md border border-primary-foreground/25 object-cover transition-opacity hover:opacity-90"})},r):f.jsxs("div",{className:Kt("inline-flex max-w-full items-center gap-2 rounded-md border px-2 py-1","border-primary-foreground/25 bg-primary-foreground/10 text-primary-foreground"),children:[f.jsx(kd,{className:"h-3.5 w-3.5 shrink-0"}),f.jsx("span",{className:"truncate text-xs font-medium",children:t.name??"Attached file"})]},r)})})}function l2({message:e}){const t=e.role==="user";return f.jsx("div",{className:Kt("flex w-full animate-message-enter",t?"justify-end":"justify-start"),children:f.jsxs("div",{className:Kt(t?"max-w-[75%] rounded-2xl bg-primary px-4 py-2.5 text-primary-foreground":"w-full text-foreground"),children:[t?f.jsxs(f.Fragment,{children:[f.jsx(s2,{attachments:e.attachments}),e.content?f.jsx("p",{className:"whitespace-pre-wrap",children:e.content}):null]}):f.jsx(a2,{message:e}),e.isStreaming&&!t&&f.jsxs("span",{className:"ml-2 inline-flex gap-1",children:[f.jsx("span",{className:"typing-dot inline-block h-1.5 w-1.5 rounded-full bg-current"}),f.jsx("span",{className:"typing-dot inline-block h-1.5 w-1.5 rounded-full bg-current"}),f.jsx("span",{className:"typing-dot inline-block h-1.5 w-1.5 rounded-full bg-current"})]})]})})}function Ed(e){return e.thinkingContent??e.persistedThinkingContent??""}function c2(e,t=50){const n=e.trim().replace(/\s+/g," ");return n.length<=t?n:`${n.slice(0,t)}…`}function u2({messages:e}){const[t,n]=g.useState(!1),r=e.some(l=>l.isThinking||l.isStreaming),o=e[e.length-1],i=Ed(o),a=c2(i),s=e.length;return f.jsxs("div",{className:"relative w-full",children:[f.jsxs("button",{type:"button",onClick:()=>n(l=>!l),className:Kt("flex w-full min-w-0 items-center gap-2 rounded-lg border border-dashed px-3 py-2 text-left transition-colors","border-border/60 bg-muted/30 hover:bg-muted/50",t&&"bg-muted/50"),children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[f.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground",children:[f.jsx("span",{children:"💭 Thinking"}),r&&f.jsx(Ds,{className:"h-3 w-3 animate-spin"})]}),!t&&i&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),f.jsx("span",{className:"min-w-0 truncate text-xs italic text-muted-foreground",children:a})]})]}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[f.jsxs("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:[s," ",s===1?"step":"steps"]}),f.jsx(Ls,{className:Kt("h-3.5 w-3.5 text-muted-foreground transition-transform",t&&"rotate-180")})]})]}),t&&f.jsx("div",{className:"mt-2 rounded-lg border border-border/60 bg-card/95 p-3 shadow-sm backdrop-blur-sm animate-in fade-in slide-in-from-top-2 duration-200",children:f.jsx("ol",{className:"space-y-2 text-xs",children:e.map((l,c)=>{const u=Ed(l);return f.jsxs("li",{className:"flex gap-2 text-muted-foreground",children:[f.jsxs("span",{className:"shrink-0 font-medium text-primary",children:[c+1,"."]}),f.jsx("span",{className:"whitespace-pre-wrap italic",children:u||"(empty)"})]},l.id)})})})]})}function d2(e){if(e.role!=="assistant")return!1;const t=e.content.trim().length>0,n=(e.thinkingContent??e.persistedThinkingContent??"").trim().length>0;return!t&&n}function f2(e){const t=[];let n=[];for(const r of e)d2(r)?n.push(r):(n.length>0&&(t.push({type:"thinking-steps",messages:n}),n=[]),t.push({type:"message",message:r}));return n.length>0&&t.push({type:"thinking-steps",messages:n}),t}function p2(){const{messages:e}=Hn(Fv,r=>({messages:r.messages})),t=g.useRef(null);if(g.useEffect(()=>{t.current?.scrollIntoView({behavior:"smooth"})},[e]),e.length===0)return f.jsx("div",{className:"flex h-full items-center justify-center p-8 chat-background",children:f.jsxs("div",{className:"text-center space-y-4 max-w-md",children:[f.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-primary/10 border border-primary/20 mb-2",children:f.jsx("span",{className:"text-3xl font-mono font-bold text-primary",children:"c/"})}),f.jsx("p",{className:"text-xl font-semibold",children:"Start a conversation"}),f.jsxs("p",{className:"text-sm text-muted-foreground leading-relaxed",children:["Send a message to begin chatting with"," ",f.jsx("span",{className:"font-mono text-primary",children:"clankie"}),", your personal AI assistant that lives in your workspace."]}),f.jsxs("div",{className:"pt-2 flex flex-wrap gap-2 justify-center text-xs text-muted-foreground",children:[f.jsx("span",{className:"px-3 py-1 rounded-full bg-muted/50",children:"💬 Natural language"}),f.jsx("span",{className:"px-3 py-1 rounded-full bg-muted/50",children:"🔧 Tools & commands"}),f.jsx("span",{className:"px-3 py-1 rounded-full bg-muted/50",children:"📎 File uploads"})]})]})});const n=f2(e);return f.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-6 chat-background",children:f.jsxs("div",{className:"mx-auto w-full max-w-3xl space-y-4",children:[n.map(r=>r.type==="message"?f.jsx(l2,{message:r.message},r.message.id):f.jsx(u2,{messages:r.messages},r.messages[0].id)),f.jsx("div",{ref:t})]})})}function v2(){const{sessionId:e}=Bv.useParams(),t=Uv(),{status:n}=Hn(Hv,i=>({status:i.status})),{sessionId:r}=Hn(Os,i=>({sessionId:i.sessionId}));Hn(Vv,i=>i);const o=n==="connected";return g.useEffect(()=>{if(o){if(r===e){console.log(`[session-page] Already on session ${e}, no switch needed`);return}console.log(`[session-page] URL sessionId changed to ${e}, switching...`),ni.switchSession(e).catch(i=>{console.error(`[session-page] Failed to load session ${e}:`,i),t({to:"/"})})}},[e,o,r,t]),o?r!==e?f.jsx("div",{className:"flex h-full items-center justify-center chat-background",children:f.jsxs("div",{className:"text-center space-y-3",children:[f.jsxs("div",{className:"inline-flex gap-1 mb-2",children:[f.jsx("span",{className:"typing-dot inline-block h-3 w-3 rounded-full bg-primary"}),f.jsx("span",{className:"typing-dot inline-block h-3 w-3 rounded-full bg-primary"}),f.jsx("span",{className:"typing-dot inline-block h-3 w-3 rounded-full bg-primary"})]}),f.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading session"," ",f.jsx("span",{className:"font-mono text-primary",children:e.slice(0,8)})]})]})}):f.jsxs("div",{className:"flex h-full flex-col",children:[f.jsx(p2,{}),f.jsx(Ey,{})]}):f.jsx("div",{className:"flex h-full items-center justify-center chat-background",children:f.jsxs("div",{className:"text-center space-y-4 max-w-md p-8",children:[f.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-destructive/10 border border-destructive/20 mb-2",children:f.jsx(pc,{className:"h-8 w-8 text-destructive"})}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("h2",{className:"text-2xl font-semibold",children:"Not Connected"}),f.jsx("p",{className:"text-muted-foreground",children:"Configure your connection to get started"})]}),f.jsx(Gv,{to:"/settings",children:f.jsxs(ti,{className:"transition-transform hover:scale-105 active:scale-95",children:[f.jsx(pc,{className:"mr-2 h-4 w-4"}),"Go to Settings"]})})]})})}export{v2 as component};