1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[21401],{804:(e,t,a)=>{a.d(t,{KP:()=>i,Uy:()=>r.Uy,cx:()=>p,rS:()=>u});var n=a(76607);a(47239);var r=a(4846);let o=new Set(["APA7","MLA9","Harvard","IEEE"]);function i(e){return o.has(e)}function s(e,t){if(null==t?void 0:t.enabled){if("first"===t.order)return"[".concat(e,", ");if("last"===t.order)return"".concat(e,"]");if("middle"===t.order)return"".concat(e,", ")}return"[".concat(e,"]")}function l(e){let t=e.trim();return t.startsWith("(")&&t.endsWith(")")||t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t}function c(e,t,a){if(!(null==t?void 0:t.enabled))return e;let n=((0,r.uZ)(a),"; ");return"first"===t.order?"(".concat(e).concat(n):"last"===t.order?"".concat(e,")"):"middle"===t.order?"".concat(e).concat(n):e}function d(e,t,a,r){let o=new n.I8([e]);if(r.isNarrative){let n=o.format("citation",{template:t,lang:a,format:"text",entry:[{id:e.id,"author-only":!0}]});if(/\(\d{4}[a-z]?\)/.test(n))return n;let r=o.format("citation",{template:t,lang:a,format:"text",entry:[{id:e.id,"suppress-author":!0}]}).replace(/^\(|\)$/g,"").trim();return r?"".concat(n," (").concat(r,")"):n}return o.format("citation",{template:t,lang:a,format:"text",entry:[e.id]})}async function u(e,t){var a,n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(i(e))return"";if(await (0,r.fu)(e),(0,r.g6)(e))return s(null!=(n=o.ieeeIndex)?n:1,o.merge);let u=(0,r.WH)(e),p=(0,r.nS)(u),m=d(t,u,p,{isNarrative:o.isNarrative});return(null==(a=o.merge)?void 0:a.enabled)?c(l(m),o.merge,e):m}function p(e,t){var a,n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(i(e))return"";if((0,r.g6)(e))return s(null!=(n=o.ieeeIndex)?n:1,o.merge);let u=(0,r.WH)(e);if(!(0,r.xj)(u))return(0,r.fu)(e),"";let p=(0,r.nS)(u),m=d(t,u,p,{isNarrative:o.isNarrative});return(null==(a=o.merge)?void 0:a.enabled)?c(l(m),o.merge,e):m}},1275:(e,t,a)=>{a.d(t,{Qg:()=>m,Sb:()=>h,US:()=>d,aD:()=>g,eC:()=>f,tE:()=>c,y8:()=>p});var n=a(95155),r=a(12115),o=a(31719),i=a(26499),s=a(92885),l=a(55883);let c=i.Kq,d=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)(i.LM,{ref:t,className:(0,l.cn)("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",a),...r})});d.displayName=i.LM.displayName;let u=(0,s.F)("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md p-4 pr-6 shadow-toast transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border-l-4 border-secondary bg-background",success:"border-l-4 border-secondary bg-background",info:"border-l-4 border-blue-500 bg-background",error:"border-l-4 border-red-500 bg-background",warning:"border-l-4 border-yellow-500 bg-background",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),p=r.forwardRef((e,t)=>{let{className:a,variant:r,...o}=e;return(0,n.jsx)(i.bL,{ref:t,className:(0,l.cn)(u({variant:r}),a),...o})});p.displayName=i.bL.displayName;let m=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)(i.rc,{ref:t,className:(0,l.cn)("inline-flex h-8 shrink-0 items-center justify-center rounded-xl bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",a),...r})});m.displayName=i.rc.displayName;let f=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)(i.bm,{ref:t,className:(0,l.cn)("absolute right-1 top-1 rounded-md p-1 text-foreground
1/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",a),"toast-close":"",...r,children:(0,n.jsx)(o.MKb,{className:"h-4 w-4"})})});f.displayName=i.bm.displayName;let h=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)(i.hE,{ref:t,className:(0,l.cn)("text-base text-dark font-medium [&+div]:text-xs",a),...r})});h.displayName=i.hE.displayName;let g=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)(i.VY,{ref:t,className:(0,l.cn)("text-sm opacity-90",a),...r})});g.displayName=i.VY.displayName},3998:(e,t,a)=>{a.d(t,{$:()=>c});var n=a(95155),r=a(12115),o=a(32467),i=a(92885),s=a(55883);let l=(0,i.F)("inline-flex items-center leading-4 justify-center rounded-full text-sm font-medium select-none touch-manipulation transition-[color,background-color,border-color,text-decoration-color,fill,stroke,transform] duration-100 active:scale-[0.98] motion-reduce:active:scale-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-green-600 ",ultra:"bg-[#82a3e8] text-secondary-foreground shadow-sm hover:bg-blue-600 ",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",gray:"text-dark bg-dark-background hover:bg-gray-200","b&w":"bg-white text-black shadow-sm hover:bg-gray-100 shadow border-b-2 font-medium border border-stroke ",yomu:"py-3 gap-3 text-primary font-medium text-sm bg-transparent border-none hover:text-primary/70"},size:{default:"h-9 px-4 py-3 text-sm ",sm:"text-sm rounded-xl px-3 py-2.5 font-medium",lg:"h-10 rounded-full px-8",xl:"py-5 px-4 rounded-full text-xl",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),c=r.forwardRef((e,t)=>{let{className:a,variant:r,size:i,asChild:c=!1,...d}=e,u=c?o.DX:"button";return(0,n.jsx)(u,{className:(0,s.cn)(l({variant:r,size:i,className:a})),ref:t,...d})});c.displayName="Button"},4846:(e,t,a)=>{a.d(t,{fu:()=>P,c2:()=>S,tH:()=>y,nS:()=>N,g6:()=>E,xj:()=>I,ZZ:()=>v,cI:()=>_,WH:()=>w,Uy:()=>A,uZ:()=>b}),a(47239);var n=a(76607);let r=new Set(["apa","harvard1","vancouver"]),o=new Set(["en-US","nl-NL","fr-FR","de-DE","es-ES"]),i=new Map,s={"harvard-cite-them-right":"en-GB"};function l(){return n.Nx.config.get("@csl")}function c(e){var t,a;return null!=(a=null!=(t=s[e])?t:i.get(e))?a:"en-US"}let d={APA7:"apa",Harvard:"harvard1",Vancouver:"vancouver",IEEE:"ieee",Nature:"nature",AMA:"american-medical-association",MLA9:"modern-language-association",Chicago:"chicago-author-date"},u=new Set(["IEEE","Vancouver","Nature","AMA","ieee","vancouver","nature","american-medical-association"]),p=new Map,m=null,f=null,h=0,g=new Set;function y(){return h}function A(e){return g.add(e),()=>g.delete(e)}function x(e){h++,g.forEach(t=>t(e))}let T={APA7:"apa",MLA9:"modern-language-association",Harvard:"harvard-cite-them-right",IEEE:"ieee"};function v(e){var t;return null!=(t=T[e])?t:e}function w(e){var t,a;return null!=(a=null!=(t=d[e])?t:d[v(e)])?a:e}let C=new Set(["APA7","Harvard","apa","harvard1","harvard-cite-them-right"]);function b(e){let t=w(e);return C.has(e)||C.has(t)}function E(e){return u.has(e)}function S(){return m?Promise.resolve(m):(f||(f=fetch("/csl-templates/manifest.json").then(e=>{if(!e.ok)throw Error("Failed to load CSL template manifest");return e.json()}).then(e=>{for(let t of(m=e,e))t.numeric&&(u.add(t.id),u.add(t.cslId));return e})),f)}function _(e,t){(function(e,t){var a;if(r.has(e))return!1;l().templates.add(e,t),r.add(e);let n=null==(a=t.match(/default-locale="([^"]+)"/))?void 0:a[1];return n&&i.set(e,n),!0})(e,t)&&x(e)}function I(e){return r.has(e)}function N(e){let t=c(e);return o.has(t)?t:"en-US"}let R=new Set;async function O(e){if(o.has(e)||R.has(e))return;let t="locale:".concat(e);
1if(!p.has(t)){let a=fetch("/csl-locales/locales-".concat(e,".xml")).then(t=>{if(!t.ok)throw Error("CSL locale not found: ".concat(e));return t.text()}).then(t=>{!o.has(e)&&(l().locales.add(e,t),o.add(e),1)&&x(e)}).catch(()=>{R.add(e)}).finally(()=>{p.delete(t)});p.set(t,a)}return p.get(t)}async function j(e){if(!r.has(e)){if(!p.has(e)){let t=fetch("/csl-templates/".concat(e,".csl")).then(t=>{if(!t.ok)throw Error("CSL template not found: ".concat(e));return t.text()}).then(t=>{_(e,t)}).finally(()=>{p.delete(e)});p.set(e,t)}await p.get(e)}await O(c(e))}async function P(e){await S();let t=w(e);await j(t)}},5447:(e,t,a)=>{a.d(t,{LZ:()=>c,cF:()=>d});var n=a(4846);let r={article:"article-journal",inproceedings:"paper-conference",conference:"paper-conference",proceedings:"paper-conference",book:"book",inbook:"chapter",incollection:"chapter",phdthesis:"thesis",mastersthesis:"thesis",techreport:"report",manual:"report",misc:"article",unpublished:"manuscript",online:"webpage",electronic:"webpage"},o=e=>e.replace(/\{\\['"`^~]([a-zA-Z])\}/g,"$1").replace(/\\&/g,"&").replace(/\\%/g,"%").replace(/\\\$/g,"$").replace(/\\#/g,"#").replace(/\\_/g,"_").replace(/--/g,"â").replace(/\{([^{}]*)\}/g,"$1").replace(/\s+/g," ").trim(),i=e=>{let t=e.trim();if(!t)return{literal:""};let a=t.split(/\s+/).filter(Boolean);return 1===a.length||/\b(university|institute|laborator|corporation|company|inc\.?|ltd\.?|llc|department|college|school|hospital|center|centre|society|association|foundation|consortium)\b/i.test(t)||t===t.toUpperCase()&&a.length>1?{literal:t}:{family:a[a.length-1],given:a.slice(0,-1).join(" ")}},s=e=>{if(null==e)return;if("number"==typeof e)return e>0?e:void 0;let t=e.trim();if(!t||"n/a"===t.toLowerCase())return;let a=parseInt(t,10);return Number.isFinite(a)&&a>0?a:void 0},l=e=>{if(!e)return;let t=e.trim();if(t&&"n/a"!==t.toLowerCase())return t};function c(e){return(0,n.g6)(e)}let d=e=>{var t,a,n,c,d,u,p,m,f,h,g;let y=(e=>{let t,a={fields:{}};if(!e)return a;let n=e.match(/@(\w+)\s*\{/);n&&(a.entryType=n[1].toLowerCase());let r=/(\w+)\s*=\s*(?:\{((?:[^{}]|\{[^{}]*\})*)\}|"([^"]*)"|(\d+))/g;for(;null!==(t=r.exec(e));){var i,s,l;let e=t[1].toLowerCase(),n=null!=(l=null!=(s=null!=(i=t[2])?i:t[3])?s:t[4])?l:"";a.fields[e]=o(n)}return a})(null!=(a=null==e?void 0:e.BibTeX)?a:""),A=y.fields,x=(null!=(n=null==e?void 0:e.full_authors_names_list)?n:[]).map(e=>"string"==typeof e?e.trim():"").filter(Boolean).map(i),T=null!=(c=s(null==e?void 0:e.year))?c:s(A.year),v=y.entryType&&r[y.entryType]||((null==e||null==(t=e.paper_type_classification)?void 0:t.preprint)?"article":"article-journal"),w={id:(null==e?void 0:e.paper_id
1)||(null==e?void 0:e.url)||(null==e?void 0:e.title)||"cite",type:v},C=null!=(d=l(null==e?void 0:e.title))?d:l(A.title);C&&(w.title=C),x.length&&(w.author=x),void 0!==T&&(w.issued={"date-parts":[[T]]});let b=null!=(p=null!=(u=l(null==e?void 0:e.venue_or_journal_full))?u:l(A.journal))?p:l(A.booktitle);b&&(w["container-title"]=b);let E=l(null==e?void 0:e.venue_or_journal);E&&E!==b&&(w["container-title-short"]=E);let S=l(A.volume);S&&(w.volume=S);let _=l(null!=(m=A.number)?m:A.issue);_&&(w.issue=_);let I=l(null!=(f=A.pages)?f:A.page);I&&(w.page=I);let N=l(A.publisher);N&&(w.publisher=N);let R=l(A.address);R&&(w["publisher-place"]=R);let O=l(A.isbn);O&&(w.ISBN=O);let j=l(A.issn);j&&(w.ISSN=j);let P=null!=(h=l(A.doi))?h:(e=>{if(!e)return;let t=e.match(/(?:https?:\/\/)?(?:dx\.)?doi\.org\/(.+)$/i);return null==t?void 0:t[1]})(null==e?void 0:e.url);P&&(w.DOI=P);let k=null!=(g=l(null==e?void 0:e.url))?g:l(A.url);return k&&(w.URL=k),w}},21401:(e,t,a)=>{a.d(t,{default:()=>S,jb:()=>C,kX:()=>E,on:()=>b});var n=a(95155),r=a(1684),o=a(99776),i=a(12115),s=a(25959),l=a(4538),c=a(25137),d=a(82021),u=a(1275),p=a(27515),m=a(44385),f=a(48233),h=a(60080),g=a(80207),y=a(82754),A=a(85488),x=a(95226);let T=(e,t)=>"function"==typeof e?e(t):e,v=(e,t)=>a=>{e(e=>({[t]:T(a,e[t])}))},w=()=>{},C={enableNewCheck:!1,isRunning:!1,isLoadingResult:!1},b=(0,s.v)(e=>({theme:"light",continuation:"",isLoadingAiCommand:!1,enableAutocomplete:!1,showFormatMenu:!0,showSelectCommandBubbleMenu:!0,showSuggestionsBubbleMenu:!1,showCitationsBubbleMenu:!1,openRightPannel:!1,savedTextSelected:"",isLoadingAiDocumentCommand:!1,suggestions:[{text:""}],suggestionIndex:0,commandAppliedTo:{position:"none",to:"selection"},yomuEditorSchema:{title:"",outlineSchema:[]},yomuContentInEditorIsSet:!1,editor:null,expandLeftSideBar:!1,openSideBar:!1,aiActionUsed:0,citations:[],selectedCitations:{citations:[],selectedStyle:"APA7"},citationFilters:{include_keywords:[],exclude_keywords:[],is_research_paper:!1,is_review_paper:!1,minimum_citation_count:void 0,open_access_pdf:!1,year_to:void 0,year_from:void 0,venue_name:void 0},rightPannelData:null,plagiarismLogicByDoc:{},documentSettings:{language:"EN_US",gpt:"gpt41_mini",shareable:!1,customStyle:""},showAtCapacityDialog:!1,showCreateDocDialog:!1,streamResponse:"",showAskAiBubbleMenu:!1,showLinkEditor:!1,showGenerateImageBubbleMenu:!1,isGenerateImageLoading:!1,publicId:"",startGuideTuto:!1,startFeedback:!1,loadingText:"Yomu is writing",citationKeywords:"",initCitationsScore:0,suppressedCiteSelection:null,setShowFormatMenu:v(e,"showFormatMenu"),setShowSelectCommandBubbleMenu:v(e,"showSelectCommandBubbleMenu"),setShowSuggestionsBubbleMenu:v(e,"showSuggestionsBubbleMenu"),setShowCitationsBubbleMenu:v(e,"showCitationsBubbleMenu"),runAICommand:w,runAICite:w,runAIContinuation:w,setEnableAutocomplete:v(e,"enableAutocomplete"),setContinuation:v(e,"continuation"),setIsLoadingAiCommand:v(e,"isLoadingAiCommand"),setSavedTextSelected:v(e,"savedTextSelected"),setSuggestions:v(e,"suggestions"),setSuggestionIndex:v(e,"suggestionIndex"),setCommandAppliedTo:v(e,"commandAppliedTo"),setIsLoadingAiDocumentCommand:v(e,"isLoadingAiDocumentCommand"),setYomuEditorSchema:v(e,"yomuEditorSchema"),setYomuContentInEditorIsSet:v(e,"yomuContentInEditorIsSet"),setEditor:v(e,"editor"),setExpandLeftSideBar:v(e,"expandLeftSideBar"),setOpenSideBar:v(e,"openSideBar"),setAiActionUsed:v(e,"aiActionUsed"),incrementAiAction:w,setSelectedCitations:v(e,"selectedCitations"),setCitationFilters:v(e,"citationFilters"),setOpenRightPannel:v(e,"openRightPannel"),setRightPannelData:v(e,"rightPannelData"),setPlagiarismLogic:(t,a)=>e(e=>{var n;return{plagiarismLogicByDoc:{...e.plagiarismLogicByDoc,[t]:T(a,null!=(n=e.plagiarismLogicByDoc[t])?n:C)}}}),setDocumentSettings:v(e,"documentSettings"),setShowAtCapacityDialog:v(e,"showAtCapacityDialog"),setShowCreateDocDialog:v(e,"showCreateDocDialog"),setStreamResponse:v(e,"streamResponse"),setShowAskAiBubbleMenu:v(e,"showAskAiBubbleMenu"),setShowLinkEditor:v(e,"showLinkEditor"),setShowGenerateImageBubbleMenu:v(e,"showGenerateImageBubbleMenu"),setIsGenerateImageLoading:v(e,"isGenerateImageLoading"),setPublicId:v(e,"publicId"),setStartGuideTuto:v(e,"startGuideTuto"),setStartFeedback:v(e,"startFeedback"),setLoadingText:v(e,"loadingText"),setCitationKeywords:v(e,"citationKeywords"),setCitations:v(e,"citations"),setInitCitationsScore:v(e,"initCitationsScore"),setSuppressedCiteSelection:v(e,"suppressedCiteSelection")})),E=l.k,S=e=>{let{children:t}=e,{isLoaded:a}=(0,r.Jd)(),{customer:s,costumerLoaded:l}=(0,i.useContext)(p.C),{toast:T}=(0,d.dj)(),v=(0,o.jE)(),w=(0,m.a)(),C=b(e=>e.enableAutocomplete),E=b(e=>e.showAtCapacityDialog),S=b(e=>e.setShowAtCapacityDialog),[_,I]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let e=localStorage.getItem("enableAutocomplete"),t=null===e||JSON.parse(e);b.setState({enableAutocomplete:t}),I(!0)},[w]),(0,i.useEffect)(()=>{_&&localStorage.setItem("enableAutocomplete",JSON.stringify(C))},[_,C]),(0,i.useEffect)(()=>{b.getState().setAiActionUsed(s.aiActionUsed||0)},[s.aiActionUsed,a]),(0,i.useEffect)(()=>{b.getState().setDocumentSettings(e=>({...e,gpt:s.preferGPT}))},[s.preferGPT]),(0,i.useEffect)(()=>{b.getState().setDocumentSettings(e=>({...e,customStyle:s.customStyle}))},[s.customStyle]);let N=(0,i.useCallback)(e=>{var t,a;
1let r=Math.max(null!=(t=b.getState().aiActionUsed)?t:0,null!=(a=s.aiActionUsed)?a:0);return s.isFreeOrPaidPerAction()&&(!s.hasCredits()||r>=x.A.maxAIActions)?!e&&(b.getState().setShowAtCapacityDialog(!0),!1):"paid"===s.status&&r>=x.A.proMonthlyAIActions?!e&&(T({title:"You used all your monthly AI actions",description:"Upgrade to Ultra at app.yomu.ai/subscribe for unlimited AI actions, or wait for your monthly reset.",variant:"info",action:(0,n.jsx)(u.Qg,{altText:"Upgrade to Ultra",onClick:()=>{window.location.href="/subscribe"},children:"Upgrade"})}),!1):!s.isPaidPerAction()||!(b.getState().aiActionUsed>=x.A.maxAIActions)||(T({title:"You ran out of AI actions",description:"Please upgrade your plan to continue using Yomu AI",variant:"info"}),b.getState().setShowAtCapacityDialog(!0),!1)},[l,s,T]),R=(0,i.useCallback)(()=>{try{y.A.incrementAiAction(s.userId).then(()=>{b.getState().setAiActionUsed(e=>e+1)}),s.isFreeOrPaidPerAction()&&v.invalidateQueries({queryKey:["getCustomer"]})}catch(e){console.log("Error incrementing AI action: ",e)}},[s,v]),O=(0,i.useCallback)(async(e,t,a,n,r,o,i)=>{let{documentSettings:l,editor:c,publicId:d,setAiActionUsed:u,setCommandAppliedTo:p,setIsLoadingAiCommand:m,setIsLoadingAiDocumentCommand:y,setLoadingText:x,setSavedTextSelected:w,setShowAskAiBubbleMenu:C,setShowCitationsBubbleMenu:E,setShowSelectCommandBubbleMenu:S,setShowSuggestionsBubbleMenu:_,setSuggestionIndex:I,setSuggestions:R}=b.getState();if(""===e||!(0,f.T4)(c)||!N())return;if(C(!1),_(!1),E(!1),S(!0),m(!0),x("Yomu is writing"),w(void 0!==i?i:e),c.setEditable(!1),p(a),"document"===a.to){var O,j;w(" "),y(!0);let t=null!=(j=null==(O=(0,f.EL)(c))?void 0:O.length)?j:0;e=e.substring(t>0?t+2:0)}let P={text:e};n&&(P.title=n),r&&(P={...P,...r}),P.language=l.language,P.prefer_gpt=l.gpt,P.custom_style=l.customStyle;try{let e=await g.A.runCommand(P,t);if(h.j.aiCommandUsed({document_id:d,command:A.I[t],model_id:l.gpt,apply_to:a.to,position:a.position}),"document"===a.to&&h.j.documentAICommandUsed({document_id:d,command:A.I[t],model_id:l.gpt}),u(e.aiActionUsed),s.isFreeOrPaidPerAction()&&v.invalidateQueries({queryKey:["getCustomer"]}),void 0!==o){let t=e.suggestions.map(e=>({text:(0,f._J)(e.text,o)}));R(t)}else R(e.suggestions);I(0)}catch(e){"ultra"===s.status||"believer"===s.status?T({title:"Timeout Error",description:"Is taking too long, try switching to fast versions in settings",variant:"error"}):T({title:"Error",description:"An expected error has ocurred",variant:"error"}),console.log("Error running ai command: ",e)}finally{(0,f.T4)(c)&&c.setEditable(!0),m(!1),y(!1)}},[s,N,v,T]),j=(0,i.useCallback)((e,t)=>{if(!N(!0))return;let{setContinuation:a,editor:n}=b.getState();a(""),(0,f.T4)(n)&&n.commands.setAutocompleteLoading(!0);try{g.A.runContinuation({...e},t).then(e=>{""===e.completion&&T({title:"Yomu is not confident with its suggestion",description:"Please write more text to generate an autocomplete suggestion",variant:"info"}),a(e.completion)}).catch(e=>{console.log("Error running autocomplete: ",e)}).finally(()=>{let e=b.getState().editor;(0,f.T4)(e)&&e.commands.setAutocompleteLoading(!1)})}catch(e){(0,f.T4)(n)&&n.commands.setAutocompleteLoading(!1),console.log("Error running autocomplete: ",e)}},[N,T]),P=(0,i.useCallback)(async(e,t,a)=>{var n,r;let{citationFilters:o,documentSettings:i,editor:l,setAiActionUsed:c,setCitationKeywords:d,setCitations:u,setInitCitationsScore:p,setIsLoadingAiCommand:m,setIsLoadingAiDocumentCommand:h,setLoadingText:y,setShowCitationsBubbleMenu:A,setShowSelectCommandBubbleMenu:x,setShowSuggestionsBubbleMenu:w,setSuppressedCiteSelection:C}=b.getState();if(!(0,f.T4)(l)||!N())return;let{from:E,to:S}=l.state.selection;C({from:E,to:S}),w(!1),A(!1),x(!0),m(!0),y("Yomu is searching"),p(0),u([]);let _=t?{...o,include_keywords:null==o||null==(n=o.include_keywords)?void 0:n.join(","),exclude_keywords:null==o||null==(r=o.exclude_keywords)?void 0:r.join(",")}:void 0;try{let t=await g.A.runCites({...e,request_type:s.status,yomu:!0,language:i.language,..._,page:a});u(t.citations),d(t.keywords),c(t.aiActionUsed),A(!1),x(!0),s.isFreeOrPaidPerA
1ction()&&v.invalidateQueries({queryKey:["getCustomer"]}),p(t.max_score)}catch(e){T({title:"Error",description:"An expected error has ocurred",variant:"error"}),console.log("Error running cite: ",e)}finally{(0,f.T4)(l)&&l.setEditable(!0),m(!1),h(!1)}},[s,N,v,T]);return(0,i.useEffect)(()=>{b.setState({incrementAiAction:R,runAICommand:O,runAICite:P,runAIContinuation:j})},[R,O,P,j]),(0,n.jsxs)(n.Fragment,{children:[t,(0,n.jsx)(c.A,{open:E,setOpen:S})]})}},25137:(e,t,a)=>{a.d(t,{A:()=>c});var n=a(95155),r=a(20063),o=a(3998),i=a(12115),s=a(95180);let l=["https://www.youtube.com/embed/OrDVSzON5Rg?autoplay=1","https://www.youtube.com/embed/C2-hZ-_0PlY?autoplay=1","https://www.youtube.com/embed/2sX4P0OmQzI?autoplay=1","https://www.youtube.com/embed/yTKjtLq-qao?autoplay=1","https://www.youtube.com/embed/RjyKCYVERHY?autoplay=1"],c=e=>{let{open:t,setOpen:a}=e,c=(0,r.useRouter)(),[d,u]=(0,i.useState)(!1),[p,m]=(0,i.useState)(0),f=(0,i.useCallback)(()=>{m((p+1)%l.length)},[p]);return(0,n.jsx)(s.RF,{open:t,onOpenChange:a,children:(0,n.jsxs)(s.sL,{className:"z-[100000] w-full overflow-hidden sm:max-w-[560px]",children:[(0,n.jsx)("img",{src:"/img/out-of-capacity-popup.png",width:560,height:200,alt:"at capacity"}),(0,n.jsx)(s.Y8,{className:"px-8 pt-4 text-2xl font-semibold leading-[24px] text-dark",children:"AI features are exclusively available for Pro Users at this time"}),(0,n.jsxs)(s.xj,{className:"px-8 pb-6 pt-2",children:[(0,n.jsx)("p",{className:"mb-4 text-sm text-dark",children:"As a result of overwhelming demand, we had to restrict access to AI features for our free users. To ensure we provide quality Yomu AI service to people who need it the most, we invite you to try our Pro version."}),(0,n.jsx)("p",{className:"mb-2 text-sm text-dark",children:"We offer both one-time payment and subscription options. We are committed to providing top-notch service. If you are not completely satisfied with the Pro version, we offer a hassle-free, no questions asked refund."}),(0,n.jsx)(o.$,{variant:"secondary",className:"py-3",onClick:()=>{a(!1),c.push("/subscribe")},children:"Upgrade your plan"}),(0,n.jsx)(o.$,{variant:"outline",className:"ml-2 mt-4 py-3",onClick:()=>a(!1),children:"Close"}),(0,n.jsx)("div",{className:"mt-6 text-center",children:d?(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)("div",{className:"relative aspect-video overflow-hidden rounded-lg",children:(0,n.jsx)("iframe",{width:"100%",height:"100%",src:l[p],title:"Yomu AI Testimonial",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"absolute inset-0"})}),(0,n.jsxs)("div",{className:"mt-2 flex justify-center gap-2 text-center",children:[(0,n.jsx)(o.$,{variant:"ghost",size:"sm",className:"text-xs text-gray-500",onClick:()=>u(!1),children:"Hide video"}),(0,n.jsx)(o.$,{variant:"ghost",size:"sm",className:"text-primary-600 text-xs",onClick:f,children:"Watch next testimonial â"})]})]}):(0,n.jsx)(o.$,{variant:"ghost",className:"text-primary-600 hover:text-primary-700 text-sm",onClick:()=>u(!0),children:(0,n.jsx)("span",{children:"Not convinced yet? Watch how others use Yomu AI â"})})})]})]})})}},27515:(e,t,a)=>{a.d(t,{C:()=>u,default:()=>p});var n=a(95155),r=a(1684),o=a(99776),i=a(59072),s=a(12115),l=a(82754),c=a(95226);let d={userId:"",stripeCustomerId:"",aiActionUsed:0,lastActionReset:"",status:"free",isFree:()=>!0,isPaidPerAction:()=>!1,isFreeOrPaidPerAction:()=>!1,isPaid:()=>!1,isUltra:()=>!1,isBelieverOnly:()=>!1,hasCredits:()=>!0,preferGPT:"gpt41_mini",customStyle:"",showStepByStepGuide:!1,preferChatGPT:i.PreferChatGPT.gemini3_flash,generalChatTutorialCompleted:!1,showAgentModeTutorialBanner:!0,monthlyCreditsUsed:0,monthlyReportsUsed:0,boughtCredits:0,nextMonthlyCreditResetDate:new Date},u=(0,s.createContext)({costumers:[],setCustomers:e=>{},customer:{userId:"",stripeCustomerId:"",aiActionUsed:0,lastActionReset:"",preferGPT:"gpt41_mini",preferChatGPT:i.PreferChatGPT.gemini3_flash,status:"free",customStyle:"",isFree:()=>!0,isPaidPerAction:()=>!1,isFreeOrPaidPerAction:()=>!1,isPaid:()=>!1,isUltra:()=>!1,isBelieverOnly:()=>!1,showStepByStepGuide:!1,generalChatTutorialCompleted:!1,showAgentModeTutorialBanner:!0,hasCredits:()=>!0,monthlyCreditsUsed:0,monthlyReportsUsed:0,nextMonthlyCreditResetDate:new Date,boughtCredits:0},setCustomer:()=>{},costumerLoaded:!1,updateCustomerSettings:()=>{}}),p=e=>{let{children:t}
1=e,[a,i]=(0,s.useState)([]),[p,m]=(0,s.useState)(d),[f,h]=(0,s.useState)(!1),{isLoaded:g,isSignedIn:y,user:A}=(0,r.Jd)(),x=(0,o.jE)(),T=()=>"free"===p.status||"paid_per_action"===p.status;p.isFree=()=>"free"===p.status,p.isPaidPerAction=()=>"paid_per_action"===p.status,p.isPaid=()=>"paid"===p.status||"ultra"===p.status||"believer"===p.status,p.isUltra=()=>"ultra"===p.status||"believer"===p.status,p.isBelieverOnly=()=>"believer"===p.status,p.isFreeOrPaidPerAction=T,p.hasCredits=()=>T()?p.aiActionUsed<c.A.maxAIActions:"paid"!==p.status||p.aiActionUsed<c.A.proMonthlyAIActions,(0,s.useEffect)(()=>{let e=!1;return(async()=>{if(g){if(!y||!(null==A?void 0:A.id)){h(!1),m(d);return}h(!1);for(let t=1;t<=5;t++)try{let t=await l.A.getCostumer(A.id);if(e)return;m(t),h(!0);return}catch(a){if(e)return;if(5===t){console.error("Error fetching costumers:",a),h(!0);return}await new Promise(e=>setTimeout(e,800*t))}}})(),()=>{e=!0}},[g,y,null==A?void 0:A.id]),(0,s.useEffect)(()=>{(null==A?void 0:A.id)||x.clear()},[null==A?void 0:A.id,x]);let v=(0,s.useCallback)(async e=>{if(g&&y&&p.userId)try{let t=await l.A.updateCustomerWhiteCard(p.userId,e);m(a=>({...a,...t,...e}))}catch(e){console.error("Error updating customer settings:",e)}},[g,y,p.userId]);return(0,n.jsx)(u.Provider,{value:{costumers:a,setCustomers:i,customer:p,setCustomer:m,costumerLoaded:f,updateCustomerSettings:v},children:t})}},44385:(e,t,a)=>{a.d(t,{a:()=>r});var n=a(12115);function r(){let[e,t]=n.useState(void 0);return n.useEffect(()=>{let e=window.matchMedia("(max-width: ".concat(767,"px)")),a=()=>{t(window.innerWidth<768)};return e.addEventListener("change",a),t(window.innerWidth<768),()=>e.removeEventListener("change",a)},[]),!!e}},48233:(e,t,a)=>{a.d(t,{BF:()=>p,EL:()=>T,F2:()=>h,MO:()=>A,N4:()=>g,RA:()=>b,T4:()=>l,UU:()=>w,Yq:()=>x,_J:()=>f,cs:()=>m,h2:()=>c,j5:()=>u,lN:()=>E,mT:()=>y,mW:()=>d,nI:()=>C,qn:()=>I,vf:()=>S,yU:()=>v,zT:()=>_});var n=a(55883),r=a(5447),o=a(804),i=a(92322),s=a(51876);function l(e){return!!e&&!e.isDestroyed}let c=(e,t)=>{let a=e.view.state.selection;e.chain().focus().insertContentAt({from:a.from,to:a.to},t).run()},d=(e,t)=>{e.view.state.selection,e.chain().insertContentAt({from:e.view.state.selection.$head.start(),to:e.view.state.selection.$head.end()},t).focus().run()},u=e=>{let{view:t,state:a}=e,{from:n,to:r}=t.state.selection;return a.doc.textBetween(n,r,"")},p=(e,t)=>{var a,n;let{doc:r,selection:o}=e.state,i=null!=(a=null==t?void 0:t.from)?a:o.from,l=null!=(n=null==t?void 0:t.to)?n:o.to;if(o instanceof s.nh&&"citeComponent"===o.node.type.name)return!0;if(i>=l)return!1;let c=!1;if(r.nodesBetween(i,l,e=>{if("citeComponent"===e.type.name)return c=!0,!1}),c)return!0;for(let e=i;e<l;e++){let t=r.nodeAt(e);if((null==t?void 0:t.type.name)==="citeComponent")return!0}return!1},m=e=>{let{view:t,state:a}=e,{from:n,to:r}=t.state.selection;if(n===r){var o;return null!=(o=x(e))?o:""}return u(e)};function f(e,t){let a=e;return Object.keys(t).forEach(e=>{a=function(e,t,a){let n=RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g");return e.replace(n,a)||""}(a,e,t[e])}),a}function h(e){let t=0;return{text:e.replace(/<[^>]*>.*?<\/[^>]*>/g,e=>(t++,"")),counter:t}}function g(e){let{view:t,state:a}=e,{from:n,to:r}=t.state.selection,o=[],s=!1;a.doc.nodesBetween(n,r,(n,r,l)=>{if(l===a.doc&&!s){s=!0;let a=i.ZF.fromSchema(e.schema),n=t.state.selection.content(),r=a.serializeFragment(n.content),l=document.createElement("div");l.appendChild(r),o.push(l.innerHTML)}});let{html:l,citeComponents:c}=function(e){let t=[],a=1,n=e.replace(/<cite-component\s*([^>]*)>(.*?)<\/cite-component>/g,e=>{let n="\\cite{cite_".concat(a,"}");return t[n]=e,a++,n});return a=1,{html:n=n.replace(/<captioninserted-component\s*([^>]*)>(.*?)<\/captioninserted-component>/g,e=>{let n="\\ref{ref_".concat(a,"}");return t[n]=e,a++,n}),citeComponents:t}}(o.join(""));return{text:l.replace(/<[^>]*>/g,""),citeComponents:c,originalHtml:o.join("")}}let y=e=>{let{$from:t}=e.state.selection;return t.pos===t.end()},A=e=>!e.isActive("table")&&!e.isActive("caption")&&!e.isActive("title")&&!e.isActive("heading"),x=e=>{let{selection:t}=e.state,a=t.$head.parent;if("paragraph"===a.type.name)return a.textContent},T=e=>{let{doc:t}=e.state,a=t.firstChild;return null==a?void 0:a.textContent},v=e=>{var t;let{doc:a}=e.state;if(0===a.childCount||(null==(t=a.firstChild)?void 0:t.type.name)!=="title")return!1;let n=0;for(let e=1;e<a.childCount;e++){let t=a.child(e);if("paragraph"===t.type.name){if(t.textContent.replace(/\u200b/g,"").trim().length>0)return!1;n++;continue}return!1}return n<=1},w=(e,t)=>
1{e.chain().insertContentAt(e.state.doc.content.size,t).focus("end").run(),e.chain().focus().toggleNode("paragraph","paragraph").run()},C=(e,t)=>{var a;let{doc:n}=e.state;e.commands.focus("start");let r=Number(null==(a=n.nodeAt(0))?void 0:a.content.size)+1;return e.chain().focus(r).run(),e.chain().insertContentAt(r,t).focus(r).run(),e.chain().focus().toggleNode("paragraph","paragraph").run(),r},b=e=>{var t;let{doc:a,selection:n}=e.state,r=[];return a.content.nodesBetween(0,n.$from.pos,e=>{e.type.name.startsWith("paragraph")&&r.push(e.textContent)}),null!=(t=r.reverse()[1])?t:""},E=(e,t)=>{let{doc:a,selection:i}=e.state,s="";a.descendants((e,a,l)=>{a<i.$from.pos&&(e.type.name.startsWith("title")?s+="# ".concat(e.textContent,"\n"):e.type.name.startsWith("heading")?s+="".concat("#".repeat(e.attrs.level)," ").concat(e.textContent,"\n"):e.type.name.startsWith("paragraph")?(e.content.forEach(e=>{l&&"tableCell"===l.type.name||("text"===e.type.name?s+=e.text:"captionInserted"===e.type.name?s+=e.attrs.captionText:"citeComponent"===e.type.name&&(s+=" ",s+=((e,t)=>{let a=t.attrs.isNarrative||!1,i=t.attrs.ieeeIndex,s=a?void 0:t.attrs.merge;if((0,o.KP)(e))try{return(0,n.fT)(e,JSON.parse(t.attrs.cite),a,i,s)}catch(e){return""}let l=(e=>{try{let t=e.attrs.cslJson;if(t)return JSON.parse(t)}catch(e){}try{return(0,r.cF)(JSON.parse(e.attrs.cite))}catch(e){return null}})(t);if(l){let t=(0,o.cx)(e,l,{isNarrative:a,ieeeIndex:i,merge:s});if(t)return t}return(e=>{try{var t;let a=JSON.parse(e.attrs.cite),n=null!=(t=a.full_authors_names_list)?t:[],r=e=>e.split(" ").pop()||e,o="";if(1===n.length?o=r(n[0]):2===n.length?o="".concat(r(n[0])," & ").concat(r(n[1])):n.length>2&&(o="".concat(r(n[0])," et al.")),o&&a.year)return"(".concat(o,", ").concat(a.year,")");if(o)return"(".concat(o,")");return""}catch(e){return""}})(t)})(t,e)))}),s+="\n"):"caption"===e.type.name&&(e.content.forEach(e=>{"text"===e.type.name&&(s+=e.text)}),s+="\n"))}),s=s.replace(/\n{2,}/g,"\n");let l=i.$head.parent;return 0===i.$head.parentOffset&&["paragraph","heading","title"].some(e=>l.type.name.startsWith(e))?s.endsWith("\n")||(s+="\n"):s=s.slice(0,-1),s=s.replace(/\n\s+/g,"\n")},S=e=>{let{doc:t}=e.state,a={title:"",outlineSchema:[]};return t.descendants((e,t)=>{if(e.type.name.startsWith("heading")){var n;a.outlineSchema.push({value:e.textContent,level:null==(n=e.attrs)?void 0:n.level,editorPosition:t})}e.type.name.startsWith("title")&&(a.title=e.textContent)}),a},_=function(e){let t=e.state.selection.$from,a=t.depth;for(;a>1&&"table"!==t.node(a).type.name;)a--;let n=t.before(a),r=e.nodeDOM(n).getBoundingClientRect();return new DOMRect(r.x,r.y,r.width,r.height)};function I(e){e.chain().focus().insertContent({type:"capturedTable",content:[{type:"table",content:[{type:"tableRow",content:[{type:"tableCell",content:[{type:"paragraph"}]},{type:"tableCell",content:[{type:"paragraph"}]},{type:"tableCell",content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",content:[{type:"paragraph"}]},{type:"tableCell",content:[{type:"paragraph"}]},{type:"tableCell",content:[{type:"paragraph"}]}]}]},{type:"caption"}]}).run()}},51834:(e,t,a)=>{a.d(t,{Cf:()=>p,Es:()=>f,L3:()=>h,c7:()=>m,lG:()=>l,rr:()=>g,zM:()=>c});var n=a(95155),r=a(12115),o=a(77442),i=a(55883),s=a(31719);let l=o.bL,c=o.l9,d=o.ZL;o.bm;let u=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)(o.hJ,{ref:t,className:(0,i.cn)("fixed inset-0 z-[99999] bg-dark/20 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...r})});u.displayName=o.hJ.displayName;let p=r.forwardRef((e,t)=>{let{className:a,children:r,...l}=e;return(0,n.jsxs)(d,{children:[(0,n.jsx)(u,{}),(0,n.jsxs)(o.UC,{ref:t,className:(0,i.cn)("fixed left-[50%] top-[50%] z-[99999] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
1nded-2xl",a),...l,children:[r,(0,n.jsxs)(o.bm,{className:"absolute right-4 top-4 rounded-2xl opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,n.jsx)(s.MKb,{className:"h-4 w-4"}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});p.displayName=o.UC.displayName;let m=e=>{let{className:t,...a}=e;return(0,n.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...a})};m.displayName="DialogHeader";let f=e=>{let{className:t,...a}=e;return(0,n.jsx)("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};f.displayName="DialogFooter";let h=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)(o.hE,{ref:t,className:(0,i.cn)("text-lg font-semibold leading-none tracking-tight",a),...r})});h.displayName=o.hE.displayName;let g=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)(o.VY,{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",a),...r})});g.displayName=o.VY.displayName},60080:(e,t,a)=>{a.d(t,{j:()=>o});var n=a(26614);function r(e,t){n.Ay.capture(e,t)}let o={chatMessageSent(e){r("chat_message_sent",e)},chatModelChanged(e){r("chat_model_changed",e)},chatModeChanged(e){r("chat_mode_changed",e)},chatDocumentUploaded(e){r("chat_document_uploaded",e)},documentLanguageChanged(e){r("document_language_changed",e)},plagiarismCheckStarted(e){r("plagiarism_check_started",e)},aiCommandUsed(e){r("ai_command_used",e)},documentAICommandUsed(e){r("document_ai_command_used",e)},rightPanelChatMessageSent(e){r("right_panel_chat_message_sent",e)},documentCreated(e){r("document_created",e)}
1,checkoutInitiated(e){r("checkout_initiated",e)},subscriptionCancellationStarted(e){r("subscription_cancellation_started",e)}}},68725:(e,t,a)=>{a.d(t,{BE:()=>p,I6:()=>f,Uz:()=>l,_s:()=>s,gk:()=>m,zj:()=>u});var n=a(95155),r=a(12115),o=a(83161),i=a(55883);let s=e=>{let{shouldScaleBackground:t=!0,handleOnly:a=!0,...r}=e;return(0,n.jsx)(o._s.Root,{shouldScaleBackground:t,handleOnly:a,...r})};s.displayName="Drawer";let l=o._s.Trigger,c=o._s.Portal;o._s.Close;let d=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)(o._s.Overlay,{ref:t,className:(0,i.cn)("fixed inset-0 z-[100] bg-black/80",a),...r})});d.displayName=o._s.Overlay.displayName;let u=r.forwardRef((e,t)=>{let{className:a,children:r,overlayClassName:s,handleClassName:l,...u}=e;return(0,n.jsxs)(c,{children:[(0,n.jsx)(d,{className:s}),(0,n.jsxs)(o._s.Content,{ref:t,className:(0,i.cn)("fixed inset-x-0 bottom-0 z-[101] mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",a),...u,children:[(0,n.jsx)(o._s.Handle,{className:(0,i.cn)("mx-auto mt-3 h-1 w-9 shrink-0 rounded-full bg-muted",l)}),r]})]})});u.displayName="DrawerContent";let p=e=>{let{className:t,...a}=e;return(0,n.jsx)("div",{className:(0,i.cn)("grid gap-1.5 p-4 text-center sm:text-left",t),...a})};p.displayName="DrawerHeader";let m=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)(o._s.Title,{ref:t,className:(0,i.cn)("text-lg font-semibold leading-none tracking-tight",a),...r})});m.displayName=o._s.Title.displayName;let f=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,n.jsx)(o._s.Description,{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",a),...r})});f.displayName=o._s.Description.displayName},80207:(e,t,a)=>{a.d(t,{A:()=>i});var n=a(85488),r=a(18720);let o="https://app.yomu.ai",i={runCommand:async function e(e,t){let a=await fetch("".concat(o,"/api/ai"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:e,type:t})});if(!a.ok){let e=await a.text();throw(null==e?void 0:e.includes("AI action limit reached"))&&r.oR.error("You have reached the maximum number of actions"),Error(a.statusText)}return await a.json()},generateImage:async function e(e){let t=await fetch("".concat(o,"/api/ai"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:e,type:n.I.GENERATE_IMAGE})});if(!t.ok){let e=await t.text();throw(null==e?void 0:e.includes("AI action limit reached"))&&r.oR.error("You have reached the maximum number of actions"),Error(t.statusText)}return await t.json()},runContinuation:async function e(e,t){let a=await fetch("".concat(o,"/api/ai"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:e,type:null!=t?t:n.I.CONTINUE2})});if(!a.ok)throw Error(a.statusText);return await a.json()},runCites:async function e(e){let t=await fetch("".concat(o,"/api/ai"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:e,type:n.I.CITE})});if(!t.ok)throw Error(t.statusText);return await t.json()},generateCite:async function e(e){let t=await fetch("".concat(o,"/api/ai"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:e,type:n.I.GENERATE_CITE})});if(!t.ok)throw Error(t.statusText);return await t.json()},getPlagiarismResult:async function e(e){let t=await fetch("".concat(o,"/api/ai"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{...e,isProduction:!0},type:n.I.PLAGIARISM_RESULT})});if(!t.ok)throw Error(t.statusText);return await t.json()},CheckPlagiarism:async function e(e){let t=await fetch("".concat(o,"/api/ai"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{...e,isProduction:!0},type:n.I.PLAGIARISM_CHECK})});if(!t.ok)throw Error(t.statusText);return await t.json()},getFeedback:async function e(e){let t=await fetch("".concat(o,"/api/ai"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{...e,isProduction:!0},type:n.I.GET_FEEDBACK})});if(!t.ok)throw Error(t.statusText);return await t.json()},startFeedback:async function e(e){let t=await fetch("".concat(o,"/api/ai"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{...e,isProduction:!0}
1,type:n.I.START_FEEDBACK})});if(!t.ok)throw Error(t.statusText);return await t.json()},askAI2:async function* e(e){var t;let a=await fetch("".concat(o,"/api/ai/stream"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:e,type:n.I.ASK_AI_2})});if(!a.ok){let e=await a.text();throw(null==e?void 0:e.includes("AI action limit reached"))&&r.oR.error("You have reached the maximum number of actions"),Error(e||a.statusText)}let i=null==a||null==(t=a.body)?void 0:t.getReader(),s=new TextDecoder("utf-8");if(i)for(;;){let{done:e,value:t}=await i.read();if(e)break;try{yield s.decode(t)}catch(e){console.log(e.message)}}},askCancelAI:async function* e(e){var t;let a=await fetch("".concat(o,"/api/ai/stream"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:e,type:n.I.ASK_CANCEL_AI})});if(!a.ok)throw Error(a.statusText);let r=null==a||null==(t=a.body)?void 0:t.getReader(),i=new TextDecoder("utf-8");if(r)for(;;){let{done:e,value:t}=await r.read();if(e)break;try{yield i.decode(t)}catch(e){console.error("Error decoding cancel AI response:",e.message)}}},chatYomu:async function* e(e){var t;let a=await fetch("".concat(o,"/api/ai/stream"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{...e,isProduction:!0},type:n.I.CHAT_YOMU})});if(!a.ok){let t=await a.text();throw(null==t?void 0:t.includes("AI action limit reached"))?r.oR.error("You have reached the maximum number of actions",{description:"Upgrade at app.yomu.ai/subscribe",descriptionClassName:"!text-dark font-medium",action:{label:"Upgrade",onClick:()=>{window.location.href="/subscribe"}}}):(null==t?void 0:t.includes("Credits limit reached"))&&!e.generalChat&&r.oR.error("You are out of AI credits",{description:"Top up at app.yomu.ai/credits, or switch the document model to Gemini 3.7 Flash to keep chatting for free.",descriptionClassName:"!text-dark font-medium",action:{label:"Top up",onClick:()=>{window.location.href="/credits"}}}),Error(t||a.statusText)}let i=null==a||null==(t=a.body)?void 0:t.getReader(),s=new TextDecoder("utf-8");if(i)for(;;){let{done:e,value:t}=await i.read();if(e)break;try{yield s.decode(t)}catch(e){console.log(e.message)}}},chatYomuAnswerNow:async function e(e){let t=await fetch("".concat(o,"/api/ai/stream"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{token:e},type:n.I.CHAT_YOMU_ANSWER_NOW})});if(!t.ok)throw Error("Answer now failed: ".concat(t.status));return t.json()}}},82021:(e,t,a)=>{a.d(t,{dj:()=>u,oR:()=>d});var n=a(12115);let r=0,o=new Map,i=e=>{if(o.has(e))return;let t=setTimeout(()=>{o.delete(e),c({type:"REMOVE_TOAST",toastId:e})},3e3);o.set(e,t)},s=[],l={toasts:[]};function c(e){l=((e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:a}=t;return a?i(a):e.toasts.forEach(e=>{i(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===a||void 0===a?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}})(l,e),s.forEach(e=>{e(l)})}function d(e){let{...t}=e,a=(r=(r+1)%Number.MAX_VALUE).toString(),n=()=>c({type:"DISMISS_TOAST",toastId:a});return c({type:"ADD_TOAST",toast:{...t,id:a,open:!0,onOpenChange:e=>{e||n()}}}),{id:a,dismiss:n,update:e=>c({type:"UPDATE_TOAST",toast:{...e,id:a}})}}function u(){let[e,t]=n.useState(l);return n.useEffect(()=>(s.push(t),()=>{let e=s.indexOf(t);e>-1&&s.splice(e,1)}),[e]),{...e,toast:d,dismiss:e=>c({type:"DISMISS_TOAST",toastId:e})}}},82754:(e,t,a)=>{a.d(t,{A:()=>r});let n="https://app.yomu.ai",r={initUserInCustomersTable:async function e(e){let t=await fetch("".concat(n,"/api/users/").concat(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"INIT_USER_IN_CUSTOMERS_TABLE"}),next:{revalidate:0}}),a=await t.json();if(!t.ok)throw console.log("res not ok"),Error(t.statusText);return a.isNewUser},getCostumer:async e=>{let t=await fetch("".concat(n,"/api/users/").concat(e),{method:"GET",headers:{"Content-Type":"application/json"},cache:"no-store",next:{revalidate:0}});if(!t.ok)throw Error(t.statusText);return await t.json()},incrementAiAction:async e=>{let t=await fetch("".concat(n,"/api/users/").concat(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"INCREMENT_AI_ACTION"}),next:{revalidate:0}});if(!t.ok)throw Error(t.statusText);return await t.json()},updateCustomer:async(e,t)=>{let a=await fetch("".concat(n,"/api/users/").concat(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"UPDATE_CUSTOMER",data:{preferGPT:t.preferGPT}}),next:{revalidate:0}});if(!a.ok)throw Error(a.statusText);let{customer:r}=await a.json();return console.log("customer",r),r},updateCustomerCustomStyle:async(e,t)=>{let a=await fetch("".concat(n,"/api/users/").concat(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"UPDATE_CUSTOMER_CUSTOM_STYLE",data:{customStyle:t.customStyle}}),next:{revalidate:0}});if(!a.ok)throw Error(a.statusText);let{customer:r}=await a.json();return console.log("customer",r),r},updateCustomerWhiteCard:async(e,t)=>{let a=await fetch("".concat(n,"/api/users/").concat(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"UPDATE_CUSTOMER_WHITE_CARD",data:t}),next:{revalidate:0}});if(!a.ok)throw Error(a.statusText);let{customer:r}=await a.json();return console.log("customer",r),r},updateStepGuideTutorial:async(e,t)=>{let a=await fetch("".concat(n,"/api/users/step-guide/").concat(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:t}),next:{revalidate:0}});if(!a.ok)throw Error(a.statusText);return await a.json()},getStepGuideTutorial:async e=>{let t=await fetch("".concat(n,"/api/users/step-guide/").concat(e),{method:"GET",headers:{"Content-Type":"application/json"},next:{revalidate:0}});if(!t.ok)throw Error(t.statusText);return await t.json()}}},85488:(e,t,a)=>{a.d(t,{I:()=>n,d:()=>r});var n=function(e){return e[e.PARAPHRASE=0]="PARAPHRASE",e[e.SUMMARIZE=1]="SUMMARIZE",e[e.EXPAND=2]="EXPAND",e[e.SHORTEN=3]="SHORTEN",e[e.ACADEMISE=4]="ACADEMISE",e[e.FIX_FLUENCY=5]="FIX_FLUENCY",e[e.CITE=6]="CITE",e[e.BULLET_TO_TEXT=7]="BULLET_TO_TEXT",e[e.WRITE_IN_DEPTH=8]="WRITE_IN_DEPTH",e[e.WRITE_SUPPORTING_ARGUMENT=9]="WRITE_SUPPORTING_ARGUMENT",e[e.WRITE_OPOSSING_ARGUMENT=10]="WRITE_OPOSSING_ARGUMENT",e[e.WRITE_INTRODUCTION=11]="WRITE_INTRODUCTION",e[e.WRITE_CONCLUSION=12]="WRITE_CONCLUSION",e[e.GIVE_FEEDBACK_PUBLICID=13]="GIVE_FEEDBACK_PUBLICID",e[e.START_FEEDBACK=14]="START_FEEDBACK",e[e.GET_FEEDBACK=15]="GET_FEEDBACK",e[e.WRITE_ABSTRACT=16]="WRITE_ABSTRACT",e[e.WRITE_SUMMARY=17]="WRITE_SUMMARY",e[e.START_ESSAY=18]="START_ESSAY",e[e.CONTINUE=19]="CONTINUE",e[e.CONTINUE2=20]="CONTINUE2",e[e.GENERATE_CITE=21]="GENERATE_CITE",e[e.PLAGIARISM_CHECK=22]="PLAGIARISM_CHECK",e[e.PLAGIARISM_RESULT=23]="PLAGIARISM_RESULT",e[e.START2_GENERATE=24]="START2_GENERATE",e[e.START3_GENERATE=25]="START3_GENERATE",e[e.ASK_AI=26]="ASK_AI",e[e.ASK_CANCEL_AI=27]="ASK_CANCEL_AI",e[e.CHAT_YOMU=28]="CHAT_YOMU",e[e.CHAT_YOMU_GENERATE_TITLE=29]="CHAT_YOMU_GENERATE_TITLE",e[e.HUMANIZE=30]="HUMANIZE",e[e.GENERATE_IMAGE=31]="GENERATE_IMAGE",e[e.CHAT_YOMU_ANSWER_NOW=32]="CHAT_YOMU_ANSWER_NOW",e[e.ASK_AI_2=33]="ASK_AI_2",e}({}),r=function(e){return e[e.FORMAT_CITE=0]="FORMAT_CITE",e[e.GET_CITE_MISSING_FORMAT=1
1]="GET_CITE_MISSING_FORMAT",e[e.EXTRACT_TITLE_FROM_TEXT=2]="EXTRACT_TITLE_FROM_TEXT",e[e.PARSE_CITATION_FORMATS_TO_CITE=3]="PARSE_CITATION_FORMATS_TO_CITE",e}({})},95180:(e,t,a)=>{a.d(t,{Lr:()=>p,N5:()=>h,RF:()=>u,Y8:()=>f,sL:()=>m,xj:()=>g});var n=a(95155),r=a(12115),o=a(55883),i=a(44385),s=a(51834),l=a(68725);let c=r.createContext({isMobile:!1}),d=()=>{let e=r.useContext(c);if(!e)throw Error("ResponsiveDialog components cannot be rendered outside the ResponsiveDialog Context");return e};function u(e){let{children:t,...a}=e,r=(0,i.a)(),o=r?l._s:s.lG;return(0,n.jsx)(c.Provider,{value:{isMobile:r},children:(0,n.jsx)(o,{...a,children:t})})}function p(e){let{className:t,children:a,...r}=e,{isMobile:o}=d(),i=o?l.Uz:s.zM;return(0,n.jsx)(i,{className:t,...r,children:a})}function m(e){let{className:t,children:a,showCloseButton:r=!0,...i}=e,{isMobile:c}=d(),u=c?l.zj:s.Cf;return(0,n.jsx)(u,{className:(0,o.cn)(c&&"max-h-[90vh] flex flex-col",t),...c?{}:{showCloseButton:r},...i,children:a})}function f(e){let{className:t,children:a,...r}=e,{isMobile:o}=d(),i=o?l.BE:s.c7;return(0,n.jsx)(i,{className:t,...r,children:a})}function h(e){let{className:t,children:a,...r}=e,{isMobile:o}=d(),i=o?l.gk:s.L3;return(0,n.jsx)(i,{className:t,...r,children:a})}function g(e){let{className:t,children:a,...r}=e,{isMobile:i}=d();return i?(0,n.jsx)("div",{className:(0,o.cn)("px-4 flex-1 overflow-y-auto pb-4",t),...r,children:a}):(0,n.jsx)("div",{className:t,...r,children:a})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.