@tom2012/cc-web 2026.4.27-e → 2026.4.28-a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/README.md +1 -1
  2. package/backend/dist/terminal-manager.d.ts +8 -0
  3. package/backend/dist/terminal-manager.d.ts.map +1 -1
  4. package/backend/dist/terminal-manager.js +45 -3
  5. package/backend/dist/terminal-manager.js.map +1 -1
  6. package/frontend/dist/assets/ChatOverlay-DLTaht2F.js +13 -0
  7. package/frontend/dist/assets/{GraphPreview-jBgcKX7j.js → GraphPreview-YHACc4fD.js} +2 -2
  8. package/frontend/dist/assets/MobilePage-BDF46huS.js +14 -0
  9. package/frontend/dist/assets/{OfficePreview-DrS64ehu.js → OfficePreview-Cx0D9i0b.js} +2 -2
  10. package/frontend/dist/assets/{ProjectPage-ByY_pKon.js → ProjectPage-DU3hIK6T.js} +5 -5
  11. package/frontend/dist/assets/{SettingsPage-DCsamoIN.js → SettingsPage-CUwyxiSi.js} +3 -3
  12. package/frontend/dist/assets/{SkillHubPage-ChEG3UXF.js → SkillHubPage-Ddukc0En.js} +3 -3
  13. package/frontend/dist/assets/{chevron-down-CxkiZ1SD.js → chevron-down-DLHeMcVR.js} +1 -1
  14. package/frontend/dist/assets/{chevron-up-BZkUJHec.js → index-C5okOgHG.js} +3 -3
  15. package/frontend/dist/assets/{index-Bi0Lxaim.js → index-CKoHQn_E.js} +2 -2
  16. package/frontend/dist/assets/index-Cpk6vzEf.js +13 -0
  17. package/frontend/dist/assets/{index-DupxITkq.js → index-JdwfSZfN.js} +1 -1
  18. package/frontend/dist/assets/{jszip.min-Cm3MH9ZY.js → jszip.min-eFQumMwe.js} +1 -1
  19. package/frontend/dist/assets/{search-CSdU5BiW.js → search-Dvs7wLZq.js} +1 -1
  20. package/frontend/dist/index.html +1 -1
  21. package/package.json +1 -1
  22. package/frontend/dist/assets/AssistantMessageContent-fk_C4oct.js +0 -13
  23. package/frontend/dist/assets/MobilePage-Cy7KRgH_.js +0 -14
  24. package/frontend/dist/assets/index-DsCTP_lW.js +0 -13
  25. /package/frontend/dist/assets/{AssistantMessageContent-wklAmtGL.css → ChatOverlay-wklAmtGL.css} +0 -0
@@ -1,14 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OfficePreview-DrS64ehu.js","assets/index-Bi0Lxaim.js","assets/index-BJDTvhqr.css","assets/purify.es-CgRAQgUo.js"])))=>i.map(i=>d[i]);
2
- import{c as e,aF as t,bt as s,aH as a,r as n,bu as r,bv as l,j as o,bw as c,l as i,d,bx as x,by as u,bz as m,bA as h,aV as p,aW as f,ab as g,aa as b,bB as j,t as v,a9 as y,aI as N,aM as w,b1 as k,a as C,b as S,g as I,D as M,f as z,R as P,_ as U,k as T,X as D,o as $,bC as A,bD as L,C as R,A as E,p as H}from"./index-Bi0Lxaim.js";import{A as _,f as F,T as O,G as q,M as B,r as W,a as V,b as K,c as G,e as J,h as Q,o as X,d as Y,I as Z,F as ee}from"./AssistantMessageContent-fk_C4oct.js";import{C as te}from"./chevron-up-BZkUJHec.js";import{C as se}from"./chevron-down-CxkiZ1SD.js";
3
- /**
4
- * @license lucide-react v0.309.0 - ISC
5
- *
6
- * This source code is licensed under the ISC license.
7
- * See the LICENSE file in the root directory of this source tree.
8
- */const ae=e("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]),ne=e("FileCode",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"m10 13-2 2 2 2",key:"17smn8"}],["path",{d:"m14 17 2-2-2-2",key:"14mezr"}]]),re=e("FileJson",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]),le=e("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]),oe=window.matchMedia("(pointer: coarse)").matches&&window.innerWidth<768;
9
- /**
10
- * @license lucide-react v0.309.0 - ISC
11
- *
12
- * This source code is licensed under the ISC license.
13
- * See the LICENSE file in the root directory of this source tree.
14
- */function ce({onSelectProject:e}){const h=t(),p=s(e=>e.clearToken),{projects:f,fetchProjects:g,hasFetched:b,loading:j}=a(),v=n.useCallback(()=>{a.getState().setProjects([]),p(),h("/login")},[p,h]),[y,N]=n.useState(new Map),[w,k]=n.useState(new Set),[C,S]=n.useState(!1);n.useEffect(()=>{g()},[g]);const I=n.useCallback(e=>{e.status&&N(t=>{const s=new Map(t);return s.set(e.projectId,e.status),s}),void 0!==e.active&&k(t=>{const s=new Set(t);return e.active?s.add(e.projectId):s.delete(e.projectId),s})},[]);r({onActivityUpdate:I});const{applyOrder:M}=l(),z=M(f.filter(e=>!e.archived));return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsxs("div",{className:"flex items-center gap-3 px-4 h-12 border-b border-border shrink-0",children:[o.jsx("span",{className:"font-semibold text-base flex-1",children:"CC Web"}),o.jsx(c,{}),o.jsx("button",{onClick:()=>{(async()=>{S(!0);try{await g()}finally{S(!1)}})()},className:"text-muted-foreground active:text-foreground",disabled:C,"aria-label":"Refresh",children:o.jsx(i,{className:d("h-4 w-4",C&&"animate-spin")})}),o.jsx("button",{onClick:()=>h("/settings"),className:"text-muted-foreground active:text-foreground","aria-label":"Settings",children:o.jsx(x,{className:"h-4 w-4"})}),o.jsx("button",{onClick:v,className:"text-muted-foreground active:text-foreground","aria-label":"Logout",children:o.jsx(u,{className:"h-4 w-4"})}),!oe&&o.jsx("button",{onClick:()=>h("/"),className:"text-muted-foreground active:text-foreground","aria-label":"Desktop mode",children:o.jsx(m,{className:"h-4 w-4"})})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[j&&!b&&o.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"加载中..."}),b&&0===z.length&&o.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"暂无项目"}),o.jsx("div",{className:"grid grid-cols-2 gap-2",children:z.map(t=>{var s;const a="running"===(s=t,y.get(s.id)??s.status??"stopped"),n=w.has(t.id),r=o.jsxs("button",{onClick:()=>e(t.id),className:d("w-full text-left rounded-xl border bg-card p-2.5 active:bg-accent transition-colors",n?"border-transparent":"border-border"),children:[o.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[o.jsx("span",{className:d("w-2 h-2 rounded-full shrink-0",a?"bg-green-500":"bg-zinc-400")}),o.jsx("span",{className:"font-medium text-sm truncate flex-1",children:t.name})]}),o.jsx("div",{className:"text-[10px] text-muted-foreground font-mono truncate",children:t.cliTool??"claude"})]});return o.jsx("div",{className:n?"card-active-glow rounded-xl":void 0,children:r},t.id)})})]})]})}function ie(e){if(!e.phase)return null;if("thinking"===e.phase)return"思考中";if("tool_result"===e.phase)return"处理结果";if("tool_use"===e.phase){const t=(e.detail||"").toLowerCase();return"bash"===t?"执行命令":"read"===t?"读取文件":"edit"===t||"multiedit"===t?"编辑文件":"write"===t?"写入文件":"grep"===t?"搜索内容":"glob"===t?"匹配文件":"webfetch"===t||"websearch"===t?"访问网络":"task"===t?"调度子任务":"todowrite"===t?"更新任务列表":"notebookedit"===t?"编辑 Notebook":e.detail?`调用 ${e.detail}`:"调用工具"}return null}function de({project:e,onBack:t,onOpenPanel:s,onContextUpdate:a}){const[r,l]=n.useState(""),c=n.useRef(null),i=n.useRef(null),[x,u]=n.useState([]),m=n.useCallback(e=>{u(t=>{const s=[...t,e];return s.length>200?s.slice(-200):s})},[]),C=n.useRef(null),S=n.useCallback(e=>{var t;"stopped"===e&&(null==(t=C.current)||t.call(C,"stopped"))},[]),[I,M]=n.useState([]),z=n.useRef(new Set),P=n.useCallback(e=>{z.current.has(e.toolUseId)||M(t=>t.some(t=>t.toolUseId===e.toolUseId)?t:[...t,{projectId:e.projectId,toolUseId:e.toolUseId,toolName:e.toolName,toolInput:e.toolInput,sessionId:e.sessionId,createdAt:e.createdAt}])},[]),U=n.useCallback(e=>{z.current.add(e.toolUseId),M(t=>t.filter(t=>t.toolUseId!==e.toolUseId))},[]),T=n.useCallback(e=>{z.current.add(e),M(t=>t.filter(t=>t.toolUseId!==e))},[]),[D,$]=n.useState(null),A=n.useRef(0),L=n.useCallback(e=>{var t,s,a;if(!e.active)return void $(null);if("text"===(null==(t=e.semantic)?void 0:t.phase))return void $(null);const n=null==(s=e.semantic)?void 0:s.phase,r=null==(a=e.semantic)?void 0:a.detail;$(e=>e?e.phase===n&&e.detail===r?e:{...e,phase:n,detail:r}:{id:"mab"+ ++A.current,phase:n,detail:r})},[]),{sendInput:R,connected:E}=h({projectId:e.id,enabled:!0,onChatMessage:m,onStatusChange:S,onContextUpdate:a,onApprovalRequest:P,onApprovalResolved:U,onSemanticUpdate:L});n.useEffect(()=>{if(!E)return;if("claude"!==e.cliTool)return;let t=!1;return p(e.id).then(e=>{if(t)return;const s=e.pending.filter(e=>!z.current.has(e.toolUseId));M(e=>{const t=new Map;for(const a of s)t.set(a.toolUseId,a);for(const s of e)t.has(s.toolUseId)||z.current.has(s.toolUseId)||t.set(s.toolUseId,s);return[...t.values()]})}).catch(()=>{}),()=>{t=!0}},[e.id,e.cliTool,E]);const{state:H,setState:B,messages:W,hasMoreHistory:V,loadMoreHistory:K,sendMessage:G,isWaking:J}=f({project:e,liveMessages:x,ws:{send:R,connected:E},historyLimit:20});C.current=B;const Q=n.useRef(E);n.useEffect(()=>{!Q.current&&E&&u([]),Q.current=E},[E]);const X=(()=>{for(let e=W.length-1;e>=0;e--)if("assistant"===W[e].role)return e;return-1})(),[Y,Z]=n.useState([]),[ee,ne]=n.useState([]),[re,oe]=n.useState(null);n.useEffect(()=>{g().then(Z).catch(()=>{}),b(e.id).then(ne).catch(()=>{})},[e.id]);const ce=n.useCallback(async()=>{const e=c.current,t=(null==e?void 0:e.scrollHeight)??0;await K(),requestAnimationFrame(()=>{e&&(e.scrollTop+=e.scrollHeight-t)})},[K]),de=n.useRef(0);n.useEffect(()=>{const e=c.current;if(!e)return;const t=W.length>de.current,s=0===de.current&&W.length>0;de.current=W.length,s?e.scrollTo({top:e.scrollHeight}):t&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[W,I.length]);const[xe,ue]=n.useState(!1),me=n.useCallback(async()=>{const e=r.trim();if(!e||xe)return;ue(!0);const t=await G(e);ue(!1),"delivered"===t&&(l(""),i.current&&(i.current.style.height="auto"))},[r,xe,G]),he=j(me,"shift"),pe=n.useCallback(async(t,s)=>{oe(null);try{"failed"===await G(t.command)?v.error("快捷命令未送达,请重试或检查会话"):"project"===s&&y(e.id,t.id,!0).catch(e=>{console.error("Failed to mark shortcut used:",e)})}catch(a){console.error("Shortcut send error:",a),v.error("快捷命令发送失败")}},[G,e.id]),fe="live"===H;return o.jsxs("div",{className:"flex flex-col h-full bg-background",children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[o.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:o.jsx(N,{className:"h-5 w-5"})}),o.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0",children:[o.jsx("span",{className:"font-medium text-sm truncate",children:e.name}),o.jsx("span",{className:d("w-2 h-2 rounded-full shrink-0",fe?"bg-green-500":J?"bg-yellow-400 animate-pulse":"bg-zinc-400")})]}),o.jsx("button",{onClick:s,className:"text-muted-foreground active:text-foreground p-1",children:o.jsx(le,{className:"h-5 w-5"})})]}),o.jsxs("div",{ref:c,className:"flex-1 overflow-y-auto px-3 py-3 space-y-3 min-h-0",children:[V&&o.jsx("div",{className:"flex justify-center pb-1",children:o.jsxs("button",{onClick:()=>{ce()},className:"flex items-center gap-1 px-3 py-1.5 rounded-full text-xs text-muted-foreground border border-border active:bg-accent transition-colors",children:[o.jsx(te,{className:"h-3 w-3"}),"加载更早消息"]})}),W.map((e,t)=>{const s="user"===e.role;return o.jsx("div",{className:d("flex",s?"justify-end":"justify-start"),children:o.jsx("div",{className:d("max-w-[85%] rounded-xl px-3 py-2 break-words text-sm leading-relaxed",s?"bg-blue-500/15 text-foreground border border-blue-500/20 rounded-br-sm whitespace-pre-wrap":"bg-secondary text-secondary-foreground border border-border rounded-bl-sm"),children:s?e.content:o.jsx(_,{content:e.content,blocks:e.blocks,isLatest:t===X})})},e.id)}),I.map(e=>o.jsx(F,{approval:e,onResolved:T},e.toolUseId)),D&&0===I.length&&o.jsx("div",{className:"flex justify-start",children:o.jsxs("div",{className:"rounded-2xl rounded-bl-md px-3 py-1.5 bg-black/5 dark:bg-white/10 border border-black/10 dark:border-white/15 flex items-center gap-2 text-xs text-muted-foreground",children:[o.jsx(O,{}),ie(D)&&o.jsx("span",{children:ie(D)})]})},D.id),0===W.length&&0===I.length&&!D&&"stopped"===H&&o.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground/40 text-sm",children:"暂无对话记录"}),J&&o.jsx("div",{className:"flex items-center justify-center py-4 text-yellow-400 text-sm animate-pulse",children:"启动中..."})]}),re&&o.jsx("div",{className:"border-t border-border max-h-48 overflow-y-auto shrink-0",children:o.jsxs("div",{className:"px-3 py-2 space-y-1",children:[("global"===re?Y:ee).map(e=>o.jsxs("button",{onClick:()=>pe(e,re),disabled:J,className:d("w-full text-left rounded-md px-2.5 py-2 text-sm active:bg-accent transition-colors border border-border/50",J&&"opacity-50 cursor-not-allowed"),children:[o.jsx("div",{className:"font-medium text-xs",children:e.label}),o.jsx("div",{className:"text-[11px] text-muted-foreground font-mono truncate",children:e.command})]},e.id)),0===("global"===re?Y:ee).length&&o.jsx("div",{className:"text-center text-muted-foreground text-xs py-3",children:"暂无快捷 Prompts"})]})}),(Y.length>0||ee.length>0)&&o.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 border-t border-border shrink-0",children:[o.jsxs("button",{onClick:()=>oe(e=>"global"===e?null:"global"),className:d("flex items-center gap-1 px-2 py-1 rounded-md text-xs transition-colors","global"===re?"bg-blue-500/15 text-blue-500":"text-muted-foreground active:bg-accent"),children:[o.jsx(q,{className:"h-3 w-3"}),"全局","global"===re&&o.jsx(se,{className:"h-3 w-3"})]}),o.jsxs("button",{onClick:()=>oe(e=>"project"===e?null:"project"),className:d("flex items-center gap-1 px-2 py-1 rounded-md text-xs transition-colors","project"===re?"bg-blue-500/15 text-blue-500":"text-muted-foreground active:bg-accent"),children:[o.jsx(ae,{className:"h-3 w-3"}),"项目","project"===re&&o.jsx(se,{className:"h-3 w-3"})]})]}),o.jsx("div",{className:"border-t border-border px-3 py-2 shrink-0",style:{paddingBottom:"max(0.5rem, env(safe-area-inset-bottom))"},children:o.jsxs("div",{className:"flex items-end gap-2",children:[o.jsx("textarea",{ref:i,value:r,onChange:e=>l(e.target.value),onKeyDown:he,disabled:J||xe,placeholder:J?"启动中...":xe?"发送中…":"stopped"===H?"输入消息(自动启动)...":"输入消息...",rows:1,className:d("flex-1 resize-none rounded-md border border-input bg-transparent px-3 py-2 text-sm outline-none","focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50","max-h-32 overflow-y-auto",(J||xe)&&"opacity-50 cursor-not-allowed"),style:{minHeight:"2.5rem"},onInput:e=>{const t=e.currentTarget;t.style.height="auto",t.style.height=Math.min(t.scrollHeight,128)+"px"}}),o.jsx("button",{onClick:me,disabled:J||xe||!r.trim(),className:d("shrink-0 p-2 rounded-md transition-colors",r.trim()&&!xe?"text-blue-500 active:bg-blue-500/10":"text-muted-foreground/30"),children:xe?o.jsx(w,{className:"h-5 w-5 animate-spin"}):o.jsx(k,{className:"h-5 w-5"})})]})})]})}const xe=P.lazy(()=>U(()=>import("./OfficePreview-DrS64ehu.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.OfficePreview}))),ue=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]),me=new Set(["docx","xlsx","xls","pptx"]),he={js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",cpp:"cpp",h:"c",cs:"csharp",php:"php",sh:"bash",bash:"bash",zsh:"bash",yaml:"yaml",yml:"yaml",json:"json",toml:"toml",html:"html",htm:"html",xml:"xml",svg:"xml",css:"css",scss:"scss",less:"less",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"docker",makefile:"makefile",r:"r",lua:"lua",dart:"dart",zig:"zig"};function pe(e){return e.split("/").pop()??e}function fe({filePath:e,onBack:t}){const[s,a]=n.useState(null),[r,l]=n.useState(!0),[c,i]=n.useState(null),{resolved:d}=C(),x=function(e){const t=e.split("/").pop()??"",s=t.toLowerCase();if("dockerfile"===s)return"dockerfile";if("makefile"===s)return"makefile";const a=t.lastIndexOf(".");return a>=0?t.slice(a+1).toLowerCase():""}(e),u=ue.has(x),m=me.has(x),h=he[x],p="dark"===d;n.useEffect(()=>{u||m?l(!1):(l(!0),i(null),S(e).then(a).catch(e=>i(e instanceof Error?e.message:"Failed to load")).finally(()=>l(!1)))},[e,u,m]);const f=z(e),g=n.useMemo(()=>{const e=I();return e?`${f}&token=${encodeURIComponent(e)}`:f},[f]),b=n.useMemo(()=>u?`${g}&t=${Date.now()}`:"",[g,u]);return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[o.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:o.jsx(N,{className:"h-5 w-5"})}),o.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:pe(e)}),o.jsx("a",{href:g,download:!0,className:"text-muted-foreground active:text-foreground p-1",onClick:e=>e.stopPropagation(),children:o.jsx(M,{className:"h-4 w-4"})})]}),o.jsxs("div",{className:"flex-1 overflow-auto min-h-0",children:[r&&o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(w,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),c&&o.jsx("div",{className:"text-center text-destructive text-sm py-12 px-4",children:c}),u&&o.jsx("div",{className:"flex items-center justify-center p-4 h-full",children:o.jsx("img",{src:b,alt:pe(e),className:"max-w-full max-h-full object-contain rounded",style:{touchAction:"pinch-zoom"}})}),m&&o.jsx(n.Suspense,{fallback:o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(w,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),children:o.jsx(xe,{filePath:e,ext:x,zoom:100})}),s&&(s.binary||s.tooLarge)&&o.jsxs("div",{className:"text-center py-12 px-4 space-y-3",children:[o.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.binary?"二进制文件":"文件过大",s.size>0&&` (${j=s.size,j<1024?`${j} B`:j<1048576?`${(j/1024).toFixed(1)} KB`:`${(j/1048576).toFixed(1)} MB`})`]}),o.jsxs("a",{href:g,download:!0,className:"inline-flex items-center gap-1.5 text-sm text-blue-500 active:text-blue-400",children:[o.jsx(M,{className:"h-4 w-4"}),"下载文件"]})]}),s&&!s.binary&&!s.tooLarge&&null!=s.content&&o.jsxs(o.Fragment,{children:["md"===x&&o.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none px-4 py-3",children:o.jsx(B,{remarkPlugins:[V,K],rehypePlugins:[W],urlTransform:(e,t,s)=>"src"===t&&"img"===s.tagName?e:J(e),components:{img:({src:t,alt:s,...a})=>o.jsx("img",{...a,src:G(e,t,I()),alt:s??"",loading:"lazy",style:{maxWidth:"100%",height:"auto"}})},children:s.content})}),"md"!==x&&h&&o.jsx(Q,{language:h,style:p?X:Y,customStyle:{margin:0,fontSize:"12px",borderRadius:0},showLineNumbers:!0,children:s.content}),"md"!==x&&!h&&o.jsx("pre",{className:"p-4 text-xs font-mono whitespace-pre-wrap break-words",children:s.content})]})]})]});var j}const ge=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]),be=new Set(["js","jsx","ts","tsx","py","rb","go","rs","java","c","cpp","h","swift","kt","cs","php","sh","bash","zsh","r","lua","dart","zig","css","scss","less","html","htm","xml","sql"]),je=new Set(["json","yaml","yml","toml","csv","tsv"]);function ve({entry:e}){if("dir"===e.type)return o.jsx($,{className:"h-8 w-8 text-blue-400"});const t=function(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t+1).toLowerCase():""}(e.name);return ge.has(t)?o.jsx(Z,{className:"h-8 w-8 text-emerald-400"}):be.has(t)?o.jsx(ne,{className:"h-8 w-8 text-orange-400"}):je.has(t)?o.jsx(re,{className:"h-8 w-8 text-yellow-400"}):"md"===t?o.jsx(ee,{className:"h-8 w-8 text-sky-400"}):o.jsx(A,{className:"h-8 w-8 text-muted-foreground"})}function ye({rootPath:e,onClose:t}){const[s,a]=n.useState(e),[r,l]=n.useState([]),[c,i]=n.useState(!0),[d,x]=n.useState(null),u=n.useCallback(async e=>{i(!0);try{const t=[...(await T(e)).entries].sort((e,t)=>e.type!==t.type?"dir"===e.type?-1:1:e.name.localeCompare(t.name));l(t),a(e)}catch{l([])}finally{i(!1)}},[]);n.useEffect(()=>{u(e)},[e,u]);const m=s!==e,h=s.startsWith(e)?s.slice(e.length)||"/":s;return d?o.jsx(fe,{filePath:d,onBack:()=>x(null)}):o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[o.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:o.jsx(D,{className:"h-5 w-5"})}),o.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-0 text-sm",children:[m&&o.jsx("button",{onClick:()=>{if(s===e)return;const t=s.replace(/\/[^/]+$/,"")||"/";t.startsWith(e)&&u(t)},className:"text-muted-foreground active:text-foreground p-0.5 shrink-0",children:o.jsx(N,{className:"h-4 w-4"})}),o.jsx("span",{className:"truncate text-muted-foreground font-mono text-xs",children:h})]})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[c&&o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx(w,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!c&&0===r.length&&o.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"空目录"}),!c&&o.jsx("div",{className:"grid grid-cols-3 gap-1",children:r.map(e=>o.jsxs("button",{onClick:()=>(e=>{"dir"===e.type?u(e.path):x(e.path)})(e),className:"flex flex-col items-center gap-1 p-2 rounded-md active:bg-accent transition-colors",children:[o.jsx(ve,{entry:e}),o.jsx("span",{className:"text-[11px] text-center leading-tight w-full line-clamp-2 break-all",children:e.name})]},e.path))})]})]})}function Ne(e){return e<50?"text-green-400":e<80?"text-yellow-400":"text-red-400"}function we(e){return e<50?"bg-green-500":e<80?"bg-yellow-500":"bg-red-500"}function ke({projectName:e,cliTool:t,folderPath:s,contextData:a,onClose:r}){const[l,c]=n.useState(new Set(["context","usage","files"])),[x,u]=n.useState(null),[m,h]=n.useState(!1),p=e=>{c(t=>{const s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})};n.useEffect(()=>{h(!0),L(t).then(u).catch(()=>u(null)).finally(()=>h(!1))},[t]);const f=a?Math.round(a.usedPercentage):null;return o.jsxs("div",{className:"flex flex-col h-full",children:[o.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[o.jsx("button",{onClick:r,className:"text-muted-foreground active:text-foreground p-1",children:o.jsx(D,{className:"h-5 w-5"})}),o.jsx("span",{className:"flex-1 font-medium text-sm truncate",children:e})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto",children:[o.jsxs("button",{onClick:()=>p("context"),className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 active:bg-accent",children:[l.has("context")?o.jsx(se,{className:"h-3.5 w-3.5 text-muted-foreground"}):o.jsx(R,{className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-medium",children:"上下文"}),null!==f&&o.jsxs("span",{className:d("text-xs font-mono ml-auto",Ne(f)),children:[f,"%"]})]}),l.has("context")&&o.jsx("div",{className:"px-4 py-3 border-b border-border/50",children:null!==f&&a?o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"flex-1 h-2 bg-secondary rounded-full overflow-hidden",children:o.jsx("div",{className:d("h-full rounded-full transition-all",we(f)),style:{width:`${Math.min(f,100)}%`}})}),o.jsxs("span",{className:d("text-xs font-mono w-10 text-right",Ne(f)),children:[f,"%"]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-[11px] text-muted-foreground",children:[o.jsx("span",{children:"窗口大小"}),o.jsx("span",{className:"text-right font-mono",children:a.contextWindowSize>=1e6?`${(a.contextWindowSize/1e6).toFixed(1)}M`:`${Math.round(a.contextWindowSize/1e3)}K`}),o.jsx("span",{children:"输入 tokens"}),o.jsx("span",{className:"text-right font-mono",children:a.inputTokens.toLocaleString()}),o.jsx("span",{children:"输出 tokens"}),o.jsx("span",{className:"text-right font-mono",children:a.outputTokens.toLocaleString()})]})]}):o.jsx("div",{className:"text-xs text-muted-foreground/50 text-center py-2",children:"暂无数据"})}),o.jsxs("div",{className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 cursor-pointer",role:"button",tabIndex:0,onClick:()=>p("usage"),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||p("usage")},children:[l.has("usage")?o.jsx(se,{className:"h-3.5 w-3.5 text-muted-foreground"}):o.jsx(R,{className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-medium",children:"用量"}),o.jsx("button",{onClick:e=>{e.stopPropagation(),(async()=>{h(!0);try{const{refreshUsage:e}=await U(async()=>{const{refreshUsage:e}=await import("./index-Bi0Lxaim.js").then(e=>e.bM);return{refreshUsage:e}},__vite__mapDeps([1,2]));u(await e(t))}catch{}finally{h(!1)}})()},className:"ml-auto text-muted-foreground active:text-foreground",children:o.jsx(i,{className:d("h-3 w-3",m&&"animate-spin")})})]}),l.has("usage")&&o.jsx("div",{className:"px-4 py-3 border-b border-border/50",children:x?o.jsxs("div",{className:"space-y-2",children:[x.planName&&o.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Plan: ",o.jsx("span",{className:"font-medium text-foreground",children:x.planName})]}),o.jsx(Ce,{label:"5h",bucket:x.fiveHour}),o.jsx(Ce,{label:"7d",bucket:x.sevenDay}),x.sevenDaySonnet&&o.jsx(Ce,{label:"7d Sonnet",bucket:x.sevenDaySonnet}),x.sevenDayOpus&&o.jsx(Ce,{label:"7d Opus",bucket:x.sevenDayOpus}),!x.fiveHour&&!x.sevenDay&&o.jsx("div",{className:"text-xs text-muted-foreground/50 text-center",children:"暂无数据"})]}):o.jsx("div",{className:"text-xs text-muted-foreground/50 text-center py-2",children:m?"加载中...":"暂无数据"})}),o.jsxs("button",{onClick:()=>p("files"),className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 active:bg-accent",children:[l.has("files")?o.jsx(se,{className:"h-3.5 w-3.5 text-muted-foreground"}):o.jsx(R,{className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-medium",children:"文件"})]}),l.has("files")&&o.jsx("div",{className:"h-[60vh]",children:o.jsx(ye,{rootPath:s,onClose:()=>p("files")})})]})]})}function Ce({label:e,bucket:t}){if(!t||void 0===t.utilization)return null;const s=t.utilization,a=function(e){if(!e)return"";const t=new Date(e).getTime()-Date.now();if(t<=0)return"即将重置";const s=Math.floor(t/36e5),a=Math.floor(t%36e5/6e4);return s>0?`${s}h${a}m`:`${a}m`}(t.resetAt);return o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs text-muted-foreground w-16",children:e}),o.jsx("div",{className:"flex-1 h-1.5 bg-secondary rounded-full overflow-hidden",children:o.jsx("div",{className:d("h-full rounded-full",we(s)),style:{width:`${Math.min(s,100)}%`}})}),o.jsxs("span",{className:d("text-xs font-mono w-8 text-right",Ne(s)),children:[s,"%"]}),a&&o.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:a})]})}function Se(){n.useEffect(()=>{const e=document.querySelector('meta[name="viewport"]');if(!e)return;const t=e.getAttribute("content")??"";return e.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"),()=>{e.setAttribute("content",t)}},[]);const[e,t]=n.useState({screen:"list"}),[s,r]=n.useState(null),l=a(e=>e.projects),c=n.useCallback(e=>{t({screen:"chat",projectId:e}),r(null)},[]),i=n.useCallback(e=>{t({screen:"panel",projectId:e})},[]),d=n.useCallback(()=>{t(e=>"panel"===e.screen?{screen:"chat",projectId:e.projectId}:{screen:"list"})},[]),x="list"!==e.screen?l.find(t=>t.id===e.projectId):void 0;return o.jsxs("div",{className:"fixed inset-0 bg-background overflow-hidden",children:[o.jsxs(E,{mode:"wait",children:["list"===e.screen&&o.jsx(H.div,{className:"absolute inset-0",initial:{opacity:0},animate:{opacity:1},exit:{x:"-30%",opacity:0},transition:{duration:.2},style:{paddingTop:"env(safe-area-inset-top)"},children:o.jsx(ce,{onSelectProject:c})},"list"),"chat"===e.screen&&x&&o.jsx(H.div,{className:"absolute inset-0",initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"tween",duration:.25},style:{paddingTop:"env(safe-area-inset-top)"},children:o.jsx(de,{project:x,onBack:d,onOpenPanel:()=>i(e.projectId),onContextUpdate:r})},`chat-${e.projectId}`)]}),o.jsx(E,{children:"panel"===e.screen&&x&&o.jsx(H.div,{className:"absolute inset-0 z-50 bg-background",initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"tween",duration:.25},style:{paddingTop:"env(safe-area-inset-top)"},children:o.jsx(ke,{projectName:x.name,cliTool:x.cliTool??"claude",folderPath:x.folderPath,contextData:s,onClose:d})},"panel")})]})}export{Se as MobilePage};
@@ -1,13 +0,0 @@
1
- import{c as e,r as t,j as n,U as r,W as o,R as i,$ as a,b6 as l,a1 as s,a0 as c,b5 as f,V as u,Y as d,d as p,b7 as m,aU as h}from"./index-Bi0Lxaim.js";
2
- /**
3
- * @license lucide-react v0.309.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */const g=e("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]),y=e("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);
8
- /**
9
- * @license lucide-react v0.309.0 - ISC
10
- *
11
- * This source code is licensed under the ISC license.
12
- * See the LICENSE file in the root directory of this source tree.
13
- */function v(e){const r=w(e),o=t.forwardRef((e,o)=>{const{children:i,...a}=e,l=t.Children.toArray(i),s=l.find(b);if(s){const e=s.props.children,i=l.map(n=>n===s?t.Children.count(e)>1?t.Children.only(null):t.isValidElement(e)?e.props.children:null:n);return n.jsx(r,{...a,ref:o,children:t.isValidElement(e)?t.cloneElement(e,void 0,i):null})}return n.jsx(r,{...a,ref:o,children:i})});return o.displayName=`${e}.Slot`,o}function w(e){const n=t.forwardRef((e,n)=>{const{children:o,...i}=e;if(t.isValidElement(o)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(o),a=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(i,o.props);return o.type!==t.Fragment&&(a.ref=n?r(n,e):e),t.cloneElement(o,a)}return t.Children.count(o)>1?t.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var x=Symbol("radix.slottable");function b(e){return t.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===x}function R(e){const t=e+"CollectionProvider",[r,l]=o(t),[s,c]=r(t,{collectionRef:{current:null},itemMap:new Map}),f=e=>{const{scope:t,children:r}=e,o=i.useRef(null),a=i.useRef(new Map).current;return n.jsx(s,{scope:t,itemMap:a,collectionRef:o,children:r})};f.displayName=t;const u=e+"CollectionSlot",d=v(u),p=i.forwardRef((e,t)=>{const{scope:r,children:o}=e,i=c(u,r),l=a(t,i.collectionRef);return n.jsx(d,{ref:l,children:o})});p.displayName=u;const m=e+"CollectionItemSlot",h="data-radix-collection-item",g=v(m),y=i.forwardRef((e,t)=>{const{scope:r,children:o,...l}=e,s=i.useRef(null),f=a(t,s),u=c(m,r);return i.useEffect(()=>(u.itemMap.set(s,{ref:s,...l}),()=>{u.itemMap.delete(s)})),n.jsx(g,{[h]:"",ref:f,children:o})});return y.displayName=m,[{Provider:f,Slot:p,ItemSlot:y},function(t){const n=c(e+"CollectionConsumer",t);return i.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},l]}var A=t.createContext(void 0);function S(e){const n=t.useContext(A);return e||n||"ltr"}var C="rovingFocusGroup.onEntryFocus",T={bubbles:!1,cancelable:!0},E="RovingFocusGroup",[P,D,O]=R(E),[j,F]=o(E,[O]),[L,M]=j(E),k=t.forwardRef((e,t)=>n.jsx(P.Provider,{scope:e.__scopeRovingFocusGroup,children:n.jsx(P.Slot,{scope:e.__scopeRovingFocusGroup,children:n.jsx(I,{...e,ref:t})})}));k.displayName=E;var I=t.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:o,orientation:i,loop:l=!1,dir:d,currentTabStopId:p,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:h,onEntryFocus:g,preventScrollOnEntryFocus:y=!1,...v}=e,w=t.useRef(null),x=a(r,w),b=S(d),[R,A]=f({prop:p,defaultProp:m??null,onChange:h,caller:E}),[P,O]=t.useState(!1),j=u(g),F=D(o),M=t.useRef(!1),[k,I]=t.useState(0);return t.useEffect(()=>{const e=w.current;if(e)return e.addEventListener(C,j),()=>e.removeEventListener(C,j)},[j]),n.jsx(L,{scope:o,orientation:i,dir:b,loop:l,currentTabStopId:R,onItemFocus:t.useCallback(e=>A(e),[A]),onItemShiftTab:t.useCallback(()=>O(!0),[]),onFocusableItemAdd:t.useCallback(()=>I(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>I(e=>e-1),[]),children:n.jsx(s.div,{tabIndex:P||0===k?-1:0,"data-orientation":i,...v,ref:x,style:{outline:"none",...e.style},onMouseDown:c(e.onMouseDown,()=>{M.current=!0}),onFocus:c(e.onFocus,e=>{const t=!M.current;if(e.target===e.currentTarget&&t&&!P){const t=new CustomEvent(C,T);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=F().filter(e=>e.focusable);W([e.find(e=>e.active),e.find(e=>e.id===R),...e].filter(Boolean).map(e=>e.ref.current),y)}}M.current=!1}),onBlur:c(e.onBlur,()=>O(!1))})})}),N="RovingFocusGroupItem",_=t.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:o,focusable:i=!0,active:a=!1,tabStopId:f,children:u,...d}=e,p=l(),m=f||p,h=M(N,o),g=h.currentTabStopId===m,y=D(o),{onFocusableItemAdd:v,onFocusableItemRemove:w,currentTabStopId:x}=h;return t.useEffect(()=>{if(i)return v(),()=>w()},[i,v,w]),n.jsx(P.ItemSlot,{scope:o,id:m,focusable:i,active:a,children:n.jsx(s.span,{tabIndex:g?0:-1,"data-orientation":h.orientation,...d,ref:r,onMouseDown:c(e.onMouseDown,e=>{i?h.onItemFocus(m):e.preventDefault()}),onFocus:c(e.onFocus,()=>h.onItemFocus(m)),onKeyDown:c(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void h.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:H[r]}(e,h.orientation,h.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=y().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=h.loop?(r=i+1,(n=o).map((e,t)=>n[(r+t)%n.length])):o.slice(i+1)}setTimeout(()=>W(o))}var n,r}),children:"function"==typeof u?u({isCurrentTabStop:g,hasTabStop:null!=x}):u})})});_.displayName=N;var H={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function W(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var z=k,$=_,V="Tabs",[B]=o(V,[F]),K=F(),[Y,G]=B(V),U=t.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,onValueChange:i,defaultValue:a,orientation:c="horizontal",dir:u,activationMode:d="automatic",...p}=e,m=S(u),[h,g]=f({prop:o,onChange:i,defaultProp:a??"",caller:V});return n.jsx(Y,{scope:r,baseId:l(),value:h,onValueChange:g,orientation:c,dir:m,activationMode:d,children:n.jsx(s.div,{dir:m,"data-orientation":c,...p,ref:t})})});U.displayName=V;var X="TabsList",q=t.forwardRef((e,t)=>{const{__scopeTabs:r,loop:o=!0,...i}=e,a=G(X,r),l=K(r);return n.jsx(z,{asChild:!0,...l,orientation:a.orientation,dir:a.dir,loop:o,children:n.jsx(s.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})});q.displayName=X;var Z="TabsTrigger",J=t.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,disabled:i=!1,...a}=e,l=G(Z,r),f=K(r),u=te(l.baseId,o),d=ne(l.baseId,o),p=o===l.value;return n.jsx($,{asChild:!0,...f,focusable:!i,active:p,children:n.jsx(s.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...a,ref:t,onMouseDown:c(e.onMouseDown,e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():l.onValueChange(o)}),onKeyDown:c(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&l.onValueChange(o)}),onFocus:c(e.onFocus,()=>{const e="manual"!==l.activationMode;p||i||!e||l.onValueChange(o)})})})});J.displayName=Z;var Q="TabsContent",ee=t.forwardRef((e,r)=>{const{__scopeTabs:o,value:i,forceMount:a,children:l,...c}=e,f=G(Q,o),u=te(f.baseId,i),p=ne(f.baseId,i),m=i===f.value,h=t.useRef(m);return t.useEffect(()=>{const e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),n.jsx(d,{present:a||m,children:({present:t})=>n.jsx(s.div,{"data-state":m?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":u,hidden:!t,id:p,tabIndex:0,...c,ref:r,style:{...e.style,animationDuration:h.current?"0s":void 0},children:t&&l})})});function te(e,t){return`${e}-trigger-${t}`}function ne(e,t){return`${e}-content-${t}`}ee.displayName=Q;var re=q,oe=J,ie=ee;const ae=U,le=t.forwardRef(({className:e,...t},r)=>n.jsx(re,{ref:r,className:p("flex rounded-md bg-muted p-1 text-muted-foreground data-[orientation=horizontal]:h-10 data-[orientation=horizontal]:items-center data-[orientation=horizontal]:justify-center data-[orientation=horizontal]:inline-flex data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-center data-[orientation=vertical]:justify-start",e),...t}));le.displayName=re.displayName;const se=t.forwardRef(({className:e,...t},r)=>n.jsx(oe,{ref:r,className:p("inline-flex items-center justify-center whitespace-nowrap rounded-sm text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm data-[orientation=horizontal]:px-3 data-[orientation=horizontal]:py-1.5",e),...t}));se.displayName=oe.displayName;const ce=t.forwardRef(({className:e,...t},r)=>n.jsx(ie,{ref:r,className:p("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ce.displayName=ie.displayName;const fe=["top","right","bottom","left"],ue=Math.min,de=Math.max,pe=Math.round,me=Math.floor,he=e=>({x:e,y:e}),ge={left:"right",right:"left",bottom:"top",top:"bottom"};function ye(e,t,n){return de(e,ue(t,n))}function ve(e,t){return"function"==typeof e?e(t):e}function we(e){return e.split("-")[0]}function xe(e){return e.split("-")[1]}function be(e){return"x"===e?"y":"x"}function Re(e){return"y"===e?"height":"width"}function Ae(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Se(e){return be(Ae(e))}function Ce(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Te=["left","right"],Ee=["right","left"],Pe=["top","bottom"],De=["bottom","top"];function Oe(e,t,n,r){const o=xe(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Ee:Te:t?Te:Ee;case"left":case"right":return t?Pe:De;default:return[]}}(we(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(Ce)))),i}function je(e){const t=we(e);return ge[t]+e.slice(t.length)}function Fe(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Le(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Me(e,t,n){let{reference:r,floating:o}=e;const i=Ae(t),a=Se(t),l=Re(a),s=we(t),c="y"===i,f=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,d=r[l]/2-o[l]/2;let p;switch(s){case"top":p={x:f,y:r.y-o.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(xe(t)){case"start":p[a]-=d*(n&&c?-1:1);break;case"end":p[a]+=d*(n&&c?-1:1)}return p}async function ke(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:d=!1,padding:p=0}=ve(t,e),m=Fe(p),h=l[d?"floating"===u?"reference":"floating":u],g=Le(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:s})),y="floating"===u?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),w=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},x=Le(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:v,strategy:s}):y);return{top:(g.top-x.top+m.top)/w.y,bottom:(x.bottom-g.bottom+m.bottom)/w.y,left:(g.left-x.left+m.left)/w.x,right:(x.right-g.right+m.right)/w.x}}function Ie(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ne(e){return fe.some(t=>e[t]>=0)}const _e=new Set(["left","top"]);function He(){return"undefined"!=typeof window}function We(e){return Ve(e)?(e.nodeName||"").toLowerCase():"#document"}function ze(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function $e(e){var t;return null==(t=(Ve(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Ve(e){return!!He()&&(e instanceof Node||e instanceof ze(e).Node)}function Be(e){return!!He()&&(e instanceof Element||e instanceof ze(e).Element)}function Ke(e){return!!He()&&(e instanceof HTMLElement||e instanceof ze(e).HTMLElement)}function Ye(e){return!(!He()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ze(e).ShadowRoot)}function Ge(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=rt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function Ue(e){return/^(table|td|th)$/.test(We(e))}function Xe(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}const qe=/transform|translate|scale|rotate|perspective|filter/,Ze=/paint|layout|strict|content/,Je=e=>!!e&&"none"!==e;let Qe;function et(e){const t=Be(e)?rt(e):e;return Je(t.transform)||Je(t.translate)||Je(t.scale)||Je(t.rotate)||Je(t.perspective)||!tt()&&(Je(t.backdropFilter)||Je(t.filter))||qe.test(t.willChange||"")||Ze.test(t.contain||"")}function tt(){return null==Qe&&(Qe="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Qe}function nt(e){return/^(html|body|#document)$/.test(We(e))}function rt(e){return ze(e).getComputedStyle(e)}function ot(e){return Be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function it(e){if("html"===We(e))return e;const t=e.assignedSlot||e.parentNode||Ye(e)&&e.host||$e(e);return Ye(t)?t.host:t}function at(e){const t=it(e);return nt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ke(t)&&Ge(t)?t:at(t)}function lt(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=at(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=ze(o);if(i){const e=st(a);return t.concat(a,a.visualViewport||[],Ge(o)?o:[],e&&n?lt(e):[])}return t.concat(o,lt(o,[],n))}function st(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ct(e){const t=rt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ke(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=pe(n)!==i||pe(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function ft(e){return Be(e)?e:e.contextElement}function ut(e){const t=ft(e);if(!Ke(t))return he(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ct(t);let a=(i?pe(n.width):n.width)/r,l=(i?pe(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const dt=he(0);function pt(e){const t=ze(e);return tt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:dt}function mt(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=ft(e);let a=he(1);t&&(r?Be(r)&&(a=ut(r)):a=ut(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==ze(e))&&t}(i,n,r)?pt(i):he(0);let s=(o.left+l.x)/a.x,c=(o.top+l.y)/a.y,f=o.width/a.x,u=o.height/a.y;if(i){const e=ze(i),t=r&&Be(r)?ze(r):r;let n=e,o=st(n);for(;o&&r&&t!==n;){const e=ut(o),t=o.getBoundingClientRect(),r=rt(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,c*=e.y,f*=e.x,u*=e.y,s+=i,c+=a,n=ze(o),o=st(n)}}return Le({width:f,height:u,x:s,y:c})}function ht(e,t){const n=ot(e).scrollLeft;return t?t.left+n:mt($e(e)).left+n}function gt(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ht(e,n),y:n.top+t.scrollTop}}function yt(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=ze(e),r=$e(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=tt();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}const c=ht(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=25&&(i-=a)}else c<=25&&(i+=c);return{width:i,height:a,x:l,y:s}}(e,n);else if("document"===t)r=function(e){const t=$e(e),n=ot(e),r=e.ownerDocument.body,o=de(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=de(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ht(e);const l=-n.scrollTop;return"rtl"===rt(r).direction&&(a+=de(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:l}}($e(e));else if(Be(t))r=function(e,t){const n=mt(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ke(e)?ut(e):he(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=pt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Le(r)}function vt(e,t){const n=it(e);return!(n===t||!Be(n)||nt(n))&&("fixed"===rt(n).position||vt(n,t))}function wt(e,t,n){const r=Ke(t),o=$e(t),i="fixed"===n,a=mt(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const s=he(0);function c(){s.x=ht(o)}if(r||!r&&!i)if(("body"!==We(t)||Ge(o))&&(l=ot(t)),r){const e=mt(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const f=!o||r||i?he(0):gt(o,l);return{x:a.left+l.scrollLeft-s.x-f.x,y:a.top+l.scrollTop-s.y-f.y,width:a.width,height:a.height}}function xt(e){return"static"===rt(e).position}function bt(e,t){if(!Ke(e)||"fixed"===rt(e).position)return null;if(t)return t(e);let n=e.offsetParent;return $e(e)===n&&(n=n.ownerDocument.body),n}function Rt(e,t){const n=ze(e);if(Xe(e))return n;if(!Ke(e)){let t=it(e);for(;t&&!nt(t);){if(Be(t)&&!xt(t))return t;t=it(t)}return n}let r=bt(e,t);for(;r&&Ue(r)&&xt(r);)r=bt(r,t);return r&&nt(r)&&xt(r)&&!et(r)?n:r||function(e){let t=it(e);for(;Ke(t)&&!nt(t);){if(et(t))return t;if(Xe(t))return null;t=it(t)}return null}(e)||n}const At={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=$e(r),l=!!t&&Xe(t.floating);if(r===a||l&&i)return n;let s={scrollLeft:0,scrollTop:0},c=he(1);const f=he(0),u=Ke(r);if((u||!u&&!i)&&(("body"!==We(r)||Ge(a))&&(s=ot(r)),u)){const e=mt(r);c=ut(r),f.x=e.x+r.clientLeft,f.y=e.y+r.clientTop}const d=!a||u||i?he(0):gt(a,s);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+f.x+d.x,y:n.y*c.y-s.scrollTop*c.y+f.y+d.y}},getDocumentElement:$e,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?Xe(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=lt(e,[],!1).filter(e=>Be(e)&&"body"!==We(e)),o=null;const i="fixed"===rt(e).position;let a=i?it(e):e;for(;Be(a)&&!nt(a);){const t=rt(a),n=et(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||Ge(a)&&!n&&vt(e,a))?r=r.filter(e=>e!==a):o=t,a=it(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=yt(t,i[0],o);let l=a.top,s=a.right,c=a.bottom,f=a.left;for(let u=1;u<i.length;u++){const e=yt(t,i[u],o);l=de(e.top,l),s=ue(e.right,s),c=ue(e.bottom,c),f=de(e.left,f)}return{width:s-f,height:c-l,x:f,y:l}},getOffsetParent:Rt,getElementRects:async function(e){const t=this.getOffsetParent||Rt,n=this.getDimensions,r=await n(e.floating);return{reference:wt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=ct(e);return{width:t,height:n}},getScale:ut,isElement:Be,isRTL:function(e){return"rtl"===rt(e).direction}};function St(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ct(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,c=ft(e),f=o||i?[...c?lt(c):[],...t?lt(t):[]]:[];f.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const u=c&&l?function(e,t){let n,r=null;const o=$e(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(l,s){void 0===l&&(l=!1),void 0===s&&(s=1),i();const c=e.getBoundingClientRect(),{left:f,top:u,width:d,height:p}=c;if(l||t(),!d||!p)return;const m={rootMargin:-me(u)+"px "+-me(o.clientWidth-(f+d))+"px "+-me(o.clientHeight-(u+p))+"px "+-me(f)+"px",threshold:de(0,ue(1,s))||1};let h=!0;function g(t){const r=t[0].intersectionRatio;if(r!==s){if(!h)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||St(c,e.getBoundingClientRect())||a(),h=!1}try{r=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch(y){r=new IntersectionObserver(g,m)}r.observe(e)}(!0),i}(c,n):null;let d,p=-1,m=null;a&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),c&&!s&&m.observe(c),t&&m.observe(t));let h=s?mt(e):null;return s&&function t(){const r=mt(e);h&&!St(h,r)&&n();h=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;f.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=m)||e.disconnect(),m=null,s&&cancelAnimationFrame(d)}}const Tt=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:l}=t,s=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=we(n),l=xe(n),s="y"===Ae(n),c=_e.has(a)?-1:1,f=i&&s?-1:1,u=ve(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&"number"==typeof m&&(p="end"===l?-1*m:m),s?{x:p*f,y:d*c}:{x:d*c,y:p*f}}(t,e);return a===(null==(n=l.offset)?void 0:n.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:a}}}}},Et=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:l=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=ve(e,t),f={x:n,y:r},u=await i.detectOverflow(t,c),d=Ae(we(o)),p=be(d);let m=f[p],h=f[d];if(a){const e="y"===p?"bottom":"right";m=ye(m+u["y"===p?"top":"left"],m,m-u[e])}if(l){const e="y"===d?"bottom":"right";h=ye(h+u["y"===d?"top":"left"],h,h-u[e])}const g=s.fn({...t,[p]:m,[d]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:a,[d]:l}}}}}},Pt=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:l,platform:s,elements:c}=t,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=ve(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=we(o),v=Ae(l),w=we(l)===l,x=await(null==s.isRTL?void 0:s.isRTL(c.floating)),b=d||(w||!h?[je(l)]:function(e){const t=je(e);return[Ce(e),t,Ce(t)]}(l)),R="none"!==m;!d&&R&&b.push(...Oe(l,h,m,x));const A=[l,...b],S=await s.detectOverflow(t,g),C=[];let T=(null==(r=i.flip)?void 0:r.overflows)||[];if(f&&C.push(S[y]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=xe(e),o=Se(e),i=Re(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=je(a)),[a,je(a)]}(o,a,x);C.push(S[e[0]],S[e[1]])}if(T=[...T,{placement:o,overflows:C}],!C.every(e=>e<=0)){var E,P;const e=((null==(E=i.flip)?void 0:E.index)||0)+1,t=A[e];if(t){if(!("alignment"===u&&v!==Ae(t))||T.every(e=>Ae(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:T},reset:{placement:t}}}let n=null==(P=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:P.placement;if(!n)switch(p){case"bestFit":{var D;const e=null==(D=T.filter(e=>{if(R){const t=Ae(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:D[0];e&&(n=e);break}case"initialPlacement":n=l}if(o!==n)return{reset:{placement:n}}}return{}}}},Dt=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:l}=t,{apply:s=()=>{},...c}=ve(e,t),f=await a.detectOverflow(t,c),u=we(o),d=xe(o),p="y"===Ae(o),{width:m,height:h}=i.floating;let g,y;"top"===u||"bottom"===u?(g=u,y=d===(await(null==a.isRTL?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(y=u,g="end"===d?"top":"bottom");const v=h-f.top-f.bottom,w=m-f.left-f.right,x=ue(h-f[g],v),b=ue(m-f[y],w),R=!t.middlewareData.shift;let A=x,S=b;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=w),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(A=v),R&&!d){const e=de(f.left,0),t=de(f.right,0),n=de(f.top,0),r=de(f.bottom,0);p?S=m-2*(0!==e||0!==t?e+t:de(f.left,f.right)):A=h-2*(0!==n||0!==r?n+r:de(f.top,f.bottom))}await s({...t,availableWidth:S,availableHeight:A});const C=await a.getDimensions(l.floating);return m!==C.width||h!==C.height?{reset:{rects:!0}}:{}}}},Ot=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=ve(e,t);switch(o){case"referenceHidden":{const e=Ie(await r.detectOverflow(t,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ne(e)}}}case"escaped":{const e=Ie(await r.detectOverflow(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ne(e)}}}default:return{}}}}},jt=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:l,middlewareData:s}=t,{element:c,padding:f=0}=ve(e,t)||{};if(null==c)return{};const u=Fe(f),d={x:n,y:r},p=Se(o),m=Re(p),h=await a.getDimensions(c),g="y"===p,y=g?"top":"left",v=g?"bottom":"right",w=g?"clientHeight":"clientWidth",x=i.reference[m]+i.reference[p]-d[p]-i.floating[m],b=d[p]-i.reference[p],R=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let A=R?R[w]:0;A&&await(null==a.isElement?void 0:a.isElement(R))||(A=l.floating[w]||i.floating[m]);const S=x/2-b/2,C=A/2-h[m]/2-1,T=ue(u[y],C),E=ue(u[v],C),P=T,D=A-h[m]-E,O=A/2-h[m]/2+S,j=ye(P,O,D),F=!s.arrow&&null!=xe(o)&&O!==j&&i.reference[m]/2-(O<P?T:E)-h[m]/2<0,L=F?O<P?O-P:O-D:0;return{[p]:d[p]+L,data:{[p]:j,centerOffset:O-j-L,...F&&{alignmentOffset:L}},reset:F}}}),Ft=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:l=0,mainAxis:s=!0,crossAxis:c=!0}=ve(e,t),f={x:n,y:r},u=Ae(o),d=be(u);let p=f[d],m=f[u];const h=ve(l,t),g="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(s){const e="y"===d?"height":"width",t=i.reference[d]-i.floating[e]+g.mainAxis,n=i.reference[d]+i.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var y,v;const e="y"===d?"width":"height",t=_e.has(we(o)),n=i.reference[u]-i.floating[e]+(t&&(null==(y=a.offset)?void 0:y[u])||0)+(t?0:g.crossAxis),r=i.reference[u]+i.reference[e]+(t?0:(null==(v=a.offset)?void 0:v[u])||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[d]:p,[u]:m}}}},Lt=(e,t,n)=>{const r=new Map,o={platform:At,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=a.detectOverflow?a:{...a,detectOverflow:ke},s=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:u}=Me(c,r,s),d=r,p=0;const m={};for(let h=0;h<i.length;h++){const n=i[h];if(!n)continue;const{name:g,fn:y}=n,{x:v,y:w,data:x,reset:b}=await y({x:f,y:u,initialPlacement:r,placement:d,strategy:o,middlewareData:m,rects:c,platform:l,elements:{reference:e,floating:t}});f=null!=v?v:f,u=null!=w?w:u,m[g]={...m[g],...x},b&&p<50&&(p++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:f,y:u}=Me(c,d,s))),h=-1)}return{x:f,y:u,placement:d,strategy:o,middlewareData:m}})(e,t,{...o,platform:i})};var Mt="undefined"!=typeof document?t.useLayoutEffect:function(){};function kt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!kt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!kt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function It(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Nt(e,t){const n=It(e);return Math.round(t*n)/n}function _t(e){const n=t.useRef(e);return Mt(()=>{n.current=e}),n}const Ht=(e,t)=>{const n=Tt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wt=(e,t)=>{const n=Et(e);return{name:n.name,fn:n.fn,options:[e,t]}},zt=(e,t)=>{const n=Pt(e);return{name:n.name,fn:n.fn,options:[e,t]}},$t=(e,t)=>{const n=Dt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vt=(e,t)=>{const n=Ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bt=(e,t)=>{const n=(e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?jt({element:n.current,padding:r}).fn(t):{}:n?jt({element:n,padding:r}).fn(t):{};var o}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Kt=t.forwardRef((e,t)=>{const{children:r,width:o=10,height:i=5,...a}=e;return n.jsx(s.svg,{...a,ref:t,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:n.jsx("polygon",{points:"0,0 30,0 15,10"})})});Kt.displayName="Arrow";var Yt=Kt;function Gt(e){const[n,r]=t.useState(void 0);return h(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let o,i;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;r({width:o,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),n}var Ut="Popper",[Xt,qt]=o(Ut),[Zt,Jt]=Xt(Ut),Qt=e=>{const{__scopePopper:r,children:o}=e,[i,a]=t.useState(null);return n.jsx(Zt,{scope:r,anchor:i,onAnchorChange:a,children:o})};Qt.displayName=Ut;var en="PopperAnchor",tn=t.forwardRef((e,r)=>{const{__scopePopper:o,virtualRef:i,...l}=e,c=Jt(en,o),f=t.useRef(null),u=a(r,f),d=t.useRef(null);return t.useEffect(()=>{const e=d.current;d.current=(null==i?void 0:i.current)||f.current,e!==d.current&&c.onAnchorChange(d.current)}),i?null:n.jsx(s.div,{...l,ref:u})});tn.displayName=en;var nn="PopperContent",[rn,on]=Xt(nn),an=t.forwardRef((e,r)=>{var o,i,l,c,f,d;const{__scopePopper:p,side:g="bottom",sideOffset:y=0,align:v="center",alignOffset:w=0,arrowPadding:x=0,avoidCollisions:b=!0,collisionBoundary:R=[],collisionPadding:A=0,sticky:S="partial",hideWhenDetached:C=!1,updatePositionStrategy:T="optimized",onPlaced:E,...P}=e,D=Jt(nn,p),[O,j]=t.useState(null),F=a(r,e=>j(e)),[L,M]=t.useState(null),k=Gt(L),I=(null==k?void 0:k.width)??0,N=(null==k?void 0:k.height)??0,_=g+("center"!==v?"-"+v:""),H="number"==typeof A?A:{top:0,right:0,bottom:0,left:0,...A},W=Array.isArray(R)?R:[R],z=W.length>0,$={padding:H,boundary:W.filter(fn),altBoundary:z},{refs:V,floatingStyles:B,placement:K,isPositioned:Y,middlewareData:G}=function(e){void 0===e&&(e={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:l}={},transform:s=!0,whileElementsMounted:c,open:f}=e,[u,d]=t.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[p,h]=t.useState(o);kt(p,o)||h(o);const[g,y]=t.useState(null),[v,w]=t.useState(null),x=t.useCallback(e=>{e!==S.current&&(S.current=e,y(e))},[]),b=t.useCallback(e=>{e!==C.current&&(C.current=e,w(e))},[]),R=a||g,A=l||v,S=t.useRef(null),C=t.useRef(null),T=t.useRef(u),E=null!=c,P=_t(c),D=_t(i),O=_t(f),j=t.useCallback(()=>{if(!S.current||!C.current)return;const e={placement:n,strategy:r,middleware:p};D.current&&(e.platform=D.current),Lt(S.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==O.current};F.current&&!kt(T.current,t)&&(T.current=t,m.flushSync(()=>{d(t)}))})},[p,n,r,D,O]);Mt(()=>{!1===f&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[f]);const F=t.useRef(!1);Mt(()=>(F.current=!0,()=>{F.current=!1}),[]),Mt(()=>{if(R&&(S.current=R),A&&(C.current=A),R&&A){if(P.current)return P.current(R,A,j);j()}},[R,A,j,P,E]);const L=t.useMemo(()=>({reference:S,floating:C,setReference:x,setFloating:b}),[x,b]),M=t.useMemo(()=>({reference:R,floating:A}),[R,A]),k=t.useMemo(()=>{const e={position:r,left:0,top:0};if(!M.floating)return e;const t=Nt(M.floating,u.x),n=Nt(M.floating,u.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...It(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,s,M.floating,u.x,u.y]);return t.useMemo(()=>({...u,update:j,refs:L,elements:M,floatingStyles:k}),[u,j,L,M,k])}({strategy:"fixed",placement:_,whileElementsMounted:(...e)=>Ct(...e,{animationFrame:"always"===T}),elements:{reference:D.anchor},middleware:[Ht({mainAxis:y+N,alignmentAxis:w}),b&&Wt({mainAxis:!0,crossAxis:!1,limiter:"partial"===S?{fn:Ft(U).fn,options:[U,X]}:void 0,...$}),b&&zt({...$}),$t({...$,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),L&&Bt({element:L,padding:x}),un({arrowWidth:I,arrowHeight:N}),C&&Vt({strategy:"referenceHidden",...$})]});var U,X;const[q,Z]=dn(K),J=u(E);h(()=>{Y&&(null==J||J())},[Y,J]);const Q=null==(o=G.arrow)?void 0:o.x,ee=null==(i=G.arrow)?void 0:i.y,te=0!==(null==(l=G.arrow)?void 0:l.centerOffset),[ne,re]=t.useState();return h(()=>{O&&re(window.getComputedStyle(O).zIndex)},[O]),n.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:Y?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[null==(c=G.transformOrigin)?void 0:c.x,null==(f=G.transformOrigin)?void 0:f.y].join(" "),...(null==(d=G.hide)?void 0:d.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:n.jsx(rn,{scope:p,placedSide:q,onArrowChange:M,arrowX:Q,arrowY:ee,shouldHideArrow:te,children:n.jsx(s.div,{"data-side":q,"data-align":Z,...P,ref:F,style:{...P.style,animation:Y?void 0:"none"}})})})});an.displayName=nn;var ln="PopperArrow",sn={top:"bottom",right:"left",bottom:"top",left:"right"},cn=t.forwardRef(function(e,t){const{__scopePopper:r,...o}=e,i=on(ln,r),a=sn[i.placedSide];return n.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:n.jsx(Yt,{...o,ref:t,style:{...o.style,display:"block"}})})});function fn(e){return null!==e}cn.displayName=ln;var un=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o;const{placement:i,rects:a,middlewareData:l}=t,s=0!==(null==(n=l.arrow)?void 0:n.centerOffset),c=s?0:e.arrowWidth,f=s?0:e.arrowHeight,[u,d]=dn(i),p={start:"0%",center:"50%",end:"100%"}[d],m=((null==(r=l.arrow)?void 0:r.x)??0)+c/2,h=((null==(o=l.arrow)?void 0:o.y)??0)+f/2;let g="",y="";return"bottom"===u?(g=s?p:`${m}px`,y=-f+"px"):"top"===u?(g=s?p:`${m}px`,y=`${a.floating.height+f}px`):"right"===u?(g=-f+"px",y=s?p:`${h}px`):"left"===u&&(g=`${a.floating.width+f}px`,y=s?p:`${h}px`),{data:{x:g,y:y}}}});function dn(e){const[t,n="center"]=e.split("-");return[t,n]}var pn=Qt,mn=tn,hn=an,gn=cn;function yn(e,[t,n]){return Math.min(n,Math.max(t,e))}export{mn as A,hn as C,$ as I,pn as R,g as S,ae as T,y as U,le as a,se as b,ce as c,qt as d,F as e,R as f,z as g,gn as h,yn as i,Gt as j,S as u};