PageSourceSearch

https://www.trtarabi.com/_next/static/chunks/6378-f3ac7dd696086545.js

js trtarabi.com collected 2026-10-02 11:00:59 UTC 24,653 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6378],{86378:function(e,t,n){n.r(t),n.d(t,{default:function(){return y}});var r=n(74023),l=n(83641),a=n(59052),s=n(69577),i=n(71297),o=n(97769),c=n(33533),d=n(73765);async function u(e){var t,n;let{messageHandler:r,slug:l,input:a,messages:s}=e,i=await fetch("".concat("https://prod-trt-global-ai-search.trtglobal.io","/api/summary/").concat(l),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:a,focusMode:"webSearch",history:null===(t=s||[])||void 0===t?void 0:t.map(e=>[(null==e?void 0:e.user)?"human":"ai",null==e?void 0:e.text])})});if(!i.body)throw Error("No response body");let o=null===(n=i.body)||void 0===n?void 0:n.getReader(),c=new TextDecoder("utf-8"),d="",u="",m="";for(;;){let{value:e,done:t}=await o.read();if(t)break;d+=c.decode(e,{stream:!0});try{for(let e of d.split("\n")){if(!e.trim())continue;let t=JSON.parse(e);"message"===t.type&&t.data&&(u||(u=t.messageId||Math.random().toString(36).substring(2,15)),m+=t.data,r(u,m)),t.message&&r(Math.random().toString(36).substring(2,15),t.message)}d=""}catch(e){}}}var m=n(12173),x=n(22188);let h=e=>{let{children:t,open:n,setOpen:l}=e,{videoSrc:a}=(0,x.qC)();return(0,r.jsx)("div",{className:(0,m.cn)("fixed inline-flex items-center right-4 rounded-lg justify-between gap-x-2 bottom-20 chat-bot-bubble-button sm:bottom-6 z-[100] text-grey-13 transition",{"left-4":!!a}),children:(0,r.jsx)("div",{className:"",onClick:()=>{n||l(!0)},children:(0,r.jsx)("div",{className:(0,m.cn)("flex items-center justify-center transition-all ease-linear bg-white pb-2 max-w-[calc(100vw-32px)] max-h-[calc(100vh-132px)] shadow-lg rounded-lg","px-[14px] py-[10px] md:px-4 md:py-3",{"w-[52px] h-[58px] md:w-[200px] md:h-[58px]":!n,"w-[350px] h-[645px] md:w-[498px] md:h-[716px] overflow-y-auto":n,"cursor-pointer":!n,"cursor-default":n}),children:t})})})};var p=e=>{let{trackVisibility:t,isAtBottom:n,scrollAreaRef:a}=e,s=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!t||!a.current||!s.current)return;let e=a.current,r=new MutationObserver(t=>{t.filter(e=>"childList"===e.type&&(e.addedNodes.length>0||e.removedNodes.length>0)||"characterData"===e.type||"attributes"===e.type&&"style"===e.attributeName).length>0&&n&&requestAnimationFrame(()=>{let t=e.scrollHeight-e.clientHeight;e.scrollHeight>e.clientHeight&&e.scrollTo({top:t,behavior:"smooth"})})});return r.observe(e,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeOldValue:!0}),()=>{r.disconnect()}},[t,a,n]),(0,r.jsx)("div",{ref:s,style:{height:"5px",width:"100%"},"aria-hidden":"true"})};let f=()=>(0,r.jsxs)("svg",{width:"28",height:"26",viewBox:"0 0 28 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.81901 6.57826C1.47933 6.45694 1.12634 6.3615 0.762573 6.29436C0.735865 6.28945 0.7091 6.28467 0.682275 6.28004C0.439242 6.23815 0.439242 5.90135 0.682275 5.85946C0.7091 5.85483 0.735865 5.85005 0.762573 5.84514C1.12634 5.778 1.47933 5.68256 1.81901 5.56124C2.02229 5.48863 2.22081 5.40679 2.41401 5.31616C3.75203 4.68868 4.83562 3.64181 5.48514 2.34914C5.57892 2.16248 5.66367 1.9707 5.73879 1.7743C5.86436 1.44613 5.96315 1.10511 6.03265 0.753674C6.03774 0.727871 6.04268 0.702014 6.04747 0.676097C6.09084 0.441301 6.43944 0.441301 6.4828 0.676097C6.4876 0.702014 6.49254 0.727871 6.49763 0.753674C6.56713 1.10511 6.66591 1.44613 6.79149 1.7743C6.86664 1.97069 6.95136 2.16248 7.04517 2.34914C7.69465 3.64181 8.77825 4.68868 10.1163 5.31616C10.3095 5.40679 10.508 5.48863 10.7113 5.56124C11.051 5.68256 11.4039 5.778 11.7677 5.84514C11.7944 5.85005 11.8212 5.85483 11.848 5.85946C12.0911 5.90135 12.0911 6.23815 11.848 6.28004C11.8212 6.28467 11.7944 6.28945 11.7677 6.29436C11.4039 6.3615 11.051 6.45694 10.7113 6.57826C10.508 6.65087 10.3095 6.73271 10.1163 6.82335C8.77825 7.45082 7.69465 8.49769 7.04517 9.79037C6.95136 9.97703 6.86664 10.1688 6.79149 10.3652C6.66591 10.6934 6.56713 11.0344 6.49763 11.3858C6.49254 11.4116 6.4876 11.4375 6.4828 11.4634C6.43944 11.6982 6.09084 11.6982 6.04747 11.4634C6.04268 11.4375 6.03774 11.4116 6.03265 11.3858C5.96315 11.0344 5.86436 10.6934 5.73879 10.3652C5.66367 10.1688 5.57892 9.97703 5.48514 9.79037C4.83562 8.49769 3.75203 7.45082 2.41401 6.82335C2.22081 6.73271 2.02229 6.65087 1.81901 6.57826ZM9.94001 14.9216C9.70244 14.8597 9.46157 14.8054 9.21766 14.759C9.17953 14.7518 9.14136 14.7447 9.10312 14.7378L9.09152 14.7358L9.07583 14.733C9.0517 14.7287 9.0252 14.7242 8.97221 14.715L8.9537 14.7118C8.56503 14.6408 8.56503 14.1031 8.9537 14.032L8.97221 14.0288C9.0252 14.0197 9.0517 14.0151 9.07583 14.0109L9.09152 14.0081L9.10312 14.006C9.14136 13.9991 9.17953 13.9921 9.21762 13.9848C9.46153 
113.9384 9.70244 13.8841 9.94001 13.8223C10.1429 13.7695 10.3434 13.7111 10.5414 13.6474C13.7437 12.6161 16.2636 10.1815 17.3311 7.08774C17.3971 6.89651 17.4575 6.70279 17.5122 6.50672C17.5762 6.27724 17.6324 6.0445 17.6804 5.80886C17.6879 5.77205 17.6952 5.73517 17.7023 5.69823L17.7045 5.68702L17.7074 5.67187C17.7117 5.64883 17.7164 5.62354 17.7257 5.57349L17.726 5.57176L17.7293 5.55387C17.8028 5.17837 18.3594 5.17837 18.4329 5.55387L18.4363 5.57176C18.4457 5.62296 18.4504 5.64855 18.4548 5.67187L18.4577 5.68702L18.4599 5.69823C18.467 5.73517 18.4743 5.77205 18.4818 5.80886C18.5298 6.04453 18.586 6.27724 18.65 6.50672C18.7047 6.70279 18.7651 6.89651 18.8311 7.08774C19.8986 10.1815 22.4185 12.6161 25.6208 13.6474C25.8188 13.7111 26.0193 13.7695 26.2222 13.8223C26.4598 13.8841 26.7007 13.9384 26.9446 13.9848C26.9827 13.9921 27.0208 13.9991 27.0591 14.006L27.0707 14.0081L27.0864 14.0109C27.1105 14.0151 27.137 14.0197 27.19 14.0288L27.2085 14.032C27.5972 14.1031 27.5972 14.6408 27.2085 14.7118L27.19 14.715L27.1339 14.7247L27.0864 14.733L27.0707 14.7358L27.0591 14.7378C27.0208 14.7447 26.9827 14.7518 26.9446 14.759C26.7007 14.8054 26.4598 14.8597 26.2222 14.9216C26.0193 14.9744 25.8188 15.0328 25.6208 15.0965C22.4185 16.1278 19.8986 18.5623 18.8311 21.6561C18.7651 21.8473 18.7047 22.0411 18.65 22.2371C18.586 22.4666 18.5298 22.6994 18.4818 22.935C18.4743 22.9718 18.467 23.0087 18.4599 23.0456L18.4577 23.0568L18.4548 23.072L18.4484 23.1061L18.4366 23.1701L18.4329 23.19C18.3594 23.5655 17.8028 23.5655 17.7293 23.19L17.726 23.1721C17.7165 23.121 17.7118 23.0953 17.7074 23.072L17.7045 23.0568L17.7023 23.0456C17.6952 23.0087 17.6879 22.9718 17.6804 22.935C17.6324 22.6993 17.5762 22.4666 17.5122 22.2371C17.4575 22.0411 17.3971 21.8473 17.3311 21.6561C16.2636 18.5623 13.7437 16.1278 10.5414 15.0965C10.3434 15.0328 10.1429 14.9744 9.94001 14.9216ZM4.58015 22.1241C4.98866 22.1995 5.37561 22.3314 5.7321 22.5112C5.89068 22.5912 6.04321 22.6806 6.18891 22.7788C6.59491 23.0522 6.94792 23.3933 7.231 23.7855C7.33259 23.9263 7.42518 24.0737 7.50793 24.2269C7.69405 24.5713 7.83057 24.9451 7.9086 25.3398C7.91182 25.3561 7.91497 25.3724 7.91798 25.3888C7.94537 25.5371 8.16554 25.5371 8.19293 25.3888C8.19594 25.3724 8.19905 25.3561 8.20228 25.3398C8.28033 24.9451 8.41686 24.5713 8.60294 24.2269C8.68573 24.0737 8.77832 23.9263 8.8799 23.7855C9.16295 23.3933 9.516 23.0522 9.922 22.7788C10.0677 22.6806 10.2202 22.5912 10.3788 22.5112C10.7353 22.3314 11.1222 22.1995 11.5308 22.1241C11.5476 22.121 11.5645 22.118 11.5815 22.1151C11.735 22.0886 11.735 21.8759 11.5815 21.8495C11.5645 21.8465 11.5476 21.8435 11.5308 21.8404C11.1222 21.765 10.7353 21.6331 10.3788 21.4533C10.2202 21.3733 10.0677 21.2839 9.922 21.1857C9.516 20.9123 9.16295 20.5712 8.8799 20.179C8.77832 20.0382 8.68573 19.8908 8.60294 19.7377C8.41686 19.3933 8.28033 19.0194 8.20228 18.6247C8.19905 18.6084 8.19594 18.5921 8.19293 18.5757C8.16554 18.4274 7.94537 18.4274 7.91798 18.5757C7.91497 18.5921 7.91182 18.6084 7.9086 18.6247C7.83057 19.0194 7.69405 19.3933 7.50793 19.7377C7.42518 19.8908 7.33259 20.0382 7.231 20.179C6.94792 20.5712 6.59491 20.9123 6.18891 21.1857C6.04321 21.2839 5.89068 21.3733 5.7321 21.4533C5.37561 21.6331 4.98866 21.765 4.58015 21.8404C4.56328 21.8435 4.54638 21.8465 4.52941 21.8495C4.37595 21.8759 4.37595 22.0886 4.52941 22.1151C4.54638 22.118 4.56328 22.121 4.58015 22.1241Z",fill:"url(#paint0_linear_22047_66974)"}),(0,r.jsx)("defs",{children:(0,r.jsxs)("linearGradient",{id:"paint0_linear_22047_66974",x1:"14",y1:"25.5",x2:"14",y2:"0.5",gradientUnits:"userSpaceOnUse",children:[(0,r.jsx)("stop",{stopColor:"#33C4E6"}),(0,r.jsx)("stop",{offset:"1",stopColor:"#01ABD9"})]})})]});var g=n(53766);let b=e=>{let{disabled:t,className:n,onSend:l}=e;return(0,r.jsx)("div",{className:n,style:{filter:t?"":"drop-shadow(0px 0px 4px #33C4E6)"},onClick:l,children:(0,r.jsx)("button",{className:(0,m.cn)("bg-white border rounded-xl h-full aspect-square flex items-center justify-center",{"text-primary-blue-2":!t,"border-grey-6 text-grey-6":t}),children:(0,r.jsx)("svg",{width:"23",height:"21",viewBox:"0 0 23 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M1.86244 0.541856L22 10.5L1.86244 20.4581C1.74749 20.5029 1.62201 20.512 1.50193 20.4844C1.38184 20.4568 1.27257 20.3937 1.18798 20.3031C1.10091 20.2102 1.04097 20.0946 1.01481 19.9693C0.988643 19.844 0.997274 19.7138 1.03974 19.5931L3.55553 12.0894C3.90133 11.058 3.90133 9.94198 3.5
15553 8.91058L1.03974 1.40691C0.997274 1.28625 0.988643 1.15604 1.01481 1.03071C1.04097 0.905386 1.10091 0.789837 1.18798 0.696866C1.27257 0.6063 1.38184 0.543213 1.50193 0.515614C1.62201 0.488015 1.74749 0.497149 1.86244 0.541856Z",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})})})},C=(0,l.forwardRef)((e,t)=>{let{topic:n}=e,m=(0,o.usePathname)().split("/").filter(Boolean),x=m[m.length-1],C=(0,l.useRef)(null),[y,w]=(0,l.useState)(!1),[v,j]=(0,l.useState)(!1),[k,N]=(0,l.useState)(""),[L,S]=(0,l.useState)(!0),[M,_]=(0,l.useState)([]),F=(0,l.useCallback)(()=>{if(!C.current)return;let{scrollTop:e,scrollHeight:t,clientHeight:n}=C.current,r=t-n<=e+5;r!==L&&S(r)},[L]);(0,l.useEffect)(()=>{if(C.current&&L){let e=C.current,t=e.scrollHeight-e.clientHeight;t>0&&(e.scrollTop=t)}},[M,L]);let T=(e,t)=>{_(n=>{let r=n.findIndex(t=>t.id===e);if(-1!==r){let e=[...n];return e[r].text=t,e}return[...n,{text:t,user:!1,id:e,animate:!0}]})},[I,R]=(0,l.useState)([]),D=(0,l.useCallback)(async e=>{try{w(!0),j(!0),await u({slug:e,messageHandler:T,input:"summarize the article"}),j(!1)}catch(e){}},[]),E=async e=>{if(!e&&!k.trim()||v)return;let t=e||k;j(!0),_(e=>[...e,{text:t,user:!0,id:Math.random().toString(),animate:!1}]),N(""),await (0,a.a)({input:t,messageHandler:T,slug:x,citationsHandler:R}),j(!1)};return(0,l.useImperativeHandle)(t,()=>({open:e=>{w(!0)}})),(0,l.useEffect)(()=>{y&&!M.length&&D(x)},[y,M.length,x]),(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(h,{open:y,setOpen:w,children:y?(0,r.jsxs)("div",{className:"flex flex-col w-full h-full",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"gap-x-[10px] pb-3 md:pb-[14px] mb-3 md:mb-[14px] w-full text-sm font-medium border-b border-grey-4 flex items-center justify-between",children:[(0,r.jsx)(f,{}),(0,r.jsx)("p",{className:"w-full text-base md:text-xl leading-8 font-medium font-body text-primary-blue-2 flex-1",children:"AI Summary"}),(0,r.jsx)("button",{onClick:()=>{w(!1)},children:(0,r.jsx)(s.Z,{className:"text-grey-6"})})]}),n?(0,r.jsxs)("div",{className:"text-base md:text-xl text-grey-6 font-body",children:["Topic: ",(0,r.jsx)("span",{className:"text-primary-blue-2",children:n})]}):null]}),(0,r.jsxs)("div",{className:"flex flex-col py-1 overflow-y-auto p-4 flex-1 gap-y-2 text-sm mt-6",ref:C,onScroll:F,children:[M.map(e=>(0,r.jsx)(g.D,{className:"break-all rounded-lg px-3 py-2 text-black font-normal ".concat(e.user?"bg-grey-2 text-lg leading-7 font-body self-end text-right":"bg-white font-base font-body leading-6 self-start"),children:e.text},e.id)),v?(0,r.jsx)("div",{className:"flex z-10 items-center justify-center",children:(0,r.jsx)(c.A,{className:"z-10 text-black m-auto",color:"black"})}):null,(0,r.jsx)(p,{trackVisibility:v,isAtBottom:L,scrollAreaRef:C})]}),(0,r.jsxs)("div",{className:"pt-[14px] pb-3 md:pt-[18px] md:pb-[14px] grid gap-2 hidden",children:[(0,r.jsxs)("div",{className:"flex gap-x-2 h-10 md:h-[52px]",children:[(0,r.jsx)("input",{className:"flex-1 px-3 py-2 h-full text-sm border border-grey-5 bg-grey-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 placeholder:text-grey-6",value:k,onChange:e=>N(e.target.value),onKeyDown:e=>"Enter"===e.key&&E(),placeholder:"Ask something about ".concat(n,"...")}),(0,r.jsx)(b,{disabled:!k.trim()||v,onSend:()=>{E()},className:"hidden md:block"})]}),(0,r.jsxs)("div",{className:"flex gap-2 justify-between h-10 md:h-auto mb-3 md:mb-0",children:[(0,r.jsxs)(d.LinkWithChannelLink,{href:"/ai-search",className:"flex items-center gap-2 text-primary-blue-2 font-body text-sm md:text-base",children:["Go to Discover Portal",(0,r.jsx)(i.Z,{})]}),(0,r.jsx)(b,{disabled:!k.trim()||v,onSend:()=>{E()},className:"block md:hidden"})]})]})]}):(0,r.jsxs)("div",{className:"flex gap-x-[10px]",children:[(0,r.jsx)(f,{}),(0,r.jsx)("p",{className:"hidden md:block w-full text-center text-lg leading-6.25 font-medium font-body text-primary-blue-2",children:"AI Summary"})]})})})});var y=e=>{let{topic:t}=e;return window.location.href.includes("test.trtglobal.io")||window.location.href.includes("localhost")?(0,r.jsx)(C,{topic:t}):null}},53766:function(e,t,n){n.d(t,{D:function(){return g},Z:function(){return b}});var r=n(74023),l=n(83641),a=n(12173);function s(e,t){let n;let r=/\[(\d+(?:\s*,\s*\d+)*)\](?:\(([^)]*)\))?/g,l=t;for(;null!==(n=r.exec(e));){let e=n.index,r=e+n[0].length;if(t>e&&t<r){l=e;break}}let a=e.lastIndexOf("[",l);if(-1!==a){let t=e.substring(a).match(/^\[(\d+(?:\s*,\s*\d+)*)?\]?(?:\([^)]*)?$/);t&&a+t[0].length>=l&&(l=a)}return l}
1var i=n(50897),o=n(36754),c=n(61845);let d=e=>{let{citeNumbers:t,citations:n}=e,[s,i]=(0,l.useState)(!1),d=t.map(e=>n.find(t=>t.cite===e)).filter(Boolean);if(0===d.length)return null;let u=d.length<=2;return(0,r.jsx)(o.Provider,{delayDuration:0,skipDelayDuration:500,children:(0,r.jsxs)(o.Root,{open:s,onOpenChange:i,children:[(0,r.jsx)(o.Trigger,{asChild:!0,children:(0,r.jsxs)("span",{className:(0,a.cn)("inline-flex items-center justify-center px-1 py-1 rounded-[4px] text-[11px] font-semibold font-body leading-normal transition-colors cursor-pointer whitespace-nowrap",{"bg-grey-4 text-grey-8":!s,"bg-primary-4 text-white":s}),children:[(0,r.jsx)("span",{children:"+"}),(0,r.jsx)("span",{children:d.length})]})}),(0,r.jsx)(o.Portal,{children:(0,r.jsx)(o.Content,{sideOffset:4,side:"bottom",align:"center",style:{filter:"drop-shadow(0px 0px 10px rgba(0, 0, 0, 0.2))"},className:(0,a.cn)("z-50 bg-white rounded-[5px] min-w-[200px] max-w-[269px] w-auto sm:min-w-[269px] sm:max-w-[300px] relative"),onPointerDownOutside:e=>{e.target.closest("[data-citation-tooltip]")&&e.preventDefault()},children:(0,r.jsx)("div",{"data-citation-tooltip":!0,className:"bg-grey-3 flex flex-col gap-0 p-2 rounded-[5px] overflow-clip",onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:d.map((e,t)=>(0,r.jsxs)("div",{className:"min-w-0 w-full",children:[(0,r.jsx)(c.default,{href:e.metadata.url||e.link,target:"_blank",className:"group block w-full",onClick:e=>e.stopPropagation(),children:(0,r.jsxs)("div",{className:"flex flex-col gap-1.5 items-start transition-colors min-w-0 w-full",children:[u&&e.metadata.url&&(0,r.jsx)("div",{className:"font-body text-[11px] leading-[16.5px] overflow-hidden text-ellipsis whitespace-nowrap w-full min-w-0 text-grey-8 group-hover:text-primary-4 underline",children:e.metadata.url}),(0,r.jsx)("div",{className:(0,a.cn)("font-primary font-semibold text-[13px] leading-normal w-full min-w-0 text-grey-12 group-hover:text-primary-4",{"overflow-hidden text-ellipsis whitespace-nowrap":!u}),children:e.metadata.title})]})}),t<d.length-1&&(0,r.jsx)("div",{className:"h-px bg-grey-5 my-2.5"})]},e.cite))})})})]})})},u=(e,t)=>{let n;let l=/\[(\d+(?:\s*,\s*\d+)*)\](?:\(([^)]+)\))?/g,a=[],s=0;for(;null!==(n=l.exec(e));){n.index>s&&a.push(e.substring(s,n.index));let l=n[1].split(",").map(e=>parseInt(e.trim(),10)).filter(e=>!isNaN(e));l.length>0&&a.push((0,r.jsx)(d,{citeNumbers:l,citations:t},"citation-".concat(n.index))),s=n.index+n[0].length}return s<e.length&&a.push(e.substring(s)),a.length>0?a:[e]},m=(e,t,n,a)=>{switch(e.type){case"paragraph":return(0,r.jsxs)("p",{className:"mb-3 last:mb-0",children:[e.tokens&&e.tokens.length>0?e.tokens.map((r,l)=>m(r,t,"".concat(n,"-").concat(l),l===e.tokens.length-1?a:void 0)):e.text?(0,r.jsxs)(l.Fragment,{children:[u(e.text,t),a]}):null,e.tokens&&e.tokens.length>0&&!e.tokens.some(e=>["text","strong","em","link"].includes(e.type))&&a]},n);case"text":if(e.tokens&&e.tokens.length>0)return(0,r.jsx)(l.Fragment,{children:e.tokens.map((r,l)=>m(r,t,"".concat(n,"-").concat(l),l===e.tokens.length-1?a:void 0))},n);return(0,r.jsxs)(l.Fragment,{children:[u(e.text,t),a]},n);case"strong":return(0,r.jsx)("strong",{children:e.tokens&&e.tokens.length>0?e.tokens.map((e,r)=>m(e,t,"".concat(n,"-").concat(r))):e.text?(0,r.jsx)(r.Fragment,{children:u(e.text,t)}):null},n);case"em":return(0,r.jsx)("em",{className:"italic text-grey-9 leading-8 font-normal font-body",children:e.tokens&&e.tokens.length>0?e.tokens.map((e,r)=>m(e,t,"".concat(n,"-").concat(r))):e.text?(0,r.jsx)(r.Fragment,{children:u(e.text,t)}):null},n);case"list":{let l=e.ordered?"ol":"ul",a=e.ordered?"list-decimal list-outside space-y-2 my-4 ml-6":"list-disc list-outside space-y-2 my-4 ml-6";return(0,r.jsx)(l,{className:a,children:e.items.map((e,r)=>m(e,t,"".concat(n,"-item-").concat(r)))},n)}case"list_item":return(0,r.jsx)("li",{className:"text-black leading-relaxed pl-2",children:e.tokens&&e.tokens.length>0?e.tokens.map((e,a)=>"paragraph"===e.type?(0,r.jsx)(l.Fragment,{children:e.tokens&&e.tokens.length>0?e.tokens.map((e,r)=>m(e,t,"".concat(n,"-").concat(a,"-").concat(r))):e.text?u(e.text,t):null},"".concat(n,"-").concat(a)):m(e,t,"".concat(n,"-").concat(a))):e.text?(0,r.jsx)(r.Fragment,{children:u(e.text,t)}):null},n);case"link":return(0,r.jsx)("a",{href:e.href,target:"_blank",rel:"noreferrer",title:e.title||"",className:"text-primary-blue-2 hover:text-primary-blue-3 decoration-1 underline-offset-2 hover:
1decoration-2 transition-all font-primary",children:e.tokens&&e.tokens.length>0?e.tokens.map((e,r)=>m(e,t,"".concat(n,"-").concat(r))):e.text?(0,r.jsx)(r.Fragment,{children:u(e.text,t)}):null},n);case"space":return" ";case"br":return(0,r.jsx)("br",{},n);case"code":case"codespan":return(0,r.jsx)("code",{className:"bg-grey-1 px-1 py-0.5 rounded text-sm",children:e.text},n);case"del":return(0,r.jsx)("del",{children:e.tokens&&e.tokens.length>0?e.tokens.map((e,r)=>m(e,t,"".concat(n,"-").concat(r))):e.text?(0,r.jsx)(r.Fragment,{children:u(e.text,t)}):null},n);default:if(e.text)return(0,r.jsx)(l.Fragment,{children:u(e.text,t)},n);if(e.tokens)return(0,r.jsx)(l.Fragment,{children:e.tokens.map((e,r)=>m(e,t,"".concat(n,"-").concat(r)))},n);return null}},x=(e,t,n)=>{if(!e)return null;i.TU.setOptions({gfm:!0,pedantic:!1});let l=i.TU.lexer(e);return(0,r.jsx)(r.Fragment,{children:l.map((e,r)=>m(e,t,"token-".concat(r),r===l.length-1?n:void 0))})};var h=n(31652);let p=(0,l.memo)(e=>{let{onClick:t}=e,n=(0,h.useTranslations)();return(0,r.jsx)("span",{className:"inline whitespace-nowrap",children:(0,r.jsx)("button",{onClick:t,className:"text-primary-4 hover:text-primary-blue-3 transition-colors cursor-pointer font-body leading-5 text-sm font-bold mx-2",children:n("show_more")})})});p.displayName="ShowMoreButton";let f=(0,l.memo)(l.forwardRef((e,t)=>(0,r.jsx)("div",{ref:t,"aria-hidden":"true",className:"absolute invisible pointer-events-none max-w-none  font-body text-[16px] leading-normal top-0 left-0"})));f.displayName="MeasurementDiv";let g=(0,l.memo)(e=>{let{children:t,className:n,contents:i=[],isStreaming:o=!1,maxLines:c=3,isCollapsed:d=!1,onExpand:u}=e,{containerRef:m,measureRef:h,truncatedText:g,isOverflowing:b}=function(e){let{text:t,maxLines:n,isCollapsed:r,reserveText:a="Show More"}=e,i=(0,l.useRef)(null),o=(0,l.useRef)(null),c=(0,l.useRef)(null),d=(0,l.useRef)(null),[u,m]=(0,l.useState)({index:null,overflowing:!1}),x=(0,l.useCallback)(()=>{if(!i.current||!o.current||!r){m({index:null,overflowing:!1});return}let e=i.current,l=o.current,d=e.offsetWidth,u=c.current;if(u&&u.text===t&&5>Math.abs(u.width-d))return;l.style.width="".concat(d,"px");let x=(parseFloat(window.getComputedStyle(e).lineHeight)||24)*n+4;if(l.textContent=t,l.scrollHeight<=x){c.current={text:t,width:d,index:null,overflowing:!1},m({index:null,overflowing:!1});return}let h=0,p=t.length,f=0;for(;h<=p;){let e=Math.floor((h+p)/2);l.textContent=t.substring(0,e)+a,l.scrollHeight<=x?(f=e,h=e+1):p=e-1}let g=f;g=s(t,g);let b=t.substring(0,g).lastIndexOf(" ");b>g-20&&b>0&&s(t,b)===b&&(g=b),c.current={text:t,width:d,index:g,overflowing:!0},m({index:g,overflowing:!0})},[t,r,n,a]),h=(0,l.useCallback)(()=>{d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{requestAnimationFrame(x)},16)},[x]);return(0,l.useEffect)(()=>(h(),()=>{d.current&&clearTimeout(d.current)}),[h]),(0,l.useEffect)(()=>{let e=null,t=()=>{e&&clearTimeout(e),e=setTimeout(()=>{c.current=null,h()},100)};return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t),e&&clearTimeout(e)}},[h]),{containerRef:i,measureRef:o,truncatedText:(0,l.useMemo)(()=>r&&null!==u.index?t.substring(0,u.index):t,[t,r,u.index]),isOverflowing:u.overflowing}}({text:t,maxLines:c,isCollapsed:d}),C=d&&b,{visibleText:y}=function(e){let{text:t,isStreaming:n,revealDelay:r=10}=e,[a,s]=(0,l.useState)(()=>n?0:t.length),i=(0,l.useRef)(t.length),o=(0,l.useRef)(null),c=(0,l.useCallback)(()=>{o.current&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{s(e=>{let n=t.length-e;return n<=0?e:Math.min(e+Math.min(n,Math.max(5,Math.floor(n/5))),t.length)})})},[t.length]);return(0,l.useEffect)(()=>{if(!n){o.current&&cancelAnimationFrame(o.current),s(t.length),i.current=t.length;return}t.length<i.current&&s(0),i.current=t.length},[t.length,n]),(0,l.useEffect)(()=>{if(!n||a>=t.length)return;let e=setTimeout(c,r);return()=>{clearTimeout(e),o.current&&cancelAnimationFrame(o.current)}},[n,a,t.length,r,c]),(0,l.useEffect)(()=>()=>{o.current&&cancelAnimationFrame(o.current)},[]),{visibleText:(0,l.useMemo)(()=>n?t.substring(0,a):t,[t,n,a]),isRevealing:n&&a<t.length}}({text:g,isStreaming:o&&!C}),w=C&&!!u,v=(0,l.useCallback)(()=>{null==u||u()},[u]),j=(0,l.useMemo)(()=>w?(0,r.jsx)(p,{onClick:v}):null,[w,v]),k=(0,l.useMemo)(()=>x(y,i,j),[y,i,j]);return(0,r.jsxs)("div",{className:(0,a.cn)("relative",n),children:[(0,r.jsx)(f,{ref:h}),(0,r.jsx)("div",{ref:m,className:"max-w-none  font-body text-sm lg:text-base leading-normal",children:k})]})});var b=g},59052:function(e,t,n){n.d(t,{a:function(){return s}});var r=n(35446);function l(e,t){let n=new Set(e.map(e=>{var t;return e.link||(null===(t=e.metadata)||void 0===t?void 0:t.url)}
1).filter(Boolean));return[...e,...t.filter(e=>{var t;let r=e.link||(null===(t=e.metadata)||void 0===t?void 0:t.url);return r&&!n.has(r)})]}n(35249);var a=(0,n(92298).$)("cba1a6ca0a802a8a30e95cd379a56e59a31f282a");async function s(e){let{messageHandler:t,slug:n,input:s,citationsHandler:i,languageCode:o="en"}=e,{output:c}=await a({query:s||"",focusMode:"webSearch",languageCode:o}),d="",u="",m="",x="",h=!1;for await(let e of(0,r.mj)(c))if(e){d+=e;try{for(let e of d.split("\n")){if(!e.trim())continue;let n=JSON.parse(e);if(n.chatId&&!m&&(m=n.chatId),n.messageId&&!u&&(u=n.messageId,h=!0),u||h||(u=Math.random().toString(36).substring(2,15),h=!0),"chunk"===n.type&&n.message&&(!m&&n.chatId&&(m=n.chatId),x+=n.message,t(u,x,m)),"message"===n.type&&n.data&&(!m&&n.chatId&&(m=n.chatId),x=n.data,t(u,x,m)),"sources"===n.type&&i){let e=n.sources||n.data||[];if(e.length>0){let t=e.map((e,t)=>({cite:t+1,link:e.url,source:e.source,metadata:{title:e.title,url:e.url,img_src:e.img_src||"",published_date:e.published_date,source:e.source}}));i(e=>l(e,t))}}if("citations"===n.type&&n.data&&i){let e=n.data.map((e,t)=>({cite:t+1,link:e.url,source:e.source,metadata:{title:e.title,url:e.url,img_src:e.img_src||"",published_date:e.published_date,source:e.source}}));i(t=>l(t,e))}if("final"===n.type&&n.data&&n.data.sources&&i){let e=n.data.sources.map((e,t)=>({cite:t+1,link:e.url,source:e.source,metadata:{title:e.title,url:e.url,img_src:e.img_src||"",published_date:e.published_date,source:e.source}}));i(t=>l(t,e))}if(n.message){let e=n.messageId||u||(h||(u=Math.random().toString(36).substring(2,15),h=!0),u),r=n.chatId||m||"";t(e,n.message,r)}n.citations&&i&&i(e=>l(e,n.citations))}d=""}catch(e){}}}}}]);

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.