(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,520236,e=>{"use strict";var t=e.i(843476),n=e.i(495277),i=e.i(19477),r=e.i(618566),s=e.i(815316),a=e.i(101255),o=e.i(888426),l=e.i(700064),c=e.i(547209),u=e.i(675792);e.s(["default",0,({className:e,path:d,componentType:p,label:m="Read More",icon:f="zine",linkClassName:g,gtmData:h})=>{let x=(0,r.usePathname)(),y=h??{event:i.eventName.INTERNAL_CLICK,componentType:p,clickText:m,pagePath:x};return(0,t.jsx)(n.default,{variant:"withIcon",className:(0,s.cn)("no-focus-on-parent relative z-10",l.brandRedHoverClass,"chevron"===f&&"support:hover:no-underline",e),gtmData:y,asChild:!0,children:(0,t.jsxs)(c.default,{href:(0,u.getAbsolutePath)(d),className:(0,s.cn)(g),children:[m,"zine"===f?(0,t.jsx)(a.ZineIcon,{"aria-hidden":"true",className:"shrink-0 text-brand-red"}):(0,t.jsx)(o.ChevronRight,{size:"0.75rem",className:"shrink-0","aria-hidden":"true"})]})})}])},132434,e=>{"use strict";var t=e.i(843476),n=e.i(271645),i=e.i(387644),r=e.i(19477);e.s(["default",0,({page:e,pageType:s,additionalPageInfo:a})=>((0,n.useEffect)(()=>{let t=(0,r.getPageViewGtmEventData)(e,s,a);(0,i.sendGTMEvent)(t)},[e,s,a]),(0,t.jsx)(t.Fragment,{}))])},623978,e=>{"use strict";var t=e.i(271645);e.s(["useFocusTrap",0,function(e,{isActive:n,onClose:i,triggerRef:r}){(0,t.useEffect)(()=>{if(!n||!e.current)return;let t=t=>{if(!e.current)return;let n=document.activeElement,s=e.current.querySelectorAll('button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"]):not(:disabled)'),a=s[0],o=s[s?.length-1];if("Escape"===t.key||"Enter"===t.key&&n?.getAttribute("data-close-button")==="true")t.preventDefault(),i(),r?.current?.focus();else if("Tab"===t.key){if(!a||!o)return;t.shiftKey&&n===a?(t.preventDefault(),o.focus()):t.shiftKey||n!==o||(t.preventDefault(),a.focus())}};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[n,e,i,r])}])},580554,e=>{"use strict";var t=e.i(271645),n=e.i(818622);e.s(["useScrollLock",0,function(e){let i=(0,t.useRef)(0),r=(0,n.useIsMobile)(),s=(0,t.useRef)(""),a=(0,t.useRef)("");(0,t.useEffect)(()=>{if("u"{t.style.overflow=s.current||"",t.style.touchAction=a.current||"",t.style.position="",t.style.top="",t.style.left="",t.style.right="",t.style.width=""};if(e)return s.current=t.style.overflow,a.current=t.style.touchAction,r&&(i.current=window.scrollY,t.style.position="fixed",t.style.top=`-${i.current}px`,t.style.left="0",t.style.right="0",t.style.width="100%"),t.style.overflow="hidden",t.style.touchAction="none",n;{let e=i.current;return r&&window.scrollTo({top:e,behavior:"instant"}),t.style.overflow=s.current||"",t.style.touchAction=a.current||"",r&&(t.style.position="",t.style.top="",t.style.left="",t.style.right="",t.style.width=""),n}},[e,r])}])},443450,e=>{"use strict";var t=e.i(843476),n=e.i(818622),i=e.i(846932),r=e.i(271645),s=e.i(618566),a=e.i(853802),o=e.i(658954),l=e.i(998834),c=e.i(663152),u=e.i(167297),d=e.i(715411),p=e.i(822315),m=e.i(387644),f=e.i(19477),g=e.i(895751),h=e.i(4824),x=e.i(871689),y=e.i(37727),v=e.i(373820),b=e.i(921205);let w=({setIsExpanded:e})=>{let n=(0,s.usePathname)(),{resetThread:i}=(0,a.useAgentexRootController)(),r=(0,a.useAgentexRootStore)(e=>e.messages.length>0),o=(0,a.useAgentexRootStore)(e=>e.isMessageStreaming);return(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-t-lg border-b border-gray-200 bg-white p-4 py-2",children:[(0,t.jsxs)("div",{className:"relative flex items-center gap-4",children:[(0,t.jsx)(v.IconButton,{className:"rounded-md border border-gray-200 p-2",icon:(0,t.jsx)(x.ArrowLeft,{size:20}),onClick:()=>void i(),gtmData:{event:f.eventName.INTERNAL_CLICK,componentType:f.componentType.scaleAgentExperience,pagePath:n,clickText:"back button"},disabled:!r||o}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(b.TimeaiLogoBlack,{className:"h-[35px] w-[124px] translate-y-[-6px]"}),(0,t.jsx)("span",{className:"absolute bottom-[-4px] right-[-24px] rounded-full bg-red-100 px-1.5 py-0.5 text-[8px] font-semibold uppercase text-red-600",children:"beta"})]})]}),(0,t.jsx)(v.IconButton,{icon:(0,t.jsx)(y.X,{size:20}),onClick:()=>e(!1)})]})};var E=e.i(495277),A=e.i(26094),T=e.i(884864),j=e.i(917591),C=e.i(287022),N=e.i(737806),k=e.i(486427),I=e.i(947414);function R(e){let t=(0,I.useConstant)(()=>(0,k.motionValue)(e)),{isStatic:n}=(0,r.useContext)(N.MotionConfigContext);if(n){let[,n]=(0,r.useState)(e);(0,r.useEffect)(()=>t.on("change",n),[])}return t}var S=e.i(344230),L=e.i(674008);function P(e,t){let n=R(t()),i=()=>n.set(t());return i(),(0,L.useIsomorphicLayoutEffect)(()=>{let t=()=>C.frame.preRender(i,!1,!0),n=e.map(e=>e.on("change",t));return()=>{n.forEach(e=>e()),(0,C.cancelFrame)(i)}}),n}function M(e,t,n,i){if("function"==typeof e){let t;return k.collectMotionValues.current=[],e(),t=P(k.collectMotionValues.current,e),k.collectMotionValues.current=void 0,t}if(void 0!==n&&!Array.isArray(n)&&"function"!=typeof t){var r=e,s=t,a=n,o=i;let l=(0,I.useConstant)(()=>Object.keys(a)),c=(0,I.useConstant)(()=>({}));for(let e of l)c[e]=M(r,s,a[e],o);return c}let l="function"==typeof t?t:function(...e){let t=!Array.isArray(e[0]),n=t?0:-1,i=e[0+n],r=e[1+n],s=e[2+n],a=e[3+n],o=(0,S.interpolate)(r,s,a);return t?o(i):o}(t,n,i),c=Array.isArray(e)?z(e,l):z([e],([e])=>l(e)),u=Array.isArray(e)?void 0:e.accelerate;return u&&!u.isTransformed&&"function"!=typeof t&&Array.isArray(n)&&i?.clamp!==!1&&(c.accelerate={...u,times:t,keyframes:n,isTransformed:!0,...i?.ease?{ease:i.ease}:{}}),c}function z(e,t){let n=(0,I.useConstant)(()=>[]);return P(e,()=>{n.length=0;let i=e.length;for(let t=0;t{let s,[a,o]=(0,r.useState)(!0),l=M((s=R(0),!function(e){let t=(0,r.useRef)(0),{isStatic:n}=(0,r.useContext)(N.MotionConfigContext);(0,r.useEffect)(()=>{if(n)return;let i=({timestamp:n,delta:i})=>{t.current||(t.current=n),e(n-t.current,i)};return C.frame.update(i,!0),()=>(0,C.cancelFrame)(i)},[e])}(e=>s.set(e)),s),[0,5e3],[0,360],{clamp:!1}),c=M(l,e=>`conic-gradient(from ${e}deg, transparent 0%, transparent 10%, red 40%, black 60%, red 80%, transparent 100%)`);return(0,r.useEffect)(()=>{if(e){let t=setTimeout(()=>{o(!1)},e);return()=>clearTimeout(t)}},[e]),(0,r.useEffect)(()=>{n&&queueMicrotask(()=>{o(!1)})},[n]),(0,t.jsx)(i.motion.div,{className:"absolute -inset-px z-[-1] rounded-lg",style:{background:a?c:"transparent"},initial:{opacity:0},animate:{opacity:+!!a},transition:{duration:2}})};var D=e.i(88653),_=e.i(225526);let H=({isExpanded:e})=>{let[s,a]=(0,_.useLocalStorage)("info-banner-cleared",!1),o=(0,n.useIsMobile)();return(0,r.useEffect)(()=>{e&&a(!0)},[e,a]),(0,t.jsx)(D.AnimatePresence,{children:!s&&!e&&(0,t.jsx)("div",{className:"absolute inset-x-0 bottom-full z-[10001] mb-2 flex justify-center",children:(0,t.jsxs)(i.motion.div,{className:`relative flex w-full flex-col gap-1 rounded-lg border border-warm-grey-2 bg-ivory-white p-4 ${o?"max-w-[95dvw]":"max-w-[600px]"}`,initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2,ease:"easeOut"},children:[(0,t.jsx)(E.default,{variant:"withIcon",onClick:()=>a(!0),className:"absolute -top-3 right-[-6px] z-20 flex size-6 items-center justify-center rounded-full bg-ivory-white shadow-lg lg:-right-3 support:hover:bg-warm-grey-2","aria-label":"Close info banner",children:(0,t.jsx)(A.CloseIcon,{className:"size-4"})}),(0,t.jsx)("p",{className:"pr-6 font-graphik-compact",children:"Explore the full archive of TIME, a century of journalism, insight, and perspective, with AI that helps you research, connect ideas, and uncover stories across every era and topic."})]})})})};var O=e.i(657523);p.default.extend(g.default),p.default.extend(h.default);let K=({isExpanded:e,setIsExpanded:n,isVisible:g,setIsVisible:h,articleTitle:x,postId:y})=>{let v=(0,a.useAgentexRootStore)(e=>e.messages.length>0),b=(0,a.useAgentexRootStore)(e=>e.task),C=(0,a.useAgentexRootStore)(e=>e.isTaskPending),N=(0,s.usePathname)(),{sendMessage:k,createTask:I}=(0,a.useAgentexRootController)(),R=(0,r.useRef)(null),S=(0,O.isMobile)(),L=(0,r.useCallback)(async e=>{""!==e.trim()&&((0,m.sendGTMEvent)({event:f.eventName.FORM_SUBMIT,componentType:f.componentType.scaleAgentExperience,inputType:"userPrompt",promptText:e,pagePath:N}),await k(e).finally(()=>{R.current&&R.current.scrollTo({top:R.current.scrollHeight,behavior:"smooth"})}))},[k,N]),P=(0,r.useCallback)(async()=>{if(n(!0),"function"==typeof window.jwplayer){let e=window.jwplayer(),t=e.getState?.();e&&"function"==typeof e.pause&&"playing"===t&&e.pause()}null!==b||C||await I({user_language:navigator.language,user_timezone:p.default.tz.guess(),user_local_time:(0,p.default)().tz(p.default.tz.guess()).format("HH:mm:ss"),...void 0!==y&&""!==y?{post_id:y}:{}})},[n,b,C,I,y]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(i.motion.div,{className:"relative flex size-full flex-col items-center gap-4 overflow-y-auto bg-white [overscroll-behavior:contain] [touch-action:pan-y]",initial:{visibility:e?"visible":"hidden"},animate:{visibility:e?"visible":"hidden"},transition:{delay:.5*!e},ref:R,children:[(0,t.jsx)(i.motion.div,{className:"sticky top-0 z-10 w-full",initial:{opacity:0,display:"none"},animate:{opacity:1,display:"block"},exit:{opacity:0,display:"none"},transition:{ease:"easeOut"},children:(0,t.jsx)(w,{setIsExpanded:n})}),(0,t.jsxs)(o.ActiveAudioProvider,{children:[v?(0,t.jsx)(u.Thread,{}):(0,t.jsx)(d.Welcome,{onSelectPrompt:L,onMinimize:()=>n(!1),articleTitle:x}),(0,t.jsx)(l.StickyPodcastPlayer,{isExpanded:e})]})]}),(0,t.jsxs)(i.motion.div,{className:"relative flex w-full flex-row items-center justify-center bg-transparent align-middle",children:[(0,t.jsxs)(i.motion.div,{className:"w-full",initial:{opacity:+!!g},animate:{opacity:+!!g},transition:{duration:g?.8:S?.2:.3,delay:g?0:.4*!S,ease:"backIn"},style:{pointerEvents:g?"auto":"none"},children:[(0,t.jsx)(H,{isExpanded:e}),(0,t.jsxs)(i.motion.div,{className:"relative shadow-lg",animate:{marginRight:e?"0rem":"4rem"},children:[(0,t.jsx)(c.PromptInput,{isExpanded:e,onClick:()=>void P(),onSubmit:L}),!e&&g&&(0,t.jsx)(V,{})]})]}),!e&&(0,t.jsx)(E.default,{variant:"withIcon",className:"absolute right-1 z-20 rounded-full bg-white shadow-lg","aria-label":"Toggle AI Assistant",onClick:()=>{(0,m.sendGTMEvent)({event:f.eventName.INTERNAL_CLICK,componentType:f.componentType.scaleAgentExperience,clickText:g?"collapse":"expand",pagePath:N}),h(!g)},children:(0,t.jsx)(i.motion.div,{animate:{rotate:360*!!g},transition:{duration:.8,ease:"easeInOut"},className:"flex items-center justify-center p-4 ",children:g?(0,t.jsx)(A.CloseIcon,{color:j.colors.brand.red,className:"size-6"}):(0,t.jsx)(T.TimeAiSparkles,{asChild:!0})})})]})]})};var B=e.i(60533);e.i(291749);var F=e.i(883348),Y=e.i(374774),Z=e.i(623978),G=e.i(580554),X=e.i(815316);let $=new F.default({baseURL:`${window.location.origin}/api/agentex`});e.s(["ScaleAgentOverlay",0,({bottomOffset:e=84,collapseOnOutsideInteraction:o=!0,articleTitle:l,postId:c})=>{let[u,d]=(0,r.useState)(!1),[p,g]=(0,r.useState)(!1),[h,x]=(0,r.useState)(!0),[y,v]=(0,r.useState)(!1),[b,w]=(0,r.useState)(!1),[E,A]=(0,r.useState)("z-[10001]");(0,G.useScrollLock)(p);let T=(0,r.useRef)(!1),C=(0,s.usePathname)(),N=(0,r.useRef)(null),k=(0,n.useIsMobile)(),I=(0,r.useRef)(p);(0,r.useEffect)(()=>{let e=sessionStorage.getItem("agentCollapsed");null===e?x(!0):x("true"!==e)},[]),(0,r.useEffect)(()=>{if(!T.current){T.current=!0;return}sessionStorage.setItem("agentCollapsed",String(!h))},[h]),(0,r.useEffect)(()=>{p?(0,Y.pauseAllAdTimers)():(0,Y.resumeAllAdTimers)()},[p]),(0,r.useEffect)(()=>{let e;return p?queueMicrotask(()=>{A("z-[2147483645]")}):e=setTimeout(()=>{A("z-[10001]")},B.DESKTOP_EXPAND_DELAY+200),()=>clearTimeout(e)},[p]),(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&p&&g(!1)};return I.current!==p&&((0,m.sendGTMEvent)({event:f.eventName.INTERNAL_CLICK,componentType:f.componentType.scaleAgentExperience,clickText:p?"open":"close",pagePath:C}),I.current=p),document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[p,g,C]);let R=(0,r.useCallback)(()=>{(0,m.sendGTMEvent)({event:f.eventName.SYSTEM_ERROR,componentType:f.componentType.scaleAgentExperience,errorType:"Agent Initialization",pagePath:C}),v(!0)},[v,C]);return((0,r.useEffect)(()=>{let e=()=>{window.scrollY/(document.body.scrollHeight-window.innerHeight)*100>=15&&d(!0)};return e(),window.addEventListener("scroll",e,{passive:!0}),()=>{window.removeEventListener("scroll",e)}},[]),(0,r.useEffect)(()=>{if(!o||!p)return;let e=e=>{let t=N.current;if(!t)return;let n=e.target;n&&t.contains(n)||g(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e,{passive:!0}),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[o,p]),(0,Z.useFocusTrap)(N,{isActive:p,onClose:()=>g(!1)}),y||!u)?null:(0,t.jsx)(i.motion.div,{id:"scale-agent-overlay-container","data-isexpanded":p,ref:N,role:"dialog","aria-modal":"true","aria-label":"chat with time ai",className:(0,X.cn)("fixed right-2 w-full rounded-lg lg:right-20",E,{"right-0 lg:right-0":p}),initial:{bottom:"-150px",width:h?k?"95dvw":"600px":"40px"},animate:{width:p?"calc(100dvw)":h?k?"95dvw":"600px":"64px",bottom:b?p?"0px":`${e}px`:"-150px"},transition:{bottom:{duration:.8,type:"spring",bounce:.05,delay:k?0:p?B.DESKTOP_EXPAND_DELAY:0},width:{duration:.5,type:"spring",damping:20,mass:1,delay:k||p?0:B.DESKTOP_EXPAND_DELAY+.15},borderRadius:{duration:.5,type:"spring",damping:20}},children:(0,t.jsx)(i.motion.div,{className:"relative flex h-full flex-col items-center rounded-lg",animate:{height:p?"calc(100dvh)":"64px",backgroundColor:p?j.colors.white:j.colors.transparent},transition:{backgroundColor:{delay:.7*!p,ease:"easeInOut"},duration:.8,type:"spring",bounce:.05,delay:k?0:p?B.DESKTOP_EXPAND_DELAY:0},children:(0,t.jsx)(a.AgentexRoot,{agentexClient:$,onError:R,onAgentexLoaded:()=>w(!0),children:(0,t.jsx)(K,{isExpanded:p,setIsExpanded:g,isVisible:h,setIsVisible:x,articleTitle:l,postId:c})})})})}],443450)},101255,e=>{"use strict";var t=e.i(843476);e.s(["ZineIcon",0,({size:e="1.5rem",className:n,color:i="currentColor",alt:r,...s})=>(0,t.jsxs)("svg",{className:n,width:e,height:e,viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s,children:[(0,t.jsx)("title",{children:r}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.2 15.3V4.49999H18.8V15.3H5.2ZM5.2 16.5V20.1H18.8V16.5H5.2ZM4 16.3V4.29999C4 3.7477 4.44772 3.29999 5 3.29999H18.8H20V4.49999V15.3V16.5V20.1V21.3H18.8H5C4.44772 21.3 4 20.8523 4 20.3V16.3ZM16 9.29999H8V8.09999H16V9.29999ZM8 12.3H16V11.1H8V12.3Z",fill:i})]})])}]);