@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.
package/dist/embed.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,o)=>(o=n==null?{}:e(i(n)),l(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e),f={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`}},p=f.name,m=f.version,h=`[Smarter ${p} v${m}]`,g=864e5,_=`https://cdn.jsdelivr.net/npm/${p}@${m}/dist/`,v=_;function y(e){if(e instanceof HTMLScriptElement&&e.src)try{return new URL(`.`,e.src).toString()}catch{}return _}function b(e=document.currentScript){return v=y(e),v}function x(e){return new URL(`embed/${e}`,v).toString()}var S=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=M(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(te(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ne(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ie=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function ae(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ie)}catch(e){ie(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function oe(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ae(oe.bind(null,e))}var se={map:ne,forEach:function(e,t,n){ne(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ne(e,function(){t++}),t},toArray:function(e){return ne(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=se,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=oe,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:re}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ae,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),C=s(((e,t)=>{t.exports=S()})),w=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ee(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),T=s(((e,t)=>{t.exports=w()})),E=s((e=>{var t=C();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),D=s(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=E()})),O=s((e=>{var t=T(),n=C(),r=D();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}function f(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&f(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function p(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function m(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function h(e){var t=[null,null],n=p(e);return n===null||g(t,e,n.child,{foundSelf:!1}),t}function g(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&g(e,t,n.child,r))return!0;n=n.sibling}return!1}function _(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var v=null,y=null;function b(e,t,n){return e===n||e===t&&(v=e,!0)}function x(e,t,n){return e===n?(y=e,!1):e===t&&(y!==null&&(v=e),!0)}function S(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function w(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var E=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),ee=Symbol.for(`react.fragment`),j=Symbol.for(`react.strict_mode`),te=Symbol.for(`react.profiler`),M=Symbol.for(`react.consumer`),ne=Symbol.for(`react.context`),re=Symbol.for(`react.forward_ref`),ie=Symbol.for(`react.suspense`),ae=Symbol.for(`react.suspense_list`),oe=Symbol.for(`react.memo`),se=Symbol.for(`react.lazy`),ce=Symbol.for(`react.activity`),le=Symbol.for(`react.legacy_hidden`),ue=Symbol.for(`react.memo_cache_sentinel`),de=Symbol.for(`react.view_transition`),fe=Symbol.for(`react.recoverable`),pe=Symbol.iterator;function me(e){return typeof e!=`object`||!e?null:(e=pe&&e[pe]||e[`@@iterator`],typeof e==`function`?e:null)}var he=Symbol.for(`react.client.reference`);function ge(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case ee:return`Fragment`;case te:return`Profiler`;case j:return`StrictMode`;case ie:return`Suspense`;case ae:return`SuspenseList`;case ce:return`Activity`;case de:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case ne:return e.displayName||`Context`;case M:return(e._context.displayName||`Context`)+`.Consumer`;case re:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case oe:return t=e.displayName||null,t===null?ge(e.type)||`Memo`:t;case se:t=e._payload,e=e._init;try{return ge(e(t))}catch{}}return null}var _e=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve={pending:!1,data:null,method:null,action:null},ye=[],be=-1;function xe(e){return{current:e}}function F(e){0>be||(e.current=ye[be],ye[be]=null,be--)}function Se(e,t){be++,ye[be]=e.current,e.current=t}var Ce=xe(null),we=xe(null),Te=xe(null),Ee=xe(null);function De(e,t){switch(Se(Te,t),Se(we,e),Se(Ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Tp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Tp(t),e=Ep(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}F(Ce),Se(Ce,e)}function Oe(){F(Ce),F(we),F(Te)}function ke(e){var t=e.memoizedState;t!==null&&(Sh._currentValue=t.memoizedState,Se(Ee,e)),t=Ce.current;var n=Ep(t,e.type);t!==n&&(Se(we,e),Se(Ce,n))}function Ae(e){we.current===e&&(F(Ce),F(we)),Ee.current===e&&(F(Ee),Sh._currentValue=ve)}var je,Me;function Ne(e){if(je===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);je=t&&t[1]||``,Me=-1<e.stack.indexOf(`
1
+ (function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,o)=>(o=n==null?{}:e(i(n)),l(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e),f={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`}},p=f.name,m=f.version,h=`[Smarter ${p} v${m}]`,g=864e5,_=`https://cdn.jsdelivr.net/npm/${p}@${m}/dist/`,v=_;function y(e){if(e instanceof HTMLScriptElement&&e.src)try{return new URL(`.`,e.src).toString()}catch{}return _}function b(e=document.currentScript){return v=y(e),v}function x(e){return new URL(`embed/${e}`,v).toString()}var S=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=M(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(te(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ne(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ie=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function ae(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ie)}catch(e){ie(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function oe(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ae(oe.bind(null,e))}var se={map:ne,forEach:function(e,t,n){ne(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ne(e,function(){t++}),t},toArray:function(e){return ne(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=se,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=oe,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:re}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ae,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),C=s(((e,t)=>{t.exports=S()})),w=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ee(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),T=s(((e,t)=>{t.exports=w()})),E=s((e=>{var t=C();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),D=s(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=E()})),O=s((e=>{var t=T(),n=C(),r=D();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}function f(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&f(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function p(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function m(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function h(e){var t=[null,null],n=p(e);return n===null||g(t,e,n.child,{foundSelf:!1}),t}function g(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&g(e,t,n.child,r))return!0;n=n.sibling}return!1}function _(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var v=null,y=null;function b(e,t,n){return e===n||e===t&&(v=e,!0)}function x(e,t,n){return e===n?(y=e,!1):e===t&&(y!==null&&(v=e),!0)}function S(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function w(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var E=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),ee=Symbol.for(`react.fragment`),j=Symbol.for(`react.strict_mode`),te=Symbol.for(`react.profiler`),M=Symbol.for(`react.consumer`),ne=Symbol.for(`react.context`),re=Symbol.for(`react.forward_ref`),ie=Symbol.for(`react.suspense`),ae=Symbol.for(`react.suspense_list`),oe=Symbol.for(`react.memo`),se=Symbol.for(`react.lazy`),ce=Symbol.for(`react.activity`),le=Symbol.for(`react.legacy_hidden`),ue=Symbol.for(`react.memo_cache_sentinel`),de=Symbol.for(`react.view_transition`),fe=Symbol.for(`react.recoverable`),pe=Symbol.iterator;function me(e){return typeof e!=`object`||!e?null:(e=pe&&e[pe]||e[`@@iterator`],typeof e==`function`?e:null)}var he=Symbol.for(`react.client.reference`);function ge(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case ee:return`Fragment`;case te:return`Profiler`;case j:return`StrictMode`;case ie:return`Suspense`;case ae:return`SuspenseList`;case ce:return`Activity`;case de:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case ne:return e.displayName||`Context`;case M:return(e._context.displayName||`Context`)+`.Consumer`;case re:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case oe:return t=e.displayName||null,t===null?ge(e.type)||`Memo`:t;case se:t=e._payload,e=e._init;try{return ge(e(t))}catch{}}return null}var _e=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve={pending:!1,data:null,method:null,action:null},ye=[],be=-1;function xe(e){return{current:e}}function F(e){0>be||(e.current=ye[be],ye[be]=null,be--)}function Se(e,t){be++,ye[be]=e.current,e.current=t}var Ce=xe(null),we=xe(null),Te=xe(null),Ee=xe(null);function De(e,t){switch(Se(Te,t),Se(we,e),Se(Ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Tp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Tp(t),e=Ep(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}F(Ce),Se(Ce,e)}function Oe(){F(Ce),F(we),F(Te)}function ke(e){var t=e.memoizedState;t!==null&&(Sh._currentValue=t.memoizedState,Se(Ee,e)),t=Ce.current;var n=Ep(t,e.type);t!==n&&(Se(we,e),Se(Ce,n))}function Ae(e){we.current===e&&(F(Ce),F(we)),Ee.current===e&&(F(Ee),Sh._currentValue=ve)}var je,Me;function Ne(e){if(je===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);je=t&&t[1]||``,Me=-1<e.stack.indexOf(`
2
2
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
3
  `+je+e+Me}var Pe=!1;function Fe(e,t){if(!e||Pe)return``;Pe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
4
  `),l=s.split(`
@@ -572,7 +572,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
572
572
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nu(e,t){if(e){if(typeof e==`string`)return ru(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)?ru(e,t):void 0}}function ru(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 iu(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 au(e){if(Array.isArray(e))return e}function ou(e,t){if(e==null)return{};var n,r,i=su(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 su(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 cu(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function lu(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,yu(r.key),r)}}function uu(e,t,n){return t&&lu(e.prototype,t),n&&lu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function du(e,t,n){return t=hu(t),fu(e,mu()?Reflect.construct(t,n||[],hu(e).constructor):t.apply(e,n))}function fu(e,t){if(t&&(Ql(t)==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return pu(e)}function pu(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function mu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mu=function(){return!!e})()}function hu(e){return hu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hu(e)}function gu(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&&_u(e,t)}function _u(e,t){return _u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_u(e,t)}function vu(e,t,n){return(t=yu(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yu(e){var t=bu(e,`string`);return Ql(t)==`symbol`?t:t+``}function bu(e,t){if(Ql(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Ql(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var xu=function(e){function t(e){var n;return cu(this,t),n=du(this,t,[e]),vu(n,`handleResize`,function(){n.containerRef.current.clientHeight<n.lastClientHeight&&n.scrollToEnd(n.props.scrollBehavior),n.scrollRef.current.updateScroll()}),vu(n,`handleContainerResize`,function(){n.resizeTicking===!1&&(window.requestAnimationFrame(function(){var e=n.containerRef.current;if(e){var t=e.clientHeight-n.lastClientHeight;t>=1?n.preventScrollTop===!1&&(e.scrollTop=Math.round(e.scrollTop)-t):e.scrollTop-=t,n.lastClientHeight=e.clientHeight,n.scrollRef.current.updateScroll()}n.resizeTicking=!1}),n.resizeTicking=!0)}),vu(n,`isSticked`,function(){var e=n.containerRef.current;return e.scrollHeight===Math.round(e.scrollTop+e.clientHeight)}),vu(n,`handleScroll`,function(){n.scrollTicking===!1&&(window.requestAnimationFrame(function(){n.noScroll===!1?n.preventScrollTop=n.isSticked():n.noScroll=!1,n.scrollTicking=!1}),n.scrollTicking=!0)}),vu(n,`getLastMessageOrGroup`,function(){var e=n.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`)}}),n.scrollPointRef=A.createRef(),n.containerRef=A.createRef(),n.scrollRef=A.createRef(),n.lastClientHeight=0,n.preventScrollTop=!1,n.resizeObserver=void 0,n.scrollTicking=!1,n.resizeTicking=!1,n.noScroll=void 0,n}return gu(t,e),uu(t,[{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,t=this.props,n=t.children,r=t.typingIndicator,i=t.loading,a=t.loadingMore,o=t.loadingMorePosition,s=t.onYReachStart,c=t.onYReachEnd,l=t.className,u=t.disableOnYReachWhenNoScroll;t.scrollBehavior,t.autoScrollToBottom,t.autoScrollToBottomOnMount;var d=ou(t,Zl),f=`cs-message-list`,p=eu(Ve(n,[Xl]),1)[0];return A.createElement(`div`,$l({},d,{className:(0,fe.default)(f,l)}),a&&A.createElement(`div`,{className:(0,fe.default)(`${f}__loading-more`,vu({},`${f}__loading-more--bottom`,o===`bottom`))},A.createElement(wc,null)),i&&A.createElement(Nc,null,A.createElement(wc,null)),A.createElement(hc,$l({onYReachStart:s,onYReachEnd:c,onSync:function(e){return e.update(u)},className:`${f}__scroll-wrapper`,ref:this.scrollRef,containerRef:function(t){return e.containerRef.current=t},options:{suppressScrollX:!0}},vu({},`data-cs-message-list`,``),{style:{overscrollBehaviorY:`none`,overflowAnchor:`auto`,touchAction:`none`}}),p||n,A.createElement(`div`,{className:`${f}__scroll-to`,ref:this.scrollPointRef})),r!==void 0&&A.createElement(`div`,{className:`${f}__typing-indicator-container`},r))}}])}(A.Component);xu.displayName=`MessageList`;function Su(e,t){var n=(0,A.useRef)(),r=function(e){return n.current.scrollToEnd(e)};return(0,A.useImperativeHandle)(t,function(){return{scrollToBottom:r}}),A.createElement(xu,$l({ref:n},e))}var Cu=(0,A.forwardRef)(Su);Cu.propTypes={children:Ue([ll,Bl,Gl,Xl]),typingIndicator:F.default.node,loading:F.default.bool,loadingMore:F.default.bool,loadingMorePosition:F.default.oneOf([`top`,`bottom`]),onYReachStart:F.default.func,onYReachEnd:F.default.func,disableOnYReachWhenNoScroll:F.default.bool,autoScrollToBottom:F.default.bool,autoScrollToBottomOnMount:F.default.bool,scrollBehavior:F.default.oneOf([`auto`,`smooth`]),className:F.default.string},Cu.defaultProps={typingIndicator:void 0,loading:!1,loadingMore:!1,loadingMorePosition:`top`,disableOnYReachWhenNoScroll:!1,autoScrollToBottom:!0,autoScrollToBottomOnMount:!0,scrollBehavior:`auto`},xu.defaultProps=Cu.defaultProps,Cu.Content=Xl;var wu=Cu;function Tu(e){"@babel/helpers - typeof";return Tu=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},Tu(e)}function Eu(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Du(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 Ou(e,t,n){return t&&Du(e.prototype,t),n&&Du(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ku(e,t,n){return t=Nu(t),Au(e,Mu()?Reflect.construct(t,n||[],Nu(e).constructor):t.apply(e,n))}function Au(e,t){if(t&&(Tu(t)==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return ju(e)}function ju(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Mu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Mu=function(){return!!e})()}function Nu(e){return Nu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Nu(e)}function Pu(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&&Fu(e,t)}function Fu(e,t){return Fu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fu(e,t)}function Iu(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=Ru(e,`string`);return Tu(t)==`symbol`?t:t+``}function Ru(e,t){if(Tu(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Tu(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var zu=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)}}},Bu=function(e){function t(e){var n;return Eu(this,t),n=ku(this,t,[e]),Iu(n,`innerHTML`,function(){var e=n.props.value;return{__html:e===void 0?``:e}}),Iu(n,`handleKeyPress`,function(e){var t=n.props.onKeyPress;t?.(e)}),Iu(n,`handleInput`,function(e){var t=n.props.onChange,r=e.target;t?.(r.innerHTML,r.textContent,r.innerText)}),n.msgRef=A.createRef(),n}return Pu(t,e),Ou(t,[{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:``),zu(e.current,r)}},{key:`render`,value:function(){var e=this.msgRef,t=this.handleInput,n=this.handleKeyPress,r=this.innerHTML,i=this.props,a=i.placeholder,o=i.disabled,s=i.className,c=typeof a==`string`?a:``;return A.createElement(`div`,{ref:e,className:s,contentEditable:o===!1,disabled:o,"data-placeholder":c,onInput:t,onKeyPress:n,dangerouslySetInnerHTML:r()})}}])}(A.Component);function Vu(e){"@babel/helpers - typeof";return Vu=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},Vu(e)}var Hu=[`fancyScroll`,`children`,`forwardedRef`],Uu=[`value`,`onSend`,`onChange`,`autoFocus`,`placeholder`,`fancyScroll`,`className`,`activateAfterChange`,`disabled`,`sendDisabled`,`sendOnReturnDisabled`,`attachDisabled`,`sendButton`,`attachButton`,`onAttachClick`];function Wu(e,t,n){return(t=rd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gu(e,t){return Xu(e)||Yu(e,t)||qu(e,t)||Ku()}function Ku(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
573
573
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qu(e,t){if(e){if(typeof e==`string`)return Ju(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)?Ju(e,t):void 0}}function Ju(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 Yu(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 Xu(e){if(Array.isArray(e))return e}function Zu(){return Zu=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},Zu.apply(null,arguments)}function Qu(e,t){if(e==null)return{};var n,r,i=$u(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 $u(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 ed(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function td(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,rd(r.key),r)}}function nd(e,t,n){return t&&td(e.prototype,t),n&&td(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function rd(e){var t=id(e,`string`);return Vu(t)==`symbol`?t:t+``}function id(e,t){if(Vu(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Vu(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ad(e,t,n){return t=ld(t),od(e,cd()?Reflect.construct(t,n||[],ld(e).constructor):t.apply(e,n))}function od(e,t){if(t&&(Vu(t)==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return sd(e)}function sd(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function cd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cd=function(){return!!e})()}function ld(e){return ld=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ld(e)}function ud(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&&dd(e,t)}function dd(e,t){return dd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dd(e,t)}function fd(){var e=function(e){function t(){return ed(this,t),ad(this,t,arguments)}return ud(t,e),nd(t,[{key:`render`,value:function(){var e=this.props,t=e.fancyScroll,n=e.children,r=e.forwardedRef,i=Qu(e,Hu);return A.createElement(A.Fragment,null,t===!0&&A.createElement(hc,Zu({ref:function(e){return r.current=e}},i,{options:{suppressScrollX:!0}}),n),t===!1&&A.createElement(`div`,Zu({ref:r},i),n))}}])}(A.Component);return A.forwardRef(function(t,n){return A.createElement(e,Zu({forwardedRef:n},t))})}var pd=fd(),md=function(e,t){var n=Gu((0,A.useState)(e===void 0?t:e),2),r=n[0],i=n[1];return[e===void 0?r:e,function(e){i(e)}]};function hd(e,t){var n=e.value,r=n===void 0?void 0:n,i=e.onSend,a=i===void 0?ze:i,o=e.onChange,s=o===void 0?ze:o,c=e.autoFocus,l=c!==void 0&&c,u=e.placeholder,d=u===void 0?``:u,f=e.fancyScroll,p=f===void 0||f,m=e.className,h=e.activateAfterChange,g=h!==void 0&&h,_=e.disabled,v=_!==void 0&&_,y=e.sendDisabled,b=e.sendOnReturnDisabled,x=b!==void 0&&b,S=e.attachDisabled,C=S!==void 0&&S,w=e.sendButton,T=w===void 0||w,E=e.attachButton,D=E===void 0||E,O=e.onAttachClick,k=O===void 0?ze:O,ee=Qu(e,Uu),j=(0,A.useRef)(),te=(0,A.useRef)(),M=Gu(md(r,``),2),ne=M[0],re=M[1],ie=Gu(md(y,!0),2),ae=ie[0],oe=ie[1],se=function(){te.current!==void 0&&te.current.focus()};(0,A.useImperativeHandle)(t,function(){return{focus:se}}),(0,A.useEffect)(function(){l===!0&&se()},[]),(0,A.useEffect)(function(){typeof j.current.updateScroll==`function`&&j.current.updateScroll()});var ce=function(){var e=te.current.msgRef.current;return[e.textContent,e.innerText,e.cloneNode(!0).childNodes]},le=function(){if(ne.length>0){r===void 0&&re(``),y===void 0&&oe(!0);var e=ce();a(ne,e[0],e[1],e[2])}},ue=function(e){e.key===`Enter`&&e.shiftKey===!1&&x===!1&&(e.preventDefault(),le())},de=function(e,t,n){re(e),y===void 0&&oe(t.length===0),typeof j.current.updateScroll==`function`&&j.current.updateScroll(),s(e,t,n,ce()[2])},pe=`cs-message-input`,me=typeof d==`string`?d:``;return A.createElement(`div`,Zu({},ee,{className:(0,fe.default)(pe,Wu({},`${pe}--disabled`,v),m)}),D===!0&&A.createElement(`div`,{className:`${pe}__tools`},A.createElement(Uo,{onClick:k,disabled:v===!0||C===!0})),A.createElement(`div`,{className:`${pe}__content-editor-wrapper`},A.createElement(pd,{fancyScroll:p,ref:j,className:`${pe}__content-editor-container`},A.createElement(Bu,{ref:te,className:`${pe}__content-editor`,disabled:v,placeholder:me,onKeyPress:ue,onChange:de,activateAfterChange:g,value:ne}))),T===!0&&A.createElement(`div`,{className:`${pe}__tools`},A.createElement(Lo,{onClick:le,disabled:v===!0||ae===!0})))}var gd=(0,A.forwardRef)(hd);gd.displayName=`MessageInput`,gd.propTypes={value:F.default.string,placeholder:F.default.string,disabled:F.default.bool,sendOnReturnDisabled:F.default.bool,sendDisabled:F.default.bool,fancyScroll:F.default.bool,activateAfterChange:F.default.bool,autoFocus:F.default.bool,onChange:F.default.func,onSend:F.default.func,className:F.default.string,sendButton:F.default.bool,attachButton:F.default.bool,attachDisabled:F.default.bool,onAttachClick:F.default.func};var _d=gd,vd=[`className`,`children`];function yd(){return yd=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},yd.apply(null,arguments)}function bd(e,t){if(e==null)return{};var n,r,i=xd(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 xd(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 Sd=function(e){var t=e.className,n=e.children,r=bd(e,vd);return A.createElement(`div`,yd({},r,{className:(0,fe.default)(`cs-input-toolbox`,t)}),n)};Sd.displayName=`InputToolbox`;var Cd=Sd,wd=[`children`,`className`];function Td(){return Td=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},Td.apply(null,arguments)}function Ed(e,t){return jd(e)||Ad(e,t)||Od(e,t)||Dd()}function Dd(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
574
574
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Od(e,t){if(e){if(typeof e==`string`)return kd(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)?kd(e,t):void 0}}function kd(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 Ad(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 jd(e){if(Array.isArray(e))return e}function Md(e,t){if(e==null)return{};var n,r,i=Nd(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 Nd(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 t=e.children,n=t===void 0?void 0:t,r=e.className,i=Md(e,wd),a=`cs-chat-container`,o=Ed(Ve(n,[gs,wu,_d,Cd]),4),s=o[0],c=o[1],l=o[2],u=o[3];return A.createElement(`div`,Td({},i,{className:(0,fe.default)(a,r)}),s,c,l,u)};jo();var Fd=s((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})),Id=s((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}));Fd(),Id();function Ld(e){"@babel/helpers - typeof";return Ld=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},Ld(e)}var Rd=[`responsive`,`children`,`className`];function zd(){return zd=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},zd.apply(null,arguments)}function Bd(e,t,n){return(t=Vd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vd(e){var t=Hd(e,`string`);return Ld(t)==`symbol`?t:t+``}function Hd(e,t){if(Ld(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Ld(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ud(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 Gd=function(e){var t=e.responsive,n=t!==void 0&&t,r=e.children,i=r===void 0?void 0:r,a=e.className,o=Ud(e,Rd),s=`cs-main-container`;return A.createElement(`div`,zd({},o,{className:(0,fe.default)(s,Bd({},`${s}--responsive`,n),a)}),i)},Kd={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`]},qd={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 Jd(e){"@babel/helpers - typeof";return Jd=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},Jd(e)}var Yd=[`placeholder`,`value`,`onChange`,`onClearClick`,`className`,`disabled`];function Xd(){return Xd=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},Xd.apply(null,arguments)}function Zd(e,t,n){return(t=Qd(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qd(e){var t=$d(e,`string`);return Jd(t)==`symbol`?t:t+``}function $d(e,t){if(Jd(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Jd(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ef(e,t){return of(e)||af(e,t)||nf(e,t)||tf()}function tf(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
575
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nf(e,t){if(e){if(typeof e==`string`)return rf(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)?rf(e,t):void 0}}function rf(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 af(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 of(e){if(Array.isArray(e))return e}function sf(e,t){if(e==null)return{};var n,r,i=cf(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 cf(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 lf=function(e,t){return t===void 0?(0,A.useState)(e):[t,function(){}]};function uf(e,t){var n=e.placeholder,r=n===void 0?``:n,i=e.value,a=i===void 0?void 0:i,o=e.onChange,s=o===void 0?function(){}:o,c=e.onClearClick,l=c===void 0?function(){}:c,u=e.className,d=e.disabled,f=d!==void 0&&d,p=sf(e,Yd),m=`cs-search`,h=(0,A.useMemo)(function(){return a!==void 0},[]),g=ef(lf(``,a),2),_=g[0],v=g[1],y=ef((0,A.useState)(h?_.length>0:!1),2),b=y[0],x=y[1];if(h!==(a!==void 0))throw`Search: Changing from controlled to uncontrolled component and vice versa is not allowed`;var S=(0,A.useRef)(void 0),C=function(){S.current!==void 0&&S.current.focus()};return(0,A.useImperativeHandle)(t,function(){return{focus:C}}),A.createElement(`div`,Xd({},p,{className:(0,fe.default)(m,Zd({},`${m}--disabled`,f),u)}),A.createElement(ho,{icon:Kd,className:`${m}__search-icon`}),A.createElement(`input`,{ref:S,type:`text`,className:`${m}__input`,placeholder:r,onChange:function(e){var t=e.target.value;x(t.length>0),h===!1&&v(t),s(t)},disabled:f,value:_}),A.createElement(ho,{icon:qd,className:(0,fe.default)(`${m}__clear-icon`,Zd({},`${m}__clear-icon--active`,b)),onClick:function(){h===!1&&v(``),x(!1),l()}}))}var df=(0,A.forwardRef)(uf);df.displayName=`Search`,df.propTypes={placeholder:F.default.string,value:F.default.string,onChange:F.default.func,onClearClick:F.default.func,className:F.default.string,disabled:F.default.bool};var ff=xe,pf=[`content`,`className`];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){if(e==null)return{};var n,r,i=gf(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 gf(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 _f=function(e){var t=e.content,n=t===void 0?``:t,r=e.className,i=hf(e,pf),a=`cs-typing-indicator`;return A.createElement(`div`,mf({},i,{className:(0,fe.default)(a,r)}),A.createElement(`div`,{className:`${a}__indicator`},A.createElement(`div`,{className:`${a}__dot`}),A.createElement(`div`,{className:`${a}__dot`}),A.createElement(`div`,{className:`${a}__dot`})),A.createElement(`div`,{className:`${a}__text`},n))};function vf(e){"@babel/helpers - typeof";return vf=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},vf(e)}var yf=[`className`,`children`,`size`,`selected`,`onChange`,`itemsTabIndex`];function bf(){return bf=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},bf.apply(null,arguments)}function xf(e,t,n){return(t=Sf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sf(e){var t=Cf(e,`string`);return vf(t)==`symbol`?t:t+``}function Cf(e,t){if(vf(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(vf(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function wf(e,t){if(e==null)return{};var n,r,i=Tf(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 Tf(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 Ef(e,t){var n=e.className,r=e.children,i=e.size,a=e.selected,o=e.onChange,s=o===void 0?ze:o,c=e.itemsTabIndex,l=wf(e,yf),u=`cs-status-list`,d=(0,A.useRef)();(0,A.useImperativeHandle)(t,function(){return{focus:function(e){var t=Array.from(d.current.querySelectorAll(`li`)).filter(function(e){return e.parentNode===d.current});t[e]!==void 0&&t[e].focus()}}});var f=c;return A.createElement(`ul`,bf({ref:d},l,{className:(0,fe.default)(u,n,xf({},`${u}--${i}`,i))}),A.Children.map(r,function(e){var t={};a&&(t.selected=e.props.status===a),s&&(t.onClick=function(t){s(e.props.status),e.onClick&&e.onClick(t)});var n=function(t){s&&t.key===`Enter`&&t.shiftKey===!1&&t.altKey===!1&&s(e.props.status)},r=function(){if(typeof f==`number`)return f>0?f++:f}();return A.createElement(`li`,{tabIndex:r,onKeyPress:n},A.cloneElement(e,t))}))}var Df=(0,A.forwardRef)(Ef);Df.displayName=`StatusList`,Df.propTypes={children:Ue([ff]),selected:F.default.oneOf(pe),size:F.default.oneOf(me),itemsTabIndex:F.default.number,className:F.default.string,onChange:F.default.func};function Of(e,t){let n=(t||``).trim().split(`:`)[0].replace(/^\./,``);return!n||n===`None`||e===n||e.endsWith(`.${n}`)}function kf(e,t=null){if(e.value!==null&&e.value!==void 0&&e.value!==``)return e.value;if(!Of(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 Af(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 jf(e,t,n,r=null,i=null){return{name:e,expiration:t,domain:n??``,value:r,path:i}}var Mf={INCOMING:`incoming`,OUTGOING:`outgoing`},Nf={SYSTEM:`system`,ASSISTANT:`assistant`,USER:`user`,TOOL:`tool`,SMARTER:`smarter`,SMARTER_ERROR:`smarter_error`},Pf=[Nf.SYSTEM,Nf.ASSISTANT,Nf.USER,Nf.TOOL],Ff=[Nf.SMARTER,Nf.SYSTEM,Nf.TOOL],If={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:`}}},Lf=s((e=>{var t=Symbol.for(`react.transitional.element`);function n(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.jsx=n,e.jsxs=n})),R=s(((e,t)=>{t.exports=Lf()}))(),Rf=e=>e.trim().toLowerCase().replaceAll(`_`,`-`),zf=Object.fromEntries(Object.entries(If).map(([e,t])=>[Rf(e),t])),Bf=[`en`,...Object.keys(zf)],Vf=/%\(([A-Za-z_][A-Za-z0-9_]*)\)s/g,Hf=``,Uf=null;function Wf(e){let t=e?Rf(e):``;if(!t)return null;if(Bf.includes(t))return t;let n=t.split(`-`)[0];return Bf.includes(n)?n:Bf.find(e=>e.split(`-`)[0]===n)??null}function Gf(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=Wf(e);if(t)return t}return`en`}function Kf(e){return Uf=Gf(e),Uf}function qf(){return Uf??=Gf(),Uf}var Jf=()=>zf[qf()];function Yf(e){let t=Jf()?.messages[e];return t===``?void 0:t}function Xf(e,t,n,r){let i=Yf(e),a=Jf();return Array.isArray(i)&&a&&i[a.plural(r)]||(r===1?t:n)}function Zf(e){let t=Yf(e);return typeof t==`string`?t:e}function Qf(e,t,n){return Xf(e,e,t,n)}function $f(e,t){let n=Yf(`${e}${Hf}${t}`);return typeof n==`string`?n:t}function ep(e,t){return e.replace(Vf,(e,n)=>{let r=t[n];return r==null?e:String(r)})}var tp=`application/json`,np=`text/event-stream`,rp=`chat-contract-v2`,ip=class extends Error{status;constructor(e,t){super(e),this.name=`SmarterApiError`,this.status=t}};function ap(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 op(e,t){let n={Accept:tp,"Content-Type":tp,"X-CSRFToken":kf(e.csrfCookie,``)??``,"X-Smarter-Client":t.smarterClient,"X-Smarter-ClientVersion":t.smarterClientVersion,"X-Smarter-ClientType":`react`,"X-Smarter-Capabilities":rp};return t.smarterRequestId&&(n[`X-Smarter-RequestId`]=t.smarterRequestId),t.apiKey&&(n.Authorization=`Token ${t.apiKey}`),n}function sp(e,t){return{method:`POST`,credentials:`include`,mode:`cors`,headers:e,body:JSON.stringify(t)}}async function cp(e){if(!(e.headers.get(`content-type`)??``).includes(tp)){let t=await e.text();throw new ip(ep(Zf(`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 lp(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 ep(Zf(`The Smarter api returned http %(status)s %(statusText)s`),{status:t.status,statusText:t.statusText}).trim()}function up(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.contract===2)return t.llmclient?.url_llmclient?fp(t):null;let n=t.chatbot;return!n||typeof n.url_chatbot!=`string`?null:fp(dp(t))}function dp(e){return Array.isArray(e)?e.map(dp):!e||typeof e!=`object`?e:Object.fromEntries(Object.entries(e).map(([e,t])=>[e.replaceAll(`chatbot`,`llmclient`).replaceAll(`accountNumber`,`account_number`),dp(t)]))}function fp(e){let t={...e};return Object.defineProperty(t,"chatbot",{get(){return this.llmclient},enumerable:!1}),t}var pp=`verbose`;async function mp(e,t,n,r=!1){let i=kf(t.sessionCookie,``),a=sp(op(t,n),{session_key:i}),o=new URL(ap(e,`config/`,i));r&&o.searchParams.append(pp,`true`);let s=await fetch(o.toString(),a),c=await cp(s);if(!s.ok)throw new ip(lp(c,s),s.status);let l=up(c.data);if(!l)throw new ip(Zf(`The Smarter api returned an incomplete configuration.`),s.status);return Af(t.sessionCookie,l.session_key),Af(t.debugCookie,l.debug_mode),l}function hp(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 gp(e){let t=e?.smarter;return Array.isArray(t?.messages)?t.messages:[]}async function _p(e,t){let n=e.getReader(),r=new TextDecoder,i=``,a=e=>{let n=`message`,r=[];for(let t of e.split(`
575
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nf(e,t){if(e){if(typeof e==`string`)return rf(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)?rf(e,t):void 0}}function rf(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 af(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 of(e){if(Array.isArray(e))return e}function sf(e,t){if(e==null)return{};var n,r,i=cf(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 cf(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 lf=function(e,t){return t===void 0?(0,A.useState)(e):[t,function(){}]};function uf(e,t){var n=e.placeholder,r=n===void 0?``:n,i=e.value,a=i===void 0?void 0:i,o=e.onChange,s=o===void 0?function(){}:o,c=e.onClearClick,l=c===void 0?function(){}:c,u=e.className,d=e.disabled,f=d!==void 0&&d,p=sf(e,Yd),m=`cs-search`,h=(0,A.useMemo)(function(){return a!==void 0},[]),g=ef(lf(``,a),2),_=g[0],v=g[1],y=ef((0,A.useState)(h?_.length>0:!1),2),b=y[0],x=y[1];if(h!==(a!==void 0))throw`Search: Changing from controlled to uncontrolled component and vice versa is not allowed`;var S=(0,A.useRef)(void 0),C=function(){S.current!==void 0&&S.current.focus()};return(0,A.useImperativeHandle)(t,function(){return{focus:C}}),A.createElement(`div`,Xd({},p,{className:(0,fe.default)(m,Zd({},`${m}--disabled`,f),u)}),A.createElement(ho,{icon:Kd,className:`${m}__search-icon`}),A.createElement(`input`,{ref:S,type:`text`,className:`${m}__input`,placeholder:r,onChange:function(e){var t=e.target.value;x(t.length>0),h===!1&&v(t),s(t)},disabled:f,value:_}),A.createElement(ho,{icon:qd,className:(0,fe.default)(`${m}__clear-icon`,Zd({},`${m}__clear-icon--active`,b)),onClick:function(){h===!1&&v(``),x(!1),l()}}))}var df=(0,A.forwardRef)(uf);df.displayName=`Search`,df.propTypes={placeholder:F.default.string,value:F.default.string,onChange:F.default.func,onClearClick:F.default.func,className:F.default.string,disabled:F.default.bool};var ff=xe,pf=[`content`,`className`];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){if(e==null)return{};var n,r,i=gf(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 gf(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 _f=function(e){var t=e.content,n=t===void 0?``:t,r=e.className,i=hf(e,pf),a=`cs-typing-indicator`;return A.createElement(`div`,mf({},i,{className:(0,fe.default)(a,r)}),A.createElement(`div`,{className:`${a}__indicator`},A.createElement(`div`,{className:`${a}__dot`}),A.createElement(`div`,{className:`${a}__dot`}),A.createElement(`div`,{className:`${a}__dot`})),A.createElement(`div`,{className:`${a}__text`},n))};function vf(e){"@babel/helpers - typeof";return vf=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},vf(e)}var yf=[`className`,`children`,`size`,`selected`,`onChange`,`itemsTabIndex`];function bf(){return bf=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},bf.apply(null,arguments)}function xf(e,t,n){return(t=Sf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sf(e){var t=Cf(e,`string`);return vf(t)==`symbol`?t:t+``}function Cf(e,t){if(vf(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(vf(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function wf(e,t){if(e==null)return{};var n,r,i=Tf(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 Tf(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 Ef(e,t){var n=e.className,r=e.children,i=e.size,a=e.selected,o=e.onChange,s=o===void 0?ze:o,c=e.itemsTabIndex,l=wf(e,yf),u=`cs-status-list`,d=(0,A.useRef)();(0,A.useImperativeHandle)(t,function(){return{focus:function(e){var t=Array.from(d.current.querySelectorAll(`li`)).filter(function(e){return e.parentNode===d.current});t[e]!==void 0&&t[e].focus()}}});var f=c;return A.createElement(`ul`,bf({ref:d},l,{className:(0,fe.default)(u,n,xf({},`${u}--${i}`,i))}),A.Children.map(r,function(e){var t={};a&&(t.selected=e.props.status===a),s&&(t.onClick=function(t){s(e.props.status),e.onClick&&e.onClick(t)});var n=function(t){s&&t.key===`Enter`&&t.shiftKey===!1&&t.altKey===!1&&s(e.props.status)},r=function(){if(typeof f==`number`)return f>0?f++:f}();return A.createElement(`li`,{tabIndex:r,onKeyPress:n},A.cloneElement(e,t))}))}var Df=(0,A.forwardRef)(Ef);Df.displayName=`StatusList`,Df.propTypes={children:Ue([ff]),selected:F.default.oneOf(pe),size:F.default.oneOf(me),itemsTabIndex:F.default.number,className:F.default.string,onChange:F.default.func};function Of(e,t){let n=(t||``).trim().split(`:`)[0].replace(/^\./,``);return!n||n===`None`||e===n||e.endsWith(`.${n}`)}function kf(e,t=null){if(e.value!==null&&e.value!==void 0&&e.value!==``)return e.value;if(!Of(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 Af(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 jf(e,t,n,r=null,i=null){return{name:e,expiration:t,domain:n??``,value:r,path:i}}var Mf={INCOMING:`incoming`,OUTGOING:`outgoing`},Nf={SYSTEM:`system`,ASSISTANT:`assistant`,USER:`user`,TOOL:`tool`,SMARTER:`smarter`,SMARTER_ERROR:`smarter_error`},Pf=[Nf.SYSTEM,Nf.ASSISTANT,Nf.USER,Nf.TOOL],Ff=[Nf.SMARTER,Nf.SYSTEM,Nf.TOOL],If={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:`}}},Lf=s((e=>{var t=Symbol.for(`react.transitional.element`);function n(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.jsx=n,e.jsxs=n})),R=s(((e,t)=>{t.exports=Lf()}))(),Rf=e=>e.trim().toLowerCase().replaceAll(`_`,`-`),zf=Object.fromEntries(Object.entries(If).map(([e,t])=>[Rf(e),t])),Bf=[`en`,...Object.keys(zf)],Vf=/%\(([A-Za-z_][A-Za-z0-9_]*)\)s/g,Hf=``,Uf=null;function Wf(e){let t=e?Rf(e):``;if(!t)return null;if(Bf.includes(t))return t;let n=t.split(`-`)[0];return Bf.includes(n)?n:Bf.find(e=>e.split(`-`)[0]===n)??null}function Gf(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=Wf(e);if(t)return t}return`en`}function Kf(e){return Uf=Gf(e),Uf}function qf(){return Uf??=Gf(),Uf}var Jf=()=>zf[qf()];function Yf(e){let t=Jf()?.messages[e];return t===``?void 0:t}function Xf(e,t,n,r){let i=Yf(e),a=Jf();return Array.isArray(i)&&a&&i[a.plural(r)]||(r===1?t:n)}function Zf(e){let t=Yf(e);return typeof t==`string`?t:e}function Qf(e,t,n){return Xf(e,e,t,n)}function $f(e,t){let n=Yf(`${e}${Hf}${t}`);return typeof n==`string`?n:t}function ep(e,t){return e.replace(Vf,(e,n)=>{let r=t[n];return r==null?e:String(r)})}var tp=`application/json`,np=`text/event-stream`,rp=`chat-contract-v2`,ip=class extends Error{status;constructor(e,t){super(e),this.name=`SmarterApiError`,this.status=t}};function ap(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 op(e,t){let n={Accept:tp,"Content-Type":tp,"X-CSRFToken":kf(e.csrfCookie,``)??``,"X-Smarter-Client":t.smarterClient,"X-Smarter-ClientVersion":t.smarterClientVersion,"X-Smarter-ClientType":`react`,"X-Smarter-Capabilities":rp};return t.smarterRequestId&&(n[`X-Smarter-RequestId`]=t.smarterRequestId),t.apiKey&&(n.Authorization=`Token ${t.apiKey}`),n}function sp(e,t){return{method:`POST`,credentials:`include`,mode:`cors`,headers:e,body:JSON.stringify(t)}}async function cp(e){if(!(e.headers.get(`content-type`)??``).includes(tp)){let t=await e.text();throw new ip(ep(Zf(`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 lp(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 ep(Zf(`The Smarter api returned http %(status)s %(statusText)s`),{status:t.status,statusText:t.statusText}).trim()}function up(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.contract===2)return t.llmclient?.url_llmclient?fp(t):null;let n=t.chatbot;return!n||typeof n.url_chatbot!=`string`?null:fp(dp(t))}function dp(e){return Array.isArray(e)?e.map(dp):!e||typeof e!=`object`?e:Object.fromEntries(Object.entries(e).map(([e,t])=>[e.replaceAll(`chatbot`,`llmclient`).replaceAll(`accountNumber`,`account_number`),dp(t)]))}function fp(e){let t={...e};return Object.defineProperty(t,"chatbot",{get(){return this.llmclient},enumerable:!1}),t}var pp=`verbose`;async function mp(e,t,n,r=!1){let i=kf(t.sessionCookie,``),a=sp(op(t,n),{session_key:i}),o=new URL(ap(e,`config/`,i));r&&o.searchParams.append(pp,`true`);let s=await fetch(o.toString(),a),c=await cp(s);if(!s.ok)throw new ip(lp(c,s),s.status);let l=up(c.data);if(!l)throw new ip(Zf(`The Smarter api returned an incomplete configuration.`),s.status);return Af(t.sessionCookie,l.session_key),Af(t.debugCookie,l.debug_mode),l}function hp(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 gp(e){let t=e?.smarter;return Array.isArray(t?.messages)?t.messages:[]}async function _p(e,t){let n=e.getReader(),r=new TextDecoder,i=``,a=e=>{let n=`message`,r=[];for(let t of e.split(`
576
576
  `))t.startsWith(`event:`)?n=t.slice(6).trim():t.startsWith(`data:`)&&r.push(t.slice(5).replace(/^ /,``));r.length>0&&t(n,r.join(`
577
577
  `))};for(;;){let{done:e,value:t}=await n.read();i+=r.decode(t,{stream:!e}).replace(/\r\n?/g,`
578
578
  `);let o=i.indexOf(`
@@ -887,7 +887,7 @@ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
887
887
  ?)[ \r ]*`,FC=`[̀-ͯ]`,IC=RegExp(FC+`+$`),LC=`(`+AC+`+)|`+(PC+`|`)+`([!-\\[\\]-‧‪-퟿豈-￿]`+(FC+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(FC+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+NC)+(`|`+MC+`)`),RC=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(LC,`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 RS(`EOF`,new LS(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new z(`Unexpected character: '`+e[t]+`'`,new RS(e[t],new LS(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
888
888
  `,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 RS(r,new LS(this,t,this.tokenRegex.lastIndex))}},zC=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 z(`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}},BC=IS;$(`\\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 VC={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 z("\\char` missing argument");else r=t.text.charCodeAt(0)}else n=10;if(n){if(r=VC[t.text],r==null||r>=n)throw new z(`Invalid base-`+n+` digit `+t.text);for(var i;(i=VC[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var HC=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new z(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new z(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new z(`\\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 z(`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=>HC(e,!1,!0,!1)),$(`\\renewcommand`,e=>HC(e,!0,!1,!1)),$(`\\providecommand`,e=>HC(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),kC[n],Sy.math[n],Sy.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 UC={",":`\\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`},WC=new Set([`bin`,`rel`]);$(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in UC?t=UC[n]:(n.slice(0,4)===`\\not`||n in Sy.math&&WC.has(Sy.math[n].group))&&(t=`\\dotsb`),t});var GC={")":!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 GC?`\\ldots\\,`:`\\ldots`}),$(`\\dotsc`,function(e){var t=e.future().text;return t in GC&&t!==`,`?`\\ldots\\,`:`\\ldots`}),$(`\\cdots`,function(e){return e.future().text in GC?`\\@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 z(`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 KC=B(hy[`Main-Regular`][84][1]-.7*hy[`Main-Regular`][65][1]);$(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+KC+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),$(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+KC+`}{\\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 qC=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`,qC(!1)),$(`\\bra@set`,qC(!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 JC={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},YC=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 zC(BC,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new RC(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 RS(`EOF`,n.loc)),this.pushTokens(r),new RS(``,LS.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 z(`Extra }`,i)}else if(i.text===`EOF`)throw new z(`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 z(`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 z(`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 z(`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 z(`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 z(`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 z(`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 RS(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 RC(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(kC,e)||Object.prototype.hasOwnProperty.call(Sy.math,e)||Object.prototype.hasOwnProperty.call(Sy.text,e)||Object.prototype.hasOwnProperty.call(JC,e)}isExpandable(e){var t=this.macros.get(e);return t==null?Object.prototype.hasOwnProperty.call(kC,e)&&!kC[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},XC=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,ZC=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`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),QC={"́":{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`}},$C={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},ew=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 YC(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 z(`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 RS(`}`)),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&&kC[i.text]&&kC[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 z(`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 z(`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 z(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new z(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new z(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new z(`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(ZC[i.text]){var s=XC.test(i.text),c=[];for(c.push(new RS(ZC[i.text])),this.consume();;){var l=this.fetch().text;if(!ZC[l]||XC.test(l)!==s)break;c.unshift(new RS(ZC[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=kC[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new z(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new z(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new z(`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=kC[e];if(o&&o.handler)return o.handler(a,t,n);throw new z(`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 z(`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 z(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new z(`Expected group as `+e,this.fetch());return a;case`original`:case void 0:return this.parseArgumentGroup(n);default:throw new z(`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 z(`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 z(`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 z(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!Xv(i))throw new z(`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:LS.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(JC,r)){if(this.settings.throwOnError)throw new z(`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:LS.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:LS.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:LS.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 z(`\\verb assertion failed --
889
889
  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($C,t[0])&&!Sy[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=$C[t[0]]+t.slice(1));var i=IC.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(Sy[this.mode][t]){this.settings.strict&&this.mode===`math`&&Gy.includes(t)&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,e);var o=Sy[this.mode][t].group,s=LS.range(e);a=jx(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&&(Mv(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:LS.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(!QC[l])throw new z(`Unknown accent ' `+l+`'`,e);var u=QC[l][this.mode]||QC[l].text;if(!u)throw new z(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:LS.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};ew.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var tw=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new ew(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 z(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new RS(`\\df@tag`)])}]}return r},nw=function(e,t,n){t.textContent=``;var r=ow(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.`),nw=function(){throw new z(`KaTeX doesn't work in quirks mode.`)});var rw=function(e,t){return ow(e,t).toMarkup()},iw=function(e,t){return tw(e,new dv(t))},aw=function(e,t,n){if(n.throwOnError||!(e instanceof z))throw e;var r=X([`katex-error`],[new cy(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},ow=function(e,t){var n=new dv(t);try{return yx(tw(e,n),e,n)}catch(t){return aw(t,e,n)}},sw={version:`0.18.7`,render:nw,renderToString:rw,ParseError:z,SETTINGS_SCHEMA:sv,__parse:iw,__renderToDomTree:ow,__renderToHTMLTree:function(e,t){var n=new dv(t);try{return bx(tw(e,n),e,n)}catch(t){return aw(t,e,n)}},__setFontMetrics:vy,__defineSymbol:V,__defineFunction:Z,__defineMacro:$,__domTree:{Span:iy,Anchor:ay,SymbolNode:cy,SvgNode:ly,PathNode:uy,LineNode:dy}};re(`@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_AMS-Regular.woff2) format("woff2")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_Fraktur-Bold.woff2) format("woff2")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_Fraktur-Regular.woff2) format("woff2")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_Main-Bold.woff2) format("woff2")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_Main-BoldItalic.woff2) format("woff2")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_Main-Italic.woff2) format("woff2")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_Main-Regular.woff2) format("woff2")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_Math-BoldItalic.woff2) format("woff2")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_Math-Italic.woff2) format("woff2")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_SansSerif-Bold.woff2) format("woff2")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_SansSerif-Italic.woff2) format("woff2")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_SansSerif-Regular.woff2) format("woff2")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_Script-Regular.woff2) format("woff2")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_Size1-Regular.woff2) format("woff2")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_Size2-Regular.woff2) format("woff2")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_Size3-Regular.woff2) format("woff2")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_Size4-Regular.woff2) format("woff2")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(__SMARTER_CHAT_ASSETS__/katex/fonts/KaTeX_Typewriter-Regular.woff2) format("woff2")}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;position:relative;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.18.7"}.katex .katex-mathml{border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.katex-newline{display:block}.katex .katex-base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .katex-base,.katex .katex-strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .katex-vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .katex-thinbox{display:inline-flex;flex-direction:row;max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .katex-hdashline,.katex .katex-hline,.katex .katex-overline .overline-line,.katex .katex-rule,.katex .katex-underline .underline-line,.katex .mfrac .frac-line{min-height:1px}.katex .mspace{display:inline-block}.katex .katex-smash{display:inline;line-height:0}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.katex-inner,.katex .llap>.katex-inner,.katex .rlap>.katex-inner{position:absolute}.katex .clap>.katex-fix,.katex .llap>.katex-fix,.katex .rlap>.katex-fix{display:inline-block}.katex .llap>.katex-inner{right:0}.katex .clap>.katex-inner,.katex .rlap>.katex-inner{left:0}.katex .clap>.katex-inner>span{margin-left:-50%;margin-right:50%}.katex .katex-rule{border:0 solid;display:inline-block;position:relative}.katex .katex-hline,.katex .katex-overline .overline-line,.katex .katex-underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .katex-hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.katex-root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .katex-sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .katex-sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .katex-sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .katex-sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .katex-sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .katex-sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .katex-sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .katex-sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .katex-sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .katex-sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .katex-sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .katex-sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .katex-sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .katex-sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .katex-sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .katex-sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .katex-sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .katex-sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .katex-sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .katex-sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .katex-sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .katex-sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .katex-sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .katex-sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .katex-sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .katex-sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .katex-sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .katex-sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .katex-sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .katex-sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .katex-sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .katex-sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .katex-sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .katex-sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .katex-sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .katex-sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .katex-sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .katex-sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .katex-sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .katex-sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .katex-sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .katex-sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .katex-sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .katex-sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .katex-sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .katex-sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .katex-sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .katex-sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .katex-sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .katex-sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .katex-sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .katex-sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .katex-sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .katex-sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .katex-sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .katex-sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .katex-sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .katex-sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .katex-sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .katex-sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .katex-sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .katex-sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .katex-sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .katex-sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .katex-sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .katex-sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .katex-sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .katex-sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .katex-sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .katex-sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .katex-sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .katex-sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .katex-sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .katex-sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .katex-sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .katex-sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .katex-sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .katex-sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .katex-sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .katex-sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .katex-sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .katex-sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .katex-sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .katex-sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .katex-sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .katex-sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .katex-sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .katex-sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .katex-sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .katex-sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .katex-sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .katex-sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .katex-sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .katex-sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .katex-sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .katex-sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .katex-sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .katex-sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .katex-sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .katex-sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .katex-sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .katex-sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .katex-sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .katex-sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .katex-sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .katex-sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .katex-sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .katex-sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .katex-sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .katex-sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .katex-sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .katex-sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .katex-sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .katex-sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .katex-sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .katex-sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .katex-sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .katex-sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .katex-sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .katex-sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .katex-sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .katex-accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .katex-accent .accent-body{position:relative}.katex .katex-accent .accent-body:not(.accent-full){width:0}.katex .katex-overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .katex-stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .katex-stretchy:after,.katex .katex-stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .katex-sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .reflectbox{display:inline-block;transform:scaleX(-1)}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.katex-tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.katex-tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}
890
- `),re(`div.cs-message__html-content .katex-display{max-width:100%;margin:.4em 0 .6em;padding:.2em 0;overflow:auto hidden}div.cs-message__html-content .katex-display:last-child{margin-bottom:0}div.cs-message__html-content .katex-error{font-family:JetBrains Mono,SFMono-Regular,Menlo,Consolas,monospace;font-size:.9em}`);var cw=/^ {0,3}(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])[ \t]*(?:\n+|$)/,lw=/^ {0,3}(?:\$\$|\\\[)/m,uw=/^(?:\\\(([\s\S]+?)\\\)|\\\[([\s\S]+?)\\\]|\$\$([\s\S]+?)\$\$)/,dw=/\\\(|\\\[|\$\$/;function fw(e,t){return sw.renderToString(e.trim().replace(/(?<!\\)\$/g,`\\$`),{displayMode:t,throwOnError:!1,strict:`ignore`,trust:!1})}function pw(e,t,n,r){return{type:e,raw:t,text:n,displayMode:r}}var mw={tokenizer:{lheading(e){let t=/^(?:[^\n]+\n)+?(?: {0,3}(?:=+|-+) *(?:\n+|$))/.exec(e)?.[0]??``;return lw.test(t)?void 0:!1}},extensions:[{name:`blockMath`,level:`block`,start:e=>e.match(lw)?.index,tokenizer(e){let t=cw.exec(e);if(t)return pw(`blockMath`,t[0],t[1]??t[2],!0)},renderer:e=>`${fw(e.text,!0)}\n`},{name:`inlineMath`,level:`inline`,start:e=>e.match(dw)?.index,tokenizer(e){let t=uw.exec(e);if(!t)return;let[n,r,i,a]=t;return pw(`inlineMath`,n,r??i??a,r===void 0)},renderer:e=>fw(e.text,e.displayMode)}]},hw={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function gw(e){return e.replace(/[&<>"']/g,e=>hw[e])}var _w=String.raw`(?:https?:\/\/|\/)[^\s)"]+`,vw=String.raw`(?:${_w}|data:image\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/=]+)`,yw=String.raw`!\[([^\]]*)\]\((${vw})\)`,bw=new RegExp(String.raw`^${_w}$`),xw=new RegExp(String.raw`^${vw}$`),Sw=new RegExp(String.raw`\[${yw}\]\((${_w})\)`,`g`),Cw=new RegExp(yw,`g`),ww=new RegExp(String.raw`\[([^\]]+)\]\((${_w})\)`,`g`);function Tw(e,t){return`<a href="${e}" target="_blank" rel="noopener noreferrer">${t}</a>`}function Ew(e,t){return`<img class="smarter-chat-image" src="${e}" alt="${t}" loading="lazy">`}function Dw(e){return gw(e).replace(Sw,(e,t,n,r)=>Tw(r,Ew(n,t))).replace(Cw,(e,t,n)=>Ow(n,t)).replace(ww,(e,t,n)=>Tw(n,t))}function Ow(e,t){return e.startsWith(`data:`)?Ew(e,t):Tw(e,Ew(e,t))}var kw=new Y_({gfm:!0,breaks:!0,async:!1});kw.use(mw),kw.use({renderer:{html({text:e}){return gw(e)},link({href:e,tokens:t}){let[n]=t;if(t.length===1&&n.type===`image`){let{href:t,text:r}=n;if(bw.test(e)&&xw.test(t))return Tw(gw(e),Ew(gw(t),r))}let r=this.parser.parseInline(t);return bw.test(e)?Tw(gw(e),r):r},image({href:e,text:t}){return xw.test(e)?Ow(gw(e),t):t},code({text:e,lang:t}){return Sm(e,t)}}});function Aw(e){return rg.sanitize(e,{ADD_TAGS:[`semantics`,`annotation`],ADD_ATTR:[`target`,`encoding`]})}function jw(e){let t=kw.parse(e).trim(),n=/^<p>([\s\S]*)<\/p>$/.exec(t);return Aw(n&&!n[1].includes(`<p>`)?n[1]:t)}function Mw(e){return e===Nf.USER?Mf.OUTGOING:Mf.INCOMING}function Nw(e,t){return t===Nf.USER?Dw(e):jw(e)}function Pw(e,t,n,r=Mw(t)){let i=typeof e==`string`&&e!==``;return{message:i?Nw(e,t):``,content:e??null,direction:r,sender:t,sentTime:new Date().toLocaleString(),display:i,originalMessage:n}}function Fw(e){return(e??[]).filter(e=>e&&typeof e==`object`&&typeof e.role==`string`).map(e=>Pw(e.content,e.role,e))}function Iw(e){return!e||e.length===0?``:Zf(`Some example prompts to get you started:`)+`
890
+ `),re(`div.cs-message__html-content .katex-display{max-width:100%;margin:.4em 0 .6em;padding:.2em 0;overflow:auto hidden}div.cs-message__html-content .katex-display:last-child{margin-bottom:0}div.cs-message__html-content .katex-error{font-family:JetBrains Mono,SFMono-Regular,Menlo,Consolas,monospace;font-size:.9em}`);var cw=/^ {0,3}(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])[ \t]*(?:\n+|$)/,lw=/^ {0,3}(?:\$\$|\\\[)/m,uw=/^(?:\\\(([\s\S]+?)\\\)|\\\[([\s\S]+?)\\\]|\$\$([\s\S]+?)\$\$)/,dw=/\\\(|\\\[|\$\$/;function fw(e,t){return sw.renderToString(e.trim().replace(/(?<!\\)\$/g,`\\$`),{displayMode:t,throwOnError:!1,strict:`ignore`,trust:!1})}function pw(e,t,n,r){return{type:e,raw:t,text:n,displayMode:r}}var mw={tokenizer:{lheading(e){let t=/^(?:[^\n]+\n)+?(?: {0,3}(?:=+|-+) *(?:\n+|$))/.exec(e)?.[0]??``;return lw.test(t)?void 0:!1}},extensions:[{name:`blockMath`,level:`block`,start:e=>e.match(lw)?.index,tokenizer(e){let t=cw.exec(e);if(t)return pw(`blockMath`,t[0],t[1]??t[2],!0)},renderer:e=>`${fw(e.text,!0)}\n`},{name:`inlineMath`,level:`inline`,start:e=>e.match(dw)?.index,tokenizer(e){let t=uw.exec(e);if(!t)return;let[n,r,i,a]=t;return pw(`inlineMath`,n,r??i??a,r===void 0)},renderer:e=>fw(e.text,e.displayMode)}]},hw={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function gw(e){return e.replace(/[&<>"']/g,e=>hw[e])}var _w=String.raw`(?:https?:\/\/|\/)[^\s)"]+`,vw=String.raw`(?:${_w}|data:image\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/=]+)`,yw=String.raw`!\[([^\]]*)\]\((${vw})\)`,bw=new RegExp(String.raw`^${_w}$`),xw=new RegExp(String.raw`^${vw}$`),Sw=new RegExp(String.raw`\[${yw}\]\((${_w})\)`,`g`),Cw=new RegExp(yw,`g`),ww=new RegExp(String.raw`\[([^\]]+)\]\((${_w})\)`,`g`);function Tw(e,t){return`<a href="${e}" target="_blank" rel="noopener noreferrer">${t}</a>`}var Ew=`smarter-chat-image`;function Dw(e,t){return`<img class="${Ew}" src="${e}" alt="${t}" loading="lazy" referrerpolicy="no-referrer">`}function Ow(e){if(!(e instanceof HTMLImageElement)||!e.classList.contains(Ew))return!1;let t=document.createElement(`span`);return t.className=`smarter-chat-image-unavailable`,t.textContent=e.alt.trim()||Zf(`Image`),e.replaceWith(t),!0}function kw(e){return gw(e).replace(Sw,(e,t,n,r)=>Tw(r,Dw(n,t))).replace(Cw,(e,t,n)=>Aw(n,t)).replace(ww,(e,t,n)=>Tw(n,t))}function Aw(e,t){return e.startsWith(`data:`)?Dw(e,t):Tw(e,Dw(e,t))}var jw=new Y_({gfm:!0,breaks:!0,async:!1});jw.use(mw),jw.use({renderer:{html({text:e}){return gw(e)},link({href:e,tokens:t}){let[n]=t;if(t.length===1&&n.type===`image`){let{href:t,text:r}=n;if(bw.test(e)&&xw.test(t))return Tw(gw(e),Dw(gw(t),r))}let r=this.parser.parseInline(t);return bw.test(e)?Tw(gw(e),r):r},image({href:e,text:t}){return xw.test(e)?Aw(gw(e),t):t},code({text:e,lang:t}){return Sm(e,t)}}});function Mw(e){return rg.sanitize(e,{ADD_TAGS:[`semantics`,`annotation`],ADD_ATTR:[`target`,`encoding`,`referrerpolicy`]})}function Nw(e){let t=jw.parse(e).trim(),n=/^<p>([\s\S]*)<\/p>$/.exec(t);return Mw(n&&!n[1].includes(`<p>`)?n[1]:t)}function Pw(e){return e===Nf.USER?Mf.OUTGOING:Mf.INCOMING}function Fw(e,t){return t===Nf.USER?kw(e):Nw(e)}function Iw(e,t,n,r=Pw(t)){let i=typeof e==`string`&&e!==``;return{message:i?Fw(e,t):``,content:e??null,direction:r,sender:t,sentTime:new Date().toLocaleString(),display:i,originalMessage:n}}function Lw(e){return(e??[]).filter(e=>e&&typeof e==`object`&&typeof e.role==`string`).map(e=>Iw(e.content,e.role,e))}function Rw(e){return!e||e.length===0?``:Zf(`Some example prompts to get you started:`)+`
891
891
 
892
- `+e.map(e=>`- ${e}\n`).join(``)}function Lw(e,t,n){let r=[Pw(t,Nf.SYSTEM),Pw(e,Nf.ASSISTANT)],i=Iw(n);return i&&r.push(Pw(i,Nf.ASSISTANT)),r}function Rw(e,t,n,r){let i=Fw(r);return i.length>0?i:Lw(e,t,n)}function zw(e){return e.filter(e=>Pf.includes(e.sender)).map(e=>({...e.originalMessage,role:e.sender,content:e.content}))}function Bw(e,t,n){return e.map(e=>e.message?{...e,display:!n.includes(e.sender)||t}:{...e,display:!1})}function Vw(e){return e.replace(/<[^>]+>/g,``)}re(`.smarter-chat-title{align-items:center;gap:.35em;display:inline-flex}.smarter-chat-title-icon{width:1em;height:1em}.smarter-chat-title-sandbox{color:brown}`);function Hw({label:e,color:t,path:n}){return(0,R.jsxs)(`svg`,{className:`smarter-chat-title-icon`,viewBox:`0 0 16 16`,role:`img`,"aria-label":e,fill:t,children:[(0,R.jsx)(`title`,{children:e}),(0,R.jsx)(`path`,{d:n})]})}var Uw=`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`,Ww=`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`,Gw=`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 Kw({title:e,isReady:t,isValid:n,isDeployed:r}){return t?(0,R.jsxs)(`span`,{className:`smarter-chat-title`,children:[e,n?(0,R.jsx)(Hw,{label:Zf(`valid`),color:`green`,path:Uw}):(0,R.jsx)(Hw,{label:Zf(`not valid`),color:`red`,path:Ww}),r?(0,R.jsx)(Hw,{label:Zf(`deployed`),color:`orange`,path:Gw}):(0,R.jsx)(`span`,{className:`smarter-chat-title-sandbox`,children:Zf(`(sandbox)`)})]}):(0,R.jsx)(`span`,{children:Zf(`Loading...`)})}var qw=Kw,Jw=class extends A.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`${h} ErrorBoundary caught an error:`,e,t)}render(){return this.state.error?(0,R.jsxs)(`div`,{role:`alert`,className:`smarter-chat-error-boundary`,children:[(0,R.jsx)(`h2`,{children:Zf(`Something went wrong.`)}),(0,R.jsx)(`p`,{children:this.state.error.message})]}):this.props.children}};function Yw({paths:e}){return(0,R.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,children:e.map(e=>(0,R.jsx)(`path`,{d:e},e))})}function Xw(){return(0,R.jsx)(Yw,{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 Zw(){return(0,R.jsx)(Yw,{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 Qw(){return(0,R.jsx)(Yw,{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`]})}re(`.SmarterChat{border:1px solid #ff5733bf;height:100%;overflow-x:auto}.SmarterChat a{-webkit-text-decoration:inherit;text-decoration:inherit;font-synthesis:none;text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;font-weight:400;line-height:1.5}.smarter-chat-container{flex-direction:row;height:100%;margin:0;padding:0;display:flex}.smarter-chat-app{box-sizing:border-box;flex:100%;min-width:280px;height:100%;margin:0;padding:5px}.chat-app{width:100%;height:100%;position:relative}.smarter-chat-container-inner,.smarter-chat-message-list{width:100%}.SmarterChat .cs-main-container{font-family:var(--smarter-chat-font-family,Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif);font-size:var(--smarter-chat-font-size,1rem);color:var(--smarter-chat-main-container-color,#000000de);background-color:var(--smarter-chat-main-container-bg,#fff);border-color:var(--smarter-chat-main-container-border-color,#d1dbe3)}.SmarterChat .smarter-chat-container-inner{color:var(--smarter-chat-message-list-color,lightgray);background-color:var(--smarter-chat-chat-container-bg,#0000001a)!important}.SmarterChat .smarter-chat-message-list{color:var(--smarter-chat-message-list-color,lightgray);background-image:var(--smarter-chat-background-image,none);background-size:var(--smarter-chat-background-size,cover);background-repeat:var(--smarter-chat-background-repeat,no-repeat);background-position:50%;background-color:var(--smarter-chat-message-list-bg,#0000001a)!important}.SmarterChat .cs-conversation-header{font-family:var(--smarter-chat-font-family,Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif);background-color:var(--smarter-chat-header-bg,#f6fbff);border-bottom-color:var(--smarter-chat-header-border-color,#d1dbe3)}.SmarterChat .cs-conversation-header__content .cs-conversation-header__user-name{color:var(--smarter-chat-header-color,#000000de);background-color:#0000}.SmarterChat .cs-conversation-header__content .cs-conversation-header__info{color:var(--smarter-chat-header-info-color,#0009);background-color:#0000}.SmarterChat .cs-conversation-header__avatar .smarter-chat-logo img{box-sizing:border-box;object-fit:contain;background-color:#fff;padding:3px}.SmarterChat .cs-message__content{font-family:var(--smarter-chat-font-family,Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif)}.SmarterChat .cs-message.cs-message--incoming.cs-message--single:not(.smarter-message,.smarter-error-message,.smarter-progress-message,.system-message) .cs-message__content{color:var(--smarter-chat-incoming-color,#000000de);background-color:var(--smarter-chat-incoming-bg,#c6e3fa);border:1px solid var(--smarter-chat-incoming-border-color,transparent);border-radius:0 var(--smarter-chat-border-radius,.7em) var(--smarter-chat-border-radius,.7em) var(--smarter-chat-border-radius,.7em)}.SmarterChat .cs-message.cs-message--outgoing.cs-message--single:not(.smarter-message,.smarter-error-message,.smarter-progress-message,.system-message) .cs-message__content{color:var(--smarter-chat-outgoing-color,#000000de);background-color:var(--smarter-chat-outgoing-bg,#6ea9d7);border:1px solid var(--smarter-chat-outgoing-border-color,transparent);border-radius:var(--smarter-chat-border-radius,.7em) var(--smarter-chat-border-radius,.7em) 0 var(--smarter-chat-border-radius,.7em)}.SmarterChat .cs-message--incoming:not(.smarter-message,.smarter-error-message,.smarter-progress-message,.system-message) div.cs-message__html-content a{color:var(--smarter-chat-incoming-link-color,inherit);filter:var(--smarter-chat-incoming-link-filter,invert(1) contrast(2))}.SmarterChat .cs-message--outgoing:not(.smarter-message,.smarter-error-message,.smarter-progress-message,.system-message) div.cs-message__html-content a{color:var(--smarter-chat-outgoing-link-color,inherit);filter:var(--smarter-chat-outgoing-link-filter,invert(1) contrast(2))}.SmarterChat .cs-chat-container .cs-message-input{color:var(--smarter-chat-input-color,#000000de);background-color:var(--smarter-chat-input-bg,#fff);border-top-color:var(--smarter-chat-input-border-color,#d1dbe3)}.SmarterChat .cs-message-input__content-editor-wrapper,.SmarterChat .cs-message-input__content-editor-container,.SmarterChat .cs-message-input__content-editor{background-color:var(--smarter-chat-input-editor-bg,#c6e3fa)}.SmarterChat .cs-message-input__content-editor-wrapper{border-radius:var(--smarter-chat-border-radius,.7em)}.SmarterChat .cs-message-input__content-editor{font-family:var(--smarter-chat-font-family,Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif);color:var(--smarter-chat-input-color,#000000de)}.SmarterChat .cs-message-input__content-editor[data-placeholder]:empty:before{color:var(--smarter-chat-input-placeholder-color,#00000061)}.SmarterChat .cs-button--send,.SmarterChat .cs-button--attachment{color:var(--smarter-chat-button-color,#6ea9d7)}.SmarterChat .cs-typing-indicator__text{color:var(--smarter-chat-typing-color,#6ea9d7)}.SmarterChat .cs-typing-indicator__dot{background-color:var(--smarter-chat-typing-color,#6ea9d7)}.SmarterChat .cs-message__avatar .cs-avatar img{object-fit:cover}.cs-message-separator:before,.cs-message-separator:after{background-color:#d3d3d3!important}.cs-conversation-header{text-align:center}.cs-conversation-header__actions .cs-button.smarter-chat-toolbar-button{color:var(--smarter-chat-header-color,var(--smarter-chat-button-color,#6ea9d7));background-color:#0000;border-radius:.4em;align-items:center;gap:.35em;padding:.2em .4em;font-size:1.3em;display:inline-flex}.cs-conversation-header__actions .cs-button.smarter-chat-toolbar-button:hover,.cs-conversation-header__actions .cs-button.smarter-chat-toolbar-button:focus-visible{background-color:color-mix(in srgb, currentColor 15%, transparent)}.cs-conversation-header__actions .smarter-chat-mode-toggle{border-right:1px solid color-mix(in srgb, currentColor 30%, transparent);color:var(--smarter-chat-header-color,var(--smarter-chat-button-color,#6ea9d7));align-items:center;margin-right:.4em;padding-right:.4em;display:inline-flex}.cs-conversation-header__actions .smarter-chat-mode-toggle .cs-button.smarter-chat-mode-option{white-space:nowrap;border:1px solid color-mix(in srgb, currentColor 60%, transparent);border-radius:0;margin:0;font-size:.85em}.cs-conversation-header__actions .smarter-chat-mode-toggle .cs-button.smarter-chat-mode-option:first-child{border-radius:.4em 0 0 .4em}.cs-conversation-header__actions .smarter-chat-mode-toggle .cs-button.smarter-chat-mode-option:last-child{border-left:none;border-radius:0 .4em .4em 0}.cs-conversation-header__actions .smarter-chat-mode-toggle .cs-button.smarter-chat-mode-option[aria-pressed=true]{background-color:color-mix(in srgb, currentColor 22%, transparent);font-weight:600}.cs-conversation-header__actions .cs-button.smarter-chat-toolbar-button-labeled{white-space:nowrap;font-size:.85em}.cs-conversation-header__actions .cs-button.smarter-chat-mode-option svg,.cs-conversation-header__actions .cs-button.smarter-chat-toolbar-button-labeled svg{font-size:1.2em}.smarter-chat-app{container:smarter-chat/inline-size}@container smarter-chat (width<=560px){.cs-conversation-header__actions .smarter-chat-toolbar-label{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.cs-conversation-header__actions .cs-button.smarter-chat-toolbar-button{gap:0}}.cs-message--outgoing div.cs-message__html-content{white-space:pre-wrap}div.cs-message__html-content>:first-child{margin-top:0}div.cs-message__html-content>:last-child{margin-bottom:0}div.cs-message__html-content :is(p,ul,ol,blockquote,table){margin:0 0 .6em}div.cs-message__html-content :is(h1,h2,h3,h4,h5,h6){margin:.6em 0 .3em;font-weight:700;line-height:1.25}div.cs-message__html-content h1{font-size:1.4em}div.cs-message__html-content h2{font-size:1.25em}div.cs-message__html-content h3{font-size:1.1em}div.cs-message__html-content :is(h4,h5,h6){font-size:1em}div.cs-message__html-content :is(ul,ol){padding-left:1.5em}div.cs-message__html-content li>:is(ul,ol){margin-bottom:0}div.cs-message__html-content code{background-color:#00000014;border-radius:4px;padding:.1em .3em;font-family:JetBrains Mono,SFMono-Regular,Menlo,Consolas,monospace;font-size:.9em}section.cs-message .cs-message__content-wrapper{min-width:0;max-width:100%}div.cs-message__html-content .smarter-chat-code{text-align:left;background-color:#0d1117;border:1px solid #30363d;border-radius:6px;max-width:100%;margin:0 0 .6em;overflow:hidden}div.cs-message__html-content .smarter-chat-code:last-child{margin-bottom:0}div.cs-message__html-content .smarter-chat-code-header{color:#8b949e;background-color:#161b22;border-bottom:1px solid #30363d;justify-content:space-between;align-items:center;gap:1em;padding:.3em .5em .3em 1em;font-family:Inter,system-ui,-apple-system,Segoe UI,Helvetica,Arial,sans-serif;font-size:.8em;display:flex}div.cs-message__html-content .smarter-chat-code-copy{color:#c9d1d9;font:inherit;cursor:pointer;background-color:#21262d;border:1px solid #30363d;border-radius:6px;padding:.2em .6em}div.cs-message__html-content .smarter-chat-code-copy:hover,div.cs-message__html-content .smarter-chat-code-copy:focus-visible{background-color:#30363d;border-color:#8b949e;outline:none}div.cs-message__html-content pre{color:#c9d1d9;white-space:pre;word-wrap:normal;tab-size:4;background-color:#0d1117;margin:0;padding:1em;overflow-x:auto}div.cs-message__html-content pre code{color:inherit;background-color:#0000;border-radius:0;padding:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:.85em;line-height:1.45;display:block}div.cs-message__html-content .hljs :is(.hljs-doctag,.hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_){color:#ff7b72}div.cs-message__html-content .hljs :is(.hljs-title,.hljs-title.class_,.hljs-title.function_){color:#d2a8ff}div.cs-message__html-content .hljs :is(.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable){color:#79c0ff}div.cs-message__html-content .hljs :is(.hljs-string,.hljs-regexp,.hljs-meta .hljs-string){color:#a5d6ff}div.cs-message__html-content .hljs :is(.hljs-built_in,.hljs-symbol){color:#ffa657}div.cs-message__html-content .hljs :is(.hljs-comment,.hljs-code,.hljs-formula){color:#8b949e}div.cs-message__html-content .hljs :is(.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo){color:#7ee787}div.cs-message__html-content .hljs .hljs-meta .hljs-keyword{color:#ff7b72}div.cs-message__html-content .hljs .hljs-subst{color:#c9d1d9}div.cs-message__html-content .hljs .hljs-section{color:#1f6feb;font-weight:700}div.cs-message__html-content .hljs .hljs-bullet{color:#f2cc60}div.cs-message__html-content .hljs .hljs-emphasis{color:#c9d1d9;font-style:italic}div.cs-message__html-content .hljs .hljs-strong{color:#c9d1d9;font-weight:700}div.cs-message__html-content .hljs .hljs-addition{color:#aff5b4;background-color:#033a16}div.cs-message__html-content .hljs .hljs-deletion{color:#ffdcd7;background-color:#67060c}div.cs-message__html-content blockquote{opacity:.85;border-left:3px solid #00000040;padding:0 0 0 .8em}div.cs-message__html-content table{border-collapse:collapse;max-width:100%;display:block;overflow-x:auto}div.cs-message__html-content :is(th,td){text-align:left;border:1px solid #0003;padding:.25em .6em}div.cs-message__html-content th{background-color:#0000000d;font-weight:700}div.cs-message__html-content hr{border:0;border-top:1px solid #0003;margin:.6em 0}div.cs-message__html-content a{text-decoration:underline!important}div.cs-message__html-content a:hover{color:orange;text-decoration:underline}section.smarter-message .cs-message__content{text-align:left;background-color:#ffebcd;border:1px solid brown;border-radius:10px;margin-top:10px;margin-bottom:10px;font-family:Courier New,Courier,monospace;font-weight:700;color:brown!important}section.smarter-error-message .cs-message__content{text-align:left;background-color:#f5f5f5;border:3px solid #dc143c;border-radius:10px;margin-top:10px;margin-bottom:10px;font-family:Courier New,Courier,monospace;position:relative;color:#000!important}section.smarter-progress-message .cs-message__content{text-align:left;background-color:#fff4dc;border:2px dashed #d2691e;border-radius:10px;align-items:center;gap:.75em;margin-top:10px;margin-bottom:10px;padding:.8em 1.1em;font-family:Courier New,Courier,monospace;font-size:1.15em;font-style:italic;font-weight:700;display:flex;color:#8a3b12!important}section.smarter-progress-message .cs-message__content:before{content:"";box-sizing:border-box;flex:none;width:1.2em;height:1.2em}section.smarter-progress-message-active .cs-message__content{animation:1.6s ease-in-out infinite smarter-progress-pulse}section.smarter-progress-message-active .cs-message__content:before{border:3px solid #d2691e40;border-top-color:#d2691e;border-radius:50%;animation:.8s linear infinite smarter-progress-spin}section.smarter-progress-message-done .cs-message__content{opacity:.7}section.smarter-progress-message-done .cs-message__content:before{content:"✓";color:#d2691e;text-align:center;font-style:normal;line-height:1.2em}@keyframes smarter-progress-spin{to{transform:rotate(360deg)}}@keyframes smarter-progress-pulse{0%,to{border-color:#d2691e;box-shadow:0 0 #d2691e73}50%{border-color:#ff8c1a;box-shadow:0 0 0 5px #d2691e00}}@media (prefers-reduced-motion:reduce){section.smarter-progress-message-active .cs-message__content,section.smarter-progress-message-active .cs-message__content:before{animation:none}}div.cs-message__html-content img.smarter-chat-image{object-fit:contain;border-radius:6px;width:auto;max-width:min(100%,480px);height:auto;max-height:360px;margin:4px 0;display:block}.SmarterChat .cs-message div.cs-message__html-content a:has(>img.smarter-chat-image){filter:none}section.system-message .cs-message__content{background-color:#272822;border:1px solid brown;border-radius:10px;margin-top:10px;margin-bottom:10px;font-family:Courier New,Courier,monospace;font-weight:700;color:beige!important}.smarter-chat-error-boundary{color:#dc143c;padding:1rem}`);function $w(e){return e===Nf.SMARTER?`smarter-message`:e===Nf.SMARTER_ERROR?`smarter-error-message`:e===Nf.TOOL||e===Nf.SYSTEM?`system-message`:``}function eT(e){return Pw(e.message,Nf.SMARTER).message}function tT({apiUrl:e,apiKey:t=null,toggleMetadata:n=!1,csrfCookieName:r=`csrftoken`,csrftoken:i=null,debugCookieName:a=`debug`,debugCookieExpiration:o=g,debugMode:s=!1,sessionCookieName:c=`session_key`,sessionCookieExpiration:l=g,cookiePath:u=null,cookieDomain:d=``,smarterRequestId:f=``,streamProgress:_=!0,language:v=null,verbose:y=!1,reloadKey:b,headerActions:x=null,onConfig:S,onNewChat:C,onModeChange:w}){let T=Kf(v),[E,D]=(0,A.useState)(null),[O,k]=(0,A.useState)(null),[ee,j]=(0,A.useState)([]),[te,M]=(0,A.useState)(n),[ne,re]=(0,A.useState)(!1),[ie,ae]=(0,A.useState)([]),[oe,se]=(0,A.useState)(new Set),ce=(0,A.useRef)(null),le=(0,A.useRef)(null),[ue,de]=(0,A.useState)(!1),fe=(0,A.useRef)(0),pe=(0,A.useMemo)(()=>({csrfCookie:jf(r,null,d,i),sessionCookie:jf(c,l,d,null,u),debugCookie:jf(a,o,d,null,u)}),[r,i,d,c,l,u,a,o]),me=(0,A.useMemo)(()=>({smarterClient:p,smarterClientVersion:m,smarterRequestId:f,apiKey:t}),[f,t]),he=(0,A.useCallback)((...e)=>{(s||E?.debug_mode)&&console.log(h,...e)},[s,E?.debug_mode]),ge=(0,A.useCallback)(async()=>{let t=++fe.current,n=await mp(e,pe,me,y);return t===fe.current&&(D(n),de(y)),n},[e,pe,me,y]);(0,A.useEffect)(()=>{y&&E&&!ue&&ge().catch(e=>console.error(`${h} Failed to refresh:`,e))},[y,E,ue,ge]);let _e=(0,A.useRef)(b);(0,A.useEffect)(()=>{b!==_e.current&&(_e.current=b,ge().catch(e=>console.error(`${h} Failed to refresh:`,e)))},[b,ge]),(0,A.useEffect)(()=>{E&&S?.(E)},[E,S]),(0,A.useEffect)(()=>{w?.(te)},[te,w]);let N=(0,A.useCallback)(async()=>{try{k(null);let e=await ge(),t=e.llmclient,r=Rw(t.app_welcome_message??``,t.default_system_role??``,t.app_example_prompts,e.history?.chat_history);j(Bw(r,n,Ff)),M(n),re(!1),he(`chat started`,e)}catch(e){console.error(`${h} Failed to fetch the configuration:`,e),k(e instanceof Error?e.message:String(e))}},[ge,he,n]);(0,A.useEffect)(()=>{N()},[e]),(0,A.useEffect)(()=>{let e=le.current?.querySelector(`.cs-message-input__content-editor`);e?.setAttribute(`role`,`textbox`),e?.setAttribute(`aria-multiline`,`true`),e?.setAttribute(`aria-label`,Zf(`Message`))},[T]),(0,A.useEffect)(()=>{let e=le.current,t=e=>Cm(e.target)||xg(e.target);return e?.addEventListener(`click`,t),()=>e?.removeEventListener(`click`,t)},[]),(0,A.useEffect)(()=>{let e=le.current,t=e=>{let t=e.target;if(!(t instanceof HTMLImageElement)||!t.closest(`.cs-avatar`))return;let n=t.getAttribute(`src`)??``;se(e=>e.has(n)?e:new Set(e).add(n))};return e?.addEventListener(`error`,t,!0),()=>e?.removeEventListener(`error`,t,!0)},[]),(0,A.useLayoutEffect)(()=>{bg(le.current)},[ee,te]);let P=()=>{Af(pe.sessionCookie,``),D(null),C?.(),N()},ve=e=>{e!==te&&(M(e),j(t=>Bw(t,e,Ff)))};async function ye(e){if(!E)return;let t=[...ee,Pw(e,Nf.USER)];j(t),re(!0),ae([]);let n=_?e=>{he(`prompt progress`,e),ae(t=>[...t,e])}:void 0;try{let e=await wp(E,zw(t),pe,me,n),r=e.messages.map(e=>{let t=Pw(e.content,e.role,e);return Ff.includes(t.sender)&&!te?{...t,display:!1}:t});j(e=>[...e,...r]),he(`prompt response`,e),y?await ge().catch(e=>console.error(`${h} Failed to refresh:`,e)):de(!1)}catch(e){console.error(`${h} Prompt failed:`,e);let t=e instanceof Error?e.message:String(e);j(e=>[...e,Pw(t,Nf.SMARTER_ERROR)])}finally{re(!1),ae([])}}let be=(e,t,n)=>{let r=n??t??Vw(e);r.trim()&&ye(r)},xe=e=>{let t=e.target.files?.[0];t&&(t.text().then(e=>void ye(e)),e.target.value=``)},F=E?.llmclient,Se=!!E,Ce=F?.styles,we=(0,A.useMemo)(()=>Mg(Ce),[Ce]);Ng(Ce?.google_font);let Te=e=>{let t=kg(e);return t&&!oe.has(t)?t:null},Ee=Te(Ce?.app_logo_url),De=Te(Ce?.assistant_avatar_url),Oe=Te(Ce?.user_avatar_url),ke=F?`${F.app_name} v${F.version||`1.0.0`}`:``,Ae=F?.total_tools??0,je=``;F&&Ae>0?je=ep(Qf(`%(provider)s %(model)s with %(count)s additional tool`,`%(provider)s %(model)s with %(count)s additional tools`,Ae),{provider:F.provider,model:F.default_model,count:Ae}):F&&(je=`${F.provider} ${F.default_model}`);let Ne=E?.meta_data?.is_valid??E?.meta_data?.ready??!0,Pe=!!(E?.meta_data?.is_deployed??F?.deployed),Fe=F?.app_assistant??Zf(`Assistant`);function Ie(e){return e.sender===Nf.ASSISTANT&&De?(0,R.jsx)(Me,{src:De,name:Fe}):e.sender===Nf.USER&&Oe?(0,R.jsx)(Me,{src:Oe,name:Zf(`You`)}):null}let Le=ie.at(-1)?.message,Re=Le?ep(Zf(`%(assistant)s: %(step)s`),{assistant:Fe,step:Le}):ep(Zf(`%(assistant)s is typing`),{assistant:Fe}),ze;return ze=O?Zf(`Smarter Chat is not available`):Se?(0,R.jsx)(qw,{title:ke,isReady:Se,isValid:Ne,isDeployed:Pe}):Zf(`Configuring workbench...`),(0,R.jsx)(`div`,{id:`smarter_chat_component_container`,className:`SmarterChat`,style:we,children:(0,R.jsx)(`div`,{className:`smarter-chat-container`,children:(0,R.jsx)(`div`,{role:`region`,"aria-label":Zf(`Chat`),className:`smarter-chat-app`,children:(0,R.jsxs)(`div`,{className:`chat-app`,ref:le,children:[(0,R.jsx)(Jw,{children:(0,R.jsx)(Gd,{style:{width:`100%`,height:`100%`},children:(0,R.jsxs)(Pd,{className:`smarter-chat-container-inner`,children:[(0,R.jsxs)(gs,{children:[Ee&&Se&&(0,R.jsx)(Me,{className:`smarter-chat-logo`,src:Ee,name:F?.app_name??``}),(0,R.jsx)(gs.Content,{userName:ze,info:Se?je:``}),(0,R.jsxs)(gs.Actions,{children:[n&&(0,R.jsxs)(`div`,{role:`group`,"aria-label":Zf(`Chat mode`),className:`smarter-chat-mode-toggle`,children:[(0,R.jsx)(et,{className:`smarter-chat-toolbar-button smarter-chat-mode-option`,icon:(0,R.jsx)(Zw,{}),"aria-pressed":te,onClick:()=>ve(!0),title:Zf(`Sandbox mode: Smarter's system, tool and meta data messages are displayed.`),children:(0,R.jsx)(`span`,{className:`smarter-chat-toolbar-label`,children:$f(`chat mode`,`Sandbox`)})}),(0,R.jsx)(et,{className:`smarter-chat-toolbar-button smarter-chat-mode-option`,icon:(0,R.jsx)(Qw,{}),"aria-pressed":!te,onClick:()=>ve(!1),title:Zf(`Production mode: the conversation is displayed as its users see it.`),children:(0,R.jsx)(`span`,{className:`smarter-chat-toolbar-label`,children:$f(`chat mode`,`Production`)})})]}),(0,R.jsx)(et,{className:`smarter-chat-toolbar-button`,icon:(0,R.jsx)(Xw,{}),onClick:P,title:Zf(`Start a new chat`),"aria-label":Zf(`Start a new chat`)}),x]})]}),(0,R.jsxs)(wu,{className:`smarter-chat-message-list`,scrollBehavior:`auto`,typingIndicator:ne?(0,R.jsx)(_f,{content:Re}):null,children:[O&&(0,R.jsx)(ll,{className:`smarter-error-message`,model:{message:Pw(O,Nf.SMARTER_ERROR).message,direction:`incoming`,position:`single`,sender:Nf.SMARTER_ERROR}}),ee.map((e,t)=>e.display?(0,R.jsx)(ll,{className:$w(e.sender),model:{message:e.message,sentTime:e.sentTime,sender:e.sender,direction:e.direction,position:`single`},children:Ie(e)},t):null),te&&ie.map((e,t)=>(0,R.jsx)(ll,{className:`smarter-progress-message ${t===ie.length-1?`smarter-progress-message-active`:`smarter-progress-message-done`}`,model:{message:eT(e),sender:Nf.SMARTER,direction:`incoming`,position:`single`}},`progress-${t}`))]}),(0,R.jsx)(_d,{placeholder:F?.app_placeholder??``,onSend:be,onAttachClick:()=>ce.current?.click(),attachButton:!!F?.app_file_attachment,disabled:!Se,fancyScroll:!1,onPaste:Tm})]})})}),(0,R.jsx)(`input`,{type:`file`,accept:`.py,.txt,.md,.json,.yaml,.yml,.csv`,"aria-label":Zf(`Attach a file`),ref:ce,style:{display:`none`},onChange:xe})]})})})})}var nT=tT,rT=`smarter-chat-embed-panel`;function iT({options:e}){return(0,R.jsx)(nT,{apiUrl:e.chatbot,apiKey:e.apiKey,toggleMetadata:!1,debugMode:e.debug,streamProgress:e.streamProgress,sessionCookieName:e.sessionCookieName,debugCookieName:`${e.sessionCookieName}_debug`,cookiePath:e.cookiePath,language:e.language},e.chatbot)}function aT(){return(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`28`,height:`28`,"aria-hidden":`true`,focusable:`false`,children:(0,R.jsx)(`path`,{fill:`currentColor`,d:`M4 3h16a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H8.4L4 21.5V18a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm3 6.5a1.5 1.5 0 1 0 0 .01Zm5 0a1.5 1.5 0 1 0 0 .01Zm5 0a1.5 1.5 0 1 0 0 .01Z`})})}function oT(){return(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`24`,height:`24`,"aria-hidden":`true`,focusable:`false`,children:(0,R.jsx)(`path`,{fill:`currentColor`,d:`M5.3 5.3a1 1 0 0 1 1.4 0L12 10.6l5.3-5.3a1 1 0 1 1 1.4 1.4L13.4 12l5.3 5.3a1 1 0 0 1-1.4 1.4L12 13.4l-5.3 5.3a1 1 0 0 1-1.4-1.4l5.3-5.3-5.3-5.3a1 1 0 0 1 0-1.4Z`})})}function sT({options:e,open:t,onOpenChange:n}){Kf(e.language);let r=e.label??Zf(`Chat`),[i,a]=(0,A.useState)(t);t&&!i&&a(!0);let o=(0,A.useRef)(null),s=(0,A.useRef)(null);return(0,A.useEffect)(()=>{let e=s.current,t=e=>{e.key===`Escape`&&(n(!1),o.current?.focus())};return e?.addEventListener(`keydown`,t),()=>e?.removeEventListener(`keydown`,t)},[n]),(0,R.jsxs)(`div`,{className:`smarter-chat-embed-launcher smarter-chat-embed-${e.position}`,style:{zIndex:e.zIndex,"--smarter-chat-embed-width":e.width,"--smarter-chat-embed-height":e.height},children:[(0,R.jsx)(`section`,{id:rT,part:`panel`,className:`smarter-chat-embed-panel`,"aria-label":r,hidden:!t,ref:s,children:i&&(0,R.jsx)(iT,{options:e})}),(0,R.jsx)(`button`,{ref:o,type:`button`,part:`launcher`,className:`smarter-chat-embed-button`,style:{background:e.color},"aria-label":t?ep(Zf(`Close %(label)s`),{label:r}):r,"aria-expanded":t,"aria-controls":rT,onClick:()=>n(!t),children:t?(0,R.jsx)(oT,{}):(0,R.jsx)(aT,{})})]})}function cT(e){let{options:t}=e;return t.mode===`launcher`?(0,R.jsx)(sT,{...e}):(0,R.jsx)(`div`,{part:`chat`,className:`smarter-chat-embed-inline`,style:{width:t.width,height:t.height},children:(0,R.jsx)(iT,{options:t})})}var lT=[`chatbot`,`api-key`,`mode`,`position`,`open`,`label`,`color`,`width`,`height`,`z-index`,`session-cookie-name`,`cookie-path`,`stream-progress`,`debug`,`language`],uT=2147483e3,dT={launcher:{width:`400px`,height:`600px`},inline:{width:`100%`,height:`600px`}};function fT(e,t){if(e==null)return t;let n=e.trim().toLowerCase();return n===``||n===`true`||n!==`false`&&t}function pT(e){if(!e?.trim())return null;try{let t=new URL(e.trim());return t.protocol!==`https:`&&t.protocol!==`http:`?null:(t.pathname.endsWith(`/`)||(t.pathname=`${t.pathname}/`),t.toString())}catch{return null}}function mT(e){return`smarter_chat_${new URL(e).host.replace(/[^A-Za-z0-9]/g,`_`)}`}function hT(e,t=`inline`){let n=pT(e(`chatbot`));if(!n)return{options:null,error:`"chatbot" must be the http(s) url of a deployed LLMClient, not ${JSON.stringify(e(`chatbot`))}.`};let r=e(`mode`)?.trim().toLowerCase(),i=r===`launcher`||r===`inline`?r:t,a=e(`position`)?.trim().toLowerCase()===`bottom-left`?`bottom-left`:`bottom-right`,o=Number.parseInt(e(`z-index`)??``,10),s=e(`cookie-path`)?.trim(),c=e(`session-cookie-name`)?.trim();return{error:null,options:{chatbot:n,apiKey:e(`api-key`)?.trim()||null,mode:i,position:a,open:fT(e(`open`),!1),label:e(`label`)?.trim()||null,color:Og(e(`color`))??`#ff5733`,width:Og(e(`width`))??dT[i].width,height:Og(e(`height`))??dT[i].height,zIndex:Number.isFinite(o)?o:uT,sessionCookieName:c&&/^[A-Za-z0-9_.-]+$/.test(c)?c:mT(n),cookiePath:s?.startsWith(`/`)?s:`/`,streamProgress:fT(e(`stream-progress`),!0),debug:fT(e(`debug`),!1),language:e(`language`)?.trim()||null}}}function gT(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function _T(e){let t={};for(let[n,r]of Object.entries(e))(typeof r==`string`||typeof r==`number`||typeof r==`boolean`)&&(t[gT(n)]=String(r));return t}var vT=`smarter-chat`,yT=`smarter-chat-toggle`,bT=class extends HTMLElement{static observedAttributes=[...lT];#e=null;#t=null;#n=null;#r=null;get options(){return hT(e=>this.getAttribute(e),`inline`)}get isOpen(){return this.#n??this.options.options?.open??!1}connectedCallback(){let e=this.shadowRoot;if(!e){e=this.attachShadow({mode:`open`});let t=ie();ce(e,t),oe(t,this.ownerDocument)}this.#t=this.ownerDocument.createElement(`div`),e.append(this.#t),this.#e=(0,ee.createRoot)(this.#t),this.#a()}disconnectedCallback(){this.#e?.unmount(),this.#e=null,this.#t?.remove(),this.#t=null}attributeChangedCallback(){this.#a()}open(){this.#i(!0)}close(){this.#i(!1)}toggle(){this.#i(!this.isOpen)}#i(e){e!==this.isOpen&&(this.#n=e,this.#a(),this.dispatchEvent(new CustomEvent(yT,{detail:{open:e},bubbles:!0,composed:!0})))}#a(){if(!this.#e)return;let{options:e,error:t}=this.options;if(!e){t!==this.#r&&console.error(`${h} <${vT}>: ${t}`),this.#r=t,this.#e.render(null);return}this.#r=null,this.#e.render((0,A.createElement)(cT,{options:e,open:this.isOpen,onOpenChange:e=>this.#i(e)}))}};function xT(e=customElements){e.get(`smarter-chat`)||e.define(vT,bT)}var ST=`data-smarter-chat-auto`;function CT(e,t){let n=[];e instanceof HTMLElement&&e.dataset.chatbot&&n.push(_T({...e.dataset}));for(let e of[t??[]].flat())e&&typeof e==`object`&&n.push(_T(e));return n}function wT(e,t=document){let{target:n,...r}=e,i=r.chatbot??``;if([...t.querySelectorAll(`smarter-chat[data-smarter-chat-auto]`)].find(e=>e.getAttribute(`data-smarter-chat-auto`)===i))return null;let a=t.body;if(n){try{a=t.querySelector(n)}catch{a=null}if(!a)return console.error(`${h} SmarterChatConfig.target: no element matches ${JSON.stringify(n)}.`),null}let o=t.createElement(vT);o.setAttribute(`mode`,r.mode??(n?`inline`:`launcher`));for(let[e,t]of Object.entries(r))/^[a-z][a-z0-9-]*$/.test(e)&&o.setAttribute(e,t);return o.setAttribute(ST,i),a.append(o),o}function TT(e,t,n=document){let r=CT(e,t);if(r.length===0)return;let i=()=>r.forEach(e=>wT(e,n));n.body?i():n.addEventListener(`DOMContentLoaded`,i,{once:!0})}re(`:host{all:initial;color:#212529;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:16px;line-height:1.5;display:block}:host([hidden]){display:none}.smarter-chat-embed-inline{box-sizing:border-box;background:#fff;max-width:100%}.smarter-chat-embed-launcher{position:fixed;bottom:20px}.smarter-chat-embed-bottom-right{right:20px}.smarter-chat-embed-bottom-left{left:20px}.smarter-chat-embed-button{color:#fff;cursor:pointer;border:none;border-radius:50%;justify-content:center;align-items:center;width:56px;height:56px;margin:0;padding:0;transition:transform .15s ease-in-out;display:flex;box-shadow:0 4px 14px #00000040}.smarter-chat-embed-bottom-left .smarter-chat-embed-button{margin-right:auto}.smarter-chat-embed-bottom-right .smarter-chat-embed-button{margin-left:auto}.smarter-chat-embed-button:hover{transform:scale(1.06)}.smarter-chat-embed-button:focus-visible{outline-offset:3px;outline:3px solid #1a73e8}.smarter-chat-embed-panel{box-sizing:border-box;width:var(--smarter-chat-embed-width,400px);max-width:calc(100vw - 40px);height:var(--smarter-chat-embed-height,600px);background:#fff;border-radius:12px;max-height:calc(100vh - 116px);margin-bottom:16px;overflow:hidden;box-shadow:0 8px 32px #00000040}.smarter-chat-embed-panel[hidden]{display:none}@media (width<=480px){.smarter-chat-embed-launcher{bottom:12px}.smarter-chat-embed-bottom-right{right:12px}.smarter-chat-embed-bottom-left{left:12px}.smarter-chat-embed-panel{border-radius:0;width:auto;max-width:none;height:auto;max-height:none;margin:0;position:fixed;inset:0 0 80px}}@media (prefers-reduced-motion:reduce){.smarter-chat-embed-button{transition:none}}`);function ET(e){return[...document.querySelectorAll(vT)].filter(t=>t.options.options?.mode===`launcher`&&(!e||t.options.options.chatbot.startsWith(e)))}b(document.currentScript),xT(),window.SmarterChat={version:m,open:e=>ET(e).forEach(e=>e.open()),close:e=>ET(e).forEach(e=>e.close()),toggle:e=>ET(e).forEach(e=>e.toggle()),mount:e=>wT(_T(e))},TT(document.currentScript,window.SmarterChatConfig)})();
892
+ `+e.map(e=>`- ${e}\n`).join(``)}function zw(e,t,n){let r=[Iw(t,Nf.SYSTEM),Iw(e,Nf.ASSISTANT)],i=Rw(n);return i&&r.push(Iw(i,Nf.ASSISTANT)),r}function Bw(e,t,n,r){let i=Lw(r);return i.length>0?i:zw(e,t,n)}function Vw(e){return e.filter(e=>Pf.includes(e.sender)).map(e=>({...e.originalMessage,role:e.sender,content:e.content}))}function Hw(e,t,n){return e.map(e=>e.message?{...e,display:!n.includes(e.sender)||t}:{...e,display:!1})}function Uw(e){return e.replace(/<[^>]+>/g,``)}re(`.smarter-chat-title{align-items:center;gap:.35em;display:inline-flex}.smarter-chat-title-icon{width:1em;height:1em}.smarter-chat-title-sandbox{color:brown}`);function Ww({label:e,color:t,path:n}){return(0,R.jsxs)(`svg`,{className:`smarter-chat-title-icon`,viewBox:`0 0 16 16`,role:`img`,"aria-label":e,fill:t,children:[(0,R.jsx)(`title`,{children:e}),(0,R.jsx)(`path`,{d:n})]})}var Gw=`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`,Kw=`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`,qw=`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 Jw({title:e,isReady:t,isValid:n,isDeployed:r}){return t?(0,R.jsxs)(`span`,{className:`smarter-chat-title`,children:[e,n?(0,R.jsx)(Ww,{label:Zf(`valid`),color:`green`,path:Gw}):(0,R.jsx)(Ww,{label:Zf(`not valid`),color:`red`,path:Kw}),r?(0,R.jsx)(Ww,{label:Zf(`deployed`),color:`orange`,path:qw}):(0,R.jsx)(`span`,{className:`smarter-chat-title-sandbox`,children:Zf(`(sandbox)`)})]}):(0,R.jsx)(`span`,{children:Zf(`Loading...`)})}var Yw=Jw,Xw=class extends A.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`${h} ErrorBoundary caught an error:`,e,t)}render(){return this.state.error?(0,R.jsxs)(`div`,{role:`alert`,className:`smarter-chat-error-boundary`,children:[(0,R.jsx)(`h2`,{children:Zf(`Something went wrong.`)}),(0,R.jsx)(`p`,{children:this.state.error.message})]}):this.props.children}};function Zw({paths:e}){return(0,R.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,children:e.map(e=>(0,R.jsx)(`path`,{d:e},e))})}function Qw(){return(0,R.jsx)(Zw,{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 $w(){return(0,R.jsx)(Zw,{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 eT(){return(0,R.jsx)(Zw,{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`]})}re(`.SmarterChat{border:1px solid #ff5733bf;height:100%;overflow-x:auto}.SmarterChat a{-webkit-text-decoration:inherit;text-decoration:inherit;font-synthesis:none;text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;font-weight:400;line-height:1.5}.smarter-chat-container{flex-direction:row;height:100%;margin:0;padding:0;display:flex}.smarter-chat-app{box-sizing:border-box;flex:100%;min-width:280px;height:100%;margin:0;padding:5px}.chat-app{width:100%;height:100%;position:relative}.smarter-chat-container-inner,.smarter-chat-message-list{width:100%}.SmarterChat .cs-main-container{font-family:var(--smarter-chat-font-family,Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif);font-size:var(--smarter-chat-font-size,1rem);color:var(--smarter-chat-main-container-color,#000000de);background-color:var(--smarter-chat-main-container-bg,#fff);border-color:var(--smarter-chat-main-container-border-color,#d1dbe3)}.SmarterChat .smarter-chat-container-inner{color:var(--smarter-chat-message-list-color,lightgray);background-color:var(--smarter-chat-chat-container-bg,#0000001a)!important}.SmarterChat .smarter-chat-message-list{color:var(--smarter-chat-message-list-color,lightgray);background-image:var(--smarter-chat-background-image,none);background-size:var(--smarter-chat-background-size,cover);background-repeat:var(--smarter-chat-background-repeat,no-repeat);background-position:50%;background-color:var(--smarter-chat-message-list-bg,#0000001a)!important}.SmarterChat .cs-conversation-header{font-family:var(--smarter-chat-font-family,Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif);background-color:var(--smarter-chat-header-bg,#f6fbff);border-bottom-color:var(--smarter-chat-header-border-color,#d1dbe3)}.SmarterChat .cs-conversation-header__content .cs-conversation-header__user-name{color:var(--smarter-chat-header-color,#000000de);background-color:#0000}.SmarterChat .cs-conversation-header__content .cs-conversation-header__info{color:var(--smarter-chat-header-info-color,#0009);background-color:#0000}.SmarterChat .cs-conversation-header__avatar .smarter-chat-logo img{box-sizing:border-box;object-fit:contain;background-color:#fff;padding:3px}.SmarterChat .cs-message__content{font-family:var(--smarter-chat-font-family,Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif)}.SmarterChat .cs-message.cs-message--incoming.cs-message--single:not(.smarter-message,.smarter-error-message,.smarter-progress-message,.system-message) .cs-message__content{color:var(--smarter-chat-incoming-color,#000000de);background-color:var(--smarter-chat-incoming-bg,#c6e3fa);border:1px solid var(--smarter-chat-incoming-border-color,transparent);border-radius:0 var(--smarter-chat-border-radius,.7em) var(--smarter-chat-border-radius,.7em) var(--smarter-chat-border-radius,.7em)}.SmarterChat .cs-message.cs-message--outgoing.cs-message--single:not(.smarter-message,.smarter-error-message,.smarter-progress-message,.system-message) .cs-message__content{color:var(--smarter-chat-outgoing-color,#000000de);background-color:var(--smarter-chat-outgoing-bg,#6ea9d7);border:1px solid var(--smarter-chat-outgoing-border-color,transparent);border-radius:var(--smarter-chat-border-radius,.7em) var(--smarter-chat-border-radius,.7em) 0 var(--smarter-chat-border-radius,.7em)}.SmarterChat .cs-message--incoming:not(.smarter-message,.smarter-error-message,.smarter-progress-message,.system-message) div.cs-message__html-content a{color:var(--smarter-chat-incoming-link-color,inherit);filter:var(--smarter-chat-incoming-link-filter,invert(1) contrast(2))}.SmarterChat .cs-message--outgoing:not(.smarter-message,.smarter-error-message,.smarter-progress-message,.system-message) div.cs-message__html-content a{color:var(--smarter-chat-outgoing-link-color,inherit);filter:var(--smarter-chat-outgoing-link-filter,invert(1) contrast(2))}.SmarterChat .cs-chat-container .cs-message-input{color:var(--smarter-chat-input-color,#000000de);background-color:var(--smarter-chat-input-bg,#fff);border-top-color:var(--smarter-chat-input-border-color,#d1dbe3)}.SmarterChat .cs-message-input__content-editor-wrapper,.SmarterChat .cs-message-input__content-editor-container,.SmarterChat .cs-message-input__content-editor{background-color:var(--smarter-chat-input-editor-bg,#c6e3fa)}.SmarterChat .cs-message-input__content-editor-wrapper{border-radius:var(--smarter-chat-border-radius,.7em)}.SmarterChat .cs-message-input__content-editor{font-family:var(--smarter-chat-font-family,Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif);color:var(--smarter-chat-input-color,#000000de)}.SmarterChat .cs-message-input__content-editor[data-placeholder]:empty:before{color:var(--smarter-chat-input-placeholder-color,#00000061)}.SmarterChat .cs-button--send,.SmarterChat .cs-button--attachment{color:var(--smarter-chat-button-color,#6ea9d7)}.SmarterChat .cs-typing-indicator__text{color:var(--smarter-chat-typing-color,#6ea9d7)}.SmarterChat .cs-typing-indicator__dot{background-color:var(--smarter-chat-typing-color,#6ea9d7)}.SmarterChat .cs-message__avatar .cs-avatar img{object-fit:cover}.cs-message-separator:before,.cs-message-separator:after{background-color:#d3d3d3!important}.cs-conversation-header{text-align:center}.cs-conversation-header__actions .cs-button.smarter-chat-toolbar-button{color:var(--smarter-chat-header-color,var(--smarter-chat-button-color,#6ea9d7));background-color:#0000;border-radius:.4em;align-items:center;gap:.35em;padding:.2em .4em;font-size:1.3em;display:inline-flex}.cs-conversation-header__actions .cs-button.smarter-chat-toolbar-button:hover,.cs-conversation-header__actions .cs-button.smarter-chat-toolbar-button:focus-visible{background-color:color-mix(in srgb, currentColor 15%, transparent)}.cs-conversation-header__actions .smarter-chat-mode-toggle{border-right:1px solid color-mix(in srgb, currentColor 30%, transparent);color:var(--smarter-chat-header-color,var(--smarter-chat-button-color,#6ea9d7));align-items:center;margin-right:.4em;padding-right:.4em;display:inline-flex}.cs-conversation-header__actions .smarter-chat-mode-toggle .cs-button.smarter-chat-mode-option{white-space:nowrap;border:1px solid color-mix(in srgb, currentColor 60%, transparent);border-radius:0;margin:0;font-size:.85em}.cs-conversation-header__actions .smarter-chat-mode-toggle .cs-button.smarter-chat-mode-option:first-child{border-radius:.4em 0 0 .4em}.cs-conversation-header__actions .smarter-chat-mode-toggle .cs-button.smarter-chat-mode-option:last-child{border-left:none;border-radius:0 .4em .4em 0}.cs-conversation-header__actions .smarter-chat-mode-toggle .cs-button.smarter-chat-mode-option[aria-pressed=true]{background-color:color-mix(in srgb, currentColor 22%, transparent);font-weight:600}.cs-conversation-header__actions .cs-button.smarter-chat-toolbar-button-labeled{white-space:nowrap;font-size:.85em}.cs-conversation-header__actions .cs-button.smarter-chat-mode-option svg,.cs-conversation-header__actions .cs-button.smarter-chat-toolbar-button-labeled svg{font-size:1.2em}.smarter-chat-app{container:smarter-chat/inline-size}@container smarter-chat (width<=560px){.cs-conversation-header__actions .smarter-chat-toolbar-label{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.cs-conversation-header__actions .cs-button.smarter-chat-toolbar-button{gap:0}}.cs-message--outgoing div.cs-message__html-content{white-space:pre-wrap}div.cs-message__html-content>:first-child{margin-top:0}div.cs-message__html-content>:last-child{margin-bottom:0}div.cs-message__html-content :is(p,ul,ol,blockquote,table){margin:0 0 .6em}div.cs-message__html-content :is(h1,h2,h3,h4,h5,h6){margin:.6em 0 .3em;font-weight:700;line-height:1.25}div.cs-message__html-content h1{font-size:1.4em}div.cs-message__html-content h2{font-size:1.25em}div.cs-message__html-content h3{font-size:1.1em}div.cs-message__html-content :is(h4,h5,h6){font-size:1em}div.cs-message__html-content :is(ul,ol){padding-left:1.5em}div.cs-message__html-content li>:is(ul,ol){margin-bottom:0}div.cs-message__html-content code{background-color:#00000014;border-radius:4px;padding:.1em .3em;font-family:JetBrains Mono,SFMono-Regular,Menlo,Consolas,monospace;font-size:.9em}section.cs-message .cs-message__content-wrapper{min-width:0;max-width:100%}div.cs-message__html-content .smarter-chat-code{text-align:left;background-color:#0d1117;border:1px solid #30363d;border-radius:6px;max-width:100%;margin:0 0 .6em;overflow:hidden}div.cs-message__html-content .smarter-chat-code:last-child{margin-bottom:0}div.cs-message__html-content .smarter-chat-code-header{color:#8b949e;background-color:#161b22;border-bottom:1px solid #30363d;justify-content:space-between;align-items:center;gap:1em;padding:.3em .5em .3em 1em;font-family:Inter,system-ui,-apple-system,Segoe UI,Helvetica,Arial,sans-serif;font-size:.8em;display:flex}div.cs-message__html-content .smarter-chat-code-copy{color:#c9d1d9;font:inherit;cursor:pointer;background-color:#21262d;border:1px solid #30363d;border-radius:6px;padding:.2em .6em}div.cs-message__html-content .smarter-chat-code-copy:hover,div.cs-message__html-content .smarter-chat-code-copy:focus-visible{background-color:#30363d;border-color:#8b949e;outline:none}div.cs-message__html-content pre{color:#c9d1d9;white-space:pre;word-wrap:normal;tab-size:4;background-color:#0d1117;margin:0;padding:1em;overflow-x:auto}div.cs-message__html-content pre code{color:inherit;background-color:#0000;border-radius:0;padding:0;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:.85em;line-height:1.45;display:block}div.cs-message__html-content .hljs :is(.hljs-doctag,.hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_){color:#ff7b72}div.cs-message__html-content .hljs :is(.hljs-title,.hljs-title.class_,.hljs-title.function_){color:#d2a8ff}div.cs-message__html-content .hljs :is(.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable){color:#79c0ff}div.cs-message__html-content .hljs :is(.hljs-string,.hljs-regexp,.hljs-meta .hljs-string){color:#a5d6ff}div.cs-message__html-content .hljs :is(.hljs-built_in,.hljs-symbol){color:#ffa657}div.cs-message__html-content .hljs :is(.hljs-comment,.hljs-code,.hljs-formula){color:#8b949e}div.cs-message__html-content .hljs :is(.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo){color:#7ee787}div.cs-message__html-content .hljs .hljs-meta .hljs-keyword{color:#ff7b72}div.cs-message__html-content .hljs .hljs-subst{color:#c9d1d9}div.cs-message__html-content .hljs .hljs-section{color:#1f6feb;font-weight:700}div.cs-message__html-content .hljs .hljs-bullet{color:#f2cc60}div.cs-message__html-content .hljs .hljs-emphasis{color:#c9d1d9;font-style:italic}div.cs-message__html-content .hljs .hljs-strong{color:#c9d1d9;font-weight:700}div.cs-message__html-content .hljs .hljs-addition{color:#aff5b4;background-color:#033a16}div.cs-message__html-content .hljs .hljs-deletion{color:#ffdcd7;background-color:#67060c}div.cs-message__html-content blockquote{opacity:.85;border-left:3px solid #00000040;padding:0 0 0 .8em}div.cs-message__html-content table{border-collapse:collapse;max-width:100%;display:block;overflow-x:auto}div.cs-message__html-content :is(th,td){text-align:left;border:1px solid #0003;padding:.25em .6em}div.cs-message__html-content th{background-color:#0000000d;font-weight:700}div.cs-message__html-content hr{border:0;border-top:1px solid #0003;margin:.6em 0}div.cs-message__html-content a{text-decoration:underline!important}div.cs-message__html-content a:hover{color:orange;text-decoration:underline}section.smarter-message .cs-message__content{text-align:left;background-color:#ffebcd;border:1px solid brown;border-radius:10px;margin-top:10px;margin-bottom:10px;font-family:Courier New,Courier,monospace;font-weight:700;color:brown!important}section.smarter-error-message .cs-message__content{text-align:left;background-color:#f5f5f5;border:3px solid #dc143c;border-radius:10px;margin-top:10px;margin-bottom:10px;font-family:Courier New,Courier,monospace;position:relative;color:#000!important}section.smarter-progress-message .cs-message__content{text-align:left;background-color:#fff4dc;border:2px dashed #d2691e;border-radius:10px;align-items:center;gap:.75em;margin-top:10px;margin-bottom:10px;padding:.8em 1.1em;font-family:Courier New,Courier,monospace;font-size:1.15em;font-style:italic;font-weight:700;display:flex;color:#8a3b12!important}section.smarter-progress-message .cs-message__content:before{content:"";box-sizing:border-box;flex:none;width:1.2em;height:1.2em}section.smarter-progress-message-active .cs-message__content{animation:1.6s ease-in-out infinite smarter-progress-pulse}section.smarter-progress-message-active .cs-message__content:before{border:3px solid #d2691e40;border-top-color:#d2691e;border-radius:50%;animation:.8s linear infinite smarter-progress-spin}section.smarter-progress-message-done .cs-message__content{opacity:.7}section.smarter-progress-message-done .cs-message__content:before{content:"✓";color:#d2691e;text-align:center;font-style:normal;line-height:1.2em}@keyframes smarter-progress-spin{to{transform:rotate(360deg)}}@keyframes smarter-progress-pulse{0%,to{border-color:#d2691e;box-shadow:0 0 #d2691e73}50%{border-color:#ff8c1a;box-shadow:0 0 0 5px #d2691e00}}@media (prefers-reduced-motion:reduce){section.smarter-progress-message-active .cs-message__content,section.smarter-progress-message-active .cs-message__content:before{animation:none}}div.cs-message__html-content img.smarter-chat-image{object-fit:contain;border-radius:6px;width:auto;max-width:min(100%,480px);height:auto;max-height:360px;margin:4px 0;display:block}.SmarterChat .cs-message div.cs-message__html-content a:has(>img.smarter-chat-image){filter:none}section.system-message .cs-message__content{background-color:#272822;border:1px solid brown;border-radius:10px;margin-top:10px;margin-bottom:10px;font-family:Courier New,Courier,monospace;font-weight:700;color:beige!important}.smarter-chat-error-boundary{color:#dc143c;padding:1rem}`);function tT(e){return e===Nf.SMARTER?`smarter-message`:e===Nf.SMARTER_ERROR?`smarter-error-message`:e===Nf.TOOL||e===Nf.SYSTEM?`system-message`:``}function nT(e){return Iw(e.message,Nf.SMARTER).message}function rT({apiUrl:e,apiKey:t=null,toggleMetadata:n=!1,csrfCookieName:r=`csrftoken`,csrftoken:i=null,debugCookieName:a=`debug`,debugCookieExpiration:o=g,debugMode:s=!1,sessionCookieName:c=`session_key`,sessionCookieExpiration:l=g,cookiePath:u=null,cookieDomain:d=``,smarterRequestId:f=``,streamProgress:_=!0,language:v=null,verbose:y=!1,reloadKey:b,headerActions:x=null,onConfig:S,onNewChat:C,onModeChange:w}){let T=Kf(v),[E,D]=(0,A.useState)(null),[O,k]=(0,A.useState)(null),[ee,j]=(0,A.useState)([]),[te,M]=(0,A.useState)(n),[ne,re]=(0,A.useState)(!1),[ie,ae]=(0,A.useState)([]),[oe,se]=(0,A.useState)(new Set),ce=(0,A.useRef)(null),le=(0,A.useRef)(null),[ue,de]=(0,A.useState)(!1),fe=(0,A.useRef)(0),pe=(0,A.useMemo)(()=>({csrfCookie:jf(r,null,d,i),sessionCookie:jf(c,l,d,null,u),debugCookie:jf(a,o,d,null,u)}),[r,i,d,c,l,u,a,o]),me=(0,A.useMemo)(()=>({smarterClient:p,smarterClientVersion:m,smarterRequestId:f,apiKey:t}),[f,t]),he=(0,A.useCallback)((...e)=>{(s||E?.debug_mode)&&console.log(h,...e)},[s,E?.debug_mode]),ge=(0,A.useCallback)(async()=>{let t=++fe.current,n=await mp(e,pe,me,y);return t===fe.current&&(D(n),de(y)),n},[e,pe,me,y]);(0,A.useEffect)(()=>{y&&E&&!ue&&ge().catch(e=>console.error(`${h} Failed to refresh:`,e))},[y,E,ue,ge]);let _e=(0,A.useRef)(b);(0,A.useEffect)(()=>{b!==_e.current&&(_e.current=b,ge().catch(e=>console.error(`${h} Failed to refresh:`,e)))},[b,ge]),(0,A.useEffect)(()=>{E&&S?.(E)},[E,S]),(0,A.useEffect)(()=>{w?.(te)},[te,w]);let N=(0,A.useCallback)(async()=>{try{k(null);let e=await ge(),t=e.llmclient,r=Bw(t.app_welcome_message??``,t.default_system_role??``,t.app_example_prompts,e.history?.chat_history);j(Hw(r,n,Ff)),M(n),re(!1),he(`chat started`,e)}catch(e){console.error(`${h} Failed to fetch the configuration:`,e),k(e instanceof Error?e.message:String(e))}},[ge,he,n]);(0,A.useEffect)(()=>{N()},[e]),(0,A.useEffect)(()=>{let e=le.current?.querySelector(`.cs-message-input__content-editor`);e?.setAttribute(`role`,`textbox`),e?.setAttribute(`aria-multiline`,`true`),e?.setAttribute(`aria-label`,Zf(`Message`))},[T]),(0,A.useEffect)(()=>{let e=le.current,t=e=>Cm(e.target)||xg(e.target);return e?.addEventListener(`click`,t),()=>e?.removeEventListener(`click`,t)},[]),(0,A.useEffect)(()=>{let e=le.current,t=e=>{if(Ow(e.target))return;let t=e.target;if(!(t instanceof HTMLImageElement)||!t.closest(`.cs-avatar`))return;let n=t.getAttribute(`src`)??``;se(e=>e.has(n)?e:new Set(e).add(n))};return e?.addEventListener(`error`,t,!0),()=>e?.removeEventListener(`error`,t,!0)},[]),(0,A.useLayoutEffect)(()=>{bg(le.current)},[ee,te]);let P=()=>{Af(pe.sessionCookie,``),D(null),C?.(),N()},ve=e=>{e!==te&&(M(e),j(t=>Hw(t,e,Ff)))};async function ye(e){if(!E)return;let t=[...ee,Iw(e,Nf.USER)];j(t),re(!0),ae([]);let n=_?e=>{he(`prompt progress`,e),ae(t=>[...t,e])}:void 0;try{let e=await wp(E,Vw(t),pe,me,n),r=e.messages.map(e=>{let t=Iw(e.content,e.role,e);return Ff.includes(t.sender)&&!te?{...t,display:!1}:t});j(e=>[...e,...r]),he(`prompt response`,e),y?await ge().catch(e=>console.error(`${h} Failed to refresh:`,e)):de(!1)}catch(e){console.error(`${h} Prompt failed:`,e);let t=e instanceof Error?e.message:String(e);j(e=>[...e,Iw(t,Nf.SMARTER_ERROR)])}finally{re(!1),ae([])}}let be=(e,t,n)=>{let r=n??t??Uw(e);r.trim()&&ye(r)},xe=e=>{let t=e.target.files?.[0];t&&(t.text().then(e=>void ye(e)),e.target.value=``)},F=E?.llmclient,Se=!!E,Ce=F?.styles,we=(0,A.useMemo)(()=>Mg(Ce),[Ce]);Ng(Ce?.google_font);let Te=e=>{let t=kg(e);return t&&!oe.has(t)?t:null},Ee=Te(Ce?.app_logo_url),De=Te(Ce?.assistant_avatar_url),Oe=Te(Ce?.user_avatar_url),ke=F?`${F.app_name} v${F.version||`1.0.0`}`:``,Ae=F?.total_tools??0,je=``;F&&Ae>0?je=ep(Qf(`%(provider)s %(model)s with %(count)s additional tool`,`%(provider)s %(model)s with %(count)s additional tools`,Ae),{provider:F.provider,model:F.default_model,count:Ae}):F&&(je=`${F.provider} ${F.default_model}`);let Ne=E?.meta_data?.is_valid??E?.meta_data?.ready??!0,Pe=!!(E?.meta_data?.is_deployed??F?.deployed),Fe=F?.app_assistant??Zf(`Assistant`);function Ie(e){return e.sender===Nf.ASSISTANT&&De?(0,R.jsx)(Me,{src:De,name:Fe}):e.sender===Nf.USER&&Oe?(0,R.jsx)(Me,{src:Oe,name:Zf(`You`)}):null}let Le=ie.at(-1)?.message,Re=Le?ep(Zf(`%(assistant)s: %(step)s`),{assistant:Fe,step:Le}):ep(Zf(`%(assistant)s is typing`),{assistant:Fe}),ze;return ze=O?Zf(`Smarter Chat is not available`):Se?(0,R.jsx)(Yw,{title:ke,isReady:Se,isValid:Ne,isDeployed:Pe}):Zf(`Configuring workbench...`),(0,R.jsx)(`div`,{id:`smarter_chat_component_container`,className:`SmarterChat`,style:we,children:(0,R.jsx)(`div`,{className:`smarter-chat-container`,children:(0,R.jsx)(`div`,{role:`region`,"aria-label":Zf(`Chat`),className:`smarter-chat-app`,children:(0,R.jsxs)(`div`,{className:`chat-app`,ref:le,children:[(0,R.jsx)(Xw,{children:(0,R.jsx)(Gd,{style:{width:`100%`,height:`100%`},children:(0,R.jsxs)(Pd,{className:`smarter-chat-container-inner`,children:[(0,R.jsxs)(gs,{children:[Ee&&Se&&(0,R.jsx)(Me,{className:`smarter-chat-logo`,src:Ee,name:F?.app_name??``}),(0,R.jsx)(gs.Content,{userName:ze,info:Se?je:``}),(0,R.jsxs)(gs.Actions,{children:[n&&(0,R.jsxs)(`div`,{role:`group`,"aria-label":Zf(`Chat mode`),className:`smarter-chat-mode-toggle`,children:[(0,R.jsx)(et,{className:`smarter-chat-toolbar-button smarter-chat-mode-option`,icon:(0,R.jsx)($w,{}),"aria-pressed":te,onClick:()=>ve(!0),title:Zf(`Sandbox mode: Smarter's system, tool and meta data messages are displayed.`),children:(0,R.jsx)(`span`,{className:`smarter-chat-toolbar-label`,children:$f(`chat mode`,`Sandbox`)})}),(0,R.jsx)(et,{className:`smarter-chat-toolbar-button smarter-chat-mode-option`,icon:(0,R.jsx)(eT,{}),"aria-pressed":!te,onClick:()=>ve(!1),title:Zf(`Production mode: the conversation is displayed as its users see it.`),children:(0,R.jsx)(`span`,{className:`smarter-chat-toolbar-label`,children:$f(`chat mode`,`Production`)})})]}),(0,R.jsx)(et,{className:`smarter-chat-toolbar-button`,icon:(0,R.jsx)(Qw,{}),onClick:P,title:Zf(`Start a new chat`),"aria-label":Zf(`Start a new chat`)}),x]})]}),(0,R.jsxs)(wu,{className:`smarter-chat-message-list`,scrollBehavior:`auto`,typingIndicator:ne?(0,R.jsx)(_f,{content:Re}):null,children:[O&&(0,R.jsx)(ll,{className:`smarter-error-message`,model:{message:Iw(O,Nf.SMARTER_ERROR).message,direction:`incoming`,position:`single`,sender:Nf.SMARTER_ERROR}}),ee.map((e,t)=>e.display?(0,R.jsx)(ll,{className:tT(e.sender),model:{message:e.message,sentTime:e.sentTime,sender:e.sender,direction:e.direction,position:`single`},children:Ie(e)},t):null),te&&ie.map((e,t)=>(0,R.jsx)(ll,{className:`smarter-progress-message ${t===ie.length-1?`smarter-progress-message-active`:`smarter-progress-message-done`}`,model:{message:nT(e),sender:Nf.SMARTER,direction:`incoming`,position:`single`}},`progress-${t}`))]}),(0,R.jsx)(_d,{placeholder:F?.app_placeholder??``,onSend:be,onAttachClick:()=>ce.current?.click(),attachButton:!!F?.app_file_attachment,disabled:!Se,fancyScroll:!1,onPaste:Tm})]})})}),(0,R.jsx)(`input`,{type:`file`,accept:`.py,.txt,.md,.json,.yaml,.yml,.csv`,"aria-label":Zf(`Attach a file`),ref:ce,style:{display:`none`},onChange:xe})]})})})})}var iT=rT,aT=`smarter-chat-embed-panel`;function oT({options:e}){return(0,R.jsx)(iT,{apiUrl:e.chatbot,apiKey:e.apiKey,toggleMetadata:!1,debugMode:e.debug,streamProgress:e.streamProgress,sessionCookieName:e.sessionCookieName,debugCookieName:`${e.sessionCookieName}_debug`,cookiePath:e.cookiePath,language:e.language},e.chatbot)}function sT(){return(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`28`,height:`28`,"aria-hidden":`true`,focusable:`false`,children:(0,R.jsx)(`path`,{fill:`currentColor`,d:`M4 3h16a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H8.4L4 21.5V18a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm3 6.5a1.5 1.5 0 1 0 0 .01Zm5 0a1.5 1.5 0 1 0 0 .01Zm5 0a1.5 1.5 0 1 0 0 .01Z`})})}function cT(){return(0,R.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`24`,height:`24`,"aria-hidden":`true`,focusable:`false`,children:(0,R.jsx)(`path`,{fill:`currentColor`,d:`M5.3 5.3a1 1 0 0 1 1.4 0L12 10.6l5.3-5.3a1 1 0 1 1 1.4 1.4L13.4 12l5.3 5.3a1 1 0 0 1-1.4 1.4L12 13.4l-5.3 5.3a1 1 0 0 1-1.4-1.4l5.3-5.3-5.3-5.3a1 1 0 0 1 0-1.4Z`})})}function lT({options:e,open:t,onOpenChange:n}){Kf(e.language);let r=e.label??Zf(`Chat`),[i,a]=(0,A.useState)(t);t&&!i&&a(!0);let o=(0,A.useRef)(null),s=(0,A.useRef)(null);return(0,A.useEffect)(()=>{let e=s.current,t=e=>{e.key===`Escape`&&(n(!1),o.current?.focus())};return e?.addEventListener(`keydown`,t),()=>e?.removeEventListener(`keydown`,t)},[n]),(0,R.jsxs)(`div`,{className:`smarter-chat-embed-launcher smarter-chat-embed-${e.position}`,style:{zIndex:e.zIndex,"--smarter-chat-embed-width":e.width,"--smarter-chat-embed-height":e.height},children:[(0,R.jsx)(`section`,{id:aT,part:`panel`,className:`smarter-chat-embed-panel`,"aria-label":r,hidden:!t,ref:s,children:i&&(0,R.jsx)(oT,{options:e})}),(0,R.jsx)(`button`,{ref:o,type:`button`,part:`launcher`,className:`smarter-chat-embed-button`,style:{background:e.color},"aria-label":t?ep(Zf(`Close %(label)s`),{label:r}):r,"aria-expanded":t,"aria-controls":aT,onClick:()=>n(!t),children:t?(0,R.jsx)(cT,{}):(0,R.jsx)(sT,{})})]})}function uT(e){let{options:t}=e;return t.mode===`launcher`?(0,R.jsx)(lT,{...e}):(0,R.jsx)(`div`,{part:`chat`,className:`smarter-chat-embed-inline`,style:{width:t.width,height:t.height},children:(0,R.jsx)(oT,{options:t})})}var dT=[`chatbot`,`api-key`,`mode`,`position`,`open`,`label`,`color`,`width`,`height`,`z-index`,`session-cookie-name`,`cookie-path`,`stream-progress`,`debug`,`language`],fT=2147483e3,pT={launcher:{width:`400px`,height:`600px`},inline:{width:`100%`,height:`600px`}};function mT(e,t){if(e==null)return t;let n=e.trim().toLowerCase();return n===``||n===`true`||n!==`false`&&t}function hT(e){if(!e?.trim())return null;try{let t=new URL(e.trim());return t.protocol!==`https:`&&t.protocol!==`http:`?null:(t.pathname.endsWith(`/`)||(t.pathname=`${t.pathname}/`),t.toString())}catch{return null}}function gT(e){return`smarter_chat_${new URL(e).host.replace(/[^A-Za-z0-9]/g,`_`)}`}function _T(e,t=`inline`){let n=hT(e(`chatbot`));if(!n)return{options:null,error:`"chatbot" must be the http(s) url of a deployed LLMClient, not ${JSON.stringify(e(`chatbot`))}.`};let r=e(`mode`)?.trim().toLowerCase(),i=r===`launcher`||r===`inline`?r:t,a=e(`position`)?.trim().toLowerCase()===`bottom-left`?`bottom-left`:`bottom-right`,o=Number.parseInt(e(`z-index`)??``,10),s=e(`cookie-path`)?.trim(),c=e(`session-cookie-name`)?.trim();return{error:null,options:{chatbot:n,apiKey:e(`api-key`)?.trim()||null,mode:i,position:a,open:mT(e(`open`),!1),label:e(`label`)?.trim()||null,color:Og(e(`color`))??`#ff5733`,width:Og(e(`width`))??pT[i].width,height:Og(e(`height`))??pT[i].height,zIndex:Number.isFinite(o)?o:fT,sessionCookieName:c&&/^[A-Za-z0-9_.-]+$/.test(c)?c:gT(n),cookiePath:s?.startsWith(`/`)?s:`/`,streamProgress:mT(e(`stream-progress`),!0),debug:mT(e(`debug`),!1),language:e(`language`)?.trim()||null}}}function vT(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function yT(e){let t={};for(let[n,r]of Object.entries(e))(typeof r==`string`||typeof r==`number`||typeof r==`boolean`)&&(t[vT(n)]=String(r));return t}var bT=`smarter-chat`,xT=`smarter-chat-toggle`,ST=class extends HTMLElement{static observedAttributes=[...dT];#e=null;#t=null;#n=null;#r=null;get options(){return _T(e=>this.getAttribute(e),`inline`)}get isOpen(){return this.#n??this.options.options?.open??!1}connectedCallback(){let e=this.shadowRoot;if(!e){e=this.attachShadow({mode:`open`});let t=ie();ce(e,t),oe(t,this.ownerDocument)}this.#t=this.ownerDocument.createElement(`div`),e.append(this.#t),this.#e=(0,ee.createRoot)(this.#t),this.#a()}disconnectedCallback(){this.#e?.unmount(),this.#e=null,this.#t?.remove(),this.#t=null}attributeChangedCallback(){this.#a()}open(){this.#i(!0)}close(){this.#i(!1)}toggle(){this.#i(!this.isOpen)}#i(e){e!==this.isOpen&&(this.#n=e,this.#a(),this.dispatchEvent(new CustomEvent(xT,{detail:{open:e},bubbles:!0,composed:!0})))}#a(){if(!this.#e)return;let{options:e,error:t}=this.options;if(!e){t!==this.#r&&console.error(`${h} <${bT}>: ${t}`),this.#r=t,this.#e.render(null);return}this.#r=null,this.#e.render((0,A.createElement)(uT,{options:e,open:this.isOpen,onOpenChange:e=>this.#i(e)}))}};function CT(e=customElements){e.get(`smarter-chat`)||e.define(bT,ST)}var wT=`data-smarter-chat-auto`;function TT(e,t){let n=[];e instanceof HTMLElement&&e.dataset.chatbot&&n.push(yT({...e.dataset}));for(let e of[t??[]].flat())e&&typeof e==`object`&&n.push(yT(e));return n}function ET(e,t=document){let{target:n,...r}=e,i=r.chatbot??``;if([...t.querySelectorAll(`smarter-chat[data-smarter-chat-auto]`)].find(e=>e.getAttribute(`data-smarter-chat-auto`)===i))return null;let a=t.body;if(n){try{a=t.querySelector(n)}catch{a=null}if(!a)return console.error(`${h} SmarterChatConfig.target: no element matches ${JSON.stringify(n)}.`),null}let o=t.createElement(bT);o.setAttribute(`mode`,r.mode??(n?`inline`:`launcher`));for(let[e,t]of Object.entries(r))/^[a-z][a-z0-9-]*$/.test(e)&&o.setAttribute(e,t);return o.setAttribute(wT,i),a.append(o),o}function DT(e,t,n=document){let r=TT(e,t);if(r.length===0)return;let i=()=>r.forEach(e=>ET(e,n));n.body?i():n.addEventListener(`DOMContentLoaded`,i,{once:!0})}re(`:host{all:initial;color:#212529;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:16px;line-height:1.5;display:block}:host([hidden]){display:none}.smarter-chat-embed-inline{box-sizing:border-box;background:#fff;max-width:100%}.smarter-chat-embed-launcher{position:fixed;bottom:20px}.smarter-chat-embed-bottom-right{right:20px}.smarter-chat-embed-bottom-left{left:20px}.smarter-chat-embed-button{color:#fff;cursor:pointer;border:none;border-radius:50%;justify-content:center;align-items:center;width:56px;height:56px;margin:0;padding:0;transition:transform .15s ease-in-out;display:flex;box-shadow:0 4px 14px #00000040}.smarter-chat-embed-bottom-left .smarter-chat-embed-button{margin-right:auto}.smarter-chat-embed-bottom-right .smarter-chat-embed-button{margin-left:auto}.smarter-chat-embed-button:hover{transform:scale(1.06)}.smarter-chat-embed-button:focus-visible{outline-offset:3px;outline:3px solid #1a73e8}.smarter-chat-embed-panel{box-sizing:border-box;width:var(--smarter-chat-embed-width,400px);max-width:calc(100vw - 40px);height:var(--smarter-chat-embed-height,600px);background:#fff;border-radius:12px;max-height:calc(100vh - 116px);margin-bottom:16px;overflow:hidden;box-shadow:0 8px 32px #00000040}.smarter-chat-embed-panel[hidden]{display:none}@media (width<=480px){.smarter-chat-embed-launcher{bottom:12px}.smarter-chat-embed-bottom-right{right:12px}.smarter-chat-embed-bottom-left{left:12px}.smarter-chat-embed-panel{border-radius:0;width:auto;max-width:none;height:auto;max-height:none;margin:0;position:fixed;inset:0 0 80px}}@media (prefers-reduced-motion:reduce){.smarter-chat-embed-button{transition:none}}`);function OT(e){return[...document.querySelectorAll(bT)].filter(t=>t.options.options?.mode===`launcher`&&(!e||t.options.options.chatbot.startsWith(e)))}b(document.currentScript),CT(),window.SmarterChat={version:m,open:e=>OT(e).forEach(e=>e.open()),close:e=>OT(e).forEach(e=>e.close()),toggle:e=>OT(e).forEach(e=>e.toggle()),mount:e=>ET(yT(e))},DT(document.currentScript,window.SmarterChatConfig)})();
893
893
  //# sourceMappingURL=embed.js.map