1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[18430,55037],{618:(e,t,a)=>{a.d(t,{DE:()=>g});var r=a(95155),n=a(53455),s=a(6613),i=a(56154),l=a(8198),o=a(48055),c=a(58347),d=a(50209),u=a(90297);function m(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M").replace(".0M","M"):e>=1e3?"".concat((e/1e3).toFixed(1),"k").replace(".0k","k"):e.toString()}function x(e){return 1===e?"денÑ":e>=2&&e<=4?"днÑ":"дней"}function g(){let{data:e,status:t}=(0,c.wV)(),g=null==e?void 0:e.user,h=(0,d.St)(null!=g?g:{}),f=!!(null==g?void 0:g.id)&&!(null==g?void 0:g.needsEmailLinking)&&!(0,u.h6)(null==g?void 0:g.id),{data:p,isLoading:b}=(0,n.I)({queryKey:["user-stats-bar"],queryFn:async()=>{var e,t,r;let n=await fetch("/api/user/stats");if(401===n.status)throw console.warn("[useUserStatsBar] 401 Unauthorized - forcing sign out"),await (0,c.CI)({callbackUrl:"/"}),Error("Unauthorized");if(!n.ok)throw Error("Failed to fetch stats: ".concat(n.status));let s=await n.json(),{getLevelTitle:i,getLevelProgress:l}=await Promise.all([a.e(61774),a.e(20224)]).then(a.bind(a,20224)),o=i(s.level),d=l(s.totalXP);return{level:s.level,levelTitle:o,totalXP:s.totalXP,xpToNextLevel:d.xpNeededForNextLevel-d.xpInCurrentLevel,progressPercent:d.progressPercent,currentStreak:s.currentStreak,longestStreak:null!=(e=s.longestStreak)?e:0,workCoins:s.workCoins,hasActiveSubscription:null!=(t=s.hasActiveSubscription)&&t,activeCampaign:null!=(r=s.activeCampaign)?r:null}},enabled:f,retry:(e,t)=>"Unauthorized"!==t.message&&e<3,staleTime:5e3,refetchInterval:6e4}),v=p?[{icon:s.A,label:"УÑовенÑ",rawValue:p.level,color:"text-gray-700",bg:"bg-transparent",tooltip:"".concat(p.levelTitle," (УÑÐ¾Ð²ÐµÐ½Ñ ").concat(p.level,")"),detailedTooltip:"ÐÑогÑеÑÑ: ".concat(p.progressPercent,"% до ÑÑÐ¾Ð²Ð½Ñ ").concat(p.level+1),href:"/achievements"},{icon:i.A,label:"XP",rawValue:p.totalXP,format:m,color:"text-gray-700",bg:"bg-transparent",tooltip:"".concat(m(p.totalXP)," опÑÑа"),detailedTooltip:"ÐÑе ".concat(m(p.xpToNextLevel)," XP до ÑледÑÑÑего ÑÑовнÑ"),href:"/profile"},{icon:l.A,label:"СеÑиÑ",rawValue:p.currentStreak,color:"text-gray-700",bg:"bg-transparent",tooltip:"".concat(p.currentStreak," ").concat(x(p.currentStreak)," подÑÑд"),detailedTooltip:"РекоÑд: ".concat(p.longestStreak," ").concat(x(p.longestStreak)),href:"/profile"},{icon:o.A,label:"WorkCoins",rawValue:p.workCoins,subtitle:"â",color:"text-gray-700",bg:"bg-transparent",tooltip:"".concat(p.workCoins," WorkCoins"),detailedTooltip:(0,r.jsxs)(r.Fragment,{children:["ÐалÑÑа длÑ"," ",(0,r.jsx)("a",{href:"https://workai.su?utm_source=platform&utm_medium=stats_bar&utm_campaign=workcoin",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline hover:no-underline",children:"WorkAI IDE"}),". ÐÑполÑзÑйÑе Ð´Ð»Ñ Ð´Ð¾ÑÑÑпа к AI-ÑÑнкÑиÑм ÑедакÑоÑа кода."]}),href:"/workcoin-transactions"}]:null;return{user:g,avatarUrl:h,isFullyLinkedUser:f,isLoading:"loading"===t||b,stats:p,statsItems:v}}},3998:(e,t,a)=>{a.d(t,{$:()=>o,r:()=>l});var r=a(95155),n=a(32467),s=a(83101);a(12115);var i=a(64269);let l=(0,s.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-medium transition-all duration-200 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus:ring-2 focus:ring-offset-2",{variants:{variant:{default:"bg-gray-900 text-white hover:bg-gray-800 focus:ring-gray-900/20 shadow-sm",secondary:"bg-gray-100 text-gray-900 hover:bg-gray-200 focus:ring-gray-500/20 border border-gray-200 shadow-sm",subtle:"bg-gray-100 text-gray-900 hover:bg-gray-200 focus:ring-gray-500/20 shadow-sm",outline:"border border-gray-200 bg-transparent text-gray-700 hover:bg-gray-50 focus:ring-gray-500/20 shadow-sm",ghost:"bg-transparent text-gray-600 hover:bg-gray-100 hover:text-gray-900 focus:ring-gray-500/20",destructive:"bg-red-600 text-white hover:bg-red-700 focus:ring-2 focus:ring-red-600/20 shadow-sm",link:"text-gray-900 underline-offset-4 hover:underline focus:ring-gray-900/20",edgeTab:"h-auto rounded-l-lg rounded-r-none border-r-0 shadow-md py-4 px-4 w-auto min-w-0 flex flex-col items-center gap-2 overflow-visible border border-gray-200 bg-transparent text-gray-700 hover:bg-gray-50 focus:ring-gray-500/20",edgeTabActive:"h-auto rounded-l-lg rounded-r-none border-r-0 shadow-md py-4 px-4 w-auto min-w-0 flex flex-col items-center gap-2 overflow-visible bg-primary text-primary-foreground hover:bg-primary/90 focus:ring-primary/20 shadow-sm"},size:{default:"h-9 px-4 py-2",sm:"h-8 px-3 py-1.5 text-xs",lg:"h-10 px-6 py-2.5",icon:"size-9",edgeTab:"text-xs"}},defaultVariants:{variant:"default",size:"default"}});function o(e){let{className:t,variant:a,size:s,asChild:o=!1,...c}=e,d=o?n.DX:"button";return(0,r.jsx)(d,{"data-slot":"button",className:(0,i.cn)(l({variant:a,size:s,className:t})),...c})}},7190:(e,t,a)=>{a.d(t,{h:()=>n});var r=a(95155);function n(e){let{className:t}=e;return(0,r.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM16.64 8.8C16.49 10.38 15.84 14.22 15.51 15.99C15.37 16.74 15.09 16.99 14.83 17.02C14.25 17.07 13.81 16.64 13.25 16.27C12.37 15.69 11.87 15.33 11.02 14.77C10.03 14.12 10.67 13.76 11.24 13.18C11.39 13.03 13.95 10.7 14 10.49C14.0069 10.4582 14.006 10.4252 13.9973 10.3938C13.9886 10.3624 13.9724 10.3337 13.95 10.31C13.89 10.26 13.81 10.28 13.74 10.29C13.65 10.31 12.25 11.24 9.52 13.08C9.12 13.35 8.76 13.49 8.44 13.48C8.08 13.47 7.4 13.28 6.89 13.11C6.26 12.91 5.77 12.8 5.81 12.45C5.83 12.27 6.08 12.09 6.55 11.9C9.47 10.63 11.41 9.79 12.38 9.39C15.16 8.23 15.73 8.03 16.11 8.03C16.19 8.03 16.38 8.05 16.5 8.15C16.6 8.23 16.63 8.34 16.64 8.42C16.63 8.48 16.65 8.66 16.64 8.8Z",fill:"#0088CC"})})}a(12115)},26333:(e,t,a)=>{a.d(t,{AM:()=>i,Wv:()=>l,hl:()=>o});var r=a(95155),n=a(31138);a(12115);var s=a(64269);function i(e){let{...t}=e;return(0,r.jsx)(n.bL,{"data-slot":"popover",...t})}function l(e){let{...t}=e;return(0,r.jsx)(n.l9,{"data-slot":"popover-trigger",...t})}function o(e){let{className:t,align:a="center",sideOffset:i=4,...l}=e;return(0,r.jsx)(n.ZL,{children:(0,r.jsx)(n.UC,{"data-slot":"popover-content",align:a,sideOffset:i,className:(0,s.cn)("bg-white text-gray-900 border border-gray-300 rounded-md shadow-lg z-50 w-72 origin-(--radix-popover-content-transform-origin) p-4 outline-none","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]:sli
1de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...l})})}},30760:(e,t,a)=>{a.d(t,{H:()=>n});var r=a(95155);function n(e){let{className:t}=e;return(0,r.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M13.6 4.5h-1.1c-2.7 0-4.3 1.5-4.3 3.9 0 2.6 1.4 3.8 3.6 5.1l1.7 1-4 7H6.8l3.5-6.1c-2.5-1.5-4.3-3.3-4.3-6.2C6 5.7 8.3 3 13.4 3h3.1v18h-2.9V4.5z",fill:"#FC3F1D"})})}a(12115)},45557:(e,t,a)=>{a.d(t,{v:()=>n});var r=a(30926);let n=(0,r.createServerReference)("40d5ca17c05a84a734b6910796832a262d811b9025",r.callServer,void 0,r.findSourceMapURL,"markAnnouncementRead")},48387:(e,t,a)=>{function r(e){return e.split(" ").map(e=>e.charAt(0)).join("").toUpperCase().substring(0,2)}function n(e){let t=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500"],a=0;for(let t=0;t<e.length;t++)a=e.charCodeAt(t)+((a<<5)-a);return t[Math.abs(a)%t.length]||"bg-blue-500"}a.d(t,{$L:()=>n,IM:()=>r})},48589:(e,t,a)=>{a.d(t,{J:()=>u});var r=a(95155),n=a(26497),s=a(32164),i=a(52619),l=a.n(i),o=a(12115),c=a(46767),d=a(64269);function u(e){var t;let{icon:a,rawValue:i,format:u,isWorkCoins:m,tooltip:x,detailedTooltip:g,href:h,isKotlinSprintPage:f,isLast:p,fullHeight:b,size:v="default",caption:y,onClick:j}=e,w=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:700,[a,r]=(0,o.useState)(e),n=(0,o.useRef)(e);return(0,o.useEffect)(()=>{let a=n.current;if(n.current=e,a===e)return;let s=0,i=performance.now(),l=n=>{let o=Math.min(1,(n-i)/t);r(Math.round(a+(e-a)*(1-(1-o)**3))),o<1&&(s=requestAnimationFrame(l))};return s=requestAnimationFrame(l),()=>cancelAnimationFrame(s)},[e,t]),a}(i),N=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1500,a=(0,o.useRef)(e),[r,n]=(0,o.useState)(null),s=(0,o.useRef)(null);return(0,o.useEffect)(()=>{let r=a.current;a.current=e;let i=e-r;0!==i&&(n({delta:i,key:Date.now()+Math.random()}),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>n(null),t))},[e,t]),(0,o.useEffect)(()=>()=>{s.current&&clearTimeout(s.current)},[]),r}(i),A=(null!=(t=null==N?void 0:N.delta)?t:0)>=0,k=u?u(w):String(w),C="lg"===v;return(0,r.jsx)(c.TooltipProvider,{children:(0,r.jsxs)(c.Tooltip,{children:[(0,r.jsx)(c.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)(l(),{href:h,onClick:j,className:(0,d.cn)("relative flex items-center transition-colors",C?"flex-col justify-center gap-1 rounded-xl border px-2 py-3":"gap-1.5 px-2.5 py-1.5 rounded-md",b&&"h-full",!C&&!p&&(f?"border-r border-slate-700/50":"border-r border-gray-200/80"),C?f?"border-slate-700/50 bg-slate-800/30":"border-gray-200/80 bg-gray-100/60":f?"hover:bg-slate-800/50":"hover:bg-gray-200/80"),children:[(0,r.jsx)(n.N,{children:N&&(0,r.jsx)(s.P.span,{initial:{opacity:0,y:2,scale:.85},animate:{opacity:1,y:-16,scale:1},exit:{opacity:0,y:-24},transition:{duration:.7,ease:"easeOut"},className:(0,d.cn)("pointer-events-none absolute -top-0.5 left-1/2 z-10 -translate-x-1/2 whitespace-nowrap text-[11px] font-bold drop-shadow-sm",A?"text-emerald-500":"text-rose-500"),children:A?"+".concat(N.delta):N.delta},N.key)}),(0,r.jsx)(s.P.span,{animate:N?{scale:[1,1.35,1],rotate:[0,A?-10:10,0]}:{scale:1,rotate:0},transition:{duration:.5,ease:"easeOut"},className:"flex shrink-0 items-center justify-center",children:m?(0,r.jsx)("span",{className:(0,d.cn)(C?"text-lg font-bold":"text-sm font-bold",f?"text-slate-500":"text-gray-400"),children:"â"}):(0,r.jsx)(a,{className:(0,d.cn)(C?"size-5":"size-4","shrink-0",f?"text-slate-500":"text-gray-500")})},N?"icon-".concat(N.key):"icon-idle"),(0,r.jsx)(s.P.span,{animate:N?{scale:[1,1.22,1]}:{scale:1},transition:{duration:.45,ease:"easeOut"},className:(0,d.cn)("font-semibold tabular-nums transition-colors duration-300",C?"text-sm":"text-xs",N?A?"text-emerald-600":"text-rose-500":f?"text-slate-400":"text-gray-700"),children:k},N?"val-".concat(N.key):"val-idle"),C&&y&&(0,r.jsx)("span",{className:(0,d.cn)("text-[11px] leading-none",f?"text-slate-500 font-mono":"text-gray-500"),children:y})]})}),(0,r.jsx)(c.TooltipContent,{children:(0,r.jsxs)("div",{className:"space-y-0.5",children:[(0,r.jsx)("p",{className:"font-semibold",children:x}),g&&(0,r.jsx)("p",{className:"text-xs text-gray-400",children:g})]})})]})})}},50209:(e,t,a)=>{a.d(t,{St:()=>s});let r="storage.yandexcloud.net".split(",").map(e=>
1e.trim().toLowerCase()).filter(Boolean);var n=a(95704);function s(e){var t;return(t=e.image)?!function(e){var t,a;if(!e||!e.startsWith("http"))return!1;try{if(function(e){let t=e.toLowerCase();return r.some(e=>t===e||t.endsWith(".".concat(e)))}(new URL(e).hostname))return!0}catch(e){return!1}let s=null==(t=n.env.S3_PUBLIC_URL_BASE)?void 0:t.replace(/\/$/,"");if(s&&e.startsWith(s))return!0;let i=null==(a=n.env.S3_ENDPOINT)?void 0:a.replace(/\/$/,"");return!!(i&&e.startsWith(i))}(t)?null:t:null}},53844:(e,t,a)=>{a.d(t,{E:()=>l});var r=a(99776),n=a(53455),s=a(80549),i=a(58347);function l(){let e=(0,r.jE)(),{data:t}=(0,i.wV)(),{data:a,refetch:l}=(0,n.I)({queryKey:["notifications"],queryFn:async()=>{let e=await fetch("/api/notifications");if(!e.ok)throw Error("Failed to fetch notifications");return e.json()},enabled:!!(null==t?void 0:t.user),refetchInterval:3e4,staleTime:2e4}),o=(0,s.n)({mutationFn:async e=>{await fetch("/api/notifications/".concat(e,"/read"),{method:"POST"})},onMutate:async t=>{await e.cancelQueries({queryKey:["notifications"]});let a=e.getQueryData(["notifications"]);return e.setQueryData(["notifications"],e=>e?{...e,notifications:e.notifications.map(e=>e.id===t?{...e,isRead:!0}:e),unreadCount:Math.max(0,e.unreadCount-1)}:e),{previousData:a}},onError:(t,a,r)=>{(null==r?void 0:r.previousData)&&e.setQueryData(["notifications"],r.previousData)},onSettled:()=>{e.invalidateQueries({queryKey:["notifications"]})}}),c=(0,s.n)({mutationFn:async()=>{let e=await fetch("/api/notifications/mark-all-read",{method:"POST"});if(!e.ok)throw Error("Failed to mark all as read");return e.json()},onMutate:async()=>{await e.cancelQueries({queryKey:["notifications"]});let t=e.getQueryData(["notifications"]);return e.setQueryData(["notifications"],e=>e?{...e,notifications:e.notifications.map(e=>({...e,isRead:!0})),unreadCount:0}:e),{previousData:t}},onError:(t,a,r)=>{(null==r?void 0:r.previousData)&&e.setQueryData(["notifications"],r.previousData)},onSettled:()=>{e.invalidateQueries({queryKey:["notifications"]})}}),d=(0,s.n)({mutationFn:async e=>{let t=await fetch("/api/notifications/".concat(e,"/delete"),{method:"DELETE"});if(!t.ok)throw Error("Failed to delete notification");return t.json()},onMutate:async t=>{await e.cancelQueries({queryKey:["notifications"]});let a=e.getQueryData(["notifications"]);return e.setQueryData(["notifications"],e=>{if(!e)return e;let a=e.notifications.find(e=>e.id===t);return{...e,notifications:e.notifications.filter(e=>e.id!==t),unreadCount:(null==a?void 0:a.isRead)?e.unreadCount:Math.max(0,e.unreadCount-1)}}),{previousData:a}},onError:(t,a,r)=>{(null==r?void 0:r.previousData)&&e.setQueryData(["notifications"],r.previousData)},onSettled:()=>{e.invalidateQueries({queryKey:["notifications"]})}}),u=(0,s.n)({mutationFn:async()=>{let e=await fetch("/api/notifications/clear-read",{method:"DELETE"});if(!e.ok)throw Error("Failed to clear read notifications");return e.json()},onMutate:async()=>{await e.cancelQueries({queryKey:["notifications"]});let t=e.getQueryData(["notifications"]);return e.setQueryData(["notifications"],e=>e?{...e,notifications:e.notifications.filter(e=>!e.isRead)}:e),{previousData:t}},onError:(t,a,r)=>{(null==r?void 0:r.previousData)&&e.setQueryData(["notifications"],r.previousData)},onSettled:()=>{e.invalidateQueries({queryKey:["notifications"]})}});return{notifications:(null==a?void 0:a.notifications)||[],unreadCount:(null==a?void 0:a.unreadCount)||0,markAsRead:o.mutate,markAllAsRead:c.mutate,deleteNotification:d.mutate,clearRead:u.mutate,isLoading:o.isPending||c.isPending||d.isPending||u.isPending,refetch:l}}},54209:(e,t,a)=>{a.d(t,{Il:()=>n.A,RI:()=>L.A,hc:()=>m.A,Td:()=>ew.A,$T:()=>eN.A,Qp:()=>ek.A,YL:()=>E.A,Gy:()=>j.A,iG:()=>Q.A,cC:()=>P.A,zP:()=>eh.A,Vv:()=>_.A,aJ:()=>h.A,rA:()=>C.A,Jl:()=>z.A,Sr:()=>h.A,yQ:()=>f.A,D3:()=>f.A,c_:()=>b.A,rX:()=>p.A,Mt:()=>p.A,jl:()=>v.A,GQ:()=>v.A,zD:()=>y.A,Cy:()=>R.A,QR:()=>g.A,y5:()=>U.A,f5:()=>es.A,ff:()=>T.A,Gr:()=>B.A,kU:()=>S.A,X_:()=>eu.A,F7:()=>eA.A,GD:()=>ee.A,iU:()=>V.A,Q5:()=>ej.A,Zr:()=>ec.A,Yg:()=>el.A,rh:()=>ed.A,D$:()=>eo.A,Cp:()=>Y.A,lj:()=>l.A,XI:()=>eg.A,f2:()=>ei.A,mN:()=>J.A,_V:()=>$.A,R2:()=>ef.A,kV:()=>em.A,g5:()=>G.A,N_:()=>Z.A,kr:()=>k.A,LM:()=>N.A,oF:()=>W.A,Hs:()=>d.A,es:()=>ey.A,xv:()=>en.A,vR:()=>O.A,jG:()=>X.A,FW:()=>x.A,e9:()=>eb.A,vG:()=>K.A,Hb:()=>eC.A,vj:()=>s.A,Vn:()=>H.A,sU:()=>ep.A,FE:()=>u.A,We:()=>ex.A,hZ:()=>eS.h,jU:()=>ev.A,lM:()=>er.A,TB:()=>A.A,kl:()=>c.A,nt:()=>o.A,Xs:()=>w.A,_O:()=>q.A,KJ:()=>M.A,Gv:()=>I.A,yp:()=>F.A,zW:()=>r.A,Ce:()=>et.A,X:()=>i.A,Jp:()=>ea.A,uv:()=>eT,Hh:()=>eD.H,Kq:()=>D.A,$Z:()=>eR.A});var r=a(91169),n=a(50906),s=a(86651),i=a(65229),l=a(4761),o=a(1524),c=a(26921),d=a(7125),u=a(39347),m=a(52056),x=a(6191),g=a(75426),h=a(5917),f=a(24033),p=a(12108),b=a(27937),v=a(99051),y=a(26983),j=a(47937),w=a(6613),N=a(99708),A=a(71360),k=a(35299),C=a(42529),R=a(9602),D=a(56154),S=a(57828),T=a(11010),E=a(52025),M=a(20508),z=a(61362),F=a(96583),I=a(50069),P=a(
178192),L=a(6132),_=a(16485),U=a(78519),Q=a(98001),V=a(89715),W=a(5937),q=a(21786),B=a(93499),$=a(42196),K=a(4861),X=a(85921),O=a(53511),H=a(18085),J=a(20908),G=a(17666),Y=a(94684),Z=a(50859),ee=a(71613),et=a(60890),ea=a(78874),er=a(37135),en=a(14285),es=a(39867),ei=a(49476),el=a(23924),eo=a(87759),ec=a(39332),ed=a(78500),eu=a(70532),em=a(55867),ex=a(30814),eg=a(89442),eh=a(46927),ef=a(23327),ep=a(95740),eb=a(89559),ev=a(86604),ey=a(39926),ej=a(8198),ew=a(1375),eN=a(6100),eA=a(73366),ek=a(52987),eC=a(48314),eR=a(34904),eD=a(30760),eS=a(7190);a(95155),a(72262),a(64269);let eT=i.A},55645:(e,t,a)=>{a.d(t,{UserStatsBar:()=>P});var r=a(95155),n=a(861),s=a(95740),i=a(27937),l=a(403),o=a(89559),c=a(24033),d=a(84926),u=a(25276),m=a(49745),x=a(90368),g=a(52619),h=a.n(g),f=a(12115),p=a(64322),b=a(45557),v=a(30926);let y=(0,v.createServerReference)("604f74aaf24e0d279f63bbe4be509a07d585284519",v.callServer,void 0,v.findSourceMapURL,"rateAnnouncement");var j=a(85897),w=a(51834),N=a(6259),A=a(46767),k=a(54518),C=a(64269),R=a(48387),D=a(48589),S=a(68564),T=a(91085),E=a(618);let M={Ðовинка:"bg-emerald-50 text-emerald-700 border-emerald-200",Ðбновление:"bg-violet-50 text-violet-700 border-violet-200",Ðажно:"bg-rose-50 text-rose-700 border-rose-200",ÐкÑиÑ:"bg-amber-50 text-amber-700 border-amber-200"},z="announcement_first_seen";function F(e,t){return t?new Date(t).getTime():new Date(e).getTime()+864e5}function I(e){let{publishedAt:t,expiresAt:a}=e,[n,s]=(0,f.useState)(1);(0,f.useEffect)(()=>{let e=new Date(t).getTime(),r=F(t,a)-e,n=()=>{s(Math.max(0,Math.min(1,1-(Date.now()-e)/r)))};n();let i=setInterval(n,6e4);return()=>clearInterval(i)},[t,a]);let i=2*Math.PI*7;return(0,r.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",className:"shrink-0 -rotate-90",children:[(0,r.jsx)("circle",{cx:"9",cy:"9",r:7,fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"opacity-15"}),(0,r.jsx)("circle",{cx:"9",cy:"9",r:7,fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeDasharray:i,strokeDashoffset:i*(1-n),strokeLinecap:"round"})]})}function P(e){var t,a,g,v,P,L;let{variant:_="desktop",className:U}=e,{user:Q,avatarUrl:V,isFullyLinkedUser:W,isLoading:q,stats:B,statsItems:$}=(0,E.DE)(),K=(0,k.dE)(),[X,O]=(0,f.useState)([]),[H,J]=(0,f.useState)(0),[,G]=(0,f.useTransition)(),Y=null==Q?void 0:Q.role,Z=(0,f.useCallback)(async()=>{try{var e;let t=await fetch("/api/announcements");if(!t.ok)return;let a=await t.json();O(null!=(e=a.announcements)?e:[])}catch(e){}},[]);(0,f.useEffect)(()=>{W&&Z()},[W,Z]);let ee=(0,f.useMemo)(()=>{let e=Date.now();return X.filter(t=>{if(t.isRead||e>=F(t.publishedAt,t.expiresAt))return!1;if(!t.expiresAt)try{var a,r;let n=JSON.parse(null!=(a=localStorage.getItem(z))?a:"{}");if(n[t.id]||(n[t.id]=e,localStorage.setItem(z,JSON.stringify(n))),(null!=(r=n[t.id])?r:e)+864e5<=e)return!1}catch(e){}return!0})},[X]),et=null!=(t=ee[H])?t:null,ea=0===ee.length&&X.length>0,[er,en]=(0,f.useState)(!1),[es,ei]=(0,f.useState)(0),el=null!=(a=ee[es])?a:null,eo=(0,f.useRef)(new Set),ec=e=>{var t;let a=null==(t=ee[e])?void 0:t.id;a&&!eo.current.has(a)&&(eo.current.add(a),G(async()=>{await (0,b.v)(a)})),ei(e)},ed=e=>{if(!el)return;let t=el.id,a=el.myReaction,r=a===e;O(n=>n.map(n=>{var s,i;if(n.id!==t)return n;let l=null!=(s=n.upCount)?s:0,o=null!=(i=n.downCount)?i:0;return r?{...n,myReaction:null,upCount:"up"===e?l-1:l,downCount:"down"===e?o-1:o}:{...n,myReaction:e,upCount:"up"===e?l+1:"up"===a?l-1:l,downCount:"down"===e?o+1:"down"===a?o-1:o}})),G(async()=>{await y(t,e)})};if((0,f.useEffect)(()=>{let e=setInterval(()=>{O(e=>[...e])},6e4);return()=>clearInterval(e)},[]),!W)return null;if(q||!B)return"mobile"===_?(0,r.jsxs)("div",{className:(0,C.cn)("flex items-center gap-0.5 animate-pulse",U),children:[(0,r.jsx)("div",{className:(0,C.cn)("h-5 w-10 rounded",K?"bg-slate-800/50":"bg-gray-200")}),(0,r.jsxs)("div",{className:(0,C.cn)("hidden sm:flex items-center gap-0.5"),children:[(0,r.jsx)("div",{className:(0,C.cn)("h-5 w-8 rounded",K?"bg-slate-800/50":"bg-gray-200")}),(0,r.jsx)("div",{className:(0,C.cn)("h-5 w-10 rounded",K?"bg-slate-800/50":"bg-gray-200")}),(0,r.jsx)("div",{className:(0,C.cn)("h-5 w-7 rounded",K?"bg-slate-800/50":"bg-gray-200")})]})]}):(0,r.jsxs)("div",{className:(0,C.cn)("border-b px-6 py-2","flex items-center justify-between","min-h-[48px]","animate-pulse",K?"bg-slate-900/95 border-slate-700/50":"bg-white border-gray-200",U),children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("div",{className:(0,C.cn)("h-8 w-16 rounded",K?"bg-slate-800/50":"bg-gray-200")}),(0,r.jsx)("div",{className:(0,C.cn)("h-8 w-16 rounded",K?"bg-slate-800/50":"bg-gray-200")}),(0,r.jsx)("div",{className:(0,C.cn)("h-8 w-16 rounded",K?"bg-slate-800/50":"bg-gray-200")}),(0,r.jsx)("div",{className:(0,C.cn)("h-6 w-px mx-1",K?"bg-slate-700/50":"bg-gray-200")}),(0,r.jsx)("div",{className:(0,C.cn)("h-3 w-20 rounded",K?"bg-slate-800/50":"bg-gray-200")})]}),(0,r.jsx)("div",{className:(0,C.cn)("h-7 w-7 rounded-full",K?"bg-slate-800/50":"bg-gray-200")})]});if(!$)return null;if("mobile"===_){let e=null!=(g=$.find(e=>"СеÑиÑ"===e.label))?g:$[0];return e?(0,r.jsxs)("div",{className:(0,C.cn)("flex h-10 items-center rounded-lg border",K?"bg-slate-800/30 border-slate-700/50":"bg-gray-100/80 border-gray-200/80",U),children:[(0,r.jsx)("div",{className:"flex h-full items-center sm:hidden",children:(0,r.jsx)(D.J,{icon:e.icon,rawValue:e.rawValue,format:e.format,isWorkCoins:"WorkCoins"===e.label,tooltip:e.tooltip,detailedTooltip:e.detailedTooltip,href:e.href,isKotlinSprintPage:K,isLast:!0,fullHeight:!0},e.label)}),(0,r.jsx)("div",{className:"hidden h-full items-center sm:flex",children:$.map((e,t)=>(0,r.jsx)(D.J,{icon:e.icon,rawValue:e.rawValue,format:e.format,isWorkCoins:"WorkCoins"===e.label,tooltip:e.tooltip,detailedTooltip:e.detailedTooltip,href:e.href,isKotlinSprintPage:K,isLast:t===$.length-1,fullHeight:!0},e.label))})]}):null}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:(0,C.cn)("border-b px-4","flex items-center justify-between h-12",K?"bg-slate-900/95 border-slate-700/50":"bg-white border-gray-200",U),children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 h-8 min-w-0",children:[!B.hasActiveSubscription&&!K&&B.activeCampaign&&(0,r.jsx)(A.TooltipProvider,{children:(0,r.jsxs)(A.Tooltip,{children:[(0,r.jsx)(A.TooltipTrigger,{asChild:!0,children:(0,r.jsxs)(h(),{href:B.activeCampaign.ctaHref,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg bg-violet-50 border border-violet-200 hover:bg-violet-100 transition-colors group text-xs font-semibold text-violet-700 shrink-0",children:[(0,r.jsx)(s.A,{className:"size-3.5 text-violet-600 shrink-0"}),(0,r.jsxs)("span",{className:"whitespace-nowrap",children:["Скидка до ",B.activeCampaign.maxDiscountAmount.toLocaleStr
1ing("ru-RU")," â½"]}),(0,r.jsx)(i.A,{className:"size-3 text-violet-400 group-hover:translate-x-0.5 transition-transform"})]})}),(0,r.jsxs)(A.TooltipContent,{side:"bottom",children:[(0,r.jsx)("p",{className:"font-semibold",children:B.activeCampaign.badgeLabel}),(0,r.jsx)("p",{className:"text-xs text-gray-400",children:B.activeCampaign.title})]})]})}),!K&&et&&(0,r.jsxs)("button",{onClick:()=>(e=>{var t;eo.current=new Set;let a=null==(t=ee[e])?void 0:t.id;a&&eo.current.add(a),ei(e),en(!0),a&&G(async()=>{await (0,b.v)(a)})})(H),className:(0,C.cn)("flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border text-xs min-w-0 max-w-sm cursor-pointer","transition-opacity hover:opacity-80 active:opacity-60","Ðбновление"===et.tag?"bg-violet-50 border-violet-200 text-violet-700":"bg-gray-50 border-gray-200 text-gray-700"),children:[et.tag&&(0,r.jsx)("span",{className:(0,C.cn)("shrink-0 px-1.5 py-0.5 rounded text-[10px] font-semibold border",null!=(v=M[et.tag])?v:"bg-gray-100 text-gray-600 border-gray-200"),children:et.tag}),(0,r.jsx)("span",{className:"truncate font-medium",children:et.title}),ee.length>1&&(0,r.jsxs)("span",{role:"button",tabIndex:0,onClick:e=>{e.stopPropagation(),J(e=>(e+1)%ee.length)},onKeyDown:e=>{"Enter"===e.key&&(e.stopPropagation(),J(e=>(e+1)%ee.length))},className:"shrink-0 opacity-50 hover:opacity-80 transition-opacity text-[10px] font-mono",children:[H+1,"/",ee.length]}),(0,r.jsx)(I,{publishedAt:et.publishedAt,expiresAt:et.expiresAt})]}),!K&&("ADMIN"===Y||"EDITOR"===Y)&&ea&&(0,r.jsxs)("button",{onClick:()=>{G(async()=>{await (0,p.w)();try{localStorage.removeItem(z)}catch(e){}await Z(),J(0)})},className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg bg-gray-50 border border-dashed border-gray-300 text-xs text-gray-400 hover:text-gray-600 hover:border-gray-400 transition-colors shrink-0",children:[(0,r.jsx)(l.A,{className:"size-3 shrink-0"}),(0,r.jsx)("span",{children:"ÐоказаÑÑ Ð½Ð¾Ð²Ð¾ÑÑи"}),(0,r.jsx)(o.A,{className:"size-3 shrink-0"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:(0,C.cn)("flex items-center rounded-lg border h-8",K?"bg-slate-800/30 border-slate-700/50":"bg-gray-100/80 border-gray-200/80"),children:$.map((e,t)=>(0,r.jsx)(D.J,{icon:e.icon,rawValue:e.rawValue,format:e.format,isWorkCoins:"WorkCoins"===e.label,tooltip:e.tooltip,detailedTooltip:e.detailedTooltip,href:e.href,isKotlinSprintPage:K,isLast:t===$.length-1,fullHeight:!0},e.label))}),(0,r.jsx)("div",{className:(0,C.cn)("w-px h-4 shrink-0",K?"bg-slate-700/50":"bg-gray-200")}),(0,r.jsx)(S.r,{}),(0,r.jsx)("div",{className:(0,C.cn)("w-px h-4 shrink-0",K?"bg-slate-700/50":"bg-gray-200")}),(0,r.jsxs)(N.rI,{children:[(0,r.jsx)(N.ty,{asChild:!0,children:(0,r.jsxs)("button",{className:(0,C.cn)("flex items-center gap-1.5 pl-1.5 pr-2 py-1.5 rounded-lg transition-colors",K?"hover:bg-slate-800/30":"hover:bg-gray-50"),children:[(0,r.jsxs)(j.Avatar,{className:(0,C.cn)("size-7 shrink-0",K&&"ring-1 ring-slate-700"),children:[V&&(0,r.jsx)(j.AvatarImage,{src:V,alt:(null==Q?void 0:Q.name)||""}),(0,r.jsx)(j.AvatarFallback,{className:(0,C.cn)("text-xs font-medium text-white",K?"bg-slate-700 text-slate-300":(0,R.$L)((null==Q?void 0:Q.name)||(null==Q?void 0:Q.email)||"User")),children:(0,R.IM)((null==Q?void 0:Q.name)||(null==Q?void 0:Q.email)||"U")})]}),(0,r.jsx)(c.A,{className:(0,C.cn)("size-3.5 shrink-0",K?"text-slate-500":"text-gray-400")})]})}),(0,r.jsxs)(N.SQ,{align:"end",className:(0,C.cn)("w-56",K&&"bg-slate-900 border-slate-700"),children:[(0,r.jsx)(N.lp,{children:(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("p",{className:(0,C.cn)("font-semibold",K&&"text-slate-200 font-mono text-sm"),children:(null==Q?void 0:Q.name)||"ÐолÑзоваÑелÑ"}),(0,r.jsx)("p",{className:(0,C.cn)("text-xs font-normal",K?"text-slate-500 font-mono":"text-gray-500"),children:null==Q?void 0:Q.email})]})}),(0,r.jsx)(N.mB,{className:K?"bg-slate-700":""}),T.r.map(e=>(0,r.jsxs)("div",{children:[e.separatorBefore&&(0,r.jsx)(N.mB,{className:K?"bg-slate-700":""}),(0,r.jsx)(N._2,{asChild:!0,children:(0,r.jsxs)(h(),{href:e.href,className:(0,C.cn)("cursor-pointer",K&&"text-slate-300 font-mono text-[13px] [&:hover]:!bg-slate-800/50 [&:focus]:!bg-slate-800/50"),children:[(0,r.jsx)(e.icon,{className:(0,C.cn)("mr-2 h-4 w-4",K&&"text-slate-500")}),e.label]})})]},e.href)),(0,r.jsx)(N.mB,{className:K?"bg-slate-700":""}),(0,r.jsxs)(N._2,{onClick:()=>{(0,T.X)()},className:(0,C.cn)("cursor-pointer",K?"text-red-400 font-mono text-[13px] [&:hover]:!bg-slate-800/50 [&:focus]:!bg-slate-800/50":"text-red-600"),children:[(0,r.jsx)(d.A,{className:"mr-2 h-4 w-4"}),"ÐÑйÑи"]})]})]})]})]}),(0,r.jsx)(w.lG,{open:er,onOpenChange:e=>{if(!e&&eo.current.size>
10){let e=new Set(eo.current);O(t=>t.map(t=>e.has(t.id)?{...t,isRead:!0}:t)),J(0),eo.current=new Set}en(e)},children:(0,r.jsxs)(w.Cf,{className:"p-0 gap-0 w-[calc(100vw-1rem)] max-w-lg sm:w-full overflow-hidden rounded-2xl",children:[(0,r.jsx)(n.s6,{children:(0,r.jsx)(w.L3,{children:null!=(P=null==el?void 0:el.title)?P:"ÐовоÑÑÑ Ð¿Ð»Ð°ÑÑоÑмÑ"})}),el&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-5 pt-5 pb-0 flex-wrap",children:[el.tag&&(0,r.jsx)("span",{className:(0,C.cn)("shrink-0 px-2 py-0.5 rounded-md text-[11px] font-semibold border",null!=(L=M[el.tag])?L:"bg-gray-100 text-gray-600 border-gray-200"),children:el.tag}),(0,r.jsx)("span",{className:"text-xs text-gray-400",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<60)return t<=1?"ÑолÑко ÑÑо":"".concat(t," мин. назад");let a=Math.floor(t/60);if(a<24)return"".concat(a," Ñ. назад");let r=Math.floor(a/24);return"".concat(r," ").concat(1===r?"денÑ":r<5?"днÑ":"дней"," назад")}(el.publishedAt)})]}),(0,r.jsx)("div",{className:"px-5 pt-3",children:(0,r.jsx)("h2",{className:"text-base font-semibold text-gray-900 leading-snug",children:el.title})}),(0,r.jsx)("div",{className:"px-5 pt-3 pb-5 overflow-y-auto max-h-[55vh]",children:(0,r.jsx)("p",{className:"text-sm text-gray-700 leading-relaxed whitespace-pre-wrap",children:el.content})})]}),!(null==el?void 0:el.myReaction)&&(0,r.jsxs)("div",{className:"flex items-center gap-2 px-5 py-3 border-t border-gray-100",children:[(0,r.jsx)("button",{onClick:()=>ed("up"),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-sm hover:bg-gray-50 hover:text-gray-800 transition-all min-h-[36px]",children:(0,r.jsx)(u.A,{className:"size-4 shrink-0"})}),(0,r.jsx)("button",{onClick:()=>ed("down"),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-gray-200 bg-white text-gray-500 text-sm hover:bg-gray-50 hover:text-gray-800 transition-all min-h-[36px]",children:(0,r.jsx)(m.A,{className:"size-4 shrink-0"})})]}),ee.length>1&&(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-t border-gray-100 bg-gray-50/80",children:[(0,r.jsxs)("button",{onClick:()=>ec((es-1+ee.length)%ee.length),className:"flex items-center gap-1 text-xs text-gray-500 hover:text-gray-800 transition-colors disabled:opacity-30 min-h-[36px] px-2 -mx-2",disabled:0===es,children:[(0,r.jsx)(x.A,{className:"size-4"}),"ÐÑедÑдÑÑее"]}),(0,r.jsxs)("span",{className:"text-xs text-gray-400 tabular-nums",children:[es+1," / ",ee.length]}),(0,r.jsxs)("button",{onClick:()=>ec((es+1)%ee.length),className:"flex items-center gap-1 text-xs text-gray-500 hover:text-gray-800 transition-colors disabled:opacity-30 min-h-[36px] px-2 -mx-2",disabled:es===ee.length-1,children:["СледÑÑÑее",(0,r.jsx)(i.A,{className:"size-4"})]})]})]})})]})}},64269:(e,t,a)=>{a.d(t,{$g:()=>x,Ee:()=>c,Pj:()=>i,ZV:()=>l,_R:()=>d,cn:()=>s,fw:()=>m,r6:()=>u,vv:()=>o});var r=a(2821),n=a(75889);function s(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,n.QP)((0,r.$)(t))}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{offset:a=0,durationMs:r=400}=t,n=e.parentElement;for(;n;){let e=getComputedStyle(n);if(/(auto|scroll)/.test(e.overflowY)&&n.scrollHeight>n.clientHeight)break;n=n.parentElement}if(!n)return void e.scrollIntoView({behavior:"smooth",block:"start"});let s=n.getBoundingClientRect(),i=e.getBoundingClientRect(),l=n.scrollTop,o=l+(i.top-s.top-a),c=performance.now();requestAnimationFrame(function e(t){let a=Math.min((t-c)/r,1);n.scrollTop=l+(o-l)*(a<.5?2*a*a:1-Math.pow(-2*a+2,2)/2),a<1&&requestAnimationFrame(e)})}function l(e){return new Intl.NumberFormat("ru-RU").format(e)}function o(e){return new Intl.NumberFormat("ru-RU",{style:"currency",currency:"RUB",minimumFractionDigits:0}).format(e)}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return"".concat(e.toFixed(t),"%")}function d(e){return e?"\xab".concat(e,"\xbb"):e}function u(e){let t="string"==typeof e?new Date(e):e;return new Intl.DateTimeFormat("ru-RU",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(t)}function m(e){let t="string"==typeof e?new Date(e):e,a=Math.floor((new Date().getTime()-t.getTime())/1e3);if(a<60)return"ÑолÑко ÑÑо";if(a<3600)return"".concat(Math.floor(a/60)," мин. назад");
1if(a<86400)return"".concat(Math.floor(a/3600)," Ñ. назад");if(a<604800)return"".concat(Math.floor(a/86400)," дн. назад");let r="string"==typeof t?new Date(t):t;return new Intl.DateTimeFormat("ru-RU").format(r)}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"RUB";return new Intl.NumberFormat("ru-RU",{style:"currency",currency:t,maximumFractionDigits:0}).format(e)}},64322:(e,t,a)=>{a.d(t,{w:()=>n});var r=a(30926);let n=(0,r.createServerReference)("0055f690b1e668a4296c7e2f47e63e61270c072821",r.callServer,void 0,r.findSourceMapURL,"resetAnnouncementReads")},68564:(e,t,a)=>{a.d(t,{r:()=>A});var r=a(95155),n=a(85998),s=a(5917),i=a(71360),l=a(23664),o=a(52619),c=a.n(o),d=a(12115),u=a(7971),m=a(3998),x=a(26333),g=a(17037),h=a(54518),f=a(53844),p=a(14763),b=a(64269),v=a(57525),y=a(78723),j=a(78519),w=a(65229);function N(e){let{notification:t,onRead:a,onDelete:n}=e,s="PAYMENT_REMINDER"===t.type,i=()=>{t.isRead||a()},l=e=>{e.preventDefault(),e.stopPropagation(),null==n||n()};return s?(0,r.jsxs)("div",{className:(0,b.cn)("relative group border-b transition-colors",t.isRead?"bg-white hover:bg-slate-50":"bg-amber-50 hover:bg-amber-100 dark:bg-amber-950/20 dark:hover:bg-amber-950/30"),children:[(0,r.jsxs)(c(),{href:t.url,onClick:i,className:"flex items-start gap-3 px-3 py-3 pr-10",children:[(0,r.jsx)("div",{className:"flex-shrink-0 mt-0.5 flex size-7 items-center justify-center rounded-full bg-amber-100 dark:bg-amber-900/40",children:(0,r.jsx)(j.A,{className:"size-3.5 text-amber-600 dark:text-amber-400"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:(0,b.cn)("text-sm font-semibold leading-snug",t.isRead?"text-slate-700":"text-amber-900 dark:text-amber-200"),children:t.title}),t.content&&(0,r.jsx)("p",{className:(0,b.cn)("text-xs mt-0.5 line-clamp-2",t.isRead?"text-slate-500":"text-amber-700/90 dark:text-amber-400/80"),children:t.content}),(0,r.jsx)("p",{className:"text-xs text-amber-600/60 dark:text-amber-500/60 mt-1",children:(0,v.m)(new Date(t.createdAt),{addSuffix:!0,locale:y.ru})})]}),!t.isRead&&(0,r.jsx)("div",{className:"w-2 h-2 bg-amber-500 rounded-full mt-1.5 flex-shrink-0"})]}),n&&(0,r.jsx)(m.$,{variant:"ghost",size:"icon",onClick:l,className:"absolute top-2 right-2 h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"УдалиÑÑ Ñведомление",children:(0,r.jsx)(w.A,{className:"w-4 h-4"})})]}):(0,r.jsxs)("div",{className:(0,b.cn)("relative group border-b hover:bg-muted/50 transition-colors",!t.isRead&&"bg-violet-50/50 dark:bg-violet-950/20"),children:[(0,r.jsx)(c(),{href:t.url,onClick:i,className:"block p-3 pr-10",children:(0,r.jsxs)("div",{className:"flex items-start gap-2",children:[!t.isRead&&(0,r.jsx)("div",{className:"w-2 h-2 bg-violet-500 rounded-full mt-1.5 flex-shrink-0"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-foreground",children:t.title}),t.content&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:t.content}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:(0,v.m)(new Date(t.createdAt),{addSuffix:!0,locale:y.ru})})]})]})}),n&&(0,r.jsx)(m.$,{variant:"ghost",size:"icon",onClick:l,className:"absolute top-2 right-2 h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"УдалиÑÑ Ñведомление",children:(0,r.jsx)(w.A,{className:"w-4 h-4"})})]})}function A(){let{notifications:e,unreadCount:t,markAsRead:a,markAllAsRead:o,deleteNotification:v,clearRead:y,isLoading:j}=(0,f.E)(),{user:w}=(0,p.J)(),A=(0,d.useRef)(!1),k=!!w&&null===w.emailVerified,C=e.filter(e=>"PAYMENT_REMINDER"===e.type&&!e.isRead).length>0,R=[...e.filter(e=>"PAYMENT_REMINDER"===e.type&&!e.isRead),...e.filter(e=>!("PAYMENT_REMINDER"===e.type&&!e.isRead))],D=(0,h.dE)();return(0,r.jsxs)(x.AM,{onOpenChange:e=>{e?A.current=t>0:A.current&&(o(),A.current=!1)},children:[(0,r.jsx)(x.Wv,{asChild:!0,children:(0,r.jsxs)(m.$,{variant:"ghost",size:"icon",className:(0,b.cn)("relative size-10 rounded-xl",D&&"hover:bg-slate-800/30"),children:[(0,r.jsx)(n.A,{className:(0,b.cn)("size-5",D?"text-slate-500":"")}
1),(t>0||k)&&(0,r.jsx)("span",{className:(0,b.cn)("absolute top-1 right-1 flex size-4 items-center justify-center rounded-full text-[10px] font-bold",D?"bg-red-900/50 text-red-400":C?"bg-amber-500 text-white":"bg-red-500 text-white"),children:t+ +!!k>9?"9+":t+ +!!k})]})}),(0,r.jsxs)(x.hl,{className:(0,b.cn)("w-80 p-0",D&&"bg-slate-900 border-slate-700"),align:"end",children:[(0,r.jsxs)("div",{className:(0,b.cn)("p-3 border-b space-y-2",D&&"border-slate-700"),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:(0,b.cn)("font-semibold text-base",D&&"text-slate-200 font-mono text-sm"),children:"УведомлениÑ"}),t>0&&(0,r.jsxs)("p",{className:(0,b.cn)("text-xs mt-0.5",D?"text-slate-500 font-mono":"text-muted-foreground"),children:[t," непÑоÑиÑаннÑÑ "]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)(c(),{href:"/announcements",children:(0,r.jsx)(m.$,{variant:"ghost",size:"sm",className:(0,b.cn)("text-xs h-7",D&&"text-slate-400 hover:text-slate-300 hover:bg-slate-800/50"),children:"ÐовоÑÑи"})}),e.length>0&&(0,r.jsx)(c(),{href:"/dashboard/notifications",children:(0,r.jsx)(m.$,{variant:"ghost",size:"sm",className:(0,b.cn)("text-xs h-7",D&&"text-slate-400 hover:text-slate-300 hover:bg-slate-800/50"),children:"ÐÑе"})})]})]}),e.length>0&&(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>o(),disabled:j||0===t,className:(0,b.cn)("flex-1 text-xs h-7",D&&"border-slate-700 text-slate-400 hover:bg-slate-800/50 hover:text-slate-300",0===t&&"opacity-50 cursor-not-allowed"),children:[(0,r.jsx)(s.A,{className:"w-3 h-3 mr-1"}),"ÐÑоÑиÑаÑÑ Ð²ÑÑ"]}),(0,r.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>y(),disabled:j||!e.some(e=>e.isRead),className:(0,b.cn)("flex-1 text-xs h-7",D&&"border-slate-700 text-slate-400 hover:bg-slate-800/50 hover:text-slate-300",!e.some(e=>e.isRead)&&"opacity-50 cursor-not-allowed"),children:[(0,r.jsx)(i.A,{className:"w-3 h-3 mr-1"}),"ÐÑиÑÑиÑÑ"]})]})]}),(0,r.jsxs)(g.F,{className:"h-96",children:[k&&(0,r.jsx)(c(),{href:"/settings",className:"block",children:(0,r.jsxs)("div",{className:"flex items-start gap-3 border-b px-3 py-3 bg-amber-50 hover:bg-amber-100 transition-colors dark:bg-amber-950/20 dark:hover:bg-amber-950/30",children:[(0,r.jsx)("div",{className:"flex-shrink-0 mt-0.5 flex size-7 items-center justify-center rounded-full bg-amber-100 dark:bg-amber-900/40",children:(0,r.jsx)(l.A,{className:"size-3.5 text-amber-600 dark:text-amber-400"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-amber-900 dark:text-amber-200",children:"ÐодÑвеÑдиÑе email"}),(0,r.jsx)("p",{className:"text-xs text-amber-700/80 dark:text-amber-400/80 mt-0.5",children:"ÐеÑейдиÑе в наÑÑÑойки и оÑпÑавÑÑе пиÑÑмо Ð´Ð»Ñ Ð¿Ð¾Ð´ÑвеÑÐ¶Ð´ÐµÐ½Ð¸Ñ Ð°Ð´ÑеÑа"})]}),(0,r.jsx)("div",{className:"w-2 h-2 bg-amber-500 rounded-full mt-1.5 flex-shrink-0"})]})}),0!==e.length||k?(0,r.jsx)("div",{children:R.map(e=>(0,r.jsx)(N,{notification:e,onRead:()=>a(e.id),onDelete:()=>v(e.id)},e.id))}):(0,r.jsxs)("div",{className:(0,b.cn)("p-6 text-center text-sm",D?"text-slate-500":"text-muted-foreground"),children:[(0,r.jsx)(n.A,{className:"w-8 h-8 mx-auto mb-2 opacity-30"}),(0,r.jsx)("p",{className:(0,b.cn)("mb-4",D?"font-mono":""),children:"ÐÐµÑ Ñведомлений"}),!D&&(0,r.jsx)("div",{className:"text-left",children:(0,r.jsx)(u.q,{placement:"notification-bell"})})]})]})]})]})}},91085:(e,t,a)=>{a.d(t,{X:()=>u,r:()=>d});var r=a(20508),n=a(15870),s=a(85998),i=a(78519),l=a(20908),o=a(23327),c=a(58347);let d=[{href:"/profile",icon:r.A,label:"ÐÑоÑилÑ"},{href:"/settings",icon:n.A,label:"ÐаÑÑÑойки"},{href:"/notifications",icon:s.A,label:"УведомлениÑ"},{href:"/payments",icon:i.A,label:"ÐодпиÑки и покÑпки"},{href:"/support",icon:l.A,label:"ÐоддеÑжка",separatorBefore:!0},{href:"/about",icon:o.A,label:"РплаÑÑоÑме"}];async function u(){try{await (0,c.CI)({callbackUrl:"/"})}catch(e){console.error("Failed to sign out:",e)}}}}]); 2//# sourceMappingURL=55037-202b8e9914d4fe9b.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.