@juejin-opensource/jusage 0.1.6 → 0.1.8

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 (38) hide show
  1. package/README.md +1 -0
  2. package/dist/args.d.ts +20 -0
  3. package/dist/args.js +121 -0
  4. package/dist/daemon.d.ts +2 -2
  5. package/dist/daemon.js +8 -7
  6. package/dist/dashboard/assets/click-idle-CXAVCmiH.png +0 -0
  7. package/dist/dashboard/assets/dashboard-BcYn7CaU.js +55 -0
  8. package/dist/dashboard/assets/download-CteP_gYs.js +6 -0
  9. package/dist/dashboard/assets/downloads-dKq4xNjC.js +1 -0
  10. package/dist/dashboard/assets/hawking-idle-QoXt5bST.png +0 -0
  11. package/dist/dashboard/assets/index-BfeJy_UY.js +1 -0
  12. package/dist/dashboard/assets/index-CWwN4M6h.css +1 -0
  13. package/dist/dashboard/assets/{index-C-ulpYDE.js → index-flWmwEjH.js} +31 -31
  14. package/dist/dashboard/assets/model-provider-0f_aGOIG.js +1 -0
  15. package/dist/dashboard/assets/pricing-OObJBgJw.js +1 -0
  16. package/dist/dashboard/assets/rank-CuAJ5i73.js +16 -0
  17. package/dist/dashboard/assets/{settings-Cud6Sr27.js → settings-KbZOVhnT.js} +1 -1
  18. package/dist/dashboard/assets/useLocalStorage-BdF6kE3i.js +1 -0
  19. package/dist/dashboard/assets/yoyo-idle-DDvV3ieO.png +0 -0
  20. package/dist/dashboard/captain-wechat.jpg +0 -0
  21. package/dist/dashboard/index.html +2 -2
  22. package/dist/index.d.ts +1 -10
  23. package/dist/index.js +21 -93
  24. package/dist/service.d.ts +4 -1
  25. package/dist/service.js +19 -8
  26. package/package.json +3 -3
  27. package/dist/dashboard/assets/ChevronDown-hI5eRGzD.js +0 -1
  28. package/dist/dashboard/assets/click-idle-6pQvdt8N.png +0 -0
  29. package/dist/dashboard/assets/dashboard-CAkIFa6U.js +0 -55
  30. package/dist/dashboard/assets/download-ByMnRiaK.js +0 -1
  31. package/dist/dashboard/assets/downloads-C3JkgIXC.js +0 -1
  32. package/dist/dashboard/assets/env-Cw7aSECu.js +0 -1
  33. package/dist/dashboard/assets/hawking-idle-C6M3ZvDm.png +0 -0
  34. package/dist/dashboard/assets/index-CeqvL8Jz.js +0 -1
  35. package/dist/dashboard/assets/index-CmpX7J2H.css +0 -1
  36. package/dist/dashboard/assets/pricing-J0aEt4op.js +0 -1
  37. package/dist/dashboard/assets/rank-DNcLrJpg.js +0 -16
  38. package/dist/dashboard/assets/yoyo-idle-DmXh5tLT.png +0 -0
@@ -0,0 +1,6 @@
1
+ import{r as n,c as Q,j as e,B as A,a as l,C as O,bc as q,bd as Y}from"./index-flWmwEjH.js";import{r as H,d as D,a as V,g as X,f as ee,D as E,m as se,P as c,C as y,b as te,G as ae,c as ne}from"./downloads-dKq4xNjC.js";const re=t=>n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},t),n.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 2.5H8A1.5 1.5 0 0 0 6.5 4v1H8a3 3 0 0 1 3 3v1.5h1A1.5 1.5 0 0 0 13.5 8V4A1.5 1.5 0 0 0 12 2.5M11 11h1a3 3 0 0 0 3-3V4a3 3 0 0 0-3-3H8a3 3 0 0 0-3 3v1H4a3 3 0 0 0-3 3v4a3 3 0 0 0 3 3h4a3 3 0 0 0 3-3zM4 6.5h4A1.5 1.5 0 0 1 9.5 8v4A1.5 1.5 0 0 1 8 13.5H4A1.5 1.5 0 0 1 2.5 12V8A1.5 1.5 0 0 1 4 6.5",clipRule:"evenodd"}));/**
2
+ * @license lucide-react v1.24.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const oe=[["path",{d:"M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z",key:"12oyoe"}],["path",{d:"M21 16v2a4 4 0 0 1-4 4h-5",key:"1x7m43"}]],ie=Q("headset",oe),le="/captain-wechat.jpg";function P(){return window.matchMedia("(hover: hover) and (pointer: fine)").matches}function ce(){return e.jsxs("div",{className:"w-52 rounded-xl bg-overlay p-3 text-overlay-foreground shadow-surface",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"问题反馈"}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-muted",children:"使用问题,建议反馈,可加微信反馈"}),e.jsx("img",{alt:"微信客服二维码:扫码添加 Captain",className:"mt-2.5 block h-auto w-full rounded-lg bg-white",decoding:"async",draggable:!1,height:640,src:le,width:480})]})}function de({variant:t}){const[o,i]=n.useState(!1),x=n.useRef(null),d=t==="link";return n.useEffect(()=>{if(!o)return;const f=h=>{var m;(m=x.current)!=null&&m.contains(h.target)||i(!1)},v=h=>{h.key==="Escape"&&i(!1)};return document.addEventListener("pointerdown",f),document.addEventListener("keydown",v),()=>{document.removeEventListener("pointerdown",f),document.removeEventListener("keydown",v)}},[o]),e.jsxs("div",{ref:x,className:"relative inline-flex",onMouseEnter:()=>{P()&&i(!0)},onMouseLeave:()=>{P()&&i(!1)},children:[e.jsx(A,{"aria-expanded":o,"aria-haspopup":"dialog","aria-label":"问题反馈",className:d?l("h-7 min-h-7 min-w-7 shrink-0 p-0 text-foreground/70 shadow-none","hover:bg-transparent hover:text-foreground","data-[pressed=true]:bg-transparent"):"size-8 min-h-8 min-w-8 shrink-0 p-0",isIconOnly:!0,size:"sm",variant:d?"ghost":"tertiary",onPress:()=>i(f=>!f),children:e.jsx(ie,{"aria-hidden":"true",className:d?"size-4.5":"size-4",strokeWidth:2})}),o?e.jsx("div",{className:l("absolute z-50",d?"bottom-full left-1/2 -translate-x-1/2 pb-2":"top-full right-0 pt-2"),role:"dialog","aria-label":"问题反馈",children:e.jsx(ce,{})}):null]})}const ue={new_user:{badge:"Juejin Usage",headline:["Cursor、Claude、Codex","多工具 Token 与费用","本地面板一张表看完。"],description:"汇总你实际在用的 AI 编码工具用量与趋势,安装后即可查看。"},uninstalled:{badge:"客户端暂未连接",headline:["客户端暂未连接","启动后继续","同步本机用量。"],description:"下载并打开 Juejin Usage,即可把本机 AI 用量同步回这块面板。"}},fe="/e1.png",_=[{id:"install-start",label:"npm",command:"npm i -g @juejin-opensource/jusage && jusage service start"},{id:"npx",label:"npx",command:"npx @juejin-opensource/jusage start"}],U="tud.downloadTarget";function G(){try{const t=sessionStorage.getItem(U);if(t&&E.some(o=>o.id===t))return t}catch{}return null}function me(t){try{sessionStorage.setItem(U,t)}catch{}}function xe({reason:t}){const o=ue[t],[i,x]=n.useState(()=>{const s=G();return s||(typeof navigator>"u"?"macos-arm":H(V(navigator.userAgent,navigator.platform),D(navigator.userAgent)))}),[d,f]=n.useState({}),[v,h]=n.useState(),[m,z]=n.useState(!1),[w,M]=n.useState(!1),[R,W]=n.useState("npx"),[p,N]=n.useState(!1),[I,Z]=n.useState(null),T=n.useRef(G()!==null),g=X(i),$=ne(v),k=_.find(s=>s.id===R)??_[0];n.useEffect(()=>{var u,b;let s=!1;const a=navigator,r=(j,K)=>{var L;s||T.current||x(H(V(a.userAgent,a.platform,K??((L=a.userAgentData)==null?void 0:L.platform)??""),D(a.userAgent,j)))};return r(),(b=(u=a.userAgentData)==null?void 0:u.getHighEntropyValues)==null||b.call(u,["architecture","platform"]).then(j=>{r(j.architecture,j.platform)}).catch(()=>{}),()=>{s=!0}},[]),n.useEffect(()=>{let s=!1;return ee().then(a=>{if(s)return;const r={};for(const u of E){const b=se(a.assets,u.id);b&&(r[u.id]=b)}f(r),h(a.source)}).catch(()=>{}),()=>{s=!0}},[]),n.useEffect(()=>{if(!p)return;const s=window.setTimeout(()=>N(!1),1600);return()=>window.clearTimeout(s)},[p]),n.useEffect(()=>{let s=!1;return fetch("https://api.github.com/repos/juejin-cn/juejin-usage",{headers:{Accept:"application/vnd.github+json"}}).then(a=>a.ok?a.json():null).then(a=>{const r=a==null?void 0:a.stargazers_count;s||typeof r!="number"||!Number.isFinite(r)||Z(he(r))}).catch(()=>{}),()=>{s=!0}},[]);const F=s=>{const a=d[s]??$,r=document.createElement("a");r.href=a,r.rel="noopener noreferrer",r.target="_blank",d[s]&&(r.download=""),document.body.append(r),r.click(),r.remove()},J=async()=>{try{await navigator.clipboard.writeText(k.command),N(!0)}catch{N(!1)}};return e.jsx("section",{className:"flex min-h-[calc(100svh-9rem)] items-start pt-4 pb-10 sm:pt-6 sm:pb-14 lg:pt-8",children:e.jsxs("div",{className:"flex w-full flex-col gap-14 sm:gap-16 lg:gap-20",children:[e.jsxs("div",{className:"grid w-full items-start gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.15fr)] lg:gap-16 xl:gap-20",children:[e.jsxs("div",{className:"max-w-2xl motion-safe:animate-[fade-up_420ms_ease-out] lg:max-w-none",children:[e.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-base text-muted",children:[e.jsx("span",{children:o.badge}),e.jsx("span",{"aria-hidden":"true",className:"text-foreground/25",children:"·"}),g.os==="windows"?e.jsx(S,{className:"size-4 text-foreground/70"}):e.jsx(C,{className:"size-4 text-foreground/70"}),e.jsxs("span",{children:["适用于 ",g.badgePlatform]})]}),e.jsxs("h1",{className:"mt-6 text-[2.15rem] leading-[1.15] font-semibold tracking-tight text-foreground sm:text-5xl sm:leading-[1.12] lg:text-[3.15rem] lg:leading-[1.1]",children:[o.headline[0],e.jsx("br",{}),o.headline[1],e.jsx("br",{}),o.headline[2]]}),e.jsx("p",{className:"mt-5 max-w-xl text-lg leading-8 text-muted",children:o.description}),e.jsxs("div",{className:"mt-9 flex flex-col gap-4",children:[e.jsxs("div",{"aria-label":"下载客户端",className:"inline-flex max-w-full shrink-0 overflow-hidden rounded-full shadow-[0_1px_2px_rgb(0_0_0/0.06)]",role:"group",children:[e.jsxs("button",{className:l(B,"rounded-l-full ps-6 pe-5"),type:"button",onClick:()=>F(i),children:[g.os==="windows"?e.jsx(S,{className:"size-4.5"}):e.jsx(C,{className:"size-4.5"}),g.label]}),e.jsxs(c,{isOpen:m,onOpenChange:z,children:[e.jsx(A,{"aria-expanded":m,"aria-haspopup":"menu","aria-label":"选择其它系统",className:l(B,"h-14! min-h-14! min-w-14 rounded-l-none rounded-r-full border-0 p-0 shadow-none","bg-[#1e80ff]! text-white! hover:bg-[#1171ee]!","relative before:absolute before:inset-y-2.5 before:left-0 before:w-px before:bg-white/30","dark:bg-[#4b9cff]! dark:hover:bg-[#3a8ff0]!"),isIconOnly:!0,variant:"primary",children:e.jsx(O,{"aria-hidden":"true",className:l("size-4.5 transition-transform duration-200 motion-reduce:transition-none",m&&"rotate-180")})}),e.jsx(c.Content,{className:"min-w-56 overflow-hidden rounded-[10px] border-0 bg-overlay p-0 text-overlay-foreground shadow-surface",placement:"bottom start",children:e.jsxs(c.Dialog,{className:"p-0 outline-none",children:[e.jsx(c.Heading,{className:"sr-only",children:"选择下载平台"}),e.jsx("div",{className:"flex flex-col py-1",role:"menu",children:E.map(s=>{const a=s.id===i;return e.jsxs("button",{"aria-current":a?"true":void 0,className:l("flex min-h-11 w-full cursor-pointer items-center gap-2 px-3 text-left text-sm","transition-colors duration-150","hover:bg-surface-secondary","focus-visible:bg-surface-secondary focus-visible:outline-none",a?"text-foreground":"text-foreground/80"),role:"menuitem",type:"button",onClick:()=>{T.current=!0,me(s.id),x(s.id),z(!1)},children:[s.os==="windows"?e.jsx(S,{className:"size-4 text-foreground/70"}):e.jsx(C,{className:"size-4 text-foreground/70"}),e.jsx("span",{className:"min-w-0 flex-1",children:s.menuLabel}),a?e.jsx(y,{"aria-hidden":"true",className:"size-4 text-[#1e80ff] dark:text-[#4b9cff]"}):null]},s.id)})})]})})]})]}),e.jsxs("div",{className:"flex min-h-14 min-w-0 max-w-2xl items-center gap-2 rounded-2xl border border-border bg-surface-secondary/80 p-2 ps-3 dark:bg-overlay/60",children:[e.jsxs(c,{isOpen:w,onOpenChange:M,children:[e.jsxs(A,{"aria-expanded":w,"aria-haspopup":"menu","aria-label":"选择 CLI 启动方式",className:"h-10 min-h-10 shrink-0 gap-1 rounded-full bg-background/80 px-3 text-xs font-medium text-foreground shadow-none hover:bg-background dark:bg-black/10 dark:hover:bg-black/20",variant:"secondary",children:[e.jsx("span",{children:k.label}),e.jsx(O,{"aria-hidden":"true",className:l("size-3.5 transition-transform duration-200 motion-reduce:transition-none",w&&"rotate-180")})]}),e.jsx(c.Content,{className:"min-w-60 overflow-hidden rounded-[10px] border-0 bg-overlay p-0 text-overlay-foreground shadow-surface",placement:"bottom start",children:e.jsxs(c.Dialog,{className:"p-0 outline-none",children:[e.jsx(c.Heading,{className:"sr-only",children:"选择 CLI 启动方式"}),e.jsx("div",{className:"flex flex-col py-1",role:"menu",children:_.map(s=>{const a=s.id===R;return e.jsxs("button",{"aria-current":a?"true":void 0,className:l("flex min-h-11 w-full cursor-pointer items-center gap-2 px-3 text-left text-sm","transition-colors duration-150 hover:bg-surface-secondary","focus-visible:bg-surface-secondary focus-visible:outline-none",a?"text-foreground":"text-foreground/80"),role:"menuitem",type:"button",onClick:()=>{W(s.id),M(!1)},children:[e.jsx("span",{className:"min-w-0 flex-1",children:s.label}),a?e.jsx(y,{"aria-hidden":"true",className:"size-4 text-[#1e80ff] dark:text-[#4b9cff]"}):null]},s.id)})})]})})]}),e.jsx("div",{className:"min-w-0 flex-1 overflow-hidden rounded-xl bg-background/75 px-3 py-2 dark:bg-black/10",children:e.jsxs("code",{className:"block overflow-x-auto whitespace-nowrap font-mono text-sm text-foreground/85 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:["$ ",k.command]})}),e.jsx("button",{"aria-label":p?"安装命令已复制":"复制 CLI 安装命令",className:l("inline-flex size-11 shrink-0 items-center justify-center rounded-full","text-muted transition-colors duration-150","hover:bg-background hover:text-foreground","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent","touch-manipulation"),type:"button",onClick:()=>{J()},children:p?e.jsx(y,{"aria-hidden":"true",className:"size-4 text-[#1e80ff] dark:text-[#4b9cff]"}):e.jsx(re,{"aria-hidden":"true",className:"size-4"})})]})]}),e.jsx("p",{"aria-live":"polite",className:"sr-only",children:p?"安装命令已复制":""}),e.jsxs("p",{className:"mt-5 flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted",children:[e.jsx("span",{children:g.requirement}),e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsx("span",{children:"CLI 需 Node.js 20+"}),e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsxs("a",{className:"inline-flex items-center gap-1 text-foreground/70 transition-colors hover:text-foreground",href:te,rel:"noopener noreferrer",target:"_blank",children:[e.jsx(ge,{className:"size-3.5"}),"Gitee"]}),e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsx(de,{variant:"link"})]}),e.jsxs("a",{"aria-label":"在 GitHub 上 Star 本项目",className:"mt-4 flex w-full max-w-xl items-center gap-4 rounded-2xl border border-border bg-surface-secondary/80 px-5 py-4 shadow-[0_1px_2px_rgb(0_0_0/0.06)] outline-offset-2 transition-colors hover:bg-surface-secondary focus-visible:outline-2 focus-visible:outline-accent dark:bg-overlay/60 dark:hover:bg-overlay/80",href:ae,rel:"noopener noreferrer",target:"_blank",children:[e.jsx(pe,{className:"size-8 shrink-0"}),e.jsxs("span",{className:"min-w-0",children:[e.jsxs("span",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-base font-medium text-foreground",children:"⭐️ Star"}),I?e.jsx("span",{className:"text-sm font-medium tabular-nums text-foreground/55",children:I}):null]}),e.jsx("span",{className:"mt-0.5 block text-sm leading-6 text-muted",children:"开源共享,欢迎提 Issue 与贡献代码"})]})]})]}),e.jsx("div",{className:"min-w-0 motion-safe:animate-[fade-up_520ms_ease-out]",children:e.jsx("figure",{className:"overflow-hidden rounded-2xl border border-border/80 bg-surface shadow-[0_24px_48px_-28px_rgb(15_23_42/0.45)] dark:shadow-[0_24px_48px_-24px_rgb(0_0_0/0.65)]",children:e.jsx("img",{alt:"Juejin Usage 用量看板界面预览:费用、Token、热力图与趋势图",className:"h-auto w-full",decoding:"async",fetchPriority:"high",height:1560,src:fe,width:2102})})})]}),e.jsxs("section",{"aria-labelledby":"supported-tools-heading",className:"w-full",children:[e.jsx("h2",{className:"text-lg font-semibold tracking-tight text-foreground sm:text-xl",id:"supported-tools-heading",children:"支持的工具"}),e.jsx("div",{className:"mt-4",children:e.jsx(q,{className:"lg:grid-cols-3",collapsible:!0})})]})]})})}const B=l("inline-flex h-14 min-h-14 cursor-pointer items-center justify-center gap-2.5","bg-[#1e80ff] text-base font-medium whitespace-nowrap text-white","transition-colors duration-200 motion-reduce:transition-none","hover:bg-[#1171ee] active:brightness-[0.96]","focus-visible:z-10 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#1e80ff]","dark:bg-[#4b9cff] dark:hover:bg-[#3a8ff0] dark:focus-visible:outline-[#4b9cff]","touch-manipulation");function he(t){if(t<1e3)return String(Math.floor(t));const o=t/1e3,i=t>=1e4?0:1;return`${o.toFixed(i).replace(/\.0$/,"")}k`}function pe({className:t}){return e.jsx("svg",{"aria-hidden":"true",className:t,fill:"currentColor",focusable:"false",overflow:"visible",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M10.226 17.284c-2.965-.36-5.054-2.493-5.054-5.256 0-1.123.404-2.336 1.078-3.144-.292-.741-.247-2.314.09-2.965.898-.112 2.111.36 2.83 1.01.853-.269 1.752-.404 2.853-.404 1.1 0 1.999.135 2.807.382.696-.629 1.932-1.1 2.83-.988.315.606.36 2.179.067 2.942.72.854 1.101 2 1.101 3.167 0 2.763-2.089 4.852-5.098 5.234.763.494 1.28 1.572 1.28 2.807v2.336c0 .674.561 1.056 1.235.786 4.066-1.55 7.255-5.615 7.255-10.646C23.5 6.188 18.334 1 11.978 1 5.62 1 .5 6.188.5 12.545c0 4.986 3.167 9.12 7.435 10.669.606.225 1.19-.18 1.19-.786V20.63a2.9 2.9 0 0 1-1.078.224c-1.483 0-2.359-.808-2.987-2.313-.247-.607-.517-.966-1.034-1.033-.27-.023-.359-.135-.359-.27 0-.27.45-.471.898-.471.652 0 1.213.404 1.797 1.235.45.651.921.943 1.483.943.561 0 .92-.202 1.437-.719.382-.381.674-.718.944-.943"})})}function C({className:t}){return e.jsx("svg",{"aria-hidden":"true",className:t,fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"})})}function ge({className:t}){return e.jsx("svg",{"aria-hidden":"true",className:t,fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M11.984 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.016 0zm6.09 5.333c.328 0 .593.266.592.593v1.482a.594.594 0 0 1-.593.592H9.777c-.982 0-1.778.796-1.778 1.778v5.63c0 .327.266.592.593.592h5.63c.982 0 1.778-.796 1.778-1.778v-.296a.593.593 0 0 0-.592-.593h-4.15a.592.592 0 0 1-.592-.592v-1.482a.593.593 0 0 1 .593-.592h6.815c.327 0 .593.265.593.592v3.408a4 4 0 0 1-4 4H5.926a.593.593 0 0 1-.593-.593V9.778a4.444 4.444 0 0 1 4.445-4.444h8.296z"})})}function S({className:t}){return e.jsx("svg",{"aria-hidden":"true",className:t,fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{d:"M3 5.2 11.2 4v7.4H3V5.2Zm8.9-1.4L21 2.6v8.8h-9.1V3.8ZM3 13.4h8.2V21L3 19.7v-6.3Zm8.9 0H21V21.4l-9.1-1.3v-6.7Z"})})}function je(){const t=Y(),o=(t==null?void 0:t.reason)==="uninstalled"?"uninstalled":"new_user";return e.jsx(xe,{reason:o})}export{je as component};
@@ -0,0 +1 @@
1
+ import{t as x,am as p,j as o,cf as E,r as c,cg as j,aT as f,bg as $,cb as R,aU as T,bT as A,ch as S,ci as P,aR as O}from"./index-flWmwEjH.js";const C=x({slots:{base:"popover",dialog:"popover__dialog",heading:"popover__heading",trigger:"popover__trigger"}}),d=c.createContext({}),g=({children:e,...t})=>{const r=p.useMemo(()=>C(),[]);return o.jsx(d,{value:{slots:r},children:o.jsx(E,{"data-slot":"popover-root",...t,children:e})})},L=({children:e,className:t,...r})=>{const{slots:n}=c.use(d);return o.jsx(d,{value:{slots:n},children:o.jsx($,{value:{variant:"default"},children:o.jsx(R,{...r,className:T(t,n==null?void 0:n.base()),children:e})})})},I=({children:e,className:t,...r})=>{const n=o.jsx("svg",{"data-slot":"popover-overlay-arrow",fill:"none",height:"12",viewBox:"0 0 12 12",width:"12",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{d:"M0 0C5.48483 8 6.5 8 12 0Z"})}),s=p.isValidElement(e)?p.cloneElement(e,{"data-slot":"popover-overlay-arrow"}):n;return o.jsx(A,{"data-slot":"popover-overlay-arrow-group",...r,className:t,children:s})},N=({children:e,className:t,...r})=>{const{slots:n}=c.use(d);return o.jsx(S,{"data-slot":"popover-dialog",...r,className:f(n==null?void 0:n.dialog,t),children:e})},y=({children:e,className:t,...r})=>{const{slots:n}=c.use(d);return o.jsx(P,{children:o.jsx(O.div,{className:f(n==null?void 0:n.trigger,t),"data-slot":"popover-trigger",role:"button",...r,children:e})})},k=({children:e,className:t,...r})=>{const{slots:n}=c.use(d);return o.jsx(j,{slot:"title",...r,className:f(n==null?void 0:n.heading,t),children:e})},J=Object.assign(g,{Root:g,Trigger:y,Dialog:N,Arrow:I,Content:L,Heading:k}),K=e=>c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),c.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.488 3.43a.75.75 0 0 1 .081 1.058l-6 7a.75.75 0 0 1-1.1.042l-3.5-3.5A.75.75 0 0 1 4.03 6.97l2.928 2.927 5.473-6.385a.75.75 0 0 1 1.057-.081",clipRule:"evenodd"})),D="https://gitee.com/juejin-cn/juejin-usage",G=`${D}/releases`,M="https://gitee.com/api/v5/repos/juejin-cn/juejin-usage/releases?per_page=20&direction=desc",U="https://github.com/juejin-cn/juejin-usage",B=`${U}/releases`,H="https://api.github.com/repos/juejin-cn/juejin-usage/releases?per_page=20",W=8e3,_=[{id:"macos-arm",os:"macos",label:"下载 macOS",menuLabel:"macOS(Apple Silicon)",badgePlatform:"macOS",requirement:"macOS 14+"},{id:"macos-intel",os:"macos",label:"下载 macOS(Intel)",menuLabel:"macOS(Intel)",badgePlatform:"macOS",requirement:"macOS 14+"},{id:"windows",os:"windows",label:"下载 Windows",menuLabel:"Windows",badgePlatform:"Windows",requirement:"Windows 10+"}],F=new Map(_.map(e=>[e.id,e]));function Q(e){return F.get(e)??_[0]}function X(e,t="",r=""){const n=`${r} ${t} ${e}`.toLowerCase();return/\bwin(?:dows|32|64|ce)?\b/.test(n)||n.includes("windows")?"windows":n.includes("mac")||n.includes("darwin")||n.includes("iphone")||n.includes("ipad")||n.includes("ipod")?"macos":"other"}function ee(e,t=""){const r=t.toLowerCase();return r.includes("arm")?"arm":r.includes("x86")||r.includes("x64")||r.includes("amd64")||/\bintel\b/i.test(e)?"x64":"unknown"}function te(e,t="unknown"){return e==="windows"?"windows":e==="macos"&&t==="x64"?"macos-intel":"macos-arm"}function w(e){const t=e.trim().replace(/^v/i,""),r=t.indexOf("-"),n=r===-1?t:t.slice(0,r),s=r===-1?null:t.slice(r+1);return{parts:n.split(".").map(l=>{const a=Number.parseInt(l,10);return Number.isFinite(a)?a:0}),prerelease:s}}function q(e,t){const r=w(e),n=w(t),s=Math.max(r.parts.length,n.parts.length);for(let i=0;i<s;i+=1){const l=(r.parts[i]??0)-(n.parts[i]??0);if(l!==0)return l}return r.prerelease==null&&n.prerelease!=null?1:r.prerelease!=null&&n.prerelease==null?-1:r.prerelease!=null&&n.prerelease!=null?r.prerelease.localeCompare(n.prerelease,"en",{numeric:!0}):0}function h(e){if(!e)return 0;const t=Date.parse(e);return Number.isFinite(t)?t:0}function z(e){const t=e.filter(r=>!r.draft);return t.length===0?null:t.reduce((r,n)=>{const s=q(n.tag_name??"",r.tag_name??"");return s>0?n:s<0?r:h(n.created_at)>h(r.created_at)?n:r})}function v(e){return!/\.(blockmap|yml|yaml|zip|tar\.gz)$/i.test(e)}function m(e){return e.some(t=>v(t.name)&&/\.(dmg|exe)$/i.test(t.name))}function re(e,t){var n,s,i,l;const r=e.filter(a=>v(a.name));if(t==="windows"){const a=r.find(u=>/\.exe$/i.test(u.name)&&/setup/i.test(u.name)&&!/portable/i.test(u.name));return a?a.browser_download_url:((n=r.find(u=>/\.exe$/i.test(u.name)&&!/portable/i.test(u.name)))==null?void 0:n.browser_download_url)??null}return t==="macos-arm"?((s=r.find(a=>/arm64\.dmg$/i.test(a.name)))==null?void 0:s.browser_download_url)??null:((i=r.find(a=>/x64\.dmg$/i.test(a.name)))==null?void 0:i.browser_download_url)??((l=r.find(a=>/\.dmg$/i.test(a.name)&&!/arm64/i.test(a.name)))==null?void 0:l.browser_download_url)??null}function ne(e){return e==="github"?B:G}function V(e,t){return{source:e,tagName:t.tag_name,assets:t.assets??[]}}function Y(e,t){if(e&&m(e.assets))return e;if(t&&m(t.assets))return t;throw new Error("No published desktop release")}async function b(e,t){const r=new AbortController,n=setTimeout(()=>r.abort(),W);try{const s=await fetch(e,{headers:{Accept:t==="github"?"application/vnd.github+json":"application/json"},signal:r.signal});if(!s.ok)throw new Error(`${t} releases ${s.status}`);const i=await s.json(),l=z(i);if(!l)throw new Error(`No published ${t} release`);return V(t,l)}finally{clearTimeout(n)}}async function se(){let e=null;try{e=await b(M,"gitee")}catch{e=null}if(e&&m(e.assets))return e;const t=await b(H,"github");return Y(e,t)}export{K as C,_ as D,U as G,J as P,X as a,D as b,ne as c,ee as d,se as f,Q as g,re as m,te as r};
@@ -0,0 +1 @@
1
+ import{r as s,$ as bl,au as gl,a7 as $l,t as L,aX as Y,aC as T,ax as F,am as f,G as z,ac as hl,aG as xl,bU as Ee,Z as R,bV as pl,bW as vl,bX as ml,ae as J,y as Se,w as Me,bY as ge,bZ as N,av as $e,U as Q,V as yl,K as Pl,W as K,b_ as Dl,b$ as O,_ as Bl,ab as Re,ak as Ae,a5 as he,c0 as Cl,aD as we,at as El,ag as Sl,c1 as Ml,c2 as Rl,ai as H,aj as Fe,al as k,aJ as Al,an as ee,c3 as wl,aK as Fl,c4 as Ke,b1 as ke,ay as ze,c5 as Kl,ah as Le,c6 as kl,b3 as U,ar as zl,as as Ll,az as Il,aA as Vl,c7 as Tl,X as jl,c8 as Nl,af as Ol,aZ as Ul,a_ as Zl,bM as _l,O as ql,aY as Wl,a$ as Ie,b0 as Gl,b2 as Xl,aq as Ve,c9 as Yl,ca as Jl,b5 as Ql,j as B,bK as Hl,aR as Te,aT as X,aU as I,bg as ea,cb as ta,cc as xe,cd as la,ce as aa}from"./index-flWmwEjH.js";function ra(l,e){let{collection:a,onLoadMore:t,scrollOffset:r=1,direction:o="end"}=l,i=s.useRef(null),u=bl(n=>{for(let b of n)b.isIntersecting&&t&&t()});gl(()=>{if(e.current){const n=100*r,b=o==="start"?`${n}% 0px 0px 0px`:`0px ${n}% ${n}% ${n}%`;i.current=new IntersectionObserver(u,{root:$l(e==null?void 0:e.current),rootMargin:b}),i.current.observe(e.current)}return()=>{i.current&&i.current.disconnect()}},[a,e,r,o])}const oa=L({base:"label",defaultVariants:{isDisabled:!1,isInvalid:!1,isRequired:!1},variants:{isDisabled:{true:"label--disabled"},isInvalid:{true:"label--invalid"},isRequired:{true:"label--required"}}}),ia=L({base:"list-box",defaultVariants:{variant:"default"},variants:{variant:{danger:"list-box--danger",default:"list-box--default"}}}),sa=L({defaultVariants:{variant:"default"},slots:{indicator:"list-box-item__indicator",item:"list-box-item"},variants:{variant:{danger:{item:"list-box-item--danger"},default:{item:"list-box-item--default"}}}}),na=L({base:"list-box-section"}),ua=L({defaultVariants:{fullWidth:!1,variant:"primary"},slots:{base:"select",indicator:"select__indicator",popover:"select__popover",trigger:"select__trigger",value:"select__value"},variants:{fullWidth:{false:{},true:{base:"select--full-width",trigger:"select__trigger--full-width"}},variant:{primary:{base:"select--primary"},secondary:{base:"select--secondary"}}}}),ca=L({defaultVariants:{animationType:"shimmer"},slots:{base:"skeleton"},variants:{animationType:{none:"skeleton--none",pulse:"skeleton--pulse",shimmer:"skeleton--shimmer"}}}),te=s.createContext({}),da=Y(function(e,a){[e,a]=T(e,a,te);let{elementType:t="label",...r}=e,o=F[t];return f.createElement(o,{className:"react-aria-Label",...r,ref:a})});function je(l){let{id:e,label:a,"aria-labelledby":t,"aria-label":r,labelElementType:o="label"}=l;e=z(e);let i=z(),u={};a&&(t=t?`${i} ${t}`:i,u={id:i,htmlFor:o==="label"?e:void 0});let n=hl({id:e,"aria-label":r,"aria-labelledby":t});return{labelProps:u,fieldProps:n}}const fa=s.createContext(null),ar=s.createContext(null),ba=s.createContext({}),ga=s.createContext({}),ue=class ue extends xl{filter(e,a){let t=a.getItem(this.prevKey);if(t&&t.type!=="separator"){let r=this.clone();return a.addDescendants(r,e),r}return null}};ue.type="separator";let pe=ue;var Ne={};Ne={longPressMessage:"اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة"};var Oe={};Oe={longPressMessage:"Натиснете продължително или натиснете Alt+ стрелка надолу, за да отворите менюто"};var Ue={};Ue={longPressMessage:"Dlouhým stiskem nebo stisknutím kláves Alt + šipka dolů otevřete nabídku"};var Ze={};Ze={longPressMessage:"Langt tryk eller tryk på Alt + pil ned for at åbne menuen"};var _e={};_e={longPressMessage:"Drücken Sie lange oder drücken Sie Alt + Nach-unten, um das Menü zu öffnen"};var qe={};qe={longPressMessage:"Πιέστε παρατεταμένα ή πατήστε Alt + κάτω βέλος για να ανοίξετε το μενού"};var We={};We={longPressMessage:"Long press or press Alt + ArrowDown to open menu"};var Ge={};Ge={longPressMessage:"Mantenga pulsado o pulse Alt + flecha abajo para abrir el menú"};var Xe={};Xe={longPressMessage:"Menüü avamiseks vajutage pikalt või vajutage klahve Alt + allanool"};var Ye={};Ye={longPressMessage:"Avaa valikko painamalla pohjassa tai näppäinyhdistelmällä Alt + Alanuoli"};var Je={};Je={longPressMessage:"Appuyez de manière prolongée ou appuyez sur Alt + Flèche vers le bas pour ouvrir le menu."};var Qe={};Qe={longPressMessage:"לחץ לחיצה ארוכה או הקש Alt + ArrowDown כדי לפתוח את התפריט"};var He={};He={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika"};var et={};et={longPressMessage:"Nyomja meg hosszan, vagy nyomja meg az Alt + lefele nyíl gombot a menü megnyitásához"};var tt={};tt={longPressMessage:"Premi a lungo o premi Alt + Freccia giù per aprire il menu"};var lt={};lt={longPressMessage:"長押しまたは Alt+下矢印キーでメニューを開く"};var at={};at={longPressMessage:"길게 누르거나 Alt + 아래쪽 화살표를 눌러 메뉴 열기"};var rt={};rt={longPressMessage:"Norėdami atidaryti meniu, nuspaudę palaikykite arba paspauskite „Alt + ArrowDown“."};var ot={};ot={longPressMessage:"Lai atvērtu izvēlni, turiet nospiestu vai nospiediet taustiņu kombināciju Alt + lejupvērstā bultiņa"};var it={};it={longPressMessage:"Langt trykk eller trykk Alt + PilNed for å åpne menyen"};var st={};st={longPressMessage:"Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen"};var nt={};nt={longPressMessage:"Naciśnij i przytrzymaj lub naciśnij klawisze Alt + Strzałka w dół, aby otworzyć menu"};var ut={};ut={longPressMessage:"Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu"};var ct={};ct={longPressMessage:"Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu"};var dt={};dt={longPressMessage:"Apăsați lung sau apăsați pe Alt + săgeată în jos pentru a deschide meniul"};var ft={};ft={longPressMessage:"Нажмите и удерживайте или нажмите Alt + Стрелка вниз, чтобы открыть меню"};var bt={};bt={longPressMessage:"Ponuku otvoríte dlhým stlačením alebo stlačením klávesu Alt + klávesu so šípkou nadol"};var gt={};gt={longPressMessage:"Za odprtje menija pritisnite in držite gumb ali pritisnite Alt+puščica navzdol"};var $t={};$t={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni"};var ht={};ht={longPressMessage:"Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn"};var xt={};xt={longPressMessage:"Menüyü açmak için uzun basın veya Alt + Aşağı Ok tuşuna basın"};var pt={};pt={longPressMessage:"Довго або звичайно натисніть комбінацію клавіш Alt і стрілка вниз, щоб відкрити меню"};var vt={};vt={longPressMessage:"长按或按 Alt + 向下方向键以打开菜单"};var mt={};mt={longPressMessage:"長按或按 Alt+向下鍵以開啟功能表"};var yt={};yt={"ar-AE":Ne,"bg-BG":Oe,"cs-CZ":Ue,"da-DK":Ze,"de-DE":_e,"el-GR":qe,"en-US":We,"es-ES":Ge,"et-EE":Xe,"fi-FI":Ye,"fr-FR":Je,"he-IL":Qe,"hr-HR":He,"hu-HU":et,"it-IT":tt,"ja-JP":lt,"ko-KR":at,"lt-LT":rt,"lv-LV":ot,"nb-NO":it,"nl-NL":st,"pl-PL":nt,"pt-BR":ut,"pt-PT":ct,"ro-RO":dt,"ru-RU":ft,"sk-SK":bt,"sl-SI":gt,"sr-SP":$t,"sv-SE":ht,"tr-TR":xt,"uk-UA":pt,"zh-CN":vt,"zh-TW":mt};function $a(l){let{onContextMenu:e}=l,a=s.useRef(!1),{longPressProps:t}=Ee({onLongPressStart(){a.current=!1},onLongPress(r){a.current?a.current=!1:e==null||e({target:r.target,x:r.x,y:r.y})}});return e?{contextMenuProps:R(pl()?t:{},{onContextMenu(r){r.stopPropagation(),r.preventDefault(),a.current=!0;let o=r.currentTarget.getBoundingClientRect();e({target:r.currentTarget,x:r.clientX-o.x,y:r.clientY-o.y})},onKeyDown(r){if(vl()&&r.ctrlKey&&r.key==="Enter"){a.current=!1;let o=r.currentTarget;r.stopPropagation(),setTimeout(()=>{if(a.current)a.current=!1;else{let i=o.getBoundingClientRect();e({target:o,x:i.width/2,y:i.height/2})}},10)}}})}:{contextMenuProps:{}}}function ha(l){return l&&l.__esModule?l.default:l}function xa(l,e,a){let{type:t="menu",isDisabled:r,trigger:o="press"}=l,i=z(),{triggerProps:u,overlayProps:n}=ml({type:t},e,a),b=(c,m,P="first")=>{if(!c||m.isDefaultPrevented())return!1;e.toggle(P)},{keyboardProps:d}=J({isDisabled:r,shortcuts:{Enter:c=>b(o!=="longPress",c,"first")," ":c=>b(o!=="longPress",c,"first"),ArrowDown:c=>b(o!=="longPress",c,"first"),ArrowUp:c=>b(o!=="longPress",c,"last"),"Alt+Enter":c=>b(o==="longPress",c,"first"),"Alt+ ":c=>b(o==="longPress",c,"first"),"Alt+ArrowDown":c=>b(!0,c,"first"),"Alt+ArrowUp":c=>b(!0,c,"last")}}),$=Se(ha(yt),"@react-aria/menu"),{longPressProps:x}=Ee({isDisabled:r||o!=="longPress",accessibilityDescription:$.format("longPressMessage"),onLongPressStart(){e.close()},onLongPress(){e.open("first")}}),g={preventFocusOnPress:!0,onPressStart(c){c.pointerType!=="touch"&&c.pointerType!=="keyboard"&&!r&&(ge(c.target),e.open(c.pointerType==="virtual"?"first":null))},onPress(c){c.pointerType==="touch"&&!r&&(ge(c.target),e.toggle())}};delete u.onPress;let{contextMenuProps:p}=$a({onContextMenu(c){let m=c.target.getBoundingClientRect();e.setPoint({x:m.x+c.x,y:m.y+c.y}),e.open()}});s.useEffect(()=>{if(e.isOpen&&o==="contextMenu"){let c=m=>{(m.button===2||m.button===0&&m.ctrlKey===!0)&&Me(m)===document.body&&e.close()};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)}},[e,o]);let v;if(o==="press")v={...g,...d};else if(o==="longPress")v={...x,...d};else if(o==="contextMenu"){v=p;let{"aria-haspopup":c,"aria-expanded":m,"aria-controls":P,...h}=u;u=h}return{menuTriggerProps:{...u,...v,id:i},menuProps:{...n,"aria-labelledby":i,autoFocus:e.focusStrategy||!0,onClose:e.close}}}class ve{constructor(e){this.ref=e}getItemRect(e){let a=this.ref.current;if(!a)return null;let t=e!=null?N(this.ref,e):null;if(!t)return null;let r=a.getBoundingClientRect(),o=t.getBoundingClientRect();return{x:o.left-r.left-a.clientLeft+a.scrollLeft,y:o.top-r.top-a.clientTop+a.scrollTop,width:o.width,height:o.height}}getContentSize(){let e=this.ref.current;return{width:(e==null?void 0:e.scrollWidth)??0,height:(e==null?void 0:e.scrollHeight)??0}}getVisibleRect(){let e=this.ref.current;return{x:(e==null?void 0:e.scrollLeft)??0,y:(e==null?void 0:e.scrollTop)??0,width:(e==null?void 0:e.clientWidth)??0,height:(e==null?void 0:e.clientHeight)??0}}}class le{constructor(...e){if(e.length===1){let a=e[0];this.collection=a.collection,this.ref=a.ref,this.collator=a.collator,this.disabledKeys=a.disabledKeys||new Set,this.disabledBehavior=a.disabledBehavior||"all",this.orientation=a.orientation||"vertical",this.direction=a.direction,this.layout=a.layout||"stack",this.layoutDelegate=a.layoutDelegate||new ve(a.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new ve(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}isDisabled(e){var a,t;return this.disabledBehavior==="all"&&(((a=e.props)==null?void 0:a.isDisabled)||this.disabledKeys.has(e.key))&&((t=e.props)==null?void 0:t.disabledBehavior)!=="selection"}findNextNonDisabled(e,a,t=!1){let r=e;for(;r!=null;){let o=this.collection.getItem(r);if((o==null?void 0:o.type)==="item"&&(t||!this.isDisabled(o)))return r;r=a(r)}return null}getNextKey(e,a){let t=e;return t=this.collection.getKeyAfter(t),this.findNextNonDisabled(t,r=>this.collection.getKeyAfter(r),a==null?void 0:a.includeDisabled)}getPreviousKey(e,a){let t=e;return t=this.collection.getKeyBefore(t),this.findNextNonDisabled(t,r=>this.collection.getKeyBefore(r),a==null?void 0:a.includeDisabled)}findKey(e,a,t){let r=e,o=this.layoutDelegate.getItemRect(r);if(!o||r==null)return null;let i=o;do{if(r=a(r),r==null)break;o=this.layoutDelegate.getItemRect(r)}while(o&&t(i,o)&&r!=null);return r}isSameRow(e,a){return e.y===a.y||e.x!==a.x}isSameColumn(e,a){return e.x===a.x||e.y!==a.y}isReversed(e){let a=this.getNextKey(e),t=N(this.ref,e);if(a!=null){let o=N(this.ref,a);return!t||!o?!1:t.getBoundingClientRect().top>o.getBoundingClientRect().top}let r=this.getPreviousKey(e);if(r!=null){let o=N(this.ref,r);return!t||!o?!1:o.getBoundingClientRect().top>t.getBoundingClientRect().top}return!1}getKeyBelow(e,a){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,t=>this.getNextKey(t,a),this.isSameRow):this.orientation==="vertical"?this.isReversed(e)?this.getPreviousKey(e,a):this.getNextKey(e,a):this.getNextKey(e,a)}getKeyAbove(e,a){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,t=>this.getPreviousKey(t,a),this.isSameRow):this.orientation==="vertical"?this.isReversed(e)?this.getNextKey(e,a):this.getPreviousKey(e,a):this.getPreviousKey(e,a)}getNextColumn(e,a,t){return a?this.getPreviousKey(e,t):this.getNextKey(e,t)}getKeyRightOf(e,a){let t=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[t]?(e=this.layoutDelegate[t](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[t](r),a==null?void 0:a.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl",a):this.findKey(e,r=>this.getNextColumn(r,this.direction==="rtl",a),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl",a):null}getKeyLeftOf(e,a){let t=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[t]?(e=this.layoutDelegate[t](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[t](r),a==null?void 0:a.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr",a):this.findKey(e,r=>this.getNextColumn(r,this.direction==="ltr",a),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr",a):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,a=>this.collection.getKeyAfter(a))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,a=>this.collection.getKeyBefore(a))}getKeyPageAbove(e){let a=this.ref.current,t=this.layoutDelegate.getItemRect(e);if(!t)return null;let r=this.isReversed(e);if(a&&!$e(a))return this.getFirstKey();let o=e;if(this.orientation==="horizontal"){let i=Math.max(0,t.x+t.width-this.layoutDelegate.getVisibleRect().width);for(;t&&t.x>i&&o!=null;)o=this.getKeyAbove(o),t=o==null?null:this.layoutDelegate.getItemRect(o)}else{let i=this.layoutDelegate.getVisibleRect(),u=r?t.y-i.height:Math.max(0,t.y+t.height-i.height);for(;t&&t.y>u&&o!=null;)o=this.getKeyAbove(o),t=o==null?null:this.layoutDelegate.getItemRect(o)}return o??(r?this.getLastKey():this.getFirstKey())}getKeyPageBelow(e){let a=this.ref.current,t=this.layoutDelegate.getItemRect(e);if(!t)return null;let r=this.isReversed(e);if(a&&!$e(a))return this.getLastKey();let o=e;if(this.orientation==="horizontal"){let i=Math.min(this.layoutDelegate.getContentSize().width,t.x-t.width+this.layoutDelegate.getVisibleRect().width);for(;t&&t.x<i&&o!=null;)o=this.getKeyBelow(o),t=o==null?null:this.layoutDelegate.getItemRect(o)}else{let i=Math.min(this.layoutDelegate.getContentSize().height,t.y-t.height+this.layoutDelegate.getVisibleRect().height);for(;t&&t.y<i&&o!=null;)o=this.getKeyBelow(o),t=o==null?null:this.layoutDelegate.getItemRect(o)}return o??(r?this.getFirstKey():this.getLastKey())}getKeyForSearch(e,a){if(!this.collator)return null;let t=this.collection,r=a||this.getFirstKey();for(;r!=null;){let o=t.getItem(r);if(!o)return null;let i=o.textValue.slice(0,e.length);if(o.textValue&&this.collator.compare(i,e)===0)return r;r=this.getNextKey(r)}return null}}let W=new Map;function ae(l){let{locale:e}=Q(),a=e+(l?Object.entries(l).sort((r,o)=>r[0]<o[0]?-1:1).join():"");if(W.has(a))return W.get(a);let t=new Intl.Collator(e,l);return W.set(a,t),t}function pa(l){let{selectionManager:e,collection:a,disabledKeys:t,ref:r,keyboardDelegate:o,layoutDelegate:i,orientation:u}=l,n=ae({usage:"search",sensitivity:"base"}),b=e.disabledBehavior,d=s.useMemo(()=>o||new le({collection:a,disabledKeys:t,disabledBehavior:b,ref:r,collator:n,layoutDelegate:i,orientation:u}),[o,i,a,t,r,n,b,u]),{collectionProps:$}=yl({...l,ref:r,selectionManager:e,keyboardDelegate:d});return{listProps:$}}const me=new WeakMap;function va(l){let e=me.get(l);if(e!=null)return e;let a=0,t=r=>{for(let o of r)o.type==="section"?t(Pl(o,l)):o.type==="item"&&a++};return t(l),me.set(l,a),a}var Pt={};Pt={colorSwatchPicker:"تغييرات الألوان",dropzoneLabel:"DropZone",selectPlaceholder:"حدد عنصرًا",tableResizer:"أداة تغيير الحجم"};var Dt={};Dt={colorSwatchPicker:"Цветови мостри",dropzoneLabel:"DropZone",selectPlaceholder:"Изберете предмет",tableResizer:"Преоразмерител"};var Bt={};Bt={colorSwatchPicker:"Vzorky barev",dropzoneLabel:"Místo pro přetažení",selectPlaceholder:"Vyberte položku",tableResizer:"Změna velikosti"};var Ct={};Ct={colorSwatchPicker:"Farveprøver",dropzoneLabel:"DropZone",selectPlaceholder:"Vælg et element",tableResizer:"Størrelsesændring"};var Et={};Et={colorSwatchPicker:"Farbfelder",dropzoneLabel:"Ablegebereich",selectPlaceholder:"Element wählen",tableResizer:"Größenanpassung"};var St={};St={colorSwatchPicker:"Χρωματικά δείγματα",dropzoneLabel:"DropZone",selectPlaceholder:"Επιλέξτε ένα αντικείμενο",tableResizer:"Αλλαγή μεγέθους"};var Mt={};Mt={selectPlaceholder:"Select an item",tableResizer:"Resizer",dropzoneLabel:"DropZone",colorSwatchPicker:"Color swatches"};var Rt={};Rt={colorSwatchPicker:"Muestras de colores",dropzoneLabel:"DropZone",selectPlaceholder:"Seleccionar un artículo",tableResizer:"Cambiador de tamaño"};var At={};At={colorSwatchPicker:"Värvinäidised",dropzoneLabel:"DropZone",selectPlaceholder:"Valige üksus",tableResizer:"Suuruse muutja"};var wt={};wt={colorSwatchPicker:"Värimallit",dropzoneLabel:"DropZone",selectPlaceholder:"Valitse kohde",tableResizer:"Koon muuttaja"};var Ft={};Ft={colorSwatchPicker:"Échantillons de couleurs",dropzoneLabel:"DropZone",selectPlaceholder:"Sélectionner un élément",tableResizer:"Redimensionneur"};var Kt={};Kt={colorSwatchPicker:"דוגמיות צבע",dropzoneLabel:"DropZone",selectPlaceholder:"בחר פריט",tableResizer:"שינוי גודל"};var kt={};kt={colorSwatchPicker:"Uzorci boja",dropzoneLabel:"Zona spuštanja",selectPlaceholder:"Odaberite stavku",tableResizer:"Promjena veličine"};var zt={};zt={colorSwatchPicker:"Színtárak",dropzoneLabel:"DropZone",selectPlaceholder:"Válasszon ki egy elemet",tableResizer:"Átméretező"};var Lt={};Lt={colorSwatchPicker:"Campioni di colore",dropzoneLabel:"Zona di rilascio",selectPlaceholder:"Seleziona un elemento",tableResizer:"Ridimensionamento"};var It={};It={colorSwatchPicker:"カラースウォッチ",dropzoneLabel:"ドロップゾーン",selectPlaceholder:"項目を選択",tableResizer:"サイズ変更ツール"};var Vt={};Vt={colorSwatchPicker:"색상 견본",dropzoneLabel:"드롭 영역",selectPlaceholder:"항목 선택",tableResizer:"크기 조정기"};var Tt={};Tt={colorSwatchPicker:"Spalvų pavyzdžiai",dropzoneLabel:"„DropZone“",selectPlaceholder:"Pasirinkite elementą",tableResizer:"Dydžio keitiklis"};var jt={};jt={colorSwatchPicker:"Krāsu paraugi",dropzoneLabel:"DropZone",selectPlaceholder:"Izvēlēties vienumu",tableResizer:"Izmēra mainītājs"};var Nt={};Nt={colorSwatchPicker:"Fargekart",dropzoneLabel:"Droppsone",selectPlaceholder:"Velg et element",tableResizer:"Størrelsesendrer"};var Ot={};Ot={colorSwatchPicker:"kleurstalen",dropzoneLabel:"DropZone",selectPlaceholder:"Selecteer een item",tableResizer:"Resizer"};var Ut={};Ut={colorSwatchPicker:"Próbki kolorów",dropzoneLabel:"Strefa upuszczania",selectPlaceholder:"Wybierz element",tableResizer:"Zmiana rozmiaru"};var Zt={};Zt={colorSwatchPicker:"Amostras de cores",dropzoneLabel:"DropZone",selectPlaceholder:"Selecione um item",tableResizer:"Redimensionador"};var _t={};_t={colorSwatchPicker:"Amostras de cores",dropzoneLabel:"DropZone",selectPlaceholder:"Selecione um item",tableResizer:"Redimensionador"};var qt={};qt={colorSwatchPicker:"Specimene de culoare",dropzoneLabel:"Zonă de plasare",selectPlaceholder:"Selectați un element",tableResizer:"Instrument de redimensionare"};var Wt={};Wt={colorSwatchPicker:"Цветовые образцы",dropzoneLabel:"DropZone",selectPlaceholder:"Выберите элемент",tableResizer:"Средство изменения размера"};var Gt={};Gt={colorSwatchPicker:"Vzorkovníky farieb",dropzoneLabel:"DropZone",selectPlaceholder:"Vyberte položku",tableResizer:"Nástroj na zmenu veľkosti"};var Xt={};Xt={colorSwatchPicker:"Barvne palete",dropzoneLabel:"DropZone",selectPlaceholder:"Izberite element",tableResizer:"Spreminjanje velikosti"};var Yt={};Yt={colorSwatchPicker:"Uzorci boje",dropzoneLabel:"DropZone",selectPlaceholder:"Izaberite stavku",tableResizer:"Promena veličine"};var Jt={};Jt={colorSwatchPicker:"Färgrutor",dropzoneLabel:"DropZone",selectPlaceholder:"Välj en artikel",tableResizer:"Storleksändrare"};var Qt={};Qt={colorSwatchPicker:"Renk örnekleri",dropzoneLabel:"Bırakma Bölgesi",selectPlaceholder:"Bir öğe seçin",tableResizer:"Yeniden boyutlandırıcı"};var Ht={};Ht={colorSwatchPicker:"Зразки кольорів",dropzoneLabel:"DropZone",selectPlaceholder:"Виберіть елемент",tableResizer:"Засіб змінення розміру"};var el={};el={colorSwatchPicker:"颜色色板",dropzoneLabel:"放置区域",selectPlaceholder:"选择一个项目",tableResizer:"尺寸调整器"};var tl={};tl={colorSwatchPicker:"色票",dropzoneLabel:"放置區",selectPlaceholder:"選取項目",tableResizer:"大小調整器"};var ll={};ll={"ar-AE":Pt,"bg-BG":Dt,"cs-CZ":Bt,"da-DK":Ct,"de-DE":Et,"el-GR":St,"en-US":Mt,"es-ES":Rt,"et-EE":At,"fi-FI":wt,"fr-FR":Ft,"he-IL":Kt,"hr-HR":kt,"hu-HU":zt,"it-IT":Lt,"ja-JP":It,"ko-KR":Vt,"lt-LT":Tt,"lv-LV":jt,"nb-NO":Nt,"nl-NL":Ot,"pl-PL":Ut,"pt-BR":Zt,"pt-PT":_t,"ro-RO":qt,"ru-RU":Wt,"sk-SK":Gt,"sl-SI":Xt,"sr-SP":Yt,"sv-SE":Jt,"tr-TR":Qt,"uk-UA":Ht,"zh-CN":el,"zh-TW":tl};const Z=s.createContext({}),al=s.createContext(null),ma=s.forwardRef(function(e,a){let{render:t}=s.useContext(al);return f.createElement(f.Fragment,null,t(e,a))});function rl(l,e){var o;let a=l==null?void 0:l.renderDropIndicator,t=(o=l==null?void 0:l.isVirtualDragging)==null?void 0:o.call(l),r=s.useCallback(i=>{if(t||e!=null&&e.isDropTarget(i))return a?a(i):f.createElement(ma,{target:i})},[e==null?void 0:e.target,t,a]);return l!=null&&l.useDropIndicator?r:void 0}function ya(l,e,a){var o,i,u;let t=l.focusedKey,r=null;if((o=e==null?void 0:e.isVirtualDragging)!=null&&o.call(e)&&((i=a==null?void 0:a.target)==null?void 0:i.type)==="item"&&(r=a.target.key,a.target.dropPosition==="after")){let n=a.collection.getKeyAfter(r),b=null;if(n!=null){let d=((u=a.collection.getItem(r))==null?void 0:u.level)??0;for(;n!=null;){let $=a.collection.getItem(n);if(!$)break;if($.type!=="item"){n=a.collection.getKeyAfter(n);continue}if(($.level??0)<=d)break;b=n,n=a.collection.getKeyAfter(n)}}r=n??b??r}return s.useMemo(()=>new Set([t,r].filter(n=>n!=null)),[t,r])}const re=new WeakMap;function Pa(l){return typeof l=="string"?l.replace(/\s*/g,""):""+l}function Da(l,e){let a=re.get(l);if(!a)throw new Error("Unknown list");return`${a.id}-option-${Pa(e)}`}function Ba(l,e,a){let t=K(l,{labelable:!0}),r=l.selectionBehavior||"toggle",o=l.orientation||"vertical",i=l.linkBehavior||(r==="replace"?"action":"override");r==="toggle"&&i==="action"&&(i="override");let{listProps:u}=pa({...l,ref:a,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,linkBehavior:i}),{focusWithinProps:n}=Dl({onFocusWithin:l.onFocus,onBlurWithin:l.onBlur,onFocusWithinChange:l.onFocusChange}),b=z(l.id);re.set(e,{id:b,shouldUseVirtualFocus:l.shouldUseVirtualFocus,shouldSelectOnPressUp:l.shouldSelectOnPressUp,shouldFocusOnHover:l.shouldFocusOnHover,isVirtualized:l.isVirtualized,onAction:l.onAction,linkBehavior:i,UNSTABLE_itemBehavior:l.UNSTABLE_itemBehavior});let{labelProps:d,fieldProps:$}=je({...l,id:b,labelElementType:"span"});return{labelProps:d,listBoxProps:R(t,n,e.selectionManager.selectionMode==="multiple"?{"aria-multiselectable":"true"}:{},{role:"listbox","aria-orientation":o,...R($,u)})}}function Ca(l,e,a){var y,A;let{key:t}=l,r=re.get(e),o=l.isDisabled??e.selectionManager.isDisabled(t),i=l.isSelected??e.selectionManager.isSelected(t),u=l.shouldSelectOnPressUp??(r==null?void 0:r.shouldSelectOnPressUp),n=l.shouldFocusOnHover??(r==null?void 0:r.shouldFocusOnHover),b=l.shouldUseVirtualFocus??(r==null?void 0:r.shouldUseVirtualFocus),d=l.isVirtualized??(r==null?void 0:r.isVirtualized),$=O(),x=O(),g={role:"option","aria-disabled":o||void 0,"aria-selected":e.selectionManager.selectionMode!=="none"?i:void 0,"aria-label":l["aria-label"],"aria-labelledby":$,"aria-describedby":x},p=e.collection.getItem(t);if(d){let S=Number(p==null?void 0:p.index);g["aria-posinset"]=Number.isNaN(S)?void 0:S+1,g["aria-setsize"]=va(e.collection)}let v=r!=null&&r.onAction?()=>{var S;return(S=r==null?void 0:r.onAction)==null?void 0:S.call(r,t)}:void 0,c=Da(e,t),{itemProps:m,isPressed:P,isFocused:h,hasAction:E,allowsSelection:C}=Bl({selectionManager:e.selectionManager,key:t,ref:a,shouldSelectOnPressUp:u,allowsDifferentPressOrigin:u&&n,isVirtualized:d,shouldUseVirtualFocus:b,isDisabled:o,onAction:v||(y=p==null?void 0:p.props)!=null&&y.onAction?Re((A=p==null?void 0:p.props)==null?void 0:A.onAction,v):void 0,linkBehavior:r==null?void 0:r.linkBehavior,UNSTABLE_itemBehavior:r==null?void 0:r.UNSTABLE_itemBehavior,id:c}),{hoverProps:M}=Ae({isDisabled:o||!n,onHoverStart(){he()||(e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(t))}}),D=K(p==null?void 0:p.props);delete D.id;let w=Cl(p==null?void 0:p.props);return{optionProps:{...g,...R(D,m,M,w),id:c},labelProps:{id:$},descriptionProps:{id:x},isFocused:h,isFocusVisible:h&&e.selectionManager.isFocused&&he(),isSelected:i,isDisabled:o,isPressed:P,allowsSelection:C,hasAction:E}}function Ea(l){let{heading:e,"aria-label":a}=l,t=z();return{itemProps:{role:"presentation"},headingProps:e?{id:t,role:"presentation",onMouseDown:r=>{r.preventDefault()}}:{},groupProps:{role:"group","aria-label":a,"aria-labelledby":e?t:void 0}}}const oe=s.createContext(null),V=s.createContext(null),Sa=s.forwardRef(function(e,a){[e,a]=T(e,a,oe);let t=s.useContext(V);return t?f.createElement(ol,{state:t,props:e,listBoxRef:a}):f.createElement(we,{content:f.createElement(El,e)},r=>f.createElement(Ma,{props:e,listBoxRef:a,collection:r}))});function Ma({props:l,listBoxRef:e,collection:a}){l={...l,collection:a,children:null,items:null};let{layoutDelegate:t}=s.useContext(H),r=Ke({...l,layoutDelegate:t});return f.createElement(ol,{state:r,props:l,listBoxRef:e})}function ol({state:l,props:e,listBoxRef:a}){[e,a]=T(e,a,fa);let{dragAndDropHooks:t,layout:r="stack",orientation:o="vertical",filter:i}=e,u=Rl(l,i),{collection:n,selectionManager:b}=u,d=!!(t!=null&&t.useDraggableCollectionState),$=!!(t!=null&&t.useDroppableCollectionState),{direction:x}=Q(),{disabledBehavior:g,disabledKeys:p}=b,v=ae({usage:"search",sensitivity:"base"}),{isVirtualized:c,layoutDelegate:m,dropTargetDelegate:P,CollectionRoot:h}=s.useContext(H),E=s.useMemo(()=>e.keyboardDelegate||new le({collection:n,collator:v,ref:a,disabledKeys:p,disabledBehavior:g,layout:r,orientation:o,direction:x,layoutDelegate:m}),[n,v,a,g,p,o,x,e.keyboardDelegate,r,m]),{listBoxProps:C}=Ba({...e,shouldSelectOnPressUp:d||e.shouldSelectOnPressUp,keyboardDelegate:E,isVirtualized:c},u,a);s.useRef(d),s.useRef($),s.useEffect(()=>{},[d,$]);let M,D,w,y=!1,A=null,S=s.useRef(null);if(d&&t){M=t.useDraggableCollectionState({collection:n,selectionManager:b,preview:t.renderDragPreview?S:void 0}),t.useDraggableCollection({},M,a);let q=t.DragPreview;A=t.renderDragPreview?f.createElement(q,{ref:S},t.renderDragPreview):null}if($&&t){D=t.useDroppableCollectionState({collection:n,selectionManager:b});let q=t.dropTargetDelegate||P||new t.ListDropTargetDelegate(n,a,{orientation:o,layout:r,direction:x});w=t.useDroppableCollection({keyboardDelegate:E,dropTargetDelegate:q},D,a),y=D.isDropTarget({type:"root"})}let{focusProps:cl,isFocused:ce,isFocusVisible:de}=Fe(),_=u.collection.size===0,fe={isDropTarget:y,isEmpty:_,isFocused:ce,isFocusVisible:de,layout:e.layout||"stack",orientation:o,state:u},dl=k({...e,children:void 0,defaultClassName:"react-aria-ListBox",values:fe}),be=null;_&&e.renderEmptyState&&(be=f.createElement("div",{role:"option",style:{display:"contents"}},e.renderEmptyState(fe)));let fl=K(e,{global:!0});return f.createElement(Al,null,f.createElement(F.div,{...R(fl,dl,C,cl,w==null?void 0:w.collectionProps),ref:a,slot:e.slot||void 0,onScroll:e.onScroll,"data-drop-target":y||void 0,"data-empty":_||void 0,"data-focused":ce||void 0,"data-focus-visible":de||void 0,"data-layout":e.layout||"stack","data-orientation":o},f.createElement(ee,{values:[[oe,e],[V,u],[Z,{dragAndDropHooks:t,dragState:M,dropState:D}],[ga,{elementType:"div"}],[al,{render:wa}],[wl,{name:"ListBoxSection",render:il}]]},f.createElement(Fl,null,f.createElement(h,{collection:n,scrollRef:a,persistedKeys:ya(b,t,D),renderDropIndicator:rl(t,D)}))),be,A))}function il(l,e,a,t="react-aria-ListBoxSection"){let r=s.useContext(V),{dragAndDropHooks:o,dropState:i}=s.useContext(Z),{CollectionBranch:u}=s.useContext(H),[n,b]=ke(),{headingProps:d,groupProps:$}=Ea({heading:b,"aria-label":l["aria-label"]??void 0}),x=k({...l,id:void 0,children:void 0,defaultClassName:t,values:void 0}),g=K(l,{global:!0});return delete g.id,f.createElement(F.section,{...R(g,x,$),ref:e},f.createElement(ba.Provider,{value:{...d,ref:n}},f.createElement(u,{collection:r.collection,parent:a,renderDropIndicator:rl(o,i)})))}const Ra=Sl(Ml,il),Aa=ze(Kl,function(e,a,t){let r=Le(a),o=s.useContext(V),{dragAndDropHooks:i,dragState:u,dropState:n}=s.useContext(Z),b=u&&!(u.isDisabled||u.selectionManager.isDisabled(t.key)),{optionProps:d,labelProps:$,descriptionProps:x,...g}=Ca({key:t.key,"aria-label":e==null?void 0:e["aria-label"]},o,r),{hoverProps:p,isHovered:v}=Ae({isDisabled:!g.allowsSelection&&!g.hasAction&&!b,onHoverStart:t.props.onHoverStart,onHoverChange:t.props.onHoverChange,onHoverEnd:t.props.onHoverEnd}),{keyboardProps:c}=J(e),{focusProps:m}=kl(e),P=null;u&&i&&(P=i.useDraggableItem({key:t.key,hasAction:g.hasAction},u));let h=null;n&&i&&(h=i.useDroppableItem({target:{type:"item",key:t.key,dropPosition:"on"}},n,r));let E=u&&u.isDragging(t.key),C=k({...e,id:void 0,children:e.children,defaultClassName:"react-aria-ListBoxItem",values:{...g,isHovered:v,selectionMode:o.selectionManager.selectionMode,selectionBehavior:o.selectionManager.selectionBehavior,allowsDragging:!!u,isDragging:E,isDropTarget:h==null?void 0:h.isDropTarget}});s.useEffect(()=>{t.textValue},[t.textValue]);let M=e.href?F.a:F.div,D=K(e,{global:!0});return delete D.id,delete D.onClick,e.href&&d.tabIndex==null&&(d.tabIndex=-1),f.createElement(M,{...R(D,C,d,p,c,m,P==null?void 0:P.dragProps,h==null?void 0:h.dropProps),ref:r,"data-allows-dragging":!!u||void 0,"data-selected":g.isSelected||void 0,"data-disabled":g.isDisabled||void 0,"data-hovered":v||void 0,"data-focused":g.isFocused||void 0,"data-focus-visible":g.isFocusVisible||void 0,"data-pressed":g.isPressed||void 0,"data-dragging":E||void 0,"data-drop-target":(h==null?void 0:h.isDropTarget)||void 0,"data-selection-mode":o.selectionManager.selectionMode==="none"?void 0:o.selectionManager.selectionMode},f.createElement(ee,{values:[[U,{slots:{[Ll]:$,label:$,description:x}}],[zl,{isSelected:g.isSelected}]]},C.children))});function wa(l,e){e=Le(e);let{dragAndDropHooks:a,dropState:t}=s.useContext(Z),{dropIndicatorProps:r,isHidden:o,isDropTarget:i}=a.useDropIndicator(l,t,e);return o?null:f.createElement(Ka,{...l,dropIndicatorProps:r,isDropTarget:i,ref:e})}function Fa(l,e){let{dropIndicatorProps:a,isDropTarget:t,...r}=l,o=k({...r,defaultClassName:"react-aria-DropIndicator",values:{isDropTarget:t}});return f.createElement(f.Fragment,null,f.createElement(F.div,{...a,...o,role:"option",ref:e,"data-drop-target":t||void 0}))}const Ka=s.forwardRef(Fa);ze(Il,function(e,a,t){let r=s.useContext(V),{isLoading:o,onLoadMore:i,scrollOffset:u,...n}=e,b=s.useRef(null),d=s.useMemo(()=>({onLoadMore:i,collection:r==null?void 0:r.collection,sentinelRef:b,scrollOffset:u}),[i,u,r==null?void 0:r.collection]);ra(d,b);let $=k({...n,id:void 0,children:t.rendered,defaultClassName:"react-aria-ListBoxLoadingIndicator",values:void 0}),x={tabIndex:-1};return f.createElement(f.Fragment,null,f.createElement("div",{style:{position:"relative",width:0,height:0},inert:Vl(!0)},f.createElement("div",{"data-testid":"loadMoreSentinel",ref:b,style:{position:"absolute",height:1,width:1}})),o&&$.children&&f.createElement(f.Fragment,null,f.createElement(F.div,{...R(K(e,{global:!0}),x),...$,role:"option",ref:a},$.children)))});function ka(l){let{description:e,errorMessage:a,isInvalid:t,validationState:r}=l,{labelProps:o,fieldProps:i}=je(l),u=O([!!e,!!a,t,r]),n=O([!!e,!!a,t,r]);return i=R(i,{"aria-describedby":[u,n,l["aria-describedby"]].filter(Boolean).join(" ")||void 0}),{labelProps:o,fieldProps:i,descriptionProps:{id:u},errorMessageProps:{id:n}}}const ie=new WeakMap;function za(l,e,a){let{keyboardDelegate:t,isDisabled:r,isRequired:o,name:i,form:u,validationBehavior:n="aria"}=l,b=ae({usage:"search",sensitivity:"base"}),d=s.useMemo(()=>t||new le(e.collection,e.disabledKeys,a,b),[t,e.collection,e.disabledKeys,b,a]),{menuTriggerProps:$,menuProps:x}=xa({isDisabled:r,type:"listbox"},e,a),{keyboardProps:g}=J({shortcuts:{ArrowLeft:()=>{var A,S;if(e.selectionManager.selectionMode==="multiple")return!1;let y=e.selectedKey!=null?(A=d.getKeyAbove)==null?void 0:A.call(d,e.selectedKey):(S=d.getFirstKey)==null?void 0:S.call(d);y!=null&&e.setSelectedKey(y)},ArrowRight:()=>{var A,S;if(e.selectionManager.selectionMode==="multiple")return!1;let y=e.selectedKey!=null?(A=d.getKeyBelow)==null?void 0:A.call(d,e.selectedKey):(S=d.getFirstKey)==null?void 0:S.call(d);y!=null&&e.setSelectedKey(y)}},allowRepeats:!0,onKeyDown:l.onKeyDown,onKeyUp:l.onKeyUp}),{typeSelectProps:p}=Tl({keyboardDelegate:d,selectionManager:e.selectionManager,onTypeSelect(y){e.setSelectedKey(y)}}),{isInvalid:v,validationErrors:c,validationDetails:m}=e.displayValidation,{labelProps:P,fieldProps:h,descriptionProps:E,errorMessageProps:C}=ka({...l,labelElementType:"span",isInvalid:v,errorMessage:l.errorMessage||c});e.selectionManager.selectionMode==="multiple"&&(p={});let M=K(l,{labelable:!0}),D=R(p,$,h),w=z();return ie.set(e,{isDisabled:r,isRequired:o,name:i,form:u,validationBehavior:n}),{labelProps:{...P,onClick:()=>{var y;l.isDisabled||((y=a.current)==null||y.focus(),Nl("keyboard"))}},triggerProps:R(M,{...D,isDisabled:r,onKeyDown:Re(D.onKeyDown,g.onKeyDown),onKeyUp:g.onKeyUp,"aria-labelledby":[w,D["aria-labelledby"],D["aria-label"]&&!D["aria-labelledby"]?D.id:null].filter(Boolean).join(" "),onFocus(y){e.isFocused||(l.onFocus&&l.onFocus(y),l.onFocusChange&&l.onFocusChange(!0),e.setFocused(!0))},onBlur(y){e.isOpen||(l.onBlur&&l.onBlur(y),l.onFocusChange&&l.onFocusChange(!1),e.setFocused(!1))}}),valueProps:{id:w},menuProps:{...x,onAction:void 0,autoFocus:e.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,disallowEmptySelection:!0,linkBehavior:"selection",onBlur:y=>{jl(y.currentTarget,y.relatedTarget)||(l.onBlur&&l.onBlur(y),l.onFocusChange&&l.onFocusChange(!1),e.setFocused(!1))},"aria-labelledby":[h["aria-labelledby"],D["aria-label"]&&!h["aria-labelledby"]?D.id:null].filter(Boolean).join(" ")},descriptionProps:E,errorMessageProps:C,isInvalid:v,validationErrors:c,validationDetails:m,hiddenSelectProps:{isDisabled:r,name:i,label:l.label,state:e,triggerRef:a,form:u}}}function La(l,e,a){let t=ie.get(e)||{},{autoComplete:r,name:o=t.name,form:i=t.form,isDisabled:u=t.isDisabled}=l,{validationBehavior:n,isRequired:b}=t,{visuallyHiddenProps:d}=Ol({style:{position:"fixed",top:0,left:0}});Ul(l.selectRef,e.defaultValue,e.setValue),Zl({validationBehavior:n,focus:()=>{var g;return(g=a.current)==null?void 0:g.focus()}},e,l.selectRef);let $=e.setValue,x=s.useCallback(g=>{let p=Me(g);p.multiple?$(Array.from(p.selectedOptions,v=>v.value)):$(g.currentTarget.value)},[$]);return{containerProps:{...d,"aria-hidden":!0,"data-react-aria-prevent-focus":!0,"data-a11y-ignore":"aria-hidden-focus"},inputProps:{style:{display:"none"}},selectProps:{tabIndex:-1,autoComplete:r,disabled:u,multiple:e.selectionManager.selectionMode==="multiple",required:n==="native"&&b,name:o,form:i,value:e.value??"",onChange:x,onInput:x}}}function Ia(l){let{state:e,triggerRef:a,label:t,name:r,form:o,isDisabled:i}=l,u=s.useRef(null),n=s.useRef(null),{containerProps:b,selectProps:d}=La({...l,selectRef:e.collection.size<=300?u:n},e,a),$=Array.isArray(e.value)?e.value:[e.value];if(e.collection.size<=300)return f.createElement("div",{...b,"data-testid":"hidden-select-container"},f.createElement("label",null,t,f.createElement("select",{...d,ref:u},f.createElement("option",{value:"",label:" "}," "),[...e.collection.getKeys()].map(x=>{let g=e.collection.getItem(x);if(g&&g.type==="item")return f.createElement("option",{key:g.key,value:g.key},g.textValue)}),e.collection.size===0&&r&&$.map((x,g)=>f.createElement("option",{key:g,value:x??""})))));if(r){let x=ie.get(e)||{},{validationBehavior:g}=x;$.length===0&&($=[null]);let p=$.map((v,c)=>{let m={type:"hidden",autoComplete:d.autoComplete,name:r,form:o,disabled:i,value:v??""};return g==="native"?f.createElement("input",{key:c,...m,ref:c===0?n:null,style:{display:"none"},type:"text",required:c===0?d.required:!1,onChange:()=>{}}):f.createElement("input",{key:c,...m,ref:c===0?n:null})});return f.createElement(f.Fragment,null,p)}return null}function Va(l){let{selectionMode:e="single",shouldCloseOnSelect:a=e==="single"}=l,t=_l(l),[r,o]=s.useState(null),i=s.useMemo(()=>l.defaultValue!==void 0?l.defaultValue:e==="single"?l.defaultSelectedKey??null:[],[l.defaultValue,l.defaultSelectedKey,e]),u=s.useMemo(()=>l.value!==void 0?l.value:e==="single"?l.selectedKey:void 0,[l.value,l.selectedKey,e]),[n,b]=ql(u,i,l.onChange),d=e==="single"&&Array.isArray(n)?n[0]:n,$=h=>{var E;if(e==="single"){let C=Array.isArray(h)?h[0]??null:h;b(C),C!==d&&((E=l.onSelectionChange)==null||E.call(l,C))}else{let C=[];Array.isArray(h)?C=h:h!=null&&(C=[h]),b(C)}},x=Ke({...l,selectionMode:e,disallowEmptySelection:e==="single",allowDuplicateSelectionEvents:!0,selectedKeys:s.useMemo(()=>Ta(d),[d]),onSelectionChange:h=>{if(h!=="all"){if(e==="single"){let E=h.values().next().value??null;$(E)}else $([...h]);a&&t.close(),v.commitValidation()}}}),g=x.selectionManager.firstSelectedKey,p=s.useMemo(()=>[...x.selectionManager.selectedKeys].map(h=>x.collection.getItem(h)).filter(h=>h!=null),[x.selectionManager.selectedKeys,x.collection]),v=Wl({...l,value:Array.isArray(d)&&d.length===0?null:d}),[c,m]=s.useState(!1),[P]=s.useState(d);return{...v,...x,...t,value:d,defaultValue:i??P,setValue:$,selectedKey:g,setSelectedKey:$,selectedItem:p[0]??null,selectedItems:p,defaultSelectedKey:l.defaultSelectedKey??(l.selectionMode==="single"?P:null),focusStrategy:r,open(h=null){(x.collection.size!==0||l.allowsEmptyCollection)&&(o(h),t.open())},toggle(h=null){(x.collection.size!==0||l.allowsEmptyCollection)&&(o(h),t.toggle())},isFocused:c,setFocused:m}}function Ta(l){if(l!==void 0)return l===null?[]:Array.isArray(l)?l:[l]}function ja(l={}){let{locale:e}=Q();return s.useMemo(()=>new Intl.ListFormat(e,l),[e,l])}function Na(l){return l&&l.__esModule?l.default:l}const se=s.createContext(null),ne=s.createContext(null),Oa=Y(function(e,a){[e,a]=T(e,a,se);let{children:t,isDisabled:r=!1,isInvalid:o=!1,isRequired:i=!1}=e,u=s.useMemo(()=>typeof t=="function"?t({isOpen:!1,isDisabled:r,isInvalid:o,isRequired:i,isFocused:!1,isFocusVisible:!1,defaultChildren:null}):t,[t,r,o,i]);return f.createElement(we,{content:u},n=>f.createElement(Za,{props:e,collection:n,selectRef:a}))}),Ua=[te,Ve,U];function Za({props:l,selectRef:e,collection:a}){let{validationBehavior:t}=Ie(Gl)||{},r=l.validationBehavior??t??"native",o=Va({...l,collection:a,children:void 0,validationBehavior:r}),{isFocusVisible:i,focusProps:u}=Fe({within:!0}),n=s.useRef(null),[b,d]=ke(!l["aria-label"]&&!l["aria-labelledby"]),{labelProps:$,triggerProps:x,valueProps:g,menuProps:p,descriptionProps:v,errorMessageProps:c,hiddenSelectProps:m,...P}=za({...Xl(l),label:d,validationBehavior:r},o,n),h=s.useMemo(()=>({isOpen:o.isOpen,isFocused:o.isFocused,isFocusVisible:i,isDisabled:l.isDisabled||!1,isInvalid:P.isInvalid||!1,isRequired:l.isRequired||!1}),[o.isOpen,o.isFocused,i,l.isDisabled,P.isInvalid,l.isRequired]),E=k({...l,values:h,defaultClassName:"react-aria-Select"}),C=K(l,{global:!0});delete C.id;let M=s.useRef(null);return f.createElement(ee,{values:[[se,l],[ne,o],[sl,g],[te,{...$,ref:b,elementType:"span"}],[Ve,{...x,ref:n,isPressed:o.isOpen,autoFocus:l.autoFocus}],[Yl,o],[Jl,{trigger:"Select",triggerRef:n,scrollRef:M,placement:"bottom start","aria-labelledby":p["aria-labelledby"],clearContexts:Ua}],[oe,{...p,ref:M}],[V,o],[U,{slots:{description:v,errorMessage:c}}],[Ql,P]]},f.createElement(F.div,{...R(C,E,u),ref:e,slot:l.slot||void 0,"data-focused":o.isFocused||void 0,"data-focus-visible":i||void 0,"data-open":o.isOpen||void 0,"data-disabled":l.isDisabled||void 0,"data-invalid":P.isInvalid||void 0,"data-required":l.isRequired||void 0},E.children,f.createElement(Ia,{...m,autoComplete:l.autoComplete})))}const sl=s.createContext(null),_a=Y(function(e,a){var p;[e,a]=T(e,a,sl);let t=s.useContext(ne),{placeholder:r}=Ie(se),o=t.selectedItems.map(v=>{var m;let c=(m=v.props)==null?void 0:m.children;return typeof c=="function"&&(c=c({isHovered:!1,isPressed:!1,isSelected:!1,isFocused:!1,isFocusVisible:!1,isDisabled:!1,selectionMode:"single",selectionBehavior:"toggle"})),c}),i=ja(),u=s.useMemo(()=>t.selectedItems.map(v=>v==null?void 0:v.textValue),[t.selectedItems]),n=t.selectionManager.selectionMode,b=s.useMemo(()=>n==="single"?u[0]??"":i.format(u),[n,i,u]),d=s.useMemo(()=>{if(n==="single")return o[0];let v=i.formatToParts(u);if(v.length===0)return null;let c=0;return v.map(m=>m.type==="element"?f.createElement(s.Fragment,{key:c},o[c++]):m.value)},[n,i,u,o]),$=Se(Na(ll),"react-aria-components"),x=k({...e,defaultChildren:d??r??$.format("selectPlaceholder"),defaultClassName:"react-aria-SelectValue",values:{selectedItem:((p=t.selectedItems[0])==null?void 0:p.value)??null,selectedItems:s.useMemo(()=>t.selectedItems.map(v=>v.value??null),[t.selectedItems]),selectedText:b,isPlaceholder:t.selectedItems.length===0,state:t}}),g=K(e,{global:!0});return f.createElement(F.span,{ref:a,...g,...x,"data-placeholder":t.selectedItems.length===0||void 0},f.createElement(U.Provider,{value:void 0},x.children))}),qa=s.createContext(!1),Wa=({children:l})=>B.jsx(qa,{value:!0,children:l}),G=new Map;function Ga(l,e,a=!0){const t=Hl();return s.useMemo(()=>{if(e!==void 0)return e;if(!t){if(a&&G.has(l))return G.get(l);try{const r=document.documentElement,o=getComputedStyle(r).getPropertyValue(l).trim()||void 0;return a&&G.set(l,o),o}catch{return}}},[l,e,t,a])}const ye=({animationType:l,className:e,...a})=>{const t=Ga("--skeleton-animation",l),r=f.useMemo(()=>ca({animationType:t}),[t]);return B.jsx(Te.div,{className:r.base({className:e}),...a})},rr=Object.assign(ye,{Root:ye}),Pe=({children:l,className:e,isDisabled:a,isInvalid:t,isRequired:r,...o})=>B.jsx(da,{className:oa({isRequired:r,isDisabled:a,isInvalid:t,className:e}),"data-slot":"label",...o,children:l}),or=Object.assign(Pe,{Root:Pe}),nl=s.createContext({}),De=({children:l,className:e,variant:a,...t})=>{const r=f.useMemo(()=>sa({variant:a}),[a]);return B.jsx(Aa,{className:I(e,r.item()),"data-slot":"list-box-item",...t,children:o=>B.jsx(nl,{value:{slots:r,state:o},children:typeof l=="function"?l(o):l})})},ul=({children:l,className:e,...a})=>{const{slots:t,state:r}=s.use(nl),o=r==null?void 0:r.isSelected,i=typeof l=="function"?l(r??{}):l||B.jsx("svg",{"aria-hidden":"true","data-slot":"list-box-item-indicator--checkmark",fill:"none",role:"presentation",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:o?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 17 18",children:B.jsx("polyline",{points:"1 9 7 14 15 4"})});return B.jsx(Te.span,{"aria-hidden":"true",className:X(t==null?void 0:t.indicator,e),"data-slot":"list-box-item-indicator","data-visible":o||void 0,...a,children:i})},Xa=Object.assign(De,{Root:De,Indicator:ul}),Ya=({children:l,className:e,...a})=>{const t=f.useMemo(()=>na({class:typeof e=="string"?e:void 0}),[e]);return B.jsx(Ra,{className:t,...a,children:l})},Ja=Ya;function Be({className:l,variant:e,...a}){const t=f.useMemo(()=>ia({variant:e}),[e]);return B.jsx(Sa,{className:I(l,t),"data-slot":"list-box",...a})}const ir=Object.assign(Be,{Root:Be,Item:Xa,ItemIndicator:ul,Section:Ja}),j=s.createContext({}),Ce=({children:l,className:e,fullWidth:a,variant:t,...r})=>{const o=f.useMemo(()=>ua({fullWidth:a,variant:t}),[a,t]);return B.jsx(Wa,{children:B.jsx(j,{value:{slots:o},children:B.jsx(Oa,{"data-slot":"select",...r,className:I(e,o==null?void 0:o.base()),children:i=>B.jsx(B.Fragment,{children:typeof l=="function"?l(i):l})})})})},Qa=({children:l,className:e,...a})=>{const{slots:t}=s.use(j);return B.jsx(aa,{className:I(e,t==null?void 0:t.trigger()),"data-slot":"select-trigger",...a,children:r=>B.jsx(B.Fragment,{children:typeof l=="function"?l(r):l})})},Ha=({children:l,className:e,...a})=>{const{slots:t}=s.use(j);return B.jsx(_a,{className:I(e,t==null?void 0:t.value()),"data-slot":"select-value",...a,children:l})},er=({children:l,className:e,...a})=>{const{slots:t}=s.use(j),r=s.use(ne);return l&&f.isValidElement(l)?f.cloneElement(l,{...a,className:X(t==null?void 0:t.indicator,e),"data-slot":"select-indicator","data-open":xe(r==null?void 0:r.isOpen)}):B.jsx(la,{className:X(t==null?void 0:t.indicator,e),"data-open":xe(r==null?void 0:r.isOpen),"data-slot":"select-default-indicator",...a})},tr=({children:l,className:e,placement:a="bottom",...t})=>{const{slots:r}=s.use(j);return B.jsx(ea,{value:{variant:"default"},children:B.jsx(ta,{...t,className:I(e,r==null?void 0:r.popover()),"data-slot":"select-popover",placement:a,children:l})})},sr=Object.assign(Ce,{Root:Ce,Trigger:Qa,Value:Ha,Indicator:er,Popover:tr});export{ve as $,or as L,rr as S,sr as a,ir as b,ae as c,Z as d,ra as e,rl as f,fa as g,le as h,al as i,ar as j,ya as k,ll as l,ka as m,te as n,Ga as u};