1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2494],{32045:function(e,t,a){"use strict";let r=(0,a(30012).Z)();t.Z=r},23459:function(e,t,a){var r=a(15787).w_;e.exports.N=function(e){return r({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M14 6C14 7.10457 13.1046 8 12 8C10.8954 8 10 7.10457 10 6C10 4.89543 10.8954 4 12 4C13.1046 4 14 4.89543 14 6Z",fill:"currentColor"}},{tag:"path",attr:{d:"M14 12C14 13.1046 13.1046 14 12 14C10.8954 14 10 13.1046 10 12C10 10.8954 10.8954 10 12 10C13.1046 10 14 10.8954 14 12Z",fill:"currentColor"}},{tag:"path",attr:{d:"M14 18C14 19.1046 13.1046 20 12 20C10.8954 20 10 19.1046 10 18C10 16.8954 10.8954 16 12 16C13.1046 16 14 16.8954 14 18Z",fill:"currentColor"}}]})(e)}},67391:function(e,t,a){var r=a(15787).w_;e.exports.L=function(e){return r({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17.263 2.177a1.75 1.75 0 0 1 2.474 0l2.586 2.586a1.75 1.75 0 0 1 0 2.474L19.53 10.03l-.012.013L8.69 20.378a1.753 1.753 0 0 1-.699.409l-5.523 1.68a.748.748 0 0 1-.747-.188.748.748 0 0 1-.188-.747l1.673-5.5a1.75 1.75 0 0 1 .466-.756L14.476 4.963ZM4.708 16.361a.26.26 0 0 0-.067.108l-1.264 4.154 4.177-1.271a.253.253 0 0 0 .1-.059l10.273-9.806-2.94-2.939-10.279 9.813ZM19 8.44l2.263-2.262a.25.25 0 0 0 0-.354l-2.586-2.586a.25.25 0 0 0-.354 0L16.061 5.5Z"}}]})(e)}},80360:function(e,t,a){var r=a(15787).w_;e.exports.Q=function(e){return r({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z"}}]})(e)}},44023:function(e,t,a){var r=a(15787).w_;e.exports.v=function(e){return r({tag:"svg",attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M2 1C1.44772 1 1 1.44772 1 2V13C1 13.5523 1.44772 14 2 14H13C13.5523 14 14 13.5523 14 13V2C14 1.44772 13.5523 1 13 1H2ZM3.05 6H4.95V12H3.05V6ZM5.075 4.005C5.075 4.59871 4.59371 5.08 4 5.08C3.4063 5.08 2.925 4.59871 2.925 4.005C2.925 3.41129 3.4063 2.93 4 2.93C4.59371 2.93 5.075 3.41129 5.075 4.005ZM12 8.35713C12 6.55208 10.8334 5.85033 9.67449 5.85033C9.29502 5.83163 8.91721 5.91119 8.57874 6.08107C8.32172 6.21007 8.05265 6.50523 7.84516 7.01853H7.79179V6.00044H6V12.0047H7.90616V8.8112C7.8786 8.48413 7.98327 8.06142 8.19741 7.80987C8.41156 7.55832 8.71789 7.49825 8.95015 7.46774H9.02258C9.62874 7.46774 10.0786 7.84301 10.0786 8.78868V12.0047H11.9847L12 8.35713Z",fill:"currentColor"}}]})(e)}},30862:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/manager/courses-main",function(){return a(34073)}])},72498:function(e,t,a){"use strict";var r=a(64836);t.Z=void 0;var n=r(a(33651)),s=a(85893);t.Z=(0,n.default)((0,s.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"SearchOutlined")},75949:function(e,t,a){"use strict";a.d(t,{Z:function(){return m}});var r=a(85893),n=a(67294),s=a(3314),i=a(21844),l=a(77881),o=a(88771),u=a(38175),d=a(54035),c=a(34708),x=a(92338),h=a(16198);function m(e){let{children:t}=e,{themeLayout:a}=(0,i.K$)(),m=(0,l.F)("up","md"),[p,g]=(0,n.useState)(!1),v=()=>{g(!0)},j=(0,r.jsx)(h.Z,{isManager:!0,openNav:p,onCloseNav:()=>{g(!1)}});return(0,r.jsxs)(o.Z,{children:[" ","horizontal"===a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.Z,{onOpenNav:v}),m?(0,r.jsx)(c.Z,{isManager:!0}):j,(0,r.jsx)(d.Z,{children:t})]}):"mini"===a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.Z,{onOpenNav:v}),(0,r.jsxs)(s.Z,{sx:{display:{md:"flex"},minHeight:{md:1}},children:[m?(0,r.jsx)(x.Z,{isManager:!0}):j,(0,r.jsx)(d.Z,{children:t})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.Z,{onOpenNav:v}),(0,r.jsxs)(s.Z,{sx:{display:{md:"flex"},minHeight:{md:1}},children:[j,(0,r.jsx)(d.Z,{children:t})]})]})," "]})}},34073:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return eN}});var r=a(85893),n=a(4336),s=a(3314),i=a(32045),l=a(35336),o=a(9008),u=a.n(o),d=a(8147),c=a(71560),x=a(75949),h=a(70540),m=a(85591),p=a(57041),g=a(67294),v=a(31812),j=a(60762),f=a(53145),_=a(52857),b=a(96788),F=a(45399),Z=a(56912),C=a(23459),w=a(43956),y=a(67391),A=a(41664),D=a.n(A),E=a(13689),k=a(35536),R=a(96849),T=a(26646),z=a(95639),N=a(40110),I=a(88607),L=a(28907),q=a(88196),G=a(92365),S=a(84324);let{useGetCourseAuthorsQuery:V,useAddAuthorToCourseMutation:B,useCreateCourseAuthorMutation:M,useDeleteCourseAuthorMutation:O,useRemoveAuthorFromCourseMutation:H,useUpdateCourseAuthorCoverMutation:P,useUpdateCourseAuthorMutation:K}=a(45490).g.injectEndpoints({endpoints:e=>({getCourseAuthors:e.query({query:e=>({url:"/manager/author",method:"GET",params:e}),providesTags:["CourseAuthor"]}),updateCourseAuthor:e.mutation({query:e=>{let{id:t,...a}=e;return{url:"/manager/author/".concat(t),method:"PATCH",body:a}}
1,invalidatesTags:[{type:"CourseAuthor"}]}),updateCourseAuthorCover:e.mutation({query:e=>{let{id:t,file:a}=e;return{url:"/manager/author/".concat(t,"/cover"),method:"PATCH",body:a}},invalidatesTags:[{type:"CourseAuthor"}]}),createCourseAuthor:e.mutation({query:e=>{let{...t}=e;return{url:"/manager/author",method:"POST",body:t}},invalidatesTags:[{type:"CourseAuthor"}]}),deleteCourseAuthor:e.mutation({query:e=>{let{id:t}=e;return{url:"/manager/author/".concat(t),method:"DELETE"}},invalidatesTags:[{type:"CourseAuthor"}]}),addAuthorToCourse:e.mutation({query:e=>{let{id:t,...a}=e;return{url:"/manager/author/".concat(t,"/course"),method:"PATCH",body:a}},invalidatesTags:[{type:"CourseAuthor"}]}),removeAuthorFromCourse:e.mutation({query:e=>{let{id:t,...a}=e;return{url:"/manager/author/".concat(t,"/course"),method:"DELETE",body:a}},invalidatesTags:[{type:"CourseAuthor"}]})}),overrideExisting:!1});var W=a(47533),$=a(29496),X=a(87536),U=a(7258),Y=a(58902);let J=/^((https?|ftp):\/\/)?(www.)?(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;function Q(e){let{isEdit:t=!1,courseId:a,setFormVisible:i,defaultValues:l={name:"",about:"",linkedin:"",email:""}}=e,{enqueueSnackbar:o}=(0,$.Ds)(),[u,{isLoading:d}]=M(),[c,{isLoading:x}]=K(),[h]=P(),m=(0,T.q)(),p=U.Ry().shape({name:U.Z_().required(m("required_name")),about:U.Z_(),linkedin:U.Z_().matches(J,m("enter_valid_url_msg")),email:U.Z_().email(m("must_be_valid_email")),avatar:U.nK()}),j=(0,X.cI)({resolver:(0,W.X)(p),defaultValues:l}),_=async e=>{try{let r=new FormData;if(t&&(null==l?void 0:l.id))await c({id:l.id,name:e.name,linkedin:e.linkedin,about:e.about}).unwrap(),e.avatar&&"string"!=typeof e.avatar&&(r.append("file",e.avatar),await h({id:l.id,file:r}).unwrap());else{let t=await u({name:e.name,about:e.about,linkedin:e.linkedin,email:e.email,course_id:a}).unwrap();e.avatar&&(r.append("file",e.avatar),await h({id:t.id,file:r}).unwrap())}o(t?m("messages_update_success"):m("messages_create_success")),i(!1),j.reset()}catch(e){var r;o(null==e?void 0:null===(r=e.data)||void 0===r?void 0:r.message,{variant:"error"})}},b=(0,g.useCallback)(e=>{let t=e[0],a=Object.assign(t,{preview:URL.createObjectURL(t)});t&&j.setValue("avatar",a,{shouldValidate:!1})},[j.setValue]);return(0,r.jsxs)(f.Z,{sx:{py:{xs:1,sm:3},px:{xs:2,sm:3},height:"100%"},children:[(0,r.jsx)(Y.RV,{methods:j,children:(0,r.jsxs)(f.Z,{direction:"column",sx:{gap:2,width:"100%"},children:[(0,r.jsx)(Y.sX,{name:"avatar",onDrop:b}),(0,r.jsx)(Y.au,{name:"name",label:m("name"),required:!0}),(0,r.jsx)(Y.au,{name:"email",label:m("email"),disabled:t}),(0,r.jsx)(Y.au,{name:"linkedin",label:"Website link"}),(0,r.jsx)(Y.au,{name:"about",label:m("about"),multiline:!0,rows:3})]})}),(0,r.jsxs)(s.Z,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:"auto",mb:2,pt:2},children:[(0,r.jsx)(n.Z,{onClick:()=>{i(!1)},color:"error",variant:"soft",children:m("actions_cancel")}),(0,r.jsx)(v.Z,{onClick:j.handleSubmit(_),variant:"contained",loading:x||d,children:m("actions_save")})]})]})}function ee(e){let{children:t,courseId:a,defaultValues:n}=e,[i,l]=(0,g.useState)(!1),o=(0,T.q)(),u=()=>{l(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Z,{sx:{display:"flex"},onClick:()=>{l(!0)},children:t}),(0,r.jsxs)(q.Z,{open:i,onClose:u,PaperProps:{sx:{height:"800px",width:{xs:"330px",sm:"350px",md:"450px"}}},children:[(0,r.jsxs)(s.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,r.jsx)(G.Z,{variant:"h5",children:o("actions_create_author")}),(0,r.jsx)(_.Z,{onClick:u,sx:{mr:2},children:(0,r.jsx)(z.Z,{})})]}),(0,r.jsx)(Q,{courseId:a,setFormVisible:u,defaultValues:n,isEdit:!!n})]})]})}var et=a(21201),ea=a(61769),er=a(44023);function en(e){var t;let{author:a,courseId:i}=e,{enqueueSnackbar:l}=(0,$.Ds)(),[o,{isLoading:u}]=O(),c=(0,T.q)();return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(j.Z,{sx:{textAlign:"center"},children:[(0,r.jsxs)(s.Z,{sx:{position:"relative"},children:[(0,r.jsx)(f.Z,{sx:e=>({pt:"50px",background:e.palette.primary.dark})}),(0,r.jsx)(d.h5,{src:"/assets/shape_avatar.svg",sx:{width:144,height:62,zIndex:10,left:0,right:0,bottom:-26,mx:"auto",position:"absolute",color:"background.paper"}}),(0,r.jsx)(et.Z,{alt:a.name,src:null!==(t=a.avatar)&&void 0!==t?t:"",sx:{width:64,height:64,zIndex:11,left:0,right:0,bottom:-32,mx:"auto",position:"absolute"}}),(0,r.jsx)(ea.Z,{component:D(),href:a.linkedin,target:"_blank",sx:{position:"absolute",width:"25px",height:"25px",top:"60px",right:"10px"},children:(0,r.jsx)(er.v,{size:"25px",color:"#0077b5"})})]}),(0,r.jsx)(b.Z,{variant:"subtitle1",sx:{mt:6,mb:.5,textTransform:"capitalize"},children:a.name}),(0,r.jsx)(b.Z,{variant:"subtitle2",sx:{color:"text.secondary",mb:.5},children:a.email}),(0,r.jsx)(b.Z,{variant:"body2",sx:{color:"text.secondary",mb:2},children:a.about}),(0,r.jsx)(Z.Z,{sx:{borderStyle:"dashed"}}),(0,r.jsxs)(s.Z,{sx:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:2,py:2,px:2},children:[(0,r.jsx)(v.Z,{color:"error",variant:"soft",sx:{whiteSpace:"nowrap",textTransform:"none"},loading:u,onClick:()=>{try{a.id&&(o({id:a.id}).unwrap(),l(c("messages_deleted")))}catch(t){var e;l(null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.message,{variant:"error"})}},children:c("actions_delete_author")}),(0,r.jsx)(ee,{courseId:i,defaultValues:a,children:(0,r.jsx)(n.Z,{variant:"soft",color:"success",sx:{width:"100%"},children:c("actions_edit")})})]})]})})}function es(e){let{authors:t,courseId:a}=e;return(0,r.jsx)(f.Z,{gap:2,children:t.map((e,t)=>(0,r.jsx)(en,{author:e,courseId:a},e.id))})}function ei(e){var t;let{courseId:a}=e,{data:s,isLoading:i}=V({course_id:a}),l=(0,T.q)();return(0,r.jsxs)(f.Z,{height:"100%",children:[(null==s?void 0:s.data.length)||i?null:(0,r.jsx)(d.z1,{title:l("messages_no_data")}),i?(0,r.jsx)(S.Z,{variant:"rounded",animation:"wave",sx:{height:"260px"}}):(0,r.jsx)(es,{authors:null!==(t=null==s?void 0:s.data)&&void 0!==t?t:[],courseId:a}),(0,r.jsx)(f.Z,{direction:"row",justifyContent:"flex-end",mt:"auto",children:(0,r.jsx)(ee,{courseId:a,children:(0,r.jsx)(n.Z,{sx:{mt:4,mb:1},variant:"contained",children:l("actions_create_author")})})})]})}var el=a(22867);let eo=e=>U.Ry().shape({name:U.Z_().default("Build AI Agents for Everything"),level:U.Z_().default(el.z5.BEGINNER),price:U.Z_().default("0"),description:U.Z_().default("Learn how to build AI Agents from Scratch"),content_id:U.Z_().default(Math.random().toString(36).substring(2,10)),initial_likes:U.Rx().transform(e=>Number.isNaN(e)?null:e).nullable().default(0),initial_stars:U.Rx().transform(e=>Number.isNaN(e)?null:e).nullable().default(0),initial_enrolled:U.Rx().transform(e=>Number.isNaN(e)?null:e).nullable().default(0),skills:U.IX()}),eu=()=>U.Ry().shape({level:U.nK(),customLevel:U.Z_(),age:U.nK(),customAge:U.Z_()}
1),ed={position:"absolute",right:"5px",top:"5px",zIndex:10,width:"20px",height:"20px",p:0},ec={mt:1,mb:-1,mx:"auto",display:"block",textAlign:"center",color:"text.secondary"},ex={display:"flex",justifyContent:"flex-end",gap:2,pt:2,mt:"auto"},eh={pb:1,pt:2,display:"flex",alignItems:"center",justifyContent:"space-between"},em={display:"flex",flexDirection:"column",py:{xs:1,sm:3},px:{xs:2,sm:3},minHeight:600,height:"100%",overflowY:"auto"};var ep=a(64583),eg=function(e){let{defaultValues:t,handleClose:a,refetch:i,id:l}=e,o=(0,T.q)(),{enqueueSnackbar:u}=(0,d.Ds)(),c={level:(null==t?void 0:t.level)||el.z5.BEGINNER,age:(null==t?void 0:t.age)||el.BK.GRADE_1,customLevel:(null==t?void 0:t.customLevel)||"",customAge:(null==t?void 0:t.customAge)||"",audience:(null==t?void 0:t.audience)||"",for_teachers:(null==t?void 0:t.for_teachers)||""},[x,{isLoading:h}]=(0,R.mG)(),m=(0,X.cI)({resolver:(0,W.X)(eu()),defaultValues:c}),p=async e=>{try{if(!l)return;await x({id:l,...e}).unwrap(),u(o("messages_update_success")),i&&i(),m.reset(),a()}catch(e){var t;u(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.message,{variant:"error"})}},j=m.watch("customLevel"),_=m.watch("customAge");return(0,g.useEffect)(()=>{j&&m.setValue("level",(null==t?void 0:t.level)||el.z5.BEGINNER)},[j]),(0,g.useEffect)(()=>{_&&m.setValue("age",(null==t?void 0:t.age)||el.BK.GRADE_1)},[_]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Y.RV,{methods:m,children:(0,r.jsxs)(f.Z,{gap:3,children:[(0,r.jsxs)(Y.Cc,{native:!0,name:"level",label:o("courses_course_level"),children:[(0,r.jsx)("option",{value:""}),Object.keys(el.z5).map(e=>(0,r.jsx)("option",{value:el.z5[e],children:(0,ep.p)(el.z5[e])},el.z5[e]))]}),(0,r.jsx)(Y.au,{sx:{width:"100%"},name:"customLevel",label:o("courses_course_other_level")}),(0,r.jsxs)(Y.Cc,{native:!0,name:"age",label:o("courses_course_age"),children:[(0,r.jsx)("option",{value:""}),Object.keys(el.BK).map(e=>(0,r.jsx)("option",{value:el.BK[e],children:(0,ep.p)(el.BK[e])},el.BK[e]))]}),(0,r.jsx)(Y.au,{sx:{width:"100%"},name:"customAge",label:o("courses_course_other_other")}),(0,r.jsx)(Y.au,{sx:{width:"100%"},name:"audience",multiline:!0,rows:4,label:o("courses_modal_audience")}),(0,r.jsx)(Y.au,{sx:{width:"100%"},name:"for_teachers",multiline:!0,rows:4,label:o("courses_modal_for_teachers")})]})}),(0,r.jsxs)(s.Z,{sx:ex,children:[(0,r.jsx)(n.Z,{color:"error",variant:"soft",onClick:a,children:o("actions_close")}),(0,r.jsx)(v.Z,{onClick:m.handleSubmit(p),variant:"contained",loading:h,children:o("actions_save")})]})]})},ev=a(80360),ej=a(26609),ef=a(56894),e_=function(e){let{isSuperAdmin:t}=e,a=(0,T.q)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Y.au,{sx:{width:"100%"},name:"name",label:a("courses_course_name")}),(0,r.jsx)(Y.au,{name:"description",label:a("courses_course_description"),multiline:!0,rows:3}),(0,r.jsx)(Y.au,{sx:{width:"100%"},name:"content_id",label:a("courses_content_id"),placeholder:"W1"}),(0,r.jsxs)(Y.Cc,{native:!0,name:"level",label:a("courses_course_level"),children:[(0,r.jsx)("option",{value:""}),Object.keys(el.z5).map(e=>(0,r.jsx)("option",{value:el.z5[e],children:(0,ep.p)(el.z5[e])},el.z5[e]))]}),(0,r.jsxs)(ef.Z,{row:!0,style:{flexWrap:"nowrap"},children:[(0,r.jsx)(n.Z,{variant:"contained",sx:{maxHeight:"56px",bgcolor:"grey.400",color:"grey.800",borderTopRightRadius:0,borderBottomRightRadius:0},disableElevation:!0,children:"$"}),(0,r.jsx)(Y.au,{sx:{"& .MuiOutlinedInput-root":{borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeftColor:"transparent"}},name:"price",label:a("courses_course_price"),type:"number"})]}),(0,r.jsx)(Y.au,{sx:{width:"100%"},name:"initial_likes",label:a("courses_initial_likes"),type:"number"}),(0,r.jsx)(Y.au,{sx:{width:"100%"},name:"initial_stars",label:a("courses_initial_stars"),type:"number"}),(0,r.jsx)(Y.au,{sx:{width:"100%"},name:"initial_enrolled",label:a("courses_initial_enrolled"),type:"number"}),(0,r.jsxs)(f.Z,{direction:"row",flexWrap:"wrap",justifyContent:"space-between",sx:{"& > *":{width:"45%"}},children:[(0,r.jsx)(Y._e,{name:"active",label:a("courses_course_active")}),(0,r.jsx)(Y._e,{name:"public",label:a("public")}),(0,r.jsx)(Y._e,{name:"catalog",label:a("Catalog")}),t?(0,r.jsx)(Y._e,{name:"is_global",label:a("Global")}):null]})]})},eb=function(e){let{defaultValues:t,isEdit:a,id:i,refetch:l,handleClose:o}=e,u=(0,T.q)(),{enqueueSnackbar:c}=(0,d.Ds)(),{user:x}=(0,E.E)(),h=(null==x?void 0:x.role)===k.u.SuperAdmin,[m,p]=(0,g.useState)(null),[j,{isLoading:F}]=(0,R.mG)(),[Z,{isLoading:C}]=(0,R._c)(),[w]=(0,R.oT)(),y=(0,X.cI)({resolver:(0,W.X)(eo(u)),defaultValues:t}),A=async e=>{try{let t=new FormData;if(a&&i)await j({id:i,...e}).unwrap(),m&&(t.append("file",m),await w({id:i,file:t}).unwrap());else{let a=await Z(e).unwrap();m&&(t.append("file",m),await w({id:a.id,file:t}).unwrap())}c(a?u("messages_update_success"):u("messages_create_success")),l&&l(),y.reset(),o()}catch(e){var t;c(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.message,{variant:"error"})}};return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(Y.RV,{methods:y,onSubmit:y.handleSubmit(A),children:[(0,r.jsxs)(f.Z,{gap:3,children:[(0,r.jsxs)(s.Z,{sx:{position:"relative"},children:[m?(0,r.jsx)(_.Z,{sx:ed,onClick:()=>{p(null)},children:(0,r.jsx)(ev.Q,{size:"20px"})}):null,(0,r.jsx)(Y.rd,{name:"course_img",onDrop:e=>{p(e[0])},helperText:(0,r.jsx)(b.Z,{variant:"caption",noWrap:!0,width:"90px",sx:ec,children:null==m?void 0:m.name})}),(0,r.jsx)(ej.Hn,{file:m?URL.createObjectURL(m):null})]}),(0,r.jsx)(e_,{isSuperAdmin:h})]}),(0,r.jsxs)(s.Z,{sx:ex,children:[(0,r.jsx)(n.Z,{color:"error",variant:"soft",onClick:o,children:u("actions_close")}),(0,r.jsx)(v.Z,{type:"submit",variant:"contained",loading:F||C,children:u("actions_save")})]})]})})};function eF(e){let{id:t,isEdit:a=!1,children:n,defaultValues:i,refetch:l}=e,o=(0,T.q)(),[u,c]=(0,g.useState)(!1),[x,h]=(0,g.useState)(0),m=()=>{c(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Z,{onClick:()=>{c(!0)},children:n}),(0,r.jsxs)(q.Z,{open:u,onClose:m,fullWidth:!0,maxWidth:"sm",children:[(0,r.jsxs)(G.Z,{variant:"h5",sx:eh,children:[o(a?"actions_edit":"courses_create"),(0,r.jsx)(_.Z,{onClick:m,children:(0,r.jsx)(z.Z,{})})]}),(0,r.jsxs)(N.Z,{sx:{p:0},children:[a?(0,r.jsx)(s.Z,{sx:{borderBottom:1,borderColor:"divider"},children:(0,r.jsxs)(I.Z,{value:x,onChange:(e,t)=>
1{h(t)},"aria-label":"basic tabs example",sx:{ml:3},children:[(0,r.jsx)(L.Z,{label:o("general"),...eC(0)}),(0,r.jsx)(L.Z,{label:o("details"),...eC(1)}),(0,r.jsx)(L.Z,{label:o("courses_modules"),...eC(2)}),(0,r.jsx)(L.Z,{label:o("courses_authors"),...eC(3)})]})}):null,(0,r.jsx)(eZ,{value:x,index:0,children:(0,r.jsx)(eb,{handleClose:m,id:t,refetch:l,defaultValues:i,isEdit:a})}),(0,r.jsx)(eZ,{value:x,index:1,children:(0,r.jsx)(eg,{handleClose:m,refetch:l,defaultValues:i,id:t,isEdit:a})}),(0,r.jsx)(eZ,{value:x,index:2,children:(0,r.jsx)(d.F,{id:t})}),(0,r.jsx)(eZ,{value:x,index:3,children:(0,r.jsx)(ei,{courseId:t})})]})]})]})}function eZ(e){let{children:t,value:a,index:n,...i}=e;return(0,r.jsx)("div",{role:"tabpanel",hidden:a!==n,id:"simple-tabpanel-".concat(n),"aria-labelledby":"simple-tab-".concat(n),...i,children:a===n&&(0,r.jsx)(s.Z,{sx:em,children:t})})}function eC(e){return{id:"simple-tab-".concat(e),"aria-controls":"simple-tabpanel-".concat(e)}}function ew(e){let{course:t,refetch:a}=e,n=(0,T.q)(),{user:i}=(0,E.E)(),l=(null==i?void 0:i.role)===k.u.Admin,o=(null==i?void 0:i.role)===k.u.SuperAdmin,{enqueueSnackbar:u}=(0,d.Ds)(),[c,x]=(0,g.useState)(!1),[h,p]=(0,g.useState)(!1),[A,z]=(0,g.useState)(null),[N]=(0,R.a_)(),{name:I,level:L,price:q,description:G,active:S,cover:V,is_global:B}=t,M=()=>{x(!0)},O=()=>{z(null)},H=async()=>{p(!0);try{await N({id:t.id}).unwrap(),p(!1),x(!1),u(n("courses_delete_msg")),a&&a()}catch(e){u(e.data.message,{variant:"error"})}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(j.Z,{sx:{textAlign:"center",pb:2,textDecoration:"none",border:"1px solid transparent","&:hover":{borderColor:"grey.400",borderWidth:1,borderStyle:"solid"}},component:D(),href:"".concat(m.tJ.modules.root,"?course_id=").concat(t.id),children:[l&&!B||o?(0,r.jsx)(f.Z,{direction:"row",alignItems:"center",sx:{zIndex:2,top:8,right:8,position:"absolute"},children:(0,r.jsx)(_.Z,{color:A?"inherit":"default",onClick:e=>{e.stopPropagation(),e.preventDefault(),z(e.currentTarget)},children:(0,r.jsx)(C.N,{})})}):"",(0,r.jsx)(s.Z,{sx:{position:"relative",borderBottom:"1px solid rgba(145, 158, 171, 0.24)"},children:(0,r.jsx)(d.Ee,{src:null!=V?V:"/assets/icons/files/ic_folder.svg",alt:V,ratio:"16/9",style:{objectFit:"contain",padding:10}})}),(0,r.jsxs)(s.Z,{sx:{position:"relative"},children:[B?(0,r.jsx)(d.__,{variant:"soft",color:"info",sx:{textTransform:"uppercase",mr:"auto",position:"absolute",top:10,left:10},children:"Global"}):"",(0,r.jsx)(d.__,{variant:"soft",color:S?"success":"error",sx:{textTransform:"uppercase",mr:"auto",position:"absolute",top:10,right:10},children:S?n("active"):n("not_active")}),(0,r.jsx)(b.Z,{variant:"subtitle1",sx:{pt:6,mb:.5},children:I}),(0,r.jsx)(b.Z,{noWrap:!0,textAlign:"center",variant:"body2",sx:{color:"text.secondary",px:3},children:G})]}),(0,r.jsxs)(s.Z,{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",sx:{pt:3},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(b.Z,{variant:"caption",component:"div",sx:{mb:.75,color:"text.disabled"},children:n("level")}),(0,r.jsx)(b.Z,{variant:"subtitle1",textTransform:"capitalize",children:L})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(b.Z,{variant:"caption",component:"div",sx:{mb:.75,color:"text.disabled"},children:n("price")}),(0,r.jsx)(b.Z,{variant:"subtitle1",children:0==+q.substring(1)?"free":q})]})]})]}),(0,r.jsxs)(d.YI,{open:A,onClose:O,arrow:"right-top",sx:{width:160},children:[(0,r.jsx)(eF,{isEdit:!0,id:t.id,defaultValues:{name:t.name,content_id:t.content_id===t.name?"":t.content_id,level:t.level,customLevel:t.customLevel,age:t.age,customAge:t.customAge,price:t.price.substring(1),description:t.description,active:t.active,public:t.public,catalog:t.catalog,skills:t.skills,initial_likes:t.initial_likes,initial_stars:t.initial_stars,initial_enrolled:t.initial_enrolled,audience:t.audience,for_teachers:t.for_teachers,is_global:t.is_global},refetch:a,children:(0,r.jsxs)(F.Z,{children:[(0,r.jsx)(y.L,{}),n("actions_edit")]})}),(0,r.jsx)(Z.Z,{sx:{borderStyle:"dashed"}}),(0,r.jsxs)(F.Z,{onClick:()=>{M(),O()},sx:{color:"error.main"},children:[(0,r.jsx)(w.Y,{}),n("actions_delete")]})]}),(0,r.jsx)(d.QH,{open:c,onClose:()=>{x(!1)},title:n("actions_delete"),content:n("messages_delete_question"),action:(0,r.jsx)(v.Z,{variant:"contained",color:"error",onClick:H,loading:h,children:n("actions_delete")})})]})}var ey=a(72498),eA=a(95611),eD=a(40492),eE=a(88085);function ek(e){var t;let{filters:a,setFilter:n}
1=e,s=(0,T.q)();return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(eE.Z,{spacing:2,sx:{mb:4},alignItems:"center",direction:{xs:"column",sm:"row"},children:(0,r.jsx)(eD.Z,{defaultValue:null!==(t=null==a?void 0:a.name)&&void 0!==t?t:"",sx:{width:{xs:"100%",sm:"100%",md:"260px",lg:"260px"}},onChange:e=>{n("name",e.target.value)},placeholder:s("name"),InputProps:{endAdornment:(0,r.jsx)(eA.Z,{position:"end",sx:{cursor:"pointer"},children:(0,r.jsx)(ey.Z,{})})}})})})}function eR(){return(0,r.jsx)(s.Z,{children:(0,r.jsx)(S.Z,{variant:"rectangular",animation:"wave",sx:{width:"100%",maxWidth:"368px",height:"395px",borderRadius:"16px"}})})}var eT=a(48554),ez=a(45038);function eN(){var e;let t=(0,T.q)(),{themeStretch:a}=(0,d.K$)(),{isAdmin:o}=(0,ez.c)(),{filters:x,setFilter:g}=(0,c.mN)({name:"",school_id:""},c.X9.global),{data:v,isLoading:j,isFetching:f,refetch:_}=(0,h.wR)(x);return j?(0,r.jsx)(eT.Z,{item:(0,r.jsx)(eR,{}),count:c.$X}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u(),{children:(0,r.jsxs)("title",{children:[" ",t("courses")+" | CodeTribe"]})}),(0,r.jsxs)(i.Z,{maxWidth:!a&&"lg",children:[(0,r.jsx)(d.YC,{heading:"",links:[{name:t("home"),href:p.G1.class.root},{name:t("courses"),href:m.tJ.courses.root}],action:o?(0,r.jsx)(eF,{id:"",refetch:_,children:(0,r.jsx)(n.Z,{variant:"contained",startIcon:(0,r.jsx)(l.w,{}),children:t("courses_add")})}):""}),(0,r.jsx)(ek,{filters:x,setFilter:g}),(null==v?void 0:v.data.length)?(0,r.jsx)(d.kP,{hasNextPage:null!==(e=null==v?void 0:v.meta.hasNextPage)&&void 0!==e&&e,onLoadMore:()=>{g("take",Number(x.take)+c.$X)},loading:null!=j?j:f,children:(0,r.jsxs)(s.Z,{sx:{gap:3,display:"grid",gridTemplateColumns:{xs:"repeat(1, 1fr)",sm:"repeat(2, 1fr)",md:"repeat(3, 1fr)"}},children:[o?(0,r.jsx)(r.Fragment,{children:null==v?void 0:v.data.map((e,t)=>(0,r.jsx)(ew,{course:e,refetch:_},t))}):null,f?Array(24).fill(null).map((e,t)=>(0,r.jsx)(eR,{},t)):null]})}):(0,r.jsx)(d.z1,{title:"You have no courses"})]})]})}eN.getLayout=e=>(0,r.jsx)(x.Z,{children:e})},70540:function(e,t,a){"use strict";a.d(t,{kb:function(){return s},vC:function(){return i},wR:function(){return r}});let{useGetAdminCoursesQuery:r,useGetOwnCoursesQuery:n,useGetAdminGlobalCoursesQuery:s,useUpdateAdminGlobalCourseInCatalogByOrgMutation:i}=a(23827).N.injectEndpoints({endpoints:e=>({getAdminCourses:e.query({query:e=>({url:"/course",method:"GET",params:e}),keepUnusedDataFor:0,providesTags:["Courses"]}),getAdminGlobalCourses:e.query({query:e=>({url:"/course/global",method:"GET",params:e}),keepUnusedDataFor:0,providesTags:["Courses"]}),getOwnCourses:e.query({query:e=>({url:"/course/own",method:"GET",params:e}),keepUnusedDataFor:0,providesTags:["Courses"]}),updateAdminGlobalCourseInCatalogByOrg:e.mutation({query:e=>{let{course_id:t,...a}=e;return{url:"/course/catalog/".concat(t),method:"PATCH",body:a}},invalidatesTags:["Courses"]})})})},22867:function(e,t,a){"use strict";var r,n,s,i,l,o;a.d(t,{BK:function(){return r},eb:function(){return s},z5:function(){return n}}),(i=r||(r={})).GRADE_1="grade 1+",i.GRADE_2="grade 2+",i.GRADE_3="grade 3+",i.GRADE_4="grade 4+",i.GRADE_5="grade 5+",i.GRADE_6="grade 6+",i.GRADE_7="grade 7+",i.GRADE_8="grade 8+",i.GRADE_9="grade 9+",i.GRADE_10="grade 10+",i.GRADE_12="grade 11+",i.GRADE_13="grade 12+",i.GRADE_18="18 & up",(l=n||(n={})).ROOKIE="rookie",l.BEGINNER="beginner",l.INTERMEDIATE="intermediate",l.PRO="pro",l.NINJA="ninja",(o=s||(s={})).AUTO="auto-graded",o.MANUAL="manual-graded",o.MIXED="mixed-graded"},80394:function(e,t,a){"use strict";a.d(t,{j:function(){return i}});var r=a(85893),n=a(3314),s=a(84324);function i(){return(0,r.jsxs)(n.Z,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:2,children:[(0,r.jsx)(s.Z,{variant:"rectangular",animation:"wave",sx:{width:"40px",height:"26px",borderRadius:"8px"}}),(0,r.jsx)(s.Z,{variant:"rectangular",animation:"wave",sx:{width:"4px",height:"4px"}}),(0,r.jsx)(s.Z,{variant:"rectangular",animation:"wave",sx:{width:"60px",height:"26px",borderRadius:"8px"}})]})}},96370:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});var r=a(85893),n=a(84324);function s(){return(0,r.jsx)(n.Z,{variant:"rectangular",animation:"wave",sx:{mr:"16px",width:{xs:"100%",sm:"100%",md:"260px",lg:"260px"},height:"56px",borderRadius:"16px",mb:{xs:"16px",sm:"16px",md:"32px"}}})}},48554:function(e,t,a){"use strict";a.d(t,{Z:function(){return x},z:function(){return c}});var r=a(85893),n=a(84324),s=a(88489),i=a(3314),l=a(53145),o=a(8147),u=a(80394),d=a(96370);let c=()=>(0,r.jsx)(n.Z,{variant:"rectangular",animation:"wave",sx:{width:{xs:"100%",sm:"100%",md:"100%",xl:"373px"},height:"124px",borderRadius:"16px"}});function x(e){let{item:t=(0,r.jsx)(c,{}),filter:a=1,count:x=1}=e,{themeStretch:h}=(0,o.K$)();return(0,r.jsxs)(s.Z,{maxWidth:!h&&"lg",children:[(0,r.jsxs)(i.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:"24px"},children:[(0,r.jsx)(u.j,{}),(0,r.jsx)(n.Z,{variant:"rectangular",animation:"wave",sx:{width:"134px",height:"36px",borderRadius:"8px"}})]}),(0,r.jsx)(l.Z,{direction:{xs:"column",sm:"row"},children:Array(a).fill(null).map((e,t)=>(0,r.jsx)(d.Z,{},t+10))}
1),(0,r.jsx)(i.Z,{gap:3,display:"grid",gridTemplateColumns:{xs:"repeat(1, 1fr)",sm:"repeat(2, 1fr)",md:"repeat(3, 1fr)"},children:Array(x).fill(null).map((e,a)=>(0,r.jsx)(i.Z,{children:t},a+18))})]})}},64583:function(e,t,a){"use strict";a.d(t,{p:function(){return r}});let r=e=>e?e.charAt(0).toUpperCase()+e.slice(1):""}},function(e){e.O(0,[3948,4026,4467,9683,2678,7627,7312,3338,8902,3950,9877,5338,5238,7315,2888,9774,179],function(){return e(e.s=30862)}),_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.