kyt-chat 1.0.0 β†’ 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.
package/README.md CHANGED
@@ -90,14 +90,16 @@ No React, no npm, no bundler needed.
90
90
 
91
91
  <script src="https://cdn.jsdelivr.net/npm/kyt-chat/dist/kyt-chat.iife.js"></script>
92
92
  <script>
93
- KytUI.mountBubble({
94
- queryUrl: 'https://your-proxy.example.com/query',
95
- title: 'Ask anything',
96
- primaryColor: '#1565c0',
97
- }, '#chat')
98
-
99
- // OR full-page:
100
- // KytUI.mountChat({ queryUrl: '...' }, '#chat')
93
+ document.addEventListener('DOMContentLoaded', function () {
94
+ KytChat.mountBubble({
95
+ queryUrl: 'https://your-proxy.example.com/query',
96
+ title: 'Ask anything',
97
+ primaryColor: '#1565c0',
98
+ }, '#chat')
99
+
100
+ // OR full-page:
101
+ // KytChat.mountChat({ queryUrl: '...' }, '#chat')
102
+ })
101
103
  </script>
102
104
  ```
103
105
 
@@ -1,4 +1,4 @@
1
- var KytUI=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var ee=Array.isArray;function S(){}var C={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function ne(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function re(e,t){return ne(e.type,t,e.props)}function w(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ie(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ae=/\/+/g;function oe(e,t){return typeof e==`object`&&e&&e.key!=null?ie(``+e.key):t.toString(36)}function se(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(S,S):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ce(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ce(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+oe(e,0):a,ee(o)?(i=``,c!=null&&(i=c.replace(ae,`$&/`)+`/`),ce(o,r,i,``,function(e){return e})):o!=null&&(w(o)&&(o=re(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ae,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(ee(e))for(var u=0;u<e.length;u++)a=e[u],s=l+oe(a,u),c+=ce(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+oe(a,u++),c+=ce(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ce(se(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function le(e,t,n){if(e==null)return e;var r=[],i=0;return ce(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ue(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var T=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},E={map:le,forEach:function(e,t,n){le(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return le(e,function(){t++}),t},toArray:function(e){return le(e,function(e){return e})||[]},only:function(e){if(!w(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=E,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return C.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!te.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return ne(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)te.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return ne(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=w,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ue}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=C.T,n={};C.T=n;try{var r=e(),i=C.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(S,T)}catch(e){T(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),C.T=t}},e.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},e.use=function(e){return C.H.use(e)},e.useActionState=function(e,t,n){return C.H.useActionState(e,t,n)},e.useCallback=function(e,t){return C.H.useCallback(e,t)},e.useContext=function(e){return C.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return C.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return C.H.useEffect(e,t)},e.useEffectEvent=function(e){return C.H.useEffectEvent(e)},e.useId=function(){return C.H.useId()},e.useImperativeHandle=function(e,t,n){return C.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return C.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return C.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return C.H.useMemo(e,t)},e.useOptimistic=function(e,t){return C.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return C.H.useReducer(e,t,n)},e.useRef=function(e){return C.H.useRef(e)},e.useState=function(e){return C.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return C.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return C.H.useTransition()},e.version=`19.2.4`})),r=t(((e,t)=>{t.exports=n()})),i=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,ee||(ee=!0,w());else{var t=n(l);t!==null&&oe(x,t.startTime-e)}}var ee=!1,S=-1,C=5,te=-1;function ne(){return g?!0:!(e.unstable_now()-te<C)}function re(){if(g=!1,ee){var t=e.unstable_now();te=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(S),S=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ne());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&oe(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?w():ee=!1}}}var w;if(typeof y==`function`)w=function(){y(re)};else if(typeof MessageChannel<`u`){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=re,w=function(){ae.postMessage(null)}}else w=function(){_(re,0)};function oe(t,n){S=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):C=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(S),S=-1):h=!0,oe(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,w()))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),a=t(((e,t)=>{t.exports=i()})),o=t((e=>{var t=r();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.4`})),s=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=o()})),c=t((e=>{var t=a(),n=r(),i=s();function o(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(o(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=a;break}if(c===r){s=!0,r=i,n=a;break}c=c.sibling}if(!s){for(c=a.child;c;){if(c===n){s=!0,n=a,r=i;break}if(c===r){s=!0,r=a,n=i;break}c=c.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),ee=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),te=Symbol.for(`react.suspense`),ne=Symbol.for(`react.suspense_list`),re=Symbol.for(`react.memo`),w=Symbol.for(`react.lazy`),ie=Symbol.for(`react.activity`),ae=Symbol.for(`react.memo_cache_sentinel`),oe=Symbol.iterator;function se(e){return typeof e!=`object`||!e?null:(e=oe&&e[oe]||e[`@@iterator`],typeof e==`function`?e:null)}var ce=Symbol.for(`react.client.reference`);function le(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case te:return`Suspense`;case ne:return`SuspenseList`;case ie:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case S:return e.displayName||`Context`;case ee:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case re:return t=e.displayName||null,t===null?le(e.type)||`Memo`:t;case w:t=e._payload,e=e._init;try{return le(e(t))}catch{}}return null}var ue=Array.isArray,T=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},fe=[],pe=-1;function me(e){return{current:e}}function D(e){0>pe||(e.current=fe[pe],fe[pe]=null,pe--)}function O(e,t){pe++,fe[pe]=e.current,e.current=t}var he=me(null),ge=me(null),_e=me(null),ve=me(null);function ye(e,t){switch(O(_e,t),O(ge,e),O(he,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}D(he),O(he,e)}function be(){D(he),D(ge),D(_e)}function xe(e){e.memoizedState!==null&&O(ve,e);var t=he.current,n=Hd(t,e.type);t!==n&&(O(ge,e),O(he,n))}function Se(e){ge.current===e&&(D(he),D(ge)),ve.current===e&&(D(ve),Qf._currentValue=de)}var Ce,we;function Te(e){if(Ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ce=t&&t[1]||``,we=-1<e.stack.indexOf(`
1
+ var KytChat=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var ee=Array.isArray;function S(){}var C={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function ne(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function re(e,t){return ne(e.type,t,e.props)}function w(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ie(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ae=/\/+/g;function oe(e,t){return typeof e==`object`&&e&&e.key!=null?ie(``+e.key):t.toString(36)}function se(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(S,S):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ce(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ce(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+oe(e,0):a,ee(o)?(i=``,c!=null&&(i=c.replace(ae,`$&/`)+`/`),ce(o,r,i,``,function(e){return e})):o!=null&&(w(o)&&(o=re(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ae,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(ee(e))for(var u=0;u<e.length;u++)a=e[u],s=l+oe(a,u),c+=ce(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+oe(a,u++),c+=ce(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ce(se(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function le(e,t,n){if(e==null)return e;var r=[],i=0;return ce(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ue(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var T=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},E={map:le,forEach:function(e,t,n){le(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return le(e,function(){t++}),t},toArray:function(e){return le(e,function(e){return e})||[]},only:function(e){if(!w(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=E,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return C.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!te.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return ne(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)te.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return ne(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=w,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ue}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=C.T,n={};C.T=n;try{var r=e(),i=C.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(S,T)}catch(e){T(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),C.T=t}},e.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},e.use=function(e){return C.H.use(e)},e.useActionState=function(e,t,n){return C.H.useActionState(e,t,n)},e.useCallback=function(e,t){return C.H.useCallback(e,t)},e.useContext=function(e){return C.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return C.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return C.H.useEffect(e,t)},e.useEffectEvent=function(e){return C.H.useEffectEvent(e)},e.useId=function(){return C.H.useId()},e.useImperativeHandle=function(e,t,n){return C.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return C.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return C.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return C.H.useMemo(e,t)},e.useOptimistic=function(e,t){return C.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return C.H.useReducer(e,t,n)},e.useRef=function(e){return C.H.useRef(e)},e.useState=function(e){return C.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return C.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return C.H.useTransition()},e.version=`19.2.4`})),r=t(((e,t)=>{t.exports=n()})),i=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,ee||(ee=!0,w());else{var t=n(l);t!==null&&oe(x,t.startTime-e)}}var ee=!1,S=-1,C=5,te=-1;function ne(){return g?!0:!(e.unstable_now()-te<C)}function re(){if(g=!1,ee){var t=e.unstable_now();te=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(S),S=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ne());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&oe(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?w():ee=!1}}}var w;if(typeof y==`function`)w=function(){y(re)};else if(typeof MessageChannel<`u`){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=re,w=function(){ae.postMessage(null)}}else w=function(){_(re,0)};function oe(t,n){S=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):C=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(S),S=-1):h=!0,oe(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,w()))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),a=t(((e,t)=>{t.exports=i()})),o=t((e=>{var t=r();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.4`})),s=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=o()})),c=t((e=>{var t=a(),n=r(),i=s();function o(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(o(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=a;break}if(c===r){s=!0,r=i,n=a;break}c=c.sibling}if(!s){for(c=a.child;c;){if(c===n){s=!0,n=a,r=i;break}if(c===r){s=!0,r=a,n=i;break}c=c.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),ee=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),te=Symbol.for(`react.suspense`),ne=Symbol.for(`react.suspense_list`),re=Symbol.for(`react.memo`),w=Symbol.for(`react.lazy`),ie=Symbol.for(`react.activity`),ae=Symbol.for(`react.memo_cache_sentinel`),oe=Symbol.iterator;function se(e){return typeof e!=`object`||!e?null:(e=oe&&e[oe]||e[`@@iterator`],typeof e==`function`?e:null)}var ce=Symbol.for(`react.client.reference`);function le(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case te:return`Suspense`;case ne:return`SuspenseList`;case ie:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case S:return e.displayName||`Context`;case ee:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case re:return t=e.displayName||null,t===null?le(e.type)||`Memo`:t;case w:t=e._payload,e=e._init;try{return le(e(t))}catch{}}return null}var ue=Array.isArray,T=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,E=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},fe=[],pe=-1;function me(e){return{current:e}}function D(e){0>pe||(e.current=fe[pe],fe[pe]=null,pe--)}function O(e,t){pe++,fe[pe]=e.current,e.current=t}var he=me(null),ge=me(null),_e=me(null),ve=me(null);function ye(e,t){switch(O(_e,t),O(ge,e),O(he,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}D(he),O(he,e)}function be(){D(he),D(ge),D(_e)}function xe(e){e.memoizedState!==null&&O(ve,e);var t=he.current,n=Hd(t,e.type);t!==n&&(O(ge,e),O(he,n))}function Se(e){ge.current===e&&(D(he),D(ge)),ve.current===e&&(D(ve),Qf._currentValue=de)}var Ce,we;function Te(e){if(Ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ce=t&&t[1]||``,we=-1<e.stack.indexOf(`
2
2
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
3
  `+Ce+e+we}var Ee=!1;function De(e,t){if(!e||Ee)return``;Ee=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
4
  `),l=s.split(`
@@ -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-ui: 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, {
@@ -9148,7 +9151,7 @@ function se({ config: e, style: t, className: n }) {
9148
9151
  //#region index.ts
9149
9152
  function ce(e) {
9150
9153
  let t = document.querySelector(e);
9151
- if (!t) throw Error(`kyt-ui: no element found for selector "${e}"`);
9154
+ if (!t) throw Error(`kyt-chat: no element found for selector "${e}"`);
9152
9155
  return t;
9153
9156
  }
9154
9157
  function le(e, t) {
@@ -10,8 +10,8 @@ export declare function mountBubble(config: KytConfig, selector: string): void;
10
10
  export declare function mountChat(config: KytConfig, selector: string): void;
11
11
  /**
12
12
  * Generic helper β€” choose mode explicitly.
13
- * KytUI.mount(config, '#chat', 'bubble') // default
14
- * KytUI.mount(config, '#chat', 'chat')
13
+ * KytChat.mount(config, '#chat', 'bubble') // default
14
+ * KytChat.mount(config, '#chat', 'chat')
15
15
  */
16
16
  export declare function mount(config: KytConfig, selector: string, mode?: 'bubble' | 'chat'): void;
17
17
  //# sourceMappingURL=index.d.ts.map
@@ -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/dist/test.html CHANGED
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>kyt-ui β€” local test</title>
6
+ <title>kyt-chat β€” local test</title>
7
7
  <style>
8
8
  * { box-sizing: border-box; margin: 0; padding: 0; }
9
9
  body { background: #0a0a0f; color: #f0f0f5; font-family: -apple-system, sans-serif; }
@@ -73,7 +73,7 @@
73
73
  document.getElementById('chat-container').classList.remove('visible')
74
74
 
75
75
  if (!bubbleMounted) {
76
- KytUI.mountBubble(config, '#bubble-container')
76
+ KytChat.mountBubble(config, '#bubble-container')
77
77
  bubbleMounted = true
78
78
  }
79
79
  }
@@ -84,7 +84,7 @@
84
84
  document.getElementById('chat-container').classList.add('visible')
85
85
 
86
86
  if (!chatMounted) {
87
- KytUI.mountChat(config, '#chat-container')
87
+ KytChat.mountChat(config, '#chat-container')
88
88
  chatMounted = true
89
89
  }
90
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kyt-chat",
3
- "version": "1.0.0",
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",