1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9695],{78943:(e,l,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/collections/[id]",function(){return s(99106)}])},99106:(e,l,s)=>{"use strict";s.r(l),s.d(l,{__N_SSP:()=>E,default:()=>D});var n=s(6029),i=s(19784),t=s(81278),o=s(55729),a=s(43444),r=s(37812),c=s(13846),d=s(35189),u=s(91585),m=s(4410),h=s(63037),x=s(20595),v=s(67986),_=s(57179),g=s(14187),f=s(90273),j=s(85492),p=s(38544),b=s(34169),w=s(88202),N=s(69566),k=s(82295),A=s(19131),y=s(73639),C=s(35270),S=s(36919);let I=()=>{var e,l,s,a,I,E,D;let{t:M}=(0,g.Bd)(),F=(0,t.useRouter)(),{data:B=[]}=(0,j.Xd)(),[P,U]=(0,o.useState)(null!=(D=Number(localStorage.getItem("sortBy")))?D:i.FU.DateNewestFirst),{links:q,data:O}=(0,b.JQ)({sort:P,collectionId:Number(F.query.id)}),[X,z]=(0,o.useState)(null),[J,L]=(0,o.useState)(),Q=(0,c.A)(null==J?void 0:J.id);(0,o.useEffect)(()=>{L(B.find(e=>e.id===Number(F.query.id)))},[F,B]);let{data:T}=(0,p.Jd)(),R=(0,d.A)(),[V,W]=(0,o.useState)({});(0,o.useEffect)(()=>{(async()=>{J&&J.ownerId!==(null==T?void 0:T.id)?W(await (0,m.A)(J.ownerId)):J&&J.ownerId===(null==T?void 0:T.id)&&W({id:null==T?void 0:T.id,name:null==T?void 0:T.name,username:null==T?void 0:T.username,image:null==T?void 0:T.image,archiveAsScreenshot:null==T?void 0:T.archiveAsScreenshot,archiveAsMonolith:null==T?void 0:T.archiveAsMonolith,archiveAsPDF:null==T?void 0:T.archiveAsPDF})})()},[J]);let[$,G]=(0,o.useState)(!1),[H,K]=(0,o.useState)(!1),[Y,Z]=(0,o.useState)(!1),[ee,el]=(0,o.useState)(!1),[es,en]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(es)return en(!1)},[F]);let[ei,et]=(0,o.useState)(localStorage.getItem("viewMode")||i.nE.Card);return(0,n.jsxs)("div",{className:"p-5 flex gap-3 flex-col",style:{backgroundImage:"linear-gradient(".concat(null==J?void 0:J.color,"20 0%, ").concat("dark"===R?"#262626":"#f3f4f6"," 13rem, ").concat("dark"===R?"#171717":"#ffffff"," 100%)")},children:[J&&(0,n.jsxs)("div",{className:"flex gap-3 items-start justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[J.icon?(0,n.jsx)(N.A,{icon:J.icon,size:45,weight:J.iconWeight||"regular",color:J.color}):(0,n.jsx)("i",{className:"bi-folder-fill text-3xl",style:{color:J.color}}),(0,n.jsx)("p",{className:"sm:text-3xl text-2xl w-full py-1 break-words hyphens-auto font-thin",children:null==J?void 0:J.name})]}),(0,n.jsxs)(y.rI,{children:[(0,n.jsx)(y.ty,{asChild:!0,children:(0,n.jsx)(C.$,{asChild:!0,variant:"ghost",size:"icon",className:"mt-2 text-neutral cursor-pointer",onMouseDown:e=>e.preventDefault(),title:M("more"),children:(0,n.jsx)("i",{className:"bi-three-dots text-xl"})})}),(0,n.jsxs)(y.SQ,{sideOffset:4,align:"end",className:"bg-base-200 border border-neutral-content rounded-box p-1",children:[(0,n.jsxs)(y._2,{onClick:()=>{let e=!1;for(let l of q){if(!l.url)continue;let s=window.open(l.url,"_blank");s?s.blur():e=!0}window.focus(),e&&alert(M("popups_blocked_open_all_links"))},children:[(0,n.jsx)("i",{className:"bi-box-arrow-up-right"}),M("open_all_links")]}),!0===Q&&(0,n.jsxs)(y._2,{onClick:()=>G(!0),children:[(0,n.jsx)("i",{className:"bi-pencil-square"}),M("edit_collection_info")]}),(0,n.jsxs)(y._2,{onClick:()=>Z(!0),children:[(0,n.jsx)("i",{className:"bi-globe"}),!0===Q?M("share_and_collaborate"):M("view_team")]}),(!0===Q||(null==Q?void 0:Q.canCreate)&&(null==Q?void 0:Q.canUpdate)&&(null==Q?void 0:Q.canDelete))&&(0,n.jsxs)(y._2,{onClick:()=>K(!0),children:[(0,n.jsx)("i",{className:"bi-folder-plus"}),M("create_subcollection")]}),(0,n.jsx)(y.mB,{}),(0,n.jsx)(y._2,{onClick:()=>el(!0),className:"text-error",children:!0===Q?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("i",{className:"bi-trash"}),M("delete_collection")]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("i",{className:"bi-box-arrow-left"}),M("leave_collection")]})})]})]})]}),J&&(0,n.jsx)("div",{className:"min-w-[15rem]",children:(0,n.jsxs)("div",{className:"flex gap-1 justify-center sm:justify-end items-center w-fit",children:[(0,n.jsxs)("div",{className:"flex items-center px-1 py-1 rounded-full cursor-pointer hover:bg-base-content/20 transition-colors duration-200",onClick:()=>Z(!0),children:[V.id&&(0,n.jsx)(r.A,{src:V.image||void 0,name:V.name}),J.members.sort((e,l)=>e.userId-l.userId).map((e,l)=>(0,n.jsx)(r.A,{src:e.user.image?e.user.image:void 0,name:e.user.name,className:"-ml-3"},l)).slice(0,3),J.members.length-3>0&&(0,n.jsx)("div",{className:"avatar drop-shadow-md placeholder -ml-3",children:(0,n.jsx)("div",{className:"bg-base-100 text-neutral rounded-full w-8 h-8 ring-2 ring-neutral-content",children:(0,n.jsxs)("span",{children:["+",J.members.length-3]})})})]}),(0,n.jsx)("p",{className:"text-neutral text-sm ml-2",children:J.members.length>0?1===J.members.length?M("by_author_and_other",{author:V.name,count:J.members.length}):M("by_author_and_others",{author:V.name,count:J.members.length}):M("by_author",{author:V.name})})]})}),(null==J?void 0:J.description)&&(0,n.jsx)("p",{children:J.description}),(0,n.jsx)(S.w,{}),B.some(e=>e.parentId===(null==J?void 0:J.id))&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(A.A,{icon:"bi-folder",title:M("collections"),description:M(1===B.filter(e=>e.parentId===(null==J?void 0:J.id)).length?"showing_count_result":"showing_count_results",{count:B.filter(e=>e.parentId===(null==J?void 0:J.id)).length}),className:"scale-90 w-fit"}
1),(0,n.jsx)("div",{className:"grid 2xl:grid-cols-4 xl:grid-cols-3 sm:grid-cols-2 grid-cols-1 gap-5",children:B.filter(e=>e.parentId===(null==J?void 0:J.id)).map(e=>(0,n.jsx)(k.A,{collection:e},e.id))})]}),(0,n.jsx)(f.A,{t:M,viewMode:ei,setViewMode:et,sortBy:P,setSortBy:U,editMode:!0===Q||(null==Q?void 0:Q.canUpdate)||(null==Q?void 0:Q.canDelete)?es:void 0,setEditMode:!0===Q||(null==Q?void 0:Q.canUpdate)||(null==Q?void 0:Q.canDelete)?en:void 0,links:q,children:B.some(e=>e.parentId===(null==J?void 0:J.id))?(0,n.jsx)(A.A,{icon:"bi-link-45deg",title:M("links"),description:(null==J||null==(e=J._count)?void 0:e.links)===1?M("showing_count_result",{count:null==J||null==(l=J._count)?void 0:l.links}):M("showing_count_results",{count:null==J||null==(s=J._count)?void 0:s.links}),className:"scale-90 w-fit"}):(0,n.jsx)("p",{children:(null==J||null==(a=J._count)?void 0:a.links)===1?M("showing_count_result",{count:null==J||null==(I=J._count)?void 0:I.links}):M("showing_count_results",{count:null==J||null==(E=J._count)?void 0:E.links})})}),(0,n.jsx)(w.A,{editMode:es,links:q,layout:ei,useData:O}),!O.isLoading&&q&&!q[0]&&(0,n.jsx)(u.A,{}),J&&(0,n.jsxs)(n.Fragment,{children:[$&&(0,n.jsx)(h.A,{onClose:()=>G(!1),activeCollection:J}),Y&&(0,n.jsx)(x.A,{onClose:()=>Z(!1),activeCollection:J}),H&&(0,n.jsx)(_.A,{onClose:()=>K(!1),parent:J}),ee&&(0,n.jsx)(v.A,{onClose:()=>el(!1),activeCollection:J})]})]})};I.getLayout=function(e){return(0,n.jsx)(a.A,{children:e})};var E=!0;let D=I}},e=>{e.O(0,[1201,7474,8986,2203,3458,7129,7113,87,4907,7487,3319,4759,5553,5051,1912,8652,3888,142,3444,874,595,1425,4396,636,6593,8792],()=>e(e.s=78943)),_N_E=e.O()}]);
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.