https://www.501site.com/_next/static/chunks/pages/private-areas/files/[folderId]-6374faa9c1e83fdf.js
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7302],{31425:function(e,r,t){"use strict";t.d(r,{Z:function(){return Z}});var n=t(63366),i=t(87462),a=t(67294),s=t(86010),l=t(94780),o=t(90948),d=t(71657),c=t(1588),u=t(34867);function f(e){return(0,u.ZP)("MuiDialogActions",e)}(0,c.Z)("MuiDialogActions",["root","spacing"]);var m=t(85893);let p=["className","disableSpacing"],x=e=>{let{classes:r,disableSpacing:t}=e;return(0,l.Z)({root:["root",!t&&"spacing"]},f,r)},h=(0,o.ZP)("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,r)=>{let{ownerState:t}=e;return[r.root,!t.disableSpacing&&r.spacing]}})(({ownerState:e})=>(0,i.Z)({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!e.disableSpacing&&{"& > :not(:first-of-type)":{marginLeft:8}})),g=a.forwardRef(function(e,r){let t=(0,d.Z)({props:e,name:"MuiDialogActions"}),{className:a,disableSpacing:l=!1}=t,o=(0,n.Z)(t,p),c=(0,i.Z)({},t,{disableSpacing:l}),u=x(c);return(0,m.jsx)(h,(0,i.Z)({className:(0,s.Z)(u.root,a),ownerState:c,ref:r},o))});var Z=g},58951:function(e,r,t){"use strict";t.d(r,{Z:function(){return v}});var n=t(63366),i=t(87462),a=t(67294),s=t(86010),l=t(94780),o=t(90948),d=t(71657),c=t(15861),u=t(1588),f=t(34867);function m(e){return(0,f.ZP)("MuiDialogContentText",e)}(0,u.Z)("MuiDialogContentText",["root"]);var p=t(85893);let x=["children","className"],h=e=>{let{classes:r}=e,t=(0,l.Z)({root:["root"]},m,r);return(0,i.Z)({},r,t)},g=(0,o.ZP)(c.Z,{shouldForwardProp:e=>(0,o.FO)(e)||"classes"===e,name:"MuiDialogContentText",slot:"Root",overridesResolver:(e,r)=>r.root})({}),Z=a.forwardRef(function(e,r){let t=(0,d.Z)({props:e,name:"MuiDialogContentText"}),{className:a}=t,l=(0,n.Z)(t,x),o=h(l);return(0,p.jsx)(g,(0,i.Z)({component:"p",variant:"body1",color:"text.secondary",ref:r,ownerState:l,className:(0,s.Z)(o.root,a)},t,{classes:o}))});var v=Z},86149:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/private-areas/files/[folderId]",function(){return t(25003)}])},25003:function(e,r,t){"use strict";t.r(r);var n=t(85893),i=t(67294),a=t(11163),s=t(41664),l=t.n(s),o=t(87357),d=t(66242),c=t(86886),u=t(90948),f=t(93946),m=t(15861),p=t(94054),x=t(45008),h=t(83321),g=t(22715),Z=t(84808),v=t(98456),j=t(64666),y=t(6514),b=t(37645),w=t(56815),C=t(79878),S=t(16310),N=t(47533),P=t(87536),I=t(86501),z=t(9473);t(95600),t(10410),t(43509);var _=t(95264);t(41674),t(74808);var k=t(18921),M=t(37345),F=t(82381);(0,u.ZP)(l())(e=>{let{theme:r}=e;return{fontWeight:600,fontSize:"1rem",cursor:"pointer",textDecoration:"none",color:r.palette.text.secondary,"&:hover":{color:r.palette.primary.main}}});let R=(0,u.ZP)(o.Z)(e=>{let{theme:r}=e;return{display:"flex",alignItems:"center",padding:r.spacing(3,4),justifyContent:"space-between",backgroundColor:r.palette.background.default}}),D=e=>{let{id:r}=e,t=(0,z.I0)(),[a,s]=(0,i.useState)(!1),[l,d]=(0,i.useState)(null),[c,u]=(0,i.useState)(!1),[m,x]=(0,i.useState)(!1),[Z,M]=(0,i.useState)(!1),R=()=>{d(null)},D=async()=>{try{let e=await t((0,_._I)(r)).unwrap();200==e.status&&I.ZP.success(e.msg)}catch(e){I.ZP.error(e.msg)}R()},E=async e=>{try{s(!0);let r=await t((0,_.Sv)(e)).unwrap();if(s(!1),r){let e=window.URL.createObjectURL(new Blob([r.data])),t=document.createElement("a");t.href=e;let n=r.headers["content-disposition"],i="default_filename";if(n){let e=n.match(/filename\*?=['"]?(?:UTF-\d['"]*)?([^;\r\n"']*)['"]?;?/i);i=e?e[1]:n.match(/filename=['"]?([^;\r\n"']*)['"]?;?/i)[1]}t.setAttribute("download",i.trim()),document.body.appendChild(t),t.click(),document.body.removeChild(t)}else I.ZP.error("Error downloading file")}catch(e){console.error("Fetch error:",e)}},T=async e=>{x(!0)},W=async()=>{x(!1)},A=S.Ry().shape({email:S.Z_().required()}),{reset:O,control:V,setValue:U,setError:L,handleSubmit:q,watch:B,formState:{errors:X}}=(0,P.cI)({defaultValues:{email:""},mode:"onChange",resolver:(0,N.X)(A)}),H=async e=>{s(!0),e.id=r;try{await t((0,_.u5)(e)).unwrap(),s(!1),I.ZP.success("File shared successfully"),x(!1)}catch(e){s(!1),422==e.status?L("email",{message:e.msg}):L(null,{message:e.msg})}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(f.Z,{sx:{"& svg":{mr:0}},onClick:()=>M(!0),children:(0,n.jsx)(C.Z,{icon:"mdi:users",fontSize:20})}),(0,n.jsxs)(f.Z,{sx:{"& svg":{mr:0}},onClick:()=>E(r),disabled:a,children:[(0,n.jsx)(C.Z,{icon:"mdi:download",fontSize:20}),a&&(0,n.jsx)(v.Z,{size:24,sx:{color:"#333",position:"absolute",top:"50%",left:"50%",marginTop:"-12px",marginLeft:"-12px"}})]}),(0,n.jsx)(f.Z,{sx:{"& svg":{mr:0}},onClick:()=>T(r),children:(0,n.jsx)(C.Z,{icon:"ri:share-fill",fontSize:20})}),(0,n.jsx)(f.Z,{sx:{"& svg":{mr:0}},onClick:()=>u(!0),children:(0,n.jsx)(C.Z,{icon:"mdi:delete-outline",fontSize:20})}),(0,n.jsx)(k.Z,{title:"Delete Record?",open:c,setOpen:u,onConfirm:D,children:"Are you sure you want to delete this record?"}),(0,n.jsxs)(j.Z,{onClose:W,open:m,fullWidth:!0,children:[(0,n.jsx)(b.Z,{children:"Share File"}),(0,n.jsx)(y.Z,{children:(0,n.jsxs)("form",{onSubmit:q(H),children:[(0,n.jsxs)(p.Z,{fullWidth:!0,sx:{mb:6,mt:3},children:[(0,n.jsx)(P.Qr,{name:"email",control:V,rules:{required:!0},render:e=>{let{field:{value:r,onChange:t}}=e;return(0,n.jsx)(g.Z,{value:r,label:"Email",onChange:t,placeholder:"",error:Boolean(X.email)})}}),X.email&&(0,n.jsx)(w.Z,{sx:{color:"error.main"},children:X.email.message})]}
1),(0,n.jsxs)(o.Z,{align:"right",sx:{display:"inline-block",width:"100%"},children:[(0,n.jsx)(h.Z,{size:"large",variant:"outlined",color:"secondary",onClick:W,children:"Cancel"}),(0,n.jsxs)(o.Z,{sx:{m:1,position:"relative",display:"inline"},children:[(0,n.jsx)(h.Z,{size:"large",type:"submit",variant:"contained",sx:{mr:0},disabled:a,children:"Send"}),a&&(0,n.jsx)(v.Z,{size:24,sx:{color:"#333",position:"absolute",top:"50%",left:"50%",marginTop:"-12px",marginLeft:"-12px"}})]})]})]})})]}),Z&&(0,n.jsxs)(j.Z,{onClose:()=>M(!1),open:Z,fullWidth:!0,children:[(0,n.jsx)(b.Z,{children:"Shared Members"}),(0,n.jsx)(y.Z,{children:(0,n.jsx)(F.Z,{sharedItem:r,sharedItemType:"PrivateAreaFile"})})]})]})},E=[{flex:.2,minWidth:230,field:"originalFileName",headerName:"File Name",renderCell:e=>{let{row:r}=e,{originalFileName:t,_id:i}=r;return(0,n.jsx)(o.Z,{sx:{display:"flex",alignItems:"center"},children:(0,n.jsx)(o.Z,{sx:{display:"flex",alignItems:"flex-start",flexDirection:"column"},children:(0,n.jsx)(m.Z,{children:t})})})}},{flex:.2,minWidth:250,field:"files",headerName:"File Type",renderCell:e=>{let{row:r}=e,{fileType:t,_id:i}=r;return(0,n.jsx)(m.Z,{noWrap:!0,variant:"body2",children:t})}},{flex:.2,minWidth:250,field:"size",headerName:"Size",renderCell:e=>{let{row:r}=e,{fileSize:t,_id:i}=r;return(0,n.jsx)(m.Z,{noWrap:!0,variant:"body2",children:(0,M.sS)(t)})}},{flex:.1,minWidth:200,sortable:!1,field:"actions",headerName:"",renderCell:e=>{let{row:r}=e;return(0,n.jsx)(D,{id:r._id})}}],T=()=>{var e,r;let t=(0,a.useRouter)(),s=t.query.folderId,[u,f]=(0,i.useState)(""),[p,j]=(0,i.useState)({page:0,pageSize:10}),[y,b]=(0,i.useState)(0),[w,S]=(0,i.useState)(y),N=(0,z.I0)(),P=(0,z.v9)(e=>e.privateArea);(0,i.useEffect)(()=>{N((0,_.uB)({id:s,q:u,page:p.page+1,pageSize:p.pageSize}))},[N,u,p,s]),(0,i.useEffect)(()=>{S(e=>void 0!==P.files.total?P.files.total:e)},[y,S,N,P.files.total]);let I=(0,i.useCallback)(e=>{f(e)},[]);return(0,i.useCallback)(e=>{setFolderType(e.target.value)},[]),(0,n.jsxs)(c.ZP,{container:!0,spacing:6,children:[(0,n.jsx)(Z.Z,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:P.loading,children:(0,n.jsx)(v.Z,{color:"inherit"})}),(0,n.jsxs)(c.ZP,{item:!0,xs:12,children:[(0,n.jsxs)(R,{children:[(0,n.jsxs)(m.Z,{variant:"h6",children:["Folder: ",null==P?void 0:null===(e=P.files)||void 0===e?void 0:null===(r=e.folder)||void 0===r?void 0:r.folderName]}),(0,n.jsxs)(o.Z,{children:[(0,n.jsx)(h.Z,{sx:{mr:2},variant:"contained",component:l(),href:"/private-areas/edit/"+s,startIcon:(0,n.jsx)(C.Z,{icon:"mdi:plus"}),children:"Add File"}),(0,n.jsx)(h.Z,{variant:"contained",color:"secondary",startIcon:(0,n.jsx)(C.Z,{icon:"mdi:arrow-left"}),component:l(),href:"/private-areas/folders",children:"Back"})]})]}),(0,n.jsxs)(d.Z,{children:[(0,n.jsx)(o.Z,{sx:{p:5,pb:3,display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"},children:(0,n.jsx)(o.Z,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center"},children:(0,n.jsx)(g.Z,{size:"small",value:u,sx:{mr:6,mb:2},placeholder:"Search",onChange:e=>I(e.target.value)})})}),(0,n.jsx)(x._$,{disableColumnMenu:!0,autoHeight:!0,rows:P.files.data?P.files.data:[],columns:E,disableRowSelectionOnClick:!0,pageSizeOptions:[10,25,50],paginationModel:p,onPaginationModelChange:j,sx:{"& .MuiDataGrid-columnHeaders":{borderRadius:0}},getRowId:e=>e._id,paginationMode:"server",rowCount:P.files.total,editMode:"row"})]})]})]})};T.acl={action:"all",subject:"website"},r.default=T},47533:function(e,r,t){"use strict";t.d(r,{X:function(){return l}});var n=t(87536),i=function(e,r,t){if(e&&"reportValidity"in e){var i=(0,n.U2)(t,r);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},a=function(e,r){var t=function(t){var n=r.fields[t];n&&n.ref&&"reportValidity"in n.ref?i(n.ref,t,e):n.refs&&n.refs.forEach(function(r){return i(r,t,e)})};for(var n in r.fields)t(n)},s=function(e,r){r.shouldUseNativeValidation&&a(e,r);var t={};for(var i in e){var s=(0,n.U2)(r.fields,i);(0,n.t8)(t,i,Object.assign(e[i],{ref:s&&s.ref}))}return t},l=function(e,r,t){return void 0===r&&(r={}),void 0===t&&(t={}),function(i,l,o){try{return Promise.resolve(function(n,s){try{var d=(r.context,Promise.resolve(e["sync"===t.mode?"validateSync":"validate"](i,Object.assign({abortE
1arly:!1},r,{context:l}))).then(function(e){return o.shouldUseNativeValidation&&a({},o),{values:t.rawValues?i:e,errors:{}}}))}catch(e){return s(e)}return d&&d.then?d.then(void 0,s):d}(0,function(e){var r;if(!e.inner)throw e;return{values:{},errors:s((r=!o.shouldUseNativeValidation&&"all"===o.criteriaMode,(e.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),r){var i=e[t.path].types,a=i&&i[t.type];e[t.path]=(0,n.KN)(t.path,r,e,t.type,a?[].concat(a,t.message):t.message)}return e},{})),o)}}))}catch(e){return Promise.reject(e)}}}}},function(e){e.O(0,[6886,502,9717,7536,4030,5306,395,5008,2381,9774,2888,179],function(){return e(e.s=86149)}),_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.