@tom2012/cc-web 1.5.52 → 1.5.54

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 (28) hide show
  1. package/README.md +1 -1
  2. package/backend/dist/index.d.ts.map +1 -1
  3. package/backend/dist/index.js +0 -2
  4. package/backend/dist/index.js.map +1 -1
  5. package/backend/dist/routes/projects.d.ts.map +1 -1
  6. package/backend/dist/routes/projects.js +0 -19
  7. package/backend/dist/routes/projects.js.map +1 -1
  8. package/frontend/dist/assets/{ChatView-BGrHsMR9.js → ChatView-SSfb4jQh.js} +1 -1
  9. package/frontend/dist/assets/{GraphPreview-CB0_XO4r.js → GraphPreview-Bu10mEVC.js} +1 -1
  10. package/frontend/dist/assets/{OfficePreview-1-i1sz5k.js → OfficePreview-B76DK236.js} +3 -3
  11. package/frontend/dist/assets/{ProjectPage-Cur4elk1.js → ProjectPage-Cs_pFCyS.js} +62 -67
  12. package/frontend/dist/assets/SettingsPage-Cb6j2aJ3.js +36 -0
  13. package/frontend/dist/assets/{ShareViewPage-CcquAbhh.js → ShareViewPage-DXmGmoZM.js} +1 -1
  14. package/frontend/dist/assets/{SkillHubPage-CoM63_GP.js → SkillHubPage-BjkmFW9M.js} +2 -2
  15. package/frontend/dist/assets/{bot-Bhot_xL1.js → bot-Dvon5AP9.js} +1 -1
  16. package/frontend/dist/assets/{chevron-down-BLLGZF4Q.js → chevron-down-oywyj_mF.js} +1 -1
  17. package/frontend/dist/assets/{download-dn65Yic6.js → download-s_UyPGX4.js} +1 -1
  18. package/frontend/dist/assets/{index-Dc8u1vU0.js → index-D4FtflMi.js} +46 -46
  19. package/frontend/dist/assets/{index-DnsaxfE4.js → index-D_ReGjmg.js} +1 -1
  20. package/frontend/dist/assets/index-DhOfrbbP.css +1 -0
  21. package/frontend/dist/assets/{jszip.min-CzfLNkw8.js → jszip.min-DDXUx9vE.js} +1 -1
  22. package/frontend/dist/assets/save-DXU_4k3M.js +16 -0
  23. package/frontend/dist/assets/{user-CljKCZZO.js → user-DrmNnlq0.js} +1 -1
  24. package/frontend/dist/index.html +2 -2
  25. package/package.json +1 -1
  26. package/frontend/dist/assets/SettingsPage-DnAH9VWu.js +0 -36
  27. package/frontend/dist/assets/index-B13xy6Pb.css +0 -1
  28. package/frontend/dist/assets/select-Bvlmfn-y.js +0 -16
@@ -0,0 +1,36 @@
1
+ import{c as je,r as l,ah as ne,ai as K,aj as He,j as s,ak as z,al as V,am as Ee,e as Z,an as rn,R as we,ao as We,ap as Nt,aq as Xo,ar as Rt,as as qo,at as Zo,au as Jo,av as Qo,aw as er,ax as tr,q as nr,ay as or,K as rr,L as sr,N as ir,O as ar,Q as cr,B as te,T as Se,I as Be,U as lr,az as Bt,aA as pt,aB as dr,aC as ur,aD as fr,a5 as sn,aE as pr,l as an,aF as mr,a3 as hr,aG as gr,a4 as xr,v as vr,A as yr,o as wr,X as br,aH as Sr,aI as Cr,aJ as Nr,aK as Rr,aL as jr,aM as Ar,aN as $t,aO as Tr,t as Ht}from"./index-D4FtflMi.js";import{C as cn}from"./chevron-down-oywyj_mF.js";import{a as Er,C as Pr,S as Ir}from"./save-DXU_4k3M.js";/**
2
+ * @license lucide-react v0.309.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 Or=je("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
7
+ * @license lucide-react v0.309.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const _r=je("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
12
+ * @license lucide-react v0.309.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const kr=je("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
17
+ * @license lucide-react v0.309.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const mt=je("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/**
22
+ * @license lucide-react v0.309.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const Vt=je("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
27
+ * @license lucide-react v0.309.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const Dr=je("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
32
+ * @license lucide-react v0.309.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const Mr=je("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);function ln(e){const t=l.useRef({value:e,previous:e});return l.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function dn(e){const[t,n]=l.useState(void 0);return ne(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const a=r[0];let i,c;if("borderBoxSize"in a){const d=a.borderBoxSize,u=Array.isArray(d)?d[0]:d;i=u.inlineSize,c=u.blockSize}else i=e.offsetWidth,c=e.offsetHeight;n({width:i,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var et="Switch",[Lr]=Ee(et),[Fr,Br]=Lr(et),un=l.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:r,defaultChecked:a,required:i,disabled:c,value:d="on",onCheckedChange:u,form:f,...p}=e,[v,h]=l.useState(null),w=K(t,x=>h(x)),m=l.useRef(!1),g=v?f||!!v.closest("form"):!0,[b,y]=He({prop:r,defaultProp:a??!1,onChange:u,caller:et});return s.jsxs(Fr,{scope:n,checked:b,disabled:c,children:[s.jsx(z.button,{type:"button",role:"switch","aria-checked":b,"aria-required":i,"data-state":hn(b),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:w,onClick:V(e.onClick,x=>{y(C=>!C),g&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})}),g&&s.jsx(mn,{control:v,bubbles:!m.current,name:o,value:d,checked:b,required:i,disabled:c,form:f,style:{transform:"translateX(-100%)"}})]})});un.displayName=et;var fn="SwitchThumb",pn=l.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,r=Br(fn,n);return s.jsx(z.span,{"data-state":hn(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:t})});pn.displayName=fn;var $r="SwitchBubbleInput",mn=l.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:o=!0,...r},a)=>{const i=l.useRef(null),c=K(i,a),d=ln(n),u=dn(t);return l.useEffect(()=>{const f=i.current;if(!f)return;const p=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&h){const w=new Event("click",{bubbles:o});h.call(f,n),f.dispatchEvent(w)}},[d,n,o]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:c,style:{...r.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});mn.displayName=$r;function hn(e){return e?"checked":"unchecked"}var gn=un,Hr=pn;const xn=l.forwardRef(({className:e,...t},n)=>s.jsx(gn,{className:Z("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:s.jsx(Hr,{className:Z("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));xn.displayName=gn.displayName;function Wt(e){const t=Vr(e),n=l.forwardRef((o,r)=>{const{children:a,...i}=o,c=l.Children.toArray(a),d=c.find(zr);if(d){const u=d.props.children,f=c.map(p=>p===d?l.Children.count(u)>1?l.Children.only(null):l.isValidElement(u)?u.props.children:null:p);return s.jsx(t,{...i,ref:r,children:l.isValidElement(u)?l.cloneElement(u,void 0,f):null})}return s.jsx(t,{...i,ref:r,children:a})});return n.displayName=`${e}.Slot`,n}function Vr(e){const t=l.forwardRef((n,o)=>{const{children:r,...a}=n;if(l.isValidElement(r)){const i=Kr(r),c=Ur(a,r.props);return r.type!==l.Fragment&&(c.ref=o?rn(o,i):i),l.cloneElement(r,c)}return l.Children.count(r)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Wr=Symbol("radix.slottable");function zr(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Wr}function Ur(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...c)=>{const d=a(...c);return r(...c),d}:r&&(n[o]=r):o==="style"?n[o]={...r,...a}:o==="className"&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function Kr(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function vn(e){const t=e+"CollectionProvider",[n,o]=Ee(t),[r,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:g,children:b}=m,y=we.useRef(null),x=we.useRef(new Map).current;return s.jsx(r,{scope:g,itemMap:x,collectionRef:y,children:b})};i.displayName=t;const c=e+"CollectionSlot",d=Wt(c),u=we.forwardRef((m,g)=>{const{scope:b,children:y}=m,x=a(c,b),C=K(g,x.collectionRef);return s.jsx(d,{ref:C,children:y})});u.displayName=c;const f=e+"CollectionItemSlot",p="data-radix-collection-item",v=Wt(f),h=we.forwardRef((m,g)=>{const{scope:b,children:y,...x}=m,C=we.useRef(null),N=K(g,C),j=a(f,b);return we.useEffect(()=>(j.itemMap.set(C,{ref:C,...x}),()=>void j.itemMap.delete(C))),s.jsx(v,{[p]:"",ref:N,children:y})});h.displayName=f;function w(m){const g=a(e+"CollectionConsumer",m);return we.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const x=Array.from(y.querySelectorAll(`[${p}]`));return Array.from(g.itemMap.values()).sort((j,A)=>x.indexOf(j.ref.current)-x.indexOf(A.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:i,Slot:u,ItemSlot:h},w,o]}var Gr=l.createContext(void 0);function jt(e){const t=l.useContext(Gr);return e||t||"ltr"}var lt="rovingFocusGroup.onEntryFocus",Yr={bubbles:!1,cancelable:!0},ze="RovingFocusGroup",[ht,yn,Xr]=vn(ze),[qr,wn]=Ee(ze,[Xr]),[Zr,Jr]=qr(ze),bn=l.forwardRef((e,t)=>s.jsx(ht.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(ht.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Qr,{...e,ref:t})})}));bn.displayName=ze;var Qr=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...p}=e,v=l.useRef(null),h=K(t,v),w=jt(a),[m,g]=He({prop:i,defaultProp:c??null,onChange:d,caller:ze}),[b,y]=l.useState(!1),x=Nt(u),C=yn(n),N=l.useRef(!1),[j,A]=l.useState(0);return l.useEffect(()=>{const T=v.current;if(T)return T.addEventListener(lt,x),()=>T.removeEventListener(lt,x)},[x]),s.jsx(Zr,{scope:n,orientation:o,dir:w,loop:r,currentTabStopId:m,onItemFocus:l.useCallback(T=>g(T),[g]),onItemShiftTab:l.useCallback(()=>y(!0),[]),onFocusableItemAdd:l.useCallback(()=>A(T=>T+1),[]),onFocusableItemRemove:l.useCallback(()=>A(T=>T-1),[]),children:s.jsx(z.div,{tabIndex:b||j===0?-1:0,"data-orientation":o,...p,ref:h,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{N.current=!0}),onFocus:V(e.onFocus,T=>{const R=!N.current;if(T.target===T.currentTarget&&R&&!b){const I=new CustomEvent(lt,Yr);if(T.currentTarget.dispatchEvent(I),!I.defaultPrevented){const _=C().filter(P=>P.focusable),L=_.find(P=>P.active),D=_.find(P=>P.id===m),F=[L,D,..._].filter(Boolean).map(P=>P.ref.current);Nn(F,f)}}N.current=!1}),onBlur:V(e.onBlur,()=>y(!1))})})}),Sn="RovingFocusGroupItem",Cn=l.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:a,children:i,...c}=e,d=We(),u=a||d,f=Jr(Sn,n),p=f.currentTabStopId===u,v=yn(n),{onFocusableItemAdd:h,onFocusableItemRemove:w,currentTabStopId:m}=f;return l.useEffect(()=>{if(o)return h(),()=>w()},[o,h,w]),s.jsx(ht.ItemSlot,{scope:n,id:u,focusable:o,active:r,children:s.jsx(z.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:V(e.onMouseDown,g=>{o?f.onItemFocus(u):g.preventDefault()}),onFocus:V(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:V(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){f.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const b=ns(g,f.orientation,f.dir);if(b!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let x=v().filter(C=>C.focusable).map(C=>C.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const C=x.indexOf(g.currentTarget);x=f.loop?os(x,C+1):x.slice(C+1)}setTimeout(()=>Nn(x))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:m!=null}):i})})});Cn.displayName=Sn;var es={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ts(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ns(e,t,n){const o=ts(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return es[o]}function Nn(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function os(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var rs=bn,ss=Cn,tt="Tabs",[is]=Ee(tt,[wn]),Rn=wn(),[as,At]=is(tt),jn=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:a,orientation:i="horizontal",dir:c,activationMode:d="automatic",...u}=e,f=jt(c),[p,v]=He({prop:o,onChange:r,defaultProp:a??"",caller:tt});return s.jsx(as,{scope:n,baseId:We(),value:p,onValueChange:v,orientation:i,dir:f,activationMode:d,children:s.jsx(z.div,{dir:f,"data-orientation":i,...u,ref:t})})});jn.displayName=tt;var An="TabsList",Tn=l.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,a=At(An,n),i=Rn(n);return s.jsx(rs,{asChild:!0,...i,orientation:a.orientation,dir:a.dir,loop:o,children:s.jsx(z.div,{role:"tablist","aria-orientation":a.orientation,...r,ref:t})})});Tn.displayName=An;var En="TabsTrigger",Pn=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...a}=e,i=At(En,n),c=Rn(n),d=_n(i.baseId,o),u=kn(i.baseId,o),f=o===i.value;return s.jsx(ss,{asChild:!0,...c,focusable:!r,active:f,children:s.jsx(z.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:d,...a,ref:t,onMouseDown:V(e.onMouseDown,p=>{!r&&p.button===0&&p.ctrlKey===!1?i.onValueChange(o):p.preventDefault()}),onKeyDown:V(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&i.onValueChange(o)}),onFocus:V(e.onFocus,()=>{const p=i.activationMode!=="manual";!f&&!r&&p&&i.onValueChange(o)})})})});Pn.displayName=En;var In="TabsContent",On=l.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:a,...i}=e,c=At(In,n),d=_n(c.baseId,o),u=kn(c.baseId,o),f=o===c.value,p=l.useRef(f);return l.useEffect(()=>{const v=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(v)},[]),s.jsx(Xo,{present:r||f,children:({present:v})=>s.jsx(z.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!v,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:v&&a})})});On.displayName=In;function _n(e,t){return`${e}-trigger-${t}`}function kn(e,t){return`${e}-content-${t}`}var cs=jn,Dn=Tn,Mn=Pn,Ln=On;const ls=cs,Fn=l.forwardRef(({className:e,...t},n)=>s.jsx(Dn,{ref:n,className:Z("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Fn.displayName=Dn.displayName;const Me=l.forwardRef(({className:e,...t},n)=>s.jsx(Mn,{ref:n,className:Z("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 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",e),...t}));Me.displayName=Mn.displayName;const Le=l.forwardRef(({className:e,...t},n)=>s.jsx(Ln,{ref:n,className:Z("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Le.displayName=Ln.displayName;function zt(e,[t,n]){return Math.min(n,Math.max(t,e))}const ds=["top","right","bottom","left"],me=Math.min,X=Math.max,Xe=Math.round,Ge=Math.floor,ae=e=>({x:e,y:e}),us={left:"right",right:"left",bottom:"top",top:"bottom"};function gt(e,t,n){return X(e,me(t,n))}function de(e,t){return typeof e=="function"?e(t):e}function ue(e){return e.split("-")[0]}function Pe(e){return e.split("-")[1]}function Tt(e){return e==="x"?"y":"x"}function Et(e){return e==="y"?"height":"width"}function ie(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Pt(e){return Tt(ie(e))}function fs(e,t,n){n===void 0&&(n=!1);const o=Pe(e),r=Pt(e),a=Et(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=qe(i)),[i,qe(i)]}function ps(e){const t=qe(e);return[xt(e),t,xt(t)]}function xt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ut=["left","right"],Kt=["right","left"],ms=["top","bottom"],hs=["bottom","top"];function gs(e,t,n){switch(e){case"top":case"bottom":return n?t?Kt:Ut:t?Ut:Kt;case"left":case"right":return t?ms:hs;default:return[]}}function xs(e,t,n,o){const r=Pe(e);let a=gs(ue(e),n==="start",o);return r&&(a=a.map(i=>i+"-"+r),t&&(a=a.concat(a.map(xt)))),a}function qe(e){const t=ue(e);return us[t]+e.slice(t.length)}function vs(e){return{top:0,right:0,bottom:0,left:0,...e}}function Bn(e){return typeof e!="number"?vs(e):{top:e,right:e,bottom:e,left:e}}function Ze(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Gt(e,t,n){let{reference:o,floating:r}=e;const a=ie(t),i=Pt(t),c=Et(i),d=ue(t),u=a==="y",f=o.x+o.width/2-r.width/2,p=o.y+o.height/2-r.height/2,v=o[c]/2-r[c]/2;let h;switch(d){case"top":h={x:f,y:o.y-r.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:p};break;case"left":h={x:o.x-r.width,y:p};break;default:h={x:o.x,y:o.y}}switch(Pe(t)){case"start":h[i]-=v*(n&&u?-1:1);break;case"end":h[i]+=v*(n&&u?-1:1);break}return h}async function ys(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:a,rects:i,elements:c,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:v=!1,padding:h=0}=de(t,e),w=Bn(h),g=c[v?p==="floating"?"reference":"floating":p],b=Ze(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(g)))==null||n?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:u,rootBoundary:f,strategy:d})),y=p==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),C=await(a.isElement==null?void 0:a.isElement(x))?await(a.getScale==null?void 0:a.getScale(x))||{x:1,y:1}:{x:1,y:1},N=Ze(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:x,strategy:d}):y);return{top:(b.top-N.top+w.top)/C.y,bottom:(N.bottom-b.bottom+w.bottom)/C.y,left:(b.left-N.left+w.left)/C.x,right:(N.right-b.right+w.right)/C.x}}const ws=50,bs=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:a=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:ys},d=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:p}=Gt(u,o,d),v=o,h=0;const w={};for(let m=0;m<a.length;m++){const g=a[m];if(!g)continue;const{name:b,fn:y}=g,{x,y:C,data:N,reset:j}=await y({x:f,y:p,initialPlacement:o,placement:v,strategy:r,middlewareData:w,rects:u,platform:c,elements:{reference:e,floating:t}});f=x??f,p=C??p,w[b]={...w[b],...N},j&&h<ws&&(h++,typeof j=="object"&&(j.placement&&(v=j.placement),j.rects&&(u=j.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):j.rects),{x:f,y:p}=Gt(u,v,d)),m=-1)}return{x:f,y:p,placement:v,strategy:r,middlewareData:w}},Ss=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:a,platform:i,elements:c,middlewareData:d}=t,{element:u,padding:f=0}=de(e,t)||{};if(u==null)return{};const p=Bn(f),v={x:n,y:o},h=Pt(r),w=Et(h),m=await i.getDimensions(u),g=h==="y",b=g?"top":"left",y=g?"bottom":"right",x=g?"clientHeight":"clientWidth",C=a.reference[w]+a.reference[h]-v[h]-a.floating[w],N=v[h]-a.reference[h],j=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let A=j?j[x]:0;(!A||!await(i.isElement==null?void 0:i.isElement(j)))&&(A=c.floating[x]||a.floating[w]);const T=C/2-N/2,R=A/2-m[w]/2-1,I=me(p[b],R),_=me(p[y],R),L=I,D=A-m[w]-_,k=A/2-m[w]/2+T,F=gt(L,k,D),P=!d.arrow&&Pe(r)!=null&&k!==F&&a.reference[w]/2-(k<L?I:_)-m[w]/2<0,M=P?k<L?k-L:k-D:0;return{[h]:v[h]+M,data:{[h]:F,centerOffset:k-F-M,...P&&{alignmentOffset:M}},reset:P}}}),Cs=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:a,rects:i,initialPlacement:c,platform:d,elements:u}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:v,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:m=!0,...g}=de(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const b=ue(r),y=ie(c),x=ue(c)===c,C=await(d.isRTL==null?void 0:d.isRTL(u.floating)),N=v||(x||!m?[qe(c)]:ps(c)),j=w!=="none";!v&&j&&N.push(...xs(c,m,w,C));const A=[c,...N],T=await d.detectOverflow(t,g),R=[];let I=((o=a.flip)==null?void 0:o.overflows)||[];if(f&&R.push(T[b]),p){const k=fs(r,i,C);R.push(T[k[0]],T[k[1]])}if(I=[...I,{placement:r,overflows:R}],!R.every(k=>k<=0)){var _,L;const k=(((_=a.flip)==null?void 0:_.index)||0)+1,F=A[k];if(F&&(!(p==="alignment"?y!==ie(F):!1)||I.every(E=>ie(E.placement)===y?E.overflows[0]>0:!0)))return{data:{index:k,overflows:I},reset:{placement:F}};let P=(L=I.filter(M=>M.overflows[0]<=0).sort((M,E)=>M.overflows[1]-E.overflows[1])[0])==null?void 0:L.placement;if(!P)switch(h){case"bestFit":{var D;const M=(D=I.filter(E=>{if(j){const H=ie(E.placement);return H===y||H==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(H=>H>0).reduce((H,G)=>H+G,0)]).sort((E,H)=>E[1]-H[1])[0])==null?void 0:D[0];M&&(P=M);break}case"initialPlacement":P=c;break}if(r!==P)return{reset:{placement:P}}}return{}}}};function Yt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xt(e){return ds.some(t=>e[t]>=0)}const Ns=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...a}=de(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...a,elementContext:"reference"}),c=Yt(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Xt(c)}}}case"escaped":{const i=await o.detectOverflow(t,{...a,altBoundary:!0}),c=Yt(i,n.floating);return{data:{escapedOffsets:c,escaped:Xt(c)}}}default:return{}}}}},$n=new Set(["left","top"]);async function Rs(e,t){const{placement:n,platform:o,elements:r}=e,a=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=ue(n),c=Pe(n),d=ie(n)==="y",u=$n.has(i)?-1:1,f=a&&d?-1:1,p=de(t,e);let{mainAxis:v,crossAxis:h,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof w=="number"&&(h=c==="end"?w*-1:w),d?{x:h*f,y:v*u}:{x:v*u,y:h*f}}const js=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:a,placement:i,middlewareData:c}=t,d=await Rs(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+d.x,y:a+d.y,data:{...d,placement:i}}}}},As=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:a}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:d={fn:b=>{let{x:y,y:x}=b;return{x:y,y:x}}},...u}=de(e,t),f={x:n,y:o},p=await a.detectOverflow(t,u),v=ie(ue(r)),h=Tt(v);let w=f[h],m=f[v];if(i){const b=h==="y"?"top":"left",y=h==="y"?"bottom":"right",x=w+p[b],C=w-p[y];w=gt(x,w,C)}if(c){const b=v==="y"?"top":"left",y=v==="y"?"bottom":"right",x=m+p[b],C=m-p[y];m=gt(x,m,C)}const g=d.fn({...t,[h]:w,[v]:m});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[h]:i,[v]:c}}}}}},Ts=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:a,middlewareData:i}=t,{offset:c=0,mainAxis:d=!0,crossAxis:u=!0}=de(e,t),f={x:n,y:o},p=ie(r),v=Tt(p);let h=f[v],w=f[p];const m=de(c,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(d){const x=v==="y"?"height":"width",C=a.reference[v]-a.floating[x]+g.mainAxis,N=a.reference[v]+a.reference[x]-g.mainAxis;h<C?h=C:h>N&&(h=N)}if(u){var b,y;const x=v==="y"?"width":"height",C=$n.has(ue(r)),N=a.reference[p]-a.floating[x]+(C&&((b=i.offset)==null?void 0:b[p])||0)+(C?0:g.crossAxis),j=a.reference[p]+a.reference[x]+(C?0:((y=i.offset)==null?void 0:y[p])||0)-(C?g.crossAxis:0);w<N?w=N:w>j&&(w=j)}return{[v]:h,[p]:w}}}},Es=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:a,platform:i,elements:c}=t,{apply:d=()=>{},...u}=de(e,t),f=await i.detectOverflow(t,u),p=ue(r),v=Pe(r),h=ie(r)==="y",{width:w,height:m}=a.floating;let g,b;p==="top"||p==="bottom"?(g=p,b=v===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(b=p,g=v==="end"?"top":"bottom");const y=m-f.top-f.bottom,x=w-f.left-f.right,C=me(m-f[g],y),N=me(w-f[b],x),j=!t.middlewareData.shift;let A=C,T=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(A=y),j&&!v){const I=X(f.left,0),_=X(f.right,0),L=X(f.top,0),D=X(f.bottom,0);h?T=w-2*(I!==0||_!==0?I+_:X(f.left,f.right)):A=m-2*(L!==0||D!==0?L+D:X(f.top,f.bottom))}await d({...t,availableWidth:T,availableHeight:A});const R=await i.getDimensions(c.floating);return w!==R.width||m!==R.height?{reset:{rects:!0}}:{}}}};function nt(){return typeof window<"u"}function Ie(e){return Hn(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ce(e){var t;return(t=(Hn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Hn(e){return nt()?e instanceof Node||e instanceof q(e).Node:!1}function oe(e){return nt()?e instanceof Element||e instanceof q(e).Element:!1}function fe(e){return nt()?e instanceof HTMLElement||e instanceof q(e).HTMLElement:!1}function qt(e){return!nt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof q(e).ShadowRoot}function Ue(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=re(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function Ps(e){return/^(table|td|th)$/.test(Ie(e))}function ot(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Is=/transform|translate|scale|rotate|perspective|filter/,Os=/paint|layout|strict|content/,be=e=>!!e&&e!=="none";let dt;function It(e){const t=oe(e)?re(e):e;return be(t.transform)||be(t.translate)||be(t.scale)||be(t.rotate)||be(t.perspective)||!Ot()&&(be(t.backdropFilter)||be(t.filter))||Is.test(t.willChange||"")||Os.test(t.contain||"")}function _s(e){let t=he(e);for(;fe(t)&&!Te(t);){if(It(t))return t;if(ot(t))return null;t=he(t)}return null}function Ot(){return dt==null&&(dt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),dt}function Te(e){return/^(html|body|#document)$/.test(Ie(e))}function re(e){return q(e).getComputedStyle(e)}function rt(e){return oe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function he(e){if(Ie(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qt(e)&&e.host||ce(e);return qt(t)?t.host:t}function Vn(e){const t=he(e);return Te(t)?e.ownerDocument?e.ownerDocument.body:e.body:fe(t)&&Ue(t)?t:Vn(t)}function Ve(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Vn(e),a=r===((o=e.ownerDocument)==null?void 0:o.body),i=q(r);if(a){const c=vt(i);return t.concat(i,i.visualViewport||[],Ue(r)?r:[],c&&n?Ve(c):[])}else return t.concat(r,Ve(r,[],n))}function vt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Wn(e){const t=re(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=fe(e),a=r?e.offsetWidth:n,i=r?e.offsetHeight:o,c=Xe(n)!==a||Xe(o)!==i;return c&&(n=a,o=i),{width:n,height:o,$:c}}function _t(e){return oe(e)?e:e.contextElement}function Ae(e){const t=_t(e);if(!fe(t))return ae(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:a}=Wn(t);let i=(a?Xe(n.width):n.width)/o,c=(a?Xe(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const ks=ae(0);function zn(e){const t=q(e);return!Ot()||!t.visualViewport?ks:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ds(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==q(e)?!1:t}function Ce(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=_t(e);let i=ae(1);t&&(o?oe(o)&&(i=Ae(o)):i=Ae(e));const c=Ds(a,n,o)?zn(a):ae(0);let d=(r.left+c.x)/i.x,u=(r.top+c.y)/i.y,f=r.width/i.x,p=r.height/i.y;if(a){const v=q(a),h=o&&oe(o)?q(o):o;let w=v,m=vt(w);for(;m&&o&&h!==w;){const g=Ae(m),b=m.getBoundingClientRect(),y=re(m),x=b.left+(m.clientLeft+parseFloat(y.paddingLeft))*g.x,C=b.top+(m.clientTop+parseFloat(y.paddingTop))*g.y;d*=g.x,u*=g.y,f*=g.x,p*=g.y,d+=x,u+=C,w=q(m),m=vt(w)}}return Ze({width:f,height:p,x:d,y:u})}function st(e,t){const n=rt(e).scrollLeft;return t?t.left+n:Ce(ce(e)).left+n}function Un(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-st(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Ms(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const a=r==="fixed",i=ce(o),c=t?ot(t.floating):!1;if(o===i||c&&a)return n;let d={scrollLeft:0,scrollTop:0},u=ae(1);const f=ae(0),p=fe(o);if((p||!p&&!a)&&((Ie(o)!=="body"||Ue(i))&&(d=rt(o)),p)){const h=Ce(o);u=Ae(o),f.x=h.x+o.clientLeft,f.y=h.y+o.clientTop}const v=i&&!p&&!a?Un(i,d):ae(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-d.scrollLeft*u.x+f.x+v.x,y:n.y*u.y-d.scrollTop*u.y+f.y+v.y}}function Ls(e){return Array.from(e.getClientRects())}function Fs(e){const t=ce(e),n=rt(e),o=e.ownerDocument.body,r=X(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=X(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+st(e);const c=-n.scrollTop;return re(o).direction==="rtl"&&(i+=X(t.clientWidth,o.clientWidth)-r),{width:r,height:a,x:i,y:c}}const Zt=25;function Bs(e,t){const n=q(e),o=ce(e),r=n.visualViewport;let a=o.clientWidth,i=o.clientHeight,c=0,d=0;if(r){a=r.width,i=r.height;const f=Ot();(!f||f&&t==="fixed")&&(c=r.offsetLeft,d=r.offsetTop)}const u=st(o);if(u<=0){const f=o.ownerDocument,p=f.body,v=getComputedStyle(p),h=f.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,w=Math.abs(o.clientWidth-p.clientWidth-h);w<=Zt&&(a-=w)}else u<=Zt&&(a+=u);return{width:a,height:i,x:c,y:d}}function $s(e,t){const n=Ce(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,a=fe(e)?Ae(e):ae(1),i=e.clientWidth*a.x,c=e.clientHeight*a.y,d=r*a.x,u=o*a.y;return{width:i,height:c,x:d,y:u}}function Jt(e,t,n){let o;if(t==="viewport")o=Bs(e,n);else if(t==="document")o=Fs(ce(e));else if(oe(t))o=$s(t,n);else{const r=zn(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Ze(o)}function Kn(e,t){const n=he(e);return n===t||!oe(n)||Te(n)?!1:re(n).position==="fixed"||Kn(n,t)}function Hs(e,t){const n=t.get(e);if(n)return n;let o=Ve(e,[],!1).filter(c=>oe(c)&&Ie(c)!=="body"),r=null;const a=re(e).position==="fixed";let i=a?he(e):e;for(;oe(i)&&!Te(i);){const c=re(i),d=It(i);!d&&c.position==="fixed"&&(r=null),(a?!d&&!r:!d&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Ue(i)&&!d&&Kn(e,i))?o=o.filter(f=>f!==i):r=c,i=he(i)}return t.set(e,o),o}function Vs(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?ot(t)?[]:Hs(t,this._c):[].concat(n),o],c=Jt(t,i[0],r);let d=c.top,u=c.right,f=c.bottom,p=c.left;for(let v=1;v<i.length;v++){const h=Jt(t,i[v],r);d=X(h.top,d),u=me(h.right,u),f=me(h.bottom,f),p=X(h.left,p)}return{width:u-p,height:f-d,x:p,y:d}}function Ws(e){const{width:t,height:n}=Wn(e);return{width:t,height:n}}function zs(e,t,n){const o=fe(t),r=ce(t),a=n==="fixed",i=Ce(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const d=ae(0);function u(){d.x=st(r)}if(o||!o&&!a)if((Ie(t)!=="body"||Ue(r))&&(c=rt(t)),o){const h=Ce(t,!0,a,t);d.x=h.x+t.clientLeft,d.y=h.y+t.clientTop}else r&&u();a&&!o&&r&&u();const f=r&&!o&&!a?Un(r,c):ae(0),p=i.left+c.scrollLeft-d.x-f.x,v=i.top+c.scrollTop-d.y-f.y;return{x:p,y:v,width:i.width,height:i.height}}function ut(e){return re(e).position==="static"}function Qt(e,t){if(!fe(e)||re(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ce(e)===n&&(n=n.ownerDocument.body),n}function Gn(e,t){const n=q(e);if(ot(e))return n;if(!fe(e)){let r=he(e);for(;r&&!Te(r);){if(oe(r)&&!ut(r))return r;r=he(r)}return n}let o=Qt(e,t);for(;o&&Ps(o)&&ut(o);)o=Qt(o,t);return o&&Te(o)&&ut(o)&&!It(o)?n:o||_s(e)||n}const Us=async function(e){const t=this.getOffsetParent||Gn,n=this.getDimensions,o=await n(e.floating);return{reference:zs(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ks(e){return re(e).direction==="rtl"}const Gs={convertOffsetParentRelativeRectToViewportRelativeRect:Ms,getDocumentElement:ce,getClippingRect:Vs,getOffsetParent:Gn,getElementRects:Us,getClientRects:Ls,getDimensions:Ws,getScale:Ae,isElement:oe,isRTL:Ks};function Yn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ys(e,t){let n=null,o;const r=ce(e);function a(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function i(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),a();const u=e.getBoundingClientRect(),{left:f,top:p,width:v,height:h}=u;if(c||t(),!v||!h)return;const w=Ge(p),m=Ge(r.clientWidth-(f+v)),g=Ge(r.clientHeight-(p+h)),b=Ge(f),x={rootMargin:-w+"px "+-m+"px "+-g+"px "+-b+"px",threshold:X(0,me(1,d))||1};let C=!0;function N(j){const A=j[0].intersectionRatio;if(A!==d){if(!C)return i();A?i(!1,A):o=setTimeout(()=>{i(!1,1e-7)},1e3)}A===1&&!Yn(u,e.getBoundingClientRect())&&i(),C=!1}try{n=new IntersectionObserver(N,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(N,x)}n.observe(e)}return i(!0),a}function Xs(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,u=_t(e),f=r||a?[...u?Ve(u):[],...t?Ve(t):[]]:[];f.forEach(b=>{r&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const p=u&&c?Ys(u,n):null;let v=-1,h=null;i&&(h=new ResizeObserver(b=>{let[y]=b;y&&y.target===u&&h&&t&&(h.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),u&&!d&&h.observe(u),t&&h.observe(t));let w,m=d?Ce(e):null;d&&g();function g(){const b=Ce(e);m&&!Yn(m,b)&&n(),m=b,w=requestAnimationFrame(g)}return n(),()=>{var b;f.forEach(y=>{r&&y.removeEventListener("scroll",n),a&&y.removeEventListener("resize",n)}),p==null||p(),(b=h)==null||b.disconnect(),h=null,d&&cancelAnimationFrame(w)}}const qs=js,Zs=As,Js=Cs,Qs=Es,ei=Ns,en=Ss,ti=Ts,ni=(e,t,n)=>{const o=new Map,r={platform:Gs,...n},a={...r.platform,_c:o};return bs(e,t,{...r,platform:a})};var oi=typeof document<"u",ri=function(){},Ye=oi?l.useLayoutEffect:ri;function Je(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Je(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const a=r[o];if(!(a==="_owner"&&e.$$typeof)&&!Je(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Xn(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tn(e,t){const n=Xn(e);return Math.round(t*n)/n}function ft(e){const t=l.useRef(e);return Ye(()=>{t.current=e}),t}function si(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:a,floating:i}={},transform:c=!0,whileElementsMounted:d,open:u}=e,[f,p]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,h]=l.useState(o);Je(v,o)||h(o);const[w,m]=l.useState(null),[g,b]=l.useState(null),y=l.useCallback(E=>{E!==j.current&&(j.current=E,m(E))},[]),x=l.useCallback(E=>{E!==A.current&&(A.current=E,b(E))},[]),C=a||w,N=i||g,j=l.useRef(null),A=l.useRef(null),T=l.useRef(f),R=d!=null,I=ft(d),_=ft(r),L=ft(u),D=l.useCallback(()=>{if(!j.current||!A.current)return;const E={placement:t,strategy:n,middleware:v};_.current&&(E.platform=_.current),ni(j.current,A.current,E).then(H=>{const G={...H,isPositioned:L.current!==!1};k.current&&!Je(T.current,G)&&(T.current=G,Rt.flushSync(()=>{p(G)}))})},[v,t,n,_,L]);Ye(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,p(E=>({...E,isPositioned:!1})))},[u]);const k=l.useRef(!1);Ye(()=>(k.current=!0,()=>{k.current=!1}),[]),Ye(()=>{if(C&&(j.current=C),N&&(A.current=N),C&&N){if(I.current)return I.current(C,N,D);D()}},[C,N,D,I,R]);const F=l.useMemo(()=>({reference:j,floating:A,setReference:y,setFloating:x}),[y,x]),P=l.useMemo(()=>({reference:C,floating:N}),[C,N]),M=l.useMemo(()=>{const E={position:n,left:0,top:0};if(!P.floating)return E;const H=tn(P.floating,f.x),G=tn(P.floating,f.y);return c?{...E,transform:"translate("+H+"px, "+G+"px)",...Xn(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:G}},[n,c,P.floating,f.x,f.y]);return l.useMemo(()=>({...f,update:D,refs:F,elements:P,floatingStyles:M}),[f,D,F,P,M])}const ii=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?en({element:o.current,padding:r}).fn(n):{}:o?en({element:o,padding:r}).fn(n):{}}}},ai=(e,t)=>{const n=qs(e);return{name:n.name,fn:n.fn,options:[e,t]}},ci=(e,t)=>{const n=Zs(e);return{name:n.name,fn:n.fn,options:[e,t]}},li=(e,t)=>({fn:ti(e).fn,options:[e,t]}),di=(e,t)=>{const n=Js(e);return{name:n.name,fn:n.fn,options:[e,t]}},ui=(e,t)=>{const n=Qs(e);return{name:n.name,fn:n.fn,options:[e,t]}},fi=(e,t)=>{const n=ei(e);return{name:n.name,fn:n.fn,options:[e,t]}},pi=(e,t)=>{const n=ii(e);return{name:n.name,fn:n.fn,options:[e,t]}};var mi="Arrow",qn=l.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...a}=e;return s.jsx(z.svg,{...a,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});qn.displayName=mi;var hi=qn,kt="Popper",[Zn,Jn]=Ee(kt),[gi,Qn]=Zn(kt),eo=e=>{const{__scopePopper:t,children:n}=e,[o,r]=l.useState(null);return s.jsx(gi,{scope:t,anchor:o,onAnchorChange:r,children:n})};eo.displayName=kt;var to="PopperAnchor",no=l.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,a=Qn(to,n),i=l.useRef(null),c=K(t,i),d=l.useRef(null);return l.useEffect(()=>{const u=d.current;d.current=(o==null?void 0:o.current)||i.current,u!==d.current&&a.onAnchorChange(d.current)}),o?null:s.jsx(z.div,{...r,ref:c})});no.displayName=to;var Dt="PopperContent",[xi,vi]=Zn(Dt),oo=l.forwardRef((e,t)=>{var S,O,U,W,B,$;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:a="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:v=!1,updatePositionStrategy:h="optimized",onPlaced:w,...m}=e,g=Qn(Dt,n),[b,y]=l.useState(null),x=K(t,Y=>y(Y)),[C,N]=l.useState(null),j=dn(C),A=(j==null?void 0:j.width)??0,T=(j==null?void 0:j.height)??0,R=o+(a!=="center"?"-"+a:""),I=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},_=Array.isArray(u)?u:[u],L=_.length>0,D={padding:I,boundary:_.filter(wi),altBoundary:L},{refs:k,floatingStyles:F,placement:P,isPositioned:M,middlewareData:E}=si({strategy:"fixed",placement:R,whileElementsMounted:(...Y)=>Xs(...Y,{animationFrame:h==="always"}),elements:{reference:g.anchor},middleware:[ai({mainAxis:r+T,alignmentAxis:i}),d&&ci({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?li():void 0,...D}),d&&di({...D}),ui({...D,apply:({elements:Y,rects:se,availableWidth:_e,availableHeight:ke})=>{const{width:De,height:Yo}=se.reference,Ke=Y.floating.style;Ke.setProperty("--radix-popper-available-width",`${_e}px`),Ke.setProperty("--radix-popper-available-height",`${ke}px`),Ke.setProperty("--radix-popper-anchor-width",`${De}px`),Ke.setProperty("--radix-popper-anchor-height",`${Yo}px`)}}),C&&pi({element:C,padding:c}),bi({arrowWidth:A,arrowHeight:T}),v&&fi({strategy:"referenceHidden",...D})]}),[H,G]=io(P),J=Nt(w);ne(()=>{M&&(J==null||J())},[M,J]);const ve=(S=E.arrow)==null?void 0:S.x,ye=(O=E.arrow)==null?void 0:O.y,Q=((U=E.arrow)==null?void 0:U.centerOffset)!==0,[pe,le]=l.useState();return ne(()=>{b&&le(window.getComputedStyle(b).zIndex)},[b]),s.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:M?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[(W=E.transformOrigin)==null?void 0:W.x,(B=E.transformOrigin)==null?void 0:B.y].join(" "),...(($=E.hide)==null?void 0:$.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(xi,{scope:n,placedSide:H,onArrowChange:N,arrowX:ve,arrowY:ye,shouldHideArrow:Q,children:s.jsx(z.div,{"data-side":H,"data-align":G,...m,ref:x,style:{...m.style,animation:M?void 0:"none"}})})})});oo.displayName=Dt;var ro="PopperArrow",yi={top:"bottom",right:"left",bottom:"top",left:"right"},so=l.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,a=vi(ro,o),i=yi[a.placedSide];return s.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:s.jsx(hi,{...r,ref:n,style:{...r.style,display:"block"}})})});so.displayName=ro;function wi(e){return e!==null}var bi=e=>({name:"transformOrigin",options:e,fn(t){var g,b,y;const{placement:n,rects:o,middlewareData:r}=t,i=((g=r.arrow)==null?void 0:g.centerOffset)!==0,c=i?0:e.arrowWidth,d=i?0:e.arrowHeight,[u,f]=io(n),p={start:"0%",center:"50%",end:"100%"}[f],v=(((b=r.arrow)==null?void 0:b.x)??0)+c/2,h=(((y=r.arrow)==null?void 0:y.y)??0)+d/2;let w="",m="";return u==="bottom"?(w=i?p:`${v}px`,m=`${-d}px`):u==="top"?(w=i?p:`${v}px`,m=`${o.floating.height+d}px`):u==="right"?(w=`${-d}px`,m=i?p:`${h}px`):u==="left"&&(w=`${o.floating.width+d}px`,m=i?p:`${h}px`),{data:{x:w,y:m}}}});function io(e){const[t,n="center"]=e.split("-");return[t,n]}var Si=eo,Ci=no,Ni=oo,Ri=so;function ji(e){const t=Ai(e),n=l.forwardRef((o,r)=>{const{children:a,...i}=o,c=l.Children.toArray(a),d=c.find(Ei);if(d){const u=d.props.children,f=c.map(p=>p===d?l.Children.count(u)>1?l.Children.only(null):l.isValidElement(u)?u.props.children:null:p);return s.jsx(t,{...i,ref:r,children:l.isValidElement(u)?l.cloneElement(u,void 0,f):null})}return s.jsx(t,{...i,ref:r,children:a})});return n.displayName=`${e}.Slot`,n}function Ai(e){const t=l.forwardRef((n,o)=>{const{children:r,...a}=n;if(l.isValidElement(r)){const i=Ii(r),c=Pi(a,r.props);return r.type!==l.Fragment&&(c.ref=o?rn(o,i):i),l.cloneElement(r,c)}return l.Children.count(r)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ti=Symbol("radix.slottable");function Ei(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ti}function Pi(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...c)=>{const d=a(...c);return r(...c),d}:r&&(n[o]=r):o==="style"?n[o]={...r,...a}:o==="className"&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function Ii(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ao=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Oi="VisuallyHidden",_i=l.forwardRef((e,t)=>s.jsx(z.span,{...e,ref:t,style:{...ao,...e.style}}));_i.displayName=Oi;var ki=[" ","Enter","ArrowUp","ArrowDown"],Di=[" ","Enter"],Ne="Select",[it,at,Mi]=vn(Ne),[Oe]=Ee(Ne,[Mi,Jn]),ct=Jn(),[Li,ge]=Oe(Ne),[Fi,Bi]=Oe(Ne),co=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:a,value:i,defaultValue:c,onValueChange:d,dir:u,name:f,autoComplete:p,disabled:v,required:h,form:w}=e,m=ct(t),[g,b]=l.useState(null),[y,x]=l.useState(null),[C,N]=l.useState(!1),j=jt(u),[A,T]=He({prop:o,defaultProp:r??!1,onChange:a,caller:Ne}),[R,I]=He({prop:i,defaultProp:c,onChange:d,caller:Ne}),_=l.useRef(null),L=g?w||!!g.closest("form"):!0,[D,k]=l.useState(new Set),F=Array.from(D).map(P=>P.props.value).join(";");return s.jsx(Si,{...m,children:s.jsxs(Li,{required:h,scope:t,trigger:g,onTriggerChange:b,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:C,onValueNodeHasChildrenChange:N,contentId:We(),value:R,onValueChange:I,open:A,onOpenChange:T,dir:j,triggerPointerDownPosRef:_,disabled:v,children:[s.jsx(it.Provider,{scope:t,children:s.jsx(Fi,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(P=>{k(M=>new Set(M).add(P))},[]),onNativeOptionRemove:l.useCallback(P=>{k(M=>{const E=new Set(M);return E.delete(P),E})},[]),children:n})}),L?s.jsxs(_o,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:R,onChange:P=>I(P.target.value),disabled:v,form:w,children:[R===void 0?s.jsx("option",{value:""}):null,Array.from(D)]},F):null]})})};co.displayName=Ne;var lo="SelectTrigger",uo=l.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,a=ct(n),i=ge(lo,n),c=i.disabled||o,d=K(t,i.onTriggerChange),u=at(n),f=l.useRef("touch"),[p,v,h]=Do(m=>{const g=u().filter(x=>!x.disabled),b=g.find(x=>x.value===i.value),y=Mo(g,m,b);y!==void 0&&i.onValueChange(y.value)}),w=m=>{c||(i.onOpenChange(!0),h()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return s.jsx(Ci,{asChild:!0,...a,children:s.jsx(z.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":ko(i.value)?"":void 0,...r,ref:d,onClick:V(r.onClick,m=>{m.currentTarget.focus(),f.current!=="mouse"&&w(m)}),onPointerDown:V(r.onPointerDown,m=>{f.current=m.pointerType;const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(w(m),m.preventDefault())}),onKeyDown:V(r.onKeyDown,m=>{const g=p.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&v(m.key),!(g&&m.key===" ")&&ki.includes(m.key)&&(w(),m.preventDefault())})})})});uo.displayName=lo;var fo="SelectValue",po=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:a,placeholder:i="",...c}=e,d=ge(fo,n),{onValueNodeHasChildrenChange:u}=d,f=a!==void 0,p=K(t,d.onValueNodeChange);return ne(()=>{u(f)},[u,f]),s.jsx(z.span,{...c,ref:p,style:{pointerEvents:"none"},children:ko(d.value)?s.jsx(s.Fragment,{children:i}):a})});po.displayName=fo;var $i="SelectIcon",mo=l.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return s.jsx(z.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});mo.displayName=$i;var Hi="SelectPortal",ho=e=>s.jsx(qo,{asChild:!0,...e});ho.displayName=Hi;var Re="SelectContent",go=l.forwardRef((e,t)=>{const n=ge(Re,e.__scopeSelect),[o,r]=l.useState();if(ne(()=>{r(new DocumentFragment)},[]),!n.open){const a=o;return a?Rt.createPortal(s.jsx(xo,{scope:e.__scopeSelect,children:s.jsx(it.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),a):null}return s.jsx(vo,{...e,ref:t})});go.displayName=Re;var ee=10,[xo,xe]=Oe(Re),Vi="SelectContentImpl",Wi=ji("SelectContent.RemoveScroll"),vo=l.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:a,onPointerDownOutside:i,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:v,collisionPadding:h,sticky:w,hideWhenDetached:m,avoidCollisions:g,...b}=e,y=ge(Re,n),[x,C]=l.useState(null),[N,j]=l.useState(null),A=K(t,S=>C(S)),[T,R]=l.useState(null),[I,_]=l.useState(null),L=at(n),[D,k]=l.useState(!1),F=l.useRef(!1);l.useEffect(()=>{if(x)return Zo(x)},[x]),Jo();const P=l.useCallback(S=>{const[O,...U]=L().map($=>$.ref.current),[W]=U.slice(-1),B=document.activeElement;for(const $ of S)if($===B||($==null||$.scrollIntoView({block:"nearest"}),$===O&&N&&(N.scrollTop=0),$===W&&N&&(N.scrollTop=N.scrollHeight),$==null||$.focus(),document.activeElement!==B))return},[L,N]),M=l.useCallback(()=>P([T,x]),[P,T,x]);l.useEffect(()=>{D&&M()},[D,M]);const{onOpenChange:E,triggerPointerDownPosRef:H}=y;l.useEffect(()=>{if(x){let S={x:0,y:0};const O=W=>{var B,$;S={x:Math.abs(Math.round(W.pageX)-(((B=H.current)==null?void 0:B.x)??0)),y:Math.abs(Math.round(W.pageY)-((($=H.current)==null?void 0:$.y)??0))}},U=W=>{S.x<=10&&S.y<=10?W.preventDefault():x.contains(W.target)||E(!1),document.removeEventListener("pointermove",O),H.current=null};return H.current!==null&&(document.addEventListener("pointermove",O),document.addEventListener("pointerup",U,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",O),document.removeEventListener("pointerup",U,{capture:!0})}}},[x,E,H]),l.useEffect(()=>{const S=()=>E(!1);return window.addEventListener("blur",S),window.addEventListener("resize",S),()=>{window.removeEventListener("blur",S),window.removeEventListener("resize",S)}},[E]);const[G,J]=Do(S=>{const O=L().filter(B=>!B.disabled),U=O.find(B=>B.ref.current===document.activeElement),W=Mo(O,S,U);W&&setTimeout(()=>W.ref.current.focus())}),ve=l.useCallback((S,O,U)=>{const W=!F.current&&!U;(y.value!==void 0&&y.value===O||W)&&(R(S),W&&(F.current=!0))},[y.value]),ye=l.useCallback(()=>x==null?void 0:x.focus(),[x]),Q=l.useCallback((S,O,U)=>{const W=!F.current&&!U;(y.value!==void 0&&y.value===O||W)&&_(S)},[y.value]),pe=o==="popper"?yt:yo,le=pe===yt?{side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:v,collisionPadding:h,sticky:w,hideWhenDetached:m,avoidCollisions:g}:{};return s.jsx(xo,{scope:n,content:x,viewport:N,onViewportChange:j,itemRefCallback:ve,selectedItem:T,onItemLeave:ye,itemTextRefCallback:Q,focusSelectedItem:M,selectedItemText:I,position:o,isPositioned:D,searchRef:G,children:s.jsx(Qo,{as:Wi,allowPinchZoom:!0,children:s.jsx(er,{asChild:!0,trapped:y.open,onMountAutoFocus:S=>{S.preventDefault()},onUnmountAutoFocus:V(r,S=>{var O;(O=y.trigger)==null||O.focus({preventScroll:!0}),S.preventDefault()}),children:s.jsx(tr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:S=>S.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:s.jsx(pe,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:S=>S.preventDefault(),...b,...le,onPlaced:()=>k(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:V(b.onKeyDown,S=>{const O=S.ctrlKey||S.altKey||S.metaKey;if(S.key==="Tab"&&S.preventDefault(),!O&&S.key.length===1&&J(S.key),["ArrowUp","ArrowDown","Home","End"].includes(S.key)){let W=L().filter(B=>!B.disabled).map(B=>B.ref.current);if(["ArrowUp","End"].includes(S.key)&&(W=W.slice().reverse()),["ArrowUp","ArrowDown"].includes(S.key)){const B=S.target,$=W.indexOf(B);W=W.slice($+1)}setTimeout(()=>P(W)),S.preventDefault()}})})})})})})});vo.displayName=Vi;var zi="SelectItemAlignedPosition",yo=l.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,a=ge(Re,n),i=xe(Re,n),[c,d]=l.useState(null),[u,f]=l.useState(null),p=K(t,A=>f(A)),v=at(n),h=l.useRef(!1),w=l.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:b,focusSelectedItem:y}=i,x=l.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&u&&m&&g&&b){const A=a.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),R=a.valueNode.getBoundingClientRect(),I=b.getBoundingClientRect();if(a.dir!=="rtl"){const B=I.left-T.left,$=R.left-B,Y=A.left-$,se=A.width+Y,_e=Math.max(se,T.width),ke=window.innerWidth-ee,De=zt($,[ee,Math.max(ee,ke-_e)]);c.style.minWidth=se+"px",c.style.left=De+"px"}else{const B=T.right-I.right,$=window.innerWidth-R.right-B,Y=window.innerWidth-A.right-$,se=A.width+Y,_e=Math.max(se,T.width),ke=window.innerWidth-ee,De=zt($,[ee,Math.max(ee,ke-_e)]);c.style.minWidth=se+"px",c.style.right=De+"px"}const _=v(),L=window.innerHeight-ee*2,D=m.scrollHeight,k=window.getComputedStyle(u),F=parseInt(k.borderTopWidth,10),P=parseInt(k.paddingTop,10),M=parseInt(k.borderBottomWidth,10),E=parseInt(k.paddingBottom,10),H=F+P+D+E+M,G=Math.min(g.offsetHeight*5,H),J=window.getComputedStyle(m),ve=parseInt(J.paddingTop,10),ye=parseInt(J.paddingBottom,10),Q=A.top+A.height/2-ee,pe=L-Q,le=g.offsetHeight/2,S=g.offsetTop+le,O=F+P+S,U=H-O;if(O<=Q){const B=_.length>0&&g===_[_.length-1].ref.current;c.style.bottom="0px";const $=u.clientHeight-m.offsetTop-m.offsetHeight,Y=Math.max(pe,le+(B?ye:0)+$+M),se=O+Y;c.style.height=se+"px"}else{const B=_.length>0&&g===_[0].ref.current;c.style.top="0px";const Y=Math.max(Q,F+m.offsetTop+(B?ve:0)+le)+U;c.style.height=Y+"px",m.scrollTop=O-Q+m.offsetTop}c.style.margin=`${ee}px 0`,c.style.minHeight=G+"px",c.style.maxHeight=L+"px",o==null||o(),requestAnimationFrame(()=>h.current=!0)}},[v,a.trigger,a.valueNode,c,u,m,g,b,a.dir,o]);ne(()=>x(),[x]);const[C,N]=l.useState();ne(()=>{u&&N(window.getComputedStyle(u).zIndex)},[u]);const j=l.useCallback(A=>{A&&w.current===!0&&(x(),y==null||y(),w.current=!1)},[x,y]);return s.jsx(Ki,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:j,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:s.jsx(z.div,{...r,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});yo.displayName=zi;var Ui="SelectPopperPosition",yt=l.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=ee,...a}=e,i=ct(n);return s.jsx(Ni,{...i,...a,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});yt.displayName=Ui;var[Ki,Mt]=Oe(Re,{}),wt="SelectViewport",wo=l.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,a=xe(wt,n),i=Mt(wt,n),c=K(t,a.onViewportChange),d=l.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),s.jsx(it.Slot,{scope:n,children:s.jsx(z.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:V(r.onScroll,u=>{const f=u.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:v}=i;if(v!=null&&v.current&&p){const h=Math.abs(d.current-f.scrollTop);if(h>0){const w=window.innerHeight-ee*2,m=parseFloat(p.style.minHeight),g=parseFloat(p.style.height),b=Math.max(m,g);if(b<w){const y=b+h,x=Math.min(w,y),C=y-x;p.style.height=x+"px",p.style.bottom==="0px"&&(f.scrollTop=C>0?C:0,p.style.justifyContent="flex-end")}}}d.current=f.scrollTop})})})]})});wo.displayName=wt;var bo="SelectGroup",[Gi,Yi]=Oe(bo),Xi=l.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=We();return s.jsx(Gi,{scope:n,id:r,children:s.jsx(z.div,{role:"group","aria-labelledby":r,...o,ref:t})})});Xi.displayName=bo;var So="SelectLabel",Co=l.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Yi(So,n);return s.jsx(z.div,{id:r.id,...o,ref:t})});Co.displayName=So;var Qe="SelectItem",[qi,No]=Oe(Qe),Ro=l.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:a,...i}=e,c=ge(Qe,n),d=xe(Qe,n),u=c.value===o,[f,p]=l.useState(a??""),[v,h]=l.useState(!1),w=K(t,y=>{var x;return(x=d.itemRefCallback)==null?void 0:x.call(d,y,o,r)}),m=We(),g=l.useRef("touch"),b=()=>{r||(c.onValueChange(o),c.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(qi,{scope:n,value:o,disabled:r,textId:m,isSelected:u,onItemTextChange:l.useCallback(y=>{p(x=>x||((y==null?void 0:y.textContent)??"").trim())},[]),children:s.jsx(it.ItemSlot,{scope:n,value:o,disabled:r,textValue:f,children:s.jsx(z.div,{role:"option","aria-labelledby":m,"data-highlighted":v?"":void 0,"aria-selected":u&&v,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:w,onFocus:V(i.onFocus,()=>h(!0)),onBlur:V(i.onBlur,()=>h(!1)),onClick:V(i.onClick,()=>{g.current!=="mouse"&&b()}),onPointerUp:V(i.onPointerUp,()=>{g.current==="mouse"&&b()}),onPointerDown:V(i.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:V(i.onPointerMove,y=>{var x;g.current=y.pointerType,r?(x=d.onItemLeave)==null||x.call(d):g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(i.onPointerLeave,y=>{var x;y.currentTarget===document.activeElement&&((x=d.onItemLeave)==null||x.call(d))}),onKeyDown:V(i.onKeyDown,y=>{var C;((C=d.searchRef)==null?void 0:C.current)!==""&&y.key===" "||(Di.includes(y.key)&&b(),y.key===" "&&y.preventDefault())})})})})});Ro.displayName=Qe;var Fe="SelectItemText",jo=l.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...a}=e,i=ge(Fe,n),c=xe(Fe,n),d=No(Fe,n),u=Bi(Fe,n),[f,p]=l.useState(null),v=K(t,b=>p(b),d.onItemTextChange,b=>{var y;return(y=c.itemTextRefCallback)==null?void 0:y.call(c,b,d.value,d.disabled)}),h=f==null?void 0:f.textContent,w=l.useMemo(()=>s.jsx("option",{value:d.value,disabled:d.disabled,children:h},d.value),[d.disabled,d.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=u;return ne(()=>(m(w),()=>g(w)),[m,g,w]),s.jsxs(s.Fragment,{children:[s.jsx(z.span,{id:d.textId,...a,ref:v}),d.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Rt.createPortal(a.children,i.valueNode):null]})});jo.displayName=Fe;var Ao="SelectItemIndicator",To=l.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return No(Ao,n).isSelected?s.jsx(z.span,{"aria-hidden":!0,...o,ref:t}):null});To.displayName=Ao;var bt="SelectScrollUpButton",Eo=l.forwardRef((e,t)=>{const n=xe(bt,e.__scopeSelect),o=Mt(bt,e.__scopeSelect),[r,a]=l.useState(!1),i=K(t,o.onScrollButtonChange);return ne(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=d.scrollTop>0;a(u)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?s.jsx(Io,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});Eo.displayName=bt;var St="SelectScrollDownButton",Po=l.forwardRef((e,t)=>{const n=xe(St,e.__scopeSelect),o=Mt(St,e.__scopeSelect),[r,a]=l.useState(!1),i=K(t,o.onScrollButtonChange);return ne(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=d.scrollHeight-d.clientHeight,f=Math.ceil(d.scrollTop)<u;a(f)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?s.jsx(Io,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});Po.displayName=St;var Io=l.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,a=xe("SelectScrollButton",n),i=l.useRef(null),c=at(n),d=l.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return l.useEffect(()=>()=>d(),[d]),ne(()=>{var f;const u=c().find(p=>p.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[c]),s.jsx(z.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:V(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:V(r.onPointerMove,()=>{var u;(u=a.onItemLeave)==null||u.call(a),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:V(r.onPointerLeave,()=>{d()})})}),Zi="SelectSeparator",Oo=l.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return s.jsx(z.div,{"aria-hidden":!0,...o,ref:t})});Oo.displayName=Zi;var Ct="SelectArrow",Ji=l.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=ct(n),a=ge(Ct,n),i=xe(Ct,n);return a.open&&i.position==="popper"?s.jsx(Ri,{...r,...o,ref:t}):null});Ji.displayName=Ct;var Qi="SelectBubbleInput",_o=l.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=l.useRef(null),a=K(o,r),i=ln(t);return l.useEffect(()=>{const c=r.current;if(!c)return;const d=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==t&&f){const p=new Event("change",{bubbles:!0});f.call(c,t),c.dispatchEvent(p)}},[i,t]),s.jsx(z.select,{...n,style:{...ao,...n.style},ref:a,defaultValue:t})});_o.displayName=Qi;function ko(e){return e===""||e===void 0}function Do(e){const t=Nt(e),n=l.useRef(""),o=l.useRef(0),r=l.useCallback(i=>{const c=n.current+i;t(c),function d(u){n.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>d(""),1e3))}(c)},[t]),a=l.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,a]}function Mo(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=ea(e,Math.max(a,0));r.length===1&&(i=i.filter(u=>u!==n));const d=i.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return d!==n?d:void 0}function ea(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var ta=co,Lo=uo,na=po,oa=mo,ra=ho,Fo=go,sa=wo,Bo=Co,$o=Ro,ia=jo,aa=To,Ho=Eo,Vo=Po,Wo=Oo;const zo=ta,Uo=na,Lt=l.forwardRef(({className:e,children:t,...n},o)=>s.jsxs(Lo,{ref:o,className:Z("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,s.jsx(oa,{asChild:!0,children:s.jsx(cn,{className:"h-4 w-4 opacity-50"})})]}));Lt.displayName=Lo.displayName;const Ko=l.forwardRef(({className:e,...t},n)=>s.jsx(Ho,{ref:n,className:Z("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Er,{className:"h-4 w-4"})}));Ko.displayName=Ho.displayName;const Go=l.forwardRef(({className:e,...t},n)=>s.jsx(Vo,{ref:n,className:Z("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(cn,{className:"h-4 w-4"})}));Go.displayName=Vo.displayName;const Ft=l.forwardRef(({className:e,children:t,position:n="popper",...o},r)=>s.jsx(ra,{children:s.jsxs(Fo,{ref:r,className:Z("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...o,children:[s.jsx(Ko,{}),s.jsx(sa,{className:Z("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(Go,{})]})}));Ft.displayName=Fo.displayName;const ca=l.forwardRef(({className:e,...t},n)=>s.jsx(Bo,{ref:n,className:Z("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));ca.displayName=Bo.displayName;const $e=l.forwardRef(({className:e,children:t,...n},o)=>s.jsxs($o,{ref:o,className:Z("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(aa,{children:s.jsx(nr,{className:"h-4 w-4"})})}),s.jsx(ia,{children:t})]}));$e.displayName=$o.displayName;const la=l.forwardRef(({className:e,...t},n)=>s.jsx(Wo,{ref:n,className:Z("-mx-1 my-1 h-px bg-muted",e),...t}));la.displayName=Wo.displayName;const nn={"google-drive":"Google Drive",onedrive:"OneDrive",dropbox:"Dropbox"};function da({open:e,onOpenChange:t,onAdded:n}){const[o,r]=l.useState([]),[a,i]=l.useState(!1),[c,d]=l.useState(null),[u,f]=l.useState(""),[p,v]=l.useState(""),[h,w]=l.useState(""),[m,g]=l.useState(""),[b,y]=l.useState(!1),[x,C]=l.useState(null);l.useEffect(()=>{e&&or().then(R=>r(R.available)).catch(()=>r([]))},[e]);const N=()=>{i(!1),d(null),f(""),v(""),w(""),g(""),y(!1),C(null)},j=async R=>{d(R),C(null);try{const{id:I}=await Bt({type:R,label:nn[R]||R}),{url:_}=await pt(I);window.open(_,"_blank"),N(),t(!1),n()}catch(I){C(I instanceof Error?I.message:"添加失败"),d(null)}},A=async()=>{if(!u||!p||!h||!m){C("请填写所有字段");return}y(!0),C(null);try{const{id:R}=await Bt({type:u,label:p,clientId:h,clientSecret:m}),{url:I}=await pt(R);window.open(I,"_blank"),N(),t(!1),n()}catch(R){C(R instanceof Error?R.message:"添加失败")}finally{y(!1)}},T=o.length>0;return s.jsx(rr,{open:e,onOpenChange:R=>{t(R),R||N()},children:s.jsxs(sr,{className:"sm:max-w-md",children:[s.jsxs(ir,{children:[s.jsxs(ar,{className:"flex items-center gap-2",children:[s.jsx(mt,{className:"h-5 w-5"}),"添加云盘账号"]}),s.jsx(cr,{children:a?"手动填写 OAuth 凭据连接云盘":"选择云盘类型,点击后跳转登录授权"})]}),a?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-4 py-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Se,{children:"云盘类型"}),s.jsxs(zo,{value:u,onValueChange:f,children:[s.jsx(Lt,{children:s.jsx(Uo,{placeholder:"选择云盘类型"})}),s.jsxs(Ft,{children:[s.jsx($e,{value:"google-drive",children:"Google Drive"}),s.jsx($e,{value:"onedrive",children:"OneDrive"}),s.jsx($e,{value:"dropbox",children:"Dropbox"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Se,{children:"显示名称"}),s.jsx(Be,{placeholder:"例如:我的 Google Drive",value:p,onChange:R=>v(R.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Se,{children:"Client ID"}),s.jsx(Be,{placeholder:"OAuth Client ID",value:h,onChange:R=>w(R.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Se,{children:"Client Secret"}),s.jsx(Be,{type:"password",placeholder:"OAuth Client Secret",value:m,onChange:R=>g(R.target.value)})]}),x&&s.jsx("p",{className:"text-sm text-destructive",children:x})]}),s.jsxs(lr,{children:[s.jsx(te,{variant:"outline",onClick:()=>{i(!1),C(null)},children:"返回"}),s.jsx(te,{onClick:A,disabled:b,children:b?"添加中...":"添加并授权"})]})]}):s.jsxs("div",{className:"space-y-3 py-2",children:[T?s.jsx(s.Fragment,{children:o.map(R=>s.jsx(te,{variant:"outline",className:"w-full justify-start gap-3 h-12 text-base",onClick:()=>void j(R),disabled:c!==null,children:c===R?"连接中...":`连接 ${nn[R]||R}`},R))}):s.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"暂无内置 OAuth 凭据,请使用手动模式添加"}),x&&s.jsx("p",{className:"text-sm text-destructive",children:x}),s.jsx("div",{className:"pt-2 border-t border-border",children:s.jsxs("button",{onClick:()=>{i(!0),C(null)},className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(Dr,{className:"h-3.5 w-3.5"}),"手动填写 OAuth 凭据"]})})]})]})})}const ua={"google-drive":"Google Drive",onedrive:"OneDrive",dropbox:"Dropbox"};function fa({type:e}){switch(e){case"google-drive":return s.jsx(Vt,{className:"h-5 w-5 text-blue-500"});case"onedrive":return s.jsx(mt,{className:"h-5 w-5 text-sky-500"});case"dropbox":return s.jsx(Vt,{className:"h-5 w-5 text-indigo-500"});default:return s.jsx(mt,{className:"h-5 w-5"})}}function pa({provider:e,onDelete:t,onReauth:n}){var i;const[o,r]=l.useState(!1),a=()=>{o?(t(e.id),r(!1)):(r(!0),setTimeout(()=>r(!1),3e3))};return s.jsxs(dr,{children:[s.jsx(ur,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(fa,{type:e.type}),s.jsxs("div",{children:[s.jsx(fr,{className:"text-base",children:e.label}),s.jsx("p",{className:"text-sm text-muted-foreground",children:ua[e.type]||e.type})]})]}),s.jsx(sn,{variant:e.authorized?"default":"destructive",className:e.authorized?"bg-green-600 hover:bg-green-700":"",children:e.authorized?"已授权":"未授权"})]})}),s.jsxs(pr,{children:[e.authorized&&((i=e.tokens)==null?void 0:i.expiry)&&s.jsxs("p",{className:"text-xs text-muted-foreground mb-3",children:["授权到期:",new Date(e.tokens.expiry).toLocaleDateString("zh-CN")]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(te,{variant:"outline",size:"sm",onClick:()=>n(e.id),children:[s.jsx(an,{className:"h-3.5 w-3.5 mr-1"}),"重新授权"]}),s.jsxs(te,{variant:o?"destructive":"outline",size:"sm",onClick:a,children:[s.jsx(mr,{className:"h-3.5 w-3.5 mr-1"}),o?"确认删除?":"删除"]})]})]})]})}const ma={success:{label:"成功",icon:kr,className:"bg-green-600 hover:bg-green-700"},failed:{label:"失败",icon:Mr,className:"bg-red-600 hover:bg-red-700"},partial:{label:"部分完成",icon:Or,className:"bg-yellow-600 hover:bg-yellow-700"}};function ha(e,t){const n=new Date(t).getTime()-new Date(e).getTime();if(n<1e3)return`${n}ms`;const o=Math.floor(n/1e3);if(o<60)return`${o}秒`;const r=Math.floor(o/60),a=o%60;return`${r}分${a}秒`}function ga(e){return new Date(e).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function xa({history:e}){const t=e.slice(0,20);return t.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[s.jsx(Pr,{className:"h-10 w-10 mb-3 opacity-50"}),s.jsx("p",{className:"text-sm",children:"暂无备份记录"})]}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b",children:[s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"时间"}),s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"项目"}),s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"云盘"}),s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"状态"}),s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"文件数"}),s.jsx("th",{className:"text-left py-3 px-2 font-medium text-muted-foreground",children:"耗时"})]})}),s.jsx("tbody",{children:t.map(n=>{const o=ma[n.status],r=o.icon;return s.jsxs("tr",{className:"border-b last:border-0 hover:bg-muted/50",children:[s.jsx("td",{className:"py-2.5 px-2 whitespace-nowrap",children:ga(n.startTime)}),s.jsx("td",{className:"py-2.5 px-2",children:n.projectName}),s.jsx("td",{className:"py-2.5 px-2",children:n.providerLabel}),s.jsxs("td",{className:"py-2.5 px-2",children:[s.jsxs(sn,{className:o.className,children:[s.jsx(r,{className:"h-3 w-3 mr-1"}),o.label]}),n.error&&s.jsx("p",{className:"text-xs text-destructive mt-1",children:n.error})]}),s.jsxs("td",{className:"py-2.5 px-2 whitespace-nowrap",children:[n.filesUploaded,"/",n.filesTotal]}),s.jsx("td",{className:"py-2.5 px-2 whitespace-nowrap",children:ha(n.startTime,n.endTime)})]},n.id)})})]})})}const on=["node_modules",".git","dist","build","*.log",".DS_Store","*.tmp",".venv","__pycache__",".env"],va=[{value:"30",label:"30分钟"},{value:"60",label:"1小时"},{value:"360",label:"6小时"},{value:"720",label:"12小时"},{value:"1440",label:"24小时"}];function Sa(){const e=hr(),[t,n]=l.useState([]),[o,r]=l.useState(!0),[a,i]=l.useState(!1),[c,d]=l.useState({enabled:!1,intervalMinutes:60}),[u,f]=l.useState(!0),[p,v]=l.useState([]),[h,w]=l.useState(!0),[m,g]=l.useState(""),[b,y]=l.useState(!1),[x,C]=l.useState(!1),[N,j]=l.useState([]),[A,T]=l.useState(!0),[R,I]=l.useState({webhookEnabled:!1}),[_,L]=l.useState(""),[D,k]=l.useState(!1),F=async()=>{try{const S=await Sr();n(S)}catch{}finally{r(!1)}},P=async()=>{try{const S=await Cr();d(S)}catch{}finally{f(!1)}},M=async()=>{try{const S=await Nr();v(S.length>0?S:on)}catch{v(on)}finally{w(!1)}},E=async()=>{try{const S=await Rr();j(S)}catch{}finally{T(!1)}};l.useEffect(()=>{F(),P(),M(),E(),gr().then(S=>{I(S),L(S.webhookUrl??"")}).catch(()=>{})},[]);const H=async()=>{k(!0);try{const S=await Tr({webhookEnabled:_.trim().length>0,webhookUrl:_.trim()||void 0});I(S),Ht.success("Webhook 配置已保存")}catch{Ht.error("保存失败")}finally{k(!1)}},G=async S=>{try{await jr(S),n(O=>O.filter(U=>U.id!==S))}catch{}},J=async S=>{try{const{url:O}=await pt(S);window.open(O,"_blank")}catch{}},ve=async S=>{const O={...c,enabled:S};d(O);try{await $t({enabled:S})}catch{d(c)}},ye=async S=>{const O=parseInt(S,10),U={...c,intervalMinutes:O};d(U);try{await $t({intervalMinutes:O})}catch{d(c)}},Q=()=>{const S=m.trim();!S||p.includes(S)||(v(O=>[...O,S]),g(""),y(!0))},pe=S=>{v(O=>O.filter(U=>U!==S)),y(!0)},le=async()=>{C(!0);try{await Ar(p),y(!1)}catch{}finally{C(!1)}};return s.jsx("div",{className:"min-h-screen bg-background",children:s.jsxs("div",{className:"max-w-4xl mx-auto p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsxs(te,{variant:"ghost",size:"sm",onClick:()=>e("/"),children:[s.jsx(xr,{className:"h-4 w-4 mr-1"}),"返回"]}),s.jsx("h1",{className:"text-2xl font-bold",children:"设置"})]}),s.jsxs(ls,{defaultValue:"providers",children:[s.jsxs(Fn,{className:"mb-4",children:[s.jsx(Me,{value:"providers",children:"云盘账号"}),s.jsx(Me,{value:"strategy",children:"备份策略"}),s.jsx(Me,{value:"history",children:"备份记录"}),s.jsxs(Me,{value:"notifications",children:[s.jsx(_r,{className:"h-3.5 w-3.5 mr-1.5"}),"通知"]})]}),s.jsxs(Le,{value:"providers",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex justify-end",children:s.jsxs(te,{onClick:()=>i(!0),children:[s.jsx(vr,{className:"h-4 w-4 mr-1"}),"添加云盘"]})}),o?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"加载中..."}):t.length===0?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-12",children:"暂无云盘账号,点击上方按钮添加"}):s.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:t.map(S=>s.jsx(pa,{provider:S,onDelete:G,onReauth:J},S.id))})]}),s.jsx(da,{open:a,onOpenChange:i,onAdded:()=>void F()})]}),s.jsx(Le,{value:"strategy",children:s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-medium",children:"排除规则"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"匹配这些模式的文件和目录将不会被备份"}),h?s.jsx("p",{className:"text-sm text-muted-foreground",children:"加载中..."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex flex-wrap gap-2",children:s.jsx(yr,{children:p.map(S=>s.jsxs(wr.span,{layout:!0,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"inline-flex items-center gap-1 rounded-md bg-muted px-2.5 py-1 text-sm",children:[S,s.jsx("button",{onClick:()=>pe(S),className:"ml-0.5 rounded-sm hover:bg-muted-foreground/20 p-0.5",children:s.jsx(br,{className:"h-3 w-3"})})]},S))})}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Be,{placeholder:"输入排除模式,例如 *.log",value:m,onChange:S=>g(S.target.value),onKeyDown:S=>{S.key==="Enter"&&Q()},className:"max-w-xs"}),s.jsx(te,{variant:"outline",size:"sm",onClick:Q,children:"添加"})]}),b&&s.jsxs(te,{onClick:le,disabled:x,children:[s.jsx(Ir,{className:"h-4 w-4 mr-1"}),x?"保存中...":"保存"]})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-medium",children:"定时备份"}),u?s.jsx("p",{className:"text-sm text-muted-foreground",children:"加载中..."}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(xn,{checked:c.enabled,onCheckedChange:ve}),s.jsx(Se,{children:c.enabled?"已开启":"已关闭"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Se,{children:"备份间隔"}),s.jsxs(zo,{value:String(c.intervalMinutes),onValueChange:ye,children:[s.jsx(Lt,{className:"w-48",children:s.jsx(Uo,{})}),s.jsx(Ft,{children:va.map(S=>s.jsx($e,{value:S.value,children:S.label},S.value))})]})]})]})]})]})}),s.jsx(Le,{value:"history",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex justify-end",children:s.jsxs(te,{variant:"outline",size:"sm",onClick:()=>{T(!0),E()},children:[s.jsx(an,{className:"h-4 w-4 mr-1"}),"刷新"]})}),A?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"加载中..."}):s.jsx(xa,{history:N})]})}),s.jsx(Le,{value:"notifications",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[s.jsx("h3",{className:"text-sm font-medium",children:"浏览器通知"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"当 Claude 完成任务时,浏览器将自动弹出通知。首次打开 Dashboard 时会请求通知权限。"})]}),s.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-3",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium",children:"Webhook 通知"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Claude 完成任务时向指定 URL 发送 POST 请求(JSON: event, projectId, projectName, timestamp)"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Se,{className:"text-xs",children:"Webhook URL"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Be,{placeholder:"https://hooks.slack.com/...",value:_,onChange:S=>L(S.target.value),className:"font-mono text-xs"}),s.jsx(te,{size:"sm",onClick:()=>void H(),disabled:D,children:D?"保存中…":"保存"})]}),R.webhookEnabled&&R.webhookUrl&&s.jsxs("p",{className:"text-xs text-green-500",children:["已启用 → ",R.webhookUrl]})]})]})]})})]})]})})}export{Sa as SettingsPage};
@@ -1 +1 @@
1
- import{az as f,r,aX as g,j as e,e as a}from"./index-Dc8u1vU0.js";import{U as j}from"./user-CljKCZZO.js";import{B as p}from"./bot-Bhot_xL1.js";function v(){const{token:n}=f(),[o,c]=r.useState(!0),[i,l]=r.useState(null),[t,d]=r.useState(null),[m,x]=r.useState("");if(r.useEffect(()=>{n&&(c(!0),g(n).then(s=>{document.title=s.projectName+" — cc-web",d(s.session),x(s.projectName)}).catch(s=>l(s.message||"链接无效或已过期")).finally(()=>c(!1)))},[n]),o)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsx("span",{className:"text-muted-foreground text-sm",children:"加载中…"})});if(i||!t)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("p",{className:"text-foreground font-medium",children:"无法加载会话"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:i??"链接无效或已过期"})]})});const u=new Date(t.startedAt).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"});return e.jsx("div",{className:"min-h-screen bg-background text-foreground",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-8",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-lg font-semibold text-foreground",children:m}),e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-sm text-muted-foreground",children:[e.jsx("span",{children:u}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[t.messageCount," 条消息"]})]})]}),e.jsxs("div",{className:"space-y-4",children:[t.messages.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground text-center py-8",children:"本次会话暂无记录"}),t.messages.map((s,h)=>e.jsxs("div",{className:a("flex gap-2.5",s.role==="user"?"flex-row-reverse":"flex-row"),children:[e.jsx("div",{className:a("flex-shrink-0 w-7 h-7 rounded-full flex items-center justify-center mt-0.5",s.role==="user"?"bg-blue-500/10":"bg-muted"),children:s.role==="user"?e.jsx(j,{className:"h-3.5 w-3.5 text-blue-400"}):e.jsx(p,{className:"h-3.5 w-3.5 text-muted-foreground"})}),e.jsx("div",{className:a("max-w-[85%] text-sm rounded-lg px-3 py-2 whitespace-pre-wrap break-words",s.role==="user"?"bg-blue-500/10 text-blue-400":"bg-muted text-foreground"),children:s.content})]},h))]})]})})}export{v as ShareViewPage};
1
+ import{af as f,r,aR as g,j as e,e as a}from"./index-D4FtflMi.js";import{U as j}from"./user-DrmNnlq0.js";import{B as p}from"./bot-Dvon5AP9.js";function v(){const{token:n}=f(),[o,c]=r.useState(!0),[i,l]=r.useState(null),[t,d]=r.useState(null),[m,x]=r.useState("");if(r.useEffect(()=>{n&&(c(!0),g(n).then(s=>{document.title=s.projectName+" — cc-web",d(s.session),x(s.projectName)}).catch(s=>l(s.message||"链接无效或已过期")).finally(()=>c(!1)))},[n]),o)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsx("span",{className:"text-muted-foreground text-sm",children:"加载中…"})});if(i||!t)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("p",{className:"text-foreground font-medium",children:"无法加载会话"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:i??"链接无效或已过期"})]})});const u=new Date(t.startedAt).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"});return e.jsx("div",{className:"min-h-screen bg-background text-foreground",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-8",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-lg font-semibold text-foreground",children:m}),e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-sm text-muted-foreground",children:[e.jsx("span",{children:u}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[t.messageCount," 条消息"]})]})]}),e.jsxs("div",{className:"space-y-4",children:[t.messages.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground text-center py-8",children:"本次会话暂无记录"}),t.messages.map((s,h)=>e.jsxs("div",{className:a("flex gap-2.5",s.role==="user"?"flex-row-reverse":"flex-row"),children:[e.jsx("div",{className:a("flex-shrink-0 w-7 h-7 rounded-full flex items-center justify-center mt-0.5",s.role==="user"?"bg-blue-500/10":"bg-muted"),children:s.role==="user"?e.jsx(j,{className:"h-3.5 w-3.5 text-blue-400"}):e.jsx(p,{className:"h-3.5 w-3.5 text-muted-foreground"})}),e.jsx("div",{className:a("max-w-[85%] text-sm rounded-lg px-3 py-2 whitespace-pre-wrap break-words",s.role==="user"?"bg-blue-500/10 text-blue-400":"bg-muted text-foreground"),children:s.content})]},h))]})]})})}export{v as ShareViewPage};
@@ -1,6 +1,6 @@
1
- import{c as k,al as z,r,aV as P,j as e,K as S,am as U,au as F,I as G,e as g,o as p,G as O,A as q,aW as B,t as K}from"./index-Dc8u1vU0.js";import{U as R}from"./user-CljKCZZO.js";import{D as _}from"./download-dn65Yic6.js";import{C as V}from"./chevron-down-BLLGZF4Q.js";/**
1
+ import{c as k,a3 as P,r,aP as z,j as e,B as S,a4 as U,ab as B,I as F,e as g,o as p,H as O,A as q,aQ as G,t as Q}from"./index-D4FtflMi.js";import{U as R}from"./user-DrmNnlq0.js";import{D as _}from"./download-s_UyPGX4.js";import{C as Z}from"./chevron-down-oywyj_mF.js";/**
2
2
  * @license lucide-react v0.309.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const W=k("Tag",[["path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z",key:"14b2ls"}],["path",{d:"M7 7h.01",key:"7u93v4"}]]);function X(){const C=z(),[o,f]=r.useState([]),[x,I]=r.useState(!0),[i,E]=r.useState(null),[c,L]=r.useState(""),[d,h]=r.useState(null),[D,H]=r.useState(null),[j,w]=r.useState(null),[N,M]=r.useState(new Set);r.useEffect(()=>{P().then(f).catch(t=>E(t instanceof Error?t.message:"Failed to load SkillHub")).finally(()=>I(!1))},[]);const b=r.useMemo(()=>{const t=new Set;return o.forEach(a=>{var s;return(s=a.tags)==null?void 0:s.forEach(n=>t.add(n))}),Array.from(t).sort()},[o]),A=r.useMemo(()=>o.some(t=>!t.tags||t.tags.length===0),[o]),v=r.useMemo(()=>{let t=o;if(d==="__untagged__"?t=t.filter(a=>!a.tags||a.tags.length===0):d&&(t=t.filter(a=>{var s;return(s=a.tags)==null?void 0:s.includes(d)})),c.trim()){const a=c.toLowerCase();t=t.filter(s=>{var n;return s.label.toLowerCase().includes(a)||s.description.toLowerCase().includes(a)||s.command.toLowerCase().includes(a)||s.author.toLowerCase().includes(a)||((n=s.tags)==null?void 0:n.some(m=>m.toLowerCase().includes(a)))})}return t},[o,c,d]),T=async(t,a)=>{if(a.stopPropagation(),!(j||N.has(t.id))){w(t.id);try{await B(t.id),M(s=>new Set(s).add(t.id)),f(s=>s.map(n=>n.id===t.id?{...n,downloads:(n.downloads||0)+1}:n))}catch(s){K.error(s instanceof Error?s.message:"Download failed")}finally{w(null)}}};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("header",{className:"border-b sticky top-0 bg-background z-10",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-4 h-14 flex items-center gap-4",children:[e.jsxs(S,{variant:"ghost",size:"sm",onClick:()=>C("/"),children:[e.jsx(U,{className:"h-4 w-4 mr-1"}),"返回"]}),e.jsx("h1",{className:"font-semibold text-lg",children:"SkillHub"}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"relative w-64",children:[e.jsx(F,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(G,{placeholder:"搜索命令...",value:c,onChange:t=>L(t.target.value),className:"pl-8 h-9"})]})]})}),e.jsxs("main",{className:"max-w-4xl mx-auto px-4 py-6",children:[b.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[e.jsx("button",{className:g("px-3 py-1 rounded-full text-xs font-medium transition-colors",d===null?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>h(null),children:"全部"}),b.map(t=>e.jsx("button",{className:g("px-3 py-1 rounded-full text-xs font-medium transition-colors",d===t?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>h(d===t?null:t),children:t},t)),A&&e.jsx("button",{className:g("px-3 py-1 rounded-full text-xs font-medium transition-colors",d==="__untagged__"?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>h(d==="__untagged__"?null:"__untagged__"),children:"无标签"})]}),x&&e.jsx("div",{className:"text-center text-muted-foreground py-20",children:"加载中..."}),i&&e.jsx("div",{className:"text-center text-destructive py-20",children:i}),!x&&!i&&o.length===0&&e.jsxs("div",{className:"text-center text-muted-foreground py-20",children:[e.jsx("p",{className:"text-lg mb-2",children:"SkillHub 还没有命令"}),e.jsx("p",{className:"text-sm",children:"在快捷命令面板中点击分享按钮来提交第一个命令吧!"})]}),!x&&!i&&o.length>0&&v.length===0&&e.jsx("div",{className:"text-center text-muted-foreground py-20",children:"没有匹配的命令"}),e.jsx("div",{className:"space-y-3",children:v.map((t,a)=>{var y;const s=D===t.id,n=N.has(t.id),m=j===t.id,u=t.parentId?o.find(l=>l.id===t.parentId):void 0;return e.jsxs(p.div,{layout:!0,initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.25,delay:a*.03,ease:"easeOut"},className:"rounded-lg border bg-card p-4 cursor-pointer hover:border-muted-foreground/30 transition-colors",onClick:()=>H(s?null:t.id),children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-medium text-sm truncate",children:t.label}),(y=t.tags)==null?void 0:y.map(l=>e.jsxs("span",{className:"inline-flex items-center gap-0.5 px-2 py-0.5 rounded-full text-xs bg-muted text-muted-foreground",children:[e.jsx(W,{className:"h-2.5 w-2.5"}),l]},l))]}),u&&e.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[e.jsx(O,{className:"h-3 w-3 text-muted-foreground"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["继承: ",u.label]})]}),t.description&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1 truncate",children:t.description}),e.jsxs("div",{className:"flex items-center gap-3 mt-2 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"h-3 w-3"}),t.author]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(_,{className:"h-3 w-3"}),t.downloads||0]}),e.jsx("span",{children:t.createdAt})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsxs(S,{size:"sm",variant:n?"outline":"default",disabled:m||n,onClick:l=>T(t,l),title:u?`将同时下载继承的「${u.label}」`:void 0,children:[e.jsx(_,{className:"h-3.5 w-3.5 mr-1"}),n?"已下载":m?"下载中...":"下载"]}),e.jsx(p.span,{animate:{rotate:s?180:0},transition:{duration:.2},children:e.jsx(V,{className:"h-4 w-4 text-muted-foreground"})})]})]}),e.jsx(q,{children:s&&e.jsx(p.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:e.jsx("div",{className:"mt-3 pt-3 border-t",children:e.jsx("pre",{className:"text-xs font-mono bg-muted rounded p-3 whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:t.command})})})})]},t.id)})})]})]})}export{X as SkillHubPage};
6
+ */const $=k("Tag",[["path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z",key:"14b2ls"}],["path",{d:"M7 7h.01",key:"7u93v4"}]]);function X(){const C=P(),[o,f]=r.useState([]),[x,I]=r.useState(!0),[i,E]=r.useState(null),[c,L]=r.useState(""),[d,h]=r.useState(null),[D,H]=r.useState(null),[j,w]=r.useState(null),[N,M]=r.useState(new Set);r.useEffect(()=>{z().then(f).catch(t=>E(t instanceof Error?t.message:"Failed to load SkillHub")).finally(()=>I(!1))},[]);const b=r.useMemo(()=>{const t=new Set;return o.forEach(a=>{var s;return(s=a.tags)==null?void 0:s.forEach(n=>t.add(n))}),Array.from(t).sort()},[o]),A=r.useMemo(()=>o.some(t=>!t.tags||t.tags.length===0),[o]),v=r.useMemo(()=>{let t=o;if(d==="__untagged__"?t=t.filter(a=>!a.tags||a.tags.length===0):d&&(t=t.filter(a=>{var s;return(s=a.tags)==null?void 0:s.includes(d)})),c.trim()){const a=c.toLowerCase();t=t.filter(s=>{var n;return s.label.toLowerCase().includes(a)||s.description.toLowerCase().includes(a)||s.command.toLowerCase().includes(a)||s.author.toLowerCase().includes(a)||((n=s.tags)==null?void 0:n.some(m=>m.toLowerCase().includes(a)))})}return t},[o,c,d]),T=async(t,a)=>{if(a.stopPropagation(),!(j||N.has(t.id))){w(t.id);try{await G(t.id),M(s=>new Set(s).add(t.id)),f(s=>s.map(n=>n.id===t.id?{...n,downloads:(n.downloads||0)+1}:n))}catch(s){Q.error(s instanceof Error?s.message:"Download failed")}finally{w(null)}}};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("header",{className:"border-b sticky top-0 bg-background z-10",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-4 h-14 flex items-center gap-4",children:[e.jsxs(S,{variant:"ghost",size:"sm",onClick:()=>C("/"),children:[e.jsx(U,{className:"h-4 w-4 mr-1"}),"返回"]}),e.jsx("h1",{className:"font-semibold text-lg",children:"SkillHub"}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"relative w-64",children:[e.jsx(B,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(F,{placeholder:"搜索命令...",value:c,onChange:t=>L(t.target.value),className:"pl-8 h-9"})]})]})}),e.jsxs("main",{className:"max-w-4xl mx-auto px-4 py-6",children:[b.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[e.jsx("button",{className:g("px-3 py-1 rounded-full text-xs font-medium transition-colors",d===null?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>h(null),children:"全部"}),b.map(t=>e.jsx("button",{className:g("px-3 py-1 rounded-full text-xs font-medium transition-colors",d===t?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>h(d===t?null:t),children:t},t)),A&&e.jsx("button",{className:g("px-3 py-1 rounded-full text-xs font-medium transition-colors",d==="__untagged__"?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"),onClick:()=>h(d==="__untagged__"?null:"__untagged__"),children:"无标签"})]}),x&&e.jsx("div",{className:"text-center text-muted-foreground py-20",children:"加载中..."}),i&&e.jsx("div",{className:"text-center text-destructive py-20",children:i}),!x&&!i&&o.length===0&&e.jsxs("div",{className:"text-center text-muted-foreground py-20",children:[e.jsx("p",{className:"text-lg mb-2",children:"SkillHub 还没有命令"}),e.jsx("p",{className:"text-sm",children:"在快捷命令面板中点击分享按钮来提交第一个命令吧!"})]}),!x&&!i&&o.length>0&&v.length===0&&e.jsx("div",{className:"text-center text-muted-foreground py-20",children:"没有匹配的命令"}),e.jsx("div",{className:"space-y-3",children:v.map((t,a)=>{var y;const s=D===t.id,n=N.has(t.id),m=j===t.id,u=t.parentId?o.find(l=>l.id===t.parentId):void 0;return e.jsxs(p.div,{layout:!0,initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.25,delay:a*.03,ease:"easeOut"},className:"rounded-lg border bg-card p-4 cursor-pointer hover:border-muted-foreground/30 transition-colors",onClick:()=>H(s?null:t.id),children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-medium text-sm truncate",children:t.label}),(y=t.tags)==null?void 0:y.map(l=>e.jsxs("span",{className:"inline-flex items-center gap-0.5 px-2 py-0.5 rounded-full text-xs bg-muted text-muted-foreground",children:[e.jsx($,{className:"h-2.5 w-2.5"}),l]},l))]}),u&&e.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[e.jsx(O,{className:"h-3 w-3 text-muted-foreground"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["继承: ",u.label]})]}),t.description&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1 truncate",children:t.description}),e.jsxs("div",{className:"flex items-center gap-3 mt-2 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"h-3 w-3"}),t.author]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(_,{className:"h-3 w-3"}),t.downloads||0]}),e.jsx("span",{children:t.createdAt})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsxs(S,{size:"sm",variant:n?"outline":"default",disabled:m||n,onClick:l=>T(t,l),title:u?`将同时下载继承的「${u.label}」`:void 0,children:[e.jsx(_,{className:"h-3.5 w-3.5 mr-1"}),n?"已下载":m?"下载中...":"下载"]}),e.jsx(p.span,{animate:{rotate:s?180:0},transition:{duration:.2},children:e.jsx(Z,{className:"h-4 w-4 text-muted-foreground"})})]})]}),e.jsx(q,{children:s&&e.jsx(p.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:e.jsx("div",{className:"mt-3 pt-3 border-t",children:e.jsx("pre",{className:"text-xs font-mono bg-muted rounded p-3 whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:t.command})})})})]},t.id)})})]})]})}export{X as SkillHubPage};
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-Dc8u1vU0.js";/**
1
+ import{c as t}from"./index-D4FtflMi.js";/**
2
2
  * @license lucide-react v0.309.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-Dc8u1vU0.js";/**
1
+ import{c as o}from"./index-D4FtflMi.js";/**
2
2
  * @license lucide-react v0.309.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-Dc8u1vU0.js";/**
1
+ import{c as o}from"./index-D4FtflMi.js";/**
2
2
  * @license lucide-react v0.309.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.