1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[55299],{51360:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/offline-course/cutoff",function(){return n(47526)}])},98007:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var s=n(85893),l=n(67294),i=n(50788);function o(e){let{label:t,name:n,value:o,onChange:r,type:a="text",placeholder:c="",required:d=!1,error:u="",maxLength:f=1e4,rows:m=3,className:h="",labelClassName:x="",inputClassName:p="",errorClassName:b="",disabled:g=!1,readOnly:v=!1,icon:y=null,iconPosition:j="left",helperText:_="",autoFocus:N=!1,onBlur:w=null,onFocus:C=null,...k}=e,[E,A]=(0,l.useState)(!1),S="password"===a,O="textarea"===a,Z=e=>{r&&r(e)},F="w-full px-4 py-2 border rounded-lg\nfocus:outline-none\nfocus:ring-2\nfocus:ring-blue-500\nfocus:border-blue-500\ntransition-all duration-200\n".concat(u?"border-red-500":"border-gray-300","\n").concat(g?"bg-gray-100 cursor-not-allowed":"bg-white","\n").concat(y&&"left"===j?"pl-10":"","\n").concat(y&&"right"===j?"pr-10":"","\n").concat(S?"pr-10":"","\n").concat(p);return(0,s.jsxs)("div",{className:"mb-4 ".concat(h),children:[t&&(0,s.jsxs)("label",{htmlFor:n,className:"block text-sm font-medium text-gray-700 mb-2 ".concat(x),children:[t,d&&(0,s.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,s.jsxs)("div",{className:"relative",children:[y&&"left"===j&&(0,s.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,s.jsx)("span",{className:"text-gray-500",children:y})}),O?(0,s.jsx)("textarea",{id:n,name:n,value:o||"",onChange:Z,placeholder:c,rows:m,maxLength:f,disabled:g,readOnly:v,autoFocus:N,onBlur:w,onFocus:C,className:F,...k}):(0,s.jsx)("input",{id:n,name:n,type:S?E?"text":"password":a,value:o||"",onChange:Z,placeholder:c,maxLength:f,disabled:g,readOnly:v,autoFocus:N,onBlur:w,onFocus:C,className:F,...k}),S&&(0,s.jsx)("button",{type:"button",onClick:()=>{A(!E)},className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-500 hover:text-gray-700 focus:outline-none",tabIndex:"-1",children:E?(0,s.jsx)(i.wqE,{size:20}):(0,s.jsx)(i.t2l,{size:20})}),y&&"right"===j&&!S&&(0,s.jsx)("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none",children:(0,s.jsx)("span",{className:"text-gray-500",children:y})})]}),_&&!u&&(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:_}),u&&(0,s.jsx)("p",{className:"mt-1 text-sm text-red-500 ".concat(b),children:u}),f&&o&&(0,s.jsxs)("div",{className:"mt-1 text-xs text-gray-400 text-right",children:[String(o).length,"/",f]})]})}},98198:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var s=n(85893),l=n(5152),i=n.n(l);n(86834);let o=i()(()=>Promise.all([n.e(22937),n.e(71167)]).then(n.t.bind(n,71167,23)),{loadableGenerated:{webpack:()=>[71167]},ssr:!1}),r={toolbar:[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"}],["link","image"],["clean"]]},a=["header","bold","italic","underline","strike","blockquote","list","bullet","link","image"];function c(e){let{label:t,desc:n="",handleBioChange:l}=e;return(0,s.jsxs)("div",{className:"mb-3 mt-3",children:[(0,s.jsx)("label",{className:"block text-[#FF1B1B] font-semibold mb-2",children:t}),(0,s.jsx)(o,{theme:"snow",value:n||"",onChange:l,modules:r,formats:a})]})}},2958:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return r}});var s=n(85893),l=n(41664),i=n.n(l),o=n(11163);function r(){let{university_id:e,course_id:t}=(0,o.useRouter)().query,n=[{label:"Edit (About)",href:"/admin/offline-course/add?course_id=".concat(t,"&university_id=").concat(e),color:"blue"},{label:"Fees",href:"/admin/offline-course/fees?course_id=".concat(t,"&university_id=").concat(e),color:"yellow"},{label:"Eligibility",href:"/admin/offline-course/eligibility?course_id=".concat(t,"&university_id=").concat(e),color:"red"},{label:"Curriculum",href:"/admin/offline-course/curriculum?course_id=".concat(t,"&university_id=").concat(e),color:"lime"},{label:"Admission",href:"/admin/offline-course/admission?course_id=".concat(t,"&university_id=").concat(e),color:"green"},{label:"CutOff",href:"/admin/offline-course/cutoff?course_id=".concat(t,"&university_id=").concat(e),color:"purple"},{label:"Scholarship",href:"/admin/offline-course/scholarship?course_id=".concat(t,"&university_id=").concat(e),color:"teal"},{label:"Placement",href:"/admin/offline-course/Placement?course_id=".concat(t,"&university_id=").concat(e),color:"cyan"},{label:"FAQ",href:"/admin/offline-course/faq?course_id=".concat(t,"&university_id=").concat(e),color:"orange"}];return(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-6",children:[(0,s.jsx)(i(),{href:"/admin/offline-course?course_id=".concat(t,"&university_id=").concat(e),className:"px-3 py-1.5 rounded bg-gray-100 text-gray-700 hover:bg-gray-200 text-sm font-medium",children:"â Back"}),null==n?void 0:n.map(e=>(0,s.jsx)(i(),{href:e.href,className:"px-3 py-1.5 rounded bg-blue-50 text-blue-600 hover:bg-blue-100 text-sm font-medium",children:e.label},e.label))]})}},47526:function(e,t,n){"use strict";n.r(t);var s=n(85893),l=n(67294),i=n(11163),o=n(86501),r=n(15122),a=n(98007),c=n(34291),d=n(2958),u=n(98198),f=n(5152);let m=n.n(f)()(()=>Promise.all([n.e(4220),n.e(78088),n.e(50418),n.e(73824),n.e(5618),n.e(81072),n.e(62735),n.e(91934),n.e(96866),n.e(99081)]).then(n.bind(n,99081)),{loadableGenerated:{webpack:()=>[99081]},ssr:!1,loading:()=>(0,s.jsx)("p",{children:"Loading editor..."})});t.default=function(){var e;let t=(0,i.useRouter)(),{id:n,universityId:f,course_id:h,university_id:x}=t.query,[p,b]=(0,l.useState)(!1),[g,v]=(0,l.useState)(!1),[y,j]=(0,l.useState)(!1),[_,N]=(0,l.useState)({offline_university_id:f||"",title:"",description:"",new_descriptions:[],cutoff_json:[],factors_json:[],cutoff_notes:"",meta_title:"",meta_description:""}),[w,C]=(0,l.useState)({}),k=(e,t,n)=>{let s=[..._.new_descriptions];s[e][t]=n,N(e=>({...e,new_descriptions:s}))},E=e=>{if(_.new_descriptions.length<=1)return;
1let t=_.new_descriptions.filter((t,n)=>n!==e);N(e=>({...e,new_descriptions:t}))},A=e=>{N(t=>({...t,cutoff_json:t.cutoff_json.filter((t,n)=>n!==e)}))},S=(e,t)=>{N(n=>{let s=[...n.cutoff_json];return s[e].heading=t,{...n,cutoff_json:s}})},O=(e,t,n,s)=>{N(l=>{let i=[...l.cutoff_json];return i[e].cutoffs[t][n]=s,{...l,cutoff_json:i}})},Z=e=>{N(t=>{let n=[...t.cutoff_json];return n[e].cutoffs.push({title:"",value:""}),{...t,cutoff_json:n}})},F=(e,t)=>{N(n=>{let s=[...n.cutoff_json],l=s[e];return l.cutoffs.length<=1?(o.default.error("At least one entry is required per section."),n):(l.cutoffs=l.cutoffs.filter((e,n)=>n!==t),{...n,cutoff_json:s})})},q=e=>{let{name:t,value:n}=e.target;N(e=>({...e,[t]:n})),w[t]&&C(e=>({...e,[t]:""}))},B=(e,t)=>{N(n=>({...n,[e]:t})),w[e]&&C(t=>({...t,[e]:""}))};(0,l.useEffect)(()=>{h&&(v(!0),D(h))},[h]);let D=async e=>{j(!0);try{var t,n;let s=new c.default,l=await s.GetOfflineCourseByID(e),i=(null==l?void 0:null===(n=l.data)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.cutoff)||(null==l?void 0:l.data);if(!i){o.default.error("University not found");return}let r=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){}return e},a=r(null==i?void 0:i.cutoff_json);Array.isArray(a)&&0!==a.length||(a=[{heading:"",cutoffs:[{title:"",value:""}]}]),a=a.map(e=>({heading:e.heading||"",cutoffs:Array.isArray(e.cutoffs)&&e.cutoffs.length>0?e.cutoffs:[{title:"",value:""}]}));let d=r(null==i?void 0:i.new_descriptions),u=Array.isArray(d)&&d.length>0?d:[];N({title:i.title||"",description:(null==i?void 0:i.description)||"",new_descriptions:u||[],cutoff_json:a||[],factors_json:r(null==i?void 0:i.factors_json)||[],cutoff_notes:i.cutoff_notes||"",meta_title:i.meta_title||"",meta_description:i.meta_description||""})}catch(e){console.error(e),o.default.error((null==e?void 0:e.message)||"Failed to fetch university")}finally{j(!1)}},T=()=>{var e;let t={};return(null===(e=_.title)||void 0===e?void 0:e.trim())||(t.title="Title is required"),C(t),0===Object.keys(t).length},P=async e=>{if(e.preventDefault(),T()){b(!0);try{let e=new c.default,n={title:_.title||"",description:_.description||"",new_descriptions:_.new_descriptions||[],meta_title:_.meta_title||"",meta_description:_.meta_description||"",cutoff_json:_.cutoff_json||[],cutoff_notes:_.cutoff_notes||""},s=await e.AdminCutOffOfflineCourse(h,n);if(s.status){var t;o.default.success((null==s?void 0:null===(t=s.data)||void 0===t?void 0:t.message)||"Admission saved!")}else o.default.error(s.message||"Operation failed")}catch(e){console.error(e),o.default.error(e.message||"Something went wrong")}finally{b(!1)}}};return y?(0,s.jsx)(r.Z,{children:(0,s.jsx)("div",{className:"min-h-screen p-6 bg-gray-50 flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"}),(0,s.jsx)("p",{className:"mt-4 text-gray-600",children:"Loading cutoff data..."})]})})}):(0,s.jsx)(r.Z,{children:(0,s.jsxs)("div",{className:"min-h-screen p-6 bg-gray-50",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-gray-800 mb-6",children:g?"Edit Cutoff":"Add Cutoff"}),(0,s.jsx)(d.default,{id:n}),(0,s.jsx)(a.Z,{label:"Title",name:"title",value:_.title,onChange:q,placeholder:"Enter cutoff title (e.g., B.Tech Cutoff 2025)",required:!0,error:w.title,maxLength:255}),(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Description"}),(0,s.jsx)(u.Z,{desc:_.description||"",handleBioChange:e=>B("description",e),placeholder:"Enter admission description..."})]}),(0,s.jsxs)("div",{className:"mt-6 border p-4 rounded-lg bg-white shadow-sm",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Multiple Descriptions"}),null==_?void 0:null===(e=_.new_descriptions)||void 0===e?void 0:e.map((e,t)=>(0,s.jsxs)("div",{className:"mb-6 p-3 border rounded bg-gray-50",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,s.jsxs)("span",{className:"font-medium",children:["Description #",t+1
1]}),(0,s.jsx)("button",{type:"button",onClick:()=>E(t),className:"px-3 py-1 bg-red-100 text-red-600 rounded hover:bg-red-200",children:"Remove"})]}),(0,s.jsx)(a.Z,{label:"Title",value:e.title,onChange:e=>k(t,"title",e.target.value),placeholder:"Enter title"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Description"}),(0,s.jsx)(m,{value:e.description||"",onChange:e=>k(t,"description",e),placeholder:"Enter description..."})]})]},t)),(0,s.jsx)("button",{type:"button",onClick:()=>{N(e=>({...e,new_descriptions:[...e.new_descriptions,{title:"",description:""}]}))},className:"px-4 py-2 bg-green-100 text-green-700 rounded hover:bg-green-200",children:"+ Add Description"})]}),(0,s.jsxs)("div",{className:"mt-6 border p-4 rounded-lg bg-white shadow-sm",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Cutoff Details"}),_.cutoff_json.map((e,t)=>(0,s.jsxs)("div",{className:"mb-6 p-4 border rounded bg-gray-50",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,s.jsxs)("span",{className:"font-medium",children:["Section #",t+1]}),(0,s.jsx)("button",{type:"button",onClick:()=>A(t),className:"px-3 py-1 bg-red-100 text-red-600 rounded hover:bg-red-200",children:"Remove Section"})]}),(0,s.jsx)(a.Z,{label:"Cutoff Heading",value:e.heading,onChange:e=>S(t,e.target.value),placeholder:"e.g., Amity Jaipur Cutoff 2026 (Expected)"}),(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Cutoff Entries (Exam-wise)"}),e.cutoffs.map((e,n)=>(0,s.jsxs)("div",{className:"flex items-center gap-4 mb-3",children:[(0,s.jsx)("input",{type:"text",placeholder:"Exam name (e.g., CAT)",value:e.title,onChange:e=>O(t,n,"title",e.target.value),className:"flex-1 px-3 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500"}),(0,s.jsx)("input",{type:"text",placeholder:"Value (e.g., 70 Percentile)",value:e.value,onChange:e=>O(t,n,"value",e.target.value),className:"flex-1 px-3 py-2 border rounded-lg focus:ring-2 focus:ring-blue-500"}),(0,s.jsx)("button",{type:"button",onClick:()=>F(t,n),className:"px-3 py-2 bg-red-100 text-red-600 rounded-lg hover:bg-red-200",children:"Remove"})]},n)),(0,s.jsx)("button",{type:"button",onClick:()=>Z(t),className:"px-4 py-2 bg-green-100 text-green-700 rounded-lg hover:bg-green-200",children:"+ Add Entry"})]})]},t)),(0,s.jsx)("button",{type:"button",onClick:()=>{N(e=>({...e,cutoff_json:[...e.cutoff_json,{heading:"",cutoffs:[{title:"",value:""}]}]}))},className:"px-5 py-2 bg-blue-600 text-white rounded",children:"+ Add Cutoff Section"})]}),(0,s.jsx)("div",{className:"mt-6",children:(0,s.jsx)(a.Z,{label:"Cutoff Notes",name:"cutoff_notes",value:_.cutoff_notes,onChange:q,placeholder:"Additional notes",type:"textarea",rows:3})}),(0,s.jsx)(a.Z,{label:"Meta Title",name:"meta_title",value:_.meta_title,onChange:q,placeholder:"Enter meta title"}),(0,s.jsx)(a.Z,{label:"Meta Description",name:"meta_description",value:_.meta_description,onChange:q,placeholder:"Enter meta description",type:"textarea"}),(0,s.jsxs)("div",{className:"flex justify-end space-x-4 mt-8 pt-6 border-t",children:[(0,s.jsx)("button",{type:"button",onClick:()=>t.back(),className:"px-6 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors",children:"Cancel"}),(0,s.jsx)("button",{type:"button",onClick:P,disabled:p,className:"px-6 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg font-medium shadow-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:p?(0,s.jsxs)("span",{className:"flex items-center",children:[(0,s.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),g?"Updating...":"Saving..."]}):g?"Update Cutoff":"Save Cutoff"})]})]})})}},86834:function(){}},function(e){e.O(0,[64838,76660,13365,60509,56130,34396,92729,41664,63872,77472,34291,15122,92888,49774,40179],function(){return e(e.s=51360)}),_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.