1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2559],{9023:(e,t,r)=>{r.d(t,{Bu:()=>i,TD:()=>x,Wt:()=>u,Xn:()=>m,eA:()=>n,eS:()=>d});let s=["pdf","txt","doc","docx","odt","rtf","ppt","pptx","odp","xls","xlsx","ods","csv"],a=["application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.oasis.opendocument.text","application/rtf","text/rtf","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.oasis.opendocument.presentation","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.spreadsheet","text/csv"],n=[...s.map(e=>".".concat(e)),...a].join(","),i=0x1400000,l=["png","jpg","jpeg","webp"],o=["image/png","image/jpeg","image/webp"],d=[...s.map(e=>".".concat(e)),...l.map(e=>".".concat(e)),...a,...o].join(",");function c(e){var t;let r=(e||"").toLowerCase();return r.includes(".")&&null!==(t=r.split(".").pop())&&void 0!==t?t:""}function u(e){let t=c(e.name);if(s.includes(t))return!0;let r=(e.type||"").split(";",1)[0].trim().toLowerCase();return!!a.includes(r)||r.startsWith("text/")}function m(e){if(u(e))return!0;let t=c(e.name);if(l.includes(t))return!0;let r=(e.type||"").split(";",1)[0].trim().toLowerCase();return!!o.includes(r)||r.startsWith("image/")}function x(e){let t=c(e.name);return!!l.includes(t)||(e.type||"").split(";",1)[0].trim().toLowerCase().startsWith("image/")}},22346:(e,t,r)=>{r(95155),r(12115)},30285:(e,t,r)=>{r.d(t,{$:()=>o,r:()=>l});var s=r(95155);r(12115);var a=r(99708),n=r(74466),i=r(59434);let l=(0,n.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8 [&_svg:not([class*='size-'])]:size-3.5"}},defaultVariants:{variant:"default",size:"default"}});function o(e){let{className:t,variant:r,size:n,asChild:o=!1,...d}=e,c=o?a.DX:"button";return(0,s.jsx)(c,{"data-slot":"button",className:(0,i.cn)(l({variant:r,size:n,className:t})),...d})}},32451:(e,t,r)=>{r.d(t,{A:()=>h});var s=r(95155),a=r(12115),n=r(17652),i=r(90692),l=r(42337),o=r(27213),d=r(57434),c=r(54416),u=r(54165),m=r(9023);let x=["easy","medium","hard"],p=[5,10,15,20],h=e=>{let{open:t,onOpenChange:r,onSubmit:h,submitting:f=!1}=e,b=(0,n.c3)("tutie.exam.upload"),g=(0,a.useRef)(null),[j,v]=(0,a.useState)([]),[w,N]=(0,a.useState)(null),[y,k]=(0,a.useState)("medium"),[C,A]=(0,a.useState)(12),_=()=>{v([]),N(null),k("medium"),A(12),g.current&&(g.current.value="")},E=e=>{e||_(),r(e)},z=()=>{var e;f||null===(e=g.current)||void 0===e||e.click()},I=e=>{if(0!==e.length){for(let t of e)if(!(0,m.Xn)(t)||t.size>m.Bu){N(b("errorInvalidFile"));return}if(e.length>1&&!e.every(e=>(0,m.TD)(e))){N(b("errorMixedSelection"));return}N(null),v(e)}},S=e=>{v(t=>t.filter((t,r)=>r!==e)),N(null),g.current&&(g.current.value="")},F=async()=>{0===j.length||f||await h(j,{difficulty:y,questionCount:C})},L=j.length>0&&!f,D=0===j.length||j.every(e=>(0,m.TD)(e));return(0,s.jsx)(u.lG,{open:t,onOpenChange:E,children:(0,s.jsxs)(u.Cf,{className:"sm:max-w-md p-6 gap-5",children:[(0,s.jsxs)(u.c7,{className:"gap-1 text-left",children:[(0,s.jsx)(u.L3,{className:"text-lg",children:b("title")}),(0,s.jsx)(u.rr,{className:"text-sm",children:b("subtitle")})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground font-medium",children:b("fileLabel")}),(0,s.jsx)("input",{ref:g,type:"file",accept:m.eS,multiple:!0,className:"hidden",onChange:e=>{var t;let r=Array.from(null!==(t=e.target.files)&&void 0!==t?t:[]);if(0===r.length)return;let s=j.length>0&&j.every(e=>(0,m.TD)(e)),a=r.every(e=>(0,m.TD)(e));I(s&&a?[...j,...r]:r)}}),0===j.length?(0,s.jsxs)("button",{type:"button",onClick:z,disabled:f,className:"w-full flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed border-border bg-card px-4 py-6 text-center transition cursor-pointer hover:border-purple-300 dark:hover:border-purple-800/70 hover:shadow-[inset_0_0_24px_rgba(168,85,247,0.12)] dark:hover:shadow-[inset_0_0_24px_rgba(168,85,247,0.16)] disabled:opacity-60 disabled:cursor-default",children:[(0,s.jsx)(l.A,{className:"w-6 h-6 text-muted-foreground"}),(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,s.jsx)("span",{className:"text-sm text-foreground font-medium",children:b("dropzonePrompt")}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:b("dropzoneHint")})]})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[j.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-xl border border-border bg-card px-3 py-2.5",children:[(0,s.jsx)("div",{className:"w-9 h-9 shrink-0 rounded-lg bg-muted/60 dark:bg-card/60 flex items-center justify-center",children:(0,m.TD)(e)?(0,s.jsx)(o.A,{className:"w-4 h-4 text-muted-foreground"}):(0,s.jsx)(d.A,{className:"w-4 h-4 text-muted-foreground"})}),(0,s.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"text-sm font-medium truncate",children:e.name}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[(e.size/1048576).toFixed(1)," MB"]})]}),(0,s.jsx)("button",{type:"button",onClick:()=>S(t),disabled:f,"aria-label":b("fileReplace"),className:"shrink-0 w-7 h-7 rounded-md flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-muted/60 transition cursor-pointer disabled:opacity-60 disabled:cursor-default",children:(0,s.jsx)(c.A,{className:"w-4 h-4"})})]}
1,"".concat(e.name,"-").concat(t,"-").concat(e.lastModified))),D&&(0,s.jsx)("button",{type:"button",onClick:z,disabled:f,className:"self-start text-xs text-purple-600 dark:text-purple-300 hover:underline cursor-pointer disabled:opacity-60 disabled:cursor-default",children:b("addMoreImages")})]}),w&&(0,s.jsx)("span",{className:"text-xs text-red-600 dark:text-red-400",children:w})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground font-medium",children:b("difficultyLabel")}),(0,s.jsx)("div",{className:"inline-flex w-full items-center gap-1 rounded-full bg-muted/40 dark:bg-card/60 border dark:border-border p-1",children:x.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>k(e),disabled:f,className:"flex-1 rounded-full px-3 py-1.5 text-sm font-medium transition cursor-pointer "+(y===e?"bg-background text-foreground shadow-sm border dark:bg-muted dark:border-border":"text-muted-foreground hover:text-foreground")+" disabled:opacity-60 disabled:cursor-default",children:b("easy"===e?"difficultyEasy":"medium"===e?"difficultyMedium":"difficultyHard")},e))})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground font-medium",children:b("countLabel")}),(0,s.jsx)("div",{className:"inline-flex w-full items-center gap-1 rounded-full bg-muted/40 dark:bg-card/60 border dark:border-border p-1",children:p.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>A(e),disabled:f,className:"flex-1 rounded-full px-3 py-1.5 text-sm font-medium transition cursor-pointer "+(C===e?"bg-background text-foreground shadow-sm border dark:bg-muted dark:border-border":"text-muted-foreground hover:text-foreground")+" disabled:opacity-60 disabled:cursor-default",children:e},e))})]}),(0,s.jsxs)(u.Es,{className:"gap-2 sm:gap-2 sm:justify-end pt-1",children:[(0,s.jsx)("button",{type:"button",onClick:()=>E(!1),disabled:f,className:"h-10 px-4 rounded-lg border border-border bg-muted/60 text-foreground text-sm font-medium hover:bg-muted dark:bg-muted/40 dark:hover:bg-muted/60 transition cursor-pointer disabled:opacity-60 disabled:cursor-default",children:b("cancel")}),(0,s.jsx)("button",{type:"button",onClick:F,disabled:!L,className:"h-10 px-5 rounded-lg flex items-center justify-center gap-2 transition cursor-pointer border border-purple-800/70 bg-gradient-to-r from-purple-400 via-purple-600 to-purple-400 text-white text-sm font-medium shadow-[inset_0_-2px_3px_rgba(255,255,255,0.18)] hover:from-purple-500 hover:via-purple-700 hover:to-purple-500 disabled:opacity-60 disabled:cursor-default",children:f?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.A,{size:12,color:"#fff"}),(0,s.jsx)("span",{children:b("submitting")})]}):(0,s.jsx)("span",{children:b("submit")})})]})]})})}},35714:(e,t,r)=>{r.d(t,{A:()=>a});var s=r(12115);function a(e){let t=(0,s.useRef)(null),r=(0,s.useRef)(null),a=(0,s.useRef)(0),n=(0,s.useRef)(e);n.current=e;let i=()=>{null!==t.current&&(cancelAnimationFrame(t.current),t.current=null),null!==r.current&&(clearInterval(r.current),r.current=null)},l=(0,s.useCallback)(()=>{var e;i();let s=Date.now();a.current=12,null===(e=n.current)||void 0===e||e.call(n,12);let l=e=>{let t=e/1e3;return t<4?12+t/4*43:55+(1-Math.exp(-(t-4)/8))*35},o=()=>{let e=Math.min(89.5,l(Date.now()-s));if(Math.abs(e-a.current)>=.05){var r;a.current=e,null===(r=n.current)||void 0===r||r.call(n,e)}t.current=requestAnimationFrame(o)};"function"==typeof requestAnimationFrame?t.current=requestAnimationFrame(o):r.current=setInterval(()=>{var e;let t=Math.min(89.5,l(Date.now()-s));a.current=t,null===(e=n.current)||void 0===e||e.call(n,t)},16)},[]),o=(0,s.useCallback)(()=>{var e;i(),a.current=0,null===(e=n.current)||void 0===e||e.call(n,100)},[]),d=(0,s.useCallback)(()=>{var e;i(),a.current=0,null===(e=n.current)||void 0===e||e.call(n,0)},[]);return(0,s.useEffect)(()=>i,[]),{start:l,finish:o,cancel:d}}},38382:(e,t,r)=>{r.d(t,{CG:()=>o,Fm:()=>m,Qs:()=>h,XW:()=>x,cj:()=>l,h:()=>u,qp:()=>p});var s=r(95155);r(12115);var a=r(15452),n=r(54416),i=r(59434);function l(e){let{...t}=e;return(0,s.jsx)(a.bL,{"data-slot":"sheet",...t})}function o(e){let{...t}=e;return(0,s.jsx)(a.l9,{"data-slot":"sheet-trigger",...t})}function d(e){let{...t}=e;return(0,s.jsx)(a.ZL,{"data-slot":"sheet-portal",...t})}function c(e){let{className:t,...r}=e;return(0,s.jsx)(a.hJ,{"data-slot":"sheet-overlay",className:(0,i.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...r})}function u(e){let{className:t,children:r,side:l="right",...o}=e;return(0,s.jsxs)(d,{children:[(0,s.jsx)(c,{}),(0,s.jsxs)(a.UC,{"data-slot":"sheet-content",className:(0,i.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500","right"===l&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm","left"===l&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm","top"===l&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b","bottom"===l&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...o,children:[r,(0,s.jsxs)(a.bm,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,s.jsx)(n.A,{className:"size-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function m(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"sheet-header",className:(0,i.cn)("flex flex-col gap-1.5 p-4",t),...r})}function x(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"sheet-footer",className:(0,i.cn)("mt-auto flex flex-col gap-2 p-4",t),...r})}function p(e){let{className:t,...r}=e;return(0,s.jsx)(a.hE,{"data-slot":"sheet-title",className:(0,i.cn)("text-foreground font-semibold",t),...r})}function h(e){let{className:t,...r}=e;
1return(0,s.jsx)(a.VY,{"data-slot":"sheet-description",className:(0,i.cn)("text-muted-foreground text-sm",t),...r})}},46102:(e,t,r)=>{r.d(t,{Bc:()=>i,ZI:()=>d,k$:()=>o,m_:()=>l});var s=r(95155);r(12115);var a=r(89613),n=r(59434);function i(e){let{delayDuration:t=0,...r}=e;return(0,s.jsx)(a.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...r})}function l(e){let{...t}=e;return(0,s.jsx)(i,{children:(0,s.jsx)(a.bL,{"data-slot":"tooltip",...t})})}function o(e){let{...t}=e;return(0,s.jsx)(a.l9,{"data-slot":"tooltip-trigger",...t})}function d(e){let{className:t,sideOffset:r=0,children:i,...l}=e;return(0,s.jsx)(a.ZL,{children:(0,s.jsxs)(a.UC,{"data-slot":"tooltip-content",sideOffset:r,className:(0,n.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...l,children:[i,(0,s.jsx)(a.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},54165:(e,t,r)=>{r.d(t,{Cf:()=>u,Es:()=>x,L3:()=>p,c7:()=>m,lG:()=>l,rr:()=>h,zM:()=>o});var s=r(95155);r(12115);var a=r(15452),n=r(54416),i=r(59434);function l(e){let{...t}=e;return(0,s.jsx)(a.bL,{"data-slot":"dialog",...t})}function o(e){let{...t}=e;return(0,s.jsx)(a.l9,{"data-slot":"dialog-trigger",...t})}function d(e){let{...t}=e;return(0,s.jsx)(a.ZL,{"data-slot":"dialog-portal",...t})}function c(e){let{className:t,...r}=e;return(0,s.jsx)(a.hJ,{"data-slot":"dialog-overlay",className:(0,i.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...r})}function u(e){let{className:t,children:r,...l}=e;return(0,s.jsxs)(d,{"data-slot":"dialog-portal",children:[(0,s.jsx)(c,{}),(0,s.jsxs)(a.UC,{"data-slot":"dialog-content",className:(0,i.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...l,children:[r,(0,s.jsxs)(a.bm,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,s.jsx)(n.A,{}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function m(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"dialog-header",className:(0,i.cn)("flex flex-col gap-2 text-center sm:text-left",t),...r})}function x(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"dialog-footer",className:(0,i.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...r})}function p(e){let{className:t,...r}=e;return(0,s.jsx)(a.hE,{"data-slot":"dialog-title",className:(0,i.cn)("text-lg leading-none font-semibold",t),...r})}function h(e){let{className:t,...r}=e;return(0,s.jsx)(a.VY,{"data-slot":"dialog-description",className:(0,i.cn)("text-muted-foreground text-sm",t),...r})}},60605:(e,t,r)=>{r.d(t,{$:()=>c});var s=r(8390),a=r(56104),n=r(50306),i=r(55467),l=r(49509);let o=new Set(["Frontend_App_Visit","Frontend_Note_View","Frontend_Note_Limit_Reached","Frontend_Note_Upload","Frontend_Tutie_Visit","Frontend_Tutie_Interaction","Frontend_Tutie_Limit_Reach","Frontend_Tutie_Upgrade_Clicked","Frontend_Tutie_First_Message","Frontend_Tutie_Chapters_Visit","Frontend_Tutie_Summary_Visit","Frontend_Tutie_Flashcards_Visit","Frontend_Tutie_Quiz_Visit","Frontend_Tutie_Flashcards_End","Frontend_Tutie_Quiz_End"]),d=l.env.NEXT_PUBLIC_MIXPANEL_TOKEN||"";d&&s.A.init(d,{debug:!1});let c=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(o.has(e)&&d)try{let r={...t},l=null===a.j||void 0===a.j?void 0:a.j.currentUser;if(null==l?void 0:l.uid){let e=await (0,i.GT)(l.uid);if("found"===e.status){let s=await (0,n.KF)(e.userId);r={universityId:null==s?void 0:s.universityId,departmentId:null==s?void 0:s.departmentId,userId:e.userId,...t}}}s.A.track(e,r)}catch(t){console.error("logEvent failed for ".concat(e,":"),t)}}},62523:(e,t,r)=>{r.d(t,{p:()=>n});var s=r(95155);r(12115);var a=r(59434);function n(e){let{className:t,type:r,...n}=e;return(0,s.jsx)("input",{type:r,"data-slot":"input",className:(0,a.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}},62559:(e,t,r)=>{r.d(t,{A:()=>ek});var s=r(95155),a=r(12115),n=r(99708),i=r(74466),l=r(22432),o=r(59434),d=r(30285),c=r(62523);r(22346);var u=r(38382),m=r(68856),x=r(46102);let p=a.createContext(null);function h(){let e=a.useContext(p);if(!e)throw Error("useSidebar must be used within a SidebarProvider.");return e}function f(e){let{defaultOpen:t=!0,open:r,onOpenChange:n,className:i,style:l,children:d,...c}=e,u=function(){let[e,t]=a.useState(void 0);return a.useEffect(()=>{let e=window.matchMedia("(max-width: ".concat(767,"px)")),r=()=>{t(window.innerWidth<768)};return e.addEventListener("change",r),t(window.innerWidth<768),()=>e.removeEventListener("change",r)},[]),!!e}
1(),[m,h]=a.useState(!1),[f,b]=a.useState(t),g=null!=r?r:f,j=a.useCallback(e=>{let t="function"==typeof e?e(g):e;n?n(t):b(t),document.cookie="".concat("sidebar_state","=").concat(t,"; path=/; max-age=").concat(604800)},[n,g]),v=a.useCallback(()=>u?h(e=>!e):j(e=>!e),[u,j,h]);a.useEffect(()=>{let e=e=>{"b"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),v())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[v]);let w=g?"expanded":"collapsed",N=a.useMemo(()=>({state:w,open:g,setOpen:j,isMobile:u,openMobile:m,setOpenMobile:h,toggleSidebar:v}),[w,g,j,u,m,h,v]);return(0,s.jsx)(p.Provider,{value:N,children:(0,s.jsx)(x.Bc,{delayDuration:0,children:(0,s.jsx)("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":"16rem","--sidebar-width-icon":"3rem",...l},className:(0,o.cn)("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",i),...c,children:d})})})}function b(e){let{side:t="left",variant:r="sidebar",collapsible:a="offcanvas",className:n,children:i,...l}=e,{isMobile:d,state:c,openMobile:m,setOpenMobile:x}=h();return"none"===a?(0,s.jsx)("div",{"data-slot":"sidebar",className:(0,o.cn)("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...l,children:i}):d?(0,s.jsx)(u.cj,{open:m,onOpenChange:x,...l,children:(0,s.jsxs)(u.h,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":"18rem"},side:t,children:[(0,s.jsxs)(u.Fm,{className:"sr-only",children:[(0,s.jsx)(u.qp,{children:"Sidebar"}),(0,s.jsx)(u.Qs,{children:"Displays the mobile sidebar."})]}),(0,s.jsx)("div",{className:"flex h-full w-full flex-col",children:i})]})}):(0,s.jsxs)("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":c,"data-collapsible":"collapsed"===c?a:"","data-variant":r,"data-side":t,"data-slot":"sidebar",children:[(0,s.jsx)("div",{"data-slot":"sidebar-gap",className:(0,o.cn)("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180","floating"===r||"inset"===r?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),(0,s.jsx)("div",{"data-slot":"sidebar-container",className:(0,o.cn)("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex","left"===t?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]","floating"===r||"inset"===r?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...l,children:(0,s.jsx)("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:i})})]})}function g(e){let{className:t,onClick:r,...a}=e,{toggleSidebar:n}=h();return(0,s.jsxs)(d.$,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:(0,o.cn)("size-7",t),onClick:e=>{null==r||r(e),n()},...a,children:[(0,s.jsx)(l.A,{}),(0,s.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function j(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:(0,o.cn)("flex flex-col gap-2 p-2",t),...r})}function v(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:(0,o.cn)("flex flex-col gap-2 p-2",t),...r})}function w(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:(0,o.cn)("flex min-h-0 flex-1 flex-col gap-2 overflow-auto no-scrollbar group-data-[collapsible=icon]:overflow-hidden",t),...r})}function N(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:(0,o.cn)("relative flex w-full min-w-0 flex-col p-2",t),...r})}function y(e){let{className:t,asChild:r=!1,...a}=e,i=r?n.DX:"div";return(0,s.jsx)(i,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:(0,o.cn)("text-sidebar-foreground
1/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...a})}function k(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:(0,o.cn)("w-full text-sm",t),...r})}function C(e){let{className:t,...r}=e;return(0,s.jsx)("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:(0,o.cn)("flex w-full min-w-0 flex-col gap-1",t),...r})}function A(e){let{className:t,...r}=e;return(0,s.jsx)("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:(0,o.cn)("group/menu-item relative",t),...r})}let _=(0,i.F)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function E(e){let{asChild:t=!1,isActive:r=!1,variant:a="default",size:i="default",tooltip:l,className:d,...c}=e,u=t?n.DX:"button",{isMobile:m,state:p}=h(),f=(0,s.jsx)(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":i,"data-active":r,className:(0,o.cn)(_({variant:a,size:i}),d),...c});return l?("string"==typeof l&&(l={children:l}),(0,s.jsxs)(x.m_,{children:[(0,s.jsx)(x.k$,{asChild:!0,children:f}),(0,s.jsx)(x.ZI,{side:"right",align:"center",hidden:"collapsed"!==p||m,...l})]})):f}var z=r(6874),I=r.n(z),S=r(57340),F=r(50492),L=r(64360),D=r(25273),P=r(12548),U=r(68318),R=r(60183),T=r(92138),B=r(53311),M=r(9428),K=r(81497),V=r(12486),q=r(13052),O=r(5196),W=r(56287),Q=r(62098),$=r(93509),X=r(92498),G=r(57330),Y=r(91394),H=r(35695),Z=r(66789),J=r(76050),ee=r(42019),et=r(35714),er=r(9023),es=r(32451);let ea=e=>{let{progress:t,onLoaded:r}=e;(0,a.useEffect)(()=>{if(t>=100){let e=setTimeout(()=>r(),300);return()=>clearTimeout(e)}},[t,r]);let n=(0,a.useRef)(0),i=0===t,l=0===n.current&&t>0;return(0,a.useEffect)(()=>{n.current=t},[t]),(0,s.jsx)("div",{className:"absolute bottom-0 left-0 w-full h-0.5 bg-transparent z-40 pointer-events-none",children:(0,s.jsx)("div",{className:"h-full bg-purple-600 dark:bg-purple-500",style:{width:"".concat(t,"%"),transition:i||l?"none":"width 100ms linear"}})})};var en=r(56671),ei=r(54165),el=r(4884);function eo(e){let{className:t,...r}=e;return(0,s.jsx)(el.bL,{"data-slot":"switch",className:(0,o.cn)("cursor-pointer peer data-[state=checked]:bg-purple-600 data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:(0,s.jsx)(el.zi,{"data-slot":"switch-thumb",className:(0,o.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-3 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[16px] data-[state=unchecked]:translate-x-[2px]")})})}var ed=r(90692),ec=r(91034);let eu=["ÎÏεÏιÏÏιÏÏα chats (αÏλά ή με Ï
λικÏ) και βιβλιοθήκεÏ","ÎÏεÏιÏÏιÏÏÎµÏ ÎµÏÏÏήÏειÏ, εÏεξηγήÏÎµÎ¹Ï ÎºÎ±Î¹ αÏανÏήÏειÏ","ÎÏεÏιÏÏιÏÏα flashcards, ÏεÏιλήÏÎµÎ¹Ï ÎºÎ±Î¹ quizzes","ÎÎ¹Î²Î»Î¹Î¿Î¸Î®ÎºÎµÏ ÏÏÏÎ¯Ï ÏÏια ÏληÏ"],em={monthly:{unit:"μήνα",costPerUnit:"11.99",costPerDay:"0.40",offer:null},year:{unit:"ÎÏοÏ",costPerUnit:"8.33",costPerDay:"0.27",offer:"30%"}},ex=e=>{let{children:t,open:r,onOpenChange:n}=e,i=(0,H.useRouter)(),{appUser:l,appLoading:o}=(0,ec.A)(),[d,c]=(0,a.useState)(!1),[u]=(0,a.useState)(!1),m=()=>d?em.year:em.monthly;return(0,s.jsxs)(ei.lG,{open:r,onOpenChange:n,children:[t&&(0,s.jsx)(ei.zM,{asChild:!0,children:t}),(0,s.jsxs)(ei.Cf,{className:"bg-background p-7 w-[calc(100vw - 40px)] md:min-w-[600px] dark:bg-slate-950 dar
1k:border-slate-700",children:[(0,s.jsxs)(ei.c7,{children:[(0,s.jsx)(ei.L3,{children:"ÎÎÏνα Ïο διάβαÏμα ÏÏÏÏ Ïο ήξεÏεÏ"}),(0,s.jsxs)(ei.rr,{className:"text-gray-700 dark:text-gray-300",children:["ÎÏÎκÏηÏε ",(0,s.jsx)("span",{className:"bg-purple-100 rounded-sm px-2 font-medium text-black dark:bg-purple-800 dark:text-white",children:"Ïο μÏνο AI ÏοÏ
ÏÏειάζεÏαι..."})," ÎεκλείδÏÏε ÏήμεÏα Ïην ÏλήÏη εμÏειÏία, ÏÏÏÎ¯Ï ÎºÎ±Î½Îνα ÏÏιο!"]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-4 mt-4",children:[(0,s.jsx)("span",{className:"font-medium",children:"ÎεκλείδÏÏε με Ïην ÏÏ
νδÏομή:"}),(0,s.jsx)("div",{className:"flex flex-col gap-3",children:eu.map(e=>(0,s.jsxs)("div",{className:"flex flex-row gap-2 items-center",children:[(0,s.jsx)("div",{className:"w-4 h-4 rounded-full bg-purple-600 flex items-center justify-center",children:(0,s.jsx)(O.A,{className:"w-3 h-3 text-white"})}),(0,s.jsx)("span",{className:"",children:e})]}))})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 mt-5",children:[(0,s.jsxs)("div",{className:"flex flex-row items-center gap-2",children:[(0,s.jsx)(eo,{checked:d,onCheckedChange:()=>{c(!d)}}),(0,s.jsx)("span",{children:"ÎεÏμεÏομαι για Îνα ÏÏÏνο"})]}),(0,s.jsxs)("div",{className:"w-full justify-between flex flex-row items-center",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("div",{className:"flex flex-row items-end",children:[(0,s.jsxs)("span",{className:"font-medium text-3xl",children:["â¬",m().costPerUnit]}),(0,s.jsx)("span",{children:"/μήνα"})]}),(0,s.jsxs)("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:["δηλαδή, â¬",m().costPerDay,"/ημÎÏα"]})]}),m().offer&&(0,s.jsxs)("span",{className:"py-1 px-3 bg-purple-600 border border-purple-700 shadow-md shadow-purple-600/20 rounded-lg text-white font-medium text-sm",children:[m().offer," ÎκÏÏÏÏη"]})]})]}),(0,s.jsx)(ei.Es,{children:(0,s.jsxs)("div",{className:"flex flex-col gap-2 w-full items-center mt-3",children:[(0,s.jsx)("span",{className:"text-sm",children:"ÎÎµÏ Î½Î± Î³Î¯Î½ÎµÎ¹Ï Î¿ κοÏÏ
ÏÎ±Î¯Î¿Ï ÏοιÏηÏÎ®Ï ÏÎ·Ï ÏÏÎ¿Î»Î®Ï ÏοÏ
;"}),(0,s.jsxs)("button",{onClick:()=>{o||(l?i.push("/pricing"):((0,en.o)("Î ÏÎÏει να ÏÏ
Î½Î´ÎµÎ¸ÎµÎ¯Ï ÏÏÏÏα"),i.push("/login")))},disabled:u,className:"disabled:opacity-60 disabled:cursor-default w-full cursor-pointer p-2 bg-gradient-to-r from-purple-600 to-purple-600 via-indigo-600 dark:from-purple-800 dark:to-purple-800 dark:via-indigo-700 dark:border-purple-700 text-white rounded-lg transition hover:opacity-90 flex items-center justify-center gap-2 shadow-md shadow-purple-600/20 hover:shadow-lg hover:shadow-purple-600/50 border border-purple-700",children:["ÎναβάθμιÏε ÏÏÏα",u?(0,s.jsx)(ed.A,{size:10,color:"#fff"}):(0,s.jsx)(T.A,{className:"w-4 h-4"})]})]})})]})]})};var ep=r(50306),eh=r(60605),ef=r(51362),eb=r(66474),eg=r(62525),ej=r(57383),ev=r(17652);let ew=e=>{let{spaces:t,title:r,loading:n,currentUUID:i,onDeleteSpaceClick:l}=e,o=(0,H.useRouter)(),d=(0,H.usePathname)(),c=(0,a.useRef)(null),u=(0,a.useRef)(null),x=(0,ev.c3)("tutie"),{spacesHasMore:p,loadMoreSpaces:h}=(0,ec.A)();(0,a.useEffect)(()=>{if(!p)return;let e=u.current;if(!e)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&h()},{root:e.parentElement,rootMargin:"40px",threshold:0});return t.observe(e),()=>t.disconnect()},[p,h]);let[f,b]=(0,a.useState)(()=>{let e=ej.A.get("libraryExpanded");return"true"===e||"false"!==e&&d.includes("space")});return(0,a.useEffect)(()=>{f&&c.current&&c.current.scrollIntoView({behavior:"smooth",block:"start"})},[f,i]),(0,s.jsxs)(N,{id:"sidebar-space-history",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>{let e=!f;b(e),ej.A.set("libraryExpanded",e?"true":"false",{expires:7})},className:"group/menu-title w-full flex items-center justify-between text-left cursor-pointer","aria-expanded":f,children:[(0,s.jsx)(y,{asChild:!0,children:(0,s.jsx)("span",{className:"group-hover/menu-title:underline",children:x("libraries")})}),(0,s.jsx)(eb.A,{className:"".concat(f?"":"-rotate-90"," w-4 h-4 mr-2 text-muted-foreground transition-transform")})]}),(0,s.jsx)(k,{children:(0,s.jsx)("div",{className:"relative overflow-auto transition-all ".concat(f?"max-h-24":"max-h-0"),children:(0,s.jsxs)(C,{className:"pl-4",children:[n?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.E,{className:"h-6 w-full rounded-md"}),(0,s.jsx)(m.E,{className:"h-6 w-full rounded-md"}),(0,s.jsx)(m.E,{className:"h-6 w-full rounded-md"})]}):t&&t.length>0?t.map(e=>{let t=e.uuid===i,a=t?r||"ÎÎα Îιβλιοθήκη":e.title||"ÎÎα Îιβλιοθήκη",n=a.length>25?a.substring(0,22)+"...":a;return(0,s.jsxs)(A,{className:"relative group/menu-row",children:[(0,s.jsx)("div",{ref:t?c:null,children:(0,s.jsx)(E,{size:"sm",isActive:t,onClick:()=>{o.push("/tutie/space/".concat(e.uuid))},className:"cursor-pointer pr-8 transition-colors duration-200",children:(0,s.jsx)("span",{children:n})})}),(0,s.jsx)("button",{className:"cursor-pointer flex items-center justify-center absolute top-1/2 right-2 -translate-y-1/2 opacity-0 group-hover/menu-row:opacity-100 focus-visible:opacity-100 transition-opacity duration-150","aria-label":x("layout.delete"),onClick:t=>{l(t,e.uuid)},children:(0,s.jsx)(eg.A,{className:"w-4 h-4 text-muted-foreground hover:text-foreground transition-colors"})})]},e.uuid)}):(0,s.jsx)("span",{className:"text-sm text-gray-400 pl-1 py-1",children:x("layout.noSpaces")}
1),p&&(0,s.jsx)("div",{ref:u,"aria-hidden":!0,className:"h-1 w-full"})]})})})]})},eN=e=>{let{title:t,loading:r,currentUUID:n,onDeleteChatClick:i}=e,l=(0,H.useRouter)(),o=(0,H.usePathname)(),d=(0,a.useRef)(null),c=(0,ev.c3)("tutie"),{chats:u,chatsHasMore:x,loadMoreChats:p}=(0,ec.A)(),h=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(!x)return;let e=h.current;if(!e)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&p()},{root:e.parentElement,rootMargin:"40px",threshold:0});return t.observe(e),()=>t.disconnect()},[x,p]);let[f,b]=(0,a.useState)(()=>{let e=ej.A.get("historyExpanded");return"true"===e||"false"!==e&&(o.includes("chat")||o.includes("resource"))});return(0,a.useEffect)(()=>{f&&d.current&&d.current.scrollIntoView({behavior:"smooth",block:"start"})},[f,n]),(0,s.jsxs)(N,{id:"sidebar-chat-history",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>{let e=!f;b(e),ej.A.set("historyExpanded",e?"true":"false",{expires:7})},className:"group/menu-title w-full flex items-center justify-between text-left cursor-pointer","aria-expanded":f,children:[(0,s.jsx)(y,{asChild:!0,children:(0,s.jsx)("span",{className:"group-hover/menu-title:underline",children:c("layout.chatHistory")})}),(0,s.jsx)(eb.A,{className:"".concat(f?"":"-rotate-90"," w-4 h-4 mr-2 text-muted-foreground transition-transform")})]}),(0,s.jsx)(k,{children:(0,s.jsx)("div",{className:"relative overflow-auto transition-all ".concat(f?"max-h-24":"max-h-0"),children:(0,s.jsxs)(C,{className:"pl-4",children:[r?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.E,{className:"h-6 w-full rounded-md"}),(0,s.jsx)(m.E,{className:"h-6 w-full rounded-md"}),(0,s.jsx)(m.E,{className:"h-6 w-full rounded-md"})]}):u&&u.length>0?u.filter(e=>e.uuid).map(e=>{let r=e.uuid===n,a=r?t||c("layout.newChat"):e.title||c("layout.newChat"),o=a.length>25?a.substring(0,22)+"...":a;return(0,s.jsxs)(A,{className:"relative group/menu-row",children:[(0,s.jsx)("div",{ref:r?d:null,children:(0,s.jsx)(E,{size:"sm",isActive:r,onClick:()=>{l.push("/tutie/".concat("simple"===e.type?"chat":"resource","/").concat(e.uuid))},className:"cursor-pointer pr-8 transition-colors duration-200",children:(0,s.jsx)("span",{children:o})})}),(0,s.jsx)("button",{className:"cursor-pointer flex items-center justify-center absolute top-1/2 right-2 -translate-y-1/2 opacity-0 group-hover/menu-row:opacity-100 focus-visible:opacity-100 transition-opacity duration-150","aria-label":c("layout.delete"),onClick:t=>{i(t,e.uuid)},children:(0,s.jsx)(eg.A,{className:"w-4 h-4 text-muted-foreground hover:text-foreground transition-colors"})})]},e.uuid)}):(0,s.jsx)("span",{className:"text-sm text-gray-400 pl-1 py-1",children:c("layout.noChats")}),x&&(0,s.jsx)("div",{ref:h,"aria-hidden":!0,className:"h-1 w-full"})]})})})]})},ey=e=>{let{exams:t,title:r,loading:n,currentUUID:i,onDeleteExamClick:l}=e,o=(0,H.useRouter)(),d=(0,H.usePathname)(),c=(0,a.useRef)(null),u=(0,a.useRef)(null),x=(0,ev.c3)("tutie"),{examsHasMore:p,loadMoreExams:h}=(0,ec.A)();(0,a.useEffect)(()=>{if(!p)return;let e=u.current;if(!e)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&h()},{root:e.parentElement,rootMargin:"40px",threshold:0});return t.observe(e),()=>t.disconnect()},[p,h]);let[f,b]=(0,a.useState)(()=>{let e=ej.A.get("examExpanded");return"true"===e||"false"!==e&&d.includes("exam")});return(0,a.useEffect)(()=>{f&&c.current&&c.current.scrollIntoView({behavior:"smooth",block:"start"})},[f,i]),(0,s.jsxs)(N,{id:"sidebar-exam-history",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>{let e=!f;b(e),ej.A.set("examExpanded",e?"true":"false",{expires:7})},className:"group/menu-title w-full flex items-center justify-between text-left cursor-pointer","aria-expanded":f,children:[(0,s.jsx)(y,{asChild:!0,children:(0,s.jsx)("span",{className:"group-hover/menu-title:underline",children:x("layout.exams")})}),(0,s.jsx)(eb.A,{className:"".concat(f?"":"-rotate-90"," w-4 h-4 mr-2 text-muted-foreground transition-transform")})]}),(0,s.jsx)(k,{children:(0,s.jsx)("div",{className:"relative overflow-auto transition-all ".concat(f?"max-h-24":"max-h-0"),children:(0,s.jsxs)(C,{className:"pl-4",children:[n?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.E,{className:"h-6 w-full rounded-md"}),(0,s.jsx)(m.E,{className:"h-6 w-full rounded-md"}),(0,s.jsx)(m.E,{className:"h-6 w-full rounded-md"})]}):t&&t.length>0?t.map(e=>{let t=e.uuid===i,a=t?r||x("layout.newExam"):e.title||x("layout.newExam"),n=a.length>25?a.substring(0,22)+"...":a;return(0,s.jsxs)(A,{className:"relative group/menu-row",children:[(0,s.jsx)("div",{ref:t?c:null,children:(0,s.jsx)(E,{size:"sm",isActive:t,onClick:()=>{o.push("/tutie/exam/".concat(e.uuid))},className:"cursor-pointer pr-8 transition-colors duration-200",children:(0,s.jsx)("span",{className:"truncate",children:n})})}),(0,s.jsx)("button",{className:"cursor-pointer flex items-center justify-center absolute top-1/2 right-2 -translate-y-1/2 opacity-0 group-hover/menu-row:opacity-100 focus-visible:opacity-100 transition-opacity duration-150","aria-label":x("layout.delete"),onClick:t=>{l(t,e.uuid)},children:(0,s.jsx)(eg.A,{className:"w-4 h-4 text-muted-foreground hover:text-foreground transition-colors"})})]},e.uuid)}):(0,s.jsx)("span",{className:"text-sm text-gray-400 pl-1 py-1",children:x("layout.noExams")}
1),p&&(0,s.jsx)("div",{ref:u,"aria-hidden":!0,className:"h-1 w-full"})]})})})]})},ek=e=>{let{progressBarValue:t,onLoaded:r,children:n,pricingDialogOpen:i,onPricingDialogOpenChange:l,onProgressBarChange:o}=e,d=(0,ev.c3)("tutie"),x=(0,ev.c3)("common"),p=(0,H.useRouter)(),h=(0,H.usePathname)(),k=(0,et.A)(o),[_,z]=(0,a.useState)(""),[ei,el]=(0,a.useState)(!0),[eo,eu]=(0,a.useState)(""),em=(0,a.useRef)(null),[eb,eg]=(0,a.useState)(!1),[ej,ek]=(0,a.useState)(!1),[eC,eA]=(0,a.useState)(""),[e_,eE]=(0,a.useState)(""),[ez,eI]=(0,a.useState)(!1),eS=(0,ec.A)(e=>e.appUser),eF=(0,ec.A)(e=>e.appLoading),eL=(0,ec.A)(e=>e.chats),eD=(0,ec.A)(e=>e.spaces),eP=(0,ec.A)(e=>e.limits);(0,ec.A)(e=>e.refreshUser);let eU=(0,ec.A)(e=>e.addChat),eR=(0,ec.A)(e=>e.addSpace),eT=(0,ec.A)(e=>e.removeChat),eB=(0,ec.A)(e=>e.removeSpace),eM=(0,ec.A)(e=>e.examSessions),eK=(0,ec.A)(e=>e.addExam),eV=(0,ec.A)(e=>e.removeExam),[eq,eO]=(0,a.useState)(!0);(0,a.useEffect)(()=>{(async()=>{var e;if(!eS)return;let t=await (0,ep.$z)(eS.id);eI((null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.subscriptionPlan)==="BASIC")})()},[eS]),(0,a.useEffect)(()=>{var e,t,r;if(eF)return;let s="",a="",n="home";if(h.includes("/exam/")){let e=h.split("/");a=e[e.length-1],n="exam"}else if(h.includes("chat")||h.includes("resource")){let e=h.split("/");a=e[e.length-1],n="chat"}else if(h.includes("space")){let e=h.split("/");a=e[e.length-1],n="space"}if("chat"===n){let t=eL.find(e=>e.uuid===a);t&&(s=null!==(e=t.title)&&void 0!==e?e:d("layout.newChat"))}else if("space"===n){let e=eD.find(e=>e.uuid===a);e&&(s=null!==(t=e.title)&&void 0!==t?t:d("layout.newSpace"))}else if("exam"===n){let e=eM.find(e=>e.uuid===a);e&&(s=null!==(r=e.title)&&void 0!==r?r:d("layout.newExam"))}z(a),eA(null!=s?s:""),eE(null!=s?s:"")},[eF,h,eL,eD,eM,d]);let eW=()=>{p.push("/login")},eQ=async(e,t)=>{e.preventDefault(),k.start(),await (0,Z._e)(t),eT(t),k.finish(),(0,en.o)("Î ÏÏ
νομιλία διαγÏάÏηκε με εÏιÏÏ
Ïία"),(h.includes("/chat/".concat(t))||h.includes("/resource/".concat(t)))&&p.push("/tutie")},e$=async(e,t)=>{if(e.preventDefault(),k.start(),!await (0,ee.cN)(t)){k.finish(),en.o.error("Îεν μÏοÏÎÏαμε να διαγÏάÏοÏ
με Ïην βιβλιοθήκη");return}eB(t),k.finish(),(0,en.o)("Πβιβλιοθήκη διαγÏάÏηκε με εÏιÏÏ
Ïία"),h.includes("/space/".concat(t))&&p.push("/tutie")},eX=e=>{eE(e.target.value)},eG=async e=>{"Enter"===e.key&&await eY()},eY=async()=>{if(!ej){ek(!0);return}if(e_.length<6){(0,en.o)("Î ÏίÏÎ»Î¿Ï ÏÏÎÏει να ÎÏει ÏοÏ
λάÏιÏÏον 6 ÏαÏακÏήÏεÏ");return}499===(h.includes("space")?await (0,ee.S1)(_,e_):await (0,Z.YP)(_,e_))?((0,en.o)("Î¥ÏήÏξε κάÏοιο ÏÏάλμα καÏά Ïην αλλαγή ÏοÏ
ÏίÏλοÏ
"),eE(eC)):(0,en.o)("Î ÏίÏÎ»Î¿Ï Î¬Î»Î»Î±Î¾Îµ με εÏιÏÏ
Ïία"),ek(!1)},eH=async()=>{if(eF)return;if(await (0,eh.$)("Frontend_Tutie_Interaction",{action:"Create Library"}),eS&&eS.id){if(!eS.subscriptionPlan||"FREE"===eS.subscriptionPlan){await (0,eh.$)("Frontend_Tutie_Limit_Reach",{action:"Create Library"}),en.o.error("Îεν μÏοÏÎµÎ¯Ï Î½Î± δημιοÏ
ÏγήÏÎµÎ¹Ï Î²Î¹Î²Î»Î¹Î¿Î¸Î®ÎºÎ· ÏÏο αÏÎ»Ï Ïλάνο",{description:"Îάνε αναβάθμιÏη για να αÏολαÏÏÎµÎ¹Ï Ïην αÏεÏιÏÏιÏÏη εμÏειÏία"});return}}else{eW();return}eu("library"),(0,en.o)("ΣοÏ
δημιοÏ
ÏγοÏμε μια νÎα βιβλιοθήκη!");let e="";for(let t=1;t<99;t++){let r=!0;e=d("library")+" "+t.toString();for(let t=0;t<eD.length;t++)if(eD[t].title===e){r=!1;break}if(r)break}let t=await (0,ee.bz)(e);if(!t||"number"!=typeof t.id){eu(""),en.o.error("Îεν μÏοÏÎÏαμε να δημιοÏ
ÏγήÏοÏ
με Ïη βιβλιοθήκη.");return}eR({created_at:t.createdAt,id:t.id,title:e,uuid:t.uuid,updated_at:t.createdAt}),p.push("/tutie/space/".concat(t.uuid))},eZ=()=>{if(!eF){if(!eS||!eS.id){eW();return}em.current&&em.current.click()}},eJ=async e=>{var t;let r=null===(t=e.target.files)||void 0===t?void 0:t[0];if(r)if(await (0,eh.$)("Frontend_Tutie_Interaction",{action:"Create Resource Chat"}),(0,er.Wt)(r)&&r.size<=er.Bu){eO(!0),eu("resource"),k.start(),(0,en.o)("ΣοÏ
ÏÏοεÏοιμάζοÏ
με Ïο study session!");let e=await (0,Z.hP)(r);if(999===e){eO(!1),eu(""),k.finish(),await (0,eh.$)("Frontend_Tutie_Limit_Reach",{action:"Create Resource Chat"}),en.o.error("ÎεÏÎÏαÏÎµÏ Ïα ημεÏήÏιά ÏοÏ
ÏÏια",{description:"Îάνε αναβάθμιÏη για να αÏολαÏÏÎµÎ¹Ï Ïην αÏεÏιÏÏιÏÏη εμÏειÏία"});return}if(500===e||!e||"object"!=typeof e){eO(!1),eu(""),k.finish(),en.o.error("Îεν μÏοÏÎÏαμε να ξεκινήÏοÏ
με Ïην ÏÏ
νομιλία.");return}let t=(0,Z.mG)(e);k.finish(),t?(eU(t),p.push("/tutie/resource/".concat(t.uuid))):(eO(!1),eu(""),en.o.error("Îεν μÏοÏÎÏαμε να ξεκινήÏοÏ
με Ïην ÏÏ
νομιλία."))}else(0,en.o)("Îη ÎγκÏ
Ïο αÏÏείο",{description:"Îη Ï
ÏοÏÏηÏιζÏÎ¼ÎµÎ½Î¿Ï ÏÏÏÎ¿Ï Î±ÏÏείοÏ
ή μÎÎ³ÎµÎ¸Î¿Ï ÏÎ¬Î½Ï ÏÏν 20
1MB!"})},e0=()=>{if(!eF){if(!eS||!eS.id){eW();return}eg(!0)}},e1=async(e,t)=>{await (0,eh.$)("Frontend_Tutie_Interaction",{action:"Create Exam Session"}),eO(!0),eu("exam"),k.start(),(0,en.o)("ΣοÏ
ÏÏοεÏοιμάζοÏ
με Ïο διαγÏνιÏμα!");let r=await (0,J.UY)(e,{difficulty:t.difficulty,questionCount:t.questionCount});if(999===r){eO(!1),eu(""),k.finish(),eg(!1),await (0,eh.$)("Frontend_Tutie_Limit_Reach",{action:"Create Exam Session"}),en.o.error("ÎεÏÎÏαÏÎµÏ Ïα ημεÏήÏιά ÏοÏ
ÏÏια",{description:"Îάνε αναβάθμιÏη για να αÏολαÏÏÎµÎ¹Ï Ïην αÏεÏιÏÏιÏÏη εμÏειÏία"});return}if(!r){eO(!1),eu(""),k.finish(),en.o.error("Îεν μÏοÏÎÏαμε να δημιοÏ
ÏγήÏοÏ
με Ïο διαγÏνιÏμα.");return}eO(!1),eu(""),eK({examSessionId:r.examSessionId,uuid:r.uuid,title:r.title,submitted:!1,createdAt:r.createdAt}),k.finish(),eg(!1),p.push("/tutie/exam/".concat(r.uuid))},e4=async(e,t)=>{if(e.preventDefault(),k.start(),!await (0,J.TC)(t)){k.finish(),en.o.error("Îεν μÏοÏÎÏαμε να διαγÏάÏοÏ
με Ïο διαγÏνιÏμα");return}eV(t),k.finish(),(0,en.o)("Το διαγÏνιÏμα διαγÏάÏηκε με εÏιÏÏ
Ïία"),h.includes("/exam/".concat(t))&&p.push("/tutie")},{theme:e5,setTheme:e2}=(0,ef.D)(),e6=()=>{e2("dark"===e5?"light":"dark")};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("input",{type:"file",ref:em,style:{display:"none"},onChange:eJ,accept:er.eA}),(0,s.jsx)(es.A,{open:eb,onOpenChange:eg,onSubmit:e1,submitting:eq&&"exam"===eo}),(0,s.jsx)("div",{className:"hidden md:block",children:(0,s.jsx)(f,{open:ei,onOpenChange:()=>{el(!ei)},children:(0,s.jsxs)("div",{className:"flex h-screen w-screen overflow-hidden",children:[(0,s.jsxs)(b,{id:"sidebar",className:"sm:block dark:border-border",children:[(0,s.jsx)(j,{className:"dark:bg-background",children:(0,s.jsxs)("div",{className:"flex justify-between items-center py-2 px-2",children:[(0,s.jsx)("div",{className:"flex justify-center items-center gap-4",children:(0,s.jsx)(I(),{href:"/tutie",className:"hidden md:block",children:(0,s.jsx)("img",{src:"/images/uninote-logo.png",alt:"Tutie",className:"w-8 h-8 hover:scale-110 transition"})})}),ei&&(0,s.jsx)(g,{className:"text-muted-foreground hover:bg-muted hover:text-foreground dark:hover:bg-muted/60 cursor-pointer transition"})]})}),(0,s.jsxs)(w,{className:"dark:bg-background flex flex-col gap-0",children:[(0,s.jsxs)(N,{children:[(0,s.jsx)(y,{children:d("layout.main")}),(0,s.jsxs)(C,{children:[(0,s.jsx)(A,{children:(0,s.jsx)(I(),{href:"/tutie",children:(0,s.jsxs)(E,{className:"".concat(h.endsWith("/tutie")?"bg-accent dark:bg-muted font-medium":""," text-sm transition cursor-pointer hover:bg-muted dark:hover:bg-muted/60"),children:[(0,s.jsx)(S.A,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:d("layout.home")})]})})}),(0,s.jsx)(A,{children:(0,s.jsxs)(E,{onClick:eZ,disabled:""!==eo,className:"text-sm disabled:opacity-60 cursor-pointer dark:hover:bg-muted/60 transition",children:["resource"===eo?(0,s.jsx)(ed.A,{size:10,color:"#000"}):(0,s.jsx)(F.A,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:d("layout.uploadPDF")})]})}),(0,s.jsx)(A,{children:(0,s.jsxs)(E,{onClick:eH,disabled:""!==eo,className:"text-sm disabled:opacity-60 cursor-pointer dark:hover:bg-muted/60 transition",children:["library"===eo?(0,s.jsx)(ed.A,{size:10,color:"#000"}):(0,s.jsx)(L.A,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:d("layout.createLibrary")})]})}),(0,s.jsx)(A,{children:(0,s.jsxs)(E,{onClick:e0,disabled:""!==eo,className:"text-sm disabled:opacity-60 cursor-pointer dark:hover:bg-muted/60 transition",children:["exam"===eo?(0,s.jsx)(ed.A,{size:10,color:"#000"}):(0,s.jsx)(D.A,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:d("layout.solveExam")})]})})]})]}),(0,s.jsxs)(N,{children:[(0,s.jsx)(y,{children:d("layout.resources")}),(0,s.jsxs)(C,{children:[(0,s.jsx)(A,{children:(0,s.jsx)(I(),{href:"/tutie/unihub",children:(0,s.jsxs)(E,{className:"".concat(h.includes("/tutie/unihub")?"bg-accent dark:bg-muted font-medium":""," text-sm transition cursor-pointer hover:bg-muted dark:hover:bg-muted/60"),
1children:[(0,s.jsx)(P.A,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:d("layout.unihub")})]})})}),(0,s.jsx)(A,{children:(0,s.jsx)(I(),{href:"/tutie/my-notes",children:(0,s.jsxs)(E,{className:"".concat(h.includes("/tutie/my-notes")?"bg-accent dark:bg-muted font-medium":""," text-sm transition cursor-pointer hover:bg-muted dark:hover:bg-muted/60"),children:[(0,s.jsx)(U.A,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:d("layout.myNotes")})]})})})]})]}),(0,s.jsx)(eN,{chats:eL,title:e_,loading:eF,currentUUID:_,onDeleteChatClick:eQ}),(0,s.jsx)(ew,{spaces:eD,title:e_,loading:eF,currentUUID:_,onDeleteSpaceClick:e$}),(0,s.jsx)(ey,{exams:eM,title:e_,loading:eF,currentUUID:_,onDeleteExamClick:e4})]}),(0,s.jsxs)(v,{className:"dark:bg-background",children:[(0,s.jsx)("a",{href:"https://docs.google.com/forms/d/e/1FAIpQLSeWsEojCVbLIxHjCA93kRSunXhQPCbYy2798cQLJKPLKdFYkQ/viewform",target:"_blank",rel:"noopener noreferrer",children:(0,s.jsxs)("button",{className:"w-full flex items-center justify-center gap-2 rounded-lg bg-muted/40 hover:bg-muted dark:bg-card/60 dark:hover:bg-muted transition p-1 cursor-pointer text-sm border",children:[(0,s.jsx)(R.A,{className:"w-4 h-4"}),d("layout.giveFeedback"),(0,s.jsx)(T.A,{className:"w-4 h-4"})]})}),eF?(0,s.jsx)(m.E,{className:"w-full h-12"}):eS?(0,s.jsx)("div",{role:"button",tabIndex:0,onClick:()=>{p.push("/tutie/profile")},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),p.push("/tutie/profile"))},className:"w-full rounded-xl bg-muted/40 dark:bg-card/60 border dark:border-border p-2 flex flex-col gap-1 cursor-pointer hover:bg-muted dark:hover:bg-muted/80 transition",children:(0,s.jsxs)("div",{className:"flex-col justify-start items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1 mb-1",children:[(0,s.jsx)("div",{className:"border rounded-full h-6 w-6 flex items-center justify-center bg-background border-border",children:"BASIC"===eS.subscriptionPlan||ez?(0,s.jsx)(B.A,{className:"w-3 h-3"}):(0,s.jsx)(M.A,{className:"w-3 h-3"})}),(0,s.jsx)("span",{className:"text-sm text-primary font-medium dark:text-gray-300",children:"BASIC"===eS.subscriptionPlan||ez?"Pro":"Basic"})]}),"FREE"===eS.subscriptionPlan&&(0,s.jsxs)("button",{className:"flex items-center gap-1 text-xs cursor-pointer hover:opacity-80 transition",onClick:e=>{e.stopPropagation(),p.push("/pricing")},children:[(0,s.jsx)(B.A,{className:"w-3 h-3"}),"Get Pro"]})]}),eP&&(0,s.jsxs)("div",{className:"flex flex-col p-2 mb-1 border-dashed border dark:border-border rounded-lg bg-background/40 dark:bg-background/40",children:[(0,s.jsx)("span",{className:"text-xs mb-1",children:"Daily Limits"}),(0,s.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(K.A,{className:"w-3 h-3"}),(0,s.jsx)("span",{children:"Chats"})]}),(0,s.jsxs)("span",{children:[eP.dailyChatUsed,"/",eP.dailyChatLimit]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(V.A,{className:"w-3 h-3"}),(0,s.jsx)("span",{children:"Messages"})]}),(0,s.jsxs)("span",{children:[eP.dailyMessageUsed,"/",eP.dailyMessageLimit]})]})]}),(0,s.jsxs)("div",{className:"flex flex-row items-center gap-1 hover:cursor-pointer hover:opacity-80 transition",onClick:()=>{p.push("/tutie/profile")},children:[(0,s.jsxs)(Y.eu,{className:"w-4 h-4 border",children:[(0,s.jsx)(Y.BK,{src:eS.profileImageUrl,className:"object-cover"}),(0,s.jsx)(Y.q5,{className:"text-xs",children:eS.username?eS.username.charAt(0).toUpperCase():"U"})]}),(0,s.jsxs)("span",{className:"text-sm font-medium",children:["@",eS.username&&eS.username.length>16?eS.username.substring(0,13)+"...":eS.username]})]})]})}):(0,s.jsx)(I(),{href:"/login",children:(0,s.jsxs)("button",{className:"cursor-pointer w-full py-2 shadow-sm border rounded-lg bg-background flex items-center justify-center gap-1 hover:bg-muted dark:bg-card dark:border-border dark:hover:bg-muted transition",children:[x("connect"),(0,s.jsx)(q.A,{className:"w-4 h-4"})]})})]})]}),(0,s.jsxs)("div",{className:"flex flex-col flex-1 overflow-hidden",children:[(0,s.jsxs)("header",{className:"relative flex items-center justify-center border-b px-6 py-2 dark:bg-background dark:border-border",children:[(0,s.jsx)(ea,{progress:t,onLoaded:r}),(0,s.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",id:"chat-title",children:[!ei&&(0,s.jsx)(g,{className:"text-muted-foreground hover:bg-muted hover:text-foreground dark:hover:bg-muted/60 cursor-pointer transition"}),(()=>{let e,t=h.includes("chat")||h.includes("space")||h.includes("resource")||h.includes("/exam/");
1if(t&&eF)return(0,s.jsx)(m.E,{className:"h-6 w-56"});if(t&&ej)return(0,s.jsx)(c.p,{placeholder:d("layout.title"),className:"font-semibold text-lg h-8 w-80 px-2 border-0 bg-muted/40 dark:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring/30 transition-colors",value:e_,maxLength:80,onChange:eX,onKeyDown:eG,autoFocus:!0});let r=e=>e.length>60?e.substring(0,59)+"â¦":e;return e=t?(null===eC||""===eC)&&(""===e_||null===e_)?d("layout.newChat"):r(eC===e_?eC:e_):h.includes("/tutie/unihub")?d("layout.unihub"):h.includes("/tutie/my-notes")?d("layout.myNotes"):h.includes("/tutie/profile")?d("layout.profile"):d("layout.home"),(0,s.jsx)("h1",{className:"font-semibold text-lg truncate",children:e})})(),!eF&&(h.includes("chat")||h.includes("space")||h.includes("resource")||h.includes("/exam/"))&&(0,s.jsx)("button",{onClick:eY,className:"text-muted-foreground hover:bg-muted hover:text-foreground dark:hover:bg-muted/60 p-2 rounded-lg transition cursor-pointer shrink-0","aria-label":ej?"Save title":"Edit title",children:ej?(0,s.jsx)(O.A,{className:"w-4 h-4"}):(0,s.jsx)(W.A,{className:"w-4 h-4"})})]}),(0,s.jsx)("div",{className:"flex flex-row items-center gap-4",children:eF?(0,s.jsx)(m.E,{className:"w-40 h-11"}):eS&&"BASIC"===eS.subscriptionPlan||ez?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{className:"cursor-pointer hover:bg-muted dark:hover:bg-muted/60 rounded-md p-1 md:p-2",onClick:e6,children:"light"===e5?(0,s.jsx)(Q.A,{className:"w-4 h-4"}):(0,s.jsx)($.A,{className:"w-4 h-4"})}),(0,s.jsx)("div",{className:"relative h-11",children:(0,s.jsxs)("button",{onClick:()=>{p.push("/tutie/profile")},className:"cursor-pointer",children:[(0,s.jsxs)(Y.eu,{className:"border-2 border-border w-10 h-10",children:[(0,s.jsx)(Y.BK,{src:null==eS?void 0:eS.profileImageUrl,className:"object-cover"}),(0,s.jsx)(Y.q5,{className:"bg-muted text-foreground",children:"UNI"})]}),(null==eS?void 0:eS.subscriptionPlan)==="BASIC"&&(0,s.jsxs)("span",{className:"flex items-center gap-0.5 text-[10px] absolute bottom-0 left-[50%] translate-x-[-50%] bg-gradient-to-r from-purple-700 to-purple-600 text-white px-2 rounded-sm",children:[(0,s.jsx)(X.A,{className:"w-1.5 h-1.5 text-white fill-white"}),"PRO"]})]})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{className:"cursor-pointer hover:bg-muted dark:hover:bg-muted/60 rounded-md p-1 md:p-2",onClick:e6,children:"light"===e5?(0,s.jsx)(Q.A,{className:"w-4 h-4"}):(0,s.jsx)($.A,{className:"w-4 h-4"})}),(0,s.jsx)(ex,{open:i,onOpenChange:l}),eS?(0,s.jsx)("button",{onClick:()=>{p.push("/pricing")},className:"cursor-pointer flex items-center justify-center gap-2 h-10 px-5 rounded-lg border border-purple-800/70 bg-gradient-to-r from-purple-400 via-purple-600 to-purple-400 text-white font-medium shadow-[inset_0_-2px_3px_rgba(255,255,255,0.18)] hover:from-purple-500 hover:via-purple-700 hover:to-purple-500 transition",children:(0,s.jsx)("span",{children:x("upgrade")})}):(0,s.jsxs)("button",{onClick:()=>{p.push("/login")},className:"cursor-pointer flex items-center justify-center gap-2 h-10 px-5 rounded-lg border border-purple-800/70 bg-gradient-to-r from-purple-400 via-purple-600 to-purple-400 text-white font-medium shadow-[inset_0_-2px_3px_rgba(255,255,255,0.18)] hover:from-purple-500 hover:via-purple-700 hover:to-purple-500 transition",children:[(0,s.jsx)("span",{children:x("connect")}),(0,s.jsx)(q.A,{className:"w-4 h-4"})]})]})})]})]}),(0,s.jsx)("main",{className:"flex-1 overflow-auto dark:bg-background",children:n})]})]})})}),(0,s.jsx)("div",{className:"md:hidden",children:(0,s.jsxs)("div",{className:"flex flex-col flex-1 overflow-hidden",children:[(0,s.jsxs)("header",{className:"relative flex items-center justify-between border-b dark:border-border px-6 py-1.5 dark:bg-background dark:border-border fixed top-0 left-0 right-0 z-[100]",children:[(0,s.jsx)(ea,{progress:t,onLoaded:r}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)(u.cj,{children:[(0,s.jsx)("div",{className:"flex items-center gap-2",children:(0,s.jsx)(u.CG,{asChild:!0,children:(0,s.jsx)(G.A,{className:"w-4 h-4 text-foreground"})})}),(0,s.jsxs)(u.h,{side:"left",className:"dark:bg-background dark:border-border gap-0 z-[200]",children:[(0,s.jsxs)(u.Fm,{className:"flex flex-row justify-start items-center gap-2",children:[(0,s.jsx)(I(),{href:"/tutie",children:(0,s.jsx)("img",{src:"/images/uninote-logo.png",alt:"Tutie",className:"min-w-8 min-h-8 max-w-8 max-h-8"})}),(0,s.jsx)(u.CG,{asChild:!0,children:(0,s.jsx)(G.A,{className:"w-4 h-4 text-foreground"})})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 px-4 py-4",children:[(0,s.jsx)("h3",{className:"text-sm text-gray-700 dark:text-gray-300",children:d("layout.main")}),(0,s.jsxs)("button",{onClick:()=>{p.push("/tutie")},className:"".concat(h.endsWith("/tutie")?"bg-accent dark:bg-muted font-medium":""," flex items-center gap-2 transition rounded-md py-1 px-2 cursor-pointer text-sm hover:bg-muted dark:hover:bg-muted/60"),
1children:[(0,s.jsx)(S.A,{className:"w-4 h-4"}),d("layout.home")]}),(0,s.jsxs)("button",{onClick:eZ,className:"flex items-center gap-2 transition rounded-lg p-1 cursor-pointer text-sm rounded-md py-1 px-2",children:[(0,s.jsx)(F.A,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:d("layout.uploadPDF")})]}),(0,s.jsxs)("button",{onClick:eH,className:"flex items-center gap-2 transition rounded-lg p-1 cursor-pointer text-sm rounded-md py-1 px-2",children:[(0,s.jsx)(L.A,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:d("layout.createLibrary")})]}),(0,s.jsxs)("button",{onClick:e0,className:"flex items-center gap-2 transition rounded-lg p-1 cursor-pointer text-sm rounded-md py-1 px-2",children:[(0,s.jsx)(D.A,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:d("layout.solveExam")})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 px-4 pb-4",children:[(0,s.jsx)("h3",{className:"text-sm text-gray-700 dark:text-gray-300",children:d("layout.resources")}),(0,s.jsxs)("button",{onClick:()=>{p.push("/tutie/unihub")},className:"".concat(h.includes("/tutie/unihub")?"bg-accent dark:bg-muted font-medium":""," flex items-center gap-2 transition rounded-md py-1 px-2 cursor-pointer text-sm hover:bg-muted dark:hover:bg-muted/60"),children:[(0,s.jsx)(P.A,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:d("layout.unihub")})]}),(0,s.jsxs)("button",{onClick:()=>{p.push("/tutie/my-notes")},className:"".concat(h.includes("/tutie/my-notes")?"bg-accent dark:bg-muted font-medium":""," flex items-center gap-2 transition rounded-md py-1 px-2 cursor-pointer text-sm hover:bg-muted dark:hover:bg-muted/60"),children:[(0,s.jsx)(U.A,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:d("layout.myNotes")})]})]}),(0,s.jsx)(eN,{chats:eL,title:e_,loading:eF,currentUUID:_,onDeleteChatClick:eQ}),(0,s.jsx)(ew,{spaces:eD,title:e_,loading:eF,currentUUID:_,onDeleteSpaceClick:e$}),(0,s.jsx)(ey,{exams:eM,title:e_,loading:eF,currentUUID:_,onDeleteExamClick:e4}),(0,s.jsxs)(u.XW,{className:"flex flex-col md:flex-col gap-4 pb-4",children:[(0,s.jsx)("a",{href:"https://docs.google.com/forms/d/e/1FAIpQLSeWsEojCVbLIxHjCA93kRSunXhQPCbYy2798cQLJKPLKdFYkQ/viewform",target:"_blank",rel:"noopener noreferrer",children:(0,s.jsxs)("button",{className:"w-full flex items-center justify-center gap-2 rounded-lg bg-muted/40 hover:bg-muted dark:bg-card/60 dark:hover:bg-muted transition p-1 cursor-pointer text-sm border",children:[(0,s.jsx)(R.A,{className:"w-4 h-4"}),d("layout.giveFeedback"),(0,s.jsx)(T.A,{className:"w-4 h-4"})]})}),eS?(0,s.jsx)("div",{role:"button",tabIndex:0,onClick:()=>{p.push("/tutie/profile")},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),p.push("/tutie/profile"))},className:"w-full rounded-xl bg-muted/40 dark:bg-card/60 border dark:border-border p-2 flex flex-col gap-1 cursor-pointer hover:bg-muted dark:hover:bg-muted/80 transition",children:(0,s.jsxs)("div",{className:"flex justify-start items-center gap-2",children:[(0,s.jsx)("div",{className:"max-w-10 max-h-10 p-2 rounded-full border flex items-center justify-center bg-background dark:bg-background dark:border-border",children:(0,s.jsx)(B.A,{className:"text-muted-foreground max-w-4 max-h-4"})}),(0,s.jsxs)("div",{className:"flex flex-col gap-0.5 w-full",children:[(0,s.jsx)("span",{className:"text-xs text-primary font-medium dark:text-gray-300",children:(null==eS?void 0:eS.subscriptionPlan)==="BASIC"||ez?"Pro":"Basic"}),(0,s.jsxs)("div",{className:"flex flex-row items-center gap-1",children:[(0,s.jsxs)(Y.eu,{className:"w-4 h-4 border",children:[(0,s.jsx)(Y.BK,{src:null==eS?void 0:eS.profileImageUrl,className:"object-cover"}),(0,s.jsx)(Y.q5,{className:"text-xs",children:(null==eS?void 0:eS.username)?eS.username.charAt(0).toUpperCase():"U"})]}),(0,s.jsxs)("span",{className:"text-sm dark:text-gray-300 font-medium",children:["@",(null==eS?void 0:eS.username)&&eS.username.length>16?eS.username.substring(0,13)+"...":null==eS?void 0:eS.username]})]})]})]})}):(0,s.jsx)(I(),{href:"/login",children:(0,s.jsxs)("button",{className:"w-full py-1 shadow-sm border rounded-lg bg-background flex items-center justify-center gap-1 hover:bg-muted transition dark:bg-card dark:border-border dark:hover:bg-muted",children:[x("connect"),(0,s.jsx)(q.A,{className:"w-4 h-4"})]})})]})]})]}),(0,s.jsx)("div",{className:"flex flex-row items-center min-w-0",children:(()=>{let e;if(h.includes("chat")||h.includes("space")||h.includes("resource")){let t=(e_||eC||"").trim();e=""===t?d("layout.newChat"):t}else e=h.includes("/tutie/unihub")?d("layout.unihub"):h.includes("/tutie/my-notes")?d("layout.myNotes"):h.includes("/tutie/profile")?d("layout.profile"):d("layout.home");return(0,s.jsx)("h1",{className:"text-base font-semibold truncate max-w-[180px]",children:e.length>24?e.substring(0,21)+"â¦":e})})()})]}),eF?(0,s.jsx)(m.E,{className:"w-24 h-11"}):eS&&"BASIC"===eS.subscriptionPlan||ez?(0,s.jsxs)("div",{className:"flex flex-row items-center gap-4",children:[(0,s.jsx)("button",{className:"cursor-pointer hover:bg-muted dark:hover:bg-muted/60 rounded-md p-1 md:p-2",onClick:e6,children:"light"===e5?(0,s.jsx)(Q.A,{className:"w-4 h-4"}):(0,s.jsx)($.A,{className:"w-4 h-4"})}),(0,s.jsx)("div",{className:"relative h-11",children:(0,s.jsxs)("button",{onClick:()=>{p.push("/tutie/profile")},className:"cursor-pointer",children:[(0,s.jsxs)(Y.eu,{className:"border-2 border-border w-10 h-10",children:[(0,s.jsx)(Y.BK,{src:null==eS?void 0:eS.profileImageUrl,className:"object-cover"}),(0,s.jsx)(Y.q5,{className:"bg-muted text-foreground",children:"UNI"})]}),(null==eS?void 0:eS.subscriptionPlan)==="BASIC"&&(0,s.jsxs)("span",{className:"flex items-center gap-0.5 text-[10px] absolute bottom-0 left-[50%] translate-x-[-50%] bg-gradient-to-r from-purple-700 to-purple-600 text-white px-2 rounded-sm",children:[(0,s.jsx)(X.A,{className:"w-1.5 h-1.5 text-white fill-white"}),"PRO"]})]})})]}):(0,s.jsxs)("div",{className:"flex flex-row items-center gap-2",children:[(0,s.jsx)("button",{className:"cursor-pointer hover:bg-muted dark:hover:bg-muted/60 rounded-md p-1 md:p-2",onClick:e6,children:"light"===e5?(0,s.jsx)(Q.A,{className:"w-4 h-4"}):(0,s.jsx)($.A,{className:"w-4 h-4"})}),(0,s.jsx)(ex,{open:i,onOpenChange:l}),eS?(0,s.jsx)("button",{onClick:()=>{p.push("/pricing")},className:"cursor-pointer flex items-center justify-center gap-2 h-9 px-4 roun
1ded-lg border border-purple-800/70 bg-gradient-to-r from-purple-400 via-purple-600 to-purple-400 text-white text-sm font-medium shadow-[inset_0_-2px_3px_rgba(255,255,255,0.18)] hover:from-purple-500 hover:via-purple-700 hover:to-purple-500 transition",children:(0,s.jsx)("span",{children:x("upgrade")})}):(0,s.jsxs)("button",{onClick:()=>{p.push("/login")},className:"cursor-pointer flex items-center justify-center gap-2 h-9 px-4 rounded-lg border border-purple-800/70 bg-gradient-to-r from-purple-400 via-purple-600 to-purple-400 text-white text-sm font-medium shadow-[inset_0_-2px_3px_rgba(255,255,255,0.18)] hover:from-purple-500 hover:via-purple-700 hover:to-purple-500 transition",children:[(0,s.jsx)("span",{children:x("connect")}),(0,s.jsx)(q.A,{className:"w-4 h-4"})]})]})]}),(0,s.jsx)("main",{className:"flex-1 overflow-auto",children:n})]})})]})}},68856:(e,t,r)=>{r.d(t,{E:()=>n});var s=r(95155),a=r(59434);function n(e){let{className:t,...r}=e;return(0,s.jsx)("div",{"data-slot":"skeleton",className:(0,a.cn)("bg-muted animate-pulse rounded-md",t),...r})}},91394:(e,t,r)=>{r.d(t,{BK:()=>l,eu:()=>i,q5:()=>o});var s=r(95155);r(12115);var a=r(54011),n=r(59434);function i(e){let{className:t,...r}=e;return(0,s.jsx)(a.bL,{"data-slot":"avatar",className:(0,n.cn)("relative flex size-8 shrink-0 overflow-hidden rounded-full",t),...r})}function l(e){let{className:t,...r}=e;return(0,s.jsx)(a._V,{"data-slot":"avatar-image",className:(0,n.cn)("aspect-square size-full",t),...r})}function o(e){let{className:t,...r}=e;return(0,s.jsx)(a.H4,{"data-slot":"avatar-fallback",className:(0,n.cn)("bg-muted flex size-full items-center justify-center rounded-full",t),...r})}}}]);
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.