research-agent-ui 0.1.52 → 0.1.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -13,7 +13,7 @@
13
13
  #5a922c calc(50% / var(--repeating-conic-gradient-times)),
14
14
  #4c7894 calc(75% / var(--repeating-conic-gradient-times)),
15
15
  #dd7bbb calc(100% / var(--repeating-conic-gradient-times))
16
- )`},className:E(`pointer-events-none absolute inset-0 rounded-[inherit] opacity-100 transition-opacity`,o&&`opacity-100`,e>0&&`blur-[var(--blur)] `,s,f&&`!hidden`),children:(0,d.jsx)(`div`,{className:E(`glow`,`rounded-[inherit]`,`after:content-[""] after:rounded-[inherit] after:absolute after:inset-[calc(-1*var(--glowingeffect-border-width))]`,`after:[border:var(--glowingeffect-border-width)_solid_transparent]`,`after:[background:var(--gradient)] after:[background-attachment:fixed]`,`after:opacity-[var(--active)] after:transition-opacity after:duration-300`,`after:[mask-clip:padding-box,border-box]`,`after:[mask-composite:intersect]`,`after:[mask-image:linear-gradient(#0000,#0000),conic-gradient(from_calc((var(--start)-var(--spread))*1deg),#00000000_0deg,#fff,#00000000_calc(var(--spread)*2deg))]`)})})]})});O.displayName=`GlowingEffect`;var k=(0,n.createContext)(void 0),A=()=>{let e=(0,n.useContext)(k);if(!e)throw Error(`useExtractPanel must be used within an ExtractPanelProvider`);return e},j=({children:e})=>{let[t,r]=(0,n.useState)(!1),[i,a]=(0,n.useState)(``),[o,s]=(0,n.useState)(``),[c,l]=(0,n.useState)(600);return(0,d.jsx)(k.Provider,{value:{isOpen:t,url:i,searchText:o,panelWidth:c,setIsOpen:r,setUrl:a,setSearchText:s,setPanelWidth:l,openPanel:(e,t=``)=>{console.log(`[ExtractPanelContext] openPanel called with URL:`,e);try{let t=new URL(e);(t.pathname===`/`||t.pathname===``)&&console.error(`[ExtractPanelContext] URL is domain-only, missing article path:`,e)}catch(t){console.error(`[ExtractPanelContext] Invalid URL format:`,e,t)}if(a(e),s(t),r(!0),typeof window<`u`){let t=new URLSearchParams(window.location.search);t.set(`extract`,encodeURIComponent(e));let n=`${window.location.pathname}?${t.toString()}`;window.history.pushState({},``,n)}},closePanel:()=>{if(r(!1),typeof window<`u`){let e=new URLSearchParams(window.location.search);e.delete(`extract`);let t=e.toString()?`${window.location.pathname}?${e.toString()}`:window.location.pathname;window.history.pushState({},``,t)}}},children:e})};function M(e){return(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,viewBox:`0 0 214.6279 198.1416`,...e,children:[(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{fill:`#5CB0FF`,d:`M171.748,142.3193c0-15.4375-12.5625-28-28-28s-28,12.5625-28,28s12.5625,28,28,28 S171.748,157.7568,171.748,142.3193z`}),(0,d.jsx)(`path`,{fill:`#1C71DA`,d:`M95.748,166.3193v-76h42.989c0.0146,0.7878,0.0696,1.5579,0.0696,2.3516c0,2.2109,1.7891,4,4,4 s4-1.7891,4-4c0-0.7937-0.0603-1.5632-0.0745-2.3516h25.0159h5.6484h2.3516c0-46.3164-37.6836-84-84-84h-8v0.4053 c-42.5754,4.0447-76,39.9785-76,83.5947c0,46.3164,37.6836,84,84,84c2.2109,0,4-1.7891,4-4S97.959,166.3193,95.748,166.3193z M87.748,164.9949c-19.9287-6.438-35.0586-36.3945-35.0586-72.324c0-0.7937,0.0549-1.5637,0.0696-2.3516h34.989V164.9949z M53.1655,82.3193C55.75,51.1135,69.7729,26.157,87.748,20.3506v61.9688H53.1655z M95.748,82.3193v-63.293 c21.6829,0,39.6248,27.5808,42.5825,63.293H95.748z M171.3181,82.3193h-24.9685c-2.3884-29.9812-14.96-54.8911-31.9993-65.6013 C144.7681,24.4146,167.9641,50.417,171.3181,82.3193z M77.1458,16.718C60.1064,27.4282,47.5349,52.3381,45.1465,82.3193H20.178 C23.532,50.417,46.728,24.4146,77.1458,16.718z M19.748,90.3193h25.0159c-0.0142,0.7883-0.0745,1.5579-0.0745,2.3516 c0,28.5327,9.217,53.6572,23.1233,68.2603C39.7031,149.769,19.748,122.3567,19.748,90.3193z`}),(0,d.jsx)(`path`,{fill:`#1C71DA`,d:`M191.5137,184.4287l-19.665-19.665c4.9307-6.1609,7.8994-13.9573,7.8994-22.4443 c0-19.8516-16.1484-36-36-36s-36,16.1484-36,36s16.1484,36,36,36c8.4871,0,16.2834-2.9688,22.4443-7.8994l19.665,19.665 L191.5137,184.4287z M115.748,142.3193c0-15.4375,12.5625-28,28-28s28,12.5625,28,28s-12.5625,28-28,28 S115.748,157.7568,115.748,142.3193z`})]}),(0,d.jsx)(`path`,{fill:`#FF5D5D`,d:`M4,22.1416c-1.0234,0-2.0479-0.3906-2.8281-1.1719c-1.5625-1.5615-1.5625-4.0947,0-5.6562L15.3145,1.1719 c1.5625-1.5625,4.0957-1.5625,5.6562,0c1.5625,1.5615,1.5625,4.0947,0,5.6562L6.8281,20.9697 C6.0469,21.751,5.0234,22.1416,4,22.1416z`}),(0,d.jsx)(`path`,{fill:`#FF5D5D`,d:`M18.1426,22.1416c-1.0234,0-2.0469-0.3906-2.8281-1.1719L1.1719,6.8281 c-1.5625-1.5615-1.5625-4.0947,0-5.6562c1.5605-1.5625,4.0938-1.5625,5.6562,0l14.1426,14.1416 c1.5625,1.5615,1.5625,4.0947,0,5.6562C20.1904,21.751,19.166,22.1416,18.1426,22.1416z`}),(0,d.jsx)(`path`,{fill:`#00D40B`,d:`M14,198.1416c-7.7197,0-14-6.2803-14-14s6.2803-14,14-14s14,6.2803,14,14S21.7197,198.1416,14,198.1416z M14,178.1416c-3.3086,0-6,2.6914-6,6s2.6914,6,6,6s6-2.6914,6-6S17.3086,178.1416,14,178.1416z`}),(0,d.jsx)(`path`,{fill:`#FFC504`,d:`M199.3145,56.7695c-1.0605,0-2.0781-0.4219-2.8281-1.1719l-11.3145-11.3145 c-0.75-0.75-1.1719-1.7676-1.1719-2.8281s0.4219-2.0781,1.1719-2.8281l11.3145-11.3135c1.5625-1.5625,4.0938-1.5625,5.6562,0 l11.3135,11.3135c1.5625,1.5615,1.5625,4.0947,0,5.6562l-11.3135,11.3145C201.3926,56.3477,200.375,56.7695,199.3145,56.7695z M193.6572,41.4551l5.6572,5.6572l5.6572-5.6572l-5.6572-5.6572L193.6572,41.4551z`})]})}function N(e){return(0,d.jsxs)(`svg`,{version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,viewBox:`0 0 508 508`,...e,children:[(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M316.1,353.2H191.9c13.2,60.9,37.8,102.2,62.1,102.2C278.3,455.4,302.9,414.1,316.1,353.2z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M78.2,353.2c26.2,46.5,69.8,80.1,120.6,94.5c-15.4-22.5-27.7-54.7-35.7-94.5H78.2z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M429.8,353.2h-84.9c-8,39.8-20.4,72-35.7,94.5C360,433.4,403.6,399.7,429.8,353.2z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M429.3,154.8c-26.3-46.4-69.6-80-120-94.4c15.3,22.4,27.7,54.7,35.6,94.4H429.3z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M163.1,154.8c8-39.7,20.3-71.9,35.7-94.4c-50.4,14.4-93.8,48-120,94.4H163.1z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M479.8,310.9V197.1c0-7.8-6.3-14.1-14.1-14.1H42.3c-7.8,0-14.1,6.3-14.1,14.1v113.8 c0,7.8,6.3,14.1,14.1,14.1h423.3C473.4,325,479.8,318.7,479.8,310.9z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M254,52.6c-24.3,0-48.9,41.3-62.1,102.2h124.2C302.9,93.9,278.3,52.6,254,52.6z`})]}),(0,d.jsx)(`path`,{style:{fill:`#56ACE0`},d:`M254,426.5c-95.3,0-172.9-77.5-172.9-172.9S158.7,80.8,254,80.8s172.9,77.5,172.9,172.9 S349.3,426.5,254,426.5z`}),(0,d.jsx)(`rect`,{x:`56.4`,y:`211.2`,style:{fill:`#FFC10D`},width:`395.1`,height:`85.6`}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{style:{fill:`#194F82`},d:`M465.7,154.8H461C422.8,75.3,342.7,24.4,254,24.4S85.1,75.3,47,154.8h-4.7C19,154.8,0,173.7,0,197.1 v113.8c0,23.3,19,42.3,42.3,42.3h4.2c38,79.5,118.4,130.4,207.5,130.4c89.2,0,169.5-50.9,207.5-130.4h4.2c23.3,0,42.3-19,42.3-42.3 V197.1C508,173.7,489,154.8,465.7,154.8z M429.3,154.8h-84.4c-8-39.7-20.3-71.9-35.6-94.4C359.7,74.7,403,108.4,429.3,154.8z M254,52.6c24.3,0,48.9,41.3,62.1,102.2H191.9C205.1,93.9,229.7,52.6,254,52.6z M198.7,60.4c-15.3,22.4-27.7,54.7-35.7,94.4H78.7 C105,108.4,148.3,74.7,198.7,60.4z M78.2,353.2h84.9c8,39.8,20.4,72,35.7,94.5C148,433.4,104.4,399.7,78.2,353.2z M254,455.4 c-24.3,0-48.9-41.3-62.1-102.2h124.2C302.9,414.1,278.3,455.4,254,455.4z M309.2,447.7c15.4-22.5,27.7-54.7,35.7-94.5h84.9 C403.6,399.7,360,433.4,309.2,447.7z M479.8,310.9c0,7.8-6.3,14.1-14.1,14.1H42.3c-7.8,0-14.1-6.3-14.1-14.1V197.1 c0-7.8,6.3-14.1,14.1-14.1h423.3c7.8,0,14.1,6.3,14.1,14.1v113.8H479.8z`}),(0,d.jsx)(`polygon`,{style:{fill:`#194F82`},points:`146,265.7 109.1,215.3 93.4,215.3 93.4,293.6 110.2,293.6 110.2,244.5 146,293.6 162.7,293.6 162.7,215.3 146,215.3 `}),(0,d.jsx)(`polygon`,{style:{fill:`#194F82`},points:`197.9,261.9 231.6,261.9 231.6,247 197.9,247 197.9,230.9 235.3,230.9 235.3,215.3 181.2,215.3 181.2,293.6 236.5,293.6 236.5,278.1 197.9,278.1 `}),(0,d.jsx)(`polygon`,{style:{fill:`#194F82`},points:`318.9,260.3 305.7,215.3 288.1,215.3 274.8,260.3 260,215.3 241.9,215.3 268.1,293.6 280.5,293.6 296.8,239.2 313.3,293.6 325.7,293.6 351.9,215.3 333.8,215.3 `}),(0,d.jsx)(`path`,{style:{fill:`#194F82`},d:`M392,246.6c-8.2-1.9-16.5-3.8-16.6-10.2c0.5-5.4,3.9-7.5,9-7.6c6.9,0,13.7,2.6,20.2,7.7l8.5-12.8 c-8-6.2-17-10.4-28.1-10.3c-12.5-0.6-27,7.6-26.8,23.2c-1,15.4,10.4,21.4,25.2,24.8c9.2,2,14.5,5.1,13.9,9.8 c0.1,5.2-4.6,7.7-9.9,7.7c-6.9,0-14.3-3.7-22.4-11.1l-10,12.8c9.5,9.2,20.2,13.8,32.1,13.8c15.1,0.7,27.6-8.8,27.5-23.6 C414.8,257.3,406.3,250,392,246.6z`})]})]})}function P(e){return(0,d.jsxs)(`svg`,{version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,viewBox:`0 0 512 512`,...e,children:[(0,d.jsx)(`circle`,{style:{fill:`#8AD5DD`},cx:`256`,cy:`256`,r:`256`}),(0,d.jsx)(`rect`,{id:`SVGCleanerId_0`,x:`115`,y:`68`,style:{fill:`#FFFFFF`},width:`282`,height:`376`}),(0,d.jsx)(`rect`,{id:`SVGCleanerId_1`,x:`146.336`,y:`339.8`,style:{fill:`#2D2D2D`},width:`97.696`,height:`8`}),(0,d.jsx)(`rect`,{id:`SVGCleanerId_2`,x:`146.336`,y:`371.12`,style:{fill:`#E0E0E0`},width:`97.696`,height:`8`}),(0,d.jsx)(`rect`,{id:`SVGCleanerId_3`,x:`146.336`,y:`386.8`,style:{fill:`#E0E0E0`},width:`97.696`,height:`8`}),(0,d.jsx)(`rect`,{id:`SVGCleanerId_4`,x:`146.336`,y:`402.48`,style:{fill:`#E0E0E0`},width:`97.696`,height:`8`}),(0,d.jsx)(`path`,{id:`SVGCleanerId_5`,style:{fill:`#DB2B42`},d:`M355.872,316.384H156.128c-6.464,0-11.752-5.288-11.752-11.752v-144.92 c0-6.464,5.288-11.752,11.752-11.752H355.88c6.464,0,11.752,5.288,11.752,11.752v144.92 C367.624,311.096,362.336,316.384,355.872,316.384z`}),(0,d.jsx)(`g`,{children:(0,d.jsx)(`rect`,{id:`SVGCleanerId_0_1_`,x:`115`,y:`68`,style:{fill:`#FFFFFF`},width:`282`,height:`376`})}),(0,d.jsx)(`g`,{children:(0,d.jsx)(`rect`,{id:`SVGCleanerId_1_1_`,x:`146.336`,y:`339.8`,style:{fill:`#2D2D2D`},width:`97.696`,height:`8`})}),(0,d.jsx)(`g`,{children:(0,d.jsx)(`rect`,{id:`SVGCleanerId_2_1_`,x:`146.336`,y:`371.12`,style:{fill:`#E0E0E0`},width:`97.696`,height:`8`})}),(0,d.jsx)(`g`,{children:(0,d.jsx)(`rect`,{id:`SVGCleanerId_3_1_`,x:`146.336`,y:`386.8`,style:{fill:`#E0E0E0`},width:`97.696`,height:`8`})}),(0,d.jsx)(`g`,{children:(0,d.jsx)(`rect`,{id:`SVGCleanerId_4_1_`,x:`146.336`,y:`402.48`,style:{fill:`#E0E0E0`},width:`97.696`,height:`8`})}),(0,d.jsx)(`g`,{children:(0,d.jsx)(`path`,{id:`SVGCleanerId_5_1_`,style:{fill:`#DB2B42`},d:`M355.872,316.384H156.128c-6.464,0-11.752-5.288-11.752-11.752v-144.92 c0-6.464,5.288-11.752,11.752-11.752H355.88c6.464,0,11.752,5.288,11.752,11.752v144.92 C367.624,311.096,362.336,316.384,355.872,316.384z`})}),(0,d.jsx)(`polygon`,{style:{fill:`#FFFFFF`},points:`232.496,191.472 303,232.176 232.496,272.88 `}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`rect`,{x:`269.928`,y:`339.04`,style:{fill:`#E0E0E0`},width:`97.696`,height:`19.016`}),(0,d.jsx)(`rect`,{x:`269.928`,y:`365.624`,style:{fill:`#E0E0E0`},width:`97.696`,height:`19.016`}),(0,d.jsx)(`rect`,{x:`269.928`,y:`392.24`,style:{fill:`#E0E0E0`},width:`97.696`,height:`19.016`})]}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`rect`,{x:`269.928`,y:`392.24`,style:{fill:`#2D2D2D`},width:`20.304`,height:`19.016`}),(0,d.jsx)(`rect`,{x:`269.928`,y:`365.624`,style:{fill:`#2D2D2D`},width:`20.304`,height:`19.016`}),(0,d.jsx)(`rect`,{x:`269.928`,y:`339.04`,style:{fill:`#2D2D2D`},width:`20.304`,height:`19.016`})]}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{style:{fill:`#E0E0E0`},d:`M365.664,100.072v19.616h-135.24v-19.616H365.664 M367.624,98.112h-139.16v23.536h139.16 L367.624,98.112L367.624,98.112z`}),(0,d.jsx)(`rect`,{x:`341.312`,y:`98.112`,style:{fill:`#E0E0E0`},width:`26.312`,height:`23.536`})]}),(0,d.jsx)(`path`,{style:{fill:`#DB2B42`},d:`M207.656,121.648H173.2c-1.312,0-2.384-1.072-2.384-2.384v-18.768c0-1.312,1.072-2.384,2.384-2.384 h34.456c1.312,0,2.384,1.072,2.384,2.384v18.768C210.04,120.576,208.96,121.648,207.656,121.648z`}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M178.008,107.264h-2.784v-1.488h7.384v1.488h-2.816v8.28h-1.784L178.008,107.264L178.008,107.264z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M189.28,113.424c0,0.84,0.032,1.544,0.056,2.12h-1.568l-0.088-1.08h-0.024 c-0.304,0.504-1,1.232-2.264,1.232c-1.288,0-2.464-0.768-2.464-3.072v-4.144h1.784v3.84c0,1.176,0.384,1.936,1.32,1.936 c0.712,0,1.176-0.504,1.36-0.96c0.064-0.16,0.104-0.344,0.104-0.552v-4.264h1.784V113.424z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M191.144,115.544c0.032-0.48,0.064-1.264,0.064-1.984v-8.312h1.784v4.2h0.032 c0.432-0.672,1.2-1.128,2.256-1.128c1.728,0,2.96,1.432,2.944,3.584c0,2.536-1.608,3.8-3.208,3.8c-0.912,0-1.728-0.352-2.232-1.216 h-0.032l-0.088,1.056H191.144z M192.992,112.632c0,0.152,0.016,0.288,0.04,0.424c0.192,0.712,0.808,1.256,1.584,1.256 c1.12,0,1.8-0.904,1.8-2.32c0-1.256-0.592-2.264-1.784-2.264c-0.72,0-1.376,0.528-1.584,1.304 c-0.024,0.128-0.056,0.288-0.056,0.464V112.632z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M200.952,112.512c0.04,1.28,1.04,1.832,2.176,1.832c0.824,0,1.416-0.12,1.96-0.32l0.264,1.232 c-0.616,0.248-1.456,0.44-2.472,0.44c-2.288,0-3.64-1.408-3.64-3.576c0-1.952,1.192-3.8,3.448-3.8c2.296,0,3.048,1.888,3.048,3.44 c0,0.336-0.032,0.592-0.056,0.752C205.68,112.512,200.952,112.512,200.952,112.512z M204.056,111.264 c0.016-0.648-0.272-1.728-1.464-1.728c-1.104,0-1.568,1.008-1.64,1.728H204.056z`})]}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M147.464,115.544v-4.072l-3.088-5.696h2.032l1.176,2.504c0.336,0.728,0.584,1.28,0.848,1.944h0.024 c0.248-0.624,0.52-1.232,0.856-1.944l1.176-2.504h2.016l-3.248,5.656v4.112H147.464z`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M158.864,111.944c0,2.6-1.824,3.76-3.624,3.76c-2,0-3.536-1.376-3.536-3.632 c0-2.328,1.52-3.744,3.656-3.744C157.464,108.32,158.864,109.8,158.864,111.944z M153.544,112.024c0,1.36,0.664,2.392,1.752,2.392 c1.016,0,1.728-1,1.728-2.424c0-1.104-0.496-2.368-1.712-2.368C154.056,109.624,153.544,110.84,153.544,112.024z`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M166.656,113.424c0,0.84,0.032,1.544,0.056,2.12h-1.568l-0.088-1.08h-0.024 c-0.304,0.504-1,1.232-2.264,1.232c-1.288,0-2.464-0.768-2.464-3.072v-4.144h1.784v3.84c0,1.176,0.384,1.936,1.32,1.936 c0.712,0,1.176-0.504,1.36-0.96c0.064-0.16,0.104-0.344,0.104-0.552v-4.264h1.784V113.424z`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M353.936,113.776c-3.096,0-5.616-2.52-5.616-5.616s2.52-5.616,5.616-5.616s5.616,2.52,5.616,5.616 C359.552,111.256,357.032,113.776,353.936,113.776z M353.936,103.816c-2.392,0-4.344,1.952-4.344,4.344s1.952,4.344,4.344,4.344 s4.344-1.952,4.344-4.344S356.328,103.816,353.936,103.816z`}),(0,d.jsx)(`rect`,{x:`356.02`,y:`113.813`,transform:`matrix(-0.6044 -0.7967 0.7967 -0.6044 484.7665 469.5985)`,style:{fill:`#2D2D2D`},width:`5.896`,height:`1.272`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M240.088,113.168c0.48,0.296,1.184,0.544,1.92,0.544c1.096,0,1.736-0.576,1.736-1.416 c0-0.768-0.44-1.216-1.56-1.648c-1.352-0.48-2.192-1.184-2.192-2.352c0-1.296,1.072-2.248,2.68-2.248 c0.848,0,1.464,0.192,1.832,0.4l-0.296,0.872c-0.272-0.152-0.824-0.392-1.576-0.392c-1.136,0-1.56,0.672-1.56,1.24 c0,0.776,0.504,1.152,1.648,1.6c1.4,0.544,2.12,1.216,2.12,2.432c0,1.28-0.952,2.392-2.904,2.392c-0.8,0-1.68-0.24-2.12-0.528 L240.088,113.168z`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M246.984,111.688c0.024,1.472,0.96,2.064,2.048,2.064c0.776,0,1.24-0.128,1.648-0.304l0.184,0.776 c-0.384,0.176-1.032,0.368-1.984,0.368c-1.832,0-2.928-1.208-2.928-3s1.056-3.216,2.792-3.216c1.952,0,2.464,1.704,2.464,2.808 c0,0.216-0.024,0.392-0.04,0.496h-4.184V111.688z M250.16,110.92c0.016-0.688-0.288-1.76-1.504-1.76 c-1.096,0-1.576,1.008-1.664,1.76H250.16z`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M255.88,114.472l-0.088-0.752h-0.032c-0.336,0.472-0.968,0.888-1.824,0.888 c-1.208,0-1.824-0.848-1.824-1.704c0-1.448,1.28-2.232,3.584-2.216v-0.128c0-0.488-0.136-1.384-1.36-1.384 c-0.552,0-1.128,0.176-1.552,0.448l-0.248-0.72c0.488-0.312,1.208-0.528,1.96-0.528c1.824,0,2.264,1.24,2.264,2.432v2.232 c0,0.52,0.024,1.024,0.104,1.424h-0.984V114.472z M255.72,111.44c-1.184-0.024-2.528,0.184-2.528,1.336 c0,0.704,0.472,1.032,1.024,1.032c0.776,0,1.272-0.488,1.44-1c0.04-0.112,0.064-0.24,0.064-0.344V111.44z`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M258.552,110.376c0-0.704-0.016-1.304-0.056-1.864h0.944l0.04,1.176h0.04 c0.272-0.8,0.928-1.304,1.656-1.304c0.12,0,0.2,0.008,0.304,0.032v1.024c-0.112-0.024-0.224-0.032-0.368-0.032 c-0.768,0-1.312,0.576-1.456,1.392c-0.024,0.144-0.056,0.312-0.056,0.496v3.176h-1.072v-4.096H258.552z`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M266.72,114.256c-0.288,0.152-0.912,0.344-1.72,0.344c-1.792,0-2.968-1.216-2.968-3.04 c0-1.84,1.264-3.168,3.208-3.168c0.64,0,1.208,0.168,1.504,0.304l-0.248,0.84c-0.264-0.152-0.664-0.28-1.264-0.28 c-1.368,0-2.104,1.008-2.104,2.248c0,1.384,0.888,2.232,2.064,2.232c0.616,0,1.024-0.168,1.328-0.296L266.72,114.256z`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M268.016,105.736h1.08v3.712h0.024c0.176-0.304,0.448-0.576,0.776-0.76 c0.312-0.184,0.704-0.304,1.104-0.304c0.808,0,2.08,0.488,2.08,2.544v3.544H272v-3.424c0-0.96-0.352-1.768-1.376-1.768 c-0.704,0-1.264,0.488-1.456,1.08c-0.064,0.152-0.08,0.304-0.08,0.52v3.6h-1.08v-8.744H268.016z`})]})]})}function F(e){return(0,d.jsx)(`svg`,{width:`800px`,height:`800px`,viewBox:`0 0 73 73`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,...e,children:(0,d.jsx)(`g`,{id:`fundamentals/css/images`,stroke:`none`,strokeWidth:`1`,fill:`none`,fillRule:`evenodd`,children:(0,d.jsxs)(`g`,{id:`container`,transform:`translate(2.000000, 2.000000)`,fillRule:`nonzero`,children:[(0,d.jsx)(`rect`,{id:`mask`,stroke:`#000000`,strokeWidth:`2`,fill:`#424A60`,x:`-1`,y:`-1`,width:`71`,height:`71`,rx:`14`}),(0,d.jsx)(`circle`,{id:`Oval`,fill:`#EFCE4A`,cx:`21.069`,cy:`23.069`,r:`9.069`}),(0,d.jsx)(`polygon`,{id:`Shape`,fill:`#1A9172`,points:`69.5 56.7492553 68.1170213 55.212766 51.5212766 40 37 55.9042553 44.5828723 63.4871277 50.1382979 69.0425532 60.7455406 69.0425532 69.5 60.1780353`}),(0,d.jsx)(`polygon`,{id:`Shape`,fill:`#25AE88`,points:`47.8532188 64.0501875 33.8030313 50 12 69.1969687 53 69.1969687`}),(0,d.jsx)(`rect`,{id:`mask`,stroke:`#000000`,strokeWidth:`2`,x:`-1`,y:`-1`,width:`71`,height:`71`,rx:`14`})]})})})}function I(e){return(0,d.jsxs)(`svg`,{width:`800px`,height:`800px`,viewBox:`0 0 32 32`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,d.jsx)(`path`,{d:`M23.3 8.40007L21.82 6.40008C21.7248 6.27314 21.6008 6.17066 21.4583 6.10111C21.3157 6.03156 21.1586 5.99693 21 6.00008H11.2C11.0555 6.00007 10.9128 6.03135 10.7816 6.09177C10.6504 6.15219 10.5339 6.24031 10.44 6.35007L8.71998 8.35008C8.57227 8.53401 8.49435 8.76424 8.49998 9.00008V16.2901C8.50262 18.0317 9.19567 19.7013 10.4272 20.9328C11.6588 22.1644 13.3283 22.8574 15.07 22.8601H16.93C18.6716 22.8574 20.3412 22.1644 21.5728 20.9328C22.8043 19.7013 23.4973 18.0317 23.5 16.2901V9.00008C23.5 8.7837 23.4298 8.57317 23.3 8.40007Z`,fill:`#FFCC80`}),(0,d.jsx)(`path`,{d:`M29.78 28.38L25.78 23.38C25.664 23.2321 25.5086 23.1198 25.3318 23.0562C25.1549 22.9925 24.9637 22.98 24.78 23.02L16 25L7.21999 23C7.03632 22.96 6.84507 22.9725 6.6682 23.0362C6.49133 23.0998 6.33598 23.2121 6.21999 23.36L2.21999 28.36C2.10392 28.5064 2.03116 28.6823 2.00995 28.8679C1.98874 29.0534 2.01993 29.2413 2.09999 29.41C2.17815 29.5839 2.3044 29.7319 2.46385 29.8364C2.62331 29.9409 2.80933 29.9977 2.99999 30H29C29.1885 29.9995 29.373 29.9457 29.5322 29.8448C29.6914 29.744 29.8189 29.6002 29.9 29.43C29.98 29.2613 30.0112 29.0734 29.99 28.8879C29.9688 28.7023 29.8961 28.5264 29.78 28.38Z`,fill:`#01579B`}),(0,d.jsx)(`path`,{d:`M29.29 6.00003L16.29 2.00003C16.0999 1.95002 15.9001 1.95002 15.71 2.00003L2.71 6.00003C2.49742 6.06422 2.31226 6.19735 2.1837 6.37841C2.05515 6.55947 1.99052 6.77817 2 7.00003C1.9917 7.22447 2.0592 7.44518 2.19163 7.62659C2.32405 7.80799 2.5137 7.93954 2.73 8.00003L15.73 11.6C15.906 11.6534 16.094 11.6534 16.27 11.6L29.27 8.00003C29.4863 7.93954 29.6759 7.80799 29.8084 7.62659C29.9408 7.44518 30.0083 7.22447 30 7.00003C30.0095 6.77817 29.9448 6.55947 29.8163 6.37841C29.6877 6.19735 29.5026 6.06422 29.29 6.00003Z`,fill:`#01579B`}),(0,d.jsx)(`path`,{d:`M11.22 6C11.0756 5.99999 10.9328 6.03127 10.8016 6.09169C10.6704 6.15211 10.5539 6.24023 10.46 6.35L8.74 8.35C8.58509 8.53114 8.49998 8.76166 8.5 9V16.29C8.50264 18.0317 9.19569 19.7012 10.4272 20.9328C11.6588 22.1643 13.3283 22.8574 15.07 22.86H16V6H11.22Z`,fill:`#FFE0B2`}),(0,d.jsx)(`path`,{d:`M7.21999 23C7.03632 22.96 6.84507 22.9725 6.6682 23.0362C6.49133 23.0998 6.33598 23.2121 6.21999 23.36L2.21999 28.36C2.10392 28.5064 2.03116 28.6823 2.00995 28.8679C1.98874 29.0534 2.01993 29.2413 2.09999 29.41C2.17815 29.5839 2.3044 29.7319 2.46385 29.8364C2.62331 29.9409 2.80933 29.9977 2.99999 30H16V25L7.21999 23Z`,fill:`#0277BD`}),(0,d.jsx)(`path`,{d:`M15.71 2.00002L2.71 6.00002C2.49742 6.06422 2.31226 6.19734 2.1837 6.3784C2.05515 6.55947 1.99052 6.77817 2 7.00002C1.9917 7.22447 2.0592 7.44518 2.19163 7.62658C2.32405 7.80799 2.5137 7.93954 2.73 8.00002L15.73 11.6C15.8194 11.6146 15.9106 11.6146 16 11.6V2.00002C15.9039 1.98469 15.8061 1.98469 15.71 2.00002Z`,fill:`#0277BD`}),(0,d.jsx)(`path`,{d:`M2.73 8.00003L8.5 9.56003V16.29C8.50264 18.0317 9.19569 19.7013 10.4272 20.9328C11.6588 22.1643 13.3283 22.8574 15.07 22.86H16.93C18.6717 22.8574 20.3412 22.1643 21.5728 20.9328C22.8043 19.7013 23.4974 18.0317 23.5 16.29V9.56003L29.27 8.00003C29.4863 7.93954 29.6759 7.80799 29.8084 7.62659C29.9408 7.44518 30.0083 7.22447 30 7.00003C30.0095 6.77817 29.9448 6.55947 29.8163 6.37841C29.6877 6.19735 29.5026 6.06422 29.29 6.00003L16.29 2.00003C16.0999 1.95002 15.9001 1.95002 15.71 2.00003L2.71 6.00003C2.49742 6.06422 2.31226 6.19735 2.1837 6.37841C2.05515 6.55947 1.99052 6.77817 2 7.00003C1.9917 7.22447 2.0592 7.44518 2.19163 7.62659C2.32405 7.80799 2.5137 7.93954 2.73 8.00003ZM21.5 16.29C21.4974 17.5013 21.015 18.6621 20.1586 19.5186C19.3021 20.3751 18.1412 20.8574 16.93 20.86H15.07C13.8588 20.8574 12.6979 20.3751 11.8414 19.5186C10.985 18.6621 10.5026 17.5013 10.5 16.29V10.11L15.73 11.56C15.906 11.6134 16.094 11.6134 16.27 11.56L21.5 10.11V16.29ZM16 4.05003L25.44 7.00003L16 9.56003L6.56 7.00003L16 4.05003Z`,fill:`#263238`}),(0,d.jsx)(`path`,{d:`M25.78 23.38C25.664 23.2321 25.5086 23.1198 25.3318 23.0562C25.1549 22.9925 24.9637 22.98 24.78 23.02L16 25L7.21999 23C7.03632 22.96 6.84507 22.9725 6.6682 23.0362C6.49133 23.0998 6.33598 23.2121 6.21999 23.36L2.21999 28.36C2.10392 28.5064 2.03116 28.6823 2.00995 28.8679C1.98874 29.0534 2.01993 29.2413 2.09999 29.41C2.17815 29.5839 2.3044 29.7319 2.46385 29.8364C2.62331 29.9409 2.80933 29.9977 2.99999 30H29C29.1885 29.9995 29.373 29.9457 29.5322 29.8448C29.6914 29.744 29.8189 29.6002 29.9 29.43C29.98 29.2613 30.0112 29.0734 29.99 28.8879C29.9688 28.7023 29.8961 28.5264 29.78 28.38L25.78 23.38ZM5.07999 28L7.38999 25.11L15.78 27C15.9251 27.0299 16.0748 27.0299 16.22 27L24.61 25.13L26.92 28H5.07999Z`,fill:`#263238`})]})}function L(e){return(0,d.jsxs)(`svg`,{height:`800px`,width:`800px`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,viewBox:`0 0 503.322 503.322`,...e,children:[(0,d.jsx)(`path`,{style:{fill:`#FBC176`},d:`M0,73.763v130.169c0,6.942,6.075,13.017,13.017,13.017h225.627c6.942,0,13.017-6.075,13.017-13.017 V73.763c0-6.942-6.075-13.017-13.017-13.017H13.017C6.075,60.746,0,66.82,0,73.763`}),(0,d.jsx)(`path`,{style:{fill:`#C39A6E`},d:`M225.627,60.746V39.051c0-6.942-6.075-13.017-13.017-13.017h-69.424L121.492,0H30.373 c-6.942,0-13.017,6.075-13.017,13.017v47.729H225.627z`}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M86.78,104.136H34.712c-5.207,0-8.678-3.471-8.678-8.678c0-5.207,3.471-8.678,8.678-8.678H86.78 c5.207,0,8.678,3.471,8.678,8.678C95.458,100.664,91.986,104.136,86.78,104.136`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M86.78,138.847H34.712c-5.207,0-8.678-3.471-8.678-8.678s3.471-8.678,8.678-8.678H86.78 c5.207,0,8.678,3.471,8.678,8.678S91.986,138.847,86.78,138.847`})]}),(0,d.jsx)(`path`,{style:{fill:`#FBC176`},d:`M251.661,360.136v130.169c0,6.942,6.075,13.017,13.017,13.017h225.627 c6.942,0,13.017-6.075,13.017-13.017V360.136c0-6.942-6.075-13.017-13.017-13.017H264.678 C257.736,347.119,251.661,353.193,251.661,360.136`}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M338.441,390.508h-52.068c-5.207,0-8.678-3.471-8.678-8.678s3.471-8.678,8.678-8.678h52.068 c5.207,0,8.678,3.471,8.678,8.678S343.647,390.508,338.441,390.508`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M338.441,425.22h-52.068c-5.207,0-8.678-3.471-8.678-8.678c0-5.207,3.471-8.678,8.678-8.678h52.068 c5.207,0,8.678,3.471,8.678,8.678C347.119,421.749,343.647,425.22,338.441,425.22`})]}),(0,d.jsx)(`path`,{style:{fill:`#F38774`},d:`M208.271,451.254H78.102c-5.207,0-8.678-3.471-8.678-8.678V260.339c0-5.207,3.471-8.678,8.678-8.678 c5.207,0,8.678,3.471,8.678,8.678v173.559h121.492c5.207,0,8.678,3.471,8.678,8.678 C216.949,447.783,213.478,451.254,208.271,451.254`}),(0,d.jsx)(`path`,{style:{fill:`#26B999`},d:`M433.898,277.695c-5.207,0-8.678-3.471-8.678-8.678V95.458H295.051c-5.207,0-8.678-3.471-8.678-8.678 c0-5.207,3.471-8.678,8.678-8.678h138.847c5.207,0,8.678,3.471,8.678,8.678v182.237 C442.576,274.224,439.105,277.695,433.898,277.695`}),(0,d.jsx)(`path`,{style:{fill:`#C39A6E`},d:`M477.288,347.119v-21.695c0-6.942-6.075-13.017-13.017-13.017h-69.424l-21.695-26.034h-91.119 c-6.942,0-13.017,6.075-13.017,13.017v47.729H477.288z`})]})}function R(e){return(0,d.jsxs)(`svg`,{height:`800px`,width:`800px`,viewBox:`0 0 128 128`,xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,className:`iconify iconify--noto`,preserveAspectRatio:`xMidYMid meet`,...e,children:[(0,d.jsx)(`path`,{d:`M106 24.79H22.15c-1.92 0-3.48 1.56-3.48 3.48v57.59c0 1.92 1.56 3.48 3.48 3.48H106c1.92 0 3.48-1.56 3.48-3.48V28.27c0-1.92-1.55-3.48-3.48-3.48z`,fill:`#b7d5e5`}),(0,d.jsxs)(`radialGradient`,{id:`IconifyId17ecdb2904d178eab9910`,cx:`48.408`,cy:`13.024`,r:`75.465`,gradientTransform:`matrix(1 0 0 1.0843 0 -10.19)`,gradientUnits:`userSpaceOnUse`,children:[(0,d.jsx)(`stop`,{offset:`0`,stopColor:`#2f7889`}),(0,d.jsx)(`stop`,{offset:`1`,stopColor:`#424242`})]}),(0,d.jsx)(`path`,{fill:`url(#IconifyId17ecdb2904d178eab9910)`,d:`M104.75 83.2H23.4l.96-52.27h79.43z`}),(0,d.jsx)(`path`,{d:`M121.09 123.82H7.59c-.43 0-.83-.03-1.2-.09c-2.88-.44-4.21-4.18-2.5-6.74l.39-.59h119.59l.4.6c1.86 2.78.12 6.76-3.04 6.81c-.04.01-.09.01-.14.01z`,fill:`#2f7889`}),(0,d.jsx)(`path`,{d:`M106.84 90.41H20.6c-1.27 0-2.54.77-3.25 1.99l-14 25.48c-.59.88-.01 2.12.99 2.12H123.8c1 0 1.58-1.24.99-2.12l-14.71-25.63c-.7-1.08-1.97-1.84-3.24-1.84z`,fill:`#eee`}),(0,d.jsx)(`path`,{fill:`#b7d5e5`,d:`M86.36 115.52H41.8l2.85-7.98h39.07z`}),(0,d.jsxs)(`g`,{opacity:`0.57`,fill:`#69a1ba`,children:[(0,d.jsx)(`path`,{d:`M72.69 94.84l-.27-2.2h-3.44l.13 2.2z`}),(0,d.jsx)(`path`,{d:`M67.14 94.84l-.14-2.2h-3.45v2.2z`}),(0,d.jsx)(`path`,{d:`M93.61 94.84l-.81-2.2h-3.26l.68 2.2z`}),(0,d.jsx)(`path`,{d:`M88.36 94.84l-.68-2.2h-3.32l.54 2.2z`}),(0,d.jsx)(`path`,{d:`M83.18 94.84l-.54-2.2h-3.37l.41 2.2z`}),(0,d.jsx)(`path`,{d:`M102.11 94.84l-.95-2.2h-6.71l.82 2.2z`}),(0,d.jsx)(`path`,{d:`M77.61 94.84l-.41-2.2h-3.41l.28 2.2z`}),(0,d.jsx)(`path`,{d:`M33.76 94.84l.68-2.2h-3.26l-.81 2.2z`}),(0,d.jsx)(`path`,{d:`M50.51 94.84l.27-2.2h-3.41l-.4 2.2z`}),(0,d.jsx)(`path`,{d:`M39.35 94.84l.54-2.2h-3.32l-.67 2.2z`}),(0,d.jsx)(`path`,{d:`M28.17 94.84l.81-2.2H25.8l-.95 2.2z`}),(0,d.jsx)(`path`,{d:`M44.93 94.84l.41-2.2h-3.37l-.54 2.2z`}),(0,d.jsx)(`path`,{d:`M56.08 94.84l.14-2.2h-3.44l-.27 2.2z`}),(0,d.jsx)(`path`,{d:`M61.65 94.84v-2.2H58.2l-.14 2.2z`}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{d:`M83.78 103.73H44.36l-.75 2.2h41.08z`}),(0,d.jsx)(`path`,{d:`M102.15 105.93l-1.21-2.2h6.54l.95 2.2z`}),(0,d.jsx)(`path`,{d:`M86.75 105.93l-.83-2.2h6.29l.96 2.2z`}),(0,d.jsx)(`path`,{d:`M95.39 105.93l-.96-2.2h4.31l1.1 2.2z`}),(0,d.jsx)(`path`,{d:`M25.67 105.93l1.21-2.2h-6.54l-.95 2.2z`}),(0,d.jsx)(`path`,{d:`M41.07 105.93l.83-2.2h-6.29l-.96 2.2z`}),(0,d.jsx)(`path`,{d:`M32.42 105.93l.97-2.2h-4.31l-1.11 2.2z`})]}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{d:`M29.71 98.51l.82-2.19h-6.67l-.95 2.19z`}),(0,d.jsx)(`path`,{d:`M97.95 98.51l-.81-2.19h6.66l.95 2.19z`}),(0,d.jsx)(`path`,{d:`M96.25 98.51l-.96-2.19h-3.85l.82 2.19z`}),(0,d.jsx)(`path`,{d:`M86.23 98.51l-.65-2.19h3.85l.78 2.19z`}),(0,d.jsx)(`path`,{d:`M80.19 98.51l-.47-2.19h3.85l.6 2.19z`}),(0,d.jsx)(`path`,{d:`M74.15 98.51l-.28-2.19h3.84l.43 2.19z`}),(0,d.jsx)(`path`,{d:`M68.12 98.51l-.11-2.19h3.85l.24 2.19z`}),(0,d.jsx)(`path`,{d:`M62.08 98.51l.07-2.19H66l.06 2.19z`}),(0,d.jsx)(`path`,{d:`M56.04 98.51l.25-2.19h3.85l-.11 2.19z`}),(0,d.jsx)(`path`,{d:`M50.01 98.51l.42-2.19h3.85l-.29 2.19z`}),(0,d.jsx)(`path`,{d:`M43.97 98.51l.6-2.19h3.85l-.47 2.19z`}),(0,d.jsx)(`path`,{d:`M37.93 98.51l.78-2.19h3.85l-.64 2.19z`}),(0,d.jsx)(`path`,{d:`M31.9 98.51l.95-2.19h3.85l-.82 2.19z`})]}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{d:`M29.7 102.22l.81-2.2h-8.75l-.95 2.2z`}),(0,d.jsx)(`path`,{d:`M95.87 102.22l-.77-2.2h-4.17l.64 2.2z`}),(0,d.jsx)(`path`,{d:`M84.93 102.22l-.48-2.2h4.16l.62 2.2z`}),(0,d.jsx)(`path`,{d:`M78.28 102.22l-.32-2.2h4.17l.45 2.2z`}),(0,d.jsx)(`path`,{d:`M71.64 102.22l-.17-2.2h4.17l.3 2.2z`}),(0,d.jsx)(`path`,{d:`M65 102.22l-.01-2.2h4.16l.15 2.2z`}),(0,d.jsx)(`path`,{d:`M58.36 102.22l.14-2.2h4.17l-.01 2.2z`}),(0,d.jsx)(`path`,{d:`M51.71 102.22l.3-2.2h4.17l-.17 2.2z`}),(0,d.jsx)(`path`,{d:`M45.07 102.22l.46-2.2h4.16l-.32 2.2z`}),(0,d.jsx)(`path`,{d:`M38.43 102.22l.61-2.2h4.17l-.48 2.2z`}),(0,d.jsx)(`path`,{d:`M31.78 102.22l.77-2.2h4.17l-.63 2.2z`}),(0,d.jsx)(`path`,{d:`M97.47 102.22l-.82-2.2h8.75l.95 2.2z`})]})]}),(0,d.jsx)(`path`,{d:`M124.73 117.88L110.39 92.4c-.71-1.07-1.98-1.84-3.25-1.84c0 0 1.22 1.1 1.59 1.63l12.59 23.59c.56 1.02-.18 2.26-1.34 2.26H7.96c-1.15 0-1.89-1.23-1.35-2.24l11.95-23.18c.35-.6 1.88-1.99 1.88-1.99h-.45c-1.27 0-2.54.77-3.25 1.99L3.28 117.88c-.59.88-.01 2.12.99 2.12h119.46c1.01 0 1.59-1.24 1-2.12z`,fill:`#b7d5e5`}),(0,d.jsx)(`path`,{fill:`none`,stroke:`#eee`,strokeWidth:`2.936`,strokeLinecap:`round`,strokeMiterlimit:`10`,d:`M25.97 28.02h13.21`}),(0,d.jsx)(`path`,{d:`M109.37 30.11c0-1.04-1.01-1.12-1.01.11v55.8c0 1.34-1.09 2.43-2.43 2.43H22.08c-1.34 0-2.43-1.09-2.43-2.43v-55.8c0-1.23-1.01-1.15-1.01-.11l-.95 55.91c0 2.42 1.24 4.39 4.39 4.39h83.85c2.73 0 4.39-1.97 4.39-4.39l-.95-55.91z`,fill:`#75a7bc`})]})}var z=[{code:`general`,icon:M,name:`Web`},{code:`news`,icon:N,name:`News`},{code:`videos`,icon:P,name:`Videos`},{code:`images`,icon:F,name:`Images`},{code:`science`,icon:I,name:`Academic`},{code:`files`,icon:L,name:`Files`},{code:`it`,icon:R,name:`Tech`}],ee=z.filter(e=>[`general`,`news`,`videos`,`images`,`science`,`files`].includes(e.code)),te=({sources:e,query:t})=>{let[r,i]=(0,n.useState)(`general`),[a,o]=(0,n.useState)(e),[u,f]=(0,n.useState)(!1),[p,m]=(0,n.useState)(!1),[h,g]=(0,n.useState)(1),[_,v]=(0,n.useState)(!0),[y,b]=(0,n.useState)(!1),x=(0,n.useRef)(null),S=(0,n.useRef)(!1),C=(0,n.useRef)(!1),{openPanel:w,isOpen:T}=A(),[D,k]=(0,n.useState)({});(0,n.useEffect)(()=>{let e=()=>{b(window.innerWidth>=1024)};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,n.useEffect)(()=>{o(e),i(`general`),g(1),v(!0),k({}),j(e)},[e]);let j=(0,n.useCallback)(async e=>{let t=e.filter(e=>e.metadata.url&&e.metadata.url!==`File`&&!e.metadata.iframe_src);for(let e of t)try{let{data:t}=await(0,c.getArticle)({query:{url:e.metadata.url}});t?.cached&&t?.article?.html&&k(t=>({...t,[e.metadata.url]:`loaded`}))}catch{}},[]);(0,n.useEffect)(()=>{if(typeof window<`u`){let e=new URLSearchParams(window.location.search).get(`extract`);e&&(w(decodeURIComponent(e),``),C.current=!1)}},[w]),(0,n.useEffect)(()=>{C.current=!1},[e]),(0,n.useEffect)(()=>{S.current&&!T&&(C.current=!0),S.current=T},[T]),(0,n.useEffect)(()=>{if(y&&a&&a.length>0&&!T&&!C.current){let e=a[0];e?.metadata?.url&&w(e.metadata.url,``)}},[a,y]);let M=async(e,t)=>{e.preventDefault(),C.current=!1,k(e=>({...e,[t]:`loading`})),w(t,``);try{await(0,c.getArticle)({query:{url:t}}),k(e=>({...e,[t]:`loaded`}))}catch{k(e=>({...e,[t]:`loaded`}))}},N=(0,n.useCallback)(async()=>{if(!t||p||!_)return;m(!0);let e=h+1,{data:n}=await(0,c.agentSearch)({query:{q:t,cat:r,page:e}}),i=n?.results??[];if(i.length===0){v(!1),m(!1);return}let a=i.map(e=>{if(e.url)try{let t=new URL(e.url);(t.pathname===`/`||t.pathname===``)&&console.warn(`[MessageSources] Search result URL is domain-only:`,e.url,`Title:`,e.title)}catch{console.error(`[MessageSources] Invalid URL in search result:`,e.url)}return{pageContent:e.snippet||e.content||``,metadata:{title:e.title||``,source:e.source||``,thumbnail:e.thumbnail||``,url:e.url||``,...e.thumbnail&&{thumbnail:e.thumbnail}}}});o(e=>[...e,...a]),g(e),m(!1)},[t,r,h,p,_]),P=async e=>{if(!(e===r||!t)){i(e),f(!0),g(1),v(!0);try{let{data:n}=await(0,c.agentSearch)({query:{q:t,cat:e,page:1}}),r=(n?.results??[]).map(e=>{if(e.url)try{let t=new URL(e.url);(t.pathname===`/`||t.pathname===``)&&console.warn(`[MessageSources] Category search result URL is domain-only:`,e.url,`Title:`,e.title)}catch{console.error(`[MessageSources] Invalid URL in category search result:`,e.url)}return{pageContent:e.snippet||e.content||``,metadata:{title:e.title||``,source:e.source||``,thumbnail:e.thumbnail||``,url:e.url||``,...e.img_src&&{img_src:e.img_src},...e.thumbnail&&{thumbnail:e.thumbnail},...e.iframe_src&&{iframe_src:e.iframe_src}}}});o(r)}catch(e){console.error(`Error searching:`,e)}finally{f(!1)}}};(0,n.useEffect)(()=>{let e=x.current;if(!e)return;let t=()=>{let{scrollTop:t,scrollHeight:n,clientHeight:r}=e;n-t-r<100&&N()};return e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)},[N]);let F=(e,t)=>{let n=r===`images`,i=r===`videos`,a=e.metadata.img_src||e.metadata.thumbnail;if(n&&a)return(0,d.jsx)(`div`,{className:`relative rounded-lg group`,children:(0,d.jsxs)(`a`,{className:`relative block overflow-hidden rounded-lg cursor-pointer`,href:e.metadata.url,onClick:t=>M(t,e.metadata.url),children:[(0,d.jsx)(`img`,{src:a,alt:e.metadata.title,className:`w-full h-auto object-cover rounded-lg hover:scale-105 transition-transform duration-200`,loading:`lazy`}),(0,d.jsxs)(`div`,{className:`absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/70 to-transparent p-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200`,children:[(0,d.jsx)(`p`,{className:`text-xs text-white line-clamp-2`,children:(0,l.convertURLSafeHTMLToHTML)(e.metadata.title)}),(0,d.jsx)(`p`,{className:`text-[10px] text-white/70 truncate mt-0.5`,children:e.metadata.source})]})]})},t);if(i&&a)return(0,d.jsxs)(`div`,{className:`relative rounded-xl`,children:[(0,d.jsx)(O,{spread:40,glow:!0,disabled:!1,proximity:64,inactiveZone:.01,borderWidth:2}),(0,d.jsxs)(`a`,{className:`relative bg-card text-card-foreground border border-border rounded-xl overflow-hidden flex flex-col cursor-pointer shadow-sm hover:shadow-md transition-all duration-200`,href:e.metadata.url,target:`_blank`,rel:`noopener noreferrer`,children:[(0,d.jsxs)(`div`,{className:`relative`,children:[(0,d.jsx)(`img`,{src:a,alt:e.metadata.title,className:`w-full h-24 object-cover`}),(0,d.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,d.jsx)(`div`,{className:`w-10 h-10 bg-black/60 rounded-full flex items-center justify-center`,children:(0,d.jsx)(s.Video,{size:18,className:`text-white ml-0.5`})})})]}),(0,d.jsx)(`p`,{className:`text-xs line-clamp-2 p-2 text-muted-foreground`,children:(0,l.convertURLSafeHTMLToHTML)(e.metadata.title)})]})]},t);let o=D[e.metadata.url];return(0,d.jsxs)(`div`,{className:`relative rounded-xl group h-full`,children:[(0,d.jsx)(O,{spread:40,glow:!0,disabled:!1,proximity:64,inactiveZone:.01,borderWidth:2}),(0,d.jsxs)(`div`,{className:`relative bg-card text-card-foreground border border-border rounded-xl p-2.5 flex flex-col font-medium cursor-pointer shadow-sm hover:shadow-md transition-all duration-200 h-full`,onClick:t=>M(t,e.metadata.url),children:[o&&(0,d.jsx)(`div`,{className:`absolute top-1.5 left-1.5 p-1 rounded-md bg-background/80 backdrop-blur-sm z-[5]`,children:o===`loading`?(0,d.jsx)(s.Loader2,{size:14,className:`text-primary animate-spin`}):(0,d.jsx)(s.FileText,{size:14,className:`text-green-500`})}),(0,d.jsx)(`a`,{href:e.metadata.url,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),className:`absolute top-1.5 right-1.5 p-1 rounded-md bg-secondary/50 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-secondary z-10`,title:`Open in new tab`,children:(0,d.jsx)(s.ExternalLink,{size:12,className:`text-muted-foreground`})}),(0,d.jsxs)(`p`,{className:`text-xs line-clamp-4 text-muted-foreground`,children:[(0,d.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-semibold text-foreground/70 align-middle`,children:[e.metadata.url===`File`?(0,d.jsx)(`span`,{className:`inline-flex items-center justify-center w-3.5 h-3.5 rounded-full bg-secondary flex-shrink-0`,children:(0,d.jsx)(s.File,{size:10,className:`text-muted-foreground`})}):(0,d.jsx)(`img`,{src:`https://s2.googleusercontent.com/s2/favicons?domain_url=${e.metadata.url}`,width:20,height:20,alt:`favicon`,className:`inline rounded h-5 w-5 flex-shrink-0`}),e.metadata.source]}),` `,(0,d.jsx)(`span`,{className:`align-middle`,children:(0,l.convertURLSafeHTMLToHTML)(e.metadata.title)})]})]})]},t)};return(0,d.jsxs)(d.Fragment,{children:[t&&(0,d.jsx)(`div`,{className:`flex items-center gap-1 mb-3 overflow-x-auto pb-1`,children:ee.map(e=>(0,d.jsxs)(`button`,{onClick:()=>P(e.code),disabled:u,className:E(`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-all duration-200 whitespace-nowrap`,r===e.code?`bg-primary text-primary-foreground`:`bg-secondary/50 text-muted-foreground hover:bg-secondary hover:text-foreground`),children:[(0,d.jsx)(e.icon,{className:`w-4 h-4 flex-shrink-0`}),(0,d.jsx)(`span`,{children:e.name})]},e.code))}),(0,d.jsx)(`div`,{ref:x,className:E(`overflow-y-auto pb-2 pr-1`,r===`images`?`max-h-[400px] lg:max-h-[500px]`:`max-h-[180px] lg:max-h-[280px]`),children:u?(0,d.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,d.jsx)(s.Loader2,{className:`w-6 h-6 animate-spin text-muted-foreground`})}):a.length>0?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`div`,{className:E(r===`images`?`columns-2 sm:columns-3 lg:columns-4 gap-2 [&>div]:mb-2 [&>div]:break-inside-avoid`:E(`grid gap-3 auto-rows-fr`,T&&y?`grid-cols-2`:`grid-cols-3`)),children:a.map((e,t)=>F(e,t))}),p&&(0,d.jsx)(`div`,{className:`flex items-center justify-center py-4`,children:(0,d.jsx)(s.Loader2,{className:`w-5 h-5 animate-spin text-muted-foreground`})}),!_&&a.length>0&&(0,d.jsx)(`div`,{className:`flex items-center justify-center py-4 text-muted-foreground text-xs`,children:`No more results`})]}):(0,d.jsx)(`div`,{className:`flex items-center justify-center py-8 text-muted-foreground text-sm`,children:`No results found`})})]})},B={extract:`Extract`,arxiv:`ArXiv`,"google scholar":`Scholar`,pubmed:`PubMed`,wolframalpha:`Wolfram`,youtube:`YouTube`,Web:`Web`};function ne(e){return e?B[e]??e:`Web`}function V({queries:e,loading:t}){let n=e.filter(e=>e.status===`done`).length,r=e.length,i=t&&e.some(e=>e.status===`running`);return t?(0,d.jsxs)(`div`,{className:`rounded-xl border border-border bg-secondary/20 overflow-hidden text-sm`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border/50`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground`,children:[i?(0,d.jsx)(s.Loader2,{className:`w-3.5 h-3.5 animate-spin`}):(0,d.jsx)(s.Search,{className:`w-3.5 h-3.5`}),(0,d.jsx)(`span`,{className:`font-medium text-foreground`,children:i?`Running analysis…`:`Analysis complete`})]}),r>0&&(0,d.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[n,`/`,r,` searches`]})]}),e.length>0&&(0,d.jsx)(`div`,{className:`divide-y divide-border/40`,children:e.map((e,t)=>(0,d.jsxs)(`div`,{className:`flex items-center gap-2.5 px-3 py-2`,children:[e.status===`running`?(0,d.jsx)(s.Loader2,{className:`w-3.5 h-3.5 text-muted-foreground animate-spin flex-shrink-0`}):(0,d.jsx)(s.Search,{className:E(`w-3.5 h-3.5 flex-shrink-0`,e.status===`done`?`text-muted-foreground`:`text-muted-foreground/40`)}),(0,d.jsxs)(`div`,{className:`flex items-baseline gap-1.5 min-w-0 flex-1`,children:[(0,d.jsxs)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap flex-shrink-0`,children:[ne(e.category),` ·`]}),(0,d.jsx)(`span`,{className:`text-foreground/80 truncate`,children:e.query})]})]},t))})]}):null}var H=null,re=`onnx-community/Kokoro-82M-v1.0-ONNX`,U={device:`webgpu`,dtype:`fp32`},ie={device:`wasm`,dtype:`q8`},ae=null,W=null;function oe(){return typeof navigator<`u`&&`gpu`in navigator}async function se(){if(!oe())return!1;try{return await navigator.gpu.requestAdapter()!=null}catch{return!1}}async function ce(){if(!H)try{H=(await import(`kokoro-js`)).KokoroTTS}catch(e){throw console.error(`Failed to import kokoro-js:`,e),Error(`Kokoro.js library not available`)}let e=[];await se()&&e.push(U),e.push(ie);let t;for(let n of e)try{let e=await H.from_pretrained(re,{device:n.device,dtype:n.dtype});return W=n.device,e}catch(e){t=e,console.warn(`Kokoro model failed to load on "${n.device}" backend:`,e)}throw t instanceof Error?t:Error(`Failed to load Kokoro model`)}async function le(){return ae||=ce().catch(e=>{throw ae=null,e}),ae}async function G(){return le()}async function ue(){return(await G()).list_voices()}function de(){return W}function K(e,t){let[r,i]=(0,n.useState)(`stopped`),a=(0,n.useRef)(null),o=(0,n.useRef)(null),s=(0,n.useRef)(null),c=(0,n.useRef)(t);c.current=t;let l=(0,n.useCallback)(()=>{a.current&&=(a.current.pause(),a.current.src.startsWith(`blob:`)&&URL.revokeObjectURL(a.current.src),null),s.current?.abort(),s.current=null},[]),u=(0,n.useCallback)(()=>{if(!(`speechSynthesis`in window))return!1;try{window.speechSynthesis.cancel();let t=new SpeechSynthesisUtterance(e);return o.current=t,t.onend=()=>{o.current=null,i(`stopped`)},t.onerror=()=>{o.current=null,i(`stopped`)},window.speechSynthesis.speak(t),i(`started`),!0}catch{return!1}},[e]);return{speechStatus:r,start:(0,n.useCallback)(async()=>{if(!e?.trim())return;l(),window.speechSynthesis?.cancel(),o.current=null,i(`started`);let t=new AbortController;s.current=t;try{if(localStorage.getItem(`useTTSKokoro`)!==`false`)try{let t=await G(),n=localStorage.getItem(`kokoroVoice`)||`af_heart`,r=(await t.generate(e.slice(0,5e3),{voice:n})).toWav(),o=new Blob([r],{type:`audio/wav`}),s=URL.createObjectURL(o),c=new Audio(s);a.current=c,c.onended=()=>{i(`stopped`),URL.revokeObjectURL(s),a.current=null},c.onerror=()=>{URL.revokeObjectURL(s),a.current=null,u()||i(`stopped`)},await c.play();return}catch(e){console.warn(`Kokoro TTS failed, falling back to Cloudflare:`,e)}let n=await(0,f.default)(`/api/agent/voice`,{method:`POST`,body:{text:e.slice(0,5e3),voice:localStorage.getItem(`kokoroVoice`)||`af_heart`},signal:t.signal}),r=typeof n.blob==`function`?await n.blob():n;if(!r||r.size===0){u()||i(`stopped`);return}let o=URL.createObjectURL(r),s=new Audio(o);a.current=s,s.onended=()=>{i(`stopped`),URL.revokeObjectURL(o),a.current=null},s.onerror=()=>{URL.revokeObjectURL(o),a.current=null,u()||i(`stopped`)},await s.play()}catch{u()||i(`stopped`)}},[e,l,u]),stop:(0,n.useCallback)(()=>{l(),o.current=null,window.speechSynthesis?.cancel(),i(`stopped`)},[l])}}var fe=async(e,t,n)=>{let r=localStorage.getItem(`chatModelKey`),i=localStorage.getItem(`chatModelProviderId`),a=(await(0,f.default)(`/api/agent/providers`))?.providers||[];if(!a||a.length===0){t(!0);return}let o=a.find(e=>e.id===i&&(e.chatModels?.length??0)>0);if(o||=a.find(e=>e.name.toLowerCase().includes(`openrouter`)&&(e.chatModels?.length??0)>0)||a.find(e=>e.name.toLowerCase().includes(`nvidia`)&&(e.chatModels?.length??0)>0)||a.find(e=>(e.chatModels?.length??0)>0),!o){t(!0);return}i=o.id;let s=o.chatModels.find(e=>e.key===r);if(s||(o.name.toLowerCase().includes(`openrouter`)&&(s=o.chatModels.find(e=>e.key===`openrouter/free`)),!s&&o.name.toLowerCase().includes(`openrouter`)&&(s=o.chatModels.find(e=>e.key===`nvidia/nemotron-3-super-120b-a12b:free`)),s||=o.chatModels.find(e=>(e.key.toLowerCase().includes(`nemotron-3-super`)||e.name.toLowerCase().includes(`nemotron 3 super`))&&e.key.toLowerCase().includes(`120b`)),s||=o.chatModels.find(e=>e.key.toLowerCase().includes(`nemotron`)||e.name.toLowerCase().includes(`nemotron`)),s||=o.chatModels[0]),!s){t(!0);return}r=s.key,localStorage.setItem(`chatModelKey`,r),localStorage.setItem(`chatModelProviderId`,i),e({key:r,providerId:i}),t(!0)},pe=`qwksearch_guest_chats`,me=typeof window<`u`;function he(){if(!me)return[];try{let e=localStorage.getItem(pe);return e?JSON.parse(e).sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()):[]}catch(e){return console.error(`Failed to get guest chats:`,e),[]}}function ge(e){return me&&he().find(t=>t.id===e)||null}function _e(e){if(me)try{let t=he(),n=t.findIndex(t=>t.id===e.id);n>=0?t[n]=e:t.push(e),localStorage.setItem(pe,JSON.stringify(t))}catch(e){console.error(`Failed to save guest chat:`,e)}}function ve(e){if(me)try{let t=he().filter(t=>t.id!==e);localStorage.setItem(pe,JSON.stringify(t))}catch(e){console.error(`Failed to delete guest chat:`,e)}}function ye(){if(me)try{localStorage.removeItem(pe)}catch(e){console.error(`Failed to clear guest chats:`,e)}}var be=async(e,t,n,r,i,a,o,s,l)=>{if(!t){let t=ge(e);if(t){n(t.messages);let e=t.messages.filter(e=>e.role===`user`||e.role===`assistant`),o=e.map(e=>[e.role,e.content]);e.length>0&&(document.title=e[0].content),s(t.files||[]),l((t.files||[]).map(e=>e.fileId)),i(o),a(t.focusMode),r(!0);return}try{let{data:t,error:u}=await(0,c.getChatById)({path:{id:e}});if(u){let e=u.status;if(e===404||e===403){o(!0),r(!0);return}throw Error(`Failed to load chat: ${u.message}`)}let{messages:d,chat:f}=t||{};if(!d||!f){o(!0),r(!0);return}n(d);let p=d.filter(e=>e.role===`user`||e.role===`assistant`),m=p.map(e=>[e.role,e.content]);p.length>0&&(document.title=p[0].content);let h=f.files.map(e=>({fileName:e.name,fileExtension:e.name.split(`.`).pop(),fileId:e.fileId}));s(h),l(h.map(e=>e.fileId)),i(m),a(f.focusMode),r(!0);return}catch(e){console.error(`[chatMessages] Failed to load public chat:`,e),o(!0),r(!0);return}}try{let{data:t,error:u}=await(0,c.getChatById)({path:{id:e}});if(u){let e=u.status;if(e===404||e===401||e===403){o(!0),r(!0);return}throw Error(`Failed to load chat: ${u.message}`)}let{messages:d,chat:f}=t||{};if(!d||!f){o(!0),r(!0);return}n(d);let p=d.filter(e=>e.role===`user`||e.role===`assistant`),m=p.map(e=>[e.role,e.content]);console.debug(new Date,`app:messages_loaded`),p.length>0&&(document.title=p[0].content);let h=f.files.map(e=>({fileName:e.name,fileExtension:e.name.split(`.`).pop(),fileId:e.fileId}));s(h),l(h.map(e=>e.fileId)),i(m),a(f.focusMode),r(!0)}catch(e){console.error(`[chatMessages] Failed to load chat:`,e),o(!0),r(!0)}},xe=e=>{let t=[];return e.forEach((n,r)=>{if(n.role===`user`){let i=e.findIndex((e,t)=>t>r&&e.role===`user`),a=e.find((e,t)=>t>r&&e.role===`assistant`&&(i===-1||t<i)),o=e.find((e,t)=>t>r&&e.role===`source`&&e.sources&&(i===-1||t<i)),s=e.find((e,t)=>t>r&&e.role===`searching`&&(i===-1||t<i)),c=!1,l=a?.content??``,u=a?.content??``,d=[];if(a){let t=/\[([^\]]+)\]/g,n=/\[(\d+)\]/g;if(l.includes(`<think>`)){let e=l.match(/<think>/g)?.length||0,t=l.match(/<\/think>/g)?.length||0;e&&!t&&(l+=`</think> <a> </a>`)}a.content.includes(`</think>`)&&(c=!0),o&&o.sources&&o.sources.length>0?(l=l.replace(t,(e,t)=>t.split(`,`).map(e=>e.trim()).map(e=>{let t=parseInt(e);if(isNaN(t)||t<=0)return`[${e}]`;let n=(o.sources?.[t-1])?.metadata?.url;return n?`<citation href="${n}">${e}</citation>`:``}).join(``)),u=a.content.replace(n,``)):(l=l.replace(n,``),u=a.content.replace(n,``));let s=e.find((e,t)=>t>r&&e.role===`suggestion`&&(i===-1||t<i));s&&s.suggestions.length>0&&(d=s.suggestions)}t.push({userMessage:n,assistantMessage:a,sourceMessage:o,searchingMessage:s,parsedAssistantMessage:l,speechMessage:u,thinkingEnded:c,suggestions:d})}}),t},Se=async e=>{let t=localStorage.getItem(`chatModelKey`),n=localStorage.getItem(`chatModelProviderId`),r=parseInt(localStorage.getItem(`maxFollowupQuestions`)||`4`),i=e.filter(e=>e.role===`user`||e.role===`assistant`);try{let e=await(0,f.default)(`agent/suggestions`,{method:`POST`,body:JSON.stringify({chatHistory:i,chatModel:{providerId:n,key:t},maxQuestions:r})});return Array.isArray(e.suggestions)?e.suggestions:[]}catch{return[]}},Ce=3,we=()=>Array.from(crypto.getRandomValues(new Uint8Array(7)),e=>e.toString(16).padStart(2,`0`)).join(``),Te=`sourceExtractionEnabled`,Ee=`thinkingTimeLimit`;async function De(e,n){let{message:r,messageId:i,rewrite:a=!1}=e,{chatId:o,loading:s,messages:l,fileIds:u,focusMode:d,category:m,optimizationMode:h,chatHistory:g,chatModelProvider:_,isAuthenticated:v,messagesRef:y,abortControllerRef:b,setLoading:x,setMessageAppeared:S,setMessages:C,setChatHistory:w,setChatModelProvider:T}=n,E=typeof window<`u`&&localStorage.getItem(Te)===`true`,D=typeof window<`u`&&Number(localStorage.getItem(Ee)??`0`)||0;if(s||!r)return;let O=new AbortController;b.current=O,x(!0),S(!1),l.length<=1&&window.history.replaceState(null,``,`/c/${o}`);let k=``,A=!1,j=!1,M=[],N=Date.now(),P=D>0,F=``,I=``,L=i??we();C(e=>[...e,{content:r,messageId:L,chatId:o,role:`user`,createdAt:new Date}]);let R=async e=>{if(e.type===`error`){let t=e.data;typeof t==`string`&&(t.includes(`no longer available`)||t.includes(`deprecated`)||t.includes(`410`))&&(localStorage.removeItem(`chatModelKey`),localStorage.removeItem(`chatModelProviderId`),T?.({key:``,providerId:``})),p.toast.error(t),x(!1);return}if(e.type===`searching`){let t=e.data;C(n=>{let r=n.findIndex(t=>t.messageId===e.messageId&&t.role===`searching`);return r===-1?[...n,{role:`searching`,messageId:e.messageId,chatId:o,createdAt:new Date,queries:[{query:t.query,category:t.category,status:t.status}]}]:n.map((e,n)=>{if(n!==r)return e;let i=e,a=i.queries.findIndex(e=>e.query===t.query);if(a===-1)return{...i,queries:[...i.queries,{query:t.query,category:t.category,status:t.status}]};let o=i.queries.map((e,n)=>n===a?{...e,status:t.status}:e);return{...i,queries:o}})})}if(e.type===`sources`&&(M=e.data||[],C(t=>[...t,{messageId:e.messageId,chatId:o,role:`source`,sources:M,createdAt:new Date}]),M.length>0&&(S(!0),M.slice(0,Ce).forEach(e=>{let t=e?.metadata?.url;t&&t!==`File`&&(0,f.default)(`doc/article?url=${encodeURIComponent(t)}`).catch(()=>{})}))),e.type===`message`&&(k+=e.data,P?(F+=e.data,I||=e.messageId,A=!0):A?C(t=>t.map(t=>t.messageId===e.messageId&&t.role===`assistant`?{...t,content:t.content+e.data}:t)):(C(t=>[...t,{content:e.data,messageId:e.messageId,chatId:o,role:`assistant`,createdAt:new Date}]),A=!0,S(!0))),e.type===`messageEnd`){let e=async()=>{P&&F&&(C(e=>[...e,{content:F,messageId:I,chatId:o,role:`assistant`,createdAt:new Date}]),S(!0)),w(e=>[...e,[`human`,r],[`assistant`,k]]),x(!1);let e=y.current[y.current.length-1];if(t.researchAgentUIConfig.getAutoMediaSearch()&&(document.getElementById(`search-images-${e.messageId}`)?.click(),document.getElementById(`search-videos-${e.messageId}`)?.click()),!j){j=!0;let e=await Se(y.current),t=we();if(C(n=>[...n,{role:`suggestion`,suggestions:e,chatId:o,createdAt:new Date,messageId:t}]),v&&e.length>0)try{await(0,c.saveMessage)({body:{chatId:o,messageId:t,role:`suggestion`,suggestions:e}})}catch(e){console.error(`Failed to save suggestions:`,e)}}};if(P){let e=Date.now()-N,t=D*1e3-e;t>0&&await new Promise(e=>setTimeout(e,t))}await e()}},z=l.findIndex(e=>e.messageId===L);try{let{stream:e}=await(0,c.agentChat)({signal:O.signal,body:{message:{messageId:L,chatId:o,content:r},optimizationMode:h,focusMode:d,category:m,history:a?g.slice(0,z===-1?void 0:z):g,files:u,chatModel:{key:_.key,providerId:_.providerId},sourceExtractionEnabled:E,thinkingTimeLimit:D,systemInstructions:localStorage.getItem(`systemInstructions`)??void 0},onSseError:e=>{if((e instanceof Error?e.message:String(e)).includes(`401`)&&v){p.toast.error(`Your session has expired. Please sign in again.`),x(!1),window.location.href=`/`;return}p.toast.error(`Failed to send message. Please try again.`),x(!1)}});for await(let t of e)await R(t)}catch(e){if(e.name===`AbortError`){P&&F&&(C(e=>[...e,{content:F,messageId:I,chatId:o,role:`assistant`,createdAt:new Date}]),S(!0)),k&&w(e=>[...e,[`human`,r],[`assistant`,k]]),x(!1),b.current=null;return}throw e}b.current=null}function Oe(e){let[t,r]=(0,n.useState)(e),[i,a]=(0,n.useState)(!1),[o,s]=(0,n.useState)(!1),[c,l]=(0,n.useState)(!1),[u,d]=(0,n.useState)(!1),[f,p]=(0,n.useState)(!1),[m,h]=(0,n.useState)(!1),[g,_]=(0,n.useState)(!1),[v,y]=(0,n.useState)(!1),[b,x]=(0,n.useState)([]),[S,C]=(0,n.useState)([]),[w,T]=(0,n.useState)([]),[E,D]=(0,n.useState)([]),[O,k]=(0,n.useState)(`webSearch`),[A,j]=(0,n.useState)(`general`),[M,N]=(0,n.useState)(`speed`),[P,F]=(0,n.useState)({key:``,providerId:``}),I=(0,n.useRef)([]),L=(0,n.useMemo)(()=>S.filter(e=>e.role===`user`||e.role===`assistant`),[S]),R=(0,n.useMemo)(()=>xe(S),[S]);return{state:{chatId:t,newChatCreated:i,loading:o,messageAppeared:c,chatHistory:b,messages:S,files:w,fileIds:E,focusMode:O,category:A,optimizationMode:M,isMessagesLoaded:u,notFound:v,chatModelProvider:P,isConfigReady:f,hasError:m,isReady:g},setters:{setChatId:r,setNewChatCreated:a,setLoading:s,setMessageAppeared:l,setChatHistory:x,setMessages:C,setFiles:T,setFileIds:D,setFocusMode:k,setCategory:j,setOptimizationMode:N,setIsMessagesLoaded:d,setNotFound:y,setChatModelProvider:F,setIsConfigReady:p,setHasError:h,setIsReady:_},messagesRef:I,chatTurns:L,sections:R}}var ke=(0,n.createContext)({chatHistory:[],chatId:``,fileIds:[],files:[],focusMode:``,category:``,hasError:!1,isMessagesLoaded:!1,isReady:!1,loading:!1,messageAppeared:!1,messages:[],chatTurns:[],sections:[],notFound:!1,optimizationMode:``,chatModelProvider:{key:``,providerId:``},rewrite:()=>{},sendMessage:async()=>{},setFileIds:()=>{},setFiles:()=>{},setFocusMode:()=>{},setCategory:()=>{},setOptimizationMode:()=>{},setChatModelProvider:()=>{},stopStreaming:()=>{},newChat:()=>{},incognito:!1,setIncognito:()=>{}});function q(){return(0,n.useContext)(ke)}var Ae=(0,n.createContext)({user:null,isLoading:!0,isAuthenticated:!1,signIn:()=>{},signOut:async()=>{}});function je({children:e,authClient:t}){let[r,i]=(0,n.useState)(null),[a,o]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{(async()=>{try{let{data:e}=await t.getSession();i(e?.user??null)}catch(e){console.error(`Failed to fetch session:`,e),i(null)}finally{o(!1)}})()},[]),(0,n.useEffect)(()=>{a||r||t.oneTap({fetchOptions:{onSuccess:async()=>{let{data:e}=await t.getSession();i(e?.user??null)}}})},[a,r]),(0,d.jsx)(Ae.Provider,{value:{user:r,isLoading:a,isAuthenticated:!!r,signIn:()=>{t.signIn.social({provider:`google`,callbackURL:`/`})},signOut:async()=>{try{await t.signOut({fetchOptions:{onSuccess:()=>{i(null),window.location.href=`/`}}})}catch(e){console.error(`Sign out failed:`,e)}}},children:e})}function Me(){let e=(0,n.useContext)(Ae);if(!e)throw Error(`useSession must be used within SessionProvider`);return e}function Ne({children:e}){let t=(0,r.useParams)(),i=(0,r.useSearchParams)(),a=(0,r.useRouter)(),o=i.get(`q`),{isAuthenticated:s,isLoading:c}=Me(),{state:l,setters:u,messagesRef:f,chatTurns:p,sections:m}=Oe(t.chatId),h=(0,n.useRef)(null),[g,_]=(0,n.useState)(!1);(0,n.useEffect)(()=>{fe(u.setChatModelProvider,u.setIsConfigReady,u.setHasError)},[]),(0,n.useEffect)(()=>{t.chatId&&t.chatId!==l.chatId&&(u.setChatId(t.chatId),u.setMessages([]),u.setChatHistory([]),u.setFiles([]),u.setFileIds([]),u.setIsMessagesLoaded(!1),u.setNotFound(!1),u.setNewChatCreated(!1))},[t.chatId,l.chatId]),(0,n.useEffect)(()=>{if(l.chatId&&!l.newChatCreated&&!l.isMessagesLoaded&&l.messages.length===0){if(c)return;be(l.chatId,s,u.setMessages,u.setIsMessagesLoaded,u.setChatHistory,u.setFocusMode,u.setNotFound,u.setFiles,u.setFileIds)}else l.chatId||(u.setNewChatCreated(!0),u.setIsMessagesLoaded(!0),u.setChatId(crypto.randomUUID()))},[l.chatId,l.isMessagesLoaded,l.newChatCreated,l.messages.length,s,c]),(0,n.useEffect)(()=>{if(!g&&!s&&l.chatId&&l.messages.length>0){let e=l.messages.filter(e=>e.role===`user`||e.role===`assistant`);if(e.length>0){let t=e[0].content.slice(0,50);_e({id:l.chatId,title:t,createdAt:new Date().toISOString(),focusMode:l.focusMode,files:l.files,messages:l.messages})}}},[l.messages,l.chatId,s,l.focusMode,l.files]),(0,n.useEffect)(()=>{f.current=l.messages},[l.messages]),(0,n.useEffect)(()=>{l.isMessagesLoaded&&l.isConfigReady?(u.setIsReady(!0),console.debug(new Date,`app:ready`)):u.setIsReady(!1)},[l.isMessagesLoaded,l.isConfigReady]),(0,n.useEffect)(()=>{l.isReady&&o&&l.isConfigReady&&v(o)},[l.isConfigReady,l.isReady,o]);let v=(0,n.useCallback)(async(e,t,n=!1)=>{l.chatId&&await De({message:e,messageId:t,rewrite:n},{chatId:l.chatId,loading:l.loading,messages:l.messages,fileIds:l.fileIds,focusMode:l.focusMode,category:l.category,optimizationMode:l.optimizationMode,chatHistory:l.chatHistory,chatModelProvider:l.chatModelProvider,isAuthenticated:s,messagesRef:f,abortControllerRef:h,setLoading:u.setLoading,setMessageAppeared:u.setMessageAppeared,setMessages:u.setMessages,setChatHistory:u.setChatHistory,setChatModelProvider:u.setChatModelProvider})},[l.chatId,l.loading,l.messages,l.fileIds,l.focusMode,l.category,l.optimizationMode,l.chatHistory,l.chatModelProvider,s,f]),y=(0,n.useCallback)(e=>{let t=l.messages.findIndex(t=>t.messageId===e),n=p.findIndex(t=>t.messageId===e);if(t===-1)return;let r=p[n-1];u.setMessages(e=>[...e.slice(0,l.messages.length>2?l.messages.indexOf(r):0)]),u.setChatHistory(e=>[...e.slice(0,p.length>2?n-1:0)]),v(r.content,r.messageId,!0)},[l.messages,p,v]),b=(0,n.useCallback)(()=>{h.current&&=(h.current.abort(),null)},[]),x=(0,n.useCallback)(()=>{b(),u.setMessages([]),u.setChatHistory([]),u.setFiles([]),u.setFileIds([]),u.setChatId(void 0),u.setNewChatCreated(!1),u.setIsMessagesLoaded(!1),u.setNotFound(!1),a.push(`/`)},[b,a]),S={messages:l.messages,chatTurns:p,sections:m,chatHistory:l.chatHistory,files:l.files,fileIds:l.fileIds,focusMode:l.focusMode,category:l.category,chatId:l.chatId,hasError:l.hasError,isMessagesLoaded:l.isMessagesLoaded,isReady:l.isReady,loading:l.loading,messageAppeared:l.messageAppeared,notFound:l.notFound,optimizationMode:l.optimizationMode,chatModelProvider:l.chatModelProvider,incognito:g,setFileIds:u.setFileIds,setFiles:u.setFiles,setFocusMode:u.setFocusMode,setCategory:u.setCategory,setOptimizationMode:u.setOptimizationMode,rewrite:y,sendMessage:v,setChatModelProvider:u.setChatModelProvider,stopStreaming:b,newChat:x,setIncognito:_};return(0,d.jsx)(ke.Provider,{value:S,children:e})}function Pe({delayDuration:e=0,...t}){return(0,d.jsx)(m.Provider,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function J({...e}){return(0,d.jsx)(Pe,{children:(0,d.jsx)(m.Root,{"data-slot":`tooltip`,...e})})}function Y({...e}){return(0,d.jsx)(m.Trigger,{"data-slot":`tooltip-trigger`,...e})}function X({className:e,sideOffset:t=0,children:n,...r}){return(0,d.jsx)(m.Portal,{children:(0,d.jsxs)(m.Content,{"data-slot":`tooltip-content`,sideOffset:t,className:E(`bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-2xl px-3 py-1.5 text-xs text-balance`,e),...r,children:[n,(0,d.jsx)(m.Arrow,{className:`bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]`})]})})}var Fe=({href:e,children:t,sources:r})=>{let{openPanel:i}=A(),a=(0,n.useMemo)(()=>!r||!e?null:r.find(t=>t.metadata?.url===e)??null,[r,e]),o=(0,n.useMemo)(()=>{try{return new URL(e).hostname.replace(`www.`,``)}catch{return a?.metadata?.source||``}},[e,a]),s=a?.metadata?.title||``,c=`https://s2.googleusercontent.com/s2/favicons?domain_url=${e}`;return(0,d.jsxs)(J,{children:[(0,d.jsx)(Y,{asChild:!0,children:(0,d.jsx)(`a`,{href:e,onClick:t=>{t.preventDefault(),i(e,``)},className:`bg-light-secondary dark:bg-dark-secondary px-1 rounded ml-1 no-underline text-xs text-black/70 dark:text-white/70 relative cursor-pointer hover:bg-black/10 dark:hover:bg-white/20 transition-colors`,children:t})}),(0,d.jsx)(X,{side:`top`,className:`max-w-72 p-2.5`,children:(0,d.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,d.jsx)(`img`,{src:c,alt:``,width:16,height:16,className:`rounded flex-shrink-0 mt-0.5`}),(0,d.jsxs)(`div`,{className:`min-w-0`,children:[(0,d.jsx)(`p`,{className:`text-xs font-medium leading-snug line-clamp-2`,children:s||o}),s&&(0,d.jsx)(`p`,{className:`text-[10px] opacity-70 truncate mt-0.5`,children:o})]})]})})]})},Ie=({content:e,thinkingEnded:t})=>{let[r,i]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{i(!t)},[t]),(0,d.jsxs)(`div`,{className:`my-4 bg-secondary/50 rounded-xl border border-border overflow-hidden`,children:[(0,d.jsxs)(`button`,{onClick:()=>i(!r),className:`w-full flex items-center justify-between px-4 py-1 text-foreground/90 hover:bg-secondary transition duration-200`,children:[(0,d.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,d.jsx)(s.BrainCircuit,{size:20,className:`text-accent-foreground`}),(0,d.jsx)(`p`,{className:`font-medium text-sm`,children:`Thinking Process`})]}),r?(0,d.jsx)(s.ChevronUp,{size:18,className:`text-muted-foreground`}):(0,d.jsx)(s.ChevronDown,{size:18,className:`text-muted-foreground`})]}),r&&(0,d.jsx)(`div`,{className:`px-4 py-3 text-foreground/80 text-sm border-t border-border bg-muted/50 whitespace-pre-wrap`,children:e})]})},Le=({children:e,thinkingEnded:t})=>(0,d.jsx)(Ie,{content:e,thinkingEnded:t}),Re=({section:e,isExpanded:t,setIsExpanded:r,isEditing:i,setIsEditing:a,editText:o,setEditText:c,handleEditSubmit:l,copiedUserMsg:u,handleCopyUserMsg:f})=>{let p=(0,n.useRef)(null);return(0,d.jsxs)(`div`,{className:`w-full pt-8 break-words`,children:[(0,d.jsxs)(`button`,{onClick:()=>r(!t),className:`flex items-center gap-3 group text-left w-full`,children:[(0,d.jsx)(`div`,{className:`flex-shrink-0 p-1.5 rounded-lg bg-secondary/50 group-hover:bg-secondary transition-colors duration-200`,children:t?(0,d.jsx)(s.ChevronDown,{size:18,className:`text-muted-foreground group-hover:text-foreground transition-colors`}):(0,d.jsx)(s.ChevronRight,{size:18,className:`text-muted-foreground group-hover:text-foreground transition-colors`})}),(0,d.jsx)(`h2`,{className:`text-foreground font-medium text-lg lg:text-3xl lg:w-9/12 group-hover:text-foreground/80 transition-colors line-clamp-3 lg:line-clamp-none`,children:e.userMessage.content})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-0.5 mt-1 ml-10`,children:[(0,d.jsxs)(J,{children:[(0,d.jsx)(Y,{asChild:!0,children:(0,d.jsx)(`button`,{onClick:f,className:`p-1.5 text-muted-foreground rounded-lg hover:bg-secondary transition-all duration-200 hover:text-foreground`,children:(0,d.jsx)(`span`,{className:E(`flex items-center transition-all duration-300`,u?`scale-110`:`scale-100`),children:u?(0,d.jsx)(s.Check,{size:14,className:`text-green-500`}):(0,d.jsx)(s.ClipboardList,{size:14})})})}),(0,d.jsx)(X,{side:`bottom`,children:u?`Copied!`:`Copy prompt`})]}),(0,d.jsxs)(J,{children:[(0,d.jsx)(Y,{asChild:!0,children:(0,d.jsx)(`button`,{onClick:()=>{c(e.userMessage.content),a(!0),setTimeout(()=>p.current?.focus(),50)},className:`p-1.5 text-muted-foreground rounded-lg hover:bg-secondary transition-all duration-200 hover:text-foreground`,children:(0,d.jsx)(s.Pencil,{size:14})})}),(0,d.jsx)(X,{side:`bottom`,children:`Edit & resubmit`})]})]}),i&&(0,d.jsxs)(`div`,{className:`mt-3 ml-10 flex flex-col gap-2`,children:[(0,d.jsx)(`textarea`,{ref:p,value:o,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),l()),e.key===`Escape`&&a(!1)},rows:3,className:`w-full rounded-xl border border-border bg-background p-3 text-sm resize-none focus:outline-none focus:ring-2 focus:ring-primary/30 transition-colors`}),(0,d.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,d.jsx)(`button`,{onClick:()=>a(!1),className:`px-3 py-1.5 text-sm text-muted-foreground rounded-lg hover:bg-secondary transition-colors duration-200`,children:`Cancel`}),(0,d.jsx)(`button`,{onClick:l,disabled:!o.trim(),className:`px-3 py-1.5 text-sm bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200`,children:`Resubmit`})]})]})]})};function ze({...e}){return(0,d.jsx)(h.Root,{"data-slot":`dropdown-menu`,...e})}function Be({...e}){return(0,d.jsx)(h.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function Ve({className:e,sideOffset:t=4,...n}){return(0,d.jsx)(h.Portal,{children:(0,d.jsx)(h.Content,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:E(`bg-card text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-2xl border p-1 shadow-md`,e),...n})})}function Z({className:e,inset:t,variant:n=`default`,...r}){return(0,d.jsx)(h.Item,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:E(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-2xl px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r})}function He({className:e,children:t,checked:n,...r}){return(0,d.jsxs)(h.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,className:E(`focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-2xl py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...r,children:[(0,d.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,d.jsx)(h.ItemIndicator,{children:(0,d.jsx)(s.CheckIcon,{className:`size-4`})})}),t]})}function Ue({className:e,inset:t,...n}){return(0,d.jsx)(h.Label,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:E(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function Q({className:e,...t}){return(0,d.jsx)(h.Separator,{"data-slot":`dropdown-menu-separator`,className:E(`bg-border -mx-1 my-1 h-px`,e),...t})}function We({...e}){return(0,d.jsx)(h.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function Ge({className:e,inset:t,children:n,...r}){return(0,d.jsxs)(h.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:E(`focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-2xl px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8`,e),...r,children:[n,(0,d.jsx)(s.ChevronRightIcon,{className:`ml-auto size-4`})]})}function Ke({className:e,...t}){return(0,d.jsx)(h.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:E(`bg-card text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-2xl border p-1 shadow-lg`,e),...t})}var qe=({section:e,initialMessage:t})=>{let[r,i]=(0,n.useState)(!1);return(0,d.jsxs)(J,{children:[(0,d.jsx)(Y,{asChild:!0,children:(0,d.jsx)(`button`,{onClick:()=>{let n=`${t}${e?.sourceMessage?.sources&&e.sourceMessage.sources.length>0&&`\n\nCitations:\n${e.sourceMessage.sources?.map((e,t)=>`[${t+1}] ${e.metadata.url}`).join(`
16
+ )`},className:E(`pointer-events-none absolute inset-0 rounded-[inherit] opacity-100 transition-opacity`,o&&`opacity-100`,e>0&&`blur-[var(--blur)] `,s,f&&`!hidden`),children:(0,d.jsx)(`div`,{className:E(`glow`,`rounded-[inherit]`,`after:content-[""] after:rounded-[inherit] after:absolute after:inset-[calc(-1*var(--glowingeffect-border-width))]`,`after:[border:var(--glowingeffect-border-width)_solid_transparent]`,`after:[background:var(--gradient)] after:[background-attachment:fixed]`,`after:opacity-[var(--active)] after:transition-opacity after:duration-300`,`after:[mask-clip:padding-box,border-box]`,`after:[mask-composite:intersect]`,`after:[mask-image:linear-gradient(#0000,#0000),conic-gradient(from_calc((var(--start)-var(--spread))*1deg),#00000000_0deg,#fff,#00000000_calc(var(--spread)*2deg))]`)})})]})});O.displayName=`GlowingEffect`;var k=(0,n.createContext)(void 0),A=()=>{let e=(0,n.useContext)(k);if(!e)throw Error(`useExtractPanel must be used within an ExtractPanelProvider`);return e},j=({children:e})=>{let[t,r]=(0,n.useState)(!1),[i,a]=(0,n.useState)(``),[o,s]=(0,n.useState)(``),[c,l]=(0,n.useState)(600);return(0,d.jsx)(k.Provider,{value:{isOpen:t,url:i,searchText:o,panelWidth:c,setIsOpen:r,setUrl:a,setSearchText:s,setPanelWidth:l,openPanel:(e,t=``)=>{console.log(`[ExtractPanelContext] openPanel called with URL:`,e);try{let t=new URL(e);(t.pathname===`/`||t.pathname===``)&&console.error(`[ExtractPanelContext] URL is domain-only, missing article path:`,e)}catch(t){console.error(`[ExtractPanelContext] Invalid URL format:`,e,t)}if(a(e),s(t),r(!0),typeof window<`u`){let t=new URLSearchParams(window.location.search);t.set(`extract`,encodeURIComponent(e));let n=`${window.location.pathname}?${t.toString()}`;window.history.pushState({},``,n)}},closePanel:()=>{if(r(!1),typeof window<`u`){let e=new URLSearchParams(window.location.search);e.delete(`extract`);let t=e.toString()?`${window.location.pathname}?${e.toString()}`:window.location.pathname;window.history.pushState({},``,t)}}},children:e})};function M(e){return(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,viewBox:`0 0 214.6279 198.1416`,...e,children:[(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{fill:`#5CB0FF`,d:`M171.748,142.3193c0-15.4375-12.5625-28-28-28s-28,12.5625-28,28s12.5625,28,28,28 S171.748,157.7568,171.748,142.3193z`}),(0,d.jsx)(`path`,{fill:`#1C71DA`,d:`M95.748,166.3193v-76h42.989c0.0146,0.7878,0.0696,1.5579,0.0696,2.3516c0,2.2109,1.7891,4,4,4 s4-1.7891,4-4c0-0.7937-0.0603-1.5632-0.0745-2.3516h25.0159h5.6484h2.3516c0-46.3164-37.6836-84-84-84h-8v0.4053 c-42.5754,4.0447-76,39.9785-76,83.5947c0,46.3164,37.6836,84,84,84c2.2109,0,4-1.7891,4-4S97.959,166.3193,95.748,166.3193z M87.748,164.9949c-19.9287-6.438-35.0586-36.3945-35.0586-72.324c0-0.7937,0.0549-1.5637,0.0696-2.3516h34.989V164.9949z M53.1655,82.3193C55.75,51.1135,69.7729,26.157,87.748,20.3506v61.9688H53.1655z M95.748,82.3193v-63.293 c21.6829,0,39.6248,27.5808,42.5825,63.293H95.748z M171.3181,82.3193h-24.9685c-2.3884-29.9812-14.96-54.8911-31.9993-65.6013 C144.7681,24.4146,167.9641,50.417,171.3181,82.3193z M77.1458,16.718C60.1064,27.4282,47.5349,52.3381,45.1465,82.3193H20.178 C23.532,50.417,46.728,24.4146,77.1458,16.718z M19.748,90.3193h25.0159c-0.0142,0.7883-0.0745,1.5579-0.0745,2.3516 c0,28.5327,9.217,53.6572,23.1233,68.2603C39.7031,149.769,19.748,122.3567,19.748,90.3193z`}),(0,d.jsx)(`path`,{fill:`#1C71DA`,d:`M191.5137,184.4287l-19.665-19.665c4.9307-6.1609,7.8994-13.9573,7.8994-22.4443 c0-19.8516-16.1484-36-36-36s-36,16.1484-36,36s16.1484,36,36,36c8.4871,0,16.2834-2.9688,22.4443-7.8994l19.665,19.665 L191.5137,184.4287z M115.748,142.3193c0-15.4375,12.5625-28,28-28s28,12.5625,28,28s-12.5625,28-28,28 S115.748,157.7568,115.748,142.3193z`})]}),(0,d.jsx)(`path`,{fill:`#FF5D5D`,d:`M4,22.1416c-1.0234,0-2.0479-0.3906-2.8281-1.1719c-1.5625-1.5615-1.5625-4.0947,0-5.6562L15.3145,1.1719 c1.5625-1.5625,4.0957-1.5625,5.6562,0c1.5625,1.5615,1.5625,4.0947,0,5.6562L6.8281,20.9697 C6.0469,21.751,5.0234,22.1416,4,22.1416z`}),(0,d.jsx)(`path`,{fill:`#FF5D5D`,d:`M18.1426,22.1416c-1.0234,0-2.0469-0.3906-2.8281-1.1719L1.1719,6.8281 c-1.5625-1.5615-1.5625-4.0947,0-5.6562c1.5605-1.5625,4.0938-1.5625,5.6562,0l14.1426,14.1416 c1.5625,1.5615,1.5625,4.0947,0,5.6562C20.1904,21.751,19.166,22.1416,18.1426,22.1416z`}),(0,d.jsx)(`path`,{fill:`#00D40B`,d:`M14,198.1416c-7.7197,0-14-6.2803-14-14s6.2803-14,14-14s14,6.2803,14,14S21.7197,198.1416,14,198.1416z M14,178.1416c-3.3086,0-6,2.6914-6,6s2.6914,6,6,6s6-2.6914,6-6S17.3086,178.1416,14,178.1416z`}),(0,d.jsx)(`path`,{fill:`#FFC504`,d:`M199.3145,56.7695c-1.0605,0-2.0781-0.4219-2.8281-1.1719l-11.3145-11.3145 c-0.75-0.75-1.1719-1.7676-1.1719-2.8281s0.4219-2.0781,1.1719-2.8281l11.3145-11.3135c1.5625-1.5625,4.0938-1.5625,5.6562,0 l11.3135,11.3135c1.5625,1.5615,1.5625,4.0947,0,5.6562l-11.3135,11.3145C201.3926,56.3477,200.375,56.7695,199.3145,56.7695z M193.6572,41.4551l5.6572,5.6572l5.6572-5.6572l-5.6572-5.6572L193.6572,41.4551z`})]})}function N(e){return(0,d.jsxs)(`svg`,{version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,viewBox:`0 0 508 508`,...e,children:[(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M316.1,353.2H191.9c13.2,60.9,37.8,102.2,62.1,102.2C278.3,455.4,302.9,414.1,316.1,353.2z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M78.2,353.2c26.2,46.5,69.8,80.1,120.6,94.5c-15.4-22.5-27.7-54.7-35.7-94.5H78.2z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M429.8,353.2h-84.9c-8,39.8-20.4,72-35.7,94.5C360,433.4,403.6,399.7,429.8,353.2z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M429.3,154.8c-26.3-46.4-69.6-80-120-94.4c15.3,22.4,27.7,54.7,35.6,94.4H429.3z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M163.1,154.8c8-39.7,20.3-71.9,35.7-94.4c-50.4,14.4-93.8,48-120,94.4H163.1z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M479.8,310.9V197.1c0-7.8-6.3-14.1-14.1-14.1H42.3c-7.8,0-14.1,6.3-14.1,14.1v113.8 c0,7.8,6.3,14.1,14.1,14.1h423.3C473.4,325,479.8,318.7,479.8,310.9z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M254,52.6c-24.3,0-48.9,41.3-62.1,102.2h124.2C302.9,93.9,278.3,52.6,254,52.6z`})]}),(0,d.jsx)(`path`,{style:{fill:`#56ACE0`},d:`M254,426.5c-95.3,0-172.9-77.5-172.9-172.9S158.7,80.8,254,80.8s172.9,77.5,172.9,172.9 S349.3,426.5,254,426.5z`}),(0,d.jsx)(`rect`,{x:`56.4`,y:`211.2`,style:{fill:`#FFC10D`},width:`395.1`,height:`85.6`}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{style:{fill:`#194F82`},d:`M465.7,154.8H461C422.8,75.3,342.7,24.4,254,24.4S85.1,75.3,47,154.8h-4.7C19,154.8,0,173.7,0,197.1 v113.8c0,23.3,19,42.3,42.3,42.3h4.2c38,79.5,118.4,130.4,207.5,130.4c89.2,0,169.5-50.9,207.5-130.4h4.2c23.3,0,42.3-19,42.3-42.3 V197.1C508,173.7,489,154.8,465.7,154.8z M429.3,154.8h-84.4c-8-39.7-20.3-71.9-35.6-94.4C359.7,74.7,403,108.4,429.3,154.8z M254,52.6c24.3,0,48.9,41.3,62.1,102.2H191.9C205.1,93.9,229.7,52.6,254,52.6z M198.7,60.4c-15.3,22.4-27.7,54.7-35.7,94.4H78.7 C105,108.4,148.3,74.7,198.7,60.4z M78.2,353.2h84.9c8,39.8,20.4,72,35.7,94.5C148,433.4,104.4,399.7,78.2,353.2z M254,455.4 c-24.3,0-48.9-41.3-62.1-102.2h124.2C302.9,414.1,278.3,455.4,254,455.4z M309.2,447.7c15.4-22.5,27.7-54.7,35.7-94.5h84.9 C403.6,399.7,360,433.4,309.2,447.7z M479.8,310.9c0,7.8-6.3,14.1-14.1,14.1H42.3c-7.8,0-14.1-6.3-14.1-14.1V197.1 c0-7.8,6.3-14.1,14.1-14.1h423.3c7.8,0,14.1,6.3,14.1,14.1v113.8H479.8z`}),(0,d.jsx)(`polygon`,{style:{fill:`#194F82`},points:`146,265.7 109.1,215.3 93.4,215.3 93.4,293.6 110.2,293.6 110.2,244.5 146,293.6 162.7,293.6 162.7,215.3 146,215.3 `}),(0,d.jsx)(`polygon`,{style:{fill:`#194F82`},points:`197.9,261.9 231.6,261.9 231.6,247 197.9,247 197.9,230.9 235.3,230.9 235.3,215.3 181.2,215.3 181.2,293.6 236.5,293.6 236.5,278.1 197.9,278.1 `}),(0,d.jsx)(`polygon`,{style:{fill:`#194F82`},points:`318.9,260.3 305.7,215.3 288.1,215.3 274.8,260.3 260,215.3 241.9,215.3 268.1,293.6 280.5,293.6 296.8,239.2 313.3,293.6 325.7,293.6 351.9,215.3 333.8,215.3 `}),(0,d.jsx)(`path`,{style:{fill:`#194F82`},d:`M392,246.6c-8.2-1.9-16.5-3.8-16.6-10.2c0.5-5.4,3.9-7.5,9-7.6c6.9,0,13.7,2.6,20.2,7.7l8.5-12.8 c-8-6.2-17-10.4-28.1-10.3c-12.5-0.6-27,7.6-26.8,23.2c-1,15.4,10.4,21.4,25.2,24.8c9.2,2,14.5,5.1,13.9,9.8 c0.1,5.2-4.6,7.7-9.9,7.7c-6.9,0-14.3-3.7-22.4-11.1l-10,12.8c9.5,9.2,20.2,13.8,32.1,13.8c15.1,0.7,27.6-8.8,27.5-23.6 C414.8,257.3,406.3,250,392,246.6z`})]})]})}function P(e){return(0,d.jsxs)(`svg`,{version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,viewBox:`0 0 512 512`,...e,children:[(0,d.jsx)(`circle`,{style:{fill:`#8AD5DD`},cx:`256`,cy:`256`,r:`256`}),(0,d.jsx)(`rect`,{id:`SVGCleanerId_0`,x:`115`,y:`68`,style:{fill:`#FFFFFF`},width:`282`,height:`376`}),(0,d.jsx)(`rect`,{id:`SVGCleanerId_1`,x:`146.336`,y:`339.8`,style:{fill:`#2D2D2D`},width:`97.696`,height:`8`}),(0,d.jsx)(`rect`,{id:`SVGCleanerId_2`,x:`146.336`,y:`371.12`,style:{fill:`#E0E0E0`},width:`97.696`,height:`8`}),(0,d.jsx)(`rect`,{id:`SVGCleanerId_3`,x:`146.336`,y:`386.8`,style:{fill:`#E0E0E0`},width:`97.696`,height:`8`}),(0,d.jsx)(`rect`,{id:`SVGCleanerId_4`,x:`146.336`,y:`402.48`,style:{fill:`#E0E0E0`},width:`97.696`,height:`8`}),(0,d.jsx)(`path`,{id:`SVGCleanerId_5`,style:{fill:`#DB2B42`},d:`M355.872,316.384H156.128c-6.464,0-11.752-5.288-11.752-11.752v-144.92 c0-6.464,5.288-11.752,11.752-11.752H355.88c6.464,0,11.752,5.288,11.752,11.752v144.92 C367.624,311.096,362.336,316.384,355.872,316.384z`}),(0,d.jsx)(`g`,{children:(0,d.jsx)(`rect`,{id:`SVGCleanerId_0_1_`,x:`115`,y:`68`,style:{fill:`#FFFFFF`},width:`282`,height:`376`})}),(0,d.jsx)(`g`,{children:(0,d.jsx)(`rect`,{id:`SVGCleanerId_1_1_`,x:`146.336`,y:`339.8`,style:{fill:`#2D2D2D`},width:`97.696`,height:`8`})}),(0,d.jsx)(`g`,{children:(0,d.jsx)(`rect`,{id:`SVGCleanerId_2_1_`,x:`146.336`,y:`371.12`,style:{fill:`#E0E0E0`},width:`97.696`,height:`8`})}),(0,d.jsx)(`g`,{children:(0,d.jsx)(`rect`,{id:`SVGCleanerId_3_1_`,x:`146.336`,y:`386.8`,style:{fill:`#E0E0E0`},width:`97.696`,height:`8`})}),(0,d.jsx)(`g`,{children:(0,d.jsx)(`rect`,{id:`SVGCleanerId_4_1_`,x:`146.336`,y:`402.48`,style:{fill:`#E0E0E0`},width:`97.696`,height:`8`})}),(0,d.jsx)(`g`,{children:(0,d.jsx)(`path`,{id:`SVGCleanerId_5_1_`,style:{fill:`#DB2B42`},d:`M355.872,316.384H156.128c-6.464,0-11.752-5.288-11.752-11.752v-144.92 c0-6.464,5.288-11.752,11.752-11.752H355.88c6.464,0,11.752,5.288,11.752,11.752v144.92 C367.624,311.096,362.336,316.384,355.872,316.384z`})}),(0,d.jsx)(`polygon`,{style:{fill:`#FFFFFF`},points:`232.496,191.472 303,232.176 232.496,272.88 `}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`rect`,{x:`269.928`,y:`339.04`,style:{fill:`#E0E0E0`},width:`97.696`,height:`19.016`}),(0,d.jsx)(`rect`,{x:`269.928`,y:`365.624`,style:{fill:`#E0E0E0`},width:`97.696`,height:`19.016`}),(0,d.jsx)(`rect`,{x:`269.928`,y:`392.24`,style:{fill:`#E0E0E0`},width:`97.696`,height:`19.016`})]}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`rect`,{x:`269.928`,y:`392.24`,style:{fill:`#2D2D2D`},width:`20.304`,height:`19.016`}),(0,d.jsx)(`rect`,{x:`269.928`,y:`365.624`,style:{fill:`#2D2D2D`},width:`20.304`,height:`19.016`}),(0,d.jsx)(`rect`,{x:`269.928`,y:`339.04`,style:{fill:`#2D2D2D`},width:`20.304`,height:`19.016`})]}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{style:{fill:`#E0E0E0`},d:`M365.664,100.072v19.616h-135.24v-19.616H365.664 M367.624,98.112h-139.16v23.536h139.16 L367.624,98.112L367.624,98.112z`}),(0,d.jsx)(`rect`,{x:`341.312`,y:`98.112`,style:{fill:`#E0E0E0`},width:`26.312`,height:`23.536`})]}),(0,d.jsx)(`path`,{style:{fill:`#DB2B42`},d:`M207.656,121.648H173.2c-1.312,0-2.384-1.072-2.384-2.384v-18.768c0-1.312,1.072-2.384,2.384-2.384 h34.456c1.312,0,2.384,1.072,2.384,2.384v18.768C210.04,120.576,208.96,121.648,207.656,121.648z`}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M178.008,107.264h-2.784v-1.488h7.384v1.488h-2.816v8.28h-1.784L178.008,107.264L178.008,107.264z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M189.28,113.424c0,0.84,0.032,1.544,0.056,2.12h-1.568l-0.088-1.08h-0.024 c-0.304,0.504-1,1.232-2.264,1.232c-1.288,0-2.464-0.768-2.464-3.072v-4.144h1.784v3.84c0,1.176,0.384,1.936,1.32,1.936 c0.712,0,1.176-0.504,1.36-0.96c0.064-0.16,0.104-0.344,0.104-0.552v-4.264h1.784V113.424z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M191.144,115.544c0.032-0.48,0.064-1.264,0.064-1.984v-8.312h1.784v4.2h0.032 c0.432-0.672,1.2-1.128,2.256-1.128c1.728,0,2.96,1.432,2.944,3.584c0,2.536-1.608,3.8-3.208,3.8c-0.912,0-1.728-0.352-2.232-1.216 h-0.032l-0.088,1.056H191.144z M192.992,112.632c0,0.152,0.016,0.288,0.04,0.424c0.192,0.712,0.808,1.256,1.584,1.256 c1.12,0,1.8-0.904,1.8-2.32c0-1.256-0.592-2.264-1.784-2.264c-0.72,0-1.376,0.528-1.584,1.304 c-0.024,0.128-0.056,0.288-0.056,0.464V112.632z`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M200.952,112.512c0.04,1.28,1.04,1.832,2.176,1.832c0.824,0,1.416-0.12,1.96-0.32l0.264,1.232 c-0.616,0.248-1.456,0.44-2.472,0.44c-2.288,0-3.64-1.408-3.64-3.576c0-1.952,1.192-3.8,3.448-3.8c2.296,0,3.048,1.888,3.048,3.44 c0,0.336-0.032,0.592-0.056,0.752C205.68,112.512,200.952,112.512,200.952,112.512z M204.056,111.264 c0.016-0.648-0.272-1.728-1.464-1.728c-1.104,0-1.568,1.008-1.64,1.728H204.056z`})]}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M147.464,115.544v-4.072l-3.088-5.696h2.032l1.176,2.504c0.336,0.728,0.584,1.28,0.848,1.944h0.024 c0.248-0.624,0.52-1.232,0.856-1.944l1.176-2.504h2.016l-3.248,5.656v4.112H147.464z`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M158.864,111.944c0,2.6-1.824,3.76-3.624,3.76c-2,0-3.536-1.376-3.536-3.632 c0-2.328,1.52-3.744,3.656-3.744C157.464,108.32,158.864,109.8,158.864,111.944z M153.544,112.024c0,1.36,0.664,2.392,1.752,2.392 c1.016,0,1.728-1,1.728-2.424c0-1.104-0.496-2.368-1.712-2.368C154.056,109.624,153.544,110.84,153.544,112.024z`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M166.656,113.424c0,0.84,0.032,1.544,0.056,2.12h-1.568l-0.088-1.08h-0.024 c-0.304,0.504-1,1.232-2.264,1.232c-1.288,0-2.464-0.768-2.464-3.072v-4.144h1.784v3.84c0,1.176,0.384,1.936,1.32,1.936 c0.712,0,1.176-0.504,1.36-0.96c0.064-0.16,0.104-0.344,0.104-0.552v-4.264h1.784V113.424z`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M353.936,113.776c-3.096,0-5.616-2.52-5.616-5.616s2.52-5.616,5.616-5.616s5.616,2.52,5.616,5.616 C359.552,111.256,357.032,113.776,353.936,113.776z M353.936,103.816c-2.392,0-4.344,1.952-4.344,4.344s1.952,4.344,4.344,4.344 s4.344-1.952,4.344-4.344S356.328,103.816,353.936,103.816z`}),(0,d.jsx)(`rect`,{x:`356.02`,y:`113.813`,transform:`matrix(-0.6044 -0.7967 0.7967 -0.6044 484.7665 469.5985)`,style:{fill:`#2D2D2D`},width:`5.896`,height:`1.272`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M240.088,113.168c0.48,0.296,1.184,0.544,1.92,0.544c1.096,0,1.736-0.576,1.736-1.416 c0-0.768-0.44-1.216-1.56-1.648c-1.352-0.48-2.192-1.184-2.192-2.352c0-1.296,1.072-2.248,2.68-2.248 c0.848,0,1.464,0.192,1.832,0.4l-0.296,0.872c-0.272-0.152-0.824-0.392-1.576-0.392c-1.136,0-1.56,0.672-1.56,1.24 c0,0.776,0.504,1.152,1.648,1.6c1.4,0.544,2.12,1.216,2.12,2.432c0,1.28-0.952,2.392-2.904,2.392c-0.8,0-1.68-0.24-2.12-0.528 L240.088,113.168z`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M246.984,111.688c0.024,1.472,0.96,2.064,2.048,2.064c0.776,0,1.24-0.128,1.648-0.304l0.184,0.776 c-0.384,0.176-1.032,0.368-1.984,0.368c-1.832,0-2.928-1.208-2.928-3s1.056-3.216,2.792-3.216c1.952,0,2.464,1.704,2.464,2.808 c0,0.216-0.024,0.392-0.04,0.496h-4.184V111.688z M250.16,110.92c0.016-0.688-0.288-1.76-1.504-1.76 c-1.096,0-1.576,1.008-1.664,1.76H250.16z`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M255.88,114.472l-0.088-0.752h-0.032c-0.336,0.472-0.968,0.888-1.824,0.888 c-1.208,0-1.824-0.848-1.824-1.704c0-1.448,1.28-2.232,3.584-2.216v-0.128c0-0.488-0.136-1.384-1.36-1.384 c-0.552,0-1.128,0.176-1.552,0.448l-0.248-0.72c0.488-0.312,1.208-0.528,1.96-0.528c1.824,0,2.264,1.24,2.264,2.432v2.232 c0,0.52,0.024,1.024,0.104,1.424h-0.984V114.472z M255.72,111.44c-1.184-0.024-2.528,0.184-2.528,1.336 c0,0.704,0.472,1.032,1.024,1.032c0.776,0,1.272-0.488,1.44-1c0.04-0.112,0.064-0.24,0.064-0.344V111.44z`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M258.552,110.376c0-0.704-0.016-1.304-0.056-1.864h0.944l0.04,1.176h0.04 c0.272-0.8,0.928-1.304,1.656-1.304c0.12,0,0.2,0.008,0.304,0.032v1.024c-0.112-0.024-0.224-0.032-0.368-0.032 c-0.768,0-1.312,0.576-1.456,1.392c-0.024,0.144-0.056,0.312-0.056,0.496v3.176h-1.072v-4.096H258.552z`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M266.72,114.256c-0.288,0.152-0.912,0.344-1.72,0.344c-1.792,0-2.968-1.216-2.968-3.04 c0-1.84,1.264-3.168,3.208-3.168c0.64,0,1.208,0.168,1.504,0.304l-0.248,0.84c-0.264-0.152-0.664-0.28-1.264-0.28 c-1.368,0-2.104,1.008-2.104,2.248c0,1.384,0.888,2.232,2.064,2.232c0.616,0,1.024-0.168,1.328-0.296L266.72,114.256z`}),(0,d.jsx)(`path`,{style:{fill:`#2D2D2D`},d:`M268.016,105.736h1.08v3.712h0.024c0.176-0.304,0.448-0.576,0.776-0.76 c0.312-0.184,0.704-0.304,1.104-0.304c0.808,0,2.08,0.488,2.08,2.544v3.544H272v-3.424c0-0.96-0.352-1.768-1.376-1.768 c-0.704,0-1.264,0.488-1.456,1.08c-0.064,0.152-0.08,0.304-0.08,0.52v3.6h-1.08v-8.744H268.016z`})]})]})}function F(e){return(0,d.jsx)(`svg`,{width:`800px`,height:`800px`,viewBox:`0 0 73 73`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,...e,children:(0,d.jsx)(`g`,{id:`fundamentals/css/images`,stroke:`none`,strokeWidth:`1`,fill:`none`,fillRule:`evenodd`,children:(0,d.jsxs)(`g`,{id:`container`,transform:`translate(2.000000, 2.000000)`,fillRule:`nonzero`,children:[(0,d.jsx)(`rect`,{id:`mask`,stroke:`#000000`,strokeWidth:`2`,fill:`#424A60`,x:`-1`,y:`-1`,width:`71`,height:`71`,rx:`14`}),(0,d.jsx)(`circle`,{id:`Oval`,fill:`#EFCE4A`,cx:`21.069`,cy:`23.069`,r:`9.069`}),(0,d.jsx)(`polygon`,{id:`Shape`,fill:`#1A9172`,points:`69.5 56.7492553 68.1170213 55.212766 51.5212766 40 37 55.9042553 44.5828723 63.4871277 50.1382979 69.0425532 60.7455406 69.0425532 69.5 60.1780353`}),(0,d.jsx)(`polygon`,{id:`Shape`,fill:`#25AE88`,points:`47.8532188 64.0501875 33.8030313 50 12 69.1969687 53 69.1969687`}),(0,d.jsx)(`rect`,{id:`mask`,stroke:`#000000`,strokeWidth:`2`,x:`-1`,y:`-1`,width:`71`,height:`71`,rx:`14`})]})})})}function I(e){return(0,d.jsxs)(`svg`,{width:`800px`,height:`800px`,viewBox:`0 0 32 32`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,d.jsx)(`path`,{d:`M23.3 8.40007L21.82 6.40008C21.7248 6.27314 21.6008 6.17066 21.4583 6.10111C21.3157 6.03156 21.1586 5.99693 21 6.00008H11.2C11.0555 6.00007 10.9128 6.03135 10.7816 6.09177C10.6504 6.15219 10.5339 6.24031 10.44 6.35007L8.71998 8.35008C8.57227 8.53401 8.49435 8.76424 8.49998 9.00008V16.2901C8.50262 18.0317 9.19567 19.7013 10.4272 20.9328C11.6588 22.1644 13.3283 22.8574 15.07 22.8601H16.93C18.6716 22.8574 20.3412 22.1644 21.5728 20.9328C22.8043 19.7013 23.4973 18.0317 23.5 16.2901V9.00008C23.5 8.7837 23.4298 8.57317 23.3 8.40007Z`,fill:`#FFCC80`}),(0,d.jsx)(`path`,{d:`M29.78 28.38L25.78 23.38C25.664 23.2321 25.5086 23.1198 25.3318 23.0562C25.1549 22.9925 24.9637 22.98 24.78 23.02L16 25L7.21999 23C7.03632 22.96 6.84507 22.9725 6.6682 23.0362C6.49133 23.0998 6.33598 23.2121 6.21999 23.36L2.21999 28.36C2.10392 28.5064 2.03116 28.6823 2.00995 28.8679C1.98874 29.0534 2.01993 29.2413 2.09999 29.41C2.17815 29.5839 2.3044 29.7319 2.46385 29.8364C2.62331 29.9409 2.80933 29.9977 2.99999 30H29C29.1885 29.9995 29.373 29.9457 29.5322 29.8448C29.6914 29.744 29.8189 29.6002 29.9 29.43C29.98 29.2613 30.0112 29.0734 29.99 28.8879C29.9688 28.7023 29.8961 28.5264 29.78 28.38Z`,fill:`#01579B`}),(0,d.jsx)(`path`,{d:`M29.29 6.00003L16.29 2.00003C16.0999 1.95002 15.9001 1.95002 15.71 2.00003L2.71 6.00003C2.49742 6.06422 2.31226 6.19735 2.1837 6.37841C2.05515 6.55947 1.99052 6.77817 2 7.00003C1.9917 7.22447 2.0592 7.44518 2.19163 7.62659C2.32405 7.80799 2.5137 7.93954 2.73 8.00003L15.73 11.6C15.906 11.6534 16.094 11.6534 16.27 11.6L29.27 8.00003C29.4863 7.93954 29.6759 7.80799 29.8084 7.62659C29.9408 7.44518 30.0083 7.22447 30 7.00003C30.0095 6.77817 29.9448 6.55947 29.8163 6.37841C29.6877 6.19735 29.5026 6.06422 29.29 6.00003Z`,fill:`#01579B`}),(0,d.jsx)(`path`,{d:`M11.22 6C11.0756 5.99999 10.9328 6.03127 10.8016 6.09169C10.6704 6.15211 10.5539 6.24023 10.46 6.35L8.74 8.35C8.58509 8.53114 8.49998 8.76166 8.5 9V16.29C8.50264 18.0317 9.19569 19.7012 10.4272 20.9328C11.6588 22.1643 13.3283 22.8574 15.07 22.86H16V6H11.22Z`,fill:`#FFE0B2`}),(0,d.jsx)(`path`,{d:`M7.21999 23C7.03632 22.96 6.84507 22.9725 6.6682 23.0362C6.49133 23.0998 6.33598 23.2121 6.21999 23.36L2.21999 28.36C2.10392 28.5064 2.03116 28.6823 2.00995 28.8679C1.98874 29.0534 2.01993 29.2413 2.09999 29.41C2.17815 29.5839 2.3044 29.7319 2.46385 29.8364C2.62331 29.9409 2.80933 29.9977 2.99999 30H16V25L7.21999 23Z`,fill:`#0277BD`}),(0,d.jsx)(`path`,{d:`M15.71 2.00002L2.71 6.00002C2.49742 6.06422 2.31226 6.19734 2.1837 6.3784C2.05515 6.55947 1.99052 6.77817 2 7.00002C1.9917 7.22447 2.0592 7.44518 2.19163 7.62658C2.32405 7.80799 2.5137 7.93954 2.73 8.00002L15.73 11.6C15.8194 11.6146 15.9106 11.6146 16 11.6V2.00002C15.9039 1.98469 15.8061 1.98469 15.71 2.00002Z`,fill:`#0277BD`}),(0,d.jsx)(`path`,{d:`M2.73 8.00003L8.5 9.56003V16.29C8.50264 18.0317 9.19569 19.7013 10.4272 20.9328C11.6588 22.1643 13.3283 22.8574 15.07 22.86H16.93C18.6717 22.8574 20.3412 22.1643 21.5728 20.9328C22.8043 19.7013 23.4974 18.0317 23.5 16.29V9.56003L29.27 8.00003C29.4863 7.93954 29.6759 7.80799 29.8084 7.62659C29.9408 7.44518 30.0083 7.22447 30 7.00003C30.0095 6.77817 29.9448 6.55947 29.8163 6.37841C29.6877 6.19735 29.5026 6.06422 29.29 6.00003L16.29 2.00003C16.0999 1.95002 15.9001 1.95002 15.71 2.00003L2.71 6.00003C2.49742 6.06422 2.31226 6.19735 2.1837 6.37841C2.05515 6.55947 1.99052 6.77817 2 7.00003C1.9917 7.22447 2.0592 7.44518 2.19163 7.62659C2.32405 7.80799 2.5137 7.93954 2.73 8.00003ZM21.5 16.29C21.4974 17.5013 21.015 18.6621 20.1586 19.5186C19.3021 20.3751 18.1412 20.8574 16.93 20.86H15.07C13.8588 20.8574 12.6979 20.3751 11.8414 19.5186C10.985 18.6621 10.5026 17.5013 10.5 16.29V10.11L15.73 11.56C15.906 11.6134 16.094 11.6134 16.27 11.56L21.5 10.11V16.29ZM16 4.05003L25.44 7.00003L16 9.56003L6.56 7.00003L16 4.05003Z`,fill:`#263238`}),(0,d.jsx)(`path`,{d:`M25.78 23.38C25.664 23.2321 25.5086 23.1198 25.3318 23.0562C25.1549 22.9925 24.9637 22.98 24.78 23.02L16 25L7.21999 23C7.03632 22.96 6.84507 22.9725 6.6682 23.0362C6.49133 23.0998 6.33598 23.2121 6.21999 23.36L2.21999 28.36C2.10392 28.5064 2.03116 28.6823 2.00995 28.8679C1.98874 29.0534 2.01993 29.2413 2.09999 29.41C2.17815 29.5839 2.3044 29.7319 2.46385 29.8364C2.62331 29.9409 2.80933 29.9977 2.99999 30H29C29.1885 29.9995 29.373 29.9457 29.5322 29.8448C29.6914 29.744 29.8189 29.6002 29.9 29.43C29.98 29.2613 30.0112 29.0734 29.99 28.8879C29.9688 28.7023 29.8961 28.5264 29.78 28.38L25.78 23.38ZM5.07999 28L7.38999 25.11L15.78 27C15.9251 27.0299 16.0748 27.0299 16.22 27L24.61 25.13L26.92 28H5.07999Z`,fill:`#263238`})]})}function L(e){return(0,d.jsxs)(`svg`,{height:`800px`,width:`800px`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,viewBox:`0 0 503.322 503.322`,...e,children:[(0,d.jsx)(`path`,{style:{fill:`#FBC176`},d:`M0,73.763v130.169c0,6.942,6.075,13.017,13.017,13.017h225.627c6.942,0,13.017-6.075,13.017-13.017 V73.763c0-6.942-6.075-13.017-13.017-13.017H13.017C6.075,60.746,0,66.82,0,73.763`}),(0,d.jsx)(`path`,{style:{fill:`#C39A6E`},d:`M225.627,60.746V39.051c0-6.942-6.075-13.017-13.017-13.017h-69.424L121.492,0H30.373 c-6.942,0-13.017,6.075-13.017,13.017v47.729H225.627z`}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M86.78,104.136H34.712c-5.207,0-8.678-3.471-8.678-8.678c0-5.207,3.471-8.678,8.678-8.678H86.78 c5.207,0,8.678,3.471,8.678,8.678C95.458,100.664,91.986,104.136,86.78,104.136`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M86.78,138.847H34.712c-5.207,0-8.678-3.471-8.678-8.678s3.471-8.678,8.678-8.678H86.78 c5.207,0,8.678,3.471,8.678,8.678S91.986,138.847,86.78,138.847`})]}),(0,d.jsx)(`path`,{style:{fill:`#FBC176`},d:`M251.661,360.136v130.169c0,6.942,6.075,13.017,13.017,13.017h225.627 c6.942,0,13.017-6.075,13.017-13.017V360.136c0-6.942-6.075-13.017-13.017-13.017H264.678 C257.736,347.119,251.661,353.193,251.661,360.136`}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M338.441,390.508h-52.068c-5.207,0-8.678-3.471-8.678-8.678s3.471-8.678,8.678-8.678h52.068 c5.207,0,8.678,3.471,8.678,8.678S343.647,390.508,338.441,390.508`}),(0,d.jsx)(`path`,{style:{fill:`#FFFFFF`},d:`M338.441,425.22h-52.068c-5.207,0-8.678-3.471-8.678-8.678c0-5.207,3.471-8.678,8.678-8.678h52.068 c5.207,0,8.678,3.471,8.678,8.678C347.119,421.749,343.647,425.22,338.441,425.22`})]}),(0,d.jsx)(`path`,{style:{fill:`#F38774`},d:`M208.271,451.254H78.102c-5.207,0-8.678-3.471-8.678-8.678V260.339c0-5.207,3.471-8.678,8.678-8.678 c5.207,0,8.678,3.471,8.678,8.678v173.559h121.492c5.207,0,8.678,3.471,8.678,8.678 C216.949,447.783,213.478,451.254,208.271,451.254`}),(0,d.jsx)(`path`,{style:{fill:`#26B999`},d:`M433.898,277.695c-5.207,0-8.678-3.471-8.678-8.678V95.458H295.051c-5.207,0-8.678-3.471-8.678-8.678 c0-5.207,3.471-8.678,8.678-8.678h138.847c5.207,0,8.678,3.471,8.678,8.678v182.237 C442.576,274.224,439.105,277.695,433.898,277.695`}),(0,d.jsx)(`path`,{style:{fill:`#C39A6E`},d:`M477.288,347.119v-21.695c0-6.942-6.075-13.017-13.017-13.017h-69.424l-21.695-26.034h-91.119 c-6.942,0-13.017,6.075-13.017,13.017v47.729H477.288z`})]})}function R(e){return(0,d.jsxs)(`svg`,{height:`800px`,width:`800px`,viewBox:`0 0 128 128`,xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,className:`iconify iconify--noto`,preserveAspectRatio:`xMidYMid meet`,...e,children:[(0,d.jsx)(`path`,{d:`M106 24.79H22.15c-1.92 0-3.48 1.56-3.48 3.48v57.59c0 1.92 1.56 3.48 3.48 3.48H106c1.92 0 3.48-1.56 3.48-3.48V28.27c0-1.92-1.55-3.48-3.48-3.48z`,fill:`#b7d5e5`}),(0,d.jsxs)(`radialGradient`,{id:`IconifyId17ecdb2904d178eab9910`,cx:`48.408`,cy:`13.024`,r:`75.465`,gradientTransform:`matrix(1 0 0 1.0843 0 -10.19)`,gradientUnits:`userSpaceOnUse`,children:[(0,d.jsx)(`stop`,{offset:`0`,stopColor:`#2f7889`}),(0,d.jsx)(`stop`,{offset:`1`,stopColor:`#424242`})]}),(0,d.jsx)(`path`,{fill:`url(#IconifyId17ecdb2904d178eab9910)`,d:`M104.75 83.2H23.4l.96-52.27h79.43z`}),(0,d.jsx)(`path`,{d:`M121.09 123.82H7.59c-.43 0-.83-.03-1.2-.09c-2.88-.44-4.21-4.18-2.5-6.74l.39-.59h119.59l.4.6c1.86 2.78.12 6.76-3.04 6.81c-.04.01-.09.01-.14.01z`,fill:`#2f7889`}),(0,d.jsx)(`path`,{d:`M106.84 90.41H20.6c-1.27 0-2.54.77-3.25 1.99l-14 25.48c-.59.88-.01 2.12.99 2.12H123.8c1 0 1.58-1.24.99-2.12l-14.71-25.63c-.7-1.08-1.97-1.84-3.24-1.84z`,fill:`#eee`}),(0,d.jsx)(`path`,{fill:`#b7d5e5`,d:`M86.36 115.52H41.8l2.85-7.98h39.07z`}),(0,d.jsxs)(`g`,{opacity:`0.57`,fill:`#69a1ba`,children:[(0,d.jsx)(`path`,{d:`M72.69 94.84l-.27-2.2h-3.44l.13 2.2z`}),(0,d.jsx)(`path`,{d:`M67.14 94.84l-.14-2.2h-3.45v2.2z`}),(0,d.jsx)(`path`,{d:`M93.61 94.84l-.81-2.2h-3.26l.68 2.2z`}),(0,d.jsx)(`path`,{d:`M88.36 94.84l-.68-2.2h-3.32l.54 2.2z`}),(0,d.jsx)(`path`,{d:`M83.18 94.84l-.54-2.2h-3.37l.41 2.2z`}),(0,d.jsx)(`path`,{d:`M102.11 94.84l-.95-2.2h-6.71l.82 2.2z`}),(0,d.jsx)(`path`,{d:`M77.61 94.84l-.41-2.2h-3.41l.28 2.2z`}),(0,d.jsx)(`path`,{d:`M33.76 94.84l.68-2.2h-3.26l-.81 2.2z`}),(0,d.jsx)(`path`,{d:`M50.51 94.84l.27-2.2h-3.41l-.4 2.2z`}),(0,d.jsx)(`path`,{d:`M39.35 94.84l.54-2.2h-3.32l-.67 2.2z`}),(0,d.jsx)(`path`,{d:`M28.17 94.84l.81-2.2H25.8l-.95 2.2z`}),(0,d.jsx)(`path`,{d:`M44.93 94.84l.41-2.2h-3.37l-.54 2.2z`}),(0,d.jsx)(`path`,{d:`M56.08 94.84l.14-2.2h-3.44l-.27 2.2z`}),(0,d.jsx)(`path`,{d:`M61.65 94.84v-2.2H58.2l-.14 2.2z`}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{d:`M83.78 103.73H44.36l-.75 2.2h41.08z`}),(0,d.jsx)(`path`,{d:`M102.15 105.93l-1.21-2.2h6.54l.95 2.2z`}),(0,d.jsx)(`path`,{d:`M86.75 105.93l-.83-2.2h6.29l.96 2.2z`}),(0,d.jsx)(`path`,{d:`M95.39 105.93l-.96-2.2h4.31l1.1 2.2z`}),(0,d.jsx)(`path`,{d:`M25.67 105.93l1.21-2.2h-6.54l-.95 2.2z`}),(0,d.jsx)(`path`,{d:`M41.07 105.93l.83-2.2h-6.29l-.96 2.2z`}),(0,d.jsx)(`path`,{d:`M32.42 105.93l.97-2.2h-4.31l-1.11 2.2z`})]}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{d:`M29.71 98.51l.82-2.19h-6.67l-.95 2.19z`}),(0,d.jsx)(`path`,{d:`M97.95 98.51l-.81-2.19h6.66l.95 2.19z`}),(0,d.jsx)(`path`,{d:`M96.25 98.51l-.96-2.19h-3.85l.82 2.19z`}),(0,d.jsx)(`path`,{d:`M86.23 98.51l-.65-2.19h3.85l.78 2.19z`}),(0,d.jsx)(`path`,{d:`M80.19 98.51l-.47-2.19h3.85l.6 2.19z`}),(0,d.jsx)(`path`,{d:`M74.15 98.51l-.28-2.19h3.84l.43 2.19z`}),(0,d.jsx)(`path`,{d:`M68.12 98.51l-.11-2.19h3.85l.24 2.19z`}),(0,d.jsx)(`path`,{d:`M62.08 98.51l.07-2.19H66l.06 2.19z`}),(0,d.jsx)(`path`,{d:`M56.04 98.51l.25-2.19h3.85l-.11 2.19z`}),(0,d.jsx)(`path`,{d:`M50.01 98.51l.42-2.19h3.85l-.29 2.19z`}),(0,d.jsx)(`path`,{d:`M43.97 98.51l.6-2.19h3.85l-.47 2.19z`}),(0,d.jsx)(`path`,{d:`M37.93 98.51l.78-2.19h3.85l-.64 2.19z`}),(0,d.jsx)(`path`,{d:`M31.9 98.51l.95-2.19h3.85l-.82 2.19z`})]}),(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`path`,{d:`M29.7 102.22l.81-2.2h-8.75l-.95 2.2z`}),(0,d.jsx)(`path`,{d:`M95.87 102.22l-.77-2.2h-4.17l.64 2.2z`}),(0,d.jsx)(`path`,{d:`M84.93 102.22l-.48-2.2h4.16l.62 2.2z`}),(0,d.jsx)(`path`,{d:`M78.28 102.22l-.32-2.2h4.17l.45 2.2z`}),(0,d.jsx)(`path`,{d:`M71.64 102.22l-.17-2.2h4.17l.3 2.2z`}),(0,d.jsx)(`path`,{d:`M65 102.22l-.01-2.2h4.16l.15 2.2z`}),(0,d.jsx)(`path`,{d:`M58.36 102.22l.14-2.2h4.17l-.01 2.2z`}),(0,d.jsx)(`path`,{d:`M51.71 102.22l.3-2.2h4.17l-.17 2.2z`}),(0,d.jsx)(`path`,{d:`M45.07 102.22l.46-2.2h4.16l-.32 2.2z`}),(0,d.jsx)(`path`,{d:`M38.43 102.22l.61-2.2h4.17l-.48 2.2z`}),(0,d.jsx)(`path`,{d:`M31.78 102.22l.77-2.2h4.17l-.63 2.2z`}),(0,d.jsx)(`path`,{d:`M97.47 102.22l-.82-2.2h8.75l.95 2.2z`})]})]}),(0,d.jsx)(`path`,{d:`M124.73 117.88L110.39 92.4c-.71-1.07-1.98-1.84-3.25-1.84c0 0 1.22 1.1 1.59 1.63l12.59 23.59c.56 1.02-.18 2.26-1.34 2.26H7.96c-1.15 0-1.89-1.23-1.35-2.24l11.95-23.18c.35-.6 1.88-1.99 1.88-1.99h-.45c-1.27 0-2.54.77-3.25 1.99L3.28 117.88c-.59.88-.01 2.12.99 2.12h119.46c1.01 0 1.59-1.24 1-2.12z`,fill:`#b7d5e5`}),(0,d.jsx)(`path`,{fill:`none`,stroke:`#eee`,strokeWidth:`2.936`,strokeLinecap:`round`,strokeMiterlimit:`10`,d:`M25.97 28.02h13.21`}),(0,d.jsx)(`path`,{d:`M109.37 30.11c0-1.04-1.01-1.12-1.01.11v55.8c0 1.34-1.09 2.43-2.43 2.43H22.08c-1.34 0-2.43-1.09-2.43-2.43v-55.8c0-1.23-1.01-1.15-1.01-.11l-.95 55.91c0 2.42 1.24 4.39 4.39 4.39h83.85c2.73 0 4.39-1.97 4.39-4.39l-.95-55.91z`,fill:`#75a7bc`})]})}var z=[{code:`general`,icon:M,name:`Web`},{code:`news`,icon:N,name:`News`},{code:`videos`,icon:P,name:`Videos`},{code:`images`,icon:F,name:`Images`},{code:`science`,icon:I,name:`Academic`},{code:`files`,icon:L,name:`Files`},{code:`it`,icon:R,name:`Tech`}],ee=z.filter(e=>[`general`,`news`,`videos`,`images`,`science`,`files`].includes(e.code)),te=({sources:e,query:t})=>{let[r,i]=(0,n.useState)(`general`),[a,o]=(0,n.useState)(e),[u,f]=(0,n.useState)(!1),[p,m]=(0,n.useState)(!1),[h,g]=(0,n.useState)(1),[_,v]=(0,n.useState)(!0),[y,b]=(0,n.useState)(!1),x=(0,n.useRef)(null),S=(0,n.useRef)(!1),C=(0,n.useRef)(!1),{openPanel:w,isOpen:T}=A(),[D,k]=(0,n.useState)({});(0,n.useEffect)(()=>{let e=()=>{b(window.innerWidth>=1024)};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,n.useEffect)(()=>{o(e),i(`general`),g(1),v(!0),k({}),j(e)},[e]);let j=(0,n.useCallback)(async e=>{let t=e.filter(e=>e.metadata.url&&e.metadata.url!==`File`&&!e.metadata.iframe_src);for(let e of t)try{let{data:t}=await(0,c.getArticle)({query:{url:e.metadata.url}});t?.cached&&t?.article?.html&&k(t=>({...t,[e.metadata.url]:`loaded`}))}catch{}},[]);(0,n.useEffect)(()=>{if(typeof window<`u`){let e=new URLSearchParams(window.location.search).get(`extract`);e&&(w(decodeURIComponent(e),``),C.current=!1)}},[w]),(0,n.useEffect)(()=>{C.current=!1},[e]),(0,n.useEffect)(()=>{S.current&&!T&&(C.current=!0),S.current=T},[T]),(0,n.useEffect)(()=>{if(y&&a&&a.length>0&&!T&&!C.current){let e=a[0];e?.metadata?.url&&w(e.metadata.url,``)}},[a,y]);let M=async(e,t)=>{e.preventDefault(),C.current=!1,k(e=>({...e,[t]:`loading`})),w(t,``);try{await(0,c.getArticle)({query:{url:t}}),k(e=>({...e,[t]:`loaded`}))}catch{k(e=>({...e,[t]:`loaded`}))}},N=(0,n.useCallback)(async()=>{if(!t||p||!_)return;m(!0);let e=h+1,{data:n}=await(0,c.agentSearch)({query:{q:t,cat:r,page:e}}),i=n?.results??[];if(i.length===0){v(!1),m(!1);return}let a=i.map(e=>{if(e.url)try{let t=new URL(e.url);(t.pathname===`/`||t.pathname===``)&&console.warn(`[MessageSources] Search result URL is domain-only:`,e.url,`Title:`,e.title)}catch{console.error(`[MessageSources] Invalid URL in search result:`,e.url)}return{pageContent:e.snippet||e.content||``,metadata:{title:e.title||``,source:e.source||``,thumbnail:e.thumbnail||``,url:e.url||``,...e.thumbnail&&{thumbnail:e.thumbnail}}}});o(e=>[...e,...a]),g(e),m(!1)},[t,r,h,p,_]),P=async e=>{if(!(e===r||!t)){i(e),f(!0),g(1),v(!0);try{let{data:n}=await(0,c.agentSearch)({query:{q:t,cat:e,page:1}}),r=(n?.results??[]).map(e=>{if(e.url)try{let t=new URL(e.url);(t.pathname===`/`||t.pathname===``)&&console.warn(`[MessageSources] Category search result URL is domain-only:`,e.url,`Title:`,e.title)}catch{console.error(`[MessageSources] Invalid URL in category search result:`,e.url)}return{pageContent:e.snippet||e.content||``,metadata:{title:e.title||``,source:e.source||``,thumbnail:e.thumbnail||``,url:e.url||``,...e.img_src&&{img_src:e.img_src},...e.thumbnail&&{thumbnail:e.thumbnail},...e.iframe_src&&{iframe_src:e.iframe_src}}}});o(r)}catch(e){console.error(`Error searching:`,e)}finally{f(!1)}}};(0,n.useEffect)(()=>{let e=x.current;if(!e)return;let t=()=>{let{scrollTop:t,scrollHeight:n,clientHeight:r}=e;n-t-r<100&&N()};return e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)},[N]);let F=(e,t)=>{let n=r===`images`,i=r===`videos`,a=e.metadata.img_src||e.metadata.thumbnail;if(n&&a)return(0,d.jsx)(`div`,{className:`relative rounded-lg group`,children:(0,d.jsxs)(`a`,{className:`relative block overflow-hidden rounded-lg cursor-pointer`,href:e.metadata.url,onClick:t=>M(t,e.metadata.url),children:[(0,d.jsx)(`img`,{src:a,alt:e.metadata.title,className:`w-full h-auto object-cover rounded-lg hover:scale-105 transition-transform duration-200`,loading:`lazy`}),(0,d.jsxs)(`div`,{className:`absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/70 to-transparent p-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200`,children:[(0,d.jsx)(`p`,{className:`text-xs text-white line-clamp-2`,children:(0,l.convertURLSafeHTMLToHTML)(e.metadata.title)}),(0,d.jsx)(`p`,{className:`text-[10px] text-white/70 truncate mt-0.5`,children:e.metadata.source})]})]})},t);if(i&&a)return(0,d.jsxs)(`div`,{className:`relative rounded-xl`,children:[(0,d.jsx)(O,{spread:40,glow:!0,disabled:!1,proximity:64,inactiveZone:.01,borderWidth:2}),(0,d.jsxs)(`a`,{className:`relative bg-card text-card-foreground border border-border rounded-xl overflow-hidden flex flex-col cursor-pointer shadow-sm hover:shadow-md transition-all duration-200`,href:e.metadata.url,target:`_blank`,rel:`noopener noreferrer`,children:[(0,d.jsxs)(`div`,{className:`relative`,children:[(0,d.jsx)(`img`,{src:a,alt:e.metadata.title,className:`w-full h-24 object-cover`}),(0,d.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,d.jsx)(`div`,{className:`w-10 h-10 bg-black/60 rounded-full flex items-center justify-center`,children:(0,d.jsx)(s.Video,{size:18,className:`text-white ml-0.5`})})})]}),(0,d.jsx)(`p`,{className:`text-xs line-clamp-2 p-2 text-muted-foreground`,children:(0,l.convertURLSafeHTMLToHTML)(e.metadata.title)})]})]},t);let o=D[e.metadata.url];return(0,d.jsxs)(`div`,{className:`relative rounded-xl group h-full`,children:[(0,d.jsx)(O,{spread:40,glow:!0,disabled:!1,proximity:64,inactiveZone:.01,borderWidth:2}),(0,d.jsxs)(`div`,{className:`relative bg-card text-card-foreground border border-border rounded-xl p-2.5 flex flex-col font-medium cursor-pointer shadow-sm hover:shadow-md transition-all duration-200 h-full`,onClick:t=>M(t,e.metadata.url),children:[o&&(0,d.jsx)(`div`,{className:`absolute top-1.5 left-1.5 p-1 rounded-md bg-background/80 backdrop-blur-sm z-[5]`,children:o===`loading`?(0,d.jsx)(s.Loader2,{size:14,className:`text-primary animate-spin`}):(0,d.jsx)(s.FileText,{size:14,className:`text-green-500`})}),(0,d.jsx)(`a`,{href:e.metadata.url,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),className:`absolute top-1.5 right-1.5 p-1 rounded-md bg-secondary/50 opacity-0 group-hover:opacity-100 transition-opacity hover:bg-secondary z-10`,title:`Open in new tab`,children:(0,d.jsx)(s.ExternalLink,{size:12,className:`text-muted-foreground`})}),(0,d.jsxs)(`p`,{className:`text-xs line-clamp-4 text-muted-foreground`,children:[(0,d.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-semibold text-foreground/70 align-middle`,children:[e.metadata.url===`File`?(0,d.jsx)(`span`,{className:`inline-flex items-center justify-center w-3.5 h-3.5 rounded-full bg-secondary flex-shrink-0`,children:(0,d.jsx)(s.File,{size:10,className:`text-muted-foreground`})}):(0,d.jsx)(`img`,{src:`https://s2.googleusercontent.com/s2/favicons?domain_url=${e.metadata.url}`,width:20,height:20,alt:`favicon`,className:`inline rounded h-5 w-5 flex-shrink-0`}),e.metadata.source]}),` `,(0,d.jsx)(`span`,{className:`align-middle`,children:(0,l.convertURLSafeHTMLToHTML)(e.metadata.title)})]})]})]},t)};return(0,d.jsxs)(d.Fragment,{children:[t&&(0,d.jsx)(`div`,{className:`flex items-center gap-1 mb-3 overflow-x-auto pb-1`,children:ee.map(e=>(0,d.jsxs)(`button`,{onClick:()=>P(e.code),disabled:u,className:E(`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-all duration-200 whitespace-nowrap`,r===e.code?`bg-primary text-primary-foreground`:`bg-secondary/50 text-muted-foreground hover:bg-secondary hover:text-foreground`),children:[(0,d.jsx)(e.icon,{className:`w-4 h-4 flex-shrink-0`}),(0,d.jsx)(`span`,{children:e.name})]},e.code))}),(0,d.jsx)(`div`,{ref:x,className:E(`overflow-y-auto pb-2 pr-1`,r===`images`?`max-h-[400px] lg:max-h-[500px]`:`max-h-[180px] lg:max-h-[280px]`),children:u?(0,d.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,d.jsx)(s.Loader2,{className:`w-6 h-6 animate-spin text-muted-foreground`})}):a.length>0?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`div`,{className:E(r===`images`?`columns-2 sm:columns-3 lg:columns-4 gap-2 [&>div]:mb-2 [&>div]:break-inside-avoid`:E(`grid gap-3 auto-rows-fr`,T&&y?`grid-cols-2`:`grid-cols-3`)),children:a.map((e,t)=>F(e,t))}),p&&(0,d.jsx)(`div`,{className:`flex items-center justify-center py-4`,children:(0,d.jsx)(s.Loader2,{className:`w-5 h-5 animate-spin text-muted-foreground`})}),!_&&a.length>0&&(0,d.jsx)(`div`,{className:`flex items-center justify-center py-4 text-muted-foreground text-xs`,children:`No more results`})]}):(0,d.jsx)(`div`,{className:`flex items-center justify-center py-8 text-muted-foreground text-sm`,children:`No results found`})})]})},B={extract:`Extract`,arxiv:`ArXiv`,"google scholar":`Scholar`,pubmed:`PubMed`,wolframalpha:`Wolfram`,youtube:`YouTube`,Web:`Web`};function ne(e){return e?B[e]??e:`Web`}function V({queries:e,loading:t}){let n=e.filter(e=>e.status===`done`).length,r=e.length,i=t&&e.some(e=>e.status===`running`);return t?(0,d.jsxs)(`div`,{className:`rounded-xl border border-border bg-secondary/20 overflow-hidden text-sm`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border/50`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground`,children:[i?(0,d.jsx)(s.Loader2,{className:`w-3.5 h-3.5 animate-spin`}):(0,d.jsx)(s.Search,{className:`w-3.5 h-3.5`}),(0,d.jsx)(`span`,{className:`font-medium text-foreground`,children:i?`Running analysis…`:`Analysis complete`})]}),r>0&&(0,d.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[n,`/`,r,` searches`]})]}),e.length>0&&(0,d.jsx)(`div`,{className:`divide-y divide-border/40`,children:e.map((e,t)=>(0,d.jsxs)(`div`,{className:`flex items-center gap-2.5 px-3 py-2`,children:[e.status===`running`?(0,d.jsx)(s.Loader2,{className:`w-3.5 h-3.5 text-muted-foreground animate-spin flex-shrink-0`}):(0,d.jsx)(s.Search,{className:E(`w-3.5 h-3.5 flex-shrink-0`,e.status===`done`?`text-muted-foreground`:`text-muted-foreground/40`)}),(0,d.jsxs)(`div`,{className:`flex items-baseline gap-1.5 min-w-0 flex-1`,children:[(0,d.jsxs)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap flex-shrink-0`,children:[ne(e.category),` ·`]}),(0,d.jsx)(`span`,{className:`text-foreground/80 truncate`,children:e.query})]})]},t))})]}):null}var H=null,re=`onnx-community/Kokoro-82M-v1.0-ONNX`,U={device:`webgpu`,dtype:`fp32`},ie={device:`wasm`,dtype:`q8`},ae=null,W=null;function oe(){return typeof navigator<`u`&&`gpu`in navigator}async function se(){if(!oe())return!1;try{return await navigator.gpu.requestAdapter()!=null}catch{return!1}}async function ce(){if(!H)try{H=(await import(`kokoro-js`)).KokoroTTS}catch(e){throw console.warn(`Kokoro.js not available, will use server-side TTS:`,e instanceof Error?e.message:String(e)),Error(`Kokoro.js library not available`)}let e=[];await se()&&e.push(U),e.push(ie);let t;for(let n of e)try{let e=await H.from_pretrained(re,{device:n.device,dtype:n.dtype});return W=n.device,e}catch(e){t=e,console.warn(`Kokoro model failed to load on "${n.device}" backend:`,e)}throw t instanceof Error?t:Error(`Failed to load Kokoro model`)}async function le(){return ae||=ce().catch(e=>{throw ae=null,e}),ae}async function G(){return le()}async function ue(){return(await G()).list_voices()}function de(){return W}function K(e,t){let[r,i]=(0,n.useState)(`stopped`),a=(0,n.useRef)(null),o=(0,n.useRef)(null),s=(0,n.useRef)(null),c=(0,n.useRef)(t);c.current=t;let l=(0,n.useCallback)(()=>{a.current&&=(a.current.pause(),a.current.src.startsWith(`blob:`)&&URL.revokeObjectURL(a.current.src),null),s.current?.abort(),s.current=null},[]),u=(0,n.useCallback)(()=>{if(!(`speechSynthesis`in window))return!1;try{window.speechSynthesis.cancel();let t=new SpeechSynthesisUtterance(e);return o.current=t,t.onend=()=>{o.current=null,i(`stopped`)},t.onerror=()=>{o.current=null,i(`stopped`)},window.speechSynthesis.speak(t),i(`started`),!0}catch{return!1}},[e]);return{speechStatus:r,start:(0,n.useCallback)(async()=>{if(!e?.trim())return;l(),window.speechSynthesis?.cancel(),o.current=null,i(`started`);let t=new AbortController;s.current=t;try{if(localStorage.getItem(`useTTSKokoro`)!==`false`)try{let t=await G(),n=localStorage.getItem(`kokoroVoice`)||`af_heart`,r=(await t.generate(e.slice(0,5e3),{voice:n})).toWav(),o=new Blob([r],{type:`audio/wav`}),s=URL.createObjectURL(o),c=new Audio(s);a.current=c,c.onended=()=>{i(`stopped`),URL.revokeObjectURL(s),a.current=null},c.onerror=()=>{URL.revokeObjectURL(s),a.current=null,u()||i(`stopped`)},await c.play();return}catch(e){console.debug(`Kokoro TTS unavailable, using server-side TTS:`,e instanceof Error?e.message:String(e))}let n=await(0,f.default)(`/api/agent/voice`,{method:`POST`,body:{text:e.slice(0,5e3),voice:localStorage.getItem(`kokoroVoice`)||`af_heart`},signal:t.signal}),r=typeof n.blob==`function`?await n.blob():n;if(!r||r.size===0){u()||i(`stopped`);return}let o=URL.createObjectURL(r),s=new Audio(o);a.current=s,s.onended=()=>{i(`stopped`),URL.revokeObjectURL(o),a.current=null},s.onerror=()=>{URL.revokeObjectURL(o),a.current=null,u()||i(`stopped`)},await s.play()}catch{u()||i(`stopped`)}},[e,l,u]),stop:(0,n.useCallback)(()=>{l(),o.current=null,window.speechSynthesis?.cancel(),i(`stopped`)},[l])}}var fe=async(e,t,n)=>{let r=localStorage.getItem(`chatModelKey`),i=localStorage.getItem(`chatModelProviderId`),a=(await(0,f.default)(`/api/agent/providers`))?.providers||[];if(!a||a.length===0){t(!0);return}let o=a.find(e=>e.id===i&&(e.chatModels?.length??0)>0);if(o||=a.find(e=>e.name.toLowerCase().includes(`openrouter`)&&(e.chatModels?.length??0)>0)||a.find(e=>e.name.toLowerCase().includes(`nvidia`)&&(e.chatModels?.length??0)>0)||a.find(e=>(e.chatModels?.length??0)>0),!o){t(!0);return}i=o.id;let s=o.chatModels.find(e=>e.key===r);if(s||(o.name.toLowerCase().includes(`openrouter`)&&(s=o.chatModels.find(e=>e.key===`openrouter/free`)),!s&&o.name.toLowerCase().includes(`openrouter`)&&(s=o.chatModels.find(e=>e.key===`nvidia/nemotron-3-super-120b-a12b:free`)),s||=o.chatModels.find(e=>(e.key.toLowerCase().includes(`nemotron-3-super`)||e.name.toLowerCase().includes(`nemotron 3 super`))&&e.key.toLowerCase().includes(`120b`)),s||=o.chatModels.find(e=>e.key.toLowerCase().includes(`nemotron`)||e.name.toLowerCase().includes(`nemotron`)),s||=o.chatModels[0]),!s){t(!0);return}r=s.key,localStorage.setItem(`chatModelKey`,r),localStorage.setItem(`chatModelProviderId`,i),e({key:r,providerId:i}),t(!0)},pe=`qwksearch_guest_chats`,me=typeof window<`u`;function he(){if(!me)return[];try{let e=localStorage.getItem(pe);return e?JSON.parse(e).sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()):[]}catch(e){return console.error(`Failed to get guest chats:`,e),[]}}function ge(e){return me&&he().find(t=>t.id===e)||null}function _e(e){if(me)try{let t=he(),n=t.findIndex(t=>t.id===e.id);n>=0?t[n]=e:t.push(e),localStorage.setItem(pe,JSON.stringify(t))}catch(e){console.error(`Failed to save guest chat:`,e)}}function ve(e){if(me)try{let t=he().filter(t=>t.id!==e);localStorage.setItem(pe,JSON.stringify(t))}catch(e){console.error(`Failed to delete guest chat:`,e)}}function ye(){if(me)try{localStorage.removeItem(pe)}catch(e){console.error(`Failed to clear guest chats:`,e)}}var be=async(e,t,n,r,i,a,o,s,l)=>{if(!t){let t=ge(e);if(t){n(t.messages);let e=t.messages.filter(e=>e.role===`user`||e.role===`assistant`),o=e.map(e=>[e.role,e.content]);e.length>0&&(document.title=e[0].content),s(t.files||[]),l((t.files||[]).map(e=>e.fileId)),i(o),a(t.focusMode),r(!0);return}try{let{data:t,error:u}=await(0,c.getChatById)({path:{id:e}});if(u){let e=u.status;if(e===404||e===403){o(!0),r(!0);return}throw Error(`Failed to load chat: ${u.message}`)}let{messages:d,chat:f}=t||{};if(!d||!f){o(!0),r(!0);return}n(d);let p=d.filter(e=>e.role===`user`||e.role===`assistant`),m=p.map(e=>[e.role,e.content]);p.length>0&&(document.title=p[0].content);let h=f.files.map(e=>({fileName:e.name,fileExtension:e.name.split(`.`).pop(),fileId:e.fileId}));s(h),l(h.map(e=>e.fileId)),i(m),a(f.focusMode),r(!0);return}catch(e){console.error(`[chatMessages] Failed to load public chat:`,e),o(!0),r(!0);return}}try{let{data:t,error:u}=await(0,c.getChatById)({path:{id:e}});if(u){let e=u.status;if(e===404||e===401||e===403){o(!0),r(!0);return}throw Error(`Failed to load chat: ${u.message}`)}let{messages:d,chat:f}=t||{};if(!d||!f){o(!0),r(!0);return}n(d);let p=d.filter(e=>e.role===`user`||e.role===`assistant`),m=p.map(e=>[e.role,e.content]);console.debug(new Date,`app:messages_loaded`),p.length>0&&(document.title=p[0].content);let h=f.files.map(e=>({fileName:e.name,fileExtension:e.name.split(`.`).pop(),fileId:e.fileId}));s(h),l(h.map(e=>e.fileId)),i(m),a(f.focusMode),r(!0)}catch(e){console.error(`[chatMessages] Failed to load chat:`,e),o(!0),r(!0)}},xe=e=>{let t=[];return e.forEach((n,r)=>{if(n.role===`user`){let i=e.findIndex((e,t)=>t>r&&e.role===`user`),a=e.find((e,t)=>t>r&&e.role===`assistant`&&(i===-1||t<i)),o=e.find((e,t)=>t>r&&e.role===`source`&&e.sources&&(i===-1||t<i)),s=e.find((e,t)=>t>r&&e.role===`searching`&&(i===-1||t<i)),c=!1,l=a?.content??``,u=a?.content??``,d=[];if(a){let t=/\[([^\]]+)\]/g,n=/\[(\d+)\]/g;if(l.includes(`<think>`)){let e=l.match(/<think>/g)?.length||0,t=l.match(/<\/think>/g)?.length||0;e&&!t&&(l+=`</think> <a> </a>`)}a.content.includes(`</think>`)&&(c=!0),o&&o.sources&&o.sources.length>0?(l=l.replace(t,(e,t)=>t.split(`,`).map(e=>e.trim()).map(e=>{let t=parseInt(e);if(isNaN(t)||t<=0)return`[${e}]`;let n=(o.sources?.[t-1])?.metadata?.url;return n?`<citation href="${n}">${e}</citation>`:``}).join(``)),u=a.content.replace(n,``)):(l=l.replace(n,``),u=a.content.replace(n,``));let s=e.find((e,t)=>t>r&&e.role===`suggestion`&&(i===-1||t<i));s&&s.suggestions.length>0&&(d=s.suggestions)}t.push({userMessage:n,assistantMessage:a,sourceMessage:o,searchingMessage:s,parsedAssistantMessage:l,speechMessage:u,thinkingEnded:c,suggestions:d})}}),t},Se=async e=>{let t=localStorage.getItem(`chatModelKey`),n=localStorage.getItem(`chatModelProviderId`),r=parseInt(localStorage.getItem(`maxFollowupQuestions`)||`4`),i=e.filter(e=>e.role===`user`||e.role===`assistant`);try{let e=await(0,f.default)(`agent/suggestions`,{method:`POST`,body:JSON.stringify({chatHistory:i,chatModel:{providerId:n,key:t},maxQuestions:r})});return Array.isArray(e.suggestions)?e.suggestions:[]}catch{return[]}},Ce=3,we=()=>Array.from(crypto.getRandomValues(new Uint8Array(7)),e=>e.toString(16).padStart(2,`0`)).join(``),Te=`sourceExtractionEnabled`,Ee=`thinkingTimeLimit`;async function De(e,n){let{message:r,messageId:i,rewrite:a=!1}=e,{chatId:o,loading:s,messages:l,fileIds:u,focusMode:d,category:m,optimizationMode:h,chatHistory:g,chatModelProvider:_,isAuthenticated:v,messagesRef:y,abortControllerRef:b,setLoading:x,setMessageAppeared:S,setMessages:C,setChatHistory:w,setChatModelProvider:T}=n,E=typeof window<`u`&&localStorage.getItem(Te)===`true`,D=typeof window<`u`&&Number(localStorage.getItem(Ee)??`0`)||0;if(s||!r)return;let O=new AbortController;b.current=O,x(!0),S(!1),l.length<=1&&window.history.replaceState(null,``,`/c/${o}`);let k=``,A=!1,j=!1,M=[],N=Date.now(),P=D>0,F=``,I=``,L=i??we();C(e=>[...e,{content:r,messageId:L,chatId:o,role:`user`,createdAt:new Date}]);let R=async e=>{if(e.type===`error`){let t=e.data;typeof t==`string`&&(t.includes(`no longer available`)||t.includes(`deprecated`)||t.includes(`410`))&&(localStorage.removeItem(`chatModelKey`),localStorage.removeItem(`chatModelProviderId`),T?.({key:``,providerId:``})),p.toast.error(t),x(!1);return}if(e.type===`searching`){let t=e.data;C(n=>{let r=n.findIndex(t=>t.messageId===e.messageId&&t.role===`searching`);return r===-1?[...n,{role:`searching`,messageId:e.messageId,chatId:o,createdAt:new Date,queries:[{query:t.query,category:t.category,status:t.status}]}]:n.map((e,n)=>{if(n!==r)return e;let i=e,a=i.queries.findIndex(e=>e.query===t.query);if(a===-1)return{...i,queries:[...i.queries,{query:t.query,category:t.category,status:t.status}]};let o=i.queries.map((e,n)=>n===a?{...e,status:t.status}:e);return{...i,queries:o}})})}if(e.type===`sources`&&(M=e.data||[],C(t=>[...t,{messageId:e.messageId,chatId:o,role:`source`,sources:M,createdAt:new Date}]),M.length>0&&(S(!0),M.slice(0,Ce).forEach(e=>{let t=e?.metadata?.url;t&&t!==`File`&&(0,f.default)(`doc/article?url=${encodeURIComponent(t)}`).catch(()=>{})}))),e.type===`message`&&(k+=e.data,P?(F+=e.data,I||=e.messageId,A=!0):A?C(t=>t.map(t=>t.messageId===e.messageId&&t.role===`assistant`?{...t,content:t.content+e.data}:t)):(C(t=>[...t,{content:e.data,messageId:e.messageId,chatId:o,role:`assistant`,createdAt:new Date}]),A=!0,S(!0))),e.type===`messageEnd`){let e=async()=>{P&&F&&(C(e=>[...e,{content:F,messageId:I,chatId:o,role:`assistant`,createdAt:new Date}]),S(!0)),w(e=>[...e,[`human`,r],[`assistant`,k]]),x(!1);let e=y.current[y.current.length-1];if(t.researchAgentUIConfig.getAutoMediaSearch()&&(document.getElementById(`search-images-${e.messageId}`)?.click(),document.getElementById(`search-videos-${e.messageId}`)?.click()),!j){j=!0;let e=await Se(y.current),t=we();if(C(n=>[...n,{role:`suggestion`,suggestions:e,chatId:o,createdAt:new Date,messageId:t}]),v&&e.length>0)try{await(0,c.saveMessage)({body:{chatId:o,messageId:t,role:`suggestion`,suggestions:e}})}catch(e){console.error(`Failed to save suggestions:`,e)}}};if(P){let e=Date.now()-N,t=D*1e3-e;t>0&&await new Promise(e=>setTimeout(e,t))}await e()}},z=l.findIndex(e=>e.messageId===L);try{let{stream:e}=await(0,c.agentChat)({signal:O.signal,body:{message:{messageId:L,chatId:o,content:r},optimizationMode:h,focusMode:d,category:m,history:a?g.slice(0,z===-1?void 0:z):g,files:u,chatModel:{key:_.key,providerId:_.providerId},sourceExtractionEnabled:E,thinkingTimeLimit:D,systemInstructions:localStorage.getItem(`systemInstructions`)??void 0},onSseError:e=>{if((e instanceof Error?e.message:String(e)).includes(`401`)&&v){p.toast.error(`Your session has expired. Please sign in again.`),x(!1),window.location.href=`/`;return}p.toast.error(`Failed to send message. Please try again.`),x(!1)}});for await(let t of e)await R(t)}catch(e){if(e.name===`AbortError`){P&&F&&(C(e=>[...e,{content:F,messageId:I,chatId:o,role:`assistant`,createdAt:new Date}]),S(!0)),k&&w(e=>[...e,[`human`,r],[`assistant`,k]]),x(!1),b.current=null;return}throw e}b.current=null}function Oe(e){let[t,r]=(0,n.useState)(e),[i,a]=(0,n.useState)(!1),[o,s]=(0,n.useState)(!1),[c,l]=(0,n.useState)(!1),[u,d]=(0,n.useState)(!1),[f,p]=(0,n.useState)(!1),[m,h]=(0,n.useState)(!1),[g,_]=(0,n.useState)(!1),[v,y]=(0,n.useState)(!1),[b,x]=(0,n.useState)([]),[S,C]=(0,n.useState)([]),[w,T]=(0,n.useState)([]),[E,D]=(0,n.useState)([]),[O,k]=(0,n.useState)(`webSearch`),[A,j]=(0,n.useState)(`general`),[M,N]=(0,n.useState)(`speed`),[P,F]=(0,n.useState)({key:``,providerId:``}),I=(0,n.useRef)([]),L=(0,n.useMemo)(()=>S.filter(e=>e.role===`user`||e.role===`assistant`),[S]),R=(0,n.useMemo)(()=>xe(S),[S]);return{state:{chatId:t,newChatCreated:i,loading:o,messageAppeared:c,chatHistory:b,messages:S,files:w,fileIds:E,focusMode:O,category:A,optimizationMode:M,isMessagesLoaded:u,notFound:v,chatModelProvider:P,isConfigReady:f,hasError:m,isReady:g},setters:{setChatId:r,setNewChatCreated:a,setLoading:s,setMessageAppeared:l,setChatHistory:x,setMessages:C,setFiles:T,setFileIds:D,setFocusMode:k,setCategory:j,setOptimizationMode:N,setIsMessagesLoaded:d,setNotFound:y,setChatModelProvider:F,setIsConfigReady:p,setHasError:h,setIsReady:_},messagesRef:I,chatTurns:L,sections:R}}var ke=(0,n.createContext)({chatHistory:[],chatId:``,fileIds:[],files:[],focusMode:``,category:``,hasError:!1,isMessagesLoaded:!1,isReady:!1,loading:!1,messageAppeared:!1,messages:[],chatTurns:[],sections:[],notFound:!1,optimizationMode:``,chatModelProvider:{key:``,providerId:``},rewrite:()=>{},sendMessage:async()=>{},setFileIds:()=>{},setFiles:()=>{},setFocusMode:()=>{},setCategory:()=>{},setOptimizationMode:()=>{},setChatModelProvider:()=>{},stopStreaming:()=>{},newChat:()=>{},incognito:!1,setIncognito:()=>{}});function q(){return(0,n.useContext)(ke)}var Ae=(0,n.createContext)({user:null,isLoading:!0,isAuthenticated:!1,signIn:()=>{},signOut:async()=>{}});function je({children:e,authClient:t}){let[r,i]=(0,n.useState)(null),[a,o]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{(async()=>{try{let{data:e}=await t.getSession();i(e?.user??null)}catch(e){console.error(`Failed to fetch session:`,e),i(null)}finally{o(!1)}})()},[]),(0,n.useEffect)(()=>{a||r||t.oneTap({fetchOptions:{onSuccess:async()=>{let{data:e}=await t.getSession();i(e?.user??null)}}})},[a,r]),(0,d.jsx)(Ae.Provider,{value:{user:r,isLoading:a,isAuthenticated:!!r,signIn:()=>{t.signIn.social({provider:`google`,callbackURL:`/`})},signOut:async()=>{try{await t.signOut({fetchOptions:{onSuccess:()=>{i(null),window.location.href=`/`}}})}catch(e){console.error(`Sign out failed:`,e)}}},children:e})}function Me(){let e=(0,n.useContext)(Ae);if(!e)throw Error(`useSession must be used within SessionProvider`);return e}function Ne({children:e}){let t=(0,r.useParams)(),i=(0,r.useSearchParams)(),a=(0,r.useRouter)(),o=i.get(`q`),{isAuthenticated:s,isLoading:c}=Me(),{state:l,setters:u,messagesRef:f,chatTurns:p,sections:m}=Oe(t.chatId),h=(0,n.useRef)(null),[g,_]=(0,n.useState)(!1);(0,n.useEffect)(()=>{fe(u.setChatModelProvider,u.setIsConfigReady,u.setHasError)},[]),(0,n.useEffect)(()=>{t.chatId&&t.chatId!==l.chatId&&(u.setChatId(t.chatId),u.setMessages([]),u.setChatHistory([]),u.setFiles([]),u.setFileIds([]),u.setIsMessagesLoaded(!1),u.setNotFound(!1),u.setNewChatCreated(!1))},[t.chatId,l.chatId]),(0,n.useEffect)(()=>{if(l.chatId&&!l.newChatCreated&&!l.isMessagesLoaded&&l.messages.length===0){if(c)return;be(l.chatId,s,u.setMessages,u.setIsMessagesLoaded,u.setChatHistory,u.setFocusMode,u.setNotFound,u.setFiles,u.setFileIds)}else l.chatId||(u.setNewChatCreated(!0),u.setIsMessagesLoaded(!0),u.setChatId(crypto.randomUUID()))},[l.chatId,l.isMessagesLoaded,l.newChatCreated,l.messages.length,s,c]),(0,n.useEffect)(()=>{if(!g&&!s&&l.chatId&&l.messages.length>0){let e=l.messages.filter(e=>e.role===`user`||e.role===`assistant`);if(e.length>0){let t=e[0].content.slice(0,50);_e({id:l.chatId,title:t,createdAt:new Date().toISOString(),focusMode:l.focusMode,files:l.files,messages:l.messages})}}},[l.messages,l.chatId,s,l.focusMode,l.files]),(0,n.useEffect)(()=>{f.current=l.messages},[l.messages]),(0,n.useEffect)(()=>{l.isMessagesLoaded&&l.isConfigReady?(u.setIsReady(!0),console.debug(new Date,`app:ready`)):u.setIsReady(!1)},[l.isMessagesLoaded,l.isConfigReady]),(0,n.useEffect)(()=>{l.isReady&&o&&l.isConfigReady&&v(o)},[l.isConfigReady,l.isReady,o]);let v=(0,n.useCallback)(async(e,t,n=!1)=>{l.chatId&&await De({message:e,messageId:t,rewrite:n},{chatId:l.chatId,loading:l.loading,messages:l.messages,fileIds:l.fileIds,focusMode:l.focusMode,category:l.category,optimizationMode:l.optimizationMode,chatHistory:l.chatHistory,chatModelProvider:l.chatModelProvider,isAuthenticated:s,messagesRef:f,abortControllerRef:h,setLoading:u.setLoading,setMessageAppeared:u.setMessageAppeared,setMessages:u.setMessages,setChatHistory:u.setChatHistory,setChatModelProvider:u.setChatModelProvider})},[l.chatId,l.loading,l.messages,l.fileIds,l.focusMode,l.category,l.optimizationMode,l.chatHistory,l.chatModelProvider,s,f]),y=(0,n.useCallback)(e=>{let t=l.messages.findIndex(t=>t.messageId===e),n=p.findIndex(t=>t.messageId===e);if(t===-1)return;let r=p[n-1];u.setMessages(e=>[...e.slice(0,l.messages.length>2?l.messages.indexOf(r):0)]),u.setChatHistory(e=>[...e.slice(0,p.length>2?n-1:0)]),v(r.content,r.messageId,!0)},[l.messages,p,v]),b=(0,n.useCallback)(()=>{h.current&&=(h.current.abort(),null)},[]),x=(0,n.useCallback)(()=>{b(),u.setMessages([]),u.setChatHistory([]),u.setFiles([]),u.setFileIds([]),u.setChatId(void 0),u.setNewChatCreated(!1),u.setIsMessagesLoaded(!1),u.setNotFound(!1),a.push(`/`)},[b,a]),S={messages:l.messages,chatTurns:p,sections:m,chatHistory:l.chatHistory,files:l.files,fileIds:l.fileIds,focusMode:l.focusMode,category:l.category,chatId:l.chatId,hasError:l.hasError,isMessagesLoaded:l.isMessagesLoaded,isReady:l.isReady,loading:l.loading,messageAppeared:l.messageAppeared,notFound:l.notFound,optimizationMode:l.optimizationMode,chatModelProvider:l.chatModelProvider,incognito:g,setFileIds:u.setFileIds,setFiles:u.setFiles,setFocusMode:u.setFocusMode,setCategory:u.setCategory,setOptimizationMode:u.setOptimizationMode,rewrite:y,sendMessage:v,setChatModelProvider:u.setChatModelProvider,stopStreaming:b,newChat:x,setIncognito:_};return(0,d.jsx)(ke.Provider,{value:S,children:e})}function Pe({delayDuration:e=0,...t}){return(0,d.jsx)(m.Provider,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function J({...e}){return(0,d.jsx)(Pe,{children:(0,d.jsx)(m.Root,{"data-slot":`tooltip`,...e})})}function Y({...e}){return(0,d.jsx)(m.Trigger,{"data-slot":`tooltip-trigger`,...e})}function X({className:e,sideOffset:t=0,children:n,...r}){return(0,d.jsx)(m.Portal,{children:(0,d.jsxs)(m.Content,{"data-slot":`tooltip-content`,sideOffset:t,className:E(`bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-2xl px-3 py-1.5 text-xs text-balance`,e),...r,children:[n,(0,d.jsx)(m.Arrow,{className:`bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]`})]})})}var Fe=({href:e,children:t,sources:r})=>{let{openPanel:i}=A(),a=(0,n.useMemo)(()=>!r||!e?null:r.find(t=>t.metadata?.url===e)??null,[r,e]),o=(0,n.useMemo)(()=>{try{return new URL(e).hostname.replace(`www.`,``)}catch{return a?.metadata?.source||``}},[e,a]),s=a?.metadata?.title||``,c=`https://s2.googleusercontent.com/s2/favicons?domain_url=${e}`;return(0,d.jsxs)(J,{children:[(0,d.jsx)(Y,{asChild:!0,children:(0,d.jsx)(`a`,{href:e,onClick:t=>{t.preventDefault(),i(e,``)},className:`bg-light-secondary dark:bg-dark-secondary px-1 rounded ml-1 no-underline text-xs text-black/70 dark:text-white/70 relative cursor-pointer hover:bg-black/10 dark:hover:bg-white/20 transition-colors`,children:t})}),(0,d.jsx)(X,{side:`top`,className:`max-w-72 p-2.5`,children:(0,d.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,d.jsx)(`img`,{src:c,alt:``,width:16,height:16,className:`rounded flex-shrink-0 mt-0.5`}),(0,d.jsxs)(`div`,{className:`min-w-0`,children:[(0,d.jsx)(`p`,{className:`text-xs font-medium leading-snug line-clamp-2`,children:s||o}),s&&(0,d.jsx)(`p`,{className:`text-[10px] opacity-70 truncate mt-0.5`,children:o})]})]})})]})},Ie=({content:e,thinkingEnded:t})=>{let[r,i]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{i(!t)},[t]),(0,d.jsxs)(`div`,{className:`my-4 bg-secondary/50 rounded-xl border border-border overflow-hidden`,children:[(0,d.jsxs)(`button`,{onClick:()=>i(!r),className:`w-full flex items-center justify-between px-4 py-1 text-foreground/90 hover:bg-secondary transition duration-200`,children:[(0,d.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,d.jsx)(s.BrainCircuit,{size:20,className:`text-accent-foreground`}),(0,d.jsx)(`p`,{className:`font-medium text-sm`,children:`Thinking Process`})]}),r?(0,d.jsx)(s.ChevronUp,{size:18,className:`text-muted-foreground`}):(0,d.jsx)(s.ChevronDown,{size:18,className:`text-muted-foreground`})]}),r&&(0,d.jsx)(`div`,{className:`px-4 py-3 text-foreground/80 text-sm border-t border-border bg-muted/50 whitespace-pre-wrap`,children:e})]})},Le=({children:e,thinkingEnded:t})=>(0,d.jsx)(Ie,{content:e,thinkingEnded:t}),Re=({section:e,isExpanded:t,setIsExpanded:r,isEditing:i,setIsEditing:a,editText:o,setEditText:c,handleEditSubmit:l,copiedUserMsg:u,handleCopyUserMsg:f})=>{let p=(0,n.useRef)(null);return(0,d.jsxs)(`div`,{className:`w-full pt-8 break-words`,children:[(0,d.jsxs)(`button`,{onClick:()=>r(!t),className:`flex items-center gap-3 group text-left w-full`,children:[(0,d.jsx)(`div`,{className:`flex-shrink-0 p-1.5 rounded-lg bg-secondary/50 group-hover:bg-secondary transition-colors duration-200`,children:t?(0,d.jsx)(s.ChevronDown,{size:18,className:`text-muted-foreground group-hover:text-foreground transition-colors`}):(0,d.jsx)(s.ChevronRight,{size:18,className:`text-muted-foreground group-hover:text-foreground transition-colors`})}),(0,d.jsx)(`h2`,{className:`text-foreground font-medium text-lg lg:text-3xl lg:w-9/12 group-hover:text-foreground/80 transition-colors line-clamp-3 lg:line-clamp-none`,children:e.userMessage.content})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-0.5 mt-1 ml-10`,children:[(0,d.jsxs)(J,{children:[(0,d.jsx)(Y,{asChild:!0,children:(0,d.jsx)(`button`,{onClick:f,className:`p-1.5 text-muted-foreground rounded-lg hover:bg-secondary transition-all duration-200 hover:text-foreground`,children:(0,d.jsx)(`span`,{className:E(`flex items-center transition-all duration-300`,u?`scale-110`:`scale-100`),children:u?(0,d.jsx)(s.Check,{size:14,className:`text-green-500`}):(0,d.jsx)(s.ClipboardList,{size:14})})})}),(0,d.jsx)(X,{side:`bottom`,children:u?`Copied!`:`Copy prompt`})]}),(0,d.jsxs)(J,{children:[(0,d.jsx)(Y,{asChild:!0,children:(0,d.jsx)(`button`,{onClick:()=>{c(e.userMessage.content),a(!0),setTimeout(()=>p.current?.focus(),50)},className:`p-1.5 text-muted-foreground rounded-lg hover:bg-secondary transition-all duration-200 hover:text-foreground`,children:(0,d.jsx)(s.Pencil,{size:14})})}),(0,d.jsx)(X,{side:`bottom`,children:`Edit & resubmit`})]})]}),i&&(0,d.jsxs)(`div`,{className:`mt-3 ml-10 flex flex-col gap-2`,children:[(0,d.jsx)(`textarea`,{ref:p,value:o,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),l()),e.key===`Escape`&&a(!1)},rows:3,className:`w-full rounded-xl border border-border bg-background p-3 text-sm resize-none focus:outline-none focus:ring-2 focus:ring-primary/30 transition-colors`}),(0,d.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,d.jsx)(`button`,{onClick:()=>a(!1),className:`px-3 py-1.5 text-sm text-muted-foreground rounded-lg hover:bg-secondary transition-colors duration-200`,children:`Cancel`}),(0,d.jsx)(`button`,{onClick:l,disabled:!o.trim(),className:`px-3 py-1.5 text-sm bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200`,children:`Resubmit`})]})]})]})};function ze({...e}){return(0,d.jsx)(h.Root,{"data-slot":`dropdown-menu`,...e})}function Be({...e}){return(0,d.jsx)(h.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function Ve({className:e,sideOffset:t=4,...n}){return(0,d.jsx)(h.Portal,{children:(0,d.jsx)(h.Content,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:E(`bg-card text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-2xl border p-1 shadow-md`,e),...n})})}function Z({className:e,inset:t,variant:n=`default`,...r}){return(0,d.jsx)(h.Item,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:E(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-2xl px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r})}function He({className:e,children:t,checked:n,...r}){return(0,d.jsxs)(h.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,className:E(`focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-2xl py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...r,children:[(0,d.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,d.jsx)(h.ItemIndicator,{children:(0,d.jsx)(s.CheckIcon,{className:`size-4`})})}),t]})}function Ue({className:e,inset:t,...n}){return(0,d.jsx)(h.Label,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:E(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function Q({className:e,...t}){return(0,d.jsx)(h.Separator,{"data-slot":`dropdown-menu-separator`,className:E(`bg-border -mx-1 my-1 h-px`,e),...t})}function We({...e}){return(0,d.jsx)(h.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function Ge({className:e,inset:t,children:n,...r}){return(0,d.jsxs)(h.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:E(`focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-2xl px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8`,e),...r,children:[n,(0,d.jsx)(s.ChevronRightIcon,{className:`ml-auto size-4`})]})}function Ke({className:e,...t}){return(0,d.jsx)(h.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:E(`bg-card text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-2xl border p-1 shadow-lg`,e),...t})}var qe=({section:e,initialMessage:t})=>{let[r,i]=(0,n.useState)(!1);return(0,d.jsxs)(J,{children:[(0,d.jsx)(Y,{asChild:!0,children:(0,d.jsx)(`button`,{onClick:()=>{let n=`${t}${e?.sourceMessage?.sources&&e.sourceMessage.sources.length>0&&`\n\nCitations:\n${e.sourceMessage.sources?.map((e,t)=>`[${t+1}] ${e.metadata.url}`).join(`
17
17
  `)}`}`;navigator.clipboard.writeText(n),i(!0),setTimeout(()=>i(!1),1e3)},className:`p-2 text-muted-foreground rounded-full backdrop-blur-md bg-white/10 dark:bg-black/10 hover:bg-white/20 dark:hover:bg-black/20 transition duration-200 hover:text-foreground`,children:r?(0,d.jsx)(s.Check,{size:18}):(0,d.jsx)(s.ClipboardList,{size:18})})}),(0,d.jsx)(X,{side:`bottom`,children:r?`Copied!`:`Copy`})]})};function Je({...e}){return(0,d.jsx)(g.Root,{"data-slot":`popover`,...e})}function Ye({...e}){return(0,d.jsx)(g.Trigger,{"data-slot":`popover-trigger`,...e})}function Xe({className:e,align:t=`center`,sideOffset:n=4,container:r,...i}){return(0,d.jsx)(g.Portal,{container:r,children:(0,d.jsx)(g.Content,{"data-slot":`popover-content`,align:t,sideOffset:n,className:E(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-2xl border p-4 shadow-md outline-hidden`,e),...i})})}var $={Plus:s.Plus,Paperclip:s.Paperclip,Cloud:s.Cloud,Upload:s.Upload,File:s.File,SquarePen:s.SquarePen,Thinking:e=>(0,d.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,d.jsx)(`path`,{d:`M10.3857 2.50977C14.3486 2.71054 17.5 5.98724 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 9.72386 2.72386 9.5 3 9.5C3.27614 9.5 3.5 9.72386 3.5 10C3.5 13.5899 6.41015 16.5 10 16.5C13.5899 16.5 16.5 13.5899 16.5 10C16.5 6.5225 13.7691 3.68312 10.335 3.50879L10 3.5L9.89941 3.49023C9.67145 3.44371 9.5 3.24171 9.5 3C9.5 2.72386 9.72386 2.5 10 2.5L10.3857 2.50977ZM10 5.5C10.2761 5.5 10.5 5.72386 10.5 6V9.69043L13.2236 11.0527C13.4706 11.1762 13.5708 11.4766 13.4473 11.7236C13.3392 11.9397 13.0957 12.0435 12.8711 11.9834L12.7764 11.9473L9.77637 10.4473C9.60698 10.3626 9.5 10.1894 9.5 10V6C9.5 5.72386 9.72386 5.5 10 5.5ZM3.66211 6.94141C4.0273 6.94159 4.32303 7.23735 4.32324 7.60254C4.32324 7.96791 4.02743 8.26446 3.66211 8.26465C3.29663 8.26465 3 7.96802 3 7.60254C3.00021 7.23723 3.29676 6.94141 3.66211 6.94141ZM4.95605 4.29395C5.32146 4.29404 5.61719 4.59063 5.61719 4.95605C5.6171 5.3214 5.3214 5.61709 4.95605 5.61719C4.59063 5.61719 4.29403 5.32146 4.29395 4.95605C4.29395 4.59057 4.59057 4.29395 4.95605 4.29395ZM7.60254 3C7.96802 3 8.26465 3.29663 8.26465 3.66211C8.26446 4.02743 7.96791 4.32324 7.60254 4.32324C7.23736 4.32302 6.94159 4.0273 6.94141 3.66211C6.94141 3.29676 7.23724 3.00022 7.60254 3Z`})}),SelectArrow:s.ChevronDown,ArrowUp:s.ArrowUp,X:s.X,FileText:s.FileText,Loader2:s.Loader2,Check:s.Check,Archive:s.Archive,Mic:s.Mic,Stop:s.Square,Clock:e=>(0,d.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`currentColor`,...e,children:(0,d.jsx)(`path`,{d:`M10.3857 2.50977C14.3486 2.71054 17.5 5.98724 17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 9.72386 2.72386 9.5 3 9.5C3.27614 9.5 3.5 9.72386 3.5 10C3.5 13.5899 6.41015 16.5 10 16.5C13.5899 16.5 16.5 13.5899 16.5 10C16.5 6.5225 13.7691 3.68312 10.335 3.50879L10 3.5L9.89941 3.49023C9.67145 3.44371 9.5 3.24171 9.5 3C9.5 2.72386 9.72386 2.5 10 2.5L10.3857 2.50977ZM10 5.5C10.2761 5.5 10.5 5.72386 10.5 6V9.69043L13.2236 11.0527C13.4706 11.1762 13.5708 11.4766 13.4473 11.7236C13.3392 11.9397 13.0957 12.0435 12.8711 11.9834L12.7764 11.9473L9.77637 10.4473C9.60698 10.3626 9.5 10.1894 9.5 10V6C9.5 5.72386 9.72386 5.5 10 5.5ZM3.66211 6.94141C4.0273 6.94159 4.32303 7.23735 4.32324 7.60254C4.32324 7.96791 4.02743 8.26446 3.66211 8.26465C3.29663 8.26465 3 7.96802 3 7.60254C3.00021 7.23723 3.29676 6.94141 3.66211 6.94141ZM4.95605 4.29395C5.32146 4.29404 5.61719 4.59063 5.61719 4.95605C5.6171 5.3214 5.3214 5.61709 4.95605 5.61719C4.59063 5.61719 4.29403 5.32146 4.29395 4.95605C4.29395 4.59057 4.59057 4.29395 4.95605 4.29395ZM7.60254 3C7.96802 3 8.26465 3.29663 8.26465 3.66211C8.26446 4.02743 7.96791 4.32324 7.60254 4.32324C7.23736 4.32302 6.94159 4.0273 6.94141 3.66211C6.94141 3.29676 7.23724 3.00022 7.60254 3Z`})})},Ze=({messageId:e})=>{let{rewrite:t,chatModelProvider:r,setChatModelProvider:i}=q(),[a,o]=(0,n.useState)([]),[l,u]=(0,n.useState)(!0),[f,p]=(0,n.useState)(``),[m,h]=(0,n.useState)(!1);(0,n.useEffect)(()=>{m&&(async()=>{try{u(!0);let{data:e}=await(0,c.listProviders)();o(e?.providers??[])}catch(e){console.error(`Error loading providers:`,e)}finally{u(!1)}})()},[m]);let g=(0,n.useMemo)(()=>{if(!r?.providerId)return a;let e=a.findIndex(e=>e.id===r.providerId);return e===-1?a:[a[e],...a.filter((t,n)=>n!==e)]},[a,r]).map(e=>({...e,chatModels:(e.chatModels??[]).filter(t=>t.name.toLowerCase().includes(f.toLowerCase())||e.name.toLowerCase().includes(f.toLowerCase()))})).filter(e=>e.chatModels.length>0),_=(0,n.useMemo)(()=>{if(!r.key)return`Rewrite`;for(let e of a){let t=e.chatModels.find(e=>e.key===r.key);if(t)return t.name}return r.key},[a,r.key]),v=(n,r)=>{i({providerId:n,key:r}),localStorage.setItem(`chatModelProviderId`,n),localStorage.setItem(`chatModelKey`,r),h(!1),t(e)};return(0,d.jsxs)(Je,{open:m,onOpenChange:h,children:[(0,d.jsxs)(J,{children:[(0,d.jsx)(Y,{asChild:!0,children:(0,d.jsx)(Ye,{asChild:!0,children:(0,d.jsx)(`button`,{className:`p-2 text-muted-foreground rounded-full backdrop-blur-md bg-white/10 dark:bg-black/10 hover:bg-white/20 dark:hover:bg-black/20 transition duration-200 hover:text-foreground`,children:(0,d.jsx)(s.ArrowLeftRight,{size:18})})})}),(0,d.jsxs)(X,{side:`bottom`,children:[`Rewrite with `,_]})]}),(0,d.jsx)(Xe,{className:`w-[280px] p-0`,align:`start`,side:`top`,sideOffset:8,children:(0,d.jsxs)(`div`,{className:`bg-white dark:bg-[#212121] max-h-[400px] border rounded-2xl border-[#DDDDDD] dark:border-[#30302E] w-full flex flex-col shadow-2xl overflow-hidden`,children:[(0,d.jsx)(`div`,{className:`p-3 border-b border-[#EEEEEE] dark:border-[#30302E]`,children:(0,d.jsxs)(`div`,{className:`relative`,children:[(0,d.jsx)(s.Search,{size:14,className:`absolute left-3 top-1/2 -translate-y-1/2 text-text-400 dark:text-[#999999]`}),(0,d.jsx)(`input`,{type:`text`,placeholder:`Search models...`,value:f,onChange:e=>p(e.target.value),className:`w-full pl-9 pr-3 py-2 text-[13px] bg-bg-100 dark:bg-[#30302E] border border-bg-300 dark:border-[#404040] rounded-lg text-text-100 dark:text-[#ECECEC] placeholder:text-text-400 dark:placeholder:text-[#999999] focus:outline-none focus:ring-2 focus:ring-sky-500/20 focus:border-sky-500/30 transition-all`})]})}),(0,d.jsx)(`div`,{className:`max-h-[320px] overflow-y-auto`,children:l?(0,d.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,d.jsx)($.Loader2,{className:`animate-spin text-text-400 dark:text-[#999999]`,size:20})}):g.length===0?(0,d.jsx)(`div`,{className:`text-center py-12 px-4 text-text-400 dark:text-[#999999] text-sm`,children:f?`No models found`:`No chat models configured`}):(0,d.jsx)(`div`,{className:`flex flex-col`,children:g.map((e,t)=>(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`div`,{className:`px-4 py-2 sticky top-0 bg-white dark:bg-[#212121] border-b border-[#EEEEEE]/50 dark:border-[#30302E]/50`,children:(0,d.jsx)(`p`,{className:`text-[11px] text-text-400 dark:text-[#999999] uppercase tracking-wider font-medium`,children:e.name})}),(0,d.jsx)(`div`,{className:`flex flex-col px-1.5 py-1.5 space-y-0.5`,children:e.chatModels.map(t=>(0,d.jsxs)(`button`,{onClick:()=>v(e.id,t.key),type:`button`,className:E(`px-3 py-2 flex items-center justify-between text-start duration-200 cursor-pointer transition rounded-xl group`,r?.providerId===e.id&&r?.key===t.key?`bg-sky-50 dark:bg-sky-500/10`:`hover:bg-bg-100 dark:hover:bg-[#30302E]`),children:[(0,d.jsxs)(`div`,{className:`flex items-center space-x-2.5 min-w-0 flex-1`,children:[(0,d.jsx)(s.Cpu,{size:14,className:E(`shrink-0`,r?.providerId===e.id&&r?.key===t.key?`text-sky-500`:`text-text-400 dark:text-[#999999] group-hover:text-text-300 dark:group-hover:text-[#B4B4B4]`)}),(0,d.jsx)(`p`,{className:E(`text-[13px] truncate`,r?.providerId===e.id&&r?.key===t.key?`text-sky-600 dark:text-sky-400 font-medium`:`text-text-200 dark:text-[#ECECEC] group-hover:text-text-100 dark:group-hover:text-white`),children:t.name})]}),r?.providerId===e.id&&r?.key===t.key&&(0,d.jsx)($.Check,{className:`w-4 h-4 text-sky-500 shrink-0`})]},t.key))}),t<g.length-1&&(0,d.jsx)(`div`,{className:`h-px bg-[#EEEEEE] dark:bg-[#30302E] mx-2`})]},e.id))})})]})})]})},Qe=new Map;function $e(e){if(typeof window>`u`)return Promise.reject(Error(`CDN scripts require a browser environment`));let t=Qe.get(e);if(t)return t;let n=new Promise((t,n)=>{let r=document.querySelector(`script[data-cdn-loader="${e}"]`);if(r){r.dataset.loaded===`true`?t():(r.addEventListener(`load`,()=>t(),{once:!0}),r.addEventListener(`error`,()=>n(Error(`Failed to load ${e}`)),{once:!0}));return}let i=document.createElement(`script`);i.src=e,i.async=!0,i.dataset.cdnLoader=e,i.onload=()=>{i.dataset.loaded=`true`,t()},i.onerror=()=>{Qe.delete(e),n(Error(`Failed to load ${e}`))},document.head.appendChild(i)});return Qe.set(e,n),n}var et=`https://cdn.jsdelivr.net/npm/jspdf@2.5.2/dist/jspdf.umd.min.js`,tt=`https://cdn.jsdelivr.net/npm/docx@9.5.1/build/index.umd.min.js`;async function nt(){await $e(et);let e=window.jspdf?.jsPDF;if(!e)throw Error(`jsPDF global not found after CDN load`);return e}async function rt(){await $e(tt);let e=window.docx;if(!e)throw Error(`docx global not found after CDN load`);return e}async function it(e,t){ct(`# ${e}\n\n${new v.default({headingStyle:`atx`,codeBlockStyle:`fenced`}).turndown(t)}`,`${e}.md`,`text/markdown`)}async function at(e,t){let{Document:n,Paragraph:r,TextRun:i,HeadingLevel:a,Packer:o}=await rt(),s=new DOMParser().parseFromString(t,`text/html`),c=[];c.push(new r({text:e,heading:a.HEADING_1,spacing:{after:200}}));let l=e=>{if(e.nodeType===Node.TEXT_NODE){let t=e.textContent?.trim();t&&c.push(new r({children:[new i(t)]}))}else if(e.nodeType===Node.ELEMENT_NODE){let t=e,n=t.tagName.toLowerCase();switch(n){case`h1`:c.push(new r({text:t.textContent||``,heading:a.HEADING_1}));break;case`h2`:c.push(new r({text:t.textContent||``,heading:a.HEADING_2}));break;case`h3`:c.push(new r({text:t.textContent||``,heading:a.HEADING_3}));break;case`p`:let e=[];t.childNodes.forEach(t=>{if(t.nodeType===Node.TEXT_NODE)e.push(new i(t.textContent||``));else if(t.nodeType===Node.ELEMENT_NODE){let n=t,r={text:n.textContent||``};(n.tagName===`STRONG`||n.tagName===`B`)&&(r.bold=!0),(n.tagName===`EM`||n.tagName===`I`)&&(r.italics=!0),n.tagName===`U`&&(r.underline={}),n.tagName===`CODE`&&(r.font=`Courier New`),e.push(new i(r))}}),e.length>0?c.push(new r({children:e})):c.push(new r({text:t.textContent||``}));break;case`ul`:case`ol`:t.querySelectorAll(`li`).forEach(e=>{c.push(new r({text:e.textContent||``,bullet:n===`ul`?{level:0}:void 0,numbering:n===`ol`?{reference:`default`,level:0}:void 0}))});break;case`blockquote`:c.push(new r({children:[new i({text:t.textContent||``,italics:!0})],indent:{left:720}}));break;default:t.childNodes.forEach(l)}}};s.body.childNodes.forEach(l);let u=new n({sections:[{properties:{},children:c}]}),d=await o.toBlob(u),f=URL.createObjectURL(d),p=document.createElement(`a`);p.href=f,p.download=`${e}.docx`,p.click(),URL.revokeObjectURL(f)}async function ot(e,t){let n=document.createElement(`div`);n.style.position=`absolute`,n.style.left=`-9999px`,n.style.width=`210mm`,n.style.padding=`20mm`,n.style.backgroundColor=`white`,n.style.fontFamily=`Arial, sans-serif`,n.style.fontSize=`12pt`,n.style.lineHeight=`1.6`,n.innerHTML=`
18
18
  <h1 style="font-size: 24pt; margin-bottom: 20px;">${e}</h1>
19
19
  ${t}
package/dist/index.mjs CHANGED
@@ -1203,7 +1203,7 @@ async function Yt() {
1203
1203
  if (!Vt) try {
1204
1204
  Vt = (await import("kokoro-js")).KokoroTTS;
1205
1205
  } catch (e) {
1206
- throw console.error("Failed to import kokoro-js:", e), Error("Kokoro.js library not available");
1206
+ throw console.warn("Kokoro.js not available, will use server-side TTS:", e instanceof Error ? e.message : String(e)), Error("Kokoro.js library not available");
1207
1207
  }
1208
1208
  let e = [];
1209
1209
  await Jt() && e.push(Ut), e.push(Wt);
@@ -1271,7 +1271,7 @@ function en(e, t) {
1271
1271
  }, await c.play();
1272
1272
  return;
1273
1273
  } catch (e) {
1274
- console.warn("Kokoro TTS failed, falling back to Cloudflare:", e);
1274
+ console.debug("Kokoro TTS unavailable, using server-side TTS:", e instanceof Error ? e.message : String(e));
1275
1275
  }
1276
1276
  let n = await dt("/api/agent/voice", {
1277
1277
  method: "POST",
@@ -9,4 +9,5 @@ export declare function preloadKokoro(): Promise<any>;
9
9
  export declare function getKokoro(): Promise<any>;
10
10
  export declare function getVoiceList(): Promise<string[]>;
11
11
  export declare function getLoadedBackend(): DeviceMode;
12
+ export declare function isKokoroAvailable(): boolean;
12
13
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "research-agent-ui",
3
3
  "description": "Chat research agent UI: conversation window, article reader, search config, file uploads, and chat history",
4
- "version": "0.1.52",
4
+ "version": "0.1.54",
5
5
  "author": "vtempest",
6
6
  "repository": {
7
7
  "type": "git",
@@ -63,19 +63,19 @@
63
63
  "@radix-ui/react-slot": "^1.2.5",
64
64
  "@radix-ui/react-tooltip": "^1.2.9",
65
65
  "@ricky0123/vad-web": "^0.0.30",
66
- "chat-agent-toolkit": "^1.2.74",
67
- "domain-rank": "^0.1.63",
66
+ "chat-agent-toolkit": "^1.2.76",
67
+ "domain-rank": "^0.1.65",
68
68
  "drizzle-orm": "^0.45.2",
69
69
  "fuse.js": "^7.1.0",
70
70
  "class-variance-authority": "^0.7.1",
71
71
  "clsx": "^2.1.1",
72
72
  "dompurify": "^3.4.9",
73
- "extract-webpage": "^1.2.75",
74
- "search-web-api": "^1.0.34",
73
+ "extract-webpage": "^1.2.77",
74
+ "search-web-api": "^1.0.36",
75
75
  "framer-motion": "^12.40.0",
76
76
  "grab-url": "^1.6.22",
77
77
  "kokoro-js": "^1.2.1",
78
- "qwksearch-api-client": "^0.9.23",
78
+ "qwksearch-api-client": "^0.9.25",
79
79
  "html2canvas": "^1.4.1",
80
80
  "lucide-react": "^1.17.0",
81
81
  "markdown-to-jsx": "^9.8.2",