(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3397],{3275:(e,n,t)=>{"use strict";t.d(n,{YG:()=>u,p2:()=>d,uo:()=>c});var r=t(37876),i=t(99972),l=t(76841),a=t(72696),s=t(93026),o=t(14232);let d=e=>{let{done:n,endReached:t,...a}=e,[s,d]=(0,o.useState)("Pending"),h=()=>{d("Infinite"),null==t||t(0)};return(0,r.jsx)(i.YL,{overscan:i.p2,endReached:e=>{if("Pending"===s)return void h();null==t||t(e)},components:{...i.Wp,Footer:n?void 0:({Pending:()=>(0,r.jsx)(u,{children:(0,r.jsx)(l.$,{size:"lg",onClick:h,children:"Load more"})}),Infinite:c})[s]},...a})},c=()=>(0,r.jsx)(u,{children:(0,r.jsx)(a.y,{})}),u=(0,s.pH)("div",{display:"flex",justifyContent:"center",alignItems:"center",color:"$gray4",height:"$10"})},24842:(e,n,t)=>{"use strict";t.d(n,{C:()=>c,O:()=>x});var r=t(28888),i=t(37876),l=t(4439),a=t(59782),s=t(86355);function o(){let e=(0,r._)(["\n fragment MetaTagsProfileIdentityFragment on Identity {\n id\n identifiable {\n ... on User {\n id\n avatar(size: LARGE)\n description: bio(format: PLAIN)\n href\n is_indexable\n name\n }\n ... on Group {\n id\n avatar(size: LARGE)\n description(format: PLAIN)\n href\n name\n }\n }\n }\n"]);return o=function(){return e},e}function d(){let e=(0,r._)(["\n query MetaTagsProfileQuery($id: ID!) {\n identity(id: $id) {\n ...MetaTagsProfileIdentityFragment\n id\n identifiable {\n ... on Group {\n id\n visibility\n }\n }\n }\n }\n ","\n"]);return d=function(){return e},e}let c=e=>{let{identity:n}=e,t=n.identifiable;return(0,i.jsx)(l.p,{description:t.description,imageUrl:t.avatar,isIndexable:"User"!==t.__typename||t.is_indexable,title:"".concat(t.name," | Are.na"),canonical:"".concat(t.href,"/channels"),children:(0,i.jsx)("link",{rel:"alternate",type:"application/rss+xml",title:"".concat(t.name," | Are.na"),href:"".concat("https://www.are.na").concat(t.href,"/feed/rss")})})},u=(0,s.J1)(o()),h=(0,s.J1)(d(),u),x=async e=>{let{client:n,id:t}=e,{data:r,error:i}=await n.query(h,{id:t.toString()}).toPromise();if(i)throw i;let l=null==r?void 0:r.identity;if(!l)throw new a.m_;return{metaTags:l}}},51194:(e,n,t)=>{"use strict";t.d(n,{Y2:()=>x,sq:()=>c});var r=t(28888),i=t(37876),l=t(4439),a=t(59782),s=t(86355);function o(){let e=(0,r._)(["\n fragment MetaTagsBlockFragment on Konnectable {\n ... on Model {\n id\n }\n ... on ConnectableInterface {\n href\n title\n metaDescription: description(format: PLAIN)\n visibility\n }\n ... on Block {\n is_indexable\n }\n ... on Image {\n image_url(size: ORIGINAL)\n }\n ... on Link {\n image_url(size: ORIGINAL)\n }\n ... on Embed {\n image_url(size: ORIGINAL)\n }\n ... on Attachment {\n image_url(size: ORIGINAL)\n }\n }\n"]);return o=function(){return e},e}function d(){let e=(0,r._)(["\n query MetaTagsBlockQuery($id: ID!) {\n block: blokk(id: $id) {\n ...MetaTagsBlockFragment\n ... on Model {\n id\n }\n }\n }\n ","\n"]);return d=function(){return e},e}let c=e=>{let{block:n}=e;return(0,i.jsx)(l.p,{description:n.metaDescription,imageUrl:"image_url"in n?(0,l.R)(n.image_url):void 0,isIndexable:"is_indexable"in n?n.is_indexable:void 0,title:n.title?"".concat(n.title," | Are.na"):"Are.na",canonical:n.href})},u=(0,s.J1)(o()),h=(0,s.J1)(d(),u),x=async e=>{let{client:n,id:t}=e,{data:r,error:i}=await n.query(h,{id:t.toString()}).toPromise();if(i)throw i;let l=null==r?void 0:r.block;if(!l)throw new a.m_;return{metaTags:l}}},54188:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>nU});var r=t(37876),i=t(76820),l=t(28888),a=t(89748),s=t(43594),o=t(34426),d=t(99972),c=t(29334),u=t(14905),h=t(86355);function x(){let e=(0,l._)(["\n query ChannelCollaboratorsQuery($id: ID!) {\n channel(id: $id) {\n id\n members {\n ...GridCellUserFragment\n ...GridCellGroupFragment\n __typename\n ... on Model {\n id\n }\n }\n }\n }\n"]);return x=function(){return e},e}let p=e=>{var n;let{id:t}=e,[{data:i,error:l,fetching:h}]=(0,u.iYC)({variables:{id:t.toString()}});if(l)throw l;if(h||!(null==i||null==(n=i.channel)?void 0:n.members))return(0,r.jsx)(o.C,{});let x=(0,c.o)(i.channel.members);return(0,r.jsx)(d.YL,{totalCount:x.length,itemContent:e=>{let n=x[e];switch(n.__typename){case"User":return(0,r.jsx)(s.G,{user:n});case"Group":return(0,r.jsx)(a.u,{group:n})}}})};(0,h.J1)(x());var g=t(68556),f=t(15882),m=t(42357),j=t(38070),y=t(87303),b=t(3619),v=t(10731),_=t(76841),C=t(13521),w=t(77680);function $(){let e=(0,l._)(["\n query ChannelConnectionsQuery($id: ID!, $page: Int!, $per: Int!) {\n channel(id: $id) {\n id\n counts {\n connected_to_channels\n }\n connected_to_channels(page: $page, per: $per) {\n ...GridCellChannelFragment\n id\n type\n }\n }\n }\n"]);return $=function(){return e},e}let I=b.t7,k=()=>{var e,n;let{channelId:t,isReady:i,router:l}=(0,f.T)(),a=Number(l.query.page)||1,[{data:s,fetching:d,error:c}]=(0,u.oZx)({variables:{id:t,page:a,per:I},pause:!i});if(c)throw c;let h=(null==s||null==(e=s.channel)?void 0:e.connected_to_channels)||[],x=(null==s||null==(n=s.channel)?void 0:n.counts.connected_to_channels)||0;return d||0===h.length&&x>0?(0,r.jsxs)(y.B,{gap:"$2",children:[(0,r.jsx)(o.C,{per:I}),(0,r.jsx)(j.is,{total:x,per:I})]}):0===h.length?(0,r.jsxs)(v.P,{children:["No connections yet",(0,r.jsx)(C.P,{id:t,type:"Channel",children:(0,r.jsxs)(_.$,{size:"sm",children:["Connect ",(0,r.jsx)(w.flY,{})]})})]}):(0,r.jsxs)(y.B,{gap:"$2",children:[(0,r.jsx)(m.JT,{children:h.map(e=>(0,r.jsx)(g.sT,{channel:e},e.id))}),(0,r.jsx)(j.is,{total:x,per:I})]})};(0,h.J1)($());var S=t(72531),z=t(89099);function F(){let e=(0,l._)(["\n query ChannelFollowersQuery($id: ID!, $page: Int, $per: Int) {\n channel(id: $id) {\n id\n counts {\n followers\n }\n followers(page: $page, per: $per) {\n ...GridCellUserFragment\n id\n }\n }\n }\n"]);return F=function(){return e},e}let P=b.t7,T=()=>{var e,n,t,i;let{query:{channelId:l},isReady:a}=(0,z.useRouter)(),h=(0,S.a)(),[{data:x,fetching:p,error:g}]=(0,u.mP7)({variables:{id:String(l),page:h,per:P},pause:!a});if(g)throw g;if(p||0===((null==x||null==(n=x.channel)||null==(e=n.followers)?void 0:e.length)||0))return(0,r.jsxs)(y.B,{gap:"$4",children:[(0,r.jsx)(o.C,{}),(0,r.jsx)(j.RT,{})]});let f=(0,c.o)(null==x||null==(t=x.channel)?void 0:t.followers),m=(null==x||null==(i=x.channel)?void 0:i.counts.followers)||0;return(0,r.jsxs)(y.B,{gap:"$4",children:[(0,r.jsx)(d.YL,{totalCount:f.length,itemContent:e=>{let n=f[e];return(0,r.jsx)(s.G,{user:n})}}),(0,r.jsx)(j.is,{total:m,per:P})]})};(0,h.J1)(F());var R=t(78787),E=t(97775),B=t(14232),G=t(12023),A=t(31896),q=t(16607),M=t(50168),L=t(58780),U=t(93026);let D=(0,U.pH)("div",{display:"flex",minWidth:0,variants:{size:{sm:{flex:.75,"@bp2":{display:"none"}},md:{flex:1}}},defaultVariants:{size:"md"}}),O=(0,U.pH)("div",{display:"flex",width:"100%",height:40,borderBottom:"1px solid $gray2","&:hover":{bg:"$gray1"},variants:{active:{true:{bg:"$gray1"}},inert:{true:{"&:hover":{bg:"transparent"}}}}}),N=(0,U.pH)("div",{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"$1",px:"$2",width:70,flexShrink:0});var H=t(89572),J=t(89464),K=t(39220),W=t(96428);function Y(){let e=(0,l._)(["\n fragment TableRowThumbnailFragment on Konnectable {\n ...PreviewCellFragment\n ... on Model {\n id\n }\n ... on Image {\n zoomed_src_1x: resized_image_url(\n width: 300\n height: 300\n quality: 75\n flatten: true\n )\n zoomed_src_2x: resized_image_url(\n width: 600\n height: 600\n quality: 65\n flatten: true\n )\n }\n ... on Link {\n zoomed_src_1x: resized_image_url(width: 300, height: 300, quality: 75)\n zoomed_src_2x: resized_image_url(width: 600, height: 600, quality: 65)\n }\n ... on Embed {\n zoomed_src_1x: resized_image_url(width: 300, height: 300, quality: 75)\n zoomed_src_2x: resized_image_url(width: 600, height: 600, quality: 65)\n }\n ... on Attachment {\n zoomed_src_1x: resized_image_url(width: 300, height: 300, quality: 75)\n zoomed_src_2x: resized_image_url(width: 600, height: 600, quality: 65)\n }\n }\n"]);return Y=function(){return e},e}let Q=e=>{let{connectable:n}=e;return(0,r.jsx)(K.m_,{side:"right",flush:!0,label:"zoomed_src_1x"in n&&"zoomed_src_2x"in n&&n.zoomed_src_1x&&n.zoomed_src_2x?(0,r.jsx)(W._,{srcs:[n.zoomed_src_1x,n.zoomed_src_2x],alt:""}):null,children:(0,r.jsx)(H.a,{css:{width:39},children:(0,r.jsx)(J.l,{connectable:n,size:39})})})};(0,U.pH)("div",{width:39,height:39}),(0,h.J1)(Y());var V=t(5336);let Z=()=>(0,r.jsxs)(X,{children:[(0,r.jsx)(H.a,{css:{width:39}}),(0,r.jsx)(D,{children:(0,r.jsx)(ee,{css:{boxShadow:"none"},children:"Content"})}),(0,r.jsx)(D,{children:(0,r.jsx)(ee,{children:"Title"})}),(0,r.jsx)(D,{size:"sm",children:(0,r.jsx)(ee,{children:"Author"})}),(0,r.jsx)(D,{size:"sm",children:(0,r.jsx)(ee,{children:"Added at"})}),(0,r.jsx)(N,{})]}),X=(0,U.pH)("div",{display:"flex",width:"100%",height:40,borderBottom:"1px solid $gray2"}),ee=(0,U.pH)(V.E,{display:"flex",alignItems:"center",fontWeight:"bold",flex:1,boxShadow:"inset 1px 0 0 $colors$gray2",minWidth:0,px:"$2",gap:"$1",defaultVariants:{size:"xs"}});var en=t(3275);let et=()=>(0,r.jsx)(O,{css:{borderBottom:"1px solid $gray2"}}),er=e=>{let n=(0,B.useRef)(e);return(0,B.useEffect)(()=>{n.current=e},[e]),n.current};var ei=t(85456),el=t(57430),ea=t(29979);let es=(0,B.createContext)({x:0,y:0,source:"Idle",coordinates:[1/0,1/0],setCoordinates:()=>{},resetCoordinates:()=>{},ref:(0,B.createRef)()}),eo=e=>{let{maxX:n,maxY:t,children:i}=e,[l,a]=(0,B.useState)({x:1/0,y:1/0,source:"Idle"}),s=()=>{a({x:1/0,y:1/0,source:"Idle"})},{ref:o}=(0,ei.L)({type:"click",onClickOutside:s,when:l.x!==1/0&&l.y!==1/0});(0,ea.vC)("ArrowUp",e=>{e.preventDefault(),a(e=>({...e,y:e.y-1,source:"Keyboard"}))}),(0,ea.vC)("ArrowDown",e=>{e.preventDefault(),a(e=>({...e,y:e.y+1,source:"Keyboard"}))}),(0,ea.vC)("ArrowLeft",()=>{a(e=>({...e,x:e.x-1,source:"Keyboard"}))}),(0,ea.vC)("ArrowRight",()=>{a(e=>({...e,x:e.x+1,source:"Keyboard"}))}),(0,ea.vC)("Tab",e=>{e.preventDefault(),a(e=>({...e,x:e.x+1,source:"Keyboard"}))}),(0,ea.vC)("Shift+Tab",e=>{e.preventDefault(),a(e=>({...e,x:e.x-1,source:"Keyboard"}))});let d=(0,el.mapCursorToMax)(l.x,n),c=(0,el.mapCursorToMax)(l.y,t);return(0,r.jsx)(es.Provider,{value:{ref:o,x:d,y:c,source:l.source,coordinates:[l.x,l.y],setCoordinates:a,resetCoordinates:s},children:i})},ed=()=>(0,B.useContext)(es);var ec=t(88798);let eu={enter:e=>Math.abs(e)>750,exit:e=>250>Math.abs(e)},eh={Item:O,ScrollSeekPlaceholder:et},ex=e=>{let{components:n=eh,endReached:t,itemContent:i,overscan:l=200,totalCount:a}=e,s=(0,B.useRef)(null),o=(0,B.useCallback)(e=>{s.current&&s.current.scrollToIndex({index:e,align:"center"})},[]),{y:d,ref:c,source:u}=ed(),h=er(d);return(0,B.useEffect)(()=>{"Click"===u||isNaN(d)||isNaN(h)||o(d)},[d,o,h,u]),(0,r.jsx)(ep.Provider,{value:{scrollToIndex:o},children:(0,r.jsx)(H.a,{tabIndex:-1,ref:c,css:{"&:focus":{outline:0}},children:(0,r.jsx)(ec.sN,{ref:s,endReached:t,itemContent:i,overscan:l,components:n,scrollSeekConfiguration:eu,totalCount:a,useWindowScroll:!0})})})},ep=(0,B.createContext)({scrollToIndex:e=>{}}),eg=e=>{let{done:n,endReached:t,...i}=e,[l,a]=(0,B.useState)("Pending"),s=()=>{a("Infinite"),null==t||t(0)};return(0,r.jsx)(ex,{endReached:e=>{if("Pending"===l)return void s();null==t||t(e)},components:{...eh,Footer:n?void 0:({Pending:()=>(0,r.jsx)(em,{children:(0,r.jsx)(_.$,{onClick:s,size:"lg",children:"Load more"})}),Infinite:ef})[l]},...i})},ef=en.uo,em=en.YG;var ej=t(54761),ey=t(11891),eb=t(52001);let ev=()=>{let[e,n]=(0,B.useState)("Idle"),[t,i]=(0,B.useState)(""),l=(0,B.useRef)(null),{y:a}=ed(),{addCell:s}=(0,M.E1)(),{sendToast:o,sendGenericError:d}=(0,eb.Yf)(),{createBlock:c}=(0,q.p)();(0,B.useEffect)(()=>{l.current&&0===a&&l.current.focus()},[a]);let u=async()=>{if(""!==t.trim()&&"Adding"!==e){n("Adding");try{let e=await c({value:t});s({type:"Block",id:e}),o({title:"Block added successfully"}),i("")}catch(e){d(e)}n("Idle")}};return(0,ea.vC)("meta+enter",e=>{e.preventDefault(),n("Open")},[]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(O,{css:{alignItems:"center",gap:"$1","&:hover":{bg:"$background"}},children:(0,r.jsx)(K.m_,{label:"⌘ + enter",children:(0,r.jsx)(_.$,{ref:l,size:"sm",onClick:()=>{n("Open")},children:"+ Add block"})})}),(0,r.jsx)(ej.Dz,{open:"Idle"!==e,onOpenChange:e=>{n(e?"Open":"Idle")},children:(0,r.jsx)(ej.lG,{title:"Add block",isCloseable:!0,css:{width:400,height:"auto","@bp1":{width:"100%",height:"100%"}},children:(0,r.jsxs)(y.B,{gap:"$6",children:[(0,r.jsx)(ey.TM,{rows:4,placeholder:"Paste a URL (image, video, or link) or type text here",autoFocus:!0,onChange:e=>i(e.target.value)}),(0,r.jsx)(ej.Es,{children:(0,r.jsx)(_.$,{onClick:u,disabled:""===t.trim()||"Adding"===e,children:"Adding"===e?"Adding…":"Add block"})})]})})})]})};var e_=t(71431),eC=t(57314),ew=t(89250),e$=t(84147);let eI=e=>{let{children:n,editable:t,multiline:i,onClick:l,onSubmit:a,size:s="md",value:o,x:d,y:c,...u}=e,{sendToast:h,updateToast:x}=(0,eb.Yf)(),{x:p,y:g,setCoordinates:f}=ed(),[m,j]=(0,B.useState)("Idle"),y=(0,B.useRef)(null),[b,v]=(0,B.useState)(o),_=p===d&&g===c;(0,B.useEffect)(()=>{y.current&&_&&y.current.focus()},[_]);let{ref:C}=(0,ei.L)({when:"Edit"===m,type:"mousedown",onClickOutside:()=>{if(o===b)return void j("Idle");I()}}),w=e=>{if("Enter"===e.key&&!e.shiftKey&&!i||"Enter"===e.key&&e.metaKey){e.preventDefault(),I();return}if("Escape"===e.key){j("Idle"),f({x:d,y:c,source:"Keyboard"});return}},$=e=>{v(e.currentTarget.value)},I=async()=>{if(void 0===b)return;if(b===o){j("Idle"),f({x:d,y:c,source:"Keyboard"});return}j("Saving"),f({x:d,y:c,source:"Keyboard"});let e=h({title:"Saving…"});f({x:d,y:c+1,source:"Keyboard"}),await (null==a?void 0:a(b)),x({...e,title:"Updated"}),j("Idle")};return"Edit"===m||"Saving"===m?(0,r.jsx)(D,{size:s,children:i?(0,r.jsx)(H.a,{css:{position:"relative",flex:1,minWidth:0,px:"$2"},children:(0,r.jsx)(ez,{ref:C,defaultValue:b,autoFocus:!0,onKeyDown:w,onChange:$,disabled:"Saving"===m,css:{width:"100%",boxSizing:"border-box"}})}):(0,r.jsx)(eS,{ref:C,defaultValue:b,autoFocus:!0,onKeyDown:w,onChange:$,disabled:"Saving"===m})}):(0,r.jsx)(D,{size:s,children:(0,r.jsx)(eF,{ref:y,editable:t,onClick:e=>{if(f({x:d,y:c,source:"Click"}),_){if(void 0!==b)return void j(e=>"Idle"===e?"Edit":"Idle");null==l||l(e)}},...u,children:n})})},ek={all:"unset",boxSizing:"border-box",flex:1,minWidth:0,px:"$2",outline:0,bg:"$background",boxShadow:"0 0 0 1px $colors$focus",zIndex:1,...V.X.sm,"&:disabled":{color:"$slate",boxShadow:"0 0 0 1px $colors$gray3"}},eS=(0,U.pH)("input",ek),ez=(0,U.pH)("textarea",{...ek,width:"auto",position:"absolute",left:0,right:0,top:0,height:150,py:"$2"}),eF=(0,U.pH)(e$.D,{position:"relative",flex:1,display:"flex",alignItems:"center",minWidth:0,boxShadow:"inset 1px 0 0 $colors$gray2",px:"$2","&:focus":{outline:0,boxShadow:"0 0 0 1px $colors$focus",zIndex:1,color:"$link"},variants:{editable:{true:{"&:hover, &:focus":{bg:"$blue1"}}}},defaultVariants:{editable:!1}});var eP=t(57175);let eT=()=>(0,r.jsx)(O,{css:{borderBottom:"1px solid $gray2"},children:(0,r.jsx)(eP.Z,{css:{width:"100%",height:"100%",color:"$gray2"}})}),eR=()=>(0,r.jsx)(O,{css:{borderBottom:"1px solid $gray2"}}),eE=()=>{let[e,n]=(0,B.useState)("Pending");return{hover:e,isHovered:"Hover"===e,hoverProps:{onMouseEnter:()=>{n("Hover")},onMouseLeave:()=>{n("Pending")}}}};var eB=t(78085),eG=t(13107),eA=t(48230),eq=t.n(eA);function eM(){let e=(0,l._)(['\n fragment TableRowBlockFragment on Konnectable {\n ...TableRowThumbnailFragment\n __typename\n ... on PendingBlock {\n iso_created_at: created_at(format: "%Y-%m-%dT%H:%M:%S.%LZ")\n }\n ... on Model {\n id\n }\n ... on ConnectableInterface {\n title\n href\n user {\n ...AvatarUserFragment\n id\n name\n href\n }\n source {\n url\n title\n }\n connection_to(channel_id: $channelId) {\n id\n created_at(relative: true)\n iso_created_at: created_at(format: "%Y-%m-%dT%H:%M:%S.%LZ")\n }\n }\n ... on Text {\n editableContent: content(format: MARKDOWN)\n }\n ... on Block {\n can {\n manage\n }\n }\n }\n']);return eM=function(){return e},e}function eL(){let e=(0,l._)(["\n query TableRowBlockQuery($id: ID!, $channelId: ID) {\n block: blokk(id: $id) {\n ...TableRowBlockFragment\n }\n }\n\n mutation TableRowBlockMutation(\n $input: UpdateBlockMutationInput!\n $channelId: ID!\n ) {\n update_block(input: $input) {\n block: blokk {\n ...TableRowBlockFragment\n ...BlockTextFragment\n }\n }\n }\n"]);return eL=function(){return e},e}let eU=e=>{var n;let{block:t,index:i}=e,{channelId:l}=(0,q.p)(),{isHovered:a,hoverProps:s}=eE(),{y:o}=ed(),{link:d}=(0,eC.U)({href:t.href,blockId:t.id.toString()}),[{fetching:c},h]=(0,u.vUf)({variables:{id:t.id.toString(),channelId:l.toString()},requestPolicy:"network-only",pause:!0});(0,eB.g)({fetching:c,refetch:h,..."PendingBlock"===t.__typename?{isoTimestamp:t.iso_created_at}:{pause:!0}});let[x,p]=(0,u.if9)(),g=a||o===i,f=(0,B.useMemo)(()=>{var e;return"Text"===t.__typename?(0,eG.xv)(t.editableContent,{from:"center",length:75}):(0,eG.xv)((null==(e=t.source)?void 0:e.url)||"—",{from:"center",length:75})},[t]);return"Channel"===t.__typename?null:(0,r.jsxs)(O,{active:g,...s,children:[(0,r.jsx)(H.a,{css:{display:"flex",alignItems:"center"},children:(0,r.jsx)(Q,{connectable:t})}),(0,r.jsx)(eI,{value:"Text"===t.__typename&&t.can.manage?t.editableContent:void 0,x:0,y:i,multiline:!0,editable:"Text"===t.__typename&&t.can.manage,onClick:()=>{var e;"Text"===t.__typename&&t.can.manage||window.open((null==(e=t.source)?void 0:e.url)||t.href,"_blank")},onSubmit:e=>{if(t.can.manage)return p({channelId:l.toString(),input:{id:t.id.toString(),content:e}})},children:(0,r.jsx)(V.E,{size:"xs",ellipsis:!0,children:f})}),(0,r.jsx)(eI,{x:1,y:i,value:"PendingBlock"!==t.__typename&&t.can.manage?t.title||"":void 0,editable:"PendingBlock"!==t.__typename&&t.can.manage,onClick:()=>{t.can.manage||window.open(t.href,"_blank")},onSubmit:e=>{if(t.can.manage)return p({channelId:l.toString(),input:{id:t.id.toString(),title:e}})},children:(0,r.jsx)(V.E,{size:"xs",ellipsis:!0,children:t.title||"—"})}),(0,r.jsx)(eI,{x:2,y:i,size:"sm",onClick:()=>{t.user&&window.open(t.user.href,"_blank")},children:t.user&&(0,r.jsxs)(H.a,{css:{display:"flex",gap:"$2",alignItems:"center",minWidth:0},children:[(0,r.jsx)(e_.e,{size:"xxs",entity:t.user}),(0,r.jsx)(V.E,{size:"xs",ellipsis:!0,children:t.user.name||"—"})]})}),(0,r.jsx)(eI,{x:3,y:i,size:"sm",onClick:()=>{window.open(t.href,"_blank")},children:(0,r.jsx)(V.E,{size:"xs",ellipsis:!0,children:(null==(n=t.connection_to)?void 0:n.created_at)||"—"})}),(0,r.jsxs)(N,{children:[(0,r.jsx)(K.m_,{label:"Open",side:"bottom",children:(0,r.jsx)(eq(),{...d,scroll:!1,passHref:!0,children:(0,r.jsx)(_.$,{size:"icon",as:"a",children:(0,r.jsx)(w.hWu,{})})})}),(0,r.jsx)(ew.G,{id:t.id})]})]})},eD=e=>(0,r.jsx)(eU,{...e});(0,h.J1)(eM());let eO=e=>{let{id:n,index:t}=e,{channelId:i}=(0,q.p)(),[{data:l,error:a,fetching:s}]=(0,u.vUf)({variables:{id:n,...0!==i?{channelId:i.toString()}:{}}});return a?(console.error(a),(0,r.jsx)(eT,{})):s||!l?(0,r.jsx)(eR,{}):l.block?(0,r.jsx)(eD,{block:l.block,index:t}):(0,r.jsx)(eT,{})};(0,h.J1)(eL());var eN=t(39484),eH=t(29615),eJ=t(63073),eK=t(82749);function eW(){let e=(0,l._)(['\n query TableRowChannelQuery($id: ID!, $channelId: ID) {\n channel(id: $id) {\n ...TableRowChannelFragment\n }\n }\n\n fragment TableRowChannelFragment on Channel {\n ...TableRowThumbnailFragment\n id\n href\n title\n visibility_name\n counts {\n contents\n }\n blocks: blokks(page: 1, per: 12, sort_by: POSITION, direction: DESC) {\n ...PreviewCellFragment\n ... on Model {\n id\n }\n }\n owner {\n __typename\n ... on User {\n ...AvatarUserFragment\n id\n name\n href\n }\n ... on Group {\n ...AvatarGroupFragment\n id\n name\n href\n }\n }\n connection_to(channel_id: $channelId) {\n id\n created_at(relative: true)\n iso_created_at: created_at(format: "%Y-%m-%dT%H:%M:%S.%LZ")\n }\n }\n']);return eW=function(){return e},e}let eY=e=>{var n;let{channel:t,index:i}=e,{isHovered:l,hoverProps:a}=eE(),{y:s}=ed(),{primary:o}=(0,eH.W)(t.visibility_name),d=l||s===i;return(0,r.jsxs)(O,{active:d,...a,children:[(0,r.jsx)(H.a,{css:{display:"flex",alignItems:"center"},children:(0,r.jsx)(Q,{connectable:t})}),(0,r.jsx)(eI,{x:0,y:i,onClick:()=>{window.open(t.href,"_blank")},children:(0,r.jsx)(eK.X,{direction:"horizontal",css:{display:"flex",gap:"$1",alignItems:"center"},children:t.blocks.map(e=>(0,r.jsx)(H.a,{css:{width:30,height:30,flexShrink:0},children:(0,r.jsx)(J.l,{connectable:e,size:30})},e.id))})}),(0,r.jsx)(eI,{x:1,y:i,onClick:()=>{window.open(t.href,"_blank")},children:(0,r.jsxs)(V.E,{size:"xs",css:{color:o},ellipsis:!0,children:[t.title," - ",(0,r.jsxs)(V.E,{as:"span",size:"xs",css:{color:o},children:[(0,eJ.B)(t.counts.contents)," block",1!==t.counts.contents?"s":""]})]})}),(0,r.jsx)(eI,{x:2,y:i,size:"sm",onClick:()=>{window.open(t.owner.href,"_blank")},children:t.owner&&(0,r.jsxs)(H.a,{css:{display:"flex",gap:"$2",alignItems:"center",minWidth:0},children:[(0,r.jsx)(e_.e,{size:"xxs",entity:t.owner}),(0,r.jsx)(V.E,{size:"xs",ellipsis:!0,children:t.owner.name||"—"})]})}),(0,r.jsx)(eI,{x:3,y:i,size:"sm",onClick:()=>{window.open(t.href,"_blank")},children:(0,r.jsx)(V.E,{size:"xs",ellipsis:!0,children:(null==(n=t.connection_to)?void 0:n.created_at)||"—"})}),(0,r.jsxs)(N,{children:[(0,r.jsx)(K.m_,{label:"Open",side:"bottom",children:(0,r.jsx)(eq(),{href:t.href,passHref:!0,children:(0,r.jsx)(_.$,{size:"icon",as:"a",children:(0,r.jsx)(w.hWu,{})})})}),(0,r.jsx)(eN.K,{id:t.id})]})]})},eQ=e=>(0,r.jsx)(eY,{...e}),eV=e=>{let{id:n,index:t}=e,{channelId:i}=(0,q.p)(),[{data:l,error:a,fetching:s}]=(0,u.HTO)({variables:{id:n,...0!==i?{channelId:i.toString()}:{}}});return a?(console.error(a),(0,r.jsx)(eT,{})):s||!l?(0,r.jsx)(eR,{}):l.channel?(0,r.jsx)(eQ,{channel:l.channel,index:t}):(0,r.jsx)(eT,{})};(0,h.J1)(eW());let eZ=e=>{let{cols:n=0,endReached:t,done:i}=e,{cells:l}=(0,M.E1)(),a="Add"===l[0].type,s=a?l.slice(1):l,o=(0,B.useCallback)(e=>{let n=s[e];switch(n.type){case"Block":return(0,r.jsx)(eO,{id:n.id.toString(),index:e});case"Channel":return(0,r.jsx)(eV,{id:n.id.toString(),index:e});default:return null}},[s]);return(0,r.jsxs)(eo,{maxX:n,maxY:s.length,children:[a&&(0,r.jsx)(ev,{}),(0,r.jsx)(Z,{}),void 0===i?(0,r.jsx)(ex,{totalCount:s.length,endReached:t,itemContent:o}):(0,r.jsx)(eg,{done:i,totalCount:s.length,endReached:t,itemContent:o})]})},eX=()=>(0,r.jsx)(H.a,{children:Array.from({length:10}).map((e,n)=>(0,r.jsx)(et,{},n))});var e0=t(62610);function e1(){let e=(0,l._)(["\n query ChannelTableQuery($id: ID!) {\n channel(id: $id) {\n ...ChannelOperationsChannelFragment\n id\n href\n compressed_skeleton\n can {\n add_to\n }\n }\n }\n"]);return e1=function(){return e},e}let e2=()=>{let{channelId:e,blockId:n,isReady:t}=(0,f.T)(),i=(0,z.useRouter)(),[{data:l,fetching:a,error:s}]=(0,u.zov)({variables:{id:e},pause:!t,requestPolicy:"cache-and-network"}),o=(0,B.useMemo)(()=>l&&l.channel?(0,G.b)(l.channel.compressed_skeleton):[],[l]);if(s)throw s;return!a&&l&&l.channel?(0,r.jsx)(e0.j,{children:(0,r.jsx)(q.T,{channel:l.channel,children:(0,r.jsxs)(M.kv,{cells:[...l.channel.can.add_to?[M.zd]:[],...o],children:[(0,r.jsx)(L.h,{}),(0,r.jsx)(eZ,{cols:4}),(0,r.jsx)(A.k,{id:n,onOpenChange:e=>{!e&&l&&l.channel&&i.back()}})]},l.channel.id)})}):(0,r.jsx)(eX,{})};(0,h.J1)(e1());var e7=t(29507);let e3=e=>{let{id:n}=e,{query:t}=(0,z.useRouter)();switch((0,e7.r)(t.tab)){case"table":return(0,r.jsx)(E.G,{id:n,children:(0,r.jsx)(e2,{})});case"followers":return(0,r.jsx)(E.G,{id:n,name:"Followers",children:(0,r.jsx)(T,{})});case"connections":return(0,r.jsx)(E.G,{id:n,name:"Connections",children:(0,r.jsx)(k,{})});case"collaborators":return(0,r.jsx)(E.G,{id:n,name:"Collaborators",children:(0,r.jsx)(p,{id:n})});default:return(0,r.jsx)(E.G,{id:n,children:(0,r.jsx)(R.E,{id:n})})}};var e8=t(10120),e6=t(1261),e9=t(77152),e4=t(74349);function e5(){let e=(0,l._)(["\n fragment ProfileEmptyUserFragment on User {\n id\n is_me\n }\n\n fragment ProfileEmptyGroupFragment on Group {\n id\n }\n"]);return e5=function(){return e},e}let ne=e=>{let{profile:n}=e,{open:t}=(0,e4.s)();return"User"===n.__typename&&n.is_me?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(H.a,{css:{px:"$4",py:"$10",bg:"$gray1",color:"$slate",textAlign:"center"},children:(0,r.jsxs)(y.B,{gap:"$2",children:[(0,r.jsx)(V.E,{size:"xl",css:{color:"$slate"},children:"Your profile doesn’t have any content yet."}),(0,r.jsx)(_.$,{size:"sm",css:{mixBlendMode:"$colors$blend",alignSelf:"center"},onClick:()=>{t({type:"NewChannel"})},children:"Create your first channel"})]})})}):(0,r.jsx)(v.P,{children:"Nothing yet"})};(0,h.J1)(e5());var nn=t(72047),nt=t(43023),nr=t(947),ni=t(83740);function nl(){let e=(0,l._)(["\n query ProfileChannelsIndexQuery($id: ID!, $type: IndexedChannelsTypes) {\n identity(id: $id) {\n id\n identifiable {\n ...ProfileChannelsIndexFragment\n }\n }\n }\n\n fragment ProfileChannelsIndexFragment on Identifiable {\n ...ProfileEmptyUserFragment\n ...ProfileEmptyGroupFragment\n ... on Model {\n id\n }\n ... on User {\n channels_index(type: $type) {\n key\n channels {\n ...ChannelCompactFragment\n id\n }\n }\n }\n ... on Group {\n channels_index(type: $type) {\n key\n channels {\n ...ChannelCompactFragment\n id\n }\n }\n }\n }\n"]);return nl=function(){return e},e}let na=e=>{var n;let{identifiable:t,refetch:i}=e,{query:{visibility:l}}=(0,z.useRouter)(),a=(0,B.useMemo)(()=>(0,ni.q)(l),[l]),[s,o]=(0,B.useState)(""),[d,c]=(0,B.useState)(null!=(n=t.channels_index)?n:[]);(0,B.useEffect)(()=>{var e;c(null!=(e=t.channels_index)?e:[])},[t.channels_index]);let u=(0,B.useMemo)(()=>d.map(e=>{let{key:n,channels:t}=e;return{key:n,channels:t.filter(e=>{let{title:n,visibility_name:t}=e;return n.toLowerCase().includes(s.toLowerCase())&&(!a||t===a)})}}),[d,s,a]);return 0===d.length?(0,r.jsx)(ne,{profile:t}):(0,r.jsxs)(y.B,{gap:"$6",children:[(0,r.jsx)(nt.DO,{placeholder:"Filter index",value:s,onChange:o}),(0,r.jsx)(nd,{children:u.map(e=>{let{key:n,channels:t}=e;return 0===t.length?null:(0,r.jsxs)(y.B,{gap:"$2",css:{breakInside:"avoid"},children:[(0,r.jsx)(V.E,{size:"md",as:"h2",css:{color:"$gray5",borderBottom:"1px solid $gray2",pb:"$nudge"},children:n}),(0,r.jsx)(y.B,{gap:"$1",children:t.map(e=>(0,r.jsx)(e8.H,{channel:e,displayManage:!0,displayOwner:!1,hoverCard:"right",onDelete:()=>{c(n=>n.map(n=>{let{key:t,channels:r}=n;return{key:t,channels:r.filter(n=>{let{id:t}=n;return t!==e.id})}})),i()},onUpdate:()=>{i()}},e.id))}),(0,r.jsx)(e6.h,{y:"$6"})]},n)})})]})};(0,h.J1)(nl());let ns=()=>(0,r.jsxs)(y.B,{gap:"$6",children:[(0,r.jsx)(nr.cV,{}),(0,r.jsx)(nd,{children:Array.from({length:7}).map((e,n)=>(0,r.jsxs)(y.B,{gap:"$2",css:{breakInside:"avoid"},children:[(0,r.jsx)(e9.r,{size:"md",css:{borderBottom:"1px solid $gray2",pb:"$nudge"},children:"AZ"}),(0,r.jsx)(y.B,{gap:"$1",children:Array.from({length:[18,4,7][n%3]}).map((e,n)=>(0,r.jsx)(e8.K,{length:[10,13,7,20][n%4]},n))}),(0,r.jsx)(e6.h,{y:"$6"})]},n))})]}),no=()=>{var e;let{query:{profileId:n,type:t=u.Hig.Own},isReady:i}=(0,z.useRouter)(),l=(0,B.useMemo)(()=>(0,nn.P)("".concat(t)),[t]),[{data:a,fetching:s,error:o},d]=(0,u.TFG)({requestPolicy:"cache-and-network",variables:{id:"".concat(n),...l?{type:l}:{}},pause:!i});if(o)throw o;let c=null==a||null==(e=a.identity)?void 0:e.identifiable;return s||!c?(0,r.jsx)(ns,{}):(0,r.jsx)(na,{identifiable:c,refetch:d},l)},nd=(0,U.pH)("div",{columnCount:2,"@bp1":{columnCount:1}});var nc=t(60307);function nu(){let e=(0,l._)(["\n query ProfileGroupsQuery($id: ID!, $page: Int!, $per: Int!) {\n identity(id: $id) {\n id\n identifiable {\n __typename\n ... on User {\n id\n counts {\n groups\n }\n groups(page: $page, per: $per) {\n ...GridCellGroupFragment\n id\n }\n }\n }\n }\n }\n"]);return nu=function(){return e},e}let nh=b.t7,nx=()=>{var e;let{query:{profileId:n,page:t},isReady:i}=(0,z.useRouter)(),l=Number(t)||1,[{data:s,fetching:d,error:c}]=(0,u.Fbm)({variables:{id:String(n),page:l,per:nh},pause:!i});if(c)throw c;let h=null==s||null==(e=s.identity)?void 0:e.identifiable;if(d||!h)return(0,r.jsx)(o.C,{per:nh});if("User"!==h.__typename)throw Error("Only users can have groups");let x=h.groups,p=h.counts.groups;return 0===p?(0,r.jsx)(v.P,{children:"Nothing yet"}):(0,r.jsxs)(y.B,{gap:"$2",children:[(0,r.jsx)(m.JT,{children:x.map(e=>(0,r.jsx)(a.u,{group:e},e.id))}),(0,r.jsx)(j.is,{total:p,per:nh})]})};function np(){let e=(0,l._)(["\n query ProfileFollowersQuery($id: ID!, $page: Int, $per: Int) {\n identity(id: $id) {\n id\n identifiable {\n ... on Model {\n id\n }\n ... on User {\n counts {\n followers\n }\n followers(page: $page, per: $per) {\n ...GridCellUserFragment\n id\n }\n }\n ... on Group {\n counts {\n followers\n }\n followers(page: $page, per: $per) {\n ...GridCellUserFragment\n id\n }\n }\n }\n }\n }\n"]);return np=function(){return e},e}(0,h.J1)(nu());let ng=b.t7,nf=()=>{var e,n,t,i;let{query:{profileId:l},isReady:a}=(0,z.useRouter)(),h=(0,S.a)(),[{data:x,fetching:p,error:g}]=(0,u.CS8)({variables:{id:String(l),page:h,per:ng},pause:!a});if(g)throw g;if(p||0===((null==x||null==(n=x.identity)||null==(e=n.identifiable.followers)?void 0:e.length)||0))return(0,r.jsxs)(y.B,{gap:"$4",children:[(0,r.jsx)(o.C,{}),(0,r.jsx)(j.RT,{})]});let f=(0,c.o)(null==x||null==(t=x.identity)?void 0:t.identifiable.followers),m=(null==x||null==(i=x.identity)?void 0:i.identifiable.counts.followers)||0;return(0,r.jsxs)(y.B,{gap:"$4",children:[(0,r.jsx)(d.YL,{totalCount:f.length,itemContent:e=>{let n=f[e];return(0,r.jsx)(s.G,{user:n})}}),(0,r.jsx)(j.is,{total:m,per:ng})]})};function nm(){let e=(0,l._)(["\n query ProfileFollowingQuery($id: ID!, $page: Int, $per: Int) {\n identity(id: $id) {\n id\n identifiable {\n __typename\n ... on Model {\n id\n }\n ... on User {\n counts {\n following\n }\n following(page: $page, per: $per) {\n ...GridCellUserFragment\n ...GridCellGroupFragment\n ...GridCellChannelFragment\n __typename\n ... on Model {\n id\n }\n }\n }\n }\n }\n }\n"]);return nm=function(){return e},e}(0,h.J1)(np());let nj=b.t7,ny=()=>{var e,n,t,i,l;let{query:{profileId:h},isReady:x}=(0,z.useRouter)(),p=(0,S.a)(),[{data:f,fetching:m,error:b}]=(0,u.quN)({variables:{id:String(h),page:p,per:nj},pause:!x});if(b)throw b;if((null==f||null==(e=f.identity)?void 0:e.identifiable.__typename)==="Group")return null;if(m||0===((null==f||null==(t=f.identity)||null==(n=t.identifiable.following)?void 0:n.length)||0))return(0,r.jsxs)(y.B,{gap:"$4",children:[(0,r.jsx)(o.C,{}),(0,r.jsx)(j.RT,{})]});let v=(0,c.o)(null==f||null==(i=f.identity)?void 0:i.identifiable.following),_=(null==f||null==(l=f.identity)?void 0:l.identifiable.counts.following)||0;return(0,r.jsxs)(y.B,{gap:"$4",children:[(0,r.jsx)(d.YL,{totalCount:v.length,itemContent:e=>{let n=v[e];switch(n.__typename){case"Channel":return(0,r.jsx)(g.sT,{channel:n});case"User":return(0,r.jsx)(s.G,{user:n});case"Group":return(0,r.jsx)(a.u,{group:n})}}}),(0,r.jsx)(j.is,{total:_,per:nj})]})};(0,h.J1)(nm());var nb=t(60695);function nv(){let e=(0,l._)(["\n query ProfileChannelsQuery($id: ID!, $page: Int!, $per: Int!) {\n identity(id: $id) {\n id\n identifiable {\n ...ProfileEmptyUserFragment\n ...ProfileEmptyGroupFragment\n __typename\n ... on Model {\n id\n }\n ... on User {\n counts {\n channels\n }\n channels(page: $page, per: $per) {\n ...RowChannelFragment\n id\n }\n }\n ... on Group {\n counts {\n channels\n }\n channels(page: $page, per: $per) {\n ...RowChannelFragment\n id\n }\n }\n }\n }\n }\n"]);return nv=function(){return e},e}let n_=b.t7,nC=()=>{var e,n,t,i,l;let{query:{profileId:a,page:s},isReady:o}=(0,z.useRouter)(),d=Number(s)||1,[{data:c,fetching:h,error:x}]=(0,u.Fjt)({requestPolicy:"cache-and-network",variables:{id:String(a),page:d,per:n_},pause:!o});if(x)throw x;if(h||!(null==c||null==(e=c.identity)?void 0:e.identifiable)||(null==c||null==(n=c.identity)?void 0:n.identifiable.__typename)==="User"&&null===c.identity.identifiable.channels)return(0,r.jsx)(y.B,{gap:"$6",children:Array.from({length:24}).map((e,n)=>(0,r.jsx)(nb.RC,{},n))});let p=null==(t=c.identity)?void 0:t.identifiable;return 0===(null!=(i=p.channels)?i:[]).length?(0,r.jsx)(ne,{profile:p}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ec.aY,{useWindowScroll:!0,data:null!=(l=p.channels)?l:[],itemContent:(e,n)=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(nb.ES,{channel:n}),(0,r.jsx)(e6.h,{y:"$6"})]}),overscan:200}),(0,r.jsx)(j.is,{total:p.counts.channels,per:n_})]})};(0,h.J1)(nv());var nw=t(2092);function n$(){let e=(0,l._)(["\n fragment SearchTableResultFragment on SsearchResult {\n __typename\n ... on Model {\n id\n }\n }\n\n query SearchTableQuery(\n $term: Term\n $where: [Where!]\n $what: What\n $fields: Fields\n $order: Order\n $extensions: [ExtensionsEnum!]\n $page: Int\n $per: Int\n $before: String\n $after: String\n ) {\n searches {\n advanced(\n term: $term\n where: $where\n what: $what\n fields: $fields\n order: $order\n extensions: $extensions\n per: $per\n page: $page\n before: $before\n after: $after\n ) {\n total\n results {\n ...SearchTableResultFragment\n }\n }\n }\n }\n"]);return n$=function(){return e},e}let nI=b.t7,nk=e=>{let{input:n}=e,{error:t,fetching:i,total:l,results:a,loadMore:s,done:o}=nS({input:n}),d=(0,M.MK)(a);if(t)throw t;return i||0!==l?0===a.length?(0,r.jsx)(eX,{}):(0,r.jsx)(e0.j,{children:(0,r.jsxs)(M.kv,{cells:d,children:[(0,r.jsx)(eZ,{cols:4,endReached:s,done:o}),(0,r.jsx)(A.k,{})]})}):(0,r.jsx)(v.P,{children:"Nothing yet"})},nS=e=>{var n,t,r;let{input:i}=e,l=JSON.stringify(i),[a,s]=(0,B.useState)(!1),[o,d]=(0,B.useState)(1),[h,x]=(0,B.useState)([]),[{data:p,fetching:g,error:f}]=(0,u.k92)({variables:{page:o,per:nI,...i},pause:a}),m=null!=(r=null==p||null==(n=p.searches)?void 0:n.advanced.total)?r:0,j=(0,B.useMemo)(()=>{var e;return(0,c.o)(null==p||null==(e=p.searches)?void 0:e.advanced.results)},[null==p||null==(t=p.searches)?void 0:t.advanced.results]);return(0,B.useEffect)(()=>{if(!g){if(!g&&0===j.length)return void s(!0);x(e=>(0,nw.Y)([...e,...j]))}},[g,j]),(0,B.useEffect)(()=>{x([])},[l]),{page:o,results:h,loadMore:(0,B.useCallback)(()=>{a||g||d(e=>e+1)},[a,g]),fetching:g,error:f,done:a,total:m,isExceedingLimit:m>=1e4}};(0,h.J1)(n$());var nz=t(81732),nF=t(2118),nP=t(97423);function nT(){let e=(0,l._)(["\n query ProfilePageQuery($id: ID!) {\n identity(id: $id) {\n ...ProfileLayoutFragment\n id\n identifiable {\n __typename\n ... on Model {\n id\n }\n }\n }\n }\n"]);return nT=function(){return e},e}let nR=e=>{let{id:n,tab:t}=e,[{data:l,fetching:a,error:s}]=(0,u.Cnx)({variables:{id:n.toString()}}),{preferences:o}=(0,nP.gc)(),d=(0,z.useRouter)(),{order:c}=nz.SC.order.prepare(String(d.query.order||o.profileOrder||nF.oz)),h=null==l?void 0:l.identity;if(s)throw s;if(a||!h)return(0,r.jsx)(i.fZ,{children:(0,r.jsx)(r.Fragment,{})});let x="User"===h.identifiable.__typename?"USER":"GROUP";switch(t){case"channels":return(0,r.jsx)(i.ug,{identity:h,children:(0,r.jsx)(nC,{})});case"blocks":return(0,r.jsx)(i.ug,{identity:h,children:(0,r.jsx)(nc.L,{input:{what:{facets:["BLOCK"]},where:[{facet:x,id:n.toString()}],order:c}})});case"table":return(0,r.jsx)(i.ug,{identity:h,children:(0,r.jsx)(nk,{input:{what:{facets:["ALL"]},where:[{facet:x,id:n.toString()}],order:c}})});case"index":return(0,r.jsx)(i.ug,{identity:h,children:(0,r.jsx)(no,{})});case"all":return(0,r.jsx)(i.ug,{identity:h,children:(0,r.jsx)(nc.L,{input:{what:{facets:["ALL"]},where:[{facet:x,id:n.toString()}],order:c}})});case"groups":return(0,r.jsx)(i.ug,{identity:h,name:"Groups",children:(0,r.jsx)(nx,{})});case"following":return(0,r.jsx)(i.ug,{identity:h,name:"Following",children:(0,r.jsx)(ny,{})});case"followers":return(0,r.jsx)(i.ug,{identity:h,name:"Followers",children:(0,r.jsx)(nf,{})});default:return null}};(0,h.J1)(nT());var nE=t(9295),nB=t(61367),nG=t(84916),nA=t(80904),nq=t(24842),nM=t(80397),nL=t(59782);function nU(e){let{error:n,metaTags:t}=e,{profileId:l,channelId:a}=(0,f.T)();return(0,i.NO)(a)?(0,r.jsx)(nG.x,{error:n,metaTags:t,children:(0,r.jsx)(nR,{id:l,tab:a})}):(0,r.jsx)(nG.x,{error:n,metaTags:t,children:(0,r.jsx)(e3,{id:a})})}nU.getInitialProps=async e=>{let{req:n,res:t,query:r}=e;if(!n||!t||!r.profileId||"_next"===r.profileId)return{};try{let{user:e}=await (0,nE.Ht)(n,t),l=(0,nB.kV)({authenticationToken:null==e?void 0:e.authentication_token}),a=Array.isArray(r.channelId)?r.channelId[0]:r.channelId;if((0,i.NO)(a)){let e=String(r.profileId),{metaTags:n}=await (0,nq.O)({client:l,id:e});return n?{metaTags:n}:{}}let s=Array.isArray(r.tab)?r.tab[0]:r.tab;if(a&&(0,nM.jW)(s)){let{metaTags:e}=await (0,nA.q4)({client:l,id:a});return e?{metaTags:e}:{}}throw new nL.m_}catch(e){return(0,nG.j)({err:e,res:t})}}},60695:(e,n,t)=>{"use strict";t.d(n,{ES:()=>P,zr:()=>B,RC:()=>T});var r=t(28888),i=t(37876),l=t(68556),a=t(42357),s=t(41437),o=t(93801),d=t(74716),c=t(14232);let u=e=>{let{children:n,css:t,style:r}=e,l=(0,c.useRef)(null),[u,h]=(0,c.useState)(0),x=()=>{l.current&&h(l.current.children[0].getBoundingClientRect().height)};return(0,s.E)(x,[]),(0,o.w)({target:l,onResize:x}),(0,i.jsx)(a.JT,{ref:l,css:(0,d.h)({overflow:"hidden"},t),style:{maxHeight:u,...r},children:n})};var h=t(93026),x=t(14905),p=t(48230),g=t.n(p),f=t(86355),m=t(16825),j=t(31576),y=t(92726);function b(){let e=(0,r._)(["\n fragment RowChannelContentsFragment on Channel {\n id\n connectables: blokks(page: 1, per: 9, sort_by: POSITION, direction: DESC) {\n ...GridCellChannelContentFragment\n ...GridCellBlockContentFragment\n __typename\n ... on Model {\n id\n }\n }\n }\n\n query RowChannelContentsQuery($id: ID!) {\n channel(id: $id) {\n ...RowChannelContentsFragment\n id\n }\n }\n"]);return b=function(){return e},e}let v=e=>{let{channel:n}=e;return(0,i.jsx)(i.Fragment,{children:n.connectables.map(e=>{switch(e.__typename){case"PendingBlock":case"Text":case"Image":case"Link":case"Attachment":case"Embed":return(0,i.jsx)(m.z,{width:1,height:1,maxWidth:"100%",css:{pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,i.jsx)(j.PU,{block:e})},e.id);case"Channel":return(0,i.jsx)(m.z,{width:1,height:1,maxWidth:"100%",css:{pointerEvents:"none"},children:(0,i.jsx)(l.b1,{channel:e})},e.id);default:return null}})})},_=()=>(0,i.jsx)(i.Fragment,{children:Array.from({length:9}).map((e,n)=>(0,i.jsx)(m.z,{width:1,height:1,maxWidth:"100%",children:(0,i.jsx)(y.A,{})},n))}),C=e=>{let{id:n}=e,[{data:t,error:r,fetching:l}]=(0,x.dvx)({variables:{id:n.toString()}});return r?(console.error(r),null):!l&&t&&t.channel?(0,i.jsx)(v,{channel:t.channel}):(0,i.jsx)(_,{})};(0,f.J1)(b());var w=t(9323),$=t(27903),I=t(89572),k=t(92637),S=t(94594);function z(){let e=(0,r._)(["\n fragment RowChannelFragment on Channel {\n ...GridCellChannelContentFragment\n id\n href\n visibility_name\n }\n"]);return z=function(){return e},e}function F(){let e=(0,r._)(["\n query RowChannelQuery($id: ID!) {\n channel(id: $id) {\n ...RowChannelFragment\n }\n }\n"]);return F=function(){return e},e}let P=e=>{let{channel:n}=e,t=(0,c.useRef)(null);return(0,i.jsx)(w.t,{FallbackComponent:$.P,children:(0,i.jsx)(k.U,{cellRef:t,children:(0,i.jsxs)(E,{ref:t,visibility:n.visibility_name,children:[(0,i.jsx)(I.a,{as:g(),href:n.href,passHref:!0,css:{width:"100%",height:"100%",position:"absolute",top:0,left:0}}),(0,i.jsx)(R,{children:(0,i.jsx)(S.H,{id:n.id,type:"Channel"})}),(0,i.jsxs)(u,{children:[(0,i.jsx)(m.z,{width:1,height:1,maxWidth:"100%",children:(0,i.jsx)(l.b1,{channel:n,css:{border:0}})}),(0,i.jsx)(C,{id:n.id})]})]})})})},T=()=>(0,i.jsx)(E,{children:(0,i.jsxs)(u,{children:[(0,i.jsx)(m.z,{width:1,height:1,maxWidth:"100%",children:(0,i.jsx)(l.I0,{})}),(0,i.jsx)(_,{})]})}),R=(0,h.pH)("div",{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,pointerEvents:"none","a, button":{pointerEvents:"auto"},"@bp1":{display:"none"}}),E=(0,h.pH)("div",{position:"relative",p:"$3",border:"2px solid $gray2",["".concat(R)]:{opacity:0,transform:"translateY(2px)",transition:"opacity 50ms, visibility 50ms",visibility:"hidden"},"&:hover":{["".concat(R)]:{opacity:1,visibility:"visible"}},variants:{visibility:{PUBLIC:{borderColor:"$channelPublic2","&:hover":{borderColor:"$channelPublic3"}},PRIVATE:{borderColor:"$channelPrivate2","&:hover":{borderColor:"$channelPrivate3"}},CLOSED:{borderColor:"$channelClosed2","&:hover":{borderColor:"$channelClosed3"}}}}});(0,f.J1)(z());let B=e=>{let{id:n}=e,[{data:t,fetching:r,error:l}]=(0,x.jBj)({variables:{id:n.toString()}});if(l)return console.error(l),null;let a=null==t?void 0:t.channel;return r||!a?(0,i.jsx)(T,{}):(0,i.jsx)(P,{channel:a})};(0,f.J1)(F())},69926:(e,n,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/[profileId]/[channelId]/[[...tab]]",function(){return t(54188)}])},84916:(e,n,t)=>{"use strict";t.d(n,{j:()=>h,x:()=>c});var r=t(37876),i=t(62868),l=t(51194),a=t(80904),s=t(24842),o=t(59782),d=t(52447);let c=e=>{let{error:n,metaTags:t,children:l}=e;return n?(0,r.jsx)(i.M,{statusCode:n.statusCode,message:n.message}):(0,r.jsxs)(r.Fragment,{children:[t&&(0,r.jsx)(u,{metaTags:t}),l]})},u=e=>{let{metaTags:n}=e;switch(n.__typename){case"Channel":return(0,r.jsx)(a.YX,{channel:n});case"Identity":return(0,r.jsx)(s.C,{identity:n});case"Attachment":case"Embed":case"Image":case"Link":case"PendingBlock":case"Text":return(0,r.jsx)(l.sq,{block:n});default:return null}},h=e=>{let{err:n,res:t}=e;if(console.error(n),n instanceof Error&&"statusCode"in n&&"number"==typeof n.statusCode){t.statusCode=n.statusCode;let e=(0,d.PE)(n);return{error:{statusCode:n.statusCode,message:e}}}let r=(0,d.Pl)(n),i=(0,o.K)(r),l=500===i?(0,d.PE)(n):(0,o.oe)(i).message;return t.statusCode=i,{error:{statusCode:i,message:l}}}}},e=>{var n=n=>e(e.s=n);e.O(0,[8096,2805,3735,559,2570,8261,307,7253,636,6593,8792],()=>n(69926)),_N_E=e.O()}]);