将 Markdown 编辑器替换为 TipTap WYSIWYG,新增帖子修订记录与 diff 展示;首页支持最新/回复排序与本地缓存;后台可配置编辑时限与锁定帖子;侧边栏整合板块导航并优化 Feed 布局。 Co-authored-by: Cursor <cursoragent@cursor.com>
3 lines
89 KiB
JavaScript
3 lines
89 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomePage-DGnsX5Gb.js","assets/react-vendor-CFzzFOsg.js","assets/virtual-vendor-DQlhmwRh.js","assets/badge-e5OBoJ6g.js","assets/PinnedIcon-CWAQCHB6.js","assets/ui-vendor-DGgNN2YO.js","assets/content-BrFHUpp8.js","assets/feedCache-D2GnU_BI.js","assets/PostDetailPage-Dr1Cbngv.js","assets/postContent-D-mW2yDF.js","assets/markdown-vendor-DxR1h-Bq.js","assets/LoginPage-DD0h8vBo.js","assets/form-xbbJUieP.js","assets/input-CIPYpxcv.js","assets/RegisterPage-DxlIbwrc.js","assets/ComposePage-BFRWOfPd.js","assets/BoardsManagePage-CQfZWFTe.js","assets/alert-dialog-Q1fPYDxo.js","assets/ProfilePage-CGuBSp7z.js","assets/FavoritesPage-rCUA1Lp6.js","assets/AdminDashboardPage-BPcWHcOy.js","assets/AdminPostsPage-D3j3Buvt.js","assets/AdminCommentsPage-DgkfVIER.js","assets/AdminUsersPage-C9r9nOl4.js","assets/AdminSettingsPage-DXmt4ZWZ.js"])))=>i.map(i=>d[i]);
|
||
var Cs=Object.defineProperty;var _s=(e,s,t)=>s in e?Cs(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t;var dt=(e,s,t)=>_s(e,typeof s!="symbol"?s+"":s,t);import{r as b,j as o,e as Ue,g as Et,i as Tt,O as Ct,k as u,m as Ps,N as Rs,B as zs,n as As,p as G,q as ut,t as Is}from"./react-vendor-CFzzFOsg.js";import{S as _t,C as Os,a as Pt,P as Ds,b as Rt,I as zt,c as At,d as It,e as Ms,R as Ot,f as Ls,L as Dt,g as Mt,h as Bs,T as $s,i as Fs,M as Vs,F as Gs,H as Us,j as Ws,k as Lt,l as Hs,m as Ys,n as qs,o as Ks,p as Bt,A as Js,q as Xs,r as Qs,s as Zs,U as eo,t as to,u as so}from"./ui-vendor-DGgNN2YO.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const n of l.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&r(n)}).observe(document,{childList:!0,subtree:!0});function t(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=t(i);fetch(i.href,l)}})();const $t="j13-theme";function Ft(){return localStorage.getItem($t)==="dark"?"dark":"light"}function Vt(e){const s=document.documentElement;s.classList.toggle("dark",e==="dark"),s.style.colorScheme=e,localStorage.setItem($t,e)}const oo="modulepreload",ro=function(e){return"/"+e},mt={},se=function(s,t,r){let i=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const n=document.querySelector("meta[property=csp-nonce]"),d=(n==null?void 0:n.nonce)||(n==null?void 0:n.getAttribute("nonce"));i=Promise.allSettled(t.map(m=>{if(m=ro(m),m in mt)return;mt[m]=!0;const c=m.endsWith(".css"),y=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${y}`))return;const a=document.createElement("link");if(a.rel=c?"stylesheet":oo,c||(a.as="script"),a.crossOrigin="",a.href=m,d&&a.setAttribute("nonce",d),document.head.appendChild(a),c)return new Promise((E,C)=>{a.addEventListener("load",E),a.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${m}`)))})}))}function l(n){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=n,window.dispatchEvent(d),!d.defaultPrevented)throw n}return i.then(n=>{for(const d of n||[])d.status==="rejected"&&l(d.reason);return s().catch(l)})},ao="";async function k(e,s={}){const t=await fetch(ao+e,{credentials:"same-origin",...s,headers:{...s.body instanceof FormData?{}:{"Content-Type":"application/json"},...s.headers}});let r;try{r=await t.json()}catch{throw new Error("服务器响应异常")}if(!t.ok)throw new Error(r.error||"请求失败");return r}const ye={me:()=>k("/api/me"),stats:()=>k("/api/stats"),boards:()=>k("/api/boards"),posts:e=>{const s=new URLSearchParams(e).toString();return k(`/api/posts?${s}`)},hotPosts:()=>k("/api/posts/hot"),post:e=>k(`/api/posts/${e}`),comments:(e,s)=>{const t=s!=null&&s.length?`?my_ids=${s.join(",")}`:"";return k(`/api/posts/${e}/comments${t}`)},notifications:()=>k("/api/notifications"),online:()=>k("/api/online"),presence:()=>k("/api/presence",{method:"POST"}),favorites:()=>k("/api/favorites"),createBoard:e=>k("/api/admin/boards",{method:"POST",body:JSON.stringify(e)}),updateBoard:(e,s)=>k(`/api/admin/boards/${e}`,{method:"PUT",body:JSON.stringify(s)}),deleteBoard:e=>k(`/api/admin/boards/${e}`,{method:"DELETE"}),adminDashboard:()=>k("/api/admin/dashboard"),adminSettings:()=>k("/api/admin/settings"),adminPosts:e=>{const s=new URLSearchParams;e.page&&s.set("page",String(e.page)),e.keyword&&s.set("keyword",e.keyword);const t=s.toString();return k(`/api/admin/posts${t?`?${t}`:""}`)},adminPinPost:(e,s)=>k(`/api/admin/posts/${e}/pin`,{method:"POST",body:JSON.stringify({pinned:s})}),adminLockPost:(e,s)=>k(`/api/admin/posts/${e}/lock`,{method:"POST",body:JSON.stringify({locked:s})}),adminUpdateForumSettings:e=>k("/api/admin/settings/forum",{method:"PUT",body:JSON.stringify(e)}),postRevisions:e=>k(`/api/posts/${e}/revisions`),postRevision:(e,s)=>k(`/api/posts/${e}/revisions/${s}`),adminDeletePost:e=>k(`/api/admin/posts/${e}`,{method:"DELETE"}),adminComments:(e=1)=>k(`/api/admin/comments?page=${e}`),adminDeleteComment:e=>k(`/api/admin/comments/${e}`,{method:"DELETE"}),adminUsers:(e=1)=>k(`/api/admin/users?page=${e}`),adminBanUser:(e,s)=>k(`/api/admin/users/${e}/ban`,{method:"POST",body:JSON.stringify({banned:s})}),adminBackup:()=>k("/api/admin/backup",{method:"POST"}),updateNickname:e=>{const s=new FormData;return s.append("nickname",e),k("/api/profile/nickname",{method:"POST",body:s,headers:{}})},updatePassword:(e,s)=>{const t=new FormData;return t.append("old_password",e),t.append("new_password",s),k("/api/profile/password",{method:"POST",body:t,headers:{}})},uploadAvatar:e=>{const s=new FormData;return s.append("avatar",e),k("/api/profile/avatar",{method:"POST",body:s,headers:{}})},createPost:e=>{const s=new FormData;return s.append("board_id",e.board_id),s.append("title",e.title),s.append("content",e.content),s.append("tags",e.tags||""),k("/api/posts",{method:"POST",body:s,headers:{}})},updatePost:(e,s)=>{const t=new FormData;return t.append("title",s.title),t.append("content",s.content),t.append("tags",s.tags||""),k(`/api/posts/${e}`,{method:"PUT",body:t,headers:{}})},login:(e,s)=>{const t=new FormData;return t.append("username",e),t.append("password",s),k("/api/login",{method:"POST",body:t,headers:{}})},register:(e,s,t)=>{const r=new FormData;return r.append("username",e),r.append("password",s),r.append("nickname",t),k("/api/register",{method:"POST",body:r,headers:{}})},logout:()=>k("/api/logout",{method:"POST"}),like:e=>k(`/api/posts/${e}/like`,{method:"POST"}),favorite:e=>k(`/api/posts/${e}/favorite`,{method:"POST"}),addComment:(e,s)=>{const t=new FormData;return t.append("content",s.content),s.replyTo&&t.append("reply_to",String(s.replyTo)),s.guestNick&&t.append("guest_nick",s.guestNick),s.guestEmail&&t.append("guest_email",s.guestEmail),s.guestUrl&&t.append("guest_url",s.guestUrl),s.isPrivate&&t.append("is_private","1"),k(`/api/posts/${e}/comments`,{method:"POST",body:t,headers:{}})},ping:()=>k("/api/ping",{method:"POST"})},Gt=b.createContext({user:null,loading:!0,refresh:async()=>{},logout:async()=>{}});function no({children:e}){const[s,t]=b.useState(null),[r,i]=b.useState(!0),l=b.useCallback(async()=>{try{const d=await ye.me();t(d.user??null)}catch{t(null)}finally{i(!1)}},[]);b.useEffect(()=>{l()},[l]);const n=async()=>{await ye.logout(),t(null)};return o.jsx(Gt.Provider,{value:{user:s,loading:r,refresh:l,logout:n},children:e})}const We=()=>b.useContext(Gt),Ut=b.createContext({theme:"light",toggle:()=>{}});function io({children:e}){const[s,t]=b.useState(Ft);b.useLayoutEffect(()=>{Vt(s)},[s]);const r=()=>t(i=>i==="light"?"dark":"light");return o.jsx(Ut.Provider,{value:{theme:s,toggle:r},children:e})}const Wt=()=>b.useContext(Ut);function lo(e){const[s,t]=b.useState(()=>window.matchMedia(e).matches);return b.useLayoutEffect(()=>{const r=window.matchMedia(e),i=()=>t(r.matches);return r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[e]),s}function xe(){return o.jsxs("div",{className:"page-loader",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"page-loader__dot"}),"加载中…"]})}function Ht(e){var s,t,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(s=0;s<i;s++)e[s]&&(t=Ht(e[s]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Yt(){for(var e,s,t=0,r="",i=arguments.length;t<i;t++)(e=arguments[t])&&(s=Ht(e))&&(r&&(r+=" "),r+=s);return r}const co=(e,s)=>{const t=new Array(e.length+s.length);for(let r=0;r<e.length;r++)t[r]=e[r];for(let r=0;r<s.length;r++)t[e.length+r]=s[r];return t},uo=(e,s)=>({classGroupId:e,validator:s}),qt=(e=new Map,s=null,t)=>({nextPart:e,validators:s,classGroupId:t}),Ve="-",pt=[],mo="arbitrary..",po=e=>{const s=ho(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:n=>{if(n.startsWith("[")&&n.endsWith("]"))return fo(n);const d=n.split(Ve),m=d[0]===""&&d.length>1?1:0;return Kt(d,m,s)},getConflictingClassGroupIds:(n,d)=>{if(d){const m=r[n],c=t[n];return m?c?co(c,m):m:c||pt}return t[n]||pt}}},Kt=(e,s,t)=>{if(e.length-s===0)return t.classGroupId;const i=e[s],l=t.nextPart.get(i);if(l){const c=Kt(e,s+1,l);if(c)return c}const n=t.validators;if(n===null)return;const d=s===0?e.join(Ve):e.slice(s).join(Ve),m=n.length;for(let c=0;c<m;c++){const y=n[c];if(y.validator(d))return y.classGroupId}},fo=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const s=e.slice(1,-1),t=s.indexOf(":"),r=s.slice(0,t);return r?mo+r:void 0})(),ho=e=>{const{theme:s,classGroups:t}=e;return go(t,s)},go=(e,s)=>{const t=qt();for(const r in e){const i=e[r];Ze(i,t,r,s)}return t},Ze=(e,s,t,r)=>{const i=e.length;for(let l=0;l<i;l++){const n=e[l];bo(n,s,t,r)}},bo=(e,s,t,r)=>{if(typeof e=="string"){xo(e,s,t);return}if(typeof e=="function"){yo(e,s,t,r);return}vo(e,s,t,r)},xo=(e,s,t)=>{const r=e===""?s:Jt(s,e);r.classGroupId=t},yo=(e,s,t,r)=>{if(wo(e)){Ze(e(r),s,t,r);return}s.validators===null&&(s.validators=[]),s.validators.push(uo(t,e))},vo=(e,s,t,r)=>{const i=Object.entries(e),l=i.length;for(let n=0;n<l;n++){const[d,m]=i[n];Ze(m,Jt(s,d),t,r)}},Jt=(e,s)=>{let t=e;const r=s.split(Ve),i=r.length;for(let l=0;l<i;l++){const n=r[l];let d=t.nextPart.get(n);d||(d=qt(),t.nextPart.set(n,d)),t=d}return t},wo=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,ko=e=>{if(e<1)return{get:()=>{},set:()=>{}};let s=0,t=Object.create(null),r=Object.create(null);const i=(l,n)=>{t[l]=n,s++,s>e&&(s=0,r=t,t=Object.create(null))};return{get(l){let n=t[l];if(n!==void 0)return n;if((n=r[l])!==void 0)return i(l,n),n},set(l,n){l in t?t[l]=n:i(l,n)}}},Je="!",ft=":",jo=[],ht=(e,s,t,r,i)=>({modifiers:e,hasImportantModifier:s,baseClassName:t,maybePostfixModifierPosition:r,isExternal:i}),So=e=>{const{prefix:s,experimentalParseClassName:t}=e;let r=i=>{const l=[];let n=0,d=0,m=0,c;const y=i.length;for(let O=0;O<y;O++){const I=i[O];if(n===0&&d===0){if(I===ft){l.push(i.slice(m,O)),m=O+1;continue}if(I==="/"){c=O;continue}}I==="["?n++:I==="]"?n--:I==="("?d++:I===")"&&d--}const a=l.length===0?i:i.slice(m);let E=a,C=!1;a.endsWith(Je)?(E=a.slice(0,-1),C=!0):a.startsWith(Je)&&(E=a.slice(1),C=!0);const P=c&&c>m?c-m:void 0;return ht(l,C,E,P)};if(s){const i=s+ft,l=r;r=n=>n.startsWith(i)?l(n.slice(i.length)):ht(jo,!1,n,void 0,!0)}if(t){const i=r;r=l=>t({className:l,parseClassName:i})}return r},No=e=>{const s=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{s.set(t,1e6+r)}),t=>{const r=[];let i=[];for(let l=0;l<t.length;l++){const n=t[l],d=n[0]==="[",m=s.has(n);d||m?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(n)):i.push(n)}return i.length>0&&(i.sort(),r.push(...i)),r}},Eo=e=>({cache:ko(e.cacheSize),parseClassName:So(e),sortModifiers:No(e),postfixLookupClassGroupIds:To(e),...po(e)}),To=e=>{const s=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let r=0;r<t.length;r++)s[t[r]]=!0;return s},Co=/\s+/,_o=(e,s)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:l,postfixLookupClassGroupIds:n}=s,d=[],m=e.trim().split(Co);let c="";for(let y=m.length-1;y>=0;y-=1){const a=m[y],{isExternal:E,modifiers:C,hasImportantModifier:P,baseClassName:O,maybePostfixModifierPosition:I}=t(a);if(E){c=a+(c.length>0?" "+c:c);continue}let N=!!I,L;if(N){const D=O.substring(0,I);L=r(D);const p=L&&n[L]?r(O):void 0;p&&p!==L&&(L=p,N=!1)}else L=r(O);if(!L){if(!N){c=a+(c.length>0?" "+c:c);continue}if(L=r(O),!L){c=a+(c.length>0?" "+c:c);continue}N=!1}const q=C.length===0?"":C.length===1?C[0]:l(C).join(":"),Z=P?q+Je:q,oe=Z+L;if(d.indexOf(oe)>-1)continue;d.push(oe);const B=i(L,N);for(let D=0;D<B.length;++D){const p=B[D];d.push(Z+p)}c=a+(c.length>0?" "+c:c)}return c},Po=(...e)=>{let s=0,t,r,i="";for(;s<e.length;)(t=e[s++])&&(r=Xt(t))&&(i&&(i+=" "),i+=r);return i},Xt=e=>{if(typeof e=="string")return e;let s,t="";for(let r=0;r<e.length;r++)e[r]&&(s=Xt(e[r]))&&(t&&(t+=" "),t+=s);return t},Ro=(e,...s)=>{let t,r,i,l;const n=m=>{const c=s.reduce((y,a)=>a(y),e());return t=Eo(c),r=t.cache.get,i=t.cache.set,l=d,d(m)},d=m=>{const c=r(m);if(c)return c;const y=_o(m,t);return i(m,y),y};return l=n,(...m)=>l(Po(...m))},zo=[],$=e=>{const s=t=>t[e]||zo;return s.isThemeGetter=!0,s},Qt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Zt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ao=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Io=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Oo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Do=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Mo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Lo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ke=e=>Ao.test(e),j=e=>!!e&&!Number.isNaN(Number(e)),pe=e=>!!e&&Number.isInteger(Number(e)),qe=e=>e.endsWith("%")&&j(e.slice(0,-1)),be=e=>Io.test(e),es=()=>!0,Bo=e=>Oo.test(e)&&!Do.test(e),et=()=>!1,$o=e=>Mo.test(e),Fo=e=>Lo.test(e),Vo=e=>!h(e)&&!g(e),Go=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Uo=e=>je(e,os,et),h=e=>Qt.test(e),Te=e=>je(e,rs,Bo),gt=e=>je(e,Qo,j),Wo=e=>je(e,ns,es),Ho=e=>je(e,as,et),bt=e=>je(e,ts,et),Yo=e=>je(e,ss,Fo),Be=e=>je(e,is,$o),g=e=>Zt.test(e),Ie=e=>Ce(e,rs),qo=e=>Ce(e,as),xt=e=>Ce(e,ts),Ko=e=>Ce(e,os),Jo=e=>Ce(e,ss),$e=e=>Ce(e,is,!0),Xo=e=>Ce(e,ns,!0),je=(e,s,t)=>{const r=Qt.exec(e);return r?r[1]?s(r[1]):t(r[2]):!1},Ce=(e,s,t=!1)=>{const r=Zt.exec(e);return r?r[1]?s(r[1]):t:!1},ts=e=>e==="position"||e==="percentage",ss=e=>e==="image"||e==="url",os=e=>e==="length"||e==="size"||e==="bg-size",rs=e=>e==="length",Qo=e=>e==="number",as=e=>e==="family-name",ns=e=>e==="number"||e==="weight",is=e=>e==="shadow",Zo=()=>{const e=$("color"),s=$("font"),t=$("text"),r=$("font-weight"),i=$("tracking"),l=$("leading"),n=$("breakpoint"),d=$("container"),m=$("spacing"),c=$("radius"),y=$("shadow"),a=$("inset-shadow"),E=$("text-shadow"),C=$("drop-shadow"),P=$("blur"),O=$("perspective"),I=$("aspect"),N=$("ease"),L=$("animate"),q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],oe=()=>[...Z(),g,h],B=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],p=()=>[g,h,m],M=()=>[ke,"full","auto",...p()],de=()=>[pe,"none","subgrid",g,h],ae=()=>["auto",{span:["full",pe,g,h]},pe,g,h],K=()=>[pe,"auto",g,h],H=()=>["auto","min","max","fr",g,h],ue=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],v=()=>["auto",...p()],x=()=>[ke,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...p()],F=()=>[ke,"screen","full","dvw","lvw","svw","min","max","fit",...p()],J=()=>[ke,"screen","full","lh","dvh","lvh","svh","min","max","fit",...p()],f=()=>[e,g,h],me=()=>[...Z(),xt,bt,{position:[g,h]}],Se=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",Ko,Uo,{size:[g,h]}],z=()=>[qe,Ie,Te],S=()=>["","none","full",c,g,h],_=()=>["",j,Ie,Te],ne=()=>["solid","dashed","dotted","double"],R=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>[j,qe,xt,bt],Ne=()=>["","none",P,g,h],he=()=>["none",j,g,h],ie=()=>["none",j,g,h],ze=()=>[j,g,h],ve=()=>[ke,"full",...p()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[be],breakpoint:[be],color:[es],container:[be],"drop-shadow":[be],ease:["in","out","in-out"],font:[Vo],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[be],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[be],shadow:[be],spacing:["px",j],text:[be],"text-shadow":[be],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ke,h,g,I]}],container:["container"],"container-type":[{"@container":["","normal","size",g,h]}],"container-named":[Go],columns:[{columns:[j,h,g,d]}],"break-after":[{"break-after":q()}],"break-before":[{"break-before":q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:oe()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[pe,"auto",g,h]}],basis:[{basis:[ke,"full","auto",d,...p()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[j,ke,"auto","initial","none",h]}],grow:[{grow:["",j,g,h]}],shrink:[{shrink:["",j,g,h]}],order:[{order:[pe,"first","last","none",g,h]}],"grid-cols":[{"grid-cols":de()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":de()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:p()}],"gap-x":[{"gap-x":p()}],"gap-y":[{"gap-y":p()}],"justify-content":[{justify:[...ue(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...ue()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":ue()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:p()}],px:[{px:p()}],py:[{py:p()}],ps:[{ps:p()}],pe:[{pe:p()}],pbs:[{pbs:p()}],pbe:[{pbe:p()}],pt:[{pt:p()}],pr:[{pr:p()}],pb:[{pb:p()}],pl:[{pl:p()}],m:[{m:v()}],mx:[{mx:v()}],my:[{my:v()}],ms:[{ms:v()}],me:[{me:v()}],mbs:[{mbs:v()}],mbe:[{mbe:v()}],mt:[{mt:v()}],mr:[{mr:v()}],mb:[{mb:v()}],ml:[{ml:v()}],"space-x":[{"space-x":p()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":p()}],"space-y-reverse":["space-y-reverse"],size:[{size:x()}],"inline-size":[{inline:["auto",...F()]}],"min-inline-size":[{"min-inline":["auto",...F()]}],"max-inline-size":[{"max-inline":["none",...F()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[d,"screen",...x()]}],"min-w":[{"min-w":[d,"screen","none",...x()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[n]},...x()]}],h:[{h:["screen","lh",...x()]}],"min-h":[{"min-h":["screen","lh","none",...x()]}],"max-h":[{"max-h":["screen","lh",...x()]}],"font-size":[{text:["base",t,Ie,Te]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Xo,Wo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qe,h]}],"font-family":[{font:[qo,Ho,s]}],"font-features":[{"font-features":[h]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,g,h]}],"line-clamp":[{"line-clamp":[j,"none",g,gt]}],leading:[{leading:[l,...p()]}],"list-image":[{"list-image":["none",g,h]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",g,h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:f()}],"text-color":[{text:f()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[j,"from-font","auto",g,Te]}],"text-decoration-color":[{decoration:f()}],"underline-offset":[{"underline-offset":[j,"auto",g,h]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:p()}],"tab-size":[{tab:[pe,g,h]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",g,h]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",g,h]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:me()}],"bg-repeat":[{bg:Se()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},pe,g,h],radial:["",g,h],conic:[pe,g,h]},Jo,Yo]}],"bg-color":[{bg:f()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:f()}],"gradient-via":[{via:f()}],"gradient-to":[{to:f()}],rounded:[{rounded:S()}],"rounded-s":[{"rounded-s":S()}],"rounded-e":[{"rounded-e":S()}],"rounded-t":[{"rounded-t":S()}],"rounded-r":[{"rounded-r":S()}],"rounded-b":[{"rounded-b":S()}],"rounded-l":[{"rounded-l":S()}],"rounded-ss":[{"rounded-ss":S()}],"rounded-se":[{"rounded-se":S()}],"rounded-ee":[{"rounded-ee":S()}],"rounded-es":[{"rounded-es":S()}],"rounded-tl":[{"rounded-tl":S()}],"rounded-tr":[{"rounded-tr":S()}],"rounded-br":[{"rounded-br":S()}],"rounded-bl":[{"rounded-bl":S()}],"border-w":[{border:_()}],"border-w-x":[{"border-x":_()}],"border-w-y":[{"border-y":_()}],"border-w-s":[{"border-s":_()}],"border-w-e":[{"border-e":_()}],"border-w-bs":[{"border-bs":_()}],"border-w-be":[{"border-be":_()}],"border-w-t":[{"border-t":_()}],"border-w-r":[{"border-r":_()}],"border-w-b":[{"border-b":_()}],"border-w-l":[{"border-l":_()}],"divide-x":[{"divide-x":_()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":_()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:f()}],"border-color-x":[{"border-x":f()}],"border-color-y":[{"border-y":f()}],"border-color-s":[{"border-s":f()}],"border-color-e":[{"border-e":f()}],"border-color-bs":[{"border-bs":f()}],"border-color-be":[{"border-be":f()}],"border-color-t":[{"border-t":f()}],"border-color-r":[{"border-r":f()}],"border-color-b":[{"border-b":f()}],"border-color-l":[{"border-l":f()}],"divide-color":[{divide:f()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[j,g,h]}],"outline-w":[{outline:["",j,Ie,Te]}],"outline-color":[{outline:f()}],shadow:[{shadow:["","none",y,$e,Be]}],"shadow-color":[{shadow:f()}],"inset-shadow":[{"inset-shadow":["none",a,$e,Be]}],"inset-shadow-color":[{"inset-shadow":f()}],"ring-w":[{ring:_()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:f()}],"ring-offset-w":[{"ring-offset":[j,Te]}],"ring-offset-color":[{"ring-offset":f()}],"inset-ring-w":[{"inset-ring":_()}],"inset-ring-color":[{"inset-ring":f()}],"text-shadow":[{"text-shadow":["none",E,$e,Be]}],"text-shadow-color":[{"text-shadow":f()}],opacity:[{opacity:[j,g,h]}],"mix-blend":[{"mix-blend":[...R(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":R()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[j]}],"mask-image-linear-from-pos":[{"mask-linear-from":A()}],"mask-image-linear-to-pos":[{"mask-linear-to":A()}],"mask-image-linear-from-color":[{"mask-linear-from":f()}],"mask-image-linear-to-color":[{"mask-linear-to":f()}],"mask-image-t-from-pos":[{"mask-t-from":A()}],"mask-image-t-to-pos":[{"mask-t-to":A()}],"mask-image-t-from-color":[{"mask-t-from":f()}],"mask-image-t-to-color":[{"mask-t-to":f()}],"mask-image-r-from-pos":[{"mask-r-from":A()}],"mask-image-r-to-pos":[{"mask-r-to":A()}],"mask-image-r-from-color":[{"mask-r-from":f()}],"mask-image-r-to-color":[{"mask-r-to":f()}],"mask-image-b-from-pos":[{"mask-b-from":A()}],"mask-image-b-to-pos":[{"mask-b-to":A()}],"mask-image-b-from-color":[{"mask-b-from":f()}],"mask-image-b-to-color":[{"mask-b-to":f()}],"mask-image-l-from-pos":[{"mask-l-from":A()}],"mask-image-l-to-pos":[{"mask-l-to":A()}],"mask-image-l-from-color":[{"mask-l-from":f()}],"mask-image-l-to-color":[{"mask-l-to":f()}],"mask-image-x-from-pos":[{"mask-x-from":A()}],"mask-image-x-to-pos":[{"mask-x-to":A()}],"mask-image-x-from-color":[{"mask-x-from":f()}],"mask-image-x-to-color":[{"mask-x-to":f()}],"mask-image-y-from-pos":[{"mask-y-from":A()}],"mask-image-y-to-pos":[{"mask-y-to":A()}],"mask-image-y-from-color":[{"mask-y-from":f()}],"mask-image-y-to-color":[{"mask-y-to":f()}],"mask-image-radial":[{"mask-radial":[g,h]}],"mask-image-radial-from-pos":[{"mask-radial-from":A()}],"mask-image-radial-to-pos":[{"mask-radial-to":A()}],"mask-image-radial-from-color":[{"mask-radial-from":f()}],"mask-image-radial-to-color":[{"mask-radial-to":f()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":Z()}],"mask-image-conic-pos":[{"mask-conic":[j]}],"mask-image-conic-from-pos":[{"mask-conic-from":A()}],"mask-image-conic-to-pos":[{"mask-conic-to":A()}],"mask-image-conic-from-color":[{"mask-conic-from":f()}],"mask-image-conic-to-color":[{"mask-conic-to":f()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:me()}],"mask-repeat":[{mask:Se()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",g,h]}],filter:[{filter:["","none",g,h]}],blur:[{blur:Ne()}],brightness:[{brightness:[j,g,h]}],contrast:[{contrast:[j,g,h]}],"drop-shadow":[{"drop-shadow":["","none",C,$e,Be]}],"drop-shadow-color":[{"drop-shadow":f()}],grayscale:[{grayscale:["",j,g,h]}],"hue-rotate":[{"hue-rotate":[j,g,h]}],invert:[{invert:["",j,g,h]}],saturate:[{saturate:[j,g,h]}],sepia:[{sepia:["",j,g,h]}],"backdrop-filter":[{"backdrop-filter":["","none",g,h]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[j,g,h]}],"backdrop-contrast":[{"backdrop-contrast":[j,g,h]}],"backdrop-grayscale":[{"backdrop-grayscale":["",j,g,h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[j,g,h]}],"backdrop-invert":[{"backdrop-invert":["",j,g,h]}],"backdrop-opacity":[{"backdrop-opacity":[j,g,h]}],"backdrop-saturate":[{"backdrop-saturate":[j,g,h]}],"backdrop-sepia":[{"backdrop-sepia":["",j,g,h]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":p()}],"border-spacing-x":[{"border-spacing-x":p()}],"border-spacing-y":[{"border-spacing-y":p()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",g,h]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[j,"initial",g,h]}],ease:[{ease:["linear","initial",N,g,h]}],delay:[{delay:[j,g,h]}],animate:[{animate:["none",L,g,h]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[O,g,h]}],"perspective-origin":[{"perspective-origin":oe()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":["scale-3d"],skew:[{skew:ze()}],"skew-x":[{"skew-x":ze()}],"skew-y":[{"skew-y":ze()}],transform:[{transform:[g,h,"","none","gpu","cpu"]}],"transform-origin":[{origin:oe()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ve()}],"translate-x":[{"translate-x":ve()}],"translate-y":[{"translate-y":ve()}],"translate-z":[{"translate-z":ve()}],"translate-none":["translate-none"],zoom:[{zoom:[pe,g,h]}],accent:[{accent:f()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:f()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",g,h]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":f()}],"scrollbar-track-color":[{"scrollbar-track":f()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":p()}],"scroll-mx":[{"scroll-mx":p()}],"scroll-my":[{"scroll-my":p()}],"scroll-ms":[{"scroll-ms":p()}],"scroll-me":[{"scroll-me":p()}],"scroll-mbs":[{"scroll-mbs":p()}],"scroll-mbe":[{"scroll-mbe":p()}],"scroll-mt":[{"scroll-mt":p()}],"scroll-mr":[{"scroll-mr":p()}],"scroll-mb":[{"scroll-mb":p()}],"scroll-ml":[{"scroll-ml":p()}],"scroll-p":[{"scroll-p":p()}],"scroll-px":[{"scroll-px":p()}],"scroll-py":[{"scroll-py":p()}],"scroll-ps":[{"scroll-ps":p()}],"scroll-pe":[{"scroll-pe":p()}],"scroll-pbs":[{"scroll-pbs":p()}],"scroll-pbe":[{"scroll-pbe":p()}],"scroll-pt":[{"scroll-pt":p()}],"scroll-pr":[{"scroll-pr":p()}],"scroll-pb":[{"scroll-pb":p()}],"scroll-pl":[{"scroll-pl":p()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",g,h]}],fill:[{fill:["none",...f()]}],"stroke-w":[{stroke:[j,Ie,Te,gt]}],stroke:[{stroke:["none",...f()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},er=Ro(Zo);function Q(...e){return er(Yt(e))}const tr=Bs,sr=$s,or=b.forwardRef(({className:e,inset:s,children:t,...r},i)=>o.jsxs(_t,{ref:i,className:Q("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",s&&"pl-8",e),...r,children:[t,o.jsx(Os,{className:"ml-auto"})]}));or.displayName=_t.displayName;const rr=b.forwardRef(({className:e,...s},t)=>o.jsx(Pt,{ref:t,className:Q("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s}));rr.displayName=Pt.displayName;const ls=b.forwardRef(({className:e,sideOffset:s=4,...t},r)=>o.jsx(Ds,{children:o.jsx(Rt,{ref:r,sideOffset:s,className:Q("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));ls.displayName=Rt.displayName;const Oe=b.forwardRef(({className:e,inset:s,...t},r)=>o.jsx(zt,{ref:r,className:Q("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",s&&"pl-8",e),...t}));Oe.displayName=zt.displayName;const ar=b.forwardRef(({className:e,children:s,checked:t,...r},i)=>o.jsxs(At,{ref:i,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:t,...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(It,{children:o.jsx(Ms,{className:"h-4 w-4"})})}),s]}));ar.displayName=At.displayName;const nr=b.forwardRef(({className:e,children:s,...t},r)=>o.jsxs(Ot,{ref:r,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(It,{children:o.jsx(Ls,{className:"h-2 w-2 fill-current"})})}),s]}));nr.displayName=Ot.displayName;const ir=b.forwardRef(({className:e,inset:s,...t},r)=>o.jsx(Dt,{ref:r,className:Q("px-2 py-1.5 text-sm font-semibold",s&&"pl-8",e),...t}));ir.displayName=Dt.displayName;const Xe=b.forwardRef(({className:e,...s},t)=>o.jsx(Mt,{ref:t,className:Q("-mx-1 my-1 h-px bg-muted",e),...s}));Xe.displayName=Mt.displayName;const cs="j13-cache-boards",ds="j13-cache-stats";function us(e){try{const s=sessionStorage.getItem(e);return s?JSON.parse(s):null}catch{return null}}function ms(e,s){try{sessionStorage.setItem(e,JSON.stringify(s))}catch{}}function yt(){return us(cs)??[]}function vt(){return us(ds)}function lr(e){ms(cs,e)}function cr(e){ms(ds,e)}const dr=[{key:"latest",label:"最新发帖",hint:"按发布时间",icon:Fs},{key:"reply",label:"最新回复",hint:"最近有人回复",icon:Vs},{key:"hot",label:"热门讨论",hint:"按互动热度",icon:Gs}];function ps(e){return e==="reply"||e==="hot"?e:"latest"}function Ge(e,s="latest"){const t=new URLSearchParams;e&&t.set("board",String(e)),s!=="latest"&&t.set("sort",s);const r=t.toString();return r?`/?${r}`:"/"}function fa({value:e,onChange:s,postTotal:t}){return o.jsxs("div",{className:"feed-toolbar",children:[o.jsx("div",{className:"feed-sort-bar",role:"tablist","aria-label":"帖子排序",children:dr.map(({key:r,label:i,hint:l,icon:n})=>o.jsxs("button",{type:"button",role:"tab","aria-selected":e===r,title:`${i} · ${l}`,className:Q("feed-sort-tab",e===r&&"active"),onClick:()=>s(r),children:[o.jsx(n,{"aria-hidden":!0}),o.jsx("span",{className:"feed-sort-tab__label",children:i})]},r))}),t!=null&&o.jsxs("span",{className:"feed-toolbar__count",children:["共 ",t," 条"]})]})}const ur=["/post/","/profile"];function fs(e){return ur.some(s=>e.startsWith(s))}function mr(e,s){return fs(e)?null:e.startsWith("/favorites")?"favorites":e.startsWith("/admin")?"admin":s===0?"all":String(s)}function pr({boards:e,activeBoard:s,onSelectBoard:t}){const r=Ue(),i=Et(),[l]=Tt(),n=ps(l.get("sort")),{user:d}=We(),m=(d==null?void 0:d.role)==="admin",c=mr(i.pathname,s),y=(a,E,C,P)=>o.jsxs("button",{type:"button",className:Q("sidebar-nav-item",c!=null&&c===a&&"active"),onClick:P,children:[C,o.jsx("span",{className:"flex-1 truncate",children:E})]},a);return o.jsxs("aside",{className:"sidebar",children:[o.jsx("div",{className:"sidebar-section",children:"浏览"}),o.jsxs("nav",{className:"sidebar-nav",children:[y("all","全部帖子",o.jsx(Us,{}),()=>{t(0),r(Ge(0,n))}),d&&y("favorites","我的收藏",o.jsx(Ws,{}),()=>r("/favorites"))]}),e.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sidebar-section",style:{marginTop:8},children:"板块"}),o.jsx("nav",{className:"sidebar-nav",children:e.map(a=>o.jsx("button",{type:"button",className:Q("sidebar-nav-item",c!=null&&c===String(a.id)&&"active"),onClick:()=>{t(a.id),r(Ge(a.id,n))},children:o.jsx("span",{className:"flex-1 truncate",children:a.name})},a.id))})]}),m&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sidebar-section",style:{marginTop:8},children:"管理"}),o.jsx("nav",{className:"sidebar-nav",children:y("admin","管理后台",o.jsx(Lt,{}),()=>r("/admin/dashboard"))})]})]})}function fr({hot:e,notifications:s,online:t,onPostClick:r}){const i=(e==null?void 0:e.slice(0,8))??[],l=(s==null?void 0:s.slice(0,6))??[],n=(t==null?void 0:t.users)??[];return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"widget-card",children:[o.jsx("div",{className:"widget-card-head",children:"🔥 热门帖子"}),o.jsx("div",{className:"widget-card-body",children:i.length===0?o.jsx("div",{style:{fontSize:13,color:"var(--color-text-3)",padding:"8px 0"},children:"暂无数据"}):i.map((d,m)=>o.jsxs("div",{className:"widget-item",onClick:()=>r(d.id),children:[o.jsx("span",{style:{color:m<3?"#e74c3c":"var(--color-text-3)",fontWeight:600,minWidth:18},children:m+1}),o.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.title})]},d.id))})]}),o.jsxs("div",{className:"widget-card",children:[o.jsx("div",{className:"widget-card-head",children:"📢 最新动态"}),o.jsx("div",{className:"widget-card-body",children:l.length===0?o.jsx("div",{style:{fontSize:13,color:"var(--color-text-3)",padding:"8px 0"},children:"暂无动态"}):l.map(d=>o.jsxs("div",{className:"widget-item",onClick:()=>r(d.id),children:[o.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.title}),o.jsx("span",{style:{fontSize:11,color:"var(--color-text-4)",flexShrink:0},children:d.created_at})]},d.id))})]}),o.jsxs("div",{className:"widget-card",children:[o.jsxs("div",{className:"widget-card-head",children:["👀 当前浏览 ",(t==null?void 0:t.count)??"—"," 人"]}),o.jsxs("div",{className:"widget-card-body",children:[o.jsxs("div",{style:{fontSize:12,color:"var(--color-text-3)",marginBottom:8},children:["会员 ",(t==null?void 0:t.members)??0," · 游客 ",(t==null?void 0:t.guests)??0]}),o.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:[n.map(d=>{var m;return o.jsx("span",{title:d.nickname,style:{width:28,height:28,borderRadius:"50%",background:"var(--j13-green)",color:"#fff",fontSize:12,display:"inline-flex",alignItems:"center",justifyContent:"center"},children:((m=d.nickname)==null?void 0:m[0])||"?"},d.id)}),n.length===0&&o.jsx("span",{style:{fontSize:13,color:"var(--color-text-3)"},children:"暂无会员在线"})]})]})]}),o.jsx("div",{className:"widget-card widget-card--about",children:o.jsx("div",{className:"widget-card-body",children:o.jsxs("p",{className:"widget-about-text",children:[o.jsx("strong",{children:"姜十三论坛"}),"拾三一隅,自在交流。轻量社区,专为小圈子打造。"]})})})]})}function hr(){var v;const{user:e,loading:s,logout:t}=We(),{theme:r,toggle:i}=Wt(),l=lo("(max-width: 768px)"),n=Ue(),d=Et(),[m]=Tt(),c=d.pathname.startsWith("/compose")||/\/post\/\d+\/edit$/.test(d.pathname),[y,a]=b.useState(()=>yt()),[E,C]=b.useState(()=>vt()),[P,O]=b.useState(()=>yt().length>0||!!vt()),[I,N]=b.useState([]),[L,q]=b.useState([]),[Z,oe]=b.useState(null),[B,D]=b.useState(Number(m.get("board"))||0),[p,M]=b.useState(m.get("keyword")||""),de=ps(m.get("sort"));b.useEffect(()=>{D(Number(m.get("board"))||0)},[m]),b.useEffect(()=>{M(m.get("keyword")||"")},[m]);const ae=b.useCallback(()=>{Promise.all([ye.boards().then(x=>{const F=x.boards??[];return a(F),lr(F),F}).catch(()=>[]),ye.stats().then(x=>(C(x),cr(x),x)).catch(()=>null)]).finally(()=>O(!0))},[]),K=b.useCallback(()=>{ye.online().then(x=>{oe({count:x.count??0,members:x.members??0,guests:x.guests??0,users:Array.isArray(x.users)?x.users:[]})}).catch(()=>{})},[]);b.useEffect(()=>{ae(),ye.hotPosts().then(f=>N(Array.isArray(f.posts)?f.posts:[])).catch(()=>{}),ye.notifications().then(f=>q(Array.isArray(f.notifications)?f.notifications:[])).catch(()=>{}),K(),ye.presence().catch(()=>{});const x=setInterval(K,3e4),F=setInterval(()=>ye.presence().catch(()=>{}),6e4),J=()=>ae();return window.addEventListener("boards-refresh",J),()=>{clearInterval(x),clearInterval(F),window.removeEventListener("boards-refresh",J)}},[ae,K]);const H=()=>{p.trim()?n(`/?keyword=${encodeURIComponent(p.trim())}`):n("/")},ue=((v=e==null?void 0:e.nickname)==null?void 0:v.charAt(0))||"?",Y=fs(d.pathname)?-1:B;return o.jsx("div",{className:"app-shell",children:o.jsxs("div",{className:"app-frame",children:[o.jsx("header",{className:"app-header",children:o.jsxs("div",{className:"header-inner",children:[o.jsxs("button",{type:"button",className:"header-brand",onClick:()=>n("/"),children:[o.jsx("span",{className:"header-logo-mark",children:"姜"}),!l&&o.jsx("span",{className:"header-logo-text",children:"姜十三论坛"})]}),!c&&o.jsxs("div",{className:"header-search-wrap",children:[o.jsx(Hs,{className:"header-search-icon",size:16}),o.jsx("input",{className:"header-search-input",type:"search",placeholder:"搜索帖子...",value:p,onChange:x=>M(x.target.value),onKeyDown:x=>x.key==="Enter"&&H()}),p&&o.jsx("button",{type:"button",className:"header-search-clear",onClick:()=>{M(""),n("/")},"aria-label":"清除搜索",children:"×"})]}),o.jsxs("div",{className:"header-actions",children:[!c&&o.jsxs("button",{type:"button",className:"header-compose-btn",onClick:()=>n(e?"/compose":"/login"),children:[o.jsx(Ys,{size:16}),!l&&o.jsx("span",{children:"发帖"})]}),o.jsxs("div",{className:"header-action-group",children:[o.jsx("button",{type:"button",className:"header-icon-btn",onClick:i,title:r==="light"?"切换暗色模式":"切换亮色模式",children:r==="light"?o.jsx(qs,{size:18}):o.jsx(Ks,{size:18})}),s?o.jsx("span",{className:"header-auth-slot header-auth-slot--loading","aria-hidden":!0}):e?o.jsxs(tr,{children:[o.jsx(sr,{asChild:!0,children:o.jsx("button",{type:"button",className:"header-user-btn",title:e.nickname,children:e.avatar?o.jsx("img",{src:e.avatar,alt:"",className:"header-user-avatar"}):o.jsx("span",{className:"header-user-initial",children:ue})})}),o.jsxs(ls,{align:"end",className:"w-40",children:[o.jsx(Oe,{onClick:()=>n("/profile"),children:"个人中心"}),o.jsx(Oe,{onClick:()=>n("/favorites"),children:"我的收藏"}),e.role==="admin"&&o.jsxs(o.Fragment,{children:[o.jsx(Xe,{}),o.jsx(Oe,{onClick:()=>n("/admin/dashboard"),children:"管理后台"})]}),o.jsx(Xe,{}),o.jsx(Oe,{onClick:()=>t().then(()=>n("/login")),children:"退出登录"})]})]}):o.jsx("button",{type:"button",className:"header-login-btn",onClick:()=>n("/login"),children:"登录"})]})]})]})}),o.jsxs("div",{className:`app-body${c?" app-body--compose":""}`,children:[!c&&o.jsx(pr,{boards:y,activeBoard:B,onSelectBoard:D}),o.jsxs("div",{className:`content-workspace${c?" content-workspace--compose":""}`,children:[o.jsxs("main",{className:`main-content${c?" main-content--compose":""}`,children:[l&&!c&&o.jsxs("div",{className:"mobile-board-bar",children:[o.jsx("span",{className:`board-chip ${Y===0?"active":""}`,onClick:()=>{D(0),n(Ge(0,de))},children:"全部"}),y.map(x=>o.jsx("span",{className:`board-chip ${Y===x.id?"active":""}`,onClick:()=>{D(x.id),n(Ge(x.id,de))},children:x.name},x.id))]}),o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx(Ct,{context:{boardId:B,keyword:m.get("keyword")||"",setBoardId:D,boards:y,stats:E,layoutReady:P,refreshBoards:ae,isMobile:l}})})]}),!c&&o.jsx("aside",{className:"aside-panel",children:o.jsx(fr,{hot:I,notifications:L,online:Z,onPostClick:x=>n(`/post/${x}`)})})]})]})]})})}const gr={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-8 w-8"};function br({className:e,size:s="md"}){return o.jsx(Bt,{className:Q("animate-spin text-[var(--j13-green)]",gr[s],e),"aria-label":"加载中"})}function xr(e){if(typeof document>"u")return;let s=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",s.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const yr=e=>{switch(e){case"success":return kr;case"info":return Sr;case"warning":return jr;case"error":return Nr;default:return null}},vr=Array(12).fill(0),wr=({visible:e,className:s})=>u.createElement("div",{className:["sonner-loading-wrapper",s].filter(Boolean).join(" "),"data-visible":e},u.createElement("div",{className:"sonner-spinner"},vr.map((t,r)=>u.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),kr=u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},u.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),jr=u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},u.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Sr=u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},u.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Nr=u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},u.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Er=u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},u.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),u.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Tr=()=>{const[e,s]=u.useState(document.hidden);return u.useEffect(()=>{const t=()=>{s(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),e};let Qe=1;class Cr{constructor(){this.subscribe=s=>(this.subscribers.push(s),()=>{const t=this.subscribers.indexOf(s);this.subscribers.splice(t,1)}),this.publish=s=>{this.subscribers.forEach(t=>t(s))},this.addToast=s=>{this.publish(s),this.toasts=[...this.toasts,s]},this.create=s=>{var t;const{message:r,...i}=s,l=typeof(s==null?void 0:s.id)=="number"||((t=s.id)==null?void 0:t.length)>0?s.id:Qe++,n=this.toasts.find(m=>m.id===l),d=s.dismissible===void 0?!0:s.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),n?this.toasts=this.toasts.map(m=>m.id===l?(this.publish({...m,...s,id:l,title:r}),{...m,...s,id:l,dismissible:d,title:r}):m):this.addToast({title:r,...i,dismissible:d,id:l}),l},this.dismiss=s=>(s?(this.dismissedToasts.add(s),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:s,dismiss:!0})))):this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),s),this.message=(s,t)=>this.create({...t,message:s}),this.error=(s,t)=>this.create({...t,message:s,type:"error"}),this.success=(s,t)=>this.create({...t,type:"success",message:s}),this.info=(s,t)=>this.create({...t,type:"info",message:s}),this.warning=(s,t)=>this.create({...t,type:"warning",message:s}),this.loading=(s,t)=>this.create({...t,type:"loading",message:s}),this.promise=(s,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:s,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const i=Promise.resolve(s instanceof Function?s():s);let l=r!==void 0,n;const d=i.then(async c=>{if(n=["resolve",c],u.isValidElement(c))l=!1,this.create({id:r,type:"default",message:c});else if(Pr(c)&&!c.ok){l=!1;const a=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,E=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description,P=typeof a=="object"&&!u.isValidElement(a)?a:{message:a};this.create({id:r,type:"error",description:E,...P})}else if(c instanceof Error){l=!1;const a=typeof t.error=="function"?await t.error(c):t.error,E=typeof t.description=="function"?await t.description(c):t.description,P=typeof a=="object"&&!u.isValidElement(a)?a:{message:a};this.create({id:r,type:"error",description:E,...P})}else if(t.success!==void 0){l=!1;const a=typeof t.success=="function"?await t.success(c):t.success,E=typeof t.description=="function"?await t.description(c):t.description,P=typeof a=="object"&&!u.isValidElement(a)?a:{message:a};this.create({id:r,type:"success",description:E,...P})}}).catch(async c=>{if(n=["reject",c],t.error!==void 0){l=!1;const y=typeof t.error=="function"?await t.error(c):t.error,a=typeof t.description=="function"?await t.description(c):t.description,C=typeof y=="object"&&!u.isValidElement(y)?y:{message:y};this.create({id:r,type:"error",description:a,...C})}}).finally(()=>{l&&(this.dismiss(r),r=void 0),t.finally==null||t.finally.call(t)}),m=()=>new Promise((c,y)=>d.then(()=>n[0]==="reject"?y(n[1]):c(n[1])).catch(y));return typeof r!="string"&&typeof r!="number"?{unwrap:m}:Object.assign(r,{unwrap:m})},this.custom=(s,t)=>{const r=(t==null?void 0:t.id)||Qe++;return this.create({jsx:s(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(s=>!this.dismissedToasts.has(s.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const X=new Cr,_r=(e,s)=>{const t=(s==null?void 0:s.id)||Qe++;return X.addToast({title:e,...s,id:t}),t},Pr=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Rr=_r,zr=()=>X.toasts,Ar=()=>X.getActiveToasts(),Ke=Object.assign(Rr,{success:X.success,info:X.info,warning:X.warning,error:X.error,custom:X.custom,message:X.message,promise:X.promise,dismiss:X.dismiss,loading:X.loading},{getHistory:zr,getToasts:Ar});xr("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Fe(e){return e.label!==void 0}const Ir=3,Or="24px",Dr="16px",wt=4e3,Mr=356,Lr=14,Br=45,$r=200;function fe(...e){return e.filter(Boolean).join(" ")}function Fr(e){const[s,t]=e.split("-"),r=[];return s&&r.push(s),t&&r.push(t),r}const Vr=e=>{var s,t,r,i,l,n,d,m,c;const{invert:y,toast:a,unstyled:E,interacting:C,setHeights:P,visibleToasts:O,heights:I,index:N,toasts:L,expanded:q,removeToast:Z,defaultRichColors:oe,closeButton:B,style:D,cancelButtonStyle:p,actionButtonStyle:M,className:de="",descriptionClassName:ae="",duration:K,position:H,gap:ue,expandByDefault:Y,classNames:v,icons:x,closeButtonAriaLabel:F="Close toast"}=e,[J,f]=u.useState(null),[me,Se]=u.useState(null),[T,z]=u.useState(!1),[S,_]=u.useState(!1),[ne,R]=u.useState(!1),[A,Ne]=u.useState(!1),[he,ie]=u.useState(!1),[ze,ve]=u.useState(0),[bs,tt]=u.useState(0),Ae=u.useRef(a.duration||K||wt),st=u.useRef(null),ge=u.useRef(null),xs=N===0,ys=N+1<=O,ee=a.type,_e=a.dismissible!==!1,vs=a.className||"",ws=a.descriptionClassName||"",De=u.useMemo(()=>I.findIndex(w=>w.toastId===a.id)||0,[I,a.id]),ks=u.useMemo(()=>{var w;return(w=a.closeButton)!=null?w:B},[a.closeButton,B]),ot=u.useMemo(()=>a.duration||K||wt,[a.duration,K]),He=u.useRef(0),Pe=u.useRef(0),rt=u.useRef(0),Re=u.useRef(null),[js,Ss]=H.split("-"),at=u.useMemo(()=>I.reduce((w,V,W)=>W>=De?w:w+V.height,0),[I,De]),nt=Tr(),Ns=a.invert||y,Ye=ee==="loading";Pe.current=u.useMemo(()=>De*ue+at,[De,at]),u.useEffect(()=>{Ae.current=ot},[ot]),u.useEffect(()=>{z(!0)},[]),u.useEffect(()=>{const w=ge.current;if(w){const V=w.getBoundingClientRect().height;return tt(V),P(W=>[{toastId:a.id,height:V,position:a.position},...W]),()=>P(W=>W.filter(te=>te.toastId!==a.id))}},[P,a.id]),u.useLayoutEffect(()=>{if(!T)return;const w=ge.current,V=w.style.height;w.style.height="auto";const W=w.getBoundingClientRect().height;w.style.height=V,tt(W),P(te=>te.find(U=>U.toastId===a.id)?te.map(U=>U.toastId===a.id?{...U,height:W}:U):[{toastId:a.id,height:W,position:a.position},...te])},[T,a.title,a.description,P,a.id,a.jsx,a.action,a.cancel]);const we=u.useCallback(()=>{_(!0),ve(Pe.current),P(w=>w.filter(V=>V.toastId!==a.id)),setTimeout(()=>{Z(a)},$r)},[a,Z,P,Pe]);u.useEffect(()=>{if(a.promise&&ee==="loading"||a.duration===1/0||a.type==="loading")return;let w;return q||C||nt?(()=>{if(rt.current<He.current){const te=new Date().getTime()-He.current;Ae.current=Ae.current-te}rt.current=new Date().getTime()})():(()=>{Ae.current!==1/0&&(He.current=new Date().getTime(),w=setTimeout(()=>{a.onAutoClose==null||a.onAutoClose.call(a,a),we()},Ae.current))})(),()=>clearTimeout(w)},[q,C,a,ee,nt,we]),u.useEffect(()=>{a.delete&&(we(),a.onDismiss==null||a.onDismiss.call(a,a))},[we,a.delete]);function Es(){var w;if(x!=null&&x.loading){var V;return u.createElement("div",{className:fe(v==null?void 0:v.loader,a==null||(V=a.classNames)==null?void 0:V.loader,"sonner-loader"),"data-visible":ee==="loading"},x.loading)}return u.createElement(wr,{className:fe(v==null?void 0:v.loader,a==null||(w=a.classNames)==null?void 0:w.loader),visible:ee==="loading"})}const Ts=a.icon||(x==null?void 0:x[ee])||yr(ee);var it,lt;return u.createElement("li",{tabIndex:0,ref:ge,className:fe(de,vs,v==null?void 0:v.toast,a==null||(s=a.classNames)==null?void 0:s.toast,v==null?void 0:v.default,v==null?void 0:v[ee],a==null||(t=a.classNames)==null?void 0:t[ee]),"data-sonner-toast":"","data-rich-colors":(it=a.richColors)!=null?it:oe,"data-styled":!(a.jsx||a.unstyled||E),"data-mounted":T,"data-promise":!!a.promise,"data-swiped":he,"data-removed":S,"data-visible":ys,"data-y-position":js,"data-x-position":Ss,"data-index":N,"data-front":xs,"data-swiping":ne,"data-dismissible":_e,"data-type":ee,"data-invert":Ns,"data-swipe-out":A,"data-swipe-direction":me,"data-expanded":!!(q||Y&&T),"data-testid":a.testId,style:{"--index":N,"--toasts-before":N,"--z-index":L.length-N,"--offset":`${S?ze:Pe.current}px`,"--initial-height":Y?"auto":`${bs}px`,...D,...a.style},onDragEnd:()=>{R(!1),f(null),Re.current=null},onPointerDown:w=>{w.button!==2&&(Ye||!_e||(st.current=new Date,ve(Pe.current),w.target.setPointerCapture(w.pointerId),w.target.tagName!=="BUTTON"&&(R(!0),Re.current={x:w.clientX,y:w.clientY})))},onPointerUp:()=>{var w,V,W;if(A||!_e)return;Re.current=null;const te=Number(((w=ge.current)==null?void 0:w.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Me=Number(((V=ge.current)==null?void 0:V.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),U=new Date().getTime()-((W=st.current)==null?void 0:W.getTime()),re=J==="x"?te:Me,Le=Math.abs(re)/U;if(Math.abs(re)>=Br||Le>.11){ve(Pe.current),a.onDismiss==null||a.onDismiss.call(a,a),Se(J==="x"?te>0?"right":"left":Me>0?"down":"up"),we(),Ne(!0);return}else{var le,ce;(le=ge.current)==null||le.style.setProperty("--swipe-amount-x","0px"),(ce=ge.current)==null||ce.style.setProperty("--swipe-amount-y","0px")}ie(!1),R(!1),f(null)},onPointerMove:w=>{var V,W,te;if(!Re.current||!_e||((V=window.getSelection())==null?void 0:V.toString().length)>0)return;const U=w.clientY-Re.current.y,re=w.clientX-Re.current.x;var Le;const le=(Le=e.swipeDirections)!=null?Le:Fr(H);!J&&(Math.abs(re)>1||Math.abs(U)>1)&&f(Math.abs(re)>Math.abs(U)?"x":"y");let ce={x:0,y:0};const ct=Ee=>1/(1.5+Math.abs(Ee)/20);if(J==="y"){if(le.includes("top")||le.includes("bottom"))if(le.includes("top")&&U<0||le.includes("bottom")&&U>0)ce.y=U;else{const Ee=U*ct(U);ce.y=Math.abs(Ee)<Math.abs(U)?Ee:U}}else if(J==="x"&&(le.includes("left")||le.includes("right")))if(le.includes("left")&&re<0||le.includes("right")&&re>0)ce.x=re;else{const Ee=re*ct(re);ce.x=Math.abs(Ee)<Math.abs(re)?Ee:re}(Math.abs(ce.x)>0||Math.abs(ce.y)>0)&&ie(!0),(W=ge.current)==null||W.style.setProperty("--swipe-amount-x",`${ce.x}px`),(te=ge.current)==null||te.style.setProperty("--swipe-amount-y",`${ce.y}px`)}},ks&&!a.jsx&&ee!=="loading"?u.createElement("button",{"aria-label":F,"data-disabled":Ye,"data-close-button":!0,onClick:Ye||!_e?()=>{}:()=>{we(),a.onDismiss==null||a.onDismiss.call(a,a)},className:fe(v==null?void 0:v.closeButton,a==null||(r=a.classNames)==null?void 0:r.closeButton)},(lt=x==null?void 0:x.close)!=null?lt:Er):null,(ee||a.icon||a.promise)&&a.icon!==null&&((x==null?void 0:x[ee])!==null||a.icon)?u.createElement("div",{"data-icon":"",className:fe(v==null?void 0:v.icon,a==null||(i=a.classNames)==null?void 0:i.icon)},a.promise||a.type==="loading"&&!a.icon?a.icon||Es():null,a.type!=="loading"?Ts:null):null,u.createElement("div",{"data-content":"",className:fe(v==null?void 0:v.content,a==null||(l=a.classNames)==null?void 0:l.content)},u.createElement("div",{"data-title":"",className:fe(v==null?void 0:v.title,a==null||(n=a.classNames)==null?void 0:n.title)},a.jsx?a.jsx:typeof a.title=="function"?a.title():a.title),a.description?u.createElement("div",{"data-description":"",className:fe(ae,ws,v==null?void 0:v.description,a==null||(d=a.classNames)==null?void 0:d.description)},typeof a.description=="function"?a.description():a.description):null),u.isValidElement(a.cancel)?a.cancel:a.cancel&&Fe(a.cancel)?u.createElement("button",{"data-button":!0,"data-cancel":!0,style:a.cancelButtonStyle||p,onClick:w=>{Fe(a.cancel)&&_e&&(a.cancel.onClick==null||a.cancel.onClick.call(a.cancel,w),we())},className:fe(v==null?void 0:v.cancelButton,a==null||(m=a.classNames)==null?void 0:m.cancelButton)},a.cancel.label):null,u.isValidElement(a.action)?a.action:a.action&&Fe(a.action)?u.createElement("button",{"data-button":!0,"data-action":!0,style:a.actionButtonStyle||M,onClick:w=>{Fe(a.action)&&(a.action.onClick==null||a.action.onClick.call(a.action,w),!w.defaultPrevented&&we())},className:fe(v==null?void 0:v.actionButton,a==null||(c=a.classNames)==null?void 0:c.actionButton)},a.action.label):null)};function kt(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Gr(e,s){const t={};return[e,s].forEach((r,i)=>{const l=i===1,n=l?"--mobile-offset":"--offset",d=l?Dr:Or;function m(c){["top","right","bottom","left"].forEach(y=>{t[`${n}-${y}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?m(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?t[`${n}-${c}`]=d:t[`${n}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):m(d)}),t}const Ur=u.forwardRef(function(s,t){const{id:r,invert:i,position:l="bottom-right",hotkey:n=["altKey","KeyT"],expand:d,closeButton:m,className:c,offset:y,mobileOffset:a,theme:E="light",richColors:C,duration:P,style:O,visibleToasts:I=Ir,toastOptions:N,dir:L=kt(),gap:q=Lr,icons:Z,containerAriaLabel:oe="Notifications"}=s,[B,D]=u.useState([]),p=u.useMemo(()=>r?B.filter(T=>T.toasterId===r):B.filter(T=>!T.toasterId),[B,r]),M=u.useMemo(()=>Array.from(new Set([l].concat(p.filter(T=>T.position).map(T=>T.position)))),[p,l]),[de,ae]=u.useState([]),[K,H]=u.useState(!1),[ue,Y]=u.useState(!1),[v,x]=u.useState(E!=="system"?E:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=u.useRef(null),J=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),f=u.useRef(null),me=u.useRef(!1),Se=u.useCallback(T=>{D(z=>{var S;return(S=z.find(_=>_.id===T.id))!=null&&S.delete||X.dismiss(T.id),z.filter(({id:_})=>_!==T.id)})},[]);return u.useEffect(()=>X.subscribe(T=>{if(T.dismiss){requestAnimationFrame(()=>{D(z=>z.map(S=>S.id===T.id?{...S,delete:!0}:S))});return}setTimeout(()=>{Ps.flushSync(()=>{D(z=>{const S=z.findIndex(_=>_.id===T.id);return S!==-1?[...z.slice(0,S),{...z[S],...T},...z.slice(S+1)]:[T,...z]})})})}),[B]),u.useEffect(()=>{if(E!=="system"){x(E);return}if(E==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?x("dark"):x("light")),typeof window>"u")return;const T=window.matchMedia("(prefers-color-scheme: dark)");try{T.addEventListener("change",({matches:z})=>{x(z?"dark":"light")})}catch{T.addListener(({matches:S})=>{try{x(S?"dark":"light")}catch(_){console.error(_)}})}},[E]),u.useEffect(()=>{B.length<=1&&H(!1)},[B]),u.useEffect(()=>{const T=z=>{var S;if(n.every(R=>z[R]||z.code===R)){var ne;H(!0),(ne=F.current)==null||ne.focus()}z.code==="Escape"&&(document.activeElement===F.current||(S=F.current)!=null&&S.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[n]),u.useEffect(()=>{if(F.current)return()=>{f.current&&(f.current.focus({preventScroll:!0}),f.current=null,me.current=!1)}},[F.current]),u.createElement("section",{ref:t,"aria-label":`${oe} ${J}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((T,z)=>{var S;const[_,ne]=T.split("-");return p.length?u.createElement("ol",{key:T,dir:L==="auto"?kt():L,tabIndex:-1,ref:F,className:c,"data-sonner-toaster":!0,"data-sonner-theme":v,"data-y-position":_,"data-x-position":ne,style:{"--front-toast-height":`${((S=de[0])==null?void 0:S.height)||0}px`,"--width":`${Mr}px`,"--gap":`${q}px`,...O,...Gr(y,a)},onBlur:R=>{me.current&&!R.currentTarget.contains(R.relatedTarget)&&(me.current=!1,f.current&&(f.current.focus({preventScroll:!0}),f.current=null))},onFocus:R=>{R.target instanceof HTMLElement&&R.target.dataset.dismissible==="false"||me.current||(me.current=!0,f.current=R.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{ue||H(!1)},onDragEnd:()=>H(!1),onPointerDown:R=>{R.target instanceof HTMLElement&&R.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},p.filter(R=>!R.position&&z===0||R.position===T).map((R,A)=>{var Ne,he;return u.createElement(Vr,{key:R.id,icons:Z,index:A,toast:R,defaultRichColors:C,duration:(Ne=N==null?void 0:N.duration)!=null?Ne:P,className:N==null?void 0:N.className,descriptionClassName:N==null?void 0:N.descriptionClassName,invert:i,visibleToasts:I,closeButton:(he=N==null?void 0:N.closeButton)!=null?he:m,interacting:ue,position:T,style:N==null?void 0:N.style,unstyled:N==null?void 0:N.unstyled,classNames:N==null?void 0:N.classNames,cancelButtonStyle:N==null?void 0:N.cancelButtonStyle,actionButtonStyle:N==null?void 0:N.actionButtonStyle,closeButtonAriaLabel:N==null?void 0:N.closeButtonAriaLabel,removeToast:Se,toasts:p.filter(ie=>ie.position==R.position),heights:de.filter(ie=>ie.position==R.position),setHeights:ae,expandByDefault:d,gap:q,expanded:K,swipeDirections:s.swipeDirections})})):null}))}),hs={success:e=>Ke.success(e),error:e=>Ke.error(e),warning:e=>Ke.warning(e)},Wr=[{to:"/admin/dashboard",label:"仪表盘",icon:Lt},{to:"/admin/boards",label:"板块管理",icon:Xs},{to:"/admin/posts",label:"帖子管理",icon:Qs},{to:"/admin/comments",label:"评论管理",icon:Zs},{to:"/admin/users",label:"用户管理",icon:eo},{to:"/admin/settings",label:"系统设置",icon:to}];function Hr(){const{user:e,loading:s}=We(),t=Ue();return b.useEffect(()=>{if(!s){if(!e){t("/login");return}e.role!=="admin"&&(hs.warning("需要管理员权限"),t("/"))}},[e,s,t]),s?o.jsx("div",{className:"flex justify-center py-24",children:o.jsx(br,{size:"lg"})}):!e||e.role!=="admin"?null:o.jsxs("div",{className:"admin-shell",children:[o.jsxs("header",{className:"admin-topbar",children:[o.jsxs("div",{className:"admin-topbar-brand",children:[o.jsx("div",{className:"admin-topbar-mark",children:"姜"}),o.jsxs("div",{children:[o.jsx("div",{className:"admin-topbar-title",children:"姜十三论坛"}),o.jsx("div",{className:"admin-topbar-sub",children:"管理后台"})]})]}),o.jsxs("div",{className:"admin-topbar-actions",children:[o.jsxs("button",{type:"button",className:"admin-link-btn",onClick:()=>t("/"),children:[o.jsx(Js,{size:16}),"返回论坛"]}),o.jsx("span",{className:"admin-topbar-user",children:e.nickname})]})]}),o.jsxs("div",{className:"admin-body",children:[o.jsx("aside",{className:"admin-sidebar",children:Wr.map(({to:r,label:i,icon:l})=>o.jsxs(Rs,{to:r,className:({isActive:n})=>Q("admin-nav-item",n&&"active"),children:[o.jsx(l,{size:16}),i]},r))}),o.jsx("main",{className:"admin-main",children:o.jsx(Ct,{})})]})]})}function ha(){const{user:e,loading:s}=We(),t=Ue();return b.useEffect(()=>{s||(e?e.role!=="admin"&&(hs.warning("需要管理员权限"),t("/")):t("/login"))},[e,s,t]),{user:e,loading:s,ready:!s&&!!e&&e.role==="admin"}}const jt=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,St=Yt,Yr=(e,s)=>t=>{var r;if((s==null?void 0:s.variants)==null)return St(e,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:i,defaultVariants:l}=s,n=Object.keys(i).map(c=>{const y=t==null?void 0:t[c],a=l==null?void 0:l[c];if(y===null)return null;const E=jt(y)||jt(a);return i[c][E]}),d=t&&Object.entries(t).reduce((c,y)=>{let[a,E]=y;return E===void 0||(c[a]=E),c},{}),m=s==null||(r=s.compoundVariants)===null||r===void 0?void 0:r.reduce((c,y)=>{let{class:a,className:E,...C}=y;return Object.entries(C).every(P=>{let[O,I]=P;return Array.isArray(I)?I.includes({...l,...d}[O]):{...l,...d}[O]===I})?[...c,a,E]:c},[]);return St(e,n,m,t==null?void 0:t.class,t==null?void 0:t.className)},qr=Yr("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),gs=b.forwardRef(({className:e,variant:s,size:t,asChild:r=!1,loading:i,children:l,disabled:n,...d},m)=>{const c=r?so:"button";return o.jsxs(c,{className:Q(qr({variant:s,size:t,className:e})),ref:m,disabled:n||i,...d,children:[i?o.jsx(Bt,{className:"animate-spin"}):null,l]})});gs.displayName="Button";class Kr extends b.Component{constructor(){super(...arguments);dt(this,"state",{error:null})}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,r){console.error("[Jiang13Forum]",t,r.componentStack)}render(){return this.state.error?o.jsxs("div",{style:{padding:24,textAlign:"center"},children:[o.jsx("h3",{children:"页面渲染出错"}),o.jsx("p",{style:{color:"var(--color-text-3)",fontSize:13},children:this.state.error.message}),o.jsx(gs,{size:"sm",onClick:()=>{this.setState({error:null}),window.location.reload()},children:"刷新页面"})]}):this.props.children}}function Jr(){const{theme:e}=Wt();return o.jsx(Ur,{theme:e,position:"top-center",richColors:!0,closeButton:!0,toastOptions:{classNames:{toast:"font-sans"}}})}const Xr=b.lazy(()=>se(()=>import("./HomePage-DGnsX5Gb.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Qr=b.lazy(()=>se(()=>import("./PostDetailPage-Dr1Cbngv.js"),__vite__mapDeps([8,1,4,5,3,6,9,10,7]))),Zr=b.lazy(()=>se(()=>import("./LoginPage-DD0h8vBo.js"),__vite__mapDeps([11,1,12,5,13]))),ea=b.lazy(()=>se(()=>import("./RegisterPage-DxlIbwrc.js"),__vite__mapDeps([14,1,12,5,13]))),Nt=b.lazy(()=>se(()=>import("./ComposePage-BFRWOfPd.js"),__vite__mapDeps([15,1,9,10,5]))),ta=b.lazy(()=>se(()=>import("./BoardsManagePage-CQfZWFTe.js"),__vite__mapDeps([16,1,12,5,13,3,17]))),sa=b.lazy(()=>se(()=>import("./ProfilePage-CGuBSp7z.js"),__vite__mapDeps([18,1,12,5,13,3]))),oa=b.lazy(()=>se(()=>import("./FavoritesPage-rCUA1Lp6.js"),__vite__mapDeps([19,1,6,5]))),ra=b.lazy(()=>se(()=>import("./AdminDashboardPage-BPcWHcOy.js"),__vite__mapDeps([20,1,3,5]))),aa=b.lazy(()=>se(()=>import("./AdminPostsPage-D3j3Buvt.js"),__vite__mapDeps([21,1,13,3,17,5,7]))),na=b.lazy(()=>se(()=>import("./AdminCommentsPage-DgkfVIER.js"),__vite__mapDeps([22,1,3,17,5]))),ia=b.lazy(()=>se(()=>import("./AdminUsersPage-C9r9nOl4.js"),__vite__mapDeps([23,1,3,5]))),la=b.lazy(()=>se(()=>import("./AdminSettingsPage-DXmt4ZWZ.js"),__vite__mapDeps([24,1,13,5])));function ca(){return o.jsx(io,{children:o.jsx(no,{children:o.jsxs(Kr,{children:[o.jsx(zs,{children:o.jsxs(As,{children:[o.jsx(G,{path:"/login",element:o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx(Zr,{})})}),o.jsx(G,{path:"/register",element:o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx(ea,{})})}),o.jsx(G,{path:"/boards",element:o.jsx(ut,{to:"/admin/boards",replace:!0})}),o.jsxs(G,{path:"/admin",element:o.jsx(Hr,{}),children:[o.jsx(G,{index:!0,element:o.jsx(ut,{to:"/admin/dashboard",replace:!0})}),o.jsx(G,{path:"dashboard",element:o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx(ra,{})})}),o.jsx(G,{path:"boards",element:o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx(ta,{})})}),o.jsx(G,{path:"posts",element:o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx(aa,{})})}),o.jsx(G,{path:"comments",element:o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx(na,{})})}),o.jsx(G,{path:"users",element:o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx(ia,{})})}),o.jsx(G,{path:"settings",element:o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx(la,{})})})]}),o.jsxs(G,{element:o.jsx(hr,{}),children:[o.jsx(G,{path:"/",element:o.jsx(Xr,{})}),o.jsx(G,{path:"/post/:id",element:o.jsx(Qr,{})}),o.jsx(G,{path:"/post/:id/edit",element:o.jsx(Nt,{})}),o.jsx(G,{path:"/compose",element:o.jsx(Nt,{})}),o.jsx(G,{path:"/profile",element:o.jsx(sa,{})}),o.jsx(G,{path:"/favorites",element:o.jsx(oa,{})})]})]})}),o.jsx(Jr,{})]})})})}Vt(Ft());Is.createRoot(document.getElementById("root")).render(o.jsx(u.StrictMode,{children:o.jsx(ca,{})}));export{gs as B,fa as F,br as S,ye as a,Ge as b,Q as c,ha as d,Yr as e,qr as f,hs as n,ps as p,We as u};
|