kyt-chat 1.0.1 β†’ 1.0.2

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.
@@ -483,4 +483,4 @@ Error generating stack: `+e.message+`
483
483
  }
484
484
  .kyt-bubble-btn { bottom: 16px; right: 16px; }
485
485
  }
486
- `}var f=!1;function p(e){if(f)return;f=!0;let t=document.createElement(`style`);t.setAttribute(`data-kyt`,`1`),t.textContent=d(e),document.head.appendChild(t)}function m(){return Math.random().toString(36).slice(2)}function h(e){let[t,n]=(0,u.useState)([]),[r,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)(null),s=(0,u.useRef)(null);return{messages:t,loading:r,error:a,sendMessage:(0,u.useCallback)(async t=>{let a=t.trim();if(!(!a||r)){o(null),n(e=>[...e,{id:m(),role:`user`,text:a}]),i(!0),s.current?.abort(),s.current=new AbortController;try{let t=await(await fetch(e.queryUrl,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({input:a}),signal:s.current.signal})).json();n(e=>[...e,{id:m(),role:`assistant`,text:t.answer??`No response.`,confidence:t.confidence,sources:t.sources,extra_sources:t.extra_sources}])}catch(e){if(e.name===`AbortError`)return;let t=e instanceof Error?e.message:`Something went wrong.`;o(t),n(e=>[...e,{id:m(),role:`assistant`,text:t,confidence:`low`}])}finally{i(!1)}}},[e,r]),reset:(0,u.useCallback)(()=>{s.current?.abort(),n([]),o(null),i(!1)},[])}}var g=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),_=t(((e,t)=>{t.exports=g()}))();function v(e){let t=Math.floor(e);return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`}function y({url:e,label:t}){return e?(0,_.jsxs)(`a`,{className:`kyt-source-btn`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,_.jsxs)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,children:[(0,_.jsx)(`path`,{d:`M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6`}),(0,_.jsx)(`polyline`,{points:`15 3 21 3 21 9`}),(0,_.jsx)(`line`,{x1:`10`,y1:`14`,x2:`21`,y2:`3`})]}),t]}):null}function b({s:e}){let t=e.source_type===`external`,n=e.url??``,r=n.includes(`#`)?`Jump to section`:`Go to source`;return(0,_.jsxs)(`div`,{className:`kyt-source-card`,children:[(0,_.jsxs)(`div`,{className:`kyt-card-header`,children:[(0,_.jsx)(`span`,{className:`kyt-card-type kyt-t-${t?`external`:`website`}`,children:t?`EXTERNAL`:`WEBSITE`}),(0,_.jsx)(`span`,{className:`kyt-card-label`,children:e.source_label.replace(/_/g,` `)})]}),(0,_.jsxs)(`div`,{className:`kyt-card-body`,children:[e.summary&&(0,_.jsx)(`div`,{className:`kyt-card-summary`,children:e.summary}),(0,_.jsx)(`div`,{className:`kyt-card-actions`,children:(0,_.jsx)(y,{url:n,label:r})})]})]})}function x({s:e}){let t=e.url||e.storage_url||void 0;return(0,_.jsxs)(`div`,{className:`kyt-source-card`,children:[(0,_.jsxs)(`div`,{className:`kyt-card-header`,children:[(0,_.jsx)(`span`,{className:`kyt-card-type kyt-t-pdf`,children:`PDF`}),(0,_.jsx)(`span`,{className:`kyt-card-label`,children:e.source_label.replace(/_/g,` `)})]}),(0,_.jsxs)(`div`,{className:`kyt-card-body`,children:[e.summary&&(0,_.jsx)(`div`,{className:`kyt-card-summary`,children:e.summary}),(0,_.jsxs)(`div`,{className:`kyt-card-actions`,children:[e.pdf_page!=null&&(0,_.jsxs)(`span`,{className:`kyt-pdf-page-badge`,children:[`πŸ“„ Page `,e.pdf_page]}),(0,_.jsx)(y,{url:t,label:e.pdf_page==null?`Open PDF`:`Open page ${e.pdf_page}`})]})]})]})}function ee({s:e}){let t=e.start_time===null||e.start_time===void 0,n=t?0:e.start_time??0,r=e.drive_embed_url??``;r&&(r=r.split(`?`)[0].split(`#`)[0],!t&&n>0&&(r=r.includes(`drive.google.com`)?`${r}?start=${n}`:`${r}#t=${n}`));let i=r.includes(`drive.google.com`),a=t?`Watch video`:`Jump to ${v(n)}`;return(0,_.jsxs)(`div`,{className:`kyt-source-card`,children:[(0,_.jsxs)(`div`,{className:`kyt-card-header`,children:[(0,_.jsx)(`span`,{className:`kyt-card-type kyt-t-video`,children:`VIDEO`}),(0,_.jsx)(`span`,{className:`kyt-card-label`,children:e.source_label.replace(/_/g,` `)})]}),(0,_.jsxs)(`div`,{className:`kyt-card-body`,children:[r&&(0,_.jsx)(`div`,{className:`kyt-video-embed-wrapper`,children:i?(0,_.jsx)(`iframe`,{src:r,allowFullScreen:!0,loading:`lazy`,allow:`fullscreen`,style:{border:0}}):(0,_.jsx)(`video`,{controls:!0,preload:`none`,"data-start":!t&&n>0?n:void 0,children:(0,_.jsx)(`source`,{src:r})})}),(0,_.jsxs)(`div`,{className:`kyt-card-actions`,children:[!t&&n>0&&(0,_.jsxs)(`span`,{className:`kyt-timestamp-chip`,children:[`⏱ `,v(n)]}),(0,_.jsx)(y,{url:r||void 0,label:a}),e.url&&e.url!==r&&(0,_.jsx)(y,{url:e.url,label:`Go to source`})]}),e.content_snippet&&(0,_.jsxs)(`div`,{className:`kyt-transcript-snippet`,children:[`"`,e.content_snippet,`…"`]})]})]})}function S({s:e}){let t=e.storage_url??void 0,n=e.storage_url??e.url??``;return(0,_.jsxs)(`div`,{className:`kyt-source-card`,children:[(0,_.jsxs)(`div`,{className:`kyt-card-header`,children:[(0,_.jsx)(`span`,{className:`kyt-card-type kyt-t-social`,children:`IMAGE`}),(0,_.jsx)(`span`,{className:`kyt-card-label`,children:e.source_label.replace(/_/g,` `)})]}),(0,_.jsxs)(`div`,{className:`kyt-card-body`,children:[t&&(0,_.jsx)(`div`,{className:`kyt-card-img-wrap`,children:(0,_.jsx)(`img`,{src:t,alt:e.source_label})}),e.summary&&(0,_.jsx)(`div`,{className:`kyt-card-summary`,children:e.summary}),(0,_.jsx)(`div`,{className:`kyt-card-actions`,children:(0,_.jsx)(y,{url:n||void 0,label:`View image`})})]})]})}function C({s:e}){let t=(e.source_label??``).toLowerCase(),n=t.includes(`x`)||t.includes(`twitter`)?`𝕏`:t.includes(`linkedin`)?`in`:`β—Ž`,r=e.content_snippet??e.summary??``;return(0,_.jsxs)(`div`,{className:`kyt-source-card`,children:[(0,_.jsxs)(`div`,{className:`kyt-card-header`,children:[(0,_.jsxs)(`span`,{className:`kyt-card-type kyt-t-social`,children:[n,` SOCIAL`]}),(0,_.jsx)(`span`,{className:`kyt-card-label`,children:e.source_label.replace(/_/g,` `)})]}),(0,_.jsxs)(`div`,{className:`kyt-card-body`,children:[r&&(0,_.jsx)(`div`,{className:`kyt-card-summary`,children:r}),(0,_.jsx)(`div`,{className:`kyt-card-actions`,children:(0,_.jsx)(y,{url:e.url,label:`View post`})})]})]})}function te({s:e}){return e.source_type===`video`?(0,_.jsx)(ee,{s:e}):e.source_type===`pdf`?(0,_.jsx)(x,{s:e}):e.source_type===`image`?(0,_.jsx)(S,{s:e}):e.source_type===`social`?(0,_.jsx)(C,{s:e}):(0,_.jsx)(b,{s:e})}function ne(e){return e.source_type===`video`?`video::${e.source_label}::${e.start_time??`desc`}`:e.source_type===`pdf`?`pdf::${e.source_label}::${e.pdf_page??`all`}`:e.source_type===`image`?`image::${e.storage_url??e.url??e.source_label}`:`${e.source_type}::${e.url??e.source_label}`}function re(e){let t=new Set;return e.filter(e=>{let n=ne(e);return t.has(n)?!1:(t.add(n),!0)})}function w({sources:e,extra_sources:t=[]}){let[n,r]=(0,u.useState)(!1),i=re(e),a=re(t);return i.length?(0,_.jsxs)(`div`,{className:`kyt-sources-row`,children:[(0,_.jsxs)(`div`,{className:`kyt-sources-header`,children:[`Sources (`,i.length,a.length?`+`:``,`)`]}),(0,_.jsxs)(`div`,{className:`kyt-source-cards`,children:[i.map((e,t)=>(0,_.jsx)(te,{s:e},t)),a.length>0&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`button`,{className:`kyt-extra-toggle`,onClick:()=>r(e=>!e),children:n?`Show less`:`+ ${a.length} more source${a.length>1?`s`:``}`}),n&&(0,_.jsx)(`div`,{className:`kyt-extra-cards`,children:a.map((e,t)=>(0,_.jsx)(te,{s:e},t))})]})]})]}):null}function ie(e){return e.replace(/\*\*(.*?)\*\*/g,`<strong>$1</strong>`).replace(/\n/g,`<br>`)}function ae({config:e,onClose:t,showHeader:n=!0,bubbleMode:r=!1,pendingFaq:i,onFaqSent:a}){let{messages:o,loading:s,sendMessage:c}=h(e),[l,d]=(0,u.useState)(``),f=(0,u.useRef)(null),p=(0,u.useRef)(null),m=e.theme??`dark`,g=e.faqs??[],v=e.title??`Ask anything`,y=e.placeholder??`Type your question…`,b=e.welcomeMessage??`Ask a question to get started.`,x=e.avatarLabel??`AI`,ee=e.hint??``;(0,u.useEffect)(()=>{f.current?.scrollIntoView({behavior:`smooth`})},[o,s]);let S=(0,u.useRef)(void 0);(0,u.useEffect)(()=>{i&&i!==S.current&&(S.current=i,c(i),a?.())},[i,c,a]);let C=()=>{!l.trim()||s||(c(l),d(``),p.current?.focus())},te=e=>{c(e),d(``)};return(0,_.jsx)(`div`,{className:`kyt-root${m===`light`?` kyt-light`:``}`,style:{height:`100%`,display:`flex`,flexDirection:`column`},children:(0,_.jsxs)(`div`,{className:`kyt-page`,children:[n&&(0,_.jsxs)(`header`,{className:`kyt-header`,children:[(0,_.jsx)(`span`,{className:`kyt-header-title`,children:v}),(0,_.jsxs)(`div`,{className:`kyt-header-right`,children:[(0,_.jsxs)(`div`,{className:`kyt-live`,children:[(0,_.jsx)(`div`,{className:`kyt-live-dot`}),`Live`]}),t&&(0,_.jsx)(`button`,{className:`kyt-hdr-btn`,onClick:t,"aria-label":`Close chat`,children:(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`white`,children:(0,_.jsx)(`path`,{d:`M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`})})})]})]}),(0,_.jsxs)(`div`,{className:`kyt-body`,children:[!r&&g.length>0&&(0,_.jsxs)(`aside`,{className:`kyt-sidebar`,children:[(0,_.jsx)(`div`,{className:`kyt-sidebar-label`,children:`Suggested Questions`}),(0,_.jsx)(`div`,{className:`kyt-faq-list`,children:g.map((e,t)=>(0,_.jsx)(`button`,{className:`kyt-faq-btn`,onClick:()=>te(e),children:e},t))})]}),(0,_.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,_.jsxs)(`div`,{className:`kyt-messages`,children:[o.length===0&&(0,_.jsxs)(`div`,{className:`kyt-welcome`,children:[(0,_.jsx)(`div`,{className:`kyt-welcome-icon`,children:(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`28`,height:`28`,fill:`white`,children:(0,_.jsx)(`path`,{d:`M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z`})})}),(0,_.jsx)(`h2`,{children:v}),(0,_.jsx)(`p`,{children:b})]}),o.map(e=>(0,_.jsx)(oe,{msg:e,avatarLabel:x},e.id)),s&&(0,_.jsxs)(`div`,{className:`kyt-msg kyt-msg-assistant`,children:[(0,_.jsx)(`div`,{className:`kyt-avatar`,children:x[0]}),(0,_.jsxs)(`div`,{className:`kyt-typing`,children:[(0,_.jsx)(`div`,{className:`kyt-dot`}),(0,_.jsx)(`div`,{className:`kyt-dot`}),(0,_.jsx)(`div`,{className:`kyt-dot`})]})]}),(0,_.jsx)(`div`,{ref:f})]}),(0,_.jsxs)(`div`,{className:`kyt-input-bar`,children:[(0,_.jsxs)(`div`,{className:`kyt-input-row`,children:[(0,_.jsx)(`input`,{ref:p,className:`kyt-input`,value:l,placeholder:y,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),C())},disabled:s}),(0,_.jsx)(`button`,{className:`kyt-send-btn`,onClick:C,disabled:s||!l.trim(),"aria-label":`Send`,children:(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,children:(0,_.jsx)(`path`,{d:`M2 21l21-9L2 3v7l15 2-15 2z`})})})]}),ee&&(0,_.jsx)(`div`,{className:`kyt-hint`,children:ee})]})]})]})]})})}function oe({msg:e,avatarLabel:t}){if(e.role===`user`)return(0,_.jsx)(`div`,{className:`kyt-msg kyt-msg-user`,children:(0,_.jsx)(`div`,{className:`kyt-bubble kyt-bubble-user`,dangerouslySetInnerHTML:{__html:ie(e.text)}})});let n=e.confidence===`high`?`kyt-conf kyt-conf-high`:e.confidence===`low`?`kyt-conf kyt-conf-low`:`kyt-conf kyt-conf-medium`;return(0,_.jsxs)(`div`,{className:`kyt-msg kyt-msg-assistant`,style:{flexDirection:`column`},children:[(0,_.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:10},children:[(0,_.jsx)(`div`,{className:`kyt-avatar`,children:t[0]}),(0,_.jsxs)(`div`,{className:`kyt-bubble kyt-bubble-assistant`,children:[(0,_.jsx)(`span`,{dangerouslySetInnerHTML:{__html:ie(e.text)}}),e.confidence&&(0,_.jsx)(`span`,{className:n,children:e.confidence.toUpperCase()})]})]}),e.sources&&e.sources.length>0&&(0,_.jsx)(w,{sources:e.sources,extra_sources:e.extra_sources})]})}function se({config:e}){let[t,n]=(0,u.useState)(!1),[r,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)(!1),[s,c]=(0,u.useState)(),l=e.primaryColor??`#1565c0`,d=e.faqs??[];(0,u.useEffect)(()=>{p(l)},[l]);let f=()=>{n(!1),i(!1),o(!1)},m=e=>{c({text:e,id:Date.now()}),o(!1)};return(0,_.jsxs)(`div`,{className:`kyt-root`,children:[t&&r&&(0,_.jsx)(`div`,{className:`kyt-bubble-expanded-backdrop`,onClick:f}),t&&(0,_.jsxs)(`div`,{className:r?`kyt-bubble-expanded`:`kyt-bubble-compact`,children:[(0,_.jsxs)(`div`,{className:`kyt-bubble-header`,style:{background:l},children:[(0,_.jsx)(`span`,{className:`kyt-bubble-header-title`,children:e.title??`Ask anything`}),(0,_.jsxs)(`div`,{className:`kyt-bubble-header-actions`,children:[(0,_.jsxs)(`div`,{className:`kyt-live`,style:{marginRight:4},children:[(0,_.jsx)(`div`,{className:`kyt-live-dot`}),`Live`]}),d.length>0&&(0,_.jsx)(`button`,{className:`kyt-hdr-btn`,onClick:()=>o(e=>!e),title:`Suggested questions`,"aria-label":`Suggested questions`,children:`πŸ’‘`}),(0,_.jsx)(`button`,{className:`kyt-hdr-btn`,onClick:()=>i(e=>!e),title:r?`Compact`:`Expand`,"aria-label":r?`Compact`:`Expand`,children:r?(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`white`,children:(0,_.jsx)(`path`,{d:`M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z`})}):(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`white`,children:(0,_.jsx)(`path`,{d:`M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z`})})}),(0,_.jsx)(`button`,{className:`kyt-hdr-btn`,onClick:f,"aria-label":`Close chat`,children:(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`white`,children:(0,_.jsx)(`path`,{d:`M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`})})})]})]}),(0,_.jsxs)(`div`,{style:{flex:1,overflow:`hidden`,display:`flex`,flexDirection:`column`,position:`relative`},children:[(0,_.jsx)(ae,{config:e,showHeader:!1,bubbleMode:!0,pendingFaq:s?.text,onFaqSent:()=>c(void 0)}),a&&d.length>0&&(0,_.jsxs)(`div`,{className:`kyt-faq-drawer`,children:[(0,_.jsxs)(`div`,{className:`kyt-faq-drawer-header`,children:[(0,_.jsx)(`span`,{className:`kyt-faq-drawer-label`,children:`Suggested`}),(0,_.jsx)(`button`,{className:`kyt-faq-drawer-close`,onClick:()=>o(!1),"aria-label":`Close`,children:`βœ•`})]}),(0,_.jsx)(`div`,{className:`kyt-faq-drawer-list`,children:d.map((e,t)=>(0,_.jsx)(`button`,{className:`kyt-faq-drawer-btn`,onClick:()=>m(e),children:e},t))})]})]})]}),!r&&(0,_.jsx)(`button`,{className:`kyt-bubble-btn`,style:{background:l},onClick:()=>n(e=>!e),"aria-label":t?`Close chat`:`Open chat`,children:t?(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,children:(0,_.jsx)(`path`,{d:`M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`})}):(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,children:(0,_.jsx)(`path`,{d:`M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z`})})})]})}function ce({config:e,style:t,className:n}){return(0,u.useEffect)(()=>{p(e.primaryColor??`#1565c0`)},[e.primaryColor]),(0,_.jsx)(`div`,{style:{height:`100%`,width:`100%`,...t},className:n,children:(0,_.jsx)(ae,{config:e,showHeader:!0})})}function le(e){let t=document.querySelector(e);if(!t)throw Error(`kyt-chat: no element found for selector "${e}"`);return t}function ue(e,t){p(e.primaryColor??`#1565c0`),(0,l.createRoot)(le(t)).render((0,u.createElement)(se,{config:e}))}function T(e,t){p(e.primaryColor??`#1565c0`);let n=le(t);n.style.height=n.style.height||`100vh`,n.style.display=`flex`,n.style.flexDirection=`column`,(0,l.createRoot)(n).render((0,u.createElement)(ce,{config:e,style:{height:`100%`,flex:1}}))}function E(e,t,n=`bubble`){n===`chat`?T(e,t):ue(e,t)}return e.mount=E,e.mountBubble=ue,e.mountChat=T,e})({});
486
+ `}var f=!1;function p(e){if(f)return;f=!0;let t=document.createElement(`style`);t.setAttribute(`data-kyt`,`1`),t.textContent=d(e),document.head.appendChild(t)}function m(){return Math.random().toString(36).slice(2)}function h(e){let[t,n]=(0,u.useState)([]),[r,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)(null),s=(0,u.useRef)(null);return{messages:t,loading:r,error:a,sendMessage:(0,u.useCallback)(async t=>{let a=t.trim();if(!(!a||r)){o(null),n(e=>[...e,{id:m(),role:`user`,text:a}]),i(!0),s.current?.abort(),s.current=new AbortController;try{let t=await(await fetch(e.queryUrl,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({input:a,...e.topicId?{topic_id:e.topicId}:{}}),signal:s.current.signal})).json();n(e=>[...e,{id:m(),role:`assistant`,text:t.answer??`No response.`,confidence:t.confidence,sources:t.sources,extra_sources:t.extra_sources}])}catch(e){if(e.name===`AbortError`)return;let t=e instanceof Error?e.message:`Something went wrong.`;o(t),n(e=>[...e,{id:m(),role:`assistant`,text:t,confidence:`low`}])}finally{i(!1)}}},[e,r]),reset:(0,u.useCallback)(()=>{s.current?.abort(),n([]),o(null),i(!1)},[])}}var g=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),_=t(((e,t)=>{t.exports=g()}))();function v(e){let t=Math.floor(e);return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`}function y({url:e,label:t}){return e?(0,_.jsxs)(`a`,{className:`kyt-source-btn`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,_.jsxs)(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,children:[(0,_.jsx)(`path`,{d:`M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6`}),(0,_.jsx)(`polyline`,{points:`15 3 21 3 21 9`}),(0,_.jsx)(`line`,{x1:`10`,y1:`14`,x2:`21`,y2:`3`})]}),t]}):null}function b({s:e}){let t=e.source_type===`external`,n=e.url??``,r=n.includes(`#`)?`Jump to section`:`Go to source`;return(0,_.jsxs)(`div`,{className:`kyt-source-card`,children:[(0,_.jsxs)(`div`,{className:`kyt-card-header`,children:[(0,_.jsx)(`span`,{className:`kyt-card-type kyt-t-${t?`external`:`website`}`,children:t?`EXTERNAL`:`WEBSITE`}),(0,_.jsx)(`span`,{className:`kyt-card-label`,children:e.source_label.replace(/_/g,` `)})]}),(0,_.jsxs)(`div`,{className:`kyt-card-body`,children:[e.summary&&(0,_.jsx)(`div`,{className:`kyt-card-summary`,children:e.summary}),(0,_.jsx)(`div`,{className:`kyt-card-actions`,children:(0,_.jsx)(y,{url:n,label:r})})]})]})}function x({s:e}){let t=e.url||e.storage_url||void 0;return(0,_.jsxs)(`div`,{className:`kyt-source-card`,children:[(0,_.jsxs)(`div`,{className:`kyt-card-header`,children:[(0,_.jsx)(`span`,{className:`kyt-card-type kyt-t-pdf`,children:`PDF`}),(0,_.jsx)(`span`,{className:`kyt-card-label`,children:e.source_label.replace(/_/g,` `)})]}),(0,_.jsxs)(`div`,{className:`kyt-card-body`,children:[e.summary&&(0,_.jsx)(`div`,{className:`kyt-card-summary`,children:e.summary}),(0,_.jsxs)(`div`,{className:`kyt-card-actions`,children:[e.pdf_page!=null&&(0,_.jsxs)(`span`,{className:`kyt-pdf-page-badge`,children:[`πŸ“„ Page `,e.pdf_page]}),(0,_.jsx)(y,{url:t,label:e.pdf_page==null?`Open PDF`:`Open page ${e.pdf_page}`})]})]})]})}function ee({s:e}){let t=e.start_time===null||e.start_time===void 0,n=t?0:e.start_time??0,r=e.drive_embed_url??``;r&&(r=r.split(`?`)[0].split(`#`)[0],!t&&n>0&&(r=r.includes(`drive.google.com`)?`${r}?start=${n}`:`${r}#t=${n}`));let i=r.includes(`drive.google.com`),a=t?`Watch video`:`Jump to ${v(n)}`;return(0,_.jsxs)(`div`,{className:`kyt-source-card`,children:[(0,_.jsxs)(`div`,{className:`kyt-card-header`,children:[(0,_.jsx)(`span`,{className:`kyt-card-type kyt-t-video`,children:`VIDEO`}),(0,_.jsx)(`span`,{className:`kyt-card-label`,children:e.source_label.replace(/_/g,` `)})]}),(0,_.jsxs)(`div`,{className:`kyt-card-body`,children:[r&&(0,_.jsx)(`div`,{className:`kyt-video-embed-wrapper`,children:i?(0,_.jsx)(`iframe`,{src:r,allowFullScreen:!0,loading:`lazy`,allow:`fullscreen`,style:{border:0}}):(0,_.jsx)(`video`,{controls:!0,preload:`none`,"data-start":!t&&n>0?n:void 0,children:(0,_.jsx)(`source`,{src:r})})}),(0,_.jsxs)(`div`,{className:`kyt-card-actions`,children:[!t&&n>0&&(0,_.jsxs)(`span`,{className:`kyt-timestamp-chip`,children:[`⏱ `,v(n)]}),(0,_.jsx)(y,{url:r||void 0,label:a}),e.url&&e.url!==r&&(0,_.jsx)(y,{url:e.url,label:`Go to source`})]}),e.content_snippet&&(0,_.jsxs)(`div`,{className:`kyt-transcript-snippet`,children:[`"`,e.content_snippet,`…"`]})]})]})}function S({s:e}){let t=e.storage_url??void 0,n=e.storage_url??e.url??``;return(0,_.jsxs)(`div`,{className:`kyt-source-card`,children:[(0,_.jsxs)(`div`,{className:`kyt-card-header`,children:[(0,_.jsx)(`span`,{className:`kyt-card-type kyt-t-social`,children:`IMAGE`}),(0,_.jsx)(`span`,{className:`kyt-card-label`,children:e.source_label.replace(/_/g,` `)})]}),(0,_.jsxs)(`div`,{className:`kyt-card-body`,children:[t&&(0,_.jsx)(`div`,{className:`kyt-card-img-wrap`,children:(0,_.jsx)(`img`,{src:t,alt:e.source_label})}),e.summary&&(0,_.jsx)(`div`,{className:`kyt-card-summary`,children:e.summary}),(0,_.jsx)(`div`,{className:`kyt-card-actions`,children:(0,_.jsx)(y,{url:n||void 0,label:`View image`})})]})]})}function C({s:e}){let t=(e.source_label??``).toLowerCase(),n=t.includes(`x`)||t.includes(`twitter`)?`𝕏`:t.includes(`linkedin`)?`in`:`β—Ž`,r=e.content_snippet??e.summary??``;return(0,_.jsxs)(`div`,{className:`kyt-source-card`,children:[(0,_.jsxs)(`div`,{className:`kyt-card-header`,children:[(0,_.jsxs)(`span`,{className:`kyt-card-type kyt-t-social`,children:[n,` SOCIAL`]}),(0,_.jsx)(`span`,{className:`kyt-card-label`,children:e.source_label.replace(/_/g,` `)})]}),(0,_.jsxs)(`div`,{className:`kyt-card-body`,children:[r&&(0,_.jsx)(`div`,{className:`kyt-card-summary`,children:r}),(0,_.jsx)(`div`,{className:`kyt-card-actions`,children:(0,_.jsx)(y,{url:e.url,label:`View post`})})]})]})}function te({s:e}){return e.source_type===`video`?(0,_.jsx)(ee,{s:e}):e.source_type===`pdf`?(0,_.jsx)(x,{s:e}):e.source_type===`image`?(0,_.jsx)(S,{s:e}):e.source_type===`social`?(0,_.jsx)(C,{s:e}):(0,_.jsx)(b,{s:e})}function ne(e){return e.source_type===`video`?`video::${e.source_label}::${e.start_time??`desc`}`:e.source_type===`pdf`?`pdf::${e.source_label}::${e.pdf_page??`all`}`:e.source_type===`image`?`image::${e.storage_url??e.url??e.source_label}`:`${e.source_type}::${e.url??e.source_label}`}function re(e){let t=new Set;return e.filter(e=>{let n=ne(e);return t.has(n)?!1:(t.add(n),!0)})}function w({sources:e,extra_sources:t=[]}){let[n,r]=(0,u.useState)(!1),i=re(e),a=re(t);return i.length?(0,_.jsxs)(`div`,{className:`kyt-sources-row`,children:[(0,_.jsxs)(`div`,{className:`kyt-sources-header`,children:[`Sources (`,i.length,a.length?`+`:``,`)`]}),(0,_.jsxs)(`div`,{className:`kyt-source-cards`,children:[i.map((e,t)=>(0,_.jsx)(te,{s:e},t)),a.length>0&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`button`,{className:`kyt-extra-toggle`,onClick:()=>r(e=>!e),children:n?`Show less`:`+ ${a.length} more source${a.length>1?`s`:``}`}),n&&(0,_.jsx)(`div`,{className:`kyt-extra-cards`,children:a.map((e,t)=>(0,_.jsx)(te,{s:e},t))})]})]})]}):null}function ie(e){return e.replace(/\*\*(.*?)\*\*/g,`<strong>$1</strong>`).replace(/\n/g,`<br>`)}function ae({config:e,onClose:t,showHeader:n=!0,bubbleMode:r=!1,pendingFaq:i,onFaqSent:a}){let{messages:o,loading:s,sendMessage:c}=h(e),[l,d]=(0,u.useState)(``),f=(0,u.useRef)(null),p=(0,u.useRef)(null),m=e.theme??`dark`,g=e.faqs??[],v=e.title??`Ask anything`,y=e.placeholder??`Type your question…`,b=e.welcomeMessage??`Ask a question to get started.`,x=e.avatarLabel??`AI`,ee=e.hint??``;(0,u.useEffect)(()=>{f.current?.scrollIntoView({behavior:`smooth`})},[o,s]);let S=(0,u.useRef)(void 0);(0,u.useEffect)(()=>{i&&i!==S.current&&(S.current=i,c(i),a?.())},[i,c,a]);let C=()=>{!l.trim()||s||(c(l),d(``),p.current?.focus())},te=e=>{c(e),d(``)};return(0,_.jsx)(`div`,{className:`kyt-root${m===`light`?` kyt-light`:``}`,style:{height:`100%`,display:`flex`,flexDirection:`column`},children:(0,_.jsxs)(`div`,{className:`kyt-page`,children:[n&&(0,_.jsxs)(`header`,{className:`kyt-header`,children:[(0,_.jsx)(`span`,{className:`kyt-header-title`,children:v}),(0,_.jsxs)(`div`,{className:`kyt-header-right`,children:[(0,_.jsxs)(`div`,{className:`kyt-live`,children:[(0,_.jsx)(`div`,{className:`kyt-live-dot`}),`Live`]}),t&&(0,_.jsx)(`button`,{className:`kyt-hdr-btn`,onClick:t,"aria-label":`Close chat`,children:(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`white`,children:(0,_.jsx)(`path`,{d:`M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`})})})]})]}),(0,_.jsxs)(`div`,{className:`kyt-body`,children:[!r&&g.length>0&&(0,_.jsxs)(`aside`,{className:`kyt-sidebar`,children:[(0,_.jsx)(`div`,{className:`kyt-sidebar-label`,children:`Suggested Questions`}),(0,_.jsx)(`div`,{className:`kyt-faq-list`,children:g.map((e,t)=>(0,_.jsx)(`button`,{className:`kyt-faq-btn`,onClick:()=>te(e),children:e},t))})]}),(0,_.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:[(0,_.jsxs)(`div`,{className:`kyt-messages`,children:[o.length===0&&(0,_.jsxs)(`div`,{className:`kyt-welcome`,children:[(0,_.jsx)(`div`,{className:`kyt-welcome-icon`,children:(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`28`,height:`28`,fill:`white`,children:(0,_.jsx)(`path`,{d:`M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z`})})}),(0,_.jsx)(`h2`,{children:v}),(0,_.jsx)(`p`,{children:b})]}),o.map(e=>(0,_.jsx)(oe,{msg:e,avatarLabel:x},e.id)),s&&(0,_.jsxs)(`div`,{className:`kyt-msg kyt-msg-assistant`,children:[(0,_.jsx)(`div`,{className:`kyt-avatar`,children:x[0]}),(0,_.jsxs)(`div`,{className:`kyt-typing`,children:[(0,_.jsx)(`div`,{className:`kyt-dot`}),(0,_.jsx)(`div`,{className:`kyt-dot`}),(0,_.jsx)(`div`,{className:`kyt-dot`})]})]}),(0,_.jsx)(`div`,{ref:f})]}),(0,_.jsxs)(`div`,{className:`kyt-input-bar`,children:[(0,_.jsxs)(`div`,{className:`kyt-input-row`,children:[(0,_.jsx)(`input`,{ref:p,className:`kyt-input`,value:l,placeholder:y,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),C())},disabled:s}),(0,_.jsx)(`button`,{className:`kyt-send-btn`,onClick:C,disabled:s||!l.trim(),"aria-label":`Send`,children:(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,children:(0,_.jsx)(`path`,{d:`M2 21l21-9L2 3v7l15 2-15 2z`})})})]}),ee&&(0,_.jsx)(`div`,{className:`kyt-hint`,children:ee})]})]})]})]})})}function oe({msg:e,avatarLabel:t}){if(e.role===`user`)return(0,_.jsx)(`div`,{className:`kyt-msg kyt-msg-user`,children:(0,_.jsx)(`div`,{className:`kyt-bubble kyt-bubble-user`,dangerouslySetInnerHTML:{__html:ie(e.text)}})});let n=e.confidence===`high`?`kyt-conf kyt-conf-high`:e.confidence===`low`?`kyt-conf kyt-conf-low`:`kyt-conf kyt-conf-medium`;return(0,_.jsxs)(`div`,{className:`kyt-msg kyt-msg-assistant`,style:{flexDirection:`column`},children:[(0,_.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:10},children:[(0,_.jsx)(`div`,{className:`kyt-avatar`,children:t[0]}),(0,_.jsxs)(`div`,{className:`kyt-bubble kyt-bubble-assistant`,children:[(0,_.jsx)(`span`,{dangerouslySetInnerHTML:{__html:ie(e.text)}}),e.confidence&&(0,_.jsx)(`span`,{className:n,children:e.confidence.toUpperCase()})]})]}),e.sources&&e.sources.length>0&&(0,_.jsx)(w,{sources:e.sources,extra_sources:e.extra_sources})]})}function se({config:e}){let[t,n]=(0,u.useState)(!1),[r,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)(!1),[s,c]=(0,u.useState)(),l=e.primaryColor??`#1565c0`,d=e.faqs??[];(0,u.useEffect)(()=>{p(l)},[l]);let f=()=>{n(!1),i(!1),o(!1)},m=e=>{c({text:e,id:Date.now()}),o(!1)};return(0,_.jsxs)(`div`,{className:`kyt-root`,children:[t&&r&&(0,_.jsx)(`div`,{className:`kyt-bubble-expanded-backdrop`,onClick:f}),t&&(0,_.jsxs)(`div`,{className:r?`kyt-bubble-expanded`:`kyt-bubble-compact`,children:[(0,_.jsxs)(`div`,{className:`kyt-bubble-header`,style:{background:l},children:[(0,_.jsx)(`span`,{className:`kyt-bubble-header-title`,children:e.title??`Ask anything`}),(0,_.jsxs)(`div`,{className:`kyt-bubble-header-actions`,children:[(0,_.jsxs)(`div`,{className:`kyt-live`,style:{marginRight:4},children:[(0,_.jsx)(`div`,{className:`kyt-live-dot`}),`Live`]}),d.length>0&&(0,_.jsx)(`button`,{className:`kyt-hdr-btn`,onClick:()=>o(e=>!e),title:`Suggested questions`,"aria-label":`Suggested questions`,children:`πŸ’‘`}),(0,_.jsx)(`button`,{className:`kyt-hdr-btn`,onClick:()=>i(e=>!e),title:r?`Compact`:`Expand`,"aria-label":r?`Compact`:`Expand`,children:r?(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`white`,children:(0,_.jsx)(`path`,{d:`M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z`})}):(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`white`,children:(0,_.jsx)(`path`,{d:`M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z`})})}),(0,_.jsx)(`button`,{className:`kyt-hdr-btn`,onClick:f,"aria-label":`Close chat`,children:(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`white`,children:(0,_.jsx)(`path`,{d:`M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`})})})]})]}),(0,_.jsxs)(`div`,{style:{flex:1,overflow:`hidden`,display:`flex`,flexDirection:`column`,position:`relative`},children:[(0,_.jsx)(ae,{config:e,showHeader:!1,bubbleMode:!0,pendingFaq:s?.text,onFaqSent:()=>c(void 0)}),a&&d.length>0&&(0,_.jsxs)(`div`,{className:`kyt-faq-drawer`,children:[(0,_.jsxs)(`div`,{className:`kyt-faq-drawer-header`,children:[(0,_.jsx)(`span`,{className:`kyt-faq-drawer-label`,children:`Suggested`}),(0,_.jsx)(`button`,{className:`kyt-faq-drawer-close`,onClick:()=>o(!1),"aria-label":`Close`,children:`βœ•`})]}),(0,_.jsx)(`div`,{className:`kyt-faq-drawer-list`,children:d.map((e,t)=>(0,_.jsx)(`button`,{className:`kyt-faq-drawer-btn`,onClick:()=>m(e),children:e},t))})]})]})]}),!r&&(0,_.jsx)(`button`,{className:`kyt-bubble-btn`,style:{background:l},onClick:()=>n(e=>!e),"aria-label":t?`Close chat`:`Open chat`,children:t?(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,children:(0,_.jsx)(`path`,{d:`M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`})}):(0,_.jsx)(`svg`,{viewBox:`0 0 24 24`,children:(0,_.jsx)(`path`,{d:`M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z`})})})]})}function ce({config:e,style:t,className:n}){return(0,u.useEffect)(()=>{p(e.primaryColor??`#1565c0`)},[e.primaryColor]),(0,_.jsx)(`div`,{style:{height:`100%`,width:`100%`,...t},className:n,children:(0,_.jsx)(ae,{config:e,showHeader:!0})})}function le(e){let t=document.querySelector(e);if(!t)throw Error(`kyt-chat: no element found for selector "${e}"`);return t}function ue(e,t){p(e.primaryColor??`#1565c0`),(0,l.createRoot)(le(t)).render((0,u.createElement)(se,{config:e}))}function T(e,t){p(e.primaryColor??`#1565c0`);let n=le(t);n.style.height=n.style.height||`100vh`,n.style.display=`flex`,n.style.flexDirection=`column`,(0,l.createRoot)(n).render((0,u.createElement)(ce,{config:e,style:{height:`100%`,flex:1}}))}function E(e,t,n=`bubble`){n===`chat`?T(e,t):ue(e,t)}return e.mount=E,e.mountBubble=ue,e.mountChat=T,e})({});
package/dist/kyt-chat.js CHANGED
@@ -8504,7 +8504,10 @@ function m(e) {
8504
8504
  let t = await (await fetch(e.queryUrl, {
8505
8505
  method: "POST",
8506
8506
  headers: { "Content-Type": "application/json" },
8507
- body: JSON.stringify({ input: a }),
8507
+ body: JSON.stringify({
8508
+ input: a,
8509
+ ...e.topicId ? { topic_id: e.topicId } : {}
8510
+ }),
8508
8511
  signal: s.current.signal
8509
8512
  })).json();
8510
8513
  n((e) => [...e, {
@@ -5,6 +5,11 @@ export interface KytConfig {
5
5
  * Never point this directly at the KYT edge function from the browser.
6
6
  */
7
7
  queryUrl: string;
8
+ /**
9
+ * Topic ID to query. Overrides the default topic set in your proxy server.
10
+ * Useful when one proxy serves multiple topics.
11
+ */
12
+ topicId?: string;
8
13
  /** Chat window title */
9
14
  title?: string;
10
15
  /** Welcome subtitle shown before first message */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kDAAkD;IAClD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,8CAA8C;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;IACjC,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,WAAW,EAAE,CAAA;IACvB,aAAa,CAAC,EAAE,WAAW,EAAE,CAAA;IAC7B,UAAU,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAA;IACtC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,GAAG,WAAW,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAA;IACtC,OAAO,CAAC,EAAE,WAAW,EAAE,CAAA;IACvB,aAAa,CAAC,EAAE,WAAW,EAAE,CAAA;CAC9B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kDAAkD;IAClD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,8CAA8C;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;IACjC,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,WAAW,EAAE,CAAA;IACvB,aAAa,CAAC,EAAE,WAAW,EAAE,CAAA;IAC7B,UAAU,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAA;IACtC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,GAAG,WAAW,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAA;IACtC,OAAO,CAAC,EAAE,WAAW,EAAE,CAAA;IACvB,aAAa,CAAC,EAAE,WAAW,EAAE,CAAA;CAC9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"useKytChat.d.ts","sourceRoot":"","sources":["../../../../src/useKytChat.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAiB,MAAM,SAAS,CAAA;AAMhE,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS;;;;yBAO1B,MAAM;;EA0DvB"}
1
+ {"version":3,"file":"useKytChat.d.ts","sourceRoot":"","sources":["../../../../src/useKytChat.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAiB,MAAM,SAAS,CAAA;AAMhE,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS;;;;yBAO1B,MAAM;;EA6DvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kyt-chat",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Embeddable KYT chat widget β€” self-contained, no React required by host",
5
5
  "license": "MIT",
6
6
  "type": "module",