@helpai/elements 0.12.0 → 0.12.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/elements.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- var Ws=Object.defineProperty;var Ks=(e,t,n)=>t in e?Ws(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var W=(e,t,n)=>Ks(e,typeof t!="symbol"?t+"":t,n);var Wt,H,Pr,to,De,hr,yr,Sr,Jn,Bt,ft,wr,no,Qn,Zn,Gs,Ut={},zt=[],Vs=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Kt=Array.isArray;function Te(e,t){for(var n in t)e[n]=t[n];return e}function oo(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Gt(e,t,n){var o,i,a,s={};for(a in t)a=="key"?o=t[a]:a=="ref"?i=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?Wt.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)s[a]===void 0&&(s[a]=e.defaultProps[a]);return $t(e,s,o,i,null)}function $t(e,t,n,o,i){var a={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Pr,__i:-1,__u:0};return i==null&&H.vnode!=null&&H.vnode(a),a}function ee(e){return e.children}function He(e,t){this.props=e,this.context=t}function Qe(e,t){if(t==null)return e.__?Qe(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Qe(e):null}function qs(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],i=[],a=Te({},t);a.__v=t.__v+1,H.vnode&&H.vnode(a),ro(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??Qe(t),!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,Ar(o,a,i),t.__e=t.__=null,a.__e!=n&&kr(a)}}function kr(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),kr(e)}function vr(e){(!e.__d&&(e.__d=!0)&&De.push(e)&&!Ft.__r++||hr!=H.debounceRendering)&&((hr=H.debounceRendering)||yr)(Ft)}function Ft(){try{for(var e,t=1;De.length;)De.length>t&&De.sort(Sr),e=De.shift(),t=De.length,qs(e)}finally{De.length=Ft.__r=0}}function Er(e,t,n,o,i,a,s,l,c,_,p){var d,u,g,m,f,b,x,y=o&&o.__k||zt,A=t.length;for(c=Xs(n,t,y,c,A),d=0;d<A;d++)(g=n.__k[d])!=null&&(u=g.__i!=-1&&y[g.__i]||Ut,g.__i=d,b=ro(e,g,u,i,a,s,l,c,_,p),m=g.__e,g.ref&&u.ref!=g.ref&&(u.ref&&io(u.ref,null,g),p.push(g.ref,g.__c||m,g)),f==null&&m!=null&&(f=m),(x=!!(4&g.__u))||u.__k===g.__k?(c=Cr(g,c,e,x),x&&u.__e&&(u.__e=null)):typeof g.type=="function"&&b!==void 0?c=b:m&&(c=m.nextSibling),g.__u&=-7);return n.__e=f,c}function Xs(e,t,n,o,i){var a,s,l,c,_,p=n.length,d=p,u=0;for(e.__k=new Array(i),a=0;a<i;a++)(s=t[a])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[a]=$t(null,s,null,null,null):Kt(s)?s=e.__k[a]=$t(ee,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[a]=$t(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[a]=s,c=a+u,s.__=e,s.__b=e.__b+1,l=null,(_=s.__i=js(s,n,c,d))!=-1&&(d--,(l=n[_])&&(l.__u|=2)),l==null||l.__v==null?(_==-1&&(i>p?u--:i<p&&u++),typeof s.type!="function"&&(s.__u|=4)):_!=c&&(_==c-1?u--:_==c+1?u++:(_>c?u--:u++,s.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<p;a++)(l=n[a])!=null&&(2&l.__u)==0&&(l.__e==o&&(o=Qe(l)),Ir(l,l));return o}function Cr(e,t,n,o){var i,a;if(typeof e.type=="function"){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=Cr(i[a],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Qe(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function js(e,t,n,o){var i,a,s,l=e.key,c=e.type,_=t[n],p=_!=null&&(2&_.__u)==0;if(_===null&&l==null||p&&l==_.key&&c==_.type)return n;if(o>(p?1:0)){for(i=n-1,a=n+1;i>=0||a<t.length;)if((_=t[s=i>=0?i--:a++])!=null&&(2&_.__u)==0&&l==_.key&&c==_.type)return s}return-1}function br(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Vs.test(t)?n:n+"px"}function Ht(e,t,n,o,i){var a,s;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||br(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||br(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")a=t!=(t=t.replace(wr,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?o?n[ft]=o[ft]:(n[ft]=no,e.addEventListener(t,a?Zn:Qn,a)):e.removeEventListener(t,a?Zn:Qn,a);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function xr(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[Bt]==null)t[Bt]=no++;else if(t[Bt]<n[ft])return;return n(H.event?H.event(t):t)}}}function ro(e,t,n,o,i,a,s,l,c,_){var p,d,u,g,m,f,b,x,y,A,j,U,oe,O,le,B=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[l=t.__e=n.__e]),(p=H.__b)&&p(t);e:if(typeof B=="function")try{if(x=t.props,y=B.prototype&&B.prototype.render,A=(p=B.contextType)&&o[p.__c],j=p?A?A.props.value:p.__:o,n.__c?b=(d=t.__c=n.__c).__=d.__E:(y?t.__c=d=new B(x,j):(t.__c=d=new He(x,j),d.constructor=B,d.render=Js),A&&A.sub(d),d.state||(d.state={}),d.__n=o,u=d.__d=!0,d.__h=[],d._sb=[]),y&&d.__s==null&&(d.__s=d.state),y&&B.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=Te({},d.__s)),Te(d.__s,B.getDerivedStateFromProps(x,d.__s))),g=d.props,m=d.state,d.__v=t,u)y&&B.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),y&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(y&&B.getDerivedStateFromProps==null&&x!==g&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(x,j),t.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(x,d.__s,j)===!1){t.__v!=n.__v&&(d.props=x,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(R){R&&(R.__=t)}),zt.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(x,d.__s,j),y&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(g,m,f)})}if(d.context=j,d.props=x,d.__P=e,d.__e=!1,U=H.__r,oe=0,y)d.state=d.__s,d.__d=!1,U&&U(t),p=d.render(d.props,d.state,d.context),zt.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,U&&U(t),p=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++oe<25);d.state=d.__s,d.getChildContext!=null&&(o=Te(Te({},o),d.getChildContext())),y&&!u&&d.getSnapshotBeforeUpdate!=null&&(f=d.getSnapshotBeforeUpdate(g,m)),O=p!=null&&p.type===ee&&p.key==null?Tr(p.props.children):p,l=Er(e,Kt(O)?O:[O],t,n,o,i,a,s,l,c,_),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),b&&(d.__E=d.__=null)}catch(R){if(t.__v=null,c||a!=null)if(R.then){for(t.__u|=c?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;a[a.indexOf(l)]=null,t.__e=l}else{for(le=a.length;le--;)oo(a[le]);eo(t)}else t.__e=n.__e,t.__k=n.__k,R.then||eo(t);H.__e(R,t,n)}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=Ys(n.__e,t,n,o,i,a,s,c,_);return(p=H.diffed)&&p(t),128&t.__u?void 0:l}function eo(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(eo))}function Ar(e,t,n){for(var o=0;o<n.length;o++)io(n[o],n[++o],n[++o]);H.__c&&H.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(a){a.call(i)})}catch(a){H.__e(a,i.__v)}})}function Tr(e){return typeof e!="object"||e==null||e.__b>0?e:Kt(e)?e.map(Tr):e.constructor!==void 0?null:Te({},e)}function Ys(e,t,n,o,i,a,s,l,c){var _,p,d,u,g,m,f,b=n.props||Ut,x=t.props,y=t.type;if(y=="svg"?i="http://www.w3.org/2000/svg":y=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),a!=null){for(_=0;_<a.length;_++)if((g=a[_])&&"setAttribute"in g==!!y&&(y?g.localName==y:g.nodeType==3)){e=g,a[_]=null;break}}if(e==null){if(y==null)return document.createTextNode(x);e=document.createElementNS(i,y,x.is&&x),l&&(H.__m&&H.__m(t,a),l=!1),a=null}if(y==null)b===x||l&&e.data==x||(e.data=x);else{if(a=y=="textarea"&&x.defaultValue!=null?null:a&&Wt.call(e.childNodes),!l&&a!=null)for(b={},_=0;_<e.attributes.length;_++)b[(g=e.attributes[_]).name]=g.value;for(_ in b)g=b[_],_=="dangerouslySetInnerHTML"?d=g:_=="children"||_ in x||_=="value"&&"defaultValue"in x||_=="checked"&&"defaultChecked"in x||Ht(e,_,null,g,i);for(_ in x)g=x[_],_=="children"?u=g:_=="dangerouslySetInnerHTML"?p=g:_=="value"?m=g:_=="checked"?f=g:l&&typeof g!="function"||b[_]===g||Ht(e,_,g,b[_],i);if(p)l||d&&(p.__html==d.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(d&&(e.innerHTML=""),Er(t.type=="template"?e.content:e,Kt(u)?u:[u],t,n,o,y=="foreignObject"?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:n.__k&&Qe(n,0),l,c),a!=null)for(_=a.length;_--;)oo(a[_]);l&&y!="textarea"||(_="value",y=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[_]||y=="progress"&&!m||y=="option"&&m!=b[_])&&Ht(e,_,m,b[_],i),_="checked",f!=null&&f!=e[_]&&Ht(e,_,f,b[_],i))}return e}function io(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(i){H.__e(i,n)}}function Ir(e,t,n){var o,i;if(H.unmount&&H.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||io(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(a){H.__e(a,t)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&Ir(o[i],t,n||typeof e.type!="function");n||oo(e.__e),e.__c=e.__=e.__e=void 0}function Js(e,t,n){return this.constructor(e,n)}function ao(e,t,n){var o,i,a,s;t==document&&(t=document.documentElement),H.__&&H.__(e,t),i=(o=typeof n=="function")?null:n&&n.__k||t.__k,a=[],s=[],ro(t,e=(!o&&n||t).__k=Gt(ee,null,[e]),i||Ut,Ut,t.namespaceURI,!o&&n?[n]:i?null:t.firstChild?Wt.call(t.childNodes):null,a,!o&&n?n:i?i.__e:t.firstChild,o,s),Ar(a,e,s)}Wt=zt.slice,H={__e:function(e,t,n,o){for(var i,a,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,o||{}),s=i.__d),s)return i.__E=i}catch(l){e=l}throw e}},Pr=0,to=function(e){return e!=null&&e.constructor===void 0},He.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Te({},this.state),typeof e=="function"&&(e=e(Te({},n),this.props)),e&&Te(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),vr(this))},He.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),vr(this))},He.prototype.render=ee,De=[],yr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Sr=function(e,t){return e.__v.__b-t.__v.__b},Ft.__r=0,Jn=Math.random().toString(8),Bt="__d"+Jn,ft="__a"+Jn,wr=/(PointerCapture)$|Capture$/i,no=0,Qn=xr(!1),Zn=xr(!0),Gs=0;var Ze,Q,so,Rr,gt=0,$r=[],te=H,Mr=te.__b,Lr=te.__r,Nr=te.diffed,Or=te.__c,Dr=te.unmount,Hr=te.__;function qt(e,t){te.__h&&te.__h(Q,e,gt||t),gt=0;var n=Q.__H||(Q.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function w(e){return gt=1,Qs(zr,e)}function Qs(e,t,n){var o=qt(Ze++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):zr(void 0,t),function(l){var c=o.__N?o.__N[0]:o.__[0],_=o.t(c,l);c!==_&&(o.__N=[_,o.__[1]],o.__c.setState({}))}],o.__c=Q,!Q.__f)){var i=function(l,c,_){if(!o.__c.__H)return!0;var p=o.__c.__H.__.filter(function(u){return u.__c});if(p.every(function(u){return!u.__N}))return!a||a.call(this,l,c,_);var d=o.__c.props!==l;return p.some(function(u){if(u.__N){var g=u.__[0];u.__=u.__N,u.__N=void 0,g!==u.__[0]&&(d=!0)}}),a&&a.call(this,l,c,_)||d};Q.__f=!0;var a=Q.shouldComponentUpdate,s=Q.componentWillUpdate;Q.componentWillUpdate=function(l,c,_){if(this.__e){var p=a;a=void 0,i(l,c,_),a=p}s&&s.call(this,l,c,_)},Q.shouldComponentUpdate=i}return o.__N||o.__}function S(e,t){var n=qt(Ze++,3);!te.__s&&co(n.__H,t)&&(n.__=e,n.u=t,Q.__H.__h.push(n))}function Ur(e,t){var n=qt(Ze++,4);!te.__s&&co(n.__H,t)&&(n.__=e,n.u=t,Q.__h.push(n))}function N(e){return gt=5,me(function(){return{current:e}},[])}function me(e,t){var n=qt(Ze++,7);return co(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function D(e,t){return gt=8,me(function(){return e},t)}function Zs(){for(var e;e=$r.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Vt),t.__h.some(lo),t.__h=[]}catch(n){t.__h=[],te.__e(n,e.__v)}}}te.__b=function(e){Q=null,Mr&&Mr(e)},te.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Hr&&Hr(e,t)},te.__r=function(e){Lr&&Lr(e),Ze=0;var t=(Q=e.__c).__H;t&&(so===Q?(t.__h=[],Q.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(Vt),t.__h.some(lo),t.__h=[],Ze=0)),so=Q},te.diffed=function(e){Nr&&Nr(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&($r.push(t)!==1&&Rr===te.requestAnimationFrame||((Rr=te.requestAnimationFrame)||el)(Zs)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),so=Q=null},te.__c=function(e,t){t.some(function(n){try{n.__h.some(Vt),n.__h=n.__h.filter(function(o){return!o.__||lo(o)})}catch(o){t.some(function(i){i.__h&&(i.__h=[])}),t=[],te.__e(o,n.__v)}}),Or&&Or(e,t)},te.unmount=function(e){Dr&&Dr(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{Vt(o)}catch(i){t=i}}),n.__H=void 0,t&&te.__e(t,n.__v))};var Br=typeof requestAnimationFrame=="function";function el(e){var t,n=function(){clearTimeout(o),Br&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);Br&&(t=requestAnimationFrame(n))}function Vt(e){var t=Q,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Q=t}function lo(e){var t=Q;e.__c=e.__(),Q=t}function co(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function zr(e,t){return typeof t=="function"?t(e):t}var tl=Symbol.for("preact-signals");function Jt(){if(Ie>1)Ie--;else{var e,t=!1;for((function(){var i=jt;for(jt=void 0;i!==void 0;)i.S.v===i.v&&(i.S.i=i.i),i=i.o})();mt!==void 0;){var n=mt;for(mt=void 0,Xt++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Kr(n))try{n.c()}catch(i){t||(e=i,t=!0)}n=o}}if(Xt=0,Ie--,t)throw e}}function uo(e){if(Ie>0)return e();_o=++nl,Ie++;try{return e()}finally{Jt()}}var V=void 0;function Qt(e){var t=V;V=void 0;try{return e()}finally{V=t}}var Fr,mt=void 0,Ie=0,Xt=0,nl=0,_o=0,jt=void 0,Yt=0;function Wr(e){if(V!==void 0){var t=e.n;if(t===void 0||t.t!==V)return t={i:0,S:e,p:V.s,n:void 0,t:V,e:void 0,x:void 0,r:t},V.s!==void 0&&(V.s.n=t),V.s=t,e.n=t,32&V.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=V.s,t.n=void 0,V.s.n=t,V.s=t),t}}function ae(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}ae.prototype.brand=tl;ae.prototype.h=function(){return!0};ae.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:Qt(function(){var o;(o=t.W)==null||o.call(t)}))};ae.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,o=e.x;n!==void 0&&(n.x=o,e.e=void 0),o!==void 0&&(o.e=n,e.x=void 0),e===this.t&&(this.t=o,o===void 0&&Qt(function(){var i;(i=t.Z)==null||i.call(t)}))}};ae.prototype.subscribe=function(e){var t=this;return Re(function(){var n=t.value,o=V;V=void 0;try{e(n)}finally{V=o}},{name:"sub"})};ae.prototype.valueOf=function(){return this.value};ae.prototype.toString=function(){return this.value+""};ae.prototype.toJSON=function(){return this.value};ae.prototype.peek=function(){var e=this;return Qt(function(){return e.value})};Object.defineProperty(ae.prototype,"value",{get:function(){var e=Wr(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Xt>100)throw new Error("Cycle detected");(function(n){Ie!==0&&Xt===0&&n.l!==_o&&(n.l=_o,jt={S:n,v:n.v,i:n.i,o:jt})})(this),this.v=e,this.i++,Yt++,Ie++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Jt()}}}});function L(e,t){return new ae(e,t)}function Kr(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Gr(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Vr(e){for(var t=e.s,n=void 0;t!==void 0;){var o=t.p;t.i===-1?(t.S.U(t),o!==void 0&&(o.n=t.n),t.n!==void 0&&(t.n.p=o)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=o}e.s=n}function Fe(e,t){ae.call(this,void 0),this.x=e,this.s=void 0,this.g=Yt-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}Fe.prototype=new ae;Fe.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Yt))return!0;if(this.g=Yt,this.f|=1,this.i>0&&!Kr(this))return this.f&=-2,!0;var e=V;try{Gr(this),V=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return V=e,Vr(this),this.f&=-2,!0};Fe.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}ae.prototype.S.call(this,e)};Fe.prototype.U=function(e){if(this.t!==void 0&&(ae.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Fe.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Fe.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Wr(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function ht(e,t){return new Fe(e,t)}function qr(e){var t=e.m;if(e.m=void 0,typeof t=="function"){Ie++;var n=V;V=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,po(e),o}finally{V=n,Jt()}}}function po(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,qr(e)}function ol(e){if(V!==this)throw new Error("Out-of-order effect");Vr(this),V=e,this.f&=-2,8&this.f&&po(this),Jt()}function et(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Fr&&Fr.push(this)}et.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};et.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,qr(this),Gr(this),Ie++;var e=V;return V=this,ol.bind(this,e)};et.prototype.N=function(){2&this.f||(this.f|=2,this.u=mt,mt=this)};et.prototype.d=function(){this.f|=8,1&this.f||po(this)};et.prototype.dispose=function(){this.d()};function Re(e,t){var n=new et(e,t);try{n.c()}catch(i){throw n.d(),i}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var Xr,tn,Zt,rl=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var jr=[];Re(function(){Xr=this.N})();function tt(e,t){H[e]=t.bind(null,H[e]||function(){})}function en(e){if(Zt){var t=Zt;Zt=void 0,t()}Zt=e&&e.S()}function Yr(e){var t=this,n=e.data,o=vt(n);o.value=n;var i=me(function(){for(var l=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var _=ht(function(){var g=o.value.value;return g===0?0:g===!0?"":g||""}),p=ht(function(){return!Array.isArray(_.value)&&!to(_.value)}),d=Re(function(){if(this.N=Jr,p.value){var g=_.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=g)}}),u=t.__$u.d;return t.__$u.d=function(){d(),u.call(this)},[p,_]},[]),a=i[0],s=i[1];return a.value?s.peek():s.value}Yr.displayName="ReactiveTextNode";Object.defineProperties(ae.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Yr},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});tt("__b",function(e,t){if(typeof t.type=="string"){var n,o=t.props;for(var i in o)if(i!=="children"){var a=o[i];a instanceof ae&&(n||(t.__np=n={}),n[i]=a,o[i]=a.peek())}}e(t)});tt("__r",function(e,t){if(e(t),t.type!==ee){en();var n,o=t.__c;o&&(o.__$f&=-2,(n=o.__$u)===void 0&&(o.__$u=n=(function(i,a){var s;return Re(function(){s=this},{name:a}),s.c=i,s})(function(){var i;rl&&((i=n.y)==null||i.call(n)),o.__$f|=1,o.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),tn=o,en(n)}});tt("__e",function(e,t,n,o){en(),tn=void 0,e(t,n,o)});tt("diffed",function(e,t){en(),tn=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var o=t.__np,i=t.props;if(o){var a=n.U;if(a)for(var s in a){var l=a[s];l!==void 0&&!(s in o)&&(l.d(),a[s]=void 0)}else a={},n.U=a;for(var c in o){var _=a[c],p=o[c];_===void 0?(_=il(n,c,p),a[c]=_):_.o(p,i)}}}e(t)});function il(e,t,n,o){var i=t in e&&e.ownerSVGElement===void 0,a=L(n),s=n.peek();return{o:function(l,c){a.value=l,s=l.peek()},d:Re(function(){this.N=Jr;var l=a.value.value;s!==l?(s=void 0,i?e[t]=l:l!=null&&(l!==!1||t[4]==="-")?e.setAttribute(t,l):e.removeAttribute(t)):s=void 0})}}tt("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var o=n.U;if(o){n.U=void 0;for(var i in o){var a=o[i];a&&a.d()}}}var s=t.__np;if(s){var l=t.props;for(var c in s)l[c]=s[c]}t.__np=void 0}else{var _=t.__c;if(_){var p=_.__$u;p&&(_.__$u=void 0,p.d())}}e(t)});tt("__h",function(e,t,n,o){(o<3||o===9)&&(t.__$f|=2),e(t,n,o)});He.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,o=n&&n.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var a=2&this.__$f;if(!(o||a||4&this.__$f)||1&this.__$f)return!0}else if(!(o||4&this.__$f)||3&this.__$f)return!0;for(var s in e)if(s!=="__source"&&e[s]!==this.props[s])return!0;for(var l in this.props)if(!(l in e))return!0;return!1};function vt(e,t){return me(function(){return L(e,t)},[])}function Se(e,t){var n=N(e);return n.current=e,tn.__$f|=4,me(function(){return ht(function(){return n.current()},t)},[])}var al=function(e){queueMicrotask(function(){queueMicrotask(e)})};function sl(){uo(function(){for(var e;e=jr.shift();)Xr.call(e)})}function Jr(){jr.push(this)===1&&(H.requestAnimationFrame||al)(sl)}var v={id:"help-ai",name:"@helpai/elements",global:"HelpAI",tagName:"web-ai-chat",cssPrefix:"helpai",defaultBaseUrl:"https://help.ai/api",standaloneUrl:"https://help.ai/chat",displayName:"Help AI",domain:"help.ai",siteUrl:"https://help.ai"};var ll={attach:"Attach files",attachmentMimeRejected:"File type not supported",attachmentTooLarge:"File is too large",attachmentTooMany:"Attachment limit reached",chatClosed:"This conversation is closed",close:"Close",collapse:"Collapse",collapseSidebar:"Collapse sidebar",composerPlaceholder:"Type a message\u2026",dateLastWeek:"Last 7 days",dateOlder:"Older",dateToday:"Today",dateYesterday:"Yesterday",dropZone:"Drop files to attach",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous conversations yet",historyLoading:"Loading your chats\u2026",historyNewChat:"New chat",historyTitle:"Chat history",language:"Language",launcherOpen:"Open chat",messagesLoading:"Loading conversation\u2026",micStart:"Start voice input",micStop:"Stop voice input",micUnsupported:"Voice input is not supported in this browser",moreActions:"More actions",newConversation:"New conversation",panelTitle:"Chat",popOut:"Open in a new tab",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",soundOff:"Sound off",soundOn:"Sound on",startNewConversation:"Start a new conversation",stop:"Stop",theme:"Theme",themeAuto:"Auto (system)",themeDark:"Dark",themeLight:"Light",loading:"Loading\u2026",thinking:"Thinking\u2026",thoughts:"Thoughts",usedTool:"Used tool",tabHome:"Home",tabMessages:"Messages",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",moduleBack:"Back",contentLoading:"Loading\u2026",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeContentTitle:"Popular articles",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results found",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsBack:"Back to news",newsPublishedAt:"Published {date}"};function nn(e,t){let n=cl(e),o=rn(t),i=o?t[n]??{}:t??{},a=o?t.en??{}:{};return{...ll,...a,...i}}function cl(e){return(e.split("-")[0]??"en").toLowerCase()}function on(e,t){return e[t]??t}function rn(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}var fo=class{get(t){try{return localStorage.getItem(t)}catch{return null}}set(t,n){try{localStorage.setItem(t,n)}catch{}}remove(t){try{localStorage.removeItem(t)}catch{}}},an=new fo;var ho=["off","error","warn","info","debug","trace"],vo=v.cssPrefix,Qr=`${vo}.debug`,dl=`__${v.global}_DEBUG__`,_l=`${vo}-debug`,sn=2,go=null;function ul(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(_l);if(e!==null){let t=mo(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(Qr);if(e){let t=mo(e);if(t>=0)return t}}catch{}return window[dl]?4:2}function mo(e){if(e===!0||e==="1"||e==="true")return 4;if(e===!1||e==="0"||e==="false"||e==="off")return 0;if(typeof e=="number")return Math.max(0,Math.min(5,Math.floor(e)));if(typeof e=="string"){let t=ho.indexOf(e);if(t>=0)return t}return-1}function ln(e){let t=mo(e);if(!(t<0)){sn=t;try{window.localStorage?.setItem(Qr,ho[t])}catch{}}}function bo(){return ho[sn]}sn=ul();function Zr(e){let t=`[${vo}:${e}]`,n=(o,i,a)=>(s,l)=>{if(!(sn<o)&&(l===void 0?console[i](t,s):console[i](t,s,l),go))try{go({level:a,scope:e,message:s,payload:l})}catch{}};return{error:n(1,"error","error"),warn:n(2,"warn","warn"),info:n(3,"info","info"),debug:n(4,"debug","debug"),trace:n(5,"debug","trace"),scope:o=>Zr(`${e}:${o}`)}}var M=Zr("core");function ei(e){go=e}var We=M.scope("context"),pl=new Set(["visitorId","sessionId","sessionId","jwt","token","authorization","password"]),ti=50,xo=1024,fl=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Po(e){return ni(e,"userContext",!0)}function yo(e){return ni(e,"pageContext",!1)}function ni(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){We.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let o={},i=0;for(let[a,s]of Object.entries(e)){if(pl.has(a)){We.warn(`dropped reserved ${t} key "${a}" \u2014 managed by the widget, not host-settable`);continue}if(s==null)continue;if(i>=ti){We.warn(`${t} truncated at ${ti} keys \u2014 dropped "${a}"`);continue}let l=gl(t,a,s);l!==void 0&&(o[a]=l,i++)}return n&&typeof o.email=="string"&&!fl.test(o.email)&&(We.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function gl(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){We.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let o=n.trim();return o===""?void 0:o.length>xo?(We.warn(`truncated ${e}.${t} to ${xo} chars`),o.slice(0,xo)):o}We.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var cn={maxBytes:10485760,maxCount:10,accept:"*/*"},oi={animation:"typewriter",speed:60},So={files:!0,voice:"local"},wo={upload:"/ai/agent/upload-file",transcribe:"/ai/agent/transcribe-audio"},nt={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},ri={floating:{main:["theme","history","close"],overflow:["clear","expand","fullscreen","popOut","sound","language"]},inline:{main:["theme","history","close"],overflow:["clear","fullscreen","popOut","sound","language"]},standalone:{main:["theme","history"],overflow:["clear","sound","language"]},page:{main:["theme","history"],overflow:["clear","sound","language"]},modal:{main:["theme","history","close"],overflow:["clear","fullscreen","popOut","sound","language"]},drawer:{main:["theme","history","close"],overflow:["clear","fullscreen","popOut","sound","language"]}},ko={enabled:!0,volume:.3,events:void 0},ii={enabled:!0,events:void 0},ai=[{label:"tabMessages",layout:"chat"}],si={showSearchBar:!0};function bt(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},o=t.behavior??{},i=t.i18n??{},a=t.feedback??{},s=t.footer??{},l=t.header??{},{themeMode:c,themeOverrides:_}=ml(t.theme),p=n.mode??"floating",d=i.locale??hl(i.defaultLocale),u=i.availableLocales??[d];return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:(t.baseUrl??v.defaultBaseUrl).replace(/\/$/,""),userContext:Po(t.userContext),pageContext:yo(t.pageContext),position:n.position??"bottom-right",themeMode:c,themeOverrides:_,mode:p,iframe:n.iframe??!1,responseMode:o.responseMode??"streaming",showReasoning:o.showReasoning??!1,showToolCalls:o.showToolCalls??!1,popOutUrl:o.popOutUrl??v.standaloneUrl,welcome:{...oi,...t.welcome},features:{files:t.features?.files??So.files,voice:t.features?.voice??So.voice,tools:t.features?.tools},endpoints:{upload:t.endpoints?.upload??wo.upload,transcribe:t.endpoints?.transcribe??wo.transcribe},attachments:{accept:t.composer?.attachments?.accept??cn.accept,maxBytes:t.composer?.attachments?.maxBytes??cn.maxBytes,maxCount:t.composer?.attachments?.maxCount??cn.maxCount},locale:d,availableLocales:u,startMinimized:o.startMinimized??!0,actions:vl(p,l.actions),size:n.size??{},launcher:wl(t.launcher),sound:bl(a.sound),haptics:xl(a.haptics),strings:nn(d,i.strings),stringsOverride:i.strings,composerDisclaimer:s.composerDisclaimer??"",poweredBy:Pl(s.poweredBy),composer:yl(t.composer),modules:Sl(t.modules),storage:t.storage??an,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function ml(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function hl(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function vl(e,t){let n=ri[e];return{main:t?.main??n.main,overflow:t?.overflow??n.overflow}}function bl(e){return{enabled:e?.enabled??ko.enabled,volume:e?.volume??ko.volume,events:e?.events}}function xl(e){return{enabled:e?.enabled??ii.enabled,events:e?.events}}function Pl(e){let n={...{text:`Powered by ${v.displayName}`,href:v.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function yl(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function Sl(e){let t=e===void 0?ai:e,n=new Set,o=[];for(let a of t.slice(0,4)){if(!a?.label||!a?.layout)continue;let s=a.contentTags?.filter(Boolean),l=a.id??s?.[0]??a.layout;for(;n.has(l);)l=`${l}-${o.length}`;n.add(l);let c={id:l,label:a.label,layout:a.layout};s&&s.length>0&&(c.contentTags=s),a.layout==="home"&&(c.brandName=a.brandName,c.greetingText=a.greetingText,c.showGreeting=a.showGreeting??!0,c.showSearchBar=a.showSearchBar??si.showSearchBar,c.showRecentMessages=a.showRecentMessages??!0,a.userAvatars&&a.userAvatars.length>0&&(c.userAvatars=a.userAvatars),a.status&&(c.status=a.status),c.contentBlockTitle=a.contentBlockTitle),o.push(c)}let i=Object.fromEntries(o.map(a=>[a.id,a]));return{list:o,byId:i}}function wl(e){let t=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??nt.variant,size:e?.size??nt.size,label:e?.label??nt.label,icon:e?.icon??nt.icon,hidden:e?.hidden??nt.hidden,callout:t}}function Eo(e,t,n){if(t===e.locale&&n===e.themeMode)return e;let o={...e};return t!==e.locale&&(o.locale=t,o.strings=nn(t,e.stringsOverride)),n!==e.themeMode&&(o.themeMode=n),o}var kl=["presentation","behavior","theme","launcher","header","composer","welcome","feedback","i18n","footer","features","endpoints"];function Co(e,t){if(!t)return e;let n={...e};for(let a of kl){let s=t[a];if(s===void 0)continue;let l=e[a];if(a==="theme"){l===void 0&&(n[a]=s);continue}a!=="i18n"&&(n[a]=li(s,l))}t.modules!==void 0&&e.modules===void 0&&(n.modules=t.modules);let o=e.i18n,i=t.i18n;if(o||i){let a=li(i??{},o),s=o?.strings,l=i?.strings;(s||l)&&(a.strings=El(l,s)),n.i18n=a}return n}function li(e,t){if(!t)return e;let n={...e};for(let[o,i]of Object.entries(t))i!==void 0&&(n[o]=i);return n}function El(e,t){if(!e)return t;if(!t)return e;let n=rn(e),o=rn(t);if(!n&&!o)return{...e,...t};let i={},a=n?e:{en:e},s=o?t:{en:t};for(let[l,c]of Object.entries(a))i[l]={...c};for(let[l,c]of Object.entries(s))i[l]={...i[l],...c};return i}var Cl=["clear","expand","fullscreen","popOut","sound","history","language","theme","close"],ot=e=>e!=="false",Al=e=>e.split(",").map(t=>t.trim()).filter(Boolean),Tl=[["public-key","publicKey"],["ai-agent-deployment-id","aiAgentDeploymentId"],["base-url","baseUrl"],["theme","theme",e=>e]],Il=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",ot]],Rl=[["width","width"],["height","height"]],Ml=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",ot],["show-reasoning","showReasoning",ot],["show-tool-calls","showToolCalls",ot]],Ll=[["locale","locale"]],U_=new Set(Cl);var Nl=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",ot]],Ol=[["features-files","files",ot],["features-voice","voice",e=>e],["features-tools","tools",Al]],Dl=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Hl=[["user-id","id"],["user-email","email"],["user-name","name"]],Bl=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],$l=["launcher-label","callout-text","callout-delay","actions-main","actions-overflow","user-context","page-context"],Ul=[Tl,Il,Rl,Ml,Ll,Nl,Ol,Dl,Hl,Bl],zl=new Set(["iframe","start-minimized"]),Fl=[...Ul.flatMap(e=>e.map(([t])=>t).filter(t=>!zl.has(t))),...$l];function ci(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function di(e){return ci(e)}function _i(e){return!(!ci(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function ui(e){return`${v.cssPrefix}:${e}`}function xt(e,t){e.dispatchEvent(new CustomEvent(ui(t)))}function pi(e,t){let o=Object.entries(t).map(([i,a])=>{let s=ui(i),l=()=>a();return e.addEventListener(s,l),[s,l]});return()=>{for(let[i,a]of o)e.removeEventListener(i,a)}}var fi=`:host{--__P__-accent: __BRAND_ACCENT__;--__P__-accent-text: __BRAND_ACCENT_TEXT__;--__P__-radius: __BRAND_RADIUS__;--__P__-radius-sm: 8px;--__P__-radius-md: 10px;--__P__-radius-lg: 16px;--__P__-font: __BRAND_FONT__;--__P__-font-display: var(--__P__-font);--__P__-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;--__P__-bg: oklch(1 0 0);--__P__-bg-elevated: oklch(.9789 .0029 278.3);--__P__-surface: var(--__P__-bg-elevated);--__P__-muted: var(--__P__-fg-muted);--__P__-hover: oklch(.1686 .011 278.3 / .06);--__P__-fg: oklch(.1686 .011 278.3);--__P__-fg-muted: oklch(.4932 .0301 278.3);--__P__-border: oklch(.9312 .0084 278.3);--__P__-border-strong: oklch(.8757 .0131 278.3);--__P__-bubble-user: var(--__P__-accent);--__P__-bubble-user-text: var(--__P__-accent-text);--__P__-bubble-assistant: oklch(.9638 .0058 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-on-accent: var(--__P__-accent-text);--__P__-success: oklch(.6456 .1654 151.53);--__P__-warning: oklch(.7135 .1494 74.05);--__P__-danger: oklch(.5966 .1818 24.51);--__P__-danger-text: oklch(.5054 .1905 27.52);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .1);--__P__-neutral: oklch(.7137 .0192 278.3);--__P__-focus: var(--__P__-accent);--__P__-shadow-panel: 0 8px 24px -8px rgba(13, 15, 20, .18), 0 24px 64px -24px rgba(13, 15, 20, .24);--__P__-shadow-card: 0 1px 2px rgba(13, 15, 20, .06), 0 4px 12px -6px rgba(13, 15, 20, .12);--__P__-backdrop: oklch(.1686 .011 278.3 / .55);--__P__-shadow-fab: 0 6px 16px -4px color-mix(in oklch, var(--__P__-accent) 45%, transparent), 0 12px 32px -12px rgba(13, 15, 20, .25);--__P__-z-fab: 2147483600;--__P__-z-panel: 2147483601;--__P__-panel-w: 380px;--__P__-panel-h: 600px;--__P__-fab-size: 56px;--__P__-space-1: 4px;--__P__-space-2: 8px;--__P__-space-3: 12px;--__P__-space-4: 16px;--__P__-space-5: 20px;--__P__-space-6: 24px;--__P__-space-8: 32px;--__P__-text-xs: 12px;--__P__-text-sm: 13px;--__P__-text-base: 15px;--__P__-text-md: 16px;--__P__-text-lg: 18px;--__P__-text-xl: 22px;--__P__-text-2xl: 30px;--__P__-ease: cubic-bezier(.2, .7, .2, 1);--__P__-ease-out: cubic-bezier(.2, .7, .2, 1);--__P__-ease-in: cubic-bezier(.4, 0, 1, 1);--__P__-ease-in-out: cubic-bezier(.65, 0, .35, 1);--__P__-dur-quick: .12s;--__P__-dur-base: .22s;--__P__-dur-slow: .32s;font-family:var(--__P__-font);color:var(--__P__-fg);color-scheme:light}:host([data-theme="dark"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-danger-text: oklch(.8077 .1035 19.57);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .18);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);--__P__-shadow-card: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px -6px rgba(0, 0, 0, .5);--__P__-backdrop: rgba(0, 0, 0, .65);color-scheme:dark}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);color-scheme:dark}}@media(prefers-reduced-motion:reduce){:host{--__P__-dur-quick: 1ms;--__P__-dur-base: 1ms;--__P__-dur-slow: 1ms}}
1
+ var Ws=Object.defineProperty;var Ks=(e,t,n)=>t in e?Ws(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var W=(e,t,n)=>Ks(e,typeof t!="symbol"?t+"":t,n);var Wt,H,Pr,to,De,hr,yr,Sr,Jn,Bt,ft,wr,no,Qn,Zn,Gs,Ut={},zt=[],Vs=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Kt=Array.isArray;function Te(e,t){for(var n in t)e[n]=t[n];return e}function oo(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Gt(e,t,n){var o,i,a,s={};for(a in t)a=="key"?o=t[a]:a=="ref"?i=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?Wt.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)s[a]===void 0&&(s[a]=e.defaultProps[a]);return $t(e,s,o,i,null)}function $t(e,t,n,o,i){var a={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Pr,__i:-1,__u:0};return i==null&&H.vnode!=null&&H.vnode(a),a}function ee(e){return e.children}function He(e,t){this.props=e,this.context=t}function Qe(e,t){if(t==null)return e.__?Qe(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Qe(e):null}function qs(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],i=[],a=Te({},t);a.__v=t.__v+1,H.vnode&&H.vnode(a),ro(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??Qe(t),!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,Ar(o,a,i),t.__e=t.__=null,a.__e!=n&&kr(a)}}function kr(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),kr(e)}function vr(e){(!e.__d&&(e.__d=!0)&&De.push(e)&&!Ft.__r++||hr!=H.debounceRendering)&&((hr=H.debounceRendering)||yr)(Ft)}function Ft(){try{for(var e,t=1;De.length;)De.length>t&&De.sort(Sr),e=De.shift(),t=De.length,qs(e)}finally{De.length=Ft.__r=0}}function Er(e,t,n,o,i,a,s,l,c,_,p){var d,u,g,m,f,b,x,y=o&&o.__k||zt,A=t.length;for(c=Xs(n,t,y,c,A),d=0;d<A;d++)(g=n.__k[d])!=null&&(u=g.__i!=-1&&y[g.__i]||Ut,g.__i=d,b=ro(e,g,u,i,a,s,l,c,_,p),m=g.__e,g.ref&&u.ref!=g.ref&&(u.ref&&io(u.ref,null,g),p.push(g.ref,g.__c||m,g)),f==null&&m!=null&&(f=m),(x=!!(4&g.__u))||u.__k===g.__k?(c=Cr(g,c,e,x),x&&u.__e&&(u.__e=null)):typeof g.type=="function"&&b!==void 0?c=b:m&&(c=m.nextSibling),g.__u&=-7);return n.__e=f,c}function Xs(e,t,n,o,i){var a,s,l,c,_,p=n.length,d=p,u=0;for(e.__k=new Array(i),a=0;a<i;a++)(s=t[a])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[a]=$t(null,s,null,null,null):Kt(s)?s=e.__k[a]=$t(ee,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[a]=$t(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[a]=s,c=a+u,s.__=e,s.__b=e.__b+1,l=null,(_=s.__i=js(s,n,c,d))!=-1&&(d--,(l=n[_])&&(l.__u|=2)),l==null||l.__v==null?(_==-1&&(i>p?u--:i<p&&u++),typeof s.type!="function"&&(s.__u|=4)):_!=c&&(_==c-1?u--:_==c+1?u++:(_>c?u--:u++,s.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<p;a++)(l=n[a])!=null&&(2&l.__u)==0&&(l.__e==o&&(o=Qe(l)),Ir(l,l));return o}function Cr(e,t,n,o){var i,a;if(typeof e.type=="function"){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=Cr(i[a],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Qe(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function js(e,t,n,o){var i,a,s,l=e.key,c=e.type,_=t[n],p=_!=null&&(2&_.__u)==0;if(_===null&&l==null||p&&l==_.key&&c==_.type)return n;if(o>(p?1:0)){for(i=n-1,a=n+1;i>=0||a<t.length;)if((_=t[s=i>=0?i--:a++])!=null&&(2&_.__u)==0&&l==_.key&&c==_.type)return s}return-1}function br(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Vs.test(t)?n:n+"px"}function Ht(e,t,n,o,i){var a,s;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||br(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||br(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")a=t!=(t=t.replace(wr,"$1")),s=t.toLowerCase(),t=s in e||t=="onFocusOut"||t=="onFocusIn"?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?o?n[ft]=o[ft]:(n[ft]=no,e.addEventListener(t,a?Zn:Qn,a)):e.removeEventListener(t,a?Zn:Qn,a);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function xr(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[Bt]==null)t[Bt]=no++;else if(t[Bt]<n[ft])return;return n(H.event?H.event(t):t)}}}function ro(e,t,n,o,i,a,s,l,c,_){var p,d,u,g,m,f,b,x,y,A,j,U,oe,O,le,B=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[l=t.__e=n.__e]),(p=H.__b)&&p(t);e:if(typeof B=="function")try{if(x=t.props,y=B.prototype&&B.prototype.render,A=(p=B.contextType)&&o[p.__c],j=p?A?A.props.value:p.__:o,n.__c?b=(d=t.__c=n.__c).__=d.__E:(y?t.__c=d=new B(x,j):(t.__c=d=new He(x,j),d.constructor=B,d.render=Js),A&&A.sub(d),d.state||(d.state={}),d.__n=o,u=d.__d=!0,d.__h=[],d._sb=[]),y&&d.__s==null&&(d.__s=d.state),y&&B.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=Te({},d.__s)),Te(d.__s,B.getDerivedStateFromProps(x,d.__s))),g=d.props,m=d.state,d.__v=t,u)y&&B.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),y&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(y&&B.getDerivedStateFromProps==null&&x!==g&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(x,j),t.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(x,d.__s,j)===!1){t.__v!=n.__v&&(d.props=x,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(R){R&&(R.__=t)}),zt.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(x,d.__s,j),y&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(g,m,f)})}if(d.context=j,d.props=x,d.__P=e,d.__e=!1,U=H.__r,oe=0,y)d.state=d.__s,d.__d=!1,U&&U(t),p=d.render(d.props,d.state,d.context),zt.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,U&&U(t),p=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++oe<25);d.state=d.__s,d.getChildContext!=null&&(o=Te(Te({},o),d.getChildContext())),y&&!u&&d.getSnapshotBeforeUpdate!=null&&(f=d.getSnapshotBeforeUpdate(g,m)),O=p!=null&&p.type===ee&&p.key==null?Tr(p.props.children):p,l=Er(e,Kt(O)?O:[O],t,n,o,i,a,s,l,c,_),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),b&&(d.__E=d.__=null)}catch(R){if(t.__v=null,c||a!=null)if(R.then){for(t.__u|=c?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;a[a.indexOf(l)]=null,t.__e=l}else{for(le=a.length;le--;)oo(a[le]);eo(t)}else t.__e=n.__e,t.__k=n.__k,R.then||eo(t);H.__e(R,t,n)}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=Ys(n.__e,t,n,o,i,a,s,c,_);return(p=H.diffed)&&p(t),128&t.__u?void 0:l}function eo(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(eo))}function Ar(e,t,n){for(var o=0;o<n.length;o++)io(n[o],n[++o],n[++o]);H.__c&&H.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(a){a.call(i)})}catch(a){H.__e(a,i.__v)}})}function Tr(e){return typeof e!="object"||e==null||e.__b>0?e:Kt(e)?e.map(Tr):e.constructor!==void 0?null:Te({},e)}function Ys(e,t,n,o,i,a,s,l,c){var _,p,d,u,g,m,f,b=n.props||Ut,x=t.props,y=t.type;if(y=="svg"?i="http://www.w3.org/2000/svg":y=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),a!=null){for(_=0;_<a.length;_++)if((g=a[_])&&"setAttribute"in g==!!y&&(y?g.localName==y:g.nodeType==3)){e=g,a[_]=null;break}}if(e==null){if(y==null)return document.createTextNode(x);e=document.createElementNS(i,y,x.is&&x),l&&(H.__m&&H.__m(t,a),l=!1),a=null}if(y==null)b===x||l&&e.data==x||(e.data=x);else{if(a=y=="textarea"&&x.defaultValue!=null?null:a&&Wt.call(e.childNodes),!l&&a!=null)for(b={},_=0;_<e.attributes.length;_++)b[(g=e.attributes[_]).name]=g.value;for(_ in b)g=b[_],_=="dangerouslySetInnerHTML"?d=g:_=="children"||_ in x||_=="value"&&"defaultValue"in x||_=="checked"&&"defaultChecked"in x||Ht(e,_,null,g,i);for(_ in x)g=x[_],_=="children"?u=g:_=="dangerouslySetInnerHTML"?p=g:_=="value"?m=g:_=="checked"?f=g:l&&typeof g!="function"||b[_]===g||Ht(e,_,g,b[_],i);if(p)l||d&&(p.__html==d.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(d&&(e.innerHTML=""),Er(t.type=="template"?e.content:e,Kt(u)?u:[u],t,n,o,y=="foreignObject"?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:n.__k&&Qe(n,0),l,c),a!=null)for(_=a.length;_--;)oo(a[_]);l&&y!="textarea"||(_="value",y=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[_]||y=="progress"&&!m||y=="option"&&m!=b[_])&&Ht(e,_,m,b[_],i),_="checked",f!=null&&f!=e[_]&&Ht(e,_,f,b[_],i))}return e}function io(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(i){H.__e(i,n)}}function Ir(e,t,n){var o,i;if(H.unmount&&H.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||io(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(a){H.__e(a,t)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&Ir(o[i],t,n||typeof e.type!="function");n||oo(e.__e),e.__c=e.__=e.__e=void 0}function Js(e,t,n){return this.constructor(e,n)}function ao(e,t,n){var o,i,a,s;t==document&&(t=document.documentElement),H.__&&H.__(e,t),i=(o=typeof n=="function")?null:n&&n.__k||t.__k,a=[],s=[],ro(t,e=(!o&&n||t).__k=Gt(ee,null,[e]),i||Ut,Ut,t.namespaceURI,!o&&n?[n]:i?null:t.firstChild?Wt.call(t.childNodes):null,a,!o&&n?n:i?i.__e:t.firstChild,o,s),Ar(a,e,s)}Wt=zt.slice,H={__e:function(e,t,n,o){for(var i,a,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,o||{}),s=i.__d),s)return i.__E=i}catch(l){e=l}throw e}},Pr=0,to=function(e){return e!=null&&e.constructor===void 0},He.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Te({},this.state),typeof e=="function"&&(e=e(Te({},n),this.props)),e&&Te(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),vr(this))},He.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),vr(this))},He.prototype.render=ee,De=[],yr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Sr=function(e,t){return e.__v.__b-t.__v.__b},Ft.__r=0,Jn=Math.random().toString(8),Bt="__d"+Jn,ft="__a"+Jn,wr=/(PointerCapture)$|Capture$/i,no=0,Qn=xr(!1),Zn=xr(!0),Gs=0;var Ze,Q,so,Rr,gt=0,$r=[],te=H,Mr=te.__b,Lr=te.__r,Nr=te.diffed,Or=te.__c,Dr=te.unmount,Hr=te.__;function qt(e,t){te.__h&&te.__h(Q,e,gt||t),gt=0;var n=Q.__H||(Q.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function w(e){return gt=1,Qs(zr,e)}function Qs(e,t,n){var o=qt(Ze++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):zr(void 0,t),function(l){var c=o.__N?o.__N[0]:o.__[0],_=o.t(c,l);c!==_&&(o.__N=[_,o.__[1]],o.__c.setState({}))}],o.__c=Q,!Q.__f)){var i=function(l,c,_){if(!o.__c.__H)return!0;var p=o.__c.__H.__.filter(function(u){return u.__c});if(p.every(function(u){return!u.__N}))return!a||a.call(this,l,c,_);var d=o.__c.props!==l;return p.some(function(u){if(u.__N){var g=u.__[0];u.__=u.__N,u.__N=void 0,g!==u.__[0]&&(d=!0)}}),a&&a.call(this,l,c,_)||d};Q.__f=!0;var a=Q.shouldComponentUpdate,s=Q.componentWillUpdate;Q.componentWillUpdate=function(l,c,_){if(this.__e){var p=a;a=void 0,i(l,c,_),a=p}s&&s.call(this,l,c,_)},Q.shouldComponentUpdate=i}return o.__N||o.__}function S(e,t){var n=qt(Ze++,3);!te.__s&&co(n.__H,t)&&(n.__=e,n.u=t,Q.__H.__h.push(n))}function Ur(e,t){var n=qt(Ze++,4);!te.__s&&co(n.__H,t)&&(n.__=e,n.u=t,Q.__h.push(n))}function N(e){return gt=5,me(function(){return{current:e}},[])}function me(e,t){var n=qt(Ze++,7);return co(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function D(e,t){return gt=8,me(function(){return e},t)}function Zs(){for(var e;e=$r.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Vt),t.__h.some(lo),t.__h=[]}catch(n){t.__h=[],te.__e(n,e.__v)}}}te.__b=function(e){Q=null,Mr&&Mr(e)},te.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Hr&&Hr(e,t)},te.__r=function(e){Lr&&Lr(e),Ze=0;var t=(Q=e.__c).__H;t&&(so===Q?(t.__h=[],Q.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(Vt),t.__h.some(lo),t.__h=[],Ze=0)),so=Q},te.diffed=function(e){Nr&&Nr(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&($r.push(t)!==1&&Rr===te.requestAnimationFrame||((Rr=te.requestAnimationFrame)||el)(Zs)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),so=Q=null},te.__c=function(e,t){t.some(function(n){try{n.__h.some(Vt),n.__h=n.__h.filter(function(o){return!o.__||lo(o)})}catch(o){t.some(function(i){i.__h&&(i.__h=[])}),t=[],te.__e(o,n.__v)}}),Or&&Or(e,t)},te.unmount=function(e){Dr&&Dr(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{Vt(o)}catch(i){t=i}}),n.__H=void 0,t&&te.__e(t,n.__v))};var Br=typeof requestAnimationFrame=="function";function el(e){var t,n=function(){clearTimeout(o),Br&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);Br&&(t=requestAnimationFrame(n))}function Vt(e){var t=Q,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Q=t}function lo(e){var t=Q;e.__c=e.__(),Q=t}function co(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function zr(e,t){return typeof t=="function"?t(e):t}var tl=Symbol.for("preact-signals");function Jt(){if(Ie>1)Ie--;else{var e,t=!1;for((function(){var i=jt;for(jt=void 0;i!==void 0;)i.S.v===i.v&&(i.S.i=i.i),i=i.o})();mt!==void 0;){var n=mt;for(mt=void 0,Xt++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Kr(n))try{n.c()}catch(i){t||(e=i,t=!0)}n=o}}if(Xt=0,Ie--,t)throw e}}function uo(e){if(Ie>0)return e();_o=++nl,Ie++;try{return e()}finally{Jt()}}var V=void 0;function Qt(e){var t=V;V=void 0;try{return e()}finally{V=t}}var Fr,mt=void 0,Ie=0,Xt=0,nl=0,_o=0,jt=void 0,Yt=0;function Wr(e){if(V!==void 0){var t=e.n;if(t===void 0||t.t!==V)return t={i:0,S:e,p:V.s,n:void 0,t:V,e:void 0,x:void 0,r:t},V.s!==void 0&&(V.s.n=t),V.s=t,e.n=t,32&V.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=V.s,t.n=void 0,V.s.n=t,V.s=t),t}}function ae(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}ae.prototype.brand=tl;ae.prototype.h=function(){return!0};ae.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:Qt(function(){var o;(o=t.W)==null||o.call(t)}))};ae.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,o=e.x;n!==void 0&&(n.x=o,e.e=void 0),o!==void 0&&(o.e=n,e.x=void 0),e===this.t&&(this.t=o,o===void 0&&Qt(function(){var i;(i=t.Z)==null||i.call(t)}))}};ae.prototype.subscribe=function(e){var t=this;return Re(function(){var n=t.value,o=V;V=void 0;try{e(n)}finally{V=o}},{name:"sub"})};ae.prototype.valueOf=function(){return this.value};ae.prototype.toString=function(){return this.value+""};ae.prototype.toJSON=function(){return this.value};ae.prototype.peek=function(){var e=this;return Qt(function(){return e.value})};Object.defineProperty(ae.prototype,"value",{get:function(){var e=Wr(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Xt>100)throw new Error("Cycle detected");(function(n){Ie!==0&&Xt===0&&n.l!==_o&&(n.l=_o,jt={S:n,v:n.v,i:n.i,o:jt})})(this),this.v=e,this.i++,Yt++,Ie++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Jt()}}}});function L(e,t){return new ae(e,t)}function Kr(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Gr(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Vr(e){for(var t=e.s,n=void 0;t!==void 0;){var o=t.p;t.i===-1?(t.S.U(t),o!==void 0&&(o.n=t.n),t.n!==void 0&&(t.n.p=o)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=o}e.s=n}function Fe(e,t){ae.call(this,void 0),this.x=e,this.s=void 0,this.g=Yt-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}Fe.prototype=new ae;Fe.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Yt))return!0;if(this.g=Yt,this.f|=1,this.i>0&&!Kr(this))return this.f&=-2,!0;var e=V;try{Gr(this),V=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return V=e,Vr(this),this.f&=-2,!0};Fe.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}ae.prototype.S.call(this,e)};Fe.prototype.U=function(e){if(this.t!==void 0&&(ae.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Fe.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Fe.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Wr(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function ht(e,t){return new Fe(e,t)}function qr(e){var t=e.m;if(e.m=void 0,typeof t=="function"){Ie++;var n=V;V=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,po(e),o}finally{V=n,Jt()}}}function po(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,qr(e)}function ol(e){if(V!==this)throw new Error("Out-of-order effect");Vr(this),V=e,this.f&=-2,8&this.f&&po(this),Jt()}function et(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Fr&&Fr.push(this)}et.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};et.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,qr(this),Gr(this),Ie++;var e=V;return V=this,ol.bind(this,e)};et.prototype.N=function(){2&this.f||(this.f|=2,this.u=mt,mt=this)};et.prototype.d=function(){this.f|=8,1&this.f||po(this)};et.prototype.dispose=function(){this.d()};function Re(e,t){var n=new et(e,t);try{n.c()}catch(i){throw n.d(),i}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var Xr,tn,Zt,rl=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var jr=[];Re(function(){Xr=this.N})();function tt(e,t){H[e]=t.bind(null,H[e]||function(){})}function en(e){if(Zt){var t=Zt;Zt=void 0,t()}Zt=e&&e.S()}function Yr(e){var t=this,n=e.data,o=vt(n);o.value=n;var i=me(function(){for(var l=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var _=ht(function(){var g=o.value.value;return g===0?0:g===!0?"":g||""}),p=ht(function(){return!Array.isArray(_.value)&&!to(_.value)}),d=Re(function(){if(this.N=Jr,p.value){var g=_.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=g)}}),u=t.__$u.d;return t.__$u.d=function(){d(),u.call(this)},[p,_]},[]),a=i[0],s=i[1];return a.value?s.peek():s.value}Yr.displayName="ReactiveTextNode";Object.defineProperties(ae.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Yr},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});tt("__b",function(e,t){if(typeof t.type=="string"){var n,o=t.props;for(var i in o)if(i!=="children"){var a=o[i];a instanceof ae&&(n||(t.__np=n={}),n[i]=a,o[i]=a.peek())}}e(t)});tt("__r",function(e,t){if(e(t),t.type!==ee){en();var n,o=t.__c;o&&(o.__$f&=-2,(n=o.__$u)===void 0&&(o.__$u=n=(function(i,a){var s;return Re(function(){s=this},{name:a}),s.c=i,s})(function(){var i;rl&&((i=n.y)==null||i.call(n)),o.__$f|=1,o.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),tn=o,en(n)}});tt("__e",function(e,t,n,o){en(),tn=void 0,e(t,n,o)});tt("diffed",function(e,t){en(),tn=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var o=t.__np,i=t.props;if(o){var a=n.U;if(a)for(var s in a){var l=a[s];l!==void 0&&!(s in o)&&(l.d(),a[s]=void 0)}else a={},n.U=a;for(var c in o){var _=a[c],p=o[c];_===void 0?(_=il(n,c,p),a[c]=_):_.o(p,i)}}}e(t)});function il(e,t,n,o){var i=t in e&&e.ownerSVGElement===void 0,a=L(n),s=n.peek();return{o:function(l,c){a.value=l,s=l.peek()},d:Re(function(){this.N=Jr;var l=a.value.value;s!==l?(s=void 0,i?e[t]=l:l!=null&&(l!==!1||t[4]==="-")?e.setAttribute(t,l):e.removeAttribute(t)):s=void 0})}}tt("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var o=n.U;if(o){n.U=void 0;for(var i in o){var a=o[i];a&&a.d()}}}var s=t.__np;if(s){var l=t.props;for(var c in s)l[c]=s[c]}t.__np=void 0}else{var _=t.__c;if(_){var p=_.__$u;p&&(_.__$u=void 0,p.d())}}e(t)});tt("__h",function(e,t,n,o){(o<3||o===9)&&(t.__$f|=2),e(t,n,o)});He.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,o=n&&n.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var a=2&this.__$f;if(!(o||a||4&this.__$f)||1&this.__$f)return!0}else if(!(o||4&this.__$f)||3&this.__$f)return!0;for(var s in e)if(s!=="__source"&&e[s]!==this.props[s])return!0;for(var l in this.props)if(!(l in e))return!0;return!1};function vt(e,t){return me(function(){return L(e,t)},[])}function Se(e,t){var n=N(e);return n.current=e,tn.__$f|=4,me(function(){return ht(function(){return n.current()},t)},[])}var al=function(e){queueMicrotask(function(){queueMicrotask(e)})};function sl(){uo(function(){for(var e;e=jr.shift();)Xr.call(e)})}function Jr(){jr.push(this)===1&&(H.requestAnimationFrame||al)(sl)}var v={id:"help-ai",name:"@helpai/elements",global:"HelpAI",tagName:"web-ai-chat",cssPrefix:"helpai",defaultBaseUrl:"https://help.ai/api",standaloneUrl:"https://help.ai/chat",displayName:"Help AI",domain:"help.ai",siteUrl:"https://help.ai"};var ll={attach:"Attach files",attachmentMimeRejected:"File type not supported",attachmentTooLarge:"File is too large",attachmentTooMany:"Attachment limit reached",chatClosed:"This conversation is closed",close:"Close",collapse:"Collapse",collapseSidebar:"Collapse sidebar",composerPlaceholder:"Type a message\u2026",dateLastWeek:"Last 7 days",dateOlder:"Older",dateToday:"Today",dateYesterday:"Yesterday",dropZone:"Drop files to attach",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous conversations yet",historyLoading:"Loading your chats\u2026",historyNewChat:"New chat",historyTitle:"Chat history",language:"Language",launcherOpen:"Open chat",messagesLoading:"Loading conversation\u2026",micStart:"Start voice input",micStop:"Stop voice input",micUnsupported:"Voice input is not supported in this browser",moreActions:"More actions",newConversation:"New conversation",panelTitle:"Chat",popOut:"Open in a new tab",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",soundOff:"Sound off",soundOn:"Sound on",startNewConversation:"Start a new conversation",stop:"Stop",theme:"Theme",themeAuto:"Auto (system)",themeDark:"Dark",themeLight:"Light",loading:"Loading\u2026",thinking:"Thinking\u2026",thoughts:"Thoughts",usedTool:"Used tool",tabHome:"Home",tabMessages:"Messages",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",moduleBack:"Back",contentLoading:"Loading\u2026",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeContentTitle:"Popular articles",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results found",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsBack:"Back to news",newsPublishedAt:"Published {date}"};function nn(e,t){let n=cl(e),o=rn(t),i=o?t[n]??{}:t??{},a=o?t.en??{}:{};return{...ll,...a,...i}}function cl(e){return(e.split("-")[0]??"en").toLowerCase()}function on(e,t){return e[t]??t}function rn(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}var fo=class{get(t){try{return localStorage.getItem(t)}catch{return null}}set(t,n){try{localStorage.setItem(t,n)}catch{}}remove(t){try{localStorage.removeItem(t)}catch{}}},an=new fo;var ho=["off","error","warn","info","debug","trace"],vo=v.cssPrefix,Qr=`${vo}.debug`,dl=`__${v.global}_DEBUG__`,_l=`${vo}-debug`,sn=2,go=null;function ul(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(_l);if(e!==null){let t=mo(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(Qr);if(e){let t=mo(e);if(t>=0)return t}}catch{}return window[dl]?4:2}function mo(e){if(e===!0||e==="1"||e==="true")return 4;if(e===!1||e==="0"||e==="false"||e==="off")return 0;if(typeof e=="number")return Math.max(0,Math.min(5,Math.floor(e)));if(typeof e=="string"){let t=ho.indexOf(e);if(t>=0)return t}return-1}function ln(e){let t=mo(e);if(!(t<0)){sn=t;try{window.localStorage?.setItem(Qr,ho[t])}catch{}}}function bo(){return ho[sn]}sn=ul();function Zr(e){let t=`[${vo}:${e}]`,n=(o,i,a)=>(s,l)=>{if(!(sn<o)&&(l===void 0?console[i](t,s):console[i](t,s,l),go))try{go({level:a,scope:e,message:s,payload:l})}catch{}};return{error:n(1,"error","error"),warn:n(2,"warn","warn"),info:n(3,"info","info"),debug:n(4,"debug","debug"),trace:n(5,"debug","trace"),scope:o=>Zr(`${e}:${o}`)}}var M=Zr("core");function ei(e){go=e}var We=M.scope("context"),pl=new Set(["visitorId","sessionId","sessionId","jwt","token","authorization","password"]),ti=50,xo=1024,fl=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Po(e){return ni(e,"userContext",!0)}function yo(e){return ni(e,"pageContext",!1)}function ni(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){We.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let o={},i=0;for(let[a,s]of Object.entries(e)){if(pl.has(a)){We.warn(`dropped reserved ${t} key "${a}" \u2014 managed by the widget, not host-settable`);continue}if(s==null)continue;if(i>=ti){We.warn(`${t} truncated at ${ti} keys \u2014 dropped "${a}"`);continue}let l=gl(t,a,s);l!==void 0&&(o[a]=l,i++)}return n&&typeof o.email=="string"&&!fl.test(o.email)&&(We.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function gl(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){We.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let o=n.trim();return o===""?void 0:o.length>xo?(We.warn(`truncated ${e}.${t} to ${xo} chars`),o.slice(0,xo)):o}We.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var cn={maxBytes:10485760,maxCount:10,accept:"*/*"},oi={animation:"typewriter",speed:60},So={files:!0,voice:"local"},wo={upload:"/ai/agent/upload-file",transcribe:"/ai/agent/transcribe-audio"},nt={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},ri={floating:["theme","history","close","clear","expand","fullscreen","popOut","sound","language"],inline:["theme","history","close","clear","fullscreen","popOut","sound","language"],standalone:["theme","history","clear","sound","language"],page:["theme","history","clear","sound","language"],modal:["theme","history","close","clear","fullscreen","popOut","sound","language"],drawer:["theme","history","close","clear","fullscreen","popOut","sound","language"]},ko={enabled:!0,volume:.3,events:void 0},ii={enabled:!0,events:void 0},ai=[{label:"tabMessages",layout:"chat"}],si={showSearchBar:!0};function bt(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},o=t.behavior??{},i=t.i18n??{},a=t.feedback??{},s=t.footer??{},l=t.header??{},{themeMode:c,themeOverrides:_}=ml(t.theme),p=n.mode??"floating",d=i.locale??hl(i.defaultLocale),u=i.availableLocales??[d];return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:(t.baseUrl??v.defaultBaseUrl).replace(/\/$/,""),userContext:Po(t.userContext),pageContext:yo(t.pageContext),position:n.position??"bottom-right",themeMode:c,themeOverrides:_,mode:p,iframe:n.iframe??!1,responseMode:o.responseMode??"streaming",showReasoning:o.showReasoning??!1,showToolCalls:o.showToolCalls??!1,popOutUrl:o.popOutUrl??v.standaloneUrl,welcome:{...oi,...t.welcome},features:{files:t.features?.files??So.files,voice:t.features?.voice??So.voice,tools:t.features?.tools},endpoints:{upload:t.endpoints?.upload??wo.upload,transcribe:t.endpoints?.transcribe??wo.transcribe},attachments:{accept:t.composer?.attachments?.accept??cn.accept,maxBytes:t.composer?.attachments?.maxBytes??cn.maxBytes,maxCount:t.composer?.attachments?.maxCount??cn.maxCount},locale:d,availableLocales:u,startMinimized:o.startMinimized??!0,actions:vl(p,l.actions),size:n.size??{},launcher:wl(t.launcher),sound:bl(a.sound),haptics:xl(a.haptics),strings:nn(d,i.strings),stringsOverride:i.strings,composerDisclaimer:s.composerDisclaimer??"",poweredBy:Pl(s.poweredBy),composer:yl(t.composer),modules:Sl(t.modules),storage:t.storage??an,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function ml(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function hl(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function vl(e,t){return t??ri[e]}function bl(e){return{enabled:e?.enabled??ko.enabled,volume:e?.volume??ko.volume,events:e?.events}}function xl(e){return{enabled:e?.enabled??ii.enabled,events:e?.events}}function Pl(e){let n={...{text:`Powered by ${v.displayName}`,href:v.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function yl(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function Sl(e){let t=e===void 0?ai:e,n=new Set,o=[];for(let a of t.slice(0,4)){if(!a?.label||!a?.layout)continue;let s=a.contentTags?.filter(Boolean),l=a.id??s?.[0]??a.layout;for(;n.has(l);)l=`${l}-${o.length}`;n.add(l);let c={id:l,label:a.label,layout:a.layout};s&&s.length>0&&(c.contentTags=s),a.layout==="home"&&(c.brandName=a.brandName,c.greetingText=a.greetingText,c.showGreeting=a.showGreeting??!0,c.showSearchBar=a.showSearchBar??si.showSearchBar,c.showRecentMessages=a.showRecentMessages??!0,a.userAvatars&&a.userAvatars.length>0&&(c.userAvatars=a.userAvatars),a.status&&(c.status=a.status),c.contentBlockTitle=a.contentBlockTitle),o.push(c)}let i=Object.fromEntries(o.map(a=>[a.id,a]));return{list:o,byId:i}}function wl(e){let t=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??nt.variant,size:e?.size??nt.size,label:e?.label??nt.label,icon:e?.icon??nt.icon,hidden:e?.hidden??nt.hidden,callout:t}}function Eo(e,t,n){if(t===e.locale&&n===e.themeMode)return e;let o={...e};return t!==e.locale&&(o.locale=t,o.strings=nn(t,e.stringsOverride)),n!==e.themeMode&&(o.themeMode=n),o}var kl=["presentation","behavior","theme","launcher","header","composer","welcome","feedback","i18n","footer","features","endpoints"];function Co(e,t){if(!t)return e;let n={...e};for(let a of kl){let s=t[a];if(s===void 0)continue;let l=e[a];if(a==="theme"){l===void 0&&(n[a]=s);continue}a!=="i18n"&&(n[a]=li(s,l))}t.modules!==void 0&&e.modules===void 0&&(n.modules=t.modules);let o=e.i18n,i=t.i18n;if(o||i){let a=li(i??{},o),s=o?.strings,l=i?.strings;(s||l)&&(a.strings=El(l,s)),n.i18n=a}return n}function li(e,t){if(!t)return e;let n={...e};for(let[o,i]of Object.entries(t))i!==void 0&&(n[o]=i);return n}function El(e,t){if(!e)return t;if(!t)return e;let n=rn(e),o=rn(t);if(!n&&!o)return{...e,...t};let i={},a=n?e:{en:e},s=o?t:{en:t};for(let[l,c]of Object.entries(a))i[l]={...c};for(let[l,c]of Object.entries(s))i[l]={...i[l],...c};return i}var Cl=["clear","expand","fullscreen","popOut","sound","history","language","theme","close"],ot=e=>e!=="false",Al=e=>e.split(",").map(t=>t.trim()).filter(Boolean),Tl=[["public-key","publicKey"],["ai-agent-deployment-id","aiAgentDeploymentId"],["base-url","baseUrl"],["theme","theme",e=>e]],Il=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",ot]],Rl=[["width","width"],["height","height"]],Ml=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",ot],["show-reasoning","showReasoning",ot],["show-tool-calls","showToolCalls",ot]],Ll=[["locale","locale"]],U_=new Set(Cl);var Nl=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",ot]],Ol=[["features-files","files",ot],["features-voice","voice",e=>e],["features-tools","tools",Al]],Dl=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Hl=[["user-id","id"],["user-email","email"],["user-name","name"]],Bl=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],$l=["launcher-label","callout-text","callout-delay","actions-main","actions-overflow","user-context","page-context"],Ul=[Tl,Il,Rl,Ml,Ll,Nl,Ol,Dl,Hl,Bl],zl=new Set(["iframe","start-minimized"]),Fl=[...Ul.flatMap(e=>e.map(([t])=>t).filter(t=>!zl.has(t))),...$l];function ci(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function di(e){return ci(e)}function _i(e){return!(!ci(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function ui(e){return`${v.cssPrefix}:${e}`}function xt(e,t){e.dispatchEvent(new CustomEvent(ui(t)))}function pi(e,t){let o=Object.entries(t).map(([i,a])=>{let s=ui(i),l=()=>a();return e.addEventListener(s,l),[s,l]});return()=>{for(let[i,a]of o)e.removeEventListener(i,a)}}var fi=`:host{--__P__-accent: __BRAND_ACCENT__;--__P__-accent-text: __BRAND_ACCENT_TEXT__;--__P__-radius: __BRAND_RADIUS__;--__P__-radius-sm: 8px;--__P__-radius-md: 10px;--__P__-radius-lg: 16px;--__P__-font: __BRAND_FONT__;--__P__-font-display: var(--__P__-font);--__P__-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;--__P__-bg: oklch(1 0 0);--__P__-bg-elevated: oklch(.9789 .0029 278.3);--__P__-surface: var(--__P__-bg-elevated);--__P__-muted: var(--__P__-fg-muted);--__P__-hover: oklch(.1686 .011 278.3 / .06);--__P__-fg: oklch(.1686 .011 278.3);--__P__-fg-muted: oklch(.4932 .0301 278.3);--__P__-border: oklch(.9312 .0084 278.3);--__P__-border-strong: oklch(.8757 .0131 278.3);--__P__-bubble-user: var(--__P__-accent);--__P__-bubble-user-text: var(--__P__-accent-text);--__P__-bubble-assistant: oklch(.9638 .0058 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-on-accent: var(--__P__-accent-text);--__P__-success: oklch(.6456 .1654 151.53);--__P__-warning: oklch(.7135 .1494 74.05);--__P__-danger: oklch(.5966 .1818 24.51);--__P__-danger-text: oklch(.5054 .1905 27.52);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .1);--__P__-neutral: oklch(.7137 .0192 278.3);--__P__-focus: var(--__P__-accent);--__P__-shadow-panel: 0 8px 24px -8px rgba(13, 15, 20, .18), 0 24px 64px -24px rgba(13, 15, 20, .24);--__P__-shadow-card: 0 1px 2px rgba(13, 15, 20, .06), 0 4px 12px -6px rgba(13, 15, 20, .12);--__P__-backdrop: oklch(.1686 .011 278.3 / .55);--__P__-shadow-fab: 0 6px 16px -4px color-mix(in oklch, var(--__P__-accent) 45%, transparent), 0 12px 32px -12px rgba(13, 15, 20, .25);--__P__-z-fab: 2147483600;--__P__-z-panel: 2147483601;--__P__-panel-w: 380px;--__P__-panel-h: 600px;--__P__-fab-size: 56px;--__P__-space-1: 4px;--__P__-space-2: 8px;--__P__-space-3: 12px;--__P__-space-4: 16px;--__P__-space-5: 20px;--__P__-space-6: 24px;--__P__-space-8: 32px;--__P__-text-xs: 12px;--__P__-text-sm: 13px;--__P__-text-base: 15px;--__P__-text-md: 16px;--__P__-text-lg: 18px;--__P__-text-xl: 22px;--__P__-text-2xl: 30px;--__P__-ease: cubic-bezier(.2, .7, .2, 1);--__P__-ease-out: cubic-bezier(.2, .7, .2, 1);--__P__-ease-in: cubic-bezier(.4, 0, 1, 1);--__P__-ease-in-out: cubic-bezier(.65, 0, .35, 1);--__P__-dur-quick: .12s;--__P__-dur-base: .22s;--__P__-dur-slow: .32s;font-family:var(--__P__-font);color:var(--__P__-fg);color-scheme:light}:host([data-theme="dark"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-danger-text: oklch(.8077 .1035 19.57);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .18);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);--__P__-shadow-card: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px -6px rgba(0, 0, 0, .5);--__P__-backdrop: rgba(0, 0, 0, .65);color-scheme:dark}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);color-scheme:dark}}@media(prefers-reduced-motion:reduce){:host{--__P__-dur-quick: 1ms;--__P__-dur-base: 1ms;--__P__-dur-slow: 1ms}}
2
2
  `;var gi=`*,*:before,*:after{box-sizing:border-box;margin:0;padding:0;border:0}button{font:inherit;color:inherit;background:none;cursor:pointer;-webkit-appearance:none;appearance:none;line-height:1}button:focus-visible,[tabindex]:focus-visible,textarea:focus-visible,input:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}textarea,input{font:inherit;color:inherit;background:none;border:0;outline:0;resize:none}a{color:var(--__P__-accent);text-decoration:underline;text-underline-offset:2px}img,svg{display:block;max-width:100%}ul,ol{list-style:none}.__P__-app{display:block;width:100%;height:100%;font-family:var(--__P__-font);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:"cv11","ss01","ss03"}.__P__-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
3
3
  `;var mi=`.__P__-anchor{right:16px;bottom:16px}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:14px}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:14px;background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:#ffffff26}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:12px 14px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:14px;font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-left:auto;display:flex;align-items:center;gap:var(--__P__-space-1);flex-shrink:0}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:14px;font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;right:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px;scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-date-divider{position:sticky;top:var(--__P__-space-2);z-index:1;display:flex;justify-content:center;margin:var(--__P__-space-1) 0;pointer-events:none}.__P__-date-pill{padding:3px 10px;border-radius:999px;font-size:11px;font-weight:600;color:var(--__P__-fg-muted);background:color-mix(in oklch,var(--__P__-bg-elevated) 92%,transparent);border:1px solid var(--__P__-border);box-shadow:var(--__P__-shadow-card);backdrop-filter:blur(4px)}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:14px;word-wrap:break-word;overflow-wrap:anywhere;box-shadow:0 1px 2px #0000000a,0 1px 8px -4px #0000000f;animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-bubble ::selection{background:color-mix(in srgb,var(--__P__-accent) 30%,transparent)}.__P__-bubble-row[data-role=user] .__P__-bubble ::selection{background:#fff6;color:var(--__P__-bubble-user-text)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-bottom-right-radius:5px}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-bottom-left-radius:5px}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-time{margin-top:3px;padding:0 4px;font-size:11px;line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-left:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-left:2px}.__P__-md li::marker{color:var(--__P__-fg-muted)}.__P__-md li>p{margin:6px 0}.__P__-md li>ul,.__P__-md li>ol{margin:6px 0}.__P__-md strong,.__P__-md b{font-weight:650;letter-spacing:-.005em}.__P__-md em,.__P__-md i{font-style:italic}.__P__-md code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:12.5px;padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-left:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-radius:0 var(--__P__-radius-sm) var(--__P__-radius-sm) 0;color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:left}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:6px;height:6px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-left:var(--__P__-space-3);border-left:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-tool-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2);margin-top:6px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs)}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:14px;line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:16px}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 10px;border-radius:var(--__P__-radius-sm);background:var(--__P__-danger-bg);color:var(--__P__-danger-text);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error button{color:inherit;text-decoration:underline;font-size:var(--__P__-text-sm)}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:14px;text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-2)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:12px 8px 6px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-item{all:unset;display:flex;flex-direction:column;gap:3px;padding:10px 12px;border-radius:var(--__P__-radius-md);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-title{font-size:14px;font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-preview{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-item[data-closed=true] .__P__-history-title:after{content:"\\2022";margin-left:var(--__P__-space-2);opacity:.5}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:11px;line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:11px;letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;right:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent)}.__P__-menu-check svg{width:14px;height:14px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-help-card .__P__-list-row:hover{background:var(--__P__-hover)}.__P__-module-cta{padding:var(--__P__-space-3);border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-4px;left:calc(50% + 6px);min-width:16px;height:16px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:var(--__P__-accent);color:var(--__P__-on-accent);font-size:10px;font-weight:600;line-height:1}.__P__-home-hero{flex-shrink:0;padding:var(--__P__-space-5) var(--__P__-space-5) var(--__P__-space-3);color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-home-hero-top{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);min-height:32px}.__P__-home-brand{font-size:14px;font-weight:600;letter-spacing:.01em;color:color-mix(in srgb,#fff 82%,transparent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.__P__-home-brand-spacer{flex:1}.__P__-home-hero-actions{display:flex;align-items:center;gap:var(--__P__-space-2);flex-shrink:0}.__P__-home-hero-actions .__P__-icon-btn{color:#fff}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:var(--__P__-text-2xl);font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:2px 0 0;font-family:var(--__P__-font-display);font-size:var(--__P__-text-2xl);font-weight:800;line-height:1.18;letter-spacing:-.01em;color:color-mix(in srgb,var(--__P__-on-accent) 88%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-left:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-left:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:left;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:14px}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-at{color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);flex-shrink:0}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:14px}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:left}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:14px}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:14px;color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:left;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-bg-elevated)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:left;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-tags{display:flex;gap:6px;flex-wrap:wrap}.__P__-news-tag{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);padding:2px 8px;border-radius:999px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:14px;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;right:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}
4
4
  `;var hi=`.__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}
@@ -8,7 +8,7 @@ var Ws=Object.defineProperty;var Ks=(e,t,n)=>t in e?Ws(e,t,{enumerable:!0,config
8
8
 
9
9
  `))!==-1;){let l=o.slice(0,s);o=o.slice(s+2);let c=ki(l);c&&(yield c)}}}finally{n.releaseLock()}}function ki(e){let t="",n;for(let o of e.split(`
10
10
  `))if(!(o===""||o.startsWith(":"))){if(o.startsWith("data:")){let i=o.slice(5).replace(/^ /,"");t=t?`${t}
11
- ${i}`:i;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(!t||t==="[DONE]")return null;try{let o=JSON.parse(t);return wi.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){return wi.trace("frame parse failed",{err:o,payload:t.slice(0,200)}),null}}function cc(e){let t=new TextEncoder().encode(e),n="";for(let o of t)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var Ei=e=>e&&Object.keys(e).length>0?e:void 0;function Ci(e,t){let n=Ei(e),o=Ei(t);if(!n&&!o)return;let i={};return n&&(i.user=n),o&&(i.page=o),cc(JSON.stringify(i))}var ke={startSession:"/ai/agent/start-session",streamMessage:"/ai/agent/stream-message",streamResume:"/ai/agent/stream-resume",cancelStream:"/ai/agent/cancel-stream",listSessions:"/ai/agent/list-sessions",listMessages:"/ai/agent/list-messages",updateSettings:"/ai/agent/update-settings",markRead:"/ai/agent/mark-read",content:"/ai/agent/content"},Ai="context";function Ti(e){let n={messages:e.messages.map(a=>({id:a.id,parts:_c(a),role:a.role,createdAt:a.createdAt})),sessionId:e.sessionId,trigger:e.trigger??"submit-message"};e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs);let o={},i=e.tools?.map(dc).filter(a=>a!==null);return i?.length&&(o.tools=i),e.responseMode&&(o.responseMode=e.responseMode),Object.keys(o).length>0&&(n.data=o),n}function dc(e){return typeof e=="string"?e?{code:e}:null:e?.code?e:null}function _c(e){let t=[];for(let n of e.parts)n.kind==="text"&&n.text&&t.push({text:n.text,type:"text"}),n.kind==="file"&&n.url&&t.push({mediaType:n.mediaType,type:"file",url:n.url});for(let n of e.attachments??[])n.url&&t.push({type:"file",url:n.url,mediaType:n.mediaType,filename:n.name,fileId:n.id,fileSize:n.size});return t}var q=M.scope("transport"),uc=3,Mi=400,Ii=3,pc=new Set([408,425,429,500,502,503,504]);function Ri(e){return Mi*2**e+Math.floor(Math.random()*250)}function fc(e){let t=e.get("retry-after");if(!t)return null;let n=Number(t),o=Number.isFinite(n)?n*1e3:Date.parse(t)-Date.now();return Number.isFinite(o)&&o>=0?Math.min(o,3e4):null}function Ro(e,t){return new Promise(n=>{if(t?.aborted)return n();let o=setTimeout(a,e),i=()=>a();t?.addEventListener("abort",i,{once:!0});function a(){clearTimeout(o),t?.removeEventListener("abort",i),n()}})}var fn=class{constructor(t){W(this,"opts",t);W(this,"visitorId");W(this,"sessionId");W(this,"userContext");W(this,"pageContext")}setContext(t,n){this.userContext=t,this.pageContext=n}primeIdentity(t,n){t&&(this.visitorId=t),n&&(this.sessionId=n)}envelope(){let t={};this.visitorId&&(t.visitorId=this.visitorId),this.sessionId&&(t.sessionId=this.sessionId);let n=Ci(this.userContext,this.pageContext);return n&&(t[Ai]=n),t}withEnvelope(t){return{...this.envelope(),...t}}appendEnvelope(t){for(let[n,o]of Object.entries(this.envelope()))t.append(n,o);return t}withEnvelopeQuery(t){let n=new URL(this.url(t));for(let[o,i]of Object.entries(this.envelope()))n.searchParams.has(o)||n.searchParams.set(o,i);return n.toString()}async startSession(t){q.debug("startSession \u2192",{visitorId:t.visitorId,sessionId:t.sessionId,locale:t.locale});let n=await this.postJson(ke.startSession,t,"startSession");return q.debug("startSession \u2190",{visitorId:n.visitorId,sessionId:n.sessionId,canContinue:n.canContinue,hasMessages:!!n.messages?.length,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),mc(n)||q.warn("startSession response did not match expected shape; using raw response",{response:n}),this.visitorId=n.visitorId??t.visitorId,this.sessionId=n.sessionId,n}async uploadFile(t){q.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let n=new FormData;n.append("file",t,t.name);let o=await this.postForm(this.uploadPath,n,"upload");return q.debug("uploadFile \u2190",{id:o.id,url:o.url}),o}async transcribe(t,n="audio/webm"){q.debug("transcribe \u2192",{size:t.size,mimeType:n});let o=new FormData;o.append("audio",t,`voice.${gc(n)}`),o.append("mimeType",n);let i=await this.postForm(this.transcribePath,o,"transcribe");return q.debug("transcribe \u2190",{textLen:i.text.length}),i}async listSessions(t={}){let n=new URL(this.url(ke.listSessions));t.visitorId&&n.searchParams.set("visitorId",t.visitorId),t.limit&&n.searchParams.set("limit",String(t.limit)),t.cursor&&n.searchParams.set("cursor",t.cursor),q.debug("listSessions \u2192",{visitorId:t.visitorId??this.visitorId,limit:t.limit,cursor:t.cursor});let o=await this.getJson(n.toString(),"listSessions"),i=o.sessions??[];return q.debug("listSessions \u2190",{count:i.length,nextCursor:o.nextCursor}),{sessions:i.map(a=>({sessionId:a.sessionId,title:a.title,lastMessageAt:a.lastMessageAt,preview:a.preview,canContinue:a.canContinue,unreadCount:a.unreadCount})),nextCursor:o.nextCursor}}async loadSession(t){let n=new URL(this.url(ke.listMessages));n.searchParams.set("sessionId",t),q.debug("loadSession \u2192",{sessionId:t,visitorId:this.visitorId});let o=await this.getJson(n.toString(),"loadSession"),i=o.messages??[];return q.debug("loadSession \u2190",{sessionId:o.sessionId,canContinue:o.canContinue,messageCount:i.length,hasSuggestions:!!o.suggestions}),{sessionId:o.sessionId,canContinue:o.canContinue??!0,messages:i,agent:o.agent,suggestions:o.suggestions}}async markRead(t){if(!(!this.visitorId||!t)){q.debug("markRead \u2192",{sessionId:t,visitorId:this.visitorId});try{await this.postJson(ke.markRead,{sessionId:t},"markRead")}catch(n){q.debug("markRead failed (non-fatal)",{err:n})}}}async listContent(t={}){let n=new URL(this.url(ke.content));for(let[a,s]of Object.entries(t))s!==void 0&&n.searchParams.set(a,Array.isArray(s)?s.join(","):String(s));q.debug("listContent \u2192",t);let o=await this.getJson(n.toString(),"listContent"),i=o.items??[];return q.debug("listContent \u2190",{count:i.length,total:o.pagination?.total}),{...o,items:i}}async saveUserPrefs(t){q.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,sessionId:this.sessionId,settingsKeys:Object.keys(t)});let n=await this.postJson(ke.updateSettings,{userPrefs:t},"saveUserPrefs");return q.debug("saveUserPrefs \u2190",{ok:n.ok}),n}get uploadPath(){return this.opts.endpoints?.upload??"/ai/agent/upload-file"}get transcribePath(){return this.opts.endpoints?.transcribe??"/ai/agent/transcribe-audio"}sendMessage(t){q.debug("message \u2192",{sessionId:t.sessionId,visitorId:t.visitorId,messageCount:t.messages.length,trigger:t.trigger,responseMode:t.data?.responseMode,tools:t.data?.tools?.map(s=>s.code)});let n=new AbortController,o=new Set;return{iter:this.runStream(t,n,o),cancel:()=>this.cancelStream(n,t.sessionId)}}resumeStream(){let t=new AbortController,n=new Set;return{iter:this.resumeStreamGen(t,n,!0),cancel:()=>t.abort()}}async*runStream(t,n,o){(yield*this.drain(this.openMessageStream(t,n.signal),o,n))||(yield*this.resumeStreamGen(n,o,!1))}async*resumeStreamGen(t,n,o){for(let i=1;i<=uc&&!t.signal.aborted;i++){if((!o||i>1)&&(await Ro(Mi*i,t.signal),t.signal.aborted))return;let a;try{a=await this.fetchImpl(this.resumeUrl(n.size),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(l){if(t.signal.aborted)return;q.debug("resume fetch failed \u2014 retrying",{attempt:i,err:l});continue}if(a.status===204||!a.ok){q.debug("resume \u2192 no in-flight stream",{status:a.status});return}let s=n.size;if(yield*this.drain(Io(a,t.signal),n,t))return;if(n.size===s){q.debug("resume \u2192 stream closed with no new events; nothing to resume");return}}if(!t.signal.aborted)throw new be("stream incomplete after resume attempts","server")}async*drain(t,n,o){try{for await(let i of t){if(o.signal.aborted)return!0;if(i.eventId){if(n.has(i.eventId))continue;n.add(i.eventId)}if(yield i,i.chunk.type==="finish"||i.chunk.type==="error")return!0}}catch(i){if(o.signal.aborted)return!0;if(i instanceof be&&i.status!==void 0)throw i;q.debug("stream segment dropped",{err:i})}return!1}cancelStream(t,n){t.signal.aborted||(q.debug("cancel stream",{sessionId:n,visitorId:this.visitorId}),t.abort(),!(!this.visitorId||!n)&&this.fetchImpl(this.url(ke.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({})),keepalive:!0}).catch(o=>q.debug("cancel POST failed (non-fatal)",{err:o})))}async*openMessageStream(t,n){let o=await this.fetchImpl(this.url(ke.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"text/event-stream","content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(t)),signal:n});yield*Io(o,n)}resumeUrl(t){let n=new URL(this.withEnvelopeQuery(ke.streamResume));return n.searchParams.set("resumeAt",String(t)),n.toString()}async postJson(t,n,o){let i=await this.fetchWithRetry(()=>[this.url(t),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(n))}],o);return this.assertOk(i,o)}async postForm(t,n,o){let i=await this.fetchImpl(this.url(t),{method:"POST",credentials:"omit",headers:this.opts.auth.headers(),body:this.appendEnvelope(n)});return this.assertOk(i,o)}async getJson(t,n){let o=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.opts.auth.headers()}}],n);return this.assertOk(o,n)}async fetchWithRetry(t,n){for(let o=0;;o++){let[i,a]=t(),s;try{s=await this.fetchImpl(i,a)}catch(c){if(o>=Ii)throw new be(`${n} failed: network error`,"network",void 0,c);q.debug("request network error \u2014 retrying",{label:n,attempt:o}),await Ro(Ri(o));continue}if(s.ok||!pc.has(s.status)||o>=Ii)return s;let l=fc(s.headers)??Ri(o);q.debug("request retryable status \u2014 retrying",{label:n,status:s.status,attempt:o,wait:l}),await Ro(l)}}async assertOk(t,n){if(!t.ok)throw new be(`${n} failed: ${t.status}`,"server",t.status);return await t.json()}url(t){return/^https?:\/\//i.test(t)?t:`${this.opts.baseUrl}${t}`}get fetchImpl(){return this.opts.fetchImpl??globalThis.fetch.bind(globalThis)}};function gc(e){return e.includes("webm")?"webm":e.includes("ogg")?"ogg":e.includes("mp4")||e.includes("m4a")?"m4a":e.includes("mpeg")?"mp3":e.includes("wav")?"wav":"bin"}function mc(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.sessionId=="string"&&typeof t.canContinue=="boolean"}function Li(e,t){let n=e?[{kind:"text",id:"t0",textSig:L(e),doneSig:L(!0)}]:[];return{id:we(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:L(n)}}function Mo(){return{id:we(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:L([])}}function Ni(e){return{id:e.id,role:e.role,createdAt:Date.now(),status:"streaming",partsSig:L([{kind:"text",id:`${e.id}-t0`,textSig:L(""),doneSig:L(!1)}])}}function Oi(e){return hc({id:e.id,role:e.role,createdAt:Date.now(),status:"complete",parts:[{kind:"text",id:`${e.id}-t0`,text:e.text,done:!0}]})}function hc(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,errorText:e.errorText,finishReason:e.finishReason,attachments:e.attachments,partsSig:L(e.parts.map(vc))}}function Lo(e){let t=e.parts.map((n,o)=>n.type==="text"?{kind:"text",id:`${e.id}-t${o}`,textSig:L(n.text),doneSig:L(!0)}:n.type==="file"?{kind:"file",url:n.url,mediaType:n.mediaType}:null).filter(n=>n!==null);return{id:e.id,role:e.role,createdAt:e.createdAt??Date.now(),status:"complete",partsSig:L(t)}}function Di(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,errorText:e.errorText,finishReason:e.finishReason,attachments:e.attachments,parts:e.partsSig.value.map(bc)}}function No(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function vc(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:L(e.text),doneSig:L(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartialSig:L(e.inputPartial),inputSig:L(e.input),outputSig:L(e.output),errorSig:L(e.error),stateSig:L(e.state)}:e}function bc(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,text:e.textSig.value,done:e.doneSig.value}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartial:e.inputPartialSig.value,input:e.inputSig.value,output:e.outputSig.value,error:e.errorSig.value,state:e.stateSig.value}:e}var Hi=M.scope("reducer"),gn=class{constructor(t){W(this,"messagesSig",t);W(this,"active",null)}attach(t){this.active=t}detach(){this.active=null}apply(t){let n=this.active;if(n)switch(t.type){case"start":case"start-step":case"finish-step":return;case"finish":Hi.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":Hi.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=t.errorText,this.bumpDone(n);return;case"text-start":it(n,"text",t.id);return;case"text-delta":{let o=it(n,"text",t.id);o.textSig.value+=t.delta;return}case"text-end":it(n,"text",t.id).doneSig.value=!0;return;case"reasoning-start":it(n,"reasoning",t.id).doneSig.value=!1;return;case"reasoning-delta":{let o=it(n,"reasoning",t.id);o.textSig.value+=t.delta;return}case"reasoning-end":it(n,"reasoning",t.id).doneSig.value=!0;return;case"tool-input-start":case"tool-input-delta":case"tool-input-available":case"tool-output-available":case"tool-output-error":xc(n,t);return;case"file":mn(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":{if(n.partsSig.value.some(i=>i.kind==="source"&&i.sourceId===t.sourceId))return;mn(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return}case"data-notification":return;default:{let o=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value=[...this.messagesSig.value]}};function it(e,t,n){let o=e.partsSig.value.find(a=>a.kind===t&&a.id===n);if(o)return o;let i={kind:t,id:n,textSig:L(""),doneSig:L(!1)};return mn(e,i),i}function yt(e,t,n){let o=e.partsSig.value.find(a=>a.kind==="tool"&&a.toolCallId===t);if(o)return o;let i={kind:"tool",toolCallId:t,toolName:n??"tool",inputPartialSig:L(""),inputSig:L(void 0),outputSig:L(void 0),errorSig:L(void 0),stateSig:L("input")};return mn(e,i),i}function mn(e,t){e.partsSig.value=[...e.partsSig.value,t]}function xc(e,t){switch(t.type){case"tool-input-start":yt(e,t.toolCallId,t.toolName);return;case"tool-input-delta":{let n=yt(e,t.toolCallId);n.inputPartialSig.value+=t.delta;return}case"tool-input-available":{let n=yt(e,t.toolCallId,t.toolName);n.inputSig.value=t.input,n.stateSig.value="awaiting";return}case"tool-output-available":{let n=yt(e,t.toolCallId);n.outputSig.value=t.output,n.stateSig.value="output";return}case"tool-output-error":{let n=yt(e,t.toolCallId);n.errorSig.value=t.errorText,n.stateSig.value="error";return}default:return}}var hn=M.scope("persistence");function St(e,t=an){let n=`${v.cssPrefix}.${e}`,o=`${n}.visitorId`,i=`${n}.sessionId`,a=`${n}.userPrefs`,s=`${n}.panelOpen`,l=`${n}.panelSize`,c=`${n}.calloutDismissed`,_=`${n}.sidebarCollapsed`,p=`${n}.activeModule`,d={getVisitorId(){let u=t.get(o);if(u)return u;let g=we();return t.set(o,g),g},setVisitorId(u){hn.debug("setVisitorId (rebind)",{id:u,widgetId:e}),t.set(o,u)},loadSessionId(){return t.get(i)??void 0},saveSessionId(u){hn.trace("saveSessionId",{id:u,widgetId:e}),u?t.set(i,u):t.remove(i)},loadUserPrefs(){let u=t.get(a);if(!u)return{};try{let g=JSON.parse(u);return Pc(g)?g:{}}catch(g){return hn.warn("loadUserPrefs parse failed",{error:g}),{}}},saveUserPrefs(u){try{t.set(a,JSON.stringify(u))}catch(g){hn.warn("saveUserPrefs serialise failed",{error:g})}},patchUserPrefs(u){let g=d.loadUserPrefs();d.saveUserPrefs({...g,...u})},loadPanelOpen(){let u=t.get(s);return u==="1"?!0:u==="0"?!1:null},savePanelOpen(u){t.set(s,u?"1":"0")},loadPanelSize(){let u=t.get(l);return u==="normal"||u==="expanded"||u==="fullscreen"?u:null},savePanelSize(u){t.set(l,u)},loadCalloutDismissed(u){if(!u)return!1;let g=t.get(c);return!!g&&g===u},saveCalloutDismissed(u){u?t.set(c,u):t.remove(c)},loadSidebarCollapsed(){let u=t.get(_);return u==="1"?!0:u==="0"?!1:null},saveSidebarCollapsed(u){t.set(_,u?"1":"0")},loadActiveModule(){return t.get(p)||null},saveActiveModule(u){t.set(p,u)},clearSession(){t.remove(i)}};return d}function Pc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Bi=M.scope("feedback:audio"),vn=class{constructor(){W(this,"ctx",null);W(this,"master",null);W(this,"buffers",new Map)}unlock(){if(this.ctx){this.ctx.state==="suspended"&&this.ctx.resume();return}let t=globalThis.AudioContext??globalThis.webkitAudioContext;if(t)try{this.ctx=new t,this.master=this.ctx.createGain(),this.master.gain.value=1,this.master.connect(this.ctx.destination)}catch(n){Bi.warn("AudioContext init failed",{err:n})}}setVolume(t){if(!this.master||!this.ctx)return;let n=Math.max(0,Math.min(1,t));this.master.gain.setTargetAtTime(n,this.ctx.currentTime,.01)}playTone(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let i=n.currentTime,a=t.noteMs/1e3;t.notes.forEach((s,l)=>{let c=n.createOscillator();c.type=t.type,c.frequency.value=s;let _=n.createGain(),p=i+l*a;_.gain.setValueAtTime(1e-4,p),_.gain.exponentialRampToValueAtTime(t.peakGain,p+.005),_.gain.exponentialRampToValueAtTime(1e-4,p+a),c.connect(_).connect(o),c.start(p),c.stop(p+a+.01)})}async playUrl(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let i=await this.getBuffer(t);if(!i)return;let a=n.createBufferSource();a.buffer=i,a.connect(o),a.start()}destroy(){this.ctx&&this.ctx.close().catch(()=>{}),this.ctx=null,this.master=null,this.buffers.clear()}async getBuffer(t){if(!this.ctx)return null;let n=this.buffers.get(t);if(n)return n instanceof Promise,n;let o=this.ctx,i=fetch(t).then(a=>a.ok?a.arrayBuffer():Promise.reject(new Error(`fetch ${a.status}`))).then(a=>o.decodeAudioData(a)).then(a=>(this.buffers.set(t,a),a)).catch(a=>(Bi.warn("audio fetch/decode failed",{url:t,err:a}),this.buffers.delete(t),null));return this.buffers.set(t,i),i}};var $i={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},Ui={messageReceived:{notes:[880,1318.51],noteMs:90,type:"sine",peakGain:.45},messageSent:{notes:[1568],noteMs:60,type:"sine",peakGain:.25},error:{notes:[523.25,392],noteMs:120,type:"triangle",peakGain:.55},voiceStart:{notes:[1318.51],noteMs:50,type:"sine",peakGain:.3},voiceStop:{notes:[880],noteMs:50,type:"sine",peakGain:.3}};var Be=null,bn=0;function yc(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function Sc(){if(typeof document>"u")return null;let e=document.createElement("input");e.type="checkbox",e.setAttribute("switch",""),e.setAttribute("aria-hidden","true"),e.tabIndex=-1,e.id=`__${v.cssPrefix}_haptic_${Math.random().toString(36).slice(2)}`;let t=document.createElement("label");t.htmlFor=e.id,t.setAttribute("aria-hidden","true");let n="position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;opacity:0!important;pointer-events:none!important;";return e.style.cssText=n,t.style.cssText=n,document.body.append(e,t),{input:e,label:t}}function zi(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(yc())try{navigator.vibrate(e);return}catch{}if(Be||(Be=Sc()),!!Be)try{Be.label.click()}catch{}}}function Fi(){bn++;let e=!1;return()=>{e||(e=!0,bn=Math.max(0,bn-1),bn===0&&Be&&(Be.input.remove(),Be.label.remove(),Be=null))}}var wc=M.scope("feedback"),kc=100,xn=class{constructor(t,n){W(this,"mutedSig",L(!1));W(this,"audio",new vn);W(this,"releaseHaptics");W(this,"sound");W(this,"haptics");W(this,"lastPlayed",new Map);W(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=Fi(),this.audio.setVolume(this.effectiveVolume()),typeof matchMedia<"u"&&(this.reducedMotionMq=matchMedia("(prefers-reduced-motion: reduce)"))}unlock(){this.audio.unlock(),this.audio.setVolume(this.effectiveVolume())}update(t,n){this.sound=t,this.haptics=n,this.audio.setVolume(this.effectiveVolume())}setMuted(t){this.mutedSig.value!==t&&(this.mutedSig.value=t)}toggleMuted(){this.mutedSig.value=!this.mutedSig.value}play(t){this.mutedSig.value||this.isDeduped(t)||(this.lastPlayed.set(t,performance.now()),this.sound.enabled&&this.playSound(t),this.haptics.enabled&&this.isTouchDevice()&&this.playHaptic(t))}destroy(){this.audio.destroy(),this.releaseHaptics()}isDeduped(t){let n=this.lastPlayed.get(t);return n===void 0?!1:performance.now()-n<kc}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(i=>wc.warn("audio play failed",{err:i,url:n}));return}let o=Ui[t];o&&this.audio.playTone(o)}playHaptic(t){if(this.reducedMotionMq?.matches)return;let n=this.haptics.events?.[t];if(n===!1)return;let o=n===!0||n===void 0?$i[t]:n;zi(o)}effectiveVolume(){let t=this.sound.volume??.3;return this.reducedMotionMq?.matches?t*.5:t}isTouchDevice(){return typeof window>"u"?!1:matchMedia("(hover: none) and (pointer: coarse)").matches}};function Ke(e,t){return e instanceof be&&e.status===429?t.errorRateLimited:t.errorGeneric}var Ec=0;function r(e,t,n,o,i,a){t||(t={});var s,l,c=t;if("ref"in c)for(l in c={},t)l=="ref"?s=t[l]:c[l]=t[l];var _={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ec,__i:-1,__u:0,__source:i,__self:a};if(typeof e=="function"&&(s=e.defaultProps))for(l in s)c[l]===void 0&&(c[l]=s[l]);return H.vnode&&H.vnode(_),_}var T={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},Cc=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})}),Ee=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M18 6 6 18M6 6l12 12"})}),Wi=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M12 5v14M5 12h14"})}),Ki=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"m22 2-7 20-4-9-9-4Z"}),r("path",{d:"M22 2 11 13"})]}),Gi=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M12 19V5M5 12l7-7 7 7"})}),Vi=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M3 20V4l18 8-18 8Z"})}),Pn=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"m9 18 6-6-6-6"})}),qi=()=>r("svg",{...T,"aria-hidden":"true",children:r("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),Xi=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"m21 11-9 9a5.5 5.5 0 0 1-7.78-7.78l8.49-8.49a3.67 3.67 0 0 1 5.19 5.19l-8.49 8.49a1.83 1.83 0 0 1-2.6-2.6l7.78-7.78"})}),ji=()=>r("svg",{...T,"aria-hidden":"true",children:[r("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),r("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]}),Yi=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),Ji=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),Qi=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),Zi=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),ea=()=>r("svg",{...T,"aria-hidden":"true",viewBox:"0 0 10 10",children:r("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),ta=()=>r("svg",{...T,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]}),na=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})}),oa=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),ra=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M20 6 9 17l-5-5"})}),ia=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M3 3v6h6"}),r("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),r("path",{d:"M12 7v5l3 2"})]});var wt=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),aa=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M15 3h6v6M10 14 21 3M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5"})}),sa=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M12 20h9"}),r("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),la=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"m6 9 6 6 6-6"})}),ca=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),r("path",{d:"M14 2v6h6"})]}),Ac=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),r("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]}),Tc=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})}),Oo=()=>r("svg",{...T,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),r("path",{d:"M12 17h.01"})]}),Ic=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"m15 4 3 3-9 9-3-3z"}),r("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]}),Rc=()=>r("svg",{...T,"aria-hidden":"true",children:[r("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),r("path",{d:"M12 8V4"}),r("circle",{cx:"12",cy:"3",r:"1"}),r("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]}),Mc=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),r("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),r("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),r("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]}),Lc=()=>r("svg",{...T,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("circle",{cx:"12",cy:"12",r:"4"}),r("path",{d:"m4.93 4.93 4.24 4.24M14.83 14.83l4.24 4.24M14.83 9.17l4.24-4.24M4.93 19.07l4.24-4.24"})]}),Do=()=>r("svg",{...T,"aria-hidden":"true",children:[r("circle",{cx:"11",cy:"11",r:"7"}),r("path",{d:"m21 21-4.3-4.3"})]}),da=()=>r("svg",{...T,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),_a=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M3 9.5 12 3l9 6.5"}),r("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]}),ua=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"m3 11 15-5v12L3 13z"}),r("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),r("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),r("path",{d:"M21 10a3 3 0 0 1 0 4"})]}),kt=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),r("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}),pa=()=>r("svg",{...T,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"4"}),r("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}),fa=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),ga=()=>r("svg",{...T,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 3v18"}),r("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]}),Nc=()=>r("svg",{...T,"aria-hidden":"true",children:[r("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),r("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),r("path",{d:"m20 20-4.4-4.4"})]}),Oc=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M12 3.5 13.6 9 19 10.5 13.6 12 12 17.5 10.4 12 5 10.5 10.4 9z"}),r("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]}),Dc=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M4 18h16"}),r("path",{d:"M5 18a7 7 0 0 1 14 0"}),r("path",{d:"M12 8V6"}),r("path",{d:"M10 6h4"})]}),Hc=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),r("path",{d:"M16 9.5a1.5 1.5 0 0 1 3 0v2.5a7 7 0 0 1-7 7 7 7 0 0 1-6.4-4.2L4 12.5a1.5 1.5 0 0 1 2.6-1.5L7 11"})]}),ma={chat:Cc,message:Tc,bubbles:kt,spark:Ac,wand:Ic,bot:Rc,help:Oo,lifebuoy:Lc,headset:Mc,search:Nc,sparkles:Oc,concierge:Dc,wave:Hc};var I=v.cssPrefix,k={launcher:`${I}-launcher`,callout:`${I}-callout`,calloutDismiss:`${I}-callout-dismiss`,panel:`${I}-panel`,panelHeader:`${I}-panel-header`,resizeGrip:`${I}-resize-grip`,scrollToBottom:`${I}-scroll-to-bottom`,actionHistory:`${I}-action-history`,actionClose:`${I}-action-close`,composer:`${I}-composer`,composerInput:`${I}-composer-input`,composerSend:`${I}-composer-send`,composerStop:`${I}-composer-stop`,composerAttach:`${I}-composer-attach`,composerFileInput:`${I}-composer-file-input`,composerVoice:`${I}-composer-voice`,attachmentChip:`${I}-attachment-chip`,attachmentRemove:`${I}-attachment-remove`,suggestion:`${I}-suggestion`,messageBubble:`${I}-message`,messageRetry:`${I}-message-retry`,historyPane:`${I}-history-pane`,historyBack:`${I}-history-back`,historyItem:`${I}-history-item`,sidebar:`${I}-sidebar`,sidebarToggle:`${I}-sidebar-toggle`,sidebarNewChat:`${I}-sidebar-new-chat`,sidebarItem:`${I}-sidebar-item`,messengerHome:`${I}-messenger-home`,modulesEmpty:`${I}-modules-empty`,tab:`${I}-tab`,tabBadge:`${I}-tab-badge`,homeView:`${I}-home-view`,homeGreeting:`${I}-home-greeting`,homeBrand:`${I}-home-brand`,backHeader:`${I}-back-header`,contentView:`${I}-content-view`,contentScroll:`${I}-content-scroll`,homeSearch:`${I}-home-search`,helpSearch:`${I}-help-search`,homeRecent:`${I}-home-recent`,homeContentRow:`${I}-home-content-row`,helpArticle:`${I}-help-article`,newsItem:`${I}-news-item`};function ce(e,t){return`${e}-${t}`}var yn=v.cssPrefix;function ha({onToggle:e,launcher:t,strings:n,leaving:o,edgeTab:i}){let a=t.variant!=="circle"&&!!t.label;return r("button",{type:"button",class:`${yn}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":i?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":k.launcher,onClick:e,"aria-label":n.launcherOpen,children:[Bc(t.icon),a?r("span",{class:`${yn}-fab-label`,children:t.label}):null]})}function Bc(e){let t=ma[e];return t?r(t,{}):r($c,{source:e})}function $c({source:e}){return r("span",{ref:t=>{t&&Uc(t,e)},"aria-hidden":"true"})}function Uc(e,t){if(e.dataset.svgMounted!==t)try{let o=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;o&&o.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(o,!0)),e.dataset.svgMounted=t)}catch{}}function va({callout:e,launcherPosition:t,closeLabel:n,onDismiss:o}){let[i,a]=w(!1);return S(()=>{let s=setTimeout(()=>a(!0),e.delayMs);return()=>clearTimeout(s)},[e.delayMs]),S(()=>{if(!i||e.autoDismissMs<=0)return;let s=setTimeout(o,e.autoDismissMs);return()=>clearTimeout(s)},[i,e.autoDismissMs,o]),i?r("div",{class:`${yn}-callout`,role:"status","data-shape":e.shape,"data-position":zc(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":k.callout,children:[r("span",{children:e.text}),r("button",{type:"button",class:`${yn}-callout-close`,onClick:o,"aria-label":n,title:n,"data-testid":k.calloutDismiss,children:r(Ee,{})})]}):null}function zc(e,t){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"?o?"top":"bottom":n?"left":"right"}function Sn({panelEl:e,resize:t,position:n,initialSize:o,onSizeChange:i,strings:a}){let s=v.cssPrefix,l=N(null);if(S(()=>{if(!e)return;let m=e.style;t.minWidth&&m.setProperty(`--${s}-resize-min-w`,t.minWidth),t.maxWidth&&m.setProperty(`--${s}-resize-max-w`,t.maxWidth),t.minHeight&&m.setProperty(`--${s}-resize-min-h`,t.minHeight),t.maxHeight&&m.setProperty(`--${s}-resize-max-h`,t.maxHeight),o&&(m.setProperty(`--${s}-widget-w`,`${o.width}px`),m.setProperty(`--${s}-widget-h`,`${o.height}px`))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,s,o]),!e)return null;let c=n.startsWith("top-"),_=n.endsWith("-right"),p=`${s}-resize-grip ${s}-resize-grip--${c?"bottom":"top"}-${_?"left":"right"}`,d=m=>{if(!e)return;let f=m.currentTarget,b=e.getBoundingClientRect();l.current={pointerId:m.pointerId,startX:m.clientX,startY:m.clientY,startW:b.width,startH:b.height,dirX:_?-1:1,dirY:c?1:-1},f.setPointerCapture(m.pointerId),m.preventDefault()},u=m=>{let f=l.current;if(!f||m.pointerId!==f.pointerId||!e)return;let b=(m.clientX-f.startX)*f.dirX,x=(m.clientY-f.startY)*f.dirY;e.style.setProperty(`--${s}-widget-w`,`${f.startW+b}px`),e.style.setProperty(`--${s}-widget-h`,`${f.startH+x}px`)},g=m=>{let f=l.current;if(!f||m.pointerId!==f.pointerId||!e)return;m.currentTarget.releasePointerCapture(m.pointerId);let b=e.getBoundingClientRect();i({width:Math.round(b.width),height:Math.round(b.height)}),l.current=null};return r("div",{class:p,role:"separator","aria-orientation":"vertical","aria-label":a.resizeHandle,title:a.resizeHandle,onPointerDown:d,onPointerMove:u,onPointerUp:g,onPointerCancel:g,"data-testid":k.resizeGrip,children:r(ea,{})})}var Ge=v.cssPrefix,Fc=`.${Ge}-header, .${Ge}-back-header, .${Ge}-home-hero`,Wc='button, a, input, textarea, select, [role="tab"], [contenteditable]',ba=56;function wn(e,t){S(()=>{if(!t||!e)return;let n=c=>Number.parseFloat(c)||0,o=(c,_)=>Math.min(_,Math.max(-_,c)),i=null,a=c=>{let _=c.target;if(!(_ instanceof Element)||!_.closest(Fc)||_.closest(Wc))return;let p=e.getBoundingClientRect();i={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${Ge}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${Ge}-modal-dy`)),maxX:(window.innerWidth+p.width)/2-ba,maxY:(window.innerHeight+p.height)/2-ba},e.dataset.dragging="true",c.preventDefault()},s=c=>{if(!i||c.pointerId!==i.id)return;let _=o(i.dx+c.clientX-i.x,i.maxX),p=o(i.dy+c.clientY-i.y,i.maxY);e.style.setProperty(`--${Ge}-modal-dx`,`${_}px`),e.style.setProperty(`--${Ge}-modal-dy`,`${p}px`)},l=c=>{!i||c.pointerId!==i.id||(i=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",a),window.addEventListener("pointermove",s),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l),()=>{e.removeEventListener("pointerdown",a),window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l)}},[e,t])}function Et(e,t,n,o){switch(e){case"clear":case"sound":case"history":case"language":case"theme":return!0;case"expand":return t==="floating";case"fullscreen":return t!=="standalone";case"popOut":return t!=="standalone"&&!!o?.popOutUrl;case"close":return t==="standalone"||t==="page"?!1:t==="inline"?n==="fullscreen":!0}}function kn(e,t,n){return Et("close",e,t)?n.main.includes("close")||n.overflow.includes("close"):!1}function xa(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var Kc='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function En(e){let t=n=>{if(n.key!=="Tab")return;let o=[...e.querySelectorAll(Kc)].filter(l=>l.offsetParent!==null||l===document.activeElement);if(o.length===0){n.preventDefault();return}let i=o[0],a=o[o.length-1];if(!i||!a)return;let s=e.getRootNode().activeElement;n.shiftKey&&s===i?(n.preventDefault(),a.focus()):!n.shiftKey&&s===a&&(n.preventDefault(),i.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}function Cn(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var Ho=v.cssPrefix;function Pa({agent:e}){let t=e.status??"online";return r("div",{class:`${Ho}-agent`,children:[r("div",{class:`${Ho}-agent-avatar`,"data-status":t,children:e.avatar?r("img",{src:e.avatar,alt:""}):r("span",{children:Cn(e.name)})}),r("div",{class:`${Ho}-agent-meta`,children:[r("strong",{children:e.name}),e.title?r("span",{children:e.title}):null]})]})}var ya=M.scope("attachments");function An(e,t,n){let o=Vc(e),i=[],a=[],s=jc(n.accept),l=t.reduce((_,p)=>_+p.size,0),c=t.length;for(let _ of o){let p=Gc(_,c,l,n,s);if(p){a.push({file:_,reason:p});continue}i.push(Xc(_)),l+=_.size,c+=1}return(i.length||a.length)&&ya.debug("ingest",{accepted:i.length,rejected:a.map(_=>({name:_.file.name,reason:_.reason}))}),{accepted:i,rejected:a}}function Bo(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){ya.debug("revokeObjectURL failed",{error:t})}}function Gc(e,t,n,o,i){return t>=o.maxCount?"count":n+e.size>o.maxBytes?"bytes":Yc(e,i)?null:"mime"}function Vc(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:qc(t)).filter(t=>t!==null):[]}function qc(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function Xc(e){return{file:e,id:we(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function jc(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean).map(t=>{if(t.startsWith("."))return{kind:"ext",ext:t};let[n="*",o="*"]=t.split("/");return{kind:"mime",type:n,subtype:o}})}function Yc(e,t){if(t.length===0)return!0;let[n="*",o="*"]=(e.type||"").toLowerCase().split("/"),i=(e.name||"").toLowerCase();return t.some(a=>a.kind==="ext"?i.endsWith(a.ext):(a.type==="*"||a.type===n)&&(a.subtype==="*"||a.subtype===o))}var Ct=v.cssPrefix;function Sa({attachment:e,onRemove:t}){let n=e.mediaType.startsWith("image/");return r("span",{class:`${Ct}-attachment-chip`,title:e.name,"data-testid":ce(k.attachmentChip,e.id),children:[n?r("img",{class:`${Ct}-attachment-thumb`,src:e.previewUrl,alt:""}):r("span",{class:`${Ct}-attachment-thumb`,"aria-hidden":"true",children:r(ca,{})}),r("span",{class:`${Ct}-attachment-name`,children:e.name}),r("button",{type:"button",class:`${Ct}-attachment-remove`,onClick:t,"aria-label":`Remove ${e.name}`,"data-testid":ce(k.attachmentRemove,e.id),children:r(Ee,{})})]})}var $o={isSupported:!1,start:()=>{},stop:()=>{}};function Uo(e,t,n){return e==="disabled"?$o:e==="server"?ed(n):Jc(t)}function Jc(e){let t=Qc();if(!t)return $o;let n=null;return{isSupported:!0,start(o,i){n=new t,n.continuous=!0,n.interimResults=!0,n.lang=e,n.addEventListener("result",s=>{let l=s,c="",_=!1;for(let p=l.resultIndex;p<l.results.length;p++){let d=l.results[p];d&&(c+=d[0].transcript,d.isFinal&&(_=!0))}o(c,_)});let a=()=>{n=null,i()};n.addEventListener("end",a),n.addEventListener("error",a),n.start()},stop(){n?.stop()}}}function Qc(){let e=globalThis;return e.SpeechRecognition??e.webkitSpeechRecognition}var Zc=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function ed(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return $o;let t=null,n=null,o=[],i=()=>{for(let a of n?.getTracks()??[])a.stop();n=null};return{isSupported:!0,async start(a,s){try{n=await navigator.mediaDevices.getUserMedia({audio:!0});let l=td();t=new MediaRecorder(n,l?{mimeType:l}:void 0),o=[],t.addEventListener("dataavailable",c=>{c.data.size>0&&o.push(c.data)}),t.addEventListener("stop",async()=>{let c=t?.mimeType??"audio/webm";i();let _=new Blob(o,{type:c});o=[];try{let{text:p}=await e(_,c);p&&a(p,!0)}catch{}finally{s()}}),t.start()}catch{i(),s()}},stop(){t?.stop()}}}function td(){for(let e of Zc)if(MediaRecorder.isTypeSupported(e))return e}var he=v.cssPrefix,Ve=M.scope("composer");function at(e){return e.reduce((t,n)=>t+n.size,0)}var nd={arrowUp:Gi,paperPlane:Ki,send:Vi,chevron:Pn};function wa({options:e,transport:t,feedback:n,bus:o,isStreaming:i,onSend:a,onStop:s,attachApiRef:l}){let c=e.strings,[_,p]=w(""),[d,u]=w([]),[g,m]=w(!1),f=N(null),b=N(null),x=e.features.files,y=e.features.voice,[A,j]=w(()=>Uo(y,e.locale,(E,z)=>t.transcribe(E,z)));S(()=>{g||y==="disabled"||j(Uo(y,e.locale,(E,z)=>t.transcribe(E,z)))},[e.locale,y,t,g]),S(()=>{let E=f.current;if(!E)return;let z=E.getRootNode(),Y="activeElement"in z?z.activeElement:null;Y&&E.closest(`.${he}-panel`)?.contains(Y)||E.focus({preventScroll:!0})},[]),S(()=>{let E=f.current;if(E){if(_.length===0){E.style.height="";return}E.style.height="auto",E.style.height=`${Math.min(E.scrollHeight,160)}px`}},[_]);let U=N(d);U.current=d,S(()=>()=>U.current.forEach(Bo),[]),S(()=>{if(l)return l.current={attachFromDrop:E=>{let z=An(E,U.current,e.attachments);z.accepted.length!==0&&(Ve.info("attach (drop)",{count:z.accepted.length,totalBytes:at(z.accepted)}),o.emit("attach",{count:z.accepted.length,totalBytes:at(z.accepted)}),u(Y=>[...Y,...z.accepted]))}},()=>{l.current&&(l.current=null)}},[l,e.attachments]),S(()=>{let E=f.current;if(!E)return;let z=E.closest(`.${he}-panel`);if(!z)return;let Y=fe=>{let Ue=fe.clipboardData;if(!Ue)return;if(x){let ue=An(Ue.items,U.current,e.attachments);if(ue.accepted.length>0){fe.preventDefault(),Ve.info("attach (paste)",{count:ue.accepted.length,totalBytes:at(ue.accepted)}),o.emit("attach",{count:ue.accepted.length,totalBytes:at(ue.accepted)}),u(Rt=>[...Rt,...ue.accepted]);return}}if(fe.target===E)return;let _e=Ue.getData("text/plain");_e&&(fe.preventDefault(),p(ue=>ue+_e),E.focus())};return z.addEventListener("paste",Y),()=>z.removeEventListener("paste",Y)},[x,e.attachments,he]);let oe=()=>{let E=_.trim();!E&&d.length===0||i||(a(E,d),p(""),u([]))},O=E=>{E.key!=="Enter"||E.shiftKey||E.isComposing||(E.preventDefault(),i?s():oe())},le=E=>{let z=E.target,Y=An(z.files,d,e.attachments);Y.accepted.length>0&&(Ve.info("attach (file picker)",{count:Y.accepted.length,totalBytes:at(Y.accepted)}),o.emit("attach",{count:Y.accepted.length,totalBytes:at(Y.accepted)}),u(fe=>[...fe,...Y.accepted])),z.value=""},B=E=>{Ve.info("removeAttachment",{id:E}),o.emit("removeAttachment",{id:E}),u(z=>{let Y=z.find(fe=>fe.id===E);return Y&&Bo(Y),z.filter(fe=>fe.id!==E)})},R=N(null),Ye=()=>{if(A.isSupported){if(g){let E=R.current?Date.now()-R.current:0;Ve.info("voiceStop",{durationMs:E}),o.emit("voiceStop",{durationMs:E}),A.stop(),m(!1),n.play("voiceStop"),R.current=null;return}R.current=Date.now(),Ve.info("voiceStart"),o.emit("voiceStart",void 0),m(!0),n.play("voiceStart"),A.start((E,z)=>p(Y=>z?`${Y}${E} `:Y),()=>{if(m(!1),R.current){let E=Date.now()-R.current;Ve.debug("voiceStop (auto)",{durationMs:E}),o.emit("voiceStop",{durationMs:E}),R.current=null}})}},de=nd[e.composer.sendButton.icon];return r("div",{class:`${he}-composer`,"data-testid":k.composer,children:[d.length>0?r("div",{class:`${he}-attachments`,children:d.map(E=>r(Sa,{attachment:E,onRemove:()=>B(E.id)},E.id))}):null,r("div",{class:`${he}-composer-row`,children:[r("div",{class:`${he}-composer-actions`,children:[x?r("button",{type:"button",class:`${he}-icon-btn`,onClick:()=>b.current?.click(),"aria-label":c.attach,"data-testid":k.composerAttach,children:r(Xi,{})}):null,A.isSupported?r("button",{type:"button",class:`${he}-icon-btn`,onClick:Ye,"aria-label":g?c.micStop:c.micStart,"aria-pressed":g,"data-recording":g?"true":void 0,"data-testid":k.composerVoice,children:r(ji,{})}):null]}),r("textarea",{ref:f,class:`${he}-textarea`,rows:1,value:_,placeholder:c.composerPlaceholder,onInput:E=>p(E.target.value),onKeyDown:O,"aria-label":c.composerPlaceholder,"data-testid":k.composerInput}),i?r("button",{type:"button",class:`${he}-send`,onClick:s,"aria-label":c.stop,"data-testid":k.composerStop,children:r(qi,{})}):r("button",{type:"button",class:`${he}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:oe,disabled:!_.trim()&&d.length===0,"aria-label":c.send,"data-testid":k.composerSend,children:r(de,{})})]}),r("input",{ref:b,type:"file",multiple:!0,accept:e.attachments.accept,onChange:le,class:`${he}-sr-only`,"data-testid":k.composerFileInput})]})}var od=v.cssPrefix;function ka({visible:e,strings:t}){return e?r("div",{class:`${od}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function Tn({containerRef:e,onDrop:t}){let[n,o]=w(!1);return S(()=>{let i=e.current;if(!i)return;let a=0,s=p=>{a+=1,p.dataTransfer?.types.includes("Files")&&(p.preventDefault(),o(!0))},l=()=>{a-=1,!(a>0)&&(a=0,o(!1))},c=p=>{p.dataTransfer?.types.includes("Files")&&p.preventDefault()},_=p=>{a=0,o(!1),p.dataTransfer&&(p.preventDefault(),t(p.dataTransfer.items))};return i.addEventListener("dragenter",s),i.addEventListener("dragleave",l),i.addEventListener("dragover",c),i.addEventListener("drop",_),()=>{i.removeEventListener("dragenter",s),i.removeEventListener("dragleave",l),i.removeEventListener("dragover",c),i.removeEventListener("drop",_)}},[e,t]),{visible:n}}function Ea({itemCount:e,initialFocusIndex:t}){let[n,o]=w(!1),i=N(null),a=N(null),[s,l]=w(-1),c=D(()=>{o(!1),l(-1),i.current?.focus()},[]),_=D(()=>o(u=>!u),[]);S(()=>{if(!n)return;let u=g=>{let m=a.current,f=i.current;if(!m||!f)return;let b=g.composedPath();b.includes(m)||b.includes(f)||(o(!1),l(-1))};return document.addEventListener("click",u,!0),()=>document.removeEventListener("click",u,!0)},[n]),S(()=>{if(!n||e===0)return;let u=t?.()??0,g=u<0||u>=e?0:u;l(g)},[n,e,t]),S(()=>{if(!n||s<0)return;a.current?.querySelectorAll("[role='menuitem']")?.[s]?.focus()},[n,s]);let p=D(u=>{(u.key==="ArrowDown"||u.key==="Enter"||u.key===" ")&&(u.preventDefault(),o(!0))},[]),d=D(u=>{if(e!==0)switch(u.key){case"Escape":u.preventDefault(),c();return;case"ArrowDown":u.preventDefault(),l(g=>(g+1)%e);return;case"ArrowUp":u.preventDefault(),l(g=>(g-1+e)%e);return;case"Home":u.preventDefault(),l(0);return;case"End":u.preventDefault(),l(e-1)}},[e,c]);return{open:n,focusIndex:s,triggerRef:i,menuRef:a,toggle:_,close:c,onTriggerKey:p,onMenuKey:d}}function Ca({items:e,triggerLabel:t}){let n=v.cssPrefix,o=Ea({itemCount:e.length}),i=a=>{a.disabled||(a.onSelect(),a.keepOpen||o.close())};return r("div",{class:`${n}-menu-wrap`,children:[r("button",{ref:o.triggerRef,type:"button",class:`${n}-icon-btn`,"aria-label":t,"aria-haspopup":"menu","aria-expanded":o.open,title:t,onClick:o.toggle,onKeyDown:o.onTriggerKey,children:r(ta,{})}),o.open?r("div",{ref:o.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:o.onMenuKey,tabIndex:-1,children:e.map(a=>r("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":a.type==="switch"?a.on:void 0,disabled:a.disabled,lang:a.lang,onClick:()=>i(a),children:[a.icon?r("span",{class:`${n}-menu-icon`,children:a.icon}):null,r("span",{class:`${n}-menu-label`,children:a.label}),a.type==="switch"&&a.on?r("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:r(ra,{})}):null]},a.id))}):null]})}var zo=v.cssPrefix,rd={auto:"dark",dark:"light",light:"auto"};function id(e){return e==="light"?r(pa,{}):e==="dark"?r(fa,{}):r(ga,{})}function Ce({panelProps:e,variant:t}){let{options:n,panelSize:o,feedback:i,onClose:a,onClear:s,onExpand:l,onFullscreen:c,onPopOut:_,onSoundToggle:p}=e,{onToggleHistory:d,onLocaleChange:u,onThemeChange:g}=e,m=n.strings,f=n.mode,b=t==="chat",x=Se(()=>i.mutedSig.value).value,y=new Set([...n.actions.main,...n.actions.overflow]),A=R=>y.has(R),j=R=>Et(R,f,o,{popOutUrl:n.popOutUrl}),U=n.themeMode,oe={auto:m.themeAuto,light:m.themeLight,dark:m.themeDark},O=[];if(A("theme")&&O.push({id:"theme",icon:id(U),label:`${m.theme}: ${oe[U]}`,onSelect:()=>g(rd[U]),keepOpen:!0}),A("language")&&n.availableLocales.length>1)for(let R of n.availableLocales)O.push({id:`language:${R}`,label:`${m.language} \u2014 ${R}`,lang:R,type:"switch",on:R===n.locale,onSelect:()=>u(R)});if(A("expand")&&j("expand")){let R=o==="expanded";O.push({id:"expand",icon:R?r(Ji,{}):r(Yi,{}),label:R?m.collapse:m.expand,type:"switch",on:R,onSelect:l})}if(A("fullscreen")&&j("fullscreen")){let R=o==="fullscreen";O.push({id:"fullscreen",icon:R?r(Zi,{}):r(Qi,{}),label:R?m.exitFullscreen:m.fullscreen,type:"switch",on:R,onSelect:c})}A("popOut")&&j("popOut")&&O.push({id:"popOut",icon:r(aa,{}),label:m.popOut,onSelect:_}),b&&A("sound")&&O.push({id:"sound",icon:x?r(oa,{}):r(na,{}),label:x?m.soundOff:m.soundOn,type:"switch",on:!x,onSelect:p}),b&&A("clear")&&O.push({id:"clear",icon:r(sa,{}),label:m.newConversation,onSelect:s});let le=!!a&&kn(f,o,n.actions),B=b&&A("history");return r("div",{class:`${zo}-header-actions`,children:[B?r("button",{type:"button",class:`${zo}-icon-btn`,onClick:d,"aria-label":m.history,title:m.history,"data-testid":k.actionHistory,children:r(ia,{})}):null,O.length>0?r(Ca,{items:O,triggerLabel:m.moreActions}):null,le?r("button",{type:"button",class:`${zo}-icon-btn`,onClick:a,"aria-label":m.close,title:m.close,"data-testid":k.actionClose,children:r(Ee,{})}):null]})}var Ko=1,Ta=2,Ia=4,Ra=8,Ma=16;function ad(e){switch(e){case Ko:return"href";case Ta:return"src";case Ia:return"class";case Ra:return"checked";case Ma:return"start"}}var sd=e=>{switch(e){case 1:return 3;case 2:return 4;case 3:return 5;case 4:return 6;case 5:return 7;default:return 8}},ld=sd;var Aa=24;function Vo(e){let t=new Uint32Array(Aa);return t[0]=1,{renderer:e,text:"",pending:"",tokens:t,len:0,token:1,fence_end:0,blockquote_idx:0,hr_char:"",hr_chars:0,fence_start:0,spaces:new Uint8Array(Aa),indent:"",indent_len:0,table_state:0}}function La(e){e.pending.length>0&&se(e,`
11
+ ${i}`:i;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(!t||t==="[DONE]")return null;try{let o=JSON.parse(t);return wi.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){return wi.trace("frame parse failed",{err:o,payload:t.slice(0,200)}),null}}function cc(e){let t=new TextEncoder().encode(e),n="";for(let o of t)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var Ei=e=>e&&Object.keys(e).length>0?e:void 0;function Ci(e,t){let n=Ei(e),o=Ei(t);if(!n&&!o)return;let i={};return n&&(i.user=n),o&&(i.page=o),cc(JSON.stringify(i))}var ke={startSession:"/ai/agent/start-session",streamMessage:"/ai/agent/stream-message",streamResume:"/ai/agent/stream-resume",cancelStream:"/ai/agent/cancel-stream",listSessions:"/ai/agent/list-sessions",listMessages:"/ai/agent/list-messages",updateSettings:"/ai/agent/update-settings",markRead:"/ai/agent/mark-read",content:"/ai/agent/content"},Ai="context";function Ti(e){let n={messages:e.messages.map(a=>({id:a.id,parts:_c(a),role:a.role,createdAt:a.createdAt})),sessionId:e.sessionId,trigger:e.trigger??"submit-message"};e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs);let o={},i=e.tools?.map(dc).filter(a=>a!==null);return i?.length&&(o.tools=i),e.responseMode&&(o.responseMode=e.responseMode),Object.keys(o).length>0&&(n.data=o),n}function dc(e){return typeof e=="string"?e?{code:e}:null:e?.code?e:null}function _c(e){let t=[];for(let n of e.parts)n.kind==="text"&&n.text&&t.push({text:n.text,type:"text"}),n.kind==="file"&&n.url&&t.push({mediaType:n.mediaType,type:"file",url:n.url});for(let n of e.attachments??[])n.url&&t.push({type:"file",url:n.url,mediaType:n.mediaType,filename:n.name,fileId:n.id,fileSize:n.size});return t}var q=M.scope("transport"),uc=3,Mi=400,Ii=3,pc=new Set([408,425,429,500,502,503,504]);function Ri(e){return Mi*2**e+Math.floor(Math.random()*250)}function fc(e){let t=e.get("retry-after");if(!t)return null;let n=Number(t),o=Number.isFinite(n)?n*1e3:Date.parse(t)-Date.now();return Number.isFinite(o)&&o>=0?Math.min(o,3e4):null}function Ro(e,t){return new Promise(n=>{if(t?.aborted)return n();let o=setTimeout(a,e),i=()=>a();t?.addEventListener("abort",i,{once:!0});function a(){clearTimeout(o),t?.removeEventListener("abort",i),n()}})}var fn=class{constructor(t){W(this,"opts",t);W(this,"visitorId");W(this,"sessionId");W(this,"userContext");W(this,"pageContext")}setContext(t,n){this.userContext=t,this.pageContext=n}primeIdentity(t,n){t&&(this.visitorId=t),n&&(this.sessionId=n)}envelope(){let t={};this.visitorId&&(t.visitorId=this.visitorId),this.sessionId&&(t.sessionId=this.sessionId);let n=Ci(this.userContext,this.pageContext);return n&&(t[Ai]=n),t}withEnvelope(t){return{...this.envelope(),...t}}appendEnvelope(t){for(let[n,o]of Object.entries(this.envelope()))t.append(n,o);return t}withEnvelopeQuery(t){let n=new URL(this.url(t));for(let[o,i]of Object.entries(this.envelope()))n.searchParams.has(o)||n.searchParams.set(o,i);return n.toString()}async startSession(t){q.debug("startSession \u2192",{visitorId:t.visitorId,sessionId:t.sessionId,locale:t.locale});let n=await this.postJson(ke.startSession,t,"startSession");return q.debug("startSession \u2190",{visitorId:n.visitorId,sessionId:n.sessionId,canContinue:n.canContinue,hasMessages:!!n.messages?.length,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),mc(n)||q.warn("startSession response did not match expected shape; using raw response",{response:n}),this.visitorId=n.visitorId??t.visitorId,this.sessionId=n.sessionId,n}async uploadFile(t){q.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let n=new FormData;n.append("file",t,t.name);let o=await this.postForm(this.uploadPath,n,"upload");return q.debug("uploadFile \u2190",{id:o.id,url:o.url}),o}async transcribe(t,n="audio/webm"){q.debug("transcribe \u2192",{size:t.size,mimeType:n});let o=new FormData;o.append("audio",t,`voice.${gc(n)}`),o.append("mimeType",n);let i=await this.postForm(this.transcribePath,o,"transcribe");return q.debug("transcribe \u2190",{textLen:i.text.length}),i}async listSessions(t={}){let n=new URL(this.url(ke.listSessions));t.visitorId&&n.searchParams.set("visitorId",t.visitorId),t.limit&&n.searchParams.set("limit",String(t.limit)),t.cursor&&n.searchParams.set("cursor",t.cursor),q.debug("listSessions \u2192",{visitorId:t.visitorId??this.visitorId,limit:t.limit,cursor:t.cursor});let o=await this.getJson(n.toString(),"listSessions"),i=o.sessions??[];return q.debug("listSessions \u2190",{count:i.length,nextCursor:o.nextCursor}),{sessions:i.map(a=>({sessionId:a.sessionId,title:a.title,lastMessageAt:a.lastMessageAt,preview:a.preview,canContinue:a.canContinue,unreadCount:a.unreadCount})),nextCursor:o.nextCursor}}async loadSession(t){let n=new URL(this.url(ke.listMessages));n.searchParams.set("sessionId",t),q.debug("loadSession \u2192",{sessionId:t,visitorId:this.visitorId});let o=await this.getJson(n.toString(),"loadSession"),i=o.messages??[];return q.debug("loadSession \u2190",{sessionId:o.sessionId,canContinue:o.canContinue,messageCount:i.length,hasSuggestions:!!o.suggestions}),{sessionId:o.sessionId,canContinue:o.canContinue??!0,messages:i,agent:o.agent,suggestions:o.suggestions}}async markRead(t){if(!(!this.visitorId||!t)){q.debug("markRead \u2192",{sessionId:t,visitorId:this.visitorId});try{await this.postJson(ke.markRead,{sessionId:t},"markRead")}catch(n){q.debug("markRead failed (non-fatal)",{err:n})}}}async listContent(t={}){let n=new URL(this.url(ke.content));for(let[a,s]of Object.entries(t))s!==void 0&&n.searchParams.set(a,Array.isArray(s)?s.join(","):String(s));q.debug("listContent \u2192",t);let o=await this.getJson(n.toString(),"listContent"),i=o.items??[];return q.debug("listContent \u2190",{count:i.length,total:o.pagination?.total}),{...o,items:i}}async saveUserPrefs(t){q.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,sessionId:this.sessionId,settingsKeys:Object.keys(t)});let n=await this.postJson(ke.updateSettings,{userPrefs:t},"saveUserPrefs");return q.debug("saveUserPrefs \u2190",{ok:n.ok}),n}get uploadPath(){return this.opts.endpoints?.upload??"/ai/agent/upload-file"}get transcribePath(){return this.opts.endpoints?.transcribe??"/ai/agent/transcribe-audio"}sendMessage(t){q.debug("message \u2192",{sessionId:t.sessionId,visitorId:t.visitorId,messageCount:t.messages.length,trigger:t.trigger,responseMode:t.data?.responseMode,tools:t.data?.tools?.map(s=>s.code)});let n=new AbortController,o=new Set;return{iter:this.runStream(t,n,o),cancel:()=>this.cancelStream(n,t.sessionId)}}resumeStream(){let t=new AbortController,n=new Set;return{iter:this.resumeStreamGen(t,n,!0),cancel:()=>t.abort()}}async*runStream(t,n,o){(yield*this.drain(this.openMessageStream(t,n.signal),o,n))||(yield*this.resumeStreamGen(n,o,!1))}async*resumeStreamGen(t,n,o){for(let i=1;i<=uc&&!t.signal.aborted;i++){if((!o||i>1)&&(await Ro(Mi*i,t.signal),t.signal.aborted))return;let a;try{a=await this.fetchImpl(this.resumeUrl(n.size),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(l){if(t.signal.aborted)return;q.debug("resume fetch failed \u2014 retrying",{attempt:i,err:l});continue}if(a.status===204||!a.ok){q.debug("resume \u2192 no in-flight stream",{status:a.status});return}let s=n.size;if(yield*this.drain(Io(a,t.signal),n,t))return;if(n.size===s){q.debug("resume \u2192 stream closed with no new events; nothing to resume");return}}if(!t.signal.aborted)throw new be("stream incomplete after resume attempts","server")}async*drain(t,n,o){try{for await(let i of t){if(o.signal.aborted)return!0;if(i.eventId){if(n.has(i.eventId))continue;n.add(i.eventId)}if(yield i,i.chunk.type==="finish"||i.chunk.type==="error")return!0}}catch(i){if(o.signal.aborted)return!0;if(i instanceof be&&i.status!==void 0)throw i;q.debug("stream segment dropped",{err:i})}return!1}cancelStream(t,n){t.signal.aborted||(q.debug("cancel stream",{sessionId:n,visitorId:this.visitorId}),t.abort(),!(!this.visitorId||!n)&&this.fetchImpl(this.url(ke.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({})),keepalive:!0}).catch(o=>q.debug("cancel POST failed (non-fatal)",{err:o})))}async*openMessageStream(t,n){let o=await this.fetchImpl(this.url(ke.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"text/event-stream","content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(t)),signal:n});yield*Io(o,n)}resumeUrl(t){let n=new URL(this.withEnvelopeQuery(ke.streamResume));return n.searchParams.set("resumeAt",String(t)),n.toString()}async postJson(t,n,o){let i=await this.fetchWithRetry(()=>[this.url(t),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(n))}],o);return this.assertOk(i,o)}async postForm(t,n,o){let i=await this.fetchImpl(this.url(t),{method:"POST",credentials:"omit",headers:this.opts.auth.headers(),body:this.appendEnvelope(n)});return this.assertOk(i,o)}async getJson(t,n){let o=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.opts.auth.headers()}}],n);return this.assertOk(o,n)}async fetchWithRetry(t,n){for(let o=0;;o++){let[i,a]=t(),s;try{s=await this.fetchImpl(i,a)}catch(c){if(o>=Ii)throw new be(`${n} failed: network error`,"network",void 0,c);q.debug("request network error \u2014 retrying",{label:n,attempt:o}),await Ro(Ri(o));continue}if(s.ok||!pc.has(s.status)||o>=Ii)return s;let l=fc(s.headers)??Ri(o);q.debug("request retryable status \u2014 retrying",{label:n,status:s.status,attempt:o,wait:l}),await Ro(l)}}async assertOk(t,n){if(!t.ok)throw new be(`${n} failed: ${t.status}`,"server",t.status);return await t.json()}url(t){return/^https?:\/\//i.test(t)?t:`${this.opts.baseUrl}${t}`}get fetchImpl(){return this.opts.fetchImpl??globalThis.fetch.bind(globalThis)}};function gc(e){return e.includes("webm")?"webm":e.includes("ogg")?"ogg":e.includes("mp4")||e.includes("m4a")?"m4a":e.includes("mpeg")?"mp3":e.includes("wav")?"wav":"bin"}function mc(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.sessionId=="string"&&typeof t.canContinue=="boolean"}function Li(e,t){let n=e?[{kind:"text",id:"t0",textSig:L(e),doneSig:L(!0)}]:[];return{id:we(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:L(n)}}function Mo(){return{id:we(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:L([])}}function Ni(e){return{id:e.id,role:e.role,createdAt:Date.now(),status:"streaming",partsSig:L([{kind:"text",id:`${e.id}-t0`,textSig:L(""),doneSig:L(!1)}])}}function Oi(e){return hc({id:e.id,role:e.role,createdAt:Date.now(),status:"complete",parts:[{kind:"text",id:`${e.id}-t0`,text:e.text,done:!0}]})}function hc(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,errorText:e.errorText,finishReason:e.finishReason,attachments:e.attachments,partsSig:L(e.parts.map(vc))}}function Lo(e){let t=e.parts.map((n,o)=>n.type==="text"?{kind:"text",id:`${e.id}-t${o}`,textSig:L(n.text),doneSig:L(!0)}:n.type==="file"?{kind:"file",url:n.url,mediaType:n.mediaType}:null).filter(n=>n!==null);return{id:e.id,role:e.role,createdAt:e.createdAt??Date.now(),status:"complete",partsSig:L(t)}}function Di(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,errorText:e.errorText,finishReason:e.finishReason,attachments:e.attachments,parts:e.partsSig.value.map(bc)}}function No(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function vc(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:L(e.text),doneSig:L(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartialSig:L(e.inputPartial),inputSig:L(e.input),outputSig:L(e.output),errorSig:L(e.error),stateSig:L(e.state)}:e}function bc(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,text:e.textSig.value,done:e.doneSig.value}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartial:e.inputPartialSig.value,input:e.inputSig.value,output:e.outputSig.value,error:e.errorSig.value,state:e.stateSig.value}:e}var Hi=M.scope("reducer"),gn=class{constructor(t){W(this,"messagesSig",t);W(this,"active",null)}attach(t){this.active=t}detach(){this.active=null}apply(t){let n=this.active;if(n)switch(t.type){case"start":case"start-step":case"finish-step":return;case"finish":Hi.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":Hi.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=t.errorText,this.bumpDone(n);return;case"text-start":it(n,"text",t.id);return;case"text-delta":{let o=it(n,"text",t.id);o.textSig.value+=t.delta;return}case"text-end":it(n,"text",t.id).doneSig.value=!0;return;case"reasoning-start":it(n,"reasoning",t.id).doneSig.value=!1;return;case"reasoning-delta":{let o=it(n,"reasoning",t.id);o.textSig.value+=t.delta;return}case"reasoning-end":it(n,"reasoning",t.id).doneSig.value=!0;return;case"tool-input-start":case"tool-input-delta":case"tool-input-available":case"tool-output-available":case"tool-output-error":xc(n,t);return;case"file":mn(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":{if(n.partsSig.value.some(i=>i.kind==="source"&&i.sourceId===t.sourceId))return;mn(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return}case"data-notification":return;default:{let o=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value=[...this.messagesSig.value]}};function it(e,t,n){let o=e.partsSig.value.find(a=>a.kind===t&&a.id===n);if(o)return o;let i={kind:t,id:n,textSig:L(""),doneSig:L(!1)};return mn(e,i),i}function yt(e,t,n){let o=e.partsSig.value.find(a=>a.kind==="tool"&&a.toolCallId===t);if(o)return o;let i={kind:"tool",toolCallId:t,toolName:n??"tool",inputPartialSig:L(""),inputSig:L(void 0),outputSig:L(void 0),errorSig:L(void 0),stateSig:L("input")};return mn(e,i),i}function mn(e,t){e.partsSig.value=[...e.partsSig.value,t]}function xc(e,t){switch(t.type){case"tool-input-start":yt(e,t.toolCallId,t.toolName);return;case"tool-input-delta":{let n=yt(e,t.toolCallId);n.inputPartialSig.value+=t.delta;return}case"tool-input-available":{let n=yt(e,t.toolCallId,t.toolName);n.inputSig.value=t.input,n.stateSig.value="awaiting";return}case"tool-output-available":{let n=yt(e,t.toolCallId);n.outputSig.value=t.output,n.stateSig.value="output";return}case"tool-output-error":{let n=yt(e,t.toolCallId);n.errorSig.value=t.errorText,n.stateSig.value="error";return}default:return}}var hn=M.scope("persistence");function St(e,t=an){let n=`${v.cssPrefix}.${e}`,o=`${n}.visitorId`,i=`${n}.sessionId`,a=`${n}.userPrefs`,s=`${n}.panelOpen`,l=`${n}.panelSize`,c=`${n}.calloutDismissed`,_=`${n}.sidebarCollapsed`,p=`${n}.activeModule`,d={getVisitorId(){let u=t.get(o);if(u)return u;let g=we();return t.set(o,g),g},setVisitorId(u){hn.debug("setVisitorId (rebind)",{id:u,widgetId:e}),t.set(o,u)},loadSessionId(){return t.get(i)??void 0},saveSessionId(u){hn.trace("saveSessionId",{id:u,widgetId:e}),u?t.set(i,u):t.remove(i)},loadUserPrefs(){let u=t.get(a);if(!u)return{};try{let g=JSON.parse(u);return Pc(g)?g:{}}catch(g){return hn.warn("loadUserPrefs parse failed",{error:g}),{}}},saveUserPrefs(u){try{t.set(a,JSON.stringify(u))}catch(g){hn.warn("saveUserPrefs serialise failed",{error:g})}},patchUserPrefs(u){let g=d.loadUserPrefs();d.saveUserPrefs({...g,...u})},loadPanelOpen(){let u=t.get(s);return u==="1"?!0:u==="0"?!1:null},savePanelOpen(u){t.set(s,u?"1":"0")},loadPanelSize(){let u=t.get(l);return u==="normal"||u==="expanded"||u==="fullscreen"?u:null},savePanelSize(u){t.set(l,u)},loadCalloutDismissed(u){if(!u)return!1;let g=t.get(c);return!!g&&g===u},saveCalloutDismissed(u){u?t.set(c,u):t.remove(c)},loadSidebarCollapsed(){let u=t.get(_);return u==="1"?!0:u==="0"?!1:null},saveSidebarCollapsed(u){t.set(_,u?"1":"0")},loadActiveModule(){return t.get(p)||null},saveActiveModule(u){t.set(p,u)},clearSession(){t.remove(i)}};return d}function Pc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Bi=M.scope("feedback:audio"),vn=class{constructor(){W(this,"ctx",null);W(this,"master",null);W(this,"buffers",new Map)}unlock(){if(this.ctx){this.ctx.state==="suspended"&&this.ctx.resume();return}let t=globalThis.AudioContext??globalThis.webkitAudioContext;if(t)try{this.ctx=new t,this.master=this.ctx.createGain(),this.master.gain.value=1,this.master.connect(this.ctx.destination)}catch(n){Bi.warn("AudioContext init failed",{err:n})}}setVolume(t){if(!this.master||!this.ctx)return;let n=Math.max(0,Math.min(1,t));this.master.gain.setTargetAtTime(n,this.ctx.currentTime,.01)}playTone(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let i=n.currentTime,a=t.noteMs/1e3;t.notes.forEach((s,l)=>{let c=n.createOscillator();c.type=t.type,c.frequency.value=s;let _=n.createGain(),p=i+l*a;_.gain.setValueAtTime(1e-4,p),_.gain.exponentialRampToValueAtTime(t.peakGain,p+.005),_.gain.exponentialRampToValueAtTime(1e-4,p+a),c.connect(_).connect(o),c.start(p),c.stop(p+a+.01)})}async playUrl(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let i=await this.getBuffer(t);if(!i)return;let a=n.createBufferSource();a.buffer=i,a.connect(o),a.start()}destroy(){this.ctx&&this.ctx.close().catch(()=>{}),this.ctx=null,this.master=null,this.buffers.clear()}async getBuffer(t){if(!this.ctx)return null;let n=this.buffers.get(t);if(n)return n instanceof Promise,n;let o=this.ctx,i=fetch(t).then(a=>a.ok?a.arrayBuffer():Promise.reject(new Error(`fetch ${a.status}`))).then(a=>o.decodeAudioData(a)).then(a=>(this.buffers.set(t,a),a)).catch(a=>(Bi.warn("audio fetch/decode failed",{url:t,err:a}),this.buffers.delete(t),null));return this.buffers.set(t,i),i}};var $i={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},Ui={messageReceived:{notes:[880,1318.51],noteMs:90,type:"sine",peakGain:.45},messageSent:{notes:[1568],noteMs:60,type:"sine",peakGain:.25},error:{notes:[523.25,392],noteMs:120,type:"triangle",peakGain:.55},voiceStart:{notes:[1318.51],noteMs:50,type:"sine",peakGain:.3},voiceStop:{notes:[880],noteMs:50,type:"sine",peakGain:.3}};var Be=null,bn=0;function yc(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function Sc(){if(typeof document>"u")return null;let e=document.createElement("input");e.type="checkbox",e.setAttribute("switch",""),e.setAttribute("aria-hidden","true"),e.tabIndex=-1,e.id=`__${v.cssPrefix}_haptic_${Math.random().toString(36).slice(2)}`;let t=document.createElement("label");t.htmlFor=e.id,t.setAttribute("aria-hidden","true");let n="position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;opacity:0!important;pointer-events:none!important;";return e.style.cssText=n,t.style.cssText=n,document.body.append(e,t),{input:e,label:t}}function zi(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(yc())try{navigator.vibrate(e);return}catch{}if(Be||(Be=Sc()),!!Be)try{Be.label.click()}catch{}}}function Fi(){bn++;let e=!1;return()=>{e||(e=!0,bn=Math.max(0,bn-1),bn===0&&Be&&(Be.input.remove(),Be.label.remove(),Be=null))}}var wc=M.scope("feedback"),kc=100,xn=class{constructor(t,n){W(this,"mutedSig",L(!1));W(this,"audio",new vn);W(this,"releaseHaptics");W(this,"sound");W(this,"haptics");W(this,"lastPlayed",new Map);W(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=Fi(),this.audio.setVolume(this.effectiveVolume()),typeof matchMedia<"u"&&(this.reducedMotionMq=matchMedia("(prefers-reduced-motion: reduce)"))}unlock(){this.audio.unlock(),this.audio.setVolume(this.effectiveVolume())}update(t,n){this.sound=t,this.haptics=n,this.audio.setVolume(this.effectiveVolume())}setMuted(t){this.mutedSig.value!==t&&(this.mutedSig.value=t)}toggleMuted(){this.mutedSig.value=!this.mutedSig.value}play(t){this.mutedSig.value||this.isDeduped(t)||(this.lastPlayed.set(t,performance.now()),this.sound.enabled&&this.playSound(t),this.haptics.enabled&&this.isTouchDevice()&&this.playHaptic(t))}destroy(){this.audio.destroy(),this.releaseHaptics()}isDeduped(t){let n=this.lastPlayed.get(t);return n===void 0?!1:performance.now()-n<kc}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(i=>wc.warn("audio play failed",{err:i,url:n}));return}let o=Ui[t];o&&this.audio.playTone(o)}playHaptic(t){if(this.reducedMotionMq?.matches)return;let n=this.haptics.events?.[t];if(n===!1)return;let o=n===!0||n===void 0?$i[t]:n;zi(o)}effectiveVolume(){let t=this.sound.volume??.3;return this.reducedMotionMq?.matches?t*.5:t}isTouchDevice(){return typeof window>"u"?!1:matchMedia("(hover: none) and (pointer: coarse)").matches}};function Ke(e,t){return e instanceof be&&e.status===429?t.errorRateLimited:t.errorGeneric}var Ec=0;function r(e,t,n,o,i,a){t||(t={});var s,l,c=t;if("ref"in c)for(l in c={},t)l=="ref"?s=t[l]:c[l]=t[l];var _={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ec,__i:-1,__u:0,__source:i,__self:a};if(typeof e=="function"&&(s=e.defaultProps))for(l in s)c[l]===void 0&&(c[l]=s[l]);return H.vnode&&H.vnode(_),_}var T={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},Cc=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})}),Ee=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M18 6 6 18M6 6l12 12"})}),Wi=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M12 5v14M5 12h14"})}),Ki=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"m22 2-7 20-4-9-9-4Z"}),r("path",{d:"M22 2 11 13"})]}),Gi=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M12 19V5M5 12l7-7 7 7"})}),Vi=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M3 20V4l18 8-18 8Z"})}),Pn=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"m9 18 6-6-6-6"})}),qi=()=>r("svg",{...T,"aria-hidden":"true",children:r("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),Xi=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"m21 11-9 9a5.5 5.5 0 0 1-7.78-7.78l8.49-8.49a3.67 3.67 0 0 1 5.19 5.19l-8.49 8.49a1.83 1.83 0 0 1-2.6-2.6l7.78-7.78"})}),ji=()=>r("svg",{...T,"aria-hidden":"true",children:[r("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),r("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]}),Yi=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),Ji=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),Qi=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),Zi=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),ea=()=>r("svg",{...T,"aria-hidden":"true",viewBox:"0 0 10 10",children:r("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),ta=()=>r("svg",{...T,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]}),na=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})}),oa=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),ra=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M20 6 9 17l-5-5"})}),ia=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M3 3v6h6"}),r("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),r("path",{d:"M12 7v5l3 2"})]});var wt=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),aa=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M15 3h6v6M10 14 21 3M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5"})}),sa=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M12 20h9"}),r("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),la=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"m6 9 6 6 6-6"})}),ca=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),r("path",{d:"M14 2v6h6"})]}),Ac=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),r("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]}),Tc=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})}),Oo=()=>r("svg",{...T,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),r("path",{d:"M12 17h.01"})]}),Ic=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"m15 4 3 3-9 9-3-3z"}),r("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]}),Rc=()=>r("svg",{...T,"aria-hidden":"true",children:[r("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),r("path",{d:"M12 8V4"}),r("circle",{cx:"12",cy:"3",r:"1"}),r("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]}),Mc=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),r("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),r("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),r("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]}),Lc=()=>r("svg",{...T,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("circle",{cx:"12",cy:"12",r:"4"}),r("path",{d:"m4.93 4.93 4.24 4.24M14.83 14.83l4.24 4.24M14.83 9.17l4.24-4.24M4.93 19.07l4.24-4.24"})]}),Do=()=>r("svg",{...T,"aria-hidden":"true",children:[r("circle",{cx:"11",cy:"11",r:"7"}),r("path",{d:"m21 21-4.3-4.3"})]}),da=()=>r("svg",{...T,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),_a=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M3 9.5 12 3l9 6.5"}),r("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]}),ua=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"m3 11 15-5v12L3 13z"}),r("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),r("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),r("path",{d:"M21 10a3 3 0 0 1 0 4"})]}),kt=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),r("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}),pa=()=>r("svg",{...T,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"4"}),r("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}),fa=()=>r("svg",{...T,"aria-hidden":"true",children:r("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),ga=()=>r("svg",{...T,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 3v18"}),r("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]}),Nc=()=>r("svg",{...T,"aria-hidden":"true",children:[r("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),r("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),r("path",{d:"m20 20-4.4-4.4"})]}),Oc=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M12 3.5 13.6 9 19 10.5 13.6 12 12 17.5 10.4 12 5 10.5 10.4 9z"}),r("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]}),Dc=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M4 18h16"}),r("path",{d:"M5 18a7 7 0 0 1 14 0"}),r("path",{d:"M12 8V6"}),r("path",{d:"M10 6h4"})]}),Hc=()=>r("svg",{...T,"aria-hidden":"true",children:[r("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),r("path",{d:"M16 9.5a1.5 1.5 0 0 1 3 0v2.5a7 7 0 0 1-7 7 7 7 0 0 1-6.4-4.2L4 12.5a1.5 1.5 0 0 1 2.6-1.5L7 11"})]}),ma={chat:Cc,message:Tc,bubbles:kt,spark:Ac,wand:Ic,bot:Rc,help:Oo,lifebuoy:Lc,headset:Mc,search:Nc,sparkles:Oc,concierge:Dc,wave:Hc};var I=v.cssPrefix,k={launcher:`${I}-launcher`,callout:`${I}-callout`,calloutDismiss:`${I}-callout-dismiss`,panel:`${I}-panel`,panelHeader:`${I}-panel-header`,resizeGrip:`${I}-resize-grip`,scrollToBottom:`${I}-scroll-to-bottom`,actionHistory:`${I}-action-history`,actionClose:`${I}-action-close`,composer:`${I}-composer`,composerInput:`${I}-composer-input`,composerSend:`${I}-composer-send`,composerStop:`${I}-composer-stop`,composerAttach:`${I}-composer-attach`,composerFileInput:`${I}-composer-file-input`,composerVoice:`${I}-composer-voice`,attachmentChip:`${I}-attachment-chip`,attachmentRemove:`${I}-attachment-remove`,suggestion:`${I}-suggestion`,messageBubble:`${I}-message`,messageRetry:`${I}-message-retry`,historyPane:`${I}-history-pane`,historyBack:`${I}-history-back`,historyItem:`${I}-history-item`,sidebar:`${I}-sidebar`,sidebarToggle:`${I}-sidebar-toggle`,sidebarNewChat:`${I}-sidebar-new-chat`,sidebarItem:`${I}-sidebar-item`,messengerHome:`${I}-messenger-home`,modulesEmpty:`${I}-modules-empty`,tab:`${I}-tab`,tabBadge:`${I}-tab-badge`,homeView:`${I}-home-view`,homeGreeting:`${I}-home-greeting`,homeBrand:`${I}-home-brand`,backHeader:`${I}-back-header`,contentView:`${I}-content-view`,contentScroll:`${I}-content-scroll`,homeSearch:`${I}-home-search`,helpSearch:`${I}-help-search`,homeRecent:`${I}-home-recent`,homeContentRow:`${I}-home-content-row`,helpArticle:`${I}-help-article`,newsItem:`${I}-news-item`};function ce(e,t){return`${e}-${t}`}var yn=v.cssPrefix;function ha({onToggle:e,launcher:t,strings:n,leaving:o,edgeTab:i}){let a=t.variant!=="circle"&&!!t.label;return r("button",{type:"button",class:`${yn}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":i?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":k.launcher,onClick:e,"aria-label":n.launcherOpen,children:[Bc(t.icon),a?r("span",{class:`${yn}-fab-label`,children:t.label}):null]})}function Bc(e){let t=ma[e];return t?r(t,{}):r($c,{source:e})}function $c({source:e}){return r("span",{ref:t=>{t&&Uc(t,e)},"aria-hidden":"true"})}function Uc(e,t){if(e.dataset.svgMounted!==t)try{let o=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;o&&o.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(o,!0)),e.dataset.svgMounted=t)}catch{}}function va({callout:e,launcherPosition:t,closeLabel:n,onDismiss:o}){let[i,a]=w(!1);return S(()=>{let s=setTimeout(()=>a(!0),e.delayMs);return()=>clearTimeout(s)},[e.delayMs]),S(()=>{if(!i||e.autoDismissMs<=0)return;let s=setTimeout(o,e.autoDismissMs);return()=>clearTimeout(s)},[i,e.autoDismissMs,o]),i?r("div",{class:`${yn}-callout`,role:"status","data-shape":e.shape,"data-position":zc(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":k.callout,children:[r("span",{children:e.text}),r("button",{type:"button",class:`${yn}-callout-close`,onClick:o,"aria-label":n,title:n,"data-testid":k.calloutDismiss,children:r(Ee,{})})]}):null}function zc(e,t){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"?o?"top":"bottom":n?"left":"right"}function Sn({panelEl:e,resize:t,position:n,initialSize:o,onSizeChange:i,strings:a}){let s=v.cssPrefix,l=N(null);if(S(()=>{if(!e)return;let m=e.style;t.minWidth&&m.setProperty(`--${s}-resize-min-w`,t.minWidth),t.maxWidth&&m.setProperty(`--${s}-resize-max-w`,t.maxWidth),t.minHeight&&m.setProperty(`--${s}-resize-min-h`,t.minHeight),t.maxHeight&&m.setProperty(`--${s}-resize-max-h`,t.maxHeight),o&&(m.setProperty(`--${s}-widget-w`,`${o.width}px`),m.setProperty(`--${s}-widget-h`,`${o.height}px`))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,s,o]),!e)return null;let c=n.startsWith("top-"),_=n.endsWith("-right"),p=`${s}-resize-grip ${s}-resize-grip--${c?"bottom":"top"}-${_?"left":"right"}`,d=m=>{if(!e)return;let f=m.currentTarget,b=e.getBoundingClientRect();l.current={pointerId:m.pointerId,startX:m.clientX,startY:m.clientY,startW:b.width,startH:b.height,dirX:_?-1:1,dirY:c?1:-1},f.setPointerCapture(m.pointerId),m.preventDefault()},u=m=>{let f=l.current;if(!f||m.pointerId!==f.pointerId||!e)return;let b=(m.clientX-f.startX)*f.dirX,x=(m.clientY-f.startY)*f.dirY;e.style.setProperty(`--${s}-widget-w`,`${f.startW+b}px`),e.style.setProperty(`--${s}-widget-h`,`${f.startH+x}px`)},g=m=>{let f=l.current;if(!f||m.pointerId!==f.pointerId||!e)return;m.currentTarget.releasePointerCapture(m.pointerId);let b=e.getBoundingClientRect();i({width:Math.round(b.width),height:Math.round(b.height)}),l.current=null};return r("div",{class:p,role:"separator","aria-orientation":"vertical","aria-label":a.resizeHandle,title:a.resizeHandle,onPointerDown:d,onPointerMove:u,onPointerUp:g,onPointerCancel:g,"data-testid":k.resizeGrip,children:r(ea,{})})}var Ge=v.cssPrefix,Fc=`.${Ge}-header, .${Ge}-back-header, .${Ge}-home-hero`,Wc='button, a, input, textarea, select, [role="tab"], [contenteditable]',ba=56;function wn(e,t){S(()=>{if(!t||!e)return;let n=c=>Number.parseFloat(c)||0,o=(c,_)=>Math.min(_,Math.max(-_,c)),i=null,a=c=>{let _=c.target;if(!(_ instanceof Element)||!_.closest(Fc)||_.closest(Wc))return;let p=e.getBoundingClientRect();i={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${Ge}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${Ge}-modal-dy`)),maxX:(window.innerWidth+p.width)/2-ba,maxY:(window.innerHeight+p.height)/2-ba},e.dataset.dragging="true",c.preventDefault()},s=c=>{if(!i||c.pointerId!==i.id)return;let _=o(i.dx+c.clientX-i.x,i.maxX),p=o(i.dy+c.clientY-i.y,i.maxY);e.style.setProperty(`--${Ge}-modal-dx`,`${_}px`),e.style.setProperty(`--${Ge}-modal-dy`,`${p}px`)},l=c=>{!i||c.pointerId!==i.id||(i=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",a),window.addEventListener("pointermove",s),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l),()=>{e.removeEventListener("pointerdown",a),window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l)}},[e,t])}function Et(e,t,n,o){switch(e){case"clear":case"sound":case"history":case"language":case"theme":return!0;case"expand":return t==="floating";case"fullscreen":return t!=="standalone";case"popOut":return t!=="standalone"&&!!o?.popOutUrl;case"close":return t==="standalone"||t==="page"?!1:t==="inline"?n==="fullscreen":!0}}function kn(e,t,n){return Et("close",e,t)?n.includes("close"):!1}function xa(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var Kc='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function En(e){let t=n=>{if(n.key!=="Tab")return;let o=[...e.querySelectorAll(Kc)].filter(l=>l.offsetParent!==null||l===document.activeElement);if(o.length===0){n.preventDefault();return}let i=o[0],a=o[o.length-1];if(!i||!a)return;let s=e.getRootNode().activeElement;n.shiftKey&&s===i?(n.preventDefault(),a.focus()):!n.shiftKey&&s===a&&(n.preventDefault(),i.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}function Cn(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var Ho=v.cssPrefix;function Pa({agent:e}){let t=e.status??"online";return r("div",{class:`${Ho}-agent`,children:[r("div",{class:`${Ho}-agent-avatar`,"data-status":t,children:e.avatar?r("img",{src:e.avatar,alt:""}):r("span",{children:Cn(e.name)})}),r("div",{class:`${Ho}-agent-meta`,children:[r("strong",{children:e.name}),e.title?r("span",{children:e.title}):null]})]})}var ya=M.scope("attachments");function An(e,t,n){let o=Vc(e),i=[],a=[],s=jc(n.accept),l=t.reduce((_,p)=>_+p.size,0),c=t.length;for(let _ of o){let p=Gc(_,c,l,n,s);if(p){a.push({file:_,reason:p});continue}i.push(Xc(_)),l+=_.size,c+=1}return(i.length||a.length)&&ya.debug("ingest",{accepted:i.length,rejected:a.map(_=>({name:_.file.name,reason:_.reason}))}),{accepted:i,rejected:a}}function Bo(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){ya.debug("revokeObjectURL failed",{error:t})}}function Gc(e,t,n,o,i){return t>=o.maxCount?"count":n+e.size>o.maxBytes?"bytes":Yc(e,i)?null:"mime"}function Vc(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:qc(t)).filter(t=>t!==null):[]}function qc(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function Xc(e){return{file:e,id:we(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function jc(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean).map(t=>{if(t.startsWith("."))return{kind:"ext",ext:t};let[n="*",o="*"]=t.split("/");return{kind:"mime",type:n,subtype:o}})}function Yc(e,t){if(t.length===0)return!0;let[n="*",o="*"]=(e.type||"").toLowerCase().split("/"),i=(e.name||"").toLowerCase();return t.some(a=>a.kind==="ext"?i.endsWith(a.ext):(a.type==="*"||a.type===n)&&(a.subtype==="*"||a.subtype===o))}var Ct=v.cssPrefix;function Sa({attachment:e,onRemove:t}){let n=e.mediaType.startsWith("image/");return r("span",{class:`${Ct}-attachment-chip`,title:e.name,"data-testid":ce(k.attachmentChip,e.id),children:[n?r("img",{class:`${Ct}-attachment-thumb`,src:e.previewUrl,alt:""}):r("span",{class:`${Ct}-attachment-thumb`,"aria-hidden":"true",children:r(ca,{})}),r("span",{class:`${Ct}-attachment-name`,children:e.name}),r("button",{type:"button",class:`${Ct}-attachment-remove`,onClick:t,"aria-label":`Remove ${e.name}`,"data-testid":ce(k.attachmentRemove,e.id),children:r(Ee,{})})]})}var $o={isSupported:!1,start:()=>{},stop:()=>{}};function Uo(e,t,n){return e==="disabled"?$o:e==="server"?ed(n):Jc(t)}function Jc(e){let t=Qc();if(!t)return $o;let n=null;return{isSupported:!0,start(o,i){n=new t,n.continuous=!0,n.interimResults=!0,n.lang=e,n.addEventListener("result",s=>{let l=s,c="",_=!1;for(let p=l.resultIndex;p<l.results.length;p++){let d=l.results[p];d&&(c+=d[0].transcript,d.isFinal&&(_=!0))}o(c,_)});let a=()=>{n=null,i()};n.addEventListener("end",a),n.addEventListener("error",a),n.start()},stop(){n?.stop()}}}function Qc(){let e=globalThis;return e.SpeechRecognition??e.webkitSpeechRecognition}var Zc=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function ed(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return $o;let t=null,n=null,o=[],i=()=>{for(let a of n?.getTracks()??[])a.stop();n=null};return{isSupported:!0,async start(a,s){try{n=await navigator.mediaDevices.getUserMedia({audio:!0});let l=td();t=new MediaRecorder(n,l?{mimeType:l}:void 0),o=[],t.addEventListener("dataavailable",c=>{c.data.size>0&&o.push(c.data)}),t.addEventListener("stop",async()=>{let c=t?.mimeType??"audio/webm";i();let _=new Blob(o,{type:c});o=[];try{let{text:p}=await e(_,c);p&&a(p,!0)}catch{}finally{s()}}),t.start()}catch{i(),s()}},stop(){t?.stop()}}}function td(){for(let e of Zc)if(MediaRecorder.isTypeSupported(e))return e}var he=v.cssPrefix,Ve=M.scope("composer");function at(e){return e.reduce((t,n)=>t+n.size,0)}var nd={arrowUp:Gi,paperPlane:Ki,send:Vi,chevron:Pn};function wa({options:e,transport:t,feedback:n,bus:o,isStreaming:i,onSend:a,onStop:s,attachApiRef:l}){let c=e.strings,[_,p]=w(""),[d,u]=w([]),[g,m]=w(!1),f=N(null),b=N(null),x=e.features.files,y=e.features.voice,[A,j]=w(()=>Uo(y,e.locale,(E,z)=>t.transcribe(E,z)));S(()=>{g||y==="disabled"||j(Uo(y,e.locale,(E,z)=>t.transcribe(E,z)))},[e.locale,y,t,g]),S(()=>{let E=f.current;if(!E)return;let z=E.getRootNode(),Y="activeElement"in z?z.activeElement:null;Y&&E.closest(`.${he}-panel`)?.contains(Y)||E.focus({preventScroll:!0})},[]),S(()=>{let E=f.current;if(E){if(_.length===0){E.style.height="";return}E.style.height="auto",E.style.height=`${Math.min(E.scrollHeight,160)}px`}},[_]);let U=N(d);U.current=d,S(()=>()=>U.current.forEach(Bo),[]),S(()=>{if(l)return l.current={attachFromDrop:E=>{let z=An(E,U.current,e.attachments);z.accepted.length!==0&&(Ve.info("attach (drop)",{count:z.accepted.length,totalBytes:at(z.accepted)}),o.emit("attach",{count:z.accepted.length,totalBytes:at(z.accepted)}),u(Y=>[...Y,...z.accepted]))}},()=>{l.current&&(l.current=null)}},[l,e.attachments]),S(()=>{let E=f.current;if(!E)return;let z=E.closest(`.${he}-panel`);if(!z)return;let Y=fe=>{let Ue=fe.clipboardData;if(!Ue)return;if(x){let ue=An(Ue.items,U.current,e.attachments);if(ue.accepted.length>0){fe.preventDefault(),Ve.info("attach (paste)",{count:ue.accepted.length,totalBytes:at(ue.accepted)}),o.emit("attach",{count:ue.accepted.length,totalBytes:at(ue.accepted)}),u(Rt=>[...Rt,...ue.accepted]);return}}if(fe.target===E)return;let _e=Ue.getData("text/plain");_e&&(fe.preventDefault(),p(ue=>ue+_e),E.focus())};return z.addEventListener("paste",Y),()=>z.removeEventListener("paste",Y)},[x,e.attachments,he]);let oe=()=>{let E=_.trim();!E&&d.length===0||i||(a(E,d),p(""),u([]))},O=E=>{E.key!=="Enter"||E.shiftKey||E.isComposing||(E.preventDefault(),i?s():oe())},le=E=>{let z=E.target,Y=An(z.files,d,e.attachments);Y.accepted.length>0&&(Ve.info("attach (file picker)",{count:Y.accepted.length,totalBytes:at(Y.accepted)}),o.emit("attach",{count:Y.accepted.length,totalBytes:at(Y.accepted)}),u(fe=>[...fe,...Y.accepted])),z.value=""},B=E=>{Ve.info("removeAttachment",{id:E}),o.emit("removeAttachment",{id:E}),u(z=>{let Y=z.find(fe=>fe.id===E);return Y&&Bo(Y),z.filter(fe=>fe.id!==E)})},R=N(null),Ye=()=>{if(A.isSupported){if(g){let E=R.current?Date.now()-R.current:0;Ve.info("voiceStop",{durationMs:E}),o.emit("voiceStop",{durationMs:E}),A.stop(),m(!1),n.play("voiceStop"),R.current=null;return}R.current=Date.now(),Ve.info("voiceStart"),o.emit("voiceStart",void 0),m(!0),n.play("voiceStart"),A.start((E,z)=>p(Y=>z?`${Y}${E} `:Y),()=>{if(m(!1),R.current){let E=Date.now()-R.current;Ve.debug("voiceStop (auto)",{durationMs:E}),o.emit("voiceStop",{durationMs:E}),R.current=null}})}},de=nd[e.composer.sendButton.icon];return r("div",{class:`${he}-composer`,"data-testid":k.composer,children:[d.length>0?r("div",{class:`${he}-attachments`,children:d.map(E=>r(Sa,{attachment:E,onRemove:()=>B(E.id)},E.id))}):null,r("div",{class:`${he}-composer-row`,children:[r("div",{class:`${he}-composer-actions`,children:[x?r("button",{type:"button",class:`${he}-icon-btn`,onClick:()=>b.current?.click(),"aria-label":c.attach,"data-testid":k.composerAttach,children:r(Xi,{})}):null,A.isSupported?r("button",{type:"button",class:`${he}-icon-btn`,onClick:Ye,"aria-label":g?c.micStop:c.micStart,"aria-pressed":g,"data-recording":g?"true":void 0,"data-testid":k.composerVoice,children:r(ji,{})}):null]}),r("textarea",{ref:f,class:`${he}-textarea`,rows:1,value:_,placeholder:c.composerPlaceholder,onInput:E=>p(E.target.value),onKeyDown:O,"aria-label":c.composerPlaceholder,"data-testid":k.composerInput}),i?r("button",{type:"button",class:`${he}-send`,onClick:s,"aria-label":c.stop,"data-testid":k.composerStop,children:r(qi,{})}):r("button",{type:"button",class:`${he}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:oe,disabled:!_.trim()&&d.length===0,"aria-label":c.send,"data-testid":k.composerSend,children:r(de,{})})]}),r("input",{ref:b,type:"file",multiple:!0,accept:e.attachments.accept,onChange:le,class:`${he}-sr-only`,"data-testid":k.composerFileInput})]})}var od=v.cssPrefix;function ka({visible:e,strings:t}){return e?r("div",{class:`${od}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function Tn({containerRef:e,onDrop:t}){let[n,o]=w(!1);return S(()=>{let i=e.current;if(!i)return;let a=0,s=p=>{a+=1,p.dataTransfer?.types.includes("Files")&&(p.preventDefault(),o(!0))},l=()=>{a-=1,!(a>0)&&(a=0,o(!1))},c=p=>{p.dataTransfer?.types.includes("Files")&&p.preventDefault()},_=p=>{a=0,o(!1),p.dataTransfer&&(p.preventDefault(),t(p.dataTransfer.items))};return i.addEventListener("dragenter",s),i.addEventListener("dragleave",l),i.addEventListener("dragover",c),i.addEventListener("drop",_),()=>{i.removeEventListener("dragenter",s),i.removeEventListener("dragleave",l),i.removeEventListener("dragover",c),i.removeEventListener("drop",_)}},[e,t]),{visible:n}}function Ea({itemCount:e,initialFocusIndex:t}){let[n,o]=w(!1),i=N(null),a=N(null),[s,l]=w(-1),c=D(()=>{o(!1),l(-1),i.current?.focus()},[]),_=D(()=>o(u=>!u),[]);S(()=>{if(!n)return;let u=g=>{let m=a.current,f=i.current;if(!m||!f)return;let b=g.composedPath();b.includes(m)||b.includes(f)||(o(!1),l(-1))};return document.addEventListener("click",u,!0),()=>document.removeEventListener("click",u,!0)},[n]),S(()=>{if(!n||e===0)return;let u=t?.()??0,g=u<0||u>=e?0:u;l(g)},[n,e,t]),S(()=>{if(!n||s<0)return;a.current?.querySelectorAll("[role='menuitem']")?.[s]?.focus()},[n,s]);let p=D(u=>{(u.key==="ArrowDown"||u.key==="Enter"||u.key===" ")&&(u.preventDefault(),o(!0))},[]),d=D(u=>{if(e!==0)switch(u.key){case"Escape":u.preventDefault(),c();return;case"ArrowDown":u.preventDefault(),l(g=>(g+1)%e);return;case"ArrowUp":u.preventDefault(),l(g=>(g-1+e)%e);return;case"Home":u.preventDefault(),l(0);return;case"End":u.preventDefault(),l(e-1)}},[e,c]);return{open:n,focusIndex:s,triggerRef:i,menuRef:a,toggle:_,close:c,onTriggerKey:p,onMenuKey:d}}function Ca({items:e,triggerLabel:t}){let n=v.cssPrefix,o=Ea({itemCount:e.length}),i=a=>{a.disabled||(a.onSelect(),a.keepOpen||o.close())};return r("div",{class:`${n}-menu-wrap`,children:[r("button",{ref:o.triggerRef,type:"button",class:`${n}-icon-btn`,"aria-label":t,"aria-haspopup":"menu","aria-expanded":o.open,title:t,onClick:o.toggle,onKeyDown:o.onTriggerKey,children:r(ta,{})}),o.open?r("div",{ref:o.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:o.onMenuKey,tabIndex:-1,children:e.map(a=>r("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":a.type==="switch"?a.on:void 0,disabled:a.disabled,lang:a.lang,onClick:()=>i(a),children:[a.icon?r("span",{class:`${n}-menu-icon`,children:a.icon}):null,r("span",{class:`${n}-menu-label`,children:a.label}),a.type==="switch"&&a.on?r("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:r(ra,{})}):null]},a.id))}):null]})}var zo=v.cssPrefix,rd={auto:"dark",dark:"light",light:"auto"};function id(e){return e==="light"?r(pa,{}):e==="dark"?r(fa,{}):r(ga,{})}function Ce({panelProps:e,variant:t}){let{options:n,panelSize:o,feedback:i,onClose:a,onClear:s,onExpand:l,onFullscreen:c,onPopOut:_,onSoundToggle:p}=e,{onToggleHistory:d,onLocaleChange:u,onThemeChange:g}=e,m=n.strings,f=n.mode,b=t==="chat",x=Se(()=>i.mutedSig.value).value,y=new Set(n.actions),A=R=>y.has(R),j=R=>Et(R,f,o,{popOutUrl:n.popOutUrl}),U=n.themeMode,oe={auto:m.themeAuto,light:m.themeLight,dark:m.themeDark},O=[];if(A("theme")&&O.push({id:"theme",icon:id(U),label:`${m.theme}: ${oe[U]}`,onSelect:()=>g(rd[U]),keepOpen:!0}),A("language")&&n.availableLocales.length>1)for(let R of n.availableLocales)O.push({id:`language:${R}`,label:`${m.language} \u2014 ${R}`,lang:R,type:"switch",on:R===n.locale,onSelect:()=>u(R)});if(A("expand")&&j("expand")){let R=o==="expanded";O.push({id:"expand",icon:R?r(Ji,{}):r(Yi,{}),label:R?m.collapse:m.expand,type:"switch",on:R,onSelect:l})}if(A("fullscreen")&&j("fullscreen")){let R=o==="fullscreen";O.push({id:"fullscreen",icon:R?r(Zi,{}):r(Qi,{}),label:R?m.exitFullscreen:m.fullscreen,type:"switch",on:R,onSelect:c})}A("popOut")&&j("popOut")&&O.push({id:"popOut",icon:r(aa,{}),label:m.popOut,onSelect:_}),b&&A("sound")&&O.push({id:"sound",icon:x?r(oa,{}):r(na,{}),label:x?m.soundOff:m.soundOn,type:"switch",on:!x,onSelect:p}),b&&A("clear")&&O.push({id:"clear",icon:r(sa,{}),label:m.newConversation,onSelect:s});let le=!!a&&kn(f,o,n.actions),B=b&&A("history");return r("div",{class:`${zo}-header-actions`,children:[B?r("button",{type:"button",class:`${zo}-icon-btn`,onClick:d,"aria-label":m.history,title:m.history,"data-testid":k.actionHistory,children:r(ia,{})}):null,O.length>0?r(Ca,{items:O,triggerLabel:m.moreActions}):null,le?r("button",{type:"button",class:`${zo}-icon-btn`,onClick:a,"aria-label":m.close,title:m.close,"data-testid":k.actionClose,children:r(Ee,{})}):null]})}var Ko=1,Ta=2,Ia=4,Ra=8,Ma=16;function ad(e){switch(e){case Ko:return"href";case Ta:return"src";case Ia:return"class";case Ra:return"checked";case Ma:return"start"}}var sd=e=>{switch(e){case 1:return 3;case 2:return 4;case 3:return 5;case 4:return 6;case 5:return 7;default:return 8}},ld=sd;var Aa=24;function Vo(e){let t=new Uint32Array(Aa);return t[0]=1,{renderer:e,text:"",pending:"",tokens:t,len:0,token:1,fence_end:0,blockquote_idx:0,hr_char:"",hr_chars:0,fence_start:0,spaces:new Uint8Array(Aa),indent:"",indent_len:0,table_state:0}}function La(e){e.pending.length>0&&se(e,`
12
12
  `)}function $(e){e.text.length!==0&&(console.assert(e.len>0,"Never adding text to root"),e.renderer.add_text(e.renderer.data,e.text),e.text="")}function Z(e){console.assert(e.len>0,"No nodes to end"),e.len-=1,e.token=e.tokens[e.len],e.renderer.end_token(e.renderer.data)}function K(e,t){(e.tokens[e.len]===24||e.tokens[e.len]===23)&&t!==25&&Z(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function cd(e,t,n){for(;n<=e.len;){if(e.tokens[n]===t)return n;n+=1}return-1}function qe(e,t){for(e.fence_start=0;e.len>t;)Z(e)}function In(e,t){let n=0;for(let o=0;o<=e.len&&(t-=e.spaces[o],!(t<0));o+=1)switch(e.tokens[o]){case 9:case 10:case 20:case 25:n=o;break}for(;e.len>n;)Z(e);return t}function Fo(e,t){let n=-1,o=-1;for(let i=e.blockquote_idx+1;i<=e.len;i+=1)if(e.tokens[i]===25){if(e.indent_len<e.spaces[i]){o=-1;break}o=i}else e.tokens[i]===t&&(n=i);return o===-1?n===-1?(qe(e,e.blockquote_idx),K(e,t),!0):(qe(e,n),!1):(qe(e,o),K(e,t),!0)}function Wo(e,t){K(e,25),e.spaces[e.len]=e.indent_len+t,Me(e),e.token=103}function Me(e){e.indent="",e.indent_len=0,e.pending=""}function Go(e){switch(e){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return!0;default:return!1}}function dd(e){switch(e){case 32:case 58:case 59:case 41:case 44:case 33:case 46:case 63:case 93:case 10:return!0;default:return!1}}function _d(e){return Go(e)||dd(e)}function se(e,t){for(let n of t){if(e.token===101){switch(n){case" ":e.indent_len+=1;continue;case" ":e.indent_len+=4;continue}let i=In(e,e.indent_len);e.indent_len=0,e.token=e.tokens[e.len],i>0&&se(e," ".repeat(i))}let o=e.pending+n;switch(e.token){case 21:case 1:case 20:case 24:case 23:switch(console.assert(e.text.length===0,"Root should not have any text"),e.pending[0]){case void 0:e.pending=n;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=1;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=4;continue;case`
13
13
  `:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){Z(e),Me(e),e.pending=n;continue}qe(e,e.blockquote_idx),Me(e),e.blockquote_idx=0,e.fence_start=0,e.pending=n;continue;case"#":switch(n){case"#":if(e.pending.length<6){e.pending=o;continue}break;case" ":In(e,e.indent_len),K(e,ld(e.pending.length)),Me(e);continue}break;case">":{let a=cd(e,20,e.blockquote_idx+1);a===-1?(qe(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,K(e,20)):e.blockquote_idx=a,Me(e),e.pending=n;continue}case"-":case"*":case"_":if(e.hr_chars===0&&(console.assert(e.pending.length===1,"Pending should be one character"),e.hr_chars=1,e.hr_char=e.pending),e.hr_chars>0){switch(n){case e.hr_char:e.hr_chars+=1,e.pending=o;continue;case" ":e.pending=o;continue;case`
14
14
  `:if(e.hr_chars<3)break;In(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),Me(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){Fo(e,23),Wo(e,2),se(e,o.slice(2));continue}break;case"`":if(e.pending.length<3){if(n==="`"){e.pending=o,e.fence_start=o.length;continue}e.fence_start=0;break}switch(n){case"`":e.pending.length===e.fence_start?(e.pending=o,e.fence_start=o.length):(K(e,2),Me(e),e.fence_start=0,se(e,o));continue;case`