PageSourceSearch

https://app.rocketlanguages.com/assets/_languageslug_-BH7F9sZ_.js

js rocketlanguages.com collected 2026-10-01 11:49:13 UTC 6,757 bytes, 2 lines download raw bytes

1import{r as i,t as y,k as d,j as e,e as C,L as f,aU as _,aV as p,P as N,E as L,u as P,w as S,l as T,f as $,q as E,aW as F,aS as O,aX as M}from"./index-CM3wFXu8.js";import{T as k}from"./ThreadTab-BDyWkht8.js";import{T as I}from"./Tag-Be5kFRj-.js";import{g as Z,u as A,a as G}from"./utils-u_3avwLy.js";import"./index-B7pumEhT.js";import"./Calendar-ruUKsV2v.js";var K=Object.defineProperty,g=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,v=(n,s,r)=>s in n?K(n,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[s]=r,j=(n,s)=>{for(var r in s||(s={}))R.call(s,r)&&v(n,r,s[r]);if(g)for(var r of g(s))W.call(s,r)&&v(n,r,s[r]);return n};const z=(n,s)=>{const r=i.useContext(y),t=j(j({},r),n);return i.createElement("svg",j({width:"1.5em",height:"1.5em",strokeWidth:1.5,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"currentColor",ref:s},t),i.createElement("path",{d:"M17 12.5C17.2761 12.5 17.5 12.2761 17.5 12C17.5 11.7239 17.2761 11.5 17 11.5C16.7239 11.5 16.5 11.7239 16.5 12C16.5 12.2761 16.7239 12.5 17 12.5Z",fill:"currentColor",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{d:"M12 12.5C12.2761 12.5 12.5 12.2761 12.5 12C12.5 11.7239 12.2761 11.5 12 11.5C11.7239 11.5 11.5 11.7239 11.5 12C11.5 12.2761 11.7239 12.5 12 12.5Z",fill:"currentColor",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{d:"M7 12.5C7.27614 12.5 7.5 12.2761 7.5 12C7.5 11.7239 7.27614 11.5 7 11.5C6.72386 11.5 6.5 11.7239 6.5 12C6.5 12.2761 6.72386 12.5 7 12.5Z",fill:"currentColor",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{d:"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 13.8214 2.48697 15.5291 3.33782 17L2.5 21.5L7 20.6622C8.47087 21.513 10.1786 22 12 22Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}))},B=i.forwardRef(z);var V=B;function q({state:n}){const s=d(),[r,t]=i.useState(null);if(i.useEffect(()=>{n?.status==="loaded"&&n.data.notified_conversations.length&&!r&&t(n.data.notified_conversations)},[n,r]),n?.status!=="loaded"||!n.data.notified_conversations.length||!r||!r.length)return null;const a=()=>{t([]),C.put("v2/forum/clear-notifications")};return e.jsxs("div",{className:"mb-4 sm:mb-8",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("h2",{className:"mb-2 font-sans",children:s("announcements")}),e.jsx("button",{onClick:a,className:"font-sans font-bold text-missilebrand underline dark:text-text2",children:s("discard-all")})]}),e.jsx("div",{children:r?.map(l=>e.jsx("div",{className:"my-2",children:e.jsx(k,{thread:l,languageSlug:l.category.course?.slug||"general"})},l.id))})]})}function D({courseId:n,categoryName:s,categorySlug:r,courseSlug:t,latestActivity:a,conversations:l,comments:o}){const m=d();function u(){const c=Z(n),x=p.get(c);if(!Array.isArray(x)){console.warn("no state found",c);return}const w=x.map(h=>h.latest_post_thread.id===a.id?{...h,latest_post_thread:{...h.latest_post_thread,is_new:!1}}:h);p.set(c,w)}return e.jsxs("div",{className:"bg-missilesurfacelight hover:bg-missilestroke space-y-2 rounded-2xl p-4 sm:p-6 hover:dark:bg-neutral-700",children:[e.jsx(f,{to:`/members/forum/${t}/${r}`,children:e.jsx("h4",{className:"text-xl",children:s})}),e.jsxs("div",{children:[m("most-recent-comment"),":"," ",e.jsx(f,{to:`/members/forum/${t}/${r}/${a?.slug}`,onClick:u,children:a?.title}),a?.is_new&&e.jsx("span",{className:"pl-2",children:e.jsx(I,{label:m("new"),color:"success"})})]}),e.jsxs("div",{className:"",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{}),e.jsx("span",{children:m("conversations")}),e.jsxs("span",{children:["(",l,")"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{}),e.jsx("span",{children:m("comments",void 0,o)}),e.jsxs("span",{children:["(",o,")"]})]})]})]})}function b({name:n,courseId:s,courseSlug:r}){const t=d(),{state:a}=A(s);return e.jsxs("div",{className:"mb-4 sm:mb-8",children:[e.jsx("h2",{className:"mb-2",children:n}),e.jsx("div",{className:"my-2",children:e.jsx(N,{state:a,children:l=>e.jsx(e.Fragment,{children:l.map(o=>e.jsx("div",{className:"my-2",children:e.jsx(D,{courseId:s,categoryName:r==="general"&&t(`general-${o.slug}`)||o.name,categorySlug:o.slug,courseSlug:r,latestActivity:o.latest_post_thread,conversations:o.thread_count,comments:o.post_count})},o.id))})})})]})}function J({state:n}){const s=d();return e.jsxs("div",{className:"mb-4 sm:mb-8",children:[e.jsx("h2",{className:"mb-2 font-sans",children:s("your-conversations")}),e.jsx("p",{children:s("your-conversations-description")}),e.jsx("div",{className:"my-2",children:e.jsx(N,{state:n,children:({recent_conversations:r})=>e.jsx(e.Fragment,{children:r.slice(0,5).map(t=>e.jsx("div",{className:"my-2",children:e.jsx(k,{thread:t,languageSlug:t.category.course?.slug||"general"})},t.id))})})})]})}function se(){const n=L(),s=d(),{languageSlug:r}
1=P(),t=S(),a=G(r),m=T(x=>x.user).isGuest?{onClick:()=>n(M())}:{use:f,to:"create"},{state:u}=$(()=>C.getJson("v2/forum/user-forum-data",{course_id:a.courseId}),{once:!0,cacheKey:`forum-${r}`}),c=`${t?.name} ${s("forum")}`;return E(c),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-1 mt-2 h-min max-w-[100vw] overflow-hidden text-ellipsis whitespace-nowrap",children:e.jsx(f,{to:`/members/forum/${r}`,className:"text-sm font-bold text-slate-600 underline dark:text-text1",children:c})}),e.jsxs("div",{className:"flex min-h-[300px] w-full flex-grow flex-col border border-missilestroke bg-surface2 p-2 sm:rounded-2xl sm:p-8",children:[e.jsxs("div",{className:"flex items-center gap-2 pb-4",children:[e.jsx("div",{className:"flex size-10 items-center justify-center rounded-full border border-neutral-500/10 bg-missilestroke text-missilegray2 dark:text-white",children:e.jsx(F,{className:"size-5",strokeWidth:2})}),e.jsx("h1",{className:"text-3xl font-bold",children:c})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4 sm:mb-8",children:[e.jsx("p",{className:"mb-2",children:s("forum-description-1-{language}",{language:t?.name||""})}),e.jsx("p",{className:"mb-2",children:s("forum-description-2")}),e.jsx("div",{className:"mt-4 flex justify-center",children:e.jsx(O,{color:"primary",...m,children:s("start-a-new-conversation")})})]}),e.jsx(q,{state:u}),e.jsx(J,{state:u}),e.jsx(b,{courseId:a.courseId,name:s("rocket-{language}-categories-{categories}",{language:a.courseName,categories:s("categories",void 0,2)}),courseSlug:a.courseSlug}),e.jsx(b,{courseId:0,name:s("general-categories"),courseSlug:"general"})]})]})]})}export{se as default};
2//# sourceMappingURL=_languageslug_-BH7F9sZ_.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.