@grackle-ai/web 0.72.6 → 0.73.1

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
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-DTUHQ8rc.js","assets/markdown-gcy1Jmzi.js","assets/dagview-BA5TtMAQ.js","assets/KnowledgePage-DMqJ4jlP.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KnowledgePage-DHgwsoTN.js","assets/markdown-gcy1Jmzi.js","assets/dagview-BA5TtMAQ.js","assets/KnowledgePage-DMqJ4jlP.css"])))=>i.map(i=>d[i]);
2
2
  import{r as ZS,a as x,j as c,v as XS,b as QS,t as Gr,i as WS,f as JS,M as th,c as nh}from"./markdown-gcy1Jmzi.js";import{r as eT,d as Zv,H as Xv,P as Qv,i as tT,B as nT,a as aT,C as sT,M as iT}from"./dagview-BA5TtMAQ.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const u of r)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function i(r){const u={};return r.integrity&&(u.integrity=r.integrity),r.referrerPolicy&&(u.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?u.credentials="include":r.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(r){if(r.ep)return;r.ep=!0;const u=i(r);fetch(r.href,u)}})();var Yd={exports:{}},Ko={},Zd={exports:{}},Xd={};/**
3
3
  * @license React
4
4
  * scheduler.production.js
@@ -87,7 +87,7 @@ Migration 003_audit_log.sql applied successfully.`}},{delayMs:2500,event:{eventT
87
87
  - should apply discount codes
88
88
  - should handle currency conversion
89
89
  - should reject expired cards`}},{delayMs:2800,event:{eventType:"output",timestamp:jt(2800),content:`Error: Cannot resolve import 'src/services/stripe-client.ts' — module not found.
90
- The billing service depends on a Stripe client that doesn't exist in this environment.`}},{delayMs:3500,event:{eventType:"status",timestamp:jt(3500),content:"failed"}}]}],gy=400;function UC({children:t}){const[a,i]=x.useState(AC),[o,r]=x.useState(DC),[u,d]=x.useState(RC),[p,m]=x.useState(void 0),[g,v]=x.useState(MC),[y,b]=x.useState(OC),[S,T]=x.useState(py),[C,N]=x.useState(BC),[E,w]=x.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[R,M]=x.useState(IC),[A]=x.useState(LC),[$,V]=x.useState(""),B=x.useRef(0),F=x.useRef(0),X=x.useRef(new Set),J=x.useRef(new Map),te=x.useRef(y);te.current=y;const ee=x.useRef(new Map),z=x.useRef(new Map),ne=x.useCallback(Q=>(B.current+=1,`mock-${Q}-${String(B.current).padStart(3,"0")}`),[]),I=x.useCallback(()=>{const Q=my[F.current%my.length];return F.current+=1,Q},[]),K=x.useCallback((Q,le,re)=>{const Se=setTimeout(()=>{var ve;X.current.delete(Se),re&&((ve=J.current.get(re))==null||ve.delete(Se)),Q()},le);X.current.add(Se),re&&(J.current.has(re)||J.current.set(re,new Set),J.current.get(re).add(Se))},[]),se=x.useCallback(Q=>{const le=J.current.get(Q);le&&(le.forEach(re=>{clearTimeout(re),X.current.delete(re)}),J.current.delete(Q))},[]),oe=x.useCallback((Q,le,re)=>{r(Se=>Se.map(ve=>ve.id===Q?{...ve,status:le,...re!==void 0?{endReason:re}:{}}:ve))},[]),j=x.useCallback(Q=>{d(le=>[...le,Q])},[]),ie=x.useCallback((Q,le,re)=>{le.forEach((Se,ve)=>{K(()=>{const Xe={sessionId:Q,...Se.event,timestamp:new Date().toISOString()};if(j(Xe),Se.event.eventType==="status"){const Ne=tb(Se.event.content),Je=nb(Se.event.content);oe(Q,Ne,Je)}ve===le.length-1&&re&&re()},Se.delayMs,Q)})},[K,j,oe]),pe=x.useCallback((Q,le,re,Se)=>{console.log("[MockGrackle] spawn",{environmentId:Q,prompt:le,runtime:Se});const ve=ne("sess"),Xe={id:ve,environmentId:Q,runtime:Se||"claude-code",status:"running",prompt:le,startedAt:new Date().toISOString()};r(Je=>[...Je,Xe]),m(ve);const Ne=I();if(console.log(`[MockGrackle] Playing scenario: ${Ne.label}`),Ne.pauseForInput){const Je=Ne.pauseAfterStep??Ne.steps.length-1,we=Ne.steps.slice(0,Je+1),nt=we.length>0?we[we.length-1].delayMs:0;ie(ve,we),K(()=>{oe(ve,"idle"),j({sessionId:ve,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},nt+gy,ve),Ne.resumeSteps&&ee.current.set(ve,Ne.resumeSteps)}else ie(ve,Ne.steps)},[ne,I,ie,K,oe,j]),ge=x.useCallback(Q=>{console.log("[MockGrackle] kill",Q),se(Q),ee.current.delete(Q),oe(Q,"stopped","killed"),j({sessionId:Q,eventType:"status",timestamp:new Date().toISOString(),content:"killed"}),b(le=>le.map(re=>re.latestSessionId===Q&&re.status==="working"?{...re,status:"not_started"}:re))},[se,oe,j]),_e=x.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),yt=x.useCallback(Q=>{console.log("[MockGrackle] loadSessionEvents",Q)},[]),fe=x.useCallback(()=>{console.log("[MockGrackle] clearEvents"),d([])},[]),Et=x.useCallback((Q,le,re,Se,ve,Xe,Ne,Je,we)=>{console.log("[MockGrackle] createWorkspace",{name:Q,description:le});const nt={id:ne("proj"),name:Q,description:le||"",repoUrl:re||"",environmentId:Se||"",status:"active",worktreeBasePath:Ne||"",useWorktrees:Xe??!0,defaultPersonaId:ve||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};v(Ge=>[...Ge,nt]),Je&&Je()},[ne]),mn=x.useCallback(Q=>{console.log("[MockGrackle] archiveWorkspace",Q),v(le=>le.map(re=>re.id===Q?{...re,status:"archived"}:re))},[]),gn=x.useCallback(Q=>{console.log("[MockGrackle] loadTasks",Q)},[]),ka=x.useCallback((Q,le,re,Se,ve,Xe,Ne,Je,we)=>{console.log("[MockGrackle] createTask",{workspaceId:Q,title:le,parentTaskId:ve}),b(nt=>{const Gt=nt.filter(vn=>vn.workspaceId===Q).reduce((vn,Ea)=>Math.max(vn,Ea.sortOrder),0),tn=ve?nt.find(vn=>vn.id===ve):void 0;if(ve&&!tn)return console.warn("[MockGrackle] Parent task not found:",ve),nt;if(tn&&!tn.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",ve),nt;const Vt=tn?tn.depth+1:0,Ca={id:ne("task"),workspaceId:Q,title:le,description:re||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:Se||[],reviewNotes:void 0,sortOrder:Gt+1,createdAt:new Date().toISOString(),parentTaskId:ve||"",depth:Vt,childTaskIds:[],canDecompose:Ne??!ve,defaultPersonaId:Xe||""};return[...nt,Ca]}),Je&&Je()},[ne]),Mn=x.useCallback((Q,le,re,Se)=>{var nt;console.log("[MockGrackle] startTask",{taskId:Q});const ve=te.current.find(Ge=>Ge.id===Q),Xe=(ve==null?void 0:ve.title)??"",Ne=ne("sess"),Je={id:Ne,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:Xe||Q,startedAt:new Date().toISOString()};r(Ge=>[...Ge,Je]),b(Ge=>Ge.map(Gt=>Gt.id===Q?{...Gt,status:"working",latestSessionId:Ne,branch:`mock/${Q.slice(0,8)}`}:Gt));const we=I();if(console.log(`[MockGrackle] Playing task scenario: ${we.label}`),we.pauseForInput){const Ge=we.pauseAfterStep??we.steps.length-1,Gt=we.steps.slice(0,Ge+1),tn=Gt.length>0?Gt[Gt.length-1].delayMs:0;if(ie(Ne,Gt),K(()=>{oe(Ne,"idle"),j({sessionId:Ne,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},tn+gy,Ne),we.resumeSteps){const Vt=[...we.resumeSteps];ee.current.set(Ne,Vt);const Ca=Vt.reduce((vn,Ea)=>Math.max(vn,Ea.delayMs),0);z.current.set(Ne,{taskId:Q,delayAfterResume:Ca+200})}}else{const Ge=we.steps.length>0?we.steps[we.steps.length-1].delayMs:0;ie(Ne,we.steps);const Gt=(nt=we.steps[we.steps.length-1])==null?void 0:nt.event.content;K(()=>{Gt==="completed"?b(tn=>tn.map(Vt=>Vt.id===Q&&Vt.status==="working"?{...Vt,status:"paused"}:Vt)):Gt==="failed"&&b(tn=>tn.map(Vt=>Vt.id===Q&&Vt.status==="working"?{...Vt,status:"failed"}:Vt))},Ge+100,Ne)}},[ne,I,ie,K,oe,j]),Te=x.useCallback((Q,le)=>{console.log("[MockGrackle] sendInput",{sessionId:Q,text:le}),j({sessionId:Q,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${le}`}),oe(Q,"running"),j({sessionId:Q,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const re=ee.current.get(Q);if(re)ee.current.delete(Q),ie(Q,re);else{const ve=[{delayMs:500,event:{eventType:"output",timestamp:new Date().toISOString(),content:"I received your input, continuing..."}},{delayMs:1500,event:{eventType:"status",timestamp:new Date().toISOString(),content:"completed"}}];ie(Q,ve)}const Se=z.current.get(Q);Se&&(z.current.delete(Q),K(()=>{b(ve=>ve.map(Xe=>Xe.id===Se.taskId&&Xe.status==="working"?{...Xe,status:"paused"}:Xe))},Se.delayAfterResume,Q))},[j,oe,ie,K]),pt=x.useCallback(Q=>{console.log("[MockGrackle] completeTask",Q),b(le=>le.map(re=>re.id===Q?{...re,status:"complete"}:re))},[]),Un=x.useCallback(Q=>{console.log("[MockGrackle] resumeTask",Q)},[]),Ps=x.useCallback((Q,le,re,Se,ve)=>{console.log("[MockGrackle] updateTask",{taskId:Q,title:le}),b(Xe=>Xe.map(Ne=>Ne.id===Q?{...Ne,title:le.trim()||Ne.title,description:re,dependsOn:Se,...ve!==void 0?{defaultPersonaId:ve}:{}}:Ne))},[]),Gs=x.useCallback(Q=>{console.log("[MockGrackle] deleteTask",Q),b(le=>le.filter(re=>re.id!==Q))},[]),Nl=x.useCallback(Q=>{console.log("[MockGrackle] loadFindings",Q),T(py.filter(le=>le.workspaceId===Q))},[]),eo=x.useCallback((Q,le,re,Se,ve)=>{console.log("[MockGrackle] postFinding",{workspaceId:Q,title:le});const Xe={id:ne("find"),workspaceId:Q,taskId:"",sessionId:"",category:Se||"general",title:le,content:re,tags:ve||[],createdAt:new Date().toISOString()};T(Ne=>[...Ne,Xe])},[ne]),$s=x.useCallback((Q,le,re)=>{console.log("[MockGrackle] addEnvironment",{displayName:Q,adapterType:le,adapterConfig:re})},[]),Fs=x.useCallback((Q,le)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:Q,...le}),i(re=>re.map(Se=>Se.id!==Q?Se:{...Se,...le.displayName!==void 0?{displayName:le.displayName}:{},...le.adapterConfig!==void 0?{adapterConfig:JSON.stringify(le.adapterConfig)}:{}}))},[]),qs=x.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),jl=x.useCallback((Q,le,re,Se,ve)=>{console.log("[MockGrackle] setToken",{name:Q,tokenType:re}),N(Xe=>[...Xe.filter(Je=>Je.name!==Q),{name:Q,tokenType:re,envVar:Se,filePath:ve,expiresAt:""}])},[]),wl=x.useCallback(Q=>{console.log("[MockGrackle] deleteToken",Q),N(le=>le.filter(re=>re.name!==Q))},[]),zt=x.useCallback(Q=>{console.log("[MockGrackle] updateCredentialProviders",Q),w(Q)},[]);x.useEffect(()=>()=>{X.current.forEach(clearTimeout),X.current.clear()},[]);const Bc=x.useMemo(()=>({connected:!0,send:()=>{},environments:a,sessions:o,events:u,eventsDropped:0,lastSpawnedId:p,workspaces:g,tasks:y,findings:S,tokens:C,credentialProviders:E,spawn:pe,sendInput:Te,kill:ge,refresh:_e,loadSessionEvents:yt,clearEvents:fe,createWorkspace:Et,archiveWorkspace:mn,updateWorkspace:(Q,le)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:Q,...le}),v(re=>re.map(Se=>Se.id!==Q?Se:{...Se,...le.name!==void 0?{name:le.name}:{},...le.description!==void 0?{description:le.description}:{},...le.repoUrl!==void 0?{repoUrl:le.repoUrl}:{},...le.environmentId!==void 0?{environmentId:le.environmentId}:{},...le.worktreeBasePath!==void 0?{worktreeBasePath:le.worktreeBasePath}:{},...le.useWorktrees!==void 0?{useWorktrees:le.useWorktrees}:{},...le.defaultPersonaId!==void 0?{defaultPersonaId:le.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},loadTasks:gn,loadAllTasks:()=>{console.log("[MockGrackle] loadAllTasks")},createTask:ka,startTask:Mn,stopTask:Q=>{console.log("[MockGrackle] stopTask",{taskId:Q}),pt(Q)},completeTask:pt,resumeTask:Un,updateTask:Ps,deleteTask:Gs,loadFindings:Nl,postFinding:eo,addEnvironment:$s,updateEnvironment:Fs,loadTokens:qs,setToken:jl,deleteToken:wl,updateCredentialProviders:zt,provisionStatus:{},provisionEnvironment:()=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:R,createPersona:(Q,le,re,Se,ve,Xe,Ne,Je)=>{console.log("[MockGrackle] createPersona",{name:Q});const we={id:`mock-persona-${Date.now()}`,name:Q,description:le,systemPrompt:re,toolConfig:"{}",runtime:Se??"claude-code",model:ve||"",maxTurns:Xe||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:Ne||"agent",script:Je||""};M(nt=>[...nt,we])},updatePersona:(Q,le,re,Se,ve,Xe,Ne,Je,we)=>{console.log("[MockGrackle] updatePersona",{personaId:Q,name:le}),M(nt=>nt.map(Ge=>Ge.id!==Q?Ge:{...Ge,...le!==void 0?{name:le}:{},...re!==void 0?{description:re}:{},...Se!==void 0?{systemPrompt:Se}:{},...ve!==void 0?{runtime:ve}:{},...Xe!==void 0?{model:Xe}:{},...Ne!==void 0?{maxTurns:Ne}:{},...Je!==void 0?{type:Je}:{},...we!==void 0?{script:we}:{},updatedAt:new Date().toISOString()}))},deletePersona:Q=>{console.log("[MockGrackle] deletePersona",Q),M(le=>le.filter(re=>re.id!==Q))},taskSessions:A,loadTaskSessions:Q=>{console.log("[MockGrackle] loadTaskSessions",Q)},appDefaultPersonaId:$,setAppDefaultPersonaId:Q=>{console.log("[MockGrackle] setAppDefaultPersonaId",Q),V(Q)},onboardingCompleted:!0,completeOnboarding:()=>{console.log("[MockGrackle] completeOnboarding")},usageCache:{"workspace:proj-alpha":{inputTokens:214500,outputTokens:44850,costUsd:1.12,sessionCount:4},"workspace:proj-beta":{inputTokens:86700,outputTokens:23800,costUsd:.48,sessionCount:3},"task:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1},"task_tree:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task_tree:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1}},loadUsage:(Q,le)=>{console.log(`[MockGrackle] loadUsage(${Q}, ${le})`)},knowledge:{graphData:{nodes:[],links:[]},selectedNode:void 0,loading:!1,selectedId:void 0,searchQuery:"",search:()=>{},clearSearch:()=>{},selectNode:()=>{},clearSelection:()=>{},expandNode:()=>{},loadRecent:()=>{},handleMessage:()=>!1}}),[a,o,u,p,g,y,S,C,E,R,A,$,pe,Te,ge,_e,yt,fe,Et,mn,gn,ka,Mn,pt,Un,Ps,Gs,Nl,eo,$s,Fs,qs,jl,wl,zt]);return c.jsx(dh.Provider,{value:Bc,children:t})}const Cb=x.createContext(void 0),zC=4e3;function VC({children:t}){const[a,i]=x.useState([]),o=x.useRef(0),r=x.useCallback(d=>{i(p=>p.filter(m=>m.id!==d))},[]),u=x.useCallback((d,p="info",m=zC)=>{const g=`toast-${++o.current}`;i(v=>[...v,{id:g,message:d,variant:p,duration:m}])},[]);return c.jsx(Cb.Provider,{value:{toasts:a,showToast:u,dismissToast:r},children:t})}function zs(){const t=x.useContext(Cb);if(!t)throw new Error("useToast must be used within ToastProvider");return t}const Ec=[{id:"grackle",label:"Grackle",description:"The default Grackle theme — iridescent purple on clean dark.",swatches:["#0e1218","#8b5cf6","#60a5fa","#e5e7eb","#34d399"],variantLightId:"grackle-light",variantDarkId:"grackle-dark"},{id:"grackle-light",label:"Grackle Light",description:"Light Grackle variant.",hidden:!0},{id:"grackle-dark",label:"Grackle Dark",description:"Dark Grackle variant.",hidden:!0},{id:"glass",label:"Glassmorphism",description:"Dark frosted-glass aesthetic with backdrop blur effects.",swatches:["#0a0c14","#4ecca3","#70a1ff","#e2e8f0","#a855f7"]},{id:"matrix",label:"Matrix",description:"Phosphor-green CRT terminal with scanlines and glow.",swatches:["#050505","#00ff41","#00bfff","#33ff77","#ffb000"]},{id:"brutalist",label:"Neubrutalism",description:"Thick borders, raw colors, bold type — ugly on purpose.",swatches:["#f5f0e8","#ff5757","#5ce1e6","#1a1a1a","#ffde59"],variantLightId:"brutalist-light",variantDarkId:"brutalist-dark"},{id:"brutalist-light",label:"Neubrutalism Light",description:"Light neubrutalism variant.",hidden:!0},{id:"brutalist-dark",label:"Neubrutalism Dark",description:"Dark neubrutalism variant.",hidden:!0},{id:"monokai",label:"Monokai",description:"Classic warm editor palette — pink, green, and purple.",swatches:["#272822","#f92672","#a6e22e","#f8f8f2","#ae81ff"],variantLightId:"monokai-light",variantDarkId:"monokai-dark"},{id:"monokai-dark",label:"Monokai Dark",description:"Dark Monokai variant.",hidden:!0},{id:"monokai-light",label:"Monokai Light",description:"Light Monokai variant.",hidden:!0},{id:"ubuntu",label:"Ubuntu",description:"Aubergine terminal with the GNOME Tango palette.",swatches:["#300a24","#8ae234","#ef2929","#eeeeec","#fce94f"]},{id:"sandstone",label:"Sandstone",description:"Warm terracotta accent on dark brown, in the style of Claude Code.",swatches:["#1a1815","#C15F3C","#6b8afd","#e8e6e3","#a78bfa"]},{id:"verdigris",label:"Verdigris",description:"Teal accent on charcoal, in the style of ChatGPT.",swatches:["#141414","#00a67e","#3b82f6","#ececec","#ab68ff"]},{id:"primer",label:"Primer",description:"Blue accent on ink-dark grey, in the style of GitHub.",swatches:["#0d1117","#58a6ff","#3fb950","#c9d1d9","#bc8cff"]}],Eb=new Set(Ec.map(t=>t.id)),vy="grackle";function Nf(t){return Ec.find(a=>a.id===t)}const jf="grackle-theme",Nb="grackle-prefer-system",jb="(prefers-color-scheme: dark)";let Jo=[],sc;function nf(){sc=void 0;for(const t of Jo)t()}function wf(){return typeof window>"u"?!1:window.matchMedia(jb).matches}function ol(){if(typeof localStorage>"u")return vy;try{const t=localStorage.getItem(jf);if(t!==null&&Eb.has(t))return t}catch{}return vy}function uc(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(Nb)==="true"}catch{return!1}}function Af(t){return Ec.find(a=>a.variantLightId===t||a.variantDarkId===t)}function wb(t,a){const i=Nf(t);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?wf()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const o=Af(t);if(o!=null&&o.variantLightId&&o.variantDarkId)return wf()?o.variantDarkId:o.variantLightId}return t}function Oi(t,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=wb(t,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Oi(ol(),uc());function HC(){return sc===void 0&&(sc={themeId:ol(),systemDark:wf(),preferSystem:uc()}),sc}function PC(t){return Jo=[...Jo,t],()=>{Jo=Jo.filter(a=>a!==t)}}function GC(){const t=x.useSyncExternalStore(PC,HC),{themeId:a,preferSystem:i}=t,o=wb(a,i),r=x.useCallback(d=>{if(Eb.has(d)){try{localStorage.setItem(jf,d)}catch{}Oi(d,uc(),!0),nf()}},[]),u=x.useCallback(d=>{try{localStorage.setItem(Nb,d?"true":"false")}catch{}if(d){const p=ol(),m=Nf(p);if(m!=null&&m.hidden){const g=Af(p);if(g)try{localStorage.setItem(jf,g.id)}catch{}}}Oi(ol(),d,!0),nf()},[]);return x.useEffect(()=>{Oi(a,i)},[a,i]),x.useEffect(()=>{if(typeof window>"u")return;const d=window.matchMedia(jb),p=()=>{const m=ol(),g=uc();if(g){const v=Nf(m);if(v!=null&&v.variantDarkId&&v.variantLightId&&Oi(m,g),v!=null&&v.hidden){const y=Af(m);y!=null&&y.variantDarkId&&y.variantLightId&&Oi(m,g)}}nf()};return d.addEventListener("change",p),()=>{d.removeEventListener("change",p)}},[]),{themeId:a,setTheme:r,resolvedThemeId:o,preferSystem:i,setPreferSystem:u}}const Ab=x.createContext(void 0);function $C({children:t}){const a=GC();return c.jsx(Ab.Provider,{value:a,children:t})}function Db(){const t=x.useContext(Ab);if(!t)throw new Error("useThemeContext must be used within ThemeProvider");return t}const FC="_container_1mq5u_1",qC="_hamburger_1mq5u_33",KC="_brand_1mq5u_49",YC="_brandLogo_1mq5u_68",ZC="_info_1mq5u_75",XC="_connectionLabel_1mq5u_90",QC="_connectionDot_1mq5u_103",WC="_connected_1mq5u_106",JC="_disconnected_1mq5u_110",ga={container:FC,hamburger:qC,brand:KC,brandLogo:YC,info:ZC,connectionLabel:XC,connectionDot:QC,connected:WC,disconnected:JC};function eE({onToggleSidebar:t,sidebarOpen:a}){const{connected:i,environments:o,sessions:r}=We(),u=Rt(),d=o.length,p=o.filter(g=>g.status==="connected").length,m=r.filter(g=>["running","idle"].includes(g.status)).length;return c.jsxs("div",{className:ga.container,children:[t&&c.jsx("button",{type:"button",className:ga.hamburger,onClick:t,"aria-label":"Toggle sidebar","aria-expanded":a,children:"☰"}),c.jsxs("button",{type:"button",className:ga.brand,onClick:()=>u(Bs),title:"Home",children:[c.jsx("img",{src:"/icon-192x192.png",alt:"",className:ga.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]}),c.jsxs("div",{className:ga.info,children:[c.jsxs("span",{"aria-label":i?"Connected":"Disconnected",children:[c.jsx("span",{className:`${ga.connectionDot} ${i?ga.connected:ga.disconnected}`,"aria-hidden":"true",children:"●"})," ",c.jsx("span",{className:ga.connectionLabel,"aria-hidden":"true",children:i?"Connected":"Disconnected"})]}),c.jsxs("span",{children:[p,"/",d," env",d!==1?"s":""]}),c.jsxs("span",{children:[m," active"]})]})]})}const tE="_nav_13gkc_1",nE="_tab_13gkc_35",aE="_tabIcon_13gkc_68",sE="_tabLabel_13gkc_79",iE="_tabActive_13gkc_84",Zo={nav:tE,tab:nE,tabIcon:aE,tabLabel:sE,tabActive:iE},Es=[{view:"dashboard",label:"Dashboard",icon:"🏠",route:Bs,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:"💬",route:uC,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:"📋",route:dC,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:"🖥️",route:Pi,testId:"sidebar-tab-environments"},{view:"knowledge",label:"Knowledge",icon:"🧠",route:kb,testId:"sidebar-tab-knowledge"},{view:"settings",label:"Settings",icon:"⚙️",route:rC,testId:"sidebar-tab-settings"}];function oE(t){return t===Bs||t==="/"?"dashboard":t.startsWith("/chat")||t.startsWith("/sessions")?"chat":t.startsWith("/workspaces")||t.startsWith("/environments")?"environments":t.startsWith(kb)?"knowledge":t.startsWith(il)?"settings":"tasks"}function lE(){const t=wt(),a=Rt(),i=x.useRef(null),o=oE(t.pathname),r=x.useCallback(d=>{a(d.route)},[a]),u=x.useCallback(d=>{var y,b;const p=(y=i.current)==null?void 0:y.querySelectorAll('[role="tab"]');if(!p)return;const m=Array.from(p).findIndex(S=>S===document.activeElement),g=m>=0?m:Es.findIndex(S=>S.view===o);let v=g;if(d.key==="ArrowRight")d.preventDefault(),v=(g+1)%Es.length;else if(d.key==="ArrowLeft")d.preventDefault(),v=(g-1+Es.length)%Es.length;else if(d.key==="Home")d.preventDefault(),v=0;else if(d.key==="End")d.preventDefault(),v=Es.length-1;else return;a(Es[v].route),(b=p[v])==null||b.focus()},[o,a]);return c.jsx("nav",{className:Zo.nav,ref:i,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:u,"data-testid":"sidebar-nav",children:Es.map(d=>{const p=d.view===o;return c.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${Zo.tab} ${p?Zo.tabActive:""}`,onClick:()=>r(d),"data-testid":d.testId,title:d.label,"aria-label":d.label,children:[c.jsx("span",{className:Zo.tabIcon,"aria-hidden":"true",children:d.icon}),c.jsx("span",{className:Zo.tabLabel,children:d.label})]},d.view)})})}const Rb=x.createContext(void 0),Mb=x.createContext(void 0);function rE({children:t}){const[a,i]=x.useState(void 0),o=x.useCallback(r=>{i(r)},[]);return c.jsx(Mb.Provider,{value:o,children:c.jsx(Rb.Provider,{value:a,children:t})})}function Ob(){return x.useContext(Rb)}function cE(){const t=x.useContext(Mb);if(t===void 0)throw new Error("useSidebarSetter must be used within a SidebarProvider");return t}const uE="_container_pi6ii_1",dE="_content_pi6ii_66",yy={container:uE,content:dE},fE=320,Bb=220,Ib=600,Lb="grackle-sidebar-width";function hE(){try{const t=localStorage.getItem(Lb);if(t!==null){const a=Number(t);if(Number.isFinite(a)&&a>=Bb&&a<=Ib)return a}}catch{}return fE}function pE(t){try{localStorage.setItem(Lb,String(t))}catch{}}function mE(){const[t]=x.useState(hE),a=x.useRef(null),i=Ob();if(x.useEffect(()=>{const o=a.current;if(!o)return;const r=new ResizeObserver(u=>{for(const d of u){const p=d.borderBoxSize[0];if(p){const m=Math.round(p.inlineSize);m>=Bb&&m<=Ib&&pE(m)}}});return r.observe(o),()=>{r.disconnect()}},[]),i!==void 0)return c.jsx("div",{className:yy.container,ref:a,"data-testid":"sidebar",style:{width:t},children:c.jsx("div",{className:yy.content,children:i})})}function Nc(t){const a=cE();x.useLayoutEffect(()=>(a(t),()=>{a(void 0)}),[t,a])}const fh=x.createContext({});function hh(t){const a=x.useRef(null);return a.current===null&&(a.current=t()),a.current}const jc=x.createContext(null),ph=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class gE extends x.Component{getSnapshotBeforeUpdate(a){const i=this.props.childRef.current;if(i&&a.isPresent&&!this.props.isPresent){const o=this.props.sizeRef.current;o.height=i.offsetHeight||0,o.width=i.offsetWidth||0,o.top=i.offsetTop,o.left=i.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function vE({children:t,isPresent:a}){const i=x.useId(),o=x.useRef(null),r=x.useRef({width:0,height:0,top:0,left:0}),{nonce:u}=x.useContext(ph);return x.useInsertionEffect(()=>{const{width:d,height:p,top:m,left:g}=r.current;if(a||!o.current||!d||!p)return;o.current.dataset.motionPopId=i;const v=document.createElement("style");return u&&(v.nonce=u),document.head.appendChild(v),v.sheet&&v.sheet.insertRule(`
90
+ The billing service depends on a Stripe client that doesn't exist in this environment.`}},{delayMs:3500,event:{eventType:"status",timestamp:jt(3500),content:"failed"}}]}],gy=400;function UC({children:t}){const[a,i]=x.useState(AC),[o,r]=x.useState(DC),[u,d]=x.useState(RC),[p,m]=x.useState(void 0),[g,v]=x.useState(MC),[y,b]=x.useState(OC),[S,T]=x.useState(py),[C,N]=x.useState(BC),[E,w]=x.useState({claude:"off",github:"off",copilot:"off",codex:"off",goose:"off"}),[R,M]=x.useState(IC),[A]=x.useState(LC),[$,V]=x.useState(""),B=x.useRef(0),F=x.useRef(0),X=x.useRef(new Set),J=x.useRef(new Map),te=x.useRef(y);te.current=y;const ee=x.useRef(new Map),z=x.useRef(new Map),ne=x.useCallback(Q=>(B.current+=1,`mock-${Q}-${String(B.current).padStart(3,"0")}`),[]),I=x.useCallback(()=>{const Q=my[F.current%my.length];return F.current+=1,Q},[]),K=x.useCallback((Q,le,re)=>{const Se=setTimeout(()=>{var ve;X.current.delete(Se),re&&((ve=J.current.get(re))==null||ve.delete(Se)),Q()},le);X.current.add(Se),re&&(J.current.has(re)||J.current.set(re,new Set),J.current.get(re).add(Se))},[]),se=x.useCallback(Q=>{const le=J.current.get(Q);le&&(le.forEach(re=>{clearTimeout(re),X.current.delete(re)}),J.current.delete(Q))},[]),oe=x.useCallback((Q,le,re)=>{r(Se=>Se.map(ve=>ve.id===Q?{...ve,status:le,...re!==void 0?{endReason:re}:{}}:ve))},[]),j=x.useCallback(Q=>{d(le=>[...le,Q])},[]),ie=x.useCallback((Q,le,re)=>{le.forEach((Se,ve)=>{K(()=>{const Xe={sessionId:Q,...Se.event,timestamp:new Date().toISOString()};if(j(Xe),Se.event.eventType==="status"){const Ne=tb(Se.event.content),Je=nb(Se.event.content);oe(Q,Ne,Je)}ve===le.length-1&&re&&re()},Se.delayMs,Q)})},[K,j,oe]),pe=x.useCallback((Q,le,re,Se)=>{console.log("[MockGrackle] spawn",{environmentId:Q,prompt:le,runtime:Se});const ve=ne("sess"),Xe={id:ve,environmentId:Q,runtime:Se||"claude-code",status:"running",prompt:le,startedAt:new Date().toISOString()};r(Je=>[...Je,Xe]),m(ve);const Ne=I();if(console.log(`[MockGrackle] Playing scenario: ${Ne.label}`),Ne.pauseForInput){const Je=Ne.pauseAfterStep??Ne.steps.length-1,we=Ne.steps.slice(0,Je+1),nt=we.length>0?we[we.length-1].delayMs:0;ie(ve,we),K(()=>{oe(ve,"idle"),j({sessionId:ve,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},nt+gy,ve),Ne.resumeSteps&&ee.current.set(ve,Ne.resumeSteps)}else ie(ve,Ne.steps)},[ne,I,ie,K,oe,j]),ge=x.useCallback(Q=>{console.log("[MockGrackle] kill",Q),se(Q),ee.current.delete(Q),oe(Q,"stopped","killed"),j({sessionId:Q,eventType:"status",timestamp:new Date().toISOString(),content:"killed"}),b(le=>le.map(re=>re.latestSessionId===Q&&re.status==="working"?{...re,status:"not_started"}:re))},[se,oe,j]),_e=x.useCallback(()=>{console.log("[MockGrackle] refresh")},[]),yt=x.useCallback(Q=>{console.log("[MockGrackle] loadSessionEvents",Q)},[]),fe=x.useCallback(()=>{console.log("[MockGrackle] clearEvents"),d([])},[]),Et=x.useCallback((Q,le,re,Se,ve,Xe,Ne,Je,we)=>{console.log("[MockGrackle] createWorkspace",{name:Q,description:le});const nt={id:ne("proj"),name:Q,description:le||"",repoUrl:re||"",environmentId:Se||"",status:"active",worktreeBasePath:Ne||"",useWorktrees:Xe??!0,defaultPersonaId:ve||"",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};v(Ge=>[...Ge,nt]),Je&&Je()},[ne]),mn=x.useCallback(Q=>{console.log("[MockGrackle] archiveWorkspace",Q),v(le=>le.map(re=>re.id===Q?{...re,status:"archived"}:re))},[]),gn=x.useCallback(Q=>{console.log("[MockGrackle] loadTasks",Q)},[]),ka=x.useCallback((Q,le,re,Se,ve,Xe,Ne,Je,we)=>{console.log("[MockGrackle] createTask",{workspaceId:Q,title:le,parentTaskId:ve}),b(nt=>{const Gt=nt.filter(vn=>vn.workspaceId===Q).reduce((vn,Ea)=>Math.max(vn,Ea.sortOrder),0),tn=ve?nt.find(vn=>vn.id===ve):void 0;if(ve&&!tn)return console.warn("[MockGrackle] Parent task not found:",ve),nt;if(tn&&!tn.canDecompose)return console.warn("[MockGrackle] Parent task does not have decomposition rights:",ve),nt;const Vt=tn?tn.depth+1:0,Ca={id:ne("task"),workspaceId:Q,title:le,description:re||"",status:"not_started",branch:"",latestSessionId:"",dependsOn:Se||[],reviewNotes:void 0,sortOrder:Gt+1,createdAt:new Date().toISOString(),parentTaskId:ve||"",depth:Vt,childTaskIds:[],canDecompose:Ne??!ve,defaultPersonaId:Xe||""};return[...nt,Ca]}),Je&&Je()},[ne]),Mn=x.useCallback((Q,le,re,Se)=>{var nt;console.log("[MockGrackle] startTask",{taskId:Q});const ve=te.current.find(Ge=>Ge.id===Q),Xe=(ve==null?void 0:ve.title)??"",Ne=ne("sess"),Je={id:Ne,environmentId:"env-local-01",runtime:"claude-code",status:"running",prompt:Xe||Q,startedAt:new Date().toISOString()};r(Ge=>[...Ge,Je]),b(Ge=>Ge.map(Gt=>Gt.id===Q?{...Gt,status:"working",latestSessionId:Ne,branch:`mock/${Q.slice(0,8)}`}:Gt));const we=I();if(console.log(`[MockGrackle] Playing task scenario: ${we.label}`),we.pauseForInput){const Ge=we.pauseAfterStep??we.steps.length-1,Gt=we.steps.slice(0,Ge+1),tn=Gt.length>0?Gt[Gt.length-1].delayMs:0;if(ie(Ne,Gt),K(()=>{oe(Ne,"idle"),j({sessionId:Ne,eventType:"status",timestamp:new Date().toISOString(),content:"idle"})},tn+gy,Ne),we.resumeSteps){const Vt=[...we.resumeSteps];ee.current.set(Ne,Vt);const Ca=Vt.reduce((vn,Ea)=>Math.max(vn,Ea.delayMs),0);z.current.set(Ne,{taskId:Q,delayAfterResume:Ca+200})}}else{const Ge=we.steps.length>0?we.steps[we.steps.length-1].delayMs:0;ie(Ne,we.steps);const Gt=(nt=we.steps[we.steps.length-1])==null?void 0:nt.event.content;K(()=>{Gt==="completed"?b(tn=>tn.map(Vt=>Vt.id===Q&&Vt.status==="working"?{...Vt,status:"paused"}:Vt)):Gt==="failed"&&b(tn=>tn.map(Vt=>Vt.id===Q&&Vt.status==="working"?{...Vt,status:"failed"}:Vt))},Ge+100,Ne)}},[ne,I,ie,K,oe,j]),Te=x.useCallback((Q,le)=>{console.log("[MockGrackle] sendInput",{sessionId:Q,text:le}),j({sessionId:Q,eventType:"output",timestamp:new Date().toISOString(),content:`User input: ${le}`}),oe(Q,"running"),j({sessionId:Q,eventType:"status",timestamp:new Date().toISOString(),content:"running"});const re=ee.current.get(Q);if(re)ee.current.delete(Q),ie(Q,re);else{const ve=[{delayMs:500,event:{eventType:"output",timestamp:new Date().toISOString(),content:"I received your input, continuing..."}},{delayMs:1500,event:{eventType:"status",timestamp:new Date().toISOString(),content:"completed"}}];ie(Q,ve)}const Se=z.current.get(Q);Se&&(z.current.delete(Q),K(()=>{b(ve=>ve.map(Xe=>Xe.id===Se.taskId&&Xe.status==="working"?{...Xe,status:"paused"}:Xe))},Se.delayAfterResume,Q))},[j,oe,ie,K]),pt=x.useCallback(Q=>{console.log("[MockGrackle] completeTask",Q),b(le=>le.map(re=>re.id===Q?{...re,status:"complete"}:re))},[]),Un=x.useCallback(Q=>{console.log("[MockGrackle] resumeTask",Q)},[]),Ps=x.useCallback((Q,le,re,Se,ve)=>{console.log("[MockGrackle] updateTask",{taskId:Q,title:le}),b(Xe=>Xe.map(Ne=>Ne.id===Q?{...Ne,title:le.trim()||Ne.title,description:re,dependsOn:Se,...ve!==void 0?{defaultPersonaId:ve}:{}}:Ne))},[]),Gs=x.useCallback(Q=>{console.log("[MockGrackle] deleteTask",Q),b(le=>le.filter(re=>re.id!==Q))},[]),Nl=x.useCallback(Q=>{console.log("[MockGrackle] loadFindings",Q),T(py.filter(le=>le.workspaceId===Q))},[]),eo=x.useCallback((Q,le,re,Se,ve)=>{console.log("[MockGrackle] postFinding",{workspaceId:Q,title:le});const Xe={id:ne("find"),workspaceId:Q,taskId:"",sessionId:"",category:Se||"general",title:le,content:re,tags:ve||[],createdAt:new Date().toISOString()};T(Ne=>[...Ne,Xe])},[ne]),$s=x.useCallback((Q,le,re)=>{console.log("[MockGrackle] addEnvironment",{displayName:Q,adapterType:le,adapterConfig:re})},[]),Fs=x.useCallback((Q,le)=>{console.log("[MockGrackle] updateEnvironment",{environmentId:Q,...le}),i(re=>re.map(Se=>Se.id!==Q?Se:{...Se,...le.displayName!==void 0?{displayName:le.displayName}:{},...le.adapterConfig!==void 0?{adapterConfig:JSON.stringify(le.adapterConfig)}:{}}))},[]),qs=x.useCallback(()=>{console.log("[MockGrackle] loadTokens")},[]),jl=x.useCallback((Q,le,re,Se,ve)=>{console.log("[MockGrackle] setToken",{name:Q,tokenType:re}),N(Xe=>[...Xe.filter(Je=>Je.name!==Q),{name:Q,tokenType:re,envVar:Se,filePath:ve,expiresAt:""}])},[]),wl=x.useCallback(Q=>{console.log("[MockGrackle] deleteToken",Q),N(le=>le.filter(re=>re.name!==Q))},[]),zt=x.useCallback(Q=>{console.log("[MockGrackle] updateCredentialProviders",Q),w(Q)},[]);x.useEffect(()=>()=>{X.current.forEach(clearTimeout),X.current.clear()},[]);const Bc=x.useMemo(()=>({connected:!0,send:()=>{},environments:a,sessions:o,events:u,eventsDropped:0,lastSpawnedId:p,workspaces:g,tasks:y,findings:S,tokens:C,credentialProviders:E,spawn:pe,sendInput:Te,kill:ge,refresh:_e,loadSessionEvents:yt,clearEvents:fe,createWorkspace:Et,archiveWorkspace:mn,updateWorkspace:(Q,le)=>{console.log("[MockGrackle] updateWorkspace",{workspaceId:Q,...le}),v(re=>re.map(Se=>Se.id!==Q?Se:{...Se,...le.name!==void 0?{name:le.name}:{},...le.description!==void 0?{description:le.description}:{},...le.repoUrl!==void 0?{repoUrl:le.repoUrl}:{},...le.environmentId!==void 0?{environmentId:le.environmentId}:{},...le.worktreeBasePath!==void 0?{worktreeBasePath:le.worktreeBasePath}:{},...le.useWorktrees!==void 0?{useWorktrees:le.useWorktrees}:{},...le.defaultPersonaId!==void 0?{defaultPersonaId:le.defaultPersonaId}:{},updatedAt:new Date().toISOString()}))},loadTasks:gn,loadAllTasks:()=>{console.log("[MockGrackle] loadAllTasks")},createTask:ka,startTask:Mn,stopTask:Q=>{console.log("[MockGrackle] stopTask",{taskId:Q}),pt(Q)},completeTask:pt,resumeTask:Un,updateTask:Ps,deleteTask:Gs,loadFindings:Nl,postFinding:eo,addEnvironment:$s,updateEnvironment:Fs,loadTokens:qs,setToken:jl,deleteToken:wl,updateCredentialProviders:zt,provisionStatus:{},provisionEnvironment:()=>{},stopEnvironment:()=>{},removeEnvironment:()=>{},codespaces:[],codespaceError:"",codespaceListError:"",codespaceCreating:!1,listCodespaces:()=>{},createCodespace:()=>{},workspaceCreating:!1,taskStartingId:void 0,personas:R,createPersona:(Q,le,re,Se,ve,Xe,Ne,Je)=>{console.log("[MockGrackle] createPersona",{name:Q});const we={id:`mock-persona-${Date.now()}`,name:Q,description:le,systemPrompt:re,toolConfig:"{}",runtime:Se??"claude-code",model:ve||"",maxTurns:Xe||0,mcpServers:"[]",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),type:Ne||"agent",script:Je||""};M(nt=>[...nt,we])},updatePersona:(Q,le,re,Se,ve,Xe,Ne,Je,we)=>{console.log("[MockGrackle] updatePersona",{personaId:Q,name:le}),M(nt=>nt.map(Ge=>Ge.id!==Q?Ge:{...Ge,...le!==void 0?{name:le}:{},...re!==void 0?{description:re}:{},...Se!==void 0?{systemPrompt:Se}:{},...ve!==void 0?{runtime:ve}:{},...Xe!==void 0?{model:Xe}:{},...Ne!==void 0?{maxTurns:Ne}:{},...Je!==void 0?{type:Je}:{},...we!==void 0?{script:we}:{},updatedAt:new Date().toISOString()}))},deletePersona:Q=>{console.log("[MockGrackle] deletePersona",Q),M(le=>le.filter(re=>re.id!==Q))},taskSessions:A,loadTaskSessions:Q=>{console.log("[MockGrackle] loadTaskSessions",Q)},appDefaultPersonaId:$,setAppDefaultPersonaId:Q=>{console.log("[MockGrackle] setAppDefaultPersonaId",Q),V(Q)},onboardingCompleted:!0,completeOnboarding:()=>{console.log("[MockGrackle] completeOnboarding")},usageCache:{"workspace:proj-alpha":{inputTokens:214500,outputTokens:44850,costUsd:1.12,sessionCount:4},"workspace:proj-beta":{inputTokens:86700,outputTokens:23800,costUsd:.48,sessionCount:3},"task:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1},"task_tree:task-001":{inputTokens:126800,outputTokens:20850,costUsd:.63,sessionCount:2},"task_tree:task-006":{inputTokens:18900,outputTokens:4500,costUsd:.1,sessionCount:1}},loadUsage:(Q,le)=>{console.log(`[MockGrackle] loadUsage(${Q}, ${le})`)},knowledge:{graphData:{nodes:[],links:[]},selectedNode:void 0,loading:!1,selectedId:void 0,searchQuery:"",search:()=>{},clearSearch:()=>{},selectNode:()=>{},clearSelection:()=>{},expandNode:()=>{},loadRecent:()=>{},handleMessage:()=>!1}}),[a,o,u,p,g,y,S,C,E,R,A,$,pe,Te,ge,_e,yt,fe,Et,mn,gn,ka,Mn,pt,Un,Ps,Gs,Nl,eo,$s,Fs,qs,jl,wl,zt]);return c.jsx(dh.Provider,{value:Bc,children:t})}const Cb=x.createContext(void 0),zC=4e3;function VC({children:t}){const[a,i]=x.useState([]),o=x.useRef(0),r=x.useCallback(d=>{i(p=>p.filter(m=>m.id!==d))},[]),u=x.useCallback((d,p="info",m=zC)=>{const g=`toast-${++o.current}`;i(v=>[...v,{id:g,message:d,variant:p,duration:m}])},[]);return c.jsx(Cb.Provider,{value:{toasts:a,showToast:u,dismissToast:r},children:t})}function zs(){const t=x.useContext(Cb);if(!t)throw new Error("useToast must be used within ToastProvider");return t}const Ec=[{id:"grackle",label:"Grackle",description:"The default Grackle theme — iridescent purple on clean dark.",swatches:["#0e1218","#8b5cf6","#60a5fa","#e5e7eb","#34d399"],variantLightId:"grackle-light",variantDarkId:"grackle-dark"},{id:"grackle-light",label:"Grackle Light",description:"Light Grackle variant.",hidden:!0},{id:"grackle-dark",label:"Grackle Dark",description:"Dark Grackle variant.",hidden:!0},{id:"glass",label:"Glassmorphism",description:"Dark frosted-glass aesthetic with backdrop blur effects.",swatches:["#0a0c14","#4ecca3","#70a1ff","#e2e8f0","#a855f7"]},{id:"matrix",label:"Matrix",description:"Phosphor-green CRT terminal with scanlines and glow.",swatches:["#050505","#00ff41","#00bfff","#33ff77","#ffb000"]},{id:"brutalist",label:"Neubrutalism",description:"Thick borders, raw colors, bold type — ugly on purpose.",swatches:["#f5f0e8","#ff5757","#5ce1e6","#1a1a1a","#ffde59"],variantLightId:"brutalist-light",variantDarkId:"brutalist-dark"},{id:"brutalist-light",label:"Neubrutalism Light",description:"Light neubrutalism variant.",hidden:!0},{id:"brutalist-dark",label:"Neubrutalism Dark",description:"Dark neubrutalism variant.",hidden:!0},{id:"monokai",label:"Monokai",description:"Classic warm editor palette — pink, green, and purple.",swatches:["#272822","#f92672","#a6e22e","#f8f8f2","#ae81ff"],variantLightId:"monokai-light",variantDarkId:"monokai-dark"},{id:"monokai-dark",label:"Monokai Dark",description:"Dark Monokai variant.",hidden:!0},{id:"monokai-light",label:"Monokai Light",description:"Light Monokai variant.",hidden:!0},{id:"ubuntu",label:"Ubuntu",description:"Aubergine terminal with the GNOME Tango palette.",swatches:["#300a24","#8ae234","#ef2929","#eeeeec","#fce94f"]},{id:"sandstone",label:"Sandstone",description:"Warm terracotta accent on dark brown, in the style of Claude Code.",swatches:["#1a1815","#C15F3C","#6b8afd","#e8e6e3","#a78bfa"]},{id:"verdigris",label:"Verdigris",description:"Teal accent on charcoal, in the style of ChatGPT.",swatches:["#141414","#00a67e","#3b82f6","#ececec","#ab68ff"]},{id:"primer",label:"Primer",description:"Blue accent on ink-dark grey, in the style of GitHub.",swatches:["#0d1117","#58a6ff","#3fb950","#c9d1d9","#bc8cff"]}],Eb=new Set(Ec.map(t=>t.id)),vy="grackle";function Nf(t){return Ec.find(a=>a.id===t)}const jf="grackle-theme",Nb="grackle-prefer-system",jb="(prefers-color-scheme: dark)";let Jo=[],sc;function nf(){sc=void 0;for(const t of Jo)t()}function wf(){return typeof window>"u"?!1:window.matchMedia(jb).matches}function ol(){if(typeof localStorage>"u")return vy;try{const t=localStorage.getItem(jf);if(t!==null&&Eb.has(t))return t}catch{}return vy}function uc(){if(typeof localStorage>"u")return!1;try{return localStorage.getItem(Nb)==="true"}catch{return!1}}function Af(t){return Ec.find(a=>a.variantLightId===t||a.variantDarkId===t)}function wb(t,a){const i=Nf(t);if(i!=null&&i.variantDarkId)return a&&i.variantLightId?wf()?i.variantDarkId:i.variantLightId:i.variantDarkId;if(i!=null&&i.hidden&&a){const o=Af(t);if(o!=null&&o.variantLightId&&o.variantDarkId)return wf()?o.variantDarkId:o.variantLightId}return t}function Oi(t,a,i=!1){i&&document.documentElement.classList.add("no-transitions"),document.documentElement.dataset.theme=wb(t,a),i&&(document.documentElement.offsetHeight,requestAnimationFrame(()=>{document.documentElement.classList.remove("no-transitions")}))}typeof document<"u"&&Oi(ol(),uc());function HC(){return sc===void 0&&(sc={themeId:ol(),systemDark:wf(),preferSystem:uc()}),sc}function PC(t){return Jo=[...Jo,t],()=>{Jo=Jo.filter(a=>a!==t)}}function GC(){const t=x.useSyncExternalStore(PC,HC),{themeId:a,preferSystem:i}=t,o=wb(a,i),r=x.useCallback(d=>{if(Eb.has(d)){try{localStorage.setItem(jf,d)}catch{}Oi(d,uc(),!0),nf()}},[]),u=x.useCallback(d=>{try{localStorage.setItem(Nb,d?"true":"false")}catch{}if(d){const p=ol(),m=Nf(p);if(m!=null&&m.hidden){const g=Af(p);if(g)try{localStorage.setItem(jf,g.id)}catch{}}}Oi(ol(),d,!0),nf()},[]);return x.useEffect(()=>{Oi(a,i)},[a,i]),x.useEffect(()=>{if(typeof window>"u")return;const d=window.matchMedia(jb),p=()=>{const m=ol(),g=uc();if(g){const v=Nf(m);if(v!=null&&v.variantDarkId&&v.variantLightId&&Oi(m,g),v!=null&&v.hidden){const y=Af(m);y!=null&&y.variantDarkId&&y.variantLightId&&Oi(m,g)}}nf()};return d.addEventListener("change",p),()=>{d.removeEventListener("change",p)}},[]),{themeId:a,setTheme:r,resolvedThemeId:o,preferSystem:i,setPreferSystem:u}}const Ab=x.createContext(void 0);function $C({children:t}){const a=GC();return c.jsx(Ab.Provider,{value:a,children:t})}function Db(){const t=x.useContext(Ab);if(!t)throw new Error("useThemeContext must be used within ThemeProvider");return t}const FC="_container_1mq5u_1",qC="_hamburger_1mq5u_33",KC="_brand_1mq5u_49",YC="_brandLogo_1mq5u_68",ZC="_info_1mq5u_75",XC="_connectionLabel_1mq5u_90",QC="_connectionDot_1mq5u_103",WC="_connected_1mq5u_106",JC="_disconnected_1mq5u_110",ga={container:FC,hamburger:qC,brand:KC,brandLogo:YC,info:ZC,connectionLabel:XC,connectionDot:QC,connected:WC,disconnected:JC};function eE({connected:t,environments:a,sessions:i,onToggleSidebar:o,sidebarOpen:r}){const u=Rt(),d=a.length,p=a.filter(g=>g.status==="connected").length,m=i.filter(g=>["running","idle"].includes(g.status)).length;return c.jsxs("div",{className:ga.container,children:[o&&c.jsx("button",{type:"button",className:ga.hamburger,onClick:o,"aria-label":"Toggle sidebar","aria-expanded":r,children:"☰"}),c.jsxs("button",{type:"button",className:ga.brand,onClick:()=>u(Bs),title:"Home",children:[c.jsx("img",{src:"/icon-192x192.png",alt:"",className:ga.brandLogo,"aria-hidden":"true","data-testid":"statusbar-logo"}),"Grackle"]}),c.jsxs("div",{className:ga.info,children:[c.jsxs("span",{"aria-label":t?"Connected":"Disconnected",children:[c.jsx("span",{className:`${ga.connectionDot} ${t?ga.connected:ga.disconnected}`,"aria-hidden":"true",children:"●"})," ",c.jsx("span",{className:ga.connectionLabel,"aria-hidden":"true",children:t?"Connected":"Disconnected"})]}),c.jsxs("span",{children:[p,"/",d," env",d!==1?"s":""]}),c.jsxs("span",{children:[m," active"]})]})]})}const tE="_nav_13gkc_1",nE="_tab_13gkc_35",aE="_tabIcon_13gkc_68",sE="_tabLabel_13gkc_79",iE="_tabActive_13gkc_84",Zo={nav:tE,tab:nE,tabIcon:aE,tabLabel:sE,tabActive:iE},Es=[{view:"dashboard",label:"Dashboard",icon:"🏠",route:Bs,testId:"sidebar-tab-dashboard"},{view:"chat",label:"Chat",icon:"💬",route:uC,testId:"sidebar-tab-chat"},{view:"tasks",label:"Tasks",icon:"📋",route:dC,testId:"sidebar-tab-tasks"},{view:"environments",label:"Environments",icon:"🖥️",route:Pi,testId:"sidebar-tab-environments"},{view:"knowledge",label:"Knowledge",icon:"🧠",route:kb,testId:"sidebar-tab-knowledge"},{view:"settings",label:"Settings",icon:"⚙️",route:rC,testId:"sidebar-tab-settings"}];function oE(t){return t===Bs||t==="/"?"dashboard":t.startsWith("/chat")||t.startsWith("/sessions")?"chat":t.startsWith("/workspaces")||t.startsWith("/environments")?"environments":t.startsWith(kb)?"knowledge":t.startsWith(il)?"settings":"tasks"}function lE(){const t=wt(),a=Rt(),i=x.useRef(null),o=oE(t.pathname),r=x.useCallback(d=>{a(d.route)},[a]),u=x.useCallback(d=>{var y,b;const p=(y=i.current)==null?void 0:y.querySelectorAll('[role="tab"]');if(!p)return;const m=Array.from(p).findIndex(S=>S===document.activeElement),g=m>=0?m:Es.findIndex(S=>S.view===o);let v=g;if(d.key==="ArrowRight")d.preventDefault(),v=(g+1)%Es.length;else if(d.key==="ArrowLeft")d.preventDefault(),v=(g-1+Es.length)%Es.length;else if(d.key==="Home")d.preventDefault(),v=0;else if(d.key==="End")d.preventDefault(),v=Es.length-1;else return;a(Es[v].route),(b=p[v])==null||b.focus()},[o,a]);return c.jsx("nav",{className:Zo.nav,ref:i,role:"tablist","aria-orientation":"horizontal","aria-label":"App navigation",onKeyDown:u,"data-testid":"sidebar-nav",children:Es.map(d=>{const p=d.view===o;return c.jsxs("button",{role:"tab",type:"button","aria-selected":p,tabIndex:p?0:-1,className:`${Zo.tab} ${p?Zo.tabActive:""}`,onClick:()=>r(d),"data-testid":d.testId,title:d.label,"aria-label":d.label,children:[c.jsx("span",{className:Zo.tabIcon,"aria-hidden":"true",children:d.icon}),c.jsx("span",{className:Zo.tabLabel,children:d.label})]},d.view)})})}const Rb=x.createContext(void 0),Mb=x.createContext(void 0);function rE({children:t}){const[a,i]=x.useState(void 0),o=x.useCallback(r=>{i(r)},[]);return c.jsx(Mb.Provider,{value:o,children:c.jsx(Rb.Provider,{value:a,children:t})})}function Ob(){return x.useContext(Rb)}function cE(){const t=x.useContext(Mb);if(t===void 0)throw new Error("useSidebarSetter must be used within a SidebarProvider");return t}const uE="_container_pi6ii_1",dE="_content_pi6ii_66",yy={container:uE,content:dE},fE=320,Bb=220,Ib=600,Lb="grackle-sidebar-width";function hE(){try{const t=localStorage.getItem(Lb);if(t!==null){const a=Number(t);if(Number.isFinite(a)&&a>=Bb&&a<=Ib)return a}}catch{}return fE}function pE(t){try{localStorage.setItem(Lb,String(t))}catch{}}function mE(){const[t]=x.useState(hE),a=x.useRef(null),i=Ob();if(x.useEffect(()=>{const o=a.current;if(!o)return;const r=new ResizeObserver(u=>{for(const d of u){const p=d.borderBoxSize[0];if(p){const m=Math.round(p.inlineSize);m>=Bb&&m<=Ib&&pE(m)}}});return r.observe(o),()=>{r.disconnect()}},[]),i!==void 0)return c.jsx("div",{className:yy.container,ref:a,"data-testid":"sidebar",style:{width:t},children:c.jsx("div",{className:yy.content,children:i})})}function Nc(t){const a=cE();x.useLayoutEffect(()=>(a(t),()=>{a(void 0)}),[t,a])}const fh=x.createContext({});function hh(t){const a=x.useRef(null);return a.current===null&&(a.current=t()),a.current}const jc=x.createContext(null),ph=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class gE extends x.Component{getSnapshotBeforeUpdate(a){const i=this.props.childRef.current;if(i&&a.isPresent&&!this.props.isPresent){const o=this.props.sizeRef.current;o.height=i.offsetHeight||0,o.width=i.offsetWidth||0,o.top=i.offsetTop,o.left=i.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function vE({children:t,isPresent:a}){const i=x.useId(),o=x.useRef(null),r=x.useRef({width:0,height:0,top:0,left:0}),{nonce:u}=x.useContext(ph);return x.useInsertionEffect(()=>{const{width:d,height:p,top:m,left:g}=r.current;if(a||!o.current||!d||!p)return;o.current.dataset.motionPopId=i;const v=document.createElement("style");return u&&(v.nonce=u),document.head.appendChild(v),v.sheet&&v.sheet.insertRule(`
91
91
  [data-motion-pop-id="${i}"] {
92
92
  position: absolute !important;
93
93
  width: ${d}px !important;
@@ -95,7 +95,7 @@ The billing service depends on a Stripe client that doesn't exist in this enviro
95
95
  top: ${m}px !important;
96
96
  left: ${g}px !important;
97
97
  }
98
- `),()=>{document.head.removeChild(v)}},[a]),c.jsx(gE,{isPresent:a,childRef:o,sizeRef:r,children:x.cloneElement(t,{ref:o})})}const yE=({children:t,initial:a,isPresent:i,onExitComplete:o,custom:r,presenceAffectsLayout:u,mode:d})=>{const p=hh(bE),m=x.useId(),g=x.useCallback(y=>{p.set(y,!0);for(const b of p.values())if(!b)return;o&&o()},[p,o]),v=x.useMemo(()=>({id:m,initial:a,isPresent:i,custom:r,onExitComplete:g,register:y=>(p.set(y,!1),()=>p.delete(y))}),u?[Math.random(),g]:[i,g]);return x.useMemo(()=>{p.forEach((y,b)=>p.set(b,!1))},[i]),x.useEffect(()=>{!i&&!p.size&&o&&o()},[i]),d==="popLayout"&&(t=c.jsx(vE,{isPresent:i,children:t})),c.jsx(jc.Provider,{value:v,children:t})};function bE(){return new Map}function Ub(t=!0){const a=x.useContext(jc);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:o,register:r}=a,u=x.useId();x.useEffect(()=>{t&&r(u)},[t]);const d=x.useCallback(()=>t&&o&&o(u),[u,o,t]);return!i&&o?[!1,d]:[!0]}const Kr=t=>t.key||"";function by(t){const a=[];return x.Children.forEach(t,i=>{x.isValidElement(i)&&a.push(i)}),a}const mh=typeof window<"u",zb=mh?x.useLayoutEffect:x.useEffect,Qn=({children:t,custom:a,initial:i=!0,onExitComplete:o,presenceAffectsLayout:r=!0,mode:u="sync",propagate:d=!1})=>{const[p,m]=Ub(d),g=x.useMemo(()=>by(t),[t]),v=d&&!p?[]:g.map(Kr),y=x.useRef(!0),b=x.useRef(g),S=hh(()=>new Map),[T,C]=x.useState(g),[N,E]=x.useState(g);zb(()=>{y.current=!1,b.current=g;for(let M=0;M<N.length;M++){const A=Kr(N[M]);v.includes(A)?S.delete(A):S.get(A)!==!0&&S.set(A,!1)}},[N,v.length,v.join("-")]);const w=[];if(g!==T){let M=[...g];for(let A=0;A<N.length;A++){const $=N[A],V=Kr($);v.includes(V)||(M.splice(A,0,$),w.push($))}u==="wait"&&w.length&&(M=w),E(by(M)),C(g);return}const{forceRender:R}=x.useContext(fh);return c.jsx(c.Fragment,{children:N.map(M=>{const A=Kr(M),$=d&&!p?!1:g===N||v.includes(A),V=()=>{if(S.has(A))S.set(A,!0);else return;let B=!0;S.forEach(F=>{F||(B=!1)}),B&&(R==null||R(),E(b.current),d&&(m==null||m()),o&&o())};return c.jsx(yE,{isPresent:$,initial:!y.current||i?void 0:!1,custom:$?void 0:a,presenceAffectsLayout:r,mode:u,onExitComplete:$?void 0:V,children:M},A)})})},fn=t=>t;let Vb=fn;const xE={useManualTiming:!1};function _E(t){let a=new Set,i=new Set,o=!1,r=!1;const u=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function p(g){u.has(g)&&(m.schedule(g),t()),g(d)}const m={schedule:(g,v=!1,y=!1)=>{const S=y&&o?a:i;return v&&u.add(g),S.has(g)||S.add(g),g},cancel:g=>{i.delete(g),u.delete(g)},process:g=>{if(d=g,o){r=!0;return}o=!0,[a,i]=[i,a],a.forEach(p),a.clear(),o=!1,r&&(r=!1,m.process(g))}};return m}const Yr=["read","resolveKeyframes","update","preRender","render","postRender"],SE=40;function Hb(t,a){let i=!1,o=!0;const r={delta:0,timestamp:0,isProcessing:!1},u=()=>i=!0,d=Yr.reduce((E,w)=>(E[w]=_E(u),E),{}),{read:p,resolveKeyframes:m,update:g,preRender:v,render:y,postRender:b}=d,S=()=>{const E=performance.now();i=!1,r.delta=o?1e3/60:Math.max(Math.min(E-r.timestamp,SE),1),r.timestamp=E,r.isProcessing=!0,p.process(r),m.process(r),g.process(r),v.process(r),y.process(r),b.process(r),r.isProcessing=!1,i&&a&&(o=!1,t(S))},T=()=>{i=!0,o=!0,r.isProcessing||t(S)};return{schedule:Yr.reduce((E,w)=>{const R=d[w];return E[w]=(M,A=!1,$=!1)=>(i||T(),R.schedule(M,A,$)),E},{}),cancel:E=>{for(let w=0;w<Yr.length;w++)d[Yr[w]].cancel(E)},state:r,steps:d}}const{schedule:lt,cancel:ns,state:Ut,steps:af}=Hb(typeof requestAnimationFrame<"u"?requestAnimationFrame:fn,!0),Pb=x.createContext({strict:!1}),xy={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},$i={};for(const t in xy)$i[t]={isEnabled:a=>xy[t].some(i=>!!a[i])};function TE(t){for(const a in t)$i[a]={...$i[a],...t[a]}}const kE=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function dc(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||kE.has(t)}let Gb=t=>!dc(t);function CE(t){t&&(Gb=a=>a.startsWith("on")?!dc(a):t(a))}try{CE(require("@emotion/is-prop-valid").default)}catch{}function EE(t,a,i){const o={};for(const r in t)r==="values"&&typeof t.values=="object"||(Gb(r)||i===!0&&dc(r)||!a&&!dc(r)||t.draggable&&r.startsWith("onDrag"))&&(o[r]=t[r]);return o}function NE(t){if(typeof Proxy>"u")return t;const a=new Map,i=(...o)=>t(...o);return new Proxy(i,{get:(o,r)=>r==="create"?t:(a.has(r)||a.set(r,t(r)),a.get(r))})}const wc=x.createContext({});function ml(t){return typeof t=="string"||Array.isArray(t)}function Ac(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const gh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vh=["initial",...gh];function Dc(t){return Ac(t.animate)||vh.some(a=>ml(t[a]))}function $b(t){return!!(Dc(t)||t.variants)}function jE(t,a){if(Dc(t)){const{initial:i,animate:o}=t;return{initial:i===!1||ml(i)?i:void 0,animate:ml(o)?o:void 0}}return t.inherit!==!1?a:{}}function wE(t){const{initial:a,animate:i}=jE(t,x.useContext(wc));return x.useMemo(()=>({initial:a,animate:i}),[_y(a),_y(i)])}function _y(t){return Array.isArray(t)?t.join(" "):t}const AE=Symbol.for("motionComponentSymbol");function Bi(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function DE(t,a,i){return x.useCallback(o=>{o&&t.onMount&&t.onMount(o),a&&(o?a.mount(o):a.unmount()),i&&(typeof i=="function"?i(o):Bi(i)&&(i.current=o))},[a])}const yh=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),RE="framerAppearId",Fb="data-"+yh(RE),{schedule:bh}=Hb(queueMicrotask,!1),qb=x.createContext({});function ME(t,a,i,o,r){var u,d;const{visualElement:p}=x.useContext(wc),m=x.useContext(Pb),g=x.useContext(jc),v=x.useContext(ph).reducedMotion,y=x.useRef(null);o=o||m.renderer,!y.current&&o&&(y.current=o(t,{visualState:a,parent:p,props:i,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:v}));const b=y.current,S=x.useContext(qb);b&&!b.projection&&r&&(b.type==="html"||b.type==="svg")&&OE(y.current,i,r,S);const T=x.useRef(!1);x.useInsertionEffect(()=>{b&&T.current&&b.update(i,g)});const C=i[Fb],N=x.useRef(!!C&&!(!((u=window.MotionHandoffIsComplete)===null||u===void 0)&&u.call(window,C))&&((d=window.MotionHasOptimisedAnimation)===null||d===void 0?void 0:d.call(window,C)));return zb(()=>{b&&(T.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),bh.render(b.render),N.current&&b.animationState&&b.animationState.animateChanges())}),x.useEffect(()=>{b&&(!N.current&&b.animationState&&b.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var E;(E=window.MotionHandoffMarkAsComplete)===null||E===void 0||E.call(window,C)}),N.current=!1))}),b}function OE(t,a,i,o){const{layoutId:r,layout:u,drag:d,dragConstraints:p,layoutScroll:m,layoutRoot:g}=a;t.projection=new i(t.latestValues,a["data-framer-portal-id"]?void 0:Kb(t.parent)),t.projection.setOptions({layoutId:r,layout:u,alwaysMeasureLayout:!!d||p&&Bi(p),visualElement:t,animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:m,layoutRoot:g})}function Kb(t){if(t)return t.options.allowProjection!==!1?t.projection:Kb(t.parent)}function BE({preloadedFeatures:t,createVisualElement:a,useRender:i,useVisualState:o,Component:r}){var u,d;t&&TE(t);function p(g,v){let y;const b={...x.useContext(ph),...g,layoutId:IE(g)},{isStatic:S}=b,T=wE(g),C=o(g,S);if(!S&&mh){LE();const N=UE(b);y=N.MeasureLayout,T.visualElement=ME(r,C,b,a,N.ProjectionNode)}return c.jsxs(wc.Provider,{value:T,children:[y&&T.visualElement?c.jsx(y,{visualElement:T.visualElement,...b}):null,i(r,g,DE(C,T.visualElement,v),C,S,T.visualElement)]})}p.displayName=`motion.${typeof r=="string"?r:`create(${(d=(u=r.displayName)!==null&&u!==void 0?u:r.name)!==null&&d!==void 0?d:""})`}`;const m=x.forwardRef(p);return m[AE]=r,m}function IE({layoutId:t}){const a=x.useContext(fh).id;return a&&t!==void 0?a+"-"+t:t}function LE(t,a){x.useContext(Pb).strict}function UE(t){const{drag:a,layout:i}=$i;if(!a&&!i)return{};const o={...a,...i};return{MeasureLayout:a!=null&&a.isEnabled(t)||i!=null&&i.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}const zE=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function xh(t){return typeof t!="string"||t.includes("-")?!1:!!(zE.indexOf(t)>-1||/[A-Z]/u.test(t))}function Sy(t){const a=[{},{}];return t==null||t.values.forEach((i,o)=>{a[0][o]=i.get(),a[1][o]=i.getVelocity()}),a}function _h(t,a,i,o){if(typeof a=="function"){const[r,u]=Sy(o);a=a(i!==void 0?i:t.custom,r,u)}if(typeof a=="string"&&(a=t.variants&&t.variants[a]),typeof a=="function"){const[r,u]=Sy(o);a=a(i!==void 0?i:t.custom,r,u)}return a}const Df=t=>Array.isArray(t),VE=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),HE=t=>Df(t)?t[t.length-1]||0:t,Pt=t=>!!(t&&t.getVelocity);function ic(t){const a=Pt(t)?t.get():t;return VE(a)?a.toValue():a}function PE({scrapeMotionValuesFromProps:t,createRenderState:a,onUpdate:i},o,r,u){const d={latestValues:GE(o,r,u,t),renderState:a()};return i&&(d.onMount=p=>i({props:o,current:p,...d}),d.onUpdate=p=>i(p)),d}const Yb=t=>(a,i)=>{const o=x.useContext(wc),r=x.useContext(jc),u=()=>PE(t,a,o,r);return i?u():hh(u)};function GE(t,a,i,o){const r={},u=o(t,{});for(const b in u)r[b]=ic(u[b]);let{initial:d,animate:p}=t;const m=Dc(t),g=$b(t);a&&g&&!m&&t.inherit!==!1&&(d===void 0&&(d=a.initial),p===void 0&&(p=a.animate));let v=i?i.initial===!1:!1;v=v||d===!1;const y=v?p:d;if(y&&typeof y!="boolean"&&!Ac(y)){const b=Array.isArray(y)?y:[y];for(let S=0;S<b.length;S++){const T=_h(t,b[S]);if(T){const{transitionEnd:C,transition:N,...E}=T;for(const w in E){let R=E[w];if(Array.isArray(R)){const M=v?R.length-1:0;R=R[M]}R!==null&&(r[w]=R)}for(const w in C)r[w]=C[w]}}}return r}const Qi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vs=new Set(Qi),Zb=t=>a=>typeof a=="string"&&a.startsWith(t),Xb=Zb("--"),$E=Zb("var(--"),Sh=t=>$E(t)?FE.test(t.split("/*")[0].trim()):!1,FE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Qb=(t,a)=>a&&typeof t=="number"?a.transform(t):t,Sa=(t,a,i)=>i>a?a:i<t?t:i,Wi={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},gl={...Wi,transform:t=>Sa(0,1,t)},Zr={...Wi,default:1},Tl=t=>({test:a=>typeof a=="string"&&a.endsWith(t)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${t}`}),Wa=Tl("deg"),Zn=Tl("%"),be=Tl("px"),qE=Tl("vh"),KE=Tl("vw"),Ty={...Zn,parse:t=>Zn.parse(t)/100,transform:t=>Zn.transform(t*100)},YE={borderWidth:be,borderTopWidth:be,borderRightWidth:be,borderBottomWidth:be,borderLeftWidth:be,borderRadius:be,radius:be,borderTopLeftRadius:be,borderTopRightRadius:be,borderBottomRightRadius:be,borderBottomLeftRadius:be,width:be,maxWidth:be,height:be,maxHeight:be,top:be,right:be,bottom:be,left:be,padding:be,paddingTop:be,paddingRight:be,paddingBottom:be,paddingLeft:be,margin:be,marginTop:be,marginRight:be,marginBottom:be,marginLeft:be,backgroundPositionX:be,backgroundPositionY:be},ZE={rotate:Wa,rotateX:Wa,rotateY:Wa,rotateZ:Wa,scale:Zr,scaleX:Zr,scaleY:Zr,scaleZ:Zr,skew:Wa,skewX:Wa,skewY:Wa,distance:be,translateX:be,translateY:be,translateZ:be,x:be,y:be,z:be,perspective:be,transformPerspective:be,opacity:gl,originX:Ty,originY:Ty,originZ:be},ky={...Wi,transform:Math.round},Th={...YE,...ZE,zIndex:ky,size:be,fillOpacity:gl,strokeOpacity:gl,numOctaves:ky},XE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},QE=Qi.length;function WE(t,a,i){let o="",r=!0;for(let u=0;u<QE;u++){const d=Qi[u],p=t[d];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(d.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||i){const g=Qb(p,Th[d]);if(!m){r=!1;const v=XE[d]||d;o+=`${v}(${g}) `}i&&(a[d]=g)}}return o=o.trim(),i?o=i(a,r?"":o):r&&(o="none"),o}function kh(t,a,i){const{style:o,vars:r,transformOrigin:u}=t;let d=!1,p=!1;for(const m in a){const g=a[m];if(Vs.has(m)){d=!0;continue}else if(Xb(m)){r[m]=g;continue}else{const v=Qb(g,Th[m]);m.startsWith("origin")?(p=!0,u[m]=v):o[m]=v}}if(a.transform||(d||i?o.transform=WE(a,t.transform,i):o.transform&&(o.transform="none")),p){const{originX:m="50%",originY:g="50%",originZ:v=0}=u;o.transformOrigin=`${m} ${g} ${v}`}}const JE={offset:"stroke-dashoffset",array:"stroke-dasharray"},eN={offset:"strokeDashoffset",array:"strokeDasharray"};function tN(t,a,i=1,o=0,r=!0){t.pathLength=1;const u=r?JE:eN;t[u.offset]=be.transform(-o);const d=be.transform(a),p=be.transform(i);t[u.array]=`${d} ${p}`}function Cy(t,a,i){return typeof t=="string"?t:be.transform(a+i*t)}function nN(t,a,i){const o=Cy(a,t.x,t.width),r=Cy(i,t.y,t.height);return`${o} ${r}`}function Ch(t,{attrX:a,attrY:i,attrScale:o,originX:r,originY:u,pathLength:d,pathSpacing:p=1,pathOffset:m=0,...g},v,y){if(kh(t,g,y),v){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:b,style:S,dimensions:T}=t;b.transform&&(T&&(S.transform=b.transform),delete b.transform),T&&(r!==void 0||u!==void 0||S.transform)&&(S.transformOrigin=nN(T,r!==void 0?r:.5,u!==void 0?u:.5)),a!==void 0&&(b.x=a),i!==void 0&&(b.y=i),o!==void 0&&(b.scale=o),d!==void 0&&tN(b,d,p,m,!1)}const Eh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Wb=()=>({...Eh(),attrs:{}}),Nh=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Jb(t,{style:a,vars:i},o,r){Object.assign(t.style,a,r&&r.getProjectionStyles(o));for(const u in i)t.style.setProperty(u,i[u])}const ex=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function tx(t,a,i,o){Jb(t,a,void 0,o);for(const r in a.attrs)t.setAttribute(ex.has(r)?r:yh(r),a.attrs[r])}const fc={};function aN(t){Object.assign(fc,t)}function nx(t,{layout:a,layoutId:i}){return Vs.has(t)||t.startsWith("origin")||(a||i!==void 0)&&(!!fc[t]||t==="opacity")}function jh(t,a,i){var o;const{style:r}=t,u={};for(const d in r)(Pt(r[d])||a.style&&Pt(a.style[d])||nx(d,t)||((o=i==null?void 0:i.getValue(d))===null||o===void 0?void 0:o.liveStyle)!==void 0)&&(u[d]=r[d]);return u}function ax(t,a,i){const o=jh(t,a,i);for(const r in t)if(Pt(t[r])||Pt(a[r])){const u=Qi.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;o[u]=t[r]}return o}function sN(t,a){try{a.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{a.dimensions={x:0,y:0,width:0,height:0}}}const Ey=["x","y","width","height","cx","cy","r"],iN={useVisualState:Yb({scrapeMotionValuesFromProps:ax,createRenderState:Wb,onUpdate:({props:t,prevProps:a,current:i,renderState:o,latestValues:r})=>{if(!i)return;let u=!!t.drag;if(!u){for(const p in r)if(Vs.has(p)){u=!0;break}}if(!u)return;let d=!a;if(a)for(let p=0;p<Ey.length;p++){const m=Ey[p];t[m]!==a[m]&&(d=!0)}d&&lt.read(()=>{sN(i,o),lt.render(()=>{Ch(o,r,Nh(i.tagName),t.transformTemplate),tx(i,o)})})}})},oN={useVisualState:Yb({scrapeMotionValuesFromProps:jh,createRenderState:Eh})};function sx(t,a,i){for(const o in a)!Pt(a[o])&&!nx(o,i)&&(t[o]=a[o])}function lN({transformTemplate:t},a){return x.useMemo(()=>{const i=Eh();return kh(i,a,t),Object.assign({},i.vars,i.style)},[a])}function rN(t,a){const i=t.style||{},o={};return sx(o,i,t),Object.assign(o,lN(t,a)),o}function cN(t,a){const i={},o=rN(t,a);return t.drag&&t.dragListener!==!1&&(i.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(i.tabIndex=0),i.style=o,i}function uN(t,a,i,o){const r=x.useMemo(()=>{const u=Wb();return Ch(u,a,Nh(o),t.transformTemplate),{...u.attrs,style:{...u.style}}},[a]);if(t.style){const u={};sx(u,t.style,t),r.style={...u,...r.style}}return r}function dN(t=!1){return(i,o,r,{latestValues:u},d)=>{const m=(xh(i)?uN:cN)(o,u,d,i),g=EE(o,typeof i=="string",t),v=i!==x.Fragment?{...g,...m,ref:r}:{},{children:y}=o,b=x.useMemo(()=>Pt(y)?y.get():y,[y]);return x.createElement(i,{...v,children:b})}}function fN(t,a){return function(o,{forwardMotionProps:r}={forwardMotionProps:!1}){const d={...xh(o)?iN:oN,preloadedFeatures:t,useRender:dN(r),createVisualElement:a,Component:o};return BE(d)}}function ix(t,a){if(!Array.isArray(a))return!1;const i=a.length;if(i!==t.length)return!1;for(let o=0;o<i;o++)if(a[o]!==t[o])return!1;return!0}function Rc(t,a,i){const o=t.getProps();return _h(o,a,i!==void 0?i:o.custom,t)}function wh(t,a){return t?t[a]||t.default||t:void 0}const ox=new Set(["width","height","top","left","right","bottom",...Qi]);let oc;function hN(){oc=void 0}const Xn={now:()=>(oc===void 0&&Xn.set(Ut.isProcessing||xE.useManualTiming?Ut.timestamp:performance.now()),oc),set:t=>{oc=t,queueMicrotask(hN)}};function Ah(t,a){t.indexOf(a)===-1&&t.push(a)}function Dh(t,a){const i=t.indexOf(a);i>-1&&t.splice(i,1)}class Rh{constructor(){this.subscriptions=[]}add(a){return Ah(this.subscriptions,a),()=>Dh(this.subscriptions,a)}notify(a,i,o){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](a,i,o);else for(let u=0;u<r;u++){const d=this.subscriptions[u];d&&d(a,i,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function lx(t,a){return a?t*(1e3/a):0}const Ny=30,pN=t=>!isNaN(parseFloat(t));class mN{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,r=!0)=>{const u=Xn.now();this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(a),this.owner=i.owner}setCurrent(a){this.current=a,this.updatedAt=Xn.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=pN(this.current))}setPrevFrameValue(a=this.current){this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt}onChange(a){return this.on("change",a)}on(a,i){this.events[a]||(this.events[a]=new Rh);const o=this.events[a].add(i);return a==="change"?()=>{o(),lt.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const a in this.events)this.events[a].clear()}attach(a,i){this.passiveEffect=a,this.stopPassiveEffect=i}set(a,i=!0){!i||!this.passiveEffect?this.updateAndNotify(a,i):this.passiveEffect(a,this.updateAndNotify)}setWithVelocity(a,i,o){this.set(i),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-o}jump(a,i=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const a=Xn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>Ny)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,Ny);return lx(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(a){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=a(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function vl(t,a){return new mN(t,a)}function gN(t,a,i){t.hasValue(a)?t.getValue(a).set(i):t.addValue(a,vl(i))}function vN(t,a){const i=Rc(t,a);let{transitionEnd:o={},transition:r={},...u}=i||{};u={...u,...o};for(const d in u){const p=HE(u[d]);gN(t,d,p)}}function yN(t){return!!(Pt(t)&&t.add)}function Rf(t,a){const i=t.getValue("willChange");if(yN(i))return i.add(a)}function rx(t){return t.props[Fb]}function Mh(t){let a;return()=>(a===void 0&&(a=t()),a)}const bN=Mh(()=>window.ScrollTimeline!==void 0);class xN{constructor(a){this.stop=()=>this.runAll("stop"),this.animations=a.filter(Boolean)}get finished(){return Promise.all(this.animations.map(a=>"finished"in a?a.finished:a))}getAll(a){return this.animations[0][a]}setAll(a,i){for(let o=0;o<this.animations.length;o++)this.animations[o][a]=i}attachTimeline(a,i){const o=this.animations.map(r=>{if(bN()&&r.attachTimeline)return r.attachTimeline(a);if(typeof i=="function")return i(r)});return()=>{o.forEach((r,u)=>{r&&r(),this.animations[u].stop()})}}get time(){return this.getAll("time")}set time(a){this.setAll("time",a)}get speed(){return this.getAll("speed")}set speed(a){this.setAll("speed",a)}get startTime(){return this.getAll("startTime")}get duration(){let a=0;for(let i=0;i<this.animations.length;i++)a=Math.max(a,this.animations[i].duration);return a}runAll(a){this.animations.forEach(i=>i[a]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class _N extends xN{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const ya=t=>t*1e3,ba=t=>t/1e3;function Oh(t){return typeof t=="function"}function jy(t,a){t.timeline=a,t.onfinish=null}const Bh=t=>Array.isArray(t)&&typeof t[0]=="number",SN={linearEasing:void 0};function TN(t,a){const i=Mh(t);return()=>{var o;return(o=SN[a])!==null&&o!==void 0?o:i()}}const hc=TN(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Fi=(t,a,i)=>{const o=a-t;return o===0?1:(i-t)/o},cx=(t,a,i=10)=>{let o="";const r=Math.max(Math.round(a/i),2);for(let u=0;u<r;u++)o+=t(Fi(0,r-1,u))+", ";return`linear(${o.substring(0,o.length-2)})`};function ux(t){return!!(typeof t=="function"&&hc()||!t||typeof t=="string"&&(t in Mf||hc())||Bh(t)||Array.isArray(t)&&t.every(ux))}const el=([t,a,i,o])=>`cubic-bezier(${t}, ${a}, ${i}, ${o})`,Mf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:el([0,.65,.55,1]),circOut:el([.55,0,1,.45]),backIn:el([.31,.01,.66,-.59]),backOut:el([.33,1.53,.69,.99])};function dx(t,a){if(t)return typeof t=="function"&&hc()?cx(t,a):Bh(t)?el(t):Array.isArray(t)?t.map(i=>dx(i,a)||Mf.easeOut):Mf[t]}const fx=(t,a,i)=>(((1-3*i+3*a)*t+(3*i-6*a))*t+3*a)*t,kN=1e-7,CN=12;function EN(t,a,i,o,r){let u,d,p=0;do d=a+(i-a)/2,u=fx(d,o,r)-t,u>0?i=d:a=d;while(Math.abs(u)>kN&&++p<CN);return d}function kl(t,a,i,o){if(t===a&&i===o)return fn;const r=u=>EN(u,0,1,t,i);return u=>u===0||u===1?u:fx(r(u),a,o)}const hx=t=>a=>a<=.5?t(2*a)/2:(2-t(2*(1-a)))/2,px=t=>a=>1-t(1-a),mx=kl(.33,1.53,.69,.99),Ih=px(mx),gx=hx(Ih),vx=t=>(t*=2)<1?.5*Ih(t):.5*(2-Math.pow(2,-10*(t-1))),Lh=t=>1-Math.sin(Math.acos(t)),yx=px(Lh),bx=hx(Lh),xx=t=>/^0[^.\s]+$/u.test(t);function NN(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||xx(t):!0}const ll=t=>Math.round(t*1e5)/1e5,Uh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function jN(t){return t==null}const wN=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,zh=(t,a)=>i=>!!(typeof i=="string"&&wN.test(i)&&i.startsWith(t)||a&&!jN(i)&&Object.prototype.hasOwnProperty.call(i,a)),_x=(t,a,i)=>o=>{if(typeof o!="string")return o;const[r,u,d,p]=o.match(Uh);return{[t]:parseFloat(r),[a]:parseFloat(u),[i]:parseFloat(d),alpha:p!==void 0?parseFloat(p):1}},AN=t=>Sa(0,255,t),sf={...Wi,transform:t=>Math.round(AN(t))},Ms={test:zh("rgb","red"),parse:_x("red","green","blue"),transform:({red:t,green:a,blue:i,alpha:o=1})=>"rgba("+sf.transform(t)+", "+sf.transform(a)+", "+sf.transform(i)+", "+ll(gl.transform(o))+")"};function DN(t){let a="",i="",o="",r="";return t.length>5?(a=t.substring(1,3),i=t.substring(3,5),o=t.substring(5,7),r=t.substring(7,9)):(a=t.substring(1,2),i=t.substring(2,3),o=t.substring(3,4),r=t.substring(4,5),a+=a,i+=i,o+=o,r+=r),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(o,16),alpha:r?parseInt(r,16)/255:1}}const Of={test:zh("#"),parse:DN,transform:Ms.transform},Ii={test:zh("hsl","hue"),parse:_x("hue","saturation","lightness"),transform:({hue:t,saturation:a,lightness:i,alpha:o=1})=>"hsla("+Math.round(t)+", "+Zn.transform(ll(a))+", "+Zn.transform(ll(i))+", "+ll(gl.transform(o))+")"},Ht={test:t=>Ms.test(t)||Of.test(t)||Ii.test(t),parse:t=>Ms.test(t)?Ms.parse(t):Ii.test(t)?Ii.parse(t):Of.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ms.transform(t):Ii.transform(t)},RN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function MN(t){var a,i;return isNaN(t)&&typeof t=="string"&&(((a=t.match(Uh))===null||a===void 0?void 0:a.length)||0)+(((i=t.match(RN))===null||i===void 0?void 0:i.length)||0)>0}const Sx="number",Tx="color",ON="var",BN="var(",wy="${}",IN=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function yl(t){const a=t.toString(),i=[],o={color:[],number:[],var:[]},r=[];let u=0;const p=a.replace(IN,m=>(Ht.test(m)?(o.color.push(u),r.push(Tx),i.push(Ht.parse(m))):m.startsWith(BN)?(o.var.push(u),r.push(ON),i.push(m)):(o.number.push(u),r.push(Sx),i.push(parseFloat(m))),++u,wy)).split(wy);return{values:i,split:p,indexes:o,types:r}}function kx(t){return yl(t).values}function Cx(t){const{split:a,types:i}=yl(t),o=a.length;return r=>{let u="";for(let d=0;d<o;d++)if(u+=a[d],r[d]!==void 0){const p=i[d];p===Sx?u+=ll(r[d]):p===Tx?u+=Ht.transform(r[d]):u+=r[d]}return u}}const LN=t=>typeof t=="number"?0:t;function UN(t){const a=kx(t);return Cx(t)(a.map(LN))}const as={test:MN,parse:kx,createTransformer:Cx,getAnimatableNone:UN},zN=new Set(["brightness","contrast","saturate","opacity"]);function VN(t){const[a,i]=t.slice(0,-1).split("(");if(a==="drop-shadow")return t;const[o]=i.match(Uh)||[];if(!o)return t;const r=i.replace(o,"");let u=zN.has(a)?1:0;return o!==i&&(u*=100),a+"("+u+r+")"}const HN=/\b([a-z-]*)\(.*?\)/gu,Bf={...as,getAnimatableNone:t=>{const a=t.match(HN);return a?a.map(VN).join(" "):t}},PN={...Th,color:Ht,backgroundColor:Ht,outlineColor:Ht,fill:Ht,stroke:Ht,borderColor:Ht,borderTopColor:Ht,borderRightColor:Ht,borderBottomColor:Ht,borderLeftColor:Ht,filter:Bf,WebkitFilter:Bf},Vh=t=>PN[t];function Ex(t,a){let i=Vh(t);return i!==Bf&&(i=as),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const GN=new Set(["auto","none","0"]);function $N(t,a,i){let o=0,r;for(;o<t.length&&!r;){const u=t[o];typeof u=="string"&&!GN.has(u)&&yl(u).values.length&&(r=t[o]),o++}if(r&&i)for(const u of a)t[u]=Ex(i,r)}const Ay=t=>t===Wi||t===be,Dy=(t,a)=>parseFloat(t.split(", ")[a]),Ry=(t,a)=>(i,{transform:o})=>{if(o==="none"||!o)return 0;const r=o.match(/^matrix3d\((.+)\)$/u);if(r)return Dy(r[1],a);{const u=o.match(/^matrix\((.+)\)$/u);return u?Dy(u[1],t):0}},FN=new Set(["x","y","z"]),qN=Qi.filter(t=>!FN.has(t));function KN(t){const a=[];return qN.forEach(i=>{const o=t.getValue(i);o!==void 0&&(a.push([i,o.get()]),o.set(i.startsWith("scale")?1:0))}),a}const qi={width:({x:t},{paddingLeft:a="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(a)-parseFloat(i),height:({y:t},{paddingTop:a="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(a)-parseFloat(i),top:(t,{top:a})=>parseFloat(a),left:(t,{left:a})=>parseFloat(a),bottom:({y:t},{top:a})=>parseFloat(a)+(t.max-t.min),right:({x:t},{left:a})=>parseFloat(a)+(t.max-t.min),x:Ry(4,13),y:Ry(5,14)};qi.translateX=qi.x;qi.translateY=qi.y;const Os=new Set;let If=!1,Lf=!1;function Nx(){if(Lf){const t=Array.from(Os).filter(o=>o.needsMeasurement),a=new Set(t.map(o=>o.element)),i=new Map;a.forEach(o=>{const r=KN(o);r.length&&(i.set(o,r),o.render())}),t.forEach(o=>o.measureInitialState()),a.forEach(o=>{o.render();const r=i.get(o);r&&r.forEach(([u,d])=>{var p;(p=o.getValue(u))===null||p===void 0||p.set(d)})}),t.forEach(o=>o.measureEndState()),t.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}Lf=!1,If=!1,Os.forEach(t=>t.complete()),Os.clear()}function jx(){Os.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Lf=!0)})}function YN(){jx(),Nx()}class Hh{constructor(a,i,o,r,u,d=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=i,this.name=o,this.motionValue=r,this.element=u,this.isAsync=d}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Os.add(this),If||(If=!0,lt.read(jx),lt.resolveKeyframes(Nx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:o,motionValue:r}=this;for(let u=0;u<a.length;u++)if(a[u]===null)if(u===0){const d=r==null?void 0:r.get(),p=a[a.length-1];if(d!==void 0)a[0]=d;else if(o&&i){const m=o.readValue(i,p);m!=null&&(a[0]=m)}a[0]===void 0&&(a[0]=p),r&&d===void 0&&r.set(a[0])}else a[u]=a[u-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Os.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Os.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const wx=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ZN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function XN(t){const a=ZN.exec(t);if(!a)return[,];const[,i,o,r]=a;return[`--${i??o}`,r]}function Ax(t,a,i=1){const[o,r]=XN(t);if(!o)return;const u=window.getComputedStyle(a).getPropertyValue(o);if(u){const d=u.trim();return wx(d)?parseFloat(d):d}return Sh(r)?Ax(r,a,i+1):r}const Dx=t=>a=>a.test(t),QN={test:t=>t==="auto",parse:t=>t},Rx=[Wi,be,Zn,Wa,KE,qE,QN],My=t=>Rx.find(Dx(t));class Mx extends Hh{constructor(a,i,o,r,u){super(a,i,o,r,u,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:i,name:o}=this;if(!i||!i.current)return;super.readKeyframes();for(let m=0;m<a.length;m++){let g=a[m];if(typeof g=="string"&&(g=g.trim(),Sh(g))){const v=Ax(g,i.current);v!==void 0&&(a[m]=v),m===a.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!ox.has(o)||a.length!==2)return;const[r,u]=a,d=My(r),p=My(u);if(d!==p)if(Ay(d)&&Ay(p))for(let m=0;m<a.length;m++){const g=a[m];typeof g=="string"&&(a[m]=parseFloat(g))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:i}=this,o=[];for(let r=0;r<a.length;r++)NN(a[r])&&o.push(r);o.length&&$N(a,o,i)}measureInitialState(){const{element:a,unresolvedKeyframes:i,name:o}=this;if(!a||!a.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=qi[o](a.measureViewportBox(),window.getComputedStyle(a.current)),i[0]=this.measuredOrigin;const r=i[i.length-1];r!==void 0&&a.getValue(o,r).jump(r,!1)}measureEndState(){var a;const{element:i,name:o,unresolvedKeyframes:r}=this;if(!i||!i.current)return;const u=i.getValue(o);u&&u.jump(this.measuredOrigin,!1);const d=r.length-1,p=r[d];r[d]=qi[o](i.measureViewportBox(),window.getComputedStyle(i.current)),p!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=p),!((a=this.removedTransforms)===null||a===void 0)&&a.length&&this.removedTransforms.forEach(([m,g])=>{i.getValue(m).set(g)}),this.resolveNoneKeyframes()}}const Oy=(t,a)=>a==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(as.test(t)||t==="0")&&!t.startsWith("url("));function WN(t){const a=t[0];if(t.length===1)return!0;for(let i=0;i<t.length;i++)if(t[i]!==a)return!0}function JN(t,a,i,o){const r=t[0];if(r===null)return!1;if(a==="display"||a==="visibility")return!0;const u=t[t.length-1],d=Oy(r,a),p=Oy(u,a);return!d||!p?!1:WN(t)||(i==="spring"||Oh(i))&&o}const ej=t=>t!==null;function Mc(t,{repeat:a,repeatType:i="loop"},o){const r=t.filter(ej),u=a&&i!=="loop"&&a%2===1?0:r.length-1;return!u||o===void 0?r[u]:o}const tj=40;class Ox{constructor({autoplay:a=!0,delay:i=0,type:o="keyframes",repeat:r=0,repeatDelay:u=0,repeatType:d="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Xn.now(),this.options={autoplay:a,delay:i,type:o,repeat:r,repeatDelay:u,repeatType:d,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>tj?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&YN(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=Xn.now(),this.hasAttemptedResolve=!0;const{name:o,type:r,velocity:u,delay:d,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!JN(a,o,r,u))if(d)this.options.duration=0;else{m&&m(Mc(a,this.options,i)),p&&p(),this.resolveFinishedPromise();return}const v=this.initPlayback(a,i);v!==!1&&(this._resolved={keyframes:a,finalKeyframe:i,...v},this.onPostResolved())}onPostResolved(){}then(a,i){return this.currentFinishedPromise.then(a,i)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(a=>{this.resolveFinishedPromise=a})}}const Uf=2e4;function Bx(t){let a=0;const i=50;let o=t.next(a);for(;!o.done&&a<Uf;)a+=i,o=t.next(a);return a>=Uf?1/0:a}const ut=(t,a,i)=>t+(a-t)*i;function of(t,a,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+(a-t)*6*i:i<1/2?a:i<2/3?t+(a-t)*(2/3-i)*6:t}function nj({hue:t,saturation:a,lightness:i,alpha:o}){t/=360,a/=100,i/=100;let r=0,u=0,d=0;if(!a)r=u=d=i;else{const p=i<.5?i*(1+a):i+a-i*a,m=2*i-p;r=of(m,p,t+1/3),u=of(m,p,t),d=of(m,p,t-1/3)}return{red:Math.round(r*255),green:Math.round(u*255),blue:Math.round(d*255),alpha:o}}function pc(t,a){return i=>i>0?a:t}const lf=(t,a,i)=>{const o=t*t,r=i*(a*a-o)+o;return r<0?0:Math.sqrt(r)},aj=[Of,Ms,Ii],sj=t=>aj.find(a=>a.test(t));function By(t){const a=sj(t);if(!a)return!1;let i=a.parse(t);return a===Ii&&(i=nj(i)),i}const Iy=(t,a)=>{const i=By(t),o=By(a);if(!i||!o)return pc(t,a);const r={...i};return u=>(r.red=lf(i.red,o.red,u),r.green=lf(i.green,o.green,u),r.blue=lf(i.blue,o.blue,u),r.alpha=ut(i.alpha,o.alpha,u),Ms.transform(r))},ij=(t,a)=>i=>a(t(i)),Cl=(...t)=>t.reduce(ij),zf=new Set(["none","hidden"]);function oj(t,a){return zf.has(t)?i=>i<=0?t:a:i=>i>=1?a:t}function lj(t,a){return i=>ut(t,a,i)}function Ph(t){return typeof t=="number"?lj:typeof t=="string"?Sh(t)?pc:Ht.test(t)?Iy:uj:Array.isArray(t)?Ix:typeof t=="object"?Ht.test(t)?Iy:rj:pc}function Ix(t,a){const i=[...t],o=i.length,r=t.map((u,d)=>Ph(u)(u,a[d]));return u=>{for(let d=0;d<o;d++)i[d]=r[d](u);return i}}function rj(t,a){const i={...t,...a},o={};for(const r in i)t[r]!==void 0&&a[r]!==void 0&&(o[r]=Ph(t[r])(t[r],a[r]));return r=>{for(const u in o)i[u]=o[u](r);return i}}function cj(t,a){var i;const o=[],r={color:0,var:0,number:0};for(let u=0;u<a.values.length;u++){const d=a.types[u],p=t.indexes[d][r[d]],m=(i=t.values[p])!==null&&i!==void 0?i:0;o[u]=m,r[d]++}return o}const uj=(t,a)=>{const i=as.createTransformer(a),o=yl(t),r=yl(a);return o.indexes.var.length===r.indexes.var.length&&o.indexes.color.length===r.indexes.color.length&&o.indexes.number.length>=r.indexes.number.length?zf.has(t)&&!r.values.length||zf.has(a)&&!o.values.length?oj(t,a):Cl(Ix(cj(o,r),r.values),i):pc(t,a)};function Lx(t,a,i){return typeof t=="number"&&typeof a=="number"&&typeof i=="number"?ut(t,a,i):Ph(t)(t,a)}const dj=5;function Ux(t,a,i){const o=Math.max(a-dj,0);return lx(i-t(o),a-o)}const ht={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},rf=.001;function fj({duration:t=ht.duration,bounce:a=ht.bounce,velocity:i=ht.velocity,mass:o=ht.mass}){let r,u,d=1-a;d=Sa(ht.minDamping,ht.maxDamping,d),t=Sa(ht.minDuration,ht.maxDuration,ba(t)),d<1?(r=g=>{const v=g*d,y=v*t,b=v-i,S=Vf(g,d),T=Math.exp(-y);return rf-b/S*T},u=g=>{const y=g*d*t,b=y*i+i,S=Math.pow(d,2)*Math.pow(g,2)*t,T=Math.exp(-y),C=Vf(Math.pow(g,2),d);return(-r(g)+rf>0?-1:1)*((b-S)*T)/C}):(r=g=>{const v=Math.exp(-g*t),y=(g-i)*t+1;return-rf+v*y},u=g=>{const v=Math.exp(-g*t),y=(i-g)*(t*t);return v*y});const p=5/t,m=pj(r,u,p);if(t=ya(t),isNaN(m))return{stiffness:ht.stiffness,damping:ht.damping,duration:t};{const g=Math.pow(m,2)*o;return{stiffness:g,damping:d*2*Math.sqrt(o*g),duration:t}}}const hj=12;function pj(t,a,i){let o=i;for(let r=1;r<hj;r++)o=o-t(o)/a(o);return o}function Vf(t,a){return t*Math.sqrt(1-a*a)}const mj=["duration","bounce"],gj=["stiffness","damping","mass"];function Ly(t,a){return a.some(i=>t[i]!==void 0)}function vj(t){let a={velocity:ht.velocity,stiffness:ht.stiffness,damping:ht.damping,mass:ht.mass,isResolvedFromDuration:!1,...t};if(!Ly(t,gj)&&Ly(t,mj))if(t.visualDuration){const i=t.visualDuration,o=2*Math.PI/(i*1.2),r=o*o,u=2*Sa(.05,1,1-(t.bounce||0))*Math.sqrt(r);a={...a,mass:ht.mass,stiffness:r,damping:u}}else{const i=fj(t);a={...a,...i,mass:ht.mass},a.isResolvedFromDuration=!0}return a}function zx(t=ht.visualDuration,a=ht.bounce){const i=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:a}:t;let{restSpeed:o,restDelta:r}=i;const u=i.keyframes[0],d=i.keyframes[i.keyframes.length-1],p={done:!1,value:u},{stiffness:m,damping:g,mass:v,duration:y,velocity:b,isResolvedFromDuration:S}=vj({...i,velocity:-ba(i.velocity||0)}),T=b||0,C=g/(2*Math.sqrt(m*v)),N=d-u,E=ba(Math.sqrt(m/v)),w=Math.abs(N)<5;o||(o=w?ht.restSpeed.granular:ht.restSpeed.default),r||(r=w?ht.restDelta.granular:ht.restDelta.default);let R;if(C<1){const A=Vf(E,C);R=$=>{const V=Math.exp(-C*E*$);return d-V*((T+C*E*N)/A*Math.sin(A*$)+N*Math.cos(A*$))}}else if(C===1)R=A=>d-Math.exp(-E*A)*(N+(T+E*N)*A);else{const A=E*Math.sqrt(C*C-1);R=$=>{const V=Math.exp(-C*E*$),B=Math.min(A*$,300);return d-V*((T+C*E*N)*Math.sinh(B)+A*N*Math.cosh(B))/A}}const M={calculatedDuration:S&&y||null,next:A=>{const $=R(A);if(S)p.done=A>=y;else{let V=0;C<1&&(V=A===0?ya(T):Ux(R,A,$));const B=Math.abs(V)<=o,F=Math.abs(d-$)<=r;p.done=B&&F}return p.value=p.done?d:$,p},toString:()=>{const A=Math.min(Bx(M),Uf),$=cx(V=>M.next(A*V).value,A,30);return A+"ms "+$}};return M}function Uy({keyframes:t,velocity:a=0,power:i=.8,timeConstant:o=325,bounceDamping:r=10,bounceStiffness:u=500,modifyTarget:d,min:p,max:m,restDelta:g=.5,restSpeed:v}){const y=t[0],b={done:!1,value:y},S=B=>p!==void 0&&B<p||m!==void 0&&B>m,T=B=>p===void 0?m:m===void 0||Math.abs(p-B)<Math.abs(m-B)?p:m;let C=i*a;const N=y+C,E=d===void 0?N:d(N);E!==N&&(C=E-y);const w=B=>-C*Math.exp(-B/o),R=B=>E+w(B),M=B=>{const F=w(B),X=R(B);b.done=Math.abs(F)<=g,b.value=b.done?E:X};let A,$;const V=B=>{S(b.value)&&(A=B,$=zx({keyframes:[b.value,T(b.value)],velocity:Ux(R,B,b.value),damping:r,stiffness:u,restDelta:g,restSpeed:v}))};return V(0),{calculatedDuration:null,next:B=>{let F=!1;return!$&&A===void 0&&(F=!0,M(B),V(B)),A!==void 0&&B>=A?$.next(B-A):(!F&&M(B),b)}}}const yj=kl(.42,0,1,1),bj=kl(0,0,.58,1),Vx=kl(.42,0,.58,1),xj=t=>Array.isArray(t)&&typeof t[0]!="number",_j={linear:fn,easeIn:yj,easeInOut:Vx,easeOut:bj,circIn:Lh,circInOut:bx,circOut:yx,backIn:Ih,backInOut:gx,backOut:mx,anticipate:vx},zy=t=>{if(Bh(t)){Vb(t.length===4);const[a,i,o,r]=t;return kl(a,i,o,r)}else if(typeof t=="string")return _j[t];return t};function Sj(t,a,i){const o=[],r=i||Lx,u=t.length-1;for(let d=0;d<u;d++){let p=r(t[d],t[d+1]);if(a){const m=Array.isArray(a)?a[d]||fn:a;p=Cl(m,p)}o.push(p)}return o}function Tj(t,a,{clamp:i=!0,ease:o,mixer:r}={}){const u=t.length;if(Vb(u===a.length),u===1)return()=>a[0];if(u===2&&a[0]===a[1])return()=>a[1];const d=t[0]===t[1];t[0]>t[u-1]&&(t=[...t].reverse(),a=[...a].reverse());const p=Sj(a,o,r),m=p.length,g=v=>{if(d&&v<t[0])return a[0];let y=0;if(m>1)for(;y<t.length-2&&!(v<t[y+1]);y++);const b=Fi(t[y],t[y+1],v);return p[y](b)};return i?v=>g(Sa(t[0],t[u-1],v)):g}function kj(t,a){const i=t[t.length-1];for(let o=1;o<=a;o++){const r=Fi(0,a,o);t.push(ut(i,1,r))}}function Cj(t){const a=[0];return kj(a,t.length-1),a}function Ej(t,a){return t.map(i=>i*a)}function Nj(t,a){return t.map(()=>a||Vx).splice(0,t.length-1)}function mc({duration:t=300,keyframes:a,times:i,ease:o="easeInOut"}){const r=xj(o)?o.map(zy):zy(o),u={done:!1,value:a[0]},d=Ej(i&&i.length===a.length?i:Cj(a),t),p=Tj(d,a,{ease:Array.isArray(r)?r:Nj(a,r)});return{calculatedDuration:t,next:m=>(u.value=p(m),u.done=m>=t,u)}}const jj=t=>{const a=({timestamp:i})=>t(i);return{start:()=>lt.update(a,!0),stop:()=>ns(a),now:()=>Ut.isProcessing?Ut.timestamp:Xn.now()}},wj={decay:Uy,inertia:Uy,tween:mc,keyframes:mc,spring:zx},Aj=t=>t/100;class Gh extends Ox{constructor(a){super(a),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:m}=this.options;m&&m()};const{name:i,motionValue:o,element:r,keyframes:u}=this.options,d=(r==null?void 0:r.KeyframeResolver)||Hh,p=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new d(u,p,i,o,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(a){const{type:i="keyframes",repeat:o=0,repeatDelay:r=0,repeatType:u,velocity:d=0}=this.options,p=Oh(i)?i:wj[i]||mc;let m,g;p!==mc&&typeof a[0]!="number"&&(m=Cl(Aj,Lx(a[0],a[1])),a=[0,100]);const v=p({...this.options,keyframes:a});u==="mirror"&&(g=p({...this.options,keyframes:[...a].reverse(),velocity:-d})),v.calculatedDuration===null&&(v.calculatedDuration=Bx(v));const{calculatedDuration:y}=v,b=y+r,S=b*(o+1)-r;return{generator:v,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:y,resolvedDuration:b,totalDuration:S}}onPostResolved(){const{autoplay:a=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!a?this.pause():this.state=this.pendingPlayState}tick(a,i=!1){const{resolved:o}=this;if(!o){const{keyframes:B}=this.options;return{done:!0,value:B[B.length-1]}}const{finalKeyframe:r,generator:u,mirroredGenerator:d,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:g,totalDuration:v,resolvedDuration:y}=o;if(this.startTime===null)return u.next(0);const{delay:b,repeat:S,repeatType:T,repeatDelay:C,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-v/this.speed,this.startTime)),i?this.currentTime=a:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(a-this.startTime)*this.speed;const E=this.currentTime-b*(this.speed>=0?1:-1),w=this.speed>=0?E<0:E>v;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=v);let R=this.currentTime,M=u;if(S){const B=Math.min(this.currentTime,v)/y;let F=Math.floor(B),X=B%1;!X&&B>=1&&(X=1),X===1&&F--,F=Math.min(F,S+1),!!(F%2)&&(T==="reverse"?(X=1-X,C&&(X-=C/y)):T==="mirror"&&(M=d)),R=Sa(0,1,X)*y}const A=w?{done:!1,value:m[0]}:M.next(R);p&&(A.value=p(A.value));let{done:$}=A;!w&&g!==null&&($=this.speed>=0?this.currentTime>=v:this.currentTime<=0);const V=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&$);return V&&r!==void 0&&(A.value=Mc(m,this.options,r)),N&&N(A.value),V&&this.finish(),A}get duration(){const{resolved:a}=this;return a?ba(a.calculatedDuration):0}get time(){return ba(this.currentTime)}set time(a){a=ya(a),this.currentTime=a,this.holdTime!==null||this.speed===0?this.holdTime=a:this.driver&&(this.startTime=this.driver.now()-a/this.speed)}get speed(){return this.playbackSpeed}set speed(a){const i=this.playbackSpeed!==a;this.playbackSpeed=a,i&&(this.time=ba(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=jj,onPlay:i,startTime:o}=this.options;this.driver||(this.driver=a(u=>this.tick(u))),i&&i();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=o??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var a;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(a=this.currentTime)!==null&&a!==void 0?a:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:a}=this.options;a&&a()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(a){return this.startTime=0,this.tick(a,!0)}}const Dj=new Set(["opacity","clipPath","filter","transform"]);function Rj(t,a,i,{delay:o=0,duration:r=300,repeat:u=0,repeatType:d="loop",ease:p="easeInOut",times:m}={}){const g={[a]:i};m&&(g.offset=m);const v=dx(p,r);return Array.isArray(v)&&(g.easing=v),t.animate(g,{delay:o,duration:r,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:u+1,direction:d==="reverse"?"alternate":"normal"})}const Mj=Mh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),gc=10,Oj=2e4;function Bj(t){return Oh(t.type)||t.type==="spring"||!ux(t.ease)}function Ij(t,a){const i=new Gh({...a,keyframes:t,repeat:0,delay:0,isGenerator:!0});let o={done:!1,value:t[0]};const r=[];let u=0;for(;!o.done&&u<Oj;)o=i.sample(u),r.push(o.value),u+=gc;return{times:void 0,keyframes:r,duration:u-gc,ease:"linear"}}const Hx={anticipate:vx,backInOut:gx,circInOut:bx};function Lj(t){return t in Hx}class Vy extends Ox{constructor(a){super(a);const{name:i,motionValue:o,element:r,keyframes:u}=this.options;this.resolver=new Mx(u,(d,p)=>this.onKeyframesResolved(d,p),i,o,r),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:o=300,times:r,ease:u,type:d,motionValue:p,name:m,startTime:g}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof u=="string"&&hc()&&Lj(u)&&(u=Hx[u]),Bj(this.options)){const{onComplete:y,onUpdate:b,motionValue:S,element:T,...C}=this.options,N=Ij(a,C);a=N.keyframes,a.length===1&&(a[1]=a[0]),o=N.duration,r=N.times,u=N.ease,d="keyframes"}const v=Rj(p.owner.current,m,a,{...this.options,duration:o,times:r,ease:u});return v.startTime=g??this.calcStartTime(),this.pendingTimeline?(jy(v,this.pendingTimeline),this.pendingTimeline=void 0):v.onfinish=()=>{const{onComplete:y}=this.options;p.set(Mc(a,this.options,i)),y&&y(),this.cancel(),this.resolveFinishedPromise()},{animation:v,duration:o,times:r,type:d,ease:u,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return ba(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return ba(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.currentTime=ya(a)}get speed(){const{resolved:a}=this;if(!a)return 1;const{animation:i}=a;return i.playbackRate}set speed(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.playbackRate=a}get state(){const{resolved:a}=this;if(!a)return"idle";const{animation:i}=a;return i.playState}get startTime(){const{resolved:a}=this;if(!a)return null;const{animation:i}=a;return i.startTime}attachTimeline(a){if(!this._resolved)this.pendingTimeline=a;else{const{resolved:i}=this;if(!i)return fn;const{animation:o}=i;jy(o,a)}return fn}play(){if(this.isStopped)return;const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.playState==="finished"&&this.updateFinishedPromise(),i.play()}pause(){const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:a}=this;if(!a)return;const{animation:i,keyframes:o,duration:r,type:u,ease:d,times:p}=a;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:v,onComplete:y,element:b,...S}=this.options,T=new Gh({...S,keyframes:o,duration:r,type:u,ease:d,times:p,isGenerator:!0}),C=ya(this.time);g.setWithVelocity(T.sample(C-gc).value,T.sample(C).value,gc)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:a}=this;a&&a.animation.finish()}cancel(){const{resolved:a}=this;a&&a.animation.cancel()}static supports(a){const{motionValue:i,name:o,repeatDelay:r,repeatType:u,damping:d,type:p}=a;if(!i||!i.owner||!(i.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=i.owner.getProps();return Mj()&&o&&Dj.has(o)&&!m&&!g&&!r&&u!=="mirror"&&d!==0&&p!=="inertia"}}const Uj={type:"spring",stiffness:500,damping:25,restSpeed:10},zj=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Vj={type:"keyframes",duration:.8},Hj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Pj=(t,{keyframes:a})=>a.length>2?Vj:Vs.has(t)?t.startsWith("scale")?zj(a[1]):Uj:Hj;function Gj({when:t,delay:a,delayChildren:i,staggerChildren:o,staggerDirection:r,repeat:u,repeatType:d,repeatDelay:p,from:m,elapsed:g,...v}){return!!Object.keys(v).length}const $h=(t,a,i,o={},r,u)=>d=>{const p=wh(o,t)||{},m=p.delay||o.delay||0;let{elapsed:g=0}=o;g=g-ya(m);let v={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:a.getVelocity(),...p,delay:-g,onUpdate:b=>{a.set(b),p.onUpdate&&p.onUpdate(b)},onComplete:()=>{d(),p.onComplete&&p.onComplete()},name:t,motionValue:a,element:u?void 0:r};Gj(p)||(v={...v,...Pj(t,v)}),v.duration&&(v.duration=ya(v.duration)),v.repeatDelay&&(v.repeatDelay=ya(v.repeatDelay)),v.from!==void 0&&(v.keyframes[0]=v.from);let y=!1;if((v.type===!1||v.duration===0&&!v.repeatDelay)&&(v.duration=0,v.delay===0&&(y=!0)),y&&!u&&a.get()!==void 0){const b=Mc(v.keyframes,p);if(b!==void 0)return lt.update(()=>{v.onUpdate(b),v.onComplete()}),new _N([])}return!u&&Vy.supports(v)?new Vy(v):new Gh(v)};function $j({protectedKeys:t,needsAnimating:a},i){const o=t.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,o}function Px(t,a,{delay:i=0,transitionOverride:o,type:r}={}){var u;let{transition:d=t.getDefaultTransition(),transitionEnd:p,...m}=a;o&&(d=o);const g=[],v=r&&t.animationState&&t.animationState.getState()[r];for(const y in m){const b=t.getValue(y,(u=t.latestValues[y])!==null&&u!==void 0?u:null),S=m[y];if(S===void 0||v&&$j(v,y))continue;const T={delay:i,...wh(d||{},y)};let C=!1;if(window.MotionHandoffAnimation){const E=rx(t);if(E){const w=window.MotionHandoffAnimation(E,y,lt);w!==null&&(T.startTime=w,C=!0)}}Rf(t,y),b.start($h(y,b,S,t.shouldReduceMotion&&ox.has(y)?{type:!1}:T,t,C));const N=b.animation;N&&g.push(N)}return p&&Promise.all(g).then(()=>{lt.update(()=>{p&&vN(t,p)})}),g}function Hf(t,a,i={}){var o;const r=Rc(t,a,i.type==="exit"?(o=t.presenceContext)===null||o===void 0?void 0:o.custom:void 0);let{transition:u=t.getDefaultTransition()||{}}=r||{};i.transitionOverride&&(u=i.transitionOverride);const d=r?()=>Promise.all(Px(t,r,i)):()=>Promise.resolve(),p=t.variantChildren&&t.variantChildren.size?(g=0)=>{const{delayChildren:v=0,staggerChildren:y,staggerDirection:b}=u;return Fj(t,a,v+g,y,b,i)}:()=>Promise.resolve(),{when:m}=u;if(m){const[g,v]=m==="beforeChildren"?[d,p]:[p,d];return g().then(()=>v())}else return Promise.all([d(),p(i.delay)])}function Fj(t,a,i=0,o=0,r=1,u){const d=[],p=(t.variantChildren.size-1)*o,m=r===1?(g=0)=>g*o:(g=0)=>p-g*o;return Array.from(t.variantChildren).sort(qj).forEach((g,v)=>{g.notify("AnimationStart",a),d.push(Hf(g,a,{...u,delay:i+m(v)}).then(()=>g.notify("AnimationComplete",a)))}),Promise.all(d)}function qj(t,a){return t.sortNodePosition(a)}function Kj(t,a,i={}){t.notify("AnimationStart",a);let o;if(Array.isArray(a)){const r=a.map(u=>Hf(t,u,i));o=Promise.all(r)}else if(typeof a=="string")o=Hf(t,a,i);else{const r=typeof a=="function"?Rc(t,a,i.custom):a;o=Promise.all(Px(t,r,i))}return o.then(()=>{t.notify("AnimationComplete",a)})}const Yj=vh.length;function Gx(t){if(!t)return;if(!t.isControllingVariants){const i=t.parent?Gx(t.parent)||{}:{};return t.props.initial!==void 0&&(i.initial=t.props.initial),i}const a={};for(let i=0;i<Yj;i++){const o=vh[i],r=t.props[o];(ml(r)||r===!1)&&(a[o]=r)}return a}const Zj=[...gh].reverse(),Xj=gh.length;function Qj(t){return a=>Promise.all(a.map(({animation:i,options:o})=>Kj(t,i,o)))}function Wj(t){let a=Qj(t),i=Hy(),o=!0;const r=m=>(g,v)=>{var y;const b=Rc(t,v,m==="exit"?(y=t.presenceContext)===null||y===void 0?void 0:y.custom:void 0);if(b){const{transition:S,transitionEnd:T,...C}=b;g={...g,...C,...T}}return g};function u(m){a=m(t)}function d(m){const{props:g}=t,v=Gx(t.parent)||{},y=[],b=new Set;let S={},T=1/0;for(let N=0;N<Xj;N++){const E=Zj[N],w=i[E],R=g[E]!==void 0?g[E]:v[E],M=ml(R),A=E===m?w.isActive:null;A===!1&&(T=N);let $=R===v[E]&&R!==g[E]&&M;if($&&o&&t.manuallyAnimateOnMount&&($=!1),w.protectedKeys={...S},!w.isActive&&A===null||!R&&!w.prevProp||Ac(R)||typeof R=="boolean")continue;const V=Jj(w.prevProp,R);let B=V||E===m&&w.isActive&&!$&&M||N>T&&M,F=!1;const X=Array.isArray(R)?R:[R];let J=X.reduce(r(E),{});A===!1&&(J={});const{prevResolvedValues:te={}}=w,ee={...te,...J},z=K=>{B=!0,b.has(K)&&(F=!0,b.delete(K)),w.needsAnimating[K]=!0;const se=t.getValue(K);se&&(se.liveStyle=!1)};for(const K in ee){const se=J[K],oe=te[K];if(S.hasOwnProperty(K))continue;let j=!1;Df(se)&&Df(oe)?j=!ix(se,oe):j=se!==oe,j?se!=null?z(K):b.add(K):se!==void 0&&b.has(K)?z(K):w.protectedKeys[K]=!0}w.prevProp=R,w.prevResolvedValues=J,w.isActive&&(S={...S,...J}),o&&t.blockInitialAnimation&&(B=!1),B&&(!($&&V)||F)&&y.push(...X.map(K=>({animation:K,options:{type:E}})))}if(b.size){const N={};b.forEach(E=>{const w=t.getBaseTarget(E),R=t.getValue(E);R&&(R.liveStyle=!0),N[E]=w??null}),y.push({animation:N})}let C=!!y.length;return o&&(g.initial===!1||g.initial===g.animate)&&!t.manuallyAnimateOnMount&&(C=!1),o=!1,C?a(y):Promise.resolve()}function p(m,g){var v;if(i[m].isActive===g)return Promise.resolve();(v=t.variantChildren)===null||v===void 0||v.forEach(b=>{var S;return(S=b.animationState)===null||S===void 0?void 0:S.setActive(m,g)}),i[m].isActive=g;const y=d(m);for(const b in i)i[b].protectedKeys={};return y}return{animateChanges:d,setActive:p,setAnimateFunction:u,getState:()=>i,reset:()=>{i=Hy(),o=!0}}}function Jj(t,a){return typeof a=="string"?a!==t:Array.isArray(a)?!ix(a,t):!1}function Ns(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Hy(){return{animate:Ns(!0),whileInView:Ns(),whileHover:Ns(),whileTap:Ns(),whileDrag:Ns(),whileFocus:Ns(),exit:Ns()}}class os{constructor(a){this.isMounted=!1,this.node=a}update(){}}class ew extends os{constructor(a){super(a),a.animationState||(a.animationState=Wj(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();Ac(a)&&(this.unmountControls=a.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:a}=this.node.getProps(),{animate:i}=this.node.prevProps||{};a!==i&&this.updateAnimationControlsSubscription()}unmount(){var a;this.node.animationState.reset(),(a=this.unmountControls)===null||a===void 0||a.call(this)}}let tw=0;class nw extends os{constructor(){super(...arguments),this.id=tw++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:i}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===o)return;const r=this.node.animationState.setActive("exit",!a);i&&!a&&r.then(()=>i(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const aw={animation:{Feature:ew},exit:{Feature:nw}},Ln={x:!1,y:!1};function $x(){return Ln.x||Ln.y}function sw(t){return t==="x"||t==="y"?Ln[t]?null:(Ln[t]=!0,()=>{Ln[t]=!1}):Ln.x||Ln.y?null:(Ln.x=Ln.y=!0,()=>{Ln.x=Ln.y=!1})}const Fh=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function bl(t,a,i,o={passive:!0}){return t.addEventListener(a,i,o),()=>t.removeEventListener(a,i)}function El(t){return{point:{x:t.pageX,y:t.pageY}}}const iw=t=>a=>Fh(a)&&t(a,El(a));function rl(t,a,i,o){return bl(t,a,iw(i),o)}const Py=(t,a)=>Math.abs(t-a);function ow(t,a){const i=Py(t.x,a.x),o=Py(t.y,a.y);return Math.sqrt(i**2+o**2)}class Fx{constructor(a,i,{transformPagePoint:o,contextWindow:r,dragSnapToOrigin:u=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=uf(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,S=ow(y.offset,{x:0,y:0})>=3;if(!b&&!S)return;const{point:T}=y,{timestamp:C}=Ut;this.history.push({...T,timestamp:C});const{onStart:N,onMove:E}=this.handlers;b||(N&&N(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,y)},this.handlePointerMove=(y,b)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=cf(b,this.transformPagePoint),lt.update(this.updatePoint,!0)},this.handlePointerUp=(y,b)=>{this.end();const{onEnd:S,onSessionEnd:T,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=uf(y.type==="pointercancel"?this.lastMoveEventInfo:cf(b,this.transformPagePoint),this.history);this.startEvent&&S&&S(y,N),T&&T(y,N)},!Fh(a))return;this.dragSnapToOrigin=u,this.handlers=i,this.transformPagePoint=o,this.contextWindow=r||window;const d=El(a),p=cf(d,this.transformPagePoint),{point:m}=p,{timestamp:g}=Ut;this.history=[{...m,timestamp:g}];const{onSessionStart:v}=i;v&&v(a,uf(p,this.history)),this.removeListeners=Cl(rl(this.contextWindow,"pointermove",this.handlePointerMove),rl(this.contextWindow,"pointerup",this.handlePointerUp),rl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),ns(this.updatePoint)}}function cf(t,a){return a?{point:a(t.point)}:t}function Gy(t,a){return{x:t.x-a.x,y:t.y-a.y}}function uf({point:t},a){return{point:t,delta:Gy(t,qx(a)),offset:Gy(t,lw(a)),velocity:rw(a,.1)}}function lw(t){return t[0]}function qx(t){return t[t.length-1]}function rw(t,a){if(t.length<2)return{x:0,y:0};let i=t.length-1,o=null;const r=qx(t);for(;i>=0&&(o=t[i],!(r.timestamp-o.timestamp>ya(a)));)i--;if(!o)return{x:0,y:0};const u=ba(r.timestamp-o.timestamp);if(u===0)return{x:0,y:0};const d={x:(r.x-o.x)/u,y:(r.y-o.y)/u};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}const Kx=1e-4,cw=1-Kx,uw=1+Kx,Yx=.01,dw=0-Yx,fw=0+Yx;function hn(t){return t.max-t.min}function hw(t,a,i){return Math.abs(t-a)<=i}function $y(t,a,i,o=.5){t.origin=o,t.originPoint=ut(a.min,a.max,t.origin),t.scale=hn(i)/hn(a),t.translate=ut(i.min,i.max,t.origin)-t.originPoint,(t.scale>=cw&&t.scale<=uw||isNaN(t.scale))&&(t.scale=1),(t.translate>=dw&&t.translate<=fw||isNaN(t.translate))&&(t.translate=0)}function cl(t,a,i,o){$y(t.x,a.x,i.x,o?o.originX:void 0),$y(t.y,a.y,i.y,o?o.originY:void 0)}function Fy(t,a,i){t.min=i.min+a.min,t.max=t.min+hn(a)}function pw(t,a,i){Fy(t.x,a.x,i.x),Fy(t.y,a.y,i.y)}function qy(t,a,i){t.min=a.min-i.min,t.max=t.min+hn(a)}function ul(t,a,i){qy(t.x,a.x,i.x),qy(t.y,a.y,i.y)}function mw(t,{min:a,max:i},o){return a!==void 0&&t<a?t=o?ut(a,t,o.min):Math.max(t,a):i!==void 0&&t>i&&(t=o?ut(i,t,o.max):Math.min(t,i)),t}function Ky(t,a,i){return{min:a!==void 0?t.min+a:void 0,max:i!==void 0?t.max+i-(t.max-t.min):void 0}}function gw(t,{top:a,left:i,bottom:o,right:r}){return{x:Ky(t.x,i,r),y:Ky(t.y,a,o)}}function Yy(t,a){let i=a.min-t.min,o=a.max-t.max;return a.max-a.min<t.max-t.min&&([i,o]=[o,i]),{min:i,max:o}}function vw(t,a){return{x:Yy(t.x,a.x),y:Yy(t.y,a.y)}}function yw(t,a){let i=.5;const o=hn(t),r=hn(a);return r>o?i=Fi(a.min,a.max-o,t.min):o>r&&(i=Fi(t.min,t.max-r,a.min)),Sa(0,1,i)}function bw(t,a){const i={};return a.min!==void 0&&(i.min=a.min-t.min),a.max!==void 0&&(i.max=a.max-t.min),i}const Pf=.35;function xw(t=Pf){return t===!1?t=0:t===!0&&(t=Pf),{x:Zy(t,"left","right"),y:Zy(t,"top","bottom")}}function Zy(t,a,i){return{min:Xy(t,a),max:Xy(t,i)}}function Xy(t,a){return typeof t=="number"?t:t[a]||0}const Qy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Li=()=>({x:Qy(),y:Qy()}),Wy=()=>({min:0,max:0}),vt=()=>({x:Wy(),y:Wy()});function An(t){return[t("x"),t("y")]}function Zx({top:t,left:a,right:i,bottom:o}){return{x:{min:a,max:i},y:{min:t,max:o}}}function _w({x:t,y:a}){return{top:a.min,right:t.max,bottom:a.max,left:t.min}}function Sw(t,a){if(!a)return t;const i=a({x:t.left,y:t.top}),o=a({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:o.y,right:o.x}}function df(t){return t===void 0||t===1}function Gf({scale:t,scaleX:a,scaleY:i}){return!df(t)||!df(a)||!df(i)}function As(t){return Gf(t)||Xx(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Xx(t){return Jy(t.x)||Jy(t.y)}function Jy(t){return t&&t!=="0%"}function vc(t,a,i){const o=t-i,r=a*o;return i+r}function e0(t,a,i,o,r){return r!==void 0&&(t=vc(t,r,o)),vc(t,i,o)+a}function $f(t,a=0,i=1,o,r){t.min=e0(t.min,a,i,o,r),t.max=e0(t.max,a,i,o,r)}function Qx(t,{x:a,y:i}){$f(t.x,a.translate,a.scale,a.originPoint),$f(t.y,i.translate,i.scale,i.originPoint)}const t0=.999999999999,n0=1.0000000000001;function Tw(t,a,i,o=!1){const r=i.length;if(!r)return;a.x=a.y=1;let u,d;for(let p=0;p<r;p++){u=i[p],d=u.projectionDelta;const{visualElement:m}=u.options;m&&m.props.style&&m.props.style.display==="contents"||(o&&u.options.layoutScroll&&u.scroll&&u!==u.root&&zi(t,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),d&&(a.x*=d.x.scale,a.y*=d.y.scale,Qx(t,d)),o&&As(u.latestValues)&&zi(t,u.latestValues))}a.x<n0&&a.x>t0&&(a.x=1),a.y<n0&&a.y>t0&&(a.y=1)}function Ui(t,a){t.min=t.min+a,t.max=t.max+a}function a0(t,a,i,o,r=.5){const u=ut(t.min,t.max,r);$f(t,a,i,u,o)}function zi(t,a){a0(t.x,a.x,a.scaleX,a.scale,a.originX),a0(t.y,a.y,a.scaleY,a.scale,a.originY)}function Wx(t,a){return Zx(Sw(t.getBoundingClientRect(),a))}function kw(t,a,i){const o=Wx(t,i),{scroll:r}=a;return r&&(Ui(o.x,r.offset.x),Ui(o.y,r.offset.y)),o}const Jx=({current:t})=>t?t.ownerDocument.defaultView:null,Cw=new WeakMap;class Ew{constructor(a){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=vt(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const r=v=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(El(v).point)},u=(v,y)=>{const{drag:b,dragPropagation:S,onDragStart:T}=this.getProps();if(b&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=sw(b),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),An(N=>{let E=this.getAxisMotionValue(N).get()||0;if(Zn.test(E)){const{projection:w}=this.visualElement;if(w&&w.layout){const R=w.layout.layoutBox[N];R&&(E=hn(R)*(parseFloat(E)/100))}}this.originPoint[N]=E}),T&&lt.postRender(()=>T(v,y)),Rf(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},d=(v,y)=>{const{dragPropagation:b,dragDirectionLock:S,onDirectionLock:T,onDrag:C}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:N}=y;if(S&&this.currentDirection===null){this.currentDirection=Nw(N),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",y.point,N),this.updateAxis("y",y.point,N),this.visualElement.render(),C&&C(v,y)},p=(v,y)=>this.stop(v,y),m=()=>An(v=>{var y;return this.getAnimationState(v)==="paused"&&((y=this.getAxisMotionValue(v).animation)===null||y===void 0?void 0:y.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new Fx(a,{onSessionStart:r,onStart:u,onMove:d,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:Jx(this.visualElement)})}stop(a,i){const o=this.isDragging;if(this.cancel(),!o)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:u}=this.getProps();u&&lt.postRender(()=>u(a,i))}cancel(){this.isDragging=!1;const{projection:a,animationState:i}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,o){const{drag:r}=this.getProps();if(!o||!Xr(a,r,this.currentDirection))return;const u=this.getAxisMotionValue(a);let d=this.originPoint[a]+o[a];this.constraints&&this.constraints[a]&&(d=mw(d,this.constraints[a],this.elastic[a])),u.set(d)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:o}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,u=this.constraints;i&&Bi(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&r?this.constraints=gw(r.layoutBox,i):this.constraints=!1,this.elastic=xw(o),u!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&An(d=>{this.constraints!==!1&&this.getAxisMotionValue(d)&&(this.constraints[d]=bw(r.layoutBox[d],this.constraints[d]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!Bi(a))return!1;const o=a.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const u=kw(o,r.root,this.visualElement.getTransformPagePoint());let d=vw(r.layout.layoutBox,u);if(i){const p=i(_w(d));this.hasMutatedConstraints=!!p,p&&(d=Zx(p))}return d}startAnimation(a){const{drag:i,dragMomentum:o,dragElastic:r,dragTransition:u,dragSnapToOrigin:d,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=An(v=>{if(!Xr(v,i,this.currentDirection))return;let y=m&&m[v]||{};d&&(y={min:0,max:0});const b=r?200:1e6,S=r?40:1e7,T={type:"inertia",velocity:o?a[v]:0,bounceStiffness:b,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...u,...y};return this.startAxisValueAnimation(v,T)});return Promise.all(g).then(p)}startAxisValueAnimation(a,i){const o=this.getAxisMotionValue(a);return Rf(this.visualElement,a),o.start($h(a,o,0,i,this.visualElement,!1))}stopAnimation(){An(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){An(a=>{var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.pause()})}getAnimationState(a){var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.state}getAxisMotionValue(a){const i=`_drag${a.toUpperCase()}`,o=this.visualElement.getProps(),r=o[i];return r||this.visualElement.getValue(a,(o.initial?o.initial[a]:void 0)||0)}snapToCursor(a){An(i=>{const{drag:o}=this.getProps();if(!Xr(i,o,this.currentDirection))return;const{projection:r}=this.visualElement,u=this.getAxisMotionValue(i);if(r&&r.layout){const{min:d,max:p}=r.layout.layoutBox[i];u.set(a[i]-ut(d,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:o}=this.visualElement;if(!Bi(i)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};An(d=>{const p=this.getAxisMotionValue(d);if(p&&this.constraints!==!1){const m=p.get();r[d]=yw({min:m,max:m},this.constraints[d])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),An(d=>{if(!Xr(d,a,null))return;const p=this.getAxisMotionValue(d),{min:m,max:g}=this.constraints[d];p.set(ut(m,g,r[d]))})}addListeners(){if(!this.visualElement.current)return;Cw.set(this.visualElement,this);const a=this.visualElement.current,i=rl(a,"pointerdown",m=>{const{drag:g,dragListener:v=!0}=this.getProps();g&&v&&this.start(m)}),o=()=>{const{dragConstraints:m}=this.getProps();Bi(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,u=r.addEventListener("measure",o);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),lt.read(o);const d=bl(window,"resize",()=>this.scalePositionWithinConstraints()),p=r.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(An(v=>{const y=this.getAxisMotionValue(v);y&&(this.originPoint[v]+=m[v].translate,y.set(y.get()+m[v].translate))}),this.visualElement.render())}));return()=>{d(),i(),u(),p&&p()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:o=!1,dragPropagation:r=!1,dragConstraints:u=!1,dragElastic:d=Pf,dragMomentum:p=!0}=a;return{...a,drag:i,dragDirectionLock:o,dragPropagation:r,dragConstraints:u,dragElastic:d,dragMomentum:p}}}function Xr(t,a,i){return(a===!0||a===t)&&(i===null||i===t)}function Nw(t,a=10){let i=null;return Math.abs(t.y)>a?i="y":Math.abs(t.x)>a&&(i="x"),i}class jw extends os{constructor(a){super(a),this.removeGroupControls=fn,this.removeListeners=fn,this.controls=new Ew(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fn}unmount(){this.removeGroupControls(),this.removeListeners()}}const s0=t=>(a,i)=>{t&&lt.postRender(()=>t(a,i))};class ww extends os{constructor(){super(...arguments),this.removePointerDownListener=fn}onPointerDown(a){this.session=new Fx(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Jx(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:o,onPanEnd:r}=this.node.getProps();return{onSessionStart:s0(a),onStart:s0(i),onMove:o,onEnd:(u,d)=>{delete this.session,r&&lt.postRender(()=>r(u,d))}}}mount(){this.removePointerDownListener=rl(this.node.current,"pointerdown",a=>this.onPointerDown(a))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const lc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function i0(t,a){return a.max===a.min?0:t/(a.max-a.min)*100}const Xo={correct:(t,a)=>{if(!a.target)return t;if(typeof t=="string")if(be.test(t))t=parseFloat(t);else return t;const i=i0(t,a.target.x),o=i0(t,a.target.y);return`${i}% ${o}%`}},Aw={correct:(t,{treeScale:a,projectionDelta:i})=>{const o=t,r=as.parse(t);if(r.length>5)return o;const u=as.createTransformer(t),d=typeof r[0]!="number"?1:0,p=i.x.scale*a.x,m=i.y.scale*a.y;r[0+d]/=p,r[1+d]/=m;const g=ut(p,m,.5);return typeof r[2+d]=="number"&&(r[2+d]/=g),typeof r[3+d]=="number"&&(r[3+d]/=g),u(r)}};class Dw extends x.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o,layoutId:r}=this.props,{projection:u}=a;aN(Rw),u&&(i.group&&i.group.add(u),o&&o.register&&r&&o.register(u),u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),lc.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:o,drag:r,isPresent:u}=this.props,d=o.projection;return d&&(d.isPresent=u,r||a.layoutDependency!==i||i===void 0?d.willUpdate():this.safeToRemove(),a.isPresent!==u&&(u?d.promote():d.relegate()||lt.postRender(()=>{const p=d.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),bh.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o}=this.props,{projection:r}=a;r&&(r.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(r),o&&o.deregister&&o.deregister(r))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function e_(t){const[a,i]=Ub(),o=x.useContext(fh);return c.jsx(Dw,{...t,layoutGroup:o,switchLayoutGroup:x.useContext(qb),isPresent:a,safeToRemove:i})}const Rw={borderRadius:{...Xo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Xo,borderTopRightRadius:Xo,borderBottomLeftRadius:Xo,borderBottomRightRadius:Xo,boxShadow:Aw};function Mw(t,a,i){const o=Pt(t)?t:vl(t);return o.start($h("",o,a,i)),o.animation}function Ow(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Bw=(t,a)=>t.depth-a.depth;class Iw{constructor(){this.children=[],this.isDirty=!1}add(a){Ah(this.children,a),this.isDirty=!0}remove(a){Dh(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(Bw),this.isDirty=!1,this.children.forEach(a)}}function Lw(t,a){const i=Xn.now(),o=({timestamp:r})=>{const u=r-i;u>=a&&(ns(o),t(u-a))};return lt.read(o,!0),()=>ns(o)}const t_=["TopLeft","TopRight","BottomLeft","BottomRight"],Uw=t_.length,o0=t=>typeof t=="string"?parseFloat(t):t,l0=t=>typeof t=="number"||be.test(t);function zw(t,a,i,o,r,u){r?(t.opacity=ut(0,i.opacity!==void 0?i.opacity:1,Vw(o)),t.opacityExit=ut(a.opacity!==void 0?a.opacity:1,0,Hw(o))):u&&(t.opacity=ut(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,o));for(let d=0;d<Uw;d++){const p=`border${t_[d]}Radius`;let m=r0(a,p),g=r0(i,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||l0(m)===l0(g)?(t[p]=Math.max(ut(o0(m),o0(g),o),0),(Zn.test(g)||Zn.test(m))&&(t[p]+="%")):t[p]=g}(a.rotate||i.rotate)&&(t.rotate=ut(a.rotate||0,i.rotate||0,o))}function r0(t,a){return t[a]!==void 0?t[a]:t.borderRadius}const Vw=n_(0,.5,yx),Hw=n_(.5,.95,fn);function n_(t,a,i){return o=>o<t?0:o>a?1:i(Fi(t,a,o))}function c0(t,a){t.min=a.min,t.max=a.max}function jn(t,a){c0(t.x,a.x),c0(t.y,a.y)}function u0(t,a){t.translate=a.translate,t.scale=a.scale,t.originPoint=a.originPoint,t.origin=a.origin}function d0(t,a,i,o,r){return t-=a,t=vc(t,1/i,o),r!==void 0&&(t=vc(t,1/r,o)),t}function Pw(t,a=0,i=1,o=.5,r,u=t,d=t){if(Zn.test(a)&&(a=parseFloat(a),a=ut(d.min,d.max,a/100)-d.min),typeof a!="number")return;let p=ut(u.min,u.max,o);t===u&&(p-=a),t.min=d0(t.min,a,i,p,r),t.max=d0(t.max,a,i,p,r)}function f0(t,a,[i,o,r],u,d){Pw(t,a[i],a[o],a[r],a.scale,u,d)}const Gw=["x","scaleX","originX"],$w=["y","scaleY","originY"];function h0(t,a,i,o){f0(t.x,a,Gw,i?i.x:void 0,o?o.x:void 0),f0(t.y,a,$w,i?i.y:void 0,o?o.y:void 0)}function p0(t){return t.translate===0&&t.scale===1}function a_(t){return p0(t.x)&&p0(t.y)}function m0(t,a){return t.min===a.min&&t.max===a.max}function Fw(t,a){return m0(t.x,a.x)&&m0(t.y,a.y)}function g0(t,a){return Math.round(t.min)===Math.round(a.min)&&Math.round(t.max)===Math.round(a.max)}function s_(t,a){return g0(t.x,a.x)&&g0(t.y,a.y)}function v0(t){return hn(t.x)/hn(t.y)}function y0(t,a){return t.translate===a.translate&&t.scale===a.scale&&t.originPoint===a.originPoint}class qw{constructor(){this.members=[]}add(a){Ah(this.members,a),a.scheduleRender()}remove(a){if(Dh(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(a){const i=this.members.findIndex(r=>a===r);if(i===0)return!1;let o;for(let r=i;r>=0;r--){const u=this.members[r];if(u.isPresent!==!1){o=u;break}}return o?(this.promote(o),!0):!1}promote(a,i){const o=this.lead;if(a!==o&&(this.prevLead=o,this.lead=a,a.show(),o)){o.instance&&o.scheduleRender(),a.scheduleRender(),a.resumeFrom=o,i&&(a.resumeFrom.preserveOpacity=!0),o.snapshot&&(a.snapshot=o.snapshot,a.snapshot.latestValues=o.animationValues||o.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:r}=a.options;r===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:i,resumingFrom:o}=a;i.onExitComplete&&i.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Kw(t,a,i){let o="";const r=t.x.translate/a.x,u=t.y.translate/a.y,d=(i==null?void 0:i.z)||0;if((r||u||d)&&(o=`translate3d(${r}px, ${u}px, ${d}px) `),(a.x!==1||a.y!==1)&&(o+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:g,rotate:v,rotateX:y,rotateY:b,skewX:S,skewY:T}=i;g&&(o=`perspective(${g}px) ${o}`),v&&(o+=`rotate(${v}deg) `),y&&(o+=`rotateX(${y}deg) `),b&&(o+=`rotateY(${b}deg) `),S&&(o+=`skewX(${S}deg) `),T&&(o+=`skewY(${T}deg) `)}const p=t.x.scale*a.x,m=t.y.scale*a.y;return(p!==1||m!==1)&&(o+=`scale(${p}, ${m})`),o||"none"}const Ds={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},tl=typeof window<"u"&&window.MotionDebug!==void 0,ff=["","X","Y","Z"],Yw={visibility:"hidden"},b0=1e3;let Zw=0;function hf(t,a,i,o){const{latestValues:r}=a;r[t]&&(i[t]=r[t],a.setStaticValue(t,0),o&&(o[t]=0))}function i_(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:a}=t.options;if(!a)return;const i=rx(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:r,layoutId:u}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",lt,!(r||u))}const{parent:o}=t;o&&!o.hasCheckedOptimisedAppear&&i_(o)}function o_({attachResizeListener:t,defaultParent:a,measureScroll:i,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(d={},p=a==null?void 0:a()){this.id=Zw++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,tl&&(Ds.totalNodes=Ds.resolvedTargetDeltas=Ds.recalculatedProjection=0),this.nodes.forEach(Ww),this.nodes.forEach(aA),this.nodes.forEach(sA),this.nodes.forEach(Jw),tl&&window.MotionDebug.record(Ds)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=d,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new Iw)}addEventListener(d,p){return this.eventHandlers.has(d)||this.eventHandlers.set(d,new Rh),this.eventHandlers.get(d).add(p)}notifyListeners(d,...p){const m=this.eventHandlers.get(d);m&&m.notify(...p)}hasListeners(d){return this.eventHandlers.has(d)}mount(d,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Ow(d),this.instance=d;const{layoutId:m,layout:g,visualElement:v}=this.options;if(v&&!v.current&&v.mount(d),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(g||m)&&(this.isLayoutDirty=!0),t){let y;const b=()=>this.root.updateBlockedByResize=!1;t(d,()=>{this.root.updateBlockedByResize=!0,y&&y(),y=Lw(b,250),lc.hasAnimatedSinceResize&&(lc.hasAnimatedSinceResize=!1,this.nodes.forEach(_0))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&v&&(m||g)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:b,hasRelativeTargetChanged:S,layout:T})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const C=this.options.transition||v.getDefaultTransition()||cA,{onLayoutAnimationStart:N,onLayoutAnimationComplete:E}=v.getProps(),w=!this.targetLayout||!s_(this.targetLayout,T)||S,R=!b&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||R||b&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(y,R);const M={...wh(C,"layout"),onPlay:N,onComplete:E};(v.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M)}else b||_0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=T})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const d=this.getStack();d&&d.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ns(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(iA),this.animationId++)}getTransformTemplate(){const{visualElement:d}=this.options;return d&&d.getProps().transformTemplate}willUpdate(d=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&i_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let v=0;v<this.path.length;v++){const y=this.path[v];y.shouldResetTransform=!0,y.updateScroll("snapshot"),y.options.layoutRoot&&y.willUpdate(!1)}const{layoutId:p,layout:m}=this.options;if(p===void 0&&!m)return;const g=this.getTransformTemplate();this.prevTransformTemplateValue=g?g(this.latestValues,""):void 0,this.updateSnapshot(),d&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(x0);return}this.isUpdating||this.nodes.forEach(tA),this.isUpdating=!1,this.nodes.forEach(nA),this.nodes.forEach(Xw),this.nodes.forEach(Qw),this.clearAllSnapshots();const p=Xn.now();Ut.delta=Sa(0,1e3/60,p-Ut.timestamp),Ut.timestamp=p,Ut.isProcessing=!0,af.update.process(Ut),af.preRender.process(Ut),af.render.process(Ut),Ut.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,bh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(eA),this.sharedNodes.forEach(oA)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,lt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){lt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const d=this.layout;this.layout=this.measure(!1),this.layoutCorrected=vt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,d?d.layoutBox:void 0)}updateScroll(d="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===d&&(p=!1),p){const m=o(this.instance);this.scroll={animationId:this.root.animationId,phase:d,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!r)return;const d=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!a_(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,v=g!==this.prevTransformTemplateValue;d&&(p||As(this.latestValues)||v)&&(r(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(d=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return d&&(m=this.removeTransform(m)),uA(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:p}=this.options;if(!p)return vt();const m=p.measureViewportBox();if(!(((d=this.scroll)===null||d===void 0?void 0:d.wasRoot)||this.path.some(dA))){const{scroll:v}=this.root;v&&(Ui(m.x,v.offset.x),Ui(m.y,v.offset.y))}return m}removeElementScroll(d){var p;const m=vt();if(jn(m,d),!((p=this.scroll)===null||p===void 0)&&p.wasRoot)return m;for(let g=0;g<this.path.length;g++){const v=this.path[g],{scroll:y,options:b}=v;v!==this.root&&y&&b.layoutScroll&&(y.wasRoot&&jn(m,d),Ui(m.x,y.offset.x),Ui(m.y,y.offset.y))}return m}applyTransform(d,p=!1){const m=vt();jn(m,d);for(let g=0;g<this.path.length;g++){const v=this.path[g];!p&&v.options.layoutScroll&&v.scroll&&v!==v.root&&zi(m,{x:-v.scroll.offset.x,y:-v.scroll.offset.y}),As(v.latestValues)&&zi(m,v.latestValues)}return As(this.latestValues)&&zi(m,this.latestValues),m}removeTransform(d){const p=vt();jn(p,d);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!As(g.latestValues))continue;Gf(g.latestValues)&&g.updateSnapshot();const v=vt(),y=g.measurePageBox();jn(v,y),h0(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,v)}return As(this.latestValues)&&h0(p,this.latestValues),p}setTargetDelta(d){this.targetDelta=d,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(d){this.options={...this.options,...d,crossfade:d.crossfade!==void 0?d.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ut.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(d=!1){var p;const m=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=m.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=m.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=m.isSharedProjectionDirty);const g=!!this.resumingFrom||this!==m;if(!(d||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:b}=this.options;if(!(!this.layout||!(y||b))){if(this.resolvedRelativeTargetAt=Ut.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=vt(),this.relativeTargetOrigin=vt(),ul(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),jn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=vt(),this.targetWithTransforms=vt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),pw(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):jn(this.target,this.layout.layoutBox),Qx(this.target,this.targetDelta)):jn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const S=this.getClosestProjectingParent();S&&!!S.resumingFrom==!!this.resumingFrom&&!S.options.layoutScroll&&S.target&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=vt(),this.relativeTargetOrigin=vt(),ul(this.relativeTargetOrigin,this.target,S.target),jn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}tl&&Ds.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Gf(this.parent.latestValues)||Xx(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var d;const p=this.getLead(),m=!!this.resumingFrom||this!==p;let g=!0;if((this.isProjectionDirty||!((d=this.parent)===null||d===void 0)&&d.isProjectionDirty)&&(g=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===Ut.timestamp&&(g=!1),g)return;const{layout:v,layoutId:y}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(v||y))return;jn(this.layoutCorrected,this.layout.layoutBox);const b=this.treeScale.x,S=this.treeScale.y;Tw(this.layoutCorrected,this.treeScale,this.path,m),p.layout&&!p.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(p.target=p.layout.layoutBox,p.targetWithTransforms=vt());const{target:T}=p;if(!T){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(u0(this.prevProjectionDelta.x,this.projectionDelta.x),u0(this.prevProjectionDelta.y,this.projectionDelta.y)),cl(this.projectionDelta,this.layoutCorrected,T,this.latestValues),(this.treeScale.x!==b||this.treeScale.y!==S||!y0(this.projectionDelta.x,this.prevProjectionDelta.x)||!y0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",T)),tl&&Ds.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(d=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),d){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Li(),this.projectionDelta=Li(),this.projectionDeltaWithTransform=Li()}setAnimationOrigin(d,p=!1){const m=this.snapshot,g=m?m.latestValues:{},v={...this.latestValues},y=Li();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const b=vt(),S=m?m.source:void 0,T=this.layout?this.layout.source:void 0,C=S!==T,N=this.getStack(),E=!N||N.members.length<=1,w=!!(C&&!E&&this.options.crossfade===!0&&!this.path.some(rA));this.animationProgress=0;let R;this.mixTargetDelta=M=>{const A=M/1e3;S0(y.x,d.x,A),S0(y.y,d.y,A),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ul(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),lA(this.relativeTarget,this.relativeTargetOrigin,b,A),R&&Fw(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=vt()),jn(R,this.relativeTarget)),C&&(this.animationValues=v,zw(v,g,this.latestValues,A,w,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(d){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ns(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=lt.update(()=>{lc.hasAnimatedSinceResize=!0,this.currentAnimation=Mw(0,b0,{...d,onUpdate:p=>{this.mixTargetDelta(p),d.onUpdate&&d.onUpdate(p)},onComplete:()=>{d.onComplete&&d.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const d=this.getStack();d&&d.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(b0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const d=this.getLead();let{targetWithTransforms:p,target:m,layout:g,latestValues:v}=d;if(!(!p||!m||!g)){if(this!==d&&this.layout&&g&&l_(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||vt();const y=hn(this.layout.layoutBox.x);m.x.min=d.target.x.min,m.x.max=m.x.min+y;const b=hn(this.layout.layoutBox.y);m.y.min=d.target.y.min,m.y.max=m.y.min+b}jn(p,m),zi(p,v),cl(this.projectionDeltaWithTransform,this.layoutCorrected,p,v)}}registerSharedNode(d,p){this.sharedNodes.has(d)||this.sharedNodes.set(d,new qw),this.sharedNodes.get(d).add(p);const g=p.options.initialPromotionConfig;p.promote({transition:g?g.transition:void 0,preserveFollowOpacity:g&&g.shouldPreserveFollowOpacity?g.shouldPreserveFollowOpacity(p):void 0})}isLead(){const d=this.getStack();return d?d.lead===this:!0}getLead(){var d;const{layoutId:p}=this.options;return p?((d=this.getStack())===null||d===void 0?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:p}=this.options;return p?(d=this.getStack())===null||d===void 0?void 0:d.prevLead:void 0}getStack(){const{layoutId:d}=this.options;if(d)return this.root.sharedNodes.get(d)}promote({needsReset:d,transition:p,preserveFollowOpacity:m}={}){const g=this.getStack();g&&g.promote(this,m),d&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const d=this.getStack();return d?d.relegate(this):!1}resetSkewAndRotation(){const{visualElement:d}=this.options;if(!d)return;let p=!1;const{latestValues:m}=d;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const g={};m.z&&hf("z",d,g,this.animationValues);for(let v=0;v<ff.length;v++)hf(`rotate${ff[v]}`,d,g,this.animationValues),hf(`skew${ff[v]}`,d,g,this.animationValues);d.render();for(const v in g)d.setStaticValue(v,g[v]),this.animationValues&&(this.animationValues[v]=g[v]);d.scheduleRender()}getProjectionStyles(d){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Yw;const g={visibility:""},v=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=ic(d==null?void 0:d.pointerEvents)||"",g.transform=v?v(this.latestValues,""):"none",g;const y=this.getLead();if(!this.projectionDelta||!this.layout||!y.target){const C={};return this.options.layoutId&&(C.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,C.pointerEvents=ic(d==null?void 0:d.pointerEvents)||""),this.hasProjected&&!As(this.latestValues)&&(C.transform=v?v({},""):"none",this.hasProjected=!1),C}const b=y.animationValues||y.latestValues;this.applyTransformsToTarget(),g.transform=Kw(this.projectionDeltaWithTransform,this.treeScale,b),v&&(g.transform=v(b,g.transform));const{x:S,y:T}=this.projectionDelta;g.transformOrigin=`${S.origin*100}% ${T.origin*100}% 0`,y.animationValues?g.opacity=y===this?(m=(p=b.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:b.opacityExit:g.opacity=y===this?b.opacity!==void 0?b.opacity:"":b.opacityExit!==void 0?b.opacityExit:0;for(const C in fc){if(b[C]===void 0)continue;const{correct:N,applyTo:E}=fc[C],w=g.transform==="none"?b[C]:N(b[C],y);if(E){const R=E.length;for(let M=0;M<R;M++)g[E[M]]=w}else g[C]=w}return this.options.layoutId&&(g.pointerEvents=y===this?ic(d==null?void 0:d.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(d=>{var p;return(p=d.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(x0),this.root.sharedNodes.clear()}}}function Xw(t){t.updateLayout()}function Qw(t){var a;const i=((a=t.resumeFrom)===null||a===void 0?void 0:a.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:r}=t.layout,{animationType:u}=t.options,d=i.source!==t.layout.source;u==="size"?An(y=>{const b=d?i.measuredBox[y]:i.layoutBox[y],S=hn(b);b.min=o[y].min,b.max=b.min+S}):l_(u,i.layoutBox,o)&&An(y=>{const b=d?i.measuredBox[y]:i.layoutBox[y],S=hn(o[y]);b.max=b.min+S,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[y].max=t.relativeTarget[y].min+S)});const p=Li();cl(p,o,i.layoutBox);const m=Li();d?cl(m,t.applyTransform(r,!0),i.measuredBox):cl(m,o,i.layoutBox);const g=!a_(p);let v=!1;if(!t.resumeFrom){const y=t.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:b,layout:S}=y;if(b&&S){const T=vt();ul(T,i.layoutBox,b.layoutBox);const C=vt();ul(C,o,S.layoutBox),s_(T,C)||(v=!0),y.options.layoutRoot&&(t.relativeTarget=C,t.relativeTargetOrigin=T,t.relativeParent=y)}}}t.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:m,layoutDelta:p,hasLayoutChanged:g,hasRelativeTargetChanged:v})}else if(t.isLead()){const{onExitComplete:o}=t.options;o&&o()}t.options.transition=void 0}function Ww(t){tl&&Ds.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Jw(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function eA(t){t.clearSnapshot()}function x0(t){t.clearMeasurements()}function tA(t){t.isLayoutDirty=!1}function nA(t){const{visualElement:a}=t.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),t.resetTransform()}function _0(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function aA(t){t.resolveTargetDelta()}function sA(t){t.calcProjection()}function iA(t){t.resetSkewAndRotation()}function oA(t){t.removeLeadSnapshot()}function S0(t,a,i){t.translate=ut(a.translate,0,i),t.scale=ut(a.scale,1,i),t.origin=a.origin,t.originPoint=a.originPoint}function T0(t,a,i,o){t.min=ut(a.min,i.min,o),t.max=ut(a.max,i.max,o)}function lA(t,a,i,o){T0(t.x,a.x,i.x,o),T0(t.y,a.y,i.y,o)}function rA(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const cA={duration:.45,ease:[.4,0,.1,1]},k0=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),C0=k0("applewebkit/")&&!k0("chrome/")?Math.round:fn;function E0(t){t.min=C0(t.min),t.max=C0(t.max)}function uA(t){E0(t.x),E0(t.y)}function l_(t,a,i){return t==="position"||t==="preserve-aspect"&&!hw(v0(a),v0(i),.2)}function dA(t){var a;return t!==t.root&&((a=t.scroll)===null||a===void 0?void 0:a.wasRoot)}const fA=o_({attachResizeListener:(t,a)=>bl(t,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),pf={current:void 0},r_=o_({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!pf.current){const t=new fA({});t.mount(window),t.setOptions({layoutScroll:!0}),pf.current=t}return pf.current},resetTransform:(t,a)=>{t.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),hA={pan:{Feature:ww},drag:{Feature:jw,ProjectionNode:r_,MeasureLayout:e_}};function pA(t,a,i){var o;if(t instanceof Element)return[t];if(typeof t=="string"){let r=document;const u=(o=void 0)!==null&&o!==void 0?o:r.querySelectorAll(t);return u?Array.from(u):[]}return Array.from(t)}function c_(t,a){const i=pA(t),o=new AbortController,r={passive:!0,...a,signal:o.signal};return[i,r,()=>o.abort()]}function N0(t){return a=>{a.pointerType==="touch"||$x()||t(a)}}function mA(t,a,i={}){const[o,r,u]=c_(t,i),d=N0(p=>{const{target:m}=p,g=a(p);if(typeof g!="function"||!m)return;const v=N0(y=>{g(y),m.removeEventListener("pointerleave",v)});m.addEventListener("pointerleave",v,r)});return o.forEach(p=>{p.addEventListener("pointerenter",d,r)}),u}function j0(t,a,i){const{props:o}=t;t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",i==="Start");const r="onHover"+i,u=o[r];u&&lt.postRender(()=>u(a,El(a)))}class gA extends os{mount(){const{current:a}=this.node;a&&(this.unmount=mA(a,i=>(j0(this.node,i,"Start"),o=>j0(this.node,o,"End"))))}unmount(){}}class vA extends os{constructor(){super(...arguments),this.isActive=!1}onFocus(){let a=!1;try{a=this.node.current.matches(":focus-visible")}catch{a=!0}!a||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Cl(bl(this.node.current,"focus",()=>this.onFocus()),bl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const u_=(t,a)=>a?t===a?!0:u_(t,a.parentElement):!1,yA=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function bA(t){return yA.has(t.tagName)||t.tabIndex!==-1}const nl=new WeakSet;function w0(t){return a=>{a.key==="Enter"&&t(a)}}function mf(t,a){t.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const xA=(t,a)=>{const i=t.currentTarget;if(!i)return;const o=w0(()=>{if(nl.has(i))return;mf(i,"down");const r=w0(()=>{mf(i,"up")}),u=()=>mf(i,"cancel");i.addEventListener("keyup",r,a),i.addEventListener("blur",u,a)});i.addEventListener("keydown",o,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",o),a)};function A0(t){return Fh(t)&&!$x()}function _A(t,a,i={}){const[o,r,u]=c_(t,i),d=p=>{const m=p.currentTarget;if(!A0(p)||nl.has(m))return;nl.add(m);const g=a(p),v=(S,T)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",b),!(!A0(S)||!nl.has(m))&&(nl.delete(m),typeof g=="function"&&g(S,{success:T}))},y=S=>{v(S,i.useGlobalTarget||u_(m,S.target))},b=S=>{v(S,!1)};window.addEventListener("pointerup",y,r),window.addEventListener("pointercancel",b,r)};return o.forEach(p=>{!bA(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(i.useGlobalTarget?window:p).addEventListener("pointerdown",d,r),p.addEventListener("focus",g=>xA(g,r),r)}),u}function D0(t,a,i){const{props:o}=t;t.animationState&&o.whileTap&&t.animationState.setActive("whileTap",i==="Start");const r="onTap"+(i==="End"?"":i),u=o[r];u&&lt.postRender(()=>u(a,El(a)))}class SA extends os{mount(){const{current:a}=this.node;a&&(this.unmount=_A(a,i=>(D0(this.node,i,"Start"),(o,{success:r})=>D0(this.node,o,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ff=new WeakMap,gf=new WeakMap,TA=t=>{const a=Ff.get(t.target);a&&a(t)},kA=t=>{t.forEach(TA)};function CA({root:t,...a}){const i=t||document;gf.has(i)||gf.set(i,{});const o=gf.get(i),r=JSON.stringify(a);return o[r]||(o[r]=new IntersectionObserver(kA,{root:t,...a})),o[r]}function EA(t,a,i){const o=CA(a);return Ff.set(t,i),o.observe(t),()=>{Ff.delete(t),o.unobserve(t)}}const NA={some:0,all:1};class jA extends os{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:o,amount:r="some",once:u}=a,d={root:i?i.current:void 0,rootMargin:o,threshold:typeof r=="number"?r:NA[r]},p=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,u&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:v,onViewportLeave:y}=this.node.getProps(),b=g?v:y;b&&b(m)};return EA(this.node.current,d,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:i}=this.node;["amount","margin","root"].some(wA(a,i))&&this.startObserver()}unmount(){}}function wA({viewport:t={}},{viewport:a={}}={}){return i=>t[i]!==a[i]}const AA={inView:{Feature:jA},tap:{Feature:SA},focus:{Feature:vA},hover:{Feature:gA}},DA={layout:{ProjectionNode:r_,MeasureLayout:e_}},yc={current:null},qh={current:!1};function d_(){if(qh.current=!0,!!mh)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),a=()=>yc.current=t.matches;t.addListener(a),a()}else yc.current=!1}const RA=[...Rx,Ht,as],MA=t=>RA.find(Dx(t)),R0=new WeakMap;function OA(t,a,i){for(const o in a){const r=a[o],u=i[o];if(Pt(r))t.addValue(o,r);else if(Pt(u))t.addValue(o,vl(r,{owner:t}));else if(u!==r)if(t.hasValue(o)){const d=t.getValue(o);d.liveStyle===!0?d.jump(r):d.hasAnimated||d.set(r)}else{const d=t.getStaticValue(o);t.addValue(o,vl(d!==void 0?d:r,{owner:t}))}}for(const o in i)a[o]===void 0&&t.removeValue(o);return a}const M0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class BA{scrapeMotionValuesFromProps(a,i,o){return{}}constructor({parent:a,props:i,presenceContext:o,reducedMotionConfig:r,blockInitialAnimation:u,visualState:d},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Hh,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const S=Xn.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,lt.render(this.render,!1,!0))};const{latestValues:m,renderState:g,onUpdate:v}=d;this.onUpdate=v,this.latestValues=m,this.baseTarget={...m},this.initialValues=i.initial?{...m}:{},this.renderState=g,this.parent=a,this.props=i,this.presenceContext=o,this.depth=a?a.depth+1:0,this.reducedMotionConfig=r,this.options=p,this.blockInitialAnimation=!!u,this.isControllingVariants=Dc(i),this.isVariantNode=$b(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:y,...b}=this.scrapeMotionValuesFromProps(i,{},this);for(const S in b){const T=b[S];m[S]!==void 0&&Pt(T)&&T.set(m[S],!1)}}mount(a){this.current=a,R0.set(a,this),this.projection&&!this.projection.instance&&this.projection.mount(a),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,o)=>this.bindToMotionValue(o,i)),qh.current||d_(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:yc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){R0.delete(this.current),this.projection&&this.projection.unmount(),ns(this.notifyUpdate),ns(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const a in this.events)this.events[a].clear();for(const a in this.features){const i=this.features[a];i&&(i.unmount(),i.isMounted=!1)}this.current=null}bindToMotionValue(a,i){this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)();const o=Vs.has(a),r=i.on("change",p=>{this.latestValues[a]=p,this.props.onUpdate&&lt.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0)}),u=i.on("renderRequest",this.scheduleRender);let d;window.MotionCheckAppearSync&&(d=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{r(),u(),d&&d(),i.owner&&i.stop()})}sortNodePosition(a){return!this.current||!this.sortInstanceNodePosition||this.type!==a.type?0:this.sortInstanceNodePosition(this.current,a.current)}updateFeatures(){let a="animation";for(a in $i){const i=$i[a];if(!i)continue;const{isEnabled:o,Feature:r}=i;if(!this.features[a]&&r&&o(this.props)&&(this.features[a]=new r(this)),this.features[a]){const u=this.features[a];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):vt()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,i){this.latestValues[a]=i}update(a,i){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let o=0;o<M0.length;o++){const r=M0[o];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const u="on"+r,d=a[u];d&&(this.propEventSubscriptions[r]=this.on(r,d))}this.prevMotionValues=OA(this,this.scrapeMotionValuesFromProps(a,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(a){return this.props.variants?this.props.variants[a]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(a){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(a),()=>i.variantChildren.delete(a)}addValue(a,i){const o=this.values.get(a);i!==o&&(o&&this.removeValue(a),this.bindToMotionValue(a,i),this.values.set(a,i),this.latestValues[a]=i.get())}removeValue(a){this.values.delete(a);const i=this.valueSubscriptions.get(a);i&&(i(),this.valueSubscriptions.delete(a)),delete this.latestValues[a],this.removeValueFromRenderState(a,this.renderState)}hasValue(a){return this.values.has(a)}getValue(a,i){if(this.props.values&&this.props.values[a])return this.props.values[a];let o=this.values.get(a);return o===void 0&&i!==void 0&&(o=vl(i===null?void 0:i,{owner:this}),this.addValue(a,o)),o}readValue(a,i){var o;let r=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(o=this.getBaseTargetFromProps(this.props,a))!==null&&o!==void 0?o:this.readValueFromInstance(this.current,a,this.options);return r!=null&&(typeof r=="string"&&(wx(r)||xx(r))?r=parseFloat(r):!MA(r)&&as.test(i)&&(r=Ex(a,i)),this.setBaseTarget(a,Pt(r)?r.get():r)),Pt(r)?r.get():r}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:o}=this.props;let r;if(typeof o=="string"||typeof o=="object"){const d=_h(this.props,o,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);d&&(r=d[a])}if(o&&r!==void 0)return r;const u=this.getBaseTargetFromProps(this.props,a);return u!==void 0&&!Pt(u)?u:this.initialValues[a]!==void 0&&r===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new Rh),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class f_ extends BA{constructor(){super(...arguments),this.KeyframeResolver=Mx}sortInstanceNodePosition(a,i){return a.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(a,i){return a.style?a.style[i]:void 0}removeValueFromRenderState(a,{vars:i,style:o}){delete i[a],delete o[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;Pt(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function IA(t){return window.getComputedStyle(t)}class LA extends f_{constructor(){super(...arguments),this.type="html",this.renderInstance=Jb}readValueFromInstance(a,i){if(Vs.has(i)){const o=Vh(i);return o&&o.default||0}else{const o=IA(a),r=(Xb(i)?o.getPropertyValue(i):o[i])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(a,{transformPagePoint:i}){return Wx(a,i)}build(a,i,o){kh(a,i,o.transformTemplate)}scrapeMotionValuesFromProps(a,i,o){return jh(a,i,o)}}class UA extends f_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=vt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if(Vs.has(i)){const o=Vh(i);return o&&o.default||0}return i=ex.has(i)?i:yh(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,o){return ax(a,i,o)}build(a,i,o){Ch(a,i,this.isSVGTag,o.transformTemplate)}renderInstance(a,i,o,r){tx(a,i,o,r)}mount(a){this.isSVGTag=Nh(a.tagName),super.mount(a)}}const zA=(t,a)=>xh(t)?new UA(a):new LA(a,{allowProjection:t!==x.Fragment}),VA=fN({...aw,...AA,...hA,...DA},zA),Ct=NE(VA);function HA(){!qh.current&&d_();const[t]=x.useState(yc.current);return t}var et;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TEXT=1]="TEXT",t[t.TOOL_USE=2]="TOOL_USE",t[t.TOOL_RESULT=3]="TOOL_RESULT",t[t.ERROR=4]="ERROR",t[t.STATUS=5]="STATUS",t[t.SYSTEM=6]="SYSTEM",t[t.FINDING=7]="FINDING",t[t.SUBTASK_CREATE=8]="SUBTASK_CREATE",t[t.USER_INPUT=9]="USER_INPUT",t[t.SIGNAL=10]="SIGNAL",t[t.USAGE=11]="USAGE"})(et||(et={}));var kt;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.NOT_STARTED=1]="NOT_STARTED",t[t.WORKING=3]="WORKING",t[t.PAUSED=4]="PAUSED",t[t.COMPLETE=5]="COMPLETE",t[t.FAILED=6]="FAILED"})(kt||(kt={}));var Ja;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ACTIVE=1]="ACTIVE",t[t.ARCHIVED=2]="ARCHIVED"})(Ja||(Ja={}));var es;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OPEN=1]="OPEN",t[t.CLOSED=2]="CLOSED"})(es||(es={}));var Fn;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OFF=1]="OFF",t[t.SUBSCRIPTION=2]="SUBSCRIPTION",t[t.API_KEY=3]="API_KEY"})(Fn||(Fn={}));var ts;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OFF=1]="OFF",t[t.ON=2]="ON"})(ts||(ts={}));const PA=8,O0="system",Qo="system";Object.assign(Object.create(null),{"":et.UNSPECIFIED,text:et.TEXT,tool_use:et.TOOL_USE,tool_result:et.TOOL_RESULT,error:et.ERROR,status:et.STATUS,system:et.SYSTEM,finding:et.FINDING,subtask_create:et.SUBTASK_CREATE,user_input:et.USER_INPUT,signal:et.SIGNAL,usage:et.USAGE});et.UNSPECIFIED+"",et.TEXT+"",et.TOOL_USE+"",et.TOOL_RESULT+"",et.ERROR+"",et.STATUS+"",et.SYSTEM+"",et.FINDING+"",et.SUBTASK_CREATE+"",et.USER_INPUT+"",et.SIGNAL+"",et.USAGE+"";Object.assign(Object.create(null),{"":kt.UNSPECIFIED,not_started:kt.NOT_STARTED,working:kt.WORKING,paused:kt.PAUSED,complete:kt.COMPLETE,failed:kt.FAILED,pending:kt.NOT_STARTED,assigned:kt.NOT_STARTED,in_progress:kt.WORKING,waiting_input:kt.PAUSED,review:kt.PAUSED,done:kt.COMPLETE});kt.UNSPECIFIED+"",kt.NOT_STARTED+"",kt.WORKING+"",kt.PAUSED+"",kt.COMPLETE+"",kt.FAILED+"";Object.assign(Object.create(null),{"":Ja.UNSPECIFIED,active:Ja.ACTIVE,archived:Ja.ARCHIVED});Ja.UNSPECIFIED+"",Ja.ACTIVE+"",Ja.ARCHIVED+"";Object.assign(Object.create(null),{"":es.UNSPECIFIED,open:es.OPEN,closed:es.CLOSED});es.UNSPECIFIED+"",es.OPEN+"",es.CLOSED+"";Object.assign(Object.create(null),{"":Fn.UNSPECIFIED,off:Fn.OFF,subscription:Fn.SUBSCRIPTION,api_key:Fn.API_KEY});Fn.UNSPECIFIED+"",Fn.OFF+"",Fn.SUBSCRIPTION+"",Fn.API_KEY+"";Object.assign(Object.create(null),{"":ts.UNSPECIFIED,off:ts.OFF,on:ts.ON});ts.UNSPECIFIED+"",ts.OFF+"",ts.ON+"";function Ta(t){return Array.isArray?Array.isArray(t):m_(t)==="[object Array]"}function GA(t){if(typeof t=="string")return t;let a=t+"";return a=="0"&&1/t==-1/0?"-0":a}function $A(t){return t==null?"":GA(t)}function qn(t){return typeof t=="string"}function h_(t){return typeof t=="number"}function FA(t){return t===!0||t===!1||qA(t)&&m_(t)=="[object Boolean]"}function p_(t){return typeof t=="object"}function qA(t){return p_(t)&&t!==null}function dn(t){return t!=null}function vf(t){return!t.trim().length}function m_(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const KA="Incorrect 'index' type",YA=t=>`Invalid value for key ${t}`,ZA=t=>`Pattern length exceeds max of ${t}.`,XA=t=>`Missing ${t} property in key`,QA=t=>`Property 'weight' in key '${t}' must be a positive integer`,B0=Object.prototype.hasOwnProperty;class WA{constructor(a){this._keys=[],this._keyMap={};let i=0;a.forEach(o=>{let r=g_(o);this._keys.push(r),this._keyMap[r.id]=r,i+=r.weight}),this._keys.forEach(o=>{o.weight/=i})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function g_(t){let a=null,i=null,o=null,r=1,u=null;if(qn(t)||Ta(t))o=t,a=I0(t),i=qf(t);else{if(!B0.call(t,"name"))throw new Error(XA("name"));const d=t.name;if(o=d,B0.call(t,"weight")&&(r=t.weight,r<=0))throw new Error(QA(d));a=I0(d),i=qf(d),u=t.getFn}return{path:a,id:i,weight:r,src:o,getFn:u}}function I0(t){return Ta(t)?t:t.split(".")}function qf(t){return Ta(t)?t.join("."):t}function JA(t,a){let i=[],o=!1;const r=(u,d,p)=>{if(dn(u))if(!d[p])i.push(u);else{let m=d[p];const g=u[m];if(!dn(g))return;if(p===d.length-1&&(qn(g)||h_(g)||FA(g)))i.push($A(g));else if(Ta(g)){o=!0;for(let v=0,y=g.length;v<y;v+=1)r(g[v],d,p+1)}else d.length&&r(g,d,p+1)}};return r(t,qn(a)?a.split("."):a,0),o?i:i[0]}const e2={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},t2={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,a)=>t.score===a.score?t.idx<a.idx?-1:1:t.score<a.score?-1:1},n2={location:0,threshold:.6,distance:100},a2={useExtendedSearch:!1,getFn:JA,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var xe={...t2,...e2,...n2,...a2};const s2=/[^ ]+/g;function i2(t=1,a=3){const i=new Map,o=Math.pow(10,a);return{get(r){const u=r.match(s2).length;if(i.has(u))return i.get(u);const d=1/Math.pow(u,.5*t),p=parseFloat(Math.round(d*o)/o);return i.set(u,p),p},clear(){i.clear()}}}class Kh{constructor({getFn:a=xe.getFn,fieldNormWeight:i=xe.fieldNormWeight}={}){this.norm=i2(i,3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}setSources(a=[]){this.docs=a}setIndexRecords(a=[]){this.records=a}setKeys(a=[]){this.keys=a,this._keysMap={},a.forEach((i,o)=>{this._keysMap[i.id]=o})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,qn(this.docs[0])?this.docs.forEach((a,i)=>{this._addString(a,i)}):this.docs.forEach((a,i)=>{this._addObject(a,i)}),this.norm.clear())}add(a){const i=this.size();qn(a)?this._addString(a,i):this._addObject(a,i)}removeAt(a){this.records.splice(a,1);for(let i=a,o=this.size();i<o;i+=1)this.records[i].i-=1}getValueForItemAtKeyId(a,i){return a[this._keysMap[i]]}size(){return this.records.length}_addString(a,i){if(!dn(a)||vf(a))return;let o={v:a,i,n:this.norm.get(a)};this.records.push(o)}_addObject(a,i){let o={i,$:{}};this.keys.forEach((r,u)=>{let d=r.getFn?r.getFn(a):this.getFn(a,r.path);if(dn(d)){if(Ta(d)){let p=[];const m=[{nestedArrIndex:-1,value:d}];for(;m.length;){const{nestedArrIndex:g,value:v}=m.pop();if(dn(v))if(qn(v)&&!vf(v)){let y={v,i:g,n:this.norm.get(v)};p.push(y)}else Ta(v)&&v.forEach((y,b)=>{m.push({nestedArrIndex:b,value:y})})}o.$[u]=p}else if(qn(d)&&!vf(d)){let p={v:d,n:this.norm.get(d)};o.$[u]=p}}}),this.records.push(o)}toJSON(){return{keys:this.keys,records:this.records}}}function v_(t,a,{getFn:i=xe.getFn,fieldNormWeight:o=xe.fieldNormWeight}={}){const r=new Kh({getFn:i,fieldNormWeight:o});return r.setKeys(t.map(g_)),r.setSources(a),r.create(),r}function o2(t,{getFn:a=xe.getFn,fieldNormWeight:i=xe.fieldNormWeight}={}){const{keys:o,records:r}=t,u=new Kh({getFn:a,fieldNormWeight:i});return u.setKeys(o),u.setIndexRecords(r),u}function Qr(t,{errors:a=0,currentLocation:i=0,expectedLocation:o=0,distance:r=xe.distance,ignoreLocation:u=xe.ignoreLocation}={}){const d=a/t.length;if(u)return d;const p=Math.abs(o-i);return r?d+p/r:p?1:d}function l2(t=[],a=xe.minMatchCharLength){let i=[],o=-1,r=-1,u=0;for(let d=t.length;u<d;u+=1){let p=t[u];p&&o===-1?o=u:!p&&o!==-1&&(r=u-1,r-o+1>=a&&i.push([o,r]),o=-1)}return t[u-1]&&u-o>=a&&i.push([o,u-1]),i}const Rs=32;function r2(t,a,i,{location:o=xe.location,distance:r=xe.distance,threshold:u=xe.threshold,findAllMatches:d=xe.findAllMatches,minMatchCharLength:p=xe.minMatchCharLength,includeMatches:m=xe.includeMatches,ignoreLocation:g=xe.ignoreLocation}={}){if(a.length>Rs)throw new Error(ZA(Rs));const v=a.length,y=t.length,b=Math.max(0,Math.min(o,y));let S=u,T=b;const C=p>1||m,N=C?Array(y):[];let E;for(;(E=t.indexOf(a,T))>-1;){let V=Qr(a,{currentLocation:E,expectedLocation:b,distance:r,ignoreLocation:g});if(S=Math.min(V,S),T=E+v,C){let B=0;for(;B<v;)N[E+B]=1,B+=1}}T=-1;let w=[],R=1,M=v+y;const A=1<<v-1;for(let V=0;V<v;V+=1){let B=0,F=M;for(;B<F;)Qr(a,{errors:V,currentLocation:b+F,expectedLocation:b,distance:r,ignoreLocation:g})<=S?B=F:M=F,F=Math.floor((M-B)/2+B);M=F;let X=Math.max(1,b-F+1),J=d?y:Math.min(b+F,y)+v,te=Array(J+2);te[J+1]=(1<<V)-1;for(let z=J;z>=X;z-=1){let ne=z-1,I=i[t.charAt(ne)];if(C&&(N[ne]=+!!I),te[z]=(te[z+1]<<1|1)&I,V&&(te[z]|=(w[z+1]|w[z])<<1|1|w[z+1]),te[z]&A&&(R=Qr(a,{errors:V,currentLocation:ne,expectedLocation:b,distance:r,ignoreLocation:g}),R<=S)){if(S=R,T=ne,T<=b)break;X=Math.max(1,2*b-T)}}if(Qr(a,{errors:V+1,currentLocation:b,expectedLocation:b,distance:r,ignoreLocation:g})>S)break;w=te}const $={isMatch:T>=0,score:Math.max(.001,R)};if(C){const V=l2(N,p);V.length?m&&($.indices=V):$.isMatch=!1}return $}function c2(t){let a={};for(let i=0,o=t.length;i<o;i+=1){const r=t.charAt(i);a[r]=(a[r]||0)|1<<o-i-1}return a}const bc=String.prototype.normalize?(t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(t=>t);class y_{constructor(a,{location:i=xe.location,threshold:o=xe.threshold,distance:r=xe.distance,includeMatches:u=xe.includeMatches,findAllMatches:d=xe.findAllMatches,minMatchCharLength:p=xe.minMatchCharLength,isCaseSensitive:m=xe.isCaseSensitive,ignoreDiacritics:g=xe.ignoreDiacritics,ignoreLocation:v=xe.ignoreLocation}={}){if(this.options={location:i,threshold:o,distance:r,includeMatches:u,findAllMatches:d,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:v},a=m?a:a.toLowerCase(),a=g?bc(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;const y=(S,T)=>{this.chunks.push({pattern:S,alphabet:c2(S),startIndex:T})},b=this.pattern.length;if(b>Rs){let S=0;const T=b%Rs,C=b-T;for(;S<C;)y(this.pattern.substr(S,Rs),S),S+=Rs;if(T){const N=b-Rs;y(this.pattern.substr(N),N)}}else y(this.pattern,0)}searchIn(a){const{isCaseSensitive:i,ignoreDiacritics:o,includeMatches:r}=this.options;if(a=i?a:a.toLowerCase(),a=o?bc(a):a,this.pattern===a){let C={isMatch:!0,score:0};return r&&(C.indices=[[0,a.length-1]]),C}const{location:u,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,ignoreLocation:v}=this.options;let y=[],b=0,S=!1;this.chunks.forEach(({pattern:C,alphabet:N,startIndex:E})=>{const{isMatch:w,score:R,indices:M}=r2(a,C,N,{location:u+E,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,includeMatches:r,ignoreLocation:v});w&&(S=!0),b+=R,w&&M&&(y=[...y,...M])});let T={isMatch:S,score:S?b/this.chunks.length:1};return S&&r&&(T.indices=y),T}}class ls{constructor(a){this.pattern=a}static isMultiMatch(a){return L0(a,this.multiRegex)}static isSingleMatch(a){return L0(a,this.singleRegex)}search(){}}function L0(t,a){const i=t.match(a);return i?i[1]:null}class u2 extends ls{constructor(a){super(a)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(a){const i=a===this.pattern;return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class d2 extends ls{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){const o=a.indexOf(this.pattern)===-1;return{isMatch:o,score:o?0:1,indices:[0,a.length-1]}}}class f2 extends ls{constructor(a){super(a)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(a){const i=a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class h2 extends ls{constructor(a){super(a)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(a){const i=!a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class p2 extends ls{constructor(a){super(a)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(a){const i=a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[a.length-this.pattern.length,a.length-1]}}}class m2 extends ls{constructor(a){super(a)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(a){const i=!a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class b_ extends ls{constructor(a,{location:i=xe.location,threshold:o=xe.threshold,distance:r=xe.distance,includeMatches:u=xe.includeMatches,findAllMatches:d=xe.findAllMatches,minMatchCharLength:p=xe.minMatchCharLength,isCaseSensitive:m=xe.isCaseSensitive,ignoreDiacritics:g=xe.ignoreDiacritics,ignoreLocation:v=xe.ignoreLocation}={}){super(a),this._bitapSearch=new y_(a,{location:i,threshold:o,distance:r,includeMatches:u,findAllMatches:d,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:v})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(a){return this._bitapSearch.searchIn(a)}}class x_ extends ls{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let i=0,o;const r=[],u=this.pattern.length;for(;(o=a.indexOf(this.pattern,i))>-1;)i=o+u,r.push([o,i-1]);const d=!!r.length;return{isMatch:d,score:d?0:1,indices:r}}}const Kf=[u2,x_,f2,h2,m2,p2,d2,b_],U0=Kf.length,g2=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,v2="|";function y2(t,a={}){return t.split(v2).map(i=>{let o=i.trim().split(g2).filter(u=>u&&!!u.trim()),r=[];for(let u=0,d=o.length;u<d;u+=1){const p=o[u];let m=!1,g=-1;for(;!m&&++g<U0;){const v=Kf[g];let y=v.isMultiMatch(p);y&&(r.push(new v(y,a)),m=!0)}if(!m)for(g=-1;++g<U0;){const v=Kf[g];let y=v.isSingleMatch(p);if(y){r.push(new v(y,a));break}}}return r})}const b2=new Set([b_.type,x_.type]);class x2{constructor(a,{isCaseSensitive:i=xe.isCaseSensitive,ignoreDiacritics:o=xe.ignoreDiacritics,includeMatches:r=xe.includeMatches,minMatchCharLength:u=xe.minMatchCharLength,ignoreLocation:d=xe.ignoreLocation,findAllMatches:p=xe.findAllMatches,location:m=xe.location,threshold:g=xe.threshold,distance:v=xe.distance}={}){this.query=null,this.options={isCaseSensitive:i,ignoreDiacritics:o,includeMatches:r,minMatchCharLength:u,findAllMatches:p,ignoreLocation:d,location:m,threshold:g,distance:v},a=i?a:a.toLowerCase(),a=o?bc(a):a,this.pattern=a,this.query=y2(this.pattern,this.options)}static condition(a,i){return i.useExtendedSearch}searchIn(a){const i=this.query;if(!i)return{isMatch:!1,score:1};const{includeMatches:o,isCaseSensitive:r,ignoreDiacritics:u}=this.options;a=r?a:a.toLowerCase(),a=u?bc(a):a;let d=0,p=[],m=0;for(let g=0,v=i.length;g<v;g+=1){const y=i[g];p.length=0,d=0;for(let b=0,S=y.length;b<S;b+=1){const T=y[b],{isMatch:C,indices:N,score:E}=T.search(a);if(C){if(d+=1,m+=E,o){const w=T.constructor.type;b2.has(w)?p=[...p,...N]:p.push(N)}}else{m=0,d=0,p.length=0;break}}if(d){let b={isMatch:!0,score:m/d};return o&&(b.indices=p),b}}return{isMatch:!1,score:1}}}const Yf=[];function _2(...t){Yf.push(...t)}function Zf(t,a){for(let i=0,o=Yf.length;i<o;i+=1){let r=Yf[i];if(r.condition(t,a))return new r(t,a)}return new y_(t,a)}const xc={AND:"$and",OR:"$or"},Xf={PATH:"$path",PATTERN:"$val"},Qf=t=>!!(t[xc.AND]||t[xc.OR]),S2=t=>!!t[Xf.PATH],T2=t=>!Ta(t)&&p_(t)&&!Qf(t),z0=t=>({[xc.AND]:Object.keys(t).map(a=>({[a]:t[a]}))});function __(t,a,{auto:i=!0}={}){const o=r=>{let u=Object.keys(r);const d=S2(r);if(!d&&u.length>1&&!Qf(r))return o(z0(r));if(T2(r)){const m=d?r[Xf.PATH]:u[0],g=d?r[Xf.PATTERN]:r[m];if(!qn(g))throw new Error(YA(m));const v={keyId:qf(m),pattern:g};return i&&(v.searcher=Zf(g,a)),v}let p={children:[],operator:u[0]};return u.forEach(m=>{const g=r[m];Ta(g)&&g.forEach(v=>{p.children.push(o(v))})}),p};return Qf(t)||(t=z0(t)),o(t)}function k2(t,{ignoreFieldNorm:a=xe.ignoreFieldNorm}){t.forEach(i=>{let o=1;i.matches.forEach(({key:r,norm:u,score:d})=>{const p=r?r.weight:null;o*=Math.pow(d===0&&p?Number.EPSILON:d,(p||1)*(a?1:u))}),i.score=o})}function C2(t,a){const i=t.matches;a.matches=[],dn(i)&&i.forEach(o=>{if(!dn(o.indices)||!o.indices.length)return;const{indices:r,value:u}=o;let d={indices:r,value:u};o.key&&(d.key=o.key.src),o.idx>-1&&(d.refIndex=o.idx),a.matches.push(d)})}function E2(t,a){a.score=t.score}function N2(t,a,{includeMatches:i=xe.includeMatches,includeScore:o=xe.includeScore}={}){const r=[];return i&&r.push(C2),o&&r.push(E2),t.map(u=>{const{idx:d}=u,p={item:a[d],refIndex:d};return r.length&&r.forEach(m=>{m(u,p)}),p})}class Ji{constructor(a,i={},o){this.options={...xe,...i},this.options.useExtendedSearch,this._keyStore=new WA(this.options.keys),this.setCollection(a,o)}setCollection(a,i){if(this._docs=a,i&&!(i instanceof Kh))throw new Error(KA);this._myIndex=i||v_(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){dn(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){const i=[];for(let o=0,r=this._docs.length;o<r;o+=1){const u=this._docs[o];a(u,o)&&(this.removeAt(o),o-=1,r-=1,i.push(u))}return i}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:i=-1}={}){const{includeMatches:o,includeScore:r,shouldSort:u,sortFn:d,ignoreFieldNorm:p}=this.options;let m=qn(a)?qn(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return k2(m,{ignoreFieldNorm:p}),u&&m.sort(d),h_(i)&&i>-1&&(m=m.slice(0,i)),N2(m,this._docs,{includeMatches:o,includeScore:r})}_searchStringList(a){const i=Zf(a,this.options),{records:o}=this._myIndex,r=[];return o.forEach(({v:u,i:d,n:p})=>{if(!dn(u))return;const{isMatch:m,score:g,indices:v}=i.searchIn(u);m&&r.push({item:u,idx:d,matches:[{score:g,value:u,norm:p,indices:v}]})}),r}_searchLogical(a){const i=__(a,this.options),o=(p,m,g)=>{if(!p.children){const{keyId:y,searcher:b}=p,S=this._findMatches({key:this._keyStore.get(y),value:this._myIndex.getValueForItemAtKeyId(m,y),searcher:b});return S&&S.length?[{idx:g,item:m,matches:S}]:[]}const v=[];for(let y=0,b=p.children.length;y<b;y+=1){const S=p.children[y],T=o(S,m,g);if(T.length)v.push(...T);else if(p.operator===xc.AND)return[]}return v},r=this._myIndex.records,u={},d=[];return r.forEach(({$:p,i:m})=>{if(dn(p)){let g=o(i,p,m);g.length&&(u[m]||(u[m]={idx:m,item:p,matches:[]},d.push(u[m])),g.forEach(({matches:v})=>{u[m].matches.push(...v)}))}}),d}_searchObjectList(a){const i=Zf(a,this.options),{keys:o,records:r}=this._myIndex,u=[];return r.forEach(({$:d,i:p})=>{if(!dn(d))return;let m=[];o.forEach((g,v)=>{m.push(...this._findMatches({key:g,value:d[v],searcher:i}))}),m.length&&u.push({idx:p,item:d,matches:m})}),u}_findMatches({key:a,value:i,searcher:o}){if(!dn(i))return[];let r=[];if(Ta(i))i.forEach(({v:u,i:d,n:p})=>{if(!dn(u))return;const{isMatch:m,score:g,indices:v}=o.searchIn(u);m&&r.push({score:g,key:a,value:u,idx:d,norm:p,indices:v})});else{const{v:u,n:d}=i,{isMatch:p,score:m,indices:g}=o.searchIn(u);p&&r.push({score:m,key:a,value:u,norm:d,indices:g})}return r}}Ji.version="7.1.0";Ji.createIndex=v_;Ji.parseIndex=o2;Ji.config=xe;Ji.parseQuery=__;_2(x2);function j2(t,a,i,o){if(!a.trim())return[];const r=.3;return new Ji(t,{keys:i,threshold:r,ignoreLocation:!0,includeScore:!0,includeMatches:!0,minMatchCharLength:2}).search(a).map(m=>({item:m.item,score:m.score??1,matches:(m.matches??[]).map(g=>({key:g.key??"",indices:g.indices}))}))}const Wf={not_started:{color:"var(--text-tertiary)",icon:"○",label:"Not Started"},working:{color:"var(--accent-green)",icon:"●",label:"Working"},paused:{color:"var(--accent-yellow)",icon:"◉",label:"Paused"},complete:{color:"var(--accent-green)",icon:"✓",label:"Complete"},failed:{color:"var(--accent-red)",icon:"✗",label:"Failed"},blocked:{color:"var(--accent-yellow)",icon:"⦸",label:"Blocked"}};function ss(t){return t==="blocked"?Wf.blocked:Wf[Yh(t)]}const w2={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function A2(t){return w2[Yh(t)]??"statusPending"}const D2=["working","paused","failed","not_started","blocked","complete"],V0=["not_started","working","paused","complete","failed"],R2={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function Yh(t){return t in Wf&&t!=="blocked"?t:R2[t]??"not_started"}const M2={not_started:"--text-tertiary",working:"--accent-green",paused:"--accent-yellow",complete:"--accent-green",failed:"--accent-red",pending:"--text-tertiary",assigned:"--text-tertiary",in_progress:"--accent-green",review:"--accent-yellow",done:"--accent-green",waiting_input:"--accent-yellow"};function O2(t){if(t.length===0)return[];const a=[...t].sort((o,r)=>o[0]-r[0]),i=[[a[0][0],a[0][1]]];for(let o=1;o<a.length;o++){const r=i[i.length-1],[u,d]=a[o];u<=r[1]+1?r[1]=Math.max(r[1],d):i.push([u,d])}return i}function S_({text:t,indices:a,highlightClass:i}){if(!a||a.length===0)return c.jsx(c.Fragment,{children:t});const o=O2(a),r=[];let u=0;for(const[d,p]of o)d>u&&r.push(c.jsx("span",{children:t.slice(u,d)},`p${u}`)),r.push(c.jsx("mark",{className:i,children:t.slice(d,p+1)},`m${d}`)),u=p+1;return u<t.length&&r.push(c.jsx("span",{children:t.slice(u)},`p${u}`)),c.jsx(c.Fragment,{children:r})}function B2(t){const a=new Map(t.map(o=>[o.id,{...o,children:[]}])),i=[];for(const o of a.values())o.parentTaskId&&a.has(o.parentTaskId)?a.get(o.parentTaskId).children.push(o):i.push(o);for(const o of a.values())o.children.sort((r,u)=>r.sortOrder-u.sortOrder);return i.sort((o,r)=>o.sortOrder-r.sortOrder)}function I2(t,a){const i=new Map;for(const u of t){const p=u.dependsOn.length>0&&u.dependsOn.some(g=>a.get(g)!=="complete")?"blocked":u.status,m=i.get(p);m?m.push(u):i.set(p,[u])}const o=[],r=new Set;for(const u of D2){r.add(u);const d=i.get(u);if(d&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=ss(u);o.push({status:u,label:p.label,style:p,tasks:d})}}for(const[u,d]of i)if(!r.has(u)&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=ss(u);o.push({status:u,label:p.label,style:p,tasks:d})}return o}const L2="_container_z4i38_1",U2="_header_z4i38_5",z2="_headerActions_z4i38_17",V2="_searchInput_z4i38_23",H2="_searchHighlight_z4i38_56",P2="_groupToggle_z4i38_62",G2="_groupToggleActive_z4i38_89",$2="_addButton_z4i38_93",F2="_taskRow_z4i38_120",q2="_selected_z4i38_140",K2="_expandArrow_z4i38_150",Y2="_expanded_z4i38_157",Z2="_leafSpacer_z4i38_161",X2="_taskStatusIcon_z4i38_166",Q2="_taskTitle_z4i38_170",W2="_workspaceBadge_z4i38_177",J2="_childCountBadge_z4i38_195",eD="_dependencyBadge_z4i38_208",tD="_blockedBadge_z4i38_220",nD="_addChildButton_z4i38_225",aD="_emptyState_z4i38_268",sD="_statusGroupHeader_z4i38_275",iD="_statusGroupIcon_z4i38_294",oD="_statusGroupLabel_z4i38_298",lD="_statusGroupCount_z4i38_303",Be={container:L2,header:U2,headerActions:z2,searchInput:V2,searchHighlight:H2,groupToggle:P2,groupToggleActive:G2,addButton:$2,taskRow:F2,selected:q2,expandArrow:K2,expanded:Y2,leafSpacer:Z2,taskStatusIcon:X2,taskTitle:Q2,workspaceBadge:W2,childCountBadge:J2,dependencyBadge:eD,blockedBadge:tD,addChildButton:nD,emptyState:aD,statusGroupHeader:sD,statusGroupIcon:iD,statusGroupLabel:oD,statusGroupCount:lD},rD=[{name:"title",weight:2},{name:"description",weight:1}],T_=16,cD=16,k_="grackle-task-group-by-status";function H0(){try{return localStorage.getItem(k_)==="true"}catch{return!1}}function uD(t){try{localStorage.setItem(k_,String(t))}catch{}}function dD({group:t,isExpanded:a,onToggle:i,selectedTaskId:o,navigate:r,titleHighlights:u,workspaceNames:d}){return c.jsxs("div",{"data-testid":`status-group-${t.status}`,children:[c.jsxs("div",{className:Be.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":a,onClick:i,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),i())},children:[c.jsx("span",{className:`${Be.expandArrow} ${a?Be.expanded:""}`,children:"▸"}),c.jsx("span",{className:Be.statusGroupIcon,style:{color:t.style.color},children:t.style.icon}),c.jsx("span",{className:Be.statusGroupLabel,children:t.label}),c.jsx("span",{className:Be.statusGroupCount,children:t.tasks.length})]}),c.jsx(Qn,{children:a&&c.jsx(Ct.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:t.tasks.map(p=>{const m=ss(p.status),g=o===p.id,v=p.parentTaskId||!p.workspaceId?void 0:d.get(p.workspaceId);return c.jsxs("div",{onClick:()=>r(_a(p.id)),className:`${Be.taskRow} ${g?Be.selected:""}`,style:{"--task-indent":`${T_}px`},"data-task-id":p.id,children:[c.jsx("span",{className:Be.leafSpacer}),c.jsx("span",{className:Be.taskStatusIcon,style:{color:m.color},children:m.icon}),c.jsx("span",{className:Be.taskTitle,title:p.title,children:c.jsx(S_,{text:p.title,indices:u.get(p.id),highlightClass:Be.searchHighlight})}),v&&c.jsx("span",{className:Be.workspaceBadge,title:v,children:v})]},p.id)})})})]})}function C_({node:t,depth:a,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:u,taskStatusById:d,titleHighlights:p,workspaceNames:m}){const g=ss(t.status),v=t.dependsOn.length>0&&t.dependsOn.some(E=>d.get(E)!=="complete"),y=i.has(t.id),b=t.children.length>0,S=r===t.id,T=T_+a*cD,N=a===0&&!t.parentTaskId&&t.workspaceId?m.get(t.workspaceId):void 0;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{onClick:()=>u(_a(t.id)),className:`${Be.taskRow} ${S?Be.selected:""}`,style:{"--task-indent":`${T}px`},"data-task-id":t.id,children:[b&&c.jsx("span",{className:`${Be.expandArrow} ${y?Be.expanded:""}`,role:"button",tabIndex:0,"aria-label":y?"Collapse task":"Expand task",onClick:E=>{E.stopPropagation(),o(t.id)},onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),E.stopPropagation(),o(t.id))},children:"▸"}),!b&&c.jsx("span",{className:Be.leafSpacer}),c.jsx("span",{className:Be.taskStatusIcon,style:{color:g.color},children:g.icon}),c.jsx("span",{className:Be.taskTitle,title:t.title,children:c.jsx(S_,{text:t.title,indices:p.get(t.id),highlightClass:Be.searchHighlight})}),N&&c.jsx("span",{className:Be.workspaceBadge,title:N,children:N}),b&&c.jsxs("span",{className:Be.childCountBadge,children:[t.children.filter(E=>E.status==="complete").length,"/",t.children.length]}),t.dependsOn.length>0&&c.jsx("span",{className:`${Be.dependencyBadge} ${v?Be.blockedBadge:""}`,title:`Depends on: ${t.dependsOn.join(", ")}`,children:v?"blocked":"dep"}),a<PA&&c.jsx("button",{onClick:E=>{E.stopPropagation(),u(Xi(t.workspaceId,t.id))},title:"Add child task","aria-label":"Add child task",className:Be.addChildButton,children:"+"})]}),c.jsx(Qn,{children:b&&y&&c.jsx(Ct.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},style:{overflow:"hidden"},children:t.children.map(E=>c.jsx(C_,{node:E,depth:a+1,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:u,taskStatusById:d,titleHighlights:p,workspaceNames:m},E.id))})})]})}function fD(){const{workspaces:t,tasks:a}=We(),i=Rt(),[o,r]=x.useState(new Set),[u,d]=x.useState(new Set),[p,m]=x.useState(H0),[g,v]=x.useState(H0),[y,b]=x.useState(new Map),S=Tt("/tasks/:taskId/*"),T=(S==null?void 0:S.params.taskId)!=="new"?S==null?void 0:S.params.taskId:void 0,C=x.useMemo(()=>new Map(a.map(z=>[z.id,z.status])),[a]),N=x.useMemo(()=>new Map(t.map(z=>[z.id,z.name])),[t]),E=()=>{const z=!p;uD(z),m(z),z&&(v(!0),b(new Map))},w=z=>{b(ne=>{const I=new Map(ne),K=I.has(z)?I.get(z):g;return I.set(z,!K),I})},R=z=>y.has(z)?y.get(z):g,M=z=>{r(ne=>{const I=new Set(ne);return I.has(z)?(I.delete(z),d(K=>new Set(K).add(z))):(I.add(z),d(K=>{const se=new Set(K);return se.delete(z),se})),I})};x.useEffect(()=>{const z=new Set(a.filter(ne=>ne.parentTaskId).map(ne=>ne.parentTaskId));z.size>0&&r(ne=>{const I=new Set(ne);for(const K of z)u.has(K)||I.add(K);return I})},[a,u]);const[A,$]=x.useState(""),{directMatchTaskIds:V,treeMatchTaskIds:B,titleHighlights:F}=x.useMemo(()=>{if(!A.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const z=j2(a,A,rD),ne=new Set(z.map(oe=>oe.item.id)),I=new Map;for(const oe of z){const j=oe.matches.find(ie=>ie.key==="title");j&&I.set(oe.item.id,j.indices)}const K=new Set(ne),se=new Map(a.map(oe=>[oe.id,oe]));for(const oe of[...ne]){let j=se.get(oe);for(;j!=null&&j.parentTaskId;)K.add(j.parentTaskId),j=se.get(j.parentTaskId)}return{directMatchTaskIds:ne,treeMatchTaskIds:K,titleHighlights:I}},[A,a]),X=V!==null,J=X?p?V:B:null,te=J?a.filter(z=>J.has(z.id)):a,ee=p?[]:B2(te);return c.jsxs("div",{className:Be.container,children:[c.jsxs("div",{className:Be.header,children:[c.jsx("span",{children:"Tasks"}),c.jsxs("div",{className:Be.headerActions,children:[c.jsx("button",{className:`${Be.groupToggle} ${p?Be.groupToggleActive:""}`,onClick:E,"aria-label":p?"Switch to tree view":"Group tasks by status","aria-pressed":p,title:p?"Switch to tree view":"Group tasks by status","data-testid":"task-group-by-status-toggle",children:"≡"}),c.jsx("button",{className:Be.addButton,onClick:()=>i(Xi()),"aria-label":"New task",title:"New task","data-testid":"new-task-button",children:"+"})]})]}),a.length>0&&c.jsx("input",{type:"text",value:A,onChange:z=>$(z.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Be.searchInput,"data-testid":"sidebar-search"}),p?I2(te,C).map(z=>c.jsx(dD,{group:z,isExpanded:R(z.status),onToggle:()=>w(z.status),selectedTaskId:T,navigate:i,titleHighlights:F,workspaceNames:N},z.status)):ee.map(z=>c.jsx(C_,{node:z,depth:0,expandedTasks:o,toggleTask:M,selectedTaskId:T,navigate:i,taskStatusById:C,titleHighlights:F,workspaceNames:N},z.id)),te.length===0&&!X&&c.jsx("div",{className:Be.emptyState,children:"No tasks yet. Click + to create one."}),te.length===0&&X&&c.jsx("div",{className:Be.emptyState,children:"No matching tasks"})]})}const hD="_nav_14i94_1",pD="_tab_14i94_24",mD="_tabActive_14i94_62",gD="_tabLabel_14i94_75",vD="_statusDot_14i94_81",yD="_pulse_14i94_87",bD="_addButton_14i94_99",xD="_empty_14i94_132",Qa={nav:hD,tab:pD,tabActive:mD,tabLabel:gD,statusDot:vD,pulse:yD,addButton:bD,empty:xD},_D={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function SD(){const{environments:t}=We(),a=Rt(),i=x.useRef(null),o=Tt("/environments/:environmentId"),r=Tt("/environments/:environmentId/edit"),u=Tt("/environments/:environmentId/workspaces/:workspaceId"),d=Tt("/environments/:environmentId/workspaces/:workspaceId/*"),p=(o==null?void 0:o.params.environmentId)??(r==null?void 0:r.params.environmentId)??(u==null?void 0:u.params.environmentId)??(d==null?void 0:d.params.environmentId),m=p==="new"?void 0:p,g=x.useCallback(b=>{a(Gi(b))},[a]),v=x.useCallback(b=>{var E;const S=(E=i.current)==null?void 0:E.querySelectorAll('[role="tab"]');if(!S||S.length===0)return;const T=Array.from(S).findIndex(w=>w===document.activeElement),C=T>=0?T:t.findIndex(w=>w.id===m);let N=C;if(b.key==="ArrowDown")b.preventDefault(),N=(C+1)%S.length;else if(b.key==="ArrowUp")b.preventDefault(),N=(C-1+S.length)%S.length;else if(b.key==="Home")b.preventDefault(),N=0;else if(b.key==="End")b.preventDefault(),N=S.length-1;else return;N<t.length&&a(Gi(t[N].id)),S[N].focus()},[m,t,a]),y=m??(t.length>0?t[0].id:void 0);return c.jsxs("div",{className:Qa.nav,"data-testid":"environment-nav",children:[c.jsx("nav",{ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:v,children:t.map(b=>{const S=b.id===m,T=b.id===y,C=_D[b.status]||"var(--text-tertiary)",N=b.status==="connected";return c.jsxs("button",{role:"tab",type:"button","aria-selected":S,tabIndex:T?0:-1,className:`${Qa.tab} ${S?Qa.tabActive:""}`,onClick:()=>g(b.id),"data-testid":"env-nav-item",children:[c.jsx("span",{className:`${Qa.statusDot} ${N?Qa.pulse:""}`,style:{color:C},children:"●"}),c.jsx("span",{className:Qa.tabLabel,title:b.displayName||b.id,children:b.displayName||b.id})]},b.id)})}),c.jsx("button",{type:"button",className:Qa.addButton,onClick:()=>a(oC),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),t.length===0&&c.jsx("div",{className:Qa.empty,children:"No environments yet."})]})}const TD="_nav_1bhou_1",kD="_tab_1bhou_24",CD="_tabIcon_1bhou_62",ED="_tabActive_1bhou_68",Wr={nav:TD,tab:kD,tabIcon:CD,tabActive:ED},va=[{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"about",label:"About",icon:"ℹ️"}];function ND(){var d;const t=wt(),a=Rt(),i=x.useRef(null),o=((d=va.find(p=>t.pathname===`${il}/${p.path}`))==null?void 0:d.path)??va[0].path,r=x.useCallback(p=>{a(`${il}/${p}`)},[a]),u=x.useCallback(p=>{var S,T;const m=(S=i.current)==null?void 0:S.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(C=>C===document.activeElement),v=g>=0?g:va.findIndex(C=>C.path===o);let y=v;if(p.key==="ArrowDown")p.preventDefault(),y=(v+1)%va.length;else if(p.key==="ArrowUp")p.preventDefault(),y=(v-1+va.length)%va.length;else if(p.key==="Home")p.preventDefault(),y=0;else if(p.key==="End")p.preventDefault(),y=va.length-1;else return;const b=va[y].path;a(`${il}/${b}`),(T=m[y])==null||T.focus()},[o,a]);return c.jsx("nav",{className:Wr.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:u,children:va.map(p=>{const m=p.path===o;return c.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Wr.tab} ${m?Wr.tabActive:""}`,onClick:()=>r(p.path),children:[c.jsx("span",{className:Wr.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}const jD="_nav_1snmp_1",wD="_searchForm_1snmp_8",AD="_searchInput_1snmp_15",DD="_searchButton_1snmp_33",RD="_clearButton_1snmp_68",MD="_workspaceSelect_1snmp_85",OD="_listHeader_1snmp_99",BD="_nodeList_1snmp_108",ID="_nodeItem_1snmp_116",LD="_indicator_1snmp_129",UD="_label_1snmp_136",zD="_badge_1snmp_145",wn={nav:jD,searchForm:wD,searchInput:AD,searchButton:DD,clearButton:RD,workspaceSelect:MD,listHeader:OD,nodeList:BD,nodeItem:ID,indicator:LD,label:UD,badge:zD};function VD(){const{knowledge:t,workspaces:a}=We(),[i,o]=x.useState(""),r=x.useCallback(m=>{m.preventDefault(),i.trim()&&t.search(i.trim())},[i,t]),u=x.useCallback(()=>{o(""),t.clearSearch()},[t]),d=x.useCallback(m=>{t.selectNode(m)},[t]),p=x.useCallback(m=>{o(""),t.loadRecent(m||void 0)},[t]);return c.jsxs("div",{className:wn.nav,"data-testid":"knowledge-nav",children:[c.jsxs("form",{className:wn.searchForm,onSubmit:r,children:[c.jsx("input",{className:wn.searchInput,type:"text",placeholder:"Search...",value:i,onChange:m=>{o(m.target.value)},"data-testid":"knowledge-search-input"}),c.jsx("button",{type:"submit",className:wn.searchButton,disabled:t.loading,children:"Go"})]}),t.searchQuery&&c.jsx("button",{type:"button",className:wn.clearButton,onClick:u,children:"Clear search"}),c.jsxs("select",{className:wn.workspaceSelect,onChange:m=>{p(m.target.value)},"data-testid":"knowledge-workspace-filter",children:[c.jsx("option",{value:"",children:"All workspaces"}),a.map(m=>c.jsx("option",{value:m.id,children:m.name},m.id))]}),c.jsxs("div",{className:wn.listHeader,children:["Nodes (",t.graphData.nodes.length,")"]}),c.jsx("ul",{className:wn.nodeList,children:t.graphData.nodes.map(m=>c.jsxs("li",{className:wn.nodeItem,onClick:()=>{d(m.id)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),d(m.id))},role:"button",tabIndex:0,children:[c.jsx("span",{className:wn.indicator,style:{backgroundColor:m.kind==="reference"?"#4A9EFF":m.category==="decision"?"#22C55E":m.category==="concept"?"#A855F7":m.category==="snippet"?"#6B7280":"#EAB308"}}),c.jsx("span",{className:wn.label,children:m.label}),c.jsx("span",{className:wn.badge,children:m.kind==="reference"?m.sourceType:m.category})]},m.id))})]})}function HD(){const t=x.useMemo(()=>c.jsx(fD,{}),[]);return Nc(t),c.jsx(Us,{})}function PD(){const t=x.useMemo(()=>c.jsx(SD,{}),[]);return Nc(t),c.jsx(Us,{})}function GD(){const t=x.useMemo(()=>c.jsx(ND,{}),[]);return Nc(t),c.jsx(Us,{})}function $D(){const t=x.useMemo(()=>c.jsx(VD,{}),[]);return Nc(t),c.jsx(Us,{})}const FD="_bar_tnfsh_1",qD="_btnPrimary_tnfsh_32",KD="_statusText_tnfsh_85",YD="_statusCompleted_tnfsh_90",ZD="_statusFailed_tnfsh_94",XD="_statusBlocked_tnfsh_98",QD="_hintText_tnfsh_103",ct={bar:FD,btnPrimary:qD,statusText:KD,statusCompleted:YD,statusFailed:ZD,statusBlocked:XD,hintText:QD};function WD(){const{sessions:t,tasks:a,environments:i}=We(),o=Rt(),r=wt(),u=Tt("/sessions/:sessionId"),d=Tt("/tasks/:taskId"),p=Tt("/tasks/:taskId/stream"),m=Tt("/tasks/:taskId/findings"),g=Tt("/tasks/:taskId/edit"),v=Tt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId"),y=Tt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream"),b=Tt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings"),S=Tt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit"),T=Tt("/sessions/new"),C=Tt("/environments/:environmentId/workspaces/:workspaceId"),N=Tt("/tasks/new"),E=Tt("/chat"),w=Tt("/"),R=Tt("/settings/*"),M=u==null?void 0:u.params.sessionId,A=(d==null?void 0:d.params.taskId)??(p==null?void 0:p.params.taskId)??(m==null?void 0:m.params.taskId)??(v==null?void 0:v.params.taskId)??(y==null?void 0:y.params.taskId)??(b==null?void 0:b.params.taskId)??(S==null?void 0:S.params.taskId),$=v??y??b??S,V=($==null?void 0:$.params.environmentId)??(C==null?void 0:C.params.environmentId),B=r.pathname.startsWith("/environments")&&!C&&!$,F=!!E,X=!!T,J=!!C&&!v&&!y&&!b&&!S,te=!!N;if(!!w&&!X&&!J&&!te||!!R||(!!g||!!S)||te||B||X)return c.jsx(c.Fragment,{});if(F)return i.find(K=>K.adapterType==="local"&&K.status==="connected")?c.jsx(c.Fragment,{}):c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Add a local environment to start chatting"})});if(J)return c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Select a task or click + to create one"})});if(A){const I=a.find(oe=>oe.id===A);if(!I)return c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Loading..."})});const K=new Map(a.map(oe=>[oe.id,oe])),se=I.dependsOn.some(oe=>{const j=K.get(oe);return j!==void 0&&j.status!=="complete"});if(I.status==="not_started"){const oe=se?I.dependsOn.map(j=>K.get(j)).filter(j=>j&&j.status!=="complete").map(j=>j.title):[];return c.jsx("div",{className:ct.bar,children:se?c.jsxs("span",{className:ct.statusBlocked,children:["Blocked by: ",oe.join(", ")]}):c.jsx("span",{className:ct.hintText,children:"Use the buttons above to start or manage this task"})})}if(I.status==="working"||I.status==="paused"){const oe=I.latestSessionId||void 0,j=oe?t.find(pe=>pe.id===oe):void 0;return j&&j.status!=="stopped"?c.jsx(c.Fragment,{}):c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Waiting for agent..."})})}if(I.status==="complete")return c.jsxs("div",{className:ct.bar,children:[c.jsx("span",{className:`${ct.statusText} ${ct.statusCompleted}`,children:"Task completed"}),c.jsx("button",{onClick:()=>o(Xi(I.workspaceId,void 0,V)),className:ct.btnPrimary,children:"+ New Task"})]});if(I.status==="failed")return c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:`${ct.statusText} ${ct.statusFailed}`,children:"Task failed"})})}if(M){const I=t.find(oe=>oe.id===M),K=(I==null?void 0:I.status)==="stopped";if(I!==void 0&&!K)return c.jsx(c.Fragment,{});if(K)return c.jsxs("div",{className:ct.bar,children:[c.jsxs("span",{className:`${ct.statusText} ${ct.hintText}`,children:["Session ",I.endReason||I.status]}),c.jsx("button",{onClick:()=>o(Sb(I.environmentId)),className:ct.btnPrimary,children:"+ New Chat"})]})}return c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Loading..."})})}const JD="_toast_da8ll_1",eR="_success_da8ll_18",tR="_icon_da8ll_22",nR="_error_da8ll_25",aR="_warning_da8ll_32",sR="_info_da8ll_38",iR="_message_da8ll_53",oR="_close_da8ll_60",Wo={toast:JD,success:eR,icon:tR,error:nR,warning:aR,info:sR,message:iR,close:oR},lR={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function rR({toast:t,onDismiss:a}){return x.useEffect(()=>{const i=setTimeout(()=>a(t.id),t.duration);return()=>clearTimeout(i)},[t.id,t.duration,a]),c.jsxs(Ct.div,{className:`${Wo.toast} ${Wo[t.variant]}`,role:"status",initial:{opacity:0,y:-16,scale:.94},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.94},transition:{duration:.2,ease:"easeOut"},layout:!0,children:[c.jsx("span",{className:Wo.icon,"aria-hidden":"true",children:lR[t.variant]}),c.jsx("span",{className:Wo.message,children:t.message}),c.jsx("button",{type:"button",className:Wo.close,onClick:()=>a(t.id),"aria-label":"Dismiss notification",children:"×"})]})}const cR="_container_qqse2_1",uR={container:cR};function dR(){const{toasts:t,dismissToast:a}=zs();return c.jsx("div",{className:uR.container,"data-testid":"toast-container",children:c.jsx(Qn,{children:t.map(i=>c.jsx(rR,{toast:i,onDismiss:a},i.id))})})}const fR="_breadcrumbs_17or2_1",hR="_list_17or2_11",pR="_item_17or2_21",mR="_separator_17or2_28",gR="_link_17or2_34",vR="_current_17or2_57",Ri={breadcrumbs:fR,list:hR,item:pR,separator:mR,link:gR,current:vR},yR="›";function Hs({segments:t}){return c.jsx("nav",{className:Ri.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:c.jsx("ol",{className:Ri.list,children:t.map((a,i)=>{const o=i===t.length-1;return c.jsxs("li",{className:Ri.item,children:[i>0&&c.jsx("span",{className:Ri.separator,"aria-hidden":"true",children:yR}),a.url&&!o?c.jsx(ch,{className:Ri.link,to:a.url,title:a.label,children:a.label}):c.jsx("span",{className:Ri.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}function Jf(){Jf=function(r,u){return new i(r,void 0,u)};var t=RegExp.prototype,a=new WeakMap;function i(r,u,d){var p=new RegExp(r,u);return a.set(p,d||a.get(r)),_c(p,i.prototype)}function o(r,u){var d=a.get(u);return Object.keys(d).reduce(function(p,m){var g=d[m];if(typeof g=="number")p[m]=r[g];else{for(var v=0;r[g[v]]===void 0&&v+1<g.length;)v++;p[m]=r[g[v]]}return p},Object.create(null))}return(function(r,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(u&&u.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),u&&_c(r,u)})(i,RegExp),i.prototype.exec=function(r){var u=t.exec.call(this,r);if(u){u.groups=o(u,this);var d=u.indices;d&&(d.groups=o(d,this))}return u},i.prototype[Symbol.replace]=function(r,u){if(typeof u=="string"){var d=a.get(this);return t[Symbol.replace].call(this,r,u.replace(/\$<([^>]+)>/g,function(m,g){var v=d[g];return"$"+(Array.isArray(v)?v.join("$"):v)}))}if(typeof u=="function"){var p=this;return t[Symbol.replace].call(this,r,function(){var m=arguments;return typeof m[m.length-1]!="object"&&(m=[].slice.call(m)).push(o(m,p)),u.apply(this,m)})}return t[Symbol.replace].call(this,r,u)},Jf.apply(this,arguments)}function _c(t,a){return _c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,o){return i.__proto__=o,i},_c(t,a)}function P0(t,a){(a==null||a>t.length)&&(a=t.length);for(var i=0,o=new Array(a);i<a;i++)o[i]=t[i];return o}function yf(t,a){var i=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=(function(r,u){if(r){if(typeof r=="string")return P0(r,u);var d=Object.prototype.toString.call(r).slice(8,-1);return d==="Object"&&r.constructor&&(d=r.constructor.name),d==="Map"||d==="Set"?Array.from(r):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?P0(r,u):void 0}})(t))||a){i&&(t=i);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
98
+ `),()=>{document.head.removeChild(v)}},[a]),c.jsx(gE,{isPresent:a,childRef:o,sizeRef:r,children:x.cloneElement(t,{ref:o})})}const yE=({children:t,initial:a,isPresent:i,onExitComplete:o,custom:r,presenceAffectsLayout:u,mode:d})=>{const p=hh(bE),m=x.useId(),g=x.useCallback(y=>{p.set(y,!0);for(const b of p.values())if(!b)return;o&&o()},[p,o]),v=x.useMemo(()=>({id:m,initial:a,isPresent:i,custom:r,onExitComplete:g,register:y=>(p.set(y,!1),()=>p.delete(y))}),u?[Math.random(),g]:[i,g]);return x.useMemo(()=>{p.forEach((y,b)=>p.set(b,!1))},[i]),x.useEffect(()=>{!i&&!p.size&&o&&o()},[i]),d==="popLayout"&&(t=c.jsx(vE,{isPresent:i,children:t})),c.jsx(jc.Provider,{value:v,children:t})};function bE(){return new Map}function Ub(t=!0){const a=x.useContext(jc);if(a===null)return[!0,null];const{isPresent:i,onExitComplete:o,register:r}=a,u=x.useId();x.useEffect(()=>{t&&r(u)},[t]);const d=x.useCallback(()=>t&&o&&o(u),[u,o,t]);return!i&&o?[!1,d]:[!0]}const Kr=t=>t.key||"";function by(t){const a=[];return x.Children.forEach(t,i=>{x.isValidElement(i)&&a.push(i)}),a}const mh=typeof window<"u",zb=mh?x.useLayoutEffect:x.useEffect,Qn=({children:t,custom:a,initial:i=!0,onExitComplete:o,presenceAffectsLayout:r=!0,mode:u="sync",propagate:d=!1})=>{const[p,m]=Ub(d),g=x.useMemo(()=>by(t),[t]),v=d&&!p?[]:g.map(Kr),y=x.useRef(!0),b=x.useRef(g),S=hh(()=>new Map),[T,C]=x.useState(g),[N,E]=x.useState(g);zb(()=>{y.current=!1,b.current=g;for(let M=0;M<N.length;M++){const A=Kr(N[M]);v.includes(A)?S.delete(A):S.get(A)!==!0&&S.set(A,!1)}},[N,v.length,v.join("-")]);const w=[];if(g!==T){let M=[...g];for(let A=0;A<N.length;A++){const $=N[A],V=Kr($);v.includes(V)||(M.splice(A,0,$),w.push($))}u==="wait"&&w.length&&(M=w),E(by(M)),C(g);return}const{forceRender:R}=x.useContext(fh);return c.jsx(c.Fragment,{children:N.map(M=>{const A=Kr(M),$=d&&!p?!1:g===N||v.includes(A),V=()=>{if(S.has(A))S.set(A,!0);else return;let B=!0;S.forEach(F=>{F||(B=!1)}),B&&(R==null||R(),E(b.current),d&&(m==null||m()),o&&o())};return c.jsx(yE,{isPresent:$,initial:!y.current||i?void 0:!1,custom:$?void 0:a,presenceAffectsLayout:r,mode:u,onExitComplete:$?void 0:V,children:M},A)})})},fn=t=>t;let Vb=fn;const xE={useManualTiming:!1};function _E(t){let a=new Set,i=new Set,o=!1,r=!1;const u=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function p(g){u.has(g)&&(m.schedule(g),t()),g(d)}const m={schedule:(g,v=!1,y=!1)=>{const S=y&&o?a:i;return v&&u.add(g),S.has(g)||S.add(g),g},cancel:g=>{i.delete(g),u.delete(g)},process:g=>{if(d=g,o){r=!0;return}o=!0,[a,i]=[i,a],a.forEach(p),a.clear(),o=!1,r&&(r=!1,m.process(g))}};return m}const Yr=["read","resolveKeyframes","update","preRender","render","postRender"],SE=40;function Hb(t,a){let i=!1,o=!0;const r={delta:0,timestamp:0,isProcessing:!1},u=()=>i=!0,d=Yr.reduce((E,w)=>(E[w]=_E(u),E),{}),{read:p,resolveKeyframes:m,update:g,preRender:v,render:y,postRender:b}=d,S=()=>{const E=performance.now();i=!1,r.delta=o?1e3/60:Math.max(Math.min(E-r.timestamp,SE),1),r.timestamp=E,r.isProcessing=!0,p.process(r),m.process(r),g.process(r),v.process(r),y.process(r),b.process(r),r.isProcessing=!1,i&&a&&(o=!1,t(S))},T=()=>{i=!0,o=!0,r.isProcessing||t(S)};return{schedule:Yr.reduce((E,w)=>{const R=d[w];return E[w]=(M,A=!1,$=!1)=>(i||T(),R.schedule(M,A,$)),E},{}),cancel:E=>{for(let w=0;w<Yr.length;w++)d[Yr[w]].cancel(E)},state:r,steps:d}}const{schedule:lt,cancel:ns,state:Ut,steps:af}=Hb(typeof requestAnimationFrame<"u"?requestAnimationFrame:fn,!0),Pb=x.createContext({strict:!1}),xy={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},$i={};for(const t in xy)$i[t]={isEnabled:a=>xy[t].some(i=>!!a[i])};function TE(t){for(const a in t)$i[a]={...$i[a],...t[a]}}const kE=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function dc(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||kE.has(t)}let Gb=t=>!dc(t);function CE(t){t&&(Gb=a=>a.startsWith("on")?!dc(a):t(a))}try{CE(require("@emotion/is-prop-valid").default)}catch{}function EE(t,a,i){const o={};for(const r in t)r==="values"&&typeof t.values=="object"||(Gb(r)||i===!0&&dc(r)||!a&&!dc(r)||t.draggable&&r.startsWith("onDrag"))&&(o[r]=t[r]);return o}function NE(t){if(typeof Proxy>"u")return t;const a=new Map,i=(...o)=>t(...o);return new Proxy(i,{get:(o,r)=>r==="create"?t:(a.has(r)||a.set(r,t(r)),a.get(r))})}const wc=x.createContext({});function ml(t){return typeof t=="string"||Array.isArray(t)}function Ac(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const gh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vh=["initial",...gh];function Dc(t){return Ac(t.animate)||vh.some(a=>ml(t[a]))}function $b(t){return!!(Dc(t)||t.variants)}function jE(t,a){if(Dc(t)){const{initial:i,animate:o}=t;return{initial:i===!1||ml(i)?i:void 0,animate:ml(o)?o:void 0}}return t.inherit!==!1?a:{}}function wE(t){const{initial:a,animate:i}=jE(t,x.useContext(wc));return x.useMemo(()=>({initial:a,animate:i}),[_y(a),_y(i)])}function _y(t){return Array.isArray(t)?t.join(" "):t}const AE=Symbol.for("motionComponentSymbol");function Bi(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function DE(t,a,i){return x.useCallback(o=>{o&&t.onMount&&t.onMount(o),a&&(o?a.mount(o):a.unmount()),i&&(typeof i=="function"?i(o):Bi(i)&&(i.current=o))},[a])}const yh=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),RE="framerAppearId",Fb="data-"+yh(RE),{schedule:bh}=Hb(queueMicrotask,!1),qb=x.createContext({});function ME(t,a,i,o,r){var u,d;const{visualElement:p}=x.useContext(wc),m=x.useContext(Pb),g=x.useContext(jc),v=x.useContext(ph).reducedMotion,y=x.useRef(null);o=o||m.renderer,!y.current&&o&&(y.current=o(t,{visualState:a,parent:p,props:i,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:v}));const b=y.current,S=x.useContext(qb);b&&!b.projection&&r&&(b.type==="html"||b.type==="svg")&&OE(y.current,i,r,S);const T=x.useRef(!1);x.useInsertionEffect(()=>{b&&T.current&&b.update(i,g)});const C=i[Fb],N=x.useRef(!!C&&!(!((u=window.MotionHandoffIsComplete)===null||u===void 0)&&u.call(window,C))&&((d=window.MotionHasOptimisedAnimation)===null||d===void 0?void 0:d.call(window,C)));return zb(()=>{b&&(T.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),bh.render(b.render),N.current&&b.animationState&&b.animationState.animateChanges())}),x.useEffect(()=>{b&&(!N.current&&b.animationState&&b.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var E;(E=window.MotionHandoffMarkAsComplete)===null||E===void 0||E.call(window,C)}),N.current=!1))}),b}function OE(t,a,i,o){const{layoutId:r,layout:u,drag:d,dragConstraints:p,layoutScroll:m,layoutRoot:g}=a;t.projection=new i(t.latestValues,a["data-framer-portal-id"]?void 0:Kb(t.parent)),t.projection.setOptions({layoutId:r,layout:u,alwaysMeasureLayout:!!d||p&&Bi(p),visualElement:t,animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:m,layoutRoot:g})}function Kb(t){if(t)return t.options.allowProjection!==!1?t.projection:Kb(t.parent)}function BE({preloadedFeatures:t,createVisualElement:a,useRender:i,useVisualState:o,Component:r}){var u,d;t&&TE(t);function p(g,v){let y;const b={...x.useContext(ph),...g,layoutId:IE(g)},{isStatic:S}=b,T=wE(g),C=o(g,S);if(!S&&mh){LE();const N=UE(b);y=N.MeasureLayout,T.visualElement=ME(r,C,b,a,N.ProjectionNode)}return c.jsxs(wc.Provider,{value:T,children:[y&&T.visualElement?c.jsx(y,{visualElement:T.visualElement,...b}):null,i(r,g,DE(C,T.visualElement,v),C,S,T.visualElement)]})}p.displayName=`motion.${typeof r=="string"?r:`create(${(d=(u=r.displayName)!==null&&u!==void 0?u:r.name)!==null&&d!==void 0?d:""})`}`;const m=x.forwardRef(p);return m[AE]=r,m}function IE({layoutId:t}){const a=x.useContext(fh).id;return a&&t!==void 0?a+"-"+t:t}function LE(t,a){x.useContext(Pb).strict}function UE(t){const{drag:a,layout:i}=$i;if(!a&&!i)return{};const o={...a,...i};return{MeasureLayout:a!=null&&a.isEnabled(t)||i!=null&&i.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}const zE=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function xh(t){return typeof t!="string"||t.includes("-")?!1:!!(zE.indexOf(t)>-1||/[A-Z]/u.test(t))}function Sy(t){const a=[{},{}];return t==null||t.values.forEach((i,o)=>{a[0][o]=i.get(),a[1][o]=i.getVelocity()}),a}function _h(t,a,i,o){if(typeof a=="function"){const[r,u]=Sy(o);a=a(i!==void 0?i:t.custom,r,u)}if(typeof a=="string"&&(a=t.variants&&t.variants[a]),typeof a=="function"){const[r,u]=Sy(o);a=a(i!==void 0?i:t.custom,r,u)}return a}const Df=t=>Array.isArray(t),VE=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),HE=t=>Df(t)?t[t.length-1]||0:t,Pt=t=>!!(t&&t.getVelocity);function ic(t){const a=Pt(t)?t.get():t;return VE(a)?a.toValue():a}function PE({scrapeMotionValuesFromProps:t,createRenderState:a,onUpdate:i},o,r,u){const d={latestValues:GE(o,r,u,t),renderState:a()};return i&&(d.onMount=p=>i({props:o,current:p,...d}),d.onUpdate=p=>i(p)),d}const Yb=t=>(a,i)=>{const o=x.useContext(wc),r=x.useContext(jc),u=()=>PE(t,a,o,r);return i?u():hh(u)};function GE(t,a,i,o){const r={},u=o(t,{});for(const b in u)r[b]=ic(u[b]);let{initial:d,animate:p}=t;const m=Dc(t),g=$b(t);a&&g&&!m&&t.inherit!==!1&&(d===void 0&&(d=a.initial),p===void 0&&(p=a.animate));let v=i?i.initial===!1:!1;v=v||d===!1;const y=v?p:d;if(y&&typeof y!="boolean"&&!Ac(y)){const b=Array.isArray(y)?y:[y];for(let S=0;S<b.length;S++){const T=_h(t,b[S]);if(T){const{transitionEnd:C,transition:N,...E}=T;for(const w in E){let R=E[w];if(Array.isArray(R)){const M=v?R.length-1:0;R=R[M]}R!==null&&(r[w]=R)}for(const w in C)r[w]=C[w]}}}return r}const Qi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vs=new Set(Qi),Zb=t=>a=>typeof a=="string"&&a.startsWith(t),Xb=Zb("--"),$E=Zb("var(--"),Sh=t=>$E(t)?FE.test(t.split("/*")[0].trim()):!1,FE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Qb=(t,a)=>a&&typeof t=="number"?a.transform(t):t,Sa=(t,a,i)=>i>a?a:i<t?t:i,Wi={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},gl={...Wi,transform:t=>Sa(0,1,t)},Zr={...Wi,default:1},Tl=t=>({test:a=>typeof a=="string"&&a.endsWith(t)&&a.split(" ").length===1,parse:parseFloat,transform:a=>`${a}${t}`}),Wa=Tl("deg"),Zn=Tl("%"),be=Tl("px"),qE=Tl("vh"),KE=Tl("vw"),Ty={...Zn,parse:t=>Zn.parse(t)/100,transform:t=>Zn.transform(t*100)},YE={borderWidth:be,borderTopWidth:be,borderRightWidth:be,borderBottomWidth:be,borderLeftWidth:be,borderRadius:be,radius:be,borderTopLeftRadius:be,borderTopRightRadius:be,borderBottomRightRadius:be,borderBottomLeftRadius:be,width:be,maxWidth:be,height:be,maxHeight:be,top:be,right:be,bottom:be,left:be,padding:be,paddingTop:be,paddingRight:be,paddingBottom:be,paddingLeft:be,margin:be,marginTop:be,marginRight:be,marginBottom:be,marginLeft:be,backgroundPositionX:be,backgroundPositionY:be},ZE={rotate:Wa,rotateX:Wa,rotateY:Wa,rotateZ:Wa,scale:Zr,scaleX:Zr,scaleY:Zr,scaleZ:Zr,skew:Wa,skewX:Wa,skewY:Wa,distance:be,translateX:be,translateY:be,translateZ:be,x:be,y:be,z:be,perspective:be,transformPerspective:be,opacity:gl,originX:Ty,originY:Ty,originZ:be},ky={...Wi,transform:Math.round},Th={...YE,...ZE,zIndex:ky,size:be,fillOpacity:gl,strokeOpacity:gl,numOctaves:ky},XE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},QE=Qi.length;function WE(t,a,i){let o="",r=!0;for(let u=0;u<QE;u++){const d=Qi[u],p=t[d];if(p===void 0)continue;let m=!0;if(typeof p=="number"?m=p===(d.startsWith("scale")?1:0):m=parseFloat(p)===0,!m||i){const g=Qb(p,Th[d]);if(!m){r=!1;const v=XE[d]||d;o+=`${v}(${g}) `}i&&(a[d]=g)}}return o=o.trim(),i?o=i(a,r?"":o):r&&(o="none"),o}function kh(t,a,i){const{style:o,vars:r,transformOrigin:u}=t;let d=!1,p=!1;for(const m in a){const g=a[m];if(Vs.has(m)){d=!0;continue}else if(Xb(m)){r[m]=g;continue}else{const v=Qb(g,Th[m]);m.startsWith("origin")?(p=!0,u[m]=v):o[m]=v}}if(a.transform||(d||i?o.transform=WE(a,t.transform,i):o.transform&&(o.transform="none")),p){const{originX:m="50%",originY:g="50%",originZ:v=0}=u;o.transformOrigin=`${m} ${g} ${v}`}}const JE={offset:"stroke-dashoffset",array:"stroke-dasharray"},eN={offset:"strokeDashoffset",array:"strokeDasharray"};function tN(t,a,i=1,o=0,r=!0){t.pathLength=1;const u=r?JE:eN;t[u.offset]=be.transform(-o);const d=be.transform(a),p=be.transform(i);t[u.array]=`${d} ${p}`}function Cy(t,a,i){return typeof t=="string"?t:be.transform(a+i*t)}function nN(t,a,i){const o=Cy(a,t.x,t.width),r=Cy(i,t.y,t.height);return`${o} ${r}`}function Ch(t,{attrX:a,attrY:i,attrScale:o,originX:r,originY:u,pathLength:d,pathSpacing:p=1,pathOffset:m=0,...g},v,y){if(kh(t,g,y),v){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:b,style:S,dimensions:T}=t;b.transform&&(T&&(S.transform=b.transform),delete b.transform),T&&(r!==void 0||u!==void 0||S.transform)&&(S.transformOrigin=nN(T,r!==void 0?r:.5,u!==void 0?u:.5)),a!==void 0&&(b.x=a),i!==void 0&&(b.y=i),o!==void 0&&(b.scale=o),d!==void 0&&tN(b,d,p,m,!1)}const Eh=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Wb=()=>({...Eh(),attrs:{}}),Nh=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Jb(t,{style:a,vars:i},o,r){Object.assign(t.style,a,r&&r.getProjectionStyles(o));for(const u in i)t.style.setProperty(u,i[u])}const ex=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function tx(t,a,i,o){Jb(t,a,void 0,o);for(const r in a.attrs)t.setAttribute(ex.has(r)?r:yh(r),a.attrs[r])}const fc={};function aN(t){Object.assign(fc,t)}function nx(t,{layout:a,layoutId:i}){return Vs.has(t)||t.startsWith("origin")||(a||i!==void 0)&&(!!fc[t]||t==="opacity")}function jh(t,a,i){var o;const{style:r}=t,u={};for(const d in r)(Pt(r[d])||a.style&&Pt(a.style[d])||nx(d,t)||((o=i==null?void 0:i.getValue(d))===null||o===void 0?void 0:o.liveStyle)!==void 0)&&(u[d]=r[d]);return u}function ax(t,a,i){const o=jh(t,a,i);for(const r in t)if(Pt(t[r])||Pt(a[r])){const u=Qi.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;o[u]=t[r]}return o}function sN(t,a){try{a.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{a.dimensions={x:0,y:0,width:0,height:0}}}const Ey=["x","y","width","height","cx","cy","r"],iN={useVisualState:Yb({scrapeMotionValuesFromProps:ax,createRenderState:Wb,onUpdate:({props:t,prevProps:a,current:i,renderState:o,latestValues:r})=>{if(!i)return;let u=!!t.drag;if(!u){for(const p in r)if(Vs.has(p)){u=!0;break}}if(!u)return;let d=!a;if(a)for(let p=0;p<Ey.length;p++){const m=Ey[p];t[m]!==a[m]&&(d=!0)}d&&lt.read(()=>{sN(i,o),lt.render(()=>{Ch(o,r,Nh(i.tagName),t.transformTemplate),tx(i,o)})})}})},oN={useVisualState:Yb({scrapeMotionValuesFromProps:jh,createRenderState:Eh})};function sx(t,a,i){for(const o in a)!Pt(a[o])&&!nx(o,i)&&(t[o]=a[o])}function lN({transformTemplate:t},a){return x.useMemo(()=>{const i=Eh();return kh(i,a,t),Object.assign({},i.vars,i.style)},[a])}function rN(t,a){const i=t.style||{},o={};return sx(o,i,t),Object.assign(o,lN(t,a)),o}function cN(t,a){const i={},o=rN(t,a);return t.drag&&t.dragListener!==!1&&(i.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(i.tabIndex=0),i.style=o,i}function uN(t,a,i,o){const r=x.useMemo(()=>{const u=Wb();return Ch(u,a,Nh(o),t.transformTemplate),{...u.attrs,style:{...u.style}}},[a]);if(t.style){const u={};sx(u,t.style,t),r.style={...u,...r.style}}return r}function dN(t=!1){return(i,o,r,{latestValues:u},d)=>{const m=(xh(i)?uN:cN)(o,u,d,i),g=EE(o,typeof i=="string",t),v=i!==x.Fragment?{...g,...m,ref:r}:{},{children:y}=o,b=x.useMemo(()=>Pt(y)?y.get():y,[y]);return x.createElement(i,{...v,children:b})}}function fN(t,a){return function(o,{forwardMotionProps:r}={forwardMotionProps:!1}){const d={...xh(o)?iN:oN,preloadedFeatures:t,useRender:dN(r),createVisualElement:a,Component:o};return BE(d)}}function ix(t,a){if(!Array.isArray(a))return!1;const i=a.length;if(i!==t.length)return!1;for(let o=0;o<i;o++)if(a[o]!==t[o])return!1;return!0}function Rc(t,a,i){const o=t.getProps();return _h(o,a,i!==void 0?i:o.custom,t)}function wh(t,a){return t?t[a]||t.default||t:void 0}const ox=new Set(["width","height","top","left","right","bottom",...Qi]);let oc;function hN(){oc=void 0}const Xn={now:()=>(oc===void 0&&Xn.set(Ut.isProcessing||xE.useManualTiming?Ut.timestamp:performance.now()),oc),set:t=>{oc=t,queueMicrotask(hN)}};function Ah(t,a){t.indexOf(a)===-1&&t.push(a)}function Dh(t,a){const i=t.indexOf(a);i>-1&&t.splice(i,1)}class Rh{constructor(){this.subscriptions=[]}add(a){return Ah(this.subscriptions,a),()=>Dh(this.subscriptions,a)}notify(a,i,o){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](a,i,o);else for(let u=0;u<r;u++){const d=this.subscriptions[u];d&&d(a,i,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function lx(t,a){return a?t*(1e3/a):0}const Ny=30,pN=t=>!isNaN(parseFloat(t));class mN{constructor(a,i={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(o,r=!0)=>{const u=Xn.now();this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(a),this.owner=i.owner}setCurrent(a){this.current=a,this.updatedAt=Xn.now(),this.canTrackVelocity===null&&a!==void 0&&(this.canTrackVelocity=pN(this.current))}setPrevFrameValue(a=this.current){this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt}onChange(a){return this.on("change",a)}on(a,i){this.events[a]||(this.events[a]=new Rh);const o=this.events[a].add(i);return a==="change"?()=>{o(),lt.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const a in this.events)this.events[a].clear()}attach(a,i){this.passiveEffect=a,this.stopPassiveEffect=i}set(a,i=!0){!i||!this.passiveEffect?this.updateAndNotify(a,i):this.passiveEffect(a,this.updateAndNotify)}setWithVelocity(a,i,o){this.set(i),this.prev=void 0,this.prevFrameValue=a,this.prevUpdatedAt=this.updatedAt-o}jump(a,i=!0){this.updateAndNotify(a),this.prev=a,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const a=Xn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||a-this.updatedAt>Ny)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,Ny);return lx(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(a){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=a(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function vl(t,a){return new mN(t,a)}function gN(t,a,i){t.hasValue(a)?t.getValue(a).set(i):t.addValue(a,vl(i))}function vN(t,a){const i=Rc(t,a);let{transitionEnd:o={},transition:r={},...u}=i||{};u={...u,...o};for(const d in u){const p=HE(u[d]);gN(t,d,p)}}function yN(t){return!!(Pt(t)&&t.add)}function Rf(t,a){const i=t.getValue("willChange");if(yN(i))return i.add(a)}function rx(t){return t.props[Fb]}function Mh(t){let a;return()=>(a===void 0&&(a=t()),a)}const bN=Mh(()=>window.ScrollTimeline!==void 0);class xN{constructor(a){this.stop=()=>this.runAll("stop"),this.animations=a.filter(Boolean)}get finished(){return Promise.all(this.animations.map(a=>"finished"in a?a.finished:a))}getAll(a){return this.animations[0][a]}setAll(a,i){for(let o=0;o<this.animations.length;o++)this.animations[o][a]=i}attachTimeline(a,i){const o=this.animations.map(r=>{if(bN()&&r.attachTimeline)return r.attachTimeline(a);if(typeof i=="function")return i(r)});return()=>{o.forEach((r,u)=>{r&&r(),this.animations[u].stop()})}}get time(){return this.getAll("time")}set time(a){this.setAll("time",a)}get speed(){return this.getAll("speed")}set speed(a){this.setAll("speed",a)}get startTime(){return this.getAll("startTime")}get duration(){let a=0;for(let i=0;i<this.animations.length;i++)a=Math.max(a,this.animations[i].duration);return a}runAll(a){this.animations.forEach(i=>i[a]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class _N extends xN{then(a,i){return Promise.all(this.animations).then(a).catch(i)}}const ya=t=>t*1e3,ba=t=>t/1e3;function Oh(t){return typeof t=="function"}function jy(t,a){t.timeline=a,t.onfinish=null}const Bh=t=>Array.isArray(t)&&typeof t[0]=="number",SN={linearEasing:void 0};function TN(t,a){const i=Mh(t);return()=>{var o;return(o=SN[a])!==null&&o!==void 0?o:i()}}const hc=TN(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Fi=(t,a,i)=>{const o=a-t;return o===0?1:(i-t)/o},cx=(t,a,i=10)=>{let o="";const r=Math.max(Math.round(a/i),2);for(let u=0;u<r;u++)o+=t(Fi(0,r-1,u))+", ";return`linear(${o.substring(0,o.length-2)})`};function ux(t){return!!(typeof t=="function"&&hc()||!t||typeof t=="string"&&(t in Mf||hc())||Bh(t)||Array.isArray(t)&&t.every(ux))}const el=([t,a,i,o])=>`cubic-bezier(${t}, ${a}, ${i}, ${o})`,Mf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:el([0,.65,.55,1]),circOut:el([.55,0,1,.45]),backIn:el([.31,.01,.66,-.59]),backOut:el([.33,1.53,.69,.99])};function dx(t,a){if(t)return typeof t=="function"&&hc()?cx(t,a):Bh(t)?el(t):Array.isArray(t)?t.map(i=>dx(i,a)||Mf.easeOut):Mf[t]}const fx=(t,a,i)=>(((1-3*i+3*a)*t+(3*i-6*a))*t+3*a)*t,kN=1e-7,CN=12;function EN(t,a,i,o,r){let u,d,p=0;do d=a+(i-a)/2,u=fx(d,o,r)-t,u>0?i=d:a=d;while(Math.abs(u)>kN&&++p<CN);return d}function kl(t,a,i,o){if(t===a&&i===o)return fn;const r=u=>EN(u,0,1,t,i);return u=>u===0||u===1?u:fx(r(u),a,o)}const hx=t=>a=>a<=.5?t(2*a)/2:(2-t(2*(1-a)))/2,px=t=>a=>1-t(1-a),mx=kl(.33,1.53,.69,.99),Ih=px(mx),gx=hx(Ih),vx=t=>(t*=2)<1?.5*Ih(t):.5*(2-Math.pow(2,-10*(t-1))),Lh=t=>1-Math.sin(Math.acos(t)),yx=px(Lh),bx=hx(Lh),xx=t=>/^0[^.\s]+$/u.test(t);function NN(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||xx(t):!0}const ll=t=>Math.round(t*1e5)/1e5,Uh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function jN(t){return t==null}const wN=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,zh=(t,a)=>i=>!!(typeof i=="string"&&wN.test(i)&&i.startsWith(t)||a&&!jN(i)&&Object.prototype.hasOwnProperty.call(i,a)),_x=(t,a,i)=>o=>{if(typeof o!="string")return o;const[r,u,d,p]=o.match(Uh);return{[t]:parseFloat(r),[a]:parseFloat(u),[i]:parseFloat(d),alpha:p!==void 0?parseFloat(p):1}},AN=t=>Sa(0,255,t),sf={...Wi,transform:t=>Math.round(AN(t))},Ms={test:zh("rgb","red"),parse:_x("red","green","blue"),transform:({red:t,green:a,blue:i,alpha:o=1})=>"rgba("+sf.transform(t)+", "+sf.transform(a)+", "+sf.transform(i)+", "+ll(gl.transform(o))+")"};function DN(t){let a="",i="",o="",r="";return t.length>5?(a=t.substring(1,3),i=t.substring(3,5),o=t.substring(5,7),r=t.substring(7,9)):(a=t.substring(1,2),i=t.substring(2,3),o=t.substring(3,4),r=t.substring(4,5),a+=a,i+=i,o+=o,r+=r),{red:parseInt(a,16),green:parseInt(i,16),blue:parseInt(o,16),alpha:r?parseInt(r,16)/255:1}}const Of={test:zh("#"),parse:DN,transform:Ms.transform},Ii={test:zh("hsl","hue"),parse:_x("hue","saturation","lightness"),transform:({hue:t,saturation:a,lightness:i,alpha:o=1})=>"hsla("+Math.round(t)+", "+Zn.transform(ll(a))+", "+Zn.transform(ll(i))+", "+ll(gl.transform(o))+")"},Ht={test:t=>Ms.test(t)||Of.test(t)||Ii.test(t),parse:t=>Ms.test(t)?Ms.parse(t):Ii.test(t)?Ii.parse(t):Of.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ms.transform(t):Ii.transform(t)},RN=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function MN(t){var a,i;return isNaN(t)&&typeof t=="string"&&(((a=t.match(Uh))===null||a===void 0?void 0:a.length)||0)+(((i=t.match(RN))===null||i===void 0?void 0:i.length)||0)>0}const Sx="number",Tx="color",ON="var",BN="var(",wy="${}",IN=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function yl(t){const a=t.toString(),i=[],o={color:[],number:[],var:[]},r=[];let u=0;const p=a.replace(IN,m=>(Ht.test(m)?(o.color.push(u),r.push(Tx),i.push(Ht.parse(m))):m.startsWith(BN)?(o.var.push(u),r.push(ON),i.push(m)):(o.number.push(u),r.push(Sx),i.push(parseFloat(m))),++u,wy)).split(wy);return{values:i,split:p,indexes:o,types:r}}function kx(t){return yl(t).values}function Cx(t){const{split:a,types:i}=yl(t),o=a.length;return r=>{let u="";for(let d=0;d<o;d++)if(u+=a[d],r[d]!==void 0){const p=i[d];p===Sx?u+=ll(r[d]):p===Tx?u+=Ht.transform(r[d]):u+=r[d]}return u}}const LN=t=>typeof t=="number"?0:t;function UN(t){const a=kx(t);return Cx(t)(a.map(LN))}const as={test:MN,parse:kx,createTransformer:Cx,getAnimatableNone:UN},zN=new Set(["brightness","contrast","saturate","opacity"]);function VN(t){const[a,i]=t.slice(0,-1).split("(");if(a==="drop-shadow")return t;const[o]=i.match(Uh)||[];if(!o)return t;const r=i.replace(o,"");let u=zN.has(a)?1:0;return o!==i&&(u*=100),a+"("+u+r+")"}const HN=/\b([a-z-]*)\(.*?\)/gu,Bf={...as,getAnimatableNone:t=>{const a=t.match(HN);return a?a.map(VN).join(" "):t}},PN={...Th,color:Ht,backgroundColor:Ht,outlineColor:Ht,fill:Ht,stroke:Ht,borderColor:Ht,borderTopColor:Ht,borderRightColor:Ht,borderBottomColor:Ht,borderLeftColor:Ht,filter:Bf,WebkitFilter:Bf},Vh=t=>PN[t];function Ex(t,a){let i=Vh(t);return i!==Bf&&(i=as),i.getAnimatableNone?i.getAnimatableNone(a):void 0}const GN=new Set(["auto","none","0"]);function $N(t,a,i){let o=0,r;for(;o<t.length&&!r;){const u=t[o];typeof u=="string"&&!GN.has(u)&&yl(u).values.length&&(r=t[o]),o++}if(r&&i)for(const u of a)t[u]=Ex(i,r)}const Ay=t=>t===Wi||t===be,Dy=(t,a)=>parseFloat(t.split(", ")[a]),Ry=(t,a)=>(i,{transform:o})=>{if(o==="none"||!o)return 0;const r=o.match(/^matrix3d\((.+)\)$/u);if(r)return Dy(r[1],a);{const u=o.match(/^matrix\((.+)\)$/u);return u?Dy(u[1],t):0}},FN=new Set(["x","y","z"]),qN=Qi.filter(t=>!FN.has(t));function KN(t){const a=[];return qN.forEach(i=>{const o=t.getValue(i);o!==void 0&&(a.push([i,o.get()]),o.set(i.startsWith("scale")?1:0))}),a}const qi={width:({x:t},{paddingLeft:a="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(a)-parseFloat(i),height:({y:t},{paddingTop:a="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(a)-parseFloat(i),top:(t,{top:a})=>parseFloat(a),left:(t,{left:a})=>parseFloat(a),bottom:({y:t},{top:a})=>parseFloat(a)+(t.max-t.min),right:({x:t},{left:a})=>parseFloat(a)+(t.max-t.min),x:Ry(4,13),y:Ry(5,14)};qi.translateX=qi.x;qi.translateY=qi.y;const Os=new Set;let If=!1,Lf=!1;function Nx(){if(Lf){const t=Array.from(Os).filter(o=>o.needsMeasurement),a=new Set(t.map(o=>o.element)),i=new Map;a.forEach(o=>{const r=KN(o);r.length&&(i.set(o,r),o.render())}),t.forEach(o=>o.measureInitialState()),a.forEach(o=>{o.render();const r=i.get(o);r&&r.forEach(([u,d])=>{var p;(p=o.getValue(u))===null||p===void 0||p.set(d)})}),t.forEach(o=>o.measureEndState()),t.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}Lf=!1,If=!1,Os.forEach(t=>t.complete()),Os.clear()}function jx(){Os.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Lf=!0)})}function YN(){jx(),Nx()}class Hh{constructor(a,i,o,r,u,d=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...a],this.onComplete=i,this.name=o,this.motionValue=r,this.element=u,this.isAsync=d}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Os.add(this),If||(If=!0,lt.read(jx),lt.resolveKeyframes(Nx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:a,name:i,element:o,motionValue:r}=this;for(let u=0;u<a.length;u++)if(a[u]===null)if(u===0){const d=r==null?void 0:r.get(),p=a[a.length-1];if(d!==void 0)a[0]=d;else if(o&&i){const m=o.readValue(i,p);m!=null&&(a[0]=m)}a[0]===void 0&&(a[0]=p),r&&d===void 0&&r.set(a[0])}else a[u]=a[u-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Os.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Os.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const wx=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ZN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function XN(t){const a=ZN.exec(t);if(!a)return[,];const[,i,o,r]=a;return[`--${i??o}`,r]}function Ax(t,a,i=1){const[o,r]=XN(t);if(!o)return;const u=window.getComputedStyle(a).getPropertyValue(o);if(u){const d=u.trim();return wx(d)?parseFloat(d):d}return Sh(r)?Ax(r,a,i+1):r}const Dx=t=>a=>a.test(t),QN={test:t=>t==="auto",parse:t=>t},Rx=[Wi,be,Zn,Wa,KE,qE,QN],My=t=>Rx.find(Dx(t));class Mx extends Hh{constructor(a,i,o,r,u){super(a,i,o,r,u,!0)}readKeyframes(){const{unresolvedKeyframes:a,element:i,name:o}=this;if(!i||!i.current)return;super.readKeyframes();for(let m=0;m<a.length;m++){let g=a[m];if(typeof g=="string"&&(g=g.trim(),Sh(g))){const v=Ax(g,i.current);v!==void 0&&(a[m]=v),m===a.length-1&&(this.finalKeyframe=g)}}if(this.resolveNoneKeyframes(),!ox.has(o)||a.length!==2)return;const[r,u]=a,d=My(r),p=My(u);if(d!==p)if(Ay(d)&&Ay(p))for(let m=0;m<a.length;m++){const g=a[m];typeof g=="string"&&(a[m]=parseFloat(g))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:a,name:i}=this,o=[];for(let r=0;r<a.length;r++)NN(a[r])&&o.push(r);o.length&&$N(a,o,i)}measureInitialState(){const{element:a,unresolvedKeyframes:i,name:o}=this;if(!a||!a.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=qi[o](a.measureViewportBox(),window.getComputedStyle(a.current)),i[0]=this.measuredOrigin;const r=i[i.length-1];r!==void 0&&a.getValue(o,r).jump(r,!1)}measureEndState(){var a;const{element:i,name:o,unresolvedKeyframes:r}=this;if(!i||!i.current)return;const u=i.getValue(o);u&&u.jump(this.measuredOrigin,!1);const d=r.length-1,p=r[d];r[d]=qi[o](i.measureViewportBox(),window.getComputedStyle(i.current)),p!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=p),!((a=this.removedTransforms)===null||a===void 0)&&a.length&&this.removedTransforms.forEach(([m,g])=>{i.getValue(m).set(g)}),this.resolveNoneKeyframes()}}const Oy=(t,a)=>a==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(as.test(t)||t==="0")&&!t.startsWith("url("));function WN(t){const a=t[0];if(t.length===1)return!0;for(let i=0;i<t.length;i++)if(t[i]!==a)return!0}function JN(t,a,i,o){const r=t[0];if(r===null)return!1;if(a==="display"||a==="visibility")return!0;const u=t[t.length-1],d=Oy(r,a),p=Oy(u,a);return!d||!p?!1:WN(t)||(i==="spring"||Oh(i))&&o}const ej=t=>t!==null;function Mc(t,{repeat:a,repeatType:i="loop"},o){const r=t.filter(ej),u=a&&i!=="loop"&&a%2===1?0:r.length-1;return!u||o===void 0?r[u]:o}const tj=40;class Ox{constructor({autoplay:a=!0,delay:i=0,type:o="keyframes",repeat:r=0,repeatDelay:u=0,repeatType:d="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Xn.now(),this.options={autoplay:a,delay:i,type:o,repeat:r,repeatDelay:u,repeatType:d,...p},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>tj?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&YN(),this._resolved}onKeyframesResolved(a,i){this.resolvedAt=Xn.now(),this.hasAttemptedResolve=!0;const{name:o,type:r,velocity:u,delay:d,onComplete:p,onUpdate:m,isGenerator:g}=this.options;if(!g&&!JN(a,o,r,u))if(d)this.options.duration=0;else{m&&m(Mc(a,this.options,i)),p&&p(),this.resolveFinishedPromise();return}const v=this.initPlayback(a,i);v!==!1&&(this._resolved={keyframes:a,finalKeyframe:i,...v},this.onPostResolved())}onPostResolved(){}then(a,i){return this.currentFinishedPromise.then(a,i)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(a=>{this.resolveFinishedPromise=a})}}const Uf=2e4;function Bx(t){let a=0;const i=50;let o=t.next(a);for(;!o.done&&a<Uf;)a+=i,o=t.next(a);return a>=Uf?1/0:a}const ut=(t,a,i)=>t+(a-t)*i;function of(t,a,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+(a-t)*6*i:i<1/2?a:i<2/3?t+(a-t)*(2/3-i)*6:t}function nj({hue:t,saturation:a,lightness:i,alpha:o}){t/=360,a/=100,i/=100;let r=0,u=0,d=0;if(!a)r=u=d=i;else{const p=i<.5?i*(1+a):i+a-i*a,m=2*i-p;r=of(m,p,t+1/3),u=of(m,p,t),d=of(m,p,t-1/3)}return{red:Math.round(r*255),green:Math.round(u*255),blue:Math.round(d*255),alpha:o}}function pc(t,a){return i=>i>0?a:t}const lf=(t,a,i)=>{const o=t*t,r=i*(a*a-o)+o;return r<0?0:Math.sqrt(r)},aj=[Of,Ms,Ii],sj=t=>aj.find(a=>a.test(t));function By(t){const a=sj(t);if(!a)return!1;let i=a.parse(t);return a===Ii&&(i=nj(i)),i}const Iy=(t,a)=>{const i=By(t),o=By(a);if(!i||!o)return pc(t,a);const r={...i};return u=>(r.red=lf(i.red,o.red,u),r.green=lf(i.green,o.green,u),r.blue=lf(i.blue,o.blue,u),r.alpha=ut(i.alpha,o.alpha,u),Ms.transform(r))},ij=(t,a)=>i=>a(t(i)),Cl=(...t)=>t.reduce(ij),zf=new Set(["none","hidden"]);function oj(t,a){return zf.has(t)?i=>i<=0?t:a:i=>i>=1?a:t}function lj(t,a){return i=>ut(t,a,i)}function Ph(t){return typeof t=="number"?lj:typeof t=="string"?Sh(t)?pc:Ht.test(t)?Iy:uj:Array.isArray(t)?Ix:typeof t=="object"?Ht.test(t)?Iy:rj:pc}function Ix(t,a){const i=[...t],o=i.length,r=t.map((u,d)=>Ph(u)(u,a[d]));return u=>{for(let d=0;d<o;d++)i[d]=r[d](u);return i}}function rj(t,a){const i={...t,...a},o={};for(const r in i)t[r]!==void 0&&a[r]!==void 0&&(o[r]=Ph(t[r])(t[r],a[r]));return r=>{for(const u in o)i[u]=o[u](r);return i}}function cj(t,a){var i;const o=[],r={color:0,var:0,number:0};for(let u=0;u<a.values.length;u++){const d=a.types[u],p=t.indexes[d][r[d]],m=(i=t.values[p])!==null&&i!==void 0?i:0;o[u]=m,r[d]++}return o}const uj=(t,a)=>{const i=as.createTransformer(a),o=yl(t),r=yl(a);return o.indexes.var.length===r.indexes.var.length&&o.indexes.color.length===r.indexes.color.length&&o.indexes.number.length>=r.indexes.number.length?zf.has(t)&&!r.values.length||zf.has(a)&&!o.values.length?oj(t,a):Cl(Ix(cj(o,r),r.values),i):pc(t,a)};function Lx(t,a,i){return typeof t=="number"&&typeof a=="number"&&typeof i=="number"?ut(t,a,i):Ph(t)(t,a)}const dj=5;function Ux(t,a,i){const o=Math.max(a-dj,0);return lx(i-t(o),a-o)}const ht={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},rf=.001;function fj({duration:t=ht.duration,bounce:a=ht.bounce,velocity:i=ht.velocity,mass:o=ht.mass}){let r,u,d=1-a;d=Sa(ht.minDamping,ht.maxDamping,d),t=Sa(ht.minDuration,ht.maxDuration,ba(t)),d<1?(r=g=>{const v=g*d,y=v*t,b=v-i,S=Vf(g,d),T=Math.exp(-y);return rf-b/S*T},u=g=>{const y=g*d*t,b=y*i+i,S=Math.pow(d,2)*Math.pow(g,2)*t,T=Math.exp(-y),C=Vf(Math.pow(g,2),d);return(-r(g)+rf>0?-1:1)*((b-S)*T)/C}):(r=g=>{const v=Math.exp(-g*t),y=(g-i)*t+1;return-rf+v*y},u=g=>{const v=Math.exp(-g*t),y=(i-g)*(t*t);return v*y});const p=5/t,m=pj(r,u,p);if(t=ya(t),isNaN(m))return{stiffness:ht.stiffness,damping:ht.damping,duration:t};{const g=Math.pow(m,2)*o;return{stiffness:g,damping:d*2*Math.sqrt(o*g),duration:t}}}const hj=12;function pj(t,a,i){let o=i;for(let r=1;r<hj;r++)o=o-t(o)/a(o);return o}function Vf(t,a){return t*Math.sqrt(1-a*a)}const mj=["duration","bounce"],gj=["stiffness","damping","mass"];function Ly(t,a){return a.some(i=>t[i]!==void 0)}function vj(t){let a={velocity:ht.velocity,stiffness:ht.stiffness,damping:ht.damping,mass:ht.mass,isResolvedFromDuration:!1,...t};if(!Ly(t,gj)&&Ly(t,mj))if(t.visualDuration){const i=t.visualDuration,o=2*Math.PI/(i*1.2),r=o*o,u=2*Sa(.05,1,1-(t.bounce||0))*Math.sqrt(r);a={...a,mass:ht.mass,stiffness:r,damping:u}}else{const i=fj(t);a={...a,...i,mass:ht.mass},a.isResolvedFromDuration=!0}return a}function zx(t=ht.visualDuration,a=ht.bounce){const i=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:a}:t;let{restSpeed:o,restDelta:r}=i;const u=i.keyframes[0],d=i.keyframes[i.keyframes.length-1],p={done:!1,value:u},{stiffness:m,damping:g,mass:v,duration:y,velocity:b,isResolvedFromDuration:S}=vj({...i,velocity:-ba(i.velocity||0)}),T=b||0,C=g/(2*Math.sqrt(m*v)),N=d-u,E=ba(Math.sqrt(m/v)),w=Math.abs(N)<5;o||(o=w?ht.restSpeed.granular:ht.restSpeed.default),r||(r=w?ht.restDelta.granular:ht.restDelta.default);let R;if(C<1){const A=Vf(E,C);R=$=>{const V=Math.exp(-C*E*$);return d-V*((T+C*E*N)/A*Math.sin(A*$)+N*Math.cos(A*$))}}else if(C===1)R=A=>d-Math.exp(-E*A)*(N+(T+E*N)*A);else{const A=E*Math.sqrt(C*C-1);R=$=>{const V=Math.exp(-C*E*$),B=Math.min(A*$,300);return d-V*((T+C*E*N)*Math.sinh(B)+A*N*Math.cosh(B))/A}}const M={calculatedDuration:S&&y||null,next:A=>{const $=R(A);if(S)p.done=A>=y;else{let V=0;C<1&&(V=A===0?ya(T):Ux(R,A,$));const B=Math.abs(V)<=o,F=Math.abs(d-$)<=r;p.done=B&&F}return p.value=p.done?d:$,p},toString:()=>{const A=Math.min(Bx(M),Uf),$=cx(V=>M.next(A*V).value,A,30);return A+"ms "+$}};return M}function Uy({keyframes:t,velocity:a=0,power:i=.8,timeConstant:o=325,bounceDamping:r=10,bounceStiffness:u=500,modifyTarget:d,min:p,max:m,restDelta:g=.5,restSpeed:v}){const y=t[0],b={done:!1,value:y},S=B=>p!==void 0&&B<p||m!==void 0&&B>m,T=B=>p===void 0?m:m===void 0||Math.abs(p-B)<Math.abs(m-B)?p:m;let C=i*a;const N=y+C,E=d===void 0?N:d(N);E!==N&&(C=E-y);const w=B=>-C*Math.exp(-B/o),R=B=>E+w(B),M=B=>{const F=w(B),X=R(B);b.done=Math.abs(F)<=g,b.value=b.done?E:X};let A,$;const V=B=>{S(b.value)&&(A=B,$=zx({keyframes:[b.value,T(b.value)],velocity:Ux(R,B,b.value),damping:r,stiffness:u,restDelta:g,restSpeed:v}))};return V(0),{calculatedDuration:null,next:B=>{let F=!1;return!$&&A===void 0&&(F=!0,M(B),V(B)),A!==void 0&&B>=A?$.next(B-A):(!F&&M(B),b)}}}const yj=kl(.42,0,1,1),bj=kl(0,0,.58,1),Vx=kl(.42,0,.58,1),xj=t=>Array.isArray(t)&&typeof t[0]!="number",_j={linear:fn,easeIn:yj,easeInOut:Vx,easeOut:bj,circIn:Lh,circInOut:bx,circOut:yx,backIn:Ih,backInOut:gx,backOut:mx,anticipate:vx},zy=t=>{if(Bh(t)){Vb(t.length===4);const[a,i,o,r]=t;return kl(a,i,o,r)}else if(typeof t=="string")return _j[t];return t};function Sj(t,a,i){const o=[],r=i||Lx,u=t.length-1;for(let d=0;d<u;d++){let p=r(t[d],t[d+1]);if(a){const m=Array.isArray(a)?a[d]||fn:a;p=Cl(m,p)}o.push(p)}return o}function Tj(t,a,{clamp:i=!0,ease:o,mixer:r}={}){const u=t.length;if(Vb(u===a.length),u===1)return()=>a[0];if(u===2&&a[0]===a[1])return()=>a[1];const d=t[0]===t[1];t[0]>t[u-1]&&(t=[...t].reverse(),a=[...a].reverse());const p=Sj(a,o,r),m=p.length,g=v=>{if(d&&v<t[0])return a[0];let y=0;if(m>1)for(;y<t.length-2&&!(v<t[y+1]);y++);const b=Fi(t[y],t[y+1],v);return p[y](b)};return i?v=>g(Sa(t[0],t[u-1],v)):g}function kj(t,a){const i=t[t.length-1];for(let o=1;o<=a;o++){const r=Fi(0,a,o);t.push(ut(i,1,r))}}function Cj(t){const a=[0];return kj(a,t.length-1),a}function Ej(t,a){return t.map(i=>i*a)}function Nj(t,a){return t.map(()=>a||Vx).splice(0,t.length-1)}function mc({duration:t=300,keyframes:a,times:i,ease:o="easeInOut"}){const r=xj(o)?o.map(zy):zy(o),u={done:!1,value:a[0]},d=Ej(i&&i.length===a.length?i:Cj(a),t),p=Tj(d,a,{ease:Array.isArray(r)?r:Nj(a,r)});return{calculatedDuration:t,next:m=>(u.value=p(m),u.done=m>=t,u)}}const jj=t=>{const a=({timestamp:i})=>t(i);return{start:()=>lt.update(a,!0),stop:()=>ns(a),now:()=>Ut.isProcessing?Ut.timestamp:Xn.now()}},wj={decay:Uy,inertia:Uy,tween:mc,keyframes:mc,spring:zx},Aj=t=>t/100;class Gh extends Ox{constructor(a){super(a),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:m}=this.options;m&&m()};const{name:i,motionValue:o,element:r,keyframes:u}=this.options,d=(r==null?void 0:r.KeyframeResolver)||Hh,p=(m,g)=>this.onKeyframesResolved(m,g);this.resolver=new d(u,p,i,o,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(a){const{type:i="keyframes",repeat:o=0,repeatDelay:r=0,repeatType:u,velocity:d=0}=this.options,p=Oh(i)?i:wj[i]||mc;let m,g;p!==mc&&typeof a[0]!="number"&&(m=Cl(Aj,Lx(a[0],a[1])),a=[0,100]);const v=p({...this.options,keyframes:a});u==="mirror"&&(g=p({...this.options,keyframes:[...a].reverse(),velocity:-d})),v.calculatedDuration===null&&(v.calculatedDuration=Bx(v));const{calculatedDuration:y}=v,b=y+r,S=b*(o+1)-r;return{generator:v,mirroredGenerator:g,mapPercentToKeyframes:m,calculatedDuration:y,resolvedDuration:b,totalDuration:S}}onPostResolved(){const{autoplay:a=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!a?this.pause():this.state=this.pendingPlayState}tick(a,i=!1){const{resolved:o}=this;if(!o){const{keyframes:B}=this.options;return{done:!0,value:B[B.length-1]}}const{finalKeyframe:r,generator:u,mirroredGenerator:d,mapPercentToKeyframes:p,keyframes:m,calculatedDuration:g,totalDuration:v,resolvedDuration:y}=o;if(this.startTime===null)return u.next(0);const{delay:b,repeat:S,repeatType:T,repeatDelay:C,onUpdate:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,a):this.speed<0&&(this.startTime=Math.min(a-v/this.speed,this.startTime)),i?this.currentTime=a:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(a-this.startTime)*this.speed;const E=this.currentTime-b*(this.speed>=0?1:-1),w=this.speed>=0?E<0:E>v;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=v);let R=this.currentTime,M=u;if(S){const B=Math.min(this.currentTime,v)/y;let F=Math.floor(B),X=B%1;!X&&B>=1&&(X=1),X===1&&F--,F=Math.min(F,S+1),!!(F%2)&&(T==="reverse"?(X=1-X,C&&(X-=C/y)):T==="mirror"&&(M=d)),R=Sa(0,1,X)*y}const A=w?{done:!1,value:m[0]}:M.next(R);p&&(A.value=p(A.value));let{done:$}=A;!w&&g!==null&&($=this.speed>=0?this.currentTime>=v:this.currentTime<=0);const V=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&$);return V&&r!==void 0&&(A.value=Mc(m,this.options,r)),N&&N(A.value),V&&this.finish(),A}get duration(){const{resolved:a}=this;return a?ba(a.calculatedDuration):0}get time(){return ba(this.currentTime)}set time(a){a=ya(a),this.currentTime=a,this.holdTime!==null||this.speed===0?this.holdTime=a:this.driver&&(this.startTime=this.driver.now()-a/this.speed)}get speed(){return this.playbackSpeed}set speed(a){const i=this.playbackSpeed!==a;this.playbackSpeed=a,i&&(this.time=ba(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:a=jj,onPlay:i,startTime:o}=this.options;this.driver||(this.driver=a(u=>this.tick(u))),i&&i();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=o??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var a;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(a=this.currentTime)!==null&&a!==void 0?a:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:a}=this.options;a&&a()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(a){return this.startTime=0,this.tick(a,!0)}}const Dj=new Set(["opacity","clipPath","filter","transform"]);function Rj(t,a,i,{delay:o=0,duration:r=300,repeat:u=0,repeatType:d="loop",ease:p="easeInOut",times:m}={}){const g={[a]:i};m&&(g.offset=m);const v=dx(p,r);return Array.isArray(v)&&(g.easing=v),t.animate(g,{delay:o,duration:r,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:u+1,direction:d==="reverse"?"alternate":"normal"})}const Mj=Mh(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),gc=10,Oj=2e4;function Bj(t){return Oh(t.type)||t.type==="spring"||!ux(t.ease)}function Ij(t,a){const i=new Gh({...a,keyframes:t,repeat:0,delay:0,isGenerator:!0});let o={done:!1,value:t[0]};const r=[];let u=0;for(;!o.done&&u<Oj;)o=i.sample(u),r.push(o.value),u+=gc;return{times:void 0,keyframes:r,duration:u-gc,ease:"linear"}}const Hx={anticipate:vx,backInOut:gx,circInOut:bx};function Lj(t){return t in Hx}class Vy extends Ox{constructor(a){super(a);const{name:i,motionValue:o,element:r,keyframes:u}=this.options;this.resolver=new Mx(u,(d,p)=>this.onKeyframesResolved(d,p),i,o,r),this.resolver.scheduleResolve()}initPlayback(a,i){let{duration:o=300,times:r,ease:u,type:d,motionValue:p,name:m,startTime:g}=this.options;if(!p.owner||!p.owner.current)return!1;if(typeof u=="string"&&hc()&&Lj(u)&&(u=Hx[u]),Bj(this.options)){const{onComplete:y,onUpdate:b,motionValue:S,element:T,...C}=this.options,N=Ij(a,C);a=N.keyframes,a.length===1&&(a[1]=a[0]),o=N.duration,r=N.times,u=N.ease,d="keyframes"}const v=Rj(p.owner.current,m,a,{...this.options,duration:o,times:r,ease:u});return v.startTime=g??this.calcStartTime(),this.pendingTimeline?(jy(v,this.pendingTimeline),this.pendingTimeline=void 0):v.onfinish=()=>{const{onComplete:y}=this.options;p.set(Mc(a,this.options,i)),y&&y(),this.cancel(),this.resolveFinishedPromise()},{animation:v,duration:o,times:r,type:d,ease:u,keyframes:a}}get duration(){const{resolved:a}=this;if(!a)return 0;const{duration:i}=a;return ba(i)}get time(){const{resolved:a}=this;if(!a)return 0;const{animation:i}=a;return ba(i.currentTime||0)}set time(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.currentTime=ya(a)}get speed(){const{resolved:a}=this;if(!a)return 1;const{animation:i}=a;return i.playbackRate}set speed(a){const{resolved:i}=this;if(!i)return;const{animation:o}=i;o.playbackRate=a}get state(){const{resolved:a}=this;if(!a)return"idle";const{animation:i}=a;return i.playState}get startTime(){const{resolved:a}=this;if(!a)return null;const{animation:i}=a;return i.startTime}attachTimeline(a){if(!this._resolved)this.pendingTimeline=a;else{const{resolved:i}=this;if(!i)return fn;const{animation:o}=i;jy(o,a)}return fn}play(){if(this.isStopped)return;const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.playState==="finished"&&this.updateFinishedPromise(),i.play()}pause(){const{resolved:a}=this;if(!a)return;const{animation:i}=a;i.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:a}=this;if(!a)return;const{animation:i,keyframes:o,duration:r,type:u,ease:d,times:p}=a;if(i.playState==="idle"||i.playState==="finished")return;if(this.time){const{motionValue:g,onUpdate:v,onComplete:y,element:b,...S}=this.options,T=new Gh({...S,keyframes:o,duration:r,type:u,ease:d,times:p,isGenerator:!0}),C=ya(this.time);g.setWithVelocity(T.sample(C-gc).value,T.sample(C).value,gc)}const{onStop:m}=this.options;m&&m(),this.cancel()}complete(){const{resolved:a}=this;a&&a.animation.finish()}cancel(){const{resolved:a}=this;a&&a.animation.cancel()}static supports(a){const{motionValue:i,name:o,repeatDelay:r,repeatType:u,damping:d,type:p}=a;if(!i||!i.owner||!(i.owner.current instanceof HTMLElement))return!1;const{onUpdate:m,transformTemplate:g}=i.owner.getProps();return Mj()&&o&&Dj.has(o)&&!m&&!g&&!r&&u!=="mirror"&&d!==0&&p!=="inertia"}}const Uj={type:"spring",stiffness:500,damping:25,restSpeed:10},zj=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Vj={type:"keyframes",duration:.8},Hj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Pj=(t,{keyframes:a})=>a.length>2?Vj:Vs.has(t)?t.startsWith("scale")?zj(a[1]):Uj:Hj;function Gj({when:t,delay:a,delayChildren:i,staggerChildren:o,staggerDirection:r,repeat:u,repeatType:d,repeatDelay:p,from:m,elapsed:g,...v}){return!!Object.keys(v).length}const $h=(t,a,i,o={},r,u)=>d=>{const p=wh(o,t)||{},m=p.delay||o.delay||0;let{elapsed:g=0}=o;g=g-ya(m);let v={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:a.getVelocity(),...p,delay:-g,onUpdate:b=>{a.set(b),p.onUpdate&&p.onUpdate(b)},onComplete:()=>{d(),p.onComplete&&p.onComplete()},name:t,motionValue:a,element:u?void 0:r};Gj(p)||(v={...v,...Pj(t,v)}),v.duration&&(v.duration=ya(v.duration)),v.repeatDelay&&(v.repeatDelay=ya(v.repeatDelay)),v.from!==void 0&&(v.keyframes[0]=v.from);let y=!1;if((v.type===!1||v.duration===0&&!v.repeatDelay)&&(v.duration=0,v.delay===0&&(y=!0)),y&&!u&&a.get()!==void 0){const b=Mc(v.keyframes,p);if(b!==void 0)return lt.update(()=>{v.onUpdate(b),v.onComplete()}),new _N([])}return!u&&Vy.supports(v)?new Vy(v):new Gh(v)};function $j({protectedKeys:t,needsAnimating:a},i){const o=t.hasOwnProperty(i)&&a[i]!==!0;return a[i]=!1,o}function Px(t,a,{delay:i=0,transitionOverride:o,type:r}={}){var u;let{transition:d=t.getDefaultTransition(),transitionEnd:p,...m}=a;o&&(d=o);const g=[],v=r&&t.animationState&&t.animationState.getState()[r];for(const y in m){const b=t.getValue(y,(u=t.latestValues[y])!==null&&u!==void 0?u:null),S=m[y];if(S===void 0||v&&$j(v,y))continue;const T={delay:i,...wh(d||{},y)};let C=!1;if(window.MotionHandoffAnimation){const E=rx(t);if(E){const w=window.MotionHandoffAnimation(E,y,lt);w!==null&&(T.startTime=w,C=!0)}}Rf(t,y),b.start($h(y,b,S,t.shouldReduceMotion&&ox.has(y)?{type:!1}:T,t,C));const N=b.animation;N&&g.push(N)}return p&&Promise.all(g).then(()=>{lt.update(()=>{p&&vN(t,p)})}),g}function Hf(t,a,i={}){var o;const r=Rc(t,a,i.type==="exit"?(o=t.presenceContext)===null||o===void 0?void 0:o.custom:void 0);let{transition:u=t.getDefaultTransition()||{}}=r||{};i.transitionOverride&&(u=i.transitionOverride);const d=r?()=>Promise.all(Px(t,r,i)):()=>Promise.resolve(),p=t.variantChildren&&t.variantChildren.size?(g=0)=>{const{delayChildren:v=0,staggerChildren:y,staggerDirection:b}=u;return Fj(t,a,v+g,y,b,i)}:()=>Promise.resolve(),{when:m}=u;if(m){const[g,v]=m==="beforeChildren"?[d,p]:[p,d];return g().then(()=>v())}else return Promise.all([d(),p(i.delay)])}function Fj(t,a,i=0,o=0,r=1,u){const d=[],p=(t.variantChildren.size-1)*o,m=r===1?(g=0)=>g*o:(g=0)=>p-g*o;return Array.from(t.variantChildren).sort(qj).forEach((g,v)=>{g.notify("AnimationStart",a),d.push(Hf(g,a,{...u,delay:i+m(v)}).then(()=>g.notify("AnimationComplete",a)))}),Promise.all(d)}function qj(t,a){return t.sortNodePosition(a)}function Kj(t,a,i={}){t.notify("AnimationStart",a);let o;if(Array.isArray(a)){const r=a.map(u=>Hf(t,u,i));o=Promise.all(r)}else if(typeof a=="string")o=Hf(t,a,i);else{const r=typeof a=="function"?Rc(t,a,i.custom):a;o=Promise.all(Px(t,r,i))}return o.then(()=>{t.notify("AnimationComplete",a)})}const Yj=vh.length;function Gx(t){if(!t)return;if(!t.isControllingVariants){const i=t.parent?Gx(t.parent)||{}:{};return t.props.initial!==void 0&&(i.initial=t.props.initial),i}const a={};for(let i=0;i<Yj;i++){const o=vh[i],r=t.props[o];(ml(r)||r===!1)&&(a[o]=r)}return a}const Zj=[...gh].reverse(),Xj=gh.length;function Qj(t){return a=>Promise.all(a.map(({animation:i,options:o})=>Kj(t,i,o)))}function Wj(t){let a=Qj(t),i=Hy(),o=!0;const r=m=>(g,v)=>{var y;const b=Rc(t,v,m==="exit"?(y=t.presenceContext)===null||y===void 0?void 0:y.custom:void 0);if(b){const{transition:S,transitionEnd:T,...C}=b;g={...g,...C,...T}}return g};function u(m){a=m(t)}function d(m){const{props:g}=t,v=Gx(t.parent)||{},y=[],b=new Set;let S={},T=1/0;for(let N=0;N<Xj;N++){const E=Zj[N],w=i[E],R=g[E]!==void 0?g[E]:v[E],M=ml(R),A=E===m?w.isActive:null;A===!1&&(T=N);let $=R===v[E]&&R!==g[E]&&M;if($&&o&&t.manuallyAnimateOnMount&&($=!1),w.protectedKeys={...S},!w.isActive&&A===null||!R&&!w.prevProp||Ac(R)||typeof R=="boolean")continue;const V=Jj(w.prevProp,R);let B=V||E===m&&w.isActive&&!$&&M||N>T&&M,F=!1;const X=Array.isArray(R)?R:[R];let J=X.reduce(r(E),{});A===!1&&(J={});const{prevResolvedValues:te={}}=w,ee={...te,...J},z=K=>{B=!0,b.has(K)&&(F=!0,b.delete(K)),w.needsAnimating[K]=!0;const se=t.getValue(K);se&&(se.liveStyle=!1)};for(const K in ee){const se=J[K],oe=te[K];if(S.hasOwnProperty(K))continue;let j=!1;Df(se)&&Df(oe)?j=!ix(se,oe):j=se!==oe,j?se!=null?z(K):b.add(K):se!==void 0&&b.has(K)?z(K):w.protectedKeys[K]=!0}w.prevProp=R,w.prevResolvedValues=J,w.isActive&&(S={...S,...J}),o&&t.blockInitialAnimation&&(B=!1),B&&(!($&&V)||F)&&y.push(...X.map(K=>({animation:K,options:{type:E}})))}if(b.size){const N={};b.forEach(E=>{const w=t.getBaseTarget(E),R=t.getValue(E);R&&(R.liveStyle=!0),N[E]=w??null}),y.push({animation:N})}let C=!!y.length;return o&&(g.initial===!1||g.initial===g.animate)&&!t.manuallyAnimateOnMount&&(C=!1),o=!1,C?a(y):Promise.resolve()}function p(m,g){var v;if(i[m].isActive===g)return Promise.resolve();(v=t.variantChildren)===null||v===void 0||v.forEach(b=>{var S;return(S=b.animationState)===null||S===void 0?void 0:S.setActive(m,g)}),i[m].isActive=g;const y=d(m);for(const b in i)i[b].protectedKeys={};return y}return{animateChanges:d,setActive:p,setAnimateFunction:u,getState:()=>i,reset:()=>{i=Hy(),o=!0}}}function Jj(t,a){return typeof a=="string"?a!==t:Array.isArray(a)?!ix(a,t):!1}function Ns(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Hy(){return{animate:Ns(!0),whileInView:Ns(),whileHover:Ns(),whileTap:Ns(),whileDrag:Ns(),whileFocus:Ns(),exit:Ns()}}class os{constructor(a){this.isMounted=!1,this.node=a}update(){}}class ew extends os{constructor(a){super(a),a.animationState||(a.animationState=Wj(a))}updateAnimationControlsSubscription(){const{animate:a}=this.node.getProps();Ac(a)&&(this.unmountControls=a.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:a}=this.node.getProps(),{animate:i}=this.node.prevProps||{};a!==i&&this.updateAnimationControlsSubscription()}unmount(){var a;this.node.animationState.reset(),(a=this.unmountControls)===null||a===void 0||a.call(this)}}let tw=0;class nw extends os{constructor(){super(...arguments),this.id=tw++}update(){if(!this.node.presenceContext)return;const{isPresent:a,onExitComplete:i}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||a===o)return;const r=this.node.animationState.setActive("exit",!a);i&&!a&&r.then(()=>i(this.id))}mount(){const{register:a}=this.node.presenceContext||{};a&&(this.unmount=a(this.id))}unmount(){}}const aw={animation:{Feature:ew},exit:{Feature:nw}},Ln={x:!1,y:!1};function $x(){return Ln.x||Ln.y}function sw(t){return t==="x"||t==="y"?Ln[t]?null:(Ln[t]=!0,()=>{Ln[t]=!1}):Ln.x||Ln.y?null:(Ln.x=Ln.y=!0,()=>{Ln.x=Ln.y=!1})}const Fh=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function bl(t,a,i,o={passive:!0}){return t.addEventListener(a,i,o),()=>t.removeEventListener(a,i)}function El(t){return{point:{x:t.pageX,y:t.pageY}}}const iw=t=>a=>Fh(a)&&t(a,El(a));function rl(t,a,i,o){return bl(t,a,iw(i),o)}const Py=(t,a)=>Math.abs(t-a);function ow(t,a){const i=Py(t.x,a.x),o=Py(t.y,a.y);return Math.sqrt(i**2+o**2)}class Fx{constructor(a,i,{transformPagePoint:o,contextWindow:r,dragSnapToOrigin:u=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=uf(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,S=ow(y.offset,{x:0,y:0})>=3;if(!b&&!S)return;const{point:T}=y,{timestamp:C}=Ut;this.history.push({...T,timestamp:C});const{onStart:N,onMove:E}=this.handlers;b||(N&&N(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,y)},this.handlePointerMove=(y,b)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=cf(b,this.transformPagePoint),lt.update(this.updatePoint,!0)},this.handlePointerUp=(y,b)=>{this.end();const{onEnd:S,onSessionEnd:T,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=uf(y.type==="pointercancel"?this.lastMoveEventInfo:cf(b,this.transformPagePoint),this.history);this.startEvent&&S&&S(y,N),T&&T(y,N)},!Fh(a))return;this.dragSnapToOrigin=u,this.handlers=i,this.transformPagePoint=o,this.contextWindow=r||window;const d=El(a),p=cf(d,this.transformPagePoint),{point:m}=p,{timestamp:g}=Ut;this.history=[{...m,timestamp:g}];const{onSessionStart:v}=i;v&&v(a,uf(p,this.history)),this.removeListeners=Cl(rl(this.contextWindow,"pointermove",this.handlePointerMove),rl(this.contextWindow,"pointerup",this.handlePointerUp),rl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(a){this.handlers=a}end(){this.removeListeners&&this.removeListeners(),ns(this.updatePoint)}}function cf(t,a){return a?{point:a(t.point)}:t}function Gy(t,a){return{x:t.x-a.x,y:t.y-a.y}}function uf({point:t},a){return{point:t,delta:Gy(t,qx(a)),offset:Gy(t,lw(a)),velocity:rw(a,.1)}}function lw(t){return t[0]}function qx(t){return t[t.length-1]}function rw(t,a){if(t.length<2)return{x:0,y:0};let i=t.length-1,o=null;const r=qx(t);for(;i>=0&&(o=t[i],!(r.timestamp-o.timestamp>ya(a)));)i--;if(!o)return{x:0,y:0};const u=ba(r.timestamp-o.timestamp);if(u===0)return{x:0,y:0};const d={x:(r.x-o.x)/u,y:(r.y-o.y)/u};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}const Kx=1e-4,cw=1-Kx,uw=1+Kx,Yx=.01,dw=0-Yx,fw=0+Yx;function hn(t){return t.max-t.min}function hw(t,a,i){return Math.abs(t-a)<=i}function $y(t,a,i,o=.5){t.origin=o,t.originPoint=ut(a.min,a.max,t.origin),t.scale=hn(i)/hn(a),t.translate=ut(i.min,i.max,t.origin)-t.originPoint,(t.scale>=cw&&t.scale<=uw||isNaN(t.scale))&&(t.scale=1),(t.translate>=dw&&t.translate<=fw||isNaN(t.translate))&&(t.translate=0)}function cl(t,a,i,o){$y(t.x,a.x,i.x,o?o.originX:void 0),$y(t.y,a.y,i.y,o?o.originY:void 0)}function Fy(t,a,i){t.min=i.min+a.min,t.max=t.min+hn(a)}function pw(t,a,i){Fy(t.x,a.x,i.x),Fy(t.y,a.y,i.y)}function qy(t,a,i){t.min=a.min-i.min,t.max=t.min+hn(a)}function ul(t,a,i){qy(t.x,a.x,i.x),qy(t.y,a.y,i.y)}function mw(t,{min:a,max:i},o){return a!==void 0&&t<a?t=o?ut(a,t,o.min):Math.max(t,a):i!==void 0&&t>i&&(t=o?ut(i,t,o.max):Math.min(t,i)),t}function Ky(t,a,i){return{min:a!==void 0?t.min+a:void 0,max:i!==void 0?t.max+i-(t.max-t.min):void 0}}function gw(t,{top:a,left:i,bottom:o,right:r}){return{x:Ky(t.x,i,r),y:Ky(t.y,a,o)}}function Yy(t,a){let i=a.min-t.min,o=a.max-t.max;return a.max-a.min<t.max-t.min&&([i,o]=[o,i]),{min:i,max:o}}function vw(t,a){return{x:Yy(t.x,a.x),y:Yy(t.y,a.y)}}function yw(t,a){let i=.5;const o=hn(t),r=hn(a);return r>o?i=Fi(a.min,a.max-o,t.min):o>r&&(i=Fi(t.min,t.max-r,a.min)),Sa(0,1,i)}function bw(t,a){const i={};return a.min!==void 0&&(i.min=a.min-t.min),a.max!==void 0&&(i.max=a.max-t.min),i}const Pf=.35;function xw(t=Pf){return t===!1?t=0:t===!0&&(t=Pf),{x:Zy(t,"left","right"),y:Zy(t,"top","bottom")}}function Zy(t,a,i){return{min:Xy(t,a),max:Xy(t,i)}}function Xy(t,a){return typeof t=="number"?t:t[a]||0}const Qy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Li=()=>({x:Qy(),y:Qy()}),Wy=()=>({min:0,max:0}),vt=()=>({x:Wy(),y:Wy()});function An(t){return[t("x"),t("y")]}function Zx({top:t,left:a,right:i,bottom:o}){return{x:{min:a,max:i},y:{min:t,max:o}}}function _w({x:t,y:a}){return{top:a.min,right:t.max,bottom:a.max,left:t.min}}function Sw(t,a){if(!a)return t;const i=a({x:t.left,y:t.top}),o=a({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:o.y,right:o.x}}function df(t){return t===void 0||t===1}function Gf({scale:t,scaleX:a,scaleY:i}){return!df(t)||!df(a)||!df(i)}function As(t){return Gf(t)||Xx(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Xx(t){return Jy(t.x)||Jy(t.y)}function Jy(t){return t&&t!=="0%"}function vc(t,a,i){const o=t-i,r=a*o;return i+r}function e0(t,a,i,o,r){return r!==void 0&&(t=vc(t,r,o)),vc(t,i,o)+a}function $f(t,a=0,i=1,o,r){t.min=e0(t.min,a,i,o,r),t.max=e0(t.max,a,i,o,r)}function Qx(t,{x:a,y:i}){$f(t.x,a.translate,a.scale,a.originPoint),$f(t.y,i.translate,i.scale,i.originPoint)}const t0=.999999999999,n0=1.0000000000001;function Tw(t,a,i,o=!1){const r=i.length;if(!r)return;a.x=a.y=1;let u,d;for(let p=0;p<r;p++){u=i[p],d=u.projectionDelta;const{visualElement:m}=u.options;m&&m.props.style&&m.props.style.display==="contents"||(o&&u.options.layoutScroll&&u.scroll&&u!==u.root&&zi(t,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),d&&(a.x*=d.x.scale,a.y*=d.y.scale,Qx(t,d)),o&&As(u.latestValues)&&zi(t,u.latestValues))}a.x<n0&&a.x>t0&&(a.x=1),a.y<n0&&a.y>t0&&(a.y=1)}function Ui(t,a){t.min=t.min+a,t.max=t.max+a}function a0(t,a,i,o,r=.5){const u=ut(t.min,t.max,r);$f(t,a,i,u,o)}function zi(t,a){a0(t.x,a.x,a.scaleX,a.scale,a.originX),a0(t.y,a.y,a.scaleY,a.scale,a.originY)}function Wx(t,a){return Zx(Sw(t.getBoundingClientRect(),a))}function kw(t,a,i){const o=Wx(t,i),{scroll:r}=a;return r&&(Ui(o.x,r.offset.x),Ui(o.y,r.offset.y)),o}const Jx=({current:t})=>t?t.ownerDocument.defaultView:null,Cw=new WeakMap;class Ew{constructor(a){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=vt(),this.visualElement=a}start(a,{snapToCursor:i=!1}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const r=v=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),i&&this.snapToCursor(El(v).point)},u=(v,y)=>{const{drag:b,dragPropagation:S,onDragStart:T}=this.getProps();if(b&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=sw(b),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),An(N=>{let E=this.getAxisMotionValue(N).get()||0;if(Zn.test(E)){const{projection:w}=this.visualElement;if(w&&w.layout){const R=w.layout.layoutBox[N];R&&(E=hn(R)*(parseFloat(E)/100))}}this.originPoint[N]=E}),T&&lt.postRender(()=>T(v,y)),Rf(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},d=(v,y)=>{const{dragPropagation:b,dragDirectionLock:S,onDirectionLock:T,onDrag:C}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:N}=y;if(S&&this.currentDirection===null){this.currentDirection=Nw(N),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",y.point,N),this.updateAxis("y",y.point,N),this.visualElement.render(),C&&C(v,y)},p=(v,y)=>this.stop(v,y),m=()=>An(v=>{var y;return this.getAnimationState(v)==="paused"&&((y=this.getAxisMotionValue(v).animation)===null||y===void 0?void 0:y.play())}),{dragSnapToOrigin:g}=this.getProps();this.panSession=new Fx(a,{onSessionStart:r,onStart:u,onMove:d,onSessionEnd:p,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,contextWindow:Jx(this.visualElement)})}stop(a,i){const o=this.isDragging;if(this.cancel(),!o)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:u}=this.getProps();u&&lt.postRender(()=>u(a,i))}cancel(){this.isDragging=!1;const{projection:a,animationState:i}=this.visualElement;a&&(a.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}updateAxis(a,i,o){const{drag:r}=this.getProps();if(!o||!Xr(a,r,this.currentDirection))return;const u=this.getAxisMotionValue(a);let d=this.originPoint[a]+o[a];this.constraints&&this.constraints[a]&&(d=mw(d,this.constraints[a],this.elastic[a])),u.set(d)}resolveConstraints(){var a;const{dragConstraints:i,dragElastic:o}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)===null||a===void 0?void 0:a.layout,u=this.constraints;i&&Bi(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&r?this.constraints=gw(r.layoutBox,i):this.constraints=!1,this.elastic=xw(o),u!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&An(d=>{this.constraints!==!1&&this.getAxisMotionValue(d)&&(this.constraints[d]=bw(r.layoutBox[d],this.constraints[d]))})}resolveRefConstraints(){const{dragConstraints:a,onMeasureDragConstraints:i}=this.getProps();if(!a||!Bi(a))return!1;const o=a.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const u=kw(o,r.root,this.visualElement.getTransformPagePoint());let d=vw(r.layout.layoutBox,u);if(i){const p=i(_w(d));this.hasMutatedConstraints=!!p,p&&(d=Zx(p))}return d}startAnimation(a){const{drag:i,dragMomentum:o,dragElastic:r,dragTransition:u,dragSnapToOrigin:d,onDragTransitionEnd:p}=this.getProps(),m=this.constraints||{},g=An(v=>{if(!Xr(v,i,this.currentDirection))return;let y=m&&m[v]||{};d&&(y={min:0,max:0});const b=r?200:1e6,S=r?40:1e7,T={type:"inertia",velocity:o?a[v]:0,bounceStiffness:b,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...u,...y};return this.startAxisValueAnimation(v,T)});return Promise.all(g).then(p)}startAxisValueAnimation(a,i){const o=this.getAxisMotionValue(a);return Rf(this.visualElement,a),o.start($h(a,o,0,i,this.visualElement,!1))}stopAnimation(){An(a=>this.getAxisMotionValue(a).stop())}pauseAnimation(){An(a=>{var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.pause()})}getAnimationState(a){var i;return(i=this.getAxisMotionValue(a).animation)===null||i===void 0?void 0:i.state}getAxisMotionValue(a){const i=`_drag${a.toUpperCase()}`,o=this.visualElement.getProps(),r=o[i];return r||this.visualElement.getValue(a,(o.initial?o.initial[a]:void 0)||0)}snapToCursor(a){An(i=>{const{drag:o}=this.getProps();if(!Xr(i,o,this.currentDirection))return;const{projection:r}=this.visualElement,u=this.getAxisMotionValue(i);if(r&&r.layout){const{min:d,max:p}=r.layout.layoutBox[i];u.set(a[i]-ut(d,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:a,dragConstraints:i}=this.getProps(),{projection:o}=this.visualElement;if(!Bi(i)||!o||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};An(d=>{const p=this.getAxisMotionValue(d);if(p&&this.constraints!==!1){const m=p.get();r[d]=yw({min:m,max:m},this.constraints[d])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),An(d=>{if(!Xr(d,a,null))return;const p=this.getAxisMotionValue(d),{min:m,max:g}=this.constraints[d];p.set(ut(m,g,r[d]))})}addListeners(){if(!this.visualElement.current)return;Cw.set(this.visualElement,this);const a=this.visualElement.current,i=rl(a,"pointerdown",m=>{const{drag:g,dragListener:v=!0}=this.getProps();g&&v&&this.start(m)}),o=()=>{const{dragConstraints:m}=this.getProps();Bi(m)&&m.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,u=r.addEventListener("measure",o);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),lt.read(o);const d=bl(window,"resize",()=>this.scalePositionWithinConstraints()),p=r.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(An(v=>{const y=this.getAxisMotionValue(v);y&&(this.originPoint[v]+=m[v].translate,y.set(y.get()+m[v].translate))}),this.visualElement.render())}));return()=>{d(),i(),u(),p&&p()}}getProps(){const a=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:o=!1,dragPropagation:r=!1,dragConstraints:u=!1,dragElastic:d=Pf,dragMomentum:p=!0}=a;return{...a,drag:i,dragDirectionLock:o,dragPropagation:r,dragConstraints:u,dragElastic:d,dragMomentum:p}}}function Xr(t,a,i){return(a===!0||a===t)&&(i===null||i===t)}function Nw(t,a=10){let i=null;return Math.abs(t.y)>a?i="y":Math.abs(t.x)>a&&(i="x"),i}class jw extends os{constructor(a){super(a),this.removeGroupControls=fn,this.removeListeners=fn,this.controls=new Ew(a)}mount(){const{dragControls:a}=this.node.getProps();a&&(this.removeGroupControls=a.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fn}unmount(){this.removeGroupControls(),this.removeListeners()}}const s0=t=>(a,i)=>{t&&lt.postRender(()=>t(a,i))};class ww extends os{constructor(){super(...arguments),this.removePointerDownListener=fn}onPointerDown(a){this.session=new Fx(a,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Jx(this.node)})}createPanHandlers(){const{onPanSessionStart:a,onPanStart:i,onPan:o,onPanEnd:r}=this.node.getProps();return{onSessionStart:s0(a),onStart:s0(i),onMove:o,onEnd:(u,d)=>{delete this.session,r&&lt.postRender(()=>r(u,d))}}}mount(){this.removePointerDownListener=rl(this.node.current,"pointerdown",a=>this.onPointerDown(a))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const lc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function i0(t,a){return a.max===a.min?0:t/(a.max-a.min)*100}const Xo={correct:(t,a)=>{if(!a.target)return t;if(typeof t=="string")if(be.test(t))t=parseFloat(t);else return t;const i=i0(t,a.target.x),o=i0(t,a.target.y);return`${i}% ${o}%`}},Aw={correct:(t,{treeScale:a,projectionDelta:i})=>{const o=t,r=as.parse(t);if(r.length>5)return o;const u=as.createTransformer(t),d=typeof r[0]!="number"?1:0,p=i.x.scale*a.x,m=i.y.scale*a.y;r[0+d]/=p,r[1+d]/=m;const g=ut(p,m,.5);return typeof r[2+d]=="number"&&(r[2+d]/=g),typeof r[3+d]=="number"&&(r[3+d]/=g),u(r)}};class Dw extends x.Component{componentDidMount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o,layoutId:r}=this.props,{projection:u}=a;aN(Rw),u&&(i.group&&i.group.add(u),o&&o.register&&r&&o.register(u),u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),lc.hasEverUpdated=!0}getSnapshotBeforeUpdate(a){const{layoutDependency:i,visualElement:o,drag:r,isPresent:u}=this.props,d=o.projection;return d&&(d.isPresent=u,r||a.layoutDependency!==i||i===void 0?d.willUpdate():this.safeToRemove(),a.isPresent!==u&&(u?d.promote():d.relegate()||lt.postRender(()=>{const p=d.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:a}=this.props.visualElement;a&&(a.root.didUpdate(),bh.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:a,layoutGroup:i,switchLayoutGroup:o}=this.props,{projection:r}=a;r&&(r.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(r),o&&o.deregister&&o.deregister(r))}safeToRemove(){const{safeToRemove:a}=this.props;a&&a()}render(){return null}}function e_(t){const[a,i]=Ub(),o=x.useContext(fh);return c.jsx(Dw,{...t,layoutGroup:o,switchLayoutGroup:x.useContext(qb),isPresent:a,safeToRemove:i})}const Rw={borderRadius:{...Xo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Xo,borderTopRightRadius:Xo,borderBottomLeftRadius:Xo,borderBottomRightRadius:Xo,boxShadow:Aw};function Mw(t,a,i){const o=Pt(t)?t:vl(t);return o.start($h("",o,a,i)),o.animation}function Ow(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Bw=(t,a)=>t.depth-a.depth;class Iw{constructor(){this.children=[],this.isDirty=!1}add(a){Ah(this.children,a),this.isDirty=!0}remove(a){Dh(this.children,a),this.isDirty=!0}forEach(a){this.isDirty&&this.children.sort(Bw),this.isDirty=!1,this.children.forEach(a)}}function Lw(t,a){const i=Xn.now(),o=({timestamp:r})=>{const u=r-i;u>=a&&(ns(o),t(u-a))};return lt.read(o,!0),()=>ns(o)}const t_=["TopLeft","TopRight","BottomLeft","BottomRight"],Uw=t_.length,o0=t=>typeof t=="string"?parseFloat(t):t,l0=t=>typeof t=="number"||be.test(t);function zw(t,a,i,o,r,u){r?(t.opacity=ut(0,i.opacity!==void 0?i.opacity:1,Vw(o)),t.opacityExit=ut(a.opacity!==void 0?a.opacity:1,0,Hw(o))):u&&(t.opacity=ut(a.opacity!==void 0?a.opacity:1,i.opacity!==void 0?i.opacity:1,o));for(let d=0;d<Uw;d++){const p=`border${t_[d]}Radius`;let m=r0(a,p),g=r0(i,p);if(m===void 0&&g===void 0)continue;m||(m=0),g||(g=0),m===0||g===0||l0(m)===l0(g)?(t[p]=Math.max(ut(o0(m),o0(g),o),0),(Zn.test(g)||Zn.test(m))&&(t[p]+="%")):t[p]=g}(a.rotate||i.rotate)&&(t.rotate=ut(a.rotate||0,i.rotate||0,o))}function r0(t,a){return t[a]!==void 0?t[a]:t.borderRadius}const Vw=n_(0,.5,yx),Hw=n_(.5,.95,fn);function n_(t,a,i){return o=>o<t?0:o>a?1:i(Fi(t,a,o))}function c0(t,a){t.min=a.min,t.max=a.max}function jn(t,a){c0(t.x,a.x),c0(t.y,a.y)}function u0(t,a){t.translate=a.translate,t.scale=a.scale,t.originPoint=a.originPoint,t.origin=a.origin}function d0(t,a,i,o,r){return t-=a,t=vc(t,1/i,o),r!==void 0&&(t=vc(t,1/r,o)),t}function Pw(t,a=0,i=1,o=.5,r,u=t,d=t){if(Zn.test(a)&&(a=parseFloat(a),a=ut(d.min,d.max,a/100)-d.min),typeof a!="number")return;let p=ut(u.min,u.max,o);t===u&&(p-=a),t.min=d0(t.min,a,i,p,r),t.max=d0(t.max,a,i,p,r)}function f0(t,a,[i,o,r],u,d){Pw(t,a[i],a[o],a[r],a.scale,u,d)}const Gw=["x","scaleX","originX"],$w=["y","scaleY","originY"];function h0(t,a,i,o){f0(t.x,a,Gw,i?i.x:void 0,o?o.x:void 0),f0(t.y,a,$w,i?i.y:void 0,o?o.y:void 0)}function p0(t){return t.translate===0&&t.scale===1}function a_(t){return p0(t.x)&&p0(t.y)}function m0(t,a){return t.min===a.min&&t.max===a.max}function Fw(t,a){return m0(t.x,a.x)&&m0(t.y,a.y)}function g0(t,a){return Math.round(t.min)===Math.round(a.min)&&Math.round(t.max)===Math.round(a.max)}function s_(t,a){return g0(t.x,a.x)&&g0(t.y,a.y)}function v0(t){return hn(t.x)/hn(t.y)}function y0(t,a){return t.translate===a.translate&&t.scale===a.scale&&t.originPoint===a.originPoint}class qw{constructor(){this.members=[]}add(a){Ah(this.members,a),a.scheduleRender()}remove(a){if(Dh(this.members,a),a===this.prevLead&&(this.prevLead=void 0),a===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(a){const i=this.members.findIndex(r=>a===r);if(i===0)return!1;let o;for(let r=i;r>=0;r--){const u=this.members[r];if(u.isPresent!==!1){o=u;break}}return o?(this.promote(o),!0):!1}promote(a,i){const o=this.lead;if(a!==o&&(this.prevLead=o,this.lead=a,a.show(),o)){o.instance&&o.scheduleRender(),a.scheduleRender(),a.resumeFrom=o,i&&(a.resumeFrom.preserveOpacity=!0),o.snapshot&&(a.snapshot=o.snapshot,a.snapshot.latestValues=o.animationValues||o.latestValues),a.root&&a.root.isUpdating&&(a.isLayoutDirty=!0);const{crossfade:r}=a.options;r===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(a=>{const{options:i,resumingFrom:o}=a;i.onExitComplete&&i.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(a=>{a.instance&&a.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Kw(t,a,i){let o="";const r=t.x.translate/a.x,u=t.y.translate/a.y,d=(i==null?void 0:i.z)||0;if((r||u||d)&&(o=`translate3d(${r}px, ${u}px, ${d}px) `),(a.x!==1||a.y!==1)&&(o+=`scale(${1/a.x}, ${1/a.y}) `),i){const{transformPerspective:g,rotate:v,rotateX:y,rotateY:b,skewX:S,skewY:T}=i;g&&(o=`perspective(${g}px) ${o}`),v&&(o+=`rotate(${v}deg) `),y&&(o+=`rotateX(${y}deg) `),b&&(o+=`rotateY(${b}deg) `),S&&(o+=`skewX(${S}deg) `),T&&(o+=`skewY(${T}deg) `)}const p=t.x.scale*a.x,m=t.y.scale*a.y;return(p!==1||m!==1)&&(o+=`scale(${p}, ${m})`),o||"none"}const Ds={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},tl=typeof window<"u"&&window.MotionDebug!==void 0,ff=["","X","Y","Z"],Yw={visibility:"hidden"},b0=1e3;let Zw=0;function hf(t,a,i,o){const{latestValues:r}=a;r[t]&&(i[t]=r[t],a.setStaticValue(t,0),o&&(o[t]=0))}function i_(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:a}=t.options;if(!a)return;const i=rx(a);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:r,layoutId:u}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",lt,!(r||u))}const{parent:o}=t;o&&!o.hasCheckedOptimisedAppear&&i_(o)}function o_({attachResizeListener:t,defaultParent:a,measureScroll:i,checkIsScrollRoot:o,resetTransform:r}){return class{constructor(d={},p=a==null?void 0:a()){this.id=Zw++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,tl&&(Ds.totalNodes=Ds.resolvedTargetDeltas=Ds.recalculatedProjection=0),this.nodes.forEach(Ww),this.nodes.forEach(aA),this.nodes.forEach(sA),this.nodes.forEach(Jw),tl&&window.MotionDebug.record(Ds)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=d,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new Iw)}addEventListener(d,p){return this.eventHandlers.has(d)||this.eventHandlers.set(d,new Rh),this.eventHandlers.get(d).add(p)}notifyListeners(d,...p){const m=this.eventHandlers.get(d);m&&m.notify(...p)}hasListeners(d){return this.eventHandlers.has(d)}mount(d,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Ow(d),this.instance=d;const{layoutId:m,layout:g,visualElement:v}=this.options;if(v&&!v.current&&v.mount(d),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(g||m)&&(this.isLayoutDirty=!0),t){let y;const b=()=>this.root.updateBlockedByResize=!1;t(d,()=>{this.root.updateBlockedByResize=!0,y&&y(),y=Lw(b,250),lc.hasAnimatedSinceResize&&(lc.hasAnimatedSinceResize=!1,this.nodes.forEach(_0))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&v&&(m||g)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:b,hasRelativeTargetChanged:S,layout:T})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const C=this.options.transition||v.getDefaultTransition()||cA,{onLayoutAnimationStart:N,onLayoutAnimationComplete:E}=v.getProps(),w=!this.targetLayout||!s_(this.targetLayout,T)||S,R=!b&&S;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||R||b&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(y,R);const M={...wh(C,"layout"),onPlay:N,onComplete:E};(v.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M)}else b||_0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=T})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const d=this.getStack();d&&d.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ns(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(iA),this.animationId++)}getTransformTemplate(){const{visualElement:d}=this.options;return d&&d.getProps().transformTemplate}willUpdate(d=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&i_(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let v=0;v<this.path.length;v++){const y=this.path[v];y.shouldResetTransform=!0,y.updateScroll("snapshot"),y.options.layoutRoot&&y.willUpdate(!1)}const{layoutId:p,layout:m}=this.options;if(p===void 0&&!m)return;const g=this.getTransformTemplate();this.prevTransformTemplateValue=g?g(this.latestValues,""):void 0,this.updateSnapshot(),d&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(x0);return}this.isUpdating||this.nodes.forEach(tA),this.isUpdating=!1,this.nodes.forEach(nA),this.nodes.forEach(Xw),this.nodes.forEach(Qw),this.clearAllSnapshots();const p=Xn.now();Ut.delta=Sa(0,1e3/60,p-Ut.timestamp),Ut.timestamp=p,Ut.isProcessing=!0,af.update.process(Ut),af.preRender.process(Ut),af.render.process(Ut),Ut.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,bh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(eA),this.sharedNodes.forEach(oA)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,lt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){lt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const d=this.layout;this.layout=this.measure(!1),this.layoutCorrected=vt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,d?d.layoutBox:void 0)}updateScroll(d="measure"){let p=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===d&&(p=!1),p){const m=o(this.instance);this.scroll={animationId:this.root.animationId,phase:d,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!r)return;const d=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,p=this.projectionDelta&&!a_(this.projectionDelta),m=this.getTransformTemplate(),g=m?m(this.latestValues,""):void 0,v=g!==this.prevTransformTemplateValue;d&&(p||As(this.latestValues)||v)&&(r(this.instance,g),this.shouldResetTransform=!1,this.scheduleRender())}measure(d=!0){const p=this.measurePageBox();let m=this.removeElementScroll(p);return d&&(m=this.removeTransform(m)),uA(m),{animationId:this.root.animationId,measuredBox:p,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:p}=this.options;if(!p)return vt();const m=p.measureViewportBox();if(!(((d=this.scroll)===null||d===void 0?void 0:d.wasRoot)||this.path.some(dA))){const{scroll:v}=this.root;v&&(Ui(m.x,v.offset.x),Ui(m.y,v.offset.y))}return m}removeElementScroll(d){var p;const m=vt();if(jn(m,d),!((p=this.scroll)===null||p===void 0)&&p.wasRoot)return m;for(let g=0;g<this.path.length;g++){const v=this.path[g],{scroll:y,options:b}=v;v!==this.root&&y&&b.layoutScroll&&(y.wasRoot&&jn(m,d),Ui(m.x,y.offset.x),Ui(m.y,y.offset.y))}return m}applyTransform(d,p=!1){const m=vt();jn(m,d);for(let g=0;g<this.path.length;g++){const v=this.path[g];!p&&v.options.layoutScroll&&v.scroll&&v!==v.root&&zi(m,{x:-v.scroll.offset.x,y:-v.scroll.offset.y}),As(v.latestValues)&&zi(m,v.latestValues)}return As(this.latestValues)&&zi(m,this.latestValues),m}removeTransform(d){const p=vt();jn(p,d);for(let m=0;m<this.path.length;m++){const g=this.path[m];if(!g.instance||!As(g.latestValues))continue;Gf(g.latestValues)&&g.updateSnapshot();const v=vt(),y=g.measurePageBox();jn(v,y),h0(p,g.latestValues,g.snapshot?g.snapshot.layoutBox:void 0,v)}return As(this.latestValues)&&h0(p,this.latestValues),p}setTargetDelta(d){this.targetDelta=d,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(d){this.options={...this.options,...d,crossfade:d.crossfade!==void 0?d.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ut.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(d=!1){var p;const m=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=m.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=m.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=m.isSharedProjectionDirty);const g=!!this.resumingFrom||this!==m;if(!(d||g&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:b}=this.options;if(!(!this.layout||!(y||b))){if(this.resolvedRelativeTargetAt=Ut.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=vt(),this.relativeTargetOrigin=vt(),ul(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),jn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=vt(),this.targetWithTransforms=vt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),pw(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):jn(this.target,this.layout.layoutBox),Qx(this.target,this.targetDelta)):jn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const S=this.getClosestProjectingParent();S&&!!S.resumingFrom==!!this.resumingFrom&&!S.options.layoutScroll&&S.target&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=vt(),this.relativeTargetOrigin=vt(),ul(this.relativeTargetOrigin,this.target,S.target),jn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}tl&&Ds.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Gf(this.parent.latestValues)||Xx(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var d;const p=this.getLead(),m=!!this.resumingFrom||this!==p;let g=!0;if((this.isProjectionDirty||!((d=this.parent)===null||d===void 0)&&d.isProjectionDirty)&&(g=!1),m&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(g=!1),this.resolvedRelativeTargetAt===Ut.timestamp&&(g=!1),g)return;const{layout:v,layoutId:y}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(v||y))return;jn(this.layoutCorrected,this.layout.layoutBox);const b=this.treeScale.x,S=this.treeScale.y;Tw(this.layoutCorrected,this.treeScale,this.path,m),p.layout&&!p.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(p.target=p.layout.layoutBox,p.targetWithTransforms=vt());const{target:T}=p;if(!T){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(u0(this.prevProjectionDelta.x,this.projectionDelta.x),u0(this.prevProjectionDelta.y,this.projectionDelta.y)),cl(this.projectionDelta,this.layoutCorrected,T,this.latestValues),(this.treeScale.x!==b||this.treeScale.y!==S||!y0(this.projectionDelta.x,this.prevProjectionDelta.x)||!y0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",T)),tl&&Ds.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(d=!0){var p;if((p=this.options.visualElement)===null||p===void 0||p.scheduleRender(),d){const m=this.getStack();m&&m.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Li(),this.projectionDelta=Li(),this.projectionDeltaWithTransform=Li()}setAnimationOrigin(d,p=!1){const m=this.snapshot,g=m?m.latestValues:{},v={...this.latestValues},y=Li();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const b=vt(),S=m?m.source:void 0,T=this.layout?this.layout.source:void 0,C=S!==T,N=this.getStack(),E=!N||N.members.length<=1,w=!!(C&&!E&&this.options.crossfade===!0&&!this.path.some(rA));this.animationProgress=0;let R;this.mixTargetDelta=M=>{const A=M/1e3;S0(y.x,d.x,A),S0(y.y,d.y,A),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ul(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),lA(this.relativeTarget,this.relativeTargetOrigin,b,A),R&&Fw(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=vt()),jn(R,this.relativeTarget)),C&&(this.animationValues=v,zw(v,g,this.latestValues,A,w,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(d){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ns(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=lt.update(()=>{lc.hasAnimatedSinceResize=!0,this.currentAnimation=Mw(0,b0,{...d,onUpdate:p=>{this.mixTargetDelta(p),d.onUpdate&&d.onUpdate(p)},onComplete:()=>{d.onComplete&&d.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const d=this.getStack();d&&d.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(b0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const d=this.getLead();let{targetWithTransforms:p,target:m,layout:g,latestValues:v}=d;if(!(!p||!m||!g)){if(this!==d&&this.layout&&g&&l_(this.options.animationType,this.layout.layoutBox,g.layoutBox)){m=this.target||vt();const y=hn(this.layout.layoutBox.x);m.x.min=d.target.x.min,m.x.max=m.x.min+y;const b=hn(this.layout.layoutBox.y);m.y.min=d.target.y.min,m.y.max=m.y.min+b}jn(p,m),zi(p,v),cl(this.projectionDeltaWithTransform,this.layoutCorrected,p,v)}}registerSharedNode(d,p){this.sharedNodes.has(d)||this.sharedNodes.set(d,new qw),this.sharedNodes.get(d).add(p);const g=p.options.initialPromotionConfig;p.promote({transition:g?g.transition:void 0,preserveFollowOpacity:g&&g.shouldPreserveFollowOpacity?g.shouldPreserveFollowOpacity(p):void 0})}isLead(){const d=this.getStack();return d?d.lead===this:!0}getLead(){var d;const{layoutId:p}=this.options;return p?((d=this.getStack())===null||d===void 0?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:p}=this.options;return p?(d=this.getStack())===null||d===void 0?void 0:d.prevLead:void 0}getStack(){const{layoutId:d}=this.options;if(d)return this.root.sharedNodes.get(d)}promote({needsReset:d,transition:p,preserveFollowOpacity:m}={}){const g=this.getStack();g&&g.promote(this,m),d&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const d=this.getStack();return d?d.relegate(this):!1}resetSkewAndRotation(){const{visualElement:d}=this.options;if(!d)return;let p=!1;const{latestValues:m}=d;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(p=!0),!p)return;const g={};m.z&&hf("z",d,g,this.animationValues);for(let v=0;v<ff.length;v++)hf(`rotate${ff[v]}`,d,g,this.animationValues),hf(`skew${ff[v]}`,d,g,this.animationValues);d.render();for(const v in g)d.setStaticValue(v,g[v]),this.animationValues&&(this.animationValues[v]=g[v]);d.scheduleRender()}getProjectionStyles(d){var p,m;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Yw;const g={visibility:""},v=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,g.opacity="",g.pointerEvents=ic(d==null?void 0:d.pointerEvents)||"",g.transform=v?v(this.latestValues,""):"none",g;const y=this.getLead();if(!this.projectionDelta||!this.layout||!y.target){const C={};return this.options.layoutId&&(C.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,C.pointerEvents=ic(d==null?void 0:d.pointerEvents)||""),this.hasProjected&&!As(this.latestValues)&&(C.transform=v?v({},""):"none",this.hasProjected=!1),C}const b=y.animationValues||y.latestValues;this.applyTransformsToTarget(),g.transform=Kw(this.projectionDeltaWithTransform,this.treeScale,b),v&&(g.transform=v(b,g.transform));const{x:S,y:T}=this.projectionDelta;g.transformOrigin=`${S.origin*100}% ${T.origin*100}% 0`,y.animationValues?g.opacity=y===this?(m=(p=b.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&m!==void 0?m:1:this.preserveOpacity?this.latestValues.opacity:b.opacityExit:g.opacity=y===this?b.opacity!==void 0?b.opacity:"":b.opacityExit!==void 0?b.opacityExit:0;for(const C in fc){if(b[C]===void 0)continue;const{correct:N,applyTo:E}=fc[C],w=g.transform==="none"?b[C]:N(b[C],y);if(E){const R=E.length;for(let M=0;M<R;M++)g[E[M]]=w}else g[C]=w}return this.options.layoutId&&(g.pointerEvents=y===this?ic(d==null?void 0:d.pointerEvents)||"":"none"),g}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(d=>{var p;return(p=d.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(x0),this.root.sharedNodes.clear()}}}function Xw(t){t.updateLayout()}function Qw(t){var a;const i=((a=t.resumeFrom)===null||a===void 0?void 0:a.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:r}=t.layout,{animationType:u}=t.options,d=i.source!==t.layout.source;u==="size"?An(y=>{const b=d?i.measuredBox[y]:i.layoutBox[y],S=hn(b);b.min=o[y].min,b.max=b.min+S}):l_(u,i.layoutBox,o)&&An(y=>{const b=d?i.measuredBox[y]:i.layoutBox[y],S=hn(o[y]);b.max=b.min+S,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[y].max=t.relativeTarget[y].min+S)});const p=Li();cl(p,o,i.layoutBox);const m=Li();d?cl(m,t.applyTransform(r,!0),i.measuredBox):cl(m,o,i.layoutBox);const g=!a_(p);let v=!1;if(!t.resumeFrom){const y=t.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:b,layout:S}=y;if(b&&S){const T=vt();ul(T,i.layoutBox,b.layoutBox);const C=vt();ul(C,o,S.layoutBox),s_(T,C)||(v=!0),y.options.layoutRoot&&(t.relativeTarget=C,t.relativeTargetOrigin=T,t.relativeParent=y)}}}t.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:m,layoutDelta:p,hasLayoutChanged:g,hasRelativeTargetChanged:v})}else if(t.isLead()){const{onExitComplete:o}=t.options;o&&o()}t.options.transition=void 0}function Ww(t){tl&&Ds.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Jw(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function eA(t){t.clearSnapshot()}function x0(t){t.clearMeasurements()}function tA(t){t.isLayoutDirty=!1}function nA(t){const{visualElement:a}=t.options;a&&a.getProps().onBeforeLayoutMeasure&&a.notify("BeforeLayoutMeasure"),t.resetTransform()}function _0(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function aA(t){t.resolveTargetDelta()}function sA(t){t.calcProjection()}function iA(t){t.resetSkewAndRotation()}function oA(t){t.removeLeadSnapshot()}function S0(t,a,i){t.translate=ut(a.translate,0,i),t.scale=ut(a.scale,1,i),t.origin=a.origin,t.originPoint=a.originPoint}function T0(t,a,i,o){t.min=ut(a.min,i.min,o),t.max=ut(a.max,i.max,o)}function lA(t,a,i,o){T0(t.x,a.x,i.x,o),T0(t.y,a.y,i.y,o)}function rA(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const cA={duration:.45,ease:[.4,0,.1,1]},k0=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),C0=k0("applewebkit/")&&!k0("chrome/")?Math.round:fn;function E0(t){t.min=C0(t.min),t.max=C0(t.max)}function uA(t){E0(t.x),E0(t.y)}function l_(t,a,i){return t==="position"||t==="preserve-aspect"&&!hw(v0(a),v0(i),.2)}function dA(t){var a;return t!==t.root&&((a=t.scroll)===null||a===void 0?void 0:a.wasRoot)}const fA=o_({attachResizeListener:(t,a)=>bl(t,"resize",a),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),pf={current:void 0},r_=o_({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!pf.current){const t=new fA({});t.mount(window),t.setOptions({layoutScroll:!0}),pf.current=t}return pf.current},resetTransform:(t,a)=>{t.style.transform=a!==void 0?a:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),hA={pan:{Feature:ww},drag:{Feature:jw,ProjectionNode:r_,MeasureLayout:e_}};function pA(t,a,i){var o;if(t instanceof Element)return[t];if(typeof t=="string"){let r=document;const u=(o=void 0)!==null&&o!==void 0?o:r.querySelectorAll(t);return u?Array.from(u):[]}return Array.from(t)}function c_(t,a){const i=pA(t),o=new AbortController,r={passive:!0,...a,signal:o.signal};return[i,r,()=>o.abort()]}function N0(t){return a=>{a.pointerType==="touch"||$x()||t(a)}}function mA(t,a,i={}){const[o,r,u]=c_(t,i),d=N0(p=>{const{target:m}=p,g=a(p);if(typeof g!="function"||!m)return;const v=N0(y=>{g(y),m.removeEventListener("pointerleave",v)});m.addEventListener("pointerleave",v,r)});return o.forEach(p=>{p.addEventListener("pointerenter",d,r)}),u}function j0(t,a,i){const{props:o}=t;t.animationState&&o.whileHover&&t.animationState.setActive("whileHover",i==="Start");const r="onHover"+i,u=o[r];u&&lt.postRender(()=>u(a,El(a)))}class gA extends os{mount(){const{current:a}=this.node;a&&(this.unmount=mA(a,i=>(j0(this.node,i,"Start"),o=>j0(this.node,o,"End"))))}unmount(){}}class vA extends os{constructor(){super(...arguments),this.isActive=!1}onFocus(){let a=!1;try{a=this.node.current.matches(":focus-visible")}catch{a=!0}!a||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Cl(bl(this.node.current,"focus",()=>this.onFocus()),bl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const u_=(t,a)=>a?t===a?!0:u_(t,a.parentElement):!1,yA=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function bA(t){return yA.has(t.tagName)||t.tabIndex!==-1}const nl=new WeakSet;function w0(t){return a=>{a.key==="Enter"&&t(a)}}function mf(t,a){t.dispatchEvent(new PointerEvent("pointer"+a,{isPrimary:!0,bubbles:!0}))}const xA=(t,a)=>{const i=t.currentTarget;if(!i)return;const o=w0(()=>{if(nl.has(i))return;mf(i,"down");const r=w0(()=>{mf(i,"up")}),u=()=>mf(i,"cancel");i.addEventListener("keyup",r,a),i.addEventListener("blur",u,a)});i.addEventListener("keydown",o,a),i.addEventListener("blur",()=>i.removeEventListener("keydown",o),a)};function A0(t){return Fh(t)&&!$x()}function _A(t,a,i={}){const[o,r,u]=c_(t,i),d=p=>{const m=p.currentTarget;if(!A0(p)||nl.has(m))return;nl.add(m);const g=a(p),v=(S,T)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",b),!(!A0(S)||!nl.has(m))&&(nl.delete(m),typeof g=="function"&&g(S,{success:T}))},y=S=>{v(S,i.useGlobalTarget||u_(m,S.target))},b=S=>{v(S,!1)};window.addEventListener("pointerup",y,r),window.addEventListener("pointercancel",b,r)};return o.forEach(p=>{!bA(p)&&p.getAttribute("tabindex")===null&&(p.tabIndex=0),(i.useGlobalTarget?window:p).addEventListener("pointerdown",d,r),p.addEventListener("focus",g=>xA(g,r),r)}),u}function D0(t,a,i){const{props:o}=t;t.animationState&&o.whileTap&&t.animationState.setActive("whileTap",i==="Start");const r="onTap"+(i==="End"?"":i),u=o[r];u&&lt.postRender(()=>u(a,El(a)))}class SA extends os{mount(){const{current:a}=this.node;a&&(this.unmount=_A(a,i=>(D0(this.node,i,"Start"),(o,{success:r})=>D0(this.node,o,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ff=new WeakMap,gf=new WeakMap,TA=t=>{const a=Ff.get(t.target);a&&a(t)},kA=t=>{t.forEach(TA)};function CA({root:t,...a}){const i=t||document;gf.has(i)||gf.set(i,{});const o=gf.get(i),r=JSON.stringify(a);return o[r]||(o[r]=new IntersectionObserver(kA,{root:t,...a})),o[r]}function EA(t,a,i){const o=CA(a);return Ff.set(t,i),o.observe(t),()=>{Ff.delete(t),o.unobserve(t)}}const NA={some:0,all:1};class jA extends os{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:a={}}=this.node.getProps(),{root:i,margin:o,amount:r="some",once:u}=a,d={root:i?i.current:void 0,rootMargin:o,threshold:typeof r=="number"?r:NA[r]},p=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,u&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:v,onViewportLeave:y}=this.node.getProps(),b=g?v:y;b&&b(m)};return EA(this.node.current,d,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:a,prevProps:i}=this.node;["amount","margin","root"].some(wA(a,i))&&this.startObserver()}unmount(){}}function wA({viewport:t={}},{viewport:a={}}={}){return i=>t[i]!==a[i]}const AA={inView:{Feature:jA},tap:{Feature:SA},focus:{Feature:vA},hover:{Feature:gA}},DA={layout:{ProjectionNode:r_,MeasureLayout:e_}},yc={current:null},qh={current:!1};function d_(){if(qh.current=!0,!!mh)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),a=()=>yc.current=t.matches;t.addListener(a),a()}else yc.current=!1}const RA=[...Rx,Ht,as],MA=t=>RA.find(Dx(t)),R0=new WeakMap;function OA(t,a,i){for(const o in a){const r=a[o],u=i[o];if(Pt(r))t.addValue(o,r);else if(Pt(u))t.addValue(o,vl(r,{owner:t}));else if(u!==r)if(t.hasValue(o)){const d=t.getValue(o);d.liveStyle===!0?d.jump(r):d.hasAnimated||d.set(r)}else{const d=t.getStaticValue(o);t.addValue(o,vl(d!==void 0?d:r,{owner:t}))}}for(const o in i)a[o]===void 0&&t.removeValue(o);return a}const M0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class BA{scrapeMotionValuesFromProps(a,i,o){return{}}constructor({parent:a,props:i,presenceContext:o,reducedMotionConfig:r,blockInitialAnimation:u,visualState:d},p={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Hh,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const S=Xn.now();this.renderScheduledAt<S&&(this.renderScheduledAt=S,lt.render(this.render,!1,!0))};const{latestValues:m,renderState:g,onUpdate:v}=d;this.onUpdate=v,this.latestValues=m,this.baseTarget={...m},this.initialValues=i.initial?{...m}:{},this.renderState=g,this.parent=a,this.props=i,this.presenceContext=o,this.depth=a?a.depth+1:0,this.reducedMotionConfig=r,this.options=p,this.blockInitialAnimation=!!u,this.isControllingVariants=Dc(i),this.isVariantNode=$b(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(a&&a.current);const{willChange:y,...b}=this.scrapeMotionValuesFromProps(i,{},this);for(const S in b){const T=b[S];m[S]!==void 0&&Pt(T)&&T.set(m[S],!1)}}mount(a){this.current=a,R0.set(a,this),this.projection&&!this.projection.instance&&this.projection.mount(a),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,o)=>this.bindToMotionValue(o,i)),qh.current||d_(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:yc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){R0.delete(this.current),this.projection&&this.projection.unmount(),ns(this.notifyUpdate),ns(this.render),this.valueSubscriptions.forEach(a=>a()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const a in this.events)this.events[a].clear();for(const a in this.features){const i=this.features[a];i&&(i.unmount(),i.isMounted=!1)}this.current=null}bindToMotionValue(a,i){this.valueSubscriptions.has(a)&&this.valueSubscriptions.get(a)();const o=Vs.has(a),r=i.on("change",p=>{this.latestValues[a]=p,this.props.onUpdate&&lt.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0)}),u=i.on("renderRequest",this.scheduleRender);let d;window.MotionCheckAppearSync&&(d=window.MotionCheckAppearSync(this,a,i)),this.valueSubscriptions.set(a,()=>{r(),u(),d&&d(),i.owner&&i.stop()})}sortNodePosition(a){return!this.current||!this.sortInstanceNodePosition||this.type!==a.type?0:this.sortInstanceNodePosition(this.current,a.current)}updateFeatures(){let a="animation";for(a in $i){const i=$i[a];if(!i)continue;const{isEnabled:o,Feature:r}=i;if(!this.features[a]&&r&&o(this.props)&&(this.features[a]=new r(this)),this.features[a]){const u=this.features[a];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):vt()}getStaticValue(a){return this.latestValues[a]}setStaticValue(a,i){this.latestValues[a]=i}update(a,i){(a.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=a,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let o=0;o<M0.length;o++){const r=M0[o];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const u="on"+r,d=a[u];d&&(this.propEventSubscriptions[r]=this.on(r,d))}this.prevMotionValues=OA(this,this.scrapeMotionValuesFromProps(a,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(a){return this.props.variants?this.props.variants[a]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(a){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(a),()=>i.variantChildren.delete(a)}addValue(a,i){const o=this.values.get(a);i!==o&&(o&&this.removeValue(a),this.bindToMotionValue(a,i),this.values.set(a,i),this.latestValues[a]=i.get())}removeValue(a){this.values.delete(a);const i=this.valueSubscriptions.get(a);i&&(i(),this.valueSubscriptions.delete(a)),delete this.latestValues[a],this.removeValueFromRenderState(a,this.renderState)}hasValue(a){return this.values.has(a)}getValue(a,i){if(this.props.values&&this.props.values[a])return this.props.values[a];let o=this.values.get(a);return o===void 0&&i!==void 0&&(o=vl(i===null?void 0:i,{owner:this}),this.addValue(a,o)),o}readValue(a,i){var o;let r=this.latestValues[a]!==void 0||!this.current?this.latestValues[a]:(o=this.getBaseTargetFromProps(this.props,a))!==null&&o!==void 0?o:this.readValueFromInstance(this.current,a,this.options);return r!=null&&(typeof r=="string"&&(wx(r)||xx(r))?r=parseFloat(r):!MA(r)&&as.test(i)&&(r=Ex(a,i)),this.setBaseTarget(a,Pt(r)?r.get():r)),Pt(r)?r.get():r}setBaseTarget(a,i){this.baseTarget[a]=i}getBaseTarget(a){var i;const{initial:o}=this.props;let r;if(typeof o=="string"||typeof o=="object"){const d=_h(this.props,o,(i=this.presenceContext)===null||i===void 0?void 0:i.custom);d&&(r=d[a])}if(o&&r!==void 0)return r;const u=this.getBaseTargetFromProps(this.props,a);return u!==void 0&&!Pt(u)?u:this.initialValues[a]!==void 0&&r===void 0?void 0:this.baseTarget[a]}on(a,i){return this.events[a]||(this.events[a]=new Rh),this.events[a].add(i)}notify(a,...i){this.events[a]&&this.events[a].notify(...i)}}class f_ extends BA{constructor(){super(...arguments),this.KeyframeResolver=Mx}sortInstanceNodePosition(a,i){return a.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(a,i){return a.style?a.style[i]:void 0}removeValueFromRenderState(a,{vars:i,style:o}){delete i[a],delete o[a]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:a}=this.props;Pt(a)&&(this.childSubscription=a.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}function IA(t){return window.getComputedStyle(t)}class LA extends f_{constructor(){super(...arguments),this.type="html",this.renderInstance=Jb}readValueFromInstance(a,i){if(Vs.has(i)){const o=Vh(i);return o&&o.default||0}else{const o=IA(a),r=(Xb(i)?o.getPropertyValue(i):o[i])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(a,{transformPagePoint:i}){return Wx(a,i)}build(a,i,o){kh(a,i,o.transformTemplate)}scrapeMotionValuesFromProps(a,i,o){return jh(a,i,o)}}class UA extends f_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=vt}getBaseTargetFromProps(a,i){return a[i]}readValueFromInstance(a,i){if(Vs.has(i)){const o=Vh(i);return o&&o.default||0}return i=ex.has(i)?i:yh(i),a.getAttribute(i)}scrapeMotionValuesFromProps(a,i,o){return ax(a,i,o)}build(a,i,o){Ch(a,i,this.isSVGTag,o.transformTemplate)}renderInstance(a,i,o,r){tx(a,i,o,r)}mount(a){this.isSVGTag=Nh(a.tagName),super.mount(a)}}const zA=(t,a)=>xh(t)?new UA(a):new LA(a,{allowProjection:t!==x.Fragment}),VA=fN({...aw,...AA,...hA,...DA},zA),Ct=NE(VA);function HA(){!qh.current&&d_();const[t]=x.useState(yc.current);return t}var et;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TEXT=1]="TEXT",t[t.TOOL_USE=2]="TOOL_USE",t[t.TOOL_RESULT=3]="TOOL_RESULT",t[t.ERROR=4]="ERROR",t[t.STATUS=5]="STATUS",t[t.SYSTEM=6]="SYSTEM",t[t.FINDING=7]="FINDING",t[t.SUBTASK_CREATE=8]="SUBTASK_CREATE",t[t.USER_INPUT=9]="USER_INPUT",t[t.SIGNAL=10]="SIGNAL",t[t.USAGE=11]="USAGE"})(et||(et={}));var kt;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.NOT_STARTED=1]="NOT_STARTED",t[t.WORKING=3]="WORKING",t[t.PAUSED=4]="PAUSED",t[t.COMPLETE=5]="COMPLETE",t[t.FAILED=6]="FAILED"})(kt||(kt={}));var Ja;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ACTIVE=1]="ACTIVE",t[t.ARCHIVED=2]="ARCHIVED"})(Ja||(Ja={}));var es;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OPEN=1]="OPEN",t[t.CLOSED=2]="CLOSED"})(es||(es={}));var Fn;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OFF=1]="OFF",t[t.SUBSCRIPTION=2]="SUBSCRIPTION",t[t.API_KEY=3]="API_KEY"})(Fn||(Fn={}));var ts;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.OFF=1]="OFF",t[t.ON=2]="ON"})(ts||(ts={}));const PA=8,O0="system",Qo="system";Object.assign(Object.create(null),{"":et.UNSPECIFIED,text:et.TEXT,tool_use:et.TOOL_USE,tool_result:et.TOOL_RESULT,error:et.ERROR,status:et.STATUS,system:et.SYSTEM,finding:et.FINDING,subtask_create:et.SUBTASK_CREATE,user_input:et.USER_INPUT,signal:et.SIGNAL,usage:et.USAGE});et.UNSPECIFIED+"",et.TEXT+"",et.TOOL_USE+"",et.TOOL_RESULT+"",et.ERROR+"",et.STATUS+"",et.SYSTEM+"",et.FINDING+"",et.SUBTASK_CREATE+"",et.USER_INPUT+"",et.SIGNAL+"",et.USAGE+"";Object.assign(Object.create(null),{"":kt.UNSPECIFIED,not_started:kt.NOT_STARTED,working:kt.WORKING,paused:kt.PAUSED,complete:kt.COMPLETE,failed:kt.FAILED,pending:kt.NOT_STARTED,assigned:kt.NOT_STARTED,in_progress:kt.WORKING,waiting_input:kt.PAUSED,review:kt.PAUSED,done:kt.COMPLETE});kt.UNSPECIFIED+"",kt.NOT_STARTED+"",kt.WORKING+"",kt.PAUSED+"",kt.COMPLETE+"",kt.FAILED+"";Object.assign(Object.create(null),{"":Ja.UNSPECIFIED,active:Ja.ACTIVE,archived:Ja.ARCHIVED});Ja.UNSPECIFIED+"",Ja.ACTIVE+"",Ja.ARCHIVED+"";Object.assign(Object.create(null),{"":es.UNSPECIFIED,open:es.OPEN,closed:es.CLOSED});es.UNSPECIFIED+"",es.OPEN+"",es.CLOSED+"";Object.assign(Object.create(null),{"":Fn.UNSPECIFIED,off:Fn.OFF,subscription:Fn.SUBSCRIPTION,api_key:Fn.API_KEY});Fn.UNSPECIFIED+"",Fn.OFF+"",Fn.SUBSCRIPTION+"",Fn.API_KEY+"";Object.assign(Object.create(null),{"":ts.UNSPECIFIED,off:ts.OFF,on:ts.ON});ts.UNSPECIFIED+"",ts.OFF+"",ts.ON+"";function Ta(t){return Array.isArray?Array.isArray(t):m_(t)==="[object Array]"}function GA(t){if(typeof t=="string")return t;let a=t+"";return a=="0"&&1/t==-1/0?"-0":a}function $A(t){return t==null?"":GA(t)}function qn(t){return typeof t=="string"}function h_(t){return typeof t=="number"}function FA(t){return t===!0||t===!1||qA(t)&&m_(t)=="[object Boolean]"}function p_(t){return typeof t=="object"}function qA(t){return p_(t)&&t!==null}function dn(t){return t!=null}function vf(t){return!t.trim().length}function m_(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const KA="Incorrect 'index' type",YA=t=>`Invalid value for key ${t}`,ZA=t=>`Pattern length exceeds max of ${t}.`,XA=t=>`Missing ${t} property in key`,QA=t=>`Property 'weight' in key '${t}' must be a positive integer`,B0=Object.prototype.hasOwnProperty;class WA{constructor(a){this._keys=[],this._keyMap={};let i=0;a.forEach(o=>{let r=g_(o);this._keys.push(r),this._keyMap[r.id]=r,i+=r.weight}),this._keys.forEach(o=>{o.weight/=i})}get(a){return this._keyMap[a]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function g_(t){let a=null,i=null,o=null,r=1,u=null;if(qn(t)||Ta(t))o=t,a=I0(t),i=qf(t);else{if(!B0.call(t,"name"))throw new Error(XA("name"));const d=t.name;if(o=d,B0.call(t,"weight")&&(r=t.weight,r<=0))throw new Error(QA(d));a=I0(d),i=qf(d),u=t.getFn}return{path:a,id:i,weight:r,src:o,getFn:u}}function I0(t){return Ta(t)?t:t.split(".")}function qf(t){return Ta(t)?t.join("."):t}function JA(t,a){let i=[],o=!1;const r=(u,d,p)=>{if(dn(u))if(!d[p])i.push(u);else{let m=d[p];const g=u[m];if(!dn(g))return;if(p===d.length-1&&(qn(g)||h_(g)||FA(g)))i.push($A(g));else if(Ta(g)){o=!0;for(let v=0,y=g.length;v<y;v+=1)r(g[v],d,p+1)}else d.length&&r(g,d,p+1)}};return r(t,qn(a)?a.split("."):a,0),o?i:i[0]}const e2={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},t2={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,a)=>t.score===a.score?t.idx<a.idx?-1:1:t.score<a.score?-1:1},n2={location:0,threshold:.6,distance:100},a2={useExtendedSearch:!1,getFn:JA,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var xe={...t2,...e2,...n2,...a2};const s2=/[^ ]+/g;function i2(t=1,a=3){const i=new Map,o=Math.pow(10,a);return{get(r){const u=r.match(s2).length;if(i.has(u))return i.get(u);const d=1/Math.pow(u,.5*t),p=parseFloat(Math.round(d*o)/o);return i.set(u,p),p},clear(){i.clear()}}}class Kh{constructor({getFn:a=xe.getFn,fieldNormWeight:i=xe.fieldNormWeight}={}){this.norm=i2(i,3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}setSources(a=[]){this.docs=a}setIndexRecords(a=[]){this.records=a}setKeys(a=[]){this.keys=a,this._keysMap={},a.forEach((i,o)=>{this._keysMap[i.id]=o})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,qn(this.docs[0])?this.docs.forEach((a,i)=>{this._addString(a,i)}):this.docs.forEach((a,i)=>{this._addObject(a,i)}),this.norm.clear())}add(a){const i=this.size();qn(a)?this._addString(a,i):this._addObject(a,i)}removeAt(a){this.records.splice(a,1);for(let i=a,o=this.size();i<o;i+=1)this.records[i].i-=1}getValueForItemAtKeyId(a,i){return a[this._keysMap[i]]}size(){return this.records.length}_addString(a,i){if(!dn(a)||vf(a))return;let o={v:a,i,n:this.norm.get(a)};this.records.push(o)}_addObject(a,i){let o={i,$:{}};this.keys.forEach((r,u)=>{let d=r.getFn?r.getFn(a):this.getFn(a,r.path);if(dn(d)){if(Ta(d)){let p=[];const m=[{nestedArrIndex:-1,value:d}];for(;m.length;){const{nestedArrIndex:g,value:v}=m.pop();if(dn(v))if(qn(v)&&!vf(v)){let y={v,i:g,n:this.norm.get(v)};p.push(y)}else Ta(v)&&v.forEach((y,b)=>{m.push({nestedArrIndex:b,value:y})})}o.$[u]=p}else if(qn(d)&&!vf(d)){let p={v:d,n:this.norm.get(d)};o.$[u]=p}}}),this.records.push(o)}toJSON(){return{keys:this.keys,records:this.records}}}function v_(t,a,{getFn:i=xe.getFn,fieldNormWeight:o=xe.fieldNormWeight}={}){const r=new Kh({getFn:i,fieldNormWeight:o});return r.setKeys(t.map(g_)),r.setSources(a),r.create(),r}function o2(t,{getFn:a=xe.getFn,fieldNormWeight:i=xe.fieldNormWeight}={}){const{keys:o,records:r}=t,u=new Kh({getFn:a,fieldNormWeight:i});return u.setKeys(o),u.setIndexRecords(r),u}function Qr(t,{errors:a=0,currentLocation:i=0,expectedLocation:o=0,distance:r=xe.distance,ignoreLocation:u=xe.ignoreLocation}={}){const d=a/t.length;if(u)return d;const p=Math.abs(o-i);return r?d+p/r:p?1:d}function l2(t=[],a=xe.minMatchCharLength){let i=[],o=-1,r=-1,u=0;for(let d=t.length;u<d;u+=1){let p=t[u];p&&o===-1?o=u:!p&&o!==-1&&(r=u-1,r-o+1>=a&&i.push([o,r]),o=-1)}return t[u-1]&&u-o>=a&&i.push([o,u-1]),i}const Rs=32;function r2(t,a,i,{location:o=xe.location,distance:r=xe.distance,threshold:u=xe.threshold,findAllMatches:d=xe.findAllMatches,minMatchCharLength:p=xe.minMatchCharLength,includeMatches:m=xe.includeMatches,ignoreLocation:g=xe.ignoreLocation}={}){if(a.length>Rs)throw new Error(ZA(Rs));const v=a.length,y=t.length,b=Math.max(0,Math.min(o,y));let S=u,T=b;const C=p>1||m,N=C?Array(y):[];let E;for(;(E=t.indexOf(a,T))>-1;){let V=Qr(a,{currentLocation:E,expectedLocation:b,distance:r,ignoreLocation:g});if(S=Math.min(V,S),T=E+v,C){let B=0;for(;B<v;)N[E+B]=1,B+=1}}T=-1;let w=[],R=1,M=v+y;const A=1<<v-1;for(let V=0;V<v;V+=1){let B=0,F=M;for(;B<F;)Qr(a,{errors:V,currentLocation:b+F,expectedLocation:b,distance:r,ignoreLocation:g})<=S?B=F:M=F,F=Math.floor((M-B)/2+B);M=F;let X=Math.max(1,b-F+1),J=d?y:Math.min(b+F,y)+v,te=Array(J+2);te[J+1]=(1<<V)-1;for(let z=J;z>=X;z-=1){let ne=z-1,I=i[t.charAt(ne)];if(C&&(N[ne]=+!!I),te[z]=(te[z+1]<<1|1)&I,V&&(te[z]|=(w[z+1]|w[z])<<1|1|w[z+1]),te[z]&A&&(R=Qr(a,{errors:V,currentLocation:ne,expectedLocation:b,distance:r,ignoreLocation:g}),R<=S)){if(S=R,T=ne,T<=b)break;X=Math.max(1,2*b-T)}}if(Qr(a,{errors:V+1,currentLocation:b,expectedLocation:b,distance:r,ignoreLocation:g})>S)break;w=te}const $={isMatch:T>=0,score:Math.max(.001,R)};if(C){const V=l2(N,p);V.length?m&&($.indices=V):$.isMatch=!1}return $}function c2(t){let a={};for(let i=0,o=t.length;i<o;i+=1){const r=t.charAt(i);a[r]=(a[r]||0)|1<<o-i-1}return a}const bc=String.prototype.normalize?(t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(t=>t);class y_{constructor(a,{location:i=xe.location,threshold:o=xe.threshold,distance:r=xe.distance,includeMatches:u=xe.includeMatches,findAllMatches:d=xe.findAllMatches,minMatchCharLength:p=xe.minMatchCharLength,isCaseSensitive:m=xe.isCaseSensitive,ignoreDiacritics:g=xe.ignoreDiacritics,ignoreLocation:v=xe.ignoreLocation}={}){if(this.options={location:i,threshold:o,distance:r,includeMatches:u,findAllMatches:d,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:v},a=m?a:a.toLowerCase(),a=g?bc(a):a,this.pattern=a,this.chunks=[],!this.pattern.length)return;const y=(S,T)=>{this.chunks.push({pattern:S,alphabet:c2(S),startIndex:T})},b=this.pattern.length;if(b>Rs){let S=0;const T=b%Rs,C=b-T;for(;S<C;)y(this.pattern.substr(S,Rs),S),S+=Rs;if(T){const N=b-Rs;y(this.pattern.substr(N),N)}}else y(this.pattern,0)}searchIn(a){const{isCaseSensitive:i,ignoreDiacritics:o,includeMatches:r}=this.options;if(a=i?a:a.toLowerCase(),a=o?bc(a):a,this.pattern===a){let C={isMatch:!0,score:0};return r&&(C.indices=[[0,a.length-1]]),C}const{location:u,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,ignoreLocation:v}=this.options;let y=[],b=0,S=!1;this.chunks.forEach(({pattern:C,alphabet:N,startIndex:E})=>{const{isMatch:w,score:R,indices:M}=r2(a,C,N,{location:u+E,distance:d,threshold:p,findAllMatches:m,minMatchCharLength:g,includeMatches:r,ignoreLocation:v});w&&(S=!0),b+=R,w&&M&&(y=[...y,...M])});let T={isMatch:S,score:S?b/this.chunks.length:1};return S&&r&&(T.indices=y),T}}class ls{constructor(a){this.pattern=a}static isMultiMatch(a){return L0(a,this.multiRegex)}static isSingleMatch(a){return L0(a,this.singleRegex)}search(){}}function L0(t,a){const i=t.match(a);return i?i[1]:null}class u2 extends ls{constructor(a){super(a)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(a){const i=a===this.pattern;return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class d2 extends ls{constructor(a){super(a)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(a){const o=a.indexOf(this.pattern)===-1;return{isMatch:o,score:o?0:1,indices:[0,a.length-1]}}}class f2 extends ls{constructor(a){super(a)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(a){const i=a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,this.pattern.length-1]}}}class h2 extends ls{constructor(a){super(a)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(a){const i=!a.startsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class p2 extends ls{constructor(a){super(a)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(a){const i=a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[a.length-this.pattern.length,a.length-1]}}}class m2 extends ls{constructor(a){super(a)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(a){const i=!a.endsWith(this.pattern);return{isMatch:i,score:i?0:1,indices:[0,a.length-1]}}}class b_ extends ls{constructor(a,{location:i=xe.location,threshold:o=xe.threshold,distance:r=xe.distance,includeMatches:u=xe.includeMatches,findAllMatches:d=xe.findAllMatches,minMatchCharLength:p=xe.minMatchCharLength,isCaseSensitive:m=xe.isCaseSensitive,ignoreDiacritics:g=xe.ignoreDiacritics,ignoreLocation:v=xe.ignoreLocation}={}){super(a),this._bitapSearch=new y_(a,{location:i,threshold:o,distance:r,includeMatches:u,findAllMatches:d,minMatchCharLength:p,isCaseSensitive:m,ignoreDiacritics:g,ignoreLocation:v})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(a){return this._bitapSearch.searchIn(a)}}class x_ extends ls{constructor(a){super(a)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(a){let i=0,o;const r=[],u=this.pattern.length;for(;(o=a.indexOf(this.pattern,i))>-1;)i=o+u,r.push([o,i-1]);const d=!!r.length;return{isMatch:d,score:d?0:1,indices:r}}}const Kf=[u2,x_,f2,h2,m2,p2,d2,b_],U0=Kf.length,g2=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,v2="|";function y2(t,a={}){return t.split(v2).map(i=>{let o=i.trim().split(g2).filter(u=>u&&!!u.trim()),r=[];for(let u=0,d=o.length;u<d;u+=1){const p=o[u];let m=!1,g=-1;for(;!m&&++g<U0;){const v=Kf[g];let y=v.isMultiMatch(p);y&&(r.push(new v(y,a)),m=!0)}if(!m)for(g=-1;++g<U0;){const v=Kf[g];let y=v.isSingleMatch(p);if(y){r.push(new v(y,a));break}}}return r})}const b2=new Set([b_.type,x_.type]);class x2{constructor(a,{isCaseSensitive:i=xe.isCaseSensitive,ignoreDiacritics:o=xe.ignoreDiacritics,includeMatches:r=xe.includeMatches,minMatchCharLength:u=xe.minMatchCharLength,ignoreLocation:d=xe.ignoreLocation,findAllMatches:p=xe.findAllMatches,location:m=xe.location,threshold:g=xe.threshold,distance:v=xe.distance}={}){this.query=null,this.options={isCaseSensitive:i,ignoreDiacritics:o,includeMatches:r,minMatchCharLength:u,findAllMatches:p,ignoreLocation:d,location:m,threshold:g,distance:v},a=i?a:a.toLowerCase(),a=o?bc(a):a,this.pattern=a,this.query=y2(this.pattern,this.options)}static condition(a,i){return i.useExtendedSearch}searchIn(a){const i=this.query;if(!i)return{isMatch:!1,score:1};const{includeMatches:o,isCaseSensitive:r,ignoreDiacritics:u}=this.options;a=r?a:a.toLowerCase(),a=u?bc(a):a;let d=0,p=[],m=0;for(let g=0,v=i.length;g<v;g+=1){const y=i[g];p.length=0,d=0;for(let b=0,S=y.length;b<S;b+=1){const T=y[b],{isMatch:C,indices:N,score:E}=T.search(a);if(C){if(d+=1,m+=E,o){const w=T.constructor.type;b2.has(w)?p=[...p,...N]:p.push(N)}}else{m=0,d=0,p.length=0;break}}if(d){let b={isMatch:!0,score:m/d};return o&&(b.indices=p),b}}return{isMatch:!1,score:1}}}const Yf=[];function _2(...t){Yf.push(...t)}function Zf(t,a){for(let i=0,o=Yf.length;i<o;i+=1){let r=Yf[i];if(r.condition(t,a))return new r(t,a)}return new y_(t,a)}const xc={AND:"$and",OR:"$or"},Xf={PATH:"$path",PATTERN:"$val"},Qf=t=>!!(t[xc.AND]||t[xc.OR]),S2=t=>!!t[Xf.PATH],T2=t=>!Ta(t)&&p_(t)&&!Qf(t),z0=t=>({[xc.AND]:Object.keys(t).map(a=>({[a]:t[a]}))});function __(t,a,{auto:i=!0}={}){const o=r=>{let u=Object.keys(r);const d=S2(r);if(!d&&u.length>1&&!Qf(r))return o(z0(r));if(T2(r)){const m=d?r[Xf.PATH]:u[0],g=d?r[Xf.PATTERN]:r[m];if(!qn(g))throw new Error(YA(m));const v={keyId:qf(m),pattern:g};return i&&(v.searcher=Zf(g,a)),v}let p={children:[],operator:u[0]};return u.forEach(m=>{const g=r[m];Ta(g)&&g.forEach(v=>{p.children.push(o(v))})}),p};return Qf(t)||(t=z0(t)),o(t)}function k2(t,{ignoreFieldNorm:a=xe.ignoreFieldNorm}){t.forEach(i=>{let o=1;i.matches.forEach(({key:r,norm:u,score:d})=>{const p=r?r.weight:null;o*=Math.pow(d===0&&p?Number.EPSILON:d,(p||1)*(a?1:u))}),i.score=o})}function C2(t,a){const i=t.matches;a.matches=[],dn(i)&&i.forEach(o=>{if(!dn(o.indices)||!o.indices.length)return;const{indices:r,value:u}=o;let d={indices:r,value:u};o.key&&(d.key=o.key.src),o.idx>-1&&(d.refIndex=o.idx),a.matches.push(d)})}function E2(t,a){a.score=t.score}function N2(t,a,{includeMatches:i=xe.includeMatches,includeScore:o=xe.includeScore}={}){const r=[];return i&&r.push(C2),o&&r.push(E2),t.map(u=>{const{idx:d}=u,p={item:a[d],refIndex:d};return r.length&&r.forEach(m=>{m(u,p)}),p})}class Ji{constructor(a,i={},o){this.options={...xe,...i},this.options.useExtendedSearch,this._keyStore=new WA(this.options.keys),this.setCollection(a,o)}setCollection(a,i){if(this._docs=a,i&&!(i instanceof Kh))throw new Error(KA);this._myIndex=i||v_(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(a){dn(a)&&(this._docs.push(a),this._myIndex.add(a))}remove(a=()=>!1){const i=[];for(let o=0,r=this._docs.length;o<r;o+=1){const u=this._docs[o];a(u,o)&&(this.removeAt(o),o-=1,r-=1,i.push(u))}return i}removeAt(a){this._docs.splice(a,1),this._myIndex.removeAt(a)}getIndex(){return this._myIndex}search(a,{limit:i=-1}={}){const{includeMatches:o,includeScore:r,shouldSort:u,sortFn:d,ignoreFieldNorm:p}=this.options;let m=qn(a)?qn(this._docs[0])?this._searchStringList(a):this._searchObjectList(a):this._searchLogical(a);return k2(m,{ignoreFieldNorm:p}),u&&m.sort(d),h_(i)&&i>-1&&(m=m.slice(0,i)),N2(m,this._docs,{includeMatches:o,includeScore:r})}_searchStringList(a){const i=Zf(a,this.options),{records:o}=this._myIndex,r=[];return o.forEach(({v:u,i:d,n:p})=>{if(!dn(u))return;const{isMatch:m,score:g,indices:v}=i.searchIn(u);m&&r.push({item:u,idx:d,matches:[{score:g,value:u,norm:p,indices:v}]})}),r}_searchLogical(a){const i=__(a,this.options),o=(p,m,g)=>{if(!p.children){const{keyId:y,searcher:b}=p,S=this._findMatches({key:this._keyStore.get(y),value:this._myIndex.getValueForItemAtKeyId(m,y),searcher:b});return S&&S.length?[{idx:g,item:m,matches:S}]:[]}const v=[];for(let y=0,b=p.children.length;y<b;y+=1){const S=p.children[y],T=o(S,m,g);if(T.length)v.push(...T);else if(p.operator===xc.AND)return[]}return v},r=this._myIndex.records,u={},d=[];return r.forEach(({$:p,i:m})=>{if(dn(p)){let g=o(i,p,m);g.length&&(u[m]||(u[m]={idx:m,item:p,matches:[]},d.push(u[m])),g.forEach(({matches:v})=>{u[m].matches.push(...v)}))}}),d}_searchObjectList(a){const i=Zf(a,this.options),{keys:o,records:r}=this._myIndex,u=[];return r.forEach(({$:d,i:p})=>{if(!dn(d))return;let m=[];o.forEach((g,v)=>{m.push(...this._findMatches({key:g,value:d[v],searcher:i}))}),m.length&&u.push({idx:p,item:d,matches:m})}),u}_findMatches({key:a,value:i,searcher:o}){if(!dn(i))return[];let r=[];if(Ta(i))i.forEach(({v:u,i:d,n:p})=>{if(!dn(u))return;const{isMatch:m,score:g,indices:v}=o.searchIn(u);m&&r.push({score:g,key:a,value:u,idx:d,norm:p,indices:v})});else{const{v:u,n:d}=i,{isMatch:p,score:m,indices:g}=o.searchIn(u);p&&r.push({score:m,key:a,value:u,norm:d,indices:g})}return r}}Ji.version="7.1.0";Ji.createIndex=v_;Ji.parseIndex=o2;Ji.config=xe;Ji.parseQuery=__;_2(x2);function j2(t,a,i,o){if(!a.trim())return[];const r=.3;return new Ji(t,{keys:i,threshold:r,ignoreLocation:!0,includeScore:!0,includeMatches:!0,minMatchCharLength:2}).search(a).map(m=>({item:m.item,score:m.score??1,matches:(m.matches??[]).map(g=>({key:g.key??"",indices:g.indices}))}))}const Wf={not_started:{color:"var(--text-tertiary)",icon:"○",label:"Not Started"},working:{color:"var(--accent-green)",icon:"●",label:"Working"},paused:{color:"var(--accent-yellow)",icon:"◉",label:"Paused"},complete:{color:"var(--accent-green)",icon:"✓",label:"Complete"},failed:{color:"var(--accent-red)",icon:"✗",label:"Failed"},blocked:{color:"var(--accent-yellow)",icon:"⦸",label:"Blocked"}};function ss(t){return t==="blocked"?Wf.blocked:Wf[Yh(t)]}const w2={not_started:"statusPending",working:"statusInProgress",paused:"statusWaitingInput",complete:"statusDone",failed:"statusFailed"};function A2(t){return w2[Yh(t)]??"statusPending"}const D2=["working","paused","failed","not_started","blocked","complete"],V0=["not_started","working","paused","complete","failed"],R2={pending:"not_started",assigned:"not_started",in_progress:"working",waiting_input:"paused",review:"paused",done:"complete"};function Yh(t){return t in Wf&&t!=="blocked"?t:R2[t]??"not_started"}const M2={not_started:"--text-tertiary",working:"--accent-green",paused:"--accent-yellow",complete:"--accent-green",failed:"--accent-red",pending:"--text-tertiary",assigned:"--text-tertiary",in_progress:"--accent-green",review:"--accent-yellow",done:"--accent-green",waiting_input:"--accent-yellow"};function O2(t){if(t.length===0)return[];const a=[...t].sort((o,r)=>o[0]-r[0]),i=[[a[0][0],a[0][1]]];for(let o=1;o<a.length;o++){const r=i[i.length-1],[u,d]=a[o];u<=r[1]+1?r[1]=Math.max(r[1],d):i.push([u,d])}return i}function S_({text:t,indices:a,highlightClass:i}){if(!a||a.length===0)return c.jsx(c.Fragment,{children:t});const o=O2(a),r=[];let u=0;for(const[d,p]of o)d>u&&r.push(c.jsx("span",{children:t.slice(u,d)},`p${u}`)),r.push(c.jsx("mark",{className:i,children:t.slice(d,p+1)},`m${d}`)),u=p+1;return u<t.length&&r.push(c.jsx("span",{children:t.slice(u)},`p${u}`)),c.jsx(c.Fragment,{children:r})}function B2(t){const a=new Map(t.map(o=>[o.id,{...o,children:[]}])),i=[];for(const o of a.values())o.parentTaskId&&a.has(o.parentTaskId)?a.get(o.parentTaskId).children.push(o):i.push(o);for(const o of a.values())o.children.sort((r,u)=>r.sortOrder-u.sortOrder);return i.sort((o,r)=>o.sortOrder-r.sortOrder)}function I2(t,a){const i=new Map;for(const u of t){const p=u.dependsOn.length>0&&u.dependsOn.some(g=>a.get(g)!=="complete")?"blocked":u.status,m=i.get(p);m?m.push(u):i.set(p,[u])}const o=[],r=new Set;for(const u of D2){r.add(u);const d=i.get(u);if(d&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=ss(u);o.push({status:u,label:p.label,style:p,tasks:d})}}for(const[u,d]of i)if(!r.has(u)&&d.length>0){d.sort((m,g)=>m.sortOrder-g.sortOrder);const p=ss(u);o.push({status:u,label:p.label,style:p,tasks:d})}return o}const L2="_container_z4i38_1",U2="_header_z4i38_5",z2="_headerActions_z4i38_17",V2="_searchInput_z4i38_23",H2="_searchHighlight_z4i38_56",P2="_groupToggle_z4i38_62",G2="_groupToggleActive_z4i38_89",$2="_addButton_z4i38_93",F2="_taskRow_z4i38_120",q2="_selected_z4i38_140",K2="_expandArrow_z4i38_150",Y2="_expanded_z4i38_157",Z2="_leafSpacer_z4i38_161",X2="_taskStatusIcon_z4i38_166",Q2="_taskTitle_z4i38_170",W2="_workspaceBadge_z4i38_177",J2="_childCountBadge_z4i38_195",eD="_dependencyBadge_z4i38_208",tD="_blockedBadge_z4i38_220",nD="_addChildButton_z4i38_225",aD="_emptyState_z4i38_268",sD="_statusGroupHeader_z4i38_275",iD="_statusGroupIcon_z4i38_294",oD="_statusGroupLabel_z4i38_298",lD="_statusGroupCount_z4i38_303",Be={container:L2,header:U2,headerActions:z2,searchInput:V2,searchHighlight:H2,groupToggle:P2,groupToggleActive:G2,addButton:$2,taskRow:F2,selected:q2,expandArrow:K2,expanded:Y2,leafSpacer:Z2,taskStatusIcon:X2,taskTitle:Q2,workspaceBadge:W2,childCountBadge:J2,dependencyBadge:eD,blockedBadge:tD,addChildButton:nD,emptyState:aD,statusGroupHeader:sD,statusGroupIcon:iD,statusGroupLabel:oD,statusGroupCount:lD},rD=[{name:"title",weight:2},{name:"description",weight:1}],T_=16,cD=16,k_="grackle-task-group-by-status";function H0(){try{return localStorage.getItem(k_)==="true"}catch{return!1}}function uD(t){try{localStorage.setItem(k_,String(t))}catch{}}function dD({group:t,isExpanded:a,onToggle:i,selectedTaskId:o,navigate:r,titleHighlights:u,workspaceNames:d}){return c.jsxs("div",{"data-testid":`status-group-${t.status}`,children:[c.jsxs("div",{className:Be.statusGroupHeader,role:"button",tabIndex:0,"aria-expanded":a,onClick:i,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),i())},children:[c.jsx("span",{className:`${Be.expandArrow} ${a?Be.expanded:""}`,children:"▸"}),c.jsx("span",{className:Be.statusGroupIcon,style:{color:t.style.color},children:t.style.icon}),c.jsx("span",{className:Be.statusGroupLabel,children:t.label}),c.jsx("span",{className:Be.statusGroupCount,children:t.tasks.length})]}),c.jsx(Qn,{children:a&&c.jsx(Ct.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},style:{overflow:"hidden"},children:t.tasks.map(p=>{const m=ss(p.status),g=o===p.id,v=p.parentTaskId||!p.workspaceId?void 0:d.get(p.workspaceId);return c.jsxs("div",{onClick:()=>r(_a(p.id)),className:`${Be.taskRow} ${g?Be.selected:""}`,style:{"--task-indent":`${T_}px`},"data-task-id":p.id,children:[c.jsx("span",{className:Be.leafSpacer}),c.jsx("span",{className:Be.taskStatusIcon,style:{color:m.color},children:m.icon}),c.jsx("span",{className:Be.taskTitle,title:p.title,children:c.jsx(S_,{text:p.title,indices:u.get(p.id),highlightClass:Be.searchHighlight})}),v&&c.jsx("span",{className:Be.workspaceBadge,title:v,children:v})]},p.id)})})})]})}function C_({node:t,depth:a,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:u,taskStatusById:d,titleHighlights:p,workspaceNames:m}){const g=ss(t.status),v=t.dependsOn.length>0&&t.dependsOn.some(E=>d.get(E)!=="complete"),y=i.has(t.id),b=t.children.length>0,S=r===t.id,T=T_+a*cD,N=a===0&&!t.parentTaskId&&t.workspaceId?m.get(t.workspaceId):void 0;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{onClick:()=>u(_a(t.id)),className:`${Be.taskRow} ${S?Be.selected:""}`,style:{"--task-indent":`${T}px`},"data-task-id":t.id,children:[b&&c.jsx("span",{className:`${Be.expandArrow} ${y?Be.expanded:""}`,role:"button",tabIndex:0,"aria-label":y?"Collapse task":"Expand task",onClick:E=>{E.stopPropagation(),o(t.id)},onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),E.stopPropagation(),o(t.id))},children:"▸"}),!b&&c.jsx("span",{className:Be.leafSpacer}),c.jsx("span",{className:Be.taskStatusIcon,style:{color:g.color},children:g.icon}),c.jsx("span",{className:Be.taskTitle,title:t.title,children:c.jsx(S_,{text:t.title,indices:p.get(t.id),highlightClass:Be.searchHighlight})}),N&&c.jsx("span",{className:Be.workspaceBadge,title:N,children:N}),b&&c.jsxs("span",{className:Be.childCountBadge,children:[t.children.filter(E=>E.status==="complete").length,"/",t.children.length]}),t.dependsOn.length>0&&c.jsx("span",{className:`${Be.dependencyBadge} ${v?Be.blockedBadge:""}`,title:`Depends on: ${t.dependsOn.join(", ")}`,children:v?"blocked":"dep"}),a<PA&&c.jsx("button",{onClick:E=>{E.stopPropagation(),u(Xi(t.workspaceId,t.id))},title:"Add child task","aria-label":"Add child task",className:Be.addChildButton,children:"+"})]}),c.jsx(Qn,{children:b&&y&&c.jsx(Ct.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},style:{overflow:"hidden"},children:t.children.map(E=>c.jsx(C_,{node:E,depth:a+1,expandedTasks:i,toggleTask:o,selectedTaskId:r,navigate:u,taskStatusById:d,titleHighlights:p,workspaceNames:m},E.id))})})]})}function fD(){const{workspaces:t,tasks:a}=We(),i=Rt(),[o,r]=x.useState(new Set),[u,d]=x.useState(new Set),[p,m]=x.useState(H0),[g,v]=x.useState(H0),[y,b]=x.useState(new Map),S=Tt("/tasks/:taskId/*"),T=(S==null?void 0:S.params.taskId)!=="new"?S==null?void 0:S.params.taskId:void 0,C=x.useMemo(()=>new Map(a.map(z=>[z.id,z.status])),[a]),N=x.useMemo(()=>new Map(t.map(z=>[z.id,z.name])),[t]),E=()=>{const z=!p;uD(z),m(z),z&&(v(!0),b(new Map))},w=z=>{b(ne=>{const I=new Map(ne),K=I.has(z)?I.get(z):g;return I.set(z,!K),I})},R=z=>y.has(z)?y.get(z):g,M=z=>{r(ne=>{const I=new Set(ne);return I.has(z)?(I.delete(z),d(K=>new Set(K).add(z))):(I.add(z),d(K=>{const se=new Set(K);return se.delete(z),se})),I})};x.useEffect(()=>{const z=new Set(a.filter(ne=>ne.parentTaskId).map(ne=>ne.parentTaskId));z.size>0&&r(ne=>{const I=new Set(ne);for(const K of z)u.has(K)||I.add(K);return I})},[a,u]);const[A,$]=x.useState(""),{directMatchTaskIds:V,treeMatchTaskIds:B,titleHighlights:F}=x.useMemo(()=>{if(!A.trim())return{directMatchTaskIds:null,treeMatchTaskIds:null,titleHighlights:new Map};const z=j2(a,A,rD),ne=new Set(z.map(oe=>oe.item.id)),I=new Map;for(const oe of z){const j=oe.matches.find(ie=>ie.key==="title");j&&I.set(oe.item.id,j.indices)}const K=new Set(ne),se=new Map(a.map(oe=>[oe.id,oe]));for(const oe of[...ne]){let j=se.get(oe);for(;j!=null&&j.parentTaskId;)K.add(j.parentTaskId),j=se.get(j.parentTaskId)}return{directMatchTaskIds:ne,treeMatchTaskIds:K,titleHighlights:I}},[A,a]),X=V!==null,J=X?p?V:B:null,te=J?a.filter(z=>J.has(z.id)):a,ee=p?[]:B2(te);return c.jsxs("div",{className:Be.container,children:[c.jsxs("div",{className:Be.header,children:[c.jsx("span",{children:"Tasks"}),c.jsxs("div",{className:Be.headerActions,children:[c.jsx("button",{className:`${Be.groupToggle} ${p?Be.groupToggleActive:""}`,onClick:E,"aria-label":p?"Switch to tree view":"Group tasks by status","aria-pressed":p,title:p?"Switch to tree view":"Group tasks by status","data-testid":"task-group-by-status-toggle",children:"≡"}),c.jsx("button",{className:Be.addButton,onClick:()=>i(Xi()),"aria-label":"New task",title:"New task","data-testid":"new-task-button",children:"+"})]})]}),a.length>0&&c.jsx("input",{type:"text",value:A,onChange:z=>$(z.target.value),placeholder:"Filter...","aria-label":"Filter tasks",className:Be.searchInput,"data-testid":"sidebar-search"}),p?I2(te,C).map(z=>c.jsx(dD,{group:z,isExpanded:R(z.status),onToggle:()=>w(z.status),selectedTaskId:T,navigate:i,titleHighlights:F,workspaceNames:N},z.status)):ee.map(z=>c.jsx(C_,{node:z,depth:0,expandedTasks:o,toggleTask:M,selectedTaskId:T,navigate:i,taskStatusById:C,titleHighlights:F,workspaceNames:N},z.id)),te.length===0&&!X&&c.jsx("div",{className:Be.emptyState,children:"No tasks yet. Click + to create one."}),te.length===0&&X&&c.jsx("div",{className:Be.emptyState,children:"No matching tasks"})]})}const hD="_nav_14i94_1",pD="_tab_14i94_24",mD="_tabActive_14i94_62",gD="_tabLabel_14i94_75",vD="_statusDot_14i94_81",yD="_pulse_14i94_87",bD="_addButton_14i94_99",xD="_empty_14i94_132",Qa={nav:hD,tab:pD,tabActive:mD,tabLabel:gD,statusDot:vD,pulse:yD,addButton:bD,empty:xD},_D={connected:"var(--accent-green)",sleeping:"var(--accent-yellow)",error:"var(--accent-red)",disconnected:"var(--text-tertiary)",connecting:"var(--accent-blue)"};function SD({environments:t}){const a=Rt(),i=x.useRef(null),o=Tt("/environments/:environmentId"),r=Tt("/environments/:environmentId/edit"),u=Tt("/environments/:environmentId/workspaces/:workspaceId"),d=Tt("/environments/:environmentId/workspaces/:workspaceId/*"),p=(o==null?void 0:o.params.environmentId)??(r==null?void 0:r.params.environmentId)??(u==null?void 0:u.params.environmentId)??(d==null?void 0:d.params.environmentId),m=p==="new"?void 0:p,g=x.useCallback(b=>{a(Gi(b))},[a]),v=x.useCallback(b=>{var E;const S=(E=i.current)==null?void 0:E.querySelectorAll('[role="tab"]');if(!S||S.length===0)return;const T=Array.from(S).findIndex(w=>w===document.activeElement),C=T>=0?T:t.findIndex(w=>w.id===m);let N=C;if(b.key==="ArrowDown")b.preventDefault(),N=(C+1)%S.length;else if(b.key==="ArrowUp")b.preventDefault(),N=(C-1+S.length)%S.length;else if(b.key==="Home")b.preventDefault(),N=0;else if(b.key==="End")b.preventDefault(),N=S.length-1;else return;N<t.length&&a(Gi(t[N].id)),S[N].focus()},[m,t,a]),y=m??(t.length>0?t[0].id:void 0);return c.jsxs("div",{className:Qa.nav,"data-testid":"environment-nav",children:[c.jsx("nav",{ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Environments",onKeyDown:v,children:t.map(b=>{const S=b.id===m,T=b.id===y,C=_D[b.status]||"var(--text-tertiary)",N=b.status==="connected";return c.jsxs("button",{role:"tab",type:"button","aria-selected":S,tabIndex:T?0:-1,className:`${Qa.tab} ${S?Qa.tabActive:""}`,onClick:()=>g(b.id),"data-testid":"env-nav-item",children:[c.jsx("span",{className:`${Qa.statusDot} ${N?Qa.pulse:""}`,style:{color:C},children:"●"}),c.jsx("span",{className:Qa.tabLabel,title:b.displayName||b.id,children:b.displayName||b.id})]},b.id)})}),c.jsx("button",{type:"button",className:Qa.addButton,onClick:()=>a(oC),title:"Add environment","data-testid":"env-nav-add",children:"+ Add Environment"}),t.length===0&&c.jsx("div",{className:Qa.empty,children:"No environments yet."})]})}const TD="_nav_1bhou_1",kD="_tab_1bhou_24",CD="_tabIcon_1bhou_62",ED="_tabActive_1bhou_68",Wr={nav:TD,tab:kD,tabIcon:CD,tabActive:ED},va=[{path:"credentials",label:"Credentials",icon:"🔑"},{path:"personas",label:"Personas",icon:"👤"},{path:"appearance",label:"Appearance",icon:"🎨"},{path:"about",label:"About",icon:"ℹ️"}];function ND(){var d;const t=wt(),a=Rt(),i=x.useRef(null),o=((d=va.find(p=>t.pathname===`${il}/${p.path}`))==null?void 0:d.path)??va[0].path,r=x.useCallback(p=>{a(`${il}/${p}`)},[a]),u=x.useCallback(p=>{var S,T;const m=(S=i.current)==null?void 0:S.querySelectorAll('[role="tab"]');if(!m)return;const g=Array.from(m).findIndex(C=>C===document.activeElement),v=g>=0?g:va.findIndex(C=>C.path===o);let y=v;if(p.key==="ArrowDown")p.preventDefault(),y=(v+1)%va.length;else if(p.key==="ArrowUp")p.preventDefault(),y=(v-1+va.length)%va.length;else if(p.key==="Home")p.preventDefault(),y=0;else if(p.key==="End")p.preventDefault(),y=va.length-1;else return;const b=va[y].path;a(`${il}/${b}`),(T=m[y])==null||T.focus()},[o,a]);return c.jsx("nav",{className:Wr.nav,ref:i,role:"tablist","aria-orientation":"vertical","aria-label":"Settings",onKeyDown:u,children:va.map(p=>{const m=p.path===o;return c.jsxs("button",{role:"tab",type:"button","aria-selected":m,tabIndex:m?0:-1,className:`${Wr.tab} ${m?Wr.tabActive:""}`,onClick:()=>r(p.path),children:[c.jsx("span",{className:Wr.tabIcon,"aria-hidden":"true",children:p.icon}),p.label]},p.path)})})}const jD="_nav_1snmp_1",wD="_searchForm_1snmp_8",AD="_searchInput_1snmp_15",DD="_searchButton_1snmp_33",RD="_clearButton_1snmp_68",MD="_workspaceSelect_1snmp_85",OD="_listHeader_1snmp_99",BD="_nodeList_1snmp_108",ID="_nodeItem_1snmp_116",LD="_indicator_1snmp_129",UD="_label_1snmp_136",zD="_badge_1snmp_145",wn={nav:jD,searchForm:wD,searchInput:AD,searchButton:DD,clearButton:RD,workspaceSelect:MD,listHeader:OD,nodeList:BD,nodeItem:ID,indicator:LD,label:UD,badge:zD};function VD(){const{knowledge:t,workspaces:a}=We(),[i,o]=x.useState(""),r=x.useCallback(m=>{m.preventDefault(),i.trim()&&t.search(i.trim())},[i,t]),u=x.useCallback(()=>{o(""),t.clearSearch()},[t]),d=x.useCallback(m=>{t.selectNode(m)},[t]),p=x.useCallback(m=>{o(""),t.loadRecent(m||void 0)},[t]);return c.jsxs("div",{className:wn.nav,"data-testid":"knowledge-nav",children:[c.jsxs("form",{className:wn.searchForm,onSubmit:r,children:[c.jsx("input",{className:wn.searchInput,type:"text",placeholder:"Search...",value:i,onChange:m=>{o(m.target.value)},"data-testid":"knowledge-search-input"}),c.jsx("button",{type:"submit",className:wn.searchButton,disabled:t.loading,children:"Go"})]}),t.searchQuery&&c.jsx("button",{type:"button",className:wn.clearButton,onClick:u,children:"Clear search"}),c.jsxs("select",{className:wn.workspaceSelect,onChange:m=>{p(m.target.value)},"data-testid":"knowledge-workspace-filter",children:[c.jsx("option",{value:"",children:"All workspaces"}),a.map(m=>c.jsx("option",{value:m.id,children:m.name},m.id))]}),c.jsxs("div",{className:wn.listHeader,children:["Nodes (",t.graphData.nodes.length,")"]}),c.jsx("ul",{className:wn.nodeList,children:t.graphData.nodes.map(m=>c.jsxs("li",{className:wn.nodeItem,onClick:()=>{d(m.id)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),d(m.id))},role:"button",tabIndex:0,children:[c.jsx("span",{className:wn.indicator,style:{backgroundColor:m.kind==="reference"?"#4A9EFF":m.category==="decision"?"#22C55E":m.category==="concept"?"#A855F7":m.category==="snippet"?"#6B7280":"#EAB308"}}),c.jsx("span",{className:wn.label,children:m.label}),c.jsx("span",{className:wn.badge,children:m.kind==="reference"?m.sourceType:m.category})]},m.id))})]})}function HD(){const t=x.useMemo(()=>c.jsx(fD,{}),[]);return Nc(t),c.jsx(Us,{})}function PD(){const{environments:t}=We(),a=x.useMemo(()=>c.jsx(SD,{environments:t}),[t]);return Nc(a),c.jsx(Us,{})}function GD(){const t=x.useMemo(()=>c.jsx(ND,{}),[]);return Nc(t),c.jsx(Us,{})}function $D(){const t=x.useMemo(()=>c.jsx(VD,{}),[]);return Nc(t),c.jsx(Us,{})}const FD="_bar_tnfsh_1",qD="_btnPrimary_tnfsh_32",KD="_statusText_tnfsh_85",YD="_statusCompleted_tnfsh_90",ZD="_statusFailed_tnfsh_94",XD="_statusBlocked_tnfsh_98",QD="_hintText_tnfsh_103",ct={bar:FD,btnPrimary:qD,statusText:KD,statusCompleted:YD,statusFailed:ZD,statusBlocked:XD,hintText:QD};function WD(){const{sessions:t,tasks:a,environments:i}=We(),o=Rt(),r=wt(),u=Tt("/sessions/:sessionId"),d=Tt("/tasks/:taskId"),p=Tt("/tasks/:taskId/stream"),m=Tt("/tasks/:taskId/findings"),g=Tt("/tasks/:taskId/edit"),v=Tt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId"),y=Tt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream"),b=Tt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings"),S=Tt("/environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit"),T=Tt("/sessions/new"),C=Tt("/environments/:environmentId/workspaces/:workspaceId"),N=Tt("/tasks/new"),E=Tt("/chat"),w=Tt("/"),R=Tt("/settings/*"),M=u==null?void 0:u.params.sessionId,A=(d==null?void 0:d.params.taskId)??(p==null?void 0:p.params.taskId)??(m==null?void 0:m.params.taskId)??(v==null?void 0:v.params.taskId)??(y==null?void 0:y.params.taskId)??(b==null?void 0:b.params.taskId)??(S==null?void 0:S.params.taskId),$=v??y??b??S,V=($==null?void 0:$.params.environmentId)??(C==null?void 0:C.params.environmentId),B=r.pathname.startsWith("/environments")&&!C&&!$,F=!!E,X=!!T,J=!!C&&!v&&!y&&!b&&!S,te=!!N;if(!!w&&!X&&!J&&!te||!!R||(!!g||!!S)||te||B||X)return c.jsx(c.Fragment,{});if(F)return i.find(K=>K.adapterType==="local"&&K.status==="connected")?c.jsx(c.Fragment,{}):c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Add a local environment to start chatting"})});if(J)return c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Select a task or click + to create one"})});if(A){const I=a.find(oe=>oe.id===A);if(!I)return c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Loading..."})});const K=new Map(a.map(oe=>[oe.id,oe])),se=I.dependsOn.some(oe=>{const j=K.get(oe);return j!==void 0&&j.status!=="complete"});if(I.status==="not_started"){const oe=se?I.dependsOn.map(j=>K.get(j)).filter(j=>j&&j.status!=="complete").map(j=>j.title):[];return c.jsx("div",{className:ct.bar,children:se?c.jsxs("span",{className:ct.statusBlocked,children:["Blocked by: ",oe.join(", ")]}):c.jsx("span",{className:ct.hintText,children:"Use the buttons above to start or manage this task"})})}if(I.status==="working"||I.status==="paused"){const oe=I.latestSessionId||void 0,j=oe?t.find(pe=>pe.id===oe):void 0;return j&&j.status!=="stopped"?c.jsx(c.Fragment,{}):c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Waiting for agent..."})})}if(I.status==="complete")return c.jsxs("div",{className:ct.bar,children:[c.jsx("span",{className:`${ct.statusText} ${ct.statusCompleted}`,children:"Task completed"}),c.jsx("button",{onClick:()=>o(Xi(I.workspaceId,void 0,V)),className:ct.btnPrimary,children:"+ New Task"})]});if(I.status==="failed")return c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:`${ct.statusText} ${ct.statusFailed}`,children:"Task failed"})})}if(M){const I=t.find(oe=>oe.id===M),K=(I==null?void 0:I.status)==="stopped";if(I!==void 0&&!K)return c.jsx(c.Fragment,{});if(K)return c.jsxs("div",{className:ct.bar,children:[c.jsxs("span",{className:`${ct.statusText} ${ct.hintText}`,children:["Session ",I.endReason||I.status]}),c.jsx("button",{onClick:()=>o(Sb(I.environmentId)),className:ct.btnPrimary,children:"+ New Chat"})]})}return c.jsx("div",{className:ct.bar,children:c.jsx("span",{className:ct.hintText,children:"Loading..."})})}const JD="_toast_da8ll_1",eR="_success_da8ll_18",tR="_icon_da8ll_22",nR="_error_da8ll_25",aR="_warning_da8ll_32",sR="_info_da8ll_38",iR="_message_da8ll_53",oR="_close_da8ll_60",Wo={toast:JD,success:eR,icon:tR,error:nR,warning:aR,info:sR,message:iR,close:oR},lR={success:"✓",error:"✕",warning:"⚠",info:"ℹ"};function rR({toast:t,onDismiss:a}){return x.useEffect(()=>{const i=setTimeout(()=>a(t.id),t.duration);return()=>clearTimeout(i)},[t.id,t.duration,a]),c.jsxs(Ct.div,{className:`${Wo.toast} ${Wo[t.variant]}`,role:"status",initial:{opacity:0,y:-16,scale:.94},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.94},transition:{duration:.2,ease:"easeOut"},layout:!0,children:[c.jsx("span",{className:Wo.icon,"aria-hidden":"true",children:lR[t.variant]}),c.jsx("span",{className:Wo.message,children:t.message}),c.jsx("button",{type:"button",className:Wo.close,onClick:()=>a(t.id),"aria-label":"Dismiss notification",children:"×"})]})}const cR="_container_qqse2_1",uR={container:cR};function dR(){const{toasts:t,dismissToast:a}=zs();return c.jsx("div",{className:uR.container,"data-testid":"toast-container",children:c.jsx(Qn,{children:t.map(i=>c.jsx(rR,{toast:i,onDismiss:a},i.id))})})}const fR="_breadcrumbs_17or2_1",hR="_list_17or2_11",pR="_item_17or2_21",mR="_separator_17or2_28",gR="_link_17or2_34",vR="_current_17or2_57",Ri={breadcrumbs:fR,list:hR,item:pR,separator:mR,link:gR,current:vR},yR="›";function Hs({segments:t}){return c.jsx("nav",{className:Ri.breadcrumbs,"aria-label":"Breadcrumb","data-testid":"breadcrumbs",children:c.jsx("ol",{className:Ri.list,children:t.map((a,i)=>{const o=i===t.length-1;return c.jsxs("li",{className:Ri.item,children:[i>0&&c.jsx("span",{className:Ri.separator,"aria-hidden":"true",children:yR}),a.url&&!o?c.jsx(ch,{className:Ri.link,to:a.url,title:a.label,children:a.label}):c.jsx("span",{className:Ri.current,"aria-current":"page",title:a.label,children:a.label})]},i)})})})}function Jf(){Jf=function(r,u){return new i(r,void 0,u)};var t=RegExp.prototype,a=new WeakMap;function i(r,u,d){var p=new RegExp(r,u);return a.set(p,d||a.get(r)),_c(p,i.prototype)}function o(r,u){var d=a.get(u);return Object.keys(d).reduce(function(p,m){var g=d[m];if(typeof g=="number")p[m]=r[g];else{for(var v=0;r[g[v]]===void 0&&v+1<g.length;)v++;p[m]=r[g[v]]}return p},Object.create(null))}return(function(r,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(u&&u.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),u&&_c(r,u)})(i,RegExp),i.prototype.exec=function(r){var u=t.exec.call(this,r);if(u){u.groups=o(u,this);var d=u.indices;d&&(d.groups=o(d,this))}return u},i.prototype[Symbol.replace]=function(r,u){if(typeof u=="string"){var d=a.get(this);return t[Symbol.replace].call(this,r,u.replace(/\$<([^>]+)>/g,function(m,g){var v=d[g];return"$"+(Array.isArray(v)?v.join("$"):v)}))}if(typeof u=="function"){var p=this;return t[Symbol.replace].call(this,r,function(){var m=arguments;return typeof m[m.length-1]!="object"&&(m=[].slice.call(m)).push(o(m,p)),u.apply(this,m)})}return t[Symbol.replace].call(this,r,u)},Jf.apply(this,arguments)}function _c(t,a){return _c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,o){return i.__proto__=o,i},_c(t,a)}function P0(t,a){(a==null||a>t.length)&&(a=t.length);for(var i=0,o=new Array(a);i<a;i++)o[i]=t[i];return o}function yf(t,a){var i=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=(function(r,u){if(r){if(typeof r=="string")return P0(r,u);var d=Object.prototype.toString.call(r).slice(8,-1);return d==="Object"&&r.constructor&&(d=r.constructor.name),d==="Map"||d==="Set"?Array.from(r):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?P0(r,u):void 0}})(t))||a){i&&(t=i);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
99
99
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var bR=(function(t){return function(a){return a===void 0&&(a={}),(function(o,r){if(r&&!o.registered(r))throw new Error('The default language "'+r+'" is not registered with refractor.')})(t,a.defaultLanguage),function(o){XS(o,"element",i)};function i(o,r,u){var d,p;if(u&&u.tagName==="pre"&&o.tagName==="code"){var m=(o==null||(d=o.data)==null?void 0:d.meta)||(o==null||(p=o.properties)==null?void 0:p.metastring)||"";o.properties.className?typeof o.properties.className=="boolean"?o.properties.className=[]:Array.isArray(o.properties.className)||(o.properties.className=[o.properties.className]):o.properties.className=[];var g,v,y=(function(A){for(var $,V=yf(A.properties.className);!($=V()).done;){var B=$.value;if(B.slice(0,9)==="language-")return B.slice(9).toLowerCase()}return null})(o);if(!y&&a.defaultLanguage&&o.properties.className.push("language-"+(y=a.defaultLanguage)),o.properties.className.push("code-highlight"),y)try{var b,S;S=(b=y)!=null&&b.includes("diff-")?y.split("-")[1]:y,g=t.highlight(Gr(o),S),u.properties.className=(u.properties.className||[]).concat("language-"+S)}catch(A){if(!a.ignoreMissing||!/Unknown language/.test(A.message))throw A;g=o}else g=o;g.children=(v=1,function A($){return $.reduce(function(V,B){if(B.type==="text"){var F=B.value,X=(F.match(/\n/g)||"").length;if(X===0)B.position={start:{line:v,column:1},end:{line:v,column:1}},V.push(B);else for(var J,te=F.split(`
100
100
  `),ee=yf(te.entries());!(J=ee()).done;){var z=J.value,ne=z[0],I=z[1];V.push({type:"text",value:ne===te.length-1?I:I+`
101
101
  `,position:{start:{line:v+ne,column:1},end:{line:v+ne,column:1}}})}return v+=X,V}if(Object.prototype.hasOwnProperty.call(B,"children")){var K=v;return B.children=A(B.children),V.push(B),B.position={start:{line:K,column:1},end:{line:v,column:1}},V}return V.push(B),V},[])})(g.children),g.position=g.children.length>0?{start:{line:g.children[0].position.start.line,column:0},end:{line:g.children[g.children.length-1].position.end.line,column:0}}:{start:{line:0,column:0},end:{line:0,column:0}};for(var T,C=(function(A){var $=/{([\d,-]+)}/,V=A.split(",").map(function(X){return X.trim()}).join();if($.test(V)){var B=$.exec(V)[1],F=WS(B);return function(X){return F.includes(X+1)}}return function(){return!1}})(m),N=(function(A){var $=Jf(/showLineNumbers=(\d+)/i,{lines:1});if($.test(A)){var V=$.exec(A);return Number(V.groups.lines)}return 1})(m),E=(function(A){for(var $=new Array(A),V=0;V<A;V++)$[V]={type:"element",tagName:"span",properties:{className:[]},children:[]};return $})(g.position.end.line),w=["showlinenumbers=false",'showlinenumbers="false"',"showlinenumbers={false}"],R=function(){var A,$,V=T.value,B=V[0],F=V[1];F.properties.className=["code-line"];var X=JS(g,function(J){return J.position.start.line<=B+1&&J.position.end.line>=B+1});F.children=X.children,(m.toLowerCase().includes("showLineNumbers".toLowerCase())||a.showLineNumbers===!0||typeof a.showLineNumbers=="object"&&a.showLineNumbers.includes(y))&&!w.some(function(J){return m.toLowerCase().includes(J)})&&(F.properties.line=[(B+N).toString()],F.properties.className.push("line-number")),C(B)&&F.properties.className.push("highlight-line"),(y==="diff"||(A=y)!=null&&A.includes("diff-"))&&Gr(F).substring(0,1)==="-"?F.properties.className.push("deleted"):(y==="diff"||($=y)!=null&&$.includes("diff-"))&&Gr(F).substring(0,1)==="+"&&F.properties.className.push("inserted")},M=yf(E.entries());!(T=M()).done;)R();E.length>0&&Gr(E[E.length-1]).trim()===""&&E.pop(),o.children=E}}}})(QS);function E_(t){if(t>=1e6)return`${(t/1e6).toFixed(1)}M`;if(t>=1e3){const a=Number((t/1e3).toFixed(1));return a>=1e3?`${(t/1e6).toFixed(1)}M`:`${a.toFixed(1)}k`}return String(t)}function Ki(t){return t===0?"-":t<.01?`$${t.toFixed(4)}`:`$${t.toFixed(2)}`}const xR="_systemContextEvent_1qbiw_1",_R="_systemContextHeader_1qbiw_7",SR="_systemContextBadge_1qbiw_28",TR="_systemContextToggle_1qbiw_37",kR="_systemContextPre_1qbiw_43",CR="_systemContextEllipsis_1qbiw_54",ER="_systemEvent_1qbiw_58",NR="_systemTimestamp_1qbiw_65",jR="_textEvent_1qbiw_69",wR="_toolUseEvent_1qbiw_155",AR="_toolUseHeader_1qbiw_175",DR="_toolUsePrefix_1qbiw_182",RR="_toolUseName_1qbiw_187",MR="_toolUseArgs_1qbiw_192",OR="_toolResultEvent_1qbiw_203",BR="_toolResultHeader_1qbiw_208",IR="_toolResultIndicatorOk_1qbiw_232",LR="_toolResultIndicatorError_1qbiw_239",UR="_toolResultLabel_1qbiw_246",zR="_toolResultToggle_1qbiw_250",VR="_toolResultCommand_1qbiw_256",HR="_toolResultEllipsis_1qbiw_266",PR="_toolResultPre_1qbiw_270",GR="_errorEvent_1qbiw_291",$R="_statusEvent_1qbiw_299",FR="_userInputEvent_1qbiw_308",qR="_userInputContent_1qbiw_314",KR="_signalEvent_1qbiw_331",YR="_signalBadge_1qbiw_342",ZR="_signalContent_1qbiw_351",XR="_usageEvent_1qbiw_356",QR="_usageBadge_1qbiw_363",WR="_defaultEvent_1qbiw_372",Le={systemContextEvent:xR,systemContextHeader:_R,systemContextBadge:SR,systemContextToggle:TR,systemContextPre:kR,systemContextEllipsis:CR,systemEvent:ER,systemTimestamp:NR,textEvent:jR,toolUseEvent:wR,toolUseHeader:AR,toolUsePrefix:DR,toolUseName:RR,toolUseArgs:MR,toolResultEvent:OR,toolResultHeader:BR,toolResultIndicatorOk:IR,toolResultIndicatorError:LR,toolResultLabel:UR,toolResultToggle:zR,toolResultCommand:VR,toolResultEllipsis:HR,toolResultPre:PR,errorEvent:GR,statusEvent:$R,userInputEvent:FR,userInputContent:qR,signalEvent:KR,signalBadge:YR,signalContent:ZR,usageEvent:XR,usageBadge:QR,defaultEvent:WR},G0=3;function JR({content:t}){const[a,i]=x.useState(!1),o=t.split(`
@@ -109,4 +109,4 @@ const grackle = await host.mcpServer({
109
109
  url: env.vars.GRACKLE_MCP_URL,
110
110
  });
111
111
 
112
- $\`Summarize the current tasks.\`;`,rows:20,className:Pe.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),c.jsxs("div",{className:Pe.formActions,children:[c.jsx("button",{type:"submit",className:Pe.btnPrimary,children:d?"Save":"Create"}),c.jsx("button",{type:"button",onClick:se,className:Pe.btnSecondary,children:"Cancel"})]})]});return c.jsxs("div",{className:Pe.container,children:[c.jsxs("div",{className:Pe.header,children:[c.jsx("h2",{children:"Personas"}),c.jsx("button",{onClick:ee,className:Pe.btnPrimary,children:"+ New Persona"})]}),(m||d)&&oe(),t.length===0&&!m?c.jsx("p",{className:Pe.empty,children:"No personas yet. Create one to get started."}):c.jsx("div",{className:Pe.list,children:t.map(j=>{const ie=r===j.id,pe=j.type==="script";return c.jsxs("div",{className:`${Pe.card} ${(d==null?void 0:d.id)===j.id?Pe.active:""}`,"data-testid":`persona-card-${j.id}`,children:[c.jsxs("div",{className:Pe.cardHeader,children:[c.jsxs("span",{className:Pe.cardTitle,children:[c.jsx("strong",{children:j.name}),c.jsx("span",{className:Pe.typeBadge,"data-testid":`persona-type-badge-${j.id}`,children:pe?"Script":"Agent"}),ie&&c.jsx("span",{className:Pe.defaultBadge,"data-testid":`persona-default-badge-${j.id}`,children:"App Default"})]}),c.jsxs("div",{className:Pe.cardActions,children:[!ie&&c.jsx("button",{onClick:()=>u(j.id),className:Pe.btnSmall,"data-testid":`persona-set-default-${j.id}`,title:"Set as app default persona",children:"Set Default"}),c.jsx("button",{onClick:()=>z(j),className:Pe.btnSmall,children:"Edit"}),v===j.id?c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>K(j.id),className:Pe.btnDanger,children:"Confirm"}),c.jsx("button",{onClick:()=>y(null),className:Pe.btnSmall,children:"Cancel"})]}):c.jsx("button",{onClick:()=>y(j.id),className:Pe.btnSmall,children:"Delete"})]})]}),j.description&&c.jsx("p",{className:Pe.description,children:j.description}),c.jsxs("div",{className:Pe.meta,children:[j.runtime&&c.jsxs("span",{children:["Runtime: ",j.runtime]}),j.model&&c.jsxs("span",{children:["Model: ",j.model]}),j.maxTurns>0&&c.jsxs("span",{children:["Max turns: ",j.maxTurns]})]}),pe?c.jsxs("details",{className:Pe.promptDetails,children:[c.jsx("summary",{children:"Script"}),c.jsx("pre",{className:Pe.promptText,children:j.script})]}):c.jsxs("details",{className:Pe.promptDetails,children:[c.jsx("summary",{children:"System Prompt"}),c.jsx("pre",{className:Pe.promptText,children:j.systemPrompt})]})]},j.id)})})]})}function bL(){return c.jsx(yL,{})}function xL(){const{themeId:t,resolvedThemeId:a,setTheme:i,preferSystem:o,setPreferSystem:r}=Db();return c.jsxs("section",{className:ue.section,children:[c.jsx("h3",{className:ue.sectionTitle,children:"Appearance"}),c.jsx("p",{className:ue.sectionDescription,children:"Choose how Grackle looks across the app."}),c.jsx("div",{className:ue.themeOptions,children:Ec.filter(u=>!u.hidden).map(u=>{const d=!!(u.variantLightId&&u.variantDarkId),p=d?t===u.id||t===u.variantLightId||t===u.variantDarkId:t===u.id,m=d&&a===u.variantLightId;return c.jsxs("button",{type:"button",className:`${ue.themeOption} ${p?ue.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>i(u.id),children:[c.jsxs("span",{className:ue.themeOptionHeader,children:[c.jsxs("span",{children:[c.jsx("span",{className:ue.themeOptionLabel,children:u.label}),c.jsx("span",{className:ue.themeOptionDesc,children:u.description})]}),d&&c.jsxs("span",{className:ue.variantToggle,children:[c.jsx("span",{role:"button",tabIndex:0,className:`${ue.variantButton} ${p&&m?ue.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantLightId))},"aria-label":"Light variant","aria-pressed":p&&m,children:"☼"}),c.jsx("span",{role:"button",tabIndex:0,className:`${ue.variantButton} ${p&&!m?ue.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),u.swatches&&c.jsx("span",{className:ue.themeSwatches,children:u.swatches.map((g,v)=>c.jsx("span",{className:ue.themeSwatch,style:{background:g}},v))})]},u.id)})}),c.jsxs("label",{className:ue.systemToggle,children:[c.jsx("input",{type:"checkbox",checked:o,onChange:u=>r(u.target.checked)}),c.jsx("span",{children:"Match system light/dark preference"})]}),c.jsx("p",{className:ue.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),c.jsxs("p",{className:ue.themeActive,children:["Active theme: ",c.jsx("strong",{children:a})]})]})}function _L(){return c.jsx(xL,{})}function SL(){const{connected:t,environments:a,sessions:i}=We(),o=a.filter(d=>d.status==="connected").length,r=a.length,u=i.filter(d=>["running","idle"].includes(d.status)).length;return c.jsxs("section",{className:ue.section,"data-testid":"about-panel",children:[c.jsx("h3",{className:ue.sectionTitle,children:"About"}),c.jsx("p",{className:ue.sectionDescription,children:"Connection status and application information."}),c.jsxs("div",{className:ue.aboutGrid,children:[c.jsxs("div",{className:ue.aboutItem,children:[c.jsx("span",{className:ue.aboutLabel,children:"Connection"}),c.jsxs("span",{className:ue.aboutValue,children:[c.jsx("span",{className:`${ue.aboutDot} ${t?ue.aboutDotConnected:ue.aboutDotDisconnected}`}),t?"Connected":"Disconnected"]})]}),c.jsxs("div",{className:ue.aboutItem,children:[c.jsx("span",{className:ue.aboutLabel,children:"Environments"}),c.jsxs("span",{className:ue.aboutValue,children:[o,"/",r," connected"]})]}),c.jsxs("div",{className:ue.aboutItem,children:[c.jsx("span",{className:ue.aboutLabel,children:"Active Sessions"}),c.jsx("span",{className:ue.aboutValue,children:u})]}),c.jsxs("div",{className:ue.aboutItem,children:[c.jsx("span",{className:ue.aboutLabel,children:"Version"}),c.jsx("span",{className:ue.aboutValue,children:"0.72.5"})]})]})]})}function TL(){return c.jsx(SL,{})}const kL="_wizard_1260s_1",CL="_container_1260s_10",EL="_stepContent_1260s_19",NL="_logoArea_1260s_28",jL="_logoImage_1260s_32",wL="_heading_1260s_41",AL="_tagline_1260s_49",DL="_subtitle_1260s_56",RL="_featureList_1260s_64",ML="_runtimeGrid_1260s_89",OL="_runtimeCard_1260s_101",BL="_runtimeName_1260s_133",IL="_runtimeDescription_1260s_139",LL="_buttonRow_1260s_144",UL="_primaryButton_1260s_151",zL="_ghostButton_1260s_185",VL="_dots_1260s_213",HL="_dot_1260s_213",tt={wizard:kL,container:CL,stepContent:EL,logoArea:NL,logoImage:jL,heading:wL,tagline:AL,subtitle:DL,featureList:RL,runtimeGrid:ML,runtimeCard:OL,runtimeName:BL,runtimeDescription:IL,buttonRow:LL,primaryButton:UL,ghostButton:zL,dots:VL,dot:HL};function PL({onNext:t}){return c.jsxs("div",{className:tt.stepContent,"data-testid":"setup-welcome",children:[c.jsx("div",{className:tt.logoArea,children:c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:tt.logoImage})}),c.jsx("h1",{className:tt.heading,children:"Welcome to Grackle"}),c.jsx("p",{className:tt.tagline,children:"Multi-agent orchestration for software teams"}),c.jsx("button",{type:"button",className:tt.primaryButton,onClick:t,"data-testid":"setup-get-started",children:"Get Started"})]})}function GL({onNext:t,onBack:a}){return c.jsxs("div",{className:tt.stepContent,"data-testid":"setup-about",children:[c.jsx("h2",{className:tt.heading,children:"What is Grackle?"}),c.jsxs("ul",{className:tt.featureList,children:[c.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),c.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),c.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),c.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),c.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),c.jsxs("div",{className:tt.buttonRow,children:[c.jsx("button",{type:"button",className:tt.ghostButton,onClick:a,children:"Back"}),c.jsx("button",{type:"button",className:tt.primaryButton,onClick:t,"data-testid":"setup-about-next",children:"Next"})]})]})}const $L=[{id:"claude-code",name:"Claude Code",description:"Anthropic's agentic coding tool"},{id:"copilot",name:"Copilot Coding Agent",description:"GitHub's AI pair programmer"},{id:"codex",name:"Codex CLI",description:"OpenAI's coding agent"},{id:"goose",name:"Goose",description:"Block's open-source AI coding agent"}];function FL({currentRuntime:t,onFinish:a,onBack:i,finishDisabled:o}){const[r,u]=x.useState(t||"claude-code");return x.useEffect(()=>{t&&u(t)},[t]),c.jsxs("div",{className:tt.stepContent,"data-testid":"setup-runtime",children:[c.jsx("h2",{className:tt.heading,children:"Choose Your Runtime"}),c.jsx("p",{className:tt.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),c.jsx("div",{className:tt.runtimeGrid,children:$L.map(d=>c.jsxs("button",{type:"button",className:tt.runtimeCard,"data-selected":r===d.id,"aria-pressed":r===d.id,"data-testid":`runtime-card-${d.id}`,onClick:()=>u(d.id),children:[c.jsx("span",{className:tt.runtimeName,children:d.name}),c.jsx("span",{className:tt.runtimeDescription,children:d.description})]},d.id))}),c.jsxs("div",{className:tt.buttonRow,children:[c.jsx("button",{type:"button",className:tt.ghostButton,onClick:i,children:"Back"}),c.jsx("button",{type:"button",className:tt.primaryButton,onClick:()=>a(r),disabled:o,"data-testid":"setup-finish",children:"Finish"})]})]})}const qL=3,eb={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function KL(){const{personas:t,updatePersona:a,completeOnboarding:i,onboardingCompleted:o}=We(),r=Rt(),[u,d]=x.useState(0),p=t.find(g=>g.id==="claude-code"),m=x.useCallback(g=>{if(p&&g!==p.runtime){const y=eb[g]??"sonnet";a(p.id,void 0,void 0,void 0,g,y)}const v=t.find(y=>y.id===O0);if(v&&g!==v.runtime){const y=eb[g]??"sonnet";a(O0,void 0,void 0,void 0,g,y)}i(),r("/",{replace:!0})},[p,t,a,i,r]);return o===!0?c.jsx($n,{to:"/",replace:!0}):c.jsx("div",{className:tt.wizard,"data-testid":"setup-wizard",children:c.jsxs("div",{className:tt.container,children:[c.jsx(Qn,{mode:"wait",children:c.jsxs(Ct.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[u===0&&c.jsx(PL,{onNext:()=>d(1)}),u===1&&c.jsx(GL,{onNext:()=>d(2),onBack:()=>d(0)}),u===2&&c.jsx(FL,{currentRuntime:(p==null?void 0:p.runtime)??"claude-code",onFinish:m,onBack:()=>d(1),finishDisabled:!p})]},u)}),c.jsx("div",{className:tt.dots,children:Array.from({length:qL},(g,v)=>c.jsx("span",{className:tt.dot,"data-active":v===u},v))})]})})}const YL="_root_zndgp_1",ZL="_body_zndgp_7",XL="_main_zndgp_19",QL="_sidebarWrapper_zndgp_26",WL="_overlay_zndgp_51",sl={root:YL,body:ZL,main:XL,sidebarWrapper:QL,overlay:WL},JL=x.lazy(()=>hT(()=>import("./KnowledgePage-DTUHQ8rc.js"),__vite__mapDeps([0,1,2,3])).then(t=>({default:t.KnowledgePage}))),e8=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function t8(){const t=wt(),i=Ob()!==void 0,[o,r]=x.useState(!1),u=x.useCallback(()=>r(d=>!d),[]);return x.useEffect(()=>{r(!1)},[t.pathname]),x.useEffect(()=>{if(!o)return;const d=p=>{p.key==="Escape"&&r(!1)};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[o]),c.jsxs(c.Fragment,{children:[c.jsx(eE,{onToggleSidebar:i?u:void 0,sidebarOpen:o}),c.jsx(lE,{}),c.jsxs("div",{className:sl.body,children:[i&&c.jsx("div",{className:sl.sidebarWrapper,"data-sidebar-open":o,children:c.jsx(mE,{})}),i&&o&&c.jsx("div",{className:sl.overlay,"data-testid":"drawer-overlay",onClick:()=>r(!1)}),c.jsxs("div",{className:sl.main,children:[c.jsx(Us,{}),c.jsx(WD,{})]})]}),c.jsx(dR,{})]})}function n8(){const{lastSpawnedId:t,environments:a,connected:i,onboardingCompleted:o}=We(),{showToast:r}=zs();NM(a,r);const u=Rt(),d=wt();return x.useEffect(()=>{t&&!d.pathname.includes("/tasks/")&&u(_b(t),{replace:!0})},[t,u,d.pathname]),i&&o===!1?c.jsx($n,{to:"/setup",replace:!0}):c.jsx(rE,{children:c.jsx("div",{className:sl.root,children:c.jsx(t8,{})})})}function Tf(){const{workspaceId:t}=is(),{workspaces:a}=We(),i=wt(),o=a.find(m=>m.id===t);if(!(o!=null&&o.environmentId))return a.length===0?void 0:c.jsx($n,{to:"/environments",replace:!0});const r=encodeURIComponent(t),u=`/workspaces/${r}`,d=i.pathname.startsWith(u)?i.pathname.slice(u.length):"",p=`/environments/${encodeURIComponent(o.environmentId)}/workspaces/${r}${d}${i.search}${i.hash}`;return c.jsx($n,{to:p,replace:!0})}function a8(){return c.jsxs(kk,{children:[c.jsx(ke,{path:"setup",element:c.jsx(KL,{})}),c.jsxs(ke,{element:c.jsx(n8,{}),children:[c.jsx(ke,{index:!0,element:c.jsx(eB,{})}),c.jsx(ke,{path:"chat",element:c.jsx(wB,{})}),c.jsx(ke,{path:"sessions/new",element:c.jsx(LB,{})}),c.jsx(ke,{path:"sessions/:sessionId",element:c.jsx(VB,{})}),c.jsx(ke,{element:c.jsx($D,{}),children:c.jsx(ke,{path:"knowledge",element:c.jsx(x.Suspense,{fallback:c.jsx(j_,{}),children:c.jsx(JL,{})})})}),c.jsxs(ke,{element:c.jsx(HD,{}),children:[c.jsx(ke,{path:"tasks",element:c.jsx(WO,{})}),c.jsx(ke,{path:"tasks/new",element:c.jsx(X0,{})}),c.jsx(ke,{path:"tasks/:taskId",element:c.jsx(Mi,{})}),c.jsx(ke,{path:"tasks/:taskId/stream",element:c.jsx(Mi,{})}),c.jsx(ke,{path:"tasks/:taskId/findings",element:c.jsx(Mi,{})}),c.jsx(ke,{path:"tasks/:taskId/edit",element:c.jsx(Q0,{})})]}),c.jsxs(ke,{element:c.jsx(PD,{}),children:[c.jsx(ke,{path:"workspaces",element:c.jsx($n,{to:"/environments",replace:!0})}),c.jsx(ke,{path:"workspaces/new",element:c.jsx(HI,{})}),c.jsx(ke,{path:"workspaces/:workspaceId",element:c.jsx(Tf,{})}),c.jsx(ke,{path:"workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Tf,{})}),c.jsx(ke,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:c.jsx(Tf,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId",element:c.jsx(iI,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:c.jsx(X0,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Mi,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:c.jsx(Mi,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:c.jsx(Mi,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:c.jsx(Q0,{})}),c.jsxs(ke,{path:"environments",element:c.jsx(w4,{}),children:[c.jsx(ke,{index:!0,element:c.jsx(JO,{})}),c.jsx(ke,{path:"new",element:c.jsx(k4,{})}),c.jsx(ke,{path:":environmentId",element:c.jsx(a5,{})}),c.jsx(ke,{path:":environmentId/edit",element:c.jsx(C4,{})})]})]}),c.jsx(ke,{element:c.jsx(GD,{}),children:c.jsxs(ke,{path:"settings",element:c.jsx(o5,{}),children:[c.jsx(ke,{index:!0,element:c.jsx($n,{to:"credentials",replace:!0})}),c.jsx(ke,{path:"environments",element:c.jsx($n,{to:"/environments",replace:!0})}),c.jsx(ke,{path:"credentials",element:c.jsx(K5,{})}),c.jsx(ke,{path:"tokens",element:c.jsx($n,{to:"../credentials",replace:!0})}),c.jsx(ke,{path:"personas",element:c.jsx(bL,{})}),c.jsx(ke,{path:"appearance",element:c.jsx(_L,{})}),c.jsx(ke,{path:"about",element:c.jsx(TL,{})})]})}),c.jsx(ke,{path:"*",element:c.jsx($n,{to:"/",replace:!0})})]})]})}const s8=1e4;function i8(){const{onboardingCompleted:t}=We(),[a,i]=x.useState(!1);x.useEffect(()=>{if(t!==void 0)return;const r=setTimeout(()=>i(!0),s8);return()=>clearTimeout(r)},[t]);const o=t===void 0&&!a;return c.jsx(Qn,{mode:"wait",children:o?c.jsx(Ct.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:c.jsx(j_,{})},"splash"):c.jsx(Ct.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:c.jsx(Zk,{children:c.jsx(a8,{})})},"app")})}function o8(){const t=e8?UC:wC;return c.jsx($C,{children:c.jsx(VC,{children:c.jsx(t,{children:c.jsx(i8,{})})})})}uT.createRoot(document.getElementById("root")).render(c.jsx(x.StrictMode,{children:c.jsx(o8,{})}));export{Hs as B,kb as K,We as a,_b as s,_a as t,Rt as u};
112
+ $\`Summarize the current tasks.\`;`,rows:20,className:Pe.scriptEditor,required:!0,"data-testid":"persona-script-editor"})]})]}),c.jsxs("div",{className:Pe.formActions,children:[c.jsx("button",{type:"submit",className:Pe.btnPrimary,children:d?"Save":"Create"}),c.jsx("button",{type:"button",onClick:se,className:Pe.btnSecondary,children:"Cancel"})]})]});return c.jsxs("div",{className:Pe.container,children:[c.jsxs("div",{className:Pe.header,children:[c.jsx("h2",{children:"Personas"}),c.jsx("button",{onClick:ee,className:Pe.btnPrimary,children:"+ New Persona"})]}),(m||d)&&oe(),t.length===0&&!m?c.jsx("p",{className:Pe.empty,children:"No personas yet. Create one to get started."}):c.jsx("div",{className:Pe.list,children:t.map(j=>{const ie=r===j.id,pe=j.type==="script";return c.jsxs("div",{className:`${Pe.card} ${(d==null?void 0:d.id)===j.id?Pe.active:""}`,"data-testid":`persona-card-${j.id}`,children:[c.jsxs("div",{className:Pe.cardHeader,children:[c.jsxs("span",{className:Pe.cardTitle,children:[c.jsx("strong",{children:j.name}),c.jsx("span",{className:Pe.typeBadge,"data-testid":`persona-type-badge-${j.id}`,children:pe?"Script":"Agent"}),ie&&c.jsx("span",{className:Pe.defaultBadge,"data-testid":`persona-default-badge-${j.id}`,children:"App Default"})]}),c.jsxs("div",{className:Pe.cardActions,children:[!ie&&c.jsx("button",{onClick:()=>u(j.id),className:Pe.btnSmall,"data-testid":`persona-set-default-${j.id}`,title:"Set as app default persona",children:"Set Default"}),c.jsx("button",{onClick:()=>z(j),className:Pe.btnSmall,children:"Edit"}),v===j.id?c.jsxs(c.Fragment,{children:[c.jsx("button",{onClick:()=>K(j.id),className:Pe.btnDanger,children:"Confirm"}),c.jsx("button",{onClick:()=>y(null),className:Pe.btnSmall,children:"Cancel"})]}):c.jsx("button",{onClick:()=>y(j.id),className:Pe.btnSmall,children:"Delete"})]})]}),j.description&&c.jsx("p",{className:Pe.description,children:j.description}),c.jsxs("div",{className:Pe.meta,children:[j.runtime&&c.jsxs("span",{children:["Runtime: ",j.runtime]}),j.model&&c.jsxs("span",{children:["Model: ",j.model]}),j.maxTurns>0&&c.jsxs("span",{children:["Max turns: ",j.maxTurns]})]}),pe?c.jsxs("details",{className:Pe.promptDetails,children:[c.jsx("summary",{children:"Script"}),c.jsx("pre",{className:Pe.promptText,children:j.script})]}):c.jsxs("details",{className:Pe.promptDetails,children:[c.jsx("summary",{children:"System Prompt"}),c.jsx("pre",{className:Pe.promptText,children:j.systemPrompt})]})]},j.id)})})]})}function bL(){return c.jsx(yL,{})}function xL(){const{themeId:t,resolvedThemeId:a,setTheme:i,preferSystem:o,setPreferSystem:r}=Db();return c.jsxs("section",{className:ue.section,children:[c.jsx("h3",{className:ue.sectionTitle,children:"Appearance"}),c.jsx("p",{className:ue.sectionDescription,children:"Choose how Grackle looks across the app."}),c.jsx("div",{className:ue.themeOptions,children:Ec.filter(u=>!u.hidden).map(u=>{const d=!!(u.variantLightId&&u.variantDarkId),p=d?t===u.id||t===u.variantLightId||t===u.variantDarkId:t===u.id,m=d&&a===u.variantLightId;return c.jsxs("button",{type:"button",className:`${ue.themeOption} ${p?ue.themeOptionSelected:""}`,"aria-pressed":p,onClick:()=>i(u.id),children:[c.jsxs("span",{className:ue.themeOptionHeader,children:[c.jsxs("span",{children:[c.jsx("span",{className:ue.themeOptionLabel,children:u.label}),c.jsx("span",{className:ue.themeOptionDesc,children:u.description})]}),d&&c.jsxs("span",{className:ue.variantToggle,children:[c.jsx("span",{role:"button",tabIndex:0,className:`${ue.variantButton} ${p&&m?ue.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantLightId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantLightId))},"aria-label":"Light variant","aria-pressed":p&&m,children:"☼"}),c.jsx("span",{role:"button",tabIndex:0,className:`${ue.variantButton} ${p&&!m?ue.variantActive:""}`,onClick:g=>{g.stopPropagation(),r(!1),i(u.variantDarkId)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),g.stopPropagation(),r(!1),i(u.variantDarkId))},"aria-label":"Dark variant","aria-pressed":p&&!m,children:"☾"})]})]}),u.swatches&&c.jsx("span",{className:ue.themeSwatches,children:u.swatches.map((g,v)=>c.jsx("span",{className:ue.themeSwatch,style:{background:g}},v))})]},u.id)})}),c.jsxs("label",{className:ue.systemToggle,children:[c.jsx("input",{type:"checkbox",checked:o,onChange:u=>r(u.target.checked)}),c.jsx("span",{children:"Match system light/dark preference"})]}),c.jsx("p",{className:ue.systemToggleHint,children:"Automatically switches between light and dark variants when available."}),c.jsxs("p",{className:ue.themeActive,children:["Active theme: ",c.jsx("strong",{children:a})]})]})}function _L(){return c.jsx(xL,{})}function SL({connected:t,environments:a,sessions:i}){const o=a.filter(d=>d.status==="connected").length,r=a.length,u=i.filter(d=>["running","idle"].includes(d.status)).length;return c.jsxs("section",{className:ue.section,"data-testid":"about-panel",children:[c.jsx("h3",{className:ue.sectionTitle,children:"About"}),c.jsx("p",{className:ue.sectionDescription,children:"Connection status and application information."}),c.jsxs("div",{className:ue.aboutGrid,children:[c.jsxs("div",{className:ue.aboutItem,children:[c.jsx("span",{className:ue.aboutLabel,children:"Connection"}),c.jsxs("span",{className:ue.aboutValue,children:[c.jsx("span",{className:`${ue.aboutDot} ${t?ue.aboutDotConnected:ue.aboutDotDisconnected}`}),t?"Connected":"Disconnected"]})]}),c.jsxs("div",{className:ue.aboutItem,children:[c.jsx("span",{className:ue.aboutLabel,children:"Environments"}),c.jsxs("span",{className:ue.aboutValue,children:[o,"/",r," connected"]})]}),c.jsxs("div",{className:ue.aboutItem,children:[c.jsx("span",{className:ue.aboutLabel,children:"Active Sessions"}),c.jsx("span",{className:ue.aboutValue,children:u})]}),c.jsxs("div",{className:ue.aboutItem,children:[c.jsx("span",{className:ue.aboutLabel,children:"Version"}),c.jsx("span",{className:ue.aboutValue,children:"0.73.0"})]})]})]})}function TL(){const{connected:t,environments:a,sessions:i}=We();return c.jsx(SL,{connected:t,environments:a,sessions:i})}const kL="_wizard_1260s_1",CL="_container_1260s_10",EL="_stepContent_1260s_19",NL="_logoArea_1260s_28",jL="_logoImage_1260s_32",wL="_heading_1260s_41",AL="_tagline_1260s_49",DL="_subtitle_1260s_56",RL="_featureList_1260s_64",ML="_runtimeGrid_1260s_89",OL="_runtimeCard_1260s_101",BL="_runtimeName_1260s_133",IL="_runtimeDescription_1260s_139",LL="_buttonRow_1260s_144",UL="_primaryButton_1260s_151",zL="_ghostButton_1260s_185",VL="_dots_1260s_213",HL="_dot_1260s_213",tt={wizard:kL,container:CL,stepContent:EL,logoArea:NL,logoImage:jL,heading:wL,tagline:AL,subtitle:DL,featureList:RL,runtimeGrid:ML,runtimeCard:OL,runtimeName:BL,runtimeDescription:IL,buttonRow:LL,primaryButton:UL,ghostButton:zL,dots:VL,dot:HL};function PL({onNext:t}){return c.jsxs("div",{className:tt.stepContent,"data-testid":"setup-welcome",children:[c.jsx("div",{className:tt.logoArea,children:c.jsx("img",{src:"/grackle-logo.png",alt:"Grackle",className:tt.logoImage})}),c.jsx("h1",{className:tt.heading,children:"Welcome to Grackle"}),c.jsx("p",{className:tt.tagline,children:"Multi-agent orchestration for software teams"}),c.jsx("button",{type:"button",className:tt.primaryButton,onClick:t,"data-testid":"setup-get-started",children:"Get Started"})]})}function GL({onNext:t,onBack:a}){return c.jsxs("div",{className:tt.stepContent,"data-testid":"setup-about",children:[c.jsx("h2",{className:tt.heading,children:"What is Grackle?"}),c.jsxs("ul",{className:tt.featureList,children:[c.jsx("li",{children:"Run Claude, Copilot, and Codex agents side by side"}),c.jsx("li",{children:"Provision and control dev environments — SSH, Codespaces, or local"}),c.jsx("li",{children:"Organize work into workspaces with agent-executable tasks"}),c.jsx("li",{children:"Customize agent behavior with personas, tools, and MCP servers"}),c.jsx("li",{children:"Live-stream agent sessions with full terminal replay"})]}),c.jsxs("div",{className:tt.buttonRow,children:[c.jsx("button",{type:"button",className:tt.ghostButton,onClick:a,children:"Back"}),c.jsx("button",{type:"button",className:tt.primaryButton,onClick:t,"data-testid":"setup-about-next",children:"Next"})]})]})}const $L=[{id:"claude-code",name:"Claude Code",description:"Anthropic's agentic coding tool"},{id:"copilot",name:"Copilot Coding Agent",description:"GitHub's AI pair programmer"},{id:"codex",name:"Codex CLI",description:"OpenAI's coding agent"},{id:"goose",name:"Goose",description:"Block's open-source AI coding agent"}];function FL({currentRuntime:t,onFinish:a,onBack:i,finishDisabled:o}){const[r,u]=x.useState(t||"claude-code");return x.useEffect(()=>{t&&u(t)},[t]),c.jsxs("div",{className:tt.stepContent,"data-testid":"setup-runtime",children:[c.jsx("h2",{className:tt.heading,children:"Choose Your Runtime"}),c.jsx("p",{className:tt.subtitle,children:"Select the primary agent runtime for your workspace. You can change this later."}),c.jsx("div",{className:tt.runtimeGrid,children:$L.map(d=>c.jsxs("button",{type:"button",className:tt.runtimeCard,"data-selected":r===d.id,"aria-pressed":r===d.id,"data-testid":`runtime-card-${d.id}`,onClick:()=>u(d.id),children:[c.jsx("span",{className:tt.runtimeName,children:d.name}),c.jsx("span",{className:tt.runtimeDescription,children:d.description})]},d.id))}),c.jsxs("div",{className:tt.buttonRow,children:[c.jsx("button",{type:"button",className:tt.ghostButton,onClick:i,children:"Back"}),c.jsx("button",{type:"button",className:tt.primaryButton,onClick:()=>a(r),disabled:o,"data-testid":"setup-finish",children:"Finish"})]})]})}const qL=3,eb={"claude-code":"sonnet",copilot:"gpt-4o",codex:"o3",goose:""};function KL(){const{personas:t,updatePersona:a,completeOnboarding:i,onboardingCompleted:o}=We(),r=Rt(),[u,d]=x.useState(0),p=t.find(g=>g.id==="claude-code"),m=x.useCallback(g=>{if(p&&g!==p.runtime){const y=eb[g]??"sonnet";a(p.id,void 0,void 0,void 0,g,y)}const v=t.find(y=>y.id===O0);if(v&&g!==v.runtime){const y=eb[g]??"sonnet";a(O0,void 0,void 0,void 0,g,y)}i(),r("/",{replace:!0})},[p,t,a,i,r]);return o===!0?c.jsx($n,{to:"/",replace:!0}):c.jsx("div",{className:tt.wizard,"data-testid":"setup-wizard",children:c.jsxs("div",{className:tt.container,children:[c.jsx(Qn,{mode:"wait",children:c.jsxs(Ct.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.2,ease:"easeInOut"},children:[u===0&&c.jsx(PL,{onNext:()=>d(1)}),u===1&&c.jsx(GL,{onNext:()=>d(2),onBack:()=>d(0)}),u===2&&c.jsx(FL,{currentRuntime:(p==null?void 0:p.runtime)??"claude-code",onFinish:m,onBack:()=>d(1),finishDisabled:!p})]},u)}),c.jsx("div",{className:tt.dots,children:Array.from({length:qL},(g,v)=>c.jsx("span",{className:tt.dot,"data-active":v===u},v))})]})})}const YL="_root_zndgp_1",ZL="_body_zndgp_7",XL="_main_zndgp_19",QL="_sidebarWrapper_zndgp_26",WL="_overlay_zndgp_51",sl={root:YL,body:ZL,main:XL,sidebarWrapper:QL,overlay:WL},JL=x.lazy(()=>hT(()=>import("./KnowledgePage-DHgwsoTN.js"),__vite__mapDeps([0,1,2,3])).then(t=>({default:t.KnowledgePage}))),e8=typeof window<"u"&&new URLSearchParams(window.location.search).has("mock");function t8(){const{connected:t,environments:a,sessions:i}=We(),o=wt(),u=Ob()!==void 0,[d,p]=x.useState(!1),m=x.useCallback(()=>p(g=>!g),[]);return x.useEffect(()=>{p(!1)},[o.pathname]),x.useEffect(()=>{if(!d)return;const g=v=>{v.key==="Escape"&&p(!1)};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[d]),c.jsxs(c.Fragment,{children:[c.jsx(eE,{connected:t,environments:a,sessions:i,onToggleSidebar:u?m:void 0,sidebarOpen:d}),c.jsx(lE,{}),c.jsxs("div",{className:sl.body,children:[u&&c.jsx("div",{className:sl.sidebarWrapper,"data-sidebar-open":d,children:c.jsx(mE,{})}),u&&d&&c.jsx("div",{className:sl.overlay,"data-testid":"drawer-overlay",onClick:()=>p(!1)}),c.jsxs("div",{className:sl.main,children:[c.jsx(Us,{}),c.jsx(WD,{})]})]}),c.jsx(dR,{})]})}function n8(){const{lastSpawnedId:t,environments:a,connected:i,onboardingCompleted:o}=We(),{showToast:r}=zs();NM(a,r);const u=Rt(),d=wt();return x.useEffect(()=>{t&&!d.pathname.includes("/tasks/")&&u(_b(t),{replace:!0})},[t,u,d.pathname]),i&&o===!1?c.jsx($n,{to:"/setup",replace:!0}):c.jsx(rE,{children:c.jsx("div",{className:sl.root,children:c.jsx(t8,{})})})}function Tf(){const{workspaceId:t}=is(),{workspaces:a}=We(),i=wt(),o=a.find(m=>m.id===t);if(!(o!=null&&o.environmentId))return a.length===0?void 0:c.jsx($n,{to:"/environments",replace:!0});const r=encodeURIComponent(t),u=`/workspaces/${r}`,d=i.pathname.startsWith(u)?i.pathname.slice(u.length):"",p=`/environments/${encodeURIComponent(o.environmentId)}/workspaces/${r}${d}${i.search}${i.hash}`;return c.jsx($n,{to:p,replace:!0})}function a8(){return c.jsxs(kk,{children:[c.jsx(ke,{path:"setup",element:c.jsx(KL,{})}),c.jsxs(ke,{element:c.jsx(n8,{}),children:[c.jsx(ke,{index:!0,element:c.jsx(eB,{})}),c.jsx(ke,{path:"chat",element:c.jsx(wB,{})}),c.jsx(ke,{path:"sessions/new",element:c.jsx(LB,{})}),c.jsx(ke,{path:"sessions/:sessionId",element:c.jsx(VB,{})}),c.jsx(ke,{element:c.jsx($D,{}),children:c.jsx(ke,{path:"knowledge",element:c.jsx(x.Suspense,{fallback:c.jsx(j_,{}),children:c.jsx(JL,{})})})}),c.jsxs(ke,{element:c.jsx(HD,{}),children:[c.jsx(ke,{path:"tasks",element:c.jsx(WO,{})}),c.jsx(ke,{path:"tasks/new",element:c.jsx(X0,{})}),c.jsx(ke,{path:"tasks/:taskId",element:c.jsx(Mi,{})}),c.jsx(ke,{path:"tasks/:taskId/stream",element:c.jsx(Mi,{})}),c.jsx(ke,{path:"tasks/:taskId/findings",element:c.jsx(Mi,{})}),c.jsx(ke,{path:"tasks/:taskId/edit",element:c.jsx(Q0,{})})]}),c.jsxs(ke,{element:c.jsx(PD,{}),children:[c.jsx(ke,{path:"workspaces",element:c.jsx($n,{to:"/environments",replace:!0})}),c.jsx(ke,{path:"workspaces/new",element:c.jsx(HI,{})}),c.jsx(ke,{path:"workspaces/:workspaceId",element:c.jsx(Tf,{})}),c.jsx(ke,{path:"workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Tf,{})}),c.jsx(ke,{path:"workspaces/:workspaceId/tasks/:taskId/*",element:c.jsx(Tf,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId",element:c.jsx(iI,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/new",element:c.jsx(X0,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId",element:c.jsx(Mi,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/stream",element:c.jsx(Mi,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/findings",element:c.jsx(Mi,{})}),c.jsx(ke,{path:"environments/:environmentId/workspaces/:workspaceId/tasks/:taskId/edit",element:c.jsx(Q0,{})}),c.jsxs(ke,{path:"environments",element:c.jsx(w4,{}),children:[c.jsx(ke,{index:!0,element:c.jsx(JO,{})}),c.jsx(ke,{path:"new",element:c.jsx(k4,{})}),c.jsx(ke,{path:":environmentId",element:c.jsx(a5,{})}),c.jsx(ke,{path:":environmentId/edit",element:c.jsx(C4,{})})]})]}),c.jsx(ke,{element:c.jsx(GD,{}),children:c.jsxs(ke,{path:"settings",element:c.jsx(o5,{}),children:[c.jsx(ke,{index:!0,element:c.jsx($n,{to:"credentials",replace:!0})}),c.jsx(ke,{path:"environments",element:c.jsx($n,{to:"/environments",replace:!0})}),c.jsx(ke,{path:"credentials",element:c.jsx(K5,{})}),c.jsx(ke,{path:"tokens",element:c.jsx($n,{to:"../credentials",replace:!0})}),c.jsx(ke,{path:"personas",element:c.jsx(bL,{})}),c.jsx(ke,{path:"appearance",element:c.jsx(_L,{})}),c.jsx(ke,{path:"about",element:c.jsx(TL,{})})]})}),c.jsx(ke,{path:"*",element:c.jsx($n,{to:"/",replace:!0})})]})]})}const s8=1e4;function i8(){const{onboardingCompleted:t}=We(),[a,i]=x.useState(!1);x.useEffect(()=>{if(t!==void 0)return;const r=setTimeout(()=>i(!0),s8);return()=>clearTimeout(r)},[t]);const o=t===void 0&&!a;return c.jsx(Qn,{mode:"wait",children:o?c.jsx(Ct.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:c.jsx(j_,{})},"splash"):c.jsx(Ct.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.25},style:{minHeight:"100vh"},children:c.jsx(Zk,{children:c.jsx(a8,{})})},"app")})}function o8(){const t=e8?UC:wC;return c.jsx($C,{children:c.jsx(VC,{children:c.jsx(t,{children:c.jsx(i8,{})})})})}uT.createRoot(document.getElementById("root")).render(c.jsx(x.StrictMode,{children:c.jsx(o8,{})}));export{Hs as B,kb as K,We as a,_b as s,_a as t,Rt as u};