@kaitranntt/ccs 7.49.1-dev.2 → 7.50.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/dist/api/services/index.d.ts +2 -2
- package/dist/api/services/index.d.ts.map +1 -1
- package/dist/api/services/index.js +2 -1
- package/dist/api/services/index.js.map +1 -1
- package/dist/api/services/profile-reader.d.ts.map +1 -1
- package/dist/api/services/profile-reader.js +13 -0
- package/dist/api/services/profile-reader.js.map +1 -1
- package/dist/api/services/profile-types.d.ts +9 -0
- package/dist/api/services/profile-types.d.ts.map +1 -1
- package/dist/api/services/profile-writer.d.ts +8 -2
- package/dist/api/services/profile-writer.d.ts.map +1 -1
- package/dist/api/services/profile-writer.js +68 -6
- package/dist/api/services/profile-writer.js.map +1 -1
- package/dist/auth/profile-detector.d.ts.map +1 -1
- package/dist/auth/profile-detector.js +7 -0
- package/dist/auth/profile-detector.js.map +1 -1
- package/dist/ccs.js +100 -2
- package/dist/ccs.js.map +1 -1
- package/dist/cliproxy/services/variant-config-adapter.d.ts +4 -35
- package/dist/cliproxy/services/variant-config-adapter.d.ts.map +1 -1
- package/dist/cliproxy/services/variant-config-adapter.js +11 -34
- package/dist/cliproxy/services/variant-config-adapter.js.map +1 -1
- package/dist/cliproxy/services/variant-service.d.ts +5 -1
- package/dist/cliproxy/services/variant-service.d.ts.map +1 -1
- package/dist/cliproxy/services/variant-service.js +19 -9
- package/dist/cliproxy/services/variant-service.js.map +1 -1
- package/dist/cliproxy/sync/profile-mapper.d.ts.map +1 -1
- package/dist/cliproxy/sync/profile-mapper.js +14 -2
- package/dist/cliproxy/sync/profile-mapper.js.map +1 -1
- package/dist/commands/api-command.d.ts +2 -0
- package/dist/commands/api-command.d.ts.map +1 -1
- package/dist/commands/api-command.js +45 -10
- package/dist/commands/api-command.js.map +1 -1
- package/dist/commands/cliproxy/auth-subcommand.d.ts.map +1 -1
- package/dist/commands/cliproxy/auth-subcommand.js +5 -2
- package/dist/commands/cliproxy/auth-subcommand.js.map +1 -1
- package/dist/commands/cliproxy/help-subcommand.d.ts.map +1 -1
- package/dist/commands/cliproxy/help-subcommand.js +1 -0
- package/dist/commands/cliproxy/help-subcommand.js.map +1 -1
- package/dist/commands/cliproxy/variant-subcommand.d.ts +15 -0
- package/dist/commands/cliproxy/variant-subcommand.d.ts.map +1 -1
- package/dist/commands/cliproxy/variant-subcommand.js +144 -15
- package/dist/commands/cliproxy/variant-subcommand.js.map +1 -1
- package/dist/commands/help-command.d.ts.map +1 -1
- package/dist/commands/help-command.js +9 -1
- package/dist/commands/help-command.js.map +1 -1
- package/dist/targets/droid-adapter.d.ts +1 -3
- package/dist/targets/droid-adapter.d.ts.map +1 -1
- package/dist/targets/droid-adapter.js +4 -6
- package/dist/targets/droid-adapter.js.map +1 -1
- package/dist/targets/droid-config-manager.js +3 -3
- package/dist/targets/droid-config-manager.js.map +1 -1
- package/dist/targets/target-resolver.d.ts.map +1 -1
- package/dist/targets/target-resolver.js +6 -3
- package/dist/targets/target-resolver.js.map +1 -1
- package/dist/types/config.d.ts +5 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js.map +1 -1
- package/dist/ui/assets/accounts-BKK-Lc16.js +1 -0
- package/dist/ui/assets/{alert-dialog-YcmZPFim.js → alert-dialog-DmrIcJav.js} +1 -1
- package/dist/ui/assets/api-DzTwRtww.js +1 -0
- package/dist/ui/assets/{auth-section-Amm4rwiS.js → auth-section-CP_2r8oJ.js} +1 -1
- package/dist/ui/assets/{backups-section-DmAsqMfq.js → backups-section-jwtuA5Ay.js} +1 -1
- package/dist/ui/assets/{checkbox-Cfg9kbJX.js → checkbox-CNqHZx7Z.js} +1 -1
- package/dist/ui/assets/cliproxy-CtO9BwgG.js +3 -0
- package/dist/ui/assets/cliproxy-control-panel--WUVyBIk.js +1 -0
- package/dist/ui/assets/{confirm-dialog-CRcV2Yc4.js → confirm-dialog-CQNxkz9X.js} +1 -1
- package/dist/ui/assets/{copilot-EarFqUyJ.js → copilot-DLxxmnsW.js} +2 -2
- package/dist/ui/assets/{cursor-Dbe4Wtw2.js → cursor-YRIza7sP.js} +1 -1
- package/dist/ui/assets/{form-utils-C-pVd1--.js → form-utils-Cn_Uld6y.js} +1 -1
- package/dist/ui/assets/{globalenv-section-CBp73q9k.js → globalenv-section-vUSIK5rf.js} +1 -1
- package/dist/ui/assets/{health-Cvr359ff.js → health-BWPd6F4h.js} +1 -1
- package/dist/ui/assets/icons-Dk2sL3Mr.js +1 -0
- package/dist/ui/assets/index-B9dJZNls.js +1 -0
- package/dist/ui/assets/index-BZdHAol5.js +1 -0
- package/dist/ui/assets/{index-DTDftvd-.js → index-BlldLmNl.js} +1 -1
- package/dist/ui/assets/{index-Cp8K9_TQ.js → index-D244tv89.js} +1 -1
- package/dist/ui/assets/index-DEDy1J8t.css +1 -0
- package/dist/ui/assets/index-PWMOllOf.js +47 -0
- package/dist/ui/assets/proxy-status-widget-MlyNgoPh.js +1 -0
- package/dist/ui/assets/{radix-ui-DKgfU5rd.js → radix-ui-DIWAxjEp.js} +1 -1
- package/dist/ui/assets/{separator-CdOKc0gJ.js → separator-OcJLDgYQ.js} +1 -1
- package/dist/ui/assets/{shared-zsUXmES2.js → shared-LxAdbm4g.js} +1 -1
- package/dist/ui/assets/{switch-B2ALi24E.js → switch-s8pp-m8L.js} +1 -1
- package/dist/ui/assets/{tanstack-5ndrQy-j.js → tanstack-Hn82hibe.js} +1 -1
- package/dist/ui/assets/updates-BQRhDVbP.js +1 -0
- package/dist/ui/index.html +6 -6
- package/dist/web-server/routes/profile-routes.d.ts +2 -0
- package/dist/web-server/routes/profile-routes.d.ts.map +1 -1
- package/dist/web-server/routes/profile-routes.js +60 -6
- package/dist/web-server/routes/profile-routes.js.map +1 -1
- package/dist/web-server/routes/variant-routes.d.ts +2 -0
- package/dist/web-server/routes/variant-routes.d.ts.map +1 -1
- package/dist/web-server/routes/variant-routes.js +50 -6
- package/dist/web-server/routes/variant-routes.js.map +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/accounts-DIqClJ7z.js +0 -1
- package/dist/ui/assets/api-BWyCgbMh.js +0 -1
- package/dist/ui/assets/cliproxy-B-q7RjS2.js +0 -3
- package/dist/ui/assets/cliproxy-control-panel-BliRTkbb.js +0 -1
- package/dist/ui/assets/icons-DGASzt3M.js +0 -1
- package/dist/ui/assets/index-8n-yIlea.js +0 -47
- package/dist/ui/assets/index-B5aulDs4.js +0 -1
- package/dist/ui/assets/index-BBCDm6dS.css +0 -1
- package/dist/ui/assets/index-CLBNUja8.js +0 -1
- package/dist/ui/assets/proxy-status-widget-C0G0aOCW.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./radix-ui-DIWAxjEp.js";import{r as y}from"./react-vendor-CNOkPC89.js";import{b9 as X,aL as Y,ba as Z,bb as _,bc as ee,bd as se,be as te,c as d,B as E,aw as ae,K as ne,N as re,q as oe,r as ie,s as le,t as ce,v as de,b as T,T as xe,o as me,p as ue,W as he}from"./index-PWMOllOf.js";import{A as ge,a as pe,b as fe,c as be,d as je,e as ye,f as Ne,g as we}from"./alert-dialog-DmrIcJav.js";import{u as L,a as ve,b as Ce,e as Se}from"./tanstack-Hn82hibe.js";import{t as V}from"./notifications-B2HqRBj7.js";import{a2 as ke,A as Pe,R as f,aI as Ve,aJ as Ae,aK as Te,X as De,S as Ie,aL as Ue,aM as $e,U as Ee,p as qe,j as Le,a1 as Re,ao as Me,T as q,av as Fe}from"./icons-Dk2sL3Mr.js";async function Ke(){const s=await fetch("/api/cliproxy/sync/status");if(!s.ok){let n="Failed to fetch sync status";try{const t=await s.json();n=t.error||t.message||n}catch{}throw new Error(n)}return s.json()}async function Be(){const s=new AbortController,n=setTimeout(()=>s.abort(),3e4);try{const t=await fetch("/api/cliproxy/sync",{method:"POST",headers:{"Content-Type":"application/json"},signal:s.signal});if(!t.ok){let a="Sync failed";try{const r=await t.json();a=r.error||r.message||a}catch{}throw new Error(a)}return t.json()}catch(t){throw t instanceof Error&&t.name==="AbortError"?new Error("Sync request timed out after 30 seconds"):t}finally{clearTimeout(n)}}function Qe(){return L({queryKey:["cliproxy-sync-status"],queryFn:Ke,refetchInterval:3e4,retry:1,staleTime:1e4})}function ze(){const s=ve();return Ce({mutationFn:Be,onSuccess:n=>{s.invalidateQueries({queryKey:["cliproxy-sync-status"]}),s.invalidateQueries({queryKey:["cliproxy-sync-preview"]}),n.syncedCount===0?V.info("No profiles to sync"):V.success(`Synced ${n.syncedCount} profile${n.syncedCount===1?"":"s"} to CLIProxy`)},onError:n=>{V.error(`Sync failed: ${n.message}`)}})}function A(s,n){const t=s.replace(/-\d+$/,"").split(".").map(Number),a=n.replace(/-\d+$/,"").split(".").map(Number);for(let r=0;r<3;r++){if((t[r]||0)>(a[r]||0))return!0;if((t[r]||0)<(a[r]||0))return!1}return!1}function Oe(s){if(!s)return"";const n=new Date(s).getTime(),a=Date.now()-n,r=Math.floor(a/(1e3*60*60)),i=Math.floor(a%(1e3*60*60)/(1e3*60));return r>0?`${r}h ${i}m`:`${i}m`}function He(s){if(!s)return"";const n=Date.now()-s,t=Math.floor(n/(1e3*60)),a=Math.floor(n/(1e3*60*60));return t<1?"just now":t<60?`${t}m ago`:`${a}h ago`}function N({icon:s,tooltip:n,onClick:t,disabled:a,isPending:r,className:i,variant:l="ghost"}){return e.jsxs(xe,{children:[e.jsx(me,{asChild:!0,children:e.jsx(T,{variant:l==="destructive-ghost"?"ghost":l,size:"sm",className:d("h-7 w-7 p-0",l==="destructive-ghost"&&"hover:bg-destructive/10 hover:text-destructive hover:border-destructive/30",i),onClick:t,disabled:a,children:r?e.jsx(f,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(s,{className:"w-3.5 h-3.5"})})}),e.jsx(ue,{side:"bottom",className:"text-xs",children:n})]})}function es(){const{data:s,isLoading:n}=X(),{data:t}=Y(),{data:a,isLoading:r}=Z(),i=_(),l=ee(),w=se(),u=te(),{data:R}=Qe(),{mutate:M,isPending:v}=ze(),[h,D]=y.useState(!1),[g,F]=y.useState(""),[K,b]=y.useState(!1),[C,S]=y.useState(null),{data:B}=L({queryKey:["cliproxy-server-config"],queryFn:()=>he.cliproxyServer.get(),staleTime:3e4}),Q=Se({mutationKey:["update-backend"]})>0,x=B?.remote,I=x?.enabled&&x?.host,p=s?.running??!1,k=i.isPending||l.isPending||w.isPending||u.isPending||Q||v,z=t?.hasUpdate??!1,m=t?.isStable===!1,U=t?.currentVersion,j=R?.configured??!1,O=j?"Sync Ready":"No Config",P=m?t?.maxStableVersion||a?.latestStable:t?.latestVersion,$=o=>{if(!o)return;const c=a?.maxStableVersion||"6.6.80";if(A(o,c)){S(o),b(!0);return}u.mutate({version:o})},H=()=>{C&&u.mutate({version:C,force:!0}),b(!1),S(null)},W=()=>{b(!1),S(null)},G=I?(()=>{const o=x.protocol||"http",c=x.port||(o==="https"?443:80);return o==="https"&&c===443||o==="http"&&c===80?x.host:`${x.host}:${c}`})():null;return I?e.jsxs("div",{className:d("rounded-lg border p-3 transition-colors","border-blue-500/30 bg-blue-500/5"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ke,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium",children:"Remote Proxy"}),e.jsx(E,{variant:"secondary",className:"text-[10px] h-4 px-1.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:"Active"})]}),e.jsx(Pe,{className:"w-3 h-3 text-blue-600"})]}),e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("div",{className:"flex items-center gap-1 mb-1",children:e.jsx("span",{className:"font-mono",children:G})}),e.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:"Traffic auto-routed to remote server"})]})]}):e.jsx(ae,{delayDuration:300,children:e.jsxs("div",{className:d("rounded-lg border p-3 transition-colors",p?"border-green-500/30 bg-green-500/5":"border-muted bg-muted/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:d("w-2 h-2 rounded-full",p?"bg-green-500 animate-pulse":"bg-muted-foreground/30")}),e.jsx("span",{className:"text-sm font-medium",children:t?.backendLabel??"CLIProxy"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[n?e.jsx(f,{className:"w-3 h-3 animate-spin text-muted-foreground"}):p?e.jsxs(e.Fragment,{children:[e.jsx(N,{icon:v?f:Ve,tooltip:"Sync profiles to CLIProxy",onClick:()=>M(),disabled:!j||k,isPending:v}),e.jsx(N,{icon:Ae,tooltip:"Restart",onClick:()=>w.mutate(),disabled:k,isPending:w.isPending}),e.jsx(N,{icon:Te,tooltip:"Stop",onClick:()=>l.mutate(),disabled:k,isPending:l.isPending,variant:"destructive-ghost"})]}):null,e.jsx(N,{icon:h?De:Ie,tooltip:h?"Close":"Version settings",onClick:()=>D(!h),className:h?"bg-muted":void 0})]})]}),U&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[e.jsxs("span",{className:d("text-xs font-mono text-muted-foreground",m&&"text-amber-600 dark:text-amber-400"),children:["v",U]}),(z||m)&&P&&e.jsxs(E,{variant:"secondary",className:d("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",m?"bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400 dark:hover:bg-amber-900/50":"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50"),onClick:()=>$(P),title:`Click to ${m?"downgrade":"update"}`,children:[m?e.jsx(Ue,{className:"w-2.5 h-2.5"}):e.jsx($e,{className:"w-2.5 h-2.5"}),P]})]}),p&&s&&e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:["Port ",s.port]}),s.sessionCount!==void 0&&s.sessionCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ee,{className:"w-3 h-3"}),s.sessionCount," session",s.sessionCount!==1?"s":""]}),s.startedAt&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(qe,{className:"w-3 h-3"}),Oe(s.startedAt)]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[j?e.jsx(Le,{className:"w-3 h-3 text-green-600 dark:text-green-400"}):e.jsx(Re,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:d("text-xs",j?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:O})]}),e.jsx(ne,{open:h,onOpenChange:D,children:e.jsxs(re,{className:"mt-3 pt-3 border-t border-muted",children:[e.jsx("h4",{className:"text-xs font-medium text-muted-foreground mb-3",children:"Version Management"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(oe,{value:g,onValueChange:F,disabled:r,children:[e.jsx(ie,{className:"h-8 text-xs flex-1",children:e.jsx(le,{placeholder:"Select version to install..."})}),e.jsx(ce,{children:a?.versions.slice(0,20).map(o=>{const c=a?.maxStableVersion&&A(o,a.maxStableVersion);return e.jsx(de,{value:o,className:"text-xs",children:e.jsxs("span",{className:"flex items-center gap-2",children:["v",o,o===a.latestStable&&e.jsx("span",{className:"text-green-600 dark:text-green-400",children:"(stable)"}),c&&e.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"⚠"})]})},o)})})]}),e.jsxs(T,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>$(g),disabled:u.isPending||!g,children:[u.isPending?e.jsx(f,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Me,{className:"w-3.5 h-3.5"}),"Install"]})]}),g&&a?.maxStableVersion&&A(g,a.maxStableVersion)&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[e.jsx(q,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsxs("span",{children:["Versions above ",a.maxStableVersion," have known issues"]})]}),t?.checkedAt&&e.jsxs("div",{className:"mt-2 text-[10px] text-muted-foreground/60",children:["Last checked ",He(t.checkedAt)]})]})}),!p&&e.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not running"}),e.jsxs(T,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>i.mutate(),disabled:i.isPending,children:[i.isPending?e.jsx(f,{className:"w-3 h-3 animate-spin"}):e.jsx(Fe,{className:"w-3 h-3"}),"Start"]})]}),e.jsx(ge,{open:K,onOpenChange:b,children:e.jsxs(pe,{children:[e.jsxs(fe,{children:[e.jsxs(be,{className:"flex items-center gap-2",children:[e.jsx(q,{className:"w-5 h-5 text-amber-500"}),"Install Unstable Version?"]}),e.jsxs(je,{className:"space-y-2",children:[e.jsxs("p",{children:["You are about to install ",e.jsxs("strong",{children:["v",C]}),", which is above the maximum stable version"," ",e.jsxs("strong",{children:["v",a?.maxStableVersion||"6.6.80"]}),"."]}),e.jsx("p",{className:"text-amber-600 dark:text-amber-400",children:"This version has known stability issues and may cause unexpected behavior."}),e.jsx("p",{children:"Are you sure you want to proceed?"})]})]}),e.jsxs(ye,{children:[e.jsx(Ne,{onClick:W,children:"Cancel"}),e.jsx(we,{onClick:H,className:"bg-amber-500 hover:bg-amber-600 text-white",children:"Install Anyway"})]})]})})]})})}export{es as P};
|
|
@@ -48,4 +48,4 @@ You can add a description to the \`${ze}\` by passing a \`${xi}\` component as a
|
|
|
48
48
|
|
|
49
49
|
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ze}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
50
50
|
|
|
51
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return i.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},qh=pi,Zh=hi,Jh=mi,Qh=vi,em=bi,tm=Si,nm=wi,om=yi,ln="Tabs",[Ap]=J(ln,[nn]),Ei=nn(),[Tp,Co]=Ap(ln),Ri=i.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:s,orientation:a="horizontal",dir:c,activationMode:l="automatic",...u}=e,d=vt(c),[f,h]=ue({prop:o,onChange:r,defaultProp:s??"",caller:ln});return p.jsx(Tp,{scope:n,baseId:ne(),value:f,onValueChange:h,orientation:a,dir:d,activationMode:l,children:p.jsx(O.div,{dir:d,"data-orientation":a,...u,ref:t})})});Ri.displayName=ln;var Pi="TabsList",Ai=i.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,s=Co(Pi,n),a=Ei(n);return p.jsx(ys,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:o,children:p.jsx(O.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:t})})});Ai.displayName=Pi;var Ti="TabsTrigger",_i=i.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...s}=e,a=Co(Ti,n),c=Ei(n),l=Mi(a.baseId,o),u=Ni(a.baseId,o),d=o===a.value;return p.jsx(bs,{asChild:!0,...c,focusable:!r,active:d,children:p.jsx(O.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...s,ref:t,onMouseDown:R(e.onMouseDown,f=>{!r&&f.button===0&&f.ctrlKey===!1?a.onValueChange(o):f.preventDefault()}),onKeyDown:R(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&a.onValueChange(o)}),onFocus:R(e.onFocus,()=>{const f=a.activationMode!=="manual";!d&&!r&&f&&a.onValueChange(o)})})})});_i.displayName=Ti;var Ii="TabsContent",Oi=i.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:s,...a}=e,c=Co(Ii,n),l=Mi(c.baseId,o),u=Ni(c.baseId,o),d=o===c.value,f=i.useRef(d);return i.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),p.jsx(z,{present:r||d,children:({present:h})=>p.jsx(O.div,{"data-state":d?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:u,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&s})})});Oi.displayName=Ii;function Mi(e,t){return`${e}-trigger-${t}`}function Ni(e,t){return`${e}-content-${t}`}var rm=Ri,sm=Ai,im=_i,am=Oi,_p=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ip=_p.reduce((e,t)=>{const n=Kn(`Primitive.${t}`),o=i.forwardRef((r,s)=>{const{asChild:a,...c}=r,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Op="Label",Di=i.forwardRef((e,t)=>p.jsx(Ip.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Di.displayName=Op;var cm=Di;function Mp(e){const t=Np(e),n=i.forwardRef((o,r)=>{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(jp);if(l){const u=l.props.children,d=c.map(f=>f===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:f);return p.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,d):null})}return p.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function Np(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=kp(r),c=Lp(s,r.props);return r.type!==i.Fragment&&(c.ref=o?we(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Dp=Symbol("radix.slottable");function jp(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Dp}function Lp(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function kp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function So(e){const t=i.useRef({value:e,previous:e});return i.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var $p=[" ","Enter","ArrowUp","ArrowDown"],Fp=[" ","Enter"],$e="Select",[un,dn,Wp]=uo($e),[nt]=J($e,[Wp,Ie]),fn=Ie(),[Bp,Oe]=nt($e),[Vp,Hp]=nt($e),ji=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:s,value:a,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:h,required:v,form:w}=e,m=fn(t),[g,x]=i.useState(null),[y,b]=i.useState(null),[C,S]=i.useState(!1),A=vt(u),[E,_]=ue({prop:o,defaultProp:r??!1,onChange:s,caller:$e}),[I,M]=ue({prop:a,defaultProp:c,onChange:l,caller:$e}),L=i.useRef(null),$=g?w||!!g.closest("form"):!0,[F,k]=i.useState(new Set),B=Array.from(F).map(D=>D.props.value).join(";");return p.jsx(qt,{...m,children:p.jsxs(Bp,{required:v,scope:t,trigger:g,onTriggerChange:x,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:C,onValueNodeHasChildrenChange:S,contentId:ne(),value:I,onValueChange:M,open:E,onOpenChange:_,dir:A,triggerPointerDownPosRef:L,disabled:h,children:[p.jsx(un.Provider,{scope:t,children:p.jsx(Vp,{scope:e.__scopeSelect,onNativeOptionAdd:i.useCallback(D=>{k(W=>new Set(W).add(D))},[]),onNativeOptionRemove:i.useCallback(D=>{k(W=>{const N=new Set(W);return N.delete(D),N})},[]),children:n})}),$?p.jsxs(ia,{"aria-hidden":!0,required:v,tabIndex:-1,name:d,autoComplete:f,value:I,onChange:D=>M(D.target.value),disabled:h,form:w,children:[I===void 0?p.jsx("option",{value:""}):null,Array.from(F)]},B):null]})})};ji.displayName=$e;var Li="SelectTrigger",ki=i.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,s=fn(n),a=Oe(Li,n),c=a.disabled||o,l=j(t,a.onTriggerChange),u=dn(n),d=i.useRef("touch"),[f,h,v]=ca(m=>{const g=u().filter(b=>!b.disabled),x=g.find(b=>b.value===a.value),y=la(g,m,x);y!==void 0&&a.onValueChange(y.value)}),w=m=>{c||(a.onOpenChange(!0),v()),m&&(a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return p.jsx(ht,{asChild:!0,...s,children:p.jsx(O.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":aa(a.value)?"":void 0,...r,ref:l,onClick:R(r.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&w(m)}),onPointerDown:R(r.onPointerDown,m=>{d.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:R(r.onKeyDown,m=>{const g=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(g&&m.key===" ")&&$p.includes(m.key)&&(w(),m.preventDefault())})})})});ki.displayName=Li;var $i="SelectValue",Fi=i.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:s,placeholder:a="",...c}=e,l=Oe($i,n),{onValueNodeHasChildrenChange:u}=l,d=s!==void 0,f=j(t,l.onValueNodeChange);return Y(()=>{u(d)},[u,d]),p.jsx(O.span,{...c,ref:f,style:{pointerEvents:"none"},children:aa(l.value)?p.jsx(p.Fragment,{children:a}):s})});Fi.displayName=$i;var Up="SelectIcon",Wi=i.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return p.jsx(O.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});Wi.displayName=Up;var Gp="SelectPortal",Bi=e=>p.jsx(Qe,{asChild:!0,...e});Bi.displayName=Gp;var Fe="SelectContent",Vi=i.forwardRef((e,t)=>{const n=Oe(Fe,e.__scopeSelect),[o,r]=i.useState();if(Y(()=>{r(new DocumentFragment)},[]),!n.open){const s=o;return s?Bt.createPortal(p.jsx(Hi,{scope:e.__scopeSelect,children:p.jsx(un.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),s):null}return p.jsx(Ui,{...e,ref:t})});Vi.displayName=Fe;var le=10,[Hi,Me]=nt(Fe),Kp="SelectContentImpl",zp=Mp("SelectContent.RemoveScroll"),Ui=i.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:a,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:v,sticky:w,hideWhenDetached:m,avoidCollisions:g,...x}=e,y=Oe(Fe,n),[b,C]=i.useState(null),[S,A]=i.useState(null),E=j(t,T=>C(T)),[_,I]=i.useState(null),[M,L]=i.useState(null),$=dn(n),[F,k]=i.useState(!1),B=i.useRef(!1);i.useEffect(()=>{if(b)return Ut(b)},[b]),Vt();const D=i.useCallback(T=>{const[V,...Z]=$().map(K=>K.ref.current),[H]=Z.slice(-1),U=document.activeElement;for(const K of T)if(K===U||(K?.scrollIntoView({block:"nearest"}),K===V&&S&&(S.scrollTop=0),K===H&&S&&(S.scrollTop=S.scrollHeight),K?.focus(),document.activeElement!==U))return},[$,S]),W=i.useCallback(()=>D([_,b]),[D,_,b]);i.useEffect(()=>{F&&W()},[F,W]);const{onOpenChange:N,triggerPointerDownPosRef:P}=y;i.useEffect(()=>{if(b){let T={x:0,y:0};const V=H=>{T={x:Math.abs(Math.round(H.pageX)-(P.current?.x??0)),y:Math.abs(Math.round(H.pageY)-(P.current?.y??0))}},Z=H=>{T.x<=10&&T.y<=10?H.preventDefault():b.contains(H.target)||N(!1),document.removeEventListener("pointermove",V),P.current=null};return P.current!==null&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",Z,{capture:!0})}}},[b,N,P]),i.useEffect(()=>{const T=()=>N(!1);return window.addEventListener("blur",T),window.addEventListener("resize",T),()=>{window.removeEventListener("blur",T),window.removeEventListener("resize",T)}},[N]);const[G,q]=ca(T=>{const V=$().filter(U=>!U.disabled),Z=V.find(U=>U.ref.current===document.activeElement),H=la(V,T,Z);H&&setTimeout(()=>H.ref.current.focus())}),ce=i.useCallback((T,V,Z)=>{const H=!B.current&&!Z;(y.value!==void 0&&y.value===V||H)&&(I(T),H&&(B.current=!0))},[y.value]),be=i.useCallback(()=>b?.focus(),[b]),re=i.useCallback((T,V,Z)=>{const H=!B.current&&!Z;(y.value!==void 0&&y.value===V||H)&&L(T)},[y.value]),Ce=o==="popper"?Wn:Gi,ee=Ce===Wn?{side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:v,sticky:w,hideWhenDetached:m,avoidCollisions:g}:{};return p.jsx(Hi,{scope:n,content:b,viewport:S,onViewportChange:A,itemRefCallback:ce,selectedItem:_,onItemLeave:be,itemTextRefCallback:re,focusSelectedItem:W,selectedItemText:M,position:o,isPositioned:F,searchRef:G,children:p.jsx(ft,{as:zp,allowPinchZoom:!0,children:p.jsx(dt,{asChild:!0,trapped:y.open,onMountAutoFocus:T=>{T.preventDefault()},onUnmountAutoFocus:R(r,T=>{y.trigger?.focus({preventScroll:!0}),T.preventDefault()}),children:p.jsx(Je,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:T=>T.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:p.jsx(Ce,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:T=>T.preventDefault(),...x,...ee,onPlaced:()=>k(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:R(x.onKeyDown,T=>{const V=T.ctrlKey||T.altKey||T.metaKey;if(T.key==="Tab"&&T.preventDefault(),!V&&T.key.length===1&&q(T.key),["ArrowUp","ArrowDown","Home","End"].includes(T.key)){let H=$().filter(U=>!U.disabled).map(U=>U.ref.current);if(["ArrowUp","End"].includes(T.key)&&(H=H.slice().reverse()),["ArrowUp","ArrowDown"].includes(T.key)){const U=T.target,K=H.indexOf(U);H=H.slice(K+1)}setTimeout(()=>D(H)),T.preventDefault()}})})})})})})});Ui.displayName=Kp;var Yp="SelectItemAlignedPosition",Gi=i.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,s=Oe(Fe,n),a=Me(Fe,n),[c,l]=i.useState(null),[u,d]=i.useState(null),f=j(t,E=>d(E)),h=dn(n),v=i.useRef(!1),w=i.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:x,focusSelectedItem:y}=a,b=i.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&m&&g&&x){const E=s.trigger.getBoundingClientRect(),_=u.getBoundingClientRect(),I=s.valueNode.getBoundingClientRect(),M=x.getBoundingClientRect();if(s.dir!=="rtl"){const U=M.left-_.left,K=I.left-U,se=E.left-K,De=E.width+se,vn=Math.max(De,_.width),gn=window.innerWidth-le,wn=Fn(K,[le,Math.max(le,gn-vn)]);c.style.minWidth=De+"px",c.style.left=wn+"px"}else{const U=_.right-M.right,K=window.innerWidth-I.right-U,se=window.innerWidth-E.right-K,De=E.width+se,vn=Math.max(De,_.width),gn=window.innerWidth-le,wn=Fn(K,[le,Math.max(le,gn-vn)]);c.style.minWidth=De+"px",c.style.right=wn+"px"}const L=h(),$=window.innerHeight-le*2,F=m.scrollHeight,k=window.getComputedStyle(u),B=parseInt(k.borderTopWidth,10),D=parseInt(k.paddingTop,10),W=parseInt(k.borderBottomWidth,10),N=parseInt(k.paddingBottom,10),P=B+D+F+N+W,G=Math.min(g.offsetHeight*5,P),q=window.getComputedStyle(m),ce=parseInt(q.paddingTop,10),be=parseInt(q.paddingBottom,10),re=E.top+E.height/2-le,Ce=$-re,ee=g.offsetHeight/2,T=g.offsetTop+ee,V=B+D+T,Z=P-V;if(V<=re){const U=L.length>0&&g===L[L.length-1].ref.current;c.style.bottom="0px";const K=u.clientHeight-m.offsetTop-m.offsetHeight,se=Math.max(Ce,ee+(U?be:0)+K+W),De=V+se;c.style.height=De+"px"}else{const U=L.length>0&&g===L[0].ref.current;c.style.top="0px";const se=Math.max(re,B+m.offsetTop+(U?ce:0)+ee)+Z;c.style.height=se+"px",m.scrollTop=V-re+m.offsetTop}c.style.margin=`${le}px 0`,c.style.minHeight=G+"px",c.style.maxHeight=$+"px",o?.(),requestAnimationFrame(()=>v.current=!0)}},[h,s.trigger,s.valueNode,c,u,m,g,x,s.dir,o]);Y(()=>b(),[b]);const[C,S]=i.useState();Y(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const A=i.useCallback(E=>{E&&w.current===!0&&(b(),y?.(),w.current=!1)},[b,y]);return p.jsx(qp,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:v,onScrollButtonChange:A,children:p.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:p.jsx(O.div,{...r,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Gi.displayName=Yp;var Xp="SelectPopperPosition",Wn=i.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=le,...s}=e,a=fn(n);return p.jsx(Zt,{...a,...s,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...s.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)"}})});Wn.displayName=Xp;var[qp,Eo]=nt(Fe,{}),Bn="SelectViewport",Ki=i.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,s=Me(Bn,n),a=Eo(Bn,n),c=j(t,s.onViewportChange),l=i.useRef(0);return p.jsxs(p.Fragment,{children:[p.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}),p.jsx(un.Slot,{scope:n,children:p.jsx(O.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:R(r.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=a;if(h?.current&&f){const v=Math.abs(l.current-d.scrollTop);if(v>0){const w=window.innerHeight-le*2,m=parseFloat(f.style.minHeight),g=parseFloat(f.style.height),x=Math.max(m,g);if(x<w){const y=x+v,b=Math.min(w,y),C=y-b;f.style.height=b+"px",f.style.bottom==="0px"&&(d.scrollTop=C>0?C:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});Ki.displayName=Bn;var zi="SelectGroup",[Zp,Jp]=nt(zi),Yi=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=ne();return p.jsx(Zp,{scope:n,id:r,children:p.jsx(O.div,{role:"group","aria-labelledby":r,...o,ref:t})})});Yi.displayName=zi;var Xi="SelectLabel",qi=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Jp(Xi,n);return p.jsx(O.div,{id:r.id,...o,ref:t})});qi.displayName=Xi;var Wt="SelectItem",[Qp,Zi]=nt(Wt),Ji=i.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:s,...a}=e,c=Oe(Wt,n),l=Me(Wt,n),u=c.value===o,[d,f]=i.useState(s??""),[h,v]=i.useState(!1),w=j(t,y=>l.itemRefCallback?.(y,o,r)),m=ne(),g=i.useRef("touch"),x=()=>{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 p.jsx(Qp,{scope:n,value:o,disabled:r,textId:m,isSelected:u,onItemTextChange:i.useCallback(y=>{f(b=>b||(y?.textContent??"").trim())},[]),children:p.jsx(un.ItemSlot,{scope:n,value:o,disabled:r,textValue:d,children:p.jsx(O.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...a,ref:w,onFocus:R(a.onFocus,()=>v(!0)),onBlur:R(a.onBlur,()=>v(!1)),onClick:R(a.onClick,()=>{g.current!=="mouse"&&x()}),onPointerUp:R(a.onPointerUp,()=>{g.current==="mouse"&&x()}),onPointerDown:R(a.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:R(a.onPointerMove,y=>{g.current=y.pointerType,r?l.onItemLeave?.():g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:R(a.onPointerLeave,y=>{y.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:R(a.onKeyDown,y=>{l.searchRef?.current!==""&&y.key===" "||(Fp.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});Ji.displayName=Wt;var st="SelectItemText",Qi=i.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...s}=e,a=Oe(st,n),c=Me(st,n),l=Zi(st,n),u=Hp(st,n),[d,f]=i.useState(null),h=j(t,x=>f(x),l.onItemTextChange,x=>c.itemTextRefCallback?.(x,l.value,l.disabled)),v=d?.textContent,w=i.useMemo(()=>p.jsx("option",{value:l.value,disabled:l.disabled,children:v},l.value),[l.disabled,l.value,v]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=u;return Y(()=>(m(w),()=>g(w)),[m,g,w]),p.jsxs(p.Fragment,{children:[p.jsx(O.span,{id:l.textId,...s,ref:h}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Bt.createPortal(s.children,a.valueNode):null]})});Qi.displayName=st;var ea="SelectItemIndicator",ta=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Zi(ea,n).isSelected?p.jsx(O.span,{"aria-hidden":!0,...o,ref:t}):null});ta.displayName=ea;var Vn="SelectScrollUpButton",na=i.forwardRef((e,t)=>{const n=Me(Vn,e.__scopeSelect),o=Eo(Vn,e.__scopeSelect),[r,s]=i.useState(!1),a=j(t,o.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?p.jsx(ra,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});na.displayName=Vn;var Hn="SelectScrollDownButton",oa=i.forwardRef((e,t)=>{const n=Me(Hn,e.__scopeSelect),o=Eo(Hn,e.__scopeSelect),[r,s]=i.useState(!1),a=j(t,o.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<u;s(d)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?p.jsx(ra,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});oa.displayName=Hn;var ra=i.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,s=Me("SelectScrollButton",n),a=i.useRef(null),c=dn(n),l=i.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return i.useEffect(()=>()=>l(),[l]),Y(()=>{c().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),p.jsx(O.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:R(r.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(o,50))}),onPointerMove:R(r.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(o,50))}),onPointerLeave:R(r.onPointerLeave,()=>{l()})})}),eh="SelectSeparator",sa=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return p.jsx(O.div,{"aria-hidden":!0,...o,ref:t})});sa.displayName=eh;var Un="SelectArrow",th=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=fn(n),s=Oe(Un,n),a=Me(Un,n);return s.open&&a.position==="popper"?p.jsx(Jt,{...r,...o,ref:t}):null});th.displayName=Un;var nh="SelectBubbleInput",ia=i.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=i.useRef(null),s=j(o,r),a=So(t);return i.useEffect(()=>{const c=r.current;if(!c)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&d){const f=new Event("change",{bubbles:!0});d.call(c,t),c.dispatchEvent(f)}},[a,t]),p.jsx(O.select,{...n,style:{...ns,...n.style},ref:s,defaultValue:t})});ia.displayName=nh;function aa(e){return e===""||e===void 0}function ca(e){const t=X(e),n=i.useRef(""),o=i.useRef(0),r=i.useCallback(a=>{const c=n.current+a;t(c),(function l(u){n.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>l(""),1e3))})(c)},[t]),s=i.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,s]}function la(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=oh(e,Math.max(s,0));r.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function oh(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var lm=ji,um=ki,dm=Fi,fm=Wi,pm=Bi,hm=Vi,mm=Ki,vm=Yi,gm=qi,wm=Ji,xm=Qi,ym=ta,bm=na,Cm=oa,Sm=sa,pn="Checkbox",[rh]=J(pn),[sh,Ro]=rh(pn);function ih(e){const{__scopeCheckbox:t,checked:n,children:o,defaultChecked:r,disabled:s,form:a,name:c,onCheckedChange:l,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,v]=ue({prop:n,defaultProp:r??!1,onChange:l,caller:pn}),[w,m]=i.useState(null),[g,x]=i.useState(null),y=i.useRef(!1),b=w?!!a||!!w.closest("form"):!0,C={checked:h,disabled:s,setChecked:v,control:w,setControl:m,name:c,form:a,value:d,hasConsumerStoppedPropagationRef:y,required:u,defaultChecked:Ae(r)?!1:r,isFormControl:b,bubbleInput:g,setBubbleInput:x};return p.jsx(sh,{scope:t,...C,children:lh(f)?f(C):o})}var ua="CheckboxTrigger",da=i.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...o},r)=>{const{control:s,value:a,disabled:c,checked:l,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:v,bubbleInput:w}=Ro(ua,e),m=j(r,d),g=i.useRef(l);return i.useEffect(()=>{const x=s?.form;if(x){const y=()=>f(g.current);return x.addEventListener("reset",y),()=>x.removeEventListener("reset",y)}},[s,f]),p.jsx(O.button,{type:"button",role:"checkbox","aria-checked":Ae(l)?"mixed":l,"aria-required":u,"data-state":ma(l),"data-disabled":c?"":void 0,disabled:c,value:a,...o,ref:m,onKeyDown:R(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:R(n,x=>{f(y=>Ae(y)?!0:!y),w&&v&&(h.current=x.isPropagationStopped(),h.current||x.stopPropagation())})})});da.displayName=ua;var ah=i.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:o,checked:r,defaultChecked:s,required:a,disabled:c,value:l,onCheckedChange:u,form:d,...f}=e;return p.jsx(ih,{__scopeCheckbox:n,checked:r,defaultChecked:s,disabled:c,required:a,onCheckedChange:u,name:o,form:d,value:l,internal_do_not_use_render:({isFormControl:h})=>p.jsxs(p.Fragment,{children:[p.jsx(da,{...f,ref:t,__scopeCheckbox:n}),h&&p.jsx(ha,{__scopeCheckbox:n})]})})});ah.displayName=pn;var fa="CheckboxIndicator",ch=i.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...r}=e,s=Ro(fa,n);return p.jsx(z,{present:o||Ae(s.checked)||s.checked===!0,children:p.jsx(O.span,{"data-state":ma(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});ch.displayName=fa;var pa="CheckboxBubbleInput",ha=i.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:o,hasConsumerStoppedPropagationRef:r,checked:s,defaultChecked:a,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:v}=Ro(pa,e),w=j(n,v),m=So(s),g=no(o);i.useEffect(()=>{const y=h;if(!y)return;const b=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(b,"checked").set,A=!r.current;if(m!==s&&S){const E=new Event("click",{bubbles:A});y.indeterminate=Ae(s),S.call(y,Ae(s)?!1:s),y.dispatchEvent(E)}},[h,m,s,r]);const x=i.useRef(Ae(s)?!1:s);return p.jsx(O.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??x.current,required:c,disabled:l,name:u,value:d,form:f,...t,tabIndex:-1,ref:w,style:{...t.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ha.displayName=pa;function lh(e){return typeof e=="function"}function Ae(e){return e==="indeterminate"}function ma(e){return Ae(e)?"indeterminate":e?"checked":"unchecked"}var hn="Switch",[uh]=J(hn),[dh,fh]=uh(hn),va=i.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:r,defaultChecked:s,required:a,disabled:c,value:l="on",onCheckedChange:u,form:d,...f}=e,[h,v]=i.useState(null),w=j(t,b=>v(b)),m=i.useRef(!1),g=h?d||!!h.closest("form"):!0,[x,y]=ue({prop:r,defaultProp:s??!1,onChange:u,caller:hn});return p.jsxs(dh,{scope:n,checked:x,disabled:c,children:[p.jsx(O.button,{type:"button",role:"switch","aria-checked":x,"aria-required":a,"data-state":ya(x),"data-disabled":c?"":void 0,disabled:c,value:l,...f,ref:w,onClick:R(e.onClick,b=>{y(C=>!C),g&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})}),g&&p.jsx(xa,{control:h,bubbles:!m.current,name:o,value:l,checked:x,required:a,disabled:c,form:d,style:{transform:"translateX(-100%)"}})]})});va.displayName=hn;var ga="SwitchThumb",wa=i.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,r=fh(ga,n);return p.jsx(O.span,{"data-state":ya(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:t})});wa.displayName=ga;var ph="SwitchBubbleInput",xa=i.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:o=!0,...r},s)=>{const a=i.useRef(null),c=j(a,s),l=So(n),u=no(t);return i.useEffect(()=>{const d=a.current;if(!d)return;const f=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==n&&v){const w=new Event("click",{bubbles:o});v.call(d,n),d.dispatchEvent(w)}},[l,n,o]),p.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}})});xa.displayName=ph;function ya(e){return e?"checked":"unchecked"}var Em=va,Rm=wa;function hh(e){const t=mh(e),n=i.forwardRef((o,r)=>{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(gh);if(l){const u=l.props.children,d=c.map(f=>f===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:f);return p.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,d):null})}return p.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function mh(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=xh(r),c=wh(s,r.props);return r.type!==i.Fragment&&(c.ref=o?we(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vh=Symbol("radix.slottable");function gh(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vh}function wh(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function xh(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mn="Popover",[ba]=J(mn,[Ie]),yt=Ie(),[yh,Ne]=ba(mn),Ca=e=>{const{__scopePopover:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:a=!1}=e,c=yt(t),l=i.useRef(null),[u,d]=i.useState(!1),[f,h]=ue({prop:o,defaultProp:r??!1,onChange:s,caller:mn});return p.jsx(qt,{...c,children:p.jsx(yh,{scope:t,contentId:ne(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:i.useCallback(()=>h(v=>!v),[h]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>d(!0),[]),onCustomAnchorRemove:i.useCallback(()=>d(!1),[]),modal:a,children:n})})};Ca.displayName=mn;var Sa="PopoverAnchor",Ea=i.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Ne(Sa,n),s=yt(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:c}=r;return i.useEffect(()=>(a(),()=>c()),[a,c]),p.jsx(ht,{...s,...o,ref:t})});Ea.displayName=Sa;var Ra="PopoverTrigger",Pa=i.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Ne(Ra,n),s=yt(n),a=j(t,r.triggerRef),c=p.jsx(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Oa(r.open),...o,ref:a,onClick:R(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?c:p.jsx(ht,{asChild:!0,...s,children:c})});Pa.displayName=Ra;var Po="PopoverPortal",[bh,Ch]=ba(Po,{forceMount:void 0}),Aa=e=>{const{__scopePopover:t,forceMount:n,children:o,container:r}=e,s=Ne(Po,t);return p.jsx(bh,{scope:t,forceMount:n,children:p.jsx(z,{present:n||s.open,children:p.jsx(Qe,{asChild:!0,container:r,children:o})})})};Aa.displayName=Po;var Ze="PopoverContent",Ta=i.forwardRef((e,t)=>{const n=Ch(Ze,e.__scopePopover),{forceMount:o=n.forceMount,...r}=e,s=Ne(Ze,e.__scopePopover);return p.jsx(z,{present:o||s.open,children:s.modal?p.jsx(Eh,{...r,ref:t}):p.jsx(Rh,{...r,ref:t})})});Ta.displayName=Ze;var Sh=hh("PopoverContent.RemoveScroll"),Eh=i.forwardRef((e,t)=>{const n=Ne(Ze,e.__scopePopover),o=i.useRef(null),r=j(t,o),s=i.useRef(!1);return i.useEffect(()=>{const a=o.current;if(a)return Ut(a)},[]),p.jsx(ft,{as:Sh,allowPinchZoom:!0,children:p.jsx(_a,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:R(e.onCloseAutoFocus,a=>{a.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:R(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:R(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),Rh=i.forwardRef((e,t)=>{const n=Ne(Ze,e.__scopePopover),o=i.useRef(!1),r=i.useRef(!1);return p.jsx(_a,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(o.current||n.triggerRef.current?.focus(),s.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),_a=i.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,h=Ne(Ze,n),v=yt(n);return Vt(),p.jsx(dt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:p.jsx(Je,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:p.jsx(Zt,{"data-state":Oa(h.open),role:"dialog",id:h.contentId,...v,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Ia="PopoverClose",Ph=i.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Ne(Ia,n);return p.jsx(O.button,{type:"button",...o,ref:t,onClick:R(e.onClick,()=>r.onOpenChange(!1))})});Ph.displayName=Ia;var Ah="PopoverArrow",Th=i.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=yt(n);return p.jsx(Jt,{...r,...o,ref:t})});Th.displayName=Ah;function Oa(e){return e?"open":"closed"}var Pm=Ca,Am=Ea,Tm=Pa,_m=Aa,Im=Ta;export{Oh as $,kh as A,pm as B,Ol as C,Nl as D,hm as E,mm as F,gm as G,wm as H,Uh as I,ym as J,xm as K,sm as L,Sm as M,lm as N,Il as O,_l as P,dm as Q,Al as R,Ih as S,Ml as T,vm as U,Kh as V,_m as W,Im as X,Pm as Y,Am as Z,Tm as _,Dr as a,ah as a0,ch as a1,Em as a2,Rm as a3,qh as a4,Qh as a5,nm as a6,om as a7,tm as a8,em as a9,Zh as aa,Jh as ab,Mh as b,Nh as c,Dh as d,jh as e,Lh as f,$h as g,yd as h,xd as i,p as j,Wh as k,Bh as l,Vh as m,Hh as n,Gh as o,Xh as p,zh as q,Yh as r,im as s,am as t,rm as u,cm as v,um as w,fm as x,bm as y,Cm as z};
|
|
51
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return i.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},qh=pi,Zh=hi,Jh=mi,Qh=vi,em=bi,tm=Si,nm=wi,om=yi;function Ap(e){const t=Tp(e),n=i.forwardRef((o,r)=>{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(Ip);if(l){const u=l.props.children,d=c.map(f=>f===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:f);return p.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,d):null})}return p.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function Tp(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=Mp(r),c=Op(s,r.props);return r.type!==i.Fragment&&(c.ref=o?we(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _p=Symbol("radix.slottable");function Ip(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_p}function Op(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function Mp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Co(e){const t=i.useRef({value:e,previous:e});return i.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Np=[" ","Enter","ArrowUp","ArrowDown"],Dp=[" ","Enter"],$e="Select",[ln,un,jp]=uo($e),[nt]=J($e,[jp,Ie]),dn=Ie(),[Lp,Oe]=nt($e),[kp,$p]=nt($e),Ei=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:s,value:a,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:h,required:v,form:w}=e,m=dn(t),[g,x]=i.useState(null),[y,b]=i.useState(null),[C,S]=i.useState(!1),A=vt(u),[E,_]=ue({prop:o,defaultProp:r??!1,onChange:s,caller:$e}),[I,M]=ue({prop:a,defaultProp:c,onChange:l,caller:$e}),L=i.useRef(null),$=g?w||!!g.closest("form"):!0,[F,k]=i.useState(new Set),B=Array.from(F).map(D=>D.props.value).join(";");return p.jsx(qt,{...m,children:p.jsxs(Lp,{required:v,scope:t,trigger:g,onTriggerChange:x,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:C,onValueNodeHasChildrenChange:S,contentId:ne(),value:I,onValueChange:M,open:E,onOpenChange:_,dir:A,triggerPointerDownPosRef:L,disabled:h,children:[p.jsx(ln.Provider,{scope:t,children:p.jsx(kp,{scope:e.__scopeSelect,onNativeOptionAdd:i.useCallback(D=>{k(W=>new Set(W).add(D))},[]),onNativeOptionRemove:i.useCallback(D=>{k(W=>{const N=new Set(W);return N.delete(D),N})},[]),children:n})}),$?p.jsxs(Xi,{"aria-hidden":!0,required:v,tabIndex:-1,name:d,autoComplete:f,value:I,onChange:D=>M(D.target.value),disabled:h,form:w,children:[I===void 0?p.jsx("option",{value:""}):null,Array.from(F)]},B):null]})})};Ei.displayName=$e;var Ri="SelectTrigger",Pi=i.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,s=dn(n),a=Oe(Ri,n),c=a.disabled||o,l=j(t,a.onTriggerChange),u=un(n),d=i.useRef("touch"),[f,h,v]=Zi(m=>{const g=u().filter(b=>!b.disabled),x=g.find(b=>b.value===a.value),y=Ji(g,m,x);y!==void 0&&a.onValueChange(y.value)}),w=m=>{c||(a.onOpenChange(!0),v()),m&&(a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return p.jsx(ht,{asChild:!0,...s,children:p.jsx(O.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":qi(a.value)?"":void 0,...r,ref:l,onClick:R(r.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&w(m)}),onPointerDown:R(r.onPointerDown,m=>{d.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:R(r.onKeyDown,m=>{const g=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(g&&m.key===" ")&&Np.includes(m.key)&&(w(),m.preventDefault())})})})});Pi.displayName=Ri;var Ai="SelectValue",Ti=i.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:s,placeholder:a="",...c}=e,l=Oe(Ai,n),{onValueNodeHasChildrenChange:u}=l,d=s!==void 0,f=j(t,l.onValueNodeChange);return Y(()=>{u(d)},[u,d]),p.jsx(O.span,{...c,ref:f,style:{pointerEvents:"none"},children:qi(l.value)?p.jsx(p.Fragment,{children:a}):s})});Ti.displayName=Ai;var Fp="SelectIcon",_i=i.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return p.jsx(O.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});_i.displayName=Fp;var Wp="SelectPortal",Ii=e=>p.jsx(Qe,{asChild:!0,...e});Ii.displayName=Wp;var Fe="SelectContent",Oi=i.forwardRef((e,t)=>{const n=Oe(Fe,e.__scopeSelect),[o,r]=i.useState();if(Y(()=>{r(new DocumentFragment)},[]),!n.open){const s=o;return s?Bt.createPortal(p.jsx(Mi,{scope:e.__scopeSelect,children:p.jsx(ln.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),s):null}return p.jsx(Ni,{...e,ref:t})});Oi.displayName=Fe;var le=10,[Mi,Me]=nt(Fe),Bp="SelectContentImpl",Vp=Ap("SelectContent.RemoveScroll"),Ni=i.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:a,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:v,sticky:w,hideWhenDetached:m,avoidCollisions:g,...x}=e,y=Oe(Fe,n),[b,C]=i.useState(null),[S,A]=i.useState(null),E=j(t,T=>C(T)),[_,I]=i.useState(null),[M,L]=i.useState(null),$=un(n),[F,k]=i.useState(!1),B=i.useRef(!1);i.useEffect(()=>{if(b)return Ut(b)},[b]),Vt();const D=i.useCallback(T=>{const[V,...Z]=$().map(K=>K.ref.current),[H]=Z.slice(-1),U=document.activeElement;for(const K of T)if(K===U||(K?.scrollIntoView({block:"nearest"}),K===V&&S&&(S.scrollTop=0),K===H&&S&&(S.scrollTop=S.scrollHeight),K?.focus(),document.activeElement!==U))return},[$,S]),W=i.useCallback(()=>D([_,b]),[D,_,b]);i.useEffect(()=>{F&&W()},[F,W]);const{onOpenChange:N,triggerPointerDownPosRef:P}=y;i.useEffect(()=>{if(b){let T={x:0,y:0};const V=H=>{T={x:Math.abs(Math.round(H.pageX)-(P.current?.x??0)),y:Math.abs(Math.round(H.pageY)-(P.current?.y??0))}},Z=H=>{T.x<=10&&T.y<=10?H.preventDefault():b.contains(H.target)||N(!1),document.removeEventListener("pointermove",V),P.current=null};return P.current!==null&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",Z,{capture:!0})}}},[b,N,P]),i.useEffect(()=>{const T=()=>N(!1);return window.addEventListener("blur",T),window.addEventListener("resize",T),()=>{window.removeEventListener("blur",T),window.removeEventListener("resize",T)}},[N]);const[G,q]=Zi(T=>{const V=$().filter(U=>!U.disabled),Z=V.find(U=>U.ref.current===document.activeElement),H=Ji(V,T,Z);H&&setTimeout(()=>H.ref.current.focus())}),ce=i.useCallback((T,V,Z)=>{const H=!B.current&&!Z;(y.value!==void 0&&y.value===V||H)&&(I(T),H&&(B.current=!0))},[y.value]),be=i.useCallback(()=>b?.focus(),[b]),re=i.useCallback((T,V,Z)=>{const H=!B.current&&!Z;(y.value!==void 0&&y.value===V||H)&&L(T)},[y.value]),Ce=o==="popper"?Wn:Di,ee=Ce===Wn?{side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:v,sticky:w,hideWhenDetached:m,avoidCollisions:g}:{};return p.jsx(Mi,{scope:n,content:b,viewport:S,onViewportChange:A,itemRefCallback:ce,selectedItem:_,onItemLeave:be,itemTextRefCallback:re,focusSelectedItem:W,selectedItemText:M,position:o,isPositioned:F,searchRef:G,children:p.jsx(ft,{as:Vp,allowPinchZoom:!0,children:p.jsx(dt,{asChild:!0,trapped:y.open,onMountAutoFocus:T=>{T.preventDefault()},onUnmountAutoFocus:R(r,T=>{y.trigger?.focus({preventScroll:!0}),T.preventDefault()}),children:p.jsx(Je,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:T=>T.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:p.jsx(Ce,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:T=>T.preventDefault(),...x,...ee,onPlaced:()=>k(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:R(x.onKeyDown,T=>{const V=T.ctrlKey||T.altKey||T.metaKey;if(T.key==="Tab"&&T.preventDefault(),!V&&T.key.length===1&&q(T.key),["ArrowUp","ArrowDown","Home","End"].includes(T.key)){let H=$().filter(U=>!U.disabled).map(U=>U.ref.current);if(["ArrowUp","End"].includes(T.key)&&(H=H.slice().reverse()),["ArrowUp","ArrowDown"].includes(T.key)){const U=T.target,K=H.indexOf(U);H=H.slice(K+1)}setTimeout(()=>D(H)),T.preventDefault()}})})})})})})});Ni.displayName=Bp;var Hp="SelectItemAlignedPosition",Di=i.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,s=Oe(Fe,n),a=Me(Fe,n),[c,l]=i.useState(null),[u,d]=i.useState(null),f=j(t,E=>d(E)),h=un(n),v=i.useRef(!1),w=i.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:x,focusSelectedItem:y}=a,b=i.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&m&&g&&x){const E=s.trigger.getBoundingClientRect(),_=u.getBoundingClientRect(),I=s.valueNode.getBoundingClientRect(),M=x.getBoundingClientRect();if(s.dir!=="rtl"){const U=M.left-_.left,K=I.left-U,se=E.left-K,De=E.width+se,vn=Math.max(De,_.width),gn=window.innerWidth-le,wn=Fn(K,[le,Math.max(le,gn-vn)]);c.style.minWidth=De+"px",c.style.left=wn+"px"}else{const U=_.right-M.right,K=window.innerWidth-I.right-U,se=window.innerWidth-E.right-K,De=E.width+se,vn=Math.max(De,_.width),gn=window.innerWidth-le,wn=Fn(K,[le,Math.max(le,gn-vn)]);c.style.minWidth=De+"px",c.style.right=wn+"px"}const L=h(),$=window.innerHeight-le*2,F=m.scrollHeight,k=window.getComputedStyle(u),B=parseInt(k.borderTopWidth,10),D=parseInt(k.paddingTop,10),W=parseInt(k.borderBottomWidth,10),N=parseInt(k.paddingBottom,10),P=B+D+F+N+W,G=Math.min(g.offsetHeight*5,P),q=window.getComputedStyle(m),ce=parseInt(q.paddingTop,10),be=parseInt(q.paddingBottom,10),re=E.top+E.height/2-le,Ce=$-re,ee=g.offsetHeight/2,T=g.offsetTop+ee,V=B+D+T,Z=P-V;if(V<=re){const U=L.length>0&&g===L[L.length-1].ref.current;c.style.bottom="0px";const K=u.clientHeight-m.offsetTop-m.offsetHeight,se=Math.max(Ce,ee+(U?be:0)+K+W),De=V+se;c.style.height=De+"px"}else{const U=L.length>0&&g===L[0].ref.current;c.style.top="0px";const se=Math.max(re,B+m.offsetTop+(U?ce:0)+ee)+Z;c.style.height=se+"px",m.scrollTop=V-re+m.offsetTop}c.style.margin=`${le}px 0`,c.style.minHeight=G+"px",c.style.maxHeight=$+"px",o?.(),requestAnimationFrame(()=>v.current=!0)}},[h,s.trigger,s.valueNode,c,u,m,g,x,s.dir,o]);Y(()=>b(),[b]);const[C,S]=i.useState();Y(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const A=i.useCallback(E=>{E&&w.current===!0&&(b(),y?.(),w.current=!1)},[b,y]);return p.jsx(Gp,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:v,onScrollButtonChange:A,children:p.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:p.jsx(O.div,{...r,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Di.displayName=Hp;var Up="SelectPopperPosition",Wn=i.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=le,...s}=e,a=dn(n);return p.jsx(Zt,{...a,...s,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...s.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)"}})});Wn.displayName=Up;var[Gp,So]=nt(Fe,{}),Bn="SelectViewport",ji=i.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,s=Me(Bn,n),a=So(Bn,n),c=j(t,s.onViewportChange),l=i.useRef(0);return p.jsxs(p.Fragment,{children:[p.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}),p.jsx(ln.Slot,{scope:n,children:p.jsx(O.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:R(r.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=a;if(h?.current&&f){const v=Math.abs(l.current-d.scrollTop);if(v>0){const w=window.innerHeight-le*2,m=parseFloat(f.style.minHeight),g=parseFloat(f.style.height),x=Math.max(m,g);if(x<w){const y=x+v,b=Math.min(w,y),C=y-b;f.style.height=b+"px",f.style.bottom==="0px"&&(d.scrollTop=C>0?C:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});ji.displayName=Bn;var Li="SelectGroup",[Kp,zp]=nt(Li),ki=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=ne();return p.jsx(Kp,{scope:n,id:r,children:p.jsx(O.div,{role:"group","aria-labelledby":r,...o,ref:t})})});ki.displayName=Li;var $i="SelectLabel",Fi=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=zp($i,n);return p.jsx(O.div,{id:r.id,...o,ref:t})});Fi.displayName=$i;var Wt="SelectItem",[Yp,Wi]=nt(Wt),Bi=i.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:s,...a}=e,c=Oe(Wt,n),l=Me(Wt,n),u=c.value===o,[d,f]=i.useState(s??""),[h,v]=i.useState(!1),w=j(t,y=>l.itemRefCallback?.(y,o,r)),m=ne(),g=i.useRef("touch"),x=()=>{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 p.jsx(Yp,{scope:n,value:o,disabled:r,textId:m,isSelected:u,onItemTextChange:i.useCallback(y=>{f(b=>b||(y?.textContent??"").trim())},[]),children:p.jsx(ln.ItemSlot,{scope:n,value:o,disabled:r,textValue:d,children:p.jsx(O.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...a,ref:w,onFocus:R(a.onFocus,()=>v(!0)),onBlur:R(a.onBlur,()=>v(!1)),onClick:R(a.onClick,()=>{g.current!=="mouse"&&x()}),onPointerUp:R(a.onPointerUp,()=>{g.current==="mouse"&&x()}),onPointerDown:R(a.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:R(a.onPointerMove,y=>{g.current=y.pointerType,r?l.onItemLeave?.():g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:R(a.onPointerLeave,y=>{y.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:R(a.onKeyDown,y=>{l.searchRef?.current!==""&&y.key===" "||(Dp.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});Bi.displayName=Wt;var st="SelectItemText",Vi=i.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...s}=e,a=Oe(st,n),c=Me(st,n),l=Wi(st,n),u=$p(st,n),[d,f]=i.useState(null),h=j(t,x=>f(x),l.onItemTextChange,x=>c.itemTextRefCallback?.(x,l.value,l.disabled)),v=d?.textContent,w=i.useMemo(()=>p.jsx("option",{value:l.value,disabled:l.disabled,children:v},l.value),[l.disabled,l.value,v]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=u;return Y(()=>(m(w),()=>g(w)),[m,g,w]),p.jsxs(p.Fragment,{children:[p.jsx(O.span,{id:l.textId,...s,ref:h}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Bt.createPortal(s.children,a.valueNode):null]})});Vi.displayName=st;var Hi="SelectItemIndicator",Ui=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Wi(Hi,n).isSelected?p.jsx(O.span,{"aria-hidden":!0,...o,ref:t}):null});Ui.displayName=Hi;var Vn="SelectScrollUpButton",Gi=i.forwardRef((e,t)=>{const n=Me(Vn,e.__scopeSelect),o=So(Vn,e.__scopeSelect),[r,s]=i.useState(!1),a=j(t,o.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?p.jsx(zi,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});Gi.displayName=Vn;var Hn="SelectScrollDownButton",Ki=i.forwardRef((e,t)=>{const n=Me(Hn,e.__scopeSelect),o=So(Hn,e.__scopeSelect),[r,s]=i.useState(!1),a=j(t,o.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<u;s(d)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?p.jsx(zi,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});Ki.displayName=Hn;var zi=i.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,s=Me("SelectScrollButton",n),a=i.useRef(null),c=un(n),l=i.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return i.useEffect(()=>()=>l(),[l]),Y(()=>{c().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),p.jsx(O.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:R(r.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(o,50))}),onPointerMove:R(r.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(o,50))}),onPointerLeave:R(r.onPointerLeave,()=>{l()})})}),Xp="SelectSeparator",Yi=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return p.jsx(O.div,{"aria-hidden":!0,...o,ref:t})});Yi.displayName=Xp;var Un="SelectArrow",qp=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=dn(n),s=Oe(Un,n),a=Me(Un,n);return s.open&&a.position==="popper"?p.jsx(Jt,{...r,...o,ref:t}):null});qp.displayName=Un;var Zp="SelectBubbleInput",Xi=i.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=i.useRef(null),s=j(o,r),a=Co(t);return i.useEffect(()=>{const c=r.current;if(!c)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&d){const f=new Event("change",{bubbles:!0});d.call(c,t),c.dispatchEvent(f)}},[a,t]),p.jsx(O.select,{...n,style:{...ns,...n.style},ref:s,defaultValue:t})});Xi.displayName=Zp;function qi(e){return e===""||e===void 0}function Zi(e){const t=X(e),n=i.useRef(""),o=i.useRef(0),r=i.useCallback(a=>{const c=n.current+a;t(c),(function l(u){n.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>l(""),1e3))})(c)},[t]),s=i.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,s]}function Ji(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Jp(e,Math.max(s,0));r.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function Jp(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var rm=Ei,sm=Pi,im=Ti,am=_i,cm=Ii,lm=Oi,um=ji,dm=ki,fm=Fi,pm=Bi,hm=Vi,mm=Ui,vm=Gi,gm=Ki,wm=Yi,fn="Tabs",[Qp]=J(fn,[nn]),Qi=nn(),[eh,Eo]=Qp(fn),ea=i.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:s,orientation:a="horizontal",dir:c,activationMode:l="automatic",...u}=e,d=vt(c),[f,h]=ue({prop:o,onChange:r,defaultProp:s??"",caller:fn});return p.jsx(eh,{scope:n,baseId:ne(),value:f,onValueChange:h,orientation:a,dir:d,activationMode:l,children:p.jsx(O.div,{dir:d,"data-orientation":a,...u,ref:t})})});ea.displayName=fn;var ta="TabsList",na=i.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,s=Eo(ta,n),a=Qi(n);return p.jsx(ys,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:o,children:p.jsx(O.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:t})})});na.displayName=ta;var oa="TabsTrigger",ra=i.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...s}=e,a=Eo(oa,n),c=Qi(n),l=aa(a.baseId,o),u=ca(a.baseId,o),d=o===a.value;return p.jsx(bs,{asChild:!0,...c,focusable:!r,active:d,children:p.jsx(O.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...s,ref:t,onMouseDown:R(e.onMouseDown,f=>{!r&&f.button===0&&f.ctrlKey===!1?a.onValueChange(o):f.preventDefault()}),onKeyDown:R(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&a.onValueChange(o)}),onFocus:R(e.onFocus,()=>{const f=a.activationMode!=="manual";!d&&!r&&f&&a.onValueChange(o)})})})});ra.displayName=oa;var sa="TabsContent",ia=i.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:s,...a}=e,c=Eo(sa,n),l=aa(c.baseId,o),u=ca(c.baseId,o),d=o===c.value,f=i.useRef(d);return i.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),p.jsx(z,{present:r||d,children:({present:h})=>p.jsx(O.div,{"data-state":d?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:u,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&s})})});ia.displayName=sa;function aa(e,t){return`${e}-trigger-${t}`}function ca(e,t){return`${e}-content-${t}`}var xm=ea,ym=na,bm=ra,Cm=ia,th=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nh=th.reduce((e,t)=>{const n=Kn(`Primitive.${t}`),o=i.forwardRef((r,s)=>{const{asChild:a,...c}=r,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),oh="Label",la=i.forwardRef((e,t)=>p.jsx(nh.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));la.displayName=oh;var Sm=la,pn="Checkbox",[rh]=J(pn),[sh,Ro]=rh(pn);function ih(e){const{__scopeCheckbox:t,checked:n,children:o,defaultChecked:r,disabled:s,form:a,name:c,onCheckedChange:l,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,v]=ue({prop:n,defaultProp:r??!1,onChange:l,caller:pn}),[w,m]=i.useState(null),[g,x]=i.useState(null),y=i.useRef(!1),b=w?!!a||!!w.closest("form"):!0,C={checked:h,disabled:s,setChecked:v,control:w,setControl:m,name:c,form:a,value:d,hasConsumerStoppedPropagationRef:y,required:u,defaultChecked:Ae(r)?!1:r,isFormControl:b,bubbleInput:g,setBubbleInput:x};return p.jsx(sh,{scope:t,...C,children:lh(f)?f(C):o})}var ua="CheckboxTrigger",da=i.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...o},r)=>{const{control:s,value:a,disabled:c,checked:l,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:v,bubbleInput:w}=Ro(ua,e),m=j(r,d),g=i.useRef(l);return i.useEffect(()=>{const x=s?.form;if(x){const y=()=>f(g.current);return x.addEventListener("reset",y),()=>x.removeEventListener("reset",y)}},[s,f]),p.jsx(O.button,{type:"button",role:"checkbox","aria-checked":Ae(l)?"mixed":l,"aria-required":u,"data-state":ma(l),"data-disabled":c?"":void 0,disabled:c,value:a,...o,ref:m,onKeyDown:R(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:R(n,x=>{f(y=>Ae(y)?!0:!y),w&&v&&(h.current=x.isPropagationStopped(),h.current||x.stopPropagation())})})});da.displayName=ua;var ah=i.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:o,checked:r,defaultChecked:s,required:a,disabled:c,value:l,onCheckedChange:u,form:d,...f}=e;return p.jsx(ih,{__scopeCheckbox:n,checked:r,defaultChecked:s,disabled:c,required:a,onCheckedChange:u,name:o,form:d,value:l,internal_do_not_use_render:({isFormControl:h})=>p.jsxs(p.Fragment,{children:[p.jsx(da,{...f,ref:t,__scopeCheckbox:n}),h&&p.jsx(ha,{__scopeCheckbox:n})]})})});ah.displayName=pn;var fa="CheckboxIndicator",ch=i.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...r}=e,s=Ro(fa,n);return p.jsx(z,{present:o||Ae(s.checked)||s.checked===!0,children:p.jsx(O.span,{"data-state":ma(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});ch.displayName=fa;var pa="CheckboxBubbleInput",ha=i.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:o,hasConsumerStoppedPropagationRef:r,checked:s,defaultChecked:a,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:v}=Ro(pa,e),w=j(n,v),m=Co(s),g=no(o);i.useEffect(()=>{const y=h;if(!y)return;const b=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(b,"checked").set,A=!r.current;if(m!==s&&S){const E=new Event("click",{bubbles:A});y.indeterminate=Ae(s),S.call(y,Ae(s)?!1:s),y.dispatchEvent(E)}},[h,m,s,r]);const x=i.useRef(Ae(s)?!1:s);return p.jsx(O.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??x.current,required:c,disabled:l,name:u,value:d,form:f,...t,tabIndex:-1,ref:w,style:{...t.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ha.displayName=pa;function lh(e){return typeof e=="function"}function Ae(e){return e==="indeterminate"}function ma(e){return Ae(e)?"indeterminate":e?"checked":"unchecked"}var hn="Switch",[uh]=J(hn),[dh,fh]=uh(hn),va=i.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:r,defaultChecked:s,required:a,disabled:c,value:l="on",onCheckedChange:u,form:d,...f}=e,[h,v]=i.useState(null),w=j(t,b=>v(b)),m=i.useRef(!1),g=h?d||!!h.closest("form"):!0,[x,y]=ue({prop:r,defaultProp:s??!1,onChange:u,caller:hn});return p.jsxs(dh,{scope:n,checked:x,disabled:c,children:[p.jsx(O.button,{type:"button",role:"switch","aria-checked":x,"aria-required":a,"data-state":ya(x),"data-disabled":c?"":void 0,disabled:c,value:l,...f,ref:w,onClick:R(e.onClick,b=>{y(C=>!C),g&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})}),g&&p.jsx(xa,{control:h,bubbles:!m.current,name:o,value:l,checked:x,required:a,disabled:c,form:d,style:{transform:"translateX(-100%)"}})]})});va.displayName=hn;var ga="SwitchThumb",wa=i.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,r=fh(ga,n);return p.jsx(O.span,{"data-state":ya(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:t})});wa.displayName=ga;var ph="SwitchBubbleInput",xa=i.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:o=!0,...r},s)=>{const a=i.useRef(null),c=j(a,s),l=Co(n),u=no(t);return i.useEffect(()=>{const d=a.current;if(!d)return;const f=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==n&&v){const w=new Event("click",{bubbles:o});v.call(d,n),d.dispatchEvent(w)}},[l,n,o]),p.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}})});xa.displayName=ph;function ya(e){return e?"checked":"unchecked"}var Em=va,Rm=wa;function hh(e){const t=mh(e),n=i.forwardRef((o,r)=>{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(gh);if(l){const u=l.props.children,d=c.map(f=>f===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:f);return p.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,d):null})}return p.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function mh(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=xh(r),c=wh(s,r.props);return r.type!==i.Fragment&&(c.ref=o?we(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vh=Symbol("radix.slottable");function gh(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vh}function wh(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function xh(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mn="Popover",[ba]=J(mn,[Ie]),yt=Ie(),[yh,Ne]=ba(mn),Ca=e=>{const{__scopePopover:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:a=!1}=e,c=yt(t),l=i.useRef(null),[u,d]=i.useState(!1),[f,h]=ue({prop:o,defaultProp:r??!1,onChange:s,caller:mn});return p.jsx(qt,{...c,children:p.jsx(yh,{scope:t,contentId:ne(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:i.useCallback(()=>h(v=>!v),[h]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>d(!0),[]),onCustomAnchorRemove:i.useCallback(()=>d(!1),[]),modal:a,children:n})})};Ca.displayName=mn;var Sa="PopoverAnchor",Ea=i.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Ne(Sa,n),s=yt(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:c}=r;return i.useEffect(()=>(a(),()=>c()),[a,c]),p.jsx(ht,{...s,...o,ref:t})});Ea.displayName=Sa;var Ra="PopoverTrigger",Pa=i.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Ne(Ra,n),s=yt(n),a=j(t,r.triggerRef),c=p.jsx(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Oa(r.open),...o,ref:a,onClick:R(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?c:p.jsx(ht,{asChild:!0,...s,children:c})});Pa.displayName=Ra;var Po="PopoverPortal",[bh,Ch]=ba(Po,{forceMount:void 0}),Aa=e=>{const{__scopePopover:t,forceMount:n,children:o,container:r}=e,s=Ne(Po,t);return p.jsx(bh,{scope:t,forceMount:n,children:p.jsx(z,{present:n||s.open,children:p.jsx(Qe,{asChild:!0,container:r,children:o})})})};Aa.displayName=Po;var Ze="PopoverContent",Ta=i.forwardRef((e,t)=>{const n=Ch(Ze,e.__scopePopover),{forceMount:o=n.forceMount,...r}=e,s=Ne(Ze,e.__scopePopover);return p.jsx(z,{present:o||s.open,children:s.modal?p.jsx(Eh,{...r,ref:t}):p.jsx(Rh,{...r,ref:t})})});Ta.displayName=Ze;var Sh=hh("PopoverContent.RemoveScroll"),Eh=i.forwardRef((e,t)=>{const n=Ne(Ze,e.__scopePopover),o=i.useRef(null),r=j(t,o),s=i.useRef(!1);return i.useEffect(()=>{const a=o.current;if(a)return Ut(a)},[]),p.jsx(ft,{as:Sh,allowPinchZoom:!0,children:p.jsx(_a,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:R(e.onCloseAutoFocus,a=>{a.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:R(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:R(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),Rh=i.forwardRef((e,t)=>{const n=Ne(Ze,e.__scopePopover),o=i.useRef(!1),r=i.useRef(!1);return p.jsx(_a,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(o.current||n.triggerRef.current?.focus(),s.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),_a=i.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,h=Ne(Ze,n),v=yt(n);return Vt(),p.jsx(dt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:p.jsx(Je,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:p.jsx(Zt,{"data-state":Oa(h.open),role:"dialog",id:h.contentId,...v,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Ia="PopoverClose",Ph=i.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Ne(Ia,n);return p.jsx(O.button,{type:"button",...o,ref:t,onClick:R(e.onClick,()=>r.onOpenChange(!1))})});Ph.displayName=Ia;var Ah="PopoverArrow",Th=i.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=yt(n);return p.jsx(Jt,{...r,...o,ref:t})});Th.displayName=Ah;function Oa(e){return e?"open":"closed"}var Pm=Ca,Am=Ea,Tm=Pa,_m=Aa,Im=Ta;export{Oh as $,kh as A,mm as B,Ol as C,Nl as D,hm as E,wm as F,rm as G,im as H,Uh as I,dm as J,ym as K,fm as L,bm as M,Cm as N,Il as O,_l as P,xm as Q,Al as R,Ih as S,Ml as T,Sm as U,Kh as V,_m as W,Im as X,Pm as Y,Am as Z,Tm as _,Dr as a,ah as a0,ch as a1,Em as a2,Rm as a3,qh as a4,Qh as a5,nm as a6,om as a7,tm as a8,em as a9,Zh as aa,Jh as ab,Mh as b,Nh as c,Dh as d,jh as e,Lh as f,$h as g,yd as h,xd as i,p as j,Wh as k,Bh as l,Vh as m,Hh as n,Gh as o,Xh as p,zh as q,Yh as r,sm as s,am as t,vm as u,gm as v,cm as w,lm as x,um as y,pm as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i,$ as n}from"./radix-ui-
|
|
1
|
+
import{j as i,$ as n}from"./radix-ui-DIWAxjEp.js";import"./react-vendor-CNOkPC89.js";import{c as e}from"./index-PWMOllOf.js";function m({className:t,orientation:a="horizontal",decorative:o=!0,...r}){return i.jsx(n,{"data-slot":"separator",decorative:o,orientation:a,className:e("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}export{m as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./radix-ui-
|
|
1
|
+
import{j as s}from"./radix-ui-DIWAxjEp.js";import{r as l}from"./react-vendor-CNOkPC89.js";import{aY as o,aZ as m,a_ as c,a$ as x,b0 as u,b as h,C as p,a as g}from"./index-PWMOllOf.js";import{N as j,a0 as f,aA as N,T as b}from"./icons-Dk2sL3Mr.js";import"./tanstack-Hn82hibe.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";function B(){const[t,i]=l.useState("commands"),{data:e}=o(),{data:n,isLoading:r}=m(t),d=[{id:"commands",label:"Commands",icon:j,count:e?.commands??0},{id:"skills",label:"Skills",icon:f,count:e?.skills??0},{id:"agents",label:"Agents",icon:N,count:e?.agents??0}];return s.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-8",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Shared Data"}),s.jsx("p",{className:"text-muted-foreground",children:"Commands, skills, and agents shared across Claude instances"})]}),e&&!e.symlinkStatus.valid&&s.jsxs(c,{variant:"warning",children:[s.jsx(b,{className:"h-4 w-4"}),s.jsx(x,{children:"Configuration Required"}),s.jsxs(u,{children:[e.symlinkStatus.message,". Run `ccs sync` to configure."]})]}),s.jsx("div",{className:"flex gap-2 border-b pb-2",children:d.map(a=>s.jsxs(h,{variant:t===a.id?"default":"ghost",size:"sm",onClick:()=>i(a.id),className:"flex items-center gap-2",children:[s.jsx(a.icon,{className:"w-4 h-4"}),a.label," (",a.count,")"]},a.id))}),s.jsx("div",{className:"mt-4",children:r?s.jsx("div",{className:"text-muted-foreground",children:"Loading..."}):n?.items.length===0?s.jsxs("div",{className:"text-muted-foreground",children:["No ",t," found"]}):s.jsx("div",{className:"grid gap-3",children:n?.items.map(a=>s.jsx(p,{children:s.jsxs(g,{children:[s.jsx("div",{className:"font-medium",children:a.name}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:a.description}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2 font-mono truncate",children:a.path})]})},a.name))})})]})}export{B as SharedPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a,a2 as s,a3 as n}from"./radix-ui-
|
|
1
|
+
import{j as a,a2 as s,a3 as n}from"./radix-ui-DIWAxjEp.js";import"./react-vendor-CNOkPC89.js";import{c as e}from"./index-PWMOllOf.js";function c({className:t,...r}){return a.jsx(s,{"data-slot":"switch",className:e("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:a.jsx(n,{"data-slot":"switch-thumb",className:e("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}export{c as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as w}from"./react-vendor-CNOkPC89.js";import{j as ut}from"./radix-ui-DKgfU5rd.js";var j=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},lt={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},at=class{#e=lt;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},z=new at;function ct(e){setTimeout(e,0)}var q=typeof window>"u"||"Deno"in globalThis;function x(){}function dt(e,t){return typeof e=="function"?e(t):e}function ae(e){return typeof e=="number"&&e>=0&&e!==1/0}function Qe(e,t){return Math.max(e+(t||0)-Date.now(),0)}function L(e,t){return typeof e=="function"?e(t):e}function E(e,t){return typeof e=="function"?e(t):e}function xe(e,t){const{type:n="all",exact:i,fetchStatus:s,predicate:r,queryKey:o,stale:u}=e;if(o){if(i){if(t.queryHash!==ye(o,t.options))return!1}else if(!N(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||s&&s!==t.state.fetchStatus||r&&!r(t))}function $e(e,t){const{exact:n,status:i,predicate:s,mutationKey:r}=e;if(r){if(!t.options.mutationKey)return!1;if(n){if(Q(t.options.mutationKey)!==Q(r))return!1}else if(!N(t.options.mutationKey,r))return!1}return!(i&&t.state.status!==i||s&&!s(t))}function ye(e,t){return(t?.queryKeyHashFn||Q)(e)}function Q(e){return JSON.stringify(e,(t,n)=>ce(n)?Object.keys(n).sort().reduce((i,s)=>(i[s]=n[s],i),{}):n)}function N(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>N(e[n],t[n])):!1}var gt=Object.prototype.hasOwnProperty;function Re(e,t){if(e===t)return e;const n=Oe(e)&&Oe(t);if(!n&&!(ce(e)&&ce(t)))return t;const s=(n?e:Object.keys(e)).length,r=n?t:Object.keys(t),o=r.length,u=n?new Array(o):{};let l=0;for(let a=0;a<o;a++){const c=n?a:r[a],p=e[c],g=t[c];if(p===g){u[c]=p,(n?a<s:gt.call(e,c))&&l++;continue}if(p===null||g===null||typeof p!="object"||typeof g!="object"){u[c]=g;continue}const d=Re(p,g);u[c]=d,d===p&&l++}return s===o&&l===s?e:u}function Z(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Oe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ce(e){if(!Ee(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ee(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ee(e){return Object.prototype.toString.call(e)==="[object Object]"}function ft(e){return new Promise(t=>{z.setTimeout(t,e)})}function de(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Re(e,t):t}function ht(e,t,n=0){const i=[...e,t];return n&&i.length>n?i.slice(1):i}function pt(e,t,n=0){const i=[t,...e];return n&&i.length>n?i.slice(0,-1):i}var we=Symbol();function Ue(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===we?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function je(e,t){return typeof e=="function"?e(...t):!!e}var mt=class extends j{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!q&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Fe=new mt;function ge(){let e,t;const n=new Promise((s,r)=>{e=s,t=r});n.status="pending",n.catch(()=>{});function i(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{i({status:"fulfilled",value:s}),e(s)},n.reject=s=>{i({status:"rejected",reason:s}),t(s)},n}var vt=ct;function St(){let e=[],t=0,n=u=>{u()},i=u=>{u()},s=vt;const r=u=>{t?e.push(u):s(()=>{n(u)})},o=()=>{const u=e;e=[],u.length&&s(()=>{i(()=>{u.forEach(l=>{n(l)})})})};return{batch:u=>{let l;t++;try{l=u()}finally{t--,t||o()}return l},batchCalls:u=>(...l)=>{r(()=>{u(...l)})},schedule:r,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{i=u},setScheduler:u=>{s=u}}}var F=St(),Ct=class extends j{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!q&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Y=new Ct;function yt(e){return Math.min(1e3*2**e,3e4)}function ke(e){return(e??"online")==="online"?Y.isOnline():!0}var fe=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Be(e){let t=!1,n=0,i;const s=ge(),r=()=>s.status!=="pending",o=f=>{if(!r()){const C=new fe(f);g(C),e.onCancel?.(C)}},u=()=>{t=!0},l=()=>{t=!1},a=()=>Fe.isFocused()&&(e.networkMode==="always"||Y.isOnline())&&e.canRun(),c=()=>ke(e.networkMode)&&e.canRun(),p=f=>{r()||(i?.(),s.resolve(f))},g=f=>{r()||(i?.(),s.reject(f))},d=()=>new Promise(f=>{i=C=>{(r()||a())&&f(C)},e.onPause?.()}).then(()=>{i=void 0,r()||e.onContinue?.()}),h=()=>{if(r())return;let f;const C=n===0?e.initialPromise:void 0;try{f=C??e.fn()}catch(m){f=Promise.reject(m)}Promise.resolve(f).then(p).catch(m=>{if(r())return;const R=e.retry??(q?0:3),y=e.retryDelay??yt,_=typeof y=="function"?y(n,m):y,M=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,m);if(t||!M){g(m);return}n++,e.onFail?.(n,m),ft(_).then(()=>a()?void 0:d()).then(()=>{t?g(m):h()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(i?.(),s),cancelRetry:u,continueRetry:l,canStart:c,start:()=>(c()?h():d().then(h),s)}}var Ne=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ae(this.gcTime)&&(this.#e=z.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(q?1/0:300*1e3))}clearGcTimeout(){this.#e&&(z.clearTimeout(this.#e),this.#e=void 0)}},Rt=class extends Ne{#e;#t;#n;#s;#i;#o;#u;constructor(e){super(),this.#u=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=De(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=De(this.options);t.data!==void 0&&(this.setState(Ve(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=de(this.state.data,e,this.options);return this.#r({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#r({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(x).catch(x):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>E(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===we||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>L(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Qe(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#u?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#r({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const u=this.observers.find(l=>l.options.queryFn);u&&this.setOptions(u.options)}const n=new AbortController,i=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(this.#u=!0,n.signal)})},s=()=>{const u=Ue(this.options,t),a=(()=>{const c={client:this.#s,queryKey:this.queryKey,meta:this.meta};return i(c),c})();return this.#u=!1,this.options.persister?this.options.persister(u,a,this):u(a)},o=(()=>{const u={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return i(u),u})();this.options.behavior?.onFetch(o,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#r({type:"fetch",meta:o.fetchOptions?.meta}),this.#i=Be({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:u=>{u instanceof fe&&u.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(u,l)=>{this.#r({type:"failed",failureCount:u,error:l})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const u=await this.#i.start();if(u===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(u),this.#n.config.onSuccess?.(u,this),this.#n.config.onSettled?.(u,this.state.error,this),u}catch(u){if(u instanceof fe){if(u.silent)return this.#i.promise;if(u.revert){if(this.state.data===void 0)throw u;return this.state.data}}throw this.#r({type:"error",error:u}),this.#n.config.onError?.(u,this),this.#n.config.onSettled?.(this.state.data,u,this),u}finally{this.scheduleGc()}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Ke(n.data,this.options),fetchMeta:e.meta??null};case"success":const i={...n,...Ve(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?i:void 0,i;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),F.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Ke(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ke(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ve(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function De(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,i=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var wt=class extends j{constructor(e,t){super(),this.options=t,this.#e=e,this.#r=null,this.#u=ge(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#i;#o;#u;#r;#p;#g;#f;#a;#c;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ae(this.#t,this.options)?this.#d():this.updateResult(),this.#C())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return he(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return he(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#y(),this.#R(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof E(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),t._defaulted&&!Z(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&He(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),i&&(this.#t!==n||E(this.options.enabled,this.#t)!==E(t.enabled,this.#t)||L(this.options.staleTime,this.#t)!==L(t.staleTime,this.#t))&&this.#m();const s=this.#v();i&&(this.#t!==n||E(this.options.enabled,this.#t)!==E(t.enabled,this.#t)||s!==this.#l)&&this.#S(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return _t(this,n)&&(this.#s=n,this.#o=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,i)=>(this.trackProp(i),t?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#u.status==="pending"&&this.#u.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#d(e){this.#w();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(x)),t}#m(){this.#y();const e=L(this.options.staleTime,this.#t);if(q||this.#s.isStale||!ae(e))return;const n=Qe(this.#s.dataUpdatedAt,e)+1;this.#a=z.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#S(e){this.#R(),this.#l=e,!(q||E(this.options.enabled,this.#t)===!1||!ae(this.#l)||this.#l===0)&&(this.#c=z.setInterval(()=>{(this.options.refetchIntervalInBackground||Fe.isFocused())&&this.#d()},this.#l))}#C(){this.#m(),this.#S(this.#v())}#y(){this.#a&&(z.clearTimeout(this.#a),this.#a=void 0)}#R(){this.#c&&(z.clearInterval(this.#c),this.#c=void 0)}createResult(e,t){const n=this.#t,i=this.options,s=this.#s,r=this.#i,o=this.#o,l=e!==n?e.state:this.#n,{state:a}=e;let c={...a},p=!1,g;if(t._optimisticResults){const I=this.hasListeners(),U=!I&&Ae(e,t),A=I&&He(e,n,t,i);(U||A)&&(c={...c,...Ke(a.data,e.options)}),t._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:d,errorUpdatedAt:h,status:f}=c;g=c.data;let C=!1;if(t.placeholderData!==void 0&&g===void 0&&f==="pending"){let I;s?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(I=s.data,C=!0):I=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,I!==void 0&&(f="success",g=de(s?.data,I,t),p=!0)}if(t.select&&g!==void 0&&!C)if(s&&g===r?.data&&t.select===this.#p)g=this.#g;else try{this.#p=t.select,g=t.select(g),g=de(s?.data,g,t),this.#g=g,this.#r=null}catch(I){this.#r=I}this.#r&&(d=this.#r,g=this.#g,h=Date.now(),f="error");const m=c.fetchStatus==="fetching",R=f==="pending",y=f==="error",_=R&&m,M=g!==void 0,$={status:f,fetchStatus:c.fetchStatus,isPending:R,isSuccess:f==="success",isError:y,isInitialLoading:_,isLoading:_,data:g,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:h,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:m,isRefetching:m&&!R,isLoadingError:y&&!M,isPaused:c.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:y&&M,isStale:_e(e,t),refetch:this.refetch,promise:this.#u,isEnabled:E(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const I=T=>{$.status==="error"?T.reject($.error):$.data!==void 0&&T.resolve($.data)},U=()=>{const T=this.#u=$.promise=ge();I(T)},A=this.#u;switch(A.status){case"pending":e.queryHash===n.queryHash&&I(A);break;case"fulfilled":($.status==="error"||$.data!==A.value)&&U();break;case"rejected":($.status!=="error"||$.error!==A.reason)&&U();break}}return $}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#o=this.options,this.#i.data!==void 0&&(this.#f=this.#t),Z(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!this.#h.size)return!0;const r=new Set(s??this.#h);return this.options.throwOnError&&r.add("error"),Object.keys(this.#s).some(o=>{const u=o;return this.#s[u]!==e[u]&&r.has(u)})};this.#F({listeners:n()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#C()}#F(e){F.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Ft(e,t){return E(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ae(e,t){return Ft(e,t)||e.state.data!==void 0&&he(e,t,t.refetchOnMount)}function he(e,t,n){if(E(t.enabled,e)!==!1&&L(t.staleTime,e)!=="static"){const i=typeof n=="function"?n(e):n;return i==="always"||i!==!1&&_e(e,t)}return!1}function He(e,t,n,i){return(e!==t||E(i.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&_e(e,n)}function _e(e,t){return E(t.enabled,e)!==!1&&e.isStaleByTime(L(t.staleTime,e))}function _t(e,t){return!Z(e.getCurrentResult(),t)}function Le(e){return{onFetch:(t,n)=>{const i=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,r=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},l=0;const a=async()=>{let c=!1;const p=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},g=Ue(t.options,t.fetchOptions),d=async(h,f,C)=>{if(c)return Promise.reject();if(f==null&&h.pages.length)return Promise.resolve(h);const R=(()=>{const b={client:t.client,queryKey:t.queryKey,pageParam:f,direction:C?"backward":"forward",meta:t.options.meta};return p(b),b})(),y=await g(R),{maxPages:_}=t.options,M=C?pt:ht;return{pages:M(h.pages,y,_),pageParams:M(h.pageParams,f,_)}};if(s&&r.length){const h=s==="backward",f=h?Pt:Ge,C={pages:r,pageParams:o},m=f(i,C);u=await d(C,m,h)}else{const h=e??r.length;do{const f=l===0?o[0]??i.initialPageParam:Ge(i,u);if(l>0&&f==null)break;u=await d(u,f),l++}while(l<h)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(a,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=a}}}function Ge(e,{pages:t,pageParams:n}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,n[i],n):void 0}function Pt(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Mt=class extends Ne{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Xe(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#i({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Be({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(r,o)=>{this.#i({type:"failed",failureCount:r,error:o})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",s=!this.#s.canStart();try{if(i)t();else{this.#i({type:"pending",variables:e,isPaused:s}),await this.#n.config.onMutate?.(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#i({type:"pending",context:o,variables:e,isPaused:s})}const r=await this.#s.start();return await this.#n.config.onSuccess?.(r,e,this.state.context,this,n),await this.options.onSuccess?.(r,e,this.state.context,n),await this.#n.config.onSettled?.(r,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(r,null,e,this.state.context,n),this.#i({type:"success",data:r}),r}catch(r){try{throw await this.#n.config.onError?.(r,e,this.state.context,this,n),await this.options.onError?.(r,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,r,e,this.state.context,n),r}finally{this.#i({type:"error",error:r})}}finally{this.#n.runNext(this)}}#i(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),F.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Xe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var It=class extends j{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const i=new Mt({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(i),i}add(e){this.#e.add(e);const t=K(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=K(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const i=n.indexOf(e);i!==-1&&n.splice(i,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=K(e);if(typeof t=="string"){const i=this.#t.get(t)?.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){const t=K(e);return typeof t=="string"?this.#t.get(t)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){F.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>$e(t,n))}findAll(e={}){return this.getAll().filter(t=>$e(e,t))}notify(e){F.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return F.batch(()=>Promise.all(e.map(t=>t.continue().catch(x))))}};function K(e){return e.options.scope?.id}var xt=class extends j{#e;#t=void 0;#n;#s;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#e.defaultMutationOptions(e),Z(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Q(t.mutationKey)!==Q(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#o(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#o()}mutate(e,t){return this.#s=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){const e=this.#n?.state??Xe();this.#t={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#o(e){F.batch(()=>{if(this.#s&&this.hasListeners()){const t=this.#t.variables,n=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type==="success"?(this.#s.onSuccess?.(e.data,t,n,i),this.#s.onSettled?.(e.data,null,t,n,i)):e?.type==="error"&&(this.#s.onError?.(e.error,t,n,i),this.#s.onSettled?.(void 0,e.error,t,n,i))}this.listeners.forEach(t=>{t(this.#t)})})}},$t=class extends j{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const i=t.queryKey,s=t.queryHash??ye(i,t);let r=this.get(s);return r||(r=new Rt({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(r)),r}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){F.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>xe(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>xe(e,n)):t}notify(e){F.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){F.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){F.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},An=class{#e;#t;#n;#s;#i;#o;#u;#r;constructor(e={}){this.#e=e.queryCache||new $t,this.#t=e.mutationCache||new It,this.#n=e.defaultOptions||{},this.#s=new Map,this.#i=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#u=Fe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#r=Y.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#u?.(),this.#u=void 0,this.#r?.(),this.#r=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),i=n.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(L(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const i=n.data;return[t,i]})}setQueryData(e,t,n){const i=this.defaultQueryOptions({queryKey:e}),r=this.#e.get(i.queryHash)?.state.data,o=dt(t,r);if(o!==void 0)return this.#e.build(this,i).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return F.batch(()=>this.#e.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;F.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return F.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},i=F.batch(()=>this.#e.findAll(e).map(s=>s.cancel(n)));return Promise.all(i).then(x).catch(x)}invalidateQueries(e,t={}){return F.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},i=F.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let r=s.fetch(void 0,n);return n.throwOnError||(r=r.catch(x)),s.state.fetchStatus==="paused"?Promise.resolve():r}));return Promise.all(i).then(x)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(L(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(x).catch(x)}fetchInfiniteQuery(e){return e.behavior=Le(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(x).catch(x)}ensureInfiniteQueryData(e){return e.behavior=Le(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Y.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#s.set(Q(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(i=>{N(e,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Q(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(i=>{N(e,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ye(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===we&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},We=w.createContext(void 0),ee=e=>{const t=w.useContext(We);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Hn=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ut.jsx(We.Provider,{value:e,children:t})),Je=w.createContext(!1),Ot=()=>w.useContext(Je);Je.Provider;function Et(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Vt=w.createContext(Et()),Dt=()=>w.useContext(Vt),At=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Ht=e=>{w.useEffect(()=>{e.clearReset()},[e])},Lt=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(s&&e.data===void 0||je(n,[e.error,i])),Gt=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...s)=>n(i(...s)):n(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},bt=(e,t)=>e.isLoading&&e.isFetching&&!t,Tt=(e,t)=>e?.suspense&&t.isPending,be=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function zt(e,t,n){const i=Ot(),s=Dt(),r=ee(n),o=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=i?"isRestoring":"optimistic",Gt(o),At(o,s),Ht(s);const u=!r.getQueryCache().get(o.queryHash),[l]=w.useState(()=>new t(r,o)),a=l.getOptimisticResult(o),c=!i&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(p=>{const g=c?l.subscribe(F.batchCalls(p)):x;return l.updateResult(),g},[l,c]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),w.useEffect(()=>{l.setOptions(o)},[o,l]),Tt(o,a))throw be(o,l,s);if(Lt({result:a,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw a.error;return r.getDefaultOptions().queries?._experimental_afterQuery?.(o,a),o.experimental_prefetchInRender&&!q&&bt(a,i)&&(u?be(o,l,s):r.getQueryCache().get(o.queryHash)?.promise)?.catch(x).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?a:l.trackResult(a)}function Ln(e,t){return zt(e,wt,t)}function Gn(e,t){const n=ee(t);return qt({filters:{...e,status:"pending"}},n).length}function Te(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function qt(e={},t){const n=ee(t).getMutationCache(),i=w.useRef(e),s=w.useRef(null);return s.current===null&&(s.current=Te(n,e)),w.useEffect(()=>{i.current=e}),w.useSyncExternalStore(w.useCallback(r=>n.subscribe(()=>{const o=Re(s.current,Te(n,i.current));s.current!==o&&(s.current=o,F.schedule(r))}),[n]),()=>s.current,()=>s.current)}function bn(e,t){const n=ee(t),[i]=w.useState(()=>new xt(n,e));w.useEffect(()=>{i.setOptions(e)},[i,e]);const s=w.useSyncExternalStore(w.useCallback(o=>i.subscribe(F.batchCalls(o)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),r=w.useCallback((o,u)=>{i.mutate(o,u).catch(x)},[i]);if(s.error&&je(i.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:r,mutateAsync:s.mutate}}function H(e,t){return typeof e=="function"?e(t):e}function O(e,t){return n=>{t.setState(i=>({...i,[e]:H(n,i[e])}))}}function te(e){return e instanceof Function}function Qt(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Ut(e,t){const n=[],i=s=>{s.forEach(r=>{n.push(r);const o=t(r);o!=null&&o.length&&i(o)})};return i(e),n}function v(e,t,n){let i=[],s;return r=>{let o;n.key&&n.debug&&(o=Date.now());const u=e(r);if(!(u.length!==i.length||u.some((c,p)=>i[p]!==c)))return s;i=u;let a;if(n.key&&n.debug&&(a=Date.now()),s=t(...u),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-o)*100)/100,p=Math.round((Date.now()-a)*100)/100,g=p/16,d=(h,f)=>{for(h=String(h);h.length<f;)h=" "+h;return h};console.info(`%c⏱ ${d(p,5)} /${d(c,5)} ms`,`
|
|
1
|
+
import{r as w}from"./react-vendor-CNOkPC89.js";import{j as ut}from"./radix-ui-DIWAxjEp.js";var j=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},lt={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},at=class{#e=lt;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},z=new at;function ct(e){setTimeout(e,0)}var q=typeof window>"u"||"Deno"in globalThis;function x(){}function dt(e,t){return typeof e=="function"?e(t):e}function ae(e){return typeof e=="number"&&e>=0&&e!==1/0}function Qe(e,t){return Math.max(e+(t||0)-Date.now(),0)}function L(e,t){return typeof e=="function"?e(t):e}function E(e,t){return typeof e=="function"?e(t):e}function xe(e,t){const{type:n="all",exact:i,fetchStatus:s,predicate:r,queryKey:o,stale:u}=e;if(o){if(i){if(t.queryHash!==ye(o,t.options))return!1}else if(!N(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||s&&s!==t.state.fetchStatus||r&&!r(t))}function $e(e,t){const{exact:n,status:i,predicate:s,mutationKey:r}=e;if(r){if(!t.options.mutationKey)return!1;if(n){if(Q(t.options.mutationKey)!==Q(r))return!1}else if(!N(t.options.mutationKey,r))return!1}return!(i&&t.state.status!==i||s&&!s(t))}function ye(e,t){return(t?.queryKeyHashFn||Q)(e)}function Q(e){return JSON.stringify(e,(t,n)=>ce(n)?Object.keys(n).sort().reduce((i,s)=>(i[s]=n[s],i),{}):n)}function N(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>N(e[n],t[n])):!1}var gt=Object.prototype.hasOwnProperty;function Re(e,t){if(e===t)return e;const n=Oe(e)&&Oe(t);if(!n&&!(ce(e)&&ce(t)))return t;const s=(n?e:Object.keys(e)).length,r=n?t:Object.keys(t),o=r.length,u=n?new Array(o):{};let l=0;for(let a=0;a<o;a++){const c=n?a:r[a],p=e[c],g=t[c];if(p===g){u[c]=p,(n?a<s:gt.call(e,c))&&l++;continue}if(p===null||g===null||typeof p!="object"||typeof g!="object"){u[c]=g;continue}const d=Re(p,g);u[c]=d,d===p&&l++}return s===o&&l===s?e:u}function Z(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Oe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ce(e){if(!Ee(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ee(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ee(e){return Object.prototype.toString.call(e)==="[object Object]"}function ft(e){return new Promise(t=>{z.setTimeout(t,e)})}function de(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Re(e,t):t}function ht(e,t,n=0){const i=[...e,t];return n&&i.length>n?i.slice(1):i}function pt(e,t,n=0){const i=[t,...e];return n&&i.length>n?i.slice(0,-1):i}var we=Symbol();function Ue(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===we?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function je(e,t){return typeof e=="function"?e(...t):!!e}var mt=class extends j{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!q&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Fe=new mt;function ge(){let e,t;const n=new Promise((s,r)=>{e=s,t=r});n.status="pending",n.catch(()=>{});function i(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{i({status:"fulfilled",value:s}),e(s)},n.reject=s=>{i({status:"rejected",reason:s}),t(s)},n}var vt=ct;function St(){let e=[],t=0,n=u=>{u()},i=u=>{u()},s=vt;const r=u=>{t?e.push(u):s(()=>{n(u)})},o=()=>{const u=e;e=[],u.length&&s(()=>{i(()=>{u.forEach(l=>{n(l)})})})};return{batch:u=>{let l;t++;try{l=u()}finally{t--,t||o()}return l},batchCalls:u=>(...l)=>{r(()=>{u(...l)})},schedule:r,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{i=u},setScheduler:u=>{s=u}}}var F=St(),Ct=class extends j{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!q&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Y=new Ct;function yt(e){return Math.min(1e3*2**e,3e4)}function ke(e){return(e??"online")==="online"?Y.isOnline():!0}var fe=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Be(e){let t=!1,n=0,i;const s=ge(),r=()=>s.status!=="pending",o=f=>{if(!r()){const C=new fe(f);g(C),e.onCancel?.(C)}},u=()=>{t=!0},l=()=>{t=!1},a=()=>Fe.isFocused()&&(e.networkMode==="always"||Y.isOnline())&&e.canRun(),c=()=>ke(e.networkMode)&&e.canRun(),p=f=>{r()||(i?.(),s.resolve(f))},g=f=>{r()||(i?.(),s.reject(f))},d=()=>new Promise(f=>{i=C=>{(r()||a())&&f(C)},e.onPause?.()}).then(()=>{i=void 0,r()||e.onContinue?.()}),h=()=>{if(r())return;let f;const C=n===0?e.initialPromise:void 0;try{f=C??e.fn()}catch(m){f=Promise.reject(m)}Promise.resolve(f).then(p).catch(m=>{if(r())return;const R=e.retry??(q?0:3),y=e.retryDelay??yt,_=typeof y=="function"?y(n,m):y,M=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,m);if(t||!M){g(m);return}n++,e.onFail?.(n,m),ft(_).then(()=>a()?void 0:d()).then(()=>{t?g(m):h()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(i?.(),s),cancelRetry:u,continueRetry:l,canStart:c,start:()=>(c()?h():d().then(h),s)}}var Ne=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ae(this.gcTime)&&(this.#e=z.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(q?1/0:300*1e3))}clearGcTimeout(){this.#e&&(z.clearTimeout(this.#e),this.#e=void 0)}},Rt=class extends Ne{#e;#t;#n;#s;#i;#o;#u;constructor(e){super(),this.#u=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=De(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=De(this.options);t.data!==void 0&&(this.setState(Ve(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=de(this.state.data,e,this.options);return this.#r({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#r({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(x).catch(x):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>E(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===we||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>L(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Qe(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#u?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#r({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const u=this.observers.find(l=>l.options.queryFn);u&&this.setOptions(u.options)}const n=new AbortController,i=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(this.#u=!0,n.signal)})},s=()=>{const u=Ue(this.options,t),a=(()=>{const c={client:this.#s,queryKey:this.queryKey,meta:this.meta};return i(c),c})();return this.#u=!1,this.options.persister?this.options.persister(u,a,this):u(a)},o=(()=>{const u={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:s};return i(u),u})();this.options.behavior?.onFetch(o,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#r({type:"fetch",meta:o.fetchOptions?.meta}),this.#i=Be({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:u=>{u instanceof fe&&u.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(u,l)=>{this.#r({type:"failed",failureCount:u,error:l})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const u=await this.#i.start();if(u===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(u),this.#n.config.onSuccess?.(u,this),this.#n.config.onSettled?.(u,this.state.error,this),u}catch(u){if(u instanceof fe){if(u.silent)return this.#i.promise;if(u.revert){if(this.state.data===void 0)throw u;return this.state.data}}throw this.#r({type:"error",error:u}),this.#n.config.onError?.(u,this),this.#n.config.onSettled?.(this.state.data,u,this),u}finally{this.scheduleGc()}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Ke(n.data,this.options),fetchMeta:e.meta??null};case"success":const i={...n,...Ve(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?i:void 0,i;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),F.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Ke(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ke(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ve(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function De(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,i=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var wt=class extends j{constructor(e,t){super(),this.options=t,this.#e=e,this.#r=null,this.#u=ge(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#i;#o;#u;#r;#p;#g;#f;#a;#c;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ae(this.#t,this.options)?this.#d():this.updateResult(),this.#C())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return he(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return he(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#y(),this.#R(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof E(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),t._defaulted&&!Z(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&He(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),i&&(this.#t!==n||E(this.options.enabled,this.#t)!==E(t.enabled,this.#t)||L(this.options.staleTime,this.#t)!==L(t.staleTime,this.#t))&&this.#m();const s=this.#v();i&&(this.#t!==n||E(this.options.enabled,this.#t)!==E(t.enabled,this.#t)||s!==this.#l)&&this.#S(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return _t(this,n)&&(this.#s=n,this.#o=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,i)=>(this.trackProp(i),t?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#u.status==="pending"&&this.#u.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#d(e){this.#w();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(x)),t}#m(){this.#y();const e=L(this.options.staleTime,this.#t);if(q||this.#s.isStale||!ae(e))return;const n=Qe(this.#s.dataUpdatedAt,e)+1;this.#a=z.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#S(e){this.#R(),this.#l=e,!(q||E(this.options.enabled,this.#t)===!1||!ae(this.#l)||this.#l===0)&&(this.#c=z.setInterval(()=>{(this.options.refetchIntervalInBackground||Fe.isFocused())&&this.#d()},this.#l))}#C(){this.#m(),this.#S(this.#v())}#y(){this.#a&&(z.clearTimeout(this.#a),this.#a=void 0)}#R(){this.#c&&(z.clearInterval(this.#c),this.#c=void 0)}createResult(e,t){const n=this.#t,i=this.options,s=this.#s,r=this.#i,o=this.#o,l=e!==n?e.state:this.#n,{state:a}=e;let c={...a},p=!1,g;if(t._optimisticResults){const I=this.hasListeners(),U=!I&&Ae(e,t),A=I&&He(e,n,t,i);(U||A)&&(c={...c,...Ke(a.data,e.options)}),t._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:d,errorUpdatedAt:h,status:f}=c;g=c.data;let C=!1;if(t.placeholderData!==void 0&&g===void 0&&f==="pending"){let I;s?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(I=s.data,C=!0):I=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,I!==void 0&&(f="success",g=de(s?.data,I,t),p=!0)}if(t.select&&g!==void 0&&!C)if(s&&g===r?.data&&t.select===this.#p)g=this.#g;else try{this.#p=t.select,g=t.select(g),g=de(s?.data,g,t),this.#g=g,this.#r=null}catch(I){this.#r=I}this.#r&&(d=this.#r,g=this.#g,h=Date.now(),f="error");const m=c.fetchStatus==="fetching",R=f==="pending",y=f==="error",_=R&&m,M=g!==void 0,$={status:f,fetchStatus:c.fetchStatus,isPending:R,isSuccess:f==="success",isError:y,isInitialLoading:_,isLoading:_,data:g,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:h,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:m,isRefetching:m&&!R,isLoadingError:y&&!M,isPaused:c.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:y&&M,isStale:_e(e,t),refetch:this.refetch,promise:this.#u,isEnabled:E(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const I=T=>{$.status==="error"?T.reject($.error):$.data!==void 0&&T.resolve($.data)},U=()=>{const T=this.#u=$.promise=ge();I(T)},A=this.#u;switch(A.status){case"pending":e.queryHash===n.queryHash&&I(A);break;case"fulfilled":($.status==="error"||$.data!==A.value)&&U();break;case"rejected":($.status!=="error"||$.error!==A.reason)&&U();break}}return $}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#o=this.options,this.#i.data!==void 0&&(this.#f=this.#t),Z(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!this.#h.size)return!0;const r=new Set(s??this.#h);return this.options.throwOnError&&r.add("error"),Object.keys(this.#s).some(o=>{const u=o;return this.#s[u]!==e[u]&&r.has(u)})};this.#F({listeners:n()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#C()}#F(e){F.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Ft(e,t){return E(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ae(e,t){return Ft(e,t)||e.state.data!==void 0&&he(e,t,t.refetchOnMount)}function he(e,t,n){if(E(t.enabled,e)!==!1&&L(t.staleTime,e)!=="static"){const i=typeof n=="function"?n(e):n;return i==="always"||i!==!1&&_e(e,t)}return!1}function He(e,t,n,i){return(e!==t||E(i.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&_e(e,n)}function _e(e,t){return E(t.enabled,e)!==!1&&e.isStaleByTime(L(t.staleTime,e))}function _t(e,t){return!Z(e.getCurrentResult(),t)}function Le(e){return{onFetch:(t,n)=>{const i=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,r=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},l=0;const a=async()=>{let c=!1;const p=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},g=Ue(t.options,t.fetchOptions),d=async(h,f,C)=>{if(c)return Promise.reject();if(f==null&&h.pages.length)return Promise.resolve(h);const R=(()=>{const b={client:t.client,queryKey:t.queryKey,pageParam:f,direction:C?"backward":"forward",meta:t.options.meta};return p(b),b})(),y=await g(R),{maxPages:_}=t.options,M=C?pt:ht;return{pages:M(h.pages,y,_),pageParams:M(h.pageParams,f,_)}};if(s&&r.length){const h=s==="backward",f=h?Pt:Ge,C={pages:r,pageParams:o},m=f(i,C);u=await d(C,m,h)}else{const h=e??r.length;do{const f=l===0?o[0]??i.initialPageParam:Ge(i,u);if(l>0&&f==null)break;u=await d(u,f),l++}while(l<h)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(a,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=a}}}function Ge(e,{pages:t,pageParams:n}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,n[i],n):void 0}function Pt(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Mt=class extends Ne{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Xe(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#i({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Be({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(r,o)=>{this.#i({type:"failed",failureCount:r,error:o})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",s=!this.#s.canStart();try{if(i)t();else{this.#i({type:"pending",variables:e,isPaused:s}),await this.#n.config.onMutate?.(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#i({type:"pending",context:o,variables:e,isPaused:s})}const r=await this.#s.start();return await this.#n.config.onSuccess?.(r,e,this.state.context,this,n),await this.options.onSuccess?.(r,e,this.state.context,n),await this.#n.config.onSettled?.(r,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(r,null,e,this.state.context,n),this.#i({type:"success",data:r}),r}catch(r){try{throw await this.#n.config.onError?.(r,e,this.state.context,this,n),await this.options.onError?.(r,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,r,e,this.state.context,n),r}finally{this.#i({type:"error",error:r})}}finally{this.#n.runNext(this)}}#i(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),F.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Xe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var It=class extends j{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const i=new Mt({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(i),i}add(e){this.#e.add(e);const t=K(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=K(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const i=n.indexOf(e);i!==-1&&n.splice(i,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=K(e);if(typeof t=="string"){const i=this.#t.get(t)?.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){const t=K(e);return typeof t=="string"?this.#t.get(t)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){F.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>$e(t,n))}findAll(e={}){return this.getAll().filter(t=>$e(e,t))}notify(e){F.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return F.batch(()=>Promise.all(e.map(t=>t.continue().catch(x))))}};function K(e){return e.options.scope?.id}var xt=class extends j{#e;#t=void 0;#n;#s;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#e.defaultMutationOptions(e),Z(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Q(t.mutationKey)!==Q(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#o(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#o()}mutate(e,t){return this.#s=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){const e=this.#n?.state??Xe();this.#t={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#o(e){F.batch(()=>{if(this.#s&&this.hasListeners()){const t=this.#t.variables,n=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type==="success"?(this.#s.onSuccess?.(e.data,t,n,i),this.#s.onSettled?.(e.data,null,t,n,i)):e?.type==="error"&&(this.#s.onError?.(e.error,t,n,i),this.#s.onSettled?.(void 0,e.error,t,n,i))}this.listeners.forEach(t=>{t(this.#t)})})}},$t=class extends j{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const i=t.queryKey,s=t.queryHash??ye(i,t);let r=this.get(s);return r||(r=new Rt({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(r)),r}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){F.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>xe(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>xe(e,n)):t}notify(e){F.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){F.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){F.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},An=class{#e;#t;#n;#s;#i;#o;#u;#r;constructor(e={}){this.#e=e.queryCache||new $t,this.#t=e.mutationCache||new It,this.#n=e.defaultOptions||{},this.#s=new Map,this.#i=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#u=Fe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#r=Y.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#u?.(),this.#u=void 0,this.#r?.(),this.#r=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),i=n.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(L(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const i=n.data;return[t,i]})}setQueryData(e,t,n){const i=this.defaultQueryOptions({queryKey:e}),r=this.#e.get(i.queryHash)?.state.data,o=dt(t,r);if(o!==void 0)return this.#e.build(this,i).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return F.batch(()=>this.#e.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;F.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return F.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},i=F.batch(()=>this.#e.findAll(e).map(s=>s.cancel(n)));return Promise.all(i).then(x).catch(x)}invalidateQueries(e,t={}){return F.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},i=F.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let r=s.fetch(void 0,n);return n.throwOnError||(r=r.catch(x)),s.state.fetchStatus==="paused"?Promise.resolve():r}));return Promise.all(i).then(x)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(L(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(x).catch(x)}fetchInfiniteQuery(e){return e.behavior=Le(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(x).catch(x)}ensureInfiniteQueryData(e){return e.behavior=Le(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Y.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#s.set(Q(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(i=>{N(e,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Q(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(i=>{N(e,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ye(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===we&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},We=w.createContext(void 0),ee=e=>{const t=w.useContext(We);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Hn=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ut.jsx(We.Provider,{value:e,children:t})),Je=w.createContext(!1),Ot=()=>w.useContext(Je);Je.Provider;function Et(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Vt=w.createContext(Et()),Dt=()=>w.useContext(Vt),At=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Ht=e=>{w.useEffect(()=>{e.clearReset()},[e])},Lt=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(s&&e.data===void 0||je(n,[e.error,i])),Gt=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...s)=>n(i(...s)):n(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},bt=(e,t)=>e.isLoading&&e.isFetching&&!t,Tt=(e,t)=>e?.suspense&&t.isPending,be=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function zt(e,t,n){const i=Ot(),s=Dt(),r=ee(n),o=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=i?"isRestoring":"optimistic",Gt(o),At(o,s),Ht(s);const u=!r.getQueryCache().get(o.queryHash),[l]=w.useState(()=>new t(r,o)),a=l.getOptimisticResult(o),c=!i&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(p=>{const g=c?l.subscribe(F.batchCalls(p)):x;return l.updateResult(),g},[l,c]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),w.useEffect(()=>{l.setOptions(o)},[o,l]),Tt(o,a))throw be(o,l,s);if(Lt({result:a,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw a.error;return r.getDefaultOptions().queries?._experimental_afterQuery?.(o,a),o.experimental_prefetchInRender&&!q&&bt(a,i)&&(u?be(o,l,s):r.getQueryCache().get(o.queryHash)?.promise)?.catch(x).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?a:l.trackResult(a)}function Ln(e,t){return zt(e,wt,t)}function Gn(e,t){const n=ee(t);return qt({filters:{...e,status:"pending"}},n).length}function Te(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function qt(e={},t){const n=ee(t).getMutationCache(),i=w.useRef(e),s=w.useRef(null);return s.current===null&&(s.current=Te(n,e)),w.useEffect(()=>{i.current=e}),w.useSyncExternalStore(w.useCallback(r=>n.subscribe(()=>{const o=Re(s.current,Te(n,i.current));s.current!==o&&(s.current=o,F.schedule(r))}),[n]),()=>s.current,()=>s.current)}function bn(e,t){const n=ee(t),[i]=w.useState(()=>new xt(n,e));w.useEffect(()=>{i.setOptions(e)},[i,e]);const s=w.useSyncExternalStore(w.useCallback(o=>i.subscribe(F.batchCalls(o)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),r=w.useCallback((o,u)=>{i.mutate(o,u).catch(x)},[i]);if(s.error&&je(i.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:r,mutateAsync:s.mutate}}function H(e,t){return typeof e=="function"?e(t):e}function O(e,t){return n=>{t.setState(i=>({...i,[e]:H(n,i[e])}))}}function te(e){return e instanceof Function}function Qt(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Ut(e,t){const n=[],i=s=>{s.forEach(r=>{n.push(r);const o=t(r);o!=null&&o.length&&i(o)})};return i(e),n}function v(e,t,n){let i=[],s;return r=>{let o;n.key&&n.debug&&(o=Date.now());const u=e(r);if(!(u.length!==i.length||u.some((c,p)=>i[p]!==c)))return s;i=u;let a;if(n.key&&n.debug&&(a=Date.now()),s=t(...u),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-o)*100)/100,p=Math.round((Date.now()-a)*100)/100,g=p/16,d=(h,f)=>{for(h=String(h);h.length<f;)h=" "+h;return h};console.info(`%c⏱ ${d(p,5)} /${d(c,5)} ms`,`
|
|
2
2
|
font-size: .6rem;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,n?.key)}return s}}function S(e,t,n,i){return{debug:()=>{var s;return(s=e?.debugAll)!=null?s:e[t]},key:!1,onChange:i}}function jt(e,t,n,i){const s=()=>{var o;return(o=r.getValue())!=null?o:e.options.renderFallbackValue},r={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(i),renderValue:s,getContext:v(()=>[e,n,t,r],(o,u,l,a)=>({table:o,column:u,row:l,cell:a,getValue:a.getValue,renderValue:a.renderValue}),S(e.options,"debugCells"))};return e._features.forEach(o=>{o.createCell==null||o.createCell(r,n,t,e)},{}),r}function kt(e,t,n,i){var s,r;const u={...e._getDefaultColumnDef(),...t},l=u.accessorKey;let a=(s=(r=u.id)!=null?r:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?s:typeof u.header=="string"?u.header:void 0,c;if(u.accessorFn?c=u.accessorFn:l&&(l.includes(".")?c=g=>{let d=g;for(const f of l.split(".")){var h;d=(h=d)==null?void 0:h[f]}return d}:c=g=>g[u.accessorKey]),!a)throw new Error;let p={id:`${String(a)}`,accessorFn:c,parent:i,depth:n,columnDef:u,columns:[],getFlatColumns:v(()=>[!0],()=>{var g;return[p,...(g=p.columns)==null?void 0:g.flatMap(d=>d.getFlatColumns())]},S(e.options,"debugColumns")),getLeafColumns:v(()=>[e._getOrderColumnsFn()],g=>{var d;if((d=p.columns)!=null&&d.length){let h=p.columns.flatMap(f=>f.getLeafColumns());return g(h)}return[p]},S(e.options,"debugColumns"))};for(const g of e._features)g.createColumn==null||g.createColumn(p,e);return p}const P="debugHeaders";function ze(e,t,n){var i;let r={id:(i=n.id)!=null?i:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const o=[],u=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(u),o.push(l)};return u(r),o},getContext:()=>({table:e,header:r,column:t})};return e._features.forEach(o=>{o.createHeader==null||o.createHeader(r,e)}),r}const Bt={createTable:e=>{e.getHeaderGroups=v(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,s)=>{var r,o;const u=(r=i?.map(p=>n.find(g=>g.id===p)).filter(Boolean))!=null?r:[],l=(o=s?.map(p=>n.find(g=>g.id===p)).filter(Boolean))!=null?o:[],a=n.filter(p=>!(i!=null&&i.includes(p.id))&&!(s!=null&&s.includes(p.id)));return X(t,[...u,...a,...l],e)},S(e.options,P)),e.getCenterHeaderGroups=v(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i,s)=>(n=n.filter(r=>!(i!=null&&i.includes(r.id))&&!(s!=null&&s.includes(r.id))),X(t,n,e,"center")),S(e.options,P)),e.getLeftHeaderGroups=v(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,i)=>{var s;const r=(s=i?.map(o=>n.find(u=>u.id===o)).filter(Boolean))!=null?s:[];return X(t,r,e,"left")},S(e.options,P)),e.getRightHeaderGroups=v(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,i)=>{var s;const r=(s=i?.map(o=>n.find(u=>u.id===o)).filter(Boolean))!=null?s:[];return X(t,r,e,"right")},S(e.options,P)),e.getFooterGroups=v(()=>[e.getHeaderGroups()],t=>[...t].reverse(),S(e.options,P)),e.getLeftFooterGroups=v(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),S(e.options,P)),e.getCenterFooterGroups=v(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),S(e.options,P)),e.getRightFooterGroups=v(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),S(e.options,P)),e.getFlatHeaders=v(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),S(e.options,P)),e.getLeftFlatHeaders=v(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),S(e.options,P)),e.getCenterFlatHeaders=v(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),S(e.options,P)),e.getRightFlatHeaders=v(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),S(e.options,P)),e.getCenterLeafHeaders=v(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),S(e.options,P)),e.getLeftLeafHeaders=v(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),S(e.options,P)),e.getRightLeafHeaders=v(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var i;return!((i=n.subHeaders)!=null&&i.length)}),S(e.options,P)),e.getLeafHeaders=v(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,i)=>{var s,r,o,u,l,a;return[...(s=(r=t[0])==null?void 0:r.headers)!=null?s:[],...(o=(u=n[0])==null?void 0:u.headers)!=null?o:[],...(l=(a=i[0])==null?void 0:a.headers)!=null?l:[]].map(c=>c.getLeafHeaders()).flat()},S(e.options,P))}};function X(e,t,n,i){var s,r;let o=0;const u=function(g,d){d===void 0&&(d=1),o=Math.max(o,d),g.filter(h=>h.getIsVisible()).forEach(h=>{var f;(f=h.columns)!=null&&f.length&&u(h.columns,d+1)},0)};u(e);let l=[];const a=(g,d)=>{const h={depth:d,id:[i,`${d}`].filter(Boolean).join("_"),headers:[]},f=[];g.forEach(C=>{const m=[...f].reverse()[0],R=C.column.depth===h.depth;let y,_=!1;if(R&&C.column.parent?y=C.column.parent:(y=C.column,_=!0),m&&m?.column===y)m.subHeaders.push(C);else{const M=ze(n,y,{id:[i,d,y.id,C?.id].filter(Boolean).join("_"),isPlaceholder:_,placeholderId:_?`${f.filter(b=>b.column===y).length}`:void 0,depth:d,index:f.length});M.subHeaders.push(C),f.push(M)}h.headers.push(C),C.headerGroup=h}),l.push(h),d>0&&a(f,d-1)},c=t.map((g,d)=>ze(n,g,{depth:o,index:d}));a(c,o-1),l.reverse();const p=g=>g.filter(h=>h.column.getIsVisible()).map(h=>{let f=0,C=0,m=[0];h.subHeaders&&h.subHeaders.length?(m=[],p(h.subHeaders).forEach(y=>{let{colSpan:_,rowSpan:M}=y;f+=_,m.push(M)})):f=1;const R=Math.min(...m);return C=C+R,h.colSpan=f,h.rowSpan=C,{colSpan:f,rowSpan:C}});return p((s=(r=l[0])==null?void 0:r.headers)!=null?s:[]),l}const Nt=(e,t,n,i,s,r,o)=>{let u={id:t,index:i,original:n,depth:s,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(u._valuesCache.hasOwnProperty(l))return u._valuesCache[l];const a=e.getColumn(l);if(a!=null&&a.accessorFn)return u._valuesCache[l]=a.accessorFn(u.original,i),u._valuesCache[l]},getUniqueValues:l=>{if(u._uniqueValuesCache.hasOwnProperty(l))return u._uniqueValuesCache[l];const a=e.getColumn(l);if(a!=null&&a.accessorFn)return a.columnDef.getUniqueValues?(u._uniqueValuesCache[l]=a.columnDef.getUniqueValues(u.original,i),u._uniqueValuesCache[l]):(u._uniqueValuesCache[l]=[u.getValue(l)],u._uniqueValuesCache[l])},renderValue:l=>{var a;return(a=u.getValue(l))!=null?a:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Ut(u.subRows,l=>l.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let l=[],a=u;for(;;){const c=a.getParentRow();if(!c)break;l.push(c),a=c}return l.reverse()},getAllCells:v(()=>[e.getAllLeafColumns()],l=>l.map(a=>jt(e,u,a,a.id)),S(e.options,"debugRows")),_getAllCellsByColumnId:v(()=>[u.getAllCells()],l=>l.reduce((a,c)=>(a[c.column.id]=c,a),{}),S(e.options,"debugRows"))};for(let l=0;l<e._features.length;l++){const a=e._features[l];a==null||a.createRow==null||a.createRow(u,e)}return u},Kt={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Ze=(e,t,n)=>{var i,s;const r=n==null||(i=n.toString())==null?void 0:i.toLowerCase();return!!(!((s=e.getValue(t))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(r))};Ze.autoRemove=e=>V(e);const Ye=(e,t,n)=>{var i;return!!(!((i=e.getValue(t))==null||(i=i.toString())==null)&&i.includes(n))};Ye.autoRemove=e=>V(e);const et=(e,t,n)=>{var i;return((i=e.getValue(t))==null||(i=i.toString())==null?void 0:i.toLowerCase())===n?.toLowerCase()};et.autoRemove=e=>V(e);const tt=(e,t,n)=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(n)};tt.autoRemove=e=>V(e);const nt=(e,t,n)=>!n.some(i=>{var s;return!((s=e.getValue(t))!=null&&s.includes(i))});nt.autoRemove=e=>V(e)||!(e!=null&&e.length);const it=(e,t,n)=>n.some(i=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(i)});it.autoRemove=e=>V(e)||!(e!=null&&e.length);const st=(e,t,n)=>e.getValue(t)===n;st.autoRemove=e=>V(e);const rt=(e,t,n)=>e.getValue(t)==n;rt.autoRemove=e=>V(e);const Pe=(e,t,n)=>{let[i,s]=n;const r=e.getValue(t);return r>=i&&r<=s};Pe.resolveFilterValue=e=>{let[t,n]=e,i=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,r=t===null||Number.isNaN(i)?-1/0:i,o=n===null||Number.isNaN(s)?1/0:s;if(r>o){const u=r;r=o,o=u}return[r,o]};Pe.autoRemove=e=>V(e)||V(e[0])&&V(e[1]);const D={includesString:Ze,includesStringSensitive:Ye,equalsString:et,arrIncludes:tt,arrIncludesAll:nt,arrIncludesSome:it,equals:st,weakEquals:rt,inNumberRange:Pe};function V(e){return e==null||e===""}const Xt={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:O("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],i=n?.getValue(e.id);return typeof i=="string"?D.includesString:typeof i=="number"?D.inNumberRange:typeof i=="boolean"||i!==null&&typeof i=="object"?D.equals:Array.isArray(i)?D.arrIncludes:D.weakEquals},e.getFilterFn=()=>{var n,i;return te(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(i=t.options.filterFns)==null?void 0:i[e.columnDef.filterFn])!=null?n:D[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,i,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((i=t.options.enableColumnFilters)!=null?i:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(i=>i.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,i;return(n=(i=t.getState().columnFilters)==null?void 0:i.findIndex(s=>s.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(i=>{const s=e.getFilterFn(),r=i?.find(c=>c.id===e.id),o=H(n,r?r.value:void 0);if(qe(s,o,e)){var u;return(u=i?.filter(c=>c.id!==e.id))!=null?u:[]}const l={id:e.id,value:o};if(r){var a;return(a=i?.map(c=>c.id===e.id?l:c))!=null?a:[]}return i!=null&&i.length?[...i,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),i=s=>{var r;return(r=H(t,s))==null?void 0:r.filter(o=>{const u=n.find(l=>l.id===o.id);if(u){const l=u.getFilterFn();if(qe(l,o.value,u))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(i)},e.resetColumnFilters=t=>{var n,i;e.setColumnFilters(t?[]:(n=(i=e.initialState)==null?void 0:i.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function qe(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Wt=(e,t,n)=>n.reduce((i,s)=>{const r=s.getValue(e);return i+(typeof r=="number"?r:0)},0),Jt=(e,t,n)=>{let i;return n.forEach(s=>{const r=s.getValue(e);r!=null&&(i>r||i===void 0&&r>=r)&&(i=r)}),i},Zt=(e,t,n)=>{let i;return n.forEach(s=>{const r=s.getValue(e);r!=null&&(i<r||i===void 0&&r>=r)&&(i=r)}),i},Yt=(e,t,n)=>{let i,s;return n.forEach(r=>{const o=r.getValue(e);o!=null&&(i===void 0?o>=o&&(i=s=o):(i>o&&(i=o),s<o&&(s=o)))}),[i,s]},en=(e,t)=>{let n=0,i=0;if(t.forEach(s=>{let r=s.getValue(e);r!=null&&(r=+r)>=r&&(++n,i+=r)}),n)return i/n},tn=(e,t)=>{if(!t.length)return;const n=t.map(r=>r.getValue(e));if(!Qt(n))return;if(n.length===1)return n[0];const i=Math.floor(n.length/2),s=n.sort((r,o)=>r-o);return n.length%2!==0?s[i]:(s[i-1]+s[i])/2},nn=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),sn=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,rn=(e,t)=>t.length,ne={sum:Wt,min:Jt,max:Zt,extent:Yt,mean:en,median:tn,unique:nn,uniqueCount:sn,count:rn},on={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:O("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(i=>i!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,i;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((i=t.options.enableGrouping)!=null?i:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],i=n?.getValue(e.id);if(typeof i=="number")return ne.sum;if(Object.prototype.toString.call(i)==="[object Date]")return ne.extent},e.getAggregationFn=()=>{var n,i;if(!e)throw new Error;return te(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(i=t.options.aggregationFns)==null?void 0:i[e.columnDef.aggregationFn])!=null?n:ne[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,i;e.setGrouping(t?[]:(n=(i=e.initialState)==null?void 0:i.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const i=t.getColumn(n);return i!=null&&i.columnDef.getGroupingValue?(e._groupingValuesCache[n]=i.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,i)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function un(e,t,n){if(!(t!=null&&t.length)||!n)return e;const i=e.filter(r=>!t.includes(r.id));return n==="remove"?i:[...t.map(r=>e.find(o=>o.id===r)).filter(Boolean),...i]}const ln={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:O("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=v(n=>[B(t,n)],n=>n.findIndex(i=>i.id===e.id),S(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var i;return((i=B(t,n)[0])==null?void 0:i.id)===e.id},e.getIsLastColumn=n=>{var i;const s=B(t,n);return((i=s[s.length-1])==null?void 0:i.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=v(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,i)=>s=>{let r=[];if(!(t!=null&&t.length))r=s;else{const o=[...t],u=[...s];for(;u.length&&o.length;){const l=o.shift(),a=u.findIndex(c=>c.id===l);a>-1&&r.push(u.splice(a,1)[0])}r=[...r,...u]}return un(r,n,i)},S(e.options,"debugTable"))}},ie=()=>({left:[],right:[]}),an={getInitialState:e=>({columnPinning:ie(),...e}),getDefaultOptions:e=>({onColumnPinningChange:O("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const i=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var r,o;if(n==="right"){var u,l;return{left:((u=s?.left)!=null?u:[]).filter(p=>!(i!=null&&i.includes(p))),right:[...((l=s?.right)!=null?l:[]).filter(p=>!(i!=null&&i.includes(p))),...i]}}if(n==="left"){var a,c;return{left:[...((a=s?.left)!=null?a:[]).filter(p=>!(i!=null&&i.includes(p))),...i],right:((c=s?.right)!=null?c:[]).filter(p=>!(i!=null&&i.includes(p)))}}return{left:((r=s?.left)!=null?r:[]).filter(p=>!(i!=null&&i.includes(p))),right:((o=s?.right)!=null?o:[]).filter(p=>!(i!=null&&i.includes(p)))}})},e.getCanPin=()=>e.getLeafColumns().some(i=>{var s,r,o;return((s=i.columnDef.enablePinning)!=null?s:!0)&&((r=(o=t.options.enableColumnPinning)!=null?o:t.options.enablePinning)!=null?r:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(u=>u.id),{left:i,right:s}=t.getState().columnPinning,r=n.some(u=>i?.includes(u)),o=n.some(u=>s?.includes(u));return r?"left":o?"right":!1},e.getPinnedIndex=()=>{var n,i;const s=e.getIsPinned();return s?(n=(i=t.getState().columnPinning)==null||(i=i[s])==null?void 0:i.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=v(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,i,s)=>{const r=[...i??[],...s??[]];return n.filter(o=>!r.includes(o.column.id))},S(t.options,"debugRows")),e.getLeftVisibleCells=v(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,i)=>(i??[]).map(r=>n.find(o=>o.column.id===r)).filter(Boolean).map(r=>({...r,position:"left"})),S(t.options,"debugRows")),e.getRightVisibleCells=v(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,i)=>(i??[]).map(r=>n.find(o=>o.column.id===r)).filter(Boolean).map(r=>({...r,position:"right"})),S(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,i;return e.setColumnPinning(t?ie():(n=(i=e.initialState)==null?void 0:i.columnPinning)!=null?n:ie())},e.getIsSomeColumnsPinned=t=>{var n;const i=e.getState().columnPinning;if(!t){var s,r;return!!((s=i.left)!=null&&s.length||(r=i.right)!=null&&r.length)}return!!((n=i[t])!=null&&n.length)},e.getLeftLeafColumns=v(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(i=>t.find(s=>s.id===i)).filter(Boolean),S(e.options,"debugColumns")),e.getRightLeafColumns=v(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(i=>t.find(s=>s.id===i)).filter(Boolean),S(e.options,"debugColumns")),e.getCenterLeafColumns=v(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,i)=>{const s=[...n??[],...i??[]];return t.filter(r=>!s.includes(r.id))},S(e.options,"debugColumns"))}};function cn(e){return e||(typeof document<"u"?document:null)}const W={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},se=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),dn={getDefaultColumnDef:()=>W,getInitialState:e=>({columnSizing:{},columnSizingInfo:se(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:O("columnSizing",e),onColumnSizingInfoChange:O("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,i,s;const r=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:W.minSize,(i=r??e.columnDef.size)!=null?i:W.size),(s=e.columnDef.maxSize)!=null?s:W.maxSize)},e.getStart=v(n=>[n,B(t,n),t.getState().columnSizing],(n,i)=>i.slice(0,e.getIndex(n)).reduce((s,r)=>s+r.getSize(),0),S(t.options,"debugColumns")),e.getAfter=v(n=>[n,B(t,n),t.getState().columnSizing],(n,i)=>i.slice(e.getIndex(n)+1).reduce((s,r)=>s+r.getSize(),0),S(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:i,...s}=n;return s})},e.getCanResize=()=>{var n,i;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((i=t.options.enableColumnResizing)!=null?i:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const i=s=>{if(s.subHeaders.length)s.subHeaders.forEach(i);else{var r;n+=(r=s.column.getSize())!=null?r:0}};return i(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const i=t.getColumn(e.column.id),s=i?.getCanResize();return r=>{if(!i||!s||(r.persist==null||r.persist(),re(r)&&r.touches&&r.touches.length>1))return;const o=e.getSize(),u=e?e.getLeafHeaders().map(m=>[m.column.id,m.column.getSize()]):[[i.id,i.getSize()]],l=re(r)?Math.round(r.touches[0].clientX):r.clientX,a={},c=(m,R)=>{typeof R=="number"&&(t.setColumnSizingInfo(y=>{var _,M;const b=t.options.columnResizeDirection==="rtl"?-1:1,$=(R-((_=y?.startOffset)!=null?_:0))*b,I=Math.max($/((M=y?.startSize)!=null?M:0),-.999999);return y.columnSizingStart.forEach(U=>{let[A,T]=U;a[A]=Math.round(Math.max(T+T*I,0)*100)/100}),{...y,deltaOffset:$,deltaPercentage:I}}),(t.options.columnResizeMode==="onChange"||m==="end")&&t.setColumnSizing(y=>({...y,...a})))},p=m=>c("move",m),g=m=>{c("end",m),t.setColumnSizingInfo(R=>({...R,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},d=cn(n),h={moveHandler:m=>p(m.clientX),upHandler:m=>{d?.removeEventListener("mousemove",h.moveHandler),d?.removeEventListener("mouseup",h.upHandler),g(m.clientX)}},f={moveHandler:m=>(m.cancelable&&(m.preventDefault(),m.stopPropagation()),p(m.touches[0].clientX),!1),upHandler:m=>{var R;d?.removeEventListener("touchmove",f.moveHandler),d?.removeEventListener("touchend",f.upHandler),m.cancelable&&(m.preventDefault(),m.stopPropagation()),g((R=m.touches[0])==null?void 0:R.clientX)}},C=gn()?{passive:!1}:!1;re(r)?(d?.addEventListener("touchmove",f.moveHandler,C),d?.addEventListener("touchend",f.upHandler,C)):(d?.addEventListener("mousemove",h.moveHandler,C),d?.addEventListener("mouseup",h.upHandler,C)),t.setColumnSizingInfo(m=>({...m,startOffset:l,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:i.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?se():(n=e.initialState.columnSizingInfo)!=null?n:se())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((i,s)=>i+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((i,s)=>i+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((i,s)=>i+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((i,s)=>i+s.getSize(),0))!=null?t:0}}};let J=null;function gn(){if(typeof J=="boolean")return J;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return J=e,J}function re(e){return e.type==="touchstart"}const fn={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:O("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(i=>({...i,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,i;const s=e.columns;return(n=s.length?s.some(r=>r.getIsVisible()):(i=t.getState().columnVisibility)==null?void 0:i[e.id])!=null?n:!0},e.getCanHide=()=>{var n,i;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((i=t.options.enableHiding)!=null?i:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=v(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(i=>i.column.getIsVisible()),S(t.options,"debugRows")),e.getVisibleCells=v(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,i,s)=>[...n,...i,...s],S(t.options,"debugRows"))},createTable:e=>{const t=(n,i)=>v(()=>[i(),i().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(r=>r.getIsVisible==null?void 0:r.getIsVisible()),S(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var i;e.setColumnVisibility(n?{}:(i=e.initialState.columnVisibility)!=null?i:{})},e.toggleAllColumnsVisible=n=>{var i;n=(i=n)!=null?i:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,r)=>({...s,[r.id]:n||!(r.getCanHide!=null&&r.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var i;e.toggleAllColumnsVisible((i=n.target)==null?void 0:i.checked)}}};function B(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const hn={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},pn={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:O("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const i=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof i=="string"||typeof i=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,i,s,r;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((i=t.options.enableGlobalFilter)!=null?i:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((r=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?r:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>D.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:i}=e.options;return te(i)?i:i==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[i])!=null?t:D[i]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},mn={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:O("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var i,s;if(!t){e._queue(()=>{t=!0});return}if((i=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?i:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=i=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(i),e.toggleAllRowsExpanded=i=>{i??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=i=>{var s,r;e.setExpanded(i?{}:(s=(r=e.initialState)==null?void 0:r.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(i=>i.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>i=>{i.persist==null||i.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const i=e.getState().expanded;return i===!0||Object.values(i).some(Boolean)},e.getIsAllRowsExpanded=()=>{const i=e.getState().expanded;return typeof i=="boolean"?i===!0:!(!Object.keys(i).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let i=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(r=>{const o=r.split(".");i=Math.max(i,o.length)}),i},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(i=>{var s;const r=i===!0?!0:!!(i!=null&&i[e.id]);let o={};if(i===!0?Object.keys(t.getRowModel().rowsById).forEach(u=>{o[u]=!0}):o=i,n=(s=n)!=null?s:!r,!r&&n)return{...o,[e.id]:!0};if(r&&!n){const{[e.id]:u,...l}=o;return l}return i})},e.getIsExpanded=()=>{var n;const i=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:i===!0||i?.[e.id])},e.getCanExpand=()=>{var n,i,s;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((i=t.options.enableExpanding)!=null?i:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let n=!0,i=e;for(;n&&i.parentId;)i=t.getRow(i.parentId,!0),n=i.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},pe=0,me=10,oe=()=>({pageIndex:pe,pageSize:me}),vn={getInitialState:e=>({...e,pagination:{...oe(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:O("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var i,s;if(!t){e._queue(()=>{t=!0});return}if((i=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?i:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=i=>{const s=r=>H(i,r);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=i=>{var s;e.setPagination(i?oe():(s=e.initialState.pagination)!=null?s:oe())},e.setPageIndex=i=>{e.setPagination(s=>{let r=H(i,s.pageIndex);const o=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return r=Math.max(0,Math.min(r,o)),{...s,pageIndex:r}})},e.resetPageIndex=i=>{var s,r;e.setPageIndex(i?pe:(s=(r=e.initialState)==null||(r=r.pagination)==null?void 0:r.pageIndex)!=null?s:pe)},e.resetPageSize=i=>{var s,r;e.setPageSize(i?me:(s=(r=e.initialState)==null||(r=r.pagination)==null?void 0:r.pageSize)!=null?s:me)},e.setPageSize=i=>{e.setPagination(s=>{const r=Math.max(1,H(i,s.pageSize)),o=s.pageSize*s.pageIndex,u=Math.floor(o/r);return{...s,pageIndex:u,pageSize:r}})},e.setPageCount=i=>e.setPagination(s=>{var r;let o=H(i,(r=e.options.pageCount)!=null?r:-1);return typeof o=="number"&&(o=Math.max(-1,o)),{...s,pageCount:o}}),e.getPageOptions=v(()=>[e.getPageCount()],i=>{let s=[];return i&&i>0&&(s=[...new Array(i)].fill(null).map((r,o)=>o)),s},S(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:i}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:i<s-1},e.previousPage=()=>e.setPageIndex(i=>i-1),e.nextPage=()=>e.setPageIndex(i=>i+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var i;return(i=e.options.pageCount)!=null?i:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var i;return(i=e.options.rowCount)!=null?i:e.getPrePaginationRowModel().rows.length}}},ue=()=>({top:[],bottom:[]}),Sn={getInitialState:e=>({rowPinning:ue(),...e}),getDefaultOptions:e=>({onRowPinningChange:O("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,i,s)=>{const r=i?e.getLeafRows().map(l=>{let{id:a}=l;return a}):[],o=s?e.getParentRows().map(l=>{let{id:a}=l;return a}):[],u=new Set([...o,e.id,...r]);t.setRowPinning(l=>{var a,c;if(n==="bottom"){var p,g;return{top:((p=l?.top)!=null?p:[]).filter(f=>!(u!=null&&u.has(f))),bottom:[...((g=l?.bottom)!=null?g:[]).filter(f=>!(u!=null&&u.has(f))),...Array.from(u)]}}if(n==="top"){var d,h;return{top:[...((d=l?.top)!=null?d:[]).filter(f=>!(u!=null&&u.has(f))),...Array.from(u)],bottom:((h=l?.bottom)!=null?h:[]).filter(f=>!(u!=null&&u.has(f)))}}return{top:((a=l?.top)!=null?a:[]).filter(f=>!(u!=null&&u.has(f))),bottom:((c=l?.bottom)!=null?c:[]).filter(f=>!(u!=null&&u.has(f)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:i,enablePinning:s}=t.options;return typeof i=="function"?i(e):(n=i??s)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:i,bottom:s}=t.getState().rowPinning,r=n.some(u=>i?.includes(u)),o=n.some(u=>s?.includes(u));return r?"top":o?"bottom":!1},e.getPinnedIndex=()=>{var n,i;const s=e.getIsPinned();if(!s)return-1;const r=(n=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(o=>{let{id:u}=o;return u});return(i=r?.indexOf(e.id))!=null?i:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,i;return e.setRowPinning(t?ue():(n=(i=e.initialState)==null?void 0:i.rowPinning)!=null?n:ue())},e.getIsSomeRowsPinned=t=>{var n;const i=e.getState().rowPinning;if(!t){var s,r;return!!((s=i.top)!=null&&s.length||(r=i.bottom)!=null&&r.length)}return!!((n=i[t])!=null&&n.length)},e._getPinnedRows=(t,n,i)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(n??[]).map(o=>{const u=e.getRow(o,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(o=>t.find(u=>u.id===o))).filter(Boolean).map(o=>({...o,position:i}))},e.getTopRows=v(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),S(e.options,"debugRows")),e.getBottomRows=v(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),S(e.options,"debugRows")),e.getCenterRows=v(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,i)=>{const s=new Set([...n??[],...i??[]]);return t.filter(r=>!s.has(r.id))},S(e.options,"debugRows"))}},Cn={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:O("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const i={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(r=>{r.getCanSelect()&&(i[r.id]=!0)}):s.forEach(r=>{delete i[r.id]}),i})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const i=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(r=>{ve(s,r.id,i,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=v(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?le(e,n):{rows:[],flatRows:[],rowsById:{}},S(e.options,"debugTable")),e.getFilteredSelectedRowModel=v(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?le(e,n):{rows:[],flatRows:[],rowsById:{}},S(e.options,"debugTable")),e.getGroupedSelectedRowModel=v(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?le(e,n):{rows:[],flatRows:[],rowsById:{}},S(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let i=!!(t.length&&Object.keys(n).length);return i&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(i=!1),i},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=e.getState();let i=!!t.length;return i&&t.some(s=>!n[s.id])&&(i=!1),i},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,i)=>{const s=e.getIsSelected();t.setRowSelection(r=>{var o;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return r;const u={...r};return ve(u,e.id,n,(o=i?.selectChildren)!=null?o:!0,t),u})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Me(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Se(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Se(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return i=>{var s;n&&e.toggleSelected((s=i.target)==null?void 0:s.checked)}}}},ve=(e,t,n,i,s)=>{var r;const o=s.getRow(t,!0);n?(o.getCanMultiSelect()||Object.keys(e).forEach(u=>delete e[u]),o.getCanSelect()&&(e[t]=!0)):delete e[t],i&&(r=o.subRows)!=null&&r.length&&o.getCanSelectSubRows()&&o.subRows.forEach(u=>ve(e,u.id,n,i,s))};function le(e,t){const n=e.getState().rowSelection,i=[],s={},r=function(o,u){return o.map(l=>{var a;const c=Me(l,n);if(c&&(i.push(l),s[l.id]=l),(a=l.subRows)!=null&&a.length&&(l={...l,subRows:r(l.subRows)}),c)return l}).filter(Boolean)};return{rows:r(t.rows),flatRows:i,rowsById:s}}function Me(e,t){var n;return(n=t[e.id])!=null?n:!1}function Se(e,t,n){var i;if(!((i=e.subRows)!=null&&i.length))return!1;let s=!0,r=!1;return e.subRows.forEach(o=>{if(!(r&&!s)&&(o.getCanSelect()&&(Me(o,t)?r=!0:s=!1),o.subRows&&o.subRows.length)){const u=Se(o,t);u==="all"?r=!0:(u==="some"&&(r=!0),s=!1)}}),s?"all":r?"some":!1}const Ce=/([0-9]+)/gm,yn=(e,t,n)=>ot(G(e.getValue(n)).toLowerCase(),G(t.getValue(n)).toLowerCase()),Rn=(e,t,n)=>ot(G(e.getValue(n)),G(t.getValue(n))),wn=(e,t,n)=>Ie(G(e.getValue(n)).toLowerCase(),G(t.getValue(n)).toLowerCase()),Fn=(e,t,n)=>Ie(G(e.getValue(n)),G(t.getValue(n))),_n=(e,t,n)=>{const i=e.getValue(n),s=t.getValue(n);return i>s?1:i<s?-1:0},Pn=(e,t,n)=>Ie(e.getValue(n),t.getValue(n));function Ie(e,t){return e===t?0:e>t?1:-1}function G(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function ot(e,t){const n=e.split(Ce).filter(Boolean),i=t.split(Ce).filter(Boolean);for(;n.length&&i.length;){const s=n.shift(),r=i.shift(),o=parseInt(s,10),u=parseInt(r,10),l=[o,u].sort();if(isNaN(l[0])){if(s>r)return 1;if(r>s)return-1;continue}if(isNaN(l[1]))return isNaN(o)?-1:1;if(o>u)return 1;if(u>o)return-1}return n.length-i.length}const k={alphanumeric:yn,alphanumericCaseSensitive:Rn,text:wn,textCaseSensitive:Fn,datetime:_n,basic:Pn},Mn={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:O("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let i=!1;for(const s of n){const r=s?.getValue(e.id);if(Object.prototype.toString.call(r)==="[object Date]")return k.datetime;if(typeof r=="string"&&(i=!0,r.split(Ce).length>1))return k.alphanumeric}return i?k.text:k.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,i;if(!e)throw new Error;return te(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(i=t.options.sortingFns)==null?void 0:i[e.columnDef.sortingFn])!=null?n:k[e.columnDef.sortingFn]},e.toggleSorting=(n,i)=>{const s=e.getNextSortingOrder(),r=typeof n<"u"&&n!==null;t.setSorting(o=>{const u=o?.find(d=>d.id===e.id),l=o?.findIndex(d=>d.id===e.id);let a=[],c,p=r?n:s==="desc";if(o!=null&&o.length&&e.getCanMultiSort()&&i?u?c="toggle":c="add":o!=null&&o.length&&l!==o.length-1?c="replace":u?c="toggle":c="replace",c==="toggle"&&(r||s||(c="remove")),c==="add"){var g;a=[...o,{id:e.id,desc:p}],a.splice(0,a.length-((g=t.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else c==="toggle"?a=o.map(d=>d.id===e.id?{...d,desc:p}:d):c==="remove"?a=o.filter(d=>d.id!==e.id):a=[{id:e.id,desc:p}];return a})},e.getFirstSortDir=()=>{var n,i;return((n=(i=e.columnDef.sortDescFirst)!=null?i:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var i,s;const r=e.getFirstSortDir(),o=e.getIsSorted();return o?o!==r&&((i=t.options.enableSortingRemoval)==null||i)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:o==="desc"?"asc":"desc":r},e.getCanSort=()=>{var n,i;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((i=t.options.enableSorting)!=null?i:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,i;return(n=(i=e.columnDef.enableMultiSort)!=null?i:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const i=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return i?i.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,i;return(n=(i=t.getState().sorting)==null?void 0:i.findIndex(s=>s.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(i=>i.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return i=>{n&&(i.persist==null||i.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(i):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,i;e.setSorting(t?[]:(n=(i=e.initialState)==null?void 0:i.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},In=[Bt,fn,ln,an,Kt,Xt,hn,pn,Mn,on,mn,vn,Sn,Cn,dn];function xn(e){var t,n;const i=[...In,...(t=e._features)!=null?t:[]];let s={_features:i};const r=s._features.reduce((g,d)=>Object.assign(g,d.getDefaultOptions==null?void 0:d.getDefaultOptions(s)),{}),o=g=>s.options.mergeOptions?s.options.mergeOptions(r,g):{...r,...g};let l={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(g=>{var d;l=(d=g.getInitialState==null?void 0:g.getInitialState(l))!=null?d:l});const a=[];let c=!1;const p={_features:i,options:{...r,...e},initialState:l,_queue:g=>{a.push(g),c||(c=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();c=!1}).catch(d=>setTimeout(()=>{throw d})))},reset:()=>{s.setState(s.initialState)},setOptions:g=>{const d=H(g,s.options);s.options=o(d)},getState:()=>s.options.state,setState:g=>{s.options.onStateChange==null||s.options.onStateChange(g)},_getRowId:(g,d,h)=>{var f;return(f=s.options.getRowId==null?void 0:s.options.getRowId(g,d,h))!=null?f:`${h?[h.id,d].join("."):d}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(g,d)=>{let h=(d?s.getPrePaginationRowModel():s.getRowModel()).rowsById[g];if(!h&&(h=s.getCoreRowModel().rowsById[g],!h))throw new Error;return h},_getDefaultColumnDef:v(()=>[s.options.defaultColumn],g=>{var d;return g=(d=g)!=null?d:{},{header:h=>{const f=h.header.column.columnDef;return f.accessorKey?f.accessorKey:f.accessorFn?f.id:null},cell:h=>{var f,C;return(f=(C=h.renderValue())==null||C.toString==null?void 0:C.toString())!=null?f:null},...s._features.reduce((h,f)=>Object.assign(h,f.getDefaultColumnDef==null?void 0:f.getDefaultColumnDef()),{}),...g}},S(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:v(()=>[s._getColumnDefs()],g=>{const d=function(h,f,C){return C===void 0&&(C=0),h.map(m=>{const R=kt(s,m,C,f),y=m;return R.columns=y.columns?d(y.columns,R,C+1):[],R})};return d(g)},S(e,"debugColumns")),getAllFlatColumns:v(()=>[s.getAllColumns()],g=>g.flatMap(d=>d.getFlatColumns()),S(e,"debugColumns")),_getAllFlatColumnsById:v(()=>[s.getAllFlatColumns()],g=>g.reduce((d,h)=>(d[h.id]=h,d),{}),S(e,"debugColumns")),getAllLeafColumns:v(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(g,d)=>{let h=g.flatMap(f=>f.getLeafColumns());return d(h)},S(e,"debugColumns")),getColumn:g=>s._getAllFlatColumnsById()[g]};Object.assign(s,p);for(let g=0;g<s._features.length;g++){const d=s._features[g];d==null||d.createTable==null||d.createTable(s)}return s}function Tn(){return e=>v(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},i=function(s,r,o){r===void 0&&(r=0);const u=[];for(let a=0;a<s.length;a++){const c=Nt(e,e._getRowId(s[a],a,o),s[a],a,r,void 0,o?.id);if(n.flatRows.push(c),n.rowsById[c.id]=c,u.push(c),e.options.getSubRows){var l;c.originalSubRows=e.options.getSubRows(s[a],a),(l=c.originalSubRows)!=null&&l.length&&(c.subRows=i(c.originalSubRows,r+1,c))}}return u};return n.rows=i(t),n},S(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function zn(e,t){return e?$n(e)?w.createElement(e,t):e:null}function $n(e){return On(e)||typeof e=="function"||En(e)}function On(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function En(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function qn(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=w.useState(()=>({current:xn(t)})),[i,s]=w.useState(()=>n.current.initialState);return n.current.setOptions(r=>({...r,...e,state:{...i,...e.state},onStateChange:o=>{s(o),e.onStateChange==null||e.onStateChange(o)}})),n.current}export{An as Q,ee as a,bn as b,Hn as c,qn as d,Gn as e,zn as f,Tn as g,Ln as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./radix-ui-DIWAxjEp.js";import{L as C,r as o}from"./react-vendor-CNOkPC89.js";import{B as w,c as v,b as x,w as A,b1 as E,C as b,i as f,j as g,Y as j,a as N,m as h,b2 as _,b3 as D,I as B,b4 as L}from"./index-PWMOllOf.js";import{D as U,y as z,aB as $,q as Q,E as q,v as G,a0 as V,b as Y,aC as F,ai as J}from"./icons-Dk2sL3Mr.js";import"./tanstack-Hn82hibe.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";const W={new:"New",stable:"Stable",planned:"Planned"},H={new:"border-blue-200 bg-blue-50 text-blue-700 dark:border-blue-900/50 dark:bg-blue-900/20 dark:text-blue-300",stable:"border-green-200 bg-green-50 text-green-700 dark:border-green-900/50 dark:bg-green-900/20 dark:text-green-300",planned:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900/50 dark:bg-amber-900/20 dark:text-amber-300"};function K({status:s,className:a}){return e.jsx(w,{variant:"outline",className:v("font-medium",H[s],a),children:W[s]})}const I="ccs:updates:notice-progress:v1";function X(s){return s==="new"?"new":"seen"}function m(s,a){return a[s.id]??X(s.status)}function S(s){return s!=="done"&&s!=="dismissed"}function Z(){if(typeof window>"u")return{};try{const s=window.localStorage.getItem(I);if(!s)return{};const a=JSON.parse(s);if(!a||typeof a!="object"||Array.isArray(a))return{};const l={};for(const[d,t]of Object.entries(a))typeof d=="string"&&(t==="new"||t==="seen"||t==="done"||t==="dismissed")&&(l[d]=t);return l}catch{return{}}}function ee(s){typeof window>"u"||window.localStorage.setItem(I,JSON.stringify(s))}const se={new:{label:"Needs Action",className:"border-amber-300/70 bg-amber-100/70 text-amber-800 dark:border-amber-500/40 dark:bg-amber-500/15 dark:text-amber-300",showDot:!0},seen:{label:"In Review",className:"border-blue-300/70 bg-blue-100/70 text-blue-800 dark:border-blue-500/40 dark:bg-blue-500/15 dark:text-blue-300"},done:{label:"Done",className:"border-emerald-300/70 bg-emerald-100/70 text-emerald-800 dark:border-emerald-500/40 dark:bg-emerald-500/15 dark:text-emerald-300"},dismissed:{label:"Dismissed",className:"border-muted-foreground/20 bg-muted text-muted-foreground dark:border-muted-foreground/30"}};function M({state:s,className:a}){const l=se[s];return e.jsxs(w,{variant:"outline",className:v("gap-1.5 border text-[10px] font-medium",l.className,a),children:[l.showDot&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}),l.label]})}function re({action:s}){return e.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 space-y-0.5",children:[e.jsx("p",{className:"text-sm font-medium",children:s.label}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.description})]}),s.type==="route"&&s.path&&e.jsx(x,{size:"sm",asChild:!0,children:e.jsxs(C,{to:s.path,children:["Open",e.jsx(U,{className:"h-3.5 w-3.5"})]})})]}),s.type==="command"&&s.command&&e.jsxs("div",{className:"mt-2 flex items-center gap-2 rounded-md border bg-background px-2 py-1.5",children:[e.jsx(z,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("code",{className:"min-w-0 flex-1 truncate text-[11px]",children:s.command}),e.jsx(A,{value:s.command})]})]})}function ae({notice:s,progress:a,relatedEntries:l,onUpdateProgress:d}){return s?e.jsxs("div",{className:"flex-1 min-w-0 bg-background grid grid-rows-[auto_minmax(0,1fr)] overflow-hidden",children:[e.jsxs("div",{className:"border-b bg-background px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("h2",{className:"text-base font-semibold leading-tight",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.summary})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[a&&e.jsx(M,{state:a}),e.jsx(K,{status:s.status})]})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsx($,{className:"h-3.5 w-3.5"}),e.jsxs("span",{children:["Published ",E(s.publishedAt)]})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsxs(x,{size:"sm",onClick:()=>d("done"),children:[e.jsx(Q,{className:"h-4 w-4"}),"Mark done"]}),e.jsxs(x,{size:"sm",variant:"outline",onClick:()=>d("dismissed"),children:[e.jsx(q,{className:"h-4 w-4"}),"Dismiss"]}),e.jsxs(x,{size:"sm",variant:"ghost",onClick:()=>d("new"),children:[e.jsx(G,{className:"h-4 w-4"}),"Reopen"]})]})]}),e.jsx("div",{className:"min-h-0 p-4",children:e.jsxs("div",{className:"grid h-full gap-4 xl:grid-cols-[minmax(0,1.5fr)_minmax(320px,1fr)] overflow-hidden",children:[e.jsxs(b,{className:"h-full overflow-hidden",children:[e.jsxs(f,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-4 w-4 text-primary"}),e.jsx(g,{className:"text-base",children:"Do Next"})]}),e.jsx(j,{children:s.primaryAction})]}),e.jsx(N,{className:"min-h-0",children:e.jsx(h,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-3",children:s.actions.map(t=>e.jsx(re,{action:t},`${s.id}-${t.id}`))})})})]}),e.jsxs("div",{className:"grid h-full grid-rows-[minmax(0,1fr)_minmax(0,1fr)] gap-4 overflow-hidden",children:[e.jsxs(b,{className:"overflow-hidden",children:[e.jsxs(f,{className:"pb-3",children:[e.jsx(g,{className:"text-base",children:"Impacted Integrations"}),e.jsx(j,{children:"Related areas based on update scope and routing."})]}),e.jsx(N,{className:"min-h-0",children:e.jsx(h,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-2",children:l.map(t=>e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("p",{className:"min-w-0 truncate text-sm font-medium",children:t.name}),e.jsx(w,{variant:"outline",className:"h-5 px-1.5 text-[10px]",children:_[t.scope]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[t.routes[0]&&e.jsx(x,{size:"sm",variant:"outline",asChild:!0,children:e.jsx(C,{to:t.routes[0].path,children:t.routes[0].label})}),t.commands[0]&&e.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-1.5",children:[e.jsx("code",{className:"truncate rounded bg-background px-1.5 py-0.5 text-[11px]",children:t.commands[0]}),e.jsx(A,{value:t.commands[0]})]})]})]},t.id))})})})]}),e.jsxs(b,{className:"overflow-hidden",children:[e.jsxs(f,{className:"pb-3",children:[e.jsx(g,{className:"text-base",children:"Why It Matters"}),e.jsx(j,{children:"Short context only, no wall-of-text release notes."})]}),e.jsx(N,{className:"min-h-0",children:e.jsx(h,{className:"h-full pr-2",children:e.jsx("ul",{className:"space-y-2 text-sm text-muted-foreground",children:s.highlights.map(t=>e.jsxs("li",{children:["- ",t]},`${s.id}-${t}`))})})})]})]})]})})]}):e.jsx("div",{className:"flex h-full items-center justify-center rounded-lg border border-dashed bg-muted/20 p-6",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"No updates available."})})}function te({notice:s,progress:a,selected:l,onSelect:d}){return e.jsxs("button",{type:"button",onClick:d,className:v("w-full rounded-lg border px-3 py-3 text-left transition-colors",l?"border-primary/30 bg-primary/10":"border-transparent bg-background/40 hover:border-border hover:bg-muted/70"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:s.title}),e.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:s.primaryAction})]}),e.jsx(Y,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"})]}),e.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground",children:E(s.publishedAt)}),e.jsx(M,{state:a})]})]})}const de=[{id:"inbox",label:"Action Required"},{id:"done",label:"Done"},{id:"all",label:"All"}];function le(s,a){return a?[s.title,s.summary,s.primaryAction,...s.highlights,...s.commands,...s.actions.map(d=>`${d.label} ${d.description} ${d.command||""}`),...s.routes.map(d=>d.label)].join(" ").toLowerCase().includes(a):!0}function fe(){const s=o.useMemo(()=>[...D].sort((r,n)=>n.publishedAt.localeCompare(r.publishedAt)),[]),[a,l]=o.useState("inbox"),[d,t]=o.useState(""),[i,y]=o.useState(()=>Z()),[k,P]=o.useState(null);o.useEffect(()=>{ee(i)},[i]);const u=o.useMemo(()=>{const r=d.trim().toLowerCase();return s.filter(n=>{const p=m(n,i);return le(n,r)?a==="done"?p==="done":a==="inbox"?S(p):!0:!1})},[s,i,d,a]),c=o.useMemo(()=>{const r=a==="all"?s:u;return r.find(n=>n.id===k)??r[0]??null},[s,k,a,u]),O=r=>{P(r.id),y(n=>m(r,n)!=="new"?n:{...n,[r.id]:"seen"})},R=o.useMemo(()=>s.filter(r=>S(m(r,i))).length,[s,i]),T=o.useMemo(()=>s.filter(r=>m(r,i)==="done").length,[s,i]);return e.jsxs("div",{className:"h-[calc(100vh-100px)] flex overflow-hidden",children:[e.jsxs("div",{className:"w-80 border-r bg-muted/30 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:"Updates Inbox"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Focus on actions, then mark updates done or dismissed."})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:"Needs Action"}),e.jsx("p",{className:"text-base font-semibold",children:R})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:"Done"}),e.jsx("p",{className:"text-base font-semibold",children:T})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(J,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(B,{value:d,onChange:r=>t(r.target.value),placeholder:"Search actions or commands",className:"h-9 pl-8"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:de.map(r=>e.jsx(x,{size:"sm",variant:a===r.id?"default":"outline",onClick:()=>l(r.id),children:r.label},r.id))})]}),e.jsx(h,{className:"flex-1",children:e.jsx("div",{className:"space-y-2 p-2",children:u.length===0?e.jsx("div",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground",children:"No notices match this view."}):u.map(r=>e.jsx(te,{notice:r,progress:m(r,i),selected:c?.id===r.id,onSelect:()=>O(r)},r.id))})})]}),e.jsx(ae,{notice:c,progress:c?m(c,i):null,relatedEntries:c?L(c):[],onUpdateProgress:r=>{c&&y(n=>({...n,[c.id]:r}))}})]})}export{fe as UpdatesPage};
|