PageSourceSearch

https://nbyula.com/assets/EctsCalculatorContainer-w6agV8Z2.js

js nbyula.com collected 2026-10-06 20:43:25 UTC 14,906 bytes, 2 lines download raw bytes

1import{j as e,Y as ie,B as z,r,L as q,b as O,c as A,A as F,f as w,an as ce,a as ue,bb as de,al as me,I as G}from"./index-QW0Z3Qxf.js";import{P as $}from"./Program-BMQV1GOW.js";import{P as pe}from"./ProgramContainer-YPn3UzD7.js";import{R as _}from"./RadioButton-BEcHN6zD.js";import{c as he}from"./functions-BNk17N_W.js";import{A as fe}from"./Accordion-BAE8Mi4h.js";import{G as be}from"./GPARedirect-7msS4nUv.js";import{u as ge,a as xe,b as ve,P as ye,c as je}from"./useToolLeadCreation-DI5F3efi.js";import"./constants-Dre6kf9O.js";import"./DeleteIcon-DGzZ8evl.js";import"./operations-D2q3sMrH.js";import"./GoogleMapsAutocompleteContainer-By31BhQp.js";import"./react-select-async-creatable.esm-bhnQSzhz.js";import"./useStateManager-7e1e8489.esm-DByOQtpx.js";import"./use-isomorphic-layout-effect.browser.esm-BTBZIb0h.js";import"./useAsync-85924129.esm-BszIiA8C.js";import"./useCreatable-4a2d7323.esm-CljrTJkl.js";import"./index-cm4_pNFt.js";import"./DateComponent-KXm2aR1U.js";import"./react-select.esm-BrU0Fymq.js";import"./TextAreaContainer-M_HQ7Nhp.js";import"./react-textarea-autosize.browser.esm-CTuLfcHi.js";import"./SelectContainer-DpqoU4Gg.js";import"./ArrowIcon-b1xbJvXe.js";import"./lib-CuMiUjfd.js";/* empty css              */import"./LayoutModalV2-DiIdu2lA.js";function H({title:s,onChange:l,value:a,placeholder:n}){return e.jsxs("section",{className:"flex justify-between items-center space-x-2",children:[e.jsx("div",{className:"font-serif",children:e.jsx("h6",{className:"text-base font-bold tracking-tight",children:s})}),e.jsx("div",{className:"w-1/4",children:e.jsx(ie,{value:a,type:"number",placeholder:n,onChange:l})})]})}const Se={"@context":"https://schema.org","@graph":[{"@type":["EducationalOrganization","Organization"],"@id":"https://nbyula.com/#organization",name:"Nbyula",url:"https://nbyula.com",logo:{"@type":"ImageObject","@id":"https://nbyula.com/#logo",url:"https://nbyula.com/logo512.png",caption:"Nbyula",inLanguage:"en-US",width:"512",height:"512"}},{"@type":"WebSite","@id":"https://nbyula.com/#website",url:"https://nbyula.com",name:"Nbyula",publisher:{"@id":"https://nbyula.com/#organization"},inLanguage:"en-US"},{"@type":"ImageObject","@id":"https://cdn.nbyula.com/public/61248146bae79d005e63741d/Frame1045.png",url:"https://cdn.nbyula.com/public/61248146bae79d005e63741d/Frame1045.png",width:"516",height:"516",inLanguage:"en-US"},{"@type":"BreadcrumbList","@id":"https://nbyula.com/s/ects-calculator/#breadcrumb",itemListElement:[{"@type":"ListItem",position:"1",item:{"@id":"https://nbyula.com",name:"Nbyula"}},{"@type":"ListItem",position:"2",item:{"@id":"https://nbyula.com/s/ects-calculator",name:"ECTS Calculator"}}]},{"@type":"Person","@id":"https://nbyula.com/profile/developer/",name:"Developer",url:"https://nbyula.com/profile/developer/",image:{"@type":"ImageObject","@id":"https://cdn.nbyula.com/public/profile/6204dcb00c113a001a4f0bbf/avatar/1644485851062-logo512.png",url:"https://cdn.nbyula.com/public/profile/6204dcb00c113a001a4f0bbf/avatar/1644485851062-logo512.png",caption:"Developer",inLanguage:"en-US"},worksFor:{"@id":"https://nbyula.com/#organization"}},{"@type":"WebPage","@id":"https://nbyula.com/s/ects-calculator/#webpage",url:"https://nbyula.com/s/ects-calculator",name:"ECTS Calculator - Nbyula",datePublished:"2022-02-12T22:47:28+05:30",dateModified:"2022-02-12T22:47:28+05:30",author:{"@id":"https://nbyula.com/profile/developer/"},isPartOf:{"@id":"https://nbyula.com/#website"},primaryImageOfPage:{"@id":"https://cdn.nbyula.com/public/613b4dd9d65eaa00476de724/Frame1044.png"},inLanguage:"en-US",breadcrumb:{"@id":"https://nbyula.com/s/ects-calculator/#breadcrumb"}},{"@type":"BlogPosting",headline:"ECTS Calculator - Nbyula",datePublished:"2022-02-12T22:47:28+05:30",dateModified:"2022-02-12T22:47:28+05:30",author:{"@type":"Person",name:"Developer"},description:"This calculator calculates the equivalent ECTS credits from the number of lecture hours and self study hours spent on a particular subject.",name:"ECTS Calculator - Nbyula","@id":"https://nbyula.com/s/ects-calculator/#schema",isPartOf:{"@id":"https://nbyula.com/s/ects-calculator/#webpage"},publisher:{"@id":"https://nbyula.com/#organization"}
1,image:{"@id":"https://cdn.nbyula.com/public/613b4dd9d65eaa00476de724/Frame1044.png"},inLanguage:"en-US",mainEntityOfPage:{"@id":"https://nbyula.com/s/ects-calculator/#webpage"}}]};function Ce({lectureHours:s,selfStudyHours:l,weeks:a,ectsScore:n,setLectureHours:o,setSelfStudyHours:d,setWeeks:c,calculateEcts:v,slug:i,saveUserScore:f,enableSaveButton:S}){return e.jsxs("section",{className:"flex justify-center",children:[e.jsx("script",{type:"application/ld+json",children:JSON.stringify(Se)}),e.jsxs("section",{className:"flex flex-col items-center px-4 mt-16 space-y-12 max-w-7xl lg:flex-row lg:justify-between lg:px-0 lg:my-16 lg:mx-10 lg:space-y-0 lg:space-x-8 lg:space-x-24",children:[e.jsxs("section",{className:"flex flex-col justify-center space-y-4",children:[e.jsx("h1",{className:"font-serif text-3xl font-extrabold tracking-tight text-secondary",children:"ECTS Credits Calculator"}),e.jsx("p",{className:"font-serif text-base font-medium tracking-tight text-secondary-dark-300",children:"ECTS Credit Calculator This calculator can be used to calculate the equivalent ECTS credits from the number of lecture hours and self study hours spent on a particular subject."})]}),e.jsx("section",{className:"p-8 rounded-2xl border md:p-16 md:w-11/12 w-9/10 drop-shadow-sm filter",children:e.jsxs("section",{className:"space-y-8",children:[e.jsxs("section",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(H,{title:"Lecture Hours/Week",value:s,placeholder:"4",onChange:m=>{m.target.value>=0&&o(m.target.value)}}),e.jsx(H,{title:"Self Study Hours/Week",value:l,placeholder:"4",onChange:m=>{m.target.value>=0&&d(m.target.value)}}),e.jsx(H,{title:"No. of Weeks/Semester",value:a,placeholder:"16",onChange:m=>{m.target.value>=0&&c(m.target.value)}})]}),e.jsxs("div",{className:"flex justify-center items-center space-x-1",children:[e.jsx(z,{size:"responsive-base",label:"Convert",block:!0,disabled:!(s&&l&&a),onClick:v,logImpression:!0,logEventProps:{elementName:"convert-button",eventName:"ects-credits-converted",slug:i,credits:{lectureHours:s,selfStudyHours:l,weeks:a}},customContainerClass:n==null?"w-full":"w-4/5 animate-fade-in"}),n&&n>0&&e.jsx(z,{size:"responsive-base",label:"Save",disabled:!S,variant:"outline-secondary",customContainerClass:"w-1/5 animate-fade-in",onClick:f})]})]}),e.jsx("section",{className:"space-y-6 font-serif text-center",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("h6",{className:"text-sm font-medium tracking-tight text-secondary-dark-100",children:"Equivalent ECTS Credits"}),e.jsx("h4",{className:"text-4xl font-extrabold tracking-tight text-primary",children:n||0})]})})]})})]})]})}function J({heading:s,values:l,setChecked:a,checked:n}){return e.jsxs("div",{className:"flex flex-col space-y-2 font-serif",children:[e.jsx("div",{className:"font-serif font-semibold whitespace-nowrap",children:s}),e.jsx("div",{className:"flex flex-col flex-wrap pl-3 space-y-2 md:flex-nowrap",children:l.map((o,d)=>e.jsx(_,{labelClass:"flex flex-row items-center gap-3 font-serif text-base font-normal text-secondary",id:d,name:s,value:o,checked:n,setChecked:a,onChange:()=>a(o),body:he(o)}))})]})}function Ne({setShowEducationModal:s,isAddNewVisible:l,setIsAddNewVisible:a}){const[n,o]=r.useState(null),[d,c]=r.useState(null);return e.jsx(fe,{heading:"Add Program",onClickAction:()=>{l||(o(null),c(null)),a(!l)},body:e.jsxs("div",{children:[e.jsxs("div",{className:"pb-4 pl-4 space-y-3",children:[e.jsx(J,{heading:"Select Location",values:["domestic","international"],checked:n,setChecked:o}),e.jsx(J,{heading:"Select Stage",values:["Enrolled","Alumni"],checked:d,setChecked:c})]}),n&&d&&e.jsx("div",{className:"pb-3 animate-slide-in",children:e.jsx(pe,{type:n,programStage:d,setShowEducationModal:s,onSuccess:()=>{a(!0)},onFailure:()=>{a(!0)},hidePrograms:!0})})]})})}function ke({selectedProgram:s,setSelectedProgram:l,isAddNewVisible:a,setIsAddNewVisible:n,associatedPrograms:o,domesticPrograms:d,saveToProfile:c,showEducationModal:v,setShowEducationModal:i,programsExists:f}){const S=()=>{var m,x,y,b;return e.jsx("div",{className:"pt-2 space-y-4 animate-fade-in",children:e.jsxs("div",{className:"animate-fade-in",children:[e.jsx("h1",{className:"font-sans text-xl font-semibold text-secondary",children:"Select a Program"}),e.jsxs("div",{className:"px-2",children:[o&&((m=o.alumnus)===null||m===void 0?void 0:m.map((t,g)=>e.jsx(_,{name:"programSelect",labelClass:"flex flex-row items-center gap-3",value:t,id:g,onChange:()=>{l(t)},checked:s,bodyClassName:"w-full",body:e.jsx($,{courseName:t.courseName,startYearMonth:t.intake.date,endYearMonth:t.completion.date,marks:t.marks,marksType:t.marksType})}))),o&&((x=o.enrolled)===null||x===void 0?void 0:x.map((t,g)=>e.jsx(_,{name:"programSelect",labelClass:"flex flex-row items-center gap-3",value:t,id:g,onChange:()=>{l(t)},checked:s,bodyClassName:"w-full",body:e.jsx($,{courseName:t.courseName,startYearMonth:t.intake.date,endYearMonth:t.completion.date,marks:t.marks,marksType:t.marksType})}))),d&&((y=d.alumnus)===null||y===void 0?void 0:y.map((t,g)=>e.jsx(_,{name:"programSelect",labelClass:"flex flex-row items-center gap-3",value:t,id:g,onChange:()=>{l(t)},checked:s,bodyClassName:"w-full",body:e.jsx($,{courseName:t.courseName,startYearMonth:t.intake.date,endYearMonth:t.completion.date,marks:t.marks,marksType:t.marksType})}))),d&&((b=d.enrolled)===null||b===void 0?void 0:b.map((t,g)=>e.jsx(_,{name:"programSelect",labelClass:"flex flex-row items-center gap-3",value:t,id:g,onChange:()=>{l(t)},checked:s,bodyClassName:"w-full",body:e.jsx($,{courseName:t.courseName,startYearMonth:t.intake.date,endYearMonth:t.completion.date,marks:t.marks,marksType:t.marksType})})))]})]})})};return e.jsx(q,{showModal:v,setShowModal:i,showCloseIcon:!0,className:"flex flex-col justify-between p-10 h-full md:w-160",children:e.jsx(q.Body,{children:e.jsxs("div",{className:"relative",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"pb-2 font-sans text-2xl font-bold text-secondary",children:"Add to Profile"}),e.jsx("div",{className:"pb-4",children:e.jsx(Ne,{setShowEducationModal:i,isAddNewVisible:a,setIsAddNewVisible:n})}),a&&f()&&e.jsx("div",{id:"list-program-container",children:S()})]}),a&&f()&&e.jsx("div",{className:"sticky bottom-0 pt-2 bg-white",children:e.jsx(z,{size:"responsive-base",customContainerClass:"w-full",disabled:!s,onClick:()=>c(),children:e.jsx("span",{className:"px-2 font-serif text-base font-semibold tracking-tight",children:"Save Score"})})})]})})})}function Pe({showEducationModal:s,setShowEducationModal:l,validEctsValues:a}){const[n,o]=r.useState(null),[d,c]=r.useState(!0);r.useEffect(()=>{c(!0)},[s]);const v=O(b=>{var t;return(t=b.user)===null||t===void 0?void 0:t.gamePlayerProfile}),i=v.associatedPrograms,f=v.domesticPrograms,S=()=>{w.success("Score Saved successfully!")},m=()=>{w.error("Failed to Save Score!")},x=()=>{const b={programId:n._id,lectureHours:a.lectureHours,selfStudyHours:a.selfStudyHours,weeks:a.weeks};A.post(`${F}/v1/ects/save-score`,b).then(()=>{S()}).catch(()=>{m()}),o(null),l(!s)},y=()=>{var b,t,g,C;return(i==null||(b=i.alumnus)===null||b===void 0?void 0:b.length)!==0||(i==null||(t=i.enrolled)===null||t===void 0?void 0:t.length)!==0||(f==null||(g=f.alumnus)===null||g===void 0?void 0:g.length)!==0||(f==null||(C=f.enrolled)===null||C===void 0?void 0:C.length)!==0};return s&&e.jsx(ke,{selectedProgram:n,setSelectedProgram:o,isAddNewVisible:d,setIsAddNewVisible:c,associatedPrograms:i,domesticPrograms:f,saveToProfile:x,showEducationModal:s,setShowEducationModal:l,programsExists:y})}const we="ECTS Calculator";function tt(){let{url:s}=ce();s=window.location.search?s+window.location.search:s;const l=ue(),[a,n]=r.useState(null),[o,d]=r.useState(null),[c,v]=r.useState(null),[i,f]=r.useState(null),[S,m]=r.useState(null),[x,y]=r.useState(!1),[b,t]=r.useState([]),[g,C]=r.useState(!0),[K,Y]=r.useState(!1),[W,R]=r.useState(!1),Q=je(),[T]=ge(Q),[U,X]=xe(T==null?void 0:T._id),Z="ects-calculator",D=O(u=>u.user.isAuthenticated),N=O(u=>{var p;return(p=u.user)===null||p===void 0?void 0:p.profile}),M=O(u=>{var p;return(p=u.user)===null||p===void 0?void 0:p.gamePlayerProfile}),{ensureLead:ee}=ve(we),te=r.useCallback(()=>!!(N!=null&&N.phone&&N!==null&&N!==void 0&&N.isPhoneVerified),[N]),B=r.useCallback(()=>
1{if(a==0||c==0){w.error("Enter Valid Values");return}if(parseFloat(a)+parseFloat(o)>168){w.error("Lecture and Self Study Hours to large");return}if(parseFloat(c)>26){w.error("Weeks per Semester cannot be greater than 26");return}const u=(a*c+o*c)/30;f({lectureHours:a,selfStudyHours:o,weeks:c}),m(u.toFixed(2)),t(V(M)),re(),ee()},[a,o,c,M]),se=r.useCallback(()=>{W&&(R(!1),setTimeout(()=>B(),300))},[W,B]);r.useEffect(()=>{async function u(){const p=await ae(),h=V(p),j=h==null?void 0:h.filter(k=>b.indexOf(k)<0);if(j!=null&&j.length){C(!1);const k={programId:j[0],lectureHours:i.lectureHours,selfStudyHours:i.selfStudyHours,weeks:i.weeks};A.post(`${F}/v1/ects/save-score`,k).then(()=>{w.success("ECTS Score Saved!"),C(!0),t(h)}).catch(()=>{w.error("Failed to Save Score!"),C(!0),t(h)})}}i&&u()},[x]);async function ae(){return(await A.get(`${F}/v1/game-player/profile/${M.userName}?gameplayerId=${M.gamePlayerId}`)).data}const oe=()=>{y(!x)},le=()=>{if(!D)return l(G.showLoginModal(!0,{redirectTo:s,isLoginDismissible:!0}));if(!te()){R(!0),Y(!0);return}B()},ne=()=>{if(!D)return l(G.showLoginModal(!0,{redirectTo:s,isLoginDismissible:!0}));oe()},re=()=>{if((U==null?void 0:U.state)!==3&&Object.keys(T).length){var u;const p={listing:{...T,category:(u=T.category)===null||u===void 0?void 0:u._id},state:3};A.post(`${F}/v1/gigs/subscription/app`,p).then(({data:h})=>{X(h==null?void 0:h.gigOrder)}).catch(h=>console.error(h))}};function V(u){var p,h,j,k;let I=[];const E=u.associatedPrograms,L=u.domesticPrograms;return E==null||(p=E.enrolled)===null||p===void 0||p.map(P=>{I.push(P._id)}),E==null||(h=E.alumnus)===null||h===void 0||h.map(P=>{I.push(P._id)}),L==null||(j=L.enrolled)===null||j===void 0||j.map(P=>{I.push(P._id)}),L==null||(k=L.alumnus)===null||k===void 0||k.map(P=>{I.push(P._id)}),I}return e.jsxs(de,{eventName:"page-visit",slug:Z,logImpression:!0,children:[e.jsx(Ce,{lectureHours:a,selfStudyHours:o,weeks:c,ectsScore:S,setLectureHours:n,setSelfStudyHours:d,setWeeks:v,calculateEcts:le,saveUserScore:ne,enableSaveButton:g}),e.jsx(Pe,{showEducationModal:x,setShowEducationModal:y,validEctsValues:i}),e.jsx(ye,{showModal:K,setShowModal:Y,onVerified:se,title:"Verify your phone number",subtitle:"We need your phone number to share your personalised ECTS credit report."}),e.jsx(be,{path:"germany-grade-calculator"}),e.jsx(me,{})]})}export{tt as default};
2//# sourceMappingURL=EctsCalculatorContainer-w6agV8Z2.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.