@helpai/elements 0.53.0 → 0.54.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configurator.mjs +2 -2
- package/elements-web-component.esm.js +29 -29
- package/elements-web-component.esm.js.map +4 -4
- package/elements.cjs.js +29 -29
- package/elements.cjs.js.map +4 -4
- package/elements.esm.js +29 -29
- package/elements.esm.js.map +4 -4
- package/elements.js +28 -28
- package/elements.js.map +4 -4
- package/index.d.ts +4 -4
- package/index.mjs +206 -284
- package/package.json +1 -1
- package/schema.d.ts +1 -1
- package/schema.json +4 -4
- package/schema.mjs +2 -2
- package/web-component.mjs +206 -284
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var zc=Object.defineProperty;var Uc=(e,t,n)=>t in e?zc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var V=(e,t,n)=>Uc(e,typeof t!="symbol"?t+"":t,n);var Hn,J,Ri,cr,st,ki,Ai,Ii,ir,Mn,Qt,Li,dr,ar,sr,Vc,On={},Dn=[],qc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Bn=Array.isArray;function et(e,t){for(var n in t)e[n]=t[n];return e}function _r(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Fn(e,t,n){var o,i,a,l={};for(a in t)a=="key"?o=t[a]:a=="ref"?i=t[a]:l[a]=t[a];if(arguments.length>2&&(l.children=arguments.length>3?Hn.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)l[a]===void 0&&(l[a]=e.defaultProps[a]);return Nn(e,l,o,i,null)}function Nn(e,t,n,o,i){var a={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Ri,__i:-1,__u:0};return i==null&&J.vnode!=null&&J.vnode(a),a}function ee(e){return e.children}function lt(e,t){this.props=e,this.context=t}function Tt(e,t){if(t==null)return e.__?Tt(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"?Tt(e):null}function Wc(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],i=[],a=et({},t);a.__v=t.__v+1,J.vnode&&J.vnode(a),ur(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??Tt(t),!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,Di(o,a,i),t.__e=t.__=null,a.__e!=n&&Mi(a)}}function Mi(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Mi(e)}function Ci(e){(!e.__d&&(e.__d=!0)&&st.push(e)&&!$n.__r++||ki!=J.debounceRendering)&&((ki=J.debounceRendering)||Ai)($n)}function $n(){try{for(var e,t=1;st.length;)st.length>t&&st.sort(Ii),e=st.shift(),t=st.length,Wc(e)}finally{st.length=$n.__r=0}}function Ni(e,t,n,o,i,a,l,s,c,d,u){var _,g,f,m,C,v,b,y=o&&o.__k||Dn,P=t.length;for(c=Gc(n,t,y,c,P),_=0;_<P;_++)(f=n.__k[_])!=null&&(g=f.__i!=-1&&y[f.__i]||On,f.__i=_,v=ur(e,f,g,i,a,l,s,c,d,u),m=f.__e,f.ref&&g.ref!=f.ref&&(g.ref&&pr(g.ref,null,f),u.push(f.ref,f.__c||m,f)),C==null&&m!=null&&(C=m),(b=!!(4&f.__u))||g.__k===f.__k?(c=Oi(f,c,e,b),b&&g.__e&&(g.__e=null)):typeof f.type=="function"&&v!==void 0?c=v:m&&(c=m.nextSibling),f.__u&=-7);return n.__e=C,c}function Gc(e,t,n,o,i){var a,l,s,c,d,u=n.length,_=u,g=0;for(e.__k=new Array(i),a=0;a<i;a++)(l=t[a])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[a]=Nn(null,l,null,null,null):Bn(l)?l=e.__k[a]=Nn(ee,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[a]=Nn(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[a]=l,c=a+g,l.__=e,l.__b=e.__b+1,s=null,(d=l.__i=Kc(l,n,c,_))!=-1&&(_--,(s=n[d])&&(s.__u|=2)),s==null||s.__v==null?(d==-1&&(i>u?g--:i<u&&g++),typeof l.type!="function"&&(l.__u|=4)):d!=c&&(d==c-1?g--:d==c+1?g++:(d>c?g--:g++,l.__u|=4))):e.__k[a]=null;if(_)for(a=0;a<u;a++)(s=n[a])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=Tt(s)),Hi(s,s));return o}function Oi(e,t,n,o){var i,a;if(typeof e.type=="function"){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=Oi(i[a],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Tt(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Kc(e,t,n,o){var i,a,l,s=e.key,c=e.type,d=t[n],u=d!=null&&(2&d.__u)==0;if(d===null&&s==null||u&&s==d.key&&c==d.type)return n;if(o>(u?1:0)){for(i=n-1,a=n+1;i>=0||a<t.length;)if((d=t[l=i>=0?i--:a++])!=null&&(2&d.__u)==0&&s==d.key&&c==d.type)return l}return-1}function Ti(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||qc.test(t)?n:n+"px"}function Ln(e,t,n,o,i){var a,l;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||Ti(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Ti(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")a=t!=(t=t.replace(Li,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?o?n[Qt]=o[Qt]:(n[Qt]=dr,e.addEventListener(t,a?sr:ar,a)):e.removeEventListener(t,a?sr:ar,a);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Ei(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[Mn]==null)t[Mn]=dr++;else if(t[Mn]<n[Qt])return;return n(J.event?J.event(t):t)}}}function ur(e,t,n,o,i,a,l,s,c,d){var u,_,g,f,m,C,v,b,y,P,E,B,le,M,Z,F=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(u=J.__b)&&u(t);e:if(typeof F=="function")try{if(b=t.props,y=F.prototype&&F.prototype.render,P=(u=F.contextType)&&o[u.__c],E=u?P?P.props.value:u.__:o,n.__c?v=(_=t.__c=n.__c).__=_.__E:(y?t.__c=_=new F(b,E):(t.__c=_=new lt(b,E),_.constructor=F,_.render=Yc),P&&P.sub(_),_.state||(_.state={}),_.__n=o,g=_.__d=!0,_.__h=[],_._sb=[]),y&&_.__s==null&&(_.__s=_.state),y&&F.getDerivedStateFromProps!=null&&(_.__s==_.state&&(_.__s=et({},_.__s)),et(_.__s,F.getDerivedStateFromProps(b,_.__s))),f=_.props,m=_.state,_.__v=t,g)y&&F.getDerivedStateFromProps==null&&_.componentWillMount!=null&&_.componentWillMount(),y&&_.componentDidMount!=null&&_.__h.push(_.componentDidMount);else{if(y&&F.getDerivedStateFromProps==null&&b!==f&&_.componentWillReceiveProps!=null&&_.componentWillReceiveProps(b,E),t.__v==n.__v||!_.__e&&_.shouldComponentUpdate!=null&&_.shouldComponentUpdate(b,_.__s,E)===!1){t.__v!=n.__v&&(_.props=b,_.state=_.__s,_.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(G){G&&(G.__=t)}),Dn.push.apply(_.__h,_._sb),_._sb=[],_.__h.length&&l.push(_);break e}_.componentWillUpdate!=null&&_.componentWillUpdate(b,_.__s,E),y&&_.componentDidUpdate!=null&&_.__h.push(function(){_.componentDidUpdate(f,m,C)})}if(_.context=E,_.props=b,_.__P=e,_.__e=!1,B=J.__r,le=0,y)_.state=_.__s,_.__d=!1,B&&B(t),u=_.render(_.props,_.state,_.context),Dn.push.apply(_.__h,_._sb),_._sb=[];else do _.__d=!1,B&&B(t),u=_.render(_.props,_.state,_.context),_.state=_.__s;while(_.__d&&++le<25);_.state=_.__s,_.getChildContext!=null&&(o=et(et({},o),_.getChildContext())),y&&!g&&_.getSnapshotBeforeUpdate!=null&&(C=_.getSnapshotBeforeUpdate(f,m)),M=u!=null&&u.type===ee&&u.key==null?$i(u.props.children):u,s=Ni(e,Bn(M)?M:[M],t,n,o,i,a,l,s,c,d),_.base=t.__e,t.__u&=-161,_.__h.length&&l.push(_),v&&(_.__E=_.__=null)}catch(G){if(t.__v=null,c||a!=null)if(G.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__e=s}else{for(Z=a.length;Z--;)_r(a[Z]);lr(t)}else t.__e=n.__e,t.__k=n.__k,G.then||lr(t);J.__e(G,t,n)}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=jc(n.__e,t,n,o,i,a,l,c,d);return(u=J.diffed)&&u(t),128&t.__u?void 0:s}function lr(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(lr))}function Di(e,t,n){for(var o=0;o<n.length;o++)pr(n[o],n[++o],n[++o]);J.__c&&J.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(a){a.call(i)})}catch(a){J.__e(a,i.__v)}})}function $i(e){return typeof e!="object"||e==null||e.__b>0?e:Bn(e)?e.map($i):e.constructor!==void 0?null:et({},e)}function jc(e,t,n,o,i,a,l,s,c){var d,u,_,g,f,m,C,v=n.props||On,b=t.props,y=t.type;if(y=="svg"?i="http://www.w3.org/2000/svg":y=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),a!=null){for(d=0;d<a.length;d++)if((f=a[d])&&"setAttribute"in f==!!y&&(y?f.localName==y:f.nodeType==3)){e=f,a[d]=null;break}}if(e==null){if(y==null)return document.createTextNode(b);e=document.createElementNS(i,y,b.is&&b),s&&(J.__m&&J.__m(t,a),s=!1),a=null}if(y==null)v===b||s&&e.data==b||(e.data=b);else{if(a=y=="textarea"&&b.defaultValue!=null?null:a&&Hn.call(e.childNodes),!s&&a!=null)for(v={},d=0;d<e.attributes.length;d++)v[(f=e.attributes[d]).name]=f.value;for(d in v)f=v[d],d=="dangerouslySetInnerHTML"?_=f:d=="children"||d in b||d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b||Ln(e,d,null,f,i);for(d in b)f=b[d],d=="children"?g=f:d=="dangerouslySetInnerHTML"?u=f:d=="value"?m=f:d=="checked"?C=f:s&&typeof f!="function"||v[d]===f||Ln(e,d,f,v[d],i);if(u)s||_&&(u.__html==_.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(_&&(e.innerHTML=""),Ni(t.type=="template"?e.content:e,Bn(g)?g:[g],t,n,o,y=="foreignObject"?"http://www.w3.org/1999/xhtml":i,a,l,a?a[0]:n.__k&&Tt(n,0),s,c),a!=null)for(d=a.length;d--;)_r(a[d]);s&&y!="textarea"||(d="value",y=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[d]||y=="progress"&&!m||y=="option"&&m!=v[d])&&Ln(e,d,m,v[d],i),d="checked",C!=null&&C!=e[d]&&Ln(e,d,C,v[d],i))}return e}function pr(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(i){J.__e(i,n)}}function Hi(e,t,n){var o,i;if(J.unmount&&J.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||pr(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(a){J.__e(a,t)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&Hi(o[i],t,n||typeof e.type!="function");n||_r(e.__e),e.__c=e.__=e.__e=void 0}function Yc(e,t,n){return this.constructor(e,n)}function zn(e,t,n){var o,i,a,l;t==document&&(t=document.documentElement),J.__&&J.__(e,t),i=(o=typeof n=="function")?null:n&&n.__k||t.__k,a=[],l=[],ur(t,e=(!o&&n||t).__k=Fn(ee,null,[e]),i||On,On,t.namespaceURI,!o&&n?[n]:i?null:t.firstChild?Hn.call(t.childNodes):null,a,!o&&n?n:i?i.__e:t.firstChild,o,l),Di(a,e,l)}Hn=Dn.slice,J={__e:function(e,t,n,o){for(var i,a,l;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),l=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,o||{}),l=i.__d),l)return i.__E=i}catch(s){e=s}throw e}},Ri=0,cr=function(e){return e!=null&&e.constructor===void 0},lt.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=et({},this.state),typeof e=="function"&&(e=e(et({},n),this.props)),e&&et(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ci(this))},lt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ci(this))},lt.prototype.render=ee,st=[],Ai=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ii=function(e,t){return e.__v.__b-t.__v.__b},$n.__r=0,ir=Math.random().toString(8),Mn="__d"+ir,Qt="__a"+ir,Li=/(PointerCapture)$|Capture$/i,dr=0,ar=Ei(!1),sr=Ei(!0),Vc=0;var x={id:"help-ai",name:"@helpai/elements",global:"HelpAI",tagName:"web-ai-chat",cssPrefix:"helpai",defaultBaseUrl:"https://help.ai",displayName:"Help AI",domain:"help.ai",siteUrl:"https://help.ai"};var Bi={attach:"Attach files",attachmentMimeRejected:"File type not supported",attachmentTooLarge:"File is too large",attachmentTooMany:"Attachment limit reached",conversationClosed:"This conversation is closed",conversationLoading:"Loading conversation\u2026",close:"Close",collapse:"Collapse",collapseSidebar:"Collapse sidebar",composerPlaceholder:"Type a message\u2026",dateLastWeek:"Last 7 days",dateOlder:"Older",dateToday:"Today",dateYesterday:"Yesterday",dropZone:"Drop files to attach",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous conversations yet",historyLoading:"Loading your conversations\u2026",historyContinue:"Continue the conversation",historyTitle:"Conversation history",language:"Language",launcherOpen:"Open chat",launcherLabel:"Chat with us",micStart:"Start voice input",micStop:"Stop voice input",micUnsupported:"Voice input is not supported in this browser",moreActions:"More actions",newConversation:"New conversation",panelTitle:"Chat",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",soundOff:"Sound off",soundOn:"Sound on",startNewConversation:"Start a new conversation",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",thinking:"Thinking\u2026",thoughts:"Thoughts",usedTool:"Used tool",toolResult:"Result",sources:"Sources",tabHome:"Home",tabConversations:"Conversations",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",moduleBack:"Back",contentLoading:"Loading\u2026",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results found",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsBack:"Back to news",newsPublishedAt:"Published {date}",formSubmit:"Submit",formSkip:"Maybe later",formSubmitted:"Completed",formSkipped:"Maybe later",formFillOut:"Fill out",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidUrl:"Enter a valid URL",formInvalidNumber:"Enter a valid number",formTooShort:"Too short (min {min} characters)",formTooLong:"Too long (max {max} characters)",formNumberTooSmall:"Must be at least {min}",formNumberTooLarge:"Must be at most {max}",formPatternMismatch:"Please match the requested format",formChooseAtLeast:"Choose at least {min}",formChooseAtMost:"Choose at most {max}",formOther:"Other",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"User Input Required",inputBadge:"User Input",inputAnswered:"Answered",inputSkipped:"Skipped",inputQuestion:"Question",inputYourAnswer:"Your answer",inputSubmit:"Submit answer",inputSubmitHint:"Enter to send \xB7 Shift+Enter = new line",inputAnswerPlaceholder:"Type your answer\u2026",inputSkip:"Skip",confirmYes:"Yes",confirmNo:"No",inputConfirmHint:"Choose yes or no.",inputOptionalNote:"Optional note",inputOptionalNotePlaceholder:"Optional comment\u2026",inputSubmitted:"Answer submitted",respFreeText:"Free Text",respSingleChoice:"Single Choice",respMultiChoice:"Multiple Choice",respConfirmation:"Confirmation",approvalRequired:"Approval required",approve:"Approve",reject:"Reject",approved:"Approved",rejected:"Rejected",approvalReason:"Add a reason (optional)",approvalPrompt:"{tool} requires your approval to execute.",approvalBody:"Review the tool input above and decide whether to allow this action.",approvalYourResponse:"Your response: {decision}",approvalEditHint:"You can edit this response until this step continues.",approvalSubmitting:"Response submitted. Request in progress\u2026",edit:"Edit",toolParameters:"Parameters",statusAwaiting:"Awaiting Approval",statusResponded:"Responded",statusRunning:"Running",statusCompleted:"Completed",statusDenied:"Denied",statusError:"Error",statusSuperseded:"Skipped"},Xc={attach:"Joindre des fichiers",attachmentMimeRejected:"Type de fichier non pris en charge",attachmentTooLarge:"Le fichier est trop volumineux",attachmentTooMany:"Limite de pi\xE8ces jointes atteinte",conversationClosed:"Cette conversation est ferm\xE9e",conversationLoading:"Chargement de la conversation\u2026",close:"Fermer",collapse:"R\xE9duire",collapseSidebar:"R\xE9duire la barre lat\xE9rale",composerPlaceholder:"\xC9crivez un message\u2026",dateLastWeek:"7 derniers jours",dateOlder:"Plus ancien",dateToday:"Aujourd'hui",dateYesterday:"Hier",dropZone:"D\xE9posez les fichiers \xE0 joindre",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRetry:"R\xE9essayer",expand:"Agrandir",expandSidebar:"D\xE9velopper la barre lat\xE9rale",exitFullscreen:"Quitter le plein \xE9cran",fullscreen:"Plein \xE9cran",history:"Historique",historyBack:"Retour au chat",historyEmpty:"Aucune conversation pour le moment",historyContinue:"Poursuivre la conversation",historyLoading:"Chargement de vos conversations\u2026",historyTitle:"Historique des conversations",language:"Langue",launcherOpen:"Ouvrir le chat",launcherLabel:"Discuter avec nous",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",micUnsupported:"La saisie vocale n'est pas prise en charge par ce navigateur",moreActions:"Plus d'actions",newConversation:"Nouvelle conversation",panelTitle:"Chat",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",startNewConversation:"D\xE9marrer une nouvelle conversation",stop:"Arr\xEAter",theme:"Th\xE8me",themeAuto:"Auto",themeDark:"Sombre",themeLight:"Clair",textSize:"Taille du texte",textSizeSmall:"Petite",textSizeNormal:"Normale",textSizeLarge:"Grande",loading:"Chargement\u2026",thinking:"R\xE9flexion\u2026",thoughts:"R\xE9flexions",usedTool:"Outil utilis\xE9",toolResult:"R\xE9sultat",sources:"Sources",tabHome:"Accueil",tabConversations:"Conversations",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeContentTitle:"Articles populaires",homeStatus:"Statut",helpTitle:"Aide",helpSearchPlaceholder:"Rechercher de l'aide",helpEmpty:"Aucun article d'aide pour le moment",helpLoading:"Chargement de l'aide\u2026",helpSearchEmpty:"Aucun r\xE9sultat trouv\xE9",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsBack:"Retour aux actualit\xE9s",newsPublishedAt:"Publi\xE9 le {date}",formSubmit:"Envoyer",formSkip:"Plus tard",formSubmitted:"Termin\xE9",formSkipped:"Plus tard",formFillOut:"Remplir",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidUrl:"Saisissez une URL valide",formInvalidNumber:"Saisissez un nombre valide",formTooShort:"Trop court (min. {min} caract\xE8res)",formTooLong:"Trop long (max. {max} caract\xE8res)",formNumberTooSmall:"Doit \xEAtre au moins {min}",formNumberTooLarge:"Doit \xEAtre au plus {max}",formPatternMismatch:"Veuillez respecter le format demand\xE9",formChooseAtLeast:"Choisissez au moins {min}",formChooseAtMost:"Choisissez au plus {max}",formOther:"Autre",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Saisie requise",inputBadge:"Saisie",inputAnswered:"R\xE9pondu",inputSkipped:"Ignor\xE9",inputQuestion:"Question",inputYourAnswer:"Votre r\xE9ponse",inputSubmit:"Envoyer la r\xE9ponse",inputSubmitHint:"Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e = saut de ligne",inputAnswerPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputSkip:"Ignorer",confirmYes:"Oui",confirmNo:"Non",inputConfirmHint:"Choisissez oui ou non.",inputOptionalNote:"Note facultative",inputOptionalNotePlaceholder:"Commentaire facultatif\u2026",inputSubmitted:"R\xE9ponse envoy\xE9e",respFreeText:"Texte libre",respSingleChoice:"Choix unique",respMultiChoice:"Choix multiple",respConfirmation:"Confirmation",approvalRequired:"Approbation requise",approve:"Approuver",reject:"Refuser",approved:"Approuv\xE9",rejected:"Refus\xE9",approvalReason:"Ajouter une raison (facultatif)",approvalPrompt:"{tool} n\xE9cessite votre approbation pour s'ex\xE9cuter.",approvalBody:"V\xE9rifiez les param\xE8tres ci-dessus et d\xE9cidez d'autoriser ou non cette action.",approvalYourResponse:"Votre r\xE9ponse : {decision}",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",approvalSubmitting:"R\xE9ponse envoy\xE9e. Traitement en cours\u2026",edit:"Modifier",toolParameters:"Param\xE8tres",statusAwaiting:"En attente d'approbation",statusResponded:"R\xE9pondu",statusRunning:"En cours",statusCompleted:"Termin\xE9",statusDenied:"Refus\xE9",statusError:"Erreur",statusSuperseded:"Ignor\xE9"},Jc={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645",attachmentTooLarge:"\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627",attachmentTooMany:"\u062A\u0645 \u0628\u0644\u0648\u063A \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A",conversationClosed:"\u062A\u0645 \u0625\u063A\u0644\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629\u2026",close:"\u0625\u063A\u0644\u0627\u0642",collapse:"\u0637\u064A\u0651",collapseSidebar:"\u0637\u064A\u0651 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",composerPlaceholder:"\u0627\u0643\u062A\u0628 \u0631\u0633\u0627\u0644\u0629\u2026",dateLastWeek:"\u0622\u062E\u0631 \u0667 \u0623\u064A\u0627\u0645",dateOlder:"\u0623\u0642\u062F\u0645",dateToday:"\u0627\u0644\u064A\u0648\u0645",dateYesterday:"\u0623\u0645\u0633",dropZone:"\u0623\u0641\u0644\u062A \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0644\u0625\u0631\u0641\u0627\u0642\u0647\u0627",errorGeneric:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0627",errorRateLimited:"\u0637\u0644\u0628\u0627\u062A \u0643\u062B\u064A\u0631\u0629 \u062C\u062F\u064B\u0627 \u2014 \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0628\u0639\u062F \u0644\u062D\u0638\u0629.",errorRetry:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",expand:"\u062A\u0648\u0633\u064A\u0639",expandSidebar:"\u062A\u0648\u0633\u064A\u0639 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",exitFullscreen:"\u0625\u0646\u0647\u0627\u0621 \u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",fullscreen:"\u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",history:"\u0627\u0644\u0633\u062C\u0644",historyBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",historyEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u062D\u0627\u062F\u062B\u0627\u062A \u0633\u0627\u0628\u0642\u0629 \u0628\u0639\u062F",historyContinue:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",historyLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0645\u062D\u0627\u062F\u062B\u0627\u062A\u0643\u2026",historyTitle:"\u0633\u062C\u0644 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0627\u062A",language:"\u0627\u0644\u0644\u063A\u0629",launcherOpen:"\u0641\u062A\u062D \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",launcherLabel:"\u062A\u062D\u062F\u062B \u0645\u0639\u0646\u0627",micStart:"\u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micStop:"\u0625\u064A\u0642\u0627\u0641 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micUnsupported:"\u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645 \u0641\u064A \u0647\u0630\u0627 \u0627\u0644\u0645\u062A\u0635\u0641\u062D",moreActions:"\u0625\u062C\u0631\u0627\u0621\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629",newConversation:"\u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629",panelTitle:"\u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",resizeHandle:"\u0627\u0633\u062D\u0628 \u0644\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u062D\u062C\u0645",scrollToBottom:"\u0627\u0644\u0627\u0646\u062A\u0642\u0627\u0644 \u0625\u0644\u0649 \u0627\u0644\u0623\u062D\u062F\u062B",send:"\u0625\u0631\u0633\u0627\u0644",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",startNewConversation:"\u0628\u062F\u0621 \u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629",stop:"\u0625\u064A\u0642\u0627\u0641",theme:"\u0627\u0644\u0645\u0638\u0647\u0631",themeAuto:"\u062A\u0644\u0642\u0627\u0626\u064A",themeDark:"\u062F\u0627\u0643\u0646",themeLight:"\u0641\u0627\u062A\u062D",textSize:"\u062D\u062C\u0645 \u0627\u0644\u0646\u0635",textSizeSmall:"\u0635\u063A\u064A\u0631",textSizeNormal:"\u0639\u0627\u062F\u064A",textSizeLarge:"\u0643\u0628\u064A\u0631",loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thoughts:"\u0627\u0644\u0623\u0641\u0643\u0627\u0631",usedTool:"\u0623\u062F\u0627\u0629 \u0645\u064F\u0633\u062A\u062E\u062F\u064E\u0645\u0629",toolResult:"\u0627\u0644\u0646\u062A\u064A\u062C\u0629",sources:"\u0627\u0644\u0645\u0635\u0627\u062F\u0631",tabHome:"\u0627\u0644\u0631\u0626\u064A\u0633\u064A\u0629",tabConversations:"\u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0627\u062A",tabHelp:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",tabNews:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",modulesEmpty:"\u0644\u0627 \u0634\u064A\u0621 \u0647\u0646\u0627 \u0628\u0639\u062F",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",homeGreeting:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeGreetingNamed:"\u0645\u0631\u062D\u0628\u064B\u0627 {name} \u{1F44B}",homeGreetingLead:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",homeContentTitle:"\u0645\u0642\u0627\u0644\u0627\u062A \u0634\u0627\u0626\u0639\u0629",homeStatus:"\u0627\u0644\u062D\u0627\u0644\u0629",helpTitle:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",helpSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",helpEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u0642\u0627\u0644\u0627\u062A \u0645\u0633\u0627\u0639\u062F\u0629 \u0628\u0639\u062F",helpLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629\u2026",helpSearchEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C",newsTitle:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0623\u062E\u0628\u0627\u0631 \u0628\u0639\u062F",newsLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0623\u062E\u0628\u0627\u0631\u2026",newsBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsPublishedAt:"\u0646\u064F\u0634\u0631 \u0641\u064A {date}",formSubmit:"\u0625\u0631\u0633\u0627\u0644",formSkip:"\u0644\u0627\u062D\u0642\u064B\u0627",formSubmitted:"\u062A\u0645",formSkipped:"\u0644\u0627\u062D\u0642\u064B\u0627",formFillOut:"\u062A\u0639\u0628\u0626\u0629",formRequired:"\u0647\u0630\u0627 \u0627\u0644\u062D\u0642\u0644 \u0645\u0637\u0644\u0648\u0628",formInvalidEmail:"\u0623\u062F\u062E\u0644 \u0628\u0631\u064A\u062F\u064B\u0627 \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidTel:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidUrl:"\u0623\u062F\u062E\u0644 \u0631\u0627\u0628\u0637\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formTooShort:"\u0642\u0635\u064A\u0631 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 {min} \u062D\u0631\u0641\u064B\u0627)",formTooLong:"\u0637\u0648\u064A\u0644 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 {max} \u062D\u0631\u0641\u064B\u0627)",formNumberTooSmall:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0642\u0644 \u0639\u0646 {min}",formNumberTooLarge:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0632\u064A\u062F \u0639\u0646 {max}",formPatternMismatch:"\u064A\u0631\u062C\u0649 \u0645\u0637\u0627\u0628\u0642\u0629 \u0627\u0644\u0635\u064A\u063A\u0629 \u0627\u0644\u0645\u0637\u0644\u0648\u0628\u0629",formChooseAtLeast:"\u0627\u062E\u062A\u0631 {min} \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644",formChooseAtMost:"\u0627\u062E\u062A\u0631 {max} \u0639\u0644\u0649 \u0627\u0644\u0623\u0643\u062B\u0631",formOther:"\u0623\u062E\u0631\u0649",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0645\u0637\u0644\u0648\u0628 \u0625\u062F\u062E\u0627\u0644 \u0645\u0646 \u0627\u0644\u0645\u0633\u062A\u062E\u062F\u0645",inputBadge:"\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0645\u0633\u062A\u062E\u062F\u0645",inputAnswered:"\u062A\u0645\u062A \u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputSkipped:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A",inputQuestion:"\u0627\u0644\u0633\u0624\u0627\u0644",inputYourAnswer:"\u0625\u062C\u0627\u0628\u062A\u0643",inputSubmit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputSubmitHint:"Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter = \u0633\u0637\u0631 \u062C\u062F\u064A\u062F",inputAnswerPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputSkip:"\u062A\u062E\u0637\u064D\u0651",confirmYes:"\u0646\u0639\u0645",confirmNo:"\u0644\u0627",inputConfirmHint:"\u0627\u062E\u062A\u0631 \u0646\u0639\u0645 \u0623\u0648 \u0644\u0627.",inputOptionalNote:"\u0645\u0644\u0627\u062D\u0638\u0629 \u0627\u062E\u062A\u064A\u0627\u0631\u064A\u0629",inputOptionalNotePlaceholder:"\u062A\u0639\u0644\u064A\u0642 \u0627\u062E\u062A\u064A\u0627\u0631\u064A\u2026",inputSubmitted:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",respFreeText:"\u0646\u0635 \u062D\u0631",respSingleChoice:"\u0627\u062E\u062A\u064A\u0627\u0631 \u0648\u0627\u062D\u062F",respMultiChoice:"\u0627\u062E\u062A\u064A\u0627\u0631 \u0645\u062A\u0639\u062F\u062F",respConfirmation:"\u062A\u0623\u0643\u064A\u062F",approvalRequired:"\u0645\u0637\u0644\u0648\u0628 \u0645\u0648\u0627\u0641\u0642\u0629",approve:"\u0645\u0648\u0627\u0641\u0642\u0629",reject:"\u0631\u0641\u0636",approved:"\u062A\u0645\u062A \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",rejected:"\u0645\u0631\u0641\u0648\u0636",approvalReason:"\u0623\u0636\u0641 \u0633\u0628\u0628\u064B\u0627 (\u0627\u062E\u062A\u064A\u0627\u0631\u064A)",approvalPrompt:"\u062A\u062A\u0637\u0644\u0628 {tool} \u0645\u0648\u0627\u0641\u0642\u062A\u0643 \u0644\u0644\u062A\u0646\u0641\u064A\u0630.",approvalBody:"\u0631\u0627\u062C\u0639 \u0645\u064F\u0639\u0637\u064A\u0627\u062A \u0627\u0644\u0623\u062F\u0627\u0629 \u0623\u0639\u0644\u0627\u0647 \u0648\u0642\u0631\u0651\u0631 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \u0623\u0648 \u0631\u0641\u0636\u0647.",approvalYourResponse:"\u0631\u062F\u0651\u0643: {decision}",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u0639\u062F\u064A\u0644 \u0631\u062F\u0651\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",approvalSubmitting:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062F. \u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",edit:"\u062A\u0639\u062F\u064A\u0644",toolParameters:"\u0627\u0644\u0645\u0639\u0637\u064A\u0627\u062A",statusAwaiting:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",statusResponded:"\u062A\u0645 \u0627\u0644\u0631\u062F",statusRunning:"\u0642\u064A\u062F \u0627\u0644\u062A\u0646\u0641\u064A\u0630",statusCompleted:"\u0645\u0643\u062A\u0645\u0644",statusDenied:"\u0645\u0631\u0641\u0648\u0636",statusError:"\u062E\u0637\u0623",statusSuperseded:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A"},Qc={attach:"Adjuntar archivos",attachmentMimeRejected:"Tipo de archivo no admitido",attachmentTooLarge:"El archivo es demasiado grande",attachmentTooMany:"Se alcanz\xF3 el l\xEDmite de adjuntos",conversationClosed:"Esta conversaci\xF3n est\xE1 cerrada",conversationLoading:"Cargando conversaci\xF3n\u2026",close:"Cerrar",collapse:"Contraer",collapseSidebar:"Contraer la barra lateral",composerPlaceholder:"Escribe un mensaje\u2026",dateLastWeek:"\xDAltimos 7 d\xEDas",dateOlder:"Anteriores",dateToday:"Hoy",dateYesterday:"Ayer",dropZone:"Suelta los archivos para adjuntarlos",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRetry:"Reintentar",expand:"Ampliar",expandSidebar:"Expandir la barra lateral",exitFullscreen:"Salir de pantalla completa",fullscreen:"Pantalla completa",history:"Historial",historyBack:"Volver al chat",historyEmpty:"A\xFAn no tienes conversaciones",historyContinue:"Continuar la conversaci\xF3n",historyLoading:"Cargando tus conversaciones\u2026",historyTitle:"Historial de conversaciones",language:"Idioma",launcherOpen:"Abrir el chat",launcherLabel:"Chatea con nosotros",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",micUnsupported:"Este navegador no admite la entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nueva conversaci\xF3n",panelTitle:"Chat",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",soundOff:"Sonido desactivado",soundOn:"Sonido activado",startNewConversation:"Iniciar una conversaci\xF3n nueva",stop:"Detener",theme:"Tema",themeAuto:"Autom\xE1tico",themeDark:"Oscuro",themeLight:"Claro",textSize:"Tama\xF1o del texto",textSizeSmall:"Peque\xF1o",textSizeNormal:"Normal",textSizeLarge:"Grande",loading:"Cargando\u2026",thinking:"Pensando\u2026",thoughts:"Razonamiento",usedTool:"Herramienta usada",toolResult:"Resultado",sources:"Fuentes",tabHome:"Inicio",tabConversations:"Conversaciones",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeContentTitle:"Art\xEDculos populares",homeStatus:"Estado",helpTitle:"Ayuda",helpSearchPlaceholder:"Buscar ayuda",helpEmpty:"A\xFAn no hay art\xEDculos de ayuda",helpLoading:"Cargando la ayuda\u2026",helpSearchEmpty:"No se encontraron resultados",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsBack:"Volver a novedades",newsPublishedAt:"Publicado el {date}",formSubmit:"Enviar",formSkip:"Quiz\xE1 m\xE1s tarde",formSubmitted:"Completado",formSkipped:"Quiz\xE1 m\xE1s tarde",formFillOut:"Completar",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidUrl:"Introduce una URL v\xE1lida",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formTooShort:"Demasiado corto (m\xEDn. {min} caracteres)",formTooLong:"Demasiado largo (m\xE1x. {max} caracteres)",formNumberTooSmall:"Debe ser al menos {min}",formNumberTooLarge:"Debe ser como m\xE1ximo {max}",formPatternMismatch:"Respeta el formato solicitado",formChooseAtLeast:"Elige al menos {min}",formChooseAtMost:"Elige como m\xE1ximo {max}",formOther:"Otro",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Entrada requerida",inputBadge:"Entrada",inputAnswered:"Respondido",inputSkipped:"Omitido",inputQuestion:"Pregunta",inputYourAnswer:"Tu respuesta",inputSubmit:"Enviar respuesta",inputSubmitHint:"Enter para enviar \xB7 May\xFAs+Enter = nueva l\xEDnea",inputAnswerPlaceholder:"Escribe tu respuesta\u2026",inputSkip:"Omitir",confirmYes:"S\xED",confirmNo:"No",inputConfirmHint:"Elige s\xED o no.",inputOptionalNote:"Nota opcional",inputOptionalNotePlaceholder:"Comentario opcional\u2026",inputSubmitted:"Respuesta enviada",respFreeText:"Texto libre",respSingleChoice:"Opci\xF3n \xFAnica",respMultiChoice:"Opci\xF3n m\xFAltiple",respConfirmation:"Confirmaci\xF3n",approvalRequired:"Aprobaci\xF3n requerida",approve:"Aprobar",reject:"Rechazar",approved:"Aprobado",rejected:"Rechazado",approvalReason:"A\xF1ade un motivo (opcional)",approvalPrompt:"{tool} requiere tu aprobaci\xF3n para ejecutarse.",approvalBody:"Revisa los par\xE1metros de arriba y decide si permites esta acci\xF3n.",approvalYourResponse:"Tu respuesta: {decision}",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",approvalSubmitting:"Respuesta enviada. Procesando\u2026",edit:"Editar",toolParameters:"Par\xE1metros",statusAwaiting:"Esperando aprobaci\xF3n",statusResponded:"Respondido",statusRunning:"En curso",statusCompleted:"Completado",statusDenied:"Denegado",statusError:"Error",statusSuperseded:"Omitido"},Zc={attach:"\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",attachmentMimeRejected:"\u05E1\u05D5\u05D2 \u05D4\u05E7\u05D5\u05D1\u05E5 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA",attachmentTooLarge:"\u05D4\u05E7\u05D5\u05D1\u05E5 \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9",attachmentTooMany:"\u05D4\u05D2\u05E2\u05EA \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D4\u05DE\u05E8\u05D1\u05D9 \u05E9\u05DC \u05E7\u05D1\u05E6\u05D9\u05DD \u05DE\u05E6\u05D5\u05E8\u05E4\u05D9\u05DD",conversationClosed:"\u05D4\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5 \u05E0\u05E1\u05D2\u05E8\u05D4",conversationLoading:"\u05D8\u05D5\u05E2\u05DF \u05E9\u05D9\u05D7\u05D4\u2026",close:"\u05E1\u05D2\u05D9\u05E8\u05D4",collapse:"\u05DB\u05D9\u05D5\u05D5\u05E5",collapseSidebar:"\u05DB\u05D9\u05D5\u05D5\u05E5 \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",composerPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D4\u05D5\u05D3\u05E2\u05D4\u2026",dateLastWeek:"7 \u05D4\u05D9\u05DE\u05D9\u05DD \u05D4\u05D0\u05D7\u05E8\u05D5\u05E0\u05D9\u05DD",dateOlder:"\u05D9\u05E9\u05DF \u05D9\u05D5\u05EA\u05E8",dateToday:"\u05D4\u05D9\u05D5\u05DD",dateYesterday:"\u05D0\u05EA\u05DE\u05D5\u05DC",dropZone:"\u05E9\u05D7\u05E8\u05E8 \u05E7\u05D1\u05E6\u05D9\u05DD \u05DB\u05D3\u05D9 \u05DC\u05E6\u05E8\u05E3",errorGeneric:"\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9",errorRateLimited:"\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 \u05E8\u05D2\u05E2.",errorRetry:"\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1",expand:"\u05D4\u05E8\u05D7\u05D1\u05D4",expandSidebar:"\u05D4\u05E8\u05D7\u05D1\u05EA \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",exitFullscreen:"\u05D9\u05E6\u05D9\u05D0\u05D4 \u05DE\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",fullscreen:"\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",history:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D4",historyBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05E9\u05D9\u05D7\u05D4",historyEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05E9\u05D9\u05D7\u05D5\u05EA \u05E7\u05D5\u05D3\u05DE\u05D5\u05EA",historyContinue:"\u05D4\u05DE\u05E9\u05DA \u05E9\u05D9\u05D7\u05D4",historyLoading:"\u05D8\u05D5\u05E2\u05DF \u05D0\u05EA \u05D4\u05E9\u05D9\u05D7\u05D5\u05EA \u05E9\u05DC\u05DA\u2026",historyTitle:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D9\u05EA \u05E9\u05D9\u05D7\u05D5\u05EA",language:"\u05E9\u05E4\u05D4",launcherOpen:"\u05E4\u05EA\u05D9\u05D7\u05EA \u05E6\u05F3\u05D0\u05D8",launcherLabel:"\u05D3\u05D1\u05E8\u05D5 \u05D0\u05D9\u05EA\u05E0\u05D5",micStart:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micStop:"\u05E2\u05E6\u05D9\u05E8\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micUnsupported:"\u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA \u05D1\u05D3\u05E4\u05D3\u05E4\u05DF \u05D6\u05D4",moreActions:"\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",newConversation:"\u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4",panelTitle:"\u05E9\u05D9\u05D7\u05D4",resizeHandle:"\u05D2\u05E8\u05D5\u05E8 \u05DC\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05D2\u05D5\u05D3\u05DC",scrollToBottom:"\u05DE\u05E2\u05D1\u05E8 \u05DC\u05D7\u05D3\u05E9 \u05D1\u05D9\u05D5\u05EA\u05E8",send:"\u05E9\u05DC\u05D9\u05D7\u05D4",soundOff:"\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",soundOn:"\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",startNewConversation:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4",stop:"\u05E2\u05E6\u05D9\u05E8\u05D4",theme:"\u05E2\u05E8\u05DB\u05EA \u05E0\u05D5\u05E9\u05D0",themeAuto:"\u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9",themeDark:"\u05DB\u05D4\u05D4",themeLight:"\u05D1\u05D4\u05D9\u05E8",textSize:"\u05D2\u05D5\u05D3\u05DC \u05D8\u05E7\u05E1\u05D8",textSizeSmall:"\u05E7\u05D8\u05DF",textSizeNormal:"\u05E8\u05D2\u05D9\u05DC",textSizeLarge:"\u05D2\u05D3\u05D5\u05DC",loading:"\u05D8\u05D5\u05E2\u05DF\u2026",thinking:"\u05D7\u05D5\u05E9\u05D1\u2026",thoughts:"\u05DE\u05D7\u05E9\u05D1\u05D5\u05EA",usedTool:"\u05DB\u05DC\u05D9 \u05D1\u05E9\u05D9\u05DE\u05D5\u05E9",toolResult:"\u05EA\u05D5\u05E6\u05D0\u05D4",sources:"\u05DE\u05E7\u05D5\u05E8\u05D5\u05EA",tabHome:"\u05D1\u05D9\u05EA",tabConversations:"\u05E9\u05D9\u05D7\u05D5\u05EA",tabHelp:"\u05E2\u05D6\u05E8\u05D4",tabNews:"\u05D7\u05D3\u05E9\u05D5\u05EA",modulesEmpty:"\u05D0\u05D9\u05DF \u05DB\u05D0\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DB\u05DC\u05D5\u05DD",moduleBack:"\u05D7\u05D6\u05E8\u05D4",contentLoading:"\u05D8\u05D5\u05E2\u05DF\u2026",homeGreeting:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeGreetingNamed:"\u05E9\u05DC\u05D5\u05DD {name} \u{1F44B}",homeGreetingLead:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",homeContentTitle:"\u05DE\u05D0\u05DE\u05E8\u05D9\u05DD \u05E4\u05D5\u05E4\u05D5\u05DC\u05E8\u05D9\u05D9\u05DD",homeStatus:"\u05E1\u05D8\u05D8\u05D5\u05E1",helpTitle:"\u05E2\u05D6\u05E8\u05D4",helpSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",helpEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DE\u05D0\u05DE\u05E8\u05D9 \u05E2\u05D6\u05E8\u05D4",helpLoading:"\u05D8\u05D5\u05E2\u05DF \u05E2\u05D6\u05E8\u05D4\u2026",helpSearchEmpty:"\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA",newsTitle:"\u05D7\u05D3\u05E9\u05D5\u05EA",newsEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA",newsLoading:"\u05D8\u05D5\u05E2\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA\u2026",newsBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05D7\u05D3\u05E9\u05D5\u05EA",newsPublishedAt:"\u05E4\u05D5\u05E8\u05E1\u05DD \u05D1-{date}",formSubmit:"\u05E9\u05DC\u05D9\u05D7\u05D4",formSkip:"\u05D0\u05D7\u05E8 \u05DB\u05DA",formSubmitted:"\u05E0\u05E9\u05DC\u05D7",formSkipped:"\u05D3\u05D5\u05DC\u05D2",formFillOut:"\u05DE\u05D9\u05DC\u05D5\u05D9",formRequired:"\u05E9\u05D3\u05D4 \u05D7\u05D5\u05D1\u05D4",formInvalidEmail:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidTel:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05EA\u05E7\u05D9\u05DF",formInvalidUrl:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA URL \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidNumber:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",formTooShort:"\u05E7\u05E6\u05E8 \u05DE\u05D3\u05D9 (\u05DC\u05E4\u05D7\u05D5\u05EA {min} \u05EA\u05D5\u05D5\u05D9\u05DD)",formTooLong:"\u05D0\u05E8\u05D5\u05DA \u05DE\u05D3\u05D9 (\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max} \u05EA\u05D5\u05D5\u05D9\u05DD)",formNumberTooSmall:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formNumberTooLarge:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formPatternMismatch:"\u05D4\u05EA\u05D0\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D4\u05E0\u05D3\u05E8\u05E9\u05EA",formChooseAtLeast:"\u05D1\u05D7\u05E8 \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formChooseAtMost:"\u05D1\u05D7\u05E8 \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formOther:"\u05D0\u05D7\u05E8",formOtherPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D0\u05EA \u05EA\u05E9\u05D5\u05D1\u05EA\u05DA\u2026",inputRequired:"\u05E0\u05D3\u05E8\u05E9 \u05E7\u05DC\u05D8 \u05DE\u05D4\u05DE\u05E9\u05EA\u05DE\u05E9",inputBadge:"\u05E7\u05DC\u05D8 \u05DE\u05E9\u05EA\u05DE\u05E9",inputAnswered:"\u05E0\u05E2\u05E0\u05D4",inputSkipped:"\u05D3\u05D5\u05DC\u05D2",inputQuestion:"\u05E9\u05D0\u05DC\u05D4",inputYourAnswer:"\u05D4\u05EA\u05E9\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA",inputSubmit:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05E9\u05D5\u05D1\u05D4",inputSubmitHint:"Enter \u05DC\u05E9\u05DC\u05D9\u05D7\u05D4 \xB7 Shift+Enter = \u05E9\u05D5\u05E8\u05D4 \u05D7\u05D3\u05E9\u05D4",inputAnswerPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D0\u05EA \u05EA\u05E9\u05D5\u05D1\u05EA\u05DA\u2026",inputSkip:"\u05D3\u05D9\u05DC\u05D5\u05D2",confirmYes:"\u05DB\u05DF",confirmNo:"\u05DC\u05D0",inputConfirmHint:"\u05D1\u05D7\u05E8 \u05DB\u05DF \u05D0\u05D5 \u05DC\u05D0.",inputOptionalNote:"\u05D4\u05E2\u05E8\u05D4 \u05D0\u05D5\u05E4\u05E6\u05D9\u05D5\u05E0\u05DC\u05D9\u05EA",inputOptionalNotePlaceholder:"\u05D4\u05E2\u05E8\u05D4 \u05D0\u05D5\u05E4\u05E6\u05D9\u05D5\u05E0\u05DC\u05D9\u05EA\u2026",inputSubmitted:"\u05D4\u05EA\u05E9\u05D5\u05D1\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4",respFreeText:"\u05D8\u05E7\u05E1\u05D8 \u05D7\u05D5\u05E4\u05E9\u05D9",respSingleChoice:"\u05D1\u05D7\u05D9\u05E8\u05D4 \u05D9\u05D7\u05D9\u05D3\u05D4",respMultiChoice:"\u05D1\u05D7\u05D9\u05E8\u05D4 \u05DE\u05E8\u05D5\u05D1\u05D4",respConfirmation:"\u05D0\u05D9\u05E9\u05D5\u05E8",approvalRequired:"\u05E0\u05D3\u05E8\u05E9 \u05D0\u05D9\u05E9\u05D5\u05E8",approve:"\u05D0\u05D9\u05E9\u05D5\u05E8",reject:"\u05D3\u05D7\u05D9\u05D9\u05D4",approved:"\u05D0\u05D5\u05E9\u05E8",rejected:"\u05E0\u05D3\u05D7\u05D4",approvalReason:"\u05D4\u05D5\u05E1\u05E3 \u05E1\u05D9\u05D1\u05D4 (\u05D0\u05D5\u05E4\u05E6\u05D9\u05D5\u05E0\u05DC\u05D9)",approvalPrompt:"\u05D4\u05DB\u05DC\u05D9 {tool} \u05D3\u05D5\u05E8\u05E9 \u05D0\u05EA \u05D0\u05D9\u05E9\u05D5\u05E8\u05DA \u05DB\u05D3\u05D9 \u05DC\u05E4\u05E2\u05D5\u05DC.",approvalBody:"\u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05E4\u05E8\u05DE\u05D8\u05E8\u05D9 \u05D4\u05DB\u05DC\u05D9 \u05E9\u05DC\u05DE\u05E2\u05DC\u05D4 \u05D5\u05D4\u05D7\u05DC\u05D8 \u05D0\u05DD \u05DC\u05D0\u05E9\u05E8 \u05E4\u05E2\u05D5\u05DC\u05D4 \u05D6\u05D5.",approvalYourResponse:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA: {decision}",approvalEditHint:"\u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D5\u05DA \u05D0\u05EA \u05EA\u05D2\u05D5\u05D1\u05EA\u05DA \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05EA\u05D7\u05D3\u05E9.",approvalSubmitting:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05DE\u05D1\u05E6\u05E2\u2026",edit:"\u05E2\u05E8\u05D9\u05DB\u05D4",toolParameters:"\u05E4\u05E8\u05DE\u05D8\u05E8\u05D9\u05DD",statusAwaiting:"\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8",statusResponded:"\u05E0\u05E2\u05E0\u05D4",statusRunning:"\u05E4\u05D5\u05E2\u05DC",statusCompleted:"\u05D4\u05D5\u05E9\u05DC\u05DD",statusDenied:"\u05E0\u05D3\u05D7\u05D4",statusError:"\u05E9\u05D2\u05D9\u05D0\u05D4",statusSuperseded:"\u05D3\u05D5\u05DC\u05D2"},ed={en:Bi,fr:Xc,ar:Jc,es:Qc,he:Zc};function Un(e,t){let n=Fi(e),o=Vn(t),i=n==="en"?{}:ed[n]??{},a=o?t[n]??{}:t??{},l=o?t.en??{}:{};return{...Bi,...i,...l,...a}}function Fi(e){return(e.split("-")[0]??"en").toLowerCase()}var td=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function zi(e){return td.has(Fi(e))}function Ee(e,t){return e[t]??t}function Vn(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function Ui(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function Vi(e,t){let{translations:n,defaultLocale:o,...i}=e,a=Ui(n,t);return a?{...i,title:a.title??i.title,description:a.description??i.description,content:a.content??i.content}:i}function qi(e,t){let{translations:n,defaultLocale:o,...i}=e,a=Ui(n,t);if(!a)return i;let l=new Map((a.fields??[]).map(c=>[c.name,c])),s=i.fields.map(c=>{let d=l.get(c.name);if(!d)return c;let u=new Map((d.options??[]).map(_=>[_.value,_]));return{...c,label:d.label??c.label,placeholder:d.placeholder??c.placeholder,validationHint:d.validationHint??c.validationHint,options:c.options?.map(_=>{let g=u.get(_.value);return g?{..._,label:g.label??_.label,description:g.description??_.description}:_})}});return{...i,title:a.title??i.title,description:a.description??i.description,submitLabel:a.submitLabel??i.submitLabel,fields:s}}var mr=class{get(t){try{return localStorage.getItem(t)}catch{return null}}set(t,n){try{localStorage.setItem(t,n)}catch{}}remove(t){try{localStorage.removeItem(t)}catch{}}},qn=new mr;var nd=["off","error","warn","info","debug","trace"],fr=x.cssPrefix,od=`${fr}.debug`,rd=`__${x.global}_DEBUG__`,id=`${fr}-debug`,Ki=2,Wi=null;function ad(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(id);if(e!==null){let t=Gi(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(od);if(e){let t=Gi(e);if(t>=0)return t}}catch{}return window[rd]?4:2}function Gi(e){if(e===!0||e==="1"||e==="true")return 4;if(e===!1||e==="0"||e==="false"||e==="off")return 0;if(typeof e=="number")return Math.max(0,Math.min(5,Math.floor(e)));if(typeof e=="string"){let t=nd.indexOf(e);if(t>=0)return t}return-1}Ki=ad();function ji(e){let t=`[${fr}:${e}]`,n=(o,i,a)=>(l,s)=>{if(!(Ki<o)&&(s===void 0?console[i](t,l):console[i](t,l,s),Wi))try{Wi({level:a,scope:e,message:l,payload:s})}catch{}};return{error:n(1,"error","error"),warn:n(2,"warn","warn"),info:n(3,"info","info"),debug:n(4,"debug","debug"),trace:n(5,"debug","trace"),scope:o=>ji(`${e}:${o}`)}}var Y=ji("core");var pt=Y.scope("context"),sd=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),Yi=50,gr=1024,ld=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function hr(e){return Xi(e,"userContext",!0)}function vr(e){return Xi(e,"pageContext",!1)}function Xi(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){pt.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let o={},i=0;for(let[a,l]of Object.entries(e)){if(sd.has(a)){pt.warn(`dropped reserved ${t} key "${a}" \u2014 managed by the widget, not host-settable`);continue}if(l==null)continue;if(i>=Yi){pt.warn(`${t} truncated at ${Yi} keys \u2014 dropped "${a}"`);continue}let s=cd(t,a,l);s!==void 0&&(o[a]=s,i++)}return n&&typeof o.email=="string"&&!ld.test(o.email)&&(pt.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function cd(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){pt.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let o=n.trim();return o===""?void 0:o.length>gr?(pt.warn(`truncated ${e}.${t} to ${gr} chars`),o.slice(0,gr)):o}pt.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var Wn={maxBytes:10485760,maxCount:10,accept:"*/*"},Gn={files:!0,voice:"local",humanInLoop:!0},Ji={list:[],byTrigger:{}},br={enabled:!0,sampleRate:1},Kn={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},Et={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},Qi={floating:["theme","textSize","history","close","clear","expand","fullscreen","sound","language"],inline:["theme","textSize","history","close","clear","fullscreen","sound","language"],standalone:["theme","textSize","history","clear","sound","language"],page:["theme","textSize","history","clear","sound","language"],modal:["theme","textSize","history","close","clear","fullscreen","sound","language"],drawer:["theme","textSize","history","close","clear","fullscreen","sound","language"]},Pr={enabled:!0,volume:.3,events:void 0},Zi={enabled:!0,events:void 0},ea=[{label:"tabConversations",layout:"chat"}],ta={showSearchBar:!0};function Rt(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},o=t.behavior??{},i=t.i18n??{},a=t.feedback??{},l=t.footer??{},s=t.header??{},{themeMode:c,themeOverrides:d}=dd(t.theme),u=n.mode??"floating",_=_d(i.defaultLocale),g=i.availableLocales??[i.locale??_],f=At(i.locale??_,g,_),m=(t.baseUrl??x.defaultBaseUrl).replace(/\/$/,""),C=(t.agentApiBaseUrl??`${m}/api/agent`).replace(/\/$/,""),v=(t.dataApiBaseUrl??`${m}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:m,agentApiBaseUrl:C,dataApiBaseUrl:v,userContext:hr(t.userContext),pageContext:vr(t.pageContext),position:n.position??"bottom-right",themeMode:c,textSize:"normal",themeOverrides:d,mode:u,iframe:n.iframe??!1,responseMode:o.responseMode??"streaming",showReasoning:o.showReasoning??!1,showToolCalls:o.showToolCalls??!1,showSources:o.showSources??!1,features:{files:t.features?.files??Gn.files,voice:t.features?.voice??Gn.voice,humanInLoop:t.features?.humanInLoop??Gn.humanInLoop,tools:t.features?.tools},forms:Zt(t.forms,f),endpoints:{upload:t.endpoints?.upload??Kn.upload,transcribe:t.endpoints?.transcribe??Kn.transcribe,submitForm:t.endpoints?.submitForm??Kn.submitForm},attachments:{accept:t.composer?.attachments?.accept??Wn.accept,maxBytes:t.composer?.attachments?.maxBytes??Wn.maxBytes,maxCount:t.composer?.attachments?.maxCount??Wn.maxCount},locale:f,defaultLocale:_,availableLocales:g,startMinimized:o.startMinimized??!0,actions:ud(u,s.actions),size:n.size??{},launcher:Pd(t.launcher),sound:pd(a.sound),haptics:md(a.haptics),strings:Un(f,i.strings),stringsOverride:i.strings,composerDisclaimer:l.composerDisclaimer??"",poweredBy:gd(l.poweredBy),composer:hd(t.composer),modules:vd(t.modules),tracking:fd(t.tracking,v),storage:t.storage??qn,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function dd(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function _d(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function At(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function ud(e,t){return t??Qi[e]}function pd(e){return{enabled:e?.enabled??Pr.enabled,volume:e?.volume??Pr.volume,events:e?.events}}function md(e){return{enabled:e?.enabled??Zi.enabled,events:e?.events}}function fd(e,t){let n=e?.sampleRate??br.sampleRate;return{enabled:e?.enabled??br.enabled,endpoint:e?.endpoint??`${t}/pai/elements-px.gif`,sampleRate:Math.min(1,Math.max(0,Number.isFinite(n)?n:1)),token:e?.token}}function gd(e){let n={...{text:`Powered by ${x.displayName}`,href:x.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function hd(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function vd(e){let t=e===void 0?ea:e,n=new Set,o=[];for(let a of t.slice(0,4)){if(!a?.label||!a?.layout)continue;let l=a.contentTags?.filter(Boolean),s=a.id??l?.[0]??a.layout;for(;n.has(s);)s=`${s}-${o.length}`;n.add(s);let c={id:s,label:a.label,layout:a.layout};l&&l.length>0&&(c.contentTags=l),a.layout==="home"&&(c.brandName=a.brandName,c.greetingText=a.greetingText,c.showGreeting=a.showGreeting??!0,c.showSearchBar=a.showSearchBar??ta.showSearchBar,c.showRecentConversations=a.showRecentConversations??!0,a.userAvatars&&a.userAvatars.length>0&&(c.userAvatars=a.userAvatars),a.status&&(c.status=a.status),c.contentBlockTitle=a.contentBlockTitle),o.push(c)}let i=Object.fromEntries(o.map(a=>[a.id,a]));return{list:o,byId:i}}function Zt(e,t){var a;if(!e?.length)return Ji;let n=[],o=new Set;for(let l of e){if(!l?.id||o.has(l.id))continue;let s=qi(l,t),c=(s.fields??[]).filter(u=>!!(u&&u.name&&u.label&&u.type)),d=(Array.isArray(s.on)?s.on:[s.on]).map(bd).filter(u=>u!==null);c.length===0||d.length===0||(o.add(s.id),n.push({id:s.id,triggers:d,when:s.when,fields:c,title:s.title,description:s.description,submitLabel:s.submitLabel,skippable:s.skippable??!1,frequency:s.frequency??"once",mirrorToContext:s.mirrorToContext??!0,reopenable:s.reopenable??!0,reviewable:s.reviewable??!0}))}let i={};for(let l of n)for(let s of l.triggers)(i[a=s.kind]??(i[a]=[])).push(l);return{list:n,byTrigger:i}}function bd(e){if(typeof e!="string")return null;if(e==="pre-chat"||e==="conversation-closed"||e==="panel-close"||e==="manual")return{kind:e};let[t,n]=e.split(":",2);if(t==="after-messages"){let o=Number(n);return Number.isFinite(o)&&o>0?{kind:"after-messages",param:o}:null}if(t==="idle"){let o=Number(n);return Number.isFinite(o)&&o>0?{kind:"idle",param:o}:null}return t==="page-area"&&n?{kind:"page-area",param:n}:null}function Pd(e){let t=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??Et.variant,size:e?.size??Et.size,label:e?.label??Et.label,icon:e?.icon??Et.icon,hidden:e?.hidden??Et.hidden,callout:t}}function xr(e,t,n,o){let i=At(t,e.availableLocales,e.defaultLocale);if(i===e.locale&&n===e.themeMode&&o===e.textSize)return e;let a={...e};return i!==e.locale&&(a.locale=i,a.strings=Un(i,e.stringsOverride)),n!==e.themeMode&&(a.themeMode=n),o!==e.textSize&&(a.textSize=o),a}var xd=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function yr(e,t){if(!t)return e;let n={...e};for(let a of xd){let l=t[a];if(l===void 0)continue;let s=e[a];if(a==="theme"){s===void 0&&(n[a]=l);continue}a!=="i18n"&&(n[a]=na(l,s))}t.modules!==void 0&&e.modules===void 0&&(n.modules=t.modules),t.dataApiBaseUrl!==void 0&&e.dataApiBaseUrl===void 0&&(n.dataApiBaseUrl=t.dataApiBaseUrl);let o=e.i18n,i=t.i18n;if(o||i){let a=na(i??{},o);i?.availableLocales!==void 0&&(a.availableLocales=i.availableLocales),i?.defaultLocale!==void 0&&(a.defaultLocale=i.defaultLocale);let l=o?.strings,s=i?.strings;(l||s)&&(a.strings=yd(s,l)),n.i18n=a}return n}function na(e,t){if(!t)return e;let n={...e};for(let[o,i]of Object.entries(t))i!==void 0&&(n[o]=i);return n}function yd(e,t){if(!e)return t;if(!t)return e;let n=Vn(e),o=Vn(t);if(!n&&!o)return{...e,...t};let i={},a=n?e:{en:e},l=o?t:{en:t};for(let[s,c]of Object.entries(a))i[s]={...c};for(let[s,c]of Object.entries(l))i[s]={...i[s],...c};return i}var Sd=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],ft=e=>e!=="false",ra=e=>e.split(",").map(t=>t.trim()).filter(Boolean),ia=[["public-key","publicKey"],["ai-agent-deployment-id","aiAgentDeploymentId"],["base-url","baseUrl"],["agent-api-base-url","agentApiBaseUrl"],["data-api-base-url","dataApiBaseUrl"],["theme","theme",e=>e]],aa=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",ft]],sa=[["width","width"],["height","height"]],la=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",ft],["show-reasoning","showReasoning",ft],["show-tool-calls","showToolCalls",ft],["show-sources","showSources",ft]],ca=[["locale","locale"]],wd=new Set(Sd),kd=e=>ra(e).filter(t=>wd.has(t)),da=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",ft]],_a=[["features-files","files",ft],["features-voice","voice",e=>e],["features-tools","tools",ra]],ua=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],pa=[["user-id","id"],["user-email","email"],["user-name","name"]],ma=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],Cd=["launcher-label","callout-text","callout-delay","actions-main","actions-overflow","user-context","page-context"],Td=[ia,aa,sa,la,ca,da,_a,ua,pa,ma],Ed=new Set(["iframe","start-minimized"]),Sr=[...Td.flatMap(e=>e.map(([t])=>t).filter(t=>!Ed.has(t))),...Cd];function wr(e){let t={},n=f=>{let m=e(f);return m===null||m===""?void 0:m};for(let[f,m,C]of ia){let v=n(f);v!==void 0&&(t[m]=C?C(v):v)}let o=mt(n,aa),i=mt(n,sa);(o||i)&&(t.presentation={...o,...i?{size:i}:{}});let a=mt(n,la);a&&(t.behavior=a);let l=mt(n,ca);l&&(t.i18n=l);let s=Rd(e,n);s&&(t.launcher=s);let c=mt(n,_a);c&&(t.features=c);let d=mt(n,ua);d&&(t.endpoints=d);let u=oa(n,pa,"user-context");u&&(t.userContext=u);let _=oa(n,ma,"page-context");_&&(t.pageContext=_);let g=n("actions");return g!==void 0&&(t.header={actions:kd(g)}),t}function mt(e,t){let n={};for(let[o,i,a]of t){let l=e(o);l!==void 0&&(n[i]=a?a(l):l)}return Object.keys(n).length>0?n:null}function oa(e,t,n){let o={};for(let[s,c]of t){let d=e(s);d!==void 0&&(o[c]=d)}let i={},a=e(n);if(a)try{let s=JSON.parse(a);s&&typeof s=="object"&&!Array.isArray(s)&&(i=s)}catch{}let l={...i,...o};return Object.keys(l).length>0?l:null}function Rd(e,t){let n=mt(t,da)??{},o=e("launcher-label");o!==null&&(n.label=o);let i=t("callout-text");if(i){let a=Number.parseInt(t("callout-delay")??"",10);n.callout={text:i,...Number.isFinite(a)?{delayMs:a}:{}}}return Object.keys(n).length>0?n:null}function Ue(){let e=Date.now(),t=new Uint8Array(16);t[0]=Math.floor(e/2**40)&255,t[1]=Math.floor(e/2**32)&255,t[2]=e>>>24&255,t[3]=e>>>16&255,t[4]=e>>>8&255,t[5]=e&255,Ad(t.subarray(6)),t[6]=t[6]&15|112,t[8]=t[8]&63|128;let n=Array.from(t,o=>o.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function Ad(e){if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"){crypto.getRandomValues(e);return}for(let t=0;t<e.length;t++)e[t]=Math.floor(Math.random()*256)}var gt=Y.scope("persistence");function It(e,t=qn,n){let o=n?`${e}.${n}`:e,i=`${x.cssPrefix}.storageVersion`,a=t.get(i)??void 0,l=a?`.v${a}`:"",s=`${x.cssPrefix}.${o}${l}`,c=`${x.cssPrefix}${l}.visitorId`,d=`${s}.conversationId`,u=`${s}.userPrefs`,_=`${s}.panelOpen`,g=`${s}.panelSize`,f=`${s}.calloutDismissed`,m=`${s}.sidebarCollapsed`,C=`${s}.activeModule`,v=`${s}.historyCount`,b=`${s}.formsDone`,y={getVisitorId(){let P=t.get(c);if(P)return P;let E=Ue();return t.set(c,E),E},setVisitorId(P){gt.debug("setVisitorId (rebind)",{id:P,scope:o}),t.set(c,P)},loadConversationId(){return t.get(d)??void 0},saveConversationId(P){gt.trace("saveConversationId",{id:P,scope:o}),P?t.set(d,P):t.remove(d)},loadUserPrefs(){let P=t.get(u);if(!P)return{};try{let E=JSON.parse(P);return fa(E)?E:{}}catch(E){return gt.warn("loadUserPrefs parse failed",{error:E}),{}}},saveUserPrefs(P){try{t.set(u,JSON.stringify(P))}catch(E){gt.warn("saveUserPrefs serialise failed",{error:E})}},patchUserPrefs(P){let E=y.loadUserPrefs();y.saveUserPrefs({...E,...P})},loadPanelOpen(){let P=t.get(_);return P==="1"?!0:P==="0"?!1:null},savePanelOpen(P){t.set(_,P?"1":"0")},loadPanelSize(){let P=t.get(g);return P==="normal"||P==="expanded"||P==="fullscreen"?P:null},savePanelSize(P){t.set(g,P)},loadCalloutDismissed(P){if(!P)return!1;let E=t.get(f);return!!E&&E===P},saveCalloutDismissed(P){P?t.set(f,P):t.remove(f)},loadSidebarCollapsed(){let P=t.get(m);return P==="1"?!0:P==="0"?!1:null},saveSidebarCollapsed(P){t.set(m,P?"1":"0")},loadActiveModule(){return t.get(C)||null},saveActiveModule(P){t.set(C,P)},loadHistoryCount(){let P=t.get(v);if(!P)return null;let E=Number.parseInt(P,10);return Number.isFinite(E)&&E>=0?E:null},saveHistoryCount(P){t.set(v,String(P))},loadFormsDone(){let P=t.get(b);if(!P)return{};try{let E=JSON.parse(P);return fa(E)?E:{}}catch(E){return gt.warn("loadFormsDone parse failed",{error:E}),{}}},saveFormDone(P){try{let E=y.loadFormsDone();E[P]=Date.now(),t.set(b,JSON.stringify(E))}catch(E){gt.warn("saveFormDone serialise failed",{error:E})}},rememberStorageVersion(P){P&&P!==t.get(i)&&(gt.debug("rememberStorageVersion (force-reset on next load)",{version:P}),t.set(i,P))},clearConversation(){t.remove(d)}};return y}function fa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var ga=`:host{--__P__-accent-user: __BRAND_ACCENT__;--__P__-accent: var(--__P__-accent-user);--__P__-accent-text-user: __BRAND_ACCENT_TEXT__;--__P__-accent-text: var(--__P__-accent-text-user);--__P__-radius: __BRAND_RADIUS__;--__P__-radius-sm: 8px;--__P__-radius-md: 10px;--__P__-radius-lg: 16px;--__P__-font: __BRAND_FONT__;--__P__-font-display: var(--__P__-font);--__P__-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;--__P__-bg: oklch(1 0 0);--__P__-bg-elevated: oklch(.9789 .0029 278.3);--__P__-surface: var(--__P__-bg-elevated);--__P__-muted: var(--__P__-fg-muted);--__P__-hover: oklch(.1686 .011 278.3 / .06);--__P__-fg: oklch(.1686 .011 278.3);--__P__-fg-muted: oklch(.4932 .0301 278.3);--__P__-border: oklch(.9312 .0084 278.3);--__P__-border-strong: oklch(.8757 .0131 278.3);--__P__-bubble-user: var(--__P__-accent);--__P__-bubble-user-text: var(--__P__-accent-text);--__P__-bubble-assistant: oklch(.9638 .0058 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-on-accent: var(--__P__-accent-text);--__P__-success: oklch(.6456 .1654 151.53);--__P__-warning: oklch(.7135 .1494 74.05);--__P__-danger: oklch(.5966 .1818 24.51);--__P__-danger-text: oklch(.5054 .1905 27.52);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .1);--__P__-neutral: oklch(.7137 .0192 278.3);--__P__-focus: var(--__P__-accent);--__P__-shadow-panel: 0 8px 24px -8px rgba(13, 15, 20, .18), 0 24px 64px -24px rgba(13, 15, 20, .24);--__P__-shadow-card: 0 1px 2px rgba(13, 15, 20, .06), 0 4px 12px -6px rgba(13, 15, 20, .12);--__P__-backdrop: oklch(.1686 .011 278.3 / .55);--__P__-shadow-fab: 0 6px 16px -4px color-mix(in oklch, var(--__P__-accent) 45%, transparent), 0 12px 32px -12px rgba(13, 15, 20, .25);--__P__-z-fab: 2147483600;--__P__-z-panel: 2147483601;--__P__-panel-w: 380px;--__P__-panel-h: 600px;--__P__-fab-size: 56px;--__P__-conversation-max: 768px;--__P__-space-1: 4px;--__P__-space-2: 8px;--__P__-space-3: 12px;--__P__-space-4: 16px;--__P__-space-5: 20px;--__P__-space-6: 24px;--__P__-space-8: 32px;--__P__-text-scale: 1;--__P__-text-xs: calc(12px * var(--__P__-text-scale));--__P__-text-sm: calc(13px * var(--__P__-text-scale));--__P__-text-base: calc(15px * var(--__P__-text-scale));--__P__-text-md: calc(16px * var(--__P__-text-scale));--__P__-text-lg: calc(18px * var(--__P__-text-scale));--__P__-text-xl: calc(22px * var(--__P__-text-scale));--__P__-text-2xl: calc(30px * var(--__P__-text-scale))}:host([data-text-size="small"]){--__P__-text-scale: .9}:host([data-text-size="large"]){--__P__-text-scale: 1.15}:host{--__P__-ease: cubic-bezier(.2, .7, .2, 1);--__P__-ease-out: cubic-bezier(.2, .7, .2, 1);--__P__-ease-in: cubic-bezier(.4, 0, 1, 1);--__P__-ease-in-out: cubic-bezier(.65, 0, .35, 1);--__P__-dur-quick: .12s;--__P__-dur-base: .22s;--__P__-dur-slow: .32s;font-family:var(--__P__-font);color:var(--__P__-fg);color-scheme:light;--__P__-color-scheme: light}:host([data-theme="dark"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-danger-text: oklch(.8077 .1035 19.57);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .18);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);--__P__-shadow-card: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px -6px rgba(0, 0, 0, .5);--__P__-backdrop: rgba(0, 0, 0, .65);color-scheme:dark;--__P__-color-scheme: dark}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);color-scheme:dark;--__P__-color-scheme: dark}}@supports (color: oklch(from red l c h)){:host{--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.3, l, .62) c h);--__P__-accent-text: oklch(from var(--__P__-accent) clamp(0, (l / .623 - 1) * -infinity, 1) 0 h)}:host([data-theme="dark"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h)}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h)}}}@media(prefers-reduced-motion:reduce){:host{--__P__-dur-quick: 1ms;--__P__-dur-base: 1ms;--__P__-dur-slow: 1ms}}
|
|
2
|
-
`;var
|
|
3
|
-
`;var va=`.__P__-anchor{color-scheme:var(--__P__-color-scheme, light);right:16px;bottom:16px}.__P__-surface{display:contents}.__P__-surface[hidden]{display:none}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:calc(14px * var(--__P__-text-scale))}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:calc(14px * var(--__P__-text-scale));background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:color-mix(in srgb,currentColor 15%,transparent)}.__P__-callout-close:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}@media(prefers-reduced-motion:no-preference){.__P__-panel{transition:width var(--__P__-dur-base) var(--__P__-ease),height var(--__P__-dur-base) var(--__P__-ease),max-width var(--__P__-dur-base) var(--__P__-ease),max-height var(--__P__-dur-base) var(--__P__-ease)}.__P__-panel[data-resizing]{transition:none}}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;padding:0;justify-content:flex-end;align-items:flex-end}:host([data-mode="fullscreen"][data-position*="top"]) .__P__-anchor{justify-content:flex-start}:host([data-mode="fullscreen"][data-position*="left"]) .__P__-anchor{align-items:flex-start}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}@media(max-width:640px){:host([data-mode="open"]) .__P__-anchor,:host([data-mode="expanded"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="open"]) .__P__-panel,:host([data-mode="expanded"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-inline-start:auto;display:flex;align-items:center;gap:var(--__P__-space-1);flex-shrink:0}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list,.__P__-history,.__P__-module-scroll,.__P__-home-scroll,.__P__-help-list,.__P__-toolui-code,.__P__-sidebar-conversations{scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;overscroll-behavior:contain;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar,.__P__-history::-webkit-scrollbar,.__P__-module-scroll::-webkit-scrollbar,.__P__-home-scroll::-webkit-scrollbar,.__P__-help-list::-webkit-scrollbar,.__P__-toolui-code::-webkit-scrollbar,.__P__-sidebar-conversations::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb,.__P__-history::-webkit-scrollbar-thumb,.__P__-module-scroll::-webkit-scrollbar-thumb,.__P__-home-scroll::-webkit-scrollbar-thumb,.__P__-help-list::-webkit-scrollbar-thumb,.__P__-toolui-code::-webkit-scrollbar-thumb,.__P__-sidebar-conversations::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-list-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;inset-inline-end:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px}.__P__-list>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-date-divider{display:flex;justify-content:center;margin-block:var(--__P__-space-3)}.__P__-date-pill{padding:3px 10px;border-radius:999px;font-size:calc(11px * var(--__P__-text-scale));font-weight:600;color:var(--__P__-fg-muted);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);box-shadow:var(--__P__-shadow-card)}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:100%;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:calc(14px * var(--__P__-text-scale));word-wrap:break-word;overflow-wrap:break-word;box-shadow:0 1px 2px #0000000a,0 1px 8px -4px #0000000f;animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-bubble ::selection{background:color-mix(in srgb,var(--__P__-accent) 30%,transparent)}.__P__-bubble-row[data-role=user] .__P__-bubble ::selection{background:#fff6;color:var(--__P__-bubble-user-text)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-end-end-radius:5px}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-end-start-radius:5px}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui){width:100%}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui) .__P__-bubble{width:100%}@media(max-width:640px){.__P__-bubble-col{max-width:92%}.__P__-toolui:not(.__P__-toolui-collapsible){padding:var(--__P__-space-3);gap:var(--__P__-space-2)}details.__P__-toolui-collapsible>summary{padding:var(--__P__-space-2) var(--__P__-space-3)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-3)}.__P__-toolui-section,.__P__-toolui-desc{padding:var(--__P__-space-2) var(--__P__-space-3)}}.__P__-bubble-time{margin-top:3px;padding:0 4px;font-size:calc(11px * var(--__P__-text-scale));line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-inline-start:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-inline-start:2px}.__P__-md li::marker{color:var(--__P__-fg-muted)}.__P__-md li>p{margin:6px 0}.__P__-md li>ul,.__P__-md li>ol{margin:6px 0}.__P__-md strong,.__P__-md b{font-weight:650;letter-spacing:-.005em}.__P__-md em,.__P__-md i{font-style:italic}.__P__-md code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:calc(12.5px * var(--__P__-text-scale));padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-inline-start:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-start-end-radius:var(--__P__-radius-sm);border-end-end-radius:var(--__P__-radius-sm);color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:start}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:5px;height:5px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-inline-start:var(--__P__-space-3);border-inline-start:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary:hover{color:var(--__P__-fg)}.__P__-reasoning-summary:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-inline-end:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-source{display:inline-flex;align-items:center;gap:6px;max-width:100%;margin-top:6px;margin-inline-end:6px;padding:var(--__P__-space-1) var(--__P__-space-2);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);text-decoration:none}a.__P__-source:hover{color:var(--__P__-fg);border-color:var(--__P__-accent)}.__P__-source-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:calc(14px * var(--__P__-text-scale));line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-sm);background:color-mix(in oklab,var(--__P__-danger) 8%,var(--__P__-bg-elevated));border:1px solid color-mix(in oklab,var(--__P__-danger) 20%,transparent);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error span{min-width:0}.__P__-error button{margin-inline-start:auto;flex-shrink:0;border:0;background:none;padding:0;color:var(--__P__-accent);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;text-decoration:underline;white-space:nowrap;cursor:pointer}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-3)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:14px 4px 8px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-card{display:flex;flex-direction:column;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);overflow:hidden}.__P__-history-item{all:unset;display:flex;align-items:center;gap:var(--__P__-space-3);padding:12px var(--__P__-space-3);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item+.__P__-history-item{border-top:1px solid var(--__P__-border)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-avatar{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent)}.__P__-history-avatar svg{width:18px;height:18px}.__P__-history-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.__P__-history-row{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2)}.__P__-history-title{flex:1;min-width:0;font-size:calc(14px * var(--__P__-text-scale));font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-time{flex:none;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-history-preview{flex:1;min-width:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-history-item[data-unread=true] .__P__-history-title{font-weight:600}.__P__-history-item[data-closed=true] .__P__-history-title{color:var(--__P__-fg-muted)}.__P__-history-item-skeleton{cursor:default;pointer-events:none}.__P__-skeleton{display:block;border-radius:4px;background:linear-gradient(90deg,color-mix(in oklab,var(--__P__-fg) 9%,transparent) 30%,color-mix(in oklab,var(--__P__-fg) 17%,transparent),color-mix(in oklab,var(--__P__-fg) 9%,transparent) 70%);background-size:200% 100%;animation:__P__-skeleton-shimmer 1.8s ease-in-out infinite}.__P__-history-avatar.__P__-skeleton{border-radius:50%}.__P__-skeleton-heading{width:52px;height:8px}.__P__-skeleton-title{width:55%;height:12px}.__P__-skeleton-time{width:34px;height:10px}.__P__-skeleton-preview{width:80%;height:10px}@keyframes __P__-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.__P__-skeleton{animation:none}}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:calc(11px * var(--__P__-text-scale));line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:calc(11px * var(--__P__-text-scale));letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;inset-inline-end:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent)}.__P__-menu-check svg{width:14px;height:14px}.__P__-menu-item-segmented{cursor:default}.__P__-menu-item-segmented:hover{background:transparent}.__P__-segmented{display:inline-flex;gap:2px;padding:2px;background:var(--__P__-bg-elevated);border-radius:var(--__P__-radius-sm)}.__P__-segment{all:unset;min-width:26px;padding:3px 8px;font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.02em;text-align:center;color:var(--__P__-fg-muted);border-radius:calc(var(--__P__-radius-sm) - 2px);cursor:pointer;transition:color .12s ease,background .12s ease}.__P__-segment:hover{color:var(--__P__-fg)}.__P__-segment[data-on=true]{background:var(--__P__-bg);color:var(--__P__-accent);box-shadow:var(--__P__-shadow-card)}.__P__-segment:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body,.__P__-messenger-pane{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-pane[hidden]{display:none}@keyframes __P__-view-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}@media(prefers-reduced-motion:no-preference){.__P__-module,.__P__-history{animation:__P__-view-in .18s var(--__P__-ease-out)}}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{container-type:inline-size;background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-4px;left:calc(50% + 6px);min-width:16px;height:16px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:var(--__P__-accent);color:var(--__P__-on-accent);font-size:calc(10px * var(--__P__-text-scale));font-weight:600;line-height:1}.__P__-home-hero{flex-shrink:0;padding:var(--__P__-space-5) var(--__P__-space-5) var(--__P__-space-3);color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-home-hero-top{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);min-height:32px}.__P__-home-brand{font-size:clamp(calc(12px * var(--__P__-text-scale)),calc(3.2cqi * var(--__P__-text-scale)),calc(14px * var(--__P__-text-scale)));font-weight:600;letter-spacing:.01em;color:color-mix(in srgb,#fff 82%,transparent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.__P__-home-brand-spacer{flex:1}.__P__-home-hero-actions{display:flex;align-items:center;gap:var(--__P__-space-2);flex-shrink:0}.__P__-home-hero-actions .__P__-icon-btn{color:#fff}.__P__-home-hero-actions .__P__-icon-btn:hover{background:color-mix(in srgb,#fff 18%,transparent);color:#fff}.__P__-home-hero-actions .__P__-icon-btn:active{background:color-mix(in srgb,#fff 26%,transparent)}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(19px * var(--__P__-text-scale)),calc(5.5cqi * var(--__P__-text-scale)),var(--__P__-text-2xl));font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:10px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(15px * var(--__P__-text-scale)),calc(4.2cqi * var(--__P__-text-scale)),var(--__P__-text-xl));font-weight:600;line-height:1.25;letter-spacing:-.005em;color:color-mix(in srgb,var(--__P__-on-accent) 78%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-inline-start:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-inline-start:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:start;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:start}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:calc(14px * var(--__P__-text-scale));color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:start;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-hover)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:start;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;inset-inline-end:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-form{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-field{display:flex;flex-direction:column;gap:6px}.__P__-field-label{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-field-req{color:var(--__P__-danger)}.__P__-field-input{width:100%;min-width:0;max-width:100%;box-sizing:border-box;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);resize:vertical;transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-field-input:focus-visible{outline:none;border-color:var(--__P__-accent)}.__P__-field[data-invalid=true] .__P__-field-input{border-color:var(--__P__-danger)}.__P__-field-input[type=date],.__P__-field-input[type=time]{appearance:none;-webkit-appearance:none}@media(pointer:coarse){.__P__-field-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}}.__P__-field-hint{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-field-error{font-size:var(--__P__-text-xs);color:var(--__P__-danger)}.__P__-field-choices{display:flex;flex-direction:column;gap:10px;padding-top:2px}.__P__-choice{display:flex;align-items:flex-start;gap:10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);cursor:pointer}.__P__-choice input{margin-top:2px;accent-color:var(--__P__-accent)}.__P__-form-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}.__P__-form-hint{flex:1 1 auto;min-width:6rem;margin-inline-end:auto;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-form-submit{padding:var(--__P__-space-2) var(--__P__-space-4);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-submit:hover:not(:disabled){filter:brightness(1.06)}.__P__-form-submit:disabled{opacity:.6;cursor:default}.__P__-form-skip{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:transparent;color:var(--__P__-fg-muted);font:inherit;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-skip:hover:not(:disabled){background:var(--__P__-bg-elevated)}@media(max-width:640px){.__P__-form-hint{flex-basis:100%;margin-inline-end:0;font-size:var(--__P__-text-xs)}.__P__-form-submit,.__P__-form-skip{flex:1 1 0;text-align:center}}.__P__-form-gate{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-form-gate-title{margin:0;font-size:var(--__P__-text-base);font-weight:700;color:var(--__P__-fg)}.__P__-form-gate-desc{margin:0 0 var(--__P__-space-1);font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-form-done{display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border:1px dashed var(--__P__-border);border-radius:999px;align-self:center;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted)}.__P__-form-done svg{width:14px;height:14px;color:var(--__P__-success, #22c55e)}.__P__-form-done[data-outcome=skipped] svg{color:var(--__P__-fg-muted)}.__P__-form-done-fill{border:0;background:none;padding:0 2px;cursor:pointer;font:inherit;font-weight:600;color:var(--__P__-accent)}.__P__-form-done-fill:hover{text-decoration:underline}details.__P__-form-done{display:block;padding:0;border-radius:var(--__P__-radius-md)}details[open].__P__-form-done{width:min(100%,420px);background:var(--__P__-surface)}.__P__-form-done-summary{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;cursor:pointer;list-style:none}.__P__-form-done-summary::-webkit-details-marker{display:none}.__P__-form-done-summary>svg:last-child{color:var(--__P__-fg-muted);transition:transform .15s var(--__P__-ease)}details[open]>.__P__-form-done-summary>svg:last-child{transform:rotate(90deg)}.__P__-form-answers{margin:0;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);display:grid;gap:var(--__P__-space-3);text-align:start}.__P__-form-answer{display:grid;gap:6px}.__P__-form-answer dt{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-form-answer dd{margin:0;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);font-size:var(--__P__-text-sm);font-weight:400;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui{margin-block:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);background:var(--__P__-bg-elevated);font-size:var(--__P__-text-sm)}.__P__-toolui:not(.__P__-toolui-collapsible){display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-group{display:flex;flex-direction:column;gap:var(--__P__-space-3);margin-block:var(--__P__-space-3)}.__P__-toolui-group>.__P__-toolui{margin-block:0}.__P__-toolui-stale{opacity:.7}details.__P__-toolui-collapsible>summary{display:flex;align-items:center;gap:var(--__P__-space-2);padding:var(--__P__-space-3) var(--__P__-space-4);cursor:pointer;list-style:none}details.__P__-toolui-collapsible>summary::-webkit-details-marker{display:none}details.__P__-toolui-collapsible[open]>summary{border-bottom:1px solid var(--__P__-border)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-4)}details.__P__-toolui-collapsible>.__P__-toolui-section~.__P__-toolui-section{margin-top:calc(-1 * var(--__P__-space-2))}.__P__-toolui-wrench{display:inline-flex;color:var(--__P__-fg-muted)}.__P__-toolui-wrench svg{width:15px;height:15px}.__P__-toolui-title{font-weight:600;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui-chevron{display:inline-flex;margin-inline-start:auto;color:var(--__P__-fg-muted);transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-toolui-chevron svg{width:16px;height:16px}details.__P__-toolui-collapsible[open]>summary .__P__-toolui-chevron{transform:rotate(180deg)}.__P__-toolui-badge{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:999px;border:1px solid var(--__P__-border-strong);background:var(--__P__-bg);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;white-space:nowrap}.__P__-toolui-badge-accent{border-color:color-mix(in oklab,var(--__P__-warning, #f59e0b) 55%,transparent);background:color-mix(in oklab,var(--__P__-warning, #f59e0b) 12%,transparent);color:var(--__P__-warning, #f59e0b)}.__P__-toolui-badge-muted{border-color:color-mix(in oklab,var(--__P__-fg-muted) 50%,transparent);background:color-mix(in oklab,var(--__P__-fg-muted) 14%,transparent);color:var(--__P__-fg)}.__P__-toolui-status-icon{display:inline-flex}.__P__-toolui-status-icon svg{width:14px;height:14px}.__P__-toolui-status[data-status=awaiting] .__P__-toolui-status-icon{color:var(--__P__-warning, #f59e0b)}.__P__-toolui-status[data-status=responded] .__P__-toolui-status-icon{color:var(--__P__-accent)}.__P__-toolui-status[data-status=completed] .__P__-toolui-status-icon{color:var(--__P__-success, #16a34a)}.__P__-toolui-status[data-status=denied] .__P__-toolui-status-icon{color:#ea580c}.__P__-toolui-status[data-status=error] .__P__-toolui-status-icon{color:var(--__P__-danger, #dc2626)}.__P__-toolui-head{display:flex;align-items:center;flex-wrap:wrap;gap:var(--__P__-space-2)}.__P__-toolui-desc{margin:0;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-section{display:flex;flex-direction:column;gap:8px;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border)}.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-section,.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-desc{padding:0;background:none;border:0;border-radius:0}.__P__-toolui-label{font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--__P__-fg-muted)}.__P__-toolui-text{margin:0;font-size:var(--__P__-text-base);font-weight:600;color:var(--__P__-fg);line-height:1.55;overflow-wrap:anywhere}.__P__-toolui-code{margin:0;max-height:240px;overflow:auto;color:var(--__P__-fg);font-family:var(--__P__-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:var(--__P__-text-xs);line-height:1.5;white-space:pre-wrap;word-break:break-word}.__P__-toolui-code[data-error=true]{color:var(--__P__-danger, #dc2626)}.__P__-toolui-body{gap:6px}.__P__-toolui-prompt{margin:0;font-weight:600;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui-subtle{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}:host([dir="rtl"]) .__P__-icon-dir{transform:scaleX(-1)}:host([dir="rtl"]) .__P__-field-input[type=date],:host([dir="rtl"]) .__P__-field-input[type=time]{position:relative;text-align:right;padding-left:34px}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-datetime-edit,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-datetime-edit{text-align:right}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-calendar-picker-indicator,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-calendar-picker-indicator{position:absolute;left:var(--__P__-space-3);margin:0}
|
|
4
|
-
`;var
|
|
5
|
-
`;var
|
|
6
|
-
`;var
|
|
7
|
-
`).replace(/__P__/g,Dd).replaceAll("__BRAND_ACCENT_TEXT__",Hd).replaceAll("__BRAND_ACCENT__",$d).replaceAll("__BRAND_RADIUS__",Bd).replaceAll("__BRAND_FONT__",Fd);var zd=Y.scope("mount"),xa=new WeakMap,ya={floating:"all: initial; position: fixed; z-index: 2147483600;",flow:"all: initial; display: block; position: relative; width: 100%; height: 100%; z-index: 1; contain: size;",viewport:"all: initial; display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;"};function Sa(e,t){e.style.cssText=ya[t]}function jn(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function wa(e={}){let t=e.position??"flow";zd.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${x.cssPrefix}-chat-host`;typeof customElements<"u"&&!customElements.get(n)&&customElements.define(n,class extends HTMLElement{});let o;e.existingHost?o=e.existingHost:(o=document.createElement(n),(e.target??document.body).appendChild(o)),o.setAttribute("data-brand",x.id),o.style.cssText=ya[t];let i=o.shadowRoot??o.attachShadow({mode:"open"}),a=o.ownerDocument;if(!Ud(i,a)){let s=a.createElement("style");s.textContent=kr,i.appendChild(s)}let l=document.createElement("div");return l.className=`${x.cssPrefix}-app`,i.appendChild(l),{appRoot:l,destroy:()=>o.remove(),hostElement:o,shadowRoot:i}}function Ud(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let o=xa.get(t);if(!o)try{o=new n.CSSStyleSheet,o.replaceSync(kr),xa.set(t,o)}catch{return!1}try{return e.adoptedStyleSheets=[o],!0}catch{return!1}}function Vd(e,t){let n=x.cssPrefix;t.accent&&e.style.setProperty(`--${n}-accent-user`,t.accent),t.accentText&&e.style.setProperty(`--${n}-accent-text-user`,t.accentText),t.radius&&e.style.setProperty(`--${n}-radius`,t.radius),t.fontFamily&&e.style.setProperty(`--${n}-font`,t.fontFamily)}function qd(e,t){e.dataset.theme=t}function Wd(e,t){let n=x.cssPrefix;t.width!==void 0&&e.style.setProperty(`--${n}-panel-w`,t.width),t.height!==void 0&&e.style.setProperty(`--${n}-panel-h`,t.height),t.expanded?.width!==void 0&&e.style.setProperty(`--${n}-expanded-w`,t.expanded.width),t.expanded?.height!==void 0&&e.style.setProperty(`--${n}-expanded-h`,t.expanded.height),t.inset!==void 0&&e.style.setProperty(`--${n}-panel-inset`,t.inset)}function Gd(e,t){e.dataset.position=t}function Yn(e,t){e.dataset.mode=t}function ka(e,t){qd(e,t.themeMode),Vd(e,t.themeOverrides),Gd(e,t.position),Wd(e,t.size)}var Lt,me,Cr,Ca,en=0,Na=[],ge=J,Ta=ge.__b,Ea=ge.__r,Ra=ge.diffed,Aa=ge.__c,Ia=ge.unmount,La=ge.__;function Jn(e,t){ge.__h&&ge.__h(me,e,en||t),en=0;var n=me.__H||(me.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function A(e){return en=1,Kd(Oa,e)}function Kd(e,t,n){var o=Jn(Lt++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):Oa(void 0,t),function(s){var c=o.__N?o.__N[0]:o.__[0],d=o.t(c,s);c!==d&&(o.__N=[d,o.__[1]],o.__c.setState({}))}],o.__c=me,!me.__f)){var i=function(s,c,d){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(g){return g.__c});if(u.every(function(g){return!g.__N}))return!a||a.call(this,s,c,d);var _=o.__c.props!==s;return u.some(function(g){if(g.__N){var f=g.__[0];g.__=g.__N,g.__N=void 0,f!==g.__[0]&&(_=!0)}}),a&&a.call(this,s,c,d)||_};me.__f=!0;var a=me.shouldComponentUpdate,l=me.componentWillUpdate;me.componentWillUpdate=function(s,c,d){if(this.__e){var u=a;a=void 0,i(s,c,d),a=u}l&&l.call(this,s,c,d)},me.shouldComponentUpdate=i}return o.__N||o.__}function R(e,t){var n=Jn(Lt++,3);!ge.__s&&Er(n.__H,t)&&(n.__=e,n.u=t,me.__H.__h.push(n))}function ht(e,t){var n=Jn(Lt++,4);!ge.__s&&Er(n.__H,t)&&(n.__=e,n.u=t,me.__h.push(n))}function O(e){return en=5,Re(function(){return{current:e}},[])}function Re(e,t){var n=Jn(Lt++,7);return Er(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function D(e,t){return en=8,Re(function(){return e},t)}function jd(){for(var e;e=Na.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Xn),t.__h.some(Tr),t.__h=[]}catch(n){t.__h=[],ge.__e(n,e.__v)}}}ge.__b=function(e){me=null,Ta&&Ta(e)},ge.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),La&&La(e,t)},ge.__r=function(e){Ea&&Ea(e),Lt=0;var t=(me=e.__c).__H;t&&(Cr===me?(t.__h=[],me.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(Xn),t.__h.some(Tr),t.__h=[],Lt=0)),Cr=me},ge.diffed=function(e){Ra&&Ra(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Na.push(t)!==1&&Ca===ge.requestAnimationFrame||((Ca=ge.requestAnimationFrame)||Yd)(jd)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Cr=me=null},ge.__c=function(e,t){t.some(function(n){try{n.__h.some(Xn),n.__h=n.__h.filter(function(o){return!o.__||Tr(o)})}catch(o){t.some(function(i){i.__h&&(i.__h=[])}),t=[],ge.__e(o,n.__v)}}),Aa&&Aa(e,t)},ge.unmount=function(e){Ia&&Ia(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{Xn(o)}catch(i){t=i}}),n.__H=void 0,t&&ge.__e(t,n.__v))};var Ma=typeof requestAnimationFrame=="function";function Yd(e){var t,n=function(){clearTimeout(o),Ma&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);Ma&&(t=requestAnimationFrame(n))}function Xn(e){var t=me,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),me=t}function Tr(e){var t=me;e.__c=e.__(),me=t}function Er(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function Oa(e,t){return typeof t=="function"?t(e):t}var Xd=Symbol.for("preact-signals");function to(){if(tt>1)tt--;else{var e,t=!1;for((function(){var i=Zn;for(Zn=void 0;i!==void 0;)i.S.v===i.v&&(i.S.i=i.i),i=i.o})();tn!==void 0;){var n=tn;for(tn=void 0,Qn++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Ha(n))try{n.c()}catch(i){t||(e=i,t=!0)}n=o}}if(Qn=0,tt--,t)throw e}}function Mt(e){if(tt>0)return e();Rr=++Jd,tt++;try{return e()}finally{to()}}var ce=void 0;function nn(e){var t=ce;ce=void 0;try{return e()}finally{ce=t}}var Da,tn=void 0,tt=0,Qn=0,Jd=0,Rr=0,Zn=void 0,eo=0;function $a(e){if(ce!==void 0){var t=e.n;if(t===void 0||t.t!==ce)return t={i:0,S:e,p:ce.s,n:void 0,t:ce,e:void 0,x:void 0,r:t},ce.s!==void 0&&(ce.s.n=t),ce.s=t,e.n=t,32&ce.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=ce.s,t.n=void 0,ce.s.n=t,ce.s=t),t}}function ve(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}ve.prototype.brand=Xd;ve.prototype.h=function(){return!0};ve.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:nn(function(){var o;(o=t.W)==null||o.call(t)}))};ve.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,o=e.x;n!==void 0&&(n.x=o,e.e=void 0),o!==void 0&&(o.e=n,e.x=void 0),e===this.t&&(this.t=o,o===void 0&&nn(function(){var i;(i=t.Z)==null||i.call(t)}))}};ve.prototype.subscribe=function(e){var t=this;return nt(function(){var n=t.value;nn(function(){return e(n)})},{name:"sub"})};ve.prototype.valueOf=function(){return this.value};ve.prototype.toString=function(){return this.value+""};ve.prototype.toJSON=function(){return this.value};ve.prototype.peek=function(){var e=this;return nn(function(){return e.value})};Object.defineProperty(ve.prototype,"value",{get:function(){var e=$a(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Qn>100)throw new Error("Cycle detected");(function(n){tt!==0&&Qn===0&&n.l!==Rr&&(n.l=Rr,Zn={S:n,v:n.v,i:n.i,o:Zn})})(this),this.v=e,this.i++,eo++,tt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{to()}}}});function H(e,t){return new ve(e,t)}function Ha(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 Ba(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 Fa(e){for(var t=e.s,n=void 0;t!==void 0;){var o=t.p;t.i===-1?(t.S.U(t),o!==void 0&&(o.n=t.n),t.n!==void 0&&(t.n.p=o)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=o}e.s=n}function vt(e,t){ve.call(this,void 0,t),this.x=e,this.s=void 0,this.g=eo-1,this.f=4}vt.prototype=new ve;vt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===eo))return!0;if(this.g=eo,this.f|=1,this.i>0&&!Ha(this))return this.f&=-2,!0;var e=ce;try{Ba(this),ce=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 ce=e,Fa(this),this.f&=-2,!0};vt.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)}ve.prototype.S.call(this,e)};vt.prototype.U=function(e){if(this.t!==void 0&&(ve.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)}};vt.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(vt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=$a(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function on(e,t){return new vt(e,t)}function za(e){var t=e.m;if(e.m=void 0,typeof t=="function"){tt++;var n=ce;ce=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,Ar(e),o}finally{ce=n,to()}}}function Ar(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,za(e)}function Qd(e){if(ce!==this)throw new Error("Out-of-order effect");Fa(this),ce=e,this.f&=-2,8&this.f&&Ar(this),to()}function Nt(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Da&&Da.push(this)}Nt.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};Nt.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,za(this),Ba(this),tt++;var e=ce;return ce=this,Qd.bind(this,e)};Nt.prototype.N=function(){2&this.f||(this.f|=2,this.u=tn,tn=this)};Nt.prototype.d=function(){this.f|=8,1&this.f||Ar(this)};Nt.prototype.dispose=function(){this.d()};function nt(e,t){var n=new Nt(e,t);try{n.c()}catch(i){throw n.d(),i}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var Ua,ro,no,Zd=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Va=[];nt(function(){Ua=this.N})();function Ot(e,t){J[e]=t.bind(null,J[e]||function(){})}function oo(e){if(no){var t=no;no=void 0,t()}no=e&&e.S()}function qa(e){var t=this,n=e.data,o=rn(n);o.value=n;var i=Re(function(){for(var s=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var d=on(function(){var f=o.value.value;return f===0?0:f===!0?"":f||""}),u=on(function(){return!Array.isArray(d.value)&&!cr(d.value)}),_=nt(function(){if(this.N=Wa,u.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),g=t.__$u.d;return t.__$u.d=function(){_(),g.call(this)},[u,d]},[]),a=i[0],l=i[1];return a.value?l.peek():l.value}qa.displayName="ReactiveTextNode";Object.defineProperties(ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:qa},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Ot("__b",function(e,t){if(typeof t.type=="string"){var n,o=t.props;for(var i in o)if(i!=="children"){var a=o[i];a instanceof ve&&(n||(t.__np=n={}),n[i]=a,o[i]=a.peek())}}e(t)});Ot("__r",function(e,t){if(e(t),t.type!==ee){oo();var n,o=t.__c;o&&(o.__$f&=-2,(n=o.__$u)===void 0&&(o.__$u=n=(function(i,a){var l;return nt(function(){l=this},{name:a}),l.c=i,l})(function(){var i;Zd&&((i=n.y)==null||i.call(n)),o.__$f|=1,o.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),ro=o,oo(n)}});Ot("__e",function(e,t,n,o){oo(),ro=void 0,e(t,n,o)});Ot("diffed",function(e,t){oo(),ro=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var o=t.__np,i=t.props;if(o){var a=n.U;if(a)for(var l in a){var s=a[l];s!==void 0&&!(l in o)&&(s.d(),a[l]=void 0)}else a={},n.U=a;for(var c in o){var d=a[c],u=o[c];d===void 0?(d=e_(n,c,u,i),a[c]=d):d.o(u,i)}}}e(t)});function e_(e,t,n,o){var i=t in e&&e.ownerSVGElement===void 0,a=H(n);return{o:function(l,s){a.value=l,o=s},d:nt(function(){this.N=Wa;var l=a.value.value;o[t]!==l&&(o[t]=l,i?e[t]=l:l!=null&&(l!==!1||t[4]==="-")?e.setAttribute(t,l):e.removeAttribute(t))})}}Ot("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var o=n.U;if(o){n.U=void 0;for(var i in o){var a=o[i];a&&a.d()}}}var l=t.__np;if(l){var s=t.props;for(var c in l)s[c]=l[c]}t.__np=void 0}else{var d=t.__c;if(d){var u=d.__$u;u&&(d.__$u=void 0,u.d())}}e(t)});Ot("__h",function(e,t,n,o){(o<3||o===9)&&(t.__$f|=2),e(t,n,o)});lt.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,o=n&&n.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var a=2&this.__$f;if(!(o||a||4&this.__$f)||1&this.__$f)return!0}else if(!(o||4&this.__$f)||3&this.__$f)return!0;for(var l in e)if(l!=="__source"&&e[l]!==this.props[l])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function rn(e,t){return Re(function(){return H(e,t)},[])}function j(e,t){var n=O(e);return n.current=e,ro.__$f|=4,Re(function(){return on(function(){return n.current()},t)},[])}var t_=function(e){queueMicrotask(function(){queueMicrotask(e)})};function n_(){Mt(function(){for(var e;e=Va.shift();)Ua.call(e)})}function Wa(){Va.push(this)===1&&(J.requestAnimationFrame||t_)(n_)}function Ga(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ka(e){return Ga(e)}function ja(e){return!(!Ga(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function o_(e){return`${x.cssPrefix}:${e}`}function Ya(e,t){let o=Object.entries(t).map(([i,a])=>{let l=o_(i),s=c=>a(c.detail);return e.addEventListener(l,s),[l,s]});return()=>{for(let[i,a]of o)e.removeEventListener(i,a)}}function io(e,t,n){return e==="page"?"page":e==="standalone"?"standalone":e==="inline"?t==="fullscreen"?"fullscreen":"inline":e==="modal"||e==="drawer"?n?t==="fullscreen"?"fullscreen":e:"closed":n?t==="fullscreen"?"fullscreen":t==="expanded"?"expanded":"open":"closed"}var r_=900;function Ir(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let o=t.initialSize;if(o==="expanded"||o==="fullscreen"||o==="normal")return o;if(o==="auto"){let i=t.autoSizeBreakpoint??r_;return n>=i?"expanded":"normal"}return"normal"}function an(e,t,n,o=null){let a=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),s=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&o?o:Ir(e.mode,e.size,t);return{panelOpen:a,panelSize:s}}function Dt(){return typeof window>"u"?0:window.innerWidth}var i_="x-public-key",a_="x-ai-agent-deployment-id";function Xa(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[a_]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??i_]=e.publicKey),t}}}var ao="0.53.0";var Ve=class extends Error{constructor(n,o,i,a){super(n);V(this,"code",o);V(this,"status",i);V(this,"cause",a);this.name="StreamError"}};var Ja=Y.scope("parser");async function*Lr(e,t){if(!e.ok){let i=await e.text().catch(()=>"");throw new Ve(`server responded ${e.status}: ${i.slice(0,200)}`,"server",e.status)}if(!e.body)throw new Ve("response has no body","no-body");let n=e.body.pipeThrough(new TextDecoderStream).getReader(),o="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:i,value:a}=await n.read();if(i){let s=o.trim();if(s){let c=Qa(s);c&&(yield c)}return}o+=a;let l;for(;(l=o.indexOf(`
|
|
1
|
+
var Hc=Object.defineProperty;var zc=(e,t,n)=>t in e?Hc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var q=(e,t,n)=>zc(e,typeof t!="symbol"?t+"":t,n);var $n,Z,Ea,lo,st,wa,Ra,Aa,oo,Ln,Qt,Ia,co,ao,io,Fc,Nn={},Dn=[],Uc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Bn=Array.isArray;function et(e,t){for(var n in t)e[n]=t[n];return e}function _o(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Hn(e,t,n){var r,a,i,l={};for(i in t)i=="key"?r=t[i]:i=="ref"?a=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?$n.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)l[i]===void 0&&(l[i]=e.defaultProps[i]);return Mn(e,l,r,a,null)}function Mn(e,t,n,r,a){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++Ea,__i:-1,__u:0};return a==null&&Z.vnode!=null&&Z.vnode(i),i}function te(e){return e.children}function lt(e,t){this.props=e,this.context=t}function Tt(e,t){if(t==null)return e.__?Tt(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"?Tt(e):null}function qc(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],a=[],i=et({},t);i.__v=t.__v+1,Z.vnode&&Z.vnode(i),uo(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??Tt(t),!!(32&t.__u),a),i.__v=t.__v,i.__.__k[i.__i]=i,Da(r,i,a),t.__e=t.__=null,i.__e!=n&&La(i)}}function La(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),La(e)}function ka(e){(!e.__d&&(e.__d=!0)&&st.push(e)&&!On.__r++||wa!=Z.debounceRendering)&&((wa=Z.debounceRendering)||Ra)(On)}function On(){try{for(var e,t=1;st.length;)st.length>t&&st.sort(Aa),e=st.shift(),t=st.length,qc(e)}finally{st.length=On.__r=0}}function Ma(e,t,n,r,a,i,l,s,c,d,u){var _,g,f,m,C,v,b,y=r&&r.__k||Dn,P=t.length;for(c=Wc(n,t,y,c,P),_=0;_<P;_++)(f=n.__k[_])!=null&&(g=f.__i!=-1&&y[f.__i]||Nn,f.__i=_,v=uo(e,f,g,a,i,l,s,c,d,u),m=f.__e,f.ref&&g.ref!=f.ref&&(g.ref&&po(g.ref,null,f),u.push(f.ref,f.__c||m,f)),C==null&&m!=null&&(C=m),(b=!!(4&f.__u))||g.__k===f.__k?(c=Na(f,c,e,b),b&&g.__e&&(g.__e=null)):typeof f.type=="function"&&v!==void 0?c=v:m&&(c=m.nextSibling),f.__u&=-7);return n.__e=C,c}function Wc(e,t,n,r,a){var i,l,s,c,d,u=n.length,_=u,g=0;for(e.__k=new Array(a),i=0;i<a;i++)(l=t[i])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[i]=Mn(null,l,null,null,null):Bn(l)?l=e.__k[i]=Mn(te,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[i]=Mn(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[i]=l,c=i+g,l.__=e,l.__b=e.__b+1,s=null,(d=l.__i=Gc(l,n,c,_))!=-1&&(_--,(s=n[d])&&(s.__u|=2)),s==null||s.__v==null?(d==-1&&(a>u?g--:a<u&&g++),typeof l.type!="function"&&(l.__u|=4)):d!=c&&(d==c-1?g--:d==c+1?g++:(d>c?g--:g++,l.__u|=4))):e.__k[i]=null;if(_)for(i=0;i<u;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=Tt(s)),$a(s,s));return r}function Na(e,t,n,r){var a,i;if(typeof e.type=="function"){for(a=e.__k,i=0;a&&i<a.length;i++)a[i]&&(a[i].__=e,t=Na(a[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Tt(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Gc(e,t,n,r){var a,i,l,s=e.key,c=e.type,d=t[n],u=d!=null&&(2&d.__u)==0;if(d===null&&s==null||u&&s==d.key&&c==d.type)return n;if(r>(u?1:0)){for(a=n-1,i=n+1;a>=0||i<t.length;)if((d=t[l=a>=0?a--:i++])!=null&&(2&d.__u)==0&&s==d.key&&c==d.type)return l}return-1}function Ca(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Uc.test(t)?n:n+"px"}function In(e,t,n,r,a){var i,l;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||Ca(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||Ca(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Ia,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n[Qt]=r[Qt]:(n[Qt]=co,e.addEventListener(t,i?io:ao,i)):e.removeEventListener(t,i?io:ao,i);else{if(a=="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 Ta(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[Ln]==null)t[Ln]=co++;else if(t[Ln]<n[Qt])return;return n(Z.event?Z.event(t):t)}}}function uo(e,t,n,r,a,i,l,s,c,d){var u,_,g,f,m,C,v,b,y,P,R,z,K,L,G,H=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[s=t.__e=n.__e]),(u=Z.__b)&&u(t);e:if(typeof H=="function")try{if(b=t.props,y=H.prototype&&H.prototype.render,P=(u=H.contextType)&&r[u.__c],R=u?P?P.props.value:u.__:r,n.__c?v=(_=t.__c=n.__c).__=_.__E:(y?t.__c=_=new H(b,R):(t.__c=_=new lt(b,R),_.constructor=H,_.render=Kc),P&&P.sub(_),_.state||(_.state={}),_.__n=r,g=_.__d=!0,_.__h=[],_._sb=[]),y&&_.__s==null&&(_.__s=_.state),y&&H.getDerivedStateFromProps!=null&&(_.__s==_.state&&(_.__s=et({},_.__s)),et(_.__s,H.getDerivedStateFromProps(b,_.__s))),f=_.props,m=_.state,_.__v=t,g)y&&H.getDerivedStateFromProps==null&&_.componentWillMount!=null&&_.componentWillMount(),y&&_.componentDidMount!=null&&_.__h.push(_.componentDidMount);else{if(y&&H.getDerivedStateFromProps==null&&b!==f&&_.componentWillReceiveProps!=null&&_.componentWillReceiveProps(b,R),t.__v==n.__v||!_.__e&&_.shouldComponentUpdate!=null&&_.shouldComponentUpdate(b,_.__s,R)===!1){t.__v!=n.__v&&(_.props=b,_.state=_.__s,_.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(j){j&&(j.__=t)}),Dn.push.apply(_.__h,_._sb),_._sb=[],_.__h.length&&l.push(_);break e}_.componentWillUpdate!=null&&_.componentWillUpdate(b,_.__s,R),y&&_.componentDidUpdate!=null&&_.__h.push(function(){_.componentDidUpdate(f,m,C)})}if(_.context=R,_.props=b,_.__P=e,_.__e=!1,z=Z.__r,K=0,y)_.state=_.__s,_.__d=!1,z&&z(t),u=_.render(_.props,_.state,_.context),Dn.push.apply(_.__h,_._sb),_._sb=[];else do _.__d=!1,z&&z(t),u=_.render(_.props,_.state,_.context),_.state=_.__s;while(_.__d&&++K<25);_.state=_.__s,_.getChildContext!=null&&(r=et(et({},r),_.getChildContext())),y&&!g&&_.getSnapshotBeforeUpdate!=null&&(C=_.getSnapshotBeforeUpdate(f,m)),L=u!=null&&u.type===te&&u.key==null?Oa(u.props.children):u,s=Ma(e,Bn(L)?L:[L],t,n,r,a,i,l,s,c,d),_.base=t.__e,t.__u&=-161,_.__h.length&&l.push(_),v&&(_.__E=_.__=null)}catch(j){if(t.__v=null,c||i!=null)if(j.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s}else{for(G=i.length;G--;)_o(i[G]);so(t)}else t.__e=n.__e,t.__k=n.__k,j.then||so(t);Z.__e(j,t,n)}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=Vc(n.__e,t,n,r,a,i,l,c,d);return(u=Z.diffed)&&u(t),128&t.__u?void 0:s}function so(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(so))}function Da(e,t,n){for(var r=0;r<n.length;r++)po(n[r],n[++r],n[++r]);Z.__c&&Z.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){Z.__e(i,a.__v)}})}function Oa(e){return typeof e!="object"||e==null||e.__b>0?e:Bn(e)?e.map(Oa):e.constructor!==void 0?null:et({},e)}function Vc(e,t,n,r,a,i,l,s,c){var d,u,_,g,f,m,C,v=n.props||Nn,b=t.props,y=t.type;if(y=="svg"?a="http://www.w3.org/2000/svg":y=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((f=i[d])&&"setAttribute"in f==!!y&&(y?f.localName==y:f.nodeType==3)){e=f,i[d]=null;break}}if(e==null){if(y==null)return document.createTextNode(b);e=document.createElementNS(a,y,b.is&&b),s&&(Z.__m&&Z.__m(t,i),s=!1),i=null}if(y==null)v===b||s&&e.data==b||(e.data=b);else{if(i=y=="textarea"&&b.defaultValue!=null?null:i&&$n.call(e.childNodes),!s&&i!=null)for(v={},d=0;d<e.attributes.length;d++)v[(f=e.attributes[d]).name]=f.value;for(d in v)f=v[d],d=="dangerouslySetInnerHTML"?_=f:d=="children"||d in b||d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b||In(e,d,null,f,a);for(d in b)f=b[d],d=="children"?g=f:d=="dangerouslySetInnerHTML"?u=f:d=="value"?m=f:d=="checked"?C=f:s&&typeof f!="function"||v[d]===f||In(e,d,f,v[d],a);if(u)s||_&&(u.__html==_.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(_&&(e.innerHTML=""),Ma(t.type=="template"?e.content:e,Bn(g)?g:[g],t,n,r,y=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,l,i?i[0]:n.__k&&Tt(n,0),s,c),i!=null)for(d=i.length;d--;)_o(i[d]);s&&y!="textarea"||(d="value",y=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[d]||y=="progress"&&!m||y=="option"&&m!=v[d])&&In(e,d,m,v[d],a),d="checked",C!=null&&C!=e[d]&&In(e,d,C,v[d],a))}return e}function po(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(a){Z.__e(a,n)}}function $a(e,t,n){var r,a;if(Z.unmount&&Z.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||po(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){Z.__e(i,t)}r.base=r.__P=null}if(r=e.__k)for(a=0;a<r.length;a++)r[a]&&$a(r[a],t,n||typeof e.type!="function");n||_o(e.__e),e.__c=e.__=e.__e=void 0}function Kc(e,t,n){return this.constructor(e,n)}function zn(e,t,n){var r,a,i,l;t==document&&(t=document.documentElement),Z.__&&Z.__(e,t),a=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],uo(t,e=(!r&&n||t).__k=Hn(te,null,[e]),a||Nn,Nn,t.namespaceURI,!r&&n?[n]:a?null:t.firstChild?$n.call(t.childNodes):null,i,!r&&n?n:a?a.__e:t.firstChild,r,l),Da(i,e,l)}$n=Dn.slice,Z={__e:function(e,t,n,r){for(var a,i,l;t=t.__;)if((a=t.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(e)),l=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,r||{}),l=a.__d),l)return a.__E=a}catch(s){e=s}throw e}},Ea=0,lo=function(e){return e!=null&&e.constructor===void 0},lt.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=et({},this.state),typeof e=="function"&&(e=e(et({},n),this.props)),e&&et(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ka(this))},lt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ka(this))},lt.prototype.render=te,st=[],Ra=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Aa=function(e,t){return e.__v.__b-t.__v.__b},On.__r=0,oo=Math.random().toString(8),Ln="__d"+oo,Qt="__a"+oo,Ia=/(PointerCapture)$|Capture$/i,co=0,ao=Ta(!1),io=Ta(!0),Fc=0;var x={id:"help-ai",name:"@helpai/elements",global:"HelpAI",tagName:"web-ai-chat",cssPrefix:"helpai",defaultBaseUrl:"https://help.ai",displayName:"Help AI",domain:"help.ai",siteUrl:"https://help.ai"};var Ba={attach:"Attach files",attachmentMimeRejected:"File type not supported",attachmentTooLarge:"File is too large",attachmentTooMany:"Attachment limit reached",conversationClosed:"This conversation is closed",conversationLoading:"Loading conversation\u2026",close:"Close",collapse:"Collapse",collapseSidebar:"Collapse sidebar",composerPlaceholder:"Type a message\u2026",dateLastWeek:"Last 7 days",dateOlder:"Older",dateToday:"Today",dateYesterday:"Yesterday",dropZone:"Drop files to attach",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous conversations yet",historyLoading:"Loading your conversations\u2026",historyContinue:"Continue the conversation",historyTitle:"Conversation history",language:"Language",launcherOpen:"Open chat",launcherLabel:"Chat with us",micStart:"Start voice input",micStop:"Stop voice input",micUnsupported:"Voice input is not supported in this browser",moreActions:"More actions",newConversation:"New conversation",panelTitle:"Chat",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",soundOff:"Sound off",soundOn:"Sound on",startNewConversation:"Start a new conversation",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",thinking:"Thinking\u2026",thoughts:"Thoughts",usedTool:"Used tool",toolResult:"Result",sources:"Sources",tabHome:"Home",tabConversations:"Conversations",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",moduleBack:"Back",contentLoading:"Loading\u2026",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results found",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsBack:"Back to news",newsPublishedAt:"Published {date}",formSubmit:"Submit",formSkip:"Maybe later",formSubmitted:"Completed",formSkipped:"Maybe later",formFillOut:"Fill out",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidUrl:"Enter a valid URL",formInvalidNumber:"Enter a valid number",formTooShort:"Too short (min {min} characters)",formTooLong:"Too long (max {max} characters)",formNumberTooSmall:"Must be at least {min}",formNumberTooLarge:"Must be at most {max}",formPatternMismatch:"Please match the requested format",formChooseAtLeast:"Choose at least {min}",formChooseAtMost:"Choose at most {max}",formOther:"Other",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"Questions for you",inputBadge:"Questions",inputAnswered:"Answered",inputSkipped:"Skipped",inputSubmit:"Submit answers",inputSubmitHint:"Enter to send \xB7 Shift+Enter = new line",inputSkip:"Skip",confirmYes:"Yes",confirmNo:"No",approvalRequired:"Approval required",approve:"Approve",reject:"Reject",approved:"Approved",rejected:"Rejected",approvalReason:"Add a reason (optional)",approvalPrompt:"{tool} requires your approval to execute.",approvalBody:"Review the tool input above and decide whether to allow this action.",approvalYourResponse:"Your response: {decision}",approvalEditHint:"You can edit this response until this step continues.",approvalSubmitting:"Response submitted. Request in progress\u2026",edit:"Edit",toolParameters:"Parameters",statusAwaiting:"Awaiting Approval",statusResponded:"Responded",statusRunning:"Running",statusCompleted:"Completed",statusDenied:"Denied",statusError:"Error",statusSuperseded:"Skipped"},jc={attach:"Joindre des fichiers",attachmentMimeRejected:"Type de fichier non pris en charge",attachmentTooLarge:"Le fichier est trop volumineux",attachmentTooMany:"Limite de pi\xE8ces jointes atteinte",conversationClosed:"Cette conversation est ferm\xE9e",conversationLoading:"Chargement de la conversation\u2026",close:"Fermer",collapse:"R\xE9duire",collapseSidebar:"R\xE9duire la barre lat\xE9rale",composerPlaceholder:"\xC9crivez un message\u2026",dateLastWeek:"7 derniers jours",dateOlder:"Plus ancien",dateToday:"Aujourd'hui",dateYesterday:"Hier",dropZone:"D\xE9posez les fichiers \xE0 joindre",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRetry:"R\xE9essayer",expand:"Agrandir",expandSidebar:"D\xE9velopper la barre lat\xE9rale",exitFullscreen:"Quitter le plein \xE9cran",fullscreen:"Plein \xE9cran",history:"Historique",historyBack:"Retour au chat",historyEmpty:"Aucune conversation pour le moment",historyContinue:"Poursuivre la conversation",historyLoading:"Chargement de vos conversations\u2026",historyTitle:"Historique des conversations",language:"Langue",launcherOpen:"Ouvrir le chat",launcherLabel:"Discuter avec nous",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",micUnsupported:"La saisie vocale n'est pas prise en charge par ce navigateur",moreActions:"Plus d'actions",newConversation:"Nouvelle conversation",panelTitle:"Chat",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",startNewConversation:"D\xE9marrer une nouvelle conversation",stop:"Arr\xEAter",theme:"Th\xE8me",themeAuto:"Auto",themeDark:"Sombre",themeLight:"Clair",textSize:"Taille du texte",textSizeSmall:"Petite",textSizeNormal:"Normale",textSizeLarge:"Grande",loading:"Chargement\u2026",thinking:"R\xE9flexion\u2026",thoughts:"R\xE9flexions",usedTool:"Outil utilis\xE9",toolResult:"R\xE9sultat",sources:"Sources",tabHome:"Accueil",tabConversations:"Conversations",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeContentTitle:"Articles populaires",homeStatus:"Statut",helpTitle:"Aide",helpSearchPlaceholder:"Rechercher de l'aide",helpEmpty:"Aucun article d'aide pour le moment",helpLoading:"Chargement de l'aide\u2026",helpSearchEmpty:"Aucun r\xE9sultat trouv\xE9",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsBack:"Retour aux actualit\xE9s",newsPublishedAt:"Publi\xE9 le {date}",formSubmit:"Envoyer",formSkip:"Plus tard",formSubmitted:"Termin\xE9",formSkipped:"Plus tard",formFillOut:"Remplir",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidUrl:"Saisissez une URL valide",formInvalidNumber:"Saisissez un nombre valide",formTooShort:"Trop court (min. {min} caract\xE8res)",formTooLong:"Trop long (max. {max} caract\xE8res)",formNumberTooSmall:"Doit \xEAtre au moins {min}",formNumberTooLarge:"Doit \xEAtre au plus {max}",formPatternMismatch:"Veuillez respecter le format demand\xE9",formChooseAtLeast:"Choisissez au moins {min}",formChooseAtMost:"Choisissez au plus {max}",formOther:"Autre",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Questions pour vous",inputBadge:"Questions",inputAnswered:"R\xE9pondu",inputSkipped:"Ignor\xE9",inputSubmit:"Envoyer les r\xE9ponses",inputSubmitHint:"Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e = saut de ligne",inputSkip:"Ignorer",confirmYes:"Oui",confirmNo:"Non",approvalRequired:"Approbation requise",approve:"Approuver",reject:"Refuser",approved:"Approuv\xE9",rejected:"Refus\xE9",approvalReason:"Ajouter une raison (facultatif)",approvalPrompt:"{tool} n\xE9cessite votre approbation pour s'ex\xE9cuter.",approvalBody:"V\xE9rifiez les param\xE8tres ci-dessus et d\xE9cidez d'autoriser ou non cette action.",approvalYourResponse:"Votre r\xE9ponse : {decision}",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",approvalSubmitting:"R\xE9ponse envoy\xE9e. Traitement en cours\u2026",edit:"Modifier",toolParameters:"Param\xE8tres",statusAwaiting:"En attente d'approbation",statusResponded:"R\xE9pondu",statusRunning:"En cours",statusCompleted:"Termin\xE9",statusDenied:"Refus\xE9",statusError:"Erreur",statusSuperseded:"Ignor\xE9"},Xc={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645",attachmentTooLarge:"\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627",attachmentTooMany:"\u062A\u0645 \u0628\u0644\u0648\u063A \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A",conversationClosed:"\u062A\u0645 \u0625\u063A\u0644\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629\u2026",close:"\u0625\u063A\u0644\u0627\u0642",collapse:"\u0637\u064A\u0651",collapseSidebar:"\u0637\u064A\u0651 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",composerPlaceholder:"\u0627\u0643\u062A\u0628 \u0631\u0633\u0627\u0644\u0629\u2026",dateLastWeek:"\u0622\u062E\u0631 \u0667 \u0623\u064A\u0627\u0645",dateOlder:"\u0623\u0642\u062F\u0645",dateToday:"\u0627\u0644\u064A\u0648\u0645",dateYesterday:"\u0623\u0645\u0633",dropZone:"\u0623\u0641\u0644\u062A \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0644\u0625\u0631\u0641\u0627\u0642\u0647\u0627",errorGeneric:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0627",errorRateLimited:"\u0637\u0644\u0628\u0627\u062A \u0643\u062B\u064A\u0631\u0629 \u062C\u062F\u064B\u0627 \u2014 \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0628\u0639\u062F \u0644\u062D\u0638\u0629.",errorRetry:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",expand:"\u062A\u0648\u0633\u064A\u0639",expandSidebar:"\u062A\u0648\u0633\u064A\u0639 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",exitFullscreen:"\u0625\u0646\u0647\u0627\u0621 \u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",fullscreen:"\u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",history:"\u0627\u0644\u0633\u062C\u0644",historyBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",historyEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u062D\u0627\u062F\u062B\u0627\u062A \u0633\u0627\u0628\u0642\u0629 \u0628\u0639\u062F",historyContinue:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",historyLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0645\u062D\u0627\u062F\u062B\u0627\u062A\u0643\u2026",historyTitle:"\u0633\u062C\u0644 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0627\u062A",language:"\u0627\u0644\u0644\u063A\u0629",launcherOpen:"\u0641\u062A\u062D \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",launcherLabel:"\u062A\u062D\u062F\u062B \u0645\u0639\u0646\u0627",micStart:"\u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micStop:"\u0625\u064A\u0642\u0627\u0641 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micUnsupported:"\u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645 \u0641\u064A \u0647\u0630\u0627 \u0627\u0644\u0645\u062A\u0635\u0641\u062D",moreActions:"\u0625\u062C\u0631\u0627\u0621\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629",newConversation:"\u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629",panelTitle:"\u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",resizeHandle:"\u0627\u0633\u062D\u0628 \u0644\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u062D\u062C\u0645",scrollToBottom:"\u0627\u0644\u0627\u0646\u062A\u0642\u0627\u0644 \u0625\u0644\u0649 \u0627\u0644\u0623\u062D\u062F\u062B",send:"\u0625\u0631\u0633\u0627\u0644",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",startNewConversation:"\u0628\u062F\u0621 \u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629",stop:"\u0625\u064A\u0642\u0627\u0641",theme:"\u0627\u0644\u0645\u0638\u0647\u0631",themeAuto:"\u062A\u0644\u0642\u0627\u0626\u064A",themeDark:"\u062F\u0627\u0643\u0646",themeLight:"\u0641\u0627\u062A\u062D",textSize:"\u062D\u062C\u0645 \u0627\u0644\u0646\u0635",textSizeSmall:"\u0635\u063A\u064A\u0631",textSizeNormal:"\u0639\u0627\u062F\u064A",textSizeLarge:"\u0643\u0628\u064A\u0631",loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thoughts:"\u0627\u0644\u0623\u0641\u0643\u0627\u0631",usedTool:"\u0623\u062F\u0627\u0629 \u0645\u064F\u0633\u062A\u062E\u062F\u064E\u0645\u0629",toolResult:"\u0627\u0644\u0646\u062A\u064A\u062C\u0629",sources:"\u0627\u0644\u0645\u0635\u0627\u062F\u0631",tabHome:"\u0627\u0644\u0631\u0626\u064A\u0633\u064A\u0629",tabConversations:"\u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0627\u062A",tabHelp:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",tabNews:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",modulesEmpty:"\u0644\u0627 \u0634\u064A\u0621 \u0647\u0646\u0627 \u0628\u0639\u062F",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",homeGreeting:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeGreetingNamed:"\u0645\u0631\u062D\u0628\u064B\u0627 {name} \u{1F44B}",homeGreetingLead:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",homeContentTitle:"\u0645\u0642\u0627\u0644\u0627\u062A \u0634\u0627\u0626\u0639\u0629",homeStatus:"\u0627\u0644\u062D\u0627\u0644\u0629",helpTitle:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",helpSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",helpEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u0642\u0627\u0644\u0627\u062A \u0645\u0633\u0627\u0639\u062F\u0629 \u0628\u0639\u062F",helpLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629\u2026",helpSearchEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C",newsTitle:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0623\u062E\u0628\u0627\u0631 \u0628\u0639\u062F",newsLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0623\u062E\u0628\u0627\u0631\u2026",newsBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsPublishedAt:"\u0646\u064F\u0634\u0631 \u0641\u064A {date}",formSubmit:"\u0625\u0631\u0633\u0627\u0644",formSkip:"\u0644\u0627\u062D\u0642\u064B\u0627",formSubmitted:"\u062A\u0645",formSkipped:"\u0644\u0627\u062D\u0642\u064B\u0627",formFillOut:"\u062A\u0639\u0628\u0626\u0629",formRequired:"\u0647\u0630\u0627 \u0627\u0644\u062D\u0642\u0644 \u0645\u0637\u0644\u0648\u0628",formInvalidEmail:"\u0623\u062F\u062E\u0644 \u0628\u0631\u064A\u062F\u064B\u0627 \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidTel:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidUrl:"\u0623\u062F\u062E\u0644 \u0631\u0627\u0628\u0637\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formTooShort:"\u0642\u0635\u064A\u0631 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 {min} \u062D\u0631\u0641\u064B\u0627)",formTooLong:"\u0637\u0648\u064A\u0644 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 {max} \u062D\u0631\u0641\u064B\u0627)",formNumberTooSmall:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0642\u0644 \u0639\u0646 {min}",formNumberTooLarge:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0632\u064A\u062F \u0639\u0646 {max}",formPatternMismatch:"\u064A\u0631\u062C\u0649 \u0645\u0637\u0627\u0628\u0642\u0629 \u0627\u0644\u0635\u064A\u063A\u0629 \u0627\u0644\u0645\u0637\u0644\u0648\u0628\u0629",formChooseAtLeast:"\u0627\u062E\u062A\u0631 {min} \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644",formChooseAtMost:"\u0627\u062E\u062A\u0631 {max} \u0639\u0644\u0649 \u0627\u0644\u0623\u0643\u062B\u0631",formOther:"\u0623\u062E\u0631\u0649",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0623\u0633\u0626\u0644\u0629 \u0644\u0643",inputBadge:"\u0623\u0633\u0626\u0644\u0629",inputAnswered:"\u062A\u0645\u062A \u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputSkipped:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A",inputSubmit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A",inputSubmitHint:"Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter = \u0633\u0637\u0631 \u062C\u062F\u064A\u062F",inputSkip:"\u062A\u062E\u0637\u064D\u0651",confirmYes:"\u0646\u0639\u0645",confirmNo:"\u0644\u0627",approvalRequired:"\u0645\u0637\u0644\u0648\u0628 \u0645\u0648\u0627\u0641\u0642\u0629",approve:"\u0645\u0648\u0627\u0641\u0642\u0629",reject:"\u0631\u0641\u0636",approved:"\u062A\u0645\u062A \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",rejected:"\u0645\u0631\u0641\u0648\u0636",approvalReason:"\u0623\u0636\u0641 \u0633\u0628\u0628\u064B\u0627 (\u0627\u062E\u062A\u064A\u0627\u0631\u064A)",approvalPrompt:"\u062A\u062A\u0637\u0644\u0628 {tool} \u0645\u0648\u0627\u0641\u0642\u062A\u0643 \u0644\u0644\u062A\u0646\u0641\u064A\u0630.",approvalBody:"\u0631\u0627\u062C\u0639 \u0645\u064F\u0639\u0637\u064A\u0627\u062A \u0627\u0644\u0623\u062F\u0627\u0629 \u0623\u0639\u0644\u0627\u0647 \u0648\u0642\u0631\u0651\u0631 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \u0623\u0648 \u0631\u0641\u0636\u0647.",approvalYourResponse:"\u0631\u062F\u0651\u0643: {decision}",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u0639\u062F\u064A\u0644 \u0631\u062F\u0651\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",approvalSubmitting:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062F. \u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",edit:"\u062A\u0639\u062F\u064A\u0644",toolParameters:"\u0627\u0644\u0645\u0639\u0637\u064A\u0627\u062A",statusAwaiting:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",statusResponded:"\u062A\u0645 \u0627\u0644\u0631\u062F",statusRunning:"\u0642\u064A\u062F \u0627\u0644\u062A\u0646\u0641\u064A\u0630",statusCompleted:"\u0645\u0643\u062A\u0645\u0644",statusDenied:"\u0645\u0631\u0641\u0648\u0636",statusError:"\u062E\u0637\u0623",statusSuperseded:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A"},Yc={attach:"Adjuntar archivos",attachmentMimeRejected:"Tipo de archivo no admitido",attachmentTooLarge:"El archivo es demasiado grande",attachmentTooMany:"Se alcanz\xF3 el l\xEDmite de adjuntos",conversationClosed:"Esta conversaci\xF3n est\xE1 cerrada",conversationLoading:"Cargando conversaci\xF3n\u2026",close:"Cerrar",collapse:"Contraer",collapseSidebar:"Contraer la barra lateral",composerPlaceholder:"Escribe un mensaje\u2026",dateLastWeek:"\xDAltimos 7 d\xEDas",dateOlder:"Anteriores",dateToday:"Hoy",dateYesterday:"Ayer",dropZone:"Suelta los archivos para adjuntarlos",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRetry:"Reintentar",expand:"Ampliar",expandSidebar:"Expandir la barra lateral",exitFullscreen:"Salir de pantalla completa",fullscreen:"Pantalla completa",history:"Historial",historyBack:"Volver al chat",historyEmpty:"A\xFAn no tienes conversaciones",historyContinue:"Continuar la conversaci\xF3n",historyLoading:"Cargando tus conversaciones\u2026",historyTitle:"Historial de conversaciones",language:"Idioma",launcherOpen:"Abrir el chat",launcherLabel:"Chatea con nosotros",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",micUnsupported:"Este navegador no admite la entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nueva conversaci\xF3n",panelTitle:"Chat",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",soundOff:"Sonido desactivado",soundOn:"Sonido activado",startNewConversation:"Iniciar una conversaci\xF3n nueva",stop:"Detener",theme:"Tema",themeAuto:"Autom\xE1tico",themeDark:"Oscuro",themeLight:"Claro",textSize:"Tama\xF1o del texto",textSizeSmall:"Peque\xF1o",textSizeNormal:"Normal",textSizeLarge:"Grande",loading:"Cargando\u2026",thinking:"Pensando\u2026",thoughts:"Razonamiento",usedTool:"Herramienta usada",toolResult:"Resultado",sources:"Fuentes",tabHome:"Inicio",tabConversations:"Conversaciones",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeContentTitle:"Art\xEDculos populares",homeStatus:"Estado",helpTitle:"Ayuda",helpSearchPlaceholder:"Buscar ayuda",helpEmpty:"A\xFAn no hay art\xEDculos de ayuda",helpLoading:"Cargando la ayuda\u2026",helpSearchEmpty:"No se encontraron resultados",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsBack:"Volver a novedades",newsPublishedAt:"Publicado el {date}",formSubmit:"Enviar",formSkip:"Quiz\xE1 m\xE1s tarde",formSubmitted:"Completado",formSkipped:"Quiz\xE1 m\xE1s tarde",formFillOut:"Completar",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidUrl:"Introduce una URL v\xE1lida",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formTooShort:"Demasiado corto (m\xEDn. {min} caracteres)",formTooLong:"Demasiado largo (m\xE1x. {max} caracteres)",formNumberTooSmall:"Debe ser al menos {min}",formNumberTooLarge:"Debe ser como m\xE1ximo {max}",formPatternMismatch:"Respeta el formato solicitado",formChooseAtLeast:"Elige al menos {min}",formChooseAtMost:"Elige como m\xE1ximo {max}",formOther:"Otro",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Preguntas para ti",inputBadge:"Preguntas",inputAnswered:"Respondido",inputSkipped:"Omitido",inputSubmit:"Enviar respuestas",inputSubmitHint:"Enter para enviar \xB7 May\xFAs+Enter = nueva l\xEDnea",inputSkip:"Omitir",confirmYes:"S\xED",confirmNo:"No",approvalRequired:"Aprobaci\xF3n requerida",approve:"Aprobar",reject:"Rechazar",approved:"Aprobado",rejected:"Rechazado",approvalReason:"A\xF1ade un motivo (opcional)",approvalPrompt:"{tool} requiere tu aprobaci\xF3n para ejecutarse.",approvalBody:"Revisa los par\xE1metros de arriba y decide si permites esta acci\xF3n.",approvalYourResponse:"Tu respuesta: {decision}",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",approvalSubmitting:"Respuesta enviada. Procesando\u2026",edit:"Editar",toolParameters:"Par\xE1metros",statusAwaiting:"Esperando aprobaci\xF3n",statusResponded:"Respondido",statusRunning:"En curso",statusCompleted:"Completado",statusDenied:"Denegado",statusError:"Error",statusSuperseded:"Omitido"},Jc={attach:"\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",attachmentMimeRejected:"\u05E1\u05D5\u05D2 \u05D4\u05E7\u05D5\u05D1\u05E5 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA",attachmentTooLarge:"\u05D4\u05E7\u05D5\u05D1\u05E5 \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9",attachmentTooMany:"\u05D4\u05D2\u05E2\u05EA \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D4\u05DE\u05E8\u05D1\u05D9 \u05E9\u05DC \u05E7\u05D1\u05E6\u05D9\u05DD \u05DE\u05E6\u05D5\u05E8\u05E4\u05D9\u05DD",conversationClosed:"\u05D4\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5 \u05E0\u05E1\u05D2\u05E8\u05D4",conversationLoading:"\u05D8\u05D5\u05E2\u05DF \u05E9\u05D9\u05D7\u05D4\u2026",close:"\u05E1\u05D2\u05D9\u05E8\u05D4",collapse:"\u05DB\u05D9\u05D5\u05D5\u05E5",collapseSidebar:"\u05DB\u05D9\u05D5\u05D5\u05E5 \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",composerPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D4\u05D5\u05D3\u05E2\u05D4\u2026",dateLastWeek:"7 \u05D4\u05D9\u05DE\u05D9\u05DD \u05D4\u05D0\u05D7\u05E8\u05D5\u05E0\u05D9\u05DD",dateOlder:"\u05D9\u05E9\u05DF \u05D9\u05D5\u05EA\u05E8",dateToday:"\u05D4\u05D9\u05D5\u05DD",dateYesterday:"\u05D0\u05EA\u05DE\u05D5\u05DC",dropZone:"\u05E9\u05D7\u05E8\u05E8 \u05E7\u05D1\u05E6\u05D9\u05DD \u05DB\u05D3\u05D9 \u05DC\u05E6\u05E8\u05E3",errorGeneric:"\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9",errorRateLimited:"\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 \u05E8\u05D2\u05E2.",errorRetry:"\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1",expand:"\u05D4\u05E8\u05D7\u05D1\u05D4",expandSidebar:"\u05D4\u05E8\u05D7\u05D1\u05EA \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",exitFullscreen:"\u05D9\u05E6\u05D9\u05D0\u05D4 \u05DE\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",fullscreen:"\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",history:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D4",historyBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05E9\u05D9\u05D7\u05D4",historyEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05E9\u05D9\u05D7\u05D5\u05EA \u05E7\u05D5\u05D3\u05DE\u05D5\u05EA",historyContinue:"\u05D4\u05DE\u05E9\u05DA \u05E9\u05D9\u05D7\u05D4",historyLoading:"\u05D8\u05D5\u05E2\u05DF \u05D0\u05EA \u05D4\u05E9\u05D9\u05D7\u05D5\u05EA \u05E9\u05DC\u05DA\u2026",historyTitle:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D9\u05EA \u05E9\u05D9\u05D7\u05D5\u05EA",language:"\u05E9\u05E4\u05D4",launcherOpen:"\u05E4\u05EA\u05D9\u05D7\u05EA \u05E6\u05F3\u05D0\u05D8",launcherLabel:"\u05D3\u05D1\u05E8\u05D5 \u05D0\u05D9\u05EA\u05E0\u05D5",micStart:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micStop:"\u05E2\u05E6\u05D9\u05E8\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micUnsupported:"\u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA \u05D1\u05D3\u05E4\u05D3\u05E4\u05DF \u05D6\u05D4",moreActions:"\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",newConversation:"\u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4",panelTitle:"\u05E9\u05D9\u05D7\u05D4",resizeHandle:"\u05D2\u05E8\u05D5\u05E8 \u05DC\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05D2\u05D5\u05D3\u05DC",scrollToBottom:"\u05DE\u05E2\u05D1\u05E8 \u05DC\u05D7\u05D3\u05E9 \u05D1\u05D9\u05D5\u05EA\u05E8",send:"\u05E9\u05DC\u05D9\u05D7\u05D4",soundOff:"\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",soundOn:"\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",startNewConversation:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4",stop:"\u05E2\u05E6\u05D9\u05E8\u05D4",theme:"\u05E2\u05E8\u05DB\u05EA \u05E0\u05D5\u05E9\u05D0",themeAuto:"\u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9",themeDark:"\u05DB\u05D4\u05D4",themeLight:"\u05D1\u05D4\u05D9\u05E8",textSize:"\u05D2\u05D5\u05D3\u05DC \u05D8\u05E7\u05E1\u05D8",textSizeSmall:"\u05E7\u05D8\u05DF",textSizeNormal:"\u05E8\u05D2\u05D9\u05DC",textSizeLarge:"\u05D2\u05D3\u05D5\u05DC",loading:"\u05D8\u05D5\u05E2\u05DF\u2026",thinking:"\u05D7\u05D5\u05E9\u05D1\u2026",thoughts:"\u05DE\u05D7\u05E9\u05D1\u05D5\u05EA",usedTool:"\u05DB\u05DC\u05D9 \u05D1\u05E9\u05D9\u05DE\u05D5\u05E9",toolResult:"\u05EA\u05D5\u05E6\u05D0\u05D4",sources:"\u05DE\u05E7\u05D5\u05E8\u05D5\u05EA",tabHome:"\u05D1\u05D9\u05EA",tabConversations:"\u05E9\u05D9\u05D7\u05D5\u05EA",tabHelp:"\u05E2\u05D6\u05E8\u05D4",tabNews:"\u05D7\u05D3\u05E9\u05D5\u05EA",modulesEmpty:"\u05D0\u05D9\u05DF \u05DB\u05D0\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DB\u05DC\u05D5\u05DD",moduleBack:"\u05D7\u05D6\u05E8\u05D4",contentLoading:"\u05D8\u05D5\u05E2\u05DF\u2026",homeGreeting:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeGreetingNamed:"\u05E9\u05DC\u05D5\u05DD {name} \u{1F44B}",homeGreetingLead:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",homeContentTitle:"\u05DE\u05D0\u05DE\u05E8\u05D9\u05DD \u05E4\u05D5\u05E4\u05D5\u05DC\u05E8\u05D9\u05D9\u05DD",homeStatus:"\u05E1\u05D8\u05D8\u05D5\u05E1",helpTitle:"\u05E2\u05D6\u05E8\u05D4",helpSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",helpEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DE\u05D0\u05DE\u05E8\u05D9 \u05E2\u05D6\u05E8\u05D4",helpLoading:"\u05D8\u05D5\u05E2\u05DF \u05E2\u05D6\u05E8\u05D4\u2026",helpSearchEmpty:"\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA",newsTitle:"\u05D7\u05D3\u05E9\u05D5\u05EA",newsEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA",newsLoading:"\u05D8\u05D5\u05E2\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA\u2026",newsBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05D7\u05D3\u05E9\u05D5\u05EA",newsPublishedAt:"\u05E4\u05D5\u05E8\u05E1\u05DD \u05D1-{date}",formSubmit:"\u05E9\u05DC\u05D9\u05D7\u05D4",formSkip:"\u05D0\u05D7\u05E8 \u05DB\u05DA",formSubmitted:"\u05E0\u05E9\u05DC\u05D7",formSkipped:"\u05D3\u05D5\u05DC\u05D2",formFillOut:"\u05DE\u05D9\u05DC\u05D5\u05D9",formRequired:"\u05E9\u05D3\u05D4 \u05D7\u05D5\u05D1\u05D4",formInvalidEmail:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidTel:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05EA\u05E7\u05D9\u05DF",formInvalidUrl:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA URL \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidNumber:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",formTooShort:"\u05E7\u05E6\u05E8 \u05DE\u05D3\u05D9 (\u05DC\u05E4\u05D7\u05D5\u05EA {min} \u05EA\u05D5\u05D5\u05D9\u05DD)",formTooLong:"\u05D0\u05E8\u05D5\u05DA \u05DE\u05D3\u05D9 (\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max} \u05EA\u05D5\u05D5\u05D9\u05DD)",formNumberTooSmall:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formNumberTooLarge:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formPatternMismatch:"\u05D4\u05EA\u05D0\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D4\u05E0\u05D3\u05E8\u05E9\u05EA",formChooseAtLeast:"\u05D1\u05D7\u05E8 \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formChooseAtMost:"\u05D1\u05D7\u05E8 \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formOther:"\u05D0\u05D7\u05E8",formOtherPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D0\u05EA \u05EA\u05E9\u05D5\u05D1\u05EA\u05DA\u2026",inputRequired:"\u05E9\u05D0\u05DC\u05D5\u05EA \u05E2\u05D1\u05D5\u05E8\u05DA",inputBadge:"\u05E9\u05D0\u05DC\u05D5\u05EA",inputAnswered:"\u05E0\u05E2\u05E0\u05D4",inputSkipped:"\u05D3\u05D5\u05DC\u05D2",inputSubmit:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05E9\u05D5\u05D1\u05D5\u05EA",inputSubmitHint:"Enter \u05DC\u05E9\u05DC\u05D9\u05D7\u05D4 \xB7 Shift+Enter = \u05E9\u05D5\u05E8\u05D4 \u05D7\u05D3\u05E9\u05D4",inputSkip:"\u05D3\u05D9\u05DC\u05D5\u05D2",confirmYes:"\u05DB\u05DF",confirmNo:"\u05DC\u05D0",approvalRequired:"\u05E0\u05D3\u05E8\u05E9 \u05D0\u05D9\u05E9\u05D5\u05E8",approve:"\u05D0\u05D9\u05E9\u05D5\u05E8",reject:"\u05D3\u05D7\u05D9\u05D9\u05D4",approved:"\u05D0\u05D5\u05E9\u05E8",rejected:"\u05E0\u05D3\u05D7\u05D4",approvalReason:"\u05D4\u05D5\u05E1\u05E3 \u05E1\u05D9\u05D1\u05D4 (\u05D0\u05D5\u05E4\u05E6\u05D9\u05D5\u05E0\u05DC\u05D9)",approvalPrompt:"\u05D4\u05DB\u05DC\u05D9 {tool} \u05D3\u05D5\u05E8\u05E9 \u05D0\u05EA \u05D0\u05D9\u05E9\u05D5\u05E8\u05DA \u05DB\u05D3\u05D9 \u05DC\u05E4\u05E2\u05D5\u05DC.",approvalBody:"\u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05E4\u05E8\u05DE\u05D8\u05E8\u05D9 \u05D4\u05DB\u05DC\u05D9 \u05E9\u05DC\u05DE\u05E2\u05DC\u05D4 \u05D5\u05D4\u05D7\u05DC\u05D8 \u05D0\u05DD \u05DC\u05D0\u05E9\u05E8 \u05E4\u05E2\u05D5\u05DC\u05D4 \u05D6\u05D5.",approvalYourResponse:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA: {decision}",approvalEditHint:"\u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D5\u05DA \u05D0\u05EA \u05EA\u05D2\u05D5\u05D1\u05EA\u05DA \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05EA\u05D7\u05D3\u05E9.",approvalSubmitting:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05DE\u05D1\u05E6\u05E2\u2026",edit:"\u05E2\u05E8\u05D9\u05DB\u05D4",toolParameters:"\u05E4\u05E8\u05DE\u05D8\u05E8\u05D9\u05DD",statusAwaiting:"\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8",statusResponded:"\u05E0\u05E2\u05E0\u05D4",statusRunning:"\u05E4\u05D5\u05E2\u05DC",statusCompleted:"\u05D4\u05D5\u05E9\u05DC\u05DD",statusDenied:"\u05E0\u05D3\u05D7\u05D4",statusError:"\u05E9\u05D2\u05D9\u05D0\u05D4",statusSuperseded:"\u05D3\u05D5\u05DC\u05D2"},Qc={en:Ba,fr:jc,ar:Xc,es:Yc,he:Jc};function Fn(e,t){let n=Ha(e),r=Un(t),a=n==="en"?{}:Qc[n]??{},i=r?t[n]??{}:t??{},l=r?t.en??{}:{};return{...Ba,...a,...l,...i}}function Ha(e){return(e.split("-")[0]??"en").toLowerCase()}var Zc=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function za(e){return Zc.has(Ha(e))}function Ee(e,t){return e[t]??t}function Un(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function Fa(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function Ua(e,t){let{translations:n,defaultLocale:r,...a}=e,i=Fa(n,t);return i?{...a,title:i.title??a.title,description:i.description??a.description,content:i.content??a.content}:a}function qa(e,t){let{translations:n,defaultLocale:r,...a}=e,i=Fa(n,t);if(!i)return a;let l=new Map((i.fields??[]).map(c=>[c.name,c])),s=a.fields.map(c=>{let d=l.get(c.name);if(!d)return c;let u=new Map((d.options??[]).map(_=>[_.value,_]));return{...c,label:d.label??c.label,placeholder:d.placeholder??c.placeholder,validationHint:d.validationHint??c.validationHint,options:c.options?.map(_=>{let g=u.get(_.value);return g?{..._,label:g.label??_.label,description:g.description??_.description}:_})}});return{...a,title:i.title??a.title,description:i.description??a.description,submitLabel:i.submitLabel??a.submitLabel,fields:s}}var mo=class{get(t){try{return localStorage.getItem(t)}catch{return null}}set(t,n){try{localStorage.setItem(t,n)}catch{}}remove(t){try{localStorage.removeItem(t)}catch{}}},qn=new mo;var ed=["off","error","warn","info","debug","trace"],fo=x.cssPrefix,td=`${fo}.debug`,nd=`__${x.global}_DEBUG__`,rd=`${fo}-debug`,Va=2,Wa=null;function od(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(rd);if(e!==null){let t=Ga(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(td);if(e){let t=Ga(e);if(t>=0)return t}}catch{}return window[nd]?4:2}function Ga(e){if(e===!0||e==="1"||e==="true")return 4;if(e===!1||e==="0"||e==="false"||e==="off")return 0;if(typeof e=="number")return Math.max(0,Math.min(5,Math.floor(e)));if(typeof e=="string"){let t=ed.indexOf(e);if(t>=0)return t}return-1}Va=od();function Ka(e){let t=`[${fo}:${e}]`,n=(r,a,i)=>(l,s)=>{if(!(Va<r)&&(s===void 0?console[a](t,l):console[a](t,l,s),Wa))try{Wa({level:i,scope:e,message:l,payload:s})}catch{}};return{error:n(1,"error","error"),warn:n(2,"warn","warn"),info:n(3,"info","info"),debug:n(4,"debug","debug"),trace:n(5,"debug","trace"),scope:r=>Ka(`${e}:${r}`)}}var J=Ka("core");var pt=J.scope("context"),ad=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),ja=50,go=1024,id=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function ho(e){return Xa(e,"userContext",!0)}function vo(e){return Xa(e,"pageContext",!1)}function Xa(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){pt.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let r={},a=0;for(let[i,l]of Object.entries(e)){if(ad.has(i)){pt.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(l==null)continue;if(a>=ja){pt.warn(`${t} truncated at ${ja} keys \u2014 dropped "${i}"`);continue}let s=sd(t,i,l);s!==void 0&&(r[i]=s,a++)}return n&&typeof r.email=="string"&&!id.test(r.email)&&(pt.warn(`dropped malformed ${t}.email "${r.email}"`),delete r.email),Object.keys(r).length>0?r:void 0}function sd(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){pt.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let r=n.trim();return r===""?void 0:r.length>go?(pt.warn(`truncated ${e}.${t} to ${go} chars`),r.slice(0,go)):r}pt.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var Wn={maxBytes:10485760,maxCount:10,accept:"*/*"},Gn={files:!0,voice:"local",humanInLoop:!0},Ya={list:[],byTrigger:{}},bo={enabled:!0,sampleRate:1},Vn={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},Et={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},Ja={floating:["theme","textSize","history","close","clear","expand","fullscreen","sound","language"],inline:["theme","textSize","history","close","clear","fullscreen","sound","language"],standalone:["theme","textSize","history","clear","sound","language"],page:["theme","textSize","history","clear","sound","language"],modal:["theme","textSize","history","close","clear","fullscreen","sound","language"],drawer:["theme","textSize","history","close","clear","fullscreen","sound","language"]},Po={enabled:!0,volume:.3,events:void 0},Qa={enabled:!0,events:void 0},Za=[{label:"tabConversations",layout:"chat"}],ei={showSearchBar:!0};function Rt(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},r=t.behavior??{},a=t.i18n??{},i=t.feedback??{},l=t.footer??{},s=t.header??{},{themeMode:c,themeOverrides:d}=ld(t.theme),u=n.mode??"floating",_=cd(a.defaultLocale),g=a.availableLocales??[a.locale??_],f=At(a.locale??_,g,_),m=(t.baseUrl??x.defaultBaseUrl).replace(/\/$/,""),C=(t.agentApiBaseUrl??`${m}/api/agent`).replace(/\/$/,""),v=(t.dataApiBaseUrl??`${m}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:m,agentApiBaseUrl:C,dataApiBaseUrl:v,userContext:ho(t.userContext),pageContext:vo(t.pageContext),position:n.position??"bottom-right",themeMode:c,textSize:"normal",themeOverrides:d,mode:u,iframe:n.iframe??!1,responseMode:r.responseMode??"streaming",showReasoning:r.showReasoning??!1,showToolCalls:r.showToolCalls??!1,showSources:r.showSources??!1,features:{files:t.features?.files??Gn.files,voice:t.features?.voice??Gn.voice,humanInLoop:t.features?.humanInLoop??Gn.humanInLoop,tools:t.features?.tools},forms:Zt(t.forms,f),endpoints:{upload:t.endpoints?.upload??Vn.upload,transcribe:t.endpoints?.transcribe??Vn.transcribe,submitForm:t.endpoints?.submitForm??Vn.submitForm},attachments:{accept:t.composer?.attachments?.accept??Wn.accept,maxBytes:t.composer?.attachments?.maxBytes??Wn.maxBytes,maxCount:t.composer?.attachments?.maxCount??Wn.maxCount},locale:f,defaultLocale:_,availableLocales:g,startMinimized:r.startMinimized??!0,actions:dd(u,s.actions),size:n.size??{},launcher:vd(t.launcher),sound:_d(i.sound),haptics:ud(i.haptics),strings:Fn(f,a.strings),stringsOverride:a.strings,composerDisclaimer:l.composerDisclaimer??"",poweredBy:md(l.poweredBy),composer:fd(t.composer),modules:gd(t.modules),tracking:pd(t.tracking,v),storage:t.storage??qn,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function ld(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function cd(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function At(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function dd(e,t){return t??Ja[e]}function _d(e){return{enabled:e?.enabled??Po.enabled,volume:e?.volume??Po.volume,events:e?.events}}function ud(e){return{enabled:e?.enabled??Qa.enabled,events:e?.events}}function pd(e,t){let n=e?.sampleRate??bo.sampleRate;return{enabled:e?.enabled??bo.enabled,endpoint:e?.endpoint??`${t}/pai/elements-px.gif`,sampleRate:Math.min(1,Math.max(0,Number.isFinite(n)?n:1)),token:e?.token}}function md(e){let n={...{text:`Powered by ${x.displayName}`,href:x.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function fd(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function gd(e){let t=e===void 0?Za:e,n=new Set,r=[];for(let i of t.slice(0,4)){if(!i?.label||!i?.layout)continue;let l=i.contentTags?.filter(Boolean),s=i.id??l?.[0]??i.layout;for(;n.has(s);)s=`${s}-${r.length}`;n.add(s);let c={id:s,label:i.label,layout:i.layout};l&&l.length>0&&(c.contentTags=l),i.layout==="home"&&(c.brandName=i.brandName,c.greetingText=i.greetingText,c.showGreeting=i.showGreeting??!0,c.showSearchBar=i.showSearchBar??ei.showSearchBar,c.showRecentConversations=i.showRecentConversations??!0,i.userAvatars&&i.userAvatars.length>0&&(c.userAvatars=i.userAvatars),i.status&&(c.status=i.status),c.contentBlockTitle=i.contentBlockTitle),r.push(c)}let a=Object.fromEntries(r.map(i=>[i.id,i]));return{list:r,byId:a}}function Zt(e,t){var i;if(!e?.length)return Ya;let n=[],r=new Set;for(let l of e){if(!l?.id||r.has(l.id))continue;let s=qa(l,t),c=(s.fields??[]).filter(u=>!!(u&&u.name&&u.label&&u.type)),d=(Array.isArray(s.on)?s.on:[s.on]).map(hd).filter(u=>u!==null);c.length===0||d.length===0||(r.add(s.id),n.push({id:s.id,triggers:d,when:s.when,fields:c,title:s.title,description:s.description,submitLabel:s.submitLabel,skippable:s.skippable??!1,frequency:s.frequency??"once",mirrorToContext:s.mirrorToContext??!0,reopenable:s.reopenable??!0,reviewable:s.reviewable??!0}))}let a={};for(let l of n)for(let s of l.triggers)(a[i=s.kind]??(a[i]=[])).push(l);return{list:n,byTrigger:a}}function hd(e){if(typeof e!="string")return null;if(e==="pre-chat"||e==="conversation-closed"||e==="panel-close"||e==="manual")return{kind:e};let[t,n]=e.split(":",2);if(t==="after-messages"){let r=Number(n);return Number.isFinite(r)&&r>0?{kind:"after-messages",param:r}:null}if(t==="idle"){let r=Number(n);return Number.isFinite(r)&&r>0?{kind:"idle",param:r}:null}return t==="page-area"&&n?{kind:"page-area",param:n}:null}function vd(e){let t=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??Et.variant,size:e?.size??Et.size,label:e?.label??Et.label,icon:e?.icon??Et.icon,hidden:e?.hidden??Et.hidden,callout:t}}function xo(e,t,n,r){let a=At(t,e.availableLocales,e.defaultLocale);if(a===e.locale&&n===e.themeMode&&r===e.textSize)return e;let i={...e};return a!==e.locale&&(i.locale=a,i.strings=Fn(a,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),r!==e.textSize&&(i.textSize=r),i}var bd=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function yo(e,t){if(!t)return e;let n={...e};for(let i of bd){let l=t[i];if(l===void 0)continue;let s=e[i];if(i==="theme"){s===void 0&&(n[i]=l);continue}i!=="i18n"&&(n[i]=ti(l,s))}t.modules!==void 0&&e.modules===void 0&&(n.modules=t.modules),t.dataApiBaseUrl!==void 0&&e.dataApiBaseUrl===void 0&&(n.dataApiBaseUrl=t.dataApiBaseUrl);let r=e.i18n,a=t.i18n;if(r||a){let i=ti(a??{},r);a?.availableLocales!==void 0&&(i.availableLocales=a.availableLocales),a?.defaultLocale!==void 0&&(i.defaultLocale=a.defaultLocale);let l=r?.strings,s=a?.strings;(l||s)&&(i.strings=Pd(s,l)),n.i18n=i}return n}function ti(e,t){if(!t)return e;let n={...e};for(let[r,a]of Object.entries(t))a!==void 0&&(n[r]=a);return n}function Pd(e,t){if(!e)return t;if(!t)return e;let n=Un(e),r=Un(t);if(!n&&!r)return{...e,...t};let a={},i=n?e:{en:e},l=r?t:{en:t};for(let[s,c]of Object.entries(i))a[s]={...c};for(let[s,c]of Object.entries(l))a[s]={...a[s],...c};return a}var xd=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],ft=e=>e!=="false",ri=e=>e.split(",").map(t=>t.trim()).filter(Boolean),oi=[["public-key","publicKey"],["ai-agent-deployment-id","aiAgentDeploymentId"],["base-url","baseUrl"],["agent-api-base-url","agentApiBaseUrl"],["data-api-base-url","dataApiBaseUrl"],["theme","theme",e=>e]],ai=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",ft]],ii=[["width","width"],["height","height"]],si=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",ft],["show-reasoning","showReasoning",ft],["show-tool-calls","showToolCalls",ft],["show-sources","showSources",ft]],li=[["locale","locale"]],yd=new Set(xd),Sd=e=>ri(e).filter(t=>yd.has(t)),ci=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",ft]],di=[["features-files","files",ft],["features-voice","voice",e=>e],["features-tools","tools",ri]],_i=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],ui=[["user-id","id"],["user-email","email"],["user-name","name"]],pi=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],wd=["launcher-label","callout-text","callout-delay","actions-main","actions-overflow","user-context","page-context"],kd=[oi,ai,ii,si,li,ci,di,_i,ui,pi],Cd=new Set(["iframe","start-minimized"]),So=[...kd.flatMap(e=>e.map(([t])=>t).filter(t=>!Cd.has(t))),...wd];function wo(e){let t={},n=f=>{let m=e(f);return m===null||m===""?void 0:m};for(let[f,m,C]of oi){let v=n(f);v!==void 0&&(t[m]=C?C(v):v)}let r=mt(n,ai),a=mt(n,ii);(r||a)&&(t.presentation={...r,...a?{size:a}:{}});let i=mt(n,si);i&&(t.behavior=i);let l=mt(n,li);l&&(t.i18n=l);let s=Td(e,n);s&&(t.launcher=s);let c=mt(n,di);c&&(t.features=c);let d=mt(n,_i);d&&(t.endpoints=d);let u=ni(n,ui,"user-context");u&&(t.userContext=u);let _=ni(n,pi,"page-context");_&&(t.pageContext=_);let g=n("actions");return g!==void 0&&(t.header={actions:Sd(g)}),t}function mt(e,t){let n={};for(let[r,a,i]of t){let l=e(r);l!==void 0&&(n[a]=i?i(l):l)}return Object.keys(n).length>0?n:null}function ni(e,t,n){let r={};for(let[s,c]of t){let d=e(s);d!==void 0&&(r[c]=d)}let a={},i=e(n);if(i)try{let s=JSON.parse(i);s&&typeof s=="object"&&!Array.isArray(s)&&(a=s)}catch{}let l={...a,...r};return Object.keys(l).length>0?l:null}function Td(e,t){let n=mt(t,ci)??{},r=e("launcher-label");r!==null&&(n.label=r);let a=t("callout-text");if(a){let i=Number.parseInt(t("callout-delay")??"",10);n.callout={text:a,...Number.isFinite(i)?{delayMs:i}:{}}}return Object.keys(n).length>0?n:null}function Ue(){let e=Date.now(),t=new Uint8Array(16);t[0]=Math.floor(e/2**40)&255,t[1]=Math.floor(e/2**32)&255,t[2]=e>>>24&255,t[3]=e>>>16&255,t[4]=e>>>8&255,t[5]=e&255,Ed(t.subarray(6)),t[6]=t[6]&15|112,t[8]=t[8]&63|128;let n=Array.from(t,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function Ed(e){if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"){crypto.getRandomValues(e);return}for(let t=0;t<e.length;t++)e[t]=Math.floor(Math.random()*256)}var gt=J.scope("persistence");function It(e,t=qn,n){let r=n?`${e}.${n}`:e,a=`${x.cssPrefix}.storageVersion`,i=t.get(a)??void 0,l=i?`.v${i}`:"",s=`${x.cssPrefix}.${r}${l}`,c=`${x.cssPrefix}${l}.visitorId`,d=`${s}.conversationId`,u=`${s}.userPrefs`,_=`${s}.panelOpen`,g=`${s}.panelSize`,f=`${s}.calloutDismissed`,m=`${s}.sidebarCollapsed`,C=`${s}.activeModule`,v=`${s}.historyCount`,b=`${s}.formsDone`,y={getVisitorId(){let P=t.get(c);if(P)return P;let R=Ue();return t.set(c,R),R},setVisitorId(P){gt.debug("setVisitorId (rebind)",{id:P,scope:r}),t.set(c,P)},loadConversationId(){return t.get(d)??void 0},saveConversationId(P){gt.trace("saveConversationId",{id:P,scope:r}),P?t.set(d,P):t.remove(d)},loadUserPrefs(){let P=t.get(u);if(!P)return{};try{let R=JSON.parse(P);return mi(R)?R:{}}catch(R){return gt.warn("loadUserPrefs parse failed",{error:R}),{}}},saveUserPrefs(P){try{t.set(u,JSON.stringify(P))}catch(R){gt.warn("saveUserPrefs serialise failed",{error:R})}},patchUserPrefs(P){let R=y.loadUserPrefs();y.saveUserPrefs({...R,...P})},loadPanelOpen(){let P=t.get(_);return P==="1"?!0:P==="0"?!1:null},savePanelOpen(P){t.set(_,P?"1":"0")},loadPanelSize(){let P=t.get(g);return P==="normal"||P==="expanded"||P==="fullscreen"?P:null},savePanelSize(P){t.set(g,P)},loadCalloutDismissed(P){if(!P)return!1;let R=t.get(f);return!!R&&R===P},saveCalloutDismissed(P){P?t.set(f,P):t.remove(f)},loadSidebarCollapsed(){let P=t.get(m);return P==="1"?!0:P==="0"?!1:null},saveSidebarCollapsed(P){t.set(m,P?"1":"0")},loadActiveModule(){return t.get(C)||null},saveActiveModule(P){t.set(C,P)},loadHistoryCount(){let P=t.get(v);if(!P)return null;let R=Number.parseInt(P,10);return Number.isFinite(R)&&R>=0?R:null},saveHistoryCount(P){t.set(v,String(P))},loadFormsDone(){let P=t.get(b);if(!P)return{};try{let R=JSON.parse(P);return mi(R)?R:{}}catch(R){return gt.warn("loadFormsDone parse failed",{error:R}),{}}},saveFormDone(P){try{let R=y.loadFormsDone();R[P]=Date.now(),t.set(b,JSON.stringify(R))}catch(R){gt.warn("saveFormDone serialise failed",{error:R})}},rememberStorageVersion(P){P&&P!==t.get(a)&&(gt.debug("rememberStorageVersion (force-reset on next load)",{version:P}),t.set(a,P))},clearConversation(){t.remove(d)}};return y}function mi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var fi=`:host{--__P__-accent-user: __BRAND_ACCENT__;--__P__-accent: var(--__P__-accent-user);--__P__-accent-text-user: __BRAND_ACCENT_TEXT__;--__P__-accent-text: var(--__P__-accent-text-user);--__P__-radius: __BRAND_RADIUS__;--__P__-radius-sm: 8px;--__P__-radius-md: 10px;--__P__-radius-lg: 16px;--__P__-font: __BRAND_FONT__;--__P__-font-display: var(--__P__-font);--__P__-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;--__P__-bg: oklch(1 0 0);--__P__-bg-elevated: oklch(.9789 .0029 278.3);--__P__-surface: var(--__P__-bg-elevated);--__P__-muted: var(--__P__-fg-muted);--__P__-hover: oklch(.1686 .011 278.3 / .06);--__P__-fg: oklch(.1686 .011 278.3);--__P__-fg-muted: oklch(.4932 .0301 278.3);--__P__-border: oklch(.9312 .0084 278.3);--__P__-border-strong: oklch(.8757 .0131 278.3);--__P__-bubble-user: var(--__P__-accent);--__P__-bubble-user-text: var(--__P__-accent-text);--__P__-bubble-assistant: oklch(.9638 .0058 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-on-accent: var(--__P__-accent-text);--__P__-success: oklch(.6456 .1654 151.53);--__P__-warning: oklch(.7135 .1494 74.05);--__P__-danger: oklch(.5966 .1818 24.51);--__P__-danger-text: oklch(.5054 .1905 27.52);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .1);--__P__-neutral: oklch(.7137 .0192 278.3);--__P__-focus: var(--__P__-accent);--__P__-shadow-panel: 0 8px 24px -8px rgba(13, 15, 20, .18), 0 24px 64px -24px rgba(13, 15, 20, .24);--__P__-shadow-card: 0 1px 2px rgba(13, 15, 20, .06), 0 4px 12px -6px rgba(13, 15, 20, .12);--__P__-backdrop: oklch(.1686 .011 278.3 / .55);--__P__-shadow-fab: 0 6px 16px -4px color-mix(in oklch, var(--__P__-accent) 45%, transparent), 0 12px 32px -12px rgba(13, 15, 20, .25);--__P__-z-fab: 2147483600;--__P__-z-panel: 2147483601;--__P__-panel-w: 380px;--__P__-panel-h: 600px;--__P__-fab-size: 56px;--__P__-conversation-max: 768px;--__P__-space-1: 4px;--__P__-space-2: 8px;--__P__-space-3: 12px;--__P__-space-4: 16px;--__P__-space-5: 20px;--__P__-space-6: 24px;--__P__-space-8: 32px;--__P__-text-scale: 1;--__P__-text-xs: calc(12px * var(--__P__-text-scale));--__P__-text-sm: calc(13px * var(--__P__-text-scale));--__P__-text-base: calc(15px * var(--__P__-text-scale));--__P__-text-md: calc(16px * var(--__P__-text-scale));--__P__-text-lg: calc(18px * var(--__P__-text-scale));--__P__-text-xl: calc(22px * var(--__P__-text-scale));--__P__-text-2xl: calc(30px * var(--__P__-text-scale))}:host([data-text-size="small"]){--__P__-text-scale: .9}:host([data-text-size="large"]){--__P__-text-scale: 1.15}:host{--__P__-ease: cubic-bezier(.2, .7, .2, 1);--__P__-ease-out: cubic-bezier(.2, .7, .2, 1);--__P__-ease-in: cubic-bezier(.4, 0, 1, 1);--__P__-ease-in-out: cubic-bezier(.65, 0, .35, 1);--__P__-dur-quick: .12s;--__P__-dur-base: .22s;--__P__-dur-slow: .32s;font-family:var(--__P__-font);color:var(--__P__-fg);color-scheme:light;--__P__-color-scheme: light}:host([data-theme="dark"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-danger-text: oklch(.8077 .1035 19.57);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .18);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);--__P__-shadow-card: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px -6px rgba(0, 0, 0, .5);--__P__-backdrop: rgba(0, 0, 0, .65);color-scheme:dark;--__P__-color-scheme: dark}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);color-scheme:dark;--__P__-color-scheme: dark}}@supports (color: oklch(from red l c h)){:host{--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.3, l, .62) c h);--__P__-accent-text: oklch(from var(--__P__-accent) clamp(0, (l / .623 - 1) * -infinity, 1) 0 h)}:host([data-theme="dark"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h)}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h)}}}@media(prefers-reduced-motion:reduce){:host{--__P__-dur-quick: 1ms;--__P__-dur-base: 1ms;--__P__-dur-slow: 1ms}}
|
|
2
|
+
`;var gi=`*,*:before,*:after{box-sizing:border-box;margin:0;padding:0;border:0}button{font:inherit;color:inherit;background:none;cursor:pointer;-webkit-appearance:none;appearance:none;line-height:1}button:focus-visible,[tabindex]:focus-visible,textarea:focus-visible,input:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}textarea,input{font:inherit;color:inherit;background:none;border:0;outline:0;resize:none}a{color:var(--__P__-accent);text-decoration:underline;text-underline-offset:2px}img,svg{display:block;max-width:100%}ul,ol{list-style:none}.__P__-app{display:block;width:100%;height:100%;font-family:var(--__P__-font);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:"cv11","ss01","ss03"}.__P__-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
|
|
3
|
+
`;var hi=`.__P__-anchor{color-scheme:var(--__P__-color-scheme, light);right:16px;bottom:16px}.__P__-surface{display:contents}.__P__-surface[hidden]{display:none}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:calc(14px * var(--__P__-text-scale))}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:calc(14px * var(--__P__-text-scale));background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:color-mix(in srgb,currentColor 15%,transparent)}.__P__-callout-close:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}@media(prefers-reduced-motion:no-preference){.__P__-panel{transition:width var(--__P__-dur-base) var(--__P__-ease),height var(--__P__-dur-base) var(--__P__-ease),max-width var(--__P__-dur-base) var(--__P__-ease),max-height var(--__P__-dur-base) var(--__P__-ease)}.__P__-panel[data-resizing]{transition:none}}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;padding:0;justify-content:flex-end;align-items:flex-end}:host([data-mode="fullscreen"][data-position*="top"]) .__P__-anchor{justify-content:flex-start}:host([data-mode="fullscreen"][data-position*="left"]) .__P__-anchor{align-items:flex-start}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}@media(max-width:640px){:host([data-mode="open"]) .__P__-anchor,:host([data-mode="expanded"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="open"]) .__P__-panel,:host([data-mode="expanded"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-inline-start:auto;display:flex;align-items:center;gap:var(--__P__-space-1);flex-shrink:0}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list,.__P__-history,.__P__-module-scroll,.__P__-home-scroll,.__P__-help-list,.__P__-toolui-code,.__P__-sidebar-conversations{scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;overscroll-behavior:contain;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar,.__P__-history::-webkit-scrollbar,.__P__-module-scroll::-webkit-scrollbar,.__P__-home-scroll::-webkit-scrollbar,.__P__-help-list::-webkit-scrollbar,.__P__-toolui-code::-webkit-scrollbar,.__P__-sidebar-conversations::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb,.__P__-history::-webkit-scrollbar-thumb,.__P__-module-scroll::-webkit-scrollbar-thumb,.__P__-home-scroll::-webkit-scrollbar-thumb,.__P__-help-list::-webkit-scrollbar-thumb,.__P__-toolui-code::-webkit-scrollbar-thumb,.__P__-sidebar-conversations::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-list-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;inset-inline-end:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px}.__P__-list>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-date-divider{display:flex;justify-content:center;margin-block:var(--__P__-space-3)}.__P__-date-pill{padding:3px 10px;border-radius:999px;font-size:calc(11px * var(--__P__-text-scale));font-weight:600;color:var(--__P__-fg-muted);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);box-shadow:var(--__P__-shadow-card)}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:100%;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:calc(14px * var(--__P__-text-scale));word-wrap:break-word;overflow-wrap:break-word;box-shadow:0 1px 2px #0000000a,0 1px 8px -4px #0000000f;animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-bubble ::selection{background:color-mix(in srgb,var(--__P__-accent) 30%,transparent)}.__P__-bubble-row[data-role=user] .__P__-bubble ::selection{background:#fff6;color:var(--__P__-bubble-user-text)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-end-end-radius:5px}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-end-start-radius:5px}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui){width:100%}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui) .__P__-bubble{width:100%}@media(max-width:640px){.__P__-bubble-col{max-width:92%}.__P__-toolui:not(.__P__-toolui-collapsible){padding:var(--__P__-space-3);gap:var(--__P__-space-2)}details.__P__-toolui-collapsible>summary{padding:var(--__P__-space-2) var(--__P__-space-3)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-3)}.__P__-toolui-section,.__P__-toolui-desc{padding:var(--__P__-space-2) var(--__P__-space-3)}}.__P__-bubble-time{margin-top:3px;padding:0 4px;font-size:calc(11px * var(--__P__-text-scale));line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-inline-start:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-inline-start:2px}.__P__-md li::marker{color:var(--__P__-fg-muted)}.__P__-md li>p{margin:6px 0}.__P__-md li>ul,.__P__-md li>ol{margin:6px 0}.__P__-md strong,.__P__-md b{font-weight:650;letter-spacing:-.005em}.__P__-md em,.__P__-md i{font-style:italic}.__P__-md code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:calc(12.5px * var(--__P__-text-scale));padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-inline-start:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-start-end-radius:var(--__P__-radius-sm);border-end-end-radius:var(--__P__-radius-sm);color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:start}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:5px;height:5px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-inline-start:var(--__P__-space-3);border-inline-start:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary:hover{color:var(--__P__-fg)}.__P__-reasoning-summary:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-inline-end:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-source{display:inline-flex;align-items:center;gap:6px;max-width:100%;margin-top:6px;margin-inline-end:6px;padding:var(--__P__-space-1) var(--__P__-space-2);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);text-decoration:none}a.__P__-source:hover{color:var(--__P__-fg);border-color:var(--__P__-accent)}.__P__-source-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:calc(14px * var(--__P__-text-scale));line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-sm);background:color-mix(in oklab,var(--__P__-danger) 8%,var(--__P__-bg-elevated));border:1px solid color-mix(in oklab,var(--__P__-danger) 20%,transparent);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error span{min-width:0}.__P__-error button{margin-inline-start:auto;flex-shrink:0;border:0;background:none;padding:0;color:var(--__P__-accent);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;text-decoration:underline;white-space:nowrap;cursor:pointer}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-3)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:14px 4px 8px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-card{display:flex;flex-direction:column;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);overflow:hidden}.__P__-history-item{all:unset;display:flex;align-items:center;gap:var(--__P__-space-3);padding:12px var(--__P__-space-3);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item+.__P__-history-item{border-top:1px solid var(--__P__-border)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-avatar{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent)}.__P__-history-avatar svg{width:18px;height:18px}.__P__-history-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.__P__-history-row{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2)}.__P__-history-title{flex:1;min-width:0;font-size:calc(14px * var(--__P__-text-scale));font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-time{flex:none;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-history-preview{flex:1;min-width:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-history-item[data-unread=true] .__P__-history-title{font-weight:600}.__P__-history-item[data-closed=true] .__P__-history-title{color:var(--__P__-fg-muted)}.__P__-history-item-skeleton{cursor:default;pointer-events:none}.__P__-skeleton{display:block;border-radius:4px;background:linear-gradient(90deg,color-mix(in oklab,var(--__P__-fg) 9%,transparent) 30%,color-mix(in oklab,var(--__P__-fg) 17%,transparent),color-mix(in oklab,var(--__P__-fg) 9%,transparent) 70%);background-size:200% 100%;animation:__P__-skeleton-shimmer 1.8s ease-in-out infinite}.__P__-history-avatar.__P__-skeleton{border-radius:50%}.__P__-skeleton-heading{width:52px;height:8px}.__P__-skeleton-title{width:55%;height:12px}.__P__-skeleton-time{width:34px;height:10px}.__P__-skeleton-preview{width:80%;height:10px}@keyframes __P__-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.__P__-skeleton{animation:none}}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:calc(11px * var(--__P__-text-scale));line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:calc(11px * var(--__P__-text-scale));letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;inset-inline-end:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent)}.__P__-menu-check svg{width:14px;height:14px}.__P__-menu-item-segmented{cursor:default}.__P__-menu-item-segmented:hover{background:transparent}.__P__-segmented{display:inline-flex;gap:2px;padding:2px;background:var(--__P__-bg-elevated);border-radius:var(--__P__-radius-sm)}.__P__-segment{all:unset;min-width:26px;padding:3px 8px;font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.02em;text-align:center;color:var(--__P__-fg-muted);border-radius:calc(var(--__P__-radius-sm) - 2px);cursor:pointer;transition:color .12s ease,background .12s ease}.__P__-segment:hover{color:var(--__P__-fg)}.__P__-segment[data-on=true]{background:var(--__P__-bg);color:var(--__P__-accent);box-shadow:var(--__P__-shadow-card)}.__P__-segment:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body,.__P__-messenger-pane{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-pane[hidden]{display:none}@keyframes __P__-view-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}@media(prefers-reduced-motion:no-preference){.__P__-module,.__P__-history{animation:__P__-view-in .18s var(--__P__-ease-out)}}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{container-type:inline-size;background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-4px;left:calc(50% + 6px);min-width:16px;height:16px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:var(--__P__-accent);color:var(--__P__-on-accent);font-size:calc(10px * var(--__P__-text-scale));font-weight:600;line-height:1}.__P__-home-hero{flex-shrink:0;padding:var(--__P__-space-5) var(--__P__-space-5) var(--__P__-space-3);color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-home-hero-top{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);min-height:32px}.__P__-home-brand{font-size:clamp(calc(12px * var(--__P__-text-scale)),calc(3.2cqi * var(--__P__-text-scale)),calc(14px * var(--__P__-text-scale)));font-weight:600;letter-spacing:.01em;color:color-mix(in srgb,#fff 82%,transparent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.__P__-home-brand-spacer{flex:1}.__P__-home-hero-actions{display:flex;align-items:center;gap:var(--__P__-space-2);flex-shrink:0}.__P__-home-hero-actions .__P__-icon-btn{color:#fff}.__P__-home-hero-actions .__P__-icon-btn:hover{background:color-mix(in srgb,#fff 18%,transparent);color:#fff}.__P__-home-hero-actions .__P__-icon-btn:active{background:color-mix(in srgb,#fff 26%,transparent)}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(19px * var(--__P__-text-scale)),calc(5.5cqi * var(--__P__-text-scale)),var(--__P__-text-2xl));font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:10px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(15px * var(--__P__-text-scale)),calc(4.2cqi * var(--__P__-text-scale)),var(--__P__-text-xl));font-weight:600;line-height:1.25;letter-spacing:-.005em;color:color-mix(in srgb,var(--__P__-on-accent) 78%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-inline-start:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-inline-start:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:start;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:start}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:calc(14px * var(--__P__-text-scale));color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:start;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-hover)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:start;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;inset-inline-end:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-form{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-field{display:flex;flex-direction:column;gap:6px}.__P__-field-label{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-field-req{color:var(--__P__-danger)}.__P__-field-input{width:100%;min-width:0;max-width:100%;box-sizing:border-box;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);resize:vertical;transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-field-input:focus-visible{outline:none;border-color:var(--__P__-accent)}.__P__-field[data-invalid=true] .__P__-field-input{border-color:var(--__P__-danger)}.__P__-field-input[type=date],.__P__-field-input[type=time]{appearance:none;-webkit-appearance:none}@media(pointer:coarse){.__P__-field-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}}.__P__-field-hint{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-field-error{font-size:var(--__P__-text-xs);color:var(--__P__-danger)}.__P__-field-choices{display:flex;flex-direction:column;gap:10px;padding-top:2px}.__P__-choice{display:flex;align-items:flex-start;gap:10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);cursor:pointer}.__P__-choice input{margin-top:2px;accent-color:var(--__P__-accent)}.__P__-form-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}.__P__-form-hint{flex:1 1 auto;min-width:6rem;margin-inline-end:auto;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-form-submit{padding:var(--__P__-space-2) var(--__P__-space-4);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-submit:hover:not(:disabled){filter:brightness(1.06)}.__P__-form-submit:disabled{opacity:.6;cursor:default}.__P__-form-skip{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:transparent;color:var(--__P__-fg-muted);font:inherit;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-skip:hover:not(:disabled){background:var(--__P__-bg-elevated)}@media(max-width:640px){.__P__-form-hint{flex-basis:100%;margin-inline-end:0;font-size:var(--__P__-text-xs)}.__P__-form-submit,.__P__-form-skip{flex:1 1 0;text-align:center}}.__P__-form-gate{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-form-gate-title{margin:0;font-size:var(--__P__-text-base);font-weight:700;color:var(--__P__-fg)}.__P__-form-gate-desc{margin:0 0 var(--__P__-space-1);font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-form-done{display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border:1px dashed var(--__P__-border);border-radius:999px;align-self:center;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted)}.__P__-form-done svg{width:14px;height:14px;color:var(--__P__-success, #22c55e)}.__P__-form-done[data-outcome=skipped] svg{color:var(--__P__-fg-muted)}.__P__-form-done-fill{border:0;background:none;padding:0 2px;cursor:pointer;font:inherit;font-weight:600;color:var(--__P__-accent)}.__P__-form-done-fill:hover{text-decoration:underline}details.__P__-form-done{display:block;padding:0;border-radius:var(--__P__-radius-md)}details[open].__P__-form-done{width:min(100%,420px);background:var(--__P__-surface)}.__P__-form-done-summary{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;cursor:pointer;list-style:none}.__P__-form-done-summary::-webkit-details-marker{display:none}.__P__-form-done-summary>svg:last-child{color:var(--__P__-fg-muted);transition:transform .15s var(--__P__-ease)}details[open]>.__P__-form-done-summary>svg:last-child{transform:rotate(90deg)}.__P__-form-answers{margin:0;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);display:grid;gap:var(--__P__-space-3);text-align:start}.__P__-form-answer{display:grid;gap:6px}.__P__-form-answer dt{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-form-answer dd{margin:0;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);font-size:var(--__P__-text-sm);font-weight:400;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui{margin-block:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);background:var(--__P__-bg-elevated);font-size:var(--__P__-text-sm)}.__P__-toolui:not(.__P__-toolui-collapsible){display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-group{display:flex;flex-direction:column;gap:var(--__P__-space-3);margin-block:var(--__P__-space-3)}.__P__-toolui-group>.__P__-toolui{margin-block:0}.__P__-toolui-stale{opacity:.7}details.__P__-toolui-collapsible>summary{display:flex;align-items:center;gap:var(--__P__-space-2);padding:var(--__P__-space-3) var(--__P__-space-4);cursor:pointer;list-style:none}details.__P__-toolui-collapsible>summary::-webkit-details-marker{display:none}details.__P__-toolui-collapsible[open]>summary{border-bottom:1px solid var(--__P__-border)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-4)}details.__P__-toolui-collapsible>.__P__-toolui-section~.__P__-toolui-section{margin-top:calc(-1 * var(--__P__-space-2))}.__P__-toolui-wrench{display:inline-flex;color:var(--__P__-fg-muted)}.__P__-toolui-wrench svg{width:15px;height:15px}.__P__-toolui-title{font-weight:600;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui-chevron{display:inline-flex;margin-inline-start:auto;color:var(--__P__-fg-muted);transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-toolui-chevron svg{width:16px;height:16px}details.__P__-toolui-collapsible[open]>summary .__P__-toolui-chevron{transform:rotate(180deg)}.__P__-toolui-badge{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:999px;border:1px solid var(--__P__-border-strong);background:var(--__P__-bg);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;white-space:nowrap}.__P__-toolui-badge-accent{border-color:color-mix(in oklab,var(--__P__-warning, #f59e0b) 55%,transparent);background:color-mix(in oklab,var(--__P__-warning, #f59e0b) 12%,transparent);color:var(--__P__-warning, #f59e0b)}.__P__-toolui-badge-muted{border-color:color-mix(in oklab,var(--__P__-fg-muted) 50%,transparent);background:color-mix(in oklab,var(--__P__-fg-muted) 14%,transparent);color:var(--__P__-fg)}.__P__-toolui-status-icon{display:inline-flex}.__P__-toolui-status-icon svg{width:14px;height:14px}.__P__-toolui-status[data-status=awaiting] .__P__-toolui-status-icon{color:var(--__P__-warning, #f59e0b)}.__P__-toolui-status[data-status=responded] .__P__-toolui-status-icon{color:var(--__P__-accent)}.__P__-toolui-status[data-status=completed] .__P__-toolui-status-icon{color:var(--__P__-success, #16a34a)}.__P__-toolui-status[data-status=denied] .__P__-toolui-status-icon{color:#ea580c}.__P__-toolui-status[data-status=error] .__P__-toolui-status-icon{color:var(--__P__-danger, #dc2626)}.__P__-toolui-head{display:flex;align-items:center;flex-wrap:wrap;gap:var(--__P__-space-2)}.__P__-toolui-desc{margin:0;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-section{display:flex;flex-direction:column;gap:8px;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border)}.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-section,.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-desc{padding:0;background:none;border:0;border-radius:0}.__P__-toolui-label{font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--__P__-fg-muted)}.__P__-toolui-text{margin:0;font-size:var(--__P__-text-base);font-weight:600;color:var(--__P__-fg);line-height:1.55;overflow-wrap:anywhere}.__P__-toolui-code{margin:0;max-height:240px;overflow:auto;color:var(--__P__-fg);font-family:var(--__P__-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:var(--__P__-text-xs);line-height:1.5;white-space:pre-wrap;word-break:break-word}.__P__-toolui-code[data-error=true]{color:var(--__P__-danger, #dc2626)}.__P__-toolui-body{gap:6px}.__P__-toolui-prompt{margin:0;font-weight:600;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui-subtle{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}:host([dir="rtl"]) .__P__-icon-dir{transform:scaleX(-1)}:host([dir="rtl"]) .__P__-field-input[type=date],:host([dir="rtl"]) .__P__-field-input[type=time]{position:relative;text-align:right;padding-left:34px}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-datetime-edit,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-datetime-edit{text-align:right}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-calendar-picker-indicator,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-calendar-picker-indicator{position:absolute;left:var(--__P__-space-3);margin:0}
|
|
4
|
+
`;var vi=`.__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}
|
|
5
|
+
`;var bi=`:host([data-mode="page"]){min-height:0}:host([data-mode="page"]) .__P__-page-shell{display:grid;grid-template-columns:280px 1fr;width:100%;height:100%;min-height:0;background:var(--__P__-bg);color:var(--__P__-fg);transition:grid-template-columns var(--__P__-dur-base) var(--__P__-ease-in-out)}:host([data-mode="page"]) .__P__-page-shell[data-sidebar-collapsed=true]{grid-template-columns:48px 1fr}:host([data-mode="page"]) .__P__-page-chat{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}:host([data-mode="page"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-width:0;min-height:0;flex:1 1 0}:host([data-mode="page"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;border-radius:0;border:0;box-shadow:none;animation:none}:host([data-mode="page"]) .__P__-sidebar{border-inline-end:1px solid var(--__P__-border);display:flex;flex-direction:column;overflow:hidden;background:var(--__P__-surface)}:host([data-mode="page"]) .__P__-sidebar-header{padding:var(--__P__-space-4) var(--__P__-space-5);border-bottom:1px solid var(--__P__-border);display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2);min-height:56px;box-sizing:border-box}:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-header{padding:var(--__P__-space-4) var(--__P__-space-2);justify-content:center}:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-logo,:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-title{display:none}:host([data-mode="page"]) .__P__-sidebar-toggle{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid var(--__P__-border);border-radius:6px;background:transparent;color:var(--__P__-fg);cursor:pointer;transition:background .12s,border-color .12s}:host([data-mode="page"]) .__P__-sidebar-toggle:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}:host([data-mode="page"]) .__P__-sidebar-toggle:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}:host([data-mode="page"]) .__P__-sidebar-logo{height:32px;display:block}:host([data-mode="page"]) .__P__-sidebar-title{font-size:var(--__P__-text-md);font-weight:600}:host([data-mode="page"]) .__P__-sidebar-section{padding:var(--__P__-space-3) var(--__P__-space-4);border-bottom:1px solid var(--__P__-border)}:host([data-mode="page"]) .__P__-sidebar-nav{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}:host([data-mode="page"]) .__P__-sidebar-nav-item{display:flex;align-items:center;gap:10px;padding:var(--__P__-space-2) var(--__P__-space-3);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);text-decoration:none;font-size:calc(14px * var(--__P__-text-scale));transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}:host([data-mode="page"]) .__P__-sidebar-nav-item:hover{background:var(--__P__-hover)}:host([data-mode="page"]) .__P__-sidebar-nav-item:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}:host([data-mode="page"]) .__P__-sidebar-cards{display:grid;grid-template-columns:1fr;gap:var(--__P__-space-2)}:host([data-mode="page"]) .__P__-sidebar-card{display:block;padding:10px 12px;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm);text-decoration:none;color:var(--__P__-fg);transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}:host([data-mode="page"]) .__P__-sidebar-card:hover{border-color:var(--__P__-accent)}:host([data-mode="page"]) .__P__-sidebar-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}:host([data-mode="page"]) .__P__-sidebar-card-label{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}:host([data-mode="page"]) .__P__-sidebar-card-desc{font-size:var(--__P__-text-xs);color:var(--__P__-muted);margin-top:2px}:host([data-mode="page"]) .__P__-sidebar-conversations{flex:1 1 auto;overflow-y:auto;padding:var(--__P__-space-3) var(--__P__-space-4)}:host([data-mode="page"]) .__P__-page-chat{display:flex;flex-direction:column;overflow:hidden}@media(max-width:768px){:host([data-mode="page"]) .__P__-page-shell{grid-template-columns:1fr}:host([data-mode="page"]) .__P__-sidebar{display:none}}
|
|
6
|
+
`;var Nd="helpai",Dd="#5B5BD6",Od="#FFFFFF",$d="12px",Bd="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",ko=[fi,gi,hi,vi,bi].join(`
|
|
7
|
+
`).replace(/__P__/g,Nd).replaceAll("__BRAND_ACCENT_TEXT__",Od).replaceAll("__BRAND_ACCENT__",Dd).replaceAll("__BRAND_RADIUS__",$d).replaceAll("__BRAND_FONT__",Bd);var Hd=J.scope("mount"),Pi=new WeakMap,xi={floating:"all: initial; position: fixed; z-index: 2147483600;",flow:"all: initial; display: block; position: relative; width: 100%; height: 100%; z-index: 1; contain: size;",viewport:"all: initial; display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;"};function yi(e,t){e.style.cssText=xi[t]}function Kn(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function Si(e={}){let t=e.position??"flow";Hd.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${x.cssPrefix}-chat-host`;typeof customElements<"u"&&!customElements.get(n)&&customElements.define(n,class extends HTMLElement{});let r;e.existingHost?r=e.existingHost:(r=document.createElement(n),(e.target??document.body).appendChild(r)),r.setAttribute("data-brand",x.id),r.style.cssText=xi[t];let a=r.shadowRoot??r.attachShadow({mode:"open"}),i=r.ownerDocument;if(!zd(a,i)){let s=i.createElement("style");s.textContent=ko,a.appendChild(s)}let l=document.createElement("div");return l.className=`${x.cssPrefix}-app`,a.appendChild(l),{appRoot:l,destroy:()=>r.remove(),hostElement:r,shadowRoot:a}}function zd(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let r=Pi.get(t);if(!r)try{r=new n.CSSStyleSheet,r.replaceSync(ko),Pi.set(t,r)}catch{return!1}try{return e.adoptedStyleSheets=[r],!0}catch{return!1}}function Fd(e,t){let n=x.cssPrefix;t.accent&&e.style.setProperty(`--${n}-accent-user`,t.accent),t.accentText&&e.style.setProperty(`--${n}-accent-text-user`,t.accentText),t.radius&&e.style.setProperty(`--${n}-radius`,t.radius),t.fontFamily&&e.style.setProperty(`--${n}-font`,t.fontFamily)}function Ud(e,t){e.dataset.theme=t}function qd(e,t){let n=x.cssPrefix;t.width!==void 0&&e.style.setProperty(`--${n}-panel-w`,t.width),t.height!==void 0&&e.style.setProperty(`--${n}-panel-h`,t.height),t.expanded?.width!==void 0&&e.style.setProperty(`--${n}-expanded-w`,t.expanded.width),t.expanded?.height!==void 0&&e.style.setProperty(`--${n}-expanded-h`,t.expanded.height),t.inset!==void 0&&e.style.setProperty(`--${n}-panel-inset`,t.inset)}function Wd(e,t){e.dataset.position=t}function jn(e,t){e.dataset.mode=t}function wi(e,t){Ud(e,t.themeMode),Fd(e,t.themeOverrides),Wd(e,t.position),qd(e,t.size)}var Lt,pe,Co,ki,en=0,Mi=[],fe=Z,Ci=fe.__b,Ti=fe.__r,Ei=fe.diffed,Ri=fe.__c,Ai=fe.unmount,Ii=fe.__;function Yn(e,t){fe.__h&&fe.__h(pe,e,en||t),en=0;var n=pe.__H||(pe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function A(e){return en=1,Gd(Ni,e)}function Gd(e,t,n){var r=Yn(Lt++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ni(void 0,t),function(s){var c=r.__N?r.__N[0]:r.__[0],d=r.t(c,s);c!==d&&(r.__N=[d,r.__[1]],r.__c.setState({}))}],r.__c=pe,!pe.__f)){var a=function(s,c,d){if(!r.__c.__H)return!0;var u=r.__c.__H.__.filter(function(g){return g.__c});if(u.every(function(g){return!g.__N}))return!i||i.call(this,s,c,d);var _=r.__c.props!==s;return u.some(function(g){if(g.__N){var f=g.__[0];g.__=g.__N,g.__N=void 0,f!==g.__[0]&&(_=!0)}}),i&&i.call(this,s,c,d)||_};pe.__f=!0;var i=pe.shouldComponentUpdate,l=pe.componentWillUpdate;pe.componentWillUpdate=function(s,c,d){if(this.__e){var u=i;i=void 0,a(s,c,d),i=u}l&&l.call(this,s,c,d)},pe.shouldComponentUpdate=a}return r.__N||r.__}function E(e,t){var n=Yn(Lt++,3);!fe.__s&&Eo(n.__H,t)&&(n.__=e,n.u=t,pe.__H.__h.push(n))}function ht(e,t){var n=Yn(Lt++,4);!fe.__s&&Eo(n.__H,t)&&(n.__=e,n.u=t,pe.__h.push(n))}function D(e){return en=5,Re(function(){return{current:e}},[])}function Re(e,t){var n=Yn(Lt++,7);return Eo(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function O(e,t){return en=8,Re(function(){return e},t)}function Vd(){for(var e;e=Mi.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Xn),t.__h.some(To),t.__h=[]}catch(n){t.__h=[],fe.__e(n,e.__v)}}}fe.__b=function(e){pe=null,Ci&&Ci(e)},fe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ii&&Ii(e,t)},fe.__r=function(e){Ti&&Ti(e),Lt=0;var t=(pe=e.__c).__H;t&&(Co===pe?(t.__h=[],pe.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(Xn),t.__h.some(To),t.__h=[],Lt=0)),Co=pe},fe.diffed=function(e){Ei&&Ei(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Mi.push(t)!==1&&ki===fe.requestAnimationFrame||((ki=fe.requestAnimationFrame)||Kd)(Vd)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Co=pe=null},fe.__c=function(e,t){t.some(function(n){try{n.__h.some(Xn),n.__h=n.__h.filter(function(r){return!r.__||To(r)})}catch(r){t.some(function(a){a.__h&&(a.__h=[])}),t=[],fe.__e(r,n.__v)}}),Ri&&Ri(e,t)},fe.unmount=function(e){Ai&&Ai(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{Xn(r)}catch(a){t=a}}),n.__H=void 0,t&&fe.__e(t,n.__v))};var Li=typeof requestAnimationFrame=="function";function Kd(e){var t,n=function(){clearTimeout(r),Li&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Li&&(t=requestAnimationFrame(n))}function Xn(e){var t=pe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),pe=t}function To(e){var t=pe;e.__c=e.__(),pe=t}function Eo(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Ni(e,t){return typeof t=="function"?t(e):t}var jd=Symbol.for("preact-signals");function er(){if(tt>1)tt--;else{var e,t=!1;for((function(){var a=Qn;for(Qn=void 0;a!==void 0;)a.S.v===a.v&&(a.S.i=a.i),a=a.o})();tn!==void 0;){var n=tn;for(tn=void 0,Jn++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&$i(n))try{n.c()}catch(a){t||(e=a,t=!0)}n=r}}if(Jn=0,tt--,t)throw e}}function Mt(e){if(tt>0)return e();Ro=++Xd,tt++;try{return e()}finally{er()}}var le=void 0;function nn(e){var t=le;le=void 0;try{return e()}finally{le=t}}var Di,tn=void 0,tt=0,Jn=0,Xd=0,Ro=0,Qn=void 0,Zn=0;function Oi(e){if(le!==void 0){var t=e.n;if(t===void 0||t.t!==le)return t={i:0,S:e,p:le.s,n:void 0,t:le,e:void 0,x:void 0,r:t},le.s!==void 0&&(le.s.n=t),le.s=t,e.n=t,32&le.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=le.s,t.n=void 0,le.s.n=t,le.s=t),t}}function ve(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}ve.prototype.brand=jd;ve.prototype.h=function(){return!0};ve.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:nn(function(){var r;(r=t.W)==null||r.call(t)}))};ve.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&nn(function(){var a;(a=t.Z)==null||a.call(t)}))}};ve.prototype.subscribe=function(e){var t=this;return nt(function(){var n=t.value;nn(function(){return e(n)})},{name:"sub"})};ve.prototype.valueOf=function(){return this.value};ve.prototype.toString=function(){return this.value+""};ve.prototype.toJSON=function(){return this.value};ve.prototype.peek=function(){var e=this;return nn(function(){return e.value})};Object.defineProperty(ve.prototype,"value",{get:function(){var e=Oi(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Jn>100)throw new Error("Cycle detected");(function(n){tt!==0&&Jn===0&&n.l!==Ro&&(n.l=Ro,Qn={S:n,v:n.v,i:n.i,o:Qn})})(this),this.v=e,this.i++,Zn++,tt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{er()}}}});function B(e,t){return new ve(e,t)}function $i(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 Bi(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 Hi(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 vt(e,t){ve.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Zn-1,this.f=4}vt.prototype=new ve;vt.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Zn))return!0;if(this.g=Zn,this.f|=1,this.i>0&&!$i(this))return this.f&=-2,!0;var e=le;try{Bi(this),le=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 le=e,Hi(this),this.f&=-2,!0};vt.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)}ve.prototype.S.call(this,e)};vt.prototype.U=function(e){if(this.t!==void 0&&(ve.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)}};vt.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(vt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Oi(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function rn(e,t){return new vt(e,t)}function zi(e){var t=e.m;if(e.m=void 0,typeof t=="function"){tt++;var n=le;le=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,Ao(e),r}finally{le=n,er()}}}function Ao(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,zi(e)}function Yd(e){if(le!==this)throw new Error("Out-of-order effect");Hi(this),le=e,this.f&=-2,8&this.f&&Ao(this),er()}function Nt(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Di&&Di.push(this)}Nt.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};Nt.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,zi(this),Bi(this),tt++;var e=le;return le=this,Yd.bind(this,e)};Nt.prototype.N=function(){2&this.f||(this.f|=2,this.u=tn,tn=this)};Nt.prototype.d=function(){this.f|=8,1&this.f||Ao(this)};Nt.prototype.dispose=function(){this.d()};function nt(e,t){var n=new Nt(e,t);try{n.c()}catch(a){throw n.d(),a}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var Fi,rr,tr,Jd=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var Ui=[];nt(function(){Fi=this.N})();function Dt(e,t){Z[e]=t.bind(null,Z[e]||function(){})}function nr(e){if(tr){var t=tr;tr=void 0,t()}tr=e&&e.S()}function qi(e){var t=this,n=e.data,r=on(n);r.value=n;var a=Re(function(){for(var s=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var d=rn(function(){var f=r.value.value;return f===0?0:f===!0?"":f||""}),u=rn(function(){return!Array.isArray(d.value)&&!lo(d.value)}),_=nt(function(){if(this.N=Wi,u.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),g=t.__$u.d;return t.__$u.d=function(){_(),g.call(this)},[u,d]},[]),i=a[0],l=a[1];return i.value?l.peek():l.value}qi.displayName="ReactiveTextNode";Object.defineProperties(ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:qi},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Dt("__b",function(e,t){if(typeof t.type=="string"){var n,r=t.props;for(var a in r)if(a!=="children"){var i=r[a];i instanceof ve&&(n||(t.__np=n={}),n[a]=i,r[a]=i.peek())}}e(t)});Dt("__r",function(e,t){if(e(t),t.type!==te){nr();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=(function(a,i){var l;return nt(function(){l=this},{name:i}),l.c=a,l})(function(){var a;Jd&&((a=n.y)==null||a.call(n)),r.__$f|=1,r.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),rr=r,nr(n)}});Dt("__e",function(e,t,n,r){nr(),rr=void 0,e(t,n,r)});Dt("diffed",function(e,t){nr(),rr=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var r=t.__np,a=t.props;if(r){var i=n.U;if(i)for(var l in i){var s=i[l];s!==void 0&&!(l in r)&&(s.d(),i[l]=void 0)}else i={},n.U=i;for(var c in r){var d=i[c],u=r[c];d===void 0?(d=Qd(n,c,u,a),i[c]=d):d.o(u,a)}}}e(t)});function Qd(e,t,n,r){var a=t in e&&e.ownerSVGElement===void 0,i=B(n);return{o:function(l,s){i.value=l,r=s},d:nt(function(){this.N=Wi;var l=i.value.value;r[t]!==l&&(r[t]=l,a?e[t]=l:l!=null&&(l!==!1||t[4]==="-")?e.setAttribute(t,l):e.removeAttribute(t))})}}Dt("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 a in r){var i=r[a];i&&i.d()}}}var l=t.__np;if(l){var s=t.props;for(var c in l)s[c]=l[c]}t.__np=void 0}else{var d=t.__c;if(d){var u=d.__$u;u&&(d.__$u=void 0,u.d())}}e(t)});Dt("__h",function(e,t,n,r){(r<3||r===9)&&(t.__$f|=2),e(t,n,r)});lt.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,r=n&&n.s!==void 0;for(var a in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(r||i||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var l in e)if(l!=="__source"&&e[l]!==this.props[l])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function on(e,t){return Re(function(){return B(e,t)},[])}function Y(e,t){var n=D(e);return n.current=e,rr.__$f|=4,Re(function(){return rn(function(){return n.current()},t)},[])}var Zd=function(e){queueMicrotask(function(){queueMicrotask(e)})};function e_(){Mt(function(){for(var e;e=Ui.shift();)Fi.call(e)})}function Wi(){Ui.push(this)===1&&(Z.requestAnimationFrame||Zd)(e_)}function Gi(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Vi(e){return Gi(e)}function Ki(e){return!(!Gi(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function t_(e){return`${x.cssPrefix}:${e}`}function ji(e,t){let r=Object.entries(t).map(([a,i])=>{let l=t_(a),s=c=>i(c.detail);return e.addEventListener(l,s),[l,s]});return()=>{for(let[a,i]of r)e.removeEventListener(a,i)}}function or(e,t,n){return e==="page"?"page":e==="standalone"?"standalone":e==="inline"?t==="fullscreen"?"fullscreen":"inline":e==="modal"||e==="drawer"?n?t==="fullscreen"?"fullscreen":e:"closed":n?t==="fullscreen"?"fullscreen":t==="expanded"?"expanded":"open":"closed"}var n_=900;function Io(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let r=t.initialSize;if(r==="expanded"||r==="fullscreen"||r==="normal")return r;if(r==="auto"){let a=t.autoSizeBreakpoint??n_;return n>=a?"expanded":"normal"}return"normal"}function an(e,t,n,r=null){let i=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),s=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&r?r:Io(e.mode,e.size,t);return{panelOpen:i,panelSize:s}}function Ot(){return typeof window>"u"?0:window.innerWidth}var r_="x-public-key",o_="x-ai-agent-deployment-id";function Xi(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[o_]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??r_]=e.publicKey),t}}}var ar="0.54.1";var qe=class extends Error{constructor(n,r,a,i){super(n);q(this,"code",r);q(this,"status",a);q(this,"cause",i);this.name="StreamError"}};var Yi=J.scope("parser");async function*Lo(e,t){if(!e.ok){let a=await e.text().catch(()=>"");throw new qe(`server responded ${e.status}: ${a.slice(0,200)}`,"server",e.status)}if(!e.body)throw new qe("response has no body","no-body");let n=e.body.pipeThrough(new TextDecoderStream).getReader(),r="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:a,value:i}=await n.read();if(a){let s=r.trim();if(s){let c=Ji(s);c&&(yield c)}return}r+=i;let l;for(;(l=r.indexOf(`
|
|
8
8
|
|
|
9
|
-
`))!==-1;){let s=
|
|
10
|
-
`))if(!(
|
|
11
|
-
${i}`:i;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(!t||t==="[DONE]")return null;try{let o=JSON.parse(t);return Ja.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){return Ja.trace("frame parse failed",{err:o,payload:t.slice(0,200)}),null}}function s_(e){let t=new TextEncoder().encode(e),n="";for(let o of t)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var Za=e=>e&&Object.keys(e).length>0?e:void 0;function es(e,t){let n=Za(e),o=Za(t);if(!n&&!o)return;let i={};return n&&(i.user=n),o&&(i.page=o),s_(JSON.stringify(i))}function so(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function l_(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function ts(e){return e.startsWith("tool-")?e.slice(5):e}var qe={handshake:"/pai/handshake",streamMessage:"/pai/stream-message",streamResume:"/pai/stream-resume",cancelStream:"/pai/cancel-stream",listConversations:"/pai/list-conversations",listMessages:"/pai/list-messages",updateSettings:"/pai/update-settings",markRead:"/pai/mark-read",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},ns="context";function os(e){let t=e.messages.map(a=>({id:a.serverMessageId??a.id,parts:__(a),role:a.role,createdAt:a.createdAt!==void 0?new Date(a.createdAt).toISOString():void 0})),n={messages:t,conversationId:e.conversationId,trigger:e.trigger??"submit-message"},o=t.at(-1)?.id;o&&(n.messageId=o),e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs);let i=e.tools?.map(d_).filter(a=>a!==null);return i?.length&&(n.data={tools:i}),n}function c_(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function d_(e){return typeof e=="string"?e?{code:e}:null:e?.code?e:null}function __(e){let t=[];for(let n of e.parts)if(n.kind==="step-start"&&t.push({type:"step-start"}),n.kind==="reasoning"&&n.text&&t.push({type:"reasoning",text:n.text,state:n.done?"done":"streaming"}),n.kind==="text"&&n.text&&t.push({text:n.text,type:"text"}),n.kind==="file"&&n.url&&t.push({mediaType:n.mediaType,type:"file",url:n.url}),n.kind==="tool"&&c_(n)){let o={type:l_(n.toolName),toolCallId:n.toolCallId,state:n.state};n.input!==void 0&&(o.input=n.input),n.output!==void 0&&(o.output=n.output),n.error!==void 0&&(o.errorText=n.error),n.approval&&n.approval.approved!==void 0&&(o.approval=n.approval),t.push(o)}for(let n of e.attachments??[])n.url&&t.push({type:"file",url:n.url,mediaType:n.mediaType,filename:n.name,fileId:n.id,fileSize:n.size});return t}var Q=Y.scope("transport"),rs=3,ls=400,u_=6e4,is=1e4,as=3,p_=new Set([408,425,429,500,502,503,504]);function ss(e){return ls*2**e+Math.floor(Math.random()*250)}function m_(e){let t=e.get("retry-after");if(!t)return null;let n=Number(t),o=Number.isFinite(n)?n*1e3:Date.parse(t)-Date.now();return Number.isFinite(o)&&o>=0?Math.min(o,3e4):null}function Mr(e,t){return new Promise(n=>{if(t?.aborted)return n();let o=setTimeout(a,e),i=()=>a();t?.addEventListener("abort",i,{once:!0});function a(){clearTimeout(o),t?.removeEventListener("abort",i),n()}})}var lo=class{constructor(t){V(this,"opts",t);V(this,"visitorId");V(this,"conversationId");V(this,"resumeStatus");V(this,"userContext");V(this,"pageContext");V(this,"locale");V(this,"conversationsCache",new Map);V(this,"contentCache",new Map)}setContext(t,n){this.userContext=t,this.pageContext=n}setLocale(t){this.locale=t}primeIdentity(t,n){t&&(this.visitorId=t),n&&(this.conversationId=n)}envelope(){let t={_ev:ao};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=es(this.userContext,this.pageContext);return n&&(t[ns]=n),t}withEnvelope(t){return{...this.envelope(),...t}}appendEnvelope(t){for(let[n,o]of Object.entries(this.envelope()))t.append(n,o);return t}withEnvelopeQuery(t){let n=new URL(this.url(t));for(let[o,i]of Object.entries(this.envelope()))n.searchParams.has(o)||n.searchParams.set(o,i);return n.toString()}async handshake(t){Q.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson(qe.handshake,t,"handshake");return Q.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),g_(n)||Q.warn("handshake response did not match expected shape; using raw response",{response:n}),this.visitorId=n.visitorId??t.visitorId,this.conversationId=n.conversationId,n}async uploadFile(t){Q.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let n=new FormData;n.append("file",t,t.name);let o=await this.postForm(this.uploadPath,n,"upload");return Q.debug("uploadFile \u2190",{id:o.id,url:o.url}),o}async transcribe(t,n="audio/webm"){Q.debug("transcribe \u2192",{size:t.size,mimeType:n});let o=new FormData;o.append("audio",t,`voice.${f_(n)}`),o.append("mimeType",n);let i=await this.postForm(this.transcribePath,o,"transcribe");return Q.debug("transcribe \u2190",{textLen:i.text.length}),i}conversationsKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){let n=this.conversationsCache.get(this.conversationsKey(t));if(n?.value&&Date.now()-n.at<is)return n.value}listConversations(t={}){let n=this.conversationsKey(t),o=this.conversationsCache.get(n);if(o&&Date.now()-o.at<is)return Q.debug("listConversations \u2192 cache",t),o.result;let i={at:Date.now(),result:this.fetchConversations(t).then(a=>(i.value=a,a)).catch(a=>{throw this.conversationsCache.delete(n),a})};return this.conversationsCache.set(n,i),i.result}async fetchConversations(t){let n=new URL(this.url(qe.listConversations));t.visitorId&&n.searchParams.set("visitorId",t.visitorId),t.limit&&n.searchParams.set("limit",String(t.limit)),t.cursor&&n.searchParams.set("cursor",t.cursor),Q.debug("listConversations \u2192",{visitorId:t.visitorId??this.visitorId,limit:t.limit,cursor:t.cursor});let o=await this.getJson(n.toString(),"listConversations"),i=o.conversations??[];return Q.debug("listConversations \u2190",{count:i.length,nextCursor:o.nextCursor}),{conversations:i.map(a=>({conversationId:a.conversationId,title:a.title,lastMessageAt:a.lastMessageAt,preview:a.preview,canContinue:a.canContinue,unreadCount:a.unreadCount})),nextCursor:o.nextCursor}}async loadConversation(t){let n=new URL(this.url(qe.listMessages));n.searchParams.set("conversationId",t),Q.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId});let o=await this.getJson(n.toString(),"loadConversation"),i=o.messages??[];return Q.debug("loadConversation \u2190",{conversationId:o.conversationId,canContinue:o.canContinue,messageCount:i.length,hasSuggestions:!!o.suggestions}),{conversationId:o.conversationId,canContinue:o.canContinue??!0,messages:i,agent:o.agent,suggestions:o.suggestions}}async markRead(t){if(!(!this.visitorId||!t)){this.conversationsCache.clear(),Q.debug("markRead \u2192",{conversationId:t,visitorId:this.visitorId});try{await this.postJson(qe.markRead,{conversationId:t},"markRead")}catch(n){Q.debug("markRead failed (non-fatal)",{err:n})}}}listContent(t={}){let n=`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`,o=this.contentCache.get(n);if(o&&Date.now()-o.at<u_)return Q.debug("listContent \u2192 cache",t),o.result;let i=this.fetchContent(t).catch(a=>{throw this.contentCache.delete(n),a});return this.contentCache.set(n,{at:Date.now(),result:i}),i}async fetchContent(t){let n=new URL(this.dataUrl(qe.content));for(let[a,l]of Object.entries(t))l!==void 0&&n.searchParams.set(a,Array.isArray(l)?l.join(","):String(l));Q.debug("listContent \u2192",t);let o=await this.getJson(n.toString(),"listContent"),i=(o.items??[]).map(a=>Vi(a,this.locale));return Q.debug("listContent \u2190",{count:i.length,total:o.pagination?.total}),{...o,items:i}}async bootstrap(t){let n=new URL(this.dataUrl(qe.bootstrap));t&&n.searchParams.set("conversationId",t),Q.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let o=await this.getJson(n.toString(),"bootstrap"),i=o.forms??[],a=o.formSubmissions??[];return Q.debug("bootstrap \u2190",{forms:i.length,formSubmissions:a.length}),{forms:i,formSubmissions:a}}async saveUserPrefs(t){Q.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson(qe.updateSettings,{userPrefs:t},"saveUserPrefs");return Q.debug("saveUserPrefs \u2190",{ok:n.ok}),n}get uploadPath(){return this.opts.endpoints?.upload??"/pai/upload-file"}get transcribePath(){return this.opts.endpoints?.transcribe??"/pai/transcribe-audio"}get submitFormPath(){return this.opts.endpoints?.submitForm??qe.submitForm}async submitForm(t){Q.debug("submitForm \u2192",{formId:t.formId,trigger:t.trigger,fields:Object.keys(t.values).length});try{await this.postJson(this.dataUrl(this.submitFormPath),t,"submitForm")}catch(n){Q.debug("submitForm failed (non-fatal)",{err:n})}}sendMessage(t){this.conversationsCache.clear(),Q.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageId:t.messageId,messageCount:t.messages.length,trigger:t.trigger,tools:t.data?.tools?.map(l=>l.code)});let n=new AbortController,o=new Set;return{iter:this.runStream(t,n,o),cancel:()=>this.cancelStream(n,t.conversationId),detach:()=>n.abort()}}resumeStream(){let t=new AbortController,n=new Set;this.resumeStatus=void 0;let o=this.resumeStreamGen(t,n,!0),i=()=>t.abort();return{iter:o,cancel:i,detach:i}}async*runStream(t,n,o){(yield*this.drain(this.openMessageStream(t,n.signal),o,n))||(yield*this.resumeStreamGen(n,o,!1))}async*resumeStreamGen(t,n,o){for(let i=1;i<=rs&&!t.signal.aborted;i++){if((!o||i>1)&&(await Mr(ls*i,t.signal),t.signal.aborted))return;let a;try{a=await this.fetchImpl(this.resumeUrl(n.size),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(c){if(t.signal.aborted)return;Q.debug("resume fetch failed \u2014 retrying",{attempt:i,err:c});continue}if(a.status===204||!a.ok){Q.debug("resume \u2192 no in-flight stream",{status:a.status});return}if(!(a.headers.get("content-type")??"").includes("text/event-stream")){let c=await a.json().then(d=>d.status).catch(()=>{});if(Q.debug("resume \u2192 no live stream (status response)",{status:c,attempt:i}),c==="pending"&&i<rs)continue;this.resumeStatus=c==="needs-generation"?"needs-generation":"completed";return}this.resumeStatus="live";let s=n.size;if(yield*this.drain(Lr(a,t.signal),n,t))return;if(n.size===s){Q.debug("resume \u2192 stream closed with no new events; nothing to resume");return}}if(!t.signal.aborted)throw new Ve("stream incomplete after resume attempts","server")}async*drain(t,n,o){try{for await(let i of t){if(o.signal.aborted)return!0;if(i.eventId){if(n.has(i.eventId))continue;n.add(i.eventId)}if(yield i,i.chunk.type==="finish"||i.chunk.type==="error")return!0}}catch(i){if(o.signal.aborted)return!0;if(i instanceof Ve&&i.status!==void 0)throw i;Q.debug("stream segment dropped",{err:i})}return!1}cancelStream(t,n){t.signal.aborted||(Q.debug("cancel stream",{conversationId:n,visitorId:this.visitorId}),t.abort(),!(!this.visitorId||!n)&&this.fetchImpl(this.url(qe.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({})),keepalive:!0}).catch(o=>Q.debug("cancel POST failed (non-fatal)",{err:o})))}async*openMessageStream(t,n){let o=await this.fetchImpl(this.url(qe.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"text/event-stream","content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(t)),signal:n});yield*Lr(o,n)}resumeUrl(t){let n=new URL(this.withEnvelopeQuery(qe.streamResume));return n.searchParams.set("resumeAt",String(t)),n.toString()}async postJson(t,n,o){let i=await this.fetchWithRetry(()=>[this.url(t),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(n))}],o);return this.assertOk(i,o)}async postForm(t,n,o){let i=await this.fetchImpl(this.url(t),{method:"POST",credentials:"omit",headers:this.opts.auth.headers(),body:this.appendEnvelope(n)});return this.assertOk(i,o)}async getJson(t,n){let o=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.opts.auth.headers()}}],n);return this.assertOk(o,n)}async fetchWithRetry(t,n){for(let o=0;;o++){let[i,a]=t(),l;try{l=await this.fetchImpl(i,a)}catch(c){if(o>=as)throw new Ve(`${n} failed: network error`,"network",void 0,c);Q.debug("request network error \u2014 retrying",{label:n,attempt:o}),await Mr(ss(o));continue}if(l.ok||!p_.has(l.status)||o>=as)return l;let s=m_(l.headers)??ss(o);Q.debug("request retryable status \u2014 retrying",{label:n,status:l.status,attempt:o,wait:s}),await Mr(s)}}async assertOk(t,n){if(!t.ok)throw new Ve(`${n} failed: ${t.status}`,"server",t.status);return await t.json()}url(t){return/^https?:\/\//i.test(t)?t:`${this.opts.agentApiBaseUrl}${t}`}dataUrl(t){return/^https?:\/\//i.test(t)?t:`${this.opts.dataApiBaseUrl}${t}`}get fetchImpl(){return this.opts.fetchImpl??globalThis.fetch.bind(globalThis)}};function f_(e){return e.includes("webm")?"webm":e.includes("ogg")?"ogg":e.includes("mp4")||e.includes("m4a")?"m4a":e.includes("mpeg")?"mp3":e.includes("wav")?"wav":"bin"}function g_(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.conversationId=="string"}function cs(e,t){let n=e?[{kind:"text",id:"t0",textSig:H(e),doneSig:H(!0)}]:[];return{id:Ue(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:H(n)}}function sn(){return{id:Ue(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:H([])}}function ds(e){let t=Ue();return h_({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function h_(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,canceled:e.canceled,errorText:e.errorText,finishReason:e.finishReason,serverMessageId:e.serverMessageId,ephemeral:e.ephemeral,attachments:e.attachments,partsSig:H(e.parts.map(y_))}}function v_(e){let t=e.parts.map((n,o)=>n.type==="text"?{kind:"text",id:`${e.id}-t${o}`,textSig:H(n.text),doneSig:H(!0)}:n.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${o}`,textSig:H(n.text),doneSig:H(n.state!=="streaming")}:n.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${o}`}:n.type==="file"?{kind:"file",url:n.url,mediaType:n.mediaType}:n.type==="source-url"?{kind:"source",sourceId:n.sourceId,url:n.url,title:n.title}:n.type==="source-document"?{kind:"source",sourceId:n.sourceId,title:n.title,filename:n.filename,mediaType:n.mediaType}:n.type.startsWith("tool-")?{kind:"tool",toolCallId:n.toolCallId,toolName:ts(n.type),inputPartialSig:H(""),inputSig:H(n.input),outputSig:H(n.output),errorSig:H(n.errorText),stateSig:H(n.state),approvalSig:H(n.approval)}:null).filter(n=>n!==null);return{id:e.id,role:e.role,serverMessageId:e.id,createdAt:so(e.createdAt)??Date.now(),status:e.status==="failed"?"error":"complete",canceled:e.status==="canceled",partsSig:H(t)}}var b_=new Set(["completed","failed","canceled"]);function P_(e){return!e.parts.some(t=>t.type==="text"&&t.text.trim()!==""||t.type.startsWith("tool-")||t.type==="file"||t.type==="source-url"||t.type==="source-document")}function x_(e){return e.role==="assistant"&&e.status!=null&&!b_.has(e.status)&&P_(e)}function Or(e){return e.filter(t=>!x_(t)).map(v_)}function _s(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,canceled:e.canceled,errorText:e.errorText,finishReason:e.finishReason,serverMessageId:e.serverMessageId,ephemeral:e.ephemeral,attachments:e.attachments,parts:e.partsSig.value.map(S_)}}function co(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function _o(e){return co(e).trim()!==""?!1:!e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function ot(e){return e.role==="assistant"&&e.status!=="streaming"&&_o(e)}function us(e){return e.canceled===!0&&ot(e)}function y_(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:H(e.text),doneSig:H(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartialSig:H(e.inputPartial),inputSig:H(e.input),outputSig:H(e.output),errorSig:H(e.error),stateSig:H(e.state),approvalSig:H(e.approval)}:e}function S_(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,text:e.textSig.value,done:e.doneSig.value}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartial:e.inputPartialSig.value,input:e.inputSig.value,output:e.outputSig.value,error:e.errorSig.value,state:e.stateSig.value,approval:e.approvalSig.value}:e}var ps=Y.scope("reducer"),uo=class{constructor(t){V(this,"messagesSig",t);V(this,"active",null);V(this,"openTextParts",new Map);V(this,"partSeq",0)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.openTextParts.clear()}ensureTextPart(t,n,o){let i=`${n}:${o}`,a=this.openTextParts.get(i);if(a)return a;let l={kind:n,id:`${o}#${this.partSeq++}`,textSig:H(""),doneSig:H(!1)};return this.openTextParts.set(i,l),ln(t,l),l}apply(t){let n=this.active;if(n)switch(t.type){case"start":t.messageId&&(n.serverMessageId=t.messageId);return;case"finish-step":this.openTextParts.clear();return;case"start-step":ln(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":ps.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":ps.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=t.errorText,this.bumpDone(n);return;case"text-start":this.ensureTextPart(n,"text",t.id);return;case"text-delta":{let o=this.ensureTextPart(n,"text",t.id);o.textSig.value+=t.delta;return}case"text-end":this.ensureTextPart(n,"text",t.id).doneSig.value=!0;return;case"reasoning-start":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!1;return;case"reasoning-delta":{let o=this.ensureTextPart(n,"reasoning",t.id);o.textSig.value+=t.delta;return}case"reasoning-end":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!0;return;case"tool-input-start":case"tool-input-delta":case"tool-input-available":case"tool-output-available":case"tool-output-error":case"tool-output-denied":case"tool-approval-request":w_(n,t);return;case"file":ln(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":ms(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":ms(n,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-notification":return;case"data-conversation-rebind":return;default:{let o=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value=[...this.messagesSig.value]}};function bt(e,t,n){let o=e.partsSig.value.find(a=>a.kind==="tool"&&a.toolCallId===t);if(o)return o;let i={kind:"tool",toolCallId:t,toolName:n??"tool",inputPartialSig:H(""),inputSig:H(void 0),outputSig:H(void 0),errorSig:H(void 0),stateSig:H("input-streaming"),approvalSig:H(void 0)};return ln(e,i),i}function ln(e,t){e.partsSig.value=[...e.partsSig.value,t]}function ms(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||ln(e,t)}function w_(e,t){switch(t.type){case"tool-input-start":bt(e,t.toolCallId,t.toolName);return;case"tool-input-delta":{let n=bt(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=bt(e,t.toolCallId,t.toolName);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-approval-request":{let n=bt(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=bt(e,t.toolCallId);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=bt(e,t.toolCallId);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=bt(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}var fs=Y.scope("feedback:audio"),po=class{constructor(){V(this,"ctx",null);V(this,"master",null);V(this,"buffers",new Map)}unlock(){if(this.ctx){this.ctx.state==="suspended"&&this.ctx.resume();return}let t=globalThis.AudioContext??globalThis.webkitAudioContext;if(t)try{this.ctx=new t,this.master=this.ctx.createGain(),this.master.gain.value=1,this.master.connect(this.ctx.destination)}catch(n){fs.warn("AudioContext init failed",{err:n})}}setVolume(t){if(!this.master||!this.ctx)return;let n=Math.max(0,Math.min(1,t));this.master.gain.setTargetAtTime(n,this.ctx.currentTime,.01)}playTone(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let i=n.currentTime,a=t.noteMs/1e3;t.notes.forEach((l,s)=>{let c=n.createOscillator();c.type=t.type,c.frequency.value=l;let d=n.createGain(),u=i+s*a;d.gain.setValueAtTime(1e-4,u),d.gain.exponentialRampToValueAtTime(t.peakGain,u+.005),d.gain.exponentialRampToValueAtTime(1e-4,u+a),c.connect(d).connect(o),c.start(u),c.stop(u+a+.01)})}async playUrl(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let i=await this.getBuffer(t);if(!i)return;let a=n.createBufferSource();a.buffer=i,a.connect(o),a.start()}destroy(){this.ctx&&this.ctx.close().catch(()=>{}),this.ctx=null,this.master=null,this.buffers.clear()}async getBuffer(t){if(!this.ctx)return null;let n=this.buffers.get(t);if(n)return n instanceof Promise,n;let o=this.ctx,i=fetch(t).then(a=>a.ok?a.arrayBuffer():Promise.reject(new Error(`fetch ${a.status}`))).then(a=>o.decodeAudioData(a)).then(a=>(this.buffers.set(t,a),a)).catch(a=>(fs.warn("audio fetch/decode failed",{url:t,err:a}),this.buffers.delete(t),null));return this.buffers.set(t,i),i}};var gs={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},hs={messageReceived:{notes:[880,1318.51],noteMs:90,type:"sine",peakGain:.45},messageSent:{notes:[1568],noteMs:60,type:"sine",peakGain:.25},error:{notes:[523.25,392],noteMs:120,type:"triangle",peakGain:.55},voiceStart:{notes:[1318.51],noteMs:50,type:"sine",peakGain:.3},voiceStop:{notes:[880],noteMs:50,type:"sine",peakGain:.3}};var ct=null,mo=0;function k_(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function C_(){if(typeof document>"u")return null;let e=document.createElement("input");e.type="checkbox",e.setAttribute("switch",""),e.setAttribute("aria-hidden","true"),e.tabIndex=-1,e.id=`__${x.cssPrefix}_haptic_${Math.random().toString(36).slice(2)}`;let t=document.createElement("label");t.htmlFor=e.id,t.setAttribute("aria-hidden","true");let n="position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;opacity:0!important;pointer-events:none!important;";return e.style.cssText=n,t.style.cssText=n,document.body.append(e,t),{input:e,label:t}}function vs(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(k_())try{navigator.vibrate(e);return}catch{}if(ct||(ct=C_()),!!ct)try{ct.label.click()}catch{}}}function bs(){mo++;let e=!1;return()=>{e||(e=!0,mo=Math.max(0,mo-1),mo===0&&ct&&(ct.input.remove(),ct.label.remove(),ct=null))}}var T_=Y.scope("feedback"),E_=100,fo=class{constructor(t,n){V(this,"mutedSig",H(!1));V(this,"audio",new po);V(this,"releaseHaptics");V(this,"sound");V(this,"haptics");V(this,"lastPlayed",new Map);V(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=bs(),this.audio.setVolume(this.effectiveVolume()),typeof matchMedia<"u"&&(this.reducedMotionMq=matchMedia("(prefers-reduced-motion: reduce)"))}unlock(){this.audio.unlock(),this.audio.setVolume(this.effectiveVolume())}update(t,n){this.sound=t,this.haptics=n,this.audio.setVolume(this.effectiveVolume())}setMuted(t){this.mutedSig.value!==t&&(this.mutedSig.value=t)}toggleMuted(){this.mutedSig.value=!this.mutedSig.value}play(t){this.mutedSig.value||this.isDeduped(t)||(this.lastPlayed.set(t,performance.now()),this.sound.enabled&&this.playSound(t),this.haptics.enabled&&this.isTouchDevice()&&this.playHaptic(t))}destroy(){this.audio.destroy(),this.releaseHaptics()}isDeduped(t){let n=this.lastPlayed.get(t);return n===void 0?!1:performance.now()-n<E_}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(i=>T_.warn("audio play failed",{err:i,url:n}));return}let o=hs[t];o&&this.audio.playTone(o)}playHaptic(t){if(this.reducedMotionMq?.matches)return;let n=this.haptics.events?.[t];if(n===!1)return;let o=n===!0||n===void 0?gs[t]:n;vs(o)}effectiveVolume(){let t=this.sound.volume??.3;return this.reducedMotionMq?.matches?t*.5:t}isTouchDevice(){return typeof window>"u"?!1:matchMedia("(hover: none) and (pointer: coarse)").matches}};function Pt(e,t){return e instanceof Ve&&e.status===429?t.errorRateLimited:t.errorGeneric}var R_=0;function r(e,t,n,o,i,a){t||(t={});var l,s,c=t;if("ref"in c)for(s in c={},t)s=="ref"?l=t[s]:c[s]=t[s];var d={type:e,props:c,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--R_,__i:-1,__u:0,__source:i,__self:a};if(typeof e=="function"&&(l=e.defaultProps))for(s in l)c[s]===void 0&&(c[s]=l[s]);return J.vnode&&J.vnode(d),d}var $={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},cn=`${x.cssPrefix}-icon-dir`,A_=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})}),Ye=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M18 6 6 18M6 6l12 12"})}),Ps=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M12 5v14M5 12h14"})}),xs=()=>r("svg",{...$,class:cn,"aria-hidden":"true",children:[r("path",{d:"m22 2-7 20-4-9-9-4Z"}),r("path",{d:"M22 2 11 13"})]}),ys=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M12 19V5M5 12l7-7 7 7"})}),Ss=()=>r("svg",{...$,class:cn,"aria-hidden":"true",children:r("path",{d:"M3 20V4l18 8-18 8Z"})}),$t=()=>r("svg",{...$,class:cn,"aria-hidden":"true",children:r("path",{d:"m9 18 6-6-6-6"})}),ws=()=>r("svg",{...$,"aria-hidden":"true",children:r("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),ks=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"m21 11-9 9a5.5 5.5 0 0 1-7.78-7.78l8.49-8.49a3.67 3.67 0 0 1 5.19 5.19l-8.49 8.49a1.83 1.83 0 0 1-2.6-2.6l7.78-7.78"})}),Cs=()=>r("svg",{...$,"aria-hidden":"true",children:[r("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),r("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]}),Ts=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),Es=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),Rs=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),As=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),Is=()=>r("svg",{...$,"aria-hidden":"true",viewBox:"0 0 10 10",children:r("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),Ls=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]}),Ms=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})}),Ns=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),Os=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),r("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]}),Ds=()=>r("svg",{...$,class:cn,"aria-hidden":"true",children:r("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),dn=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M20 6 9 17l-5-5"})}),$s=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M3 3v6h6"}),r("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),r("path",{d:"M12 7v5l3 2"})]}),Hs=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("path",{d:"M2 12h20"}),r("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),_n=()=>r("svg",{...$,class:cn,"aria-hidden":"true",children:r("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),Bs=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M12 20h9"}),r("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),go=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"m6 9 6 6 6-6"})}),Fs=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),r("path",{d:"M14 2v6h6"})]}),I_=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),r("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]}),Dr=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})}),$r=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),r("path",{d:"M12 17h.01"})]}),L_=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"m15 4 3 3-9 9-3-3z"}),r("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]}),M_=()=>r("svg",{...$,"aria-hidden":"true",children:[r("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),r("path",{d:"M12 8V4"}),r("circle",{cx:"12",cy:"3",r:"1"}),r("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]}),N_=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),r("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),r("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),r("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]}),O_=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("circle",{cx:"12",cy:"12",r:"4"}),r("path",{d:"m4.93 4.93 4.24 4.24M14.83 14.83l4.24 4.24M14.83 9.17l4.24-4.24M4.93 19.07l4.24-4.24"})]}),Hr=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"11",cy:"11",r:"7"}),r("path",{d:"m21 21-4.3-4.3"})]}),zs=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Us=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M3 9.5 12 3l9 6.5"}),r("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]}),Vs=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"m3 11 15-5v12L3 13z"}),r("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),r("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),r("path",{d:"M21 10a3 3 0 0 1 0 4"})]}),un=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),r("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}),qs=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"4"}),r("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}),Ws=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),Gs=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 3v18"}),r("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]}),D_=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),r("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),r("path",{d:"m20 20-4.4-4.4"})]}),$_=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M12 3.5 13.6 9 19 10.5 13.6 12 12 17.5 10.4 12 5 10.5 10.4 9z"}),r("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]}),H_=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M4 18h16"}),r("path",{d:"M5 18a7 7 0 0 1 14 0"}),r("path",{d:"M12 8V6"}),r("path",{d:"M10 6h4"})]}),B_=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),r("path",{d:"M16 9.5a1.5 1.5 0 0 1 3 0v2.5a7 7 0 0 1-7 7 7 7 0 0 1-6.4-4.2L4 12.5a1.5 1.5 0 0 1 2.6-1.5L7 11"})]}),Ks=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M14.7 6.3a4 4 0 0 0-5.4 5.3L3 18l3 3 6.4-6.3a4 4 0 0 0 5.3-5.4l-2.7 2.7-2.6-.7-.7-2.6z"})}),js=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 7v5l3 2"})]}),Ys=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Xs=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m15 9-6 6M9 9l6 6"})]}),Js={chat:A_,message:Dr,bubbles:un,spark:I_,wand:L_,bot:M_,help:$r,lifebuoy:O_,headset:N_,search:D_,sparkles:$_,concierge:H_,wave:B_};var L=x.cssPrefix,w={launcher:`${L}-launcher`,callout:`${L}-callout`,calloutDismiss:`${L}-callout-dismiss`,panel:`${L}-panel`,panelHeader:`${L}-panel-header`,resizeGrip:`${L}-resize-grip`,scrollToBottom:`${L}-scroll-to-bottom`,actionHistory:`${L}-action-history`,actionClose:`${L}-action-close`,langSegment:`${L}-lang-segment`,composer:`${L}-composer`,composerInput:`${L}-composer-input`,composerSend:`${L}-composer-send`,composerStop:`${L}-composer-stop`,composerAttach:`${L}-composer-attach`,composerFileInput:`${L}-composer-file-input`,composerVoice:`${L}-composer-voice`,attachmentChip:`${L}-attachment-chip`,attachmentRemove:`${L}-attachment-remove`,suggestion:`${L}-suggestion`,messageBubble:`${L}-message`,messageRetry:`${L}-message-retry`,historyPane:`${L}-history-pane`,historyBack:`${L}-history-back`,historyItem:`${L}-history-item`,sidebar:`${L}-sidebar`,sidebarToggle:`${L}-sidebar-toggle`,sidebarNewConversation:`${L}-sidebar-new-conversation`,sidebarItem:`${L}-sidebar-item`,messengerHome:`${L}-messenger-home`,modulesEmpty:`${L}-modules-empty`,tab:`${L}-tab`,tabBadge:`${L}-tab-badge`,homeView:`${L}-home-view`,homeGreeting:`${L}-home-greeting`,homeBrand:`${L}-home-brand`,backHeader:`${L}-back-header`,contentView:`${L}-content-view`,contentScroll:`${L}-content-scroll`,homeSearch:`${L}-home-search`,helpSearch:`${L}-help-search`,homeRecent:`${L}-home-recent`,homeContentRow:`${L}-home-content-row`,helpArticle:`${L}-help-article`,newsItem:`${L}-news-item`,formGate:`${L}-form-gate`,formDone:`${L}-form-done`,formDoneToggle:`${L}-form-done-toggle`,formAnswers:`${L}-form-answers`,formFill:`${L}-form-fill`,formSubmit:`${L}-form-submit`,formSkip:`${L}-form-skip`,formField:`${L}-form-field`,toolAskInput:`${L}-tool-ask-input`,toolInputSubmit:`${L}-tool-input-submit`,toolInputSkip:`${L}-tool-input-skip`,toolApproval:`${L}-tool-approval`,toolApprove:`${L}-tool-approve`,toolReject:`${L}-tool-reject`,toolEdit:`${L}-tool-edit`,toolDecision:`${L}-tool-decision`,toolCall:`${L}-tool-call`,source:`${L}-source`};function be(e,t){return`${e}-${t}`}var ho=x.cssPrefix;function Qs({onToggle:e,launcher:t,strings:n,leaving:o,edgeTab:i}){let a=t.variant!=="circle"&&!!t.label;return r("button",{type:"button",class:`${ho}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":i?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":w.launcher,onClick:e,"aria-label":n.launcherOpen,children:[F_(t.icon),a?r("span",{class:`${ho}-fab-label`,children:Ee(n,t.label??"")}):null]})}function F_(e){let t=Js[e];return t?r(t,{}):r(z_,{source:e})}function z_({source:e}){return r("span",{ref:t=>{t&&U_(t,e)},"aria-hidden":"true"})}function U_(e,t){if(e.dataset.svgMounted!==t)try{let o=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;o&&o.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(o,!0)),e.dataset.svgMounted=t)}catch{}}function Zs({callout:e,launcherPosition:t,strings:n,closeLabel:o,onDismiss:i}){let[a,l]=A(!1);return R(()=>{let s=setTimeout(()=>l(!0),e.delayMs);return()=>clearTimeout(s)},[e.delayMs]),R(()=>{if(!a||e.autoDismissMs<=0)return;let s=setTimeout(i,e.autoDismissMs);return()=>clearTimeout(s)},[a,e.autoDismissMs,i]),a?r("div",{class:`${ho}-callout`,role:"status","data-shape":e.shape,"data-position":V_(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":w.callout,children:[r("span",{children:Ee(n,e.text)}),r("button",{type:"button",class:`${ho}-callout-close`,onClick:i,"aria-label":o,title:o,"data-testid":w.calloutDismiss,children:r(Ye,{})})]}):null}function V_(e,t){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"?o?"top":"bottom":n?"left":"right"}function vo({panelEl:e,resize:t,position:n,initialSize:o,onSizeChange:i,strings:a}){let l=x.cssPrefix,s=O(null);if(R(()=>{if(!e)return;let m=e.style;t.minWidth&&m.setProperty(`--${l}-resize-min-w`,t.minWidth),t.maxWidth&&m.setProperty(`--${l}-resize-max-w`,t.maxWidth),t.minHeight&&m.setProperty(`--${l}-resize-min-h`,t.minHeight),t.maxHeight&&m.setProperty(`--${l}-resize-max-h`,t.maxHeight),o&&(m.setProperty(`--${l}-widget-w`,`${o.width}px`),m.setProperty(`--${l}-widget-h`,`${o.height}px`))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,l,o]),!e)return null;let c=n.startsWith("top-"),d=n.endsWith("-right"),u=`${l}-resize-grip ${l}-resize-grip--${c?"bottom":"top"}-${d?"left":"right"}`,_=m=>{if(!e)return;let C=m.currentTarget,v=e.getBoundingClientRect();s.current={pointerId:m.pointerId,startX:m.clientX,startY:m.clientY,startW:v.width,startH:v.height,dirX:d?-1:1,dirY:c?1:-1},C.setPointerCapture(m.pointerId),e.setAttribute("data-resizing",""),m.preventDefault()},g=m=>{let C=s.current;if(!C||m.pointerId!==C.pointerId||!e)return;let v=(m.clientX-C.startX)*C.dirX,b=(m.clientY-C.startY)*C.dirY;e.style.setProperty(`--${l}-widget-w`,`${C.startW+v}px`),e.style.setProperty(`--${l}-widget-h`,`${C.startH+b}px`)},f=m=>{let C=s.current;if(!C||m.pointerId!==C.pointerId||!e)return;m.currentTarget.releasePointerCapture(m.pointerId),e.removeAttribute("data-resizing");let v=e.getBoundingClientRect();i({width:Math.round(v.width),height:Math.round(v.height)}),s.current=null};return r("div",{class:u,role:"separator","aria-orientation":"vertical","aria-label":a.resizeHandle,title:a.resizeHandle,onPointerDown:_,onPointerMove:g,onPointerUp:f,onPointerCancel:f,"data-testid":w.resizeGrip,children:r(Is,{})})}var xt=x.cssPrefix,q_=`.${xt}-header, .${xt}-back-header, .${xt}-home-hero`,W_='button, a, input, textarea, select, [role="tab"], [contenteditable]',el=56;function bo(e,t){R(()=>{if(!t||!e)return;let n=c=>Number.parseFloat(c)||0,o=(c,d)=>Math.min(d,Math.max(-d,c)),i=null,a=c=>{let d=c.target;if(!(d instanceof Element)||!d.closest(q_)||d.closest(W_))return;let u=e.getBoundingClientRect();i={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${xt}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${xt}-modal-dy`)),maxX:(window.innerWidth+u.width)/2-el,maxY:(window.innerHeight+u.height)/2-el},e.dataset.dragging="true",c.preventDefault()},l=c=>{if(!i||c.pointerId!==i.id)return;let d=o(i.dx+c.clientX-i.x,i.maxX),u=o(i.dy+c.clientY-i.y,i.maxY);e.style.setProperty(`--${xt}-modal-dx`,`${d}px`),e.style.setProperty(`--${xt}-modal-dy`,`${u}px`)},s=c=>{!i||c.pointerId!==i.id||(i=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",a),window.addEventListener("pointermove",l),window.addEventListener("pointerup",s),window.addEventListener("pointercancel",s),()=>{e.removeEventListener("pointerdown",a),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s)}},[e,t])}function pn(e,t,n){switch(e){case"clear":case"sound":case"history":case"language":case"theme":case"textSize":return!0;case"expand":return t==="floating";case"fullscreen":return t!=="standalone";case"close":return t==="standalone"||t==="page"?!1:t==="inline"?n==="fullscreen":!0}}function Po(e,t,n){return pn("close",e,t)?n.includes("close"):!1}function tl(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var G_='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function xo(e){let t=n=>{if(n.key!=="Tab")return;let o=[...e.querySelectorAll(G_)].filter(s=>s.offsetParent!==null||s===document.activeElement);if(o.length===0){n.preventDefault();return}let i=o[0],a=o[o.length-1];if(!i||!a)return;let l=e.getRootNode().activeElement;n.shiftKey&&l===i?(n.preventDefault(),a.focus()):!n.shiftKey&&l===a&&(n.preventDefault(),i.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}function yo(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var Br=x.cssPrefix;function nl({agent:e,strings:t}){let n=e.status??"online",o=Ee(t,e.name),i=e.title?Ee(t,e.title):null;return r("div",{class:`${Br}-agent`,children:[r("div",{class:`${Br}-agent-avatar`,"data-status":n,children:e.avatar?r("img",{src:e.avatar,alt:""}):r("span",{children:yo(o)})}),r("div",{class:`${Br}-agent-meta`,children:[r("strong",{children:o}),i?r("span",{children:i}):null]})]})}var ol=Y.scope("attachments");function So(e,t,n){let o=j_(e),i=[],a=[],l=J_(n.accept),s=t.reduce((d,u)=>d+u.size,0),c=t.length;for(let d of o){let u=K_(d,c,s,n,l);if(u){a.push({file:d,reason:u});continue}i.push(X_(d)),s+=d.size,c+=1}return(i.length||a.length)&&ol.debug("ingest",{accepted:i.length,rejected:a.map(d=>({name:d.file.name,reason:d.reason}))}),{accepted:i,rejected:a}}function Fr(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){ol.debug("revokeObjectURL failed",{error:t})}}function K_(e,t,n,o,i){return t>=o.maxCount?"count":n+e.size>o.maxBytes?"bytes":Q_(e,i)?null:"mime"}function j_(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:Y_(t)).filter(t=>t!==null):[]}function Y_(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function X_(e){return{file:e,id:Ue(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function J_(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean).map(t=>{if(t.startsWith("."))return{kind:"ext",ext:t};let[n="*",o="*"]=t.split("/");return{kind:"mime",type:n,subtype:o}})}function Q_(e,t){if(t.length===0)return!0;let[n="*",o="*"]=(e.type||"").toLowerCase().split("/"),i=(e.name||"").toLowerCase();return t.some(a=>a.kind==="ext"?i.endsWith(a.ext):(a.type==="*"||a.type===n)&&(a.subtype==="*"||a.subtype===o))}var mn=x.cssPrefix;function rl({attachment:e,onRemove:t}){let n=e.mediaType.startsWith("image/");return r("span",{class:`${mn}-attachment-chip`,title:e.name,"data-testid":be(w.attachmentChip,e.id),children:[n?r("img",{class:`${mn}-attachment-thumb`,src:e.previewUrl,alt:""}):r("span",{class:`${mn}-attachment-thumb`,"aria-hidden":"true",children:r(Fs,{})}),r("span",{class:`${mn}-attachment-name`,children:e.name}),r("button",{type:"button",class:`${mn}-attachment-remove`,onClick:t,"aria-label":`Remove ${e.name}`,"data-testid":be(w.attachmentRemove,e.id),children:r(Ye,{})})]})}var zr={isSupported:!1,start:()=>{},stop:()=>{}};function Ur(e,t,n){return e==="disabled"?zr:e==="server"?nu(n):Z_(t)}function Z_(e){let t=eu();if(!t)return zr;let n=null;return{isSupported:!0,start(o,i){n=new t,n.continuous=!0,n.interimResults=!0,n.lang=e,n.addEventListener("result",l=>{let s=l,c="",d=!1;for(let u=s.resultIndex;u<s.results.length;u++){let _=s.results[u];_&&(c+=_[0].transcript,_.isFinal&&(d=!0))}o(c,d)});let a=()=>{n=null,i()};n.addEventListener("end",a),n.addEventListener("error",a),n.start()},stop(){n?.stop()}}}function eu(){let e=globalThis;return e.SpeechRecognition??e.webkitSpeechRecognition}var tu=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function nu(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return zr;let t=null,n=null,o=[],i=()=>{for(let a of n?.getTracks()??[])a.stop();n=null};return{isSupported:!0,async start(a,l){try{n=await navigator.mediaDevices.getUserMedia({audio:!0});let s=ou();t=new MediaRecorder(n,s?{mimeType:s}:void 0),o=[],t.addEventListener("dataavailable",c=>{c.data.size>0&&o.push(c.data)}),t.addEventListener("stop",async()=>{let c=t?.mimeType??"audio/webm";i();let d=new Blob(o,{type:c});o=[];try{let{text:u}=await e(d,c);u&&a(u,!0)}catch{}finally{l()}}),t.start()}catch{i(),l()}},stop(){t?.stop()}}}function ou(){for(let e of tu)if(MediaRecorder.isTypeSupported(e))return e}var He=x.cssPrefix,yt=Y.scope("composer");function Ht(e){return e.reduce((t,n)=>t+n.size,0)}var ru={arrowUp:ys,paperPlane:xs,send:Ss,chevron:$t};function il({options:e,transport:t,feedback:n,bus:o,isStreaming:i,onSend:a,onStop:l,attachApiRef:s}){let c=e.strings,[d,u]=A(""),[_,g]=A([]),[f,m]=A(!1),C=O(null),v=O(null),b=e.features.files,y=e.features.voice,[P,E]=A(()=>Ur(y,e.locale,(k,K)=>t.transcribe(k,K)));R(()=>{f||y==="disabled"||E(Ur(y,e.locale,(k,K)=>t.transcribe(k,K)))},[e.locale,y,t,f]),R(()=>{let k=C.current;if(!k)return;let K=k.getRootNode(),re="activeElement"in K?K.activeElement:null;re&&k.closest(`.${He}-panel`)?.contains(re)||k.focus({preventScroll:!0})},[]),R(()=>{let k=C.current;if(k){if(d.length===0){k.style.height="";return}k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,160)}px`}},[d]);let B=O(_);B.current=_,R(()=>()=>B.current.forEach(Fr),[]),R(()=>{if(s)return s.current={attachFromDrop:k=>{let K=So(k,B.current,e.attachments);K.accepted.length!==0&&(yt.info("attach (drop)",{count:K.accepted.length,totalBytes:Ht(K.accepted)}),o.emit("attach",{count:K.accepted.length,totalBytes:Ht(K.accepted)}),g(re=>[...re,...K.accepted]))}},()=>{s.current&&(s.current=null)}},[s,e.attachments]),R(()=>{let k=C.current;if(!k)return;let K=k.closest(`.${He}-panel`);if(!K)return;let re=de=>{let ue=de.clipboardData;if(!ue)return;if(b){let ie=So(ue.items,B.current,e.attachments);if(ie.accepted.length>0){de.preventDefault(),yt.info("attach (paste)",{count:ie.accepted.length,totalBytes:Ht(ie.accepted)}),o.emit("attach",{count:ie.accepted.length,totalBytes:Ht(ie.accepted)}),g(Pe=>[...Pe,...ie.accepted]);return}}if(de.target===k)return;let Ie=ue.getData("text/plain");Ie&&(de.preventDefault(),u(ie=>ie+Ie),k.focus())};return K.addEventListener("paste",re),()=>K.removeEventListener("paste",re)},[b,e.attachments,He]);let le=()=>{let k=d.trim();!k&&_.length===0||i||(a(k,_),u(""),g([]))},M=k=>{k.key!=="Enter"||k.shiftKey||k.isComposing||(k.preventDefault(),i?l():le())},Z=k=>{let K=k.target,re=So(K.files,_,e.attachments);re.accepted.length>0&&(yt.info("attach (file picker)",{count:re.accepted.length,totalBytes:Ht(re.accepted)}),o.emit("attach",{count:re.accepted.length,totalBytes:Ht(re.accepted)}),g(de=>[...de,...re.accepted])),K.value=""},F=k=>{yt.info("removeAttachment",{id:k}),o.emit("removeAttachment",{id:k}),g(K=>{let re=K.find(de=>de.id===k);return re&&Fr(re),K.filter(de=>de.id!==k)})},G=O(null),X=()=>{if(P.isSupported){if(f){let k=G.current?Date.now()-G.current:0;yt.info("voiceStop",{durationMs:k}),o.emit("voiceStop",{durationMs:k}),P.stop(),m(!1),n.play("voiceStop"),G.current=null;return}G.current=Date.now(),yt.info("voiceStart"),o.emit("voiceStart",void 0),m(!0),n.play("voiceStart"),P.start((k,K)=>u(re=>K?`${re}${k} `:re),()=>{if(m(!1),G.current){let k=Date.now()-G.current;yt.debug("voiceStop (auto)",{durationMs:k}),o.emit("voiceStop",{durationMs:k}),G.current=null}})}},he=ru[e.composer.sendButton.icon];return r("div",{class:`${He}-composer`,"data-testid":w.composer,children:[_.length>0?r("div",{class:`${He}-attachments`,children:_.map(k=>r(rl,{attachment:k,onRemove:()=>F(k.id)},k.id))}):null,r("div",{class:`${He}-composer-row`,children:[r("div",{class:`${He}-composer-actions`,children:[b?r("button",{type:"button",class:`${He}-icon-btn`,onClick:()=>v.current?.click(),"aria-label":c.attach,"data-testid":w.composerAttach,children:r(ks,{})}):null,P.isSupported?r("button",{type:"button",class:`${He}-icon-btn`,onClick:X,"aria-label":f?c.micStop:c.micStart,"aria-pressed":f,"data-recording":f?"true":void 0,"data-testid":w.composerVoice,children:r(Cs,{})}):null]}),r("textarea",{ref:C,class:`${He}-textarea`,rows:1,value:d,placeholder:c.composerPlaceholder,onInput:k=>u(k.target.value),onKeyDown:M,"aria-label":c.composerPlaceholder,"data-testid":w.composerInput}),i?r("button",{type:"button",class:`${He}-send`,onClick:l,"aria-label":c.stop,"data-testid":w.composerStop,children:r(ws,{})}):r("button",{type:"button",class:`${He}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:le,disabled:!d.trim()&&_.length===0,"aria-label":c.send,"data-testid":w.composerSend,children:r(he,{})})]}),r("input",{ref:v,type:"file",multiple:!0,accept:e.attachments.accept,onChange:Z,class:`${He}-sr-only`,"data-testid":w.composerFileInput})]})}var iu=x.cssPrefix;function al({visible:e,strings:t}){return e?r("div",{class:`${iu}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function wo({containerRef:e,onDrop:t}){let[n,o]=A(!1);return R(()=>{let i=e.current;if(!i)return;let a=0,l=u=>{a+=1,u.dataTransfer?.types.includes("Files")&&(u.preventDefault(),o(!0))},s=()=>{a-=1,!(a>0)&&(a=0,o(!1))},c=u=>{u.dataTransfer?.types.includes("Files")&&u.preventDefault()},d=u=>{a=0,o(!1),u.dataTransfer&&(u.preventDefault(),t(u.dataTransfer.items))};return i.addEventListener("dragenter",l),i.addEventListener("dragleave",s),i.addEventListener("dragover",c),i.addEventListener("drop",d),()=>{i.removeEventListener("dragenter",l),i.removeEventListener("dragleave",s),i.removeEventListener("dragover",c),i.removeEventListener("drop",d)}},[e,t]),{visible:n}}function sl({itemCount:e,initialFocusIndex:t}){let[n,o]=A(!1),i=O(null),a=O(null),[l,s]=A(-1),c=D(()=>{o(!1),s(-1),i.current?.focus()},[]),d=D(()=>o(g=>!g),[]);R(()=>{if(!n)return;let g=f=>{let m=a.current,C=i.current;if(!m||!C)return;let v=f.composedPath();v.includes(m)||v.includes(C)||(o(!1),s(-1))};return document.addEventListener("click",g,!0),()=>document.removeEventListener("click",g,!0)},[n]),R(()=>{if(!n||e===0)return;let g=t?.()??0,f=g<0||g>=e?0:g;s(f)},[n,e,t]),R(()=>{if(!n||l<0)return;a.current?.querySelectorAll("[role='menuitem']")?.[l]?.focus()},[n,l]);let u=D(g=>{(g.key==="ArrowDown"||g.key==="Enter"||g.key===" ")&&(g.preventDefault(),o(!0))},[]),_=D(g=>{if(e!==0)switch(g.key){case"Escape":g.preventDefault(),c();return;case"ArrowDown":g.preventDefault(),s(f=>(f+1)%e);return;case"ArrowUp":g.preventDefault(),s(f=>(f-1+e)%e);return;case"Home":g.preventDefault(),s(0);return;case"End":g.preventDefault(),s(e-1)}},[e,c]);return{open:n,focusIndex:l,triggerRef:i,menuRef:a,toggle:d,close:c,onTriggerKey:u,onMenuKey:_}}function ll({items:e,triggerLabel:t}){let n=x.cssPrefix,o=sl({itemCount:e.length}),i=s=>{s.disabled||(s.onSelect?.(),s.keepOpen||o.close())},a=(s,c)=>s.onSelectValue?.(c),l=(s,c)=>{let d=c.segments;if(!d?.length)return;let u=Math.max(0,d.findIndex(g=>g.value===c.value)),_=-1;if(s.key==="ArrowRight"||s.key==="Enter"||s.key===" ")_=(u+1)%d.length;else if(s.key==="ArrowLeft")_=(u-1+d.length)%d.length;else return;s.preventDefault(),s.stopPropagation(),a(c,d[_].value)};return r("div",{class:`${n}-menu-wrap`,children:[r("button",{ref:o.triggerRef,type:"button",class:`${n}-icon-btn`,"aria-label":t,"aria-haspopup":"menu","aria-expanded":o.open,title:t,onClick:o.toggle,onKeyDown:o.onTriggerKey,children:r(Ls,{})}),o.open?r("div",{ref:o.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:o.onMenuKey,tabIndex:-1,children:e.map(s=>s.segments?r("div",{role:"menuitem",class:`${n}-menu-item ${n}-menu-item-segmented`,"aria-label":s.label,tabIndex:-1,onKeyDown:c=>l(c,s),children:[s.icon?r("span",{class:`${n}-menu-icon`,children:s.icon}):null,r("span",{class:`${n}-menu-label`,children:s.label}),r("span",{class:`${n}-segmented`,role:"group","aria-label":s.label,children:s.segments.map(c=>{let d=c.value===s.value;return r("button",{type:"button",role:"menuitemradio","aria-checked":d,class:`${n}-segment`,"data-on":d?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${w.langSegment}-${c.value}`,onClick:()=>a(s,c.value),children:c.label},c.value)})})]},s.id):r("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":s.type==="switch"?s.on:void 0,disabled:s.disabled,onClick:()=>i(s),children:[s.icon?r("span",{class:`${n}-menu-icon`,children:s.icon}):null,r("span",{class:`${n}-menu-label`,children:s.label}),s.type==="switch"&&s.on?r("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:r(dn,{})}):null]},s.id))}):null]})}var Vr=x.cssPrefix;function au(e){let t=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)").matches:!0;return e==="auto"?t?"light":"dark":t?e==="light"?"dark":"auto":e==="dark"?"light":"auto"}var su={normal:"large",large:"small",small:"normal"};function lu(e){return e==="light"?r(qs,{}):e==="dark"?r(Ws,{}):r(Gs,{})}function cu(e){return(e.split("-")[0]??e).toUpperCase()}function Xe({panelProps:e,variant:t}){let{options:n,panelSize:o,feedback:i,onClose:a,onClear:l,onExpand:s,onFullscreen:c,onSoundToggle:d}=e,{onToggleHistory:u,onLocaleChange:_,onThemeChange:g,onTextSizeChange:f}=e,m=n.strings,C=n.mode,v=t==="chat",b=j(()=>i.mutedSig.value).value,y=new Set(n.actions),P=k=>y.has(k),E=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,B=k=>E?!1:pn(k,C,o),le=n.themeMode,M={auto:m.themeAuto,light:m.themeLight,dark:m.themeDark},Z=n.textSize,F={small:m.textSizeSmall,normal:m.textSizeNormal,large:m.textSizeLarge},G=[];if(v&&P("clear")&&G.push({id:"clear",icon:r(Bs,{}),label:m.newConversation,onSelect:l}),P("expand")&&B("expand")){let k=o==="expanded";G.push({id:"expand",icon:k?r(Es,{}):r(Ts,{}),label:k?m.collapse:m.expand,type:"switch",on:k,onSelect:s})}if(P("fullscreen")&&B("fullscreen")){let k=o==="fullscreen";G.push({id:"fullscreen",icon:k?r(As,{}):r(Rs,{}),label:k?m.exitFullscreen:m.fullscreen,type:"switch",on:k,onSelect:c})}v&&P("sound")&&G.push({id:"sound",icon:b?r(Ns,{}):r(Ms,{}),label:b?m.soundOff:m.soundOn,type:"switch",on:!b,onSelect:d}),P("theme")&&G.push({id:"theme",icon:lu(le),label:`${m.theme}: ${M[le]}`,onSelect:()=>g(au(le)),keepOpen:!0}),P("textSize")&&G.push({id:"textSize",icon:r(Os,{}),label:`${m.textSize}: ${F[Z]}`,onSelect:()=>f(su[Z]),keepOpen:!0}),P("language")&&n.availableLocales.length>1&&G.push({id:"language",icon:r(Hs,{}),label:m.language,segments:n.availableLocales.map(k=>({value:k,label:cu(k),lang:k})),value:n.locale,onSelectValue:_});let X=!!a&&Po(C,o,n.actions),he=v&&P("history");return r("div",{class:`${Vr}-header-actions`,children:[he?r("button",{type:"button",class:`${Vr}-icon-btn`,onClick:u,"aria-label":m.history,title:m.history,"data-testid":w.actionHistory,children:r($s,{})}):null,G.length>0?r(ll,{items:G,triggerLabel:m.moreActions}):null,X?r("button",{type:"button",class:`${Vr}-icon-btn`,onClick:a,"aria-label":m.close,title:m.close,"data-testid":w.actionClose,children:r(Ye,{})}):null]})}var du=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,_u=/^https?:\/\/[^\s.]+\.[^\s]+$/i,uu=/^[+]?[\d\s().-]{6,}$/;function Bt(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>String(t[o]??`{${o}}`))}function pu(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function mu(e,t,n){let o=e.required??!0,i=e.validation;if(e.type==="multiselect"){let l=pu(t);return o&&l===0?n.formRequired:l===0?void 0:i?.minSelections!=null&&l<i.minSelections?Bt(n.formChooseAtLeast,{min:i.minSelections}):i?.maxSelections!=null&&l>i.maxSelections?Bt(n.formChooseAtMost,{max:i.maxSelections}):void 0}let a=typeof t=="string"?t.trim():"";if(!a)return o?n.formRequired:void 0;switch(e.type){case"email":if(!du.test(a))return n.formInvalidEmail;break;case"url":if(!_u.test(a))return n.formInvalidUrl;break;case"tel":if(!uu.test(a))return n.formInvalidTel;break;case"number":{let l=Number(a);if(!Number.isFinite(l))return n.formInvalidNumber;if(i?.min!=null&&l<i.min)return Bt(n.formNumberTooSmall,{min:i.min});if(i?.max!=null&&l>i.max)return Bt(n.formNumberTooLarge,{max:i.max});break}default:break}if(i?.minLength!=null&&a.length<i.minLength)return Bt(n.formTooShort,{min:i.minLength});if(i?.maxLength!=null&&a.length>i.maxLength)return Bt(n.formTooLong,{max:i.maxLength});if(i?.pattern)try{if(!new RegExp(i.pattern).test(a))return n.formPatternMismatch}catch{}}function cl(e,t,n){let o={};for(let i of e){let a=mu(i,t[i.name],n);a&&(o[i.name]=a)}return o}function dl(e){let t={};for(let[n,o]of Object.entries(e)){let i=Array.isArray(o)?o.join(", "):o;i&&i.trim()&&(t[n]=i.trim())}return t}var _e=x.cssPrefix,ko="__other__";function Co({fields:e,strings:t,submitLabel:n,onSubmit:o,skipLabel:i,onSkip:a,footerHint:l,submitOnEnter:s,disabled:c,rootTestId:d,submitTestId:u,skipTestId:_}){let[g,f]=A(()=>vu(e)),[m,C]=A({}),[v,b]=A({}),y=M=>{v[M]&&b(Z=>({...Z,[M]:""}))},P=(M,Z)=>{f(F=>({...F,[M]:Z})),y(M)},E=(M,Z)=>{C(F=>({...F,[M]:Z})),y(M)},B=M=>{if(M.preventDefault(),c)return;let Z=bu(e,g,m),F=cl(e,Z,t);if(Object.keys(F).length>0){b(F);return}o(dl(Z))},le=M=>{!s||M.key!=="Enter"||M.shiftKey||M.isComposing||M.target?.tagName==="TEXTAREA"&&B(M)};return r("form",{class:`${_e}-form`,onSubmit:B,onKeyDown:le,"data-testid":d,noValidate:!0,children:[e.map(M=>r(fu,{field:M,value:g[M.name],otherText:m[M.name]??"",error:v[M.name],disabled:c,strings:t,onChange:Z=>P(M.name,Z),onOtherChange:Z=>E(M.name,Z)},M.name)),r("div",{class:`${_e}-form-actions`,children:[l?r("span",{class:`${_e}-form-hint`,children:l}):null,i&&a?r("button",{type:"button",class:`${_e}-form-skip`,onClick:a,disabled:c,"data-testid":_,children:i}):null,r("button",{type:"submit",class:`${_e}-form-submit`,disabled:c,"data-testid":u,children:n})]})]})}function fu({field:e,value:t,otherText:n,error:o,disabled:i,strings:a,onChange:l,onOtherChange:s}){let c=be(w.formField,e.name),d=gu({field:e,value:t,otherText:n,disabled:i,strings:a,onChange:l,onOtherChange:s,fieldTid:c});return r("label",{class:`${_e}-field`,"data-field":e.name,"data-invalid":o?"true":void 0,children:[r("span",{class:`${_e}-field-label`,children:[e.label,e.required??!0?r("span",{class:`${_e}-field-req`,"aria-hidden":"true",children:" *"}):null]}),d,e.validationHint&&!o?r("span",{class:`${_e}-field-hint`,children:e.validationHint}):null,o?r("span",{class:`${_e}-field-error`,role:"alert",children:o}):null]})}function gu(e){let{field:t,value:n,otherText:o,disabled:i,strings:a,onChange:l,onOtherChange:s,fieldTid:c}=e,d=typeof n=="string"?n:"";switch(t.type){case"textarea":return r("textarea",{class:`${_e}-field-input`,rows:3,value:d,placeholder:t.placeholder,disabled:i,onInput:u=>l(u.target.value),"data-testid":c});case"select":return r("select",{class:`${_e}-field-input`,value:d,disabled:i,onChange:u=>l(u.target.value),"data-testid":c,children:[r("option",{value:"",children:t.placeholder??"\u2014"}),(t.options??[]).map(u=>r("option",{value:u.value,children:u.label??u.value},u.value))]});case"radio":{let u=t.allowOther&&d===ko;return r("div",{class:`${_e}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(_=>r("label",{class:`${_e}-choice`,children:[r("input",{type:"radio",name:`${_e}-${t.name}`,checked:d===_.value,disabled:i,onChange:()=>l(_.value)}),r("span",{children:_.label??_.value})]},_.value)),t.allowOther?r("label",{class:`${_e}-choice`,children:[r("input",{type:"radio",name:`${_e}-${t.name}`,checked:d===ko,disabled:i,onChange:()=>l(ko)}),r("span",{children:a.formOther})]}):null,u?r("input",{class:`${_e}-field-input`,value:o,placeholder:t.placeholder??a.formOtherPlaceholder,disabled:i,onInput:_=>s(_.target.value)}):null]})}case"checkbox":return r("label",{class:`${_e}-choice`,children:[r("input",{type:"checkbox",checked:d==="true",disabled:i,onChange:u=>l(u.target.checked?"true":""),"data-testid":c}),r("span",{children:t.placeholder??t.label})]});case"multiselect":{let u=Array.isArray(n)?n:[],_=(g,f)=>l(f?[...u,g]:u.filter(m=>m!==g));return r("div",{class:`${_e}-field-choices`,"data-testid":c,children:[(t.options??[]).map(g=>r("label",{class:`${_e}-choice`,children:[r("input",{type:"checkbox",checked:u.includes(g.value),disabled:i,onChange:f=>_(g.value,f.target.checked)}),r("span",{children:g.label??g.value})]},g.value)),t.allowOther||(t.options??[]).length===0?r("textarea",{class:`${_e}-field-input`,rows:2,value:o,placeholder:t.placeholder??a.formOtherPlaceholder,disabled:i,onInput:g=>s(g.target.value)}):null]})}default:return r("input",{class:`${_e}-field-input`,type:hu(t.type),value:d,placeholder:t.placeholder,disabled:i,onInput:u=>l(u.target.value),"data-testid":c})}}function hu(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function vu(e){let t={};for(let n of e)n.defaultValue!=null&&(t[n.name]=n.type==="multiselect"?n.defaultValue.split(",").map(o=>o.trim()).filter(Boolean):n.defaultValue);return t}function bu(e,t,n){let o={...t};for(let i of e){let a=n[i.name]?.trim();if(i.type==="radio"&&i.allowOther&&t[i.name]===ko)o[i.name]=a??"";else if(i.type==="multiselect"&&a){let l=a.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),s=Array.isArray(t[i.name])?t[i.name]:[];o[i.name]=[...s,...l]}}return o}var Je=x.cssPrefix;function qr({form:e,strings:t,onSubmit:n,onSkip:o}){return r("div",{class:`${Je}-form-gate`,"data-testid":w.formGate,children:[e.title?r("h3",{class:`${Je}-form-gate-title`,children:e.title}):null,e.description?r("p",{class:`${Je}-form-gate-desc`,children:e.description}):null,r(Co,{fields:e.fields,strings:t,submitLabel:e.submitLabel??t.formSubmit,onSubmit:n,skipLabel:e.skippable?t.formSkip:void 0,onSkip:e.skippable?o:void 0,submitTestId:w.formSubmit,skipTestId:w.formSkip})]})}function _l({marker:e,strings:t,onFill:n}){let o=e.outcome==="skipped",i=o?t.formSkipped:t.formSubmitted,a=e.title?r(ee,{children:[r("span",{children:e.title}),r("span",{class:`${Je}-sr-only`,children:i})]}):r("span",{children:i}),l=e.form?.reviewable??!1,s=!o&&l&&e.values&&Object.keys(e.values).length>0?e.values:null;if(s){let c=d=>e.form?.fields.find(u=>u.name===d)?.label??d;return r("details",{class:`${Je}-form-done`,"data-outcome":e.outcome,"data-testid":w.formDone,children:[r("summary",{class:`${Je}-form-done-summary`,"data-testid":w.formDoneToggle,children:[r(dn,{}),a,r($t,{})]}),r("dl",{class:`${Je}-form-answers`,"data-testid":w.formAnswers,children:Object.entries(s).map(([d,u])=>r("div",{class:`${Je}-form-answer`,children:[r("dt",{children:c(d)}),r("dd",{children:u})]},d))})]})}return r("div",{class:`${Je}-form-done`,"data-outcome":e.outcome,"data-testid":w.formDone,role:"status",children:[o?r(Ds,{}):r(dn,{}),a,o&&e.form?.reopenable&&n?r("button",{type:"button",class:`${Je}-form-done-fill`,"data-testid":w.formFill,onClick:n,children:t.formFillOut}):null]})}function ul(e){if(!e)return!1;let t=e.startsWith("tool:")?e.slice(5):e;return t==="ask-user-input"||t==="ask_user_input"||t==="request-user-input"||t==="request_user_input"}var Kr=1,ml=2,fl=4,gl=8,hl=16;function Pu(e){switch(e){case Kr:return"href";case ml:return"src";case fl:return"class";case gl:return"checked";case hl:return"start"}}var xu=e=>{switch(e){case 1:return 3;case 2:return 4;case 3:return 5;case 4:return 6;case 5:return 7;default:return 8}},yu=xu;var pl=24;function Yr(e){let t=new Uint32Array(pl);return t[0]=1,{renderer:e,text:"",pending:"",tokens:t,len:0,token:1,fence_end:0,blockquote_idx:0,hr_char:"",hr_chars:0,fence_start:0,spaces:new Uint8Array(pl),indent:"",indent_len:0,table_state:0}}function vl(e){e.pending.length>0&&Ce(e,`
|
|
12
|
-
`)}function
|
|
13
|
-
`:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){
|
|
14
|
-
`:if(e.hr_chars<3)break;
|
|
15
|
-
`:{
|
|
16
|
-
`:e.table_state=2,e.pending="";continue;default:
|
|
17
|
-
`:
|
|
18
|
-
`:
|
|
9
|
+
`))!==-1;){let s=r.slice(0,l);r=r.slice(l+2);let c=Ji(s);c&&(yield c)}}}finally{n.releaseLock()}}function Ji(e){let t="",n;for(let r of e.split(`
|
|
10
|
+
`))if(!(r===""||r.startsWith(":"))){if(r.startsWith("data:")){let a=r.slice(5).replace(/^ /,"");t=t?`${t}
|
|
11
|
+
${a}`:a;continue}r.startsWith("id:")&&(n=r.slice(3).trim())}if(!t||t==="[DONE]")return null;try{let r=JSON.parse(t);return Yi.trace("chunk",{type:r.type,eventId:n}),{chunk:r,eventId:n}}catch(r){return Yi.trace("frame parse failed",{err:r,payload:t.slice(0,200)}),null}}function a_(e){let t=new TextEncoder().encode(e),n="";for(let r of t)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var Qi=e=>e&&Object.keys(e).length>0?e:void 0;function Zi(e,t){let n=Qi(e),r=Qi(t);if(!n&&!r)return;let a={};return n&&(a.user=n),r&&(a.page=r),a_(JSON.stringify(a))}function ir(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function i_(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function es(e){return e.startsWith("tool-")?e.slice(5):e}var We={handshake:"/pai/handshake",streamMessage:"/pai/stream-message",streamResume:"/pai/stream-resume",cancelStream:"/pai/cancel-stream",listConversations:"/pai/list-conversations",listMessages:"/pai/list-messages",updateSettings:"/pai/update-settings",markRead:"/pai/mark-read",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},ts="context";function ns(e){let t=e.messages.map(i=>({id:i.serverMessageId??i.id,parts:c_(i),role:i.role,createdAt:i.createdAt!==void 0?new Date(i.createdAt).toISOString():void 0})),n={messages:t,conversationId:e.conversationId,trigger:e.trigger??"submit-message"},r=t.at(-1)?.id;r&&(n.messageId=r),e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs);let a=e.tools?.map(l_).filter(i=>i!==null);return a?.length&&(n.data={tools:a}),n}function s_(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function l_(e){return typeof e=="string"?e?{code:e}:null:e?.code?e:null}function c_(e){let t=[];for(let n of e.parts)if(n.kind==="step-start"&&t.push({type:"step-start"}),n.kind==="reasoning"&&n.text&&t.push({type:"reasoning",text:n.text,state:n.done?"done":"streaming"}),n.kind==="text"&&n.text&&t.push({text:n.text,type:"text"}),n.kind==="file"&&n.url&&t.push({mediaType:n.mediaType,type:"file",url:n.url}),n.kind==="tool"&&s_(n)){let r={type:i_(n.toolName),toolCallId:n.toolCallId,state:n.state};n.input!==void 0&&(r.input=n.input),n.output!==void 0&&(r.output=n.output),n.error!==void 0&&(r.errorText=n.error),n.approval&&n.approval.approved!==void 0&&(r.approval=n.approval),t.push(r)}for(let n of e.attachments??[])n.url&&t.push({type:"file",url:n.url,mediaType:n.mediaType,filename:n.name,fileId:n.id,fileSize:n.size});return t}var ee=J.scope("transport"),rs=3,ss=400,d_=6e4,os=1e4,as=3,__=new Set([408,425,429,500,502,503,504]);function is(e){return ss*2**e+Math.floor(Math.random()*250)}function u_(e){let t=e.get("retry-after");if(!t)return null;let n=Number(t),r=Number.isFinite(n)?n*1e3:Date.parse(t)-Date.now();return Number.isFinite(r)&&r>=0?Math.min(r,3e4):null}function Mo(e,t){return new Promise(n=>{if(t?.aborted)return n();let r=setTimeout(i,e),a=()=>i();t?.addEventListener("abort",a,{once:!0});function i(){clearTimeout(r),t?.removeEventListener("abort",a),n()}})}var sr=class{constructor(t){q(this,"opts",t);q(this,"visitorId");q(this,"conversationId");q(this,"resumeStatus");q(this,"userContext");q(this,"pageContext");q(this,"locale");q(this,"conversationsCache",new Map);q(this,"contentCache",new Map)}setContext(t,n){this.userContext=t,this.pageContext=n}setLocale(t){this.locale=t}primeIdentity(t,n){t&&(this.visitorId=t),n&&(this.conversationId=n)}envelope(){let t={_ev:ar};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=Zi(this.userContext,this.pageContext);return n&&(t[ts]=n),t}withEnvelope(t){return{...this.envelope(),...t}}appendEnvelope(t){for(let[n,r]of Object.entries(this.envelope()))t.append(n,r);return t}withEnvelopeQuery(t){let n=new URL(this.url(t));for(let[r,a]of Object.entries(this.envelope()))n.searchParams.has(r)||n.searchParams.set(r,a);return n.toString()}async handshake(t){ee.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson(We.handshake,t,"handshake");return ee.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),m_(n)||ee.warn("handshake response did not match expected shape; using raw response",{response:n}),this.visitorId=n.visitorId??t.visitorId,this.conversationId=n.conversationId,n}async uploadFile(t){ee.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let n=new FormData;n.append("file",t,t.name);let r=await this.postForm(this.uploadPath,n,"upload");return ee.debug("uploadFile \u2190",{id:r.id,url:r.url}),r}async transcribe(t,n="audio/webm"){ee.debug("transcribe \u2192",{size:t.size,mimeType:n});let r=new FormData;r.append("audio",t,`voice.${p_(n)}`),r.append("mimeType",n);let a=await this.postForm(this.transcribePath,r,"transcribe");return ee.debug("transcribe \u2190",{textLen:a.text.length}),a}conversationsKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){let n=this.conversationsCache.get(this.conversationsKey(t));if(n?.value&&Date.now()-n.at<os)return n.value}listConversations(t={}){let n=this.conversationsKey(t),r=this.conversationsCache.get(n);if(r&&Date.now()-r.at<os)return ee.debug("listConversations \u2192 cache",t),r.result;let a={at:Date.now(),result:this.fetchConversations(t).then(i=>(a.value=i,i)).catch(i=>{throw this.conversationsCache.delete(n),i})};return this.conversationsCache.set(n,a),a.result}async fetchConversations(t){let n=new URL(this.url(We.listConversations));t.visitorId&&n.searchParams.set("visitorId",t.visitorId),t.limit&&n.searchParams.set("limit",String(t.limit)),t.cursor&&n.searchParams.set("cursor",t.cursor),ee.debug("listConversations \u2192",{visitorId:t.visitorId??this.visitorId,limit:t.limit,cursor:t.cursor});let r=await this.getJson(n.toString(),"listConversations"),a=r.conversations??[];return ee.debug("listConversations \u2190",{count:a.length,nextCursor:r.nextCursor}),{conversations:a.map(i=>({conversationId:i.conversationId,title:i.title,lastMessageAt:i.lastMessageAt,preview:i.preview,canContinue:i.canContinue,unreadCount:i.unreadCount})),nextCursor:r.nextCursor}}async loadConversation(t){let n=new URL(this.url(We.listMessages));n.searchParams.set("conversationId",t),ee.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId});let r=await this.getJson(n.toString(),"loadConversation"),a=r.messages??[];return ee.debug("loadConversation \u2190",{conversationId:r.conversationId,canContinue:r.canContinue,messageCount:a.length,hasSuggestions:!!r.suggestions}),{conversationId:r.conversationId,canContinue:r.canContinue??!0,messages:a,agent:r.agent,suggestions:r.suggestions}}async markRead(t){if(!(!this.visitorId||!t)){this.conversationsCache.clear(),ee.debug("markRead \u2192",{conversationId:t,visitorId:this.visitorId});try{await this.postJson(We.markRead,{conversationId:t},"markRead")}catch(n){ee.debug("markRead failed (non-fatal)",{err:n})}}}listContent(t={}){let n=`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`,r=this.contentCache.get(n);if(r&&Date.now()-r.at<d_)return ee.debug("listContent \u2192 cache",t),r.result;let a=this.fetchContent(t).catch(i=>{throw this.contentCache.delete(n),i});return this.contentCache.set(n,{at:Date.now(),result:a}),a}async fetchContent(t){let n=new URL(this.dataUrl(We.content));for(let[i,l]of Object.entries(t))l!==void 0&&n.searchParams.set(i,Array.isArray(l)?l.join(","):String(l));ee.debug("listContent \u2192",t);let r=await this.getJson(n.toString(),"listContent"),a=(r.items??[]).map(i=>Ua(i,this.locale));return ee.debug("listContent \u2190",{count:a.length,total:r.pagination?.total}),{...r,items:a}}async bootstrap(t){let n=new URL(this.dataUrl(We.bootstrap));t&&n.searchParams.set("conversationId",t),ee.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let r=await this.getJson(n.toString(),"bootstrap"),a=r.forms??[],i=r.formSubmissions??[];return ee.debug("bootstrap \u2190",{forms:a.length,formSubmissions:i.length}),{forms:a,formSubmissions:i}}async saveUserPrefs(t){ee.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson(We.updateSettings,{userPrefs:t},"saveUserPrefs");return ee.debug("saveUserPrefs \u2190",{ok:n.ok}),n}get uploadPath(){return this.opts.endpoints?.upload??"/pai/upload-file"}get transcribePath(){return this.opts.endpoints?.transcribe??"/pai/transcribe-audio"}get submitFormPath(){return this.opts.endpoints?.submitForm??We.submitForm}async submitForm(t){ee.debug("submitForm \u2192",{formId:t.formId,trigger:t.trigger,fields:Object.keys(t.values).length});try{await this.postJson(this.dataUrl(this.submitFormPath),t,"submitForm")}catch(n){ee.debug("submitForm failed (non-fatal)",{err:n})}}sendMessage(t){this.conversationsCache.clear(),ee.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageId:t.messageId,messageCount:t.messages.length,trigger:t.trigger,tools:t.data?.tools?.map(l=>l.code)});let n=new AbortController,r=new Set;return{iter:this.runStream(t,n,r),cancel:()=>this.cancelStream(n,t.conversationId),detach:()=>n.abort()}}resumeStream(){let t=new AbortController,n=new Set;this.resumeStatus=void 0;let r=this.resumeStreamGen(t,n,!0),a=()=>t.abort();return{iter:r,cancel:a,detach:a}}async*runStream(t,n,r){(yield*this.drain(this.openMessageStream(t,n.signal),r,n))||(yield*this.resumeStreamGen(n,r,!1))}async*resumeStreamGen(t,n,r){for(let a=1;a<=rs&&!t.signal.aborted;a++){if((!r||a>1)&&(await Mo(ss*a,t.signal),t.signal.aborted))return;let i;try{i=await this.fetchImpl(this.resumeUrl(n.size),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(c){if(t.signal.aborted)return;ee.debug("resume fetch failed \u2014 retrying",{attempt:a,err:c});continue}if(i.status===204||!i.ok){ee.debug("resume \u2192 no in-flight stream",{status:i.status});return}if(!(i.headers.get("content-type")??"").includes("text/event-stream")){let c=await i.json().then(d=>d.status).catch(()=>{});if(ee.debug("resume \u2192 no live stream (status response)",{status:c,attempt:a}),c==="pending"&&a<rs)continue;this.resumeStatus=c==="needs-generation"?"needs-generation":"completed";return}this.resumeStatus="live";let s=n.size;if(yield*this.drain(Lo(i,t.signal),n,t))return;if(n.size===s){ee.debug("resume \u2192 stream closed with no new events; nothing to resume");return}}if(!t.signal.aborted)throw new qe("stream incomplete after resume attempts","server")}async*drain(t,n,r){try{for await(let a of t){if(r.signal.aborted)return!0;if(a.eventId){if(n.has(a.eventId))continue;n.add(a.eventId)}if(yield a,a.chunk.type==="finish"||a.chunk.type==="error")return!0}}catch(a){if(r.signal.aborted)return!0;if(a instanceof qe&&a.status!==void 0)throw a;ee.debug("stream segment dropped",{err:a})}return!1}cancelStream(t,n){t.signal.aborted||(ee.debug("cancel stream",{conversationId:n,visitorId:this.visitorId}),t.abort(),!(!this.visitorId||!n)&&this.fetchImpl(this.url(We.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({})),keepalive:!0}).catch(r=>ee.debug("cancel POST failed (non-fatal)",{err:r})))}async*openMessageStream(t,n){let r=await this.fetchImpl(this.url(We.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"text/event-stream","content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(t)),signal:n});yield*Lo(r,n)}resumeUrl(t){let n=new URL(this.withEnvelopeQuery(We.streamResume));return n.searchParams.set("resumeAt",String(t)),n.toString()}async postJson(t,n,r){let a=await this.fetchWithRetry(()=>[this.url(t),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(n))}],r);return this.assertOk(a,r)}async postForm(t,n,r){let a=await this.fetchImpl(this.url(t),{method:"POST",credentials:"omit",headers:this.opts.auth.headers(),body:this.appendEnvelope(n)});return this.assertOk(a,r)}async getJson(t,n){let r=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.opts.auth.headers()}}],n);return this.assertOk(r,n)}async fetchWithRetry(t,n){for(let r=0;;r++){let[a,i]=t(),l;try{l=await this.fetchImpl(a,i)}catch(c){if(r>=as)throw new qe(`${n} failed: network error`,"network",void 0,c);ee.debug("request network error \u2014 retrying",{label:n,attempt:r}),await Mo(is(r));continue}if(l.ok||!__.has(l.status)||r>=as)return l;let s=u_(l.headers)??is(r);ee.debug("request retryable status \u2014 retrying",{label:n,status:l.status,attempt:r,wait:s}),await Mo(s)}}async assertOk(t,n){if(!t.ok)throw new qe(`${n} failed: ${t.status}`,"server",t.status);return await t.json()}url(t){return/^https?:\/\//i.test(t)?t:`${this.opts.agentApiBaseUrl}${t}`}dataUrl(t){return/^https?:\/\//i.test(t)?t:`${this.opts.dataApiBaseUrl}${t}`}get fetchImpl(){return this.opts.fetchImpl??globalThis.fetch.bind(globalThis)}};function p_(e){return e.includes("webm")?"webm":e.includes("ogg")?"ogg":e.includes("mp4")||e.includes("m4a")?"m4a":e.includes("mpeg")?"mp3":e.includes("wav")?"wav":"bin"}function m_(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.conversationId=="string"}function ls(e,t){let n=e?[{kind:"text",id:"t0",textSig:B(e),doneSig:B(!0)}]:[];return{id:Ue(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:B(n)}}function sn(){return{id:Ue(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:B([])}}function cs(e){let t=Ue();return f_({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function f_(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,canceled:e.canceled,errorText:e.errorText,finishReason:e.finishReason,serverMessageId:e.serverMessageId,ephemeral:e.ephemeral,attachments:e.attachments,partsSig:B(e.parts.map(P_))}}function g_(e){let t=e.parts.map((n,r)=>n.type==="text"?{kind:"text",id:`${e.id}-t${r}`,textSig:B(n.text),doneSig:B(!0)}:n.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${r}`,textSig:B(n.text),doneSig:B(n.state!=="streaming")}:n.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${r}`}:n.type==="file"?{kind:"file",url:n.url,mediaType:n.mediaType}:n.type==="source-url"?{kind:"source",sourceId:n.sourceId,url:n.url,title:n.title}:n.type==="source-document"?{kind:"source",sourceId:n.sourceId,title:n.title,filename:n.filename,mediaType:n.mediaType}:n.type.startsWith("tool-")?{kind:"tool",toolCallId:n.toolCallId,toolName:es(n.type),inputPartialSig:B(""),inputSig:B(n.input),outputSig:B(n.output),errorSig:B(n.errorText),stateSig:B(n.state),approvalSig:B(n.approval)}:null).filter(n=>n!==null);return{id:e.id,role:e.role,serverMessageId:e.id,createdAt:ir(e.createdAt)??Date.now(),status:e.status==="failed"?"error":"complete",canceled:e.status==="canceled",partsSig:B(t)}}var h_=new Set(["completed","failed","canceled"]);function v_(e){return!e.parts.some(t=>t.type==="text"&&t.text.trim()!==""||t.type.startsWith("tool-")||t.type==="file"||t.type==="source-url"||t.type==="source-document")}function b_(e){return e.role==="assistant"&&e.status!=null&&!h_.has(e.status)&&v_(e)}function Do(e){return e.filter(t=>!b_(t)).map(g_)}function ds(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,canceled:e.canceled,errorText:e.errorText,finishReason:e.finishReason,serverMessageId:e.serverMessageId,ephemeral:e.ephemeral,attachments:e.attachments,parts:e.partsSig.value.map(x_)}}function lr(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function cr(e){return lr(e).trim()!==""?!1:!e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function rt(e){return e.role==="assistant"&&e.status!=="streaming"&&cr(e)}function _s(e){return e.canceled===!0&&rt(e)}function P_(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:B(e.text),doneSig:B(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartialSig:B(e.inputPartial),inputSig:B(e.input),outputSig:B(e.output),errorSig:B(e.error),stateSig:B(e.state),approvalSig:B(e.approval)}:e}function x_(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,text:e.textSig.value,done:e.doneSig.value}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartial:e.inputPartialSig.value,input:e.inputSig.value,output:e.outputSig.value,error:e.errorSig.value,state:e.stateSig.value,approval:e.approvalSig.value}:e}var us=J.scope("reducer"),dr=class{constructor(t){q(this,"messagesSig",t);q(this,"active",null);q(this,"openTextParts",new Map);q(this,"partSeq",0)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.openTextParts.clear()}ensureTextPart(t,n,r){let a=`${n}:${r}`,i=this.openTextParts.get(a);if(i)return i;let l={kind:n,id:`${r}#${this.partSeq++}`,textSig:B(""),doneSig:B(!1)};return this.openTextParts.set(a,l),ln(t,l),l}apply(t){let n=this.active;if(n)switch(t.type){case"start":t.messageId&&(n.serverMessageId=t.messageId);return;case"finish-step":this.openTextParts.clear();return;case"start-step":ln(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":us.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":us.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=t.errorText,this.bumpDone(n);return;case"text-start":this.ensureTextPart(n,"text",t.id);return;case"text-delta":{let r=this.ensureTextPart(n,"text",t.id);r.textSig.value+=t.delta;return}case"text-end":this.ensureTextPart(n,"text",t.id).doneSig.value=!0;return;case"reasoning-start":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!1;return;case"reasoning-delta":{let r=this.ensureTextPart(n,"reasoning",t.id);r.textSig.value+=t.delta;return}case"reasoning-end":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!0;return;case"tool-input-start":case"tool-input-delta":case"tool-input-available":case"tool-output-available":case"tool-output-error":case"tool-output-denied":case"tool-approval-request":y_(n,t);return;case"file":ln(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":ps(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":ps(n,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-notification":return;case"data-conversation-rebind":return;default:{let r=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value=[...this.messagesSig.value]}};function bt(e,t,n){let r=e.partsSig.value.find(i=>i.kind==="tool"&&i.toolCallId===t);if(r)return r;let a={kind:"tool",toolCallId:t,toolName:n??"tool",inputPartialSig:B(""),inputSig:B(void 0),outputSig:B(void 0),errorSig:B(void 0),stateSig:B("input-streaming"),approvalSig:B(void 0)};return ln(e,a),a}function ln(e,t){e.partsSig.value=[...e.partsSig.value,t]}function ps(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||ln(e,t)}function y_(e,t){switch(t.type){case"tool-input-start":bt(e,t.toolCallId,t.toolName);return;case"tool-input-delta":{let n=bt(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=bt(e,t.toolCallId,t.toolName);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-approval-request":{let n=bt(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=bt(e,t.toolCallId);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=bt(e,t.toolCallId);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=bt(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}var ms=J.scope("feedback:audio"),_r=class{constructor(){q(this,"ctx",null);q(this,"master",null);q(this,"buffers",new Map)}unlock(){if(this.ctx){this.ctx.state==="suspended"&&this.ctx.resume();return}let t=globalThis.AudioContext??globalThis.webkitAudioContext;if(t)try{this.ctx=new t,this.master=this.ctx.createGain(),this.master.gain.value=1,this.master.connect(this.ctx.destination)}catch(n){ms.warn("AudioContext init failed",{err:n})}}setVolume(t){if(!this.master||!this.ctx)return;let n=Math.max(0,Math.min(1,t));this.master.gain.setTargetAtTime(n,this.ctx.currentTime,.01)}playTone(t){let n=this.ctx,r=this.master;if(!n||!r||n.state!=="running")return;let a=n.currentTime,i=t.noteMs/1e3;t.notes.forEach((l,s)=>{let c=n.createOscillator();c.type=t.type,c.frequency.value=l;let d=n.createGain(),u=a+s*i;d.gain.setValueAtTime(1e-4,u),d.gain.exponentialRampToValueAtTime(t.peakGain,u+.005),d.gain.exponentialRampToValueAtTime(1e-4,u+i),c.connect(d).connect(r),c.start(u),c.stop(u+i+.01)})}async playUrl(t){let n=this.ctx,r=this.master;if(!n||!r||n.state!=="running")return;let a=await this.getBuffer(t);if(!a)return;let i=n.createBufferSource();i.buffer=a,i.connect(r),i.start()}destroy(){this.ctx&&this.ctx.close().catch(()=>{}),this.ctx=null,this.master=null,this.buffers.clear()}async getBuffer(t){if(!this.ctx)return null;let n=this.buffers.get(t);if(n)return n instanceof Promise,n;let r=this.ctx,a=fetch(t).then(i=>i.ok?i.arrayBuffer():Promise.reject(new Error(`fetch ${i.status}`))).then(i=>r.decodeAudioData(i)).then(i=>(this.buffers.set(t,i),i)).catch(i=>(ms.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,a),a}};var fs={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},gs={messageReceived:{notes:[880,1318.51],noteMs:90,type:"sine",peakGain:.45},messageSent:{notes:[1568],noteMs:60,type:"sine",peakGain:.25},error:{notes:[523.25,392],noteMs:120,type:"triangle",peakGain:.55},voiceStart:{notes:[1318.51],noteMs:50,type:"sine",peakGain:.3},voiceStop:{notes:[880],noteMs:50,type:"sine",peakGain:.3}};var ct=null,ur=0;function S_(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function w_(){if(typeof document>"u")return null;let e=document.createElement("input");e.type="checkbox",e.setAttribute("switch",""),e.setAttribute("aria-hidden","true"),e.tabIndex=-1,e.id=`__${x.cssPrefix}_haptic_${Math.random().toString(36).slice(2)}`;let t=document.createElement("label");t.htmlFor=e.id,t.setAttribute("aria-hidden","true");let n="position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;opacity:0!important;pointer-events:none!important;";return e.style.cssText=n,t.style.cssText=n,document.body.append(e,t),{input:e,label:t}}function hs(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(S_())try{navigator.vibrate(e);return}catch{}if(ct||(ct=w_()),!!ct)try{ct.label.click()}catch{}}}function vs(){ur++;let e=!1;return()=>{e||(e=!0,ur=Math.max(0,ur-1),ur===0&&ct&&(ct.input.remove(),ct.label.remove(),ct=null))}}var k_=J.scope("feedback"),C_=100,pr=class{constructor(t,n){q(this,"mutedSig",B(!1));q(this,"audio",new _r);q(this,"releaseHaptics");q(this,"sound");q(this,"haptics");q(this,"lastPlayed",new Map);q(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=vs(),this.audio.setVolume(this.effectiveVolume()),typeof matchMedia<"u"&&(this.reducedMotionMq=matchMedia("(prefers-reduced-motion: reduce)"))}unlock(){this.audio.unlock(),this.audio.setVolume(this.effectiveVolume())}update(t,n){this.sound=t,this.haptics=n,this.audio.setVolume(this.effectiveVolume())}setMuted(t){this.mutedSig.value!==t&&(this.mutedSig.value=t)}toggleMuted(){this.mutedSig.value=!this.mutedSig.value}play(t){this.mutedSig.value||this.isDeduped(t)||(this.lastPlayed.set(t,performance.now()),this.sound.enabled&&this.playSound(t),this.haptics.enabled&&this.isTouchDevice()&&this.playHaptic(t))}destroy(){this.audio.destroy(),this.releaseHaptics()}isDeduped(t){let n=this.lastPlayed.get(t);return n===void 0?!1:performance.now()-n<C_}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(a=>k_.warn("audio play failed",{err:a,url:n}));return}let r=gs[t];r&&this.audio.playTone(r)}playHaptic(t){if(this.reducedMotionMq?.matches)return;let n=this.haptics.events?.[t];if(n===!1)return;let r=n===!0||n===void 0?fs[t]:n;hs(r)}effectiveVolume(){let t=this.sound.volume??.3;return this.reducedMotionMq?.matches?t*.5:t}isTouchDevice(){return typeof window>"u"?!1:matchMedia("(hover: none) and (pointer: coarse)").matches}};function Pt(e,t){return e instanceof qe&&e.status===429?t.errorRateLimited:t.errorGeneric}var T_=0;function o(e,t,n,r,a,i){t||(t={});var l,s,c=t;if("ref"in c)for(s in c={},t)s=="ref"?l=t[s]:c[s]=t[s];var d={type:e,props:c,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--T_,__i:-1,__u:0,__source:a,__self:i};if(typeof e=="function"&&(l=e.defaultProps))for(s in l)c[s]===void 0&&(c[s]=l[s]);return Z.vnode&&Z.vnode(d),d}var $={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},cn=`${x.cssPrefix}-icon-dir`,E_=()=>o("svg",{...$,"aria-hidden":"true",children:o("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})}),Xe=()=>o("svg",{...$,"aria-hidden":"true",children:o("path",{d:"M18 6 6 18M6 6l12 12"})}),bs=()=>o("svg",{...$,"aria-hidden":"true",children:o("path",{d:"M12 5v14M5 12h14"})}),Ps=()=>o("svg",{...$,class:cn,"aria-hidden":"true",children:[o("path",{d:"m22 2-7 20-4-9-9-4Z"}),o("path",{d:"M22 2 11 13"})]}),xs=()=>o("svg",{...$,"aria-hidden":"true",children:o("path",{d:"M12 19V5M5 12l7-7 7 7"})}),ys=()=>o("svg",{...$,class:cn,"aria-hidden":"true",children:o("path",{d:"M3 20V4l18 8-18 8Z"})}),$t=()=>o("svg",{...$,class:cn,"aria-hidden":"true",children:o("path",{d:"m9 18 6-6-6-6"})}),Ss=()=>o("svg",{...$,"aria-hidden":"true",children:o("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),ws=()=>o("svg",{...$,"aria-hidden":"true",children:o("path",{d:"m21 11-9 9a5.5 5.5 0 0 1-7.78-7.78l8.49-8.49a3.67 3.67 0 0 1 5.19 5.19l-8.49 8.49a1.83 1.83 0 0 1-2.6-2.6l7.78-7.78"})}),ks=()=>o("svg",{...$,"aria-hidden":"true",children:[o("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),o("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]}),Cs=()=>o("svg",{...$,"aria-hidden":"true",children:o("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),Ts=()=>o("svg",{...$,"aria-hidden":"true",children:o("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),Es=()=>o("svg",{...$,"aria-hidden":"true",children:o("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),Rs=()=>o("svg",{...$,"aria-hidden":"true",children:o("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),As=()=>o("svg",{...$,"aria-hidden":"true",viewBox:"0 0 10 10",children:o("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),Is=()=>o("svg",{...$,"aria-hidden":"true",children:[o("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),o("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),o("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]}),Ls=()=>o("svg",{...$,"aria-hidden":"true",children:o("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})}),Ms=()=>o("svg",{...$,"aria-hidden":"true",children:o("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),Ns=()=>o("svg",{...$,"aria-hidden":"true",children:[o("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),o("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]}),Ds=()=>o("svg",{...$,class:cn,"aria-hidden":"true",children:o("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),dn=()=>o("svg",{...$,"aria-hidden":"true",children:o("path",{d:"M20 6 9 17l-5-5"})}),Os=()=>o("svg",{...$,"aria-hidden":"true",children:[o("path",{d:"M3 3v6h6"}),o("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),o("path",{d:"M12 7v5l3 2"})]}),$s=()=>o("svg",{...$,"aria-hidden":"true",children:[o("circle",{cx:"12",cy:"12",r:"10"}),o("path",{d:"M2 12h20"}),o("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),_n=()=>o("svg",{...$,class:cn,"aria-hidden":"true",children:o("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),Bs=()=>o("svg",{...$,"aria-hidden":"true",children:[o("path",{d:"M12 20h9"}),o("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),mr=()=>o("svg",{...$,"aria-hidden":"true",children:o("path",{d:"m6 9 6 6 6-6"})}),Hs=()=>o("svg",{...$,"aria-hidden":"true",children:[o("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),o("path",{d:"M14 2v6h6"})]}),R_=()=>o("svg",{...$,"aria-hidden":"true",children:[o("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),o("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]}),Oo=()=>o("svg",{...$,"aria-hidden":"true",children:o("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})}),$o=()=>o("svg",{...$,"aria-hidden":"true",children:[o("circle",{cx:"12",cy:"12",r:"10"}),o("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),o("path",{d:"M12 17h.01"})]}),A_=()=>o("svg",{...$,"aria-hidden":"true",children:[o("path",{d:"m15 4 3 3-9 9-3-3z"}),o("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]}),I_=()=>o("svg",{...$,"aria-hidden":"true",children:[o("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),o("path",{d:"M12 8V4"}),o("circle",{cx:"12",cy:"3",r:"1"}),o("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]}),L_=()=>o("svg",{...$,"aria-hidden":"true",children:[o("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),o("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),o("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),o("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]}),M_=()=>o("svg",{...$,"aria-hidden":"true",children:[o("circle",{cx:"12",cy:"12",r:"10"}),o("circle",{cx:"12",cy:"12",r:"4"}),o("path",{d:"m4.93 4.93 4.24 4.24M14.83 14.83l4.24 4.24M14.83 9.17l4.24-4.24M4.93 19.07l4.24-4.24"})]}),Bo=()=>o("svg",{...$,"aria-hidden":"true",children:[o("circle",{cx:"11",cy:"11",r:"7"}),o("path",{d:"m21 21-4.3-4.3"})]}),zs=()=>o("svg",{...$,"aria-hidden":"true",children:[o("circle",{cx:"12",cy:"12",r:"9"}),o("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Fs=()=>o("svg",{...$,"aria-hidden":"true",children:[o("path",{d:"M3 9.5 12 3l9 6.5"}),o("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]}),Us=()=>o("svg",{...$,"aria-hidden":"true",children:[o("path",{d:"m3 11 15-5v12L3 13z"}),o("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),o("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),o("path",{d:"M21 10a3 3 0 0 1 0 4"})]}),un=()=>o("svg",{...$,"aria-hidden":"true",children:[o("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),o("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}),qs=()=>o("svg",{...$,"aria-hidden":"true",children:[o("circle",{cx:"12",cy:"12",r:"4"}),o("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}),Ws=()=>o("svg",{...$,"aria-hidden":"true",children:o("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),Gs=()=>o("svg",{...$,"aria-hidden":"true",children:[o("circle",{cx:"12",cy:"12",r:"9"}),o("path",{d:"M12 3v18"}),o("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]}),N_=()=>o("svg",{...$,"aria-hidden":"true",children:[o("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),o("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),o("path",{d:"m20 20-4.4-4.4"})]}),D_=()=>o("svg",{...$,"aria-hidden":"true",children:[o("path",{d:"M12 3.5 13.6 9 19 10.5 13.6 12 12 17.5 10.4 12 5 10.5 10.4 9z"}),o("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]}),O_=()=>o("svg",{...$,"aria-hidden":"true",children:[o("path",{d:"M4 18h16"}),o("path",{d:"M5 18a7 7 0 0 1 14 0"}),o("path",{d:"M12 8V6"}),o("path",{d:"M10 6h4"})]}),$_=()=>o("svg",{...$,"aria-hidden":"true",children:[o("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),o("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),o("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),o("path",{d:"M16 9.5a1.5 1.5 0 0 1 3 0v2.5a7 7 0 0 1-7 7 7 7 0 0 1-6.4-4.2L4 12.5a1.5 1.5 0 0 1 2.6-1.5L7 11"})]}),Vs=()=>o("svg",{...$,"aria-hidden":"true",children:o("path",{d:"M14.7 6.3a4 4 0 0 0-5.4 5.3L3 18l3 3 6.4-6.3a4 4 0 0 0 5.3-5.4l-2.7 2.7-2.6-.7-.7-2.6z"})}),Ks=()=>o("svg",{...$,"aria-hidden":"true",children:[o("circle",{cx:"12",cy:"12",r:"9"}),o("path",{d:"M12 7v5l3 2"})]}),js=()=>o("svg",{...$,"aria-hidden":"true",children:[o("circle",{cx:"12",cy:"12",r:"9"}),o("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Xs=()=>o("svg",{...$,"aria-hidden":"true",children:[o("circle",{cx:"12",cy:"12",r:"9"}),o("path",{d:"m15 9-6 6M9 9l6 6"})]}),Ys={chat:E_,message:Oo,bubbles:un,spark:R_,wand:A_,bot:I_,help:$o,lifebuoy:M_,headset:L_,search:N_,sparkles:D_,concierge:O_,wave:$_};var M=x.cssPrefix,w={launcher:`${M}-launcher`,callout:`${M}-callout`,calloutDismiss:`${M}-callout-dismiss`,panel:`${M}-panel`,panelHeader:`${M}-panel-header`,resizeGrip:`${M}-resize-grip`,scrollToBottom:`${M}-scroll-to-bottom`,actionHistory:`${M}-action-history`,actionClose:`${M}-action-close`,langSegment:`${M}-lang-segment`,composer:`${M}-composer`,composerInput:`${M}-composer-input`,composerSend:`${M}-composer-send`,composerStop:`${M}-composer-stop`,composerAttach:`${M}-composer-attach`,composerFileInput:`${M}-composer-file-input`,composerVoice:`${M}-composer-voice`,attachmentChip:`${M}-attachment-chip`,attachmentRemove:`${M}-attachment-remove`,suggestion:`${M}-suggestion`,messageBubble:`${M}-message`,messageRetry:`${M}-message-retry`,historyPane:`${M}-history-pane`,historyBack:`${M}-history-back`,historyItem:`${M}-history-item`,sidebar:`${M}-sidebar`,sidebarToggle:`${M}-sidebar-toggle`,sidebarNewConversation:`${M}-sidebar-new-conversation`,sidebarItem:`${M}-sidebar-item`,messengerHome:`${M}-messenger-home`,modulesEmpty:`${M}-modules-empty`,tab:`${M}-tab`,tabBadge:`${M}-tab-badge`,homeView:`${M}-home-view`,homeGreeting:`${M}-home-greeting`,homeBrand:`${M}-home-brand`,backHeader:`${M}-back-header`,contentView:`${M}-content-view`,contentScroll:`${M}-content-scroll`,homeSearch:`${M}-home-search`,helpSearch:`${M}-help-search`,homeRecent:`${M}-home-recent`,homeContentRow:`${M}-home-content-row`,helpArticle:`${M}-help-article`,newsItem:`${M}-news-item`,formGate:`${M}-form-gate`,formDone:`${M}-form-done`,formDoneToggle:`${M}-form-done-toggle`,formAnswers:`${M}-form-answers`,formFill:`${M}-form-fill`,formSubmit:`${M}-form-submit`,formSkip:`${M}-form-skip`,formField:`${M}-form-field`,toolAskQuestions:`${M}-tool-ask-questions`,toolInputSubmit:`${M}-tool-input-submit`,toolInputSkip:`${M}-tool-input-skip`,toolApproval:`${M}-tool-approval`,toolApprove:`${M}-tool-approve`,toolReject:`${M}-tool-reject`,toolEdit:`${M}-tool-edit`,toolDecision:`${M}-tool-decision`,toolCall:`${M}-tool-call`,source:`${M}-source`};function be(e,t){return`${e}-${t}`}var fr=x.cssPrefix;function Js({onToggle:e,launcher:t,strings:n,leaving:r,edgeTab:a}){let i=t.variant!=="circle"&&!!t.label;return o("button",{type:"button",class:`${fr}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":a?"true":void 0,"data-leaving":r?"true":void 0,"data-testid":w.launcher,onClick:e,"aria-label":n.launcherOpen,children:[B_(t.icon),i?o("span",{class:`${fr}-fab-label`,children:Ee(n,t.label??"")}):null]})}function B_(e){let t=Ys[e];return t?o(t,{}):o(H_,{source:e})}function H_({source:e}){return o("span",{ref:t=>{t&&z_(t,e)},"aria-hidden":"true"})}function z_(e,t){if(e.dataset.svgMounted!==t)try{let r=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;r&&r.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(r,!0)),e.dataset.svgMounted=t)}catch{}}function Qs({callout:e,launcherPosition:t,strings:n,closeLabel:r,onDismiss:a}){let[i,l]=A(!1);return E(()=>{let s=setTimeout(()=>l(!0),e.delayMs);return()=>clearTimeout(s)},[e.delayMs]),E(()=>{if(!i||e.autoDismissMs<=0)return;let s=setTimeout(a,e.autoDismissMs);return()=>clearTimeout(s)},[i,e.autoDismissMs,a]),i?o("div",{class:`${fr}-callout`,role:"status","data-shape":e.shape,"data-position":F_(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":w.callout,children:[o("span",{children:Ee(n,e.text)}),o("button",{type:"button",class:`${fr}-callout-close`,onClick:a,"aria-label":r,title:r,"data-testid":w.calloutDismiss,children:o(Xe,{})})]}):null}function F_(e,t){let n=t.endsWith("-right"),r=t.startsWith("bottom-");return e==="vertical"?r?"top":"bottom":n?"left":"right"}function gr({panelEl:e,resize:t,position:n,initialSize:r,onSizeChange:a,strings:i}){let l=x.cssPrefix,s=D(null);if(E(()=>{if(!e)return;let m=e.style;t.minWidth&&m.setProperty(`--${l}-resize-min-w`,t.minWidth),t.maxWidth&&m.setProperty(`--${l}-resize-max-w`,t.maxWidth),t.minHeight&&m.setProperty(`--${l}-resize-min-h`,t.minHeight),t.maxHeight&&m.setProperty(`--${l}-resize-max-h`,t.maxHeight),r&&(m.setProperty(`--${l}-widget-w`,`${r.width}px`),m.setProperty(`--${l}-widget-h`,`${r.height}px`))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,l,r]),!e)return null;let c=n.startsWith("top-"),d=n.endsWith("-right"),u=`${l}-resize-grip ${l}-resize-grip--${c?"bottom":"top"}-${d?"left":"right"}`,_=m=>{if(!e)return;let C=m.currentTarget,v=e.getBoundingClientRect();s.current={pointerId:m.pointerId,startX:m.clientX,startY:m.clientY,startW:v.width,startH:v.height,dirX:d?-1:1,dirY:c?1:-1},C.setPointerCapture(m.pointerId),e.setAttribute("data-resizing",""),m.preventDefault()},g=m=>{let C=s.current;if(!C||m.pointerId!==C.pointerId||!e)return;let v=(m.clientX-C.startX)*C.dirX,b=(m.clientY-C.startY)*C.dirY;e.style.setProperty(`--${l}-widget-w`,`${C.startW+v}px`),e.style.setProperty(`--${l}-widget-h`,`${C.startH+b}px`)},f=m=>{let C=s.current;if(!C||m.pointerId!==C.pointerId||!e)return;m.currentTarget.releasePointerCapture(m.pointerId),e.removeAttribute("data-resizing");let v=e.getBoundingClientRect();a({width:Math.round(v.width),height:Math.round(v.height)}),s.current=null};return o("div",{class:u,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,title:i.resizeHandle,onPointerDown:_,onPointerMove:g,onPointerUp:f,onPointerCancel:f,"data-testid":w.resizeGrip,children:o(As,{})})}var xt=x.cssPrefix,U_=`.${xt}-header, .${xt}-back-header, .${xt}-home-hero`,q_='button, a, input, textarea, select, [role="tab"], [contenteditable]',Zs=56;function hr(e,t){E(()=>{if(!t||!e)return;let n=c=>Number.parseFloat(c)||0,r=(c,d)=>Math.min(d,Math.max(-d,c)),a=null,i=c=>{let d=c.target;if(!(d instanceof Element)||!d.closest(U_)||d.closest(q_))return;let u=e.getBoundingClientRect();a={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${xt}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${xt}-modal-dy`)),maxX:(window.innerWidth+u.width)/2-Zs,maxY:(window.innerHeight+u.height)/2-Zs},e.dataset.dragging="true",c.preventDefault()},l=c=>{if(!a||c.pointerId!==a.id)return;let d=r(a.dx+c.clientX-a.x,a.maxX),u=r(a.dy+c.clientY-a.y,a.maxY);e.style.setProperty(`--${xt}-modal-dx`,`${d}px`),e.style.setProperty(`--${xt}-modal-dy`,`${u}px`)},s=c=>{!a||c.pointerId!==a.id||(a=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",i),window.addEventListener("pointermove",l),window.addEventListener("pointerup",s),window.addEventListener("pointercancel",s),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s)}},[e,t])}function pn(e,t,n){switch(e){case"clear":case"sound":case"history":case"language":case"theme":case"textSize":return!0;case"expand":return t==="floating";case"fullscreen":return t!=="standalone";case"close":return t==="standalone"||t==="page"?!1:t==="inline"?n==="fullscreen":!0}}function vr(e,t,n){return pn("close",e,t)?n.includes("close"):!1}function el(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var W_='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function br(e){let t=n=>{if(n.key!=="Tab")return;let r=[...e.querySelectorAll(W_)].filter(s=>s.offsetParent!==null||s===document.activeElement);if(r.length===0){n.preventDefault();return}let a=r[0],i=r[r.length-1];if(!a||!i)return;let l=e.getRootNode().activeElement;n.shiftKey&&l===a?(n.preventDefault(),i.focus()):!n.shiftKey&&l===i&&(n.preventDefault(),a.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}function Pr(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var Ho=x.cssPrefix;function tl({agent:e,strings:t}){let n=e.status??"online",r=Ee(t,e.name),a=e.title?Ee(t,e.title):null;return o("div",{class:`${Ho}-agent`,children:[o("div",{class:`${Ho}-agent-avatar`,"data-status":n,children:e.avatar?o("img",{src:e.avatar,alt:""}):o("span",{children:Pr(r)})}),o("div",{class:`${Ho}-agent-meta`,children:[o("strong",{children:r}),a?o("span",{children:a}):null]})]})}var nl=J.scope("attachments");function xr(e,t,n){let r=V_(e),a=[],i=[],l=X_(n.accept),s=t.reduce((d,u)=>d+u.size,0),c=t.length;for(let d of r){let u=G_(d,c,s,n,l);if(u){i.push({file:d,reason:u});continue}a.push(j_(d)),s+=d.size,c+=1}return(a.length||i.length)&&nl.debug("ingest",{accepted:a.length,rejected:i.map(d=>({name:d.file.name,reason:d.reason}))}),{accepted:a,rejected:i}}function zo(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){nl.debug("revokeObjectURL failed",{error:t})}}function G_(e,t,n,r,a){return t>=r.maxCount?"count":n+e.size>r.maxBytes?"bytes":Y_(e,a)?null:"mime"}function V_(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:K_(t)).filter(t=>t!==null):[]}function K_(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function j_(e){return{file:e,id:Ue(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function X_(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean).map(t=>{if(t.startsWith("."))return{kind:"ext",ext:t};let[n="*",r="*"]=t.split("/");return{kind:"mime",type:n,subtype:r}})}function Y_(e,t){if(t.length===0)return!0;let[n="*",r="*"]=(e.type||"").toLowerCase().split("/"),a=(e.name||"").toLowerCase();return t.some(i=>i.kind==="ext"?a.endsWith(i.ext):(i.type==="*"||i.type===n)&&(i.subtype==="*"||i.subtype===r))}var mn=x.cssPrefix;function rl({attachment:e,onRemove:t}){let n=e.mediaType.startsWith("image/");return o("span",{class:`${mn}-attachment-chip`,title:e.name,"data-testid":be(w.attachmentChip,e.id),children:[n?o("img",{class:`${mn}-attachment-thumb`,src:e.previewUrl,alt:""}):o("span",{class:`${mn}-attachment-thumb`,"aria-hidden":"true",children:o(Hs,{})}),o("span",{class:`${mn}-attachment-name`,children:e.name}),o("button",{type:"button",class:`${mn}-attachment-remove`,onClick:t,"aria-label":`Remove ${e.name}`,"data-testid":be(w.attachmentRemove,e.id),children:o(Xe,{})})]})}var Fo={isSupported:!1,start:()=>{},stop:()=>{}};function Uo(e,t,n){return e==="disabled"?Fo:e==="server"?eu(n):J_(t)}function J_(e){let t=Q_();if(!t)return Fo;let n=null;return{isSupported:!0,start(r,a){n=new t,n.continuous=!0,n.interimResults=!0,n.lang=e,n.addEventListener("result",l=>{let s=l,c="",d=!1;for(let u=s.resultIndex;u<s.results.length;u++){let _=s.results[u];_&&(c+=_[0].transcript,_.isFinal&&(d=!0))}r(c,d)});let i=()=>{n=null,a()};n.addEventListener("end",i),n.addEventListener("error",i),n.start()},stop(){n?.stop()}}}function Q_(){let e=globalThis;return e.SpeechRecognition??e.webkitSpeechRecognition}var Z_=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function eu(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return Fo;let t=null,n=null,r=[],a=()=>{for(let i of n?.getTracks()??[])i.stop();n=null};return{isSupported:!0,async start(i,l){try{n=await navigator.mediaDevices.getUserMedia({audio:!0});let s=tu();t=new MediaRecorder(n,s?{mimeType:s}:void 0),r=[],t.addEventListener("dataavailable",c=>{c.data.size>0&&r.push(c.data)}),t.addEventListener("stop",async()=>{let c=t?.mimeType??"audio/webm";a();let d=new Blob(r,{type:c});r=[];try{let{text:u}=await e(d,c);u&&i(u,!0)}catch{}finally{l()}}),t.start()}catch{a(),l()}},stop(){t?.stop()}}}function tu(){for(let e of Z_)if(MediaRecorder.isTypeSupported(e))return e}var Be=x.cssPrefix,yt=J.scope("composer");function Bt(e){return e.reduce((t,n)=>t+n.size,0)}var nu={arrowUp:xs,paperPlane:Ps,send:ys,chevron:$t};function ol({options:e,transport:t,feedback:n,bus:r,isStreaming:a,onSend:i,onStop:l,attachApiRef:s}){let c=e.strings,[d,u]=A(""),[_,g]=A([]),[f,m]=A(!1),C=D(null),v=D(null),b=e.features.files,y=e.features.voice,[P,R]=A(()=>Uo(y,e.locale,(k,X)=>t.transcribe(k,X)));E(()=>{f||y==="disabled"||R(Uo(y,e.locale,(k,X)=>t.transcribe(k,X)))},[e.locale,y,t,f]),E(()=>{let k=C.current;if(!k)return;let X=k.getRootNode(),oe="activeElement"in X?X.activeElement:null;oe&&k.closest(`.${Be}-panel`)?.contains(oe)||k.focus({preventScroll:!0})},[]),E(()=>{let k=C.current;if(k){if(d.length===0){k.style.height="";return}k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,160)}px`}},[d]);let z=D(_);z.current=_,E(()=>()=>z.current.forEach(zo),[]),E(()=>{if(s)return s.current={attachFromDrop:k=>{let X=xr(k,z.current,e.attachments);X.accepted.length!==0&&(yt.info("attach (drop)",{count:X.accepted.length,totalBytes:Bt(X.accepted)}),r.emit("attach",{count:X.accepted.length,totalBytes:Bt(X.accepted)}),g(oe=>[...oe,...X.accepted]))}},()=>{s.current&&(s.current=null)}},[s,e.attachments]),E(()=>{let k=C.current;if(!k)return;let X=k.closest(`.${Be}-panel`);if(!X)return;let oe=ce=>{let _e=ce.clipboardData;if(!_e)return;if(b){let ae=xr(_e.items,z.current,e.attachments);if(ae.accepted.length>0){ce.preventDefault(),yt.info("attach (paste)",{count:ae.accepted.length,totalBytes:Bt(ae.accepted)}),r.emit("attach",{count:ae.accepted.length,totalBytes:Bt(ae.accepted)}),g(Pe=>[...Pe,...ae.accepted]);return}}if(ce.target===k)return;let Ie=_e.getData("text/plain");Ie&&(ce.preventDefault(),u(ae=>ae+Ie),k.focus())};return X.addEventListener("paste",oe),()=>X.removeEventListener("paste",oe)},[b,e.attachments,Be]);let K=()=>{let k=d.trim();!k&&_.length===0||a||(i(k,_),u(""),g([]))},L=k=>{k.key!=="Enter"||k.shiftKey||k.isComposing||(k.preventDefault(),a?l():K())},G=k=>{let X=k.target,oe=xr(X.files,_,e.attachments);oe.accepted.length>0&&(yt.info("attach (file picker)",{count:oe.accepted.length,totalBytes:Bt(oe.accepted)}),r.emit("attach",{count:oe.accepted.length,totalBytes:Bt(oe.accepted)}),g(ce=>[...ce,...oe.accepted])),X.value=""},H=k=>{yt.info("removeAttachment",{id:k}),r.emit("removeAttachment",{id:k}),g(X=>{let oe=X.find(ce=>ce.id===k);return oe&&zo(oe),X.filter(ce=>ce.id!==k)})},j=D(null),Q=()=>{if(P.isSupported){if(f){let k=j.current?Date.now()-j.current:0;yt.info("voiceStop",{durationMs:k}),r.emit("voiceStop",{durationMs:k}),P.stop(),m(!1),n.play("voiceStop"),j.current=null;return}j.current=Date.now(),yt.info("voiceStart"),r.emit("voiceStart",void 0),m(!0),n.play("voiceStart"),P.start((k,X)=>u(oe=>X?`${oe}${k} `:oe),()=>{if(m(!1),j.current){let k=Date.now()-j.current;yt.debug("voiceStop (auto)",{durationMs:k}),r.emit("voiceStop",{durationMs:k}),j.current=null}})}},he=nu[e.composer.sendButton.icon];return o("div",{class:`${Be}-composer`,"data-testid":w.composer,children:[_.length>0?o("div",{class:`${Be}-attachments`,children:_.map(k=>o(rl,{attachment:k,onRemove:()=>H(k.id)},k.id))}):null,o("div",{class:`${Be}-composer-row`,children:[o("div",{class:`${Be}-composer-actions`,children:[b?o("button",{type:"button",class:`${Be}-icon-btn`,onClick:()=>v.current?.click(),"aria-label":c.attach,"data-testid":w.composerAttach,children:o(ws,{})}):null,P.isSupported?o("button",{type:"button",class:`${Be}-icon-btn`,onClick:Q,"aria-label":f?c.micStop:c.micStart,"aria-pressed":f,"data-recording":f?"true":void 0,"data-testid":w.composerVoice,children:o(ks,{})}):null]}),o("textarea",{ref:C,class:`${Be}-textarea`,rows:1,value:d,placeholder:c.composerPlaceholder,onInput:k=>u(k.target.value),onKeyDown:L,"aria-label":c.composerPlaceholder,"data-testid":w.composerInput}),a?o("button",{type:"button",class:`${Be}-send`,onClick:l,"aria-label":c.stop,"data-testid":w.composerStop,children:o(Ss,{})}):o("button",{type:"button",class:`${Be}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:K,disabled:!d.trim()&&_.length===0,"aria-label":c.send,"data-testid":w.composerSend,children:o(he,{})})]}),o("input",{ref:v,type:"file",multiple:!0,accept:e.attachments.accept,onChange:G,class:`${Be}-sr-only`,"data-testid":w.composerFileInput})]})}var ru=x.cssPrefix;function al({visible:e,strings:t}){return e?o("div",{class:`${ru}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function yr({containerRef:e,onDrop:t}){let[n,r]=A(!1);return E(()=>{let a=e.current;if(!a)return;let i=0,l=u=>{i+=1,u.dataTransfer?.types.includes("Files")&&(u.preventDefault(),r(!0))},s=()=>{i-=1,!(i>0)&&(i=0,r(!1))},c=u=>{u.dataTransfer?.types.includes("Files")&&u.preventDefault()},d=u=>{i=0,r(!1),u.dataTransfer&&(u.preventDefault(),t(u.dataTransfer.items))};return a.addEventListener("dragenter",l),a.addEventListener("dragleave",s),a.addEventListener("dragover",c),a.addEventListener("drop",d),()=>{a.removeEventListener("dragenter",l),a.removeEventListener("dragleave",s),a.removeEventListener("dragover",c),a.removeEventListener("drop",d)}},[e,t]),{visible:n}}function il({itemCount:e,initialFocusIndex:t}){let[n,r]=A(!1),a=D(null),i=D(null),[l,s]=A(-1),c=O(()=>{r(!1),s(-1),a.current?.focus()},[]),d=O(()=>r(g=>!g),[]);E(()=>{if(!n)return;let g=f=>{let m=i.current,C=a.current;if(!m||!C)return;let v=f.composedPath();v.includes(m)||v.includes(C)||(r(!1),s(-1))};return document.addEventListener("click",g,!0),()=>document.removeEventListener("click",g,!0)},[n]),E(()=>{if(!n||e===0)return;let g=t?.()??0,f=g<0||g>=e?0:g;s(f)},[n,e,t]),E(()=>{if(!n||l<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[l]?.focus()},[n,l]);let u=O(g=>{(g.key==="ArrowDown"||g.key==="Enter"||g.key===" ")&&(g.preventDefault(),r(!0))},[]),_=O(g=>{if(e!==0)switch(g.key){case"Escape":g.preventDefault(),c();return;case"ArrowDown":g.preventDefault(),s(f=>(f+1)%e);return;case"ArrowUp":g.preventDefault(),s(f=>(f-1+e)%e);return;case"Home":g.preventDefault(),s(0);return;case"End":g.preventDefault(),s(e-1)}},[e,c]);return{open:n,focusIndex:l,triggerRef:a,menuRef:i,toggle:d,close:c,onTriggerKey:u,onMenuKey:_}}function sl({items:e,triggerLabel:t}){let n=x.cssPrefix,r=il({itemCount:e.length}),a=s=>{s.disabled||(s.onSelect?.(),s.keepOpen||r.close())},i=(s,c)=>s.onSelectValue?.(c),l=(s,c)=>{let d=c.segments;if(!d?.length)return;let u=Math.max(0,d.findIndex(g=>g.value===c.value)),_=-1;if(s.key==="ArrowRight"||s.key==="Enter"||s.key===" ")_=(u+1)%d.length;else if(s.key==="ArrowLeft")_=(u-1+d.length)%d.length;else return;s.preventDefault(),s.stopPropagation(),i(c,d[_].value)};return o("div",{class:`${n}-menu-wrap`,children:[o("button",{ref:r.triggerRef,type:"button",class:`${n}-icon-btn`,"aria-label":t,"aria-haspopup":"menu","aria-expanded":r.open,title:t,onClick:r.toggle,onKeyDown:r.onTriggerKey,children:o(Is,{})}),r.open?o("div",{ref:r.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:r.onMenuKey,tabIndex:-1,children:e.map(s=>s.segments?o("div",{role:"menuitem",class:`${n}-menu-item ${n}-menu-item-segmented`,"aria-label":s.label,tabIndex:-1,onKeyDown:c=>l(c,s),children:[s.icon?o("span",{class:`${n}-menu-icon`,children:s.icon}):null,o("span",{class:`${n}-menu-label`,children:s.label}),o("span",{class:`${n}-segmented`,role:"group","aria-label":s.label,children:s.segments.map(c=>{let d=c.value===s.value;return o("button",{type:"button",role:"menuitemradio","aria-checked":d,class:`${n}-segment`,"data-on":d?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${w.langSegment}-${c.value}`,onClick:()=>i(s,c.value),children:c.label},c.value)})})]},s.id):o("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":s.type==="switch"?s.on:void 0,disabled:s.disabled,onClick:()=>a(s),children:[s.icon?o("span",{class:`${n}-menu-icon`,children:s.icon}):null,o("span",{class:`${n}-menu-label`,children:s.label}),s.type==="switch"&&s.on?o("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:o(dn,{})}):null]},s.id))}):null]})}var qo=x.cssPrefix;function ou(e){let t=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)").matches:!0;return e==="auto"?t?"light":"dark":t?e==="light"?"dark":"auto":e==="dark"?"light":"auto"}var au={normal:"large",large:"small",small:"normal"};function iu(e){return e==="light"?o(qs,{}):e==="dark"?o(Ws,{}):o(Gs,{})}function su(e){return(e.split("-")[0]??e).toUpperCase()}function Ye({panelProps:e,variant:t}){let{options:n,panelSize:r,feedback:a,onClose:i,onClear:l,onExpand:s,onFullscreen:c,onSoundToggle:d}=e,{onToggleHistory:u,onLocaleChange:_,onThemeChange:g,onTextSizeChange:f}=e,m=n.strings,C=n.mode,v=t==="chat",b=Y(()=>a.mutedSig.value).value,y=new Set(n.actions),P=k=>y.has(k),R=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,z=k=>R?!1:pn(k,C,r),K=n.themeMode,L={auto:m.themeAuto,light:m.themeLight,dark:m.themeDark},G=n.textSize,H={small:m.textSizeSmall,normal:m.textSizeNormal,large:m.textSizeLarge},j=[];if(v&&P("clear")&&j.push({id:"clear",icon:o(Bs,{}),label:m.newConversation,onSelect:l}),P("expand")&&z("expand")){let k=r==="expanded";j.push({id:"expand",icon:k?o(Ts,{}):o(Cs,{}),label:k?m.collapse:m.expand,type:"switch",on:k,onSelect:s})}if(P("fullscreen")&&z("fullscreen")){let k=r==="fullscreen";j.push({id:"fullscreen",icon:k?o(Rs,{}):o(Es,{}),label:k?m.exitFullscreen:m.fullscreen,type:"switch",on:k,onSelect:c})}v&&P("sound")&&j.push({id:"sound",icon:b?o(Ms,{}):o(Ls,{}),label:b?m.soundOff:m.soundOn,type:"switch",on:!b,onSelect:d}),P("theme")&&j.push({id:"theme",icon:iu(K),label:`${m.theme}: ${L[K]}`,onSelect:()=>g(ou(K)),keepOpen:!0}),P("textSize")&&j.push({id:"textSize",icon:o(Ns,{}),label:`${m.textSize}: ${H[G]}`,onSelect:()=>f(au[G]),keepOpen:!0}),P("language")&&n.availableLocales.length>1&&j.push({id:"language",icon:o($s,{}),label:m.language,segments:n.availableLocales.map(k=>({value:k,label:su(k),lang:k})),value:n.locale,onSelectValue:_});let Q=!!i&&vr(C,r,n.actions),he=v&&P("history");return o("div",{class:`${qo}-header-actions`,children:[he?o("button",{type:"button",class:`${qo}-icon-btn`,onClick:u,"aria-label":m.history,title:m.history,"data-testid":w.actionHistory,children:o(Os,{})}):null,j.length>0?o(sl,{items:j,triggerLabel:m.moreActions}):null,Q?o("button",{type:"button",class:`${qo}-icon-btn`,onClick:i,"aria-label":m.close,title:m.close,"data-testid":w.actionClose,children:o(Xe,{})}):null]})}var lu=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,cu=/^https?:\/\/[^\s.]+\.[^\s]+$/i,du=/^[+]?[\d\s().-]{6,}$/;function Ht(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>String(t[r]??`{${r}}`))}function _u(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function uu(e,t,n){let r=e.required??!0,a=e.validation;if(e.type==="multiselect"){let l=_u(t);return r&&l===0?n.formRequired:l===0?void 0:a?.minSelections!=null&&l<a.minSelections?Ht(n.formChooseAtLeast,{min:a.minSelections}):a?.maxSelections!=null&&l>a.maxSelections?Ht(n.formChooseAtMost,{max:a.maxSelections}):void 0}let i=typeof t=="string"?t.trim():"";if(!i)return r?n.formRequired:void 0;switch(e.type){case"email":if(!lu.test(i))return n.formInvalidEmail;break;case"url":if(!cu.test(i))return n.formInvalidUrl;break;case"tel":if(!du.test(i))return n.formInvalidTel;break;case"number":{let l=Number(i);if(!Number.isFinite(l))return n.formInvalidNumber;if(a?.min!=null&&l<a.min)return Ht(n.formNumberTooSmall,{min:a.min});if(a?.max!=null&&l>a.max)return Ht(n.formNumberTooLarge,{max:a.max});break}default:break}if(a?.minLength!=null&&i.length<a.minLength)return Ht(n.formTooShort,{min:a.minLength});if(a?.maxLength!=null&&i.length>a.maxLength)return Ht(n.formTooLong,{max:a.maxLength});if(a?.pattern)try{if(!new RegExp(a.pattern).test(i))return n.formPatternMismatch}catch{}}function ll(e,t,n){let r={};for(let a of e){let i=uu(a,t[a.name],n);i&&(r[a.name]=i)}return r}function cl(e){let t={};for(let[n,r]of Object.entries(e)){let a=Array.isArray(r)?r.join(", "):r;a&&a.trim()&&(t[n]=a.trim())}return t}var de=x.cssPrefix,Sr="__other__";function wr({fields:e,strings:t,submitLabel:n,onSubmit:r,skipLabel:a,onSkip:i,footerHint:l,submitOnEnter:s,disabled:c,rootTestId:d,submitTestId:u,skipTestId:_}){let[g,f]=A(()=>gu(e)),[m,C]=A({}),[v,b]=A({}),y=L=>{v[L]&&b(G=>({...G,[L]:""}))},P=(L,G)=>{f(H=>({...H,[L]:G})),y(L)},R=(L,G)=>{C(H=>({...H,[L]:G})),y(L)},z=L=>{if(L.preventDefault(),c)return;let G=hu(e,g,m),H=ll(e,G,t);if(Object.keys(H).length>0){b(H);return}r(cl(G))},K=L=>{!s||L.key!=="Enter"||L.shiftKey||L.isComposing||L.target?.tagName==="TEXTAREA"&&z(L)};return o("form",{class:`${de}-form`,onSubmit:z,onKeyDown:K,"data-testid":d,noValidate:!0,children:[e.map(L=>o(pu,{field:L,value:g[L.name],otherText:m[L.name]??"",error:v[L.name],disabled:c,strings:t,onChange:G=>P(L.name,G),onOtherChange:G=>R(L.name,G)},L.name)),o("div",{class:`${de}-form-actions`,children:[l?o("span",{class:`${de}-form-hint`,children:l}):null,a&&i?o("button",{type:"button",class:`${de}-form-skip`,onClick:i,disabled:c,"data-testid":_,children:a}):null,o("button",{type:"submit",class:`${de}-form-submit`,disabled:c,"data-testid":u,children:n})]})]})}function pu({field:e,value:t,otherText:n,error:r,disabled:a,strings:i,onChange:l,onOtherChange:s}){let c=be(w.formField,e.name),d=mu({field:e,value:t,otherText:n,disabled:a,strings:i,onChange:l,onOtherChange:s,fieldTid:c});return o("label",{class:`${de}-field`,"data-field":e.name,"data-invalid":r?"true":void 0,children:[o("span",{class:`${de}-field-label`,children:[e.label,e.required??!0?o("span",{class:`${de}-field-req`,"aria-hidden":"true",children:" *"}):null]}),d,e.validationHint&&!r?o("span",{class:`${de}-field-hint`,children:e.validationHint}):null,r?o("span",{class:`${de}-field-error`,role:"alert",children:r}):null]})}function mu(e){let{field:t,value:n,otherText:r,disabled:a,strings:i,onChange:l,onOtherChange:s,fieldTid:c}=e,d=typeof n=="string"?n:"";switch(t.type){case"textarea":return o("textarea",{class:`${de}-field-input`,rows:3,value:d,placeholder:t.placeholder,disabled:a,onInput:u=>l(u.target.value),"data-testid":c});case"select":return o("select",{class:`${de}-field-input`,value:d,disabled:a,onChange:u=>l(u.target.value),"data-testid":c,children:[o("option",{value:"",children:t.placeholder??"\u2014"}),(t.options??[]).map(u=>o("option",{value:u.value,children:u.label??u.value},u.value))]});case"radio":{let u=t.allowOther&&d===Sr;return o("div",{class:`${de}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(_=>o("label",{class:`${de}-choice`,children:[o("input",{type:"radio",name:`${de}-${t.name}`,checked:d===_.value,disabled:a,onChange:()=>l(_.value)}),o("span",{children:_.label??_.value})]},_.value)),t.allowOther?o("label",{class:`${de}-choice`,children:[o("input",{type:"radio",name:`${de}-${t.name}`,checked:d===Sr,disabled:a,onChange:()=>l(Sr)}),o("span",{children:i.formOther})]}):null,u?o("input",{class:`${de}-field-input`,value:r,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:_=>s(_.target.value)}):null]})}case"checkbox":return o("label",{class:`${de}-choice`,children:[o("input",{type:"checkbox",checked:d==="true",disabled:a,onChange:u=>l(u.target.checked?"true":""),"data-testid":c}),o("span",{children:t.placeholder??t.label})]});case"multiselect":{let u=Array.isArray(n)?n:[],_=(g,f)=>l(f?[...u,g]:u.filter(m=>m!==g));return o("div",{class:`${de}-field-choices`,"data-testid":c,children:[(t.options??[]).map(g=>o("label",{class:`${de}-choice`,children:[o("input",{type:"checkbox",checked:u.includes(g.value),disabled:a,onChange:f=>_(g.value,f.target.checked)}),o("span",{children:g.label??g.value})]},g.value)),t.allowOther||(t.options??[]).length===0?o("textarea",{class:`${de}-field-input`,rows:2,value:r,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:g=>s(g.target.value)}):null]})}default:return o("input",{class:`${de}-field-input`,type:fu(t.type),value:d,placeholder:t.placeholder,disabled:a,onInput:u=>l(u.target.value),"data-testid":c})}}function fu(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function gu(e){let t={};for(let n of e)n.defaultValue!=null&&(t[n.name]=n.type==="multiselect"?n.defaultValue.split(",").map(r=>r.trim()).filter(Boolean):n.defaultValue);return t}function hu(e,t,n){let r={...t};for(let a of e){let i=n[a.name]?.trim();if(a.type==="radio"&&a.allowOther&&t[a.name]===Sr)r[a.name]=i??"";else if(a.type==="multiselect"&&i){let l=i.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),s=Array.isArray(t[a.name])?t[a.name]:[];r[a.name]=[...s,...l]}}return r}var Je=x.cssPrefix;function Wo({form:e,strings:t,onSubmit:n,onSkip:r}){return o("div",{class:`${Je}-form-gate`,"data-testid":w.formGate,children:[e.title?o("h3",{class:`${Je}-form-gate-title`,children:e.title}):null,e.description?o("p",{class:`${Je}-form-gate-desc`,children:e.description}):null,o(wr,{fields:e.fields,strings:t,submitLabel:e.submitLabel??t.formSubmit,onSubmit:n,skipLabel:e.skippable?t.formSkip:void 0,onSkip:e.skippable?r:void 0,submitTestId:w.formSubmit,skipTestId:w.formSkip})]})}function dl({marker:e,strings:t,onFill:n}){let r=e.outcome==="skipped",a=r?t.formSkipped:t.formSubmitted,i=e.title?o(te,{children:[o("span",{children:e.title}),o("span",{class:`${Je}-sr-only`,children:a})]}):o("span",{children:a}),l=e.form?.reviewable??!1,s=!r&&l&&e.values&&Object.keys(e.values).length>0?e.values:null;if(s){let c=d=>e.form?.fields.find(u=>u.name===d)?.label??d;return o("details",{class:`${Je}-form-done`,"data-outcome":e.outcome,"data-testid":w.formDone,children:[o("summary",{class:`${Je}-form-done-summary`,"data-testid":w.formDoneToggle,children:[o(dn,{}),i,o($t,{})]}),o("dl",{class:`${Je}-form-answers`,"data-testid":w.formAnswers,children:Object.entries(s).map(([d,u])=>o("div",{class:`${Je}-form-answer`,children:[o("dt",{children:c(d)}),o("dd",{children:u})]},d))})]})}return o("div",{class:`${Je}-form-done`,"data-outcome":e.outcome,"data-testid":w.formDone,role:"status",children:[r?o(Ds,{}):o(dn,{}),i,r&&e.form?.reopenable&&n?o("button",{type:"button",class:`${Je}-form-done-fill`,"data-testid":w.formFill,onClick:n,children:t.formFillOut}):null]})}function _l(e){if(!e)return!1;let t=e.startsWith("tool:")?e.slice(5):e;return t==="ask-user-questions"||t==="ask_user_questions"}var Ko=1,pl=2,ml=4,fl=8,gl=16;function vu(e){switch(e){case Ko:return"href";case pl:return"src";case ml:return"class";case fl:return"checked";case gl:return"start"}}var bu=e=>{switch(e){case 1:return 3;case 2:return 4;case 3:return 5;case 4:return 6;case 5:return 7;default:return 8}},Pu=bu;var ul=24;function Xo(e){let t=new Uint32Array(ul);return t[0]=1,{renderer:e,text:"",pending:"",tokens:t,len:0,token:1,fence_end:0,blockquote_idx:0,hr_char:"",hr_chars:0,fence_start:0,spaces:new Uint8Array(ul),indent:"",indent_len:0,table_state:0}}function hl(e){e.pending.length>0&&Ce(e,`
|
|
12
|
+
`)}function ne(e){e.text.length!==0&&(console.assert(e.len>0,"Never adding text to root"),e.renderer.add_text(e.renderer.data,e.text),e.text="")}function me(e){console.assert(e.len>0,"No nodes to end"),e.len-=1,e.token=e.tokens[e.len],e.renderer.end_token(e.renderer.data)}function re(e,t){(e.tokens[e.len]===24||e.tokens[e.len]===23)&&t!==25&&me(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function xu(e,t,n){for(;n<=e.len;){if(e.tokens[n]===t)return n;n+=1}return-1}function St(e,t){for(e.fence_start=0;e.len>t;)me(e)}function kr(e,t){let n=0;for(let r=0;r<=e.len&&(t-=e.spaces[r],!(t<0));r+=1)switch(e.tokens[r]){case 9:case 10:case 20:case 25:n=r;break}for(;e.len>n;)me(e);return t}function Go(e,t){let n=-1,r=-1;for(let a=e.blockquote_idx+1;a<=e.len;a+=1)if(e.tokens[a]===25){if(e.indent_len<e.spaces[a]){r=-1;break}r=a}else e.tokens[a]===t&&(n=a);return r===-1?n===-1?(St(e,e.blockquote_idx),re(e,t),!0):(St(e,n),!1):(St(e,r),re(e,t),!0)}function Vo(e,t){re(e,25),e.spaces[e.len]=e.indent_len+t,ot(e),e.token=103}function ot(e){e.indent="",e.indent_len=0,e.pending=""}function jo(e){switch(e){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return!0;default:return!1}}function yu(e){switch(e){case 32:case 58:case 59:case 41:case 44:case 33:case 46:case 63:case 93:case 10:return!0;default:return!1}}function Su(e){return jo(e)||yu(e)}function Ce(e,t){for(let n of t){if(e.token===101){switch(n){case" ":e.indent_len+=1;continue;case" ":e.indent_len+=4;continue}let a=kr(e,e.indent_len);e.indent_len=0,e.token=e.tokens[e.len],a>0&&Ce(e," ".repeat(a))}let r=e.pending+n;switch(e.token){case 21:case 1:case 20:case 24:case 23:switch(console.assert(e.text.length===0,"Root should not have any text"),e.pending[0]){case void 0:e.pending=n;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=1;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=4;continue;case`
|
|
13
|
+
`:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){me(e),ot(e),e.pending=n;continue}St(e,e.blockquote_idx),ot(e),e.blockquote_idx=0,e.fence_start=0,e.pending=n;continue;case"#":switch(n){case"#":if(e.pending.length<6){e.pending=r;continue}break;case" ":kr(e,e.indent_len),re(e,Pu(e.pending.length)),ot(e);continue}break;case">":{let i=xu(e,20,e.blockquote_idx+1);i===-1?(St(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,re(e,20)):e.blockquote_idx=i,ot(e),e.pending=n;continue}case"-":case"*":case"_":if(e.hr_chars===0&&(console.assert(e.pending.length===1,"Pending should be one character"),e.hr_chars=1,e.hr_char=e.pending),e.hr_chars>0){switch(n){case e.hr_char:e.hr_chars+=1,e.pending=r;continue;case" ":e.pending=r;continue;case`
|
|
14
|
+
`:if(e.hr_chars<3)break;kr(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),ot(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){Go(e,23),Vo(e,2),Ce(e,r.slice(2));continue}break;case"`":if(e.pending.length<3){if(n==="`"){e.pending=r,e.fence_start=r.length;continue}e.fence_start=0;break}switch(n){case"`":e.pending.length===e.fence_start?(e.pending=r,e.fence_start=r.length):(re(e,2),ot(e),e.fence_start=0,Ce(e,r));continue;case`
|
|
15
|
+
`:{kr(e,e.indent_len),re(e,10),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,ml,e.pending.slice(e.fence_start)),ot(e),e.token=101;continue}default:e.pending=r;continue}case"+":if(n!==" ")break;Go(e,23),Vo(e,2);continue;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":if(e.pending[e.pending.length-1]==="."){if(n!==" ")break;Go(e,24)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,gl,e.pending.slice(0,-1)),Vo(e,e.pending.length+1);continue}else{let i=n.charCodeAt(0);if(i===46||jo(i)){e.pending=r;continue}}break;case"|":St(e,e.blockquote_idx),re(e,27),re(e,28),e.pending="",Ce(e,n);continue}let a=r;if(e.token===21)e.token=e.tokens[e.len],e.renderer.add_token(e.renderer.data,21),e.renderer.end_token(e.renderer.data);else if(e.indent_len>=4){let i=0;for(;i<4;i+=1)if(e.indent[i]===" "){i=i+1;break}a=e.indent.slice(i)+r,re(e,9)}else re(e,2);ot(e),Ce(e,a);continue;case 27:if(e.table_state===1)switch(n){case"-":case" ":case"|":case":":e.pending=r;continue;case`
|
|
16
|
+
`:e.table_state=2,e.pending="";continue;default:me(e),e.table_state=0;break}else switch(e.pending){case"|":re(e,28),e.pending="",Ce(e,n);continue;case`
|
|
17
|
+
`:me(e),e.pending="",e.table_state=0,Ce(e,n);continue}break;case 28:switch(e.pending){case"":break;case"|":re(e,29),me(e),e.pending="",Ce(e,n);continue;case`
|
|
18
|
+
`:me(e),e.table_state=Math.min(e.table_state+1,2),e.pending="",Ce(e,n);continue;default:re(e,29),Ce(e,n);continue}break;case 29:if(e.pending==="|"){ne(e),me(e),e.pending="",Ce(e,n);continue}break;case 9:switch(r){case`
|
|
19
19
|
`:case`
|
|
20
20
|
`:case`
|
|
21
21
|
`:case`
|
|
@@ -25,16 +25,16 @@ ${i}`:i;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(!t||t==="[DONE]")
|
|
|
25
25
|
`:case`
|
|
26
26
|
`:case`
|
|
27
27
|
`:case`
|
|
28
|
-
`:e.pending=
|
|
29
|
-
`:if(
|
|
30
|
-
`){e.pending=
|
|
31
|
-
`:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,
|
|
32
|
-
`?(
|
|
33
|
-
`||n==="\\"?(e.renderer.set_attr(e.renderer.data,
|
|
34
|
-
`:e.pending=n;continue;default:let
|
|
35
|
-
`:switch(e.token){case 19:case 30:case 31:break;case 3:case 4:case 5:case 6:case 7:case 8:
|
|
36
|
-
`?"":n,e.pending="");continue;case"_":case"*":{if(e.token===19||e.token===30||e.token===31||e.token===14)break;let
|
|
37
|
-
`){
|
|
38
|
-
`){
|
|
39
|
-
`){te(e),ne(e,16),e.pending=n;continue}}break;case"$":if(e.token!==19&&e.token!==16&&e.pending==="$")if(n==="$"){e.token=105,e.pending=o;continue}else{if(ku(n.charCodeAt(0)))break;te(e),ne(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){te(e),ne(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){te(e),ne(e,19),e.pending="";continue}break;case" ":if(e.pending.length===1&&n===" ")continue;break}if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n==="h"&&(e.pending===" "||e.pending==="")){e.text+=e.pending,e.pending=n,e.token=102;continue}e.text+=e.pending,e.pending=n}te(e)}function Xr(e){return{add_token:Cu,end_token:Tu,add_text:Eu,set_attr:Ru,data:{nodes:[e,,,,,],index:0}}}function Cu(e,t){let n=e.nodes[e.index],o;switch(t){case 1:return;case 20:o=document.createElement("blockquote");break;case 2:o=document.createElement("p");break;case 21:o=document.createElement("br");break;case 22:o=document.createElement("hr");break;case 3:o=document.createElement("h1");break;case 4:o=document.createElement("h2");break;case 5:o=document.createElement("h3");break;case 6:o=document.createElement("h4");break;case 7:o=document.createElement("h5");break;case 8:o=document.createElement("h6");break;case 12:case 13:o=document.createElement("em");break;case 14:case 15:o=document.createElement("strong");break;case 16:o=document.createElement("s");break;case 11:o=document.createElement("code");break;case 18:case 17:o=document.createElement("a");break;case 19:o=document.createElement("img");break;case 23:o=document.createElement("ul");break;case 24:o=document.createElement("ol");break;case 25:o=document.createElement("li");break;case 26:let i=o=document.createElement("input");i.type="checkbox",i.disabled=!0;break;case 9:case 10:n=n.appendChild(document.createElement("pre")),o=document.createElement("code");break;case 27:o=document.createElement("table");break;case 28:switch(n.children.length){case 0:n=n.appendChild(document.createElement("thead"));break;case 1:n=n.appendChild(document.createElement("tbody"));break;default:n=n.children[1]}o=document.createElement("tr");break;case 29:o=document.createElement(n.parentElement?.tagName==="THEAD"?"th":"td");break;case 30:o=document.createElement("equation-block");break;case 31:o=document.createElement("equation-inline");break}e.nodes[++e.index]=n.appendChild(o)}function Tu(e){e.index-=1}function Eu(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function Ru(e,t,n){e.nodes[e.index].setAttribute(Pu(t),n)}function Eo({textSig:e,doneSig:t}){let n=O(null);return ht(()=>{let o=n.current;if(!o)return;o.classList.add(`${x.cssPrefix}-md`);let i=Xr(o),a=Yr(i),l=0,s=nt(()=>{let u=e.value,_=t.value;u.length<l&&(o.replaceChildren(),i=Xr(o),a=Yr(i),l=0);let g=u.slice(l);g&&Ce(a,g),l=u.length,_&&vl(a)}),c=new MutationObserver(u=>{for(let _ of u)for(let g of _.addedNodes){if(!(g instanceof HTMLElement))continue;let f=g.matches?.("a")?[g]:[...g.querySelectorAll?.("a")??[]];for(let m of f)bl(m)}});c.observe(o,{childList:!0,subtree:!0});for(let u of o.querySelectorAll("a"))bl(u);let d=u=>{let _=u.target?.closest?.("a");if(!_||!(_ instanceof HTMLAnchorElement))return;let g=_.getAttribute("href")??"";!g||g.startsWith("#")||(u.preventDefault(),window.open(g,"_blank","noopener,noreferrer"))};return o.addEventListener("click",d),()=>{s(),c.disconnect(),o.removeEventListener("click",d)}},[e,t]),r("div",{ref:n})}function Pl({text:e}){let t=Re(()=>H(e),[e]),n=Re(()=>H(!0),[]);return r(Eo,{textSig:t,doneSig:n})}function bl(e){let t=e.getAttribute("href")??"";if(!t||t.startsWith("#"))return;e.target!=="_blank"&&(e.target="_blank");let n=new Set((e.rel||"").split(/\s+/).filter(Boolean));n.add("noopener"),n.add("noreferrer"),e.rel=[...n].join(" ")}var Ft=x.cssPrefix;function xl({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?r("a",{class:`${Ft}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":w.source,children:[r("span",{class:`${Ft}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),r("span",{class:`${Ft}-source-label`,children:n})]}):r("span",{class:`${Ft}-source`,"data-testid":w.source,children:[r("span",{class:`${Ft}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),r("span",{class:`${Ft}-source-label`,children:n})]})}var it=x.cssPrefix;function Ro(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function Ao(e,t){let n=e==="output-available"||e==="output-error"||e==="output-denied",o=e==="approval-responded"||t?.approved!==void 0;return{terminal:n,responded:o,decided:n||o}}function Iu(e,t){return e==="output-error"?"error":e==="output-denied"||t?.approved===!1?"denied":e==="output-available"?"completed":e==="approval-responded"||t?.approved===!0?"responded":e==="approval-requested"?"awaiting":"running"}function Lu({status:e}){return e==="denied"||e==="error"||e==="superseded"?r(Xs,{}):e==="completed"||e==="responded"?r(Ys,{}):r(js,{})}function Mu(e,t){switch(e){case"awaiting":return t.statusAwaiting;case"responded":return t.statusResponded;case"completed":return t.statusCompleted;case"denied":return t.statusDenied;case"error":return t.statusError;case"superseded":return t.statusSuperseded;default:return t.statusRunning}}function Nu({state:e,approval:t,strings:n,superseded:o}){let i=Iu(e,t),a=o&&(i==="awaiting"||i==="running")?"superseded":i;return r("span",{class:`${it}-toolui-badge ${it}-toolui-status`,"data-status":a,children:[r("span",{class:`${it}-toolui-status-icon`,children:r(Lu,{status:a})}),Mu(a,n)]})}function Io({name:e,state:t,approval:n,strings:o,superseded:i}){return r(ee,{children:[r("span",{class:`${it}-toolui-wrench`,children:r(Ks,{})}),r("strong",{class:`${it}-toolui-title`,children:e}),r(Nu,{state:t,approval:n,strings:o,superseded:i}),r("span",{class:`${it}-toolui-chevron`,children:r(go,{})})]})}function dt({label:e,value:t,error:n}){let o=n?String(t??""):Lo(Jr(t));return o?r("div",{class:`${it}-toolui-section`,children:[r("span",{class:`${it}-toolui-label`,children:e}),r("pre",{class:`${it}-toolui-code`,"data-error":n?"true":void 0,children:o})]}):null}function Jr(e){if(e&&typeof e=="object"){let t=e;if(t.storage==="tool-result-ref"&&"summary"in t)return t.summary}return e}function Lo(e){if(e==null)return"";try{let t=typeof e=="string"?e:JSON.stringify(e,null,2);return!t||t==="{}"||t==="[]"||t==='""'?"":t.length>800?`${t.slice(0,800)}\u2026`:t}catch{return""}}var Ae=x.cssPrefix;function yl({part:e,strings:t,active:n,superseded:o=!1,onDecision:i,onEdit:a}){let l=j(()=>e.approvalSig.value),s=j(()=>e.stateSig.value),c=j(()=>e.inputSig.value),d=j(()=>e.outputSig.value),u=j(()=>e.errorSig.value),_=Ro(e.toolName),g=l.value?.approved,{terminal:f,responded:m,decided:C}=Ao(s.value,l.value),v=m&&n&&!f,b=o&&!C,y=e.toolCallId;return r("div",{class:`${Ae}-toolui-group`,"data-testid":C?w.toolDecision:w.toolApproval,children:[r("details",{class:`${Ae}-toolui ${Ae}-toolui-collapsible`,children:[r("summary",{class:`${Ae}-toolui-head`,children:r(Io,{name:_,state:s.value,approval:l.value,strings:t,superseded:b})}),r(dt,{label:t.toolParameters,value:c.value}),d.value!==void 0?r(dt,{label:t.toolResult,value:d.value}):null,u.value?r(dt,{label:t.statusError,value:u.value,error:!0}):null]}),b||f?null:r("div",{class:`${Ae}-toolui ${Ae}-toolui-body`,children:[m?r(ee,{children:[r("p",{class:`${Ae}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",g?t.approve:t.reject),l.value?.reason?` \u2014 ${l.value.reason}`:""]}),v?r("p",{class:`${Ae}-toolui-subtle`,children:t.approvalEditHint}):null,!v&&!f?r("p",{class:`${Ae}-toolui-subtle`,children:t.approvalSubmitting}):null]}):r(ee,{children:[r("p",{class:`${Ae}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",_)}),r("p",{class:`${Ae}-toolui-subtle`,children:t.approvalBody})]}),!C&&n?r("div",{class:`${Ae}-toolui-actions`,children:[r("button",{type:"button",class:`${Ae}-form-skip`,onClick:()=>i(y,!1),"data-testid":w.toolReject,children:t.reject}),r("button",{type:"button",class:`${Ae}-form-submit`,onClick:()=>i(y,!0),"data-testid":w.toolApprove,children:t.approve})]}):v?r("div",{class:`${Ae}-toolui-actions`,children:r("button",{type:"button",class:`${Ae}-form-skip`,onClick:()=>a(y),"data-testid":w.toolEdit,children:t.edit})}):null]})]})}function wl(e){let t=e&&typeof e=="object"?e:{},n=t.responseType;return{title:fn(t.title),question:fn(t.question)??"Please provide the missing information.",description:fn(t.description),placeholder:fn(t.placeholder),responseType:n==="single-choice"||n==="multi-choice"||n==="confirmation"||n==="free-text"?n:"free-text",choices:Array.isArray(t.choices)?t.choices:void 0,allowOther:typeof t.allowOther=="boolean"?t.allowOther:void 0,required:typeof t.required=="boolean"?t.required:!0,defaultValues:Array.isArray(t.defaultValues)?t.defaultValues.filter(o=>typeof o=="string"):void 0,minSelections:Sl(t.minSelections),maxSelections:Sl(t.maxSelections),validationHint:fn(t.validationHint)}}function kl(e){if(e.responseType==="confirmation")return[];let t=(e.choices??[]).map(Ou).filter(i=>i!==null),n="textarea";e.responseType==="single-choice"&&t.length>0?n="radio":e.responseType==="multi-choice"&&(n="multiselect");let o=n==="multiselect"?e.defaultValues?.join(", "):e.defaultValues?.[0];return[{name:"answer",label:e.question,type:n,placeholder:e.placeholder,required:e.required??!0,defaultValue:o,options:t.length>0?t:void 0,allowOther:e.allowOther,validationHint:e.validationHint,validation:n==="multiselect"?{minSelections:e.minSelections,maxSelections:e.maxSelections}:void 0}]}function Ou(e){return typeof e=="string"?e?{value:e,label:e}:null:e&&typeof e.value=="string"&&e.value?{value:e.value,label:e.label??e.value,description:e.description}:null}function fn(e){return typeof e=="string"&&e.trim()?e.trim():void 0}function Sl(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}var oe=x.cssPrefix;function Du(e,t){switch(e.responseType){case"single-choice":return t.respSingleChoice;case"multi-choice":return t.respMultiChoice;case"confirmation":return t.respConfirmation;default:return t.respFreeText}}function Cl({part:e,strings:t,active:n,superseded:o=!1,onSubmit:i,onDecision:a,onEdit:l}){let s=j(()=>e.stateSig.value),c=j(()=>e.approvalSig.value),d=j(()=>wl(e.inputSig.value)),{terminal:u,responded:_,decided:g}=Ao(s.value,c.value),f=c.value!==void 0,m=(b,y)=>{f?a(e.toolCallId,y,b):d.value.responseType==="confirmation"?i(e.toolCallId,{confirmed:y}):i(e.toolCallId,y?{answer:b}:{})},C=d.value;if(g)return r(Bu,{part:e,strings:t,req:C,editable:_&&n&&!u,onEdit:()=>l(e.toolCallId)});let v=o;return r("div",{class:`${oe}-toolui${v?` ${oe}-toolui-stale`:""}`,"data-testid":w.toolAskInput,children:[r("div",{class:`${oe}-toolui-head`,children:v?r(ee,{children:[r("span",{class:`${oe}-toolui-badge ${oe}-toolui-badge-accent`,children:t.inputBadge}),r("span",{class:`${oe}-toolui-badge ${oe}-toolui-badge-muted`,children:t.statusSuperseded})]}):r(ee,{children:[r("span",{class:`${oe}-toolui-badge ${oe}-toolui-badge-accent`,children:t.inputRequired}),r("span",{class:`${oe}-toolui-badge`,children:Du(C,t)})]})}),C.description?r("div",{class:`${oe}-toolui-desc`,children:C.description}):null,r(Qr,{label:t.inputQuestion,text:C.question}),v?null:r($u,{req:C,strings:t,resolve:m})]})}function $u({req:e,strings:t,resolve:n}){if(e.responseType==="confirmation")return r(Hu,{req:e,strings:t,resolve:n});let o=kl(e).map(i=>(i.label=t.inputYourAnswer,i.placeholder=i.placeholder??t.inputAnswerPlaceholder,i));return r(Co,{fields:o,strings:t,submitLabel:t.inputSubmit,footerHint:e.responseType==="free-text"?t.inputSubmitHint:void 0,onSubmit:i=>n(i.answer??Object.values(i).join(", "),!0),skipLabel:t.inputSkip,onSkip:()=>n(void 0,!1),submitOnEnter:!0,submitTestId:w.toolInputSubmit,skipTestId:w.toolInputSkip})}function Hu({req:e,strings:t,resolve:n}){let[o,i]=A(""),a=e.allowOther??!0,l=()=>n(o.trim()||void 0,!0),s=()=>n(void 0,!1),c=d=>{d.key!=="Enter"||d.shiftKey||d.isComposing||(d.preventDefault(),l())};return r(ee,{children:[a?r("label",{class:`${oe}-field`,children:[r("span",{class:`${oe}-field-label`,children:t.inputOptionalNote}),r("textarea",{class:`${oe}-field-input`,rows:2,value:o,placeholder:e.placeholder??t.inputOptionalNotePlaceholder,onInput:d=>i(d.target.value),onKeyDown:c,"data-testid":`${w.formField}-note`})]}):null,r("div",{class:`${oe}-form-actions`,children:[r("span",{class:`${oe}-form-hint`,children:t.inputConfirmHint}),r("button",{type:"button",class:`${oe}-form-skip`,onClick:s,"data-testid":w.toolInputSkip,children:t.confirmNo}),r("button",{type:"button",class:`${oe}-form-submit`,onClick:l,"data-testid":w.toolInputSubmit,children:t.confirmYes})]})]})}function Qr({label:e,text:t}){return r("div",{class:`${oe}-toolui-section`,children:[r("span",{class:`${oe}-toolui-label`,children:e}),r("p",{class:`${oe}-toolui-text`,children:t})]})}function Bu({part:e,strings:t,req:n,editable:o,onEdit:i}){let a=j(()=>e.outputSig.value),l=j(()=>e.approvalSig.value),s=l.value?.approved===!1,c=l.value?.approved!==void 0?l.value.reason??"":Fu(a.value,t);return r("div",{class:`${oe}-toolui`,"data-testid":w.toolDecision,children:[r("div",{class:`${oe}-toolui-head`,children:[r("span",{class:`${oe}-toolui-badge ${oe}-toolui-badge-accent`,children:t.inputBadge}),r("span",{class:`${oe}-toolui-badge`,children:s?t.inputSkipped:t.inputAnswered})]}),n.description?r("div",{class:`${oe}-toolui-desc`,children:n.description}):null,r(Qr,{label:t.inputQuestion,text:n.question}),!s&&c?r(Qr,{label:t.inputYourAnswer,text:c}):null,o?r("div",{class:`${oe}-toolui-actions`,children:r("button",{type:"button",class:`${oe}-form-skip`,onClick:i,"data-testid":w.toolEdit,children:t.edit})}):null]})}function Fu(e,t){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="object"){let n=e;return"confirmed"in n?n.confirmed?t.confirmYes:t.confirmNo:typeof n.responseText=="string"&&n.responseText?n.responseText:Object.values(n).filter(o=>typeof o=="string"||typeof o=="number").join(", ")}return String(e)}var Zr=x.cssPrefix;function Tl({part:e,strings:t}){let n=j(()=>e.inputSig.value),o=j(()=>e.outputSig.value),i=j(()=>e.errorSig.value),a=j(()=>e.stateSig.value),l=j(()=>e.approvalSig.value);return j(()=>!!Lo(n.value)||!!i.value||!!Lo(Jr(o.value))).value?r("details",{class:`${Zr}-toolui ${Zr}-toolui-collapsible`,"data-testid":w.toolCall,children:[r("summary",{class:`${Zr}-toolui-head`,children:r(Io,{name:Ro(e.toolName),state:a.value,approval:l.value,strings:t})}),r(dt,{label:t.toolParameters,value:n.value}),o.value!==void 0?r(dt,{label:t.toolResult,value:o.value}):null,i.value?r(dt,{label:t.statusError,value:i.value,error:!0}):null]}):null}var De=x.cssPrefix;function El({message:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:i,showSources:a,interactive:l=!1,superseded:s=!1,tool:c,onRetry:d}){let _=j(()=>e.partsSig.value).value,g=j(()=>ot(e)),f=j(()=>us(e)),m=j(()=>e.partsSig.value.some(B=>B.kind==="text"&&B.textSig.value.length>0)),C=j(()=>o&&e.partsSig.value.some(B=>B.kind==="reasoning")),v=e.role==="assistant"&&e.status==="streaming",b=n==="buffered"&&v,y=v&&!m.value,P=v&&!b&&!(C.value&&y);if(f.value)return null;let E=zu(e.createdAt);return r("div",{class:`${De}-bubble-row`,"data-role":e.role,"data-testid":be(w.messageBubble,e.id),children:r("div",{class:`${De}-bubble-col`,children:[r("div",{class:`${De}-bubble`,children:[b?r(Ku,{label:t.loading}):_.map(B=>r(Uu,{part:B,active:y,strings:t,showReasoning:o,showToolCalls:i,showSources:a,interactive:l,superseded:s,tool:c},Wu(B))),P&&r(Gu,{}),e.status==="error"&&e.errorText||g.value?r("div",{class:`${De}-error`,role:"alert",children:[r("span",{children:e.errorText??t.errorGeneric}),d?r("button",{type:"button",class:`${De}-error-retry`,onClick:d,"data-testid":w.messageRetry,children:t.errorRetry}):null]}):null]}),E?r("time",{class:`${De}-bubble-time`,dateTime:E.iso,title:E.full,children:E.short}):null]})})}function zu(e){if(typeof e!="number"||!Number.isFinite(e))return null;try{let t=new Date(e);return{short:t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),full:t.toLocaleString(void 0,{dateStyle:"full",timeStyle:"short"}),iso:t.toISOString()}}catch{return null}}function Uu({part:e,active:t,strings:n,showReasoning:o,showToolCalls:i,showSources:a,interactive:l,superseded:s,tool:c}){switch(e.kind){case"step-start":return null;case"text":return r(Eo,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return o?r(qu,{part:e,active:t,strings:n}):null;case"tool":return r(Vu,{part:e,strings:n,showToolCalls:i,interactive:l,superseded:s,tool:c});case"file":return e.mediaType.startsWith("image/")?r("img",{src:e.url,alt:"",loading:"lazy"}):r("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",children:e.url});case"source":return a?r(xl,{part:e,strings:n}):null}}function Vu({part:e,strings:t,showToolCalls:n,interactive:o,superseded:i,tool:a}){let l=j(()=>e.approvalSig.value!==void 0);if(a?.humanInLoop){if(ul(e.toolName))return r(Cl,{part:e,strings:t,active:o,superseded:i,onSubmit:a.onResult,onDecision:a.onDecision,onEdit:a.onEdit});if(l.value)return r(yl,{part:e,strings:t,active:o,superseded:i,onDecision:a.onDecision,onEdit:a.onEdit})}return n?r(Tl,{part:e,strings:t}):null}function qu({part:e,active:t,strings:n}){return r("details",{class:`${De}-reasoning`,open:t,"data-active":t?"true":void 0,children:[r("summary",{class:`${De}-reasoning-summary`,children:r("span",{class:`${De}-reasoning-label`,children:t?n.thinking:n.thoughts})}),r("div",{class:`${De}-reasoning-body`,children:r(Eo,{textSig:e.textSig,doneSig:e.doneSig})})]})}function Wu(e){switch(e.kind){case"text":case"reasoning":case"step-start":return`${e.kind}:${e.id}`;case"tool":return`tool:${e.toolCallId}`;case"file":return`file:${e.url}`;case"source":return`source:${e.sourceId}`}}function Gu(){return r("span",{class:`${De}-typing`,"aria-hidden":"true",children:[r("span",{}),r("span",{}),r("span",{})]})}function Ku({label:e}){return r("span",{class:`${De}-loading`,role:"status",children:[r("span",{class:`${De}-loading-spinner`,"aria-hidden":"true"}),r("span",{class:`${De}-loading-label`,children:e})]})}var zt=x.cssPrefix,ei=120,ju=350;function Rl({messagesSig:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:i,showSources:a,loading:l,idle:s,tool:c,onRetry:d,form:u,formMarkers:_,onFillForm:g}){let f=O(null),m=j(()=>e.value),[C,v]=A(!1),b=O(!1),y=O(!1),P=O(!1),E=O(0),B=()=>P.current||performance.now()-E.current<ju,le=O(0),M=S=>{le.current=performance.now(),S.scrollTop=S.scrollHeight},Z=(S,z)=>{M(S);let xe=z,ye=0,Se=()=>{M(S),--xe>0&&(ye=requestAnimationFrame(Se))};return z>0&&(ye=requestAnimationFrame(Se)),()=>cancelAnimationFrame(ye)},F=(S,z)=>{let xe,ye,Se,Ge=-1,Ke=()=>{xe.disconnect(),ye.disconnect(),clearTimeout(Se)},Ze=()=>{if(y.current||B()||Ge>=0&&S.scrollTop<Ge-4)return Ke();M(S),Ge=S.scrollTop};return xe=new ResizeObserver(Ze),ye=new MutationObserver(Ze),Ze(),xe.observe(S),ye.observe(S,{childList:!0,subtree:!0,characterData:!0}),Se=setTimeout(Ke,z),Ke},G=m.value[0]?.id;ht(()=>{let S=f.current;if(S&&m.value.length!==0&&(b.current=!0,!!m.value.some(z=>z.role==="user")))return F(S,300)},[G]);let X=O(0);R(()=>{let S=f.current,z=m.value,xe=X.current;if(X.current=z.length,!S||!b.current)return;if(z.slice(xe).some(Se=>Se.role==="user"))return y.current=!1,Z(S,3);if(!z.some(Se=>Se.role==="user")||y.current||B())return;S.scrollHeight-S.scrollTop-S.clientHeight<ei&&M(S)},[m.value.length]);let he=O(null);R(()=>{let S=f.current,z=m.value.at(-1),xe=he.current;if(he.current=z?.id??null,!!S&&b.current&&!(!z||z.id!==xe||z.status!=="streaming"))return y.current=!1,Z(S,3)},[m.value]),R(()=>{let S=f.current;if(!S)return;let z=m.value.at(-1);if(!z||z.status!=="streaming"&&!m.value.some(Se=>Se.role==="user"))return;let xe=()=>{if(y.current||B())return;S.scrollHeight-S.scrollTop-S.clientHeight<ei*2&&M(S)};if(z.status!=="streaming")return F(S,300);xe();let ye=new MutationObserver(xe);return ye.observe(S,{childList:!0,subtree:!0,characterData:!0}),()=>ye.disconnect()},[m.value]);let k=u?.form.id,K=!!u&&(_??[]).some(S=>S.formId===u.form.id);ht(()=>{let S=f.current;!S||!k||y.current||m.value.some(z=>z.role==="user")&&(K?S.querySelector(`[data-testid="${w.formGate}"]`)?.scrollIntoView({block:"nearest"}):M(S))},[k,K]),R(()=>{let S=f.current;if(!S)return;let z=()=>v(S.scrollHeight-S.scrollTop-S.clientHeight>ei*2),xe=()=>{z(),performance.now()-le.current>150&&(y.current=S.scrollHeight-S.scrollTop-S.clientHeight>8)},ye=()=>{y.current=!0},Se=Fe=>{Fe.deltaY<0&&ye()},Ge=0,Ke=Fe=>{Ge=Fe.touches[0]?.clientY??0,P.current=!0},Ze=Fe=>{(Fe.touches[0]?.clientY??0)>Ge+4&&ye()},Be=()=>{P.current=!1,E.current=performance.now()},Le=()=>{P.current=!0};return S.addEventListener("scroll",xe,{passive:!0}),S.addEventListener("wheel",Se,{passive:!0}),S.addEventListener("touchstart",Ke,{passive:!0}),S.addEventListener("touchmove",Ze,{passive:!0}),S.addEventListener("touchend",Be,{passive:!0}),S.addEventListener("touchcancel",Be,{passive:!0}),S.addEventListener("pointerdown",Le,{passive:!0}),window.addEventListener("pointerup",Be,{passive:!0}),window.addEventListener("pointercancel",Be,{passive:!0}),z(),()=>{S.removeEventListener("scroll",xe),S.removeEventListener("wheel",Se),S.removeEventListener("touchstart",Ke),S.removeEventListener("touchmove",Ze),S.removeEventListener("touchend",Be),S.removeEventListener("touchcancel",Be),S.removeEventListener("pointerdown",Le),window.removeEventListener("pointerup",Be),window.removeEventListener("pointercancel",Be)}},[]);let re=()=>{let S=f.current;S&&(y.current=!1,M(S))},de=[],ue="",Ie=m.value.at(-1)?.id,ie=[..._??[]].toSorted((S,z)=>(S.createdAt??1/0)-(z.createdAt??1/0)),Pe=S=>u&&S.formId===u.form.id?r(qr,{form:u.form,strings:t,onSubmit:u.onSubmit,onSkip:u.onSkip},`gate:${S.formId}`):r(_l,{marker:S,strings:t,onFill:!u&&g?()=>g(S.formId):void 0},S.key),Qe=S=>{for(let z=ie[0];z?.createdAt!==void 0&&!(S!==void 0&&z.createdAt>S);z=ie[0])ie.shift(),de.push(Pe(z))};for(let S of m.value){if(S.role==="assistant"&&S.id!==Ie&&ot(S))continue;Qe(S.createdAt);let z=Yu(S.createdAt);z&&z!==ue&&(de.push(r("div",{class:`${zt}-date-divider`,children:r("span",{class:`${zt}-date-pill`,title:Xu(S.createdAt),children:Ju(S.createdAt,t)})},`day:${z}`)),ue=z),de.push(r(El,{message:S,strings:t,responseMode:n,showReasoning:o,showToolCalls:i,showSources:a,interactive:!!s&&S.id===Ie,superseded:S.id!==Ie,tool:c,onRetry:s&&S.id===Ie?d:void 0},S.id))}for(let S of ie)de.push(Pe(S));return r("div",{class:`${zt}-list-wrap`,children:[r("div",{ref:f,class:`${zt}-list`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[l&&m.value.length===0?r("div",{class:`${zt}-list-loading`,role:"status",children:t.conversationLoading}):null,de,u&&!K?r(qr,{form:u.form,strings:t,onSubmit:u.onSubmit,onSkip:u.onSkip}):null]}),C?r("button",{type:"button",class:`${zt}-jump`,onClick:re,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":w.scrollToBottom,children:r(go,{})}):null]})}function Yu(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Xu(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function Ju(e,t){let n=new Date(e),o=a=>new Date(a.getFullYear(),a.getMonth(),a.getDate()).getTime(),i=Math.round((o(new Date)-o(n))/864e5);return i<=0?t.dateToday:i===1?t.dateYesterday:i<7?n.toLocaleDateString(void 0,{weekday:"long"}):n.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}var Qu=["today","yesterday","lastWeek","older"];function Zu(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let o=Math.floor((Al(e)-Al(n))/(1440*60*1e3));return o<=0?"today":o===1?"yesterday":o<7?"lastWeek":"older"}function Il(e,t){let n=new Map;for(let o of t){let i=Zu(e,o.lastMessageAt),a=n.get(i);a?a.push(o):n.set(i,[o])}return Qu.filter(o=>n.has(o)).map(o=>({bucket:o,conversations:n.get(o)}))}function Al(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var ep=Y.scope("history"),tp=3,np=6,op={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function rp(e,t,n){let o=Date.parse(e);return Number.isFinite(o)?new Date(o).toDateString()===new Date(t).toDateString()?new Intl.DateTimeFormat(n,{hour:"numeric",minute:"2-digit"}).format(o):t-o<10080*60*1e3?new Intl.DateTimeFormat(n,{weekday:"short"}).format(o):new Intl.DateTimeFormat(n,{month:"short",day:"numeric"}).format(o):""}function Mo({transport:e,strings:t,locale:n,persistence:o,visitorId:i,onSelect:a,onNewConversation:l}){let s=x.cssPrefix,c=e.peekConversations({visitorId:i}),[d,u]=A(c?"loaded":"loading"),[_,g]=A(c?.conversations??[]);R(()=>{let v=!1;return e.listConversations({visitorId:i}).then(b=>{if(v)return;let y=b.conversations??[];g(y),u("loaded"),o.saveHistoryCount(y.length)}).catch(b=>{v||(ep.warn("listConversations failed",{err:b}),u("error"))}),()=>{v=!0}},[e,i,o]);let f=l?r("div",{class:`${s}-history-footer`,children:r("button",{type:"button",class:`${s}-history-new`,onClick:l,"data-testid":w.sidebarNewConversation,children:[r(Ps,{}),t.newConversation]})}):null;if(d==="loading"){let v=Math.min(o.loadHistoryCount()??tp,np);return r(ee,{children:[r("div",{class:`${s}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:r("div",{class:`${s}-history-group`,"aria-hidden":"true",children:[r("div",{class:`${s}-history-heading`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-heading`})}),r("div",{class:`${s}-history-card`,children:Array.from({length:Math.max(1,v)},(b,y)=>r("div",{class:`${s}-history-item ${s}-history-item-skeleton`,children:[r("span",{class:`${s}-history-avatar ${s}-skeleton`}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-title`})}),r("span",{class:`${s}-history-time`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-time`})})]}),r("span",{class:`${s}-history-row`,children:r("span",{class:`${s}-history-preview`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-preview`})})})]})]},y))})]})}),f]})}if(d==="error"||_.length===0)return r(ee,{children:[r("div",{class:`${s}-history-empty`,children:t.historyEmpty}),f]});let m=Date.now(),C=Il(m,_);return r(ee,{children:[r("div",{class:`${s}-history`,role:"list",children:C.map(v=>r("div",{class:`${s}-history-group`,children:[r("div",{class:`${s}-history-heading`,children:t[op[v.bucket]]}),r("div",{class:`${s}-history-card`,children:v.conversations.map(b=>r("button",{type:"button",role:"listitem",class:`${s}-history-item`,onClick:()=>a(b),"data-closed":b.canContinue?void 0:"true","data-unread":(b.unreadCount??0)>0?"true":void 0,"data-testid":be(w.historyItem,b.conversationId),children:[r("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:r(Dr,{})}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:b.title}),r("span",{class:`${s}-history-time`,children:rp(b.lastMessageAt,m,n)})]}),r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-preview`,children:b.preview??(b.canContinue?t.historyContinue:t.conversationClosed)}),(b.unreadCount??0)>0?r("span",{class:`${s}-history-dot`}):null]})]})]},b.conversationId))})]},v.bucket))}),f]})}var Ll=x.cssPrefix;function Ml({suggestions:e,onPick:t}){return e.length===0?null:r("div",{class:`${Ll}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((n,o)=>r("button",{type:"button",class:`${Ll}-suggestion`,onClick:()=>t(n),"data-testid":be(w.suggestion,o),children:n.label},n.id))})}var Ne=x.cssPrefix;function Nl(e){let{options:t,onClose:n}=e,o=t.strings,i=O(null);R(()=>{let c=i.current;if(!c)return;let d=xo(c),u=_=>{_.key==="Escape"&&n?.()};return c.addEventListener("keydown",u),()=>{d(),c.removeEventListener("keydown",u)}},[n]);let a=O(null),l=D(c=>{a.current?.attachFromDrop(c)},[]),{visible:s}=wo({containerRef:i,onDrop:l});return bo(i.current,t.mode==="modal"),r("div",{ref:i,class:`${Ne}-panel`,role:"dialog","aria-modal":"false","aria-label":o.panelTitle,style:{position:"relative"},"data-testid":w.panel,children:[r(ti,{...e,containerEl:i.current,dragOver:s,composerAttachApiRef:a}),r(ni,{poweredBy:e.options.poweredBy})]})}function ti(e){let{options:t,transport:n,feedback:o,bus:i,persistence:a,panelSize:l,view:s,canSend:c,isStreaming:d,loadingMessages:u,messagesSig:_,agent:g,suggestions:f,initialWidgetSize:m,visitorId:C,onClose:v,onBack:b,onClear:y,onToggleHistory:P,onSelectHistoryConversation:E,onNewConversation:B,onWidgetSizeChange:le,onSend:M,onStop:Z,onSuggestion:F,activeForm:G,formMarkers:X,onFormSubmit:he,onFormSkip:k,onFormFill:K,tool:re,onRetry:de,containerEl:ue,dragOver:Ie,composerAttachApiRef:ie}=e,Pe=t.strings,Qe;return G?Qe=null:c?Qe=r(ee,{children:[r(Ml,{suggestions:f,onPick:F}),r(il,{options:t,transport:n,feedback:o,bus:i,isStreaming:d,onSend:M,onStop:Z,attachApiRef:ie})]}):Qe=r(ap,{label:Pe.conversationClosed,ctaLabel:Pe.startNewConversation,onNewConversation:y}),r(ee,{children:[s==="history"?r(ip,{strings:Pe,onBack:P,onClose:v,showClose:Po(t.mode,l,t.actions)}):r("header",{class:`${Ne}-header`,"data-testid":w.panelHeader,children:[b?r("button",{type:"button",class:`${Ne}-icon-btn`,onClick:b,"aria-label":Pe.moduleBack,title:Pe.moduleBack,children:r(_n,{})}):null,g?r(nl,{agent:g,strings:Pe}):r("h1",{children:Pe.panelTitle}),r(Xe,{panelProps:e,variant:"chat"})]}),s==="history"?r(Mo,{transport:n,strings:Pe,locale:t.locale,persistence:a,visitorId:C,onSelect:S=>E(S.conversationId),onNewConversation:B}):r(ee,{children:[r(al,{visible:Ie,strings:Pe}),r(Rl,{messagesSig:_,strings:Pe,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,loading:u,idle:!d,tool:re,onRetry:de,form:G?{form:G,onSubmit:he,onSkip:k}:null,formMarkers:X,onFillForm:K}),Qe,r(sp,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?r(vo,{panelEl:ue,resize:t.size.resize,position:t.position,initialSize:m,onSizeChange:le,strings:Pe}):null]})}function ip({strings:e,onBack:t,onClose:n,showClose:o}){return r("header",{class:`${Ne}-header`,children:[r("button",{type:"button",class:`${Ne}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:r(_n,{})}),r("h1",{children:e.historyTitle}),o?r("button",{type:"button",class:`${Ne}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:r(Ye,{})}):null]})}function ap({label:e,ctaLabel:t,onNewConversation:n}){return r("div",{class:`${Ne}-readonly-banner`,role:"note",children:[r("span",{class:`${Ne}-readonly-label`,children:e}),r("button",{type:"button",class:`${Ne}-readonly-cta`,onClick:n,children:t})]})}function sp({disclaimer:e}){return e?r("div",{class:`${Ne}-composer-footer`,children:r("div",{class:`${Ne}-disclaimer`,children:e})}):null}function ni({poweredBy:e}){return e?r("div",{class:`${Ne}-poweredby-bar`,children:r(lp,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function lp({logoUrl:e,text:t,href:n}){let o=r(ee,{children:[e?r("img",{class:`${Ne}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?r("span",{children:t}):null]});return n?r("a",{class:`${Ne}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:o}):r("span",{class:`${Ne}-poweredby`,children:o})}function Ol(e){let t=O(e);t.current=e;let n=O(null);return n.current??(n.current=cp(t)),n.current}function cp(e){let t=H(null),n=new Set,o=c=>`${e.current.conversationId()??""}:${c}`,i=c=>c.frequency==="always"?!1:c.frequency==="conversation"?n.has(o(c.id)):c.id in e.current.persistence.loadFormsDone(),a=(c,d)=>{if(t.value)return;let u=e.current;if(c==="manual"){let _=u.forms.list.find(g=>g.id===d);_&&(t.value={form:_,trigger:"manual"});return}for(let _ of u.forms.byTrigger[c]??[]){let g=_.triggers.find(f=>f.kind===c);if(!(!g||!dp(g,u)||i(_)||!_p(_,u))){t.value={form:_,trigger:c};return}}},l=(c,d)=>{let u=t.value;if(!u)return;t.value=null;let{form:_,trigger:g}=u;_.frequency==="conversation"?n.add(o(_.id)):_.frequency!=="always"&&e.current.persistence.saveFormDone(_.id),e.current.onComplete(_,g,c,d)};return{activeForm:t,fire:a,refresh:()=>{let c=t.value;if(!c)return;let d=e.current.forms.list.find(u=>u.id===c.form.id);d&&d!==c.form&&(t.value={form:d,trigger:c.trigger})},complete:c=>l(c,!1),skip:()=>l({},!0)}}function dp(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function _p(e,t){let n=e.when;if(!n)return!0;if(n.missingContext?.length){let i=t.userContext()??{};if(n.missingContext.some(a=>i[a]!==void 0&&i[a]!==""))return!1}if(n.pageArea&&!(Array.isArray(n.pageArea)?n.pageArea:[n.pageArea]).includes(t.pageArea()??""))return!1;let o=t.messageCount();return!(n.minMessages!=null&&o<n.minMessages||n.maxMessages!=null&&o>n.maxMessages)}function Dl(e){let t=x.cssPrefix,{site:n,blocks:o,strings:i,collapsed:a}=e,l=o?.navigation??[],s=o?.linkCards??[],c=a?i.expandSidebar:i.collapseSidebar;return r("aside",{class:`${t}-sidebar`,"data-collapsed":a?"true":"false","data-testid":w.sidebar,children:[r("div",{class:`${t}-sidebar-header`,children:[r(up,{site:n}),r("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":a?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":w.sidebarToggle,children:r(pp,{collapsed:a})})]}),a?null:r(ee,{children:[l.length>0?r("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:r(mp,{items:l})}):null,s.length>0?r("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:r(fp,{items:s})}):null,e.showConversations?r("div",{class:`${t}-sidebar-conversations`,children:r(Mo,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function up({site:e}){let t=x.cssPrefix;if(e?.logo?.url){let n=e.logo.alt??e.title??"Logo";return r("picture",{children:[e.logoDark?.url?r("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,r("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:n})]})}return r("div",{class:`${t}-sidebar-title`,children:e?.title??x.name})}function pp({collapsed:e}){return r("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?r("polyline",{points:"9 6 15 12 9 18"}):r("polyline",{points:"15 6 9 12 15 18"})})}function mp({items:e}){let t=x.cssPrefix;return r("ul",{class:`${t}-sidebar-nav`,children:e.map(n=>r("li",{children:r("a",{class:`${t}-sidebar-nav-item`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[n.icon?r("span",{class:`${t}-sidebar-nav-icon`,"data-icon":n.icon}):null,r("span",{class:`${t}-sidebar-nav-label`,children:n.label})]})},n.id??n.label))})}function fp({items:e}){let t=x.cssPrefix;return r("div",{class:`${t}-sidebar-cards`,children:e.map(n=>r("a",{class:`${t}-sidebar-card`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[r("div",{class:`${t}-sidebar-card-label`,children:n.label}),n.description?r("div",{class:`${t}-sidebar-card-desc`,children:n.description}):null]},n.id??n.label))})}var $l=x.cssPrefix;function Hl(e){return r("main",{class:`${$l}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[r(Dl,{site:e.site,blocks:e.blocks,transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,showConversations:e.showConversations,onSelectConversation:e.onSelectConversation,onNewConversation:e.onNewConversation,collapsed:e.sidebarCollapsed,onToggleCollapsed:e.onToggleSidebarCollapsed}),r("section",{class:`${$l}-page-chat`,"aria-label":"Chat",children:e.children})]})}var Bl=e=>Object.fromEntries(e.map(t=>[t,[]]));function Fl(e,t,n){let o=H({activeTab:e,stacks:Bl(t)});return{sig:o,switchTab(i){o.value.activeTab!==i&&(o.value={...o.value,activeTab:i},n?.(i))},push(i){let a=o.value,l=a.stacks[a.activeTab]??[];o.value={...a,stacks:{...a.stacks,[a.activeTab]:[...l,i]}}},pop(){let i=o.value,a=i.stacks[i.activeTab]??[];a.length!==0&&(o.value={...i,stacks:{...i.stacks,[i.activeTab]:a.slice(0,-1)}})},reset(i){o.value={activeTab:i,stacks:Bl(t)}}}}var zl=e=>e.stacks[e.activeTab]??[],Ul=e=>zl(e).at(-1),Vl=e=>zl(e).length===0;var ql={Icon:un};var _t=x.cssPrefix;function No({title:e,actions:t}){return r("header",{class:`${_t}-back-header`,"data-variant":"title",children:[r("span",{class:`${_t}-back-spacer`,"aria-hidden":"true"}),r("h1",{class:`${_t}-back-title`,children:e}),t??r("span",{class:`${_t}-back-spacer`,"aria-hidden":"true"})]})}function Oo({title:e,backLabel:t,onBack:n,actions:o,testid:i}){return r("header",{class:`${_t}-back-header`,"data-testid":i,children:[r("button",{type:"button",class:`${_t}-icon-btn`,onClick:n,"aria-label":t,title:t,children:r(_n,{})}),r("h1",{class:`${_t}-back-title`,children:e}),o??r("span",{class:`${_t}-back-spacer`,"aria-hidden":"true"})]})}var Ut=x.cssPrefix;function Wl({placeholder:e,onActivate:t}){return r("button",{type:"button",class:`${Ut}-home-search`,onClick:t,"data-testid":w.homeSearch,children:[r("span",{class:`${Ut}-home-search-text`,children:e}),r("span",{class:`${Ut}-home-search-icon`,"aria-hidden":"true",children:r(Hr,{})})]})}function Gl({placeholder:e,value:t,onInput:n}){return r("div",{class:`${Ut}-home-search`,"data-input":"true",children:[r("input",{type:"search",class:`${Ut}-home-search-input`,placeholder:e,value:t,onInput:o=>n(o.currentTarget.value),"data-testid":w.helpSearch}),r("span",{class:`${Ut}-home-search-icon`,"aria-hidden":"true",children:r(Hr,{})})]})}var gn=x.cssPrefix;function Do({title:e,subtitle:t,onClick:n,testid:o}){return r("button",{type:"button",class:`${gn}-list-row`,onClick:n,"data-testid":o,children:[r("span",{class:`${gn}-list-row-body`,children:[r("span",{class:`${gn}-list-row-title`,children:e}),t?r("span",{class:`${gn}-list-row-sub`,children:t}):null]}),r("span",{class:`${gn}-list-row-chevron`,"aria-hidden":"true",children:r($t,{})})]})}var Kl=x.cssPrefix;function We({tone:e="info",message:t,onRetry:n,strings:o}){return r("div",{class:`${Kl}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[r("span",{children:t}),n?r("button",{type:"button",class:`${Kl}-module-retry`,onClick:n,children:o.errorRetry}):null]})}var wt=x.cssPrefix,gp=Y.scope("help"),hp=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function vp(e){let t=new Map;for(let n of e){let o=n.categories?.[0]??"";(t.get(o)??t.set(o,[]).get(o)).push(n)}return[...t.entries()]}function jl(e,t){let n=t.toLowerCase(),o=n.indexOf(e);if(o!==-1)return 100-Math.min(o,99);let i=0;for(let a of e){if(i=n.indexOf(a,i),i===-1)return 0;i+=1}return 1}function bp(e,t){let n=t.toLowerCase().trim();return n?e.map(o=>({item:o,score:Math.max(jl(n,o.title)*2,jl(n,o.description??""))})).filter(o=>o.score>0).toSorted((o,i)=>i.score-o.score).map(o=>o.item):[]}function Yl({article:e,nav:t}){return r(Do,{title:e.title,subtitle:e.description,onClick:()=>hp(t,e),testid:be(w.helpArticle,e.id)})}function Pp({transport:e,strings:t,config:n,nav:o,bus:i,panelProps:a}){let l=n.contentTags,[s,c]=A("loading"),[d,u]=A(t.errorGeneric),[_,g]=A([]),[f,m]=A(""),[C,v]=A(0);R(()=>{let P=!1;return c("loading"),e.listContent({tags:l,sortBy:"order",limit:100}).then(E=>{if(P)return;let B=E.items??[];g(B),c("loaded"),i.emit("contentView",{section:"help",tags:l?.join(","),count:B.length})}).catch(E=>{P||(gp.warn("listContent (help) failed",{err:E}),u(Pt(E,t)),c("error"))}),()=>{P=!0}},[e,l,C,i]);let b=Re(()=>bp(_,f),[_,f]);R(()=>{let P=f.trim();if(!P)return;let E=setTimeout(()=>i.emit("contentSearch",{queryLength:P.length,hitCount:b.length}),600);return()=>clearTimeout(E)},[f,b,i]);function y(){return f.trim().length>0?b.length===0?r(We,{message:t.helpSearchEmpty,strings:t}):r("div",{class:`${wt}-help-card`,children:b.map(P=>r(Yl,{article:P,nav:o},P.id))}):s==="loading"?r(We,{message:t.helpLoading,strings:t}):s==="error"?r(We,{tone:"error",message:d,onRetry:()=>v(P=>P+1),strings:t}):_.length===0?r(We,{message:t.helpEmpty,strings:t}):vp(_).map(([P,E])=>r("section",{class:`${wt}-help-group`,children:[P?r("h2",{class:`${wt}-help-section-title`,children:P}):null,r("div",{class:`${wt}-help-card`,children:E.map(B=>r(Yl,{article:B,nav:o},B.id))})]},P))}return r("div",{class:`${wt}-module`,children:[r(No,{title:t.helpTitle,actions:r(Xe,{panelProps:a,variant:"plain"})}),r("div",{class:`${wt}-module-pad`,children:r(Gl,{placeholder:t.helpSearchPlaceholder,value:f,onInput:m})}),r("div",{class:`${wt}-help-list`,children:y()})]})}var Xl={Icon:$r,Root:e=>r(Pp,{...e})};var Jl=x.cssPrefix;function oi({onClick:e,children:t,testid:n}){return e?r("button",{type:"button",class:`${Jl}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):r("div",{class:`${Jl}-home-card`,"data-testid":n,children:t})}var se=x.cssPrefix,Ql=Y.scope("home");function xp(e){let t=e.options.userContext?.name,n=e.config.greetingText?Ee(e.strings,e.config.greetingText):void 0;return n?{title:t?n.replace("{name}",t):n.replace(/\s*\{name\}\s*/," ").trim(),subtitle:e.strings.homeGreetingLead}:t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}var yp=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function Sp(e){let{transport:t,strings:n,config:o,nav:i,bus:a,panelProps:l}=e,[s,c]=A(null),[d,u]=A([]),_=o.contentTags?.join(",");R(()=>{if(!o.showRecentConversations)return;let b=!1;return t.listConversations({limit:1}).then(y=>!b&&c(y.conversations?.[0]??null)).catch(y=>!b&&Ql.warn("listConversations (home) failed",{err:y})),()=>{b=!0}},[t,o.showRecentConversations]),R(()=>{if(!o.contentTags?.length)return;let b=!1;return t.listContent({tags:o.contentTags,limit:6}).then(y=>{if(b)return;let P=y.items??[];u(P),a.emit("contentView",{section:"home",tags:_,count:P.length})}).catch(y=>!b&&Ql.warn("listContent (home) failed",{err:y})),()=>{b=!0}},[t,_,a]);let g=xp(e),f=o.userAvatars??[],m=o.status,C=m?.text?Ee(n,m.text):n.homeStatus,v=o.contentBlockTitle?Ee(n,o.contentBlockTitle):n.homeContentTitle;return r("div",{class:`${se}-module ${se}-home`,"data-testid":w.homeView,children:r("div",{class:`${se}-home-scroll`,children:[r("div",{class:`${se}-home-hero`,children:[r("div",{class:`${se}-home-hero-top`,children:[o.brandName?r("span",{class:`${se}-home-brand`,"data-testid":w.homeBrand,children:o.brandName}):r("span",{class:`${se}-home-brand-spacer`,"aria-hidden":"true"}),r("div",{class:`${se}-home-hero-actions`,children:[f.length>0?r("div",{class:`${se}-home-avatars`,children:f.map(b=>r("span",{class:`${se}-home-avatar`,title:b.role?`${b.name} \xB7 ${b.role}`:b.name,children:b.avatar?r("img",{src:b.avatar,alt:"",loading:"lazy"}):r("span",{children:yo(b.name)})},b.name))}):null,r(Xe,{panelProps:l,variant:"plain"})]})]}),o.showGreeting!==!1?r(ee,{children:[r("h1",{class:`${se}-home-greeting`,"data-testid":w.homeGreeting,children:g.title}),g.subtitle?r("p",{class:`${se}-home-lead`,children:g.subtitle}):null]}):null]}),r("div",{class:`${se}-home-cards`,children:[o.showSearchBar!==!1?r(Wl,{placeholder:n.homeSearchPlaceholder,onActivate:()=>i.switchToLayout("help")}):null,s?r(oi,{onClick:()=>i.selectConversation(s.conversationId),testid:w.homeRecent,children:r("div",{class:`${se}-home-recent-row`,"data-unread":(s.unreadCount??0)>0?"true":void 0,children:[r("span",{class:`${se}-home-recent-avatar`,"aria-hidden":"true",children:r(un,{})}),r("span",{class:`${se}-home-recent-body`,children:[r("span",{class:`${se}-home-recent-title`,children:s.title}),s.preview?r("span",{class:`${se}-home-recent-preview`,children:s.preview}):null]}),(s.unreadCount??0)>0?r("span",{class:`${se}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,m?r(oi,{onClick:m.url?()=>i.push({kind:"iframe",url:m.url,title:C}):void 0,children:r("div",{class:`${se}-home-status`,"data-level":m.level??"operational",children:[r("span",{class:`${se}-home-status-icon`,"aria-hidden":"true",children:r(zs,{})}),r("span",{class:`${se}-home-status-text`,children:C})]})}):null,d.length>0?r("section",{class:`${se}-home-content`,children:[r("div",{class:`${se}-home-content-title`,children:v}),r("div",{class:`${se}-home-content-list`,children:d.map(b=>r(Do,{title:b.title,subtitle:b.description,onClick:()=>yp(i,b),testid:be(w.homeContentRow,b.id)},b.id))})]}):null]})]})})}var Zl={Icon:Us,Root:e=>r(Sp,{...e})};var ut=x.cssPrefix,wp=Y.scope("news");function kp({transport:e,strings:t,config:n,nav:o,bus:i,panelProps:a}){let l=n.contentTags,[s,c]=A("loading"),[d,u]=A(t.errorGeneric),[_,g]=A([]),[f,m]=A(0);R(()=>{let v=!1;return c("loading"),e.listContent({tags:l,sortBy:"publishedAt",sortOrder:"desc"}).then(b=>{if(v)return;let y=b.items??[];g(y),c("loaded"),i.emit("contentView",{section:"news",tags:l?.join(","),count:y.length})}).catch(b=>{v||(wp.warn("listContent (news) failed",{err:b}),u(Pt(b,t)),c("error"))}),()=>{v=!0}},[e,l,f,i]);function C(){return s==="loading"?r(We,{message:t.newsLoading,strings:t}):s==="error"?r(We,{tone:"error",message:d,onRetry:()=>m(v=>v+1),strings:t}):_.length===0?r(We,{message:t.newsEmpty,strings:t}):r("div",{class:`${ut}-news-list`,children:_.map(v=>r("button",{type:"button",class:`${ut}-news-card`,onClick:()=>o.push({kind:"content",id:v.id,title:v.title}),"data-testid":be(w.newsItem,v.id),children:[v.image?r("img",{class:`${ut}-news-hero`,src:v.image,alt:"",loading:"lazy"}):null,r("span",{class:`${ut}-news-body`,children:[r("span",{class:`${ut}-news-title`,children:v.title}),v.description?r("span",{class:`${ut}-news-summary`,children:v.description}):null]})]},v.id))})}return r("div",{class:`${ut}-module`,children:[r(No,{title:t.newsTitle,actions:r(Xe,{panelProps:a,variant:"plain"})}),r("div",{class:`${ut}-module-scroll`,children:C()})]})}var ec={Icon:Vs,Root:e=>r(kp,{...e})};var $o={chat:ql,home:Zl,help:Xl,news:ec};var hn=x.cssPrefix;function tc({modules:e,activeTab:t,strings:n,unreadCount:o,onSelect:i}){return r("nav",{class:`${hn}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(a=>{let l=$o[a.layout].Icon,s=a.id===t,c=a.layout==="chat"&&o>0?o>9?"9+":String(o):null;return r("button",{type:"button",role:"tab","aria-selected":s,class:`${hn}-tab`,onClick:()=>i(a.id),"data-testid":be(w.tab,a.id),children:[r("span",{class:`${hn}-tab-icon`,"aria-hidden":"true",children:[r(l,{}),c?r("span",{class:`${hn}-tab-badge`,"data-testid":w.tabBadge,children:c}):null]}),r("span",{class:`${hn}-tab-label`,children:Ee(n,a.label)})]},a.id)})})}var nc=x.cssPrefix,Cp="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function oc({url:e,title:t,strings:n,onBack:o,actions:i}){return r("div",{class:`${nc}-module`,children:[r(Oo,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:o,actions:i}),r("iframe",{class:`${nc}-content-frame`,src:e,title:t||"content",sandbox:Cp,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var vn=x.cssPrefix,Tp=Y.scope("content"),Ep=5e3;function rc({id:e,title:t,transport:n,strings:o,bus:i,onBack:a,actions:l}){let[s,c]=A(null),[d,u]=A(!1),[_,g]=A(0),f=D(()=>{u(!1),c(null),g(v=>v+1)},[]);R(()=>{let v=!1;return n.listContent({ids:[e],limit:1}).then(b=>{if(v)return;let y=b.items[0];y?(c(y),i.emit("contentOpen",{contentId:e,tags:y.tags?.length?y.tags.join(","):void 0})):u(!0)}).catch(b=>{v||(Tp.warn("listContent (reader) failed",{err:b}),u(!0))}),()=>{v=!0}},[n,e,_,i]),R(()=>{if(!s)return;let v=setTimeout(()=>i.emit("contentRead",{contentId:e}),Ep);return()=>clearTimeout(v)},[s,e,i]);let m=D(v=>{let y=v.target?.closest?.("a")?.getAttribute("href")??"";y&&!y.startsWith("#")&&i.emit("contentLinkClick",{contentId:e})},[i,e]);function C(){return d?r(We,{tone:"error",message:o.errorGeneric,onRetry:f,strings:o}):s===null?r(We,{message:o.contentLoading,strings:o}):r("article",{class:`${vn}-content`,"data-testid":w.contentView,onClick:m,children:[s.image?r("img",{class:`${vn}-content-hero`,src:s.image,alt:"",loading:"lazy"}):null,s.description?r("p",{class:`${vn}-content-subtitle`,children:s.description}):null,r(Pl,{text:s.content??""})]})}return r("div",{class:`${vn}-module`,children:[r(Oo,{title:s?.title||t||o.moduleBack,backLabel:o.moduleBack,onBack:a,actions:l,testid:w.backHeader}),r("div",{class:`${vn}-module-scroll`,"data-testid":w.contentScroll,children:C()})]})}var Ho=x.cssPrefix;function ic({panelProps:e,enabledModules:t,nav:n,bus:o,unreadCount:i,onSelectConversation:a,onStartNewConversation:l,onSetPanelSize:s}){let c=e.options,d=c.strings,u=O(null),_=O(new Set);R(()=>{let X=u.current;if(!X)return;let he=xo(X),k=K=>{K.key==="Escape"&&e.onClose?.()};return X.addEventListener("keydown",k),()=>{he(),X.removeEventListener("keydown",k)}},[e.onClose]);let g=O(null),f=D(X=>{g.current?.attachFromDrop(X)},[]),{visible:m}=wo({containerRef:u,onDrop:f});bo(u.current,c.mode==="modal");let C=j(()=>n.sig.value).value,v=Ul(C),b=c.modules.byId[C.activeTab],y=v?.kind==="iframe"||v?.kind==="content",P=t.length>1&&(Vl(C)||!y),E=O(null);R(()=>{if(y&&E.current===null)E.current=e.panelSize,e.panelSize==="normal"&&s("expanded");else if(!y&&E.current!==null){let X=E.current;E.current=null,s(X)}},[y]);let B={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:X=>{let he=t.find(k=>k.layout===X);he&&n.switchTab(he.id)},selectConversation:a,startNewConversation:l},le=X=>({options:c,transport:e.transport,strings:d,config:X,visitorId:e.visitorId,nav:B,bus:o,panelProps:e}),M=r(Xe,{panelProps:e,variant:"plain"});b&&_.current.add(b.id);let Z=t.filter(X=>_.current.has(X.id)),F=X=>{if(X.layout==="chat")return r(ti,{...e,containerEl:u.current,dragOver:m,composerAttachApiRef:g});let he=$o[X.layout].Root;return he?r(he,{...le(X)}):null},G=()=>v?.kind==="iframe"?r(oc,{url:v.url,title:v.title,strings:d,onBack:n.pop,actions:M}):v?.kind==="content"?r(rc,{id:v.id,title:v.title,transport:e.transport,strings:d,bus:o,onBack:n.pop,actions:M}):null;return r("div",{ref:u,class:`${Ho}-panel ${Ho}-messenger`,role:"dialog","aria-modal":"false","aria-label":d.panelTitle,style:{position:"relative"},"data-testid":w.messengerHome,children:[r("div",{class:`${Ho}-messenger-body`,children:[Z.map(X=>r("div",{class:`${Ho}-messenger-pane`,hidden:y||X.id!==b?.id,children:F(X)},X.id)),G()]}),P?r(tc,{modules:t,activeTab:C.activeTab,strings:d,unreadCount:i,onSelect:n.switchTab}):null,r(ni,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(b?.layout==="chat"&&!v)?r(vo,{panelEl:u.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:d}):null]})}var bn=x.cssPrefix;function ac({strings:e,onClose:t}){return r("div",{class:`${bn}-panel ${bn}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":w.modulesEmpty,children:[t?r("button",{type:"button",class:`${bn}-icon-btn ${bn}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:r(Ye,{})}):null,r("p",{class:`${bn}-modules-empty-text`,children:e.modulesEmpty})]})}function sc({callout:e,persistence:t}){let n=e?.text??"",o=e?.persistent??!0,[i,a]=A(()=>o?!1:t.loadCalloutDismissed(n));R(()=>{a(o?!1:t.loadCalloutDismissed(n))},[n,o,t]);let l=D(()=>{a(!0),o||t.saveCalloutDismissed(n)},[t,n,o]);return{dismissed:i,dismissCallout:l}}var q=Y.scope("app"),Bo=x.cssPrefix;function lc(e,t){return ds({...e,text:Ee(t,e.text)})}function Rp(e){let t=e.partsSig.value.filter(n=>n.kind==="tool");return t.length>0&&t.every(n=>{let o=n.stateSig.value;return o==="output-available"||o==="output-error"||o==="output-denied"||o==="approval-responded"})}function cc(e){return e instanceof DOMException?e.name==="AbortError":e?.name==="AbortError"}function dc({options:e,hostElement:t,bus:n}){let[o]=A(()=>It(e.widgetId,e.storage,e.aiAgentDeploymentId)),[i,a]=A(()=>o.getVisitorId()),l=o.loadUserPrefs(),[s,c]=A(()=>l.locale??e.locale),[d,u]=A(()=>l.themeMode??e.themeMode),[_,g]=A(()=>l.textSize??e.textSize),f=rn(o.loadConversationId()),m=rn([]),C=rn(0),[v,b]=A(!1),[y,P]=A([]);function E(){let p=e.modules.list,h=new Set(p.map(N=>N.id)),T=o.loadActiveModule();return T&&h.has(T)?T:p[0]?.id??""}function B(){return e.modules.list.find(p=>p.layout==="chat")?.id}let le=O();if(!le.current){let p=e.modules.list.map(h=>h.id);le.current=Fl(E(),p,h=>o.saveActiveModule(h))}let M=le.current,Z=O(void 0);Z.current=B();let[F,G]=A(!1),[X,he]=A(null),[k,K]=A(!1),re=e.mode==="standalone"||e.mode==="inline",de=O(an(e,Dt(),o.loadPanelOpen(),o.loadPanelSize())),[ue,Ie]=A(de.current.panelOpen),[ie,Pe]=A(de.current.panelOpen),Qe=O(ie);Qe.current=ie;let S=O(!1),z=O(void 0);R(()=>{ue&&Pe(!0)},[ue]);let xe=O(!1),[ye,Se]=A(!1),{dismissed:Ge,dismissCallout:Ke}=sc({callout:e.launcher.callout,persistence:o}),Ze=e.launcher.callout?.persistent??!0,Be=D(()=>{q.info("calloutDismiss"),n.emit("calloutDismiss",void 0),Ke()},[n,Ke]),[Le,Fe]=A(de.current.panelSize),Uo=O(!1),[fc,Vo]=A("chat"),[Vt,qt]=A(!0),[we,Pn]=A(!1),[gc,ai]=A(null),[qo,xn]=A([]),[si,yn]=A(null),[Sn,wn]=A(null),kn=O(e.strings),[hc,vc]=A(void 0),[bc,Pc]=A(void 0),[xc,yc]=A(()=>o.loadSidebarCollapsed()??!1),[Wo,Sc]=A({}),[W]=A(()=>new lo({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Xa({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[Me]=A(()=>new uo(m)),[ae]=A(()=>new fo(e.sound,e.haptics)),je=D(p=>{o.patchUserPrefs(p),W.saveUserPrefs(o.loadUserPrefs()).catch(h=>{q.warn("saveUserPrefs failed",{err:h})})},[o,W]);R(()=>{l.soundMuted!==void 0&&ae.setMuted(l.soundMuted)},[]),R(()=>{t.dataset.theme=d},[t,d,e]),R(()=>{t.dataset.textSize=_},[t,_,e]),R(()=>{ae.update(e.sound,e.haptics)},[ae,e.sound,e.haptics]),R(()=>()=>ae.destroy(),[ae]),R(()=>{let p=!0;return ae.mutedSig.subscribe(h=>{if(p){p=!1;return}je({soundMuted:h})})},[ae,je]),R(()=>{Uo.current||!e.size.initialSize||(Uo.current=!0,!o.loadPanelSize()&&Fe(Ir(e.mode,e.size,Dt())))},[e.mode,e.size,o]),R(()=>{if(!F||xe.current)return;xe.current=!0;let p=an(e,Dt(),o.loadPanelOpen(),o.loadPanelSize());Ie(p.panelOpen),Fe(p.panelSize)},[F,e,o]);let li=O(!1),ci=O(!1),Wt=O(null),Go=O(null),Ko=O(!1);R(()=>{if(!(!F||li.current)){if(li.current=!0,ci.current){let p=Z.current;p&&M.switchTab(p);return}M.reset(E())}},[F]);let Cn=D(p=>{!p||p.length===0||(m.value=p.map(h=>lc(h,kn.current)))},[m]),jo=O(null),Tn=D(async p=>{try{let{formSubmissions:h}=await(p?W.bootstrap(p):jo.current??W.bootstrap()),T=new Map;return h.forEach((N,U)=>T.set(N.formId,U)),h.filter((N,U)=>!N.skipped||T.get(N.formId)===U).map((N,U)=>({key:`wire:${N.formId}:${N.createdAt??U}`,formId:N.formId,outcome:N.skipped?"skipped":"submitted",createdAt:so(N.createdAt),values:N.values}))}catch(h){return q.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:h}),[]}},[W]),Gt=O(0),Kt=D((p,h)=>{let T=[...p.map(I=>I.createdAt),...h.map(I=>I.createdAt)].filter(I=>I!==void 0),N=(T.length?Math.min(...T):Date.now())-1;return[...(z.current?.messages??[]).map(I=>{let Te=lc(I,kn.current);return Te.createdAt=N,Te}),...p]},[]),Yo=D(async p=>{let h=Gt.current,T=()=>h!==Gt.current;b(!0);try{let[N,U]=await Promise.all([W.loadConversation(p),Tn()]);if(T())return;let I=Or(N.messages??[]);P(U);let Te=Wt.current?[Wt.current]:[];I.length||Te.length?(m.value=[...Kt(I,U),...Te],qt(N.canContinue??!0),xn(N.suggestions??[])):m.value=Kt([],U),W.resumeStatus==="needs-generation"&&Go.current?.()}catch(N){if(T())return;q.warn("loadThread failed; resetting conversationId",{err:N,conversationId:p}),f.value=void 0,o.saveConversationId(void 0)}finally{T()||b(!1)}},[W,Tn,m,f,o,Kt]),jt=D(async({newConversation:p})=>{let h=++Gt.current,T=()=>h!==Gt.current,N=f.value,U=p||!N?Ue():N;U!==N&&(f.value=U,o.saveConversationId(U));let I;try{I=await W.handshake({visitorId:i,conversationId:U,userPrefs:o.loadUserPrefs(),locale:s})}catch(ze){if(T())return;n.emit("error",ze),e.onError?.(ze),p||G(!0);return}if(T())return;if(I.visitorId&&I.visitorId!==i&&(q.info("visitor rebound",{previous:i,current:I.visitorId,reason:I.rebind?.visitorId}),o.setVisitorId(I.visitorId),a(I.visitorId),n.emit("visitorRebound",{previous:i,current:I.visitorId,reason:I.rebind?.visitorId})),I.conversationId&&I.conversationId!==U&&(q.info("conversation rebound",{previous:U,current:I.conversationId,reason:I.rebind?.conversationId}),n.emit("conversationRebound",{previous:U,current:I.conversationId,reason:I.rebind?.conversationId})),I.agent&&ai(I.agent),e.mode==="page"&&(I.site&&Ka(I.site)?vc(I.site):I.site&&q.warn("invalid site config, using fallback",{site:I.site}),I.blocks&&ja(I.blocks)?Pc(I.blocks):I.blocks&&q.warn("invalid blocks config, using fallback",{blocks:I.blocks})),I.userPrefs&&!p&&(o.saveUserPrefs(I.userPrefs),I.userPrefs.locale&&c(I.userPrefs.locale),I.userPrefs.soundMuted!==void 0&&ae.setMuted(I.userPrefs.soundMuted),I.userPrefs.themeMode&&u(I.userPrefs.themeMode),I.userPrefs.textSize&&g(I.userPrefs.textSize)),z.current=I.welcome,p||n.emit("handshake",I),I.welcome?.suggestions){let ze=kn.current;xn(I.welcome.suggestions.map(ke=>({...ke,label:Ee(ze,ke.label),...ke.text===void 0?{}:{text:Ee(ze,ke.text)}})))}!p&&N&&I.conversationId===N?Qe.current?Yo(N):S.current=!0:(f.value=I.conversationId,o.saveConversationId(I.conversationId),Cn(I.welcome?.messages)),p||G(!0)},[W,i,o,e,n,f,ae,Cn,Yo,s]),Yt=JSON.stringify(e.userContext??null),wc=JSON.stringify(e.pageContext??null),kc=JSON.stringify(Wo);R(()=>{let p=Object.keys(Wo).length?{...Wo,...e.userContext}:e.userContext;W.setContext(p,Ap(e.pageContext))},[W,Yt,wc,kc]);let $e=At(s,e.availableLocales,e.defaultLocale);R(()=>{W.setLocale($e)},[W,$e]),R(()=>{t.dir=zi($e)?"rtl":"ltr"},[t,$e]),R(()=>{$e!==s&&c($e)},[$e,s]);let En=D(p=>{if(p.type!=="data-conversation-rebind")return!1;let h=p.data?.conversationId;if(h&&h!==f.value){let T=f.value;f.value=h,o.saveConversationId(h),W.primeIdentity(void 0,h),q.info("conversation rebound (in-stream)",{previous:T,current:h}),T&&n.emit("conversationRebound",{previous:T,current:h,reason:h})}return!0},[f,o,W,n]),di=D(async p=>{let h=null;try{for await(let T of p.iter)if(!En(T.chunk)){if(!h){h=sn(),Wt.current=h,Me.attach(h),m.value=[...m.value,h],Pn(!0),yn(()=>p.cancel),wn(()=>p.detach),ci.current=!0;let N=Z.current;N&&M.switchTab(N),q.info("resumed in-flight reply on mount")}Me.apply(T.chunk),T.chunk.type==="finish"&&T.chunk.canContinue===!1&&qt(!1)}h&&(h.status==="error"||ot(h)?(h.status="error",h.errorText=e.strings.errorGeneric,ae.play("error")):(h.status="complete",ae.play("messageReceived"),ri(n,e,"assistant",co(h))))}catch(T){h&&(cc(T)?_o(h)?m.value=m.value.filter(N=>N!==h):h.status="complete":(h.status="error",h.errorText=Pt(T,e.strings),ae.play("error"))),q.debug("resume ended without completing",{err:T})}finally{Wt.current=null,h&&(Me.detach(),Pn(!1),yn(null),wn(null),m.value=[...m.value])}},[Me,m,ae,n,e,M,En]),_i=O(null),Xo=D(async()=>{let p=W.resumeStream();_i.current=p,await di(p),W.resumeStatus==="needs-generation"&&Go.current?.()},[W,di]);R(()=>{let p=f.value;return p&&W.primeIdentity(i,p),jt({newConversation:!1}),()=>{Gt.current++,_i.current?.cancel()}},[]),R(()=>{ie&&(jo.current=W.bootstrap(),(async()=>{try{let p=await jo.current;he(Zt((p??{forms:[]}).forms,$e))}catch(p){q.debug("bootstrap failed \u2014 treating as no forms",{err:p})}finally{K(!0)}})(),(async()=>{let p=[];if(S.current){S.current=!1;let h=f.value;h&&p.push(Yo(h))}f.value&&p.push(Xo()),p.length!==0&&await Promise.allSettled(p)})())},[ie]);let Rn=O(null);R(()=>{if(!ie)return;if(Rn.current===null){Rn.current=$e;return}if(Rn.current===$e)return;Rn.current=$e;let p=!1;return W.bootstrap().then(h=>{p||he(Zt((h??{forms:[]}).forms,$e))}).catch(h=>q.debug("forms re-localize failed \u2014 keeping current copy",{err:h})),()=>{p=!0}},[ie,$e,W]);let ui=O(Yt);R(()=>{!F||ui.current===Yt||(ui.current=Yt,jt({newConversation:!1}))},[Yt,F,jt]),ht(()=>{Yn(t,io(e.mode,Le,ue))},[t,ue,Le,e.mode]),R(()=>{if(e.mode!=="modal"||!ue)return;let p=h=>{h.composedPath().some(U=>U instanceof HTMLElement&&U.classList.contains(`${x.cssPrefix}-panel`))||Ie(!1)};return t.addEventListener("click",p),()=>t.removeEventListener("click",p)},[t,ue,e.mode]),R(()=>{if(e.mode!=="drawer"||!ue)return;let p=h=>{h.key==="Escape"&&Ie(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[ue,e.mode]);let at=D(async(p,{continueExisting:h})=>{let T=f.value??Ue();f.value||(f.value=T,o.saveConversationId(T));let N=(h?m.value:m.value.slice(0,-1)).filter(Te=>!Te.ephemeral),U=os({messages:N.map(_s),conversationId:T,tools:e.features.tools,visitorId:i,userPrefs:o.loadUserPrefs()});Pn(!0);let I=W.sendMessage(U);yn(()=>I.cancel),wn(()=>I.detach);try{for await(let ke of I.iter)En(ke.chunk)||(Me.apply(ke.chunk),ke.chunk.type==="finish"&&ke.chunk.canContinue===!1&&qt(!1));let Te=p.status==="error",ze=ot(p);if(Te||ze){p.status="error",p.errorText=e.strings.errorGeneric,ae.play("error");let ke=new Error(Te?"stream error chunk":"empty reply");n.emit("error",ke),e.onError?.(ke)}else p.status="complete",ae.play("messageReceived"),ri(n,e,"assistant",co(p))}catch(Te){cc(Te)?_o(p)?m.value=m.value.filter(ze=>ze!==p):p.status="complete":(p.status="error",p.errorText=Pt(Te,e.strings),ae.play("error"),n.emit("error",Te),e.onError?.(Te))}finally{Me.detach(),Pn(!1),yn(null),wn(null),m.value=[...m.value]}},[W,Me,m,f,e,n,ae,o,i,En]),pi=D(()=>{if(we||Ko.current||Wt.current||m.value.filter(T=>!T.ephemeral).at(-1)?.role!=="user")return;Ko.current=!0,q.info("regenerating dangling user turn (needs-generation)");let h=sn();m.value=[...m.value,h],Me.attach(h),at(h,{continueExisting:!1}).finally(()=>{Ko.current=!1})},[we,m,Me,at]);R(()=>{Go.current=pi},[pi]);let An=D((p,h)=>{if(we)return;let T=m.value.at(-1),N=T?.partsSig.value.find(U=>U.kind==="tool"&&U.toolCallId===p);if(!T||!N){q.warn("decideTool: tool part not found",{toolCallId:p});return}h(N),T.partsSig.value=[...T.partsSig.value],Rp(T)&&(T.status="streaming",m.value=[...m.value],Me.attach(T),at(T,{continueExisting:!0}))},[we,m,Me,at]),mi=D((p,h)=>{q.info("toolResult",{toolCallId:p}),n.emit("toolResult",{toolCallId:p}),An(p,T=>{T.outputSig.value=h,T.stateSig.value="output-available"})},[n,An]),fi=D((p,h,T)=>{q.info("toolDecision",{toolCallId:p,approved:h}),n.emit("toolDecision",{toolCallId:p,approved:h}),An(p,N=>{let U=N.approvalSig.value?.id??p;N.approvalSig.value={id:U,approved:h,reason:T},N.stateSig.value="approval-responded"})},[n,An]),gi=D(p=>{if(we)return;let h=m.value.at(-1),T=h?.partsSig.value.find(U=>U.kind==="tool"&&U.toolCallId===p);if(!h||!T)return;let N=T.approvalSig.value?.id??p;T.approvalSig.value={id:N},T.stateSig.value="approval-requested",h.partsSig.value=[...h.partsSig.value]},[we,m]),Cc=Re(()=>({humanInLoop:e.features.humanInLoop,onResult:mi,onDecision:fi,onEdit:gi}),[e.features.humanInLoop,mi,fi,gi]),Tc=()=>m.value.reduce((p,h)=>p+(h.role==="user"?1:0),0),kt=e.forms.list.length>0?e.forms:X??e.forms,pe=Ol({forms:kt,persistence:o,userContext:()=>e.userContext,messageCount:Tc,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>f.value,onComplete:(p,h,T,N)=>{q.info("formSubmit",{formId:p.id,trigger:h,skipped:N}),n.emit("formSubmit",{formId:p.id,values:T,skipped:N}),P(I=>{let ze=I.find(ke=>ke.formId===p.id&&ke.outcome==="skipped")?.createdAt??Date.now();return[...I.filter(ke=>!(ke.formId===p.id&&ke.outcome==="skipped")),{key:`local:${p.id}:${ze}`,formId:p.id,outcome:N?"skipped":"submitted",createdAt:ze,...N?{}:{values:T}}]});let U=f.value??Ue();f.value||(f.value=U,o.saveConversationId(U),W.primeIdentity(void 0,U)),!N&&p.mirrorToContext&&Sc(I=>({...I,...T})),W.submitForm({formId:p.id,conversationId:U,trigger:h,values:T,skipped:N})}}),Ec=j(()=>pe.activeForm.value);R(()=>{pe.refresh()},[kt,pe]);let hi=e.pageContext?.area?String(e.pageContext.area):void 0,Rc=j(()=>m.value.length);R(()=>{F&&k&&pe.fire("pre-chat")},[F,k,pe]),R(()=>{k&&!Vt&&pe.fire("conversation-closed")},[k,Vt,pe]),R(()=>{F&&k&&hi&&pe.fire("page-area")},[F,k,hi,pe]);let Jo=Re(()=>{let p=kt.list.flatMap(h=>h.triggers).filter(h=>h.kind==="idle").map(h=>Number(h.param));return p.length?Math.min(...p)*1e3:0},[kt]);R(()=>{if(!Jo||!ue)return;let p=setTimeout(()=>pe.fire("idle"),Jo);return()=>clearTimeout(p)},[Jo,ue,pe,Rc.value]);let vi=D(async(p,h)=>{if(q.info("send",{textLen:p.length,attachments:h.length,streaming:we}),we)return;n.emit("send",{text:p,attachmentCount:h.length}),qo.length>0&&xn([]);let T=await Lp(W,h,I=>{q.warn("upload failed",{err:I}),n.emit("error",I),e.onError?.(I)});ae.unlock(),ae.play("messageSent");let N=cs(p,T),U=sn();m.value=[...m.value,N,U],Me.attach(U),ri(n,e,"user",p),await at(U,{continueExisting:!1}),pe.fire("after-messages")},[we,W,n,e,qo.length,m,Me,at,pe]),Ac=D(()=>{q.info("stop"),n.emit("stop",void 0),si?.()},[si,n]),Ic=D(()=>{if(we)return;let p=m.value,h=p.at(-1);if(!h||h.role!=="assistant"||h.status!=="error"&&!ot(h))return;let T=sn();m.value=[...p.slice(0,-1),T],Me.attach(T),q.info("retry"),at(T,{continueExisting:!1})},[we,m,Me,at]),Lc=D(()=>{ae.toggleMuted();let p=ae.mutedSig.value;q.info("soundToggle",{muted:p}),n.emit("soundToggle",{muted:p})},[ae,n]),Xt=D(()=>{if(tl(e.mode,Le)==="exit-fullscreen"){q.info("close \u2192 exit-fullscreen",{mode:e.mode}),Fe("normal"),n.emit("fullscreen",!1);return}q.info("close \u2192 panel closed",{mode:e.mode}),pe.fire("panel-close"),Ie(!1),o.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,o,Le,pe]),Ct=D(()=>{e.modules.list.some(p=>p.layout==="chat")&&W.listConversations({limit:50}).then(p=>{C.value=p.conversations.reduce((h,T)=>h+(T.unreadCount??0),0)}).catch(p=>q.debug("refreshUnread failed (non-fatal)",{err:p}))},[W,e.modules,C]),bi=O(!1);R(()=>{!ie||!F||bi.current||(bi.current=!0,Ct())},[ie,F,Ct]);let Qo=D(()=>{q.info("open",{mode:e.mode}),ae.unlock(),Se(!0),Ie(!0),o.savePanelOpen(!0),!Ge&&!Ze&&Be(),setTimeout(()=>Se(!1),Ip),Ct(),n.emit("open",void 0),e.onOpen?.()},[n,e,ae,o,Ge,Ze,Be,Ct]),Zo=D(()=>{if(!m.value.some(h=>h.role==="user")&&Vt&&f.value){q.info("clear \u2192 reusing empty conversation",{conversationId:f.value}),m.value.length===0&&Cn(z.current?.messages);return}q.info("clear \u2192 new conversation",{wasStreaming:we}),n.emit("clear",void 0),we&&Sn?.(),Mt(()=>{m.value=[],f.value=void 0}),o.clearConversation(),qt(!0),P([]),jt({newConversation:!0})},[we,Sn,m,f,o,jt,n,Vt,Cn]),er=D(()=>{Zo(),Vo("chat");let p=e.modules.list.find(h=>h.layout==="chat")?.id;p&&M.switchTab(p)},[Zo,M,e]),tr=D(()=>{let p=Le==="expanded"?"normal":"expanded";q.info("expand",{from:Le,expanded:p==="expanded"}),Fe(p),o.savePanelSize(p),n.emit("expand",p==="expanded")},[n,Le,o]),nr=D(()=>{let p=Le==="fullscreen"?"normal":"fullscreen";q.info("fullscreen",{from:Le,fullscreen:p==="fullscreen"}),Fe(p),o.savePanelSize(p),n.emit("fullscreen",p==="fullscreen")},[n,Le,o]),Mc=D(()=>{Vo(p=>{let h=p==="history"?"chat":"history";return q.info("toggleHistory",{view:h}),n.emit("toggleHistory",{view:h}),h})},[n]),Nc=D(p=>{q.info("localeChange",{locale:p}),c(p),je({locale:p}),n.emit("localeChange",p)},[je,n]),Oc=D(p=>{q.info("themeChange",{mode:p}),u(p),t.dataset.theme=p,je({themeMode:p}),n.emit("themeChange",p)},[t,je,n]),Dc=D(p=>{q.info("textSizeChange",{size:p}),g(p),t.dataset.textSize=p,je({textSize:p}),n.emit("textSizeChange",p)},[t,je,n]),$c=D(()=>{yc(p=>{let h=!p;return q.info("sidebarToggle",{collapsed:h}),o.saveSidebarCollapsed(h),n.emit("sidebarToggle",{collapsed:h}),h})},[o,n]),Hc=D(p=>{q.info("resize",p),je({widgetSize:p}),n.emit("resize",p)},[je,n]),or=D(async p=>{q.info("selectConversation",{conversationId:p,wasStreaming:we}),n.emit("selectConversation",{conversationId:p}),we&&Sn?.();try{let[h,T]=await Promise.all([W.loadConversation(p),Tn(p)]),N=Or(h.messages);Mt(()=>{m.value=Kt(N,T),f.value=h.conversationId}),P(T),o.saveConversationId(h.conversationId),W.primeIdentity(i,h.conversationId),h.agent&&ai(h.agent),qt(h.canContinue),xn(h.suggestions??[]),Vo("chat"),Xo(),await W.markRead(p),Ct()}catch(h){n.emit("error",h),e.onError?.(h)}},[W,m,f,n,e,o,Ct,Tn,Kt,we,Sn,i,Xo]),In=O(null),Pi=D(p=>{typeof p=="string"&&(k?pe.fire("manual",p):In.current=p)},[k,pe]);R(()=>{!k||!In.current||(pe.fire("manual",In.current),In.current=null)},[k,pe]),R(()=>Ya(t,{open:Qo,close:Xt,expand:tr,fullscreen:nr,openForm:Pi}),[t,Qo,Xt,tr,nr,Pi]);let Oe=Re(()=>xr(e,s,d,_),[e,s,d,_]);kn.current=Oe.strings;let Bc=Re(()=>y.map(p=>{let h=kt.list.find(T=>T.id===p.formId);return{...p,title:h?.title,form:h}}),[y,kt]),xi={options:Oe,transport:W,feedback:ae,bus:n,persistence:o,view:fc,canSend:Vt,isStreaming:we,loadingMessages:v,messagesSig:m,agent:gc,suggestions:qo,initialWidgetSize:l.widgetSize??null,visitorId:i,onClose:Xt,onClear:Zo,onExpand:tr,onFullscreen:nr,onSoundToggle:Lc,onToggleHistory:Mc,onSelectHistoryConversation:or,onNewConversation:er,onLocaleChange:Nc,onThemeChange:Oc,onTextSizeChange:Dc,onWidgetSizeChange:Hc,onSend:vi,onStop:Ac,onSuggestion:p=>{let h=p.text??p.label;q.info("suggestion",{text:h}),n.emit("suggestion",{text:h}),vi(h,[])},activeForm:Ec.value?.form??null,formMarkers:Bc,onFormSubmit:pe.complete,onFormSkip:pe.skip,onFormFill:p=>pe.fire("manual",p),tool:Cc,onRetry:Ic},Fc=p=>{or(p);let h=B();h&&M.switchTab(h)};if(!F)return null;let Jt=Oe.modules.list,rr=p=>{let h=pn("close",Oe.mode,p);return Jt.length===0?r(ac,{strings:Oe.strings,onClose:h?Xt:void 0}):Jt.length===1&&Jt[0]?.layout==="chat"?r(Nl,{...xi,panelSize:p}):r(ic,{panelProps:{...xi,panelSize:p,onClose:h?Xt:void 0},enabledModules:Jt,nav:M,bus:n,unreadCount:C.value,onSelectConversation:Fc,onStartNewConversation:er,onSetPanelSize:Fe})};if(e.mode==="page"){let p=T=>{or(T.conversationId)},h=Jt.some(T=>T.layout==="chat");return r("div",{class:`${Bo}-anchor`,children:r(Hl,{site:hc,blocks:bc,transport:W,strings:Oe.strings,locale:Oe.locale,persistence:o,visitorId:i,showConversations:h,onSelectConversation:p,onNewConversation:er,sidebarCollapsed:xc,onToggleSidebarCollapsed:$c,children:rr("fullscreen")})})}if(re){let p=e.mode==="standalone"?"fullscreen":Le;return r("div",{class:`${Bo}-anchor`,children:rr(p)})}let yi=e.mode==="drawer",Si=!(e.mode==="modal")&&!e.launcher.hidden&&(!ue||ye),wi=Si&&!ye&&!Ge&&!yi?Oe.launcher.callout:null;return r("div",{class:`${Bo}-anchor`,"data-launcher-size":Oe.launcher.size,children:[ue||ie?r("div",{class:`${Bo}-surface`,hidden:!ue,children:rr(Le)}):null,Si?r(Qs,{onToggle:Qo,launcher:Oe.launcher,strings:Oe.strings,leaving:ye,edgeTab:yi}):null,wi?r(Zs,{callout:wi,launcherPosition:Oe.position,strings:Oe.strings,closeLabel:Oe.strings.close,onDismiss:Be}):null]})}function Ap(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var Ip=120;async function Lp(e,t,n){let o=[];for(let i of t)try{let{id:a,url:l}=await e.uploadFile(i.file);o.push({id:a,name:i.name,mediaType:i.mediaType,size:i.size,url:l})}catch(a){n(a)}return o}function ri(e,t,n,o){let i={role:n,text:o};e.emit("message",i),t.onMessage?.(i)}var Mp=Y.scope("error-boundary"),Fo=class extends lt{constructor(){super(...arguments);V(this,"state",{crashed:!1})}componentDidCatch(n,o){Mp.error("widget render crashed",{error:n,componentStack:o?.componentStack}),this.setState({crashed:!0}),this.props.onError(n,o?.componentStack)}render(){return this.state.crashed?this.props.fallback:this.props.children}};var Np="1",Op=60,Dp=2e3,_c={open:()=>{},close:()=>{},expand:e=>({on:e}),fullscreen:e=>({on:e}),send:e=>({attachments:e.attachmentCount}),message:e=>({role:e.role}),stop:()=>{},clear:()=>{},suggestion:()=>{},toggleHistory:e=>({view:e.view}),handshake:()=>{},formSubmit:e=>({formId:e.formId,skipped:e.skipped}),toolResult:()=>{},toolDecision:e=>({approved:e.approved}),contentView:e=>({section:e.section,tags:e.tags,count:e.count}),contentOpen:e=>({contentId:e.contentId,tags:e.tags}),contentSearch:e=>({qlen:e.queryLength,hits:e.hitCount}),contentRead:e=>({contentId:e.contentId}),contentLinkClick:e=>({contentId:e.contentId}),attach:e=>({count:e.count,bytes:e.totalBytes}),voiceStart:()=>{},voiceStop:e=>({ms:e.durationMs}),voiceCancel:()=>{},localeChange:e=>({locale:e}),themeChange:e=>({theme:e}),textSizeChange:e=>({size:e}),soundToggle:e=>({muted:e.muted}),sidebarToggle:e=>({collapsed:e.collapsed}),calloutDismiss:()=>{},error:()=>{}};function $p(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function Hp(){return location.origin+location.pathname}function Bp(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function uc(e,t){let n=Math.random(),o=0,i=0,a=new Set,l=(c,d)=>{let{tracking:u,publicKey:_,aiAgentDeploymentId:g,mode:f,themeMode:m}=t.getOptions();if(!u.enabled||$p()||n>=u.sampleRate)return;let C=performance.now();if(C-o>6e4&&(o=C,i=0),++i>Op)return;let v=new URLSearchParams;v.set("v",Np),v.set("_ev",ao),v.set("e",c),u.token&&v.set("tk",u.token),_&&v.set("pk",_),g&&v.set("dep",g),v.set("vid",t.getVisitorId());let b=t.getConversationId();b&&v.set("cid",b),v.set("url",Hp());let y=Bp();y&&v.set("ref",y),v.set("sw",String(screen.width)),v.set("sh",String(screen.height)),v.set("vw",String(innerWidth)),v.set("vh",String(innerHeight)),v.set("dpr",String(devicePixelRatio)),v.set("lang",navigator.language);try{v.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(v.set("m",f),v.set("th",m),d)for(let[le,M]of Object.entries(d))M!==void 0&&v.set(le,String(M));v.set("ts",String(Date.now()));let P=`${u.endpoint}?${v}`;if(P.length>Dp)return;let E=new Image(1,1);a.add(E);let B=()=>a.delete(E);E.addEventListener("load",B,{once:!0}),E.addEventListener("error",B,{once:!0}),E.src=P},s=Object.keys(_c).map(c=>e.on(c,d=>l(c,_c[c]?.(d))));return()=>{for(let c of s)c();a.clear()}}function pc(e){let{bus:t,host:n,appRoot:o,persistence:i,reportError:a}=e,l=e.initialRaw,s,c=Rt(l),d=!0,u=()=>{c=Rt(s?yr(l,s):l)},_=()=>{Sa(n,jn(c.mode));let m=i.loadUserPrefs().themeMode;ka(n,m?{...c,themeMode:m}:c),d&&(Yn(n,Fp(c)),d=!1)},g=()=>{_(),zn(Fn(Fo,{onError:a},Fn(dc,{bus:t,hostElement:n,options:c})),o)};t.on("handshake",m=>{m.config&&(m.config.storageVersion&&i.rememberStorageVersion(m.config.storageVersion),s=m.config,u(),g())});let f=uc(t,{getOptions:()=>c,getVisitorId:()=>i.getVisitorId(),getConversationId:()=>i.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>l,render:g,setUserOptions:m=>{l=m,u(),g()},patchUserOptions:m=>{l={...l,...m},u(),g()},destroy:()=>f()}}function Fp(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=It(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:o}=an(e,Dt(),t.loadPanelOpen(),t.loadPanelSize());return io(e.mode,o,n)}var zo=class{constructor(){V(this,"handlers",new Map)}on(t,n){let o=this.handlers.get(t);return o||(o=new Set,this.handlers.set(t,o)),o.add(n),()=>this.handlers.get(t)?.delete(n)}emit(t,n){let o=this.handlers.get(t);if(o)for(let i of o)try{i(n)}catch{}}clear(){this.handlers.clear()}};var ii=class extends HTMLElement{constructor(){super(...arguments);V(this,"bus",new zo);V(this,"mountResult",null);V(this,"runtime",null)}static get observedAttributes(){return Sr}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,zn(null,this.mountResult.appRoot),this.bus.clear())}attributeChangedCallback(){this.isConnected&&this.boot()}boot(){let n=wr(a=>this.getAttribute(a));if(this.runtime){this.runtime.setUserOptions(n);return}let o=Rt(n);this.mountResult||(this.mountResult=wa({existingHost:this,position:jn(o.mode)}));let i=It(o.widgetId,o.storage,o.aiAgentDeploymentId);this.runtime=pc({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:i,initialRaw:n,reportError:a=>this.bus.emit("error",a)}),this.runtime.render()}},mc=!1;function zp(){if(mc||typeof customElements>"u")return;let e=x.tagName;customElements.get(e)||customElements.define(e,ii),mc=!0}typeof customElements<"u"&&zp();export{zp as registerWebComponent};
|
|
28
|
+
`:e.pending=r;continue;default:e.pending.length!==0?(ne(e),me(e),e.pending=n):e.text+=n;continue}case 10:switch(n){case"`":e.pending=r;continue;case`
|
|
29
|
+
`:if(r.length===e.fence_start+e.fence_end+1){ne(e),me(e),e.pending="",e.fence_start=0,e.fence_end=0,e.token=101;continue}e.token=101;break;case" ":if(e.pending[0]===`
|
|
30
|
+
`){e.pending=r,e.fence_end+=1;continue}break}e.text+=e.pending,e.pending=n,e.fence_end=1;continue;case 11:switch(n){case"`":r.length===e.fence_start+ +(e.pending[0]===" ")?(ne(e),me(e),e.pending="",e.fence_start=0):e.pending=r;continue;case`
|
|
31
|
+
`:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,ne(e);continue;case" ":e.text+=e.pending,e.pending=n;continue;default:e.text+=r,e.pending="";continue}case 103:switch(e.pending.length){case 0:if(n!=="[")break;e.pending=r;continue;case 1:if(n!==" "&&n!=="x")break;e.pending=r;continue;case 2:if(n!=="]")break;e.pending=r;continue;case 3:if(n!==" ")break;e.renderer.add_token(e.renderer.data,26),e.pending[1]==="x"&&e.renderer.set_attr(e.renderer.data,fl,""),e.renderer.end_token(e.renderer.data),e.pending=" ";continue}e.token=e.tokens[e.len],e.pending="",Ce(e,r);continue;case 14:case 15:{let i="*",l=12;if(e.token===15&&(i="_",l=13),i===e.pending){if(ne(e),i===n){me(e),e.pending="";continue}re(e,l),e.pending=n;continue}break}case 12:case 13:{let i="*",l=14;switch(e.token===13&&(i="_",l=15),e.pending){case i:i===n?e.tokens[e.len-1]===l?e.pending=r:(ne(e),re(e,l),e.pending=""):(ne(e),me(e),e.pending=n);continue;case i+i:let s=e.token;ne(e),me(e),me(e),i!==n?(re(e,s),e.pending=n):e.pending="";continue}break}case 16:if(r==="~~"){ne(e),me(e),e.pending="";continue}break;case 105:n===`
|
|
32
|
+
`?(ne(e),re(e,30),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",Ce(e,n));continue;case 30:if(r==="\\]"||r==="$$"){ne(e),me(e),e.pending="";continue}break;case 31:if(r==="\\)"||e.pending[0]==="$"){ne(e),me(e),n===")"?e.pending="":e.pending=n;continue}break;case 102:r==="http://"||r==="https://"?(ne(e),re(e,18),e.pending=r,e.text=r):"http:/"[e.pending.length]===n||"https:/"[e.pending.length]===n?e.pending=r:(e.token=e.tokens[e.len],Ce(e,n));continue;case 17:case 19:if(e.pending==="]"){ne(e),n==="("?e.pending=r:(me(e),e.pending=n);continue}if(e.pending[0]==="]"&&e.pending[1]==="("){if(n===")"){let i=e.token===17?Ko:pl,l=e.pending.slice(2);e.renderer.set_attr(e.renderer.data,i,l),me(e),e.pending=""}else e.pending+=n;continue}break;case 18:n===" "||n===`
|
|
33
|
+
`||n==="\\"?(e.renderer.set_attr(e.renderer.data,Ko,e.pending),ne(e),me(e),e.pending=n):(e.text+=n,e.pending=r);continue;case 104:if(r.startsWith("<br")){if(r.length===3||n===" "||n==="/"&&(r.length===4||e.pending[e.pending.length-1]===" ")){e.pending=r;continue}if(n===">"){ne(e),e.token=e.tokens[e.len],e.renderer.add_token(e.renderer.data,21),e.renderer.end_token(e.renderer.data),e.pending="";continue}}e.token=e.tokens[e.len],e.text+="<",e.pending=e.pending.slice(1),Ce(e,n);continue}switch(e.pending[0]){case"\\":if(e.token===19||e.token===30||e.token===31)break;switch(n){case"(":ne(e),re(e,31),e.pending="";continue;case"[":e.token=105,e.pending=r;continue;case`
|
|
34
|
+
`:e.pending=n;continue;default:let a=n.charCodeAt(0);e.pending="",e.text+=jo(a)||a>=65&&a<=90||a>=97&&a<=122?r:n;continue}case`
|
|
35
|
+
`:switch(e.token){case 19:case 30:case 31:break;case 3:case 4:case 5:case 6:case 7:case 8:ne(e),St(e,e.blockquote_idx),e.blockquote_idx=0,e.pending=n;continue;default:ne(e),e.pending=n,e.token=21,e.blockquote_idx=0;continue}break;case"<":if(e.token!==19&&e.token!==30&&e.token!==31){ne(e),e.pending=r,e.token=104;continue}break;case"`":if(e.token===19)break;n==="`"?(e.fence_start+=1,e.pending=r):(e.fence_start+=1,ne(e),re(e,11),e.text=n===" "||n===`
|
|
36
|
+
`?"":n,e.pending="");continue;case"_":case"*":{if(e.token===19||e.token===30||e.token===31||e.token===14)break;let a=12,i=14,l=e.pending[0];if(l==="_"&&(a=13,i=15),e.pending.length===1){if(l===n){e.pending=r;continue}if(n!==" "&&n!==`
|
|
37
|
+
`){ne(e),re(e,a),e.pending=n;continue}}else{if(l===n){ne(e),re(e,i),re(e,a),e.pending="";continue}if(n!==" "&&n!==`
|
|
38
|
+
`){ne(e),re(e,i),e.pending=n;continue}}break}case"~":if(e.token!==19&&e.token!==16){if(e.pending==="~"){if(n==="~"){e.pending=r;continue}}else if(n!==" "&&n!==`
|
|
39
|
+
`){ne(e),re(e,16),e.pending=n;continue}}break;case"$":if(e.token!==19&&e.token!==16&&e.pending==="$")if(n==="$"){e.token=105,e.pending=r;continue}else{if(Su(n.charCodeAt(0)))break;ne(e),re(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){ne(e),re(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){ne(e),re(e,19),e.pending="";continue}break;case" ":if(e.pending.length===1&&n===" ")continue;break}if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n==="h"&&(e.pending===" "||e.pending==="")){e.text+=e.pending,e.pending=n,e.token=102;continue}e.text+=e.pending,e.pending=n}ne(e)}function Yo(e){return{add_token:wu,end_token:ku,add_text:Cu,set_attr:Tu,data:{nodes:[e,,,,,],index:0}}}function wu(e,t){let n=e.nodes[e.index],r;switch(t){case 1:return;case 20:r=document.createElement("blockquote");break;case 2:r=document.createElement("p");break;case 21:r=document.createElement("br");break;case 22:r=document.createElement("hr");break;case 3:r=document.createElement("h1");break;case 4:r=document.createElement("h2");break;case 5:r=document.createElement("h3");break;case 6:r=document.createElement("h4");break;case 7:r=document.createElement("h5");break;case 8:r=document.createElement("h6");break;case 12:case 13:r=document.createElement("em");break;case 14:case 15:r=document.createElement("strong");break;case 16:r=document.createElement("s");break;case 11:r=document.createElement("code");break;case 18:case 17:r=document.createElement("a");break;case 19:r=document.createElement("img");break;case 23:r=document.createElement("ul");break;case 24:r=document.createElement("ol");break;case 25:r=document.createElement("li");break;case 26:let a=r=document.createElement("input");a.type="checkbox",a.disabled=!0;break;case 9:case 10:n=n.appendChild(document.createElement("pre")),r=document.createElement("code");break;case 27:r=document.createElement("table");break;case 28:switch(n.children.length){case 0:n=n.appendChild(document.createElement("thead"));break;case 1:n=n.appendChild(document.createElement("tbody"));break;default:n=n.children[1]}r=document.createElement("tr");break;case 29:r=document.createElement(n.parentElement?.tagName==="THEAD"?"th":"td");break;case 30:r=document.createElement("equation-block");break;case 31:r=document.createElement("equation-inline");break}e.nodes[++e.index]=n.appendChild(r)}function ku(e){e.index-=1}function Cu(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function Tu(e,t,n){e.nodes[e.index].setAttribute(vu(t),n)}function Cr({textSig:e,doneSig:t}){let n=D(null);return ht(()=>{let r=n.current;if(!r)return;r.classList.add(`${x.cssPrefix}-md`);let a=Yo(r),i=Xo(a),l=0,s=nt(()=>{let u=e.value,_=t.value;u.length<l&&(r.replaceChildren(),a=Yo(r),i=Xo(a),l=0);let g=u.slice(l);g&&Ce(i,g),l=u.length,_&&hl(i)}),c=new MutationObserver(u=>{for(let _ of u)for(let g of _.addedNodes){if(!(g instanceof HTMLElement))continue;let f=g.matches?.("a")?[g]:[...g.querySelectorAll?.("a")??[]];for(let m of f)vl(m)}});c.observe(r,{childList:!0,subtree:!0});for(let u of r.querySelectorAll("a"))vl(u);let d=u=>{let _=u.target?.closest?.("a");if(!_||!(_ instanceof HTMLAnchorElement))return;let g=_.getAttribute("href")??"";!g||g.startsWith("#")||(u.preventDefault(),window.open(g,"_blank","noopener,noreferrer"))};return r.addEventListener("click",d),()=>{s(),c.disconnect(),r.removeEventListener("click",d)}},[e,t]),o("div",{ref:n})}function bl({text:e}){let t=Re(()=>B(e),[e]),n=Re(()=>B(!0),[]);return o(Cr,{textSig:t,doneSig:n})}function vl(e){let t=e.getAttribute("href")??"";if(!t||t.startsWith("#"))return;e.target!=="_blank"&&(e.target="_blank");let n=new Set((e.rel||"").split(/\s+/).filter(Boolean));n.add("noopener"),n.add("noreferrer"),e.rel=[...n].join(" ")}var zt=x.cssPrefix;function Pl({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?o("a",{class:`${zt}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":w.source,children:[o("span",{class:`${zt}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),o("span",{class:`${zt}-source-label`,children:n})]}):o("span",{class:`${zt}-source`,"data-testid":w.source,children:[o("span",{class:`${zt}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),o("span",{class:`${zt}-source-label`,children:n})]})}var at=x.cssPrefix;function Tr(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function Er(e,t){let n=e==="output-available"||e==="output-error"||e==="output-denied",r=e==="approval-responded"||t?.approved!==void 0;return{terminal:n,responded:r,decided:n||r}}function Ru(e,t){return e==="output-error"?"error":e==="output-denied"||t?.approved===!1?"denied":e==="output-available"?"completed":e==="approval-responded"||t?.approved===!0?"responded":e==="approval-requested"?"awaiting":"running"}function Au({status:e}){return e==="denied"||e==="error"||e==="superseded"?o(Xs,{}):e==="completed"||e==="responded"?o(js,{}):o(Ks,{})}function Iu(e,t){switch(e){case"awaiting":return t.statusAwaiting;case"responded":return t.statusResponded;case"completed":return t.statusCompleted;case"denied":return t.statusDenied;case"error":return t.statusError;case"superseded":return t.statusSuperseded;default:return t.statusRunning}}function Lu({state:e,approval:t,strings:n,superseded:r}){let a=Ru(e,t),i=r&&(a==="awaiting"||a==="running")?"superseded":a;return o("span",{class:`${at}-toolui-badge ${at}-toolui-status`,"data-status":i,children:[o("span",{class:`${at}-toolui-status-icon`,children:o(Au,{status:i})}),Iu(i,n)]})}function Rr({name:e,state:t,approval:n,strings:r,superseded:a}){return o(te,{children:[o("span",{class:`${at}-toolui-wrench`,children:o(Vs,{})}),o("strong",{class:`${at}-toolui-title`,children:e}),o(Lu,{state:t,approval:n,strings:r,superseded:a}),o("span",{class:`${at}-toolui-chevron`,children:o(mr,{})})]})}function dt({label:e,value:t,error:n}){let r=n?String(t??""):Ar(Jo(t));return r?o("div",{class:`${at}-toolui-section`,children:[o("span",{class:`${at}-toolui-label`,children:e}),o("pre",{class:`${at}-toolui-code`,"data-error":n?"true":void 0,children:r})]}):null}function Jo(e){if(e&&typeof e=="object"){let t=e;if(t.storage==="tool-result-ref"&&"summary"in t)return t.summary}return e}function Ar(e){if(e==null)return"";try{let t=typeof e=="string"?e:JSON.stringify(e,null,2);return!t||t==="{}"||t==="[]"||t==='""'?"":t.length>800?`${t.slice(0,800)}\u2026`:t}catch{return""}}var Ae=x.cssPrefix;function xl({part:e,strings:t,active:n,superseded:r=!1,onDecision:a,onEdit:i}){let l=Y(()=>e.approvalSig.value),s=Y(()=>e.stateSig.value),c=Y(()=>e.inputSig.value),d=Y(()=>e.outputSig.value),u=Y(()=>e.errorSig.value),_=Tr(e.toolName),g=l.value?.approved,{terminal:f,responded:m,decided:C}=Er(s.value,l.value),v=m&&n&&!f,b=r&&!C,y=e.toolCallId;return o("div",{class:`${Ae}-toolui-group`,"data-testid":C?w.toolDecision:w.toolApproval,children:[o("details",{class:`${Ae}-toolui ${Ae}-toolui-collapsible`,children:[o("summary",{class:`${Ae}-toolui-head`,children:o(Rr,{name:_,state:s.value,approval:l.value,strings:t,superseded:b})}),o(dt,{label:t.toolParameters,value:c.value}),d.value!==void 0?o(dt,{label:t.toolResult,value:d.value}):null,u.value?o(dt,{label:t.statusError,value:u.value,error:!0}):null]}),b||f?null:o("div",{class:`${Ae}-toolui ${Ae}-toolui-body`,children:[m?o(te,{children:[o("p",{class:`${Ae}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",g?t.approve:t.reject),l.value?.reason?` \u2014 ${l.value.reason}`:""]}),v?o("p",{class:`${Ae}-toolui-subtle`,children:t.approvalEditHint}):null,!v&&!f?o("p",{class:`${Ae}-toolui-subtle`,children:t.approvalSubmitting}):null]}):o(te,{children:[o("p",{class:`${Ae}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",_)}),o("p",{class:`${Ae}-toolui-subtle`,children:t.approvalBody})]}),!C&&n?o("div",{class:`${Ae}-toolui-actions`,children:[o("button",{type:"button",class:`${Ae}-form-skip`,onClick:()=>a(y,!1),"data-testid":w.toolReject,children:t.reject}),o("button",{type:"button",class:`${Ae}-form-submit`,onClick:()=>a(y,!0),"data-testid":w.toolApprove,children:t.approve})]}):v?o("div",{class:`${Ae}-toolui-actions`,children:o("button",{type:"button",class:`${Ae}-form-skip`,onClick:()=>i(y),"data-testid":w.toolEdit,children:t.edit})}):null]})]})}var Mu=new Set(["text","email","phone","number","date","single-select","multi-select","boolean"]);function yl(e){let t=e&&typeof e=="object"?e:{},r=(Array.isArray(t.questions)?t.questions:[]).map(Nu).filter(a=>a!==null);return{intro:Ir(t.intro),questions:r}}function Nu(e,t){if(!e||typeof e!="object")return null;let n=e,r=Mu.has(n.type)?n.type:"text";return{key:Ir(n.key)??`q${t+1}`,question:Ir(n.question)??"Please provide the missing information.",type:r,options:Array.isArray(n.options)?n.options.filter(a=>typeof a=="string"&&a.trim().length>0):void 0,required:typeof n.required=="boolean"?n.required:void 0,helpText:Ir(n.helpText)}}function Du(e){switch(e){case"text":return"textarea";case"phone":return"tel";case"single-select":case"boolean":return"radio";case"multi-select":return"multiselect";default:return e}}function Sl(e,t,n){return e.questions.map(r=>{let a=Du(r.type),i=r.type==="boolean"?[{value:"yes",label:t},{value:"no",label:n}]:(r.options??[]).map(l=>({value:l,label:l}));return{name:r.key,label:r.question,type:a,required:r.required??!1,options:i.length>0?i:void 0,validationHint:r.helpText}})}function Ir(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var ge=x.cssPrefix;function wl({part:e,strings:t,active:n,superseded:r=!1,onDecision:a,onEdit:i}){let l=Y(()=>e.stateSig.value),s=Y(()=>e.approvalSig.value),c=Y(()=>yl(e.inputSig.value)),{terminal:d,responded:u,decided:_}=Er(l.value,s.value),g=c.value;if(_)return o(Bu,{part:e,strings:t,req:g,editable:u&&n&&!d,onEdit:()=>i(e.toolCallId)});let f=r;return o("div",{class:`${ge}-toolui${f?` ${ge}-toolui-stale`:""}`,"data-testid":w.toolAskQuestions,children:[o("div",{class:`${ge}-toolui-head`,children:f?o(te,{children:[o("span",{class:`${ge}-toolui-badge ${ge}-toolui-badge-accent`,children:t.inputBadge}),o("span",{class:`${ge}-toolui-badge ${ge}-toolui-badge-muted`,children:t.statusSuperseded})]}):o("span",{class:`${ge}-toolui-badge ${ge}-toolui-badge-accent`,children:t.inputRequired})}),g.intro?o("div",{class:`${ge}-toolui-desc`,children:g.intro}):null,f?null:o(Ou,{req:g,strings:t,resolve:(m,C)=>a(e.toolCallId,C,m)})]})}function Ou({req:e,strings:t,resolve:n}){let r=Sl(e,t.confirmYes,t.confirmNo),a=e.questions.length===1&&e.questions[0]?.type==="text";return o(wr,{fields:r,strings:t,submitLabel:t.inputSubmit,footerHint:a?t.inputSubmitHint:void 0,onSubmit:i=>n($u(e.questions,i),!0),skipLabel:t.inputSkip,onSkip:()=>n(void 0,!1),submitOnEnter:a,submitTestId:w.toolInputSubmit,skipTestId:w.toolInputSkip})}function $u(e,t){let n=e.flatMap(r=>{let a=t[r.key];if(a==null||a.trim()==="")return[];let i=r.type==="multi-select"?a.split(",").map(l=>l.trim()).filter(Boolean):a;return[{key:r.key,value:i}]});return JSON.stringify({answers:n})}function Bu({part:e,strings:t,req:n,editable:r,onEdit:a}){let i=Y(()=>e.approvalSig.value),l=i.value?.approved===!1,s=i.value?.approved?Hu(i.value.reason):{};return o("div",{class:`${ge}-toolui`,"data-testid":w.toolDecision,children:[o("div",{class:`${ge}-toolui-head`,children:[o("span",{class:`${ge}-toolui-badge ${ge}-toolui-badge-accent`,children:t.inputBadge}),o("span",{class:`${ge}-toolui-badge`,children:l?t.inputSkipped:t.inputAnswered})]}),n.intro?o("div",{class:`${ge}-toolui-desc`,children:n.intro}):null,n.questions.map(c=>{let d=l?"":s[c.key]??"";return o("div",{class:`${ge}-toolui-section`,children:[o("span",{class:`${ge}-toolui-label`,children:c.question}),d?o("p",{class:`${ge}-toolui-text`,children:d}):null]},c.key)}),r?o("div",{class:`${ge}-toolui-actions`,children:o("button",{type:"button",class:`${ge}-form-skip`,onClick:a,"data-testid":w.toolEdit,children:t.edit})}):null]})}function Hu(e){if(!e)return{};let n=(()=>{try{return JSON.parse(e)}catch{return}})()?.answers;if(!Array.isArray(n))return{};let r={};for(let a of n){if(!a||typeof a!="object")continue;let{key:i,value:l}=a;typeof i=="string"&&(r[i]=Array.isArray(l)?l.filter(s=>typeof s=="string").join(", "):String(l??""))}return r}var Qo=x.cssPrefix;function kl({part:e,strings:t}){let n=Y(()=>e.inputSig.value),r=Y(()=>e.outputSig.value),a=Y(()=>e.errorSig.value),i=Y(()=>e.stateSig.value),l=Y(()=>e.approvalSig.value);return Y(()=>!!Ar(n.value)||!!a.value||!!Ar(Jo(r.value))).value?o("details",{class:`${Qo}-toolui ${Qo}-toolui-collapsible`,"data-testid":w.toolCall,children:[o("summary",{class:`${Qo}-toolui-head`,children:o(Rr,{name:Tr(e.toolName),state:i.value,approval:l.value,strings:t})}),o(dt,{label:t.toolParameters,value:n.value}),r.value!==void 0?o(dt,{label:t.toolResult,value:r.value}):null,a.value?o(dt,{label:t.statusError,value:a.value,error:!0}):null]}):null}var Oe=x.cssPrefix;function Cl({message:e,strings:t,responseMode:n,showReasoning:r,showToolCalls:a,showSources:i,interactive:l=!1,superseded:s=!1,tool:c,onRetry:d}){let _=Y(()=>e.partsSig.value).value,g=Y(()=>rt(e)),f=Y(()=>_s(e)),m=Y(()=>e.partsSig.value.some(K=>K.kind==="text"&&K.textSig.value.length>0)),C=Y(()=>r&&e.partsSig.value.some(K=>K.kind==="reasoning")),v=Y(()=>{let K=e.partsSig.value,L=-1;for(let G=0;G<K.length;G++){let H=K[G]?.kind;(H==="text"||H==="file"||H==="source")&&(L=G)}return L}),b=e.role==="assistant"&&e.status==="streaming",y=n==="buffered"&&b,P=b&&!m.value,R=b&&!y&&!(C.value&&P);if(f.value)return null;let z=zu(e.createdAt);return o("div",{class:`${Oe}-bubble-row`,"data-role":e.role,"data-testid":be(w.messageBubble,e.id),children:o("div",{class:`${Oe}-bubble-col`,children:[o("div",{class:`${Oe}-bubble`,children:[y?o(Vu,{label:t.loading}):_.map((K,L)=>o(Fu,{part:K,active:P,strings:t,showReasoning:r,showToolCalls:a,showSources:i,interactive:l&&(K.kind!=="tool"||L>v.value),superseded:s,tool:c},Wu(K))),R&&o(Gu,{}),e.status==="error"&&e.errorText||g.value?o("div",{class:`${Oe}-error`,role:"alert",children:[o("span",{children:e.errorText??t.errorGeneric}),d?o("button",{type:"button",class:`${Oe}-error-retry`,onClick:d,"data-testid":w.messageRetry,children:t.errorRetry}):null]}):null]}),z?o("time",{class:`${Oe}-bubble-time`,dateTime:z.iso,title:z.full,children:z.short}):null]})})}function zu(e){if(typeof e!="number"||!Number.isFinite(e))return null;try{let t=new Date(e);return{short:t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),full:t.toLocaleString(void 0,{dateStyle:"full",timeStyle:"short"}),iso:t.toISOString()}}catch{return null}}function Fu({part:e,active:t,strings:n,showReasoning:r,showToolCalls:a,showSources:i,interactive:l,superseded:s,tool:c}){switch(e.kind){case"step-start":return null;case"text":return o(Cr,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return r?o(qu,{part:e,active:t,strings:n}):null;case"tool":return o(Uu,{part:e,strings:n,showToolCalls:a,interactive:l,superseded:s,tool:c});case"file":return e.mediaType.startsWith("image/")?o("img",{src:e.url,alt:"",loading:"lazy"}):o("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",children:e.url});case"source":return i?o(Pl,{part:e,strings:n}):null}}function Uu({part:e,strings:t,showToolCalls:n,interactive:r,superseded:a,tool:i}){let l=Y(()=>e.approvalSig.value!==void 0);if(i?.humanInLoop){if(_l(e.toolName))return o(wl,{part:e,strings:t,active:r,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit});if(l.value)return o(xl,{part:e,strings:t,active:r,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit})}return n?o(kl,{part:e,strings:t}):null}function qu({part:e,active:t,strings:n}){return o("details",{class:`${Oe}-reasoning`,open:t,"data-active":t?"true":void 0,children:[o("summary",{class:`${Oe}-reasoning-summary`,children:o("span",{class:`${Oe}-reasoning-label`,children:t?n.thinking:n.thoughts})}),o("div",{class:`${Oe}-reasoning-body`,children:o(Cr,{textSig:e.textSig,doneSig:e.doneSig})})]})}function Wu(e){switch(e.kind){case"text":case"reasoning":case"step-start":return`${e.kind}:${e.id}`;case"tool":return`tool:${e.toolCallId}`;case"file":return`file:${e.url}`;case"source":return`source:${e.sourceId}`}}function Gu(){return o("span",{class:`${Oe}-typing`,"aria-hidden":"true",children:[o("span",{}),o("span",{}),o("span",{})]})}function Vu({label:e}){return o("span",{class:`${Oe}-loading`,role:"status",children:[o("span",{class:`${Oe}-loading-spinner`,"aria-hidden":"true"}),o("span",{class:`${Oe}-loading-label`,children:e})]})}var Ft=x.cssPrefix,Zo=120,Ku=350;function Tl({messagesSig:e,strings:t,responseMode:n,showReasoning:r,showToolCalls:a,showSources:i,loading:l,idle:s,tool:c,onRetry:d,form:u,formMarkers:_,onFillForm:g}){let f=D(null),m=Y(()=>e.value),[C,v]=A(!1),b=D(!1),y=D(!1),P=D(!1),R=D(0),z=()=>P.current||performance.now()-R.current<Ku,K=D(0),L=S=>{K.current=performance.now(),S.scrollTop=S.scrollHeight},G=(S,F)=>{L(S);let xe=F,ye=0,Se=()=>{L(S),--xe>0&&(ye=requestAnimationFrame(Se))};return F>0&&(ye=requestAnimationFrame(Se)),()=>cancelAnimationFrame(ye)},H=(S,F)=>{let xe,ye,Se,Ve=-1,Ke=()=>{xe.disconnect(),ye.disconnect(),clearTimeout(Se)},Ze=()=>{if(y.current||z()||Ve>=0&&S.scrollTop<Ve-4)return Ke();L(S),Ve=S.scrollTop};return xe=new ResizeObserver(Ze),ye=new MutationObserver(Ze),Ze(),xe.observe(S),ye.observe(S,{childList:!0,subtree:!0,characterData:!0}),Se=setTimeout(Ke,F),Ke},j=m.value[0]?.id;ht(()=>{let S=f.current;if(S&&m.value.length!==0&&(b.current=!0,!!m.value.some(F=>F.role==="user")))return H(S,300)},[j]);let Q=D(0);E(()=>{let S=f.current,F=m.value,xe=Q.current;if(Q.current=F.length,!S||!b.current)return;if(F.slice(xe).some(Se=>Se.role==="user"))return y.current=!1,G(S,3);if(!F.some(Se=>Se.role==="user")||y.current||z())return;S.scrollHeight-S.scrollTop-S.clientHeight<Zo&&L(S)},[m.value.length]);let he=D(null);E(()=>{let S=f.current,F=m.value.at(-1),xe=he.current;if(he.current=F?.id??null,!!S&&b.current&&!(!F||F.id!==xe||F.status!=="streaming"))return y.current=!1,G(S,3)},[m.value]),E(()=>{let S=f.current;if(!S)return;let F=m.value.at(-1);if(!F||F.status!=="streaming"&&!m.value.some(Se=>Se.role==="user"))return;let xe=()=>{if(y.current||z())return;S.scrollHeight-S.scrollTop-S.clientHeight<Zo*2&&L(S)};if(F.status!=="streaming")return H(S,300);xe();let ye=new MutationObserver(xe);return ye.observe(S,{childList:!0,subtree:!0,characterData:!0}),()=>ye.disconnect()},[m.value]);let k=u?.form.id,X=!!u&&(_??[]).some(S=>S.formId===u.form.id);ht(()=>{let S=f.current;!S||!k||y.current||m.value.some(F=>F.role==="user")&&(X?S.querySelector(`[data-testid="${w.formGate}"]`)?.scrollIntoView({block:"nearest"}):L(S))},[k,X]),E(()=>{let S=f.current;if(!S)return;let F=()=>v(S.scrollHeight-S.scrollTop-S.clientHeight>Zo*2),xe=()=>{F(),performance.now()-K.current>150&&(y.current=S.scrollHeight-S.scrollTop-S.clientHeight>8)},ye=()=>{y.current=!0},Se=ze=>{ze.deltaY<0&&ye()},Ve=0,Ke=ze=>{Ve=ze.touches[0]?.clientY??0,P.current=!0},Ze=ze=>{(ze.touches[0]?.clientY??0)>Ve+4&&ye()},He=()=>{P.current=!1,R.current=performance.now()},Le=()=>{P.current=!0};return S.addEventListener("scroll",xe,{passive:!0}),S.addEventListener("wheel",Se,{passive:!0}),S.addEventListener("touchstart",Ke,{passive:!0}),S.addEventListener("touchmove",Ze,{passive:!0}),S.addEventListener("touchend",He,{passive:!0}),S.addEventListener("touchcancel",He,{passive:!0}),S.addEventListener("pointerdown",Le,{passive:!0}),window.addEventListener("pointerup",He,{passive:!0}),window.addEventListener("pointercancel",He,{passive:!0}),F(),()=>{S.removeEventListener("scroll",xe),S.removeEventListener("wheel",Se),S.removeEventListener("touchstart",Ke),S.removeEventListener("touchmove",Ze),S.removeEventListener("touchend",He),S.removeEventListener("touchcancel",He),S.removeEventListener("pointerdown",Le),window.removeEventListener("pointerup",He),window.removeEventListener("pointercancel",He)}},[]);let oe=()=>{let S=f.current;S&&(y.current=!1,L(S))},ce=[],_e="",Ie=m.value.at(-1)?.id,ae=[..._??[]].toSorted((S,F)=>(S.createdAt??1/0)-(F.createdAt??1/0)),Pe=S=>u&&S.formId===u.form.id?o(Wo,{form:u.form,strings:t,onSubmit:u.onSubmit,onSkip:u.onSkip},`gate:${S.formId}`):o(dl,{marker:S,strings:t,onFill:!u&&g?()=>g(S.formId):void 0},S.key),Qe=S=>{for(let F=ae[0];F?.createdAt!==void 0&&!(S!==void 0&&F.createdAt>S);F=ae[0])ae.shift(),ce.push(Pe(F))};for(let S of m.value){if(S.role==="assistant"&&S.id!==Ie&&rt(S))continue;Qe(S.createdAt);let F=ju(S.createdAt);F&&F!==_e&&(ce.push(o("div",{class:`${Ft}-date-divider`,children:o("span",{class:`${Ft}-date-pill`,title:Xu(S.createdAt),children:Yu(S.createdAt,t)})},`day:${F}`)),_e=F),ce.push(o(Cl,{message:S,strings:t,responseMode:n,showReasoning:r,showToolCalls:a,showSources:i,interactive:!!s&&S.id===Ie,superseded:S.id!==Ie,tool:c,onRetry:s&&S.id===Ie?d:void 0},S.id))}for(let S of ae)ce.push(Pe(S));return o("div",{class:`${Ft}-list-wrap`,children:[o("div",{ref:f,class:`${Ft}-list`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[l&&m.value.length===0?o("div",{class:`${Ft}-list-loading`,role:"status",children:t.conversationLoading}):null,ce,u&&!X?o(Wo,{form:u.form,strings:t,onSubmit:u.onSubmit,onSkip:u.onSkip}):null]}),C?o("button",{type:"button",class:`${Ft}-jump`,onClick:oe,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":w.scrollToBottom,children:o(mr,{})}):null]})}function ju(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Xu(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function Yu(e,t){let n=new Date(e),r=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),a=Math.round((r(new Date)-r(n))/864e5);return a<=0?t.dateToday:a===1?t.dateYesterday:a<7?n.toLocaleDateString(void 0,{weekday:"long"}):n.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}var Ju=["today","yesterday","lastWeek","older"];function Qu(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let r=Math.floor((El(e)-El(n))/(1440*60*1e3));return r<=0?"today":r===1?"yesterday":r<7?"lastWeek":"older"}function Rl(e,t){let n=new Map;for(let r of t){let a=Qu(e,r.lastMessageAt),i=n.get(a);i?i.push(r):n.set(a,[r])}return Ju.filter(r=>n.has(r)).map(r=>({bucket:r,conversations:n.get(r)}))}function El(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var Zu=J.scope("history"),ep=3,tp=6,np={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function rp(e,t,n){let r=Date.parse(e);return Number.isFinite(r)?new Date(r).toDateString()===new Date(t).toDateString()?new Intl.DateTimeFormat(n,{hour:"numeric",minute:"2-digit"}).format(r):t-r<10080*60*1e3?new Intl.DateTimeFormat(n,{weekday:"short"}).format(r):new Intl.DateTimeFormat(n,{month:"short",day:"numeric"}).format(r):""}function Lr({transport:e,strings:t,locale:n,persistence:r,visitorId:a,onSelect:i,onNewConversation:l}){let s=x.cssPrefix,c=e.peekConversations({visitorId:a}),[d,u]=A(c?"loaded":"loading"),[_,g]=A(c?.conversations??[]);E(()=>{let v=!1;return e.listConversations({visitorId:a}).then(b=>{if(v)return;let y=b.conversations??[];g(y),u("loaded"),r.saveHistoryCount(y.length)}).catch(b=>{v||(Zu.warn("listConversations failed",{err:b}),u("error"))}),()=>{v=!0}},[e,a,r]);let f=l?o("div",{class:`${s}-history-footer`,children:o("button",{type:"button",class:`${s}-history-new`,onClick:l,"data-testid":w.sidebarNewConversation,children:[o(bs,{}),t.newConversation]})}):null;if(d==="loading"){let v=Math.min(r.loadHistoryCount()??ep,tp);return o(te,{children:[o("div",{class:`${s}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:o("div",{class:`${s}-history-group`,"aria-hidden":"true",children:[o("div",{class:`${s}-history-heading`,children:o("span",{class:`${s}-skeleton ${s}-skeleton-heading`})}),o("div",{class:`${s}-history-card`,children:Array.from({length:Math.max(1,v)},(b,y)=>o("div",{class:`${s}-history-item ${s}-history-item-skeleton`,children:[o("span",{class:`${s}-history-avatar ${s}-skeleton`}),o("span",{class:`${s}-history-body`,children:[o("span",{class:`${s}-history-row`,children:[o("span",{class:`${s}-history-title`,children:o("span",{class:`${s}-skeleton ${s}-skeleton-title`})}),o("span",{class:`${s}-history-time`,children:o("span",{class:`${s}-skeleton ${s}-skeleton-time`})})]}),o("span",{class:`${s}-history-row`,children:o("span",{class:`${s}-history-preview`,children:o("span",{class:`${s}-skeleton ${s}-skeleton-preview`})})})]})]},y))})]})}),f]})}if(d==="error"||_.length===0)return o(te,{children:[o("div",{class:`${s}-history-empty`,children:t.historyEmpty}),f]});let m=Date.now(),C=Rl(m,_);return o(te,{children:[o("div",{class:`${s}-history`,role:"list",children:C.map(v=>o("div",{class:`${s}-history-group`,children:[o("div",{class:`${s}-history-heading`,children:t[np[v.bucket]]}),o("div",{class:`${s}-history-card`,children:v.conversations.map(b=>o("button",{type:"button",role:"listitem",class:`${s}-history-item`,onClick:()=>i(b),"data-closed":b.canContinue?void 0:"true","data-unread":(b.unreadCount??0)>0?"true":void 0,"data-testid":be(w.historyItem,b.conversationId),children:[o("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:o(Oo,{})}),o("span",{class:`${s}-history-body`,children:[o("span",{class:`${s}-history-row`,children:[o("span",{class:`${s}-history-title`,children:b.title}),o("span",{class:`${s}-history-time`,children:rp(b.lastMessageAt,m,n)})]}),o("span",{class:`${s}-history-row`,children:[o("span",{class:`${s}-history-preview`,children:b.preview??(b.canContinue?t.historyContinue:t.conversationClosed)}),(b.unreadCount??0)>0?o("span",{class:`${s}-history-dot`}):null]})]})]},b.conversationId))})]},v.bucket))}),f]})}var Al=x.cssPrefix;function Il({suggestions:e,onPick:t}){return e.length===0?null:o("div",{class:`${Al}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((n,r)=>o("button",{type:"button",class:`${Al}-suggestion`,onClick:()=>t(n),"data-testid":be(w.suggestion,r),children:n.label},n.id))})}var Ne=x.cssPrefix;function Ll(e){let{options:t,onClose:n}=e,r=t.strings,a=D(null);E(()=>{let c=a.current;if(!c)return;let d=br(c),u=_=>{_.key==="Escape"&&n?.()};return c.addEventListener("keydown",u),()=>{d(),c.removeEventListener("keydown",u)}},[n]);let i=D(null),l=O(c=>{i.current?.attachFromDrop(c)},[]),{visible:s}=yr({containerRef:a,onDrop:l});return hr(a.current,t.mode==="modal"),o("div",{ref:a,class:`${Ne}-panel`,role:"dialog","aria-modal":"false","aria-label":r.panelTitle,style:{position:"relative"},"data-testid":w.panel,children:[o(ea,{...e,containerEl:a.current,dragOver:s,composerAttachApiRef:i}),o(ta,{poweredBy:e.options.poweredBy})]})}function ea(e){let{options:t,transport:n,feedback:r,bus:a,persistence:i,panelSize:l,view:s,canSend:c,isStreaming:d,loadingMessages:u,messagesSig:_,agent:g,suggestions:f,initialWidgetSize:m,visitorId:C,onClose:v,onBack:b,onClear:y,onToggleHistory:P,onSelectHistoryConversation:R,onNewConversation:z,onWidgetSizeChange:K,onSend:L,onStop:G,onSuggestion:H,activeForm:j,formMarkers:Q,onFormSubmit:he,onFormSkip:k,onFormFill:X,tool:oe,onRetry:ce,containerEl:_e,dragOver:Ie,composerAttachApiRef:ae}=e,Pe=t.strings,Qe;return j?Qe=null:c?Qe=o(te,{children:[o(Il,{suggestions:f,onPick:H}),o(ol,{options:t,transport:n,feedback:r,bus:a,isStreaming:d,onSend:L,onStop:G,attachApiRef:ae})]}):Qe=o(ap,{label:Pe.conversationClosed,ctaLabel:Pe.startNewConversation,onNewConversation:y}),o(te,{children:[s==="history"?o(op,{strings:Pe,onBack:P,onClose:v,showClose:vr(t.mode,l,t.actions)}):o("header",{class:`${Ne}-header`,"data-testid":w.panelHeader,children:[b?o("button",{type:"button",class:`${Ne}-icon-btn`,onClick:b,"aria-label":Pe.moduleBack,title:Pe.moduleBack,children:o(_n,{})}):null,g?o(tl,{agent:g,strings:Pe}):o("h1",{children:Pe.panelTitle}),o(Ye,{panelProps:e,variant:"chat"})]}),s==="history"?o(Lr,{transport:n,strings:Pe,locale:t.locale,persistence:i,visitorId:C,onSelect:S=>R(S.conversationId),onNewConversation:z}):o(te,{children:[o(al,{visible:Ie,strings:Pe}),o(Tl,{messagesSig:_,strings:Pe,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,loading:u,idle:!d,tool:oe,onRetry:ce,form:j?{form:j,onSubmit:he,onSkip:k}:null,formMarkers:Q,onFillForm:X}),Qe,o(ip,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?o(gr,{panelEl:_e,resize:t.size.resize,position:t.position,initialSize:m,onSizeChange:K,strings:Pe}):null]})}function op({strings:e,onBack:t,onClose:n,showClose:r}){return o("header",{class:`${Ne}-header`,children:[o("button",{type:"button",class:`${Ne}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:o(_n,{})}),o("h1",{children:e.historyTitle}),r?o("button",{type:"button",class:`${Ne}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:o(Xe,{})}):null]})}function ap({label:e,ctaLabel:t,onNewConversation:n}){return o("div",{class:`${Ne}-readonly-banner`,role:"note",children:[o("span",{class:`${Ne}-readonly-label`,children:e}),o("button",{type:"button",class:`${Ne}-readonly-cta`,onClick:n,children:t})]})}function ip({disclaimer:e}){return e?o("div",{class:`${Ne}-composer-footer`,children:o("div",{class:`${Ne}-disclaimer`,children:e})}):null}function ta({poweredBy:e}){return e?o("div",{class:`${Ne}-poweredby-bar`,children:o(sp,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function sp({logoUrl:e,text:t,href:n}){let r=o(te,{children:[e?o("img",{class:`${Ne}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?o("span",{children:t}):null]});return n?o("a",{class:`${Ne}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:r}):o("span",{class:`${Ne}-poweredby`,children:r})}function Ml(e){let t=D(e);t.current=e;let n=D(null);return n.current??(n.current=lp(t)),n.current}function lp(e){let t=B(null),n=new Set,r=c=>`${e.current.conversationId()??""}:${c}`,a=c=>c.frequency==="always"?!1:c.frequency==="conversation"?n.has(r(c.id)):c.id in e.current.persistence.loadFormsDone(),i=(c,d)=>{if(t.value)return;let u=e.current;if(c==="manual"){let _=u.forms.list.find(g=>g.id===d);_&&(t.value={form:_,trigger:"manual"});return}for(let _ of u.forms.byTrigger[c]??[]){let g=_.triggers.find(f=>f.kind===c);if(!(!g||!cp(g,u)||a(_)||!dp(_,u))){t.value={form:_,trigger:c};return}}},l=(c,d)=>{let u=t.value;if(!u)return;t.value=null;let{form:_,trigger:g}=u;_.frequency==="conversation"?n.add(r(_.id)):_.frequency!=="always"&&e.current.persistence.saveFormDone(_.id),e.current.onComplete(_,g,c,d)};return{activeForm:t,fire:i,refresh:()=>{let c=t.value;if(!c)return;let d=e.current.forms.list.find(u=>u.id===c.form.id);d&&d!==c.form&&(t.value={form:d,trigger:c.trigger})},complete:c=>l(c,!1),skip:()=>l({},!0)}}function cp(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function dp(e,t){let n=e.when;if(!n)return!0;if(n.missingContext?.length){let a=t.userContext()??{};if(n.missingContext.some(i=>a[i]!==void 0&&a[i]!==""))return!1}if(n.pageArea&&!(Array.isArray(n.pageArea)?n.pageArea:[n.pageArea]).includes(t.pageArea()??""))return!1;let r=t.messageCount();return!(n.minMessages!=null&&r<n.minMessages||n.maxMessages!=null&&r>n.maxMessages)}function Nl(e){let t=x.cssPrefix,{site:n,blocks:r,strings:a,collapsed:i}=e,l=r?.navigation??[],s=r?.linkCards??[],c=i?a.expandSidebar:a.collapseSidebar;return o("aside",{class:`${t}-sidebar`,"data-collapsed":i?"true":"false","data-testid":w.sidebar,children:[o("div",{class:`${t}-sidebar-header`,children:[o(_p,{site:n}),o("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":i?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":w.sidebarToggle,children:o(up,{collapsed:i})})]}),i?null:o(te,{children:[l.length>0?o("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:o(pp,{items:l})}):null,s.length>0?o("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:o(mp,{items:s})}):null,e.showConversations?o("div",{class:`${t}-sidebar-conversations`,children:o(Lr,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function _p({site:e}){let t=x.cssPrefix;if(e?.logo?.url){let n=e.logo.alt??e.title??"Logo";return o("picture",{children:[e.logoDark?.url?o("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,o("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:n})]})}return o("div",{class:`${t}-sidebar-title`,children:e?.title??x.name})}function up({collapsed:e}){return o("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?o("polyline",{points:"9 6 15 12 9 18"}):o("polyline",{points:"15 6 9 12 15 18"})})}function pp({items:e}){let t=x.cssPrefix;return o("ul",{class:`${t}-sidebar-nav`,children:e.map(n=>o("li",{children:o("a",{class:`${t}-sidebar-nav-item`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[n.icon?o("span",{class:`${t}-sidebar-nav-icon`,"data-icon":n.icon}):null,o("span",{class:`${t}-sidebar-nav-label`,children:n.label})]})},n.id??n.label))})}function mp({items:e}){let t=x.cssPrefix;return o("div",{class:`${t}-sidebar-cards`,children:e.map(n=>o("a",{class:`${t}-sidebar-card`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[o("div",{class:`${t}-sidebar-card-label`,children:n.label}),n.description?o("div",{class:`${t}-sidebar-card-desc`,children:n.description}):null]},n.id??n.label))})}var Dl=x.cssPrefix;function Ol(e){return o("main",{class:`${Dl}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[o(Nl,{site:e.site,blocks:e.blocks,transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,showConversations:e.showConversations,onSelectConversation:e.onSelectConversation,onNewConversation:e.onNewConversation,collapsed:e.sidebarCollapsed,onToggleCollapsed:e.onToggleSidebarCollapsed}),o("section",{class:`${Dl}-page-chat`,"aria-label":"Chat",children:e.children})]})}var $l=e=>Object.fromEntries(e.map(t=>[t,[]]));function Bl(e,t,n){let r=B({activeTab:e,stacks:$l(t)});return{sig:r,switchTab(a){r.value.activeTab!==a&&(r.value={...r.value,activeTab:a},n?.(a))},push(a){let i=r.value,l=i.stacks[i.activeTab]??[];r.value={...i,stacks:{...i.stacks,[i.activeTab]:[...l,a]}}},pop(){let a=r.value,i=a.stacks[a.activeTab]??[];i.length!==0&&(r.value={...a,stacks:{...a.stacks,[a.activeTab]:i.slice(0,-1)}})},reset(a){r.value={activeTab:a,stacks:$l(t)}}}}var Hl=e=>e.stacks[e.activeTab]??[],zl=e=>Hl(e).at(-1),Fl=e=>Hl(e).length===0;var Ul={Icon:un};var _t=x.cssPrefix;function Mr({title:e,actions:t}){return o("header",{class:`${_t}-back-header`,"data-variant":"title",children:[o("span",{class:`${_t}-back-spacer`,"aria-hidden":"true"}),o("h1",{class:`${_t}-back-title`,children:e}),t??o("span",{class:`${_t}-back-spacer`,"aria-hidden":"true"})]})}function Nr({title:e,backLabel:t,onBack:n,actions:r,testid:a}){return o("header",{class:`${_t}-back-header`,"data-testid":a,children:[o("button",{type:"button",class:`${_t}-icon-btn`,onClick:n,"aria-label":t,title:t,children:o(_n,{})}),o("h1",{class:`${_t}-back-title`,children:e}),r??o("span",{class:`${_t}-back-spacer`,"aria-hidden":"true"})]})}var Ut=x.cssPrefix;function ql({placeholder:e,onActivate:t}){return o("button",{type:"button",class:`${Ut}-home-search`,onClick:t,"data-testid":w.homeSearch,children:[o("span",{class:`${Ut}-home-search-text`,children:e}),o("span",{class:`${Ut}-home-search-icon`,"aria-hidden":"true",children:o(Bo,{})})]})}function Wl({placeholder:e,value:t,onInput:n}){return o("div",{class:`${Ut}-home-search`,"data-input":"true",children:[o("input",{type:"search",class:`${Ut}-home-search-input`,placeholder:e,value:t,onInput:r=>n(r.currentTarget.value),"data-testid":w.helpSearch}),o("span",{class:`${Ut}-home-search-icon`,"aria-hidden":"true",children:o(Bo,{})})]})}var fn=x.cssPrefix;function Dr({title:e,subtitle:t,onClick:n,testid:r}){return o("button",{type:"button",class:`${fn}-list-row`,onClick:n,"data-testid":r,children:[o("span",{class:`${fn}-list-row-body`,children:[o("span",{class:`${fn}-list-row-title`,children:e}),t?o("span",{class:`${fn}-list-row-sub`,children:t}):null]}),o("span",{class:`${fn}-list-row-chevron`,"aria-hidden":"true",children:o($t,{})})]})}var Gl=x.cssPrefix;function Ge({tone:e="info",message:t,onRetry:n,strings:r}){return o("div",{class:`${Gl}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[o("span",{children:t}),n?o("button",{type:"button",class:`${Gl}-module-retry`,onClick:n,children:r.errorRetry}):null]})}var wt=x.cssPrefix,fp=J.scope("help"),gp=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function hp(e){let t=new Map;for(let n of e){let r=n.categories?.[0]??"";(t.get(r)??t.set(r,[]).get(r)).push(n)}return[...t.entries()]}function Vl(e,t){let n=t.toLowerCase(),r=n.indexOf(e);if(r!==-1)return 100-Math.min(r,99);let a=0;for(let i of e){if(a=n.indexOf(i,a),a===-1)return 0;a+=1}return 1}function vp(e,t){let n=t.toLowerCase().trim();return n?e.map(r=>({item:r,score:Math.max(Vl(n,r.title)*2,Vl(n,r.description??""))})).filter(r=>r.score>0).toSorted((r,a)=>a.score-r.score).map(r=>r.item):[]}function Kl({article:e,nav:t}){return o(Dr,{title:e.title,subtitle:e.description,onClick:()=>gp(t,e),testid:be(w.helpArticle,e.id)})}function bp({transport:e,strings:t,config:n,nav:r,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=A("loading"),[d,u]=A(t.errorGeneric),[_,g]=A([]),[f,m]=A(""),[C,v]=A(0);E(()=>{let P=!1;return c("loading"),e.listContent({tags:l,sortBy:"order",limit:100}).then(R=>{if(P)return;let z=R.items??[];g(z),c("loaded"),a.emit("contentView",{section:"help",tags:l?.join(","),count:z.length})}).catch(R=>{P||(fp.warn("listContent (help) failed",{err:R}),u(Pt(R,t)),c("error"))}),()=>{P=!0}},[e,l,C,a]);let b=Re(()=>vp(_,f),[_,f]);E(()=>{let P=f.trim();if(!P)return;let R=setTimeout(()=>a.emit("contentSearch",{queryLength:P.length,hitCount:b.length}),600);return()=>clearTimeout(R)},[f,b,a]);function y(){return f.trim().length>0?b.length===0?o(Ge,{message:t.helpSearchEmpty,strings:t}):o("div",{class:`${wt}-help-card`,children:b.map(P=>o(Kl,{article:P,nav:r},P.id))}):s==="loading"?o(Ge,{message:t.helpLoading,strings:t}):s==="error"?o(Ge,{tone:"error",message:d,onRetry:()=>v(P=>P+1),strings:t}):_.length===0?o(Ge,{message:t.helpEmpty,strings:t}):hp(_).map(([P,R])=>o("section",{class:`${wt}-help-group`,children:[P?o("h2",{class:`${wt}-help-section-title`,children:P}):null,o("div",{class:`${wt}-help-card`,children:R.map(z=>o(Kl,{article:z,nav:r},z.id))})]},P))}return o("div",{class:`${wt}-module`,children:[o(Mr,{title:t.helpTitle,actions:o(Ye,{panelProps:i,variant:"plain"})}),o("div",{class:`${wt}-module-pad`,children:o(Wl,{placeholder:t.helpSearchPlaceholder,value:f,onInput:m})}),o("div",{class:`${wt}-help-list`,children:y()})]})}var jl={Icon:$o,Root:e=>o(bp,{...e})};var Xl=x.cssPrefix;function na({onClick:e,children:t,testid:n}){return e?o("button",{type:"button",class:`${Xl}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):o("div",{class:`${Xl}-home-card`,"data-testid":n,children:t})}var se=x.cssPrefix,Yl=J.scope("home");function Pp(e){let t=e.options.userContext?.name,n=e.config.greetingText?Ee(e.strings,e.config.greetingText):void 0;return n?{title:t?n.replace("{name}",t):n.replace(/\s*\{name\}\s*/," ").trim(),subtitle:e.strings.homeGreetingLead}:t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}var xp=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function yp(e){let{transport:t,strings:n,config:r,nav:a,bus:i,panelProps:l}=e,[s,c]=A(null),[d,u]=A([]),_=r.contentTags?.join(",");E(()=>{if(!r.showRecentConversations)return;let b=!1;return t.listConversations({limit:1}).then(y=>!b&&c(y.conversations?.[0]??null)).catch(y=>!b&&Yl.warn("listConversations (home) failed",{err:y})),()=>{b=!0}},[t,r.showRecentConversations]),E(()=>{if(!r.contentTags?.length)return;let b=!1;return t.listContent({tags:r.contentTags,limit:6}).then(y=>{if(b)return;let P=y.items??[];u(P),i.emit("contentView",{section:"home",tags:_,count:P.length})}).catch(y=>!b&&Yl.warn("listContent (home) failed",{err:y})),()=>{b=!0}},[t,_,i]);let g=Pp(e),f=r.userAvatars??[],m=r.status,C=m?.text?Ee(n,m.text):n.homeStatus,v=r.contentBlockTitle?Ee(n,r.contentBlockTitle):n.homeContentTitle;return o("div",{class:`${se}-module ${se}-home`,"data-testid":w.homeView,children:o("div",{class:`${se}-home-scroll`,children:[o("div",{class:`${se}-home-hero`,children:[o("div",{class:`${se}-home-hero-top`,children:[r.brandName?o("span",{class:`${se}-home-brand`,"data-testid":w.homeBrand,children:r.brandName}):o("span",{class:`${se}-home-brand-spacer`,"aria-hidden":"true"}),o("div",{class:`${se}-home-hero-actions`,children:[f.length>0?o("div",{class:`${se}-home-avatars`,children:f.map(b=>o("span",{class:`${se}-home-avatar`,title:b.role?`${b.name} \xB7 ${b.role}`:b.name,children:b.avatar?o("img",{src:b.avatar,alt:"",loading:"lazy"}):o("span",{children:Pr(b.name)})},b.name))}):null,o(Ye,{panelProps:l,variant:"plain"})]})]}),r.showGreeting!==!1?o(te,{children:[o("h1",{class:`${se}-home-greeting`,"data-testid":w.homeGreeting,children:g.title}),g.subtitle?o("p",{class:`${se}-home-lead`,children:g.subtitle}):null]}):null]}),o("div",{class:`${se}-home-cards`,children:[r.showSearchBar!==!1?o(ql,{placeholder:n.homeSearchPlaceholder,onActivate:()=>a.switchToLayout("help")}):null,s?o(na,{onClick:()=>a.selectConversation(s.conversationId),testid:w.homeRecent,children:o("div",{class:`${se}-home-recent-row`,"data-unread":(s.unreadCount??0)>0?"true":void 0,children:[o("span",{class:`${se}-home-recent-avatar`,"aria-hidden":"true",children:o(un,{})}),o("span",{class:`${se}-home-recent-body`,children:[o("span",{class:`${se}-home-recent-title`,children:s.title}),s.preview?o("span",{class:`${se}-home-recent-preview`,children:s.preview}):null]}),(s.unreadCount??0)>0?o("span",{class:`${se}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,m?o(na,{onClick:m.url?()=>a.push({kind:"iframe",url:m.url,title:C}):void 0,children:o("div",{class:`${se}-home-status`,"data-level":m.level??"operational",children:[o("span",{class:`${se}-home-status-icon`,"aria-hidden":"true",children:o(zs,{})}),o("span",{class:`${se}-home-status-text`,children:C})]})}):null,d.length>0?o("section",{class:`${se}-home-content`,children:[o("div",{class:`${se}-home-content-title`,children:v}),o("div",{class:`${se}-home-content-list`,children:d.map(b=>o(Dr,{title:b.title,subtitle:b.description,onClick:()=>xp(a,b),testid:be(w.homeContentRow,b.id)},b.id))})]}):null]})]})})}var Jl={Icon:Fs,Root:e=>o(yp,{...e})};var ut=x.cssPrefix,Sp=J.scope("news");function wp({transport:e,strings:t,config:n,nav:r,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=A("loading"),[d,u]=A(t.errorGeneric),[_,g]=A([]),[f,m]=A(0);E(()=>{let v=!1;return c("loading"),e.listContent({tags:l,sortBy:"publishedAt",sortOrder:"desc"}).then(b=>{if(v)return;let y=b.items??[];g(y),c("loaded"),a.emit("contentView",{section:"news",tags:l?.join(","),count:y.length})}).catch(b=>{v||(Sp.warn("listContent (news) failed",{err:b}),u(Pt(b,t)),c("error"))}),()=>{v=!0}},[e,l,f,a]);function C(){return s==="loading"?o(Ge,{message:t.newsLoading,strings:t}):s==="error"?o(Ge,{tone:"error",message:d,onRetry:()=>m(v=>v+1),strings:t}):_.length===0?o(Ge,{message:t.newsEmpty,strings:t}):o("div",{class:`${ut}-news-list`,children:_.map(v=>o("button",{type:"button",class:`${ut}-news-card`,onClick:()=>r.push({kind:"content",id:v.id,title:v.title}),"data-testid":be(w.newsItem,v.id),children:[v.image?o("img",{class:`${ut}-news-hero`,src:v.image,alt:"",loading:"lazy"}):null,o("span",{class:`${ut}-news-body`,children:[o("span",{class:`${ut}-news-title`,children:v.title}),v.description?o("span",{class:`${ut}-news-summary`,children:v.description}):null]})]},v.id))})}return o("div",{class:`${ut}-module`,children:[o(Mr,{title:t.newsTitle,actions:o(Ye,{panelProps:i,variant:"plain"})}),o("div",{class:`${ut}-module-scroll`,children:C()})]})}var Ql={Icon:Us,Root:e=>o(wp,{...e})};var Or={chat:Ul,home:Jl,help:jl,news:Ql};var gn=x.cssPrefix;function Zl({modules:e,activeTab:t,strings:n,unreadCount:r,onSelect:a}){return o("nav",{class:`${gn}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let l=Or[i.layout].Icon,s=i.id===t,c=i.layout==="chat"&&r>0?r>9?"9+":String(r):null;return o("button",{type:"button",role:"tab","aria-selected":s,class:`${gn}-tab`,onClick:()=>a(i.id),"data-testid":be(w.tab,i.id),children:[o("span",{class:`${gn}-tab-icon`,"aria-hidden":"true",children:[o(l,{}),c?o("span",{class:`${gn}-tab-badge`,"data-testid":w.tabBadge,children:c}):null]}),o("span",{class:`${gn}-tab-label`,children:Ee(n,i.label)})]},i.id)})})}var ec=x.cssPrefix,kp="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function tc({url:e,title:t,strings:n,onBack:r,actions:a}){return o("div",{class:`${ec}-module`,children:[o(Nr,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:r,actions:a}),o("iframe",{class:`${ec}-content-frame`,src:e,title:t||"content",sandbox:kp,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var hn=x.cssPrefix,Cp=J.scope("content"),Tp=5e3;function nc({id:e,title:t,transport:n,strings:r,bus:a,onBack:i,actions:l}){let[s,c]=A(null),[d,u]=A(!1),[_,g]=A(0),f=O(()=>{u(!1),c(null),g(v=>v+1)},[]);E(()=>{let v=!1;return n.listContent({ids:[e],limit:1}).then(b=>{if(v)return;let y=b.items[0];y?(c(y),a.emit("contentOpen",{contentId:e,tags:y.tags?.length?y.tags.join(","):void 0})):u(!0)}).catch(b=>{v||(Cp.warn("listContent (reader) failed",{err:b}),u(!0))}),()=>{v=!0}},[n,e,_,a]),E(()=>{if(!s)return;let v=setTimeout(()=>a.emit("contentRead",{contentId:e}),Tp);return()=>clearTimeout(v)},[s,e,a]);let m=O(v=>{let y=v.target?.closest?.("a")?.getAttribute("href")??"";y&&!y.startsWith("#")&&a.emit("contentLinkClick",{contentId:e})},[a,e]);function C(){return d?o(Ge,{tone:"error",message:r.errorGeneric,onRetry:f,strings:r}):s===null?o(Ge,{message:r.contentLoading,strings:r}):o("article",{class:`${hn}-content`,"data-testid":w.contentView,onClick:m,children:[s.image?o("img",{class:`${hn}-content-hero`,src:s.image,alt:"",loading:"lazy"}):null,s.description?o("p",{class:`${hn}-content-subtitle`,children:s.description}):null,o(bl,{text:s.content??""})]})}return o("div",{class:`${hn}-module`,children:[o(Nr,{title:s?.title||t||r.moduleBack,backLabel:r.moduleBack,onBack:i,actions:l,testid:w.backHeader}),o("div",{class:`${hn}-module-scroll`,"data-testid":w.contentScroll,children:C()})]})}var $r=x.cssPrefix;function rc({panelProps:e,enabledModules:t,nav:n,bus:r,unreadCount:a,onSelectConversation:i,onStartNewConversation:l,onSetPanelSize:s}){let c=e.options,d=c.strings,u=D(null),_=D(new Set);E(()=>{let Q=u.current;if(!Q)return;let he=br(Q),k=X=>{X.key==="Escape"&&e.onClose?.()};return Q.addEventListener("keydown",k),()=>{he(),Q.removeEventListener("keydown",k)}},[e.onClose]);let g=D(null),f=O(Q=>{g.current?.attachFromDrop(Q)},[]),{visible:m}=yr({containerRef:u,onDrop:f});hr(u.current,c.mode==="modal");let C=Y(()=>n.sig.value).value,v=zl(C),b=c.modules.byId[C.activeTab],y=v?.kind==="iframe"||v?.kind==="content",P=t.length>1&&(Fl(C)||!y),R=D(null);E(()=>{if(y&&R.current===null)R.current=e.panelSize,e.panelSize==="normal"&&s("expanded");else if(!y&&R.current!==null){let Q=R.current;R.current=null,s(Q)}},[y]);let z={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:Q=>{let he=t.find(k=>k.layout===Q);he&&n.switchTab(he.id)},selectConversation:i,startNewConversation:l},K=Q=>({options:c,transport:e.transport,strings:d,config:Q,visitorId:e.visitorId,nav:z,bus:r,panelProps:e}),L=o(Ye,{panelProps:e,variant:"plain"});b&&_.current.add(b.id);let G=t.filter(Q=>_.current.has(Q.id)),H=Q=>{if(Q.layout==="chat")return o(ea,{...e,containerEl:u.current,dragOver:m,composerAttachApiRef:g});let he=Or[Q.layout].Root;return he?o(he,{...K(Q)}):null},j=()=>v?.kind==="iframe"?o(tc,{url:v.url,title:v.title,strings:d,onBack:n.pop,actions:L}):v?.kind==="content"?o(nc,{id:v.id,title:v.title,transport:e.transport,strings:d,bus:r,onBack:n.pop,actions:L}):null;return o("div",{ref:u,class:`${$r}-panel ${$r}-messenger`,role:"dialog","aria-modal":"false","aria-label":d.panelTitle,style:{position:"relative"},"data-testid":w.messengerHome,children:[o("div",{class:`${$r}-messenger-body`,children:[G.map(Q=>o("div",{class:`${$r}-messenger-pane`,hidden:y||Q.id!==b?.id,children:H(Q)},Q.id)),j()]}),P?o(Zl,{modules:t,activeTab:C.activeTab,strings:d,unreadCount:a,onSelect:n.switchTab}):null,o(ta,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(b?.layout==="chat"&&!v)?o(gr,{panelEl:u.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:d}):null]})}var vn=x.cssPrefix;function oc({strings:e,onClose:t}){return o("div",{class:`${vn}-panel ${vn}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":w.modulesEmpty,children:[t?o("button",{type:"button",class:`${vn}-icon-btn ${vn}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:o(Xe,{})}):null,o("p",{class:`${vn}-modules-empty-text`,children:e.modulesEmpty})]})}function ac({callout:e,persistence:t}){let n=e?.text??"",r=e?.persistent??!0,[a,i]=A(()=>r?!1:t.loadCalloutDismissed(n));E(()=>{i(r?!1:t.loadCalloutDismissed(n))},[n,r,t]);let l=O(()=>{i(!0),r||t.saveCalloutDismissed(n)},[t,n,r]);return{dismissed:a,dismissCallout:l}}var W=J.scope("app"),Br=x.cssPrefix;function ic(e,t){return cs({...e,text:Ee(t,e.text)})}function Ep(e){let t=e.partsSig.value.filter(n=>n.kind==="tool");return t.length>0&&t.every(n=>{let r=n.stateSig.value;return r==="output-available"||r==="output-error"||r==="output-denied"||r==="approval-responded"})}function sc(e){return e instanceof DOMException?e.name==="AbortError":e?.name==="AbortError"}function lc({options:e,hostElement:t,bus:n}){let[r]=A(()=>It(e.widgetId,e.storage,e.aiAgentDeploymentId)),[a,i]=A(()=>r.getVisitorId()),l=r.loadUserPrefs(),[s,c]=A(()=>l.locale??e.locale),[d,u]=A(()=>l.themeMode??e.themeMode),[_,g]=A(()=>l.textSize??e.textSize),f=on(r.loadConversationId()),m=on([]),C=on(0),[v,b]=A(!1),[y,P]=A([]);function R(){let p=e.modules.list,h=new Set(p.map(N=>N.id)),T=r.loadActiveModule();return T&&h.has(T)?T:p[0]?.id??""}function z(){return e.modules.list.find(p=>p.layout==="chat")?.id}let K=D();if(!K.current){let p=e.modules.list.map(h=>h.id);K.current=Bl(R(),p,h=>r.saveActiveModule(h))}let L=K.current,G=D(void 0);G.current=z();let[H,j]=A(!1),[Q,he]=A(null),[k,X]=A(!1),oe=e.mode==="standalone"||e.mode==="inline",ce=D(an(e,Ot(),r.loadPanelOpen(),r.loadPanelSize())),[_e,Ie]=A(ce.current.panelOpen),[ae,Pe]=A(ce.current.panelOpen),Qe=D(ae);Qe.current=ae;let S=D(!1),F=D(void 0);E(()=>{_e&&Pe(!0)},[_e]);let xe=D(!1),[ye,Se]=A(!1),{dismissed:Ve,dismissCallout:Ke}=ac({callout:e.launcher.callout,persistence:r}),Ze=e.launcher.callout?.persistent??!0,He=O(()=>{W.info("calloutDismiss"),n.emit("calloutDismiss",void 0),Ke()},[n,Ke]),[Le,ze]=A(ce.current.panelSize),Fr=D(!1),[pc,Ur]=A("chat"),[qt,Wt]=A(!0),[we,bn]=A(!1),[mc,aa]=A(null),[qr,Pn]=A([]),[ia,xn]=A(null),[yn,Sn]=A(null),wn=D(e.strings),[fc,gc]=A(void 0),[hc,vc]=A(void 0),[bc,Pc]=A(()=>r.loadSidebarCollapsed()??!1),[Wr,xc]=A({}),[V]=A(()=>new sr({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Xi({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[Me]=A(()=>new dr(m)),[ie]=A(()=>new pr(e.sound,e.haptics)),je=O(p=>{r.patchUserPrefs(p),V.saveUserPrefs(r.loadUserPrefs()).catch(h=>{W.warn("saveUserPrefs failed",{err:h})})},[r,V]);E(()=>{l.soundMuted!==void 0&&ie.setMuted(l.soundMuted)},[]),E(()=>{t.dataset.theme=d},[t,d,e]),E(()=>{t.dataset.textSize=_},[t,_,e]),E(()=>{ie.update(e.sound,e.haptics)},[ie,e.sound,e.haptics]),E(()=>()=>ie.destroy(),[ie]),E(()=>{let p=!0;return ie.mutedSig.subscribe(h=>{if(p){p=!1;return}je({soundMuted:h})})},[ie,je]),E(()=>{Fr.current||!e.size.initialSize||(Fr.current=!0,!r.loadPanelSize()&&ze(Io(e.mode,e.size,Ot())))},[e.mode,e.size,r]),E(()=>{if(!H||xe.current)return;xe.current=!0;let p=an(e,Ot(),r.loadPanelOpen(),r.loadPanelSize());Ie(p.panelOpen),ze(p.panelSize)},[H,e,r]);let sa=D(!1),la=D(!1),Gt=D(null),Gr=D(null),Vr=D(!1);E(()=>{if(!(!H||sa.current)){if(sa.current=!0,la.current){let p=G.current;p&&L.switchTab(p);return}L.reset(R())}},[H]);let kn=O(p=>{!p||p.length===0||(m.value=p.map(h=>ic(h,wn.current)))},[m]),Kr=D(null),Cn=O(async p=>{try{let{formSubmissions:h}=await(p?V.bootstrap(p):Kr.current??V.bootstrap()),T=new Map;return h.forEach((N,U)=>T.set(N.formId,U)),h.filter((N,U)=>!N.skipped||T.get(N.formId)===U).map((N,U)=>({key:`wire:${N.formId}:${N.createdAt??U}`,formId:N.formId,outcome:N.skipped?"skipped":"submitted",createdAt:ir(N.createdAt),values:N.values}))}catch(h){return W.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:h}),[]}},[V]),Vt=D(0),Kt=O((p,h)=>{let T=[...p.map(I=>I.createdAt),...h.map(I=>I.createdAt)].filter(I=>I!==void 0),N=(T.length?Math.min(...T):Date.now())-1;return[...(F.current?.messages??[]).map(I=>{let Te=ic(I,wn.current);return Te.createdAt=N,Te}),...p]},[]),jr=O(async p=>{let h=Vt.current,T=()=>h!==Vt.current;b(!0);try{let[N,U]=await Promise.all([V.loadConversation(p),Cn()]);if(T())return;let I=Do(N.messages??[]);P(U);let Te=Gt.current?[Gt.current]:[];I.length||Te.length?(m.value=[...Kt(I,U),...Te],Wt(N.canContinue??!0),Pn(N.suggestions??[])):m.value=Kt([],U),V.resumeStatus==="needs-generation"&&Gr.current?.()}catch(N){if(T())return;W.warn("loadThread failed; resetting conversationId",{err:N,conversationId:p}),f.value=void 0,r.saveConversationId(void 0)}finally{T()||b(!1)}},[V,Cn,m,f,r,Kt]),jt=O(async({newConversation:p})=>{let h=++Vt.current,T=()=>h!==Vt.current,N=f.value,U=p||!N?Ue():N;U!==N&&(f.value=U,r.saveConversationId(U));let I;try{I=await V.handshake({visitorId:a,conversationId:U,userPrefs:r.loadUserPrefs(),locale:s})}catch(Fe){if(T())return;n.emit("error",Fe),e.onError?.(Fe),p||j(!0);return}if(T())return;if(I.visitorId&&I.visitorId!==a&&(W.info("visitor rebound",{previous:a,current:I.visitorId,reason:I.rebind?.visitorId}),r.setVisitorId(I.visitorId),i(I.visitorId),n.emit("visitorRebound",{previous:a,current:I.visitorId,reason:I.rebind?.visitorId})),I.conversationId&&I.conversationId!==U&&(W.info("conversation rebound",{previous:U,current:I.conversationId,reason:I.rebind?.conversationId}),n.emit("conversationRebound",{previous:U,current:I.conversationId,reason:I.rebind?.conversationId})),I.agent&&aa(I.agent),e.mode==="page"&&(I.site&&Vi(I.site)?gc(I.site):I.site&&W.warn("invalid site config, using fallback",{site:I.site}),I.blocks&&Ki(I.blocks)?vc(I.blocks):I.blocks&&W.warn("invalid blocks config, using fallback",{blocks:I.blocks})),I.userPrefs&&!p&&(r.saveUserPrefs(I.userPrefs),I.userPrefs.locale&&c(I.userPrefs.locale),I.userPrefs.soundMuted!==void 0&&ie.setMuted(I.userPrefs.soundMuted),I.userPrefs.themeMode&&u(I.userPrefs.themeMode),I.userPrefs.textSize&&g(I.userPrefs.textSize)),F.current=I.welcome,p||n.emit("handshake",I),I.welcome?.suggestions){let Fe=wn.current;Pn(I.welcome.suggestions.map(ke=>({...ke,label:Ee(Fe,ke.label),...ke.text===void 0?{}:{text:Ee(Fe,ke.text)}})))}!p&&N&&I.conversationId===N?Qe.current?jr(N):S.current=!0:(f.value=I.conversationId,r.saveConversationId(I.conversationId),kn(I.welcome?.messages)),p||j(!0)},[V,a,r,e,n,f,ie,kn,jr,s]),Xt=JSON.stringify(e.userContext??null),yc=JSON.stringify(e.pageContext??null),Sc=JSON.stringify(Wr);E(()=>{let p=Object.keys(Wr).length?{...Wr,...e.userContext}:e.userContext;V.setContext(p,Rp(e.pageContext))},[V,Xt,yc,Sc]);let $e=At(s,e.availableLocales,e.defaultLocale);E(()=>{V.setLocale($e)},[V,$e]),E(()=>{t.dir=za($e)?"rtl":"ltr"},[t,$e]),E(()=>{$e!==s&&c($e)},[$e,s]);let Tn=O(p=>{if(p.type!=="data-conversation-rebind")return!1;let h=p.data?.conversationId;if(h&&h!==f.value){let T=f.value;f.value=h,r.saveConversationId(h),V.primeIdentity(void 0,h),W.info("conversation rebound (in-stream)",{previous:T,current:h}),T&&n.emit("conversationRebound",{previous:T,current:h,reason:h})}return!0},[f,r,V,n]),ca=O(async p=>{let h=null;try{for await(let T of p.iter)if(!Tn(T.chunk)){if(!h){h=sn(),Gt.current=h,Me.attach(h),m.value=[...m.value,h],bn(!0),xn(()=>p.cancel),Sn(()=>p.detach),la.current=!0;let N=G.current;N&&L.switchTab(N),W.info("resumed in-flight reply on mount")}Me.apply(T.chunk),T.chunk.type==="finish"&&T.chunk.canContinue===!1&&Wt(!1)}h&&(h.status==="error"||rt(h)?(h.status="error",h.errorText=e.strings.errorGeneric,ie.play("error")):(h.status="complete",ie.play("messageReceived"),ra(n,e,"assistant",lr(h))))}catch(T){h&&(sc(T)?cr(h)?m.value=m.value.filter(N=>N!==h):h.status="complete":(h.status="error",h.errorText=Pt(T,e.strings),ie.play("error"))),W.debug("resume ended without completing",{err:T})}finally{Gt.current=null,h&&(Me.detach(),bn(!1),xn(null),Sn(null),m.value=[...m.value])}},[Me,m,ie,n,e,L,Tn]),da=D(null),Xr=O(async()=>{let p=V.resumeStream();da.current=p,await ca(p),V.resumeStatus==="needs-generation"&&Gr.current?.()},[V,ca]);E(()=>{let p=f.value;return p&&V.primeIdentity(a,p),jt({newConversation:!1}),()=>{Vt.current++,da.current?.cancel()}},[]),E(()=>{ae&&(Kr.current=V.bootstrap(),(async()=>{try{let p=await Kr.current;he(Zt((p??{forms:[]}).forms,$e))}catch(p){W.debug("bootstrap failed \u2014 treating as no forms",{err:p})}finally{X(!0)}})(),(async()=>{let p=[];if(S.current){S.current=!1;let h=f.value;h&&p.push(jr(h))}f.value&&p.push(Xr()),p.length!==0&&await Promise.allSettled(p)})())},[ae]);let En=D(null);E(()=>{if(!ae)return;if(En.current===null){En.current=$e;return}if(En.current===$e)return;En.current=$e;let p=!1;return V.bootstrap().then(h=>{p||he(Zt((h??{forms:[]}).forms,$e))}).catch(h=>W.debug("forms re-localize failed \u2014 keeping current copy",{err:h})),()=>{p=!0}},[ae,$e,V]);let _a=D(Xt);E(()=>{!H||_a.current===Xt||(_a.current=Xt,jt({newConversation:!1}))},[Xt,H,jt]),ht(()=>{jn(t,or(e.mode,Le,_e))},[t,_e,Le,e.mode]),E(()=>{if(e.mode!=="modal"||!_e)return;let p=h=>{h.composedPath().some(U=>U instanceof HTMLElement&&U.classList.contains(`${x.cssPrefix}-panel`))||Ie(!1)};return t.addEventListener("click",p),()=>t.removeEventListener("click",p)},[t,_e,e.mode]),E(()=>{if(e.mode!=="drawer"||!_e)return;let p=h=>{h.key==="Escape"&&Ie(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[_e,e.mode]);let it=O(async(p,{continueExisting:h})=>{let T=f.value??Ue();f.value||(f.value=T,r.saveConversationId(T));let N=(h?m.value:m.value.slice(0,-1)).filter(Te=>!Te.ephemeral),U=ns({messages:N.map(ds),conversationId:T,tools:e.features.tools,visitorId:a,userPrefs:r.loadUserPrefs()});bn(!0);let I=V.sendMessage(U);xn(()=>I.cancel),Sn(()=>I.detach);try{for await(let ke of I.iter)Tn(ke.chunk)||(Me.apply(ke.chunk),ke.chunk.type==="finish"&&ke.chunk.canContinue===!1&&Wt(!1));let Te=p.status==="error",Fe=rt(p);if(Te||Fe){p.status="error",p.errorText=e.strings.errorGeneric,ie.play("error");let ke=new Error(Te?"stream error chunk":"empty reply");n.emit("error",ke),e.onError?.(ke)}else p.status="complete",ie.play("messageReceived"),ra(n,e,"assistant",lr(p))}catch(Te){sc(Te)?cr(p)?m.value=m.value.filter(Fe=>Fe!==p):p.status="complete":(p.status="error",p.errorText=Pt(Te,e.strings),ie.play("error"),n.emit("error",Te),e.onError?.(Te))}finally{Me.detach(),bn(!1),xn(null),Sn(null),m.value=[...m.value]}},[V,Me,m,f,e,n,ie,r,a,Tn]),ua=O(()=>{if(we||Vr.current||Gt.current||m.value.filter(T=>!T.ephemeral).at(-1)?.role!=="user")return;Vr.current=!0,W.info("regenerating dangling user turn (needs-generation)");let h=sn();m.value=[...m.value,h],Me.attach(h),it(h,{continueExisting:!1}).finally(()=>{Vr.current=!1})},[we,m,Me,it]);E(()=>{Gr.current=ua},[ua]);let Rn=O((p,h)=>{if(we)return;let T=m.value.at(-1),N=T?.partsSig.value.find(U=>U.kind==="tool"&&U.toolCallId===p);if(!T||!N){W.warn("decideTool: tool part not found",{toolCallId:p});return}h(N),T.partsSig.value=[...T.partsSig.value],Ep(T)&&(T.status="streaming",m.value=[...m.value],Me.attach(T),it(T,{continueExisting:!0}))},[we,m,Me,it]),pa=O((p,h)=>{W.info("toolResult",{toolCallId:p}),n.emit("toolResult",{toolCallId:p}),Rn(p,T=>{T.outputSig.value=h,T.stateSig.value="output-available"})},[n,Rn]),ma=O((p,h,T)=>{W.info("toolDecision",{toolCallId:p,approved:h}),n.emit("toolDecision",{toolCallId:p,approved:h}),Rn(p,N=>{let U=N.approvalSig.value?.id??p;N.approvalSig.value={id:U,approved:h,reason:T},N.stateSig.value="approval-responded"})},[n,Rn]),fa=O(p=>{if(we)return;let h=m.value.at(-1),T=h?.partsSig.value.find(U=>U.kind==="tool"&&U.toolCallId===p);if(!h||!T)return;let N=T.approvalSig.value?.id??p;T.approvalSig.value={id:N},T.stateSig.value="approval-requested",h.partsSig.value=[...h.partsSig.value]},[we,m]),wc=Re(()=>({humanInLoop:e.features.humanInLoop,onResult:pa,onDecision:ma,onEdit:fa}),[e.features.humanInLoop,pa,ma,fa]),kc=()=>m.value.reduce((p,h)=>p+(h.role==="user"?1:0),0),kt=e.forms.list.length>0?e.forms:Q??e.forms,ue=Ml({forms:kt,persistence:r,userContext:()=>e.userContext,messageCount:kc,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>f.value,onComplete:(p,h,T,N)=>{W.info("formSubmit",{formId:p.id,trigger:h,skipped:N}),n.emit("formSubmit",{formId:p.id,values:T,skipped:N}),P(I=>{let Fe=I.find(ke=>ke.formId===p.id&&ke.outcome==="skipped")?.createdAt??Date.now();return[...I.filter(ke=>!(ke.formId===p.id&&ke.outcome==="skipped")),{key:`local:${p.id}:${Fe}`,formId:p.id,outcome:N?"skipped":"submitted",createdAt:Fe,...N?{}:{values:T}}]});let U=f.value??Ue();f.value||(f.value=U,r.saveConversationId(U),V.primeIdentity(void 0,U)),!N&&p.mirrorToContext&&xc(I=>({...I,...T})),V.submitForm({formId:p.id,conversationId:U,trigger:h,values:T,skipped:N})}}),Cc=Y(()=>ue.activeForm.value);E(()=>{ue.refresh()},[kt,ue]);let ga=e.pageContext?.area?String(e.pageContext.area):void 0,Tc=Y(()=>m.value.length);E(()=>{H&&k&&ue.fire("pre-chat")},[H,k,ue]),E(()=>{k&&!qt&&ue.fire("conversation-closed")},[k,qt,ue]),E(()=>{H&&k&&ga&&ue.fire("page-area")},[H,k,ga,ue]);let Yr=Re(()=>{let p=kt.list.flatMap(h=>h.triggers).filter(h=>h.kind==="idle").map(h=>Number(h.param));return p.length?Math.min(...p)*1e3:0},[kt]);E(()=>{if(!Yr||!_e)return;let p=setTimeout(()=>ue.fire("idle"),Yr);return()=>clearTimeout(p)},[Yr,_e,ue,Tc.value]);let ha=O(async(p,h)=>{if(W.info("send",{textLen:p.length,attachments:h.length,streaming:we}),we)return;n.emit("send",{text:p,attachmentCount:h.length}),qr.length>0&&Pn([]);let T=await Ip(V,h,I=>{W.warn("upload failed",{err:I}),n.emit("error",I),e.onError?.(I)});ie.unlock(),ie.play("messageSent");let N=ls(p,T),U=sn();m.value=[...m.value,N,U],Me.attach(U),ra(n,e,"user",p),await it(U,{continueExisting:!1}),ue.fire("after-messages")},[we,V,n,e,qr.length,m,Me,it,ue]),Ec=O(()=>{W.info("stop"),n.emit("stop",void 0),ia?.()},[ia,n]),Rc=O(()=>{if(we)return;let p=m.value,h=p.at(-1);if(!h||h.role!=="assistant"||h.status!=="error"&&!rt(h))return;let T=sn();m.value=[...p.slice(0,-1),T],Me.attach(T),W.info("retry"),it(T,{continueExisting:!1})},[we,m,Me,it]),Ac=O(()=>{ie.toggleMuted();let p=ie.mutedSig.value;W.info("soundToggle",{muted:p}),n.emit("soundToggle",{muted:p})},[ie,n]),Yt=O(()=>{if(el(e.mode,Le)==="exit-fullscreen"){W.info("close \u2192 exit-fullscreen",{mode:e.mode}),ze("normal"),n.emit("fullscreen",!1);return}W.info("close \u2192 panel closed",{mode:e.mode}),ue.fire("panel-close"),Ie(!1),r.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,r,Le,ue]),Ct=O(()=>{e.modules.list.some(p=>p.layout==="chat")&&V.listConversations({limit:50}).then(p=>{C.value=p.conversations.reduce((h,T)=>h+(T.unreadCount??0),0)}).catch(p=>W.debug("refreshUnread failed (non-fatal)",{err:p}))},[V,e.modules,C]),va=D(!1);E(()=>{!ae||!H||va.current||(va.current=!0,Ct())},[ae,H,Ct]);let Jr=O(()=>{W.info("open",{mode:e.mode}),ie.unlock(),Se(!0),Ie(!0),r.savePanelOpen(!0),!Ve&&!Ze&&He(),setTimeout(()=>Se(!1),Ap),Ct(),n.emit("open",void 0),e.onOpen?.()},[n,e,ie,r,Ve,Ze,He,Ct]),Qr=O(()=>{if(!m.value.some(h=>h.role==="user")&&qt&&f.value){W.info("clear \u2192 reusing empty conversation",{conversationId:f.value}),m.value.length===0&&kn(F.current?.messages);return}W.info("clear \u2192 new conversation",{wasStreaming:we}),n.emit("clear",void 0),we&&yn?.(),Mt(()=>{m.value=[],f.value=void 0}),r.clearConversation(),Wt(!0),P([]),jt({newConversation:!0})},[we,yn,m,f,r,jt,n,qt,kn]),Zr=O(()=>{Qr(),Ur("chat");let p=e.modules.list.find(h=>h.layout==="chat")?.id;p&&L.switchTab(p)},[Qr,L,e]),eo=O(()=>{let p=Le==="expanded"?"normal":"expanded";W.info("expand",{from:Le,expanded:p==="expanded"}),ze(p),r.savePanelSize(p),n.emit("expand",p==="expanded")},[n,Le,r]),to=O(()=>{let p=Le==="fullscreen"?"normal":"fullscreen";W.info("fullscreen",{from:Le,fullscreen:p==="fullscreen"}),ze(p),r.savePanelSize(p),n.emit("fullscreen",p==="fullscreen")},[n,Le,r]),Ic=O(()=>{Ur(p=>{let h=p==="history"?"chat":"history";return W.info("toggleHistory",{view:h}),n.emit("toggleHistory",{view:h}),h})},[n]),Lc=O(p=>{W.info("localeChange",{locale:p}),c(p),je({locale:p}),n.emit("localeChange",p)},[je,n]),Mc=O(p=>{W.info("themeChange",{mode:p}),u(p),t.dataset.theme=p,je({themeMode:p}),n.emit("themeChange",p)},[t,je,n]),Nc=O(p=>{W.info("textSizeChange",{size:p}),g(p),t.dataset.textSize=p,je({textSize:p}),n.emit("textSizeChange",p)},[t,je,n]),Dc=O(()=>{Pc(p=>{let h=!p;return W.info("sidebarToggle",{collapsed:h}),r.saveSidebarCollapsed(h),n.emit("sidebarToggle",{collapsed:h}),h})},[r,n]),Oc=O(p=>{W.info("resize",p),je({widgetSize:p}),n.emit("resize",p)},[je,n]),no=O(async p=>{W.info("selectConversation",{conversationId:p,wasStreaming:we}),n.emit("selectConversation",{conversationId:p}),we&&yn?.();try{let[h,T]=await Promise.all([V.loadConversation(p),Cn(p)]),N=Do(h.messages);Mt(()=>{m.value=Kt(N,T),f.value=h.conversationId}),P(T),r.saveConversationId(h.conversationId),V.primeIdentity(a,h.conversationId),h.agent&&aa(h.agent),Wt(h.canContinue),Pn(h.suggestions??[]),Ur("chat"),Xr(),await V.markRead(p),Ct()}catch(h){n.emit("error",h),e.onError?.(h)}},[V,m,f,n,e,r,Ct,Cn,Kt,we,yn,a,Xr]),An=D(null),ba=O(p=>{typeof p=="string"&&(k?ue.fire("manual",p):An.current=p)},[k,ue]);E(()=>{!k||!An.current||(ue.fire("manual",An.current),An.current=null)},[k,ue]),E(()=>ji(t,{open:Jr,close:Yt,expand:eo,fullscreen:to,openForm:ba}),[t,Jr,Yt,eo,to,ba]);let De=Re(()=>xo(e,s,d,_),[e,s,d,_]);wn.current=De.strings;let $c=Re(()=>y.map(p=>{let h=kt.list.find(T=>T.id===p.formId);return{...p,title:h?.title,form:h}}),[y,kt]),Pa={options:De,transport:V,feedback:ie,bus:n,persistence:r,view:pc,canSend:qt,isStreaming:we,loadingMessages:v,messagesSig:m,agent:mc,suggestions:qr,initialWidgetSize:l.widgetSize??null,visitorId:a,onClose:Yt,onClear:Qr,onExpand:eo,onFullscreen:to,onSoundToggle:Ac,onToggleHistory:Ic,onSelectHistoryConversation:no,onNewConversation:Zr,onLocaleChange:Lc,onThemeChange:Mc,onTextSizeChange:Nc,onWidgetSizeChange:Oc,onSend:ha,onStop:Ec,onSuggestion:p=>{let h=p.text??p.label;W.info("suggestion",{text:h}),n.emit("suggestion",{text:h}),ha(h,[])},activeForm:Cc.value?.form??null,formMarkers:$c,onFormSubmit:ue.complete,onFormSkip:ue.skip,onFormFill:p=>ue.fire("manual",p),tool:wc,onRetry:Rc},Bc=p=>{no(p);let h=z();h&&L.switchTab(h)};if(!H)return null;let Jt=De.modules.list,ro=p=>{let h=pn("close",De.mode,p);return Jt.length===0?o(oc,{strings:De.strings,onClose:h?Yt:void 0}):Jt.length===1&&Jt[0]?.layout==="chat"?o(Ll,{...Pa,panelSize:p}):o(rc,{panelProps:{...Pa,panelSize:p,onClose:h?Yt:void 0},enabledModules:Jt,nav:L,bus:n,unreadCount:C.value,onSelectConversation:Bc,onStartNewConversation:Zr,onSetPanelSize:ze})};if(e.mode==="page"){let p=T=>{no(T.conversationId)},h=Jt.some(T=>T.layout==="chat");return o("div",{class:`${Br}-anchor`,children:o(Ol,{site:fc,blocks:hc,transport:V,strings:De.strings,locale:De.locale,persistence:r,visitorId:a,showConversations:h,onSelectConversation:p,onNewConversation:Zr,sidebarCollapsed:bc,onToggleSidebarCollapsed:Dc,children:ro("fullscreen")})})}if(oe){let p=e.mode==="standalone"?"fullscreen":Le;return o("div",{class:`${Br}-anchor`,children:ro(p)})}let xa=e.mode==="drawer",ya=!(e.mode==="modal")&&!e.launcher.hidden&&(!_e||ye),Sa=ya&&!ye&&!Ve&&!xa?De.launcher.callout:null;return o("div",{class:`${Br}-anchor`,"data-launcher-size":De.launcher.size,children:[_e||ae?o("div",{class:`${Br}-surface`,hidden:!_e,children:ro(Le)}):null,ya?o(Js,{onToggle:Jr,launcher:De.launcher,strings:De.strings,leaving:ye,edgeTab:xa}):null,Sa?o(Qs,{callout:Sa,launcherPosition:De.position,strings:De.strings,closeLabel:De.strings.close,onDismiss:He}):null]})}function Rp(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var Ap=120;async function Ip(e,t,n){let r=[];for(let a of t)try{let{id:i,url:l}=await e.uploadFile(a.file);r.push({id:i,name:a.name,mediaType:a.mediaType,size:a.size,url:l})}catch(i){n(i)}return r}function ra(e,t,n,r){let a={role:n,text:r};e.emit("message",a),t.onMessage?.(a)}var Lp=J.scope("error-boundary"),Hr=class extends lt{constructor(){super(...arguments);q(this,"state",{crashed:!1})}componentDidCatch(n,r){Lp.error("widget render crashed",{error:n,componentStack:r?.componentStack}),this.setState({crashed:!0}),this.props.onError(n,r?.componentStack)}render(){return this.state.crashed?this.props.fallback:this.props.children}};var Mp="1",Np=60,Dp=2e3,cc={open:()=>{},close:()=>{},expand:e=>({on:e}),fullscreen:e=>({on:e}),send:e=>({attachments:e.attachmentCount}),message:e=>({role:e.role}),stop:()=>{},clear:()=>{},suggestion:()=>{},toggleHistory:e=>({view:e.view}),handshake:()=>{},formSubmit:e=>({formId:e.formId,skipped:e.skipped}),toolResult:()=>{},toolDecision:e=>({approved:e.approved}),contentView:e=>({section:e.section,tags:e.tags,count:e.count}),contentOpen:e=>({contentId:e.contentId,tags:e.tags}),contentSearch:e=>({qlen:e.queryLength,hits:e.hitCount}),contentRead:e=>({contentId:e.contentId}),contentLinkClick:e=>({contentId:e.contentId}),attach:e=>({count:e.count,bytes:e.totalBytes}),voiceStart:()=>{},voiceStop:e=>({ms:e.durationMs}),voiceCancel:()=>{},localeChange:e=>({locale:e}),themeChange:e=>({theme:e}),textSizeChange:e=>({size:e}),soundToggle:e=>({muted:e.muted}),sidebarToggle:e=>({collapsed:e.collapsed}),calloutDismiss:()=>{},error:()=>{}};function Op(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function $p(){return location.origin+location.pathname}function Bp(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function dc(e,t){let n=Math.random(),r=0,a=0,i=new Set,l=(c,d)=>{let{tracking:u,publicKey:_,aiAgentDeploymentId:g,mode:f,themeMode:m}=t.getOptions();if(!u.enabled||Op()||n>=u.sampleRate)return;let C=performance.now();if(C-r>6e4&&(r=C,a=0),++a>Np)return;let v=new URLSearchParams;v.set("v",Mp),v.set("_ev",ar),v.set("e",c),u.token&&v.set("tk",u.token),_&&v.set("pk",_),g&&v.set("dep",g),v.set("vid",t.getVisitorId());let b=t.getConversationId();b&&v.set("cid",b),v.set("url",$p());let y=Bp();y&&v.set("ref",y),v.set("sw",String(screen.width)),v.set("sh",String(screen.height)),v.set("vw",String(innerWidth)),v.set("vh",String(innerHeight)),v.set("dpr",String(devicePixelRatio)),v.set("lang",navigator.language);try{v.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(v.set("m",f),v.set("th",m),d)for(let[K,L]of Object.entries(d))L!==void 0&&v.set(K,String(L));v.set("ts",String(Date.now()));let P=`${u.endpoint}?${v}`;if(P.length>Dp)return;let R=new Image(1,1);i.add(R);let z=()=>i.delete(R);R.addEventListener("load",z,{once:!0}),R.addEventListener("error",z,{once:!0}),R.src=P},s=Object.keys(cc).map(c=>e.on(c,d=>l(c,cc[c]?.(d))));return()=>{for(let c of s)c();i.clear()}}function _c(e){let{bus:t,host:n,appRoot:r,persistence:a,reportError:i}=e,l=e.initialRaw,s,c=Rt(l),d=!0,u=()=>{c=Rt(s?yo(l,s):l)},_=()=>{yi(n,Kn(c.mode));let m=a.loadUserPrefs().themeMode;wi(n,m?{...c,themeMode:m}:c),d&&(jn(n,Hp(c)),d=!1)},g=()=>{_(),zn(Hn(Hr,{onError:i},Hn(lc,{bus:t,hostElement:n,options:c})),r)};t.on("handshake",m=>{m.config&&(m.config.storageVersion&&a.rememberStorageVersion(m.config.storageVersion),s=m.config,u(),g())});let f=dc(t,{getOptions:()=>c,getVisitorId:()=>a.getVisitorId(),getConversationId:()=>a.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>l,render:g,setUserOptions:m=>{l=m,u(),g()},patchUserOptions:m=>{l={...l,...m},u(),g()},destroy:()=>f()}}function Hp(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=It(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:r}=an(e,Ot(),t.loadPanelOpen(),t.loadPanelSize());return or(e.mode,r,n)}var zr=class{constructor(){q(this,"handlers",new Map)}on(t,n){let r=this.handlers.get(t);return r||(r=new Set,this.handlers.set(t,r)),r.add(n),()=>this.handlers.get(t)?.delete(n)}emit(t,n){let r=this.handlers.get(t);if(r)for(let a of r)try{a(n)}catch{}}clear(){this.handlers.clear()}};var oa=class extends HTMLElement{constructor(){super(...arguments);q(this,"bus",new zr);q(this,"mountResult",null);q(this,"runtime",null)}static get observedAttributes(){return So}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,zn(null,this.mountResult.appRoot),this.bus.clear())}attributeChangedCallback(){this.isConnected&&this.boot()}boot(){let n=wo(i=>this.getAttribute(i));if(this.runtime){this.runtime.setUserOptions(n);return}let r=Rt(n);this.mountResult||(this.mountResult=Si({existingHost:this,position:Kn(r.mode)}));let a=It(r.widgetId,r.storage,r.aiAgentDeploymentId);this.runtime=_c({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:a,initialRaw:n,reportError:i=>this.bus.emit("error",i)}),this.runtime.render()}},uc=!1;function zp(){if(uc||typeof customElements>"u")return;let e=x.tagName;customElements.get(e)||customElements.define(e,oa),uc=!0}typeof customElements<"u"&&zp();export{zp as registerWebComponent};
|
|
40
40
|
//# sourceMappingURL=elements-web-component.esm.js.map
|