PageSourceSearch

https://www.forethought.org/_next/static/chunks/321-536696ede547e530.js

js forethought.org collected 2026-10-02 03:02:10 UTC 14,817 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[321],{1127:(e,t,l)=>{l.d(t,{Bi:()=>s,DB:()=>b,I1:()=>f,Lm:()=>N,Mc:()=>c,Mu:()=>w,b0:()=>g,cc:()=>v,kT:()=>u,mk:()=>m,nS:()=>y,oB:()=>d,qz:()=>h,sL:()=>p});var n=l(7382),r=l(9949),a=l(7542),i=l(9165),o=l(9195);let c=e=>{if(!e||0===e.length)return"";if(1===e.length){var t;return null!=(t=e[0])?t:""}return e.slice(0,-1).join(", ")+" & "+e[e.length-1]},u={oldToNew:{label:"Old to new",sort:e=>[...e].sort((e,t)=>{let l=new Date(e.fields.publishedAt),n=new Date(t.fields.publishedAt);return l.getTime()-n.getTime()})},newToOld:{label:"New to old",sort:e=>[...e].sort((e,t)=>{let l=new Date(e.fields.publishedAt);return new Date(t.fields.publishedAt).getTime()-l.getTime()})}},s=e=>(0,o.ny)("type",e.map(e=>{let{fields:t}=e;return[t.type]})),d=e=>(0,o.ny)("topic",e.map(e=>{var t;let{fields:l}=e;return null!=(t=l.topics)?t:[]})),p=e=>(0,o.ny)("author",e.map(e=>{let{fields:t}=e;return(0,r.GC)(t.authors).map(e=>e.fields.name)})),h=(e,t)=>{if(0===t.length)return e;let l=t.filter(e=>"series"===e.type).map(e=>e.seriesId);return e.filter(e=>{var n,a,i;return(0,o.lu)(t,"type",[e.fields.type])&&(0,o.lu)(t,"topic",null!=(a=e.fields.topics)?a:[])&&(0,o.lu)(t,"author",(0,r.GC)(e.fields.authors).map(e=>e.fields.name))&&(0===l.length||l.includes(null!=(i=null==(n=e.seriesInfo)?void 0:n.seriesId)?i:""))})},f=e=>"/research/".concat(e.fields.slug),g=e=>{let{unlisted:t,slug:l}=e.fields,r=(0,n.$_)();return t?"".concat(r,"/").concat(l):"".concat(r,"/research/").concat(l)},m=e=>"".concat(f(e),".pdf"),v=e=>{var t;let{title:l,publishedAt:n}=e.fields,a=g(e),i=(0,r.GC)(e.fields.authors).map(e=>e.fields.name);i.length||i.push("Forethought");let o=i.map(e=>{let t=e.split(" "),l=t[t.length-1],n=t.slice(0,-1).map(e=>"".concat(e[0],".")).join(" ");return"".concat(l,", ").concat(n)}).join(", "),c=i.join(" and "),u=new Date(n).getFullYear(),s=((e,t,l)=>{var n;let r=l.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().slice(0,16),a=(null==(n=e.split(" ")[1])?void 0:n.toLowerCase())||e.toLowerCase();return"".concat(a).concat(t).concat(r)})(null!=(t=i[0])?t:"",u,l),d=new Date,p=(e=>"".concat(e.getDate()," ").concat(["Jan.","Feb.","Mar.","Apr.","May","Jun.","Jul.","Aug.","Sep.","Oct.","Nov.","Dec."][e.getMonth()]," ").concat(e.getFullYear()))(d),h=d.toISOString().split("T")[0],f="@article{".concat(s,",\n  title={").concat(l.replace(/\\/g,"\\\\").replace(/&/g,"\\&").replace(/%/g,"\\%").replace(/\$/g,"\\$").replace(/_/g,"\\_").replace(/\^/g,"\\^").replace(/#/g,"\\#").replace(/~/g,"\\~").replace(/\{/g,"\\{").replace(/\}/g,"\\}"),"},\n  author={").concat(c,"},\n  year={").concat(u,"},\n  url={").concat(a,"},\n  note={Accessed: ").concat(h,"}\n}");return{plainText:"".concat(o," (").concat(u,"). ").concat(l,". [online] Available at: ").concat(a," [Accessed ").concat(p,"]"),richText:"".concat(o," (").concat(u,"). <i>").concat(l,'</i>. [online] Available at: <a href="').concat(a,'">').concat(a,"</a> [Accessed ").concat(p,"]"),bibtex:f}},b=(e,t)=>{let l=e.length;if(l>=t)return e.slice(0,t);if(8===t&&l>4){var n,r,a,i,o;return[null!=(n=e[0])?n:null,null!=(r=e[1])?r:null,null!=(a=e[2])?a:null,null,null!=(i=e[3])?i:null,null,null!=(o=e[4])?o:null,null]}let c=Array(t).fill(null),u=t-l,s=Math.floor(u/(l+1)),d=u%(l+1),p=0;for(let t of e)c[p+=s+ +(d>0)]=t,p++,d>0&&d--;return c},x=e=>{let t=e&&(0,a.vY)(e)?e.fields.file.url:void 0;return t?(0,n.FT)(t):void 0},y=e=>{var t;return null!=(t=x(e))?t:"/social-preview/default-social-preview.png"},w=(e,t)=>{var l,n;return null!=(n=null!=(l=x(e))?l:(0,i.Az)(t))?n:void 0},N=e=>{var t;return["in article","in PDF and article"].includes(null!=(t=e.fields.abstractDisplayOptions)?t:"nowhere (default)")}},1803:(e,t,l)=>{l.d(t,{h:()=>h});var n=l(7876),r=l(4437),a=l(4232),i=l(9814),o=l(4952),c=l(5304),u=l(9573),s=l(4933);let d=e=>{let t=e.getBoundingClientRect(),l=document.documentElement.scrollTop;return t.top+l},p=(0,a.memo)(e=>{let{id:t}=e,{width:l}=(0,s.lW)(),{getById:p,selectedFootNoteId:h,setSelectedFootNoteId:f}=(0,r.B)(),{getAnchorRef:g,getContent:m}=(0,o.I)(),v=p(t),b=h===t,[x,y]=(0,a.useState)(null),{requestYPos:w,subscribeToPosition:N}=(0,i.cl)(),j=(0,a.useRef)(null),k=(0,a.useRef)(null),C=(0,a.useRef)(0),M=(0,a.useRef)(0),E=(0,a.useRef)(!1),A=g(t),_=m(t);return((0,a.useEffect)(()=>N(t,(e,t)=>{let l=Math.abs(e-C.current)>1,n=Math.abs(t-M.current)>1;(l||n)&&(C.current=e,M.current=t,y({top:e,height:t}))}),[t,N]),(0,a.useLayoutEffect)(()=>{var e;if(!_||E.current)return;
1let l=null==A?void 0:A.current,n=null==(e=k.current)?void 0:e.parentElement;if(!l||!n)return;E.current=!0;let r=requestAnimationFrame(()=>{let e=d(n),r=d(l),a=i.lN;j.current&&b&&(a=Math.max(i.lN,j.current.scrollHeight)),w({id:t,preferredYPos:r-e-16,height:a}),E.current=!1});return()=>{cancelAnimationFrame(r),E.current=!1}},[t,A,b,w,_,l]),_)?(0,n.jsxs)("div",{ref:e=>{j.current=e,k.current=e},"data-component":"SideNoteDisplay",style:x?{top:x.top,height:x.height}:void 0,className:(0,u.QP)("absolute left-0 w-full group bg-ft-offwhite overflow-hidden py-4",x?"opacity-100":"opacity-0",x?"transition-all duration-500 ease-out-quart":"transition-opacity duration-1000 ease-out-quart",b?"z-10 max-h-full":"max-h-[90px]",t.length>2?"pl-[20px]":"pl-[16px]"),onMouseEnter:()=>{f(t)},children:[(0,n.jsx)(c.E,{variant:"body-sup",className:"\n          transition-opacity duration-500 ease-out-quart\n          absolute top-0 left-0 pt-5\n          ".concat(b?"opacity-100":"opacity-30","\n        "),children:null==v?void 0:v.data.sequence}),(0,n.jsxs)("div",{className:(0,u.QP)("relative [&_*[data-footnote-backref]]:hidden","transition-opacity duration-500 ease-out-quart",b?"opacity-100":"opacity-30","[&_.katex]:inline-flex [&_.katex]:self-center","[&_.katex]:max-w-full [&_.katex]:overflow-hidden","[&_.katex-only_.katex]:overflow-x-auto"),children:[_,(0,n.jsx)("div",{className:"\n            absolute left-0 h-auto w-full\n            bg-gradient-to-b from-ft-offwhite to-transparent\n            pointer-events-none transition-all duration-500 ease-out-quart\n          "})]}),(0,n.jsx)("div",{className:"\n          absolute bottom-0 left-0 w-full h-12\n          bg-gradient-to-t from-ft-offwhite to-transparent\n          transition-opacity duration-500 ease-out-quart\n          ".concat(b?"opacity-0":"opacity-100","\n          pointer-events-none\n        ")})]}):null}),h=e=>{let{className:t}=e,{footnotes:l,setSelectedFootNoteId:a}=(0,r.B)(),{registerContainer:o}=(0,i.cl)();return l.length?(0,n.jsx)("section",{ref:o,"data-component":"SideNotes",className:"relative ".concat(t),onMouseLeave:()=>a(null),children:l.map(e=>{let{identifier:t}=e;return(0,n.jsx)(p,{id:t},t)})}):null}},4629:(e,t,l)=>{l.d(t,{h:()=>a});var n=l(7876),r=l(8106);let a=e=>{let{topLeft:t,topCenter:l,topRight:a,center:i,bottomLeft:o,bottomCenter:c,bottomRight:u}=e;return(0,n.jsx)(r.m,{"data-component":"ArticleGrid",variant:"offwhite",className:"md:!px-[30px]",innerClassName:"!max-w-[1400px]",children:(0,n.jsxs)("div",{className:"\n          grid gap-x-[30px] xl:gap-x-[30px] 2xl:gap-x-[100px] gap-y-0 max-w-full\n          grid-cols-1\n          article-tablet:grid-cols-[230px_650px_minmax(200px,500px)]\n          article-desktop:grid-cols-[250px_680px_minmax(300px,600px)]\n        ",children:[(0,n.jsx)("div",{className:"border-b border-ft-grey article-tablet:col-[1_/_span_2]"}),(0,n.jsx)("div",{className:"hidden article-tablet:block"}),t||(0,n.jsx)("div",{className:"hidden article-tablet:block"}),l,a||(0,n.jsx)("div",{className:"hidden article-tablet:block"}),(0,n.jsx)("div",{className:"border-b border-ft-grey article-tablet:col-[1_/_span_2]"}),(0,n.jsx)("div",{className:"hidden article-tablet:block"}),(0,n.jsx)("div",{className:"hidden article-tablet:block"}),i||(0,n.jsx)("div",{className:"mb-[55px]"}),(0,n.jsx)("div",{className:"hidden article-tablet:block"}),o,c,u||(0,n.jsx)("div",{className:"hidden article-tablet:block"})]})})}},9195:(e,t,l)=>{l.d(t,{IF:()=>i,VH:()=>a,lu:()=>r,ny:()=>n});let n=(e,t)=>{let l={};for(let e of t)for(let t of e){var n;l[t]=(null!=(n=l[t])?n:0)+1}return Object.entries(l).map(t=>{let[l,n]=t;return{type:e,name:l,count:n}}).sort((e,t)=>t.count-e.count)},r=(e,t,l)=>{let n=e.filter(e=>e.type===t).map(e=>{let{name:t}=e;return t});return 0===n.length||l.some(e=>n.includes(e))},a=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=e=>{let{type:l,name:n}=e;return l===t.type&&n===t.name};return e.some(n)?e.filter(e=>!n(e)):[...l.includes(t.type)?i(e,t.type):e,t]},i=(e,t)=>e.filter(e=>e.type!==t)},9513:(e,t,l)=>{l.d(t,{M:()=>s});var n=l(7876),r=l(4232),a=l(2126),i=l(9165),o=l(5304);let c=[],u=e=>{let{heading:{id:t,title:l,children:i},currentHeadingId:c,maxLevel:s}=e,d=(0,a.vq)(),p=t===c,h=(0,r.useCallback)(e=>{var n;e.preventDefault(),window.history.replaceState({},"","#".concat(t)),null==(n=document.getElementById(t))||n.scrollIntoView({behavior:"smooth"}),d("tableOfContentsClick",{props:{id:t,title:l}})},[d,t,l]);return(0,n.jsxs)("div",{"data-component":"TableOfContents-Item",className:"\n        opacity-100 article-tablet:opacity-80 group-hover:opacity-100\n        transition-opacity duration-300\n        flex flex-col gap-[10px] ml-[8px]\n      ",children:[(0,n.jsx)(o.E,{variant:"navigation",className:"text-ft-orange ".concat(p?"font-[500]":""),children:(0,n.jsx)("a",{href:"#".concat(t),onClick:h,"data-toc":t,children:l})}),i.filter(e=>e.depth<=s).map(e=>(0,n.jsx)(u,{heading:e,currentHeadingId:c,maxLevel:s},e.id))]})},s=e=>{var t,l,a;let{markdown:o,additionalHeadings:s=c}=e,d=(0,r.useMemo)(()=>{let e=(0,i.Si)(o);return e?[...(0,i.f7)(e.children),...s]:[]}
1,[o,s]),[p,h]=(0,r.useState)(null!=(l=d[0])?l:void 0),f=(0,r.useCallback)(e=>{var t,l,n;let r=null==e?void 0:e.getAttribute("id"),a=r?null!=(l=null!=(t=(0,i.iE)(d,r))?t:d[0])?l:void 0:null!=(n=d[0])?n:void 0;h(e=>(null==e?void 0:e.id)===(null==a?void 0:a.id)?e:a)},[d]),g=(0,r.useCallback)(()=>{let e=window.scrollY,t=Array.from(document.querySelectorAll("[data-toc]")).reverse().map(e=>{let t=e.getAttribute("data-toc");return t?document.getElementById(t):null});for(let l of t)if(l&&l.getBoundingClientRect().top+e-150<=e)return void f(l);let l=t[t.length-1];l&&f(l)},[f]);return((0,r.useEffect)(()=>(g(),window.addEventListener("scroll",g),()=>window.removeEventListener("scroll",g)),[g]),d.length<2&&(null!=(a=null==(t=d[0])?void 0:t.children.length)?a:0)<1)?null:(0,n.jsx)("section",{"data-component":"TableOfContents",className:"\n        group \n        overflow-visible article-tablet:overflow-y-auto\n        transition-all duration-300\n        scrollbar-thin scrollbar-stable scrollbar-track-transparent scrollbar-color scrollbar-thumb-transparent hover:scrollbar-thumb-ft-grey/40\n        pr-3 pb-14\n        flex-grow-1\n      ",children:(0,n.jsx)("div",{className:"\n          flex flex-col gap-[10px] h-full relative\n          border-l-[1px] border-ft-orange\n          opacity-100 article-tablet:opacity-80 group-hover:opacity-100\n          transition-opacity duration-300\n          pb-2\n        ",children:d.map(e=>(0,n.jsx)(u,{heading:e,currentHeadingId:null==p?void 0:p.id,maxLevel:2},e.id))})})}},9814:(e,t,l)=>{l.d(t,{YR:()=>s,cl:()=>d,lN:()=>i});var n=l(7876),r=l(4232),a=l(4437);let i=90,o=(e,t)=>{if(e.length!==t.length)return!1;let l=Math.max(e.length,t.length);for(let h=0;h<l;h++){var n,r,a,i,o,c,u,s,d,p;if((null==(n=e[h])?void 0:n.id)!==(null==(r=t[h])?void 0:r.id)||Math.abs((null!=(u=null==(a=e[h])?void 0:a.top)?u:0)-(null!=(s=null==(i=t[h])?void 0:i.top)?s:0))>1||Math.abs((null!=(d=null==(o=e[h])?void 0:o.height)?d:0)-(null!=(p=null==(c=t[h])?void 0:c.height)?p:0))>1)return!1}return!0},c=(e,t,l)=>{let n,r=[],a=e.findIndex(e=>e.id===t),o=e[a];if(!t||!o){let t=0;for(let l of e){if(!l)continue;let e=Math.max(l.preferredYPos,t+8);r.push({id:l.id,top:e,height:i}),t=e+i}return r}if(null!==l){let e=o.preferredYPos,t=e+o.height;n=l>=e&&l<=t?e:l-24}else n=o.preferredYPos;let c=n+o.height;r.push({id:o.id,top:n,height:o.height});let u=e.slice(0,a),s=e.slice(a+1),d=c;for(let e of s){if(!e)continue;let t=Math.max(e.preferredYPos,d+8);r.push({id:e.id,top:t,height:i}),d=t+i}let p=n;for(let e=u.length-1;e>=0;e--){let t=u[e];if(!t)continue;let l=Math.min(t.preferredYPos,p-i-8);r.push({id:t.id,top:l,height:i}),p=l}let h=new Map;return e.forEach((e,t)=>{e&&h.set(e.id,t)}),r.sort((e,t)=>{var l,n;return(null!=(l=h.get(e.id))?l:0)-(null!=(n=h.get(t.id))?n:0)})},u=(0,r.createContext)({requestYPos:e=>{let{preferredYPos:t}=e;return t},subscribeToPosition:()=>()=>{},registerContainer:()=>{}}),s=e=>{let{children:t}=e,{selectedFootNoteId:l}=(0,a.B)(),i=(0,r.useRef)([]),s=(0,r.useRef)([]),d=(0,r.useRef)(!1),p=(0,r.useRef)(null),h=(0,r.useRef)(null),f=(0,r.useRef)(null),g=(0,r.useRef)(new Map),m=(0,r.useCallback)((e,t)=>{var l;g.current.has(e)||g.current.set(e,new Set),null==(l=g.current.get(e))||l.add(t);let n=s.current.find(t=>t.id===e);return n&&requestAnimationFrame(()=>{t(n.top,n.height)}),()=>{var l,n;null==(l=g.current.get(e))||l.delete(t),(null==(n=g.current.get(e))?void 0:n.size)===0&&g.current.delete(e)}},[]),v=(0,r.useCallback)((e,t,l)=>{let n=g.current.get(e);n&&n.forEach(e=>e(t,l))},[]),b=(0,r.useCallback)(e=>{f.current=e},[]);(0,r.useEffect)(()=>{let e=e=>{h.current=e.clientY};return window.addEventListener("mousemove",e),()=>window.removeEventListener("mousemove",e)},[]),(0,r.useEffect)(()=>{let e=f.current;if(e){if(l&&null!==h.current){let t=e.getBoundingClientRect();p.current=h.current-t.top}else p.current=null;d.current||(d.current=!0,requestAnimationFrame(()=>{let e=s.current,t=c(i.current,l,p.current),n=0===e.length;(n||!o(t,e))&&(s.current=t,n?t.forEach(e=>{v(e.id,e.top,e.height)}):t.forEach(t=>{let l=e.find(e=>e.id===t.id);(!l||Math.abs(l.top-t.top)>1||Math.abs(l.height-t.height)>1)&&v(t.id,t.top,t.height)})),d.current=!1}))}},[l,v]);let x=(0,r.useCallback)(e=>{let{id:t,preferredYPos:n,height:r}=e,a=i.current.findIndex(e=>e.id===t),u=!1;if(-1!==a){let e=i.current[a];if(e&&(Math.abs(e.preferredYPos-n)>1||Math.abs(e.height-r)>1)){let e=[...i.current];e[a]={id:t,preferredYPos:n,height:r},i.current=e,u=!0}}else i.current=[...i.current,{id:t,preferredYPos:n,height:r}],u=!0;u&&!d.current&&(d.current=!0,requestAnimationFrame(()=>{let e=s.current,t=c(i.current,l,p.current),n=0===e.length;
1(n||!o(t,e))&&(s.current=t,n?t.forEach(e=>{v(e.id,e.top,e.height)}):t.forEach(t=>{let l=e.find(e=>e.id===t.id);(!l||Math.abs(l.top-t.top)>1||Math.abs(l.height-t.height)>1)&&v(t.id,t.top,t.height)})),d.current=!1}));let h=s.current.find(e=>e.id===t);return h?h.top:n},[v,l]),y=(0,r.useRef)({requestYPos:x,subscribeToPosition:m,registerContainer:b});return y.current.requestYPos=x,y.current.subscribeToPosition=m,y.current.registerContainer=b,(0,n.jsx)(u.Provider,{value:y.current,children:t})},d=()=>(0,r.useContext)(u)}}]);

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.