PageSourceSearch

https://resea.ai/_next/static/chunks/app/%5Blocale%5D/(v3)/writing/page-23b58a6d5052d99b.js

js resea.ai collected 2026-10-05 12:32:43 UTC 60,481 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1963],{252:(e,t,s)=>{"use strict";s.d(t,{O:()=>n});let n=["US","AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]},3760:(e,t,s)=>{"use strict";s.d(t,{EM:()=>r,Gf:()=>i,Xl:()=>l});var n=s(7232);function a(e){return"resea:writing:compose:".concat(e)}function r(e,t){n.R.setJSON(a(e),t)}function i(e){var t;let s=a(e),r=n.R.getJSON(s);return r?!(null==(t=r.documentPrompt)?void 0:t.trim())||!["standard","generate"].includes(r.headingsStyle)||!["fast","deep"].includes(r.quality)||Date.now()-r.createdAt>18e5?(n.R.removeItem(s),null):r:null}function l(e){n.R.removeItem(a(e))}},5789:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(71847).A)("quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]])},5917:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(71847).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},5937:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(71847).A)("message-circle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]])},6191:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(71847).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},10932:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});var n=s(95155),a=s(24033),r=s(5917),i=s(12115);function l(e){var t;let{id:s,label:l,value:o,options:c,open:d,onOpenChange:u,onChange:m}=e,x=(0,i.useRef)(null),p=null!=(t=c.find(e=>e.value===o))?t:c[0];return(0,i.useEffect)(()=>{if(!d)return;let e=e=>{var t;e.target instanceof Node&&!(null==(t=x.current)?void 0:t.contains(e.target))&&u(!1)},t=e=>{"Escape"===e.key&&u(!1)};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[u,d]),(0,n.jsxs)("div",{ref:x,className:"grid min-w-0 gap-2 sm:grid-cols-[116px_minmax(0,1fr)] sm:items-start sm:gap-4",children:[(0,n.jsx)("span",{id:"".concat(s,"-label"),className:"block text-[13px] font-semibold text-[#65656D] sm:pt-2",children:l}),(0,n.jsxs)("div",{className:"relative w-full min-w-0 sm:max-w-[240px] sm:justify-self-end",children:[(0,n.jsxs)("button",{type:"button","aria-labelledby":"".concat(s,"-label"),"aria-controls":"".concat(s,"-options"),"aria-expanded":d,"aria-haspopup":"listbox",onClick:()=>u(!d),className:"flex h-9 w-full items-center justify-between rounded-[10px] border border-[#DCDCE1] bg-white px-3 text-left text-[14px] text-[#292A2E] outline-none transition hover:border-[#C9C7CE] focus:border-[#8C79B2] focus:ring-2 focus:ring-[#67519C]/10",children:[(0,n.jsx)("span",{className:"truncate",children:null==p?void 0:p.label}),(0,n.jsx)(a.A,{className:"size-4 shrink-0 text-[#696A72] transition-transform ".concat(d?"rotate-180":"")})]}),d?(0,n.jsx)("div",{id:"".concat(s,"-options"),role:"listbox","aria-labelledby":"".concat(s,"-label"),className:"absolute left-0 right-0 top-[calc(100%+6px)] z-50 max-h-[260px] overflow-y-auto rounded-[12px] border border-[#DCDCE1] bg-white p-1.5 
1shadow-[0_12px_30px_rgba(35,32,42,0.14)] sm:bottom-[calc(100%+6px)] sm:top-auto",children:c.map(e=>{let t=e.value===o;return(0,n.jsxs)("button",{type:"button",role:"option","aria-selected":t,onClick:()=>{m(e.value),u(!1)},className:"flex h-10 w-full items-center gap-3 rounded-[9px] px-2.5 text-left transition ".concat(t?"bg-[#F1ECF5] hover:bg-[#ECE5F2]":"hover:bg-[#F5F5F6]"),children:[(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate text-[14px] font-medium ".concat(t?"text-[#67519C]":"text-[#25262A]"),children:e.label}),(0,n.jsx)("span",{className:"flex size-[18px] shrink-0 items-center justify-center rounded-[5px] border transition ".concat(t?"border-[#67519C] bg-[#67519C] text-white":"border-[#D7D7DC] bg-white text-transparent"),children:(0,n.jsx)(r.A,{className:"size-3",strokeWidth:2.5})})]},e.value)})}):null]})]})}},12211:(e,t,s)=>{"use strict";s.d(t,{C:()=>r,J:()=>i});var n=s(12115),a=s(20063);let r={start:!1,query:"",streamDemo:!1};function i(e){var t;let{onChange:s}=e,r=(0,a.useSearchParams)(),i=1===r.getAll("start").length&&"1"===r.get("start"),l=null!=(t=r.get("q"))?t:"";return(0,n.useEffect)(()=>{s({start:i,query:l,streamDemo:!1})},[s,i,l,!1]),null}},17721:(e,t,s)=>{"use strict";s.d(t,{AL:()=>a,WR:()=>l,Wd:()=>n,xz:()=>
1o});let n=[{value:"apa",label:"APA (7th ed.)",bibliographyTitle:"References"},{value:"ieee",label:"IEEE",bibliographyTitle:"References"},{value:"mla",label:"MLA (9th ed.)",bibliographyTitle:"Works Cited"},{value:"ama",label:"AMA (11th ed.)",bibliographyTitle:"References"},{value:"acs",label:"ACS (numeric)",bibliographyTitle:"References"},{value:"chicago",label:"Chicago (Author-Date, 18th ed.)",bibliographyTitle:"Reference List"},{value:"harvard",label:"Harvard",bibliographyTitle:"Reference List"},{value:"vancouver",label:"Vancouver",bibliographyTitle:"References"},{value:"gbt7714",label:"GB/T 7714-2025",bibliographyTitle:"参考文献"}];function a(e){var t;return null!=(t=n.find(t=>t.value===e))?t:n[0]}let r={apa:"APA",ieee:"IEEE",mla:"MLA",ama:"AMA",acs:"ACS",chicago:"Chicago",harvard:"Harvard",vancouver:"Vancouver",gbt7714:"GBT7714"},i=new Map(Object.entries(r).map(e=>{let[t,s]=e;return[s,t]}));function l(e){return r[e]}function o(e){var t;return e&&null!=(t=i.get(e))?t:"apa"}},18514:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(71847).A)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},21228:(e,t,s)=>{"use strict";s.d(t,{F:()=>p});var n=s(95155),a=s(24033),r=s(5917),i=s(89715),l=s(35795),o=s(86651),c=s(95604),d=s(12115),u=s(252);let m=["q1","q2","q3","q4"],x=["#36C6A4","#F2B900","#FF6B16","#FF6670"];function p(e){var t,s,p;let{filters:h,onChange:f,citationStyleControl:b}=e,g=(0,c.useLocale)(),v=(0,c.useTranslations)("v3.research"),y=(0,c.useTranslations)("v3.writing.start"),[w,j]=(0,d.useState)(!1),[N,C]=(0,d.useState)(!1),[A,k]=(0,d.useState)(!1),[F,E]=(0,d.useState)(""),D=new Date().getFullYear(),S=null===h.yearFrom&&null===h.yearTo?"any":h.yearTo===D&&h.yearFrom===D-2?"past2":h.yearTo===D&&h.yearFrom===D-5?"past5":h.yearTo===D&&h.yearFrom===D-10?"past10":"custom",_=(0,d.useMemo)(()=>{let e=new Intl.DisplayNames([g],{type:"region"}),t=F.trim().toLocaleLowerCase(g);return u.O.map(t=>{var s;return{code:t,label:null!=(s=e.of(t))?s:t}}
1).filter(e=>{let{code:s,label:n}=e;return!t||s.toLocaleLowerCase(g).includes(t)||n.toLocaleLowerCase(g).includes(t)})},[F,g]);return(0,n.jsx)("section",{className:"mt-1 pt-1",children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"grid gap-2 sm:grid-cols-[116px_minmax(0,1fr)] sm:items-start sm:gap-4",children:[(0,n.jsx)("h4",{className:"text-[13px] font-semibold text-[#55565E] sm:pt-2",children:v("ui.filters.publicationYear")}),(0,n.jsx)("div",{className:"w-full min-w-0",children:(0,n.jsx)("div",{className:"flex flex-wrap items-center justify-start gap-1.5 sm:justify-end",children:[["any",v("ui.filters.anyYear"),null],["past2",v("ui.filters.pastYears",{count:2}),2],["past5",v("ui.filters.pastYears",{count:5}),5],["past10",v("ui.filters.pastYears",{count:10}),10]].map(e=>{let[t,s,a]=e;return(0,n.jsx)("button",{type:"button",onClick:()=>(e=>{if(null===e){f("yearFrom",null),f("yearTo",null);return}f("yearFrom",D-e),f("yearTo",D)})(a),className:"inline-flex h-8 shrink-0 items-center justify-center whitespace-nowrap rounded-[9px] px-3 text-[12px] font-semibold transition ".concat(S===t?"bg-[#F1ECF5] text-[#67519C]":"bg-[#F2F2F4] text-[#777781] hover:bg-[#E9E9EC]"),children:s},String(t))})})})]}),b,(0,n.jsxs)("button",{type:"button","aria-expanded":w,"aria-controls":"writing-source-more-settings",onClick:()=>{j(e=>!e),C(!1),k(!1)},className:"flex h-10 w-full items-center justify-between rounded-[10px] bg-[#F7F6F8] px-3 text-left text-[13px] font-semibold text-[#64616A] transition hover:bg-[#F1EEF4] hover:text-[#67519C] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#8F7ABA]/35",children:[(0,n.jsx)("span",{children:y("moreSettings")}),(0,n.jsx)(a.A,{className:"size-4 transition-transform duration-200 ".concat(w?"rotate-180":"")})]}),(0,n.jsx)("div",{id:"writing-source-more-settings","aria-hidden":!w,className:"grid transition-[grid-template-rows,opacity] duration-200 motion-reduce:transition-none ".concat(w?"grid-rows-[1fr] opacity-100":"pointer-events-none grid-rows-[0fr] opacity-0"),children:(0,n.jsx)("div",{className:"min-h-0 ".concat(w?"overflow-visible":"overflow-hidden"),children:(0,n.jsxs)("div",{className:"space-y-4 border-t border-[#ECE9EE] pt-4",children:[(0,n.jsxs)("div",{className:"grid gap-2 sm:grid-cols-[116px_minmax(0,1fr)] sm:items-start sm:gap-4",children:[(0,n.jsx)("span",{className:"text-[13px] font-semibold text-[#55565E] sm:pt-2",children:y("customYearRange")}),(0,n.jsxs)("div",{className:"grid grid-cols-[1fr_auto_1fr] items-center gap-2 sm:ml-auto sm:max-w-[300px]",children:[(0,n.jsx)("input",{type:"number",min:1800,value:null!=(t=h.yearFrom)?t:"",onChange:e=>f("yearFrom",e.target.value?Number(e.target.value):null),onBlur:()=>{null!==h.yearFrom&&h.yearFrom<1800&&f("yearFrom",1800)},"aria-label":y("customYearFrom"),placeholder:v("ui.filters.noMinimumYear"),className:"h-9 min-w-0 rounded-[10px] border border-[#DCDCE1] px-3 text-[14px] outline-none transition placeholder:text-[#A3A3AD] focus:border-[#8C79B2] focus:ring-2 focus:ring-[#67519C]/10"}),(0,n.jsx)("span",{className:"text-[15px] text-[#85858F]",children:"–"}),(0,n.jsx)("input",{type:"number",min:1800,value:null!=(s=h.yearTo)?s:"",onChange:e=>f("yearTo",e.target.value?Number(e.target.value):null),onBlur:()=>{null!==h.yearTo&&h.yearTo<1800&&f("yearTo",1800)},"aria-label":y("customYearTo"),placeholder:String(D),className:"h-9 min-w-0 rounded-[10px] border border-[#DCDCE1] px-3 text-[14px] outline-none transition placeholder:text-[#A3A3AD] focus:border-[#8C79B2] focus:ring-2 focus:ring-[#67519C]/10"})]})]}),(0,n.jsxs)("div",{className:"grid gap-2 sm:grid-cols-[116px_minmax(0,1fr)] sm:items-start sm:gap-4",children:[(0,n.jsx)("h4",{className:"text-[13px] font-semibold text-[#55565E] sm:pt-2",children:v("ui.filters.journalRank")}),(0,n.jsxs)("div",{className:"relative w-full min-w-0 sm:max-w-[260px] sm:justify-self-end",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>{k(!1),C(e=>!e)},"aria-expanded":N,className:"flex h-9 w-full items-center justify-between rounded-[10px] border border-[#DCDCE1] bg-white px-3 text-left text-[14px] text-[#292A2E] outline-none transition hover:border-[#C9C7CE] focus:border-[#8C79B2] focus:ring-2 focus:ring-[#67519C]/10",children:[(0,n.jsx)("span",{className:"truncate",children:0===h.journalRank.length?v("ui.filters.anyJournalRank"):h.journalRank.map(e=>e.toUpperCase()).join(", ")}),(0,n.jsx)(a.A,{className:"size-4 shrink-0 transition-transform ".concat(N?"rotate-180":"")})]}),N?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button","aria-label":v("ui.filters.closeJournalRank"),onClick:()=>C(!1),className:"fixed inset-0 z-20 cursor-default"}),(0,n.jsx)("div",{className:"absolute left-0 right-0 top-[calc(100%+6px)] z-30 overflow-hidden rounded-[12px] border border-[#DCDCE1] bg-white p-1.5 
1shadow-[0_12px_30px_rgba(35,32,42,0.14)]",children:m.map((e,t)=>{let s=h.journalRank.includes(e),a=4-t;return(0,n.jsxs)("button",{type:"button",onClick:()=>{f("journalRank",h.journalRank.includes(e)?h.journalRank.filter(t=>t!==e):[...h.journalRank,e])},className:"flex h-10 w-full items-center gap-2.5 rounded-[9px] px-2.5 text-left transition ".concat(s?"bg-[#F1ECF5] hover:bg-[#ECE5F2]":"hover:bg-[#F5F5F6]"),children:[(0,n.jsx)("span",{className:"flex shrink-0 gap-1",children:[0,1,2,3].map(e=>(0,n.jsx)("span",{className:"h-2 w-5 rounded-full",style:{backgroundColor:e<a?x[t]:"#D5D5DA"}},e))}),(0,n.jsx)("span",{className:"min-w-0 flex-1 text-[14px] font-semibold ".concat(s?"text-[#67519C]":"text-[#25262A]"),children:e.toUpperCase()}),(0,n.jsx)("span",{className:"flex size-[18px] shrink-0 items-center justify-center rounded-[5px] border ".concat(s?"border-[#67519C] bg-[#67519C] text-white":"border-[#D7D7DC] bg-white text-transparent"),children:(0,n.jsx)(r.A,{className:"size-3",strokeWidth:2.5})})]},e)})})]}):null]})]}),(0,n.jsxs)("label",{className:"grid gap-2 sm:grid-cols-[116px_minmax(0,1fr)] sm:items-start sm:gap-4",children:[(0,n.jsx)("span",{className:"block text-[13px] font-semibold text-[#55565E] sm:pt-2",children:v("ui.filters.minimumCitations")}),(0,n.jsxs)("div",{className:"relative w-full min-w-0 sm:max-w-[220px] sm:justify-self-end",children:[(0,n.jsx)("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-[12px] text-[#A0A0AA]",children:v("ui.filters.atLeast")}),(0,n.jsx)("input",{type:"number",min:0,value:null!=(p=h.minimumCitations)?p:"",onChange:e=>f("minimumCitations",e.target.value?Number(e.target.value):null),placeholder:"0",className:"h-9 w-full rounded-[10px] border border-[#DCDCE1] pl-[66px] pr-3 text-[14px] outline-none transition placeholder:text-[#A3A3AD] focus:border-[#8C79B2] focus:ring-2 focus:ring-[#67519C]/10"})]})]}),(0,n.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:[{label:v("excludePreprints"),checked:h.excludePreprints,onToggle:()=>f("excludePreprints",!h.excludePreprints),icon:i.A},{label:v("openAccessOnly"),checked:h.openAccessOnly,onToggle:()=>f("openAccessOnly",!h.openAccessOnly),icon:l.A}].map(e=>{let t=e.icon;return(0,n.jsxs)("div",{className:"flex min-h-10 items-center gap-2 rounded-[9px] bg-[#F8F7F8] px-2.5",children:[(0,n.jsx)(t,{className:"size-4 shrink-0 text-[#55565E]"}),(0,n.jsx)("span",{className:"min-w-0 flex-1 text-[12px] font-semibold leading-4 text-[#38393E]",children:e.label}),(0,n.jsx)("button",{type:"button",role:"switch","aria-label":e.label,"aria-checked":e.checked,onClick:e.onToggle,className:"relative h-5 w-9 shrink-0 rounded-full transition ".concat(e.checked?"bg-[#67519C]":"bg-[#D4D4D9]"),children:(0,n.jsx)("span",{className:"absolute top-[2px] size-4 rounded-full bg-white shadow-sm transition ".concat(e.checked?"left-[18px]":"left-[2px]")})})]},e.label)})}),(0,n.jsxs)("div",{className:"grid gap-2 sm:grid-cols-[116px_minmax(0,1fr)] sm:items-start sm:gap-4",children:[(0,n.jsx)("span",{className:"text-[13px] font-semibold text-[#55565E] sm:pt-2",children:v("ui.filters.country")}),(0,n.jsxs)("div",{className:"relative w-full min-w-0 sm:max-w-[240px] sm:justify-self-end",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>{C(!1),k(e=>!e)},"aria-expanded":A,className:"flex h-9 w-full items-center justify-between rounded-[10px] border border-[#DCDCE1] bg-white px-3 text-left outline-none transition hover:border-[#C9C7CE] focus:border-[#8C79B2] focus:ring-2 focus:ring-[#67519C]/10",children:[(0,n.jsx)("span",{className:"block truncate text-[14px] text-[#292A2E]",children:h.country.length?v("ui.filters.countriesSelected",{count:h.country.length}):v("ui.filters.anyCountry")}),(0,n.jsx)(a.A,{className:"size-4 transition-transform ".concat(A?"rotate-180":"")})]}),A?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button","aria-label":v("ui.filters.closeCountries"),onClick:()=>k(!1),className:"fixed inset-0 z-20 cursor-default"}),(0,n.jsxs)("div",{className:"absolute left-0 right-0 top-[calc(100%+6px)] z-30 rounded-[12px] border border-[#DCDCE1] bg-white p-2 shadow-[0_12px_30px_rgba(35,32,42,0.16)] sm:bottom-[calc(100%+6px)] sm:top-auto",children:[(0,n.jsxs)("label",{className:"relative block",children:[(0,n.jsx)(o.A,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-[#9A9AA4]"}),(0,n.jsx)("input",{type:"search",value:F,onChange:e=>E(e.target.value),placeholder:v("ui.filters.searchCountries"),autoFocus:!0,className:"h-9 w-full rounded-[10px] border border-[#DCDCE1] pl-9 pr-3 text-[14px] outline-none transition placeholder:text-[#A3A3AD] focu
1s:border-[#8C79B2] focus:ring-2 focus:ring-[#67519C]/10"})]}),(0,n.jsxs)("div",{className:"mt-2 max-h-[230px] space-y-0.5 overflow-y-auto pr-1",children:[_.map(e=>{let{code:t,label:s}=e,a=h.country.includes(t);return(0,n.jsxs)("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-[9px] px-1.5 py-2 transition ".concat(a?"bg-[#F7F3FA] hover:bg-[#F1ECF5]":"hover:bg-[#F5F5F6]"),children:[(0,n.jsx)("input",{type:"checkbox",checked:a,onChange:()=>{f("country",h.country.includes(t)?h.country.filter(e=>e!==t):[...h.country,t])},className:"sr-only"}),(0,n.jsx)("span",{className:"flex size-[18px] shrink-0 items-center justify-center rounded-[5px] border ".concat(a?"border-[#67519C] bg-[#67519C] text-white":"border-[#D8D8DE] bg-white text-transparent"),children:(0,n.jsx)(r.A,{className:"size-3",strokeWidth:2.5})}),(0,n.jsx)("span",{className:"text-[13px] font-medium text-[#292A2E]",children:s})]},t)}),0===_.length?(0,n.jsx)("p",{className:"px-1 py-5 text-center text-[13px] text-[#8B8B94]",children:v("ui.filters.noCountriesFound")}):null]})]})]}):null]})]})]})})})]})})}},21786:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(71847).A)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]])},24033:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(71847).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},27937:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(71847).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},35299:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(71847).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},35795:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(71847).A)("lock-open",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]])},36040:(e,t,s)=>{"use strict";s.d(t,{WritingEntry:()=>H});var n=s(95155),a=s(12115),r=s(12211),i=s(54485),l=s(90799),o=s(5917),c=s(27937),d=s(86651),u=s(65229),m=s(35299),x=s(71847);let p=(0,x.A)("file-warning",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var h=s(89715),f=s(6191),b=s(5789),g=s(50386);let v=(0,x.A)("file-pen-line",[["path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2",key:"142zxg"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}],["path",{d:"M8 18h1",key:"13wk12"}]]),y=(0,x.A)("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);var w=s(95740),j=(s(5937),s(21786),s(45390)),N=s(95604),C=s(15239),A=s(20063),k=s(29420),F=s(19798),E=s(90107),D=s(39991),S=s(75288),_=s(76305),M=s(92766),z=s(19826),R=s(40411),B=s(7232),I=s(17721),T=s(9626),L=s(77154),P=s(3760),G=s(39452),W=s(21228),O=s(62720),V=s(10932);let q=[3e3,5e3,1e4];function U(e){return"".concat(e.name,":").concat(e.size,":").concat(e.lastModified,":").concat(e.type)}function Y(e){let{autoStart:t=!1}=e,s=(0,A.useRouter)(),r=(0,N.useLocale)(),x=(0,N.useTranslations)("v3.writing.start"),Y=(0,N.useTranslations)("v3.writing.compose"),{isInitializing:H,isLoggedIn:K,user:J,ensureGuestSession:Z,setLoginMode:Q}=(0,F.J)(),X=(0,a.useMemo)(()=>(0,E.UI)(J),[J]),$=X.isGuest||X.isFree?1:3,ee=(0,S.y)(),[et,es]=(0,a.useState)(!1),[en,ea]=(0,a.useState)(null),er=(0,a.useRef)(!1),[ei,el]=(0,a.useState)(!0),[eo,ec]=(0,a.useState)(!1),[ed,eu]=(0,a.useState)(!1),[em,ex]=(0,a.useState)(!1),[ep,eh]=(0,a.useState)(!1),[ef,eb]=(0,a.useState)(!1),[eg,ev]=(0,a.useState)("article"),[ey,ew]=(0,a.useState)(3e3),[ej,eN]=(0,a.useState)(!1),[eC,eA]=(0,a.useState)("3000"),[ek,eF]=(0,a.useState)("fast"),[eE,eD]=(0,a.useState)([]),[eS,e_]=(0,a.useState)(!1),[eM,ez]=(0,a.useState)(!1),[eR,eB]=(0,a.useState)(!0),[eI,eT]=(0,a.useState)([]),[eL,eP]=(0,a.useState)(null),[eG,eW]=(0,a.useState)(!1),eO=(0,a.useRef)(null),eV=(0,a.useRef)(null),eq=(0,a.useRef)(null),eU=(0,a.useRef)(0),eY=(0,a.useRef)(new Set),eH=(0,a.useRef)(new Set),eK=(0,a.useRef)(null),eJ=(0,a.useRef)(!1),{requirements:eZ,citationStyle:eQ,sourceFilters:eX,setRequirements:e$,setCitationStyle:e0,setSourceFilter:e1,resetSourceFilters:e2,markSubmitted:e5}=(0,T.o)(),e4=(0,a.useRef)(T.o.getState().submitted),e7=[x("quickUseCases.one"),x("quickUseCases.two"),x("quickUseCases.three")],e6=eZ.trim().length>0,e3=eE.length>0,e9=eE.filter(e=>"validating"===e.status).length,e8=eE.filter(e=>"ready"===e.status),te=eE.length>=1&&e8.length===eE.length,tt=e3&&!te,ts=e6||null!==eL||e3,tn="article"===eg,ta=ei||eo||ts&&em,tr=()=>!!K||(e_(!1),ee("login"),Q(!0),!1),ti=e=>(null==e?void 0:e.includes("LIBRARY_TEXT_EMPTY"))?x("documentValidation.emptyText"):(null==e?void 0:e.includes("LIBRARY_FILE_UNSUPPORTED"))?x("documentValidation.unsupported"):(null==e?void 0:e.includes("LIBRARY_FILE_REQUIRED"))?x("documentValidation.emptyFile"):x("documentValidation.failed"),tl=async e=>{let t=eU.current+1;eU.current=t,eY.current.add(t);let s=e.map((e,s)=>({id:"".concat(t,":").concat(s,":").concat(e.name,":").concat(e.size,":").concat(e.lastModified),file:e,status:"val
1idating"}));eD(e=>[...e,...s]),ez(!1);let n=(e,s)=>{eY.current.has(t)&&eD(t=>t.map(t=>t.id===e?{...t,...s}:t))},a=0,r=async()=>{for(;a<s.length;){let e=s[a];if(a+=1,!e)return;try{let t=(await (0,M.Pv)([e.file],"writing_chat_upload")).items[0];if(eH.current.has(e.id)){(null==t?void 0:t.libraryItemId)&&await (0,M._R)(t.libraryItemId).catch(()=>void 0),eH.current.delete(e.id);continue}(null==t?void 0:t.paperId)?n(e.id,{status:"ready",libraryItemId:t.libraryItemId,paperId:t.paperId}):n(e.id,{status:"failed",...(null==t?void 0:t.libraryItemId)?{libraryItemId:t.libraryItemId}:{},errorMessage:ti(null==t?void 0:t.abstractExtraction.message)})}catch(t){n(e.id,{status:"failed",errorMessage:x("documentValidation.uploadFailed")})}}};try{await Promise.all(Array.from({length:Math.min(3,s.length)},()=>r()))}finally{eY.current.delete(t)}};(0,a.useLayoutEffect)(()=>{e4.current&&T.o.getState().clearSubmittedDraft()},[]),(0,a.useEffect)(()=>()=>{eY.current.clear()},[]),(0,a.useEffect)(()=>{let e=!0;return eB(!0),(async()=>{try{if(!await Z())return;let{items:t}=await (0,_.Hg)();e&&eT(t.slice(0,$))}catch(t){e&&eT([])}finally{e&&eB(!1)}})(),()=>{e=!1}},[Z,$]),(0,a.useEffect)(()=>{if(!eS)return;let e=e=>{var t;(null==(t=eK.current)?void 0:t.contains(e.target))||e_(!1)},t=e=>{"Escape"===e.key&&e_(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[eS]),(0,a.useEffect)(()=>{if(!eM)return;let e=e=>{"Escape"===e.key&&ez(!1)};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[eM]);let to=async e=>{for(let t=0;t<30;t+=1){let{items:t}=await (0,_.Hg)(),s=t.find(t=>t.conversationId===e);if(s)return s;await new Promise(e=>{window.setTimeout(e,700)})}throw Error(x("multiDocumentPreparationFailed"))},tc=async(e,t,s)=>{var n;let a=e.flatMap(e=>"ready"===e.status&&e.paperId?[e.paperId]:[]);if(a.length!==e.length)throw Error(x("documentValidation.resolveErrors"));let r=s?await (0,z.Uc)(s.conversationId,{limit:50}):null,i=(null!=(n=null==r?void 0:r.papers.map(e=>e.paperId))?n:[]).slice(0,Math.max(0,50-a.length)),l=Array.from(new Set([...a,...i])).slice(0,50),o=[x("multiDocumentResearchPrompt")];s&&o.push(x("multiDocumentResearchContext",{title:s.title,strategy:s.writingStrategy})),t&&o.push(x("multiDocumentWritingBrief",{brief:t}));let c=x("multiDocumentTitle",{count:e.length}),d=await (0,z.j)(c),u=await (0,z.Yt)({conversationId:d.conversationId,content:o.join("\n\n"),mode:"fast",corpus:"library",selected_papers:l,...s?{source_conversation_id:s.conversationId}:{}},{onEvent:()=>void 0});if((null==u?void 0:u.type)!=="run.completed")throw Error(x("multiDocumentGenerationFailed"));return await to(d.conversationId),d.conversationId},td=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"outline",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=null!==n,i=!a&&e3;if(!e&&!eZ.trim()&&!i||er.current)return;if(i&&!te)return void R.A.error(e9>0?x("documentValidation.waitForValidation"):x("documentValidation.resolveErrors"),3e3);if(!K){ee("login"),Q(!0);return}let l=a?"":eZ.trim(),o=(null==n?void 0:n.name.replace(/\.docx$/i,"").trim())||(i?x("multiDocumentTitle",{count:eE.length}):x("untitled")),c={filters:{...null!==eX.yearFrom?{yearFrom:eX.yearFrom}:{},...null!==eX.yearTo?{yearTo:eX.yearTo}:{},...eX.journalRank.length?{journalQuartiles:eX.journalRank.map(e=>Number(e.slice(1)))}:{},...null!==eX.minimumCitations?{citationCountMin:eX.minimumCitations}:{},...eX.excludePreprints?{excludePreprints:!0}:{},...eX.openAccessOnly?{openAccessOnly:!0}:{},...eX.country.length?{countries:eX.country}:{}},citationStyle:(0,I.WR)(eQ),librarySearchEnabled:!1,webSearchEnabled:!1};er.current=!0,ea(a?"parse":i?"documents":t),es(!0);try{let e=i?await tc(eE,l,eL):null,t=null!=e?e:a||null==eL?void 0:eL.conversationId,d=(await (0,_.h1)({title:o,...l?{document_prompt:l}:{},...t?{source_research_conversation_id:t}:{},settings:c})).writing_id;n?await (0,G.Pu)(d,n):"article"===eg&&l?(0,P.EM)(d,{documentPrompt:l,...t?{hasResearchSource:!0}:{},headingsStyle:"generate",quality:X.isPaid?ek:"fast",targetLength:ey,createdAt:Date.now()}):(l||t)&&(0,L.aC)(d,{documentPrompt:l,...t?{hasResearchSource:!0}:{},style:"smart"===eg?"generate":"standard"===eg?"standard":"none",createdAt:Date.now()}),e5(),B.A.setItem("current_document_id",d),B.A.setItem("document_version","v3"),B.A.setItem("writing-title-mode",eg),B.A.removeItem("chat-first-message"),B.A.removeItem("chat-first-message-files"),B.A.removeItem("chat-first-message-images"),s.push((0,D.m)(r,"/writing/".concat(d)))}catch(e){er.current=!1,ea(null),es(!1),R.A.error(e instanceof Error?e.message:"Unable to create Writing.",2500)}};return(0,a.useEffect)(()=>{t&&!eJ.current&&!er.current&&eZ.trim()&&(eJ.current=!0,td(!1,"outline"))},[t,eZ]),(0,n.jsxs)("section",{className:"relative w-full bg-white px-4 font-app sm:px-6",children:[(0,n.jsx)(O.A,{open:eG,onClose:()=>eW(!1),anchorRef:eO,labels:{close:x("history.close"),title:x("history.title"),search:x("history.search"),empty:x("history.empty"),rename:x("history.rename"),delete:x("history.delete"),deleteConfirmTitle:x("history.deleteConfirmTitle"),deleteConfirmDescription:x("history.deleteConfirmDescription"),deleteConfirmCancel:x("history.deleteConfirmCancel"),deleteConfirmAction:x("history.deleteConfirmAction"),deleteSuccess:x("history.deleteSuccess"),deleteError:x("history.deleteError")}}),(0,n.jsx)("div",{id:"writing-start",className:"mx-auto flex min-h-[calc(100dvh-var(--v3-top,54px))] w-full max-w-[680px] flex-col ".concat(ta?"justify-start pb-10 pt-9 sm:pb-12 sm:pt-12 lg:pt-14":"justify-center py-10 sm:py-12"),children:(0,n.jsxs)(j.P.div,{layout:"position",layoutDependency:ta,initial:!1,transition:{type:"tween",duration:.34,ease:[.22,1,.36,1]},className:"w-full",children:[(0,n.jsxs)("div",{className:"mb-7 px-3 text-center sm:mb-8",children:[(0,n.jsx)("h1",{className:"text-[28px] font-semibold leading-[1.15] tracking-[-0.035em] text-[#171619] sm:text-[34px]",children:x("workspaceTitle")}),(0,n.jsx)("p",{className:"mx-auto mt-2.5 max-w-[540px] text-[14px] leading-6 text-[#77747D] sm:text-[15px]",children:x("workspaceDescription")})]}),!H&&K&&(0,n.jsx)("div",{className:"mb-2 flex min-h-9 items-center",children:(0,n.jsx)("button",{ref:eO,type:"button",onClick:()=>eW(e=>!e),className:"flex size-9 items-center justify-center rounded-[10px] text-[#626662] transition hover:bg-[#F3F2EF] hover:text-[#67519C]","aria-label":x("history.open"),title:x("history.title"),children:(0,n.jsx)(i.A,{className:"size-[18px]"})})}),(0,n.jsxs)("fieldset",{disabled:et,"aria-busy":et,className:"m-0 min-w-0 border-0 p-0 ".concat(et?"pointer-events-none select-none":""),children:[(0,n.jsxs)("div",{className:"relative min-w-0 rounded-[16px] border border-[#
1E2DFE6] bg-white shadow-[0_16px_44px_rgba(39,31,51,0.065)] ".concat(ei?"overflow-visible":"overflow-hidden"," ").concat(eS?"z-30":"z-0"),children:[(0,n.jsxs)("button",{type:"button",onClick:()=>{el(e=>!e),e_(!1),ez(!1),ec(!1),eu(!1),ex(!1)},"aria-expanded":ei,className:"flex h-14 w-full items-center gap-3 px-4 text-left text-[14px] font-semibold text-[#202020] sm:px-5 sm:text-[15px]",children:[(0,n.jsx)("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-[9px] bg-[#F1EDF7] text-[#67519C]",children:(0,n.jsx)(l.A,{className:"size-[17px]"})}),(0,n.jsx)("span",{children:x("describeDocument")}),ep?(0,n.jsx)("span",{className:"flex size-5 items-center justify-center rounded-full bg-[#36C96B] text-white",children:(0,n.jsx)(o.A,{className:"size-3.5",strokeWidth:3})}):null,(0,n.jsx)("span",{className:"flex-1"}),(0,n.jsx)(c.A,{className:"size-4 text-[#6D6D76] transition-transform duration-300 ease-out ".concat(ei?"rotate-90":"")})]}),(0,n.jsx)("div",{"aria-hidden":!ei,inert:!ei,className:"grid min-w-0 transition-[grid-template-rows,opacity] duration-[320ms] ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none ".concat(ei?"grid-rows-[1fr] opacity-100":"pointer-events-none grid-rows-[0fr] opacity-0"),children:(0,n.jsx)("div",{className:"min-h-0 min-w-0 ".concat(ei?"overflow-visible":"overflow-hidden"),children:(0,n.jsxs)("div",{className:"min-w-0 px-4 pb-4 sm:px-5 sm:pb-5",children:[(0,n.jsxs)("div",{className:"relative min-w-0 rounded-[12px] bg-transparent p-3.5 pb-14 shadow-[0_6px_22px_rgba(39,31,51,0.055)] transition-shadow focus-within:shadow-[0_8px_28px_rgba(39,31,51,0.075)]",children:[eL||e3?(0,n.jsxs)("div",{className:"flex w-full min-w-0 max-w-full gap-2 overflow-x-auto overscroll-x-contain pb-1 pr-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[eL?(0,n.jsxs)("div",{className:"relative flex h-12 w-[190px] shrink-0 items-center rounded-[9px] bg-[#F6F5F7] px-2.5 pr-8",children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,n.jsx)(d.A,{className:"size-[16px] shrink-0 text-[#67519C]"}),(0,n.jsx)("span",{className:"block min-w-0 flex-1 truncate text-[12px] font-semibold leading-4 text-[#34343A]",title:eL.title,children:eL.title})]}),(0,n.jsx)("button",{type:"button","aria-label":x("recentResearch.remove"),onClick:()=>eP(null),className:"absolute right-1.5 top-1/2 flex size-[18px] -translate-y-1/2 items-center justify-center rounded-full text-[#89858F] transition hover:bg-[#E8E5EC] hover:text-[#4B4751]",children:(0,n.jsx)(u.A,{className:"size-3"})})]}):null,eE.map(e=>(0,n.jsxs)("div",{className:"relative h-12 w-[190px] shrink-0 rounded-[9px] px-2.5 pr-8 ".concat("failed"===e.status?"bg-[#FFF6F5]":"bg-[#F6F5F7]"," ").concat("ready"===e.status?"flex items-center":"py-1.5"),children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:["validating"===e.status?(0,n.jsx)(m.A,{className:"size-[17px] shrink-0 animate-spin text-[#67519C]"}):"failed"===e.status?(0,n.jsx)(p,{className:"size-[17px] shrink-0 text-[#C25454]"}):(0,n.jsx)(h.A,{className:"size-[17px] shrink-0 text-[#67519C]"}),(0,n.jsx)("span",{className:"block min-w-0 flex-1 truncate text-[12px] font-semibold leading-4 text-[#34343A]",title:e.file.name,children:e.file.name})]}),"ready"!==e.status?(0,n.jsx)("p",{title:e.errorMessage,className:"ml-[25px] mt-0.5 truncate text-[10px] leading-[14px] ".concat("failed"===e.status?"font-medium text-[#B45454]":"text-[#85818A]"),children:"validating"===e.status?x("documentValidation.validating"):e.errorMessage}):null,(0,n.jsx)("button",{type:"button","aria-label":x("removeGenerationDocument",{name:e.file.name}),onClick:()=>{eH.current.add(e.id),eD(t=>t.filter(t=>t.id!==e.id)),e.libraryItemId&&(0,M._R)(e.libraryItemId).catch(()=>void 0)},className:"absolute right-1.5 top-1/2 flex size-[18px] -translate-y-1/2 items-center justify-center rounded-full text-[#89858F] transition hover:bg-[#E8E5EC] hover:text-[#4B4751]",children:(0,n.jsx)(u.A,{className:"size-3"})})]},e.id))]}):null,(0,n.jsx)("textarea",{value:eZ,onChange:e=>e$(e.target.value),placeholder:x("descriptionPlaceholder"),className:"".concat(eL||e3?"mt-3 h-16":"h-[106px]"," w-full resize-none border-0 bg-transparent px-1 py-1 text-[14px] leading-6 text-[#101010] outline-none placeholder:text-[#A0A3AA] disabled:cursor-not-allowed disabled:text-[#A5A5AC] disabled:placeholder:text-[#B6B6BC]")}),(0,n.jsxs)("div",{ref:eK,className:"absolute bottom-3.5 left-3.5 z-30",children:[(0,n.jsx)("button",{type:"button","aria-expanded":eS,"aria-haspopup":"menu","aria-label":x("importMe
1nu.open"),title:x("importMenu.hint"),onClick:()=>{ez(!1),e_(e=>!e)},className:"flex size-8 items-center justify-center rounded-full border bg-white shadow-sm transition ".concat(eS?"border-[#67519C] bg-[#EEE9F5] text-[#67519C]":"border-[#D5D0DB] text-[#69666F] hover:border-[#AFA3C0] hover:bg-[#F7F4FA] hover:text-[#67519C]"),children:(0,n.jsx)(f.A,{className:"size-[18px] transition-transform ".concat(eS?"rotate-45":"")})}),eS?(0,n.jsxs)("div",{role:"menu",className:"absolute left-0 top-10 z-40 w-[320px] max-w-[calc(100vw-4rem)] overflow-hidden rounded-[12px] border border-[#DDD8E2] bg-white p-1.5 shadow-[0_14px_34px_rgba(38,31,49,0.14)]",children:[(0,n.jsx)("p",{className:"px-3 pb-1.5 pt-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-[#97929B]",children:x("importMenu.title")}),(0,n.jsxs)("button",{type:"button",role:"menuitem",disabled:eR||0===eI.length,onClick:()=>{e_(!1),ez(!0)},className:"group flex w-full items-start gap-3 rounded-[9px] px-3 py-2.5 text-left transition hover:bg-[#F7F4FA] disabled:cursor-not-allowed disabled:opacity-45",children:[(0,n.jsx)("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-[8px] bg-[#EEE9F5] text-[#67519C]",children:eR?(0,n.jsx)(m.A,{className:"size-4 animate-spin"}):(0,n.jsx)(i.A,{className:"size-4"})}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block text-[13px] font-semibold text-[#29272C]",children:x("recentResearch.title")}),(0,n.jsx)("span",{className:"mt-0.5 block text-[11px] leading-4 text-[#86818B]",children:0!==eI.length||eR?x("importMenu.researchDescription",{count:eI.length}):x("importMenu.researchEmpty")})]})]}),(0,n.jsxs)("button",{type:"button",role:"menuitem",disabled:e9>0,onClick:()=>{var e;tr()&&(e_(!1),null==(e=eq.current)||e.click())},className:"group flex w-full items-start gap-3 rounded-[9px] px-3 py-2.5 text-left transition hover:bg-[#F7F4FA] disabled:cursor-not-allowed disabled:opacity-45",children:[(0,n.jsx)("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-[8px] bg-[#EEE9F5] text-[#67519C]",children:(0,n.jsx)(h.A,{className:"size-4"})}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block text-[13px] font-semibold text-[#29272C]",children:x("importMenu.generateFromDocuments")}),(0,n.jsx)("span",{className:"mt-0.5 block text-[11px] leading-4 text-[#86818B]",children:x("importMenu.generateFromDocumentsDescription")})]})]})]}):null]}),(0,n.jsx)("div",{role:"radiogroup","aria-label":x("generationQuality.label"),"aria-disabled":!tn,"data-writing-generation-quality":"selector",className:"absolute bottom-3.5 right-3.5 grid h-8 w-[144px] shrink-0 grid-cols-2 rounded-full p-0.5 transition ".concat(tn?"bg-[#FAF9FB]":"bg-[#FBFAFB]"),children:[{value:"fast",label:x("generationQuality.fast")},{value:"deep",label:x("generationQuality.deep")}].map(e=>{let t=ek===e.value;return(0,n.jsx)("button",{type:"button",role:"radio","aria-checked":t,disabled:!tn,title:tn?x("generationQuality.".concat(e.value,"Description")):x("generationQuality.disabledHint"),onClick:()=>eF(e.value),className:"flex h-7 items-center justify-center rounded-full px-2 text-[13px] font-semibold transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#8F7ABA]/40 disabled:cursor-not-allowed ".concat(tn?t?"bg-[#F2EEF6] text-[#665278] shadow-[0_1px_2px_rgba(70,49,105,0.06)]":"text-[#6D6574] hover:bg-[#F7F4F9] hover:text-[#574961]":"text-[#C0BCC3]"),children:(0,n.jsx)("span",{children:e.label})},e.value)})})]}),(0,n.jsx)("div",{"aria-hidden":!eM,inert:!eM,className:"grid transition-[grid-template-rows,opacity] duration-[320ms] ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none ".concat(eM?"grid-rows-[1fr] opacity-100":"pointer-events-none grid-rows-[0fr] opacity-0"),children:(0,n.jsx)("div",{className:"min-h-0 min-w-0 overflow-hidden",children:(0,n.jsxs)("div",{className:"mt-2 min-w-0",children:[(0,n.jsxs)("div",{className:"mb-1.5 flex items-center justify-between gap-3 px-1",children:[(0,n.jsx)("p",{className:"min-w-0 truncate text-[11px] font-semibold text-[#77727D]",children:x("recentResearch.title")}),(0,n.jsx)("button",{type:"button","aria-label":x("recentResearch.close"),title:x("recentResearch.close"),onClick:()=>ez(!1),className:"flex size-7 shrink-0 items-center justify-center rounded-full text-[#85808A] transition hover:bg-[#F0EDF3] hover:text-[#4B4751] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#8F7ABA]/45",children:(0,n.jsx)(u.A,{className:"size-4"})})]}),(0,n.jsx)("div",{className:"min-w-0 overflow-x-auto pb-1",children:(0,n.jsx)("div",{className:"flex min-w-0 gap-2",children:eI.map(e=>{let t=(null==eL?void 0:eL.conversationId)===e.conversationId;return(0,n.jsxs)("button",{type:"button",title:e.title,"aria-pressed":t,onClick:()=>{eP(e),ez(!1)},className:"relative flex h-[96px] w-[210px] max-w-[85%] min-w-0 shrink-0 items-start gap-2 overflow-hidden rounded-[8px] border px-2.5 py-2 text-left text-[#66666E] transition-colors disabled:cursor-not-allowed disabled:border-[#
1E7E7EA] disabled:bg-[#F7F7F8] disabled:text-[#A7A7AE] ".concat(t?"border-[#8F7ABA] bg-[#F7F4FB] ring-1 ring-[#8F7ABA]/20":"border-[#E1E0E5] hover:border-[#BDB5D2] hover:bg-[#FAFAFB]"),children:[(0,n.jsx)("span",{className:"mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-[6px] bg-[#F2F2F4] text-[#6D6D76]",children:(0,n.jsx)(h.A,{className:"size-[14px]",strokeWidth:1.8})}),(0,n.jsxs)("span",{className:"flex h-full min-w-0 flex-1 flex-col overflow-hidden",children:[(0,n.jsx)("span",{className:"block w-full min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-[12px] font-medium leading-4 text-[#55555E]",children:e.title}),(0,n.jsx)("span",{className:"mt-1 line-clamp-2 w-full whitespace-normal break-words text-[11px] font-normal leading-4 text-[#8A8A92] [overflow-wrap:anywhere]",children:e.writingStrategy}),(0,n.jsx)("span",{className:"mt-auto block shrink-0 pt-0.5 text-[10px] leading-3 text-[#9993A2]",children:x("recentResearch.references",{count:e.referenceCount})})]})]},e.conversationId)})})})]})})}),(0,n.jsx)("input",{ref:eq,type:"file",multiple:!0,accept:".pdf,.txt,.md,.markdown,.doc,.docx,.rtf,.ppt,.pptx,.odt",className:"hidden",onChange:e=>{var t;if(!tr()){e.target.value="";return}let s=Array.from(null!=(t=e.target.files)?t:[]);if(e.target.value="",0===s.length)return;let n=new Set(eE.map(e=>U(e.file))),a=s.filter(e=>{let t=U(e);return!n.has(t)&&(n.add(t),!0)});if(0===a.length)return;if(eE.length+a.length>10)return void R.A.error(x("multiDocumentMaximum",{count:10}),2500);let r=a.find(e=>e.size>0x1400000);if(r)return void R.A.error(x("multiDocumentTooLarge",{name:r.name}),2500);tl(a)}}),(0,n.jsx)("input",{ref:eV,type:"file",accept:".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document",className:"hidden",onChange:e=>{var t;let s=null==(t=e.target.files)?void 0:t[0];if(e.target.value="",s){if(!s.name.toLowerCase().endsWith(".docx"))return void R.A.error("Please select a .docx document.",2500);td(!0,"parse",s)}}}),(0,n.jsxs)("div",{className:"mt-4 flex items-center justify-end gap-3",children:[(0,n.jsx)("button",{type:"button",disabled:tt,onClick:()=>{eh(!0),el(!1),ec(!0)},className:"h-10 px-2 text-sm font-medium text-[#6D6D76] transition hover:text-[#67519C] disabled:cursor-not-allowed disabled:opacity-45",children:x("skip")}),(0,n.jsx)("button",{type:"button",disabled:tt,onClick:()=>{eh(!0),el(!1),ec(!0)},className:"h-10 min-w-[88px] rounded-[9px] bg-[#67519C] px-5 text-sm font-semibold text-white shadow-[0_6px_16px_rgba(103,81,156,0.2)] transition hover:bg-[#594487] disabled:cursor-not-allowed disabled:opacity-45",children:x("nextStep")})]})]})})})]}),(0,n.jsxs)("div",{className:"relative mt-3 rounded-[14px] border border-[#E2DFE6] bg-white shadow-[0_10px_30px_rgba(39,31,51,0.04)]",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>{e_(!1),ez(!1),el(!1),ec(e=>(e&&eu(!1),!e)),ex(!1)},"aria-expanded":eo,className:"flex h-14 w-full items-center gap-3 px-4 text-left text-[14px] font-semibold text-[#202020] sm:px-5 sm:text-[15px]",children:[(0,n.jsx)("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-[9px] bg-[#F5F3F7] text-[#77717D]",children:(0,n.jsx)(b.A,{className:"size-[17px]"})}),(0,n.jsx)("span",{children:x("citationSettings")}),ef?(0,n.jsx)("span",{className:"flex size-5 items-center justify-center rounded-full bg-[#36C96B] text-white",children:(0,n.jsx)(o.A,{className:"size-3.5",strokeWidth:3})}):null,(0,n.jsx)("span",{className:"flex-1"}),(0,n.jsx)(c.A,{className:"size-4 text-[#6D6D76] transition-transform duration-300 ease-out ".concat(eo?"rotate-90":"")})]}),(0,n.jsx)("div",{"aria-hidden":!eo,inert:!eo,className:"grid transition-[grid-template-rows,opacity] duration-[320ms] ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none ".concat(eo?"grid-rows-[1fr] opacity-100":"pointer-events-none grid-rows-[0fr] opacity-0"),children:(0,n.jsx)("div",{className:"min-h-0 ".concat(eo?"overflow-visible":"overflow-hidden"),children:(0,n.jsx)("div",{className:"px-3 pb-3 pt-1 sm:px-4 sm:pb-4",children:(0,n.jsxs)("div",{className:"w-full",children:[(0,n.jsx)(W.F,{filters:eX,onChange:e1,citationStyleControl:(0,n.jsx)(V.A,{id:"writing-citation-style",label:x("citationStyle"),value:eQ,options:I.Wd,open:ed,onOpenChange:eu,onChange:e0})}),(0,n.jsxs)("div",{className:"mt-4 flex flex-wrap items-center justify-end gap-2",children:[ts?(0,n.jsx)("button",{type:"button",disabled:tt,onClick:()=>{eb(!0),ec(!1),eu(!1),ex(!0)},className:"h-9 px-1 text-sm font-semibold text-[#6D6D76] transition hover:text-[#67519C] disabled:cursor-not-allowed disabled:opacity-45",children:x("skip")}):null,(0,n.jsx)("button",{type:"button",onClick:()=>{e2(),e0("apa"),eu(!1)},className:"h-9 rounded-[8px] border border-[#DAD6DD] px-3.5 text-sm font-semibold text-[#66666E] transition hover:border-[#C5C1CB] hover:bg-[#F3F2F4]",children:x("reset")}),(0,n.jsxs)("button",{type:"button",disabled:et||tt,"aria-busy":et&&!ts,onClick:()=>
1{if(!ts)return void td(!0,"citation");eb(!0),ec(!1),eu(!1),ex(!0)},className:"inline-flex h-9 items-center justify-center gap-2 rounded-[8px] bg-[#67519C] px-4 text-sm font-semibold text-white transition hover:bg-[#594487] focus:outline-none focus:ring-2 focus:ring-[#67519C]/20 disabled:cursor-not-allowed disabled:opacity-65",children:["citation"===en?(0,n.jsx)(m.A,{className:"size-4 animate-spin"}):null,(0,n.jsx)("span",{children:ts?x("nextStep"):x("startWriting")})]})]})]})})})})]}),ts?(0,n.jsxs)("div",{className:"mt-3 overflow-hidden rounded-[14px] border border-[#E2DFE6] bg-white shadow-[0_10px_30px_rgba(39,31,51,0.04)]",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>{ez(!1),el(!1),ec(!1),eu(!1),ex(e=>!e)},"aria-expanded":em,className:"flex h-14 w-full items-center gap-3 px-4 text-left text-[14px] font-semibold text-[#202020] sm:px-5 sm:text-[15px]",children:[(0,n.jsx)("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-[9px] bg-[#F5F3F7] text-[#77717D]",children:(0,n.jsx)(g.A,{className:"size-[17px]"})}),(0,n.jsx)("span",{className:"flex-1",children:x("generationMode")}),(0,n.jsx)(c.A,{className:"size-4 text-[#6D6D76] transition-transform duration-300 ease-out ".concat(em?"rotate-90":"")})]}),(0,n.jsx)("div",{"aria-hidden":!em,inert:!em,className:"grid transition-[grid-template-rows,opacity] duration-[320ms] ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none ".concat(em?"grid-rows-[1fr] opacity-100":"pointer-events-none grid-rows-[0fr] opacity-0"),children:(0,n.jsx)("div",{className:"min-h-0 overflow-hidden",children:(0,n.jsxs)("div",{className:"space-y-2 px-3 pb-3 pt-1 sm:px-4 sm:pb-4",children:[[{value:"standard",label:x("standardTitle"),description:x("standardTitleDescription"),icon:h.A},{value:"smart",label:x("smartTitle"),description:x("smartTitleDescription"),icon:v},{value:"untitled",label:x("noTitle"),description:x("noTitleDescription"),icon:y},{value:"article",label:x("fullArticle"),description:x("fullArticleDescription"),icon:w.A}].map(e=>{let t=eg===e.value,s=e.icon;return(0,n.jsxs)("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>ev(e.value),className:"flex min-h-[60px] w-full items-center gap-3 rounded-[9px] border px-3 py-2 text-left transition-colors ".concat(t?"border-[#8F7AE8] bg-white":"border-[#D9D9DD] bg-white hover:border-[#BFB8D4]"),children:[(0,n.jsx)("span",{className:"flex size-[18px] shrink-0 items-center justify-center rounded-full border ".concat(t?"border-[#67519C] bg-[#67519C]":"border-[#B8BBC3] bg-white"),children:t?(0,n.jsx)("span",{className:"size-[5px] rounded-full bg-white"}):null}),(0,n.jsx)("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-[7px] border border-[#E1E1E5] bg-white ".concat("untitled"===e.value?"text-[#C4C5CB]":"article"===e.value?"text-[#67519C]":"text-[#6D6D76]"),children:(0,n.jsx)(s,{className:"size-[22px]",strokeWidth:1.8})}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block text-[14px] font-semibold leading-5 text-[#25262A]",children:e.label}),(0,n.jsx)("span",{className:"mt-0.5 block text-[12px] leading-4 text-[#85858F]",children:e.description})]})]},e.value)}),tn?(0,n.jsxs)("div",{className:"space-y-2 rounded-[9px] border border-[#E7E4EC] bg-[#FCFBFD] px-3 py-2.5",children:[(0,n.jsxs)("div",{className:"min-w-0 space-y-2 sm:flex sm:items-center sm:justify-between sm:gap-3 sm:space-y-0",children:[(0,n.jsx)("span",{className:"block sm:shrink-0 text-[12px] font-medium text-[#77727D]",children:Y("targetLength.label")}),(0,n.jsxs)("div",{role:"radiogroup","aria-label":Y("targetLength.label"),className:"grid w-full min-w-0 grid-cols-2 gap-1 rounded-[10px] bg-[#F4F1F8] p-1 sm:h-8 sm:w-auto sm:shrink-0 sm:grid-cols-4 sm:gap-0 sm:rounded-full sm:p-0.5",children:[q.map(e=>{let t=!ej&&ey===e;return(0,n.jsx)("button",{type:"button",role:"radio","aria-checked":t,onClick:()=>{eN(!1),ew(e)},className:"flex min-h-10 min-w-0 items-center justify-center whitespace-normal rounded-[8px] px-2 py-1.5 text-center text-[12px] leading-4 sm:h-7 sm:min-h-0 sm:whitespace-nowrap sm:rou
1nded-full sm:px-2.5 sm:py-0 sm:leading-normal font-semibold transition-colors ".concat(t?"bg-white text-[#5D497F] shadow-[0_1px_2px_rgba(43,37,54,0.10)]":"text-[#716C78] hover:text-[#5A5563]"),children:Y("targetLength.preset",{count:e})},e)}),(0,n.jsx)("button",{type:"button",role:"radio","aria-checked":ej,onClick:()=>eN(!0),className:"flex min-h-10 min-w-0 items-center justify-center whitespace-normal rounded-[8px] px-2 py-1.5 text-center text-[12px] leading-4 sm:h-7 sm:min-h-0 sm:whitespace-nowrap sm:rounded-full sm:px-2.5 sm:py-0 sm:leading-normal font-semibold transition-colors ".concat(ej?"bg-white text-[#5D497F] shadow-[0_1px_2px_rgba(43,37,54,0.10)]":"text-[#716C78] hover:text-[#5A5563]"),children:Y("targetLength.custom")})]})]}),ej?(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:flex-nowrap sm:justify-end",children:[(0,n.jsx)("input",{type:"number",inputMode:"numeric",min:800,max:3e4,step:500,value:eC,autoFocus:!0,onChange:e=>eA(e.target.value),onBlur:()=>{let e=Math.round(Number(eC));if(!Number.isFinite(e))return;let t=Math.min(3e4,Math.max(800,e));eA(String(t)),ew(t)},"aria-label":Y("targetLength.customLabel"),className:"h-10 w-28 shrink-0 sm:h-8 rounded-[8px] border border-[#E2DFE5] bg-white px-2.5 text-right text-[12px] text-[#231E2B] outline-none focus:border-[#67519C]"}),(0,n.jsx)("span",{className:"text-[12px] text-[#716C78]",children:Y("targetLength.customHint",{min:800,max:3e4})})]}):null]}):null,(0,n.jsx)("div",{className:"flex justify-end pt-2",children:(0,n.jsxs)("button",{type:"button",disabled:et||tt||tn&&!e6,"aria-busy":et,onClick:()=>td(!0,"outline"),className:"inline-flex h-9 items-center justify-center gap-2 rounded-[8px] bg-[#67519C] px-4 text-sm font-semibold text-white transition hover:bg-[#594487] focus:outline-none focus:ring-2 focus:ring-[#67519C]/20 disabled:cursor-not-allowed disabled:opacity-65",children:["outline"===en||"documents"===en?(0,n.jsx)(m.A,{className:"size-4 animate-spin"}):null,(0,n.jsx)("span",{children:x("startWriting")})]})})]})})})]}):null,(0,n.jsxs)("button",{type:"button",disabled:et||tt,"aria-busy":et,onClick:()=>td(!0,"skip"),className:"mx-auto mt-5 flex h-9 items-center justify-center gap-2 rounded-[8px] px-3 text-[13px] font-semibold text-[#67519C] transition hover:bg-[#F5F2F8] disabled:cursor-not-allowed disabled:opacity-60",children:["skip"===en||"documents"===en?(0,n.jsx)(m.A,{className:"size-4 animate-spin"}):(0,n.jsx)(l.A,{className:"size-4",strokeWidth:1.8}),(0,n.jsx)("span",{children:x("skipAndWrite")})]}),(0,n.jsxs)("div",{className:"mx-auto mt-3 flex w-full max-w-[240px] items-center gap-3",children:[(0,n.jsx)("span",{className:"h-px flex-1 bg-[#E4E1E7]"}),(0,n.jsx)("span",{className:"text-[11px] text-[#716C78]",children:x("or")}),(0,n.jsx)("span",{className:"h-px flex-1 bg-[#E4E1E7]"})]}),(0,n.jsxs)("button",{type:"button",disabled:et,"aria-busy":"parse"===en,onClick:()=>{var e;tr()&&(null==(e=eV.current)||e.click())},className:"mx-auto mt-2 flex h-9 items-center justify-center gap-2 rounded-[8px] px-3 text-[13px] font-semibold text-[#67519C] transition hover:bg-[#F5F2F8] disabled:cursor-not-allowed disabled:opacity-60",children:["parse"===en?(0,n.jsx)(m.A,{className:"size-4 animate-spin"}):(0,n.jsx)(h.A,{className:"size-4",strokeWidth:1.8}),(0,n.jsx)("span",{children:x("parseFromDocument")})]}),null]})]})}),(0,n.jsx)("div",{className:"mx-auto flex min-h-[calc(100dvh-var(--v3-top,54px))] w-full max-w-[1180px] items-center justify-center py-16 sm:py-20 lg:py-24",children:(0,n.jsxs)("div",{className:"w-full px-1 text-center sm:px-6",children:[(0,n.jsxs)("h2",{className:"mx-auto max-w-[760px] text-[34px] font-semibold leading-[1.05] tracking-[-0.04em] text-[#101010] sm:text-[42px] lg:text-[52px]",children:[x("pageTitle")," ",(0,n.jsx)("span",{className:"text-[#67519C]",children:x("pageTitleHighlighted")})]}),(0,n.jsx)("p",{className:"mx-auto mt-6 max-w-[840px] font-app text-base font-normal leading-7 text-[#343434] sm:text-lg lg:text-[19px] lg:leading-8",children:x("pageDescription")}),(0,n.jsxs)("div",{className:"mx-auto mt-10 grid max-w-[1080px] items-center gap-8 text-left sm:mt-12 lg:grid-cols-[minmax(0,1fr)_480px] lg:gap-12",children:[(0,n.jsx)("div",{className:"flex flex-col gap-2.5",children:e7.map((e,t)=>(0,n.jsxs)("button",{type:"button",onClick:()=>{e$(e),el(!0),ec(!1),eu(!1),ex(!1),window.setTimeout(()=>{var e;
1null==(e=document.getElementById("writing-start"))||e.scrollIntoView({behavior:"smooth",block:"center"})},0)},className:"group flex items-start gap-5 rounded-[14px] px-5 py-3.5 transition-colors hover:bg-[#F8F7F4] sm:px-6",children:[(0,n.jsx)("span",{className:"pt-0.5 text-[11px] font-semibold tracking-[0.14em] text-[#8A72B4]",children:String(t+1).padStart(2,"0")}),(0,n.jsx)("span",{className:"text-[14px] font-medium leading-5 text-[#343434] transition-colors group-hover:text-[#67519C] sm:text-[15px]",children:e})]},e))}),(0,n.jsx)("div",{className:"mx-auto w-full max-w-[560px] overflow-hidden rounded-[28px] lg:mx-0",children:(0,n.jsx)(C.default,{src:"/images/writing-features/intelligent-writing-agent-landscape.webp",alt:"",width:1536,height:1024,className:"aspect-[3/2] h-auto w-full object-cover",sizes:"(max-width: 1023px) calc(100vw - 48px), 480px","aria-hidden":"true"})})]}),(0,n.jsx)("p",{className:"mx-auto mt-20 max-w-[840px] font-app text-base font-normal leading-7 text-[#343434] sm:text-lg lg:text-[19px] lg:leading-8",children:x("trustedBy")}),(0,n.jsx)("div",{className:"mt-7 sm:mt-8",children:(0,n.jsx)(k.L,{whiteFade:!0,showDescription:!1})})]})})]})}function H(){let[e,t]=(0,a.useState)(r.C);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.Suspense,{fallback:null,children:(0,n.jsx)(r.J,{onChange:t})}),(0,n.jsx)(Y,{autoStart:e.start})]})}},39452:(e,t,s)=>{"use strict";s.d(t,{Pu:()=>r,S9:()=>l,rY:()=>i});let n="pending-imports";function a(e,t){return new Promise((e,t)=>{let s=indexedDB.open("resea-writing-imports",1);s.onupgradeneeded=()=>{let e=s.result;e.objectStoreNames.contains(n)||e.createObjectStore(n,{keyPath:"writingId"})},s.onsuccess=()=>e(s.result),s.onerror=()=>{var e;return t(null!=(e=s.error)?e:Error("Unable to open the document import store."))}}).then(s=>new Promise((a,r)=>{let i=s.transaction(n,e),l=t(i.objectStore(n));l.onsuccess=()=>a(l.result),l.onerror=()=>{var e;return r(null!=(e=l.error)?e:Error("Document import storage failed."))},i.oncomplete=()=>s.close(),i.onerror=()=>{var e;s.close(),r(null!=(e=i.error)?e:Error("Document import storage failed."))}}))}async function r(e,t){await a("readwrite",s=>s.put({writingId:e,file:t,fileName:t.name,createdAt:Date.now()}))}async function i(e){let t=await a("readonly",t=>t.get(e));if(!(null==t?void 0:t.file))return null;let s=t.file instanceof File?t.file:new File([t.file],t.fileName,{type:t.file.type});return{...t,file:s}}async function l(e){await a("readwrite",t=>t.delete(e))}},39991:(e,t,s)=>{"use strict";s.d(t,{c:()=>r,m:()=>a});var n=s(54826);function a(e,t){let s=t.startsWith("/")?t:"/".concat(t);return e===n.Xn?s:"/".concat(e).concat("/"===s?"":s)}function r(e,t){let s=e.replace(/\/+$/,"")||"/";if(t!==n.Xn)return s;let a="/".concat(n.Xn);return s===a?"/":s.startsWith("".concat(a,"/"))?s.slice(a.length):s}},41407:(e,t,s)=>{"use strict";s.d(t,{I:()=>i});var n=s(12115),a=s(98662),r=s(14741);function i(){r.r.current||(0,a.U)();let[e]=(0,n.useState)(r.O.current);return e}},45493:(e,t,s)=>{Promise.resolve().then(s.bind(s,65084)),Promise.resolve().then(s.t.bind(s,81356,23)),Promise.resolve().then(s.bind(s,55055)),Promise.resolve().then(s.bind(s,64294)),Promise.resolve().then(s.bind(s,7222)),Promise.resolve().then(s.bind(s,53090)),Promise.resolve().then(s.bind(s,36040))},50386:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(71847).A)("list-tree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]])},54485:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(71847).A)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},54826:(e,t,s)=>{"use strict";s.d(t,{Xn:()=>a,YZ:()=>n});let n=[{code:"en",name:"English"},{code:"zh",name:"简体中文"},{code:"pt",name:"Portugu\xeas"},{code:"es",name:"Espa\xf1ol"},{code:"fr",name:"Fran\xe7ais"},{code:"de",name:"Deutsch"}],a="en"},65084:(e,t,s)=>{"use strict";function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e}).apply(null,arguments)}s.d(t,{default:()=>i});var a=s(12115),r=s(50192);function i(e){let{locale:t,...s}=e;if(!t)throw Error("Failed to determine locale in `NextIntlClientProvider`, please provide the `locale` prop explicitly.\n\nSee https://next-intl.dev/docs/configuration#locale");return a.createElement(r.IntlProvider,n({locale:t},s))}},65229:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(71847).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
1],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},71360:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(71847).A)("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},75288:(e,t,s)=>{"use strict";s.d(t,{y:()=>i});var n=s(12115),a=s(95604),r=s(40411);function i(){let e=(0,a.useTranslations)("toast");return(0,n.useCallback)(t=>{let s="login"===t?e("access-login-required"):"upgrade"===t?e("access-upgrade-required"):e("access-quota-exhausted");"quota"===t?r.A.warning(s,3e3):r.A.info(s,3e3)},[e])}},77154:(e,t,s)=>{"use strict";s.d(t,{aC:()=>r,fY:()=>l,sR:()=>i});var n=s(7232);function a(e){return"resea:writing:outline:".concat(e)}function r(e,t){n.R.setJSON(a(e),t)}function i(e){var t;let s=a(e),r=n.R.getJSON(s);return r?!(null==(t=r.documentPrompt)?void 0:t.trim())&&!r.hasResearchSource||!["standard","generate","none"].includes(r.style)||Date.now()-r.createdAt>18e5?(n.R.removeItem(s),null):r:null}function l(e){n.R.removeItem(a(e))}},90107:(e,t,s)=>{"use strict";s.d(t,{Du:()=>n,UI:()=>a}),s(82309);let n=e=>"number"==typeof e&&e>=1;function a(e){var t,s,n,a,r,i,l,o,c,d,u,m,x;let p=null!=(t=null==e?void 0:e.membership_tier)?t:-1,h=!e||e.is_guest||-1===p,f=!h&&0===p,b=p>=1,g=null==e?void 0:e.entitlement_usage,v=null==e?void 0:e.entitlements;return{plan:-1===p?"guest":0===p?"free":1===p?"standard":2===p?"pro":"unlimited",tier:p,isGuest:h,isFree:f,isPaid:b,credits:{remaining:null!=(s=null==g?void 0:g.credits_remaining)?s:0,resetsAt:null!=(a=null!=(n=null==e?void 0:e.billing.next_billing_date)?n:null==g?void 0:g.usage_period_end)?a:null},research:{fast:!0,medium:b,deep:b,historyLimit:h||f?1:null,remainingRuns:h?null!=(r=null==g?void 0:g.research_runs_remaining)?r:0:null},writing:{autocomplete:!h,deep:b,historyLimit:h||f?1:null,remainingRuns:h?null!=(i=null==g?void 0:g.writing_runs_remaining)?i:0:null},humanizer:{remainingWords:null!=(l=null==g?void 0:g.humanize_words_remaining)?l:0,perRequestWordLimit:null!=(o=null==v?void 0:v.humanize_words_per_request)?o:null,remainingRuns:h?null!=(c=null==g?void 0:g.humanizer_runs_remaining)?c:0:null,modes:b?["general","more_human","high_quality","academic","simplify","formal","informal","blog"]:["general"]},citationCheck:{remainingChecks:h?null!=(d=null==g?void 0:g.citation_checks_remaining)?d:0:null,referencesPerCheck:h?null!=(u=null==v?void 0:v.citation_references_per_check)?u:5:null,showIssueDetails:b,historyEnabled:b},library:{fileLimit:null!=(m=null==v?void 0:v.library_file_limit)?m:null,filesRemaining:null!=(x=null==g?void 0:g.library_files_remaining)?x:null}}}}},e=>{e.O(0,[3262,7797,2619,5728,5390,9798,5055,6092,2720,2840,8441,1255,7358],()=>e(e.s=45493)),_N_E=e.O()}]);

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.