@smarter.sh/ui-chat 0.36.1 → 0.36.2-alpha.1

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.
@@ -564,7 +564,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
564
564
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kl(e,t){if(e){if(typeof e==`string`)return ql(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ql(e,t):void 0}}function ql(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Jl(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Yl(e){if(Array.isArray(e))return e}function Xl(e,t){if(e==null)return{};var n,r,i=Zl(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Zl(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ql(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function $l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,lu(r.key),r)}}function eu(e,t,n){return t&&$l(e.prototype,t),n&&$l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tu(e,t,n){return t=au(t),nu(e,iu()?Reflect.construct(t,n||[],au(e).constructor):t.apply(e,n))}function nu(e,t){if(t&&(Hl(t)==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return ru(e)}function ru(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function iu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(iu=function(){return!!e})()}function au(e){return au=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},au(e)}function ou(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&su(e,t)}function su(e,t){return su=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},su(e,t)}function cu(e,t,n){return(t=lu(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lu(e){var t=uu(e,`string`);return Hl(t)==`symbol`?t:t+``}function uu(e,t){if(Hl(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Hl(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var du=function(e){function n(e){var r;return Ql(this,n),r=tu(this,n,[e]),cu(r,`handleResize`,function(){r.containerRef.current.clientHeight<r.lastClientHeight&&r.scrollToEnd(r.props.scrollBehavior),r.scrollRef.current.updateScroll()}),cu(r,`handleContainerResize`,function(){r.resizeTicking===!1&&(window.requestAnimationFrame(function(){var e=r.containerRef.current;if(e){var t=e.clientHeight-r.lastClientHeight;t>=1?r.preventScrollTop===!1&&(e.scrollTop=Math.round(e.scrollTop)-t):e.scrollTop-=t,r.lastClientHeight=e.clientHeight,r.scrollRef.current.updateScroll()}r.resizeTicking=!1}),r.resizeTicking=!0)}),cu(r,`isSticked`,function(){var e=r.containerRef.current;return e.scrollHeight===Math.round(e.scrollTop+e.clientHeight)}),cu(r,`handleScroll`,function(){r.scrollTicking===!1&&(window.requestAnimationFrame(function(){r.noScroll===!1?r.preventScrollTop=r.isSticked():r.noScroll=!1,r.scrollTicking=!1}),r.scrollTicking=!0)}),cu(r,`getLastMessageOrGroup`,function(){var e=r.containerRef.current.querySelector(`[data-cs-message-list]>[data-cs-message]:last-of-type,[data-cs-message-list]>[data-cs-message-group]:last-of-type`);return{lastElement:e,lastMessageInGroup:e?.querySelector(`[data-cs-message]:last-of-type`)}}),r.scrollPointRef=t.default.createRef(),r.containerRef=t.default.createRef(),r.scrollRef=t.default.createRef(),r.lastClientHeight=0,r.preventScrollTop=!1,r.resizeObserver=void 0,r.scrollTicking=!1,r.resizeTicking=!1,r.noScroll=void 0,r}return ou(n,e),eu(n,[{key:`getSnapshotBeforeUpdate`,value:function(){var e=this.containerRef.current,t=Math.round(e.scrollTop+e.clientHeight);return{sticky:e.scrollHeight===t||e.scrollHeight+1===t||e.scrollHeight-1===t,clientHeight:e.clientHeight,scrollHeight:e.scrollHeight,lastMessageOrGroup:this.getLastMessageOrGroup(),diff:e.scrollHeight-e.scrollTop}}},{key:`componentDidMount`,value:function(){this.props.autoScrollToBottomOnMount===!0&&this.scrollToEnd(this.props.scrollBehavior),this.lastClientHeight=this.containerRef.current.clientHeight,window.addEventListener(`resize`,this.handleResize),typeof window.ResizeObserver==`function`&&(this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.resizeObserver.observe(this.containerRef.current)),this.containerRef.current.addEventListener(`scroll`,this.handleScroll)}},{key:`componentDidUpdate`,value:function(e,t,n){var r=this.props.autoScrollToBottom;if(n!==void 0){var i=this.containerRef.current,a=this.getLastMessageOrGroup(),o=a.lastElement,s=a.lastMessageInGroup;if(o===n.lastMessageOrGroup.lastElement&&(s===void 0||s===n.lastMessageOrGroup.lastMessageInGroup)&&(i.scrollTop=i.scrollHeight-n.diff+(this.lastClientHeight-i.clientHeight)),n.sticky===!0)r===!0&&this.scrollToEnd(this.props.scrollBehavior),this.preventScrollTop=!0;else if(n.clientHeight<this.lastClientHeight){var c=i.scrollTop+this.lastClientHeight;i.scrollHeight===c||i.scrollHeight+1===c||i.scrollHeight-1===c?r===!0&&(this.scrollToEnd(this.props.scrollBehavior),this.preventScrollTop=!0):this.preventScrollTop=!1}else this.preventScrollTop=!1,o===n.lastMessageOrGroup.lastElement&&(s===void 0||s===n.lastMessageOrGroup.lastMessageInGroup)&&i.scrollTop===0&&i.scrollHeight>n.scrollHeight&&(i.scrollTop=i.scrollHeight-n.scrollHeight);this.lastClientHeight=n.clientHeight}}},{key:`componentWillUnmount`,value:function(){window.removeEventListener(`resize`,this.handleResize),this.resizeObserver!==void 0&&this.resizeObserver.disconnect(),this.containerRef.current.removeEventListener(`scroll`,this.handleScroll)}},{key:`scrollToEnd`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props.scrollBehavior,t=this.containerRef.current,n=this.scrollPointRef.current,r=t.getBoundingClientRect(),i=n.getBoundingClientRect().top+t.scrollTop-r.top;t.scrollBy?t.scrollBy({top:i,behavior:e}):t.scrollTop=i,this.lastClientHeight=t.clientHeight,this.noScroll=!0}},{key:`render`,value:function(){var e=this,n=this.props,r=n.children,i=n.typingIndicator,a=n.loading,o=n.loadingMore,s=n.loadingMorePosition,c=n.onYReachStart,l=n.onYReachEnd,u=n.className,d=n.disableOnYReachWhenNoScroll;n.scrollBehavior,n.autoScrollToBottom,n.autoScrollToBottomOnMount;var f=Xl(n,Vl),p=`cs-message-list`,m=Wl(Ce(r,[Bl]),1)[0];return t.default.createElement(`div`,Ul({},f,{className:(0,D.default)(p,u)}),o&&t.default.createElement(`div`,{className:(0,D.default)(`${p}__loading-more`,cu({},`${p}__loading-more--bottom`,s===`bottom`))},t.default.createElement(fc,null)),a&&t.default.createElement(Sc,null,t.default.createElement(fc,null)),t.default.createElement(nc,Ul({onYReachStart:c,onYReachEnd:l,onSync:function(e){return e.update(d)},className:`${p}__scroll-wrapper`,ref:this.scrollRef,containerRef:function(t){return e.containerRef.current=t},options:{suppressScrollX:!0}},cu({},`data-cs-message-list`,``),{style:{overscrollBehaviorY:`none`,overflowAnchor:`auto`,touchAction:`none`}}),m||r,t.default.createElement(`div`,{className:`${p}__scroll-to`,ref:this.scrollPointRef})),i!==void 0&&t.default.createElement(`div`,{className:`${p}__typing-indicator-container`},i))}}])}(t.default.Component);du.displayName=`MessageList`;function fu(e,n){var r=(0,t.useRef)(),i=function(e){return r.current.scrollToEnd(e)};return(0,t.useImperativeHandle)(n,function(){return{scrollToBottom:i}}),t.default.createElement(du,Ul({ref:r},e))}var pu=(0,t.forwardRef)(fu);pu.propTypes={children:Te([Qc,kl,Fl,Bl]),typingIndicator:E.default.node,loading:E.default.bool,loadingMore:E.default.bool,loadingMorePosition:E.default.oneOf([`top`,`bottom`]),onYReachStart:E.default.func,onYReachEnd:E.default.func,disableOnYReachWhenNoScroll:E.default.bool,autoScrollToBottom:E.default.bool,autoScrollToBottomOnMount:E.default.bool,scrollBehavior:E.default.oneOf([`auto`,`smooth`]),className:E.default.string},pu.defaultProps={typingIndicator:void 0,loading:!1,loadingMore:!1,loadingMorePosition:`top`,disableOnYReachWhenNoScroll:!1,autoScrollToBottom:!0,autoScrollToBottomOnMount:!0,scrollBehavior:`auto`},process.env.NODE_ENV!==`production`&&(du.propTypes=pu.propTypes),du.defaultProps=pu.defaultProps,pu.Content=Bl;var mu=pu;function hu(e){"@babel/helpers - typeof";return hu=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},hu(e)}function gu(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function _u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Du(r.key),r)}}function vu(e,t,n){return t&&_u(e.prototype,t),n&&_u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function yu(e,t,n){return t=Cu(t),bu(e,Su()?Reflect.construct(t,n||[],Cu(e).constructor):t.apply(e,n))}function bu(e,t){if(t&&(hu(t)==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return xu(e)}function xu(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Su(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Su=function(){return!!e})()}function Cu(e){return Cu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Cu(e)}function wu(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tu(e,t)}function Tu(e,t){return Tu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Tu(e,t)}function Eu(e,t,n){return(t=Du(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Du(e){var t=Ou(e,`string`);return hu(t)==`symbol`?t:t+``}function Ou(e,t){if(hu(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(hu(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var ku=function(e,t){var n=document.activeElement===e,r=document.createTextNode(``);if(e.appendChild(r),r!==null&&r.nodeValue!==null&&(n||t)){var i=window.getSelection();if(i!==null){var a=document.createRange();a.setStart(r,r.nodeValue.length),a.collapse(!0),i.removeAllRanges(),i.addRange(a)}}},Au=function(e){function n(e){var r;return gu(this,n),r=yu(this,n,[e]),Eu(r,`innerHTML`,function(){var e=r.props.value;return{__html:e===void 0?``:e}}),Eu(r,`handleKeyPress`,function(e){var t=r.props.onKeyPress;t?.(e)}),Eu(r,`handleInput`,function(e){var t=r.props.onChange,n=e.target;t?.(n.innerHTML,n.textContent,n.innerText)}),r.msgRef=t.default.createRef(),r}return wu(n,e),vu(n,[{key:`focus`,value:function(){this.msgRef.current!==void 0&&this.msgRef.current.focus()}},{key:`componentDidMount`,value:function(){this.props.autoFocus===!0&&this.msgRef.current.focus()}},{key:`shouldComponentUpdate`,value:function(e){var t=this.msgRef,n=this.props,r=n.placeholder,i=n.disabled,a=n.activateAfterChange;return t.current===void 0||e.value!==t.current.innerHTML||r!==e.placeholder||i!==e.disabled||a!==e.activateAfterChange}},{key:`componentDidUpdate`,value:function(){var e=this.msgRef,t=this.props,n=t.value,r=t.activateAfterChange;n!==e.current.innerHTML&&(e.current.innerHTML=typeof n==`string`?n:``),ku(e.current,r)}},{key:`render`,value:function(){var e=this.msgRef,n=this.handleInput,r=this.handleKeyPress,i=this.innerHTML,a=this.props,o=a.placeholder,s=a.disabled,c=a.className,l=typeof o==`string`?o:``;return t.default.createElement(`div`,{ref:e,className:c,contentEditable:s===!1,disabled:s,"data-placeholder":l,onInput:n,onKeyPress:r,dangerouslySetInnerHTML:i()})}}])}(t.Component);process.env.NODE_ENV!==`production`&&(Au.propTypes={value:E.default.string,placeholder:E.default.string,disabled:E.default.bool,activateAfterChange:E.default.bool,autoFocus:E.default.bool,onChange:E.default.func,onKeyPress:E.default.func,className:E.default.string});var ju=Au;function Mu(e){"@babel/helpers - typeof";return Mu=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Mu(e)}var Nu=[`fancyScroll`,`children`,`forwardedRef`],Pu=[`value`,`onSend`,`onChange`,`autoFocus`,`placeholder`,`fancyScroll`,`className`,`activateAfterChange`,`disabled`,`sendDisabled`,`sendOnReturnDisabled`,`attachDisabled`,`sendButton`,`attachButton`,`onAttachClick`];function Fu(e,t,n){return(t=Ju(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iu(e,t){return Vu(e)||Bu(e,t)||Ru(e,t)||Lu()}function Lu(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
565
565
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ru(e,t){if(e){if(typeof e==`string`)return zu(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zu(e,t):void 0}}function zu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Bu(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Vu(e){if(Array.isArray(e))return e}function Hu(){return Hu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hu.apply(null,arguments)}function Uu(e,t){if(e==null)return{};var n,r,i=Wu(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Wu(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Gu(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Ku(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Ju(r.key),r)}}function qu(e,t,n){return t&&Ku(e.prototype,t),n&&Ku(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ju(e){var t=Yu(e,`string`);return Mu(t)==`symbol`?t:t+``}function Yu(e,t){if(Mu(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Mu(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Xu(e,t,n){return t=ed(t),Zu(e,$u()?Reflect.construct(t,n||[],ed(e).constructor):t.apply(e,n))}function Zu(e,t){if(t&&(Mu(t)==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Qu(e)}function Qu(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function $u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($u=function(){return!!e})()}function ed(e){return ed=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ed(e)}function td(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nd(e,t)}function nd(e,t){return nd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},nd(e,t)}function rd(){var e=function(e){function n(){return Gu(this,n),Xu(this,n,arguments)}return td(n,e),qu(n,[{key:`render`,value:function(){var e=this.props,n=e.fancyScroll,r=e.children,i=e.forwardedRef,a=Uu(e,Nu);return t.default.createElement(t.default.Fragment,null,n===!0&&t.default.createElement(nc,Hu({ref:function(e){return i.current=e}},a,{options:{suppressScrollX:!0}}),r),n===!1&&t.default.createElement(`div`,Hu({ref:i},a),r))}}])}(t.Component);return t.default.forwardRef(function(n,r){return t.default.createElement(e,Hu({forwardedRef:r},n))})}var id=rd(),ad=function(e,n){var r=Iu((0,t.useState)(e===void 0?n:e),2),i=r[0],a=r[1];return[e===void 0?i:e,function(e){a(e)}]};function od(e,n){var r=e.value,i=r===void 0?void 0:r,a=e.onSend,o=a===void 0?xe:a,s=e.onChange,c=s===void 0?xe:s,l=e.autoFocus,u=l!==void 0&&l,d=e.placeholder,f=d===void 0?``:d,p=e.fancyScroll,m=p===void 0||p,h=e.className,g=e.activateAfterChange,_=g!==void 0&&g,v=e.disabled,y=v!==void 0&&v,b=e.sendDisabled,x=e.sendOnReturnDisabled,S=x!==void 0&&x,C=e.attachDisabled,w=C!==void 0&&C,T=e.sendButton,E=T===void 0||T,O=e.attachButton,k=O===void 0||O,A=e.onAttachClick,ee=A===void 0?xe:A,j=Uu(e,Pu),M=(0,t.useRef)(),N=(0,t.useRef)(),te=Iu(ad(i,``),2),ne=te[0],re=te[1],ie=Iu(ad(b,!0),2),ae=ie[0],oe=ie[1],se=function(){N.current!==void 0&&N.current.focus()};(0,t.useImperativeHandle)(n,function(){return{focus:se}}),(0,t.useEffect)(function(){u===!0&&se()},[]),(0,t.useEffect)(function(){typeof M.current.updateScroll==`function`&&M.current.updateScroll()});var P=function(){var e=N.current.msgRef.current;return[e.textContent,e.innerText,e.cloneNode(!0).childNodes]},ce=function(){if(ne.length>0){i===void 0&&re(``),b===void 0&&oe(!0);var e=P();o(ne,e[0],e[1],e[2])}},le=function(e){e.key===`Enter`&&e.shiftKey===!1&&S===!1&&(e.preventDefault(),ce())},ue=function(e,t,n){re(e),b===void 0&&oe(t.length===0),typeof M.current.updateScroll==`function`&&M.current.updateScroll(),c(e,t,n,P()[2])},de=`cs-message-input`,fe=typeof f==`string`?f:``;return t.default.createElement(`div`,Hu({},j,{className:(0,D.default)(de,Fu({},`${de}--disabled`,y),h)}),k===!0&&t.default.createElement(`div`,{className:`${de}__tools`},t.default.createElement(ko,{onClick:ee,disabled:y===!0||w===!0})),t.default.createElement(`div`,{className:`${de}__content-editor-wrapper`},t.default.createElement(id,{fancyScroll:m,ref:M,className:`${de}__content-editor-container`},t.default.createElement(ju,{ref:N,className:`${de}__content-editor`,disabled:y,placeholder:fe,onKeyPress:le,onChange:ue,activateAfterChange:_,value:ne}))),E===!0&&t.default.createElement(`div`,{className:`${de}__tools`},t.default.createElement(Co,{onClick:ce,disabled:y===!0||ae===!0})))}var sd=(0,t.forwardRef)(od);sd.displayName=`MessageInput`,sd.propTypes={value:E.default.string,placeholder:E.default.string,disabled:E.default.bool,sendOnReturnDisabled:E.default.bool,sendDisabled:E.default.bool,fancyScroll:E.default.bool,activateAfterChange:E.default.bool,autoFocus:E.default.bool,onChange:E.default.func,onSend:E.default.func,className:E.default.string,sendButton:E.default.bool,attachButton:E.default.bool,attachDisabled:E.default.bool,onAttachClick:E.default.func},process.env.NODE_ENV!==`production`&&(od.propTypes=sd.propTypes);var cd=sd,ld=[`className`,`children`];function ud(){return ud=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ud.apply(null,arguments)}function dd(e,t){if(e==null)return{};var n,r,i=fd(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function fd(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var pd=function(e){var n=e.className,r=e.children,i=dd(e,ld);return t.default.createElement(`div`,ud({},i,{className:(0,D.default)(`cs-input-toolbox`,n)}),r)};pd.displayName=`InputToolbox`,process.env.NODE_ENV!==`production`&&(pd.propTypes={children:E.default.node,className:E.default.string});var md=pd,hd=[`children`,`className`];function gd(){return gd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gd.apply(null,arguments)}function _d(e,t){return Sd(e)||xd(e,t)||yd(e,t)||vd()}function vd(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
566
566
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yd(e,t){if(e){if(typeof e==`string`)return bd(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bd(e,t):void 0}}function bd(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xd(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Sd(e){if(Array.isArray(e))return e}function Cd(e,t){if(e==null)return{};var n,r,i=wd(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function wd(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Td=function(e){var n=e.children,r=n===void 0?void 0:n,i=e.className,a=Cd(e,hd),o=`cs-chat-container`,s=_d(Ce(r,[ns,mu,cd,md]),4),c=s[0],l=s[1],u=s[2],d=s[3];return t.default.createElement(`div`,gd({},a,{className:(0,D.default)(o,i)}),c,l,u,d)};process.env.NODE_ENV!==`production`&&(Td.propTypes={children:Te([ns,mu,cd,md]),className:E.default.string});var Ed=Td;process.env.NODE_ENV!==`production`&&(E.default.node,E.default.string,E.default.bool),process.env.NODE_ENV!==`production`&&E.default.node,process.env.NODE_ENV!==`production`&&E.default.node,process.env.NODE_ENV!==`production`&&(E.default.node,E.default.string,E.default.node,E.default.node,E.default.node),process.env.NODE_ENV!==`production`&&(E.default.node,E.default.number,E.default.bool,E.default.node,E.default.node,E.default.node,E.default.bool,E.default.string),process.env.NODE_ENV!==`production`&&(E.default.bool,E.default.bool,E.default.bool,E.default.func,E.default.string);var Dd=u((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=`fas`,n=`chevron-left`,r=320,i=512,a=[9001],o=`f053`,s=`M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z`;e.definition={prefix:t,iconName:n,icon:[r,i,a,o,s]},e.faChevronLeft=e.definition,e.prefix=t,e.iconName=n,e.width=r,e.height=i,e.ligatures=a,e.unicode=o,e.svgPathData=s,e.aliases=a})),Od=u((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=`fas`,n=`chevron-down`,r=512,i=512,a=[],o=`f078`,s=`M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z`;e.definition={prefix:t,iconName:n,icon:[r,i,a,o,s]},e.faChevronDown=e.definition,e.prefix=t,e.iconName=n,e.width=r,e.height=i,e.ligatures=a,e.unicode=o,e.svgPathData=s,e.aliases=a}));Dd(),Od(),process.env.NODE_ENV!==`production`&&(E.default.node,E.default.string,E.default.bool,E.default.bool,E.default.string,E.default.func);function kd(e){"@babel/helpers - typeof";return kd=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},kd(e)}var Ad=[`responsive`,`children`,`className`];function jd(){return jd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jd.apply(null,arguments)}function Md(e,t,n){return(t=Nd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nd(e){var t=Pd(e,`string`);return kd(t)==`symbol`?t:t+``}function Pd(e,t){if(kd(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(kd(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Fd(e,t){if(e==null)return{};var n,r,i=Id(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Id(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ld=function(e){var n=e.responsive,r=n!==void 0&&n,i=e.children,a=i===void 0?void 0:i,o=e.className,s=Fd(e,Ad),c=`cs-main-container`;return t.default.createElement(`div`,jd({},s,{className:(0,D.default)(c,Md({},`${c}--responsive`,r),o)}),a)};process.env.NODE_ENV!==`production`&&(Ld.propTypes={children:E.default.node,responsive:E.default.bool,className:E.default.string});var Rd=Ld,zd={prefix:`fas`,iconName:`magnifying-glass`,icon:[512,512,[128269,`search`],`f002`,`M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z`]},Bd={prefix:`fas`,iconName:`xmark`,icon:[384,512,[128473,10005,10006,10060,215,`close`,`multiply`,`remove`,`times`],`f00d`,`M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z`]};function Vd(e){"@babel/helpers - typeof";return Vd=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Vd(e)}var Hd=[`placeholder`,`value`,`onChange`,`onClearClick`,`className`,`disabled`];function Ud(){return Ud=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ud.apply(null,arguments)}function Wd(e,t,n){return(t=Gd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gd(e){var t=Kd(e,`string`);return Vd(t)==`symbol`?t:t+``}function Kd(e,t){if(Vd(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Vd(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function qd(e,t){return Qd(e)||Zd(e,t)||Yd(e,t)||Jd()}function Jd(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
567
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yd(e,t){if(e){if(typeof e==`string`)return Xd(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xd(e,t):void 0}}function Xd(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Zd(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Qd(e){if(Array.isArray(e))return e}function $d(e,t){if(e==null)return{};var n,r,i=ef(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ef(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var tf=function(e,n){return n===void 0?(0,t.useState)(e):[n,function(){}]};function nf(e,n){var r=e.placeholder,i=r===void 0?``:r,a=e.value,o=a===void 0?void 0:a,s=e.onChange,c=s===void 0?function(){}:s,l=e.onClearClick,u=l===void 0?function(){}:l,d=e.className,f=e.disabled,p=f!==void 0&&f,m=$d(e,Hd),h=`cs-search`,g=(0,t.useMemo)(function(){return o!==void 0},[]),_=qd(tf(``,o),2),v=_[0],y=_[1],b=qd((0,t.useState)(g?v.length>0:!1),2),x=b[0],S=b[1];if(g!==(o!==void 0))throw`Search: Changing from controlled to uncontrolled component and vice versa is not allowed`;var C=(0,t.useRef)(void 0),w=function(){C.current!==void 0&&C.current.focus()};return(0,t.useImperativeHandle)(n,function(){return{focus:w}}),t.default.createElement(`div`,Ud({},m,{className:(0,D.default)(h,Wd({},`${h}--disabled`,p),d)}),t.default.createElement(Xa,{icon:zd,className:`${h}__search-icon`}),t.default.createElement(`input`,{ref:C,type:`text`,className:`${h}__input`,placeholder:i,onChange:function(e){var t=e.target.value;S(t.length>0),g===!1&&y(t),c(t)},disabled:p,value:v}),t.default.createElement(Xa,{icon:Bd,className:(0,D.default)(`${h}__clear-icon`,Wd({},`${h}__clear-icon--active`,x)),onClick:function(){g===!1&&y(``),S(!1),u()}}))}var rf=(0,t.forwardRef)(nf);rf.displayName=`Search`,rf.propTypes={placeholder:E.default.string,value:E.default.string,onChange:E.default.func,onClearClick:E.default.func,className:E.default.string,disabled:E.default.bool},process.env.NODE_ENV!==`production`&&(nf.propTypes=rf.propTypes),process.env.NODE_ENV!==`production`&&(E.default.node,E.default.oneOf([`left`,`right`]),E.default.bool,E.default.bool,E.default.string);var af=ie,of=[`content`,`className`];function sf(){return sf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sf.apply(null,arguments)}function cf(e,t){if(e==null)return{};var n,r,i=lf(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function lf(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var uf=function(e){var n=e.content,r=n===void 0?``:n,i=e.className,a=cf(e,of),o=`cs-typing-indicator`;return t.default.createElement(`div`,sf({},a,{className:(0,D.default)(o,i)}),t.default.createElement(`div`,{className:`${o}__indicator`},t.default.createElement(`div`,{className:`${o}__dot`}),t.default.createElement(`div`,{className:`${o}__dot`}),t.default.createElement(`div`,{className:`${o}__dot`})),t.default.createElement(`div`,{className:`${o}__text`},r))};process.env.NODE_ENV!==`production`&&(uf.propTypes={content:E.default.node,className:E.default.string});var df=uf;function ff(e){"@babel/helpers - typeof";return ff=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ff(e)}var pf=[`className`,`children`,`size`,`selected`,`onChange`,`itemsTabIndex`];function mf(){return mf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mf.apply(null,arguments)}function hf(e,t,n){return(t=gf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gf(e){var t=_f(e,`string`);return ff(t)==`symbol`?t:t+``}function _f(e,t){if(ff(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ff(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function vf(e,t){if(e==null)return{};var n,r,i=yf(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function yf(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function bf(e,n){var r=e.className,i=e.children,a=e.size,o=e.selected,s=e.onChange,c=s===void 0?xe:s,l=e.itemsTabIndex,u=vf(e,pf),d=`cs-status-list`,f=(0,t.useRef)();(0,t.useImperativeHandle)(n,function(){return{focus:function(e){var t=Array.from(f.current.querySelectorAll(`li`)).filter(function(e){return e.parentNode===f.current});t[e]!==void 0&&t[e].focus()}}});var p=l;return t.default.createElement(`ul`,mf({ref:f},u,{className:(0,D.default)(d,r,hf({},`${d}--${a}`,a))}),t.default.Children.map(i,function(e){var n={};o&&(n.selected=e.props.status===o),c&&(n.onClick=function(t){c(e.props.status),e.onClick&&e.onClick(t)});var r=function(t){c&&t.key===`Enter`&&t.shiftKey===!1&&t.altKey===!1&&c(e.props.status)},i=function(){if(typeof p==`number`)return p>0?p++:p}();return t.default.createElement(`li`,{tabIndex:i,onKeyPress:r},t.default.cloneElement(e,n))}))}var xf=(0,t.forwardRef)(bf);xf.displayName=`StatusList`,xf.propTypes={children:Te([af]),selected:E.default.oneOf(O),size:E.default.oneOf(k),itemsTabIndex:E.default.number,className:E.default.string,onChange:E.default.func},process.env.NODE_ENV!==`production`&&(bf.propTypes=xf.propTypes);var Sf={name:`@smarter.sh/ui-chat`,version:`0.36.1`,description:`chatbot React.js component for the https://smarter.sh declarative, plugin-based AI resource management platform.`,homepage:`https://smarter.sh`,type:`module`,main:`./dist/smarter-chat-library.umd.js`,module:`./dist/smarter-chat-library.es.js`,types:`./dist/types/src/index.d.ts`,jsdelivr:`./dist/embed.js`,unpkg:`./dist/embed.js`,exports:{".":{types:`./dist/types/src/index.d.ts`,import:`./dist/smarter-chat-library.es.js`,require:`./dist/smarter-chat-library.umd.js`},"./dist/ui-chat.css":`./dist/ui-chat.css`,"./style.css":`./dist/ui-chat.css`,"./embed":`./dist/embed.js`,"./dist/embed.js":`./dist/embed.js`},files:[`dist`],sideEffects:[`*.css`],keywords:[`react`,`component`,`chatbot`,`ai`,`smarter`],author:`Lawrence McDaniel <lpm0073@gmail.com>, (https://lawrencemcdaniel.com/)`,license:`AGPL-3.0-or-later`,repository:{type:`git`,url:`git+https://github.com/smarter-sh/smarter.git`,directory:`smarter/react/packages/smarter.sh-chat`},bugs:{url:`https://github.com/smarter-sh/smarter/issues`},contributors:[`Lawrence McDaniel <lpm0073@gmail.com> (https://lawrencemcdaniel.com/)`],engines:{node:`>=20.17.0`,npm:`>=10.8.2`},funding:{type:`individual`,url:`https://github.com/sponsors/lpm0073`},scripts:{dev:`NODE_ENV=dev && vite`,build:`tsc -b && npm run build:lib && npm run build:embed`,"build:lib":`vite build --mode lib && tsc -p tsconfig.lib.json`,"contract:types":`node scripts/contract-types.mjs`,i18n:`node scripts/i18n.mjs`,lint:`eslint --max-warnings=0 .`,preview:`vite preview`,storybook:`storybook dev -p 6006`,"build-storybook":`storybook build`,typecheck:`tsc -b`,test:`vitest run`,"test:watch":`vitest`,prepublishOnly:`npm run build:lib && npm run build:embed`,coverage:`vitest run --coverage --config vitest.coverage.config.ts`,format:`prettier --write .`,"format:check":`prettier --check .`,"build:embed":`vite build --mode embed && vite build --mode embed-mermaid`,"check:dist":`node scripts/check-dist.mjs`},dependencies:{"@chatscope/chat-ui-kit-react":`^2.1.1`,"@chatscope/chat-ui-kit-styles":`^1.4.0`,dompurify:`^3.4.16`,"highlight.js":`^11.12.0`,katex:`^0.18.7`,marked:`^14.0.0`,mermaid:`^11.17.2`},peerDependencies:{react:`^19`,"react-dom":`^19`},devDependencies:{"@eslint/js":`^10.0.1`,"@storybook/addon-a11y":`^10.6.1`,"@storybook/addon-docs":`^10.6.1`,"@storybook/react-vite":`^10.6.1`,"@testing-library/dom":`^10.4.2`,"@testing-library/jest-dom":`^7.0.1`,"@testing-library/react":`^16.3.3`,"@testing-library/user-event":`^14.6.7`,"@types/node":`^26.6.3`,"@types/react":`^19.3.0`,"@types/react-dom":`^19.3.0`,"@vitejs/plugin-react":`^6.1.1`,"@vitest/coverage-v8":`^5.0.3`,"@vitest/eslint-plugin":`^1.6.27`,ajv:`^8.20.0`,bootstrap:`^5.3.8`,"bootstrap-icons":`^1.13.1`,eslint:`^10.11.0`,"eslint-config-prettier":`^10.1.8`,"eslint-plugin-jest-dom":`^5.10.1`,"eslint-plugin-jsx-a11y":`^6.10.2`,"eslint-plugin-react-hooks":`^7.1.1`,"eslint-plugin-react-refresh":`^0.5.7`,"eslint-plugin-storybook":`^10.6.1`,"eslint-plugin-testing-library":`^7.16.2`,globals:`^17.13.0`,jsdom:`^30.1.2`,"json-schema-to-typescript":`^15.0.4`,msw:`^2.15.0`,prettier:`^3.9.9`,react:`^19.3.0`,"react-dom":`^19.3.0`,storybook:`^10.6.1`,typescript:`~6.0.2`,"typescript-eslint":`^8.71.0`,vite:`^8.3.2`,vitest:`^5.0.3`},msw:{workerDirectory:[`.storybook/public`]},overrides:{"eslint-plugin-jsx-a11y":{eslint:`$eslint`}},publishConfig:{access:`public`}},Cf=Sf.name,wf=Sf.version,Tf=`[Smarter ${Cf} v${wf}]`,Ef=864e5;function Df(e,t){let n=(t||``).trim().split(`:`)[0].replace(/^\./,``);return!n||n===`None`||e===n||e.endsWith(`.${n}`)}function Of(e,t=null){if(e.value!==null&&e.value!==void 0&&e.value!==``)return e.value;if(!Df(window.location.hostname,e.domain)||!document.cookie)return t;for(let n of document.cookie.split(`;`)){let r=n.trim();if(r.startsWith(`${e.name}=`))return decodeURIComponent(r.substring(e.name.length+1))||t}return t}function kf(e,t){let n=e.path||window.location.pathname;if(t==null||t===``){document.cookie=`${e.name}=; path=${n}; SameSite=Lax; expires=${new Date(0).toUTCString()}`;return}let r=new Date(Date.now()+(e.expiration??0)).toUTCString();document.cookie=`${e.name}=${encodeURIComponent(String(t))}; path=${n}; SameSite=Lax; expires=${r}`}function Af(e,t,n,r=null,i=null){return{name:e,expiration:t,domain:n??``,value:r,path:i}}var jf={INCOMING:`incoming`,OUTGOING:`outgoing`},Mf={SYSTEM:`system`,ASSISTANT:`assistant`,USER:`user`,TOOL:`tool`,SMARTER:`smarter`,SMARTER_ERROR:`smarter_error`},Nf=[Mf.SYSTEM,Mf.ASSISTANT,Mf.USER,Mf.TOOL],Pf=[Mf.SMARTER,Mf.SYSTEM,Mf.TOOL],Ff={es:{plural:e=>Number(e!=1),messages:{"Loading...":`Cargando...`,valid:`válido`,"not valid":`no válido`,deployed:`implementado`,"(sandbox)":`(pruebas)`,"Something went wrong.":`Algo salió mal.`,Message:`Mensaje`,"%(provider)s %(model)s with %(count)s additional tool":[`%(provider)s %(model)s con %(count)s herramienta adicional`,`%(provider)s %(model)s con %(count)s herramientas adicionales`],Assistant:`Asistente`,You:`Tú`,"%(assistant)s: %(step)s":`%(assistant)s: %(step)s`,"%(assistant)s is typing":`%(assistant)s está escribiendo`,"Smarter Chat is not available":`Smarter Chat no está disponible`,"Configuring workbench...":`Configurando el área de trabajo...`,Chat:`Chat`,"Chat mode":`Modo del chat`,"Sandbox mode: Smarter's system, tool and meta data messages are displayed.":`Modo de pruebas: se muestran los mensajes de sistema, de herramientas y de metadatos de Smarter.`,"chat modeSandbox":`Pruebas`,"Production mode: the conversation is displayed as its users see it.":`Modo de producción: la conversación se muestra como la ven sus usuarios.`,"chat modeProduction":`Producción`,"Start a new chat":`Iniciar un chat nuevo`,"Attach a file":`Adjuntar un archivo`,"Close %(label)s":`Cerrar %(label)s`,"Unexpected response from the Smarter api (http %(status)s): %(text)s":`Respuesta inesperada de la api de Smarter (http %(status)s): %(text)s`,"The Smarter api returned http %(status)s %(statusText)s":`La api de Smarter devolvió http %(status)s %(statusText)s`,"The Smarter api returned an incomplete configuration.":`La api de Smarter devolvió una configuración incompleta.`,"The Smarter api returned an empty event stream.":`La api de Smarter devolvió un flujo de eventos vacío.`,"The Smarter api's event stream ended without a result.":`El flujo de eventos de la api de Smarter terminó sin un resultado.`,"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, %(reasoning)s of which it spent reasoning, so its response is incomplete.":[`El LLM alcanzó el máximo de tokens de este LLMClient, %(tokens)s token de completado, de los cuales usó %(reasoning)s para razonar, así que su respuesta está incompleta.`,`El LLM alcanzó el máximo de tokens de este LLMClient, %(tokens)s tokens de completado, de los cuales usó %(reasoning)s para razonar, así que su respuesta está incompleta.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, %(reasoning)s of which it spent reasoning, so its response is empty.":[`El LLM alcanzó el máximo de tokens de este LLMClient, %(tokens)s token de completado, de los cuales usó %(reasoning)s para razonar, así que su respuesta está vacía.`,`El LLM alcanzó el máximo de tokens de este LLMClient, %(tokens)s tokens de completado, de los cuales usó %(reasoning)s para razonar, así que su respuesta está vacía.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, so its response is incomplete.":[`El LLM alcanzó el máximo de tokens de este LLMClient, %(tokens)s token de completado, así que su respuesta está incompleta.`,`El LLM alcanzó el máximo de tokens de este LLMClient, %(tokens)s tokens de completado, así que su respuesta está incompleta.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, so its response is empty.":[`El LLM alcanzó el máximo de tokens de este LLMClient, %(tokens)s token de completado, así que su respuesta está vacía.`,`El LLM alcanzó el máximo de tokens de este LLMClient, %(tokens)s tokens de completado, así que su respuesta está vacía.`],"The LLM reached this LLMClient's max tokens, so its response is incomplete.":`El LLM alcanzó el máximo de tokens de este LLMClient, así que su respuesta está incompleta.`,"The LLM reached this LLMClient's max tokens, so its response is empty.":`El LLM alcanzó el máximo de tokens de este LLMClient, así que su respuesta está vacía.`,"Raise defaultMaxTokens in the LLMClient's manifest.":`Aumenta defaultMaxTokens en el manifiesto del LLMClient.`,"Copy code":`Copiar el código`,Copy:`Copiar`,"Copied!":`¡Copiado!`,"buttonCode":`Código`,"Show the diagram's code":`Mostrar el código del diagrama`,"buttonDiagram":`Diagrama`,"Show the diagram":`Mostrar el diagrama`,Diagram:`Diagrama`,"Some example prompts to get you started:":`Algunos prompts de ejemplo para empezar:`}},fr:{plural:e=>Number(e>1),messages:{"Loading...":`Chargement...`,valid:`valide`,"not valid":`non valide`,deployed:`déployé`,"(sandbox)":`(bac à sable)`,"Something went wrong.":`Une erreur s'est produite.`,Message:`Message`,"%(provider)s %(model)s with %(count)s additional tool":[`%(provider)s %(model)s avec %(count)s outil supplémentaire`,`%(provider)s %(model)s avec %(count)s outils supplémentaires`],Assistant:`Assistant`,You:`Vous`,"%(assistant)s: %(step)s":`%(assistant)s : %(step)s`,"%(assistant)s is typing":`%(assistant)s est en train d'écrire`,"Smarter Chat is not available":`Smarter Chat n'est pas disponible`,"Configuring workbench...":`Configuration de l'atelier...`,Chat:`Chat`,"Chat mode":`Mode du chat`,"Sandbox mode: Smarter's system, tool and meta data messages are displayed.":`Mode bac à sable : les messages système, d'outils et de métadonnées de Smarter sont affichés.`,"chat modeSandbox":`Bac à sable`,"Production mode: the conversation is displayed as its users see it.":`Mode production : la conversation est affichée telle que ses utilisateurs la voient.`,"chat modeProduction":`Production`,"Start a new chat":`Démarrer un nouveau chat`,"Attach a file":`Joindre un fichier`,"Close %(label)s":`Fermer %(label)s`,"Unexpected response from the Smarter api (http %(status)s): %(text)s":`Réponse inattendue de l'api de Smarter (http %(status)s) : %(text)s`,"The Smarter api returned http %(status)s %(statusText)s":`L'api de Smarter a renvoyé http %(status)s %(statusText)s`,"The Smarter api returned an incomplete configuration.":`L'api de Smarter a renvoyé une configuration incomplète.`,"The Smarter api returned an empty event stream.":`L'api de Smarter a renvoyé un flux d'événements vide.`,"The Smarter api's event stream ended without a result.":`Le flux d'événements de l'api de Smarter s'est terminé sans résultat.`,"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, %(reasoning)s of which it spent reasoning, so its response is incomplete.":[`Le LLM a atteint le nombre maximal de jetons de ce LLMClient, %(tokens)s jeton de complétion, dont %(reasoning)s consacrés au raisonnement : sa réponse est donc incomplète.`,`Le LLM a atteint le nombre maximal de jetons de ce LLMClient, %(tokens)s jetons de complétion, dont %(reasoning)s consacrés au raisonnement : sa réponse est donc incomplète.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, %(reasoning)s of which it spent reasoning, so its response is empty.":[`Le LLM a atteint le nombre maximal de jetons de ce LLMClient, %(tokens)s jeton de complétion, dont %(reasoning)s consacrés au raisonnement : sa réponse est donc vide.`,`Le LLM a atteint le nombre maximal de jetons de ce LLMClient, %(tokens)s jetons de complétion, dont %(reasoning)s consacrés au raisonnement : sa réponse est donc vide.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, so its response is incomplete.":[`Le LLM a atteint le nombre maximal de jetons de ce LLMClient, %(tokens)s jeton de complétion : sa réponse est donc incomplète.`,`Le LLM a atteint le nombre maximal de jetons de ce LLMClient, %(tokens)s jetons de complétion : sa réponse est donc incomplète.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, so its response is empty.":[`Le LLM a atteint le nombre maximal de jetons de ce LLMClient, %(tokens)s jeton de complétion : sa réponse est donc vide.`,`Le LLM a atteint le nombre maximal de jetons de ce LLMClient, %(tokens)s jetons de complétion : sa réponse est donc vide.`],"The LLM reached this LLMClient's max tokens, so its response is incomplete.":`Le LLM a atteint le nombre maximal de jetons de ce LLMClient : sa réponse est donc incomplète.`,"The LLM reached this LLMClient's max tokens, so its response is empty.":`Le LLM a atteint le nombre maximal de jetons de ce LLMClient : sa réponse est donc vide.`,"Raise defaultMaxTokens in the LLMClient's manifest.":`Augmentez defaultMaxTokens dans le manifeste du LLMClient.`,"Copy code":`Copier le code`,Copy:`Copier`,"Copied!":`Copié !`,"buttonCode":`Code`,"Show the diagram's code":`Afficher le code du diagramme`,"buttonDiagram":`Diagramme`,"Show the diagram":`Afficher le diagramme`,Diagram:`Diagramme`,"Some example prompts to get you started:":`Quelques exemples de prompts pour commencer :`}},pt_BR:{plural:e=>Number(e>1),messages:{"Loading...":`Carregando...`,valid:`válido`,"not valid":`inválido`,deployed:`implantado`,"(sandbox)":`(sandbox)`,"Something went wrong.":`Algo deu errado.`,Message:`Mensagem`,"%(provider)s %(model)s with %(count)s additional tool":[`%(provider)s %(model)s com %(count)s ferramenta adicional`,`%(provider)s %(model)s com %(count)s ferramentas adicionais`],Assistant:`Assistente`,You:`Você`,"%(assistant)s: %(step)s":`%(assistant)s: %(step)s`,"%(assistant)s is typing":`%(assistant)s está digitando`,"Smarter Chat is not available":`O Smarter Chat não está disponível`,"Configuring workbench...":`Configurando a área de trabalho...`,Chat:`Chat`,"Chat mode":`Modo do chat`,"Sandbox mode: Smarter's system, tool and meta data messages are displayed.":`Modo sandbox: as mensagens de sistema, de ferramentas e de metadados do Smarter são exibidas.`,"chat modeSandbox":`Sandbox`,"Production mode: the conversation is displayed as its users see it.":`Modo de produção: a conversa é exibida como os usuários a veem.`,"chat modeProduction":`Produção`,"Start a new chat":`Iniciar um novo chat`,"Attach a file":`Anexar um arquivo`,"Close %(label)s":`Fechar %(label)s`,"Unexpected response from the Smarter api (http %(status)s): %(text)s":`Resposta inesperada da api do Smarter (http %(status)s): %(text)s`,"The Smarter api returned http %(status)s %(statusText)s":`A api do Smarter retornou http %(status)s %(statusText)s`,"The Smarter api returned an incomplete configuration.":`A api do Smarter retornou uma configuração incompleta.`,"The Smarter api returned an empty event stream.":`A api do Smarter retornou um fluxo de eventos vazio.`,"The Smarter api's event stream ended without a result.":`O fluxo de eventos da api do Smarter terminou sem um resultado.`,"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, %(reasoning)s of which it spent reasoning, so its response is incomplete.":[`O LLM atingiu o máximo de tokens deste LLMClient, %(tokens)s token de completion, dos quais gastou %(reasoning)s raciocinando, por isso a resposta está incompleta.`,`O LLM atingiu o máximo de tokens deste LLMClient, %(tokens)s tokens de completion, dos quais gastou %(reasoning)s raciocinando, por isso a resposta está incompleta.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, %(reasoning)s of which it spent reasoning, so its response is empty.":[`O LLM atingiu o máximo de tokens deste LLMClient, %(tokens)s token de completion, dos quais gastou %(reasoning)s raciocinando, por isso a resposta está vazia.`,`O LLM atingiu o máximo de tokens deste LLMClient, %(tokens)s tokens de completion, dos quais gastou %(reasoning)s raciocinando, por isso a resposta está vazia.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, so its response is incomplete.":[`O LLM atingiu o máximo de tokens deste LLMClient, %(tokens)s token de completion, por isso a resposta está incompleta.`,`O LLM atingiu o máximo de tokens deste LLMClient, %(tokens)s tokens de completion, por isso a resposta está incompleta.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, so its response is empty.":[`O LLM atingiu o máximo de tokens deste LLMClient, %(tokens)s token de completion, por isso a resposta está vazia.`,`O LLM atingiu o máximo de tokens deste LLMClient, %(tokens)s tokens de completion, por isso a resposta está vazia.`],"The LLM reached this LLMClient's max tokens, so its response is incomplete.":`O LLM atingiu o máximo de tokens deste LLMClient, por isso a resposta está incompleta.`,"The LLM reached this LLMClient's max tokens, so its response is empty.":`O LLM atingiu o máximo de tokens deste LLMClient, por isso a resposta está vazia.`,"Raise defaultMaxTokens in the LLMClient's manifest.":`Aumente o defaultMaxTokens no manifesto do LLMClient.`,"Copy code":`Copiar o código`,Copy:`Copiar`,"Copied!":`Copiado!`,"buttonCode":`Código`,"Show the diagram's code":`Mostrar o código do diagrama`,"buttonDiagram":`Diagrama`,"Show the diagram":`Mostrar o diagrama`,Diagram:`Diagrama`,"Some example prompts to get you started:":`Alguns prompts de exemplo para você começar:`}}},If=e=>e.trim().toLowerCase().replaceAll(`_`,`-`),Lf=Object.fromEntries(Object.entries(Ff).map(([e,t])=>[If(e),t])),Rf=[`en`,...Object.keys(Lf)],zf=/%\(([A-Za-z_][A-Za-z0-9_]*)\)s/g,Bf=``,Vf=null;function Hf(e){let t=e?If(e):``;if(!t)return null;if(Rf.includes(t))return t;let n=t.split(`-`)[0];return Rf.includes(n)?n:Rf.find(e=>e.split(`-`)[0]===n)??null}function Uf(e){let t=[e];typeof document<`u`&&t.push(document.documentElement.lang),typeof navigator<`u`&&t.push(...navigator.languages??[navigator.language]);for(let e of t){let t=Hf(e);if(t)return t}return`en`}function Wf(e){return Vf=Uf(e),Vf}function Gf(){return Vf??=Uf(),Vf}var Kf=()=>Lf[Gf()];function qf(e){let t=Kf()?.messages[e];return t===``?void 0:t}function Jf(e,t,n,r){let i=qf(e),a=Kf();return Array.isArray(i)&&a&&i[a.plural(r)]||(r===1?t:n)}function Yf(e){let t=qf(e);return typeof t==`string`?t:e}function Xf(e,t,n){return Jf(e,e,t,n)}function Zf(e,t){let n=qf(`${e}${Bf}${t}`);return typeof n==`string`?n:t}function Qf(e,t){return e.replace(zf,(e,n)=>{let r=t[n];return r==null?e:String(r)})}var $f=`application/json`,ep=`text/event-stream`,tp=`chat-contract-v2`,np=class extends Error{status;constructor(e,t){super(e),this.name=`SmarterApiError`,this.status=t}};function rp(e,t,n){let r=e.endsWith(`/`)?e:`${e}/`,i=new URL(t||``,new URL(r,window.location.href));return n&&i.searchParams.append(`session_key`,n),i.toString()}function ip(e,t){let n={Accept:$f,"Content-Type":$f,"X-CSRFToken":Of(e.csrfCookie,``)??``,"X-Smarter-Client":t.smarterClient,"X-Smarter-ClientVersion":t.smarterClientVersion,"X-Smarter-ClientType":`react`,"X-Smarter-Capabilities":tp};return t.smarterRequestId&&(n[`X-Smarter-RequestId`]=t.smarterRequestId),t.apiKey&&(n.Authorization=`Token ${t.apiKey}`),n}function ap(e,t){return{method:`POST`,credentials:`include`,mode:`cors`,headers:e,body:JSON.stringify(t)}}async function op(e){if(!(e.headers.get(`content-type`)??``).includes($f)){let t=await e.text();throw new np(Qf(Yf(`Unexpected response from the Smarter api (http %(status)s): %(text)s`),{status:e.status,text:t.slice(0,200)}),e.status)}return await e.json()}function sp(e,t){let n=e.error??e.data?.error;if(typeof n==`string`)return n;if(n&&typeof n==`object`){let{message:e,description:t}=n;if(typeof e==`string`)return e;if(typeof t==`string`)return t}return Qf(Yf(`The Smarter api returned http %(status)s %(statusText)s`),{status:t.status,statusText:t.statusText}).trim()}function cp(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.contract===2)return t.llmclient?.url_llmclient?up(t):null;let n=t.chatbot;return!n||typeof n.url_chatbot!=`string`?null:up(lp(t))}function lp(e){return Array.isArray(e)?e.map(lp):!e||typeof e!=`object`?e:Object.fromEntries(Object.entries(e).map(([e,t])=>[e.replaceAll(`chatbot`,`llmclient`).replaceAll(`accountNumber`,`account_number`),lp(t)]))}function up(e){let t={...e};return Object.defineProperty(t,"chatbot",{get(){return this.llmclient},enumerable:!1}),t}var dp=`verbose`;async function fp(e,t,n,r=!1){let i=Of(t.sessionCookie,``),a=ap(ip(t,n),{session_key:i}),o=new URL(rp(e,`config/`,i));r&&o.searchParams.append(dp,`true`);let s=await fetch(o.toString(),a),c=await op(s);if(!s.ok)throw new np(sp(c,s),s.status);let l=cp(c.data);if(!l)throw new np(Yf(`The Smarter api returned an incomplete configuration.`),s.status);return kf(t.sessionCookie,l.session_key),kf(t.debugCookie,l.debug_mode),l}function pp(e){let t=e.data?.body;if(typeof t==`string`)try{return JSON.parse(t)}catch{return null}return t&&typeof t==`object`?t:null}function mp(e){let t=e?.smarter;return Array.isArray(t?.messages)?t.messages:[]}async function hp(e,t){let n=e.getReader(),r=new TextDecoder,i=``,a=e=>{let n=`message`,r=[];for(let t of e.split(`
567
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yd(e,t){if(e){if(typeof e==`string`)return Xd(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xd(e,t):void 0}}function Xd(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Zd(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Qd(e){if(Array.isArray(e))return e}function $d(e,t){if(e==null)return{};var n,r,i=ef(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ef(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var tf=function(e,n){return n===void 0?(0,t.useState)(e):[n,function(){}]};function nf(e,n){var r=e.placeholder,i=r===void 0?``:r,a=e.value,o=a===void 0?void 0:a,s=e.onChange,c=s===void 0?function(){}:s,l=e.onClearClick,u=l===void 0?function(){}:l,d=e.className,f=e.disabled,p=f!==void 0&&f,m=$d(e,Hd),h=`cs-search`,g=(0,t.useMemo)(function(){return o!==void 0},[]),_=qd(tf(``,o),2),v=_[0],y=_[1],b=qd((0,t.useState)(g?v.length>0:!1),2),x=b[0],S=b[1];if(g!==(o!==void 0))throw`Search: Changing from controlled to uncontrolled component and vice versa is not allowed`;var C=(0,t.useRef)(void 0),w=function(){C.current!==void 0&&C.current.focus()};return(0,t.useImperativeHandle)(n,function(){return{focus:w}}),t.default.createElement(`div`,Ud({},m,{className:(0,D.default)(h,Wd({},`${h}--disabled`,p),d)}),t.default.createElement(Xa,{icon:zd,className:`${h}__search-icon`}),t.default.createElement(`input`,{ref:C,type:`text`,className:`${h}__input`,placeholder:i,onChange:function(e){var t=e.target.value;S(t.length>0),g===!1&&y(t),c(t)},disabled:p,value:v}),t.default.createElement(Xa,{icon:Bd,className:(0,D.default)(`${h}__clear-icon`,Wd({},`${h}__clear-icon--active`,x)),onClick:function(){g===!1&&y(``),S(!1),u()}}))}var rf=(0,t.forwardRef)(nf);rf.displayName=`Search`,rf.propTypes={placeholder:E.default.string,value:E.default.string,onChange:E.default.func,onClearClick:E.default.func,className:E.default.string,disabled:E.default.bool},process.env.NODE_ENV!==`production`&&(nf.propTypes=rf.propTypes),process.env.NODE_ENV!==`production`&&(E.default.node,E.default.oneOf([`left`,`right`]),E.default.bool,E.default.bool,E.default.string);var af=ie,of=[`content`,`className`];function sf(){return sf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sf.apply(null,arguments)}function cf(e,t){if(e==null)return{};var n,r,i=lf(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function lf(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var uf=function(e){var n=e.content,r=n===void 0?``:n,i=e.className,a=cf(e,of),o=`cs-typing-indicator`;return t.default.createElement(`div`,sf({},a,{className:(0,D.default)(o,i)}),t.default.createElement(`div`,{className:`${o}__indicator`},t.default.createElement(`div`,{className:`${o}__dot`}),t.default.createElement(`div`,{className:`${o}__dot`}),t.default.createElement(`div`,{className:`${o}__dot`})),t.default.createElement(`div`,{className:`${o}__text`},r))};process.env.NODE_ENV!==`production`&&(uf.propTypes={content:E.default.node,className:E.default.string});var df=uf;function ff(e){"@babel/helpers - typeof";return ff=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ff(e)}var pf=[`className`,`children`,`size`,`selected`,`onChange`,`itemsTabIndex`];function mf(){return mf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mf.apply(null,arguments)}function hf(e,t,n){return(t=gf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gf(e){var t=_f(e,`string`);return ff(t)==`symbol`?t:t+``}function _f(e,t){if(ff(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ff(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function vf(e,t){if(e==null)return{};var n,r,i=yf(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function yf(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function bf(e,n){var r=e.className,i=e.children,a=e.size,o=e.selected,s=e.onChange,c=s===void 0?xe:s,l=e.itemsTabIndex,u=vf(e,pf),d=`cs-status-list`,f=(0,t.useRef)();(0,t.useImperativeHandle)(n,function(){return{focus:function(e){var t=Array.from(f.current.querySelectorAll(`li`)).filter(function(e){return e.parentNode===f.current});t[e]!==void 0&&t[e].focus()}}});var p=l;return t.default.createElement(`ul`,mf({ref:f},u,{className:(0,D.default)(d,r,hf({},`${d}--${a}`,a))}),t.default.Children.map(i,function(e){var n={};o&&(n.selected=e.props.status===o),c&&(n.onClick=function(t){c(e.props.status),e.onClick&&e.onClick(t)});var r=function(t){c&&t.key===`Enter`&&t.shiftKey===!1&&t.altKey===!1&&c(e.props.status)},i=function(){if(typeof p==`number`)return p>0?p++:p}();return t.default.createElement(`li`,{tabIndex:i,onKeyPress:r},t.default.cloneElement(e,n))}))}var xf=(0,t.forwardRef)(bf);xf.displayName=`StatusList`,xf.propTypes={children:Te([af]),selected:E.default.oneOf(O),size:E.default.oneOf(k),itemsTabIndex:E.default.number,className:E.default.string,onChange:E.default.func},process.env.NODE_ENV!==`production`&&(bf.propTypes=xf.propTypes);var Sf={name:`@smarter.sh/ui-chat`,version:`0.36.2-alpha.1`,description:`chatbot React.js component for the https://smarter.sh declarative, plugin-based AI resource management platform.`,homepage:`https://smarter.sh`,type:`module`,main:`./dist/smarter-chat-library.umd.js`,module:`./dist/smarter-chat-library.es.js`,types:`./dist/types/src/index.d.ts`,jsdelivr:`./dist/embed.js`,unpkg:`./dist/embed.js`,exports:{".":{types:`./dist/types/src/index.d.ts`,import:`./dist/smarter-chat-library.es.js`,require:`./dist/smarter-chat-library.umd.js`},"./dist/ui-chat.css":`./dist/ui-chat.css`,"./style.css":`./dist/ui-chat.css`,"./embed":`./dist/embed.js`,"./dist/embed.js":`./dist/embed.js`},files:[`dist`],sideEffects:[`*.css`],keywords:[`react`,`component`,`chatbot`,`ai`,`smarter`],author:`Lawrence McDaniel <lpm0073@gmail.com>, (https://lawrencemcdaniel.com/)`,license:`AGPL-3.0-or-later`,repository:{type:`git`,url:`git+https://github.com/smarter-sh/smarter.git`,directory:`smarter/react/packages/smarter.sh-chat`},bugs:{url:`https://github.com/smarter-sh/smarter/issues`},contributors:[`Lawrence McDaniel <lpm0073@gmail.com> (https://lawrencemcdaniel.com/)`],engines:{node:`>=20.17.0`,npm:`>=10.8.2`},funding:{type:`individual`,url:`https://github.com/sponsors/lpm0073`},scripts:{dev:`NODE_ENV=dev && vite`,build:`tsc -b && npm run build:lib && npm run build:embed`,"build:lib":`vite build --mode lib && tsc -p tsconfig.lib.json`,"contract:types":`node scripts/contract-types.mjs`,i18n:`node scripts/i18n.mjs`,lint:`eslint --max-warnings=0 .`,preview:`vite preview`,storybook:`storybook dev -p 6006`,"build-storybook":`storybook build`,typecheck:`tsc -b`,test:`vitest run`,"test:watch":`vitest`,prepublishOnly:`npm run build:lib && npm run build:embed`,coverage:`vitest run --coverage --config vitest.coverage.config.ts`,format:`prettier --write .`,"format:check":`prettier --check .`,"build:embed":`vite build --mode embed && vite build --mode embed-mermaid`,"check:dist":`node scripts/check-dist.mjs`},dependencies:{"@chatscope/chat-ui-kit-react":`^2.1.1`,"@chatscope/chat-ui-kit-styles":`^1.4.0`,dompurify:`^3.4.16`,"highlight.js":`^11.12.0`,katex:`^0.18.7`,marked:`^14.0.0`,mermaid:`^11.17.2`},peerDependencies:{react:`^19`,"react-dom":`^19`},devDependencies:{"@eslint/js":`^10.0.1`,"@storybook/addon-a11y":`^10.6.1`,"@storybook/addon-docs":`^10.6.1`,"@storybook/react-vite":`^10.6.1`,"@testing-library/dom":`^10.4.2`,"@testing-library/jest-dom":`^7.0.1`,"@testing-library/react":`^16.3.3`,"@testing-library/user-event":`^14.6.7`,"@types/node":`^26.6.3`,"@types/react":`^19.3.0`,"@types/react-dom":`^19.3.0`,"@vitejs/plugin-react":`^6.1.1`,"@vitest/coverage-v8":`^5.0.3`,"@vitest/eslint-plugin":`^1.6.27`,ajv:`^8.20.0`,bootstrap:`^5.3.8`,"bootstrap-icons":`^1.13.1`,eslint:`^10.11.0`,"eslint-config-prettier":`^10.1.8`,"eslint-plugin-jest-dom":`^5.10.1`,"eslint-plugin-jsx-a11y":`^6.10.2`,"eslint-plugin-react-hooks":`^7.1.1`,"eslint-plugin-react-refresh":`^0.5.7`,"eslint-plugin-storybook":`^10.6.1`,"eslint-plugin-testing-library":`^7.16.2`,globals:`^17.13.0`,jsdom:`^30.1.2`,"json-schema-to-typescript":`^15.0.4`,msw:`^2.15.0`,prettier:`^3.9.9`,react:`^19.3.0`,"react-dom":`^19.3.0`,storybook:`^10.6.1`,typescript:`~6.0.2`,"typescript-eslint":`^8.71.0`,vite:`^8.3.2`,vitest:`^5.0.3`},msw:{workerDirectory:[`.storybook/public`]},overrides:{"eslint-plugin-jsx-a11y":{eslint:`$eslint`}},publishConfig:{access:`public`}},Cf=Sf.name,wf=Sf.version,Tf=`[Smarter ${Cf} v${wf}]`,Ef=864e5;function Df(e,t){let n=(t||``).trim().split(`:`)[0].replace(/^\./,``);return!n||n===`None`||e===n||e.endsWith(`.${n}`)}function Of(e,t=null){if(e.value!==null&&e.value!==void 0&&e.value!==``)return e.value;if(!Df(window.location.hostname,e.domain)||!document.cookie)return t;for(let n of document.cookie.split(`;`)){let r=n.trim();if(r.startsWith(`${e.name}=`))return decodeURIComponent(r.substring(e.name.length+1))||t}return t}function kf(e,t){let n=e.path||window.location.pathname;if(t==null||t===``){document.cookie=`${e.name}=; path=${n}; SameSite=Lax; expires=${new Date(0).toUTCString()}`;return}let r=new Date(Date.now()+(e.expiration??0)).toUTCString();document.cookie=`${e.name}=${encodeURIComponent(String(t))}; path=${n}; SameSite=Lax; expires=${r}`}function Af(e,t,n,r=null,i=null){return{name:e,expiration:t,domain:n??``,value:r,path:i}}var jf={INCOMING:`incoming`,OUTGOING:`outgoing`},Mf={SYSTEM:`system`,ASSISTANT:`assistant`,USER:`user`,TOOL:`tool`,SMARTER:`smarter`,SMARTER_ERROR:`smarter_error`},Nf=[Mf.SYSTEM,Mf.ASSISTANT,Mf.USER,Mf.TOOL],Pf=[Mf.SMARTER,Mf.SYSTEM,Mf.TOOL],Ff={es:{plural:e=>Number(e!=1),messages:{"Loading...":`Cargando...`,valid:`válido`,"not valid":`no válido`,deployed:`implementado`,"(sandbox)":`(pruebas)`,"Something went wrong.":`Algo salió mal.`,Message:`Mensaje`,"%(provider)s %(model)s with %(count)s additional tool":[`%(provider)s %(model)s con %(count)s herramienta adicional`,`%(provider)s %(model)s con %(count)s herramientas adicionales`],Assistant:`Asistente`,You:`Tú`,"%(assistant)s: %(step)s":`%(assistant)s: %(step)s`,"%(assistant)s is typing":`%(assistant)s está escribiendo`,"Smarter Chat is not available":`Smarter Chat no está disponible`,"Configuring workbench...":`Configurando el área de trabajo...`,Chat:`Chat`,"Chat mode":`Modo del chat`,"Sandbox mode: Smarter's system, tool and meta data messages are displayed.":`Modo de pruebas: se muestran los mensajes de sistema, de herramientas y de metadatos de Smarter.`,"chat modeSandbox":`Pruebas`,"Production mode: the conversation is displayed as its users see it.":`Modo de producción: la conversación se muestra como la ven sus usuarios.`,"chat modeProduction":`Producción`,"Start a new chat":`Iniciar un chat nuevo`,"Attach a file":`Adjuntar un archivo`,"Close %(label)s":`Cerrar %(label)s`,"Unexpected response from the Smarter api (http %(status)s): %(text)s":`Respuesta inesperada de la api de Smarter (http %(status)s): %(text)s`,"The Smarter api returned http %(status)s %(statusText)s":`La api de Smarter devolvió http %(status)s %(statusText)s`,"The Smarter api returned an incomplete configuration.":`La api de Smarter devolvió una configuración incompleta.`,"The Smarter api returned an empty event stream.":`La api de Smarter devolvió un flujo de eventos vacío.`,"The Smarter api's event stream ended without a result.":`El flujo de eventos de la api de Smarter terminó sin un resultado.`,"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, %(reasoning)s of which it spent reasoning, so its response is incomplete.":[`El LLM alcanzó el máximo de tokens de este LLMClient, %(tokens)s token de completado, de los cuales usó %(reasoning)s para razonar, así que su respuesta está incompleta.`,`El LLM alcanzó el máximo de tokens de este LLMClient, %(tokens)s tokens de completado, de los cuales usó %(reasoning)s para razonar, así que su respuesta está incompleta.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, %(reasoning)s of which it spent reasoning, so its response is empty.":[`El LLM alcanzó el máximo de tokens de este LLMClient, %(tokens)s token de completado, de los cuales usó %(reasoning)s para razonar, así que su respuesta está vacía.`,`El LLM alcanzó el máximo de tokens de este LLMClient, %(tokens)s tokens de completado, de los cuales usó %(reasoning)s para razonar, así que su respuesta está vacía.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, so its response is incomplete.":[`El LLM alcanzó el máximo de tokens de este LLMClient, %(tokens)s token de completado, así que su respuesta está incompleta.`,`El LLM alcanzó el máximo de tokens de este LLMClient, %(tokens)s tokens de completado, así que su respuesta está incompleta.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, so its response is empty.":[`El LLM alcanzó el máximo de tokens de este LLMClient, %(tokens)s token de completado, así que su respuesta está vacía.`,`El LLM alcanzó el máximo de tokens de este LLMClient, %(tokens)s tokens de completado, así que su respuesta está vacía.`],"The LLM reached this LLMClient's max tokens, so its response is incomplete.":`El LLM alcanzó el máximo de tokens de este LLMClient, así que su respuesta está incompleta.`,"The LLM reached this LLMClient's max tokens, so its response is empty.":`El LLM alcanzó el máximo de tokens de este LLMClient, así que su respuesta está vacía.`,"Raise defaultMaxTokens in the LLMClient's manifest.":`Aumenta defaultMaxTokens en el manifiesto del LLMClient.`,"Copy code":`Copiar el código`,Copy:`Copiar`,"Copied!":`¡Copiado!`,"buttonCode":`Código`,"Show the diagram's code":`Mostrar el código del diagrama`,"buttonDiagram":`Diagrama`,"Show the diagram":`Mostrar el diagrama`,Diagram:`Diagrama`,Image:`Imagen`,"Some example prompts to get you started:":`Algunos prompts de ejemplo para empezar:`}},fr:{plural:e=>Number(e>1),messages:{"Loading...":`Chargement...`,valid:`valide`,"not valid":`non valide`,deployed:`déployé`,"(sandbox)":`(bac à sable)`,"Something went wrong.":`Une erreur s'est produite.`,Message:`Message`,"%(provider)s %(model)s with %(count)s additional tool":[`%(provider)s %(model)s avec %(count)s outil supplémentaire`,`%(provider)s %(model)s avec %(count)s outils supplémentaires`],Assistant:`Assistant`,You:`Vous`,"%(assistant)s: %(step)s":`%(assistant)s : %(step)s`,"%(assistant)s is typing":`%(assistant)s est en train d'écrire`,"Smarter Chat is not available":`Smarter Chat n'est pas disponible`,"Configuring workbench...":`Configuration de l'atelier...`,Chat:`Chat`,"Chat mode":`Mode du chat`,"Sandbox mode: Smarter's system, tool and meta data messages are displayed.":`Mode bac à sable : les messages système, d'outils et de métadonnées de Smarter sont affichés.`,"chat modeSandbox":`Bac à sable`,"Production mode: the conversation is displayed as its users see it.":`Mode production : la conversation est affichée telle que ses utilisateurs la voient.`,"chat modeProduction":`Production`,"Start a new chat":`Démarrer un nouveau chat`,"Attach a file":`Joindre un fichier`,"Close %(label)s":`Fermer %(label)s`,"Unexpected response from the Smarter api (http %(status)s): %(text)s":`Réponse inattendue de l'api de Smarter (http %(status)s) : %(text)s`,"The Smarter api returned http %(status)s %(statusText)s":`L'api de Smarter a renvoyé http %(status)s %(statusText)s`,"The Smarter api returned an incomplete configuration.":`L'api de Smarter a renvoyé une configuration incomplète.`,"The Smarter api returned an empty event stream.":`L'api de Smarter a renvoyé un flux d'événements vide.`,"The Smarter api's event stream ended without a result.":`Le flux d'événements de l'api de Smarter s'est terminé sans résultat.`,"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, %(reasoning)s of which it spent reasoning, so its response is incomplete.":[`Le LLM a atteint le nombre maximal de jetons de ce LLMClient, %(tokens)s jeton de complétion, dont %(reasoning)s consacrés au raisonnement : sa réponse est donc incomplète.`,`Le LLM a atteint le nombre maximal de jetons de ce LLMClient, %(tokens)s jetons de complétion, dont %(reasoning)s consacrés au raisonnement : sa réponse est donc incomplète.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, %(reasoning)s of which it spent reasoning, so its response is empty.":[`Le LLM a atteint le nombre maximal de jetons de ce LLMClient, %(tokens)s jeton de complétion, dont %(reasoning)s consacrés au raisonnement : sa réponse est donc vide.`,`Le LLM a atteint le nombre maximal de jetons de ce LLMClient, %(tokens)s jetons de complétion, dont %(reasoning)s consacrés au raisonnement : sa réponse est donc vide.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, so its response is incomplete.":[`Le LLM a atteint le nombre maximal de jetons de ce LLMClient, %(tokens)s jeton de complétion : sa réponse est donc incomplète.`,`Le LLM a atteint le nombre maximal de jetons de ce LLMClient, %(tokens)s jetons de complétion : sa réponse est donc incomplète.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, so its response is empty.":[`Le LLM a atteint le nombre maximal de jetons de ce LLMClient, %(tokens)s jeton de complétion : sa réponse est donc vide.`,`Le LLM a atteint le nombre maximal de jetons de ce LLMClient, %(tokens)s jetons de complétion : sa réponse est donc vide.`],"The LLM reached this LLMClient's max tokens, so its response is incomplete.":`Le LLM a atteint le nombre maximal de jetons de ce LLMClient : sa réponse est donc incomplète.`,"The LLM reached this LLMClient's max tokens, so its response is empty.":`Le LLM a atteint le nombre maximal de jetons de ce LLMClient : sa réponse est donc vide.`,"Raise defaultMaxTokens in the LLMClient's manifest.":`Augmentez defaultMaxTokens dans le manifeste du LLMClient.`,"Copy code":`Copier le code`,Copy:`Copier`,"Copied!":`Copié !`,"buttonCode":`Code`,"Show the diagram's code":`Afficher le code du diagramme`,"buttonDiagram":`Diagramme`,"Show the diagram":`Afficher le diagramme`,Diagram:`Diagramme`,Image:`Image`,"Some example prompts to get you started:":`Quelques exemples de prompts pour commencer :`}},pt_BR:{plural:e=>Number(e>1),messages:{"Loading...":`Carregando...`,valid:`válido`,"not valid":`inválido`,deployed:`implantado`,"(sandbox)":`(sandbox)`,"Something went wrong.":`Algo deu errado.`,Message:`Mensagem`,"%(provider)s %(model)s with %(count)s additional tool":[`%(provider)s %(model)s com %(count)s ferramenta adicional`,`%(provider)s %(model)s com %(count)s ferramentas adicionais`],Assistant:`Assistente`,You:`Você`,"%(assistant)s: %(step)s":`%(assistant)s: %(step)s`,"%(assistant)s is typing":`%(assistant)s está digitando`,"Smarter Chat is not available":`O Smarter Chat não está disponível`,"Configuring workbench...":`Configurando a área de trabalho...`,Chat:`Chat`,"Chat mode":`Modo do chat`,"Sandbox mode: Smarter's system, tool and meta data messages are displayed.":`Modo sandbox: as mensagens de sistema, de ferramentas e de metadados do Smarter são exibidas.`,"chat modeSandbox":`Sandbox`,"Production mode: the conversation is displayed as its users see it.":`Modo de produção: a conversa é exibida como os usuários a veem.`,"chat modeProduction":`Produção`,"Start a new chat":`Iniciar um novo chat`,"Attach a file":`Anexar um arquivo`,"Close %(label)s":`Fechar %(label)s`,"Unexpected response from the Smarter api (http %(status)s): %(text)s":`Resposta inesperada da api do Smarter (http %(status)s): %(text)s`,"The Smarter api returned http %(status)s %(statusText)s":`A api do Smarter retornou http %(status)s %(statusText)s`,"The Smarter api returned an incomplete configuration.":`A api do Smarter retornou uma configuração incompleta.`,"The Smarter api returned an empty event stream.":`A api do Smarter retornou um fluxo de eventos vazio.`,"The Smarter api's event stream ended without a result.":`O fluxo de eventos da api do Smarter terminou sem um resultado.`,"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, %(reasoning)s of which it spent reasoning, so its response is incomplete.":[`O LLM atingiu o máximo de tokens deste LLMClient, %(tokens)s token de completion, dos quais gastou %(reasoning)s raciocinando, por isso a resposta está incompleta.`,`O LLM atingiu o máximo de tokens deste LLMClient, %(tokens)s tokens de completion, dos quais gastou %(reasoning)s raciocinando, por isso a resposta está incompleta.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, %(reasoning)s of which it spent reasoning, so its response is empty.":[`O LLM atingiu o máximo de tokens deste LLMClient, %(tokens)s token de completion, dos quais gastou %(reasoning)s raciocinando, por isso a resposta está vazia.`,`O LLM atingiu o máximo de tokens deste LLMClient, %(tokens)s tokens de completion, dos quais gastou %(reasoning)s raciocinando, por isso a resposta está vazia.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, so its response is incomplete.":[`O LLM atingiu o máximo de tokens deste LLMClient, %(tokens)s token de completion, por isso a resposta está incompleta.`,`O LLM atingiu o máximo de tokens deste LLMClient, %(tokens)s tokens de completion, por isso a resposta está incompleta.`],"The LLM reached this LLMClient's max tokens of %(tokens)s completion token, so its response is empty.":[`O LLM atingiu o máximo de tokens deste LLMClient, %(tokens)s token de completion, por isso a resposta está vazia.`,`O LLM atingiu o máximo de tokens deste LLMClient, %(tokens)s tokens de completion, por isso a resposta está vazia.`],"The LLM reached this LLMClient's max tokens, so its response is incomplete.":`O LLM atingiu o máximo de tokens deste LLMClient, por isso a resposta está incompleta.`,"The LLM reached this LLMClient's max tokens, so its response is empty.":`O LLM atingiu o máximo de tokens deste LLMClient, por isso a resposta está vazia.`,"Raise defaultMaxTokens in the LLMClient's manifest.":`Aumente o defaultMaxTokens no manifesto do LLMClient.`,"Copy code":`Copiar o código`,Copy:`Copiar`,"Copied!":`Copiado!`,"buttonCode":`Código`,"Show the diagram's code":`Mostrar o código do diagrama`,"buttonDiagram":`Diagrama`,"Show the diagram":`Mostrar o diagrama`,Diagram:`Diagrama`,Image:`Imagem`,"Some example prompts to get you started:":`Alguns prompts de exemplo para você começar:`}}},If=e=>e.trim().toLowerCase().replaceAll(`_`,`-`),Lf=Object.fromEntries(Object.entries(Ff).map(([e,t])=>[If(e),t])),Rf=[`en`,...Object.keys(Lf)],zf=/%\(([A-Za-z_][A-Za-z0-9_]*)\)s/g,Bf=``,Vf=null;function Hf(e){let t=e?If(e):``;if(!t)return null;if(Rf.includes(t))return t;let n=t.split(`-`)[0];return Rf.includes(n)?n:Rf.find(e=>e.split(`-`)[0]===n)??null}function Uf(e){let t=[e];typeof document<`u`&&t.push(document.documentElement.lang),typeof navigator<`u`&&t.push(...navigator.languages??[navigator.language]);for(let e of t){let t=Hf(e);if(t)return t}return`en`}function Wf(e){return Vf=Uf(e),Vf}function Gf(){return Vf??=Uf(),Vf}var Kf=()=>Lf[Gf()];function qf(e){let t=Kf()?.messages[e];return t===``?void 0:t}function Jf(e,t,n,r){let i=qf(e),a=Kf();return Array.isArray(i)&&a&&i[a.plural(r)]||(r===1?t:n)}function Yf(e){let t=qf(e);return typeof t==`string`?t:e}function Xf(e,t,n){return Jf(e,e,t,n)}function Zf(e,t){let n=qf(`${e}${Bf}${t}`);return typeof n==`string`?n:t}function Qf(e,t){return e.replace(zf,(e,n)=>{let r=t[n];return r==null?e:String(r)})}var $f=`application/json`,ep=`text/event-stream`,tp=`chat-contract-v2`,np=class extends Error{status;constructor(e,t){super(e),this.name=`SmarterApiError`,this.status=t}};function rp(e,t,n){let r=e.endsWith(`/`)?e:`${e}/`,i=new URL(t||``,new URL(r,window.location.href));return n&&i.searchParams.append(`session_key`,n),i.toString()}function ip(e,t){let n={Accept:$f,"Content-Type":$f,"X-CSRFToken":Of(e.csrfCookie,``)??``,"X-Smarter-Client":t.smarterClient,"X-Smarter-ClientVersion":t.smarterClientVersion,"X-Smarter-ClientType":`react`,"X-Smarter-Capabilities":tp};return t.smarterRequestId&&(n[`X-Smarter-RequestId`]=t.smarterRequestId),t.apiKey&&(n.Authorization=`Token ${t.apiKey}`),n}function ap(e,t){return{method:`POST`,credentials:`include`,mode:`cors`,headers:e,body:JSON.stringify(t)}}async function op(e){if(!(e.headers.get(`content-type`)??``).includes($f)){let t=await e.text();throw new np(Qf(Yf(`Unexpected response from the Smarter api (http %(status)s): %(text)s`),{status:e.status,text:t.slice(0,200)}),e.status)}return await e.json()}function sp(e,t){let n=e.error??e.data?.error;if(typeof n==`string`)return n;if(n&&typeof n==`object`){let{message:e,description:t}=n;if(typeof e==`string`)return e;if(typeof t==`string`)return t}return Qf(Yf(`The Smarter api returned http %(status)s %(statusText)s`),{status:t.status,statusText:t.statusText}).trim()}function cp(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.contract===2)return t.llmclient?.url_llmclient?up(t):null;let n=t.chatbot;return!n||typeof n.url_chatbot!=`string`?null:up(lp(t))}function lp(e){return Array.isArray(e)?e.map(lp):!e||typeof e!=`object`?e:Object.fromEntries(Object.entries(e).map(([e,t])=>[e.replaceAll(`chatbot`,`llmclient`).replaceAll(`accountNumber`,`account_number`),lp(t)]))}function up(e){let t={...e};return Object.defineProperty(t,"chatbot",{get(){return this.llmclient},enumerable:!1}),t}var dp=`verbose`;async function fp(e,t,n,r=!1){let i=Of(t.sessionCookie,``),a=ap(ip(t,n),{session_key:i}),o=new URL(rp(e,`config/`,i));r&&o.searchParams.append(dp,`true`);let s=await fetch(o.toString(),a),c=await op(s);if(!s.ok)throw new np(sp(c,s),s.status);let l=cp(c.data);if(!l)throw new np(Yf(`The Smarter api returned an incomplete configuration.`),s.status);return kf(t.sessionCookie,l.session_key),kf(t.debugCookie,l.debug_mode),l}function pp(e){let t=e.data?.body;if(typeof t==`string`)try{return JSON.parse(t)}catch{return null}return t&&typeof t==`object`?t:null}function mp(e){let t=e?.smarter;return Array.isArray(t?.messages)?t.messages:[]}async function hp(e,t){let n=e.getReader(),r=new TextDecoder,i=``,a=e=>{let n=`message`,r=[];for(let t of e.split(`
568
568
  `))t.startsWith(`event:`)?n=t.slice(6).trim():t.startsWith(`data:`)&&r.push(t.slice(5).replace(/^ /,``));r.length>0&&t(n,r.join(`
569
569
  `))};for(;;){let{done:e,value:t}=await n.read();i+=r.decode(t,{stream:!e}).replace(/\r\n?/g,`
570
570
  `);let o=i.indexOf(`
@@ -878,7 +878,7 @@ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
878
878
  |[ \r ]+
879
879
  ?)[ \r ]*`,jC=`[̀-ͯ]`,MC=RegExp(jC+`+$`),NC=`(`+EC+`+)|`+(AC+`|`)+`([!-\\[\\]-‧‪-퟿豈-￿]`+(jC+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(jC+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+kC)+(`|`+OC+`)`),PC=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(NC,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new PS(`EOF`,new NS(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new L(`Unexpected character: '`+e[t]+`'`,new PS(e[t],new NS(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
880
880
  `,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict(`commentAtEnd`,`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`)):this.tokenRegex.lastIndex=i+1,this.lex()}return new PS(r,new NS(this,t,this.tokenRegex.lastIndex))}},FC=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new L(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t of Object.keys(e))e[t]===void 0?delete this.current[t]:this.current[t]=e[t]}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return Object.prototype.hasOwnProperty.call(this.current,e)||Object.prototype.hasOwnProperty.call(this.builtins,e)}get(e){if(Object.prototype.hasOwnProperty.call(this.current,e))return this.current[e];if(Object.prototype.hasOwnProperty.call(this.builtins,e))return this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!Object.prototype.hasOwnProperty.call(i,e)&&(i[e]=Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:void 0)}t==null?delete this.current[e]:this.current[e]=t}},IC=MS;$(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),$(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),$(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),$(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),$(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),$(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),$(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var LC={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};$(`\\char`,function(e){var t=e.popToken(),n,r=0;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`"){if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new L("\\char` missing argument");else r=t.text.charCodeAt(0)}else n=10;if(n){if(r=LC[t.text],r==null||r>=n)throw new L(`Invalid base-`+n+` digit `+t.text);for(var i;(i=LC[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var RC=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new L(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new L(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new L(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new L(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};$(`\\newcommand`,e=>RC(e,!1,!0,!1)),$(`\\renewcommand`,e=>RC(e,!0,!1,!1)),$(`\\providecommand`,e=>RC(e,!0,!0,!0)),$(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),$(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),$(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),TC[n],yy.math[n],yy.text[n]),``}),$(`\\bgroup`,`{`),$(`\\egroup`,`}`),$(`~`,`\\nobreakspace`),$(`\\lq`,"`"),$(`\\rq`,`'`),$(`\\aa`,`\\r a`),$(`\\AA`,`\\r A`),$(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),$(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),$(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),$(`ℬ`,`\\mathscr{B}`),$(`ℰ`,`\\mathscr{E}`),$(`ℱ`,`\\mathscr{F}`),$(`ℋ`,`\\mathscr{H}`),$(`ℐ`,`\\mathscr{I}`),$(`ℒ`,`\\mathscr{L}`),$(`ℳ`,`\\mathscr{M}`),$(`ℛ`,`\\mathscr{R}`),$(`ℭ`,`\\mathfrak{C}`),$(`ℌ`,`\\mathfrak{H}`),$(`ℨ`,`\\mathfrak{Z}`),$(`\\Bbbk`,`\\Bbb{k}`),$(`\\llap`,`\\mathllap{\\textrm{#1}}`),$(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),$(`\\clap`,`\\mathclap{\\textrm{#1}}`),$(`\\mathstrut`,`\\vphantom{(}`),$(`\\underbar`,`\\underline{\\text{#1}}`),$(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),$(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),$(`\\ne`,`\\neq`),$(`≠`,`\\neq`),$(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),$(`∉`,`\\notin`),$(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),$(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),$(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),$(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),$(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),$(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),$(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),$(`⟂`,`\\perp`),$(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),$(`∌`,`\\notni`),$(`⌜`,`\\ulcorner`),$(`⌝`,`\\urcorner`),$(`⌞`,`\\llcorner`),$(`⌟`,`\\lrcorner`),$(`©`,`\\copyright`),$(`®`,`\\textregistered`),$(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),$(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),$(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),$(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),$(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),$(`⋮`,`\\vdots`),$(`\\varGamma`,`\\mathit{\\Gamma}`),$(`\\varDelta`,`\\mathit{\\Delta}`),$(`\\varTheta`,`\\mathit{\\Theta}`),$(`\\varLambda`,`\\mathit{\\Lambda}`),$(`\\varXi`,`\\mathit{\\Xi}`),$(`\\varPi`,`\\mathit{\\Pi}`),$(`\\varSigma`,`\\mathit{\\Sigma}`),$(`\\varUpsilon`,`\\mathit{\\Upsilon}`),$(`\\varPhi`,`\\mathit{\\Phi}`),$(`\\varPsi`,`\\mathit{\\Psi}`),$(`\\varOmega`,`\\mathit{\\Omega}`),$(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),$(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),$(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),$(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),$(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),$(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),$(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),$(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var zC={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`},BC=new Set([`bin`,`rel`]);$(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in zC?t=zC[n]:(n.slice(0,4)===`\\not`||n in yy.math&&BC.has(yy.math[n].group))&&(t=`\\dotsb`),t});var VC={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};$(`\\dotso`,function(e){return e.future().text in VC?`\\ldots\\,`:`\\ldots`}),$(`\\dotsc`,function(e){var t=e.future().text;return t in VC&&t!==`,`?`\\ldots\\,`:`\\ldots`}),$(`\\cdots`,function(e){return e.future().text in VC?`\\@cdots\\,`:`\\@cdots`}),$(`\\dotsb`,`\\cdots`),$(`\\dotsm`,`\\cdots`),$(`\\dotsi`,`\\!\\cdots`),$(`\\dotsx`,`\\ldots\\,`),$(`\\DOTSI`,`\\relax`),$(`\\DOTSB`,`\\relax`),$(`\\DOTSX`,`\\relax`),$(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),$(`\\,`,`\\tmspace+{3mu}{.1667em}`),$(`\\thinspace`,`\\,`),$(`\\>`,`\\mskip{4mu}`),$(`\\:`,`\\tmspace+{4mu}{.2222em}`),$(`\\medspace`,`\\:`),$(`\\;`,`\\tmspace+{5mu}{.2777em}`),$(`\\thickspace`,`\\;`),$(`\\!`,`\\tmspace-{3mu}{.1667em}`),$(`\\negthinspace`,`\\!`),$(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),$(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),$(`\\enspace`,`\\kern.5em `),$(`\\enskip`,`\\hskip.5em\\relax`),$(`\\quad`,`\\hskip1em\\relax`),$(`\\qquad`,`\\hskip2em\\relax`),$(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),$(`\\tag@paren`,`\\tag@literal{({#1})}`),$(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new L(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),$(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),$(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),$(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),$(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),$(`\\newline`,`\\\\\\relax`),$(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var HC=z(fy[`Main-Regular`][84][1]-.7*fy[`Main-Regular`][65][1]);$(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+HC+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),$(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+HC+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),$(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),$(`\\@hspace`,`\\hskip #1\\relax`),$(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),$(`\\ordinarycolon`,`:`),$(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),$(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),$(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),$(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),$(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),$(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),$(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),$(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),$(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),$(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),$(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),$(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),$(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),$(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),$(`∷`,`\\dblcolon`),$(`∹`,`\\eqcolon`),$(`≔`,`\\coloneqq`),$(`≕`,`\\eqqcolon`),$(`⩴`,`\\Coloneqq`),$(`\\ratio`,`\\vcentcolon`),$(`\\coloncolon`,`\\dblcolon`),$(`\\colonequals`,`\\coloneqq`),$(`\\coloncolonequals`,`\\Coloneqq`),$(`\\equalscolon`,`\\eqqcolon`),$(`\\equalscoloncolon`,`\\Eqqcolon`),$(`\\colonminus`,`\\coloneq`),$(`\\coloncolonminus`,`\\Coloneq`),$(`\\minuscolon`,`\\eqcolon`),$(`\\minuscoloncolon`,`\\Eqcolon`),$(`\\coloncolonapprox`,`\\Colonapprox`),$(`\\coloncolonsim`,`\\Colonsim`),$(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),$(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),$(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),$(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),$(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),$(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),$(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),$(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),$(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),$(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),$(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),$(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),$(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),$(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),$(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),$(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),$(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),$(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),$(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),$(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),$(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),$(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),$(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),$(`\\imath`,`\\html@mathml{\\@imath}{ı}`),$(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),$(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),$(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),$(`⟦`,`\\llbracket`),$(`⟧`,`\\rrbracket`),$(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),$(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),$(`↤`,`\\mapsfrom`),$(`\\mapsfrom`,"\\html@mathml{\\mathrel{\\mathreflectbox{\\mapsto}}}{\\mathrel{\\char`↤}}"),$(`⦃`,`\\lBrace`),$(`⦄`,`\\rBrace`),$(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),$(`⦵`,`\\minuso`),$(`\\darr`,`\\downarrow`),$(`\\dArr`,`\\Downarrow`),$(`\\Darr`,`\\Downarrow`),$(`\\lang`,`\\langle`),$(`\\rang`,`\\rangle`),$(`\\uarr`,`\\uparrow`),$(`\\uArr`,`\\Uparrow`),$(`\\Uarr`,`\\Uparrow`),$(`\\N`,`\\mathbb{N}`),$(`\\R`,`\\mathbb{R}`),$(`\\Z`,`\\mathbb{Z}`),$(`\\alef`,`\\aleph`),$(`\\alefsym`,`\\aleph`),$(`\\Alpha`,`\\mathrm{A}`),$(`\\Beta`,`\\mathrm{B}`),$(`\\bull`,`\\bullet`),$(`\\Chi`,`\\mathrm{X}`),$(`\\clubs`,`\\clubsuit`),$(`\\cnums`,`\\mathbb{C}`),$(`\\Complex`,`\\mathbb{C}`),$(`\\Dagger`,`\\ddagger`),$(`\\diamonds`,`\\diamondsuit`),$(`\\empty`,`\\emptyset`),$(`\\Epsilon`,`\\mathrm{E}`),$(`\\Eta`,`\\mathrm{H}`),$(`\\exist`,`\\exists`),$(`\\harr`,`\\leftrightarrow`),$(`\\hArr`,`\\Leftrightarrow`),$(`\\Harr`,`\\Leftrightarrow`),$(`\\hearts`,`\\heartsuit`),$(`\\image`,`\\Im`),$(`\\infin`,`\\infty`),$(`\\Iota`,`\\mathrm{I}`),$(`\\isin`,`\\in`),$(`\\Kappa`,`\\mathrm{K}`),$(`\\larr`,`\\leftarrow`),$(`\\lArr`,`\\Leftarrow`),$(`\\Larr`,`\\Leftarrow`),$(`\\lrarr`,`\\leftrightarrow`),$(`\\lrArr`,`\\Leftrightarrow`),$(`\\Lrarr`,`\\Leftrightarrow`),$(`\\Mu`,`\\mathrm{M}`),$(`\\natnums`,`\\mathbb{N}`),$(`\\Nu`,`\\mathrm{N}`),$(`\\Omicron`,`\\mathrm{O}`),$(`\\plusmn`,`\\pm`),$(`\\rarr`,`\\rightarrow`),$(`\\rArr`,`\\Rightarrow`),$(`\\Rarr`,`\\Rightarrow`),$(`\\real`,`\\Re`),$(`\\reals`,`\\mathbb{R}`),$(`\\Reals`,`\\mathbb{R}`),$(`\\Rho`,`\\mathrm{P}`),$(`\\sdot`,`\\cdot`),$(`\\sect`,`\\S`),$(`\\spades`,`\\spadesuit`),$(`\\sub`,`\\subset`),$(`\\sube`,`\\subseteq`),$(`\\supe`,`\\supseteq`),$(`\\Tau`,`\\mathrm{T}`),$(`\\thetasym`,`\\vartheta`),$(`\\weierp`,`\\wp`),$(`\\Zeta`,`\\mathrm{Z}`),$(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),$(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),$(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),$(`\\bra`,`\\mathinner{\\langle{#1}|}`),$(`\\ket`,`\\mathinner{|{#1}\\rangle}`),$(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),$(`\\Bra`,`\\left\\langle#1\\right|`),$(`\\Ket`,`\\left|#1\\right\\rangle`);var UC=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};$(`\\bra@ket`,UC(!1)),$(`\\bra@set`,UC(!0)),$(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),$(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),$(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),$(`\\angln`,`{\\angl n}`),$(`\\blue`,`\\textcolor{##6495ed}{#1}`),$(`\\orange`,`\\textcolor{##ffa500}{#1}`),$(`\\pink`,`\\textcolor{##ff00af}{#1}`),$(`\\red`,`\\textcolor{##df0030}{#1}`),$(`\\green`,`\\textcolor{##28ae7b}{#1}`),$(`\\gray`,`\\textcolor{gray}{#1}`),$(`\\purple`,`\\textcolor{##9d38bd}{#1}`),$(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),$(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),$(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),$(`\\blueD`,`\\textcolor{##11accd}{#1}`),$(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),$(`\\tealA`,`\\textcolor{##94fff5}{#1}`),$(`\\tealB`,`\\textcolor{##26edd5}{#1}`),$(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),$(`\\tealD`,`\\textcolor{##01a995}{#1}`),$(`\\tealE`,`\\textcolor{##208170}{#1}`),$(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),$(`\\greenB`,`\\textcolor{##8af281}{#1}`),$(`\\greenC`,`\\textcolor{##74cf70}{#1}`),$(`\\greenD`,`\\textcolor{##1fab54}{#1}`),$(`\\greenE`,`\\textcolor{##0d923f}{#1}`),$(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),$(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),$(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),$(`\\goldD`,`\\textcolor{##e07d10}{#1}`),$(`\\goldE`,`\\textcolor{##a75a05}{#1}`),$(`\\redA`,`\\textcolor{##fca9a9}{#1}`),$(`\\redB`,`\\textcolor{##ff8482}{#1}`),$(`\\redC`,`\\textcolor{##f9685d}{#1}`),$(`\\redD`,`\\textcolor{##e84d39}{#1}`),$(`\\redE`,`\\textcolor{##bc2612}{#1}`),$(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),$(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),$(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),$(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),$(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),$(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),$(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),$(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),$(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),$(`\\purpleE`,`\\textcolor{##543b78}{#1}`),$(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),$(`\\mintB`,`\\textcolor{##edf2df}{#1}`),$(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),$(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),$(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),$(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),$(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),$(`\\grayE`,`\\textcolor{##babec2}{#1}`),$(`\\grayF`,`\\textcolor{##888d93}{#1}`),$(`\\grayG`,`\\textcolor{##626569}{#1}`),$(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),$(`\\grayI`,`\\textcolor{##21242c}{#1}`),$(`\\kaBlue`,`\\textcolor{##314453}{#1}`),$(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var WC={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},GC=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new FC(IC,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new PC(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken();var i=this.consumeArg([`]`]);r=i.tokens,n=i.end}else{var a=this.consumeArg();r=a.tokens,t=a.start,n=a.end}return this.pushToken(new PS(`EOF`,n.loc)),this.pushTokens(r),new PS(``,NS.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new L(`Extra }`,i)}else if(i.text===`EOF`)throw new L(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n){if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new L(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new L(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new L(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new L(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new L(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new L(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new PS(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new PC(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||Object.prototype.hasOwnProperty.call(TC,e)||Object.prototype.hasOwnProperty.call(yy.math,e)||Object.prototype.hasOwnProperty.call(yy.text,e)||Object.prototype.hasOwnProperty.call(WC,e)}isExpandable(e){var t=this.macros.get(e);return t==null?Object.prototype.hasOwnProperty.call(TC,e)&&!TC[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},KC=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,qC=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),JC={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},YC={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},XC=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new GC(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new L(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new PS(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&TC[i.text]&&TC[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++){var i=e[r];if(i.type===`infix`){if(t!==-1)throw new L(`only one infix operator per group`,i.token);t=r,n=i.replaceWith}}if(t!==-1&&n){var a,o,s=e.slice(0,t),c=e.slice(t+1);return a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},o=c.length===1&&c[0].type===`ordgroup`?c[0]:{type:`ordgroup`,mode:this.mode,body:c},[n===`\\\\abovefrac`?this.callFunction(n,[a,e[t],o],[]):this.callFunction(n,[a,o],[])]}return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new L(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new L(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new L(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new L(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new L(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(qC[i.text]){var s=KC.test(i.text),c=[];for(c.push(new PS(qC[i.text])),this.consume();;){var l=this.fetch().text;if(!qC[l]||KC.test(l)!==s)break;c.unshift(new PS(qC[l])),this.consume()}var u=this.subparse(c);s?r={type:`ordgroup`,mode:`math`,body:u}:n={type:`ordgroup`,mode:`math`,body:u}}else break}return n&&r?{type:`supsub`,mode:this.mode,base:t,sup:n,sub:r}:n?{type:`supsub`,mode:this.mode,base:t,sup:n}:r?{type:`supsub`,mode:this.mode,base:t,sub:r}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=TC[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new L(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new L(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new L(`Can't use function '`+r+`' in math mode`,n);var a=this.parseArguments(r,i),o=a.args,s=a.optArgs;return this.callFunction(r,o,s,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=TC[e];if(o&&o.handler)return o.handler(a,t,n);throw new L(`No function handler for `+e)}parseArguments(e,t){var n=t.numOptionalArgs??0,r=t.numArgs+n;if(r===0)return{args:[],optArgs:[]};for(var i=[],a=[],o=0;o<r;o++){var s=t.argTypes?.[o],c=o<n;(`primitive`in t&&t.primitive&&s==null||t.type===`sqrt`&&o===1&&a[0]==null)&&(s=`primitive`);var l=this.parseGroupOfType(`argument to '`+e+`'`,s,c);if(c)a.push(l);else if(l!=null)i.push(l);else throw new L(`Null argument, please report this as a bug`)}return{args:i,optArgs:a}}parseGroupOfType(e,t,n){switch(t){case`color`:return this.parseColorGroup(n);case`size`:return this.parseSizeGroup(n);case`url`:return this.parseUrlGroup(n);case`math`:case`text`:return this.parseArgumentGroup(n,t);case`hbox`:var r=this.parseArgumentGroup(n,`text`);return r==null?null:{type:`styling`,mode:r.mode,body:[r],style:`text`,resetFont:!0};case`raw`:var i=this.parseStringGroup(n);return i==null?null:{type:`raw`,mode:`text`,string:i.text};case`primitive`:if(n)throw new L(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new L(`Expected group as `+e,this.fetch());return a;case`original`:case void 0:return this.parseArgumentGroup(n);default:throw new L(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e){var t=this.gullet.scanArgument(e);if(t==null)return null;for(var n=``,r;(r=this.fetch()).text!==`EOF`;)n+=r.text,this.consume();return this.consume(),t.text=n,t}parseRegexGroup(e,t){for(var n=this.fetch(),r=n,i=``,a;(a=this.fetch()).text!==`EOF`&&e.test(i+a.text);)r=a,i+=r.text,this.consume();if(i===``)throw new L(`Invalid `+t+`: '`+n.text+`'`,n);return n.range(r,i)}parseColorGroup(e){var t=this.parseStringGroup(e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new L(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new L(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!qv(i))throw new L(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var t=this.parseStringGroup(e);if(this.gullet.lexer.setCatcode(`%`,14),this.gullet.lexer.setCatcode(`~`,13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,`$1`);return{type:`url`,mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();var a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){var n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`){this.consume();var a=r===`{`?`}`:`\\endgroup`;this.gullet.beginGroup();var o=this.parseExpression(!1,a),s=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:`ordgroup`,mode:this.mode,loc:NS.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!Object.prototype.hasOwnProperty.call(WC,r)){if(this.settings.throwOnError)throw new L(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if(r.type===`textord`){var i=r.text,a=e[n+1];if(a&&a.type===`textord`){if(i===`-`&&a.text===`-`){var o=e[n+2];n+1<t&&o&&o.type===`textord`&&o.text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:NS.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:NS.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:NS.range(r,a),text:i+i}),--t)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new L(`\\verb assertion failed --
881
- please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}Object.prototype.hasOwnProperty.call(YC,t[0])&&!yy[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Accented Unicode text character "`+t[0]+`" used in math mode`,e),t=YC[t[0]]+t.slice(1));var i=MC.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(yy[this.mode][t]){this.settings.strict&&this.mode===`math`&&Vy.includes(t)&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,e);var o=yy[this.mode][t].group,s=NS.range(e);a=Dx(o)?{type:`atom`,mode:this.mode,family:o,loc:s,text:t}:{type:o,mode:this.mode,loc:s,text:t}}else if(t.charCodeAt(0)>=128)this.settings.strict&&(kv(t.charCodeAt(0))?this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Unicode text character "`+t[0]+`" used in math mode`,e):this.settings.reportNonstrict(`unknownSymbol`,`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),e)),a={type:`textord`,mode:`text`,loc:NS.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;c<i[0].length;c++){var l=i[0][c];if(!JC[l])throw new L(`Unknown accent ' `+l+`'`,e);var u=JC[l][this.mode]||JC[l].text;if(!u)throw new L(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:NS.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};XC.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var ZC=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new XC(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new L(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new PS(`\\df@tag`)])}]}return r},QC=function(e,t,n){t.textContent=``;var r=nw(e,n).toNode();t.appendChild(r)};typeof document<`u`&&document.compatMode!==`CSS1Compat`&&(typeof console<`u`&&console.warn(`Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.`),QC=function(){throw new L(`KaTeX doesn't work in quirks mode.`)});var $C=function(e,t){return nw(e,t).toMarkup()},ew=function(e,t){return ZC(e,new lv(t))},tw=function(e,t,n){if(n.throwOnError||!(e instanceof L))throw e;var r=X([`katex-error`],[new ay(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},nw=function(e,t){var n=new lv(t);try{return hx(ZC(e,n),e,n)}catch(t){return tw(t,e,n)}},rw={version:`0.18.7`,render:QC,renderToString:$C,ParseError:L,SETTINGS_SCHEMA:av,__parse:ew,__renderToDomTree:nw,__renderToHTMLTree:function(e,t){var n=new lv(t);try{return gx(ZC(e,n),e,n)}catch(t){return tw(t,e,n)}},__setFontMetrics:hy,__defineSymbol:B,__defineFunction:Z,__defineMacro:$,__domTree:{Span:ty,Anchor:ny,SymbolNode:ay,SvgNode:oy,PathNode:sy,LineNode:cy}},iw=/^ {0,3}(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])[ \t]*(?:\n+|$)/,aw=/^ {0,3}(?:\$\$|\\\[)/m,ow=/^(?:\\\(([\s\S]+?)\\\)|\\\[([\s\S]+?)\\\]|\$\$([\s\S]+?)\$\$)/,sw=/\\\(|\\\[|\$\$/;function cw(e,t){return rw.renderToString(e.trim().replace(/(?<!\\)\$/g,`\\$`),{displayMode:t,throwOnError:!1,strict:`ignore`,trust:!1})}function lw(e,t,n,r){return{type:e,raw:t,text:n,displayMode:r}}var uw={tokenizer:{lheading(e){let t=/^(?:[^\n]+\n)+?(?: {0,3}(?:=+|-+) *(?:\n+|$))/.exec(e)?.[0]??``;return aw.test(t)?void 0:!1}},extensions:[{name:`blockMath`,level:`block`,start:e=>e.match(aw)?.index,tokenizer(e){let t=iw.exec(e);if(t)return lw(`blockMath`,t[0],t[1]??t[2],!0)},renderer:e=>`${cw(e.text,!0)}\n`},{name:`inlineMath`,level:`inline`,start:e=>e.match(sw)?.index,tokenizer(e){let t=ow.exec(e);if(!t)return;let[n,r,i,a]=t;return lw(`inlineMath`,n,r??i??a,r===void 0)},renderer:e=>cw(e.text,e.displayMode)}]},dw={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function fw(e){return e.replace(/[&<>"']/g,e=>dw[e])}var pw=String.raw`(?:https?:\/\/|\/)[^\s)"]+`,mw=String.raw`(?:${pw}|data:image\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/=]+)`,hw=String.raw`!\[([^\]]*)\]\((${mw})\)`,gw=new RegExp(String.raw`^${pw}$`),_w=new RegExp(String.raw`^${mw}$`),vw=new RegExp(String.raw`\[${hw}\]\((${pw})\)`,`g`),yw=new RegExp(hw,`g`),bw=new RegExp(String.raw`\[([^\]]+)\]\((${pw})\)`,`g`);function xw(e,t){return`<a href="${e}" target="_blank" rel="noopener noreferrer">${t}</a>`}function Sw(e,t){return`<img class="smarter-chat-image" src="${e}" alt="${t}" loading="lazy">`}function Cw(e){return fw(e).replace(vw,(e,t,n,r)=>xw(r,Sw(n,t))).replace(yw,(e,t,n)=>ww(n,t)).replace(bw,(e,t,n)=>xw(n,t))}function ww(e,t){return e.startsWith(`data:`)?Sw(e,t):xw(e,Sw(e,t))}var Tw=new q_({gfm:!0,breaks:!0,async:!1});Tw.use(uw),Tw.use({renderer:{html({text:e}){return fw(e)},link({href:e,tokens:t}){let[n]=t;if(t.length===1&&n.type===`image`){let{href:t,text:r}=n;if(gw.test(e)&&_w.test(t))return xw(fw(e),Sw(fw(t),r))}let r=this.parser.parseInline(t);return gw.test(e)?xw(fw(e),r):r},image({href:e,text:t}){return _w.test(e)?ww(fw(e),t):t},code({text:e,lang:t}){return bm(e,t)}}});function Ew(e){return tg.sanitize(e,{ADD_TAGS:[`semantics`,`annotation`],ADD_ATTR:[`target`,`encoding`]})}function Dw(e){let t=Tw.parse(e).trim(),n=/^<p>([\s\S]*)<\/p>$/.exec(t);return Ew(n&&!n[1].includes(`<p>`)?n[1]:t)}function Ow(e){return e===Mf.USER?jf.OUTGOING:jf.INCOMING}function kw(e,t){return t===Mf.USER?Cw(e):Dw(e)}function Aw(e,t,n,r=Ow(t)){let i=typeof e==`string`&&e!==``;return{message:i?kw(e,t):``,content:e??null,direction:r,sender:t,sentTime:new Date().toLocaleString(),display:i,originalMessage:n}}function jw(e){return(e??[]).filter(e=>e&&typeof e==`object`&&typeof e.role==`string`).map(e=>Aw(e.content,e.role,e))}function Mw(e){return!e||e.length===0?``:Yf(`Some example prompts to get you started:`)+`
881
+ please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}Object.prototype.hasOwnProperty.call(YC,t[0])&&!yy[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Accented Unicode text character "`+t[0]+`" used in math mode`,e),t=YC[t[0]]+t.slice(1));var i=MC.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(yy[this.mode][t]){this.settings.strict&&this.mode===`math`&&Vy.includes(t)&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,e);var o=yy[this.mode][t].group,s=NS.range(e);a=Dx(o)?{type:`atom`,mode:this.mode,family:o,loc:s,text:t}:{type:o,mode:this.mode,loc:s,text:t}}else if(t.charCodeAt(0)>=128)this.settings.strict&&(kv(t.charCodeAt(0))?this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Unicode text character "`+t[0]+`" used in math mode`,e):this.settings.reportNonstrict(`unknownSymbol`,`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),e)),a={type:`textord`,mode:`text`,loc:NS.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;c<i[0].length;c++){var l=i[0][c];if(!JC[l])throw new L(`Unknown accent ' `+l+`'`,e);var u=JC[l][this.mode]||JC[l].text;if(!u)throw new L(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:NS.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};XC.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var ZC=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new XC(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new L(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new PS(`\\df@tag`)])}]}return r},QC=function(e,t,n){t.textContent=``;var r=nw(e,n).toNode();t.appendChild(r)};typeof document<`u`&&document.compatMode!==`CSS1Compat`&&(typeof console<`u`&&console.warn(`Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.`),QC=function(){throw new L(`KaTeX doesn't work in quirks mode.`)});var $C=function(e,t){return nw(e,t).toMarkup()},ew=function(e,t){return ZC(e,new lv(t))},tw=function(e,t,n){if(n.throwOnError||!(e instanceof L))throw e;var r=X([`katex-error`],[new ay(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},nw=function(e,t){var n=new lv(t);try{return hx(ZC(e,n),e,n)}catch(t){return tw(t,e,n)}},rw={version:`0.18.7`,render:QC,renderToString:$C,ParseError:L,SETTINGS_SCHEMA:av,__parse:ew,__renderToDomTree:nw,__renderToHTMLTree:function(e,t){var n=new lv(t);try{return gx(ZC(e,n),e,n)}catch(t){return tw(t,e,n)}},__setFontMetrics:hy,__defineSymbol:B,__defineFunction:Z,__defineMacro:$,__domTree:{Span:ty,Anchor:ny,SymbolNode:ay,SvgNode:oy,PathNode:sy,LineNode:cy}},iw=/^ {0,3}(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])[ \t]*(?:\n+|$)/,aw=/^ {0,3}(?:\$\$|\\\[)/m,ow=/^(?:\\\(([\s\S]+?)\\\)|\\\[([\s\S]+?)\\\]|\$\$([\s\S]+?)\$\$)/,sw=/\\\(|\\\[|\$\$/;function cw(e,t){return rw.renderToString(e.trim().replace(/(?<!\\)\$/g,`\\$`),{displayMode:t,throwOnError:!1,strict:`ignore`,trust:!1})}function lw(e,t,n,r){return{type:e,raw:t,text:n,displayMode:r}}var uw={tokenizer:{lheading(e){let t=/^(?:[^\n]+\n)+?(?: {0,3}(?:=+|-+) *(?:\n+|$))/.exec(e)?.[0]??``;return aw.test(t)?void 0:!1}},extensions:[{name:`blockMath`,level:`block`,start:e=>e.match(aw)?.index,tokenizer(e){let t=iw.exec(e);if(t)return lw(`blockMath`,t[0],t[1]??t[2],!0)},renderer:e=>`${cw(e.text,!0)}\n`},{name:`inlineMath`,level:`inline`,start:e=>e.match(sw)?.index,tokenizer(e){let t=ow.exec(e);if(!t)return;let[n,r,i,a]=t;return lw(`inlineMath`,n,r??i??a,r===void 0)},renderer:e=>cw(e.text,e.displayMode)}]},dw={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function fw(e){return e.replace(/[&<>"']/g,e=>dw[e])}var pw=String.raw`(?:https?:\/\/|\/)[^\s)"]+`,mw=String.raw`(?:${pw}|data:image\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/=]+)`,hw=String.raw`!\[([^\]]*)\]\((${mw})\)`,gw=new RegExp(String.raw`^${pw}$`),_w=new RegExp(String.raw`^${mw}$`),vw=new RegExp(String.raw`\[${hw}\]\((${pw})\)`,`g`),yw=new RegExp(hw,`g`),bw=new RegExp(String.raw`\[([^\]]+)\]\((${pw})\)`,`g`);function xw(e,t){return`<a href="${e}" target="_blank" rel="noopener noreferrer">${t}</a>`}var Sw=`smarter-chat-image`;function Cw(e,t){return`<img class="${Sw}" src="${e}" alt="${t}" loading="lazy" referrerpolicy="no-referrer">`}function ww(e){if(!(e instanceof HTMLImageElement)||!e.classList.contains(Sw))return!1;let t=document.createElement(`span`);return t.className=`smarter-chat-image-unavailable`,t.textContent=e.alt.trim()||Yf(`Image`),e.replaceWith(t),!0}function Tw(e){return fw(e).replace(vw,(e,t,n,r)=>xw(r,Cw(n,t))).replace(yw,(e,t,n)=>Ew(n,t)).replace(bw,(e,t,n)=>xw(n,t))}function Ew(e,t){return e.startsWith(`data:`)?Cw(e,t):xw(e,Cw(e,t))}var Dw=new q_({gfm:!0,breaks:!0,async:!1});Dw.use(uw),Dw.use({renderer:{html({text:e}){return fw(e)},link({href:e,tokens:t}){let[n]=t;if(t.length===1&&n.type===`image`){let{href:t,text:r}=n;if(gw.test(e)&&_w.test(t))return xw(fw(e),Cw(fw(t),r))}let r=this.parser.parseInline(t);return gw.test(e)?xw(fw(e),r):r},image({href:e,text:t}){return _w.test(e)?Ew(fw(e),t):t},code({text:e,lang:t}){return bm(e,t)}}});function Ow(e){return tg.sanitize(e,{ADD_TAGS:[`semantics`,`annotation`],ADD_ATTR:[`target`,`encoding`,`referrerpolicy`]})}function kw(e){let t=Dw.parse(e).trim(),n=/^<p>([\s\S]*)<\/p>$/.exec(t);return Ow(n&&!n[1].includes(`<p>`)?n[1]:t)}function Aw(e){return e===Mf.USER?jf.OUTGOING:jf.INCOMING}function jw(e,t){return t===Mf.USER?Tw(e):kw(e)}function Mw(e,t,n,r=Aw(t)){let i=typeof e==`string`&&e!==``;return{message:i?jw(e,t):``,content:e??null,direction:r,sender:t,sentTime:new Date().toLocaleString(),display:i,originalMessage:n}}function Nw(e){return(e??[]).filter(e=>e&&typeof e==`object`&&typeof e.role==`string`).map(e=>Mw(e.content,e.role,e))}function Pw(e){return!e||e.length===0?``:Yf(`Some example prompts to get you started:`)+`
882
882
 
883
- `+e.map(e=>`- ${e}\n`).join(``)}function Nw(e,t,n){let r=[Aw(t,Mf.SYSTEM),Aw(e,Mf.ASSISTANT)],i=Mw(n);return i&&r.push(Aw(i,Mf.ASSISTANT)),r}function Pw(e,t,n,r){let i=jw(r);return i.length>0?i:Nw(e,t,n)}function Fw(e){return e.filter(e=>Nf.includes(e.sender)).map(e=>({...e.originalMessage,role:e.sender,content:e.content}))}function Iw(e,t,n){return e.map(e=>e.message?{...e,display:!n.includes(e.sender)||t}:{...e,display:!1})}function Lw(e){return e.replace(/<[^>]+>/g,``)}function Rw({label:e,color:t,path:r}){return(0,n.jsxs)(`svg`,{className:`smarter-chat-title-icon`,viewBox:`0 0 16 16`,role:`img`,"aria-label":e,fill:t,children:[(0,n.jsx)(`title`,{children:e}),(0,n.jsx)(`path`,{d:r})]})}var zw=`M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z`,Bw=`M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293z`,Vw=`M9.752 6.193c.599.6 1.73.437 2.528-.362s.96-1.932.362-2.531c-.599-.6-1.73-.438-2.528.361-.798.8-.96 1.933-.362 2.532M15.811 3.312c-.363 1.534-1.334 3.626-3.64 6.218l-.24 2.408a2.56 2.56 0 0 1-.732 1.526L8.817 15.85a.51.51 0 0 1-.867-.434l.27-1.899c.04-.28-.013-.593-.131-.956a9 9 0 0 0-.249-.657l-.082-.202c-.468-.07-.844-.393-1.162-.71-.319-.318-.64-.695-.71-1.163l-.202-.082a9 9 0 0 0-.657-.249c-.363-.118-.676-.172-.956-.131l-1.899.27a.51.51 0 0 1-.434-.867l2.391-2.391a2.56 2.56 0 0 1 1.526-.732l2.408-.24c2.592-2.306 4.684-3.277 6.218-3.64a.5.5 0 0 1 .6.6`;function Hw({title:e,isReady:t,isValid:r,isDeployed:i}){return t?(0,n.jsxs)(`span`,{className:`smarter-chat-title`,children:[e,r?(0,n.jsx)(Rw,{label:Yf(`valid`),color:`green`,path:zw}):(0,n.jsx)(Rw,{label:Yf(`not valid`),color:`red`,path:Bw}),i?(0,n.jsx)(Rw,{label:Yf(`deployed`),color:`orange`,path:Vw}):(0,n.jsx)(`span`,{className:`smarter-chat-title-sandbox`,children:Yf(`(sandbox)`)})]}):(0,n.jsx)(`span`,{children:Yf(`Loading...`)})}var Uw=Hw,Ww=class extends t.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`${Tf} ErrorBoundary caught an error:`,e,t)}render(){return this.state.error?(0,n.jsxs)(`div`,{role:`alert`,className:`smarter-chat-error-boundary`,children:[(0,n.jsx)(`h2`,{children:Yf(`Something went wrong.`)}),(0,n.jsx)(`p`,{children:this.state.error.message})]}):this.props.children}};function Gw({paths:e}){return(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,children:e.map(e=>(0,n.jsx)(`path`,{d:e},e))})}function Kw(){return(0,n.jsx)(Gw,{paths:[`M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5z`]})}function qw(){return(0,n.jsx)(Gw,{paths:[`M1 0 0 1l2.2 3.081a1 1 0 0 0 .815.419h.07a1 1 0 0 1 .708.293l2.675 2.675-2.617 2.654A3.003 3.003 0 0 0 0 13a3 3 0 1 0 5.878-.851l2.654-2.617.968.968-.305.914a1 1 0 0 0 .242 1.023l3.27 3.27a.997.997 0 0 0 1.414 0l1.586-1.586a.997.997 0 0 0 0-1.414l-3.27-3.27a1 1 0 0 0-1.023-.242L10.5 9.5l-.96-.96 2.68-2.643A3.005 3.005 0 0 0 16 3q0-.405-.102-.777l-2.14 2.141L12 4l-.364-1.757L13.777.102a3 3 0 0 0-3.675 3.68L7.462 6.46 4.793 3.793a1 1 0 0 1-.293-.707v-.071a1 1 0 0 0-.419-.814zm9.646 10.646a.5.5 0 0 1 .708 0l2.914 2.915a.5.5 0 0 1-.707.707l-2.915-2.914a.5.5 0 0 1 0-.708M3 11l.471.242.529.026.287.445.445.287.026.529L5 13l-.242.471-.026.529-.445.287-.287.445-.529.026L3 15l-.471-.242L2 14.732l-.287-.445L1.268 14l-.026-.529L1 13l.242-.471.026-.529.445-.287.287-.445.529-.026z`]})}function Jw(){return(0,n.jsx)(Gw,{paths:[`M5.338 1.59a61 61 0 0 0-2.837.856.48.48 0 0 0-.328.39c-.554 4.157.726 7.19 2.253 9.188a10.7 10.7 0 0 0 2.287 2.233c.346.244.652.42.893.533q.18.085.293.118a1 1 0 0 0 .101.025 1 1 0 0 0 .1-.025q.114-.034.294-.118c.24-.113.547-.29.893-.533a10.7 10.7 0 0 0 2.287-2.233c1.527-1.997 2.807-5.031 2.253-9.188a.48.48 0 0 0-.328-.39c-.651-.213-1.75-.56-2.837-.855C9.552 1.29 8.531 1.067 8 1.067c-.53 0-1.552.223-2.662.524zM5.072.56C6.157.265 7.31 0 8 0s1.843.265 2.928.56c1.11.3 2.229.655 2.887.87a1.54 1.54 0 0 1 1.044 1.262c.596 4.477-.787 7.795-2.465 9.99a11.8 11.8 0 0 1-2.517 2.453 7 7 0 0 1-1.048.625c-.28.132-.581.24-.829.24s-.548-.108-.829-.24a7 7 0 0 1-1.048-.625 11.8 11.8 0 0 1-2.517-2.453C1.928 10.487.545 7.169 1.141 2.692A1.54 1.54 0 0 1 2.185 1.43 63 63 0 0 1 5.072.56`,`M10.854 5.146a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708 0l-1.5-1.5a.5.5 0 1 1 .708-.708L7.5 7.793l2.646-2.647a.5.5 0 0 1 .708 0`]})}function Yw(e){return e===Mf.SMARTER?`smarter-message`:e===Mf.SMARTER_ERROR?`smarter-error-message`:e===Mf.TOOL||e===Mf.SYSTEM?`system-message`:``}function Xw(e){return Aw(e.message,Mf.SMARTER).message}function Zw({apiUrl:e,apiKey:r=null,toggleMetadata:i=!1,csrfCookieName:a=`csrftoken`,csrftoken:o=null,debugCookieName:s=`debug`,debugCookieExpiration:c=Ef,debugMode:l=!1,sessionCookieName:u=`session_key`,sessionCookieExpiration:d=Ef,cookiePath:f=null,cookieDomain:p=``,smarterRequestId:m=``,streamProgress:h=!0,language:g=null,verbose:_=!1,reloadKey:v,headerActions:y=null,onConfig:b,onNewChat:x,onModeChange:S}){let C=Wf(g),[w,T]=(0,t.useState)(null),[E,D]=(0,t.useState)(null),[O,k]=(0,t.useState)([]),[A,ee]=(0,t.useState)(i),[j,M]=(0,t.useState)(!1),[N,te]=(0,t.useState)([]),[ne,re]=(0,t.useState)(new Set),ie=(0,t.useRef)(null),ae=(0,t.useRef)(null),[oe,se]=(0,t.useState)(!1),P=(0,t.useRef)(0),ce=(0,t.useMemo)(()=>({csrfCookie:Af(a,null,p,o),sessionCookie:Af(u,d,p,null,f),debugCookie:Af(s,c,p,null,f)}),[a,o,p,u,d,f,s,c]),le=(0,t.useMemo)(()=>({smarterClient:Cf,smarterClientVersion:wf,smarterRequestId:m,apiKey:r}),[m,r]),ue=(0,t.useCallback)((...e)=>{(l||w?.debug_mode)&&console.log(Tf,...e)},[l,w?.debug_mode]),de=(0,t.useCallback)(async()=>{let t=++P.current,n=await fp(e,ce,le,_);return t===P.current&&(T(n),se(_)),n},[e,ce,le,_]);(0,t.useEffect)(()=>{_&&w&&!oe&&de().catch(e=>console.error(`${Tf} Failed to refresh:`,e))},[_,w,oe,de]);let fe=(0,t.useRef)(v);(0,t.useEffect)(()=>{v!==fe.current&&(fe.current=v,de().catch(e=>console.error(`${Tf} Failed to refresh:`,e)))},[v,de]),(0,t.useEffect)(()=>{w&&b?.(w)},[w,b]),(0,t.useEffect)(()=>{S?.(A)},[A,S]);let pe=(0,t.useCallback)(async()=>{try{D(null);let e=await de(),t=e.llmclient,n=Pw(t.app_welcome_message??``,t.default_system_role??``,t.app_example_prompts,e.history?.chat_history);k(Iw(n,i,Pf)),ee(i),M(!1),ue(`chat started`,e)}catch(e){console.error(`${Tf} Failed to fetch the configuration:`,e),D(e instanceof Error?e.message:String(e))}},[de,ue,i]);(0,t.useEffect)(()=>{pe()},[e]),(0,t.useEffect)(()=>{let e=ae.current?.querySelector(`.cs-message-input__content-editor`);e?.setAttribute(`role`,`textbox`),e?.setAttribute(`aria-multiline`,`true`),e?.setAttribute(`aria-label`,Yf(`Message`))},[C]),(0,t.useEffect)(()=>{let e=ae.current,t=e=>xm(e.target)||yg(e.target);return e?.addEventListener(`click`,t),()=>e?.removeEventListener(`click`,t)},[]),(0,t.useEffect)(()=>{let e=ae.current,t=e=>{let t=e.target;if(!(t instanceof HTMLImageElement)||!t.closest(`.cs-avatar`))return;let n=t.getAttribute(`src`)??``;re(e=>e.has(n)?e:new Set(e).add(n))};return e?.addEventListener(`error`,t,!0),()=>e?.removeEventListener(`error`,t,!0)},[]),(0,t.useLayoutEffect)(()=>{vg(ae.current)},[O,A]);let he=()=>{kf(ce.sessionCookie,``),T(null),x?.(),pe()},ge=e=>{e!==A&&(ee(e),k(t=>Iw(t,e,Pf)))};async function _e(e){if(!w)return;let t=[...O,Aw(e,Mf.USER)];k(t),M(!0),te([]);let n=h?e=>{ue(`prompt progress`,e),te(t=>[...t,e])}:void 0;try{let e=await Sp(w,Fw(t),ce,le,n),r=e.messages.map(e=>{let t=Aw(e.content,e.role,e);return Pf.includes(t.sender)&&!A?{...t,display:!1}:t});k(e=>[...e,...r]),ue(`prompt response`,e),_?await de().catch(e=>console.error(`${Tf} Failed to refresh:`,e)):se(!1)}catch(e){console.error(`${Tf} Prompt failed:`,e);let t=e instanceof Error?e.message:String(e);k(e=>[...e,Aw(t,Mf.SMARTER_ERROR)])}finally{M(!1),te([])}}let ve=(e,t,n)=>{let r=n??t??Lw(e);r.trim()&&_e(r)},ye=e=>{let t=e.target.files?.[0];t&&(t.text().then(e=>void _e(e)),e.target.value=``)},be=w?.llmclient,xe=!!w,Se=be?.styles,Ce=(0,t.useMemo)(()=>Ag(Se),[Se]);jg(Se?.google_font);let we=e=>{let t=Dg(e);return t&&!ne.has(t)?t:null},Te=we(Se?.app_logo_url),Ee=we(Se?.assistant_avatar_url),De=we(Se?.user_avatar_url),Oe=be?`${be.app_name} v${be.version||`1.0.0`}`:``,ke=be?.total_tools??0,Ae=``;be&&ke>0?Ae=Qf(Xf(`%(provider)s %(model)s with %(count)s additional tool`,`%(provider)s %(model)s with %(count)s additional tools`,ke),{provider:be.provider,model:be.default_model,count:ke}):be&&(Ae=`${be.provider} ${be.default_model}`);let je=w?.meta_data?.is_valid??w?.meta_data?.ready??!0,Me=!!(w?.meta_data?.is_deployed??be?.deployed),Ne=be?.app_assistant??Yf(`Assistant`);function Pe(e){return e.sender===Mf.ASSISTANT&&Ee?(0,n.jsx)(me,{src:Ee,name:Ne}):e.sender===Mf.USER&&De?(0,n.jsx)(me,{src:De,name:Yf(`You`)}):null}let Fe=N.at(-1)?.message,Le=Fe?Qf(Yf(`%(assistant)s: %(step)s`),{assistant:Ne,step:Fe}):Qf(Yf(`%(assistant)s is typing`),{assistant:Ne}),Re;return Re=E?Yf(`Smarter Chat is not available`):xe?(0,n.jsx)(Uw,{title:Oe,isReady:xe,isValid:je,isDeployed:Me}):Yf(`Configuring workbench...`),(0,n.jsx)(`div`,{id:`smarter_chat_component_container`,className:`SmarterChat`,style:Ce,children:(0,n.jsx)(`div`,{className:`smarter-chat-container`,children:(0,n.jsx)(`div`,{role:`region`,"aria-label":Yf(`Chat`),className:`smarter-chat-app`,children:(0,n.jsxs)(`div`,{className:`chat-app`,ref:ae,children:[(0,n.jsx)(Ww,{children:(0,n.jsx)(Rd,{style:{width:`100%`,height:`100%`},children:(0,n.jsxs)(Ed,{className:`smarter-chat-container-inner`,children:[(0,n.jsxs)(ns,{children:[Te&&xe&&(0,n.jsx)(me,{className:`smarter-chat-logo`,src:Te,name:be?.app_name??``}),(0,n.jsx)(ns.Content,{userName:Re,info:xe?Ae:``}),(0,n.jsxs)(ns.Actions,{children:[i&&(0,n.jsxs)(`div`,{role:`group`,"aria-label":Yf(`Chat mode`),className:`smarter-chat-mode-toggle`,children:[(0,n.jsx)(Ie,{className:`smarter-chat-toolbar-button smarter-chat-mode-option`,icon:(0,n.jsx)(qw,{}),"aria-pressed":A,onClick:()=>ge(!0),title:Yf(`Sandbox mode: Smarter's system, tool and meta data messages are displayed.`),children:(0,n.jsx)(`span`,{className:`smarter-chat-toolbar-label`,children:Zf(`chat mode`,`Sandbox`)})}),(0,n.jsx)(Ie,{className:`smarter-chat-toolbar-button smarter-chat-mode-option`,icon:(0,n.jsx)(Jw,{}),"aria-pressed":!A,onClick:()=>ge(!1),title:Yf(`Production mode: the conversation is displayed as its users see it.`),children:(0,n.jsx)(`span`,{className:`smarter-chat-toolbar-label`,children:Zf(`chat mode`,`Production`)})})]}),(0,n.jsx)(Ie,{className:`smarter-chat-toolbar-button`,icon:(0,n.jsx)(Kw,{}),onClick:he,title:Yf(`Start a new chat`),"aria-label":Yf(`Start a new chat`)}),y]})]}),(0,n.jsxs)(mu,{className:`smarter-chat-message-list`,scrollBehavior:`auto`,typingIndicator:j?(0,n.jsx)(df,{content:Le}):null,children:[E&&(0,n.jsx)(Qc,{className:`smarter-error-message`,model:{message:Aw(E,Mf.SMARTER_ERROR).message,direction:`incoming`,position:`single`,sender:Mf.SMARTER_ERROR}}),O.map((e,t)=>e.display?(0,n.jsx)(Qc,{className:Yw(e.sender),model:{message:e.message,sentTime:e.sentTime,sender:e.sender,direction:e.direction,position:`single`},children:Pe(e)},t):null),A&&N.map((e,t)=>(0,n.jsx)(Qc,{className:`smarter-progress-message ${t===N.length-1?`smarter-progress-message-active`:`smarter-progress-message-done`}`,model:{message:Xw(e),sender:Mf.SMARTER,direction:`incoming`,position:`single`}},`progress-${t}`))]}),(0,n.jsx)(cd,{placeholder:be?.app_placeholder??``,onSend:ve,onAttachClick:()=>ie.current?.click(),attachButton:!!be?.app_file_attachment,disabled:!xe,fancyScroll:!1,onPaste:Cm})]})})}),(0,n.jsx)(`input`,{type:`file`,accept:`.py,.txt,.md,.json,.yaml,.yml,.csv`,"aria-label":Yf(`Attach a file`),ref:ie,style:{display:`none`},onChange:ye})]})})})})}function Qw({className:e=``,icon:t,children:r,...i}){return(0,n.jsx)(Ie,{className:[`smarter-chat-toolbar-button`,r?`smarter-chat-toolbar-button-labeled`:``,e].filter(Boolean).join(` `),icon:t,...i,children:r?(0,n.jsx)(`span`,{className:`smarter-chat-toolbar-label`,children:r}):null})}var $w=Zw;e.CHAT_CONTRACT_V2_CAPABILITY=tp,e.HeaderButton=Qw,e.MessageDirectionEnum=jf,e.SenderRoleEnum=Mf,e.SmarterChat=$w,e.ValidMessageRolesEnum=Nf,e.normalizeConfig=cp,e.version=wf});
883
+ `+e.map(e=>`- ${e}\n`).join(``)}function Fw(e,t,n){let r=[Mw(t,Mf.SYSTEM),Mw(e,Mf.ASSISTANT)],i=Pw(n);return i&&r.push(Mw(i,Mf.ASSISTANT)),r}function Iw(e,t,n,r){let i=Nw(r);return i.length>0?i:Fw(e,t,n)}function Lw(e){return e.filter(e=>Nf.includes(e.sender)).map(e=>({...e.originalMessage,role:e.sender,content:e.content}))}function Rw(e,t,n){return e.map(e=>e.message?{...e,display:!n.includes(e.sender)||t}:{...e,display:!1})}function zw(e){return e.replace(/<[^>]+>/g,``)}function Bw({label:e,color:t,path:r}){return(0,n.jsxs)(`svg`,{className:`smarter-chat-title-icon`,viewBox:`0 0 16 16`,role:`img`,"aria-label":e,fill:t,children:[(0,n.jsx)(`title`,{children:e}),(0,n.jsx)(`path`,{d:r})]})}var Vw=`M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z`,Hw=`M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293z`,Uw=`M9.752 6.193c.599.6 1.73.437 2.528-.362s.96-1.932.362-2.531c-.599-.6-1.73-.438-2.528.361-.798.8-.96 1.933-.362 2.532M15.811 3.312c-.363 1.534-1.334 3.626-3.64 6.218l-.24 2.408a2.56 2.56 0 0 1-.732 1.526L8.817 15.85a.51.51 0 0 1-.867-.434l.27-1.899c.04-.28-.013-.593-.131-.956a9 9 0 0 0-.249-.657l-.082-.202c-.468-.07-.844-.393-1.162-.71-.319-.318-.64-.695-.71-1.163l-.202-.082a9 9 0 0 0-.657-.249c-.363-.118-.676-.172-.956-.131l-1.899.27a.51.51 0 0 1-.434-.867l2.391-2.391a2.56 2.56 0 0 1 1.526-.732l2.408-.24c2.592-2.306 4.684-3.277 6.218-3.64a.5.5 0 0 1 .6.6`;function Ww({title:e,isReady:t,isValid:r,isDeployed:i}){return t?(0,n.jsxs)(`span`,{className:`smarter-chat-title`,children:[e,r?(0,n.jsx)(Bw,{label:Yf(`valid`),color:`green`,path:Vw}):(0,n.jsx)(Bw,{label:Yf(`not valid`),color:`red`,path:Hw}),i?(0,n.jsx)(Bw,{label:Yf(`deployed`),color:`orange`,path:Uw}):(0,n.jsx)(`span`,{className:`smarter-chat-title-sandbox`,children:Yf(`(sandbox)`)})]}):(0,n.jsx)(`span`,{children:Yf(`Loading...`)})}var Gw=Ww,Kw=class extends t.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`${Tf} ErrorBoundary caught an error:`,e,t)}render(){return this.state.error?(0,n.jsxs)(`div`,{role:`alert`,className:`smarter-chat-error-boundary`,children:[(0,n.jsx)(`h2`,{children:Yf(`Something went wrong.`)}),(0,n.jsx)(`p`,{children:this.state.error.message})]}):this.props.children}};function qw({paths:e}){return(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,children:e.map(e=>(0,n.jsx)(`path`,{d:e},e))})}function Jw(){return(0,n.jsx)(qw,{paths:[`M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5z`]})}function Yw(){return(0,n.jsx)(qw,{paths:[`M1 0 0 1l2.2 3.081a1 1 0 0 0 .815.419h.07a1 1 0 0 1 .708.293l2.675 2.675-2.617 2.654A3.003 3.003 0 0 0 0 13a3 3 0 1 0 5.878-.851l2.654-2.617.968.968-.305.914a1 1 0 0 0 .242 1.023l3.27 3.27a.997.997 0 0 0 1.414 0l1.586-1.586a.997.997 0 0 0 0-1.414l-3.27-3.27a1 1 0 0 0-1.023-.242L10.5 9.5l-.96-.96 2.68-2.643A3.005 3.005 0 0 0 16 3q0-.405-.102-.777l-2.14 2.141L12 4l-.364-1.757L13.777.102a3 3 0 0 0-3.675 3.68L7.462 6.46 4.793 3.793a1 1 0 0 1-.293-.707v-.071a1 1 0 0 0-.419-.814zm9.646 10.646a.5.5 0 0 1 .708 0l2.914 2.915a.5.5 0 0 1-.707.707l-2.915-2.914a.5.5 0 0 1 0-.708M3 11l.471.242.529.026.287.445.445.287.026.529L5 13l-.242.471-.026.529-.445.287-.287.445-.529.026L3 15l-.471-.242L2 14.732l-.287-.445L1.268 14l-.026-.529L1 13l.242-.471.026-.529.445-.287.287-.445.529-.026z`]})}function Xw(){return(0,n.jsx)(qw,{paths:[`M5.338 1.59a61 61 0 0 0-2.837.856.48.48 0 0 0-.328.39c-.554 4.157.726 7.19 2.253 9.188a10.7 10.7 0 0 0 2.287 2.233c.346.244.652.42.893.533q.18.085.293.118a1 1 0 0 0 .101.025 1 1 0 0 0 .1-.025q.114-.034.294-.118c.24-.113.547-.29.893-.533a10.7 10.7 0 0 0 2.287-2.233c1.527-1.997 2.807-5.031 2.253-9.188a.48.48 0 0 0-.328-.39c-.651-.213-1.75-.56-2.837-.855C9.552 1.29 8.531 1.067 8 1.067c-.53 0-1.552.223-2.662.524zM5.072.56C6.157.265 7.31 0 8 0s1.843.265 2.928.56c1.11.3 2.229.655 2.887.87a1.54 1.54 0 0 1 1.044 1.262c.596 4.477-.787 7.795-2.465 9.99a11.8 11.8 0 0 1-2.517 2.453 7 7 0 0 1-1.048.625c-.28.132-.581.24-.829.24s-.548-.108-.829-.24a7 7 0 0 1-1.048-.625 11.8 11.8 0 0 1-2.517-2.453C1.928 10.487.545 7.169 1.141 2.692A1.54 1.54 0 0 1 2.185 1.43 63 63 0 0 1 5.072.56`,`M10.854 5.146a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708 0l-1.5-1.5a.5.5 0 1 1 .708-.708L7.5 7.793l2.646-2.647a.5.5 0 0 1 .708 0`]})}function Zw(e){return e===Mf.SMARTER?`smarter-message`:e===Mf.SMARTER_ERROR?`smarter-error-message`:e===Mf.TOOL||e===Mf.SYSTEM?`system-message`:``}function Qw(e){return Mw(e.message,Mf.SMARTER).message}function $w({apiUrl:e,apiKey:r=null,toggleMetadata:i=!1,csrfCookieName:a=`csrftoken`,csrftoken:o=null,debugCookieName:s=`debug`,debugCookieExpiration:c=Ef,debugMode:l=!1,sessionCookieName:u=`session_key`,sessionCookieExpiration:d=Ef,cookiePath:f=null,cookieDomain:p=``,smarterRequestId:m=``,streamProgress:h=!0,language:g=null,verbose:_=!1,reloadKey:v,headerActions:y=null,onConfig:b,onNewChat:x,onModeChange:S}){let C=Wf(g),[w,T]=(0,t.useState)(null),[E,D]=(0,t.useState)(null),[O,k]=(0,t.useState)([]),[A,ee]=(0,t.useState)(i),[j,M]=(0,t.useState)(!1),[N,te]=(0,t.useState)([]),[ne,re]=(0,t.useState)(new Set),ie=(0,t.useRef)(null),ae=(0,t.useRef)(null),[oe,se]=(0,t.useState)(!1),P=(0,t.useRef)(0),ce=(0,t.useMemo)(()=>({csrfCookie:Af(a,null,p,o),sessionCookie:Af(u,d,p,null,f),debugCookie:Af(s,c,p,null,f)}),[a,o,p,u,d,f,s,c]),le=(0,t.useMemo)(()=>({smarterClient:Cf,smarterClientVersion:wf,smarterRequestId:m,apiKey:r}),[m,r]),ue=(0,t.useCallback)((...e)=>{(l||w?.debug_mode)&&console.log(Tf,...e)},[l,w?.debug_mode]),de=(0,t.useCallback)(async()=>{let t=++P.current,n=await fp(e,ce,le,_);return t===P.current&&(T(n),se(_)),n},[e,ce,le,_]);(0,t.useEffect)(()=>{_&&w&&!oe&&de().catch(e=>console.error(`${Tf} Failed to refresh:`,e))},[_,w,oe,de]);let fe=(0,t.useRef)(v);(0,t.useEffect)(()=>{v!==fe.current&&(fe.current=v,de().catch(e=>console.error(`${Tf} Failed to refresh:`,e)))},[v,de]),(0,t.useEffect)(()=>{w&&b?.(w)},[w,b]),(0,t.useEffect)(()=>{S?.(A)},[A,S]);let pe=(0,t.useCallback)(async()=>{try{D(null);let e=await de(),t=e.llmclient,n=Iw(t.app_welcome_message??``,t.default_system_role??``,t.app_example_prompts,e.history?.chat_history);k(Rw(n,i,Pf)),ee(i),M(!1),ue(`chat started`,e)}catch(e){console.error(`${Tf} Failed to fetch the configuration:`,e),D(e instanceof Error?e.message:String(e))}},[de,ue,i]);(0,t.useEffect)(()=>{pe()},[e]),(0,t.useEffect)(()=>{let e=ae.current?.querySelector(`.cs-message-input__content-editor`);e?.setAttribute(`role`,`textbox`),e?.setAttribute(`aria-multiline`,`true`),e?.setAttribute(`aria-label`,Yf(`Message`))},[C]),(0,t.useEffect)(()=>{let e=ae.current,t=e=>xm(e.target)||yg(e.target);return e?.addEventListener(`click`,t),()=>e?.removeEventListener(`click`,t)},[]),(0,t.useEffect)(()=>{let e=ae.current,t=e=>{if(ww(e.target))return;let t=e.target;if(!(t instanceof HTMLImageElement)||!t.closest(`.cs-avatar`))return;let n=t.getAttribute(`src`)??``;re(e=>e.has(n)?e:new Set(e).add(n))};return e?.addEventListener(`error`,t,!0),()=>e?.removeEventListener(`error`,t,!0)},[]),(0,t.useLayoutEffect)(()=>{vg(ae.current)},[O,A]);let he=()=>{kf(ce.sessionCookie,``),T(null),x?.(),pe()},ge=e=>{e!==A&&(ee(e),k(t=>Rw(t,e,Pf)))};async function _e(e){if(!w)return;let t=[...O,Mw(e,Mf.USER)];k(t),M(!0),te([]);let n=h?e=>{ue(`prompt progress`,e),te(t=>[...t,e])}:void 0;try{let e=await Sp(w,Lw(t),ce,le,n),r=e.messages.map(e=>{let t=Mw(e.content,e.role,e);return Pf.includes(t.sender)&&!A?{...t,display:!1}:t});k(e=>[...e,...r]),ue(`prompt response`,e),_?await de().catch(e=>console.error(`${Tf} Failed to refresh:`,e)):se(!1)}catch(e){console.error(`${Tf} Prompt failed:`,e);let t=e instanceof Error?e.message:String(e);k(e=>[...e,Mw(t,Mf.SMARTER_ERROR)])}finally{M(!1),te([])}}let ve=(e,t,n)=>{let r=n??t??zw(e);r.trim()&&_e(r)},ye=e=>{let t=e.target.files?.[0];t&&(t.text().then(e=>void _e(e)),e.target.value=``)},be=w?.llmclient,xe=!!w,Se=be?.styles,Ce=(0,t.useMemo)(()=>Ag(Se),[Se]);jg(Se?.google_font);let we=e=>{let t=Dg(e);return t&&!ne.has(t)?t:null},Te=we(Se?.app_logo_url),Ee=we(Se?.assistant_avatar_url),De=we(Se?.user_avatar_url),Oe=be?`${be.app_name} v${be.version||`1.0.0`}`:``,ke=be?.total_tools??0,Ae=``;be&&ke>0?Ae=Qf(Xf(`%(provider)s %(model)s with %(count)s additional tool`,`%(provider)s %(model)s with %(count)s additional tools`,ke),{provider:be.provider,model:be.default_model,count:ke}):be&&(Ae=`${be.provider} ${be.default_model}`);let je=w?.meta_data?.is_valid??w?.meta_data?.ready??!0,Me=!!(w?.meta_data?.is_deployed??be?.deployed),Ne=be?.app_assistant??Yf(`Assistant`);function Pe(e){return e.sender===Mf.ASSISTANT&&Ee?(0,n.jsx)(me,{src:Ee,name:Ne}):e.sender===Mf.USER&&De?(0,n.jsx)(me,{src:De,name:Yf(`You`)}):null}let Fe=N.at(-1)?.message,Le=Fe?Qf(Yf(`%(assistant)s: %(step)s`),{assistant:Ne,step:Fe}):Qf(Yf(`%(assistant)s is typing`),{assistant:Ne}),Re;return Re=E?Yf(`Smarter Chat is not available`):xe?(0,n.jsx)(Gw,{title:Oe,isReady:xe,isValid:je,isDeployed:Me}):Yf(`Configuring workbench...`),(0,n.jsx)(`div`,{id:`smarter_chat_component_container`,className:`SmarterChat`,style:Ce,children:(0,n.jsx)(`div`,{className:`smarter-chat-container`,children:(0,n.jsx)(`div`,{role:`region`,"aria-label":Yf(`Chat`),className:`smarter-chat-app`,children:(0,n.jsxs)(`div`,{className:`chat-app`,ref:ae,children:[(0,n.jsx)(Kw,{children:(0,n.jsx)(Rd,{style:{width:`100%`,height:`100%`},children:(0,n.jsxs)(Ed,{className:`smarter-chat-container-inner`,children:[(0,n.jsxs)(ns,{children:[Te&&xe&&(0,n.jsx)(me,{className:`smarter-chat-logo`,src:Te,name:be?.app_name??``}),(0,n.jsx)(ns.Content,{userName:Re,info:xe?Ae:``}),(0,n.jsxs)(ns.Actions,{children:[i&&(0,n.jsxs)(`div`,{role:`group`,"aria-label":Yf(`Chat mode`),className:`smarter-chat-mode-toggle`,children:[(0,n.jsx)(Ie,{className:`smarter-chat-toolbar-button smarter-chat-mode-option`,icon:(0,n.jsx)(Yw,{}),"aria-pressed":A,onClick:()=>ge(!0),title:Yf(`Sandbox mode: Smarter's system, tool and meta data messages are displayed.`),children:(0,n.jsx)(`span`,{className:`smarter-chat-toolbar-label`,children:Zf(`chat mode`,`Sandbox`)})}),(0,n.jsx)(Ie,{className:`smarter-chat-toolbar-button smarter-chat-mode-option`,icon:(0,n.jsx)(Xw,{}),"aria-pressed":!A,onClick:()=>ge(!1),title:Yf(`Production mode: the conversation is displayed as its users see it.`),children:(0,n.jsx)(`span`,{className:`smarter-chat-toolbar-label`,children:Zf(`chat mode`,`Production`)})})]}),(0,n.jsx)(Ie,{className:`smarter-chat-toolbar-button`,icon:(0,n.jsx)(Jw,{}),onClick:he,title:Yf(`Start a new chat`),"aria-label":Yf(`Start a new chat`)}),y]})]}),(0,n.jsxs)(mu,{className:`smarter-chat-message-list`,scrollBehavior:`auto`,typingIndicator:j?(0,n.jsx)(df,{content:Le}):null,children:[E&&(0,n.jsx)(Qc,{className:`smarter-error-message`,model:{message:Mw(E,Mf.SMARTER_ERROR).message,direction:`incoming`,position:`single`,sender:Mf.SMARTER_ERROR}}),O.map((e,t)=>e.display?(0,n.jsx)(Qc,{className:Zw(e.sender),model:{message:e.message,sentTime:e.sentTime,sender:e.sender,direction:e.direction,position:`single`},children:Pe(e)},t):null),A&&N.map((e,t)=>(0,n.jsx)(Qc,{className:`smarter-progress-message ${t===N.length-1?`smarter-progress-message-active`:`smarter-progress-message-done`}`,model:{message:Qw(e),sender:Mf.SMARTER,direction:`incoming`,position:`single`}},`progress-${t}`))]}),(0,n.jsx)(cd,{placeholder:be?.app_placeholder??``,onSend:ve,onAttachClick:()=>ie.current?.click(),attachButton:!!be?.app_file_attachment,disabled:!xe,fancyScroll:!1,onPaste:Cm})]})})}),(0,n.jsx)(`input`,{type:`file`,accept:`.py,.txt,.md,.json,.yaml,.yml,.csv`,"aria-label":Yf(`Attach a file`),ref:ie,style:{display:`none`},onChange:ye})]})})})})}function eT({className:e=``,icon:t,children:r,...i}){return(0,n.jsx)(Ie,{className:[`smarter-chat-toolbar-button`,r?`smarter-chat-toolbar-button-labeled`:``,e].filter(Boolean).join(` `),icon:t,...i,children:r?(0,n.jsx)(`span`,{className:`smarter-chat-toolbar-label`,children:r}):null})}var tT=$w;e.CHAT_CONTRACT_V2_CAPABILITY=tp,e.HeaderButton=eT,e.MessageDirectionEnum=jf,e.SenderRoleEnum=Mf,e.SmarterChat=tT,e.ValidMessageRolesEnum=Nf,e.normalizeConfig=cp,e.version=wf});
884
884
  //# sourceMappingURL=smarter-chat-library.umd.js.map