"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[37970],{37970:function(e,i,s){s.r(i),s.d(i,{DEFAULT_STUDENT_SIDEBAR:function(){return w},__N_SSP:function(){return k},default:function(){return C}});var t=s(11527),n=s(56009),r=s.n(n),a=s(57135),o=s(59072),d=s(9970),l=s(56871),c=s(16824),u=s(93071),m=s(21148),_=s(64379),h=s(33389),p=s(35855),g=s(89553),b=s(64388),f=s(78681),x=s(5185),v=s(23683),y=s(50959),j=s(11651),N=s(84796),Z=s(85850),P=s(42760),H=s(76784),S=function(e){var i=e.student_sidebar,s=(0,y.useState)(i),n=s[0],r=s[1],S=(0,y.useState)(!1),k=S[0],w=S[1],C=(0,y.useState)(!1),D=C[0],I=C[1],O=(0,y.useState)(!1),A=O[0],L=O[1],E=(0,o.Z)(m.Z.useForm(),1)[0],F=(0,o.Z)(m.Z.useForm(),1)[0],z=(0,P.C)((function(e){var i,s;return null===(i=e.settingsData)||void 0===i||null===(s=i.global_settings)||void 0===s?void 0:s.product_settings})),B=(0,H.Z)(z,{is_expire_product:"",is_enable_expire_date:""}),J=function(){var e=(0,a.Z)((function(){var e;return(0,l.__generator)(this,(function(i){switch(i.label){case 0:return w(!0),e={key:"student_sidebar",value:JSON.stringify(n)},[4,(0,N.Z)("/teacher/school-setting/update-school-setting-meta","post",e)];case 1:return i.sent(),w(!1),(0,Z.s)("Settings saved successfully"),[2]}}))}));return function(){return e.apply(this,arguments)}}(),M=(0,j.W6)((function(){return(0,t.jsx)(c.Z,{style:{cursor:"grab"}})})),T=function(){var e=(0,a.Z)((function(){var e;return(0,l.__generator)(this,(function(i){switch(i.label){case 0:return I(!0),e={key:"product_settings",value:JSON.stringify(F.getFieldsValue())},[4,(0,N.Z)("/teacher/school-setting/update-school-setting-meta","post",e)];case 1:return i.sent(),(0,Z.s)("Settings saved successfully"),I(!1),[2]}}))}));return function(){return e.apply(this,arguments)}}(),q=function(){var e=(0,a.Z)((function(e){var i,s;return(0,l.__generator)(this,(function(t){switch(t.label){case 0:return i={category:"Custom",id:e.label?e.label.toLowerCase().replace(/\s+/g,"-")+(0,x.Z)():(0,x.Z)(),isHidden:!1,name:e.label,route:e.link,isOpenNewTab:e.is_open_new_tab},L(!0),s={key:"student_sidebar",value:JSON.stringify((0,d.Z)(n).concat([i]))},[4,(0,N.Z)("/teacher/school-setting/update-school-setting-meta","post",s)];case 1:return t.sent(),E.resetFields(),r((function(e){return(0,d.Z)(e).concat([i])})),L(!1),(0,Z.s)("Sidebar added successfully"),[2]}}))}));return function(i){return e.apply(this,arguments)}}(),V=(0,j.W8)((function(e){var i=e.item;e.items,e.setItems;return(0,t.jsxs)("div",{className:"_dis_flex justify-content-between align-itms-center _box1 _pad_12 _mar_b16",children:[(0,t.jsxs)("div",{className:"_dis_flex align-itms-center gap-2",children:[(0,t.jsx)("span",{className:"_cursor_all_scroll",children:(0,t.jsx)(M,{})}),(0,t.jsx)("p",{className:"_inpt_titl _mar_b0",children:i.name})]}),(0,t.jsx)("div",{children:(0,t.jsxs)(h.Z,{direction:"horizontal",children:["Custom"===i.category&&(0,t.jsx)(u.Z,{onClick:function(){return e=i.id,void _.Z.confirm({title:"Are you sure?",okButtonProps:{danger:!0},onOk:(0,a.Z)((function(){var i,s;return(0,l.__generator)(this,(function(t){switch(t.label){case 0:return i=n.filter((function(i){return i.id!==e})),s={key:"student_sidebar",value:JSON.stringify(i)},[4,(0,N.Z)("/teacher/school-setting/update-school-setting-meta","post",s)];case 1:return t.sent(),r(i),[2]}}))}))});var e},className:"pointer"}),(0,t.jsx)(p.Z,{checkedChildren:"Show",unCheckedChildren:"hide",checked:!i.isHidden,disabled:"/profile"===i.route,onChange:function(){r((function(e){return e.map((function(e){return e.route===i.route&&(e.isHidden=!e.isHidden),e}))}))}})]})})]})})),U=(0,j.JN)((function(){return(0,t.jsx)("div",{className:"_siteMnu_itm_r8_list",children:n.map((function(e,i){return(0,t.jsx)(V,{index:i,item:e,items:n,setItems:r},e.route)}))})}));return(0,t.jsxs)("div",{className:"_main_content",children:[(0,t.jsx)("div",{className:"row _mar_b20",children:(0,t.jsx)("div",{className:"col-xl-6 col-lg-6 col-md-12 col-sm-12 mx-auto",children:(0,t.jsxs)("div",{className:"_student_event_book_inner _box1",children:[(0,t.jsx)("div",{className:"_mar_b30 _dis_flex justify-content-between align-items-center flex-wrap",children:(0,t.jsx)("label",{className:"_teacher_event_book_input_label _mar_b10 _inpt_titl",children:(0,t.jsx)("h2",{className:"_titl2",children:"Custom Menu"})})}),(0,t.jsxs)(m.Z,{name:"basic",form:E,style:{display:"flex",gap:20,flexDirection:"column"},initialValues:{is_open_new_tab:!1},onFinish:q,autoComplete:"off",children:[(0,t.jsx)(m.Z.Item,{name:"label",rules:[{required:!0,message:"Please input your label"}],children:(0,t.jsx)(g.Z,{size:"large",placeholder:"Menu Label"})}),(0,t.jsx)(m.Z.Item,{name:"link",rules:[{required:!0,message:"Please input your link!"},{validator:function(e,i,s){i&&!/^(ftp|http|https):\/\/[^ "]+$/.test(i)?s("Please enter a valid URL!"):s()}}],children:(0,t.jsx)(g.Z,{size:"large",placeholder:"Menu Link"})}),(0,t.jsx)(m.Z.Item,{name:"is_open_new_tab",valuePropName:"checked",children:(0,t.jsx)(b.Z,{children:"Open in new tab"})}),(0,t.jsx)(m.Z.Item,{children:(0,t.jsx)(f.Z,{className:"_btn1",type:"primary",htmlType:"submit",loading:A,disabled:A,children:"Create"})})]})]})})}),(0,t.jsx)("div",{className:"row mb-4",children:(0,t.jsx)("div",{className:"col-xl-6 col-lg-6 col-md-12 col-sm-12 mx-auto",children:(0,t.jsxs)("div",{className:"_student_event_book_inner _box1",children:[(0,t.jsxs)("div",{className:"_mar_b30 _dis_flex justify-content-between align-items-center flex-wrap",children:[(0,t.jsx)("label",{className:"_teacher_event_book_input_label _mar_b10 _inpt_titl",children:(0,t.jsx)("h2",{className:"_titl2",children:"Student Product Setting "})}),(0,t.jsx)(f.Z,{loading:D,disabled:D,onClick:T,className:"_btn1",children:"Save"})]}),(0,t.jsxs)(m.Z,{form:F,initialValues:{is_expire_product:null===B||void 0===B?void 0:B.is_expire_product,is_enable_expire_date:null===B||void 0===B?void 0:B.is_enable_expire_date},children:[(0,t.jsx)(m.Z.Item,{name:"is_enable_expire_date",valuePropName:"checked",label:"Show limited access duration",children:(0,t.jsx)(p.Z,{})}),(0,t.jsx)(m.Z.Item,{name:"is_expire_product",valuePropName:"checked",label:"Show expired products",children:(0,t.jsx)(p.Z,{})})]})]})})}),(0,t.jsx)("div",{className:"row",children:(0,t.jsx)("div",{className:"col-xl-6 col-lg-6 col-md-12 col-sm-12 mx-auto",children:(0,t.jsxs)("div",{className:"_student_event_book_inner _box1",children:[(0,t.jsxs)("div",{className:"_mar_b30 _dis_flex justify-content-between align-items-center flex-wrap",children:[(0,t.jsx)("label",{className:"_teacher_event_book_input_label _mar_b10 _inpt_titl",children:(0,t.jsx)("h2",{className:"_titl2",children:"Student Dashboard Sidebar"})}),(0,t.jsx)(f.Z,{loading:k,disabled:k,onClick:J,className:"_btn1",children:"Save"})]}),(0,t.jsx)("div",{children:(0,t.jsx)(U,{onSortEnd:function(e){var i=e.oldIndex,s=e.newIndex;r((0,v.q)(n,i,s))},useDragHandle:!0})})]})})})]})},k=!0,w=[{name:"Dashboard",route:"",isHidden:!1,id:"dashboard",category:"Dashboard"},{name:"Profile",route:"/profile",isHidden:!1,id:"profile",category:"Profile"},{name:"Memberships",route:"/memberships",isHidden:!1,id:"memberships",category:"Purchases"},{name:"Courses",route:"/courses",isHidden:!1,id:"courses",category:"Purchases"},{name:"Bundle Courses",route:"/bundled-courses",isHidden:!1,id:"bundle-courses",category:"Purchases"},{name:"Communities",route:"/communities",isHidden:!1,id:"communities",category:"Purchases"},{name:"Groups",route:"/groups",isHidden:!1,id:"groups",category:"Purchases"},{name:"Digital Products",route:"/digital-products",isHidden:!1,id:"digital-products",category:"Purchases"},{name:"Physical Products",route:"/physical-products",isHidden:!1,id:"physical-products",category:"Purchases"},{name:"Live Products",route:"/live-products",isHidden:!1,id:"live",category:"Purchases"},{name:"Video Library",route:"/video-library?audio=false",isHidden:!1,id:"video-library",category:"Purchases"},{name:"Audio Library",route:"/video-library?audio=true",isHidden:!1,id:"audio-library",category:"Purchases"},{name:"Events",route:"/my-events",isHidden:!1,id:"events",category:"Purchases"},{name:"Appointments",route:"/appointments",isHidden:!1,id:"appointments",category:"Purchases"},{name:"Premium Pages",route:"/premium-pages",isHidden:!1,id:"premium-pages",category:"Purchases"},{name:"Certificates",route:"/certificates",isHidden:!1,id:"certificates",category:"Profile"},{name:"Badges",route:"/badges",isHidden:!1,id:"badges",category:"Profile"},{name:"Order History",route:"/orders",isHidden:!1,id:"order-history",category:"Payments"},{name:"Coin History",route:"/coins",isHidden:!1,id:"coins",category:"Coins"},{name:"Organization Orders",route:"/organization/orders",isHidden:!1,id:"organization-orders",category:"Purchases"},{name:"Subscription",route:"/subscriptions",isHidden:!1,id:"subscriptions",category:"Purchases"},{name:"Affiliate Dashboard",route:"/affiliate-dashboard",isHidden:!1,id:"affiliate-dashboard",category:"Affiliate Dashboard"},{name:"Settings",route:"/setting",isHidden:!1,id:"student-settings",category:"Settings"},{name:"Billing",route:"/billing",isHidden:!1,id:"student-billing",category:"Billing"}],C=function(e){var i=e.student_sidebar;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r(),{children:(0,t.jsx)("title",{children:"Student Dashboard Settings | Admin"})}),(0,t.jsx)("div",{children:(0,t.jsx)(S,{student_sidebar:i})})]})}},23683:function(e,i,s){function t(e,i,s){return function(e,i,s){const t=i<0?e.length+i:i;if(t>=0&&t<e.length){const t=s<0?e.length+s:s,[n]=e.splice(i,1);e.splice(t,0,n)}}(e=[...e],i,s),e}s.d(i,{q:function(){return t}})}}]);