PageSourceSearch

https://www.instaloops.com/_next/static/chunks/74050-632b9945a4185fbe.js?dpl=dpl_7CPoWkAiPqTovoki6vBoTDFPVrWX

js instaloops.com collected 2026-10-09 22:41:56 UTC 43,466 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[74050],{74050:function(e,t,a){a.d(t,{default:function(){return G}});var i=a(65724),r=a(67475),n=a(16752),l=a(50598),s=a(81230),o=a(33135),c=a(16447),d=a(61763),m=a(22273),u=a(80710),x=a(54704),p=a(2512),h=a(28266),g=a(55127),f=a(30724),b=a(70391);a(41302);var v=a(76205),y=e=>{let{playbackId:t,aspectRatio:a=16/9,className:r,posterUrl:n,title:s,autoPlay:o=!1}=e,[c,d]=(0,p.useState)(!0),[m,u]=(0,p.useState)(null),[x,h]=(0,p.useState)(null),[g,y]=(0,p.useState)(a),j=(0,p.useRef)(null),w=(0,p.useRef)(null);return(0,p.useEffect)(()=>{(async()=>{try{let{blurDataURL:e,aspectRatio:a}=await (0,f.Q)(t,{width:1280,height:720,blur:20,quality:1,type:"webp"});h(e),a&&y(a)}catch(e){console.error("Error generating blur data:",e)}})()},[t]),(0,p.useEffect)(()=>{let e=j.current;if(!e)return;let a=()=>{d(!1),o&&e.play().catch(()=>{})},i="https://stream.mux.com/".concat(t,".m3u8");if(e.addEventListener("loadedmetadata",a),e.canPlayType("application/vnd.apple.mpegurl"))e.src=i;else if(l.ZP.isSupported()){let t=new l.ZP({enableWorker:!0,lowLatencyMode:!0,backBufferLength:90});return t.loadSource(i),t.attachMedia(e),t.on(l.ZP.Events.ERROR,(e,t)=>{t.fatal&&(console.error("HLS error:",t),u("An error occurred while loading the video."))}),()=>{e.removeEventListener("loadedmetadata",a),t.destroy()}}else u("Your browser does not support HLS playback.");return()=>{e.removeEventListener("loadedmetadata",a)}},[t,o]),(0,i.jsxs)("div",{className:(0,v.cn)("relative w-full overflow-hidden bg-gray-900",r),style:{paddingTop:"".concat(1/g*100,"%")},children:[(0,i.jsx)("template",{ref:w,id:"media-theme-yt",dangerouslySetInnerHTML:{__html:'\n            <style>\n              media-controller {\n                font-size: 13px;\n                font-family: Roboto, Arial, sans-serif;\n                --media-font-family: Roboto, Helvetica Neue, Segoe UI, Arial, sans-serif;\n                -webkit-font-smoothing: antialiased;\n                --media-secondary-color: transparent;\n                --media-menu-background: rgba(28, 28, 28, 0.9);\n                --media-control-hover-background: var(--media-secondary-color);\n                --media-range-track-height: 3px;\n                --media-range-thumb-height: 13px;\n                --media-range-thumb-width: 13px;\n                --media-range-thumb-border-radius: 13px;\n                --media-preview-thumbnail-border: 2px solid #fff;\n                --media-preview-thumbnail-border-radius: 2px;\n                --media-tooltip-display: none;\n              }\n\n              media-controller[mediaisfullscreen] {\n                font-size: 17px;\n                --media-range-thumb-height: 20px;\n                --media-range-thumb-width: 20px;\n                --media-range-thumb-border-radius: 10px;\n                --media-range-track-height: 4px;\n              }\n\n              .yt-gradient-bottom {\n                padding-top: 37px;\n                position: absolute;\n                width: 100%;\n                height: 170px;\n                bottom: 0;\n                pointer-events: none;\n                background-position: bottom;\n                background-repeat: repeat-x;\n                background-image: url(\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAACqCAYAAABsziWkAAAAAXNSR0IArs4c6QAAAQVJREFUOE9lyNdHBQAAhfHb3nvvuu2997jNe29TJJEkkkgSSSSJJJJEEkkiifRH5jsP56Xz8PM5gcC/xfDEmjhKxEOCSaREEiSbFEqkQppJpzJMJiWyINvkUCIX8kw+JQqg0BRRxaaEEqVQZsopUQGVpooS1VBjglStqaNEPTSYRko0QbNpoUQrtJl2qsN0UqILuk0PJXqhz/RTYgAGzRA1bEYoMQpjZpwSExAyk5SYgmkzQ82aOUqEIWKilJiHBbNIiSVYhhVYhTVYhw3YhC3Yhh3YhT3YhwM4hCM4hhM4hTM4hwu4hCu4hhu4hTu4hwd4hCd4hhd4hTd4hw/4hC/4hh/4/QM2/id28uIEJAAAAABJRU5ErkJggg==\');\n              }\n\n              media-control-bar {\n                position: absolute;\n                height: 36px;\n                line-height: 36px;\n                bottom: 0;\n                left: 12px;\n                right: 12px;\n                display: flex;\n                align-items: center;\n                justify-content: space-between;\n                background: rgba(0, 0, 0, 0.5);\n                padding: 0 10px;\n              }\n\n              [breakpointmd] media-control-bar {\n                height: 48px;\n                line-height: 48px;\n              }\n\n              [mediaisfullscreen] media-control-bar {\n                height: 54px;\n                line-height: 54px;\n              }\n\n              media-play-button, media-mute-button, media-fullscreen-button {\n                width: 30px;\n                height: 30px;\n                cursor: pointer;\n              }\n\n              media-play-button svg, media-mute-button svg, media-fullscreen-button svg {\n                fill: var(--media-primary-color, #fff);\n                width: 100%;\n                height: 100%;\n              }\n\n              media-volume-range {\n                width: 100px;\n                margin-left: 10px;\n              }\n\n              media-time-display {\n                color: var(--media-primary-color, #fff);\n                font-size: 12px;\n                margin-left: 10px;\n              }\n            </style>\n\n            <media-controller\n              breakpoints="md:480"\n              defaultsubt
1itles="{{defaultsubtitles}}"\n              defaultduration="{{defaultduration}}"\n              gesturesdisabled="{{disabled}}"\n              hotkeys="{{hotkeys}}"\n              nohotkeys="{{nohotkeys}}"\n              defaultstreamtype="on-demand"\n            >\n              <slot name="media" slot="media"></slot>\n              <slot name="poster" slot="poster"></slot>\n              <media-error-dialog slot="dialog"></media-error-dialog>\n\n              <div class="yt-gradient-bottom"></div>\n\n              <media-control-bar>\n                <media-play-button>\n                  <svg viewBox="0 0 36 36">\n                    <path d="M14 10V26L22 18L14 10Z" />\n                  </svg>\n                </media-play-button>\n\n                <media-mute-button>\n                  <svg viewBox="0 0 36 36">\n                    <path d="M9 13H5V23H9L16 30V6L9 13Z" />\n                  </svg>\n                </media-mute-button>\n\n                <media-volume-range></media-volume-range>\n                <media-time-display showcurrent="true" showduration="true"></media-time-display>\n\n                <media-fullscreen-button>\n                  <svg viewBox="0 0 36 36">\n                    <path d="M29 5H25V1H19V5H15V11H19V15H25V11H29V5Z" />\n                    <path d="M7 31H11V35H17V31H21V25H17V21H11V25H7V31Z" />\n                  </svg>\n                </media-fullscreen-button>\n              </media-control-bar>\n            </media-controller>\n          '}}),(0,i.jsxs)("div",{className:"absolute inset-0",children:[c&&x&&(0,i.jsx)("img",{src:x,alt:s||"Loading thumbnail",className:"absolute inset-0 h-full w-full object-cover",style:{filter:"blur(20px)"}}),m&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-900 p-4 text-white",children:m}),(0,i.jsxs)(b.W,{template:w.current||void 0,style:{"--media-primary-color":"#f2f2f2","--media-secondary-color":"#f2f2f2","--media-accent-color":"#ea333d"},children:[n&&(0,i.jsx)("img",{slot:"poster",src:n,alt:s||"Video thumbnail",className:"absolute inset-0 h-full w-full object-cover"}),(0,i.jsx)("video",{ref:j,slot:"media",className:"absolute inset-0 h-full w-full object-cover",playsInline:!0,crossOrigin:"anonymous",preload:"metadata","data-preview":"https://image.mux.com/".concat(t,"/storyboard.png")})]})]})]})},j=a(6749),w=a(6082),N=a(79449);let _=e=>{if(e)try{if(e.includes("mux.com")){let t=e.match(/\/([a-zA-Z0-9]+)(\.|\/|$)/);return null==t?void 0:t[1]}return new URL(e).searchParams.get("playbackId")||void 0}catch(e){return}},k=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"usd",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"month",i=new Intl.NumberFormat("en-US",{style:"currency",currency:t.toUpperCase(),minimumFractionDigits:0,maximumFractionDigits:0}).format(e/100);return"".concat(i,"/").concat(a)},C=e=>{if(e>=1e6){let t=e/1e6;return t%1==0?"".concat(t,"m"):"".concat(t.toFixed(1),"m")}if(e>=1e3){let t=e/1e3;return t%1==0?"".concat(t,"k"):"".concat(t.toFixed(1),"k")}return e.toLocaleString()},A=(e,t)=>1===e?t:"".concat(t,"s"),S=e=>{let t=e.replace("#","").trim(),a=3===t.length?t.split("").map(e=>e+e).join(""):t;if(!/^[0-9a-f]{6}$/i.test(a))return"#ffffff";let i=parseInt(a.slice(0,2),16)/255,r=parseInt(a.slice(2,4),16)/255,n=parseInt(a.slice(4,6),16)/255,l=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*l(i)+.7152*l(r)+.0722*l(n)>.45?"#0f0f0f":"#ffffff"},E=e=>{let t=Math.round(e),a=Math.floor(t/3600),i=Math.floor(t%3600/60),r=String(t%60).padStart(2,"0");return a>0?"".concat(a,":").concat(String(i).padStart(2,"0"),":").concat(r):"".concat(i,":").concat(r)},V=e=>{let[t,a]=(0,p.useState)(null);return(0,p.useEffect)(()=>{if(!e){a(null);return}a(null);let t="https://stream.mux.com/".concat(e,".m3u8"),i=document.createElement("video");i.preload="metadata";let r=null,n=()=>{Number.isFinite(i.duration)&&i.duration>0&&a(i.duration)};return i.canPlayType("application/vnd.apple.mpegurl")?(i.addEventListener("loadedmetadata",n),i.src=t):l.ZP.isSupported()&&((r=new l.ZP({enableWorker:!1})).loadSource(t),r.attachMedia(i),r.on(l.ZP.Events.LEVEL_LOADED,(e,t)=>{var i;let r=null==t?void 0:null===(i=t.details)||void 0===i?void 0:i.totalduration;r&&r>0&&a(r)})),()=>{i.removeEventListener("loadedmetadata",n),null==r||r.destroy(),i.removeAttribute("src")}},[e]),t},P=e=>{let{className:t}=e;return(0,i.jsx)("svg",{viewBox:"0 0 40 20",fill:"currentColor",className:t,xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M3.8 10C3.8 6.58 6.58 3.8 10 3.8H18V0H10C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20H18V16.2H10C6.58 16.2 3.8 13.42 3.8 10ZM12 12H28V8H12V12ZM30 0H22V3.8H30C33.42 3.8 36.2 6.58 36.2 10C36.2 13.42 33.42 16.2 30 16.2H22V20H30C35.52 20 40 15.52 40 10C40 4.48 35.52 0 30 0Z"})})},I=()=>(0,i.jsx)("span",{className:"flex h-[46px] w-[64px] items-center justify-center transition-transform group-hover/vid:scale-110",children:(0,i.jsxs)("svg",{width:"64",height:"46",viewBox:"0 0 64 46",fill:"#202124",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{d:"M62.6071 7.28471C61.8729 4.52706 60.2635 2.19294 57.5059 1.45882C52.5082 0.122353 32 0 32 0C32 0 11.4918 0.122353 6.49412 1.45882C3.73647 2.19294 2.13647 4.52706 1.39294 7.28471C0.0564706 12.2824 0 22.5882 0 22.5882C0 22.5882 0.0564706 32.8941 1.39294 37.8918C2.12706 40.6494 3.73647 42.9835 6.49412 43.7176C11.4918 45.0541 32 45.1765 32 45.1765C32 45.1765 52.5082 45.0541 57.5059 43.7176C60.2635 42.9835 61.8729 40.6494 62.6071 37.8918C63.9435 32.8941 64 22.5882 64 22.5882C64 22.5882 63.9435 12.2824 62.6071 7.28471Z",fill:"#202124",fillOpacity:"0.9"}),(0,i.jsx)("path",{d:"M42.3533 22.5883L25.4121 13.1765V32",fill:"#FFFFFF"})]})}),z=()=>(0,i.jsx)("div",{className:"mx-auto max-w-[1112px] px-4 pb-16 pt-3 md:px-0 md:pt-6",children:(0,i.jsxs)("div",{className:"flex animate-pulse flex-col gap-6 lg:flex-row lg:gap-12",children:[(0,i.jsxs)("div",{className:"min-w-0 flex-1 space-y-4",children:[(0,i.jsx)("div",{className:"h-7 w-2/3 rounded-md bg-gray-200 md:h-8"}),(0,i.jsx)("div",{className:"aspect-video w-full rounded-xl bg-gray-200"}),(0,i.jsx)("div",{className:"flex gap-2",children:Array.from({length:4}).map((e,t)=>(0,i.jsx)("div",{className:"h-[84px] w-[84px] rounded-lg bg-gray-200"},t))}),(0,i.jsxs)("div",{className:"flex flex-wrap gap-3 pt-1",children:[(0,i.jsx)("div",{className:"h-4 w-20 rounded bg-gray-200"}),(0,i.jsx)("div",{className:"h-4 w-28 rounded bg-gray-200"}),(0,i.jsx)("div",{className:"h-4 w-16 rounded bg-gray-200"}),(0,i.jsx)("div",{className:"h-4 w-32 rounded bg-gray-200"})]}),(0,i.jsx)("div",{className:"space-y-2.5 pt-3",children:Array.from({length:6}).map((e,t)=>(0,i.jsx)("div",{className:"h-4 rounded bg-gray-200",style:{width:"".concat([92,84,96,70,88,60][t],"%")}},t))})]}),(0,i.jsx)("div",{className:"w-full flex-shrink-0 lg:w-[280px]",children:(0,i.jsxs)("div",{className:"overflow-hidden rounded-xl border border-gray-200",children:[(0,i.jsx)("div",{className:"aspect-[16/9] w-full bg-gray-200"}),(0,i.jsxs)("div",{className:"space-y-4 p-4",children:[(0,i.jsx)("div",{className:"h-5 w-1/2 roun
1ded bg-gray-200"}),(0,i.jsx)("div",{className:"h-3 w-2/3 rounded bg-gray-200"}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)("div",{className:"h-3 w-3/4 rounded bg-gray-200"}),(0,i.jsx)("div",{className:"h-3 w-2/3 rounded bg-gray-200"})]}),(0,i.jsx)("div",{className:"h-12 w-full rounded bg-gray-200"}),(0,i.jsx)("div",{className:"h-12 w-full rounded-lg bg-gray-200"})]})]})})]})}),F=e=>{let{slug:t,communityId:a,name:r,iconOnly:n,className:l}=e,[c,d]=(0,p.useState)(!1),m=async()=>{let e=window.location.origin,i=t?"".concat(e,"/").concat(t):"".concat(e,"/community/").concat(a);if("undefined"!=typeof navigator&&navigator.share){try{await navigator.share({title:r,url:i})}catch(e){}return}try{await navigator.clipboard.writeText(i),d(!0),h.Am.success("Link copied to clipboard"),setTimeout(()=>d(!1),2e3)}catch(e){h.Am.error("Could not copy link")}};return n?(0,i.jsx)("button",{type:"button",onClick:m,"aria-label":"Share ".concat(r),className:(0,v.cn)("flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-lg border border-gray-300 bg-white text-gray-700 transition-all hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#0f0f0f]/30 active:scale-95",l),children:c?(0,i.jsx)(s.Z,{className:"h-5 w-5 text-green-600"}):(0,i.jsx)(o.Z,{className:"h-5 w-5"})}):(0,i.jsx)(j.z,{onClick:m,variant:"outline",className:(0,v.cn)("h-10 w-full gap-2 rounded-lg border-gray-300 text-sm font-semibold text-gray-700 transition-all hover:bg-gray-50 active:scale-[0.99]",l),children:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.Z,{className:"h-4 w-4 text-green-600"})," Copied!"]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.Z,{className:"h-4 w-4"})," Share"]})})},L=e=>{let{item:t}=e,[a,r]=(0,p.useState)(!1),n=V(t.playbackId);return a&&t.playbackId?(0,i.jsx)(y,{playbackId:t.playbackId,aspectRatio:t.aspect_ratio,className:"h-full w-full",posterUrl:t.playbackId?"https://image.mux.com/".concat(t.playbackId,"/thumbnail.png?width=1280"):t.animated_thumbnail,title:t.title,autoPlay:!0}):(0,i.jsxs)("button",{type:"button",onClick:()=>r(!0),"aria-label":t.title?"Play ".concat(t.title):"Play video",className:"group/vid absolute inset-0 h-full w-full",children:[(0,i.jsx)("img",{src:t.playbackId?"https://image.mux.com/".concat(t.playbackId,"/thumbnail.png?width=1280"):t.animated_thumbnail||t.url,alt:t.title||"Video thumbnail",className:"h-full w-full object-cover"}),(0,i.jsx)("span",{className:"absolute inset-0 flex items-center justify-center",children:(0,i.jsx)(I,{})}),null!==n&&(0,i.jsx)("span",{className:"absolute bottom-2 right-2 rounded bg-black/80 px-1.5 py-0.5 text-[12px] font-medium leading-none text-white",children:E(n)})]})},R=e=>{let{mediaItems:t,canEdit:a,onUploadClick:l}=e,[s,o]=(0,p.useState)(0),m=(0,p.useRef)(null),u=(null==t?void 0:t.length)>0,x=u?t[s]:null,h=t.some(e=>!e.isCover),g=(0,p.useCallback)(()=>{o(e=>e>0?e-1:t.length-1)},[t.length]),f=(0,p.useCallback)(()=>{o(e=>e<t.length-1?e+1:0)},[t.length]);return u?(0,i.jsxs)("div",{className:"space-y-3",children:[(0,i.jsx)("div",{className:"group relative w-full overflow-hidden rounded-xl bg-black",children:(0,i.jsxs)("div",{className:"relative aspect-video",children:[(null==x?void 0:x.type)==="video"&&x.playbackId?(0,i.jsx)(L,{item:x},x.media_id||s):x?(0,i.jsx)("img",{src:x.url,alt:x.title||"Media ".concat(s+1),className:"h-full w-full object-cover"}):null,t.length>1&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("button",{onClick:g,"aria-label":"Previous media",className:"absolute left-3 top-1/2 flex h-9 w-9 -translate-y-1/2 items-center justify-center rounded-full bg-white/90 opacity-100 shadow-md transition-all hover:bg-white focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#0f0f0f]/30 active:scale-95 md:opacity-0 md:group-hover:opacity-100",children:(0,i.jsx)(c.Z,{className:"h-5 w-5 text-gray-700"})}),(0,i.jsx)("button",{onClick:f,"aria-label":"Next media",className:"absolute right-3 top-1/2 flex h-9 w-9 -translate-y-1/2 items-center justify-center rounded-full bg-white/90 opacity-100 shadow-md transition-all hover:bg-white focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#0f
10f0f]/30 active:scale-95 md:opacity-0 md:group-hover:opacity-100",children:(0,i.jsx)(d.Z,{className:"h-5 w-5 text-gray-700"})})]}),a&&(0,i.jsx)("button",{"aria-label":"Add media",onClick:l,className:"absolute right-3 top-3 rounded-full bg-black/50 p-2.5 text-white opacity-0 transition-colors hover:bg-black/70 group-hover:opacity-100",children:(0,i.jsx)(n.G,{icon:r.TzT,className:"h-3.5 w-3.5"})})]})}),h&&(0,i.jsx)("div",{className:"relative",ref:m,children:(0,i.jsx)("div",{className:"scrollbar-none flex gap-2 overflow-x-auto pb-1",children:t.map((e,t)=>(0,i.jsx)("button",{onClick:()=>o(t),"aria-label":"View ".concat("video"===e.type?"video":"image"," ").concat(t+1),className:(0,v.cn)("relative h-[84px] w-[84px] flex-shrink-0 overflow-hidden rounded-lg transition-all","border-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#202124]/30",t===s?"border-[#202124] shadow-sm":"border-transparent opacity-70 hover:scale-[1.04] hover:opacity-100"),children:"video"===e.type?(0,i.jsxs)(i.Fragment,{children:[e.animated_thumbnail?(0,i.jsx)("img",{src:e.animated_thumbnail,alt:e.title||"Video ".concat(t+1),className:"h-full w-full object-cover"}):(0,i.jsx)("div",{className:"flex h-full w-full items-center justify-center bg-gray-800",children:(0,i.jsx)(n.G,{icon:r.zc,className:"h-3 w-3 text-white"})}),(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,i.jsx)("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-black/60",children:(0,i.jsx)(n.G,{icon:r.zc,className:"ml-0.5 h-2 w-2 text-white"})})})]}):(0,i.jsx)("img",{src:e.url,alt:e.title||"Image ".concat(t+1),className:"h-full w-full object-cover"})},e.media_id||t))})})]}):a?(0,i.jsxs)("button",{onClick:l,className:"flex aspect-video w-full cursor-pointer flex-col items-center justify-center rounded-xl border-2 border-dashed border-gray-300 bg-gray-50 transition-colors hover:border-gray-400 hover:bg-gray-100",children:[(0,i.jsx)(n.G,{icon:r.cf$,className:"mb-2 h-8 w-8 text-gray-400"}),(0,i.jsx)("span",{className:"font-medium text-gray-500",children:"Upload images / videos"})]}):(0,i.jsx)("div",{className:"flex aspect-video w-full items-center justify-center rounded-xl bg-gray-50",children:(0,i.jsx)(n.G,{icon:r.VmB,className:"h-12 w-12 text-gray-300"})})},H=e=>{let{communityData:t}=e;return(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-3",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 text-[#3c4043]",children:[(0,i.jsx)(n.G,{icon:t.is_public?r.g4A:r.byT,className:"h-4 w-4 text-[#5f6368]"}),(0,i.jsx)("span",{className:"text-[14px] font-medium",children:t.is_public?"Public":"Private"})]}),(0,i.jsxs)("div",{className:"flex items-center gap-2 text-[#3c4043]",children:[(0,i.jsx)(n.G,{icon:r.FVb,className:"h-4 w-4 text-[#5f6368]"}),(0,i.jsxs)("span",{className:"text-[14px] font-medium",children:[C(t.member_count)," ",A(t.member_count,"member")]})]}),(0,i.jsxs)("div",{className:"flex items-center gap-2 text-[#3c4043]",children:[(0,i.jsx)(n.G,{icon:r.LEN,className:"h-4 w-4 text-[#5f6368]"}),(0,i.jsx)("span",{className:"text-[14px] font-medium",children:t.price_display||(t.is_paid?"Paid":"Free")})]}),t.owner_name&&(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[t.owner_profile&&(0,i.jsx)("a",{href:t.owner_username?"/@".concat(t.owner_username):"#",children:(0,i.jsx)("img",{src:t.owner_profile,alt:t.owner_name,className:"h-6 w-6 rounded-full border border-gray-200 object-cover"})}),(0,i.jsxs)("span",{className:"text-[14px] font-medium text-[#3c4043]",children:["By"," ",t.owner_username?(0,i.jsx)("a",{href:"/@".concat(t.owner_username),className:"hover:underline",children:t.owner_name}):t.owner_name]})]})]})},M=e=>{let{text:t}=e,a=e=>{let t;let a=[],r=/(\[([^\]]+)\]\((https?:\/\/[^)]+)\))|(https?:\/\/[^\s\]]+)|(\*([^*]+)\*)|(\\([()\\]))/g,n=0;for(;null!==(t=r.exec(e));)t.index>n&&a.push(e.slice(n,t.index)),t[1]?a.push((0,i.jsx)("a",{href:t[3],className:"break-all text-blue-600 hover:underline",target:"_blank",rel:"noopener noreferrer",children:t[2]},"link-".concat(t.index))):t[4]?a.push((0,i.jsx)("a",{href:t[4],
1className:"break-all text-blue-600 hover:underline",target:"_blank",rel:"noopener noreferrer",children:t[4]},"url-".concat(t.index))):t[5]?a.push((0,i.jsx)("span",{className:"font-semibold",children:t[6]},"bold-".concat(t.index))):t[7]&&a.push(t[8]),n=t.index+t[0].length;return n<e.length&&a.push(e.slice(n)),a.length>0?a:[e]},r=t.replace(/\[ul\]/g,"").replace(/\[li\]/g,"\n- ").split(/\n\n+/);return(0,i.jsx)("div",{className:"space-y-4",children:r.map((e,t)=>{let r=e.trim();if(!r)return null;let n=r.split("\n").filter(e=>e.trim());return n.length>0&&n.every(e=>/^\s*[-*•]\s/.test(e))?(0,i.jsx)("ul",{className:"space-y-1.5 pl-1",children:n.map((e,t)=>(0,i.jsxs)("li",{className:"flex gap-2 text-[15px] leading-relaxed text-[#3c4043]",children:[(0,i.jsx)("span",{className:"mt-0.5 flex-shrink-0 text-gray-400",children:"•"}),(0,i.jsx)("span",{children:a(e.replace(/^\s*[-*•]\s*/,""))})]},t))},t):(0,i.jsx)("p",{className:"whitespace-pre-wrap text-[15px] leading-relaxed text-[#3c4043]",children:a(r)},t)})})},T=e=>{let{className:t,isPaid:a,hasFreeTrial:r,accentColor:n,priceDisplay:l,onJoinClick:s}=e,o=n?{backgroundColor:n,color:S(n)}:void 0;return(0,i.jsx)(j.z,{onClick:s,style:o,className:(0,v.cn)("group h-11 w-full rounded-lg font-bold","text-[14px] tracking-wide","flex items-center justify-center gap-2",!n&&"bg-[#0f0f0f] text-white hover:bg-[#272727]",n&&"hover:brightness-95","shadow-sm hover:shadow-md active:shadow-sm","transition-all duration-200 hover:-translate-y-px active:translate-y-0 active:scale-[0.99]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#0f0f0f]/30 focus-visible:ring-offset-2",t),children:(0,i.jsx)("span",{className:"inline-flex items-center gap-2",children:a&&r?"START FREE TRIAL":a?l?"JOIN ".concat(l):"JOIN NOW":"JOIN GROUP"})})},Z=e=>{let{communityData:t,linkable:a=!0}=e,r=t.slug,n=a&&r?"a":"div";return(0,i.jsxs)("div",{className:"flex",children:[(0,i.jsxs)(n,{...a&&r?{href:"/".concat(r,"/-/members")}:{},className:"focus-visible:ring-[#0f0f0f]/15 flex-1 rounded-md py-2.5 text-center transition-colors hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset",children:[(0,i.jsx)("div",{className:"text-[16px] font-bold leading-tight text-[#202124]",children:C(t.member_count)}),(0,i.jsx)("div",{className:"mt-0.5 text-[12px] text-gray-500",children:A(t.member_count,"Member")})]}),(0,i.jsxs)(n,{...a&&r?{href:"/".concat(r,"/-/members?t=online")}:{},className:"focus-visible:ring-[#0f0f0f]/15 flex-1 border-x border-[#E4E4E4] py-2.5 text-center transition-colors hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset",children:[(0,i.jsx)("div",{className:"text-[16px] font-bold leading-tight text-[#202124]",children:C(t.online_count)}),(0,i.jsx)("div",{className:"mt-0.5 text-[12px] text-gray-500",children:"Online"})]}),(0,i.jsxs)(n,{...a&&r?{href:"/".concat(r,"/-/members?t=admin")}:{},className:"focus-visible:ring-[#0f0f0f]/15 flex-1 rounded-md py-2.5 text-center transition-colors hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset",children:[(0,i.jsx)("div",{className:"text-[16px] font-bold leading-tight text-[#202124]",children:t.admin_count.toLocaleString()}),(0,i.jsx)("div",{className:"mt-0.5 text-[12px] text-gray-500",children:A(t.admin_count,"Admin")})]})]})},q=e=>{var t;let{communityData:a,onJoinClick:r,onGoClick:n,isAuthenticated:l}=e,s=a.slug,o=a.primary_color||"#4f46e5",c=(null===(t=a.links)||void 0===t?void 0:t.filter(e=>!1!==e.isVisible))||[];return(0,i.jsxs)("div",{className:"sticky top-24 space-y-3",children:[(0,i.jsxs)("div",{className:"overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm",children:[(0,i.jsx)("div",{className:"aspect-[16/9] w-full overflow-hidden",children:a.cover_photo?(0,i.jsx)("img",{src:a.cover_photo,alt:a.name,className:"h-full w-full object-cover"}):(0,i.jsx)("div",{className:"h-full w-full",style:{background:"linear-gradient(135deg, ".concat(o," 0%, ").concat(o,"88 50%, ").concat(o,"44 100%)")}})}),(0,i.jsxs)("div",{className:"space-y-4 p-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("a",{href:s?"/".concat(s):"/community/".concat(a.community_id),className:"rounded text-[16px] font-bold leading-tight text-[#202124] transition-colors hover:underline focus-visible:underline focus-visible:outline-none",children:a.name}),s&&(0,i.jsxs)("p",{className:"mt-0.5 text-[13px] text-gray-500",children:["instaloops.com/",s]})]}),a.short_description&&(0,i.jsx)("p",{className:"mb-3 text-sm leading-relaxed text-[#3c4043]",children:a.short_description}),c.length>0&&(0,i.jsx)("div",{className:"space-y-2",children:c.map((e,t)=>(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)(P,{className:"mr-2 h-3 w-3 flex-shrink-0 text-[#909090]"}),(0,i.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer nofollow",className:"truncate text-sm text-[#909090] transition-colors hover:text-gray-700",children:e.label})]},e.id||t))}
1),(0,i.jsx)("div",{className:"border-t border-[#E4E4E4] pt-1",children:(0,i.jsx)(Z,{communityData:a})}),l&&n?(0,i.jsx)(j.z,{onClick:n,style:{backgroundColor:o,color:S(o)},className:"h-11 w-full rounded-lg text-[14px] font-bold transition-all hover:brightness-95",children:"Go to Community"}):r&&(0,i.jsx)(T,{onJoinClick:r,isPaid:a.is_paid,hasFreeTrial:a.has_free_trial,priceDisplay:a.price_display,accentColor:a.primary_color})]})]}),(0,i.jsxs)("div",{className:"flex items-center justify-center gap-1.5 text-[12px] text-gray-500",children:[(0,i.jsx)("span",{children:"Powered by"}),(0,i.jsx)("a",{href:"/",className:"font-semibold text-gray-700 hover:text-gray-900",children:"Instaloops"})]})]})},U=e=>{let{isOpen:t,onClose:a,onUpload:l,onVideoLink:s,isUploading:o}=e,[c,d]=(0,p.useState)(""),x=(0,p.useRef)(null),h=(0,p.useRef)(null);if(!t)return null;let g=async e=>{var t;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];a&&await l(a)},f=async()=>{c.trim()&&(await s(c.trim()),d(""))};return(0,i.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",children:(0,i.jsxs)("div",{className:"w-full max-w-md rounded-xl bg-white shadow-xl",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,i.jsx)("h3",{className:"text-lg font-semibold",children:"Add media"}),(0,i.jsx)("button",{"aria-label":"Close",onClick:a,className:"rounded-full p-2 hover:bg-gray-100",children:(0,i.jsx)(m.Z,{className:"h-5 w-5"})})]}),(0,i.jsxs)("div",{className:"space-y-6 p-6",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"mb-3 text-sm text-gray-600",children:"Upload an image (1400 x 790 recommended)."}),(0,i.jsx)("input",{ref:x,type:"file",accept:"image/png,image/gif,image/jpeg",onChange:g,className:"hidden"}),(0,i.jsxs)(j.z,{onClick:()=>{var e;return null===(e=x.current)||void 0===e?void 0:e.click()},disabled:o,variant:"outline",className:"w-full",children:[o?(0,i.jsx)(u.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,i.jsx)(n.G,{icon:r.cf$,className:"mr-2 h-4 w-4"}),"Upload Image"]})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"mb-3 text-sm text-gray-600",children:"Or, add a video."}),(0,i.jsx)("div",{className:"flex gap-2",children:(0,i.jsxs)("div",{className:"relative flex-1",children:[(0,i.jsx)(n.G,{icon:r.nNP,className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),(0,i.jsx)("input",{type:"text",value:c,onChange:e=>d(e.target.value),placeholder:"YouTube, Loom, Vimeo, or Wistia link",className:"w-full rounded-lg border border-gray-300 py-2 pl-10 pr-4 focus:border-transparent focus:ring-2 focus:ring-blue-500"})]})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("input",{ref:h,type:"file",accept:"video/*,.mkv",onChange:g,className:"hidden"}),(0,i.jsxs)("button",{onClick:()=>{var e;return null===(e=h.current)||void 0===e?void 0:e.click()},disabled:o,className:"flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed border-gray-300 p-6 transition-colors hover:border-gray-400 hover:bg-gray-50",children:[(0,i.jsx)(n.G,{icon:r.cf$,className:"h-6 w-6 text-gray-400"}),(0,i.jsx)("span",{className:"font-medium text-gray-600",children:"Drag and drop video here"}),(0,i.jsx)("span",{className:"text-sm text-gray-400",children:"or select file"})]})]})]}),(0,i.jsxs)("div",{className:"flex gap-3 border-t p-4",children:[(0,i.jsx)(j.z,{variant:"outline",onClick:a,className:"flex-1",children:"Cancel"}),(0,i.jsx)(j.z,{onClick:f,disabled:!c.trim()||o,className:"flex-1 bg-blue-600 text-white hover:bg-blue-700",children:"Add"})]})]})})},J=e=>{var t,a;let i=e.community,r=i.settings||null,n=null==r?void 0:r.pricing,l=null,s=!1;if("Paid"===i.type&&n){let e=n.monthly_price,t=n.currency||"usd",a=n.trial_days;e&&e>0&&(l=k(e,t,"month")),a&&a>0&&(s=!0)}let o=((null==r?void 0:r.social_links)||[]).filter(e=>!1!==e.isVisible&&e.url&&e.label).sort((e,t)=>(e.order||0)-(t.order||0)).map(e=>({id:e.id,url:e.url,label:e.label,isVisible:e.isVisible,order:e.order})),c=[];i.cover_photo&&c.push({url:i.cover_photo,type:"image",order_index:-1,isCover:!0});let d=(e.media_items||[]).map(e=>{let t="video"===e.type?_(e.url):void 0;return{media_id:e.media_id,url:e.url,type:e.type,title:e.title,order_index:e.order_index,playbackId:t,animated_thumbnail:t?"https://image.mux.com/".concat(t,"/animated.gif"):void 0,aspect_ratio:e.aspect_ratio||16/9}}).sort((e,t)=>
1"video"===e.type&&"video"!==t.type?-1:"video"!==e.type&&"video"===t.type?1:(e.order_index||0)-(t.order_index||0)),m=i.description||"",u=(null===(a=m.split("\n")[0])||void 0===a?void 0:null===(t=a.trim())||void 0===t?void 0:t.replace(/^\*|\*$/g,""))||null;return{community_id:i.community_id,name:i.name,description:m,cover_photo:i.cover_photo,logo:i.logo,media_items:[...c,...d],is_public:i.is_public,owner_name:i.owner_name,owner_profile:i.owner_profile,member_count:e.member_count,online_count:e.online_count,total_views:e.total_views,admin_count:e.admin_count,is_paid:"Paid"===i.type,has_free_trial:s,price_display:l,type:i.type||"",owner_username:i.owner_username,primary_color:i.primary_color,signup_redirect:i.signup_redirect,slug:i.slug,short_description:u,links:o,online_members:e.online_members,settings:r||void 0}};function G(e){let{slug:t,communityId:a,prefetched:l}=e,[s,o]=(0,p.useState)(()=>l?J(l):null),[c,d]=(0,p.useState)(!l),[m,f]=(0,p.useState)(null),[b,v]=(0,p.useState)(!1),[y,C]=(0,p.useState)(""),[A,S]=(0,p.useState)(!1),[E,V]=(0,p.useState)(null),[P,I]=(0,p.useState)(!1),[L,G]=(0,p.useState)(!1),[O,B]=(0,p.useState)(!1),[D,Y]=(0,p.useState)(!1),[Q,W]=(0,p.useState)("login"),$=e=>{W(e),Y(!0)},X=(0,x.useRouter)(),K=(0,x.usePathname)(),ee=(0,x.useSearchParams)(),et=(0,N.N)(),{isAuthenticated:ea,isLoading:ei,user:er,communityUser:en}=(0,w._)(),el=(0,p.useRef)(!1),es=(0,p.useCallback)(()=>{if(!ee.get("modal"))return;let e=new URLSearchParams(ee.toString());e.delete("modal");let t=e.toString();X.replace(t?"".concat(K,"?").concat(t):K,{scroll:!1})},[X,ee,K]),eo=(0,p.useCallback)(e=>{Y(e),e||es()},[es]),ec=t||(null==s?void 0:s.slug)||"",ed=E&&["owner","admin","moderator"].includes(E)&&!O,em=()=>{if(null==s?void 0:s.is_paid){ec?X.push("/".concat(ec,"/plans")):X.push("/community/".concat(a,"/plans"));return}$("signup")},eu=()=>{$("login")};(0,p.useEffect)(()=>{if(el.current||!s)return;let e=ee.get("modal");e&&(el.current=!0,"join"===e||"signup"===e?em():"login"===e?eu():es())},[s]);let ex=async()=>{if(ed&&y.trim()){S(!0);try{let{error:e}=await et.from("community").update({description:y.trim()}).eq("community_id",a);if(e)throw e;o(e=>e?{...e,description:y.trim()}:null),v(!1),h.Am.success("Description updated successfully")}catch(e){console.error("Error updating description:",e),h.Am.error("Failed to update description")}finally{S(!1)}}},ep=async e=>{if(ed){G(!0);try{var t;let i=e.name.split(".").pop(),r="".concat(a,"/").concat(Date.now(),".").concat(i),n=e.type.startsWith("video/"),{error:l}=await et.storage.from("community-media").upload(r,e);if(l)throw l;let{data:{publicUrl:o}}=et.storage.from("community-media").getPublicUrl(r),{error:c}=await et.from("community_media").insert({community_id:a,url:o,type:n?"video":"image",is_active:!0,order_index:((null==s?void 0:null===(t=s.media_items)||void 0===t?void 0:t.length)||0)+1});if(c)throw c;h.Am.success("Media uploaded successfully"),I(!1),window.location.reload()}catch(e){console.error("Error uploading media:",e),h.Am.error("Failed to upload media")}finally{G(!1)}}},eh=async e=>{if(ed){G(!0);try{var t;let{error:i}=await et.from("community_media").insert({community_id:a,url:e,type:"video",is_active:!0,order_index:((null==s?void 0:null===(t=s.media_items)||void 0===t?void 0:t.length)||0)+1});if(i)throw i;h.Am.success("Video added successfully"),I(!1),window.location.reload()}catch(e){console.error("Error adding video:",e),h.Am.error("Failed to add video")}finally{G(!1)}}},eg=(e,t)=>{let a=[];return e&&a.push({url:e,type:"image",order_index:-1,isCover:!0}),[...a,...null==t?void 0:t.map(e=>{let t="video"===e.type?_(e.url):void 0;return{media_id:e.media_id,url:e.url,type:e.type,title:e.title,order_index:e.order_index,playbackId:t,animated_thumbnail:t?"https://image.mux.com/".concat(t,"/animated.gif"):void 0,aspect_ratio:e.aspect_ratio||16/9}}).sort((e,t)=>"video"===e.type&&"video"!==t.type?-1:"video"!==e.type&&"video"===t.type?1:(e.order_index||0)-(t.order_index||0))]};return((0,p.useEffect)(()=>{let e=null==en?void 0:en.community_user_id;if(!e||!a)return;let t=async()=>{try{let{data:t}=await et.from("community_members").select("role").eq("community_id",a).eq("community_user_id",e).maybeSingle();V((null==t?void 0:t.role)||null)}catch(e){console.error("Error fetching user role:",e)}};ea&&t()},[ea,en,a,et]),(0,p.useEffect)(()=>
1{if(l)return;let e=async()=>{try{var e,t;f(null),d(!0);let{data:i,error:r}=await et.from("community").select("\n            community_id,\n            name,\n            description,\n            cover_photo,\n            logo,\n            is_public,\n            owner_name,\n            owner_profile,\n            type,\n            owner_username,\n            primary_color,\n            signup_redirect,\n            slug,\n            settings\n          ").eq("community_id",a).single();if(r)throw console.error("Community fetch error:",r),Error("Community not found");let{data:n,error:l}=await et.from("community_media").select("\n            media_id,\n            url,\n            type,\n            title,\n            order_index,\n            animated_thumbnail\n          ").eq("community_id",a).eq("is_active",!0).order("order_index");l&&console.error("Media fetch error:",l);let{count:s,error:c}=await et.from("community_members").select("*",{count:"exact",head:!0}).eq("community_id",a).eq("status","active");c&&console.error("Member count error:",c);let{data:m,error:u}=await et.from("posts").select("view_count").eq("community_id",a),x=(null==m?void 0:m.reduce((e,t)=>e+(t.view_count||0),0))||0;u&&console.error("Views count error:",u);let p=[],h=new Date(Date.now()-9e5).toISOString(),{data:g,error:b}=await et.from("community_members").select("\n            community_user_id,\n            community_user:community_user_id (\n              user_id,\n              first_name,\n              last_name,\n              profile_image\n            )\n          ").eq("community_id",a).eq("status","active").gte("last_active_at",h).limit(10),{count:v}=await et.from("community_members").select("*",{count:"exact",head:!0}).eq("community_id",a).eq("status","active").gte("last_active_at",h);b?console.error("Online members error:",b):g&&(p=g.filter(e=>e.community_user).map(e=>({user_id:e.community_user.user_id,first_name:e.community_user.first_name,last_name:e.community_user.last_name,profile_image:e.community_user.profile_image})));let{count:y,error:j}=await et.from("community_members").select("*",{count:"exact",head:!0}).eq("community_id",a).eq("status","active").in("role",["owner","admin"]);j&&console.error("Admin count error:",j);let w=i.settings,N=null==w?void 0:w.pricing,_=null,A=!1;if("Paid"===i.type&&N){let e=N.monthly_price,t=N.currency||"usd",a=N.trial_days;e&&e>0&&(_=k(e,t,"month")),a&&a>0&&(A=!0)}let S=((null==w?void 0:w.social_links)||[]).filter(e=>!1!==e.isVisible&&e.url&&e.label).sort((e,t)=>(e.order||0)-(t.order||0)).map(e=>({id:e.id,url:e.url,label:e.label,isVisible:e.isVisible,order:e.order})),E=eg(i.cover_photo,n||[]),V=i.description||"",P=(null===(t=V.split("\n")[0])||void 0===t?void 0:null===(e=t.trim())||void 0===e?void 0:e.replace(/^\*|\*$/g,""))||null,I={...i,media_items:E,member_count:s||0,online_count:v||p.length||0,total_views:x,admin_count:y||0,is_paid:"Paid"===i.type,has_free_trial:A,price_display:_,description:i.description||"",short_description:P,links:S,online_members:p};o(I),C(I.description)}catch(t){let e=t instanceof Error?t.message:"Failed to load community data.";console.error("Error fetching community data:",t),f(e),h.Am.error("Error loading community data")}finally{d(!1)}};ei||e()},[a,et,ei,l]),(0,p.useEffect)(()=>{l&&(null==s?void 0:s.description)&&C(s.description)},[]),!s&&(c||ei))?(0,i.jsx)(z,{}):m||!s?(0,i.jsx)("div",{className:"px-4 py-12 md:px-6",children:(0,i.jsxs)("div",{className:"mx-auto max-w-md text-center",children:[(0,i.jsx)("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-gray-100",children:(0,i.jsx)(n.G,{icon:r.VmB,className:"h-7 w-7 text-gray-400"})}),(0,i.jsx)("h3",{className:"mb-2 text-lg font-semibold text-gray-900",children:m||"Community Not Found"}),(0,i.jsx)("p",{className:"mb-6 text-gray-500",children:"The community you're looking for could not be found."}),(0,i.jsx)(j.z,{onClick:()=>X.push("/community"),variant:"outline",children:"Browse Communities"})]})}):(0,i.jsxs)("div",{className:"relative bg-[#F9F9F9]",children:[ed&&(0,i.jsx)("div",{className:"border-b border-gray-200 bg-white",children:(0,i.jsx)("div",{className:"mx-auto flex h-10 max-w-6xl items-center justify-end px-4 md:px-6",children:(0,i.jsxs)(j.z,{variant:"ghost",size:"sm",onClick:()=>B(!O),className:"text-xs text-gray-500 hover:text-gray-700",children:[(0,i.jsx)(n.G,{icon:r.Mdf,className:"mr-1 h-3 w-3"}),O?"Exit Preview":"Preview"]})})}),(0,i.jsx)("div",{className:"mx-auto max-w-[1112px] px-0 pb-28 pt-3 md:px-6 md:pt-6 lg:pb-16 xl:px-0",children:(0,i.jsxs)("div",{className:"flex flex-col gap-6 lg:flex-row lg:gap-12",children:[(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsxs)("div",{className:"bg-white md:rounded-xl md:border md:border-gray-200 md:p-8 md:shadow-sm",children:[(0,i.jsx)("div",{className:"px-4 pb-3 pt-4 md:px-0 md:pb-4 md:pt-0",children:(0,i.jsx)("h1",{className:"text-[19px] font-bold leading-[1.2] text-[#202124] md:text-[20px]",children:s.name})}),(0,i.jsx)("div",{className:"mb-4 px-4 md:mb-5 md:px-0",children:(0,i.jsx)(R,{mediaItems:s.media_items,canEdit:!!ed,onUploadClick:()=>I(!0)})}),(0,i.jsx)("div",{className:"mb-4 px-4 md:mb-5 md:px-0",children:(0,i.jsx)(H,{communityData:s})}),(0,i.jsxs)("div",{className:"px-4 pb-5 pt-2 md:px-0 md:pb-0",children:[ed&&!b&&(0,i.jsx)("div",{className:"mb-3 flex items-center justify-end",children:(0,i.jsxs)(j.z,{variant:"ghost",size:"sm",onClick:()=>v(!0),className:"text-sm text-gray-500 hover:text-gray-700",children:[(0,i.jsx)(n.G,{icon:r.TzT,className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})}),b&&ed?(0,i.jsxs)("div",{className:"space-y-3",children:[(0,i.jsx)("textarea",{value:y,onChange:e=>C(e.target.value),className:"min-h-[200px] w-full resize-y rounded-xl border border-gray-300 p-4 text-[15px] leading-relaxed text-gray-900 focus:border-transparent focus:ring-2 focus:ring-blue-500",placeholder:"Add a description for your community..."}),(0,i.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,i.jsx)(j.z,{variant:"outline",size:"sm",onClick:()=>{v(!1),C(s.description)},disabled:A,children:"Cancel"}),(0,i.jsx)(j.z,{size:"sm",onClick:ex,disabled:A,className:"bg-blue-600 text-white hover:bg-blue-700",children:A?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(u.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save"})]})]}):(0,i.jsx)(i.Fragment,{children:s.description?(0,i.jsx)(M,{text:s.description}):ed?(0,i.jsx)("button",{onClick:()=>v(!0),className:"text-[15px] italic text-gray-400 hover:text-gray-600",children:"Add a description..."}):(0,i.jsx)("p",{className:"text-[15px] italic text-gray-400",children:"No description available"})})]})]}),(0,i.jsx)("div",{className:"px-4 pt-4 md:px-0 md:pt-5",children:(0,i.jsx)("a",{href:"/legal?t=privacy",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-gray-400 transition-colors hover:text-gray-600",children:"Privacy and terms"})})]}),(0,i.jsxs)("div",{className:"w-full flex-shrink-0 px-4 md:px-0 lg:w-[280px]",children:[(0,i.jsxs)("div",{className:"mb-6 lg:hidden",children:[(0,i.jsx)(Z,{communityData:s,linkable:!1}),!ea&&(0,i.jsx)("button",{onClick:eu,className:"mt-3 w-full text-center text-sm font-semibold text-gray-600 transition-colors hover:text-gray-900",children:"Already a member? Log in"})]}),(0,i.jsx)("div",{className:"hidden lg:block",children:(0,i.jsx)(q,{communityData:s,isAuthenticated:ea&&!O,onJoinClick:em,onGoClick:()=>X.push(ec?"/".concat(ec):"/community/".concat(a))})})]})]})}),(0,i.jsx)("div",{className:"fixed inset-x-0 bottom-0 z-40 border-t border-gray-200 bg-white/95 backdrop-blur lg:hidden",style:{paddingBottom:"env(safe-area-inset-bottom)"},children:(0,i.jsxs)("div",{className:"mx-auto flex max-w-[1112px] items-center gap-2 px-4 py-3",children:[(0,i.jsx)(F,{slug:ec||null,communityId:a,name:s.name,iconOnly:!0}),(0,i.jsx)("div",{className:"flex-1",children:!ea||O?(0,i.jsx)(T,{onJoinClick:em,isPaid:s.is_paid,hasFreeTrial:s.has_free_trial,priceDisplay:s.price_display}):(0,i.jsx)(j.z,{onClick:()=>X.push(ec?"/".concat(ec):"/community/".concat(a)),className:"h-12 w-full rounded-lg bg-[#0f0f0f] text-[15px] font-bold text-white transition-all hover:bg-[#272727] active:scale-[0.99]",children:"Go to Community"})})]})}),(0,i.jsx)(U,{isOpen:P,onClose:()=>I(!1),onUpload:ep,onVideoLink:eh,isUploading:L}),(0,i.jsx)(g.default,{open:D,onOpenChange:eo,initialMode:Q,communityId:a,communityName:s.name,communitySlug:ec||void 0,communityLogo:s.logo,communityPrimaryColor:s.primary_color,redirectUrl:(null==s?void 0:s.signup_redirect)?s.signup_redirect:ec?"/".concat(ec):"/community/".concat(a)})]})}},6082:function(e,t,a){a.d(t,{_:function(){return r}});var i=a(43834);function r(){let{session:e,user:t,communityUser:a,profile:r,isLoading:n}=(0,i.a)();return{session:e,user:t,communityUser:a,profile:r,isAuthenticated:!!e,isLoading:n}}}}]);

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.