PageSourceSearch

https://www.withleo.ai/_next/static/chunks/6479-0f7b45cc97b2b317.js

js withleo.ai collected 2026-10-05 13:20:19 UTC 11,527 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6479],{58283:function(e,s,t){t.d(s,{Z:function(){return Select}});var l=t(85893),a=t(35079),n=t(44080),o=t(46032),r=t(13840),i=t(67294);function classNames(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return s.filter(Boolean).join(" ")}function Select(e){let{options:s,selected:t,setSelected:c,label:m}=e;return(0,l.jsx)(a.R,{value:t,onChange:c,children:e=>{let{open:c}=e;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.R.Label,{className:"block text-sm font-medium leading-6 text-gray-900 w-full text-left",children:m}),(0,l.jsxs)("div",{className:"relative mt-2",children:[(0,l.jsxs)(a.R.Button,{className:"relative w-full h-10 cursor-default rounded-md bg-white py-1.5 pl-3 pr-10 text-left text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:outline-none focus:ring-2 focus:ring-orange-600 sm:text-sm sm:leading-6",children:[(0,l.jsx)("span",{className:"block truncate",children:null==t?void 0:t.name}),(0,l.jsx)("span",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2",children:(0,l.jsx)(o.Z,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),(0,l.jsx)(n.u,{show:c,as:i.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,l.jsx)(a.R.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",children:null==s?void 0:s.map(e=>(0,l.jsx)(a.R.Option,{className:e=>{let{active:s}=e;return classNames(s?"bg-orange-600 text-white":"text-gray-900","relative cursor-default select-none py-2 pl-8 pr-4")},value:e,children:s=>{let{selected:t,active:a}=s;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:classNames(t?"font-semibold":"font-normal","block truncate"),children:e.name}),t?(0,l.jsx)("span",{className:classNames(a?"text-white":"text-orange-600","absolute inset-y-0 left-0 flex items-center pl-1.5"),children:(0,l.jsx)(r.Z,{className:"h-5 w-5","aria-hidden":"true"})}):null]})}},e.id))})})]})]})}})}},65689:function(e,s,t){t.d(s,{Z:function(){return Spinner}});var l=t(85893);function Spinner(e){let{size:s=6}=e;return(0,l.jsx)("div",{role:"status",children:(0,l.jsxs)("svg",{"aria-hidden":"true",className:"w-".concat(s," h-").concat(s," mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-orange-600"),viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),(0,l.jsx)("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]})})}},76479:function(e,s,t){t.d(s,{Z:function(){return CreateClassModal},k:function(){return p}});var l=t(85893),a=t(58283),n=t(65689),o=t(94518),r=t(83060),i=t(26595),c=t(44080),m=t(42545),d=t(86426),u=t(11163),g=t(67294),h=t(9473),x=t(2806);let p=["https://www.googleapis.com/auth/drive.file","https://www.googleapis.com/auth/classroom.courses.readonly","https://www.googleapis.com/auth/classroom.coursework.students","https://www.googleapis.com/auth/classroom.student-submissions.students.readonly","https://www.googleapis.com/auth/classroom.rosters.readonly","https://www.googleapis.com/auth/documents.readonly","https://www.googleapis.com/auth/classroom.profile.emails","https://www.googleapis.com/auth/presentations.readonly"];function CreateClassModal(e){var s,t,f,w;let{setModalOpen:v,modalOpen:y=!1}=e;(0,u.useRouter)();let j=(0,g.useRef)(null),b=(0,h.v9)(e=>e.user),C=(0,h.I0)(),[N,k]=(0,g.useState)(),[F,S]=(0,g.useState)([]),[Z,T]=(0,g.useState)(!1),[A,R]=(0,g.useState)(!1),[O,D]=(0,g.useState)(""),[P,z]=(0,g.useState)("");(0,g.useEffect)(()=>{var e,s;async function fetchData(){var e;T(!0);let s=await fetch("/api/googleClassroom/getCourses"),t=await s.json();S((null===(e=t.data.courses)||void 0===e?void 0:e.map(e=>({id:e.id,name:e.name})))||[]),T(!1)}(null==b?void 0:null===(s=b.user)||void 0===s?void 0:null===(e=s.googleOAuth)||void 0===e?void 0:e.refreshToken)&&fetchData()},[b]);let G=(0,d.Nq)({onSuccess:async e=>{let s=p.every(s=>e.scope.split(" ").includes(s));if(!s){console.log("missing scopes"),C((0,o.RF)(5e3,"error","Please make sure to select all scopes."));return}let t=await fetch("/api/googleOAuth/exchangeCodeForToken",{method:"POST",body:JSON.stringify({code:e.code})}),l=await t.json();l.error?console.log("error in exchangeResult server endpoint"):C((0,r.Nq)({googleOAuth:l.data.tokens}))},flow:"auth-code",redirect_uri:"https://www.withleo.ai",overrideScope:!1,scope:p.join(" ")});return(0,l.jsx)(c.u.Root,{show:y,as:g.Fragment,children:(0,l.jsxs)(m.V,{as:"div",className:"relative z-10",initialFocus:j,onClose:v,children:[(0,l.jsx)(c.u.Child,{as:g.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,l.jsx)("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})}),(0,l.jsx)("div",{className:"fixed inset-0 z-10 w-screen overflow-y-auto lg:w-[calc(100vw-18rem)] lg:ml-72 lg:mt-0 mt-16",children:(0,l.jsx)("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0",children:(0,l.jsx)(c.u.Child,{as:g.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:(0,l.jsxs)(m.V.Panel,{className:"relative transform overflow-y-scroll roun
1ded-lg bg-white px-4 pb-4 pt-5 text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-[37rem] sm:p-6 no-scrollbar",children:[(null==b?void 0:null===(t=b.user)||void 0===t?void 0:null===(s=t.googleOAuth)||void 0===s?void 0:s.refreshToken)&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{children:(0,l.jsxs)("div",{className:"mt-3 text-center sm:mt-5",children:[(0,l.jsx)(m.V.Title,{as:"h3",className:"text-base font-semibold leading-6 text-gray-900",children:"Select Class to Create Assignment In"}),(0,l.jsx)("div",{className:"my-2",children:(0,l.jsx)("p",{className:"text-sm text-gray-500",children:"Don't worry, this assignment won't be published yet."})}),Z?(0,l.jsxs)("div",{className:"w-full flex flex-col justify-center items-center mt-4",children:[(0,l.jsx)(n.Z,{size:5})," "]}):(0,l.jsx)(a.Z,{options:F,selected:N,setSelected:k,label:"Class"}),(0,l.jsx)("div",{className:"h-3 w-full"}),N&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"text-left",children:(0,l.jsx)(x.Z,{label:"Assignment Name",placeholder:"CS50 Assignment 1",helperText:"",onChange:e=>{D(e)},value:O,onKeyDown:e=>{e.stopPropagation()}})}),(0,l.jsx)("div",{className:"text-left",children:(0,l.jsx)(x.Z,{label:"Assignment Description",placeholder:"Basic history short-answer assignment.",helperText:"",onChange:e=>{z(e)},value:P,onKeyDown:e=>{e.stopPropagation()}})})]}),(0,l.jsx)("div",{className:"h-3 w-full"})]})}),(0,l.jsxs)("div",{className:"mt-5 sm:mt-6 sm:grid sm:grid-flow-row-dense sm:grid-cols-2 sm:gap-3",children:[(0,l.jsx)("button",{type:"button",className:"inline-flex w-full justify-center rounded-md bg-orange-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-orange-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 sm:col-start-2",onClick:async()=>{R(!0);let{success:e,data:s}=await (0,i.Z)("post","/api/googleClassroom/createCourseWork",{courseId:N.id,title:O,description:P});e?C((0,o.RF)(5e3,"success","Assignment created in Google Classroom successfully.")):C((0,o.RF)(5e3,"error","Error creating assignment in Google Classroom.")),R(!1)},children:A?(0,l.jsx)(n.Z,{size:5}):"Create Assignment"}),(0,l.jsx)("button",{type:"button",className:"mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:col-start-1 sm:mt-0",onClick:()=>v(!1),ref:j,children:"Cancel"})]})]}),!(null==b?void 0:null===(w=b.user)||void 0===w?void 0:null===(f=w.googleOAuth)||void 0===f?void 0:f.refreshToken)&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{children:(0,l.jsxs)("div",{className:"mt-3 text-center sm:mt-5",children:[(0,l.jsx)(m.V.Title,{as:"h3",className:"text-base font-semibold leading-6 text-gray-900",children:"Connect to Google Classroom"}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)("p",{className:"text-sm text-gray-500",children:"We'll ask for some permissions to connect your Google Classroom account. Please make sure to select all of the permissions."})})]})}),(0,l.jsxs)("div",{className:"mt-5 sm:mt-6 sm:grid sm:grid-flow-row-dense sm:grid-cols-2 sm:gap-3",children:[(0,l.jsxs)("button",{type:"button",className:"inline-flex w-full justify-center rounded-md bg-orange-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-orange-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 sm:col-start-2",onClick:()=>{G()},children:[(0,l.jsx)("img",{className:"h-5 mr-2",src:"/google-classroom.png"}),"Connect Google Classroom"]}),(0,l.jsx)("button",{type:"button",className:"mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 sm:col-start-1 sm:mt-0",onClick:()=>v(!1),ref:j,children:"Cancel"})]})]})]})})})})]})})}},2806:function(e,s,t){t.d(s,{Z:function(){return InputWithLabel}});
1var l=t(85893);function InputWithLabel(e){let{label:s,placeholder:t,helperText:a,value:n,onChange:o,labelSize:r,onKeyDown:i,required:c,fontWeight:m}=e;return(0,l.jsxs)("div",{className:"w-full",children:[(0,l.jsxs)("label",{htmlFor:s,className:"block text-".concat(null!=r?r:"sm"," font-").concat(m||"medium"," leading-6 text-gray-900"),children:[s," ",c&&(0,l.jsx)("span",{className:"text-xs text-red-600 align-super",children:"*"})]}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)("input",{type:"text",name:s,id:s,className:"block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-orange-600 sm:text-sm sm:leading-6",placeholder:t,"aria-describedby":"".concat(s,"-description"),onChange:e=>{o(e.target.value)},value:n,onKeyDown:e=>{i&&i(e)}})}),(0,l.jsx)("p",{className:"mt-2 text-sm text-gray-500",id:"".concat(s,"-description"),children:a})]})}}}]);

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.