1import{d as i,j as e,R as k}from"./index-CL5CXY0i.js";import{r as d}from"./react-CryvJVFI.js";import{C as B,g as V}from"./index-C09Y5_TV.js";import{u as E}from"./useMediaManagement-Btc-fCnf.js";import{Q as N}from"./react-toastify.esm-BcQ5eTVB.js";import"./index-DNaSW-Dx.js";import{F as H}from"./index-C3vpPgak.js";import{S as q}from"./index-BsncVKLf.js";import{R as J}from"./index-D_otmq_U.js";import"./index-DyUk60wA.js";import"./react-content-loader.es-9HMRlSLY.js";import"./useFetchPacList-CGKTKoEm.js";import"./useVideoThumbnailsManagement-CtslanMO.js";import"./index-BijeTAIV.js";import"./react-paginate-RUzgbzG0.js";import"./index-Cnqjmcqm.js";import"./index-DBTgMqXe.js";import"./index-BvdDu3lj.js";import"./MagnifyingGlassIcon-CSsbjLNy.js";import"./index-hOClxwWK.js";import"./index-DngTBLDh.js";import"./lodashUtils-EZhUIFFV.js";import"./useAnnualReportHook-hS8Y5hfP.js";import"./useNewsAnnouncement-DQ3p5OSZ.js";import"./useMeetinghook-CmPAFIya.js";import"./useJobDetailsManagement-C_9AYzBf.js";import"./index-CJ5qLs-6.js";import"./useAnnualReportHook-DLspTqsz.js";import"./index-B2cqaVCK.js";const Q=i.div` 2 width: 100%; 3 max-width: 100%; 4 background-color: #fff; 5 border-radius: 8px; 6`,G=i.div` 7 display: flex; 8 border-bottom: 1px solid #ddd; 9 gap: 20px; 10 width: fit-content; 11`,U=i.div` 12 padding: 10px 0px; 13 cursor: pointer; 14 ${s=>s.active&&` 15 border-bottom: 2px solid #1C399D; 16 color:#1C399D; 17 font-weight:bold; 18 display: flex; 19 align-items: center; 20 `} 21`,K=i.div` 22 display: flex; 23 flex-direction: column; 24 width: 100%; 25 max-width: 100%; 26 background-color: #fff; 27 border-radius: 8px; 28`,W=i.div` 29 display: flex; 30 flex-wrap: wrap; 31 gap: 20px; 32 margin-top: 20px; 33`,X=i.div` 34 width: 190px; 35 height: auto; 36 border: 1px solid #ddd; 37 display: flex; 38 flex-direction: column; 39 justify-content: space-between; 40 position: relative; 41 border-radius: 4px; 42 border: 1px; 43 background: #ffffff; 44 border: 1px solid #8f8f8f; 45 46 .media-details { 47 display: flex; 48 justify-content: space-between; 49 align-items: center; 50 width: 100%; 51 } 52`,_=i.div` 53 width: 290px; 54 height: auto; 55 border: 1px solid #ddd; 56 display: flex; 57 flex-direction: column; 58 justify-content: space-between; 59 position: relative; 60 border-radius: 4px; 61 border: 1px; 62 background: #ffffff; 63 border: 1px solid #8f8f8f; 64 65 ${s=>s.iframe&&` 66 width:375px; 67 height:250px; 68 `} 69 .media-details { 70 display: flex; 71 justify-content: space-between; 72 align-items: center; 73 width: 100%; 74 } 75`,Y=i.img` 76 max-width: 100%; 77 max-height: 100%; 78 background: #d9d9d9; 79 border-radius: 4px 4px 0px 0px; 80 border: 1px solid #8f8f8f; 81 object-fit: cover; 82`,Z=i.video` 83 max-width: 100%; 84 max-height: 100%; 85 background: #d9d9d9; 86 border-radius: 4px 4px 0px 0px; 87 border: 1px solid #8f8f8f; 88`,R=i.img` 89 width: 20px; 90 height: 20px; 91 margin-right: 8px; /* Adjust margin as needed */ 92`,L=i.button` 93 background: url("/AdminPanel/MemberDetails/trash.png") no-repeat center center; 94 background-size: contain; 95 width: 18px; 96 height: 18px; 97 border: none; 98 cursor: pointer; 99 padding: 0; /* Optional: Remove padding if not needed */ 100`,z=i.button` 101 background: url("/AdminPanel/MemberDetails/receive-square.png") no-repeat 102 center center; 103 background-size: contain; 104 width: 18px; 105 height: 18px; 106 border: none; 107 cursor: pointer; 108 padding: 0; /* Optional: Remove padding if not needed */ 109`,ee=i.button` 110 background: #1c399d; 111 color: #ffffff; 112 padding: 10px 18px; 113 border-radius: 8px; 114 cursor: pointer; 115 font-size: 16px; 116 text-align: center; 117 border: 1px dotted #aab0be; 118 box-shadow: 0px 0px 4px 0px #e5e7eb80; 119 margin-top: 10px; 120 align-self: flex-end; 121`,ie=i.h2` 122 font-family: Montserrat; 123 font-size: 14px; 124 font-weight: 500; 125 line-height: 17.07px; 126 text-align: left; 127 color: #000000; 128 margin: 20px 0px; 129`;i.div` 130 background-color: #ffffff; 131 border-radius: 16px; 132 padding: 16px; 133 margin-bottom: 20px; 134 width: 100%; 135 max-width: 100%; 136 box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); 137 display: flex; 138 justify-content: space-between; 139 align-items: center; 140 gap: 16px; 141`;i.div` 142 display: flex; 143 justify-content: space-between; 144 align-items: center; 145 width: 100%; 146`;i.span` 147 color: #344054; 148 font-family: Plus Jakarta Sans; 149 font-size: 14px; 150 font-weight: 500; 151 line-height: 10px; 152 text-align: left; 153 margin-bottom: 10px; 154`;i.span` 155 color: #324a51; 156 display: flex; 157 font-family: Montserrat; 158 font-size: 16px; 159 font-weight: 400; 160 line-height: 24px; 161 text-align: left; 162`;const O=i.span` 163 color: #324a51; 164 font-family: Montserrat; 165 font-size: 14px; 166 font-weight: 400; 167 line-height: 20px; 168 text-align: left; 169`,S=i.div` 170 display: flex; 171 gap: 5px; 172`,te=i.div` 173 position: fixed; 174 top: 0; 175 left: 0; 176 right: 0; 177 bottom: 0; 178 height:100vh; 179 background-color: rgba(0, 0, 0, 0.5); /* semi-transparent black overlay */ 180 z-index: 2000; /* ensure it's above everything else */ 181 display: flex; 182 justify-content: center; 183 align-items: center; 184`,oe=i.div``;i.div` 185 186`;const ne=i.div` 187 position: fixed; 188 top: 0; 189 left: 0; 190 width: 100vw; 191 height: 100vh; 192 background: rgba(0, 0, 0, 0.6); 193 display: flex; 194 justify-content: center; 195 align-items: center; 196 z-index: 1000; 197`,re=i.div` 198 background: #ffffff; 199 border-radius: 16px; 200 width: 560px; 201 padding: 20px; 202 box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); 203 display: flex; 204 flex-direction: column; 205 align-items: center; 206`,ae=i.select` 207 width: 100%; 208 padding: 10px; 209 margin: 10px 0; 210 border: 1px solid #ccc; 211 border-radius: 8px; 212 font-size: 16px; 213 background: #f9f9f9; 214 215 &:focus { 216 outline: none; 217 border-color: #1c399d; 218 } 219`,de=i.input` 220 width: 100%; 221 padding: 10px; 222 margin: 16px 0; 223 border: 1px solid #ccc; 224 border-radius: 4px; 225 font-size: 16px; 226 227 &:focus { 228 outline: none; 229 border-color: #1c399d; 230 } 231`,se=i.div` 232 display:flex; 233 flex-direction:row; 234 justify-content:space-between; 235 width:100%; 236 gap:20px; 237 margin:10px 0px; 238`,T=i.button` 239 padding: 10px 20px; 240 margin: 10px 5px; 241 background: #1c399d; 242 color: #ffffff; 243 border: none; 244 border-radius: 12px; 245 font-size: 16px; 246 cursor: pointer; 247 transition: background-color 0.3s ease; 248 width:100%; 249 &:hover { 250 background: #142d80; 251 } 252 253 &:disabled { 254 background: #ccc;
255 cursor: not-allowed; 256 } 257`,le=i.div` 258 display: flex; 259 flex-direction: column; 260 align-items: center; 261 padding: 20px; 262 border: 2px dashed #ccc; 263 border-radius: 4px; 264 margin-bottom: 10px; 265 width:100%; 266 267 img { 268 max-height: 225px; 269 object-fit:cover; 270 margin-bottom: 10px; 271 } 272`,ce=i.input` 273 opacity: 0, 274 position: absolute, 275 z-index: -1, 276`,pe=i.p` 277 font-family: Montserrat; 278 font-size: 14px; 279 font-weight: 400; 280 line-height: 24px; 281 text-align: center; 282 ${s=>s.Link&&` 283 &:hover{ 284 overflow: hidden; 285 text-overflow: ellipsis; 286 white-space: nowrap; 287 color: #1679AB; 288 text-decoration: underline; 289 } 290`} 291`,xe=({isOpen:s,onClose:b,onSubmit:M})=>{const[o,u]=d.useState("image"),[r,p]=d.useState(null),[h,x]=d.useState(null),[f,C]=d.useState(""),[v,c]=d.useState(!1),I=n=>{const l=n.target.files[0];p(l),l&&(o==="image"||o==="video")&&x(URL.createObjectURL(l))},j=n=>{C(n.target.value)},D=()=>{if(o==="url"&&!f)return alert("Please provide a URL");if((o==="image"||o==="video")&&!r)return alert("Please select a file");M({fileType:o,file:r,videoUrl:f}),b(),x(null)},P=n=>{n.preventDefault(),n.stopPropagation(),c(!0)},m=n=>{n.preventDefault(),n.stopPropagation(),c(!1)},y=n=>{n.preventDefault(),n.stopPropagation(),c(!1);const l=n.dataTransfer.files;if(l.length>0){const g=l[0];p(g),g&&(o==="image"||o==="video")&&x(URL.createObjectURL(g))}};return s&&e.jsx(ne,{children:e.jsxs(re,{children:[e.jsx("h3",{children:"Add Media"}),e.jsxs(ae,{value:o,onChange:n=>{u(n.target.value),p(null),x(null)},children:[e.jsx("option",{value:"image",children:"Image"}),e.jsx("option",{value:"video",children:"Video"}),e.jsx("option",{value:"url",children:"URL"})]}),o==="image"||o==="video"?e.jsxs(le,{onDrop:y,onDragOver:P,onDragLeave:m,style:{border:v?"2px dashed #000":"2px dashed #ccc",backgroundColor:v?"#f0f0f0":"transparent"},onClick:()=>document.getElementById("fileInput").click(),children:[h?o==="image"?e.jsx("img",{src:h,alt:"Preview",style:{width:"100%",height:"auto"},onClick:()=>document.getElementById("fileInput").click()}):e.jsx("video",{src:h,controls:!0,style:{width:"100%",height:"auto"},onClick:()=>document.getElementById("fileInput").click()}):e.jsxs(e.Fragment,{children:[e.jsx("img",{src:"/AdminPanel/Memoriam/image.png",alt:"Upload Thumbnail",onClick:()=>document.getElementById("fileInput").click(),style:{cursor:"pointer"}}),e.jsx(pe,{children:"Select the file to upload."})]}),e.jsx(ce,{id:"fileInput",type:"file",accept:o==="image"?"image/*":"video/*",onChange:I,style:{opacity:0,position:"absolute",zIndex:-1}})]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{type:"text",placeholder:"Enter video URL",value:f,onChange:j}),e.jsx("p",{style:{color:"red",marginTop:"8px"},children:"Only add streaming platforms URLS to work properly."})]}),e.jsxs(se,{children:[e.jsx(T,{onClick:D,children:"Add"}),e.jsx(T,{onClick:b,children:"Cancel"})]})]})})},Ee=({activeTab:s,onNext:b,onDiscard:M})=>{var y,n,l,g;const[o,u]=d.useState("images"),{media:r,addMedia:p,deleteMedia:h,loading:x}=E();d.useRef(null);const[f,C]=d.useState(0),[v,c]=d.useState(!1),[I,j]=d.useState(!1),D=t=>{const{fileType:a,file:w,videoUrl:$}=t;if(a==="image"||a==="video"){const A={file:w,file_type:a};c(!0),p(A,P).then(()=>c(!1)).catch(()=>c(!1))}else a==="url"&&p({video_url:$,file_type:"url"}).then(()=>console.log("URL added successfully")).catch(F=>console.error("Error adding URL:",F))},P=t=>{const a=Math.round(t.loaded*100/t.total);C(a)},m=t=>{h(t)};return x?e.jsx(H,{}):(console.log("media.videos data of members:",r.videos),e.jsxs(Q,{children:[v&&e.jsx(te,{children:e.jsx(oe,{children:e.jsx("div",{style:{width:150,height:150},children:e.jsx(B,{value:f,text:`${f}%`,styles:V({pathTransitionDuration:.15,pathColor:"#1C399D",textColor:"#1C399D"})})})})}),e.jsx(K,{children:e.jsx(ee,{onClick:()=>j(!0),children:"Add Media"})}),e.jsx(ie,{children:"Manage Media"}),e.jsxs(G,{children:[e.jsxs(U,{active:o==="images",onClick:()=>u("images"),children:[e.jsx(R,{src:"/AdminPanel/MemberDetails/gallery.png",alt:"Images Icon"})," ","Images"]}),e.jsxs(U,{active:o==="videos",onClick:()=>u("videos"),children:[e.jsx(R,{src:"/AdminPanel/MemberDetails/video.png",alt:"
291Videos Icon"})," ","Videos"]}),e.jsxs(U,{active:o==="links",onClick:()=>u("links"),children:[e.jsx(R,{src:"/AdminPanel/MemberDetails/video.png",alt:"Videos Icon"})," ","Links"]})]}),e.jsxs(W,{children:[o==="images"&&r.images.length>0&&r.images.map((t,a)=>{var w;return e.jsxs(X,{children:[e.jsx(Y,{src:`${k}/media_images/${t.file_name}`,alt:"Media"}),e.jsxs("div",{className:"media-details",children:[e.jsx(O,{children:(w=t==null?void 0:t.file_name)==null?void 0:w.slice(0,9)}),e.jsxs(S,{children:[e.jsx(L,{onClick:()=>m(t.id)}),e.jsx(z,{as:"a",href:`${k}/download-file?file=${t.file_name}`,target:"_blank"})]})]})]},a)}),o==="videos"&&((n=(y=r==null?void 0:r.videos)==null?void 0:y.files)==null?void 0:n.length)>0&&r.videos.files.map((t,a)=>e.jsxs(_,{children:[e.jsx(Z,{src:`${k}/media_videos/${t.file_name}`,controls:!0}),e.jsxs("div",{className:"media-details",children:[e.jsx(O,{children:t==null?void 0:t.file_name.slice(0,10)}),e.jsxs(S,{children:[e.jsx(L,{onClick:()=>m(t.id)}),e.jsx(z,{as:"a",href:`${k}/download-file?file=${t.file_name}`,target:"_blank"})]})]})]},a)),o==="links"&&((l=r==null?void 0:r.videos.urls)==null?void 0:l.length)>0&&((g=r==null?void 0:r.videos)==null?void 0:g.urls.map((t,a)=>e.jsxs(_,{iframe:!0,children:[e.jsx(J,{url:t.video_url,playing:!0,loop:!0,controls:!0,width:"100%",height:"100%",config:{vimeo:{playerOptions:{autoplay:!0,loop:!0,controls:!0}},youtube:{playerVars:{autoplay:1,loop:1,controls:1,modestbranding:1}},dailymotion:{params:{autoplay:1,loop:1,controls:1}}}}),e.jsxs("div",{className:"media-details",children:[e.jsx(O,{children:t==null?void 0:t.video_url.slice(0,30)}),e.jsx(S,{children:e.jsx(L,{onClick:()=>m(t.id)})})]})]},a)))]}),e.jsx(N,{}),e.jsx(q,{activeTab:s,onDiscard:M,onNext:b}),e.jsx(xe,{isOpen:I,onClose:()=>j(!1),onSubmit:D})]}))};export{Ee as default};
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.