@elevenlabs/convai-widget-embed 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";var $t,T,to,no,tt,ro,oo,ao,io,On,Ln,Rn,so,It={},lo=[],Ss=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Dt=Array.isArray;function Ne(e,t){for(var n in t)e[n]=t[n];return e}function Fn(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function K(e,t,n){var r,o,a,i={};for(a in t)a=="key"?r=t[a]:a=="ref"?o=t[a]:i[a]=t[a];if(arguments.length>2&&(i.children=arguments.length>3?$t.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)i[a]==null&&(i[a]=e.defaultProps[a]);return Mt(e,i,r,o,null)}function Mt(e,t,n,r,o){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++to,__i:-1,__u:0};return o==null&&T.vnode!=null&&T.vnode(a),a}function co(){return{current:null}}function ee(e){return e.children}function be(e,t){this.props=e,this.context=t}function ut(e,t){if(t==null)return e.__?ut(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"?ut(e):null}function uo(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return uo(e)}}function zn(e){(!e.__d&&(e.__d=!0)&&tt.push(e)&&!Gt.__r++||ro!=T.debounceRendering)&&((ro=T.debounceRendering)||oo)(Gt)}function Gt(){for(var e,t,n,r,o,a,i,s=1;tt.length;)tt.length>s&&tt.sort(ao),e=tt.shift(),s=tt.length,e.__d&&(n=void 0,o=(r=(t=e).__v).__e,a=[],i=[],t.__P&&((n=Ne({},r)).__v=r.__v+1,T.vnode&&T.vnode(n),Un(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,a,o??ut(r),!!(32&r.__u),i),n.__v=r.__v,n.__.__k[n.__i]=n,mo(a,n,i),n.__e!=o&&uo(n)));Gt.__r=0}function fo(e,t,n,r,o,a,i,s,l,c,f){var u,v,h,g,p,m,_=r&&r.__k||lo,w=t.length;for(l=Es(n,t,_,l,w),u=0;u<w;u++)(h=n.__k[u])!=null&&(v=h.__i==-1?It:_[h.__i]||It,h.__i=u,m=Un(e,h,v,o,a,i,s,l,c,f),g=h.__e,h.ref&&v.ref!=h.ref&&(v.ref&&Bn(v.ref,null,h),f.push(h.ref,h.__c||g,h)),p==null&&g!=null&&(p=g),4&h.__u||v.__k===h.__k?l=po(h,l,e):typeof h.type=="function"&&m!==void 0?l=m:g&&(l=g.nextSibling),h.__u&=-7);return n.__e=p,l}function Es(e,t,n,r,o){var a,i,s,l,c,f=n.length,u=f,v=0;for(e.__k=new Array(o),a=0;a<o;a++)(i=t[a])!=null&&typeof i!="boolean"&&typeof i!="function"?(l=a+v,(i=e.__k[a]=typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?Mt(null,i,null,null,null):Dt(i)?Mt(ee,{children:i},null,null,null):i.constructor==null&&i.__b>0?Mt(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=e,i.__b=e.__b+1,s=null,(c=i.__i=Ts(i,n,l,u))!=-1&&(u--,(s=n[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(o>f?v--:o<f&&v++),typeof i.type!="function"&&(i.__u|=4)):c!=l&&(c==l-1?v--:c==l+1?v++:(c>l?v--:v++,i.__u|=4))):e.__k[a]=null;if(u)for(a=0;a<f;a++)(s=n[a])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=ut(s)),_o(s,s));return r}function po(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=po(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=ut(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function De(e,t){return t=t||[],e==null||typeof e=="boolean"||(Dt(e)?e.some(function(n){De(n,t)}):t.push(e)),t}function Ts(e,t,n,r){var o,a,i=e.key,s=e.type,l=t[n];if(l===null&&e.key==null||l&&i==l.key&&s==l.type&&(2&l.__u)==0)return n;if(r>(l!=null&&(2&l.__u)==0?1:0))for(o=n-1,a=n+1;o>=0||a<t.length;){if(o>=0){if((l=t[o])&&(2&l.__u)==0&&i==l.key&&s==l.type)return o;o--}if(a<t.length){if((l=t[a])&&(2&l.__u)==0&&i==l.key&&s==l.type)return a;a++}}return-1}function ho(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Ss.test(t)?n:n+"px"}function Zt(e,t,n,r,o){var a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||ho(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||ho(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")a=t!=(t=t.replace(io,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?r?n.u=r.u:(n.u=On,e.addEventListener(t,a?Rn:Ln,a)):e.removeEventListener(t,a?Rn:Ln,a);else{if(o=="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 vo(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=On++;else if(t.t<n.u)return;return n(T.event?T.event(t):t)}}}function Un(e,t,n,r,o,a,i,s,l,c){var f,u,v,h,g,p,m,_,w,y,b,C,k,x,P,D,F,O=t.type;if(t.constructor!=null)return null;128&n.__u&&(l=!!(32&n.__u),a=[s=t.__e=n.__e]),(f=T.__b)&&f(t);e:if(typeof O=="function")try{if(_=t.props,w="prototype"in O&&O.prototype.render,y=(f=O.contextType)&&r[f.__c],b=f?y?y.props.value:f.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:(w?t.__c=u=new O(_,b):(t.__c=u=new be(_,b),u.constructor=O,u.render=Ps),y&&y.sub(u),u.props=_,u.state||(u.state={}),u.context=b,u.__n=r,v=u.__d=!0,u.__h=[],u._sb=[]),w&&u.__s==null&&(u.__s=u.state),w&&O.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=Ne({},u.__s)),Ne(u.__s,O.getDerivedStateFromProps(_,u.__s))),h=u.props,g=u.state,u.__v=t,v)w&&O.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),w&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(w&&O.getDerivedStateFromProps==null&&_!==h&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(_,b),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(_,u.__s,b)===!1||t.__v==n.__v){for(t.__v!=n.__v&&(u.props=_,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(L){L&&(L.__=t)}),C=0;C<u._sb.length;C++)u.__h.push(u._sb[C]);u._sb=[],u.__h.length&&i.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(_,u.__s,b),w&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,g,p)})}if(u.context=b,u.props=_,u.__P=e,u.__e=!1,k=T.__r,x=0,w){for(u.state=u.__s,u.__d=!1,k&&k(t),f=u.render(u.props,u.state,u.context),P=0;P<u._sb.length;P++)u.__h.push(u._sb[P]);u._sb=[]}else do u.__d=!1,k&&k(t),f=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++x<25);u.state=u.__s,u.getChildContext!=null&&(r=Ne(Ne({},r),u.getChildContext())),w&&!v&&u.getSnapshotBeforeUpdate!=null&&(p=u.getSnapshotBeforeUpdate(h,g)),D=f,f!=null&&f.type===ee&&f.key==null&&(D=go(f.props.children)),s=fo(e,Dt(D)?D:[D],t,n,r,o,a,i,s,l,c),u.base=t.__e,t.__u&=-161,u.__h.length&&i.push(u),m&&(u.__E=u.__=null)}catch(L){if(t.__v=null,l||a!=null)if(L.then){for(t.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__e=s}else for(F=a.length;F--;)Fn(a[F]);else t.__e=n.__e,t.__k=n.__k;T.__e(L,t,n)}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=Ns(n.__e,t,n,r,o,a,i,l,c);return(f=T.diffed)&&f(t),128&t.__u?void 0:s}function mo(e,t,n){for(var r=0;r<n.length;r++)Bn(n[r],n[++r],n[++r]);T.__c&&T.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(a){a.call(o)})}catch(a){T.__e(a,o.__v)}})}function go(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:Dt(e)?e.map(go):Ne({},e)}function Ns(e,t,n,r,o,a,i,s,l){var c,f,u,v,h,g,p,m=n.props,_=t.props,w=t.type;if(w=="svg"?o="http://www.w3.org/2000/svg":w=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),a!=null){for(c=0;c<a.length;c++)if((h=a[c])&&"setAttribute"in h==!!w&&(w?h.localName==w:h.nodeType==3)){e=h,a[c]=null;break}}if(e==null){if(w==null)return document.createTextNode(_);e=document.createElementNS(o,w,_.is&&_),s&&(T.__m&&T.__m(t,a),s=!1),a=null}if(w==null)m===_||s&&e.data==_||(e.data=_);else{if(a=a&&$t.call(e.childNodes),m=n.props||It,!s&&a!=null)for(m={},c=0;c<e.attributes.length;c++)m[(h=e.attributes[c]).name]=h.value;for(c in m)if(h=m[c],c!="children"){if(c=="dangerouslySetInnerHTML")u=h;else if(!(c in _)){if(c=="value"&&"defaultValue"in _||c=="checked"&&"defaultChecked"in _)continue;Zt(e,c,null,h,o)}}for(c in _)h=_[c],c=="children"?v=h:c=="dangerouslySetInnerHTML"?f=h:c=="value"?g=h:c=="checked"?p=h:s&&typeof h!="function"||m[c]===h||Zt(e,c,h,m[c],o);if(f)s||u&&(f.__html==u.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(u&&(e.innerHTML=""),fo(t.type=="template"?e.content:e,Dt(v)?v:[v],t,n,r,w=="foreignObject"?"http://www.w3.org/1999/xhtml":o,a,i,a?a[0]:n.__k&&ut(n,0),s,l),a!=null)for(c=a.length;c--;)Fn(a[c]);s||(c="value",w=="progress"&&g==null?e.removeAttribute("value"):g!=null&&(g!==e[c]||w=="progress"&&!g||w=="option"&&g!=m[c])&&Zt(e,c,g,m[c],o),c="checked",p!=null&&p!=e[c]&&Zt(e,c,p,m[c],o))}return e}function Bn(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(o){T.__e(o,n)}}function _o(e,t,n){var r,o;if(T.unmount&&T.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Bn(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(a){T.__e(a,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&_o(r[o],t,n||typeof e.type!="function");n||Fn(e.__e),e.__c=e.__=e.__e=void 0}function Ps(e,t,n){return this.constructor(e,n)}function Be(e,t,n){var r,o,a,i;t==document&&(t=document.documentElement),T.__&&T.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,a=[],i=[],Un(t,e=(!r&&n||t).__k=K(ee,null,[e]),o||It,It,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?$t.call(t.childNodes):null,a,!r&&n?n:o?o.__e:t.firstChild,r,i),mo(a,e,i)}function Wn(e,t){Be(e,t,Wn)}function Hn(e,t,n){var r,o,a,i,s=Ne({},e.props);for(a in e.type&&e.type.defaultProps&&(i=e.type.defaultProps),t)a=="key"?r=t[a]:a=="ref"?o=t[a]:s[a]=t[a]==null&&i!=null?i[a]:t[a];return arguments.length>2&&(s.children=arguments.length>3?$t.call(arguments,2):n),Mt(e.type,s,r||e.key,o||e.ref,null)}function ie(e){function t(n){var r,o;return this.getChildContext||(r=new Set,(o={})[t.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(a){this.props.value!=a.value&&r.forEach(function(i){i.__e=!0,zn(i)})},this.sub=function(a){r.add(a);var i=a.componentWillUnmount;a.componentWillUnmount=function(){r&&r.delete(a),i&&i.call(a)}}),n.children}return t.__c="__cC"+so++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,r){return n.children(r)}).contextType=t,t}$t=lo.slice,T={__e:function(e,t,n,r){for(var o,a,i;t=t.__;)if((o=t.__c)&&!o.__)try{if((a=o.constructor)&&a.getDerivedStateFromError!=null&&(o.setState(a.getDerivedStateFromError(e)),i=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),i=o.__d),i)return o.__E=o}catch(s){e=s}throw e}},to=0,no=function(e){return e!=null&&e.constructor==null},be.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ne({},this.state),typeof e=="function"&&(e=e(Ne({},n),this.props)),e&&Ne(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),zn(this))},be.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),zn(this))},be.prototype.render=ee,tt=[],oo=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ao=function(e,t){return e.__v.__b-t.__v.__b},Gt.__r=0,io=/(PointerCapture)$|Capture$/i,On=0,Ln=vo(!1),Rn=vo(!0),so=0;function Vn(){return(Vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var As=["context","children"];function $s(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(r,o){if(r==null)return{};var a,i,s={},l=Object.keys(r);for(i=0;i<l.length;i++)o.indexOf(a=l[i])>=0||(s[a]=r[a]);return s}(e,As);return Hn(t,n)}function Is(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=K($s,Vn({},this._props,{context:e.detail.context}),function t(n,r){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var o=[],a={},i=0,s=n.attributes,l=n.childNodes;for(i=s.length;i--;)s[i].name!=="slot"&&(a[s[i].name]=s[i].value,a[wo(s[i].name)]=s[i].value);for(i=l.length;i--;){var c=t(l[i],null),f=l[i].slot;f?a[f]=K(yo,{name:f},c):o[i]=c}var u=r?K(yo,null,o):o;return K(r||n.nodeName.toLowerCase(),a,u)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Wn:Be)(this._vdom,this._root)}function wo(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function Ds(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[wo(e)]=n,this._vdom=Hn(this._vdom,r),Be(this._vdom,this._root)}}function Ms(){Be(this._vdom=null,this._root)}function yo(e,t){var n=this;return K("slot",Vn({},e,{ref:function(r){r?(n.ref=r,n._listener||(n._listener=function(o){o.stopPropagation(),o.detail.context=t},r.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function Os(e,t,n,r){function o(){var a=Reflect.construct(HTMLElement,[],o);return a._vdomComponent=e,a._root=r&&r.shadow?a.attachShadow({mode:r.mode||"open"}):a,a}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=Is,o.prototype.attributeChangedCallback=Ds,o.prototype.disconnectedCallback=Ms,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach(function(a){Object.defineProperty(o.prototype,a,{get:function(){return this._vdom.props[a]},set:function(i){this._vdom?this.attributeChangedCallback(a,null,i):(this._props||(this._props={}),this._props[a]=i,this.connectedCallback());var s=typeof i;i!=null&&s!=="string"&&s!=="boolean"&&s!=="number"||this.setAttribute(a,i)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o)}var Ls=0;function d(e,t,n,r,o,a){t||(t={});var i,s,l=t;if("ref"in l)for(s in l={},t)s=="ref"?i=t[s]:l[s]=t[s];var c={type:e,props:l,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ls,__i:-1,__u:0,__source:o,__self:a};if(typeof e=="function"&&(i=e.defaultProps))for(s in i)l[s]===void 0&&(l[s]=i[s]);return T.vnode&&T.vnode(c),c}var Me,W,jn,bo,dt=0,xo=[],Z=T,Co=Z.__b,ko=Z.__r,So=Z.diffed,Eo=Z.__c,To=Z.unmount,No=Z.__;function nt(e,t){Z.__h&&Z.__h(W,e,dt||t),dt=0;var n=W.__H||(W.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function S(e){return dt=1,Jt(Ao,e)}function Jt(e,t,n){var r=nt(Me++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ao(void 0,t),function(s){var l=r.__N?r.__N[0]:r.__[0],c=r.t(l,s);l!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=W,!W.__f)){var o=function(s,l,c){if(!r.__c.__H)return!0;var f=r.__c.__H.__.filter(function(v){return!!v.__c});if(f.every(function(v){return!v.__N}))return!a||a.call(this,s,l,c);var u=r.__c.props!==s;return f.forEach(function(v){if(v.__N){var h=v.__[0];v.__=v.__N,v.__N=void 0,h!==v.__[0]&&(u=!0)}}),a&&a.call(this,s,l,c)||u};W.__f=!0;var a=W.shouldComponentUpdate,i=W.componentWillUpdate;W.componentWillUpdate=function(s,l,c){if(this.__e){var f=a;a=void 0,o(s,l,c),a=f}i&&i.call(this,s,l,c)},W.shouldComponentUpdate=o}return r.__N||r.__}function A(e,t){var n=nt(Me++,3);!Z.__s&&Gn(n.__H,t)&&(n.__=e,n.u=t,W.__H.__h.push(n))}function Oe(e,t){var n=nt(Me++,4);!Z.__s&&Gn(n.__H,t)&&(n.__=e,n.u=t,W.__h.push(n))}function E(e){return dt=5,B(function(){return{current:e}},[])}function Yn(e,t,n){dt=6,Oe(function(){if(typeof e=="function"){var r=e(t());return function(){e(null),r&&typeof r=="function"&&r()}}if(e)return e.current=t(),function(){return e.current=null}},n==null?n:n.concat(e))}function B(e,t){var n=nt(Me++,7);return Gn(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function $(e,t){return dt=8,B(function(){return e},t)}function We(e){var t=W.context[e.__c],n=nt(Me++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(W)),t.props.value):e.__}function qn(e,t){Z.useDebugValue&&Z.useDebugValue(t?t(e):e)}function Rs(e){var t=nt(Me++,10),n=S();return t.__=e,W.componentDidCatch||(W.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function Xn(){var e=nt(Me++,11);if(!e.__){for(var t=W.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Fs(){for(var e;e=xo.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Qt),e.__H.__h.forEach(Kn),e.__H.__h=[]}catch(t){e.__H.__h=[],Z.__e(t,e.__v)}}Z.__b=function(e){W=null,Co&&Co(e)},Z.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),No&&No(e,t)},Z.__r=function(e){ko&&ko(e),Me=0;var t=(W=e.__c).__H;t&&(jn===W?(t.__h=[],W.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(Qt),t.__h.forEach(Kn),t.__h=[],Me=0)),jn=W},Z.diffed=function(e){So&&So(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(xo.push(t)!==1&&bo===Z.requestAnimationFrame||((bo=Z.requestAnimationFrame)||zs)(Fs)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),jn=W=null},Z.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Qt),n.__h=n.__h.filter(function(r){return!r.__||Kn(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],Z.__e(r,n.__v)}}),Eo&&Eo(e,t)},Z.unmount=function(e){To&&To(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Qt(r)}catch(o){t=o}}),n.__H=void 0,t&&Z.__e(t,n.__v))};var Po=typeof requestAnimationFrame=="function";function zs(e){var t,n=function(){clearTimeout(r),Po&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Po&&(t=requestAnimationFrame(n))}function Qt(e){var t=W,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),W=t}function Kn(e){var t=W;e.__c=e.__(),W=t}function Gn(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Ao(e,t){return typeof t=="function"?t(e):t}function $o(e,t){for(var n in t)e[n]=t[n];return e}function Zn(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function Jn(e,t){var n=t(),r=S({t:{__:n,u:t}}),o=r[0].t,a=r[1];return Oe(function(){o.__=n,o.u=t,Qn(o)&&a({t:o})},[e,n,t]),A(function(){return Qn(o)&&a({t:o}),e(function(){Qn(o)&&a({t:o})})},[e]),n}function Qn(e){var t,n,r=e.u,o=e.__;try{var a=r();return!((t=o)===(n=a)&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return!0}}function er(e){e()}function tr(e){return e}function nr(){return[!1,er]}var rr=Oe;function en(e,t){this.props=e,this.context=t}function tn(e,t){function n(o){var a=this.props.ref,i=a==o.ref;return!i&&a&&(a.call?a(null):a.current=null),t?!t(this.props,o)||!i:Zn(this.props,o)}function r(o){return this.shouldComponentUpdate=n,K(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(en.prototype=new be).isPureReactComponent=!0,en.prototype.shouldComponentUpdate=function(e,t){return Zn(this.props,e)||Zn(this.state,t)};var Io=T.__b;T.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Io&&Io(e)};var Us=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function I(e){function t(n){var r=$o({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=Us,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Do=function(e,t){return e==null?null:De(De(e).map(t))},He={map:Do,forEach:Do,count:function(e){return e?De(e).length:0},only:function(e){var t=De(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:De},Bs=T.__e;T.__e=function(e,t,n,r){if(e.then){for(var o,a=t;a=a.__;)if((o=a.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}Bs(e,t,n,r)};var Mo=T.unmount;function Oo(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=$o({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Oo(r,t,n)})),e}function Lo(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Lo(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Ot(){this.__u=0,this.o=null,this.__b=null}function Ro(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Fo(e){var t,n,r;function o(a){if(t||(t=e()).then(function(i){n=i.default||i},function(i){r=i}),r)throw r;if(!n)throw t;return K(n,a)}return o.displayName="Lazy",o.__f=!0,o}function ft(){this.i=null,this.l=null}T.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Mo&&Mo(e)},(Ot.prototype=new be).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=Ro(r.__v),a=!1,i=function(){a||(a=!0,n.__R=null,o?o(s):s())};n.__R=i;var s=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=Lo(l,l.__c.__P,l.__c.__O)}var c;for(r.setState({__a:r.__b=null});c=r.o.pop();)c.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(i,i)},Ot.prototype.componentWillUnmount=function(){this.o=[]},Ot.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Oo(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&K(ee,null,e.fallback);return o&&(o.__u&=-33),[K(ee,null,t.__a?null:e.children),o]};var zo=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function Ws(e){return this.getChildContext=function(){return e.context},e.children}function Hs(e){var t=this,n=e.h;t.componentWillUnmount=function(){Be(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),t.v||(t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],contains:function(){return!0},appendChild:function(r){this.childNodes.push(r),t.h.appendChild(r)},insertBefore:function(r,o){this.childNodes.push(r),t.h.insertBefore(r,o)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.h.removeChild(r)}}),Be(K(Ws,{context:t.context},e.__v),t.v)}function nn(e,t){var n=K(Hs,{__v:e,h:t});return n.containerInfo=t,n}(ft.prototype=new be).__a=function(e){var t=this,n=Ro(t.__v),r=t.l.get(e);return r[0]++,function(o){var a=function(){t.props.revealOrder?(r.push(o),zo(t,e,r)):o()};n?n(a):a()}},ft.prototype.render=function(e){this.i=null,this.l=new Map;var t=De(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},ft.prototype.componentDidUpdate=ft.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){zo(e,n,t)})};var Uo=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Vs=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,js=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Ys=/[A-Z0-9]/g,qs=typeof document<"u",Xs=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Bo(e,t,n){return t.__k==null&&(t.textContent=""),Be(e,t),typeof n=="function"&&n(),e?e.__c:null}function Wo(e,t,n){return Wn(e,t),typeof n=="function"&&n(),e?e.__c:null}be.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(be.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Ho=T.event;function Ks(){}function Gs(){return this.cancelBubble}function Zs(){return this.defaultPrevented}T.event=function(e){return Ho&&(e=Ho(e)),e.persist=Ks,e.isPropagationStopped=Gs,e.isDefaultPrevented=Zs,e.nativeEvent=e};var or,Js={enumerable:!1,configurable:!0,get:function(){return this.class}},Vo=T.vnode;T.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={},a=r.indexOf("-")===-1;for(var i in n){var s=n[i];if(!(i==="value"&&"defaultValue"in n&&s==null||qs&&i==="children"&&r==="noscript"||i==="class"||i==="className")){var l=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?i="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||Xs(n.type)?l==="onfocus"?i="onfocusin":l==="onblur"?i="onfocusout":js.test(i)&&(i=l):l=i="oninput":a&&Vs.test(i)?i=i.replace(Ys,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&o[i=l]&&(i="oninputCapture"),o[i]=s}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=De(n.children).forEach(function(c){c.props.selected=o.value.indexOf(c.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=De(n.children).forEach(function(c){c.props.selected=o.multiple?o.defaultValue.indexOf(c.props.value)!=-1:o.defaultValue==c.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",Js)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=Uo,Vo&&Vo(e)};var jo=T.__r;T.__r=function(e){jo&&jo(e),or=e.__c};var Yo=T.diffed;T.diffed=function(e){Yo&&Yo(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),or=null};var qo={ReactCurrentDispatcher:{current:{readContext:function(e){return or.__n[e.__c].props.value},useCallback:$,useContext:We,useDebugValue:qn,useDeferredValue:tr,useEffect:A,useId:Xn,useImperativeHandle:Yn,useInsertionEffect:rr,useLayoutEffect:Oe,useMemo:B,useReducer:Jt,useRef:E,useState:S,useSyncExternalStore:Jn,useTransition:nr}}},Qs="18.3.1";function Xo(e){return K.bind(null,e)}function Le(e){return!!e&&e.$$typeof===Uo}function Ko(e){return Le(e)&&e.type===ee}function Go(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function Lt(e){return Le(e)?Hn.apply(null,arguments):e}function Zo(e){return!!e.__k&&(Be(null,e),!0)}function Jo(e){return e&&(e.base||e.nodeType===1&&e)||null}var Qo=function(e,t){return e(t)},rn=function(e,t){return e(t)},ea=ee,ta=Le,Re={useState:S,useId:Xn,useReducer:Jt,useEffect:A,useLayoutEffect:Oe,useInsertionEffect:rr,useTransition:nr,useDeferredValue:tr,useSyncExternalStore:Jn,startTransition:er,useRef:E,useImperativeHandle:Yn,useMemo:B,useCallback:$,useContext:We,useDebugValue:qn,version:"18.3.1",Children:He,render:Bo,hydrate:Wo,unmountComponentAtNode:Zo,createPortal:nn,createElement:K,createContext:ie,createFactory:Xo,cloneElement:Lt,createRef:co,Fragment:ee,isValidElement:Le,isElement:ta,isFragment:Ko,isMemo:Go,findDOMNode:Jo,Component:be,PureComponent:en,memo:tn,forwardRef:I,flushSync:rn,unstable_batchedUpdates:Qo,StrictMode:ea,Suspense:Ot,SuspenseList:ft,lazy:Fo,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:qo};const na=Object.freeze(Object.defineProperty({__proto__:null,Children:He,Component:be,Fragment:ee,PureComponent:en,StrictMode:ea,Suspense:Ot,SuspenseList:ft,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:qo,cloneElement:Lt,createContext:ie,createElement:K,createFactory:Xo,createPortal:nn,createRef:co,default:Re,findDOMNode:Jo,flushSync:rn,forwardRef:I,hydrate:Wo,isElement:ta,isFragment:Ko,isMemo:Go,isValidElement:Le,lazy:Fo,memo:tn,render:Bo,startTransition:er,unmountComponentAtNode:Zo,unstable_batchedUpdates:Qo,useCallback:$,useContext:We,useDebugValue:qn,useDeferredValue:tr,useEffect:A,useErrorBoundary:Rs,useId:Xn,useImperativeHandle:Yn,useInsertionEffect:rr,useLayoutEffect:Oe,useMemo:B,useReducer:Jt,useRef:E,useState:S,useSyncExternalStore:Jn,useTransition:nr,version:Qs},Symbol.toStringTag,{value:"Module"}));var el=Symbol.for("preact-signals");function on(){if(Ve>1)Ve--;else{for(var e,t=!1;Rt!==void 0;){var n=Rt;for(Rt=void 0,ar++;n!==void 0;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&aa(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(ar=0,Ve--,t)throw e}}function ra(e){if(Ve>0)return e();Ve++;try{return e()}finally{on()}}var H=void 0,Rt=void 0,Ve=0,ar=0,an=0;function oa(e){if(H!==void 0){var t=e.n;if(t===void 0||t.t!==H)return t={i:0,S:e,p:H.s,n:void 0,t:H,e:void 0,x:void 0,r:t},H.s!==void 0&&(H.s.n=t),H.s=t,e.n=t,32&H.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=H.s,t.n=void 0,H.s.n=t,H.s=t),t}}function se(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}se.prototype.brand=el,se.prototype.h=function(){return!0},se.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)},se.prototype.U=function(e){if(this.t!==void 0){var t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},se.prototype.subscribe=function(e){var t=this;return ht(function(){var n=t.value,r=H;H=void 0;try{e(n)}finally{H=r}})},se.prototype.valueOf=function(){return this.value},se.prototype.toString=function(){return this.value+""},se.prototype.toJSON=function(){return this.value},se.prototype.peek=function(){var e=H;H=void 0;try{return this.value}finally{H=e}},Object.defineProperty(se.prototype,"value",{get:function(){var e=oa(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(ar>100)throw new Error("Cycle detected");this.v=e,this.i++,an++,Ve++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{on()}}}});function ve(e){return new se(e)}function aa(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 ia(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 sa(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function pt(e){se.call(this,void 0),this.x=e,this.s=void 0,this.g=an-1,this.f=4}(pt.prototype=new se).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===an))return!0;if(this.g=an,this.f|=1,this.i>0&&!aa(this))return this.f&=-2,!0;var e=H;try{ia(this),H=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 H=e,sa(this),this.f&=-2,!0},pt.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)}se.prototype.S.call(this,e)},pt.prototype.U=function(e){if(this.t!==void 0&&(se.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)}},pt.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(pt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=oa(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function me(e){return new pt(e)}function la(e){var t=e.u;if(e.u=void 0,typeof t=="function"){Ve++;var n=H;H=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,ir(e),r}finally{H=n,on()}}}function ir(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,la(e)}function tl(e){if(H!==this)throw new Error("Out-of-order effect");sa(this),H=e,this.f&=-2,8&this.f&&ir(this),on()}function Ft(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Ft.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.u=t)}finally{e()}},Ft.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,la(this),ia(this),Ve++;var e=H;return H=this,tl.bind(this,e)},Ft.prototype.N=function(){2&this.f||(this.f|=2,this.o=Rt,Rt=this)},Ft.prototype.d=function(){this.f|=8,1&this.f||ir(this)};function ht(e){var t=new Ft(e);try{t.c()}catch(n){throw t.d(),n}return t.d.bind(t)}var sr,sn,lr,ca=[],ua=[];ht(function(){sr=this.N})();function vt(e,t){T[e]=t.bind(null,T[e]||function(){})}function ln(e){lr&&lr(),lr=e&&e.S()}function da(e){var t=this,n=e.data,r=xe(n);r.value=n;var o=B(function(){for(var s=t,l=t.__v;l=l.__;)if(l.__c){l.__c.__$f|=4;break}var c=me(function(){var h=r.value.value;return h===0?0:h===!0?"":h||""}),f=me(function(){return!Array.isArray(c.value)&&!no(c.value)}),u=ht(function(){if(this.N=fa,f.value){var h=c.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=h)}}),v=t.__$u.d;return t.__$u.d=function(){u(),v.call(this)},[f,c]},[]),a=o[0],i=o[1];return a.value?i.peek():i.value}da.displayName="_st",Object.defineProperties(se.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:da},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),vt("__b",function(e,t){if(typeof t.type=="string"){var n,r=t.props;for(var o in r)if(o!=="children"){var a=r[o];a instanceof se&&(n||(t.__np=n={}),n[o]=a,r[o]=a.peek())}}e(t)}),vt("__r",function(e,t){ln();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(o){var a;return ht(function(){a=this}),a.c=function(){r.__$f|=1,r.setState({})},a}())),sn=r,ln(n),e(t)}),vt("__e",function(e,t,n,r){ln(),sn=void 0,e(t,n,r)}),vt("diffed",function(e,t){ln(),sn=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var a=n.U;if(a)for(var i in a){var s=a[i];s!==void 0&&!(i in r)&&(s.d(),a[i]=void 0)}else a={},n.U=a;for(var l in r){var c=a[l],f=r[l];c===void 0?(c=nl(n,l,f,o),a[l]=c):c.o(f,o)}}}e(t)});function nl(e,t,n,r){var o=t in e&&e.ownerSVGElement===void 0,a=ve(n);return{o:function(i,s){a.value=i,r=s},d:ht(function(){this.N=fa;var i=a.value.value;r[t]!==i&&(r[t]=i,o?e[t]=i:i?e.setAttribute(t,i):e.removeAttribute(t))})}}vt("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var r=n.U;if(r){n.U=void 0;for(var o in r){var a=r[o];a&&a.d()}}}}else{var i=t.__c;if(i){var s=i.__$u;s&&(i.__$u=void 0,s.d())}}e(t)}),vt("__h",function(e,t,n,r){(r<3||r===9)&&(t.__$f|=2),e(t,n,r)}),be.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u,r=n&&n.s!==void 0;for(var o in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var a=2&this.__$f;if(!(r||a||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var i in e)if(i!=="__source"&&e[i]!==this.props[i])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function xe(e){return B(function(){return ve(e)},[])}function Q(e){var t=E(e);return t.current=e,sn.__$f|=4,B(function(){return me(function(){return t.current()})},[])}var rl=typeof requestAnimationFrame>"u"?setTimeout:function(e){var t=function(){clearTimeout(n),cancelAnimationFrame(r),e()},n=setTimeout(t,100),r=requestAnimationFrame(t)},ol=function(e){queueMicrotask(function(){queueMicrotask(e)})};function al(){ra(function(){for(var e;e=ca.shift();)sr.call(e)})}function il(){ca.push(this)===1&&(T.requestAnimationFrame||rl)(al)}function sl(){ra(function(){for(var e;e=ua.shift();)sr.call(e)})}function fa(){ua.push(this)===1&&(T.requestAnimationFrame||ol)(sl)}function je(e){var t=E(e);t.current=e,A(function(){return ht(function(){return this.N=il,t.current()})},[])}function cn(){return cn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cn.apply(null,arguments)}const pa=new Uint8Array(0);class zt{static getFullOptions(t){return cn({clientTools:{},onConnect:()=>{},onDebug:()=>{},onDisconnect:()=>{},onError:()=>{},onMessage:()=>{},onAudio:()=>{},onModeChange:()=>{},onStatusChange:()=>{},onCanSendFeedbackChange:()=>{}},t)}constructor(t,n){var r=this;this.options=void 0,this.connection=void 0,this.lastInterruptTimestamp=0,this.mode="listening",this.status="connecting",this.volume=1,this.currentEventId=1,this.lastFeedbackEventId=1,this.canSendFeedback=!1,this.endSessionWithDetails=async function(o){r.status!=="connected"&&r.status!=="connecting"||(r.updateStatus("disconnecting"),await r.handleEndSession(),r.updateStatus("disconnected"),r.options.onDisconnect(o))},this.onMessage=async function(o){switch(o.type){case"interruption":return void r.handleInterruption(o);case"agent_response":return void r.handleAgentResponse(o);case"user_transcript":return void r.handleUserTranscript(o);case"internal_tentative_agent_response":return void r.handleTentativeAgentResponse(o);case"client_tool_call":return void await r.handleClientToolCall(o);case"audio":return void r.handleAudio(o);case"ping":return void r.connection.sendMessage({type:"pong",event_id:o.ping_event.event_id});default:return void r.options.onDebug(o)}},this.setVolume=({volume:o})=>{this.volume=o},this.options=t,this.connection=n,this.options.onConnect({conversationId:n.conversationId}),this.connection.onDisconnect(this.endSessionWithDetails),this.connection.onMessage(this.onMessage),this.updateStatus("connected")}endSession(){return this.endSessionWithDetails({reason:"user"})}async handleEndSession(){this.connection.close()}updateMode(t){t!==this.mode&&(this.mode=t,this.options.onModeChange({mode:t}))}updateStatus(t){t!==this.status&&(this.status=t,this.options.onStatusChange({status:t}))}updateCanSendFeedback(){const t=this.currentEventId!==this.lastFeedbackEventId;this.canSendFeedback!==t&&(this.canSendFeedback=t,this.options.onCanSendFeedbackChange({canSendFeedback:t}))}handleInterruption(t){t.interruption_event&&(this.lastInterruptTimestamp=t.interruption_event.event_id)}handleAgentResponse(t){this.options.onMessage({source:"ai",message:t.agent_response_event.agent_response})}handleUserTranscript(t){this.options.onMessage({source:"user",message:t.user_transcription_event.user_transcript})}handleTentativeAgentResponse(t){this.options.onDebug({type:"tentative_agent_response",response:t.tentative_agent_response_internal_event.tentative_agent_response})}async handleClientToolCall(t){if(this.options.clientTools.hasOwnProperty(t.client_tool_call.tool_name))try{var n;const r=(n=await this.options.clientTools[t.client_tool_call.tool_name](t.client_tool_call.parameters))!=null?n:"Client tool execution successful.",o=typeof r=="object"?JSON.stringify(r):String(r);this.connection.sendMessage({type:"client_tool_result",tool_call_id:t.client_tool_call.tool_call_id,result:o,is_error:!1})}catch(r){this.onError("Client tool execution failed with following error: "+(r==null?void 0:r.message),{clientToolName:t.client_tool_call.tool_name}),this.connection.sendMessage({type:"client_tool_result",tool_call_id:t.client_tool_call.tool_call_id,result:"Client tool execution failed: "+(r==null?void 0:r.message),is_error:!0})}else{if(this.options.onUnhandledClientToolCall)return void this.options.onUnhandledClientToolCall(t.client_tool_call);this.onError(`Client tool with name ${t.client_tool_call.tool_name} is not defined on client`,{clientToolName:t.client_tool_call.tool_name}),this.connection.sendMessage({type:"client_tool_result",tool_call_id:t.client_tool_call.tool_call_id,result:`Client tool with name ${t.client_tool_call.tool_name} is not defined on client`,is_error:!0})}}handleAudio(t){}onError(t,n){console.error(t,n),this.options.onError(t,n)}getId(){return this.connection.conversationId}isOpen(){return this.status==="connected"}setMicMuted(t){}getInputByteFrequencyData(){return pa}getOutputByteFrequencyData(){return pa}getInputVolume(){return 0}getOutputVolume(){return 0}sendFeedback(t){this.canSendFeedback?(this.connection.sendMessage({type:"feedback",score:t?"like":"dislike",event_id:this.currentEventId}),this.lastFeedbackEventId=this.currentEventId,this.updateCanSendFeedback()):console.warn(this.lastFeedbackEventId===0?"Cannot send feedback: the conversation has not started yet.":"Cannot send feedback: feedback has already been sent for the current response.")}sendContextualUpdate(t){this.connection.sendMessage({type:"contextual_update",text:t})}sendUserMessage(t){this.connection.sendMessage({type:"user_message",text:t})}sendUserActivity(){this.connection.sendMessage({type:"user_activity"})}}function ha(e){return!!e.type}class un{static async create(t){let n=null;try{var r;const a=(r=t.origin)!=null?r:"wss://api.elevenlabs.io",i=t.signedUrl?t.signedUrl:a+"/v1/convai/conversation?agent_id="+t.agentId,s=["convai"];t.authorization&&s.push(`bearer.${t.authorization}`),n=new WebSocket(i,s);const l=await new Promise((g,p)=>{n.addEventListener("open",()=>{var m;const _={type:"conversation_initiation_client_data"};var w,y,b,C,k;t.overrides&&(_.conversation_config_override={agent:{prompt:(w=t.overrides.agent)==null?void 0:w.prompt,first_message:(y=t.overrides.agent)==null?void 0:y.firstMessage,language:(b=t.overrides.agent)==null?void 0:b.language},tts:{voice_id:(C=t.overrides.tts)==null?void 0:C.voiceId},conversation:{text_only:(k=t.overrides.conversation)==null?void 0:k.textOnly}}),t.customLlmExtraBody&&(_.custom_llm_extra_body=t.customLlmExtraBody),t.dynamicVariables&&(_.dynamic_variables=t.dynamicVariables),(m=n)==null||m.send(JSON.stringify(_))},{once:!0}),n.addEventListener("error",m=>{setTimeout(()=>p(m),0)}),n.addEventListener("close",p),n.addEventListener("message",m=>{const _=JSON.parse(m.data);ha(_)&&(_.type==="conversation_initiation_metadata"?g(_.conversation_initiation_metadata_event):console.warn("First received message is not conversation metadata."))},{once:!0})}),{conversation_id:c,agent_output_audio_format:f,user_input_audio_format:u}=l,v=va(u??"pcm_16000"),h=va(f);return new un(n,c,v,h)}catch(a){var o;throw(o=n)==null||o.close(),a}}constructor(t,n,r,o){this.socket=void 0,this.conversationId=void 0,this.inputFormat=void 0,this.outputFormat=void 0,this.queue=[],this.disconnectionDetails=null,this.onDisconnectCallback=null,this.onMessageCallback=null,this.socket=t,this.conversationId=n,this.inputFormat=r,this.outputFormat=o,this.socket.addEventListener("error",a=>{setTimeout(()=>this.disconnect({reason:"error",message:"The connection was closed due to a socket error.",context:a}),0)}),this.socket.addEventListener("close",a=>{this.disconnect(a.code===1e3?{reason:"agent",context:a}:{reason:"error",message:a.reason||"The connection was closed by the server.",context:a})}),this.socket.addEventListener("message",a=>{try{const i=JSON.parse(a.data);if(!ha(i))return;this.onMessageCallback?this.onMessageCallback(i):this.queue.push(i)}catch{}})}close(){this.socket.close()}sendMessage(t){this.socket.send(JSON.stringify(t))}onMessage(t){this.onMessageCallback=t,this.queue.forEach(t),this.queue=[]}onDisconnect(t){this.onDisconnectCallback=t,this.disconnectionDetails&&t(this.disconnectionDetails)}disconnect(t){var n;this.disconnectionDetails||(this.disconnectionDetails=t,(n=this.onDisconnectCallback)==null||n.call(this,t))}}function va(e){const[t,n]=e.split("_");if(!["pcm","ulaw"].includes(t))throw new Error(`Invalid format: ${e}`);const r=parseInt(n);if(isNaN(r))throw new Error(`Invalid sample rate: ${n}`);return{format:t,sampleRate:r}}function ma(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}async function ga(e={default:0,android:3e3}){let t=e.default;var n;if(/android/i.test(navigator.userAgent))t=(n=e.android)!=null?n:t;else if(ma()){var r;t=(r=e.ios)!=null?r:t}t>0&&await new Promise(o=>setTimeout(o,t))}class cr extends zt{static async startSession(t){const n=zt.getFullOptions(t);n.onStatusChange({status:"connecting"}),n.onCanSendFeedbackChange({canSendFeedback:!1});let r=null;try{return await ga(n.connectionDelay),r=await un.create(t),new cr(n,r)}catch(a){var o;throw n.onStatusChange({status:"disconnected"}),(o=r)==null||o.close(),a}}}function ll(e){const t=new Uint8Array(e);return window.btoa(String.fromCharCode(...t))}function cl(e){const t=window.atob(e),n=t.length,r=new Uint8Array(n);for(let o=0;o<n;o++)r[o]=t.charCodeAt(o);return r.buffer}const ur=new Map;function _a(e,t){return async n=>{const r=ur.get(e);if(r)return n.addModule(r);const o=new Blob([t],{type:"application/javascript"}),a=URL.createObjectURL(o);try{return await n.addModule(a),void ur.set(e,a)}catch{URL.revokeObjectURL(a)}try{const i=`data:application/javascript;base64,${btoa(t)}`;await n.addModule(i),ur.set(e,i)}catch{throw new Error(`Failed to load the ${e} worklet module. Make sure the browser supports AudioWorklets.`)}}}const ul=_a("raw-audio-processor",`
|
|
1
|
+
(function(){"use strict";var $t,T,to,no,tt,ro,oo,ao,io,On,Ln,Rn,so,It={},lo=[],Ss=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Dt=Array.isArray;function Ne(e,t){for(var n in t)e[n]=t[n];return e}function Fn(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function K(e,t,n){var r,o,a,i={};for(a in t)a=="key"?r=t[a]:a=="ref"?o=t[a]:i[a]=t[a];if(arguments.length>2&&(i.children=arguments.length>3?$t.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)i[a]==null&&(i[a]=e.defaultProps[a]);return Mt(e,i,r,o,null)}function Mt(e,t,n,r,o){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++to,__i:-1,__u:0};return o==null&&T.vnode!=null&&T.vnode(a),a}function co(){return{current:null}}function ee(e){return e.children}function be(e,t){this.props=e,this.context=t}function ut(e,t){if(t==null)return e.__?ut(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"?ut(e):null}function uo(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return uo(e)}}function zn(e){(!e.__d&&(e.__d=!0)&&tt.push(e)&&!Gt.__r++||ro!=T.debounceRendering)&&((ro=T.debounceRendering)||oo)(Gt)}function Gt(){for(var e,t,n,r,o,a,i,s=1;tt.length;)tt.length>s&&tt.sort(ao),e=tt.shift(),s=tt.length,e.__d&&(n=void 0,o=(r=(t=e).__v).__e,a=[],i=[],t.__P&&((n=Ne({},r)).__v=r.__v+1,T.vnode&&T.vnode(n),Un(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,a,o??ut(r),!!(32&r.__u),i),n.__v=r.__v,n.__.__k[n.__i]=n,mo(a,n,i),n.__e!=o&&uo(n)));Gt.__r=0}function fo(e,t,n,r,o,a,i,s,l,c,f){var u,v,h,g,p,m,_=r&&r.__k||lo,w=t.length;for(l=Es(n,t,_,l,w),u=0;u<w;u++)(h=n.__k[u])!=null&&(v=h.__i==-1?It:_[h.__i]||It,h.__i=u,m=Un(e,h,v,o,a,i,s,l,c,f),g=h.__e,h.ref&&v.ref!=h.ref&&(v.ref&&Bn(v.ref,null,h),f.push(h.ref,h.__c||g,h)),p==null&&g!=null&&(p=g),4&h.__u||v.__k===h.__k?l=po(h,l,e):typeof h.type=="function"&&m!==void 0?l=m:g&&(l=g.nextSibling),h.__u&=-7);return n.__e=p,l}function Es(e,t,n,r,o){var a,i,s,l,c,f=n.length,u=f,v=0;for(e.__k=new Array(o),a=0;a<o;a++)(i=t[a])!=null&&typeof i!="boolean"&&typeof i!="function"?(l=a+v,(i=e.__k[a]=typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?Mt(null,i,null,null,null):Dt(i)?Mt(ee,{children:i},null,null,null):i.constructor==null&&i.__b>0?Mt(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=e,i.__b=e.__b+1,s=null,(c=i.__i=Ts(i,n,l,u))!=-1&&(u--,(s=n[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(o>f?v--:o<f&&v++),typeof i.type!="function"&&(i.__u|=4)):c!=l&&(c==l-1?v--:c==l+1?v++:(c>l?v--:v++,i.__u|=4))):e.__k[a]=null;if(u)for(a=0;a<f;a++)(s=n[a])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=ut(s)),_o(s,s));return r}function po(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=po(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=ut(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function De(e,t){return t=t||[],e==null||typeof e=="boolean"||(Dt(e)?e.some(function(n){De(n,t)}):t.push(e)),t}function Ts(e,t,n,r){var o,a,i=e.key,s=e.type,l=t[n];if(l===null&&e.key==null||l&&i==l.key&&s==l.type&&(2&l.__u)==0)return n;if(r>(l!=null&&(2&l.__u)==0?1:0))for(o=n-1,a=n+1;o>=0||a<t.length;){if(o>=0){if((l=t[o])&&(2&l.__u)==0&&i==l.key&&s==l.type)return o;o--}if(a<t.length){if((l=t[a])&&(2&l.__u)==0&&i==l.key&&s==l.type)return a;a++}}return-1}function ho(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Ss.test(t)?n:n+"px"}function Zt(e,t,n,r,o){var a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||ho(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||ho(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")a=t!=(t=t.replace(io,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?r?n.u=r.u:(n.u=On,e.addEventListener(t,a?Rn:Ln,a)):e.removeEventListener(t,a?Rn:Ln,a);else{if(o=="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 vo(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=On++;else if(t.t<n.u)return;return n(T.event?T.event(t):t)}}}function Un(e,t,n,r,o,a,i,s,l,c){var f,u,v,h,g,p,m,_,w,y,b,C,k,x,P,D,F,O=t.type;if(t.constructor!=null)return null;128&n.__u&&(l=!!(32&n.__u),a=[s=t.__e=n.__e]),(f=T.__b)&&f(t);e:if(typeof O=="function")try{if(_=t.props,w="prototype"in O&&O.prototype.render,y=(f=O.contextType)&&r[f.__c],b=f?y?y.props.value:f.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:(w?t.__c=u=new O(_,b):(t.__c=u=new be(_,b),u.constructor=O,u.render=Ps),y&&y.sub(u),u.props=_,u.state||(u.state={}),u.context=b,u.__n=r,v=u.__d=!0,u.__h=[],u._sb=[]),w&&u.__s==null&&(u.__s=u.state),w&&O.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=Ne({},u.__s)),Ne(u.__s,O.getDerivedStateFromProps(_,u.__s))),h=u.props,g=u.state,u.__v=t,v)w&&O.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),w&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(w&&O.getDerivedStateFromProps==null&&_!==h&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(_,b),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(_,u.__s,b)===!1||t.__v==n.__v){for(t.__v!=n.__v&&(u.props=_,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(L){L&&(L.__=t)}),C=0;C<u._sb.length;C++)u.__h.push(u._sb[C]);u._sb=[],u.__h.length&&i.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(_,u.__s,b),w&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,g,p)})}if(u.context=b,u.props=_,u.__P=e,u.__e=!1,k=T.__r,x=0,w){for(u.state=u.__s,u.__d=!1,k&&k(t),f=u.render(u.props,u.state,u.context),P=0;P<u._sb.length;P++)u.__h.push(u._sb[P]);u._sb=[]}else do u.__d=!1,k&&k(t),f=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++x<25);u.state=u.__s,u.getChildContext!=null&&(r=Ne(Ne({},r),u.getChildContext())),w&&!v&&u.getSnapshotBeforeUpdate!=null&&(p=u.getSnapshotBeforeUpdate(h,g)),D=f,f!=null&&f.type===ee&&f.key==null&&(D=go(f.props.children)),s=fo(e,Dt(D)?D:[D],t,n,r,o,a,i,s,l,c),u.base=t.__e,t.__u&=-161,u.__h.length&&i.push(u),m&&(u.__E=u.__=null)}catch(L){if(t.__v=null,l||a!=null)if(L.then){for(t.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__e=s}else for(F=a.length;F--;)Fn(a[F]);else t.__e=n.__e,t.__k=n.__k;T.__e(L,t,n)}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=Ns(n.__e,t,n,r,o,a,i,l,c);return(f=T.diffed)&&f(t),128&t.__u?void 0:s}function mo(e,t,n){for(var r=0;r<n.length;r++)Bn(n[r],n[++r],n[++r]);T.__c&&T.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(a){a.call(o)})}catch(a){T.__e(a,o.__v)}})}function go(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:Dt(e)?e.map(go):Ne({},e)}function Ns(e,t,n,r,o,a,i,s,l){var c,f,u,v,h,g,p,m=n.props,_=t.props,w=t.type;if(w=="svg"?o="http://www.w3.org/2000/svg":w=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),a!=null){for(c=0;c<a.length;c++)if((h=a[c])&&"setAttribute"in h==!!w&&(w?h.localName==w:h.nodeType==3)){e=h,a[c]=null;break}}if(e==null){if(w==null)return document.createTextNode(_);e=document.createElementNS(o,w,_.is&&_),s&&(T.__m&&T.__m(t,a),s=!1),a=null}if(w==null)m===_||s&&e.data==_||(e.data=_);else{if(a=a&&$t.call(e.childNodes),m=n.props||It,!s&&a!=null)for(m={},c=0;c<e.attributes.length;c++)m[(h=e.attributes[c]).name]=h.value;for(c in m)if(h=m[c],c!="children"){if(c=="dangerouslySetInnerHTML")u=h;else if(!(c in _)){if(c=="value"&&"defaultValue"in _||c=="checked"&&"defaultChecked"in _)continue;Zt(e,c,null,h,o)}}for(c in _)h=_[c],c=="children"?v=h:c=="dangerouslySetInnerHTML"?f=h:c=="value"?g=h:c=="checked"?p=h:s&&typeof h!="function"||m[c]===h||Zt(e,c,h,m[c],o);if(f)s||u&&(f.__html==u.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(u&&(e.innerHTML=""),fo(t.type=="template"?e.content:e,Dt(v)?v:[v],t,n,r,w=="foreignObject"?"http://www.w3.org/1999/xhtml":o,a,i,a?a[0]:n.__k&&ut(n,0),s,l),a!=null)for(c=a.length;c--;)Fn(a[c]);s||(c="value",w=="progress"&&g==null?e.removeAttribute("value"):g!=null&&(g!==e[c]||w=="progress"&&!g||w=="option"&&g!=m[c])&&Zt(e,c,g,m[c],o),c="checked",p!=null&&p!=e[c]&&Zt(e,c,p,m[c],o))}return e}function Bn(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(o){T.__e(o,n)}}function _o(e,t,n){var r,o;if(T.unmount&&T.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Bn(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(a){T.__e(a,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&_o(r[o],t,n||typeof e.type!="function");n||Fn(e.__e),e.__c=e.__=e.__e=void 0}function Ps(e,t,n){return this.constructor(e,n)}function Be(e,t,n){var r,o,a,i;t==document&&(t=document.documentElement),T.__&&T.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,a=[],i=[],Un(t,e=(!r&&n||t).__k=K(ee,null,[e]),o||It,It,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?$t.call(t.childNodes):null,a,!r&&n?n:o?o.__e:t.firstChild,r,i),mo(a,e,i)}function Wn(e,t){Be(e,t,Wn)}function Hn(e,t,n){var r,o,a,i,s=Ne({},e.props);for(a in e.type&&e.type.defaultProps&&(i=e.type.defaultProps),t)a=="key"?r=t[a]:a=="ref"?o=t[a]:s[a]=t[a]==null&&i!=null?i[a]:t[a];return arguments.length>2&&(s.children=arguments.length>3?$t.call(arguments,2):n),Mt(e.type,s,r||e.key,o||e.ref,null)}function ie(e){function t(n){var r,o;return this.getChildContext||(r=new Set,(o={})[t.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(a){this.props.value!=a.value&&r.forEach(function(i){i.__e=!0,zn(i)})},this.sub=function(a){r.add(a);var i=a.componentWillUnmount;a.componentWillUnmount=function(){r&&r.delete(a),i&&i.call(a)}}),n.children}return t.__c="__cC"+so++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,r){return n.children(r)}).contextType=t,t}$t=lo.slice,T={__e:function(e,t,n,r){for(var o,a,i;t=t.__;)if((o=t.__c)&&!o.__)try{if((a=o.constructor)&&a.getDerivedStateFromError!=null&&(o.setState(a.getDerivedStateFromError(e)),i=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),i=o.__d),i)return o.__E=o}catch(s){e=s}throw e}},to=0,no=function(e){return e!=null&&e.constructor==null},be.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ne({},this.state),typeof e=="function"&&(e=e(Ne({},n),this.props)),e&&Ne(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),zn(this))},be.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),zn(this))},be.prototype.render=ee,tt=[],oo=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ao=function(e,t){return e.__v.__b-t.__v.__b},Gt.__r=0,io=/(PointerCapture)$|Capture$/i,On=0,Ln=vo(!1),Rn=vo(!0),so=0;function Vn(){return(Vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var As=["context","children"];function $s(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(r,o){if(r==null)return{};var a,i,s={},l=Object.keys(r);for(i=0;i<l.length;i++)o.indexOf(a=l[i])>=0||(s[a]=r[a]);return s}(e,As);return Hn(t,n)}function Is(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=K($s,Vn({},this._props,{context:e.detail.context}),function t(n,r){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var o=[],a={},i=0,s=n.attributes,l=n.childNodes;for(i=s.length;i--;)s[i].name!=="slot"&&(a[s[i].name]=s[i].value,a[wo(s[i].name)]=s[i].value);for(i=l.length;i--;){var c=t(l[i],null),f=l[i].slot;f?a[f]=K(yo,{name:f},c):o[i]=c}var u=r?K(yo,null,o):o;return K(r||n.nodeName.toLowerCase(),a,u)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Wn:Be)(this._vdom,this._root)}function wo(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function Ds(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[wo(e)]=n,this._vdom=Hn(this._vdom,r),Be(this._vdom,this._root)}}function Ms(){Be(this._vdom=null,this._root)}function yo(e,t){var n=this;return K("slot",Vn({},e,{ref:function(r){r?(n.ref=r,n._listener||(n._listener=function(o){o.stopPropagation(),o.detail.context=t},r.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function Os(e,t,n,r){function o(){var a=Reflect.construct(HTMLElement,[],o);return a._vdomComponent=e,a._root=r&&r.shadow?a.attachShadow({mode:r.mode||"open"}):a,a}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=Is,o.prototype.attributeChangedCallback=Ds,o.prototype.disconnectedCallback=Ms,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach(function(a){Object.defineProperty(o.prototype,a,{get:function(){return this._vdom.props[a]},set:function(i){this._vdom?this.attributeChangedCallback(a,null,i):(this._props||(this._props={}),this._props[a]=i,this.connectedCallback());var s=typeof i;i!=null&&s!=="string"&&s!=="boolean"&&s!=="number"||this.setAttribute(a,i)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o)}var Ls=0;function d(e,t,n,r,o,a){t||(t={});var i,s,l=t;if("ref"in l)for(s in l={},t)s=="ref"?i=t[s]:l[s]=t[s];var c={type:e,props:l,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ls,__i:-1,__u:0,__source:o,__self:a};if(typeof e=="function"&&(i=e.defaultProps))for(s in i)l[s]===void 0&&(l[s]=i[s]);return T.vnode&&T.vnode(c),c}var Me,W,jn,bo,dt=0,xo=[],Z=T,Co=Z.__b,ko=Z.__r,So=Z.diffed,Eo=Z.__c,To=Z.unmount,No=Z.__;function nt(e,t){Z.__h&&Z.__h(W,e,dt||t),dt=0;var n=W.__H||(W.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function S(e){return dt=1,Jt(Ao,e)}function Jt(e,t,n){var r=nt(Me++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ao(void 0,t),function(s){var l=r.__N?r.__N[0]:r.__[0],c=r.t(l,s);l!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=W,!W.__f)){var o=function(s,l,c){if(!r.__c.__H)return!0;var f=r.__c.__H.__.filter(function(v){return!!v.__c});if(f.every(function(v){return!v.__N}))return!a||a.call(this,s,l,c);var u=r.__c.props!==s;return f.forEach(function(v){if(v.__N){var h=v.__[0];v.__=v.__N,v.__N=void 0,h!==v.__[0]&&(u=!0)}}),a&&a.call(this,s,l,c)||u};W.__f=!0;var a=W.shouldComponentUpdate,i=W.componentWillUpdate;W.componentWillUpdate=function(s,l,c){if(this.__e){var f=a;a=void 0,o(s,l,c),a=f}i&&i.call(this,s,l,c)},W.shouldComponentUpdate=o}return r.__N||r.__}function A(e,t){var n=nt(Me++,3);!Z.__s&&Gn(n.__H,t)&&(n.__=e,n.u=t,W.__H.__h.push(n))}function Oe(e,t){var n=nt(Me++,4);!Z.__s&&Gn(n.__H,t)&&(n.__=e,n.u=t,W.__h.push(n))}function E(e){return dt=5,B(function(){return{current:e}},[])}function Yn(e,t,n){dt=6,Oe(function(){if(typeof e=="function"){var r=e(t());return function(){e(null),r&&typeof r=="function"&&r()}}if(e)return e.current=t(),function(){return e.current=null}},n==null?n:n.concat(e))}function B(e,t){var n=nt(Me++,7);return Gn(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function $(e,t){return dt=8,B(function(){return e},t)}function We(e){var t=W.context[e.__c],n=nt(Me++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(W)),t.props.value):e.__}function qn(e,t){Z.useDebugValue&&Z.useDebugValue(t?t(e):e)}function Rs(e){var t=nt(Me++,10),n=S();return t.__=e,W.componentDidCatch||(W.componentDidCatch=function(r,o){t.__&&t.__(r,o),n[1](r)}),[n[0],function(){n[1](void 0)}]}function Xn(){var e=nt(Me++,11);if(!e.__){for(var t=W.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Fs(){for(var e;e=xo.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Qt),e.__H.__h.forEach(Kn),e.__H.__h=[]}catch(t){e.__H.__h=[],Z.__e(t,e.__v)}}Z.__b=function(e){W=null,Co&&Co(e)},Z.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),No&&No(e,t)},Z.__r=function(e){ko&&ko(e),Me=0;var t=(W=e.__c).__H;t&&(jn===W?(t.__h=[],W.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(Qt),t.__h.forEach(Kn),t.__h=[],Me=0)),jn=W},Z.diffed=function(e){So&&So(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(xo.push(t)!==1&&bo===Z.requestAnimationFrame||((bo=Z.requestAnimationFrame)||zs)(Fs)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),jn=W=null},Z.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Qt),n.__h=n.__h.filter(function(r){return!r.__||Kn(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],Z.__e(r,n.__v)}}),Eo&&Eo(e,t)},Z.unmount=function(e){To&&To(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Qt(r)}catch(o){t=o}}),n.__H=void 0,t&&Z.__e(t,n.__v))};var Po=typeof requestAnimationFrame=="function";function zs(e){var t,n=function(){clearTimeout(r),Po&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Po&&(t=requestAnimationFrame(n))}function Qt(e){var t=W,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),W=t}function Kn(e){var t=W;e.__c=e.__(),W=t}function Gn(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Ao(e,t){return typeof t=="function"?t(e):t}function $o(e,t){for(var n in t)e[n]=t[n];return e}function Zn(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function Jn(e,t){var n=t(),r=S({t:{__:n,u:t}}),o=r[0].t,a=r[1];return Oe(function(){o.__=n,o.u=t,Qn(o)&&a({t:o})},[e,n,t]),A(function(){return Qn(o)&&a({t:o}),e(function(){Qn(o)&&a({t:o})})},[e]),n}function Qn(e){var t,n,r=e.u,o=e.__;try{var a=r();return!((t=o)===(n=a)&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return!0}}function er(e){e()}function tr(e){return e}function nr(){return[!1,er]}var rr=Oe;function en(e,t){this.props=e,this.context=t}function tn(e,t){function n(o){var a=this.props.ref,i=a==o.ref;return!i&&a&&(a.call?a(null):a.current=null),t?!t(this.props,o)||!i:Zn(this.props,o)}function r(o){return this.shouldComponentUpdate=n,K(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(en.prototype=new be).isPureReactComponent=!0,en.prototype.shouldComponentUpdate=function(e,t){return Zn(this.props,e)||Zn(this.state,t)};var Io=T.__b;T.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Io&&Io(e)};var Us=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function I(e){function t(n){var r=$o({},n);return delete r.ref,e(r,n.ref||null)}return t.$$typeof=Us,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Do=function(e,t){return e==null?null:De(De(e).map(t))},He={map:Do,forEach:Do,count:function(e){return e?De(e).length:0},only:function(e){var t=De(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:De},Bs=T.__e;T.__e=function(e,t,n,r){if(e.then){for(var o,a=t;a=a.__;)if((o=a.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}Bs(e,t,n,r)};var Mo=T.unmount;function Oo(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=$o({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Oo(r,t,n)})),e}function Lo(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Lo(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Ot(){this.__u=0,this.o=null,this.__b=null}function Ro(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Fo(e){var t,n,r;function o(a){if(t||(t=e()).then(function(i){n=i.default||i},function(i){r=i}),r)throw r;if(!n)throw t;return K(n,a)}return o.displayName="Lazy",o.__f=!0,o}function ft(){this.i=null,this.l=null}T.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Mo&&Mo(e)},(Ot.prototype=new be).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=Ro(r.__v),a=!1,i=function(){a||(a=!0,n.__R=null,o?o(s):s())};n.__R=i;var s=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=Lo(l,l.__c.__P,l.__c.__O)}var c;for(r.setState({__a:r.__b=null});c=r.o.pop();)c.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(i,i)},Ot.prototype.componentWillUnmount=function(){this.o=[]},Ot.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Oo(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&K(ee,null,e.fallback);return o&&(o.__u&=-33),[K(ee,null,t.__a?null:e.children),o]};var zo=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function Ws(e){return this.getChildContext=function(){return e.context},e.children}function Hs(e){var t=this,n=e.h;t.componentWillUnmount=function(){Be(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),t.v||(t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],contains:function(){return!0},appendChild:function(r){this.childNodes.push(r),t.h.appendChild(r)},insertBefore:function(r,o){this.childNodes.push(r),t.h.insertBefore(r,o)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),t.h.removeChild(r)}}),Be(K(Ws,{context:t.context},e.__v),t.v)}function nn(e,t){var n=K(Hs,{__v:e,h:t});return n.containerInfo=t,n}(ft.prototype=new be).__a=function(e){var t=this,n=Ro(t.__v),r=t.l.get(e);return r[0]++,function(o){var a=function(){t.props.revealOrder?(r.push(o),zo(t,e,r)):o()};n?n(a):a()}},ft.prototype.render=function(e){this.i=null,this.l=new Map;var t=De(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},ft.prototype.componentDidUpdate=ft.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){zo(e,n,t)})};var Uo=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Vs=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,js=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Ys=/[A-Z0-9]/g,qs=typeof document<"u",Xs=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Bo(e,t,n){return t.__k==null&&(t.textContent=""),Be(e,t),typeof n=="function"&&n(),e?e.__c:null}function Wo(e,t,n){return Wn(e,t),typeof n=="function"&&n(),e?e.__c:null}be.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(be.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Ho=T.event;function Ks(){}function Gs(){return this.cancelBubble}function Zs(){return this.defaultPrevented}T.event=function(e){return Ho&&(e=Ho(e)),e.persist=Ks,e.isPropagationStopped=Gs,e.isDefaultPrevented=Zs,e.nativeEvent=e};var or,Js={enumerable:!1,configurable:!0,get:function(){return this.class}},Vo=T.vnode;T.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={},a=r.indexOf("-")===-1;for(var i in n){var s=n[i];if(!(i==="value"&&"defaultValue"in n&&s==null||qs&&i==="children"&&r==="noscript"||i==="class"||i==="className")){var l=i.toLowerCase();i==="defaultValue"&&"value"in n&&n.value==null?i="value":i==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?i="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||Xs(n.type)?l==="onfocus"?i="onfocusin":l==="onblur"?i="onfocusout":js.test(i)&&(i=l):l=i="oninput":a&&Vs.test(i)?i=i.replace(Ys,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&o[i=l]&&(i="oninputCapture"),o[i]=s}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=De(n.children).forEach(function(c){c.props.selected=o.value.indexOf(c.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=De(n.children).forEach(function(c){c.props.selected=o.multiple?o.defaultValue.indexOf(c.props.value)!=-1:o.defaultValue==c.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",Js)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=Uo,Vo&&Vo(e)};var jo=T.__r;T.__r=function(e){jo&&jo(e),or=e.__c};var Yo=T.diffed;T.diffed=function(e){Yo&&Yo(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),or=null};var qo={ReactCurrentDispatcher:{current:{readContext:function(e){return or.__n[e.__c].props.value},useCallback:$,useContext:We,useDebugValue:qn,useDeferredValue:tr,useEffect:A,useId:Xn,useImperativeHandle:Yn,useInsertionEffect:rr,useLayoutEffect:Oe,useMemo:B,useReducer:Jt,useRef:E,useState:S,useSyncExternalStore:Jn,useTransition:nr}}},Qs="18.3.1";function Xo(e){return K.bind(null,e)}function Le(e){return!!e&&e.$$typeof===Uo}function Ko(e){return Le(e)&&e.type===ee}function Go(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function Lt(e){return Le(e)?Hn.apply(null,arguments):e}function Zo(e){return!!e.__k&&(Be(null,e),!0)}function Jo(e){return e&&(e.base||e.nodeType===1&&e)||null}var Qo=function(e,t){return e(t)},rn=function(e,t){return e(t)},ea=ee,ta=Le,Re={useState:S,useId:Xn,useReducer:Jt,useEffect:A,useLayoutEffect:Oe,useInsertionEffect:rr,useTransition:nr,useDeferredValue:tr,useSyncExternalStore:Jn,startTransition:er,useRef:E,useImperativeHandle:Yn,useMemo:B,useCallback:$,useContext:We,useDebugValue:qn,version:"18.3.1",Children:He,render:Bo,hydrate:Wo,unmountComponentAtNode:Zo,createPortal:nn,createElement:K,createContext:ie,createFactory:Xo,cloneElement:Lt,createRef:co,Fragment:ee,isValidElement:Le,isElement:ta,isFragment:Ko,isMemo:Go,findDOMNode:Jo,Component:be,PureComponent:en,memo:tn,forwardRef:I,flushSync:rn,unstable_batchedUpdates:Qo,StrictMode:ea,Suspense:Ot,SuspenseList:ft,lazy:Fo,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:qo};const na=Object.freeze(Object.defineProperty({__proto__:null,Children:He,Component:be,Fragment:ee,PureComponent:en,StrictMode:ea,Suspense:Ot,SuspenseList:ft,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:qo,cloneElement:Lt,createContext:ie,createElement:K,createFactory:Xo,createPortal:nn,createRef:co,default:Re,findDOMNode:Jo,flushSync:rn,forwardRef:I,hydrate:Wo,isElement:ta,isFragment:Ko,isMemo:Go,isValidElement:Le,lazy:Fo,memo:tn,render:Bo,startTransition:er,unmountComponentAtNode:Zo,unstable_batchedUpdates:Qo,useCallback:$,useContext:We,useDebugValue:qn,useDeferredValue:tr,useEffect:A,useErrorBoundary:Rs,useId:Xn,useImperativeHandle:Yn,useInsertionEffect:rr,useLayoutEffect:Oe,useMemo:B,useReducer:Jt,useRef:E,useState:S,useSyncExternalStore:Jn,useTransition:nr,version:Qs},Symbol.toStringTag,{value:"Module"}));var el=Symbol.for("preact-signals");function on(){if(Ve>1)Ve--;else{for(var e,t=!1;Rt!==void 0;){var n=Rt;for(Rt=void 0,ar++;n!==void 0;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&aa(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(ar=0,Ve--,t)throw e}}function ra(e){if(Ve>0)return e();Ve++;try{return e()}finally{on()}}var H=void 0,Rt=void 0,Ve=0,ar=0,an=0;function oa(e){if(H!==void 0){var t=e.n;if(t===void 0||t.t!==H)return t={i:0,S:e,p:H.s,n:void 0,t:H,e:void 0,x:void 0,r:t},H.s!==void 0&&(H.s.n=t),H.s=t,e.n=t,32&H.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=H.s,t.n=void 0,H.s.n=t,H.s=t),t}}function se(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}se.prototype.brand=el,se.prototype.h=function(){return!0},se.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)},se.prototype.U=function(e){if(this.t!==void 0){var t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},se.prototype.subscribe=function(e){var t=this;return ht(function(){var n=t.value,r=H;H=void 0;try{e(n)}finally{H=r}})},se.prototype.valueOf=function(){return this.value},se.prototype.toString=function(){return this.value+""},se.prototype.toJSON=function(){return this.value},se.prototype.peek=function(){var e=H;H=void 0;try{return this.value}finally{H=e}},Object.defineProperty(se.prototype,"value",{get:function(){var e=oa(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(ar>100)throw new Error("Cycle detected");this.v=e,this.i++,an++,Ve++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{on()}}}});function ve(e){return new se(e)}function aa(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 ia(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 sa(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function pt(e){se.call(this,void 0),this.x=e,this.s=void 0,this.g=an-1,this.f=4}(pt.prototype=new se).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===an))return!0;if(this.g=an,this.f|=1,this.i>0&&!aa(this))return this.f&=-2,!0;var e=H;try{ia(this),H=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 H=e,sa(this),this.f&=-2,!0},pt.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)}se.prototype.S.call(this,e)},pt.prototype.U=function(e){if(this.t!==void 0&&(se.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)}},pt.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(pt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=oa(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function me(e){return new pt(e)}function la(e){var t=e.u;if(e.u=void 0,typeof t=="function"){Ve++;var n=H;H=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,ir(e),r}finally{H=n,on()}}}function ir(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,la(e)}function tl(e){if(H!==this)throw new Error("Out-of-order effect");sa(this),H=e,this.f&=-2,8&this.f&&ir(this),on()}function Ft(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Ft.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.u=t)}finally{e()}},Ft.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,la(this),ia(this),Ve++;var e=H;return H=this,tl.bind(this,e)},Ft.prototype.N=function(){2&this.f||(this.f|=2,this.o=Rt,Rt=this)},Ft.prototype.d=function(){this.f|=8,1&this.f||ir(this)};function ht(e){var t=new Ft(e);try{t.c()}catch(n){throw t.d(),n}return t.d.bind(t)}var sr,sn,lr,ca=[],ua=[];ht(function(){sr=this.N})();function vt(e,t){T[e]=t.bind(null,T[e]||function(){})}function ln(e){lr&&lr(),lr=e&&e.S()}function da(e){var t=this,n=e.data,r=xe(n);r.value=n;var o=B(function(){for(var s=t,l=t.__v;l=l.__;)if(l.__c){l.__c.__$f|=4;break}var c=me(function(){var h=r.value.value;return h===0?0:h===!0?"":h||""}),f=me(function(){return!Array.isArray(c.value)&&!no(c.value)}),u=ht(function(){if(this.N=fa,f.value){var h=c.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=h)}}),v=t.__$u.d;return t.__$u.d=function(){u(),v.call(this)},[f,c]},[]),a=o[0],i=o[1];return a.value?i.peek():i.value}da.displayName="_st",Object.defineProperties(se.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:da},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),vt("__b",function(e,t){if(typeof t.type=="string"){var n,r=t.props;for(var o in r)if(o!=="children"){var a=r[o];a instanceof se&&(n||(t.__np=n={}),n[o]=a,r[o]=a.peek())}}e(t)}),vt("__r",function(e,t){ln();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(o){var a;return ht(function(){a=this}),a.c=function(){r.__$f|=1,r.setState({})},a}())),sn=r,ln(n),e(t)}),vt("__e",function(e,t,n,r){ln(),sn=void 0,e(t,n,r)}),vt("diffed",function(e,t){ln(),sn=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var r=t.__np,o=t.props;if(r){var a=n.U;if(a)for(var i in a){var s=a[i];s!==void 0&&!(i in r)&&(s.d(),a[i]=void 0)}else a={},n.U=a;for(var l in r){var c=a[l],f=r[l];c===void 0?(c=nl(n,l,f,o),a[l]=c):c.o(f,o)}}}e(t)});function nl(e,t,n,r){var o=t in e&&e.ownerSVGElement===void 0,a=ve(n);return{o:function(i,s){a.value=i,r=s},d:ht(function(){this.N=fa;var i=a.value.value;r[t]!==i&&(r[t]=i,o?e[t]=i:i?e.setAttribute(t,i):e.removeAttribute(t))})}}vt("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var r=n.U;if(r){n.U=void 0;for(var o in r){var a=r[o];a&&a.d()}}}}else{var i=t.__c;if(i){var s=i.__$u;s&&(i.__$u=void 0,s.d())}}e(t)}),vt("__h",function(e,t,n,r){(r<3||r===9)&&(t.__$f|=2),e(t,n,r)}),be.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u,r=n&&n.s!==void 0;for(var o in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var a=2&this.__$f;if(!(r||a||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var i in e)if(i!=="__source"&&e[i]!==this.props[i])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function xe(e){return B(function(){return ve(e)},[])}function Q(e){var t=E(e);return t.current=e,sn.__$f|=4,B(function(){return me(function(){return t.current()})},[])}var rl=typeof requestAnimationFrame>"u"?setTimeout:function(e){var t=function(){clearTimeout(n),cancelAnimationFrame(r),e()},n=setTimeout(t,100),r=requestAnimationFrame(t)},ol=function(e){queueMicrotask(function(){queueMicrotask(e)})};function al(){ra(function(){for(var e;e=ca.shift();)sr.call(e)})}function il(){ca.push(this)===1&&(T.requestAnimationFrame||rl)(al)}function sl(){ra(function(){for(var e;e=ua.shift();)sr.call(e)})}function fa(){ua.push(this)===1&&(T.requestAnimationFrame||ol)(sl)}function je(e){var t=E(e);t.current=e,A(function(){return ht(function(){return this.N=il,t.current()})},[])}function cn(){return cn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cn.apply(null,arguments)}const pa=new Uint8Array(0);class zt{static getFullOptions(t){return cn({clientTools:{},onConnect:()=>{},onDebug:()=>{},onDisconnect:()=>{},onError:()=>{},onMessage:()=>{},onAudio:()=>{},onModeChange:()=>{},onStatusChange:()=>{},onCanSendFeedbackChange:()=>{}},t)}constructor(t,n){var r=this;this.options=void 0,this.connection=void 0,this.lastInterruptTimestamp=0,this.mode="listening",this.status="connecting",this.volume=1,this.currentEventId=1,this.lastFeedbackEventId=1,this.canSendFeedback=!1,this.endSessionWithDetails=async function(o){r.status!=="connected"&&r.status!=="connecting"||(r.updateStatus("disconnecting"),await r.handleEndSession(),r.updateStatus("disconnected"),r.options.onDisconnect(o))},this.onMessage=async function(o){switch(o.type){case"interruption":return void r.handleInterruption(o);case"agent_response":return void r.handleAgentResponse(o);case"user_transcript":return void r.handleUserTranscript(o);case"internal_tentative_agent_response":return void r.handleTentativeAgentResponse(o);case"client_tool_call":return void await r.handleClientToolCall(o);case"audio":return void r.handleAudio(o);case"ping":return void r.connection.sendMessage({type:"pong",event_id:o.ping_event.event_id});default:return void r.options.onDebug(o)}},this.setVolume=({volume:o})=>{this.volume=o},this.options=t,this.connection=n,this.options.onConnect({conversationId:n.conversationId}),this.connection.onMessage(this.onMessage),this.connection.onDisconnect(this.endSessionWithDetails),this.updateStatus("connected")}endSession(){return this.endSessionWithDetails({reason:"user"})}async handleEndSession(){this.connection.close()}updateMode(t){t!==this.mode&&(this.mode=t,this.options.onModeChange({mode:t}))}updateStatus(t){t!==this.status&&(this.status=t,this.options.onStatusChange({status:t}))}updateCanSendFeedback(){const t=this.currentEventId!==this.lastFeedbackEventId;this.canSendFeedback!==t&&(this.canSendFeedback=t,this.options.onCanSendFeedbackChange({canSendFeedback:t}))}handleInterruption(t){t.interruption_event&&(this.lastInterruptTimestamp=t.interruption_event.event_id)}handleAgentResponse(t){this.options.onMessage({source:"ai",message:t.agent_response_event.agent_response})}handleUserTranscript(t){this.options.onMessage({source:"user",message:t.user_transcription_event.user_transcript})}handleTentativeAgentResponse(t){this.options.onDebug({type:"tentative_agent_response",response:t.tentative_agent_response_internal_event.tentative_agent_response})}async handleClientToolCall(t){if(this.options.clientTools.hasOwnProperty(t.client_tool_call.tool_name))try{var n;const r=(n=await this.options.clientTools[t.client_tool_call.tool_name](t.client_tool_call.parameters))!=null?n:"Client tool execution successful.",o=typeof r=="object"?JSON.stringify(r):String(r);this.connection.sendMessage({type:"client_tool_result",tool_call_id:t.client_tool_call.tool_call_id,result:o,is_error:!1})}catch(r){this.onError("Client tool execution failed with following error: "+(r==null?void 0:r.message),{clientToolName:t.client_tool_call.tool_name}),this.connection.sendMessage({type:"client_tool_result",tool_call_id:t.client_tool_call.tool_call_id,result:"Client tool execution failed: "+(r==null?void 0:r.message),is_error:!0})}else{if(this.options.onUnhandledClientToolCall)return void this.options.onUnhandledClientToolCall(t.client_tool_call);this.onError(`Client tool with name ${t.client_tool_call.tool_name} is not defined on client`,{clientToolName:t.client_tool_call.tool_name}),this.connection.sendMessage({type:"client_tool_result",tool_call_id:t.client_tool_call.tool_call_id,result:`Client tool with name ${t.client_tool_call.tool_name} is not defined on client`,is_error:!0})}}handleAudio(t){}onError(t,n){console.error(t,n),this.options.onError(t,n)}getId(){return this.connection.conversationId}isOpen(){return this.status==="connected"}setMicMuted(t){}getInputByteFrequencyData(){return pa}getOutputByteFrequencyData(){return pa}getInputVolume(){return 0}getOutputVolume(){return 0}sendFeedback(t){this.canSendFeedback?(this.connection.sendMessage({type:"feedback",score:t?"like":"dislike",event_id:this.currentEventId}),this.lastFeedbackEventId=this.currentEventId,this.updateCanSendFeedback()):console.warn(this.lastFeedbackEventId===0?"Cannot send feedback: the conversation has not started yet.":"Cannot send feedback: feedback has already been sent for the current response.")}sendContextualUpdate(t){this.connection.sendMessage({type:"contextual_update",text:t})}sendUserMessage(t){this.connection.sendMessage({type:"user_message",text:t})}sendUserActivity(){this.connection.sendMessage({type:"user_activity"})}}function ha(e){return!!e.type}class un{static async create(t){let n=null;try{var r;const a=(r=t.origin)!=null?r:"wss://api.elevenlabs.io",i=t.signedUrl?t.signedUrl:a+"/v1/convai/conversation?agent_id="+t.agentId,s=["convai"];t.authorization&&s.push(`bearer.${t.authorization}`),n=new WebSocket(i,s);const l=await new Promise((g,p)=>{n.addEventListener("open",()=>{var m;const _={type:"conversation_initiation_client_data"};var w,y,b,C,k;t.overrides&&(_.conversation_config_override={agent:{prompt:(w=t.overrides.agent)==null?void 0:w.prompt,first_message:(y=t.overrides.agent)==null?void 0:y.firstMessage,language:(b=t.overrides.agent)==null?void 0:b.language},tts:{voice_id:(C=t.overrides.tts)==null?void 0:C.voiceId},conversation:{text_only:(k=t.overrides.conversation)==null?void 0:k.textOnly}}),t.customLlmExtraBody&&(_.custom_llm_extra_body=t.customLlmExtraBody),t.dynamicVariables&&(_.dynamic_variables=t.dynamicVariables),(m=n)==null||m.send(JSON.stringify(_))},{once:!0}),n.addEventListener("error",m=>{setTimeout(()=>p(m),0)}),n.addEventListener("close",p),n.addEventListener("message",m=>{const _=JSON.parse(m.data);ha(_)&&(_.type==="conversation_initiation_metadata"?g(_.conversation_initiation_metadata_event):console.warn("First received message is not conversation metadata."))},{once:!0})}),{conversation_id:c,agent_output_audio_format:f,user_input_audio_format:u}=l,v=va(u??"pcm_16000"),h=va(f);return new un(n,c,v,h)}catch(a){var o;throw(o=n)==null||o.close(),a}}constructor(t,n,r,o){this.socket=void 0,this.conversationId=void 0,this.inputFormat=void 0,this.outputFormat=void 0,this.queue=[],this.disconnectionDetails=null,this.onDisconnectCallback=null,this.onMessageCallback=null,this.socket=t,this.conversationId=n,this.inputFormat=r,this.outputFormat=o,this.socket.addEventListener("error",a=>{setTimeout(()=>this.disconnect({reason:"error",message:"The connection was closed due to a socket error.",context:a}),0)}),this.socket.addEventListener("close",a=>{this.disconnect(a.code===1e3?{reason:"agent",context:a}:{reason:"error",message:a.reason||"The connection was closed by the server.",context:a})}),this.socket.addEventListener("message",a=>{try{const i=JSON.parse(a.data);if(!ha(i))return;this.onMessageCallback?this.onMessageCallback(i):this.queue.push(i)}catch{}})}close(){this.socket.close()}sendMessage(t){this.socket.send(JSON.stringify(t))}onMessage(t){this.onMessageCallback=t;const n=this.queue;this.queue=[],n.length>0&&queueMicrotask(()=>{n.forEach(t)})}onDisconnect(t){this.onDisconnectCallback=t;const n=this.disconnectionDetails;n&&queueMicrotask(()=>{t(n)})}disconnect(t){var n;this.disconnectionDetails||(this.disconnectionDetails=t,(n=this.onDisconnectCallback)==null||n.call(this,t))}}function va(e){const[t,n]=e.split("_");if(!["pcm","ulaw"].includes(t))throw new Error(`Invalid format: ${e}`);const r=parseInt(n);if(isNaN(r))throw new Error(`Invalid sample rate: ${n}`);return{format:t,sampleRate:r}}function ma(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}async function ga(e={default:0,android:3e3}){let t=e.default;var n;if(/android/i.test(navigator.userAgent))t=(n=e.android)!=null?n:t;else if(ma()){var r;t=(r=e.ios)!=null?r:t}t>0&&await new Promise(o=>setTimeout(o,t))}class cr extends zt{static async startSession(t){const n=zt.getFullOptions(t);n.onStatusChange({status:"connecting"}),n.onCanSendFeedbackChange({canSendFeedback:!1});let r=null;try{return await ga(n.connectionDelay),r=await un.create(t),new cr(n,r)}catch(a){var o;throw n.onStatusChange({status:"disconnected"}),(o=r)==null||o.close(),a}}}function ll(e){const t=new Uint8Array(e);return window.btoa(String.fromCharCode(...t))}function cl(e){const t=window.atob(e),n=t.length,r=new Uint8Array(n);for(let o=0;o<n;o++)r[o]=t.charCodeAt(o);return r.buffer}const ur=new Map;function _a(e,t){return async n=>{const r=ur.get(e);if(r)return n.addModule(r);const o=new Blob([t],{type:"application/javascript"}),a=URL.createObjectURL(o);try{return await n.addModule(a),void ur.set(e,a)}catch{URL.revokeObjectURL(a)}try{const i=`data:application/javascript;base64,${btoa(t)}`;await n.addModule(i),ur.set(e,i)}catch{throw new Error(`Failed to load the ${e} worklet module. Make sure the browser supports AudioWorklets.`)}}}const ul=_a("raw-audio-processor",`
|
|
2
2
|
const BIAS = 0x84;
|
|
3
3
|
const CLIP = 32635;
|
|
4
4
|
const encodeTable = [
|
|
@@ -204,7 +204,7 @@ class AudioConcatProcessor extends AudioWorkletProcessor {
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
registerProcessor("audio-concat-processor", AudioConcatProcessor);
|
|
207
|
-
`);class fr{static async create({sampleRate:t,format:n}){let r=null;try{r=new AudioContext({sampleRate:t});const a=r.createAnalyser(),i=r.createGain();i.connect(a),a.connect(r.destination),await dl(r.audioWorklet);const s=new AudioWorkletNode(r,"audio-concat-processor");return s.port.postMessage({type:"setFormat",format:n}),s.connect(i),await r.resume(),new fr(r,a,i,s)}catch(a){var o;throw(o=r)==null||o.close(),a}}constructor(t,n,r,o){this.context=void 0,this.analyser=void 0,this.gain=void 0,this.worklet=void 0,this.context=t,this.analyser=n,this.gain=r,this.worklet=o}async close(){await this.context.close()}}class pr extends zt{static async startSession(t){var n;const r=zt.getFullOptions(t);r.onStatusChange({status:"connecting"}),r.onCanSendFeedbackChange({canSendFeedback:!1});let o=null,a=null,i=null,s=null,l=null;if((n=t.useWakeLock)==null||n)try{l=await navigator.wakeLock.request("screen")}catch{}try{var c;return s=await navigator.mediaDevices.getUserMedia({audio:!0}),await ga(r.connectionDelay),a=await un.create(t),[o,i]=await Promise.all([dr.create(cn({},a.inputFormat,{preferHeadphonesForIosDevices:t.preferHeadphonesForIosDevices})),fr.create(a.outputFormat)]),(c=s)==null||c.getTracks().forEach(p=>p.stop()),s=null,new pr(r,a,o,i,l)}catch(p){var f,u,v,h;r.onStatusChange({status:"disconnected"}),(f=s)==null||f.getTracks().forEach(m=>m.stop()),(u=a)==null||u.close(),await((v=o)==null?void 0:v.close()),await((h=i)==null?void 0:h.close());try{var g;await((g=l)==null?void 0:g.release()),l=null}catch{}throw p}}constructor(t,n,r,o,a){super(t,n),this.input=void 0,this.output=void 0,this.wakeLock=void 0,this.inputFrequencyData=void 0,this.outputFrequencyData=void 0,this.onInputWorkletMessage=i=>{this.status==="connected"&&this.connection.sendMessage({user_audio_chunk:ll(i.data[0].buffer)})},this.onOutputWorkletMessage=({data:i})=>{i.type==="process"&&this.updateMode(i.finished?"listening":"speaking")},this.addAudioBase64Chunk=i=>{this.output.gain.gain.value=this.volume,this.output.worklet.port.postMessage({type:"clearInterrupted"}),this.output.worklet.port.postMessage({type:"buffer",buffer:cl(i)})},this.fadeOutAudio=()=>{this.updateMode("listening"),this.output.worklet.port.postMessage({type:"interrupt"}),this.output.gain.gain.exponentialRampToValueAtTime(1e-4,this.output.context.currentTime+2),setTimeout(()=>{this.output.gain.gain.value=this.volume,this.output.worklet.port.postMessage({type:"clearInterrupted"})},2e3)},this.calculateVolume=i=>{if(i.length===0)return 0;let s=0;for(let l=0;l<i.length;l++)s+=i[l]/255;return s/=i.length,s<0?0:s>1?1:s},this.input=r,this.output=o,this.wakeLock=a,this.input.worklet.port.onmessage=this.onInputWorkletMessage,this.output.worklet.port.onmessage=this.onOutputWorkletMessage}async handleEndSession(){await super.handleEndSession();try{var t;await((t=this.wakeLock)==null?void 0:t.release()),this.wakeLock=null}catch{}await this.input.close(),await this.output.close()}handleInterruption(t){super.handleInterruption(t),this.fadeOutAudio()}handleAudio(t){this.lastInterruptTimestamp<=t.audio_event.event_id&&(this.options.onAudio(t.audio_event.audio_base_64),this.addAudioBase64Chunk(t.audio_event.audio_base_64),this.currentEventId=t.audio_event.event_id,this.updateCanSendFeedback(),this.updateMode("speaking"))}setMicMuted(t){this.input.setMuted(t)}getInputByteFrequencyData(){return this.inputFrequencyData!=null||(this.inputFrequencyData=new Uint8Array(this.input.analyser.frequencyBinCount)),this.input.analyser.getByteFrequencyData(this.inputFrequencyData),this.inputFrequencyData}getOutputByteFrequencyData(){return this.outputFrequencyData!=null||(this.outputFrequencyData=new Uint8Array(this.output.analyser.frequencyBinCount)),this.output.analyser.getByteFrequencyData(this.outputFrequencyData),this.outputFrequencyData}getInputVolume(){return this.calculateVolume(this.getInputByteFrequencyData())}getOutputVolume(){return this.calculateVolume(this.getOutputByteFrequencyData())}}class fl extends zt{static startSession(t){return t.textOnly?cr.startSession(t):pr.startSession(t)}}function wa(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=wa(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Y(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=wa(e))&&(r&&(r+=" "),r+=t);return r}var pl=Object.defineProperty,hl=(e,t,n)=>t in e?pl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ue=(e,t,n)=>hl(e,typeof t!="symbol"?t+"":t,n);function mt(e){return e?e==="true"?!0:e==="false"?!1:null:null}const hr=["variant","placement","override-config","avatar-image-url","avatar-orb-color-1","avatar-orb-color-2","agent-id","signed-url","terms-key","server-location","language","dynamic-variables","show-avatar-when-collapsed","override-prompt","override-first-message","override-language","override-voice-id","override-text-only","mic-muting","transcript","text-input","text-contents"],vl='@import"https://fonts.googleapis.com/css2?family=Inter:wght@400,500&display=swap";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-auto{pointer-events:auto}.\\!visible{visibility:visible!important}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.-bottom-3{bottom:-12px}.bottom-0{bottom:0}.bottom-20{bottom:80px}.left-0{left:0}.left-1\\/2{left:50%}.left-4{left:16px}.right-0{right:0}.top-0{top:0}.top-1\\/2{top:50%}.top-20{top:80px}.top-4{top:16px}.z-1{z-index:1}.z-10{z-index:10}.m-1{margin:4px}.-mx-0\\.5{margin-left:-2px;margin-right:-2px}.mx-1{margin-left:4px;margin-right:4px}.-mr-1\\.5{margin-right:-6px}.ml-auto{margin-left:auto}.mt-2{margin-top:8px}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-11{height:44px}.h-16{height:64px}.h-4{height:16px}.h-48{height:192px}.h-5{height:20px}.h-6{height:24px}.h-9{height:36px}.h-\\[calc\\(100\\%-80px\\)\\]{height:calc(100% - 80px)}.h-full{height:100%}.h-screen{height:100vh}.max-h-\\[550px\\]{max-height:550px}.max-h-\\[8lh\\]{max-height:8lh}.max-h-\\[min\\(384px\\,var\\(--radix-select-content-available-height\\)\\)\\]{max-height:min(384px,var(--radix-select-content-available-height))}.min-h-min{min-height:-moz-min-content;min-height:min-content}.w-16{width:64px}.w-4{width:16px}.w-48{width:192px}.w-5{width:20px}.w-6{width:24px}.w-64{width:256px}.w-9{width:36px}.w-full{width:100%}.w-screen{width:100vw}.\\!min-w-60{min-width:240px!important}.min-w-0{min-width:0px}.min-w-60{min-width:240px}.min-w-9{min-width:36px}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.min-w-max{min-width:-moz-max-content;min-width:max-content}.min-w-min{min-width:-moz-min-content;min-width:min-content}.max-w-64{max-width:256px}.max-w-\\[400px\\]{max-width:400px}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.origin-bottom{transform-origin:bottom}.origin-bottom-left{transform-origin:bottom left}.origin-bottom-right{transform-origin:bottom right}.origin-top{transform-origin:top}.origin-top-left{transform-origin:top left}.origin-top-right{transform-origin:top right}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-\\[calc\\(var\\(--el-overlay-padding\\)\\)\\]{--tw-translate-y: calc(calc(var(--el-overlay-padding)) * -1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-1\\/2{--tw-translate-y: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[calc\\(var\\(--el-overlay-padding\\)\\)\\]{--tw-translate-y: calc(var(--el-overlay-padding));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-180{--tw-rotate: -180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-150{--tw-scale-x: 1.5;--tw-scale-y: 1.5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-75{--tw-scale-x: .75;--tw-scale-y: .75;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-90{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-\\[0\\.333\\]{--tw-scale-x: .333;--tw-scale-y: .333;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.gap-1{gap:4px}.gap-2{gap:8px}.gap-2\\.5{gap:10px}.gap-3{gap:12px}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-all{word-break:break-all}.rounded-\\[calc\\(var\\(--el-button-radius\\)\\+4px\\)\\]{border-radius:calc(var(--el-button-radius) + 4px)}.rounded-bubble{border-radius:var(--el-bubble-radius)}.rounded-button{border-radius:var(--el-button-radius)}.rounded-compact-sheet{border-radius:var(--el-compact-sheet-radius)}.rounded-dropdown-sheet{border-radius:var(--el-dropdown-sheet-radius)}.rounded-full{border-radius:9999px}.rounded-input{border-radius:var(--el-input-radius)}.rounded-sheet{border-radius:var(--el-sheet-radius)}.rounded-bl-\\[calc\\(var\\(--el-bubble-radius\\)\\/3\\)\\]{border-bottom-left-radius:calc(var(--el-bubble-radius) / 3)}.border{border-width:1px}.border-accent{border-color:var(--el-accent)}.border-base-border{border-color:var(--el-base-border)}.bg-accent{background-color:var(--el-accent)}.bg-base{background-color:var(--el-base)}.bg-base-active{background-color:var(--el-base-active)}.bg-base-border{background-color:var(--el-base-border)}.bg-base-hover{background-color:var(--el-base-hover)}.bg-cover{background-size:cover}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1{padding:4px}.p-1\\.5{padding:6px}.p-2{padding:8px}.p-3{padding:12px}.p-4{padding:16px}.px-1{padding-left:4px;padding-right:4px}.px-1\\.5{padding-left:6px;padding-right:6px}.px-2{padding-left:8px;padding-right:8px}.px-2\\.5{padding-left:10px;padding-right:10px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-8{padding-left:32px;padding-right:32px}.py-1\\.5{padding-top:6px;padding-bottom:6px}.py-2\\.5{padding-top:10px;padding-bottom:10px}.py-\\[calc\\(theme\\(spacing\\.2\\)-1px\\)\\]{padding-top:7px;padding-bottom:7px}.pb-1{padding-bottom:4px}.pb-3{padding-bottom:12px}.pl-16{padding-left:64px}.pr-16{padding-right:64px}.pr-3{padding-right:12px}.pt-1{padding-top:4px}.text-center{text-align:center}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:18px;line-height:26px}.text-md{font-size:16px;line-height:24px}.text-sm{font-size:14px;line-height:20px}.text-xs{font-size:12px;line-height:16px}.font-medium{font-weight:500}.text-accent-primary{color:var(--el-accent-primary)}.text-base-error{color:var(--el-base-error)}.text-base-primary{color:var(--el-base-primary)}.text-base-subtle{color:var(--el-base-subtle)}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-30{opacity:.3}.shadow-lg{--tw-shadow: 0 2px 40px 1px rgba(0, 0, 0, .12);--tw-shadow-colored: 0 2px 40px 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 2px 24px 1px rgba(0, 0, 0, .16);--tw-shadow-colored: 0 2px 24px 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[border-radius\\]{transition-property:border-radius;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[margin\\]{transition-property:margin;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[opacity\\,transform\\]{transition-property:opacity,transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[opacity\\,width\\,height\\,transform\\,flex-grow\\]{transition-property:opacity,width,height,transform,flex-grow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[transform\\,left\\,top\\]{transition-property:transform,left,top;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[transform\\,opacity\\]{transition-property:transform,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.overlay{position:absolute;inset:var(--el-overlay-padding);right:calc(var(--el-overlay-padding) + var(--removed-body-scroll-bar-size, 0px))}.focus-ring{--tw-ring-color: var(--el-accent);--tw-ring-offset-width: 2px;--tw-ring-offset-color: var(--el-base)}.focus-ring:focus-visible{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.animate-text{background-image:linear-gradient(75deg,var(--el-base-primary),var(--el-base-subtle),var(--el-base-primary),var(--el-base-subtle));background-size:300% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;animation:TextAnimation 2s linear infinite}@keyframes TextAnimation{0%{background-position:0 0}to{background-position:100% 0}}.\\!terms h6,.terms h6{font-size:12px;line-height:16px;font-weight:500;color:var(--el-base-primary)}.\\!terms h5,.terms h5{font-size:14px;line-height:20px;font-weight:500;color:var(--el-base-primary)}.\\!terms h4,.terms h4{font-size:16px;line-height:24px;font-weight:500;color:var(--el-base-primary)}.\\!terms h3,.terms h3{font-size:18px;line-height:26px;font-weight:500;color:var(--el-base-primary)}.\\!terms h2,.terms h2{font-size:20px;line-height:28px;font-weight:500;color:var(--el-base-primary)}.\\!terms h2,.terms h2{font-size:24px;line-height:30px;font-weight:500;color:var(--el-base-primary)}.\\[field-sizing\\:content\\]{field-sizing:content}.\\[line-height\\:var\\(--el-overlay-padding\\)\\]{line-height:var(--el-overlay-padding)}:host,:root{--el-base: #ffffff;--el-base-hover: #f9fafb;--el-base-active: #f3f4f6;--el-base-border: #e5e7eb;--el-base-subtle: #6b7280;--el-base-primary: #000000;--el-base-error: #ef4444;--el-accent: #000000;--el-accent-hover: #1f2937;--el-accent-active: #374151;--el-accent-border: #4b5563;--el-accent-subtle: #6b7280;--el-accent-primary: #ffffff;--el-overlay-padding: 32px;--el-button-radius: 18px;--el-input-radius: 10px;--el-bubble-radius: 15px;--el-sheet-radius: calc(var(--el-button-radius) + 6px);--el-compact-sheet-radius: calc(var(--el-button-radius) + 12px);--el-dropdown-sheet-radius: calc(var(--el-input-radius) + 6px)}.dev-host,:host{pointer-events:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;font-size:16px;line-height:24px;color:var(--el-base-primary);font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;scrollbar-color:#e5e7eb transparent}.placeholder\\:text-base-subtle::-moz-placeholder{color:var(--el-base-subtle)}.placeholder\\:text-base-subtle::placeholder{color:var(--el-base-subtle)}.hover\\:border-accent-hover:hover{border-color:var(--el-accent-hover)}.hover\\:bg-accent-hover:hover{background-color:var(--el-accent-hover)}.hover\\:bg-base-hover:hover{background-color:var(--el-base-hover)}.hover\\:opacity-50:hover{opacity:.5}.focus-visible\\:underline-offset-2:focus-visible{text-underline-offset:2px}.focus-visible\\:opacity-100:focus-visible{opacity:1}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.active\\:border-accent-active:active{border-color:var(--el-accent-active)}.active\\:bg-accent-active:active{background-color:var(--el-accent-active)}.active\\:bg-base-active:active{background-color:var(--el-base-active)}.data-hidden\\:-translate-y-4[data-shown=false]{--tw-translate-y: -16px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-hidden\\:translate-y-2[data-shown=false]{--tw-translate-y: 8px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-hidden\\:scale-100[data-shown=false]{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-hidden\\:scale-75[data-shown=false]{--tw-scale-x: .75;--tw-scale-y: .75;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-hidden\\:scale-90[data-shown=false]{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-hidden\\:opacity-0[data-shown=false]{opacity:0}.data-\\[highlighted\\]\\:bg-base-active[data-highlighted]{background-color:var(--el-base-active)}',ml=tn(function(){return d("style",{children:vl})});function Ce(e){const t=We(e);if(t==null)throw new Error(`${e.displayName} cannot be used outside of provider`);return t}const ya=ie(null);function gl({value:e,children:t}){const n=B(()=>Object.fromEntries(hr.map(r=>[r,ve(e[r])])),[]);return hr.forEach(r=>{n[r].value=e[r]}),d(ya.Provider,{value:n,children:t})}function _l(){return Ce(ya)}function q(e){return _l()[e]}const Ut={en:{name:"English",flagCode:"us",languageCode:"en"},zh:{name:"中文",flagCode:"cn",languageCode:"zh"},es:{name:"Español",flagCode:"es",languageCode:"es"},hi:{name:"हिन्दी",flagCode:"in",languageCode:"hi"},pt:{name:"Português (Portugal)",flagCode:"pt",languageCode:"pt"},"pt-br":{name:"Português (Brasil)",flagCode:"br",languageCode:"pt-br"},fr:{name:"Français",flagCode:"fr",languageCode:"fr"},de:{name:"Deutsch",flagCode:"de",languageCode:"de"},ja:{name:"日本語",flagCode:"jp",languageCode:"ja"},ar:{name:"العربية",flagCode:"ae",languageCode:"ar"},ru:{name:"Русский",flagCode:"ru",languageCode:"ru"},ko:{name:"한국어",flagCode:"kr",languageCode:"ko"},id:{name:"Bahasa Indonesia",flagCode:"id",languageCode:"id"},it:{name:"Italiano",flagCode:"it",languageCode:"it"},nl:{name:"Nederlands",flagCode:"nl",languageCode:"nl"},tr:{name:"Türkçe",flagCode:"tr",languageCode:"tr"},pl:{name:"Polski",flagCode:"pl",languageCode:"pl"},sv:{name:"Svenska",flagCode:"se",languageCode:"sv"},ms:{name:"Bahasa Melayu",flagCode:"my",languageCode:"ms"},ro:{name:"Română",flagCode:"ro",languageCode:"ro"},uk:{name:"Українська",flagCode:"ua",languageCode:"uk"},el:{name:"Ελληνικά",flagCode:"gr",languageCode:"el"},cs:{name:"Čeština",flagCode:"cz",languageCode:"cs"},da:{name:"Dansk",flagCode:"dk",languageCode:"da"},fi:{name:"Suomi",flagCode:"fi",languageCode:"fi"},bg:{name:"Български",flagCode:"bg",languageCode:"bg"},hr:{name:"Hrvatski",flagCode:"hr",languageCode:"hr"},sk:{name:"Slovenčina",flagCode:"sk",languageCode:"sk"},ta:{name:"தமிழ்",flagCode:"in",languageCode:"ta"},hu:{name:"Magyar",flagCode:"hu",languageCode:"hu"},no:{name:"Norsk",flagCode:"no",languageCode:"no"},vi:{name:"Tiếng Việt",flagCode:"vn",languageCode:"vi"}};function vr(e){return Object.keys(Ut).includes(e??"")}const ba=["tiny","compact","full"];function wl(e){return ba.includes(e)?e:ba[0]}const yl=["top-left","top","top-right","bottom-left","bottom","bottom-right"];function bl(e){return yl.includes(e)?e:"bottom-right"}const xa={main_label:"Need help?",start_call:"Start a call",start_chat:"Start a chat",new_call:"New call",end_call:"End",mute_microphone:"Mute microphone",change_language:"Change language",collapse:"Collapse",expand:"Expand",copied:"Copied!",accept_terms:"Accept",dismiss_terms:"Cancel",listening_status:"Listening",speaking_status:"Talk to interrupt",connecting_status:"Connecting",chatting_status:"Chatting with AI Agent",input_label:"Text message input",input_placeholder:"Send a message",input_placeholder_text_only:"Send a message",input_placeholder_new_conversation:"Start a new conversation",user_ended_conversation:"You ended the conversation",agent_ended_conversation:"The agent ended the conversation",conversation_id:"ID",error_occurred:"An error occurred",copy_id:"Copy ID"},xl=Object.keys(xa),Ca=ie(null);function Cl({children:e}){const t=q("server-location"),n=B(()=>{const r=me(()=>kl(t.value));return{location:r,serverUrl:me(()=>r.value==="us"?"https://api.us.elevenlabs.io":"https://api.elevenlabs.io"),webSocketUrl:me(()=>r.value==="us"?"wss://api.us.elevenlabs.io":"wss://api.elevenlabs.io")}},[]);return d(Ca.Provider,{value:n,children:e})}function ka(){return Ce(Ca)}function kl(e="us"){switch(e){case"us":case"global":return e;default:return console.warn(`[ConversationalAI] Invalid server-location: ${e}. Defaulting to "us"`),"us"}}const Sa=ie(null);function Sl({children:e}){const t=ce(),n=Q(()=>t.value.mic_muting_enabled??!1),r=xe(!1),o=B(()=>({isMuted:me(()=>n.value?r.value:!1),setIsMuted:a=>{r.value=a},isMutingEnabled:n}),[]);return d(Sa.Provider,{value:o,children:e})}function Ea(){return Ce(Sa)}const Ta=ie(null);function El({children:e}){const{language:t}=gt(),n=q("override-prompt"),r=q("override-first-message"),o=q("override-voice-id"),a=q("override-text-only"),i=Q(()=>({agent:{prompt:{prompt:n.value},firstMessage:r.value,language:t.value.languageCode},tts:{voiceId:o.value},conversation:{textOnly:mt(a.value)??void 0}})),s=q("dynamic-variables"),l=Q(()=>{if(s.value)try{return JSON.parse(s.value)}catch(g){console.error(`[ConversationalAI] Cannot parse dynamic-variables: ${g==null?void 0:g.message}`)}}),{webSocketUrl:c}=ka(),f=q("agent-id"),u=q("signed-url"),v=mr(),h=Q(()=>{const g={dynamicVariables:l.value,overrides:i.value,connectionDelay:{default:300},textOnly:v.value};return f.value?{agentId:f.value,origin:c.value,...g}:u.value?{signedUrl:u.value,...g}:(console.error("[ConversationalAI] Either agent-id or signed-url is required"),null)});return h.value?d(Ta.Provider,{value:h,children:e}):null}function Tl(){return Ce(Ta)}const Na=ie(null);function Nl({children:e}){const t=ce(),n=B(()=>{const r=t.peek().terms_key,o=r?!!localStorage.getItem(r):!1,a=ve(!1),i=ve(o),s=me(()=>!t.value.terms_html||i.value);let l=[];return{termsShown:a,termsAccepted:s,dismissTerms:()=>{a.value=!1,l.forEach(c=>c.reject()),l=[]},acceptTerms:()=>{i.value=!0,a.value=!1;const c=t.peek().terms_key;c&&localStorage.setItem(c,"true"),l.forEach(f=>f.resolve()),l=[]},requestTerms:async()=>{s.peek()||(a.value=!0,await new Promise((c,f)=>{l.push({resolve:c,reject:f})}))}}},[]);return d(Na.Provider,{value:n,children:e})}function dn(){return Ce(Na)}const Pa=ie(null);function Pl({children:e}){const t=Al();return je(()=>{if(t.conversationTextOnly.value===!0){t.transcript.value;const n=setTimeout(()=>{t.endSession()},10*60*1e3);return()=>{clearTimeout(n)}}}),d(Pa.Provider,{value:t,children:e})}function de(){return Ce(Pa)}function Al(){const e=E(null),t=E(null),n=ce(),r=$a(),o=dn(),a=Tl(),{isMuted:i}=Ea();return je(()=>{var s;i.value&&((s=e==null?void 0:e.current)==null||s.setMicMuted(i.value))}),A(()=>()=>{var s;(s=e.current)==null||s.endSession()},[]),B(()=>{const s=ve("disconnected"),l=me(()=>s.value==="disconnected"),c=ve("listening"),f=me(()=>c.value==="speaking"),u=ve(null),v=ve(null),h=ve(!1),g=ve([]),p=ve(0),m=ve(null);return{status:s,isSpeaking:f,mode:c,isDisconnected:l,lastId:v,error:u,canSendFeedback:h,conversationIndex:p,conversationTextOnly:m,transcript:g,startSession:async(_,w)=>{var y,b;if(await o.requestTerms(),(y=e.current)!=null&&y.isOpen())return e.current.getId();if(t.current)return(await t.current).getId();let C=structuredClone(a.peek());w&&n.value.supports_text_only&&(C.textOnly=!0,n.value.text_only||(C.overrides??(C.overrides={}),(b=C.overrides).conversation??(b.conversation={}),C.overrides.conversation.textOnly=!0));try{C=$l(_,C)}catch(k){console.error("[ConversationalAI] Error triggering call event:",k)}m.value=C.textOnly??!1,g.value=w?[{type:"message",role:"user",message:w,isText:!0,conversationIndex:p.peek()}]:[];try{if(t.current=fl.startSession({...C,onModeChange:x=>{c.value=x.mode},onStatusChange:x=>{s.value=x.status},onCanSendFeedbackChange:x=>{h.value=x.canSendFeedback},onMessage:({source:x,message:P})=>{m.peek()===!0&&x==="ai"&&P===r.peek()||(g.value=[...g.value,{type:"message",role:x,message:P,isText:!1,conversationIndex:p.peek()}])},onDisconnect:x=>{m.value=null,g.value=[...g.value,x.reason==="error"?{type:"error",message:x.message,conversationIndex:p.peek()}:{type:"disconnection",role:x.reason==="user"?"user":"ai",conversationIndex:p.peek()}],p.value++,x.reason==="error"&&(u.value=x.message,console.error("[ConversationalAI] Disconnected due to an error:",x.message))}}),e.current=await t.current,i.peek()!==void 0&&e.current.setMicMuted(i.peek()),w){const x=e.current;setTimeout(()=>x.sendUserMessage(w),100)}const k=e.current.getId();return v.value=k,u.value=null,k}catch(k){let x="Could not start a conversation.";k instanceof CloseEvent?x=k.reason||x:k instanceof Error&&(x=k.message||x),u.value=x,g.value=[...g.value,{type:"error",message:x,conversationIndex:p.peek()}]}finally{t.current=null}},endSession:async()=>{const _=e.current;e.current=null,await(_==null?void 0:_.endSession())},getInputVolume:()=>{var _;return((_=e.current)==null?void 0:_.getInputVolume())??0},getOutputVolume:()=>{var _;return((_=e.current)==null?void 0:_.getOutputVolume())??0},sendFeedback:_=>{var w;(w=e.current)==null||w.sendFeedback(_)},sendUserMessage:_=>{var w;(w=e.current)==null||w.sendUserMessage(_),g.value=[...g.value,{type:"message",role:"user",message:_,isText:!0,conversationIndex:p.peek()}]},sendUserActivity:()=>{var _;(_=e.current)==null||_.sendUserActivity()}}},[a,i])}function $l(e,t){try{const n=new CustomEvent("elevenlabs-convai:call",{bubbles:!0,composed:!0,detail:{config:t}});return e.dispatchEvent(n),n.detail.config}catch(n){return console.error("[ConversationalAI] Could not trigger call event:",n),t}}const Aa=ie(null);function Il({children:e}){const{serverUrl:t}=ka(),n=q("agent-id"),r=q("override-config"),o=xe(null);je(()=>{if(r.value)try{const g=JSON.parse(r.value);if(g){o.value=g;return}}catch(g){console.error(`[ConversationalAI] Cannot parse override-config: ${g==null?void 0:g.message}`)}if(!n.value){o.value=null;return}const h=new AbortController;return Dl(n.value,t.value,h.signal).then(g=>{h.signal.aborted||(o.value=g)}).catch(g=>{console.error(`[ConversationalAI] Cannot fetch config for agent ${n.value}: ${g==null?void 0:g.message}`),h.signal.aborted||(o.value=null)}),()=>{h.abort()}});const a=q("variant"),i=q("placement"),s=q("terms-key"),l=q("mic-muting"),c=q("transcript"),f=q("text-input"),u=q("override-text-only"),v=Q(()=>{if(!o.value)return null;const h=a.value??o.value.variant,g=i.value??o.value.placement,p=s.value??o.value.terms_key,m=mt(u.value)??o.value.text_only??!1,_=mt(l.value)??o.value.mic_muting_enabled,w=mt(c.value)??o.value.transcript_enabled,y=mt(f.value)??o.value.text_input_enabled;return{...o.value,variant:wl(h),placement:bl(g),terms_key:p,mic_muting_enabled:!m&&_,transcript_enabled:m||w,text_input_enabled:m||y}});return v.value?d(Aa.Provider,{value:v,children:e}):null}function ce(){return Ce(Aa)}function mr(){const e=q("override-text-only"),t=ce();return Q(()=>mt(e.value)??t.value.text_only??!1)}function fn(){const e=mr(),{conversationTextOnly:t}=de();return Q(()=>t.value??e.value)}function $a(){const e=q("override-first-message"),t=ce(),{language:n}=gt();return Q(()=>{var r,o;return e.value??((o=(r=t.value.language_presets)==null?void 0:r[n.value.languageCode])==null?void 0:o.first_message)??t.value.first_message??null})}async function Dl(e,t,n){const r=await(await fetch(`${t}/v1/convai/agents/${e}/widget`,{signal:n})).json();if(!r.widget_config)throw new Error("Response does not contain widget_config");return r.widget_config}const Ia=ie(null);function Ml({children:e}){const t=ce(),n=q("language"),r=q("override-language"),o=xe(n.peek()??t.peek().language),a=Q(()=>(t.value.supported_language_overrides??[]).filter(vr)),i=Q(()=>a.value.map(l=>Ut[l]).sort((l,c)=>l.name.localeCompare(c.name))),s=B(()=>({language:me(()=>vr(r.value)?Ut[r.value]:vr(o.value)&&a.value.includes(o.value)?Ut[o.value]:Ut[t.value.language]),setLanguage:l=>{o.value=l},options:i,showPicker:me(()=>i.value.length>0)}),[]);return d(Ia.Provider,{value:s,children:e})}function gt(){return Ce(Ia)}const Da=ie(null);function Ol({children:e}){const t=ce(),{language:n}=gt(),r=q("text-contents"),o=Q(()=>{try{if(r.value){const i=JSON.parse(r.value);if(typeof i=="object")return i}}catch(i){console.error("[ConversationalAI] Cannot parse text-contents:",i)}return{}}),a=B(()=>Object.fromEntries(xl.map(i=>[i,me(()=>{var s,l,c,f;return o.value[i]??((c=(l=(s=t.value.language_presets)==null?void 0:s[n.value.languageCode])==null?void 0:l.text_contents)==null?void 0:c[i])??((f=t.value.text_contents)==null?void 0:f[i])??xa[i]})])),[]);return d(Da.Provider,{value:a,children:e})}function fe(){return Ce(Da)}const Ma=ie(null);function Ll({children:e}){const t=ce(),n=q("avatar-image-url"),r=q("avatar-orb-color-1"),o=q("avatar-orb-color-2"),a=xe(""),i=Q(()=>n.value?{type:"image",url:n.value}:r.value&&o.value?{type:"orb",color_1:r.value,color_2:o.value}:t.value.avatar),s=Q(()=>{switch(i.value.type){case"url":return i.value.custom_url;case"orb":return a.value;case"image":return i.value.url}}),l=B(()=>({config:i,previewUrl:s,canvasUrl:a}),[]);return d(Ma.Provider,{value:l,children:e})}function gr(){return Ce(Ma)}const Oa=ie(null);function pn({children:e,...t}){const[n,r]=S(null);return d("div",{ref:r,...t,children:n&&d(Oa.Provider,{value:n,children:e})})}function Rl(){return Ce(Oa)}function _r(e){return e&&typeof e=="object"&&"peek"in e}function Fl(e){const t=_r(e),n=xe(t?e.peek():e);return t?e:(n.value=e,n)}function La(e){return _r(e)?e.value:e}function zl(e){return _r(e)?e.peek():e}function Ra(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Fa(...e){return t=>{let n=!1;const r=e.map(o=>{const a=Ra(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():Ra(e[o],null)}}}}function le(...e){return $(Fa(...e),e)}function Bt(e){const t=Ul(e),n=I((r,o)=>{const{children:a,...i}=r,s=He.toArray(a),l=s.find(Wl);if(l){const c=l.props.children,f=s.map(u=>u===l?He.count(c)>1?He.only(null):Le(c)?c.props.children:null:u);return d(t,{...i,ref:o,children:Le(c)?Lt(c,void 0,f):null})}return d(t,{...i,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}var za=Bt("Slot");function Ul(e){const t=I((n,r)=>{const{children:o,...a}=n;if(Le(o)){const i=Vl(o),s=Hl(a,o.props);return o.type!==ee&&(s.ref=r?Fa(r,i):i),Lt(o,s)}return He.count(o)>1?He.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Bl=Symbol("radix.slottable");function Wl(e){return Le(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Bl}function Hl(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{a(...i),o(...i)}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function Vl(e){var t,n;let r=(t=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?e.ref:(r=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}const wr=window.matchMedia("(prefers-reduced-motion: reduce)");function Ua(){const e=xe(wr.matches);return A(()=>{const t=n=>{e.value=n.matches};return wr.addEventListener("change",t),()=>wr.removeEventListener("change",t)},[]),e}function Ba({onStart:e,onEnd:t}){const n=E();n.current??(n.current=new Set);const r=E(e);r.current=e;const o=E(t);o.current=t;const a=xe(!1),i=$(l=>{var c,f;l.target===l.currentTarget&&((c=n.current)==null||c.add(l.propertyName),a.peek()||(a.value=!0,(f=r.current)==null||f.call(r)))},[]),s=$(l=>{var c,f,u;l.target===l.currentTarget&&((c=n.current)==null||c.delete(l.propertyName),(f=n.current)!=null&&f.size||(a.value=!1,(u=o.current)==null||u.call(o)))},[]);return{transitioning:a,handlers:{onTransitionStart:i,onTransitionEnd:s}}}function ke(e){const t=Ua().value?jl:Yl;return d(t,{...e})}function jl({active:e,...t}){return La(e)?d(za,{"data-shown":!0,...t}):null}function Yl({active:e,initial:t=e,...n}){const r=Fl(e),o=xe(zl(t));je(()=>{r.value&&(o.value=r.value)});const{handlers:a}=Ba({onEnd:()=>{o.value=r.value}});return!r.value&&!o.value?null:d(za,{"data-shown":r.value&&o.value,...a,...n})}const ql=`#version 300 es
|
|
207
|
+
`);class fr{static async create({sampleRate:t,format:n}){let r=null;try{r=new AudioContext({sampleRate:t});const a=r.createAnalyser(),i=r.createGain();i.connect(a),a.connect(r.destination),await dl(r.audioWorklet);const s=new AudioWorkletNode(r,"audio-concat-processor");return s.port.postMessage({type:"setFormat",format:n}),s.connect(i),await r.resume(),new fr(r,a,i,s)}catch(a){var o;throw(o=r)==null||o.close(),a}}constructor(t,n,r,o){this.context=void 0,this.analyser=void 0,this.gain=void 0,this.worklet=void 0,this.context=t,this.analyser=n,this.gain=r,this.worklet=o}async close(){await this.context.close()}}class pr extends zt{static async startSession(t){var n;const r=zt.getFullOptions(t);r.onStatusChange({status:"connecting"}),r.onCanSendFeedbackChange({canSendFeedback:!1});let o=null,a=null,i=null,s=null,l=null;if((n=t.useWakeLock)==null||n)try{l=await navigator.wakeLock.request("screen")}catch{}try{var c;return s=await navigator.mediaDevices.getUserMedia({audio:!0}),await ga(r.connectionDelay),a=await un.create(t),[o,i]=await Promise.all([dr.create(cn({},a.inputFormat,{preferHeadphonesForIosDevices:t.preferHeadphonesForIosDevices})),fr.create(a.outputFormat)]),(c=s)==null||c.getTracks().forEach(p=>p.stop()),s=null,new pr(r,a,o,i,l)}catch(p){var f,u,v,h;r.onStatusChange({status:"disconnected"}),(f=s)==null||f.getTracks().forEach(m=>m.stop()),(u=a)==null||u.close(),await((v=o)==null?void 0:v.close()),await((h=i)==null?void 0:h.close());try{var g;await((g=l)==null?void 0:g.release()),l=null}catch{}throw p}}constructor(t,n,r,o,a){super(t,n),this.input=void 0,this.output=void 0,this.wakeLock=void 0,this.inputFrequencyData=void 0,this.outputFrequencyData=void 0,this.onInputWorkletMessage=i=>{this.status==="connected"&&this.connection.sendMessage({user_audio_chunk:ll(i.data[0].buffer)})},this.onOutputWorkletMessage=({data:i})=>{i.type==="process"&&this.updateMode(i.finished?"listening":"speaking")},this.addAudioBase64Chunk=i=>{this.output.gain.gain.value=this.volume,this.output.worklet.port.postMessage({type:"clearInterrupted"}),this.output.worklet.port.postMessage({type:"buffer",buffer:cl(i)})},this.fadeOutAudio=()=>{this.updateMode("listening"),this.output.worklet.port.postMessage({type:"interrupt"}),this.output.gain.gain.exponentialRampToValueAtTime(1e-4,this.output.context.currentTime+2),setTimeout(()=>{this.output.gain.gain.value=this.volume,this.output.worklet.port.postMessage({type:"clearInterrupted"})},2e3)},this.calculateVolume=i=>{if(i.length===0)return 0;let s=0;for(let l=0;l<i.length;l++)s+=i[l]/255;return s/=i.length,s<0?0:s>1?1:s},this.input=r,this.output=o,this.wakeLock=a,this.input.worklet.port.onmessage=this.onInputWorkletMessage,this.output.worklet.port.onmessage=this.onOutputWorkletMessage}async handleEndSession(){await super.handleEndSession();try{var t;await((t=this.wakeLock)==null?void 0:t.release()),this.wakeLock=null}catch{}await this.input.close(),await this.output.close()}handleInterruption(t){super.handleInterruption(t),this.fadeOutAudio()}handleAudio(t){this.lastInterruptTimestamp<=t.audio_event.event_id&&(this.options.onAudio(t.audio_event.audio_base_64),this.addAudioBase64Chunk(t.audio_event.audio_base_64),this.currentEventId=t.audio_event.event_id,this.updateCanSendFeedback(),this.updateMode("speaking"))}setMicMuted(t){this.input.setMuted(t)}getInputByteFrequencyData(){return this.inputFrequencyData!=null||(this.inputFrequencyData=new Uint8Array(this.input.analyser.frequencyBinCount)),this.input.analyser.getByteFrequencyData(this.inputFrequencyData),this.inputFrequencyData}getOutputByteFrequencyData(){return this.outputFrequencyData!=null||(this.outputFrequencyData=new Uint8Array(this.output.analyser.frequencyBinCount)),this.output.analyser.getByteFrequencyData(this.outputFrequencyData),this.outputFrequencyData}getInputVolume(){return this.calculateVolume(this.getInputByteFrequencyData())}getOutputVolume(){return this.calculateVolume(this.getOutputByteFrequencyData())}}class fl extends zt{static startSession(t){return t.textOnly?cr.startSession(t):pr.startSession(t)}}function wa(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=wa(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Y(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=wa(e))&&(r&&(r+=" "),r+=t);return r}var pl=Object.defineProperty,hl=(e,t,n)=>t in e?pl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ue=(e,t,n)=>hl(e,typeof t!="symbol"?t+"":t,n);function mt(e){return e?e==="true"?!0:e==="false"?!1:null:null}const hr=["variant","placement","override-config","avatar-image-url","avatar-orb-color-1","avatar-orb-color-2","agent-id","signed-url","terms-key","server-location","language","dynamic-variables","show-avatar-when-collapsed","override-prompt","override-first-message","override-language","override-voice-id","override-text-only","mic-muting","transcript","text-input","text-contents"],vl='@import"https://fonts.googleapis.com/css2?family=Inter:wght@400,500&display=swap";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-auto{pointer-events:auto}.\\!visible{visibility:visible!important}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.-bottom-3{bottom:-12px}.bottom-0{bottom:0}.bottom-20{bottom:80px}.left-0{left:0}.left-1\\/2{left:50%}.left-4{left:16px}.right-0{right:0}.top-0{top:0}.top-1\\/2{top:50%}.top-20{top:80px}.top-4{top:16px}.z-1{z-index:1}.z-10{z-index:10}.m-1{margin:4px}.-mx-0\\.5{margin-left:-2px;margin-right:-2px}.mx-1{margin-left:4px;margin-right:4px}.-mr-1\\.5{margin-right:-6px}.ml-auto{margin-left:auto}.mt-2{margin-top:8px}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-11{height:44px}.h-16{height:64px}.h-4{height:16px}.h-48{height:192px}.h-5{height:20px}.h-6{height:24px}.h-9{height:36px}.h-\\[calc\\(100\\%-80px\\)\\]{height:calc(100% - 80px)}.h-full{height:100%}.h-screen{height:100vh}.max-h-\\[550px\\]{max-height:550px}.max-h-\\[8lh\\]{max-height:8lh}.max-h-\\[min\\(384px\\,var\\(--radix-select-content-available-height\\)\\)\\]{max-height:min(384px,var(--radix-select-content-available-height))}.min-h-min{min-height:-moz-min-content;min-height:min-content}.w-16{width:64px}.w-4{width:16px}.w-48{width:192px}.w-5{width:20px}.w-6{width:24px}.w-64{width:256px}.w-9{width:36px}.w-full{width:100%}.w-screen{width:100vw}.\\!min-w-60{min-width:240px!important}.min-w-0{min-width:0px}.min-w-60{min-width:240px}.min-w-9{min-width:36px}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.min-w-max{min-width:-moz-max-content;min-width:max-content}.min-w-min{min-width:-moz-min-content;min-width:min-content}.max-w-64{max-width:256px}.max-w-\\[400px\\]{max-width:400px}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.origin-bottom{transform-origin:bottom}.origin-bottom-left{transform-origin:bottom left}.origin-bottom-right{transform-origin:bottom right}.origin-top{transform-origin:top}.origin-top-left{transform-origin:top left}.origin-top-right{transform-origin:top right}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-\\[calc\\(var\\(--el-overlay-padding\\)\\)\\]{--tw-translate-y: calc(calc(var(--el-overlay-padding)) * -1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-1\\/2{--tw-translate-y: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[calc\\(var\\(--el-overlay-padding\\)\\)\\]{--tw-translate-y: calc(var(--el-overlay-padding));transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-180{--tw-rotate: -180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-150{--tw-scale-x: 1.5;--tw-scale-y: 1.5;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-75{--tw-scale-x: .75;--tw-scale-y: .75;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-90{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-\\[0\\.333\\]{--tw-scale-x: .333;--tw-scale-y: .333;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.gap-1{gap:4px}.gap-2{gap:8px}.gap-2\\.5{gap:10px}.gap-3{gap:12px}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-all{word-break:break-all}.rounded-\\[calc\\(var\\(--el-button-radius\\)\\+4px\\)\\]{border-radius:calc(var(--el-button-radius) + 4px)}.rounded-bubble{border-radius:var(--el-bubble-radius)}.rounded-button{border-radius:var(--el-button-radius)}.rounded-compact-sheet{border-radius:var(--el-compact-sheet-radius)}.rounded-dropdown-sheet{border-radius:var(--el-dropdown-sheet-radius)}.rounded-full{border-radius:9999px}.rounded-input{border-radius:var(--el-input-radius)}.rounded-sheet{border-radius:var(--el-sheet-radius)}.rounded-bl-\\[calc\\(var\\(--el-bubble-radius\\)\\/3\\)\\]{border-bottom-left-radius:calc(var(--el-bubble-radius) / 3)}.border{border-width:1px}.border-accent{border-color:var(--el-accent)}.border-base-border{border-color:var(--el-base-border)}.bg-accent{background-color:var(--el-accent)}.bg-base{background-color:var(--el-base)}.bg-base-active{background-color:var(--el-base-active)}.bg-base-border{background-color:var(--el-base-border)}.bg-base-hover{background-color:var(--el-base-hover)}.bg-cover{background-size:cover}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1{padding:4px}.p-1\\.5{padding:6px}.p-2{padding:8px}.p-3{padding:12px}.p-4{padding:16px}.px-1{padding-left:4px;padding-right:4px}.px-1\\.5{padding-left:6px;padding-right:6px}.px-2{padding-left:8px;padding-right:8px}.px-2\\.5{padding-left:10px;padding-right:10px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-8{padding-left:32px;padding-right:32px}.py-1\\.5{padding-top:6px;padding-bottom:6px}.py-2\\.5{padding-top:10px;padding-bottom:10px}.py-\\[calc\\(theme\\(spacing\\.2\\)-1px\\)\\]{padding-top:7px;padding-bottom:7px}.pb-1{padding-bottom:4px}.pb-3{padding-bottom:12px}.pl-16{padding-left:64px}.pr-16{padding-right:64px}.pr-3{padding-right:12px}.pt-1{padding-top:4px}.text-center{text-align:center}.text-\\[10px\\]{font-size:10px}.text-lg{font-size:18px;line-height:26px}.text-md{font-size:16px;line-height:24px}.text-sm{font-size:14px;line-height:20px}.text-xs{font-size:12px;line-height:16px}.font-medium{font-weight:500}.text-accent-primary{color:var(--el-accent-primary)}.text-base-error{color:var(--el-base-error)}.text-base-primary{color:var(--el-base-primary)}.text-base-subtle{color:var(--el-base-subtle)}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-30{opacity:.3}.shadow-lg{--tw-shadow: 0 2px 40px 1px rgba(0, 0, 0, .12);--tw-shadow-colored: 0 2px 40px 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 2px 24px 1px rgba(0, 0, 0, .16);--tw-shadow-colored: 0 2px 24px 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[border-radius\\]{transition-property:border-radius;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[margin\\]{transition-property:margin;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[opacity\\,transform\\]{transition-property:opacity,transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[opacity\\,width\\,height\\,transform\\,flex-grow\\]{transition-property:opacity,width,height,transform,flex-grow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[transform\\,left\\,top\\]{transition-property:transform,left,top;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[transform\\,opacity\\]{transition-property:transform,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.overlay{position:absolute;inset:var(--el-overlay-padding);right:calc(var(--el-overlay-padding) + var(--removed-body-scroll-bar-size, 0px))}.focus-ring{--tw-ring-color: var(--el-accent);--tw-ring-offset-width: 2px;--tw-ring-offset-color: var(--el-base)}.focus-ring:focus-visible{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.animate-text{background-image:linear-gradient(75deg,var(--el-base-primary),var(--el-base-subtle),var(--el-base-primary),var(--el-base-subtle));background-size:300% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;animation:TextAnimation 2s linear infinite}@keyframes TextAnimation{0%{background-position:0 0}to{background-position:100% 0}}.\\!terms h6,.terms h6{font-size:12px;line-height:16px;font-weight:500;color:var(--el-base-primary)}.\\!terms h5,.terms h5{font-size:14px;line-height:20px;font-weight:500;color:var(--el-base-primary)}.\\!terms h4,.terms h4{font-size:16px;line-height:24px;font-weight:500;color:var(--el-base-primary)}.\\!terms h3,.terms h3{font-size:18px;line-height:26px;font-weight:500;color:var(--el-base-primary)}.\\!terms h2,.terms h2{font-size:20px;line-height:28px;font-weight:500;color:var(--el-base-primary)}.\\!terms h2,.terms h2{font-size:24px;line-height:30px;font-weight:500;color:var(--el-base-primary)}.\\[field-sizing\\:content\\]{field-sizing:content}.\\[line-height\\:var\\(--el-overlay-padding\\)\\]{line-height:var(--el-overlay-padding)}.\\[overflow-wrap\\:break-word\\]{overflow-wrap:break-word}:host,:root{--el-base: #ffffff;--el-base-hover: #f9fafb;--el-base-active: #f3f4f6;--el-base-border: #e5e7eb;--el-base-subtle: #6b7280;--el-base-primary: #000000;--el-base-error: #ef4444;--el-accent: #000000;--el-accent-hover: #1f2937;--el-accent-active: #374151;--el-accent-border: #4b5563;--el-accent-subtle: #6b7280;--el-accent-primary: #ffffff;--el-overlay-padding: 32px;--el-button-radius: 18px;--el-input-radius: 10px;--el-bubble-radius: 15px;--el-sheet-radius: calc(var(--el-button-radius) + 6px);--el-compact-sheet-radius: calc(var(--el-button-radius) + 12px);--el-dropdown-sheet-radius: calc(var(--el-input-radius) + 6px)}.dev-host,:host{pointer-events:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;font-size:16px;line-height:24px;color:var(--el-base-primary);font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;scrollbar-color:#e5e7eb transparent}.placeholder\\:text-base-subtle::-moz-placeholder{color:var(--el-base-subtle)}.placeholder\\:text-base-subtle::placeholder{color:var(--el-base-subtle)}.hover\\:border-accent-hover:hover{border-color:var(--el-accent-hover)}.hover\\:bg-accent-hover:hover{background-color:var(--el-accent-hover)}.hover\\:bg-base-hover:hover{background-color:var(--el-base-hover)}.hover\\:opacity-50:hover{opacity:.5}.focus-visible\\:underline-offset-2:focus-visible{text-underline-offset:2px}.focus-visible\\:opacity-100:focus-visible{opacity:1}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.active\\:border-accent-active:active{border-color:var(--el-accent-active)}.active\\:bg-accent-active:active{background-color:var(--el-accent-active)}.active\\:bg-base-active:active{background-color:var(--el-base-active)}.data-hidden\\:-translate-y-4[data-shown=false]{--tw-translate-y: -16px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-hidden\\:translate-y-2[data-shown=false]{--tw-translate-y: 8px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-hidden\\:scale-100[data-shown=false]{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-hidden\\:scale-75[data-shown=false]{--tw-scale-x: .75;--tw-scale-y: .75;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-hidden\\:scale-90[data-shown=false]{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-hidden\\:opacity-0[data-shown=false]{opacity:0}.data-\\[highlighted\\]\\:bg-base-active[data-highlighted]{background-color:var(--el-base-active)}',ml=tn(function(){return d("style",{children:vl})});function Ce(e){const t=We(e);if(t==null)throw new Error(`${e.displayName} cannot be used outside of provider`);return t}const ya=ie(null);function gl({value:e,children:t}){const n=B(()=>Object.fromEntries(hr.map(r=>[r,ve(e[r])])),[]);return hr.forEach(r=>{n[r].value=e[r]}),d(ya.Provider,{value:n,children:t})}function _l(){return Ce(ya)}function q(e){return _l()[e]}const Ut={en:{name:"English",flagCode:"us",languageCode:"en"},zh:{name:"中文",flagCode:"cn",languageCode:"zh"},es:{name:"Español",flagCode:"es",languageCode:"es"},hi:{name:"हिन्दी",flagCode:"in",languageCode:"hi"},pt:{name:"Português (Portugal)",flagCode:"pt",languageCode:"pt"},"pt-br":{name:"Português (Brasil)",flagCode:"br",languageCode:"pt-br"},fr:{name:"Français",flagCode:"fr",languageCode:"fr"},de:{name:"Deutsch",flagCode:"de",languageCode:"de"},ja:{name:"日本語",flagCode:"jp",languageCode:"ja"},ar:{name:"العربية",flagCode:"ae",languageCode:"ar"},ru:{name:"Русский",flagCode:"ru",languageCode:"ru"},ko:{name:"한국어",flagCode:"kr",languageCode:"ko"},id:{name:"Bahasa Indonesia",flagCode:"id",languageCode:"id"},it:{name:"Italiano",flagCode:"it",languageCode:"it"},nl:{name:"Nederlands",flagCode:"nl",languageCode:"nl"},tr:{name:"Türkçe",flagCode:"tr",languageCode:"tr"},pl:{name:"Polski",flagCode:"pl",languageCode:"pl"},sv:{name:"Svenska",flagCode:"se",languageCode:"sv"},ms:{name:"Bahasa Melayu",flagCode:"my",languageCode:"ms"},ro:{name:"Română",flagCode:"ro",languageCode:"ro"},uk:{name:"Українська",flagCode:"ua",languageCode:"uk"},el:{name:"Ελληνικά",flagCode:"gr",languageCode:"el"},cs:{name:"Čeština",flagCode:"cz",languageCode:"cs"},da:{name:"Dansk",flagCode:"dk",languageCode:"da"},fi:{name:"Suomi",flagCode:"fi",languageCode:"fi"},bg:{name:"Български",flagCode:"bg",languageCode:"bg"},hr:{name:"Hrvatski",flagCode:"hr",languageCode:"hr"},sk:{name:"Slovenčina",flagCode:"sk",languageCode:"sk"},ta:{name:"தமிழ்",flagCode:"in",languageCode:"ta"},hu:{name:"Magyar",flagCode:"hu",languageCode:"hu"},no:{name:"Norsk",flagCode:"no",languageCode:"no"},vi:{name:"Tiếng Việt",flagCode:"vn",languageCode:"vi"}};function vr(e){return Object.keys(Ut).includes(e??"")}const ba=["tiny","compact","full"];function wl(e){return ba.includes(e)?e:ba[0]}const yl=["top-left","top","top-right","bottom-left","bottom","bottom-right"];function bl(e){return yl.includes(e)?e:"bottom-right"}const xa={main_label:"Need help?",start_call:"Start a call",start_chat:"Start a chat",new_call:"New call",end_call:"End",mute_microphone:"Mute microphone",change_language:"Change language",collapse:"Collapse",expand:"Expand",copied:"Copied!",accept_terms:"Accept",dismiss_terms:"Cancel",listening_status:"Listening",speaking_status:"Talk to interrupt",connecting_status:"Connecting",chatting_status:"Chatting with AI Agent",input_label:"Text message input",input_placeholder:"Send a message",input_placeholder_text_only:"Send a message",input_placeholder_new_conversation:"Start a new conversation",user_ended_conversation:"You ended the conversation",agent_ended_conversation:"The agent ended the conversation",conversation_id:"ID",error_occurred:"An error occurred",copy_id:"Copy ID"},xl=Object.keys(xa),Ca=ie(null);function Cl({children:e}){const t=q("server-location"),n=B(()=>{const r=me(()=>kl(t.value));return{location:r,serverUrl:me(()=>r.value==="us"?"https://api.us.elevenlabs.io":"https://api.elevenlabs.io"),webSocketUrl:me(()=>r.value==="us"?"wss://api.us.elevenlabs.io":"wss://api.elevenlabs.io")}},[]);return d(Ca.Provider,{value:n,children:e})}function ka(){return Ce(Ca)}function kl(e="us"){switch(e){case"us":case"global":return e;default:return console.warn(`[ConversationalAI] Invalid server-location: ${e}. Defaulting to "us"`),"us"}}const Sa=ie(null);function Sl({children:e}){const t=ce(),n=Q(()=>t.value.mic_muting_enabled??!1),r=xe(!1),o=B(()=>({isMuted:me(()=>n.value?r.value:!1),setIsMuted:a=>{r.value=a},isMutingEnabled:n}),[]);return d(Sa.Provider,{value:o,children:e})}function Ea(){return Ce(Sa)}const Ta=ie(null);function El({children:e}){const{language:t}=gt(),n=q("override-prompt"),r=q("override-first-message"),o=q("override-voice-id"),a=q("override-text-only"),i=Q(()=>({agent:{prompt:{prompt:n.value},firstMessage:r.value,language:t.value.languageCode},tts:{voiceId:o.value},conversation:{textOnly:mt(a.value)??void 0}})),s=q("dynamic-variables"),l=Q(()=>{if(s.value)try{return JSON.parse(s.value)}catch(g){console.error(`[ConversationalAI] Cannot parse dynamic-variables: ${g==null?void 0:g.message}`)}}),{webSocketUrl:c}=ka(),f=q("agent-id"),u=q("signed-url"),v=mr(),h=Q(()=>{const g={dynamicVariables:l.value,overrides:i.value,connectionDelay:{default:300},textOnly:v.value};return f.value?{agentId:f.value,origin:c.value,...g}:u.value?{signedUrl:u.value,...g}:(console.error("[ConversationalAI] Either agent-id or signed-url is required"),null)});return h.value?d(Ta.Provider,{value:h,children:e}):null}function Tl(){return Ce(Ta)}const Na=ie(null);function Nl({children:e}){const t=ce(),n=B(()=>{const r=t.peek().terms_key,o=r?!!localStorage.getItem(r):!1,a=ve(!1),i=ve(o),s=me(()=>!t.value.terms_html||i.value);let l=[];return{termsShown:a,termsAccepted:s,dismissTerms:()=>{a.value=!1,l.forEach(c=>c.reject()),l=[]},acceptTerms:()=>{i.value=!0,a.value=!1;const c=t.peek().terms_key;c&&localStorage.setItem(c,"true"),l.forEach(f=>f.resolve()),l=[]},requestTerms:async()=>{s.peek()||(a.value=!0,await new Promise((c,f)=>{l.push({resolve:c,reject:f})}))}}},[]);return d(Na.Provider,{value:n,children:e})}function dn(){return Ce(Na)}const Pa=ie(null);function Pl({children:e}){const t=Al();return je(()=>{if(t.conversationTextOnly.value===!0){t.transcript.value;const n=setTimeout(()=>{t.endSession()},10*60*1e3);return()=>{clearTimeout(n)}}}),d(Pa.Provider,{value:t,children:e})}function de(){return Ce(Pa)}function Al(){const e=E(null),t=E(null),n=ce(),r=$a(),o=dn(),a=Tl(),{isMuted:i}=Ea();return je(()=>{var s;i.value&&((s=e==null?void 0:e.current)==null||s.setMicMuted(i.value))}),A(()=>()=>{var s;(s=e.current)==null||s.endSession()},[]),B(()=>{const s=ve("disconnected"),l=me(()=>s.value==="disconnected"),c=ve("listening"),f=me(()=>c.value==="speaking"),u=ve(null),v=ve(null),h=ve(!1),g=ve([]),p=ve(0),m=ve(null);return{status:s,isSpeaking:f,mode:c,isDisconnected:l,lastId:v,error:u,canSendFeedback:h,conversationIndex:p,conversationTextOnly:m,transcript:g,startSession:async(_,w)=>{var y,b;if(await o.requestTerms(),(y=e.current)!=null&&y.isOpen())return e.current.getId();if(t.current)return(await t.current).getId();let C=structuredClone(a.peek());w&&n.value.supports_text_only&&(C.textOnly=!0,n.value.text_only||(C.overrides??(C.overrides={}),(b=C.overrides).conversation??(b.conversation={}),C.overrides.conversation.textOnly=!0));try{C=$l(_,C)}catch(k){console.error("[ConversationalAI] Error triggering call event:",k)}m.value=C.textOnly??!1,g.value=w?[{type:"message",role:"user",message:w,isText:!0,conversationIndex:p.peek()}]:[];try{if(t.current=fl.startSession({...C,onModeChange:x=>{c.value=x.mode},onStatusChange:x=>{s.value=x.status},onCanSendFeedbackChange:x=>{h.value=x.canSendFeedback},onMessage:({source:x,message:P})=>{m.peek()===!0&&x==="ai"&&P===r.peek()||(g.value=[...g.value,{type:"message",role:x,message:P,isText:!1,conversationIndex:p.peek()}])},onDisconnect:x=>{m.value=null,g.value=[...g.value,x.reason==="error"?{type:"error",message:x.message,conversationIndex:p.peek()}:{type:"disconnection",role:x.reason==="user"?"user":"ai",conversationIndex:p.peek()}],p.value++,x.reason==="error"&&(u.value=x.message,console.error("[ConversationalAI] Disconnected due to an error:",x.message))}}),e.current=await t.current,i.peek()!==void 0&&e.current.setMicMuted(i.peek()),w){const x=e.current;setTimeout(()=>x.sendUserMessage(w),100)}const k=e.current.getId();return v.value=k,u.value=null,k}catch(k){let x="Could not start a conversation.";k instanceof CloseEvent?x=k.reason||x:k instanceof Error&&(x=k.message||x),u.value=x,g.value=[...g.value,{type:"error",message:x,conversationIndex:p.peek()}]}finally{t.current=null}},endSession:async()=>{const _=e.current;e.current=null,await(_==null?void 0:_.endSession())},getInputVolume:()=>{var _;return((_=e.current)==null?void 0:_.getInputVolume())??0},getOutputVolume:()=>{var _;return((_=e.current)==null?void 0:_.getOutputVolume())??0},sendFeedback:_=>{var w;(w=e.current)==null||w.sendFeedback(_)},sendUserMessage:_=>{var w;(w=e.current)==null||w.sendUserMessage(_),g.value=[...g.value,{type:"message",role:"user",message:_,isText:!0,conversationIndex:p.peek()}]},sendUserActivity:()=>{var _;(_=e.current)==null||_.sendUserActivity()}}},[a,i])}function $l(e,t){try{const n=new CustomEvent("elevenlabs-convai:call",{bubbles:!0,composed:!0,detail:{config:t}});return e.dispatchEvent(n),n.detail.config}catch(n){return console.error("[ConversationalAI] Could not trigger call event:",n),t}}const Aa=ie(null);function Il({children:e}){const{serverUrl:t}=ka(),n=q("agent-id"),r=q("override-config"),o=xe(null);je(()=>{if(r.value)try{const g=JSON.parse(r.value);if(g){o.value=g;return}}catch(g){console.error(`[ConversationalAI] Cannot parse override-config: ${g==null?void 0:g.message}`)}if(!n.value){o.value=null;return}const h=new AbortController;return Dl(n.value,t.value,h.signal).then(g=>{h.signal.aborted||(o.value=g)}).catch(g=>{console.error(`[ConversationalAI] Cannot fetch config for agent ${n.value}: ${g==null?void 0:g.message}`),h.signal.aborted||(o.value=null)}),()=>{h.abort()}});const a=q("variant"),i=q("placement"),s=q("terms-key"),l=q("mic-muting"),c=q("transcript"),f=q("text-input"),u=q("override-text-only"),v=Q(()=>{if(!o.value)return null;const h=a.value??o.value.variant,g=i.value??o.value.placement,p=s.value??o.value.terms_key,m=mt(u.value)??o.value.text_only??!1,_=mt(l.value)??o.value.mic_muting_enabled,w=mt(c.value)??o.value.transcript_enabled,y=mt(f.value)??o.value.text_input_enabled;return{...o.value,variant:wl(h),placement:bl(g),terms_key:p,mic_muting_enabled:!m&&_,transcript_enabled:m||w,text_input_enabled:m||y}});return v.value?d(Aa.Provider,{value:v,children:e}):null}function ce(){return Ce(Aa)}function mr(){const e=q("override-text-only"),t=ce();return Q(()=>mt(e.value)??t.value.text_only??!1)}function fn(){const e=mr(),{conversationTextOnly:t}=de();return Q(()=>t.value??e.value)}function $a(){const e=q("override-first-message"),t=ce(),{language:n}=gt();return Q(()=>{var r,o;return e.value??((o=(r=t.value.language_presets)==null?void 0:r[n.value.languageCode])==null?void 0:o.first_message)??t.value.first_message??null})}async function Dl(e,t,n){const r=await(await fetch(`${t}/v1/convai/agents/${e}/widget`,{signal:n})).json();if(!r.widget_config)throw new Error("Response does not contain widget_config");return r.widget_config}const Ia=ie(null);function Ml({children:e}){const t=ce(),n=q("language"),r=q("override-language"),o=xe(n.peek()??t.peek().language),a=Q(()=>(t.value.supported_language_overrides??[]).filter(vr)),i=Q(()=>a.value.map(l=>Ut[l]).sort((l,c)=>l.name.localeCompare(c.name))),s=B(()=>({language:me(()=>vr(r.value)?Ut[r.value]:vr(o.value)&&a.value.includes(o.value)?Ut[o.value]:Ut[t.value.language]),setLanguage:l=>{o.value=l},options:i,showPicker:me(()=>i.value.length>0)}),[]);return d(Ia.Provider,{value:s,children:e})}function gt(){return Ce(Ia)}const Da=ie(null);function Ol({children:e}){const t=ce(),{language:n}=gt(),r=q("text-contents"),o=Q(()=>{try{if(r.value){const i=JSON.parse(r.value);if(typeof i=="object")return i}}catch(i){console.error("[ConversationalAI] Cannot parse text-contents:",i)}return{}}),a=B(()=>Object.fromEntries(xl.map(i=>[i,me(()=>{var s,l,c,f;return o.value[i]??((c=(l=(s=t.value.language_presets)==null?void 0:s[n.value.languageCode])==null?void 0:l.text_contents)==null?void 0:c[i])??((f=t.value.text_contents)==null?void 0:f[i])??xa[i]})])),[]);return d(Da.Provider,{value:a,children:e})}function fe(){return Ce(Da)}const Ma=ie(null);function Ll({children:e}){const t=ce(),n=q("avatar-image-url"),r=q("avatar-orb-color-1"),o=q("avatar-orb-color-2"),a=xe(""),i=Q(()=>n.value?{type:"image",url:n.value}:r.value&&o.value?{type:"orb",color_1:r.value,color_2:o.value}:t.value.avatar),s=Q(()=>{switch(i.value.type){case"url":return i.value.custom_url;case"orb":return a.value;case"image":return i.value.url}}),l=B(()=>({config:i,previewUrl:s,canvasUrl:a}),[]);return d(Ma.Provider,{value:l,children:e})}function gr(){return Ce(Ma)}const Oa=ie(null);function pn({children:e,...t}){const[n,r]=S(null);return d("div",{ref:r,...t,children:n&&d(Oa.Provider,{value:n,children:e})})}function Rl(){return Ce(Oa)}function _r(e){return e&&typeof e=="object"&&"peek"in e}function Fl(e){const t=_r(e),n=xe(t?e.peek():e);return t?e:(n.value=e,n)}function La(e){return _r(e)?e.value:e}function zl(e){return _r(e)?e.peek():e}function Ra(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Fa(...e){return t=>{let n=!1;const r=e.map(o=>{const a=Ra(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():Ra(e[o],null)}}}}function le(...e){return $(Fa(...e),e)}function Bt(e){const t=Ul(e),n=I((r,o)=>{const{children:a,...i}=r,s=He.toArray(a),l=s.find(Wl);if(l){const c=l.props.children,f=s.map(u=>u===l?He.count(c)>1?He.only(null):Le(c)?c.props.children:null:u);return d(t,{...i,ref:o,children:Le(c)?Lt(c,void 0,f):null})}return d(t,{...i,ref:o,children:a})});return n.displayName=`${e}.Slot`,n}var za=Bt("Slot");function Ul(e){const t=I((n,r)=>{const{children:o,...a}=n;if(Le(o)){const i=Vl(o),s=Hl(a,o.props);return o.type!==ee&&(s.ref=r?Fa(r,i):i),Lt(o,s)}return He.count(o)>1?He.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Bl=Symbol("radix.slottable");function Wl(e){return Le(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Bl}function Hl(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...i)=>{a(...i),o(...i)}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function Vl(e){var t,n;let r=(t=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?e.ref:(r=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}const wr=window.matchMedia("(prefers-reduced-motion: reduce)");function Ua(){const e=xe(wr.matches);return A(()=>{const t=n=>{e.value=n.matches};return wr.addEventListener("change",t),()=>wr.removeEventListener("change",t)},[]),e}function Ba({onStart:e,onEnd:t}){const n=E();n.current??(n.current=new Set);const r=E(e);r.current=e;const o=E(t);o.current=t;const a=xe(!1),i=$(l=>{var c,f;l.target===l.currentTarget&&((c=n.current)==null||c.add(l.propertyName),a.peek()||(a.value=!0,(f=r.current)==null||f.call(r)))},[]),s=$(l=>{var c,f,u;l.target===l.currentTarget&&((c=n.current)==null||c.delete(l.propertyName),(f=n.current)!=null&&f.size||(a.value=!1,(u=o.current)==null||u.call(o)))},[]);return{transitioning:a,handlers:{onTransitionStart:i,onTransitionEnd:s}}}function ke(e){const t=Ua().value?jl:Yl;return d(t,{...e})}function jl({active:e,...t}){return La(e)?d(za,{"data-shown":!0,...t}):null}function Yl({active:e,initial:t=e,...n}){const r=Fl(e),o=xe(zl(t));je(()=>{r.value&&(o.value=r.value)});const{handlers:a}=Ba({onEnd:()=>{o.value=r.value}});return!r.value&&!o.value?null:d(za,{"data-shown":r.value&&o.value,...a,...n})}const ql=`#version 300 es
|
|
208
208
|
precision highp float;
|
|
209
209
|
|
|
210
210
|
uniform float uTime;
|
|
@@ -419,4 +419,4 @@ void main() {
|
|
|
419
419
|
`)},Bi=function(){var e=parseInt(document.body.getAttribute(St)||"0",10);return isFinite(e)?e:0},Sd=function(){A(function(){return document.body.setAttribute(St,(Bi()+1).toString()),function(){var e=Bi()-1;e<=0?document.body.removeAttribute(St):document.body.setAttribute(St,e.toString())}},[])},Ed=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Sd();var a=B(function(){return xd(o)},[o]);return K(Cd,{styles:kd(a,!t,o,n?"":"!important")})},jr=!1;if(typeof window<"u")try{var Nn=Object.defineProperty({},"passive",{get:function(){return jr=!0,!0}});window.addEventListener("test",Nn,Nn),window.removeEventListener("test",Nn,Nn)}catch{jr=!1}var Et=jr?{passive:!1}:!1,Td=function(e){return e.tagName==="TEXTAREA"},Wi=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Td(e)&&n[t]==="visible")},Nd=function(e){return Wi(e,"overflowY")},Pd=function(e){return Wi(e,"overflowX")},Hi=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Vi(e,r);if(o){var a=ji(e,r),i=a[1],s=a[2];if(i>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ad=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},$d=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Vi=function(e,t){return e==="v"?Nd(t):Pd(t)},ji=function(e,t){return e==="v"?Ad(t):$d(t)},Id=function(e,t){return e==="h"&&t==="rtl"?-1:1},Dd=function(e,t,n,r,o){var a=Id(e,window.getComputedStyle(t).direction),i=a*r,s=n.target,l=t.contains(s),c=!1,f=i>0,u=0,v=0;do{var h=ji(e,s),g=h[0],p=h[1],m=h[2],_=p-m-a*g;(g||_)&&Vi(e,s)&&(u+=_,v+=g),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(f&&Math.abs(u)<1||!f&&Math.abs(v)<1)&&(c=!0),c},Pn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Yi=function(e){return[e.deltaX,e.deltaY]},qi=function(e){return e&&"current"in e?e.current:e},Md=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Od=function(e){return`
|
|
420
420
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
421
421
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
422
|
-
`)},Ld=0,Tt=[];function Rd(e){var t=E([]),n=E([0,0]),r=E(),o=S(Ld++)[0],a=S(Ui)[0],i=E(e);A(function(){i.current=e},[e]),A(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=od([e.lockRef.current],(e.shards||[]).map(qi)).filter(Boolean);return p.forEach(function(m){return m.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=$(function(p,m){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var _=Pn(p),w=n.current,y="deltaX"in p?p.deltaX:w[0]-_[0],b="deltaY"in p?p.deltaY:w[1]-_[1],C,k=p.target,x=Math.abs(y)>Math.abs(b)?"h":"v";if("touches"in p&&x==="h"&&k.type==="range")return!1;var P=Hi(x,k);if(!P)return!0;if(P?C=x:(C=x==="v"?"h":"v",P=Hi(x,k)),!P)return!1;if(!r.current&&"changedTouches"in p&&(y||b)&&(r.current=C),!C)return!0;var D=r.current||C;return Dd(D,m,p,D==="h"?y:b)},[]),l=$(function(p){var m=p;if(!(!Tt.length||Tt[Tt.length-1]!==a)){var _="deltaY"in m?Yi(m):Pn(m),w=t.current.filter(function(C){return C.name===m.type&&(C.target===m.target||m.target===C.shadowParent)&&Md(C.delta,_)})[0];if(w&&w.should){m.cancelable&&m.preventDefault();return}if(!w){var y=(i.current.shards||[]).map(qi).filter(Boolean).filter(function(C){return C.contains(m.target)}),b=y.length>0?s(m,y[0]):!i.current.noIsolation;b&&m.cancelable&&m.preventDefault()}}},[]),c=$(function(p,m,_,w){var y={name:p,delta:m,target:_,should:w,shadowParent:Fd(_)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(b){return b!==y})},1)},[]),f=$(function(p){n.current=Pn(p),r.current=void 0},[]),u=$(function(p){c(p.type,Yi(p),p.target,s(p,e.lockRef.current))},[]),v=$(function(p){c(p.type,Pn(p),p.target,s(p,e.lockRef.current))},[]);A(function(){return Tt.push(a),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:v}),document.addEventListener("wheel",l,Et),document.addEventListener("touchmove",l,Et),document.addEventListener("touchstart",f,Et),function(){Tt=Tt.filter(function(p){return p!==a}),document.removeEventListener("wheel",l,Et),document.removeEventListener("touchmove",l,Et),document.removeEventListener("touchstart",f,Et)}},[]);var h=e.removeScrollBar,g=e.inert;return K(ee,null,g?K(a,{styles:Od(o)}):null,h?K(Ed,{gapMode:e.gapMode}):null)}function Fd(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const zd=pd(zi,Rd);var Xi=I(function(e,t){return K(Tn,Ie({},e,{ref:t,sideCar:zd}))});Xi.classNames=Tn.classNames;var Ud=[" ","Enter","ArrowUp","ArrowDown"],Bd=[" ","Enter"],at="Select",[An,$n,Wd]=hc(at),[Nt,jf]=br(at,[Wd,Ci]),In=Ci(),[Hd,Ze]=Nt(at),[Vd,jd]=Nt(at),Ki=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:a,value:i,defaultValue:s,onValueChange:l,dir:c,name:f,autoComplete:u,disabled:v,required:h,form:g}=e,p=In(t),[m,_]=S(null),[w,y]=S(null),[b,C]=S(!1),k=mc(c),[x,P]=Di({prop:r,defaultProp:o??!1,onChange:a,caller:at}),[D,F]=Di({prop:i,defaultProp:s,onChange:l,caller:at}),O=E(null),L=m?g||!!m.closest("form"):!0,[X,z]=S(new Set),ne=Array.from(X).map(R=>R.props.value).join(";");return d(Hu,{...p,children:d(Hd,{required:h,scope:t,trigger:m,onTriggerChange:_,valueNode:w,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:C,contentId:Er(),value:D,onValueChange:F,open:x,onOpenChange:P,dir:k,triggerPointerDownPosRef:O,disabled:v,children:[d(An.Provider,{scope:t,children:d(Vd,{scope:e.__scopeSelect,onNativeOptionAdd:$(R=>{z(V=>new Set(V).add(R))},[]),onNativeOptionRemove:$(R=>{z(V=>{const M=new Set(V);return M.delete(R),M})},[]),children:n})}),L?d(ms,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:u,value:D,onChange:R=>F(R.target.value),disabled:v,form:g,children:[D===void 0?d("option",{value:""}):null,Array.from(X)]},ne):null]})})};Ki.displayName=at;var Gi="SelectTrigger",Zi=I((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,a=In(n),i=Ze(Gi,n),s=i.disabled||r,l=le(t,i.onTriggerChange),c=$n(n),f=E("touch"),[u,v,h]=_s(p=>{const m=c().filter(y=>!y.disabled),_=m.find(y=>y.value===i.value),w=ws(m,p,_);w!==void 0&&i.onValueChange(w.value)}),g=p=>{s||(i.onOpenChange(!0),h()),p&&(i.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d(Vu,{asChild:!0,...a,children:d(te.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":gs(i.value)?"":void 0,...o,ref:l,onClick:oe(o.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&g(p)}),onPointerDown:oe(o.onPointerDown,p=>{f.current=p.pointerType;const m=p.target;m.hasPointerCapture(p.pointerId)&&m.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(g(p),p.preventDefault())}),onKeyDown:oe(o.onKeyDown,p=>{const m=u.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&v(p.key),!(m&&p.key===" ")&&Ud.includes(p.key)&&(g(),p.preventDefault())})})})});Zi.displayName=Gi;var Ji="SelectValue",Yd=I((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:i="",...s}=e,l=Ze(Ji,n),{onValueNodeHasChildrenChange:c}=l,f=a!==void 0,u=le(t,l.onValueNodeChange);return pe(()=>{c(f)},[c,f]),d(te.span,{...s,ref:u,style:{pointerEvents:"none"},children:gs(l.value)?d(ee,{children:i}):a})});Yd.displayName=Ji;var qd="SelectIcon",Qi=I((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return d(te.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Qi.displayName=qd;var Xd="SelectPortal",es=e=>d(Ii,{asChild:!0,...e});es.displayName=Xd;var it="SelectContent",ts=I((e,t)=>{const n=Ze(it,e.__scopeSelect),[r,o]=S();if(pe(()=>{o(new DocumentFragment)},[]),!n.open){const a=r;return a?nn(d(ns,{scope:e.__scopeSelect,children:d(An.Slot,{scope:e.__scopeSelect,children:d("div",{children:e.children})})}),a):null}return d(rs,{...e,ref:t})});ts.displayName=it;var Te=10,[ns,Je]=Nt(it),Kd="SelectContentImpl",Gd=Bt("SelectContent.RemoveScroll"),rs=I((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:i,side:s,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:v,collisionPadding:h,sticky:g,hideWhenDetached:p,avoidCollisions:m,..._}=e,w=Ze(it,n),[y,b]=S(null),[C,k]=S(null),x=le(t,N=>b(N)),[P,D]=S(null),[F,O]=S(null),L=$n(n),[X,z]=S(!1),ne=E(!1);A(()=>{if(y)return rd(y)},[y]),Tc();const R=$(N=>{const[G,...re]=L().map(ae=>ae.ref.current),[U]=re.slice(-1),J=document.activeElement;for(const ae of N)if(ae===J||(ae==null||ae.scrollIntoView({block:"nearest"}),ae===G&&C&&(C.scrollTop=0),ae===U&&C&&(C.scrollTop=C.scrollHeight),ae==null||ae.focus(),document.activeElement!==J))return},[L,C]),V=$(()=>R([P,y]),[R,P,y]);A(()=>{X&&V()},[X,V]);const{onOpenChange:M,triggerPointerDownPosRef:j}=w;A(()=>{if(y){let N={x:0,y:0};const G=U=>{var J,ae;N={x:Math.abs(Math.round(U.pageX)-(((J=j.current)==null?void 0:J.x)??0)),y:Math.abs(Math.round(U.pageY)-(((ae=j.current)==null?void 0:ae.y)??0))}},re=U=>{N.x<=10&&N.y<=10?U.preventDefault():y.contains(U.target)||M(!1),document.removeEventListener("pointermove",G),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",G),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",re,{capture:!0})}}},[y,M,j]),A(()=>{const N=()=>M(!1);return window.addEventListener("blur",N),window.addEventListener("resize",N),()=>{window.removeEventListener("blur",N),window.removeEventListener("resize",N)}},[M]);const[he,st]=_s(N=>{const G=L().filter(J=>!J.disabled),re=G.find(J=>J.ref.current===document.activeElement),U=ws(G,N,re);U&&setTimeout(()=>U.ref.current.focus())}),Yt=$((N,G,re)=>{const U=!ne.current&&!re;(w.value!==void 0&&w.value===G||U)&&(D(N),U&&(ne.current=!0))},[w.value]),Qe=$(()=>y==null?void 0:y.focus(),[y]),we=$((N,G,re)=>{const U=!ne.current&&!re;(w.value!==void 0&&w.value===G||U)&&O(N)},[w.value]),lt=r==="popper"?Yr:os,ct=lt===Yr?{side:s,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:v,collisionPadding:h,sticky:g,hideWhenDetached:p,avoidCollisions:m}:{};return d(ns,{scope:n,content:y,viewport:C,onViewportChange:k,itemRefCallback:Yt,selectedItem:P,onItemLeave:Qe,itemTextRefCallback:we,focusSelectedItem:V,selectedItemText:F,position:r,isPositioned:X,searchRef:he,children:d(Xi,{as:Gd,allowPinchZoom:!0,children:d(Ja,{asChild:!0,trapped:w.open,onMountAutoFocus:N=>{N.preventDefault()},onUnmountAutoFocus:oe(o,N=>{var G;(G=w.trigger)==null||G.focus({preventScroll:!0}),N.preventDefault()}),children:d(qa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:N=>N.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:d(lt,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:N=>N.preventDefault(),..._,...ct,onPlaced:()=>z(!0),ref:x,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:oe(_.onKeyDown,N=>{const G=N.ctrlKey||N.altKey||N.metaKey;if(N.key==="Tab"&&N.preventDefault(),!G&&N.key.length===1&&st(N.key),["ArrowUp","ArrowDown","Home","End"].includes(N.key)){let re=L().filter(U=>!U.disabled).map(U=>U.ref.current);if(["ArrowUp","End"].includes(N.key)&&(re=re.slice().reverse()),["ArrowUp","ArrowDown"].includes(N.key)){const U=N.target,J=re.indexOf(U);re=re.slice(J+1)}setTimeout(()=>R(re)),N.preventDefault()}})})})})})})});rs.displayName=Kd;var Zd="SelectItemAlignedPosition",os=I((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,a=Ze(it,n),i=Je(it,n),[s,l]=S(null),[c,f]=S(null),u=le(t,x=>f(x)),v=$n(n),h=E(!1),g=E(!0),{viewport:p,selectedItem:m,selectedItemText:_,focusSelectedItem:w}=i,y=$(()=>{if(a.trigger&&a.valueNode&&s&&c&&p&&m&&_){const x=a.trigger.getBoundingClientRect(),P=c.getBoundingClientRect(),D=a.valueNode.getBoundingClientRect(),F=_.getBoundingClientRect();if(a.dir!=="rtl"){const U=F.left-P.left,J=D.left-U,ae=x.left-J,ye=x.width+ae,qt=Math.max(ye,P.width),Xt=window.innerWidth-Te,Kt=Va(J,[Te,Math.max(Te,Xt-qt)]);s.style.minWidth=ye+"px",s.style.left=Kt+"px"}else{const U=P.right-F.right,J=window.innerWidth-D.right-U,ae=window.innerWidth-x.right-J,ye=x.width+ae,qt=Math.max(ye,P.width),Xt=window.innerWidth-Te,Kt=Va(J,[Te,Math.max(Te,Xt-qt)]);s.style.minWidth=ye+"px",s.style.right=Kt+"px"}const O=v(),L=window.innerHeight-Te*2,X=p.scrollHeight,z=window.getComputedStyle(c),ne=parseInt(z.borderTopWidth,10),R=parseInt(z.paddingTop,10),V=parseInt(z.borderBottomWidth,10),M=parseInt(z.paddingBottom,10),j=ne+R+X+M+V,he=Math.min(m.offsetHeight*5,j),st=window.getComputedStyle(p),Yt=parseInt(st.paddingTop,10),Qe=parseInt(st.paddingBottom,10),we=x.top+x.height/2-Te,lt=L-we,ct=m.offsetHeight/2,N=m.offsetTop+ct,G=ne+R+N,re=j-G;if(G<=we){const U=O.length>0&&m===O[O.length-1].ref.current;s.style.bottom="0px";const J=c.clientHeight-p.offsetTop-p.offsetHeight,ae=Math.max(lt,ct+(U?Qe:0)+J+V),ye=G+ae;s.style.height=ye+"px"}else{const U=O.length>0&&m===O[0].ref.current;s.style.top="0px";const J=Math.max(we,ne+p.offsetTop+(U?Yt:0)+ct)+re;s.style.height=J+"px",p.scrollTop=G-we+p.offsetTop}s.style.margin=`${Te}px 0`,s.style.minHeight=he+"px",s.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[v,a.trigger,a.valueNode,s,c,p,m,_,a.dir,r]);pe(()=>y(),[y]);const[b,C]=S();pe(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const k=$(x=>{x&&g.current===!0&&(y(),w==null||w(),g.current=!1)},[y,w]);return d(Qd,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:k,children:d("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:d(te.div,{...o,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});os.displayName=Zd;var Jd="SelectPopperPosition",Yr=I((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Te,...a}=e,i=In(n);return d(ju,{...i,...a,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Yr.displayName=Jd;var[Qd,qr]=Nt(it,{}),Xr="SelectViewport",as=I((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,a=Je(Xr,n),i=qr(Xr,n),s=le(t,a.onViewportChange),l=E(0);return d(ee,{children:[d("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),d(An.Slot,{scope:n,children:d(te.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:oe(o.onScroll,c=>{const f=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:v}=i;if(v!=null&&v.current&&u){const h=Math.abs(l.current-f.scrollTop);if(h>0){const g=window.innerHeight-Te*2,p=parseFloat(u.style.minHeight),m=parseFloat(u.style.height),_=Math.max(p,m);if(_<g){const w=_+h,y=Math.min(g,w),b=w-y;u.style.height=y+"px",u.style.bottom==="0px"&&(f.scrollTop=b>0?b:0,u.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});as.displayName=Xr;var is="SelectGroup",[ef,tf]=Nt(is),nf=I((e,t)=>{const{__scopeSelect:n,...r}=e,o=Er();return d(ef,{scope:n,id:o,children:d(te.div,{role:"group","aria-labelledby":o,...r,ref:t})})});nf.displayName=is;var ss="SelectLabel",rf=I((e,t)=>{const{__scopeSelect:n,...r}=e,o=tf(ss,n);return d(te.div,{id:o.id,...r,ref:t})});rf.displayName=ss;var Dn="SelectItem",[of,ls]=Nt(Dn),cs=I((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...i}=e,s=Ze(Dn,n),l=Je(Dn,n),c=s.value===r,[f,u]=S(a??""),[v,h]=S(!1),g=le(t,w=>{var y;return(y=l.itemRefCallback)==null?void 0:y.call(l,w,r,o)}),p=Er(),m=E("touch"),_=()=>{o||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d(of,{scope:n,value:r,disabled:o,textId:p,isSelected:c,onItemTextChange:$(w=>{u(y=>y||((w==null?void 0:w.textContent)??"").trim())},[]),children:d(An.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:d(te.div,{role:"option","aria-labelledby":p,"data-highlighted":v?"":void 0,"aria-selected":c&&v,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:g,onFocus:oe(i.onFocus,()=>h(!0)),onBlur:oe(i.onBlur,()=>h(!1)),onClick:oe(i.onClick,()=>{m.current!=="mouse"&&_()}),onPointerUp:oe(i.onPointerUp,()=>{m.current==="mouse"&&_()}),onPointerDown:oe(i.onPointerDown,w=>{m.current=w.pointerType}),onPointerMove:oe(i.onPointerMove,w=>{var y;m.current=w.pointerType,o?(y=l.onItemLeave)==null||y.call(l):m.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:oe(i.onPointerLeave,w=>{var y;w.currentTarget===document.activeElement&&((y=l.onItemLeave)==null||y.call(l))}),onKeyDown:oe(i.onKeyDown,w=>{var y;((y=l.searchRef)==null?void 0:y.current)!==""&&w.key===" "||(Bd.includes(w.key)&&_(),w.key===" "&&w.preventDefault())})})})})});cs.displayName=Dn;var jt="SelectItemText",us=I((e,t)=>{const{__scopeSelect:n,className:r,style:o,...a}=e,i=Ze(jt,n),s=Je(jt,n),l=ls(jt,n),c=jd(jt,n),[f,u]=S(null),v=le(t,_=>u(_),l.onItemTextChange,_=>{var w;return(w=s.itemTextRefCallback)==null?void 0:w.call(s,_,l.value,l.disabled)}),h=f==null?void 0:f.textContent,g=B(()=>d("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:p,onNativeOptionRemove:m}=c;return pe(()=>(p(g),()=>m(g)),[p,m,g]),d(ee,{children:[d(te.span,{id:l.textId,...a,ref:v}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?nn(a.children,i.valueNode):null]})});us.displayName=jt;var ds="SelectItemIndicator",fs=I((e,t)=>{const{__scopeSelect:n,...r}=e;return ls(ds,n).isSelected?d(te.span,{"aria-hidden":!0,...r,ref:t}):null});fs.displayName=ds;var Kr="SelectScrollUpButton",ps=I((e,t)=>{const n=Je(Kr,e.__scopeSelect),r=qr(Kr,e.__scopeSelect),[o,a]=S(!1),i=le(t,r.onScrollButtonChange);return pe(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;a(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?d(vs,{...e,ref:i,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});ps.displayName=Kr;var Gr="SelectScrollDownButton",hs=I((e,t)=>{const n=Je(Gr,e.__scopeSelect),r=qr(Gr,e.__scopeSelect),[o,a]=S(!1),i=le(t,r.onScrollButtonChange);return pe(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)<c;a(f)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?d(vs,{...e,ref:i,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});hs.displayName=Gr;var vs=I((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,a=Je("SelectScrollButton",n),i=E(null),s=$n(n),l=$(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return A(()=>()=>l(),[l]),pe(()=>{var c;const f=s().find(u=>u.ref.current===document.activeElement);(c=f==null?void 0:f.ref.current)==null||c.scrollIntoView({block:"nearest"})},[s]),d(te.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:oe(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:oe(o.onPointerMove,()=>{var c;(c=a.onItemLeave)==null||c.call(a),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:oe(o.onPointerLeave,()=>{l()})})}),af="SelectSeparator",sf=I((e,t)=>{const{__scopeSelect:n,...r}=e;return d(te.div,{"aria-hidden":!0,...r,ref:t})});sf.displayName=af;var Zr="SelectArrow",lf=I((e,t)=>{const{__scopeSelect:n,...r}=e,o=In(n),a=Ze(Zr,n),i=Je(Zr,n);return a.open&&i.position==="popper"?d(Yu,{...o,...r,ref:t}):null});lf.displayName=Zr;var cf="SelectBubbleInput",ms=I(({__scopeSelect:e,value:t,...n},r)=>{const o=E(null),a=le(r,o),i=Zu(t);return A(()=>{const s=o.current;if(!s)return;const l=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&c){const f=new Event("change",{bubbles:!0});c.call(s,t),s.dispatchEvent(f)}},[i,t]),d(te.select,{...n,style:{...Mi,...n.style},ref:a,defaultValue:t})});ms.displayName=cf;function gs(e){return e===""||e===void 0}function _s(e){const t=rt(e),n=E(""),r=E(0),o=$(i=>{const s=n.current+i;t(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),a=$(()=>{n.current="",window.clearTimeout(r.current)},[]);return A(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function ws(e,t,n){const r=t.length>1&&Array.from(t).every(s=>s===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=uf(e,Math.max(o,0));r.length===1&&(a=a.filter(s=>s!==n));const i=a.find(s=>s.textValue.toLowerCase().startsWith(r.toLowerCase()));return i!==n?i:void 0}function uf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var df=Ki,ys=Zi,bs=Qi,ff=es,pf=ts,hf=as,vf=cs,mf=us,gf=fs,_f=ps,wf=hs;const yf={sm:"w-4 h-4",md:"w-6 h-6"};function Jr({size:e="md",flagCode:t,className:n,...r}){return d("img",{className:Y("rounded-full object-cover",yf[e],n),src:`https://storage.googleapis.com/eleven-public-cdn/images/flags/circle-flags/${t}.svg`,alt:`${t.toUpperCase()} flag`,...r})}function xs({children:e,...t}){const[n,r]=S(!1),{language:o,setLanguage:a,options:i}=gt(),s=Rl();return d(df,{open:n,value:o.value.languageCode,onValueChange:l=>{a(l),r(!1)},onOpenChange:l=>{l&&r(!0)},children:[e,d(ff,{container:s,children:d(pf,{className:"overflow-hidden bg-base border border-base-border rounded-dropdown-sheet max-h-[min(384px,var(--radix-select-content-available-height))] min-w-[var(--radix-select-trigger-width)] z-10",position:"popper",sideOffset:8,align:"end",side:"top",onPointerDownOutside:()=>r(!1),onCloseAutoFocus:()=>r(!1),onEscapeKeyDown:()=>r(!1),...t,children:[d(_f,{className:"flex items-center justify-center h-6 bg-base text-base-subtle cursor-default",children:d(wt,{size:"sm",name:"chevron-up"})}),d(hf,{className:"p-1.5",children:i.value.map(l=>d(vf,{value:l.languageCode,className:"flex select-none items-center p-1.5 pr-3 gap-2 cursor-pointer rounded-input relative focus-visible:outline-none data-[highlighted]:bg-base-active text-sm",children:[d(Jr,{flagCode:l.flagCode}),d(mf,{children:l.name}),d(gf,{className:"text-base-primary p-1.5 -mr-1.5 ml-auto",children:d(wt,{size:"sm",name:"check"})})]},l.languageCode))}),d(wf,{className:"flex items-center justify-center h-6 bg-base text-base-subtle cursor-default",children:d(wt,{size:"sm",name:"chevron-down"})})]})})]})}function bf({className:e,...t}){const n=fe(),{language:r,showPicker:o}=gt();return o.value?d(xs,{align:"center",children:d(ys,{className:Y("h-9 min-w-max rounded-button focus-ring px-2 flex gap-2 items-center text-base-primary bg-base hover:bg-base-hover active:bg-base-active font-medium",e),"aria-label":n.change_language,...t,children:[d(Jr,{size:"sm",flagCode:r.value.flagCode}),r.value.name,d(bs,{className:"text-base-subtle",asChild:!0,children:d(wt,{size:"sm",name:"chevron-down"})})]})}):null}function xf({className:e,...t}){return d("textarea",{className:Y("px-3 py-[calc(theme(spacing.2)-1px)] border text-sm text-base-primary bg-base border-base-border rounded-input focus-ring resize-none [field-sizing:content] placeholder:text-base-subtle",e),...t})}function Qr({visible:e,...t}){const n=fe(),{isMuted:r,isMutingEnabled:o,setIsMuted:a}=Ea(),i=$(()=>{a(!r.peek())},[a]);return o.value?d(Fe,{visible:e,className:"p-1",children:d(Ye,{"aria-label":n.mute_microphone,"aria-pressed":r,icon:r.value?"mic-off":"mic",onClick:i,...t})}):null}function eo({iconOnly:e,isDisconnected:t,children:n,...r}){const{endSession:o,startSession:a}=de(),i=fe();return d(Ye,{variant:t?"primary":"secondary",icon:t?"phone":"phone-off",onClick:t?s=>a(s.currentTarget):o,"aria-label":t?i.start_call:i.end_call,...r,children:e?void 0:n??(t?i.start_call:i.end_call)})}function Cf({showTranscript:e,scrollPinned:t}){const[n,r]=S(""),o=fn(),{text_input_enabled:a}=ce().value,i=fe(),{isDisconnected:s,status:l,startSession:c,sendUserMessage:f,sendUserActivity:u,conversationIndex:v}=de();return d("div",{className:"shrink-0 overflow-hidden flex p-3 items-end justify-end",children:[a&&d(xf,{rows:1,"aria-label":i.input_label,value:n,onInput:u,onChange:h=>r(h.currentTarget.value),onKeyDown:async h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),n.trim()&&(t.value=!0,r(""),s.value?await c(h.currentTarget,n):f(n)))},className:"m-1 grow z-1 max-h-[8lh]",placeholder:o.value?s.value&&v.value>0?i.input_placeholder_new_conversation:i.input_placeholder_text_only:i.input_placeholder}),d("div",{className:"flex h-11 items-center",children:[d(Qr,{visible:!o.value&&!s.value}),d(Fe,{visible:!o.value&&(!s.value||e),className:"p-1",children:d(eo,{iconOnly:!s.value,isDisconnected:s.value,disabled:l.value==="disconnecting"||l.value==="connecting",children:i.new_call})})]})]})}function kf({entry:e,animateIn:t}){const n=fe(),{previewUrl:r}=gr(),{lastId:o}=de();return d(ke,{initial:!t,active:!0,children:e.type==="message"?d("div",{className:Y("flex gap-2.5 transition-[opacity,transform] duration-200 data-hidden:opacity-0 data-hidden:scale-75",e.role=="user"?"justify-end pl-16 origin-top-right":"pr-16 origin-top-left"),children:[e.role==="ai"&&d("img",{src:r,alt:"AI agent avatar",className:"bg-base-border shrink-0 w-5 h-5 rounded-full"}),d("div",{dir:"auto",className:Y("px-3 py-2.5 rounded-bubble text-sm",e.role==="user"?"bg-accent text-accent-primary":"bg-base-active text-base-primary"),children:e.message})]}):e.type==="disconnection"?d("div",{className:"mt-2 px-8 text-xs text-base-subtle text-center transition-opacity duration-200 data-hidden:opacity-0",children:[e.role==="user"?n.user_ended_conversation:n.agent_ended_conversation,d("br",{}),o.value&&d("span",{className:"break-all",children:[n.conversation_id,": ",o.value]})]}):d("div",{className:"mt-2 px-8 text-xs text-base-error text-center transition-opacity duration-200 data-hidden:opacity-0",children:[n.error_occurred,d("br",{}),e.message,o.value&&d(ee,{children:[d("br",{}),d("span",{className:"text-base-subtle break-all",children:[n.conversation_id,": ",o.value]})]})]})})}const Sf=16;function Ef({scrollPinned:e,transcript:t}){const n=E(null),r=a=>{var i;(i=n.current)==null||i.scrollTo({top:n.current.scrollHeight,behavior:a?"smooth":"instant"})},o=E(!0);return A(()=>{o.current=!1,r(!1)},[]),je(()=>{t.value,e.peek()&&r(!0)}),d("div",{ref:n,onScroll:a=>{e.value=a.currentTarget.scrollTop>=a.currentTarget.scrollHeight-a.currentTarget.clientHeight-Sf},className:"px-4 pb-3 grow flex flex-col gap-3 overflow-y-auto",children:t.value.map((a,i)=>d(kf,{entry:a,animateIn:!o.current},`${a.message}-${i}-${a.conversationIndex}`))})}const Tf={"top-left":"origin-top-left",top:"origin-top","top-right":"origin-top-right","bottom-left":"origin-bottom-left","bottom-right":"origin-bottom-right",bottom:"origin-bottom"};function Nf({open:e}){const t=fe(),n=mr(),r=fn(),o=ce(),a=o.value.placement,{isDisconnected:i,startSession:s,transcript:l,conversationIndex:c}=de(),f=$a(),u=Q(()=>{var g;return n.value||r.value?!f.value||!n.value?l.value:[{type:"message",role:"ai",message:f.value,isText:!0,conversationIndex:((g=l.value[0])==null?void 0:g.conversationIndex)??c.peek()},...l.value]:o.value.transcript_enabled?l.value:l.value.filter(p=>p.type!=="message"||p.isText)}),v=u.value.length>0||!i.value&&o.value.transcript_enabled,h=xe(!0);return d(ke,{initial:!1,active:e,children:d("div",{className:Y("flex flex-col overflow-hidden absolute bg-base shadow-lg pointer-events-auto rounded-sheet w-full max-w-[400px] h-[calc(100%-80px)] max-h-[550px]","transition-[transform,opacity] duration-200 data-hidden:scale-90 data-hidden:opacity-0",Tf[a],a.startsWith("top")?"top-20":"bottom-20"),children:[d("div",{className:"bg-base shrink-0 flex gap-2 p-4 items-start",children:[d("div",{className:"relative w-16 h-16"}),d(ke,{active:v&&!i.value,children:d(yr,{className:"rounded-bl-[calc(var(--el-bubble-radius)/3)] transition-opacity data-hidden:opacity-0"})})]}),d(Ef,{transcript:u,scrollPinned:h}),d(Cf,{scrollPinned:h,showTranscript:v}),d(ke,{active:!v||i.value,children:d("div",{className:"absolute top-0 left-0 right-0 p-4 flex justify-center transition-[opacity,transform] duration-200 data-hidden:opacity-0 data-hidden:-translate-y-4",children:d(bf,{})})}),d("div",{className:Y("absolute origin-top-left transition-[transform,left,top] duration-200 z-1",v?"top-4 left-4 scale-[0.333]":"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 scale-100"),children:[d(_t,{size:"lg"}),d(ke,{active:!v&&i.value&&!n.value,children:d("div",{className:"absolute bottom-0 p-1 rounded-[calc(var(--el-button-radius)+4px)] bg-base left-1/2 -translate-x-1/2 translate-y-1/2 transition-[opacity,transform] data-hidden:opacity-0 data-hidden:scale-100 scale-150",children:d(Ye,{"aria-label":t.start_call,variant:"primary",icon:"phone",onClick:g=>s(g.currentTarget)})})}),d(ke,{active:!v&&!i.value,children:d("div",{className:"absolute -bottom-3 left-1/2 -translate-x-1/2 translate-y-full transition-[opacity,transform] data-hidden:opacity-0 data-hidden:scale-75",children:d(yr,{})})})]})]})})}function Cs({expanded:e}){const t=fn(),n=ce().value.variant,{isDisconnected:r}=de(),o=fe(),a=$(()=>{e.value=!e.value},[e]);return d(ee,{children:[n==="full"&&d(Fe,{visible:!e.value&&!r.value,className:"p-1",children:d(_t,{})}),d(Fe,{grow:n!=="tiny",visible:!t.value&&!e.value&&!r.value,className:"p-1",children:d(eo,{iconOnly:!0,isDisconnected:!1})}),d(Qr,{visible:!t.value&&!e.value&&!r.value}),d(Fe,{grow:r.value,visible:!0,className:"p-1",children:d(Ye,{className:"w-full",variant:"primary",iconClassName:Y((e.value||!r.value)&&"transition-transform duration-200",e.value&&"-rotate-180"),icon:e.value?"chevron-up":r.value?t.value?"chat":"phone":"chevron-up","aria-label":e.value?o.collapse:r.value?t.value?o.start_chat:o.start_call:o.expand,onClick:!e.value&&!r.value?a:void 0,children:!e.value&&r.value&&n!=="tiny"?t.value?o.start_chat:o.start_call:void 0})})]})}function Pf({expanded:e,className:t,...n}){const{isDisconnected:r}=de(),o=fe();return d("div",{className:Y("transition-[border-radius] flex flex-col p-2",!e.value&&r.value?"rounded-sheet":"rounded-compact-sheet",t),...n,children:[d(Fe,{visible:!e.value&&r.value,className:"p-1 !min-w-60",children:d("div",{className:"flex items-center gap-2",children:[d(_t,{}),d("div",{className:"text-sm max-w-64",children:o.main_label})]})}),d("div",{className:"flex items-center",children:d(Cs,{expanded:e})})]})}function Af({expanded:e,className:t,...n}){return d("div",{className:Y("rounded-compact-sheet flex items-center p-2",t),...n,children:[d(Fe,{visible:!e.value,className:"p-1",children:d(_t,{})}),d(Cs,{expanded:e})]})}function $f({visible:e,className:t,...n}){const r=fe(),{language:o,showPicker:a}=gt();return a.value?d(Fe,{visible:e,className:"p-1",children:d(xs,{children:d(ys,{className:Y("h-9 min-w-max border border-base-border rounded-button focus-ring px-1.5 flex gap-1 items-center transition-colors duration-200 hover:bg-base-hover active:bg-base-active",t),"aria-label":r.change_language,...n,children:[d(Jr,{flagCode:o.value.flagCode}),d(bs,{className:"px-1 text-base-subtle",asChild:!0,children:d(wt,{size:"sm",name:"chevron-down"})})]})})}):null}function ks(){const e=ce().value.variant,{isDisconnected:t,status:n}=de();return d(ee,{children:[d(eo,{isDisconnected:t.value,iconOnly:e==="tiny",className:"w-full m-1 z-1",disabled:n.value==="disconnecting"||n.value==="connecting"}),d($f,{visible:t.value}),d(Qr,{visible:!t.value})]})}function If({className:e,...t}){const{isDisconnected:n}=de(),r=fe();return d("div",{className:Y("flex flex-col p-2 rounded-sheet",e),...t,children:[d("div",{className:"flex items-center p-1 gap-2 min-w-60",children:[d(_t,{}),d("div",{className:"relative text-sm max-w-64",children:[d("span",{className:Y("block transition-[transform,opacity] duration-200",!n.value&&"opacity-0 scale-90"),children:r.main_label}),d(ke,{active:!n.value,children:d(yr,{className:"absolute top-1/2 -translate-y-1/2 transition-[transform,opacity] duration-200 data-hidden:opacity-0 data-hidden:scale-90"})})]})]}),d("div",{className:"flex items-center",children:d(ks,{})})]})}function Df({className:e,...t}){return d("div",{className:Y("rounded-compact-sheet flex items-center p-2",e),...t,children:[d(_t,{className:"mx-1"}),d(ks,{})]})}function Mf({expandable:e,expanded:t}){const n=ce().value.variant,r=dn(),{isDisconnected:o}=de(),a=$(async()=>{await r.requestTerms(),t.value=!t.peek()},[t]),i=n==="full";return e?d(i?Pf:Af,{expanded:t,className:Y("bg-base shadow-md pointer-events-auto overflow-hidden",(o.value||t.value)&&"cursor-pointer"),onClick:o.value||t.value?a:void 0}):d(i?If:Df,{className:"bg-base shadow-md pointer-events-auto overflow-hidden"})}function Of(){const e=fe(),t=ce(),{dismissTerms:n,acceptTerms:r}=dn();return d("div",{className:"max-w-[400px] flex flex-col gap-2 bg-base shadow-md pointer-events-auto rounded-sheet p-3 text-sm",children:[d("div",{className:"flex flex-col gap-1 terms p-2 pt-1",dangerouslySetInnerHTML:{__html:t.value.terms_html??""}}),d("div",{className:"flex justify-end gap-2",children:[d(Ye,{onClick:n,children:e.dismiss_terms}),d(Ye,{onClick:r,variant:"primary",children:e.accept_terms})]})]})}function Lf({copyText:e,children:t}){const n=fe(),[r,o]=S(!1);A(()=>{if(r){const i=setTimeout(()=>{o(!1)},2e3);return()=>{clearTimeout(i)}}},[r]);const a=$(()=>{const i=La(e);i&&(navigator.clipboard.writeText(i),o(!0))},[]);return d(Ye,{onClick:a,children:r?n.copied:t})}function Rf({sawError:e}){const t=fe(),{error:n,lastId:r}=de(),o=$(()=>{e.value=!0},[]);return d("div",{className:"max-w-[400px] flex flex-col gap-2 bg-base shadow-md pointer-events-auto rounded-sheet p-3 text-sm",children:[d("div",{className:"p-2 pt-1",children:[d("h1",{className:"text-md font-medium pb-1",children:t.error_occurred}),n.value,r.value&&d(ee,{children:[d("br",{}),d("span",{className:"text-base-subtle",children:[t.conversation_id,": ",r.value]})]})]}),d("div",{className:"flex justify-end gap-2",children:[d(Lf,{copyText:r,children:t.copy_id}),d(Ye,{variant:"primary",onClick:o,children:"Close"})]})]})}function Ff(){const e=ce();return e.value.disable_banner?null:d("p",{className:Y("whitespace-nowrap [line-height:var(--el-overlay-padding)] text-[10px] px-3",e.value.placement.startsWith("top")?"-translate-y-[calc(var(--el-overlay-padding))]":"translate-y-[calc(var(--el-overlay-padding))]"),children:[d("span",{className:"opacity-30",children:"Powered by ElevenLabs"})," ",d("a",{href:e.value.override_link||"https://elevenlabs.io/conversational-ai",className:"underline cursor-pointer pointer-events-auto focus-visible:outline-none opacity-30 hover:opacity-50 focus-visible:opacity-100 focus-visible:underline-offset-2",target:"_blank",children:"Conversational AI"})]})}const Pt={left:"items-start",center:"items-center",right:"items-end"},At={top:"flex-col-reverse justify-end",bottom:"flex-col justify-end"},zf={"top-left":`${At.top} ${Pt.left}`,top:`${At.top} ${Pt.center}`,"top-right":`${At.top} ${Pt.right}`,"bottom-left":`${At.bottom} ${Pt.left}`,bottom:`${At.bottom} ${Pt.center}`,"bottom-right":`${At.bottom} ${Pt.right}`},Uf=tn(function(){const e=xe(!1),t=ce(),n=xe(!1),{error:r}=de(),o=dn(),a=Q(()=>t.value.transcript_enabled||t.value.text_input_enabled),i=Q(()=>Y("overlay flex transition-opacity duration-200 data-hidden:opacity-0",zf[t.value.placement]));je(()=>{r.value&&(a.value?(n.value=!0,e.value=!0):n.value=!1)});const s=Q(()=>!a.value&&r.value&&!n.value?"error":!o.termsAccepted.value&&o.termsShown.value?"terms":"conversation"),l=Q(()=>s.value==="error"),c=Q(()=>s.value==="terms"),f=Q(()=>s.value==="conversation");return d(ee,{children:[d(ke,{initial:!1,active:f,children:d(pn,{className:i,children:[a.value&&d(Nf,{open:e}),d(Mf,{expandable:a.value,expanded:e})]})}),d(ke,{initial:!1,active:c,children:d(pn,{className:i,children:d(Of,{})})}),d(ke,{initial:!1,active:l,children:d(pn,{className:i,children:d(Rf,{sawError:n})})}),d(pn,{className:i,children:d(Ff,{})})]})});function Bf(e){return d(gl,{value:e,children:d(Cl,{children:d(Il,{children:d(Nl,{children:d(Ml,{children:d(Sl,{children:d(El,{children:d(Pl,{children:d(Ol,{children:d(Ll,{children:[d(ml,{}),d(Uf,{})]})})})})})})})})})})}function Wf(e="elevenlabs-convai"){Os(Bf,e,[...hr],{shadow:!0})}Wf()})();
|
|
422
|
+
`)},Ld=0,Tt=[];function Rd(e){var t=E([]),n=E([0,0]),r=E(),o=S(Ld++)[0],a=S(Ui)[0],i=E(e);A(function(){i.current=e},[e]),A(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=od([e.lockRef.current],(e.shards||[]).map(qi)).filter(Boolean);return p.forEach(function(m){return m.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=$(function(p,m){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var _=Pn(p),w=n.current,y="deltaX"in p?p.deltaX:w[0]-_[0],b="deltaY"in p?p.deltaY:w[1]-_[1],C,k=p.target,x=Math.abs(y)>Math.abs(b)?"h":"v";if("touches"in p&&x==="h"&&k.type==="range")return!1;var P=Hi(x,k);if(!P)return!0;if(P?C=x:(C=x==="v"?"h":"v",P=Hi(x,k)),!P)return!1;if(!r.current&&"changedTouches"in p&&(y||b)&&(r.current=C),!C)return!0;var D=r.current||C;return Dd(D,m,p,D==="h"?y:b)},[]),l=$(function(p){var m=p;if(!(!Tt.length||Tt[Tt.length-1]!==a)){var _="deltaY"in m?Yi(m):Pn(m),w=t.current.filter(function(C){return C.name===m.type&&(C.target===m.target||m.target===C.shadowParent)&&Md(C.delta,_)})[0];if(w&&w.should){m.cancelable&&m.preventDefault();return}if(!w){var y=(i.current.shards||[]).map(qi).filter(Boolean).filter(function(C){return C.contains(m.target)}),b=y.length>0?s(m,y[0]):!i.current.noIsolation;b&&m.cancelable&&m.preventDefault()}}},[]),c=$(function(p,m,_,w){var y={name:p,delta:m,target:_,should:w,shadowParent:Fd(_)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(b){return b!==y})},1)},[]),f=$(function(p){n.current=Pn(p),r.current=void 0},[]),u=$(function(p){c(p.type,Yi(p),p.target,s(p,e.lockRef.current))},[]),v=$(function(p){c(p.type,Pn(p),p.target,s(p,e.lockRef.current))},[]);A(function(){return Tt.push(a),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:v}),document.addEventListener("wheel",l,Et),document.addEventListener("touchmove",l,Et),document.addEventListener("touchstart",f,Et),function(){Tt=Tt.filter(function(p){return p!==a}),document.removeEventListener("wheel",l,Et),document.removeEventListener("touchmove",l,Et),document.removeEventListener("touchstart",f,Et)}},[]);var h=e.removeScrollBar,g=e.inert;return K(ee,null,g?K(a,{styles:Od(o)}):null,h?K(Ed,{gapMode:e.gapMode}):null)}function Fd(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const zd=pd(zi,Rd);var Xi=I(function(e,t){return K(Tn,Ie({},e,{ref:t,sideCar:zd}))});Xi.classNames=Tn.classNames;var Ud=[" ","Enter","ArrowUp","ArrowDown"],Bd=[" ","Enter"],at="Select",[An,$n,Wd]=hc(at),[Nt,jf]=br(at,[Wd,Ci]),In=Ci(),[Hd,Ze]=Nt(at),[Vd,jd]=Nt(at),Ki=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:a,value:i,defaultValue:s,onValueChange:l,dir:c,name:f,autoComplete:u,disabled:v,required:h,form:g}=e,p=In(t),[m,_]=S(null),[w,y]=S(null),[b,C]=S(!1),k=mc(c),[x,P]=Di({prop:r,defaultProp:o??!1,onChange:a,caller:at}),[D,F]=Di({prop:i,defaultProp:s,onChange:l,caller:at}),O=E(null),L=m?g||!!m.closest("form"):!0,[X,z]=S(new Set),ne=Array.from(X).map(R=>R.props.value).join(";");return d(Hu,{...p,children:d(Hd,{required:h,scope:t,trigger:m,onTriggerChange:_,valueNode:w,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:C,contentId:Er(),value:D,onValueChange:F,open:x,onOpenChange:P,dir:k,triggerPointerDownPosRef:O,disabled:v,children:[d(An.Provider,{scope:t,children:d(Vd,{scope:e.__scopeSelect,onNativeOptionAdd:$(R=>{z(V=>new Set(V).add(R))},[]),onNativeOptionRemove:$(R=>{z(V=>{const M=new Set(V);return M.delete(R),M})},[]),children:n})}),L?d(ms,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:u,value:D,onChange:R=>F(R.target.value),disabled:v,form:g,children:[D===void 0?d("option",{value:""}):null,Array.from(X)]},ne):null]})})};Ki.displayName=at;var Gi="SelectTrigger",Zi=I((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,a=In(n),i=Ze(Gi,n),s=i.disabled||r,l=le(t,i.onTriggerChange),c=$n(n),f=E("touch"),[u,v,h]=_s(p=>{const m=c().filter(y=>!y.disabled),_=m.find(y=>y.value===i.value),w=ws(m,p,_);w!==void 0&&i.onValueChange(w.value)}),g=p=>{s||(i.onOpenChange(!0),h()),p&&(i.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d(Vu,{asChild:!0,...a,children:d(te.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":gs(i.value)?"":void 0,...o,ref:l,onClick:oe(o.onClick,p=>{p.currentTarget.focus(),f.current!=="mouse"&&g(p)}),onPointerDown:oe(o.onPointerDown,p=>{f.current=p.pointerType;const m=p.target;m.hasPointerCapture(p.pointerId)&&m.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(g(p),p.preventDefault())}),onKeyDown:oe(o.onKeyDown,p=>{const m=u.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&v(p.key),!(m&&p.key===" ")&&Ud.includes(p.key)&&(g(),p.preventDefault())})})})});Zi.displayName=Gi;var Ji="SelectValue",Yd=I((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:i="",...s}=e,l=Ze(Ji,n),{onValueNodeHasChildrenChange:c}=l,f=a!==void 0,u=le(t,l.onValueNodeChange);return pe(()=>{c(f)},[c,f]),d(te.span,{...s,ref:u,style:{pointerEvents:"none"},children:gs(l.value)?d(ee,{children:i}):a})});Yd.displayName=Ji;var qd="SelectIcon",Qi=I((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return d(te.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Qi.displayName=qd;var Xd="SelectPortal",es=e=>d(Ii,{asChild:!0,...e});es.displayName=Xd;var it="SelectContent",ts=I((e,t)=>{const n=Ze(it,e.__scopeSelect),[r,o]=S();if(pe(()=>{o(new DocumentFragment)},[]),!n.open){const a=r;return a?nn(d(ns,{scope:e.__scopeSelect,children:d(An.Slot,{scope:e.__scopeSelect,children:d("div",{children:e.children})})}),a):null}return d(rs,{...e,ref:t})});ts.displayName=it;var Te=10,[ns,Je]=Nt(it),Kd="SelectContentImpl",Gd=Bt("SelectContent.RemoveScroll"),rs=I((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:i,side:s,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:v,collisionPadding:h,sticky:g,hideWhenDetached:p,avoidCollisions:m,..._}=e,w=Ze(it,n),[y,b]=S(null),[C,k]=S(null),x=le(t,N=>b(N)),[P,D]=S(null),[F,O]=S(null),L=$n(n),[X,z]=S(!1),ne=E(!1);A(()=>{if(y)return rd(y)},[y]),Tc();const R=$(N=>{const[G,...re]=L().map(ae=>ae.ref.current),[U]=re.slice(-1),J=document.activeElement;for(const ae of N)if(ae===J||(ae==null||ae.scrollIntoView({block:"nearest"}),ae===G&&C&&(C.scrollTop=0),ae===U&&C&&(C.scrollTop=C.scrollHeight),ae==null||ae.focus(),document.activeElement!==J))return},[L,C]),V=$(()=>R([P,y]),[R,P,y]);A(()=>{X&&V()},[X,V]);const{onOpenChange:M,triggerPointerDownPosRef:j}=w;A(()=>{if(y){let N={x:0,y:0};const G=U=>{var J,ae;N={x:Math.abs(Math.round(U.pageX)-(((J=j.current)==null?void 0:J.x)??0)),y:Math.abs(Math.round(U.pageY)-(((ae=j.current)==null?void 0:ae.y)??0))}},re=U=>{N.x<=10&&N.y<=10?U.preventDefault():y.contains(U.target)||M(!1),document.removeEventListener("pointermove",G),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",G),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",re,{capture:!0})}}},[y,M,j]),A(()=>{const N=()=>M(!1);return window.addEventListener("blur",N),window.addEventListener("resize",N),()=>{window.removeEventListener("blur",N),window.removeEventListener("resize",N)}},[M]);const[he,st]=_s(N=>{const G=L().filter(J=>!J.disabled),re=G.find(J=>J.ref.current===document.activeElement),U=ws(G,N,re);U&&setTimeout(()=>U.ref.current.focus())}),Yt=$((N,G,re)=>{const U=!ne.current&&!re;(w.value!==void 0&&w.value===G||U)&&(D(N),U&&(ne.current=!0))},[w.value]),Qe=$(()=>y==null?void 0:y.focus(),[y]),we=$((N,G,re)=>{const U=!ne.current&&!re;(w.value!==void 0&&w.value===G||U)&&O(N)},[w.value]),lt=r==="popper"?Yr:os,ct=lt===Yr?{side:s,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:v,collisionPadding:h,sticky:g,hideWhenDetached:p,avoidCollisions:m}:{};return d(ns,{scope:n,content:y,viewport:C,onViewportChange:k,itemRefCallback:Yt,selectedItem:P,onItemLeave:Qe,itemTextRefCallback:we,focusSelectedItem:V,selectedItemText:F,position:r,isPositioned:X,searchRef:he,children:d(Xi,{as:Gd,allowPinchZoom:!0,children:d(Ja,{asChild:!0,trapped:w.open,onMountAutoFocus:N=>{N.preventDefault()},onUnmountAutoFocus:oe(o,N=>{var G;(G=w.trigger)==null||G.focus({preventScroll:!0}),N.preventDefault()}),children:d(qa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:N=>N.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:d(lt,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:N=>N.preventDefault(),..._,...ct,onPlaced:()=>z(!0),ref:x,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:oe(_.onKeyDown,N=>{const G=N.ctrlKey||N.altKey||N.metaKey;if(N.key==="Tab"&&N.preventDefault(),!G&&N.key.length===1&&st(N.key),["ArrowUp","ArrowDown","Home","End"].includes(N.key)){let re=L().filter(U=>!U.disabled).map(U=>U.ref.current);if(["ArrowUp","End"].includes(N.key)&&(re=re.slice().reverse()),["ArrowUp","ArrowDown"].includes(N.key)){const U=N.target,J=re.indexOf(U);re=re.slice(J+1)}setTimeout(()=>R(re)),N.preventDefault()}})})})})})})});rs.displayName=Kd;var Zd="SelectItemAlignedPosition",os=I((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,a=Ze(it,n),i=Je(it,n),[s,l]=S(null),[c,f]=S(null),u=le(t,x=>f(x)),v=$n(n),h=E(!1),g=E(!0),{viewport:p,selectedItem:m,selectedItemText:_,focusSelectedItem:w}=i,y=$(()=>{if(a.trigger&&a.valueNode&&s&&c&&p&&m&&_){const x=a.trigger.getBoundingClientRect(),P=c.getBoundingClientRect(),D=a.valueNode.getBoundingClientRect(),F=_.getBoundingClientRect();if(a.dir!=="rtl"){const U=F.left-P.left,J=D.left-U,ae=x.left-J,ye=x.width+ae,qt=Math.max(ye,P.width),Xt=window.innerWidth-Te,Kt=Va(J,[Te,Math.max(Te,Xt-qt)]);s.style.minWidth=ye+"px",s.style.left=Kt+"px"}else{const U=P.right-F.right,J=window.innerWidth-D.right-U,ae=window.innerWidth-x.right-J,ye=x.width+ae,qt=Math.max(ye,P.width),Xt=window.innerWidth-Te,Kt=Va(J,[Te,Math.max(Te,Xt-qt)]);s.style.minWidth=ye+"px",s.style.right=Kt+"px"}const O=v(),L=window.innerHeight-Te*2,X=p.scrollHeight,z=window.getComputedStyle(c),ne=parseInt(z.borderTopWidth,10),R=parseInt(z.paddingTop,10),V=parseInt(z.borderBottomWidth,10),M=parseInt(z.paddingBottom,10),j=ne+R+X+M+V,he=Math.min(m.offsetHeight*5,j),st=window.getComputedStyle(p),Yt=parseInt(st.paddingTop,10),Qe=parseInt(st.paddingBottom,10),we=x.top+x.height/2-Te,lt=L-we,ct=m.offsetHeight/2,N=m.offsetTop+ct,G=ne+R+N,re=j-G;if(G<=we){const U=O.length>0&&m===O[O.length-1].ref.current;s.style.bottom="0px";const J=c.clientHeight-p.offsetTop-p.offsetHeight,ae=Math.max(lt,ct+(U?Qe:0)+J+V),ye=G+ae;s.style.height=ye+"px"}else{const U=O.length>0&&m===O[0].ref.current;s.style.top="0px";const J=Math.max(we,ne+p.offsetTop+(U?Yt:0)+ct)+re;s.style.height=J+"px",p.scrollTop=G-we+p.offsetTop}s.style.margin=`${Te}px 0`,s.style.minHeight=he+"px",s.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[v,a.trigger,a.valueNode,s,c,p,m,_,a.dir,r]);pe(()=>y(),[y]);const[b,C]=S();pe(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const k=$(x=>{x&&g.current===!0&&(y(),w==null||w(),g.current=!1)},[y,w]);return d(Qd,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:k,children:d("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:d(te.div,{...o,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});os.displayName=Zd;var Jd="SelectPopperPosition",Yr=I((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Te,...a}=e,i=In(n);return d(ju,{...i,...a,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Yr.displayName=Jd;var[Qd,qr]=Nt(it,{}),Xr="SelectViewport",as=I((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,a=Je(Xr,n),i=qr(Xr,n),s=le(t,a.onViewportChange),l=E(0);return d(ee,{children:[d("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),d(An.Slot,{scope:n,children:d(te.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:oe(o.onScroll,c=>{const f=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:v}=i;if(v!=null&&v.current&&u){const h=Math.abs(l.current-f.scrollTop);if(h>0){const g=window.innerHeight-Te*2,p=parseFloat(u.style.minHeight),m=parseFloat(u.style.height),_=Math.max(p,m);if(_<g){const w=_+h,y=Math.min(g,w),b=w-y;u.style.height=y+"px",u.style.bottom==="0px"&&(f.scrollTop=b>0?b:0,u.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});as.displayName=Xr;var is="SelectGroup",[ef,tf]=Nt(is),nf=I((e,t)=>{const{__scopeSelect:n,...r}=e,o=Er();return d(ef,{scope:n,id:o,children:d(te.div,{role:"group","aria-labelledby":o,...r,ref:t})})});nf.displayName=is;var ss="SelectLabel",rf=I((e,t)=>{const{__scopeSelect:n,...r}=e,o=tf(ss,n);return d(te.div,{id:o.id,...r,ref:t})});rf.displayName=ss;var Dn="SelectItem",[of,ls]=Nt(Dn),cs=I((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...i}=e,s=Ze(Dn,n),l=Je(Dn,n),c=s.value===r,[f,u]=S(a??""),[v,h]=S(!1),g=le(t,w=>{var y;return(y=l.itemRefCallback)==null?void 0:y.call(l,w,r,o)}),p=Er(),m=E("touch"),_=()=>{o||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d(of,{scope:n,value:r,disabled:o,textId:p,isSelected:c,onItemTextChange:$(w=>{u(y=>y||((w==null?void 0:w.textContent)??"").trim())},[]),children:d(An.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:d(te.div,{role:"option","aria-labelledby":p,"data-highlighted":v?"":void 0,"aria-selected":c&&v,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:g,onFocus:oe(i.onFocus,()=>h(!0)),onBlur:oe(i.onBlur,()=>h(!1)),onClick:oe(i.onClick,()=>{m.current!=="mouse"&&_()}),onPointerUp:oe(i.onPointerUp,()=>{m.current==="mouse"&&_()}),onPointerDown:oe(i.onPointerDown,w=>{m.current=w.pointerType}),onPointerMove:oe(i.onPointerMove,w=>{var y;m.current=w.pointerType,o?(y=l.onItemLeave)==null||y.call(l):m.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:oe(i.onPointerLeave,w=>{var y;w.currentTarget===document.activeElement&&((y=l.onItemLeave)==null||y.call(l))}),onKeyDown:oe(i.onKeyDown,w=>{var y;((y=l.searchRef)==null?void 0:y.current)!==""&&w.key===" "||(Bd.includes(w.key)&&_(),w.key===" "&&w.preventDefault())})})})})});cs.displayName=Dn;var jt="SelectItemText",us=I((e,t)=>{const{__scopeSelect:n,className:r,style:o,...a}=e,i=Ze(jt,n),s=Je(jt,n),l=ls(jt,n),c=jd(jt,n),[f,u]=S(null),v=le(t,_=>u(_),l.onItemTextChange,_=>{var w;return(w=s.itemTextRefCallback)==null?void 0:w.call(s,_,l.value,l.disabled)}),h=f==null?void 0:f.textContent,g=B(()=>d("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:p,onNativeOptionRemove:m}=c;return pe(()=>(p(g),()=>m(g)),[p,m,g]),d(ee,{children:[d(te.span,{id:l.textId,...a,ref:v}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?nn(a.children,i.valueNode):null]})});us.displayName=jt;var ds="SelectItemIndicator",fs=I((e,t)=>{const{__scopeSelect:n,...r}=e;return ls(ds,n).isSelected?d(te.span,{"aria-hidden":!0,...r,ref:t}):null});fs.displayName=ds;var Kr="SelectScrollUpButton",ps=I((e,t)=>{const n=Je(Kr,e.__scopeSelect),r=qr(Kr,e.__scopeSelect),[o,a]=S(!1),i=le(t,r.onScrollButtonChange);return pe(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;a(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?d(vs,{...e,ref:i,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});ps.displayName=Kr;var Gr="SelectScrollDownButton",hs=I((e,t)=>{const n=Je(Gr,e.__scopeSelect),r=qr(Gr,e.__scopeSelect),[o,a]=S(!1),i=le(t,r.onScrollButtonChange);return pe(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)<c;a(f)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?d(vs,{...e,ref:i,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});hs.displayName=Gr;var vs=I((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,a=Je("SelectScrollButton",n),i=E(null),s=$n(n),l=$(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return A(()=>()=>l(),[l]),pe(()=>{var c;const f=s().find(u=>u.ref.current===document.activeElement);(c=f==null?void 0:f.ref.current)==null||c.scrollIntoView({block:"nearest"})},[s]),d(te.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:oe(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:oe(o.onPointerMove,()=>{var c;(c=a.onItemLeave)==null||c.call(a),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:oe(o.onPointerLeave,()=>{l()})})}),af="SelectSeparator",sf=I((e,t)=>{const{__scopeSelect:n,...r}=e;return d(te.div,{"aria-hidden":!0,...r,ref:t})});sf.displayName=af;var Zr="SelectArrow",lf=I((e,t)=>{const{__scopeSelect:n,...r}=e,o=In(n),a=Ze(Zr,n),i=Je(Zr,n);return a.open&&i.position==="popper"?d(Yu,{...o,...r,ref:t}):null});lf.displayName=Zr;var cf="SelectBubbleInput",ms=I(({__scopeSelect:e,value:t,...n},r)=>{const o=E(null),a=le(r,o),i=Zu(t);return A(()=>{const s=o.current;if(!s)return;const l=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&c){const f=new Event("change",{bubbles:!0});c.call(s,t),s.dispatchEvent(f)}},[i,t]),d(te.select,{...n,style:{...Mi,...n.style},ref:a,defaultValue:t})});ms.displayName=cf;function gs(e){return e===""||e===void 0}function _s(e){const t=rt(e),n=E(""),r=E(0),o=$(i=>{const s=n.current+i;t(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),a=$(()=>{n.current="",window.clearTimeout(r.current)},[]);return A(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function ws(e,t,n){const r=t.length>1&&Array.from(t).every(s=>s===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=uf(e,Math.max(o,0));r.length===1&&(a=a.filter(s=>s!==n));const i=a.find(s=>s.textValue.toLowerCase().startsWith(r.toLowerCase()));return i!==n?i:void 0}function uf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var df=Ki,ys=Zi,bs=Qi,ff=es,pf=ts,hf=as,vf=cs,mf=us,gf=fs,_f=ps,wf=hs;const yf={sm:"w-4 h-4",md:"w-6 h-6"};function Jr({size:e="md",flagCode:t,className:n,...r}){return d("img",{className:Y("rounded-full object-cover",yf[e],n),src:`https://storage.googleapis.com/eleven-public-cdn/images/flags/circle-flags/${t}.svg`,alt:`${t.toUpperCase()} flag`,...r})}function xs({children:e,...t}){const[n,r]=S(!1),{language:o,setLanguage:a,options:i}=gt(),s=Rl();return d(df,{open:n,value:o.value.languageCode,onValueChange:l=>{a(l),r(!1)},onOpenChange:l=>{l&&r(!0)},children:[e,d(ff,{container:s,children:d(pf,{className:"overflow-hidden bg-base border border-base-border rounded-dropdown-sheet max-h-[min(384px,var(--radix-select-content-available-height))] min-w-[var(--radix-select-trigger-width)] z-10",position:"popper",sideOffset:8,align:"end",side:"top",onPointerDownOutside:()=>r(!1),onCloseAutoFocus:()=>r(!1),onEscapeKeyDown:()=>r(!1),...t,children:[d(_f,{className:"flex items-center justify-center h-6 bg-base text-base-subtle cursor-default",children:d(wt,{size:"sm",name:"chevron-up"})}),d(hf,{className:"p-1.5",children:i.value.map(l=>d(vf,{value:l.languageCode,className:"flex select-none items-center p-1.5 pr-3 gap-2 cursor-pointer rounded-input relative focus-visible:outline-none data-[highlighted]:bg-base-active text-sm",children:[d(Jr,{flagCode:l.flagCode}),d(mf,{children:l.name}),d(gf,{className:"text-base-primary p-1.5 -mr-1.5 ml-auto",children:d(wt,{size:"sm",name:"check"})})]},l.languageCode))}),d(wf,{className:"flex items-center justify-center h-6 bg-base text-base-subtle cursor-default",children:d(wt,{size:"sm",name:"chevron-down"})})]})})]})}function bf({className:e,...t}){const n=fe(),{language:r,showPicker:o}=gt();return o.value?d(xs,{align:"center",children:d(ys,{className:Y("h-9 min-w-max rounded-button focus-ring px-2 flex gap-2 items-center text-base-primary bg-base hover:bg-base-hover active:bg-base-active font-medium",e),"aria-label":n.change_language,...t,children:[d(Jr,{size:"sm",flagCode:r.value.flagCode}),r.value.name,d(bs,{className:"text-base-subtle",asChild:!0,children:d(wt,{size:"sm",name:"chevron-down"})})]})}):null}function xf({className:e,...t}){return d("textarea",{className:Y("px-3 py-[calc(theme(spacing.2)-1px)] border text-sm text-base-primary bg-base border-base-border rounded-input focus-ring resize-none [field-sizing:content] placeholder:text-base-subtle",e),...t})}function Qr({visible:e,...t}){const n=fe(),{isMuted:r,isMutingEnabled:o,setIsMuted:a}=Ea(),i=$(()=>{a(!r.peek())},[a]);return o.value?d(Fe,{visible:e,className:"p-1",children:d(Ye,{"aria-label":n.mute_microphone,"aria-pressed":r,icon:r.value?"mic-off":"mic",onClick:i,...t})}):null}function eo({iconOnly:e,isDisconnected:t,children:n,...r}){const{endSession:o,startSession:a}=de(),i=fe();return d(Ye,{variant:t?"primary":"secondary",icon:t?"phone":"phone-off",onClick:t?s=>a(s.currentTarget):o,"aria-label":t?i.start_call:i.end_call,...r,children:e?void 0:n??(t?i.start_call:i.end_call)})}function Cf({showTranscript:e,scrollPinned:t}){const[n,r]=S(""),o=fn(),{text_input_enabled:a}=ce().value,i=fe(),{isDisconnected:s,status:l,startSession:c,sendUserMessage:f,sendUserActivity:u,conversationIndex:v}=de();return d("div",{className:"shrink-0 overflow-hidden flex p-3 items-end justify-end",children:[a&&d(xf,{rows:1,"aria-label":i.input_label,value:n,onInput:u,onChange:h=>r(h.currentTarget.value),onKeyDown:async h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),n.trim()&&(t.value=!0,r(""),s.value?await c(h.currentTarget,n):f(n)))},className:"m-1 grow z-1 max-h-[8lh]",placeholder:o.value?s.value&&v.value>0?i.input_placeholder_new_conversation:i.input_placeholder_text_only:i.input_placeholder}),d("div",{className:"flex h-11 items-center",children:[d(Qr,{visible:!o.value&&!s.value}),d(Fe,{visible:!o.value&&(!s.value||e),className:"p-1",children:d(eo,{iconOnly:!s.value,isDisconnected:s.value,disabled:l.value==="disconnecting"||l.value==="connecting",children:i.new_call})})]})]})}function kf({entry:e,animateIn:t}){const n=fe(),{previewUrl:r}=gr(),{lastId:o}=de();return d(ke,{initial:!t,active:!0,children:e.type==="message"?d("div",{className:Y("flex gap-2.5 transition-[opacity,transform] duration-200 data-hidden:opacity-0 data-hidden:scale-75",e.role=="user"?"justify-end pl-16 origin-top-right":"pr-16 origin-top-left"),children:[e.role==="ai"&&d("img",{src:r,alt:"AI agent avatar",className:"bg-base-border shrink-0 w-5 h-5 rounded-full"}),d("div",{dir:"auto",className:Y("px-3 py-2.5 rounded-bubble text-sm min-w-0 [overflow-wrap:break-word]",e.role==="user"?"bg-accent text-accent-primary":"bg-base-active text-base-primary"),children:e.message})]}):e.type==="disconnection"?d("div",{className:"mt-2 px-8 text-xs text-base-subtle text-center transition-opacity duration-200 data-hidden:opacity-0",children:[e.role==="user"?n.user_ended_conversation:n.agent_ended_conversation,d("br",{}),o.value&&d("span",{className:"break-all",children:[n.conversation_id,": ",o.value]})]}):d("div",{className:"mt-2 px-8 text-xs text-base-error text-center transition-opacity duration-200 data-hidden:opacity-0",children:[n.error_occurred,d("br",{}),e.message,o.value&&d(ee,{children:[d("br",{}),d("span",{className:"text-base-subtle break-all",children:[n.conversation_id,": ",o.value]})]})]})})}const Sf=16;function Ef({scrollPinned:e,transcript:t}){const n=E(null),r=a=>{var i;(i=n.current)==null||i.scrollTo({top:n.current.scrollHeight,behavior:a?"smooth":"instant"})},o=E(!0);return A(()=>{o.current=!1,r(!1)},[]),je(()=>{t.value,e.peek()&&r(!0)}),d("div",{ref:n,onScroll:a=>{e.value=a.currentTarget.scrollTop>=a.currentTarget.scrollHeight-a.currentTarget.clientHeight-Sf},className:"px-4 pb-3 grow flex flex-col gap-3 overflow-x-hidden overflow-y-auto",children:t.value.map((a,i)=>d(kf,{entry:a,animateIn:!o.current},`${a.message}-${i}-${a.conversationIndex}`))})}const Tf={"top-left":"origin-top-left",top:"origin-top","top-right":"origin-top-right","bottom-left":"origin-bottom-left","bottom-right":"origin-bottom-right",bottom:"origin-bottom"};function Nf({open:e}){const t=fe(),n=mr(),r=fn(),o=ce(),a=o.value.placement,{isDisconnected:i,startSession:s,transcript:l,conversationIndex:c}=de(),f=$a(),u=Q(()=>{var g;return n.value||r.value?!f.value||!n.value?l.value:[{type:"message",role:"ai",message:f.value,isText:!0,conversationIndex:((g=l.value[0])==null?void 0:g.conversationIndex)??c.peek()},...l.value]:o.value.transcript_enabled?l.value:l.value.filter(p=>p.type!=="message"||p.isText)}),v=u.value.length>0||!i.value&&o.value.transcript_enabled,h=xe(!0);return d(ke,{initial:!1,active:e,children:d("div",{className:Y("flex flex-col overflow-hidden absolute bg-base shadow-lg pointer-events-auto rounded-sheet w-full max-w-[400px] h-[calc(100%-80px)] max-h-[550px]","transition-[transform,opacity] duration-200 data-hidden:scale-90 data-hidden:opacity-0",Tf[a],a.startsWith("top")?"top-20":"bottom-20"),children:[d("div",{className:"bg-base shrink-0 flex gap-2 p-4 items-start",children:[d("div",{className:"relative w-16 h-16"}),d(ke,{active:v&&!i.value,children:d(yr,{className:"rounded-bl-[calc(var(--el-bubble-radius)/3)] transition-opacity data-hidden:opacity-0"})})]}),d(Ef,{transcript:u,scrollPinned:h}),d(Cf,{scrollPinned:h,showTranscript:v}),d(ke,{active:!v||i.value,children:d("div",{className:"absolute top-0 left-0 right-0 p-4 flex justify-center transition-[opacity,transform] duration-200 data-hidden:opacity-0 data-hidden:-translate-y-4",children:d(bf,{})})}),d("div",{className:Y("absolute origin-top-left transition-[transform,left,top] duration-200 z-1",v?"top-4 left-4 scale-[0.333]":"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 scale-100"),children:[d(_t,{size:"lg"}),d(ke,{active:!v&&i.value&&!n.value,children:d("div",{className:"absolute bottom-0 p-1 rounded-[calc(var(--el-button-radius)+4px)] bg-base left-1/2 -translate-x-1/2 translate-y-1/2 transition-[opacity,transform] data-hidden:opacity-0 data-hidden:scale-100 scale-150",children:d(Ye,{"aria-label":t.start_call,variant:"primary",icon:"phone",onClick:g=>s(g.currentTarget)})})}),d(ke,{active:!v&&!i.value,children:d("div",{className:"absolute -bottom-3 left-1/2 -translate-x-1/2 translate-y-full transition-[opacity,transform] data-hidden:opacity-0 data-hidden:scale-75",children:d(yr,{})})})]})]})})}function Cs({expanded:e}){const t=fn(),n=ce().value.variant,{isDisconnected:r}=de(),o=fe(),a=$(()=>{e.value=!e.value},[e]);return d(ee,{children:[n==="full"&&d(Fe,{visible:!e.value&&!r.value,className:"p-1",children:d(_t,{})}),d(Fe,{grow:n!=="tiny",visible:!t.value&&!e.value&&!r.value,className:"p-1",children:d(eo,{iconOnly:!0,isDisconnected:!1})}),d(Qr,{visible:!t.value&&!e.value&&!r.value}),d(Fe,{grow:r.value,visible:!0,className:"p-1",children:d(Ye,{className:"w-full",variant:"primary",iconClassName:Y((e.value||!r.value)&&"transition-transform duration-200",e.value&&"-rotate-180"),icon:e.value?"chevron-up":r.value?t.value?"chat":"phone":"chevron-up","aria-label":e.value?o.collapse:r.value?t.value?o.start_chat:o.start_call:o.expand,onClick:!e.value&&!r.value?a:void 0,children:!e.value&&r.value&&n!=="tiny"?t.value?o.start_chat:o.start_call:void 0})})]})}function Pf({expanded:e,className:t,...n}){const{isDisconnected:r}=de(),o=fe();return d("div",{className:Y("transition-[border-radius] flex flex-col p-2",!e.value&&r.value?"rounded-sheet":"rounded-compact-sheet",t),...n,children:[d(Fe,{visible:!e.value&&r.value,className:"p-1 !min-w-60",children:d("div",{className:"flex items-center gap-2",children:[d(_t,{}),d("div",{className:"text-sm max-w-64",children:o.main_label})]})}),d("div",{className:"flex items-center",children:d(Cs,{expanded:e})})]})}function Af({expanded:e,className:t,...n}){return d("div",{className:Y("rounded-compact-sheet flex items-center p-2",t),...n,children:[d(Fe,{visible:!e.value,className:"p-1",children:d(_t,{})}),d(Cs,{expanded:e})]})}function $f({visible:e,className:t,...n}){const r=fe(),{language:o,showPicker:a}=gt();return a.value?d(Fe,{visible:e,className:"p-1",children:d(xs,{children:d(ys,{className:Y("h-9 min-w-max border border-base-border rounded-button focus-ring px-1.5 flex gap-1 items-center transition-colors duration-200 hover:bg-base-hover active:bg-base-active",t),"aria-label":r.change_language,...n,children:[d(Jr,{flagCode:o.value.flagCode}),d(bs,{className:"px-1 text-base-subtle",asChild:!0,children:d(wt,{size:"sm",name:"chevron-down"})})]})})}):null}function ks(){const e=ce().value.variant,{isDisconnected:t,status:n}=de();return d(ee,{children:[d(eo,{isDisconnected:t.value,iconOnly:e==="tiny",className:"w-full m-1 z-1",disabled:n.value==="disconnecting"||n.value==="connecting"}),d($f,{visible:t.value}),d(Qr,{visible:!t.value})]})}function If({className:e,...t}){const{isDisconnected:n}=de(),r=fe();return d("div",{className:Y("flex flex-col p-2 rounded-sheet",e),...t,children:[d("div",{className:"flex items-center p-1 gap-2 min-w-60",children:[d(_t,{}),d("div",{className:"relative text-sm max-w-64",children:[d("span",{className:Y("block transition-[transform,opacity] duration-200",!n.value&&"opacity-0 scale-90"),children:r.main_label}),d(ke,{active:!n.value,children:d(yr,{className:"absolute top-1/2 -translate-y-1/2 transition-[transform,opacity] duration-200 data-hidden:opacity-0 data-hidden:scale-90"})})]})]}),d("div",{className:"flex items-center",children:d(ks,{})})]})}function Df({className:e,...t}){return d("div",{className:Y("rounded-compact-sheet flex items-center p-2",e),...t,children:[d(_t,{className:"mx-1"}),d(ks,{})]})}function Mf({expandable:e,expanded:t}){const n=ce().value.variant,r=dn(),{isDisconnected:o}=de(),a=$(async()=>{await r.requestTerms(),t.value=!t.peek()},[t]),i=n==="full";return e?d(i?Pf:Af,{expanded:t,className:Y("bg-base shadow-md pointer-events-auto overflow-hidden",(o.value||t.value)&&"cursor-pointer"),onClick:o.value||t.value?a:void 0}):d(i?If:Df,{className:"bg-base shadow-md pointer-events-auto overflow-hidden"})}function Of(){const e=fe(),t=ce(),{dismissTerms:n,acceptTerms:r}=dn();return d("div",{className:"max-w-[400px] flex flex-col gap-2 bg-base shadow-md pointer-events-auto rounded-sheet p-3 text-sm",children:[d("div",{className:"flex flex-col gap-1 terms p-2 pt-1",dangerouslySetInnerHTML:{__html:t.value.terms_html??""}}),d("div",{className:"flex justify-end gap-2",children:[d(Ye,{onClick:n,children:e.dismiss_terms}),d(Ye,{onClick:r,variant:"primary",children:e.accept_terms})]})]})}function Lf({copyText:e,children:t}){const n=fe(),[r,o]=S(!1);A(()=>{if(r){const i=setTimeout(()=>{o(!1)},2e3);return()=>{clearTimeout(i)}}},[r]);const a=$(()=>{const i=La(e);i&&(navigator.clipboard.writeText(i),o(!0))},[]);return d(Ye,{onClick:a,children:r?n.copied:t})}function Rf({sawError:e}){const t=fe(),{error:n,lastId:r}=de(),o=$(()=>{e.value=!0},[]);return d("div",{className:"max-w-[400px] flex flex-col gap-2 bg-base shadow-md pointer-events-auto rounded-sheet p-3 text-sm",children:[d("div",{className:"p-2 pt-1",children:[d("h1",{className:"text-md font-medium pb-1",children:t.error_occurred}),n.value,r.value&&d(ee,{children:[d("br",{}),d("span",{className:"text-base-subtle",children:[t.conversation_id,": ",r.value]})]})]}),d("div",{className:"flex justify-end gap-2",children:[d(Lf,{copyText:r,children:t.copy_id}),d(Ye,{variant:"primary",onClick:o,children:"Close"})]})]})}function Ff(){const e=ce();return e.value.disable_banner?null:d("p",{className:Y("whitespace-nowrap [line-height:var(--el-overlay-padding)] text-[10px] px-3",e.value.placement.startsWith("top")?"-translate-y-[calc(var(--el-overlay-padding))]":"translate-y-[calc(var(--el-overlay-padding))]"),children:[d("span",{className:"opacity-30",children:"Powered by ElevenLabs"})," ",d("a",{href:e.value.override_link||"https://elevenlabs.io/conversational-ai",className:"underline cursor-pointer pointer-events-auto focus-visible:outline-none opacity-30 hover:opacity-50 focus-visible:opacity-100 focus-visible:underline-offset-2",target:"_blank",children:"Conversational AI"})]})}const Pt={left:"items-start",center:"items-center",right:"items-end"},At={top:"flex-col-reverse justify-end",bottom:"flex-col justify-end"},zf={"top-left":`${At.top} ${Pt.left}`,top:`${At.top} ${Pt.center}`,"top-right":`${At.top} ${Pt.right}`,"bottom-left":`${At.bottom} ${Pt.left}`,bottom:`${At.bottom} ${Pt.center}`,"bottom-right":`${At.bottom} ${Pt.right}`},Uf=tn(function(){const e=xe(!1),t=ce(),n=xe(!1),{error:r}=de(),o=dn(),a=Q(()=>t.value.transcript_enabled||t.value.text_input_enabled),i=Q(()=>Y("overlay flex transition-opacity duration-200 data-hidden:opacity-0",zf[t.value.placement]));je(()=>{r.value&&(a.value?(n.value=!0,e.value=!0):n.value=!1)});const s=Q(()=>!a.value&&r.value&&!n.value?"error":!o.termsAccepted.value&&o.termsShown.value?"terms":"conversation"),l=Q(()=>s.value==="error"),c=Q(()=>s.value==="terms"),f=Q(()=>s.value==="conversation");return d(ee,{children:[d(ke,{initial:!1,active:f,children:d(pn,{className:i,children:[a.value&&d(Nf,{open:e}),d(Mf,{expandable:a.value,expanded:e})]})}),d(ke,{initial:!1,active:c,children:d(pn,{className:i,children:d(Of,{})})}),d(ke,{initial:!1,active:l,children:d(pn,{className:i,children:d(Rf,{sawError:n})})}),d(pn,{className:i,children:d(Ff,{})})]})});function Bf(e){return d(gl,{value:e,children:d(Cl,{children:d(Il,{children:d(Nl,{children:d(Ml,{children:d(Sl,{children:d(El,{children:d(Pl,{children:d(Ol,{children:d(Ll,{children:[d(ml,{}),d(Uf,{})]})})})})})})})})})})}function Wf(e="elevenlabs-convai"){Os(Bf,e,[...hr],{shadow:!0})}Wf()})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elevenlabs/convai-widget-embed",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "The Conversational AI Widget bundled with all dependencies for easy embedding.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"unpkg": "./dist/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"microbundle": "^0.15.1",
|
|
15
15
|
"typescript": "^5.5.4",
|
|
16
16
|
"vite": "^6.3.2",
|
|
17
|
-
"@elevenlabs/convai-widget-core": "0.0.
|
|
17
|
+
"@elevenlabs/convai-widget-core": "0.0.7"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|