"": "const { normalize } = VM.require(\\\"thomasguntenaar.testnet/widget/core.lib.stringUtils\\\");\\n\\nnormalize || (normalize = () => {});\\n\\nconst Button = styled.button`\\n height: 40px;\\n font-size: 14px;\\n border-color: #e3e3e0;\\n background-color: #ffffff;\\n`;\\n\\nconst Banner = styled.div`\\n max-width: 100%;\\n min-height: 240px;\\n height: 240px;\\n`;\\n\\nconst CenteredMessage = styled.div`\\n display: flex;\\n flex-direction: column;\\n justify-content: center;\\n align-items: center;\\n width: 100%;\\n height: ${(p) => p.height ?? \\\"100%\\\"};\\n`;\\n\\nconst NavUnderline = styled.ul`\\n cursor: pointer;\\n a {\\n color: #151515;\\n text-decoration: none;\\n }\\n\\n a.active {\\n font-weight: bold;\\n border-bottom: 4px solid #00ec97;\\n }\\n border-bottom: 1px solid #cccccc;\\n`;\\n\\nconst { tab, permissions, community, view } = props;\\n\\nconst { href } = VM.require(\\\"thomasguntenaar.testnet/widget/core.lib.url\\\");\\n\\nif (!href) {\\n return <></>;\\n}\\n\\nif (!tab) {\\n // TODO edge case when a community has 0 addons\\n tab = \\\"Announcements\\\";\\n // (community.addons || [{ display_name: \\\"Announcements\\\" }])[0].display_name;\\n}\\n\\ntab = normalize(tab);\\n\\nconst [isLinkCopied, setLinkCopied] = useState(false);\\n\\nconst tabs = [\\n // {\\n // title: \\\"Announcements\\\",\\n // view: \\\"thomasguntenaar.testnet/widget/devhub.entity.community.Announcements\\\",\\n // params: {\\n // handle: community.handle,\\n // },\\n // },\\n // {\\n // title: \\\"Discussions\\\",\\n // view: \\\"thomasguntenaar.testnet/widget/devhub.entity.community.Discussions\\\",\\n // params: {\\n // handle: community.handle,\\n // transactionHashes: props.transactionHashes,\\n // },\\n // },\\n // {\\n // title: \\\"Activity\\\",\\n // view: \\\"thomasguntenaar.testnet/widget/devhub.entity.community.Activity\\\",\\n // params: {\\n // handle: community.handle,\\n // },\\n // },\\n // {\\n // title: \\\"Teams\\\",\\n // view: \\\"thomasguntenaar.testnet/widget/devhub.entity.community.Teams\\\",\\n // params: {\\n // handle: community.handle,\\n // },\\n // },\\n];\\n\\n(community.addons || []).map((addon) => {\\n addon.enabled &&\\n tabs.push({\\n title: addon.display_name,\\n view: \\\"thomasguntenaar.testnet/widget/devhub.page.addon\\\",\\n params: { addon, handle: community.handle },\\n });\\n});\\n\\nconst onShareClick = () =>\\n clipboard\\n .writeText(\\n href({\\n gateway: \\\"near.social\\\",\\n widgetSrc: \\\"thomasguntenaar.testnet/widget/app\\\",\\n params: { page: \\\"community\\\", handle: community.handle },\\n })\\n )\\n .then(setLinkCopied(true));\\n\\nlet currentTab = tabs.find((it) => normalize(it.title) === tab);\\n\\nconst CommunityName = styled.span`\\n color: #151515;\\n font-size: 2.25rem;\\n font-style: normal;\\n font-weight: 700;\\n line-height: 100%; /* 48px */\\n\\n @media screen and (max-width: 768px) {\\n font-size: 1.5rem;\\n }\\n`;\\n\\nconst CommunityDetails = styled.span`\\n color: #818181;\\n font-size: 1rem;\\n font-style: normal;\\n font-weight: 400;\\n line-height: 120%; /* 28.8px */\\n`;\\n\\nfunction trimHttps(url) {\\n if (url.startsWith(\\\"https://\\\")) {\\n return url.substring(8);\\n }\\n return url;\\n}\\n\\n// some communties have url as handle (eg: devhub platform) while others has correct handle\\nfunction checkTelegramHandle(tg) {\\n const pattern = /https:\\\\/\\\\/t.me\\\\/(.*)/;\\n const includesHttp = tg.match(pattern);\\n const handle = includesHttp ? includesHttp[1] : tg;\\n return { handle, url: \\\"https://t.me/\\\" + handle };\\n}\\n\\nconst socialLinks = [\\n ...((community.website_url?.length ?? 0) > 0\\n ? [\\n {\\n href: `https://${trimHttps(community.website_url)}`,\\n iconClass: \\\"bi bi-globe\\\",\\n name: trimHttps(community.website_url),\\n },\\n ]\\n : []),\\n\\n ...((community.github_handle?.length ?? 0) > 0\\n ? [\\n {\\n href: `https://github.com/${community.github_handle}`,\\n iconClass: \\\"bi bi-github\\\",\\n name: community.github_handle,\\n },\\n ]\\n : []),\\n\\n ...((community.twitter_handle?.length ?? 0) > 0\\n ? [\\n {\\n href: `https://twitter.com/${community.twitter_handle}`,\\n iconClass: \\\"bi bi-twitter\\\",\\n name: community.twitter_handle,\\n },\\n ]\\n : []),\\n\\n ...(community.telegram_handle?.length > 0\\n ? [\\n {\\n href: checkTelegramHandle(community.telegram_handle).url,\\n iconClass: \\\"bi bi-telegram\\\",\\n name: checkTelegramHandle(community.telegram_handle).handle,\\n },\\n ]\\n : []),\\n];\\n\\nconst NavlinksContainer = styled.div`\\n //background: white;\\n padding: 0 3rem;\\n\\n @media screen and (max-width: 960px) {\\n padding: 0 1rem;\\n }\\n`;\\n\\nreturn (\\n <div\\n className=\\\"d-flex flex-column gap-3 w-100\\\"\\n style={{ background: \\\"#F4F4F4\\\" }}\\n >\\n <Banner\\n className=\\\"object-fit-cover\\\"\\n style={{\\n background: `center / cover no-repeat url(${community.banner_url})`,\\n }}\\n />\\n\\n <div className=\\\"container d-flex flex-wrap justify-content-between align-items-center align-items-md-start gap-4\\\">\\n <div className=\\\"d-flex flex-column ms-3\\\">\\n <div className=\\\"position-relative\\\">\\n <div style={{ width: 150, height: 45 }}>\\n <img\\n alt=\\\"Loading logo...\\\"\\n className=\\\"rounded-circle position-absolute\\\"\\n width=\\\"160\\\"\\n height=\\\"160\\\"\\n src={community.logo_url}\\n style={{ top: -124 }}\\n />\\n </div>\\n </div>\\n\\n <div className=\\\"d-flex flex-column gap-3 ps-md-3 pt-md-3 pb-md-2\\\">\\n <CommunityName className=\\\"text-nowrap\\\">\\n {community.name}\\n </CommunityName>\\n <CommunityDetails>{community.description}</CommunityDetails>\\n </div>\\n\\n <div className=\\\"mt-3 ps-3 d-flex gap-3 align-items-center\\\">\\n {socialLinks.map((link, index) => (\\n <a\\n href={link.href}\\n style={{\\n marginLeft: index !== 0 ? \\\"0px\\\" : \\\"0px\\\",\\n color: \\\"#818181\\\",\\n }}\\n key={link.href}\\n target=\\\"_blank\\\"\\n >\\n <i className={link.iconClass}></i>\\n </a>\\n ))}\\n </div>\\n </div>\\n\\n <div className=\\\"d-flex align-items-end gap-3 ms-auto mb-md-5 me-4\\\">\\n {permissions.can_configure && (\\n <Link\\n to={`/thomasguntenaar.testnet/widget/app?page=community.configuration&handle=${community.handle}`}\\n >\\n <Widget\\n src={\\\"thomasguntenaar.testnet/widget/devhub.components.molecule.Button\\\"}\\n props={{\\n classNames: { root: \\\"btn-outline-light text-dark shadow-none\\\" },\\n notRounded: true,\\n style: {\\n display: \\\"flex\\\",\\n padding: \\\"0.75rem 1rem\\\",\\n alignItems: \\\"center\\\",\\n gap: \\\"16px\\\",\\n\\n borderRadius: \\\"4px\\\",\\n border: \\\"1px solid #00EC97\\\",\\n background: \\\"rgba(129, 129, 129, 0.00)\\\",\\n },\\n icon: {\\n type: \\\"bootstrap_icon\\\",\\n variant: \\\"bi-gear-wide-connected\\\",\\n },\\n label: \\\"Configure community\\\",\\n }}\\n />\\n </Link>\\n )}\\n <Widget\\n src={\\\"thomasguntenaar.testnet/widget/devhub.components.molecule.Button\\\"}\\n props={{\\n classNames: { root: \\\"btn-outline-light text-dark shadow-none\\\" },\\n notRounded: true,\\n style: {\\n display: \\\"flex\\\",\\n padding: \\\"0.75rem 1rem\\\",\\n alignItems: \\\"center\\\",\\n gap: \\\"16px\\\",\\n\\n borderRadius: \\\"4px\\\",\\n border: \\\"1px solid #00EC97\\\",\\n background: \\\"rgba(129, 129, 129, 0.00)\\\",\\n },\\n label: \\\"Share \\u{2197}\\\",\\n onClick: onShareClick,\\n onMouseLeave: () => setLinkCopied(false),\\n title: \\\"Copy link to clipboard\\\",\\n }}\\n />\\n </div>\\n </div>\\n <NavlinksContainer>\\n <NavUnderline className=\\\"nav gap-4 my-4\\\">\\n {tabs.map(\\n ({ title }) =>\\n title && (\\n <li className=\\\"nav-item\\\" key={title}>\\n <Link\\n to={href({\\n widgetSrc: \\\"thomasguntenaar.testnet/widget/app\\\",\\n params: {\\n page: \\\"community\\\",\\n handle: community.handle,\\n tab: normalize(title),\\n },\\n })}\\n aria-current={tab === normalize(title) && \\\"page\\\"}\\n className={[\\n \\\"d-inline-flex gap-2\\\",\\n tab === normalize(title) ? \\\"nav-link active\\\" : \\\"nav-link\\\",\\n ].join(\\\" \\\")}\\n >\\n <span>{title}</span>\\n </Link>\\n </li>\\n )\\n )}\\n </NavUnderline>\\n {currentTab.title === \\\"Activity\\\" && (\\n <div\\n className=\\\"my-4 d-flex align-items-center justify-content-between\\\"\\n style={{ gap: \\\"2.5rem\\\" }}\\n >\\n <div class=\\\"d-flex align-items-center justify-content-between\\\">\\n <small class=\\\"text-muted\\\">\\n <span>Required tags:</span>\\n <Link\\n to={href({\\n widgetSrc: \\\"thomasguntenaar.testnet/widget/app\\\",\\n params: { page: \\\"feed\\\", tag: community.tag },\\n })}\\n >\\n <Widget\\n src={\\\"thomasguntenaar.testnet/widget/devhub.components.atom.Tag\\\"}\\n props={{\\n tag: community.tag,\\n }}\\n />\\n </Link>\\n </small>\\n </div>\\n {context.accountId && (\\n <Widget\\n src={\\n \\\"thomasguntenaar.testnet/widget/devhub.components.molecule.PostControls\\\"\\n }\\n props={{\\n title: \\\"Post\\\",\\n href: href({\\n widgetSrc: \\\"thomasguntenaar.testnet/widget/app\\\",\\n params: {\\n page: \\\"create\\\",\\n labels: [community.tag],\\n },\\n }),\\n }}\\n />\\n )}\\n </div>\\n )}\\n </NavlinksContainer>\\n {currentTab && (\\n <div className=\\\"d-flex w-100 h-100\\\" key={currentTab.title}>\\n <Widget\\n src={currentTab.view}\\n props={{\\n ...currentTab.params,\\n view, // default view for an addon, can come as a prop from a community or from a direct link to page.addon\\n\\n // below is temporary prop drilling until kanban and github are migrated\\n permissions,\\n handle: community.handle,\\n }}\\n />\\n </div>\\n )}\\n </div>\\n);\\n"