1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5740],{18058:(e,s,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/me/author/assets",function(){return a(27799)}])},27799:(e,s,a)=>{"use strict";a.r(s),a.d(s,{__N_SSP:()=>A,default:()=>z});var t=a(37876),l=a(14232),r=a(31753),i=a(89099),d=a(62867),n=a(522),o=a(76965),c=a(70948),m=a(48427),x=a(76158),u=a(21355),h=a(93536),p=a(15039),f=a.n(p),b=a(15050),g=a(81935),j=a(55100),y=a(56925),N=a(75692);a(73538);var w=a(64041),v=a(16075),A=!0;let z=({session:e,initialStorage:s})=>{let{t:a}=(0,r.Bd)(["page-my-profile","common","breadCrumbs"]),p=(0,i.useRouter)(),A=(0,l.useMemo)(()=>p.locale||"en",[p.locale]),[z,k]=(0,l.useState)(s.files||[]),V=s.used/s.total*100,C=(0,l.useMemo)(()=>{let e=z.filter(e=>"cursor"===e.category||e.name?.endsWith(".cur")||e.name?.endsWith(".ani")).length,s=z.filter(e=>"image"===e.category||e.type?.startsWith("image/")).length,a=z.reduce((e,s)=>e+(s.size||0),0);return{cursorFiles:e,imageFiles:s,totalFiles:z.length,totalSize:a}},[z]),F=e=>{let s=Array.from(e.target.files);k(e=>[...e,...s.map(e=>({name:e.name,size:e.size,type:e.type}))])};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.bV,{title:a("my-profile.author.assets.seo.title",{defaultValue:"Assets Library - Author Dashboard"}),description:a("my-profile.author.assets.seo.description",{defaultValue:"Manage your uploaded assets"}),openGraph:(0,N.A)(a("my-profile.author.assets.seo.open-graph.title",{defaultValue:"Assets Library - Author Dashboard"}),a("my-profile.author.assets.seo.open-graph.description",{defaultValue:"Manage your uploaded assets"})),additionalLinkTags:y.v}),(0,t.jsx)(b.C,{children:(0,t.jsxs)("h1",{className:"flex items-center gap-3.5 text-white font-bold",children:[(0,t.jsx)(n.A,{size:28}),a("my-profile.author.assets.title",{defaultValue:"Assets Library"})]})}),(0,t.jsx)(j.d8,{children:(0,t.jsx)(j.TK,{user:e.user,isAuthor:!0,children:(0,t.jsxs)("div",{className:"space-y-6",children:[z.length>0&&(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,t.jsx)(g.Zp,{className:"border-2 border-blue-200 hover:shadow-lg transition-all",children:(0,t.jsx)(g.Wu,{className:"p-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs text-gray-medium mb-1",children:"Total Files"}),(0,t.jsx)("p",{className:"text-2xl font-bold text-blue-base",children:C.totalFiles})]}),(0,t.jsx)(o.A,{size:24,className:"text-blue-base"})]})})}),(0,t.jsx)(g.Zp,{className:"border-2 border-purple-200 hover:shadow-lg transition-all",children:(0,t.jsx)(g.Wu,{className:"p-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs text-gray-medium mb-1",children:"Cursor Files"}),(0,t.jsx)("p",{className:"text-2xl font-bold text-purple-base",children:C.cursorFiles})]}),(0,t.jsx)(o.A,{size:24,className:"text-purple-base"})]})})}),(0,t.jsx)(g.Zp,{className:"border-2 border-pink-200 hover:shadow-lg transition-all",children:(0,t.jsx)(g.Wu,{className:"p-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs text-gray-medium mb-1",children:"Images"}),(0,t.jsx)("p",{className:"text-2xl font-bold text-pink-600",children:C.imageFiles})]}),(0,t.jsx)(c.A,{size:24,className:"text-pink-600"})]})})})]}),(0,t.jsxs)(g.Zp,{className:"border-2 border-gray-light",children:[(0,t.jsx)(g.aR,{className:"pb-4",children:(0,t.jsxs)(g.ZB,{className:"text-xl font-semibold flex items-center gap-2",children:[(0,t.jsx)(m.A,{size:22,className:"text-blue-base"}),a("my-profile.author.assets.storage-usage",{defaultValue:"Storage Usage"})]})}),(0,t.jsx)(g.cG,{}),(0,t.jsx)(g.Wu,{className:"p-6",children:(0,t.jsx)("div",{className:"space-y-6",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex justify-between text-sm mb-3",children:[(0,t.jsxs)("span",{className:"font-medium text-gray-darken",children:[a("my-profile.author.assets.used",{defaultValue:"Used"}),": ",(0,t.jsxs)("span",{className:"text-black-base font-bold",children:[s.used," MB"]})]}),(0,t.jsxs)("span",{className:"font-medium text-gray-darken",children:[a("my-profile.author.assets.total",{defaultValue:"Total"}),": ",(0,t.jsxs)("span",{className:"text-black-base font-bold",children:[s.total," MB"]})]})]}),(0,t.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-4 overflow-hidden shadow-inner",children:(0,t.jsx)("div",{className:f()("h-4 rounded-full transition-all duration-500 shadow-sm",V>80&&"bg-gradient-to-r from-red-500 to-red-600",V>60&&V<=80&&"bg-gradient-to-r from-yellow-500 to-yellow-600",V<=60&&"bg-gradient-to-r from-blue-base to-blue-600"),style:{width:`${Math.max(V,2)}%`}})}),(0,t.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[(0,t.jsxs)("span",{className:"text-xs text-gray-medium",children:[V.toFixed(1),"% ",a("my-profile.author.assets.used",{defaultValue:"Used"})]}),(0,t.jsxs)("span",{className:"text-xs text-gray-medium",children:[s.total-s.used," MB ",a("my-profile.author.assets.total",{defaultValue:"Total"}).toLowerCase()," remaining"]})]})]}),(0,t.jsx)("div",{className:f()("ml-6 p-4 rounded-xl shadow-sm",V>80&&"bg-gradient-to-br from-red-50 to-red-100",V>60&&V<=80&&"bg-gradient-to-br from-yellow-50 to-yellow-100",V<=60&&"bg-gradient-to-br from-blue-50 to-blue-100"),children:(0,t.jsx)(m.A,{size:32,className:f()(V>80&&"text-red-600",V>60&&V<=80&&"text-yellow-600",V<=60&&"text-blue-base")})})]})})})]}),(0,t.jsxs)(g.Zp,{className:"border-2 border-gray-light",children:[(0,t.jsx)(g.aR,{className:"pb-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)(g.ZB,{className:"text-xl font-semibold flex items-center gap-2",children:[(0,t.jsx)(n.A,{size:22,className:"text-blue-base"}),a("my-profile.author.assets.files",{defaultValue:"Uploaded Files"})]}),(0,t.jsxs)("label",{children:[(0,t.jsx)(g.$n,{variant:g.Ck.PRIMARY,size:g.GO.LG,leftIcon:(0,t.jsx)(x.A,{size:18}),as:"span",className:"cursor-pointer",children:a("my-profile.author.assets.upload",{defaultValue:"Upload"})}),(0,t.jsx)("input",{type:"file",multiple:!0,className:"hidden",onChange:F,accept:".cur,.ani,image/*"})]})]})}),(0,t.jsx)(g.cG,{}),(0,t.jsx)(g.Wu,{className:"p-6",children:z.length>0?(0,t.jsx)("div",{className:"space-y-3",children:z.map((e,s)=>{let l=e.type?.startsWith("image/")||"image"===e.category,r=e.name?.endsWith(".cur")||e.name?.endsWith(".ani")||"cursor"===e.category,i=(e.size/1048576).toFixed(2),d=(e.size/1024).toFixed(2),n=e.size>1048576?`${i} MB`:`${d} KB`,x=e.uploadedAt?new Date(e.uploadedAt).toLocaleDateString(A,{year:"numeric",month:"short",day:"numeric"}):null;return(0,t.jsxs)("div",{className:f()("flex items-center justify-between p-5 rounded-xl border-2 border-gray-light","hover:border-blue-base hover:shadow-lg transition-all duration-200","bg-gradient-to-r from-white-base to-gray-lighter group"),children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 flex-1 min-w-0",children:[(0,t.jsx)("div",{className:f()("flex-shrink-0 w-14 h-14 roun
1ded-xl flex items-center justify-center shadow-sm",l&&"bg-gradient-to-br from-purple-50 to-purple-100 text-purple-600 border-2 border-purple-200",r&&"bg-gradient-to-br from-blue-50 to-blue-100 text-blue-base border-2 border-blue-200",!l&&!r&&"bg-gradient-to-br from-gray-100 to-gray-200 text-gray-600 border-2 border-gray-200"),children:l?(0,t.jsx)(c.A,{size:28}):r?(0,t.jsx)(o.A,{size:28}):(0,t.jsx)(u.A,{size:28})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsx)("p",{className:"font-bold text-lg text-black-base truncate group-hover:text-blue-base transition-colors",children:e.name}),r&&(0,t.jsx)(g.Ex,{variant:g.Pw.INFO,size:"sm",children:"Cursor"}),l&&(0,t.jsx)(g.Ex,{variant:g.Pw.SECONDARY,size:"sm",children:"Image"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 flex-wrap",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 text-sm text-gray-darken",children:[(0,t.jsx)(m.A,{size:14}),(0,t.jsx)("span",{className:"font-medium",children:n})]}),e.type&&(0,t.jsx)("span",{className:"text-xs px-2.5 py-1 bg-gray-200 text-gray-700 rounded-full font-medium",children:e.type.split("/")[1]?.toUpperCase()||e.type.split("/")[0]?.toUpperCase()||"FILE"}),x&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-gray-medium",children:[(0,t.jsx)(w.A,{size:12}),(0,t.jsx)("span",{children:x})]})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 ml-4 flex-shrink-0",children:[(0,t.jsx)(g.$n,{variant:g.Ck.GHOST,size:g.GO.SM,leftIcon:(0,t.jsx)(v.A,{size:16}),className:"text-gray-darken hover:text-blue-base",title:a("my-profile.author.assets.download",{defaultValue:"Download"}),children:a("my-profile.author.assets.download",{defaultValue:"Download"})}),(0,t.jsx)(g.$n,{variant:g.Ck.DESTRUCTIVE,size:g.GO.SM,onClick:()=>{confirm(a("my-profile.author.assets.delete-confirm",{defaultValue:"Are you sure you want to delete this file?"}))&&k(e=>e.filter((e,a)=>a!==s))},leftIcon:(0,t.jsx)(h.A,{size:16}),children:a("my-profile.author.assets.delete",{defaultValue:"Delete"})})]})]},e.id||s)})}):(0,t.jsxs)("div",{className:"text-center py-16",children:[(0,t.jsx)("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-gradient-to-br from-blue-light to-purple-light mb-6",children:(0,t.jsx)(n.A,{size:40,className:"text-blue-base"})}),(0,t.jsx)("h3",{className:"text-xl font-semibold text-black-base mb-2",children:a("my-profile.author.assets.no-files",{defaultValue:"No files uploaded yet"})}),(0,t.jsx)("p",{className:"text-gray-darken mb-6 max-w-md mx-auto",children:"Upload cursor files (.cur, .ani) or images to use in your packs"}),(0,t.jsxs)("label",{children:[(0,t.jsx)(g.$n,{variant:g.Ck.PRIMARY,size:g.GO.LG,leftIcon:(0,t.jsx)(x.A,{size:18}),as:"span",className:"cursor-pointer",children:a("my-profile.author.assets.upload-first",{defaultValue:"Upload Your First File"})}),(0,t.jsx)("input",{type:"file",multiple:!0,className:"hidden",onChange:F,accept:".cur,.ani,image/*"})]})]})})]})]})})})]})}}},e=>{e.O(0,[2867,5192,1372,636,6593,8792],()=>e(e.s=18058)),_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.