1(this["webpackJsonpvuexy-react-admin-dashboard"]=this["webpackJsonpvuexy-react-admin-dashboard"]||[]).push([[35],{1191:function(e,t,n){"use strict";n.r(t);var a=n(64),i=n(1),c=n(8),s=n(0),o=n(20),l=(n(82),n(1113)),r=n(1181),d=n(1125),u=n(1119),j=n(68),b=n.n(j),p=n(88),m=n(55),h=n.n(m),O=(n(121),n(174),n(57)),x=n(62),f=n(284),v=n(1190),g=n(1128),k=n(1129),N=n(1130),y=n(1131),C=n(52),w=n(59),S=n.n(w),P=n(60),I=n.n(P),D=n(96),_=n(3),T=(I()(S.a),function(e){var t=e.toggle,n=e.isOpen,a=(e.constituents,Object(s.useState)("")),i=Object(c.a)(a,2),l=i[0],r=i[1],d=Object(s.useState)(!1),u=Object(c.a)(d,2),j=u[0];u[1],Object(p.g)(),Object(o.c)();return Object(_.jsxs)(v.a,{isOpen:n,toggle:t,children:[Object(_.jsx)(g.a,{toggle:t,children:"Dodaj detalje o studentu"}),Object(_.jsxs)(k.a,{children:[Object(_.jsx)(D.a,{title:"Upload dokumenata"}),Object(_.jsx)(N.a,{placeholder:"Pretra\u017ei po imenu ili Unisport id-u",theme:O.d,className:"react-select",classNamePrefix:"select",invalid:""===l&&j,value:l,onChange:function(e){r(e.target.value)}})]}),Object(_.jsx)(y.a,{children:Object(_.jsxs)("div",{className:"row justify-content-center text-center",style:{width:"100%"},children:[Object(_.jsx)("div",{className:"col",children:Object(_.jsx)(C.a.Ripple,{onClick:function(){e.toggle()},type:"submit",color:"danger",className:"btn-next",children:Object(_.jsx)("span",{className:"align-middle d-sm-inline-block d-none",children:"Odustani"})})}),Object(_.jsx)("div",{className:"col",children:Object(_.jsx)(C.a.Ripple,{onClick:function(){h.a.post("".concat("https://unisport-backend-prod.herokuapp.com","/"),{}).then((function(t){e.toggle()}))},type:"submit",color:"primary",className:"btn-next",children:Object(_.jsx)("span",{className:"align-middle d-sm-inline-block d-none",children:"Dodaj"})})})]})})]})}),B=n(406),F=n(73),z=n(66),M=n(72),R=n(141),E=n(98),U=n(63),A=n(366),K=n(175),J=(n(701),n(702),I()(S.a));t.default=function(){var e=Object(p.g)(),t=Object(s.useState)(!1),n=Object(c.a)(t,2),j=n[0],m=n[1],v=Object(s.useState)(!1),g=Object(c.a)(v,2),k=g[0],N=g[1],y=Object(s.useState)([]),C=Object(c.a)(y,2),w=C[0],S=C[1],P=Object(p.i)(),I=P.id,D=Object(s.useState)(null),L=Object(c.a)(D,2),Z=L[0],H=L[1],G=Object(s.useState)(null),W=Object(c.a)(G,2),Y=W[0],V=W[1],q=Object(s.useState)(!1),Q=Object(c.a)(q,2),X=Q[0],$=Q[1],ee=Object(s.useState)(null),te=Object(c.a)(ee,2),ne=te[0],ae=te[1],ie=Object(s.useState)(!1),ce=Object(c.a)(ie,2),se=ce[0],oe=ce[1],le=Object(s.useState)(!1),re=Object(c.a)(le,2),de=re[0],ue=re[1],je=Object(s.useState)(!1),be=Object(c.a)(je,2),pe=be[0],me=be[1];function he(){var e=null;h.a.get("".concat("https://unisport-backend-prod.herokuapp.com","/admin/get-one-competition?competitionId=").concat(P.competitionId)).then((function(t){ae(t.data.competition);var n=t.data.competition.sport.name,a=Object(U.e)(),i=t.data.competition.sex;"F"===i&&(i="\u017d"),h.a.get("".concat("https://unisport-backend-prod.herokuapp.com","/constituent/get-core-teams?sport=").concat(n,"&constituentId=").concat(a,"&sex=").concat(i)).then((function(t){t.data.coreteams.map((function(t){var n=t.sex;"F"===n&&(n="\u017d"),t._id===I&&(H(t),e=t)})),h.a.get("".concat("https://unisport-backend-prod.herokuapp.com","/admin/get-compet
1ition-teams?competitionId=").concat(P.competitionId)).then((function(t){console.log(e),null!==e&&t.data.teams.map((function(t){if(t.coreTeam===e._id){$(!0);var n=t.players.map((function(e){return e.roleCompetition=e.isTrainer?{value:"Tehni\u010dko osoblje",label:"Slu\u017ebena osoba"}:{value:"Sudionik natjecanja",label:"Natjecatelj"},t.disciplines&&t.disciplines.map&&t.disciplines.map((function(t){t.player===e._id&&(e.discipline=t.discipline)})),e}));t.trainers&&t.trainers.map((function(e){e.roleCompetition={value:"Tehni\u010dko osoblje",label:"Slu\u017ebena osoba"},n.push(e)})),S(n),V(t)}}))}))}))}))}Object(s.useEffect)((function(){he(),Object(F.fixLayoutToFullScreen)(),setTimeout((function(){Object(F.fixLayoutToFullScreen)()}),1e3)}),[]);Object(o.c)();var Oe=Object(s.useState)([{value:"Sudionik natjecanja",label:"Natjecatelj"},{value:"Tehni\u010dko osoblje",label:"Slu\u017ebena osoba"}]),xe=Object(c.a)(Oe,2),fe=xe[0],ve=(xe[1],Object(s.useState)(!1)),ge=Object(c.a)(ve,2),ke=(ge[0],ge[1],Object(s.useState)("")),Ne=Object(c.a)(ke,2),ye=(Ne[0],Ne[1],[{name:"Ime i prezime",selector:"name",cell:function(e){return Object(_.jsxs)("span",{onClick:function(){oe(e),ue(!0)},style:{cursor:"pointer",color:"blue"},children:[e.name," ",e.surname]})}},{name:"Rola",selector:"role",cell:function(e){return Object(_.jsx)("span",{style:{width:"60%"},children:Object(_.jsx)(x.a,{isDisabled:!0,placeholder:"Odaberi ulogu",theme:O.d,className:"react-select",id:"select-react"+e._id,classNamePrefix:"select",value:e.roleCompetition,styles:{control:function(e){return Object(i.a)(Object(i.a)({},e),{},{borderColor:e.borderColor,"&:hover":{borderColor:e["&:hover"].borderColor}})}},onChange:function(t){var n=Object(a.a)(w);n=n.map((function(n){return n&&e&&n._id===e._id&&(n.roleCompetition=t),n})),S(n)},name:"clear",options:fe,isClearable:!1})})}},{name:"Status prijave na natjecanje",cell:function(e){if(e.roleCompetition&&e.roleCompetition.label&&"Slu\u017ebena osoba"===e.roleCompetition.label)return null;var t="\u010ceka odobrenje",n="primary",a="";return e.competitionApproval&&e.competitionApproval.map((function(e){e.competitionId===ne._id&&(t=!1===e.isApproved?"Odbijen":"Odobren",a=e.comment)})),"Odbijen"===t?n="light-warning":"Odobren"===t&&(n="light-success"),Object(_.jsxs)("span",{children:[Object(_.jsx)(l.a,{className:"text-capitalize",color:n,pill:!0,children:Object(_.jsx)("span",{children:t})}),a&&""!=a&&Object(_.jsxs)("span",{children:[Object(_.jsx)(A.a,{id:"a"+e._id,size:14}),Object(_.jsx)(r.a,{placement:"top",target:"a"+e._id,children:a})]})]})}},{name:"",selector:"",sortable:!0,cell:function(e){return Object(_.jsx)(B.a,{onClick:function(){J.fire({title:"Jeste li sigurni",text:"Klikom na gumb Potvrdi igra\u010d \u0107e biti izbrisan",icon:"warning",showCancelButton:!0,confirmButtonText:"Potvrdi",cancelButtonText:"Odustani",customClass:{confirmButton:"btn btn-primary",cancelButton:"btn btn-outline-danger ml-1"},buttonsStyling:!1}).then((function(t){if(t.value)if(Y)h.a.post("".concat("https://unisport-backend-prod.herokuapp.com","/constituent/remove-player"),{teamId:Y._id,userId:e._id}).then((function(e){J.fire({icon:"success",title:"Uspje\u0161no",text:"Uspje\u0161no izbrisan igra\u010d",customClass:{confirmButton:"btn btn-success"}}),he()}));else{var n=w.filter((function(t){return t._id!==e._id}));S(Object(a.a)(n))}}))},size:"16",style:{cursor:"pointer"},className:"text-capitalize",pill:!0})}}]);if(!ne)return null;var Ce="Plivanje"===ne.sport.name?R.disciplinePlivanje:"M"===ne.sex?R.disciplineAtletikaM:R.disciplineAtletikaZ;return"Karate"===ne.sport.name&&"M"===ne.sex?Ce=R.karateM:"Karate"===ne.sport.name?Ce=R.karateZ:"Judo"===ne.sport.name&&"M"===ne.sex?Ce=R.judoM:"Judo"===ne.sport.name?Ce=R.judoZ:"Kickboxing"===ne.sport.name&&"M"===ne.sex?Ce=R.KickBoxingM:"Kickboxing"===ne.sport.name?Ce=R.KickBoxingZ:"Taekwondo"===ne.sport.name&&"M"===ne.sex?Ce=R.TaekwondoM:"Taekwondo"===ne.sport.name&&(Ce=R.TaekwondoZ),ne&&Object(E.isSportWithDisciplines)(ne)&&ye.splice(2,0,{name:"Discipline",selector:"role",cell:function(e){return console.log(e),Object(_.jsx)("span",{style:{width:"70%"},children:e.discipline&&e.discipline.map((function(e){return Object(_.jsxs)(s.Fragment,{children:[Object(_.jsx)("span",{style:{fontSize:"12px"},children:e.value?e.value:e}),Object(_.jsx)("br",{})]})}))})}}),Z&&ne?Object(_.jsxs)(s.Fragment,{children:[Object(_.jsxs)("h1",{children:[ne&&ne.name," (",ne&&ne.sex,")"]}),pe&&Object(_.jsx)("div",{style:{position:"absolute",width:"100vw",height:"100vh",backgroundColor:"black",zIndex:"998",opacity:"0.5"}}),se&&Object(_.jsx)(K.a,{isNatjecanjaOdobrenje:!0,viewOnly:!0,selectedTeam:Z,selectedUser:se._id,isOpen:de,toggle:function(){oe(null),ue(!de)}}),Object(_.jsx)(f.a,{isLoader:pe,setIsLoader:me,fetchFreshData:he,competition:ne,team:Y,options:fe,categoryOptions:Ce,isEdit:X,players:w,setPlayers:S,toggle:function(){m(!j)},toggleDetails:function(){N(!k)},isOpen:j}),Object(_.jsx)(T,{toggle:function(){N(!k)},isOpen:k}),pe&&Object(_.jsx)(d.a,{animation:"border",role:"status",size:"xl",style:{width:"100px",height:"100px",position:"absolute",top:"50%",left:"50%",color:"#024BFF",zIndex:"999"}}),Object(_.jsx)(u.a,{children:Object(_.jsxs)("div",{style:{minWidth:"90%",overflow:scroll},className:"app-user-list",children:[Object(_.jsx)(b.a,{paginationRowsPerPageOptions:[10,20,30,40,50],paginationPerPage:50,noHeader:!0,pagination:!0,subHeader:!0,responsive:!0,noDataComponent:"Nema podataka za prikazati",columns:ye,className:"react-dataTable",data:w,subHeaderComponent:Object(_.jsx)(M.a,{roles:["team admin","team leader"],name:"Odabir igra\u010da - "+Z.name,new:"Dodaj novog sudionika",onClick:function(){m(!0)}})}),!pe&&Object(_.jsx)(z.a,{backClick:function(){e.replace("/natjecanja")},forwardLabel:"Zavr\u0161i i predaj",forwardClick:!X&&function(){me(!0);var t=[];w.map((function(e){t.push(e._id)})),h.a.post("".concat("https://unisport-backend-prod.herokuapp.com","/constituent/add-team-to-competition"),{coreTeamId:Z._id,competitionId:ne._id,players:[]}).then((function(){h.a.get("".concat("https://unisport-backend-prod.herokuapp.com","/admin/get-compet
1ition-teams?competitionId=").concat(P.competitionId)).then((function(t){t.data.teams.map((function(t){if(t.coreTeam===Z._id){var n=[];0===w.length&&(J.fire({icon:"success",title:"Uspje\u0161no",text:"Prijava poslana.",customClass:{confirmButton:"btn btn-success"}}),e.replace("/natjecanja")),w.map((function(a,i){setTimeout((function(){var i=[];a.discipline&&a.discipline&&a.discipline.map&&a.discipline.map((function(e){i.push(e.value)})),h.a.post("".concat("https://unisport-backend-prod.herokuapp.com","/constituent/add-player"),{userId:a._id,teamId:t._id,discipline:i.length>0?i:null,isTrainer:"Tehni\u010dko osoblje"===a.roleCompetition.value}).then((function(){n.push(!0),n.length===w.length&&(J.fire({icon:"success",title:"Uspje\u0161no",text:"Prijava poslana.",customClass:{confirmButton:"btn btn-success"}}),e.replace("/natjecanja"))}))}),500*(i+1))}))}}))}))})).catch((function(e){console.log(e),window.alert("Nesto je poslo po krivu. Molim probajte ponovno.")}))}})]})})]}):null}},121:function(e,t,n){"use strict";var a=n(8),i=n(0),c=n(1190),s=n(1128),o=n(1129),l=n(1130),r=n(1131),d=n(52),u=n(59),j=n.n(u),b=n(60),p=n.n(b),m=n(55),h=n.n(m),O=n(57),x=n(3),f=p()(j.a);t.a=function(e){var t=e.toggle,n=e.isOpen,u=e.constituents,j=Object(i.useState)(""),b=Object(a.a)(j,2),p=b[0],m=b[1],v=Object(i.useState)(!1),g=Object(a.a)(v,2),k=g[0],N=g[1];return Object(x.jsxs)(c.a,{isOpen:n,toggle:t,children:[Object(x.jsx)(s.a,{toggle:t,children:"Spremi odabir"}),Object(x.jsx)(o.a,{children:Object(x.jsx)(l.a,{placeholder:"Naziv",theme:O.d,className:"react-select",classNamePrefix:"select",invalid:""===p&&k,value:p,onChange:function(e){m(e.target.value)}})}),Object(x.jsx)(r.a,{children:Object(x.jsxs)("div",{className:"row justify-content-center text-center",style:{width:"100%"},children:[Object(x.jsx)("div",{className:"col",children:Object(x.jsx)(d.a.Ripple,{onClick:function(){e.toggle()},type:"submit",color:"danger",className:"btn-next",children:Object(x.jsx)("span",{className:"align-middle d-sm-inline-block d-none",children:"Odustani"})})}),Object(x.jsx)("div",{className:"col",children:Object(x.jsx)(d.a.Ripple,{onClick:function(){if(""!==p){var e=[];u.map((function(t){t.is_checked&&e.push(t.id)})),h.a.post("".concat("https://unisport-backend-prod.herokuapp.com","/admin/post-fast-picks"),{name:p,ids:e}).then((function(e){f.fire({icon:"success",title:"Uspje\u0161no",text:"Odabir uspje\u0161no spremljen.",customClass:{confirmButton:"btn btn-success"}}),t()}))}else N(!0)},type:"submit",color:"primary",className:"btn-next",children:Object(x.jsx)("span",{className:"align-middle d-sm-inline-block d-none",children:"Spremi"})})})]})})]})}},174:function(e,t,n){"use strict";var a=n(64),i=n(1),c=n(8),s=n(0),o=n(1190),l=n(1128),r=n(1129),d=n(1130),u=n(1131),j=n(52),b=n(59),p=n.n(b),m=n(60),h=n.n(m),O=n(57),x=n(88),f=n(20),v=n(62),g=n(55),k=n.n(g),N=(n(65),n(3)),y=h()(p.a);t.a=function(e){var t=e.toggle,n=e.isOpen,b=Object(s.useState)(!1),p=Object(c.a)(b,2),m=p[0],h=p[1],g=Object(s.useState)(""),C=Object(c.a)(g,2),w=C[0],S=C[1],P=Object(s.useState)(""),I=Object(c.a)(P,2),D=I[0],_=I[1],T=Object(s.useState)(!1),B=Object(c.a)(T,2),F=(B[0],B[1],Object(s.useState)([])),z=Object(c.a)(F,2),M=(z[0],z[1]),R=Object(s.useState)(!1),E=Object(c.a)(R,2),U=E[0],A=E[1],K=Object(s.useState)(!1),J=Object(c.a)(K,2),L=J[0],Z=J[1],H=Object(s.useState)([]),G=Object(c.a)(H,2),W=G[0],Y=G[1];Object(x.g)(),Object(f.c)();return Object(s.useEffect)((function(){if(0==W.length){k.a.get("".concat("https://unisport-backend-prod.herokuapp.com","/admin/sports")).then((function(e){var t=e.data.sports;t=t.map((function(e){return{value:e,label:e}})),Y(t)}));var e="".concat("https://unisport-backend-prod.herokuapp.com","/admin/get-users");k.a.get(e).then((function(e){var t=e.data.users.filter((function(e){return"true"===e.isApproved}));t=t.map((function(e){return{value:e._id,label:e.name+" "+e.surname}})),M(t)}))}})),Object(N.jsxs)(o.a,{isOpen:n,toggle:t,children:[Object(N.jsx)(l.a,{toggle:t,children:"Nova ekipa"}),Object(N.jsxs)(r.a,{children:[Object(N.jsx)("br",{}),Object(N.jsx)(d.a,{theme:O.d,className:"react-select",classNamePrefix:"select",placeholder:"Puni naziv",value:w,invalid:m&&""===w,onChange:function(e){
1S(e.target.value)}}),Object(N.jsx)("br",{}),Object(N.jsx)("br",{}),Object(N.jsx)(d.a,{theme:O.d,className:"react-select",classNamePrefix:"select",placeholder:"Skra\u0107eni naziv",value:D,invalid:m&&""===D,onChange:function(e){_(e.target.value)}}),Object(N.jsx)("br",{}),Object(N.jsx)("br",{}),Object(N.jsx)(v.a,{theme:O.d,className:"react-select",classNamePrefix:"select",placeholder:"Odaberi sport",value:U,styles:{control:function(e){return Object(i.a)(Object(i.a)({},e),{},{borderColor:m&&""===U?"red":e.borderColor,"&:hover":{borderColor:m&&""===U?"red":e["&:hover"].borderColor}})}},onChange:function(e){A(e)},options:W,isClearable:!1}),Object(N.jsx)("br",{}),Object(N.jsx)("br",{}),Object(N.jsx)(v.a,{theme:O.d,className:"react-select",classNamePrefix:"select",placeholder:"Odaberi spol",value:L,styles:{control:function(e){return Object(i.a)(Object(i.a)({},e),{},{borderColor:m&&!L?"red":e.borderColor,"&:hover":{borderColor:m&&!L?"red":e["&:hover"].borderColor}})}},onChange:function(e){Z(e)},options:[{value:"M",label:"mu\u0161ki"},{value:"\u017d",label:"\u017eenski"}],isClearable:!1}),Object(N.jsx)("br",{})]}),Object(N.jsx)(u.a,{children:Object(N.jsxs)("div",{className:"row justify-content-center text-center",style:{width:"100%"},children:[Object(N.jsx)("div",{className:"col",children:Object(N.jsx)(j.a.Ripple,{onClick:function(){e.toggle()},type:"submit",color:"danger",className:"btn-next",children:Object(N.jsx)("span",{className:"align-middle d-sm-inline-block d-none",children:"Odustani"})})}),Object(N.jsx)("div",{className:"col",children:Object(N.jsx)(j.a.Ripple,{onClick:function(){if(""!==w&&""!==D&&U){var t=e.teams,n={sport:U.value,sex:L.value,name:w,shortName:D,constituentId:e.constituentId};k.a.post("".concat("https://unisport-backend-prod.herokuapp.com","/admin/add-core-team"),n).then((function(i){y.fire({icon:"success",title:"Uspje\u0161no",text:"Team dodan.",customClass:{confirmButton:"btn btn-success"}}),t.push(n),e.setTeams(Object(a.a)(t)),e.toggle()})).catch((function(){window.alert("Nesto je poslo po krivu. Molim probajte ponovno.")}))}else h(!0)},type:"submit",color:"primary",className:"btn-next",children:Object(N.jsx)("span",{className:"align-middle d-sm-inline-block d-none",children:"Dodaj"})})})]})})]})}},175:function(e,t,n){"use strict";var a=n(8),i=n(0),c=n(1190),s=n(1128),o=n(1129),l=n(1113),r=n(1130),d=n(1131),u=n(52),j=n(55),b=n.n(j),p=n(394),m=n(59),h=n.n(m),O=n(60),x=n.n(O),f=(n(65),n(63)),v=n(3),g=x()(h.a);t.a=function(e){var t=e.toggle,n=e.isOpen,j=e.isNatjecanjaOdobrenje,m=e.selectedUser,h=Object(i.useState)(null),O=Object(a.a)(h,2),x=O[0],k=O[1],N=Object(i.useState)(!1),y=Object(a.a)(N,2),C=y[0],w=y[1],S=Object(i.useState)(null),P=Object(a.a)(S,2),I=P[0],D=P[1],_=x&&(null==x.isApproved||"waiting"===x.isApproved),T=x&&"true"===x.isApproved,B=x&&"false"===x.isApproved;j&&(T=x&&x.approvedForCompetitions&&"true"===x.approvedForCompetitions.flag,B=x&&x.approvedForCompetitions&&"false"===x.approvedForCompetitions.flag,_=!T&&!B);var F=x&&x.comment?x.comment:"",z=Object(i.useState)(F),M=Object(a.a)(z,2),R=M[0],E=M[1],U=Object(i.useState)(null),A=Object(a.a)(U,2),K=A[0],J=A[1];Object(i.useEffect)((function(){var e="".concat("https://unisport-backend-prod.herokuapp.com","/admin/constituents"),t=Object(f.b)();e+="?org=".concat(t,"&withoutTeams=true"),b.a.get("".concat("https://unisport-backend-prod.herokuapp.com","/admin/get-user?userId=").concat(m)).then((function(t){k(t.data.user),null==I?b.a.get(e).then((function(e){D(e.data.constituents),e.data.constituents.map((function(e){e._id===t.data.user.constituent&&J(e)}))})):I.map((function(e){e._id===t.data.user.constituent&&J(e)}))}))}),[m]);var L=function(){g.fire({title:"Jeste li sigurni",text:j?"Klikom na gumb Potvrdi korisnik \u0107e biti odbijen za natjecanja":"Klikom na gumb Potvrdi profil \u0107e biti odbijen",icon:"warning",showCancelButton:!0,confirmButtonText:"Potvrdi",cancelButtonText:"Odustani",customClass:{confirmButton:"btn btn-primary",cancelButton:"btn btn-outline-danger ml-1"},buttonsStyling:!1}).then((function(n){if(n.value){var a="reject-user";j&&(a="/approve-for-competitions"),b.a.post("".concat("https://unisport-backend-prod.herokuapp.com","/admin/").concat(a,"?"),{user:x._id,userId:x._id,flag:!1,comment:R}).then((function(n){g.fire({icon:"success",title:"Uspje\u0161no",text:j?"Odbijen korisnik za natjecanja":"Odbijen profil",customClass:{confirmButton:"btn btn-success"}}),E(""),k(null),t(),e.fetchFreshData()})).catch((function(e){console.log(e),window.alert("Nesto je poslo po krivu. Molim probajte ponovno.")}))}}))},Z=function(){g.fire({title:"Jeste li sigurni",text:j?"Klikom na gumb Da korisnik \u0107e biti odobren za
1natjecanja":"Klikom na gumb Da korisnikov profil \u0107e biti odobren",icon:"warning",showCancelButton:!0,confirmButtonText:"Da",customClass:{confirmButton:"btn btn-primary",cancelButton:"btn btn-outline-danger ml-1"},buttonsStyling:!1}).then((function(n){if(n.value){var a="approve-user";j&&(a="approve-for-competitions"),b.a.post("".concat("https://unisport-backend-prod.herokuapp.com","/admin/").concat(a),{user:x._id,userId:x._id,flag:!0,comment:R}).then((function(n){g.fire({icon:"success",title:"Uspje\u0161no",text:"Odobreno",customClass:{confirmButton:"btn btn-success"}}),E(""),t(),k(null),e.fetchFreshData()})).catch((function(e){console.log(e),window.alert("Nesto je poslo po krivu. Molim probajte ponovno.")}))}}))};if(!x)return null;var H=[];e.selectedTeam&&e.selectedTeam.disciplines&&e.selectedTeam.disciplines&&e.selectedTeam.disciplines.length>0&&e.selectedTeam.disciplines.map((function(e){e.player===x._id&&H.push(e.discipline)}));var G=x.profilePhoto?x.profilePhoto.split("/"):[""];return Object(v.jsxs)(c.a,{isOpen:n,toggle:t,children:[Object(v.jsxs)(s.a,{toggle:function(){w(!1),k(null),t()},children:["Odobri korisnika - ",x.name," ",x.surname]}),Object(v.jsxs)(o.a,{children:[Object(v.jsxs)("div",{className:"row justify-content-center text-center align-content-center",children:[x&&"true"===x.isApproved&&!e.viewOnly&&Object(v.jsx)(l.a,{style:{padding:"10px",margin:"20px"},className:"text-capitalize justify-content-center text-center align-content-center",color:"light-success",pill:!0,children:Object(v.jsx)("span",{children:"Profil odobren"})}),x&&"false"===x.isApproved&&Object(v.jsx)(l.a,{style:{padding:"10px",margin:"20px"},className:"text-capitalize justify-content-center text-center align-content-center",color:"light-warning",pill:!0,children:Object(v.jsx)("span",{children:"Profil odbijen"})})]}),Object(v.jsx)("div",{style:{marginBottom:"90px"},className:"row justify-content-center text-center",children:Object(v.jsxs)("div",{className:"col justify-content-center text-center",children:[Object(v.jsx)("h3",{children:"Op\u0107i podaci"}),Object(v.jsx)("br",{}),Object(v.jsxs)("h6",{children:["Ime korisnika: ",x.name," ",x.surname]}),x.unisportId&&Object(v.jsxs)("div",{children:["Unisport ID: ",x.unisportId]}),K&&Object(v.jsxs)("div",{children:["Fakultet: ",K.shortName?K.shortName:K.name]}),x.status&&Object(v.jsxs)("div",{children:["Studentski status: ",x.status]}),x.carnetResponse&&x.carnetResponse.map&&x.carnetResponse.length>0&&Object(v.jsxs)("div",{children:[Object(v.jsx)("br",{}),Object(v.jsx)("div",{children:Object(v.jsx)("h5",{children:"SRCE podaci:"})}),x.carnetResponse.map((function(e){if("dc"===e.fieldName||"hrEduOrgMember"===e.fieldName||"hrEduPersonHomeOrg"===e.fieldName||"o"===e.fieldName||"cn"===e.fieldName||"hrEduPersonExpireDate"===e.fieldName){var t=e.value;try{t.length>100&&(t=t.substring(0,100))}catch(n){}if("hrEduPersonExpireDate"===e.fieldName)try{t=t.slice(0,4)+"-"+t.slice(4,6)+"-"+t.slice(6,8)}catch(n){}return Object(v.jsxs)("span",{children:[e.fieldName,": ",t," ",Object(v.jsx)("br",{})]})}return null})),Object(v.jsx)("br",{}),Object(v.jsx)("hr",{}),Object(v.jsx)("br",{})]}),Object(f.t)()&&Object(v.jsxs)("div",{children:["Nacionalnost: ",x.nationality]}),Object(f.t)()&&Object(v.jsxs)("div",{children:["OIB: ",x.oib]}),Object(v.jsxs)("div",{children:["Velicina majice: ",x.shirtSize]}),Object(f.t)()&&Object(v.jsxs)("div",{children:["Datum ro\u0111enja: ",x.birthDate.slice(0,10)]}),(Object(f.h)()||Object(f.u)()||Object(f.v)()||Object(f.m)())&&Object(v.jsxs)("div",{children:["Godina ro\u0111enja: ",function(){var e=function(){if(x&&x.birthDate)return new Date(x.birthDate)}();return e?e.getFullYear():null}()]}),Object(f.t)()&&Object(v.jsxs)("div",{children:["Mjesto ro\u0111enja: ",x.birthLocation]}),Object(f.t)()&&Object(v.jsxs)("div",{children:["Mobitel: ",x.phone]}),Object(f.t)()&&Object(v.jsxs)("div",{children:["Email: ",x.email]}),Object(v.jsx)("br",{}),Object(v.jsxs)("div",{children:[Object(v.jsx)("h5",{children:"Dokumenti"}),x.files&&x.files.map((function(e){var t=e.split("/");return Object(v.jsxs)(i.Fragment,{children:[Object(v.jsx)("a",{target:"_blank",href:e,children:t[t.length-1]}),Object(v.jsx)("br",{})]})}))]}),x.profilePhoto&&Object(v.jsxs)("div",{children:[Object(v.jsx)("br",{}),Object(v.jsx)("h5",{children:"Akreditacijska fotografija (do 3 MB)"}
1),Object(v.jsx)("a",{target:"_blank",href:x.profilePhoto,children:G[G.length-1]}),Object(v.jsx)("br",{}),Object(v.jsx)("br",{}),Object(v.jsx)("img",{alt:"Profile photo",style:{width:"190px",height:"auto"},src:x.profilePhoto})]}),!e.viewOnly&&x.comments&&x.comments.length>0&&!j&&Object(v.jsxs)("div",{children:[Object(v.jsx)("br",{}),Object(v.jsx)("br",{}),Object(v.jsx)("h6",{children:"Dosada\u0161nji komentari:"}),x.comments.map((function(e){return Object(v.jsxs)("span",{children:[e,Object(v.jsx)("br",{})]})}))]}),H.length>0&&Object(v.jsxs)("div",{children:[Object(v.jsx)("br",{}),Object(v.jsx)("br",{}),"Discipline: ",H.join()]})]})}),!e.viewOnly&&Object(f.t)()&&Object(v.jsx)("div",{style:{marginBottom:"90px"},className:"row justify-content-center text-center",children:Object(v.jsx)(r.a,{type:"textarea",style:{width:"85%",height:"90px"},placeholder:"Komentar",value:R,onChange:function(e){E(e.target.value)}})})]}),!e.viewOnly&&Object(f.t)()&&Object(v.jsx)(d.a,{children:Object(v.jsxs)("div",{className:"row justify-content-center text-center",style:{width:"100%"},children:[!_&&!C&&Object(v.jsx)(i.Fragment,{children:Object(v.jsx)("div",{className:"col",children:Object(v.jsx)(u.a.Ripple,{type:"submit",color:"primary",className:"btn-next",onClick:function(){w(!0)},children:Object(v.jsx)("span",{className:"align-middle d-sm-inline-block d-none",children:"Izmijeni"})})})}),!_&&C&&Object(v.jsxs)(i.Fragment,{children:[Object(v.jsx)("div",{className:"col",children:Object(v.jsxs)(u.a.Ripple,{onClick:function(){w(!1)},color:"secondary",className:"btn-prev",outline:!0,children:[Object(v.jsx)(p.a,{size:14,className:"align-middle mr-sm-25 mr-0"}),Object(v.jsx)("span",{className:"align-middle d-sm-inline-block d-none",children:"Povratak"})]})}),Object(v.jsx)("div",{className:"col",children:Object(v.jsx)(u.a.Ripple,{type:"submit",color:B?"primary":"danger",className:"btn-next",onClick:function(){B?Z():L()},children:Object(v.jsx)("span",{className:"align-middle d-sm-inline-block d-none",children:B?"Odobri prijavu":"Odbij prijavu"})})})]}),_&&Object(v.jsxs)(i.Fragment,{children:[Object(v.jsx)("div",{className:"col",children:Object(v.jsx)(u.a.Ripple,{type:"submit",color:"danger",className:"btn-next",onClick:L,children:Object(v.jsx)("span",{className:"align-middle d-sm-inline-block d-none",children:"Odbij"})})}),Object(v.jsx)("div",{className:"col",children:Object(v.jsx)(u.a.Ripple,{onClick:Z,type:"submit",color:"primary",className:"btn-next",children:Object(v.jsx)("span",{className:"align-middle d-sm-inline-block d-none",children:"Odobri"})})})]})]})})]})}},284:function(e,t,n){"use strict";var a=n(64),i=n(8),c=n(0),s=n(1190),o=n(1125),l=n(1128),r=n(1129),d=n(1131),u=n(52),j=n(59),b=n.n(j),p=n(60),m=n.n(p),h=n(55),O=n.n(h),x=n(62),f=n(57),v=(n(20),n(65),n(141),n(98)),g=n(169),k=n(3),N=m()(b.a);t.a=function(e){var t=e.toggle,n=e.isOpen,j=e.competition,b=Object(c.useState)([]),p=Object(i.a)(b,2),m=p[0],h=p[1],y=Object(c.useState)({}),C=Object(i.a)(y,2),w=C[0],S=C[1],P=Object(c.useState)(!1),I=Object(i.a)(P,2),D=I[0],_=I[1],T=function(){var e=function(){if(w&&w.value.birthDate)return new Date(w.value.birthDate)}();return e?e.getFullYear():null};Object(c.useEffect)((function(){O.a.get("".concat("https://unisport-backend-prod.herokuapp.com","/admin/get-compet
1ition-teams?competitionId=").concat(j._id)).then((function(t){var n=t.data.teams,a="".concat("https://unisport-backend-prod.herokuapp.com","/admin/get-users");O.a.get(a).then((function(t){var a=t.data.users.filter((function(t){var a=!1;e.players.map((function(e){e._id===t._id&&(a=!0)}));var i=!1;n.map((function(e){e.players.map((function(e){e._id===t._id&&(i=!0)})),e.trainers.map((function(e){e._id===t._id&&(i=!0)}))}));return"true"===t.isApproved&&!a&&!i&&!t.role.includes("super admin")&&"developer"!==t.name&&8!==t.unisportId})).map((function(e){return e.roleCompetition={value:"Sudionik natjecanja",label:"Natjecatelj"},{value:e,label:e.name+" "+e.surname+" (Unisport ID: "+e.unisportId+")"}}));h(a)}))}))}),[e.players]);var B=w&&w.value&&w.value.profilePhoto?w.value.profilePhoto.split("/"):[""];return Object(k.jsxs)(s.a,{isOpen:n,toggle:t,children:[D&&Object(k.jsx)("div",{style:{position:"absolute",width:"100%",height:"100%",backgroundColor:"black",zIndex:"998",opacity:"0.5"}}),D&&Object(k.jsx)(o.a,{animation:"border",role:"status",size:"xl",style:{width:"100px",height:"100px",position:"absolute",top:"50%",left:"50%",color:"#024BFF",zIndex:"999"}}),Object(k.jsx)(l.a,{toggle:t,children:"Dodaj sudionika"}),Object(k.jsxs)(r.a,{children:[Object(k.jsx)(x.a,{placeholder:"Odaberi sudionika",theme:f.d,className:"react-select",classNamePrefix:"select",options:m,value:w&&w.value&&w.value._id?w:null,onChange:function(e){e.newlyAdded=!0,e.customId=Object(g.a)(1,1e7),O.a.get("".concat("https://unisport-backend-prod.herokuapp.com","/admin/get-user?userId=").concat(e.value._id)).then((function(e){S({value:e.data.user,label:e.data.user.name+e.data.user.surname+" - Unisport ID: "+e.data.user.unisportId})}))}}),Object(k.jsx)("br",{})," ",Object(k.jsx)("br",{}),Object(k.jsx)(x.a,{placeholder:"Odaberi ulogu",theme:f.d,className:"react-select",id:"select-react-test",classNamePrefix:"select",value:w&&w.value&&w.value.roleCompetition?w.value.roleCompetition:null,onChange:function(e){var t=Object.assign({},w);t.value.roleCompetition=e,S(t)},name:"clear",options:e.options,isClearable:!1}),Object(k.jsx)("br",{}),Object(k.jsx)("br",{}),j&&Object(v.isSportWithDisciplines)(j)&&(null==w||null==w.value||null==w.value.roleCompetition||"Slu\u017ebena osoba"!=w.value.roleCompetition.label)&&Object(k.jsxs)(c.Fragment,{children:[Object(k.jsx)(x.a,{isMulti:!0,style:{overflowY:"scroll"},placeholder:"Odaberi kategorije",theme:f.d,className:"react-select",id:"select-react-disciplina",classNamePrefix:"select",value:w&&w.value&&w.value.discipline?w.value.discipline:null,onChange:function(e){if(j.maxNumberOfDisciplines&&0!=j.maxNumberOfDisciplines&&""!=j.maxNumberOfDisciplines&&w.value&&w.value.discipline&&w.value.discipline.length>=j.maxNumberOfDisciplines)window.alert("Maksimalan broj kategorija za ovo natjecanje je "+j.maxNumberOfDisciplines);else{var t=Object.assign({},w);t.value.discipline=e,S(t)}},name:"clear",options:e.categoryOptions,isClearable:!1}),Object(k.jsx)("br",{})]}),w&&w.value&&Object(k.jsx)("div",{style:{marginBottom:"90px"},className:"row justify-content-center text-center",children:Object(k.jsxs)("div",{className:"col justify-content-center text-center",children:[Object(k.jsx)("h3",{children:"Op\u0107i podaci"}),Object(k.jsx)("br",{}),Object(k.jsxs)("h6",{children:["Ime korisnika: ",w.value.name," ",w.value.surname]}),w.unisportId&&Object(k.jsxs)("div",{children:["Unisport ID: ",w.value.unisportId]}),null!=w.value.yearOfStudy&&0!=w.value.yearOfStudy&&w.value.yearOfStudy>0&&Object(k.jsxs)("div",{children:["Godina studija: ",w.value.yearOfStudy]}),w.value.status&&Object(k.jsxs)("div",{children:["Studentski status: ",w.value.status]}),T()&&Object(k.jsxs)("div",{children:["Godina ro\u0111enja: ",T()]}),w.value.carnetResponse&&w.value.carnetResponse.map&&w.value.carnetResponse.length>0&&Object(k.jsxs)("div",{children:[Object(k.jsx)("br",{}),Object(k.jsx)("div",{children:"SRCE podaci:"}),w.value.carnetResponse.map((function(e){if("dc"===e.fieldName||"hrEduOrgMember"===e.fieldName||"hrEduPersonHomeOrg"===e.fieldName||"o"===e.fieldName||"cn"===e.fieldName||"hrEduPersonExpireDate"===e.fieldName){var t=e.value;try{t.length>
1100&&(t=t.substring(0,100))}catch(n){}return Object(k.jsxs)("span",{children:[e.fieldName,": ",t," ",Object(k.jsx)("br",{})]})}return null})),Object(k.jsx)("br",{})]}),w&&w.value&&Object(k.jsxs)(c.Fragment,{children:[Object(k.jsxs)("div",{children:[Object(k.jsx)("br",{}),Object(k.jsx)("h5",{children:"Dokumenti:"}),w.value.files&&w.value.files.map((function(e){var t=e.split("/");return Object(k.jsxs)(c.Fragment,{children:[Object(k.jsx)("a",{target:"_blank",href:e,children:t[t.length-1]}),Object(k.jsx)("br",{})]})}))]}),w&&w.value&&w.value.profilePhoto&&Object(k.jsxs)("div",{children:[Object(k.jsx)("br",{}),Object(k.jsx)("h5",{children:"Akreditacijska fotografija:"}),Object(k.jsx)("a",{target:"_blank",href:w.value.profilePhoto,children:B[B.length-1]}),Object(k.jsx)("br",{}),Object(k.jsx)("br",{}),Object(k.jsx)("img",{alt:"Profile photo",style:{width:"190px",height:"auto"},src:w.value.profilePhoto})]})]})]})})]}),Object(k.jsx)(d.a,{children:Object(k.jsxs)("div",{className:"row justify-content-center text-center",style:{width:"100%"},children:[Object(k.jsx)("div",{className:"col",children:Object(k.jsx)(u.a.Ripple,{onClick:function(){e.toggle()},type:"submit",color:"danger",className:"btn-next",children:Object(k.jsx)("span",{className:"align-middle d-sm-inline-block d-none",children:"Odustani"})})}),Object(k.jsx)("div",{className:"col",children:Object(k.jsx)(u.a.Ripple,{disabled:D,onClick:function(){if(w&&null!=w.value)if(null==w.value.roleCompetition)window.alert("Molimo odaberite ulogu na natjecanju");else{var n=[];w.value.discipline&&w.value.discipline.map&&w.value.discipline.map((function(e){n.push(e.value)}));var i=e.players;i.push(w.value),e.setPlayers(Object(a.a)(i)),e.isEdit?(_(!0),O.a.post("".concat("https://unisport-backend-prod.herokuapp.com","/constituent/add-player"),{userId:w.value._id,teamId:e.team._id,discipline:n.length>0?n:null,isTrainer:"Tehni\u010dko osoblje"===w.value.roleCompetition.value}).then((function(n){_(!1),N.fire({icon:"success",title:"Uspje\u0161no",text:"Igra\u010d dodan.",customClass:{confirmButton:"btn btn-success"}}),S({}),h([]),e.fetchFreshData(),t()})).catch((function(){_(!1),e.fetchFreshData(),window.alert("Nesto je poslo po krivu. Molim probajte ponovno.")}))):(S({}),h([]),t())}else window.alert("Molimo odaberite igra\u010da")},type:"submit",color:"primary",className:"btn-next",children:Object(k.jsx)("span",{className:"align-middle d-sm-inline-block d-none",children:"Dodaj"})})})]})})]})}}}]); 2//# sourceMappingURL=35.c2ea8883.chunk.js.map
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.