PageSourceSearch

https://www.limbiks.com/_next/static/chunks/pages/app/[deckId]/studyGuide-b4e8f04cf7b38ed5.js

js limbiks.com collected 2026-10-05 11:41:38 UTC 28,603 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6119],{93162:function(e,t,n){var o,a,r;a=[],void 0!==(r="function"==typeof(o=function(){"use strict";function t(e,t,n){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){i(o.response,t,n)},o.onerror=function(){console.error("could not download file")},o.send()}function o(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var r="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,s=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),i=r.saveAs||("object"!=typeof window||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(e,n,s){var i=r.URL||r.webkitURL,c=document.createElement("a");n=n||e.name||"download",c.download=n,c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?a(c):o(c.href)?t(e,n,s):a(c,c.target="_blank")):(c.href=i.createObjectURL(e),setTimeout(function(){i.revokeObjectURL(c.href)},4e4),setTimeout(function(){a(c)},0))}:"msSaveOrOpenBlob"in navigator?function(e,n,r){if(n=n||e.name||"download","string"!=typeof e){var s;navigator.msSaveOrOpenBlob((void 0===(s=r)?s={autoBom:!1}:"object"!=typeof s&&(console.warn("Deprecated: Expected third argument to be a object"),s={autoBom:!s}),s.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e),n)}else if(o(e))t(e,n,r);else{var i=document.createElement("a");i.href=e,i.target="_blank",setTimeout(function(){a(i)})}}:function(e,n,o,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,o);var i="application/octet-stream"===e.type,c=/constructor/i.test(r.HTMLElement)||r.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||i&&c||s)&&"undefined"!=typeof FileReader){var d=new FileReader;d.onloadend=function(){var e=d.result;e=l?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=e:location=e,a=null},d.readAsDataURL(e)}else{var u=r.URL||r.webkitURL,p=u.createObjectURL(e);a?a.location=p:location.href=p,a=null,setTimeout(function(){u.revokeObjectURL(p)},4e4)}});r.saveAs=i.saveAs=i,e.exports=i})?o.apply(t,a):o)&&(e.exports=r)},66675:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/[deckId]/studyGuide",function(){return n(95804)}])},95804:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return K}});var o=n(7320),a=n(11163),r=n(84764),s=n(35912),i=n(11720),c=n(28586),l=n(90050),d=n(2152),u=n(21171),p=n(32827),m=n(9817),h=n(6400),f=/[\s\n\\/='"\0<>]/,b=/^(xlink|xmlns|xml)([A-Z])/,g=/^accessK|^auto[A-Z]|^cell|^ch|^col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|spellC|src[A-Z]|tabI|useM|item[A-Z]/,v=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,y=/["&<]/;function x(e){if(0===e.length||!1===y.test(e))return e;for(var t=0,n=0,o="",a="";n<e.length;n++){switch(e.charCodeAt(n)){case 34:a="&quot;";break;case 38:a="&amp;";break;case 60:a="&lt;";break;default:continue}n!==t&&(o+=e.slice(t,n)),o+=a,t=n+1}return n!==t&&(o+=e.slice(t,n)),o}var _,w,Z,k,N={},S=new Set(["animation-iteration-count","border-image-outset","border-image-slice","border-image-width","box-flex","box-flex-group","box-ordinal-group","column-count","fill-opacity","flex","flex-grow","flex-negative","flex-order","flex-positive","flex-shrink","flood-opacity","font-weight","grid-column","grid-row","line-clamp","line-height","o
1pacity","order","orphans","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","widows","z-index","zoom"]),C=/[A-Z]/g,B=[],X=Array.isArray,E=Object.assign;function L(e,t,n){var o=h.YM.__s;h.YM.__s=!0,_=h.YM.__b,w=h.YM.diffed,Z=h.YM.__r,k=h.YM.unmount;var a=(0,h.h)(h.HY,null);a.__k=[e];try{var r=function e(t,n,o,a,r,s,i){if(null==t||!0===t||!1===t||""===t)return"";if("object"!=typeof t)return"function"==typeof t?"":x(t+"");if(X(t)){var c,l="";r.__k=t;for(var d=0;d<t.length;d++){var u=t[d];if(null!=u&&"boolean"!=typeof u){var p,m=e(u,n,o,a,r,s,i);"string"==typeof m?l+=m:(c=c||[],l&&c.push(l),l="",Array.isArray(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(void 0!==t.constructor)return"";t.__=r,_&&_(t);var y,B,L,M=t.type,D=t.props,H=n;if("function"==typeof M){if(M===h.HY){if(D.tpl){for(var Y="",G=0;G<D.tpl.length;G++)if(Y+=D.tpl[G],D.exprs&&G<D.exprs.length){var q=D.exprs[G];if(null==q)continue;"object"==typeof q&&(void 0===q.constructor||X(q))?Y+=e(q,n,o,a,t,s,i):Y+=q}return Y}if(D.UNSTABLE_comment)return"<!--"+x(D.UNSTABLE_comment||"")+"-->";B=D.children}else{if(null!=(y=M.contextType)){var F=n[y.__c];H=F?F.props.value:y.__}if(M.prototype&&"function"==typeof M.prototype.render)B=T(t,H),L=t.__c;else{t.__c=L={__v:t,props:D,context:H,setState:A,forceUpdate:A,__d:!0,__h:[]};for(var P=0;L.__d&&P++<25;)L.__d=!1,Z&&Z(t),B=M.call(L,D,H);L.__d=!0}if(null!=L.getChildContext&&(n=E({},n,L.getChildContext())),(M.getDerivedStateFromError||L.componentDidCatch)&&h.YM.errorBoundaries){var U="";B=null!=B&&B.type===h.HY&&null==B.key?B.props.children:B;try{return U=e(B,n,o,a,t,s,i)}catch(r){return M.getDerivedStateFromError&&(L.__s=M.getDerivedStateFromError(r)),L.componentDidCatch&&L.componentDidCatch(r,{}),L.__d&&(B=T(t,n),null!=(L=t.__c).getChildContext&&(n=E({},n,L.getChildContext())),U=e(B=null!=B&&B.type===h.HY&&null==B.key?B.props.children:B,n,o,a,t,s,i)),U}finally{w&&w(t),t.__=null,k&&k(t)}}}B=null!=B&&B.type===h.HY&&null==B.key&&null==B.props.tpl?B.props.children:B;try{var R=e(B,n,o,a,t,s,i);return w&&w(t),t.__=null,h.YM.unmount&&h.YM.unmount(t),R}catch(r){if(!s&&i&&i.onError){var O=i.onError(r,t,function(r){return e(r,n,o,a,t,s,i)});if(void 0!==O)return O;var z=h.YM.__e;return z&&z(r,t),""}if(!s||!r||"function"!=typeof r.then)throw r;var V=function r(){try{return e(B,n,o,a,t,s,i)}catch(c){if(!c||"function"!=typeof c.then)throw c;return c.then(function(){return e(B,n,o,a,t,s,i)},function(){return r()})}};return r.then(function(){return V()})}}var W,I="<"+M,$="";for(var K in D){var Q=D[K];switch(K){case"children":W=Q;continue;case"key":case"ref":case"__self":case"__source":continue;case"htmlFor":if("for"in D)continue;K="for";break;case"className":if("class"in D)continue;K="class";break;case"defaultChecked":K="checked";break;case"defaultSelected":K="selected";break;case"defaultValue":case"value":switch(K="value",M){case"textarea":W=Q;continue;case"select":a=Q;continue;case"option":a!=Q||"selected"in D||(I+=" selected")}break;case"dangerouslySetInnerHTML":$=Q&&Q.__html;continue;case"style":"object"==typeof Q&&(Q=function(e){var t="";for(var n in e){var o=e[n];if(null!=o&&""!==o){var a="-"==n[0]?n:N[n]||(N[n]=n.replace(C,"-$&").toLowerCase()),r=";";"number"!=typeof o||a.startsWith("--")||S.has(a)||(r="px;"),t=t+a+":"+o+r}}return t||void 0}(Q));break;case"acceptCharset":K="accept-charset";break;case"httpEquiv":K="http-equiv";break;default:if(b.test(K))K=K.replace(b,"$1:$2").toLowerCase();else{if(f.test(K))continue;"-"!==K[4]&&"draggable"!==K||null==Q?o?v.test(K)&&(K="panose1"===K?"panose-1":K.replace(/([A-Z])/g,"-$1").toLowerCase()):g.test(K)&&(K=K.toLowerCase()):Q+=""}}null!=Q&&!1!==Q&&"function"!=typeof Q&&(I=!0===Q||""===Q?I+" "+K:I+" "+K+'="'+x(Q+"")+'"')}if(f.test(M))throw Error(M+" is not a valid HTML tag name in "+I+">");if($||("string"==typeof W?$=x(W):null!=W&&!1!==W&&!0!==W&&($=e(W,n,"svg"===M||"foreignObject"!==M&&o,a,t,s,i))),w&&w(t),t.__=null,k&&k(t),!$&&j.has(M))return I+"/>";var J="</"+M+">",ee=I+">";return Array.isArray($)?[ee].concat($,[J]):"string"!=typeof $?[ee,$,J]:ee+$+J}(e,t||M,!1,void 0,a,!1,n);return Array.isArray(r)?r.join(""):r}catch(e){if(e.then)throw Error('Use "renderToStringAsync" for suspenseful rendering.');throw e}finally{h.YM.__c&&h.YM.__c(e,B),h.YM.__s=o,B.length=0}}function A(){this.__d=!0}var M={};function T(e,t){var n,o=e.type,a=!0;return e.__c?(a=!1,(n=e.__c).state=n.__s):n=new o(e.props,t),e.__c=n,n.__v=e,n.props=e.props,n.context=t,n.__d=!0,null==n.state&&(n.state=M),null==n.__s&&(n.__s=n.state),o.getDerivedStateFromProps?n.state=E({},n.state,o.getDerivedStateFromProps(n.props,n.state)):a&&n.componentWillMount?(n.componentWillMount(),n.state=n.__s!==n.state?n.__s:n.state):!a&&n.componentWillUpdate&&n.componentWillUpdate(),Z&&Z(e),n.render(n.props,n.state,t)}var j=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),D=n(79500),H=n(40928),Y=n.n(H),G=n(93162),q=n(89755),F=n.n(q),P=n(37234),U=n(38868),R=n(42432),O=n(9669),z=n.n(O),V=n(17702);z().defaults.headers.common.Accept="application/json",z().defaults.timeout=0;var W={htmlToPdf:async e=>{let t=(0,V.v0)(R.Z);return(await z().post("/api/convert/htmlToPdf",{html:e},{headers:{token:await t.currentUser.getIdToken()},responseEncoding:"binary",timeout:0,responseType:"blob"})).data}};let I=e=>{let{onGenerate:t,onCancel:n,isGenerating:a,suggestions:r,onLoadSuggestions:c}=e,{selectedDeck:l,flaggedCardIds:d}=(0,s.g)(),{trackEvent:u,analyticsInstance:p}=(0,P.z)(),[m,h]=(0,i.useState)("all"),[f,b]=(0,i.useState)(""),[g,v]=(0,i.useState)([]),[y,x]=(0,i.useState)(!0),[_,w]=(0,i.useState)("intermediate"),[Z,k]=(0,i.useState)("standard");(0,i.useEffect)(()=>{r.length>0?x(!1):x(!0)},[r]),(0,i.useEffect)(()=>{v([]),h("all"),w("intermediate"),k("standard"),b("")},[]);let N=e=>{h(e),v([]),x(!0),c(e)},S=e=>{v(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},C=d.length>0,B=()=>(0,o.BX)("div",{className:"flex items-start space-x-3 p-3 rounded border border-base-300 animate-pulse",children:[(0,o.tZ)("div",{className:"w-4 h-4 bg-base-300 rounded mt-0.5"}),(0,o.tZ)("div",{className:"flex-1",children:(0,o.tZ)("div",{className:"h-4 bg-base-300 rounded w-3/4"})})]});return(0,o.tZ)("div",{className:"flex justify-center",children:(0,o.tZ)("div",{className:"container max-w-4xl p-8",children:(0,o.BX)("div",{className:"space-y-6",children:[(0,o.BX)("div",{className:"text-center",children:[(0,o.tZ)("h2",{className:"text-2xl font-bold text-base-content mb-2",children:"Customize Your Study Guide"}),(0,o.tZ)("p",{className:"text-base-content opacity-70",children:"Personalize your study guide to focus on what matters most"})]}),(0,o.BX)("div",{className:"bg-base-200 rounded-lg p-6",children:[(0,o.tZ)("h3",{className:"text-lg font-semibold text-base-content mb-4",children:"What c
1ontent should we focus on?"}),(0,o.BX)("div",{className:"space-y-3",children:[(0,o.BX)("label",{className:"flex items-center space-x-3 cursor-pointer",children:[(0,o.tZ)("input",{type:"radio",name:"contentSource",value:"all",checked:"all"===m,onChange:e=>N(e.target.value),className:"radio radio-primary"}),(0,o.BX)("div",{children:[(0,o.tZ)("div",{className:"font-medium text-base-content",children:"All content"}),(0,o.tZ)("div",{className:"text-sm text-base-content opacity-70",children:"Create a comprehensive study guide from your entire upload"})]})]}),(0,o.BX)("label",{className:"flex items-center space-x-3 ".concat(C?"cursor-pointer":"cursor-not-allowed opacity-50"),children:[(0,o.tZ)("input",{type:"radio",name:"contentSource",value:"flagged",checked:"flagged"===m,onChange:e=>N(e.target.value),disabled:!C,className:"radio radio-primary"}),(0,o.BX)("div",{children:[(0,o.BX)("div",{className:"font-medium text-base-content",children:["Flagged cards only (",d.length," cards)"]}),(0,o.tZ)("div",{className:"text-sm text-base-content opacity-70",children:C?"Focus on concepts you've marked for review":"Flag some flashcards first to use this option"})]})]})]})]}),(0,o.BX)("div",{className:"bg-base-200 rounded-lg p-6",children:[(0,o.tZ)("h3",{className:"text-lg font-semibold text-base-content mb-4",children:"Choose complexity level"}),(0,o.tZ)("p",{className:"text-sm text-base-content opacity-70 mb-4",children:"Tailor the study guide to your current understanding level"}),(0,o.BX)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[(0,o.BX)("label",{className:"flex flex-col items-center space-y-2 cursor-pointer p-4 rounded border border-base-300 hover:bg-base-300 transition-colors",children:[(0,o.tZ)("input",{type:"radio",name:"complexityLevel",value:"novice",checked:"novice"===_,onChange:e=>w(e.target.value),className:"radio radio-primary"}),(0,o.BX)("div",{className:"text-center",children:[(0,o.tZ)("div",{className:"font-semibold text-base-content",children:"Novice"}),(0,o.tZ)("div",{className:"text-xs text-base-content opacity-70",children:"Simple explanations, basic concepts"})]})]}),(0,o.BX)("label",{className:"flex flex-col items-center space-y-2 cursor-pointer p-4 rounded border border-base-300 hover:bg-base-300 transition-colors",children:[(0,o.tZ)("input",{type:"radio",name:"complexityLevel",value:"intermediate",checked:"intermediate"===_,onChange:e=>w(e.target.value),className:"radio radio-primary"}),(0,o.BX)("div",{className:"text-center",children:[(0,o.tZ)("div",{className:"font-semibold text-base-content",children:"Intermediate"}),(0,o.tZ)("div",{className:"text-xs text-base-content opacity-70",children:"Balanced detail with examples"})]})]}),(0,o.BX)("label",{className:"flex flex-col items-center space-y-2 cursor-pointer p-4 rounded border border-base-300 hover:bg-base-300 transition-colors",children:[(0,o.tZ)("input",{type:"radio",name:"complexityLevel",value:"expert",checked:"expert"===_,onChange:e=>w(e.target.value),className:"radio radio-primary"}),(0,o.BX)("div",{className:"text-center",children:[(0,o.tZ)("div",{className:"font-semibold text-base-content",children:"Expert"}),(0,o.tZ)("div",{className:"text-xs text-base-content opacity-70",children:"Advanced concepts, technical depth"})]})]})]})]}),(0,o.BX)("div",{className:"bg-base-200 rounded-lg p-6",children:[(0,o.tZ)("h3",{className:"text-lg font-semibold text-base-content mb-4",children:"Study guide length"}),(0,o.tZ)("p",{className:"text-sm text-base-content opacity-70 mb-4",children:"Choose how detailed and extensive you want your study guide to be"}),(0,o.BX)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[(0,o.BX)("label",{className:"flex flex-col items-center space-y-2 cursor-pointer p-4 rounded border border-base-300 hover:bg-base-300 transition-colors",children:[(0,o.tZ)("input",{type:"radio",name:"studyGuideLength",value:"quick",checked:"quick"===Z,onChange:e=>k(e.target.value),className:"radio radio-primary"}),(0,o.BX)("div",{className:"text-center",children:[(0,o.tZ)("div",{className:"font-semibold text-base-content",children:"Qu
1ick Review"}),(0,o.tZ)("div",{className:"text-xs text-base-content opacity-70",children:"Key points & essential summary"})]})]}),(0,o.BX)("label",{className:"flex flex-col items-center space-y-2 cursor-pointer p-4 rounded border border-base-300 hover:bg-base-300 transition-colors",children:[(0,o.tZ)("input",{type:"radio",name:"studyGuideLength",value:"standard",checked:"standard"===Z,onChange:e=>k(e.target.value),className:"radio radio-primary"}),(0,o.BX)("div",{className:"text-center",children:[(0,o.tZ)("div",{className:"font-semibold text-base-content",children:"Standard"}),(0,o.tZ)("div",{className:"text-xs text-base-content opacity-70",children:"Balanced coverage with examples"})]})]}),(0,o.BX)("label",{className:"flex flex-col items-center space-y-2 cursor-pointer p-4 rounded border border-base-300 hover:bg-base-300 transition-colors",children:[(0,o.tZ)("input",{type:"radio",name:"studyGuideLength",value:"comprehensive",checked:"comprehensive"===Z,onChange:e=>k(e.target.value),className:"radio radio-primary"}),(0,o.BX)("div",{className:"text-center",children:[(0,o.tZ)("div",{className:"font-semibold text-base-content",children:"Comprehensive"}),(0,o.tZ)("div",{className:"text-xs text-base-content opacity-70",children:"Thorough in-depth coverage"})]})]})]})]}),(0,o.BX)("div",{className:"bg-base-200 rounded-lg p-6",children:[(0,o.tZ)("h3",{className:"text-lg font-semibold text-base-content mb-4",children:"Select focus areas (optional)"}),(0,o.tZ)("p",{className:"text-sm text-base-content opacity-70 mb-4",children:"Create a more targeted study guide by selecting specific topic areas:"}),(0,o.tZ)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:y?Array.from({length:6}).map((e,t)=>(0,o.tZ)(B,{},t)):r.map((e,t)=>(0,o.BX)("label",{className:"flex items-start space-x-3 cursor-pointer p-3 rounded border border-base-300 hover:bg-base-300 transition-colors",children:[(0,o.tZ)("input",{type:"checkbox",checked:g.includes(e),onChange:()=>S(e),className:"checkbox checkbox-primary mt-0.5"}),(0,o.tZ)("span",{className:"text-sm text-base-content",children:e})]},t))})]}),(0,o.BX)("div",{className:"bg-base-200 rounded-lg p-6",children:[(0,o.tZ)("h3",{className:"text-lg font-semibold text-base-content mb-4",children:"Additional instructions (optional)"}),(0,o.tZ)("textarea",{value:f,onChange:e=>b(e.target.value),placeholder:"Tell us how you'd like your study guide customized...  Examples: • Focus on practical applications • Include more examples and analogies   • Create practice questions for each topic • Organize by difficulty level",className:"textarea textarea-bordered w-full h-32 text-base-content placeholder-base-content placeholder-opacity-50",maxLength:500}),(0,o.BX)("div",{className:"text-right text-xs text-base-content opacity-70 mt-1",children:[f.length,"/500"]})]}),(0,o.BX)("div",{className:"flex justify-center space-x-4 pt-4",children:[(0,o.tZ)("button",{onClick:n,disabled:a,className:"btn btn-ghost text-base-content",children:"Cancel"}),(0,o.tZ)("button",{onClick:()=>{u(p,"study_guide_customized",{deck_id:l.id,content_source:m,has_custom_prompt:f.length>0,selected_suggestions_count:g.length,flagged_cards_count:d.length}),t({contentSource:m,customPrompt:f,selectedSuggestions:g,complexityLevel:_,studyGuideLength:Z})},disabled:a,className:"btn btn-primary",children:a?(0,o.BX)(o.HY,{children:[(0,o.tZ)("span",{className:"loading loading-spinner loading-sm"}),"Generating..."]}):"Generate Study Guide"})]})]})})})},$=()=>{let e=(0,a.useRouter)(),{trackEvent:t,analyticsInstance:n}=(0,P.z)(),{isPro:h,isProEligible:f}=(0,m.O)(),{openModal:b}=(0,U.d)(),[g,v]=(0,i.useState)(!1),[y,x]=(0,i.useState)(!1),{submitFeedback:_}=(0,p.Z)(),[w,Z]=(0,i.useState)(!1),[k,N]=(0,i.useState)(""),[S,C]=(0,i.useState)(!1),[B,X]=(0,i.useState)(!1),[E,A]=(0,i.useState)([]),[M,T]=(0,i.useState)(!1),{getStudyGuide:j,selectedDeck:H}=(0,s.g)(),q=async(e,o)=>{Z(!0),X(!1),T(!!o);try{let a;o?(a=await D.Z.getCustomStudyGuide(e,o),t(n,"custom_study_guide_loaded",{deck_id:H.id,content_source:o.contentSource,has_custom_prompt:o.customPrompt.length>0,suggestions_count:o.selectedSuggestions.length})):(a=await j(e),t(n,"study_guide_loaded",{deck_id:H.id})),N(a)}catch(e){try{t(n,"study_guide_failed",{error:e.toString(),deck_id:H.id}),_("Study Guide Failed to Load:"+(e?e.toString():"unknown exception"))}catch(e){}v(!0)}Z(!1),T(!1)},R=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";try{let t=await D.Z.getSuggestions(H.id,e);A(t)}catch(e){console.error("Error loading suggestions:",e),A(["Key Concepts and Definitions","Main Topics and Themes","Important Formulas and Methods","Core Principles and Rules","Essential Facts and Details","Critical Processes and Steps"])}},O=()=>{A([]),X(!0),R("all")};(0,i.useEffect)(()=>{!h&&f&&k&&!S&&(C(!0),t(n,"upgrade_visible",{upgrade_source:"study_guide"}))},[h,f,k]),(0,i.useEffect)(()=>{(null==H?void 0:H.id)&&!w&&!k&&q(H.id)},[H.id]);let z=(0,o.tZ)(o.HY,{});if(g)z=(0,o.tZ)("div",{children:(0,o.tZ)("div",{className:"mt-24 flex flex-1 flex-col items-center justify-center p-6 md:mt-72",children:(0,o.tZ)("div",{className:"mt-2 flex items-center text-lg font-semibold text-secondary-content",children:(0,o.tZ)("div",{className:"ml-2 text-center",children:(0,o.BX)("div",{children:["Study Guide failed to load.",(0,o.tZ)("br",{}),(0,o.tZ)("br",{}),(0,o.tZ)("b",{children:"Please try again in a few minutes or check back later."})," ",(0,o.tZ)("br",{}),(0,o.tZ)("br",{}),"We will investigate the cause of this issue.",(0,o.tZ)("br",{}),(0,o.tZ)("br",{}),(0,o.tZ)("button",{onClick:O,className:"btn btn-primary",children:"Create Custom Study Guide"})]})})})})});else if(w)z=(0,o.tZ)("div",{children:(0,o.tZ)("div",{className:"mt-24 flex flex-1 flex-col items-center justify-center p-6 md:mt-72",children:(0,o.BX)("div",{className:"mt-2 flex items-center text-lg font-semibold text-secondary-content",children:[(0,o.tZ)(r.Z,{}),(0,o.tZ)("div",{className:"ml-2",children:(0,o.tZ)("div",{children:M?"Loading Customized Study Guide...":"Loading Study Guide..."})})]})})});else if(h)z=(0,o.tZ)("div",{className:"container p-8",children:(0,o.tZ)("div",{className:"prose max-w-none prose-headings:text-base-content prose-p:text-base-content prose-a:text-base-content hover:prose-a:text-base-content prose-blockquote:border-white prose-blockquote:py-2 prose-blockquote:pl-4 prose-blockquote:font-light prose-blockquote:text-base-content prose-strong:text-base-content prose-em:text-base-content prose-li:text-base-content prose-li:marker:text-base-content prose-table:border prose-th:bg-white prose-th:p-2 prose-th:font-sans prose-th:text-base-content prose-td:p-2 prose-img:w-full prose-img:border prose-img:p-1 prose-hr:bg-white",children:(0,o.tZ)(u.D,{children:k})})});else{let e=k.split("\n"),a=k.length/3,r=0,s=0;for(let t of e){if((r+=t.length+2)>a)break;s++}let i=e.slice(0,s).join("\n"),c=e.slice(s).join("\n");z=(0,o.BX)("div",{className:"container p-8",children:[(0,o.tZ)("div",{children:(0,o.tZ)("div",{className:"prose max-w-none prose-headings:text-base-content prose-p:text-base-content prose-a:text-base-content hover:prose-a:text-base-content prose-blockquote:border-white prose-blockquote:py-2 prose-blockquote:pl-4 prose-blockquote:font-light prose-blockquote:text-base-content prose-strong:text-base-content prose-em:text-base-content prose-ol:list-inside prose-ul:list-inside prose-li:text-base-content prose-li:marker:text-base-content prose-table:border prose-th:bg-white prose-th:p-2 prose-th:font-sans prose-th:text-base-content prose-td:p-2 prose-img:w-full prose-img:border prose-img:p-1",children:(0,o.tZ)(u.D,{children:i})})}),(0,o.tZ)("div",{className:"mb-8 mt-8 flex max-w-5xl flex-col items-center justify-center gap-2 rounded border-solid border-secondary bg-base-300 p-4 text-center opacity-100 shadow-xl",children:(0,o.BX)("div",{children:[(0,o.tZ)("span",{onClick:()=>{t(n,"upgrade_click",{upgrade_source:"study_guide"}),t(n,"study_guide_click_upgrade",{upgrade_source:"study_guide",deck_id:H.id}),b("upgrade","studyGuides")},className:"link font-bold",style:{color:"tomato"},children:"Upgrade to Limbiks Pro"})," ","to unlock full study guides with every upload."]})}),(0,o.tZ)("div",{className:"pointer-events-none select-none blur",children:(0,o.tZ)("div",{className:"prose max-w-none prose-headings:text-base-content prose-p:text-base-content prose-a:text-base-content hover:prose-a:text-base-content prose-blockquote:border-white prose-blockquote:py-2 prose-blockquote:pl-4 prose-blockquote:font-light prose-blockquote:text-base-content prose-strong:text-base-content prose-em:text-base-content prose-ol:list-inside prose-ul:list-inside prose-li:text-base-content prose-li:marker:text-base-content prose-table:border prose-th:bg-white prose-th:p-2 prose-th:font-sans prose-th:text-base-content prose-td:p-2 prose-img:w-full prose-img:border prose-img:p-1",children:(0,o.tZ)(u.D,{children:c})})})]})}let V=()=>{t(n,"study_guide_click_print",{deck_id:H.id}),window.frames.test_frame.focus(),window.frames.test_frame.print()},$=async e=>{try{x(!0);let s=L((0,o.tZ)(u.D,{children:k}));if(e){let e=await W.htmlToPdf('\n          <!DOCTYPE html>\n          <html lang="en">\n          <head>\n              <meta charset="UTF-8">\n              <meta name="viewport" content="width=device-width, initial-scale=1.0">\n              <title>Study Guide</title>\n          </head>\n          <body>\n              '.concat(s,"\n          </body>\n          </html>\n        "));t(n,"study_guide_click_pdf",{deck_id:H.id});var a=new Blob([e],{type:"application/pdf"});(0,G.saveAs)(a,"".concat(null==H?void 0:H.name.split(".")[0]," Study Guide.pdf"))}else{t(n,"study_guide_click_docx",{deck_id:H.id});var r=Y().asBlob(s);(0,G.saveAs)(r,"".concat(null==H?void 0:H.name.split(".")[0]," Study Guide.docx"))}}catch(e){_("Failed to download Study guide: "+e.toString()),console.log(e.toString()),window.alert("Failed to download study guide. This issue will be investigated. Please try again later.")}x(!1)},K=!h;return w||g?(0,o.BX)(c.Z,{authenticated:!0,children:[(0,o.tZ)(l.Z,{currentPage:d.Y.StudyGuide,onBack:()=>{e.back()}}),z]}):B?(0,o.BX)(c.Z,{authenticated:!0,children:[(0,o.tZ)(l.Z,{currentPage:d.Y.StudyGuide,onBack:()=>{e.back()}}),(0,o.tZ)("div",{className:"mt-[132px]",children:(0,o.tZ)(I,{onGenerate:e=>{q(H.id,e)},onCancel:()=>{X(!1)},isGenerating:w,suggestions:E,onLoadSuggestions:R})})]}):(0,o.BX)(c.Z,{authenticated:!0,children:[(0,o.tZ)(l.Z,{currentPage:d.Y.StudyGuide,onBack:()=>{e.back()}}
1),k&&(0,o.tZ)("iframe",{style:{display:"none"},id:"test_frame",name:"test_frame",srcDoc:L((0,o.tZ)("div",{style:{padding:10},children:(0,o.tZ)(u.D,{children:k})}))}),k&&(0,o.BX)("div",{className:"mt-[132px] w-full bg-accent",children:[(0,o.BX)("div",{"data-tip":"Upgrade to Limbiks Pro to print study guides or download as Word Documents and PDFs",className:"flex flex-row-reverse items-center justify-center md:float-right md:inline-block ".concat(h?"":"tooltip tooltip-left"," "),children:[!y&&(0,o.BX)(o.HY,{children:[(0,o.tZ)("div",{onClick:O,className:"z-40 float-right my-4 mr-4 inline-flex items-center justify-center bg-primary cursor-pointer duration-300 ease-in-out hover:scale-105 hover:underline transform rounded px-4 py-2 font-bold text-primary-content transition",children:(0,o.tZ)("span",{className:"text-sm",children:"Customize"})}),(0,o.tZ)("div",{onClick:()=>K?null:V(),"data-tip":"Print",className:"z-30 float-right my-4 mr-4 inline-flex items-center justify-center bg-neutral ".concat(K?"opacity-60":"tooltip tooltip-left cursor-pointer duration-300 ease-in-out hover:scale-105 hover:underline"," transform rounded px-4 py-2 font-bold text-neutral-content transition"),children:(0,o.tZ)("div",{className:"h-5 w-5",children:(0,o.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,width:24,viewBox:"0 0 24 24",className:"fill-base-content",children:(0,o.tZ)("path",{d:"M7 17H17V22H7V17ZM19 20V15H5V20H3C2.44772 20 2 19.5523 2 19V9C2 8.44772 2.44772 8 3 8H21C21.5523 8 22 8.44772 22 9V19C22 19.5523 21.5523 20 21 20H19ZM5 10V12H8V10H5ZM7 2H17C17.5523 2 18 2.44772 18 3V6H6V3C6 2.44772 6.44772 2 7 2Z"})})})}),(0,o.tZ)("div",{onClick:()=>K?null:$(!0),"data-tip":"Download PDF",className:"z-20 float-right m-4 inline-flex items-center justify-center bg-neutral ".concat(K?"opacity-60":"tooltip tooltip-left cursor-pointer duration-300 ease-in-out hover:scale-105 hover:underline","  transform rounded px-4 py-2 font-bold text-neutral-content transition"),children:(0,o.tZ)(F(),{width:20,height:20,alt:"pdf",src:"/pdf.png"})}),(0,o.tZ)("div",{onClick:()=>K?null:$(!1),"data-tip":"Download Microsoft Word Document",className:"float-right my-4 ml-4 inline-flex items-center justify-center bg-neutral ".concat(K?"opacity-60":"tooltip tooltip-left cursor-pointer duration-300 ease-in-out hover:scale-105 hover:underline"," transform rounded px-4 py-2 font-bold text-neutral-content transition"),children:(0,o.tZ)(F(),{width:20,height:20,alt:"word document",src:"/word_icon.svg"})})]}),y&&(0,o.BX)("div",{className:"m-4 flex items-center text-lg font-semibold text-secondary-content",children:[(0,o.tZ)(r.Z,{}),(0,o.tZ)("div",{className:"ml-2",children:(0,o.tZ)("div",{children:"Downloading..."})})]})]}),z]})]})};function K(){return(0,o.tZ)($,{})}}},function(e){e.O(0,[6342,1348,4014,1171,8586,50,2888,179],function(){return e(e.s=66675)}),_N_E=e.O()}]);
2//# sourceMappingURL=studyGuide-b4e8f04cf7b38ed5.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.