@helpai/elements 6.12.0 → 6.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/elements-web-component.esm.js +59 -55
- package/elements-web-component.esm.js.map +4 -4
- package/elements.cjs.js +61 -57
- package/elements.cjs.js.map +4 -4
- package/elements.esm.js +61 -57
- package/elements.esm.js.map +4 -4
- package/elements.js +60 -56
- package/elements.js.map +4 -4
- package/index.d.ts +1 -1
- package/index.mjs +27 -23
- package/llms-full.txt +140 -140
- package/llms.txt +19 -19
- package/package.json +1 -1
- package/react.d.ts +1 -1
- package/react.mjs +46 -42
- package/step-display.d.ts +8 -2
- package/step-display.mjs +2 -2
- package/style.css +1 -1
- package/web-component.d.ts +1 -1
- package/web-component.mjs +27 -23
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var ug=Object.defineProperty;var pg=(e,t,r)=>t in e?ug(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ee=(e,t,r)=>pg(e,typeof t!="symbol"?t+"":t,r);var xe,Lc,ps,Cr,ds,di,Nc,li,Oc,_s,us,_g,eo=Symbol.for("pv"),ui={},pi=[],fg=/^m(i|n|o|s|text|space)$/,_i=Array.isArray,fs=pi.slice,Gr=Object.assign;function Wr(e){e&&e.parentNode&&e.remove()}function Ir(e,t,r){var n,o,s,a={},i=arguments.length;for(s in t)s=="key"?n=t[s]:s=="ref"&&typeof e!="function"?o=t[s]:a[s]=t[s];return i>2&&(a.children=i>3?fs.call(arguments,2):r),Zn(e,a,n,o,null)}function Zn(e,t,r,n,o){var s={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:eo,__v:o||++Lc,__i:-1,__u:0};return!o&&xe.vnode&&xe.vnode(s),s}function he(e){return e.children}function Zt(e,t){this.props=e,this.context=t,this.__g=0}function Tr(e,t){if(t==null)return e.__&&Tr(e.__,e.__i+1);for(var r;t<e.__k.length;t++)if((r=e.__k[t])&&r.__e)return r.__e;return typeof e.type!="function"||e.props.__P?null:Tr(e)}function mg(e){var t,r=e.__v,n=r.__e,o=[],s=[],a=e.__P;a&&((t=Gr({constructor:eo},r)).__v=r.__v+1,xe.vnode&&xe.vnode(t),gs(a,t,r,e.__n,a.namespaceURI,32&r.__u?[n]:null,o,n||Tr(r),32&r.__u,s),t.__v=r.__v,t.__.__k[t.__i]=t,zc(o,t,s),r.__=r.__e=null,t.__e!=n&&$c(t))}function $c(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),$c(e)}function Ec(e){(8&e.__g||(e.__g|=8,Cr.push(e),di++))&&ds==xe.debounceRendering||((ds=xe.debounceRendering)||queueMicrotask)(Dc)}function Dc(){try{for(var e,t=1;Cr.length;)Cr.length>t&&Cr.sort(Nc),e=Cr.shift(),t=Cr.length,8&e.__g&&mg(e)}finally{(di=Cr.length)&&(ds||queueMicrotask)(Dc)}}function qc(e,t,r,n,o,s,a,i,c,u,p){var _,d,f,v,g,x,k=n.__k||pi,y=t.length;for(c=gg(r,t,k,c,y),_=0;_<y;_++)(f=r.__k[_])!=null&&(d=~f.__i&&k[f.__i]||ui,f.__i=_,x=gs(e,f,d,o,s,a,i,c,u,p),v=f.__e,(d.ref!=f.ref||8&d.__u)&&(d.ref&&vs(d.ref,null,f,d),f.ref&&p.push(f.ref,f.__c||v,f)),g=g||v,4&f.__u?(c=Uc(f,c,e,!d.__v),d.__e&&(d.__e=null)):typeof f.type=="function"&&x!==void 0?c=x:v&&(c=v.nextSibling),f.__u&=-21);return r.__e=g,c}function gg(e,t,r,n,o){var s,a,i,c,u,p,_,d,f,v=r.length,g=v,x=0,k=0,y=e.__k=Array(o);for(s=0;s<o;s++)(a=t[s])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a!="object"||a.constructor===String?a=y[s]=Zn(null,a):_i(a)?a=y[s]=Zn(he,{children:a}):a.constructor===eo&&a.__b?a=y[s]=Zn(a.type,a.props,a.key,a.ref,a.__v):y[s]=a,c=s+x,a.__=e,a.__b=e.__b+1,i=null,~(u=a.__i=vg(a,r,c,g))&&(g--,(i=r[u])&&(i.__u|=2)),i&&i.__v?(a.__u|=16,u==c-1?x--:u==c+1?x++:u!=c&&(u>c?x--:x++,k=1)):(~u||(o>v?x--:o<v&&x++),typeof a.type!="function"&&(a.__u|=4))):y[s]=null;if(k){for(p=[],_=[],s=0;s<o;s++)if((a=y[s])&&16&a.__u){for(x=0,d=p.length;x<d;)p[f=x+d>>1]<a.__i?x=f+1:d=f;p[x]=a.__i,_[s]=x+1}for(x=p.length;s--;)_[s]&&(_[s]==x?x--:y[s].__u|=4)}if(g)for(s=0;s<v;s++)!(i=r[s])||2&i.__u||(i.__e==n&&(n=Tr(i)),hs(i,i));return n}function Uc(e,t,r,n){var o,s,a,i;if(typeof e.type=="function"){if(e.props.__P)return t;if(o=e.__k)for(s=0;s<o.length;s++)o[s]&&(o[s].__=e,t=Uc(o[s],t,r,!1));return t}for(t&&!t.parentNode&&(t=Tr(e))&&!t.parentNode&&(t=null),a=e.__e,i=t;i&&i.nodeType==8;)i=i.nextSibling;for(a!=i&&(!n&&r.moveBefore&&a.parentNode?r.moveBefore(a,t):r.insertBefore(a,t||null)),t=a;(t=t&&t.nextSibling)&&t.nodeType==8&&!t.data.startsWith("$s"););return t}function ms(e,t){return t=t||[],e!=null&&typeof e!="boolean"&&(_i(e)?e.some(function(r){ms(r,t)}):t.push(e)),t}function vg(e,t,r,n){var o,s=e.key,a=e.type,i=t[r],c=i&&!(2&i.__u);if(i===null&&s==null||c&&s==i.key&&a==i.type)return r;if(n>(c?1:0)){for(o=r-1;o>=0;o--)if((i=t[o])&&!(2&i.__u)&&s==i.key&&a==i.type)return o;for(o=r+1;o<t.length;o++)if((i=t[o])&&!(2&i.__u)&&s==i.key&&a==i.type)return o}return-1}function Mc(e,t,r){r==null&&(r=""),t[0]=="-"?e.setProperty(t,r):e[t]=r}function si(e,t,r,n,o){var s,a;if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||Mc(e.style,t);if(r)for(t in r)n&&r[t]==n[t]||Mc(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")typeof r!="function"&&(r=null),typeof n!="function"&&(n=null),(e.__e||(e.__e={}))[t]=r,r&&n||(a=us[t]||(us[t]=hg(t)),(e.__a||(e.__a={}))[t]=_s,s=t!=(t=t.replace(Oc,"$1")),(t=t.slice(2))[0]<"a"&&(t=t.toLowerCase()),r?e.addEventListener(t,a,s):e.removeEventListener(t,a,s));else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{return void(e[t]=r??"")}catch{}if(typeof r=="function")return;r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r)}}function hg(e){return function(t){var r=this.__e;if(r){if(r=r[e],t[li]==null)t[li]=_s++;else if(t[li]<this.__a[e])return;return r(xe.event?xe.event(t):t)}}}function gs(e,t,r,n,o,s,a,i,c,u){var p,_,d,f,v,g,x,k,y,S,b,w,h,m,P,R,I,A,C=t.type;if(t.constructor!==eo)return null;128&r.__u&&(c=32&r.__u,p=r.__c.__z)&&(t.__u|=c,_=s=[],p.nodeType==8?i=ci(p,s):s.push(p),i=s[0]||i),(p=xe.__b)&&p(t);e:if(typeof C=="function"){d=a.length;try{if(k=t.props,y=(p=C.prototype)&&p.render,S=(p=C.contextType)&&n[p.__c],b=p?S?S.props.value:p.__:n,(f=r.__c)?(t.__c=f,2&f.__g&&(f.__g|=1)):(y?t.__c=f=new C(k,b):(t.__c=f=new Zt(k,b),f.constructor=C,f.render=bg),S&&S.sub(f),f.state||(f.state={}),f.__n=n,f.__g|=8,f.__h=[],f.__k=[]),y&&(f.__s||(f.__s=f.state),C.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=Gr({},f.__s)),Gr(f.__s,C.getDerivedStateFromProps(k,f.__s)))),v=f.props,g=f.state,f.__v=t,r.__c){if(k!==v&&y&&!C.getDerivedStateFromProps&&f.componentWillReceiveProps&&f.componentWillReceiveProps(k,b),t.__v==r.__v&&!(8&f.__g)||!(4&f.__g)&&f.shouldComponentUpdate&&f.shouldComponentUpdate(k,f.__s,b)===!1){t.__v!=r.__v&&(f.props=k,f.state=f.__s,f.__g&=-9),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(M){M&&(M.__=t)}),pi.push.apply(f.__h,f.__k),f.__k=[],f.__h.length&&a.push(f),i=Tr(r);break e}f.componentWillUpdate&&f.componentWillUpdate(k,f.__s,b),y&&f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(v,g,x)})}else y&&!C.getDerivedStateFromProps&&f.componentWillMount&&f.componentWillMount(),y&&f.componentDidMount&&f.__h.push(f.componentDidMount);f.context=b,f.props=k,f.__P=e,f.__g&=-5,w=xe.__r,h=y?25:0;do f.__g&=-9,w&&w(t),p=f.render(f.props,f.state=f.__s,f.context);while(8&f.__g&&++h<25);y&&(pi.push.apply(f.__h,f.__k),f.__k=[]),f.state=f.__s,f.getChildContext&&(n=Gr({},n,f.getChildContext())),y&&r.__c&&f.getSnapshotBeforeUpdate&&(x=f.getSnapshotBeforeUpdate(v,g)),m=p&&p.type===he&&p.key==null?p.props.children:p,k.__P&&(p=i,o=(e=k.__P).namespaceURI,c=s=null,r.props&&r.props.__P!=e&&(r.__k.some(function(M){M&&hs(M,M)}),r.__k=null),i=r.__k?Tr(r,0):null),i=qc(e,_i(m)?m:[m],t,r,n,o,s,a,i,c,u),k.__P&&(t.__e=null,i=p),t.__u&=-161,_&&_.some(Wr),f.__h.length&&a.push(f),1&f.__g&&(f.__g&=-4)}catch(M){if(a.length=d,t.__v=null,c||s)if(M&&M.then){if(t.__u|=128|c,s){for(~(I=s.indexOf(i||void 0))||(I=s.length);(A=s[I-1])&&A.nodeType==8;)I--;for(;I<s.length;I++)if(A=s[I])if(s[I]=null,P){if(A==R)break}else{if(A.nodeType!=8)break;A.data.startsWith("$s")&&(R=ci(P=A))}}if(!P){for(;i&&i.nodeType==8&&i.nextSibling;)i=i.nextSibling;P=i}(p=ci(P=t.__c.__z||(t.__c.__z=P)))?(t.__e=P,i=p):t.__e=i,i=i&&i.nextSibling}else s&&s.some(Wr);else t.__e=r.__e;t.__k||(t.__k=r.__k||[]),M&&M.then||Bc(t),xe.__e(M,t,r)}}else i=t.__e=yg(r.__e,t,r,n,o,s,a,c,u,e);return(p=xe.diffed)&&p(t),i}function ci(e,t){if(e&&e.nodeType==8&&e.data.startsWith("$s"))for(var r=1;e=e.nextSibling;){if(e.nodeType==8){if(e.data.startsWith("$s"))r++;else if(e.data.startsWith("/$s")&&!--r)return e}t&&t.push(e)}}function Bc(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(Bc))}function zc(e,t,r){for(var n=0;n<r.length;)vs(r[n++],r[n++],r[n++]);xe.__c&&xe.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(s){s.call(o)})}catch(s){xe.__e(s,o.__v)}})}function yg(e,t,r,n,o,s,a,i,c,u){var p,_,d,f,v,g,x,k,y=r.props||ui,S=t.props,b=t.type;if(b=="svg"?o="http://www.w3.org/2000/svg":b=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),s){for(p=0;p<s.length;p++)if((v=s[p])&&(b?v.localName==b:v.nodeType==3)){e=v,s[p]=null;break}}if(!e){if(k=u.ownerDocument||document,!b)return k.createTextNode(S);e=k.createElementNS(o,b,S.is?S:u),i&&(xe.__m&&xe.__m(t,s),i=!1),s=null}if(b){if(u=b=="template"&&e.content||e,s=b=="textarea"&&S.defaultValue!=null?null:s&&fs.call(u.childNodes),!i&&s)for(y={},p=0;p<e.attributes.length;p++)y[(v=e.attributes[p]).name]=v.value;for(p in y)v=y[p],p=="dangerouslySetInnerHTML"?d=v:p=="children"||p in S||p=="value"&&"defaultValue"in S||p=="checked"&&"defaultChecked"in S||si(e,p,null,v,o);for(p in S)v=S[p],p=="children"?f=v:p=="dangerouslySetInnerHTML"?_=v:p=="value"?g=v:p=="checked"?x=v:i&&typeof v!="function"||y[p]===v||si(e,p,v,y[p],o);_?(i||d&&(_.__html==d.__html||_.__html==e.innerHTML)||(e.innerHTML=_.__html),t.__k=[]):(d&&(e.textContent=""),(b=="foreignObject"||o=="http://www.w3.org/1998/Math/MathML"&&fg.test(b))&&(o="http://www.w3.org/1999/xhtml"),qc(u,_i(f)?f:[f],t,r,n,o,s,a,s?s[0]:r.__k&&Tr(r,0),i,c),s&&s.some(Wr)),i&&b!="textarea"||(p="value",b=="progress"&&g==null?e.removeAttribute(p):g==null||g===e[p]&&(b!="progress"||g)||si(e,p,g,y[p],o),p="checked",x!=null&&x!=e[p]&&si(e,p,x,y[p],o))}else y===S||i&&e.data==S||(e.data=S);return e}function vs(e,t,r,n){try{typeof e=="function"?t?t.__x=e(t)||1:n&&(n=n.__c||n.__e)&&(t=n.__x)&&(n.__x=null,typeof t=="function"?t():e(null)):e.current=t}catch(o){xe.__e(o,r)}}function hs(e,t,r){var n,o,s,a;if(xe.unmount&&xe.unmount(e),!(n=e.ref)||n.current&&n.current!=e.__e||vs(n,null,t,e),n=e.__c){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){xe.__e(i,t)}n.__P=n.__n=null}if(n=e.__k)for(a=0;a<n.length;a++)n[a]&&hs(n[a],t,typeof e.type!="function"||r&&!e.props.__P);!r&&(n=e.__c)&&(n=n.__z)&&(o=ci(n,s=[]))&&(n==e.__e&&s.some(Wr),Wr(o),Wr(n)),r||Wr(e.__e),e.__e=e.__c=e.__=null}function bg(e,t,r){return this.constructor(e,r)}function Rr(e,t){var r,n,o,s;xe.__&&xe.__(e,t),t.nodeType==9&&(t=t.documentElement),n=(r=e&&32&e.__u)?null:t.__k,t.__k=Zn(he,{children:[e]}),o=[],s=[],gs(t,t.__k,n||ui,ui,t.namespaceURI,n?null:t.firstChild?fs.call(t.childNodes):null,o,n?n.__e:t.firstChild,r,s),zc(o,t.__k,s),t.__k.props.children=null}xe={__e:function(e,t,r,n){for(var o,s,a;t=t.__;)if((o=t.__c)&&!(1&o.__g)){o.__g|=4;try{if((a=(s=o.constructor)&&s.getDerivedStateFromError)&&o.setState(s.getDerivedStateFromError(e)),o.componentDidCatch&&(o.componentDidCatch(e,n||{}),a=1),a&&8&o.__g)return void(o.__g|=2)}catch(i){e=i}}throw di=0,e}},Lc=0,ps=function(e){return e!=null&&e.constructor===eo},Zt.prototype.setState=function(e,t){var r=this.__s;r&&r!=this.state||(r=this.__s=Gr({},this.state)),typeof e=="function"&&(e=e(Gr({},r),this.props)),e&&(Gr(r,e),this.__v&&(t&&this.__k.push(t),Ec(this)))},Zt.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),Ec(this))},Zt.prototype.render=he,Cr=[],di=0,Nc=function(e,t){return e.__v.__b-t.__v.__b},li=Symbol(),Oc=/(PointerCapture)$|Capture$/i,_s=0,us={},_g=0;var Pg=["en","fr","es","ar","he","zh"];function Fc(e){let t=e?.split("-")[0]?.toLowerCase();return Pg.find(r=>r===t)??"en"}function bs(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ys(e){return bs(e)?e.id??e.key:void 0}function Ps(e,t){return bs(e)&&bs(t)?Object.fromEntries([...new Set([...Object.keys(e),...Object.keys(t)])].map(r=>[r,Ps(e[r],t[r])])):Array.isArray(e)&&Array.isArray(t)&&t.length>0&&t.every(r=>ys(r)!==void 0)?e.map(r=>Ps(r,t.find(n=>ys(n)===ys(r)))):t==null||typeof t=="string"&&!t.trim()?e:t}function Kr(e,t){let r=t?.toLowerCase(),n=r?.split("-")[0],o=e.translations??[],s=o.find(c=>c.locale.toLowerCase()===r)??o.find(c=>c.locale.toLowerCase().split("-")[0]===n);if(!s)return e;let{locale:a,...i}=s;return Ps(e,i)}var fi={attach:"Attach files",file:"File",attachmentMimeRejected:"{name} isn't a file type this chat accepts.",attachmentTooLarge:"{name} is too large. Files can be up to {max} together.",poweredBy:"Powered by {name}",attachmentTooMany:"The attachment limit is {count}.",attachmentUploadFailed:"{name} couldn't be uploaded.",conversationLoading:"Loading chat\u2026",loadPreviousMessages:"Load previous messages",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",dropZoneRejected:"These files can't be attached here",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRateLimitedIn:"Too many requests \u2014 please try again in {seconds} s.",errorOffline:"Can't reach the server. Check your connection and try again.",errorServer:"Something went wrong on our side. Please try again.",errorOriginNotAllowed:"This chat isn't set up for this website yet.",errorMessageTooLong:"That message is too long. Shorten it and send it again.",errorReconnecting:"Connection lost. Reconnecting\u2026",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous chats yet",historyLoading:"Loading your chats\u2026",historyContinue:"Continue the chat",historyTitle:"Chat history",loadMoreConversations:"Load more conversations",language:"Language",launcherOpen:"Open chat",launcherAsk:"Ask {name}",micBlocked:"The microphone is blocked for this site, so voice input can't start.",micStart:"Start voice input",micStop:"Stop voice input",moreActions:"More actions",newConversation:"New chat",panelTitle:"Chat",popOut:"Open in new tab",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",queueMessage:"Queue message",removeQueuedMessage:"Remove queued message",removeAttachment:"Remove {name}",suggestedReplies:"Suggested replies",compactingContext:"Optimizing conversation context\u2026",soundOff:"Sound off",soundOn:"Sound on",talkToOperator:"Talk to a person",connectingOperator:"Connecting you to a person\u2026",noOperatorAvailable:"No one's available right now \u2014 leave your details and we'll follow up.",chattingWithOperator:"You're chatting with {operator}",operatorBadgeTitle:"Live chat",chatNotice:"You're chatting with an AI assistant.",cancelOperatorRequest:"Keep chatting with the AI",loginPrompt:"Log in for faster, more personalized support",loginAction:"Log in",loginRequired:"Log in to chat with us",loginExpired:"Your login expired. Log in to continue this chat.",loginExpiredGuest:"Your login expired. Log in to continue this chat, or start a new conversation as a guest.",startAsGuest:"Start new conversation",loggedInAs:"Logged in as {name}",loggedIn:"Logged in",dismissLoginPrompt:"Hide",emailTranscript:"Email transcript",emailTranscriptPrompt:"Get a copy of this conversation by email.",emailTranscriptEmailLabel:"Email address",emailTranscriptSend:"Send transcript",emailTranscriptSending:"Sending\u2026",emailTranscriptSent:"Sent to {email}.",emailTranscriptAlreadySent:"This conversation was already emailed. Send a new message to email it again.",emailTranscriptLimited:"You've reached the limit for now. Try again later.",emailTranscriptFailed:"Couldn't send it. Try again.",emailTranscriptNotDelivered:"Couldn't send to this address. Check it and try again.",emailTranscriptCancel:"Cancel",emailTranscriptDone:"Done",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",visualPreparing:"Preparing visual\u2026",visualError:"This visual could not be displayed.",visualPartial:"Some parts of this visual could not be displayed.",visualSoldOut:"Sold out",visualCartEmpty:"Your cart is empty.",visualQuantity:"Qty",visualChoose:"Choose",thinking:"Thinking\u2026",thought:"Thought",thoughtFor:"Thought for {time}",toolResult:"Result",sources:"Sources",feedbackUp:"Good response",feedbackDown:"Bad response",feedbackThanks:"Thanks for your feedback",copy:"Copy",copied:"Copied",copyTicketReference:"Ticket {reference}, copy",tabHome:"Home",tabConversations:"Chats",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",chatUnavailable:"This chat isn't available right now",moduleBack:"Back",contentLoading:"Loading\u2026",contentHelpful:"Was this helpful?",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeAskPlaceholder:"Ask a question\u2026",homeWhatsNew:"What's new",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results for \u201C{query}\u201D",helpShowMore:"Show more",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsShowMore:"Show more",newsUnseen:"New post",unread:"Unread",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidNumber:"Enter a valid number",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"Questions for you",askFallbackQuestion:"Please provide the missing information.",inputBadge:"Questions",inputAnswered:"Answered",inputSkipped:"Skipped",showOptions:"Show options",hideOptions:"Hide options",qtypeText:"Your answer",qtypeEmail:"Email address",qtypePhone:"Phone number",qtypeNumber:"Number",qtypeDate:"Date",qtypeChooseOne:"Pick one",qtypeChooseAny:"Pick any",qtypeBoolean:"Yes / No",inputSubmit:"Submit answers",inputSubmitHint:"Enter to send \xB7 Shift+Enter = new line",inputSkip:"Skip",confirmYes:"Yes",confirmNo:"No",approve:"Approve",decline:"Decline",changeAnswer:"Change answer",approvalPrompt:"{action}?",approvalEditHint:"You can change your answer until this step continues.",stepInput:"Input",stepWorking:"Working",stepWorkingOnIt:"Working on it\u2026",stepNeedsYourApproval:"Needs your approval",stepWaitingForVisitor:"Waiting for the visitor",stepApproved:"Approved",stepDeclined:"Declined",stepReplaced:"Replaced",stepFailed:"Failed",stepDidNotWork:"Didn't work",decidedYouApproved:"You approved",decidedYouDeclined:"You declined",decidedVisitorApproved:"Visitor approved",decidedVisitorDeclined:"Visitor declined",decidedTeamApproved:"Approved by a team member",decidedTeamDeclined:"Declined by a team member",decidedMemberApproved:"Approved by {name}",decidedMemberDeclined:"Declined by {name}",stepRawData:"Raw data",decidedRulesApproved:"Auto-approved",decidedRulesDeclined:"Auto-declined",edit:"Edit",toolStepsFailed:"{count} failed",statusStopped:"Stopped",toolStepsStopped:"Stopped after {count} steps",toolStepsStoppedOne:"Stopped after 1 step"},xg={attach:"Joindre des fichiers",file:"Fichier",attachmentMimeRejected:"{name} n'est pas un type de fichier accept\xE9 ici.",attachmentTooLarge:"{name} est trop volumineux. Les fichiers peuvent faire jusqu'\xE0 {max} au total.",poweredBy:"Propuls\xE9 par {name}",attachmentTooMany:"Limite de pi\xE8ces jointes : {count}.",attachmentUploadFailed:"{name} n'a pas pu \xEAtre envoy\xE9.",conversationLoading:"Chargement du chat\u2026",loadPreviousMessages:"Charger les messages pr\xE9c\xE9dents",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",dropZoneRejected:"Ces fichiers ne peuvent pas \xEAtre joints ici",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRateLimitedIn:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans {seconds} s.",errorOffline:"Impossible de joindre le serveur. V\xE9rifiez votre connexion et r\xE9essayez.",errorServer:"Un probl\xE8me est survenu de notre c\xF4t\xE9. Veuillez r\xE9essayer.",errorOriginNotAllowed:"Ce chat n'est pas encore configur\xE9 pour ce site.",errorMessageTooLong:"Ce message est trop long. Raccourcissez-le et renvoyez-le.",errorReconnecting:"Connexion perdue. Reconnexion\u2026",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:"Aucun chat pour le moment",historyContinue:"Poursuivre le chat",historyLoading:"Chargement de vos chats\u2026",historyTitle:"Historique des chats",loadMoreConversations:"Charger plus de conversations",language:"Langue",launcherOpen:"Ouvrir le chat",launcherAsk:"Demander \xE0 {name}",micBlocked:"Le micro est bloqu\xE9 pour ce site : la saisie vocale ne peut pas d\xE9marrer.",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",moreActions:"Plus d'actions",newConversation:"Nouveau chat",panelTitle:"Chat",popOut:"Ouvrir dans un nouvel onglet",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",queueMessage:"Mettre le message en attente",removeQueuedMessage:"Retirer le message en attente",removeAttachment:"Retirer {name}",suggestedReplies:"R\xE9ponses sugg\xE9r\xE9es",compactingContext:"Optimisation du contexte de la conversation\u2026",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",talkToOperator:"Parler \xE0 une personne",connectingOperator:"Mise en relation avec une personne\u2026",noOperatorAvailable:"Personne n'est disponible pour le moment \u2014 laissez vos coordonn\xE9es et nous reviendrons vers vous.",chattingWithOperator:"Vous discutez avec {operator}",operatorBadgeTitle:"Chat en direct",chatNotice:"Vous discutez avec un assistant IA.",cancelOperatorRequest:"Continuer avec l'IA",loginPrompt:"Connectez-vous pour une aide plus rapide et personnalis\xE9e",loginAction:"Se connecter",loginRequired:"Connectez-vous pour discuter avec nous",loginExpired:"Votre connexion a expir\xE9. Connectez-vous pour poursuivre cette conversation.",loginExpiredGuest:"Votre connexion a expir\xE9. Connectez-vous pour poursuivre cette conversation, ou d\xE9marrez-en une nouvelle en tant qu'invit\xE9.",startAsGuest:"D\xE9marrer une nouvelle conversation",loggedInAs:"Connect\xE9 en tant que {name}",loggedIn:"Connect\xE9",dismissLoginPrompt:"Masquer",emailTranscript:"Envoyer la transcription",emailTranscriptPrompt:"Recevez une copie de cette conversation par e-mail.",emailTranscriptEmailLabel:"Adresse e-mail",emailTranscriptSend:"Envoyer la transcription",emailTranscriptSending:"Envoi\u2026",emailTranscriptSent:"Envoy\xE9 \xE0 {email}.",emailTranscriptAlreadySent:"Cette conversation a d\xE9j\xE0 \xE9t\xE9 envoy\xE9e. Envoyez un nouveau message pour l'envoyer \xE0 nouveau.",emailTranscriptLimited:"Vous avez atteint la limite pour le moment. R\xE9essayez plus tard.",emailTranscriptFailed:"Envoi impossible. R\xE9essayez.",emailTranscriptNotDelivered:"Envoi impossible \xE0 cette adresse. V\xE9rifiez-la et r\xE9essayez.",emailTranscriptCancel:"Annuler",emailTranscriptDone:"Termin\xE9",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",visualPreparing:"Pr\xE9paration du visuel\u2026",visualError:"Ce visuel n\u2019a pas pu \xEAtre affich\xE9.",visualPartial:"Certaines parties de ce visuel n\u2019ont pas pu \xEAtre affich\xE9es.",visualSoldOut:"\xC9puis\xE9",visualCartEmpty:"Votre panier est vide.",visualQuantity:"Qt\xE9",visualChoose:"Choisissez",thinking:"R\xE9flexion\u2026",thought:"R\xE9flexion",thoughtFor:"R\xE9flexion : {time}",toolResult:"R\xE9sultat",sources:"Sources",feedbackUp:"Bonne r\xE9ponse",feedbackDown:"Mauvaise r\xE9ponse",feedbackThanks:"Merci pour votre retour",copy:"Copier",copied:"Copi\xE9",copyTicketReference:"Ticket {reference}, copier",tabHome:"Accueil",tabConversations:"Chats",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",chatUnavailable:"Ce chat n'est pas disponible pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",contentHelpful:"Cela vous a-t-il aid\xE9 ?",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeAskPlaceholder:"Posez une question\u2026",homeWhatsNew:"Nouveaut\xE9s",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 pour \xAB\xA0{query}\xA0\xBB",helpShowMore:"Afficher plus",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsShowMore:"Afficher plus",newsUnseen:"Nouvelle publication",unread:"Non lu",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidNumber:"Saisissez un nombre valide",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Questions pour vous",askFallbackQuestion:"Veuillez fournir les informations manquantes.",inputBadge:"Questions",inputAnswered:"R\xE9pondu",inputSkipped:"Ignor\xE9",showOptions:"Afficher les options",hideOptions:"Masquer les options",qtypeText:"Votre r\xE9ponse",qtypeEmail:"Adresse e-mail",qtypePhone:"Num\xE9ro de t\xE9l\xE9phone",qtypeNumber:"Nombre",qtypeDate:"Date",qtypeChooseOne:"Choisir une",qtypeChooseAny:"Choisir plusieurs",qtypeBoolean:"Oui / Non",inputSubmit:"Envoyer les r\xE9ponses",inputSubmitHint:"Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e = saut de ligne",inputSkip:"Ignorer",confirmYes:"Oui",confirmNo:"Non",approve:"Approuver",decline:"Refuser",changeAnswer:"Modifier la r\xE9ponse",approvalPrompt:"{action} ?",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",stepInput:"Entr\xE9e",stepWorking:"En cours",stepWorkingOnIt:"En cours\u2026",stepNeedsYourApproval:"Votre accord est requis",stepWaitingForVisitor:"En attente du visiteur",stepApproved:"Approuv\xE9",stepDeclined:"Refus\xE9",stepReplaced:"Remplac\xE9",stepFailed:"\xC9chec",stepDidNotWork:"N'a pas fonctionn\xE9",decidedYouApproved:"Vous avez approuv\xE9",decidedYouDeclined:"Vous avez refus\xE9",decidedVisitorApproved:"Approuv\xE9 par le visiteur",decidedVisitorDeclined:"Refus\xE9 par le visiteur",decidedTeamApproved:"Approuv\xE9 par un membre de l'\xE9quipe",decidedTeamDeclined:"Refus\xE9 par un membre de l'\xE9quipe",decidedMemberApproved:"Approuv\xE9 par {name}",decidedMemberDeclined:"Refus\xE9 par {name}",stepRawData:"Donn\xE9es brutes",decidedRulesApproved:"Approuv\xE9 automatiquement",decidedRulesDeclined:"Refus\xE9 automatiquement",edit:"Modifier",toolStepsFailed:"{count} en \xE9chec",statusStopped:"Arr\xEAt\xE9",toolStepsStopped:"Arr\xEAt\xE9 apr\xE8s {count} \xE9tapes",toolStepsStoppedOne:"Arr\xEAt\xE9 apr\xE8s 1 \xE9tape"},Sg={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",file:"\u0645\u0644\u0641",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 {name} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629.",attachmentTooLarge:"\u0627\u0644\u0645\u0644\u0641 {name} \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627. \u064A\u0645\u0643\u0646 \u0623\u0646 \u064A\u0635\u0644 \u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0645\u0639\u064B\u0627 \u0625\u0644\u0649 {max}.",poweredBy:"\u0645\u062F\u0639\u0648\u0645 \u0645\u0646 {name}",attachmentTooMany:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A: {count}.",attachmentUploadFailed:"\u062A\u0639\u0630\u0651\u0631 \u0631\u0641\u0639 {name}.",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0629\u2026",loadPreviousMessages:"\u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0631\u0633\u0627\u0626\u0644 \u0627\u0644\u0633\u0627\u0628\u0642\u0629",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",dropZoneRejected:"\u0644\u0627 \u064A\u0645\u0643\u0646 \u0625\u0631\u0641\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0647\u0646\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.",errorRateLimitedIn:"\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 {seconds} \u062B.",errorOffline:"\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u0648\u0635\u0648\u0644 \u0625\u0644\u0649 \u0627\u0644\u062E\u0627\u062F\u0645. \u062A\u062D\u0642\u0651\u0642 \u0645\u0646 \u0627\u062A\u0635\u0627\u0644\u0643 \u0648\u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",errorServer:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0646 \u062C\u0647\u062A\u0646\u0627. \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",errorOriginNotAllowed:"\u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u063A\u064A\u0631 \u0645\u064F\u0639\u062F\u0651\u0629 \u0644\u0647\u0630\u0627 \u0627\u0644\u0645\u0648\u0642\u0639 \u0628\u0639\u062F.",errorMessageTooLong:"\u0647\u0630\u0647 \u0627\u0644\u0631\u0633\u0627\u0644\u0629 \u0637\u0648\u064A\u0644\u0629 \u062C\u062F\u064B\u0627. \u0627\u062E\u062A\u0635\u0631\u0647\u0627 \u0648\u0623\u0631\u0633\u0644\u0647\u0627 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",errorReconnecting:"\u0627\u0646\u0642\u0637\u0639 \u0627\u0644\u0627\u062A\u0635\u0627\u0644. \u062C\u0627\u0631\u064D \u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0627\u062A\u0635\u0627\u0644\u2026",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\u062F\u0631\u062F\u0634\u0629",historyEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u062F\u0631\u062F\u0634\u0627\u062A \u0633\u0627\u0628\u0642\u0629 \u0628\u0639\u062F",historyContinue:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u062F\u0631\u062F\u0634\u0627\u062A\u0643\u2026",historyTitle:"\u0633\u062C\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",loadMoreConversations:"\u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0632\u064A\u062F \u0645\u0646 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0627\u062A",language:"\u0627\u0644\u0644\u063A\u0629",launcherOpen:"\u0641\u062A\u062D \u0627\u0644\u062F\u0631\u062F\u0634\u0629",launcherAsk:"\u0627\u0633\u0623\u0644 {name}",micBlocked:"\u0627\u0644\u0645\u064A\u0643\u0631\u0648\u0641\u0648\u0646 \u0645\u062D\u0638\u0648\u0631 \u0644\u0647\u0630\u0627 \u0627\u0644\u0645\u0648\u0642\u0639\u060C \u0644\u0630\u0627 \u0644\u0627 \u064A\u0645\u0643\u0646 \u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A.",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",moreActions:"\u0625\u062C\u0631\u0627\u0621\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629",newConversation:"\u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",panelTitle:"\u0627\u0644\u062F\u0631\u062F\u0634\u0629",popOut:"\u0641\u062A\u062D \u0641\u064A \u0639\u0644\u0627\u0645\u0629 \u062A\u0628\u0648\u064A\u0628 \u062C\u062F\u064A\u062F\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",queueMessage:"\u0625\u0636\u0627\u0641\u0629 \u0627\u0644\u0631\u0633\u0627\u0644\u0629 \u0625\u0644\u0649 \u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0627\u0646\u062A\u0638\u0627\u0631",removeQueuedMessage:"\u0625\u0632\u0627\u0644\u0629 \u0627\u0644\u0631\u0633\u0627\u0644\u0629 \u0645\u0646 \u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0627\u0646\u062A\u0638\u0627\u0631",removeAttachment:"\u0625\u0632\u0627\u0644\u0629 {name}",suggestedReplies:"\u0631\u062F\u0648\u062F \u0645\u0642\u062A\u0631\u062D\u0629",compactingContext:"\u062C\u0627\u0631\u064D \u062A\u062D\u0633\u064A\u0646 \u0633\u064A\u0627\u0642 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629\u2026",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",talkToOperator:"\u0627\u0644\u062A\u062D\u062F\u062B \u0625\u0644\u0649 \u0634\u062E\u0635",connectingOperator:"\u062C\u0627\u0631\u064D \u062A\u0648\u0635\u064A\u0644\u0643 \u0628\u0634\u062E\u0635\u2026",noOperatorAvailable:"\u0644\u0627 \u064A\u0648\u062C\u062F \u0645\u0648\u0638\u0641\u0648\u0646 \u0645\u062A\u0627\u062D\u0648\u0646 \u0627\u0644\u0622\u0646 \u2014 \u0627\u062A\u0631\u0643 \u0628\u064A\u0627\u0646\u0627\u062A\u0643 \u0648\u0633\u0646\u062A\u0648\u0627\u0635\u0644 \u0645\u0639\u0643.",chattingWithOperator:"\u0623\u0646\u062A \u062A\u062A\u062D\u062F\u062B \u0645\u0639 {operator}",operatorBadgeTitle:"\u0645\u062D\u0627\u062F\u062B\u0629 \u0645\u0628\u0627\u0634\u0631\u0629",chatNotice:"\u0623\u0646\u062A \u062A\u062A\u062D\u062F\u062B \u0645\u0639 \u0645\u0633\u0627\u0639\u062F \u0630\u0643\u0627\u0621 \u0627\u0635\u0637\u0646\u0627\u0639\u064A.",cancelOperatorRequest:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0645\u0639 \u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",loginPrompt:"\u0633\u062C\u0651\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0644\u0644\u062D\u0635\u0648\u0644 \u0639\u0644\u0649 \u062F\u0639\u0645 \u0623\u0633\u0631\u0639 \u0648\u0645\u062E\u0635\u0651\u0635 \u0644\u0643",loginAction:"\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644",loginRequired:"\u0633\u062C\u0651\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0644\u0644\u062F\u0631\u062F\u0634\u0629 \u0645\u0639\u0646\u0627",loginExpired:"\u0627\u0646\u062A\u0647\u062A \u0635\u0644\u0627\u062D\u064A\u0629 \u062A\u0633\u062C\u064A\u0644 \u062F\u062E\u0648\u0644\u0643. \u0633\u062C\u0651\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0644\u0645\u062A\u0627\u0628\u0639\u0629 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629.",loginExpiredGuest:"\u0627\u0646\u062A\u0647\u062A \u0635\u0644\u0627\u062D\u064A\u0629 \u062A\u0633\u062C\u064A\u0644 \u062F\u062E\u0648\u0644\u0643. \u0633\u062C\u0651\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0644\u0645\u062A\u0627\u0628\u0639\u0629 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629\u060C \u0623\u0648 \u0627\u0628\u062F\u0623 \u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629 \u0643\u0636\u064A\u0641.",startAsGuest:"\u0628\u062F\u0621 \u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629",loggedInAs:"\u062A\u0645 \u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0628\u0627\u0633\u0645 {name}",loggedIn:"\u062A\u0645 \u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644",dismissLoginPrompt:"\u0625\u062E\u0641\u0627\u0621",emailTranscript:"\u0625\u0631\u0633\u0627\u0644 \u0646\u0635 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",emailTranscriptPrompt:"\u0627\u062D\u0635\u0644 \u0639\u0644\u0649 \u0646\u0633\u062E\u0629 \u0645\u0646 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0639\u0628\u0631 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A.",emailTranscriptEmailLabel:"\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",emailTranscriptSend:"\u0625\u0631\u0633\u0627\u0644 \u0646\u0635 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",emailTranscriptSending:"\u062C\u0627\u0631\u064D \u0627\u0644\u0625\u0631\u0633\u0627\u0644\u2026",emailTranscriptSent:"\u062A\u0645 \u0627\u0644\u0625\u0631\u0633\u0627\u0644 \u0625\u0644\u0649 {email}.",emailTranscriptAlreadySent:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0628\u0627\u0644\u0641\u0639\u0644. \u0623\u0631\u0633\u0644 \u0631\u0633\u0627\u0644\u0629 \u062C\u062F\u064A\u062F\u0629 \u0644\u0625\u0631\u0633\u0627\u0644\u0647\u0627 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",emailTranscriptLimited:"\u0644\u0642\u062F \u0628\u0644\u063A\u062A \u0627\u0644\u062D\u062F \u0627\u0644\u0645\u0633\u0645\u0648\u062D \u0628\u0647 \u062D\u0627\u0644\u064A\u064B\u0627. \u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649 \u0644\u0627\u062D\u0642\u064B\u0627.",emailTranscriptFailed:"\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u0625\u0631\u0633\u0627\u0644. \u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",emailTranscriptNotDelivered:"\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u0625\u0631\u0633\u0627\u0644 \u0625\u0644\u0649 \u0647\u0630\u0627 \u0627\u0644\u0639\u0646\u0648\u0627\u0646. \u062A\u062D\u0642\u0651\u0642 \u0645\u0646\u0647 \u0648\u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",emailTranscriptCancel:"\u0625\u0644\u063A\u0627\u0621",emailTranscriptDone:"\u062A\u0645",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",visualPreparing:"\u062C\u0627\u0631\u064D \u0625\u0639\u062F\u0627\u062F \u0627\u0644\u0645\u062D\u062A\u0648\u0649 \u0627\u0644\u0645\u0631\u0626\u064A\u2026",visualError:"\u062A\u0639\u0630\u0631 \u0639\u0631\u0636 \u0647\u0630\u0627 \u0627\u0644\u0645\u062D\u062A\u0648\u0649 \u0627\u0644\u0645\u0631\u0626\u064A.",visualPartial:"\u062A\u0639\u0630\u0631 \u0639\u0631\u0636 \u0628\u0639\u0636 \u0623\u062C\u0632\u0627\u0621 \u0647\u0630\u0627 \u0627\u0644\u0645\u062D\u062A\u0648\u0649 \u0627\u0644\u0645\u0631\u0626\u064A.",visualSoldOut:"\u0646\u0641\u062F\u062A \u0627\u0644\u0643\u0645\u064A\u0629",visualCartEmpty:"\u0633\u0644\u062A\u0643 \u0641\u0627\u0631\u063A\u0629.",visualQuantity:"\u0627\u0644\u0643\u0645\u064A\u0629",visualChoose:"\u0627\u062E\u062A\u0631",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thought:"\u062A\u0641\u0643\u064A\u0631",thoughtFor:"\u0641\u0643\u0651\u0631 \u0644\u0645\u062F\u0629 {time}",toolResult:"\u0627\u0644\u0646\u062A\u064A\u062C\u0629",sources:"\u0627\u0644\u0645\u0635\u0627\u062F\u0631",feedbackUp:"\u0631\u062F \u062C\u064A\u062F",feedbackDown:"\u0631\u062F \u0633\u064A\u0626",feedbackThanks:"\u0634\u0643\u0631\u064B\u0627 \u0639\u0644\u0649 \u0645\u0644\u0627\u062D\u0638\u0627\u062A\u0643",copy:"\u0646\u0633\u062E",copied:"\u062A\u0645 \u0627\u0644\u0646\u0633\u062E",copyTicketReference:"\u0627\u0644\u062A\u0630\u0643\u0631\u0629 {reference}\u060C \u0646\u0633\u062E",tabHome:"\u0627\u0644\u0631\u0626\u064A\u0633\u064A\u0629",tabConversations:"\u0627\u0644\u062F\u0631\u062F\u0634\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",chatUnavailable:"\u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u063A\u064A\u0631 \u0645\u062A\u0627\u062D\u0629 \u062D\u0627\u0644\u064A\u0627\u064B",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",contentHelpful:"\u0647\u0644 \u0643\u0627\u0646 \u0647\u0630\u0627 \u0645\u0641\u064A\u062F\u064B\u0627\u061F",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",homeAskPlaceholder:"\u0627\u0637\u0631\u062D \u0633\u0624\u0627\u0644\u0627\u064B\u2026",homeWhatsNew:"\u0645\u0627 \u0627\u0644\u062C\u062F\u064A\u062F",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 \u0646\u062A\u0627\u0626\u062C \u0644\u0640 \xAB{query}\xBB",helpShowMore:"\u0639\u0631\u0636 \u0627\u0644\u0645\u0632\u064A\u062F",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",newsShowMore:"\u0639\u0631\u0636 \u0627\u0644\u0645\u0632\u064A\u062F",newsUnseen:"\u0645\u0646\u0634\u0648\u0631 \u062C\u062F\u064A\u062F",unread:"\u063A\u064A\u0631 \u0645\u0642\u0631\u0648\u0621",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",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0623\u0633\u0626\u0644\u0629 \u0644\u0643",askFallbackQuestion:"\u064A\u0631\u062C\u0649 \u062A\u0642\u062F\u064A\u0645 \u0627\u0644\u0645\u0639\u0644\u0648\u0645\u0627\u062A \u0627\u0644\u0646\u0627\u0642\u0635\u0629.",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",showOptions:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",hideOptions:"\u0625\u062E\u0641\u0627\u0621 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",qtypeText:"\u0625\u062C\u0627\u0628\u062A\u0643",qtypeEmail:"\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",qtypePhone:"\u0631\u0642\u0645 \u0627\u0644\u0647\u0627\u062A\u0641",qtypeNumber:"\u0631\u0642\u0645",qtypeDate:"\u062A\u0627\u0631\u064A\u062E",qtypeChooseOne:"\u0627\u062E\u062A\u0631 \u0648\u0627\u062D\u062F\u064B\u0627",qtypeChooseAny:"\u0627\u062E\u062A\u0631 \u0623\u064A\u064B\u0627",qtypeBoolean:"\u0646\u0639\u0645 / \u0644\u0627",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",approve:"\u0645\u0648\u0627\u0641\u0642\u0629",decline:"\u0631\u0641\u0636",changeAnswer:"\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",approvalPrompt:"{action}\u061F",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u063A\u064A\u064A\u0631 \u0625\u062C\u0627\u0628\u062A\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",stepInput:"\u0627\u0644\u0645\u062F\u062E\u0644\u0627\u062A",stepWorking:"\u0642\u064A\u062F \u0627\u0644\u062A\u0646\u0641\u064A\u0630",stepWorkingOnIt:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",stepNeedsYourApproval:"\u0628\u062D\u0627\u062C\u0629 \u0625\u0644\u0649 \u0645\u0648\u0627\u0641\u0642\u062A\u0643",stepWaitingForVisitor:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0632\u0627\u0626\u0631",stepApproved:"\u062A\u0645\u062A \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",stepDeclined:"\u0645\u0631\u0641\u0648\u0636",stepReplaced:"\u062A\u0645 \u0627\u0644\u0627\u0633\u062A\u0628\u062F\u0627\u0644",stepFailed:"\u0641\u0634\u0644",stepDidNotWork:"\u0644\u0645 \u064A\u0646\u062C\u062D",decidedYouApproved:"\u0648\u0627\u0641\u0642\u062A",decidedYouDeclined:"\u0631\u0641\u0636\u062A",decidedVisitorApproved:"\u0648\u0627\u0641\u0642 \u0627\u0644\u0632\u0627\u0626\u0631",decidedVisitorDeclined:"\u0631\u0641\u0636 \u0627\u0644\u0632\u0627\u0626\u0631",decidedTeamApproved:"\u0648\u0627\u0641\u0642 \u0639\u0636\u0648 \u0641\u064A \u0627\u0644\u0641\u0631\u064A\u0642",decidedTeamDeclined:"\u0631\u0641\u0636 \u0639\u0636\u0648 \u0641\u064A \u0627\u0644\u0641\u0631\u064A\u0642",decidedMemberApproved:"\u0648\u0627\u0641\u0642 {name}",decidedMemberDeclined:"\u0631\u0641\u0636 {name}",stepRawData:"\u0627\u0644\u0628\u064A\u0627\u0646\u0627\u062A \u0627\u0644\u0623\u0648\u0644\u064A\u0629",decidedRulesApproved:"\u062A\u0645\u062A \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629 \u062A\u0644\u0642\u0627\u0626\u064A\u064B\u0627",decidedRulesDeclined:"\u0631\u064F\u0641\u0636 \u062A\u0644\u0642\u0627\u0626\u064A\u064B\u0627",edit:"\u062A\u0639\u062F\u064A\u0644",toolStepsFailed:"\u0641\u0634\u0644 {count}",statusStopped:"\u0623\u064F\u0648\u0642\u0641",toolStepsStopped:"\u0623\u064F\u0648\u0642\u0641 \u0628\u0639\u062F {count} \u062E\u0637\u0648\u0627\u062A",toolStepsStoppedOne:"\u0623\u064F\u0648\u0642\u0641 \u0628\u0639\u062F \u062E\u0637\u0648\u0629 \u0648\u0627\u062D\u062F\u0629"},wg={attach:"Adjuntar archivos",file:"Archivo",attachmentMimeRejected:"{name} no es un tipo de archivo que acepte este chat.",attachmentTooLarge:"{name} es demasiado grande. Los archivos pueden ocupar hasta {max} en total.",poweredBy:"Con la tecnolog\xEDa de {name}",attachmentTooMany:"L\xEDmite de adjuntos: {count}.",attachmentUploadFailed:"No se pudo subir {name}.",conversationLoading:"Cargando chat\u2026",loadPreviousMessages:"Cargar mensajes anteriores",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",dropZoneRejected:"Estos archivos no se pueden adjuntar aqu\xED",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRateLimitedIn:"Demasiadas solicitudes: int\xE9ntalo de nuevo en {seconds} s.",errorOffline:"No se puede conectar con el servidor. Revisa tu conexi\xF3n e int\xE9ntalo de nuevo.",errorServer:"Algo sali\xF3 mal por nuestra parte. Int\xE9ntalo de nuevo.",errorOriginNotAllowed:"Este chat a\xFAn no est\xE1 configurado para este sitio web.",errorMessageTooLong:"Ese mensaje es demasiado largo. Ac\xF3rtalo y env\xEDalo de nuevo.",errorReconnecting:"Se perdi\xF3 la conexi\xF3n. Reconectando\u2026",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 chats",historyContinue:"Continuar el chat",historyLoading:"Cargando tus chats\u2026",historyTitle:"Historial de chats",loadMoreConversations:"Cargar m\xE1s conversaciones",language:"Idioma",launcherOpen:"Abrir el chat",launcherAsk:"Preg\xFAntale a {name}",micBlocked:"El micr\xF3fono est\xE1 bloqueado para este sitio, as\xED que la entrada de voz no puede iniciarse.",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nuevo chat",panelTitle:"Chat",popOut:"Abrir en una pesta\xF1a nueva",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",queueMessage:"Poner mensaje en cola",removeQueuedMessage:"Quitar mensaje de la cola",removeAttachment:"Quitar {name}",suggestedReplies:"Respuestas sugeridas",compactingContext:"Optimizando el contexto de la conversaci\xF3n\u2026",soundOff:"Sonido desactivado",soundOn:"Sonido activado",talkToOperator:"Hablar con una persona",connectingOperator:"Conect\xE1ndote con una persona\u2026",noOperatorAvailable:"Nadie est\xE1 disponible ahora \u2014 deja tus datos y te contactaremos.",chattingWithOperator:"Est\xE1s chateando con {operator}",operatorBadgeTitle:"Chat en vivo",chatNotice:"Est\xE1s chateando con un asistente de IA.",cancelOperatorRequest:"Seguir con la IA",loginPrompt:"Inicia sesi\xF3n para recibir una ayuda m\xE1s r\xE1pida y personalizada",loginAction:"Iniciar sesi\xF3n",loginRequired:"Inicia sesi\xF3n para chatear con nosotros",loginExpired:"Tu sesi\xF3n ha caducado. Inicia sesi\xF3n para continuar esta conversaci\xF3n.",loginExpiredGuest:"Tu sesi\xF3n ha caducado. Inicia sesi\xF3n para continuar esta conversaci\xF3n o empieza una nueva como invitado.",startAsGuest:"Empezar una nueva conversaci\xF3n",loggedInAs:"Sesi\xF3n iniciada como {name}",loggedIn:"Sesi\xF3n iniciada",dismissLoginPrompt:"Ocultar",emailTranscript:"Enviar transcripci\xF3n",emailTranscriptPrompt:"Recibe una copia de esta conversaci\xF3n por correo.",emailTranscriptEmailLabel:"Correo electr\xF3nico",emailTranscriptSend:"Enviar transcripci\xF3n",emailTranscriptSending:"Enviando\u2026",emailTranscriptSent:"Enviado a {email}.",emailTranscriptAlreadySent:"Esta conversaci\xF3n ya se envi\xF3. Env\xEDa un mensaje nuevo para enviarla otra vez.",emailTranscriptLimited:"Has alcanzado el l\xEDmite por ahora. Int\xE9ntalo m\xE1s tarde.",emailTranscriptFailed:"No se pudo enviar. Int\xE9ntalo de nuevo.",emailTranscriptNotDelivered:"No se pudo enviar a esta direcci\xF3n. Rev\xEDsala e int\xE9ntalo de nuevo.",emailTranscriptCancel:"Cancelar",emailTranscriptDone:"Listo",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",visualPreparing:"Preparando visualizaci\xF3n\u2026",visualError:"No se pudo mostrar esta visualizaci\xF3n.",visualPartial:"No se pudieron mostrar algunas partes de esta visualizaci\xF3n.",visualSoldOut:"Agotado",visualCartEmpty:"Tu carrito est\xE1 vac\xEDo.",visualQuantity:"Cant.",visualChoose:"Elige",thinking:"Pensando\u2026",thought:"Razonamiento",thoughtFor:"Razon\xF3 durante {time}",toolResult:"Resultado",sources:"Fuentes",feedbackUp:"Buena respuesta",feedbackDown:"Mala respuesta",feedbackThanks:"Gracias por tu opini\xF3n",copy:"Copiar",copied:"Copiado",copyTicketReference:"Ticket {reference}, copiar",tabHome:"Inicio",tabConversations:"Chats",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",chatUnavailable:"Este chat no est\xE1 disponible en este momento",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",contentHelpful:"\xBFTe result\xF3 \xFAtil?",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeAskPlaceholder:"Haz una pregunta\u2026",homeWhatsNew:"Lo nuevo",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:"Sin resultados para \xAB{query}\xBB",helpShowMore:"Mostrar m\xE1s",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsShowMore:"Mostrar m\xE1s",newsUnseen:"Publicaci\xF3n nueva",unread:"No le\xEDdo",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Preguntas para ti",askFallbackQuestion:"Indica la informaci\xF3n que falta.",inputBadge:"Preguntas",inputAnswered:"Respondido",inputSkipped:"Omitido",showOptions:"Mostrar opciones",hideOptions:"Ocultar opciones",qtypeText:"Tu respuesta",qtypeEmail:"Correo electr\xF3nico",qtypePhone:"N\xFAmero de tel\xE9fono",qtypeNumber:"N\xFAmero",qtypeDate:"Fecha",qtypeChooseOne:"Elige una",qtypeChooseAny:"Elige varias",qtypeBoolean:"S\xED / No",inputSubmit:"Enviar respuestas",inputSubmitHint:"Enter para enviar \xB7 May\xFAs+Enter = nueva l\xEDnea",inputSkip:"Omitir",confirmYes:"S\xED",confirmNo:"No",approve:"Aprobar",decline:"Rechazar",changeAnswer:"Cambiar respuesta",approvalPrompt:"\xBF{action}?",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",stepInput:"Entrada",stepWorking:"En curso",stepWorkingOnIt:"En curso\u2026",stepNeedsYourApproval:"Necesita tu aprobaci\xF3n",stepWaitingForVisitor:"Esperando al visitante",stepApproved:"Aprobado",stepDeclined:"Rechazado",stepReplaced:"Reemplazado",stepFailed:"Fall\xF3",stepDidNotWork:"No funcion\xF3",decidedYouApproved:"Lo aprobaste",decidedYouDeclined:"Lo rechazaste",decidedVisitorApproved:"El visitante aprob\xF3",decidedVisitorDeclined:"El visitante rechaz\xF3",decidedTeamApproved:"Aprobado por un miembro del equipo",decidedTeamDeclined:"Rechazado por un miembro del equipo",decidedMemberApproved:"Aprobado por {name}",decidedMemberDeclined:"Rechazado por {name}",stepRawData:"Datos sin procesar",decidedRulesApproved:"Aprobado autom\xE1ticamente",decidedRulesDeclined:"Rechazado autom\xE1ticamente",edit:"Editar",toolStepsFailed:"{count} con error",statusStopped:"Detenido",toolStepsStopped:"Detenido tras {count} pasos",toolStepsStoppedOne:"Detenido tras 1 paso"},kg={attach:"\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",file:"\u05E7\u05D5\u05D1\u05E5",attachmentMimeRejected:"\u05D4\u05E7\u05D5\u05D1\u05E5 {name} \u05D0\u05D9\u05E0\u05D5 \u05DE\u05E1\u05D5\u05D2 \u05E9\u05D4\u05E6\u05F3\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05DE\u05E7\u05D1\u05DC.",attachmentTooLarge:"\u05D4\u05E7\u05D5\u05D1\u05E5 {name} \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9. \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05D9\u05DB\u05D5\u05DC\u05D9\u05DD \u05DC\u05D4\u05D2\u05D9\u05E2 \u05D9\u05D7\u05D3 \u05E2\u05D3 {max}.",poweredBy:"\u05DE\u05D5\u05E4\u05E2\u05DC \u05E2\u05DC \u05D9\u05D3\u05D9 {name}",attachmentTooMany:"\u05DE\u05E1\u05E4\u05E8 \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05D4\u05DE\u05E8\u05D1\u05D9 \u05DC\u05E6\u05D9\u05E8\u05D5\u05E3: {count}.",attachmentUploadFailed:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05D4\u05D9\u05D4 \u05DC\u05D4\u05E2\u05DC\u05D5\u05EA \u05D0\u05EA {name}.",conversationLoading:"\u05D8\u05D5\u05E2\u05DF \u05E6\u05F3\u05D0\u05D8\u2026",loadPreviousMessages:"\u05D8\u05E2\u05D9\u05E0\u05EA \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05E7\u05D5\u05D3\u05DE\u05D5\u05EA",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",dropZoneRejected:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05DC\u05E6\u05E8\u05E3 \u05DB\u05D0\u05DF \u05D0\u05EA \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05D4\u05D0\u05DC\u05D4",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.",errorRateLimitedIn:"\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 {seconds} \u05E9\u05E0\u05F3.",errorOffline:"\u05D0\u05D9\u05DF \u05D7\u05D9\u05D1\u05D5\u05E8 \u05DC\u05E9\u05E8\u05EA. \u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05D4\u05D7\u05D9\u05D1\u05D5\u05E8 \u05D5\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1.",errorServer:"\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9 \u05D0\u05E6\u05DC\u05E0\u05D5. \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1.",errorOriginNotAllowed:"\u05D4\u05E6'\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05E2\u05D3\u05D9\u05D9\u05DF \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 \u05DC\u05D0\u05EA\u05E8 \u05D4\u05D6\u05D4.",errorMessageTooLong:"\u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05D4\u05D6\u05D5 \u05D0\u05E8\u05D5\u05DB\u05D4 \u05DE\u05D3\u05D9. \u05E7\u05E6\u05E8\u05D5 \u05D0\u05D5\u05EA\u05D4 \u05D5\u05E9\u05DC\u05D7\u05D5 \u05E9\u05D5\u05D1.",errorReconnecting:"\u05D4\u05D7\u05D9\u05D1\u05D5\u05E8 \u05D0\u05D1\u05D3. \u05DE\u05EA\u05D7\u05D1\u05E8 \u05DE\u05D7\u05D3\u05E9\u2026",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\u05E6\u05F3\u05D0\u05D8",historyEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E7\u05D5\u05D3\u05DE\u05D9\u05DD",historyContinue:"\u05D4\u05DE\u05E9\u05DA \u05E6\u05F3\u05D0\u05D8",historyLoading:"\u05D8\u05D5\u05E2\u05DF \u05D0\u05EA \u05D4\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA\u2026",historyTitle:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D9\u05EA \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",loadMoreConversations:"\u05D8\u05E2\u05D9\u05E0\u05EA \u05E9\u05D9\u05D7\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",language:"\u05E9\u05E4\u05D4",launcherOpen:"\u05E4\u05EA\u05D9\u05D7\u05EA \u05E6\u05F3\u05D0\u05D8",launcherAsk:"\u05DC\u05E9\u05D0\u05D5\u05DC \u05D0\u05EA {name}",micBlocked:"\u05D4\u05DE\u05D9\u05E7\u05E8\u05D5\u05E4\u05D5\u05DF \u05D7\u05E1\u05D5\u05DD \u05D1\u05D0\u05EA\u05E8 \u05D4\u05D6\u05D4, \u05D5\u05DC\u05DB\u05DF \u05D0\u05D9 \u05D0\u05E4\u05E9\u05E8 \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9.",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",moreActions:"\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",newConversation:"\u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",panelTitle:"\u05E6\u05F3\u05D0\u05D8",popOut:"\u05E4\u05EA\u05D9\u05D7\u05D4 \u05D1\u05DB\u05E8\u05D8\u05D9\u05E1\u05D9\u05D9\u05D4 \u05D7\u05D3\u05E9\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",queueMessage:"\u05D4\u05D5\u05E1\u05E4\u05EA \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05DC\u05EA\u05D5\u05E8",removeQueuedMessage:"\u05D4\u05E1\u05E8\u05EA \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05DE\u05D4\u05EA\u05D5\u05E8",removeAttachment:"\u05D4\u05E1\u05E8\u05EA {name}",suggestedReplies:"\u05EA\u05E9\u05D5\u05D1\u05D5\u05EA \u05DE\u05D5\u05E6\u05E2\u05D5\u05EA",compactingContext:"\u05DE\u05D1\u05E6\u05E2 \u05D0\u05D5\u05E4\u05D8\u05D9\u05DE\u05D9\u05D6\u05E6\u05D9\u05D4 \u05DC\u05D4\u05E7\u05E9\u05E8 \u05D4\u05E9\u05D9\u05D7\u05D4\u2026",soundOff:"\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",soundOn:"\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",talkToOperator:"\u05D3\u05D1\u05E8\u05D5 \u05E2\u05DD \u05D0\u05D3\u05DD",connectingOperator:"\u05DE\u05D7\u05D1\u05E8\u05D9\u05DD \u05D0\u05D5\u05EA\u05DA \u05DC\u05D0\u05D3\u05DD\u2026",noOperatorAvailable:"\u05D0\u05D9\u05DF \u05E0\u05E6\u05D9\u05D2\u05D9\u05DD \u05D6\u05DE\u05D9\u05E0\u05D9\u05DD \u05DB\u05E2\u05EA \u2014 \u05D4\u05E9\u05D0\u05E8 \u05D0\u05EA \u05D4\u05E4\u05E8\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA \u05D5\u05E0\u05D7\u05D6\u05D5\u05E8 \u05D0\u05DC\u05D9\u05DA.",chattingWithOperator:"\u05D0\u05EA\u05D4 \u05DE\u05E6\u05F3\u05D5\u05D8\u05D8 \u05E2\u05DD {operator}",operatorBadgeTitle:"\u05E6\u05F3\u05D0\u05D8 \u05D7\u05D9",chatNotice:"\u05D0\u05EA\u05D4 \u05DE\u05E6\u05F3\u05D5\u05D8\u05D8 \u05E2\u05DD \u05E2\u05D5\u05D6\u05E8 \u05D1\u05D9\u05E0\u05D4 \u05DE\u05DC\u05D0\u05DB\u05D5\u05EA\u05D9\u05EA.",cancelOperatorRequest:"\u05D4\u05DE\u05E9\u05DA \u05DC\u05E9\u05D5\u05D7\u05D7 \u05E2\u05DD \u05D4-AI",loginPrompt:"\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5 \u05DC\u05E7\u05D1\u05DC\u05EA \u05EA\u05DE\u05D9\u05DB\u05D4 \u05DE\u05D4\u05D9\u05E8\u05D4 \u05D5\u05DE\u05D5\u05EA\u05D0\u05DE\u05EA \u05D0\u05D9\u05E9\u05D9\u05EA",loginAction:"\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5\u05EA",loginRequired:"\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5 \u05DB\u05D3\u05D9 \u05DC\u05E9\u05D5\u05D7\u05D7 \u05D0\u05D9\u05EA\u05E0\u05D5",loginExpired:"\u05E4\u05D2 \u05EA\u05D5\u05E7\u05E3 \u05D4\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5\u05EA \u05E9\u05DC\u05DA. \u05D4\u05EA\u05D7\u05D1\u05E8\u05D5 \u05DB\u05D3\u05D9 \u05DC\u05D4\u05DE\u05E9\u05D9\u05DA \u05D1\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5.",loginExpiredGuest:"\u05E4\u05D2 \u05EA\u05D5\u05E7\u05E3 \u05D4\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5\u05EA \u05E9\u05DC\u05DA. \u05D4\u05EA\u05D7\u05D1\u05E8\u05D5 \u05DB\u05D3\u05D9 \u05DC\u05D4\u05DE\u05E9\u05D9\u05DA \u05D1\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5, \u05D0\u05D5 \u05D4\u05EA\u05D7\u05D9\u05DC\u05D5 \u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4 \u05DB\u05D0\u05D5\u05E8\u05D7\u05D9\u05DD.",startAsGuest:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4",loggedInAs:"\u05DE\u05D7\u05D5\u05D1\u05E8/\u05EA \u05D1\u05EA\u05D5\u05E8 {name}",loggedIn:"\u05DE\u05D7\u05D5\u05D1\u05E8/\u05EA",dismissLoginPrompt:"\u05D4\u05E1\u05EA\u05E8\u05D4",emailTranscript:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05DE\u05DC\u05D9\u05DC \u05D1\u05D3\u05D5\u05D0\u05F4\u05DC",emailTranscriptPrompt:"\u05E7\u05D1\u05DC\u05D5 \u05E2\u05D5\u05EA\u05E7 \u05E9\u05DC \u05D4\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5 \u05D1\u05D3\u05D5\u05D0\u05F4\u05DC.",emailTranscriptEmailLabel:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D3\u05D5\u05D0\u05F4\u05DC",emailTranscriptSend:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05D4\u05EA\u05DE\u05DC\u05D9\u05DC",emailTranscriptSending:"\u05E9\u05D5\u05DC\u05D7\u05D9\u05DD\u2026",emailTranscriptSent:"\u05E0\u05E9\u05DC\u05D7 \u05D0\u05DC {email}.",emailTranscriptAlreadySent:"\u05D4\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5 \u05DB\u05D1\u05E8 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05E9\u05DC\u05D7\u05D5 \u05D4\u05D5\u05D3\u05E2\u05D4 \u05D7\u05D3\u05E9\u05D4 \u05DB\u05D3\u05D9 \u05DC\u05E9\u05DC\u05D5\u05D7 \u05D0\u05D5\u05EA\u05D4 \u05E9\u05D5\u05D1.",emailTranscriptLimited:"\u05D4\u05D2\u05E2\u05EA\u05DD \u05DC\u05DE\u05D2\u05D1\u05DC\u05D4 \u05DB\u05E8\u05D2\u05E2. \u05E0\u05E1\u05D5 \u05E9\u05D5\u05D1 \u05DE\u05D0\u05D5\u05D7\u05E8 \u05D9\u05D5\u05EA\u05E8.",emailTranscriptFailed:"\u05D4\u05E9\u05DC\u05D9\u05D7\u05D4 \u05E0\u05DB\u05E9\u05DC\u05D4. \u05E0\u05E1\u05D5 \u05E9\u05D5\u05D1.",emailTranscriptNotDelivered:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05DC\u05E9\u05DC\u05D5\u05D7 \u05DC\u05DB\u05EA\u05D5\u05D1\u05EA \u05D4\u05D6\u05D5. \u05D1\u05D3\u05E7\u05D5 \u05D0\u05D5\u05EA\u05D4 \u05D5\u05E0\u05E1\u05D5 \u05E9\u05D5\u05D1.",emailTranscriptCancel:"\u05D1\u05D9\u05D8\u05D5\u05DC",emailTranscriptDone:"\u05E1\u05D9\u05D5\u05DD",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",visualPreparing:"\u05DE\u05DB\u05D9\u05DF \u05EA\u05E6\u05D5\u05D2\u05D4\u2026",visualError:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05D4\u05D9\u05D4 \u05DC\u05D4\u05E6\u05D9\u05D2 \u05EA\u05E6\u05D5\u05D2\u05D4 \u05D6\u05D5.",visualPartial:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05D4\u05D9\u05D4 \u05DC\u05D4\u05E6\u05D9\u05D2 \u05D7\u05DC\u05E7\u05D9\u05DD \u05DE\u05EA\u05E6\u05D5\u05D2\u05D4 \u05D6\u05D5.",visualSoldOut:"\u05D0\u05D6\u05DC \u05DE\u05D4\u05DE\u05DC\u05D0\u05D9",visualCartEmpty:"\u05D4\u05E2\u05D2\u05DC\u05D4 \u05E9\u05DC\u05DA \u05E8\u05D9\u05E7\u05D4.",visualQuantity:"\u05DB\u05DE\u05D5\u05EA",visualChoose:"\u05D1\u05D7\u05E8\u05D5",thinking:"\u05D7\u05D5\u05E9\u05D1\u2026",thought:"\u05DE\u05D7\u05E9\u05D1\u05D4",thoughtFor:"\u05D7\u05E9\u05D1 \u05D1\u05DE\u05E9\u05DA {time}",toolResult:"\u05EA\u05D5\u05E6\u05D0\u05D4",sources:"\u05DE\u05E7\u05D5\u05E8\u05D5\u05EA",feedbackUp:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D8\u05D5\u05D1\u05D4",feedbackDown:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D2\u05E8\u05D5\u05E2\u05D4",feedbackThanks:"\u05EA\u05D5\u05D3\u05D4 \u05E2\u05DC \u05D4\u05DE\u05E9\u05D5\u05D1",copy:"\u05D4\u05E2\u05EA\u05E7",copied:"\u05D4\u05D5\u05E2\u05EA\u05E7",copyTicketReference:"\u05E4\u05E0\u05D9\u05D9\u05D4 {reference}, \u05D4\u05E2\u05EA\u05E7\u05D4",tabHome:"\u05D1\u05D9\u05EA",tabConversations:"\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",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",chatUnavailable:"\u05D4\u05E6\u05F3\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05D0\u05D9\u05E0\u05D5 \u05D6\u05DE\u05D9\u05DF \u05DB\u05E8\u05D2\u05E2",moduleBack:"\u05D7\u05D6\u05E8\u05D4",contentLoading:"\u05D8\u05D5\u05E2\u05DF\u2026",contentHelpful:"\u05D4\u05D0\u05DD \u05D6\u05D4 \u05E2\u05D6\u05E8?",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",homeAskPlaceholder:"\u05E9\u05D0\u05DC\u05D5 \u05E9\u05D0\u05DC\u05D4\u2026",homeWhatsNew:"\u05DE\u05D4 \u05D7\u05D3\u05E9",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:"\u05D0\u05D9\u05DF \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA \u05E2\u05D1\u05D5\u05E8 \u201E{query}\u201D",helpShowMore:"\u05D4\u05E6\u05D2\u05EA \u05E2\u05D5\u05D3",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",newsShowMore:"\u05D4\u05E6\u05D2\u05EA \u05E2\u05D5\u05D3",newsUnseen:"\u05E4\u05D5\u05E1\u05D8 \u05D7\u05D3\u05E9",unread:"\u05DC\u05D0 \u05E0\u05E7\u05E8\u05D0",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",formInvalidNumber:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",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",askFallbackQuestion:"\u05D0\u05E0\u05D0 \u05E1\u05E4\u05E7\u05D5 \u05D0\u05EA \u05D4\u05DE\u05D9\u05D3\u05E2 \u05D4\u05D7\u05E1\u05E8.",inputBadge:"\u05E9\u05D0\u05DC\u05D5\u05EA",inputAnswered:"\u05E0\u05E2\u05E0\u05D4",inputSkipped:"\u05D3\u05D5\u05DC\u05D2",showOptions:"\u05D4\u05E6\u05D2 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",hideOptions:"\u05D4\u05E1\u05EA\u05E8 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",qtypeText:"\u05D4\u05EA\u05E9\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA",qtypeEmail:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",qtypePhone:"\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF",qtypeNumber:"\u05DE\u05E1\u05E4\u05E8",qtypeDate:"\u05EA\u05D0\u05E8\u05D9\u05DA",qtypeChooseOne:"\u05D1\u05D7\u05E8 \u05D0\u05D7\u05EA",qtypeChooseAny:"\u05D1\u05D7\u05E8 \u05DB\u05DE\u05D4",qtypeBoolean:"\u05DB\u05DF / \u05DC\u05D0",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",approve:"\u05D0\u05D9\u05E9\u05D5\u05E8",decline:"\u05D3\u05D7\u05D9\u05D9\u05D4",changeAnswer:"\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05EA\u05E9\u05D5\u05D1\u05D4",approvalPrompt:"{action}?",approvalEditHint:"\u05D0\u05E4\u05E9\u05E8 \u05DC\u05E9\u05E0\u05D5\u05EA \u05D0\u05EA \u05D4\u05EA\u05E9\u05D5\u05D1\u05D4 \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05DE\u05E9\u05D9\u05DA.",stepInput:"\u05E7\u05DC\u05D8",stepWorking:"\u05D1\u05D1\u05D9\u05E6\u05D5\u05E2",stepWorkingOnIt:"\u05DE\u05D8\u05E4\u05DC\u05D9\u05DD \u05D1\u05D6\u05D4\u2026",stepNeedsYourApproval:"\u05E0\u05D3\u05E8\u05E9 \u05D4\u05D0\u05D9\u05E9\u05D5\u05E8 \u05E9\u05DC\u05DA",stepWaitingForVisitor:"\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05DE\u05D1\u05E7\u05E8",stepApproved:"\u05D0\u05D5\u05E9\u05E8",stepDeclined:"\u05E0\u05D3\u05D7\u05D4",stepReplaced:"\u05D4\u05D5\u05D7\u05DC\u05E3",stepFailed:"\u05E0\u05DB\u05E9\u05DC",stepDidNotWork:"\u05DC\u05D0 \u05D4\u05E6\u05DC\u05D9\u05D7",decidedYouApproved:"\u05D0\u05D9\u05E9\u05E8\u05EA",decidedYouDeclined:"\u05D3\u05D7\u05D9\u05EA",decidedVisitorApproved:"\u05D0\u05D5\u05E9\u05E8 \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D4\u05DE\u05D1\u05E7\u05E8",decidedVisitorDeclined:"\u05E0\u05D3\u05D7\u05D4 \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D4\u05DE\u05D1\u05E7\u05E8",decidedTeamApproved:"\u05D0\u05D5\u05E9\u05E8 \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D7\u05D1\u05E8 \u05E6\u05D5\u05D5\u05EA",decidedTeamDeclined:"\u05E0\u05D3\u05D7\u05D4 \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D7\u05D1\u05E8 \u05E6\u05D5\u05D5\u05EA",decidedMemberApproved:"\u05D0\u05D5\u05E9\u05E8 \u05E2\u05DC \u05D9\u05D3\u05D9 {name}",decidedMemberDeclined:"\u05E0\u05D3\u05D7\u05D4 \u05E2\u05DC \u05D9\u05D3\u05D9 {name}",stepRawData:"\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD \u05D2\u05D5\u05DC\u05DE\u05D9\u05D9\u05DD",decidedRulesApproved:"\u05D0\u05D5\u05E9\u05E8 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA",decidedRulesDeclined:"\u05E0\u05D3\u05D7\u05D4 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA",edit:"\u05E2\u05E8\u05D9\u05DB\u05D4",toolStepsFailed:"{count} \u05E0\u05DB\u05E9\u05DC\u05D5",statusStopped:"\u05E0\u05E2\u05E6\u05E8",toolStepsStopped:"\u05E0\u05E2\u05E6\u05E8 \u05D0\u05D7\u05E8\u05D9 {count} \u05E9\u05DC\u05D1\u05D9\u05DD",toolStepsStoppedOne:"\u05E0\u05E2\u05E6\u05E8 \u05D0\u05D7\u05E8\u05D9 \u05E9\u05DC\u05D1 \u05D0\u05D7\u05D3"},Cg={attach:"\u6DFB\u52A0\u9644\u4EF6",file:"\u6587\u4EF6",attachmentMimeRejected:"\u6B64\u804A\u5929\u4E0D\u63A5\u53D7 {name} \u7684\u6587\u4EF6\u7C7B\u578B\u3002",attachmentTooLarge:"{name} \u592A\u5927\u4E86\u3002\u6587\u4EF6\u603B\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 {max}\u3002",poweredBy:"\u7531 {name} \u63D0\u4F9B\u652F\u6301",attachmentTooMany:"\u6700\u591A\u53EF\u6DFB\u52A0 {count} \u4E2A\u9644\u4EF6\u3002",attachmentUploadFailed:"{name} \u4E0A\u4F20\u5931\u8D25\u3002",conversationLoading:"\u6B63\u5728\u52A0\u8F7D\u804A\u5929\u2026",loadPreviousMessages:"\u52A0\u8F7D\u66F4\u65E9\u7684\u6D88\u606F",close:"\u5173\u95ED",collapse:"\u6536\u8D77",collapseSidebar:"\u6536\u8D77\u4FA7\u8FB9\u680F",composerPlaceholder:"\u8F93\u5165\u6D88\u606F\u2026",dateLastWeek:"\u6700\u8FD1 7 \u5929",dateOlder:"\u66F4\u65E9",dateToday:"\u4ECA\u5929",dateYesterday:"\u6628\u5929",dropZone:"\u62D6\u653E\u6587\u4EF6\u4EE5\u6DFB\u52A0\u9644\u4EF6",dropZoneRejected:"\u8FD9\u4E9B\u6587\u4EF6\u65E0\u6CD5\u5728\u6B64\u6DFB\u52A0",errorGeneric:"\u51FA\u4E86\u70B9\u95EE\u9898",errorRateLimited:"\u8BF7\u6C42\u8FC7\u591A\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",errorRateLimitedIn:"\u8BF7\u6C42\u8FC7\u591A\uFF0C\u8BF7\u5728 {seconds} \u79D2\u540E\u91CD\u8BD5\u3002",errorOffline:"\u65E0\u6CD5\u8FDE\u63A5\u670D\u52A1\u5668\u3002\u8BF7\u68C0\u67E5\u7F51\u7EDC\u540E\u91CD\u8BD5\u3002",errorServer:"\u6211\u4EEC\u8FD9\u8FB9\u51FA\u4E86\u70B9\u95EE\u9898\u3002\u8BF7\u91CD\u8BD5\u3002",errorOriginNotAllowed:"\u6B64\u804A\u5929\u5C1A\u672A\u4E3A\u672C\u7F51\u7AD9\u8BBE\u7F6E\u3002",errorMessageTooLong:"\u6D88\u606F\u592A\u957F\u4E86\u3002\u8BF7\u7F29\u77ED\u540E\u91CD\u65B0\u53D1\u9001\u3002",errorReconnecting:"\u8FDE\u63A5\u5DF2\u65AD\u5F00\uFF0C\u6B63\u5728\u91CD\u65B0\u8FDE\u63A5\u2026",errorRetry:"\u91CD\u8BD5",expand:"\u5C55\u5F00",expandSidebar:"\u5C55\u5F00\u4FA7\u8FB9\u680F",exitFullscreen:"\u9000\u51FA\u5168\u5C4F",fullscreen:"\u5168\u5C4F",history:"\u5386\u53F2\u8BB0\u5F55",historyBack:"\u8FD4\u56DE\u804A\u5929",historyEmpty:"\u8FD8\u6CA1\u6709\u4EE5\u524D\u7684\u804A\u5929",historyLoading:"\u6B63\u5728\u52A0\u8F7D\u4F60\u7684\u804A\u5929\u2026",historyContinue:"\u7EE7\u7EED\u804A\u5929",historyTitle:"\u804A\u5929\u8BB0\u5F55",loadMoreConversations:"\u52A0\u8F7D\u66F4\u591A\u5BF9\u8BDD",language:"\u8BED\u8A00",launcherOpen:"\u6253\u5F00\u804A\u5929",launcherAsk:"\u8BE2\u95EE {name}",micBlocked:"\u6B64\u7F51\u7AD9\u7684\u9EA6\u514B\u98CE\u5DF2\u88AB\u963B\u6B62\uFF0C\u65E0\u6CD5\u5F00\u59CB\u8BED\u97F3\u8F93\u5165\u3002",micStart:"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165",micStop:"\u505C\u6B62\u8BED\u97F3\u8F93\u5165",moreActions:"\u66F4\u591A\u64CD\u4F5C",newConversation:"\u65B0\u804A\u5929",panelTitle:"\u804A\u5929",popOut:"\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00",resizeHandle:"\u62D6\u52A8\u4EE5\u8C03\u6574\u5927\u5C0F",scrollToBottom:"\u6EDA\u52A8\u5230\u6700\u65B0",send:"\u53D1\u9001",queueMessage:"\u6392\u961F\u53D1\u9001",removeQueuedMessage:"\u79FB\u9664\u6392\u961F\u7684\u6D88\u606F",removeAttachment:"\u79FB\u9664 {name}",suggestedReplies:"\u63A8\u8350\u56DE\u590D",compactingContext:"\u6B63\u5728\u4F18\u5316\u5BF9\u8BDD\u4E0A\u4E0B\u6587\u2026",soundOff:"\u5173\u95ED\u58F0\u97F3",soundOn:"\u6253\u5F00\u58F0\u97F3",talkToOperator:"\u4E0E\u771F\u4EBA\u4EA4\u8C08",connectingOperator:"\u6B63\u5728\u4E3A\u4F60\u8054\u7CFB\u771F\u4EBA\u2026",noOperatorAvailable:"\u76EE\u524D\u6CA1\u6709\u4EBA\u6709\u7A7A\uFF0C\u8BF7\u7559\u4E0B\u4F60\u7684\u8054\u7CFB\u65B9\u5F0F\uFF0C\u6211\u4EEC\u4F1A\u8DDF\u8FDB\u3002",chattingWithOperator:"\u4F60\u6B63\u5728\u4E0E {operator} \u804A\u5929",operatorBadgeTitle:"\u5728\u7EBF\u804A\u5929",chatNotice:"\u4F60\u6B63\u5728\u4E0E AI \u52A9\u624B\u804A\u5929\u3002",cancelOperatorRequest:"\u7EE7\u7EED\u4E0E AI \u804A\u5929",loginPrompt:"\u767B\u5F55\u4EE5\u83B7\u5F97\u66F4\u5FEB\u3001\u66F4\u4E2A\u6027\u5316\u7684\u652F\u6301",loginAction:"\u767B\u5F55",loginRequired:"\u767B\u5F55\u540E\u4E0E\u6211\u4EEC\u804A\u5929",loginExpired:"\u4F60\u7684\u767B\u5F55\u5DF2\u8FC7\u671F\u3002\u8BF7\u767B\u5F55\u4EE5\u7EE7\u7EED\u6B64\u804A\u5929\u3002",loginExpiredGuest:"\u4F60\u7684\u767B\u5F55\u5DF2\u8FC7\u671F\u3002\u8BF7\u767B\u5F55\u4EE5\u7EE7\u7EED\u6B64\u804A\u5929\uFF0C\u6216\u4EE5\u8BBF\u5BA2\u8EAB\u4EFD\u5F00\u59CB\u65B0\u5BF9\u8BDD\u3002",startAsGuest:"\u5F00\u59CB\u65B0\u5BF9\u8BDD",loggedInAs:"\u5DF2\u767B\u5F55\u4E3A {name}",loggedIn:"\u5DF2\u767B\u5F55",dismissLoginPrompt:"\u9690\u85CF",emailTranscript:"\u901A\u8FC7\u90AE\u4EF6\u53D1\u9001\u804A\u5929\u8BB0\u5F55",emailTranscriptPrompt:"\u901A\u8FC7\u90AE\u4EF6\u83B7\u53D6\u6B64\u5BF9\u8BDD\u7684\u526F\u672C\u3002",emailTranscriptEmailLabel:"\u90AE\u7BB1\u5730\u5740",emailTranscriptSend:"\u53D1\u9001\u804A\u5929\u8BB0\u5F55",emailTranscriptSending:"\u6B63\u5728\u53D1\u9001\u2026",emailTranscriptSent:"\u5DF2\u53D1\u9001\u81F3 {email}\u3002",emailTranscriptAlreadySent:"\u6B64\u5BF9\u8BDD\u5DF2\u901A\u8FC7\u90AE\u4EF6\u53D1\u9001\u3002\u53D1\u9001\u4E00\u6761\u65B0\u6D88\u606F\u540E\u53EF\u518D\u6B21\u53D1\u9001\u3002",emailTranscriptLimited:"\u4F60\u5DF2\u8FBE\u5230\u5F53\u524D\u4E0A\u9650\u3002\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",emailTranscriptFailed:"\u53D1\u9001\u5931\u8D25\u3002\u8BF7\u91CD\u8BD5\u3002",emailTranscriptNotDelivered:"\u65E0\u6CD5\u53D1\u9001\u5230\u6B64\u5730\u5740\u3002\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5\u3002",emailTranscriptCancel:"\u53D6\u6D88",emailTranscriptDone:"\u5B8C\u6210",stop:"\u505C\u6B62",theme:"\u4E3B\u9898",themeAuto:"\u81EA\u52A8",themeDark:"\u6DF1\u8272",themeLight:"\u6D45\u8272",textSize:"\u6587\u5B57\u5927\u5C0F",textSizeSmall:"\u5C0F",textSizeNormal:"\u6807\u51C6",textSizeLarge:"\u5927",loading:"\u6B63\u5728\u52A0\u8F7D\u2026",visualPreparing:"\u6B63\u5728\u51C6\u5907\u56FE\u8868\u2026",visualError:"\u65E0\u6CD5\u663E\u793A\u6B64\u56FE\u8868\u3002",visualPartial:"\u6B64\u56FE\u8868\u7684\u90E8\u5206\u5185\u5BB9\u65E0\u6CD5\u663E\u793A\u3002",visualSoldOut:"\u5DF2\u552E\u7F44",visualCartEmpty:"\u4F60\u7684\u8D2D\u7269\u8F66\u662F\u7A7A\u7684\u3002",visualQuantity:"\u6570\u91CF",visualChoose:"\u9009\u62E9",thinking:"\u6B63\u5728\u601D\u8003\u2026",thought:"\u601D\u8003\u8FC7\u7A0B",thoughtFor:"\u601D\u8003\u4E86 {time}",toolResult:"\u7ED3\u679C",sources:"\u6765\u6E90",feedbackUp:"\u56DE\u7B54\u5F88\u597D",feedbackDown:"\u56DE\u7B54\u4E0D\u597D",feedbackThanks:"\u611F\u8C22\u4F60\u7684\u53CD\u9988",copy:"\u590D\u5236",copied:"\u5DF2\u590D\u5236",copyTicketReference:"\u5DE5\u5355 {reference}\uFF0C\u590D\u5236",tabHome:"\u9996\u9875",tabConversations:"\u804A\u5929",tabHelp:"\u5E2E\u52A9",tabNews:"\u52A8\u6001",modulesEmpty:"\u8FD9\u91CC\u8FD8\u6CA1\u6709\u5185\u5BB9",chatUnavailable:"\u6B64\u804A\u5929\u76EE\u524D\u4E0D\u53EF\u7528",moduleBack:"\u8FD4\u56DE",contentLoading:"\u6B63\u5728\u52A0\u8F7D\u2026",contentHelpful:"\u8FD9\u5BF9\u4F60\u6709\u5E2E\u52A9\u5417\uFF1F",homeGreeting:"\u6709\u4EC0\u4E48\u53EF\u4EE5\u5E2E\u4F60\uFF1F",homeGreetingNamed:"\u4F60\u597D\uFF0C{name} \u{1F44B}",homeGreetingLead:"\u6709\u4EC0\u4E48\u53EF\u4EE5\u5E2E\u4F60\uFF1F",homeSearchPlaceholder:"\u641C\u7D22\u5E2E\u52A9",homeAskPlaceholder:"\u63D0\u51FA\u95EE\u9898\u2026",homeWhatsNew:"\u6700\u65B0\u52A8\u6001",homeContentTitle:"\u70ED\u95E8\u6587\u7AE0",homeStatus:"\u72B6\u6001",helpTitle:"\u5E2E\u52A9",helpSearchPlaceholder:"\u641C\u7D22\u5E2E\u52A9",helpEmpty:"\u8FD8\u6CA1\u6709\u5E2E\u52A9\u6587\u7AE0",helpLoading:"\u6B63\u5728\u52A0\u8F7D\u5E2E\u52A9\u2026",helpSearchEmpty:"\u6CA1\u6709\u627E\u5230\u201C{query}\u201D\u7684\u7ED3\u679C",helpShowMore:"\u663E\u793A\u66F4\u591A",newsTitle:"\u52A8\u6001",newsEmpty:"\u8FD8\u6CA1\u6709\u52A8\u6001",newsLoading:"\u6B63\u5728\u52A0\u8F7D\u52A8\u6001\u2026",newsShowMore:"\u663E\u793A\u66F4\u591A",newsUnseen:"\u65B0\u6587\u7AE0",unread:"\u672A\u8BFB",formRequired:"\u6B64\u9879\u4E3A\u5FC5\u586B",formInvalidEmail:"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u90AE\u7BB1\u5730\u5740",formInvalidTel:"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u7535\u8BDD\u53F7\u7801",formInvalidNumber:"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u6570\u5B57",formOtherPlaceholder:"\u8F93\u5165\u4F60\u7684\u56DE\u7B54\u2026",inputRequired:"\u9700\u8981\u4F60\u56DE\u7B54\u7684\u95EE\u9898",askFallbackQuestion:"\u8BF7\u63D0\u4F9B\u7F3A\u5C11\u7684\u4FE1\u606F\u3002",inputBadge:"\u95EE\u9898",inputAnswered:"\u5DF2\u56DE\u7B54",inputSkipped:"\u5DF2\u8DF3\u8FC7",showOptions:"\u663E\u793A\u9009\u9879",hideOptions:"\u9690\u85CF\u9009\u9879",qtypeText:"\u4F60\u7684\u56DE\u7B54",qtypeEmail:"\u90AE\u7BB1\u5730\u5740",qtypePhone:"\u7535\u8BDD\u53F7\u7801",qtypeNumber:"\u6570\u5B57",qtypeDate:"\u65E5\u671F",qtypeChooseOne:"\u9009\u62E9\u4E00\u9879",qtypeChooseAny:"\u53EF\u591A\u9009",qtypeBoolean:"\u662F / \u5426",inputSubmit:"\u63D0\u4EA4\u56DE\u7B54",inputSubmitHint:"Enter \u53D1\u9001 \xB7 Shift+Enter \u6362\u884C",inputSkip:"\u8DF3\u8FC7",confirmYes:"\u662F",confirmNo:"\u5426",approve:"\u6279\u51C6",decline:"\u62D2\u7EDD",changeAnswer:"\u4FEE\u6539\u56DE\u7B54",approvalPrompt:"{action}\uFF1F",approvalEditHint:"\u5728\u6B64\u6B65\u9AA4\u7EE7\u7EED\u4E4B\u524D\uFF0C\u4F60\u53EF\u4EE5\u4FEE\u6539\u56DE\u7B54\u3002",stepInput:"\u8F93\u5165",stepWorking:"\u8FDB\u884C\u4E2D",stepWorkingOnIt:"\u6B63\u5728\u5904\u7406\u2026",stepNeedsYourApproval:"\u9700\u8981\u4F60\u7684\u6279\u51C6",stepWaitingForVisitor:"\u7B49\u5F85\u8BBF\u5BA2",stepApproved:"\u5DF2\u6279\u51C6",stepDeclined:"\u5DF2\u62D2\u7EDD",stepReplaced:"\u5DF2\u66FF\u6362",stepFailed:"\u5931\u8D25",stepDidNotWork:"\u672A\u6210\u529F",decidedYouApproved:"\u4F60\u5DF2\u6279\u51C6",decidedYouDeclined:"\u4F60\u5DF2\u62D2\u7EDD",decidedVisitorApproved:"\u8BBF\u5BA2\u5DF2\u6279\u51C6",decidedVisitorDeclined:"\u8BBF\u5BA2\u5DF2\u62D2\u7EDD",decidedTeamApproved:"\u56E2\u961F\u6210\u5458\u5DF2\u6279\u51C6",decidedTeamDeclined:"\u56E2\u961F\u6210\u5458\u5DF2\u62D2\u7EDD",decidedMemberApproved:"{name} \u5DF2\u6279\u51C6",decidedMemberDeclined:"{name} \u5DF2\u62D2\u7EDD",stepRawData:"\u539F\u59CB\u6570\u636E",decidedRulesApproved:"\u5DF2\u81EA\u52A8\u6279\u51C6",decidedRulesDeclined:"\u5DF2\u81EA\u52A8\u62D2\u7EDD",edit:"\u7F16\u8F91",toolStepsFailed:"{count} \u4E2A\u5931\u8D25",statusStopped:"\u5DF2\u505C\u6B62",toolStepsStopped:"\u5728 {count} \u6B65\u540E\u505C\u6B62",toolStepsStoppedOne:"\u5728 1 \u6B65\u540E\u505C\u6B62"},Tg={en:fi,fr:xg,es:wg,ar:Sg,he:kg,zh:Cg};function mi(e,t){let r=Hc(e),n=vi(t),o=Tg[Fc(r)],s=n?{...t[r],...t[e]}:t??{},a=n?t.en??{}:{};return{...fi,...o,...a,...s}}function Hc(e){return(e.split("-")[0]??"en").toLowerCase()}var Ig=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function gi(e){return Ig.has(Hc(e))}function mt(e,t){return e[t]??t}function vi(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}var q={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 Wc=["decided","auto-decided","unasked","failed"],hi=["platform","mcp","api","webmcp"],Rg=["none","values","table","json","table-and-json"];function Gc(e,t){return typeof t=="string"&&e.some(r=>r===t)}var Ag={visitor:{stepsFrom:hi,stepsShown:[],stepDetails:"values",showStepSystem:!1,showDecidedBy:!1,foldApprovals:!0},member:{stepsFrom:hi,stepsShown:Wc,stepDetails:"table-and-json",showStepSystem:!0,showDecidedBy:!0,foldApprovals:!0}},Eg=["showStepSystem","showDecidedBy","foldApprovals"];function Kc(e){let t={};if(typeof e!="object"||e===null)return t;for(let s of Eg){let a=Reflect.get(e,s);typeof a=="boolean"&&(t[s]=a)}let r=Reflect.get(e,"stepsFrom");Array.isArray(r)&&(t.stepsFrom=hi.filter(s=>r.includes(s)));let n=Reflect.get(e,"stepsShown");Array.isArray(n)&&(t.stepsShown=Wc.filter(s=>n.includes(s)));let o=Reflect.get(e,"stepDetails");return Gc(Rg,o)&&(t.stepDetails=o),t}function Qc(e,t){return{...Ag[t],...e}}var Yc=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Mg=4e3;function xs(e){let t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim().toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function Lg(e){if(e.title)return e.title;let t=e.toolName.replace(/^tool[:-]/,""),r=t.indexOf("__");return xs(r>0?t.slice(r+2):t)}function Ng(e,t,r){let n=e.approval;return n?.replacedByMessageId?"replaced":e.state==="output-available"?r.error===void 0?"done":"failed":e.state==="output-error"?t.interrupted?"stopped":"failed":e.state==="output-denied"||n?.approved===!1?"declined":e.state==="approval-responded"||n?.approved===!0?t.cutOff?"stopped":"approved":e.state==="approval-requested"?t.submitted?"submitted":t.cutOff?"stopped":t.superseded?"replaced":"waiting":t.live?"running":"stopped"}function Og(e,t){if(e.isAutomatic)return"rules";let r=e.respondedBy;return r?.visitorId?"visitor":r?.userId?r.userId===t.userId?"you":"teamMember":t.decides?"you":"visitor"}function $g(e,t,r,n,o){let s=n[t?"inputAnswered":"inputSkipped"];if(o)return{label:s,title:s};let a=n[t?"stepApproved":"stepDeclined"];if(e==="teamMember"&&r)return{label:a,title:n[t?"decidedMemberApproved":"decidedMemberDeclined"].replace("{name}",r)};let i=n[Dg[e][t?0:1]];return e==="you"?{label:a,title:i}:{label:i,title:i}}var Dg={you:["decidedYouApproved","decidedYouDeclined"],visitor:["decidedVisitorApproved","decidedVisitorDeclined"],teamMember:["decidedTeamApproved","decidedTeamDeclined"],rules:["decidedRulesApproved","decidedRulesDeclined"]};function qg(e,t){switch(e){case"running":return t.strings.stepWorking;case"waiting":return t.reader.decides?t.strings.stepNeedsYourApproval:t.strings.stepWaitingForVisitor;case"submitted":return t.strings.stepWorkingOnIt;case"approved":return t.strings.stepApproved;case"declined":return t.card?t.strings.inputSkipped:t.strings.stepDeclined;case"replaced":return t.card?t.strings.inputSkipped:t.strings.stepReplaced;case"stopped":return t.strings.statusStopped;case"failed":return t.plain?t.strings.stepDidNotWork:t.strings.stepFailed;case"done":return"";default:return e}}function Yt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Jc(e){return typeof e=="string"?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):""}function jc(e){return Jc(e)||(e!==null&&typeof e=="object"?JSON.stringify(e):"")}function Ug(e){if(!Yt(e))return jc(e);let[t,...r]=Object.values(e).map(jc).filter(Boolean);return t===void 0?"":r.length>0?`${t} (${r.join(", ")})`:t}function Vc(e,t){if(!Yt(e))return[];let r=[];function n(s,a){if(Array.isArray(s)){let c=s.map(Ug).filter(Boolean).join(", ");c&&r.push({path:a,value:c});return}if(Yt(s)){for(let[c,u]of Object.entries(s))n(u,[...a,c]);return}let i=Jc(s);i&&(t.withIds||!Yc.test(i))&&r.push({path:a,value:i})}n(e,[]);let o=r.map(({path:s})=>xs(s.at(-1)??""));return r.map(({path:s,value:a},i)=>{let c=o[i]??"";return{label:o.filter(p=>p===c).length>1&&s.length>1?`${xs(s.at(-2)??"")} \xB7 ${c.toLowerCase()}`:c,value:a}})}function Bg(e,t){if(Yt(e))return Object.entries(e).find(r=>r[0]!==t&&typeof r[1]=="string"&&r[1].trim().length>0&&!Yc.test(r[1].trim()))?.[1].trim()}function zg(e){if(typeof e.toolMetadata?.system=="string")return e.toolMetadata.system;let t=e.toolMetadata?.systemField,r=typeof t=="string"&&Yt(e.input)?e.input[t]:void 0;return typeof r=="string"&&r.trim()?r.trim():void 0}function yi(e,t=Number.POSITIVE_INFINITY){if(e==null)return;let r=typeof e=="string"?e:JSON.stringify(e,null,2);if(!(!r||r==="{}"||r==="[]"||r==='""'))return r.length>t?`${r.slice(0,t)}\u2026`:r}function Fg(e){let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return e;try{return JSON.parse(t)}catch{return e}}function Xc(e){if(Yt(e)&&e.storage==="tool-result-ref"&&"summary"in e)return Xc(e.summary);if(Yt(e)&&Array.isArray(e.content)){let t=e.content.flatMap(n=>Yt(n)&&typeof n.text=="string"?[n.text]:[]).join(`
|
|
2
|
-
`),r=Yt(e.structuredContent)?e.structuredContent:Fg(t);return e.isError===!0?{value:r,error:Yt(r)&&typeof r.error=="string"?r.error:t}:{value:r}}return Yt(e)&&typeof e.error=="string"&&typeof e.instruction=="string"?{value:e,error:e.error}:{value:e}}function Hg(e){return yi(e.input)!==void 0||yi(e.output)!==void 0||!!e.errorText}function jg(e,t){let r=e.approval?"decided":"unasked",n=e.approval?.isAutomatic?"auto-decided":r;return t==="failed"?[n,"failed"]:[n]}function Vg(e){let t=e.toolMetadata?.origin;return Gc(hi,t)?t:void 0}function Wg(e,t,r){let{display:n}=r,o=e.approval,s=o!==void 0&&!o.isAutomatic;if(s&&Ss(e,r.turn))return"card";let a=r.by==="you"||s&&r.by===void 0&&r.reader.decides,i=Vg(e),c=(i===void 0||n.stepsFrom.includes(i))&&jg(e,t.status).some(u=>n.stepsShown.includes(u));return!(a||c)||!o&&!Hg(e)?"hidden":s&&!n.foldApprovals?"card":"step"}function Ss(e,t){return e.approval?.replacedByMessageId||(t.superseded||t.cutOff)&&e.approval?.approved===void 0?!1:e.state==="approval-requested"||e.state==="approval-responded"}function Zc(e,t){let{turn:r,reader:n,display:o,strings:s}=t,a=Xc(e.output),i=Ng(e,r,a),c=e.approval,u=c!==void 0&&!c.isAutomatic,p=typeof e.toolMetadata?.card=="string"?e.toolMetadata.card:void 0,_=o.stepDetails,d=_==="table"||_==="table-and-json",f=_==="none"||_==="values",v=c?.replacedByMessageId?void 0:c?.approved,g=c&&v!==void 0?Og(c,n):void 0,x=g==="teamMember"?c?.respondedBy?.userId:void 0,k=g&&v!==void 0&&(g==="you"||g==="rules"||o.showDecidedBy)?{approved:v,by:g,...$g(g,v,x&&t.names?.get(x),s,p!==void 0),...x?{userId:x}:{}}:void 0,y=Lg(e),S=o.showStepSystem||e.toolMetadata?.nameShared===!0?zg(e):void 0,b=Bg(e.input,typeof e.toolMetadata?.systemField=="string"?e.toolMetadata.systemField:void 0),w=e.errorText??a.error,h=d&&a.error===void 0?Vc(a.value,{withIds:!0}):[],m=_==="json"||_==="table-and-json"?{input:yi(e.input),output:yi(a.value,Mg)}:void 0,P=u&&Ss(e,r),R=_==="none"&&!P?[]:Vc(e.input,{withIds:d||P}),I=w!==void 0&&w!==""&&!f,A=Yt(c?.descriptor)&&Yt(c.descriptor.decision)?c.descriptor.decision:void 0,C=_!=="none"||P?A:void 0,M=k!==void 0&&(i==="approved"||i==="declined"),N={toolCallId:e.toolCallId,placement:"hidden",...p&&c?{card:p}:{},name:y,...S?{system:S}:{},status:i,statusLabel:M?"":qg(i,{reader:n,strings:s,card:p!==void 0,plain:f}),...k?{decision:k}:{},...C?{why:C}:{},...b?{summary:b}:{},fields:R,tables:d,...h.length>0?{resultFields:h}:{},...I?{error:w}:{},...m?{raw:m}:{},opens:R.length>0||h.length>0||m!==void 0||I||C!==void 0,...u&&!p?{approval:Gg(e,i,{turn:r,reader:n,strings:s,name:y})}:{}};return{...N,placement:Wg(e,N,{turn:r,reader:n,display:o,by:g})}}function Gg(e,t,r){let n=r.strings.approvalPrompt.replace("{action}",r.name);return t==="waiting"?{ask:n,buttons:r.reader.decides?"decide":"none"}:t==="submitted"?{ask:n,buttons:"none"}:Ss(e,r.turn)?r.turn.canAct&&r.reader.decides?{ask:n,buttons:"change",note:r.strings.approvalEditHint}:t==="approved"?{ask:n,buttons:"none",note:r.strings.stepWorkingOnIt}:{ask:n,buttons:"none"}:{ask:n,buttons:"none"}}function ed(e){let t=new Map;for(let s of e)t.set(s.name,(t.get(s.name)??0)+1);let r=new Map;for(let{decision:s}of e){if(!s)continue;let a=r.get(s.title)??{approved:s.approved,label:s.label,title:s.title,...s.userId?{userId:s.userId}:{},count:0};r.set(s.title,{...a,count:a.count+1})}let[n]=e,o=e.some(s=>s.status==="stopped");return{tools:[...t].map(([s,a])=>({name:s,count:a})),...e.length===1&&n?{single:{name:n.name,...n.system?{system:n.system}:{},...n.summary?{summary:n.summary}:{},...Kg(n)}}:{},marks:[...r.values()].map(({count:s,...a})=>Object.assign(a,{label:s>1?`${a.label} \xD7${s}`:a.label})),failed:e.filter(s=>s.status==="failed").length,...o?{stopped:{finished:e.filter(s=>s.status!=="stopped").length}}:{}}}function Kg(e){return!e.decision&&(e.status==="replaced"||e.status==="declined")?{outcome:e.statusLabel}:{}}function td(e,t){return e===0?t.statusStopped:e===1?t.toolStepsStoppedOne:t.toolStepsStopped.replace("{count}",String(e))}var ws=class{get(t){try{return localStorage.getItem(t)}catch{return null}}set(t,r){try{localStorage.setItem(t,r)}catch{}}remove(t){try{localStorage.removeItem(t)}catch{}}},bi=new ws,Qr={get(e){try{return sessionStorage.getItem(e)}catch{return null}},set(e,t){try{sessionStorage.setItem(e,t)}catch{}},remove(e){try{sessionStorage.removeItem(e)}catch{}}};var Pi={maxBytes:10485760,maxCount:10,accept:"*/*"},rd={voice:"local"},ks={enabled:!0,sampleRate:1},Cs={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio"},Sn={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},nd={floating:["theme","textSize","history","close","clear","expand","fullscreen","popOut","sound","language"],inline:["theme","textSize","history","close","clear","fullscreen","popOut","sound","language"],standalone:["theme","textSize","history","clear","sound","language"],page:["theme","textSize","history","clear","sound","language"],modal:["theme","textSize","history","close","clear","fullscreen","popOut","sound","language"],drawer:["theme","textSize","history","close","clear","fullscreen","popOut","sound","language"]},Ts={enabled:!0,volume:.3,events:void 0},od={enabled:!0,events:void 0},id=[{label:"tabConversations",layout:"chat"}];var Qg=["off","error","warn","info","debug","trace"],Is=q.cssPrefix,Yg=`${Is}.debug`,Jg=`__${q.global}_DEBUG__`,Xg=`${Is}-debug`,ld=2,ad=null;function Zg(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(Xg);if(e!==null){let t=sd(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(Yg);if(e){let t=sd(e);if(t>=0)return t}}catch{}return Reflect.get(window,Jg)?4:2}function sd(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=Qg.findIndex(r=>r===e);if(t>=0)return t}return-1}ld=Zg();function cd(e){let t=`[${Is}:${e}]`;function r(n,o,s){return(a,i)=>{if(!(ld<n)&&(i===void 0?console[o](t,a):console[o](t,a,i),ad))try{ad({level:s,scope:e,message:a,payload:i})}catch{}}}return{error:r(1,"error","error"),warn:r(2,"warn","warn"),info:r(3,"info","info"),debug:r(4,"debug","debug"),trace:r(5,"debug","trace"),scope:n=>cd(`${e}:${n}`)}}var ie=cd("core");var Yr=ie.scope("context"),ev=new Set(["visitorId","conversationId","jwt","token","authorization","password"]),dd=50,Rs=1024,tv=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function As(e){return ud(e,"userContext",!0)}function Es(e){return ud(e,"pageContext",!1)}function rv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ud(e,t,r){if(e==null)return;if(!rv(e)){Yr.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let n={},o=0;for(let[s,a]of Object.entries(e)){if(ev.has(s)){Yr.warn(`dropped reserved ${t} key "${s}" \u2014 managed by the widget, not host-settable`);continue}if(a==null)continue;if(o>=dd){Yr.warn(`${t} truncated at ${dd} keys \u2014 dropped "${s}"`);continue}let i=nv(t,s,a);i!==void 0&&(n[s]=i,o++)}return r&&typeof n.email=="string"&&!tv.test(n.email)&&(Yr.warn("dropped malformed context field",{field:`${t}.email`,reason:"invalid format"}),delete n.email),Object.keys(n).length>0?n:void 0}function nv(e,t,r){if(typeof r=="boolean")return r;if(typeof r=="number"){if(!Number.isFinite(r)){Yr.warn(`dropped non-finite ${e}.${t}`);return}return r}if(typeof r=="string"){let n=r.trim();return n===""?void 0:n.length>Rs?(Yr.warn(`truncated ${e}.${t} to ${Rs} chars`),n.slice(0,Rs)):n}Yr.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof r})}function wn(e){let t=e!==null&&typeof e=="object"?e:{},r=t.presentation??{},n=t.behavior??{},o=t.i18n??{},s=t.feedback??{},a=t.footer??{},i=t.header??{},c={enabled:t.history?.enabled??!0},{themeMode:u,themeOverrides:p}=ov(t.theme),_=r.mode??"floating",d=iv(o.defaultLocale),f=o.availableLocales??[o.locale??d],v=kn(o.locale??d,f,d),g=(t.baseUrl??q.defaultBaseUrl).replace(/\/$/,""),x=(t.agentApiBaseUrl??`${g}/api/agent`).replace(/\/$/,""),k=(t.dataApiBaseUrl??`${g}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:g,agentApiBaseUrl:x,dataApiBaseUrl:k,userContext:As(t.userContext),pageContext:Es(t.pageContext),position:r.position??(gi(v)?"bottom-left":"bottom-right"),themeMode:u,textSize:"normal",themeOverrides:p,mode:_,responseMode:n.responseMode??"streaming",showReasoning:n.showReasoning??!1,stepDisplay:Qc(n.stepDisplay,"visitor"),showSources:n.showSources??!1,enableMessageFeedback:!(n.disableMessageFeedback??!1),autoSendSuggestions:n.autoSendSuggestions??!1,cardAnswerWaitSeconds:n.cardAnswerWaitSeconds??60,popOutUrl:n.popOutUrl,features:{voice:t.features?.voice??rd.voice,fileUpload:!(t.features?.disableFileUpload??!1),humanInLoop:!(t.features?.disableHumanInLoop??!1),emailTranscript:!(t.features?.disableEmailTranscript??!1),operatorRequest:t.features?.enableOperatorRequest===!0&&!(t.features.hideRequestOperatorButton??!1)},endpoints:{upload:t.endpoints?.upload??Cs.upload,transcribe:t.endpoints?.transcribe??Cs.transcribe},attachments:{accept:t.composer?.attachments?.accept??Pi.accept,maxBytes:t.composer?.attachments?.maxBytes??Pi.maxBytes,maxCount:t.composer?.attachments?.maxCount??Pi.maxCount},locale:v,defaultLocale:d,availableLocales:f,startMinimized:n.startMinimized??!0,actions:av(_,i.actions,c.enabled),size:{...r.size,resize:{...r.size?.resize,enabled:r.size?.resize?.enabled??!0}},launcher:_v(t.launcher,t.agent?.name),sound:sv(s.sound),haptics:lv(s.haptics),strings:mi(v,o.strings),stringsOverride:o.strings,composerDisclaimer:a.composerDisclaimer??"",header:{variant:i.variant??"plain",notice:i.notice,showNotice:!(i.hideNotice??!1)},poweredBy:dv(a.poweredBy),composer:uv(t.composer),modules:pv(t.modules,c.enabled),tracking:cv(t.tracking,k),history:c,storage:t.storage??bi,userToken:t.userToken,continueLink:t.continueLink,tools:t.tools,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function ov(e){if(typeof e=="string")return{themeMode:e,themeOverrides:{}};if(!e||typeof e!="object")return{themeMode:"host",themeOverrides:{}};let{mode:t,...r}=e;return{themeMode:t??"host",themeOverrides:r}}function iv(e){return e&&e!=="auto"?e:globalThis.navigator?.language||"en"}function kn(e,t,r){if(t.length<=1||t.includes(e))return e;let n=e.split("-")[0];return n&&t.includes(n)?n:t.includes(r)?r:t[0]??e}function av(e,t,r){let n=t??nd[e];return r?n:n.filter(o=>o!=="history")}function sv(e){return{enabled:e?.enabled??Ts.enabled,volume:e?.volume??Ts.volume,events:e?.events}}function lv(e){return{enabled:e?.enabled??od.enabled,events:e?.events}}function cv(e,t){let r=e?.sampleRate??ks.sampleRate;return{enabled:e?.enabled??ks.enabled,endpoint:e?.endpoint??`${t}/pai/elements-px.gif`,sampleRate:Math.min(1,Math.max(0,Number.isFinite(r)?r:1)),token:e?.token}}function dv(e){return e?.text===""&&!e.logoUrl?null:{href:q.siteUrl,...e}}function uv(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function pv(e,t){let r=(e??id).slice(0,4),n=r.some(i=>i?.label&&i.layout==="help"),o=new Set,s=[];for(let i of r){if(!i?.label||!i?.layout)continue;let c=i.contentCollectionIds?.filter(Boolean),u=i.id??c?.[0]??i.layout;for(;o.has(u);)u=`${u}-${s.length}`;o.add(u);let p={id:u,label:i.label,layout:i.layout};c?.length&&(p.contentCollectionIds=c),i.layout==="home"&&(p.brandName=i.brandName,p.greetingText=i.greetingText,p.showGreeting=!(i.hideGreeting??!1),p.showSearchBar=n&&!(i.hideSearchBar??!1),p.showRecentConversations=t&&!(i.hideRecentConversations??!1),i.userAvatars?.length&&(p.userAvatars=i.userAvatars),i.status&&(p.status=i.status),p.contentBlockTitle=i.contentBlockTitle),s.push(p)}let a=Object.fromEntries(s.map(i=>[i.id,i]));return{list:s,byId:a}}function _v(e,t){let r=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??Sn.variant,size:e?.size??Sn.size,label:e?.label??Sn.label,icon:e?.icon??Sn.icon,hidden:e?.hidden??Sn.hidden,...t&&{personaName:t},callout:r}}function to(e,t){return e==="host"?"host":t??e}function Ms(e,t,r,n){let o=kn(t,e.availableLocales,e.defaultLocale);if(o===e.locale&&r===e.themeMode&&n===e.textSize)return e;let s={...e};return o!==e.locale&&(s.locale=o,s.strings=mi(o,e.stringsOverride)),r!==e.themeMode&&(s.themeMode=r),n!==e.textSize&&(s.textSize=n),s}function xi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var fv=["agent","presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints","history"];function Ls(e,t){if(!t)return e;let r={...e};for(let s of fv){let a=t[s];if(a===void 0)continue;let i=e[s];if(s==="theme"){i===void 0?r[s]=a:typeof i=="string"&&typeof a=="object"&&a!==null&&(r[s]={...a,mode:i});continue}s!=="i18n"&&(r[s]=pd(xi(a)?a:{},xi(i)?i:void 0))}t.modules!==void 0&&e.modules===void 0&&(r.modules=t.modules),t.dataApiBaseUrl!==void 0&&e.dataApiBaseUrl===void 0&&(r.dataApiBaseUrl=t.dataApiBaseUrl);let n=e.i18n,o=t.i18n;if(n||o){let s=pd(xi(o)?o:{},xi(n)?n:void 0);o?.availableLocales!==void 0&&(s.availableLocales=o.availableLocales),o?.defaultLocale!==void 0&&(s.defaultLocale=o.defaultLocale);let a=n?.strings,i=o?.strings;(a||i)&&(s.strings=mv(i,a)),r.i18n=s}return r}function pd(e,t){if(!t)return e;let r={...e};for(let[n,o]of Object.entries(t))o!==void 0&&(r[n]=o);return r}function mv(e,t){if(!e)return t;if(!t)return e;let r=vi(e),n=vi(t);if(!r&&!n)return{...e,...t};let o={},s=r?e:{en:e},a=n?t:{en:t};for(let[i,c]of Object.entries(s))o[i]={...c};for(let[i,c]of Object.entries(a))o[i]={...o[i],...c};return o}var gv=["clear","expand","fullscreen","popOut","sound","history","language","theme","textSize","close"];function vv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ar(e){return e!=="false"}function hv(e){try{return Kc(JSON.parse(e))}catch{return}}function yv(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=0?t:void 0}function bv(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}var fd=[["public-key","publicKey"],["ai-agent-deployment-id","aiAgentDeploymentId"],["base-url","baseUrl"],["agent-api-base-url","agentApiBaseUrl"],["data-api-base-url","dataApiBaseUrl"],["continue-link","continueLink"],["theme","theme",e=>e]],md=[["mode","mode",e=>e],["position","position",e=>e]],gd=[["width","width"],["height","height"]],vd=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",Ar],["show-reasoning","showReasoning",Ar],["step-display","stepDisplay",hv],["show-sources","showSources",Ar],["disable-message-feedback","disableMessageFeedback",Ar],["auto-send-suggestions","autoSendSuggestions",Ar],["card-answer-wait-seconds","cardAnswerWaitSeconds",yv],["pop-out-url","popOutUrl"]],hd=[["locale","locale"]],Pv=new Set(gv);function xv(e){return bv(e).filter(t=>Pv.has(t))}var yd=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",Ar]],bd=[["features-disable-file-upload","disableFileUpload",Ar],["features-disable-email-transcript","disableEmailTranscript",Ar],["features-voice","voice",e=>e]],Pd=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],xd=[["user-id","id"],["user-email","email"],["user-name","name"]],Sd=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],Sv=["launcher-label","callout-text","callout-delay","actions","user-context","page-context"],wv=[fd,md,gd,vd,hd,yd,bd,Pd,xd,Sd],kv=new Set(["start-minimized"]),Ns=[...wv.flatMap(e=>e.map(([t])=>t).filter(t=>!kv.has(t))),...Sv];function Os(e){let t={};function r(f){let v=e(f);return v===null||v===""?void 0:v}for(let[f,v,g]of fd){let x=r(f);x!==void 0&&Reflect.set(t,v,g?g(x):x)}let n=Jr(r,md),o=Jr(r,gd);(n||o)&&(t.presentation={...n,...o?{size:o}:{}});let s=Jr(r,vd);s&&(t.behavior=s);let a=Jr(r,hd);a&&(t.i18n=a);let i=Cv(e,r);i&&(t.launcher=i);let c=Jr(r,bd);c&&(t.features=c);let u=Jr(r,Pd);u&&(t.endpoints=u);let p=_d(r,xd,"user-context");p&&(t.userContext=p);let _=_d(r,Sd,"page-context");_&&(t.pageContext=_);let d=r("actions");return d!==void 0&&(t.header={actions:xv(d)}),t}function Jr(e,t){let r={};for(let[n,o,s]of t){let a=e(n);a!==void 0&&Reflect.set(r,o,s?s(a):a)}return Object.keys(r).length>0?r:null}function _d(e,t,r){let n={};for(let[i,c]of t){let u=e(i);u!==void 0&&(n[c]=u)}let o={},s=e(r);if(s)try{let i=JSON.parse(s);if(vv(i))for(let[c,u]of Object.entries(i))(typeof u=="string"||typeof u=="number"||typeof u=="boolean")&&(o[c]=u)}catch{}let a={...o,...n};return Object.keys(a).length>0?a:null}function Cv(e,t){let r=Jr(t,yd)??{},n=e("launcher-label");n!==null&&(r.label=n);let o=t("callout-text");if(o){let s=Number.parseInt(t("callout-delay")??"",10);r.callout={text:o,...Number.isFinite(s)?{delayMs:s}:{}}}return Object.keys(r).length>0?r:null}var wd=ie.scope("track"),Tv=64,Iv=256,Rv=10;function kd(e,t){let r=typeof e=="string"?e.trim():"";if(!r||r.length>Tv){wd.warn("track: ignored an event without a name of 1\u201364 characters",{name:e});return}let n=Object.fromEntries(Object.entries(typeof t=="object"&&t!==null?t:{}).filter(o=>typeof o[1]=="string"||typeof o[1]=="boolean"||Number.isFinite(o[1])));return JSON.stringify(n).length>Iv?(wd.warn("track: sent the event without its data, which is over 256 characters",{name:r}),{name:r}):Object.keys(n).length>0?{name:r,data:n}:{name:r}}function Cd(e){let t=[];return e.on("hostEvent",r=>{t.push({...r,at:Date.now()}),t.length>Rv&&t.shift()}),t}function Wt(){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,Av(t.subarray(6)),t[6]=(t[6]??0)&15|112,t[8]=(t[8]??0)&63|128;let r=Array.from(t,n=>n.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function Av(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 Er=ie.scope("persistence");function Cn(e,t=bi,r){let n=r?`${e}.${r}`:e,o=`${q.cssPrefix}.${n}.storageVersion`,s=t.get(o)??void 0,a=s?`.v${s}`:"",i=`${q.cssPrefix}.${n}${a}`,c=`${q.cssPrefix}${a}.visitorId`,u=`${q.cssPrefix}${a}.lastUserSub`,p=`${i}.conversationId`,_=`${i}.userPrefs`,d=`${i}.panelOpen`,f=`${i}.panelSize`,v=`${i}.calloutDismissed`,g=`${i}.sidebarCollapsed`,x=`${i}.activeModule`,k=`${i}.seenNewsId`,y=`${i}.historyCount`,S=`${i}.loginReturn`,b=`${i}.loginPromptDismissedIn`,w={getVisitorId(){let h=t.get(c);if(h)return h;let m=Wt();return t.set(c,m),m},loadLastUserSub(){return t.get(u)??void 0},saveLastUserSub(h){t.set(u,h)},loadConversationId(){return t.get(p)??void 0},saveConversationId(h){Er.trace("saveConversationId",{id:h,scope:n}),h?t.set(p,h):t.remove(p)},loadDraft(h){return t.get(`${i}.draft.${h}`)??""},saveDraft(h,m){let P=`${i}.draft.${h}`;m?t.set(P,m):t.remove(P)},loadMessageQueue(h){let m=t.get(`${i}.messageQueue.${h}`);if(!m)return[];try{let P=JSON.parse(m);return!Array.isArray(P)||!P.every(Ev)?[]:P}catch(P){return Er.warn("loadMessageQueue parse failed",{error:P}),[]}},saveMessageQueue(h,m){let P=`${i}.messageQueue.${h}`;if(m.length===0){t.remove(P);return}try{t.set(P,JSON.stringify(m))}catch(R){Er.warn("saveMessageQueue serialise failed",{error:R})}},loadUserPrefs(){let h=t.get(_);if(!h)return{};try{return $s(JSON.parse(h))}catch(m){return Er.warn("loadUserPrefs parse failed",{error:m}),{}}},saveUserPrefs(h){try{t.set(_,JSON.stringify(h))}catch(m){Er.warn("saveUserPrefs serialise failed",{error:m})}},patchUserPrefs(h){let m=w.loadUserPrefs();w.saveUserPrefs({...m,...h})},loadPanelOpen(){let h=t.get(d);return h==="1"?!0:h==="0"?!1:null},savePanelOpen(h){t.set(d,h?"1":"0")},loadPanelSize(){let h=t.get(f);return h==="normal"||h==="expanded"||h==="fullscreen"?h:null},savePanelSize(h){t.set(f,h)},loadCalloutDismissed(h){if(!h)return!1;let m=t.get(v);return!!m&&m===h},saveCalloutDismissed(h){h?t.set(v,h):t.remove(v)},loadSidebarCollapsed(){let h=t.get(g);return h==="1"?!0:h==="0"?!1:null},saveSidebarCollapsed(h){t.set(g,h?"1":"0")},loadActiveModule(){return t.get(x)||null},saveActiveModule(h){t.set(x,h)},loadSeenNewsId(){return t.get(k)||null},saveSeenNewsId(h){t.set(k,h)},loadHistoryCount(){let h=t.get(y);if(!h)return null;let m=Number.parseInt(h,10);return Number.isFinite(m)&&m>=0?m:null},saveHistoryCount(h){t.set(y,String(h))},rememberStorageVersion(h){h&&h!==t.get(o)&&(Er.debug("rememberStorageVersion (force-reset on next load)",{version:h}),t.set(o,h))},saveLoginReturn(h){Qr.set(S,JSON.stringify(h))},takeLoginReturn(){let h=Qr.get(S);if(h){Qr.remove(S);try{let m=JSON.parse(h);return Si(m)&&typeof m.conversationId=="string"&&m.conversationId&&typeof m.draft=="string"?{conversationId:m.conversationId,draft:m.draft}:void 0}catch(m){Er.warn("takeLoginReturn parse failed",{error:m});return}}},loadLoginPromptDismissedIn(){return Qr.get(b)??void 0},dismissLoginPromptIn(h){Qr.set(b,h)},clearConversation(){t.remove(p)},reset(){let h=t.get(p);h&&(t.remove(`${i}.draft.${h}`),t.remove(`${i}.messageQueue.${h}`));for(let m of[S,b])Qr.remove(m);for(let m of[c,u,p,_,f,v,g,x,k,y])t.remove(m);Er.info("reset: forgot the visitor",{scope:n})}};return w}function Si(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ev(e){return Si(e)&&typeof e.id=="string"&&e.id.length>0&&typeof e.text=="string"}function $s(e){if(!Si(e))return{};let t={};return typeof e.locale=="string"&&(t.locale=e.locale),typeof e.soundMuted=="boolean"&&(t.soundMuted=e.soundMuted),(e.themeMode==="auto"||e.themeMode==="light"||e.themeMode==="dark")&&(t.themeMode=e.themeMode),(e.textSize==="small"||e.textSize==="normal"||e.textSize==="large")&&(t.textSize=e.textSize),Si(e.widgetSize)&&typeof e.widgetSize.width=="number"&&typeof e.widgetSize.height=="number"&&(t.widgetSize={width:e.widgetSize.width,height:e.widgetSize.height}),t}var wi="6.12.0";var Mv="1",Td=60,Lv=2e3,Ds={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:()=>{},toolResult:()=>{},toolDecision:e=>({approved:e.approved}),hostEvent:e=>({name:e.name,data:e.data&&JSON.stringify(e.data)}),messageFeedback:e=>({value:e.value??"none"}),contentView:e=>({section:e.section,count:e.count}),contentOpen:e=>({contentId:e.contentId,contentCollectionId:e.contentCollectionId}),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 Nv(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function Ov(){return location.origin+location.pathname}function $v(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function Id(e,t){let r=Math.random(),n=0,o=0,s=new Set;function a(_,d){let{tracking:f,publicKey:v,aiAgentDeploymentId:g,mode:x,themeMode:k}=t.getOptions();if(!f.enabled||Nv()||r>=f.sampleRate)return;let y=performance.now();if(y-n>6e4&&(n=y,o=0),++o>Td)return;let S=new URLSearchParams;S.set("v",Mv),S.set("_ev",wi),S.set("e",_),f.token&&S.set("tk",f.token),v&&S.set("pk",v),g&&S.set("dep",g),S.set("vid",t.getVisitorId());let b=t.getConversationId();b&&S.set("cid",b),S.set("url",Ov());let w=$v();w&&S.set("ref",w),S.set("sw",String(screen.width)),S.set("sh",String(screen.height)),S.set("vw",String(innerWidth)),S.set("vh",String(innerHeight)),S.set("dpr",String(devicePixelRatio)),S.set("lang",navigator.language);try{S.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(S.set("m",x),S.set("th",k),d)for(let[R,I]of Object.entries(d))I!==void 0&&S.set(R,String(I));S.set("ts",String(Date.now()));let h=`${f.endpoint}?${S}`;if(h.length>Lv)return;let m=new Image(1,1);s.add(m);function P(){return s.delete(m)}m.addEventListener("load",P,{once:!0}),m.addEventListener("error",P,{once:!0}),m.src=h}let i=[];function c(_,d){if(i&&_!=="handshake"){i.length<Td&&i.push([_,d]);return}let f=i??[];i=void 0;for(let[v,g]of f)a(v,g);a(_,d)}function u(_,d){return Ds[_]?.(d)}let p=Object.keys(Ds).filter(_=>Object.hasOwn(Ds,_)).map(_=>e.on(_,d=>c(_,u(_,d))));return()=>{for(let _ of p)_();s.clear()}}var Rd=`.__P__-generative-ui{display:grid;gap:var(--__P__-space-3);overflow-wrap:anywhere;white-space:pre-wrap}.__P__-generative-ui p{margin:0}.__P__-generative-ui-grid-container{container:__P__-generative-ui-grid / inline-size;min-width:0}.__P__-generative-ui-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}.__P__-generative-ui-cell{display:flex;flex-direction:column;align-self:start;min-width:0;gap:16px}.__P__-generative-ui-grid[data-equal-heights]>.__P__-generative-ui-cell{align-self:stretch}.__P__-generative-ui-grid[data-equal-heights]>.__P__-generative-ui-cell>:only-child{flex:1}@container __P__-generative-ui-grid (min-width: 496px){.__P__-generative-ui-grid:is([data-columns="2"],[data-columns="3"],[data-columns="4"]){grid-template-columns:repeat(2,minmax(0,1fr))}.__P__-generative-ui-grid:is([data-columns="2"],[data-columns="3"],[data-columns="4"])>.__P__-generative-ui-cell:is([data-span="2"],[data-span="3"],[data-span="4"]){grid-column:span 2}}@container __P__-generative-ui-grid (min-width: 752px){.__P__-generative-ui-grid:is([data-columns="3"],[data-columns="4"]){grid-template-columns:repeat(3,minmax(0,1fr))}.__P__-generative-ui-grid:is([data-columns="3"],[data-columns="4"])>.__P__-generative-ui-cell:is([data-span="3"],[data-span="4"]){grid-column:span 3}}@container __P__-generative-ui-grid (min-width: 1008px){.__P__-generative-ui-grid[data-columns="4"]{grid-template-columns:repeat(4,minmax(0,1fr))}.__P__-generative-ui-grid[data-columns="4"]>.__P__-generative-ui-cell[data-span="4"]{grid-column:span 4}}.__P__-generative-ui section{display:flex;flex-direction:column;gap:var(--__P__-space-2);padding:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);min-width:0}.__P__-generative-ui-metric{font-size:1.6em;font-weight:700}.__P__-generative-ui-table{overflow-x:auto}.__P__-generative-ui table{width:100%;border-collapse:collapse;white-space:normal}.__P__-generative-ui caption{text-align:start;font-weight:600;padding-bottom:var(--__P__-space-2)}.__P__-generative-ui th,.__P__-generative-ui td{text-align:start;padding:var(--__P__-space-2);border-bottom:1px solid var(--__P__-border)}.__P__-generative-ui-chart{display:block;width:100%;color:var(--__P__-accent)}.__P__-generative-ui-axis{stroke:var(--__P__-border)}.__P__-generative-ui-data{display:flex;flex-wrap:wrap;gap:var(--__P__-space-2);font-size:.85em}.__P__-generative-ui-carousel{display:flex;gap:var(--__P__-space-3);margin:0 calc(var(--__P__-space-1) * -1);padding:0 var(--__P__-space-1) var(--__P__-space-2);overflow-x:auto;scroll-snap-type:x mandatory;scroll-padding-inline:var(--__P__-space-1);scrollbar-width:thin;min-width:0}.__P__-generative-ui-carousel>[role=listitem]{display:flex;flex:0 0 min(250px,80%);scroll-snap-align:start;min-width:0}.__P__-generative-ui-carousel>[role=listitem]>section{flex:1}.__P__-generative-ui-product{overflow:hidden}.__P__-generative-ui>.__P__-generative-ui-product{max-width:320px}.__P__-generative-ui-footer{display:flex;flex-direction:column;gap:var(--__P__-space-1);margin-top:auto}.__P__-generative-ui-hint{min-height:1.4em;line-height:1.4;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs)}.__P__-generative-ui-photo{display:block;flex:none;width:calc(100% + 2 * var(--__P__-space-3));aspect-ratio:4 / 3;margin:calc(var(--__P__-space-3) * -1) calc(var(--__P__-space-3) * -1) var(--__P__-space-1);overflow:hidden;background:var(--__P__-hover)}.__P__-generative-ui-thumb{display:block;flex:0 0 auto;width:48px;height:48px;overflow:hidden;border-radius:var(--__P__-radius-sm);background:var(--__P__-hover)}.__P__-generative-ui-photo img,.__P__-generative-ui-thumb img{display:block;width:100%;max-width:none;height:100%;object-fit:cover}.__P__-generative-ui-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--__P__-space-2)}.__P__-generative-ui-product>.__P__-generative-ui-heading{justify-content:flex-start}.__P__-generative-ui-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.__P__-generative-ui a{color:inherit}.__P__-generative-ui .__P__-generative-ui-title a,.__P__-generative-ui .__P__-generative-ui-lines a,.__P__-generative-ui .__P__-generative-ui-actions>a{text-decoration:none}.__P__-generative-ui .__P__-generative-ui-title a:hover,.__P__-generative-ui .__P__-generative-ui-lines span>a:hover{text-decoration:underline}.__P__-generative-ui-pill{display:inline-flex;align-items:center;padding:2px var(--__P__-space-2);border-radius:var(--__P__-radius-sm);background:var(--__P__-hover);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-generative-ui-muted{color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs)}.__P__-generative-ui-star{color:var(--__P__-warning)}.__P__-generative-ui-price{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 var(--__P__-space-2);font-variant-numeric:tabular-nums}.__P__-generative-ui-price strong{font-size:1.1em}.__P__-generative-ui-price s{color:var(--__P__-fg-muted)}.__P__-generative-ui-description{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;color:var(--__P__-fg-muted)}.__P__-generative-ui-option{display:grid;gap:var(--__P__-space-1);min-width:0;margin:0;padding:0;border:0}.__P__-generative-ui-option legend{padding:0 0 var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-generative-ui-option div{display:flex;gap:6px;min-width:0;margin:-4px;padding:4px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}.__P__-generative-ui-option div::-webkit-scrollbar{display:none}.__P__-generative-ui-option div[data-cut-end]{mask-image:linear-gradient(to right,#000 calc(100% - 32px),transparent)}.__P__-generative-ui-option div[data-cut-start]{mask-image:linear-gradient(to right,transparent,#000 32px)}.__P__-generative-ui-option div[data-cut-start][data-cut-end]{mask-image:linear-gradient(to right,transparent,#000 32px,#000 calc(100% - 32px),transparent)}.__P__-generative-ui-option div:dir(rtl)[data-cut-end]{mask-image:linear-gradient(to left,#000 calc(100% - 32px),transparent)}.__P__-generative-ui-option div:dir(rtl)[data-cut-start]{mask-image:linear-gradient(to left,transparent,#000 32px)}.__P__-generative-ui-option div:dir(rtl)[data-cut-start][data-cut-end]{mask-image:linear-gradient(to left,transparent,#000 32px,#000 calc(100% - 32px),transparent)}.__P__-generative-ui-option button{flex:0 0 auto;min-height:32px;padding:0 10px;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm);background:var(--__P__-bg-elevated);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);white-space:nowrap;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-generative-ui-option button:hover{border-color:var(--__P__-border-strong)}.__P__-generative-ui-option button[aria-pressed=true]{border-color:var(--__P__-accent);box-shadow:inset 0 0 0 1px var(--__P__-accent);font-weight:600}.__P__-generative-ui-option button:disabled{color:var(--__P__-fg-muted);text-decoration:line-through;opacity:.6;cursor:not-allowed}.__P__-generative-ui-actions{display:flex;flex-wrap:wrap;gap:var(--__P__-space-2);margin-top:auto;padding-top:var(--__P__-space-1)}.__P__-generative-ui-actions:not([data-small=true])>*{flex:1 1 auto}.__P__-generative-ui-actions>*{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:0 var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm);background:var(--__P__-bg-elevated);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;text-decoration:none;white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-generative-ui-actions[data-small=true]>*{min-height:28px;padding:0 var(--__P__-space-2);font-size:var(--__P__-text-xs)}.__P__-generative-ui-actions>:hover{border-color:var(--__P__-border-strong)}.__P__-generative-ui-actions>[data-primary=true]{border-color:var(--__P__-accent);background:var(--__P__-accent);color:var(--__P__-on-accent)}.__P__-generative-ui-actions>:focus-visible,.__P__-generative-ui-option button:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-generative-ui-actions>:disabled{border-color:var(--__P__-border);background:var(--__P__-hover);color:var(--__P__-fg-muted);cursor:not-allowed}.__P__-generative-ui .__P__-generative-ui-lines{display:grid;margin:0;padding:0;list-style:none}.__P__-generative-ui .__P__-generative-ui-lines li{display:flex;margin:0;gap:var(--__P__-space-3);padding:var(--__P__-space-2) 0;border-bottom:1px solid var(--__P__-border)}.__P__-generative-ui .__P__-generative-ui-lines li:first-child{padding-top:0}.__P__-generative-ui-lines li>div{display:grid;flex:1;gap:2px;min-width:0}.__P__-generative-ui-line-head{display:flex;align-items:baseline;gap:var(--__P__-space-3)}.__P__-generative-ui-line-head>span{display:-webkit-box;flex:1;min-width:0;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.__P__-generative-ui-line-head>strong{flex:none;font-variant-numeric:tabular-nums}.__P__-generative-ui-totals{display:grid;gap:var(--__P__-space-1);margin:0;font-variant-numeric:tabular-nums}.__P__-generative-ui-totals div{display:flex;justify-content:space-between;gap:var(--__P__-space-3);color:var(--__P__-fg-muted)}.__P__-generative-ui-totals div:last-child{padding-top:var(--__P__-space-1);color:var(--__P__-fg);font-weight:700}.__P__-generative-ui-totals dd{margin:0}.__P__-generative-ui-notice{padding:var(--__P__-space-2) var(--__P__-space-3);border-radius:var(--__P__-radius-sm);background:var(--__P__-hover)}.__P__-generative-ui-notice[data-severity=warning]{color:var(--__P__-fg);background:color-mix(in oklch,var(--__P__-warning) 16%,transparent)}.__P__-generative-ui-notice[data-severity=error]{color:var(--__P__-danger-text);background:var(--__P__-danger-bg)}.__P__-generative-ui .__P__-generative-ui-timeline{display:grid;gap:var(--__P__-space-2);margin:0;padding:0;list-style:none}.__P__-generative-ui .__P__-generative-ui-timeline li{display:flex;margin:0;align-items:baseline;gap:var(--__P__-space-2);color:var(--__P__-fg-muted)}.__P__-generative-ui-timeline li:before{content:"";flex:0 0 auto;width:8px;height:8px;border:2px solid var(--__P__-border-strong);border-radius:50%}.__P__-generative-ui-timeline li[data-done=true]{color:var(--__P__-fg);font-weight:600}.__P__-generative-ui-timeline li[data-done=true]:before{border-color:var(--__P__-accent);background:var(--__P__-accent)}.__P__-generative-ui-timeline li>:first-child{flex:1}
|
|
1
|
+
var gg=Object.defineProperty;var hg=(e,t,n)=>t in e?gg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Z=(e,t,n)=>hg(e,typeof t!="symbol"?t+"":t,n);var he,Mc,os,pn,ns,ti,Lc,Zo,Oc,is,rs,vg,jr=Symbol.for("pv"),ni={},ri=[],bg=/^m(i|n|o|s|text|space)$/,oi=Array.isArray,as=ri.slice,Nn=Object.assign;function On(e){e&&e.parentNode&&e.remove()}function fn(e,t,n){var r,o,i,s={},l=arguments.length;for(i in t)i=="key"?r=t[i]:i=="ref"&&typeof e!="function"?o=t[i]:s[i]=t[i];return l>2&&(s.children=l>3?as.call(arguments,2):n),Hr(e,s,r,o,null)}function Hr(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:jr,__v:o||++Mc,__i:-1,__u:0};return!o&&he.vnode&&he.vnode(i),i}function pe(e){return e.children}function Ut(e,t){this.props=e,this.context=t,this.__g=0}function _n(e,t){if(t==null)return e.__&&_n(e.__,e.__i+1);for(var n;t<e.__k.length;t++)if((n=e.__k[t])&&n.__e)return n.__e;return typeof e.type!="function"||e.props.__P?null:_n(e)}function yg(e){var t,n=e.__v,r=n.__e,o=[],i=[],s=e.__P;s&&((t=Nn({constructor:jr},n)).__v=n.__v+1,he.vnode&&he.vnode(t),ls(s,t,n,e.__n,s.namespaceURI,32&n.__u?[r]:null,o,r||_n(n),32&n.__u,i),t.__v=n.__v,t.__.__k[t.__i]=t,zc(o,t,i),n.__=n.__e=null,t.__e!=r&&Nc(t))}function Nc(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),Nc(e)}function Ic(e){(8&e.__g||(e.__g|=8,pn.push(e),ti++))&&ns==he.debounceRendering||((ns=he.debounceRendering)||queueMicrotask)($c)}function $c(){try{for(var e,t=1;pn.length;)pn.length>t&&pn.sort(Lc),e=pn.shift(),t=pn.length,8&e.__g&&yg(e)}finally{(ti=pn.length)&&(ns||queueMicrotask)($c)}}function Dc(e,t,n,r,o,i,s,l,c,u,p){var _,d,f,v,m,b,w=r.__k||ri,y=t.length;for(c=Pg(n,t,w,c,y),_=0;_<y;_++)(f=n.__k[_])!=null&&(d=~f.__i&&w[f.__i]||ni,f.__i=_,b=ls(e,f,d,o,i,s,l,c,u,p),v=f.__e,(d.ref!=f.ref||8&d.__u)&&(d.ref&&cs(d.ref,null,f,d),f.ref&&p.push(f.ref,f.__c||v,f)),m=m||v,4&f.__u?(c=Bc(f,c,e,!d.__v),d.__e&&(d.__e=null)):typeof f.type=="function"&&b!==void 0?c=b:v&&(c=v.nextSibling),f.__u&=-21);return n.__e=m,c}function Pg(e,t,n,r,o){var i,s,l,c,u,p,_,d,f,v=n.length,m=v,b=0,w=0,y=e.__k=Array(o);for(i=0;i<o;i++)(s=t[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s!="object"||s.constructor===String?s=y[i]=Hr(null,s):oi(s)?s=y[i]=Hr(pe,{children:s}):s.constructor===jr&&s.__b?s=y[i]=Hr(s.type,s.props,s.key,s.ref,s.__v):y[i]=s,c=i+b,s.__=e,s.__b=e.__b+1,l=null,~(u=s.__i=xg(s,n,c,m))&&(m--,(l=n[u])&&(l.__u|=2)),l&&l.__v?(s.__u|=16,u==c-1?b--:u==c+1?b++:u!=c&&(u>c?b--:b++,w=1)):(~u||(o>v?b--:o<v&&b++),typeof s.type!="function"&&(s.__u|=4))):y[i]=null;if(w){for(p=[],_=[],i=0;i<o;i++)if((s=y[i])&&16&s.__u){for(b=0,d=p.length;b<d;)p[f=b+d>>1]<s.__i?b=f+1:d=f;p[b]=s.__i,_[i]=b+1}for(b=p.length;i--;)_[i]&&(_[i]==b?b--:y[i].__u|=4)}if(m)for(i=0;i<v;i++)!(l=n[i])||2&l.__u||(l.__e==r&&(r=_n(l)),ds(l,l));return r}function Bc(e,t,n,r){var o,i,s,l;if(typeof e.type=="function"){if(e.props.__P)return t;if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&(o[i].__=e,t=Bc(o[i],t,n,!1));return t}for(t&&!t.parentNode&&(t=_n(e))&&!t.parentNode&&(t=null),s=e.__e,l=t;l&&l.nodeType==8;)l=l.nextSibling;for(s!=l&&(!r&&n.moveBefore&&s.parentNode?n.moveBefore(s,t):n.insertBefore(s,t||null)),t=s;(t=t&&t.nextSibling)&&t.nodeType==8&&!t.data.startsWith("$s"););return t}function ss(e,t){return t=t||[],e!=null&&typeof e!="boolean"&&(oi(e)?e.some(function(n){ss(n,t)}):t.push(e)),t}function xg(e,t,n,r){var o,i=e.key,s=e.type,l=t[n],c=l&&!(2&l.__u);if(l===null&&i==null||c&&i==l.key&&s==l.type)return n;if(r>(c?1:0)){for(o=n-1;o>=0;o--)if((l=t[o])&&!(2&l.__u)&&i==l.key&&s==l.type)return o;for(o=n+1;o<t.length;o++)if((l=t[o])&&!(2&l.__u)&&i==l.key&&s==l.type)return o}return-1}function Ec(e,t,n){n==null&&(n=""),t[0]=="-"?e.setProperty(t,n):e[t]=n}function Xo(e,t,n,r,o){var i,s;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||Ec(e.style,t);if(n)for(t in n)r&&n[t]==r[t]||Ec(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")typeof n!="function"&&(n=null),typeof r!="function"&&(r=null),(e.__e||(e.__e={}))[t]=n,n&&r||(s=rs[t]||(rs[t]=Sg(t)),(e.__a||(e.__a={}))[t]=is,i=t!=(t=t.replace(Oc,"$1")),(t=t.slice(2))[0]<"a"&&(t=t.toLowerCase()),n?e.addEventListener(t,s,i):e.removeEventListener(t,s,i));else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{return void(e[t]=n??"")}catch{}if(typeof n=="function")return;n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n)}}function Sg(e){return function(t){var n=this.__e;if(n){if(n=n[e],t[Zo]==null)t[Zo]=is++;else if(t[Zo]<this.__a[e])return;return n(he.event?he.event(t):t)}}}function ls(e,t,n,r,o,i,s,l,c,u){var p,_,d,f,v,m,b,w,y,P,C,x,g,h,k,$,I,B,A=t.type;if(t.constructor!==jr)return null;128&n.__u&&(c=32&n.__u,p=n.__c.__z)&&(t.__u|=c,_=i=[],p.nodeType==8?l=ei(p,i):i.push(p),l=i[0]||l),(p=he.__b)&&p(t);e:if(typeof A=="function"){d=s.length;try{if(w=t.props,y=(p=A.prototype)&&p.render,P=(p=A.contextType)&&r[p.__c],C=p?P?P.props.value:p.__:r,(f=n.__c)?(t.__c=f,2&f.__g&&(f.__g|=1)):(y?t.__c=f=new A(w,C):(t.__c=f=new Ut(w,C),f.constructor=A,f.render=kg),P&&P.sub(f),f.state||(f.state={}),f.__n=r,f.__g|=8,f.__h=[],f.__k=[]),y&&(f.__s||(f.__s=f.state),A.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=Nn({},f.__s)),Nn(f.__s,A.getDerivedStateFromProps(w,f.__s)))),v=f.props,m=f.state,f.__v=t,n.__c){if(w!==v&&y&&!A.getDerivedStateFromProps&&f.componentWillReceiveProps&&f.componentWillReceiveProps(w,C),t.__v==n.__v&&!(8&f.__g)||!(4&f.__g)&&f.shouldComponentUpdate&&f.shouldComponentUpdate(w,f.__s,C)===!1){t.__v!=n.__v&&(f.props=w,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(z){z&&(z.__=t)}),ri.push.apply(f.__h,f.__k),f.__k=[],f.__h.length&&s.push(f),l=_n(n);break e}f.componentWillUpdate&&f.componentWillUpdate(w,f.__s,C),y&&f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(v,m,b)})}else y&&!A.getDerivedStateFromProps&&f.componentWillMount&&f.componentWillMount(),y&&f.componentDidMount&&f.__h.push(f.componentDidMount);f.context=C,f.props=w,f.__P=e,f.__g&=-5,x=he.__r,g=y?25:0;do f.__g&=-9,x&&x(t),p=f.render(f.props,f.state=f.__s,f.context);while(8&f.__g&&++g<25);y&&(ri.push.apply(f.__h,f.__k),f.__k=[]),f.state=f.__s,f.getChildContext&&(r=Nn({},r,f.getChildContext())),y&&n.__c&&f.getSnapshotBeforeUpdate&&(b=f.getSnapshotBeforeUpdate(v,m)),h=p&&p.type===pe&&p.key==null?p.props.children:p,w.__P&&(p=l,o=(e=w.__P).namespaceURI,c=i=null,n.props&&n.props.__P!=e&&(n.__k.some(function(z){z&&ds(z,z)}),n.__k=null),l=n.__k?_n(n,0):null),l=Dc(e,oi(h)?h:[h],t,n,r,o,i,s,l,c,u),w.__P&&(t.__e=null,l=p),t.__u&=-161,_&&_.some(On),f.__h.length&&s.push(f),1&f.__g&&(f.__g&=-4)}catch(z){if(s.length=d,t.__v=null,c||i)if(z&&z.then){if(t.__u|=128|c,i){for(~(I=i.indexOf(l||void 0))||(I=i.length);(B=i[I-1])&&B.nodeType==8;)I--;for(;I<i.length;I++)if(B=i[I])if(i[I]=null,k){if(B==$)break}else{if(B.nodeType!=8)break;B.data.startsWith("$s")&&($=ei(k=B))}}if(!k){for(;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;k=l}(p=ei(k=t.__c.__z||(t.__c.__z=k)))?(t.__e=k,l=p):t.__e=l,l=l&&l.nextSibling}else i&&i.some(On);else t.__e=n.__e;t.__k||(t.__k=n.__k||[]),z&&z.then||Uc(t),he.__e(z,t,n)}}else l=t.__e=wg(n.__e,t,n,r,o,i,s,c,u,e);return(p=he.diffed)&&p(t),l}function ei(e,t){if(e&&e.nodeType==8&&e.data.startsWith("$s"))for(var n=1;e=e.nextSibling;){if(e.nodeType==8){if(e.data.startsWith("$s"))n++;else if(e.data.startsWith("/$s")&&!--n)return e}t&&t.push(e)}}function Uc(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(Uc))}function zc(e,t,n){for(var r=0;r<n.length;)cs(n[r++],n[r++],n[r++]);he.__c&&he.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){he.__e(i,o.__v)}})}function wg(e,t,n,r,o,i,s,l,c,u){var p,_,d,f,v,m,b,w,y=n.props||ni,P=t.props,C=t.type;if(C=="svg"?o="http://www.w3.org/2000/svg":C=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i){for(p=0;p<i.length;p++)if((v=i[p])&&(C?v.localName==C:v.nodeType==3)){e=v,i[p]=null;break}}if(!e){if(w=u.ownerDocument||document,!C)return w.createTextNode(P);e=w.createElementNS(o,C,P.is?P:u),l&&(he.__m&&he.__m(t,i),l=!1),i=null}if(C){if(u=C=="template"&&e.content||e,i=C=="textarea"&&P.defaultValue!=null?null:i&&as.call(u.childNodes),!l&&i)for(y={},p=0;p<e.attributes.length;p++)y[(v=e.attributes[p]).name]=v.value;for(p in y)v=y[p],p=="dangerouslySetInnerHTML"?d=v:p=="children"||p in P||p=="value"&&"defaultValue"in P||p=="checked"&&"defaultChecked"in P||Xo(e,p,null,v,o);for(p in P)v=P[p],p=="children"?f=v:p=="dangerouslySetInnerHTML"?_=v:p=="value"?m=v:p=="checked"?b=v:l&&typeof v!="function"||y[p]===v||Xo(e,p,v,y[p],o);_?(l||d&&(_.__html==d.__html||_.__html==e.innerHTML)||(e.innerHTML=_.__html),t.__k=[]):(d&&(e.textContent=""),(C=="foreignObject"||o=="http://www.w3.org/1998/Math/MathML"&&bg.test(C))&&(o="http://www.w3.org/1999/xhtml"),Dc(u,oi(f)?f:[f],t,n,r,o,i,s,i?i[0]:n.__k&&_n(n,0),l,c),i&&i.some(On)),l&&C!="textarea"||(p="value",C=="progress"&&m==null?e.removeAttribute(p):m==null||m===e[p]&&(C!="progress"||m)||Xo(e,p,m,y[p],o),p="checked",b!=null&&b!=e[p]&&Xo(e,p,b,y[p],o))}else y===P||l&&e.data==P||(e.data=P);return e}function cs(e,t,n,r){try{typeof e=="function"?t?t.__x=e(t)||1:r&&(r=r.__c||r.__e)&&(t=r.__x)&&(r.__x=null,typeof t=="function"?t():e(null)):e.current=t}catch(o){he.__e(o,n)}}function ds(e,t,n){var r,o,i,s;if(he.unmount&&he.unmount(e),!(r=e.ref)||r.current&&r.current!=e.__e||cs(r,null,t,e),r=e.__c){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(l){he.__e(l,t)}r.__P=r.__n=null}if(r=e.__k)for(s=0;s<r.length;s++)r[s]&&ds(r[s],t,typeof e.type!="function"||n&&!e.props.__P);!n&&(r=e.__c)&&(r=r.__z)&&(o=ei(r,i=[]))&&(r==e.__e&&i.some(On),On(o),On(r)),n||On(e.__e),e.__e=e.__c=e.__=null}function kg(e,t,n){return this.constructor(e,n)}function mn(e,t){var n,r,o,i;he.__&&he.__(e,t),t.nodeType==9&&(t=t.documentElement),r=(n=e&&32&e.__u)?null:t.__k,t.__k=Hr(pe,{children:[e]}),o=[],i=[],ls(t,t.__k,r||ni,ni,t.namespaceURI,r?null:t.firstChild?as.call(t.childNodes):null,o,r?r.__e:t.firstChild,n,i),zc(o,t.__k,i),t.__k.props.children=null}he={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!(1&o.__g)){o.__g|=4;try{if((s=(i=o.constructor)&&i.getDerivedStateFromError)&&o.setState(i.getDerivedStateFromError(e)),o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=1),s&&8&o.__g)return void(o.__g|=2)}catch(l){e=l}}throw ti=0,e}},Mc=0,os=function(e){return e!=null&&e.constructor===jr},Ut.prototype.setState=function(e,t){var n=this.__s;n&&n!=this.state||(n=this.__s=Nn({},this.state)),typeof e=="function"&&(e=e(Nn({},n),this.props)),e&&(Nn(n,e),this.__v&&(t&&this.__k.push(t),Ic(this)))},Ut.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),Ic(this))},Ut.prototype.render=pe,pn=[],ti=0,Lc=function(e,t){return e.__v.__b-t.__v.__b},Zo=Symbol(),Oc=/(PointerCapture)$|Capture$/i,is=0,rs={},vg=0;var Cg=["en","fr","es","ar","he","zh"];function Fc(e){let t=e?.split("-")[0]?.toLowerCase();return Cg.find(n=>n===t)??"en"}function ps(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function us(e){return ps(e)?e.id??e.key:void 0}function _s(e,t){return ps(e)&&ps(t)?Object.fromEntries([...new Set([...Object.keys(e),...Object.keys(t)])].map(n=>[n,_s(e[n],t[n])])):Array.isArray(e)&&Array.isArray(t)&&t.length>0&&t.every(n=>us(n)!==void 0)?e.map(n=>_s(n,t.find(r=>us(r)===us(n)))):t==null||typeof t=="string"&&!t.trim()?e:t}function $n(e,t){let n=t?.toLowerCase(),r=n?.split("-")[0],o=e.translations??[],i=o.find(c=>c.locale.toLowerCase()===n)??o.find(c=>c.locale.toLowerCase().split("-")[0]===r);if(!i)return e;let{locale:s,...l}=i;return _s(e,l)}var ii={attach:"Attach files",file:"File",attachmentMimeRejected:"{name} isn't a file type this chat accepts.",attachmentTooLarge:"{name} is too large. Files can be up to {max} together.",poweredBy:"Powered by {name}",attachmentTooMany:"The attachment limit is {count}.",attachmentUploadFailed:"{name} couldn't be uploaded.",conversationLoading:"Loading chat\u2026",loadPreviousMessages:"Load previous messages",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",dropZoneRejected:"These files can't be attached here",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRateLimitedIn:"Too many requests \u2014 please try again in {seconds} s.",errorOffline:"Can't reach the server. Check your connection and try again.",errorServer:"Something went wrong on our side. Please try again.",errorOriginNotAllowed:"This chat isn't set up for this website yet.",errorMessageTooLong:"That message is too long. Shorten it and send it again.",errorReconnecting:"Connection lost. Reconnecting\u2026",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous chats yet",historyLoading:"Loading your chats\u2026",historyContinue:"Continue the chat",historyTitle:"Chat history",loadMoreConversations:"Load more conversations",language:"Language",launcherOpen:"Open chat",launcherAsk:"Ask {name}",micBlocked:"The microphone is blocked for this site, so voice input can't start.",micStart:"Start voice input",micStop:"Stop voice input",moreActions:"More actions",newConversation:"New chat",panelTitle:"Chat",popOut:"Open in new tab",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",queueMessage:"Queue message",removeQueuedMessage:"Remove queued message",removeAttachment:"Remove {name}",suggestedReplies:"Suggested replies",compactingContext:"Optimizing conversation context\u2026",soundOff:"Sound off",soundOn:"Sound on",talkToOperator:"Talk to a person",connectingOperator:"Connecting you to a person\u2026",noOperatorAvailable:"No one's available right now \u2014 leave your details and we'll follow up.",chattingWithOperator:"You're chatting with {operator}",operatorBadgeTitle:"Live chat",chatNotice:"You're chatting with an AI assistant.",cancelOperatorRequest:"Keep chatting with the AI",loginPrompt:"Log in for faster, more personalized support",loginAction:"Log in",loginRequired:"Log in to chat with us",loginExpired:"Your login expired. Log in to continue this chat.",loginExpiredGuest:"Your login expired. Log in to continue this chat, or start a new conversation as a guest.",startAsGuest:"Start new conversation",loggedInAs:"Logged in as {name}",loggedIn:"Logged in",dismissLoginPrompt:"Hide",emailTranscript:"Email transcript",emailTranscriptPrompt:"Get a copy of this conversation by email.",emailTranscriptEmailLabel:"Email address",emailTranscriptSend:"Send transcript",emailTranscriptSending:"Sending\u2026",emailTranscriptSent:"Sent to {email}.",emailTranscriptAlreadySent:"This conversation was already emailed. Send a new message to email it again.",emailTranscriptLimited:"You've reached the limit for now. Try again later.",emailTranscriptFailed:"Couldn't send it. Try again.",emailTranscriptNotDelivered:"Couldn't send to this address. Check it and try again.",emailTranscriptCancel:"Cancel",emailTranscriptDone:"Done",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",visualPreparing:"Preparing visual\u2026",visualError:"This visual could not be displayed.",visualPartial:"Some parts of this visual could not be displayed.",visualSoldOut:"Sold out",visualCartEmpty:"Your cart is empty.",visualQuantity:"Qty",visualChoose:"Choose",visualDirect:"Direct",visualVia:"via",visualNight:"1 night",visualNights:"{count} nights",visualPerNight:"per night",visualTravellers:"Travellers",thinking:"Thinking\u2026",thought:"Thought",thoughtFor:"Thought for {time}",toolResult:"Result",sources:"Sources",feedbackUp:"Good response",feedbackDown:"Bad response",feedbackThanks:"Thanks for your feedback",copy:"Copy",copied:"Copied",copyTicketReference:"Ticket {reference}, copy",tabHome:"Home",tabConversations:"Chats",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",chatUnavailable:"This chat isn't available right now",moduleBack:"Back",contentLoading:"Loading\u2026",contentHelpful:"Was this helpful?",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeAskPlaceholder:"Ask a question\u2026",homeWhatsNew:"What's new",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results for \u201C{query}\u201D",helpShowMore:"Show more",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsShowMore:"Show more",newsUnseen:"New post",unread:"Unread",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidNumber:"Enter a valid number",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"Questions for you",askFallbackQuestion:"Please provide the missing information.",inputBadge:"Questions",inputAnswered:"Answered",inputSkipped:"Skipped",showOptions:"Show options",hideOptions:"Hide options",qtypeText:"Your answer",qtypeEmail:"Email address",qtypePhone:"Phone number",qtypeNumber:"Number",qtypeDate:"Date",qtypeChooseOne:"Pick one",qtypeChooseAny:"Pick any",qtypeBoolean:"Yes / No",inputSubmit:"Submit answers",inputSubmitHint:"Enter to send \xB7 Shift+Enter = new line",inputSkip:"Skip",confirmYes:"Yes",confirmNo:"No",approve:"Approve",decline:"Decline",changeAnswer:"Change answer",approvalPrompt:"{action}?",approvalEditHint:"You can change your answer until this step continues.",stepInput:"Input",stepWorking:"Working",stepWorkingOnIt:"Working on it\u2026",stepNeedsYourApproval:"Needs your approval",stepWaitingForVisitor:"Waiting for the visitor",stepApproved:"Approved",stepDeclined:"Declined",stepReplaced:"Replaced",stepFailed:"Failed",stepDidNotWork:"Didn't work",decidedYouApproved:"You approved",decidedYouDeclined:"You declined",decidedVisitorApproved:"Visitor approved",decidedVisitorDeclined:"Visitor declined",decidedTeamApproved:"Approved by a team member",decidedTeamDeclined:"Declined by a team member",decidedMemberApproved:"Approved by {name}",decidedMemberDeclined:"Declined by {name}",stepRawData:"Raw data",decidedRulesApproved:"Auto-approved",decidedRulesDeclined:"Auto-declined",edit:"Edit",toolStepsFailed:"{count} failed",statusStopped:"Stopped",toolStepsStopped:"Stopped after {count} steps",toolStepsStoppedOne:"Stopped after 1 step"},Tg={attach:"Joindre des fichiers",file:"Fichier",attachmentMimeRejected:"{name} n'est pas un type de fichier accept\xE9 ici.",attachmentTooLarge:"{name} est trop volumineux. Les fichiers peuvent faire jusqu'\xE0 {max} au total.",poweredBy:"Propuls\xE9 par {name}",attachmentTooMany:"Limite de pi\xE8ces jointes : {count}.",attachmentUploadFailed:"{name} n'a pas pu \xEAtre envoy\xE9.",conversationLoading:"Chargement du chat\u2026",loadPreviousMessages:"Charger les messages pr\xE9c\xE9dents",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",dropZoneRejected:"Ces fichiers ne peuvent pas \xEAtre joints ici",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRateLimitedIn:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans {seconds} s.",errorOffline:"Impossible de joindre le serveur. V\xE9rifiez votre connexion et r\xE9essayez.",errorServer:"Un probl\xE8me est survenu de notre c\xF4t\xE9. Veuillez r\xE9essayer.",errorOriginNotAllowed:"Ce chat n'est pas encore configur\xE9 pour ce site.",errorMessageTooLong:"Ce message est trop long. Raccourcissez-le et renvoyez-le.",errorReconnecting:"Connexion perdue. Reconnexion\u2026",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:"Aucun chat pour le moment",historyContinue:"Poursuivre le chat",historyLoading:"Chargement de vos chats\u2026",historyTitle:"Historique des chats",loadMoreConversations:"Charger plus de conversations",language:"Langue",launcherOpen:"Ouvrir le chat",launcherAsk:"Demander \xE0 {name}",micBlocked:"Le micro est bloqu\xE9 pour ce site : la saisie vocale ne peut pas d\xE9marrer.",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",moreActions:"Plus d'actions",newConversation:"Nouveau chat",panelTitle:"Chat",popOut:"Ouvrir dans un nouvel onglet",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",queueMessage:"Mettre le message en attente",removeQueuedMessage:"Retirer le message en attente",removeAttachment:"Retirer {name}",suggestedReplies:"R\xE9ponses sugg\xE9r\xE9es",compactingContext:"Optimisation du contexte de la conversation\u2026",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",talkToOperator:"Parler \xE0 une personne",connectingOperator:"Mise en relation avec une personne\u2026",noOperatorAvailable:"Personne n'est disponible pour le moment \u2014 laissez vos coordonn\xE9es et nous reviendrons vers vous.",chattingWithOperator:"Vous discutez avec {operator}",operatorBadgeTitle:"Chat en direct",chatNotice:"Vous discutez avec un assistant IA.",cancelOperatorRequest:"Continuer avec l'IA",loginPrompt:"Connectez-vous pour une aide plus rapide et personnalis\xE9e",loginAction:"Se connecter",loginRequired:"Connectez-vous pour discuter avec nous",loginExpired:"Votre connexion a expir\xE9. Connectez-vous pour poursuivre cette conversation.",loginExpiredGuest:"Votre connexion a expir\xE9. Connectez-vous pour poursuivre cette conversation, ou d\xE9marrez-en une nouvelle en tant qu'invit\xE9.",startAsGuest:"D\xE9marrer une nouvelle conversation",loggedInAs:"Connect\xE9 en tant que {name}",loggedIn:"Connect\xE9",dismissLoginPrompt:"Masquer",emailTranscript:"Envoyer la transcription",emailTranscriptPrompt:"Recevez une copie de cette conversation par e-mail.",emailTranscriptEmailLabel:"Adresse e-mail",emailTranscriptSend:"Envoyer la transcription",emailTranscriptSending:"Envoi\u2026",emailTranscriptSent:"Envoy\xE9 \xE0 {email}.",emailTranscriptAlreadySent:"Cette conversation a d\xE9j\xE0 \xE9t\xE9 envoy\xE9e. Envoyez un nouveau message pour l'envoyer \xE0 nouveau.",emailTranscriptLimited:"Vous avez atteint la limite pour le moment. R\xE9essayez plus tard.",emailTranscriptFailed:"Envoi impossible. R\xE9essayez.",emailTranscriptNotDelivered:"Envoi impossible \xE0 cette adresse. V\xE9rifiez-la et r\xE9essayez.",emailTranscriptCancel:"Annuler",emailTranscriptDone:"Termin\xE9",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",visualPreparing:"Pr\xE9paration du visuel\u2026",visualError:"Ce visuel n\u2019a pas pu \xEAtre affich\xE9.",visualPartial:"Certaines parties de ce visuel n\u2019ont pas pu \xEAtre affich\xE9es.",visualSoldOut:"\xC9puis\xE9",visualCartEmpty:"Votre panier est vide.",visualQuantity:"Qt\xE9",visualChoose:"Choisissez",visualDirect:"Direct",visualVia:"via",visualNight:"1 nuit",visualNights:"{count} nuits",visualPerNight:"par nuit",visualTravellers:"Voyageurs",thinking:"R\xE9flexion\u2026",thought:"R\xE9flexion",thoughtFor:"R\xE9flexion : {time}",toolResult:"R\xE9sultat",sources:"Sources",feedbackUp:"Bonne r\xE9ponse",feedbackDown:"Mauvaise r\xE9ponse",feedbackThanks:"Merci pour votre retour",copy:"Copier",copied:"Copi\xE9",copyTicketReference:"Ticket {reference}, copier",tabHome:"Accueil",tabConversations:"Chats",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",chatUnavailable:"Ce chat n'est pas disponible pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",contentHelpful:"Cela vous a-t-il aid\xE9 ?",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeAskPlaceholder:"Posez une question\u2026",homeWhatsNew:"Nouveaut\xE9s",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 pour \xAB\xA0{query}\xA0\xBB",helpShowMore:"Afficher plus",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsShowMore:"Afficher plus",newsUnseen:"Nouvelle publication",unread:"Non lu",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidNumber:"Saisissez un nombre valide",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Questions pour vous",askFallbackQuestion:"Veuillez fournir les informations manquantes.",inputBadge:"Questions",inputAnswered:"R\xE9pondu",inputSkipped:"Ignor\xE9",showOptions:"Afficher les options",hideOptions:"Masquer les options",qtypeText:"Votre r\xE9ponse",qtypeEmail:"Adresse e-mail",qtypePhone:"Num\xE9ro de t\xE9l\xE9phone",qtypeNumber:"Nombre",qtypeDate:"Date",qtypeChooseOne:"Choisir une",qtypeChooseAny:"Choisir plusieurs",qtypeBoolean:"Oui / Non",inputSubmit:"Envoyer les r\xE9ponses",inputSubmitHint:"Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e = saut de ligne",inputSkip:"Ignorer",confirmYes:"Oui",confirmNo:"Non",approve:"Approuver",decline:"Refuser",changeAnswer:"Modifier la r\xE9ponse",approvalPrompt:"{action} ?",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",stepInput:"Entr\xE9e",stepWorking:"En cours",stepWorkingOnIt:"En cours\u2026",stepNeedsYourApproval:"Votre accord est requis",stepWaitingForVisitor:"En attente du visiteur",stepApproved:"Approuv\xE9",stepDeclined:"Refus\xE9",stepReplaced:"Remplac\xE9",stepFailed:"\xC9chec",stepDidNotWork:"N'a pas fonctionn\xE9",decidedYouApproved:"Vous avez approuv\xE9",decidedYouDeclined:"Vous avez refus\xE9",decidedVisitorApproved:"Approuv\xE9 par le visiteur",decidedVisitorDeclined:"Refus\xE9 par le visiteur",decidedTeamApproved:"Approuv\xE9 par un membre de l'\xE9quipe",decidedTeamDeclined:"Refus\xE9 par un membre de l'\xE9quipe",decidedMemberApproved:"Approuv\xE9 par {name}",decidedMemberDeclined:"Refus\xE9 par {name}",stepRawData:"Donn\xE9es brutes",decidedRulesApproved:"Approuv\xE9 automatiquement",decidedRulesDeclined:"Refus\xE9 automatiquement",edit:"Modifier",toolStepsFailed:"{count} en \xE9chec",statusStopped:"Arr\xEAt\xE9",toolStepsStopped:"Arr\xEAt\xE9 apr\xE8s {count} \xE9tapes",toolStepsStoppedOne:"Arr\xEAt\xE9 apr\xE8s 1 \xE9tape"},Rg={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",file:"\u0645\u0644\u0641",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 {name} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629.",attachmentTooLarge:"\u0627\u0644\u0645\u0644\u0641 {name} \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627. \u064A\u0645\u0643\u0646 \u0623\u0646 \u064A\u0635\u0644 \u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0645\u0639\u064B\u0627 \u0625\u0644\u0649 {max}.",poweredBy:"\u0645\u062F\u0639\u0648\u0645 \u0645\u0646 {name}",attachmentTooMany:"\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A: {count}.",attachmentUploadFailed:"\u062A\u0639\u0630\u0651\u0631 \u0631\u0641\u0639 {name}.",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0629\u2026",loadPreviousMessages:"\u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0631\u0633\u0627\u0626\u0644 \u0627\u0644\u0633\u0627\u0628\u0642\u0629",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",dropZoneRejected:"\u0644\u0627 \u064A\u0645\u0643\u0646 \u0625\u0631\u0641\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0647\u0646\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.",errorRateLimitedIn:"\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 {seconds} \u062B.",errorOffline:"\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u0648\u0635\u0648\u0644 \u0625\u0644\u0649 \u0627\u0644\u062E\u0627\u062F\u0645. \u062A\u062D\u0642\u0651\u0642 \u0645\u0646 \u0627\u062A\u0635\u0627\u0644\u0643 \u0648\u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",errorServer:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0646 \u062C\u0647\u062A\u0646\u0627. \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",errorOriginNotAllowed:"\u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u063A\u064A\u0631 \u0645\u064F\u0639\u062F\u0651\u0629 \u0644\u0647\u0630\u0627 \u0627\u0644\u0645\u0648\u0642\u0639 \u0628\u0639\u062F.",errorMessageTooLong:"\u0647\u0630\u0647 \u0627\u0644\u0631\u0633\u0627\u0644\u0629 \u0637\u0648\u064A\u0644\u0629 \u062C\u062F\u064B\u0627. \u0627\u062E\u062A\u0635\u0631\u0647\u0627 \u0648\u0623\u0631\u0633\u0644\u0647\u0627 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",errorReconnecting:"\u0627\u0646\u0642\u0637\u0639 \u0627\u0644\u0627\u062A\u0635\u0627\u0644. \u062C\u0627\u0631\u064D \u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0627\u062A\u0635\u0627\u0644\u2026",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\u062F\u0631\u062F\u0634\u0629",historyEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u062F\u0631\u062F\u0634\u0627\u062A \u0633\u0627\u0628\u0642\u0629 \u0628\u0639\u062F",historyContinue:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",historyLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u062F\u0631\u062F\u0634\u0627\u062A\u0643\u2026",historyTitle:"\u0633\u062C\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0627\u062A",loadMoreConversations:"\u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0632\u064A\u062F \u0645\u0646 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0627\u062A",language:"\u0627\u0644\u0644\u063A\u0629",launcherOpen:"\u0641\u062A\u062D \u0627\u0644\u062F\u0631\u062F\u0634\u0629",launcherAsk:"\u0627\u0633\u0623\u0644 {name}",micBlocked:"\u0627\u0644\u0645\u064A\u0643\u0631\u0648\u0641\u0648\u0646 \u0645\u062D\u0638\u0648\u0631 \u0644\u0647\u0630\u0627 \u0627\u0644\u0645\u0648\u0642\u0639\u060C \u0644\u0630\u0627 \u0644\u0627 \u064A\u0645\u0643\u0646 \u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A.",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",moreActions:"\u0625\u062C\u0631\u0627\u0621\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629",newConversation:"\u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",panelTitle:"\u0627\u0644\u062F\u0631\u062F\u0634\u0629",popOut:"\u0641\u062A\u062D \u0641\u064A \u0639\u0644\u0627\u0645\u0629 \u062A\u0628\u0648\u064A\u0628 \u062C\u062F\u064A\u062F\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",queueMessage:"\u0625\u0636\u0627\u0641\u0629 \u0627\u0644\u0631\u0633\u0627\u0644\u0629 \u0625\u0644\u0649 \u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0627\u0646\u062A\u0638\u0627\u0631",removeQueuedMessage:"\u0625\u0632\u0627\u0644\u0629 \u0627\u0644\u0631\u0633\u0627\u0644\u0629 \u0645\u0646 \u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0627\u0646\u062A\u0638\u0627\u0631",removeAttachment:"\u0625\u0632\u0627\u0644\u0629 {name}",suggestedReplies:"\u0631\u062F\u0648\u062F \u0645\u0642\u062A\u0631\u062D\u0629",compactingContext:"\u062C\u0627\u0631\u064D \u062A\u062D\u0633\u064A\u0646 \u0633\u064A\u0627\u0642 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629\u2026",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",talkToOperator:"\u0627\u0644\u062A\u062D\u062F\u062B \u0625\u0644\u0649 \u0634\u062E\u0635",connectingOperator:"\u062C\u0627\u0631\u064D \u062A\u0648\u0635\u064A\u0644\u0643 \u0628\u0634\u062E\u0635\u2026",noOperatorAvailable:"\u0644\u0627 \u064A\u0648\u062C\u062F \u0645\u0648\u0638\u0641\u0648\u0646 \u0645\u062A\u0627\u062D\u0648\u0646 \u0627\u0644\u0622\u0646 \u2014 \u0627\u062A\u0631\u0643 \u0628\u064A\u0627\u0646\u0627\u062A\u0643 \u0648\u0633\u0646\u062A\u0648\u0627\u0635\u0644 \u0645\u0639\u0643.",chattingWithOperator:"\u0623\u0646\u062A \u062A\u062A\u062D\u062F\u062B \u0645\u0639 {operator}",operatorBadgeTitle:"\u0645\u062D\u0627\u062F\u062B\u0629 \u0645\u0628\u0627\u0634\u0631\u0629",chatNotice:"\u0623\u0646\u062A \u062A\u062A\u062D\u062F\u062B \u0645\u0639 \u0645\u0633\u0627\u0639\u062F \u0630\u0643\u0627\u0621 \u0627\u0635\u0637\u0646\u0627\u0639\u064A.",cancelOperatorRequest:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0645\u0639 \u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064A",loginPrompt:"\u0633\u062C\u0651\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0644\u0644\u062D\u0635\u0648\u0644 \u0639\u0644\u0649 \u062F\u0639\u0645 \u0623\u0633\u0631\u0639 \u0648\u0645\u062E\u0635\u0651\u0635 \u0644\u0643",loginAction:"\u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644",loginRequired:"\u0633\u062C\u0651\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0644\u0644\u062F\u0631\u062F\u0634\u0629 \u0645\u0639\u0646\u0627",loginExpired:"\u0627\u0646\u062A\u0647\u062A \u0635\u0644\u0627\u062D\u064A\u0629 \u062A\u0633\u062C\u064A\u0644 \u062F\u062E\u0648\u0644\u0643. \u0633\u062C\u0651\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0644\u0645\u062A\u0627\u0628\u0639\u0629 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629.",loginExpiredGuest:"\u0627\u0646\u062A\u0647\u062A \u0635\u0644\u0627\u062D\u064A\u0629 \u062A\u0633\u062C\u064A\u0644 \u062F\u062E\u0648\u0644\u0643. \u0633\u062C\u0651\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0644\u0645\u062A\u0627\u0628\u0639\u0629 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629\u060C \u0623\u0648 \u0627\u0628\u062F\u0623 \u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629 \u0643\u0636\u064A\u0641.",startAsGuest:"\u0628\u062F\u0621 \u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629",loggedInAs:"\u062A\u0645 \u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644 \u0628\u0627\u0633\u0645 {name}",loggedIn:"\u062A\u0645 \u062A\u0633\u062C\u064A\u0644 \u0627\u0644\u062F\u062E\u0648\u0644",dismissLoginPrompt:"\u0625\u062E\u0641\u0627\u0621",emailTranscript:"\u0625\u0631\u0633\u0627\u0644 \u0646\u0635 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",emailTranscriptPrompt:"\u0627\u062D\u0635\u0644 \u0639\u0644\u0649 \u0646\u0633\u062E\u0629 \u0645\u0646 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0639\u0628\u0631 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A.",emailTranscriptEmailLabel:"\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",emailTranscriptSend:"\u0625\u0631\u0633\u0627\u0644 \u0646\u0635 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",emailTranscriptSending:"\u062C\u0627\u0631\u064D \u0627\u0644\u0625\u0631\u0633\u0627\u0644\u2026",emailTranscriptSent:"\u062A\u0645 \u0627\u0644\u0625\u0631\u0633\u0627\u0644 \u0625\u0644\u0649 {email}.",emailTranscriptAlreadySent:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u0628\u0627\u0644\u0641\u0639\u0644. \u0623\u0631\u0633\u0644 \u0631\u0633\u0627\u0644\u0629 \u062C\u062F\u064A\u062F\u0629 \u0644\u0625\u0631\u0633\u0627\u0644\u0647\u0627 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",emailTranscriptLimited:"\u0644\u0642\u062F \u0628\u0644\u063A\u062A \u0627\u0644\u062D\u062F \u0627\u0644\u0645\u0633\u0645\u0648\u062D \u0628\u0647 \u062D\u0627\u0644\u064A\u064B\u0627. \u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649 \u0644\u0627\u062D\u0642\u064B\u0627.",emailTranscriptFailed:"\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u0625\u0631\u0633\u0627\u0644. \u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",emailTranscriptNotDelivered:"\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u0625\u0631\u0633\u0627\u0644 \u0625\u0644\u0649 \u0647\u0630\u0627 \u0627\u0644\u0639\u0646\u0648\u0627\u0646. \u062A\u062D\u0642\u0651\u0642 \u0645\u0646\u0647 \u0648\u062D\u0627\u0648\u0644 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",emailTranscriptCancel:"\u0625\u0644\u063A\u0627\u0621",emailTranscriptDone:"\u062A\u0645",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",visualPreparing:"\u062C\u0627\u0631\u064D \u0625\u0639\u062F\u0627\u062F \u0627\u0644\u0645\u062D\u062A\u0648\u0649 \u0627\u0644\u0645\u0631\u0626\u064A\u2026",visualError:"\u062A\u0639\u0630\u0631 \u0639\u0631\u0636 \u0647\u0630\u0627 \u0627\u0644\u0645\u062D\u062A\u0648\u0649 \u0627\u0644\u0645\u0631\u0626\u064A.",visualPartial:"\u062A\u0639\u0630\u0631 \u0639\u0631\u0636 \u0628\u0639\u0636 \u0623\u062C\u0632\u0627\u0621 \u0647\u0630\u0627 \u0627\u0644\u0645\u062D\u062A\u0648\u0649 \u0627\u0644\u0645\u0631\u0626\u064A.",visualSoldOut:"\u0646\u0641\u062F\u062A \u0627\u0644\u0643\u0645\u064A\u0629",visualCartEmpty:"\u0633\u0644\u062A\u0643 \u0641\u0627\u0631\u063A\u0629.",visualQuantity:"\u0627\u0644\u0643\u0645\u064A\u0629",visualChoose:"\u0627\u062E\u062A\u0631",visualDirect:"\u0645\u0628\u0627\u0634\u0631",visualVia:"\u0639\u0628\u0631",visualNight:"\u0644\u064A\u0644\u0629 \u0648\u0627\u062D\u062F\u0629",visualNights:"\u0627\u0644\u0644\u064A\u0627\u0644\u064A: {count}",visualPerNight:"\u0644\u0644\u064A\u0644\u0629",visualTravellers:"\u0627\u0644\u0645\u0633\u0627\u0641\u0631\u0648\u0646",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thought:"\u062A\u0641\u0643\u064A\u0631",thoughtFor:"\u0641\u0643\u0651\u0631 \u0644\u0645\u062F\u0629 {time}",toolResult:"\u0627\u0644\u0646\u062A\u064A\u062C\u0629",sources:"\u0627\u0644\u0645\u0635\u0627\u062F\u0631",feedbackUp:"\u0631\u062F \u062C\u064A\u062F",feedbackDown:"\u0631\u062F \u0633\u064A\u0626",feedbackThanks:"\u0634\u0643\u0631\u064B\u0627 \u0639\u0644\u0649 \u0645\u0644\u0627\u062D\u0638\u0627\u062A\u0643",copy:"\u0646\u0633\u062E",copied:"\u062A\u0645 \u0627\u0644\u0646\u0633\u062E",copyTicketReference:"\u0627\u0644\u062A\u0630\u0643\u0631\u0629 {reference}\u060C \u0646\u0633\u062E",tabHome:"\u0627\u0644\u0631\u0626\u064A\u0633\u064A\u0629",tabConversations:"\u0627\u0644\u062F\u0631\u062F\u0634\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",chatUnavailable:"\u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629 \u063A\u064A\u0631 \u0645\u062A\u0627\u062D\u0629 \u062D\u0627\u0644\u064A\u0627\u064B",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",contentHelpful:"\u0647\u0644 \u0643\u0627\u0646 \u0647\u0630\u0627 \u0645\u0641\u064A\u062F\u064B\u0627\u061F",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",homeAskPlaceholder:"\u0627\u0637\u0631\u062D \u0633\u0624\u0627\u0644\u0627\u064B\u2026",homeWhatsNew:"\u0645\u0627 \u0627\u0644\u062C\u062F\u064A\u062F",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 \u0646\u062A\u0627\u0626\u062C \u0644\u0640 \xAB{query}\xBB",helpShowMore:"\u0639\u0631\u0636 \u0627\u0644\u0645\u0632\u064A\u062F",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",newsShowMore:"\u0639\u0631\u0636 \u0627\u0644\u0645\u0632\u064A\u062F",newsUnseen:"\u0645\u0646\u0634\u0648\u0631 \u062C\u062F\u064A\u062F",unread:"\u063A\u064A\u0631 \u0645\u0642\u0631\u0648\u0621",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",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0623\u0633\u0626\u0644\u0629 \u0644\u0643",askFallbackQuestion:"\u064A\u0631\u062C\u0649 \u062A\u0642\u062F\u064A\u0645 \u0627\u0644\u0645\u0639\u0644\u0648\u0645\u0627\u062A \u0627\u0644\u0646\u0627\u0642\u0635\u0629.",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",showOptions:"\u0625\u0638\u0647\u0627\u0631 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",hideOptions:"\u0625\u062E\u0641\u0627\u0621 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",qtypeText:"\u0625\u062C\u0627\u0628\u062A\u0643",qtypeEmail:"\u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0628\u0631\u064A\u062F \u0627\u0644\u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",qtypePhone:"\u0631\u0642\u0645 \u0627\u0644\u0647\u0627\u062A\u0641",qtypeNumber:"\u0631\u0642\u0645",qtypeDate:"\u062A\u0627\u0631\u064A\u062E",qtypeChooseOne:"\u0627\u062E\u062A\u0631 \u0648\u0627\u062D\u062F\u064B\u0627",qtypeChooseAny:"\u0627\u062E\u062A\u0631 \u0623\u064A\u064B\u0627",qtypeBoolean:"\u0646\u0639\u0645 / \u0644\u0627",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",approve:"\u0645\u0648\u0627\u0641\u0642\u0629",decline:"\u0631\u0641\u0636",changeAnswer:"\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",approvalPrompt:"{action}\u061F",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u063A\u064A\u064A\u0631 \u0625\u062C\u0627\u0628\u062A\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",stepInput:"\u0627\u0644\u0645\u062F\u062E\u0644\u0627\u062A",stepWorking:"\u0642\u064A\u062F \u0627\u0644\u062A\u0646\u0641\u064A\u0630",stepWorkingOnIt:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",stepNeedsYourApproval:"\u0628\u062D\u0627\u062C\u0629 \u0625\u0644\u0649 \u0645\u0648\u0627\u0641\u0642\u062A\u0643",stepWaitingForVisitor:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0632\u0627\u0626\u0631",stepApproved:"\u062A\u0645\u062A \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",stepDeclined:"\u0645\u0631\u0641\u0648\u0636",stepReplaced:"\u062A\u0645 \u0627\u0644\u0627\u0633\u062A\u0628\u062F\u0627\u0644",stepFailed:"\u0641\u0634\u0644",stepDidNotWork:"\u0644\u0645 \u064A\u0646\u062C\u062D",decidedYouApproved:"\u0648\u0627\u0641\u0642\u062A",decidedYouDeclined:"\u0631\u0641\u0636\u062A",decidedVisitorApproved:"\u0648\u0627\u0641\u0642 \u0627\u0644\u0632\u0627\u0626\u0631",decidedVisitorDeclined:"\u0631\u0641\u0636 \u0627\u0644\u0632\u0627\u0626\u0631",decidedTeamApproved:"\u0648\u0627\u0641\u0642 \u0639\u0636\u0648 \u0641\u064A \u0627\u0644\u0641\u0631\u064A\u0642",decidedTeamDeclined:"\u0631\u0641\u0636 \u0639\u0636\u0648 \u0641\u064A \u0627\u0644\u0641\u0631\u064A\u0642",decidedMemberApproved:"\u0648\u0627\u0641\u0642 {name}",decidedMemberDeclined:"\u0631\u0641\u0636 {name}",stepRawData:"\u0627\u0644\u0628\u064A\u0627\u0646\u0627\u062A \u0627\u0644\u0623\u0648\u0644\u064A\u0629",decidedRulesApproved:"\u062A\u0645\u062A \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629 \u062A\u0644\u0642\u0627\u0626\u064A\u064B\u0627",decidedRulesDeclined:"\u0631\u064F\u0641\u0636 \u062A\u0644\u0642\u0627\u0626\u064A\u064B\u0627",edit:"\u062A\u0639\u062F\u064A\u0644",toolStepsFailed:"\u0641\u0634\u0644 {count}",statusStopped:"\u0623\u064F\u0648\u0642\u0641",toolStepsStopped:"\u0623\u064F\u0648\u0642\u0641 \u0628\u0639\u062F {count} \u062E\u0637\u0648\u0627\u062A",toolStepsStoppedOne:"\u0623\u064F\u0648\u0642\u0641 \u0628\u0639\u062F \u062E\u0637\u0648\u0629 \u0648\u0627\u062D\u062F\u0629"},Ag={attach:"Adjuntar archivos",file:"Archivo",attachmentMimeRejected:"{name} no es un tipo de archivo que acepte este chat.",attachmentTooLarge:"{name} es demasiado grande. Los archivos pueden ocupar hasta {max} en total.",poweredBy:"Con la tecnolog\xEDa de {name}",attachmentTooMany:"L\xEDmite de adjuntos: {count}.",attachmentUploadFailed:"No se pudo subir {name}.",conversationLoading:"Cargando chat\u2026",loadPreviousMessages:"Cargar mensajes anteriores",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",dropZoneRejected:"Estos archivos no se pueden adjuntar aqu\xED",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRateLimitedIn:"Demasiadas solicitudes: int\xE9ntalo de nuevo en {seconds} s.",errorOffline:"No se puede conectar con el servidor. Revisa tu conexi\xF3n e int\xE9ntalo de nuevo.",errorServer:"Algo sali\xF3 mal por nuestra parte. Int\xE9ntalo de nuevo.",errorOriginNotAllowed:"Este chat a\xFAn no est\xE1 configurado para este sitio web.",errorMessageTooLong:"Ese mensaje es demasiado largo. Ac\xF3rtalo y env\xEDalo de nuevo.",errorReconnecting:"Se perdi\xF3 la conexi\xF3n. Reconectando\u2026",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 chats",historyContinue:"Continuar el chat",historyLoading:"Cargando tus chats\u2026",historyTitle:"Historial de chats",loadMoreConversations:"Cargar m\xE1s conversaciones",language:"Idioma",launcherOpen:"Abrir el chat",launcherAsk:"Preg\xFAntale a {name}",micBlocked:"El micr\xF3fono est\xE1 bloqueado para este sitio, as\xED que la entrada de voz no puede iniciarse.",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nuevo chat",panelTitle:"Chat",popOut:"Abrir en una pesta\xF1a nueva",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",queueMessage:"Poner mensaje en cola",removeQueuedMessage:"Quitar mensaje de la cola",removeAttachment:"Quitar {name}",suggestedReplies:"Respuestas sugeridas",compactingContext:"Optimizando el contexto de la conversaci\xF3n\u2026",soundOff:"Sonido desactivado",soundOn:"Sonido activado",talkToOperator:"Hablar con una persona",connectingOperator:"Conect\xE1ndote con una persona\u2026",noOperatorAvailable:"Nadie est\xE1 disponible ahora \u2014 deja tus datos y te contactaremos.",chattingWithOperator:"Est\xE1s chateando con {operator}",operatorBadgeTitle:"Chat en vivo",chatNotice:"Est\xE1s chateando con un asistente de IA.",cancelOperatorRequest:"Seguir con la IA",loginPrompt:"Inicia sesi\xF3n para recibir una ayuda m\xE1s r\xE1pida y personalizada",loginAction:"Iniciar sesi\xF3n",loginRequired:"Inicia sesi\xF3n para chatear con nosotros",loginExpired:"Tu sesi\xF3n ha caducado. Inicia sesi\xF3n para continuar esta conversaci\xF3n.",loginExpiredGuest:"Tu sesi\xF3n ha caducado. Inicia sesi\xF3n para continuar esta conversaci\xF3n o empieza una nueva como invitado.",startAsGuest:"Empezar una nueva conversaci\xF3n",loggedInAs:"Sesi\xF3n iniciada como {name}",loggedIn:"Sesi\xF3n iniciada",dismissLoginPrompt:"Ocultar",emailTranscript:"Enviar transcripci\xF3n",emailTranscriptPrompt:"Recibe una copia de esta conversaci\xF3n por correo.",emailTranscriptEmailLabel:"Correo electr\xF3nico",emailTranscriptSend:"Enviar transcripci\xF3n",emailTranscriptSending:"Enviando\u2026",emailTranscriptSent:"Enviado a {email}.",emailTranscriptAlreadySent:"Esta conversaci\xF3n ya se envi\xF3. Env\xEDa un mensaje nuevo para enviarla otra vez.",emailTranscriptLimited:"Has alcanzado el l\xEDmite por ahora. Int\xE9ntalo m\xE1s tarde.",emailTranscriptFailed:"No se pudo enviar. Int\xE9ntalo de nuevo.",emailTranscriptNotDelivered:"No se pudo enviar a esta direcci\xF3n. Rev\xEDsala e int\xE9ntalo de nuevo.",emailTranscriptCancel:"Cancelar",emailTranscriptDone:"Listo",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",visualPreparing:"Preparando visualizaci\xF3n\u2026",visualError:"No se pudo mostrar esta visualizaci\xF3n.",visualPartial:"No se pudieron mostrar algunas partes de esta visualizaci\xF3n.",visualSoldOut:"Agotado",visualCartEmpty:"Tu carrito est\xE1 vac\xEDo.",visualQuantity:"Cant.",visualChoose:"Elige",visualDirect:"Directo",visualVia:"v\xEDa",visualNight:"1 noche",visualNights:"{count} noches",visualPerNight:"por noche",visualTravellers:"Viajeros",thinking:"Pensando\u2026",thought:"Razonamiento",thoughtFor:"Razon\xF3 durante {time}",toolResult:"Resultado",sources:"Fuentes",feedbackUp:"Buena respuesta",feedbackDown:"Mala respuesta",feedbackThanks:"Gracias por tu opini\xF3n",copy:"Copiar",copied:"Copiado",copyTicketReference:"Ticket {reference}, copiar",tabHome:"Inicio",tabConversations:"Chats",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",chatUnavailable:"Este chat no est\xE1 disponible en este momento",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",contentHelpful:"\xBFTe result\xF3 \xFAtil?",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeAskPlaceholder:"Haz una pregunta\u2026",homeWhatsNew:"Lo nuevo",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:"Sin resultados para \xAB{query}\xBB",helpShowMore:"Mostrar m\xE1s",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsShowMore:"Mostrar m\xE1s",newsUnseen:"Publicaci\xF3n nueva",unread:"No le\xEDdo",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Preguntas para ti",askFallbackQuestion:"Indica la informaci\xF3n que falta.",inputBadge:"Preguntas",inputAnswered:"Respondido",inputSkipped:"Omitido",showOptions:"Mostrar opciones",hideOptions:"Ocultar opciones",qtypeText:"Tu respuesta",qtypeEmail:"Correo electr\xF3nico",qtypePhone:"N\xFAmero de tel\xE9fono",qtypeNumber:"N\xFAmero",qtypeDate:"Fecha",qtypeChooseOne:"Elige una",qtypeChooseAny:"Elige varias",qtypeBoolean:"S\xED / No",inputSubmit:"Enviar respuestas",inputSubmitHint:"Enter para enviar \xB7 May\xFAs+Enter = nueva l\xEDnea",inputSkip:"Omitir",confirmYes:"S\xED",confirmNo:"No",approve:"Aprobar",decline:"Rechazar",changeAnswer:"Cambiar respuesta",approvalPrompt:"\xBF{action}?",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",stepInput:"Entrada",stepWorking:"En curso",stepWorkingOnIt:"En curso\u2026",stepNeedsYourApproval:"Necesita tu aprobaci\xF3n",stepWaitingForVisitor:"Esperando al visitante",stepApproved:"Aprobado",stepDeclined:"Rechazado",stepReplaced:"Reemplazado",stepFailed:"Fall\xF3",stepDidNotWork:"No funcion\xF3",decidedYouApproved:"Lo aprobaste",decidedYouDeclined:"Lo rechazaste",decidedVisitorApproved:"El visitante aprob\xF3",decidedVisitorDeclined:"El visitante rechaz\xF3",decidedTeamApproved:"Aprobado por un miembro del equipo",decidedTeamDeclined:"Rechazado por un miembro del equipo",decidedMemberApproved:"Aprobado por {name}",decidedMemberDeclined:"Rechazado por {name}",stepRawData:"Datos sin procesar",decidedRulesApproved:"Aprobado autom\xE1ticamente",decidedRulesDeclined:"Rechazado autom\xE1ticamente",edit:"Editar",toolStepsFailed:"{count} con error",statusStopped:"Detenido",toolStepsStopped:"Detenido tras {count} pasos",toolStepsStoppedOne:"Detenido tras 1 paso"},Ig={attach:"\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",file:"\u05E7\u05D5\u05D1\u05E5",attachmentMimeRejected:"\u05D4\u05E7\u05D5\u05D1\u05E5 {name} \u05D0\u05D9\u05E0\u05D5 \u05DE\u05E1\u05D5\u05D2 \u05E9\u05D4\u05E6\u05F3\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05DE\u05E7\u05D1\u05DC.",attachmentTooLarge:"\u05D4\u05E7\u05D5\u05D1\u05E5 {name} \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9. \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05D9\u05DB\u05D5\u05DC\u05D9\u05DD \u05DC\u05D4\u05D2\u05D9\u05E2 \u05D9\u05D7\u05D3 \u05E2\u05D3 {max}.",poweredBy:"\u05DE\u05D5\u05E4\u05E2\u05DC \u05E2\u05DC \u05D9\u05D3\u05D9 {name}",attachmentTooMany:"\u05DE\u05E1\u05E4\u05E8 \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05D4\u05DE\u05E8\u05D1\u05D9 \u05DC\u05E6\u05D9\u05E8\u05D5\u05E3: {count}.",attachmentUploadFailed:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05D4\u05D9\u05D4 \u05DC\u05D4\u05E2\u05DC\u05D5\u05EA \u05D0\u05EA {name}.",conversationLoading:"\u05D8\u05D5\u05E2\u05DF \u05E6\u05F3\u05D0\u05D8\u2026",loadPreviousMessages:"\u05D8\u05E2\u05D9\u05E0\u05EA \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05E7\u05D5\u05D3\u05DE\u05D5\u05EA",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",dropZoneRejected:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05DC\u05E6\u05E8\u05E3 \u05DB\u05D0\u05DF \u05D0\u05EA \u05D4\u05E7\u05D1\u05E6\u05D9\u05DD \u05D4\u05D0\u05DC\u05D4",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.",errorRateLimitedIn:"\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 {seconds} \u05E9\u05E0\u05F3.",errorOffline:"\u05D0\u05D9\u05DF \u05D7\u05D9\u05D1\u05D5\u05E8 \u05DC\u05E9\u05E8\u05EA. \u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05D4\u05D7\u05D9\u05D1\u05D5\u05E8 \u05D5\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1.",errorServer:"\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9 \u05D0\u05E6\u05DC\u05E0\u05D5. \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1.",errorOriginNotAllowed:"\u05D4\u05E6'\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05E2\u05D3\u05D9\u05D9\u05DF \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 \u05DC\u05D0\u05EA\u05E8 \u05D4\u05D6\u05D4.",errorMessageTooLong:"\u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05D4\u05D6\u05D5 \u05D0\u05E8\u05D5\u05DB\u05D4 \u05DE\u05D3\u05D9. \u05E7\u05E6\u05E8\u05D5 \u05D0\u05D5\u05EA\u05D4 \u05D5\u05E9\u05DC\u05D7\u05D5 \u05E9\u05D5\u05D1.",errorReconnecting:"\u05D4\u05D7\u05D9\u05D1\u05D5\u05E8 \u05D0\u05D1\u05D3. \u05DE\u05EA\u05D7\u05D1\u05E8 \u05DE\u05D7\u05D3\u05E9\u2026",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\u05E6\u05F3\u05D0\u05D8",historyEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E7\u05D5\u05D3\u05DE\u05D9\u05DD",historyContinue:"\u05D4\u05DE\u05E9\u05DA \u05E6\u05F3\u05D0\u05D8",historyLoading:"\u05D8\u05D5\u05E2\u05DF \u05D0\u05EA \u05D4\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA\u2026",historyTitle:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D9\u05EA \u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",loadMoreConversations:"\u05D8\u05E2\u05D9\u05E0\u05EA \u05E9\u05D9\u05D7\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",language:"\u05E9\u05E4\u05D4",launcherOpen:"\u05E4\u05EA\u05D9\u05D7\u05EA \u05E6\u05F3\u05D0\u05D8",launcherAsk:"\u05DC\u05E9\u05D0\u05D5\u05DC \u05D0\u05EA {name}",micBlocked:"\u05D4\u05DE\u05D9\u05E7\u05E8\u05D5\u05E4\u05D5\u05DF \u05D7\u05E1\u05D5\u05DD \u05D1\u05D0\u05EA\u05E8 \u05D4\u05D6\u05D4, \u05D5\u05DC\u05DB\u05DF \u05D0\u05D9 \u05D0\u05E4\u05E9\u05E8 \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9.",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",moreActions:"\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",newConversation:"\u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",panelTitle:"\u05E6\u05F3\u05D0\u05D8",popOut:"\u05E4\u05EA\u05D9\u05D7\u05D4 \u05D1\u05DB\u05E8\u05D8\u05D9\u05E1\u05D9\u05D9\u05D4 \u05D7\u05D3\u05E9\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",queueMessage:"\u05D4\u05D5\u05E1\u05E4\u05EA \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05DC\u05EA\u05D5\u05E8",removeQueuedMessage:"\u05D4\u05E1\u05E8\u05EA \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05DE\u05D4\u05EA\u05D5\u05E8",removeAttachment:"\u05D4\u05E1\u05E8\u05EA {name}",suggestedReplies:"\u05EA\u05E9\u05D5\u05D1\u05D5\u05EA \u05DE\u05D5\u05E6\u05E2\u05D5\u05EA",compactingContext:"\u05DE\u05D1\u05E6\u05E2 \u05D0\u05D5\u05E4\u05D8\u05D9\u05DE\u05D9\u05D6\u05E6\u05D9\u05D4 \u05DC\u05D4\u05E7\u05E9\u05E8 \u05D4\u05E9\u05D9\u05D7\u05D4\u2026",soundOff:"\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",soundOn:"\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",talkToOperator:"\u05D3\u05D1\u05E8\u05D5 \u05E2\u05DD \u05D0\u05D3\u05DD",connectingOperator:"\u05DE\u05D7\u05D1\u05E8\u05D9\u05DD \u05D0\u05D5\u05EA\u05DA \u05DC\u05D0\u05D3\u05DD\u2026",noOperatorAvailable:"\u05D0\u05D9\u05DF \u05E0\u05E6\u05D9\u05D2\u05D9\u05DD \u05D6\u05DE\u05D9\u05E0\u05D9\u05DD \u05DB\u05E2\u05EA \u2014 \u05D4\u05E9\u05D0\u05E8 \u05D0\u05EA \u05D4\u05E4\u05E8\u05D8\u05D9\u05DD \u05E9\u05DC\u05DA \u05D5\u05E0\u05D7\u05D6\u05D5\u05E8 \u05D0\u05DC\u05D9\u05DA.",chattingWithOperator:"\u05D0\u05EA\u05D4 \u05DE\u05E6\u05F3\u05D5\u05D8\u05D8 \u05E2\u05DD {operator}",operatorBadgeTitle:"\u05E6\u05F3\u05D0\u05D8 \u05D7\u05D9",chatNotice:"\u05D0\u05EA\u05D4 \u05DE\u05E6\u05F3\u05D5\u05D8\u05D8 \u05E2\u05DD \u05E2\u05D5\u05D6\u05E8 \u05D1\u05D9\u05E0\u05D4 \u05DE\u05DC\u05D0\u05DB\u05D5\u05EA\u05D9\u05EA.",cancelOperatorRequest:"\u05D4\u05DE\u05E9\u05DA \u05DC\u05E9\u05D5\u05D7\u05D7 \u05E2\u05DD \u05D4-AI",loginPrompt:"\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5 \u05DC\u05E7\u05D1\u05DC\u05EA \u05EA\u05DE\u05D9\u05DB\u05D4 \u05DE\u05D4\u05D9\u05E8\u05D4 \u05D5\u05DE\u05D5\u05EA\u05D0\u05DE\u05EA \u05D0\u05D9\u05E9\u05D9\u05EA",loginAction:"\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5\u05EA",loginRequired:"\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5 \u05DB\u05D3\u05D9 \u05DC\u05E9\u05D5\u05D7\u05D7 \u05D0\u05D9\u05EA\u05E0\u05D5",loginExpired:"\u05E4\u05D2 \u05EA\u05D5\u05E7\u05E3 \u05D4\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5\u05EA \u05E9\u05DC\u05DA. \u05D4\u05EA\u05D7\u05D1\u05E8\u05D5 \u05DB\u05D3\u05D9 \u05DC\u05D4\u05DE\u05E9\u05D9\u05DA \u05D1\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5.",loginExpiredGuest:"\u05E4\u05D2 \u05EA\u05D5\u05E7\u05E3 \u05D4\u05D4\u05EA\u05D7\u05D1\u05E8\u05D5\u05EA \u05E9\u05DC\u05DA. \u05D4\u05EA\u05D7\u05D1\u05E8\u05D5 \u05DB\u05D3\u05D9 \u05DC\u05D4\u05DE\u05E9\u05D9\u05DA \u05D1\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5, \u05D0\u05D5 \u05D4\u05EA\u05D7\u05D9\u05DC\u05D5 \u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4 \u05DB\u05D0\u05D5\u05E8\u05D7\u05D9\u05DD.",startAsGuest:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4",loggedInAs:"\u05DE\u05D7\u05D5\u05D1\u05E8/\u05EA \u05D1\u05EA\u05D5\u05E8 {name}",loggedIn:"\u05DE\u05D7\u05D5\u05D1\u05E8/\u05EA",dismissLoginPrompt:"\u05D4\u05E1\u05EA\u05E8\u05D4",emailTranscript:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05DE\u05DC\u05D9\u05DC \u05D1\u05D3\u05D5\u05D0\u05F4\u05DC",emailTranscriptPrompt:"\u05E7\u05D1\u05DC\u05D5 \u05E2\u05D5\u05EA\u05E7 \u05E9\u05DC \u05D4\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5 \u05D1\u05D3\u05D5\u05D0\u05F4\u05DC.",emailTranscriptEmailLabel:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D3\u05D5\u05D0\u05F4\u05DC",emailTranscriptSend:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05D4\u05EA\u05DE\u05DC\u05D9\u05DC",emailTranscriptSending:"\u05E9\u05D5\u05DC\u05D7\u05D9\u05DD\u2026",emailTranscriptSent:"\u05E0\u05E9\u05DC\u05D7 \u05D0\u05DC {email}.",emailTranscriptAlreadySent:"\u05D4\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5 \u05DB\u05D1\u05E8 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05E9\u05DC\u05D7\u05D5 \u05D4\u05D5\u05D3\u05E2\u05D4 \u05D7\u05D3\u05E9\u05D4 \u05DB\u05D3\u05D9 \u05DC\u05E9\u05DC\u05D5\u05D7 \u05D0\u05D5\u05EA\u05D4 \u05E9\u05D5\u05D1.",emailTranscriptLimited:"\u05D4\u05D2\u05E2\u05EA\u05DD \u05DC\u05DE\u05D2\u05D1\u05DC\u05D4 \u05DB\u05E8\u05D2\u05E2. \u05E0\u05E1\u05D5 \u05E9\u05D5\u05D1 \u05DE\u05D0\u05D5\u05D7\u05E8 \u05D9\u05D5\u05EA\u05E8.",emailTranscriptFailed:"\u05D4\u05E9\u05DC\u05D9\u05D7\u05D4 \u05E0\u05DB\u05E9\u05DC\u05D4. \u05E0\u05E1\u05D5 \u05E9\u05D5\u05D1.",emailTranscriptNotDelivered:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05DC\u05E9\u05DC\u05D5\u05D7 \u05DC\u05DB\u05EA\u05D5\u05D1\u05EA \u05D4\u05D6\u05D5. \u05D1\u05D3\u05E7\u05D5 \u05D0\u05D5\u05EA\u05D4 \u05D5\u05E0\u05E1\u05D5 \u05E9\u05D5\u05D1.",emailTranscriptCancel:"\u05D1\u05D9\u05D8\u05D5\u05DC",emailTranscriptDone:"\u05E1\u05D9\u05D5\u05DD",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",visualPreparing:"\u05DE\u05DB\u05D9\u05DF \u05EA\u05E6\u05D5\u05D2\u05D4\u2026",visualError:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05D4\u05D9\u05D4 \u05DC\u05D4\u05E6\u05D9\u05D2 \u05EA\u05E6\u05D5\u05D2\u05D4 \u05D6\u05D5.",visualPartial:"\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05D4\u05D9\u05D4 \u05DC\u05D4\u05E6\u05D9\u05D2 \u05D7\u05DC\u05E7\u05D9\u05DD \u05DE\u05EA\u05E6\u05D5\u05D2\u05D4 \u05D6\u05D5.",visualSoldOut:"\u05D0\u05D6\u05DC \u05DE\u05D4\u05DE\u05DC\u05D0\u05D9",visualCartEmpty:"\u05D4\u05E2\u05D2\u05DC\u05D4 \u05E9\u05DC\u05DA \u05E8\u05D9\u05E7\u05D4.",visualQuantity:"\u05DB\u05DE\u05D5\u05EA",visualChoose:"\u05D1\u05D7\u05E8\u05D5",visualDirect:"\u05D9\u05E9\u05D9\u05E8",visualVia:"\u05D3\u05E8\u05DA",visualNight:"\u05DC\u05D9\u05DC\u05D4 \u05D0\u05D7\u05D3",visualNights:"{count} \u05DC\u05D9\u05DC\u05D5\u05EA",visualPerNight:"\u05DC\u05DC\u05D9\u05DC\u05D4",visualTravellers:"\u05E0\u05D5\u05E1\u05E2\u05D9\u05DD",thinking:"\u05D7\u05D5\u05E9\u05D1\u2026",thought:"\u05DE\u05D7\u05E9\u05D1\u05D4",thoughtFor:"\u05D7\u05E9\u05D1 \u05D1\u05DE\u05E9\u05DA {time}",toolResult:"\u05EA\u05D5\u05E6\u05D0\u05D4",sources:"\u05DE\u05E7\u05D5\u05E8\u05D5\u05EA",feedbackUp:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D8\u05D5\u05D1\u05D4",feedbackDown:"\u05EA\u05E9\u05D5\u05D1\u05D4 \u05D2\u05E8\u05D5\u05E2\u05D4",feedbackThanks:"\u05EA\u05D5\u05D3\u05D4 \u05E2\u05DC \u05D4\u05DE\u05E9\u05D5\u05D1",copy:"\u05D4\u05E2\u05EA\u05E7",copied:"\u05D4\u05D5\u05E2\u05EA\u05E7",copyTicketReference:"\u05E4\u05E0\u05D9\u05D9\u05D4 {reference}, \u05D4\u05E2\u05EA\u05E7\u05D4",tabHome:"\u05D1\u05D9\u05EA",tabConversations:"\u05E6\u05F3\u05D0\u05D8\u05D9\u05DD",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",chatUnavailable:"\u05D4\u05E6\u05F3\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05D0\u05D9\u05E0\u05D5 \u05D6\u05DE\u05D9\u05DF \u05DB\u05E8\u05D2\u05E2",moduleBack:"\u05D7\u05D6\u05E8\u05D4",contentLoading:"\u05D8\u05D5\u05E2\u05DF\u2026",contentHelpful:"\u05D4\u05D0\u05DD \u05D6\u05D4 \u05E2\u05D6\u05E8?",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",homeAskPlaceholder:"\u05E9\u05D0\u05DC\u05D5 \u05E9\u05D0\u05DC\u05D4\u2026",homeWhatsNew:"\u05DE\u05D4 \u05D7\u05D3\u05E9",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:"\u05D0\u05D9\u05DF \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA \u05E2\u05D1\u05D5\u05E8 \u201E{query}\u201D",helpShowMore:"\u05D4\u05E6\u05D2\u05EA \u05E2\u05D5\u05D3",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",newsShowMore:"\u05D4\u05E6\u05D2\u05EA \u05E2\u05D5\u05D3",newsUnseen:"\u05E4\u05D5\u05E1\u05D8 \u05D7\u05D3\u05E9",unread:"\u05DC\u05D0 \u05E0\u05E7\u05E8\u05D0",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",formInvalidNumber:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",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",askFallbackQuestion:"\u05D0\u05E0\u05D0 \u05E1\u05E4\u05E7\u05D5 \u05D0\u05EA \u05D4\u05DE\u05D9\u05D3\u05E2 \u05D4\u05D7\u05E1\u05E8.",inputBadge:"\u05E9\u05D0\u05DC\u05D5\u05EA",inputAnswered:"\u05E0\u05E2\u05E0\u05D4",inputSkipped:"\u05D3\u05D5\u05DC\u05D2",showOptions:"\u05D4\u05E6\u05D2 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",hideOptions:"\u05D4\u05E1\u05EA\u05E8 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",qtypeText:"\u05D4\u05EA\u05E9\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA",qtypeEmail:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",qtypePhone:"\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF",qtypeNumber:"\u05DE\u05E1\u05E4\u05E8",qtypeDate:"\u05EA\u05D0\u05E8\u05D9\u05DA",qtypeChooseOne:"\u05D1\u05D7\u05E8 \u05D0\u05D7\u05EA",qtypeChooseAny:"\u05D1\u05D7\u05E8 \u05DB\u05DE\u05D4",qtypeBoolean:"\u05DB\u05DF / \u05DC\u05D0",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",approve:"\u05D0\u05D9\u05E9\u05D5\u05E8",decline:"\u05D3\u05D7\u05D9\u05D9\u05D4",changeAnswer:"\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05EA\u05E9\u05D5\u05D1\u05D4",approvalPrompt:"{action}?",approvalEditHint:"\u05D0\u05E4\u05E9\u05E8 \u05DC\u05E9\u05E0\u05D5\u05EA \u05D0\u05EA \u05D4\u05EA\u05E9\u05D5\u05D1\u05D4 \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05DE\u05E9\u05D9\u05DA.",stepInput:"\u05E7\u05DC\u05D8",stepWorking:"\u05D1\u05D1\u05D9\u05E6\u05D5\u05E2",stepWorkingOnIt:"\u05DE\u05D8\u05E4\u05DC\u05D9\u05DD \u05D1\u05D6\u05D4\u2026",stepNeedsYourApproval:"\u05E0\u05D3\u05E8\u05E9 \u05D4\u05D0\u05D9\u05E9\u05D5\u05E8 \u05E9\u05DC\u05DA",stepWaitingForVisitor:"\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05DE\u05D1\u05E7\u05E8",stepApproved:"\u05D0\u05D5\u05E9\u05E8",stepDeclined:"\u05E0\u05D3\u05D7\u05D4",stepReplaced:"\u05D4\u05D5\u05D7\u05DC\u05E3",stepFailed:"\u05E0\u05DB\u05E9\u05DC",stepDidNotWork:"\u05DC\u05D0 \u05D4\u05E6\u05DC\u05D9\u05D7",decidedYouApproved:"\u05D0\u05D9\u05E9\u05E8\u05EA",decidedYouDeclined:"\u05D3\u05D7\u05D9\u05EA",decidedVisitorApproved:"\u05D0\u05D5\u05E9\u05E8 \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D4\u05DE\u05D1\u05E7\u05E8",decidedVisitorDeclined:"\u05E0\u05D3\u05D7\u05D4 \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D4\u05DE\u05D1\u05E7\u05E8",decidedTeamApproved:"\u05D0\u05D5\u05E9\u05E8 \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D7\u05D1\u05E8 \u05E6\u05D5\u05D5\u05EA",decidedTeamDeclined:"\u05E0\u05D3\u05D7\u05D4 \u05E2\u05DC \u05D9\u05D3\u05D9 \u05D7\u05D1\u05E8 \u05E6\u05D5\u05D5\u05EA",decidedMemberApproved:"\u05D0\u05D5\u05E9\u05E8 \u05E2\u05DC \u05D9\u05D3\u05D9 {name}",decidedMemberDeclined:"\u05E0\u05D3\u05D7\u05D4 \u05E2\u05DC \u05D9\u05D3\u05D9 {name}",stepRawData:"\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD \u05D2\u05D5\u05DC\u05DE\u05D9\u05D9\u05DD",decidedRulesApproved:"\u05D0\u05D5\u05E9\u05E8 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA",decidedRulesDeclined:"\u05E0\u05D3\u05D7\u05D4 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA",edit:"\u05E2\u05E8\u05D9\u05DB\u05D4",toolStepsFailed:"{count} \u05E0\u05DB\u05E9\u05DC\u05D5",statusStopped:"\u05E0\u05E2\u05E6\u05E8",toolStepsStopped:"\u05E0\u05E2\u05E6\u05E8 \u05D0\u05D7\u05E8\u05D9 {count} \u05E9\u05DC\u05D1\u05D9\u05DD",toolStepsStoppedOne:"\u05E0\u05E2\u05E6\u05E8 \u05D0\u05D7\u05E8\u05D9 \u05E9\u05DC\u05D1 \u05D0\u05D7\u05D3"},Eg={attach:"\u6DFB\u52A0\u9644\u4EF6",file:"\u6587\u4EF6",attachmentMimeRejected:"\u6B64\u804A\u5929\u4E0D\u63A5\u53D7 {name} \u7684\u6587\u4EF6\u7C7B\u578B\u3002",attachmentTooLarge:"{name} \u592A\u5927\u4E86\u3002\u6587\u4EF6\u603B\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7 {max}\u3002",poweredBy:"\u7531 {name} \u63D0\u4F9B\u652F\u6301",attachmentTooMany:"\u6700\u591A\u53EF\u6DFB\u52A0 {count} \u4E2A\u9644\u4EF6\u3002",attachmentUploadFailed:"{name} \u4E0A\u4F20\u5931\u8D25\u3002",conversationLoading:"\u6B63\u5728\u52A0\u8F7D\u804A\u5929\u2026",loadPreviousMessages:"\u52A0\u8F7D\u66F4\u65E9\u7684\u6D88\u606F",close:"\u5173\u95ED",collapse:"\u6536\u8D77",collapseSidebar:"\u6536\u8D77\u4FA7\u8FB9\u680F",composerPlaceholder:"\u8F93\u5165\u6D88\u606F\u2026",dateLastWeek:"\u6700\u8FD1 7 \u5929",dateOlder:"\u66F4\u65E9",dateToday:"\u4ECA\u5929",dateYesterday:"\u6628\u5929",dropZone:"\u62D6\u653E\u6587\u4EF6\u4EE5\u6DFB\u52A0\u9644\u4EF6",dropZoneRejected:"\u8FD9\u4E9B\u6587\u4EF6\u65E0\u6CD5\u5728\u6B64\u6DFB\u52A0",errorGeneric:"\u51FA\u4E86\u70B9\u95EE\u9898",errorRateLimited:"\u8BF7\u6C42\u8FC7\u591A\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",errorRateLimitedIn:"\u8BF7\u6C42\u8FC7\u591A\uFF0C\u8BF7\u5728 {seconds} \u79D2\u540E\u91CD\u8BD5\u3002",errorOffline:"\u65E0\u6CD5\u8FDE\u63A5\u670D\u52A1\u5668\u3002\u8BF7\u68C0\u67E5\u7F51\u7EDC\u540E\u91CD\u8BD5\u3002",errorServer:"\u6211\u4EEC\u8FD9\u8FB9\u51FA\u4E86\u70B9\u95EE\u9898\u3002\u8BF7\u91CD\u8BD5\u3002",errorOriginNotAllowed:"\u6B64\u804A\u5929\u5C1A\u672A\u4E3A\u672C\u7F51\u7AD9\u8BBE\u7F6E\u3002",errorMessageTooLong:"\u6D88\u606F\u592A\u957F\u4E86\u3002\u8BF7\u7F29\u77ED\u540E\u91CD\u65B0\u53D1\u9001\u3002",errorReconnecting:"\u8FDE\u63A5\u5DF2\u65AD\u5F00\uFF0C\u6B63\u5728\u91CD\u65B0\u8FDE\u63A5\u2026",errorRetry:"\u91CD\u8BD5",expand:"\u5C55\u5F00",expandSidebar:"\u5C55\u5F00\u4FA7\u8FB9\u680F",exitFullscreen:"\u9000\u51FA\u5168\u5C4F",fullscreen:"\u5168\u5C4F",history:"\u5386\u53F2\u8BB0\u5F55",historyBack:"\u8FD4\u56DE\u804A\u5929",historyEmpty:"\u8FD8\u6CA1\u6709\u4EE5\u524D\u7684\u804A\u5929",historyLoading:"\u6B63\u5728\u52A0\u8F7D\u4F60\u7684\u804A\u5929\u2026",historyContinue:"\u7EE7\u7EED\u804A\u5929",historyTitle:"\u804A\u5929\u8BB0\u5F55",loadMoreConversations:"\u52A0\u8F7D\u66F4\u591A\u5BF9\u8BDD",language:"\u8BED\u8A00",launcherOpen:"\u6253\u5F00\u804A\u5929",launcherAsk:"\u8BE2\u95EE {name}",micBlocked:"\u6B64\u7F51\u7AD9\u7684\u9EA6\u514B\u98CE\u5DF2\u88AB\u963B\u6B62\uFF0C\u65E0\u6CD5\u5F00\u59CB\u8BED\u97F3\u8F93\u5165\u3002",micStart:"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165",micStop:"\u505C\u6B62\u8BED\u97F3\u8F93\u5165",moreActions:"\u66F4\u591A\u64CD\u4F5C",newConversation:"\u65B0\u804A\u5929",panelTitle:"\u804A\u5929",popOut:"\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00",resizeHandle:"\u62D6\u52A8\u4EE5\u8C03\u6574\u5927\u5C0F",scrollToBottom:"\u6EDA\u52A8\u5230\u6700\u65B0",send:"\u53D1\u9001",queueMessage:"\u6392\u961F\u53D1\u9001",removeQueuedMessage:"\u79FB\u9664\u6392\u961F\u7684\u6D88\u606F",removeAttachment:"\u79FB\u9664 {name}",suggestedReplies:"\u63A8\u8350\u56DE\u590D",compactingContext:"\u6B63\u5728\u4F18\u5316\u5BF9\u8BDD\u4E0A\u4E0B\u6587\u2026",soundOff:"\u5173\u95ED\u58F0\u97F3",soundOn:"\u6253\u5F00\u58F0\u97F3",talkToOperator:"\u4E0E\u771F\u4EBA\u4EA4\u8C08",connectingOperator:"\u6B63\u5728\u4E3A\u4F60\u8054\u7CFB\u771F\u4EBA\u2026",noOperatorAvailable:"\u76EE\u524D\u6CA1\u6709\u4EBA\u6709\u7A7A\uFF0C\u8BF7\u7559\u4E0B\u4F60\u7684\u8054\u7CFB\u65B9\u5F0F\uFF0C\u6211\u4EEC\u4F1A\u8DDF\u8FDB\u3002",chattingWithOperator:"\u4F60\u6B63\u5728\u4E0E {operator} \u804A\u5929",operatorBadgeTitle:"\u5728\u7EBF\u804A\u5929",chatNotice:"\u4F60\u6B63\u5728\u4E0E AI \u52A9\u624B\u804A\u5929\u3002",cancelOperatorRequest:"\u7EE7\u7EED\u4E0E AI \u804A\u5929",loginPrompt:"\u767B\u5F55\u4EE5\u83B7\u5F97\u66F4\u5FEB\u3001\u66F4\u4E2A\u6027\u5316\u7684\u652F\u6301",loginAction:"\u767B\u5F55",loginRequired:"\u767B\u5F55\u540E\u4E0E\u6211\u4EEC\u804A\u5929",loginExpired:"\u4F60\u7684\u767B\u5F55\u5DF2\u8FC7\u671F\u3002\u8BF7\u767B\u5F55\u4EE5\u7EE7\u7EED\u6B64\u804A\u5929\u3002",loginExpiredGuest:"\u4F60\u7684\u767B\u5F55\u5DF2\u8FC7\u671F\u3002\u8BF7\u767B\u5F55\u4EE5\u7EE7\u7EED\u6B64\u804A\u5929\uFF0C\u6216\u4EE5\u8BBF\u5BA2\u8EAB\u4EFD\u5F00\u59CB\u65B0\u5BF9\u8BDD\u3002",startAsGuest:"\u5F00\u59CB\u65B0\u5BF9\u8BDD",loggedInAs:"\u5DF2\u767B\u5F55\u4E3A {name}",loggedIn:"\u5DF2\u767B\u5F55",dismissLoginPrompt:"\u9690\u85CF",emailTranscript:"\u901A\u8FC7\u90AE\u4EF6\u53D1\u9001\u804A\u5929\u8BB0\u5F55",emailTranscriptPrompt:"\u901A\u8FC7\u90AE\u4EF6\u83B7\u53D6\u6B64\u5BF9\u8BDD\u7684\u526F\u672C\u3002",emailTranscriptEmailLabel:"\u90AE\u7BB1\u5730\u5740",emailTranscriptSend:"\u53D1\u9001\u804A\u5929\u8BB0\u5F55",emailTranscriptSending:"\u6B63\u5728\u53D1\u9001\u2026",emailTranscriptSent:"\u5DF2\u53D1\u9001\u81F3 {email}\u3002",emailTranscriptAlreadySent:"\u6B64\u5BF9\u8BDD\u5DF2\u901A\u8FC7\u90AE\u4EF6\u53D1\u9001\u3002\u53D1\u9001\u4E00\u6761\u65B0\u6D88\u606F\u540E\u53EF\u518D\u6B21\u53D1\u9001\u3002",emailTranscriptLimited:"\u4F60\u5DF2\u8FBE\u5230\u5F53\u524D\u4E0A\u9650\u3002\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",emailTranscriptFailed:"\u53D1\u9001\u5931\u8D25\u3002\u8BF7\u91CD\u8BD5\u3002",emailTranscriptNotDelivered:"\u65E0\u6CD5\u53D1\u9001\u5230\u6B64\u5730\u5740\u3002\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5\u3002",emailTranscriptCancel:"\u53D6\u6D88",emailTranscriptDone:"\u5B8C\u6210",stop:"\u505C\u6B62",theme:"\u4E3B\u9898",themeAuto:"\u81EA\u52A8",themeDark:"\u6DF1\u8272",themeLight:"\u6D45\u8272",textSize:"\u6587\u5B57\u5927\u5C0F",textSizeSmall:"\u5C0F",textSizeNormal:"\u6807\u51C6",textSizeLarge:"\u5927",loading:"\u6B63\u5728\u52A0\u8F7D\u2026",visualPreparing:"\u6B63\u5728\u51C6\u5907\u56FE\u8868\u2026",visualError:"\u65E0\u6CD5\u663E\u793A\u6B64\u56FE\u8868\u3002",visualPartial:"\u6B64\u56FE\u8868\u7684\u90E8\u5206\u5185\u5BB9\u65E0\u6CD5\u663E\u793A\u3002",visualSoldOut:"\u5DF2\u552E\u7F44",visualCartEmpty:"\u4F60\u7684\u8D2D\u7269\u8F66\u662F\u7A7A\u7684\u3002",visualQuantity:"\u6570\u91CF",visualChoose:"\u9009\u62E9",visualDirect:"\u76F4\u98DE",visualVia:"\u7ECF\u505C",visualNight:"1 \u665A",visualNights:"{count} \u665A",visualPerNight:"\u6BCF\u665A",visualTravellers:"\u65C5\u5BA2",thinking:"\u6B63\u5728\u601D\u8003\u2026",thought:"\u601D\u8003\u8FC7\u7A0B",thoughtFor:"\u601D\u8003\u4E86 {time}",toolResult:"\u7ED3\u679C",sources:"\u6765\u6E90",feedbackUp:"\u56DE\u7B54\u5F88\u597D",feedbackDown:"\u56DE\u7B54\u4E0D\u597D",feedbackThanks:"\u611F\u8C22\u4F60\u7684\u53CD\u9988",copy:"\u590D\u5236",copied:"\u5DF2\u590D\u5236",copyTicketReference:"\u5DE5\u5355 {reference}\uFF0C\u590D\u5236",tabHome:"\u9996\u9875",tabConversations:"\u804A\u5929",tabHelp:"\u5E2E\u52A9",tabNews:"\u52A8\u6001",modulesEmpty:"\u8FD9\u91CC\u8FD8\u6CA1\u6709\u5185\u5BB9",chatUnavailable:"\u6B64\u804A\u5929\u76EE\u524D\u4E0D\u53EF\u7528",moduleBack:"\u8FD4\u56DE",contentLoading:"\u6B63\u5728\u52A0\u8F7D\u2026",contentHelpful:"\u8FD9\u5BF9\u4F60\u6709\u5E2E\u52A9\u5417\uFF1F",homeGreeting:"\u6709\u4EC0\u4E48\u53EF\u4EE5\u5E2E\u4F60\uFF1F",homeGreetingNamed:"\u4F60\u597D\uFF0C{name} \u{1F44B}",homeGreetingLead:"\u6709\u4EC0\u4E48\u53EF\u4EE5\u5E2E\u4F60\uFF1F",homeSearchPlaceholder:"\u641C\u7D22\u5E2E\u52A9",homeAskPlaceholder:"\u63D0\u51FA\u95EE\u9898\u2026",homeWhatsNew:"\u6700\u65B0\u52A8\u6001",homeContentTitle:"\u70ED\u95E8\u6587\u7AE0",homeStatus:"\u72B6\u6001",helpTitle:"\u5E2E\u52A9",helpSearchPlaceholder:"\u641C\u7D22\u5E2E\u52A9",helpEmpty:"\u8FD8\u6CA1\u6709\u5E2E\u52A9\u6587\u7AE0",helpLoading:"\u6B63\u5728\u52A0\u8F7D\u5E2E\u52A9\u2026",helpSearchEmpty:"\u6CA1\u6709\u627E\u5230\u201C{query}\u201D\u7684\u7ED3\u679C",helpShowMore:"\u663E\u793A\u66F4\u591A",newsTitle:"\u52A8\u6001",newsEmpty:"\u8FD8\u6CA1\u6709\u52A8\u6001",newsLoading:"\u6B63\u5728\u52A0\u8F7D\u52A8\u6001\u2026",newsShowMore:"\u663E\u793A\u66F4\u591A",newsUnseen:"\u65B0\u6587\u7AE0",unread:"\u672A\u8BFB",formRequired:"\u6B64\u9879\u4E3A\u5FC5\u586B",formInvalidEmail:"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u90AE\u7BB1\u5730\u5740",formInvalidTel:"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u7535\u8BDD\u53F7\u7801",formInvalidNumber:"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u6570\u5B57",formOtherPlaceholder:"\u8F93\u5165\u4F60\u7684\u56DE\u7B54\u2026",inputRequired:"\u9700\u8981\u4F60\u56DE\u7B54\u7684\u95EE\u9898",askFallbackQuestion:"\u8BF7\u63D0\u4F9B\u7F3A\u5C11\u7684\u4FE1\u606F\u3002",inputBadge:"\u95EE\u9898",inputAnswered:"\u5DF2\u56DE\u7B54",inputSkipped:"\u5DF2\u8DF3\u8FC7",showOptions:"\u663E\u793A\u9009\u9879",hideOptions:"\u9690\u85CF\u9009\u9879",qtypeText:"\u4F60\u7684\u56DE\u7B54",qtypeEmail:"\u90AE\u7BB1\u5730\u5740",qtypePhone:"\u7535\u8BDD\u53F7\u7801",qtypeNumber:"\u6570\u5B57",qtypeDate:"\u65E5\u671F",qtypeChooseOne:"\u9009\u62E9\u4E00\u9879",qtypeChooseAny:"\u53EF\u591A\u9009",qtypeBoolean:"\u662F / \u5426",inputSubmit:"\u63D0\u4EA4\u56DE\u7B54",inputSubmitHint:"Enter \u53D1\u9001 \xB7 Shift+Enter \u6362\u884C",inputSkip:"\u8DF3\u8FC7",confirmYes:"\u662F",confirmNo:"\u5426",approve:"\u6279\u51C6",decline:"\u62D2\u7EDD",changeAnswer:"\u4FEE\u6539\u56DE\u7B54",approvalPrompt:"{action}\uFF1F",approvalEditHint:"\u5728\u6B64\u6B65\u9AA4\u7EE7\u7EED\u4E4B\u524D\uFF0C\u4F60\u53EF\u4EE5\u4FEE\u6539\u56DE\u7B54\u3002",stepInput:"\u8F93\u5165",stepWorking:"\u8FDB\u884C\u4E2D",stepWorkingOnIt:"\u6B63\u5728\u5904\u7406\u2026",stepNeedsYourApproval:"\u9700\u8981\u4F60\u7684\u6279\u51C6",stepWaitingForVisitor:"\u7B49\u5F85\u8BBF\u5BA2",stepApproved:"\u5DF2\u6279\u51C6",stepDeclined:"\u5DF2\u62D2\u7EDD",stepReplaced:"\u5DF2\u66FF\u6362",stepFailed:"\u5931\u8D25",stepDidNotWork:"\u672A\u6210\u529F",decidedYouApproved:"\u4F60\u5DF2\u6279\u51C6",decidedYouDeclined:"\u4F60\u5DF2\u62D2\u7EDD",decidedVisitorApproved:"\u8BBF\u5BA2\u5DF2\u6279\u51C6",decidedVisitorDeclined:"\u8BBF\u5BA2\u5DF2\u62D2\u7EDD",decidedTeamApproved:"\u56E2\u961F\u6210\u5458\u5DF2\u6279\u51C6",decidedTeamDeclined:"\u56E2\u961F\u6210\u5458\u5DF2\u62D2\u7EDD",decidedMemberApproved:"{name} \u5DF2\u6279\u51C6",decidedMemberDeclined:"{name} \u5DF2\u62D2\u7EDD",stepRawData:"\u539F\u59CB\u6570\u636E",decidedRulesApproved:"\u5DF2\u81EA\u52A8\u6279\u51C6",decidedRulesDeclined:"\u5DF2\u81EA\u52A8\u62D2\u7EDD",edit:"\u7F16\u8F91",toolStepsFailed:"{count} \u4E2A\u5931\u8D25",statusStopped:"\u5DF2\u505C\u6B62",toolStepsStopped:"\u5728 {count} \u6B65\u540E\u505C\u6B62",toolStepsStoppedOne:"\u5728 1 \u6B65\u540E\u505C\u6B62"},Mg={en:ii,fr:Tg,es:Ag,ar:Rg,he:Ig,zh:Eg};function ai(e,t){let n=qc(e),r=li(t),o=Mg[Fc(n)],i=r?{...t[n],...t[e]}:t??{},s=r?t.en??{}:{};return{...ii,...o,...s,...i}}function qc(e){return(e.split("-")[0]??"en").toLowerCase()}var Lg=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function si(e){return Lg.has(qc(e))}function at(e,t){return e[t]??t}function li(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}var O={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 Vc=["decided","auto-decided","unasked","failed"],ci=["platform","mcp","api","webmcp"],Og=["none","values","table","json","table-and-json"];function Wc(e,t){return typeof t=="string"&&e.some(n=>n===t)}var Ng={visitor:{stepsFrom:ci,stepsShown:[],stepDetails:"values",showStepSystem:!1,showDecidedBy:!1,foldApprovals:!0},member:{stepsFrom:ci,stepsShown:Vc,stepDetails:"table-and-json",showStepSystem:!0,showDecidedBy:!0,foldApprovals:!0}},$g=["showStepSystem","showDecidedBy","foldApprovals"];function Gc(e){let t={};if(typeof e!="object"||e===null)return t;for(let i of $g){let s=Reflect.get(e,i);typeof s=="boolean"&&(t[i]=s)}let n=Reflect.get(e,"stepsFrom");Array.isArray(n)&&(t.stepsFrom=ci.filter(i=>n.includes(i)));let r=Reflect.get(e,"stepsShown");Array.isArray(r)&&(t.stepsShown=Vc.filter(i=>r.includes(i)));let o=Reflect.get(e,"stepDetails");return Wc(Og,o)&&(t.stepDetails=o),t}function Kc(e,t){return{...Ng[t],...e}}var Qc=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Dg=4e3;function fs(e){let t=e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim().toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function Bg(e){if(e.title)return e.title;let t=e.toolName.replace(/^tool[:-]/,""),n=t.indexOf("__");return fs(n>0?t.slice(n+2):t)}function Ug(e,t,n){let r=e.approval;return r?.replacedByMessageId?"replaced":e.state==="output-available"?n.error===void 0?"done":"failed":e.state==="output-error"?t.interrupted?"stopped":"failed":e.state==="output-denied"||r?.approved===!1?"declined":e.state==="approval-responded"||r?.approved===!0?t.cutOff?"stopped":"approved":e.state==="approval-requested"?t.submitted?"submitted":t.cutOff?"stopped":t.superseded?"replaced":"waiting":t.live?"running":"stopped"}function zg(e,t){if(e.isAutomatic)return"rules";let n=e.respondedBy;return n?.visitorId?"visitor":n?.userId?n.userId===t.userId?"you":"teamMember":t.decides?"you":"visitor"}function Fg(e,t,n,r,o){let i=r[t?"inputAnswered":"inputSkipped"];if(o)return{label:i,title:i};let s=r[t?"stepApproved":"stepDeclined"];if(e==="teamMember"&&n)return{label:s,title:r[t?"decidedMemberApproved":"decidedMemberDeclined"].replace("{name}",n)};let l=r[qg[e][t?0:1]];return e==="you"?{label:s,title:l}:{label:l,title:l}}var qg={you:["decidedYouApproved","decidedYouDeclined"],visitor:["decidedVisitorApproved","decidedVisitorDeclined"],teamMember:["decidedTeamApproved","decidedTeamDeclined"],rules:["decidedRulesApproved","decidedRulesDeclined"]};function Hg(e,t){switch(e){case"running":return t.strings.stepWorking;case"waiting":return t.reader.decides?t.strings.stepNeedsYourApproval:t.strings.stepWaitingForVisitor;case"submitted":return t.strings.stepWorkingOnIt;case"approved":return t.strings.stepApproved;case"declined":return t.card?t.strings.inputSkipped:t.strings.stepDeclined;case"replaced":return t.card?t.strings.inputSkipped:t.strings.stepReplaced;case"stopped":return t.strings.statusStopped;case"failed":return t.plain?t.strings.stepDidNotWork:t.strings.stepFailed;case"done":return"";default:return e}}function Nt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Yc(e){return typeof e=="string"?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):""}function Hc(e){return Yc(e)||(e!==null&&typeof e=="object"?JSON.stringify(e):"")}function jg(e){if(!Nt(e))return Hc(e);let[t,...n]=Object.values(e).map(Hc).filter(Boolean);return t===void 0?"":n.length>0?`${t} (${n.join(", ")})`:t}function jc(e,t){if(!Nt(e))return[];let n=[];function r(i,s){if(Array.isArray(i)){let c=i.map(jg).filter(Boolean).join(", ");c&&n.push({path:s,value:c});return}if(Nt(i)){for(let[c,u]of Object.entries(i))r(u,[...s,c]);return}let l=Yc(i);l&&(t.withIds||!Qc.test(l))&&n.push({path:s,value:l})}r(e,[]);let o=n.map(({path:i})=>fs(i.at(-1)??""));return n.map(({path:i,value:s},l)=>{let c=o[l]??"";return{label:o.filter(p=>p===c).length>1&&i.length>1?`${fs(i.at(-2)??"")} \xB7 ${c.toLowerCase()}`:c,value:s}})}function Vg(e,t){if(Nt(e))return Object.entries(e).find(n=>n[0]!==t&&typeof n[1]=="string"&&n[1].trim().length>0&&!Qc.test(n[1].trim()))?.[1].trim()}function Wg(e){if(typeof e.toolMetadata?.system=="string")return e.toolMetadata.system;let t=e.toolMetadata?.systemField,n=typeof t=="string"&&Nt(e.input)?e.input[t]:void 0;return typeof n=="string"&&n.trim()?n.trim():void 0}function di(e,t=Number.POSITIVE_INFINITY){if(e==null)return;let n=typeof e=="string"?e:JSON.stringify(e,null,2);if(!(!n||n==="{}"||n==="[]"||n==='""'))return n.length>t?`${n.slice(0,t)}\u2026`:n}function Gg(e){let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return e;try{return JSON.parse(t)}catch{return e}}function Jc(e){if(Nt(e)&&e.storage==="tool-result-ref"&&"summary"in e)return Jc(e.summary);if(Nt(e)&&Array.isArray(e.content)){let t=e.content.flatMap(r=>Nt(r)&&typeof r.text=="string"?[r.text]:[]).join(`
|
|
2
|
+
`),n=Nt(e.structuredContent)?e.structuredContent:Gg(t);return e.isError===!0?{value:n,error:Nt(n)&&typeof n.error=="string"?n.error:t}:{value:n}}return Nt(e)&&typeof e.error=="string"&&typeof e.instruction=="string"?{value:e,error:e.error}:{value:e}}function Kg(e){return di(e.input)!==void 0||di(e.output)!==void 0||!!e.errorText}function Qg(e,t){let n=e.approval?"decided":"unasked",r=e.approval?.isAutomatic?"auto-decided":n;return t==="failed"?[r,"failed"]:[r]}function Yg(e){let t=e.toolMetadata?.origin;return Wc(ci,t)?t:void 0}function Jg(e,t,n){let{display:r}=n,o=e.approval,i=o!==void 0&&!o.isAutomatic;if(i&&ms(e,n.turn))return"card";let s=n.by==="you"||i&&n.by===void 0&&n.reader.decides,l=Yg(e),c=(l===void 0||r.stepsFrom.includes(l))&&Qg(e,t.status).some(u=>r.stepsShown.includes(u));return!(s||c)||!o&&!Kg(e)?"hidden":i&&!r.foldApprovals?"card":"step"}function ms(e,t){return e.approval?.replacedByMessageId||(t.superseded||t.cutOff)&&e.approval?.approved===void 0?!1:e.state==="approval-requested"||e.state==="approval-responded"}function Xc(e,t){let{turn:n,reader:r,display:o,strings:i}=t,s=Jc(e.output),l=Ug(e,n,s),c=e.approval,u=c!==void 0&&!c.isAutomatic,p=typeof e.toolMetadata?.card=="string"?e.toolMetadata.card:void 0,_=o.stepDetails,d=_==="table"||_==="table-and-json",f=_==="none"||_==="values",v=c?.replacedByMessageId?void 0:c?.approved,m=c&&v!==void 0?zg(c,r):void 0,b=m==="teamMember"?c?.respondedBy?.userId:void 0,w=m&&v!==void 0&&(m==="you"||m==="rules"||o.showDecidedBy)?{approved:v,by:m,...Fg(m,v,b&&t.names?.get(b),i,p!==void 0),...b?{userId:b}:{}}:void 0,y=Bg(e),P=o.showStepSystem||e.toolMetadata?.nameShared===!0?Wg(e):void 0,C=Vg(e.input,typeof e.toolMetadata?.systemField=="string"?e.toolMetadata.systemField:void 0),x=e.errorText??s.error,g=d&&s.error===void 0?jc(s.value,{withIds:!0}):[],h=_==="json"||_==="table-and-json"?{input:di(e.input),output:di(s.value,Dg)}:void 0,k=u&&ms(e,n),$=_==="none"&&!k?[]:jc(e.input,{withIds:d||k}),I=x!==void 0&&x!==""&&!f,B=Nt(c?.descriptor)&&Nt(c.descriptor.decision)?c.descriptor.decision:void 0,A=_!=="none"||k?B:void 0,z=w!==void 0&&(l==="approved"||l==="declined"),j={toolCallId:e.toolCallId,placement:"hidden",...p&&c?{card:p}:{},name:y,...P?{system:P}:{},status:l,statusLabel:z?"":Hg(l,{reader:r,strings:i,card:p!==void 0,plain:f}),...w?{decision:w}:{},...A?{why:A}:{},...C?{summary:C}:{},fields:$,tables:d,...g.length>0?{resultFields:g}:{},...I?{error:x}:{},...h?{raw:h}:{},opens:$.length>0||g.length>0||h!==void 0||I||A!==void 0,...u&&!p?{approval:Xg(e,l,{turn:n,reader:r,strings:i,name:y})}:{}};return{...j,placement:Jg(e,j,{turn:n,reader:r,display:o,by:m})}}function Xg(e,t,n){let r=n.strings.approvalPrompt.replace("{action}",n.name);return t==="waiting"?{ask:r,buttons:n.reader.decides?"decide":"none"}:t==="submitted"?{ask:r,buttons:"none"}:ms(e,n.turn)?n.turn.canAct&&n.reader.decides?{ask:r,buttons:"change",note:n.strings.approvalEditHint}:t==="approved"?{ask:r,buttons:"none",note:n.strings.stepWorkingOnIt}:{ask:r,buttons:"none"}:{ask:r,buttons:"none"}}function Zc(e){let t=new Map;for(let i of e)t.set(i.name,(t.get(i.name)??0)+1);let n=new Map;for(let{decision:i}of e){if(!i)continue;let s=n.get(i.title)??{approved:i.approved,label:i.label,title:i.title,...i.userId?{userId:i.userId}:{},count:0};n.set(i.title,{...s,count:s.count+1})}let[r]=e,o=e.some(i=>i.status==="stopped");return{tools:[...t].map(([i,s])=>({name:i,count:s})),...e.length===1&&r?{single:{name:r.name,...r.system?{system:r.system}:{},...r.summary?{summary:r.summary}:{},...Zg(r)}}:{},marks:[...n.values()].map(({count:i,...s})=>Object.assign(s,{label:i>1?`${s.label} \xD7${i}`:s.label})),failed:e.filter(i=>i.status==="failed").length,...o?{stopped:{finished:e.filter(i=>i.status!=="stopped").length}}:{}}}function Zg(e){return!e.decision&&(e.status==="replaced"||e.status==="declined")?{outcome:e.statusLabel}:{}}function ed(e,t){return e===0?t.statusStopped:e===1?t.toolStepsStoppedOne:t.toolStepsStopped.replace("{count}",String(e))}var gs=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{}}},ui=new gs,Dn={get(e){try{return sessionStorage.getItem(e)}catch{return null}},set(e,t){try{sessionStorage.setItem(e,t)}catch{}},remove(e){try{sessionStorage.removeItem(e)}catch{}}};var pi={maxBytes:10485760,maxCount:10,accept:"*/*"},td={voice:"local"},hs={enabled:!0,sampleRate:1},vs={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio"},_r={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},nd={floating:["theme","textSize","history","close","clear","expand","fullscreen","popOut","sound","language"],inline:["theme","textSize","history","close","clear","fullscreen","popOut","sound","language"],standalone:["theme","textSize","history","clear","sound","language"],page:["theme","textSize","history","clear","sound","language"],modal:["theme","textSize","history","close","clear","fullscreen","popOut","sound","language"],drawer:["theme","textSize","history","close","clear","fullscreen","popOut","sound","language"]},bs={enabled:!0,volume:.3,events:void 0},rd={enabled:!0,events:void 0},od=[{label:"tabConversations",layout:"chat"}];var eh=["off","error","warn","info","debug","trace"],ys=O.cssPrefix,th=`${ys}.debug`,nh=`__${O.global}_DEBUG__`,rh=`${ys}-debug`,sd=2,id=null;function oh(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(rh);if(e!==null){let t=ad(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(th);if(e){let t=ad(e);if(t>=0)return t}}catch{}return Reflect.get(window,nh)?4:2}function ad(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=eh.findIndex(n=>n===e);if(t>=0)return t}return-1}sd=oh();function ld(e){let t=`[${ys}:${e}]`;function n(r,o,i){return(s,l)=>{if(!(sd<r)&&(l===void 0?console[o](t,s):console[o](t,s,l),id))try{id({level:i,scope:e,message:s,payload:l})}catch{}}}return{error:n(1,"error","error"),warn:n(2,"warn","warn"),info:n(3,"info","info"),debug:n(4,"debug","debug"),trace:n(5,"debug","trace"),scope:r=>ld(`${e}:${r}`)}}var oe=ld("core");var Bn=oe.scope("context"),ih=new Set(["visitorId","conversationId","jwt","token","authorization","password"]),cd=50,Ps=1024,ah=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function xs(e){return dd(e,"userContext",!0)}function Ss(e){return dd(e,"pageContext",!1)}function sh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function dd(e,t,n){if(e==null)return;if(!sh(e)){Bn.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let r={},o=0;for(let[i,s]of Object.entries(e)){if(ih.has(i)){Bn.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(s==null)continue;if(o>=cd){Bn.warn(`${t} truncated at ${cd} keys \u2014 dropped "${i}"`);continue}let l=lh(t,i,s);l!==void 0&&(r[i]=l,o++)}return n&&typeof r.email=="string"&&!ah.test(r.email)&&(Bn.warn("dropped malformed context field",{field:`${t}.email`,reason:"invalid format"}),delete r.email),Object.keys(r).length>0?r:void 0}function lh(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){Bn.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let r=n.trim();return r===""?void 0:r.length>Ps?(Bn.warn(`truncated ${e}.${t} to ${Ps} chars`),r.slice(0,Ps)):r}Bn.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}function fr(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},r=t.behavior??{},o=t.i18n??{},i=t.feedback??{},s=t.footer??{},l=t.header??{},c={enabled:t.history?.enabled??!0},{themeMode:u,themeOverrides:p}=ch(t.theme),_=n.mode??"floating",d=dh(o.defaultLocale),f=o.availableLocales??[o.locale??d],v=mr(o.locale??d,f,d),m=(t.baseUrl??O.defaultBaseUrl).replace(/\/$/,""),b=(t.agentApiBaseUrl??`${m}/api/agent`).replace(/\/$/,""),w=(t.dataApiBaseUrl??`${m}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:m,agentApiBaseUrl:b,dataApiBaseUrl:w,userContext:xs(t.userContext),pageContext:Ss(t.pageContext),position:n.position??(si(v)?"bottom-left":"bottom-right"),themeMode:u,textSize:"normal",themeOverrides:p,mode:_,responseMode:r.responseMode??"streaming",showReasoning:r.showReasoning??!1,stepDisplay:Kc(r.stepDisplay,"visitor"),showSources:r.showSources??!1,enableMessageFeedback:!(r.disableMessageFeedback??!1),autoSendSuggestions:r.autoSendSuggestions??!1,cardAnswerWaitSeconds:r.cardAnswerWaitSeconds??60,popOutUrl:r.popOutUrl,features:{voice:t.features?.voice??td.voice,fileUpload:!(t.features?.disableFileUpload??!1),humanInLoop:!(t.features?.disableHumanInLoop??!1),emailTranscript:!(t.features?.disableEmailTranscript??!1),operatorRequest:t.features?.enableOperatorRequest===!0&&!(t.features.hideRequestOperatorButton??!1)},endpoints:{upload:t.endpoints?.upload??vs.upload,transcribe:t.endpoints?.transcribe??vs.transcribe},attachments:{accept:t.composer?.attachments?.accept??pi.accept,maxBytes:t.composer?.attachments?.maxBytes??pi.maxBytes,maxCount:t.composer?.attachments?.maxCount??pi.maxCount},locale:v,defaultLocale:d,availableLocales:f,startMinimized:r.startMinimized??!0,actions:uh(_,l.actions,c.enabled),size:{...n.size,resize:{...n.size?.resize,enabled:n.size?.resize?.enabled??!0}},launcher:vh(t.launcher,t.agent?.name),sound:ph(i.sound),haptics:_h(i.haptics),strings:ai(v,o.strings),stringsOverride:o.strings,composerDisclaimer:s.composerDisclaimer??"",header:{variant:l.variant??"plain",notice:l.notice,showNotice:!(l.hideNotice??!1)},poweredBy:mh(s.poweredBy),composer:gh(t.composer),modules:hh(t.modules,c.enabled),tracking:fh(t.tracking,w),history:c,storage:t.storage??ui,userToken:t.userToken,continueLink:t.continueLink,tools:t.tools,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function ch(e){if(typeof e=="string")return{themeMode:e,themeOverrides:{}};if(!e||typeof e!="object")return{themeMode:"host",themeOverrides:{}};let{mode:t,...n}=e;return{themeMode:t??"host",themeOverrides:n}}function dh(e){return e&&e!=="auto"?e:globalThis.navigator?.language||"en"}function mr(e,t,n){if(t.length<=1||t.includes(e))return e;let r=e.split("-")[0];return r&&t.includes(r)?r:t.includes(n)?n:t[0]??e}function uh(e,t,n){let r=t??nd[e];return n?r:r.filter(o=>o!=="history")}function ph(e){return{enabled:e?.enabled??bs.enabled,volume:e?.volume??bs.volume,events:e?.events}}function _h(e){return{enabled:e?.enabled??rd.enabled,events:e?.events}}function fh(e,t){let n=e?.sampleRate??hs.sampleRate;return{enabled:e?.enabled??hs.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 mh(e){return e?.text===""&&!e.logoUrl?null:{href:O.siteUrl,...e}}function gh(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function hh(e,t){let n=(e??od).slice(0,4),r=n.some(l=>l?.label&&l.layout==="help"),o=new Set,i=[];for(let l of n){if(!l?.label||!l?.layout)continue;let c=l.contentCollectionIds?.filter(Boolean),u=l.id??c?.[0]??l.layout;for(;o.has(u);)u=`${u}-${i.length}`;o.add(u);let p={id:u,label:l.label,layout:l.layout};c?.length&&(p.contentCollectionIds=c),l.layout==="home"&&(p.brandName=l.brandName,p.greetingText=l.greetingText,p.showGreeting=!(l.hideGreeting??!1),p.showSearchBar=r&&!(l.hideSearchBar??!1),p.showRecentConversations=t&&!(l.hideRecentConversations??!1),l.userAvatars?.length&&(p.userAvatars=l.userAvatars),l.status&&(p.status=l.status),p.contentBlockTitle=l.contentBlockTitle),i.push(p)}let s=Object.fromEntries(i.map(l=>[l.id,l]));return{list:i,byId:s}}function vh(e,t){let n=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??_r.variant,size:e?.size??_r.size,label:e?.label??_r.label,icon:e?.icon??_r.icon,hidden:e?.hidden??_r.hidden,...t&&{personaName:t},callout:n}}function Vr(e,t){return e==="host"?"host":t??e}function ws(e,t,n,r){let o=mr(t,e.availableLocales,e.defaultLocale);if(o===e.locale&&n===e.themeMode&&r===e.textSize)return e;let i={...e};return o!==e.locale&&(i.locale=o,i.strings=ai(o,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),r!==e.textSize&&(i.textSize=r),i}function _i(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var bh=["agent","presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints","history"];function ks(e,t){if(!t)return e;let n={...e};for(let i of bh){let s=t[i];if(s===void 0)continue;let l=e[i];if(i==="theme"){l===void 0?n[i]=s:typeof l=="string"&&typeof s=="object"&&s!==null&&(n[i]={...s,mode:l});continue}i!=="i18n"&&(n[i]=ud(_i(s)?s:{},_i(l)?l:void 0))}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,o=t.i18n;if(r||o){let i=ud(_i(o)?o:{},_i(r)?r:void 0);o?.availableLocales!==void 0&&(i.availableLocales=o.availableLocales),o?.defaultLocale!==void 0&&(i.defaultLocale=o.defaultLocale);let s=r?.strings,l=o?.strings;(s||l)&&(i.strings=yh(l,s)),n.i18n=i}return n}function ud(e,t){if(!t)return e;let n={...e};for(let[r,o]of Object.entries(t))o!==void 0&&(n[r]=o);return n}function yh(e,t){if(!e)return t;if(!t)return e;let n=li(e),r=li(t);if(!n&&!r)return{...e,...t};let o={},i=n?e:{en:e},s=r?t:{en:t};for(let[l,c]of Object.entries(i))o[l]={...c};for(let[l,c]of Object.entries(s))o[l]={...o[l],...c};return o}var Ph=["clear","expand","fullscreen","popOut","sound","history","language","theme","textSize","close"];function xh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function gn(e){return e!=="false"}function Sh(e){try{return Gc(JSON.parse(e))}catch{return}}function wh(e){let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=0?t:void 0}function kh(e){return e.split(",").map(t=>t.trim()).filter(Boolean)}var _d=[["public-key","publicKey"],["ai-agent-deployment-id","aiAgentDeploymentId"],["base-url","baseUrl"],["agent-api-base-url","agentApiBaseUrl"],["data-api-base-url","dataApiBaseUrl"],["continue-link","continueLink"],["theme","theme",e=>e]],fd=[["mode","mode",e=>e],["position","position",e=>e]],md=[["width","width"],["height","height"]],gd=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",gn],["show-reasoning","showReasoning",gn],["step-display","stepDisplay",Sh],["show-sources","showSources",gn],["disable-message-feedback","disableMessageFeedback",gn],["auto-send-suggestions","autoSendSuggestions",gn],["card-answer-wait-seconds","cardAnswerWaitSeconds",wh],["pop-out-url","popOutUrl"]],hd=[["locale","locale"]],Ch=new Set(Ph);function Th(e){return kh(e).filter(t=>Ch.has(t))}var vd=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",gn]],bd=[["features-disable-file-upload","disableFileUpload",gn],["features-disable-email-transcript","disableEmailTranscript",gn],["features-voice","voice",e=>e]],yd=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Pd=[["user-id","id"],["user-email","email"],["user-name","name"]],xd=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],Rh=["launcher-label","callout-text","callout-delay","actions","user-context","page-context"],Ah=[_d,fd,md,gd,hd,vd,bd,yd,Pd,xd],Ih=new Set(["start-minimized"]),Cs=[...Ah.flatMap(e=>e.map(([t])=>t).filter(t=>!Ih.has(t))),...Rh];function Ts(e){let t={};function n(f){let v=e(f);return v===null||v===""?void 0:v}for(let[f,v,m]of _d){let b=n(f);b!==void 0&&Reflect.set(t,v,m?m(b):b)}let r=Un(n,fd),o=Un(n,md);(r||o)&&(t.presentation={...r,...o?{size:o}:{}});let i=Un(n,gd);i&&(t.behavior=i);let s=Un(n,hd);s&&(t.i18n=s);let l=Eh(e,n);l&&(t.launcher=l);let c=Un(n,bd);c&&(t.features=c);let u=Un(n,yd);u&&(t.endpoints=u);let p=pd(n,Pd,"user-context");p&&(t.userContext=p);let _=pd(n,xd,"page-context");_&&(t.pageContext=_);let d=n("actions");return d!==void 0&&(t.header={actions:Th(d)}),t}function Un(e,t){let n={};for(let[r,o,i]of t){let s=e(r);s!==void 0&&Reflect.set(n,o,i?i(s):s)}return Object.keys(n).length>0?n:null}function pd(e,t,n){let r={};for(let[l,c]of t){let u=e(l);u!==void 0&&(r[c]=u)}let o={},i=e(n);if(i)try{let l=JSON.parse(i);if(xh(l))for(let[c,u]of Object.entries(l))(typeof u=="string"||typeof u=="number"||typeof u=="boolean")&&(o[c]=u)}catch{}let s={...o,...r};return Object.keys(s).length>0?s:null}function Eh(e,t){let n=Un(t,vd)??{},r=e("launcher-label");r!==null&&(n.label=r);let o=t("callout-text");if(o){let i=Number.parseInt(t("callout-delay")??"",10);n.callout={text:o,...Number.isFinite(i)?{delayMs:i}:{}}}return Object.keys(n).length>0?n:null}var Sd=oe.scope("track"),Mh=64,Lh=256,Oh=10;function wd(e,t){let n=typeof e=="string"?e.trim():"";if(!n||n.length>Mh){Sd.warn("track: ignored an event without a name of 1\u201364 characters",{name:e});return}let r=Object.fromEntries(Object.entries(typeof t=="object"&&t!==null?t:{}).filter(o=>typeof o[1]=="string"||typeof o[1]=="boolean"||Number.isFinite(o[1])));return JSON.stringify(r).length>Lh?(Sd.warn("track: sent the event without its data, which is over 256 characters",{name:n}),{name:n}):Object.keys(r).length>0?{name:n,data:r}:{name:n}}function kd(e){let t=[];return e.on("hostEvent",n=>{t.push({...n,at:Date.now()}),t.length>Oh&&t.shift()}),t}function Mt(){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,Nh(t.subarray(6)),t[6]=(t[6]??0)&15|112,t[8]=(t[8]??0)&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 Nh(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 hn=oe.scope("persistence");function gr(e,t=ui,n){let r=n?`${e}.${n}`:e,o=`${O.cssPrefix}.${r}.storageVersion`,i=t.get(o)??void 0,s=i?`.v${i}`:"",l=`${O.cssPrefix}.${r}${s}`,c=`${O.cssPrefix}${s}.visitorId`,u=`${O.cssPrefix}${s}.lastUserSub`,p=`${l}.conversationId`,_=`${l}.userPrefs`,d=`${l}.panelOpen`,f=`${l}.panelSize`,v=`${l}.calloutDismissed`,m=`${l}.sidebarCollapsed`,b=`${l}.activeModule`,w=`${l}.seenNewsId`,y=`${l}.historyCount`,P=`${l}.loginReturn`,C=`${l}.loginPromptDismissedIn`,x={getVisitorId(){let g=t.get(c);if(g)return g;let h=Mt();return t.set(c,h),h},loadLastUserSub(){return t.get(u)??void 0},saveLastUserSub(g){t.set(u,g)},loadConversationId(){return t.get(p)??void 0},saveConversationId(g){hn.trace("saveConversationId",{id:g,scope:r}),g?t.set(p,g):t.remove(p)},loadDraft(g){return t.get(`${l}.draft.${g}`)??""},saveDraft(g,h){let k=`${l}.draft.${g}`;h?t.set(k,h):t.remove(k)},loadMessageQueue(g){let h=t.get(`${l}.messageQueue.${g}`);if(!h)return[];try{let k=JSON.parse(h);return!Array.isArray(k)||!k.every($h)?[]:k}catch(k){return hn.warn("loadMessageQueue parse failed",{error:k}),[]}},saveMessageQueue(g,h){let k=`${l}.messageQueue.${g}`;if(h.length===0){t.remove(k);return}try{t.set(k,JSON.stringify(h))}catch($){hn.warn("saveMessageQueue serialise failed",{error:$})}},loadUserPrefs(){let g=t.get(_);if(!g)return{};try{return Rs(JSON.parse(g))}catch(h){return hn.warn("loadUserPrefs parse failed",{error:h}),{}}},saveUserPrefs(g){try{t.set(_,JSON.stringify(g))}catch(h){hn.warn("saveUserPrefs serialise failed",{error:h})}},patchUserPrefs(g){let h=x.loadUserPrefs();x.saveUserPrefs({...h,...g})},loadPanelOpen(){let g=t.get(d);return g==="1"?!0:g==="0"?!1:null},savePanelOpen(g){t.set(d,g?"1":"0")},loadPanelSize(){let g=t.get(f);return g==="normal"||g==="expanded"||g==="fullscreen"?g:null},savePanelSize(g){t.set(f,g)},loadCalloutDismissed(g){if(!g)return!1;let h=t.get(v);return!!h&&h===g},saveCalloutDismissed(g){g?t.set(v,g):t.remove(v)},loadSidebarCollapsed(){let g=t.get(m);return g==="1"?!0:g==="0"?!1:null},saveSidebarCollapsed(g){t.set(m,g?"1":"0")},loadActiveModule(){return t.get(b)||null},saveActiveModule(g){t.set(b,g)},loadSeenNewsId(){return t.get(w)||null},saveSeenNewsId(g){t.set(w,g)},loadHistoryCount(){let g=t.get(y);if(!g)return null;let h=Number.parseInt(g,10);return Number.isFinite(h)&&h>=0?h:null},saveHistoryCount(g){t.set(y,String(g))},rememberStorageVersion(g){g&&g!==t.get(o)&&(hn.debug("rememberStorageVersion (force-reset on next load)",{version:g}),t.set(o,g))},saveLoginReturn(g){Dn.set(P,JSON.stringify(g))},takeLoginReturn(){let g=Dn.get(P);if(g){Dn.remove(P);try{let h=JSON.parse(g);return fi(h)&&typeof h.conversationId=="string"&&h.conversationId&&typeof h.draft=="string"?{conversationId:h.conversationId,draft:h.draft}:void 0}catch(h){hn.warn("takeLoginReturn parse failed",{error:h});return}}},loadLoginPromptDismissedIn(){return Dn.get(C)??void 0},dismissLoginPromptIn(g){Dn.set(C,g)},clearConversation(){t.remove(p)},reset(){let g=t.get(p);g&&(t.remove(`${l}.draft.${g}`),t.remove(`${l}.messageQueue.${g}`));for(let h of[P,C])Dn.remove(h);for(let h of[c,u,p,_,f,v,m,b,w,y])t.remove(h);hn.info("reset: forgot the visitor",{scope:r})}};return x}function fi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function $h(e){return fi(e)&&typeof e.id=="string"&&e.id.length>0&&typeof e.text=="string"}function Rs(e){if(!fi(e))return{};let t={};return typeof e.locale=="string"&&(t.locale=e.locale),typeof e.soundMuted=="boolean"&&(t.soundMuted=e.soundMuted),(e.themeMode==="auto"||e.themeMode==="light"||e.themeMode==="dark")&&(t.themeMode=e.themeMode),(e.textSize==="small"||e.textSize==="normal"||e.textSize==="large")&&(t.textSize=e.textSize),fi(e.widgetSize)&&typeof e.widgetSize.width=="number"&&typeof e.widgetSize.height=="number"&&(t.widgetSize={width:e.widgetSize.width,height:e.widgetSize.height}),t}var mi="6.13.0";var Dh="1",Cd=60,Bh=2e3,As={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:()=>{},toolResult:()=>{},toolDecision:e=>({approved:e.approved}),hostEvent:e=>({name:e.name,data:e.data&&JSON.stringify(e.data)}),messageFeedback:e=>({value:e.value??"none"}),contentView:e=>({section:e.section,count:e.count}),contentOpen:e=>({contentId:e.contentId,contentCollectionId:e.contentCollectionId}),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 Uh(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function zh(){return location.origin+location.pathname}function Fh(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function Td(e,t){let n=Math.random(),r=0,o=0,i=new Set;function s(_,d){let{tracking:f,publicKey:v,aiAgentDeploymentId:m,mode:b,themeMode:w}=t.getOptions();if(!f.enabled||Uh()||n>=f.sampleRate)return;let y=performance.now();if(y-r>6e4&&(r=y,o=0),++o>Cd)return;let P=new URLSearchParams;P.set("v",Dh),P.set("_ev",mi),P.set("e",_),f.token&&P.set("tk",f.token),v&&P.set("pk",v),m&&P.set("dep",m),P.set("vid",t.getVisitorId());let C=t.getConversationId();C&&P.set("cid",C),P.set("url",zh());let x=Fh();x&&P.set("ref",x),P.set("sw",String(screen.width)),P.set("sh",String(screen.height)),P.set("vw",String(innerWidth)),P.set("vh",String(innerHeight)),P.set("dpr",String(devicePixelRatio)),P.set("lang",navigator.language);try{P.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(P.set("m",b),P.set("th",w),d)for(let[$,I]of Object.entries(d))I!==void 0&&P.set($,String(I));P.set("ts",String(Date.now()));let g=`${f.endpoint}?${P}`;if(g.length>Bh)return;let h=new Image(1,1);i.add(h);function k(){return i.delete(h)}h.addEventListener("load",k,{once:!0}),h.addEventListener("error",k,{once:!0}),h.src=g}let l=[];function c(_,d){if(l&&_!=="handshake"){l.length<Cd&&l.push([_,d]);return}let f=l??[];l=void 0;for(let[v,m]of f)s(v,m);s(_,d)}function u(_,d){return As[_]?.(d)}let p=Object.keys(As).filter(_=>Object.hasOwn(As,_)).map(_=>e.on(_,d=>c(_,u(_,d))));return()=>{for(let _ of p)_();i.clear()}}var Rd=`.__P__-generative-ui{display:grid;gap:var(--__P__-space-3);overflow-wrap:anywhere;white-space:pre-wrap}.__P__-generative-ui p{margin:0}.__P__-generative-ui-grid-container{container:__P__-generative-ui-grid / inline-size;min-width:0}.__P__-generative-ui-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}.__P__-generative-ui-cell{display:flex;flex-direction:column;align-self:start;min-width:0;gap:16px}.__P__-generative-ui-grid[data-equal-heights]>.__P__-generative-ui-cell{align-self:stretch}.__P__-generative-ui-grid[data-equal-heights]>.__P__-generative-ui-cell>:only-child{flex:1}@container __P__-generative-ui-grid (min-width: 496px){.__P__-generative-ui-grid:is([data-columns="2"],[data-columns="3"],[data-columns="4"]){grid-template-columns:repeat(2,minmax(0,1fr))}.__P__-generative-ui-grid:is([data-columns="2"],[data-columns="3"],[data-columns="4"])>.__P__-generative-ui-cell:is([data-span="2"],[data-span="3"],[data-span="4"]){grid-column:span 2}}@container __P__-generative-ui-grid (min-width: 752px){.__P__-generative-ui-grid:is([data-columns="3"],[data-columns="4"]){grid-template-columns:repeat(3,minmax(0,1fr))}.__P__-generative-ui-grid:is([data-columns="3"],[data-columns="4"])>.__P__-generative-ui-cell:is([data-span="3"],[data-span="4"]){grid-column:span 3}}@container __P__-generative-ui-grid (min-width: 1008px){.__P__-generative-ui-grid[data-columns="4"]{grid-template-columns:repeat(4,minmax(0,1fr))}.__P__-generative-ui-grid[data-columns="4"]>.__P__-generative-ui-cell[data-span="4"]{grid-column:span 4}}.__P__-generative-ui section{display:flex;flex-direction:column;gap:var(--__P__-space-2);padding:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);min-width:0}.__P__-generative-ui-metric{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);font-size:1.6em;font-weight:700;font-variant-numeric:tabular-nums}.__P__-generative-ui-metric svg{flex:none;width:80px;height:24px;color:var(--__P__-accent)}.__P__-generative-ui-change{align-self:flex-start;padding:2px var(--__P__-space-2);border-radius:var(--__P__-radius-sm);background:var(--__P__-hover);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;font-variant-numeric:tabular-nums}.__P__-generative-ui-change[data-tone=good]{color:var(--__P__-fg);background:color-mix(in oklch,var(--__P__-success) 18%,transparent)}.__P__-generative-ui-change[data-tone=bad]{color:var(--__P__-danger-text);background:var(--__P__-danger-bg)}.__P__-generative-ui-table{overflow-x:auto}.__P__-generative-ui table{width:100%;border-collapse:collapse;white-space:normal}.__P__-generative-ui caption{text-align:start;font-weight:600;padding-bottom:var(--__P__-space-2)}.__P__-generative-ui th,.__P__-generative-ui td{text-align:start;padding:var(--__P__-space-2);border-bottom:1px solid var(--__P__-border)}.__P__-generative-ui :is(th,td)[data-numeric=true]{text-align:end;font-variant-numeric:tabular-nums}.__P__-generative-ui th button{padding:0;border:0;background:none;color:inherit;font:inherit;font-weight:600;text-align:inherit;cursor:pointer}.__P__-generative-ui th button:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-generative-ui th[aria-sort=ascending] button:after{content:" \\2191"}.__P__-generative-ui th[aria-sort=descending] button:after{content:" \\2193"}.__P__-generative-ui-chart{display:block;width:100%;max-height:320px;color:var(--__P__-accent)}.__P__-generative-ui-axis line{stroke:var(--__P__-border)}.__P__-generative-ui-axis text{fill:var(--__P__-fg-muted);font-size:9px}.__P__-generative-ui .__P__-generative-ui-legend{display:flex;flex-wrap:wrap;gap:var(--__P__-space-1) var(--__P__-space-3);margin:0;padding:0;list-style:none;color:var(--__P__-accent);font-size:var(--__P__-text-xs)}.__P__-generative-ui-legend li{display:flex;align-items:center;gap:6px;margin:0}.__P__-generative-ui-legend li:before{content:"";width:10px;height:10px;border-radius:3px;background:currentColor}.__P__-generative-ui-legend span{color:var(--__P__-fg)}.__P__-generative-ui-carousel{display:flex;gap:var(--__P__-space-3);margin:0 calc(var(--__P__-space-1) * -1);padding:0 var(--__P__-space-1) var(--__P__-space-2);overflow-x:auto;scroll-snap-type:x mandatory;scroll-padding-inline:var(--__P__-space-1);scrollbar-width:thin;min-width:0}.__P__-generative-ui-carousel>[role=listitem]{display:flex;flex:0 0 min(256px,80%);scroll-snap-align:start;min-width:0}.__P__-generative-ui-carousel>[role=listitem]>section{flex:1}.__P__-generative-ui-offer{overflow:hidden}.__P__-generative-ui>.__P__-generative-ui-offer{max-width:320px}.__P__-generative-ui>.__P__-generative-ui-flight{max-width:400px}.__P__-generative-ui>.__P__-generative-ui-sheet{max-width:480px}.__P__-generative-ui-footer{display:flex;flex-direction:column;gap:var(--__P__-space-1);margin-top:auto}.__P__-generative-ui-hint{min-height:1.4em;line-height:1.4;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs)}.__P__-generative-ui-photo{position:relative;display:block;flex:none;width:calc(100% + 2 * var(--__P__-space-3));aspect-ratio:4 / 3;margin:calc(var(--__P__-space-3) * -1) calc(var(--__P__-space-3) * -1) var(--__P__-space-1);overflow:hidden;background:var(--__P__-hover)}.__P__-generative-ui-photo[data-wide=true]{aspect-ratio:16 / 9}.__P__-generative-ui-badges{display:flex;flex-wrap:wrap;gap:var(--__P__-space-1)}.__P__-generative-ui-photo>.__P__-generative-ui-badges{position:absolute;top:var(--__P__-space-2);inset-inline-start:var(--__P__-space-2)}.__P__-generative-ui-photo .__P__-generative-ui-pill{background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:0 0 0 1px var(--__P__-border)}.__P__-generative-ui-thumb{display:block;flex:0 0 auto;width:48px;height:48px;overflow:hidden;border-radius:var(--__P__-radius-sm);background:var(--__P__-hover)}.__P__-generative-ui-photo img,.__P__-generative-ui-thumb img{display:block;width:100%;max-width:none;height:100%;object-fit:cover}.__P__-generative-ui-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--__P__-space-2)}.__P__-generative-ui-stars{color:var(--__P__-warning);font-size:var(--__P__-text-xs);letter-spacing:1px}.__P__-generative-ui .__P__-generative-ui-details{display:grid;gap:2px;margin:0;padding:0;list-style:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs)}.__P__-generative-ui-details li{display:flex;gap:6px;margin:0}.__P__-generative-ui-details li:before{content:"\\2022";flex:none}.__P__-generative-ui-leg{display:grid;grid-template-columns:minmax(0,1fr);gap:2px}.__P__-generative-ui-leg+.__P__-generative-ui-leg{padding-top:var(--__P__-space-2);border-top:1px solid var(--__P__-border)}.__P__-generative-ui-leg-times{display:flex;align-items:center;gap:var(--__P__-space-1)}.__P__-generative-ui-leg-times>span:not(.__P__-generative-ui-leg-path){display:grid;flex:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-generative-ui-leg-times>span:last-child{text-align:end}.__P__-generative-ui-leg-times strong{color:var(--__P__-fg);font-size:1rem;font-variant-numeric:tabular-nums;white-space:nowrap}.__P__-generative-ui-leg-times sup{font-size:.6em;color:var(--__P__-fg-muted)}.__P__-generative-ui-leg-path{flex:1;min-width:0;padding-bottom:4px;border-bottom:1px solid var(--__P__-border-strong);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);line-height:1.3;text-align:center;overflow-wrap:normal}.__P__-generative-ui .__P__-generative-ui-itinerary{display:grid;gap:var(--__P__-space-2);margin:0;padding:0;list-style:none}.__P__-generative-ui-itinerary li{display:grid;margin:0;padding-inline-start:var(--__P__-space-3);border-inline-start:2px solid var(--__P__-border-strong)}.__P__-generative-ui-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.__P__-generative-ui a{color:inherit}.__P__-generative-ui .__P__-generative-ui-title a,.__P__-generative-ui .__P__-generative-ui-lines a,.__P__-generative-ui .__P__-generative-ui-actions>a{text-decoration:none}.__P__-generative-ui .__P__-generative-ui-title a:hover,.__P__-generative-ui .__P__-generative-ui-lines span>a:hover{text-decoration:underline}.__P__-generative-ui-pill{display:inline-flex;align-items:center;padding:2px var(--__P__-space-2);border-radius:var(--__P__-radius-sm);background:var(--__P__-hover);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-generative-ui-muted{color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs)}.__P__-generative-ui-star{color:var(--__P__-warning)}.__P__-generative-ui-price{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 var(--__P__-space-2);font-variant-numeric:tabular-nums}.__P__-generative-ui-price strong{font-size:1.1em}.__P__-generative-ui-price s{color:var(--__P__-fg-muted)}.__P__-generative-ui-description{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;color:var(--__P__-fg-muted)}.__P__-generative-ui-option{display:grid;gap:var(--__P__-space-1);min-width:0;margin:0;padding:0;border:0}.__P__-generative-ui-option legend{padding:0 0 var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-generative-ui-option div{display:flex;gap:6px;min-width:0;margin:-4px;padding:4px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}.__P__-generative-ui-option div::-webkit-scrollbar{display:none}.__P__-generative-ui-option div[data-cut-end]{mask-image:linear-gradient(to right,#000 calc(100% - 32px),transparent)}.__P__-generative-ui-option div[data-cut-start]{mask-image:linear-gradient(to right,transparent,#000 32px)}.__P__-generative-ui-option div[data-cut-start][data-cut-end]{mask-image:linear-gradient(to right,transparent,#000 32px,#000 calc(100% - 32px),transparent)}.__P__-generative-ui-option div:dir(rtl)[data-cut-end]{mask-image:linear-gradient(to left,#000 calc(100% - 32px),transparent)}.__P__-generative-ui-option div:dir(rtl)[data-cut-start]{mask-image:linear-gradient(to left,transparent,#000 32px)}.__P__-generative-ui-option div:dir(rtl)[data-cut-start][data-cut-end]{mask-image:linear-gradient(to left,transparent,#000 32px,#000 calc(100% - 32px),transparent)}.__P__-generative-ui-option button{flex:0 0 auto;min-height:32px;padding:0 10px;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm);background:var(--__P__-bg-elevated);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);white-space:nowrap;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-generative-ui-option button:hover{border-color:var(--__P__-border-strong)}.__P__-generative-ui-option button[aria-pressed=true]{border-color:var(--__P__-accent);box-shadow:inset 0 0 0 1px var(--__P__-accent);font-weight:600}.__P__-generative-ui-option button:disabled{color:var(--__P__-fg-muted);text-decoration:line-through;opacity:.6;cursor:not-allowed}.__P__-generative-ui-actions{display:flex;flex-wrap:wrap;gap:var(--__P__-space-2);margin-top:auto;padding-top:var(--__P__-space-1)}.__P__-generative-ui-actions:not([data-small=true])>*{flex:1 1 auto}.__P__-generative-ui-actions>*{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:0 var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm);background:var(--__P__-bg-elevated);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;text-decoration:none;white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-generative-ui-actions[data-small=true]>*{min-height:28px;padding:0 var(--__P__-space-2);font-size:var(--__P__-text-xs)}.__P__-generative-ui-actions>:hover{border-color:var(--__P__-border-strong)}.__P__-generative-ui-actions>[data-primary=true]{border-color:var(--__P__-accent);background:var(--__P__-accent);color:var(--__P__-on-accent)}.__P__-generative-ui-actions>:focus-visible,.__P__-generative-ui-option button:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-generative-ui-actions>:disabled{border-color:var(--__P__-border);background:var(--__P__-hover);color:var(--__P__-fg-muted);cursor:not-allowed}.__P__-generative-ui .__P__-generative-ui-lines{display:grid;margin:0;padding:0;list-style:none}.__P__-generative-ui .__P__-generative-ui-lines li{display:flex;margin:0;gap:var(--__P__-space-3);padding:var(--__P__-space-2) 0;border-bottom:1px solid var(--__P__-border)}.__P__-generative-ui .__P__-generative-ui-lines li:first-child{padding-top:0}.__P__-generative-ui-lines li>div{display:grid;flex:1;gap:2px;min-width:0}.__P__-generative-ui-line-head{display:flex;align-items:baseline;gap:var(--__P__-space-3)}.__P__-generative-ui-line-head>span{display:-webkit-box;flex:1;min-width:0;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.__P__-generative-ui-line-head>strong{flex:none;font-variant-numeric:tabular-nums}.__P__-generative-ui-totals{display:grid;gap:var(--__P__-space-1);margin:0;font-variant-numeric:tabular-nums}.__P__-generative-ui-totals div{display:flex;justify-content:space-between;gap:var(--__P__-space-3);color:var(--__P__-fg-muted)}.__P__-generative-ui-totals div:last-child{padding-top:var(--__P__-space-1);color:var(--__P__-fg);font-weight:700}.__P__-generative-ui-totals dd{margin:0}.__P__-generative-ui-notice{padding:var(--__P__-space-2) var(--__P__-space-3);border-radius:var(--__P__-radius-sm);background:var(--__P__-hover)}.__P__-generative-ui-notice[data-severity=warning]{color:var(--__P__-fg);background:color-mix(in oklch,var(--__P__-warning) 16%,transparent)}.__P__-generative-ui-notice[data-severity=error]{color:var(--__P__-danger-text);background:var(--__P__-danger-bg)}.__P__-generative-ui .__P__-generative-ui-timeline{display:grid;gap:var(--__P__-space-2);margin:0;padding:0;list-style:none}.__P__-generative-ui .__P__-generative-ui-timeline li{display:flex;margin:0;align-items:baseline;gap:var(--__P__-space-2);color:var(--__P__-fg-muted)}.__P__-generative-ui-timeline li:before{content:"";flex:0 0 auto;width:8px;height:8px;border:2px solid var(--__P__-border-strong);border-radius:50%}.__P__-generative-ui-timeline li[data-done=true]{color:var(--__P__-fg);font-weight:600}.__P__-generative-ui-timeline li[data-done=true]:before{border-color:var(--__P__-accent);background:var(--__P__-accent)}.__P__-generative-ui-timeline li>:first-child{flex:1}@media(pointer:coarse){.__P__-generative-ui-actions>*{min-height:44px}.__P__-generative-ui-actions[data-small=true]>*{min-height:32px}.__P__-generative-ui-option button{min-height:40px}}
|
|
3
3
|
`;var Ad=`: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;border-radius:var(--__P__-radius-md)}: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}}
|
|
4
|
-
`;var Ed=`.__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-fg);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:18px;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;width:max-content;max-width:min(260px,calc(100vw - 100% - var(--__P__-callout-gap) - 32px));white-space:normal;overflow-wrap:anywhere}.__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)}.__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{flex-shrink:0;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;overflow:clip;overscroll-behavior:none;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:var(--__P__-visual-viewport-top, 0px) 0 auto;height:var(--__P__-visual-viewport-height, 100dvh);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:100%;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: clamp(440px, 32vw, 640px);--__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;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:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:100%;min-width:min(var(--__P__-resize-min-w, 0px),calc(100vw - var(--__P__-inset-x) * 2));max-width:var(--__P__-resize-max-w, none);max-height:none;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}}@media(max-width:640px){:host([data-mode="open"][data-position]) .__P__-anchor,:host([data-mode="expanded"][data-position]) .__P__-anchor,:host([data-mode="drawer"][data-position]) .__P__-anchor,:host([data-mode="modal"][data-position]) .__P__-anchor{inset:var(--__P__-visual-viewport-top, 0px) 0 auto;align-items:stretch;width:auto;height:var(--__P__-visual-viewport-height, 100dvh);padding:0}:host([data-mode="open"][data-position]) .__P__-panel,:host([data-mode="expanded"][data-position]) .__P__-panel,:host([data-mode="drawer"][data-position]) .__P__-panel,:host([data-mode="modal"][data-position]) .__P__-panel{width:100vw;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;border-radius:0;border:0;box-shadow:none;translate:none}:host([data-mode="modal"]){background:none;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__-header[data-variant=accent]{background:var(--__P__-accent);color:var(--__P__-on-accent);border-bottom-color:transparent}.__P__-header[data-variant=accent]>h1,.__P__-header[data-variant=accent] .__P__-agent-meta strong,.__P__-header[data-variant=accent] .__P__-agent-sub span,.__P__-header[data-variant=accent] .__P__-agent-ticket,.__P__-header[data-variant=accent] .__P__-agent-ticket:hover,.__P__-header[data-variant=accent]>.__P__-icon-btn,.__P__-header[data-variant=accent] .__P__-header-actions>.__P__-icon-btn,.__P__-header[data-variant=accent] .__P__-menu-wrap>.__P__-icon-btn{color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-header[data-variant=accent]>.__P__-icon-btn:hover,.__P__-header[data-variant=accent] .__P__-header-actions>.__P__-icon-btn:hover,.__P__-header[data-variant=accent] .__P__-menu-wrap>.__P__-icon-btn:hover{background:color-mix(in oklch,var(--__P__-on-accent) 16%,transparent);color:var(--__P__-on-accent)}.__P__-header[data-variant=accent]>.__P__-icon-btn:active,.__P__-header[data-variant=accent] .__P__-header-actions>.__P__-icon-btn:active,.__P__-header[data-variant=accent] .__P__-menu-wrap>.__P__-icon-btn:active{background:color-mix(in oklch,var(--__P__-on-accent) 24%,transparent)}.__P__-header[data-variant=accent] .__P__-agent-avatar{background:color-mix(in oklch,var(--__P__-on-accent) 18%,transparent);color:var(--__P__-on-accent)}.__P__-header[data-variant=accent] .__P__-agent-avatar:after{border-color:var(--__P__-accent)}.__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:var(--__P__-radius-md);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);flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;border-radius:inherit;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__-agent-sub{display:flex;gap:4px;min-width:0}.__P__-agent-sub button+span:before{content:"\\b7\\a0"}.__P__-agent-ticket{flex:none;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);cursor:copy}.__P__-agent-ticket:hover{color:var(--__P__-fg)}.__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[data-cut-end=true]{mask-image:linear-gradient(to right,#000 calc(100% - 32px),transparent)}.__P__-suggestions[data-cut-start=true]{mask-image:linear-gradient(to right,transparent,#000 32px)}.__P__-suggestions[data-cut-start=true][data-cut-end=true]{mask-image:linear-gradient(to right,transparent,#000 32px,#000 calc(100% - 32px),transparent)}:host([dir="rtl"]) .__P__-suggestions[data-cut-end=true]{mask-image:linear-gradient(to left,#000 calc(100% - 32px),transparent)}:host([dir="rtl"]) .__P__-suggestions[data-cut-start=true]{mask-image:linear-gradient(to left,transparent,#000 32px)}:host([dir="rtl"]) .__P__-suggestions[data-cut-start=true][data-cut-end=true]{mask-image:linear-gradient(to left,transparent,#000 32px,#000 calc(100% - 32px),transparent)}.__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-fg);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;position:relative;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 svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent-fg);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:0;bottom:14px;z-index:2;margin-inline:auto;display: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;overflow-anchor:none}.__P__-list--fade{--__P__-fade-size: 20px;--__P__-fade-top: 0px;--__P__-fade-bottom: 0px;-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%);mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%)}.__P__-list--fade[data-fade-top=true]{--__P__-fade-top: var(--__P__-fade-size)}.__P__-list--fade[data-fade-bottom=true]{--__P__-fade-bottom: var(--__P__-fade-size)}.__P__-list>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-load-previous,.__P__-history-more{display:flex;justify-content:center}.__P__-load-previous button,.__P__-history-more button{border:0;padding:4px 8px;background:transparent;color:var(--__P__-accent);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;cursor:pointer}.__P__-load-previous button:hover,.__P__-history-more button:hover{text-decoration:underline}.__P__-load-previous button:focus-visible,.__P__-history-more button:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-load-previous button:disabled,.__P__-history-more button:disabled{cursor:wait;opacity:.6}.__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:1px solid var(--__P__-border);border-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble{display:flex;align-items:stretch;padding:0;overflow:hidden;background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-author{display:flex;flex:0 0 auto;align-items:center;padding:0 .875rem;border-inline-end:1px solid color-mix(in oklab,var(--__P__-accent),transparent 60%);color:var(--__P__-accent);font-size:calc(13px * var(--__P__-text-scale));font-weight:600;letter-spacing:.025em;user-select:none}.__P__-bubble-body{display:flex;flex-wrap:wrap;align-items:flex-start;gap:var(--__P__-space-3) 6px;min-width:0}.__P__-bubble-body>*{flex:1 0 100%;min-width:0}.__P__-bubble-body>.__P__-source,.__P__-bubble-body>.__P__-typing{flex:0 1 auto}.__P__-bubble-row[data-role=operator] .__P__-bubble-body{flex:1 1 auto;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4)}.__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,.__P__-steps){width:100%}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui,.__P__-steps) .__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-meta{display:flex;align-items:center;gap:8px;margin-top:2px;padding:0 2px;min-height:24px}.__P__-bubble-actions{display:flex;align-items:center;gap:2px}.__P__-bubble-time{font-size:calc(11px * var(--__P__-text-scale));line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-feedback{display:flex;align-items:center;gap:2px}.__P__-msg-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:var(--__P__-radius-sm);background:transparent;color:var(--__P__-fg-muted);cursor:pointer;opacity:.65;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-msg-action:hover{opacity:1;background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-msg-action:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-msg-action[data-active=true]{opacity:1;color:var(--__P__-accent-fg)}.__P__-msg-action svg{width:15px;height:15px}.__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 :not(pre)>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__-file-image,.__P__-file-chip{border-radius:var(--__P__-radius-sm);color:inherit;text-decoration:none}.__P__-file-image{display:block;width:fit-content;max-width:min(100%,240px);overflow:hidden}.__P__-file-image img{max-height:240px;object-fit:cover}.__P__-file-chip{display:flex;align-items:center;gap:var(--__P__-space-2);max-width:min(100%,280px);padding:var(--__P__-space-2);border:1px solid color-mix(in srgb,currentColor 18%,transparent);background:color-mix(in srgb,currentColor 5%,transparent);transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-file-chip:hover{background:color-mix(in srgb,currentColor 10%,transparent)}.__P__-file-image:focus-visible,.__P__-file-chip:focus-visible{outline:2px solid currentColor;outline-offset:2px}.__P__-file-chip-icon{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:var(--__P__-radius-sm);background:color-mix(in srgb,currentColor 10%,transparent)}.__P__-file-chip-text{display:grid;min-width:0;line-height:1.35}.__P__-file-chip-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-file-chip-meta{font-size:var(--__P__-text-xs);opacity:.75}.__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__-chat-notice{padding:0 var(--__P__-space-3);text-align:center;font-size:var(--__P__-text-xs);line-height:1.5;color:var(--__P__-fg-muted)}.__P__-chat-notice .__P__-md p{margin:0}.__P__-chat-notice .__P__-md a{color:var(--__P__-accent-fg)}.__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__-steps{min-width:0;font-size:var(--__P__-text-sm)}.__P__-steps-head,.__P__-steps-row-head{display:inline-flex;align-items:center;gap:var(--__P__-space-2);max-width:100%;min-width:0;min-height:28px;padding:0;border:0;background:none;color:var(--__P__-fg-muted);font:inherit;text-align:start;cursor:pointer;-webkit-tap-highlight-color:transparent}.__P__-steps-head:hover,.__P__-steps-row-head:hover{color:var(--__P__-fg)}.__P__-steps-head:focus-visible,.__P__-steps-row-head:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-steps-icon,.__P__-steps-row-icon{display:inline-flex;flex:none;align-items:center;justify-content:center;width:16px;height:16px}.__P__-steps-icon svg,.__P__-steps-row-icon svg{width:14px;height:14px}.__P__-steps-label,.__P__-steps-row-label{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-steps-sep{margin-inline:var(--__P__-space-1)}.__P__-steps-name .__P__-steps-count{margin-inline-start:var(--__P__-space-1)}.__P__-steps-count,.__P__-steps-failed,.__P__-steps-denied,.__P__-steps-time{flex:none;font-variant-numeric:tabular-nums}.__P__-steps-failed{color:var(--__P__-danger-text)}.__P__-steps-denied{color:var(--__P__-fg-muted)}.__P__-steps-decision{display:inline-flex;flex:none;align-items:center;gap:var(--__P__-space-1);font-variant-numeric:tabular-nums;color:var(--__P__-success)}.__P__-steps-decision[data-approved=false]{color:var(--__P__-warning)}.__P__-steps-decision svg{width:14px;height:14px}.__P__-steps-row-error{margin:0;color:var(--__P__-danger-text)}.__P__-steps-chevron{display:inline-flex;flex:none;width:16px;height:16px;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-steps-chevron svg{width:16px;height:16px}.__P__-steps-chevron[data-open=true]{transform:rotate(180deg)}.__P__-steps-list{position:relative;display:flex;flex-direction:column;gap:var(--__P__-space-1);margin:var(--__P__-space-1) 0 0;padding:0;list-style:none}.__P__-steps-list:before{content:"";position:absolute;inset-block:0;inset-inline-start:7px;width:2px;border-radius:1px;background:var(--__P__-border)}.__P__-steps-row{position:relative;display:grid;grid-template-columns:16px minmax(0,1fr);column-gap:var(--__P__-space-2);align-items:start}.__P__-steps-row .__P__-steps-row-icon{margin-block:6px;border-radius:999px;background:var(--__P__-bubble-assistant);color:var(--__P__-fg-muted)}.__P__-steps-row[data-status=error] .__P__-steps-row-icon{color:var(--__P__-danger-text)}.__P__-steps-row-main{display:flex;flex-direction:column;align-items:flex-start;min-width:0}.__P__-steps-row-name{color:var(--__P__-fg);font-weight:500}.__P__-steps-row-system,.__P__-steps-row-summary{margin-inline-start:var(--__P__-space-2);color:var(--__P__-fg-muted)}.__P__-steps-row-body{grid-column:2;display:flex;flex-direction:column;gap:var(--__P__-space-2);width:100%;margin:var(--__P__-space-1) 0 var(--__P__-space-2)}.__P__-steps-row[data-standalone=true]>:is(.__P__-steps-row-body,.__P__-steps-thought-text){grid-column:1 / -1}.__P__-steps-body{display:grid;grid-template-rows:0fr;transition:grid-template-rows .2s ease-out}.__P__-steps-body[data-open=true]{grid-template-rows:1fr}.__P__-steps-body-inner{min-height:0;overflow:hidden}.__P__-steps-live{min-width:0;overflow:hidden;text-overflow:ellipsis;background:linear-gradient(90deg,var(--__P__-fg-muted) 0%,var(--__P__-fg) 50%,var(--__P__-fg-muted) 100%) 0 0 / 200% 100%;background-clip:text;-webkit-background-clip:text;color:transparent;animation:__P__-steps-shimmer 2s linear infinite}@keyframes __P__-steps-shimmer{to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.__P__-steps-body,.__P__-steps-chevron{transition:none}.__P__-steps-live{background:none;color:var(--__P__-fg-muted);animation:none}}.__P__-steps-thought,.__P__-steps-stopped-label{color:var(--__P__-fg-muted)}.__P__-steps-thought-label,.__P__-steps-stopped-label{display:inline-flex;align-items:center;min-height:28px}.__P__-steps-thought-text{grid-column:2;width:100%;margin:var(--__P__-space-1) 0 var(--__P__-space-2)}.__P__-reasoning-body{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%;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__-compaction-status{width:100%;padding:10px 14px;justify-content:center;font-size:var(--__P__-text-xs)}.__P__-message-queue{display:flex;max-height:112px;flex-direction:column;gap:var(--__P__-space-1);overflow-y:auto}.__P__-attachment-chip.__P__-queued-message{width:100%;max-width:none}.__P__-queued-text{min-width:0;flex:1}.__P__-composer-row{--__P__-composer-line-height: 40px;display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;--__P__-textarea-base-height: 40px;height:var(--__P__-textarea-base-height);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)}.__P__-textarea:focus-visible{outline:none;border-color:var(--__P__-focus)}.__P__-textarea:placeholder-shown{white-space:nowrap;overflow:hidden}.__P__-textarea::placeholder{text-overflow:ellipsis}@media(pointer:coarse){.__P__-textarea{--__P__-textarea-base-height: 44px}.__P__-composer-row{--__P__-composer-line-height: 44px}.__P__-composer-row>.__P__-send{margin-block-end:2px}}.__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-fg);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-fg)}.__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;margin-block-end:calc((var(--__P__-composer-line-height) - 32px) / 2)}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{position:relative;display:inline-flex;align-items:center;gap:8px;padding:5px;border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:220px;overflow:hidden}.__P__-attachment-chip[data-upload=error]{border-color:color-mix(in oklab,var(--__P__-danger) 45%,transparent);background:color-mix(in oklab,var(--__P__-danger) 6%,var(--__P__-bg-elevated))}.__P__-attachment-thumb{flex-shrink:0;width:32px;height:32px;border-radius:var(--__P__-radius-sm);object-fit:cover;background:var(--__P__-border);display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-text{display:flex;flex-direction:column;min-width:0;line-height:1.3}.__P__-attachment-name{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--__P__-fg);font-weight:500}.__P__-attachment-meta{display:inline-flex;align-items:center;gap:4px;color:var(--__P__-fg-muted);font-variant-numeric:tabular-nums;white-space:nowrap}.__P__-attachment-meta svg{flex:none;width:12px;height:12px}.__P__-attachment-chip[data-upload=error] .__P__-attachment-meta{color:var(--__P__-danger)}.__P__-attachment-chip[data-upload=done] .__P__-attachment-meta svg{color:var(--__P__-success)}.__P__-attachment-progress{position:absolute;inset-inline:0;bottom:0;height:2px;background:color-mix(in oklab,var(--__P__-accent) 15%,transparent)}.__P__-attachment-progress>span{display:block;height:100%;background:var(--__P__-accent);transition:width var(--__P__-dur-quick) var(--__P__-ease)}.__P__-attachment-remove{flex-shrink:0;width:24px;height:24px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove svg{width:14px;height:14px}.__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%,color-mix(in srgb,var(--__P__-bg) 92%,transparent));display:flex;flex-direction:column;gap:10px;align-items:center;justify-content:center;text-align:center;padding:16px;font-weight:600;color:var(--__P__-accent-fg);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}.__P__-dropzone-icon{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:999px;background:color-mix(in srgb,var(--__P__-accent) 14%,transparent)}.__P__-dropzone-icon svg{width:22px;height:22px}.__P__-dropzone[data-state=reject]{border-color:var(--__P__-danger);background:color-mix(in srgb,var(--__P__-danger) 8%,color-mix(in srgb,var(--__P__-bg) 92%,transparent));color:var(--__P__-danger)}.__P__-dropzone[data-state=reject] .__P__-dropzone-icon{background:color-mix(in srgb,var(--__P__-danger) 14%,transparent)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{display:flex;align-items:center;gap:var(--__P__-space-2);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)}.__P__-error-icon{display:inline-flex;flex:none;width:16px;height:16px;color:var(--__P__-danger-text)}.__P__-error-icon svg{width:16px;height:16px}.__P__-error-text{min-width:0}.__P__-error-retry{flex:none;margin-inline-start:auto;min-height:28px;border:0;background:none;padding:0;color:var(--__P__-accent-fg);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;text-decoration:underline;white-space:nowrap;cursor:pointer}.__P__-error-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size: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-card>[role=listitem]{display:flex;flex-direction:column}.__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-card>*+*{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:var(--__P__-radius-md);background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent-fg)}.__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-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:var(--__P__-radius-md)}.__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__-transcript-layer{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-4);border-radius:inherit;overflow:hidden}.__P__-transcript-backdrop{position:absolute;inset:0;background:var(--__P__-backdrop);animation:__P__-transcript-fade var(--__P__-dur-base) var(--__P__-ease-out)}.__P__-transcript-sheet{position:relative;display:flex;flex-direction:column;gap:var(--__P__-space-3);box-sizing:border-box;width:100%;max-width:360px;padding:var(--__P__-space-4);border-radius:var(--__P__-radius-lg);background:var(--__P__-bg);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel),inset 0 0 0 1px var(--__P__-border);animation:__P__-transcript-in var(--__P__-dur-base) var(--__P__-ease-out)}.__P__-transcript-sheet-head{display:flex;align-items:center;gap:var(--__P__-space-2);margin-block:-4px;margin-inline-end:-6px}.__P__-transcript-sheet-icon{display:inline-flex;align-items:center;justify-content:center;inline-size:28px;block-size:28px;flex-shrink:0;border-radius:var(--__P__-radius-sm);background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent-fg)}.__P__-transcript-sheet-icon svg{inline-size:16px;block-size:16px}.__P__-transcript-sheet-title{flex:1;min-width:0;margin:0;font-size:var(--__P__-text-base);font-weight:600;text-wrap:balance}.__P__-transcript-sheet-form{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-transcript-sheet-text{margin:0;font-size:var(--__P__-text-sm);line-height:1.45;color:var(--__P__-fg-muted);overflow-wrap:anywhere;text-wrap:pretty}.__P__-transcript-sheet-sent{display:flex;align-items:flex-start;gap:var(--__P__-space-2);color:var(--__P__-fg)}.__P__-transcript-sheet-sent svg{flex-shrink:0;inline-size:18px;block-size:18px;color:var(--__P__-success)}.__P__-transcript-sheet-action{width:100%;min-height:44px;text-align:center;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),scale var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-transcript-sheet-action:active:not(:disabled){scale:.96}@keyframes __P__-transcript-fade{0%{opacity:0}}@keyframes __P__-transcript-in{0%{opacity:0;translate:0 8px}}@media(max-width:640px){.__P__-transcript-layer{align-items:flex-end;padding:0}.__P__-transcript-sheet{max-width:none;padding-bottom:calc(var(--__P__-space-4) + env(safe-area-inset-bottom,0px));border-end-start-radius:0;border-end-end-radius:0;animation-name:__P__-transcript-up}}@keyframes __P__-transcript-up{0%{translate:0 100%}}@media(prefers-reduced-motion:reduce){.__P__-transcript-backdrop,.__P__-transcript-sheet{animation:none}}.__P__-operator-banner{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;column-gap:10px;box-sizing:border-box;width:calc(100% - 2 * var(--__P__-space-3));max-width:var(--__P__-conversation-max, 768px);margin:0 auto var(--__P__-space-2);padding:10px 12px;border-radius:var(--__P__-radius-lg);background:var(--__P__-bg-elevated);box-shadow:inset 0 0 0 1px var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);line-height:1.45;text-align:start}.__P__-operator-label{text-wrap:pretty}.__P__-operator-pulse{width:8px;height:8px;margin-block-start:calc((1.45em - 8px)/2);border-radius:50%;background:var(--__P__-accent)}.__P__-operator-banner[data-mode=awaiting-operator] .__P__-operator-pulse{animation:__P__-operator-pulse 1.4s var(--__P__-ease-out) infinite}.__P__-operator-banner[data-available=false] .__P__-operator-pulse{background:var(--__P__-warning);animation:none}.__P__-operator-banner[data-mode=operator] .__P__-operator-pulse{background:var(--__P__-success)}.__P__-operator-dismiss{width:28px;height:28px;margin-block:-4px;margin-inline-end:-6px}.__P__-operator-dismiss:before{inset:-8px}.__P__-operator-dismiss svg{width:16px;height:16px}@media(prefers-reduced-motion:reduce){.__P__-operator-banner[data-mode=awaiting-operator] .__P__-operator-pulse{animation:none}}@keyframes __P__-operator-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.7)}}.__P__-login-bar{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;column-gap:10px;padding:6px 8px;padding-inline-start:14px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);font-size:var(--__P__-text-sm);line-height:1.4}.__P__-login-bar-icon,.__P__-login-gate-icon{display:inline-flex;color:var(--__P__-fg-muted)}.__P__-login-bar-icon svg{width:16px;height:16px}.__P__-login-bar-text{text-wrap:pretty}.__P__-login-bar[data-kind=user]{grid-template-columns:auto minmax(0,1fr);padding-inline-end:14px;color:var(--__P__-fg-muted)}.__P__-login-bar[data-kind=user] .__P__-login-bar-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-login-bar-action{appearance:none;border:0;cursor:pointer;padding:6px 12px;border-radius:999px;background:transparent;color:var(--__P__-accent-fg);font:inherit;font-weight:600;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-login-bar-action:hover{background:var(--__P__-hover)}.__P__-login-bar-action:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px}.__P__-login-bar-hide{width:28px;height:28px}.__P__-login-bar-hide:before{inset:-8px}.__P__-login-bar-hide svg{width:16px;height:16px}.__P__-login-gate{display:flex;flex-direction:column;align-items:center;gap:10px;box-sizing:border-box;width:calc(100% - 2 * var(--__P__-space-3));max-width:var(--__P__-conversation-max, 768px);margin:0 auto var(--__P__-space-3);padding:18px 16px;border-radius:var(--__P__-radius-lg);background:var(--__P__-bg-elevated);box-shadow:inset 0 0 0 1px var(--__P__-border);text-align:center}.__P__-login-gate[data-alone]{flex:1;justify-content:center;margin-block-start:var(--__P__-space-3);background:transparent;box-shadow:none}.__P__-login-gate-icon{align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;background:var(--__P__-bg);box-shadow:inset 0 0 0 1px var(--__P__-border)}.__P__-login-gate[data-alone] .__P__-login-gate-icon{width:48px;height:48px;background:var(--__P__-bg-elevated)}.__P__-login-gate-icon svg{width:20px;height:20px}.__P__-form-actions.__P__-login-gate-actions{justify-content:center;width:100%;max-width:320px;margin-top:var(--__P__-space-1)}.__P__-login-gate-title{margin:0;color:var(--__P__-fg);font-size:var(--__P__-text-md);font-weight:600;line-height:1.35;text-wrap:balance}.__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);color:var(--__P__-fg);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-fg)}.__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-fg);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,.__P__-panel[data-resizing] .__P__-resize-grip{opacity:1}.__P__-resize-grip:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px;border-radius:4px}.__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)}.__P__-resize-grip--edge{top:0;bottom:0;left:0;width:8px;height:auto;opacity:1;cursor:ew-resize}.__P__-resize-grip--edge:focus-visible{outline:none}.__P__-resize-grip--edge:after{content:"";position:absolute;top:var(--__P__-radius, 12px);bottom:var(--__P__-radius, 12px);left:0;width:2px;border-radius:1px;background:var(--__P__-focus);opacity:0;transition:opacity var(--__P__-dur-base) var(--__P__-ease)}:host([data-position$="-left"]) .__P__-resize-grip--edge,:host([data-position$="-left"]) .__P__-resize-grip--edge:after{left:auto;right:0}.__P__-resize-grip--edge:hover:after{opacity:1;transition-delay:.15s}.__P__-resize-grip--edge:focus-visible:after,.__P__-panel[data-resizing] .__P__-resize-grip--edge:after{opacity:1}@media(pointer:coarse){.__P__-resize-grip{width:24px;height:24px}.__P__-resize-grip--edge{width:14px;height:auto}}:host(:not([data-mode="open"]):not([data-mode="expanded"]):not([data-mode="drawer"])) .__P__-resize-grip{display:none}@media(max-width:640px){.__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__-help-more{justify-content:center;color:var(--__P__-accent-fg);font-weight:600}.__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)}@media(hover:hover){.__P__-tab:hover{background:var(--__P__-hover)}}.__P__-tab[aria-selected=true]{color:var(--__P__-accent-fg)}.__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:-2px;left:calc(50% + 6px);width:8px;height:8px;border-radius:50%;background:var(--__P__-accent);box-shadow:0 0 0 2px var(--__P__-bg-elevated)}.__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:var(--__P__-radius-md);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:var(--__P__-radius-md);background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent-fg)}.__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;line-height:1.45}.__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{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search[data-input=true]:focus-within{outline:none;border-color:var(--__P__-focus)}.__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-input:focus-visible{outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent-fg)}.__P__-home-ask{padding-block:6px;padding-inline-end:6px}.__P__-home-ask .__P__-send{width:32px;height:32px;flex-shrink:0}.__P__-home-ask .__P__-send[data-shape=pill]{width:auto;padding:0 14px}.__P__-home-ask .__P__-send svg{width:16px;height:16px}.__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-fg);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__-history>*,.__P__-home-scroll>*,.__P__-module-scroll>*,.__P__-help-list>*,.__P__-history-footer>*,.__P__-module-pad{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-header,.__P__-back-header{padding-inline:max(12px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__P__-tabbar{padding-inline:max(0px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__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-vote{display:flex;align-items:center;flex-wrap:wrap;gap:var(--__P__-space-2);padding-top:var(--__P__-space-3);border-top:1px solid var(--__P__-border)}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:start;line-height:1.45;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface);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-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px;color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-news-tag{padding:1px 8px;border-radius:6px;background:var(--__P__-hover);color:var(--__P__-fg);font-size:calc(12px * var(--__P__-text-scale));white-space:nowrap}.__P__-news-more{display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);width:100%;min-height:44px;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);background:var(--__P__-surface);color:var(--__P__-accent-fg);font-weight:600}.__P__-news-more:hover{background:var(--__P__-bg-elevated)}.__P__-news-more:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__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__-panel-notice{display:flex;align-items:center;justify-content:center;position:relative;padding:var(--__P__-space-6);text-align:center}.__P__-panel-notice-close{position:absolute;top:12px;inset-inline-end:12px}.__P__-panel-notice-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-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--__P__-space-2)}.__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-type{flex-shrink:0;align-self:center;margin-inline-start:auto;border:1px solid var(--__P__-border);border-radius:5px;background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);padding:1px 7px;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);white-space:nowrap}.__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__-textarea,.__P__-home-search-input,.__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__-toolui{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)}.__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;-webkit-tap-highlight-color:transparent;user-select: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-name-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-toolui-chevron{display:inline-flex;color:var(--__P__-fg-muted);transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}details.__P__-toolui-collapsible>summary .__P__-toolui-status{margin-inline-start:auto}.__P__-toolui-chevron svg{width:16px;height:16px}details.__P__-toolui-collapsible[open]>summary .__P__-toolui-chevron{transform:rotate(180deg)}.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{--__P__-pill: var(--__P__-fg-muted);display:inline-flex;min-width:0;align-items:center;gap:5px;padding:3px 7px;border-radius:5px;border:1px solid var(--__P__-border);background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);color:var(--__P__-pill);font-size:var(--__P__-text-xs);font-weight:600;white-space:nowrap}.__P__-toolui-badge svg,.__P__-toolui-name-pill svg,.__P__-toolui-q-pill svg{flex-shrink:0;width:14px;height:14px}.__P__-toolui-status-icon{display:inline-flex}.__P__-toolui-name-pill{--__P__-pill: oklch(.68 .13 233)}.__P__-toolui-q-pill{--__P__-pill: oklch(.66 .12 195)}.__P__-toolui-status[data-status=done]{--__P__-pill: var(--__P__-success, #16a34a)}.__P__-toolui-status[data-status=approved],.__P__-toolui-status[data-status=submitted]{--__P__-pill: oklch(.62 .15 255)}.__P__-toolui-status[data-status=waiting]{--__P__-pill: var(--__P__-warning, #f59e0b)}.__P__-toolui-status[data-status=declined]{--__P__-pill: oklch(.66 .16 45)}.__P__-toolui-status[data-status=failed]{--__P__-pill: var(--__P__-danger, #dc2626)}.__P__-toolui-status[data-status=replaced],.__P__-toolui-status[data-status=running],.__P__-toolui-status[data-status=stopped]{--__P__-pill: var(--__P__-fg-muted)}@supports (color: oklch(from red l c h)){.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{color:oklch(from var(--__P__-pill) clamp(var(--__P__-pill-l-min),l,var(--__P__-pill-l-max)) c h)}}.__P__-toolui-head{display:flex;align-items:center;flex-wrap:wrap;gap:var(--__P__-space-2)}.__P__-toolui-head-end{display:inline-flex;align-items:center;gap:var(--__P__-space-2);margin-inline-start:auto}.__P__-toolui-collapse-body{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-summary{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-toolui-collapse-body>.__P__-form{gap:var(--__P__-space-3)}.__P__-toolui-collapse-body>.__P__-form>.__P__-field,.__P__-toolui-summary>.__P__-field{padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:color-mix(in oklab,var(--__P__-bg) 80%,transparent);line-height:1.5}.__P__-toolui-collapse-body>.__P__-form>.__P__-field{gap:var(--__P__-space-2)}.__P__-toolui-summary>.__P__-field{gap:var(--__P__-space-1)}.__P__-toolui-summary .__P__-field-label{color:var(--__P__-fg-muted)}.__P__-toolui-answer{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted);overflow-wrap:anywhere;white-space:pre-wrap}.__P__-toolui-footer{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);margin-inline:calc(-1 * var(--__P__-space-4));padding:var(--__P__-space-3) var(--__P__-space-4) 0;border-top:1px solid var(--__P__-border)}.__P__-toolui-options-toggle{display:inline-flex;align-items:center;gap:4px;border:0;background:transparent;padding:0;cursor:pointer;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);transition:color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-toolui-options-toggle:hover{color:var(--__P__-fg)}.__P__-toolui-options-chevron{display:inline-flex;transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-toolui-options-chevron svg{width:14px;height:14px}.__P__-toolui-options-chevron.__P__-open{transform:rotate(180deg)}.__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-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-system{min-width:0;overflow:hidden;color:var(--__P__-fg-muted);text-overflow:ellipsis;white-space:nowrap}.__P__-toolui-preview{min-width:0}.__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-fields{max-height:240px;overflow:auto;overscroll-behavior:contain;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm)}.__P__-toolui-fields table{width:100%;border-collapse:collapse;font-size:var(--__P__-text-sm);line-height:1.5}.__P__-toolui-fields tr:nth-child(2n){background:color-mix(in oklab,var(--__P__-fg) 4%,transparent)}.__P__-toolui-fields tr+tr{border-top:1px solid var(--__P__-border)}.__P__-toolui-fields th,.__P__-toolui-fields td{padding:6px var(--__P__-space-2);text-align:start;vertical-align:top}.__P__-toolui-fields th{width:1%;color:var(--__P__-fg-muted);font-weight:400;white-space:nowrap}.__P__-toolui-fields td{color:var(--__P__-fg);white-space:pre-wrap;overflow-wrap:anywhere}.__P__-toolui-fields[data-plain=true]{border:0;border-radius:0}.__P__-toolui-fields[data-plain=true] tr:nth-child(2n){background:none}.__P__-toolui-fields[data-plain=true] tr+tr{border-top:0}.__P__-toolui-fields[data-plain=true] th,.__P__-toolui-fields[data-plain=true] td{padding:1px var(--__P__-space-2) 1px 0}.__P__-toolui-raw>summary{width:fit-content;color:var(--__P__-fg-muted);cursor:pointer}.__P__-toolui-raw>summary:hover{color:var(--__P__-fg)}.__P__-toolui-raw>summary:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-toolui-raw[open]{display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__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}
|
|
5
|
-
`;var
|
|
6
|
-
`;var
|
|
7
|
-
`;var
|
|
8
|
-
`).replace(/__P__/g,Fv).replaceAll("__BRAND_ACCENT_TEXT__",jv).replaceAll("__BRAND_ACCENT__",Hv).replaceAll("__BRAND_RADIUS__",Vv).replaceAll("__BRAND_FONT__",Wv);var Od=["data-theme","data-color-scheme","data-mode","data-bs-theme"];function Nd(e){if(e){if(e.classList.contains("dark"))return"dark";if(e.classList.contains("light"))return"light";for(let t of Od){let r=e.getAttribute(t);if(r==="dark"||r==="light")return r}}}function ki(e=document){let t=Nd(e.documentElement)??Nd(e.body);if(t)return t;let r=getComputedStyle(e.documentElement).colorScheme.trim();return r==="dark"||r==="light"?r:typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function $d(e,t=document){let r=ki(t);e(r);function n(){let i=ki(t);i!==r&&(r=i,e(i))}let o=new MutationObserver(n),s={attributes:!0,attributeFilter:["class","style",...Od]};o.observe(t.documentElement,s),t.body&&o.observe(t.body,s);let a=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):void 0;return a?.addEventListener("change",n),()=>{o.disconnect(),a?.removeEventListener("change",n)}}var Gv=ie.scope("mount"),Dd=new WeakMap,Kv={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 Bs(e,t){let r=t==="flow"?e.style.height:"";e.style.cssText=Kv[t],r&&(e.style.height=r)}function Ci(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function qd(e={}){let t=e.position??"flow";Gv.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let r=`${q.cssPrefix}-chat-host`;typeof customElements<"u"&&!customElements.get(r)&&customElements.define(r,class extends HTMLElement{});let n;e.existingHost?n=e.existingHost:(n=document.createElement(r),(e.target??document.body).appendChild(n)),n.setAttribute("data-brand",q.id),Bs(n,t);let o=n.shadowRoot??n.attachShadow({mode:"open"});for(let i of["keydown","keypress","keyup"])o.addEventListener(i,Qv);let s=n.ownerDocument;if(!Yv(o,s)){let i=s.createElement("style");i.textContent=Us,o.appendChild(i)}let a=document.createElement("div");return a.className=`${q.cssPrefix}-app`,o.appendChild(a),{appRoot:a,destroy:()=>n.remove(),hostElement:n,shadowRoot:o}}function Qv(e){if(e instanceof KeyboardEvent&&(e.metaKey||e.ctrlKey))return;let t=e.composedPath()[0];t instanceof HTMLElement&&(t.isContentEditable||t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT")&&e.stopPropagation()}function Yv(e,t){if(!("adoptedStyleSheets"in e))return!1;let r=t.defaultView;if(!r||typeof r.CSSStyleSheet!="function")return!1;let n=Dd.get(t);if(!n)try{n=new r.CSSStyleSheet,n.replaceSync(Us),Dd.set(t,n)}catch{return!1}try{return e.adoptedStyleSheets=[n],!0}catch{return!1}}function Jv(e,t){let r=q.cssPrefix;t.accent&&e.style.setProperty(`--${r}-accent-user`,t.accent),t.accentText&&e.style.setProperty(`--${r}-accent-text-user`,t.accentText),t.radius&&e.style.setProperty(`--${r}-radius`,t.radius),t.fontFamily&&e.style.setProperty(`--${r}-font`,t.fontFamily),t.contentMaxWidth&&e.style.setProperty(`--${r}-conversation-max`,t.contentMaxWidth)}function Xv(e,t){e.dataset.theme=t==="host"?ki():t}function Zv(e,t){let r=q.cssPrefix;t.width!==void 0&&e.style.setProperty(`--${r}-panel-w`,t.width),t.height!==void 0&&e.style.setProperty(`--${r}-panel-h`,t.height),t.expanded?.width!==void 0&&e.style.setProperty(`--${r}-expanded-w`,t.expanded.width),t.expanded?.height!==void 0&&e.style.setProperty(`--${r}-expanded-h`,t.expanded.height),t.inset!==void 0&&e.style.setProperty(`--${r}-panel-inset`,t.inset)}function eh(e,t){e.dataset.position=t}function Ti(e,t){e.dataset.mode=t}function Ud(e,t){Xv(e,t.themeMode),Jv(e,t.themeOverrides),eh(e,t.position),Zv(e,t.size)}var Xr,ct,zs,Bd,Fs=Object.is,no=0,Qd=[],Hs=[],lt=xe,zd=lt.__b,Fd=lt.__r,Hd=lt.diffed,jd=lt.__c,Vd=lt.unmount,Wd=lt.__;function oo(e,t){lt.__h&<.__h(ct,e,no||t),no=0;var r=ct.__H||(ct.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function U(e){return no=1,Yd(Jd,e)}function Yd(e,t,r){var n=oo(Xr++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Jd(void 0,t),function(s){var a=(n.__N||n.__)[0],i=n.t(a,s);Fs(a,i)||(n.__N=[i,n.__[1]],n.__c.setState({}))}],n.__c=ct,!ct.__f)){ct.__f=!0;var o=ct.shouldComponentUpdate;ct.shouldComponentUpdate=function(s,a,i){var c=this.__H;if(!c)return!0;var u=!1,p=this.props!=s;if(c.__.some(function(d){d.__N&&(u=!0,Fs(d.__[0],d.__N[0])||(p=!0))}),o){var _=o.call(this,s,a,i);return u?_||p:_}return!u||p}}return n.__}function F(e,t){var r=oo(Xr++,3);!lt.__s&&Vs(r.__H,t)&&(r.__P=!0,r.__=e,r.u=t,ct.__H.__h.push(r))}function St(e,t){var r=oo(Xr++,4);!lt.__s&&Vs(r.__H,t)&&(r.__P=!1,r.__=e,r.u=t,ct.__h.push(r))}function B(e){return no=5,Ce(function(){return{current:e}},[])}function Ce(e,t){var r=oo(Xr++,7);return Vs(r.__H,t)&&(r.__=e(),r.__H=t),r.__}function j(e,t){return no=8,Ce(function(){return e},t)}function io(){var e=oo(Xr++,11);if(!e.__){for(var t=ct.__v;!t.__m&&t.__;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function th(){var e;do{for(;e=Hs.shift();)try{ro(e)}catch(r){lt.__e(r,{__:(e=e.__P)&&e.__v})}for(;e=Qd.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(ro),t.__h.some(js),t.__h=[]}catch(r){t.__h=[],lt.__e(r,e.__v)}}}while(Hs.length)}lt.__b=function(e){ct=null,zd&&zd(e)},lt.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Wd&&Wd(e,t)},lt.__r=function(e){Fd&&Fd(e),Xr=0;var t=(ct=e.__c).__H;t&&(zs==ct?ct.__h=[]:(t.__h.some(ro),t.__h.some(js),Xr=0),t.__h=[],t.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})),zs=ct},lt.diffed=function(e){Hd&&Hd(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&Kd(Qd.push(t)),t.__H.__.some(function(r){r.u&&(r.__H=r.u)})),zs=ct=null},lt.__c=function(e,t){t.some(function(r){try{r.__h.some(ro),r.__h=r.__h.filter(function(n){return!n.__||js(n)})}catch(n){r.__h=[function(){throw n}]}}),jd&&jd(e,t)},lt.unmount=function(e){Vd&&Vd(e);var t,r,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{if(o.__P&&o.__c){if(r===void 0){for(r=e.__;r&&(!r.__c||!r.__c.__P);)r=r.__;r=r&&r.__c}o.__P=r,Kd(Hs.push(o))}else ro(o)}catch(s){t=s}}),n.__H=void 0,t&<.__e(t,n.__v))};var Gd=typeof requestAnimationFrame=="function";function rh(e){var t,r=function(){clearTimeout(n),Gd&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);Gd&&(t=requestAnimationFrame(r))}function Kd(e){e!=1&&Bd==lt.requestAnimationFrame||((Bd=lt.requestAnimationFrame)||rh)(th)}function ro(e){var t=ct,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),ct=t}function js(e){var t=ct;e.__c=e.__(),ct=t}function Vs(e,t){return!e||e.length!=t.length||t.some(function(r,n){return!Fs(r,e[n])})}function Jd(e,t){return typeof t=="function"?t(e):t}var nh=Symbol.for("preact-signals");function Ei(){if(vr>1)vr--;else{var e,t=!1;for((function(){var o=Ri;for(Ri=void 0;o!==void 0;){var s=o.S;if(s.v===o.v)for(var a=s.t;a!==void 0;a=a.x)a.i===o.i&&(a.i=s.i);o=o.o}})();so!==void 0;){var r=so;for(so=void 0,Ii++;r!==void 0;){var n=r.u;if(r.u=void 0,r.f&=-3,!(8&r.f)&&Zd(r))try{r.c()}catch(o){t||(e=o,t=!0)}r=n}}if(Ii=0,vr--,t)throw e}}function er(e){if(vr>0)return e();Ws=++oh,vr++;try{return e()}finally{Ei()}}var ao,Qe=void 0;function lo(e){var t=Qe,r=ao;Qe=void 0,ao=void 0;try{return e()}finally{Qe=t,ao=r}}var so=void 0,vr=0,Ii=0,oh=0,Ws=0,Ri=void 0,Ai=0;function Xd(e){if(Qe!==void 0){var t=e.n;if(t===void 0||t.t!==Qe)return t={i:0,S:e,p:Qe.s,n:void 0,t:Qe,e:void 0,x:void 0,r:t},Qe.s!==void 0&&(Qe.s.n=t),Qe.s=t,e.n=t,32&Qe.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=Qe.s,t.n=void 0,Qe.s.n=t,Qe.s=t),t}}function wt(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}wt.prototype.brand=nh;wt.prototype.h=function(){return!0};wt.prototype.S=function(e){var t=this,r=this.t;r!==e&&e.e===void 0&&(e.x=r,this.t=e,r!==void 0?r.e=e:lo(function(){var n;(n=t.W)==null||n.call(t)}))};wt.prototype.U=function(e){var t=this;if(this.t!==void 0){var r=e.e,n=e.x;r!==void 0&&(r.x=n,e.e=void 0),n!==void 0&&(n.e=r,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&lo(function(){var o;(o=t.Z)==null||o.call(t)}))}};wt.prototype.subscribe=function(e){var t=this;return nr(function(){var r=t.value;lo(function(){return e(r)})},{name:"sub"})};wt.prototype.valueOf=function(){return this.value};wt.prototype.toString=function(){return this.value+""};wt.prototype.toJSON=function(){return this.value};wt.prototype.peek=function(){var e=this;return lo(function(){return e.value})};Object.defineProperty(wt.prototype,"value",{get:function(){var e=Xd(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Ii>100)throw new Error("Cycle detected");(function(r){vr!==0&&Ii===0&&r.l!==Ws&&(r.l=Ws,Ri={S:r,v:r.v,i:r.i,o:Ri})})(this),this.v=e,this.i++,Ai++,vr++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Ei()}}}});function oe(e,t){return new wt(e,t)}function Zd(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 eu(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function tu(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function Zr(e,t){wt.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Ai-1,this.f=4}Zr.prototype=new wt;Zr.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ai))return!0;if(this.g=Ai,this.f|=1,this.i>0&&!Zd(this))return this.f&=-2,!0;var e=Qe;try{eu(this),Qe=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return Qe=e,tu(this),this.f&=-2,!0};Zr.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)}wt.prototype.S.call(this,e)};Zr.prototype.U=function(e){if(this.t!==void 0&&(wt.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)}};Zr.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(Zr.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Xd(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function dt(e,t){return new Zr(e,t)}function ru(e){var t=e.j;if(e.j=void 0,typeof t=="function"){vr++;var r=Qe;Qe=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Gs(e),n}finally{Qe=r,Ei()}}}function Gs(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ru(e)}function ih(e){if(Qe!==this)throw new Error("Out-of-order effect");tu(this),Qe=e,this.f&=-2;try{8&this.f&&Gs(this)}finally{Ei()}}function Tn(e,t){this.x=e,this.j=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,ao&&ao.push(this)}Tn.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.j=t)}finally{e()}};Tn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ru(this),eu(this),vr++;var e=Qe;return Qe=this,ih.bind(this,e)};Tn.prototype.N=function(){2&this.f||(this.f|=2,this.u=so,so=this)};Tn.prototype.d=function(){this.f|=8,1&this.f||Gs(this)};Tn.prototype.dispose=function(){this.d()};function nr(e,t){var r=new Tn(e,t);try{r.c()}catch(o){throw r.d(),o}var n=r.d.bind(r);return n[Symbol.dispose]=n,n}var nu,uo,Mi,ah=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var ou=[];nr(function(){nu=this.N})();function In(e,t){xe[e]=t.bind(null,xe[e]||function(){})}function co(e){if(Mi){var t=Mi;Mi=void 0,t()}Mi=e&&e.S()}function iu(e){var t=this,r=e.data,n=Lt(r);n.name="ReactiveDom",n.value=r;var o=Ce(function(){for(var i=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var u=dt(function(){var f=n.value.value;return f===0?0:f===!0?"":f||""}),p=dt(function(){return!Array.isArray(u.value)&&!ps(u.value)}),_=nr(function(){if(this.N=au,p.value){var f=u.value;i.__v&&i.__v.__e&&i.__v.__e.nodeType===3&&(i.__v.__e.data=f)}}),d=t.__$u.d;return t.__$u.d=function(){_(),d.call(this)},[p,u]},[]),s=o[0],a=o[1];return s.value?a.peek():a.value}iu.displayName="ReactiveTextNode";Object.defineProperties(wt.prototype,{constructor:{configurable:!0,value:Ir(he,null).constructor},type:{configurable:!0,value:iu},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});In("__b",function(e,t){if(co(),uo=void 0,typeof t.type=="string"){var r,n=t.props;for(var o in n)if(o!=="children"){var s=n[o];s instanceof wt&&(r||(t.__np=r={}),r[o]=s,n[o]=s.peek())}}e(t)});In("__r",function(e,t){if(e(t),t.type!==he){co();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=(function(o,s){var a;return nr(function(){a=this},{name:s}),a.c=o,a})((function(o){return function(){var s;ah&&((s=this.y)==null||s.call(this)),o.__$f|=1,o.setState({})}})(n),typeof t.type=="function"?t.type.displayName||t.type.name:""))),uo=n,co(r)}});In("__e",function(e,t,r,n){co(),uo=void 0,e(t,r,n)});In("diffed",function(e,t){co(),uo=void 0;var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,o=t.props,s=r.U;if(s)for(var a in s){var i=s[a];i===void 0||n&&a in n||(i.d(),s[a]=void 0)}if(n){s||(s={},r.U=s);for(var c in n){var u=s[c],p=n[c];u===void 0?(u=sh(r,c,p,o),s[c]=u):u.o(p,o)}}}e(t)});function sh(e,t,r,n){var o=t in e&&e.ownerSVGElement===void 0,s=oe(r);return{o:function(a,i){s.value=a,n=i},d:nr(function(){this.N=au;var a=s.value.value;n[t]!==a&&(n[t]=a,o?e[t]=a:a!=null&&(a!==!1||t[4]==="-")?e.setAttribute(t,a):e.removeAttribute(t))})}}In("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var o in n){var s=n[o];s&&s.d()}}}var a=t.__np;if(a){var i=t.props;for(var c in a)i[c]=a[c]}t.__np=void 0}else{var u=t.__c;if(u){u.__$f|=8;var p=u.__$u;p&&(u.__$u=void 0,p.d())}}e(t)});In("__h",function(e,t,r,n){n<3&&(t.__$f|=2),e(t,r,n)});Zt.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var r=this.__$u,n=r&&r.s!==void 0;for(var o in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var s=2&this.__$f;if(!(n||s||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var a in e)if(a!=="__source"&&e[a]!==this.props[a])return!0;for(var i in this.props)if(!(i in e))return!0;return!1};function Lt(e,t){return Ce(function(){return oe(e,t)},[])}function Rt(e,t){var r=B(e);return r.current=e,uo.__$f|=4,Ce(function(){return dt(function(){return r.current()},t)},[])}var lh=function(e){queueMicrotask(function(){queueMicrotask(e)})};function ch(){er(function(){for(var e;e=ou.shift();)nu.call(e)})}function au(){ou.push(this)===1&&(xe.requestAnimationFrame||lh)(ch)}var dh="x-public-key",uh="x-ai-agent-deployment-id";function su(e){if(!e.aiAgentDeploymentId)throw new Error("aiAgentDeploymentId is required");return{headers(){let t={[uh]:e.aiAgentDeploymentId};return e.publicKey&&(t[e.publicKeyHeader??dh]=e.publicKey),t}}}var ph=new Set(["home","chats","help","news"]);function lu(e){return typeof e!="object"||e===null||!("to"in e)||typeof e.to!="string"||!ph.has(e.to)?!1:!("id"in e)||e.id===void 0||typeof e.id=="string"}function Li(e){let[t="",...r]=e.trim().split("/");if(t===""||t==="open")return;let n=r.join("/");return n?{to:t,id:n}:{to:t}}function po(e,t){return{text:e,send:typeof t=="object"&&t!==null&&"send"in t&&t.send===!0}}function cu(e){if(typeof e!="object"||e===null||!("text"in e)||typeof e.text!="string")return;let t=e.text.trim();return t?{text:t,send:"send"in e&&e.send===!0}:void 0}function du(e){return`${q.cssPrefix}:${e}`}function or(e,t,r){e.dispatchEvent(new CustomEvent(du(t),{detail:r}))}function uu(e,t){let r=Object.keys(t).filter(n=>Object.hasOwn(t,n)).map(n=>{let o=t[n],s=du(n);function a(i){return o(i instanceof CustomEvent?i.detail:void 0)}return e.addEventListener(s,a),[s,a]});return()=>{for(let[n,o]of r)e.removeEventListener(n,o)}}function Ni(e,t){let r=[],n;for(let o of e){let s=new URLSearchParams(o);s.has(t)?n??(n=s.get(t)??""):r.push(o)}return{value:n,rest:r}}function pu(e){let t=new URL(e),r=q.cssPrefix,n=`${q.cssPrefix}-ask`,o=t.search.slice(1).split("&").filter(Boolean),s=t.hash.slice(1).split("&").filter(Boolean),a=Ni(o,r),i=Ni(a.rest,n),c=Ni(s,r),u=Ni(c.rest,n),p=a.value??c.value,_=(i.value??u.value)?.trim()||void 0;if(!(p===void 0&&_===void 0))return t.search=i.rest.join("&"),t.hash=u.rest.join("&"),{target:p===void 0?void 0:Li(p),..._?{ask:_}:{},url:t.toString()}}var _h=ie.scope("events"),_o={open:!1,ready:!1,unread:0},Oi=class{constructor(){ee(this,"handlers",new Map);ee(this,"taps",new Set)}on(t,r){let n=this.handlers.get(t);return n||(n=new Set,this.handlers.set(t,n)),n.add(r),()=>this.handlers.get(t)?.delete(r)}tap(t){return this.taps.add(t),()=>this.taps.delete(t)}listensTo(t){return(this.handlers.get(t)?.size??0)>0||[...this.taps].some(r=>r.listensTo(t))}emit(t,r){for(let n of this.handlers.get(t)??[])try{n(r)}catch(o){_h.warn("listener threw",{event:t,error:o})}for(let n of this.taps)n.hear(t,r)}clear(){this.handlers.clear(),this.taps.clear()}};var _u=ie.scope("feedback:audio"),$i=class{constructor(){ee(this,"ctx",null);ee(this,"master",null);ee(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(r){_u.warn("AudioContext init failed",{err:r})}}setVolume(t){if(!this.master||!this.ctx)return;let r=Math.max(0,Math.min(1,t));this.master.gain.setTargetAtTime(r,this.ctx.currentTime,.01)}playTone(t){let r=this.ctx,n=this.master;if(!r||!n||r.state!=="running")return;let o=r.currentTime,s=t.noteMs/1e3;t.notes.forEach((a,i)=>{let c=r.createOscillator();c.type=t.type,c.frequency.value=a;let u=r.createGain(),p=o+i*s;u.gain.setValueAtTime(1e-4,p),u.gain.exponentialRampToValueAtTime(t.peakGain,p+.005),u.gain.exponentialRampToValueAtTime(1e-4,p+s),c.connect(u).connect(n),c.start(p),c.stop(p+s+.01)})}async playUrl(t){let r=this.ctx,n=this.master;if(!r||!n||r.state!=="running")return;let o=await this.getBuffer(t);if(!o)return;let s=r.createBufferSource();s.buffer=o,s.connect(n),s.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 r=this.buffers.get(t);if(r)return r instanceof Promise,r;let n=this.ctx,o=fetch(t).then(s=>s.ok?s.arrayBuffer():Promise.reject(new Error(`fetch ${s.status}`))).then(s=>n.decodeAudioData(s)).then(s=>(this.buffers.set(t,s),s)).catch(s=>(_u.warn("audio fetch/decode failed",{url:t,err:s}),this.buffers.delete(t),null));return this.buffers.set(t,o),o}};var fu={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},mu={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 Mr=null,Di=0;function fh(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function mh(){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=`__${q.cssPrefix}_haptic_${Math.random().toString(36).slice(2)}`;let t=document.createElement("label");t.htmlFor=e.id,t.setAttribute("aria-hidden","true");let r="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;";e.style.cssText=r,t.style.cssText=r;for(let n of[e,t])n.addEventListener("click",o=>o.stopPropagation());return document.body.append(e,t),{input:e,label:t}}function gu(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(fh())try{navigator.vibrate(e);return}catch{}if(Mr??(Mr=mh()),!!Mr)try{Mr.label.click()}catch{}}}function vu(){Di++;let e=!1;return()=>{e||(e=!0,Di=Math.max(0,Di-1),Di===0&&Mr&&(Mr.input.remove(),Mr.label.remove(),Mr=null))}}var gh=ie.scope("feedback"),vh=100,qi=class{constructor(t,r){ee(this,"mutedSig",oe(!1));ee(this,"audio",new $i);ee(this,"releaseHaptics");ee(this,"sound");ee(this,"haptics");ee(this,"lastPlayed",new Map);ee(this,"reducedMotionMq",null);this.sound=t,this.haptics=r,this.releaseHaptics=vu(),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,r){this.sound=t,this.haptics=r,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 r=this.lastPlayed.get(t);return r===void 0?!1:performance.now()-r<vh}playSound(t){let r=this.sound.events?.[t];if(r===!1)return;if(typeof r=="string"){this.audio.playUrl(r).catch(o=>gh.warn("audio play failed",{err:o,url:r}));return}let n=mu[t];n&&this.audio.playTone(n)}playHaptic(t){if(this.reducedMotionMq?.matches)return;let r=this.haptics.events?.[t];if(r===!1)return;let n=r===!0||r===void 0?fu[t]:r;gu(n)}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 hu(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ks(e){return hu(e)}function Qs(e){return!(!hu(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function Ui(e){if(typeof e!="object"||e===null)return{};let t=Reflect.get(e,"url");return{url:typeof t=="string"&&/^https?:\/\//i.test(t)&&t.includes("{returnTo}")?t:void 0,required:Reflect.get(e,"required")===!0,hidePrompt:Reflect.get(e,"hidePrompt")===!0,hideUser:Reflect.get(e,"hideUser")===!0}}function bu(e,t){let r=encodeURIComponent(t).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`);return e.replaceAll("{returnTo}",r)}function Pu(e){let t=e.split(".")[1];if(t)try{let r=atob(t.replace(/-/g,"+").replace(/_/g,"/")),n=JSON.parse(new TextDecoder().decode(Uint8Array.from(r,o=>o.charCodeAt(0))));return typeof n=="object"&&n!==null&&!Array.isArray(n)?Object.fromEntries(Object.entries(n)):void 0}catch{return}}function yu(e,t){let r=e?.[t];return typeof r=="string"&&r.trim()?{[t]:r.trim()}:{}}function xu(e){let t=Pu(e);return{...yu(t,"name"),...yu(t,"email")}}function Su(e){let t=Pu(e)?.sub;return typeof t=="string"&&t!==""?t:void 0}function wu(){try{return window.top?.location.href??location.href}catch{return location.href}}function ku(e){try{(window.top??window).location.assign(e)}catch{location.assign(e)}}var hh=Symbol.for("pv"),yh=0;function l(e,t,r,n,o,s){t||(t={});var a,i,c=t;if("ref"in c&&typeof e!="function")for(i in c={},t)i=="ref"?a=t[i]:c[i]=t[i];var u={type:e,props:c,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:hh,__v:--yh,__i:-1,__u:0};return(o||s)&&(u.__source=o,u.__self=s),xe.vnode&&xe.vnode(u),u}var Rn=1,fo=2,mo=4,Tu=8,Iu=16;function bh(e){switch(e){case Rn:return"href";case fo:return"src";case mo:return"class";case Tu:return"checked";case Iu:return"start"}}var Ph=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}},xh=Ph;var Cu=24;function go(e){let t=new Uint32Array(Cu);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(Cu),indent:"",indent_len:0,table_state:0}}function An(e){e.pending.length>0&&it(e,`
|
|
9
|
-
`)}function
|
|
10
|
-
`:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){
|
|
11
|
-
`:if(e.hr_chars<3)break;
|
|
12
|
-
`:{
|
|
13
|
-
`:e.table_state=2,e.pending="";continue;default:
|
|
14
|
-
`:
|
|
15
|
-
`:
|
|
4
|
+
`;var Id=`.__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-fg);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:18px;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;width:max-content;max-width:min(260px,calc(100vw - 100% - var(--__P__-callout-gap) - 32px));white-space:normal;overflow-wrap:anywhere}.__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)}.__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{flex-shrink:0;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;overflow:clip;overscroll-behavior:none;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:var(--__P__-visual-viewport-top, 0px) 0 auto;height:var(--__P__-visual-viewport-height, 100dvh);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:100%;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: clamp(440px, 32vw, 640px);--__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;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:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:100%;min-width:min(var(--__P__-resize-min-w, 0px),calc(100vw - var(--__P__-inset-x) * 2));max-width:var(--__P__-resize-max-w, none);max-height:none;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}}@media(max-width:640px){:host([data-mode="open"][data-position]) .__P__-anchor,:host([data-mode="expanded"][data-position]) .__P__-anchor,:host([data-mode="drawer"][data-position]) .__P__-anchor,:host([data-mode="modal"][data-position]) .__P__-anchor{inset:var(--__P__-visual-viewport-top, 0px) 0 auto;align-items:stretch;width:auto;height:var(--__P__-visual-viewport-height, 100dvh);padding:0}:host([data-mode="open"][data-position]) .__P__-panel,:host([data-mode="expanded"][data-position]) .__P__-panel,:host([data-mode="drawer"][data-position]) .__P__-panel,:host([data-mode="modal"][data-position]) .__P__-panel{width:100vw;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;border-radius:0;border:0;box-shadow:none;translate:none}:host([data-mode="modal"]){background:none;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__-header[data-variant=accent]{background:var(--__P__-accent);color:var(--__P__-on-accent);border-bottom-color:transparent}.__P__-header[data-variant=accent]>h1,.__P__-header[data-variant=accent] .__P__-agent-meta strong,.__P__-header[data-variant=accent] .__P__-agent-sub span,.__P__-header[data-variant=accent] .__P__-agent-ticket,.__P__-header[data-variant=accent] .__P__-agent-ticket:hover,.__P__-header[data-variant=accent]>.__P__-icon-btn,.__P__-header[data-variant=accent] .__P__-header-actions>.__P__-icon-btn,.__P__-header[data-variant=accent] .__P__-menu-wrap>.__P__-icon-btn{color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-header[data-variant=accent]>.__P__-icon-btn:hover,.__P__-header[data-variant=accent] .__P__-header-actions>.__P__-icon-btn:hover,.__P__-header[data-variant=accent] .__P__-menu-wrap>.__P__-icon-btn:hover{background:color-mix(in oklch,var(--__P__-on-accent) 16%,transparent);color:var(--__P__-on-accent)}.__P__-header[data-variant=accent]>.__P__-icon-btn:active,.__P__-header[data-variant=accent] .__P__-header-actions>.__P__-icon-btn:active,.__P__-header[data-variant=accent] .__P__-menu-wrap>.__P__-icon-btn:active{background:color-mix(in oklch,var(--__P__-on-accent) 24%,transparent)}.__P__-header[data-variant=accent] .__P__-agent-avatar{background:color-mix(in oklch,var(--__P__-on-accent) 18%,transparent);color:var(--__P__-on-accent)}.__P__-header[data-variant=accent] .__P__-agent-avatar:after{border-color:var(--__P__-accent)}.__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:var(--__P__-radius-md);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);flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;border-radius:inherit;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__-agent-sub{display:flex;gap:4px;min-width:0}.__P__-agent-sub button+span:before{content:"\\b7\\a0"}.__P__-agent-ticket{flex:none;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);cursor:copy}.__P__-agent-ticket:hover{color:var(--__P__-fg)}.__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[data-cut-end=true]{mask-image:linear-gradient(to right,#000 calc(100% - 32px),transparent)}.__P__-suggestions[data-cut-start=true]{mask-image:linear-gradient(to right,transparent,#000 32px)}.__P__-suggestions[data-cut-start=true][data-cut-end=true]{mask-image:linear-gradient(to right,transparent,#000 32px,#000 calc(100% - 32px),transparent)}:host([dir="rtl"]) .__P__-suggestions[data-cut-end=true]{mask-image:linear-gradient(to left,#000 calc(100% - 32px),transparent)}:host([dir="rtl"]) .__P__-suggestions[data-cut-start=true]{mask-image:linear-gradient(to left,transparent,#000 32px)}:host([dir="rtl"]) .__P__-suggestions[data-cut-start=true][data-cut-end=true]{mask-image:linear-gradient(to left,transparent,#000 32px,#000 calc(100% - 32px),transparent)}.__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-fg);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;position:relative;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 svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent-fg);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:0;bottom:14px;z-index:2;margin-inline:auto;display: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;overflow-anchor:none}.__P__-list--fade{--__P__-fade-size: 20px;--__P__-fade-top: 0px;--__P__-fade-bottom: 0px;-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%);mask-image:linear-gradient(to bottom,transparent 0,#000 var(--__P__-fade-top),#000 calc(100% - var(--__P__-fade-bottom)),transparent 100%)}.__P__-list--fade[data-fade-top=true]{--__P__-fade-top: var(--__P__-fade-size)}.__P__-list--fade[data-fade-bottom=true]{--__P__-fade-bottom: var(--__P__-fade-size)}.__P__-list>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-load-previous,.__P__-history-more{display:flex;justify-content:center}.__P__-load-previous button,.__P__-history-more button{border:0;padding:4px 8px;background:transparent;color:var(--__P__-accent);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;cursor:pointer}.__P__-load-previous button:hover,.__P__-history-more button:hover{text-decoration:underline}.__P__-load-previous button:focus-visible,.__P__-history-more button:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-load-previous button:disabled,.__P__-history-more button:disabled{cursor:wait;opacity:.6}.__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:1px solid var(--__P__-border);border-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble{display:flex;align-items:stretch;padding:0;overflow:hidden;background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-end-start-radius:5px}.__P__-bubble-row[data-role=operator] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-author{display:flex;flex:0 0 auto;align-items:center;padding:0 .875rem;border-inline-end:1px solid color-mix(in oklab,var(--__P__-accent),transparent 60%);color:var(--__P__-accent);font-size:calc(13px * var(--__P__-text-scale));font-weight:600;letter-spacing:.025em;user-select:none}.__P__-bubble-body{display:flex;flex-wrap:wrap;align-items:flex-start;gap:var(--__P__-space-3) 6px;min-width:0}.__P__-bubble-body>*{flex:1 0 100%;min-width:0}.__P__-bubble-body>.__P__-source,.__P__-bubble-body>.__P__-typing{flex:0 1 auto}.__P__-bubble-row[data-role=operator] .__P__-bubble-body{flex:1 1 auto;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4)}.__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,.__P__-steps){width:100%}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui,.__P__-steps) .__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-meta{display:flex;align-items:center;gap:8px;margin-top:2px;padding:0 2px;min-height:24px}.__P__-bubble-actions{display:flex;align-items:center;gap:2px}.__P__-bubble-time{font-size:calc(11px * var(--__P__-text-scale));line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-feedback{display:flex;align-items:center;gap:2px}.__P__-msg-action{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:var(--__P__-radius-sm);background:transparent;color:var(--__P__-fg-muted);cursor:pointer;opacity:.65;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-msg-action:hover{opacity:1;background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-msg-action:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-msg-action[data-active=true]{opacity:1;color:var(--__P__-accent-fg)}.__P__-msg-action svg{width:15px;height:15px}.__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 :not(pre)>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__-file-image,.__P__-file-chip{border-radius:var(--__P__-radius-sm);color:inherit;text-decoration:none}.__P__-file-image{display:block;width:fit-content;max-width:min(100%,240px);overflow:hidden}.__P__-file-image img{max-height:240px;object-fit:cover}.__P__-file-chip{display:flex;align-items:center;gap:var(--__P__-space-2);max-width:min(100%,280px);padding:var(--__P__-space-2);border:1px solid color-mix(in srgb,currentColor 18%,transparent);background:color-mix(in srgb,currentColor 5%,transparent);transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-file-chip:hover{background:color-mix(in srgb,currentColor 10%,transparent)}.__P__-file-image:focus-visible,.__P__-file-chip:focus-visible{outline:2px solid currentColor;outline-offset:2px}.__P__-file-chip-icon{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:var(--__P__-radius-sm);background:color-mix(in srgb,currentColor 10%,transparent)}.__P__-file-chip-text{display:grid;min-width:0;line-height:1.35}.__P__-file-chip-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-file-chip-meta{font-size:var(--__P__-text-xs);opacity:.75}.__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__-chat-notice{padding:0 var(--__P__-space-3);text-align:center;font-size:var(--__P__-text-xs);line-height:1.5;color:var(--__P__-fg-muted)}.__P__-chat-notice .__P__-md p{margin:0}.__P__-chat-notice .__P__-md a{color:var(--__P__-accent-fg)}.__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__-steps{min-width:0;font-size:var(--__P__-text-sm)}.__P__-steps-head,.__P__-steps-row-head{display:inline-flex;align-items:center;gap:var(--__P__-space-2);max-width:100%;min-width:0;min-height:28px;padding:0;border:0;background:none;color:var(--__P__-fg-muted);font:inherit;text-align:start;cursor:pointer;-webkit-tap-highlight-color:transparent}.__P__-steps-head:hover,.__P__-steps-row-head:hover{color:var(--__P__-fg)}.__P__-steps-head:focus-visible,.__P__-steps-row-head:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-steps-icon,.__P__-steps-row-icon{display:inline-flex;flex:none;align-items:center;justify-content:center;width:16px;height:16px}.__P__-steps-icon svg,.__P__-steps-row-icon svg{width:14px;height:14px}.__P__-steps-label,.__P__-steps-row-label{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-steps-sep{margin-inline:var(--__P__-space-1)}.__P__-steps-name .__P__-steps-count{margin-inline-start:var(--__P__-space-1)}.__P__-steps-count,.__P__-steps-failed,.__P__-steps-denied,.__P__-steps-time{flex:none;font-variant-numeric:tabular-nums}.__P__-steps-failed{color:var(--__P__-danger-text)}.__P__-steps-denied{color:var(--__P__-fg-muted)}.__P__-steps-decision{display:inline-flex;flex:none;align-items:center;gap:var(--__P__-space-1);font-variant-numeric:tabular-nums;color:var(--__P__-success)}.__P__-steps-decision[data-approved=false]{color:var(--__P__-warning)}.__P__-steps-decision svg{width:14px;height:14px}.__P__-steps-row-error{margin:0;color:var(--__P__-danger-text)}.__P__-steps-chevron{display:inline-flex;flex:none;width:16px;height:16px;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-steps-chevron svg{width:16px;height:16px}.__P__-steps-chevron[data-open=true]{transform:rotate(180deg)}.__P__-steps-list{position:relative;display:flex;flex-direction:column;gap:var(--__P__-space-1);margin:var(--__P__-space-1) 0 0;padding:0;list-style:none}.__P__-steps-list:before{content:"";position:absolute;inset-block:0;inset-inline-start:7px;width:2px;border-radius:1px;background:var(--__P__-border)}.__P__-steps-row{position:relative;display:grid;grid-template-columns:16px minmax(0,1fr);column-gap:var(--__P__-space-2);align-items:start}.__P__-steps-row .__P__-steps-row-icon{margin-block:6px;border-radius:999px;background:var(--__P__-bubble-assistant);color:var(--__P__-fg-muted)}.__P__-steps-row[data-status=error] .__P__-steps-row-icon{color:var(--__P__-danger-text)}.__P__-steps-row-main{display:flex;flex-direction:column;align-items:flex-start;min-width:0}.__P__-steps-row-name{color:var(--__P__-fg);font-weight:500}.__P__-steps-row-system,.__P__-steps-row-summary{margin-inline-start:var(--__P__-space-2);color:var(--__P__-fg-muted)}.__P__-steps-row-body{grid-column:2;display:flex;flex-direction:column;gap:var(--__P__-space-2);width:100%;margin:var(--__P__-space-1) 0 var(--__P__-space-2)}.__P__-steps-row[data-standalone=true]>:is(.__P__-steps-row-body,.__P__-steps-thought-text){grid-column:1 / -1}.__P__-steps-body{display:grid;grid-template-rows:0fr;transition:grid-template-rows .2s ease-out}.__P__-steps-body[data-open=true]{grid-template-rows:1fr}.__P__-steps-body-inner{min-height:0;overflow:hidden}.__P__-steps-live{min-width:0;overflow:hidden;text-overflow:ellipsis;background:linear-gradient(90deg,var(--__P__-fg-muted) 0%,var(--__P__-fg) 50%,var(--__P__-fg-muted) 100%) 0 0 / 200% 100%;background-clip:text;-webkit-background-clip:text;color:transparent;animation:__P__-steps-shimmer 2s linear infinite}@keyframes __P__-steps-shimmer{to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.__P__-steps-body,.__P__-steps-chevron{transition:none}.__P__-steps-live{background:none;color:var(--__P__-fg-muted);animation:none}}.__P__-steps-thought,.__P__-steps-stopped-label{color:var(--__P__-fg-muted)}.__P__-steps-thought-label,.__P__-steps-stopped-label{display:inline-flex;align-items:center;min-height:28px}.__P__-steps-thought-text{grid-column:2;width:100%;margin:var(--__P__-space-1) 0 var(--__P__-space-2)}.__P__-reasoning-body{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%;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__-compaction-status{width:100%;padding:10px 14px;justify-content:center;font-size:var(--__P__-text-xs)}.__P__-message-queue{display:flex;max-height:112px;flex-direction:column;gap:var(--__P__-space-1);overflow-y:auto}.__P__-attachment-chip.__P__-queued-message{width:100%;max-width:none}.__P__-queued-text{min-width:0;flex:1}.__P__-composer-row{--__P__-composer-line-height: 40px;display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;--__P__-textarea-base-height: 40px;height:var(--__P__-textarea-base-height);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)}.__P__-textarea:focus-visible{outline:none;border-color:var(--__P__-focus)}.__P__-textarea:placeholder-shown{white-space:nowrap;overflow:hidden}.__P__-textarea::placeholder{text-overflow:ellipsis}@media(pointer:coarse){.__P__-textarea{--__P__-textarea-base-height: 44px}.__P__-composer-row{--__P__-composer-line-height: 44px}.__P__-composer-row>.__P__-send{margin-block-end:2px}}.__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-fg);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-fg)}.__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;margin-block-end:calc((var(--__P__-composer-line-height) - 32px) / 2)}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{position:relative;display:inline-flex;align-items:center;gap:8px;padding:5px;border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:220px;overflow:hidden}.__P__-attachment-chip[data-upload=error]{border-color:color-mix(in oklab,var(--__P__-danger) 45%,transparent);background:color-mix(in oklab,var(--__P__-danger) 6%,var(--__P__-bg-elevated))}.__P__-attachment-thumb{flex-shrink:0;width:32px;height:32px;border-radius:var(--__P__-radius-sm);object-fit:cover;background:var(--__P__-border);display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-text{display:flex;flex-direction:column;min-width:0;line-height:1.3}.__P__-attachment-name{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--__P__-fg);font-weight:500}.__P__-attachment-meta{display:inline-flex;align-items:center;gap:4px;color:var(--__P__-fg-muted);font-variant-numeric:tabular-nums;white-space:nowrap}.__P__-attachment-meta svg{flex:none;width:12px;height:12px}.__P__-attachment-chip[data-upload=error] .__P__-attachment-meta{color:var(--__P__-danger)}.__P__-attachment-chip[data-upload=done] .__P__-attachment-meta svg{color:var(--__P__-success)}.__P__-attachment-progress{position:absolute;inset-inline:0;bottom:0;height:2px;background:color-mix(in oklab,var(--__P__-accent) 15%,transparent)}.__P__-attachment-progress>span{display:block;height:100%;background:var(--__P__-accent);transition:width var(--__P__-dur-quick) var(--__P__-ease)}.__P__-attachment-remove{flex-shrink:0;width:24px;height:24px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove svg{width:14px;height:14px}.__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%,color-mix(in srgb,var(--__P__-bg) 92%,transparent));display:flex;flex-direction:column;gap:10px;align-items:center;justify-content:center;text-align:center;padding:16px;font-weight:600;color:var(--__P__-accent-fg);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}.__P__-dropzone-icon{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:999px;background:color-mix(in srgb,var(--__P__-accent) 14%,transparent)}.__P__-dropzone-icon svg{width:22px;height:22px}.__P__-dropzone[data-state=reject]{border-color:var(--__P__-danger);background:color-mix(in srgb,var(--__P__-danger) 8%,color-mix(in srgb,var(--__P__-bg) 92%,transparent));color:var(--__P__-danger)}.__P__-dropzone[data-state=reject] .__P__-dropzone-icon{background:color-mix(in srgb,var(--__P__-danger) 14%,transparent)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{display:flex;align-items:center;gap:var(--__P__-space-2);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)}.__P__-error-icon{display:inline-flex;flex:none;width:16px;height:16px;color:var(--__P__-danger-text)}.__P__-error-icon svg{width:16px;height:16px}.__P__-error-text{min-width:0}.__P__-error-retry{flex:none;margin-inline-start:auto;min-height:28px;border:0;background:none;padding:0;color:var(--__P__-accent-fg);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;text-decoration:underline;white-space:nowrap;cursor:pointer}.__P__-error-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size: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-card>[role=listitem]{display:flex;flex-direction:column}.__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-card>*+*{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:var(--__P__-radius-md);background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent-fg)}.__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-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:var(--__P__-radius-md)}.__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__-transcript-layer{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-4);border-radius:inherit;overflow:hidden}.__P__-transcript-backdrop{position:absolute;inset:0;background:var(--__P__-backdrop);animation:__P__-transcript-fade var(--__P__-dur-base) var(--__P__-ease-out)}.__P__-transcript-sheet{position:relative;display:flex;flex-direction:column;gap:var(--__P__-space-3);box-sizing:border-box;width:100%;max-width:360px;padding:var(--__P__-space-4);border-radius:var(--__P__-radius-lg);background:var(--__P__-bg);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel),inset 0 0 0 1px var(--__P__-border);animation:__P__-transcript-in var(--__P__-dur-base) var(--__P__-ease-out)}.__P__-transcript-sheet-head{display:flex;align-items:center;gap:var(--__P__-space-2);margin-block:-4px;margin-inline-end:-6px}.__P__-transcript-sheet-icon{display:inline-flex;align-items:center;justify-content:center;inline-size:28px;block-size:28px;flex-shrink:0;border-radius:var(--__P__-radius-sm);background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent-fg)}.__P__-transcript-sheet-icon svg{inline-size:16px;block-size:16px}.__P__-transcript-sheet-title{flex:1;min-width:0;margin:0;font-size:var(--__P__-text-base);font-weight:600;text-wrap:balance}.__P__-transcript-sheet-form{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-transcript-sheet-text{margin:0;font-size:var(--__P__-text-sm);line-height:1.45;color:var(--__P__-fg-muted);overflow-wrap:anywhere;text-wrap:pretty}.__P__-transcript-sheet-sent{display:flex;align-items:flex-start;gap:var(--__P__-space-2);color:var(--__P__-fg)}.__P__-transcript-sheet-sent svg{flex-shrink:0;inline-size:18px;block-size:18px;color:var(--__P__-success)}.__P__-transcript-sheet-action{width:100%;min-height:44px;text-align:center;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),scale var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-transcript-sheet-action:active:not(:disabled){scale:.96}@keyframes __P__-transcript-fade{0%{opacity:0}}@keyframes __P__-transcript-in{0%{opacity:0;translate:0 8px}}@media(max-width:640px){.__P__-transcript-layer{align-items:flex-end;padding:0}.__P__-transcript-sheet{max-width:none;padding-bottom:calc(var(--__P__-space-4) + env(safe-area-inset-bottom,0px));border-end-start-radius:0;border-end-end-radius:0;animation-name:__P__-transcript-up}}@keyframes __P__-transcript-up{0%{translate:0 100%}}@media(prefers-reduced-motion:reduce){.__P__-transcript-backdrop,.__P__-transcript-sheet{animation:none}}.__P__-operator-banner{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;column-gap:10px;box-sizing:border-box;width:calc(100% - 2 * var(--__P__-space-3));max-width:var(--__P__-conversation-max, 768px);margin:0 auto var(--__P__-space-2);padding:10px 12px;border-radius:var(--__P__-radius-lg);background:var(--__P__-bg-elevated);box-shadow:inset 0 0 0 1px var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);line-height:1.45;text-align:start}.__P__-operator-label{text-wrap:pretty}.__P__-operator-pulse{width:8px;height:8px;margin-block-start:calc((1.45em - 8px)/2);border-radius:50%;background:var(--__P__-accent)}.__P__-operator-banner[data-mode=awaiting-operator] .__P__-operator-pulse{animation:__P__-operator-pulse 1.4s var(--__P__-ease-out) infinite}.__P__-operator-banner[data-available=false] .__P__-operator-pulse{background:var(--__P__-warning);animation:none}.__P__-operator-banner[data-mode=operator] .__P__-operator-pulse{background:var(--__P__-success)}.__P__-operator-dismiss{width:28px;height:28px;margin-block:-4px;margin-inline-end:-6px}.__P__-operator-dismiss:before{inset:-8px}.__P__-operator-dismiss svg{width:16px;height:16px}@media(prefers-reduced-motion:reduce){.__P__-operator-banner[data-mode=awaiting-operator] .__P__-operator-pulse{animation:none}}@keyframes __P__-operator-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.7)}}.__P__-login-bar{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;column-gap:10px;padding:6px 8px;padding-inline-start:14px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);font-size:var(--__P__-text-sm);line-height:1.4}.__P__-login-bar-icon,.__P__-login-gate-icon{display:inline-flex;color:var(--__P__-fg-muted)}.__P__-login-bar-icon svg{width:16px;height:16px}.__P__-login-bar-text{text-wrap:pretty}.__P__-login-bar[data-kind=user]{grid-template-columns:auto minmax(0,1fr);padding-inline-end:14px;color:var(--__P__-fg-muted)}.__P__-login-bar[data-kind=user] .__P__-login-bar-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-login-bar-action{appearance:none;border:0;cursor:pointer;padding:6px 12px;border-radius:999px;background:transparent;color:var(--__P__-accent-fg);font:inherit;font-weight:600;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-login-bar-action:hover{background:var(--__P__-hover)}.__P__-login-bar-action:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px}.__P__-login-bar-hide{width:28px;height:28px}.__P__-login-bar-hide:before{inset:-8px}.__P__-login-bar-hide svg{width:16px;height:16px}.__P__-login-gate{display:flex;flex-direction:column;align-items:center;gap:10px;box-sizing:border-box;width:calc(100% - 2 * var(--__P__-space-3));max-width:var(--__P__-conversation-max, 768px);margin:0 auto var(--__P__-space-3);padding:18px 16px;border-radius:var(--__P__-radius-lg);background:var(--__P__-bg-elevated);box-shadow:inset 0 0 0 1px var(--__P__-border);text-align:center}.__P__-login-gate[data-alone]{flex:1;justify-content:center;margin-block-start:var(--__P__-space-3);background:transparent;box-shadow:none}.__P__-login-gate-icon{align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;background:var(--__P__-bg);box-shadow:inset 0 0 0 1px var(--__P__-border)}.__P__-login-gate[data-alone] .__P__-login-gate-icon{width:48px;height:48px;background:var(--__P__-bg-elevated)}.__P__-login-gate-icon svg{width:20px;height:20px}.__P__-form-actions.__P__-login-gate-actions{justify-content:center;width:100%;max-width:320px;margin-top:var(--__P__-space-1)}.__P__-login-gate-title{margin:0;color:var(--__P__-fg);font-size:var(--__P__-text-md);font-weight:600;line-height:1.35;text-wrap:balance}.__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);color:var(--__P__-fg);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-fg)}.__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-fg);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,.__P__-panel[data-resizing] .__P__-resize-grip{opacity:1}.__P__-resize-grip:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px;border-radius:4px}.__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)}.__P__-resize-grip--edge{top:0;bottom:0;left:0;width:8px;height:auto;opacity:1;cursor:ew-resize}.__P__-resize-grip--edge:focus-visible{outline:none}.__P__-resize-grip--edge:after{content:"";position:absolute;top:var(--__P__-radius, 12px);bottom:var(--__P__-radius, 12px);left:0;width:2px;border-radius:1px;background:var(--__P__-focus);opacity:0;transition:opacity var(--__P__-dur-base) var(--__P__-ease)}:host([data-position$="-left"]) .__P__-resize-grip--edge,:host([data-position$="-left"]) .__P__-resize-grip--edge:after{left:auto;right:0}.__P__-resize-grip--edge:hover:after{opacity:1;transition-delay:.15s}.__P__-resize-grip--edge:focus-visible:after,.__P__-panel[data-resizing] .__P__-resize-grip--edge:after{opacity:1}@media(pointer:coarse){.__P__-resize-grip{width:24px;height:24px}.__P__-resize-grip--edge{width:14px;height:auto}}:host(:not([data-mode="open"]):not([data-mode="expanded"]):not([data-mode="drawer"])) .__P__-resize-grip{display:none}@media(max-width:640px){.__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__-help-more{justify-content:center;color:var(--__P__-accent-fg);font-weight:600}.__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)}@media(hover:hover){.__P__-tab:hover{background:var(--__P__-hover)}}.__P__-tab[aria-selected=true]{color:var(--__P__-accent-fg)}.__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:-2px;left:calc(50% + 6px);width:8px;height:8px;border-radius:50%;background:var(--__P__-accent);box-shadow:0 0 0 2px var(--__P__-bg-elevated)}.__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:var(--__P__-radius-md);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:var(--__P__-radius-md);background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent-fg)}.__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;line-height:1.45}.__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{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search[data-input=true]:focus-within{outline:none;border-color:var(--__P__-focus)}.__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-input:focus-visible{outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent-fg)}.__P__-home-ask{padding-block:6px;padding-inline-end:6px}.__P__-home-ask .__P__-send{width:32px;height:32px;flex-shrink:0}.__P__-home-ask .__P__-send[data-shape=pill]{width:auto;padding:0 14px}.__P__-home-ask .__P__-send svg{width:16px;height:16px}.__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-fg);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__-history>*,.__P__-home-scroll>*,.__P__-module-scroll>*,.__P__-help-list>*,.__P__-history-footer>*,.__P__-module-pad{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-header,.__P__-back-header{padding-inline:max(12px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__P__-tabbar{padding-inline:max(0px,calc((100% - var(--__P__-conversation-max, 768px)) / 2))}.__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-vote{display:flex;align-items:center;flex-wrap:wrap;gap:var(--__P__-space-2);padding-top:var(--__P__-space-3);border-top:1px solid var(--__P__-border)}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:start;line-height:1.45;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface);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-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px;color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-news-tag{padding:1px 8px;border-radius:6px;background:var(--__P__-hover);color:var(--__P__-fg);font-size:calc(12px * var(--__P__-text-scale));white-space:nowrap}.__P__-news-more{display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);width:100%;min-height:44px;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);background:var(--__P__-surface);color:var(--__P__-accent-fg);font-weight:600}.__P__-news-more:hover{background:var(--__P__-bg-elevated)}.__P__-news-more:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__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__-panel-notice{display:flex;align-items:center;justify-content:center;position:relative;padding:var(--__P__-space-6);text-align:center}.__P__-panel-notice-close{position:absolute;top:12px;inset-inline-end:12px}.__P__-panel-notice-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-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--__P__-space-2)}.__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-type{flex-shrink:0;align-self:center;margin-inline-start:auto;border:1px solid var(--__P__-border);border-radius:5px;background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);padding:1px 7px;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);white-space:nowrap}.__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__-textarea,.__P__-home-search-input,.__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__-toolui{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)}.__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;-webkit-tap-highlight-color:transparent;user-select: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-name-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-toolui-chevron{display:inline-flex;color:var(--__P__-fg-muted);transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}details.__P__-toolui-collapsible>summary .__P__-toolui-status{margin-inline-start:auto}.__P__-toolui-chevron svg{width:16px;height:16px}details.__P__-toolui-collapsible[open]>summary .__P__-toolui-chevron{transform:rotate(180deg)}.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{--__P__-pill: var(--__P__-fg-muted);display:inline-flex;min-width:0;align-items:center;gap:5px;padding:3px 7px;border-radius:5px;border:1px solid var(--__P__-border);background:color-mix(in oklab,var(--__P__-fg-muted) 9%,transparent);color:var(--__P__-pill);font-size:var(--__P__-text-xs);font-weight:600;white-space:nowrap}.__P__-toolui-badge svg,.__P__-toolui-name-pill svg,.__P__-toolui-q-pill svg{flex-shrink:0;width:14px;height:14px}.__P__-toolui-status-icon{display:inline-flex}.__P__-toolui-name-pill{--__P__-pill: oklch(.68 .13 233)}.__P__-toolui-q-pill{--__P__-pill: oklch(.66 .12 195)}.__P__-toolui-status[data-status=done]{--__P__-pill: var(--__P__-success, #16a34a)}.__P__-toolui-status[data-status=approved],.__P__-toolui-status[data-status=submitted]{--__P__-pill: oklch(.62 .15 255)}.__P__-toolui-status[data-status=waiting]{--__P__-pill: var(--__P__-warning, #f59e0b)}.__P__-toolui-status[data-status=declined]{--__P__-pill: oklch(.66 .16 45)}.__P__-toolui-status[data-status=failed]{--__P__-pill: var(--__P__-danger, #dc2626)}.__P__-toolui-status[data-status=replaced],.__P__-toolui-status[data-status=running],.__P__-toolui-status[data-status=stopped]{--__P__-pill: var(--__P__-fg-muted)}@supports (color: oklch(from red l c h)){.__P__-toolui-badge,.__P__-toolui-name-pill,.__P__-toolui-q-pill{color:oklch(from var(--__P__-pill) clamp(var(--__P__-pill-l-min),l,var(--__P__-pill-l-max)) c h)}}.__P__-toolui-head{display:flex;align-items:center;flex-wrap:wrap;gap:var(--__P__-space-2)}.__P__-toolui-head-end{display:inline-flex;align-items:center;gap:var(--__P__-space-2);margin-inline-start:auto}.__P__-toolui-collapse-body{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-summary{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-toolui-collapse-body>.__P__-form{gap:var(--__P__-space-3)}.__P__-toolui-collapse-body>.__P__-form>.__P__-field,.__P__-toolui-summary>.__P__-field{padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:color-mix(in oklab,var(--__P__-bg) 80%,transparent);line-height:1.5}.__P__-toolui-collapse-body>.__P__-form>.__P__-field{gap:var(--__P__-space-2)}.__P__-toolui-summary>.__P__-field{gap:var(--__P__-space-1)}.__P__-toolui-summary .__P__-field-label{color:var(--__P__-fg-muted)}.__P__-toolui-answer{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted);overflow-wrap:anywhere;white-space:pre-wrap}.__P__-toolui-footer{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);margin-inline:calc(-1 * var(--__P__-space-4));padding:var(--__P__-space-3) var(--__P__-space-4) 0;border-top:1px solid var(--__P__-border)}.__P__-toolui-options-toggle{display:inline-flex;align-items:center;gap:4px;border:0;background:transparent;padding:0;cursor:pointer;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);transition:color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-toolui-options-toggle:hover{color:var(--__P__-fg)}.__P__-toolui-options-chevron{display:inline-flex;transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-toolui-options-chevron svg{width:14px;height:14px}.__P__-toolui-options-chevron.__P__-open{transform:rotate(180deg)}.__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-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-system{min-width:0;overflow:hidden;color:var(--__P__-fg-muted);text-overflow:ellipsis;white-space:nowrap}.__P__-toolui-preview{min-width:0}.__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-fields{max-height:240px;overflow:auto;overscroll-behavior:contain;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm)}.__P__-toolui-fields table{width:100%;border-collapse:collapse;font-size:var(--__P__-text-sm);line-height:1.5}.__P__-toolui-fields tr:nth-child(2n){background:color-mix(in oklab,var(--__P__-fg) 4%,transparent)}.__P__-toolui-fields tr+tr{border-top:1px solid var(--__P__-border)}.__P__-toolui-fields th,.__P__-toolui-fields td{padding:6px var(--__P__-space-2);text-align:start;vertical-align:top}.__P__-toolui-fields th{width:1%;color:var(--__P__-fg-muted);font-weight:400;white-space:nowrap}.__P__-toolui-fields td{color:var(--__P__-fg);white-space:pre-wrap;overflow-wrap:anywhere}.__P__-toolui-fields[data-plain=true]{border:0;border-radius:0}.__P__-toolui-fields[data-plain=true] tr:nth-child(2n){background:none}.__P__-toolui-fields[data-plain=true] tr+tr{border-top:0}.__P__-toolui-fields[data-plain=true] th,.__P__-toolui-fields[data-plain=true] td{padding:1px var(--__P__-space-2) 1px 0}.__P__-toolui-raw>summary{width:fit-content;color:var(--__P__-fg-muted);cursor:pointer}.__P__-toolui-raw>summary:hover{color:var(--__P__-fg)}.__P__-toolui-raw>summary:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-toolui-raw[open]{display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__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}
|
|
5
|
+
`;var Ed=`*,*: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-fg);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}
|
|
6
|
+
`;var Md=`: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__-accent-fg: var(--__P__-accent);--__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__-pill-l-min: .3;--__P__-pill-l-max: .46;--__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-mode="modal"]),:host([data-mode="drawer"]){--__P__-conversation-max: 100%}: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);--__P__-pill-l-min: .75;--__P__-pill-l-max: .92;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__-pill-l-min: .75;--__P__-pill-l-max: .92;--__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, .55) c h);--__P__-accent-text: oklch(from var(--__P__-accent) clamp(0, (l / .623 - 1) * -infinity, 1) 0 h);--__P__-accent-fg: oklch(from var(--__P__-accent-user) clamp(.3, l, .46) c h)}:host([data-theme="dark"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h);--__P__-accent-fg: var(--__P__-accent)}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h);--__P__-accent-fg: var(--__P__-accent)}}}@media(prefers-reduced-motion:reduce){:host{--__P__-dur-quick: 1ms;--__P__-dur-base: 1ms;--__P__-dur-slow: 1ms}}
|
|
7
|
+
`;var Gh="helpai",Kh="#5B5BD6",Qh="#FFFFFF",Yh="12px",Jh="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",Es=[Md,Ed,Id,Rd,Ad].join(`
|
|
8
|
+
`).replace(/__P__/g,Gh).replaceAll("__BRAND_ACCENT_TEXT__",Qh).replaceAll("__BRAND_ACCENT__",Kh).replaceAll("__BRAND_RADIUS__",Yh).replaceAll("__BRAND_FONT__",Jh);var Od=["data-theme","data-color-scheme","data-mode","data-bs-theme"];function Ld(e){if(e){if(e.classList.contains("dark"))return"dark";if(e.classList.contains("light"))return"light";for(let t of Od){let n=e.getAttribute(t);if(n==="dark"||n==="light")return n}}}function gi(e=document){let t=Ld(e.documentElement)??Ld(e.body);if(t)return t;let n=getComputedStyle(e.documentElement).colorScheme.trim();return n==="dark"||n==="light"?n:typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Nd(e,t=document){let n=gi(t);e(n);function r(){let l=gi(t);l!==n&&(n=l,e(l))}let o=new MutationObserver(r),i={attributes:!0,attributeFilter:["class","style",...Od]};o.observe(t.documentElement,i),t.body&&o.observe(t.body,i);let s=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):void 0;return s?.addEventListener("change",r),()=>{o.disconnect(),s?.removeEventListener("change",r)}}var Xh=oe.scope("mount"),$d=new WeakMap,Zh={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 Ms(e,t){let n=t==="flow"?e.style.height:"";e.style.cssText=Zh[t],n&&(e.style.height=n)}function hi(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function Dd(e={}){let t=e.position??"flow";Xh.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${O.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",O.id),Ms(r,t);let o=r.shadowRoot??r.attachShadow({mode:"open"});for(let l of["keydown","keypress","keyup"])o.addEventListener(l,ev);let i=r.ownerDocument;if(!tv(o,i)){let l=i.createElement("style");l.textContent=Es,o.appendChild(l)}let s=document.createElement("div");return s.className=`${O.cssPrefix}-app`,o.appendChild(s),{appRoot:s,destroy:()=>r.remove(),hostElement:r,shadowRoot:o}}function ev(e){if(e instanceof KeyboardEvent&&(e.metaKey||e.ctrlKey))return;let t=e.composedPath()[0];t instanceof HTMLElement&&(t.isContentEditable||t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT")&&e.stopPropagation()}function tv(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let r=$d.get(t);if(!r)try{r=new n.CSSStyleSheet,r.replaceSync(Es),$d.set(t,r)}catch{return!1}try{return e.adoptedStyleSheets=[r],!0}catch{return!1}}function nv(e,t){let n=O.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),t.contentMaxWidth&&e.style.setProperty(`--${n}-conversation-max`,t.contentMaxWidth)}function rv(e,t){e.dataset.theme=t==="host"?gi():t}function ov(e,t){let n=O.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 iv(e,t){e.dataset.position=t}function vi(e,t){e.dataset.mode=t}function Bd(e,t){rv(e,t.themeMode),nv(e,t.themeOverrides),iv(e,t.position),ov(e,t.size)}var zn,Xe,Ls,Ud,Os=Object.is,Gr=0,Kd=[],Ns=[],Je=he,zd=Je.__b,Fd=Je.__r,qd=Je.diffed,Hd=Je.__c,jd=Je.unmount,Vd=Je.__;function Kr(e,t){Je.__h&&Je.__h(Xe,e,Gr||t),Gr=0;var n=Xe.__H||(Xe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function N(e){return Gr=1,Qd(Yd,e)}function Qd(e,t,n){var r=Kr(zn++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Yd(void 0,t),function(i){var s=(r.__N||r.__)[0],l=r.t(s,i);Os(s,l)||(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=Xe,!Xe.__f)){Xe.__f=!0;var o=Xe.shouldComponentUpdate;Xe.shouldComponentUpdate=function(i,s,l){var c=this.__H;if(!c)return!0;var u=!1,p=this.props!=i;if(c.__.some(function(d){d.__N&&(u=!0,Os(d.__[0],d.__N[0])||(p=!0))}),o){var _=o.call(this,i,s,l);return u?_||p:_}return!u||p}}return r.__}function U(e,t){var n=Kr(zn++,3);!Je.__s&&Ds(n.__H,t)&&(n.__P=!0,n.__=e,n.u=t,Xe.__H.__h.push(n))}function ut(e,t){var n=Kr(zn++,4);!Je.__s&&Ds(n.__H,t)&&(n.__P=!1,n.__=e,n.u=t,Xe.__h.push(n))}function D(e){return Gr=5,xe(function(){return{current:e}},[])}function xe(e,t){var n=Kr(zn++,7);return Ds(n.__H,t)&&(n.__=e(),n.__H=t),n.__}function F(e,t){return Gr=8,xe(function(){return e},t)}function Qr(){var e=Kr(zn++,11);if(!e.__){for(var t=Xe.__v;!t.__m&&t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function av(){var e;do{for(;e=Ns.shift();)try{Wr(e)}catch(n){Je.__e(n,{__:(e=e.__P)&&e.__v})}for(;e=Kd.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Wr),t.__h.some($s),t.__h=[]}catch(n){t.__h=[],Je.__e(n,e.__v)}}}while(Ns.length)}Je.__b=function(e){Xe=null,zd&&zd(e)},Je.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Vd&&Vd(e,t)},Je.__r=function(e){Fd&&Fd(e),zn=0;var t=(Xe=e.__c).__H;t&&(Ls==Xe?Xe.__h=[]:(t.__h.some(Wr),t.__h.some($s),zn=0),t.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})),Ls=Xe},Je.diffed=function(e){qd&&qd(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&Gd(Kd.push(t)),t.__H.__.some(function(n){n.u&&(n.__H=n.u)})),Ls=Xe=null},Je.__c=function(e,t){t.some(function(n){try{n.__h.some(Wr),n.__h=n.__h.filter(function(r){return!r.__||$s(r)})}catch(r){n.__h=[function(){throw r}]}}),Hd&&Hd(e,t)},Je.unmount=function(e){jd&&jd(e);var t,n,r=e.__c;r&&r.__H&&(r.__H.__.some(function(o){try{if(o.__P&&o.__c){if(n===void 0){for(n=e.__;n&&(!n.__c||!n.__c.__P);)n=n.__;n=n&&n.__c}o.__P=n,Gd(Ns.push(o))}else Wr(o)}catch(i){t=i}}),r.__H=void 0,t&&Je.__e(t,r.__v))};var Wd=typeof requestAnimationFrame=="function";function sv(e){var t,n=function(){clearTimeout(r),Wd&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Wd&&(t=requestAnimationFrame(n))}function Gd(e){e!=1&&Ud==Je.requestAnimationFrame||((Ud=Je.requestAnimationFrame)||sv)(av)}function Wr(e){var t=Xe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Xe=t}function $s(e){var t=Xe;e.__c=e.__(),Xe=t}function Ds(e,t){return!e||e.length!=t.length||t.some(function(n,r){return!Os(n,e[r])})}function Yd(e,t){return typeof t=="function"?t(e):t}var lv=Symbol.for("preact-signals");function xi(){if(rn>1)rn--;else{var e,t=!1;for((function(){var o=yi;for(yi=void 0;o!==void 0;){var i=o.S;if(i.v===o.v)for(var s=i.t;s!==void 0;s=s.x)s.i===o.i&&(s.i=i.i);o=o.o}})();Jr!==void 0;){var n=Jr;for(Jr=void 0,bi++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Xd(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(bi=0,rn--,t)throw e}}function zt(e){if(rn>0)return e();Bs=++cv,rn++;try{return e()}finally{xi()}}var Yr,Fe=void 0;function Xr(e){var t=Fe,n=Yr;Fe=void 0,Yr=void 0;try{return e()}finally{Fe=t,Yr=n}}var Jr=void 0,rn=0,bi=0,cv=0,Bs=0,yi=void 0,Pi=0;function Jd(e){if(Fe!==void 0){var t=e.n;if(t===void 0||t.t!==Fe)return t={i:0,S:e,p:Fe.s,n:void 0,t:Fe,e:void 0,x:void 0,r:t},Fe.s!==void 0&&(Fe.s.n=t),Fe.s=t,e.n=t,32&Fe.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=Fe.s,t.n=void 0,Fe.s.n=t,Fe.s=t),t}}function pt(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}pt.prototype.brand=lv;pt.prototype.h=function(){return!0};pt.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:Xr(function(){var r;(r=t.W)==null||r.call(t)}))};pt.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&&Xr(function(){var o;(o=t.Z)==null||o.call(t)}))}};pt.prototype.subscribe=function(e){var t=this;return qt(function(){var n=t.value;Xr(function(){return e(n)})},{name:"sub"})};pt.prototype.valueOf=function(){return this.value};pt.prototype.toString=function(){return this.value+""};pt.prototype.toJSON=function(){return this.value};pt.prototype.peek=function(){var e=this;return Xr(function(){return e.value})};Object.defineProperty(pt.prototype,"value",{get:function(){var e=Jd(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(bi>100)throw new Error("Cycle detected");(function(n){rn!==0&&bi===0&&n.l!==Bs&&(n.l=Bs,yi={S:n,v:n.v,i:n.i,o:yi})})(this),this.v=e,this.i++,Pi++,rn++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{xi()}}}});function re(e,t){return new pt(e,t)}function Xd(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 Zd(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 eu(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 Fn(e,t){pt.call(this,void 0,t),this.x=e,this.s=void 0,this.g=Pi-1,this.f=4}Fn.prototype=new pt;Fn.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Pi))return!0;if(this.g=Pi,this.f|=1,this.i>0&&!Xd(this))return this.f&=-2,!0;var e=Fe;try{Zd(this),Fe=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 Fe=e,eu(this),this.f&=-2,!0};Fn.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)}pt.prototype.S.call(this,e)};Fn.prototype.U=function(e){if(this.t!==void 0&&(pt.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)}};Fn.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(Fn.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Jd(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Ze(e,t){return new Fn(e,t)}function tu(e){var t=e.j;if(e.j=void 0,typeof t=="function"){rn++;var n=Fe;Fe=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,Us(e),r}finally{Fe=n,xi()}}}function Us(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,tu(e)}function dv(e){if(Fe!==this)throw new Error("Out-of-order effect");eu(this),Fe=e,this.f&=-2;try{8&this.f&&Us(this)}finally{xi()}}function hr(e,t){this.x=e,this.j=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Yr&&Yr.push(this)}hr.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.j=t)}finally{e()}};hr.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,tu(this),Zd(this),rn++;var e=Fe;return Fe=this,dv.bind(this,e)};hr.prototype.N=function(){2&this.f||(this.f|=2,this.u=Jr,Jr=this)};hr.prototype.d=function(){this.f|=8,1&this.f||Us(this)};hr.prototype.dispose=function(){this.d()};function qt(e,t){var n=new hr(e,t);try{n.c()}catch(o){throw n.d(),o}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var nu,eo,Si,uv=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var ru=[];qt(function(){nu=this.N})();function vr(e,t){he[e]=t.bind(null,he[e]||function(){})}function Zr(e){if(Si){var t=Si;Si=void 0,t()}Si=e&&e.S()}function ou(e){var t=this,n=e.data,r=Pt(n);r.name="ReactiveDom",r.value=n;var o=xe(function(){for(var l=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var u=Ze(function(){var f=r.value.value;return f===0?0:f===!0?"":f||""}),p=Ze(function(){return!Array.isArray(u.value)&&!os(u.value)}),_=qt(function(){if(this.N=iu,p.value){var f=u.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=f)}}),d=t.__$u.d;return t.__$u.d=function(){_(),d.call(this)},[p,u]},[]),i=o[0],s=o[1];return i.value?s.peek():s.value}ou.displayName="ReactiveTextNode";Object.defineProperties(pt.prototype,{constructor:{configurable:!0,value:fn(pe,null).constructor},type:{configurable:!0,value:ou},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});vr("__b",function(e,t){if(Zr(),eo=void 0,typeof t.type=="string"){var n,r=t.props;for(var o in r)if(o!=="children"){var i=r[o];i instanceof pt&&(n||(t.__np=n={}),n[o]=i,r[o]=i.peek())}}e(t)});vr("__r",function(e,t){if(e(t),t.type!==pe){Zr();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=(function(o,i){var s;return qt(function(){s=this},{name:i}),s.c=o,s})((function(o){return function(){var i;uv&&((i=this.y)==null||i.call(this)),o.__$f|=1,o.setState({})}})(r),typeof t.type=="function"?t.type.displayName||t.type.name:""))),eo=r,Zr(n)}});vr("__e",function(e,t,n,r){Zr(),eo=void 0,e(t,n,r)});vr("diffed",function(e,t){Zr(),eo=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var r=t.__np,o=t.props,i=n.U;if(i)for(var s in i){var l=i[s];l===void 0||r&&s in r||(l.d(),i[s]=void 0)}if(r){i||(i={},n.U=i);for(var c in r){var u=i[c],p=r[c];u===void 0?(u=pv(n,c,p,o),i[c]=u):u.o(p,o)}}}e(t)});function pv(e,t,n,r){var o=t in e&&e.ownerSVGElement===void 0,i=re(n);return{o:function(s,l){i.value=s,r=l},d:qt(function(){this.N=iu;var s=i.value.value;r[t]!==s&&(r[t]=s,o?e[t]=s:s!=null&&(s!==!1||t[4]==="-")?e.setAttribute(t,s):e.removeAttribute(t))})}}vr("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var r=n.U;if(r){n.U=void 0;for(var o in r){var i=r[o];i&&i.d()}}}var s=t.__np;if(s){var l=t.props;for(var c in s)l[c]=s[c]}t.__np=void 0}else{var u=t.__c;if(u){u.__$f|=8;var p=u.__$u;p&&(u.__$u=void 0,p.d())}}e(t)});vr("__h",function(e,t,n,r){r<3&&(t.__$f|=2),e(t,n,r)});Ut.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,r=n&&n.s!==void 0;for(var o in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var 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 s in e)if(s!=="__source"&&e[s]!==this.props[s])return!0;for(var l in this.props)if(!(l in e))return!0;return!1};function Pt(e,t){return xe(function(){return re(e,t)},[])}function gt(e,t){var n=D(e);return n.current=e,eo.__$f|=4,xe(function(){return Ze(function(){return n.current()},t)},[])}var _v=function(e){queueMicrotask(function(){queueMicrotask(e)})};function fv(){zt(function(){for(var e;e=ru.shift();)nu.call(e)})}function iu(){ru.push(this)===1&&(he.requestAnimationFrame||_v)(fv)}var mv="x-public-key",gv="x-ai-agent-deployment-id";function au(e){if(!e.aiAgentDeploymentId)throw new Error("aiAgentDeploymentId is required");return{headers(){let t={[gv]:e.aiAgentDeploymentId};return e.publicKey&&(t[e.publicKeyHeader??mv]=e.publicKey),t}}}var hv=new Set(["home","chats","help","news"]);function su(e){return typeof e!="object"||e===null||!("to"in e)||typeof e.to!="string"||!hv.has(e.to)?!1:!("id"in e)||e.id===void 0||typeof e.id=="string"}function wi(e){let[t="",...n]=e.trim().split("/");if(t===""||t==="open")return;let r=n.join("/");return r?{to:t,id:r}:{to:t}}function to(e,t){return{text:e,send:typeof t=="object"&&t!==null&&"send"in t&&t.send===!0}}function lu(e){if(typeof e!="object"||e===null||!("text"in e)||typeof e.text!="string")return;let t=e.text.trim();return t?{text:t,send:"send"in e&&e.send===!0}:void 0}function cu(e){return`${O.cssPrefix}:${e}`}function Ht(e,t,n){e.dispatchEvent(new CustomEvent(cu(t),{detail:n}))}function du(e,t){let n=Object.keys(t).filter(r=>Object.hasOwn(t,r)).map(r=>{let o=t[r],i=cu(r);function s(l){return o(l instanceof CustomEvent?l.detail:void 0)}return e.addEventListener(i,s),[i,s]});return()=>{for(let[r,o]of n)e.removeEventListener(r,o)}}function ki(e,t){let n=[],r;for(let o of e){let i=new URLSearchParams(o);i.has(t)?r??(r=i.get(t)??""):n.push(o)}return{value:r,rest:n}}function uu(e){let t=new URL(e),n=O.cssPrefix,r=`${O.cssPrefix}-ask`,o=t.search.slice(1).split("&").filter(Boolean),i=t.hash.slice(1).split("&").filter(Boolean),s=ki(o,n),l=ki(s.rest,r),c=ki(i,n),u=ki(c.rest,r),p=s.value??c.value,_=(l.value??u.value)?.trim()||void 0;if(!(p===void 0&&_===void 0))return t.search=l.rest.join("&"),t.hash=u.rest.join("&"),{target:p===void 0?void 0:wi(p),..._?{ask:_}:{},url:t.toString()}}var vv=oe.scope("events"),no={open:!1,ready:!1,unread:0},Ci=class{constructor(){Z(this,"handlers",new Map);Z(this,"taps",new Set)}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)}tap(t){return this.taps.add(t),()=>this.taps.delete(t)}listensTo(t){return(this.handlers.get(t)?.size??0)>0||[...this.taps].some(n=>n.listensTo(t))}emit(t,n){for(let r of this.handlers.get(t)??[])try{r(n)}catch(o){vv.warn("listener threw",{event:t,error:o})}for(let r of this.taps)r.hear(t,n)}clear(){this.handlers.clear(),this.taps.clear()}};var pu=oe.scope("feedback:audio"),Ti=class{constructor(){Z(this,"ctx",null);Z(this,"master",null);Z(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){pu.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 o=n.currentTime,i=t.noteMs/1e3;t.notes.forEach((s,l)=>{let c=n.createOscillator();c.type=t.type,c.frequency.value=s;let u=n.createGain(),p=o+l*i;u.gain.setValueAtTime(1e-4,p),u.gain.exponentialRampToValueAtTime(t.peakGain,p+.005),u.gain.exponentialRampToValueAtTime(1e-4,p+i),c.connect(u).connect(r),c.start(p),c.stop(p+i+.01)})}async playUrl(t){let n=this.ctx,r=this.master;if(!n||!r||n.state!=="running")return;let o=await this.getBuffer(t);if(!o)return;let i=n.createBufferSource();i.buffer=o,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,o=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=>(pu.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,o),o}};var _u={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},fu={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 vn=null,Ri=0;function bv(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function yv(){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=`__${O.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;";e.style.cssText=n,t.style.cssText=n;for(let r of[e,t])r.addEventListener("click",o=>o.stopPropagation());return document.body.append(e,t),{input:e,label:t}}function mu(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(bv())try{navigator.vibrate(e);return}catch{}if(vn??(vn=yv()),!!vn)try{vn.label.click()}catch{}}}function gu(){Ri++;let e=!1;return()=>{e||(e=!0,Ri=Math.max(0,Ri-1),Ri===0&&vn&&(vn.input.remove(),vn.label.remove(),vn=null))}}var Pv=oe.scope("feedback"),xv=100,Ai=class{constructor(t,n){Z(this,"mutedSig",re(!1));Z(this,"audio",new Ti);Z(this,"releaseHaptics");Z(this,"sound");Z(this,"haptics");Z(this,"lastPlayed",new Map);Z(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=gu(),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<xv}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(o=>Pv.warn("audio play failed",{err:o,url:n}));return}let r=fu[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?_u[t]:n;mu(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 hu(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function zs(e){return hu(e)}function Fs(e){return!(!hu(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function Ii(e){if(typeof e!="object"||e===null)return{};let t=Reflect.get(e,"url");return{url:typeof t=="string"&&/^https?:\/\//i.test(t)&&t.includes("{returnTo}")?t:void 0,required:Reflect.get(e,"required")===!0,hidePrompt:Reflect.get(e,"hidePrompt")===!0,hideUser:Reflect.get(e,"hideUser")===!0}}function bu(e,t){let n=encodeURIComponent(t).replace(/[!'()*]/g,r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`);return e.replaceAll("{returnTo}",n)}function yu(e){let t=e.split(".")[1];if(t)try{let n=atob(t.replace(/-/g,"+").replace(/_/g,"/")),r=JSON.parse(new TextDecoder().decode(Uint8Array.from(n,o=>o.charCodeAt(0))));return typeof r=="object"&&r!==null&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):void 0}catch{return}}function vu(e,t){let n=e?.[t];return typeof n=="string"&&n.trim()?{[t]:n.trim()}:{}}function Pu(e){let t=yu(e);return{...vu(t,"name"),...vu(t,"email")}}function xu(e){let t=yu(e)?.sub;return typeof t=="string"&&t!==""?t:void 0}function Su(){try{return window.top?.location.href??location.href}catch{return location.href}}function wu(e){try{(window.top??window).location.assign(e)}catch{location.assign(e)}}var Sv=Symbol.for("pv"),wv=0;function a(e,t,n,r,o,i){t||(t={});var s,l,c=t;if("ref"in c&&typeof e!="function")for(l in c={},t)l=="ref"?s=t[l]:c[l]=t[l];var u={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:Sv,__v:--wv,__i:-1,__u:0};return(o||i)&&(u.__source=o,u.__self=i),he.vnode&&he.vnode(u),u}var br=1,ro=2,oo=4,Cu=8,Tu=16;function kv(e){switch(e){case br:return"href";case ro:return"src";case oo:return"class";case Cu:return"checked";case Tu:return"start"}}var Cv=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}},Tv=Cv;var ku=24;function io(e){let t=new Uint32Array(ku);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(ku),indent:"",indent_len:0,table_state:0}}function yr(e){e.pending.length>0&&Qe(e,`
|
|
9
|
+
`)}function Ae(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 Ke(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 Ie(e,t){(e.tokens[e.len]===24||e.tokens[e.len]===23)&&t!==25&&Ke(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function Rv(e,t,n){for(;n<=e.len;){if(e.tokens[n]===t)return n;n+=1}return-1}function qn(e,t){for(e.fence_start=0;e.len>t;)Ke(e)}function Ei(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;)Ke(e);return t}function qs(e,t){let n=-1,r=-1;for(let o=e.blockquote_idx+1;o<=e.len;o+=1)if(e.tokens[o]===25){if(e.indent_len<e.spaces[o]){r=-1;break}r=o}else e.tokens[o]===t&&(n=o);return r===-1?n===-1?(qn(e,e.blockquote_idx),Ie(e,t),!0):(qn(e,n),!1):(qn(e,r),Ie(e,t),!0)}function Hs(e,t){Ie(e,25),e.spaces[e.len]=e.indent_len+t,on(e),e.token=103}function on(e){e.indent="",e.indent_len=0,e.pending=""}function js(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 Av(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 Iv(e){return js(e)||Av(e)}function Qe(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 o=Ei(e,e.indent_len);e.indent_len=0,e.token=e.tokens[e.len],o>0&&Qe(e," ".repeat(o))}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`
|
|
10
|
+
`:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){Ke(e),on(e),e.pending=n;continue}qn(e,e.blockquote_idx),on(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" ":Ei(e,e.indent_len),Ie(e,Tv(e.pending.length)),on(e);continue}break;case">":{let i=Rv(e,20,e.blockquote_idx+1);i===-1?(qn(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,Ie(e,20)):e.blockquote_idx=i,on(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`
|
|
11
|
+
`:if(e.hr_chars<3)break;Ei(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),on(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){qs(e,23),Hs(e,2),Qe(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):(Ie(e,2),on(e),e.fence_start=0,Qe(e,r));continue;case`
|
|
12
|
+
`:{Ei(e,e.indent_len),Ie(e,10),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,oo,e.pending.slice(e.fence_start)),on(e),e.token=101;continue}default:e.pending=r;continue}case"+":if(n!==" ")break;qs(e,23),Hs(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;qs(e,24)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,Tu,e.pending.slice(0,-1)),Hs(e,e.pending.length+1);continue}else{let i=n.charCodeAt(0);if(i===46||js(i)){e.pending=r;continue}}break;case"|":qn(e,e.blockquote_idx),Ie(e,27),Ie(e,28),e.pending="",Qe(e,n);continue}let o=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}o=e.indent.slice(i)+r,Ie(e,9)}else Ie(e,2);on(e),Qe(e,o);continue;case 27:if(e.table_state===1)switch(n){case"-":case" ":case"|":case":":e.pending=r;continue;case`
|
|
13
|
+
`:e.table_state=2,e.pending="";continue;default:Ke(e),e.table_state=0;break}else switch(e.pending){case"|":Ie(e,28),e.pending="",Qe(e,n);continue;case`
|
|
14
|
+
`:Ke(e),e.pending="",e.table_state=0,Qe(e,n);continue}break;case 28:switch(e.pending){case"":break;case"|":Ie(e,29),Ke(e),e.pending="",Qe(e,n);continue;case`
|
|
15
|
+
`:Ke(e),e.table_state=Math.min(e.table_state+1,2),e.pending="",Qe(e,n);continue;default:Ie(e,29),Qe(e,n);continue}break;case 29:if(e.pending==="|"){Ae(e),Ke(e),e.pending="",Qe(e,n);continue}break;case 9:switch(r){case`
|
|
16
16
|
`:case`
|
|
17
17
|
`:case`
|
|
18
18
|
`:case`
|
|
@@ -22,51 +22,55 @@ var ug=Object.defineProperty;var pg=(e,t,r)=>t in e?ug(e,t,{enumerable:!0,config
|
|
|
22
22
|
`:case`
|
|
23
23
|
`:case`
|
|
24
24
|
`:case`
|
|
25
|
-
`:e.pending=
|
|
26
|
-
`:if(
|
|
27
|
-
`){e.pending=
|
|
28
|
-
`:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,
|
|
29
|
-
`?(
|
|
30
|
-
`||
|
|
31
|
-
`:e.pending=
|
|
32
|
-
`:switch(e.token){case 19:case 30:case 31:break;case 3:case 4:case 5:case 6:case 7:case 8:
|
|
33
|
-
`?"":
|
|
34
|
-
`){
|
|
35
|
-
`){
|
|
36
|
-
`){Me(e),Ne(e,16),e.pending=r;continue}}break;case"$":if(e.token!==19&&e.token!==16&&e.pending==="$")if(r==="$"){e.token=105,e.pending=n;continue}else{if(kh(r.charCodeAt(0)))break;Me(e),Ne(e,31),e.pending=r;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&r!=="]"){Me(e),Ne(e,17),e.pending=r;continue}break;case"!":if(e.token!==19&&r==="["){Me(e),Ne(e,19),e.pending="";continue}break;case" ":if(e.pending.length===1&&r===" ")continue;break}if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&r==="h"&&(e.pending===" "||e.pending==="")){e.text+=e.pending,e.pending=r,e.token=102;continue}e.text+=e.pending,e.pending=r}Me(e)}function zi(e){return{add_token:Ch,end_token:Zs,add_text:el,set_attr:tl,data:{nodes:[e,,,,,],index:0}}}function Ch(e,t){let r=e.nodes[e.index],n;switch(t){case 1:return;case 20:n=document.createElement("blockquote");break;case 2:n=document.createElement("p");break;case 21:n=document.createElement("br");break;case 22:n=document.createElement("hr");break;case 3:n=document.createElement("h1");break;case 4:n=document.createElement("h2");break;case 5:n=document.createElement("h3");break;case 6:n=document.createElement("h4");break;case 7:n=document.createElement("h5");break;case 8:n=document.createElement("h6");break;case 12:case 13:n=document.createElement("em");break;case 14:case 15:n=document.createElement("strong");break;case 16:n=document.createElement("s");break;case 11:n=document.createElement("code");break;case 18:case 17:n=document.createElement("a");break;case 19:n=document.createElement("img");break;case 23:n=document.createElement("ul");break;case 24:n=document.createElement("ol");break;case 25:n=document.createElement("li");break;case 26:let o=n=document.createElement("input");o.type="checkbox",o.disabled=!0;break;case 9:case 10:r=r.appendChild(document.createElement("pre")),n=document.createElement("code");break;case 27:n=document.createElement("table");break;case 28:switch(r.children.length){case 0:r=r.appendChild(document.createElement("thead"));break;case 1:r=r.appendChild(document.createElement("tbody"));break;default:r=r.children[1]}n=document.createElement("tr");break;case 29:n=document.createElement(r.parentElement?.tagName==="THEAD"?"th":"td");break;case 30:n=document.createElement("equation-block");break;case 31:n=document.createElement("equation-inline");break}e.nodes[++e.index]=r.appendChild(n)}function Zs(e){e.index-=1}function el(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function tl(e,t,r){e.nodes[e.index].setAttribute(bh(t),r)}function yr({amount:e,currency:t},r){let n=new Intl.NumberFormat("en",{style:"currency",currency:t}).resolvedOptions().maximumFractionDigits??2;return new Intl.NumberFormat(r,{style:"currency",currency:t}).format(e/10**n)}function rl(e,t){let r=new Date(e);return!/^\d{4}-\d{2}-\d{2}/.test(e)||Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeZone:e.length===10?"UTC":void 0}).format(r)}function Au(e){let t=Math.min(0,...e.map(o=>o.value)),n=Math.max(0,...e.map(o=>o.value))-t||1;return{baseline:148+t/n*136,barWidth:192/e.length,points:e.map((o,s)=>({x:24+(s+.5)*272/e.length,y:148-(o.value-t)/n*136}))}}function Eu(e){let t=new Set(e.map(r=>{let n=r.typeName==="Cell"?r.props.children.length===1?r.props.children[0]:void 0:r;return n?.typeName==="Metric"?"Card":n?.typeName}));return t.size===1&&!t.has(void 0)}function Mu({scrollLeft:e,scrollWidth:t,clientWidth:r}){let n=Math.abs(e);return{start:n>1,end:n<t-r-1}}function vo(e){return/^https:\/\//i.test(e??"")}function nl(e,t){return(e??[]).flatMap(r=>r.url?vo(r.url)?[{...r,url:r.url,message:void 0}]:[]:t?[{...r,url:void 0,message:r.label}]:[])}function ol(e,t,r){return`${e}: ${[t,...Object.entries(r??{}).map(([n,o])=>`${n}: ${o}`)].join(", ")}`}function Lu(e,t){return t!==void 0&&t.currency===e.currency&&t.amount>e.amount}function Nu(e,t){let r=e.variants??[],n=(e.options??[]).filter(c=>c.values.length).map(c=>({...c,value:t[c.name]??c.values.find(u=>u===e.selected?.[c.name])??(c.values.length===1?c.values[0]:void 0),unavailable:r.length?c.values.filter(u=>!r.some(p=>p.available!==!1&&p.options[c.name]===u)):[]})),o=n.filter(c=>c.value===void 0).map(c=>c.name),s=Object.fromEntries(n.flatMap(c=>c.value===void 0?[]:[[c.name,c.value]])),a=o.length?void 0:r.find(c=>n.every(u=>c.options[u.name]===u.value)),i=!o.length&&r.length?a!==void 0&&a.available!==!1:e.available!==!1;return{options:n,missing:o,chosen:s,available:i,price:a?.price??e.price,compareAtPrice:a?.price?a.compareAtPrice:e.compareAtPrice,image:a?.image??e.image,canBuy:!o.length&&i}}var En={root:"Root",schema:{$schema:"https://json-schema.org/draft/2020-12/schema",type:"object",properties:{Root:{$ref:"#/$defs/Root"},Grid:{$ref:"#/$defs/Grid"},Cell:{$ref:"#/$defs/Cell"},Carousel:{$ref:"#/$defs/Carousel"},Text:{$ref:"#/$defs/Text"},Card:{$ref:"#/$defs/Card"},Metric:{$ref:"#/$defs/Metric"},Table:{$ref:"#/$defs/Table"},Chart:{$ref:"#/$defs/Chart"},Product:{$ref:"#/$defs/Product"},Cart:{$ref:"#/$defs/Cart"},Order:{$ref:"#/$defs/Order"}},required:["Root","Grid","Cell","Carousel","Text","Card","Metric","Table","Chart","Product","Cart","Order"],additionalProperties:!1,$defs:{Root:{type:"object",properties:{children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Grid"},{$ref:"#/$defs/Carousel"},{$ref:"#/$defs/Text"},{$ref:"#/$defs/Card"},{$ref:"#/$defs/Metric"},{$ref:"#/$defs/Table"},{$ref:"#/$defs/Chart"},{$ref:"#/$defs/Product"},{$ref:"#/$defs/Cart"},{$ref:"#/$defs/Order"}]}}},required:["children"],additionalProperties:!1},Grid:{type:"object",properties:{columns:{type:"integer",enum:[1,2,3,4],default:1},children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Cell"},{$ref:"#/$defs/Text"},{$ref:"#/$defs/Card"},{$ref:"#/$defs/Metric"},{$ref:"#/$defs/Table"},{$ref:"#/$defs/Chart"},{$ref:"#/$defs/Product"},{$ref:"#/$defs/Cart"},{$ref:"#/$defs/Order"}]}}},required:["columns","children"],additionalProperties:!1},Cell:{type:"object",properties:{children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Text"},{$ref:"#/$defs/Card"},{$ref:"#/$defs/Metric"},{$ref:"#/$defs/Table"},{$ref:"#/$defs/Chart"},{$ref:"#/$defs/Product"},{$ref:"#/$defs/Cart"},{$ref:"#/$defs/Order"}]}},span:{type:"integer",enum:[1,2,3,4],default:1}},required:["children"],additionalProperties:!1},Carousel:{type:"object",properties:{children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Card"},{$ref:"#/$defs/Product"}]}}},required:["children"],additionalProperties:!1},Text:{type:"object",properties:{text:{type:"string"}},required:["text"],additionalProperties:!1},Card:{type:"object",properties:{title:{type:"string"},body:{type:"string"},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["title","body"],additionalProperties:!1},Metric:{type:"object",properties:{label:{type:"string"},value:{type:"string"},detail:{type:"string"}},required:["label","value","detail"],additionalProperties:!1},Table:{type:"object",properties:{title:{type:"string"},columns:{type:"array",items:{type:"string"}},rows:{type:"array",items:{type:"array",items:{type:"string"}}}},required:["title","columns","rows"],additionalProperties:!1},Chart:{type:"object",properties:{title:{type:"string"},type:{type:"string",enum:["bar","line"]},data:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"number"}},required:["label","value"],additionalProperties:!1}}},required:["title","type","data"],additionalProperties:!1},Product:{type:"object",properties:{product:{type:"object",properties:{title:{type:"string"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},id:{type:"string"},compareAtPrice:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},image:{type:"string"},url:{type:"string"},description:{type:"string"},badge:{type:"string"},rating:{type:"object",properties:{value:{type:"number"},count:{type:"integer"}},required:["value"]},available:{type:"boolean"},options:{type:"array",items:{type:"object",properties:{name:{type:"string"},values:{type:"array",items:{type:"string"}}},required:["name","values"]}},variants:{type:"array",items:{type:"object",properties:{options:{type:"object",additionalProperties:{type:"string"}},id:{type:"string"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},compareAtPrice:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},image:{type:"string"},available:{type:"boolean"}},required:["options"]}},selected:{type:"object",additionalProperties:{type:"string"}}},required:["title","price"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["product"],additionalProperties:!1},Cart:{type:"object",properties:{cart:{type:"object",properties:{lines:{type:"array",items:{type:"object",properties:{title:{type:"string"},quantity:{type:"integer"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},image:{type:"string"},url:{type:"string"},options:{type:"object",additionalProperties:{type:"string"}},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["title","quantity","price"]}},totals:{type:"array",items:{type:"object",properties:{label:{type:"string"},amount:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]}},required:["label","amount"]}},messages:{type:"array",items:{type:"object",properties:{text:{type:"string"},severity:{type:"string",enum:["info","warning","error"]}},required:["text","severity"]}}},required:["lines","totals"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["cart"],additionalProperties:!1},Order:{type:"object",properties:{order:{type:"object",properties:{number:{type:"string"},status:{type:"string"},date:{type:"string"},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},quantity:{type:"integer"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},image:{type:"string"},url:{type:"string"},options:{type:"object",additionalProperties:{type:"string"}},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["title","quantity","price"]}},totals:{type:"array",items:{type:"object",properties:{label:{type:"string"},amount:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]}},required:["label","amount"]}},timeline:{type:"array",items:{type:"object",properties:{label:{type:"string"},done:{type:"boolean"},date:{type:"string"}},required:["label","done"]}}},required:["number","status","items","totals"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["order"],additionalProperties:!1}}}};var Ou=ho;var Th={type:"object",properties:{typeName:{const:"Grid"},statementId:{type:"string"},props:{type:"object",properties:{columns:{type:"integer",enum:[1,2,3,4],default:1},children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Cell"},{$ref:"#/$defs/Text"},{$ref:"#/$defs/Card"},{$ref:"#/$defs/Metric"},{$ref:"#/$defs/Table"},{$ref:"#/$defs/Chart"},{$ref:"#/$defs/Product"},{$ref:"#/$defs/Cart"},{$ref:"#/$defs/Order"}]}}},required:["columns","children"],additionalProperties:!1}},required:["typeName","statementId","props"]},Ih={type:"object",properties:{typeName:{const:"Cell"},statementId:{type:"string"},props:{type:"object",properties:{children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Text"},{$ref:"#/$defs/Card"},{$ref:"#/$defs/Metric"},{$ref:"#/$defs/Table"},{$ref:"#/$defs/Chart"},{$ref:"#/$defs/Product"},{$ref:"#/$defs/Cart"},{$ref:"#/$defs/Order"}]}},span:{type:"integer",enum:[1,2,3,4],default:1}},required:["children"],additionalProperties:!1}},required:["typeName","statementId","props"]};function vt(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=vt.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let p;if(e.typeName===void 0&&(p="typeName")||e.statementId===void 0&&(p="statementId")||e.props===void 0&&(p="props"))return vt.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:p}}],!1;if(e.typeName!==void 0){let _=i;if(e.typeName!=="Text")return vt.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Text"}}],!1;var u=_===i}else var u=!0;if(u){if(e.statementId!==void 0){let _=i;if(typeof e.statementId!="string")return vt.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=_===i}else var u=!0;if(u)if(e.props!==void 0){let _=e.props,d=i;if(i===d)if(_&&typeof _=="object"&&!Array.isArray(_)){let v;if(_.text===void 0&&(v="text"))return vt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:v}}],!1;{let g=i;for(let x in _)if(x!=="text"){return vt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:x}}],!1;break}if(g===i&&_.text!==void 0&&typeof _.text!="string")return vt.errors=[{instancePath:t+"/props/text",schemaPath:"#/properties/props/properties/text/type",keyword:"type",params:{type:"string"}}],!1}}else return vt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=d===i}else var u=!0}}else return vt.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return vt.errors=a,i===0}vt.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function et(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=et.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let p;if(e.label===void 0&&(p="label"))return et.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:p}}],!1;if(e.label!==void 0){let _=i;if(typeof e.label!="string")return et.errors=[{instancePath:t+"/label",schemaPath:"#/properties/label/type",keyword:"type",params:{type:"string"}}],!1;var u=_===i}else var u=!0;if(u){if(e.url!==void 0){let _=i;if(typeof e.url!="string")return et.errors=[{instancePath:t+"/url",schemaPath:"#/properties/url/type",keyword:"type",params:{type:"string"}}],!1;var u=_===i}else var u=!0;if(u)if(e.primary!==void 0){let _=i;if(typeof e.primary!="boolean")return et.errors=[{instancePath:t+"/primary",schemaPath:"#/properties/primary/type",keyword:"type",params:{type:"boolean"}}],!1;var u=_===i}else var u=!0}}else return et.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return et.errors=a,i===0}et.evaluated={props:{label:!0,url:!0,primary:!0},dynamicProps:!1,dynamicItems:!1};function We(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=We.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.typeName===void 0&&(d="typeName")||e.statementId===void 0&&(d="statementId")||e.props===void 0&&(d="props"))return We.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:d}}],!1;if(e.typeName!==void 0){let f=i;if(e.typeName!=="Card")return We.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Card"}}],!1;var u=f===i}else var u=!0;if(u){if(e.statementId!==void 0){let f=i;if(typeof e.statementId!="string")return We.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=f===i}else var u=!0;if(u)if(e.props!==void 0){let f=e.props,v=i;if(i===v)if(f&&typeof f=="object"&&!Array.isArray(f)){let x;if(f.title===void 0&&(x="title")||f.body===void 0&&(x="body"))return We.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:x}}],!1;{let k=i;for(let y in f)if(!(y==="title"||y==="body"||y==="actions")){return We.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:y}}],!1;break}if(k===i){if(f.title!==void 0){let y=i;if(typeof f.title!="string")return We.errors=[{instancePath:t+"/props/title",schemaPath:"#/properties/props/properties/title/type",keyword:"type",params:{type:"string"}}],!1;var p=y===i}else var p=!0;if(p){if(f.body!==void 0){let y=i;if(typeof f.body!="string")return We.errors=[{instancePath:t+"/props/body",schemaPath:"#/properties/props/properties/body/type",keyword:"type",params:{type:"string"}}],!1;var p=y===i}else var p=!0;if(p)if(f.actions!==void 0){let y=f.actions,S=i;if(i===S)if(Array.isArray(y)){var _=!0;let w=y.length;for(let h=0;h<w;h++){let m=i;et(y[h],{instancePath:t+"/props/actions/"+h,parentData:y,parentDataProperty:h,rootData:o,dynamicAnchors:s})||(a=a===null?et.errors:a.concat(et.errors),i=a.length);var _=m===i;if(!_)break}}else return We.errors=[{instancePath:t+"/props/actions",schemaPath:"#/properties/props/properties/actions/type",keyword:"type",params:{type:"array"}}],!1;var p=S===i}else var p=!0}}}}else return We.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=v===i}else var u=!0}}else return We.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return We.errors=a,i===0}We.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function at(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=at.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let _;if(e.typeName===void 0&&(_="typeName")||e.statementId===void 0&&(_="statementId")||e.props===void 0&&(_="props"))return at.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:_}}],!1;if(e.typeName!==void 0){let d=i;if(e.typeName!=="Metric")return at.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Metric"}}],!1;var u=d===i}else var u=!0;if(u){if(e.statementId!==void 0){let d=i;if(typeof e.statementId!="string")return at.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=d===i}else var u=!0;if(u)if(e.props!==void 0){let d=e.props,f=i;if(i===f)if(d&&typeof d=="object"&&!Array.isArray(d)){let g;if(d.label===void 0&&(g="label")||d.value===void 0&&(g="value")||d.detail===void 0&&(g="detail"))return at.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:g}}],!1;{let x=i;for(let k in d)if(!(k==="label"||k==="value"||k==="detail")){return at.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:k}}],!1;break}if(x===i){if(d.label!==void 0){let k=i;if(typeof d.label!="string")return at.errors=[{instancePath:t+"/props/label",schemaPath:"#/properties/props/properties/label/type",keyword:"type",params:{type:"string"}}],!1;var p=k===i}else var p=!0;if(p){if(d.value!==void 0){let k=i;if(typeof d.value!="string")return at.errors=[{instancePath:t+"/props/value",schemaPath:"#/properties/props/properties/value/type",keyword:"type",params:{type:"string"}}],!1;var p=k===i}else var p=!0;if(p)if(d.detail!==void 0){let k=i;if(typeof d.detail!="string")return at.errors=[{instancePath:t+"/props/detail",schemaPath:"#/properties/props/properties/detail/type",keyword:"type",params:{type:"string"}}],!1;var p=k===i}else var p=!0}}}}else return at.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=f===i}else var u=!0}}else return at.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return at.errors=a,i===0}at.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function Ve(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Ve.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let v;if(e.typeName===void 0&&(v="typeName")||e.statementId===void 0&&(v="statementId")||e.props===void 0&&(v="props"))return Ve.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:v}}],!1;if(e.typeName!==void 0){let g=i;if(e.typeName!=="Table")return Ve.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Table"}}],!1;var u=g===i}else var u=!0;if(u){if(e.statementId!==void 0){let g=i;if(typeof e.statementId!="string")return Ve.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=g===i}else var u=!0;if(u)if(e.props!==void 0){let g=e.props,x=i;if(i===x)if(g&&typeof g=="object"&&!Array.isArray(g)){let y;if(g.title===void 0&&(y="title")||g.columns===void 0&&(y="columns")||g.rows===void 0&&(y="rows"))return Ve.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:y}}],!1;{let S=i;for(let b in g)if(!(b==="title"||b==="columns"||b==="rows")){return Ve.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:b}}],!1;break}if(S===i){if(g.title!==void 0){let b=i;if(typeof g.title!="string")return Ve.errors=[{instancePath:t+"/props/title",schemaPath:"#/properties/props/properties/title/type",keyword:"type",params:{type:"string"}}],!1;var p=b===i}else var p=!0;if(p){if(g.columns!==void 0){let b=g.columns,w=i;if(i===w)if(Array.isArray(b)){var _=!0;let m=b.length;for(let P=0;P<m;P++){let R=i;if(typeof b[P]!="string")return Ve.errors=[{instancePath:t+"/props/columns/"+P,schemaPath:"#/properties/props/properties/columns/items/type",keyword:"type",params:{type:"string"}}],!1;var _=R===i;if(!_)break}}else return Ve.errors=[{instancePath:t+"/props/columns",schemaPath:"#/properties/props/properties/columns/type",keyword:"type",params:{type:"array"}}],!1;var p=w===i}else var p=!0;if(p)if(g.rows!==void 0){let b=g.rows,w=i;if(i===w)if(Array.isArray(b)){var d=!0;let m=b.length;for(let P=0;P<m;P++){let R=b[P],I=i;if(i===I)if(Array.isArray(R)){var f=!0;let C=R.length;for(let M=0;M<C;M++){let N=i;if(typeof R[M]!="string")return Ve.errors=[{instancePath:t+"/props/rows/"+P+"/"+M,schemaPath:"#/properties/props/properties/rows/items/items/type",keyword:"type",params:{type:"string"}}],!1;var f=N===i;if(!f)break}}else return Ve.errors=[{instancePath:t+"/props/rows/"+P,schemaPath:"#/properties/props/properties/rows/items/type",keyword:"type",params:{type:"array"}}],!1;var d=I===i;if(!d)break}}else return Ve.errors=[{instancePath:t+"/props/rows",schemaPath:"#/properties/props/properties/rows/type",keyword:"type",params:{type:"array"}}],!1;var p=w===i}else var p=!0}}}}else return Ve.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=x===i}else var u=!0}}else return Ve.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Ve.errors=a,i===0}Ve.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};var Rh={type:"object",properties:{typeName:{const:"Chart"},statementId:{type:"string"},props:{type:"object",properties:{title:{type:"string"},type:{type:"string",enum:["bar","line"]},data:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"number"}},required:["label","value"],additionalProperties:!1}}},required:["title","type","data"],additionalProperties:!1}},required:["typeName","statementId","props"]};function De(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=De.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let f;if(e.typeName===void 0&&(f="typeName")||e.statementId===void 0&&(f="statementId")||e.props===void 0&&(f="props"))return De.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:f}}],!1;if(e.typeName!==void 0){let v=i;if(e.typeName!=="Chart")return De.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Chart"}}],!1;var u=v===i}else var u=!0;if(u){if(e.statementId!==void 0){let v=i;if(typeof e.statementId!="string")return De.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=v===i}else var u=!0;if(u)if(e.props!==void 0){let v=e.props,g=i;if(i===g)if(v&&typeof v=="object"&&!Array.isArray(v)){let k;if(v.title===void 0&&(k="title")||v.type===void 0&&(k="type")||v.data===void 0&&(k="data"))return De.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:k}}],!1;{let y=i;for(let S in v)if(!(S==="title"||S==="type"||S==="data")){return De.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:S}}],!1;break}if(y===i){if(v.title!==void 0){let S=i;if(typeof v.title!="string")return De.errors=[{instancePath:t+"/props/title",schemaPath:"#/properties/props/properties/title/type",keyword:"type",params:{type:"string"}}],!1;var p=S===i}else var p=!0;if(p){if(v.type!==void 0){let S=v.type,b=i;if(typeof S!="string")return De.errors=[{instancePath:t+"/props/type",schemaPath:"#/properties/props/properties/type/type",keyword:"type",params:{type:"string"}}],!1;if(!(S==="bar"||S==="line"))return De.errors=[{instancePath:t+"/props/type",schemaPath:"#/properties/props/properties/type/enum",keyword:"enum",params:{allowedValues:Rh.properties.props.properties.type.enum}}],!1;var p=b===i}else var p=!0;if(p)if(v.data!==void 0){let S=v.data,b=i;if(i===b)if(Array.isArray(S)){var _=!0;let h=S.length;for(let m=0;m<h;m++){let P=S[m],R=i;if(i===R)if(P&&typeof P=="object"&&!Array.isArray(P)){let A;if(P.label===void 0&&(A="label")||P.value===void 0&&(A="value"))return De.errors=[{instancePath:t+"/props/data/"+m,schemaPath:"#/properties/props/properties/data/items/required",keyword:"required",params:{missingProperty:A}}],!1;{let C=i;for(let M in P)if(!(M==="label"||M==="value")){return De.errors=[{instancePath:t+"/props/data/"+m,schemaPath:"#/properties/props/properties/data/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:M}}],!1;break}if(C===i){if(P.label!==void 0){let M=i;if(typeof P.label!="string")return De.errors=[{instancePath:t+"/props/data/"+m+"/label",schemaPath:"#/properties/props/properties/data/items/properties/label/type",keyword:"type",params:{type:"string"}}],!1;var d=M===i}else var d=!0;if(d)if(P.value!==void 0){let M=P.value,N=i;if(!(typeof M=="number"&&isFinite(M)))return De.errors=[{instancePath:t+"/props/data/"+m+"/value",schemaPath:"#/properties/props/properties/data/items/properties/value/type",keyword:"type",params:{type:"number"}}],!1;var d=N===i}else var d=!0}}}else return De.errors=[{instancePath:t+"/props/data/"+m,schemaPath:"#/properties/props/properties/data/items/type",keyword:"type",params:{type:"object"}}],!1;var _=R===i;if(!_)break}}else return De.errors=[{instancePath:t+"/props/data",schemaPath:"#/properties/props/properties/data/type",keyword:"type",params:{type:"array"}}],!1;var p=b===i}else var p=!0}}}}else return De.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=g===i}else var u=!0}}else return De.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return De.errors=a,i===0}De.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};var Ah=new RegExp("^[A-Za-z]{3}$","u");function Fe(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Fe.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let p;if(e.amount===void 0&&(p="amount")||e.currency===void 0&&(p="currency"))return Fe.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:p}}],!1;if(e.amount!==void 0){let _=e.amount,d=i;if(!(typeof _=="number"&&!(_%1)&&!isNaN(_)&&isFinite(_)))return Fe.errors=[{instancePath:t+"/amount",schemaPath:"#/properties/amount/type",keyword:"type",params:{type:"integer"}}],!1;var u=d===i}else var u=!0;if(u)if(e.currency!==void 0){let _=e.currency,d=i;if(i===d)if(typeof _=="string"){if(!Ah.test(_))return Fe.errors=[{instancePath:t+"/currency",schemaPath:"#/properties/currency/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z]{3}$"}}],!1}else return Fe.errors=[{instancePath:t+"/currency",schemaPath:"#/properties/currency/type",keyword:"type",params:{type:"string"}}],!1;var u=d===i}else var u=!0}else return Fe.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Fe.errors=a,i===0}Fe.evaluated={props:{amount:!0,currency:!0},dynamicProps:!1,dynamicItems:!1};function Gt(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Gt.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e))for(let p in e){let _=i;if(typeof e[p]!="string")return Gt.errors=[{instancePath:t+"/"+p.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/additionalProperties/type",keyword:"type",params:{type:"string"}}],!1;var u=_===i;if(!u)break}else return Gt.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Gt.errors=a,i===0}Gt.evaluated={props:!0,dynamicProps:!1,dynamicItems:!1};function ue(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=ue.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let S;if(e.typeName===void 0&&(S="typeName")||e.statementId===void 0&&(S="statementId")||e.props===void 0&&(S="props"))return ue.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:S}}],!1;if(e.typeName!==void 0){let b=i;if(e.typeName!=="Product")return ue.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Product"}}],!1;var u=b===i}else var u=!0;if(u){if(e.statementId!==void 0){let b=i;if(typeof e.statementId!="string")return ue.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=b===i}else var u=!0;if(u)if(e.props!==void 0){let b=e.props,w=i;if(i===w)if(b&&typeof b=="object"&&!Array.isArray(b)){let m;if(b.product===void 0&&(m="product"))return ue.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:m}}],!1;{let P=i;for(let R in b)if(!(R==="product"||R==="actions")){return ue.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:R}}],!1;break}if(P===i){if(b.product!==void 0){let R=b.product,I=i;if(i===I)if(R&&typeof R=="object"&&!Array.isArray(R)){let A;if(R.title===void 0&&(A="title")||R.price===void 0&&(A="price"))return ue.errors=[{instancePath:t+"/props/product",schemaPath:"#/properties/props/properties/product/required",keyword:"required",params:{missingProperty:A}}],!1;if(R.title!==void 0){let C=i;if(typeof R.title!="string")return ue.errors=[{instancePath:t+"/props/product/title",schemaPath:"#/properties/props/properties/product/properties/title/type",keyword:"type",params:{type:"string"}}],!1;var p=C===i}else var p=!0;if(p){if(R.price!==void 0){let C=i;Fe(R.price,{instancePath:t+"/props/product/price",parentData:R,parentDataProperty:"price",rootData:o,dynamicAnchors:s})||(a=a===null?Fe.errors:a.concat(Fe.errors),i=a.length);var p=C===i}else var p=!0;if(p){if(R.id!==void 0){let C=i;if(typeof R.id!="string")return ue.errors=[{instancePath:t+"/props/product/id",schemaPath:"#/properties/props/properties/product/properties/id/type",keyword:"type",params:{type:"string"}}],!1;var p=C===i}else var p=!0;if(p){if(R.compareAtPrice!==void 0){let C=i;Fe(R.compareAtPrice,{instancePath:t+"/props/product/compareAtPrice",parentData:R,parentDataProperty:"compareAtPrice",rootData:o,dynamicAnchors:s})||(a=a===null?Fe.errors:a.concat(Fe.errors),i=a.length);var p=C===i}else var p=!0;if(p){if(R.image!==void 0){let C=i;if(typeof R.image!="string")return ue.errors=[{instancePath:t+"/props/product/image",schemaPath:"#/properties/props/properties/product/properties/image/type",keyword:"type",params:{type:"string"}}],!1;var p=C===i}else var p=!0;if(p){if(R.url!==void 0){let C=i;if(typeof R.url!="string")return ue.errors=[{instancePath:t+"/props/product/url",schemaPath:"#/properties/props/properties/product/properties/url/type",keyword:"type",params:{type:"string"}}],!1;var p=C===i}else var p=!0;if(p){if(R.description!==void 0){let C=i;if(typeof R.description!="string")return ue.errors=[{instancePath:t+"/props/product/description",schemaPath:"#/properties/props/properties/product/properties/description/type",keyword:"type",params:{type:"string"}}],!1;var p=C===i}else var p=!0;if(p){if(R.badge!==void 0){let C=i;if(typeof R.badge!="string")return ue.errors=[{instancePath:t+"/props/product/badge",schemaPath:"#/properties/props/properties/product/properties/badge/type",keyword:"type",params:{type:"string"}}],!1;var p=C===i}else var p=!0;if(p){if(R.rating!==void 0){let C=R.rating,M=i;if(i===M)if(C&&typeof C=="object"&&!Array.isArray(C)){let H;if(C.value===void 0&&(H="value"))return ue.errors=[{instancePath:t+"/props/product/rating",schemaPath:"#/properties/props/properties/product/properties/rating/required",keyword:"required",params:{missingProperty:H}}],!1;if(C.value!==void 0){let G=C.value,z=i;if(!(typeof G=="number"&&isFinite(G)))return ue.errors=[{instancePath:t+"/props/product/rating/value",schemaPath:"#/properties/props/properties/product/properties/rating/properties/value/type",keyword:"type",params:{type:"number"}}],!1;var _=z===i}else var _=!0;if(_)if(C.count!==void 0){let G=C.count,z=i;if(!(typeof G=="number"&&!(G%1)&&!isNaN(G)&&isFinite(G)))return ue.errors=[{instancePath:t+"/props/product/rating/count",schemaPath:"#/properties/props/properties/product/properties/rating/properties/count/type",keyword:"type",params:{type:"integer"}}],!1;var _=z===i}else var _=!0}else return ue.errors=[{instancePath:t+"/props/product/rating",schemaPath:"#/properties/props/properties/product/properties/rating/type",keyword:"type",params:{type:"object"}}],!1;var p=M===i}else var p=!0;if(p){if(R.available!==void 0){let C=i;if(typeof R.available!="boolean")return ue.errors=[{instancePath:t+"/props/product/available",schemaPath:"#/properties/props/properties/product/properties/available/type",keyword:"type",params:{type:"boolean"}}],!1;var p=C===i}else var p=!0;if(p){if(R.options!==void 0){let C=R.options,M=i;if(i===M)if(Array.isArray(C)){var d=!0;let H=C.length;for(let G=0;G<H;G++){let z=C[G],ce=i;if(i===ce)if(z&&typeof z=="object"&&!Array.isArray(z)){let _e;if(z.name===void 0&&(_e="name")||z.values===void 0&&(_e="values"))return ue.errors=[{instancePath:t+"/props/product/options/"+G,schemaPath:"#/properties/props/properties/product/properties/options/items/required",keyword:"required",params:{missingProperty:_e}}],!1;if(z.name!==void 0){let ae=i;if(typeof z.name!="string")return ue.errors=[{instancePath:t+"/props/product/options/"+G+"/name",schemaPath:"#/properties/props/properties/product/properties/options/items/properties/name/type",keyword:"type",params:{type:"string"}}],!1;var f=ae===i}else var f=!0;if(f)if(z.values!==void 0){let ae=z.values,ve=i;if(i===ve)if(Array.isArray(ae)){var v=!0;let bt=ae.length;for(let He=0;He<bt;He++){let Tt=i;if(typeof ae[He]!="string")return ue.errors=[{instancePath:t+"/props/product/options/"+G+"/values/"+He,schemaPath:"#/properties/props/properties/product/properties/options/items/properties/values/items/type",keyword:"type",params:{type:"string"}}],!1;var v=Tt===i;if(!v)break}}else return ue.errors=[{instancePath:t+"/props/product/options/"+G+"/values",schemaPath:"#/properties/props/properties/product/properties/options/items/properties/values/type",keyword:"type",params:{type:"array"}}],!1;var f=ve===i}else var f=!0}else return ue.errors=[{instancePath:t+"/props/product/options/"+G,schemaPath:"#/properties/props/properties/product/properties/options/items/type",keyword:"type",params:{type:"object"}}],!1;var d=ce===i;if(!d)break}}else return ue.errors=[{instancePath:t+"/props/product/options",schemaPath:"#/properties/props/properties/product/properties/options/type",keyword:"type",params:{type:"array"}}],!1;var p=M===i}else var p=!0;if(p){if(R.variants!==void 0){let C=R.variants,M=i;if(i===M)if(Array.isArray(C)){var g=!0;let H=C.length;for(let G=0;G<H;G++){let z=C[G],ce=i;if(i===ce)if(z&&typeof z=="object"&&!Array.isArray(z)){let _e;if(z.options===void 0&&(_e="options"))return ue.errors=[{instancePath:t+"/props/product/variants/"+G,schemaPath:"#/properties/props/properties/product/properties/variants/items/required",keyword:"required",params:{missingProperty:_e}}],!1;if(z.options!==void 0){let ae=i;Gt(z.options,{instancePath:t+"/props/product/variants/"+G+"/options",parentData:z,parentDataProperty:"options",rootData:o,dynamicAnchors:s})||(a=a===null?Gt.errors:a.concat(Gt.errors),i=a.length);var x=ae===i}else var x=!0;if(x){if(z.id!==void 0){let ae=i;if(typeof z.id!="string")return ue.errors=[{instancePath:t+"/props/product/variants/"+G+"/id",schemaPath:"#/properties/props/properties/product/properties/variants/items/properties/id/type",keyword:"type",params:{type:"string"}}],!1;var x=ae===i}else var x=!0;if(x){if(z.price!==void 0){let ae=i;Fe(z.price,{instancePath:t+"/props/product/variants/"+G+"/price",parentData:z,parentDataProperty:"price",rootData:o,dynamicAnchors:s})||(a=a===null?Fe.errors:a.concat(Fe.errors),i=a.length);var x=ae===i}else var x=!0;if(x){if(z.compareAtPrice!==void 0){let ae=i;Fe(z.compareAtPrice,{instancePath:t+"/props/product/variants/"+G+"/compareAtPrice",parentData:z,parentDataProperty:"compareAtPrice",rootData:o,dynamicAnchors:s})||(a=a===null?Fe.errors:a.concat(Fe.errors),i=a.length);var x=ae===i}else var x=!0;if(x){if(z.image!==void 0){let ae=i;if(typeof z.image!="string")return ue.errors=[{instancePath:t+"/props/product/variants/"+G+"/image",schemaPath:"#/properties/props/properties/product/properties/variants/items/properties/image/type",keyword:"type",params:{type:"string"}}],!1;var x=ae===i}else var x=!0;if(x)if(z.available!==void 0){let ae=i;if(typeof z.available!="boolean")return ue.errors=[{instancePath:t+"/props/product/variants/"+G+"/available",schemaPath:"#/properties/props/properties/product/properties/variants/items/properties/available/type",keyword:"type",params:{type:"boolean"}}],!1;var x=ae===i}else var x=!0}}}}}else return ue.errors=[{instancePath:t+"/props/product/variants/"+G,schemaPath:"#/properties/props/properties/product/properties/variants/items/type",keyword:"type",params:{type:"object"}}],!1;var g=ce===i;if(!g)break}}else return ue.errors=[{instancePath:t+"/props/product/variants",schemaPath:"#/properties/props/properties/product/properties/variants/type",keyword:"type",params:{type:"array"}}],!1;var p=M===i}else var p=!0;if(p)if(R.selected!==void 0){let C=i;Gt(R.selected,{instancePath:t+"/props/product/selected",parentData:R,parentDataProperty:"selected",rootData:o,dynamicAnchors:s})||(a=a===null?Gt.errors:a.concat(Gt.errors),i=a.length);var p=C===i}else var p=!0}}}}}}}}}}}}else return ue.errors=[{instancePath:t+"/props/product",schemaPath:"#/properties/props/properties/product/type",keyword:"type",params:{type:"object"}}],!1;var k=I===i}else var k=!0;if(k)if(b.actions!==void 0){let R=b.actions,I=i;if(i===I)if(Array.isArray(R)){var y=!0;let C=R.length;for(let M=0;M<C;M++){let N=i;et(R[M],{instancePath:t+"/props/actions/"+M,parentData:R,parentDataProperty:M,rootData:o,dynamicAnchors:s})||(a=a===null?et.errors:a.concat(et.errors),i=a.length);var y=N===i;if(!y)break}}else return ue.errors=[{instancePath:t+"/props/actions",schemaPath:"#/properties/props/properties/actions/type",keyword:"type",params:{type:"array"}}],!1;var k=I===i}else var k=!0}}}else return ue.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=w===i}else var u=!0}}else return ue.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return ue.errors=a,i===0}ue.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};var Eh={type:"object",properties:{typeName:{const:"Cart"},statementId:{type:"string"},props:{type:"object",properties:{cart:{type:"object",properties:{lines:{type:"array",items:{$ref:"#/$defs/LineItem"}},totals:{type:"array",items:{$ref:"#/$defs/Total"}},messages:{type:"array",items:{type:"object",properties:{text:{type:"string"},severity:{type:"string",enum:["info","warning","error"]}},required:["text","severity"]}}},required:["lines","totals"]},actions:{type:"array",items:{$ref:"#/$defs/Action"}}},required:["cart"],additionalProperties:!1}},required:["typeName","statementId","props"]};function Nt(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Nt.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let _;if(e.title===void 0&&(_="title")||e.quantity===void 0&&(_="quantity")||e.price===void 0&&(_="price"))return Nt.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:_}}],!1;if(e.title!==void 0){let d=i;if(typeof e.title!="string")return Nt.errors=[{instancePath:t+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"}}],!1;var u=d===i}else var u=!0;if(u){if(e.quantity!==void 0){let d=e.quantity,f=i;if(!(typeof d=="number"&&!(d%1)&&!isNaN(d)&&isFinite(d)))return Nt.errors=[{instancePath:t+"/quantity",schemaPath:"#/properties/quantity/type",keyword:"type",params:{type:"integer"}}],!1;var u=f===i}else var u=!0;if(u){if(e.price!==void 0){let d=i;Fe(e.price,{instancePath:t+"/price",parentData:e,parentDataProperty:"price",rootData:o,dynamicAnchors:s})||(a=a===null?Fe.errors:a.concat(Fe.errors),i=a.length);var u=d===i}else var u=!0;if(u){if(e.image!==void 0){let d=i;if(typeof e.image!="string")return Nt.errors=[{instancePath:t+"/image",schemaPath:"#/properties/image/type",keyword:"type",params:{type:"string"}}],!1;var u=d===i}else var u=!0;if(u){if(e.url!==void 0){let d=i;if(typeof e.url!="string")return Nt.errors=[{instancePath:t+"/url",schemaPath:"#/properties/url/type",keyword:"type",params:{type:"string"}}],!1;var u=d===i}else var u=!0;if(u){if(e.options!==void 0){let d=i;Gt(e.options,{instancePath:t+"/options",parentData:e,parentDataProperty:"options",rootData:o,dynamicAnchors:s})||(a=a===null?Gt.errors:a.concat(Gt.errors),i=a.length);var u=d===i}else var u=!0;if(u)if(e.actions!==void 0){let d=e.actions,f=i;if(i===f)if(Array.isArray(d)){var p=!0;let g=d.length;for(let x=0;x<g;x++){let k=i;et(d[x],{instancePath:t+"/actions/"+x,parentData:d,parentDataProperty:x,rootData:o,dynamicAnchors:s})||(a=a===null?et.errors:a.concat(et.errors),i=a.length);var p=k===i;if(!p)break}}else return Nt.errors=[{instancePath:t+"/actions",schemaPath:"#/properties/actions/type",keyword:"type",params:{type:"array"}}],!1;var u=f===i}else var u=!0}}}}}}else return Nt.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Nt.errors=a,i===0}Nt.evaluated={props:{title:!0,quantity:!0,price:!0,image:!0,url:!0,options:!0,actions:!0},dynamicProps:!1,dynamicItems:!1};function tr(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=tr.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let p;if(e.label===void 0&&(p="label")||e.amount===void 0&&(p="amount"))return tr.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:p}}],!1;if(e.label!==void 0){let _=i;if(typeof e.label!="string")return tr.errors=[{instancePath:t+"/label",schemaPath:"#/properties/label/type",keyword:"type",params:{type:"string"}}],!1;var u=_===i}else var u=!0;if(u)if(e.amount!==void 0){let _=i;Fe(e.amount,{instancePath:t+"/amount",parentData:e,parentDataProperty:"amount",rootData:o,dynamicAnchors:s})||(a=a===null?Fe.errors:a.concat(Fe.errors),i=a.length);var u=_===i}else var u=!0}else return tr.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return tr.errors=a,i===0}tr.evaluated={props:{label:!0,amount:!0},dynamicProps:!1,dynamicItems:!1};function Le(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Le.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let k;if(e.typeName===void 0&&(k="typeName")||e.statementId===void 0&&(k="statementId")||e.props===void 0&&(k="props"))return Le.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:k}}],!1;if(e.typeName!==void 0){let y=i;if(e.typeName!=="Cart")return Le.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Cart"}}],!1;var u=y===i}else var u=!0;if(u){if(e.statementId!==void 0){let y=i;if(typeof e.statementId!="string")return Le.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=y===i}else var u=!0;if(u)if(e.props!==void 0){let y=e.props,S=i;if(i===S)if(y&&typeof y=="object"&&!Array.isArray(y)){let w;if(y.cart===void 0&&(w="cart"))return Le.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:w}}],!1;{let h=i;for(let m in y)if(!(m==="cart"||m==="actions")){return Le.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:m}}],!1;break}if(h===i){if(y.cart!==void 0){let m=y.cart,P=i;if(i===P)if(m&&typeof m=="object"&&!Array.isArray(m)){let R;if(m.lines===void 0&&(R="lines")||m.totals===void 0&&(R="totals"))return Le.errors=[{instancePath:t+"/props/cart",schemaPath:"#/properties/props/properties/cart/required",keyword:"required",params:{missingProperty:R}}],!1;if(m.lines!==void 0){let I=m.lines,A=i;if(i===A)if(Array.isArray(I)){var p=!0;let C=I.length;for(let M=0;M<C;M++){let N=i;Nt(I[M],{instancePath:t+"/props/cart/lines/"+M,parentData:I,parentDataProperty:M,rootData:o,dynamicAnchors:s})||(a=a===null?Nt.errors:a.concat(Nt.errors),i=a.length);var p=N===i;if(!p)break}}else return Le.errors=[{instancePath:t+"/props/cart/lines",schemaPath:"#/properties/props/properties/cart/properties/lines/type",keyword:"type",params:{type:"array"}}],!1;var _=A===i}else var _=!0;if(_){if(m.totals!==void 0){let I=m.totals,A=i;if(i===A)if(Array.isArray(I)){var d=!0;let M=I.length;for(let N=0;N<M;N++){let H=i;tr(I[N],{instancePath:t+"/props/cart/totals/"+N,parentData:I,parentDataProperty:N,rootData:o,dynamicAnchors:s})||(a=a===null?tr.errors:a.concat(tr.errors),i=a.length);var d=H===i;if(!d)break}}else return Le.errors=[{instancePath:t+"/props/cart/totals",schemaPath:"#/properties/props/properties/cart/properties/totals/type",keyword:"type",params:{type:"array"}}],!1;var _=A===i}else var _=!0;if(_)if(m.messages!==void 0){let I=m.messages,A=i;if(i===A)if(Array.isArray(I)){var f=!0;let M=I.length;for(let N=0;N<M;N++){let H=I[N],G=i;if(i===G)if(H&&typeof H=="object"&&!Array.isArray(H)){let ce;if(H.text===void 0&&(ce="text")||H.severity===void 0&&(ce="severity"))return Le.errors=[{instancePath:t+"/props/cart/messages/"+N,schemaPath:"#/properties/props/properties/cart/properties/messages/items/required",keyword:"required",params:{missingProperty:ce}}],!1;if(H.text!==void 0){let pe=i;if(typeof H.text!="string")return Le.errors=[{instancePath:t+"/props/cart/messages/"+N+"/text",schemaPath:"#/properties/props/properties/cart/properties/messages/items/properties/text/type",keyword:"type",params:{type:"string"}}],!1;var v=pe===i}else var v=!0;if(v)if(H.severity!==void 0){let pe=H.severity,_e=i;if(typeof pe!="string")return Le.errors=[{instancePath:t+"/props/cart/messages/"+N+"/severity",schemaPath:"#/properties/props/properties/cart/properties/messages/items/properties/severity/type",keyword:"type",params:{type:"string"}}],!1;if(!(pe==="info"||pe==="warning"||pe==="error"))return Le.errors=[{instancePath:t+"/props/cart/messages/"+N+"/severity",schemaPath:"#/properties/props/properties/cart/properties/messages/items/properties/severity/enum",keyword:"enum",params:{allowedValues:Eh.properties.props.properties.cart.properties.messages.items.properties.severity.enum}}],!1;var v=_e===i}else var v=!0}else return Le.errors=[{instancePath:t+"/props/cart/messages/"+N,schemaPath:"#/properties/props/properties/cart/properties/messages/items/type",keyword:"type",params:{type:"object"}}],!1;var f=G===i;if(!f)break}}else return Le.errors=[{instancePath:t+"/props/cart/messages",schemaPath:"#/properties/props/properties/cart/properties/messages/type",keyword:"type",params:{type:"array"}}],!1;var _=A===i}else var _=!0}}else return Le.errors=[{instancePath:t+"/props/cart",schemaPath:"#/properties/props/properties/cart/type",keyword:"type",params:{type:"object"}}],!1;var g=P===i}else var g=!0;if(g)if(y.actions!==void 0){let m=y.actions,P=i;if(i===P)if(Array.isArray(m)){var x=!0;let I=m.length;for(let A=0;A<I;A++){let C=i;et(m[A],{instancePath:t+"/props/actions/"+A,parentData:m,parentDataProperty:A,rootData:o,dynamicAnchors:s})||(a=a===null?et.errors:a.concat(et.errors),i=a.length);var x=C===i;if(!x)break}}else return Le.errors=[{instancePath:t+"/props/actions",schemaPath:"#/properties/props/properties/actions/type",keyword:"type",params:{type:"array"}}],!1;var g=P===i}else var g=!0}}}else return Le.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=S===i}else var u=!0}}else return Le.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Le.errors=a,i===0}Le.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function Ie(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Ie.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let k;if(e.typeName===void 0&&(k="typeName")||e.statementId===void 0&&(k="statementId")||e.props===void 0&&(k="props"))return Ie.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:k}}],!1;if(e.typeName!==void 0){let y=i;if(e.typeName!=="Order")return Ie.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Order"}}],!1;var u=y===i}else var u=!0;if(u){if(e.statementId!==void 0){let y=i;if(typeof e.statementId!="string")return Ie.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=y===i}else var u=!0;if(u)if(e.props!==void 0){let y=e.props,S=i;if(i===S)if(y&&typeof y=="object"&&!Array.isArray(y)){let w;if(y.order===void 0&&(w="order"))return Ie.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:w}}],!1;{let h=i;for(let m in y)if(!(m==="order"||m==="actions")){return Ie.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:m}}],!1;break}if(h===i){if(y.order!==void 0){let m=y.order,P=i;if(i===P)if(m&&typeof m=="object"&&!Array.isArray(m)){let R;if(m.number===void 0&&(R="number")||m.status===void 0&&(R="status")||m.items===void 0&&(R="items")||m.totals===void 0&&(R="totals"))return Ie.errors=[{instancePath:t+"/props/order",schemaPath:"#/properties/props/properties/order/required",keyword:"required",params:{missingProperty:R}}],!1;if(m.number!==void 0){let I=i;if(typeof m.number!="string")return Ie.errors=[{instancePath:t+"/props/order/number",schemaPath:"#/properties/props/properties/order/properties/number/type",keyword:"type",params:{type:"string"}}],!1;var p=I===i}else var p=!0;if(p){if(m.status!==void 0){let I=i;if(typeof m.status!="string")return Ie.errors=[{instancePath:t+"/props/order/status",schemaPath:"#/properties/props/properties/order/properties/status/type",keyword:"type",params:{type:"string"}}],!1;var p=I===i}else var p=!0;if(p){if(m.date!==void 0){let I=i;if(typeof m.date!="string")return Ie.errors=[{instancePath:t+"/props/order/date",schemaPath:"#/properties/props/properties/order/properties/date/type",keyword:"type",params:{type:"string"}}],!1;var p=I===i}else var p=!0;if(p){if(m.items!==void 0){let I=m.items,A=i;if(i===A)if(Array.isArray(I)){var _=!0;let M=I.length;for(let N=0;N<M;N++){let H=i;Nt(I[N],{instancePath:t+"/props/order/items/"+N,parentData:I,parentDataProperty:N,rootData:o,dynamicAnchors:s})||(a=a===null?Nt.errors:a.concat(Nt.errors),i=a.length);var _=H===i;if(!_)break}}else return Ie.errors=[{instancePath:t+"/props/order/items",schemaPath:"#/properties/props/properties/order/properties/items/type",keyword:"type",params:{type:"array"}}],!1;var p=A===i}else var p=!0;if(p){if(m.totals!==void 0){let I=m.totals,A=i;if(i===A)if(Array.isArray(I)){var d=!0;let M=I.length;for(let N=0;N<M;N++){let H=i;tr(I[N],{instancePath:t+"/props/order/totals/"+N,parentData:I,parentDataProperty:N,rootData:o,dynamicAnchors:s})||(a=a===null?tr.errors:a.concat(tr.errors),i=a.length);var d=H===i;if(!d)break}}else return Ie.errors=[{instancePath:t+"/props/order/totals",schemaPath:"#/properties/props/properties/order/properties/totals/type",keyword:"type",params:{type:"array"}}],!1;var p=A===i}else var p=!0;if(p)if(m.timeline!==void 0){let I=m.timeline,A=i;if(i===A)if(Array.isArray(I)){var f=!0;let M=I.length;for(let N=0;N<M;N++){let H=I[N],G=i;if(i===G)if(H&&typeof H=="object"&&!Array.isArray(H)){let ce;if(H.label===void 0&&(ce="label")||H.done===void 0&&(ce="done"))return Ie.errors=[{instancePath:t+"/props/order/timeline/"+N,schemaPath:"#/properties/props/properties/order/properties/timeline/items/required",keyword:"required",params:{missingProperty:ce}}],!1;if(H.label!==void 0){let pe=i;if(typeof H.label!="string")return Ie.errors=[{instancePath:t+"/props/order/timeline/"+N+"/label",schemaPath:"#/properties/props/properties/order/properties/timeline/items/properties/label/type",keyword:"type",params:{type:"string"}}],!1;var v=pe===i}else var v=!0;if(v){if(H.done!==void 0){let pe=i;if(typeof H.done!="boolean")return Ie.errors=[{instancePath:t+"/props/order/timeline/"+N+"/done",schemaPath:"#/properties/props/properties/order/properties/timeline/items/properties/done/type",keyword:"type",params:{type:"boolean"}}],!1;var v=pe===i}else var v=!0;if(v)if(H.date!==void 0){let pe=i;if(typeof H.date!="string")return Ie.errors=[{instancePath:t+"/props/order/timeline/"+N+"/date",schemaPath:"#/properties/props/properties/order/properties/timeline/items/properties/date/type",keyword:"type",params:{type:"string"}}],!1;var v=pe===i}else var v=!0}}else return Ie.errors=[{instancePath:t+"/props/order/timeline/"+N,schemaPath:"#/properties/props/properties/order/properties/timeline/items/type",keyword:"type",params:{type:"object"}}],!1;var f=G===i;if(!f)break}}else return Ie.errors=[{instancePath:t+"/props/order/timeline",schemaPath:"#/properties/props/properties/order/properties/timeline/type",keyword:"type",params:{type:"array"}}],!1;var p=A===i}else var p=!0}}}}}else return Ie.errors=[{instancePath:t+"/props/order",schemaPath:"#/properties/props/properties/order/type",keyword:"type",params:{type:"object"}}],!1;var g=P===i}else var g=!0;if(g)if(y.actions!==void 0){let m=y.actions,P=i;if(i===P)if(Array.isArray(m)){var x=!0;let I=m.length;for(let A=0;A<I;A++){let C=i;et(m[A],{instancePath:t+"/props/actions/"+A,parentData:m,parentDataProperty:A,rootData:o,dynamicAnchors:s})||(a=a===null?et.errors:a.concat(et.errors),i=a.length);var x=C===i;if(!x)break}}else return Ie.errors=[{instancePath:t+"/props/actions",schemaPath:"#/properties/props/properties/actions/type",keyword:"type",params:{type:"array"}}],!1;var g=P===i}else var g=!0}}}else return Ie.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=S===i}else var u=!0}}else return Ie.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Ie.errors=a,i===0}Ie.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function gt(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=gt.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let v;if(e.typeName===void 0&&(v="typeName")||e.statementId===void 0&&(v="statementId")||e.props===void 0&&(v="props"))return gt.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:v}}],!1;if(e.typeName!==void 0){let g=i;if(e.typeName!=="Cell")return gt.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Cell"}}],!1;var u=g===i}else var u=!0;if(u){if(e.statementId!==void 0){let g=i;if(typeof e.statementId!="string")return gt.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=g===i}else var u=!0;if(u)if(e.props!==void 0){let g=e.props,x=i;if(i===x)if(g&&typeof g=="object"&&!Array.isArray(g)){let y;if(g.children===void 0&&(y="children"))return gt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:y}}],!1;{let S=i;for(let b in g)if(!(b==="children"||b==="span")){return gt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:b}}],!1;break}if(S===i){if(g.children!==void 0){let b=g.children,w=i;if(i===w)if(Array.isArray(b)){var p=!0;let h=b.length;for(let m=0;m<h;m++){let P=b[m],R=i,I=i,A=!1,C=i;vt(P,{instancePath:t+"/props/children/"+m,parentData:b,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(a=a===null?vt.errors:a.concat(vt.errors),i=a.length);var d=C===i;if(A=A||d,d){var _={};_.typeName=!0,_.statementId=!0,_.props=!0}let M=i;We(P,{instancePath:t+"/props/children/"+m,parentData:b,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(a=a===null?We.errors:a.concat(We.errors),i=a.length);var d=M===i;A=A||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let N=i;at(P,{instancePath:t+"/props/children/"+m,parentData:b,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(a=a===null?at.errors:a.concat(at.errors),i=a.length);var d=N===i;A=A||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let H=i;Ve(P,{instancePath:t+"/props/children/"+m,parentData:b,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(a=a===null?Ve.errors:a.concat(Ve.errors),i=a.length);var d=H===i;A=A||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let G=i;De(P,{instancePath:t+"/props/children/"+m,parentData:b,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(a=a===null?De.errors:a.concat(De.errors),i=a.length);var d=G===i;A=A||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let z=i;ue(P,{instancePath:t+"/props/children/"+m,parentData:b,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(a=a===null?ue.errors:a.concat(ue.errors),i=a.length);var d=z===i;A=A||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let ce=i;Le(P,{instancePath:t+"/props/children/"+m,parentData:b,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(a=a===null?Le.errors:a.concat(Le.errors),i=a.length);var d=ce===i;A=A||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0);let pe=i;Ie(P,{instancePath:t+"/props/children/"+m,parentData:b,parentDataProperty:m,rootData:o,dynamicAnchors:s})||(a=a===null?Ie.errors:a.concat(Ie.errors),i=a.length);var d=pe===i;if(A=A||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0),A)i=I,a!==null&&(I?a.length=I:a=null);else{let ae={instancePath:t+"/props/children/"+m,schemaPath:"#/properties/props/properties/children/items/anyOf",keyword:"anyOf",params:{}};return a===null?a=[ae]:a.push(ae),i++,gt.errors=a,!1}var p=R===i;if(!p)break}}else return gt.errors=[{instancePath:t+"/props/children",schemaPath:"#/properties/props/properties/children/type",keyword:"type",params:{type:"array"}}],!1;var f=w===i}else var f=!0;if(f)if(g.span!==void 0){let b=g.span,w=i;if(!(typeof b=="number"&&!(b%1)&&!isNaN(b)&&isFinite(b)))return gt.errors=[{instancePath:t+"/props/span",schemaPath:"#/properties/props/properties/span/type",keyword:"type",params:{type:"integer"}}],!1;if(!(b===1||b===2||b===3||b===4))return gt.errors=[{instancePath:t+"/props/span",schemaPath:"#/properties/props/properties/span/enum",keyword:"enum",params:{allowedValues:Ih.properties.props.properties.span.enum}}],!1;var f=w===i}else var f=!0}}}else return gt.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=x===i}else var u=!0}}else return gt.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return gt.errors=a,i===0}gt.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function Et(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Et.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let v;if(e.typeName===void 0&&(v="typeName")||e.statementId===void 0&&(v="statementId")||e.props===void 0&&(v="props"))return Et.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:v}}],!1;if(e.typeName!==void 0){let g=i;if(e.typeName!=="Grid")return Et.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Grid"}}],!1;var u=g===i}else var u=!0;if(u){if(e.statementId!==void 0){let g=i;if(typeof e.statementId!="string")return Et.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=g===i}else var u=!0;if(u)if(e.props!==void 0){let g=e.props,x=i;if(i===x)if(g&&typeof g=="object"&&!Array.isArray(g)){let y;if(g.columns===void 0&&(y="columns")||g.children===void 0&&(y="children"))return Et.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:y}}],!1;{let S=i;for(let b in g)if(!(b==="columns"||b==="children")){return Et.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:b}}],!1;break}if(S===i){if(g.columns!==void 0){let b=g.columns,w=i;if(!(typeof b=="number"&&!(b%1)&&!isNaN(b)&&isFinite(b)))return Et.errors=[{instancePath:t+"/props/columns",schemaPath:"#/properties/props/properties/columns/type",keyword:"type",params:{type:"integer"}}],!1;if(!(b===1||b===2||b===3||b===4))return Et.errors=[{instancePath:t+"/props/columns",schemaPath:"#/properties/props/properties/columns/enum",keyword:"enum",params:{allowedValues:Th.properties.props.properties.columns.enum}}],!1;var p=w===i}else var p=!0;if(p)if(g.children!==void 0){let b=g.children,w=i;if(i===w)if(Array.isArray(b)){var _=!0;let m=b.length;for(let P=0;P<m;P++){let R=b[P],I=i,A=i,C=!1,M=i;gt(R,{instancePath:t+"/props/children/"+P,parentData:b,parentDataProperty:P,rootData:o,dynamicAnchors:s})||(a=a===null?gt.errors:a.concat(gt.errors),i=a.length);var f=M===i;if(C=C||f,f){var d={};d.typeName=!0,d.statementId=!0,d.props=!0}let N=i;vt(R,{instancePath:t+"/props/children/"+P,parentData:b,parentDataProperty:P,rootData:o,dynamicAnchors:s})||(a=a===null?vt.errors:a.concat(vt.errors),i=a.length);var f=N===i;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let H=i;We(R,{instancePath:t+"/props/children/"+P,parentData:b,parentDataProperty:P,rootData:o,dynamicAnchors:s})||(a=a===null?We.errors:a.concat(We.errors),i=a.length);var f=H===i;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let G=i;at(R,{instancePath:t+"/props/children/"+P,parentData:b,parentDataProperty:P,rootData:o,dynamicAnchors:s})||(a=a===null?at.errors:a.concat(at.errors),i=a.length);var f=G===i;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let z=i;Ve(R,{instancePath:t+"/props/children/"+P,parentData:b,parentDataProperty:P,rootData:o,dynamicAnchors:s})||(a=a===null?Ve.errors:a.concat(Ve.errors),i=a.length);var f=z===i;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let ce=i;De(R,{instancePath:t+"/props/children/"+P,parentData:b,parentDataProperty:P,rootData:o,dynamicAnchors:s})||(a=a===null?De.errors:a.concat(De.errors),i=a.length);var f=ce===i;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let pe=i;ue(R,{instancePath:t+"/props/children/"+P,parentData:b,parentDataProperty:P,rootData:o,dynamicAnchors:s})||(a=a===null?ue.errors:a.concat(ue.errors),i=a.length);var f=pe===i;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let _e=i;Le(R,{instancePath:t+"/props/children/"+P,parentData:b,parentDataProperty:P,rootData:o,dynamicAnchors:s})||(a=a===null?Le.errors:a.concat(Le.errors),i=a.length);var f=_e===i;C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let ae=i;Ie(R,{instancePath:t+"/props/children/"+P,parentData:b,parentDataProperty:P,rootData:o,dynamicAnchors:s})||(a=a===null?Ie.errors:a.concat(Ie.errors),i=a.length);var f=ae===i;if(C=C||f,f&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0),C)i=A,a!==null&&(A?a.length=A:a=null);else{let Xe={instancePath:t+"/props/children/"+P,schemaPath:"#/properties/props/properties/children/items/anyOf",keyword:"anyOf",params:{}};return a===null?a=[Xe]:a.push(Xe),i++,Et.errors=a,!1}var _=I===i;if(!_)break}}else return Et.errors=[{instancePath:t+"/props/children",schemaPath:"#/properties/props/properties/children/type",keyword:"type",params:{type:"array"}}],!1;var p=w===i}else var p=!0}}}else return Et.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=x===i}else var u=!0}}else return Et.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Et.errors=a,i===0}Et.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function Ft(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=Ft.evaluated;if(c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0),i===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let f;if(e.typeName===void 0&&(f="typeName")||e.statementId===void 0&&(f="statementId")||e.props===void 0&&(f="props"))return Ft.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:f}}],!1;if(e.typeName!==void 0){let v=i;if(e.typeName!=="Carousel")return Ft.errors=[{instancePath:t+"/typeName",schemaPath:"#/properties/typeName/const",keyword:"const",params:{allowedValue:"Carousel"}}],!1;var u=v===i}else var u=!0;if(u){if(e.statementId!==void 0){let v=i;if(typeof e.statementId!="string")return Ft.errors=[{instancePath:t+"/statementId",schemaPath:"#/properties/statementId/type",keyword:"type",params:{type:"string"}}],!1;var u=v===i}else var u=!0;if(u)if(e.props!==void 0){let v=e.props,g=i;if(i===g)if(v&&typeof v=="object"&&!Array.isArray(v)){let k;if(v.children===void 0&&(k="children"))return Ft.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/required",keyword:"required",params:{missingProperty:k}}],!1;{let y=i;for(let S in v)if(S!=="children"){return Ft.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:S}}],!1;break}if(y===i&&v.children!==void 0){let S=v.children;if(i===i)if(Array.isArray(S)){var p=!0;let w=S.length;for(let h=0;h<w;h++){let m=S[h],P=i,R=i,I=!1,A=i;We(m,{instancePath:t+"/props/children/"+h,parentData:S,parentDataProperty:h,rootData:o,dynamicAnchors:s})||(a=a===null?We.errors:a.concat(We.errors),i=a.length);var d=A===i;if(I=I||d,d){var _={};_.typeName=!0,_.statementId=!0,_.props=!0}let C=i;ue(m,{instancePath:t+"/props/children/"+h,parentData:S,parentDataProperty:h,rootData:o,dynamicAnchors:s})||(a=a===null?ue.errors:a.concat(ue.errors),i=a.length);var d=C===i;if(I=I||d,d&&_!==!0&&(_=_||{},_.typeName=!0,_.statementId=!0,_.props=!0),I)i=R,a!==null&&(R?a.length=R:a=null);else{let N={instancePath:t+"/props/children/"+h,schemaPath:"#/properties/props/properties/children/items/anyOf",keyword:"anyOf",params:{}};return a===null?a=[N]:a.push(N),i++,Ft.errors=a,!1}var p=P===i;if(!p)break}}else return Ft.errors=[{instancePath:t+"/props/children",schemaPath:"#/properties/props/properties/children/type",keyword:"type",params:{type:"array"}}],!1}}}else return Ft.errors=[{instancePath:t+"/props",schemaPath:"#/properties/props/type",keyword:"type",params:{type:"object"}}],!1;var u=g===i}else var u=!0}}else return Ft.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"}}],!1;return Ft.errors=a,i===0}Ft.evaluated={props:{typeName:!0,statementId:!0,props:!0},dynamicProps:!1,dynamicItems:!1};function ho(e,{instancePath:t="",parentData:r,parentDataProperty:n,rootData:o=e,dynamicAnchors:s={}}={}){let a=null,i=0,c=ho.evaluated;c.dynamicProps&&(c.props=void 0),c.dynamicItems&&(c.items=void 0);let u=i,p=!1,_=i;Et(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?Et.errors:a.concat(Et.errors),i=a.length);var m=_===i;if(p=p||m,m){var d={};d.typeName=!0,d.statementId=!0,d.props=!0}let f=i;gt(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?gt.errors:a.concat(gt.errors),i=a.length);var m=f===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let v=i;Ft(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?Ft.errors:a.concat(Ft.errors),i=a.length);var m=v===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let g=i;vt(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?vt.errors:a.concat(vt.errors),i=a.length);var m=g===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let x=i;We(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?We.errors:a.concat(We.errors),i=a.length);var m=x===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let k=i;at(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?at.errors:a.concat(at.errors),i=a.length);var m=k===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let y=i;Ve(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?Ve.errors:a.concat(Ve.errors),i=a.length);var m=y===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let S=i;De(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?De.errors:a.concat(De.errors),i=a.length);var m=S===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let b=i;ue(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?ue.errors:a.concat(ue.errors),i=a.length);var m=b===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let w=i;Le(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?Le.errors:a.concat(Le.errors),i=a.length);var m=w===i;p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0);let h=i;Ie(e,{instancePath:t,parentData:r,parentDataProperty:n,rootData:o,dynamicAnchors:s})||(a=a===null?Ie.errors:a.concat(Ie.errors),i=a.length);var m=h===i;if(p=p||m,m&&d!==!0&&(d=d||{},d.typeName=!0,d.statementId=!0,d.props=!0),p)i=u,a!==null&&(u?a.length=u:a=null);else{let P={instancePath:t,schemaPath:"#/anyOf",keyword:"anyOf",params:{}};return a===null?a=[P]:a.push(P),i++,ho.errors=a,!1}return ho.errors=a,c.props=d,i===0}ho.evaluated={dynamicProps:!0,dynamicItems:!1};function $u(e){switch(e.k){case"StateRef":case"RuntimeRef":case"BinOp":case"UnaryOp":case"Ternary":case"Member":case"Index":case"Assign":return!0;default:return!1}}var Mh=new Set(["Comp","Ref","StateRef","RuntimeRef","BinOp","UnaryOp","Ternary","Member","Index","Assign","Str","Num","Bool","Null","Arr","Obj","Ph"]);function tn(e){return!e||typeof e!="object"||Array.isArray(e)?!1:Mh.has(e.k)}function yo(e,t){let r=n=>{switch(t(n),n.k){case"Comp":n.args.forEach(r),Object.values(n.mappedProps??{}).forEach(r);break;case"Arr":n.els.forEach(r);break;case"Obj":n.entries.forEach(([,o])=>r(o));break;case"BinOp":r(n.left),r(n.right);break;case"UnaryOp":r(n.operand);break;case"Ternary":r(n.cond),r(n.then),r(n.else);break;case"Member":r(n.obj);break;case"Index":r(n.obj),r(n.index);break;case"Assign":r(n.value);break}};r(e)}function Fi(e){return e==null?{k:"Null"}:typeof e=="string"?{k:"Str",v:e}:typeof e=="number"?{k:"Num",v:e}:typeof e=="boolean"?{k:"Bool",v:e}:Array.isArray(e)?{k:"Arr",els:e.map(Fi)}:typeof e=="object"?{k:"Obj",entries:Object.entries(e).map(([t,r])=>[t,Fi(r)])}:{k:"Null"}}function Hi(e){switch(e.k){case"Str":case"Num":case"Bool":return{v:e.v};case"Null":return{v:null};case"Arr":{let t=[];for(let r of e.els){let n=Hi(r);if(!n)return;t.push(n.v)}return{v:t}}case"Obj":{let t={};for(let[r,n]of e.entries){let o=Hi(n);if(!o)return;t[r]=o.v}return{v:t}}default:return}}var ji=new Map([["Count",{kind:"function",params:[{name:"array",required:!1}],builtin:!0}],["First",{kind:"function",params:[{name:"array",required:!1}],builtin:!0}],["Last",{kind:"function",params:[{name:"array",required:!1}],builtin:!0}],["Sum",{kind:"function",params:[{name:"numbers",required:!1}],builtin:!0}],["Avg",{kind:"function",params:[{name:"numbers",required:!1}],builtin:!0}],["Min",{kind:"function",params:[{name:"numbers",required:!1}],builtin:!0}],["Max",{kind:"function",params:[{name:"numbers",required:!1}],builtin:!0}],["Sort",{kind:"function",params:[{name:"array",required:!1},{name:"field",required:!1},{name:"direction",required:!1}],builtin:!0}],["Filter",{kind:"function",params:[{name:"array",required:!1},{name:"field",required:!1},{name:"operator",required:!1},{name:"value",required:!1}],builtin:!0}],["Round",{kind:"function",params:[{name:"number",required:!1},{name:"decimals",required:!1}],builtin:!0}],["Abs",{kind:"function",params:[{name:"number",required:!1}],builtin:!0}],["Floor",{kind:"function",params:[{name:"number",required:!1}],builtin:!0}],["Ceil",{kind:"function",params:[{name:"number",required:!1}],builtin:!0}],["Each",{kind:"function",params:[{name:"array",required:!1},{name:"varName",required:!1},{name:"template",required:!1}],builtin:!0,lazy:!0}],["Run",{kind:"action",params:[{name:"ref",required:!1}],builtin:!0,lazy:!0}],["ToAssistant",{kind:"action",params:[{name:"message",required:!1},{name:"context",required:!1}],builtin:!0}],["OpenUrl",{kind:"action",params:[{name:"url",required:!1}],builtin:!0}],["Set",{kind:"action",params:[{name:"variable",required:!1},{name:"value",required:!1}],builtin:!0,lazy:!0}],["Reset",{kind:"action",params:[{name:"variable",required:!1}],builtin:!0,lazy:!0}],["Action",{kind:"action",params:[{name:"steps",required:!0}],builtin:!0,lazy:!0}]]),Du={ActionExpression:!0,OpenUrl:!0,ToAssistant:!0},Lr={Query:"Query",Mutation:"Mutation"};function bo(e){return e?.callDefs??ji}function Po(e){return ji.has(e)}function Mn(e){return e in Lr}var E;(function(e){e[e.Newline=0]="Newline",e[e.LParen=1]="LParen",e[e.RParen=2]="RParen",e[e.LBrack=3]="LBrack",e[e.RBrack=4]="RBrack",e[e.LBrace=5]="LBrace",e[e.RBrace=6]="RBrace",e[e.Comma=7]="Comma",e[e.Colon=8]="Colon",e[e.Equals=9]="Equals",e[e.True=10]="True",e[e.False=11]="False",e[e.Null=12]="Null",e[e.EOF=13]="EOF",e[e.Str=14]="Str",e[e.Num=15]="Num",e[e.Ident=16]="Ident",e[e.Type=17]="Type",e[e.StateVar=18]="StateVar",e[e.Dot=19]="Dot",e[e.Plus=20]="Plus",e[e.Minus=21]="Minus",e[e.Star=22]="Star",e[e.Slash=23]="Slash",e[e.Percent=24]="Percent",e[e.EqEq=25]="EqEq",e[e.NotEq=26]="NotEq",e[e.Greater=27]="Greater",e[e.Less=28]="Less",e[e.GreaterEq=29]="GreaterEq",e[e.LessEq=30]="LessEq",e[e.And=31]="And",e[e.Or=32]="Or",e[e.Not=33]="Not",e[e.Question=34]="Question",e[e.BuiltinCall=35]="BuiltinCall"})(E||(E={}));var Lh=1,qu=2,Uu=3,il=4,xo=5,al=6,Vi=7,Bu=8,Nh=9;function Wi(e){let t=0,r=()=>e[t]??{t:E.EOF},n=()=>{let d=r();return t++,d},o=d=>{r().t===d&&t++};function s(d){switch(d.t){case E.Question:return Lh;case E.Or:return qu;case E.And:return Uu;case E.EqEq:case E.NotEq:return il;case E.Greater:case E.Less:case E.GreaterEq:case E.LessEq:return xo;case E.Plus:case E.Minus:return al;case E.Star:case E.Slash:case E.Percent:return Vi;case E.Dot:case E.LBrack:return Nh;default:return 0}}function a(d=0){let f=i();for(;s(r())>d;)f=c(f);return f}function i(){let d=r();if(d.t===E.Str)return n(),{k:"Str",v:d.v};if(d.t===E.Num)return n(),{k:"Num",v:d.v};if(d.t===E.True)return n(),{k:"Bool",v:!0};if(d.t===E.False)return n(),{k:"Bool",v:!1};if(d.t===E.Null)return n(),{k:"Null"};if(d.t===E.LBrack)return p();if(d.t===E.LBrace)return _();if(d.t===E.StateVar){let f=d.v;if(n(),r().t===E.Equals){n();let v=a(0);return{k:"Assign",target:f,value:v}}return{k:"StateRef",n:f}}if(d.t===E.Type){let f=d.v;return e[t+1]?.t===E.LParen&&(!Po(f)||f==="Action")?u():(n(),{k:"Ref",n:f})}if(d.t===E.BuiltinCall){if(e[t+1]?.t===E.LParen){let f=u();return f.k==="Comp"&&!Po(f.name)&&(f.fn=!0),f}return n(),{k:"Ref",n:d.v}}if(d.t===E.Ident)return n(),{k:"Ref",n:d.v};if(d.t===E.Not)return n(),{k:"UnaryOp",op:"!",operand:a(Bu)};if(d.t===E.Minus)return n(),{k:"UnaryOp",op:"-",operand:a(Bu)};if(d.t===E.LParen){n();let f=a(0);return o(E.RParen),f}return n(),{k:"Null"}}function c(d){let f=r();if(f.t===E.Plus)return n(),{k:"BinOp",op:"+",left:d,right:a(al)};if(f.t===E.Minus)return n(),{k:"BinOp",op:"-",left:d,right:a(al)};if(f.t===E.Star)return n(),{k:"BinOp",op:"*",left:d,right:a(Vi)};if(f.t===E.Slash)return n(),{k:"BinOp",op:"/",left:d,right:a(Vi)};if(f.t===E.Percent)return n(),{k:"BinOp",op:"%",left:d,right:a(Vi)};if(f.t===E.EqEq)return n(),{k:"BinOp",op:"==",left:d,right:a(il)};if(f.t===E.NotEq)return n(),{k:"BinOp",op:"!=",left:d,right:a(il)};if(f.t===E.Greater)return n(),{k:"BinOp",op:">",left:d,right:a(xo)};if(f.t===E.Less)return n(),{k:"BinOp",op:"<",left:d,right:a(xo)};if(f.t===E.GreaterEq)return n(),{k:"BinOp",op:">=",left:d,right:a(xo)};if(f.t===E.LessEq)return n(),{k:"BinOp",op:"<=",left:d,right:a(xo)};if(f.t===E.And)return n(),{k:"BinOp",op:"&&",left:d,right:a(Uu)};if(f.t===E.Or)return n(),{k:"BinOp",op:"||",left:d,right:a(qu)};if(f.t===E.Question){n();let v=a(0);o(E.Colon);let g=a(0);return{k:"Ternary",cond:d,then:v,else:g}}if(f.t===E.Dot){n();let v=r(),g=v.t===E.Ident||v.t===E.Type||v.t===E.Str||v.t===E.Num?(n(),String(v.v)):v.t===E.StateVar?(n(),v.v.replace(/^\$/,"")):(n(),"?");return{k:"Member",obj:d,field:g}}if(f.t===E.LBrack){n();let v=a(0);return o(E.RBrack),{k:"Index",obj:d,index:v}}return d}function u(){let d=r().v;n(),o(E.LParen);let f=[];for(;r().t!==E.RParen&&r().t!==E.EOF;)f.push(a(0)),r().t===E.Comma&&n();return o(E.RParen),{k:"Comp",name:d,args:f}}function p(){n();let d=[];for(;r().t!==E.RBrack&&r().t!==E.EOF;)d.push(a(0)),r().t===E.Comma&&n();return o(E.RBrack),{k:"Arr",els:d}}function _(){n();let d=[];for(;r().t!==E.RBrace&&r().t!==E.EOF;){let f=r(),v=f.t===E.Ident||f.t===E.Str||f.t===E.Type||f.t===E.Num?(n(),String(f.v)):f.t===E.StateVar?(n(),f.v.replace(/^\$/,"")):(n(),"?");o(E.Colon),d.push([v,a(0)]),r().t===E.Comma&&n()}return o(E.RBrace),{k:"Obj",entries:d}}return a(0)}function Gi(e){let t=[],r=0,n=e.length;for(;r<n;){for(;r<n&&(e[r]===" "||e[r]===" "||e[r]==="\r");)r++;if(r>=n)break;let o=e[r];if(o===`
|
|
37
|
-
`){t.push({t:
|
|
38
|
-
`:p==="t"?c+=" ":c+=p,r++}}else if(e[r]==="'"){r++,u=!0;break}else c+=e[r],r++;t.push({t:E.Str,v:c});continue}if(o==="-"){let c=t.length>0?t[t.length-1]:null;if(!(!(c!=null&&(c.t===E.Num||c.t===E.Str||c.t===E.Ident||c.t===E.Type||c.t===E.RParen||c.t===E.RBrack||c.t===E.True||c.t===E.False||c.t===E.Null||c.t===E.StateVar||c.t===E.BuiltinCall))&&r+1<n&&e[r+1]>="0"&&e[r+1]<="9")){t.push({t:E.Minus}),r++;continue}}let s=o>="0"&&o<="9",a=o==="-"&&r+1<n&&e[r+1]>="0"&&e[r+1]<="9";if(s||a){let c=r;for(e[r]==="-"&&r++;r<n&&e[r]>="0"&&e[r]<="9";)r++;if(r<n&&e[r]==="."&&r+1<n&&e[r+1]>="0"&&e[r+1]<="9")for(r++;r<n&&e[r]>="0"&&e[r]<="9";)r++;if(r<n&&(e[r]==="e"||e[r]==="E"))for(r++,r<n&&(e[r]==="+"||e[r]==="-")&&r++;r<n&&e[r]>="0"&&e[r]<="9";)r++;t.push({t:E.Num,v:+e.slice(c,r)});continue}if(o==="$"&&r+1<n&&(e[r+1]>="a"&&e[r+1]<="z"||e[r+1]>="A"&&e[r+1]<="Z"||e[r+1]==="_")){let c=r;for(r++;r<n&&(e[r]>="a"&&e[r]<="z"||e[r]>="A"&&e[r]<="Z"||e[r]>="0"&&e[r]<="9"||e[r]==="_");)r++;t.push({t:E.StateVar,v:e.slice(c,r)});continue}if(o>="a"&&o<="z"||o>="A"&&o<="Z"||o==="_"){let c=r;for(;r<n&&(e[r]>="a"&&e[r]<="z"||e[r]>="A"&&e[r]<="Z"||e[r]>="0"&&e[r]<="9"||e[r]==="_");)r++;let u=e.slice(c,r);if(u==="true"){t.push({t:E.True});continue}if(u==="false"){t.push({t:E.False});continue}if(u==="null"){t.push({t:E.Null});continue}let p=o>="A"&&o<="Z"?E.Type:E.Ident;t.push({t:p,v:u});continue}if(o==="@"&&r+1<n&&(e[r+1]>="a"&&e[r+1]<="z"||e[r+1]>="A"&&e[r+1]<="Z"||e[r+1]==="_")){r++;let c=r;for(;r<n&&(e[r]>="a"&&e[r]<="z"||e[r]>="A"&&e[r]<="Z"||e[r]>="0"&&e[r]<="9"||e[r]==="_");)r++;t.push({t:E.BuiltinCall,v:e.slice(c,r)});continue}r++}return t.push({t:E.EOF}),t}function ir(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.type==="element"&&typeof t.typeName=="string"&&typeof t.props=="object"&&t.props!==null&&typeof t.partial=="boolean"}var zu;(function(e){e.ContinueConversation="continue_conversation",e.OpenUrl="open_url"})(zu||(zu={}));var Oh={},$h=[];function Ki(e){return Array.isArray(e)?"array":typeof e}function Fu(e){return typeof e.$ref=="string"?e.$ref.split("/").pop():void 0}function Hu(e){return"$ref"in e||"anyOf"in e||"oneOf"in e||"allOf"in e}function ju(e){if(Array.isArray(e.enum))return{enumValues:e.enum};if("const"in e)return{enumValues:[e.const]};switch(e.type){case"string":return{expectedType:"string"};case"number":case"integer":return{expectedType:"number"};case"boolean":return{expectedType:"boolean"};default:return{}}}function Qi(e){if(!(!e||typeof e!="object"||Array.isArray(e)))return e.default}function sl(e){if(!e||typeof e!="object"||Array.isArray(e))return;let t=e,r=Fu(t);if(r)return r;let n=ju(t);return n.enumValues?n.enumValues.map(o=>JSON.stringify(o)).join("|"):n.expectedType?n.expectedType:typeof t.type=="string"?t.type:void 0}function ll(e,t){let r=t.map(n=>{let o=sl(n.schema),s=n.required?`${n.name}*`:n.name;return o?`${s}: ${o}`:s}).join(", ");return`${e}(${r})`}function Dh(e,t){let r=typeof e;return t.enumValues?t.enumValues.includes(e)?null:{expected:`one of [${t.enumValues.map(n=>JSON.stringify(n)).join(", ")}]`,actual:Ki(e)}:t.expectedType&&t.expectedType!==r?{expected:t.expectedType,actual:Ki(e)}:null}function qh(e,t,r){switch(r.code){case"type-mismatch":return`field "${t}" expects ${r.expected} but got ${r.actual}`;case"pruned-value":return`field "${t}" lost an unresolved or invalid value`;case"missing-required":return`missing required field "${t}"${r.signature?` \u2014 signature: ${r.signature}`:""}`;case"null-required":return`required field "${t}" cannot be null${r.signature?` \u2014 signature: ${r.signature}`:""}`;case"unknown-component":return`Unknown component "${e}" \u2014 not found in catalog or builtins${r.available?.length?`. Available components: ${r.available.join(", ")}`:""}`;case"inline-reserved":return`${e}() must be declared as a top-level statement, not used inline as a value`;case"excess-args":return`${e} takes ${r.declared} arg(s), got ${r.got} (${r.got-r.declared} excess dropped)`;case"unknown-function":return`Unknown function "@${e}": not a built-in or action step. The call evaluates to null`;case"no-root":return r.reason==="not-component"?"root does not evaluate to a component":r.reason==="fallback"?`No root statement. Rendering the first statement that calls the root component ${e}`:e?`No root statement, and no statement calls the root component ${e}`:"No root statement"}}function tt(e,t,r,n){e.errors.push({code:n.code,component:t,path:r,message:qh(t,r,n),statementId:e.currentStatementId,...n.code==="no-root"&&n.reason==="fallback"&&{severity:"warning"}})}var Ot=Symbol("invalid");function Yi(e,t){return t!==void 0?t:e?Ot:void 0}function Uh(e,t,r,n,o){return Hu(t)?!1:typeof t.type=="string"||Array.isArray(t.enum)||"const"in t?(tt(o,r,n,{code:"type-mismatch",expected:typeof t.type=="string"?t.type:"a literal value",actual:`component "${e.typeName}"`}),!0):!1}function Vu(e){return(e.anyOf??e.oneOf??[e]).map(Fu)}function Bh(e,t){let r=Vu(e);return r.length>0&&r.every(n=>n!==void 0&&t.cat?.has(n))}function zh(e,t,r,n,o){if(typeof e!="object"||Array.isArray(e))return tt(o,r,n,{code:"type-mismatch",expected:"object",actual:Ki(e)}),Ot;let s=e,a,i=t.properties&&typeof t.properties=="object"?t.properties:Oh,c=Array.isArray(t.required)?t.required:$h,u=!1;if(!o.partial)for(let p of c){let _=p in s;if(!_||s[p]==null){let d=Qi(i[p]);if(d!==void 0){(a??(a={...s}))[p]=d;continue}tt(o,r,`${n}/${p}`,{code:_?"null-required":"missing-required"}),u=!0}}for(let p of Object.keys(i)){if(!(p in s))continue;let _=i[p],d=So(s[p],_,r,`${n}/${p}`,o);if(d===Ot&&(d=Yi(c.includes(p),Qi(_)),d===Ot)){u=!0;continue}d!==s[p]&&(a??(a={...s}),d===void 0?delete a[p]:a[p]=d)}return u?Ot:a??s}function Fh(e,t,r,n,o){if(!Array.isArray(e))return tt(o,r,n,{code:"type-mismatch",expected:"array",actual:Ki(e)}),Ot;let s=t.items;if(!s||typeof s!="object"||Array.isArray(s))return e;let a;for(let i=0;i<e.length;i++){let c=So(e[i],s,r,`${n}/${i}`,o);c!==e[i]&&!a&&(a=e.slice(0,i)),a&&c!==Ot&&a.push(c)}return a??e}function Hh(e,t,r,n,o){let s=ju(t);if(s.expectedType==null&&s.enumValues==null||s.enumValues&&o.partial)return!1;let a=Dh(e,s);return a?(tt(o,r,n,{code:"type-mismatch",...a}),!0):!1}function So(e,t,r,n,o){if(!t||typeof t!="object"||Array.isArray(t))return e;let s=t;if(e==null||tn(e))return e;if(ir(e))return Uh(e,s,r,n,o)?Ot:e;if(Hu(s))return Bh(s,o)?(tt(o,r,n,{code:"type-mismatch",expected:Vu(s).join(" | "),actual:Array.isArray(e)?"array":typeof e=="object"?"plain object":typeof e}),Ot):e;let a=s.type;return a==="object"?zh(e,s,r,n,o):a==="array"?Fh(e,s,r,n,o):Hh(e,s,r,n,o)?Ot:e}function Ji(e){if(e==null||typeof e!="object")return!1;if(tn(e))return!0;if(Array.isArray(e))return e.some(Ji);if(ir(e))return Object.values(e.props).some(Ji);let t=e;return Array.isArray(t.steps)?!0:Object.values(t).some(Ji)}function Wu(e,t,r){if(t.visited.has(e))return t.unres.push(e),r==="expr"?{k:"Ph",n:e}:null;let n=t.syms.get(e);if(!n)return t.unres.push(e),r==="expr"?{k:"Ph",n:e}:null;if(t.unreached?.delete(e),n.k==="Comp"&&Mn(n.name)){let s=n.name===Lr.Mutation?"mutation":"query";return{k:"RuntimeRef",n:e,refType:s}}t.visited.add(e);let o=t.currentStatementId;t.currentStatementId=e;try{let s=r==="value"?rn(n,t):cl(n,t);return r==="value"&&ir(s)&&(s.statementId=e),s}finally{t.currentStatementId=o,t.visited.delete(e)}}function Xi(e,t){return bo(t.cat).has(e)||Mn(e)}function dl(e,t){let r={};for(let[n,o]of t.entries()){let s=e[n];if(s===void 0)break;r[o.name]=s}return r}function Gu(e,t,r,n){let{params:o}=r;t.length>o.length&&tt(n,e,"",{code:"excess-args",declared:o.length,got:t.length});let s=dl(t,o),a=!1,i=n.errors.length;for(let c of o){let u=s[c.name],p=u?Hi(u):{v:void 0};if(!p)continue;if(p.v==null){if(!c.required||c.defaultValue!==void 0)continue;tt(n,e,`/${c.name}`,{code:u?"null-required":"missing-required",signature:ll(e,o)}),a=!0;continue}let _=So(p.v,c.schema,e,`/${c.name}`,n);_===Ot&&(_=Yi(c.required,c.defaultValue)),_===Ot?a=!0:_===void 0?delete s[c.name]:_!==p.v&&(s[c.name]=Fi(_))}return r.kind==="action"&&n.errors.length>i&&(a=!0),a?null:s}function Ku(e,t,r){let n=e.args.map(r),o=bo(t.cat).get(e.name);if(!o||o.lazy)return{...e,args:n};let s=o.builtin?dl(n,o.params):Gu(e.name,n,o,t);return s?{...e,args:n,mappedProps:s}:o.kind==="action"?{k:"Comp",name:"Action",args:[{k:"Arr",els:[]}]}:{k:"Null"}}function ul(e,t,r){let n=t.currentStatementId;t.currentStatementId=r;let o=new Set;for(let s of e)yo(s,a=>{if(a.k!=="Comp"||o.has(a))return;o.add(a);let i=bo(t.cat).get(a.name);if(!i||i.lazy)return;let c=i.builtin?null:Gu(a.name,a.args,i,t);a.mappedProps=c??dl(a.args,i.params)});t.currentStatementId=n}function Qu(e,t,r){let n=bo(t.cat).get(e.name);if(n?.kind!=="function"||!n.lazy||e.args.length<3)return null;let o=e.args[1],s=o.k==="Ref"?o.n:o.k==="Str"?o.v:null;if(!s)return null;let a=new Set(r);a.add(s);let i=e.args.map((c,u)=>u===1?c:$t(c,t,a));return{...e,args:i}}function $t(e,t,r){switch(e.k){case"Ref":return r.has(e.n)?e:Wu(e.n,t,"expr");case"Ph":return e;case"Comp":{if(e.fn&&!Xi(e.name,t))return tt(t,e.name,"",{code:"unknown-function"}),{k:"Null"};let n=Qu(e,t,r);if(n)return n;if(Xi(e.name,t))return Ku(e,t,a=>$t(a,t,r));let o=e.args.map(a=>$t(a,t,r)),s=t.cat?.get(e.name);if(s){let a={};for(let i=0;i<s.params.length&&i<o.length;i++)a[s.params[i].name]=o[i];return{...e,args:o,mappedProps:a}}return tt(t,e.name,"",{code:"unknown-component",available:t.cat&&[...t.cat.keys()]}),{...e,args:o}}case"Arr":return{...e,els:e.els.map(n=>$t(n,t,r))};case"Obj":return{...e,entries:e.entries.map(([n,o])=>[n,$t(o,t,r)])};case"BinOp":return{...e,left:$t(e.left,t,r),right:$t(e.right,t,r)};case"UnaryOp":return{...e,operand:$t(e.operand,t,r)};case"Ternary":return{...e,cond:$t(e.cond,t,r),then:$t(e.then,t,r),else:$t(e.else,t,r)};case"Member":return{...e,obj:$t(e.obj,t,r)};case"Index":return{...e,obj:$t(e.obj,t,r),index:$t(e.index,t,r)};case"Assign":return{...e,value:$t(e.value,t,r)};default:return e}}function cl(e,t){return $t(e,t,new Set)}function rn(e,t){switch(e.k){case"Ref":return Wu(e.n,t,"value");case"Str":return e.v;case"Num":return e.v;case"Bool":return e.v;case"Null":return null;case"Ph":return null;case"Arr":{let r=[];for(let n of e.els){if(n.k==="Ph"){t.prunedValues++;continue}let o=rn(n,t);if(o===null&&(n.k==="Comp"||n.k==="Ref")){t.prunedValues++;continue}r.push(o)}return r}case"Obj":{let r={};for(let[n,o]of e.entries)r[n]=rn(o,t);return r}case"Comp":{let{name:r,args:n}=e;if(e.fn&&!Xi(r,t))return tt(t,r,"",{code:"unknown-function"}),null;if(Mn(r))return tt(t,r,"",{code:"inline-reserved"}),null;if(Xi(r,t)){let i=Qu(e,t,new Set);return i||Ku(e,t,c=>cl(c,t))}let o=t.cat?.get(r),s={};if(o){let i=!1;for(let u=0;u<o.params.length&&u<n.length;u++){let p=o.params[u],_=t.prunedValues,d=rn(n[u],t);if(t.prunedValues>_&&tt(t,r,`/${p.name}`,{code:"pruned-value"}),s[p.name]=d,p.schema===void 0)continue;if(d==null&&p.defaultValue!==void 0){tt(t,r,`/${p.name}`,{code:"type-mismatch",expected:sl(p.schema)??"a defined value",actual:d===null?"null":"undefined"}),s[p.name]=p.defaultValue,t.prunedValues=_;continue}let f=So(d,p.schema,r,`/${p.name}`,t);f===Ot&&(f=Yi(p.required,p.defaultValue),p.defaultValue!==void 0&&(t.prunedValues=_),f===Ot?i=!0:f===void 0&&delete s[p.name]),f!==Ot&&f!==void 0&&(s[p.name]=f)}n.length>o.params.length&&tt(t,r,"",{code:"excess-args",declared:o.params.length,got:n.length});let c=o.params.filter(u=>u.required&&(!(u.name in s)||s[u.name]===null));if(c.length){let u=c.filter(p=>p.defaultValue!==void 0?(tt(t,r,`/${p.name}`,{code:p.name in s?"null-required":"missing-required"}),s[p.name]=p.defaultValue,!1):!0);if(u.length){for(let p of u)tt(t,r,`/${p.name}`,{code:p.name in s?"null-required":"missing-required",signature:ll(r,o.params)});return null}}if(i)return null}else return tt(t,r,"",{code:"unknown-component",available:t.cat&&[...t.cat.keys()]}),null;let a=Object.values(s).some(i=>Ji(i));return{type:"element",typeName:r,props:s,partial:t.partial,hasDynamicProps:a}}default:return $u(e)?cl(e,t):e}}function pl(e){let t=[],r=!1,n=!1;for(let a=0;a<e.length;a++){let i=e[a];if(n){n=!1;continue}if(i==="\\"&&r){n=!0;continue}if(r){i===r&&(r=!1);continue}if(i==='"'||i==="'"){r=i;continue}i==="("||i==="["||i==="{"?t.push(i):(i===")"&&t[t.length-1]==="("||i==="]"&&t[t.length-1]==="["||i==="}"&&t[t.length-1]==="{")&&t.pop()}if(!(!!r||t.length>0))return{text:e,wasIncomplete:!1};let s=e;r&&(n&&(s+="\\"),s+=r);for(let a=t.length-1;a>=0;a--)s+=t[a]==="("?")":t[a]==="["?"]":"}";return{text:s,wasIncomplete:!0}}function Zi(e){let t=[],r=0;for(;r<e.length;){for(;r<e.length&&e[r].t===E.Newline;)r++;if(r>=e.length||e[r].t===E.EOF)break;let n=e[r];if(n.t!==E.Ident&&n.t!==E.Type&&n.t!==E.StateVar){for(;r<e.length&&e[r].t!==E.Newline&&e[r].t!==E.EOF;)r++;continue}let o=n.v,s=n.t;if(r++,r>=e.length||e[r].t!==E.Equals){for(;r<e.length&&e[r].t!==E.Newline&&e[r].t!==E.EOF;)r++;continue}r++;let a=[],i=0,c=0;for(;r<e.length&&e[r].t!==E.EOF;){let u=e[r].t;if(u===E.Newline&&i<=0&&c<=0){let p=r+1;for(;p<e.length&&e[p].t===E.Newline;)p++;let _=p<e.length?e[p].t:E.EOF;if(_===E.Question||_===E.Colon&&c>0){r++;continue}break}if(u===E.Newline){r++;continue}u===E.LParen||u===E.LBrack||u===E.LBrace?i++:(u===E.RParen||u===E.RBrack||u===E.RBrace)&&i>0?i--:u===E.Question&&i===0?c++:u===E.Colon&&i===0&&c>0&&c--,a.push(e[r++])}a.length&&t.push({id:o,idTokenType:s,tokens:a})}return t}function ta(e=!0){return{root:null,meta:{incomplete:e,unresolved:[],orphaned:[],statementCount:0,errors:[]},stateDeclarations:{},queryStatements:[],mutationStatements:[]}}function Xu(e){if(!tn(e))return[];let t=new Set;return yo(e,r=>{r.k==="StateRef"&&t.add(r.n)}),[...t]}function fl(e,t){if(t.k==="Comp"&&t.name===Lr.Query){let r=Xu(t.args[1]);return{kind:"query",id:e.id,call:{callee:Lr.Query,args:t.args},expr:t,deps:r.length>0?r:void 0}}return t.k==="Comp"&&t.name===Lr.Mutation?{kind:"mutation",id:e.id,call:{callee:Lr.Mutation,args:t.args},expr:t}:e.idTokenType===E.StateVar?{kind:"state",id:e.id,init:t}:{kind:"value",id:e.id,expr:t}}function jh(e,t,r){let n={},o=[],s=[];for(let a of e)switch(a.kind){case"state":n[a.id]=rn(a.init,t);break;case"query":ul(a.call.args,t,a.id),o.push({statementId:a.id,toolAST:a.call.args[0]??null,argsAST:a.call.args[1]??null,defaultsAST:a.call.args[2]??null,refreshAST:a.call.args[3]??null,deps:a.deps,complete:!0});break;case"mutation":ul(a.call.args,t,a.id),s.push({statementId:a.id,toolAST:a.call.args[0]??null,argsAST:a.call.args[1]??null});break}for(let a of e){let i=a.kind==="state"?[a.init]:a.kind==="value"?[a.expr]:a.kind==="query"||a.kind==="mutation"?a.call.args:[];for(let c of i)for(let u of Xu(c))u===r?.name&&r.stmts.has(a)||u in n||(n[u]=null)}return{stateDeclarations:n,queryStatements:o,mutationStatements:s}}var Yu="root";function gl(e){return e?.k==="Comp"&&!e.fn&&!Po(e.name)&&!Mn(e.name)}function Vh(e,t){if(e.has(Yu))return{id:Yu,fallback:!1};for(let r of e.values())if(r.kind==="value"&&gl(r.expr)&&r.expr.name===t)return{id:r.id,fallback:!0};return null}function Wh(e,t){let r=new Set;for(;e?.k==="Ref"&&!r.has(e.n);)r.add(e.n),e=t.get(e.n);return gl(e)}function Gh(e){let t=!1;return yo(e,r=>{gl(r)&&(t=!0)}),t}function ea(e,t,r,n,o,s,a){let i=Vh(e,s),c=new Map;for(let[w,h]of e)c.set(w,h.kind==="state"?h.init:h.expr);let u=[],p=[],_=new Set;for(let[w,h]of e)w!==i?.id&&(h.kind==="state"||h.kind==="query"||h.kind==="mutation"||_.add(w));let d={syms:c,cat:o,errors:p,unres:u,prunedValues:0,visited:new Set,partial:r,currentStatementId:i?.id,unreached:_},f=null,v,g=i&&c.get(i.id);if(i&&g){let w=rn(g,d);ir(w)?(f=w,f.statementId=i.id):tn(w)&&Gh(w)&&(v=w)}let{stateDeclarations:x,queryStatements:k,mutationStatements:y}=jh(t,d,a);d.currentStatementId=i?.id;let S=s??"";i?!f&&!v&&!Wh(c.get(i.id),c)?tt(d,S,"",{code:"no-root",reason:"not-component"}):i.fallback&&tt(d,S,"",{code:"no-root",reason:f?"fallback":"missing"}):tt(d,S,"",{code:"no-root",reason:"missing"});let b=i?[..._]:[];return{root:f,...v?{rootExpression:v}:{},meta:{incomplete:r,unresolved:u,orphaned:b,statementCount:n,errors:p},stateDeclarations:x,queryStatements:k,mutationStatements:y}}function Ju(e,t){if(e[t]!=='"')return t;let r=t+1;for(;r<e.length;){let n=e[r];if(n==="\\")r+=2;else{if(n==='"')return r+1;r++}}return r}function Kh(e){let t=[],r=0;for(;r<e.length;){let n=-1;for(;r<e.length;){let i=Ju(e,r);if(i>r){r=i;continue}if(e[r]==="`"&&r+1<e.length&&e[r+1]==="`"&&r+2<e.length&&e[r+2]==="`"){n=r;break}r++}if(n===-1)break;let o=n+3;for(;o<e.length&&e[o]!==`
|
|
39
|
-
`;)o++;if(o>=e.length){t.push(e.slice(
|
|
40
|
-
`);if(e.startsWith("```")){let
|
|
41
|
-
`;)
|
|
42
|
-
`).map(
|
|
43
|
-
`)}function
|
|
44
|
-
`&&d<=0&&f<=0){let
|
|
45
|
-
`);)
|
|
25
|
+
`:e.pending=r;continue;default:e.pending.length!==0?(Ae(e),Ke(e),e.pending=n):e.text+=n;continue}case 10:switch(n){case"`":e.pending=r;continue;case`
|
|
26
|
+
`:if(r.length===e.fence_start+e.fence_end+1){Ae(e),Ke(e),e.pending="",e.fence_start=0,e.fence_end=0,e.token=101;continue}e.token=101;break;case" ":if(e.pending[0]===`
|
|
27
|
+
`){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]===" ")?(Ae(e),Ke(e),e.pending="",e.fence_start=0):e.pending=r;continue;case`
|
|
28
|
+
`:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,Ae(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,Cu,""),e.renderer.end_token(e.renderer.data),e.pending=" ";continue}e.token=e.tokens[e.len],e.pending="",Qe(e,r);continue;case 14:case 15:{let i="*",s=12;if(e.token===15&&(i="_",s=13),i===e.pending){if(Ae(e),i===n){Ke(e),e.pending="";continue}Ie(e,s),e.pending=n;continue}break}case 12:case 13:{let i="*",s=14;switch(e.token===13&&(i="_",s=15),e.pending){case i:i===n?e.tokens[e.len-1]===s?e.pending=r:(Ae(e),Ie(e,s),e.pending=""):(Ae(e),Ke(e),e.pending=n);continue;case i+i:let l=e.token;Ae(e),Ke(e),Ke(e),i!==n?(Ie(e,l),e.pending=n):e.pending="";continue}break}case 16:if(r==="~~"){Ae(e),Ke(e),e.pending="";continue}break;case 105:n===`
|
|
29
|
+
`?(Ae(e),Ie(e,30),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",Qe(e,n));continue;case 30:if(r==="\\]"||r==="$$"){Ae(e),Ke(e),e.pending="";continue}break;case 31:if(r==="\\)"||e.pending[0]==="$"){Ae(e),Ke(e),n===")"?e.pending="":e.pending=n;continue}break;case 102:r==="http://"||r==="https://"?(Ae(e),Ie(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],Qe(e,n));continue;case 17:case 19:if(e.pending==="]"){Ae(e),n==="("?e.pending=r:(Ke(e),e.pending=n);continue}if(e.pending[0]==="]"&&e.pending[1]==="("){if(n===")"){let i=e.token===17?br:ro,s=e.pending.slice(2);e.renderer.set_attr(e.renderer.data,i,s),Ke(e),e.pending=""}else e.pending+=n;continue}break;case 18:n===" "||n===`
|
|
30
|
+
`||n==="\\"?(e.renderer.set_attr(e.renderer.data,br,e.pending),Ae(e),Ke(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===">"){Ae(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),Qe(e,n);continue}switch(e.pending[0]){case"\\":if(e.token===19||e.token===30||e.token===31)break;switch(n){case"(":Ae(e),Ie(e,31),e.pending="";continue;case"[":e.token=105,e.pending=r;continue;case`
|
|
31
|
+
`:e.pending=n;continue;default:let o=n.charCodeAt(0);e.pending="",e.text+=js(o)||o>=65&&o<=90||o>=97&&o<=122?r:n;continue}case`
|
|
32
|
+
`:switch(e.token){case 19:case 30:case 31:break;case 3:case 4:case 5:case 6:case 7:case 8:Ae(e),qn(e,e.blockquote_idx),e.blockquote_idx=0,e.pending=n;continue;default:Ae(e),e.pending=n,e.token=21,e.blockquote_idx=0;continue}break;case"<":if(e.token!==19&&e.token!==30&&e.token!==31){Ae(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,Ae(e),Ie(e,11),e.text=n===" "||n===`
|
|
33
|
+
`?"":n,e.pending="");continue;case"_":case"*":{if(e.token===19||e.token===30||e.token===31||e.token===14)break;let o=12,i=14,s=e.pending[0];if(s==="_"&&(o=13,i=15),e.pending.length===1){if(s===n){e.pending=r;continue}if(n!==" "&&n!==`
|
|
34
|
+
`){Ae(e),Ie(e,o),e.pending=n;continue}}else{if(s===n){Ae(e),Ie(e,i),Ie(e,o),e.pending="";continue}if(n!==" "&&n!==`
|
|
35
|
+
`){Ae(e),Ie(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!==`
|
|
36
|
+
`){Ae(e),Ie(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(Iv(n.charCodeAt(0)))break;Ae(e),Ie(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){Ae(e),Ie(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){Ae(e),Ie(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}Ae(e)}function Mi(e){return{add_token:Ev,end_token:Vs,add_text:Ws,set_attr:Gs,data:{nodes:[e,,,,,],index:0}}}function Ev(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 o=r=document.createElement("input");o.type="checkbox",o.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 Vs(e){e.index-=1}function Ws(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function Gs(e,t,n){e.nodes[e.index].setAttribute(kv(t),n)}function $t({amount:e,currency:t},n){let r=new Intl.NumberFormat("en",{style:"currency",currency:t}).resolvedOptions().maximumFractionDigits??2;return new Intl.NumberFormat(n,{style:"currency",currency:t}).format(e/10**r)}function Qs(e,t){let n=new Date(e);return!/^\d{4}-\d{2}-\d{2}/.test(e)||Number.isNaN(n.getTime())?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeZone:e.length===10?"UTC":void 0}).format(n)}function Pr(e,t){let n=Mv(e);return n?new Intl.DateTimeFormat(t,{hour:"numeric",minute:"2-digit",timeZone:"UTC"}).format(n):e}function Mv(e){let t=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})/.exec(e);return t?Date.UTC(Number(t[1]),Number(t[2])-1,Number(t[3]),Number(t[4]),Number(t[5])):void 0}function ao(e,t){let[n,r]=[e,t].map(i=>/^\d{4}-\d{2}-\d{2}/.test(i??"")?Date.parse(`${i?.slice(0,10)}T00:00:00Z`):Number.NaN),o=Math.round(((r??Number.NaN)-(n??Number.NaN))/864e5);return o>0?o:void 0}function Hn(e,t){return!/^\d{4}-\d{2}-\d{2}/.test(e)||Number.isNaN(Date.parse(e.slice(0,10)))?e:new Intl.DateTimeFormat(t,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(Date.parse(e.slice(0,10)))}function jn(e,t,n){return[e,t].flatMap(r=>r?[Hn(r,n)]:[]).join(" \u2013 ")}function Lv(e,t){let n=(o,i)=>new Intl.NumberFormat(t,{style:"unit",unit:i,unitDisplay:"narrow"}).format(o),r=Math.floor(e/60);return[r>0&&n(r,"hour"),e%60>0&&n(e%60,"minute")].filter(Boolean).join(" ")}function Au(e,t,n){let r=e.stops===void 0?void 0:e.stops.length===0?t.visualDirect:`${t.visualVia} ${e.stops.join(", ")}`;return[e.duration===void 0?void 0:Lv(e.duration,n),r].filter(Boolean).join(" \xB7 ")}function Ov(e,t){return e===1?t.visualNight:t.visualNights.replace("{count}",String(e))}function Iu(e,t,n){let r=e.typeName==="Stay"?e.props.stay:void 0,o=e.typeName==="Stay"?{...e.props.stay,title:e.props.stay.name,start:e.props.stay.checkIn,end:e.props.stay.checkOut,nights:void 0,priceNote:void 0}:e.props.package,i=o.nights??ao(o.start,o.end);return{...o,stars:r?.stars,room:r?.room,when:[jn(o.start,o.end,n),i&&Ov(i,t)].filter(Boolean).join(" \xB7 "),note:r?.nightly?`${$t(r.nightly,n)} ${t.visualPerNight}`:o.priceNote,available:o.available!==!1}}function Eu({value:e,best:t}){return t===void 0||t===5?String(e):`${e}/${t}`}function bn(e){return Array.isArray(e)?e:[e]}function Mu({type:e,data:t}){let n=bn(t[0]?.value??[]).length;if(t.some(o=>bn(o.value).length!==n))return!1;if(e!=="pie")return!0;let r=t.map(o=>bn(o.value)[0]??0);return n===1&&r.every(o=>o>=0)&&r.some(o=>o>0)}var Lu=["#f59e0b","#10b981","#ef4444","#8b5cf6","#0ea5e9"];function Ou({type:e,data:t},n){let r=t.map(f=>bn(f.value)),o=Math.max(1,r[0]?.length??1),i=Math.min(0,...r.flat()),s=Math.max(0,...r.flat()),l=s-i||1,c=272/Math.max(1,t.length),u=c*.7/o,p=Math.ceil(t.length/8),_=new Intl.NumberFormat(n,{notation:"compact",maximumFractionDigits:1});function d(f){return 148-(f-i)/l*136}return{baseline:d(0),barWidth:u,series:Array.from({length:o},(f,v)=>r.map((m,b)=>({x:24+(b+.5)*c+(e==="bar"?(v-(o-1)/2)*u:0),y:d(m[v]??0)}))),labels:t.flatMap((f,v)=>v%p===0?[{x:24+(v+.5)*c,text:f.label.length*5>c*p?`${f.label.slice(0,Math.max(1,Math.floor(c*p/5)-1))}\u2026`:f.label}]:[]),ticks:[...new Set([s,i])].map(f=>({y:d(f),text:_.format(f)})),slices:e==="pie"?Nv(r.map(f=>f[0]??0)):[]}}function Nv(e){let t=e.reduce((r,o)=>r+o,0)||1,n=-Math.PI/2;return e.map(r=>{let o=n+r/t*2*Math.PI,i=$v(n,Math.min(o,n+2*Math.PI-1e-4));return n=o,{path:i,share:r/t}})}function $v(e,t){let n=t-e>Math.PI?1:0,r=(o,i)=>`${(160+o*Math.cos(i)).toFixed(2)} ${(84+o*Math.sin(i)).toFixed(2)}`;return`M${r(64,e)}A64 64 0 ${n} 1 ${r(64,t)}L${r(40,t)}A40 40 0 ${n} 0 ${r(40,e)}Z`}function Nu(e){if(!e||e.length<2)return;let t=Math.min(...e),n=Math.max(...e)-t||1;return e.map((r,o)=>`${(o*80/(e.length-1)).toFixed(1)},${(22-(r-t)/n*20).toFixed(1)}`).join(" ")}function Ks(e){let t=/^[^\d\-−+]{0,4}([-−+]?\d[\d.,\s]*?)\s?[^\d]{0,4}$/u.exec(e.trim());if(!t?.[1])return;let n=t[1].replace(/\s/g,"").replace("\u2212","-"),r=n.match(/[.,]/g)??[],o=r.at(-1),i=new Set(r).size>1||r.length===1&&!/^[-+]?[1-9]\d{0,2}[.,]\d{3}$/.test(n)?o:void 0,s=Number(n.replace(i===","?/\./g:i==="."?/,/g:/[.,]/g,"").replace(",","."));return Number.isFinite(s)?s:void 0}function $u(e,t){return e.map((n,r)=>{let o=t.map(i=>i[r]??"").filter(i=>i.trim());return o.length>0&&o.every(i=>Ks(i)!==void 0)})}function Du(e,t,n){if(!t)return e;let r=new Intl.Collator(n,{numeric:!0}),o=t.descending?-1:1;return[...e].sort((i,s)=>{let[l,c]=[i[t.column]??"",s[t.column]??""];return o*(t.numeric?(Ks(l)??0)-(Ks(c)??0):r.compare(l,c))})}function Bu(e){let t=new Set(e.map(n=>{let r=n.typeName==="Cell"?n.props.children.length===1?n.props.children[0]:void 0:n;return r?.typeName==="Metric"?"Card":r?.typeName}));return t.size===1&&!t.has(void 0)}function Uu({scrollLeft:e,scrollWidth:t,clientWidth:n}){let r=Math.abs(e);return{start:r>1,end:r<t-n-1}}function Vn(e){return/^https:\/\//i.test(e??"")}function Ys(e,t){return(e??[]).flatMap(n=>n.url?Vn(n.url)?[{...n,url:n.url,message:void 0}]:[]:t?[{...n,url:void 0,message:n.label}]:[])}function so(e,t,n){return`${e}: ${[t,...Object.entries(n??{}).map(([r,o])=>`${r}: ${o}`)].join(", ")}`}function zu(e){return[...e.legs.map(t=>t.number??t.carrier),e.fare].filter(Boolean).join(", ")}function Fu(e,t){return t!==void 0&&t.currency===e.currency&&t.amount>e.amount}function qu(e,t){let n=e.variants??[],r=(e.options??[]).filter(c=>c.values.length).map(c=>({...c,value:t[c.name]??c.values.find(u=>u===e.selected?.[c.name])??(c.values.length===1?c.values[0]:void 0),unavailable:n.length?c.values.filter(u=>!n.some(p=>p.available!==!1&&p.options[c.name]===u)):[]})),o=r.filter(c=>c.value===void 0).map(c=>c.name),i=Object.fromEntries(r.flatMap(c=>c.value===void 0?[]:[[c.name,c.value]])),s=o.length?void 0:n.find(c=>r.every(u=>c.options[u.name]===u.value)),l=!o.length&&n.length?s!==void 0&&s.available!==!1:e.available!==!1;return{options:r,missing:o,chosen:i,available:l,price:s?.price??e.price,compareAtPrice:s?.price?s.compareAtPrice:e.compareAtPrice,image:s?.image??e.image,canBuy:!o.length&&l}}var Kt={root:"Root",schema:{$schema:"https://json-schema.org/draft/2020-12/schema",type:"object",properties:{Root:{$ref:"#/$defs/Root"},Grid:{$ref:"#/$defs/Grid"},Cell:{$ref:"#/$defs/Cell"},Carousel:{$ref:"#/$defs/Carousel"},Text:{$ref:"#/$defs/Text"},Card:{$ref:"#/$defs/Card"},Metric:{$ref:"#/$defs/Metric"},Table:{$ref:"#/$defs/Table"},Chart:{$ref:"#/$defs/Chart"},Product:{$ref:"#/$defs/Product"},Cart:{$ref:"#/$defs/Cart"},Order:{$ref:"#/$defs/Order"},Flight:{$ref:"#/$defs/Flight"},Stay:{$ref:"#/$defs/Stay"},Package:{$ref:"#/$defs/Package"},Booking:{$ref:"#/$defs/Booking"}},required:["Root","Grid","Cell","Carousel","Text","Card","Metric","Table","Chart","Product","Cart","Order","Flight","Stay","Package","Booking"],additionalProperties:!1,$defs:{Root:{type:"object",properties:{children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Grid"},{$ref:"#/$defs/Carousel"},{$ref:"#/$defs/Text"},{$ref:"#/$defs/Card"},{$ref:"#/$defs/Metric"},{$ref:"#/$defs/Table"},{$ref:"#/$defs/Chart"},{$ref:"#/$defs/Product"},{$ref:"#/$defs/Cart"},{$ref:"#/$defs/Order"},{$ref:"#/$defs/Flight"},{$ref:"#/$defs/Stay"},{$ref:"#/$defs/Package"},{$ref:"#/$defs/Booking"}]}}},required:["children"],additionalProperties:!1},Grid:{type:"object",properties:{columns:{type:"integer",enum:[1,2,3,4],default:1},children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Cell"},{$ref:"#/$defs/Text"},{$ref:"#/$defs/Card"},{$ref:"#/$defs/Metric"},{$ref:"#/$defs/Table"},{$ref:"#/$defs/Chart"},{$ref:"#/$defs/Product"},{$ref:"#/$defs/Cart"},{$ref:"#/$defs/Order"},{$ref:"#/$defs/Flight"},{$ref:"#/$defs/Stay"},{$ref:"#/$defs/Package"},{$ref:"#/$defs/Booking"}]}}},required:["columns","children"],additionalProperties:!1},Cell:{type:"object",properties:{children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Text"},{$ref:"#/$defs/Card"},{$ref:"#/$defs/Metric"},{$ref:"#/$defs/Table"},{$ref:"#/$defs/Chart"},{$ref:"#/$defs/Product"},{$ref:"#/$defs/Cart"},{$ref:"#/$defs/Order"},{$ref:"#/$defs/Flight"},{$ref:"#/$defs/Stay"},{$ref:"#/$defs/Package"},{$ref:"#/$defs/Booking"}]}},span:{type:"integer",enum:[1,2,3,4],default:1}},required:["children"],additionalProperties:!1},Carousel:{type:"object",properties:{children:{type:"array",items:{anyOf:[{$ref:"#/$defs/Card"},{$ref:"#/$defs/Product"},{$ref:"#/$defs/Flight"},{$ref:"#/$defs/Stay"},{$ref:"#/$defs/Package"}]}}},required:["children"],additionalProperties:!1},Text:{type:"object",properties:{text:{type:"string"}},required:["text"],additionalProperties:!1},Card:{type:"object",properties:{title:{type:"string"},body:{type:"string"},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}},image:{type:"string"}},required:["title","body"],additionalProperties:!1},Metric:{type:"object",properties:{label:{type:"string"},value:{type:"string"},detail:{type:"string"},change:{type:"object",properties:{text:{type:"string"},tone:{type:"string",enum:["good","bad","neutral"]}},required:["text","tone"]},trend:{type:"array",items:{type:"number"}}},required:["label","value"],additionalProperties:!1},Table:{type:"object",properties:{title:{type:"string"},columns:{type:"array",items:{type:"string"}},rows:{type:"array",items:{type:"array",items:{type:"string"}}}},required:["title","columns","rows"],additionalProperties:!1},Chart:{type:"object",properties:{title:{type:"string"},type:{type:"string",enum:["bar","line","pie"]},data:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{anyOf:[{type:"number"},{type:"array",items:{type:"number"}}]}},required:["label","value"],additionalProperties:!1}},series:{type:"array",items:{type:"string"}}},required:["title","type","data"],additionalProperties:!1},Product:{type:"object",properties:{product:{type:"object",properties:{title:{type:"string"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},id:{type:"string"},compareAtPrice:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},image:{type:"string"},url:{type:"string"},description:{type:"string"},badge:{type:"string"},rating:{type:"object",properties:{value:{type:"number"},count:{type:"integer"},best:{type:"number"}},required:["value"]},available:{type:"boolean"},options:{type:"array",items:{type:"object",properties:{name:{type:"string"},values:{type:"array",items:{type:"string"}}},required:["name","values"]}},variants:{type:"array",items:{type:"object",properties:{options:{type:"object",additionalProperties:{type:"string"}},id:{type:"string"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},compareAtPrice:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},image:{type:"string"},available:{type:"boolean"}},required:["options"]}},selected:{type:"object",additionalProperties:{type:"string"}},details:{type:"array",items:{type:"string"}}},required:["title","price"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["product"],additionalProperties:!1},Cart:{type:"object",properties:{cart:{type:"object",properties:{lines:{type:"array",items:{type:"object",properties:{title:{type:"string"},quantity:{type:"integer"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},image:{type:"string"},url:{type:"string"},options:{type:"object",additionalProperties:{type:"string"}},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["title","quantity","price"]}},totals:{type:"array",items:{type:"object",properties:{label:{type:"string"},amount:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]}},required:["label","amount"]}},messages:{type:"array",items:{type:"object",properties:{text:{type:"string"},severity:{type:"string",enum:["info","warning","error"]}},required:["text","severity"]}}},required:["lines","totals"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["cart"],additionalProperties:!1},Order:{type:"object",properties:{order:{type:"object",properties:{number:{type:"string"},status:{type:"string"},date:{type:"string"},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},quantity:{type:"integer"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},image:{type:"string"},url:{type:"string"},options:{type:"object",additionalProperties:{type:"string"}},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["title","quantity","price"]}},totals:{type:"array",items:{type:"object",properties:{label:{type:"string"},amount:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]}},required:["label","amount"]}},timeline:{type:"array",items:{type:"object",properties:{label:{type:"string"},done:{type:"boolean"},date:{type:"string"}},required:["label","done"]}},details:{type:"array",items:{type:"string"}}},required:["number","status","items","totals"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["order"],additionalProperties:!1},Flight:{type:"object",properties:{flight:{type:"object",properties:{legs:{type:"array",items:{type:"object",properties:{from:{type:"string"},to:{type:"string"},departs:{type:"string"},arrives:{type:"string"},carrier:{type:"string"},number:{type:"string"},duration:{type:"integer"},stops:{type:"array",items:{type:"string"}}},required:["from","to","departs","arrives","carrier"]},minItems:1},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},id:{type:"string"},priceNote:{type:"string"},fare:{type:"string"},badge:{type:"string"},details:{type:"array",items:{type:"string"}},available:{type:"boolean"}},required:["legs","price"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["flight"],additionalProperties:!1},Stay:{type:"object",properties:{stay:{type:"object",properties:{name:{type:"string"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},id:{type:"string"},image:{type:"string"},url:{type:"string"},location:{type:"string"},stars:{type:"integer"},rating:{type:"object",properties:{value:{type:"number"},count:{type:"integer"},best:{type:"number"}},required:["value"]},checkIn:{type:"string"},checkOut:{type:"string"},room:{type:"string"},nightly:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},compareAtPrice:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},badge:{type:"string"},details:{type:"array",items:{type:"string"}},available:{type:"boolean"}},required:["name","price"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["stay"],additionalProperties:!1},Package:{type:"object",properties:{package:{type:"object",properties:{title:{type:"string"},price:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},id:{type:"string"},image:{type:"string"},url:{type:"string"},location:{type:"string"},start:{type:"string"},end:{type:"string"},nights:{type:"integer"},priceNote:{type:"string"},compareAtPrice:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]},rating:{type:"object",properties:{value:{type:"number"},count:{type:"integer"},best:{type:"number"}},required:["value"]},badge:{type:"string"},details:{type:"array",items:{type:"string"}},available:{type:"boolean"}},required:["title","price"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["package"],additionalProperties:!1},Booking:{type:"object",properties:{booking:{type:"object",properties:{reference:{type:"string"},status:{type:"string"},title:{type:"string"},start:{type:"string"},end:{type:"string"},travellers:{type:"array",items:{type:"string"}},itinerary:{type:"array",items:{type:"object",properties:{title:{type:"string"},date:{type:"string"},time:{type:"string"},detail:{type:"string"}},required:["title"]}},totals:{type:"array",items:{type:"object",properties:{label:{type:"string"},amount:{type:"object",properties:{amount:{type:"integer"},currency:{type:"string",pattern:"^[A-Za-z]{3}$"}},required:["amount","currency"]}},required:["label","amount"]}},details:{type:"array",items:{type:"string"}}},required:["reference","status"]},actions:{type:"array",items:{type:"object",properties:{label:{type:"string"},url:{type:"string"},primary:{type:"boolean"}},required:["label"]}}},required:["booking"],additionalProperties:!1}}}};function Hu(e){switch(e.k){case"StateRef":case"RuntimeRef":case"BinOp":case"UnaryOp":case"Ternary":case"Member":case"Index":case"Assign":return!0;default:return!1}}var Dv=new Set(["Comp","Ref","StateRef","RuntimeRef","BinOp","UnaryOp","Ternary","Member","Index","Assign","Str","Num","Bool","Null","Arr","Obj","Ph"]);function Wn(e){return!e||typeof e!="object"||Array.isArray(e)?!1:Dv.has(e.k)}function lo(e,t){let n=r=>{switch(t(r),r.k){case"Comp":r.args.forEach(n),Object.values(r.mappedProps??{}).forEach(n);break;case"Arr":r.els.forEach(n);break;case"Obj":r.entries.forEach(([,o])=>n(o));break;case"BinOp":n(r.left),n(r.right);break;case"UnaryOp":n(r.operand);break;case"Ternary":n(r.cond),n(r.then),n(r.else);break;case"Member":n(r.obj);break;case"Index":n(r.obj),n(r.index);break;case"Assign":n(r.value);break}};n(e)}function Li(e){return e==null?{k:"Null"}:typeof e=="string"?{k:"Str",v:e}:typeof e=="number"?{k:"Num",v:e}:typeof e=="boolean"?{k:"Bool",v:e}:Array.isArray(e)?{k:"Arr",els:e.map(Li)}:typeof e=="object"?{k:"Obj",entries:Object.entries(e).map(([t,n])=>[t,Li(n)])}:{k:"Null"}}function Oi(e){switch(e.k){case"Str":case"Num":case"Bool":return{v:e.v};case"Null":return{v:null};case"Arr":{let t=[];for(let n of e.els){let r=Oi(n);if(!r)return;t.push(r.v)}return{v:t}}case"Obj":{let t={};for(let[n,r]of e.entries){let o=Oi(r);if(!o)return;t[n]=o.v}return{v:t}}default:return}}var Ni=new Map([["Count",{kind:"function",params:[{name:"array",required:!1}],builtin:!0}],["First",{kind:"function",params:[{name:"array",required:!1}],builtin:!0}],["Last",{kind:"function",params:[{name:"array",required:!1}],builtin:!0}],["Sum",{kind:"function",params:[{name:"numbers",required:!1}],builtin:!0}],["Avg",{kind:"function",params:[{name:"numbers",required:!1}],builtin:!0}],["Min",{kind:"function",params:[{name:"numbers",required:!1}],builtin:!0}],["Max",{kind:"function",params:[{name:"numbers",required:!1}],builtin:!0}],["Sort",{kind:"function",params:[{name:"array",required:!1},{name:"field",required:!1},{name:"direction",required:!1}],builtin:!0}],["Filter",{kind:"function",params:[{name:"array",required:!1},{name:"field",required:!1},{name:"operator",required:!1},{name:"value",required:!1}],builtin:!0}],["Round",{kind:"function",params:[{name:"number",required:!1},{name:"decimals",required:!1}],builtin:!0}],["Abs",{kind:"function",params:[{name:"number",required:!1}],builtin:!0}],["Floor",{kind:"function",params:[{name:"number",required:!1}],builtin:!0}],["Ceil",{kind:"function",params:[{name:"number",required:!1}],builtin:!0}],["Each",{kind:"function",params:[{name:"array",required:!1},{name:"varName",required:!1},{name:"template",required:!1}],builtin:!0,lazy:!0}],["Run",{kind:"action",params:[{name:"ref",required:!1}],builtin:!0,lazy:!0}],["ToAssistant",{kind:"action",params:[{name:"message",required:!1},{name:"context",required:!1}],builtin:!0}],["OpenUrl",{kind:"action",params:[{name:"url",required:!1}],builtin:!0}],["Set",{kind:"action",params:[{name:"variable",required:!1},{name:"value",required:!1}],builtin:!0,lazy:!0}],["Reset",{kind:"action",params:[{name:"variable",required:!1}],builtin:!0,lazy:!0}],["Action",{kind:"action",params:[{name:"steps",required:!0}],builtin:!0,lazy:!0}]]),ju={ActionExpression:!0,OpenUrl:!0,ToAssistant:!0},yn={Query:"Query",Mutation:"Mutation"};function co(e){return e?.callDefs??Ni}function uo(e){return Ni.has(e)}function xr(e){return e in yn}var T;(function(e){e[e.Newline=0]="Newline",e[e.LParen=1]="LParen",e[e.RParen=2]="RParen",e[e.LBrack=3]="LBrack",e[e.RBrack=4]="RBrack",e[e.LBrace=5]="LBrace",e[e.RBrace=6]="RBrace",e[e.Comma=7]="Comma",e[e.Colon=8]="Colon",e[e.Equals=9]="Equals",e[e.True=10]="True",e[e.False=11]="False",e[e.Null=12]="Null",e[e.EOF=13]="EOF",e[e.Str=14]="Str",e[e.Num=15]="Num",e[e.Ident=16]="Ident",e[e.Type=17]="Type",e[e.StateVar=18]="StateVar",e[e.Dot=19]="Dot",e[e.Plus=20]="Plus",e[e.Minus=21]="Minus",e[e.Star=22]="Star",e[e.Slash=23]="Slash",e[e.Percent=24]="Percent",e[e.EqEq=25]="EqEq",e[e.NotEq=26]="NotEq",e[e.Greater=27]="Greater",e[e.Less=28]="Less",e[e.GreaterEq=29]="GreaterEq",e[e.LessEq=30]="LessEq",e[e.And=31]="And",e[e.Or=32]="Or",e[e.Not=33]="Not",e[e.Question=34]="Question",e[e.BuiltinCall=35]="BuiltinCall"})(T||(T={}));var Bv=1,Vu=2,Wu=3,Js=4,po=5,Xs=6,$i=7,Gu=8,Uv=9;function Di(e){let t=0,n=()=>e[t]??{t:T.EOF},r=()=>{let d=n();return t++,d},o=d=>{n().t===d&&t++};function i(d){switch(d.t){case T.Question:return Bv;case T.Or:return Vu;case T.And:return Wu;case T.EqEq:case T.NotEq:return Js;case T.Greater:case T.Less:case T.GreaterEq:case T.LessEq:return po;case T.Plus:case T.Minus:return Xs;case T.Star:case T.Slash:case T.Percent:return $i;case T.Dot:case T.LBrack:return Uv;default:return 0}}function s(d=0){let f=l();for(;i(n())>d;)f=c(f);return f}function l(){let d=n();if(d.t===T.Str)return r(),{k:"Str",v:d.v};if(d.t===T.Num)return r(),{k:"Num",v:d.v};if(d.t===T.True)return r(),{k:"Bool",v:!0};if(d.t===T.False)return r(),{k:"Bool",v:!1};if(d.t===T.Null)return r(),{k:"Null"};if(d.t===T.LBrack)return p();if(d.t===T.LBrace)return _();if(d.t===T.StateVar){let f=d.v;if(r(),n().t===T.Equals){r();let v=s(0);return{k:"Assign",target:f,value:v}}return{k:"StateRef",n:f}}if(d.t===T.Type){let f=d.v;return e[t+1]?.t===T.LParen&&(!uo(f)||f==="Action")?u():(r(),{k:"Ref",n:f})}if(d.t===T.BuiltinCall){if(e[t+1]?.t===T.LParen){let f=u();return f.k==="Comp"&&!uo(f.name)&&(f.fn=!0),f}return r(),{k:"Ref",n:d.v}}if(d.t===T.Ident)return r(),{k:"Ref",n:d.v};if(d.t===T.Not)return r(),{k:"UnaryOp",op:"!",operand:s(Gu)};if(d.t===T.Minus)return r(),{k:"UnaryOp",op:"-",operand:s(Gu)};if(d.t===T.LParen){r();let f=s(0);return o(T.RParen),f}return r(),{k:"Null"}}function c(d){let f=n();if(f.t===T.Plus)return r(),{k:"BinOp",op:"+",left:d,right:s(Xs)};if(f.t===T.Minus)return r(),{k:"BinOp",op:"-",left:d,right:s(Xs)};if(f.t===T.Star)return r(),{k:"BinOp",op:"*",left:d,right:s($i)};if(f.t===T.Slash)return r(),{k:"BinOp",op:"/",left:d,right:s($i)};if(f.t===T.Percent)return r(),{k:"BinOp",op:"%",left:d,right:s($i)};if(f.t===T.EqEq)return r(),{k:"BinOp",op:"==",left:d,right:s(Js)};if(f.t===T.NotEq)return r(),{k:"BinOp",op:"!=",left:d,right:s(Js)};if(f.t===T.Greater)return r(),{k:"BinOp",op:">",left:d,right:s(po)};if(f.t===T.Less)return r(),{k:"BinOp",op:"<",left:d,right:s(po)};if(f.t===T.GreaterEq)return r(),{k:"BinOp",op:">=",left:d,right:s(po)};if(f.t===T.LessEq)return r(),{k:"BinOp",op:"<=",left:d,right:s(po)};if(f.t===T.And)return r(),{k:"BinOp",op:"&&",left:d,right:s(Wu)};if(f.t===T.Or)return r(),{k:"BinOp",op:"||",left:d,right:s(Vu)};if(f.t===T.Question){r();let v=s(0);o(T.Colon);let m=s(0);return{k:"Ternary",cond:d,then:v,else:m}}if(f.t===T.Dot){r();let v=n(),m=v.t===T.Ident||v.t===T.Type||v.t===T.Str||v.t===T.Num?(r(),String(v.v)):v.t===T.StateVar?(r(),v.v.replace(/^\$/,"")):(r(),"?");return{k:"Member",obj:d,field:m}}if(f.t===T.LBrack){r();let v=s(0);return o(T.RBrack),{k:"Index",obj:d,index:v}}return d}function u(){let d=n().v;r(),o(T.LParen);let f=[];for(;n().t!==T.RParen&&n().t!==T.EOF;)f.push(s(0)),n().t===T.Comma&&r();return o(T.RParen),{k:"Comp",name:d,args:f}}function p(){r();let d=[];for(;n().t!==T.RBrack&&n().t!==T.EOF;)d.push(s(0)),n().t===T.Comma&&r();return o(T.RBrack),{k:"Arr",els:d}}function _(){r();let d=[];for(;n().t!==T.RBrace&&n().t!==T.EOF;){let f=n(),v=f.t===T.Ident||f.t===T.Str||f.t===T.Type||f.t===T.Num?(r(),String(f.v)):f.t===T.StateVar?(r(),f.v.replace(/^\$/,"")):(r(),"?");o(T.Colon),d.push([v,s(0)]),n().t===T.Comma&&r()}return o(T.RBrace),{k:"Obj",entries:d}}return s(0)}function Bi(e){let t=[],n=0,r=e.length;for(;n<r;){for(;n<r&&(e.charAt(n)===" "||e.charAt(n)===" "||e.charAt(n)==="\r");)n++;if(n>=r)break;let o=e.charAt(n);if(o===`
|
|
37
|
+
`){t.push({t:T.Newline}),n++;continue}if(o==="("){t.push({t:T.LParen}),n++;continue}if(o===")"){t.push({t:T.RParen}),n++;continue}if(o==="["){t.push({t:T.LBrack}),n++;continue}if(o==="]"){t.push({t:T.RBrack}),n++;continue}if(o==="{"){t.push({t:T.LBrace}),n++;continue}if(o==="}"){t.push({t:T.RBrace}),n++;continue}if(o===","){t.push({t:T.Comma}),n++;continue}if(o===":"){t.push({t:T.Colon}),n++;continue}if(o==="="){n+1<r&&e.charAt(n+1)==="="?(t.push({t:T.EqEq}),n+=2):(t.push({t:T.Equals}),n++);continue}if(o==="!"){n+1<r&&e.charAt(n+1)==="="?(t.push({t:T.NotEq}),n+=2):(t.push({t:T.Not}),n++);continue}if(o===">"){n+1<r&&e.charAt(n+1)==="="?(t.push({t:T.GreaterEq}),n+=2):(t.push({t:T.Greater}),n++);continue}if(o==="<"){n+1<r&&e.charAt(n+1)==="="?(t.push({t:T.LessEq}),n+=2):(t.push({t:T.Less}),n++);continue}if(o==="&"){n+1<r&&e.charAt(n+1)==="&"?(t.push({t:T.And}),n+=2):(t.push({t:T.And}),n++);continue}if(o==="|"){n+1<r&&e.charAt(n+1)==="|"?(t.push({t:T.Or}),n+=2):(t.push({t:T.Or}),n++);continue}if(o==="."){t.push({t:T.Dot}),n++;continue}if(o==="?"){t.push({t:T.Question}),n++;continue}if(o==="+"){t.push({t:T.Plus}),n++;continue}if(o==="*"){t.push({t:T.Star}),n++;continue}if(o==="/"){t.push({t:T.Slash}),n++;continue}if(o==="%"){t.push({t:T.Percent}),n++;continue}if(o==='"'){let c=n;n++;let u=!1;for(;n<r;)if(e.charAt(n)==="\\")n+=2;else if(e.charAt(n)==='"'){n++,u=!0;break}else n++;let p=e.slice(c,n);try{let _=u?p:p+'"';t.push({t:T.Str,v:JSON.parse(_)})}catch{let _=p.replace(/^"|"$/g,"");t.push({t:T.Str,v:_})}continue}if(o==="'"){n++;let c="",u=!1;for(;n<r;)if(e.charAt(n)==="\\"){if(n++,n<r){let p=e.charAt(n);p==="'"?c+="'":p==="\\"?c+="\\":p==="n"?c+=`
|
|
38
|
+
`:p==="t"?c+=" ":c+=p,n++}}else if(e.charAt(n)==="'"){n++,u=!0;break}else c+=e.charAt(n),n++;t.push({t:T.Str,v:c});continue}if(o==="-"){let c=t.length>0?t[t.length-1]:null;if(!(!(c!=null&&(c.t===T.Num||c.t===T.Str||c.t===T.Ident||c.t===T.Type||c.t===T.RParen||c.t===T.RBrack||c.t===T.True||c.t===T.False||c.t===T.Null||c.t===T.StateVar||c.t===T.BuiltinCall))&&n+1<r&&e.charAt(n+1)>="0"&&e.charAt(n+1)<="9")){t.push({t:T.Minus}),n++;continue}}let i=o>="0"&&o<="9",s=o==="-"&&n+1<r&&e.charAt(n+1)>="0"&&e.charAt(n+1)<="9";if(i||s){let c=n;for(e.charAt(n)==="-"&&n++;n<r&&e.charAt(n)>="0"&&e.charAt(n)<="9";)n++;if(n<r&&e.charAt(n)==="."&&n+1<r&&e.charAt(n+1)>="0"&&e.charAt(n+1)<="9")for(n++;n<r&&e.charAt(n)>="0"&&e.charAt(n)<="9";)n++;if(n<r&&(e.charAt(n)==="e"||e.charAt(n)==="E"))for(n++,n<r&&(e.charAt(n)==="+"||e.charAt(n)==="-")&&n++;n<r&&e.charAt(n)>="0"&&e.charAt(n)<="9";)n++;t.push({t:T.Num,v:+e.slice(c,n)});continue}if(o==="$"&&n+1<r&&(e.charAt(n+1)>="a"&&e.charAt(n+1)<="z"||e.charAt(n+1)>="A"&&e.charAt(n+1)<="Z"||e.charAt(n+1)==="_")){let c=n;for(n++;n<r&&(e.charAt(n)>="a"&&e.charAt(n)<="z"||e.charAt(n)>="A"&&e.charAt(n)<="Z"||e.charAt(n)>="0"&&e.charAt(n)<="9"||e.charAt(n)==="_");)n++;t.push({t:T.StateVar,v:e.slice(c,n)});continue}if(o>="a"&&o<="z"||o>="A"&&o<="Z"||o==="_"){let c=n;for(;n<r&&(e.charAt(n)>="a"&&e.charAt(n)<="z"||e.charAt(n)>="A"&&e.charAt(n)<="Z"||e.charAt(n)>="0"&&e.charAt(n)<="9"||e.charAt(n)==="_");)n++;let u=e.slice(c,n);if(u==="true"){t.push({t:T.True});continue}if(u==="false"){t.push({t:T.False});continue}if(u==="null"){t.push({t:T.Null});continue}let p=o>="A"&&o<="Z"?T.Type:T.Ident;t.push({t:p,v:u});continue}if(o==="@"&&n+1<r&&(e.charAt(n+1)>="a"&&e.charAt(n+1)<="z"||e.charAt(n+1)>="A"&&e.charAt(n+1)<="Z"||e.charAt(n+1)==="_")){n++;let c=n;for(;n<r&&(e.charAt(n)>="a"&&e.charAt(n)<="z"||e.charAt(n)>="A"&&e.charAt(n)<="Z"||e.charAt(n)>="0"&&e.charAt(n)<="9"||e.charAt(n)==="_");)n++;t.push({t:T.BuiltinCall,v:e.slice(c,n)});continue}n++}return t.push({t:T.EOF}),t}function jt(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.type==="element"&&typeof t.typeName=="string"&&typeof t.props=="object"&&t.props!==null&&typeof t.partial=="boolean"}var Ku;(function(e){e.ContinueConversation="continue_conversation",e.OpenUrl="open_url"})(Ku||(Ku={}));var zv={},Fv=[];function Ui(e){return Array.isArray(e)?"array":typeof e}function Qu(e){return typeof e.$ref=="string"?e.$ref.split("/").pop():void 0}function Yu(e){return"$ref"in e||"anyOf"in e||"oneOf"in e||"allOf"in e}function Ju(e){if(Array.isArray(e.enum))return{enumValues:e.enum};if("const"in e)return{enumValues:[e.const]};switch(e.type){case"string":return{expectedType:"string"};case"number":case"integer":return{expectedType:"number"};case"boolean":return{expectedType:"boolean"};default:return{}}}function zi(e){if(!(!e||typeof e!="object"||Array.isArray(e)))return e.default}function Zs(e){if(!e||typeof e!="object"||Array.isArray(e))return;let t=e,n=Qu(t);if(n)return n;let r=Ju(t);return r.enumValues?r.enumValues.map(o=>JSON.stringify(o)).join("|"):r.expectedType?r.expectedType:typeof t.type=="string"?t.type:void 0}function el(e,t){let n=t.map(r=>{let o=Zs(r.schema),i=r.required?`${r.name}*`:r.name;return o?`${i}: ${o}`:i}).join(", ");return`${e}(${n})`}function qv(e,t){let n=typeof e;return t.enumValues?t.enumValues.includes(e)?null:{expected:`one of [${t.enumValues.map(r=>JSON.stringify(r)).join(", ")}]`,actual:Ui(e)}:t.expectedType&&t.expectedType!==n?{expected:t.expectedType,actual:Ui(e)}:null}function Hv(e,t,n){switch(n.code){case"type-mismatch":return`field "${t}" expects ${n.expected} but got ${n.actual}`;case"pruned-value":return`field "${t}" lost an unresolved or invalid value`;case"missing-required":return`missing required field "${t}"${n.signature?` \u2014 signature: ${n.signature}`:""}`;case"null-required":return`required field "${t}" cannot be null${n.signature?` \u2014 signature: ${n.signature}`:""}`;case"unknown-component":return`Unknown component "${e}" \u2014 not found in catalog or builtins${n.available?.length?`. Available components: ${n.available.join(", ")}`:""}`;case"inline-reserved":return`${e}() must be declared as a top-level statement, not used inline as a value`;case"excess-args":return`${e} takes ${n.declared} arg(s), got ${n.got} (${n.got-n.declared} excess dropped)`;case"unknown-function":return`Unknown function "@${e}": not a built-in or action step. The call evaluates to null`;case"no-root":return n.reason==="not-component"?"root does not evaluate to a component":n.reason==="fallback"?`No root statement. Rendering the first statement that calls the root component ${e}`:e?`No root statement, and no statement calls the root component ${e}`:"No root statement"}}function Ve(e,t,n,r){e.errors.push({code:r.code,component:t,path:n,message:Hv(t,n,r),statementId:e.currentStatementId,...r.code==="no-root"&&r.reason==="fallback"&&{severity:"warning"}})}var xt=Symbol("invalid");function Fi(e,t){return t!==void 0?t:e?xt:void 0}function jv(e,t,n,r,o){return Yu(t)?!1:typeof t.type=="string"||Array.isArray(t.enum)||"const"in t?(Ve(o,n,r,{code:"type-mismatch",expected:typeof t.type=="string"?t.type:"a literal value",actual:`component "${e.typeName}"`}),!0):!1}function Xu(e){return(e.anyOf??e.oneOf??[e]).map(Qu)}function Vv(e,t){let n=Xu(e);return n.length>0&&n.every(r=>r!==void 0&&t.cat?.has(r))}function Wv(e,t,n,r,o){if(typeof e!="object"||Array.isArray(e))return Ve(o,n,r,{code:"type-mismatch",expected:"object",actual:Ui(e)}),xt;let i=e,s,l=t.properties&&typeof t.properties=="object"?t.properties:zv,c=Array.isArray(t.required)?t.required:Fv,u=!1;if(!o.partial)for(let p of c){let _=p in i;if(!_||i[p]==null){let d=zi(l[p]);if(d!==void 0){(s??(s={...i}))[p]=d;continue}Ve(o,n,`${r}/${p}`,{code:_?"null-required":"missing-required"}),u=!0}}for(let p of Object.keys(l)){if(!(p in i))continue;let _=l[p],d=_o(i[p],_,n,`${r}/${p}`,o);if(d===xt&&(d=Fi(c.includes(p),zi(_)),d===xt)){u=!0;continue}d!==i[p]&&(s??(s={...i}),d===void 0?delete s[p]:s[p]=d)}return u?xt:s??i}function Gv(e,t,n,r,o){if(!Array.isArray(e))return Ve(o,n,r,{code:"type-mismatch",expected:"array",actual:Ui(e)}),xt;let i=t.items;if(!i||typeof i!="object"||Array.isArray(i))return e;let s;for(let l=0;l<e.length;l++){let c=_o(e[l],i,n,`${r}/${l}`,o);c!==e[l]&&!s&&(s=e.slice(0,l)),s&&c!==xt&&s.push(c)}return s??e}function Kv(e,t,n,r,o){let i=Ju(t);if(i.expectedType==null&&i.enumValues==null||i.enumValues&&o.partial)return!1;let s=qv(e,i);return s?(Ve(o,n,r,{code:"type-mismatch",...s}),!0):!1}function _o(e,t,n,r,o){if(!t||typeof t!="object"||Array.isArray(t))return e;let i=t;if(e==null||Wn(e))return e;if(jt(e))return jv(e,i,n,r,o)?xt:e;if(Yu(i))return Vv(i,o)?(Ve(o,n,r,{code:"type-mismatch",expected:Xu(i).join(" | "),actual:Array.isArray(e)?"array":typeof e=="object"?"plain object":typeof e}),xt):e;let s=i.type;return s==="object"?Wv(e,i,n,r,o):s==="array"?Gv(e,i,n,r,o):Kv(e,i,n,r,o)?xt:e}function qi(e){if(e==null||typeof e!="object")return!1;if(Wn(e))return!0;if(Array.isArray(e))return e.some(qi);if(jt(e))return Object.values(e.props).some(qi);let t=e;return Array.isArray(t.steps)?!0:Object.values(t).some(qi)}function Zu(e,t,n){if(t.visited.has(e))return t.unres.push(e),n==="expr"?{k:"Ph",n:e}:null;let r=t.syms.get(e);if(!r)return t.unres.push(e),n==="expr"?{k:"Ph",n:e}:null;if(t.unreached?.delete(e),r.k==="Comp"&&xr(r.name)){let i=r.name===yn.Mutation?"mutation":"query";return{k:"RuntimeRef",n:e,refType:i}}t.visited.add(e);let o=t.currentStatementId;t.currentStatementId=e;try{let i=n==="value"?Gn(r,t):tl(r,t);return n==="value"&&jt(i)&&(i.statementId=e),i}finally{t.currentStatementId=o,t.visited.delete(e)}}function Hi(e,t){return co(t.cat).has(e)||xr(e)}function nl(e,t){let n={};for(let[r,o]of t.entries()){let i=e[r];if(i===void 0)break;n[o.name]=i}return n}function ep(e,t,n,r){let{params:o}=n;t.length>o.length&&Ve(r,e,"",{code:"excess-args",declared:o.length,got:t.length});let i=nl(t,o),s=!1,l=r.errors.length;for(let c of o){let u=i[c.name],p=u?Oi(u):{v:void 0};if(!p)continue;if(p.v==null){if(!c.required||c.defaultValue!==void 0)continue;Ve(r,e,`/${c.name}`,{code:u?"null-required":"missing-required",signature:el(e,o)}),s=!0;continue}let _=_o(p.v,c.schema,e,`/${c.name}`,r);_===xt&&(_=Fi(c.required,c.defaultValue)),_===xt?s=!0:_===void 0?delete i[c.name]:_!==p.v&&(i[c.name]=Li(_))}return n.kind==="action"&&r.errors.length>l&&(s=!0),s?null:i}function tp(e,t,n){let r=e.args.map(n),o=co(t.cat).get(e.name);if(!o||o.lazy)return{...e,args:r};let i=o.builtin?nl(r,o.params):ep(e.name,r,o,t);return i?{...e,args:r,mappedProps:i}:o.kind==="action"?{k:"Comp",name:"Action",args:[{k:"Arr",els:[]}]}:{k:"Null"}}function rl(e,t,n){let r=t.currentStatementId;t.currentStatementId=n;let o=new Set;for(let i of e)lo(i,s=>{if(s.k!=="Comp"||o.has(s))return;o.add(s);let l=co(t.cat).get(s.name);if(!l||l.lazy)return;let c=l.builtin?null:ep(s.name,s.args,l,t);s.mappedProps=c??nl(s.args,l.params)});t.currentStatementId=r}function np(e,t,n){let r=co(t.cat).get(e.name);if(r?.kind!=="function"||!r.lazy||e.args.length<3)return null;let o=e.args[1];if(!o)return null;let i=o.k==="Ref"?o.n:o.k==="Str"?o.v:null;if(!i)return null;let s=new Set(n);s.add(i);let l=e.args.map((c,u)=>u===1?c:St(c,t,s));return{...e,args:l}}function St(e,t,n){switch(e.k){case"Ref":return n.has(e.n)?e:Zu(e.n,t,"expr");case"Ph":return e;case"Comp":{if(e.fn&&!Hi(e.name,t))return Ve(t,e.name,"",{code:"unknown-function"}),{k:"Null"};let r=np(e,t,n);if(r)return r;if(Hi(e.name,t))return tp(e,t,s=>St(s,t,n));let o=e.args.map(s=>St(s,t,n)),i=t.cat?.get(e.name);if(i){let s={};for(let[l,c]of i.params.entries()){let u=o[l];u&&(s[c.name]=u)}return{...e,args:o,mappedProps:s}}return Ve(t,e.name,"",{code:"unknown-component",available:t.cat&&[...t.cat.keys()]}),{...e,args:o}}case"Arr":return{...e,els:e.els.map(r=>St(r,t,n))};case"Obj":return{...e,entries:e.entries.map(([r,o])=>[r,St(o,t,n)])};case"BinOp":return{...e,left:St(e.left,t,n),right:St(e.right,t,n)};case"UnaryOp":return{...e,operand:St(e.operand,t,n)};case"Ternary":return{...e,cond:St(e.cond,t,n),then:St(e.then,t,n),else:St(e.else,t,n)};case"Member":return{...e,obj:St(e.obj,t,n)};case"Index":return{...e,obj:St(e.obj,t,n),index:St(e.index,t,n)};case"Assign":return{...e,value:St(e.value,t,n)};default:return e}}function tl(e,t){return St(e,t,new Set)}function Gn(e,t){switch(e.k){case"Ref":return Zu(e.n,t,"value");case"Str":return e.v;case"Num":return e.v;case"Bool":return e.v;case"Null":return null;case"Ph":return null;case"Arr":{let n=[];for(let r of e.els){if(r.k==="Ph"){t.prunedValues++;continue}let o=Gn(r,t);if(o===null&&(r.k==="Comp"||r.k==="Ref")){t.prunedValues++;continue}n.push(o)}return n}case"Obj":{let n={};for(let[r,o]of e.entries)n[r]=Gn(o,t);return n}case"Comp":{let{name:n,args:r}=e;if(e.fn&&!Hi(n,t))return Ve(t,n,"",{code:"unknown-function"}),null;if(xr(n))return Ve(t,n,"",{code:"inline-reserved"}),null;if(Hi(n,t)){let l=np(e,t,new Set);return l||tp(e,t,c=>tl(c,t))}let o=t.cat?.get(n),i={};if(o){let l=!1;for(let[u,p]of o.params.entries()){let _=r[u];if(!_)break;let d=t.prunedValues,f=Gn(_,t);if(t.prunedValues>d&&Ve(t,n,`/${p.name}`,{code:"pruned-value"}),i[p.name]=f,p.schema===void 0)continue;if(f==null&&p.defaultValue!==void 0){Ve(t,n,`/${p.name}`,{code:"type-mismatch",expected:Zs(p.schema)??"a defined value",actual:f===null?"null":"undefined"}),i[p.name]=p.defaultValue,t.prunedValues=d;continue}let v=_o(f,p.schema,n,`/${p.name}`,t);v===xt&&(v=Fi(p.required,p.defaultValue),p.defaultValue!==void 0&&(t.prunedValues=d),v===xt?l=!0:v===void 0&&delete i[p.name]),v!==xt&&v!==void 0&&(i[p.name]=v)}r.length>o.params.length&&Ve(t,n,"",{code:"excess-args",declared:o.params.length,got:r.length});let c=o.params.filter(u=>u.required&&(!(u.name in i)||i[u.name]===null));if(c.length){let u=c.filter(p=>p.defaultValue!==void 0?(Ve(t,n,`/${p.name}`,{code:p.name in i?"null-required":"missing-required"}),i[p.name]=p.defaultValue,!1):!0);if(u.length){for(let p of u)Ve(t,n,`/${p.name}`,{code:p.name in i?"null-required":"missing-required",signature:el(n,o.params)});return null}}if(l)return null}else return Ve(t,n,"",{code:"unknown-component",available:t.cat&&[...t.cat.keys()]}),null;let s=Object.values(i).some(l=>qi(l));return{type:"element",typeName:n,props:i,partial:t.partial,hasDynamicProps:s}}default:return Hu(e)?tl(e,t):e}}function ol(e){let t=[],n=!1,r=!1;for(let s=0;s<e.length;s++){let l=e[s];if(r){r=!1;continue}if(l==="\\"&&n){r=!0;continue}if(n){l===n&&(n=!1);continue}if(l==='"'||l==="'"){n=l;continue}l==="("||l==="["||l==="{"?t.push(l):(l===")"&&t[t.length-1]==="("||l==="]"&&t[t.length-1]==="["||l==="}"&&t[t.length-1]==="{")&&t.pop()}if(!(!!n||t.length>0))return{text:e,wasIncomplete:!1};let i=e;n&&(r&&(i+="\\"),i+=n);for(let s=t.length-1;s>=0;s--)i+=t[s]==="("?")":t[s]==="["?"]":"}";return{text:i,wasIncomplete:!0}}function ji(e){let t=[],n=0;for(;n<e.length;){for(;n<e.length&&e[n]?.t===T.Newline;)n++;if(n>=e.length||e[n]?.t===T.EOF)break;let r=e[n];if(!r)break;if(r.t!==T.Ident&&r.t!==T.Type&&r.t!==T.StateVar){for(;n<e.length&&e[n]?.t!==T.Newline&&e[n]?.t!==T.EOF;)n++;continue}let o=r.v,i=r.t;if(n++,n>=e.length||e[n]?.t!==T.Equals){for(;n<e.length&&e[n]?.t!==T.Newline&&e[n]?.t!==T.EOF;)n++;continue}n++;let s=[],l=0,c=0;for(;n<e.length&&e[n]?.t!==T.EOF;){let u=e[n]?.t;if(u===T.Newline&&l<=0&&c<=0){let _=n+1;for(;_<e.length&&e[_]?.t===T.Newline;)_++;let d=_<e.length?e[_]?.t:T.EOF;if(d===T.Question||d===T.Colon&&c>0){n++;continue}break}if(u===T.Newline){n++;continue}u===T.LParen||u===T.LBrack||u===T.LBrace?l++:(u===T.RParen||u===T.RBrack||u===T.RBrace)&&l>0?l--:u===T.Question&&l===0?c++:u===T.Colon&&l===0&&c>0&&c--;let p=e[n++];p&&s.push(p)}s.length&&t.push({id:o,idTokenType:i,tokens:s})}return t}function Wi(e=!0){return{root:null,meta:{incomplete:e,unresolved:[],orphaned:[],statementCount:0,errors:[]},stateDeclarations:{},queryStatements:[],mutationStatements:[]}}function ip(e){if(!Wn(e))return[];let t=new Set;return lo(e,n=>{n.k==="StateRef"&&t.add(n.n)}),[...t]}function al(e,t){if(t.k==="Comp"&&t.name===yn.Query){let n=ip(t.args[1]);return{kind:"query",id:e.id,call:{callee:yn.Query,args:t.args},expr:t,deps:n.length>0?n:void 0}}return t.k==="Comp"&&t.name===yn.Mutation?{kind:"mutation",id:e.id,call:{callee:yn.Mutation,args:t.args},expr:t}:e.idTokenType===T.StateVar?{kind:"state",id:e.id,init:t}:{kind:"value",id:e.id,expr:t}}function Qv(e,t,n){let r={},o=[],i=[];for(let s of e)switch(s.kind){case"state":r[s.id]=Gn(s.init,t);break;case"query":rl(s.call.args,t,s.id),o.push({statementId:s.id,toolAST:s.call.args[0]??null,argsAST:s.call.args[1]??null,defaultsAST:s.call.args[2]??null,refreshAST:s.call.args[3]??null,deps:s.deps,complete:!0});break;case"mutation":rl(s.call.args,t,s.id),i.push({statementId:s.id,toolAST:s.call.args[0]??null,argsAST:s.call.args[1]??null});break}for(let s of e){let l=s.kind==="state"?[s.init]:s.kind==="value"?[s.expr]:s.kind==="query"||s.kind==="mutation"?s.call.args:[];for(let c of l)for(let u of ip(c))u===n?.name&&n.stmts.has(s)||u in r||(r[u]=null)}return{stateDeclarations:r,queryStatements:o,mutationStatements:i}}var rp="root";function ll(e){return e?.k==="Comp"&&!e.fn&&!uo(e.name)&&!xr(e.name)}function Yv(e,t){if(e.has(rp))return{id:rp,fallback:!1};for(let n of e.values())if(n.kind==="value"&&ll(n.expr)&&n.expr.name===t)return{id:n.id,fallback:!0};return null}function Jv(e,t){let n=new Set;for(;e?.k==="Ref"&&!n.has(e.n);)n.add(e.n),e=t.get(e.n);return ll(e)}function Xv(e){let t=!1;return lo(e,n=>{ll(n)&&(t=!0)}),t}function Vi(e,t,n,r,o,i,s){let l=Yv(e,i),c=new Map;for(let[x,g]of e)c.set(x,g.kind==="state"?g.init:g.expr);let u=[],p=[],_=new Set;for(let[x,g]of e)x!==l?.id&&(g.kind==="state"||g.kind==="query"||g.kind==="mutation"||_.add(x));let d={syms:c,cat:o,errors:p,unres:u,prunedValues:0,visited:new Set,partial:n,currentStatementId:l?.id,unreached:_},f=null,v,m=l&&c.get(l.id);if(l&&m){let x=Gn(m,d);jt(x)?(f=x,f.statementId=l.id):Wn(x)&&Xv(x)&&(v=x)}let{stateDeclarations:b,queryStatements:w,mutationStatements:y}=Qv(t,d,s);d.currentStatementId=l?.id;let P=i??"";l?!f&&!v&&!Jv(c.get(l.id),c)?Ve(d,P,"",{code:"no-root",reason:"not-component"}):l.fallback&&Ve(d,P,"",{code:"no-root",reason:f?"fallback":"missing"}):Ve(d,P,"",{code:"no-root",reason:"missing"});let C=l?[..._]:[];return{root:f,...v?{rootExpression:v}:{},meta:{incomplete:n,unresolved:u,orphaned:C,statementCount:r,errors:p},stateDeclarations:b,queryStatements:w,mutationStatements:y}}function op(e,t){if(e[t]!=='"')return t;let n=t+1;for(;n<e.length;){let r=e[n];if(r==="\\")n+=2;else{if(r==='"')return n+1;n++}}return n}function Zv(e){let t=[],n=0;for(;n<e.length;){let r=-1;for(;n<e.length;){let l=op(e,n);if(l>n){n=l;continue}if(e[n]==="`"&&n+1<e.length&&e[n+1]==="`"&&n+2<e.length&&e[n+2]==="`"){r=n;break}n++}if(r===-1)break;let o=r+3;for(;o<e.length&&e[o]!==`
|
|
39
|
+
`;)o++;if(o>=e.length){t.push(e.slice(r+3).replace(/^[^\n]*\n?/,"")),n=e.length;break}o++;let i=-1,s=o;for(;s<e.length;){let l=op(e,s);if(l>s){s=l;continue}if(e[s]==="`"&&s+1<e.length&&e[s+1]==="`"&&s+2<e.length&&e[s+2]==="`"){i=s;break}s++}i!==-1?(t.push(e.slice(o,i)),n=i+3):(t.push(e.slice(o)),n=e.length)}if(t.length>0)return t.join(`
|
|
40
|
+
`);if(e.startsWith("```")){let r=3;for(;r<e.length&&e[r]!==`
|
|
41
|
+
`;)r++;let o=r<e.length?r+1:3,i=e.slice(o),s=i.lastIndexOf("```");return s!==-1?i.slice(0,s):i}return e}function eb(e){let t=!1;return e.split(`
|
|
42
|
+
`).map(n=>{for(let r=0;r<n.length;r++){let o=n[r];if(t){if(o==="\\"&&r+1<n.length){r++;continue}o===t&&(t=!1);continue}if(o==='"'||o==="'"){t=o;continue}if(o==="/"&&n[r+1]==="/"||o==="#")return n.substring(0,r).trimEnd()}return n}).join(`
|
|
43
|
+
`)}function ap(e){return eb(Zv(e.trim())).trim()}function sp(e,t,n){let r=ap(e);if(!r)return Wi();let{text:o,wasIncomplete:i}=ol(r),s=ji(Bi(o));if(!s.length)return Wi(i);let l=new Map;for(let u of s){let p=Di(u.tokens),_=al(u,p);l.set(u.id,_)}let c=[...l.values()];return Vi(l,c,i,l.size,t,n)}function lp(e,t){let n="",r="",o=0,i=new Map,s=0;function l(d){let f=d.trim();if(f)for(let v of ji(Bi(f))){let m=Di(v.tokens),b=al(v,m);i.set(v.id,b),s++}}function c(){let d=ap(n);d.startsWith(r.slice(0,o))||(o=0,i.clear(),s=0),r=d}function u(){let d=0,f=0,v=!1,m=!1,b=o;for(let w=o;w<r.length;w++){let y=r[w];if(m){m=!1;continue}if(y==="\\"&&v){m=!0;continue}if(v){y===v&&(v=!1);continue}if(y==='"'||y==="'"){v=y;continue}if(y==="("||y==="["||y==="{")d++;else if(y===")"||y==="]"||y==="}")d=Math.max(0,d-1);else if(y==="?"&&d===0)f++;else if(y===":"&&d===0&&f>0)f--;else if(y===`
|
|
44
|
+
`&&d<=0&&f<=0){let P=w+1;for(;P<r.length&&(r[P]===" "||r[P]===" "||r[P]==="\r"||r[P]===`
|
|
45
|
+
`);)P++;if(P<r.length&&(r[P]==="?"||r[P]===":"&&f>0))continue;let C=r.slice(b,w).trim();C&&l(C),b=w+1,o=w+1}}return b}function p(d=!1){c();let f=u(),v=r.slice(f).trim(),m=d?v:v.replace(/(\d)\.$/,"$1");if(!m)return s===0?Wi():Vi(i,[...i.values()],!1,s,e,t);let{text:b,wasIncomplete:w}=ol(m),y=ji(Bi(b));if(!y.length)return s===0?Wi(w):Vi(i,[...i.values()],w,s,e,t);let P=new Map(i),C=new Set;for(let k of y){if(i.has(k.id)&&w)continue;let $=Di(k.tokens),I=al(k,$);P.set(k.id,I),C.add(I)}let x=d?void 0:/\$\w+$/.exec(n)?.[0],g=x&&m.endsWith(x)&&!new RegExp(`\\${x}(?!\\w)`).test(m.slice(0,-x.length))?x:void 0,h=[...P.values()];return Vi(P,h,w,s+y.length,e,t,g?{name:g,stmts:C}:void 0)}function _(){n="",r="",o=0,i.clear(),s=0}return{push(d,f){return n+=d,p(f)},set(d,f){(d.length<n.length||!d.startsWith(n))&&_();let v=d.slice(n.length);return v&&(n+=v),p(f)},getResult:p}}function sl(e,t){if(!e||typeof e!="object")return e;let n=e.$ref;if(typeof n=="string")return t.has(n)?sl(t.get(n),t):e;let r=Array.isArray(e)?[...e]:{...e},o=!1;for(let[i,s]of Object.entries(r))r[i]=sl(s,t),o||(o=r[i]!==s);return o?r:e}function il(e,t){let n=e.properties??{},r=e.required??[];return Object.keys(n).map(o=>({name:o,required:r.includes(o),defaultValue:zi(n[o]),schema:t.size?sl(n[o],t):n[o]}))}function cp(e){let t=new Map,n=e.properties&&new Set(Object.keys(e.properties)),r=new Map;for(let o of[...Object.keys(ju),...Object.keys(e.actions??{})]){let i=e.$defs?.[o];i&&!n?.has(o)&&r.set(`#/$defs/${o}`,i)}for(let[o,i]of Object.entries(e.$defs??{}))(n?!n.has(o):r.has(`#/$defs/${o}`))||t.set(o,{params:il(i,r)});t.callDefs=new Map(Ni);for(let[o,i]of Object.entries(e.functions??{}))t.callDefs.set(o,{kind:"function",params:il(i.params,r)});for(let[o,i]of Object.entries(e.actions??{}))t.callDefs.set(o,{kind:"action",params:il(i.params,r)});return t}var dp=Kt.schema.$defs;function up(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function fo(e,t){if(e.$ref)return cl(t)&&t.typeName===e.$ref.split("/").at(-1);if(e.anyOf)return e.anyOf.some(n=>fo(n,t));if(e.enum&&!e.enum.includes(t))return!1;switch(e.type){case"string":return typeof t=="string"&&(e.pattern===void 0||new RegExp(e.pattern,"u").test(t));case"integer":return Number.isInteger(t);case"number":return typeof t=="number"&&Number.isFinite(t);case"boolean":return typeof t=="boolean";case"array":return Array.isArray(t)&&t.length>=(e.minItems??0)&&t.every(n=>e.items===void 0||fo(e.items,n));case"object":{if(!up(t)||!(e.required??[]).every(o=>Object.hasOwn(t,o)))return!1;let{properties:n={},additionalProperties:r}=e;return Object.entries(t).every(([o,i])=>{let s=Object.hasOwn(n,o)?n[o]:void 0;return s?fo(s,i):typeof r=="object"?fo(r,i):r!==!1})}default:return!0}}function cl(e){if(!up(e)||typeof e.typeName!="string"||typeof e.statementId!="string"||e.typeName===Kt.root)return!1;let t=Object.hasOwn(dp,e.typeName)?dp[e.typeName]:void 0;return t!==void 0&&fo(t,e.props)}var _p=cp(Kt.schema),tb={parse(e){return sp(e,_p,Kt.root)}};function nb(){return lp(_p,Kt.root)}var fp=Kt.schema.$defs,rb=new Map(Object.entries(fp).map(([e,t])=>[e,new Set(t.properties?.children?.items?.anyOf?.map(n=>n.$ref?.split("/").at(-1)))])),ob=new Set(Object.entries(fp).flatMap(([e,t])=>Object.values(t.properties??{}).some(n=>n.type==="object")?[e]:[]));function mp(){let e=nb(),t=[];return function(r,o){let i=ib(e.set(r,!o),o,r);return o&&t.length>0&&(i.error||i.elements.length===0)?{...i,error:!1,elements:t}:(t=i.elements,i)}}function ib(e,t,n){let r=gp(e,t,n);return!t&&(r.error||r.diagnostics.errors.length>0||r.diagnostics.unresolved.length>0||r.diagnostics.incomplete)&&console.warn("Generative UI diagnostics",{error:r.error,partial:r.partial,diagnostics:r.diagnostics}),r}function gp(e,t,n){let r=t&&!/\n\s*$/.test(n??"")?n?.match(/^\w+(?=\s*=)/gm)?.at(-1):void 0,o=e.root?.props.children,i=new Set,s=e.meta,l=e.meta.errors.some(m=>m.severity!=="warning"&&!(m.component==="Grid"&&m.path==="/columns"||m.component==="Cell"&&m.path==="/span"));function c(m,b,w){s===e.meta&&(s={...e.meta,errors:[...e.meta.errors]}),s.errors.push({code:"type-mismatch",component:m.typeName,path:b,message:w,statementId:m.statementId}),l=!0}function u(m,b,w){if(!jt(m)||typeof m.statementId!="string"||i.has(m.statementId)){c(b,`/children/${w}`,"Child must be a valid, uniquely named component");return}if(!rb.get(b.typeName)?.has(m.typeName)){c(b,`/children/${w}`,"Component is not allowed at this nesting level");return}if(i.add(m.statementId),ob.has(m.typeName)&&m.statementId===r||(m.typeName==="Chart"||m.typeName==="Table")&&e.meta.errors.some(k=>k.statementId===m.statementId&&k.severity!=="warning"))return;let y=(m.typeName==="Grid"||m.typeName==="Cell"||m.typeName==="Carousel")&&Array.isArray(m.props.children)?m.props.children.flatMap((k,$)=>{let I=u(k,m,$);return I?[I]:[]}):void 0,P=!1;function C(k){return Object.fromEntries(Object.entries(k).flatMap(([$,I])=>I==null?[]:[[$,x(I)]]))}function x(k){return Array.isArray(k)?(k.some($=>$==null)&&(P=!0),k.flatMap($=>$==null?[]:[x($)])):typeof k=="object"&&k!==null&&!jt(k)?C(k):k}let g=C(m.props);if(P&&(m.typeName==="Chart"||m.typeName==="Table")){c(m,"","A list item is missing");return}P&&(l=!0);let h={...m,props:{...g,...y&&{children:y}}};if(!cl(h)){c(m,"","Component does not match the catalog");return}if(h.typeName==="Table"&&h.props.rows.some(k=>k.length!==h.props.columns.length)){c(m,"/rows","Every table row must contain one value per column");return}if(h.typeName==="Chart"&&!Mu(h.props)){c(m,"/data","Every chart point must contain one value per series, and a pie one value");return}if(y?.length!==0&&!((h.typeName==="Chart"||h.typeName==="Table")&&(t||e.meta.incomplete)))return h}let p=e.root,_=p&&Array.isArray(o)?o.flatMap((m,b)=>{if(jt(m)&&m.typeName==="Cell")return c(p,`/children/${b}`,"Cell must be inside a Grid"),[];let w=u(m,p,b);return w&&w.typeName!=="Cell"?[w]:[]}):[],d=p?.hasDynamicProps===!0||e.queryStatements.length>0||e.mutationStatements.length>0||Object.keys(e.stateDeclarations).length>0||e.meta.errors.some(m=>m.code==="unknown-function"||m.code==="inline-reserved");d&&p&&c(p,"","Executable content is not supported by the static catalog"),p&&p.typeName!==Kt.root&&c(p,"","The block must use the catalog root component");let f=d||p!==null&&p.typeName!==Kt.root||!t&&(!Array.isArray(o)||_.length===0),v=!t&&!f&&(l||e.meta.incomplete);return{elements:f?[]:_,error:f,partial:v,diagnostics:s}}function hp(e,t){return gp(tb.parse(e),!1).elements.flatMap(r=>vp(r,t)).join(`
|
|
46
46
|
|
|
47
|
-
`)}function
|
|
48
|
-
${e.props.body}`];case"Metric":return[[e.props.label,e.props.value,e.props.detail].filter(Boolean).join(`
|
|
49
|
-
`)];case"Table":return[[e.props.title,e.props.columns.join(" "),...e.props.rows.map(
|
|
50
|
-
`)];case"Chart":return[[e.props.title,...e.props.data.map(
|
|
51
|
-
`)];case"Product":return[[e.props.product.title
|
|
52
|
-
`)];case"Cart":return[[...e.props.cart.lines.map(
|
|
53
|
-
`)];case"Order":return[[`${e.props.order.number} \xB7 ${e.props.order.status}`,...e.props.order.items.map(
|
|
54
|
-
`)]
|
|
47
|
+
`)}function vp(e,t){switch(e.typeName){case"Grid":case"Cell":case"Carousel":return e.props.children.flatMap(n=>vp(n,t));case"Text":return[e.props.text];case"Card":return[`${e.props.title}
|
|
48
|
+
${e.props.body}`];case"Metric":return[[e.props.label,e.props.value,e.props.change?.text,e.props.detail].filter(Boolean).join(`
|
|
49
|
+
`)];case"Table":return[[e.props.title,e.props.columns.join(" "),...e.props.rows.map(n=>n.join(" "))].join(`
|
|
50
|
+
`)];case"Chart":return[[e.props.title,...e.props.series?.length?[e.props.series.join(", ")]:[],...e.props.data.map(n=>`${n.label}: ${bn(n.value).join(", ")}`)].join(`
|
|
51
|
+
`)];case"Product":return[[e.props.product.title,$t(e.props.product.price,t),e.props.product.description,...e.props.product.details??[]].filter(Boolean).join(`
|
|
52
|
+
`)];case"Cart":return[[...e.props.cart.lines.map(n=>pp(n,t)),...e.props.cart.totals.map(n=>dl(n,t))].join(`
|
|
53
|
+
`)];case"Order":return[[`${e.props.order.number} \xB7 ${e.props.order.status}`,...e.props.order.details??[],...e.props.order.items.map(n=>pp(n,t)),...e.props.order.totals.map(n=>dl(n,t))].join(`
|
|
54
|
+
`)];case"Flight":return[[...e.props.flight.legs.map(n=>ab(n,t)),[e.props.flight.fare,$t(e.props.flight.price,t),e.props.flight.priceNote].filter(Boolean).join(" \xB7 "),...e.props.flight.details??[]].join(`
|
|
55
|
+
`)];case"Stay":return[[e.props.stay.name,e.props.stay.location,jn(e.props.stay.checkIn,e.props.stay.checkOut,t),e.props.stay.room,$t(e.props.stay.price,t),...e.props.stay.details??[]].filter(Boolean).join(`
|
|
56
|
+
`)];case"Package":return[[e.props.package.title,e.props.package.location,jn(e.props.package.start,e.props.package.end,t),[$t(e.props.package.price,t),e.props.package.priceNote].filter(Boolean).join(" "),...e.props.package.details??[]].filter(Boolean).join(`
|
|
57
|
+
`)];case"Booking":return[[`${e.props.booking.reference} \xB7 ${e.props.booking.status}`,e.props.booking.title,jn(e.props.booking.start,e.props.booking.end,t),e.props.booking.travellers?.join(", "),...(e.props.booking.itinerary??[]).map(n=>[n.date&&Hn(n.date,t),n.time,n.title,n.detail].filter(Boolean).join(" \xB7 ")),...(e.props.booking.totals??[]).map(n=>dl(n,t)),...e.props.booking.details??[]].filter(Boolean).join(`
|
|
58
|
+
`)]}}function ab(e,t){let n=ao(e.departs,e.arrives);return`${[e.carrier,e.number].filter(Boolean).join(" ")}: ${e.from} ${Hn(e.departs,t)} ${Pr(e.departs,t)} \u2192 ${e.to} ${Pr(e.arrives,t)}${n?` +${n}`:""}`}function pp(e,t){return`${[e.title,...Object.values(e.options??{})].join(", ")} \xD7 ${e.quantity}: ${$t(e.price,t)}`}function dl(e,t){return`${e.label}: ${$t(e.amount,t)}`}function yp(e,{cssPrefix:t,strings:n,locale:r,onAction:o}){let i=[],s=re(!1),l;return{...Mi(e),set_attr(c,u,p){if(u!==oo||p!=="openui"||c.index!==1)return Gs(c,u,p);let _=document.createElement("div");c.nodes[c.index]?.parentElement?.replaceWith(_),l={textSig:re(""),doneSig:re(!1)},i.push(_),mn(a(pl,{cssPrefix:t,textSig:l.textSig,doneSig:l.doneSig,replyDoneSig:s,strings:n,locale:r,onAction:o}),_)},add_text(c,u){l?l.textSig.value=l.textSig.peek()+u:Ws(c,u)},end_token(c){l&&(l.doneSig.value=!0,l=void 0),Vs(c)},finish(){l&&(l.doneSig.value=!0),s.value=!0},dispose(){for(let c of i)mn(null,c);i.length=0,l=void 0}}}function pl({textSig:e,doneSig:t,replyDoneSig:n,cssPrefix:r,strings:o,locale:i,onAction:s}){let l=xe(()=>{let u=mp();return Ze(()=>u(e.value,!t.value))},[e,t]),c={cssPrefix:r,strings:o,locale:i,onAction:s,busy:!n.value};return l.value.error?a("div",{role:"alert",children:o.visualError}):a("div",{class:`${r}-generative-ui`,"aria-busy":!t.value,children:[l.value.elements.map(u=>a(Gi,{element:u,context:c},u.statementId)),l.value.partial&&a("p",{role:"status",children:o.visualPartial}),l.value.elements.length===0&&!t.value?a("span",{role:"status",children:o.visualPreparing}):null]})}function Gi({element:e,context:t}){let{cssPrefix:n}=t;if(e.typeName==="Grid")return a("div",{class:`${n}-generative-ui-grid-container`,children:a("div",{class:`${n}-generative-ui-grid`,"data-columns":e.props.columns,"data-equal-heights":Bu(e.props.children)||void 0,children:e.props.children.map(r=>a("div",{class:`${n}-generative-ui-cell`,"data-span":r.typeName==="Cell"?r.props.span??1:1,children:r.typeName==="Cell"?r.props.children.map(o=>a(Gi,{element:o,context:t},o.statementId)):a(Gi,{element:r,context:t})},r.statementId))})});switch(e.typeName){case"Carousel":return a("div",{role:"list",class:`${n}-generative-ui-carousel`,children:e.props.children.map(r=>a("div",{role:"listitem",children:a(Gi,{element:r,context:t})},r.statementId))});case"Text":return a("p",{children:e.props.text});case"Card":return a("section",{children:[Vn(e.props.image)&&a(_l,{src:e.props.image,class:`${n}-generative-ui-photo`,wide:!0}),a("strong",{children:e.props.title}),a("p",{children:e.props.body}),a(Pn,{actions:e.props.actions,context:t,disabled:t.busy})]});case"Product":return a(lb,{...e.props,context:t});case"Flight":return a(db,{...e.props,context:t});case"Stay":case"Package":return a(cb,{element:e,context:t});case"Booking":{let{booking:r}=e.props;return a("section",{class:`${n}-generative-ui-sheet`,children:[a("div",{class:`${n}-generative-ui-heading`,children:[a("strong",{dir:"ltr",children:r.reference}),a("span",{class:`${n}-generative-ui-pill`,children:r.status})]}),r.title&&a("strong",{children:r.title}),a(Ki,{parts:[jn(r.start,r.end,t.locale),r.travellers?.length&&`${t.strings.visualTravellers}: ${r.travellers.join(", ")}`],context:t}),r.itinerary?.length?a("ol",{class:`${n}-generative-ui-itinerary`,children:r.itinerary.map((o,i)=>a("li",{children:[a("span",{class:`${n}-generative-ui-muted`,children:[o.date&&Hn(o.date,t.locale),o.time].filter(Boolean).join(" \xB7 ")}),a("strong",{children:o.title}),o.detail&&a("span",{class:`${n}-generative-ui-muted`,children:o.detail})]},i))}):null,a(ul,{totals:r.totals??[],context:t}),a(mo,{details:r.details,context:t}),a(Pn,{actions:e.props.actions,context:t,disabled:t.busy})]})}case"Cart":return a("section",{class:`${n}-generative-ui-sheet`,children:[e.props.cart.messages?.map(r=>a("p",{role:r.severity==="info"?"status":"alert",class:`${n}-generative-ui-notice`,"data-severity":r.severity,children:r.text},r.text)),e.props.cart.lines.length?a(bp,{lines:e.props.cart.lines,context:t}):a("p",{class:`${n}-generative-ui-muted`,children:t.strings.visualCartEmpty}),e.props.cart.lines.length>0&&a(ul,{totals:e.props.cart.totals,context:t}),a(Pn,{actions:e.props.actions,context:t,disabled:t.busy})]});case"Order":return a("section",{class:`${n}-generative-ui-sheet`,children:[a("div",{class:`${n}-generative-ui-heading`,children:[a("strong",{dir:"ltr",children:e.props.order.number}),a("span",{class:`${n}-generative-ui-pill`,children:e.props.order.status})]}),e.props.order.date&&a("p",{class:`${n}-generative-ui-muted`,children:Qs(e.props.order.date,t.locale)}),a(mo,{details:e.props.order.details,context:t}),e.props.order.timeline?.length?a("ol",{class:`${n}-generative-ui-timeline`,children:e.props.order.timeline.map(r=>a("li",{"data-done":r.done,children:[a("span",{children:r.label}),r.date&&a("span",{class:`${n}-generative-ui-muted`,children:Qs(r.date,t.locale)})]},r.label))}):null,a(bp,{lines:e.props.order.items,context:t}),a(ul,{totals:e.props.order.totals,context:t}),a(Pn,{actions:e.props.actions,context:t,disabled:t.busy})]});case"Metric":{let r=Nu(e.props.trend);return a("section",{children:[a("strong",{children:e.props.label}),a("div",{class:`${n}-generative-ui-metric`,children:[a("span",{children:e.props.value}),r&&a("svg",{viewBox:"0 0 80 24","aria-hidden":"true",children:a("polyline",{points:r,fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linejoin":"round","stroke-linecap":"round"})})]}),e.props.change&&a("span",{class:`${n}-generative-ui-change`,"data-tone":e.props.change.tone,children:e.props.change.text}),e.props.detail&&a("p",{children:e.props.detail})]})}case"Table":return a(pb,{...e.props,context:t});case"Chart":return a(_b,{element:e,context:t})}}function lb({product:e,actions:t,context:n}){let{cssPrefix:r,strings:o}=n,[i,s]=N({}),l=qu(e,i),c=Ys(t,n.onAction!==void 0).some(u=>u.message!==void 0);return a("section",{class:`${r}-generative-ui-offer`,children:[a(fl,{image:l.image,url:e.url,badge:e.badge,available:l.available,context:n}),a("strong",{class:`${r}-generative-ui-title`,children:a(ml,{title:e.title,url:e.url})}),a(Ki,{parts:[],rating:e.rating,context:n}),a(gl,{price:l.price,compareAtPrice:l.compareAtPrice,context:n}),e.description&&a("p",{class:`${r}-generative-ui-description`,children:e.description}),a(mo,{details:e.details,context:n}),l.options.map(u=>a("fieldset",{class:`${r}-generative-ui-option`,children:[a("legend",{children:u.name}),a(fb,{children:u.values.map(p=>a("button",{type:"button","aria-pressed":u.value===p,disabled:u.unavailable.includes(p),onClick:()=>s({...i,[u.name]:p}),children:p},p))})]},u.name)),a("div",{class:`${r}-generative-ui-footer`,children:[a(Pn,{actions:t,context:n,disabled:n.busy||!l.canBuy,getMessage:u=>so(u,e.title,l.chosen)}),c&&a("p",{class:`${r}-generative-ui-hint`,children:l.missing.length>0&&`${o.visualChoose} ${l.missing.join(", ")}`})]})]})}function bp({lines:e,context:t}){let{cssPrefix:n,strings:r}=t;if(!e.length)return null;let o=e.some(i=>i.image);return a("ul",{class:`${n}-generative-ui-lines`,children:e.map((i,s)=>a("li",{children:[o&&a(_l,{src:i.image??"",class:`${n}-generative-ui-thumb`},i.image),a("div",{children:[a("div",{class:`${n}-generative-ui-line-head`,children:[a("span",{children:a(ml,{title:i.title,url:i.url})}),a("strong",{children:$t(i.price,t.locale)})]}),a("span",{class:`${n}-generative-ui-muted`,children:[...Object.entries(i.options??{}).map(([l,c])=>`${l}: ${c}`),`${r.visualQuantity} ${i.quantity}`].join(" \xB7 ")}),a(Pn,{actions:i.actions,context:t,disabled:t.busy,small:!0,getMessage:l=>so(l,i.title,i.options)})]})]},s))})}function Pn({actions:e,context:t,disabled:n,small:r,getMessage:o}){let i=Ys(e,t.onAction!==void 0);return i.length?a("div",{class:`${t.cssPrefix}-generative-ui-actions`,"data-small":r,children:i.map(s=>{if(s.message===void 0)return a("a",{href:s.url,target:"_blank",rel:"noopener noreferrer","data-primary":s.primary,children:s.label},s.label);let l=s.message;return a("button",{type:"button",disabled:n,"data-primary":s.primary,onClick:()=>t.onAction?.(o?.(l)??l),children:s.label},s.label)})}):null}function _l({src:e,href:t,class:n,wide:r,children:o}){let[i,s]=N(!1),l=!i&&Vn(e)&&a("img",{src:e,alt:"",loading:"lazy",referrerpolicy:"no-referrer",onError:()=>s(!0)});return Vn(t)?a("a",{href:t,target:"_blank",rel:"noopener noreferrer",tabIndex:-1,"aria-hidden":"true",class:n,"data-wide":r,children:[l,o]}):a("span",{class:n,"data-wide":r,children:[l,o]})}function fl({image:e,url:t,badge:n,available:r,context:{cssPrefix:o,strings:i}}){let s=(n||!r)&&a("span",{class:`${o}-generative-ui-badges`,children:[n&&a("span",{class:`${o}-generative-ui-pill`,children:n}),!r&&a("span",{class:`${o}-generative-ui-pill`,children:i.visualSoldOut})]});return Vn(e)?a(_l,{src:e,href:t,class:`${o}-generative-ui-photo`,children:s},e):s||null}function Ki({parts:e,rating:t,context:{cssPrefix:n}}){let r=e.filter(o=>typeof o=="string"&&o).join(" \xB7 ");return!r&&!t?null:a("span",{class:`${n}-generative-ui-muted`,children:[t&&a(pe,{children:[a("span",{"aria-hidden":"true",class:`${n}-generative-ui-star`,children:["\u2605"," "]}),Eu(t),t.count!==void 0&&` (${t.count})`,r&&" \xB7 "]}),r]})}function mo({details:e,context:{cssPrefix:t}}){return e?.length?a("ul",{class:`${t}-generative-ui-details`,children:e.map(n=>a("li",{children:n},n))}):null}function cb({element:e,context:t}){let{cssPrefix:n,locale:r}=t,o=Iu(e,t.strings,r);return a("section",{class:`${n}-generative-ui-offer`,children:[a(fl,{image:o.image,url:o.url,badge:o.badge,available:o.available,context:t}),a("strong",{class:`${n}-generative-ui-title`,children:[a(ml,{title:o.title,url:o.url}),o.stars!==void 0&&o.stars>0&&a("span",{class:`${n}-generative-ui-stars`,role:"img","aria-label":`${o.stars} \u2605`,children:[" ","\u2605".repeat(Math.min(o.stars,5))]})]}),a(Ki,{parts:[o.location],rating:o.rating,context:t}),a(Ki,{parts:[o.when],context:t}),o.room&&a("p",{children:o.room}),a(mo,{details:o.details,context:t}),a("div",{class:`${n}-generative-ui-footer`,children:[a(gl,{price:o.price,compareAtPrice:o.compareAtPrice,note:o.note,context:t}),a(Pn,{actions:e.props.actions,context:t,disabled:t.busy||!o.available,getMessage:i=>so(i,o.title,void 0)})]})]})}function db({flight:e,actions:t,context:n}){let{cssPrefix:r,strings:o,locale:i}=n;return a("section",{class:`${r}-generative-ui-flight`,children:[e.legs.map((s,l)=>a(ub,{leg:s,strings:o,locale:i,cssPrefix:r},l)),a(mo,{details:e.details,context:n}),a("div",{class:`${r}-generative-ui-footer`,children:[a(fl,{image:void 0,url:void 0,badge:e.badge,available:e.available!==!1,context:n}),a(gl,{price:e.price,compareAtPrice:void 0,note:[e.fare,e.priceNote].filter(Boolean).join(" \xB7 "),context:n}),a(Pn,{actions:t,context:n,disabled:n.busy||e.available===!1,getMessage:s=>so(s,zu(e),void 0)})]})]})}function ub({leg:e,strings:t,locale:n,cssPrefix:r}){let o=ao(e.departs,e.arrives),i=Au(e,t,n);return a("div",{class:`${r}-generative-ui-leg`,children:[a("span",{class:`${r}-generative-ui-muted`,children:[e.carrier,e.number,Hn(e.departs,n)].filter(Boolean).join(" \xB7 ")}),a("div",{class:`${r}-generative-ui-leg-times`,children:[a("span",{children:[a("strong",{children:Pr(e.departs,n)}),a("span",{children:e.from})]}),a("span",{class:`${r}-generative-ui-leg-path`,children:i}),a("span",{children:[a("strong",{children:[Pr(e.arrives,n),o!==void 0&&a("sup",{children:["+",o]})]}),a("span",{children:e.to})]})]})]})}function pb({title:e,columns:t,rows:n,context:{cssPrefix:r,locale:o}}){let[i,s]=N(void 0),l=$u(t,n),c=Du(n,i&&{...i,numeric:l[i.column]??!1},o);return a("section",{children:a("div",{class:`${r}-generative-ui-table`,children:a("table",{children:[a("caption",{children:e}),a("thead",{children:a("tr",{children:t.map((u,p)=>a("th",{scope:"col","data-numeric":l[p],"aria-sort":i?.column===p?i.descending?"descending":"ascending":void 0,children:a("button",{type:"button",onClick:()=>s({column:p,descending:i?.column===p&&!i.descending}),children:u})},p))})}),a("tbody",{children:c.map((u,p)=>a("tr",{children:u.map((_,d)=>a("td",{"data-numeric":l[d],children:_},d))},p))})]})})})}function ml({title:e,url:t}){return Vn(t)?a("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:e}):a(pe,{children:e})}function gl({price:e,compareAtPrice:t,note:n,context:{cssPrefix:r,locale:o}}){return a("span",{class:`${r}-generative-ui-price`,children:[a("strong",{children:$t(e,o)}),t&&Fu(e,t)&&a("s",{children:$t(t,o)}),n&&a("span",{class:`${r}-generative-ui-muted`,children:n})]})}function ul({totals:e,context:{cssPrefix:t,locale:n}}){return e.length?a("dl",{class:`${t}-generative-ui-totals`,children:e.map(r=>a("div",{children:[a("dt",{children:r.label}),a("dd",{children:$t(r.amount,n)})]},r.label))}):null}function _b({element:e,context:{cssPrefix:t,locale:n}}){let{type:r,data:o,series:i=[],title:s}=e.props,{baseline:l,barWidth:c,series:u,labels:p,ticks:_,slices:d}=Ou(e.props,n),f=["currentColor",...Lu],v=r==="pie"?o.map((m,b)=>`${m.label} ${Math.round((d[b]?.share??0)*100)}%`):u.length>1?i:[];return a("section",{children:[a("strong",{children:s}),a("svg",{class:`${t}-generative-ui-chart`,viewBox:"0 0 320 168",role:"img","aria-label":`${s}. ${i.length>1?`${i.join(" / ")}. `:""}${o.map(m=>`${m.label}: ${bn(m.value).join(" / ")}`).join(", ")}`,children:[r==="pie"?d.map((m,b)=>a("path",{d:m.path,fill:f[b%f.length]},b)):u.map((m,b)=>r==="line"?a("g",{fill:f[b%f.length],children:[a("polyline",{points:m.map(w=>`${w.x},${w.y}`).join(" "),fill:"none",stroke:f[b%f.length],"stroke-width":2.5,"stroke-linejoin":"round"}),m.map((w,y)=>a("circle",{cx:w.x,cy:w.y,r:3},y))]},b):a("g",{fill:f[b%f.length],children:m.map((w,y)=>a("rect",{x:w.x-c/2,y:Math.min(w.y,l),width:c,height:Math.abs(w.y-l),rx:2},y))},b)),r!=="pie"&&a("g",{class:`${t}-generative-ui-axis`,children:[a("line",{x1:24,x2:296,y1:l,y2:l}),p.map((m,b)=>a("text",{x:m.x,y:164,"text-anchor":"middle",children:m.text},b)),_.map(m=>a("text",{x:20,y:m.y+3,"text-anchor":"end",children:m.text},m.text))]})]}),v.length>0&&a("ul",{class:`${t}-generative-ui-legend`,children:v.map((m,b)=>a("li",{style:{color:b?f[b%f.length]:void 0},children:a("span",{children:m})},b))})]})}function Qi(e,t){if(!e.includes("```openui"))return e;let n="",r=0,o=0,i=0,s=0,l;function c(p){l?.language==="openui"&&(n+=e.slice(r,l.start)+hp(l.source,t)+(e[p-1]===`
|
|
55
59
|
`?`
|
|
56
|
-
`:""),
|
|
57
|
-
`&&(s=o+1);return An(u),i&&c(e.length),r+e.slice(n)}function ty({children:e}){let t=B(null),[r,n]=U({start:!1,end:!1});return F(()=>{let o=t.current;if(!o)return;function s(){if(!o)return;let i=Mu(o);n(c=>c.start===i.start&&c.end===i.end?c:i)}s(),o.addEventListener("scroll",s,{passive:!0});let a=typeof ResizeObserver>"u"?void 0:new ResizeObserver(s);return a?.observe(o),()=>{o.removeEventListener("scroll",s),a?.disconnect()}},[]),l("div",{ref:t,"data-cut-start":r.start||void 0,"data-cut-end":r.end||void 0,children:e})}function hl(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function ry(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function gp(e){return e.startsWith("tool-")?e.slice(5):e}var kt={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",messageFeedback:"/pai/message-feedback",requestOperator:"/pai/request-operator",emailTranscript:"/pai/email-transcript",cancelOperatorRequest:"/pai/cancel-request-operator",content:"/pai/content",contentCollections:"/pai/content/collection/list",contentVoteSet:"/pai/content/vote/set"},yl="context";function oa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ia(e){if(!oa(e))return;let t=e,r=t.controlMode,n=t.controlRevision;if(!(r!=="ai-agent"&&r!=="awaiting-operator"&&r!=="operator"||typeof n!="number"||!Number.isSafeInteger(n)||n<0))return{controlMode:r,controlRevision:n,assignedOperatorInitials:typeof t.assignedOperatorInitials=="string"&&t.assignedOperatorInitials?t.assignedOperatorInitials:void 0,assignedOperatorName:typeof t.assignedOperatorName=="string"&&t.assignedOperatorName?t.assignedOperatorName:void 0,assignedOperatorAvatar:typeof t.assignedOperatorAvatar=="string"&&t.assignedOperatorAvatar?t.assignedOperatorAvatar:void 0,operatorAvailable:typeof t.operatorAvailable=="boolean"?t.operatorAvailable:void 0}}function vp(e){if(!oa(e))return;let t=e.status,r=e.postFinishSequence;if(!(t!=="compacting"&&t!=="ready"||typeof r!="number"||!Number.isSafeInteger(r)||r<0))return{status:t,postFinishSequence:r}}function aa(e){let t=oa(e)?e.suggestions:void 0;if(!Array.isArray(t))return[];let r=[];for(let n of t){if(!oa(n))continue;let{id:o,label:s,text:a}=n;typeof s!="string"||!s||r.push({id:typeof o=="string"&&o?o:`s${r.length}`,label:s,text:typeof a=="string"&&a?a:s})}return r}function bl(e){let r={messages:e.messages.map(n=>({id:n.serverMessageId??n.id,parts:oy(n),role:n.role})),conversationId:e.conversationId,responseType:"ack"};return e.visitorId&&(r.visitorId=e.visitorId),e.userPrefs&&(r.userPrefs=e.userPrefs),e.clientTools?.length&&(r.clientTools=e.clientTools),r}function ny(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function oy(e){let t=[];for(let r of e.parts)if(r.kind==="step-start"&&t.push({type:"step-start"}),r.kind==="reasoning"&&r.text&&t.push({type:"reasoning",text:r.text,state:r.done?"done":"streaming"}),r.kind==="text"&&r.text&&t.push({text:r.text,type:"text"}),r.kind==="file"&&r.url&&t.push({mediaType:r.mediaType,type:"file",url:r.url,filename:r.filename,fileId:r.fileId,fileSize:r.fileSize}),r.kind==="tool"&&ny(r)){let n=r.dynamic?{type:"dynamic-tool",toolName:r.toolName,toolCallId:r.toolCallId,state:r.state}:{type:ry(r.toolName),toolCallId:r.toolCallId,state:r.state};r.input!==void 0&&(n.input=r.input),r.output!==void 0&&(n.output=r.output),r.error!==void 0&&(n.errorText=r.error),r.approval?.approved!==void 0&&(n.approval=r.approval),r.toolMetadata&&(n.toolMetadata=r.toolMetadata),t.push(n)}for(let r of e.attachments??[])r.url&&t.push({type:"file",url:r.url,mediaType:r.mediaType,filename:r.name,fileId:r.id,fileSize:r.size});return t}function xl(e,t,r=Wt()){let n=e?[{kind:"text",id:"t0",textSig:oe(e),doneSig:oe(!0)}]:[];return{id:r,role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:oe(n)}}function cr(){return{id:Wt(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:oe([])}}function Sl(e){let t=Wt();return iy({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function iy(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,feedback:e.feedback,partsSig:oe(e.parts.map(py))}}function ay(e){return e.status==="failed"?"error":e.role==="assistant"&&e.status==="streaming"?"streaming":"complete"}function wl(e){let t=new Set,r=e.parts.map((o,s)=>o.type==="text"?{kind:"text",id:`${e.id}-t${s}`,textSig:oe(o.text),doneSig:oe(!0)}:o.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${s}`,textSig:oe(o.text),doneSig:oe(o.state!=="streaming")}:o.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${s}`}:o.type==="file"?{kind:"file",url:o.url,mediaType:o.mediaType,filename:o.filename,fileId:o.fileId,fileSize:o.fileSize}:o.type==="source-url"?{kind:"source",sourceId:o.sourceId,url:o.url,title:o.title}:o.type==="source-document"?{kind:"source",sourceId:o.sourceId,title:o.title,filename:o.filename,mediaType:o.mediaType}:o.type==="data-suggestions"?null:o.type==="dynamic-tool"||o.type.startsWith("tool-")?{kind:"tool",toolCallId:o.toolCallId,toolName:o.type==="dynamic-tool"?o.toolName:gp(o.type),title:o.title,dynamic:o.type==="dynamic-tool"?!0:void 0,toolMetadata:o.toolMetadata,inputPartialSig:oe(""),inputSig:oe(o.input),outputSig:oe(o.output),errorSig:oe(o.errorText),stateSig:oe(o.state),approvalSig:oe(o.approval)}:null).filter(o=>o!==null).filter(o=>o.kind!=="source"?!0:t.has(o.sourceId)?!1:(t.add(o.sourceId),!0)),n=e.parts.find(o=>o.type==="data-suggestions");return{id:e.id,role:e.role,operatorInitials:e.operatorInitials,suggestions:n?.type==="data-suggestions"?aa(n.data):void 0,serverMessageId:e.id,createdAt:Date.parse(e.createdAt),status:ay(e),canceled:e.status==="canceled",feedback:e.feedback??null,stepTimings:sa(e.metadata?.steps),partsSig:oe(r)}}function sa(e){if(!(!e?.length||!e.every(t=>hp(t.durationMs))))return e.map(({durationMs:t,reasoningMs:r})=>({durationMs:Number(t),...hp(r)?{reasoningMs:r}:{}}))}function hp(e){return typeof e=="number"&&Number.isFinite(e)}function sy(e){return!e.parts.some(t=>t.type==="text"&&t.text.trim()!==""||t.type==="dynamic-tool"||t.type.startsWith("tool-")||t.type==="file"||t.type==="source-url"||t.type==="source-document")}function ly(e){return e.role==="assistant"&&e.status==="streaming"&&sy(e)}function Or(e){let t=e.length-1;return e.filter((r,n)=>n===t||!ly(r)).map(wl)}function yp(e,t){let r=!t&&e.at(-1)?.role==="assistant"?-2:-1,n=e.at(r);return!n||n.ephemeral?[]:[n]}function kl(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(_y)}}function Ye(e){let t="";for(let r of e.partsSig.value)r.kind==="text"&&(t+=r.textSig.value);return t}function la(e,t,r,n,o=t.createdAt){let s=e.find(u=>u.role==="user"&&!u.ephemeral);function a(u,p){return(u.role==="assistant"?na(Ye(u)):Ye(u)).replace(/\s+/g," ").trim().slice(0,p)}let i=s?a(s,80):"",c=a(t,120);return{conversationId:r,title:i||n,lastMessageAt:new Date(o).toISOString(),preview:c||void 0}}function ar(e){return Ye(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function Cl(e){return Ye(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file")}function Tl(e){return e==="approval-responded"||e==="output-available"||e==="output-denied"||e==="output-error"}function Nr(e){return e.kind==="tool"}function bp(e){return e.kind==="text"&&e.textSig.value.trim()!==""||e.kind==="file"}function ko(e){let t=e.partsSig.value,r=t.findLastIndex(n=>n.kind==="tool");return t.slice(r+1).some(bp)}function an(e){if(e.role!=="assistant")return!1;let t=e.partsSig.value.filter(Nr);return t.length>0&&t.every(r=>Tl(r.stateSig.value))}function sn(e){return e.role!=="assistant"?!1:e.partsSig.value.some(t=>t.kind==="tool")&&!ko(e)}function ca(e,t){return!e.partsSig.value.slice(t+1).some(r=>r.kind==="step-start"||bp(r))}function da(e){return e.partsSig.value.some(t=>Nr(t)&&!Tl(t.stateSig.value))}function Pp(e,t){if(t.length===0)return e;let r=new Set;for(let a of e)r.add(a.id),a.serverMessageId&&r.add(a.serverMessageId);let n=t.filter(a=>{let i=[a.id,a.serverMessageId].filter(c=>c!==void 0);return i.some(c=>r.has(c))?!1:(i.forEach(c=>r.add(c)),!0)});if(n.length===0)return e;let o=e.findIndex(a=>!a.ephemeral),s=o<0?e.length:o;return[...e.slice(0,s),...n,...e.slice(s)]}function nn(e,t){return t.id=e.id,e.canceled&&(t.canceled=!0),e.feedback!==void 0&&(t.feedback=e.feedback),t.suggestions??(t.suggestions=e.suggestions),t}function xp(e,t,r,n){if(!Il(e))return;if(t.length===0){let a=Math.max(...n.values());return r.find(i=>i.role==="assistant"&&n.get(i.serverMessageId??i.id)===a&&Ye(i).length>=Ye(e).length)}let o=t.at(-1);if(o?.role!=="user")return;let s=n.get(o.serverMessageId??o.id);if(s!==void 0)return r.find(a=>a.role==="assistant"&&n.get(a.serverMessageId??a.id)===s+1&&Ye(a).length>=Ye(e).length)}function Il(e){return e?.role==="assistant"&&e.status==="streaming"&&e.serverMessageId===void 0}function cy(e,t){let r=new Set(e.partsSig.value.filter(Nr).map(n=>n.toolCallId));return t.partsSig.value.filter(Nr).every(n=>r.has(n.toolCallId))}function dy(e,t){let r=new Map(t.partsSig.value.filter(Nr).filter(s=>Tl(s.stateSig.value)).map(s=>[s.toolCallId,s]));if(r.size===0)return;let n=!1,o=e.partsSig.value.map(s=>{if(!Nr(s))return s;let a=r.get(s.toolCallId);if(!a)return s;let i=s.approvalSig.value,c=a.approvalSig.value,u=i===void 0||i.approved===void 0&&c?.approved!==void 0?a.approvalSig:s.approvalSig,p=s.inputSig.value===void 0?a.inputSig:s.inputSig,_=s.toolName==="tool"?a.toolName:s.toolName,d=s.dynamic??a.dynamic,f=s.toolMetadata??a.toolMetadata;return u===s.approvalSig&&p===s.inputSig&&_===s.toolName&&d===s.dynamic&&f===s.toolMetadata?s:(n=!0,{...s,toolName:_,dynamic:d,toolMetadata:f,inputSig:p,approvalSig:u})});n&&(e.partsSig.value=o)}function Sp(e){let t=e.flatMap(r=>r.role==="assistant"&&r.status!=="streaming"?hl(r.startedAt)??[]:[]);return new Set(e.filter(r=>r.role==="user"&&t.some(n=>n>=(hl(r.createdAt)??1/0))).map(r=>r.id))}function Rl(e,t){let r=t.filter(_=>!_.ephemeral&&(_.status==="streaming"||_.status==="pending"||_.status==="error"||_.retryAction!==void 0||(_.attachments?.length??0)>0||ar(_))),n=new Map;for(let _ of r)n.set(_.id,_),_.serverMessageId!==void 0&&n.set(_.serverMessageId,_);let o=new Set,s=[],a=e.map(_=>{let d=(_.serverMessageId!==void 0?n.get(_.serverMessageId):void 0)??n.get(_.id);return d===void 0?(s.push(_),_):(o.add(d),d.role!==_.role?_:d.role==="user"&&d.serverMessageId===void 0&&(d.status==="pending"||d.status==="error")?nn(d,_):d.status!=="streaming"&&Ye(d).startsWith(Ye(_))&&cy(d,_)?(_.createdAt!==void 0&&(d.createdAt=_.createdAt),dy(d,_),_.stepTimings&&(d.stepTimings=_.stepTimings),d.suggestions??(d.suggestions=_.suggestions),d.feedback===void 0&&(d.feedback=_.feedback),_.canceled&&(d.canceled=!0),d):nn(d,_))}),i=r.filter(_=>!o.has(_)),c=i.findLast(Il),u=new Map;e.forEach((_,d)=>{u.set(_.id,d),_.serverMessageId!==void 0&&u.set(_.serverMessageId,d)});let p=xp(c,c?r.slice(0,r.indexOf(c)):[],s,u);if(c&&p){let _=a.indexOf(p);_>=0&&(a[_]=nn(c,p)),i=i.filter(d=>d!==c)}return[...a,...i]}function Co(e,t){let r=new Map(t.flatMap(_=>_.serverMessageId===void 0?[]:[[_.serverMessageId,_]])),n=new Map;t.forEach((_,d)=>{n.set(_.id,d),_.serverMessageId!==void 0&&n.set(_.serverMessageId,d)});let o=new Set(e.flatMap(_=>[_.serverMessageId,_.id].filter(d=>d!==void 0))),s=!1,a=e.map(_=>{let d=r.get(_.serverMessageId??_.id);if(d===void 0||d.role!==_.role)return _;if(_.role==="user"&&_.serverMessageId===void 0)return s=!0,nn(_,d);if(_.serverMessageId===void 0)return _;d.createdAt!==void 0&&_.createdAt!==d.createdAt&&(_.createdAt=d.createdAt,s=!0);let f=Ye(d),v=Ye(_),g=d.status!=="streaming"&&f.length>=v.length&&Pl(_,d);if(f.length>v.length||f===v&&d.partsSig.value.length>_.partsSig.value.length||g)return s=!0,nn(_,d);if((d.stepTimings?.length??0)>(_.stepTimings?.length??0)&&(_.stepTimings=d.stepTimings,s=!0),_.status==="streaming"&&d.status!=="streaming"&&uy(_,d)){if(_.continuationStreaming&&da(d))return _;if(!Pl(d,_))return s=!0,nn(_,d)}return _}),i=[...r].filter(([_])=>!o.has(_)).map(([,_])=>_),c=a.findLastIndex(Il),u=a[c],p=xp(u,a.slice(0,c),i,n);if(u!==void 0&&p!==void 0&&Ye(p).length>=Ye(u).length&&(nn(u,p),a[c]=p,i.splice(i.indexOf(p),1),s=!0),i.length===0)return{messages:s?a:e,changed:s};for(let _ of i){let d=n.get(_.serverMessageId??_.id),f=!1,v=a.findIndex(g=>{let x=n.get(g.serverMessageId??g.id);return d===void 0?!1:x===void 0?f:x>d?!0:(f=!0,!1)});v===-1?a.push(_):a.splice(v,0,_)}return{messages:a,changed:!0}}function wp(e,t){if(e.role!==t.role)return!1;let r=Ye(t),n=Ye(e);return r.length>n.length||t.partsSig.value.length>e.partsSig.value.length||Pl(e,t)}function uy(e,t){let r=e.partsSig.value,n=t.partsSig.value;return r.length!==n.length?!1:r.every((o,s)=>{let a=n[s];switch(o.kind){case"text":return a?.kind==="text"&&a.textSig.value===o.textSig.value;case"reasoning":return a?.kind==="reasoning"&&a.textSig.value===o.textSig.value;case"step-start":return a?.kind==="step-start";case"tool":return a?.kind==="tool"&&a.toolCallId===o.toolCallId&&ua(a.toolName,o.toolName);case"file":return a?.kind==="file"&&a.url===o.url&&a.mediaType===o.mediaType;case"source":return a?.kind==="source"&&a.sourceId===o.sourceId&&a.url===o.url&&a.title===o.title&&a.filename===o.filename&&a.mediaType===o.mediaType;default:return o}})}function ua(e,t){let r=e.startsWith("tool:")?e.slice(5):e,n=t.startsWith("tool:")?t.slice(5):t;return r===n}var Ln={"input-streaming":0,"input-available":1,"approval-requested":2,"approval-responded":3,"output-available":4,"output-denied":4,"output-error":4};function Pl(e,t){let r=new Map(e.partsSig.value.filter(Nr).map(n=>[n.toolCallId,n]));return t.partsSig.value.filter(Nr).some(n=>{let o=r.get(n.toolCallId);if(!o||Ln[n.stateSig.value]>Ln[o.stateSig.value])return!0;let s=n.approvalSig.value?.approved;return s!==void 0&&s!==o.approvalSig.value?.approved})}function on(e){return e.role==="assistant"&&e.status!=="streaming"&&e.canceled!==!0&&!ar(e)}function pa(e,t){if(!e.includes(t)||t.retryAction===null)return;if(t.retryAction)return t.retryAction;if(t!==e.at(-1)||t.role!=="assistant"||t.serverMessageId===void 0||t.status!=="error"&&!on(t))return;let r=e.indexOf(t);for(let n=r-1;n>=0;n--){let o=e[n];if(o?.role==="user"&&!o.ephemeral)return{kind:"repeat-user",messageId:o.id}}}function kp(e,t){return e.canceled===!0&&e.role==="assistant"&&e.status!=="streaming"&&!Cl(e)&&!t}function Cp(e,t){return e.operatorRoutedTurn?on(e)?"drop":"complete-operator-routed":t||on(e)?"error":"complete"}function py(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:oe(e.text),doneSig:oe(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,title:e.title,dynamic:e.dynamic,toolMetadata:e.toolMetadata,inputPartialSig:oe(e.inputPartial),inputSig:oe(e.input),outputSig:oe(e.output),errorSig:oe(e.error),stateSig:oe(e.state),approvalSig:oe(e.approval)}:e}function _y(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,title:e.title,dynamic:e.dynamic,toolMetadata:e.toolMetadata,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}function ln(e,t){return new Promise(r=>{if(t?.aborted)return r();let n=setTimeout(s,e);function o(){return s()}t?.addEventListener("abort",o,{once:!0});function s(){clearTimeout(n),t?.removeEventListener("abort",o),r()}})}function fy(e){let t=new TextEncoder().encode(e),r="";for(let n of t)r+=String.fromCharCode(n);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Tp(e){return e&&Object.keys(e).length>0?e:void 0}function Al(e,t,r=[]){let n=Tp(e),o=Tp(t),s=Date.now();for(let a=r.length;;a-=1){let i=r.slice(r.length-a).map(({name:p,data:_,at:d})=>({name:p,data:_,secondsAgo:Math.round((s-d)/1e3)})),c=i.length>0?{...o,recentEvents:i}:o;if(!n&&!c)return;let u=fy(JSON.stringify({...n&&{user:n},...c&&{page:c}}));if(u.length<=8192||a===0)return u}}var qe=class extends Error{constructor(r,n,o,s,a,i){super(r);ee(this,"code",n);ee(this,"status",o);ee(this,"cause",s);ee(this,"retryAfterSeconds",a);ee(this,"errorCode",i);this.name="StreamError"}};var Ip=ie.scope("parser");async function*Rp(e,t,r){if(!e.ok){let n=await e.text().catch(()=>"");throw new qe(`server responded ${e.status}: ${n.slice(0,200)}`,"server",e.status)}for await(let n of my(e,t)){let o=gy(n,r);if(o==="done")return;o&&(yield o)}}async function*my(e,t){if(!e.body)throw new qe("response has no body","no-body");let r=e.body.pipeThrough(new TextDecoderStream).getReader(),n="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:o,value:s}=await r.read();if(o){let i=n.trim();i&&(yield i);return}n+=s;let a;for(;(a=n.indexOf(`
|
|
60
|
+
`:""),r=p),l=void 0}let u=io({data:void 0,add_token(p,_){s+=1,_===10&&s===1&&(l={start:i,source:"",language:""})},set_attr(p,_,d){l&&_===oo&&(l.language=d)},add_text(p,_){l&&(l.source+=_)},end_token(){l&&c(Math.min(o+1,e.length)),s-=1}});for(;o<e.length;o++)Qe(u,e.charAt(o)),e[o]===`
|
|
61
|
+
`&&(i=o+1);return yr(u),l&&c(e.length),n+e.slice(r)}function fb({children:e}){let t=D(null),[n,r]=N({start:!1,end:!1});return U(()=>{let o=t.current;if(!o)return;function i(){if(!o)return;let l=Uu(o);r(c=>c.start===l.start&&c.end===l.end?c:l)}i(),o.addEventListener("scroll",i,{passive:!0});let s=typeof ResizeObserver>"u"?void 0:new ResizeObserver(i);return s?.observe(o),()=>{o.removeEventListener("scroll",i),s?.disconnect()}},[]),a("div",{ref:t,"data-cut-start":n.start||void 0,"data-cut-end":n.end||void 0,children:e})}function hl(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function mb(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function Pp(e){return e.startsWith("tool-")?e.slice(5):e}var _t={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",messageFeedback:"/pai/message-feedback",requestOperator:"/pai/request-operator",emailTranscript:"/pai/email-transcript",cancelOperatorRequest:"/pai/cancel-request-operator",content:"/pai/content",contentCollections:"/pai/content/collection/list",contentVoteSet:"/pai/content/vote/set"},vl="context";function Yi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ji(e){if(!Yi(e))return;let t=e,n=t.controlMode,r=t.controlRevision;if(!(n!=="ai-agent"&&n!=="awaiting-operator"&&n!=="operator"||typeof r!="number"||!Number.isSafeInteger(r)||r<0))return{controlMode:n,controlRevision:r,assignedOperatorInitials:typeof t.assignedOperatorInitials=="string"&&t.assignedOperatorInitials?t.assignedOperatorInitials:void 0,assignedOperatorName:typeof t.assignedOperatorName=="string"&&t.assignedOperatorName?t.assignedOperatorName:void 0,assignedOperatorAvatar:typeof t.assignedOperatorAvatar=="string"&&t.assignedOperatorAvatar?t.assignedOperatorAvatar:void 0,operatorAvailable:typeof t.operatorAvailable=="boolean"?t.operatorAvailable:void 0}}function xp(e){if(!Yi(e))return;let t=e.status,n=e.postFinishSequence;if(!(t!=="compacting"&&t!=="ready"||typeof n!="number"||!Number.isSafeInteger(n)||n<0))return{status:t,postFinishSequence:n}}function Xi(e){let t=Yi(e)?e.suggestions:void 0;if(!Array.isArray(t))return[];let n=[];for(let r of t){if(!Yi(r))continue;let{id:o,label:i,text:s}=r;typeof i!="string"||!i||n.push({id:typeof o=="string"&&o?o:`s${n.length}`,label:i,text:typeof s=="string"&&s?s:i})}return n}function bl(e){let n={messages:e.messages.map(r=>({id:r.serverMessageId??r.id,parts:hb(r),role:r.role})),conversationId:e.conversationId,responseType:"ack"};return e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs),e.clientTools?.length&&(n.clientTools=e.clientTools),n}function gb(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function hb(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,filename:n.filename,fileId:n.fileId,fileSize:n.fileSize}),n.kind==="tool"&&gb(n)){let r=n.dynamic?{type:"dynamic-tool",toolName:n.toolName,toolCallId:n.toolCallId,state:n.state}:{type:mb(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?.approved!==void 0&&(r.approval=n.approval),n.toolMetadata&&(r.toolMetadata=n.toolMetadata),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}function Pl(e,t,n=Mt()){let r=e?[{kind:"text",id:"t0",textSig:re(e),doneSig:re(!0)}]:[];return{id:n,role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:re(r)}}function Qt(){return{id:Mt(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:re([])}}function xl(e){let t=Mt();return vb({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function vb(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,feedback:e.feedback,partsSig:re(e.parts.map(kb))}}function bb(e){return e.status==="failed"?"error":e.role==="assistant"&&e.status==="streaming"?"streaming":"complete"}function Sl(e){let t=new Set,n=e.parts.map((o,i)=>o.type==="text"?{kind:"text",id:`${e.id}-t${i}`,textSig:re(o.text),doneSig:re(!0)}:o.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${i}`,textSig:re(o.text),doneSig:re(o.state!=="streaming")}:o.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${i}`}:o.type==="file"?{kind:"file",url:o.url,mediaType:o.mediaType,filename:o.filename,fileId:o.fileId,fileSize:o.fileSize}:o.type==="source-url"?{kind:"source",sourceId:o.sourceId,url:o.url,title:o.title}:o.type==="source-document"?{kind:"source",sourceId:o.sourceId,title:o.title,filename:o.filename,mediaType:o.mediaType}:o.type==="data-suggestions"?null:o.type==="dynamic-tool"||o.type.startsWith("tool-")?{kind:"tool",toolCallId:o.toolCallId,toolName:o.type==="dynamic-tool"?o.toolName:Pp(o.type),title:o.title,dynamic:o.type==="dynamic-tool"?!0:void 0,toolMetadata:o.toolMetadata,inputPartialSig:re(""),inputSig:re(o.input),outputSig:re(o.output),errorSig:re(o.errorText),stateSig:re(o.state),approvalSig:re(o.approval)}:null).filter(o=>o!==null).filter(o=>o.kind!=="source"?!0:t.has(o.sourceId)?!1:(t.add(o.sourceId),!0)),r=e.parts.find(o=>o.type==="data-suggestions");return{id:e.id,role:e.role,operatorInitials:e.operatorInitials,suggestions:r?.type==="data-suggestions"?Xi(r.data):void 0,serverMessageId:e.id,createdAt:Date.parse(e.createdAt),status:bb(e),canceled:e.status==="canceled",feedback:e.feedback??null,stepTimings:Zi(e.metadata?.steps),partsSig:re(n)}}function Zi(e){if(!(!e?.length||!e.every(t=>Sp(t.durationMs))))return e.map(({durationMs:t,reasoningMs:n})=>({durationMs:Number(t),...Sp(n)?{reasoningMs:n}:{}}))}function Sp(e){return typeof e=="number"&&Number.isFinite(e)}function yb(e){return!e.parts.some(t=>t.type==="text"&&t.text.trim()!==""||t.type==="dynamic-tool"||t.type.startsWith("tool-")||t.type==="file"||t.type==="source-url"||t.type==="source-document")}function Pb(e){return e.role==="assistant"&&e.status==="streaming"&&yb(e)}function Sn(e){let t=e.length-1;return e.filter((n,r)=>r===t||!Pb(n)).map(Sl)}function wp(e,t){let n=!t&&e.at(-1)?.role==="assistant"?-2:-1,r=e.at(n);return!r||r.ephemeral?[]:[r]}function wl(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(Cb)}}function qe(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function ea(e,t,n,r,o=t.createdAt){let i=e.find(u=>u.role==="user"&&!u.ephemeral);function s(u,p){return(u.role==="assistant"?Qi(qe(u)):qe(u)).replace(/\s+/g," ").trim().slice(0,p)}let l=i?s(i,80):"",c=s(t,120);return{conversationId:n,title:l||r,lastMessageAt:new Date(o).toISOString(),preview:c||void 0}}function Vt(e){return qe(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function kl(e){return qe(e).trim()!==""?!0:e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file")}function Cl(e){return e==="approval-responded"||e==="output-available"||e==="output-denied"||e==="output-error"}function xn(e){return e.kind==="tool"}function kp(e){return e.kind==="text"&&e.textSig.value.trim()!==""||e.kind==="file"}function go(e){let t=e.partsSig.value,n=t.findLastIndex(r=>r.kind==="tool");return t.slice(n+1).some(kp)}function Yn(e){if(e.role!=="assistant")return!1;let t=e.partsSig.value.filter(xn);return t.length>0&&t.every(n=>Cl(n.stateSig.value))}function Jn(e){return e.role!=="assistant"?!1:e.partsSig.value.some(t=>t.kind==="tool")&&!go(e)}function ta(e,t){return!e.partsSig.value.slice(t+1).some(n=>n.kind==="step-start"||kp(n))}function na(e){return e.partsSig.value.some(t=>xn(t)&&!Cl(t.stateSig.value))}function Cp(e,t){if(t.length===0)return e;let n=new Set;for(let s of e)n.add(s.id),s.serverMessageId&&n.add(s.serverMessageId);let r=t.filter(s=>{let l=[s.id,s.serverMessageId].filter(c=>c!==void 0);return l.some(c=>n.has(c))?!1:(l.forEach(c=>n.add(c)),!0)});if(r.length===0)return e;let o=e.findIndex(s=>!s.ephemeral),i=o<0?e.length:o;return[...e.slice(0,i),...r,...e.slice(i)]}function Kn(e,t){return t.id=e.id,e.canceled&&(t.canceled=!0),e.feedback!==void 0&&(t.feedback=e.feedback),t.suggestions??(t.suggestions=e.suggestions),t}function Tp(e,t,n,r){if(!Tl(e))return;if(t.length===0){let s=Math.max(...r.values());return n.find(l=>l.role==="assistant"&&r.get(l.serverMessageId??l.id)===s&&qe(l).length>=qe(e).length)}let o=t.at(-1);if(o?.role!=="user")return;let i=r.get(o.serverMessageId??o.id);if(i!==void 0)return n.find(s=>s.role==="assistant"&&r.get(s.serverMessageId??s.id)===i+1&&qe(s).length>=qe(e).length)}function Tl(e){return e?.role==="assistant"&&e.status==="streaming"&&e.serverMessageId===void 0}function xb(e,t){let n=new Set(e.partsSig.value.filter(xn).map(r=>r.toolCallId));return t.partsSig.value.filter(xn).every(r=>n.has(r.toolCallId))}function Sb(e,t){let n=new Map(t.partsSig.value.filter(xn).filter(i=>Cl(i.stateSig.value)).map(i=>[i.toolCallId,i]));if(n.size===0)return;let r=!1,o=e.partsSig.value.map(i=>{if(!xn(i))return i;let s=n.get(i.toolCallId);if(!s)return i;let l=i.approvalSig.value,c=s.approvalSig.value,u=l===void 0||l.approved===void 0&&c?.approved!==void 0?s.approvalSig:i.approvalSig,p=i.inputSig.value===void 0?s.inputSig:i.inputSig,_=i.toolName==="tool"?s.toolName:i.toolName,d=i.dynamic??s.dynamic,f=i.toolMetadata??s.toolMetadata;return u===i.approvalSig&&p===i.inputSig&&_===i.toolName&&d===i.dynamic&&f===i.toolMetadata?i:(r=!0,{...i,toolName:_,dynamic:d,toolMetadata:f,inputSig:p,approvalSig:u})});r&&(e.partsSig.value=o)}function Rp(e){let t=e.flatMap(n=>n.role==="assistant"&&n.status!=="streaming"?hl(n.startedAt)??[]:[]);return new Set(e.filter(n=>n.role==="user"&&t.some(r=>r>=(hl(n.createdAt)??1/0))).map(n=>n.id))}function Rl(e,t){let n=t.filter(_=>!_.ephemeral&&(_.status==="streaming"||_.status==="pending"||_.status==="error"||_.retryAction!==void 0||(_.attachments?.length??0)>0||Vt(_))),r=new Map;for(let _ of n)r.set(_.id,_),_.serverMessageId!==void 0&&r.set(_.serverMessageId,_);let o=new Set,i=[],s=e.map(_=>{let d=(_.serverMessageId!==void 0?r.get(_.serverMessageId):void 0)??r.get(_.id);return d===void 0?(i.push(_),_):(o.add(d),d.role!==_.role?_:d.role==="user"&&d.serverMessageId===void 0&&(d.status==="pending"||d.status==="error")?Kn(d,_):d.status!=="streaming"&&qe(d).startsWith(qe(_))&&xb(d,_)?(_.createdAt!==void 0&&(d.createdAt=_.createdAt),Sb(d,_),_.stepTimings&&(d.stepTimings=_.stepTimings),d.suggestions??(d.suggestions=_.suggestions),d.feedback===void 0&&(d.feedback=_.feedback),_.canceled&&(d.canceled=!0),d):Kn(d,_))}),l=n.filter(_=>!o.has(_)),c=l.findLast(Tl),u=new Map;e.forEach((_,d)=>{u.set(_.id,d),_.serverMessageId!==void 0&&u.set(_.serverMessageId,d)});let p=Tp(c,c?n.slice(0,n.indexOf(c)):[],i,u);if(c&&p){let _=s.indexOf(p);_>=0&&(s[_]=Kn(c,p)),l=l.filter(d=>d!==c)}return[...s,...l]}function ho(e,t){let n=new Map(t.flatMap(_=>_.serverMessageId===void 0?[]:[[_.serverMessageId,_]])),r=new Map;t.forEach((_,d)=>{r.set(_.id,d),_.serverMessageId!==void 0&&r.set(_.serverMessageId,d)});let o=new Set(e.flatMap(_=>[_.serverMessageId,_.id].filter(d=>d!==void 0))),i=!1,s=e.map(_=>{let d=n.get(_.serverMessageId??_.id);if(d===void 0||d.role!==_.role)return _;if(_.role==="user"&&_.serverMessageId===void 0)return i=!0,Kn(_,d);if(_.serverMessageId===void 0)return _;d.createdAt!==void 0&&_.createdAt!==d.createdAt&&(_.createdAt=d.createdAt,i=!0);let f=qe(d),v=qe(_),m=d.status!=="streaming"&&f.length>=v.length&&yl(_,d);if(f.length>v.length||f===v&&d.partsSig.value.length>_.partsSig.value.length||m)return i=!0,Kn(_,d);if((d.stepTimings?.length??0)>(_.stepTimings?.length??0)&&(_.stepTimings=d.stepTimings,i=!0),_.status==="streaming"&&d.status!=="streaming"&&wb(_,d)){if(_.continuationStreaming&&na(d))return _;if(!yl(d,_))return i=!0,Kn(_,d)}return _}),l=[...n].filter(([_])=>!o.has(_)).map(([,_])=>_),c=s.findLastIndex(Tl),u=s[c],p=Tp(u,s.slice(0,c),l,r);if(u!==void 0&&p!==void 0&&qe(p).length>=qe(u).length&&(Kn(u,p),s[c]=p,l.splice(l.indexOf(p),1),i=!0),l.length===0)return{messages:i?s:e,changed:i};for(let _ of l){let d=r.get(_.serverMessageId??_.id),f=!1,v=s.findIndex(m=>{let b=r.get(m.serverMessageId??m.id);return d===void 0?!1:b===void 0?f:b>d?!0:(f=!0,!1)});v===-1?s.push(_):s.splice(v,0,_)}return{messages:s,changed:!0}}function Ap(e,t){if(e.role!==t.role)return!1;let n=qe(t),r=qe(e);return n.length>r.length||t.partsSig.value.length>e.partsSig.value.length||yl(e,t)}function wb(e,t){let n=e.partsSig.value,r=t.partsSig.value;return n.length!==r.length?!1:n.every((o,i)=>{let s=r[i];switch(o.kind){case"text":return s?.kind==="text"&&s.textSig.value===o.textSig.value;case"reasoning":return s?.kind==="reasoning"&&s.textSig.value===o.textSig.value;case"step-start":return s?.kind==="step-start";case"tool":return s?.kind==="tool"&&s.toolCallId===o.toolCallId&&ra(s.toolName,o.toolName);case"file":return s?.kind==="file"&&s.url===o.url&&s.mediaType===o.mediaType;case"source":return s?.kind==="source"&&s.sourceId===o.sourceId&&s.url===o.url&&s.title===o.title&&s.filename===o.filename&&s.mediaType===o.mediaType;default:return o}})}function ra(e,t){let n=e.startsWith("tool:")?e.slice(5):e,r=t.startsWith("tool:")?t.slice(5):t;return n===r}var Sr={"input-streaming":0,"input-available":1,"approval-requested":2,"approval-responded":3,"output-available":4,"output-denied":4,"output-error":4};function yl(e,t){let n=new Map(e.partsSig.value.filter(xn).map(r=>[r.toolCallId,r]));return t.partsSig.value.filter(xn).some(r=>{let o=n.get(r.toolCallId);if(!o||Sr[r.stateSig.value]>Sr[o.stateSig.value])return!0;let i=r.approvalSig.value?.approved;return i!==void 0&&i!==o.approvalSig.value?.approved})}function Qn(e){return e.role==="assistant"&&e.status!=="streaming"&&e.canceled!==!0&&!Vt(e)}function oa(e,t){if(!e.includes(t)||t.retryAction===null)return;if(t.retryAction)return t.retryAction;if(t!==e.at(-1)||t.role!=="assistant"||t.serverMessageId===void 0||t.status!=="error"&&!Qn(t))return;let n=e.indexOf(t);for(let r=n-1;r>=0;r--){let o=e[r];if(o?.role==="user"&&!o.ephemeral)return{kind:"repeat-user",messageId:o.id}}}function Ip(e,t){return e.canceled===!0&&e.role==="assistant"&&e.status!=="streaming"&&!kl(e)&&!t}function Ep(e,t){return e.operatorRoutedTurn?Qn(e)?"drop":"complete-operator-routed":t||Qn(e)?"error":"complete"}function kb(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:re(e.text),doneSig:re(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,title:e.title,dynamic:e.dynamic,toolMetadata:e.toolMetadata,inputPartialSig:re(e.inputPartial),inputSig:re(e.input),outputSig:re(e.output),errorSig:re(e.error),stateSig:re(e.state),approvalSig:re(e.approval)}:e}function Cb(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,title:e.title,dynamic:e.dynamic,toolMetadata:e.toolMetadata,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}function Xn(e,t){return new Promise(n=>{if(t?.aborted)return n();let r=setTimeout(i,e);function o(){return i()}t?.addEventListener("abort",o,{once:!0});function i(){clearTimeout(r),t?.removeEventListener("abort",o),n()}})}function Tb(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(/=+$/,"")}function Mp(e){return e&&Object.keys(e).length>0?e:void 0}function Al(e,t,n=[]){let r=Mp(e),o=Mp(t),i=Date.now();for(let s=n.length;;s-=1){let l=n.slice(n.length-s).map(({name:p,data:_,at:d})=>({name:p,data:_,secondsAgo:Math.round((i-d)/1e3)})),c=l.length>0?{...o,recentEvents:l}:o;if(!r&&!c)return;let u=Tb(JSON.stringify({...r&&{user:r},...c&&{page:c}}));if(u.length<=8192||s===0)return u}}var Le=class extends Error{constructor(n,r,o,i,s,l){super(n);Z(this,"code",r);Z(this,"status",o);Z(this,"cause",i);Z(this,"retryAfterSeconds",s);Z(this,"errorCode",l);this.name="StreamError"}};var Lp=oe.scope("parser");async function*Op(e,t,n){if(!e.ok){let r=await e.text().catch(()=>"");throw new Le(`server responded ${e.status}: ${r.slice(0,200)}`,"server",e.status)}for await(let r of Rb(e,t)){let o=Ab(r,n);if(o==="done")return;o&&(yield o)}}async function*Rb(e,t){if(!e.body)throw new Le("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:o,value:i}=await n.read();if(o){let l=r.trim();l&&(yield l);return}r+=i;let s;for(;(s=r.indexOf(`
|
|
58
62
|
|
|
59
|
-
`))!==-1;){let
|
|
60
|
-
`))if(o!==""){if(o.startsWith(":")){t?.(o.slice(1).trim());continue}if(o.startsWith("data:")){let
|
|
61
|
-
${s}`:s;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(r==="[DONE]")return"done";if(!r)return null;try{let o=JSON.parse(r);if(!vy(o))throw new TypeError("unrecognized chunk");return Ip.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){throw Ip.trace("frame parse failed",{errorType:o instanceof Error?o.name:typeof o,payloadLength:r.length}),new qe("invalid SSE frame","network",void 0,o)}}function vy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof Reflect.get(e,"type")=="string"}var hy=new Set([101,204,205,304]);function yy(e){let t=new Headers;for(let r of e.trim().split(/[\r\n]+/)){let n=r.indexOf(":");n>0&&t.append(r.slice(0,n).trim(),r.slice(n+1).trim())}return t}function Ap(e){return async function(r,n){let o=new Request(r,n),s=await o.blob();return new Promise((a,i)=>{if(o.signal.aborted){i(o.signal.reason);return}let c=new XMLHttpRequest;c.open(o.method,o.url),c.withCredentials=o.credentials==="include",c.responseType="blob",o.headers.forEach((u,p)=>c.setRequestHeader(p,u)),c.upload.addEventListener("progress",u=>{u.lengthComputable&&u.total>0&&e(u.loaded/u.total)}),c.addEventListener("load",()=>{a(new Response(hy.has(c.status)?null:c.response,{status:c.status,statusText:c.statusText,headers:yy(c.getAllResponseHeaders())}))}),c.addEventListener("error",()=>i(new TypeError("Failed to fetch"))),c.addEventListener("abort",()=>i(o.signal.reason)),o.signal.addEventListener("abort",()=>c.abort(),{once:!0}),c.send(s)})}}var rt=ie.scope("transport"),by="x-user-token",Py="x-continue-link";async function El(e){try{let t=await e.clone().json();if(typeof t!="object"||t===null)return{};let r=Reflect.get(t,"error");return{error:typeof r=="string"?r:void 0,loginUrl:Ui(Reflect.get(t,"login")).url}}catch{return{}}}var Ep=6e4,xy=1e4,Ml=50,Up=new WeakMap;function Nn(e){return Up.get(e)}function To(e,t){return Up.set(e,t),e}function Mp(e){return Math.max(e?.upsertRevision??0,e?.read?.revision??0)}function Sy(e,t){return e.conversationId===t.conversationId&&e.title===t.title&&e.lastMessageAt===t.lastMessageAt&&e.preview===t.preview&&e.hasUnread===t.hasUnread&&e.controlState===t.controlState}function Pr(e,t,r=!0){switch(t.type){case"snapshot":{let n=new Map(e.map(a=>[a.conversationId,a])),o=e.filter(a=>(Nn(a)?.activityRevision??0)>t.requestedRevision).toSorted((a,i)=>(Nn(i)?.activityRevision??0)-(Nn(a)?.activityRevision??0)),s=new Set(o.map(a=>a.conversationId));return[...o,...t.result.conversations.filter(a=>!s.has(a.conversationId)).map(a=>{let i=n.get(a.conversationId);if(!i)return a;let c=Nn(i);return(c?.upsertRevision??0)>t.requestedRevision?i:c?.read&&!i.hasUnread&&c.read.lastMessageAt===a.lastMessageAt?To({...a,hasUnread:!1},{upsertRevision:0,read:c.read}):a})]}case"read":{let n=e.findIndex(c=>c.conversationId===t.conversationId&&(t.lastMessageAt===void 0||c.lastMessageAt===t.lastMessageAt)),o=e[n];if(!o)return e;let s=Nn(o);if(Mp(s)>t.revision)return e;let a=t.lastMessageAt??o.lastMessageAt,i={upsertRevision:s?.upsertRevision??0,...s?.activityRevision===void 0?{}:{activityRevision:s.activityRevision},read:{revision:t.revision,...a?{lastMessageAt:a}:{}}};return o.hasUnread?e.map((c,u)=>u===n?To({...c,hasUnread:!1},i):c):(To(o,i),e)}case"upsert":{let n=e.findIndex(u=>u.conversationId===t.conversation.conversationId);if(n<0&&!r)return e;let o=e[n],s=o?Nn(o):void 0;if(Mp(s)>t.revision)return e;let a=t.activity?t.revision:s?.activityRevision,i={upsertRevision:t.revision,...a===void 0?{}:{activityRevision:a},...!t.conversation.hasUnread&&s?.read?{read:s.read}:{}},c=o?{...o,...t.conversation,title:o.title}:{...t.conversation};return o&&Sy(o,c)?(To(o,i),e):(To(c,i),t.activity?[c,...e.filter(u=>u.conversationId!==c.conversationId)]:o?e.map((u,p)=>p===n?c:u):[...e,c])}default:return t}}var Lp=3,wy=400,ky=3e4,Cy=6e4,Ty=1e4,Iy=6e4,Ry=15e3,Ay=1024*1024,Np=new Set([408,425,429,500,502,503,504]);function Op(e){return wy*2**e+Math.floor(Math.random()*250)}function Ey(e){return Iy+Math.ceil(e/Ay)*Ry}function My(e){let t=e.get("retry-after");if(!t)return null;let r=Number(t),n=Number.isFinite(r)?r*1e3:Date.parse(t)-Date.now();return Number.isFinite(n)&&n>=0?Math.min(n,3e4):null}var Io=class{constructor(t){ee(this,"ttlMs",t);ee(this,"map",new Map)}getOrFetch(t,r){let n=this.map.get(t);if(n&&performance.now()-n.at<this.ttlMs)return n.result;let o={at:performance.now(),result:r().then(s=>(o.value=s,s)).catch(s=>{throw this.map.get(t)===o&&this.map.delete(t),s})};return this.map.set(t,o),o.result}peek(t){let r=this.map.get(t);if(r?.value!==void 0&&performance.now()-r.at<this.ttlMs)return r.value}update(t){for(let r of this.map.values()){if(r.value!==void 0){let n=t(r.value);r.value=n,r.result=Promise.resolve(n);continue}r.result=r.result.then(n=>{let o=t(n);return r.value=o,o})}}delete(t){this.map.delete(t)}};function $p(e,t){let{translations:r,defaultLocale:n,...o}=Kr(e,t);return o}var _a=class{constructor(t){ee(this,"opts",t);ee(this,"conversationListeners",new Set);ee(this,"conversationRevision",0);ee(this,"visitorId");ee(this,"conversationId");ee(this,"userContext");ee(this,"pageContext");ee(this,"locale");ee(this,"userTokenSource");ee(this,"userToken");ee(this,"userTokenRequest");ee(this,"conversationsCache",new Io(xy));ee(this,"contentCache",new Io(Ep));ee(this,"contentCollectionsCache",new Io(Ep))}setUserToken(t){this.userTokenSource=t,this.userToken=typeof t=="string"&&t||void 0,this.userTokenRequest=typeof t=="function"?this.fetchUserToken():void 0,this.opts.onLoginState?.(t?{status:"pending"}:{status:"anonymous"})}async userSub(){return this.userTokenRequest&&await this.userTokenRequest,this.userToken?Su(this.userToken):void 0}reportLogin(t){this.opts.onLoginState?.(t==="loggedIn"&&this.userToken?{status:t,...xu(this.userToken)}:{status:t==="loggedIn"?"anonymous":t})}async refreshUserToken(){let t=this.userToken;return typeof this.userTokenSource!="function"?!1:(this.userTokenRequest&&await this.userTokenRequest,this.userToken===t&&await this.fetchUserToken(),!!this.userToken&&this.userToken!==t)}setContext(t,r){this.userContext=t,this.pageContext=r}setLocale(t){this.locale=t}primeIdentity(t,r){t&&(this.visitorId=t),r&&(this.conversationId=r)}envelope(){let t={_ev:wi};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let r=Al(this.userContext,this.pageContext);return r&&(t[yl]=r),t}withEnvelope(t){return{...this.envelope(),...t}}appendEnvelope(t){for(let[r,n]of Object.entries(this.envelope()))t.append(r,n);return t}withEnvelopeQuery(t){let r=new URL(this.url(t));for(let[n,o]of Object.entries(this.envelope()))r.searchParams.has(n)||r.searchParams.set(n,o);return r.toString()}async handshake(t){rt.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let r=br("handshake",await this.postJson(kt.handshake,t,"handshake"),qp),n=r.loginStatus==="expired"&&await this.refreshUserToken()?br("handshake",await this.postJson(kt.handshake,t,"handshake"),qp):r;return this.reportLogin(n.loginStatus??(this.userToken?"loggedIn":"anonymous")),rt.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),this.visitorId=n.visitorId,this.conversationId=n.conversationId,n}async uploadFile(t,r,n){rt.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let o=new FormData;o.append("file",t,t.name);let s=br("upload",await this.postForm(this.uploadPath,o,"upload",r,Ey(t.size),n),Oy);return rt.debug("uploadFile \u2190",{id:s.id,url:s.url}),s}async transcribe(t,r="audio/webm"){rt.debug("transcribe \u2192",{size:t.size,mimeType:r});let n=new FormData;n.append("audio",t,`voice.${Ly(r)}`),n.append("mimeType",r);let o=br("transcribe",await this.postForm(this.transcribePath,n,"transcribe"),$y);return rt.debug("transcribe \u2190",{textLen:o.text.length}),o}subscribeConversationChanges(t){return this.conversationListeners.add(t),()=>this.conversationListeners.delete(t)}publishConversation(t,r=!1){let n={type:"upsert",conversation:t,revision:++this.conversationRevision,...r?{activity:!0}:{}};this.conversationsCache.update(o=>{let s=o.pagination.page===1,a=o.conversations.some(_=>_.conversationId===t.conversationId),i=Pr(o.conversations,n,s&&r),c=s&&i.length>o.pagination.limit?i.slice(0,o.pagination.limit):i;if(!s||!r||a||o.pagination.hasNext)return c===o.conversations?o:{...o,conversations:c};let u=Math.max(o.pagination.total,o.conversations.length)+1,p=Math.ceil(u/o.pagination.limit);return{...o,conversations:c,pagination:{...o.pagination,total:u,totalPages:p,hasNext:o.pagination.page<p}}});for(let o of this.conversationListeners)o(n)}localeCacheKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){return this.conversationsCache.peek(this.localeCacheKey(t))}listConversations(t={},r=!1){if((t.page??1)>1)return this.fetchConversations(t);let n=this.localeCacheKey(t),o=this.conversationRevision;r&&this.conversationsCache.delete(n);let s=this.conversationsCache.getOrFetch(n,()=>this.fetchConversations(t));return r?s.then(a=>{let i={type:"snapshot",result:a,requestedRevision:o};for(let c of this.conversationListeners)c(i);return a}):s}async fetchConversations(t){let r=new URL(this.url(kt.listConversations));return t.visitorId&&r.searchParams.set("visitorId",t.visitorId),t.page&&r.searchParams.set("page",String(t.page)),t.limit&&r.searchParams.set("limit",String(t.limit)),t.ids?.length&&r.searchParams.set("ids",t.ids.join(",")),br("listConversations",await this.getJson(r.toString(),"listConversations"),Dy)}async loadConversation(t,{ids:r=[],beforeId:n,beforeCreatedAt:o}={}){let s=new URL(this.url(kt.listMessages));s.searchParams.set("conversationId",t),s.searchParams.set("limit",String(Ml)),r.length>0&&s.searchParams.set("ids",r.join(",")),n&&s.searchParams.set("beforeId",n),o&&s.searchParams.set("beforeCreatedAt",o);let a=br("loadConversation",await this.getJson(s.toString(),"loadConversation"),qy);return{...a,messages:a.messages.toReversed()}}async markRead(t,r){if(!this.visitorId||!t)return;let n={type:"read",conversationId:t,...r===void 0?{}:{lastMessageAt:r},revision:++this.conversationRevision};this.conversationsCache.update(o=>{let s=Pr(o.conversations,n);return s===o.conversations?o:{...o,conversations:s}});for(let o of this.conversationListeners)o(n);try{await this.postJson(kt.markRead,{conversationId:t},"markRead",!0)}catch(o){rt.debug("markRead failed (non-fatal)",{err:o})}}async requestOperator(){if(!(!this.visitorId||!this.conversationId))try{return Dp("requestOperator",await this.postJson(kt.requestOperator,{},"requestOperator"))}catch(t){rt.debug("requestOperator failed (non-fatal)",{err:t});return}}async emailTranscript(t){return br("emailTranscript",await this.postJson(kt.emailTranscript,{email:t},"emailTranscript"),Uy)}async cancelOperatorRequest(){if(!(!this.visitorId||!this.conversationId))try{return Dp("cancelOperatorRequest",await this.postJson(kt.cancelOperatorRequest,{},"cancelOperatorRequest"))}catch(t){rt.debug("cancelOperatorRequest failed (non-fatal)",{err:t});return}}listContent(t={}){return this.contentCache.getOrFetch(JSON.stringify(t,Object.keys(t).toSorted()),()=>this.fetchContent(t)).then(r=>({...r,items:r.items.map(n=>$p(n,this.locale))}))}async fetchContent(t){let r=new URL(this.dataUrl(kt.content));for(let[o,s]of Object.entries(t))s!==void 0&&r.searchParams.set(o,Array.isArray(s)?s.join(","):String(s));let n=br("listContent",await this.getJson(r.toString(),"listContent"),By);return{...n,items:n.items??[]}}async setContentVote(t){try{await this.postJson(this.dataUrl(kt.contentVoteSet),t,"setContentVote")}catch{}}listContentCollections(t){return this.contentCollectionsCache.getOrFetch(t.join(","),()=>this.fetchContentCollections(t)).then(r=>({items:r.items.map(n=>$p(n,this.locale))}))}async fetchContentCollections(t){let r=new URL(this.dataUrl(kt.contentCollections));return t.length&&r.searchParams.set("ids",t.join(",")),{items:br("listContentCollections",await this.getJson(r.toString(),"listContentCollections"),zy).items??[]}}async saveUserPrefs(t){await this.postJson(kt.updateSettings,{userPrefs:t},"saveUserPrefs")}get uploadPath(){return this.opts.endpoints?.upload??"/pai/upload-file"}get transcribePath(){return this.opts.endpoints?.transcribe??"/pai/transcribe-audio"}async submitFeedback(t){rt.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson(kt.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(r){rt.debug("submitFeedback failed (non-fatal)",{err:r})}}async sendTurn(t,r={}){rt.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageCount:t.messages.length});let n=JSON.stringify({...this.withEnvelope(t),[yl]:Al(this.userContext,this.pageContext,this.opts.recentHostEvents)}),o=r.keepalive===!0&&new Blob([n]).size<Cy;try{return await this.runWithAbort(async s=>{let a=await this.withFreshUserToken(()=>this.fetchImpl(this.url(kt.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"application/json","content-type":"application/json",...this.headersFor(this.url(kt.streamMessage))},body:n,keepalive:o,signal:s}));if(a.status!==202)throw new qe(`sendTurn failed: expected 202, received ${a.status}`,"server",a.status,void 0,Fy(a),(await El(a)).error);let i;try{i=await a.json()}catch(c){throw s?.aborted?c:new qe("sendTurn failed: invalid acknowledgement","server",a.status,c)}if(!Ny(i))throw new qe("sendTurn failed: invalid acknowledgement","server",a.status);return i},void 0,ky)}catch(s){throw s instanceof qe?s:new qe("sendTurn failed: network error","network",void 0,s)}}cancelTurn(t,r){!this.visitorId||!t||!r||(rt.debug("cancel stream",{conversationId:t,runId:r,visitorId:this.visitorId}),this.fetchImpl(this.url(kt.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.headersFor(this.url(kt.cancelStream))},body:JSON.stringify(this.withEnvelope({conversationId:t,runId:r})),keepalive:!0}).catch(n=>rt.debug("cancel POST failed (non-fatal)",{err:n})))}async connectResumeStream(t){let r=new AbortController;function n(){return r.abort(t.signal.reason)}t.signal.aborted?n():t.signal.addEventListener("abort",n,{once:!0});let o=setTimeout(()=>r.abort(),Ty);function s(){clearTimeout(o),t.signal.removeEventListener("abort",n)}let a;try{a=await this.withFreshUserToken(()=>this.fetchImpl(this.resumeUrl(),{method:"GET",credentials:"omit",cache:"no-store",headers:{accept:"text/event-stream",...this.headersFor(this.resumeUrl())},signal:r.signal}))}catch(c){return s(),t.signal.aborted||rt.debug("resume-stream fetch failed \u2014 reconnecting",{err:c}),"held"}if(!a.ok)return s(),a.status===409||Np.has(a.status)?(rt.debug("resume-stream \u2192 transient response; reconnecting",{status:a.status}),"held"):(rt.debug("resume-stream \u2192 endpoint unavailable",{status:a.status}),"unavailable");if(!a.body)return s(),rt.debug("resume-stream \u2192 bodyless response; stopping",{status:a.status}),"unavailable";if(!(a.headers.get("content-type")??"").includes("text/event-stream"))return s(),rt.debug("resume-stream \u2192 non-SSE response; stopping"),"unavailable";let i=!1;try{for await(let{chunk:c}of Rp(a,r.signal,u=>{i||u!=="connected"||(i=!0,clearTimeout(o),t.onConnected())})){if(t.signal.aborted)return"held";t.onChunk(c)}}catch(c){if(t.signal.aborted)return"held";rt.debug("resume-stream segment dropped \u2014 reconnecting",{err:c})}finally{s()}return"held"}resumeUrl(){return this.withEnvelopeQuery(kt.streamResume)}async postJson(t,r,n,o=!1){let s=await this.fetchWithRetry(()=>[this.url(t),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.headersFor(this.url(t))},body:JSON.stringify(this.withEnvelope(r)),...o?{keepalive:!0}:{}}],n);return this.assertOk(s,n)}async postForm(t,r,n,o,s,a){let i=a?Ap(a):this.fetchImpl;return this.runWithAbort(async c=>{let u=await this.withFreshUserToken(()=>i(this.url(t),{method:"POST",credentials:"omit",headers:this.headersFor(this.url(t)),body:this.appendEnvelope(r),signal:c}));return this.assertOk(u,n)},o,s)}async runWithAbort(t,r,n){if(!r&&n===void 0)return t();let o=new AbortController;function s(){return o.abort(r?.reason)}r?.aborted?s():r?.addEventListener("abort",s,{once:!0});let a=n===void 0?void 0:setTimeout(()=>o.abort(),n);try{return await t(o.signal)}finally{a!==void 0&&clearTimeout(a),r?.removeEventListener("abort",s)}}async getJson(t,r){let n=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.headersFor(this.url(t))}}],r);return this.assertOk(n,r)}async fetchWithRetry(t,r){for(let n=0;;n++){let o;try{o=await this.withFreshUserToken(()=>this.fetchImpl(...t()))}catch(a){if(n>=Lp)throw new qe(`${r} failed: network error`,"network",void 0,a);rt.debug("request network error \u2014 retrying",{label:r,attempt:n}),await ln(Op(n));continue}if(o.ok||!Np.has(o.status)||n>=Lp)return o;let s=My(o.headers)??Op(n);rt.debug("request retryable status \u2014 retrying",{label:r,status:o.status,attempt:n,wait:s}),await ln(s)}}async assertOk(t,r){if(!t.ok)throw new qe(`${r} failed: ${t.status}`,"server",t.status,void 0,void 0,(await El(t)).error);return await t.json()}fetchUserToken(){let t=this.userTokenSource;if(typeof t!="function")return Promise.resolve();let r=Promise.resolve().then(t).then(n=>{this.userTokenSource===t&&(this.userToken=n||void 0)},n=>{rt.warn("userToken function failed",{err:n}),this.userTokenSource===t&&(this.userToken=void 0)});return this.userTokenRequest=r,r}headersFor(t){let r=!/^https?:\/\//i.test(t)||t.startsWith(`${this.opts.agentApiBaseUrl}/`);return{...this.opts.auth.headers(),...r&&this.userToken?{[by]:this.userToken}:{},...r&&this.opts.continueLink?{[Py]:this.opts.continueLink}:{}}}async withFreshUserToken(t){this.userTokenRequest&&await this.userTokenRequest;let r=await t();if(r.status!==401)return r;let n=await El(r);if(n.error==="USER_TOKEN_REQUIRED")return this.opts.onLoginState?.({status:"required",loginUrl:n.loginUrl}),r;if(!this.userToken)return r;if(!await this.refreshUserToken())return this.reportLogin("expired"),r;this.reportLogin("loggedIn");let o=await t();return o.status===401&&this.reportLogin("expired"),o}url(t){return/^https?:\/\//i.test(t)?t:`${this.opts.agentApiBaseUrl}${t}`}dataUrl(t){return`${this.opts.dataApiBaseUrl}${t}`}get fetchImpl(){return this.opts.fetchImpl??globalThis.fetch.bind(globalThis)}};function Ly(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 Ny(e){if(typeof e!="object"||e===null)return!1;let t=Reflect.get(e,"status"),r=Reflect.get(e,"conversationId"),n=Reflect.get(e,"runId");return t==="accepted"&&typeof r=="string"&&r.length>0&&(n===void 0||typeof n=="string"&&n.length>0)}function Ht(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function br(e,t,r){if(!r(t))throw new qe(`${e} failed: invalid response body`,"server");return t}function Dp(e,t){let r=ia(Ht(t)?t.controlState:void 0);if(!r)throw new qe(`${e} failed: invalid response body`,"server");return r}function qp(e){return!(!Ht(e)||typeof e.visitorId!="string"||typeof e.conversationId!="string"||e.welcome!==void 0&&(!Ht(e.welcome)||e.welcome.messages!==void 0&&!Array.isArray(e.welcome.messages)))}function Oy(e){return Ht(e)&&typeof e.id=="string"&&typeof e.url=="string"&&typeof e.originalName=="string"&&typeof e.mimeType=="string"&&typeof e.fileSize=="number"}function $y(e){return Ht(e)&&typeof e.text=="string"}function Bp(e){return Ht(e)&&typeof e.page=="number"&&typeof e.limit=="number"&&typeof e.total=="number"&&typeof e.totalPages=="number"&&typeof e.hasNext=="boolean"&&typeof e.hasPrev=="boolean"}function Dy(e){return Ht(e)&&Array.isArray(e.conversations)&&e.conversations.every(Ht)&&Bp(e.pagination)}function qy(e){return Ht(e)&&typeof e.conversationId=="string"&&Array.isArray(e.messages)&&e.messages.every(Ht)}function Uy(e){return Ht(e)&&typeof e.status=="string"&&typeof e.to=="string"}function By(e){return Ht(e)&&(e.items===void 0||Array.isArray(e.items)&&e.items.every(Ht))&&(e.pagination===void 0||Bp(e.pagination))}function zy(e){return Ht(e)&&(e.items===void 0||Array.isArray(e.items)&&e.items.every(Ht))}function Fy(e){let t=Number(e.headers.get("retry-after"));return Number.isInteger(t)&&t>0?t:void 0}function On(e,t,r){switch(e){case"clear":case"sound":case"history":case"language":case"theme":case"textSize":return!0;case"popOut":return t!=="standalone"&&t!=="page";case"expand":return t==="floating";case"fullscreen":return t!=="standalone";case"close":return t==="standalone"||t==="page"?!1:t==="inline"?r==="fullscreen":!0}}function fa(e,t,r){return On("close",e,t)?r.includes("close"):!1}function zp(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}function $n(e,t,r,n){let o={role:r,text:n};e.emit("message",o),t.onMessage?.(o)}function Fp(e){return Object.fromEntries(e.map(t=>[t,[]]))}function Ll(e,t,r){return e.includes(t)?t:e.includes(r)?r:e[0]??""}function Hp(e,t,r){let n=[...new Set(t)],o=Ll(n,e,""),s=oe({activeTab:o,stacks:Fp(n)});return{sig:s,reconcile(a,i){let c=[...new Set(a)],u=s.value,p=Ll(c,u.activeTab,i),_=Object.fromEntries(c.map(f=>[f,u.stacks[f]??[]])),d=p===u.activeTab&&c.length===Object.keys(u.stacks).length&&c.every(f=>u.stacks[f]===_[f]);n=c,!d&&(s.value={activeTab:p,stacks:_},p!==u.activeTab&&p&&r?.(p))},switchTab(a){!(a in s.value.stacks)||s.value.activeTab===a||(s.value={...s.value,activeTab:a},r?.(a))},open(a,i){let c=s.value;a in c.stacks&&(s.value={activeTab:a,stacks:{...c.stacks,[a]:i?[i]:[]}},c.activeTab!==a&&r?.(a))},push(a){let i=s.value,c=i.stacks[i.activeTab]??[];s.value={...i,stacks:{...i.stacks,[i.activeTab]:[...c,a]}}},pop(){let a=s.value,i=a.stacks[a.activeTab]??[];i.length!==0&&(s.value={...a,stacks:{...a.stacks,[a.activeTab]:i.slice(0,-1)}})},reset(a){s.value={activeTab:Ll(n,a,""),stacks:Fp(n)}}}}function jp(e){return e.stacks[e.activeTab]??[]}function Vp(e){return jp(e).at(-1)}function Wp(e){return jp(e).length===0}function Ro(e){/^(https?:)?\//i.test(e)&&window.open(e,"_blank","noopener,noreferrer")}function ma(e,t,r){return e==="page"?"page":e==="standalone"?"standalone":e==="inline"?t==="fullscreen"?"fullscreen":"inline":e==="modal"||e==="drawer"?r?t==="fullscreen"?"fullscreen":e:"closed":r?t==="fullscreen"?"fullscreen":t==="expanded"?"expanded":"open":"closed"}var Hy=900,jy=640;function Nl(e,t,r){if(e==="standalone"||e==="page")return"fullscreen";let n=t.initialSize;return n==="expanded"||n==="fullscreen"||n==="normal"?n:r>0&&r<jy?"fullscreen":r>=(t.autoSizeBreakpoint??Hy)?"expanded":"normal"}function Ao(e,t,r,n=null){let s=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(r??!e.startMinimized),i=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&n?n:Nl(e.mode,e.size,t);return{panelOpen:s,panelSize:i}}function Dn(){return typeof window>"u"?0:window.innerWidth}var ne={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},ga=`${q.cssPrefix}-icon-dir`;function Ol(){return l("svg",{...ne,"aria-hidden":"true",children:l("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})})}function Dt(){return l("svg",{...ne,"aria-hidden":"true",children:l("path",{d:"M18 6 6 18M6 6l12 12"})})}function Gp(){return l("svg",{...ne,"aria-hidden":"true",children:l("path",{d:"M12 5v14M5 12h14"})})}function Kp(){return l("svg",{...ne,class:ga,"aria-hidden":"true",children:[l("path",{d:"m22 2-7 20-4-9-9-4Z"}),l("path",{d:"M22 2 11 13"})]})}function Qp(){return l("svg",{...ne,"aria-hidden":"true",children:l("path",{d:"M12 19V5M5 12l7-7 7 7"})})}function Yp(){return l("svg",{...ne,class:ga,"aria-hidden":"true",children:l("path",{d:"M3 20V4l18 8-18 8Z"})})}function va(){return l("svg",{...ne,class:ga,"aria-hidden":"true",children:l("path",{d:"m9 18 6-6-6-6"})})}function $r(){return l("svg",{...ne,"aria-hidden":"true",children:l("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function ha(){return l("svg",{...ne,"aria-hidden":"true",children:l("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"})})}function Jp(){return l("svg",{...ne,"aria-hidden":"true",children:[l("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),l("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]})}function xr(){return l("svg",{...ne,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"8",r:"4.5"}),l("path",{d:"M4.5 20.5a7.5 7.5 0 0 1 15 0"})]})}function Xp(){return l("svg",{...ne,"aria-hidden":"true",children:l("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})})}function Zp(){return l("svg",{...ne,"aria-hidden":"true",children:l("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})})}function e_(){return l("svg",{...ne,"aria-hidden":"true",children:l("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})})}function t_(){return l("svg",{...ne,"aria-hidden":"true",children:l("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})})}function r_(){return l("svg",{...ne,"aria-hidden":"true",children:[l("path",{d:"M14 3h7v7M21 3l-9 9"}),l("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}function n_(){return l("svg",{...ne,"aria-hidden":"true",viewBox:"0 0 10 10",children:l("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})})}function o_(){return l("svg",{...ne,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),l("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),l("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]})}function i_(){return l("svg",{...ne,"aria-hidden":"true",children:l("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})})}function a_(){return l("svg",{...ne,"aria-hidden":"true",children:l("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})})}function s_(){return l("svg",{...ne,"aria-hidden":"true",children:[l("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),l("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]})}function qn(){return l("svg",{...ne,"aria-hidden":"true",children:l("path",{d:"M20 6 9 17l-5-5"})})}function l_(){return l("svg",{...ne,"aria-hidden":"true",children:[l("path",{d:"M3 3v6h6"}),l("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),l("path",{d:"M12 7v5l3 2"})]})}function c_(){return l("svg",{...ne,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"10"}),l("path",{d:"M2 12h20"}),l("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"})]})}function Eo(){return l("svg",{...ne,class:ga,"aria-hidden":"true",children:l("path",{d:"M19 12H5M12 19l-7-7 7-7"})})}function d_(){return l("svg",{...ne,"aria-hidden":"true",children:[l("path",{d:"M12 20h9"}),l("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}function ya(){return l("svg",{...ne,"aria-hidden":"true",children:[l("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),l("path",{d:"m3 7 9 6 9-6"})]})}function sr(){return l("svg",{...ne,"aria-hidden":"true",children:l("path",{d:"m6 9 6 6 6-6"})})}function ba(){return l("svg",{...ne,"aria-hidden":"true",children:[l("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),l("path",{d:"M14 2v6h6"})]})}function Vy(){return l("svg",{...ne,"aria-hidden":"true",children:[l("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),l("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]})}function $l(){return l("svg",{...ne,"aria-hidden":"true",children:l("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})})}function Mo(){return l("svg",{...ne,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"10"}),l("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),l("path",{d:"M12 17h.01"})]})}function Wy(){return l("svg",{...ne,"aria-hidden":"true",children:[l("path",{d:"m15 4 3 3-9 9-3-3z"}),l("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]})}function Gy(){return l("svg",{...ne,"aria-hidden":"true",children:[l("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),l("path",{d:"M12 8V4"}),l("circle",{cx:"12",cy:"3",r:"1"}),l("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]})}function Ky(){return l("svg",{...ne,"aria-hidden":"true",children:[l("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),l("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),l("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),l("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]})}function Qy(){return l("svg",{...ne,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"10"}),l("circle",{cx:"12",cy:"12",r:"4"}),l("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"})]})}function Dl(){return l("svg",{...ne,"aria-hidden":"true",children:[l("circle",{cx:"11",cy:"11",r:"7"}),l("path",{d:"m21 21-4.3-4.3"})]})}function u_(){return l("svg",{...ne,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"9"}),l("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]})}function p_(){return l("svg",{...ne,"aria-hidden":"true",children:[l("path",{d:"M3 9.5 12 3l9 6.5"}),l("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]})}function Pa(){return l("svg",{...ne,"aria-hidden":"true",children:[l("path",{d:"m3 11 15-5v12L3 13z"}),l("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),l("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),l("path",{d:"M21 10a3 3 0 0 1 0 4"})]})}function Lo(){return l("svg",{...ne,"aria-hidden":"true",children:[l("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),l("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]})}function __(){return l("svg",{...ne,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"4"}),l("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"})]})}function f_(){return l("svg",{...ne,"aria-hidden":"true",children:l("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})}function m_(){return l("svg",{...ne,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"9"}),l("path",{d:"M12 3v18"}),l("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]})}function Yy(){return l("svg",{...ne,"aria-hidden":"true",children:[l("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),l("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),l("path",{d:"m20 20-4.4-4.4"})]})}function Jy(){return l("svg",{...ne,"aria-hidden":"true",children:[l("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"}),l("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]})}function Xy(){return l("svg",{...ne,"aria-hidden":"true",children:[l("path",{d:"M4 18h16"}),l("path",{d:"M5 18a7 7 0 0 1 14 0"}),l("path",{d:"M12 8V6"}),l("path",{d:"M10 6h4"})]})}function Zy(){return l("svg",{...ne,"aria-hidden":"true",children:[l("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),l("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),l("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),l("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"})]})}function g_(){return l("svg",{...ne,"aria-hidden":"true",children:[l("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),l("path",{d:"M5 15a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2"})]})}function v_(){return l("svg",{...ne,"aria-hidden":"true",children:[l("path",{d:"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"}),l("path",{d:"M7 10l4-7a2.5 2.5 0 0 1 2.5 2.5V8h5a2 2 0 0 1 2 2.3l-1.2 8A2 2 0 0 1 17.3 20H7"})]})}function h_(){return l("svg",{...ne,"aria-hidden":"true",children:[l("path",{d:"M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1z"}),l("path",{d:"M17 14l-4 7a2.5 2.5 0 0 1-2.5-2.5V16h-5a2 2 0 0 1-2-2.3l1.2-8A2 2 0 0 1 6.7 4H17"})]})}function y_(){return l("svg",{...ne,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"3.5"}),l("path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M19.1 4.9l-2.1 2.1M7 17l-2.1 2.1"})]})}function b_(){return l("svg",{...ne,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"9"}),l("path",{d:"M12 7v5l3 2"})]})}function cn(){return l("svg",{...ne,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"9"}),l("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]})}function No(){return l("svg",{...ne,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"9"}),l("path",{d:"m15 9-6 6M9 9l6 6"})]})}function P_(){return l("svg",{...ne,"aria-hidden":"true",children:l("path",{d:"M12 18V5M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294M17.996 5.125a4 4 0 012.526 5.77M18 18a4 4 0 002-7.465M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517M6 18a4 4 0 01-2-7.465M6.004 5.125a4 4 0 00-2.526 5.77"})})}function Un(){return l("svg",{...ne,"aria-hidden":"true",children:[l("circle",{cx:"12",cy:"12",r:"10"}),l("path",{d:"M12 8v4M12 16h.01"})]})}var x_={chat:Ol,message:$l,bubbles:Lo,spark:Vy,wand:Wy,bot:Gy,help:Mo,lifebuoy:Qy,headset:Ky,search:Yy,sparkles:Jy,concierge:Xy,wave:Zy};var W=q.cssPrefix,D={launcher:`${W}-launcher`,callout:`${W}-callout`,calloutDismiss:`${W}-callout-dismiss`,panel:`${W}-panel`,panelHeader:`${W}-panel-header`,resizeGrip:`${W}-resize-grip`,scrollToBottom:`${W}-scroll-to-bottom`,loadPreviousMessages:`${W}-load-previous-messages`,actionHistory:`${W}-action-history`,actionClose:`${W}-action-close`,emailTranscriptSheet:`${W}-email-transcript-sheet`,emailTranscriptEmail:`${W}-email-transcript-email`,emailTranscriptSend:`${W}-email-transcript-send`,langSegment:`${W}-lang-segment`,composer:`${W}-composer`,composerInput:`${W}-composer-input`,composerCount:`${W}-composer-count`,composerSend:`${W}-composer-send`,composerStop:`${W}-composer-stop`,compactionStatus:`${W}-compaction-status`,messageQueue:`${W}-message-queue`,queuedMessage:`${W}-queued-message`,queuedMessageRemove:`${W}-queued-message-remove`,composerAttach:`${W}-composer-attach`,composerFileInput:`${W}-composer-file-input`,composerVoice:`${W}-composer-voice`,attachmentChip:`${W}-attachment-chip`,attachmentRemove:`${W}-attachment-remove`,attachmentRetry:`${W}-attachment-retry`,suggestion:`${W}-suggestion`,messageBubble:`${W}-message`,messageRetry:`${W}-message-retry`,messageFile:`${W}-message-file`,messageFeedback:`${W}-message-feedback`,feedbackUp:`${W}-feedback-up`,feedbackDown:`${W}-feedback-down`,messageCopy:`${W}-message-copy`,historyItem:`${W}-history-item`,historyLoadMore:`${W}-history-load-more`,sidebar:`${W}-sidebar`,sidebarToggle:`${W}-sidebar-toggle`,sidebarNewConversation:`${W}-sidebar-new-conversation`,messengerHome:`${W}-messenger-home`,panelNotice:`${W}-panel-notice`,tab:`${W}-tab`,tabBadge:`${W}-tab-badge`,homeView:`${W}-home-view`,homeGreeting:`${W}-home-greeting`,homeBrand:`${W}-home-brand`,backHeader:`${W}-back-header`,contentView:`${W}-content-view`,contentScroll:`${W}-content-scroll`,homeSearch:`${W}-home-search`,helpSearch:`${W}-help-search`,homeRecent:`${W}-home-recent`,homeAsk:`${W}-home-ask`,homeWhatsNew:`${W}-home-whats-new`,homeContentRow:`${W}-home-content-row`,helpArticle:`${W}-help-article`,newsItem:`${W}-news-item`,newsMore:`${W}-news-more`,formField:`${W}-form-field`,toolAskQuestions:`${W}-tool-ask-questions`,toolInputSubmit:`${W}-tool-input-submit`,toolInputSkip:`${W}-tool-input-skip`,toolApproval:`${W}-tool-approval`,toolPreview:`${W}-tool-preview`,toolApprove:`${W}-tool-approve`,toolDecline:`${W}-tool-decline`,toolEdit:`${W}-tool-edit`,toolDecision:`${W}-tool-decision`,typingDots:`${W}-typing-dots`,reasoning:`${W}-reasoning`,replyStopped:`${W}-reply-stopped`,toolAskSummary:`${W}-ask-questions-summary`,toolAskOptions:`${W}-ask-questions-options-toggle`,toolSteps:`${W}-tool-steps`,toolStep:`${W}-tool-step`,source:`${W}-source`,operatorRequest:`${W}-operator-request`,chatNotice:`${W}-chat-notice`,operatorBanner:`${W}-operator-banner`,cancelOperatorRequest:`${W}-cancel-operator-request`,loginBar:`${W}-login-bar`,loginBarAction:`${W}-login-bar-action`,loginBarHide:`${W}-login-bar-hide`,loginGate:`${W}-login-gate`,loginGateAction:`${W}-login-gate-action`,loginGateGuest:`${W}-login-gate-guest`,loggedIn:`${W}-logged-in`};function Ct(e,t){return`${e}-${t}`}var xa=q.cssPrefix;function S_({buttonRef:e,onToggle:t,launcher:r,strings:n,leaving:o,edgeTab:s}){let a=r.variant==="circle"?"":eb(r,n);return l("button",{ref:e,type:"button",class:`${xa}-fab`,part:"launcher","data-variant":r.variant,"data-size":r.size,"data-edge-tab":s?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":D.launcher,onClick:t,"aria-label":n.launcherOpen,children:[tb(r.icon),a?l("span",{class:`${xa}-fab-label`,children:a}):null]})}function eb(e,t){return e.label?mt(t,e.label):e.personaName?t.launcherAsk.replace("{name}",mt(t,e.personaName)):""}function tb(e){let t=x_[e];return t?l(t,{}):l(rb,{source:e})}function rb({source:e}){return l("span",{ref:t=>{t&&nb(t,e)},"aria-hidden":"true"})}function nb(e,t){if(e.dataset.svgMounted!==t)try{let n=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;n.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(n,!0)),e.dataset.svgMounted=t)}catch{}}function w_({callout:e,launcherPosition:t,strings:r,closeLabel:n,onDismiss:o}){let[s,a]=U(!1),i=B(null),[c,u]=U(!0);return St(()=>{let p=i.current?.parentElement;if(!p)return;let _=()=>u(window.innerWidth-p.getBoundingClientRect().width>=ob);return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)}),F(()=>{let p=setTimeout(()=>a(!0),e.delayMs);return()=>clearTimeout(p)},[e.delayMs]),F(()=>{if(!s||e.autoDismissMs<=0)return;let p=setTimeout(o,e.autoDismissMs);return()=>clearTimeout(p)},[s,e.autoDismissMs,o]),s?l("div",{ref:i,class:`${xa}-callout`,role:"status","data-shape":e.shape,"data-position":ib(e.position,t,c),"data-animated":e.animated?"true":void 0,"data-testid":D.callout,children:[l("span",{children:mt(r,e.text)}),l("button",{type:"button",class:`${xa}-callout-close`,onClick:o,"aria-label":n,title:n,"data-testid":D.calloutDismiss,children:l(Dt,{})})]}):null}var ob=200;function ib(e,t,r=!0){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"||e==="auto"&&!r?o?"top":"bottom":n?"left":"right"}var ab='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Bn(e){function t(r){if(r.key!=="Tab")return;let n=[...e.querySelectorAll(ab)].filter(c=>c.offsetParent!==null||c===document.activeElement);if(n.length===0){r.preventDefault();return}let o=n[0],s=n[n.length-1];if(!o||!s)return;let a=e.getRootNode(),i=a instanceof ShadowRoot?a.activeElement:null;r.shiftKey&&i===o?(r.preventDefault(),s.focus()):!r.shiftKey&&i===s&&(r.preventDefault(),o.focus())}return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}var Dr=q.cssPrefix;function Sa({title:e,actions:t}){return l("header",{class:`${Dr}-back-header`,part:"header","data-variant":"title",children:[l("span",{class:`${Dr}-back-spacer`,"aria-hidden":"true"}),l("h1",{class:`${Dr}-back-title`,children:e}),t??l("span",{class:`${Dr}-back-spacer`,"aria-hidden":"true"})]})}function k_({title:e,backLabel:t,onBack:r,actions:n,testid:o}){return l("header",{class:`${Dr}-back-header`,part:"header","data-testid":o,children:[l("button",{type:"button",class:`${Dr}-icon-btn`,onClick:r,"aria-label":t,title:t,children:l(Eo,{})}),l("h1",{class:`${Dr}-back-title`,children:e}),n??l("span",{class:`${Dr}-back-spacer`,"aria-hidden":"true"})]})}function Oo({textSig:e,doneSig:t,generativeUi:r=!1,strings:n=fi,onCardAction:o}){let s=B(null),a=B(null);return St(()=>{let i=s.current;if(!i)return;i.classList.add(`${q.cssPrefix}-md`);let c=a.current,u={generativeUi:r,strings:n,onCardAction:o},p=()=>{a.current?.renderer?.dispose();let g=document.createElement("div"),x=r?_p(g,{cssPrefix:q.cssPrefix,strings:n,onAction:o}):void 0,k=go(hb(xb(x??zi(g)))),y=e.value,S=y.length-C_(y);if(!t.value)for(;S>0&&y[S-1]==="_";)S--;let b=ql(y.slice(0,S));return b&&it(k,b),t.value&&(An(k),x?.finish()),i.replaceChildren(g),{settings:u,container:g,parser:k,renderer:x,lastLen:S,lastText:y.slice(0,S)}},_=c&&c.settings.generativeUi===r&&c.settings.strings===n&&c.settings.onCardAction===o&&e.value.startsWith(c.lastText)?c:p();a.current=_;let d=nr(()=>{let g=e.value,x=t.value;if(g.length<_.lastLen){_=p(),a.current=_;return}let k=Math.max(g.length-C_(g),_.lastLen);if(!x)for(;k>_.lastLen&&g[k-1]==="_";)k--;let y=Math.max(_.lastLen-1,0),S=ql(g.slice(y,k)).slice(_.lastLen-y);S&&it(_.parser,S),_.lastLen=k,_.lastText=g.slice(0,k),x&&(An(_.parser),_.renderer?.finish())}),f=new MutationObserver(()=>T_(i));f.observe(i,{childList:!0,subtree:!0}),T_(i);function v(g){let x=g.target instanceof Element?g.target.closest("a"):null;if(!x||!(x instanceof HTMLAnchorElement))return;let k=x.getAttribute("href")??"";!k||k.startsWith("#")||(g.preventDefault(),window.open(k,"_blank","noopener,noreferrer"))}return i.addEventListener("click",v),()=>{d(),f.disconnect(),i.removeEventListener("click",v)}},[e,t,r,n,o]),F(()=>()=>{a.current?.renderer?.dispose(),a.current=null},[]),l("div",{ref:s})}function ka({text:e}){let t=Ce(()=>oe(e),[e]),r=Ce(()=>oe(!0),[]);return l(Oo,{textSig:t,doneSig:r})}var wa="\uE000",vb=/([\p{L}\p{N}])(_+)(?=[\p{L}\p{N}])/gu;function C_(e){if((e.match(/^[ \t]*`{3,}/gm)?.length??0)%2===0)return 0;let t=e.trimEnd(),r=t.lastIndexOf(`
|
|
62
|
-
`)+1;return/^[ \t]*`{3,}[^`]*$/.test(t.slice(
|
|
63
|
+
`))!==-1;){let l=r.slice(0,s);r=r.slice(s+2),yield l}}}finally{n.releaseLock()}}function Ab(e,t){let n="",r;for(let o of e.split(`
|
|
64
|
+
`))if(o!==""){if(o.startsWith(":")){t?.(o.slice(1).trim());continue}if(o.startsWith("data:")){let i=o.slice(5).replace(/^ /,"");n=n?`${n}
|
|
65
|
+
${i}`:i;continue}o.startsWith("id:")&&(r=o.slice(3).trim())}if(n==="[DONE]")return"done";if(!n)return null;try{let o=JSON.parse(n);if(!Ib(o))throw new TypeError("unrecognized chunk");return Lp.trace("chunk",{type:o.type,eventId:r}),{chunk:o,eventId:r}}catch(o){throw Lp.trace("frame parse failed",{errorType:o instanceof Error?o.name:typeof o,payloadLength:n.length}),new Le("invalid SSE frame","network",void 0,o)}}function Ib(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof Reflect.get(e,"type")=="string"}var Eb=new Set([101,204,205,304]);function Mb(e){let t=new Headers;for(let n of e.trim().split(/[\r\n]+/)){let r=n.indexOf(":");r>0&&t.append(n.slice(0,r).trim(),n.slice(r+1).trim())}return t}function Np(e){return async function(n,r){let o=new Request(n,r),i=await o.blob();return new Promise((s,l)=>{if(o.signal.aborted){l(o.signal.reason);return}let c=new XMLHttpRequest;c.open(o.method,o.url),c.withCredentials=o.credentials==="include",c.responseType="blob",o.headers.forEach((u,p)=>c.setRequestHeader(p,u)),c.upload.addEventListener("progress",u=>{u.lengthComputable&&u.total>0&&e(u.loaded/u.total)}),c.addEventListener("load",()=>{s(new Response(Eb.has(c.status)?null:c.response,{status:c.status,statusText:c.statusText,headers:Mb(c.getAllResponseHeaders())}))}),c.addEventListener("error",()=>l(new TypeError("Failed to fetch"))),c.addEventListener("abort",()=>l(o.signal.reason)),o.signal.addEventListener("abort",()=>c.abort(),{once:!0}),c.send(i)})}}var We=oe.scope("transport"),Lb="x-user-token",Ob="x-continue-link";async function Il(e){try{let t=await e.clone().json();if(typeof t!="object"||t===null)return{};let n=Reflect.get(t,"error");return{error:typeof n=="string"?n:void 0,loginUrl:Ii(Reflect.get(t,"login")).url}}catch{return{}}}var $p=6e4,Nb=1e4,El=50,jp=new WeakMap;function wr(e){return jp.get(e)}function vo(e,t){return jp.set(e,t),e}function Dp(e){return Math.max(e?.upsertRevision??0,e?.read?.revision??0)}function $b(e,t){return e.conversationId===t.conversationId&&e.title===t.title&&e.lastMessageAt===t.lastMessageAt&&e.preview===t.preview&&e.hasUnread===t.hasUnread&&e.controlState===t.controlState}function sn(e,t,n=!0){switch(t.type){case"snapshot":{let r=new Map(e.map(s=>[s.conversationId,s])),o=e.filter(s=>(wr(s)?.activityRevision??0)>t.requestedRevision).toSorted((s,l)=>(wr(l)?.activityRevision??0)-(wr(s)?.activityRevision??0)),i=new Set(o.map(s=>s.conversationId));return[...o,...t.result.conversations.filter(s=>!i.has(s.conversationId)).map(s=>{let l=r.get(s.conversationId);if(!l)return s;let c=wr(l);return(c?.upsertRevision??0)>t.requestedRevision?l:c?.read&&!l.hasUnread&&c.read.lastMessageAt===s.lastMessageAt?vo({...s,hasUnread:!1},{upsertRevision:0,read:c.read}):s})]}case"read":{let r=e.findIndex(c=>c.conversationId===t.conversationId&&(t.lastMessageAt===void 0||c.lastMessageAt===t.lastMessageAt)),o=e[r];if(!o)return e;let i=wr(o);if(Dp(i)>t.revision)return e;let s=t.lastMessageAt??o.lastMessageAt,l={upsertRevision:i?.upsertRevision??0,...i?.activityRevision===void 0?{}:{activityRevision:i.activityRevision},read:{revision:t.revision,...s?{lastMessageAt:s}:{}}};return o.hasUnread?e.map((c,u)=>u===r?vo({...c,hasUnread:!1},l):c):(vo(o,l),e)}case"upsert":{let r=e.findIndex(u=>u.conversationId===t.conversation.conversationId);if(r<0&&!n)return e;let o=e[r],i=o?wr(o):void 0;if(Dp(i)>t.revision)return e;let s=t.activity?t.revision:i?.activityRevision,l={upsertRevision:t.revision,...s===void 0?{}:{activityRevision:s},...!t.conversation.hasUnread&&i?.read?{read:i.read}:{}},c=o?{...o,...t.conversation,title:o.title}:{...t.conversation};return o&&$b(o,c)?(vo(o,l),e):(vo(c,l),t.activity?[c,...e.filter(u=>u.conversationId!==c.conversationId)]:o?e.map((u,p)=>p===r?c:u):[...e,c])}default:return t}}var Bp=3,Db=400,Bb=3e4,Ub=6e4,zb=1e4,Fb=6e4,qb=15e3,Hb=1024*1024,Up=new Set([408,425,429,500,502,503,504]);function zp(e){return Db*2**e+Math.floor(Math.random()*250)}function jb(e){return Fb+Math.ceil(e/Hb)*qb}function Vb(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}var bo=class{constructor(t){Z(this,"ttlMs",t);Z(this,"map",new Map)}getOrFetch(t,n){let r=this.map.get(t);if(r&&performance.now()-r.at<this.ttlMs)return r.result;let o={at:performance.now(),result:n().then(i=>(o.value=i,i)).catch(i=>{throw this.map.get(t)===o&&this.map.delete(t),i})};return this.map.set(t,o),o.result}peek(t){let n=this.map.get(t);if(n?.value!==void 0&&performance.now()-n.at<this.ttlMs)return n.value}update(t){for(let n of this.map.values()){if(n.value!==void 0){let r=t(n.value);n.value=r,n.result=Promise.resolve(r);continue}n.result=n.result.then(r=>{let o=t(r);return n.value=o,o})}}delete(t){this.map.delete(t)}};function Fp(e,t){let{translations:n,defaultLocale:r,...o}=$n(e,t);return o}var ia=class{constructor(t){Z(this,"opts",t);Z(this,"conversationListeners",new Set);Z(this,"conversationRevision",0);Z(this,"visitorId");Z(this,"conversationId");Z(this,"userContext");Z(this,"pageContext");Z(this,"locale");Z(this,"userTokenSource");Z(this,"userToken");Z(this,"userTokenRequest");Z(this,"conversationsCache",new bo(Nb));Z(this,"contentCache",new bo($p));Z(this,"contentCollectionsCache",new bo($p))}setUserToken(t){this.userTokenSource=t,this.userToken=typeof t=="string"&&t||void 0,this.userTokenRequest=typeof t=="function"?this.fetchUserToken():void 0,this.opts.onLoginState?.(t?{status:"pending"}:{status:"anonymous"})}async userSub(){return this.userTokenRequest&&await this.userTokenRequest,this.userToken?xu(this.userToken):void 0}reportLogin(t){this.opts.onLoginState?.(t==="loggedIn"&&this.userToken?{status:t,...Pu(this.userToken)}:{status:t==="loggedIn"?"anonymous":t})}async refreshUserToken(){let t=this.userToken;return typeof this.userTokenSource!="function"?!1:(this.userTokenRequest&&await this.userTokenRequest,this.userToken===t&&await this.fetchUserToken(),!!this.userToken&&this.userToken!==t)}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:mi};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=Al(this.userContext,this.pageContext);return n&&(t[vl]=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,o]of Object.entries(this.envelope()))n.searchParams.has(r)||n.searchParams.set(r,o);return n.toString()}async handshake(t){We.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=an("handshake",await this.postJson(_t.handshake,t,"handshake"),Hp),r=n.loginStatus==="expired"&&await this.refreshUserToken()?an("handshake",await this.postJson(_t.handshake,t,"handshake"),Hp):n;return this.reportLogin(r.loginStatus??(this.userToken?"loggedIn":"anonymous")),We.debug("handshake \u2190",{visitorId:r.visitorId,conversationId:r.conversationId,hasWelcome:!!r.welcome,hasConfig:!!r.config,rebind:r.rebind}),this.visitorId=r.visitorId,this.conversationId=r.conversationId,r}async uploadFile(t,n,r){We.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let o=new FormData;o.append("file",t,t.name);let i=an("upload",await this.postForm(this.uploadPath,o,"upload",n,jb(t.size),r),Kb);return We.debug("uploadFile \u2190",{id:i.id,url:i.url}),i}async transcribe(t,n="audio/webm"){We.debug("transcribe \u2192",{size:t.size,mimeType:n});let r=new FormData;r.append("audio",t,`voice.${Wb(n)}`),r.append("mimeType",n);let o=an("transcribe",await this.postForm(this.transcribePath,r,"transcribe"),Qb);return We.debug("transcribe \u2190",{textLen:o.text.length}),o}subscribeConversationChanges(t){return this.conversationListeners.add(t),()=>this.conversationListeners.delete(t)}publishConversation(t,n=!1){let r={type:"upsert",conversation:t,revision:++this.conversationRevision,...n?{activity:!0}:{}};this.conversationsCache.update(o=>{let i=o.pagination.page===1,s=o.conversations.some(_=>_.conversationId===t.conversationId),l=sn(o.conversations,r,i&&n),c=i&&l.length>o.pagination.limit?l.slice(0,o.pagination.limit):l;if(!i||!n||s||o.pagination.hasNext)return c===o.conversations?o:{...o,conversations:c};let u=Math.max(o.pagination.total,o.conversations.length)+1,p=Math.ceil(u/o.pagination.limit);return{...o,conversations:c,pagination:{...o.pagination,total:u,totalPages:p,hasNext:o.pagination.page<p}}});for(let o of this.conversationListeners)o(r)}localeCacheKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){return this.conversationsCache.peek(this.localeCacheKey(t))}listConversations(t={},n=!1){if((t.page??1)>1)return this.fetchConversations(t);let r=this.localeCacheKey(t),o=this.conversationRevision;n&&this.conversationsCache.delete(r);let i=this.conversationsCache.getOrFetch(r,()=>this.fetchConversations(t));return n?i.then(s=>{let l={type:"snapshot",result:s,requestedRevision:o};for(let c of this.conversationListeners)c(l);return s}):i}async fetchConversations(t){let n=new URL(this.url(_t.listConversations));return t.visitorId&&n.searchParams.set("visitorId",t.visitorId),t.page&&n.searchParams.set("page",String(t.page)),t.limit&&n.searchParams.set("limit",String(t.limit)),t.ids?.length&&n.searchParams.set("ids",t.ids.join(",")),an("listConversations",await this.getJson(n.toString(),"listConversations"),Yb)}async loadConversation(t,{ids:n=[],beforeId:r,beforeCreatedAt:o}={}){let i=new URL(this.url(_t.listMessages));i.searchParams.set("conversationId",t),i.searchParams.set("limit",String(El)),n.length>0&&i.searchParams.set("ids",n.join(",")),r&&i.searchParams.set("beforeId",r),o&&i.searchParams.set("beforeCreatedAt",o);let s=an("loadConversation",await this.getJson(i.toString(),"loadConversation"),Jb);return{...s,messages:s.messages.toReversed()}}async markRead(t,n){if(!this.visitorId||!t)return;let r={type:"read",conversationId:t,...n===void 0?{}:{lastMessageAt:n},revision:++this.conversationRevision};this.conversationsCache.update(o=>{let i=sn(o.conversations,r);return i===o.conversations?o:{...o,conversations:i}});for(let o of this.conversationListeners)o(r);try{await this.postJson(_t.markRead,{conversationId:t},"markRead",!0)}catch(o){We.debug("markRead failed (non-fatal)",{err:o})}}async requestOperator(){if(!(!this.visitorId||!this.conversationId))try{return qp("requestOperator",await this.postJson(_t.requestOperator,{},"requestOperator"))}catch(t){We.debug("requestOperator failed (non-fatal)",{err:t});return}}async emailTranscript(t){return an("emailTranscript",await this.postJson(_t.emailTranscript,{email:t},"emailTranscript"),Xb)}async cancelOperatorRequest(){if(!(!this.visitorId||!this.conversationId))try{return qp("cancelOperatorRequest",await this.postJson(_t.cancelOperatorRequest,{},"cancelOperatorRequest"))}catch(t){We.debug("cancelOperatorRequest failed (non-fatal)",{err:t});return}}listContent(t={}){return this.contentCache.getOrFetch(JSON.stringify(t,Object.keys(t).toSorted()),()=>this.fetchContent(t)).then(n=>({...n,items:n.items.map(r=>Fp(r,this.locale))}))}async fetchContent(t){let n=new URL(this.dataUrl(_t.content));for(let[o,i]of Object.entries(t))i!==void 0&&n.searchParams.set(o,Array.isArray(i)?i.join(","):String(i));let r=an("listContent",await this.getJson(n.toString(),"listContent"),Zb);return{...r,items:r.items??[]}}async setContentVote(t){try{await this.postJson(this.dataUrl(_t.contentVoteSet),t,"setContentVote")}catch{}}listContentCollections(t){return this.contentCollectionsCache.getOrFetch(t.join(","),()=>this.fetchContentCollections(t)).then(n=>({items:n.items.map(r=>Fp(r,this.locale))}))}async fetchContentCollections(t){let n=new URL(this.dataUrl(_t.contentCollections));return t.length&&n.searchParams.set("ids",t.join(",")),{items:an("listContentCollections",await this.getJson(n.toString(),"listContentCollections"),ey).items??[]}}async saveUserPrefs(t){await this.postJson(_t.updateSettings,{userPrefs:t},"saveUserPrefs")}get uploadPath(){return this.opts.endpoints?.upload??"/pai/upload-file"}get transcribePath(){return this.opts.endpoints?.transcribe??"/pai/transcribe-audio"}async submitFeedback(t){We.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson(_t.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){We.debug("submitFeedback failed (non-fatal)",{err:n})}}async sendTurn(t,n={}){We.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageCount:t.messages.length});let r=JSON.stringify({...this.withEnvelope(t),[vl]:Al(this.userContext,this.pageContext,this.opts.recentHostEvents)}),o=n.keepalive===!0&&new Blob([r]).size<Ub;try{return await this.runWithAbort(async i=>{let s=await this.withFreshUserToken(()=>this.fetchImpl(this.url(_t.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"application/json","content-type":"application/json",...this.headersFor(this.url(_t.streamMessage))},body:r,keepalive:o,signal:i}));if(s.status!==202)throw new Le(`sendTurn failed: expected 202, received ${s.status}`,"server",s.status,void 0,ty(s),(await Il(s)).error);let l;try{l=await s.json()}catch(c){throw i?.aborted?c:new Le("sendTurn failed: invalid acknowledgement","server",s.status,c)}if(!Gb(l))throw new Le("sendTurn failed: invalid acknowledgement","server",s.status);return l},void 0,Bb)}catch(i){throw i instanceof Le?i:new Le("sendTurn failed: network error","network",void 0,i)}}cancelTurn(t,n){!this.visitorId||!t||!n||(We.debug("cancel stream",{conversationId:t,runId:n,visitorId:this.visitorId}),this.fetchImpl(this.url(_t.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.headersFor(this.url(_t.cancelStream))},body:JSON.stringify(this.withEnvelope({conversationId:t,runId:n})),keepalive:!0}).catch(r=>We.debug("cancel POST failed (non-fatal)",{err:r})))}async connectResumeStream(t){let n=new AbortController;function r(){return n.abort(t.signal.reason)}t.signal.aborted?r():t.signal.addEventListener("abort",r,{once:!0});let o=setTimeout(()=>n.abort(),zb);function i(){clearTimeout(o),t.signal.removeEventListener("abort",r)}let s;try{s=await this.withFreshUserToken(()=>this.fetchImpl(this.resumeUrl(),{method:"GET",credentials:"omit",cache:"no-store",headers:{accept:"text/event-stream",...this.headersFor(this.resumeUrl())},signal:n.signal}))}catch(c){return i(),t.signal.aborted||We.debug("resume-stream fetch failed \u2014 reconnecting",{err:c}),"held"}if(!s.ok)return i(),s.status===409||Up.has(s.status)?(We.debug("resume-stream \u2192 transient response; reconnecting",{status:s.status}),"held"):(We.debug("resume-stream \u2192 endpoint unavailable",{status:s.status}),"unavailable");if(!s.body)return i(),We.debug("resume-stream \u2192 bodyless response; stopping",{status:s.status}),"unavailable";if(!(s.headers.get("content-type")??"").includes("text/event-stream"))return i(),We.debug("resume-stream \u2192 non-SSE response; stopping"),"unavailable";let l=!1;try{for await(let{chunk:c}of Op(s,n.signal,u=>{l||u!=="connected"||(l=!0,clearTimeout(o),t.onConnected())})){if(t.signal.aborted)return"held";t.onChunk(c)}}catch(c){if(t.signal.aborted)return"held";We.debug("resume-stream segment dropped \u2014 reconnecting",{err:c})}finally{i()}return"held"}resumeUrl(){return this.withEnvelopeQuery(_t.streamResume)}async postJson(t,n,r,o=!1){let i=await this.fetchWithRetry(()=>[this.url(t),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.headersFor(this.url(t))},body:JSON.stringify(this.withEnvelope(n)),...o?{keepalive:!0}:{}}],r);return this.assertOk(i,r)}async postForm(t,n,r,o,i,s){let l=s?Np(s):this.fetchImpl;return this.runWithAbort(async c=>{let u=await this.withFreshUserToken(()=>l(this.url(t),{method:"POST",credentials:"omit",headers:this.headersFor(this.url(t)),body:this.appendEnvelope(n),signal:c}));return this.assertOk(u,r)},o,i)}async runWithAbort(t,n,r){if(!n&&r===void 0)return t();let o=new AbortController;function i(){return o.abort(n?.reason)}n?.aborted?i():n?.addEventListener("abort",i,{once:!0});let s=r===void 0?void 0:setTimeout(()=>o.abort(),r);try{return await t(o.signal)}finally{s!==void 0&&clearTimeout(s),n?.removeEventListener("abort",i)}}async getJson(t,n){let r=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.headersFor(this.url(t))}}],n);return this.assertOk(r,n)}async fetchWithRetry(t,n){for(let r=0;;r++){let o;try{o=await this.withFreshUserToken(()=>this.fetchImpl(...t()))}catch(s){if(r>=Bp)throw new Le(`${n} failed: network error`,"network",void 0,s);We.debug("request network error \u2014 retrying",{label:n,attempt:r}),await Xn(zp(r));continue}if(o.ok||!Up.has(o.status)||r>=Bp)return o;let i=Vb(o.headers)??zp(r);We.debug("request retryable status \u2014 retrying",{label:n,status:o.status,attempt:r,wait:i}),await Xn(i)}}async assertOk(t,n){if(!t.ok)throw new Le(`${n} failed: ${t.status}`,"server",t.status,void 0,void 0,(await Il(t)).error);return await t.json()}fetchUserToken(){let t=this.userTokenSource;if(typeof t!="function")return Promise.resolve();let n=Promise.resolve().then(t).then(r=>{this.userTokenSource===t&&(this.userToken=r||void 0)},r=>{We.warn("userToken function failed",{err:r}),this.userTokenSource===t&&(this.userToken=void 0)});return this.userTokenRequest=n,n}headersFor(t){let n=!/^https?:\/\//i.test(t)||t.startsWith(`${this.opts.agentApiBaseUrl}/`);return{...this.opts.auth.headers(),...n&&this.userToken?{[Lb]:this.userToken}:{},...n&&this.opts.continueLink?{[Ob]:this.opts.continueLink}:{}}}async withFreshUserToken(t){this.userTokenRequest&&await this.userTokenRequest;let n=await t();if(n.status!==401)return n;let r=await Il(n);if(r.error==="USER_TOKEN_REQUIRED")return this.opts.onLoginState?.({status:"required",loginUrl:r.loginUrl}),n;if(!this.userToken)return n;if(!await this.refreshUserToken())return this.reportLogin("expired"),n;this.reportLogin("loggedIn");let o=await t();return o.status===401&&this.reportLogin("expired"),o}url(t){return/^https?:\/\//i.test(t)?t:`${this.opts.agentApiBaseUrl}${t}`}dataUrl(t){return`${this.opts.dataApiBaseUrl}${t}`}get fetchImpl(){return this.opts.fetchImpl??globalThis.fetch.bind(globalThis)}};function Wb(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 Gb(e){if(typeof e!="object"||e===null)return!1;let t=Reflect.get(e,"status"),n=Reflect.get(e,"conversationId"),r=Reflect.get(e,"runId");return t==="accepted"&&typeof n=="string"&&n.length>0&&(r===void 0||typeof r=="string"&&r.length>0)}function At(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function an(e,t,n){if(!n(t))throw new Le(`${e} failed: invalid response body`,"server");return t}function qp(e,t){let n=Ji(At(t)?t.controlState:void 0);if(!n)throw new Le(`${e} failed: invalid response body`,"server");return n}function Hp(e){return!(!At(e)||typeof e.visitorId!="string"||typeof e.conversationId!="string"||e.welcome!==void 0&&(!At(e.welcome)||e.welcome.messages!==void 0&&!Array.isArray(e.welcome.messages)))}function Kb(e){return At(e)&&typeof e.id=="string"&&typeof e.url=="string"&&typeof e.originalName=="string"&&typeof e.mimeType=="string"&&typeof e.fileSize=="number"}function Qb(e){return At(e)&&typeof e.text=="string"}function Vp(e){return At(e)&&typeof e.page=="number"&&typeof e.limit=="number"&&typeof e.total=="number"&&typeof e.totalPages=="number"&&typeof e.hasNext=="boolean"&&typeof e.hasPrev=="boolean"}function Yb(e){return At(e)&&Array.isArray(e.conversations)&&e.conversations.every(At)&&Vp(e.pagination)}function Jb(e){return At(e)&&typeof e.conversationId=="string"&&Array.isArray(e.messages)&&e.messages.every(At)}function Xb(e){return At(e)&&typeof e.status=="string"&&typeof e.to=="string"}function Zb(e){return At(e)&&(e.items===void 0||Array.isArray(e.items)&&e.items.every(At))&&(e.pagination===void 0||Vp(e.pagination))}function ey(e){return At(e)&&(e.items===void 0||Array.isArray(e.items)&&e.items.every(At))}function ty(e){let t=Number(e.headers.get("retry-after"));return Number.isInteger(t)&&t>0?t:void 0}function kr(e,t,n){switch(e){case"clear":case"sound":case"history":case"language":case"theme":case"textSize":return!0;case"popOut":return t!=="standalone"&&t!=="page";case"expand":return t==="floating";case"fullscreen":return t!=="standalone";case"close":return t==="standalone"||t==="page"?!1:t==="inline"?n==="fullscreen":!0}}function aa(e,t,n){return kr("close",e,t)?n.includes("close"):!1}function Wp(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}function Cr(e,t,n,r){let o={role:n,text:r};e.emit("message",o),t.onMessage?.(o)}function Gp(e){return Object.fromEntries(e.map(t=>[t,[]]))}function Ml(e,t,n){return e.includes(t)?t:e.includes(n)?n:e[0]??""}function Kp(e,t,n){let r=[...new Set(t)],o=Ml(r,e,""),i=re({activeTab:o,stacks:Gp(r)});return{sig:i,reconcile(s,l){let c=[...new Set(s)],u=i.value,p=Ml(c,u.activeTab,l),_=Object.fromEntries(c.map(f=>[f,u.stacks[f]??[]])),d=p===u.activeTab&&c.length===Object.keys(u.stacks).length&&c.every(f=>u.stacks[f]===_[f]);r=c,!d&&(i.value={activeTab:p,stacks:_},p!==u.activeTab&&p&&n?.(p))},switchTab(s){!(s in i.value.stacks)||i.value.activeTab===s||(i.value={...i.value,activeTab:s},n?.(s))},open(s,l){let c=i.value;s in c.stacks&&(i.value={activeTab:s,stacks:{...c.stacks,[s]:l?[l]:[]}},c.activeTab!==s&&n?.(s))},push(s){let l=i.value,c=l.stacks[l.activeTab]??[];i.value={...l,stacks:{...l.stacks,[l.activeTab]:[...c,s]}}},pop(){let s=i.value,l=s.stacks[s.activeTab]??[];l.length!==0&&(i.value={...s,stacks:{...s.stacks,[s.activeTab]:l.slice(0,-1)}})},reset(s){i.value={activeTab:Ml(r,s,""),stacks:Gp(r)}}}}function Qp(e){return e.stacks[e.activeTab]??[]}function Yp(e){return Qp(e).at(-1)}function Jp(e){return Qp(e).length===0}function yo(e){/^(https?:)?\//i.test(e)&&window.open(e,"_blank","noopener,noreferrer")}function sa(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 ny=900,ry=640;function Ll(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let r=t.initialSize;return r==="expanded"||r==="fullscreen"||r==="normal"?r:n>0&&n<ry?"fullscreen":n>=(t.autoSizeBreakpoint??ny)?"expanded":"normal"}function Po(e,t,n,r=null){let i=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),l=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&r?r:Ll(e.mode,e.size,t);return{panelOpen:i,panelSize:l}}function Tr(){return typeof window>"u"?0:window.innerWidth}var ne={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},la=`${O.cssPrefix}-icon-dir`;function Ol(){return a("svg",{...ne,"aria-hidden":"true",children:a("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})})}function wt(){return a("svg",{...ne,"aria-hidden":"true",children:a("path",{d:"M18 6 6 18M6 6l12 12"})})}function Xp(){return a("svg",{...ne,"aria-hidden":"true",children:a("path",{d:"M12 5v14M5 12h14"})})}function Zp(){return a("svg",{...ne,class:la,"aria-hidden":"true",children:[a("path",{d:"m22 2-7 20-4-9-9-4Z"}),a("path",{d:"M22 2 11 13"})]})}function e_(){return a("svg",{...ne,"aria-hidden":"true",children:a("path",{d:"M12 19V5M5 12l7-7 7 7"})})}function t_(){return a("svg",{...ne,class:la,"aria-hidden":"true",children:a("path",{d:"M3 20V4l18 8-18 8Z"})})}function ca(){return a("svg",{...ne,class:la,"aria-hidden":"true",children:a("path",{d:"m9 18 6-6-6-6"})})}function wn(){return a("svg",{...ne,"aria-hidden":"true",children:a("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function da(){return a("svg",{...ne,"aria-hidden":"true",children:a("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"})})}function n_(){return a("svg",{...ne,"aria-hidden":"true",children:[a("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),a("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]})}function ln(){return a("svg",{...ne,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"8",r:"4.5"}),a("path",{d:"M4.5 20.5a7.5 7.5 0 0 1 15 0"})]})}function r_(){return a("svg",{...ne,"aria-hidden":"true",children:a("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})})}function o_(){return a("svg",{...ne,"aria-hidden":"true",children:a("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})})}function i_(){return a("svg",{...ne,"aria-hidden":"true",children:a("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})})}function a_(){return a("svg",{...ne,"aria-hidden":"true",children:a("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})})}function s_(){return a("svg",{...ne,"aria-hidden":"true",children:[a("path",{d:"M14 3h7v7M21 3l-9 9"}),a("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]})}function l_(){return a("svg",{...ne,"aria-hidden":"true",viewBox:"0 0 10 10",children:a("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})})}function c_(){return a("svg",{...ne,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),a("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),a("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]})}function d_(){return a("svg",{...ne,"aria-hidden":"true",children:a("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})})}function u_(){return a("svg",{...ne,"aria-hidden":"true",children:a("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})})}function p_(){return a("svg",{...ne,"aria-hidden":"true",children:[a("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),a("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]})}function Rr(){return a("svg",{...ne,"aria-hidden":"true",children:a("path",{d:"M20 6 9 17l-5-5"})})}function __(){return a("svg",{...ne,"aria-hidden":"true",children:[a("path",{d:"M3 3v6h6"}),a("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),a("path",{d:"M12 7v5l3 2"})]})}function f_(){return a("svg",{...ne,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("path",{d:"M2 12h20"}),a("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"})]})}function xo(){return a("svg",{...ne,class:la,"aria-hidden":"true",children:a("path",{d:"M19 12H5M12 19l-7-7 7-7"})})}function m_(){return a("svg",{...ne,"aria-hidden":"true",children:[a("path",{d:"M12 20h9"}),a("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}function ua(){return a("svg",{...ne,"aria-hidden":"true",children:[a("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),a("path",{d:"m3 7 9 6 9-6"})]})}function Wt(){return a("svg",{...ne,"aria-hidden":"true",children:a("path",{d:"m6 9 6 6 6-6"})})}function pa(){return a("svg",{...ne,"aria-hidden":"true",children:[a("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),a("path",{d:"M14 2v6h6"})]})}function oy(){return a("svg",{...ne,"aria-hidden":"true",children:[a("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),a("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]})}function Nl(){return a("svg",{...ne,"aria-hidden":"true",children:a("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})})}function So(){return a("svg",{...ne,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),a("path",{d:"M12 17h.01"})]})}function iy(){return a("svg",{...ne,"aria-hidden":"true",children:[a("path",{d:"m15 4 3 3-9 9-3-3z"}),a("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]})}function ay(){return a("svg",{...ne,"aria-hidden":"true",children:[a("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),a("path",{d:"M12 8V4"}),a("circle",{cx:"12",cy:"3",r:"1"}),a("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]})}function sy(){return a("svg",{...ne,"aria-hidden":"true",children:[a("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),a("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),a("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),a("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]})}function ly(){return a("svg",{...ne,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("circle",{cx:"12",cy:"12",r:"4"}),a("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"})]})}function $l(){return a("svg",{...ne,"aria-hidden":"true",children:[a("circle",{cx:"11",cy:"11",r:"7"}),a("path",{d:"m21 21-4.3-4.3"})]})}function g_(){return a("svg",{...ne,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]})}function h_(){return a("svg",{...ne,"aria-hidden":"true",children:[a("path",{d:"M3 9.5 12 3l9 6.5"}),a("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]})}function _a(){return a("svg",{...ne,"aria-hidden":"true",children:[a("path",{d:"m3 11 15-5v12L3 13z"}),a("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),a("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),a("path",{d:"M21 10a3 3 0 0 1 0 4"})]})}function wo(){return a("svg",{...ne,"aria-hidden":"true",children:[a("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),a("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]})}function v_(){return a("svg",{...ne,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"4"}),a("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"})]})}function b_(){return a("svg",{...ne,"aria-hidden":"true",children:a("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})}function y_(){return a("svg",{...ne,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"M12 3v18"}),a("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]})}function cy(){return a("svg",{...ne,"aria-hidden":"true",children:[a("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),a("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),a("path",{d:"m20 20-4.4-4.4"})]})}function dy(){return a("svg",{...ne,"aria-hidden":"true",children:[a("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"}),a("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]})}function uy(){return a("svg",{...ne,"aria-hidden":"true",children:[a("path",{d:"M4 18h16"}),a("path",{d:"M5 18a7 7 0 0 1 14 0"}),a("path",{d:"M12 8V6"}),a("path",{d:"M10 6h4"})]})}function py(){return a("svg",{...ne,"aria-hidden":"true",children:[a("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),a("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),a("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),a("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"})]})}function P_(){return a("svg",{...ne,"aria-hidden":"true",children:[a("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),a("path",{d:"M5 15a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2"})]})}function x_(){return a("svg",{...ne,"aria-hidden":"true",children:[a("path",{d:"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"}),a("path",{d:"M7 10l4-7a2.5 2.5 0 0 1 2.5 2.5V8h5a2 2 0 0 1 2 2.3l-1.2 8A2 2 0 0 1 17.3 20H7"})]})}function S_(){return a("svg",{...ne,"aria-hidden":"true",children:[a("path",{d:"M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1z"}),a("path",{d:"M17 14l-4 7a2.5 2.5 0 0 1-2.5-2.5V16h-5a2 2 0 0 1-2-2.3l1.2-8A2 2 0 0 1 6.7 4H17"})]})}function w_(){return a("svg",{...ne,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"3.5"}),a("path",{d:"M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M19.1 4.9l-2.1 2.1M7 17l-2.1 2.1"})]})}function k_(){return a("svg",{...ne,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"M12 7v5l3 2"})]})}function Zn(){return a("svg",{...ne,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]})}function ko(){return a("svg",{...ne,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"9"}),a("path",{d:"m15 9-6 6M9 9l6 6"})]})}function C_(){return a("svg",{...ne,"aria-hidden":"true",children:a("path",{d:"M12 18V5M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294M17.996 5.125a4 4 0 012.526 5.77M18 18a4 4 0 002-7.465M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517M6 18a4 4 0 01-2-7.465M6.004 5.125a4 4 0 00-2.526 5.77"})})}function Ar(){return a("svg",{...ne,"aria-hidden":"true",children:[a("circle",{cx:"12",cy:"12",r:"10"}),a("path",{d:"M12 8v4M12 16h.01"})]})}var T_={chat:Ol,message:Nl,bubbles:wo,spark:oy,wand:iy,bot:ay,help:So,lifebuoy:ly,headset:sy,search:cy,sparkles:dy,concierge:uy,wave:py};var H=O.cssPrefix,L={launcher:`${H}-launcher`,callout:`${H}-callout`,calloutDismiss:`${H}-callout-dismiss`,panel:`${H}-panel`,panelHeader:`${H}-panel-header`,resizeGrip:`${H}-resize-grip`,scrollToBottom:`${H}-scroll-to-bottom`,loadPreviousMessages:`${H}-load-previous-messages`,actionHistory:`${H}-action-history`,actionClose:`${H}-action-close`,emailTranscriptSheet:`${H}-email-transcript-sheet`,emailTranscriptEmail:`${H}-email-transcript-email`,emailTranscriptSend:`${H}-email-transcript-send`,langSegment:`${H}-lang-segment`,composer:`${H}-composer`,composerInput:`${H}-composer-input`,composerCount:`${H}-composer-count`,composerSend:`${H}-composer-send`,composerStop:`${H}-composer-stop`,compactionStatus:`${H}-compaction-status`,messageQueue:`${H}-message-queue`,queuedMessage:`${H}-queued-message`,queuedMessageRemove:`${H}-queued-message-remove`,composerAttach:`${H}-composer-attach`,composerFileInput:`${H}-composer-file-input`,composerVoice:`${H}-composer-voice`,attachmentChip:`${H}-attachment-chip`,attachmentRemove:`${H}-attachment-remove`,attachmentRetry:`${H}-attachment-retry`,suggestion:`${H}-suggestion`,messageBubble:`${H}-message`,messageRetry:`${H}-message-retry`,messageFile:`${H}-message-file`,messageFeedback:`${H}-message-feedback`,feedbackUp:`${H}-feedback-up`,feedbackDown:`${H}-feedback-down`,messageCopy:`${H}-message-copy`,historyItem:`${H}-history-item`,historyLoadMore:`${H}-history-load-more`,sidebar:`${H}-sidebar`,sidebarToggle:`${H}-sidebar-toggle`,sidebarNewConversation:`${H}-sidebar-new-conversation`,messengerHome:`${H}-messenger-home`,panelNotice:`${H}-panel-notice`,tab:`${H}-tab`,tabBadge:`${H}-tab-badge`,homeView:`${H}-home-view`,homeGreeting:`${H}-home-greeting`,homeBrand:`${H}-home-brand`,backHeader:`${H}-back-header`,contentView:`${H}-content-view`,contentScroll:`${H}-content-scroll`,homeSearch:`${H}-home-search`,helpSearch:`${H}-help-search`,homeRecent:`${H}-home-recent`,homeAsk:`${H}-home-ask`,homeWhatsNew:`${H}-home-whats-new`,homeContentRow:`${H}-home-content-row`,helpArticle:`${H}-help-article`,newsItem:`${H}-news-item`,newsMore:`${H}-news-more`,formField:`${H}-form-field`,toolAskQuestions:`${H}-tool-ask-questions`,toolInputSubmit:`${H}-tool-input-submit`,toolInputSkip:`${H}-tool-input-skip`,toolApproval:`${H}-tool-approval`,toolPreview:`${H}-tool-preview`,toolApprove:`${H}-tool-approve`,toolDecline:`${H}-tool-decline`,toolEdit:`${H}-tool-edit`,toolDecision:`${H}-tool-decision`,typingDots:`${H}-typing-dots`,reasoning:`${H}-reasoning`,replyStopped:`${H}-reply-stopped`,toolAskSummary:`${H}-ask-questions-summary`,toolAskOptions:`${H}-ask-questions-options-toggle`,toolSteps:`${H}-tool-steps`,toolStep:`${H}-tool-step`,source:`${H}-source`,operatorRequest:`${H}-operator-request`,chatNotice:`${H}-chat-notice`,operatorBanner:`${H}-operator-banner`,cancelOperatorRequest:`${H}-cancel-operator-request`,loginBar:`${H}-login-bar`,loginBarAction:`${H}-login-bar-action`,loginBarHide:`${H}-login-bar-hide`,loginGate:`${H}-login-gate`,loginGateAction:`${H}-login-gate-action`,loginGateGuest:`${H}-login-gate-guest`,loggedIn:`${H}-logged-in`};function ft(e,t){return`${e}-${t}`}var fa=O.cssPrefix;function R_({buttonRef:e,onToggle:t,launcher:n,strings:r,leaving:o,edgeTab:i}){let s=n.variant==="circle"?"":_y(n,r);return a("button",{ref:e,type:"button",class:`${fa}-fab`,part:"launcher","data-variant":n.variant,"data-size":n.size,"data-edge-tab":i?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":L.launcher,onClick:t,"aria-label":r.launcherOpen,children:[fy(n.icon),s?a("span",{class:`${fa}-fab-label`,children:s}):null]})}function _y(e,t){return e.label?at(t,e.label):e.personaName?t.launcherAsk.replace("{name}",at(t,e.personaName)):""}function fy(e){let t=T_[e];return t?a(t,{}):a(my,{source:e})}function my({source:e}){return a("span",{ref:t=>{t&&gy(t,e)},"aria-hidden":"true"})}function gy(e,t){if(e.dataset.svgMounted!==t)try{let r=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;r.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(r,!0)),e.dataset.svgMounted=t)}catch{}}function A_({callout:e,launcherPosition:t,strings:n,closeLabel:r,onDismiss:o}){let[i,s]=N(!1),l=D(null),[c,u]=N(!0);return ut(()=>{let p=l.current?.parentElement;if(!p)return;let _=()=>u(window.innerWidth-p.getBoundingClientRect().width>=hy);return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)}),U(()=>{let p=setTimeout(()=>s(!0),e.delayMs);return()=>clearTimeout(p)},[e.delayMs]),U(()=>{if(!i||e.autoDismissMs<=0)return;let p=setTimeout(o,e.autoDismissMs);return()=>clearTimeout(p)},[i,e.autoDismissMs,o]),i?a("div",{ref:l,class:`${fa}-callout`,role:"status","data-shape":e.shape,"data-position":vy(e.position,t,c),"data-animated":e.animated?"true":void 0,"data-testid":L.callout,children:[a("span",{children:at(n,e.text)}),a("button",{type:"button",class:`${fa}-callout-close`,onClick:o,"aria-label":r,title:r,"data-testid":L.calloutDismiss,children:a(wt,{})})]}):null}var hy=200;function vy(e,t,n=!0){let r=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"||e==="auto"&&!n?o?"top":"bottom":r?"left":"right"}var by='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Ir(e){function t(n){if(n.key!=="Tab")return;let r=[...e.querySelectorAll(by)].filter(c=>c.offsetParent!==null||c===document.activeElement);if(r.length===0){n.preventDefault();return}let o=r[0],i=r[r.length-1];if(!o||!i)return;let s=e.getRootNode(),l=s instanceof ShadowRoot?s.activeElement:null;n.shiftKey&&l===o?(n.preventDefault(),i.focus()):!n.shiftKey&&l===i&&(n.preventDefault(),o.focus())}return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}var kn=O.cssPrefix;function ma({title:e,actions:t}){return a("header",{class:`${kn}-back-header`,part:"header","data-variant":"title",children:[a("span",{class:`${kn}-back-spacer`,"aria-hidden":"true"}),a("h1",{class:`${kn}-back-title`,children:e}),t??a("span",{class:`${kn}-back-spacer`,"aria-hidden":"true"})]})}function I_({title:e,backLabel:t,onBack:n,actions:r,testid:o}){return a("header",{class:`${kn}-back-header`,part:"header","data-testid":o,children:[a("button",{type:"button",class:`${kn}-icon-btn`,onClick:n,"aria-label":t,title:t,children:a(xo,{})}),a("h1",{class:`${kn}-back-title`,children:e}),r??a("span",{class:`${kn}-back-spacer`,"aria-hidden":"true"})]})}function Co({textSig:e,doneSig:t,generativeUi:n=!1,strings:r=ii,onCardAction:o}){let i=D(null),s=D(null);return ut(()=>{let l=i.current;if(!l)return;l.classList.add(`${O.cssPrefix}-md`);let c=s.current,u={generativeUi:n,strings:r,onCardAction:o},p=()=>{s.current?.renderer?.dispose();let m=document.createElement("div"),b=n?yp(m,{cssPrefix:O.cssPrefix,strings:r,onAction:o}):void 0,w=io(Ey(Ny(b??Mi(m)))),y=e.value,P=y.length-E_(y);if(!t.value)for(;P>0&&y[P-1]==="_";)P--;let C=Dl(y.slice(0,P));return C&&Qe(w,C),t.value&&(yr(w),b?.finish()),l.replaceChildren(m),{settings:u,container:m,parser:w,renderer:b,lastLen:P,lastText:y.slice(0,P)}},_=c&&c.settings.generativeUi===n&&c.settings.strings===r&&c.settings.onCardAction===o&&e.value.startsWith(c.lastText)?c:p();s.current=_;let d=qt(()=>{let m=e.value,b=t.value;if(m.length<_.lastLen){_=p(),s.current=_;return}let w=Math.max(m.length-E_(m),_.lastLen);if(!b)for(;w>_.lastLen&&m[w-1]==="_";)w--;let y=Math.max(_.lastLen-1,0),P=Dl(m.slice(y,w)).slice(_.lastLen-y);P&&Qe(_.parser,P),_.lastLen=w,_.lastText=m.slice(0,w),b&&(yr(_.parser),_.renderer?.finish())}),f=new MutationObserver(()=>M_(l));f.observe(l,{childList:!0,subtree:!0}),M_(l);function v(m){let b=m.target instanceof Element?m.target.closest("a"):null;if(!b||!(b instanceof HTMLAnchorElement))return;let w=b.getAttribute("href")??"";!w||w.startsWith("#")||(m.preventDefault(),window.open(w,"_blank","noopener,noreferrer"))}return l.addEventListener("click",v),()=>{d(),f.disconnect(),l.removeEventListener("click",v)}},[e,t,n,r,o]),U(()=>()=>{s.current?.renderer?.dispose(),s.current=null},[]),a("div",{ref:i})}function ha({text:e}){let t=xe(()=>re(e),[e]),n=xe(()=>re(!0),[]);return a(Co,{textSig:t,doneSig:n})}var ga="\uE000",Iy=/([\p{L}\p{N}])(_+)(?=[\p{L}\p{N}])/gu;function E_(e){if((e.match(/^[ \t]*`{3,}/gm)?.length??0)%2===0)return 0;let t=e.trimEnd(),n=t.lastIndexOf(`
|
|
66
|
+
`)+1;return/^[ \t]*`{3,}[^`]*$/.test(t.slice(n))?e.length-n:0}function Dl(e){return e.replace(Iy,(t,n,r)=>n+ga.repeat(r.length))}function Ey(e){return{...e,add_text:(t,n)=>e.add_text(t,n.replaceAll(ga,"_")),set_attr:(t,n,r)=>e.set_attr(t,n,r.replaceAll(ga,"_"))}}var My=/<(\/?)(?:(Note|Info|Tip|Warning|Danger|Check|Callout)|Tabs?|Steps?|AccordionGroup|Accordion|Expandable|Columns|CardGroup|Card|Frame|CodeGroup|Badge|Icon|Video|Embed|ParamField|ResponseField)\b((?:"[^"]*"|'[^']*'|[^>"'])*?)(\/?)>|(^|\n)([ \t]*)(```[^]*?(?:\n[ \t]*```|$))?/g;function O_(e){let t=0,n="";return e.replace(My,(r,o,i,s,l,c,u,p)=>{if(o===void 0)return t?c+(p?.split(`
|
|
63
67
|
${u}`).join(`
|
|
64
|
-
`)??
|
|
65
|
-
${
|
|
66
|
-
${r}`:"")})}var bb=new Set(["http:","https:","mailto:","tel:"]),Pb=new Set(["http:","https:"]);function xb(e){let t=document.createElement("a");return{...e,set_attr:(r,n,o)=>{if(n!==Rn&&n!==fo||(t.href=o,(n===Rn?bb:Pb).has(t.protocol)))return e.set_attr(r,n,o);let s=n===fo?r.nodes[r.index]:void 0;s?.replaceWith(...s.childNodes)}}}function T_(e){for(let t of e.querySelectorAll("a")){let r=t.getAttribute("href")??"";!r||r.startsWith("#")||(t.target="_blank",t.rel="noopener noreferrer")}}var I_=new Set([11,12,13,14,15,16,17,18,19,31]);function Ca(e){let t="",r=[],n=go({data:void 0,add_token:(o,s)=>{r.push(s),I_.has(s)||(t+=" ")},end_token:()=>{let o=r.pop();o!==void 0&&!I_.has(o)&&(t+=" ")},add_text:(o,s)=>{t+=s},set_attr:()=>{}});return it(n,ql(e)),An(n),t.replaceAll(wa,"_").replace(/\s+/g," ").trim()}var A_=q.cssPrefix;function jt({tone:e="info",message:t,onRetry:r,strings:n}){return l("div",{class:`${A_}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[l("span",{children:t}),r?l("button",{type:"button",class:`${A_}-module-retry`,onClick:r,children:n.errorRetry}):null]})}var qr=q.cssPrefix,Sb=ie.scope("content"),wb=5e3;function E_({id:e,title:t,transport:r,strings:n,bus:o,onBack:s,actions:a}){let[i,c]=U(null),[u,p]=U(!1),[_,d]=U(!1),[f,v]=U(0),[g,x]=U(null),k=j(()=>{d(!1),c(null),v(w=>w+1)},[]);F(()=>{let w=!1,h=r.listContentCollections([]).catch(()=>{});return Promise.all([r.listContent({ids:[e],limit:1}),h]).then(([m,P])=>{if(w)return;let R=m.items[0];R?(c(R),p(P?.items.find(I=>I.id===R.contentCollectionId)?.settings?.voteAccess==="portal"),o.emit("contentOpen",{contentId:e,contentCollectionId:R.contentCollectionId})):d(!0)}).catch(m=>{w||(Sb.warn("listContent (reader) failed",{err:m}),d(!0))}),()=>{w=!0}},[r,e,f,o]),F(()=>{if(!i)return;let w=setTimeout(()=>o.emit("contentRead",{contentId:e}),wb);return()=>clearTimeout(w)},[i,e,o]);let y=j(w=>{let m=(w.target instanceof HTMLElement?w.target.closest("a"):null)?.getAttribute("href")??"";m&&!m.startsWith("#")&&o.emit("contentLinkClick",{contentId:e})},[o,e]);function S(w){x(e),r.setContentVote({contentId:e,value:w})}function b(){return _?l(jt,{tone:"error",message:n.errorGeneric,onRetry:k,strings:n}):i===null?l(jt,{message:n.contentLoading,strings:n}):l("article",{class:`${qr}-content`,"data-testid":D.contentView,onClick:y,children:[i.image?l("img",{class:`${qr}-content-hero`,src:i.image,alt:"",loading:"lazy"}):null,i.description?l("p",{class:`${qr}-content-subtitle`,children:i.description}):null,l(ka,{text:R_(i.content??"")}),u?l("div",{class:`${qr}-content-vote`,"aria-live":"polite",children:g===e?n.feedbackThanks:l(he,{children:[l("span",{children:n.contentHelpful}),l("button",{type:"button",class:`${qr}-module-retry`,onClick:()=>S(1),children:n.confirmYes}),l("button",{type:"button",class:`${qr}-module-retry`,onClick:()=>S(0),children:n.confirmNo})]})}):null]})}return l("div",{class:`${qr}-module`,children:[l(k_,{title:i?.title||t||n.moduleBack,backLabel:n.moduleBack,onBack:s,actions:a,testid:D.backHeader}),l("div",{class:`${qr}-module-scroll`,"data-testid":D.contentScroll,children:b()})]})}function M_({itemCount:e,initialFocusIndex:t}){let[r,n]=U(!1),o=B(null),s=B(null),[a,i]=U(-1),c=j(()=>{n(!1),i(-1),o.current?.focus()},[]),u=j(()=>n(d=>!d),[]);F(()=>{if(!r)return;function d(f){let v=s.current,g=o.current;if(!v||!g)return;let x=f.composedPath();x.includes(v)||x.includes(g)||(n(!1),i(-1))}return document.addEventListener("click",d,!0),()=>document.removeEventListener("click",d,!0)},[r]),F(()=>{if(!r||e===0)return;let d=t?.()??0,f=d<0||d>=e?0:d;i(f)},[r,e,t]),F(()=>{if(!r||a<0)return;s.current?.querySelectorAll("[role='menuitem']")?.[a]?.focus()},[r,a]);let p=j(d=>{(d.key==="ArrowDown"||d.key==="Enter"||d.key===" ")&&(d.preventDefault(),n(!0))},[]),_=j(d=>{if(e!==0)switch(d.key){case"Escape":d.preventDefault(),d.stopPropagation(),c();return;case"ArrowDown":d.preventDefault(),i(f=>(f+1)%e);return;case"ArrowUp":d.preventDefault(),i(f=>(f-1+e)%e);return;case"Home":d.preventDefault(),i(0);return;case"End":d.preventDefault(),i(e-1)}},[e,c]);return{open:r,focusIndex:a,triggerRef:o,menuRef:s,toggle:u,close:c,onTriggerKey:p,onMenuKey:_}}function L_({items:e,triggerLabel:t}){let r=q.cssPrefix,n=M_({itemCount:e.length});function o(i){i.disabled||(i.onSelect?.(),i.keepOpen||n.close())}function s(i,c){return i.onSelectValue?.(c)}function a(i,c){let u=c.segments;if(!u?.length)return;let p=Math.max(0,u.findIndex(f=>f.value===c.value)),_=-1;if(i.key==="ArrowRight"||i.key==="Enter"||i.key===" ")_=(p+1)%u.length;else if(i.key==="ArrowLeft")_=(p-1+u.length)%u.length;else return;let d=u[_];d&&(i.preventDefault(),i.stopPropagation(),s(c,d.value))}return l("div",{class:`${r}-menu-wrap`,children:[l("button",{ref:n.triggerRef,type:"button",class:`${r}-icon-btn`,"aria-label":t,"aria-haspopup":"menu","aria-expanded":n.open,title:t,onClick:n.toggle,onKeyDown:n.onTriggerKey,children:l(o_,{})}),n.open?l("div",{ref:n.menuRef,class:`${r}-menu`,role:"menu","aria-label":t,onKeyDown:n.onMenuKey,tabIndex:-1,children:e.map(i=>i.segments?l("div",{role:"menuitem",class:`${r}-menu-item ${r}-menu-item-segmented`,"aria-label":i.label,tabIndex:-1,onKeyDown:c=>a(c,i),children:[i.icon?l("span",{class:`${r}-menu-icon`,children:i.icon}):null,l("span",{class:`${r}-menu-label`,children:i.label}),l("span",{class:`${r}-segmented`,role:"group","aria-label":i.label,children:i.segments.map(c=>{let u=c.value===i.value;return l("button",{type:"button",role:"menuitemradio","aria-checked":u,class:`${r}-segment`,"data-on":u?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${D.langSegment}-${c.value}`,onClick:()=>s(i,c.value),children:c.label},c.value)})})]},i.id):l("button",{type:"button",role:"menuitem",class:`${r}-menu-item`,"aria-pressed":i.type==="switch"?i.on:void 0,disabled:i.disabled,onClick:()=>o(i),children:[i.icon?l("span",{class:`${r}-menu-icon`,children:i.icon}):null,l("span",{class:`${r}-menu-label`,children:i.label}),i.type==="switch"&&i.on?l("span",{class:`${r}-menu-check`,"aria-hidden":"true",children:l(qn,{})}):null]},i.id))}):null]})}var Ul=q.cssPrefix;function kb(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 Cb={normal:"large",large:"small",small:"normal"};function Tb(e){return e==="light"?l(__,{}):e==="dark"?l(f_,{}):l(m_,{})}function Ib(e,t){let r=e.split("-")[0];return(t.some(o=>o!==e&&o.split("-")[0]===r)?e:r??e).toUpperCase()}function Rb(e,t){let r;try{r=new URL(e,window.location.href)}catch{return}if(!(r.protocol!=="http:"&&r.protocol!=="https:"))return t.conversationId&&r.searchParams.set("chat",t.conversationId),r.searchParams.set("widgetId",t.widgetId),t.publicKey&&r.searchParams.set("public_key",t.publicKey),r.searchParams.set("ai_agent_deployment_id",t.aiAgentDeploymentId),r.href}function dr({panelProps:e,variant:t,onEmailTranscript:r,onLogIn:n}){let{options:o,panelSize:s,feedback:a,onClose:i,onClear:c,onExpand:u,onFullscreen:p,onSoundToggle:_}=e,{onToggleHistory:d,onLocaleChange:f,onThemeChange:v,onTextSizeChange:g}=e,x=o.strings,k=o.mode,y=t==="chat",S=Rt(()=>a.mutedSig.value).value,b=new Set(o.actions);function w(z){return b.has(z)}let h=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches;function m(z){return h?!1:On(z,k,s)}let P=o.themeMode,R={auto:x.themeAuto,light:x.themeLight,dark:x.themeDark},I=o.textSize,A={small:x.textSizeSmall,normal:x.textSizeNormal,large:x.textSizeLarge},C=[];if(y&&w("clear")&&C.push({id:"clear",icon:l(d_,{}),label:x.newConversation,onSelect:c}),y&&r&&C.push({id:"emailTranscript",icon:l(ya,{}),label:x.emailTranscript,onSelect:r}),y&&n&&C.push({id:"logIn",icon:l(xr,{}),label:x.loginAction,onSelect:n}),w("expand")&&m("expand")){let z=s==="expanded";C.push({id:"expand",icon:z?l(Zp,{}):l(Xp,{}),label:z?x.collapse:x.expand,type:"switch",on:z,onSelect:u})}if(w("fullscreen")&&m("fullscreen")){let z=s==="fullscreen";C.push({id:"fullscreen",icon:z?l(t_,{}):l(e_,{}),label:z?x.exitFullscreen:x.fullscreen,type:"switch",on:z,onSelect:p})}let M=o.popOutUrl,N=o.aiAgentDeploymentId;w("popOut")&&M&&N&&On("popOut",k,s)&&C.push({id:"popOut",icon:l(r_,{}),label:x.popOut,onSelect:()=>{let z=Rb(M,{conversationId:e.conversationId,widgetId:o.widgetId,publicKey:o.publicKey,aiAgentDeploymentId:N});z&&window.open(z,"_blank","noopener,noreferrer")}}),y&&w("sound")&&C.push({id:"sound",icon:S?l(a_,{}):l(i_,{}),label:S?x.soundOff:x.soundOn,type:"switch",on:!S,onSelect:_}),w("theme")&&P!=="host"&&C.push({id:"theme",icon:Tb(P),label:`${x.theme}: ${R[P]}`,onSelect:()=>v(kb(P)),keepOpen:!0}),w("textSize")&&C.push({id:"textSize",icon:l(s_,{}),label:`${x.textSize}: ${A[I]}`,onSelect:()=>g(Cb[I]),keepOpen:!0}),w("language")&&o.availableLocales.length>1&&C.push({id:"language",icon:l(c_,{}),label:x.language,segments:o.availableLocales.map(z=>({value:z,label:Ib(z,o.availableLocales),lang:z})),value:o.locale,onSelectValue:f});let H=!!i&&fa(k,s,o.actions),G=y&&w("history");return l("div",{class:`${Ul}-header-actions`,children:[G?l("button",{type:"button",class:`${Ul}-icon-btn`,onClick:d,"aria-label":x.history,title:x.history,"data-testid":D.actionHistory,children:l(l_,{})}):null,C.length>0?l(L_,{items:C,triggerLabel:x.moreActions}):null,H?l("button",{type:"button",class:`${Ul}-icon-btn`,onClick:i,"aria-label":x.close,title:x.close,"data-testid":D.actionClose,children:l(Dt,{})}):null]})}var N_={Icon:Lo};function Sr(e,t){return e instanceof qe?e.status===429?e.retryAfterSeconds?t.errorRateLimitedIn.replace("{seconds}",String(e.retryAfterSeconds)):t.errorRateLimited:e.code==="network"?t.errorOffline:e.status===403?t.errorOriginNotAllowed:e.errorCode==="MESSAGE_TOO_LONG"?t.errorMessageTooLong:e.status!==void 0&&e.status>=500?t.errorServer:t.errorGeneric:t.errorGeneric}var zn=q.cssPrefix;function O_({placeholder:e,onActivate:t}){return l("button",{type:"button",class:`${zn}-home-search`,onClick:t,"data-testid":D.homeSearch,children:[l("span",{class:`${zn}-home-search-text`,children:e}),l("span",{class:`${zn}-home-search-icon`,"aria-hidden":"true",children:l(Dl,{})})]})}function $_({placeholder:e,value:t,onInput:r}){return l("div",{class:`${zn}-home-search`,"data-input":"true",children:[l("input",{type:"search",class:`${zn}-home-search-input`,placeholder:e,value:t,maxLength:200,onInput:n=>r(n.currentTarget.value),"data-testid":D.helpSearch}),l("span",{class:`${zn}-home-search-icon`,"aria-hidden":"true",children:l(Dl,{})})]})}var $o=q.cssPrefix;function Ta({title:e,subtitle:t,onClick:r,testid:n}){return l("button",{type:"button",class:`${$o}-list-row`,onClick:r,"data-testid":n,children:[l("span",{class:`${$o}-list-row-body`,children:[l("span",{class:`${$o}-list-row-title`,children:e}),t?l("span",{class:`${$o}-list-row-sub`,children:t}):null]}),l("span",{class:`${$o}-list-row-chevron`,"aria-hidden":"true",children:l(va,{})})]})}var ur=q.cssPrefix,Ab=ie.scope("help"),Eb=20,Mb=300;function Lb(e,t,r){let n=new Map(r.map(o=>[o.id,o.title]));return t.map(o=>({id:o,title:n.get(o),rows:e.filter(s=>s.contentCollectionId===o)})).filter(o=>o.rows.length>0)}function D_({transport:e,strings:t,bus:r},n,o){let[s,a]=U(),i=B(void 0),c=n?.join(",");function u(p){if(!n?.length)return;let _={};i.current=_,a(d=>({search:o,items:[],collections:[],...d,pagination:p>1?d?.pagination:void 0,loading:!0,error:void 0})),Promise.all([e.listContent({contentCollectionIds:n,sortBy:"order",page:p,limit:Eb,search:o}),p>1?void 0:e.listContentCollections(n)]).then(([d,f])=>{i.current===_&&(a(v=>({search:o,items:[...p>1?v?.items??[]:[],...d.items],collections:f?.items??v?.collections??[],pagination:d.pagination,loading:!1})),!(p>1)&&(o?r.emit("contentSearch",{queryLength:o.length,hitCount:d.pagination.total}):r.emit("contentView",{section:"help",count:d.items.length})))}).catch(d=>{i.current===_&&(Ab.warn("listContent (help) failed",{err:d,page:p}),a(f=>f&&{...f,loading:!1,error:Sr(d,t)}))})}return F(()=>{if(!n?.length){a(void 0);return}return u(1),()=>{i.current=void 0}},[e,c,o]),[s,()=>!s?.loading&&u((s?.pagination?.page??0)+1)]}function Nb(e){let{strings:t,config:r,nav:n,panelProps:o}=e,s=r.contentCollectionIds,[a,i]=U(""),[c,u]=U(""),p=D_(e,s),_=D_(e,c?s:void 0,c),[d,f]=a.trim()?_:p;F(()=>{let g=setTimeout(()=>u(a.trim()),Mb);return()=>clearTimeout(g)},[a]);function v(){if(!s?.length)return l(jt,{message:t.helpEmpty,strings:t});let g=d?.error?l(jt,{tone:"error",message:d.error,onRetry:f,strings:t}):null;return g&&!d?.pagination?g:!d||!d.pagination&&!d.items.length?l(jt,{message:t.helpLoading,strings:t}):d.items.length?l(he,{children:[Lb(d.items,s,d.collections).map(x=>l("section",{class:`${ur}-help-group`,children:[x.title?l("h2",{class:`${ur}-help-section-title`,children:x.title}):null,l("div",{class:`${ur}-help-card`,children:x.rows.map(k=>l(Ta,{title:k.title,subtitle:k.description,onClick:()=>k.url?Ro(k.url):n.push({kind:"content",id:k.id,title:k.title}),testid:Ct(D.helpArticle,k.id)},k.id))})]},x.id)),g,d.pagination?.hasNext&&!g?l("div",{children:l("div",{class:`${ur}-help-card`,children:l("button",{type:"button",class:`${ur}-list-row ${ur}-help-more`,onClick:f,"aria-busy":d.loading,children:[d.loading?l("span",{class:`${ur}-loading-spinner`,"aria-hidden":"true"}):null,t.helpShowMore]})})}):null]}):l(jt,{message:d.search?t.helpSearchEmpty.replace("{query}",d.search):t.helpEmpty,strings:t})}return l("div",{class:`${ur}-module`,children:[l(Sa,{title:t.helpTitle,actions:l(dr,{panelProps:o,variant:"plain"})}),l("div",{class:`${ur}-module-pad`,children:l($_,{placeholder:t.helpSearchPlaceholder,value:a,onInput:i})}),l("div",{class:`${ur}-help-list`,children:v()})]})}var q_={Icon:Mo,Root:e=>l(Nb,{...e})};var U_=ie.scope("attachments");function Ia(e,t,r){let n=$b(e),o=[],s=[],a=z_(r.accept),i=t.reduce((u,p)=>u+p.size,0),c=t.length;for(let u of n){let p=Ob(u,c,i,r,a);if(p){s.push({file:u,reason:p});continue}o.push(Bb(u)),i+=u.size,c+=1}return(o.length||s.length)&&U_.debug("ingest",{accepted:o.length,rejected:s.map(u=>({name:u.file.name,reason:u.reason}))}),{accepted:o,rejected:s}}function Fn(e){let t=Math.min(Math.floor(Math.log10(Math.max(e,1))/3),2);return new Intl.NumberFormat(void 0,{style:"unit",unit:["byte","kilobyte","megabyte"][t],unitDisplay:"narrow",maximumFractionDigits:1}).format(e/1e3**t)}function B_(e,t){let r=z_(t);return!e||r.length===0||r.some(n=>n.kind==="ext"||F_(new File([],"",{type:e}),[n]))}function Hn(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){U_.debug("revokeObjectURL failed",{error:t})}}function Ob(e,t,r,n,o){return t>=n.maxCount?"count":r+e.size>n.maxBytes?"bytes":F_(e,o)?null:"mime"}function $b(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:Db(t)).filter(t=>t!==null):[]}function Db(e){let t=qb(e)?e:null;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function qb(e){return Ub(e)&&(e.getAsFile===void 0||typeof e.getAsFile=="function")}function Ub(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Bb(e){return{file:e,id:Wt(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function z_(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean).map(t=>{if(t.startsWith("."))return{kind:"ext",ext:t};let[r="*",n="*"]=t.split("/");return{kind:"mime",type:r,subtype:n}})}function F_(e,t){if(t.length===0)return!0;let[r="*",n="*"]=(e.type||"").toLowerCase().split("/"),o=(e.name||"").toLowerCase();return t.some(s=>s.kind==="ext"?o.endsWith(s.ext):s.type==="image"&&s.subtype==="*"&&/\.(heic|heif|avif|bmp|tif|tiff)$/.test(o)?!0:(s.type==="*"||s.type===r)&&(s.subtype==="*"||s.subtype===n))}var Ur=q.cssPrefix,zb={error:Un,done:qn};function H_({attachment:e,upload:t,strings:r,onRemove:n,disabled:o=!1}){let s=/^image\/(jpeg|png|gif|webp|avif|bmp|x-ms-bmp|svg\+xml)$/i.test(e.mediaType),a=Math.round((t?.fraction??0)*100),i=Fn(e.size),c=t?.status==="error"||t?.status==="done"?zb[t.status]:void 0;return l("span",{class:`${Ur}-attachment-chip`,"data-upload":t?.status,title:e.name,"data-testid":Ct(D.attachmentChip,e.id),children:[s?l("img",{class:`${Ur}-attachment-thumb`,src:e.previewUrl,alt:""}):l("span",{class:`${Ur}-attachment-thumb`,"aria-hidden":"true",children:l(ba,{})}),l("span",{class:`${Ur}-attachment-text`,children:[l("span",{class:`${Ur}-attachment-name`,children:e.name}),l("span",{class:`${Ur}-attachment-meta`,children:[c?l(c,{}):null,t?.status==="uploading"?`${a}% \xB7 ${i}`:i]})]}),l("button",{type:"button",class:`${Ur}-attachment-remove`,onClick:n,disabled:o,"aria-label":r.removeAttachment.replace("{name}",e.name),"data-testid":Ct(D.attachmentRemove,e.id),children:l(Dt,{})}),t?.status==="uploading"?l("span",{class:`${Ur}-attachment-progress`,role:"progressbar","aria-label":e.name,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,children:l("span",{style:{width:`${a}%`}})}):null]})}var j_=new WeakMap;function Ra(e){e.currentTarget&&j_.set(e.currentTarget,e.timeStamp)}function Aa(e){let t=e.currentTarget?j_.get(e.currentTarget):void 0;return e.isComposing||t!==void 0&&e.timeStamp-t<100}var Ea=q.cssPrefix;function Do({text:e,retryLabel:t,onRetry:r,retryTestId:n}){return l("div",{class:`${Ea}-error`,role:"alert",children:[l("span",{class:`${Ea}-error-icon`,"aria-hidden":"true",children:l(Un,{})}),l("span",{class:`${Ea}-error-text`,children:e}),r&&t?l("button",{type:"button",class:`${Ea}-error-retry`,onClick:r,"data-testid":n,children:t}):null]})}var Bl={isSupported:!1,start:()=>{},stop:()=>{},cancel:()=>{}};function zl(e,t,r){return e==="disabled"?Bl:e==="server"?Vb(r):Fb(t)}function Fb(e){let t=Hb();if(!t)return Bl;let r=null,n=0;return{isSupported:!0,start(o,s){let a=r,i=++n;r=null,a?.abort();let c=new t;r=c,c.continuous=!0,c.interimResults=!0,c.lang=e;let u=!1;c.addEventListener("result",_=>{if(n!==i||r!==c)return;let d=_,f="",v=!1;for(let g=d.resultIndex;g<d.results.length;g++){let x=d.results[g];x&&(f+=x[0].transcript,x.isFinal&&(v=!0))}o(f,v)});function p(_){u||n!==i||r!==c||(u=!0,r=null,s(_))}c.addEventListener("end",()=>p(!1)),c.addEventListener("error",_=>p("error"in _&&(_.error==="not-allowed"||_.error==="service-not-allowed")));try{c.start()}catch{p(!1)}},stop(){r?.stop()},cancel(){n++;let o=r;r=null,o?.abort()}}}function Hb(){return window.SpeechRecognition??window.webkitSpeechRecognition}var jb=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function Vb(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return Bl;let t=0,r=null;function n(a){for(let i of a.stream?.getTracks()??[])i.stop();a.stream=null}function o(){t++;let a=r;r=null,a&&(n(a),a.recorder?.state!=="inactive"&&a.recorder?.stop())}async function s(a){if(a.finishing)return;a.finishing=!0;let i=a.recorder?.mimeType??"audio/webm";n(a);let c=new Blob(a.chunks,{type:i});a.chunks=[];try{let{text:u}=await e(c,i);r===a&&t===a.generation&&u&&a.onText(u,!0)}catch{}finally{r===a&&t===a.generation&&(r=null,a.onEnd(!1))}}return{isSupported:!0,async start(a,i){o();let c={generation:t,recorder:null,stream:null,chunks:[],onText:a,onEnd:i,finishing:!1};r=c;try{let u=await navigator.mediaDevices.getUserMedia({audio:!0});if(r!==c||t!==c.generation){for(let d of u.getTracks())d.stop();return}c.stream=u;let p=Wb(),_=new MediaRecorder(u,p?{mimeType:p}:void 0);c.recorder=_,_.addEventListener("dataavailable",d=>{r===c&&t===c.generation&&d.data.size>0&&c.chunks.push(d.data)}),_.addEventListener("stop",()=>{r===c&&t===c.generation&&s(c)}),_.start()}catch(u){n(c),r===c&&t===c.generation&&(r=null,i(u instanceof DOMException&&u.name==="NotAllowedError"))}},stop(){let a=r;if(a){if(!a.recorder){o();return}a.recorder.state!=="inactive"&&a.recorder.stop()}},cancel(){o()}}}function Wb(){for(let e of jb)if(MediaRecorder.isTypeSupported(e))return e}function Gb(e,{file:t,reason:r},n){return r==="count"?e.attachmentTooMany.replace("{count}",String(n.maxCount)):r==="bytes"?e.attachmentTooLarge.replace("{name}",t.name).replace("{max}",Fn(n.maxBytes)):e.attachmentMimeRejected.replace("{name}",t.name)}var Je=q.cssPrefix,jn=ie.scope("composer"),Kb=300;function Vn(e){return e.reduce((t,r)=>t+r.size,0)}var Fl={arrowUp:Qp,paperPlane:Kp,send:Yp,chevron:va};function V_(e){return"activeElement"in e}function Qb(e){return"host"in e&&"activeElement"in e}function Yb(e){return"clipboardData"in e}function W_({options:e,transport:t,feedback:r,bus:n,persistence:o,conversationId:s,maxMessageCharacters:a,isStreaming:i,pageToolRunning:c=!1,isMemoryCompacting:u=!1,canReleaseQueuedMessages:p=!0,queueManualMessages:_=!1,replyAwaitsCard:d=!1,active:f=!0,isPreparing:v=!1,attachmentUploadsSig:g,operatorRequestEnabled:x,canRequestOperator:k=!1,controlMode:y="ai-agent",onRequestOperator:S,onSend:b,onStop:w,apiRef:h}){let m=e.strings,[P,R]=U(()=>o.loadDraft(s)),[I,A]=U([]),[C,M]=U(),[N,H]=U(()=>o.loadMessageQueue(s).map(V=>({id:V.id,text:V.text,attachments:[]}))),G=B(N),z=B(!1),ce=B(void 0),[pe,_e]=U(!1),[ae,ve]=U(!1),[Xe,bt]=U(!1),[He,Tt]=U(!1),Oe=B(!1),Ge=B(null),Bt=B(null),It=B(null),Ke=B(0),se=B(s);se.current=s;let Se=B(f);Se.current=f;let ye=B(v);ye.current=v;let we=He||v||!f,Ee=i&&y==="ai-agent",Pt=Ee||u&&y==="ai-agent",$=y==="ai-agent"&&(Pt||_||N.length>0),L=j(V=>{H(J=>{let Q=V(J);return o.saveMessageQueue(se.current,Q.filter(fe=>fe.attachments.length===0).map(({id:fe,text:$e})=>({id:fe,text:$e}))),G.current=Q,Q})},[o]),Y=j(V=>{L(J=>(J.find(Q=>Q.id===V)?.attachments.forEach(Hn),J.filter(Q=>Q.id!==V)))},[L]),K=j(V=>{R(J=>{let Q=(typeof V=="function"?V(J):V).slice(0,a);return Q===J?J:(o.saveDraft(se.current,Q),Q)})},[o,a]),te=e.features.fileUpload,be=e.features.voice,[de,Pe]=U(()=>zl(be,e.locale,(V,J)=>t.transcribe(V,J))),st=B(de);st.current=de;let Be=B({mode:be,locale:e.locale,transport:t});F(()=>{let V=Be.current;V.mode===be&&V.locale===e.locale&&V.transport===t||(Be.current={mode:be,locale:e.locale,transport:t},Ke.current++,st.current.cancel(),It.current=null,ve(!1),Pe(zl(be,e.locale,(J,Q)=>t.transcribe(J,Q))))},[e.locale,be,t]),St(()=>()=>{Ke.current++,de.cancel()},[de]);let pt=j(V=>{let J=It.current;if(J===null)return!1;let Q=Math.round(performance.now()-J);return jn[V]("voiceStop",{durationMs:Q}),n.emit("voiceStop",{durationMs:Q}),It.current=null,!0},[n]),je=j(()=>{It.current!==null&&(de.stop(),ve(!1),pt("info")&&r.play("voiceStop"))},[pt,r,de]),Mt=j(()=>{Ke.current++,de.cancel(),ve(!1),pt("info")&&r.play("voiceStop")},[pt,r,de]);F(()=>{(v||!f)&&Mt()},[f,Mt,v]),F(()=>{let V=Ge.current;if(!V)return;let J=V.getRootNode(),Q=V_(J)?J.activeElement:null;Q&&V.closest(`.${Je}-panel`)?.contains(Q)||V.focus({preventScroll:!0})},[]),F(()=>{let V=Ge.current;if(!V)return;if(P.length===0){V.style.height="";return}V.style.height="auto";let J=getComputedStyle(V),Q=Number.parseFloat(J.getPropertyValue(`--${Je}-textarea-base-height`)),fe=Number.parseFloat(J.borderTopWidth)+Number.parseFloat(J.borderBottomWidth),$e=Math.min(V.scrollHeight+fe,Number.parseFloat(J.maxHeight)),At=Number.parseFloat(J.fontSize)*.7;V.style.height=`${$e<Q+At?Q:$e}px`},[P]);let Vt=B(I);Vt.current=I,F(()=>()=>{Vt.current.forEach(Hn);for(let V of G.current)V.attachments.forEach(Hn)},[]),St(()=>{if(h)return h.current={attachFromDrop:V=>{if(!te||!Se.current||Oe.current||ye.current)return;let J=Ia(V,Vt.current,e.attachments);M(J.rejected[0]),J.accepted.length!==0&&(jn.info("attach (drop)",{count:J.accepted.length,totalBytes:Vn(J.accepted)}),n.emit("attach",{count:J.accepted.length,totalBytes:Vn(J.accepted)}),A(Q=>[...Q,...J.accepted]))},fill:V=>{if(!Se.current||Oe.current||ye.current)return;K(V);let J=Ge.current;J&&(J.focus({preventScroll:!0}),requestAnimationFrame(()=>J.setSelectionRange(J.value.length,J.value.length)))},acceptQueuedMessage:Y},()=>{h.current&&(h.current=null)}},[h,te,v,e.attachments,Y,K]),F(()=>{let V=Ge.current;if(!V)return;let J=V.closest(`.${Je}-panel`);if(!J)return;let Q=$e=>{if(!Se.current||Oe.current||ye.current)return;let At=$e.clipboardData;if(!At)return;let pr=$e.target instanceof HTMLElement?$e.target.closest("input, textarea, [contenteditable]:not([contenteditable='false'])"):null;if(pr&&pr!==V)return;if(te){let zt=Ia(At.items,Vt.current,e.attachments);if(M(zt.rejected[0]),zt.accepted.length>0){$e.preventDefault(),jn.info("attach (paste)",{count:zt.accepted.length,totalBytes:Vn(zt.accepted)}),n.emit("attach",{count:zt.accepted.length,totalBytes:Vn(zt.accepted)}),A(Ja=>[...Ja,...zt.accepted]);return}}if(pr===V)return;let _r=At.getData("text/plain");_r&&($e.preventDefault(),K(zt=>zt+_r),V.focus())};function fe($e){Yb($e)&&Q($e)}return J.addEventListener("paste",fe),()=>J.removeEventListener("paste",fe)},[te,e.attachments,K]);async function Qt(){let V=P.trim();if(!V&&I.length===0||!f||Ee||Oe.current||v)return;Mt(),Oe.current=!0,Tt(!0);let J=P,Q=I;try{await b(V,Q)&&(M(void 0),K(fe=>fe===J?"":fe),A(fe=>fe!==Q?fe:(Q.forEach(Hn),Vt.current=[],[])))}finally{Oe.current=!1,Tt(!1),requestAnimationFrame(()=>{let fe=Ge.current;if(!fe||fe.disabled||!Se.current)return;let $e=fe.getRootNode(),At=V_($e)?$e.activeElement:null,pr=At?.getAttribute("data-testid");if(!(At&&At!==fe&&pr!==D.composerSend&&pr!==D.composerStop)){if(Qb($e)){let _r=$e.host.ownerDocument;if(!_r.hasFocus())return;let zt=_r.activeElement;if(zt&&zt!==$e.host&&zt!==_r.body)return}fe.focus({preventScroll:!0})}})}}function _t(){let V=P.trim();if(!V&&I.length===0||!f||!$||Oe.current||v)return;Mt();let J=I;L(Q=>[...Q,{id:Wt(),text:V,attachments:J}]),Pt||_e(!0),K(""),A(Q=>Q!==J?Q:(Vt.current=[],[])),Ge.current?.focus({preventScroll:!0})}F(()=>{Pt&&(z.current=!1,ce.current=void 0,_e(!1))},[Pt]),F(()=>{let V=N[0];if(!V||!p||Pt||z.current||He||v||!f)return;let J=d&&!pe?(ce.current??(ce.current=performance.now()+e.cardAnswerWaitSeconds*1e3))-performance.now():0,Q=setTimeout(()=>{z.current=!0,b(V.text,V.attachments,V.id).then(fe=>{if(fe){Y(V.id);return}z.current=!1})},Math.max(J,Kb));return()=>clearTimeout(Q)},[f,p,pe,v,b,e.cardAnswerWaitSeconds,Pt,N,Y,d,He]);function xt(V){V.key!=="Enter"||V.shiftKey||Aa(V)||(V.preventDefault(),$&&(P.trim()||I.length>0)?_t():Ee?w():Qt())}function Xt(V){if(!(V.target instanceof HTMLInputElement))return;let J=V.target;if(!f||Oe.current||v){J.value="";return}let Q=Ia(J.files,I,e.attachments);M(Q.rejected[0]),Q.accepted.length>0&&(jn.info("attach (file picker)",{count:Q.accepted.length,totalBytes:Vn(Q.accepted)}),n.emit("attach",{count:Q.accepted.length,totalBytes:Vn(Q.accepted)}),A(fe=>[...fe,...Q.accepted])),J.value=""}function _n(V){!f||Oe.current||v||(jn.info("removeAttachment",{id:V}),n.emit("removeAttachment",{id:V}),M(void 0),A(J=>{let Q=J.find(fe=>fe.id===V);return Q&&Hn(Q),J.filter(fe=>fe.id!==V)}))}function fn(){if(ae){je();return}if(!f||!de.isSupported||Oe.current||v)return;let V=++Ke.current;It.current=performance.now(),jn.info("voiceStart"),n.emit("voiceStart",void 0),bt(!1),ve(!0),r.play("voiceStart"),de.start((J,Q)=>{Ke.current!==V||!Se.current||ye.current||Oe.current||!Q||K(fe=>`${fe}${J} `)},J=>{Ke.current!==V||!Se.current||(ve(!1),bt(J),pt("debug"))})}let Fr=Fl[e.composer.sendButton.icon],mn=!!(P.trim()||I.length>0),Hr=g?.value,Jo=I.some(V=>Hr?.get(V.id)?.status==="uploading"),jr=I.filter(V=>Hr?.get(V.id)?.status==="error"),gn=jr.find(V=>Hr?.get(V.id)?.refusal),Ya=gn&&(Hr?.get(gn.id)?.refusal==="INVALID_FILE_TYPE"?m.attachmentMimeRejected:m.attachmentUploadFailed).replace("{name}",gn.name),Xo=Ee||Jo||c&&!mn;return l("div",{class:`${Je}-composer`,part:"composer","data-testid":D.composer,children:[N.length>0?l("div",{class:`${Je}-message-queue`,"aria-label":m.queueMessage,"data-testid":D.messageQueue,children:N.map(V=>l("div",{class:`${Je}-attachment-chip ${Je}-queued-message`,"data-testid":`${D.queuedMessage}-${V.id}`,children:[l("span",{class:`${Je}-attachment-name ${Je}-queued-text`,children:V.text||V.attachments.map(J=>J.name).join(", ")}),l("button",{type:"button",class:`${Je}-attachment-remove`,onClick:()=>Y(V.id),"aria-label":m.removeQueuedMessage,title:m.removeQueuedMessage,"data-testid":`${D.queuedMessageRemove}-${V.id}`,children:l(Dt,{})})]},V.id))}):null,I.length>0?l("div",{class:`${Je}-attachments`,children:I.map(V=>l(H_,{attachment:V,upload:Hr?.get(V.id),strings:m,onRemove:()=>_n(V.id),disabled:we},V.id))}):null,jr.length>0&&!we?l(Do,{text:Ya??m.attachmentUploadFailed.replace("{name}",jr.map(V=>V.name).join(", ")),retryLabel:m.errorRetry,onRetry:gn?void 0:()=>{Qt()},retryTestId:D.attachmentRetry}):null,C?l("p",{class:`${Je}-field-error`,role:"alert",children:Gb(m,C,e.attachments)}):null,Xe?l("p",{class:`${Je}-field-error`,role:"alert",children:m.micBlocked}):null,a!==void 0&&P.length>=a*.9?l("p",{class:`${Je}-field-${P.length<a?"hint":"error"}`,"data-testid":D.composerCount,children:`${P.length} / ${a}`}):null,l("div",{class:`${Je}-composer-row`,children:[l("div",{class:`${Je}-composer-actions`,children:[te?l("button",{type:"button",class:`${Je}-icon-btn`,onClick:()=>Bt.current?.click(),disabled:we,"aria-label":m.attach,title:m.attach,"data-testid":D.composerAttach,children:l(ha,{})}):null,de.isSupported?l("button",{type:"button",class:`${Je}-icon-btn`,onClick:fn,disabled:we,"aria-label":ae?m.micStop:m.micStart,title:ae?m.micStop:m.micStart,"aria-pressed":ae,"data-recording":ae?"true":void 0,"data-testid":D.composerVoice,children:l(Jp,{})}):null,x&&y==="ai-agent"&&S?l("button",{type:"button",class:`${Je}-icon-btn`,onClick:S,disabled:we||!k,"aria-label":m.talkToOperator,title:m.talkToOperator,"data-testid":D.operatorRequest,children:l(xr,{})}):null]}),l("textarea",{ref:Ge,name:"message",class:`${Je}-textarea`,rows:1,value:P,maxLength:a,placeholder:m.composerPlaceholder,onInput:V=>K(V.currentTarget.value),onKeyDown:xt,onCompositionEnd:Ra,disabled:we,"aria-label":m.composerPlaceholder,"data-testid":D.composerInput}),$&&mn?l("button",{type:"button",class:`${Je}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:_t,disabled:we,"aria-label":m.queueMessage,title:m.queueMessage,"data-testid":D.composerSend,children:l(Fr,{})}):null,Xo?l("button",{type:"button",class:`${Je}-send`,onClick:w,disabled:we&&!Jo,"aria-label":m.stop,"data-testid":D.composerStop,children:l($r,{})}):null,!Xo&&(!$||!mn)?l("button",{type:"button",class:`${Je}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:()=>{Qt()},disabled:we||!P.trim()&&I.length===0,"aria-label":m.send,"data-testid":D.composerSend,children:l(Fr,{})}):null]}),l("input",{ref:Bt,name:"attachments",type:"file",multiple:!0,accept:e.attachments.accept,onChange:Xt,disabled:we,class:`${Je}-sr-only`,"data-testid":D.composerFileInput})]})}var G_=q.cssPrefix;function Ma({onClick:e,children:t,testid:r}){return e?l("button",{type:"button",class:`${G_}-home-card`,"data-interactive":"true",onClick:e,"data-testid":r,children:t}):l("div",{class:`${G_}-home-card`,"data-testid":r,children:t})}function La(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var rr=q.cssPrefix,Jb=ie.scope("news"),Xb=10;function Hl(e,t){let r=e?new Date(e):void 0;if(!(!r||Number.isNaN(r.getTime())))return new Intl.DateTimeFormat(t,{dateStyle:"medium"}).format(r)}function Zb({options:e,transport:t,strings:r,config:n,nav:o,bus:s,panelProps:a,latestNews:i}){let c=n.contentCollectionIds,u=c?.join(","),[p,_]=U({items:[],loading:!0}),d=B(void 0);function f(k){if(!c?.length)return;let y={};d.current=y,_(S=>({...S,loading:!0,error:void 0})),t.listContent({contentCollectionIds:c,sortBy:"publishedAt",sortOrder:"desc",page:k,limit:Xb}).then(S=>{if(d.current!==y||(_(w=>({items:k>1?[...w.items,...S.items]:S.items,pagination:S.pagination,loading:!1})),k>1))return;s.emit("contentView",{section:"news",count:S.items.length});let b=S.items[0];b&&i.markSeen(b.id)}).catch(S=>{d.current===y&&(Jb.warn("listContent (news) failed",{err:S,page:k}),_(b=>({...b,loading:!1,error:Sr(S,r)})))})}function v(){p.loading||f((p.pagination?.page??0)+1)}F(()=>(_({items:[],loading:!0}),f(1),()=>{d.current=void 0}),[t,u]);function g(k){let y=Hl(k.publishedAt,e.locale);return l("button",{type:"button",class:`${rr}-news-card`,onClick:()=>o.push({kind:"content",id:k.id,title:k.title}),"data-testid":Ct(D.newsItem,k.id),children:[k.image?l("img",{class:`${rr}-news-hero`,src:k.image,alt:"",loading:"lazy"}):null,l("span",{class:`${rr}-news-body`,children:[l("span",{class:`${rr}-news-title`,children:k.title}),y||k.tags?.length?l("span",{class:`${rr}-news-meta`,children:[y?l("time",{dateTime:k.publishedAt,children:y}):null,k.tags?.map(S=>l("span",{class:`${rr}-news-tag`,children:S},S))]}):null,k.description?l("span",{class:`${rr}-news-summary`,children:k.description}):null]})]},k.id)}function x(){if(!c?.length)return l(jt,{message:r.newsEmpty,strings:r});let k=p.error?l(jt,{tone:"error",message:p.error,onRetry:v,strings:r}):null;return k&&!p.pagination?k:p.pagination?p.items.length?l("div",{class:`${rr}-news-list`,children:[p.items.map(g),k,p.pagination.hasNext&&!k?l("button",{type:"button",class:`${rr}-news-more`,onClick:v,"aria-busy":p.loading,"data-testid":D.newsMore,children:[p.loading?l("span",{class:`${rr}-loading-spinner`,"aria-hidden":"true"}):null,r.newsShowMore]}):null]}):l(jt,{message:r.newsEmpty,strings:r}):l(jt,{message:r.newsLoading,strings:r})}return l("div",{class:`${rr}-module`,children:[l(Sa,{title:r.newsTitle,actions:l(dr,{panelProps:a,variant:"plain"})}),l("div",{class:`${rr}-module-scroll`,children:x()})]})}var K_={Icon:Pa,Root:e=>l(Zb,{...e})};var ke=q.cssPrefix,Q_=ie.scope("home");function eP(e){let t=e.options.userContext?.name,r=e.config.greetingText?mt(e.strings,e.config.greetingText):void 0;if(r){let n=t?r.replace("{name}",t):r.replace(/\s*\{name\}\s*/," ").trim(),o=e.strings.homeGreetingLead;return{title:n,subtitle:n.toLowerCase()===o.toLowerCase()?void 0:o}}return t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}function tP(e,t){return t.url?Ro(t.url):e.push({kind:"content",id:t.id,title:t.title})}function rP({options:e,onAsk:t}){let[r,n]=U(""),{sendButton:o}=e.composer,s=Fl[o.icon];function a(i){i.preventDefault();let c=r.trim();c&&(n(""),t(c))}return l("form",{class:`${ke}-home-search ${ke}-home-ask`,"data-input":"true",onSubmit:a,"data-testid":D.homeAsk,children:[l("input",{type:"text",class:`${ke}-home-search-input`,placeholder:e.strings.homeAskPlaceholder,"aria-label":e.strings.homeAskPlaceholder,value:r,enterKeyHint:"send",onInput:i=>n(i.currentTarget.value)}),l("button",{type:"submit",class:`${ke}-send`,"data-shape":o.shape,"data-variant":o.variant,disabled:!r.trim(),"aria-label":e.strings.send,children:l(s,{})})]})}function Y_(e,t){return Pr(e,t,t.type!=="upsert"||t.activity===!0)}function nP(e){let{transport:t,strings:r,config:n,nav:o,bus:s,panelProps:a,latestNews:i}=e,[c,u]=U(null),[p,_]=U([]),d=n.contentCollectionIds?.join(","),f=e.options.modules.list.some(h=>h.layout==="chat");F(()=>{if(n.showRecentConversations===!1)return;let h=!1,m=!0,P=[],R=t.subscribeConversationChanges(I=>{m&&P.push(I),u(A=>Y_(A?[A]:[],I)[0]??null)});return t.listConversations({limit:f?50:1}).then(I=>{if(h)return;let A=P.reduce(Y_,I.conversations);P=[],m=!1,u(A[0]??null)}).catch(I=>{h||(P=[],m=!1,Q_.warn("listConversations (home) failed",{err:I}))}),()=>{h=!0,R()}},[t,n.showRecentConversations,f]),F(()=>{if(!n.contentCollectionIds?.length)return;let h=!1;return t.listContent({contentCollectionIds:n.contentCollectionIds,pinned:!0,limit:6}).then(m=>{h||(_(m.items),s.emit("contentView",{section:"home",count:m.items.length}))}).catch(m=>!h&&Q_.warn("listContent (home) failed",{err:m})),()=>{h=!0}},[t,d,s]);let v=eP(e),g=n.userAvatars??[],x=n.status,k=x?.text?mt(r,x.text):r.homeStatus,y=x?.url,S=n.contentBlockTitle?mt(r,n.contentBlockTitle):r.homeContentTitle,b=i.item,w=Hl(b?.publishedAt,e.options.locale);return l("div",{class:`${ke}-module ${ke}-home`,"data-testid":D.homeView,children:l("div",{class:`${ke}-home-scroll`,children:[l("div",{class:`${ke}-home-hero`,children:[l("div",{class:`${ke}-home-hero-top`,children:[n.brandName?l("span",{class:`${ke}-home-brand`,"data-testid":D.homeBrand,children:n.brandName}):l("span",{class:`${ke}-home-brand-spacer`,"aria-hidden":"true"}),l("div",{class:`${ke}-home-hero-actions`,children:[g.length>0?l("div",{class:`${ke}-home-avatars`,children:g.map(h=>l("span",{class:`${ke}-home-avatar`,title:h.role?`${h.name} \xB7 ${h.role}`:h.name,children:h.avatar?l("img",{src:h.avatar,alt:"",loading:"lazy"}):l("span",{children:La(h.name)})},h.name))}):null,l(dr,{panelProps:a,variant:"plain"})]})]}),n.showGreeting!==!1?l(he,{children:[l("h1",{class:`${ke}-home-greeting`,"data-testid":D.homeGreeting,children:v.title}),v.subtitle?l("p",{class:`${ke}-home-lead`,children:v.subtitle}):null]}):null]}),l("div",{class:`${ke}-home-cards`,children:[f?l(rP,{options:e.options,onAsk:h=>o.startNewConversation(h)}):null,n.showSearchBar!==!1?l(O_,{placeholder:r.homeSearchPlaceholder,onActivate:()=>o.switchToLayout("help")}):null,b?l(Ma,{onClick:()=>{i.markSeen(b.id),o.push({kind:"content",id:b.id,title:b.title})},testid:D.homeWhatsNew,children:l("div",{class:`${ke}-home-recent-row`,"data-unread":i.unseen?"true":void 0,children:[l("span",{class:`${ke}-home-recent-avatar`,"aria-hidden":"true",children:l(Pa,{})}),l("span",{class:`${ke}-home-recent-body`,children:[l("span",{class:`${ke}-home-recent-title`,children:r.homeWhatsNew}),l("span",{class:`${ke}-home-recent-preview`,children:w?`${b.title} \xB7 ${w}`:b.title})]}),i.unseen?l("span",{class:`${ke}-home-recent-dot`,role:"img","aria-label":r.newsUnseen}):null]})}):null,c?l(Ma,{onClick:()=>o.selectConversation(c),testid:D.homeRecent,children:l("div",{class:`${ke}-home-recent-row`,"data-unread":c.hasUnread?"true":void 0,children:[l("span",{class:`${ke}-home-recent-avatar`,"aria-hidden":"true",children:l(Lo,{})}),l("span",{class:`${ke}-home-recent-body`,children:[l("span",{class:`${ke}-home-recent-title`,children:c.title}),c.preview?l("span",{class:`${ke}-home-recent-preview`,children:Ca(c.preview)}):null]}),c.hasUnread?l("span",{class:`${ke}-home-recent-dot`,role:"img","aria-label":r.unread}):null]})}):null,x?l(Ma,{onClick:y?()=>Ro(y):void 0,children:l("div",{class:`${ke}-home-status`,"data-level":x.level??"operational",children:[l("span",{class:`${ke}-home-status-icon`,"aria-hidden":"true",children:l(u_,{})}),l("span",{class:`${ke}-home-status-text`,children:k})]})}):null,p.length>0?l("section",{class:`${ke}-home-content`,children:[l("div",{class:`${ke}-home-content-title`,children:S}),l("div",{class:`${ke}-home-content-list`,children:p.map(h=>l(Ta,{title:h.title,subtitle:h.description,onClick:()=>tP(o,h),testid:Ct(D.homeContentRow,h.id)},h.id))})]}):null]})]})})}var J_={Icon:p_,Root:e=>l(nP,{...e})};var Na={chat:N_,home:J_,help:q_,news:K_};var qo=q.cssPrefix;function X_({modules:e,activeTab:t,strings:r,hasUnread:n,onSelect:o}){return l("nav",{class:`${qo}-tabbar`,role:"tablist","aria-label":r.panelTitle,children:e.map(s=>{let a=Na[s.layout].Icon,i=s.id===t,c=s.layout==="chat"&&n;return l("button",{type:"button",role:"tab","aria-selected":i,class:`${qo}-tab`,onClick:()=>o(s.id),"data-testid":Ct(D.tab,s.id),children:[l("span",{class:`${qo}-tab-icon`,children:[l(a,{}),c?l("span",{class:`${qo}-tab-badge`,"data-testid":D.tabBadge,role:"img","aria-label":r.unread}):null]}),l("span",{class:`${qo}-tab-label`,children:mt(r,s.label)})]},s.id)})})}var Uo=q.cssPrefix;function Z_({agent:e,strings:t,ticketReference:r,person:n=!1}){let o=e.status??"online",s=mt(t,e.name),a=e.title?mt(t,e.title):null,i=n?l(xr,{}):l("span",{children:La(s)});return l("div",{class:`${Uo}-agent`,children:[l("div",{class:`${Uo}-agent-avatar`,"data-status":o,children:e.avatar?l("img",{src:e.avatar,alt:""}):i}),l("div",{class:`${Uo}-agent-meta`,children:[l("strong",{children:s}),a||r?l("div",{class:`${Uo}-agent-sub`,children:[r?l(oP,{reference:r,strings:t}):null,a?l("span",{children:a}):null]}):null]})]})}function oP({reference:e,strings:t}){let[r,n]=U(!1);function o(){navigator.clipboard?.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)}).catch(()=>{})}return l("button",{type:"button",class:`${Uo}-agent-ticket`,onClick:o,title:t.copy,"aria-label":r?t.copied:t.copyTicketReference.replace("{reference}",e),children:r?t.copied:e})}var iP=["today","yesterday","lastWeek","older"];function aP(e,t){let r=Date.parse(t);if(!Number.isFinite(r))return"older";let n=Math.round((ef(e)-ef(r))/(1440*60*1e3));return n<=0?"today":n===1?"yesterday":n<7?"lastWeek":"older"}function tf(e,t){let r=new Map;for(let n of t){let o=aP(e,n.lastMessageAt),s=r.get(o);s?s.push(n):r.set(o,[n])}return iP.flatMap(n=>{let o=r.get(n);return o?[{bucket:n,conversations:o}]:[]})}function ef(e){return new Date(e).setHours(0,0,0,0)}var rf=ie.scope("history"),sP=3,lP=6,cP={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function nf(e,t){let r=t.type!=="upsert"||t.activity===!0;if(t.type==="snapshot"&&t.result.pagination.page===1&&e.pagination.page>1){let o=Pr(e.conversations.slice(0,t.result.pagination.limit),t,r);if(t.result.conversations.length===0){if(o.length===0)return t.result;let u=Math.max(t.result.pagination.total,o.length);return{...t.result,conversations:o,pagination:{...t.result.pagination,total:u,totalPages:Math.ceil(u/t.result.pagination.limit)}}}let s=new Set(o.map(u=>u.conversationId)),a=e.conversations.slice(t.result.pagination.limit).filter(u=>!s.has(u.conversationId)),i=e.pagination.page,c={...t.result.pagination,page:i,hasPrev:i>1,hasNext:i<t.result.pagination.totalPages};return{conversations:[...o,...a],pagination:c}}let n=Pr(e.conversations,t,r);return n===e.conversations?e:{...t.type==="snapshot"?t.result:e,conversations:n}}function dP(e,t,r){let n=Date.parse(e);return Number.isFinite(n)?new Date(n).toDateString()===new Date(t).toDateString()?new Intl.DateTimeFormat(r,{hour:"numeric",minute:"2-digit"}).format(n):t-n<10080*60*1e3?new Intl.DateTimeFormat(r,{weekday:"short"}).format(n):new Intl.DateTimeFormat(r,{month:"short",day:"numeric"}).format(n):""}function Oa({transport:e,strings:t,locale:r,persistence:n,onSelect:o,onNewConversation:s}){let a=q.cssPrefix,i=e.peekConversations({limit:50}),[c,u]=U(i?"loaded":"loading"),[p,_]=U(0),[d,f]=U(i),[v,g]=U(!1),x=B(void 0),k=d?.conversations??[],y=d?.pagination;F(()=>{let m=!1,P=!0,R=[],I=e.subscribeConversationChanges(C=>{P&&R.push(C),f(M=>M&&nf(M,C))});x.current=void 0,g(!1);let A=e.peekConversations({limit:50});return f(A),u(A?"loaded":"loading"),e.listConversations({limit:50}).then(C=>{if(m)return;let M=C;for(let N of R)M=nf(M,N);R=[],P=!1,f(M),u("loaded"),n.saveHistoryCount(M.conversations.length)}).catch(C=>{m||(R=[],P=!1,rf.warn("listConversations failed",{err:C}),u({failure:Sr(C,t)}))}),()=>{m=!0,I(),x.current=void 0}},[e,n,r,p]);async function S(){if(x.current||!y?.hasNext)return;let m={};x.current=m,g(!0);try{let P=await e.listConversations({page:y.page+1,limit:y.limit});if(x.current!==m)return;f(R=>{if(!R)return R;let I=new Set(R.conversations.map(M=>M.conversationId)),A=P.conversations.filter(M=>I.has(M.conversationId)?!1:(I.add(M.conversationId),!0)),C={conversations:[...R.conversations,...A],pagination:P.pagination};return n.saveHistoryCount(C.conversations.length),C})}catch(P){if(x.current!==m)return;rf.warn("listConversations page failed",{err:P,page:y.page+1})}finally{x.current===m&&(x.current=void 0,g(!1))}}let b=s?l("div",{class:`${a}-history-footer`,children:l("button",{type:"button",class:`${a}-history-new`,onClick:s,"data-testid":D.sidebarNewConversation,children:[l(Gp,{}),t.newConversation]})}):null;if(c==="loading"){let m=Math.min(n.loadHistoryCount()??sP,lP);return l(he,{children:[l("div",{class:`${a}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:l("div",{class:`${a}-history-group`,"aria-hidden":"true",children:[l("div",{class:`${a}-history-heading`,children:l("span",{class:`${a}-skeleton ${a}-skeleton-heading`})}),l("div",{class:`${a}-history-card`,children:Array.from({length:Math.max(1,m)},(P,R)=>l("div",{class:`${a}-history-item ${a}-history-item-skeleton`,children:[l("span",{class:`${a}-history-avatar ${a}-skeleton`}),l("span",{class:`${a}-history-body`,children:[l("span",{class:`${a}-history-row`,children:[l("span",{class:`${a}-history-title`,children:l("span",{class:`${a}-skeleton ${a}-skeleton-title`})}),l("span",{class:`${a}-history-time`,children:l("span",{class:`${a}-skeleton ${a}-skeleton-time`})})]}),l("span",{class:`${a}-history-row`,children:l("span",{class:`${a}-history-preview`,children:l("span",{class:`${a}-skeleton ${a}-skeleton-preview`})})})]})]},R))})]})}),b]})}if(typeof c=="object")return l(he,{children:[l(jt,{tone:"error",message:c.failure,onRetry:()=>_(m=>m+1),strings:t}),b]});if(k.length===0)return l(he,{children:[l("div",{class:`${a}-history-empty`,children:t.historyEmpty}),b]});let w=Date.now(),h=tf(w,k);return l(he,{children:[l("div",{class:`${a}-history`,role:"list",children:[h.map(m=>l("div",{class:`${a}-history-group`,children:[l("div",{class:`${a}-history-heading`,children:t[cP[m.bucket]]}),l("div",{class:`${a}-history-card`,children:m.conversations.map(P=>l("div",{role:"listitem",children:l("button",{type:"button",class:`${a}-history-item`,onClick:()=>o(P),"data-unread":P.hasUnread?"true":void 0,"data-testid":Ct(D.historyItem,P.conversationId),children:[l("span",{class:`${a}-history-avatar`,"aria-hidden":"true",children:l($l,{})}),l("span",{class:`${a}-history-body`,children:[l("span",{class:`${a}-history-row`,children:[l("span",{class:`${a}-history-title`,children:P.title}),l("span",{class:`${a}-history-time`,children:[P.ticketReference&&`${P.ticketReference} \xB7 `,dP(P.lastMessageAt,w,r)]})]}),l("span",{class:`${a}-history-row`,children:[l("span",{class:`${a}-history-preview`,children:P.preview&&Ca(P.preview)||t.historyContinue}),P.hasUnread?l("span",{class:`${a}-history-dot`,role:"img","aria-label":t.unread}):null]})]})]})},P.conversationId))})]},m.bucket)),y?.hasNext?l("div",{class:`${a}-history-more`,children:l("button",{type:"button",onClick:S,disabled:v,"aria-busy":v,"data-testid":D.historyLoadMore,children:t.loadMoreConversations})}):null]}),b]})}var of=q.cssPrefix;function af({state:e,strings:t}){return e?l("div",{class:`${of}-dropzone`,"data-state":e,role:"status","aria-live":"polite",children:[l("span",{class:`${of}-dropzone-icon`,"aria-hidden":"true",children:e==="reject"?l(Un,{}):l(ha,{})}),e==="reject"?t.dropZoneRejected:t.dropZone]}):null}var jl=new RegExp(String.raw`^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$`),uP=/^[+]?[\d\s().-]{6,}$/;function pP(e,t,r){let n=Array.isArray(t)?t.join(""):t?.trim()??"";if(!n)return e.required?r.formRequired:void 0;if(e.type==="email"&&!jl.test(n))return r.formInvalidEmail;if(e.type==="tel"&&!uP.test(n))return r.formInvalidTel;if(e.type==="number"&&!Number.isFinite(Number(n)))return r.formInvalidNumber}function sf(e,t,r){return Object.fromEntries(e.flatMap(n=>{let o=pP(n,t[n.name],r);return o?[[n.name,o]]:[]}))}var ht=q.cssPrefix;function lf(e){return e.tokenEmail||e.userContext?.email?.trim()}function _P(e,t){let r=e instanceof qe?e.status:void 0;return r===400?t.formInvalidEmail:r===409?t.emailTranscriptAlreadySent:r===422?t.emailTranscriptNotDelivered:r===429?t.emailTranscriptLimited:t.emailTranscriptFailed}function fP(e){return"host"in e&&"activeElement"in e}function cf({transport:e,strings:t,knownEmail:r,onClose:n}){let[o,s]=U(r??""),[a,i]=U(!1),[c,u]=U({status:"idle"}),p=B(null),_=io(),d=`${_}-title`,f=`${_}-error`,v=c.status==="sending",g=c.status==="sent";St(()=>{let y=p.current;if(!y)return;let S=y.getRootNode(),b=fP(S)?S.activeElement:null,w=Bn(y);return()=>{w(),b instanceof HTMLElement&&b.isConnected&&b.focus({preventScroll:!0})}},[]),St(()=>{p.current?.querySelector("[data-autofocus]")?.focus({preventScroll:!0})},[g]);async function x(y){if(y.preventDefault(),v)return;let S=o.trim();if(!jl.test(S)){i(!0),p.current?.querySelector("input")?.focus();return}i(!1),u({status:"sending"});let b=await e.emailTranscript(S).then(w=>({status:"sent",to:w.to}),w=>({status:"failed",message:_P(w,t)}));u(b)}function k(y){y.key==="Tab"&&y.stopPropagation(),y.key==="Escape"&&(y.stopPropagation(),n())}return l("div",{class:`${ht}-transcript-layer`,children:[l("div",{class:`${ht}-transcript-backdrop`,"aria-hidden":"true",onClick:n}),l("section",{ref:p,class:`${ht}-transcript-sheet`,role:"dialog","aria-modal":"true","aria-labelledby":d,onKeyDown:k,"data-testid":D.emailTranscriptSheet,children:[l("header",{class:`${ht}-transcript-sheet-head`,children:[l("span",{class:`${ht}-transcript-sheet-icon`,children:l(ya,{})}),l("h2",{id:d,class:`${ht}-transcript-sheet-title`,children:t.emailTranscript}),l("button",{type:"button",class:`${ht}-icon-btn`,onClick:n,"aria-label":t.emailTranscriptCancel,title:t.emailTranscriptCancel,children:l(Dt,{})})]}),c.status==="sent"?l(he,{children:[l("p",{class:`${ht}-transcript-sheet-text ${ht}-transcript-sheet-sent`,role:"status",children:[l(cn,{}),l("span",{children:t.emailTranscriptSent.replace("{email}",c.to)})]}),l("button",{type:"button",class:`${ht}-form-submit ${ht}-transcript-sheet-action`,onClick:n,"data-autofocus":!0,children:t.emailTranscriptDone})]}):l("form",{class:`${ht}-transcript-sheet-form`,onSubmit:y=>{x(y)},noValidate:!0,children:[l("p",{class:`${ht}-transcript-sheet-text`,children:t.emailTranscriptPrompt}),l("label",{class:`${ht}-field`,"data-invalid":a?"true":void 0,children:[l("span",{class:`${ht}-field-label`,children:t.emailTranscriptEmailLabel}),l("input",{class:`${ht}-field-input`,type:"email",name:"email",autocomplete:"email",inputMode:"email",autocapitalize:"off",spellcheck:!1,value:o,readOnly:v,"aria-invalid":a,"aria-describedby":a?f:void 0,onInput:y=>{s(y.currentTarget.value),i(!1)},"data-autofocus":!0,"data-testid":D.emailTranscriptEmail}),a?l("span",{id:f,class:`${ht}-field-error`,role:"alert",children:t.formInvalidEmail}):null]}),l("button",{type:"submit",class:`${ht}-form-submit ${ht}-transcript-sheet-action`,disabled:v,"aria-busy":v,"data-testid":D.emailTranscriptSend,children:v?t.emailTranscriptSending:t.emailTranscriptSend}),c.status==="failed"?l("p",{class:`${ht}-field-error`,role:"alert",children:c.message}):null]})]})]})}var df=Object.assign;function vP(e,t){for(var r in e)if(r!="__source"&&e[r]!==t[r])return!0;for(var n in t)if(n!="__source"&&!(n in e))return!0;return!1}var hP=/^(-|f[lo].*[^se]$|g.{5,}[^ps]$|z|o[pr]|(W.{5})?[lL]i.*(t|mp)$|an|(bo|s).{4}Im|sca|m.{6}[ds]|ta|c.*[st]$|wido|ini|asp|fill|st)/;function _f(e,t){function r(o){var s=this.props.ref;return s!=o.ref&&s&&(typeof s=="function"?s(null):s.current=null),t?!t(this.props,o)||s!=o.ref:vP(this.props,o)}function n(o){return this.shouldComponentUpdate=r,Ir(e,o)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.type=e,n}var yP=Symbol.for("react.element"),bP=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(?!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,PP=/[A-Z0-9]/g,xP=typeof document<"u";var SP=function(e){return/fil|che|rad/.test(e)};Zt.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Zt.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var uf=xe.event;xe.event=function(e){return uf&&(e=uf(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var wP={configurable:!0,get:function(){return this.class}},pf=xe.vnode;xe.vnode=function(e){if(typeof e.type=="string")(function(n){var o=n.props,s=n.type,a={},i=s.indexOf("-")==-1;for(var c in o){var u=o[c];if(!(c=="value"&&"defaultValue"in o&&u==null||xP&&c=="children"&&s=="noscript"||c=="class"||c=="className")){if(c=="style"&&u&&u.constructor==Object){var p=void 0;for(var _ in u)typeof u[_]!="number"||hP.test(_)||(p||(p=u=df({},u)),u[_]+="px")}else if(c=="defaultValue"&&"value"in o&&o.value==null)c="value";else if(c=="download"&&u===!0)u="";else if(c=="translate"&&u==="no")u=!1;else if(c[0]=="o"&&c[1]=="n"){var d=c.toLowerCase();d=="ondoubleclick"?c="ondblclick":d!="onchange"||s!="input"&&s!="textarea"||SP(o.type)?d=="onfocus"?c="onfocusin":d=="onblur"&&(c="onfocusout"):d=c="oninput",d=="oninput"&&a[c=d]&&(c="oninputCapture")}else i&&bP.test(c)?c=c.replace(PP,"-$&").toLowerCase():u===null&&(u=void 0);a[c]=u}}if(s=="select"){var f=a.defaultValue!=null?a.defaultValue:a.multiple&&Array.isArray(a.value)?a.value:null;f!=null&&(a.value=ms(o.children).forEach(function(v){v.props.selected=a.multiple?f.indexOf(v.props.value)!=-1:f==v.props.value}))}o.class&&!o.className?(a.class=o.class,Object.defineProperty(a,"className",wP)):o.className&&(a.class=a.className=o.className),n.props=a})(e);else if(typeof e.type=="function"&&("ref"in e.props&&"prototype"in e.type&&e.type.prototype.render&&(e.ref=e.props.ref,delete e.props.ref),e.type.defaultProps)){var t=df({},e.props);for(var r in e.type.defaultProps)t[r]===void 0&&(t[r]=e.type.defaultProps[r]);e.props=t}e.ref&&!("ref"in e.props)&&Object.defineProperty(e.props,"ref",{value:e.ref,configurable:!0,writable:!0}),e.$$typeof=yP,pf&&pf(e)};var kP=new Set(["hidden","submit","button","reset","image","file","password"]);function mf(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function CP(e){return!mf(e)||e.name===""||e.disabled?!1:!(e instanceof HTMLInputElement&&kP.has(e.type))}function TP(e){let t=e.labels?.[0]?.textContent?.trim();return e.getAttribute("toolparamdescription")??(t||e.getAttribute("aria-description"))??void 0}function IP(e,t){let r=TP(e),n=r?{description:r}:{};return e instanceof HTMLSelectElement?{...n,type:"string",enum:[...e.options].map(o=>o.value)}:e instanceof HTMLTextAreaElement?{...n,type:"string"}:e.type==="checkbox"?{...n,type:"boolean"}:e.type==="radio"?{...n,type:"string",enum:t}:e.type==="number"||e.type==="range"?{...n,type:"number"}:{...n,type:"string"}}function RP(e,t){Object.getOwnPropertyDescriptor(Reflect.getPrototypeOf(e)??e,"value")?.set?.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function ff(e){return e==null?"":typeof e=="string"?e:JSON.stringify(e)}function AP(e,t){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked!==(t===!0||t==="true")&&e.click();return}if(e instanceof HTMLInputElement&&e.type==="radio"){e.value===ff(t)&&!e.checked&&e.click();return}RP(e,ff(t))}function EP(e,t,r){var a;let n=[...e.elements].filter(CP),o={},s=new Set;for(let i of n){let c=n.flatMap(u=>u instanceof HTMLInputElement&&u.type==="radio"&&u.name===i.name?[u.value]:[]);o[a=i.name]??(o[a]=IP(i,c)),i.required&&s.add(i.name)}return{name:t,description:r,inputSchema:{type:"object",properties:o,...s.size>0?{required:[...s]}:{}},execute(i){let c=typeof i=="object"&&i!==null?Object.entries(i):[];for(let[p,_]of c)for(let d of n)d.name===p&&AP(d,_);if(!e.hasAttribute("toolautosubmit"))return"Filled in the form. The visitor still needs to check it and press its submit button.";let u=[...new Set([...e.elements].flatMap(p=>mf(p)&&p.name&&!p.checkValidity()?[p.name]:[]))];return u.length>0?`Filled in the form, but it can't be submitted yet: ${u.join(", ")} still needs the visitor. Ask them to complete it and press the submit button.`:(setTimeout(()=>e.requestSubmit(),0),"Filled in the form and submitted it.")}}}function gf(){return[...document.querySelectorAll("form[toolname][tooldescription]")].flatMap(e=>{let t=e.getAttribute("toolname")?.trim()??"",r=e.getAttribute("tooldescription")?.trim()??"";return t&&r?[EP(e,t,r)]:[]})}var vf=`${q.cssPrefix}.page-tools`,MP=20,LP=50;function $a(e){return typeof e=="object"&&e!==null}function NP(e){return $a(e)&&(e.state==="running"||e.state==="stopped"||e.state==="finished"&&$a(e.outcome))}function OP(e){let t=e?JSON.parse(e):void 0;if(!$a(t))return{sent:[],calls:{}};let r=Array.isArray(t.sent)?t.sent.filter(o=>typeof o=="string"):[],n=Object.fromEntries(Object.entries($a(t.calls)?t.calls:{}).filter(o=>NP(o[1])));return{sent:r,calls:n}}var Wl={sent:[],calls:{}};function Bo(){try{Wl=OP(sessionStorage.getItem(vf))}catch{}return Wl}function Vl(e){Wl=e;try{sessionStorage.setItem(vf,JSON.stringify(e))}catch{}}var qt={markSent(e){let t=Bo();Vl({...t,sent:[...t.sent.filter(r=>r!==e),e].slice(-MP)})},sentHere(e){return Bo().sent.includes(e)},get(e){return Bo().calls[e]},set(e,t){let r=Bo(),n=Object.entries(r.calls).filter(([o])=>o!==e);Vl({...r,calls:Object.fromEntries([...n,[e,t]].slice(-LP))})},clear(e){let t=Bo();e.some(r=>r in t.calls)&&Vl({...t,calls:Object.fromEntries(Object.entries(t.calls).filter(([r])=>!e.includes(r)))})}};var Ql=ie.scope("page-tools"),hf="site__",yf=3e4,$P=1e3,bf=Symbol.for(`${q.cssPrefix}.page-tools`),Kl={state:"output-error",errorText:"The page reloaded before this finished, so it may or may not have taken effect. Check with the visitor before trying it again."},xf="The visitor stopped this before it finished.";function Br(e){return typeof e=="object"&&e!==null}function DP(e){return Br(e)&&Array.isArray(e.registered)&&e.runs instanceof Map}function zo(){let e=Reflect.get(globalThis,bf);if(DP(e))return e;let t={registered:[],runs:new Map};return Reflect.set(globalThis,bf,t),t}function Sf(e,t){let r=Br(t)&&t.signal instanceof AbortSignal?t.signal:void 0;if(r?.aborted)return;let n=zo().registered;n.push(e);function o(){let s=n.indexOf(e);s>=0&&n.splice(s,1)}r?.addEventListener("abort",o,{once:!0})}function Pf(e){return e.replace(/[^A-Za-z0-9_-]/g,"_").slice(0,58)}function wf(e){if(!Br(e)||typeof e.name!="string"||!Pf(e.name))return;let t=typeof e.title=="string"&&e.title.trim()!==""?e.title.trim().slice(0,120):void 0,r=[e.description,t].find(o=>typeof o=="string"&&o.trim()!=="")??e.name,n=e.preview;return{name:Pf(e.name),...t?{title:t}:{},...typeof n=="function"?{preview:o=>Reflect.apply(n,e,[o])}:{},description:r.trim().slice(0,1024),inputSchema:{properties:{},...Br(e.inputSchema)?e.inputSchema:{},type:"object"},consequential:Br(e.annotations)&&e.annotations.consequentialHint===!0}}function Gl(e){return e.flatMap(t=>{let r=wf(t),n=Br(t)?t.execute:void 0;return!r||typeof n!="function"?(Ql.warn("skipped a tool without a name or an execute function",t),[]):[{...r,run:(o,s)=>Reflect.apply(n,t,[o,{signal:s}])}]})}async function qP(){let e=Reflect.get(document,"modelContext")??Reflect.get(navigator,"modelContext");if(!Br(e)||typeof e.getTools!="function"||typeof e.executeTool!="function")return[];let t=e.getTools,r=e.executeTool,n=await Promise.race([Promise.resolve().then(()=>Reflect.apply(t,e,[])),ln($P).then(()=>[])]).catch(()=>[]);return(Array.isArray(n)?n:[]).flatMap(o=>{let s=wf(o);return s?[{...s,run:(a,i)=>Reflect.apply(r,e,[o,a,{signal:i}])}]:[]})}async function Fo(e=[]){let t=Gl(gf()),r=new Set(t.map(s=>s.name)),o=[...(await qP()).filter(s=>!r.has(s.name)),...t,...Gl(e),...Gl(zo().registered)];return new Map(o.map(s=>[s.name,s]))}function Yl(e){return[...e.values()].map(({name:t,title:r,description:n,inputSchema:o,consequential:s})=>{let a={name:t,description:n,inputSchema:o};return r&&(a.title=r),s&&(a.annotations={consequentialHint:!0}),a})}function dn(e){return e?.execution==="client"}function Wn(e){return e.startsWith(hf)?e.slice(hf.length):e}function UP(e){if(e===void 0||typeof e=="function"||typeof e=="symbol")return null;let t=new WeakSet,r=JSON.stringify(e,(n,o)=>{if(typeof o=="bigint")return o.toString();if(!(typeof o=="function"||typeof o=="symbol"))return o instanceof Node?`[${o.nodeName.toLowerCase()}]`:Br(o)?t.has(o)?"[circular]":(t.add(o),o):o});return r.length>yf?{truncated:!0,preview:r.slice(0,yf)}:JSON.parse(r)}async function kf(e){let t=(await Fo(e.optionTools)).get(Wn(e.toolName));if(!t?.preview)return;let r=t.preview;return Promise.resolve().then(()=>r(e.input)).catch(n=>{Ql.warn("a page tool preview failed",{name:t.name,error:n})})}async function BP(e){let t=Wn(e.toolName),r=(await Fo(e.optionTools)).get(t);return r?Promise.resolve().then(()=>r.run(e.input,e.signal)).then(n=>({state:"output-available",output:UP(n)})).catch(n=>(Ql.warn("a page tool failed",{name:t,error:n}),{state:"output-error",errorText:(n instanceof Error?n.message:String(n)).slice(0,1e3)||"The page tool failed."})):{state:"output-error",errorText:`This page doesn't offer "${t}" right now; the visitor may have moved on. Tell them, or continue without it.`}}function Cf(e){let{toolCallId:t}=e,r=qt.get(t);if(r?.state==="finished")return Promise.resolve(r.outcome);let{runs:n}=zo(),o=n.get(t);if(o)return o.outcome;if(r?.state==="running")return qt.set(t,{state:"finished",outcome:Kl}),e.onSettled("interrupted",0),Promise.resolve(Kl);let s=new AbortController,a=performance.now();qt.set(t,{state:"running"});let i=BP({...e,signal:s.signal}).then(c=>(n.delete(t),qt.get(t)?.state!=="running"||(qt.set(t,{state:"finished",outcome:c}),e.onSettled(c.state==="output-available"?"completed":"failed",Math.round(performance.now()-a))),c));return n.set(t,{outcome:i,controller:s}),i}function Tf(e){return e===Kl.errorText||e===xf}function Jl(e){return qt.set(e,{state:"stopped"}),zo().runs.get(e)?.controller.abort(),xf}function If(e){qt.clear([e]),zo().runs.get(e)?.controller.abort()}var Da=q.cssPrefix;function Rf({messageId:e,initial:t,strings:r,onFeedback:n}){let[o,s]=U(t);F(()=>s(t),[e,t]);function a(i){let c=o===i?null:i;s(c),n(e,c)}return l("div",{class:`${Da}-feedback`,role:"group","data-testid":D.messageFeedback,children:[l("button",{type:"button",class:`${Da}-msg-action`,"data-active":o==="up"?"true":void 0,"aria-pressed":o==="up","aria-label":r.feedbackUp,title:r.feedbackUp,onClick:()=>a("up"),"data-testid":D.feedbackUp,children:l(v_,{})}),l("button",{type:"button",class:`${Da}-msg-action`,"data-active":o==="down"?"true":void 0,"aria-pressed":o==="down","aria-label":r.feedbackDown,title:r.feedbackDown,onClick:()=>a("down"),"data-testid":D.feedbackDown,children:l(h_,{})}),l("span",{class:`${Da}-sr-only`,role:"status","aria-live":"polite",children:o?r.feedbackThanks:""})]})}function Af(e){return e.partsSig.value.some(t=>t.kind==="text"&&t.textSig.value.length>0)}function Ef(e){return e.partsSig.value.some(t=>t.kind==="reasoning")}function zP(e){return e.streaming&&!e.bufferedHold&&!(e.reasoningVisible&&e.working)}function Mf(e){let{streaming:t,reasoningVisible:r,emptyReply:n,hidden:o}=e,s=e.responseMode==="buffered"&&t,a=t&&!e.hasAnswerText;return{streaming:t,bufferedHold:s,reasoningVisible:r,working:a,showStreamDots:zP({streaming:t,bufferedHold:s,reasoningVisible:r,working:a}),emptyReply:n,hidden:o}}var Gn=q.cssPrefix;function Lf({part:e,strings:t}){let r=e.title||e.filename||e.url||t.sources;return e.url?l("a",{class:`${Gn}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":D.source,children:[l("span",{class:`${Gn}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),l("span",{class:`${Gn}-source-label`,children:r})]}):l("span",{class:`${Gn}-source`,"data-testid":D.source,children:[l("span",{class:`${Gn}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),l("span",{class:`${Gn}-source-label`,children:r})]})}var Jt=q.cssPrefix;function $f(e){return{toolCallId:e.toolCallId,toolName:e.toolName,...e.title?{title:e.title}:{},state:e.stateSig.value,input:e.inputSig.value,output:e.outputSig.value,...e.errorSig.value?{errorText:e.errorSig.value}:{},...e.approvalSig.value?{approval:e.approvalSig.value}:{},...e.toolMetadata?{toolMetadata:e.toolMetadata}:{}}}function Df(e,t){if(t?.replacedByMessageId)return{terminal:!1,responded:!1,decided:!1};let r=e==="output-available"||e==="output-error"||e==="output-denied",n=e==="approval-responded"||t?.approved!==void 0;return{terminal:r,responded:n,decided:r||n}}function qa({status:e,label:t,icon:r}){return l("span",{class:`${Jt}-toolui-badge ${Jt}-toolui-status`,"data-status":e,children:[l("span",{class:`${Jt}-toolui-status-icon`,children:r??l(Xl,{status:e})}),t]})}function Xl({status:e}){return e==="running"?l("span",{class:`${Jt}-loading-spinner`}):e==="stopped"?l($r,{}):e==="waiting"||e==="submitted"?l(b_,{}):e==="failed"||e==="declined"||e==="replaced"?l(No,{}):l(cn,{})}function Ho({decision:e}){return l("span",{class:`${Jt}-steps-decision`,"data-approved":e.approved?"true":"false",title:e.title,children:[e.approved?l(cn,{}):l(No,{}),e.label]})}function Ua({view:e,strings:t}){let r=e.raw;return l(he,{children:[e.error?l("p",{class:`${Jt}-steps-row-error`,children:e.error}):null,e.fields.length>0?l(Nf,{fields:e.fields,label:e.tables?t.stepInput:void 0,plain:!e.tables}):null,e.resultFields?l(Nf,{fields:e.resultFields,label:t.toolResult}):null,r?.input||r?.output?l("details",{class:`${Jt}-toolui-raw`,open:!e.tables,children:[l("summary",{children:t.stepRawData}),r.input?l(Of,{label:t.stepInput,text:r.input}):null,r.output?l(Of,{label:t.toolResult,text:r.output}):null]}):null]})}function Nf({fields:e,label:t,plain:r=!1}){let n=l("div",{class:`${Jt}-toolui-fields`,"data-plain":r?"true":void 0,children:l("table",{children:l("tbody",{children:e.map(({label:o,value:s},a)=>l("tr",{children:[l("th",{scope:"row",children:o}),l("td",{children:s})]},`${o}#${a}`))})})});return t?l("div",{class:`${Jt}-toolui-section`,children:[l("span",{class:`${Jt}-toolui-label`,children:t}),n]}):n}function Of({label:e,text:t}){return l("div",{class:`${Jt}-toolui-section`,children:[l("span",{class:`${Jt}-toolui-label`,children:e}),l("pre",{class:`${Jt}-toolui-code`,children:t})]})}var Ut=q.cssPrefix;function qf({part:e,view:t,strings:r,locale:n,canAct:o,onDecision:s,onEdit:a,preview:i}){let c=t.approval,u=t.status==="waiting"||t.status==="submitted"||t.status==="approved",p=e.toolCallId;return l("details",{class:`${Ut}-toolui ${Ut}-toolui-collapsible`,open:u||c?.buttons==="change"||void 0,"data-testid":t.status==="waiting"?D.toolApproval:D.toolDecision,"data-status":t.status,children:[l("summary",{class:`${Ut}-toolui-head`,children:[l("span",{class:`${Ut}-toolui-prompt`,children:u&&c?c.ask:t.name}),t.system?l("span",{class:`${Ut}-toolui-system`,children:t.system}):null,l("span",{class:`${Ut}-toolui-head-end`,children:[t.decision?l(Ho,{decision:t.decision}):null,t.statusLabel?l(qa,{status:t.status,label:t.statusLabel}):null,l("span",{class:`${Ut}-toolui-chevron`,children:l(sr,{})})]})]}),l("div",{class:`${Ut}-toolui-collapse-body`,children:[u&&i&&dn(e.toolMetadata)?l(HP,{toolName:e.toolName,input:e.inputSig.value,preview:i,strings:r,locale:n}):null,l(Ua,{view:t,strings:r}),c?.note?l("p",{class:`${Ut}-toolui-subtle`,children:c.note}):null,c?.buttons==="decide"?l("div",{class:`${Ut}-toolui-actions`,children:[l("button",{type:"button",class:`${Ut}-form-skip`,disabled:!o,onClick:()=>s(p,!1),"data-testid":D.toolDecline,children:r.decline}),l("button",{type:"button",class:`${Ut}-form-submit`,disabled:!o,onClick:()=>s(p,!0),"data-testid":D.toolApprove,children:r.approve})]}):null,c?.buttons==="change"?l("div",{class:`${Ut}-toolui-actions`,children:l("button",{type:"button",class:`${Ut}-form-skip`,onClick:()=>a(p),"data-testid":D.toolEdit,children:r.changeAnswer})}):null]})]})}function FP(e){if(!(typeof e!="object"||e===null)&&"totals"in e)return"number"in e&&"items"in e?`root = Root([preview])
|
|
68
|
+
`)??n):r;if(o)return t--,i&&(n=n.slice(2)),i?`
|
|
69
|
+
${n}`:"";l||(t++,i&&(n+="> "));let _={};s.replace(/(\w+)=(["'])(.*?)\2/g,(v,m,b,w)=>_[m]=w);let d=_.href??_.src,f=_.title??_.path??_.query??_.body??_.header??_.name??d;return(i?"> ":"")+(f?`**${d?`[${f}](${d})`:f}**${_.type?` \`${_.type}\``:""}
|
|
70
|
+
${n}`:"")})}var Ly=new Set(["http:","https:","mailto:","tel:"]),Oy=new Set(["http:","https:"]);function Ny(e){let t=document.createElement("a");return{...e,set_attr:(n,r,o)=>{if(r!==br&&r!==ro||(t.href=o,(r===br?Ly:Oy).has(t.protocol)))return e.set_attr(n,r,o);let i=r===ro?n.nodes[n.index]:void 0;i?.replaceWith(...i.childNodes)}}}function M_(e){for(let t of e.querySelectorAll("a")){let n=t.getAttribute("href")??"";!n||n.startsWith("#")||(t.target="_blank",t.rel="noopener noreferrer")}}var L_=new Set([11,12,13,14,15,16,17,18,19,31]);function va(e){let t="",n=[],r=io({data:void 0,add_token:(o,i)=>{n.push(i),L_.has(i)||(t+=" ")},end_token:()=>{let o=n.pop();o!==void 0&&!L_.has(o)&&(t+=" ")},add_text:(o,i)=>{t+=i},set_attr:()=>{}});return Qe(r,Dl(e)),yr(r),t.replaceAll(ga,"_").replace(/\s+/g," ").trim()}var N_=O.cssPrefix;function It({tone:e="info",message:t,onRetry:n,strings:r}){return a("div",{class:`${N_}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[a("span",{children:t}),n?a("button",{type:"button",class:`${N_}-module-retry`,onClick:n,children:r.errorRetry}):null]})}var Cn=O.cssPrefix,$y=oe.scope("content"),Dy=5e3;function $_({id:e,title:t,transport:n,strings:r,bus:o,onBack:i,actions:s}){let[l,c]=N(null),[u,p]=N(!1),[_,d]=N(!1),[f,v]=N(0),[m,b]=N(null),w=F(()=>{d(!1),c(null),v(x=>x+1)},[]);U(()=>{let x=!1,g=n.listContentCollections([]).catch(()=>{});return Promise.all([n.listContent({ids:[e],limit:1}),g]).then(([h,k])=>{if(x)return;let $=h.items[0];$?(c($),p(k?.items.find(I=>I.id===$.contentCollectionId)?.settings?.voteAccess==="portal"),o.emit("contentOpen",{contentId:e,contentCollectionId:$.contentCollectionId})):d(!0)}).catch(h=>{x||($y.warn("listContent (reader) failed",{err:h}),d(!0))}),()=>{x=!0}},[n,e,f,o]),U(()=>{if(!l)return;let x=setTimeout(()=>o.emit("contentRead",{contentId:e}),Dy);return()=>clearTimeout(x)},[l,e,o]);let y=F(x=>{let h=(x.target instanceof HTMLElement?x.target.closest("a"):null)?.getAttribute("href")??"";h&&!h.startsWith("#")&&o.emit("contentLinkClick",{contentId:e})},[o,e]);function P(x){b(e),n.setContentVote({contentId:e,value:x})}function C(){return _?a(It,{tone:"error",message:r.errorGeneric,onRetry:w,strings:r}):l===null?a(It,{message:r.contentLoading,strings:r}):a("article",{class:`${Cn}-content`,"data-testid":L.contentView,onClick:y,children:[l.image?a("img",{class:`${Cn}-content-hero`,src:l.image,alt:"",loading:"lazy"}):null,l.description?a("p",{class:`${Cn}-content-subtitle`,children:l.description}):null,a(ha,{text:O_(l.content??"")}),u?a("div",{class:`${Cn}-content-vote`,"aria-live":"polite",children:m===e?r.feedbackThanks:a(pe,{children:[a("span",{children:r.contentHelpful}),a("button",{type:"button",class:`${Cn}-module-retry`,onClick:()=>P(1),children:r.confirmYes}),a("button",{type:"button",class:`${Cn}-module-retry`,onClick:()=>P(0),children:r.confirmNo})]})}):null]})}return a("div",{class:`${Cn}-module`,children:[a(I_,{title:l?.title||t||r.moduleBack,backLabel:r.moduleBack,onBack:i,actions:s,testid:L.backHeader}),a("div",{class:`${Cn}-module-scroll`,"data-testid":L.contentScroll,children:C()})]})}function D_({itemCount:e,initialFocusIndex:t}){let[n,r]=N(!1),o=D(null),i=D(null),[s,l]=N(-1),c=F(()=>{r(!1),l(-1),o.current?.focus()},[]),u=F(()=>r(d=>!d),[]);U(()=>{if(!n)return;function d(f){let v=i.current,m=o.current;if(!v||!m)return;let b=f.composedPath();b.includes(v)||b.includes(m)||(r(!1),l(-1))}return document.addEventListener("click",d,!0),()=>document.removeEventListener("click",d,!0)},[n]),U(()=>{if(!n||e===0)return;let d=t?.()??0,f=d<0||d>=e?0:d;l(f)},[n,e,t]),U(()=>{if(!n||s<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[s]?.focus()},[n,s]);let p=F(d=>{(d.key==="ArrowDown"||d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r(!0))},[]),_=F(d=>{if(e!==0)switch(d.key){case"Escape":d.preventDefault(),d.stopPropagation(),c();return;case"ArrowDown":d.preventDefault(),l(f=>(f+1)%e);return;case"ArrowUp":d.preventDefault(),l(f=>(f-1+e)%e);return;case"Home":d.preventDefault(),l(0);return;case"End":d.preventDefault(),l(e-1)}},[e,c]);return{open:n,focusIndex:s,triggerRef:o,menuRef:i,toggle:u,close:c,onTriggerKey:p,onMenuKey:_}}function B_({items:e,triggerLabel:t}){let n=O.cssPrefix,r=D_({itemCount:e.length});function o(l){l.disabled||(l.onSelect?.(),l.keepOpen||r.close())}function i(l,c){return l.onSelectValue?.(c)}function s(l,c){let u=c.segments;if(!u?.length)return;let p=Math.max(0,u.findIndex(f=>f.value===c.value)),_=-1;if(l.key==="ArrowRight"||l.key==="Enter"||l.key===" ")_=(p+1)%u.length;else if(l.key==="ArrowLeft")_=(p-1+u.length)%u.length;else return;let d=u[_];d&&(l.preventDefault(),l.stopPropagation(),i(c,d.value))}return a("div",{class:`${n}-menu-wrap`,children:[a("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:a(c_,{})}),r.open?a("div",{ref:r.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:r.onMenuKey,tabIndex:-1,children:e.map(l=>l.segments?a("div",{role:"menuitem",class:`${n}-menu-item ${n}-menu-item-segmented`,"aria-label":l.label,tabIndex:-1,onKeyDown:c=>s(c,l),children:[l.icon?a("span",{class:`${n}-menu-icon`,children:l.icon}):null,a("span",{class:`${n}-menu-label`,children:l.label}),a("span",{class:`${n}-segmented`,role:"group","aria-label":l.label,children:l.segments.map(c=>{let u=c.value===l.value;return a("button",{type:"button",role:"menuitemradio","aria-checked":u,class:`${n}-segment`,"data-on":u?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${L.langSegment}-${c.value}`,onClick:()=>i(l,c.value),children:c.label},c.value)})})]},l.id):a("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":l.type==="switch"?l.on:void 0,disabled:l.disabled,onClick:()=>o(l),children:[l.icon?a("span",{class:`${n}-menu-icon`,children:l.icon}):null,a("span",{class:`${n}-menu-label`,children:l.label}),l.type==="switch"&&l.on?a("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:a(Rr,{})}):null]},l.id))}):null]})}var Bl=O.cssPrefix;function By(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 Uy={normal:"large",large:"small",small:"normal"};function zy(e){return e==="light"?a(v_,{}):e==="dark"?a(b_,{}):a(y_,{})}function Fy(e,t){let n=e.split("-")[0];return(t.some(o=>o!==e&&o.split("-")[0]===n)?e:n??e).toUpperCase()}function qy(e,t){let n;try{n=new URL(e,window.location.href)}catch{return}if(!(n.protocol!=="http:"&&n.protocol!=="https:"))return t.conversationId&&n.searchParams.set("chat",t.conversationId),n.searchParams.set("widgetId",t.widgetId),t.publicKey&&n.searchParams.set("public_key",t.publicKey),n.searchParams.set("ai_agent_deployment_id",t.aiAgentDeploymentId),n.href}function Yt({panelProps:e,variant:t,onEmailTranscript:n,onLogIn:r}){let{options:o,panelSize:i,feedback:s,onClose:l,onClear:c,onExpand:u,onFullscreen:p,onSoundToggle:_}=e,{onToggleHistory:d,onLocaleChange:f,onThemeChange:v,onTextSizeChange:m}=e,b=o.strings,w=o.mode,y=t==="chat",P=gt(()=>s.mutedSig.value).value,C=new Set(o.actions);function x(K){return C.has(K)}let g=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches;function h(K){return g?!1:kr(K,w,i)}let k=o.themeMode,$={auto:b.themeAuto,light:b.themeLight,dark:b.themeDark},I=o.textSize,B={small:b.textSizeSmall,normal:b.textSizeNormal,large:b.textSizeLarge},A=[];if(y&&x("clear")&&A.push({id:"clear",icon:a(m_,{}),label:b.newConversation,onSelect:c}),y&&n&&A.push({id:"emailTranscript",icon:a(ua,{}),label:b.emailTranscript,onSelect:n}),y&&r&&A.push({id:"logIn",icon:a(ln,{}),label:b.loginAction,onSelect:r}),x("expand")&&h("expand")){let K=i==="expanded";A.push({id:"expand",icon:K?a(o_,{}):a(r_,{}),label:K?b.collapse:b.expand,type:"switch",on:K,onSelect:u})}if(x("fullscreen")&&h("fullscreen")){let K=i==="fullscreen";A.push({id:"fullscreen",icon:K?a(a_,{}):a(i_,{}),label:K?b.exitFullscreen:b.fullscreen,type:"switch",on:K,onSelect:p})}let z=o.popOutUrl,j=o.aiAgentDeploymentId;x("popOut")&&z&&j&&kr("popOut",w,i)&&A.push({id:"popOut",icon:a(s_,{}),label:b.popOut,onSelect:()=>{let K=qy(z,{conversationId:e.conversationId,widgetId:o.widgetId,publicKey:o.publicKey,aiAgentDeploymentId:j});K&&window.open(K,"_blank","noopener,noreferrer")}}),y&&x("sound")&&A.push({id:"sound",icon:P?a(u_,{}):a(d_,{}),label:P?b.soundOff:b.soundOn,type:"switch",on:!P,onSelect:_}),x("theme")&&k!=="host"&&A.push({id:"theme",icon:zy(k),label:`${b.theme}: ${$[k]}`,onSelect:()=>v(By(k)),keepOpen:!0}),x("textSize")&&A.push({id:"textSize",icon:a(p_,{}),label:`${b.textSize}: ${B[I]}`,onSelect:()=>m(Uy[I]),keepOpen:!0}),x("language")&&o.availableLocales.length>1&&A.push({id:"language",icon:a(f_,{}),label:b.language,segments:o.availableLocales.map(K=>({value:K,label:Fy(K,o.availableLocales),lang:K})),value:o.locale,onSelectValue:f});let Y=!!l&&aa(w,i,o.actions),ie=y&&x("history");return a("div",{class:`${Bl}-header-actions`,children:[ie?a("button",{type:"button",class:`${Bl}-icon-btn`,onClick:d,"aria-label":b.history,title:b.history,"data-testid":L.actionHistory,children:a(__,{})}):null,A.length>0?a(B_,{items:A,triggerLabel:b.moreActions}):null,Y?a("button",{type:"button",class:`${Bl}-icon-btn`,onClick:l,"aria-label":b.close,title:b.close,"data-testid":L.actionClose,children:a(wt,{})}):null]})}var U_={Icon:wo};function cn(e,t){return e instanceof Le?e.status===429?e.retryAfterSeconds?t.errorRateLimitedIn.replace("{seconds}",String(e.retryAfterSeconds)):t.errorRateLimited:e.code==="network"?t.errorOffline:e.status===403?t.errorOriginNotAllowed:e.errorCode==="MESSAGE_TOO_LONG"?t.errorMessageTooLong:e.status!==void 0&&e.status>=500?t.errorServer:t.errorGeneric:t.errorGeneric}var Er=O.cssPrefix;function z_({placeholder:e,onActivate:t}){return a("button",{type:"button",class:`${Er}-home-search`,onClick:t,"data-testid":L.homeSearch,children:[a("span",{class:`${Er}-home-search-text`,children:e}),a("span",{class:`${Er}-home-search-icon`,"aria-hidden":"true",children:a($l,{})})]})}function F_({placeholder:e,value:t,onInput:n}){return a("div",{class:`${Er}-home-search`,"data-input":"true",children:[a("input",{type:"search",class:`${Er}-home-search-input`,placeholder:e,value:t,maxLength:200,onInput:r=>n(r.currentTarget.value),"data-testid":L.helpSearch}),a("span",{class:`${Er}-home-search-icon`,"aria-hidden":"true",children:a($l,{})})]})}var To=O.cssPrefix;function ba({title:e,subtitle:t,onClick:n,testid:r}){return a("button",{type:"button",class:`${To}-list-row`,onClick:n,"data-testid":r,children:[a("span",{class:`${To}-list-row-body`,children:[a("span",{class:`${To}-list-row-title`,children:e}),t?a("span",{class:`${To}-list-row-sub`,children:t}):null]}),a("span",{class:`${To}-list-row-chevron`,"aria-hidden":"true",children:a(ca,{})})]})}var Jt=O.cssPrefix,Hy=oe.scope("help"),jy=20,Vy=300;function Wy(e,t,n){let r=new Map(n.map(o=>[o.id,o.title]));return t.map(o=>({id:o,title:r.get(o),rows:e.filter(i=>i.contentCollectionId===o)})).filter(o=>o.rows.length>0)}function q_({transport:e,strings:t,bus:n},r,o){let[i,s]=N(),l=D(void 0),c=r?.join(",");function u(p){if(!r?.length)return;let _={};l.current=_,s(d=>({search:o,items:[],collections:[],...d,pagination:p>1?d?.pagination:void 0,loading:!0,error:void 0})),Promise.all([e.listContent({contentCollectionIds:r,sortBy:"order",page:p,limit:jy,search:o}),p>1?void 0:e.listContentCollections(r)]).then(([d,f])=>{l.current===_&&(s(v=>({search:o,items:[...p>1?v?.items??[]:[],...d.items],collections:f?.items??v?.collections??[],pagination:d.pagination,loading:!1})),!(p>1)&&(o?n.emit("contentSearch",{queryLength:o.length,hitCount:d.pagination.total}):n.emit("contentView",{section:"help",count:d.items.length})))}).catch(d=>{l.current===_&&(Hy.warn("listContent (help) failed",{err:d,page:p}),s(f=>f&&{...f,loading:!1,error:cn(d,t)}))})}return U(()=>{if(!r?.length){s(void 0);return}return u(1),()=>{l.current=void 0}},[e,c,o]),[i,()=>!i?.loading&&u((i?.pagination?.page??0)+1)]}function Gy(e){let{strings:t,config:n,nav:r,panelProps:o}=e,i=n.contentCollectionIds,[s,l]=N(""),[c,u]=N(""),p=q_(e,i),_=q_(e,c?i:void 0,c),[d,f]=s.trim()?_:p;U(()=>{let m=setTimeout(()=>u(s.trim()),Vy);return()=>clearTimeout(m)},[s]);function v(){if(!i?.length)return a(It,{message:t.helpEmpty,strings:t});let m=d?.error?a(It,{tone:"error",message:d.error,onRetry:f,strings:t}):null;return m&&!d?.pagination?m:!d||!d.pagination&&!d.items.length?a(It,{message:t.helpLoading,strings:t}):d.items.length?a(pe,{children:[Wy(d.items,i,d.collections).map(b=>a("section",{class:`${Jt}-help-group`,children:[b.title?a("h2",{class:`${Jt}-help-section-title`,children:b.title}):null,a("div",{class:`${Jt}-help-card`,children:b.rows.map(w=>a(ba,{title:w.title,subtitle:w.description,onClick:()=>w.url?yo(w.url):r.push({kind:"content",id:w.id,title:w.title}),testid:ft(L.helpArticle,w.id)},w.id))})]},b.id)),m,d.pagination?.hasNext&&!m?a("div",{children:a("div",{class:`${Jt}-help-card`,children:a("button",{type:"button",class:`${Jt}-list-row ${Jt}-help-more`,onClick:f,"aria-busy":d.loading,children:[d.loading?a("span",{class:`${Jt}-loading-spinner`,"aria-hidden":"true"}):null,t.helpShowMore]})})}):null]}):a(It,{message:d.search?t.helpSearchEmpty.replace("{query}",d.search):t.helpEmpty,strings:t})}return a("div",{class:`${Jt}-module`,children:[a(ma,{title:t.helpTitle,actions:a(Yt,{panelProps:o,variant:"plain"})}),a("div",{class:`${Jt}-module-pad`,children:a(F_,{placeholder:t.helpSearchPlaceholder,value:s,onInput:l})}),a("div",{class:`${Jt}-help-list`,children:v()})]})}var H_={Icon:So,Root:e=>a(Gy,{...e})};var j_=oe.scope("attachments");function ya(e,t,n){let r=Qy(e),o=[],i=[],s=W_(n.accept),l=t.reduce((u,p)=>u+p.size,0),c=t.length;for(let u of r){let p=Ky(u,c,l,n,s);if(p){i.push({file:u,reason:p});continue}o.push(Zy(u)),l+=u.size,c+=1}return(o.length||i.length)&&j_.debug("ingest",{accepted:o.length,rejected:i.map(u=>({name:u.file.name,reason:u.reason}))}),{accepted:o,rejected:i}}function Mr(e){let t=Math.min(Math.floor(Math.log10(Math.max(e,1))/3),2);return new Intl.NumberFormat(void 0,{style:"unit",unit:["byte","kilobyte","megabyte"][t],unitDisplay:"narrow",maximumFractionDigits:1}).format(e/1e3**t)}function V_(e,t){let n=W_(t);return!e||n.length===0||n.some(r=>r.kind==="ext"||G_(new File([],"",{type:e}),[r]))}function Lr(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){j_.debug("revokeObjectURL failed",{error:t})}}function Ky(e,t,n,r,o){return t>=r.maxCount?"count":n+e.size>r.maxBytes?"bytes":G_(e,o)?null:"mime"}function Qy(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:Yy(t)).filter(t=>t!==null):[]}function Yy(e){let t=Jy(e)?e:null;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function Jy(e){return Xy(e)&&(e.getAsFile===void 0||typeof e.getAsFile=="function")}function Xy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Zy(e){return{file:e,id:Mt(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function W_(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 G_(e,t){if(t.length===0)return!0;let[n="*",r="*"]=(e.type||"").toLowerCase().split("/"),o=(e.name||"").toLowerCase();return t.some(i=>i.kind==="ext"?o.endsWith(i.ext):i.type==="image"&&i.subtype==="*"&&/\.(heic|heif|avif|bmp|tif|tiff)$/.test(o)?!0:(i.type==="*"||i.type===n)&&(i.subtype==="*"||i.subtype===r))}var Tn=O.cssPrefix,eP={error:Ar,done:Rr};function K_({attachment:e,upload:t,strings:n,onRemove:r,disabled:o=!1}){let i=/^image\/(jpeg|png|gif|webp|avif|bmp|x-ms-bmp|svg\+xml)$/i.test(e.mediaType),s=Math.round((t?.fraction??0)*100),l=Mr(e.size),c=t?.status==="error"||t?.status==="done"?eP[t.status]:void 0;return a("span",{class:`${Tn}-attachment-chip`,"data-upload":t?.status,title:e.name,"data-testid":ft(L.attachmentChip,e.id),children:[i?a("img",{class:`${Tn}-attachment-thumb`,src:e.previewUrl,alt:""}):a("span",{class:`${Tn}-attachment-thumb`,"aria-hidden":"true",children:a(pa,{})}),a("span",{class:`${Tn}-attachment-text`,children:[a("span",{class:`${Tn}-attachment-name`,children:e.name}),a("span",{class:`${Tn}-attachment-meta`,children:[c?a(c,{}):null,t?.status==="uploading"?`${s}% \xB7 ${l}`:l]})]}),a("button",{type:"button",class:`${Tn}-attachment-remove`,onClick:r,disabled:o,"aria-label":n.removeAttachment.replace("{name}",e.name),"data-testid":ft(L.attachmentRemove,e.id),children:a(wt,{})}),t?.status==="uploading"?a("span",{class:`${Tn}-attachment-progress`,role:"progressbar","aria-label":e.name,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":s,children:a("span",{style:{width:`${s}%`}})}):null]})}var Q_=new WeakMap;function Pa(e){e.currentTarget&&Q_.set(e.currentTarget,e.timeStamp)}function xa(e){let t=e.currentTarget?Q_.get(e.currentTarget):void 0;return e.isComposing||t!==void 0&&e.timeStamp-t<100}var Sa=O.cssPrefix;function Ro({text:e,retryLabel:t,onRetry:n,retryTestId:r}){return a("div",{class:`${Sa}-error`,role:"alert",children:[a("span",{class:`${Sa}-error-icon`,"aria-hidden":"true",children:a(Ar,{})}),a("span",{class:`${Sa}-error-text`,children:e}),n&&t?a("button",{type:"button",class:`${Sa}-error-retry`,onClick:n,"data-testid":r,children:t}):null]})}var Ul={isSupported:!1,start:()=>{},stop:()=>{},cancel:()=>{}};function zl(e,t,n){return e==="disabled"?Ul:e==="server"?oP(n):tP(t)}function tP(e){let t=nP();if(!t)return Ul;let n=null,r=0;return{isSupported:!0,start(o,i){let s=n,l=++r;n=null,s?.abort();let c=new t;n=c,c.continuous=!0,c.interimResults=!0,c.lang=e;let u=!1;c.addEventListener("result",_=>{if(r!==l||n!==c)return;let d=_,f="",v=!1;for(let m=d.resultIndex;m<d.results.length;m++){let b=d.results[m];b&&(f+=b[0].transcript,b.isFinal&&(v=!0))}o(f,v)});function p(_){u||r!==l||n!==c||(u=!0,n=null,i(_))}c.addEventListener("end",()=>p(!1)),c.addEventListener("error",_=>p("error"in _&&(_.error==="not-allowed"||_.error==="service-not-allowed")));try{c.start()}catch{p(!1)}},stop(){n?.stop()},cancel(){r++;let o=n;n=null,o?.abort()}}}function nP(){return window.SpeechRecognition??window.webkitSpeechRecognition}var rP=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function oP(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return Ul;let t=0,n=null;function r(s){for(let l of s.stream?.getTracks()??[])l.stop();s.stream=null}function o(){t++;let s=n;n=null,s&&(r(s),s.recorder?.state!=="inactive"&&s.recorder?.stop())}async function i(s){if(s.finishing)return;s.finishing=!0;let l=s.recorder?.mimeType??"audio/webm";r(s);let c=new Blob(s.chunks,{type:l});s.chunks=[];try{let{text:u}=await e(c,l);n===s&&t===s.generation&&u&&s.onText(u,!0)}catch{}finally{n===s&&t===s.generation&&(n=null,s.onEnd(!1))}}return{isSupported:!0,async start(s,l){o();let c={generation:t,recorder:null,stream:null,chunks:[],onText:s,onEnd:l,finishing:!1};n=c;try{let u=await navigator.mediaDevices.getUserMedia({audio:!0});if(n!==c||t!==c.generation){for(let d of u.getTracks())d.stop();return}c.stream=u;let p=iP(),_=new MediaRecorder(u,p?{mimeType:p}:void 0);c.recorder=_,_.addEventListener("dataavailable",d=>{n===c&&t===c.generation&&d.data.size>0&&c.chunks.push(d.data)}),_.addEventListener("stop",()=>{n===c&&t===c.generation&&i(c)}),_.start()}catch(u){r(c),n===c&&t===c.generation&&(n=null,l(u instanceof DOMException&&u.name==="NotAllowedError"))}},stop(){let s=n;if(s){if(!s.recorder){o();return}s.recorder.state!=="inactive"&&s.recorder.stop()}},cancel(){o()}}}function iP(){for(let e of rP)if(MediaRecorder.isTypeSupported(e))return e}function aP(e,{file:t,reason:n},r){return n==="count"?e.attachmentTooMany.replace("{count}",String(r.maxCount)):n==="bytes"?e.attachmentTooLarge.replace("{name}",t.name).replace("{max}",Mr(r.maxBytes)):e.attachmentMimeRejected.replace("{name}",t.name)}var He=O.cssPrefix,Or=oe.scope("composer"),sP=300;function Nr(e){return e.reduce((t,n)=>t+n.size,0)}var Fl={arrowUp:e_,paperPlane:Zp,send:t_,chevron:ca};function Y_(e){return"activeElement"in e}function lP(e){return"host"in e&&"activeElement"in e}function cP(e){return"clipboardData"in e}function J_({options:e,transport:t,feedback:n,bus:r,persistence:o,conversationId:i,maxMessageCharacters:s,isStreaming:l,pageToolRunning:c=!1,isMemoryCompacting:u=!1,canReleaseQueuedMessages:p=!0,queueManualMessages:_=!1,replyAwaitsCard:d=!1,active:f=!0,isPreparing:v=!1,attachmentUploadsSig:m,operatorRequestEnabled:b,canRequestOperator:w=!1,controlMode:y="ai-agent",onRequestOperator:P,onSend:C,onStop:x,apiRef:g}){let h=e.strings,[k,$]=N(()=>o.loadDraft(i)),[I,B]=N([]),[A,z]=N(),[j,Y]=N(()=>o.loadMessageQueue(i).map(q=>({id:q.id,text:q.text,attachments:[]}))),ie=D(j),K=D(!1),Te=D(void 0),[Re,ye]=N(!1),[Oe,fe]=N(!1),[tt,ht]=N(!1),[nt,bt]=N(!1),Ee=D(!1),Ue=D(null),Tt=D(null),mt=D(null),ze=D(0),ae=D(i);ae.current=i;let ve=D(f);ve.current=f;let _e=D(v);_e.current=v;let be=nt||v||!f,Ce=l&&y==="ai-agent",ct=Ce||u&&y==="ai-agent",M=y==="ai-agent"&&(ct||_||j.length>0),R=F(q=>{Y(Q=>{let W=q(Q);return o.saveMessageQueue(ae.current,W.filter(ce=>ce.attachments.length===0).map(({id:ce,text:Me})=>({id:ce,text:Me}))),ie.current=W,W})},[o]),G=F(q=>{R(Q=>(Q.find(W=>W.id===q)?.attachments.forEach(Lr),Q.filter(W=>W.id!==q)))},[R]),V=F(q=>{$(Q=>{let W=(typeof q=="function"?q(Q):q).slice(0,s);return W===Q?Q:(o.saveDraft(ae.current,W),W)})},[o,s]),ee=e.features.fileUpload,me=e.features.voice,[le,ge]=N(()=>zl(me,e.locale,(q,Q)=>t.transcribe(q,Q))),Ye=D(le);Ye.current=le;let $e=D({mode:me,locale:e.locale,transport:t});U(()=>{let q=$e.current;q.mode===me&&q.locale===e.locale&&q.transport===t||($e.current={mode:me,locale:e.locale,transport:t},ze.current++,Ye.current.cancel(),mt.current=null,fe(!1),ge(zl(me,e.locale,(Q,W)=>t.transcribe(Q,W))))},[e.locale,me,t]),ut(()=>()=>{ze.current++,le.cancel()},[le]);let rt=F(q=>{let Q=mt.current;if(Q===null)return!1;let W=Math.round(performance.now()-Q);return Or[q]("voiceStop",{durationMs:W}),r.emit("voiceStop",{durationMs:W}),mt.current=null,!0},[r]),Be=F(()=>{mt.current!==null&&(le.stop(),fe(!1),rt("info")&&n.play("voiceStop"))},[rt,n,le]),yt=F(()=>{ze.current++,le.cancel(),fe(!1),rt("info")&&n.play("voiceStop")},[rt,n,le]);U(()=>{(v||!f)&&yt()},[f,yt,v]),U(()=>{let q=Ue.current;if(!q)return;let Q=q.getRootNode(),W=Y_(Q)?Q.activeElement:null;W&&q.closest(`.${He}-panel`)?.contains(W)||q.focus({preventScroll:!0})},[]),U(()=>{let q=Ue.current;if(!q)return;if(k.length===0){q.style.height="";return}q.style.height="auto";let Q=getComputedStyle(q),W=Number.parseFloat(Q.getPropertyValue(`--${He}-textarea-base-height`)),ce=Number.parseFloat(Q.borderTopWidth)+Number.parseFloat(Q.borderBottomWidth),Me=Math.min(q.scrollHeight+ce,Number.parseFloat(Q.maxHeight)),vt=Number.parseFloat(Q.fontSize)*.7;q.style.height=`${Me<W+vt?W:Me}px`},[k]);let Et=D(I);Et.current=I,U(()=>()=>{Et.current.forEach(Lr);for(let q of ie.current)q.attachments.forEach(Lr)},[]),ut(()=>{if(g)return g.current={attachFromDrop:q=>{if(!ee||!ve.current||Ee.current||_e.current)return;let Q=ya(q,Et.current,e.attachments);z(Q.rejected[0]),Q.accepted.length!==0&&(Or.info("attach (drop)",{count:Q.accepted.length,totalBytes:Nr(Q.accepted)}),r.emit("attach",{count:Q.accepted.length,totalBytes:Nr(Q.accepted)}),B(W=>[...W,...Q.accepted]))},fill:q=>{if(!ve.current||Ee.current||_e.current)return;V(q);let Q=Ue.current;Q&&(Q.focus({preventScroll:!0}),requestAnimationFrame(()=>Q.setSelectionRange(Q.value.length,Q.value.length)))},acceptQueuedMessage:G},()=>{g.current&&(g.current=null)}},[g,ee,v,e.attachments,G,V]),U(()=>{let q=Ue.current;if(!q)return;let Q=q.closest(`.${He}-panel`);if(!Q)return;let W=Me=>{if(!ve.current||Ee.current||_e.current)return;let vt=Me.clipboardData;if(!vt)return;let Xt=Me.target instanceof HTMLElement?Me.target.closest("input, textarea, [contenteditable]:not([contenteditable='false'])"):null;if(Xt&&Xt!==q)return;if(ee){let Rt=ya(vt.items,Et.current,e.attachments);if(z(Rt.rejected[0]),Rt.accepted.length>0){Me.preventDefault(),Or.info("attach (paste)",{count:Rt.accepted.length,totalBytes:Nr(Rt.accepted)}),r.emit("attach",{count:Rt.accepted.length,totalBytes:Nr(Rt.accepted)}),B(Ha=>[...Ha,...Rt.accepted]);return}}if(Xt===q)return;let Zt=vt.getData("text/plain");Zt&&(Me.preventDefault(),V(Rt=>Rt+Zt),q.focus())};function ce(Me){cP(Me)&&W(Me)}return Q.addEventListener("paste",ce),()=>Q.removeEventListener("paste",ce)},[ee,e.attachments,V]);async function Ot(){let q=k.trim();if(!q&&I.length===0||!f||Ce||Ee.current||v)return;yt(),Ee.current=!0,bt(!0);let Q=k,W=I;try{await C(q,W)&&(z(void 0),V(ce=>ce===Q?"":ce),B(ce=>ce!==W?ce:(W.forEach(Lr),Et.current=[],[])))}finally{Ee.current=!1,bt(!1),requestAnimationFrame(()=>{let ce=Ue.current;if(!ce||ce.disabled||!ve.current)return;let Me=ce.getRootNode(),vt=Y_(Me)?Me.activeElement:null,Xt=vt?.getAttribute("data-testid");if(!(vt&&vt!==ce&&Xt!==L.composerSend&&Xt!==L.composerStop)){if(lP(Me)){let Zt=Me.host.ownerDocument;if(!Zt.hasFocus())return;let Rt=Zt.activeElement;if(Rt&&Rt!==Me.host&&Rt!==Zt.body)return}ce.focus({preventScroll:!0})}})}}function ot(){let q=k.trim();if(!q&&I.length===0||!f||!M||Ee.current||v)return;yt();let Q=I;R(W=>[...W,{id:Mt(),text:q,attachments:Q}]),ct||ye(!0),V(""),B(W=>W!==Q?W:(Et.current=[],[])),Ue.current?.focus({preventScroll:!0})}U(()=>{ct&&(K.current=!1,Te.current=void 0,ye(!1))},[ct]),U(()=>{let q=j[0];if(!q||!p||ct||K.current||nt||v||!f)return;let Q=d&&!Re?(Te.current??(Te.current=performance.now()+e.cardAnswerWaitSeconds*1e3))-performance.now():0,W=setTimeout(()=>{K.current=!0,C(q.text,q.attachments,q.id).then(ce=>{if(ce){G(q.id);return}K.current=!1})},Math.max(Q,sP));return()=>clearTimeout(W)},[f,p,Re,v,C,e.cardAnswerWaitSeconds,ct,j,G,d,nt]);function dt(q){q.key!=="Enter"||q.shiftKey||xa(q)||(q.preventDefault(),M&&(k.trim()||I.length>0)?ot():Ce?x():Ot())}function Bt(q){if(!(q.target instanceof HTMLInputElement))return;let Q=q.target;if(!f||Ee.current||v){Q.value="";return}let W=ya(Q.files,I,e.attachments);z(W.rejected[0]),W.accepted.length>0&&(Or.info("attach (file picker)",{count:W.accepted.length,totalBytes:Nr(W.accepted)}),r.emit("attach",{count:W.accepted.length,totalBytes:Nr(W.accepted)}),B(ce=>[...ce,...W.accepted])),Q.value=""}function rr(q){!f||Ee.current||v||(Or.info("removeAttachment",{id:q}),r.emit("removeAttachment",{id:q}),z(void 0),B(Q=>{let W=Q.find(ce=>ce.id===q);return W&&Lr(W),Q.filter(ce=>ce.id!==q)}))}function or(){if(Oe){Be();return}if(!f||!le.isSupported||Ee.current||v)return;let q=++ze.current;mt.current=performance.now(),Or.info("voiceStart"),r.emit("voiceStart",void 0),ht(!1),fe(!0),n.play("voiceStart"),le.start((Q,W)=>{ze.current!==q||!ve.current||_e.current||Ee.current||!W||V(ce=>`${ce}${Q} `)},Q=>{ze.current!==q||!ve.current||(fe(!1),ht(Q),rt("debug"))})}let In=Fl[e.composer.sendButton.icon],ir=!!(k.trim()||I.length>0),En=m?.value,qo=I.some(q=>En?.get(q.id)?.status==="uploading"),Mn=I.filter(q=>En?.get(q.id)?.status==="error"),ar=Mn.find(q=>En?.get(q.id)?.refusal),qa=ar&&(En?.get(ar.id)?.refusal==="INVALID_FILE_TYPE"?h.attachmentMimeRejected:h.attachmentUploadFailed).replace("{name}",ar.name),Ho=Ce||qo||c&&!ir;return a("div",{class:`${He}-composer`,part:"composer","data-testid":L.composer,children:[j.length>0?a("div",{class:`${He}-message-queue`,"aria-label":h.queueMessage,"data-testid":L.messageQueue,children:j.map(q=>a("div",{class:`${He}-attachment-chip ${He}-queued-message`,"data-testid":`${L.queuedMessage}-${q.id}`,children:[a("span",{class:`${He}-attachment-name ${He}-queued-text`,children:q.text||q.attachments.map(Q=>Q.name).join(", ")}),a("button",{type:"button",class:`${He}-attachment-remove`,onClick:()=>G(q.id),"aria-label":h.removeQueuedMessage,title:h.removeQueuedMessage,"data-testid":`${L.queuedMessageRemove}-${q.id}`,children:a(wt,{})})]},q.id))}):null,I.length>0?a("div",{class:`${He}-attachments`,children:I.map(q=>a(K_,{attachment:q,upload:En?.get(q.id),strings:h,onRemove:()=>rr(q.id),disabled:be},q.id))}):null,Mn.length>0&&!be?a(Ro,{text:qa??h.attachmentUploadFailed.replace("{name}",Mn.map(q=>q.name).join(", ")),retryLabel:h.errorRetry,onRetry:ar?void 0:()=>{Ot()},retryTestId:L.attachmentRetry}):null,A?a("p",{class:`${He}-field-error`,role:"alert",children:aP(h,A,e.attachments)}):null,tt?a("p",{class:`${He}-field-error`,role:"alert",children:h.micBlocked}):null,s!==void 0&&k.length>=s*.9?a("p",{class:`${He}-field-${k.length<s?"hint":"error"}`,"data-testid":L.composerCount,children:`${k.length} / ${s}`}):null,a("div",{class:`${He}-composer-row`,children:[a("div",{class:`${He}-composer-actions`,children:[ee?a("button",{type:"button",class:`${He}-icon-btn`,onClick:()=>Tt.current?.click(),disabled:be,"aria-label":h.attach,title:h.attach,"data-testid":L.composerAttach,children:a(da,{})}):null,le.isSupported?a("button",{type:"button",class:`${He}-icon-btn`,onClick:or,disabled:be,"aria-label":Oe?h.micStop:h.micStart,title:Oe?h.micStop:h.micStart,"aria-pressed":Oe,"data-recording":Oe?"true":void 0,"data-testid":L.composerVoice,children:a(n_,{})}):null,b&&y==="ai-agent"&&P?a("button",{type:"button",class:`${He}-icon-btn`,onClick:P,disabled:be||!w,"aria-label":h.talkToOperator,title:h.talkToOperator,"data-testid":L.operatorRequest,children:a(ln,{})}):null]}),a("textarea",{ref:Ue,name:"message",class:`${He}-textarea`,rows:1,value:k,maxLength:s,placeholder:h.composerPlaceholder,onInput:q=>V(q.currentTarget.value),onKeyDown:dt,onCompositionEnd:Pa,disabled:be,"aria-label":h.composerPlaceholder,"data-testid":L.composerInput}),M&&ir?a("button",{type:"button",class:`${He}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:ot,disabled:be,"aria-label":h.queueMessage,title:h.queueMessage,"data-testid":L.composerSend,children:a(In,{})}):null,Ho?a("button",{type:"button",class:`${He}-send`,onClick:x,disabled:be&&!qo,"aria-label":h.stop,"data-testid":L.composerStop,children:a(wn,{})}):null,!Ho&&(!M||!ir)?a("button",{type:"button",class:`${He}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:()=>{Ot()},disabled:be||!k.trim()&&I.length===0,"aria-label":h.send,"data-testid":L.composerSend,children:a(In,{})}):null]}),a("input",{ref:Tt,name:"attachments",type:"file",multiple:!0,accept:e.attachments.accept,onChange:Bt,disabled:be,class:`${He}-sr-only`,"data-testid":L.composerFileInput})]})}var X_=O.cssPrefix;function wa({onClick:e,children:t,testid:n}){return e?a("button",{type:"button",class:`${X_}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):a("div",{class:`${X_}-home-card`,"data-testid":n,children:t})}function ka(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var Ft=O.cssPrefix,dP=oe.scope("news"),uP=10;function ql(e,t){let n=e?new Date(e):void 0;if(!(!n||Number.isNaN(n.getTime())))return new Intl.DateTimeFormat(t,{dateStyle:"medium"}).format(n)}function pP({options:e,transport:t,strings:n,config:r,nav:o,bus:i,panelProps:s,latestNews:l}){let c=r.contentCollectionIds,u=c?.join(","),[p,_]=N({items:[],loading:!0}),d=D(void 0);function f(w){if(!c?.length)return;let y={};d.current=y,_(P=>({...P,loading:!0,error:void 0})),t.listContent({contentCollectionIds:c,sortBy:"publishedAt",sortOrder:"desc",page:w,limit:uP}).then(P=>{if(d.current!==y||(_(x=>({items:w>1?[...x.items,...P.items]:P.items,pagination:P.pagination,loading:!1})),w>1))return;i.emit("contentView",{section:"news",count:P.items.length});let C=P.items[0];C&&l.markSeen(C.id)}).catch(P=>{d.current===y&&(dP.warn("listContent (news) failed",{err:P,page:w}),_(C=>({...C,loading:!1,error:cn(P,n)})))})}function v(){p.loading||f((p.pagination?.page??0)+1)}U(()=>(_({items:[],loading:!0}),f(1),()=>{d.current=void 0}),[t,u]);function m(w){let y=ql(w.publishedAt,e.locale);return a("button",{type:"button",class:`${Ft}-news-card`,onClick:()=>o.push({kind:"content",id:w.id,title:w.title}),"data-testid":ft(L.newsItem,w.id),children:[w.image?a("img",{class:`${Ft}-news-hero`,src:w.image,alt:"",loading:"lazy"}):null,a("span",{class:`${Ft}-news-body`,children:[a("span",{class:`${Ft}-news-title`,children:w.title}),y||w.tags?.length?a("span",{class:`${Ft}-news-meta`,children:[y?a("time",{dateTime:w.publishedAt,children:y}):null,w.tags?.map(P=>a("span",{class:`${Ft}-news-tag`,children:P},P))]}):null,w.description?a("span",{class:`${Ft}-news-summary`,children:w.description}):null]})]},w.id)}function b(){if(!c?.length)return a(It,{message:n.newsEmpty,strings:n});let w=p.error?a(It,{tone:"error",message:p.error,onRetry:v,strings:n}):null;return w&&!p.pagination?w:p.pagination?p.items.length?a("div",{class:`${Ft}-news-list`,children:[p.items.map(m),w,p.pagination.hasNext&&!w?a("button",{type:"button",class:`${Ft}-news-more`,onClick:v,"aria-busy":p.loading,"data-testid":L.newsMore,children:[p.loading?a("span",{class:`${Ft}-loading-spinner`,"aria-hidden":"true"}):null,n.newsShowMore]}):null]}):a(It,{message:n.newsEmpty,strings:n}):a(It,{message:n.newsLoading,strings:n})}return a("div",{class:`${Ft}-module`,children:[a(ma,{title:n.newsTitle,actions:a(Yt,{panelProps:s,variant:"plain"})}),a("div",{class:`${Ft}-module-scroll`,children:b()})]})}var Z_={Icon:_a,Root:e=>a(pP,{...e})};var Pe=O.cssPrefix,ef=oe.scope("home");function _P(e){let t=e.options.userContext?.name,n=e.config.greetingText?at(e.strings,e.config.greetingText):void 0;if(n){let r=t?n.replace("{name}",t):n.replace(/\s*\{name\}\s*/," ").trim(),o=e.strings.homeGreetingLead;return{title:r,subtitle:r.toLowerCase()===o.toLowerCase()?void 0:o}}return t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}function fP(e,t){return t.url?yo(t.url):e.push({kind:"content",id:t.id,title:t.title})}function mP({options:e,onAsk:t}){let[n,r]=N(""),{sendButton:o}=e.composer,i=Fl[o.icon];function s(l){l.preventDefault();let c=n.trim();c&&(r(""),t(c))}return a("form",{class:`${Pe}-home-search ${Pe}-home-ask`,"data-input":"true",onSubmit:s,"data-testid":L.homeAsk,children:[a("input",{type:"text",class:`${Pe}-home-search-input`,placeholder:e.strings.homeAskPlaceholder,"aria-label":e.strings.homeAskPlaceholder,value:n,enterKeyHint:"send",onInput:l=>r(l.currentTarget.value)}),a("button",{type:"submit",class:`${Pe}-send`,"data-shape":o.shape,"data-variant":o.variant,disabled:!n.trim(),"aria-label":e.strings.send,children:a(i,{})})]})}function tf(e,t){return sn(e,t,t.type!=="upsert"||t.activity===!0)}function gP(e){let{transport:t,strings:n,config:r,nav:o,bus:i,panelProps:s,latestNews:l}=e,[c,u]=N(null),[p,_]=N([]),d=r.contentCollectionIds?.join(","),f=e.options.modules.list.some(g=>g.layout==="chat");U(()=>{if(r.showRecentConversations===!1)return;let g=!1,h=!0,k=[],$=t.subscribeConversationChanges(I=>{h&&k.push(I),u(B=>tf(B?[B]:[],I)[0]??null)});return t.listConversations({limit:f?50:1}).then(I=>{if(g)return;let B=k.reduce(tf,I.conversations);k=[],h=!1,u(B[0]??null)}).catch(I=>{g||(k=[],h=!1,ef.warn("listConversations (home) failed",{err:I}))}),()=>{g=!0,$()}},[t,r.showRecentConversations,f]),U(()=>{if(!r.contentCollectionIds?.length)return;let g=!1;return t.listContent({contentCollectionIds:r.contentCollectionIds,pinned:!0,limit:6}).then(h=>{g||(_(h.items),i.emit("contentView",{section:"home",count:h.items.length}))}).catch(h=>!g&&ef.warn("listContent (home) failed",{err:h})),()=>{g=!0}},[t,d,i]);let v=_P(e),m=r.userAvatars??[],b=r.status,w=b?.text?at(n,b.text):n.homeStatus,y=b?.url,P=r.contentBlockTitle?at(n,r.contentBlockTitle):n.homeContentTitle,C=l.item,x=ql(C?.publishedAt,e.options.locale);return a("div",{class:`${Pe}-module ${Pe}-home`,"data-testid":L.homeView,children:a("div",{class:`${Pe}-home-scroll`,children:[a("div",{class:`${Pe}-home-hero`,children:[a("div",{class:`${Pe}-home-hero-top`,children:[r.brandName?a("span",{class:`${Pe}-home-brand`,"data-testid":L.homeBrand,children:r.brandName}):a("span",{class:`${Pe}-home-brand-spacer`,"aria-hidden":"true"}),a("div",{class:`${Pe}-home-hero-actions`,children:[m.length>0?a("div",{class:`${Pe}-home-avatars`,children:m.map(g=>a("span",{class:`${Pe}-home-avatar`,title:g.role?`${g.name} \xB7 ${g.role}`:g.name,children:g.avatar?a("img",{src:g.avatar,alt:"",loading:"lazy"}):a("span",{children:ka(g.name)})},g.name))}):null,a(Yt,{panelProps:s,variant:"plain"})]})]}),r.showGreeting!==!1?a(pe,{children:[a("h1",{class:`${Pe}-home-greeting`,"data-testid":L.homeGreeting,children:v.title}),v.subtitle?a("p",{class:`${Pe}-home-lead`,children:v.subtitle}):null]}):null]}),a("div",{class:`${Pe}-home-cards`,children:[f?a(mP,{options:e.options,onAsk:g=>o.startNewConversation(g)}):null,r.showSearchBar!==!1?a(z_,{placeholder:n.homeSearchPlaceholder,onActivate:()=>o.switchToLayout("help")}):null,C?a(wa,{onClick:()=>{l.markSeen(C.id),o.push({kind:"content",id:C.id,title:C.title})},testid:L.homeWhatsNew,children:a("div",{class:`${Pe}-home-recent-row`,"data-unread":l.unseen?"true":void 0,children:[a("span",{class:`${Pe}-home-recent-avatar`,"aria-hidden":"true",children:a(_a,{})}),a("span",{class:`${Pe}-home-recent-body`,children:[a("span",{class:`${Pe}-home-recent-title`,children:n.homeWhatsNew}),a("span",{class:`${Pe}-home-recent-preview`,children:x?`${C.title} \xB7 ${x}`:C.title})]}),l.unseen?a("span",{class:`${Pe}-home-recent-dot`,role:"img","aria-label":n.newsUnseen}):null]})}):null,c?a(wa,{onClick:()=>o.selectConversation(c),testid:L.homeRecent,children:a("div",{class:`${Pe}-home-recent-row`,"data-unread":c.hasUnread?"true":void 0,children:[a("span",{class:`${Pe}-home-recent-avatar`,"aria-hidden":"true",children:a(wo,{})}),a("span",{class:`${Pe}-home-recent-body`,children:[a("span",{class:`${Pe}-home-recent-title`,children:c.title}),c.preview?a("span",{class:`${Pe}-home-recent-preview`,children:va(c.preview)}):null]}),c.hasUnread?a("span",{class:`${Pe}-home-recent-dot`,role:"img","aria-label":n.unread}):null]})}):null,b?a(wa,{onClick:y?()=>yo(y):void 0,children:a("div",{class:`${Pe}-home-status`,"data-level":b.level??"operational",children:[a("span",{class:`${Pe}-home-status-icon`,"aria-hidden":"true",children:a(g_,{})}),a("span",{class:`${Pe}-home-status-text`,children:w})]})}):null,p.length>0?a("section",{class:`${Pe}-home-content`,children:[a("div",{class:`${Pe}-home-content-title`,children:P}),a("div",{class:`${Pe}-home-content-list`,children:p.map(g=>a(ba,{title:g.title,subtitle:g.description,onClick:()=>fP(o,g),testid:ft(L.homeContentRow,g.id)},g.id))})]}):null]})]})})}var nf={Icon:h_,Root:e=>a(gP,{...e})};var Ca={chat:U_,home:nf,help:H_,news:Z_};var Ao=O.cssPrefix;function rf({modules:e,activeTab:t,strings:n,hasUnread:r,onSelect:o}){return a("nav",{class:`${Ao}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let s=Ca[i.layout].Icon,l=i.id===t,c=i.layout==="chat"&&r;return a("button",{type:"button",role:"tab","aria-selected":l,class:`${Ao}-tab`,onClick:()=>o(i.id),"data-testid":ft(L.tab,i.id),children:[a("span",{class:`${Ao}-tab-icon`,children:[a(s,{}),c?a("span",{class:`${Ao}-tab-badge`,"data-testid":L.tabBadge,role:"img","aria-label":n.unread}):null]}),a("span",{class:`${Ao}-tab-label`,children:at(n,i.label)})]},i.id)})})}var Io=O.cssPrefix;function of({agent:e,strings:t,ticketReference:n,person:r=!1}){let o=e.status??"online",i=at(t,e.name),s=e.title?at(t,e.title):null,l=r?a(ln,{}):a("span",{children:ka(i)});return a("div",{class:`${Io}-agent`,children:[a("div",{class:`${Io}-agent-avatar`,"data-status":o,children:e.avatar?a("img",{src:e.avatar,alt:""}):l}),a("div",{class:`${Io}-agent-meta`,children:[a("strong",{children:i}),s||n?a("div",{class:`${Io}-agent-sub`,children:[n?a(hP,{reference:n,strings:t}):null,s?a("span",{children:s}):null]}):null]})]})}function hP({reference:e,strings:t}){let[n,r]=N(!1);function o(){navigator.clipboard?.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)}).catch(()=>{})}return a("button",{type:"button",class:`${Io}-agent-ticket`,onClick:o,title:t.copy,"aria-label":n?t.copied:t.copyTicketReference.replace("{reference}",e),children:n?t.copied:e})}var vP=["today","yesterday","lastWeek","older"];function bP(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let r=Math.round((af(e)-af(n))/(1440*60*1e3));return r<=0?"today":r===1?"yesterday":r<7?"lastWeek":"older"}function sf(e,t){let n=new Map;for(let r of t){let o=bP(e,r.lastMessageAt),i=n.get(o);i?i.push(r):n.set(o,[r])}return vP.flatMap(r=>{let o=n.get(r);return o?[{bucket:r,conversations:o}]:[]})}function af(e){return new Date(e).setHours(0,0,0,0)}var lf=oe.scope("history"),yP=3,PP=6,xP={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function cf(e,t){let n=t.type!=="upsert"||t.activity===!0;if(t.type==="snapshot"&&t.result.pagination.page===1&&e.pagination.page>1){let o=sn(e.conversations.slice(0,t.result.pagination.limit),t,n);if(t.result.conversations.length===0){if(o.length===0)return t.result;let u=Math.max(t.result.pagination.total,o.length);return{...t.result,conversations:o,pagination:{...t.result.pagination,total:u,totalPages:Math.ceil(u/t.result.pagination.limit)}}}let i=new Set(o.map(u=>u.conversationId)),s=e.conversations.slice(t.result.pagination.limit).filter(u=>!i.has(u.conversationId)),l=e.pagination.page,c={...t.result.pagination,page:l,hasPrev:l>1,hasNext:l<t.result.pagination.totalPages};return{conversations:[...o,...s],pagination:c}}let r=sn(e.conversations,t,n);return r===e.conversations?e:{...t.type==="snapshot"?t.result:e,conversations:r}}function SP(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 Ta({transport:e,strings:t,locale:n,persistence:r,onSelect:o,onNewConversation:i}){let s=O.cssPrefix,l=e.peekConversations({limit:50}),[c,u]=N(l?"loaded":"loading"),[p,_]=N(0),[d,f]=N(l),[v,m]=N(!1),b=D(void 0),w=d?.conversations??[],y=d?.pagination;U(()=>{let h=!1,k=!0,$=[],I=e.subscribeConversationChanges(A=>{k&&$.push(A),f(z=>z&&cf(z,A))});b.current=void 0,m(!1);let B=e.peekConversations({limit:50});return f(B),u(B?"loaded":"loading"),e.listConversations({limit:50}).then(A=>{if(h)return;let z=A;for(let j of $)z=cf(z,j);$=[],k=!1,f(z),u("loaded"),r.saveHistoryCount(z.conversations.length)}).catch(A=>{h||($=[],k=!1,lf.warn("listConversations failed",{err:A}),u({failure:cn(A,t)}))}),()=>{h=!0,I(),b.current=void 0}},[e,r,n,p]);async function P(){if(b.current||!y?.hasNext)return;let h={};b.current=h,m(!0);try{let k=await e.listConversations({page:y.page+1,limit:y.limit});if(b.current!==h)return;f($=>{if(!$)return $;let I=new Set($.conversations.map(z=>z.conversationId)),B=k.conversations.filter(z=>I.has(z.conversationId)?!1:(I.add(z.conversationId),!0)),A={conversations:[...$.conversations,...B],pagination:k.pagination};return r.saveHistoryCount(A.conversations.length),A})}catch(k){if(b.current!==h)return;lf.warn("listConversations page failed",{err:k,page:y.page+1})}finally{b.current===h&&(b.current=void 0,m(!1))}}let C=i?a("div",{class:`${s}-history-footer`,children:a("button",{type:"button",class:`${s}-history-new`,onClick:i,"data-testid":L.sidebarNewConversation,children:[a(Xp,{}),t.newConversation]})}):null;if(c==="loading"){let h=Math.min(r.loadHistoryCount()??yP,PP);return a(pe,{children:[a("div",{class:`${s}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:a("div",{class:`${s}-history-group`,"aria-hidden":"true",children:[a("div",{class:`${s}-history-heading`,children:a("span",{class:`${s}-skeleton ${s}-skeleton-heading`})}),a("div",{class:`${s}-history-card`,children:Array.from({length:Math.max(1,h)},(k,$)=>a("div",{class:`${s}-history-item ${s}-history-item-skeleton`,children:[a("span",{class:`${s}-history-avatar ${s}-skeleton`}),a("span",{class:`${s}-history-body`,children:[a("span",{class:`${s}-history-row`,children:[a("span",{class:`${s}-history-title`,children:a("span",{class:`${s}-skeleton ${s}-skeleton-title`})}),a("span",{class:`${s}-history-time`,children:a("span",{class:`${s}-skeleton ${s}-skeleton-time`})})]}),a("span",{class:`${s}-history-row`,children:a("span",{class:`${s}-history-preview`,children:a("span",{class:`${s}-skeleton ${s}-skeleton-preview`})})})]})]},$))})]})}),C]})}if(typeof c=="object")return a(pe,{children:[a(It,{tone:"error",message:c.failure,onRetry:()=>_(h=>h+1),strings:t}),C]});if(w.length===0)return a(pe,{children:[a("div",{class:`${s}-history-empty`,children:t.historyEmpty}),C]});let x=Date.now(),g=sf(x,w);return a(pe,{children:[a("div",{class:`${s}-history`,role:"list",children:[g.map(h=>a("div",{class:`${s}-history-group`,children:[a("div",{class:`${s}-history-heading`,children:t[xP[h.bucket]]}),a("div",{class:`${s}-history-card`,children:h.conversations.map(k=>a("div",{role:"listitem",children:a("button",{type:"button",class:`${s}-history-item`,onClick:()=>o(k),"data-unread":k.hasUnread?"true":void 0,"data-testid":ft(L.historyItem,k.conversationId),children:[a("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:a(Nl,{})}),a("span",{class:`${s}-history-body`,children:[a("span",{class:`${s}-history-row`,children:[a("span",{class:`${s}-history-title`,children:k.title}),a("span",{class:`${s}-history-time`,children:[k.ticketReference&&`${k.ticketReference} \xB7 `,SP(k.lastMessageAt,x,n)]})]}),a("span",{class:`${s}-history-row`,children:[a("span",{class:`${s}-history-preview`,children:k.preview&&va(k.preview)||t.historyContinue}),k.hasUnread?a("span",{class:`${s}-history-dot`,role:"img","aria-label":t.unread}):null]})]})]})},k.conversationId))})]},h.bucket)),y?.hasNext?a("div",{class:`${s}-history-more`,children:a("button",{type:"button",onClick:P,disabled:v,"aria-busy":v,"data-testid":L.historyLoadMore,children:t.loadMoreConversations})}):null]}),C]})}var df=O.cssPrefix;function uf({state:e,strings:t}){return e?a("div",{class:`${df}-dropzone`,"data-state":e,role:"status","aria-live":"polite",children:[a("span",{class:`${df}-dropzone-icon`,"aria-hidden":"true",children:e==="reject"?a(Ar,{}):a(da,{})}),e==="reject"?t.dropZoneRejected:t.dropZone]}):null}var Hl=new RegExp(String.raw`^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$`),wP=/^[+]?[\d\s().-]{6,}$/;function kP(e,t,n){let r=Array.isArray(t)?t.join(""):t?.trim()??"";if(!r)return e.required?n.formRequired:void 0;if(e.type==="email"&&!Hl.test(r))return n.formInvalidEmail;if(e.type==="tel"&&!wP.test(r))return n.formInvalidTel;if(e.type==="number"&&!Number.isFinite(Number(r)))return n.formInvalidNumber}function pf(e,t,n){return Object.fromEntries(e.flatMap(r=>{let o=kP(r,t[r.name],n);return o?[[r.name,o]]:[]}))}var st=O.cssPrefix;function _f(e){return e.tokenEmail||e.userContext?.email?.trim()}function CP(e,t){let n=e instanceof Le?e.status:void 0;return n===400?t.formInvalidEmail:n===409?t.emailTranscriptAlreadySent:n===422?t.emailTranscriptNotDelivered:n===429?t.emailTranscriptLimited:t.emailTranscriptFailed}function TP(e){return"host"in e&&"activeElement"in e}function ff({transport:e,strings:t,knownEmail:n,onClose:r}){let[o,i]=N(n??""),[s,l]=N(!1),[c,u]=N({status:"idle"}),p=D(null),_=Qr(),d=`${_}-title`,f=`${_}-error`,v=c.status==="sending",m=c.status==="sent";ut(()=>{let y=p.current;if(!y)return;let P=y.getRootNode(),C=TP(P)?P.activeElement:null,x=Ir(y);return()=>{x(),C instanceof HTMLElement&&C.isConnected&&C.focus({preventScroll:!0})}},[]),ut(()=>{p.current?.querySelector("[data-autofocus]")?.focus({preventScroll:!0})},[m]);async function b(y){if(y.preventDefault(),v)return;let P=o.trim();if(!Hl.test(P)){l(!0),p.current?.querySelector("input")?.focus();return}l(!1),u({status:"sending"});let C=await e.emailTranscript(P).then(x=>({status:"sent",to:x.to}),x=>({status:"failed",message:CP(x,t)}));u(C)}function w(y){y.key==="Tab"&&y.stopPropagation(),y.key==="Escape"&&(y.stopPropagation(),r())}return a("div",{class:`${st}-transcript-layer`,children:[a("div",{class:`${st}-transcript-backdrop`,"aria-hidden":"true",onClick:r}),a("section",{ref:p,class:`${st}-transcript-sheet`,role:"dialog","aria-modal":"true","aria-labelledby":d,onKeyDown:w,"data-testid":L.emailTranscriptSheet,children:[a("header",{class:`${st}-transcript-sheet-head`,children:[a("span",{class:`${st}-transcript-sheet-icon`,children:a(ua,{})}),a("h2",{id:d,class:`${st}-transcript-sheet-title`,children:t.emailTranscript}),a("button",{type:"button",class:`${st}-icon-btn`,onClick:r,"aria-label":t.emailTranscriptCancel,title:t.emailTranscriptCancel,children:a(wt,{})})]}),c.status==="sent"?a(pe,{children:[a("p",{class:`${st}-transcript-sheet-text ${st}-transcript-sheet-sent`,role:"status",children:[a(Zn,{}),a("span",{children:t.emailTranscriptSent.replace("{email}",c.to)})]}),a("button",{type:"button",class:`${st}-form-submit ${st}-transcript-sheet-action`,onClick:r,"data-autofocus":!0,children:t.emailTranscriptDone})]}):a("form",{class:`${st}-transcript-sheet-form`,onSubmit:y=>{b(y)},noValidate:!0,children:[a("p",{class:`${st}-transcript-sheet-text`,children:t.emailTranscriptPrompt}),a("label",{class:`${st}-field`,"data-invalid":s?"true":void 0,children:[a("span",{class:`${st}-field-label`,children:t.emailTranscriptEmailLabel}),a("input",{class:`${st}-field-input`,type:"email",name:"email",autocomplete:"email",inputMode:"email",autocapitalize:"off",spellcheck:!1,value:o,readOnly:v,"aria-invalid":s,"aria-describedby":s?f:void 0,onInput:y=>{i(y.currentTarget.value),l(!1)},"data-autofocus":!0,"data-testid":L.emailTranscriptEmail}),s?a("span",{id:f,class:`${st}-field-error`,role:"alert",children:t.formInvalidEmail}):null]}),a("button",{type:"submit",class:`${st}-form-submit ${st}-transcript-sheet-action`,disabled:v,"aria-busy":v,"data-testid":L.emailTranscriptSend,children:v?t.emailTranscriptSending:t.emailTranscriptSend}),c.status==="failed"?a("p",{class:`${st}-field-error`,role:"alert",children:c.message}):null]})]})]})}var mf=Object.assign;function IP(e,t){for(var n in e)if(n!="__source"&&e[n]!==t[n])return!0;for(var r in t)if(r!="__source"&&!(r in e))return!0;return!1}var EP=/^(-|f[lo].*[^se]$|g.{5,}[^ps]$|z|o[pr]|(W.{5})?[lL]i.*(t|mp)$|an|(bo|s).{4}Im|sca|m.{6}[ds]|ta|c.*[st]$|wido|ini|asp|fill|st)/;function vf(e,t){function n(o){var i=this.props.ref;return i!=o.ref&&i&&(typeof i=="function"?i(null):i.current=null),t?!t(this.props,o)||i!=o.ref:IP(this.props,o)}function r(o){return this.shouldComponentUpdate=n,fn(e,o)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.type=e,r}var MP=Symbol.for("react.element"),LP=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(?!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,OP=/[A-Z0-9]/g,NP=typeof document<"u";var $P=function(e){return/fil|che|rad/.test(e)};Ut.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Ut.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var gf=he.event;he.event=function(e){return gf&&(e=gf(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var DP={configurable:!0,get:function(){return this.class}},hf=he.vnode;he.vnode=function(e){if(typeof e.type=="string")(function(r){var o=r.props,i=r.type,s={},l=i.indexOf("-")==-1;for(var c in o){var u=o[c];if(!(c=="value"&&"defaultValue"in o&&u==null||NP&&c=="children"&&i=="noscript"||c=="class"||c=="className")){if(c=="style"&&u&&u.constructor==Object){var p=void 0;for(var _ in u)typeof u[_]!="number"||EP.test(_)||(p||(p=u=mf({},u)),u[_]+="px")}else if(c=="defaultValue"&&"value"in o&&o.value==null)c="value";else if(c=="download"&&u===!0)u="";else if(c=="translate"&&u==="no")u=!1;else if(c[0]=="o"&&c[1]=="n"){var d=c.toLowerCase();d=="ondoubleclick"?c="ondblclick":d!="onchange"||i!="input"&&i!="textarea"||$P(o.type)?d=="onfocus"?c="onfocusin":d=="onblur"&&(c="onfocusout"):d=c="oninput",d=="oninput"&&s[c=d]&&(c="oninputCapture")}else l&&LP.test(c)?c=c.replace(OP,"-$&").toLowerCase():u===null&&(u=void 0);s[c]=u}}if(i=="select"){var f=s.defaultValue!=null?s.defaultValue:s.multiple&&Array.isArray(s.value)?s.value:null;f!=null&&(s.value=ss(o.children).forEach(function(v){v.props.selected=s.multiple?f.indexOf(v.props.value)!=-1:f==v.props.value}))}o.class&&!o.className?(s.class=o.class,Object.defineProperty(s,"className",DP)):o.className&&(s.class=s.className=o.className),r.props=s})(e);else if(typeof e.type=="function"&&("ref"in e.props&&"prototype"in e.type&&e.type.prototype.render&&(e.ref=e.props.ref,delete e.props.ref),e.type.defaultProps)){var t=mf({},e.props);for(var n in e.type.defaultProps)t[n]===void 0&&(t[n]=e.type.defaultProps[n]);e.props=t}e.ref&&!("ref"in e.props)&&Object.defineProperty(e.props,"ref",{value:e.ref,configurable:!0,writable:!0}),e.$$typeof=MP,hf&&hf(e)};var BP=new Set(["hidden","submit","button","reset","image","file","password"]);function yf(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function UP(e){return!yf(e)||e.name===""||e.disabled?!1:!(e instanceof HTMLInputElement&&BP.has(e.type))}function zP(e){let t=e.labels?.[0]?.textContent?.trim();return e.getAttribute("toolparamdescription")??(t||e.getAttribute("aria-description"))??void 0}function FP(e,t){let n=zP(e),r=n?{description:n}:{};return e instanceof HTMLSelectElement?{...r,type:"string",enum:[...e.options].map(o=>o.value)}:e instanceof HTMLTextAreaElement?{...r,type:"string"}:e.type==="checkbox"?{...r,type:"boolean"}:e.type==="radio"?{...r,type:"string",enum:t}:e.type==="number"||e.type==="range"?{...r,type:"number"}:{...r,type:"string"}}function qP(e,t){Object.getOwnPropertyDescriptor(Reflect.getPrototypeOf(e)??e,"value")?.set?.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))}function bf(e){return e==null?"":typeof e=="string"?e:JSON.stringify(e)}function HP(e,t){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked!==(t===!0||t==="true")&&e.click();return}if(e instanceof HTMLInputElement&&e.type==="radio"){e.value===bf(t)&&!e.checked&&e.click();return}qP(e,bf(t))}function jP(e,t,n){var s;let r=[...e.elements].filter(UP),o={},i=new Set;for(let l of r){let c=r.flatMap(u=>u instanceof HTMLInputElement&&u.type==="radio"&&u.name===l.name?[u.value]:[]);o[s=l.name]??(o[s]=FP(l,c)),l.required&&i.add(l.name)}return{name:t,description:n,inputSchema:{type:"object",properties:o,...i.size>0?{required:[...i]}:{}},execute(l){let c=typeof l=="object"&&l!==null?Object.entries(l):[];for(let[p,_]of c)for(let d of r)d.name===p&&HP(d,_);if(!e.hasAttribute("toolautosubmit"))return"Filled in the form. The visitor still needs to check it and press its submit button.";let u=[...new Set([...e.elements].flatMap(p=>yf(p)&&p.name&&!p.checkValidity()?[p.name]:[]))];return u.length>0?`Filled in the form, but it can't be submitted yet: ${u.join(", ")} still needs the visitor. Ask them to complete it and press the submit button.`:(setTimeout(()=>e.requestSubmit(),0),"Filled in the form and submitted it.")}}}function Pf(){return[...document.querySelectorAll("form[toolname][tooldescription]")].flatMap(e=>{let t=e.getAttribute("toolname")?.trim()??"",n=e.getAttribute("tooldescription")?.trim()??"";return t&&n?[jP(e,t,n)]:[]})}var xf=`${O.cssPrefix}.page-tools`,VP=20,WP=50;function Ra(e){return typeof e=="object"&&e!==null}function GP(e){return Ra(e)&&(e.state==="running"||e.state==="stopped"||e.state==="finished"&&Ra(e.outcome))}function KP(e){let t=e?JSON.parse(e):void 0;if(!Ra(t))return{sent:[],calls:{}};let n=Array.isArray(t.sent)?t.sent.filter(o=>typeof o=="string"):[],r=Object.fromEntries(Object.entries(Ra(t.calls)?t.calls:{}).filter(o=>GP(o[1])));return{sent:n,calls:r}}var Vl={sent:[],calls:{}};function Eo(){try{Vl=KP(sessionStorage.getItem(xf))}catch{}return Vl}function jl(e){Vl=e;try{sessionStorage.setItem(xf,JSON.stringify(e))}catch{}}var kt={markSent(e){let t=Eo();jl({...t,sent:[...t.sent.filter(n=>n!==e),e].slice(-VP)})},sentHere(e){return Eo().sent.includes(e)},get(e){return Eo().calls[e]},set(e,t){let n=Eo(),r=Object.entries(n.calls).filter(([o])=>o!==e);jl({...n,calls:Object.fromEntries([...r,[e,t]].slice(-WP))})},clear(e){let t=Eo();e.some(n=>n in t.calls)&&jl({...t,calls:Object.fromEntries(Object.entries(t.calls).filter(([n])=>!e.includes(n)))})}};var Kl=oe.scope("page-tools"),Sf="site__",wf=3e4,QP=1e3,kf=Symbol.for(`${O.cssPrefix}.page-tools`),Gl={state:"output-error",errorText:"The page reloaded before this finished, so it may or may not have taken effect. Check with the visitor before trying it again."},Tf="The visitor stopped this before it finished.";function Rn(e){return typeof e=="object"&&e!==null}function YP(e){return Rn(e)&&Array.isArray(e.registered)&&e.runs instanceof Map}function Mo(){let e=Reflect.get(globalThis,kf);if(YP(e))return e;let t={registered:[],runs:new Map};return Reflect.set(globalThis,kf,t),t}function Rf(e,t){let n=Rn(t)&&t.signal instanceof AbortSignal?t.signal:void 0;if(n?.aborted)return;let r=Mo().registered;r.push(e);function o(){let i=r.indexOf(e);i>=0&&r.splice(i,1)}n?.addEventListener("abort",o,{once:!0})}function Cf(e){return e.replace(/[^A-Za-z0-9_-]/g,"_").slice(0,58)}function Af(e){if(!Rn(e)||typeof e.name!="string"||!Cf(e.name))return;let t=typeof e.title=="string"&&e.title.trim()!==""?e.title.trim().slice(0,120):void 0,n=[e.description,t].find(o=>typeof o=="string"&&o.trim()!=="")??e.name,r=e.preview;return{name:Cf(e.name),...t?{title:t}:{},...typeof r=="function"?{preview:o=>Reflect.apply(r,e,[o])}:{},description:n.trim().slice(0,1024),inputSchema:{properties:{},...Rn(e.inputSchema)?e.inputSchema:{},type:"object"},consequential:Rn(e.annotations)&&e.annotations.consequentialHint===!0}}function Wl(e){return e.flatMap(t=>{let n=Af(t),r=Rn(t)?t.execute:void 0;return!n||typeof r!="function"?(Kl.warn("skipped a tool without a name or an execute function",t),[]):[{...n,run:(o,i)=>Reflect.apply(r,t,[o,{signal:i}])}]})}async function JP(){let e=Reflect.get(document,"modelContext")??Reflect.get(navigator,"modelContext");if(!Rn(e)||typeof e.getTools!="function"||typeof e.executeTool!="function")return[];let t=e.getTools,n=e.executeTool,r=await Promise.race([Promise.resolve().then(()=>Reflect.apply(t,e,[])),Xn(QP).then(()=>[])]).catch(()=>[]);return(Array.isArray(r)?r:[]).flatMap(o=>{let i=Af(o);return i?[{...i,run:(s,l)=>Reflect.apply(n,e,[o,s,{signal:l}])}]:[]})}async function Lo(e=[]){let t=Wl(Pf()),n=new Set(t.map(i=>i.name)),o=[...(await JP()).filter(i=>!n.has(i.name)),...t,...Wl(e),...Wl(Mo().registered)];return new Map(o.map(i=>[i.name,i]))}function Ql(e){return[...e.values()].map(({name:t,title:n,description:r,inputSchema:o,consequential:i})=>{let s={name:t,description:r,inputSchema:o};return n&&(s.title=n),i&&(s.annotations={consequentialHint:!0}),s})}function er(e){return e?.execution==="client"}function $r(e){return e.startsWith(Sf)?e.slice(Sf.length):e}function XP(e){if(e===void 0||typeof e=="function"||typeof e=="symbol")return null;let t=new WeakSet,n=JSON.stringify(e,(r,o)=>{if(typeof o=="bigint")return o.toString();if(!(typeof o=="function"||typeof o=="symbol"))return o instanceof Node?`[${o.nodeName.toLowerCase()}]`:Rn(o)?t.has(o)?"[circular]":(t.add(o),o):o});return n.length>wf?{truncated:!0,preview:n.slice(0,wf)}:JSON.parse(n)}async function If(e){let t=(await Lo(e.optionTools)).get($r(e.toolName));if(!t?.preview)return;let n=t.preview;return Promise.resolve().then(()=>n(e.input)).catch(r=>{Kl.warn("a page tool preview failed",{name:t.name,error:r})})}async function ZP(e){let t=$r(e.toolName),n=(await Lo(e.optionTools)).get(t);return n?Promise.resolve().then(()=>n.run(e.input,e.signal)).then(r=>({state:"output-available",output:XP(r)})).catch(r=>(Kl.warn("a page tool failed",{name:t,error:r}),{state:"output-error",errorText:(r instanceof Error?r.message:String(r)).slice(0,1e3)||"The page tool failed."})):{state:"output-error",errorText:`This page doesn't offer "${t}" right now; the visitor may have moved on. Tell them, or continue without it.`}}function Ef(e){let{toolCallId:t}=e,n=kt.get(t);if(n?.state==="finished")return Promise.resolve(n.outcome);let{runs:r}=Mo(),o=r.get(t);if(o)return o.outcome;if(n?.state==="running")return kt.set(t,{state:"finished",outcome:Gl}),e.onSettled("interrupted",0),Promise.resolve(Gl);let i=new AbortController,s=performance.now();kt.set(t,{state:"running"});let l=ZP({...e,signal:i.signal}).then(c=>(r.delete(t),kt.get(t)?.state!=="running"||(kt.set(t,{state:"finished",outcome:c}),e.onSettled(c.state==="output-available"?"completed":"failed",Math.round(performance.now()-s))),c));return r.set(t,{outcome:l,controller:i}),l}function Mf(e){return e===Gl.errorText||e===Tf}function Yl(e){return kt.set(e,{state:"stopped"}),Mo().runs.get(e)?.controller.abort(),Tf}function Lf(e){kt.clear([e]),Mo().runs.get(e)?.controller.abort()}var Aa=O.cssPrefix;function Of({messageId:e,initial:t,strings:n,onFeedback:r}){let[o,i]=N(t);U(()=>i(t),[e,t]);function s(l){let c=o===l?null:l;i(c),r(e,c)}return a("div",{class:`${Aa}-feedback`,role:"group","data-testid":L.messageFeedback,children:[a("button",{type:"button",class:`${Aa}-msg-action`,"data-active":o==="up"?"true":void 0,"aria-pressed":o==="up","aria-label":n.feedbackUp,title:n.feedbackUp,onClick:()=>s("up"),"data-testid":L.feedbackUp,children:a(x_,{})}),a("button",{type:"button",class:`${Aa}-msg-action`,"data-active":o==="down"?"true":void 0,"aria-pressed":o==="down","aria-label":n.feedbackDown,title:n.feedbackDown,onClick:()=>s("down"),"data-testid":L.feedbackDown,children:a(S_,{})}),a("span",{class:`${Aa}-sr-only`,role:"status","aria-live":"polite",children:o?n.feedbackThanks:""})]})}function Nf(e){return e.partsSig.value.some(t=>t.kind==="text"&&t.textSig.value.length>0)}function $f(e){return e.partsSig.value.some(t=>t.kind==="reasoning")}function ex(e){return e.streaming&&!e.bufferedHold&&!(e.reasoningVisible&&e.working)}function Df(e){let{streaming:t,reasoningVisible:n,emptyReply:r,hidden:o}=e,i=e.responseMode==="buffered"&&t,s=t&&!e.hasAnswerText;return{streaming:t,bufferedHold:i,reasoningVisible:n,working:s,showStreamDots:ex({streaming:t,bufferedHold:i,reasoningVisible:n,working:s}),emptyReply:r,hidden:o}}var Dr=O.cssPrefix;function Bf({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?a("a",{class:`${Dr}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":L.source,children:[a("span",{class:`${Dr}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),a("span",{class:`${Dr}-source-label`,children:n})]}):a("span",{class:`${Dr}-source`,"data-testid":L.source,children:[a("span",{class:`${Dr}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),a("span",{class:`${Dr}-source-label`,children:n})]})}var Dt=O.cssPrefix;function Ff(e){return{toolCallId:e.toolCallId,toolName:e.toolName,...e.title?{title:e.title}:{},state:e.stateSig.value,input:e.inputSig.value,output:e.outputSig.value,...e.errorSig.value?{errorText:e.errorSig.value}:{},...e.approvalSig.value?{approval:e.approvalSig.value}:{},...e.toolMetadata?{toolMetadata:e.toolMetadata}:{}}}function qf(e,t){if(t?.replacedByMessageId)return{terminal:!1,responded:!1,decided:!1};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 Ia({status:e,label:t,icon:n}){return a("span",{class:`${Dt}-toolui-badge ${Dt}-toolui-status`,"data-status":e,children:[a("span",{class:`${Dt}-toolui-status-icon`,children:n??a(Jl,{status:e})}),t]})}function Jl({status:e}){return e==="running"?a("span",{class:`${Dt}-loading-spinner`}):e==="stopped"?a(wn,{}):e==="waiting"||e==="submitted"?a(k_,{}):e==="failed"||e==="declined"||e==="replaced"?a(ko,{}):a(Zn,{})}function Oo({decision:e}){return a("span",{class:`${Dt}-steps-decision`,"data-approved":e.approved?"true":"false",title:e.title,children:[e.approved?a(Zn,{}):a(ko,{}),e.label]})}function Ea({view:e,strings:t}){let n=e.raw;return a(pe,{children:[e.error?a("p",{class:`${Dt}-steps-row-error`,children:e.error}):null,e.fields.length>0?a(Uf,{fields:e.fields,label:e.tables?t.stepInput:void 0,plain:!e.tables}):null,e.resultFields?a(Uf,{fields:e.resultFields,label:t.toolResult}):null,n?.input||n?.output?a("details",{class:`${Dt}-toolui-raw`,open:!e.tables,children:[a("summary",{children:t.stepRawData}),n.input?a(zf,{label:t.stepInput,text:n.input}):null,n.output?a(zf,{label:t.toolResult,text:n.output}):null]}):null]})}function Uf({fields:e,label:t,plain:n=!1}){let r=a("div",{class:`${Dt}-toolui-fields`,"data-plain":n?"true":void 0,children:a("table",{children:a("tbody",{children:e.map(({label:o,value:i},s)=>a("tr",{children:[a("th",{scope:"row",children:o}),a("td",{children:i})]},`${o}#${s}`))})})});return t?a("div",{class:`${Dt}-toolui-section`,children:[a("span",{class:`${Dt}-toolui-label`,children:t}),r]}):r}function zf({label:e,text:t}){return a("div",{class:`${Dt}-toolui-section`,children:[a("span",{class:`${Dt}-toolui-label`,children:e}),a("pre",{class:`${Dt}-toolui-code`,children:t})]})}var Ct=O.cssPrefix;function Hf({part:e,view:t,strings:n,locale:r,canAct:o,onDecision:i,onEdit:s,preview:l}){let c=t.approval,u=t.status==="waiting"||t.status==="submitted"||t.status==="approved",p=e.toolCallId;return a("details",{class:`${Ct}-toolui ${Ct}-toolui-collapsible`,open:u||c?.buttons==="change"||void 0,"data-testid":t.status==="waiting"?L.toolApproval:L.toolDecision,"data-status":t.status,children:[a("summary",{class:`${Ct}-toolui-head`,children:[a("span",{class:`${Ct}-toolui-prompt`,children:u&&c?c.ask:t.name}),t.system?a("span",{class:`${Ct}-toolui-system`,children:t.system}):null,a("span",{class:`${Ct}-toolui-head-end`,children:[t.decision?a(Oo,{decision:t.decision}):null,t.statusLabel?a(Ia,{status:t.status,label:t.statusLabel}):null,a("span",{class:`${Ct}-toolui-chevron`,children:a(Wt,{})})]})]}),a("div",{class:`${Ct}-toolui-collapse-body`,children:[u&&l&&er(e.toolMetadata)?a(nx,{toolName:e.toolName,input:e.inputSig.value,preview:l,strings:n,locale:r}):null,a(Ea,{view:t,strings:n}),c?.note?a("p",{class:`${Ct}-toolui-subtle`,children:c.note}):null,c?.buttons==="decide"?a("div",{class:`${Ct}-toolui-actions`,children:[a("button",{type:"button",class:`${Ct}-form-skip`,disabled:!o,onClick:()=>i(p,!1),"data-testid":L.toolDecline,children:n.decline}),a("button",{type:"button",class:`${Ct}-form-submit`,disabled:!o,onClick:()=>i(p,!0),"data-testid":L.toolApprove,children:n.approve})]}):null,c?.buttons==="change"?a("div",{class:`${Ct}-toolui-actions`,children:a("button",{type:"button",class:`${Ct}-form-skip`,onClick:()=>s(p),"data-testid":L.toolEdit,children:n.changeAnswer})}):null]})]})}function tx(e){if(!(typeof e!="object"||e===null)&&"totals"in e)return"number"in e&&"items"in e?`root = Root([preview])
|
|
67
71
|
preview = Order(${JSON.stringify(e)})`:"lines"in e?`root = Root([preview])
|
|
68
|
-
preview = Cart(${JSON.stringify(e)})`:void 0}function HP({toolName:e,input:t,preview:r,strings:n,locale:o}){let[s,a]=U();F(()=>{let c=!0;return r(e,t).then(u=>{c&&a(FP(u))}),()=>{c=!1}},[e,t,r]);let i=Ce(()=>s?{textSig:oe(s),doneSig:oe(!0),replyDoneSig:oe(!0)}:void 0,[s]);return i?l("div",{class:`${Ut}-toolui-preview`,"data-testid":D.toolPreview,children:l(vl,{cssPrefix:Ut,textSig:i.textSig,doneSig:i.doneSig,replyDoneSig:i.replyDoneSig,strings:n,locale:o})}):null}var jP=["text","email","phone","number","date","single-select","multi-select","boolean"];function Uf(e){return e!==null&&typeof e=="object"}function Bf(e,t){let r=Uf(e)?e:{},o=(Array.isArray(r.questions)?r.questions:[]).map((s,a)=>VP(s,a,t)).filter(s=>s!==null);return{intro:Ba(r.intro),questions:o}}function VP(e,t,r){if(!Uf(e))return null;let n=jP.find(o=>o===e.type)??"text";return{key:Ba(e.key)??`q${t+1}`,question:Ba(e.question)??r,type:n,options:Array.isArray(e.options)?e.options.filter(o=>typeof o=="string"&&o.trim().length>0):void 0,required:typeof e.required=="boolean"?e.required:void 0,helpText:Ba(e.helpText)}}function WP(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 Zl(e,t,r){return e.questions.map(n=>{let o=WP(n.type),s=n.type==="boolean"?[{value:"yes",label:t},{value:"no",label:r}]:(n.options??[]).map(a=>({value:a,label:a}));return{name:n.key,label:n.question,type:o,required:n.required??!1,options:s.length>0?s:void 0,validationHint:n.helpText}})}function Ba(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var yt=q.cssPrefix;function ec({fields:e,strings:t,submitLabel:r,onSubmit:n,skipLabel:o,onSkip:s,footerHint:a,submitOnEnter:i,disabled:c,initialValues:u,hideActions:p,fieldTypeLabels:_,rootTestId:d,submitTestId:f,skipTestId:v}){let[g,x]=U(()=>u??{}),[k,y]=U({}),[S,b]=U({});function w(I){S[I]&&b(A=>({...A,[I]:""}))}function h(I,A){x(C=>({...C,[I]:A})),w(I)}function m(I,A){y(C=>({...C,[I]:A})),w(I)}function P(I){if(I.preventDefault(),c)return;let A=YP(e,g,k),C=sf(e,A,t);if(Object.keys(C).length>0){b(C);return}n(A)}function R(I){!i||I.key!=="Enter"||I.shiftKey||Aa(I)||!I.target||!("tagName"in I.target)||I.target.tagName!=="TEXTAREA"||P(I)}return l("form",{class:`${yt}-form`,onSubmit:P,onKeyDown:R,onCompositionEnd:Ra,"data-testid":d,noValidate:!0,children:[e.map(I=>l(GP,{field:I,value:g[I.name],otherText:k[I.name]??"",error:S[I.name],disabled:c,typeLabel:_?.[I.name],strings:t,onChange:A=>h(I.name,A),onOtherChange:A=>m(I.name,A)},I.name)),p?null:l("div",{class:`${yt}-form-actions`,children:[a?l("span",{class:`${yt}-form-hint`,children:a}):null,o&&s?l("button",{type:"button",class:`${yt}-form-skip`,onClick:s,disabled:c,"data-testid":v,children:o}):null,l("button",{type:"submit",class:`${yt}-form-submit`,disabled:c,"data-testid":f,children:r})]})]})}function GP({field:e,value:t,otherText:r,error:n,disabled:o,typeLabel:s,strings:a,onChange:i,onOtherChange:c}){let u=Ct(D.formField,e.name),p=io(),_=KP({field:e,value:t,otherText:r,disabled:o,strings:a,onChange:i,onOtherChange:c,fieldTid:u,labelId:p}),d=e.type==="radio"||e.type==="multiselect"?"div":"label";return l(d,{class:`${yt}-field`,"data-field":e.name,"data-invalid":n?"true":void 0,children:[l("span",{class:`${yt}-field-head`,children:[l("span",{class:`${yt}-field-label`,id:p,children:[e.label,e.required?l("span",{class:`${yt}-field-req`,"aria-hidden":"true",children:" *"}):null]}),s?l("span",{class:`${yt}-field-type`,children:s}):null]}),_,e.validationHint&&!n?l("span",{class:`${yt}-field-hint`,children:e.validationHint}):null,n?l("span",{class:`${yt}-field-error`,role:"alert",children:n}):null]})}function KP(e){let{field:t,value:r,otherText:n,disabled:o,strings:s,onChange:a,onOtherChange:i,fieldTid:c,labelId:u}=e,p=typeof r=="string"?r:"";switch(t.type){case"textarea":return l("textarea",{class:`${yt}-field-input`,rows:3,value:p,disabled:o,onInput:d=>a(d.currentTarget.value),"data-testid":c});case"radio":return l("div",{class:`${yt}-field-choices`,role:"radiogroup","aria-labelledby":u,"data-testid":c,children:(t.options??[]).map(d=>l("label",{class:`${yt}-choice`,children:[l("input",{type:"radio",name:`${yt}-${t.name}`,checked:p===d.value,disabled:o,onChange:()=>a(d.value)}),l("span",{children:d.label})]},d.value))});case"multiselect":{let f=function(v,g){return a(g?[...d,v]:d.filter(x=>x!==v))};var _=f;let d=Array.isArray(r)?r:[];return l("div",{class:`${yt}-field-choices`,role:"group","aria-labelledby":u,"data-testid":c,children:[(t.options??[]).map(v=>l("label",{class:`${yt}-choice`,children:[l("input",{type:"checkbox",checked:d.includes(v.value),disabled:o,onChange:g=>f(v.value,g.currentTarget.checked)}),l("span",{children:v.label})]},v.value)),(t.options??[]).length===0?l("textarea",{class:`${yt}-field-input`,rows:2,value:n,placeholder:s.formOtherPlaceholder,disabled:o,onInput:v=>i(v.currentTarget.value)}):null]})}default:return l("input",{...QP(t.type),class:`${yt}-field-input`,value:p,disabled:o,onInput:d=>a(d.currentTarget.value),"data-testid":c})}}function QP(e){switch(e){case"number":return{type:e};case"email":return{type:e};case"tel":return{type:e};case"date":return{type:e};default:return{type:"text"}}}function YP(e,t,r){let n={...t};for(let o of e){let s=r[o.name]?.trim();if(o.type==="multiselect"&&s){let a=s.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),i=t[o.name];n[o.name]=[...Array.isArray(i)?i:[],...a]}}return n}var ut=q.cssPrefix;function JP({skipped:e,submitted:t,strings:r}){return e?{status:"replaced",statusLabel:r.inputSkipped}:t?{status:"submitted",statusLabel:r.stepWorkingOnIt}:{status:"done",statusLabel:r.inputAnswered}}var XP={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function Ff(e,t){let r={};for(let n of e)r[n.key]=t[XP[n.type]];return r}function tc({part:e,strings:t,active:r,superseded:n=!1,continuationStreaming:o=!1,folded:s=!1,onDecision:a,onEdit:i}){let c=Ce(()=>dt(()=>e.stateSig.value),[e]).value,u=Ce(()=>dt(()=>e.approvalSig.value),[e]).value,p=Ce(()=>dt(()=>Bf(e.inputSig.value,t.askFallbackQuestion)),[e,t]).value,{terminal:_,decided:d}=Df(c,u),f=d&&u?.approved===!0,v=o&&!d,g=!d&&!n&&!v,x=!g&&!f&&!v,k=f&&r&&!_,y=p.questions,[S,b]=U(null),h=S??(g||f||v),[m,P]=U(!1),R=y.length>1?Ol:Mo,I=g?t.inputRequired:t.inputBadge,A=v?l("p",{class:`${ut}-toolui-subtle`,children:t.stepWorkingOnIt}):g?l(ZP,{req:p,strings:t,active:r,resolve:(N,H)=>a(e.toolCallId,H,N)}):m?l(ec,{fields:Zl(p,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:Ff(y,t),initialValues:f?ox(y,u?.reason):void 0}):l(ex,{questions:y,answers:f?nx(u?.reason):{},strings:t}),{status:C,statusLabel:M}=JP({skipped:x,submitted:v,strings:t});return l("details",{class:`${ut}-toolui ${ut}-toolui-collapsible${n?` ${ut}-toolui-stale`:""}`,open:h,onToggle:N=>{let H=N.currentTarget.open;H!==h&&b(H)},"data-testid":g?D.toolAskQuestions:D.toolDecision,children:[l("summary",{class:`${ut}-toolui-head`,children:[l("span",{class:`${ut}-toolui-q-pill`,children:[l(R,{}),I]}),l("span",{class:`${ut}-toolui-head-end`,children:[g||s?null:l(qa,{status:C,icon:x?l(No,{}):l(cn,{}),label:M}),l("span",{class:`${ut}-toolui-chevron`,children:l(sr,{})})]})]}),l("div",{class:`${ut}-toolui-collapse-body`,children:[p.intro?l("div",{class:`${ut}-toolui-desc`,children:p.intro}):null,A,g||v?null:l("div",{class:`${ut}-toolui-footer`,children:[l("button",{type:"button",class:`${ut}-toolui-options-toggle`,onClick:()=>P(N=>!N),"data-testid":D.toolAskOptions,children:[l("span",{class:`${ut}-toolui-options-chevron${m?` ${ut}-open`:""}`,children:l(sr,{})}),m?t.hideOptions:t.showOptions]}),k?l("button",{type:"button",class:`${ut}-form-skip`,onClick:()=>i(e.toolCallId),"data-testid":D.toolEdit,children:t.edit}):null]})]})]})}function ZP({req:e,strings:t,active:r,resolve:n}){let o=Zl(e,t.confirmYes,t.confirmNo),s=e.questions.length===1&&e.questions[0]?.type==="text";return l(ec,{fields:o,strings:t,disabled:!r,submitLabel:t.inputSubmit,footerHint:s?t.inputSubmitHint:void 0,onSubmit:a=>n(rx(e.questions,a),!0),skipLabel:t.inputSkip,onSkip:()=>n(void 0,!1),submitOnEnter:s,fieldTypeLabels:Ff(e.questions,t),submitTestId:D.toolInputSubmit,skipTestId:D.toolInputSkip})}function ex({questions:e,answers:t,strings:r}){return l("div",{class:`${ut}-toolui-summary`,"data-testid":D.toolAskSummary,children:e.map(n=>l("div",{class:`${ut}-field`,children:[l("span",{class:`${ut}-field-head`,children:l("span",{class:`${ut}-field-label`,children:[n.question,n.required?l("span",{class:`${ut}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),l("p",{class:`${ut}-toolui-answer`,children:tx(n,t[n.key],r)||"\u2014"})]},n.key))})}function tx(e,t,r){return e.type!=="boolean"?t??"":t==="yes"?r.confirmYes:t==="no"?r.confirmNo:t??""}function rx(e,t){let r=e.flatMap(n=>{let o=t[n.key],s=typeof o=="string"?o.trim():o;return s?.length?[{key:n.key,value:s}]:[]});return JSON.stringify({answers:r})}function Hf(e){if(!e)return{};let t=(()=>{try{return JSON.parse(e)}catch{return}})(),r=zf(t)?t.answers:void 0;if(!Array.isArray(r))return{};let n={};for(let o of r)if(zf(o)){let{key:s,value:a}=o;if(typeof s!="string")continue;typeof a=="string"?n[s]=a:Array.isArray(a)&&(n[s]=a.filter(i=>typeof i=="string"))}return n}function zf(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function nx(e){let t=Hf(e),r={};for(let[n,o]of Object.entries(t))r[n]=Array.isArray(o)?o.join(", "):o;return r}function ox(e,t){let r=Hf(t),n={};for(let o of e){let s=r[o.key];s!==void 0&&(o.type==="multi-select"?n[o.key]=Array.isArray(s)?s:[s]:n[o.key]=Array.isArray(s)?s[0]??"":s)}return n}var ge=q.cssPrefix;function Wf(e,t){let r=[];for(let[n,o]of e.entries()){let s=r.at(-1),a=o.kind==="tool"?t.viewOf(o):void 0,i=ix(o,a,t.showReasoning);if(i){s?.kind==="steps"?(s.rows.push(i),s.indices.push(n)):r.push({kind:"steps",rows:[i],indices:[n]});continue}o.kind==="step-start"||o.kind==="reasoning"||o.kind==="source"&&!t.showSources||a?.placement==="hidden"||r.push({kind:"part",part:o,index:n})}return r}function ix(e,t,r){return e.kind==="reasoning"?r?{kind:"thought",part:e}:void 0:e.kind==="tool"&&t?.placement==="step"?{kind:"tool",part:e,view:t}:void 0}function ax(e,t){let r=[...new Set(t)];if(!(!e||r.length===0||r.some(n=>n<0||n>=e.length)))return r.reduce((n,o)=>n+(e[o]?.durationMs??0),0)}function Gf(e){let t=[];for(let r of e)t.push((t.at(-1)??-1)+(r.kind==="step-start"?1:0));return t}function sx(e,t){return e.streaming?t.thinking:e.reasoningMs===void 0?t.thought:t.thoughtFor.replace("{time}",za(e.reasoningMs))}function za(e){if(e<1e4)return`${Number((e/1e3).toFixed(1))} s`;let t=Math.round(e/1e3);return t<60?`${t} s`:`${Math.floor(t/60)} m ${t%60} s`}function lx(e){return e.split(`
|
|
69
|
-
`).map(t=>t.trim()).findLast(t=>/^\*\*[^*].*\*\*$/.test(t))?.slice(2,-2).trim()}function
|
|
72
|
+
preview = Cart(${JSON.stringify(e)})`:void 0}function nx({toolName:e,input:t,preview:n,strings:r,locale:o}){let[i,s]=N();U(()=>{let c=!0;return n(e,t).then(u=>{c&&s(tx(u))}),()=>{c=!1}},[e,t,n]);let l=xe(()=>i?{textSig:re(i),doneSig:re(!0),replyDoneSig:re(!0)}:void 0,[i]);return l?a("div",{class:`${Ct}-toolui-preview`,"data-testid":L.toolPreview,children:a(pl,{cssPrefix:Ct,textSig:l.textSig,doneSig:l.doneSig,replyDoneSig:l.replyDoneSig,strings:r,locale:o})}):null}var rx=["text","email","phone","number","date","single-select","multi-select","boolean"];function jf(e){return e!==null&&typeof e=="object"}function Vf(e,t){let n=jf(e)?e:{},o=(Array.isArray(n.questions)?n.questions:[]).map((i,s)=>ox(i,s,t)).filter(i=>i!==null);return{intro:Ma(n.intro),questions:o}}function ox(e,t,n){if(!jf(e))return null;let r=rx.find(o=>o===e.type)??"text";return{key:Ma(e.key)??`q${t+1}`,question:Ma(e.question)??n,type:r,options:Array.isArray(e.options)?e.options.filter(o=>typeof o=="string"&&o.trim().length>0):void 0,required:typeof e.required=="boolean"?e.required:void 0,helpText:Ma(e.helpText)}}function ix(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 Xl(e,t,n){return e.questions.map(r=>{let o=ix(r.type),i=r.type==="boolean"?[{value:"yes",label:t},{value:"no",label:n}]:(r.options??[]).map(s=>({value:s,label:s}));return{name:r.key,label:r.question,type:o,required:r.required??!1,options:i.length>0?i:void 0,validationHint:r.helpText}})}function Ma(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var lt=O.cssPrefix;function Zl({fields:e,strings:t,submitLabel:n,onSubmit:r,skipLabel:o,onSkip:i,footerHint:s,submitOnEnter:l,disabled:c,initialValues:u,hideActions:p,fieldTypeLabels:_,rootTestId:d,submitTestId:f,skipTestId:v}){let[m,b]=N(()=>u??{}),[w,y]=N({}),[P,C]=N({});function x(I){P[I]&&C(B=>({...B,[I]:""}))}function g(I,B){b(A=>({...A,[I]:B})),x(I)}function h(I,B){y(A=>({...A,[I]:B})),x(I)}function k(I){if(I.preventDefault(),c)return;let B=cx(e,m,w),A=pf(e,B,t);if(Object.keys(A).length>0){C(A);return}r(B)}function $(I){!l||I.key!=="Enter"||I.shiftKey||xa(I)||!I.target||!("tagName"in I.target)||I.target.tagName!=="TEXTAREA"||k(I)}return a("form",{class:`${lt}-form`,onSubmit:k,onKeyDown:$,onCompositionEnd:Pa,"data-testid":d,noValidate:!0,children:[e.map(I=>a(ax,{field:I,value:m[I.name],otherText:w[I.name]??"",error:P[I.name],disabled:c,typeLabel:_?.[I.name],strings:t,onChange:B=>g(I.name,B),onOtherChange:B=>h(I.name,B)},I.name)),p?null:a("div",{class:`${lt}-form-actions`,children:[s?a("span",{class:`${lt}-form-hint`,children:s}):null,o&&i?a("button",{type:"button",class:`${lt}-form-skip`,onClick:i,disabled:c,"data-testid":v,children:o}):null,a("button",{type:"submit",class:`${lt}-form-submit`,disabled:c,"data-testid":f,children:n})]})]})}function ax({field:e,value:t,otherText:n,error:r,disabled:o,typeLabel:i,strings:s,onChange:l,onOtherChange:c}){let u=ft(L.formField,e.name),p=Qr(),_=sx({field:e,value:t,otherText:n,disabled:o,strings:s,onChange:l,onOtherChange:c,fieldTid:u,labelId:p}),d=e.type==="radio"||e.type==="multiselect"?"div":"label";return a(d,{class:`${lt}-field`,"data-field":e.name,"data-invalid":r?"true":void 0,children:[a("span",{class:`${lt}-field-head`,children:[a("span",{class:`${lt}-field-label`,id:p,children:[e.label,e.required?a("span",{class:`${lt}-field-req`,"aria-hidden":"true",children:" *"}):null]}),i?a("span",{class:`${lt}-field-type`,children:i}):null]}),_,e.validationHint&&!r?a("span",{class:`${lt}-field-hint`,children:e.validationHint}):null,r?a("span",{class:`${lt}-field-error`,role:"alert",children:r}):null]})}function sx(e){let{field:t,value:n,otherText:r,disabled:o,strings:i,onChange:s,onOtherChange:l,fieldTid:c,labelId:u}=e,p=typeof n=="string"?n:"";switch(t.type){case"textarea":return a("textarea",{class:`${lt}-field-input`,rows:3,value:p,disabled:o,onInput:d=>s(d.currentTarget.value),"data-testid":c});case"radio":return a("div",{class:`${lt}-field-choices`,role:"radiogroup","aria-labelledby":u,"data-testid":c,children:(t.options??[]).map(d=>a("label",{class:`${lt}-choice`,children:[a("input",{type:"radio",name:`${lt}-${t.name}`,checked:p===d.value,disabled:o,onChange:()=>s(d.value)}),a("span",{children:d.label})]},d.value))});case"multiselect":{let f=function(v,m){return s(m?[...d,v]:d.filter(b=>b!==v))};var _=f;let d=Array.isArray(n)?n:[];return a("div",{class:`${lt}-field-choices`,role:"group","aria-labelledby":u,"data-testid":c,children:[(t.options??[]).map(v=>a("label",{class:`${lt}-choice`,children:[a("input",{type:"checkbox",checked:d.includes(v.value),disabled:o,onChange:m=>f(v.value,m.currentTarget.checked)}),a("span",{children:v.label})]},v.value)),(t.options??[]).length===0?a("textarea",{class:`${lt}-field-input`,rows:2,value:r,placeholder:i.formOtherPlaceholder,disabled:o,onInput:v=>l(v.currentTarget.value)}):null]})}default:return a("input",{...lx(t.type),class:`${lt}-field-input`,value:p,disabled:o,onInput:d=>s(d.currentTarget.value),"data-testid":c})}}function lx(e){switch(e){case"number":return{type:e};case"email":return{type:e};case"tel":return{type:e};case"date":return{type:e};default:return{type:"text"}}}function cx(e,t,n){let r={...t};for(let o of e){let i=n[o.name]?.trim();if(o.type==="multiselect"&&i){let s=i.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),l=t[o.name];r[o.name]=[...Array.isArray(l)?l:[],...s]}}return r}var et=O.cssPrefix;function dx({skipped:e,submitted:t,strings:n}){return e?{status:"replaced",statusLabel:n.inputSkipped}:t?{status:"submitted",statusLabel:n.stepWorkingOnIt}:{status:"done",statusLabel:n.inputAnswered}}var ux={text:"qtypeText",email:"qtypeEmail",phone:"qtypePhone",number:"qtypeNumber",date:"qtypeDate","single-select":"qtypeChooseOne","multi-select":"qtypeChooseAny",boolean:"qtypeBoolean"};function Gf(e,t){let n={};for(let r of e)n[r.key]=t[ux[r.type]];return n}function ec({part:e,strings:t,active:n,superseded:r=!1,continuationStreaming:o=!1,folded:i=!1,onDecision:s,onEdit:l}){let c=xe(()=>Ze(()=>e.stateSig.value),[e]).value,u=xe(()=>Ze(()=>e.approvalSig.value),[e]).value,p=xe(()=>Ze(()=>Vf(e.inputSig.value,t.askFallbackQuestion)),[e,t]).value,{terminal:_,decided:d}=qf(c,u),f=d&&u?.approved===!0,v=o&&!d,m=!d&&!r&&!v,b=!m&&!f&&!v,w=f&&n&&!_,y=p.questions,[P,C]=N(null),g=P??(m||f||v),[h,k]=N(!1),$=y.length>1?Ol:So,I=m?t.inputRequired:t.inputBadge,B=v?a("p",{class:`${et}-toolui-subtle`,children:t.stepWorkingOnIt}):m?a(px,{req:p,strings:t,active:n,resolve:(j,Y)=>s(e.toolCallId,Y,j)}):h?a(Zl,{fields:Xl(p,t.confirmYes,t.confirmNo),strings:t,submitLabel:t.inputSubmit,onSubmit:()=>{},disabled:!0,hideActions:!0,fieldTypeLabels:Gf(y,t),initialValues:f?hx(y,u?.reason):void 0}):a(_x,{questions:y,answers:f?gx(u?.reason):{},strings:t}),{status:A,statusLabel:z}=dx({skipped:b,submitted:v,strings:t});return a("details",{class:`${et}-toolui ${et}-toolui-collapsible${r?` ${et}-toolui-stale`:""}`,open:g,onToggle:j=>{let Y=j.currentTarget.open;Y!==g&&C(Y)},"data-testid":m?L.toolAskQuestions:L.toolDecision,children:[a("summary",{class:`${et}-toolui-head`,children:[a("span",{class:`${et}-toolui-q-pill`,children:[a($,{}),I]}),a("span",{class:`${et}-toolui-head-end`,children:[m||i?null:a(Ia,{status:A,icon:b?a(ko,{}):a(Zn,{}),label:z}),a("span",{class:`${et}-toolui-chevron`,children:a(Wt,{})})]})]}),a("div",{class:`${et}-toolui-collapse-body`,children:[p.intro?a("div",{class:`${et}-toolui-desc`,children:p.intro}):null,B,m||v?null:a("div",{class:`${et}-toolui-footer`,children:[a("button",{type:"button",class:`${et}-toolui-options-toggle`,onClick:()=>k(j=>!j),"data-testid":L.toolAskOptions,children:[a("span",{class:`${et}-toolui-options-chevron${h?` ${et}-open`:""}`,children:a(Wt,{})}),h?t.hideOptions:t.showOptions]}),w?a("button",{type:"button",class:`${et}-form-skip`,onClick:()=>l(e.toolCallId),"data-testid":L.toolEdit,children:t.edit}):null]})]})]})}function px({req:e,strings:t,active:n,resolve:r}){let o=Xl(e,t.confirmYes,t.confirmNo),i=e.questions.length===1&&e.questions[0]?.type==="text";return a(Zl,{fields:o,strings:t,disabled:!n,submitLabel:t.inputSubmit,footerHint:i?t.inputSubmitHint:void 0,onSubmit:s=>r(mx(e.questions,s),!0),skipLabel:t.inputSkip,onSkip:()=>r(void 0,!1),submitOnEnter:i,fieldTypeLabels:Gf(e.questions,t),submitTestId:L.toolInputSubmit,skipTestId:L.toolInputSkip})}function _x({questions:e,answers:t,strings:n}){return a("div",{class:`${et}-toolui-summary`,"data-testid":L.toolAskSummary,children:e.map(r=>a("div",{class:`${et}-field`,children:[a("span",{class:`${et}-field-head`,children:a("span",{class:`${et}-field-label`,children:[r.question,r.required?a("span",{class:`${et}-field-req`,"aria-hidden":"true",children:" *"}):null]})}),a("p",{class:`${et}-toolui-answer`,children:fx(r,t[r.key],n)||"\u2014"})]},r.key))})}function fx(e,t,n){return e.type!=="boolean"?t??"":t==="yes"?n.confirmYes:t==="no"?n.confirmNo:t??""}function mx(e,t){let n=e.flatMap(r=>{let o=t[r.key],i=typeof o=="string"?o.trim():o;return i?.length?[{key:r.key,value:i}]:[]});return JSON.stringify({answers:n})}function Kf(e){if(!e)return{};let t=(()=>{try{return JSON.parse(e)}catch{return}})(),n=Wf(t)?t.answers:void 0;if(!Array.isArray(n))return{};let r={};for(let o of n)if(Wf(o)){let{key:i,value:s}=o;if(typeof i!="string")continue;typeof s=="string"?r[i]=s:Array.isArray(s)&&(r[i]=s.filter(l=>typeof l=="string"))}return r}function Wf(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function gx(e){let t=Kf(e),n={};for(let[r,o]of Object.entries(t))n[r]=Array.isArray(o)?o.join(", "):o;return n}function hx(e,t){let n=Kf(t),r={};for(let o of e){let i=n[o.key];i!==void 0&&(o.type==="multi-select"?r[o.key]=Array.isArray(i)?i:[i]:r[o.key]=Array.isArray(i)?i[0]??"":i)}return r}var ue=O.cssPrefix;function Jf(e,t){let n=[];for(let[r,o]of e.entries()){let i=n.at(-1),s=o.kind==="tool"?t.viewOf(o):void 0,l=vx(o,s,t.showReasoning);if(l){i?.kind==="steps"?(i.rows.push(l),i.indices.push(r)):n.push({kind:"steps",rows:[l],indices:[r]});continue}o.kind==="step-start"||o.kind==="reasoning"||o.kind==="source"&&!t.showSources||s?.placement==="hidden"||n.push({kind:"part",part:o,index:r})}return n}function vx(e,t,n){return e.kind==="reasoning"?n?{kind:"thought",part:e}:void 0:e.kind==="tool"&&t?.placement==="step"?{kind:"tool",part:e,view:t}:void 0}function bx(e,t){let n=[...new Set(t)];if(!(!e||n.length===0||n.some(r=>r<0||r>=e.length)))return n.reduce((r,o)=>r+(e[o]?.durationMs??0),0)}function Xf(e){let t=[];for(let n of e)t.push((t.at(-1)??-1)+(n.kind==="step-start"?1:0));return t}function yx(e,t){return e.streaming?t.thinking:e.reasoningMs===void 0?t.thought:t.thoughtFor.replace("{time}",La(e.reasoningMs))}function La(e){if(e<1e4)return`${Number((e/1e3).toFixed(1))} s`;let t=Math.round(e/1e3);return t<60?`${t} s`:`${Math.floor(t/60)} m ${t%60} s`}function Px(e){return e.split(`
|
|
73
|
+
`).map(t=>t.trim()).findLast(t=>/^\*\*[^*].*\*\*$/.test(t))?.slice(2,-2).trim()}function xx(e,t){return e?.kind==="tool"?`${e.view.name}\u2026`:(e&&Px(e.part.textSig.value))??t.thinking}function Zf({rows:e,steps:t=[],stepTimings:n,timed:r=!0,strings:o,running:i,runStartedAt:s,renderCard:l}){let[c,u]=N(!1),[p,_]=N(!1),d=Zc(e.flatMap(y=>y.kind==="tool"?[y.view]:[])),f=e.at(-1),v=xe(()=>Ze(()=>xx(f,o)),[f,o]).value,m=r?bx(n,t):void 0;function b(){u(!c),_(!0)}let[w]=e;return!i&&e.length===1&&w?.kind==="tool"?a("div",{class:`${ue}-steps`,"data-testid":L.toolSteps,"data-stopped":d.stopped?"true":void 0,children:a(Yf,{part:w.part,view:w.view,strings:o,durationMs:m,standalone:!0,renderCard:l})}):a("div",{class:`${ue}-steps`,"data-testid":L.toolSteps,"data-running":i?"true":void 0,"data-stopped":d.stopped?"true":void 0,children:[a("button",{type:"button",class:`${ue}-steps-head`,"aria-expanded":c,onClick:b,children:[a("span",{class:`${ue}-steps-icon`,"aria-hidden":"true",children:a(wx,{running:i,stopped:d.stopped!==void 0})}),a("span",{class:`${ue}-steps-label`,children:i?a("span",{class:`${ue}-steps-live`,children:v}):a(kx,{line:d,strings:o})}),!i&&d.failed>0?a("span",{class:`${ue}-steps-failed`,children:o.toolStepsFailed.replace("{count}",String(d.failed))}):null,i?null:d.marks.map(y=>a(Oo,{decision:y},y.title)),i&&s?a(Sx,{since:s}):null,!i&&m!==void 0?a("span",{class:`${ue}-steps-time`,children:La(m)}):null,a("span",{class:`${ue}-steps-chevron`,"data-open":c?"true":void 0,children:a(Wt,{})})]}),a("span",{class:`${ue}-sr-only`,role:"status",children:i?v:""}),a("div",{class:`${ue}-steps-body`,"data-open":c?"true":void 0,inert:!c,children:a("div",{class:`${ue}-steps-body-inner`,children:p?a("ol",{class:`${ue}-steps-list`,children:e.map((y,P)=>y.kind==="tool"?a(Yf,{part:y.part,view:y.view,strings:o,renderCard:l},y.part.toolCallId):a(tc,{part:y.part,current:i&&P===e.length-1,reasoningMs:n?.[t[P]??-1]?.reasoningMs,strings:o},`${y.part.id}#${P}`))}):null})})]})}function Sx({since:e}){let[t,n]=N(()=>Date.now());U(()=>{let o=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(o)},[]);let r=Math.max(0,Math.floor((t-Date.parse(e))/1e3));return a("span",{class:`${ue}-steps-time`,children:La(r*1e3)})}function wx({running:e,stopped:t}){return e?a("span",{class:`${ue}-loading-spinner`}):t?a(wn,{}):a(w_,{})}function kx({line:e,strings:t}){return e.stopped?a(pe,{children:ed(e.stopped.finished,t)}):e.single?a(pe,{children:[e.single.name,e.single.summary?a(pe,{children:[a("span",{class:`${ue}-steps-sep`,"aria-hidden":"true",children:"\xB7"}),a("span",{class:`${ue}-steps-summary`,children:e.single.summary})]}):null,e.single.outcome?a("span",{class:`${ue}-steps-denied`,children:e.single.outcome}):null]}):a(pe,{children:e.tools.map(({name:n,count:r},o)=>a("span",{class:`${ue}-steps-name`,children:[o>0?a("span",{class:`${ue}-steps-sep`,"aria-hidden":"true",children:"\xB7"}):null,n,r>1?a("span",{class:`${ue}-steps-count`,children:["\xD7",r]}):null]},n))})}function Cx({view:e}){let t=e.statusLabel&&e.status!=="running"?a("span",{class:e.status==="failed"?`${ue}-steps-failed`:`${ue}-steps-denied`,children:e.statusLabel}):null;return a(pe,{children:[e.decision?a(Oo,{decision:e.decision}):null,t]})}function Qf({view:e,durationMs:t}){return a(pe,{children:[a("span",{class:`${ue}-steps-row-label`,children:[a("span",{class:`${ue}-steps-row-name`,children:e.name}),e.system?a("span",{class:`${ue}-steps-row-system`,children:e.system}):null,e.summary?a("span",{class:`${ue}-steps-row-summary`,children:e.summary}):null]}),a(Cx,{view:e}),t!==void 0?a("span",{class:`${ue}-steps-time`,children:La(t)}):null]})}function Yf({part:e,view:t,strings:n,durationMs:r,standalone:o=!1,renderCard:i}){let[s,l]=N(!1);return a(o?"div":"li",{class:`${ue}-steps-row`,"data-testid":L.toolStep,"data-status":t.status,"data-standalone":o?"true":void 0,children:[a("span",{class:`${ue}-steps-row-icon`,"aria-hidden":"true",children:a(Jl,{status:t.status})}),a("div",{class:`${ue}-steps-row-main`,children:t.opens?a("button",{type:"button",class:`${ue}-steps-row-head`,"aria-expanded":s,onClick:()=>l(!s),children:[a(Qf,{view:t,durationMs:r}),a("span",{class:`${ue}-steps-chevron`,"data-open":s?"true":void 0,children:a(Wt,{})})]}):a("span",{class:`${ue}-steps-row-head`,children:a(Qf,{view:t,durationMs:r})})}),s&&t.opens?a("div",{class:`${ue}-steps-row-body`,children:(t.card?i?.(e,t):void 0)??a(Ea,{view:t,strings:n})}):null]})}function tc({part:e,current:t,reasoningMs:n,strings:r,standalone:o=!1}){let[i,s]=N(!1),l=xe(()=>Ze(()=>e.textSig.value.trim()===""),[e]).value,c=a("span",{class:t?`${ue}-steps-thought-label ${ue}-steps-live`:`${ue}-steps-thought-label`,children:yx({streaming:t,reasoningMs:n},r)});return a(o?"div":"li",{class:`${ue}-steps-row ${ue}-steps-thought`,"data-status":"thought","data-testid":o?L.reasoning:void 0,"data-standalone":o?"true":void 0,children:[a("span",{class:`${ue}-steps-row-icon`,"aria-hidden":"true",children:a(C_,{})}),a("div",{class:`${ue}-steps-row-main`,children:l?c:a("button",{type:"button",class:`${ue}-steps-row-head`,"aria-expanded":i,onClick:()=>s(!i),children:[c,a("span",{class:`${ue}-steps-chevron`,"data-open":i?"true":void 0,children:a(Wt,{})})]})}),i&&!l?a("div",{class:`${ue}-steps-thought-text ${ue}-reasoning-body`,children:a(Co,{textSig:e.textSig,doneSig:e.doneSig})}):null]})}var Ge=O.cssPrefix,em=vf(Tx);function Tx({message:e,status:t,createdAt:n,strings:r,locale:o,responseMode:i,showReasoning:s,stepDisplay:l,showSources:c,interactive:u=!1,superseded:p=!1,tool:_,onRetry:d,enableMessageFeedback:f=!1,onFeedback:v,reconnecting:m=!1,clientToolRunning:b=!1,onCardAction:w}){let P=[...xe(()=>Ze(()=>e.partsSig.value),[e]).value];for(let ae of e.attachments??[])!ae.url||P.some(ve=>ve.kind==="file"&&ve.url===ae.url)||P.push({kind:"file",url:ae.url,mediaType:ae.mediaType,filename:ae.name,fileId:ae.id,fileSize:ae.size});let C=xe(()=>Ze(()=>Qn(e)),[e,t,e.canceled]),x=xe(()=>Ze(()=>Nf(e)),[e]),g=xe(()=>Ze(()=>s&&$f(e)),[e,s]),h=xe(()=>Ze(()=>Ip(e,g.value)),[e,g,t,e.canceled]),k=xe(()=>Ze(()=>!kl(e)),[e]),$=t==="streaming",I=e.role==="assistant"&&b,B=e.role==="assistant"&&($||I),A=$||I,z=Df({streaming:B,responseMode:i,reasoningVisible:g.value,hasAnswerText:x.value,emptyReply:C.value,hidden:h.value}),{bufferedHold:j,showStreamDots:Y}=z;if(z.hidden)return null;let ie=Ax(n,o),K=e.role==="assistant"||e.role==="operator",Te=f&&!!v&&!!e.serverMessageId&&K&&!A&&t!=="error"&&!C.value,Re=A?"":P.filter(ae=>ae.kind==="text").map(ae=>e.role==="assistant"?Qi(ae.textSig.peek()):ae.textSig.peek()).join(`
|
|
70
74
|
|
|
71
|
-
`).trim(),_e=!C&&t!=="error"&&!b.value&&pe.length>0,ae=e.canceled===!0||t==="error";function ve(se){return u&&t==="complete"&&ca(e,se)}let Xe=new Map;for(let[se,Se]of S.entries()){if(Se.kind!=="tool")continue;let ye=dn(Se.toolMetadata),we=Zc($f(Se),{turn:{live:A||ye&&!p,cutOff:ae,superseded:p,submitted:e.continuationStreaming===!0&&Se.approvalSig.value?.approved===void 0,canAct:ve(se),interrupted:ye&&Tf(Se.errorSig.value)},reader:{decides:!0},display:i,strings:n});Xe.set(Se.toolCallId,we.placement==="card"&&!_?.humanInLoop?{...we,placement:"hidden"}:we)}function bt(se){let Se=Xe.get(se.toolCallId);if(!Se)throw new Error(`no step view for ${se.toolCallId}`);return Se}let He=Wf(S,{showReasoning:a,showSources:c,viewOf:bt}),Tt=Gf(S),Oe=e.canceled===!0&&!R&&P.value&&h.value,Ge=He.at(-1),Bt=Ge?.kind==="steps"?Ge.indices.at(-1):Ge?.index;function It(se,Se){return l(vx,{part:se,generativeUi:e.role==="assistant",onCardAction:k,current:A&&Se===Bt,reasoningMs:e.stepTimings?.[Tt[Se]??-1]?.reasoningMs,strings:n,locale:o,showReasoning:a,showSources:c,view:se.kind==="tool"?Xe.get(se.toolCallId):void 0,canAct:ve(Se),superseded:p,continuationStreaming:e.continuationStreaming===!0,tool:_},`${bx(se)}#${Se}`)}let Ke=ce||_e;return l("div",{class:`${nt}-bubble-row`,"data-role":e.role,"aria-busy":A?"true":void 0,"data-testid":Ct(D.messageBubble,e.serverMessageId??e.id),children:l("div",{class:`${nt}-bubble-col`,children:[l("div",{class:`${nt}-bubble`,children:[e.role==="operator"&&e.operatorInitials?l("span",{class:`${nt}-bubble-author`,children:e.operatorInitials}):null,l("div",{class:`${nt}-bubble-body`,children:[N?l(xx,{label:n.loading}):He.flatMap((se,Se)=>se.kind==="part"?[It(se.part,se.index)]:se.rows.some(ye=>ye.kind==="tool")?[l(Kf,{rows:se.rows,steps:se.indices.map(ye=>Tt[ye]??-1),stepTimings:e.stepTimings,timed:!ae,strings:n,running:A&&Se===He.length-1,runStartedAt:e.runStartedAt,renderCard:(ye,we)=>we.card==="questions"&&_?l(tc,{part:ye,strings:n,active:!1,superseded:we.status==="replaced",folded:!0,onDecision:_.onDecision,onEdit:_.onEdit}):void 0},`steps#${se.indices[0]}`)]:se.rows.map((ye,we)=>It(ye.part,se.indices[we]??we))),Oe?l("div",{class:`${nt}-steps-row`,"data-status":"stopped","data-testid":D.replyStopped,children:[l("span",{class:`${nt}-steps-row-icon`,"aria-hidden":"true",children:l($r,{})}),l("div",{class:`${nt}-steps-row-main`,children:l("span",{class:`${nt}-steps-stopped-label`,children:n.statusStopped})})]}):null,H&&!g?l(Px,{}):null,t==="error"||b.value?l(Do,{text:yx(e,t,n),retryLabel:n.errorRetry,onRetry:d?()=>d(e):void 0,retryTestId:D.messageRetry}):null,g&&A?l(Do,{text:n.errorReconnecting,retryTestId:D.messageRetry}):null]})]}),G||Ke?l("div",{class:`${nt}-bubble-meta`,children:[G?l("time",{class:`${nt}-bubble-time`,dateTime:G.iso,title:G.full,children:G.short}):null,Ke?l("div",{class:`${nt}-bubble-actions`,children:[ce&&e.serverMessageId?l(Rf,{messageId:e.serverMessageId,initial:e.feedback??null,strings:n,onFeedback:v}):null,_e?l(mx,{text:pe,strings:n}):null]}):null]}):null]})})}function mx({text:e,strings:t}){let[r,n]=U(!1);function o(){navigator.clipboard?.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),1500)}).catch(()=>{})}let s=r?t.copied:t.copy;return l("button",{type:"button",class:`${nt}-msg-action`,"data-active":r?"true":void 0,"aria-label":s,title:s,onClick:o,"data-testid":D.messageCopy,children:r?l(qn,{}):l(g_,{})})}function gx(e,t){if(typeof e!="number"||!Number.isFinite(e))return null;try{let r=new Date(e);return{short:r.toLocaleTimeString(t,{hour:"numeric",minute:"2-digit"}),full:r.toLocaleString(t,{dateStyle:"full",timeStyle:"short"}),iso:r.toISOString()}}catch{return null}}function vx({part:e,generativeUi:t,onCardAction:r,current:n,reasoningMs:o,strings:s,locale:a,showReasoning:i,showSources:c,view:u,canAct:p,superseded:_,continuationStreaming:d,tool:f}){switch(e.kind){case"step-start":return null;case"text":return l(Oo,{textSig:e.textSig,doneSig:e.doneSig,generativeUi:t,strings:s,onCardAction:r});case"reasoning":return i?l(rc,{part:e,current:n,reasoningMs:o,strings:s,standalone:!0}):null;case"tool":return u?.placement!=="card"||!f?null:u.card==="questions"?l(tc,{part:e,strings:s,active:p,superseded:_,continuationStreaming:d,onDecision:f.onDecision,onEdit:f.onEdit}):l(qf,{part:e,view:u,strings:s,locale:a,canAct:p,onDecision:f.onDecision,onEdit:f.onEdit,preview:f.preview});case"file":return l(hx,{part:e,strings:s});case"source":return c?l(Lf,{part:e,strings:s}):null}}function hx({part:e,strings:t}){let r=e.filename??t.file;if(e.mediaType.startsWith("image/"))return l("a",{class:`${nt}-file-image`,href:e.url,target:"_blank",rel:"noreferrer noopener",title:r,"data-testid":D.messageFile,children:l("img",{src:e.url,alt:r,loading:"lazy"})});let n=(r.includes(".")?r.split(".").pop():e.mediaType.split("/").pop())?.toUpperCase(),o=e.fileSize===void 0?void 0:Fn(e.fileSize);return l("a",{class:`${nt}-file-chip`,href:e.url,target:"_blank",rel:"noreferrer noopener",title:r,"data-testid":D.messageFile,children:[l("span",{class:`${nt}-file-chip-icon`,"aria-hidden":"true",children:l(ba,{})}),l("span",{class:`${nt}-file-chip-text`,children:[l("span",{class:`${nt}-file-chip-name`,children:r}),l("span",{class:`${nt}-file-chip-meta`,children:[n,o].filter(Boolean).join(" \xB7 ")})]})]})}function yx(e,t,r){return e.errorText?e.errorText:t==="error"&&e.role==="assistant"?r.errorServer:r.errorGeneric}function bx(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 Px(){return l("span",{class:`${nt}-typing`,"data-testid":D.typingDots,"aria-hidden":"true",children:[l("span",{}),l("span",{}),l("span",{})]})}function xx({label:e}){return l("span",{class:`${nt}-loading`,role:"status",children:[l("span",{class:`${nt}-loading-spinner`,"aria-hidden":"true"}),l("span",{class:`${nt}-loading-label`,children:e})]})}var wr=q.cssPrefix,Fa=120,Sx=350;function Yf({messagesSig:e,reconnectingSig:t,pageToolRunning:r,strings:n,notice:o,locale:s,responseMode:a,showReasoning:i,stepDisplay:c,showSources:u,enableMessageFeedback:p,onFeedback:_,loading:d,onLoadPreviousMessages:f,idle:v,controlMode:g="ai-agent",tool:x,onRetry:k,onCardAction:y}){let S=B(null),b=Rt(()=>e.value),w=wx(s),[h,m]=U(!1),[P,R]=U(!1),I=B(!1),A=B(!1),[C,M]=U(),N=B(!1),H=B(!1),G=B(!1),z=B(0);function ce(){return G.current||performance.now()-z.current<Sx}let pe=B(0);function _e($){let L=$.scrollHeight-$.clientHeight>1;$.dataset.fadeTop=L&&$.scrollTop>1?"true":"false",$.dataset.fadeBottom=L&&$.scrollHeight-$.scrollTop-$.clientHeight>1?"true":"false"}function ae($){return m($.scrollHeight-$.scrollTop-$.clientHeight>Fa*2)}function ve($){pe.current=performance.now(),$.scrollTop=$.scrollHeight,_e($)}function Xe($,L){ve($);let Y=L,K=0;function te(){H.current||ce()||(ve($),--Y>0&&(K=requestAnimationFrame(te)))}return L>0&&(K=requestAnimationFrame(te)),()=>cancelAnimationFrame(K)}function bt($,L){let Y,K,te,be=-1;function de(){Y.disconnect(),K.disconnect(),clearTimeout(te)}function Pe(){if(H.current||ce()||be>=0&&$.scrollTop<be-4)return de();ve($),be=$.scrollTop}return Y=new ResizeObserver(Pe),K=new MutationObserver(Pe),Pe(),Y.observe($),K.observe($,{childList:!0,subtree:!0,characterData:!0}),te=setTimeout(de,L),de}let He=b.value[0]?.id;St(()=>{let $=S.current;if($&&b.value.length!==0&&!A.current&&(N.current=!0,!!b.value.some(L=>L.role==="user")))return bt($,300)},[He]);let Tt=B(0);F(()=>{let $=S.current,L=b.value,Y=Tt.current;if(Tt.current=L.length,!$||!N.current||A.current)return;if(L.slice(Y).some(te=>te.role==="user"))return H.current=!1,Xe($,3);if(!L.some(te=>te.role==="user")||H.current||ce())return;$.scrollHeight-$.scrollTop-$.clientHeight<Fa&&ve($)},[b.value.length]);let Oe=B(null);F(()=>{let $=S.current,L=b.value.at(-1),Y=Oe.current;if(Oe.current=L?{id:L.id,streaming:L.status==="streaming"}:null,!!$&&N.current&&!(!L||L.id!==Y?.id||Y.streaming||L.status!=="streaming"))return H.current=!1,Xe($,3)},[b.value]),F(()=>{let $=S.current;if(!$)return;let L=b.value.at(-1);if(!L||L.status!=="streaming"&&!b.value.some(te=>te.role==="user"))return;let Y=()=>{if(H.current||ce())return;$.scrollHeight-$.scrollTop-$.clientHeight<Fa*2&&ve($)};if(L.status!=="streaming")return bt($,300);Y();let K=new MutationObserver(Y);return K.observe($,{childList:!0,subtree:!0,characterData:!0}),()=>K.disconnect()},[b.value]),F(()=>{let $=S.current;if(!$)return;let L=()=>{ae($),_e($),performance.now()-pe.current>150&&(H.current=$.scrollHeight-$.scrollTop-$.clientHeight>8)};function Y(){H.current=!0}function K(Be){Be.deltaY<0&&Y()}let te=0;function be(Be){te=Be.touches[0]?.clientY??0,G.current=!0}function de(Be){(Be.touches[0]?.clientY??0)>te+4&&Y()}function Pe(){G.current=!1,z.current=performance.now()}function st(){G.current=!0}return $.addEventListener("scroll",L,{passive:!0}),$.addEventListener("wheel",K,{passive:!0}),$.addEventListener("touchstart",be,{passive:!0}),$.addEventListener("touchmove",de,{passive:!0}),$.addEventListener("touchend",Pe,{passive:!0}),$.addEventListener("touchcancel",Pe,{passive:!0}),$.addEventListener("pointerdown",st,{passive:!0}),window.addEventListener("pointerup",Pe,{passive:!0}),window.addEventListener("pointercancel",Pe,{passive:!0}),ae($),()=>{$.removeEventListener("scroll",L),$.removeEventListener("wheel",K),$.removeEventListener("touchstart",be),$.removeEventListener("touchmove",de),$.removeEventListener("touchend",Pe),$.removeEventListener("touchcancel",Pe),$.removeEventListener("pointerdown",st),window.removeEventListener("pointerup",Pe),window.removeEventListener("pointercancel",Pe)}},[]),F(()=>{let $=S.current;if(!$)return;let L=$.clientHeight,Y=new ResizeObserver(()=>{if($.clientHeight===L)return;let K=$.scrollHeight-$.scrollTop-L<=Fa;L=$.clientHeight,!(!K||A.current)&&b.value.some(te=>te.role==="user")&&(H.current=!1,ve($))});return Y.observe($),()=>Y.disconnect()},[]);function Ge(){let $=S.current;$&&(H.current=!1,ve($))}let Bt=b.value.filter($=>!$.ephemeral),It=Bt[0],Ke=It?.serverMessageId??It?.id,se=!!(f&&Bt.length>=Ml&&Ke!==C);async function Se(){if(!f||I.current)return;let $=S.current,L=$?.scrollHeight??0,Y=$?.scrollTop??0;I.current=!0,A.current=!0,R(!0);try{let K=await f();K===!1&&Ke&&M(Ke),K&&$&&(await new Promise(te=>requestAnimationFrame(()=>requestAnimationFrame(()=>te()))),$.scrollTop=Y+$.scrollHeight-L,_e($),ae($))}finally{A.current=!1,I.current=!1,R(!1)}}let ye=[],we="",Ee=b.value.at(-1)?.id,Kt=t?.value===!0,Pt=r===!0;for(let $ of b.value){if($.role==="assistant"&&$.id!==Ee&&on($))continue;let L=kx($.createdAt);L&&L!==we&&(ye.push(l("div",{class:`${wr}-date-divider`,children:l("span",{class:`${wr}-date-pill`,title:Cx($.createdAt,w),children:Tx($.createdAt,n,w)})},`day:${L}`)),we=L);let K=$.retryAction!==void 0||$.role==="assistant"&&$.id===Ee?pa(b.value,$):void 0,te=K!==void 0&&(K.kind!=="continue-assistant"||g==="ai-agent");ye.push(l(Qf,{message:$,status:$.status,createdAt:$.createdAt,strings:n,locale:w,responseMode:a,showReasoning:i,stepDisplay:c,showSources:u,interactive:!!v&&g==="ai-agent"&&$.id===Ee,superseded:$.id!==Ee,tool:x,onRetry:v&&te&&($.role==="user"||$.id===Ee)?k:void 0,enableMessageFeedback:p,onFeedback:_,reconnecting:Kt&&$.id===Ee,clientToolRunning:Pt&&$.id===Ee&&$.role==="assistant",onCardAction:y},$.id))}return l("div",{class:`${wr}-list-wrap`,children:[l("div",{ref:S,class:`${wr}-list ${wr}-list--fade`,part:"messages",role:"log","aria-live":"polite","aria-relevant":"additions text",children:[d&&b.value.length===0?l("div",{class:`${wr}-list-loading`,role:"status",children:n.conversationLoading}):null,o&&!se?l("div",{class:`${wr}-chat-notice`,role:"note","data-testid":D.chatNotice,children:l(ka,{text:o})}):null,se?l("div",{class:`${wr}-load-previous`,children:l("button",{type:"button",onClick:Se,disabled:P,"aria-busy":P,"data-testid":D.loadPreviousMessages,children:n.loadPreviousMessages})}):null,ye]}),h?l("button",{type:"button",class:`${wr}-jump`,onClick:Ge,"aria-label":n.scrollToBottom,title:n.scrollToBottom,"data-testid":D.scrollToBottom,children:l(sr,{})}):null]})}function wx(e){try{return Intl.getCanonicalLocales(e)[0]}catch{return}}function kx(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Cx(e,t){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(t,{dateStyle:"full"})}catch{return""}}function Tx(e,t,r){let n=new Date(e);function o(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate()).getTime()}let s=Math.round((o(new Date)-o(n))/864e5);return s<=0?t.dateToday:s===1?t.dateYesterday:s<7?n.toLocaleDateString(r,{weekday:"long"}):n.toLocaleDateString(r,{month:"long",day:"numeric",year:"numeric"})}var Ix=16,Rx=64;function Ha({panelEl:e,resize:t,position:r,edge:n,initialSize:o,onSizeChange:s,onResizeStart:a,strings:i}){let c=q.cssPrefix,u=B(null),[p,_]=U(null),d=o?.width,f=o?.height;if(F(()=>{if(!e)return;let C=e.style;C.setProperty(`--${c}-resize-min-w`,t.minWidth??"320px"),C.setProperty(`--${c}-resize-min-h`,t.minHeight??"400px"),t.maxWidth&&C.setProperty(`--${c}-resize-max-w`,t.maxWidth),t.maxHeight&&C.setProperty(`--${c}-resize-max-h`,t.maxHeight),d!==void 0&&f!==void 0&&(C.setProperty(`--${c}-widget-w`,`${d}px`),C.setProperty(`--${c}-widget-h`,`${f}px`)),_(Math.round(e.getBoundingClientRect().width/window.innerWidth*100))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,c,d,f]),!e)return null;let v=r.startsWith("top-"),g=r.endsWith("-right"),x=g?-1:1,k=v?1:-1,y=`${c}-resize-grip--${n?"edge":`${v?"bottom":"top"}-${g?"left":"right"}`}`;function S(C){C.setAttribute("data-resizing",""),a?.()}function b(C,M,N){C.style.setProperty(`--${c}-widget-w`,`${M}px`),n||C.style.setProperty(`--${c}-widget-h`,`${N}px`)}function w(C){let M=C.getBoundingClientRect(),N={width:Math.round(M.width),height:Math.round(M.height)};C.style.setProperty(`--${c}-widget-w`,`${N.width}px`),n||C.style.setProperty(`--${c}-widget-h`,`${N.height}px`),_(Math.round(N.width/window.innerWidth*100)),s(N)}function h(C){if(!e)return;let M=e.getBoundingClientRect();u.current={pointerId:C.pointerId,startX:C.clientX,startY:C.clientY,startW:M.width,startH:M.height,moved:!1},C.currentTarget.setPointerCapture(C.pointerId),C.preventDefault()}function m(C){let M=u.current;if(!M||C.pointerId!==M.pointerId||!e)return;let N=(C.clientX-M.startX)*x,H=n?0:(C.clientY-M.startY)*k;!M.moved&&N===0&&H===0||(M.moved||S(e),M.moved=!0,b(e,M.startW+N,M.startH+H))}function P(C){let M=u.current;!M||C.pointerId!==M.pointerId||!e||(C.currentTarget.releasePointerCapture(C.pointerId),u.current=null,M.moved&&(e.removeAttribute("data-resizing"),w(e)))}function R(C){return C==="ArrowLeft"?[-1,0]:C==="ArrowRight"?[1,0]:n?null:C==="ArrowUp"?[0,-1]:C==="ArrowDown"?[0,1]:null}function I(C){let M=R(C.key);if(!M||!e)return;C.preventDefault();let N=C.shiftKey?Rx:Ix;C.repeat||S(e);let H=e.getBoundingClientRect();b(e,H.width+M[0]*N*x,H.height+M[1]*N*k)}function A(C){!R(C.key)||!e||(e.removeAttribute("data-resizing"),w(e))}return l("div",{class:`${c}-resize-grip ${y}`,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,"aria-valuenow":p??void 0,tabIndex:0,title:i.resizeHandle,onPointerDown:h,onPointerMove:m,onPointerUp:P,onPointerCancel:P,onKeyDown:I,onKeyUp:A,"data-testid":D.resizeGrip,children:n?null:l(n_,{})})}var Jf=q.cssPrefix;function Xf({suggestions:e,strings:t,onPick:r,disabled:n=!1}){let o=B(null),[s,a]=U({start:!1,end:!1});return F(()=>{let i=o.current;if(!i)return;function c(){if(!i)return;let p=Math.abs(i.scrollLeft),_=p>1,d=p<i.scrollWidth-i.clientWidth-1;a(f=>f.start===_&&f.end===d?f:{start:_,end:d})}c(),i.addEventListener("scroll",c,{passive:!0});let u=typeof ResizeObserver>"u"?void 0:new ResizeObserver(c);return u?.observe(i),()=>{i.removeEventListener("scroll",c),u?.disconnect()}},[e]),e.length===0?null:l("div",{ref:o,class:`${Jf}-suggestions`,role:"group","aria-label":t.suggestedReplies,"data-cut-start":s.start?"true":void 0,"data-cut-end":s.end?"true":void 0,children:e.map((i,c)=>l("button",{type:"button",class:`${Jf}-suggestion`,onClick:()=>r(i),disabled:n,"data-testid":Ct(D.suggestion,c),children:i.label},i.id))})}var un=q.cssPrefix,Ax=`.${un}-header, .${un}-back-header, .${un}-home-hero`,Ex='button, a, input, textarea, select, [role="tab"], [contenteditable]',Zf=56;function ja(e,t){F(()=>{if(!t||!e)return;function r(c){return Number.parseFloat(c)||0}function n(c,u){return Math.min(u,Math.max(-u,c))}let o=null,s=c=>{let u=c.target;if(!(u instanceof Element)||!u.closest(Ax)||u.closest(Ex))return;let p=e.getBoundingClientRect();o={id:c.pointerId,x:c.clientX,y:c.clientY,dx:r(e.style.getPropertyValue(`--${un}-modal-dx`)),dy:r(e.style.getPropertyValue(`--${un}-modal-dy`)),maxX:(window.innerWidth+p.width)/2-Zf,maxY:(window.innerHeight+p.height)/2-Zf},e.dataset.dragging="true",c.preventDefault()},a=c=>{if(!o||c.pointerId!==o.id)return;let u=n(o.dx+c.clientX-o.x,o.maxX),p=n(o.dy+c.clientY-o.y,o.maxY);e.style.setProperty(`--${un}-modal-dx`,`${u}px`),e.style.setProperty(`--${un}-modal-dy`,`${p}px`)},i=c=>{!o||c.pointerId!==o.id||(o=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",s),window.addEventListener("pointermove",a),window.addEventListener("pointerup",i),window.addEventListener("pointercancel",i),()=>{e.removeEventListener("pointerdown",s),window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",i),window.removeEventListener("pointercancel",i)}},[e,t])}function Va({containerRef:e,onDrop:t,accept:r,disabled:n=!1}){let[o,s]=U();return F(()=>{if(n){s(void 0);return}let a=e.current;if(!a)return;let i=0;function c(d){i+=1,d.dataTransfer?.types.includes("Files")&&(d.preventDefault(),s([...d.dataTransfer.items].every(f=>f.kind!=="file"||B_(f.type,r))?"accept":"reject"))}function u(){i-=1,!(i>0)&&(i=0,s(void 0))}function p(d){d.dataTransfer?.types.includes("Files")&&d.preventDefault()}function _(d){i=0,s(void 0),d.dataTransfer&&(d.preventDefault(),t(d.dataTransfer.items))}return a.addEventListener("dragenter",c),a.addEventListener("dragleave",u),a.addEventListener("dragover",p),a.addEventListener("drop",_),()=>{a.removeEventListener("dragenter",c),a.removeEventListener("dragleave",u),a.removeEventListener("dragover",p),a.removeEventListener("drop",_)}},[r,e,n,t]),n?void 0:o}var Te=q.cssPrefix;function em(e){let{options:t,onClose:r}=e,n=t.strings,o=B(null);F(()=>{let u=o.current;if(!u||!r)return;let p=Bn(u);function _(d){d.key==="Escape"&&r?.()}return u.addEventListener("keydown",_),()=>{p(),u.removeEventListener("keydown",_)}},[r]);let s=e.composerApiRef,a=e.composerActive&&e.view==="chat"&&!e.sendPreparing&&e.options.features.fileUpload,i=j(u=>{a&&s.current?.attachFromDrop(u)},[s,a]),c=Va({containerRef:o,onDrop:i,accept:e.options.attachments.accept,disabled:!a});return ja(o.current,t.mode==="modal"),l("div",{ref:o,class:`${Te}-panel`,part:"panel",role:"dialog","aria-modal":"false","aria-label":n.panelTitle,style:{position:"relative"},"data-testid":D.panel,children:[l(nc,{...e,containerEl:o.current,dragOver:c}),l(oc,{poweredBy:e.options.poweredBy,strings:e.options.strings})]})}function nc(e){let{options:t,transport:r,feedback:n,bus:o,persistence:s,conversationId:a,composerKey:i,panelSize:c,view:u,isStreaming:p,isMemoryCompacting:_,canReleaseQueuedMessages:d,queueManualMessages:f,replyAwaitsCard:v,sendPreparing:g,attachmentUploadsSig:x,controlMode:k,assignedOperator:y,operatorAvailable:S,operatorRequestEnabled:b,onRequestOperator:w,onCancelOperatorRequest:h,loadingMessages:m,onLoadPreviousMessages:P,messagesSig:R,reconnectingSig:I,agent:A,ticketReference:C,login:M,onStartAsGuest:N,suggestions:H,initialWidgetSize:G,onClose:z,onBack:ce,onExpand:pe,onToggleHistory:_e,onSelectHistoryConversation:ae,onNewConversation:ve,onWidgetSizeChange:Xe,onSend:bt,onStop:He,onSuggestion:Tt,tool:Oe,onRetry:Ge,onMessageFeedback:Bt,onCardAction:It,containerEl:Ke,dragOver:se,composerApiRef:Se}=e,ye=t.strings,we=k==="operator"?y:void 0,Ee=we?{name:we.name??we.initials,avatar:we.avatar,title:ye.operatorBadgeTitle,status:"online"}:A,Kt=t.header.showNotice?mt(ye,t.header.notice||"chatNotice"):void 0,Pt=Rt(()=>R.value.some(de=>!de.ephemeral&&de.role!=="system")).value,$=Rt(()=>R.value.length>0).value,[L,Y]=U(),K=L===a,te=t.features.emailTranscript&&Pt?()=>Y(a):void 0,be=M.gate?l(qx,{login:{...M,gate:M.gate},alone:!$,onStartAsGuest:N,strings:ye}):l(he,{children:[k&&k!=="ai-agent"?l(Lx,{controlMode:k,operatorName:y?.name??y?.initials,operatorAvailable:S,onCancelOperatorRequest:h,strings:ye}):null,_&&k==="ai-agent"?l("div",{class:`${Te}-loading ${Te}-compaction-status`,role:"status","data-testid":D.compactionStatus,children:[l("span",{class:`${Te}-loading-spinner`,"aria-hidden":"true"}),ye.compactingContext]}):null,!p&&!_&&k==="ai-agent"&&l(Xf,{suggestions:H,strings:ye,onPick:Tt,disabled:g}),l(W_,{options:t,transport:r,feedback:n,bus:o,persistence:s,conversationId:a,maxMessageCharacters:e.maxMessageCharacters,isStreaming:p,pageToolRunning:e.pageToolRunning,isMemoryCompacting:_,canReleaseQueuedMessages:d,queueManualMessages:f,replyAwaitsCard:v,active:e.composerActive&&u==="chat",isPreparing:g,attachmentUploadsSig:x,operatorRequestEnabled:b,canRequestOperator:Pt,controlMode:k,onRequestOperator:w,onSend:bt,onStop:He,apiRef:Se},i)]});return l(he,{children:[u==="history"?l(Mx,{strings:ye,onBack:_e,onClose:z,showClose:fa(t.mode,c,t.actions)}):l("header",{class:`${Te}-header`,part:"header","data-variant":t.header.variant,"data-testid":D.panelHeader,children:[ce?l("button",{type:"button",class:`${Te}-icon-btn`,onClick:ce,"aria-label":ye.moduleBack,title:ye.moduleBack,children:l(Eo,{})}):null,Ee?l(Z_,{agent:Ee,strings:ye,ticketReference:C,person:!!we}):l("h1",{children:ye.panelTitle}),l(dr,{panelProps:M.gate?{...e,options:{...t,actions:t.actions.filter(de=>de!=="history")}}:e,variant:"chat",onEmailTranscript:te,onLogIn:M.menuLogIn})]}),u==="history"?l(Oa,{transport:r,strings:ye,locale:t.locale,persistence:s,onSelect:ae,onNewConversation:ve}):l(he,{children:[l(af,{state:se,strings:ye}),M.strip?l($x,{strip:M.strip,onLogIn:M.onLogIn,onHide:M.onHidePrompt,strings:ye}):null,M.gate&&!$?null:l(Yf,{messagesSig:R,reconnectingSig:I,pageToolRunning:e.pageToolRunning,strings:ye,notice:Kt,locale:t.locale,responseMode:t.responseMode,showReasoning:t.showReasoning,stepDisplay:t.stepDisplay,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:Bt,loading:m,onLoadPreviousMessages:P,idle:!p&&!g,controlMode:k,tool:Oe,onRetry:Ge,onCardAction:It}),be,l(Ox,{disclaimer:t.composerDisclaimer}),K?l(cf,{transport:r,strings:ye,knownEmail:lf({tokenEmail:M.email,userContext:t.userContext}),onClose:()=>Y(void 0)}):null]}),t.size.resize?.enabled?l(Ha,{panelEl:Ke,resize:t.size.resize,position:t.position,edge:t.mode==="drawer",initialSize:G,onSizeChange:Xe,onResizeStart:t.mode==="floating"&&c==="expanded"?pe:void 0,strings:ye}):null]})}function Mx({strings:e,onBack:t,onClose:r,showClose:n}){return l("header",{class:`${Te}-header`,part:"header",children:[l("button",{type:"button",class:`${Te}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:l(Eo,{})}),l("h1",{children:e.historyTitle}),n?l("button",{type:"button",class:`${Te}-icon-btn`,onClick:r,"aria-label":e.close,title:e.close,children:l(Dt,{})}):null]})}function Lx({controlMode:e,operatorName:t,operatorAvailable:r,onCancelOperatorRequest:n,strings:o}){let[s,a]=U(!1),i=Nx(e,t,r,o);function c(){n&&(a(!0),n().finally(()=>a(!1)))}return l("div",{class:`${Te}-operator-banner`,"data-mode":e,"data-available":r===!1?"false":void 0,"data-testid":D.operatorBanner,children:[l("span",{class:`${Te}-operator-pulse`,"aria-hidden":"true"}),l("span",{class:`${Te}-operator-label`,role:"status",children:i}),e==="awaiting-operator"&&n?l("button",{type:"button",class:`${Te}-icon-btn ${Te}-operator-dismiss`,onClick:c,disabled:s,"aria-label":o.cancelOperatorRequest,title:o.cancelOperatorRequest,"data-testid":D.cancelOperatorRequest,children:l(Dt,{})}):null]})}function Nx(e,t,r,n){return e==="operator"?n.chattingWithOperator.replace("{operator}",t??""):r===!1?n.noOperatorAvailable:n.connectingOperator}function Ox({disclaimer:e}){return e?l("div",{class:`${Te}-composer-footer`,children:l("div",{class:`${Te}-disclaimer`,children:e})}):null}function $x({strip:e,onLogIn:t,onHide:r,strings:n}){let o=e.kind==="user";return l("div",{class:`${Te}-login-bar`,"data-kind":e.kind,role:o?"status":"note","data-testid":o?D.loggedIn:D.loginBar,children:[l("span",{class:`${Te}-login-bar-icon`,"aria-hidden":"true",children:l(xr,{})}),o?l("span",{class:`${Te}-login-bar-text`,children:e.who?n.loggedInAs.replace("{name}",e.who):n.loggedIn}):l(he,{children:[l("span",{class:`${Te}-login-bar-text`,children:n.loginPrompt}),l("button",{type:"button",class:`${Te}-login-bar-action`,onClick:t,"data-testid":D.loginBarAction,children:n.loginAction}),l("button",{type:"button",class:`${Te}-icon-btn ${Te}-login-bar-hide`,onClick:r,"aria-label":n.dismissLoginPrompt,title:n.dismissLoginPrompt,"data-testid":D.loginBarHide,children:l(Dt,{})})]})]})}function Dx(e,t){return e.gate==="required"?t.loginRequired:e.canStartAsGuest?t.loginExpiredGuest:t.loginExpired}function qx({login:e,alone:t,onStartAsGuest:r,strings:n}){return l("div",{class:`${Te}-login-gate`,"data-gate":e.gate,"data-alone":t?"":void 0,"data-testid":D.loginGate,children:[l("span",{class:`${Te}-login-gate-icon`,"aria-hidden":"true",children:l(xr,{})}),l("p",{class:`${Te}-login-gate-title`,role:"status",children:Dx(e,n)}),e.canLogIn||e.canStartAsGuest?l("div",{class:`${Te}-form-actions ${Te}-login-gate-actions`,children:[e.canStartAsGuest?l("button",{type:"button",class:`${Te}-form-skip`,onClick:r,"data-testid":D.loginGateGuest,children:n.startAsGuest}):null,e.canLogIn?l("button",{type:"button",class:`${Te}-form-submit`,onClick:e.onLogIn,"data-testid":D.loginGateAction,children:n.loginAction}):null]}):null]})}function oc({poweredBy:e,strings:t}){return e?l("div",{class:`${Te}-poweredby-bar`,children:l(Ux,{logoUrl:e.logoUrl,text:e.text??t.poweredBy.replace("{name}",q.displayName),href:e.href})}):null}function Ux({logoUrl:e,text:t,href:r}){let n=l(he,{children:[e?l("img",{class:`${Te}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?l("span",{children:t}):null]});return r?l("a",{class:`${Te}-poweredby`,href:r,target:"_blank",rel:"noopener noreferrer",children:n}):l("span",{class:`${Te}-poweredby`,children:n})}var Wa=q.cssPrefix;function tm({panelProps:e,enabledModules:t,nav:r,bus:n,hasUnread:o,latestNews:s,onSelectConversation:a,onStartNewConversation:i,onSetPanelSize:c}){let u=e.options,p=u.strings,_=B(null),d=B(new Set);F(()=>{let N=_.current;if(!N||!e.onClose)return;let H=Bn(N);function G(z){z.key==="Escape"&&e.onClose?.()}return N.addEventListener("keydown",G),()=>{H(),N.removeEventListener("keydown",G)}},[e.onClose]);let f=Rt(()=>r.sig.value).value,v=Vp(f),g=u.modules.byId[f.activeTab],x=e.composerActive&&g?.layout==="chat"&&v===void 0,k=e.composerApiRef,y=x&&e.view==="chat"&&!e.sendPreparing&&e.options.features.fileUpload,S=j(N=>{y&&k.current?.attachFromDrop(N)},[k,y]),b=Va({containerRef:_,onDrop:S,accept:e.options.attachments.accept,disabled:!y});ja(_.current,u.mode==="modal");let w=v?.kind==="content",h=t.length>1&&Wp(f),m=B(null);F(()=>{if(w&&m.current===null)m.current=e.panelSize,e.panelSize==="normal"&&c("expanded");else if(!w&&m.current!==null){let N=m.current;m.current=null,c(N)}},[w]);let P={push:N=>r.push(N),pop:()=>r.pop(),switchTab:N=>r.switchTab(N),switchToLayout:N=>{let H=t.find(G=>G.layout===N);H&&r.switchTab(H.id)},selectConversation:a,startNewConversation:i};function R(N){return{options:u,transport:e.transport,strings:p,config:N,nav:P,bus:n,panelProps:e,latestNews:s}}let I=l(dr,{panelProps:e,variant:"plain"});g&&d.current.add(g.id);let A=t.filter(N=>d.current.has(N.id));function C(N){if(N.layout==="chat")return l(nc,{...e,composerActive:x,containerEl:_.current,dragOver:b});let H=Na[N.layout].Root;return H?l(H,{...R(N)}):null}function M(){return v?.kind==="content"?l(E_,{id:v.id,title:v.title,transport:e.transport,strings:p,bus:n,onBack:()=>r.pop(),actions:I}):null}return l("div",{ref:_,class:`${Wa}-panel ${Wa}-messenger`,part:"panel",role:"dialog","aria-modal":"false","aria-label":p.panelTitle,style:{position:"relative"},"data-testid":D.messengerHome,children:[l("div",{class:`${Wa}-messenger-body`,children:[A.map(N=>l("div",{class:`${Wa}-messenger-pane`,hidden:w||N.id!==g?.id,children:C(N)},N.id)),M()]}),h?l(X_,{modules:t,activeTab:f.activeTab,strings:p,hasUnread:o,onSelect:N=>r.switchTab(N)}):null,l(oc,{poweredBy:u.poweredBy,strings:u.strings}),u.size.resize?.enabled&&!(g?.layout==="chat"&&!v)?l(Ha,{panelEl:_.current,resize:u.size.resize,position:u.position,edge:u.mode==="drawer",initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,onResizeStart:u.mode==="floating"&&e.panelSize==="expanded"?e.onExpand:void 0,strings:p}):null]})}function rm(e){let t=q.cssPrefix,{site:r,blocks:n,strings:o,collapsed:s}=e,a=n?.navigation??[],i=n?.linkCards??[],c=s?o.expandSidebar:o.collapseSidebar;return l("aside",{class:`${t}-sidebar`,"data-collapsed":s?"true":"false","data-testid":D.sidebar,children:[l("div",{class:`${t}-sidebar-header`,children:[l(Bx,{site:r}),l("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":s?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":D.sidebarToggle,children:l(zx,{collapsed:s})})]}),s?null:l(he,{children:[a.length>0?l("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:l(Fx,{items:a})}):null,i.length>0?l("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:l(Hx,{items:i})}):null,e.showConversations?l("div",{class:`${t}-sidebar-conversations`,children:l(Oa,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function Bx({site:e}){let t=q.cssPrefix;if(e?.logo?.url){let r=e.logo.alt??e.title??"Logo";return l("picture",{children:[e.logoDark?.url?l("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,l("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:r})]})}return l("div",{class:`${t}-sidebar-title`,children:e?.title??q.name})}function zx({collapsed:e}){return l("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?l("polyline",{points:"9 6 15 12 9 18"}):l("polyline",{points:"15 6 9 12 15 18"})})}function Fx({items:e}){let t=q.cssPrefix;return l("ul",{class:`${t}-sidebar-nav`,children:e.map(r=>l("li",{children:l("a",{class:`${t}-sidebar-nav-item`,href:r.href,target:r.href?"_blank":void 0,rel:r.href?"noreferrer":void 0,children:[r.icon?l("span",{class:`${t}-sidebar-nav-icon`,"data-icon":r.icon}):null,l("span",{class:`${t}-sidebar-nav-label`,children:r.label})]})},r.id??r.label))})}function Hx({items:e}){let t=q.cssPrefix;return l("div",{class:`${t}-sidebar-cards`,children:e.map(r=>l("a",{class:`${t}-sidebar-card`,href:r.href,target:r.href?"_blank":void 0,rel:r.href?"noreferrer":void 0,children:[l("div",{class:`${t}-sidebar-card-label`,children:r.label}),r.description?l("div",{class:`${t}-sidebar-card-desc`,children:r.description}):null]},r.id??r.label))})}var nm=q.cssPrefix;function om(e){return l("main",{class:`${nm}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[l(rm,{site:e.site,blocks:e.blocks,transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,showConversations:e.showConversations,onSelectConversation:e.onSelectConversation,onNewConversation:e.onNewConversation,collapsed:e.sidebarCollapsed,onToggleCollapsed:e.onToggleSidebarCollapsed}),l("section",{class:`${nm}-page-chat`,"aria-label":e.strings.panelTitle,children:e.children})]})}var jo=q.cssPrefix;function ic({strings:e,text:t,onClose:r}){return l("div",{class:`${jo}-panel ${jo}-panel-notice`,part:"panel",role:"dialog","aria-label":e.panelTitle,"data-testid":D.panelNotice,children:[r?l("button",{type:"button",class:`${jo}-icon-btn ${jo}-panel-notice-close`,onClick:r,"aria-label":e.close,title:e.close,children:l(Dt,{})}):null,l("p",{class:`${jo}-panel-notice-text`,children:t})]})}var Vo=ie.scope("hitl");function Wo(e){return e.kind==="tool"&&dn(e.toolMetadata)&&(e.stateSig.value==="input-available"||e.stateSig.value==="approval-responded"&&e.approvalSig.value?.approved===!0)}function im(e,t){t.errorSig.value=Jl(t.toolCallId),t.stateSig.value="output-error",e.partsSig.value=[...e.partsSig.value]}function am(e,t){let r=e.slice(0,e.indexOf(t)).findLast(n=>n.role==="user");return r!==void 0&&qt.sentHere(r.id)}function sm(e){let{streaming:t,controlModeSig:r,messagesSig:n,sendAiTurn:o,bus:s,humanInLoop:a,tools:i}=e,c=B(t);c.current=t;let u=B(i);u.current=i;let p=B(new Map),_=Rt(()=>{let S=n.value,b=S.at(-1);return r.value!=="ai-agent"||b?.role!=="assistant"||b.status!=="complete"?!1:b.partsSig.value.some(w=>Wo(w)&&qt.get(w.toolCallId)?.state!=="stopped")&&am(S,b)}).value,d=j((S,b,w)=>{if(c.current||r.value!=="ai-agent")return!1;let h=n.value.at(-1),m=h?.partsSig.value.findIndex(I=>I.kind==="tool"&&I.toolCallId===S)??-1,P=h?.partsSig.value[m];if(!h||P?.kind!=="tool")return Vo.warn("decideTool: tool part not found",{toolCallId:S}),!1;if(h.status!=="complete"||!ca(h,m)||!b(P))return!1;if(w(P),h.partsSig.value=[...h.partsSig.value],!an(h)||h.partsSig.value.some(Wo))return!0;h.status="streaming",h.retryAction={kind:"continue-assistant",messageId:h.serverMessageId??h.id},h.awaitingContinuation=!0,n.value=[...n.value];let R=h.partsSig.value.flatMap(I=>I.kind==="tool"?[I.toolCallId]:[]);return o({continueExisting:!0}).then(I=>I&&qt.clear(R)),!0},[r,n,o]),f=j((S,b)=>{let{toolCallId:w,toolName:h}=b;p.current.has(w)||(p.current.set(w,S),Cf({toolCallId:w,toolName:h,input:b.inputSig.value,optionTools:u.current??[],onSettled:(m,P)=>{Vo.info("toolResult",{toolCallId:w,status:m}),s.emit("toolResult",{toolCallId:w,name:Wn(h),status:m,durationMs:P})}}).then(m=>{p.current.delete(w)&&d(w,Wo,P=>{m.state==="output-available"?P.outputSig.value=m.output:P.errorSig.value=m.errorText,P.stateSig.value=m.state})}))},[s,d]),v=j(()=>{let S=n.value;for(let[h,m]of p.current){let P=S.findIndex(R=>R.id===m);P<0||P===S.length-1||(p.current.delete(h),If(h))}let b=S.at(-1);if(c.current||b?.role!=="assistant"||b.status!=="complete")return;let w=b.partsSig.value.filter(Wo);if(!(w.length===0||!am(S,b)))for(let h of w)qt.get(h.toolCallId)?.state==="stopped"?im(b,h):f(b.id,h)},[n,f]);F(()=>v(),[t,v]),F(()=>n.subscribe(()=>v()),[n,v]);let g=j((S,b,w)=>{let h=!1,m;if(!d(S,I=>I.stateSig.value==="approval-requested",I=>{dn(I.toolMetadata)&&(m=I),h=I.toolMetadata?.card==="questions";let A=I.approvalSig.value?.id??S;I.approvalSig.value={id:A,approved:b,reason:w},I.stateSig.value="approval-responded"}))return;let R=n.value.at(-1);if(m&&b&&R&&f(R.id,m),m&&!b&&s.emit("toolResult",{toolCallId:S,name:Wn(m.toolName),status:"declined",durationMs:0}),h){Vo.info("toolResult",{toolCallId:S}),s.emit("toolResult",{toolCallId:S});return}Vo.info("toolDecision",{toolCallId:S,approved:b}),s.emit("toolDecision",{toolCallId:S,approved:b})},[s,d,n,f]),x=j(S=>{d(S,b=>b.stateSig.value==="approval-responded"&&b.approvalSig.value?.approved!==void 0&&!Wo(b),b=>{let w=b.approvalSig.value?.id??S;b.approvalSig.value={id:w},b.stateSig.value="approval-requested"})},[d]),k=Ce(()=>({humanInLoop:a,onDecision:g,onEdit:x,preview:(S,b)=>kf({toolName:S,input:b,optionTools:u.current??[]})}),[a,g,x]),y=j(()=>{let S=n.value.at(-1);for(let b of p.current.keys()){let w=S?.partsSig.value.find(h=>h.kind==="tool"&&h.toolCallId===b);S&&w?im(S,w):Jl(b),Vo.info("toolResult",{toolCallId:b,status:"stopped"}),s.emit("toolResult",{toolCallId:b,name:w?Wn(w.toolName):void 0,status:"stopped",durationMs:0})}p.current.clear()},[s,n]);return{toolInteraction:k,pageToolsRunning:_,stopPageTools:y}}var jx=ie.scope("latest-news");function lm({transport:e,options:t,persistence:r,enabled:n}){let o=t.modules.list.find(_=>_.layout==="news")?.contentCollectionIds,s=o?.join(","),[a,i]=U(),[c,u]=U(()=>r.loadSeenNewsId());F(()=>{if(!n||!o?.length)return;let _=!1;return e.listContent({contentCollectionIds:o,sortBy:"publishedAt",sortOrder:"desc",limit:1}).then(d=>{_||i(d.items[0])}).catch(d=>jx.debug("listContent (latest news) failed (non-fatal)",{err:d})),()=>{_=!0}},[e,n,s]);let p=j(_=>{r.saveSeenNewsId(_),u(_)},[r]);return{item:a,unseen:a!==void 0&&a.id!==c,markSeen:p}}function cm({callout:e,persistence:t}){let r=e?.text??"",n=e?.persistent??!0,[o,s]=U(()=>n?!1:t.loadCalloutDismissed(r));F(()=>{s(n?!1:t.loadCalloutDismissed(r))},[r,n,t]);let a=j(()=>{s(!0),n||t.saveCalloutDismissed(r)},[t,r,n]);return{dismissed:o,dismissCallout:a}}var Vx=ie.scope("login");function Wx(e,t){switch(e.status){case"required":return"required";case"expired":return"expired";case"anonymous":return t?"required":void 0;case"pending":case"loggedIn":return;default:return e}}function Gx(e,t,r){if(e.status==="loggedIn")return t.hideUser?void 0:{kind:"user",who:e.name??e.email};if(!(e.status!=="anonymous"||!t.url||t.hidePrompt||r))return{kind:"prompt"}}function dm(e){let{state:t,deployment:r,bus:n,persistence:o,conversationIdSig:s}=e,[a,i]=U(()=>o.loadLoginPromptDismissedIn()),c=Rt(()=>s.value).value,u=a!==void 0&&a===c,p=(t.status==="required"?t.loginUrl:void 0)??r.url,_=Wx(t,r.required),d=j(()=>{let g=wu(),x=n.listensTo("loginRequested");if(Vx.info("loginRequested",{pageLogsIn:x}),n.emit("loginRequested",{returnTo:g}),x||!p)return;let k=s.value;k&&o.saveLoginReturn({conversationId:k,draft:o.loadDraft(k)}),o.savePanelOpen(!1),ku(bu(p,g))},[n,s,p,o]),f=j(()=>{let g=s.value;g&&(o.dismissLoginPromptIn(g),i(g))},[s,o]),v=!!p||n.listensTo("loginRequested");return{strip:Gx(t,r,!!_||u),gate:_,canStartAsGuest:_==="expired"&&!r.required,email:t.status==="loggedIn"?t.email:void 0,canLogIn:v,onLogIn:d,menuLogIn:t.status==="anonymous"&&!_&&v?d:void 0,onHidePrompt:f}}function um(e){let{transport:t,conversationIdSig:r}=e,n=Lt("ai-agent"),o=Lt(void 0),s=Lt(void 0),a=B(void 0),i=j(_=>{let d=_.controlRevision,f=a.current;if(f&&f.conversationId===r.value&&d<f.revision)return;a.current={conversationId:r.value,revision:d},n.value=_.controlMode;let v=_.assignedOperatorInitials;o.value=v?{initials:v,name:_.assignedOperatorName,avatar:_.assignedOperatorAvatar}:void 0,_.controlMode!=="awaiting-operator"?s.value=void 0:_.operatorAvailable!==void 0&&(s.value=_.operatorAvailable)},[r,n,o,s]),c=j(_=>{if(_.type!=="data-control-state")return;let d=ia(_.data);d&&i(d)},[i]),u=j(async()=>{let _=r.value,d=await t.requestOperator();d&&r.value===_&&i(d)},[t,r,i]),p=j(async()=>{let _=r.value,d=await t.cancelOperatorRequest();d&&r.value===_&&i(d)},[t,r,i]);return{controlModeSig:n,assignedOperatorSig:o,operatorAvailableSig:s,applyControlState:i,adoptControlStateChunk:c,requestOperator:u,cancelOperatorRequest:p}}var Ga=q.cssPrefix,pm=`--${Ga}-visual-viewport-height`,_m=`--${Ga}-visual-viewport-top`;function fm(e){let{hostElement:t,mode:r,panelSize:n,isOpen:o,surfaceReady:s,onClose:a}=e;St(()=>{Ti(t,ma(r,n,o))},[t,o,n,r]),St(()=>{if(!o||!s)return;let i=t.ownerDocument.defaultView,c=i?.visualViewport,u=t.shadowRoot?.querySelector(`.${Ga}-anchor`);if(!i||!c||!u)return;let p=()=>{u.style.setProperty(pm,`${c.height}px`),u.style.setProperty(_m,`${c.offsetTop}px`)},_=0,d=()=>{i.cancelAnimationFrame(_),_=i.requestAnimationFrame(()=>{_=i.requestAnimationFrame(p)})};return p(),c.addEventListener("resize",d),c.addEventListener("scroll",d),()=>{i.cancelAnimationFrame(_),c.removeEventListener("resize",d),c.removeEventListener("scroll",d),u.style.removeProperty(pm),u.style.removeProperty(_m)}},[t,o,s]),F(()=>{if(r!=="modal"||!o)return;function i(c){c.composedPath().some(p=>p instanceof HTMLElement&&p.classList.contains(`${Ga}-panel`))||a()}return t.addEventListener("click",i),()=>t.removeEventListener("click",i)},[t,o,r,a]),F(()=>{if(r!=="drawer"||!o)return;function i(c){c.key==="Escape"&&!c.composedPath().includes(t)&&a()}return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[t,o,r,a])}var ac=ie.scope("reducer"),Ka=class{constructor(t,r){ee(this,"messagesSig",t);ee(this,"onReconcileNeeded",r);ee(this,"active",null);ee(this,"openTextParts",new Map);ee(this,"partSeq",0);ee(this,"replay",null);ee(this,"turnChunks",[]);ee(this,"turnRow",null)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.replay=null,this.openTextParts.clear()}beginReplay(t,r){let n=cr();n.id=t.id;let o=pn(t)||sn(t)&&(t.status!=="streaming"||an(t)),s=t.status==="streaming"&&an(t)&&ko(t);this.replay={baseline:t,shadow:n,chunks:[r],probeContinuation:o,continuationTailReplay:s,liveCatchUp:t.status==="streaming"&&!o},this.attach(n),this.apply(r)}refreshReplayBaseline(){let t=this.replay;if(!t)return null;let r=t.shadow.serverMessageId??t.baseline.serverMessageId,n=this.messagesSig.value,o=n.at(-1),s=o===t.baseline||o?.id===t.baseline.id||r!==void 0&&o?.serverMessageId===r?o:n.find(i=>i===t.baseline)??n.find(i=>i.id===t.baseline.id||r!==void 0&&i.serverMessageId===r);if(!s)return this.detach(),null;if(s===t.baseline)return t;let a=t.baseline;return t.baseline=s,mm(a,s),t.liveCatchUp&&pn(t.shadow)&&(s.status==="streaming"||sn(s))?(t.probeContinuation=!1,t.continuationTailReplay=!1,t):(t.probeContinuation=pn(s)||sn(s)&&(s.status!=="streaming"||an(s)),t.continuationTailReplay=s.status==="streaming"&&an(s)&&ko(s),t.liveCatchUp=s.status==="streaming"&&!t.probeContinuation,t)}refreshActive(){let t=this.active;if(!t)return null;let r=t.serverMessageId,n=this.messagesSig.value,o=n.at(-1),s=o===t||o?.id===t.id||r!==void 0&&o?.serverMessageId===r?o:n.find(i=>i===t)??n.find(i=>i.id===t.id||r!==void 0&&i.serverMessageId===r);if(!s)return this.detach(),null;if(s===t)return t;mm(t,s);let a=pn(t)&&sn(s);return s.status!=="streaming"&&!a?(this.detach(),null):(this.replayTurn(),this.replay?this.replay.shadow:this.active)}replayTurn(){let[t,...r]=this.turnChunks;if(t?.type!=="start")return;let n=this.messagesSig.value.find(o=>o.serverMessageId===t.messageId);if(!(n===void 0||n===this.turnRow)){this.detach();for(let o of[t,...r])this.applyResume(o)}}promoteReplay(t){let{baseline:r,shadow:n}=t;return er(()=>{r.role=n.role,r.serverMessageId=n.serverMessageId,r.operatorInitials=n.operatorInitials,r.status=n.status,n.canceled&&(r.canceled=!0),r.finishReason=n.finishReason,r.errorText=n.errorText,r.suggestions=n.suggestions??r.suggestions,r.runStartedAt=n.runStartedAt??r.runStartedAt,r.stepTimings=n.stepTimings??r.stepTimings,r.partsSig.value=n.partsSig.value,this.messagesSig.value=[...this.messagesSig.value]}),this.replay=null,this.active=r,r}promoteContinuation(t){let{baseline:r,chunks:n}=t,o=da(r);return this.replay=null,er(()=>{r.partsSig.value=r.partsSig.value.slice(0,Kx(r,n)+1),r.awaitingContinuation=!1,r.status="streaming",r.finishReason=void 0,r.errorText=void 0,r.suggestions=void 0,this.attach(r);for(let s of n)this.apply(s);r.continuationStreaming=o||void 0,this.messagesSig.value=[...this.messagesSig.value]}),r}settleOwnedContinuation(t,r){let{baseline:n}=t,o=da(n);return this.replay=null,er(()=>{n.awaitingContinuation=!1,n.status="streaming",n.finishReason=void 0,n.errorText=void 0,n.suggestions=void 0,this.attach(n),this.apply(r),n.continuationStreaming=o||void 0,this.messagesSig.value=[...this.messagesSig.value]}),n}applyResume(t){t.type==="start"&&(this.turnChunks=[]);let r=this.applyTurnChunk(t);return this.turnChunks.push(t),this.turnRow=r??this.replay?.baseline??this.active??this.turnRow,r}applyTurnChunk(t){if(t.type==="start"){let o=(this.replay?.baseline??this.active)?.serverMessageId;o!==void 0&&t.messageId!==void 0&&o!==t.messageId&&this.onReconcileNeeded?.({messageId:o}),this.detach();let s=t.messageId,a=s!==void 0?this.messagesSig.value.find(p=>p.serverMessageId===s||p.id===s):void 0;if(a!==void 0)return t.messageMetadata?.senderRole==="visitor"&&a.role==="user"&&(a.status==="pending"||a.status==="error")&&(a.serverMessageId=s,a.status="complete",a.errorText=void 0,a.retryAction=void 0,this.messagesSig.value=[...this.messagesSig.value]),this.beginReplay(a,t),null;let i=t.messageMetadata?.senderRole,c=this.messagesSig.value.at(-1);if(i===void 0&&c?.role==="assistant"&&c.status==="streaming"&&c.serverMessageId===void 0&&!ar(c))return this.attach(c),this.apply(t),null;let u=cr();return this.attach(u),this.messagesSig.value=[...this.messagesSig.value,u],this.apply(t),null}if(this.replay){let n=this.refreshReplayBaseline();if(!n)return null;n.chunks.push(t),t.type==="data-control-state"&&(n.baseline.operatorRoutedTurn=t.data.controlMode!=="ai-agent"),this.apply(t);let{baseline:o,shadow:s,probeContinuation:a,continuationTailReplay:i,liveCatchUp:c}=n,u=t.type==="finish"||t.type==="error"||t.type==="abort";if(a){if(!Jx(o,s,t)){if(u){if(o.status==="streaming"&&o.awaitingContinuation!==!0){let d=this.settleOwnedContinuation(n,t);return this.detach(),d}tS(o,s)&&(o.continuationStreaming=!0,this.messagesSig.value=[...this.messagesSig.value],this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id})),this.detach()}return null}let _=pn(o)&&u?this.settleOwnedContinuation(n,t):this.promoteContinuation(n);return u?(_.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:_.serverMessageId??_.id}):_.continuationStreaming=!1),this.detach(),_):null}if(i&&Yx(o,s)){let _=this.promoteContinuation(n);return u?(this.detach(),_):null}if(!c)return u&&this.detach(),null;if(u&&!ar(o)&&ar(s)){let _=this.promoteReplay(n);return this.detach(),_}if(!Qx(o,s))return u&&(this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id}),this.detach()),null;let p=this.promoteReplay(n);return u?(this.detach(),p):null}let r=this.refreshActive();if(!r)return null;if(this.replay)return this.applyTurnChunk(t);if(this.apply(t),t.type==="finish"||t.type==="error"||t.type==="abort"){let n=r;return n.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:n.serverMessageId??n.id}):n.continuationStreaming=!1),this.detach(),n}return null}ensureTextPart(t,r,n){let o=`${r}:${n}`,s=this.openTextParts.get(o);if(s)return s;let a={kind:r,id:`${n}#${this.partSeq++}`,textSig:oe(""),doneSig:oe(!1)};return this.openTextParts.set(o,a),Go(t,a),a}apply(t){let r=this.active;if(r)switch(t.type){case"start":{t.messageId&&(r.serverMessageId=t.messageId);let n=t.messageMetadata;n?.runStartedAt&&(r.runStartedAt=n.runStartedAt),n?.senderRole==="operator"?(r.role="operator",n.operatorInitials&&(r.operatorInitials=n.operatorInitials)):n?.senderRole==="visitor"&&(r.role="user");return}case"finish-step":this.openTextParts.clear();return;case"start-step":Go(r,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"message-metadata":r.stepTimings=sa(t.messageMetadata?.steps)??r.stepTimings;return;case"finish":ac.debug("finish",{reason:t.finishReason}),r.stepTimings=sa(t.messageMetadata?.steps)??r.stepTimings,r.status="complete",r.retryAction=void 0,t.finishReason&&(r.finishReason=t.finishReason),this.bumpDone(r);return;case"error":ac.warn("stream error chunk",{errorText:t.errorText}),r.status="error",r.errorText=void 0,this.bumpDone(r);return;case"abort":ac.debug("stream abort chunk (canceled)"),r.status="complete",r.canceled=!0,r.retryAction=void 0,this.bumpDone(r);return;case"text-start":this.ensureTextPart(r,"text",t.id);return;case"text-delta":{let n=this.ensureTextPart(r,"text",t.id);n.textSig.value+=t.delta;return}case"text-end":this.ensureTextPart(r,"text",t.id).doneSig.value=!0;return;case"reasoning-start":this.ensureTextPart(r,"reasoning",t.id).doneSig.value=!1;return;case"reasoning-delta":{let n=this.ensureTextPart(r,"reasoning",t.id);n.textSig.value+=t.delta;return}case"reasoning-end":this.ensureTextPart(r,"reasoning",t.id).doneSig.value=!0;return;case"tool-input-start":case"tool-input-delta":case"tool-input-available":case"tool-input-error":case"tool-output-available":case"tool-output-error":case"tool-output-denied":case"tool-approval-request":case"tool-approval-response":rS(r,t);return;case"file":Go(r,{kind:"file",url:t.url,mediaType:t.mediaType,filename:t.filename,fileId:t.fileId,fileSize:t.fileSize});return;case"source-url":gm(r,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":gm(r,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-suggestions":r.suggestions=aa(t.data);return;case"data-control-state":r.operatorRoutedTurn=t.data.controlMode!=="ai-agent";return;case"data-memory-compaction-state":return;default:{let n=t}}}bumpDone(t){er(()=>{t.partsSig.value=[...t.partsSig.value],this.messagesSig.value.includes(t)&&(this.messagesSig.value=[...this.messagesSig.value])})}};function pn(e){return e.awaitingContinuation===!0||e.continuationStreaming===!0||e.retryAction?.kind==="continue-assistant"}function mm(e,t){e.canceled&&(t.canceled=!0),!(!pn(e)||t.status!=="streaming"&&!sn(t))&&(t.awaitingContinuation??(t.awaitingContinuation=e.awaitingContinuation),t.continuationStreaming??(t.continuationStreaming=e.continuationStreaming),t.retryAction===void 0&&(t.retryAction=e.retryAction))}function Kx(e,t){let r=e.partsSig.value,n=t.findIndex(i=>i.type==="start-step"),o=new Set(t.slice(0,n<0?t.length:n).flatMap(i=>"toolCallId"in i&&i.type.startsWith("tool-output")?[i.toolCallId]:[])),s=r.findLastIndex(i=>i.kind==="tool"&&(i.stateSig.value==="approval-requested"||i.stateSig.value==="approval-responded"||o.has(i.toolCallId)));if(s>=0)return s;let a=new Set(t.flatMap(i=>i.type==="tool-input-start"||i.type==="tool-input-available"?[i.toolCallId]:[]));return r.some(i=>i.kind==="tool"&&a.has(i.toolCallId))?-1:r.findLastIndex(i=>i.kind==="tool")}function Qx(e,t){let r=e.partsSig.value,n=t.partsSig.value;return e.role!==t.role||n.length<r.length?!1:r.every((o,s)=>vm(o,n[s]))}function Yx(e,t){let r=e.partsSig.value,n=r.findLastIndex(i=>i.kind==="tool"),o=new Set(r.slice(0,n+1).flatMap(i=>i.kind==="tool"?[i.toolCallId]:[])),s=t.partsSig.value.filter(i=>i.kind!=="tool"||!o.has(i.toolCallId)),a=r.slice(n+1);return s.length<a.length?!1:a.every((i,c)=>vm(i,s[c]))}function vm(e,t){switch(e.kind){case"text":case"reasoning":return t?.kind===e.kind&&t.textSig.value.startsWith(e.textSig.value);case"step-start":return t?.kind==="step-start";case"tool":{if(t?.kind!=="tool"||t.toolCallId!==e.toolCallId||!ua(t.toolName,e.toolName)||Ln[t.stateSig.value]<Ln[e.stateSig.value])return!1;let r=e.approvalSig.value?.approved;return r===void 0||t.approvalSig.value?.approved===r}case"file":return t?.kind==="file"&&t.url===e.url&&t.mediaType===e.mediaType;case"source":return t?.kind==="source"&&t.sourceId===e.sourceId&&t.url===e.url&&t.title===e.title&&t.filename===e.filename&&t.mediaType===e.mediaType;default:return e}}function Jx(e,t,r){return Xx(e,r)||!Zx(e,t)?!0:r.type!=="finish"&&r.type!=="error"&&r.type!=="abort"?!1:ko(t)||e.awaitingContinuation===!0&&r.type!=="finish"?!0:e.awaitingContinuation===!0&&t.partsSig.value.every(n=>n.kind==="step-start")}function Xx(e,t){if(t.type!=="tool-output-available"&&t.type!=="tool-output-error"&&t.type!=="tool-output-denied")return!1;let r=e.partsSig.value.find(n=>n.kind==="tool"&&n.toolCallId===t.toolCallId);return r!==void 0&&Ln[r.stateSig.value]<4}function Zx(e,t){let r=t.partsSig.value;if(r.length===0)return!0;let n=e.partsSig.value;return n.some((o,s)=>r.every((a,i)=>eS(n[s+i],a)))}function eS(e,t){switch(t.kind){case"text":case"reasoning":return e?.kind===t.kind&&e.textSig.value.startsWith(t.textSig.value);case"step-start":return e?.kind==="step-start";case"tool":return e?.kind==="tool"&&e.toolCallId===t.toolCallId&&(t.toolName==="tool"||ua(e.toolName,t.toolName));case"file":return e?.kind==="file"&&e.url===t.url&&e.mediaType===t.mediaType;case"source":return e?.kind==="source"&&e.sourceId===t.sourceId&&e.url===t.url&&e.title===t.title&&e.filename===t.filename&&e.mediaType===t.mediaType;default:return t}}function tS(e,t){if(pn(e)||!sn(e))return!1;let r=new Set(e.partsSig.value.filter(o=>o.kind==="tool").map(o=>o.toolCallId));return!t.partsSig.value.some(o=>o.kind==="tool"&&r.has(o.toolCallId))}function zr(e,t,r={}){let n=e.partsSig.value.find(s=>s.kind==="tool"&&s.toolCallId===t);if(n)return r.dynamic&&(n.dynamic=!0),n.toolMetadata??(n.toolMetadata=r.toolMetadata),n.title=r.title??n.title,n;let o={kind:"tool",toolCallId:t,toolName:r.toolName??"tool",title:r.title,dynamic:r.dynamic?!0:void 0,toolMetadata:r.toolMetadata,inputPartialSig:oe(""),inputSig:oe(void 0),outputSig:oe(void 0),errorSig:oe(void 0),stateSig:oe("input-streaming"),approvalSig:oe(void 0)};return Go(e,o),o}function Go(e,t){e.partsSig.value=[...e.partsSig.value,t]}function gm(e,t){e.partsSig.value.some(r=>r.kind==="source"&&r.sourceId===t.sourceId)||Go(e,t)}function rS(e,t){switch(t.type){case"tool-input-start":zr(e,t.toolCallId,t);return;case"tool-input-delta":{let r=zr(e,t.toolCallId);r.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let r=zr(e,t.toolCallId,t);r.inputSig.value=t.input,r.stateSig.value="input-available";return}case"tool-input-error":{let r=zr(e,t.toolCallId,t);r.inputSig.value=t.input,r.errorSig.value=t.errorText,r.stateSig.value="output-error";return}case"tool-approval-request":{let r=zr(e,t.toolCallId,t);if(t.isAutomatic){r.approvalSig.value={id:t.approvalId,isAutomatic:!0};return}r.approvalSig.value={id:t.approvalId},r.stateSig.value="approval-requested";return}case"tool-approval-response":{let r=e.partsSig.value.find(n=>n.kind==="tool"&&n.approvalSig.value?.id===t.approvalId);r?.approvalSig.value&&(r.approvalSig.value={...r.approvalSig.value,approved:t.approved,reason:t.reason});return}case"tool-output-available":{let r=zr(e,t.toolCallId,t);r.outputSig.value=t.output,r.stateSig.value="output-available";return}case"tool-output-error":{let r=zr(e,t.toolCallId,t);r.errorSig.value=t.errorText,r.stateSig.value="output-error";return}case"tool-output-denied":{let r=zr(e,t.toolCallId);r.stateSig.value="output-denied";return}default:return}}async function hm(e){let t=1e3,r=!1,n=!1,o=!1;function s(){o||e.signal.aborted||(o=!0,e.onInitialBoundaryReady())}for(;!e.signal.aborted;){let a,i="held";try{i=await e.connect(()=>{if(e.signal.aborted)return;a=e.now();let c=r||n;r=!0,n=!1,o?c&&e.backfill():s()})}catch{}if(e.signal.aborted||(!r&&a===void 0&&(n=!0,s()),i==="unavailable"))return;e.onDropped?.(),a!==void 0&&e.now()-a>=1e3&&(t=1e3),await e.sleep(t),t=Math.min(t*2,15e3)}}var nS=120;function ym(e){let{activated:t,conversationReady:r,paused:n,conversationIdSig:o,messagesSig:s,optionsRef:a,transport:i,visitorId:c,adoptControlStateChunk:u,adoptMemoryCompactionStateChunk:p,settleSuggestions:_,recordConversationReply:d,transcriptRecoverySig:f,beginConversationTranscript:v,commitConversationTranscript:g,runCancellation:x,feedback:k,bus:y,loadInitialThread:S,shouldReconcileOnConnect:b,reconnectingSig:w}=e,h=B(0);F(()=>{if(!t||!r||n||!o.value)return;let m=o.value,P=new AbortController,R=L=>{},I=new Ka(s,L=>R(L));i.primeIdentity(c,m);let A=!1,C=!1,M,N=!1,H,G=0,z,ce,pe=Date.now(),_e,ae=!1,ve=!1,Xe=!1,bt;function He(L,Y){if(!ar(L))return;let K=s.value.findLast(be=>!be.ephemeral),te=L.serverMessageId??L.id;if(!(K&&(K.serverMessageId??K.id)!==te)){if(_e&&ae&&!s.value.some(be=>be.role==="user"&&!be.ephemeral)){bt={replyId:te,activityAt:Y};return}return la(s.value,L,m,a.current.strings.newConversation,Y)}}function Tt(L,Y,K){let te=He(L,K);if(!te)return;let de=`${L.serverMessageId??L.id}:${Y}:${te.preview??""}`;de!==ce&&(ce=de,i.publishConversation({...te,hasUnread:!0},!0))}let Oe;function Ge(){Oe&&(clearTimeout(Oe.timer),Oe=void 0)}function Bt(){let L=Oe;if(!L)return;clearTimeout(L.timer),Oe=void 0;let Y=s.value.find(K=>(K.serverMessageId??K.id)===L.replyId);Y?.role!=="assistant"&&Y?.role!=="operator"||Tt(Y,L.generation,L.activityAt)}function It(L,Y,K){Ge(),Oe={replyId:L.serverMessageId??L.id,generation:Y,activityAt:K,timer:setTimeout(Bt,nS)}}function Ke(L,Y,K=Date.now(),te=!0){Ge();let be=He(L,K);if(!be)return;let Pe=`${L.serverMessageId??L.id}:${Y}`;Pe!==z&&(z=Pe,d(be),te&&_e&&!ae&&(ve=!0))}function se(L,Y){(L||!x.localSendRef.current)&&x.settle(Y)}function Se(L,Y=[],K=!1,te,be=G,de=Date.now(),Pe=!0){let st=a.current;if(L.canceled){Ke(L,be,de,Pe),se(K,te);return}let Be=!0,pt=L.status==="error";switch(Cp(L,pt)){case"drop":s.value=s.value.filter(je=>je!==L),Be=!1;break;case"complete-operator-routed":L.status="complete",K&&(k.play("messageReceived"),$n(y,st,"assistant",Ye(L)));break;case"error":{if(L.status="error",K){k.play("error");let je=new Error(pt?"stream error chunk":"empty reply");y.emit("error",je),st.onError?.(je)}break}case"complete":L.status="complete",K&&(k.play("messageReceived"),$n(y,st,"assistant",Ye(L))),_(L,Y);break}Be&&Ke(L,be,de,Pe),se(K,te)}function ye(L){if(P.signal.aborted||o.value!==m)return;if(u(L),p?.(L),L.type==="start"){let _t=function(xt){return xt.role==="assistant"&&xt.retryAction?.kind==="resend-user"&&xt.retryAction.messageId===Qt};var je=_t;Bt();let Mt=L.messageId===void 0?void 0:s.value.find(xt=>xt.serverMessageId===L.messageId||xt.id===L.messageId);N=Mt!==void 0&&Mt.status!=="streaming";let Vt=H?.senderRole==="visitor"?H.messageId:void 0;H={messageId:L.messageId,senderRole:L.messageMetadata?.senderRole},G+=1,pe=Date.now(),ce=void 0,A=L.messageMetadata?.senderRole===void 0,C=!1,M=A?L.messageMetadata?.runId:void 0;let Qt=A?L.messageMetadata?.senderMessageId:void 0;if(Qt&&s.value.some(_t)&&(s.value=s.value.filter(xt=>!_t(xt))),A){let xt=L.messageId!==void 0&&s.value.some(Fr=>Fr.serverMessageId===L.messageId||Fr.id===L.messageId),Xt=s.value.at(-1),_n=L.messageId!==void 0&&(Xt?.serverMessageId===L.messageId||Xt?.id===L.messageId),fn=x.localSendRef.current&&(!xt||_n)&&Xt?.role==="assistant"&&Xt.status==="streaming"&&(_n||Xt.serverMessageId===void 0&&Xt.partsSig.value.length===0);C=x.captureStart(m,L,fn,Vt)}}let Y=A&&(L.type==="finish"||L.type==="error"||L.type==="abort"),K=Y?M:void 0,te=Y&&(C||x.ownsLocalRun(K)),be=G,de=N;Y&&(A=!1,C=!1,M=void 0);let Pe=I.applyResume(L),st=H?.messageId,Be=st===void 0?void 0:s.value.find(Mt=>Mt.serverMessageId===st||Mt.id===st);N&&H?.senderRole!=="visitor"&&(Pe!==null||Be?.status==="streaming")&&(N=!1,de=!1);let pt=!N&&(Be?.role==="assistant"||Be?.role==="operator");if(L.type==="text-delta"&&pt&&It(Be,G,pe),L.type==="text-end"&&(Ge(),pt&&Tt(Be,G,pe)),!Pe){Y&&(te||!x.localSendRef.current)&&x.settle(K);return}if(Pe.role==="operator"){de||(k.play("messageReceived"),$n(y,a.current,"operator",Ye(Pe))),Ke(Pe,be,pe),N=!1,Y&&(te||!x.localSendRef.current)&&x.settle(K);return}Pe.role==="assistant"&&(Se(Pe,[],te,K,be,pe),N=!1)}async function we(L){let Y=G,K=await i.loadConversation(m,L?{ids:[L]}:void 0).catch(()=>null);if(P.signal.aborted||o.value!==m||!K)return!1;K.controlState&&u({type:"data-control-state",data:K.controlState});let te=s.value.at(-1),be=Y===G&&(L===void 0||te!==void 0&&(te.serverMessageId===L||te.id===L));if(K.messages.length===0)return!0;let de=s.value,Pe=L===void 0?de.at(-1):de.find(_t=>_t.serverMessageId===L||_t.id===L),st=Co(de,Or(K.messages)),Be=Sp(K.messages),pt=st.messages.filter(_t=>!(_t.role==="assistant"&&_t.retryAction?.kind==="resend-user"&&Be.has(_t.retryAction.messageId)));if(!st.changed&&pt.length===st.messages.length)return!0;s.value=pt;let je=L===void 0?pt.at(-1):pt.find(_t=>_t.serverMessageId===L||_t.id===L),Mt=Pe!==void 0&&je!==void 0&&(Pe.id===je.id||Pe.serverMessageId!==void 0&&Pe.serverMessageId===je.serverMessageId),Vt=je!==void 0&&je.status!=="streaming"&&(!Mt||Pe?.status==="streaming"),Qt=Mt&&Pe?.status==="streaming"?Date.now():je?.createdAt;return be&&Vt&&je.role==="assistant"?Se(je,je.suggestions??[],x.localSendRef.current,void 0,Y,Qt,!1):be&&Vt&&je.role==="operator"?Ke(je,Y,Qt,!1):be&&je?.role==="assistant"&&je.status!=="streaming"&&_(je,je.suggestions??[]),!0}let Ee=new Set;R=({messageId:L})=>{if(Ee.has(L)||!s.value.some(K=>K.serverMessageId===L||K.id===L))return;Ee.add(L);function Y(){return Ee.delete(L)}we(L).then(Y,Y)};function Kt(){let L=bt;bt=void 0;let Y=L&&s.value.find(te=>(te.serverMessageId??te.id)===L.replyId),K=Y&&He(Y,L.activityAt);K&&d(K)}function Pt(L=!1){if(P.signal.aborted||o.value!==m){ve=!1;return}if(_e){ve=!0;return}let Y=L?S(m):void 0,K=Y??(!L||b()?we():void 0);if(!K)return;v(m),_e=K,ae=Y!==void 0;function te(be=!1){if(_e===K){if(_e=void 0,I.replayTurn(),ve){ve=!1,Pt();return}Kt(),be&&g(m)}}K.then(te,()=>te(!1))}let $=f.subscribe(L=>{L<=h.current||(h.current=L,Xe&&Pt())});return hm({signal:P.signal,now:()=>performance.now(),sleep:L=>ln(L,P.signal),connect:L=>i.connectResumeStream({signal:P.signal,onChunk:ye,onConnected:()=>{w.value=!1,L()}}),onDropped:()=>{w.value=!0},onInitialBoundaryReady:()=>{Xe=!0,Pt(!0)},backfill:()=>Pt()}),()=>{P.abort(),w.value=!1,Ge(),$(),I.detach()}},[t,r,n,o,o.value,c,i,u,p,_,d,f,v,g,x,s,y,k,S,b,w])}var oS=32;function bm(e){let{transport:t,setStreaming:r}=e,n=B(void 0),o=B(void 0),s=B(!1),a=B(void 0),i=B(!1),c=B(new Map),u=B(new Set),p=j((w,h)=>{let m=`${w}:${h}`;a.current!==m&&(a.current=m,t.cancelTurn(w,h))},[t]),_=j(w=>{n.current=void 0,o.current=w,s.current=!1,a.current=void 0,i.current=!0,r(!0)},[r]),d=j((w,h)=>{c.current.set(w,{messageId:h})},[]),f=j(w=>{if(w!==void 0){u.current.add(w);let h=u.current.values().next().value;u.current.size>oS&&h!==void 0&&u.current.delete(h)}w!==void 0&&n.current?.runId!==w||(n.current=void 0,o.current=void 0,s.current=!1,i.current=!1,r(!1))},[r]),v=j((w,h)=>o.current!==w?h.runId&&n.current?.runId===h.runId?(n.current={conversationId:h.conversationId,runId:h.runId},s.current&&p(h.conversationId,h.runId),!0):!1:(o.current=void 0,h.runId?(n.current={conversationId:h.conversationId,runId:h.runId},r(!0),s.current&&p(h.conversationId,h.runId),!0):(f(),!0)),[p,r,f]),g=j((w,h)=>{let m=c.current.get(w);return m?(c.current.delete(w),!h.runId||u.current.has(h.runId)?!0:m.runId!==void 0?(m.runId!==h.runId||n.current?.runId===h.runId&&(n.current={conversationId:h.conversationId,runId:h.runId},s.current&&p(h.conversationId,h.runId)),!0):(i.current||o.current||(n.current={conversationId:h.conversationId,runId:h.runId},o.current=void 0,s.current=!1,a.current=void 0,i.current=!0,r(!0)),!0)):!1},[p,r]),x=j(w=>o.current!==w?!1:(f(),!0),[f]),k=j(w=>{let h=c.current.get(w);return h?(c.current.delete(w),h.runId===void 0):!1},[]),y=j((w,h,m,P)=>{let R=h.messageMetadata?.runId;if(h.messageMetadata?.senderRole!==void 0||typeof R!="string"||!R||u.current.has(R))return!1;if(n.current?.runId===R)return i.current;if(i.current)return n.current||!m?!1:(o.current=void 0,n.current={conversationId:w,runId:R},r(!0),s.current&&p(w,R),!0);let A=[...c.current.values()].filter(C=>C.runId===void 0).find(C=>C.messageId===P);return A?(A.runId=R,n.current={conversationId:w,runId:R},o.current=void 0,s.current=!1,a.current=void 0,i.current=!0,r(!0),!0):(o.current=void 0,n.current={conversationId:w,runId:R},r(!0),s.current&&p(w,R),i.current)},[p,r]),S=j(w=>typeof w=="string"&&n.current?.runId===w&&i.current,[]),b=j(()=>{let w=n.current;if(w)return s.current=!0,p(w.conversationId,w.runId),!0;let h=o.current;return h?(s.current=!0,h.then(m=>{m.runId&&p(m.conversationId,m.runId)}).catch(()=>{}),!0):!1},[p]);return Ce(()=>({localSendRef:i,begin:_,beginRouted:d,acceptAck:v,acceptRoutedAck:g,reject:x,rejectRouted:k,captureStart:y,ownsLocalRun:S,settle:f,stop:b}),[v,g,_,d,y,S,x,k,f,b])}var iS=ie.scope("send");function Sm(e,t,r,n,o){e.publishConversation({...la(t,r,n,o),hasUnread:!1},!0)}function wm(e,t){return e.id===t.id||(e.serverMessageId??e.id)===(t.serverMessageId??t.id)}function km(e){return e.findLast(t=>!t.ephemeral&&t.role!=="system"&&(t.role==="user"||t.status!=="streaming"||ar(t)))}function Ko(e,t,r,n,o){let s=km(t);s?.role!=="user"||!wm(s,r)||Sm(e,t,s,n,o)}function Pm(e){return e instanceof qe&&e.status===404&&e.errorCode==="CONVERSATION_NOT_FOUND"}function xm(e){return!(e instanceof qe)||e.code==="network"||e.status===void 0||e.status===202?!0:e.status===408||e.status===425||e.status===429||e.status>=500&&e.status<600}function Cm(e){let{transport:t,messagesSig:r,conversationIdSig:n,options:o,bus:s,feedback:a,persistence:i,visitorId:c,adoptConversationId:u,applyControlState:p,setTicket:_,settleSuggestions:d,runCancellation:f,onConversationNotFound:v}=e,g=j(()=>{let y=n.value??Wt();return n.value||(n.value=y,i.saveConversationId(y)),y},[n,i]),x=j(async({continueExisting:y,turn:S,movedFromConversation:b=!1})=>{let w=g(),h=r.value.at(-1),m=S?[S]:yp(r.value,y),P=m[0];P?.role==="user"&&qt.markSent(P.id);let R=m.map(kl),I=i.loadUserPrefs(),A=Fo(o.tools).then(C=>t.sendTurn(bl({messages:R,conversationId:w,visitorId:c,userPrefs:I,clientTools:Yl(C)}),{keepalive:y}));f.begin(A);try{let C=await A;if(n.value!==w||!f.acceptAck(A,C))return!1;if(u(C.conversationId),_({conversationId:C.conversationId,reference:C.ticketReference}),C.runId&&P?.role==="user"&&Ko(t,r.value,P,C.conversationId,o.strings.newConversation),!C.runId){let M=await t.loadConversation(C.conversationId).catch(()=>null);if(n.value!==C.conversationId)return!0;if(M){M.controlState&&p(M.controlState);let N=Or(M.messages),{messages:H,changed:G}=Co(r.value,N);G&&(r.value=H);let z=N.findLast(_e=>!_e.ephemeral&&_e.role!=="system"),ce=km(r.value);ce&&z&&wm(ce,z)&&Sm(t,r.value,ce,C.conversationId,o.strings.newConversation);let pe=h?r.value.find(_e=>_e.id===h.id&&_e.role==="assistant"&&_e.status!=="streaming"):void 0;pe&&d(pe,pe.suggestions??[]),!y&&h?.role==="assistant"&&r.value.includes(h)&&h.serverMessageId===void 0&&!ar(h)&&(r.value=r.value.filter(_e=>_e!==h))}else h?.role==="assistant"&&r.value.includes(h)&&(h.status="error",h.errorText=o.strings.errorGeneric,y?h.retryAction={kind:"continue-assistant",messageId:h.serverMessageId??h.id}:h.retryAction=P?.role==="user"?{kind:"resend-user",messageId:P.id}:null,r.value=[...r.value])}return!0}catch(C){if(n.value!==w)return!1;if(!f.reject(A))return P?.role==="user"&&Ko(t,r.value,P,w,o.strings.newConversation),!0;if(!y&&!b&&P?.role==="user"&&Pm(C))return v(P);if(!y&&P?.role==="user"&&C instanceof qe&&C.status===401){let G=h?.role==="assistant"&&h.serverMessageId===void 0?h:void 0;return r.value=r.value.filter(z=>z!==P&&z!==G),i.saveDraft(w,Ye(P)),!1}let M=Sr(C,o.strings),N=xm(C),H=S?.role==="assistant"?S:r.value.at(-1);if(y&&H?.role==="assistant"&&C instanceof qe&&C.status===409){let G=H.serverMessageId??H.id,z=await t.loadConversation(w,{ids:[G]}).catch(()=>null);if(n.value!==w)return!1;if(z){z.controlState&&p(z.controlState);let ce=Or(z.messages),pe=ce.find(_e=>(_e.serverMessageId??_e.id)===G);if(pe&&wp(H,pe)){let{messages:_e,changed:ae}=Co(r.value,ce),ve=_e.find(Xe=>(Xe.serverMessageId??Xe.id)===G);if(ae&&ve&&ve!==H)return ve.awaitingContinuation=!1,ve.continuationStreaming=void 0,ve.retryAction=null,r.value=_e,ve.status!=="streaming"&&d(ve,ve.suggestions??[]),!0}}if(!r.value.includes(H)||H.status!=="streaming")return!1;H.continuationStreaming=!0}if(y&&H?.role==="assistant")H.status="error",H.errorText=M,H.retryAction=N?{kind:"continue-assistant",messageId:H.serverMessageId??H.id}:null,r.value=[...r.value];else if(h?.role==="assistant"&&r.value.includes(h)){h.status="error",h.errorText=M;let G=m[0];h.retryAction=N&&G?.role==="user"?{kind:"resend-user",messageId:G.id}:null,r.value=[...r.value]}else{let G=cr();G.status="error",G.errorText=M;let z=m[0];G.retryAction=N&&z?.role==="user"?{kind:"resend-user",messageId:z.id}:null,r.value=[...r.value,G]}return a.play("error"),s.emit("error",C),o.onError?.(C),!1}},[t,r,o,s,a,i,c,u,p,_,d,g,f,v]),k=j(async y=>{let S=g();y.status="pending",y.errorText=void 0,y.retryAction=void 0,r.value.includes(y)&&(r.value=[...r.value]),qt.markSent(y.id);let b=[kl(y)],w=i.loadUserPrefs(),h=Fo(o.tools).then(m=>t.sendTurn(bl({messages:b,conversationId:S,visitorId:c,userPrefs:w,clientTools:Yl(m)})));f.beginRouted(h,y.id);try{let m=await h;return n.value!==S?(f.rejectRouted(h),!1):f.acceptRoutedAck(h,m)?(u(m.conversationId),_({conversationId:m.conversationId,reference:m.ticketReference}),Ko(t,r.value,y,m.conversationId,o.strings.newConversation),y.status==="pending"&&(y.status="complete",r.value.includes(y)&&(r.value=[...r.value])),!0):!1}catch(m){let P=f.rejectRouted(h);if(n.value!==S)return!1;if(!P)return Ko(t,r.value,y,S,o.strings.newConversation),y.status==="pending"&&(y.status="complete",r.value.includes(y)&&(r.value=[...r.value])),!0;if(y.status!=="pending")return Ko(t,r.value,y,S,o.strings.newConversation),!0;if(Pm(m))return v(y);iS.debug("operator-routed send failed",{error:m});let R=m instanceof Error?m:new Error(String(m));return y.status="error",y.errorText=Sr(m,o.strings),y.retryAction=xm(m)?{kind:"resend-user",messageId:y.id}:null,r.value.includes(y)&&(r.value=[...r.value]),a.play("error"),s.emit("error",R),o.onError?.(R),!1}},[t,r,o,s,a,i,c,u,_,g,f,v]);return{sendAiTurn:x,sendRoutedTurn:k}}var aS=ie.scope("unread");function Tm(e){let{transport:t,options:r,conversationIdSig:n,isConversationVisibleRef:o,activated:s,conversationReady:a}=e,i=Lt(!1),c=Lt(0),u=Lt(0),p=B([]),_=B(void 0),d=B(!1),f=B(!1),v=j(()=>{let m=n.value,P=o.current()&&_.current===m?m:void 0,R=p.current.filter(I=>I.hasUnread&&I.conversationId!==P).length;c.value=R,i.value=R>0},[n,i,c,o]),g=j(m=>{let P=n.value,R=p.current.find(M=>M.conversationId===P),I=Pr(p.current,m),A=I.find(M=>M.conversationId===P),C=m.type==="snapshot"&&P!==void 0&&A?.hasUnread===!0&&_.current===P&&R!==void 0&&R.lastMessageAt!==A.lastMessageAt;C&&(_.current=void 0),p.current=I,v(),C&&(u.value+=1)},[n,v,u]),x=j(()=>{if(v(),!o.current())return;let m=n.value;if(!m||_.current!==m)return;let P=p.current.find(R=>R.conversationId===m);P?.hasUnread&&t.markRead(m,P.lastMessageAt)},[n,o,v,t]),k=j(m=>{n.value===m&&(_.current=void 0,v())},[n,v]),y=j(m=>{n.value===m&&(_.current=m,x())},[n,x]),S=j(m=>_.current===m,[]),b=j((m=!1)=>{if(!r.history.enabled||!r.modules.list.some(R=>R.layout==="chat"))return;function P(R){if(d.current){R&&(f.current=!0);return}d.current=!0,t.listConversations({limit:50},R).then(I=>{R||g({type:"snapshot",result:I,requestedRevision:0}),x()}).catch(I=>aS.debug("refreshUnread failed (non-fatal)",{err:I})).finally(()=>{d.current=!1,f.current&&(f.current=!1,P(!0))})}P(m)},[g,x,r.history.enabled,r.modules,t]),w=j(m=>{let P=m.conversationId,R=o.current()&&n.value===P&&_.current===P,I=p.current.find(C=>C.conversationId===P),A=R&&(I?.lastMessageAt!==m.lastMessageAt||I.hasUnread);t.publishConversation({...m,hasUnread:!R},!0),A&&t.markRead(P,m.lastMessageAt)},[n,o,t]);F(()=>t.subscribeConversationChanges(g),[g,t]);let h=B(!1);return F(()=>{!s||!a||h.current||(h.current=!0,b())},[s,a,b]),F(()=>{if(!s)return;function m(){document.visibilityState==="visible"&&(x(),b(!0))}return document.addEventListener("visibilitychange",m),()=>document.removeEventListener("visibilitychange",m)},[s,x,b]),{hasUnreadSig:i,unreadCountSig:c,transcriptRecoverySig:u,markVisibleConversationRead:x,beginConversationTranscript:k,commitConversationTranscript:y,isConversationTranscriptCommitted:S,recordConversationReply:w,refreshUnread:b}}var Qo=ie.scope("settings");function Im(e){let{options:t,persistence:r,transport:n,feedback:o,hostElement:s,bus:a}=e,i=r.loadUserPrefs(),[c,u]=U(()=>i.locale??t.locale),[p,_]=U(i.themeMode),d=to(t.themeMode,p),[f,v]=U(()=>i.textSize??t.textSize),g=j(w=>{r.patchUserPrefs(w),n.saveUserPrefs(r.loadUserPrefs()).catch(h=>Qo.warn("saveUserPrefs failed",{err:h}))},[r,n]);F(()=>{i.soundMuted!==void 0&&o.setMuted(i.soundMuted)},[]),F(()=>{if(d!=="host"){s.dataset.theme=d;return}return $d(w=>{s.dataset.theme=w})},[s,d,t]),F(()=>{s.dataset.textSize=f},[s,f,t]),F(()=>{let w=!0;return o.mutedSig.subscribe(h=>{if(w){w=!1;return}g({soundMuted:h})})},[o,g]);let x=kn(c,t.availableLocales,t.defaultLocale);F(()=>{n.setLocale(x)},[n,x]),F(()=>{s.dir=gi(x)?"rtl":"ltr"},[s,x]),F(()=>{x!==c&&u(x)},[x,c]);let k=j(w=>{Qo.info("localeChange",{locale:w}),u(w),g({locale:w}),a.emit("localeChange",w)},[g,a]),y=j(w=>{Qo.info("themeChange",{mode:w}),_(w),s.dataset.theme=w,g({themeMode:w}),a.emit("themeChange",w)},[s,g,a]),S=j(w=>{Qo.info("textSizeChange",{size:w}),v(w),s.dataset.textSize=w,g({textSize:w}),a.emit("textSizeChange",w)},[s,g,a]),b=j(()=>{o.toggleMuted();let w=o.mutedSig.value;Qo.info("soundToggle",{muted:w}),a.emit("soundToggle",{muted:w})},[o,a]);return{activeLocale:c,activeThemeMode:d,activeTextSize:f,setActiveLocale:u,setActiveThemeMode:_,setActiveTextSize:v,patchAndSync:g,handleLocaleChange:k,handleThemeChange:y,handleTextSizeChange:S,handleSoundToggle:b}}var Re=ie.scope("app"),Yo=q.cssPrefix,sS={home:"home",chats:"chat",help:"help",news:"news"};function Am({options:e,hostElement:t,bus:r,recentHostEvents:n,loginRevision:o=0,onPersonChanged:s,onStartAsGuest:a}){let i=e.aiAgentDeploymentId;if(!i)throw new Error("aiAgentDeploymentId is required");let[c]=U(()=>Cn(e.widgetId,e.storage,e.aiAgentDeploymentId)),[u,p]=U(()=>c.getVisitorId()),_=c.loadUserPrefs(),d=Lt(c.loadConversationId()),f=B(d.value!==void 0),v=Lt(d.value??""),g=Lt([]),x=Lt(!1),[k,y]=U(!1),S=B(void 0);function b(){let T=e.modules.list,O=new Set(T.map(re=>re.id)),X=c.loadActiveModule();return X&&O.has(X)?X:T[0]?.id??""}function w(){return e.modules.list.find(T=>T.layout==="chat")?.id}function h(){let T=w();return T?e.modules.list.length===1?!0:P.sig.value.activeTab===T:!1}let m=B(void 0);if(!m.current){let T=e.modules.list.map(X=>X.id),O=c.loadActiveModule()??T[0]??"";m.current=Hp(O,O?[...T,O]:T,X=>c.saveActiveModule(X))}let P=m.current,R=Rt(()=>P.sig.value.activeTab).value,I=Rt(()=>d.value).value,[A,C]=U(!1),[M,N]=U(!1),H=e.mode==="standalone"||e.mode==="inline",G=B(Ao(e,Dn(),c.loadPanelOpen(),c.loadPanelSize())),[z,ce]=U(G.current.panelOpen),[pe,_e]=U(G.current.panelOpen),ae=B(void 0),ve=B(void 0),Xe=B(!1),bt=B(void 0),He=B(e.strings),Tt=B(void 0);F(()=>{z&&_e(!0)},[z]);let Oe=B(!1),[Ge,Bt]=U(!1),It=B(null),Ke=B(!1),{dismissed:se,dismissCallout:Se}=cm({callout:e.launcher.callout,persistence:c}),ye=e.launcher.callout?.persistent??!0,we=j(()=>{Re.info("calloutDismiss"),r.emit("calloutDismiss",void 0),Se()},[r,Se]),[Ee,Kt]=U(G.current.panelSize),Pt=B(!1),[$,L]=U("chat"),Y=B(()=>!1);Y.current=()=>z&&$==="chat"&&!document.hidden&&h();let[K,te]=U(!1),be=B(K);be.current=K;let de=B(null),[Pe,st]=U(!1),Be=Lt(new Map),pt=j((T,O)=>{let X=new Map(Be.value);O?X.set(T,O):X.delete(T),Be.value=X},[Be]),[je,Mt]=U(null),[Vt,Qt]=U(),[_t,xt]=U([]),Xt=B(e);Xt.current=e;let[_n,fn]=U(void 0),[Fr,mn]=U(void 0),[Hr,Jo]=U(()=>c.loadSidebarCollapsed()??!1),[jr,gn]=U({status:"anonymous"}),[Ya,Xo]=U({}),[V,J]=U(),[Q]=U(()=>new _a({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:su({publicKey:e.publicKey,aiAgentDeploymentId:i,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints,recentHostEvents:n,onLoginState:gn,continueLink:e.continueLink})),[fe]=U(()=>new qi(e.sound,e.haptics)),$e=bm({transport:Q,setStreaming:te}),{activeLocale:At,activeThemeMode:pr,activeTextSize:_r,setActiveLocale:zt,setActiveThemeMode:Ja,setActiveTextSize:Lm,patchAndSync:lc,handleLocaleChange:Nm,handleThemeChange:Om,handleTextSizeChange:$m,handleSoundToggle:Dm}=Im({options:e,persistence:c,transport:Q,feedback:fe,hostElement:t,bus:r}),{controlModeSig:lr,assignedOperatorSig:qm,operatorAvailableSig:Um,applyControlState:Kn,adoptControlStateChunk:Bm,requestOperator:zm,cancelOperatorRequest:Fm}=um({transport:Q,conversationIdSig:d}),kr=Lt(new Map),Hm=j(T=>{if(T.type!=="data-memory-compaction-state")return;let O=d.value;if(!O)return;let X=vp(T.data);if(!X)return;let re=kr.value.get(O);if(re&&(X.postFinishSequence<re.postFinishSequence||X.postFinishSequence===re.postFinishSequence&&(re.status==="ready"||re.status===X.status)))return;let me=new Map(kr.value);me.set(O,X),kr.value=me},[d,kr]),{hasUnreadSig:jm,unreadCountSig:cc,transcriptRecoverySig:Vm,markVisibleConversationRead:dc,beginConversationTranscript:Xa,commitConversationTranscript:vn,isConversationTranscriptCommitted:uc,recordConversationReply:Wm,refreshUnread:Gm}=Tm({transport:Q,options:e,conversationIdSig:d,isConversationVisibleRef:Y,activated:pe,conversationReady:A}),Za=dm({state:jr,deployment:Ya,bus:r,persistence:c,conversationIdSig:d}),Km=z&&e.modules.byId[R]?.layout==="home",Qm=lm({transport:Q,options:e,persistence:c,enabled:A&&Km});F(()=>{dc()},[R,z,$,I,dc]),F(()=>{fe.update(e.sound,e.haptics)},[fe,e.sound,e.haptics]),F(()=>()=>fe.destroy(),[fe]),F(()=>{Pt.current||!e.size.initialSize||(Pt.current=!0,!c.loadPanelSize()&&Kt(Nl(e.mode,e.size,Dn())))},[e.mode,e.size,c]),F(()=>{if(!A||Oe.current)return;Oe.current=!0;let T=Ao(e,Dn(),c.loadPanelOpen(),c.loadPanelSize());ce(T.panelOpen),Kt(T.panelSize)},[A,e,c]);let hn=B(null);F(()=>{A&&P.reconcile(e.modules.list.map(T=>T.id),b())},[A,e.modules.list,P]);let Zo=j(T=>{!T||T.length===0||(g.value=T.map(O=>Sl({...O,text:mt(He.current,O.text)})))},[g]),Qn=B(0),fr=B(0),es=j(T=>{if(T===d.value)return;let O=d.value;fr.current++,y(!1),O&&(c.saveDraft(T,c.loadDraft(O)),c.saveDraft(O,""),c.saveMessageQueue(T,c.loadMessageQueue(O)),c.saveMessageQueue(O,[])),d.value=T,c.saveConversationId(T),Q.primeIdentity(void 0,T),Re.info("conversation rebound",{previous:O,current:T}),O&&r.emit("conversationRebound",{previous:O,current:T})},[r,d,c,Q]),ei=j(T=>{let O=T.map(me=>me.createdAt).filter(me=>me!==void 0),X=(O.length?Math.min(...O):Date.now())-1;return[...(bt.current?.messages??[]).map(me=>{let Z=Sl({...me,text:mt(He.current,me.text)});return Z.createdAt=X,Z}),...T]},[]),pc=j(async T=>{let O=fr.current;function X(){return O!==fr.current||d.value!==T}ve.current===T&&(ve.current=void 0),y(!0);try{let re=await Q.loadConversation(T);if(X())return!1;let me=Or(re.messages),Z=ei(Rl(me,g.value));if(g.value=Z,ve.current=Z.some(Ae=>Ae.role==="user")?void 0:T,me.length>0||re.controlState!==void 0){Qt({conversationId:T,reference:re.ticketReference}),re.controlState&&Kn(re.controlState);let Ae=me.findLast(Ue=>Ue.role==="assistant"&&!Ue.ephemeral);xt(Ae?.suggestions??[])}return!0}catch(re){return X()||(Re.warn("loadThread failed; keeping conversation active",{err:re,conversationId:T}),r.emit("error",re),Xt.current.onError?.(re)),!1}finally{X()||y(!1)}},[Q,g,d,ei,r]),Ym=j(T=>{if(ae.current===T)return ae.current=void 0,pc(T)},[pc]),Jm=j(()=>{if(S.current)return Promise.resolve(void 0);let T=d.value,O=g.value.find(le=>le.serverMessageId!==void 0),X=O?.serverMessageId,re=O?new Date(O.createdAt).toISOString():void 0;if(!T||!X||!re)return Promise.resolve(void 0);let me=fr.current,Z={};return S.current=Z,(async()=>{try{let le=await Q.loadConversation(T,{beforeId:X,beforeCreatedAt:re});if(S.current!==Z||fr.current!==me||d.value!==T)return;if(le.messages.length===0)return!1;let Ae=le.messages.map(wl),Ue=g.value,gr=Pp(Ue,Ae);if(gr!==Ue){let Ze=Math.min(...Ae.map(ze=>ze.createdAt??1/0));if(Number.isFinite(Ze))for(let ze of Ue){if(!ze.ephemeral)break;(ze.createdAt??1/0)>=Ze&&(ze.createdAt=Ze-1)}g.value=gr}return!0}catch(le){if(S.current!==Z||fr.current!==me||d.value!==T)return;Re.warn("load previous messages failed",{err:le,conversationId:T,beforeId:X}),r.emit("error",le),e.onError?.(le);return}finally{S.current===Z&&(S.current=void 0)}})()},[r,d,g,e,Q]),yn=j(async({newConversation:T})=>{let O=++Qn.current;function X(){return O!==Qn.current}if(!T){let Ze=await Q.userSub(),ze=c.loadLastUserSub();if(X())return;if(ze&&ze!==Ze){s?.();return}Ze&&c.saveLastUserSub(Ze)}let re=d.value,me=T||!re?Wt():re;me!==re&&(fr.current++,y(!1),er(()=>{d.value=me,v.value=me}),c.saveConversationId(me)),Q.primeIdentity(u,me);let Z;try{Z=await Q.handshake({visitorId:u,conversationId:me,userPrefs:c.loadUserPrefs(),locale:At})}catch(Ze){if(X())return;r.emit("error",Ze),e.onError?.(Ze);let ze=Ze instanceof qe&&Ze.errorCode?cS[Ze.errorCode]:void 0;if(ze){Re.warn(`the widget is not shown: ${ze}`),(H||e.mode==="page")&&N(!0);return}T||C(!0);return}if(X())return;e.continueLink&&Z.visitorId!==u&&p(Z.visitorId),Z.conversationId!==me&&es(Z.conversationId),Tt.current=Z;let le=Kr(Z,At);Mt(le.agent),Xo(Ui(Z.config?.login));let Ae=Z.config?.maxMessageCharacters;J(typeof Ae=="number"&&Ae>0?Ae:void 0),le.site&&Ks(le.site)?fn(le.site):le.site&&Re.warn("invalid site config, using fallback",{site:le.site}),le.blocks&&Qs(le.blocks)?mn(le.blocks):le.blocks&&Re.warn("invalid blocks config, using fallback",{blocks:le.blocks});let Ue=$s(Z.userPrefs);if(Object.keys(Ue).length>0&&!T&&(c.saveUserPrefs(Ue),Ue.locale&&zt(Ue.locale),Ue.soundMuted!==void 0&&fe.setMuted(Ue.soundMuted),Ue.themeMode&&Ja(Ue.themeMode),Ue.textSize&&Lm(Ue.textSize)),bt.current=le.welcome,T||r.emit("handshake",Z),le.welcome?.suggestions){let Ze=He.current;xt(le.welcome.suggestions.map(ze=>({...ze,label:mt(Ze,ze.label),...ze.text===void 0?{}:{text:mt(Ze,ze.text)}})))}let gr=!T&&(Z.conversationId===re||e.continueLink!==void 0);f.current=gr,gr?Xe.current||(ae.current=Z.conversationId):(ve.current=Z.conversationId,Zo(le.welcome?.messages),vn(Z.conversationId)),T||C(!0)},[Q,u,c,e,r,d,v,fe,Zo,At,es,vn,s]),Yn=JSON.stringify(e.userContext??null),Xm=JSON.stringify(e.pageContext??null);F(()=>{Q.setContext(e.userContext,lS(e.pageContext))},[Q,Yn,Xm]);let _c=B(!1);F(()=>{if(Q.setUserToken(e.userToken),!_c.current){_c.current=!0;return}yn({newConversation:!1}).then(()=>{pe&&Gm(!0)})},[Q,e.userToken,o]);let fc=j((T,O=[])=>xt(T.suggestions??O),[]);F(()=>(Q.primeIdentity(u,d.value),yn({newConversation:!1}),()=>{Qn.current++,fr.current++}),[]),F(()=>{!pe||!A||Xe.current||(Xe.current=!0,ae.current===d.value&&y(!0))},[pe,A]);let mc=B(Yn);F(()=>{!A||mc.current===Yn||(mc.current=Yn,yn({newConversation:!1}))},[Yn,A,yn]);let gc=B(async()=>!1),{sendAiTurn:mr,sendRoutedTurn:bn}=Cm({onConversationNotFound:T=>gc.current(T),transport:Q,messagesSig:g,conversationIdSig:d,options:e,bus:r,feedback:fe,persistence:c,visitorId:u,adoptConversationId:es,applyControlState:Kn,setTicket:Qt,settleSuggestions:fc,runCancellation:$e}),{toolInteraction:Zm,pageToolsRunning:ts,stopPageTools:vc}=sm({streaming:K,controlModeSig:lr,messagesSig:g,sendAiTurn:mr,bus:r,humanInLoop:e.features.humanInLoop,tools:e.tools}),eg=j((T,O)=>{let X=g.value.find(re=>re.serverMessageId===T);X&&(X.feedback=O),Re.info("messageFeedback",{messageId:T,value:O}),r.emit("messageFeedback",{messageId:T,value:O}),Q.submitFeedback({messageId:T,value:O})},[r,g,Q]),tg=j(()=>f.current||g.value.some(T=>!T.ephemeral&&T.role==="user"),[g]);ym({activated:pe,conversationReady:A,paused:jr.status==="pending"||jr.status==="expired",conversationIdSig:d,messagesSig:g,optionsRef:Xt,transport:Q,visitorId:u,adoptControlStateChunk:Bm,adoptMemoryCompactionStateChunk:Hm,settleSuggestions:fc,recordConversationReply:Wm,transcriptRecoverySig:Vm,beginConversationTranscript:Xa,commitConversationTranscript:vn,runCancellation:$e,feedback:fe,bus:r,loadInitialThread:Ym,shouldReconcileOnConnect:tg,reconnectingSig:x});let Pn=j(async(T,O,X)=>{if(de.current||Za.gate)return!1;let re=d.value,me=re?kr.value.get(re):void 0,Z=lr.value!=="ai-agent";if(!Z&&me?.status==="compacting"||(Re.info("send",{textLen:T.length,attachments:O.length,streaming:be.current,routedToOperator:Z}),be.current&&!Z))return!1;let le=new AbortController,Ae={conversationId:re,controller:le};de.current=Ae,st(!0);try{fe.unlock(),Be.value=new Map;let Ue=await uS(Q,O,le.signal,pt,cs=>{le.signal.aborted||(Re.warn("upload failed",{err:cs}),r.emit("error",cs),e.onError?.(cs))});if(le.signal.aborted||d.value!==re)return!1;let gr=re?kr.value.get(re):void 0,Ze=lr.value!=="ai-agent";if(!Ze&&gr?.status==="compacting"||be.current&&!Ze||!X&&Ue.length<O.length||!T&&Ue.length===0)return!1;r.emit("send",{text:T,attachmentCount:O.length}),_t.length>0&&xt([]),fe.play("messageSent");let ze=xl(T,Ue,X);return $n(r,e,"user",T),Ze?(g.value=[...g.value,ze],X?await bn(ze):(bn(ze),!0)):(g.value=[...g.value,ze,cr()],X?await mr({continueExisting:!1}):(mr({continueExisting:!1}),!0))}finally{de.current===Ae&&(de.current=null,st(!1))}},[Q,r,e,_t.length,g,d,kr,mr,bn,lr,Be,pt,Za.gate]),rs=B(Pn);rs.current=Pn;let hc=d.value,yc=(hc?kr.value.get(hc):void 0)?.status==="compacting",ti=lr.value==="ai-agent",rg=Rt(()=>{let T=g.value.at(-1);return T?.role==="assistant"&&T.partsSig.value.some(O=>O.kind==="tool"&&(O.stateSig.value==="approval-requested"||O.stateSig.value==="approval-responded"))}),bc=Rt(()=>g.value.some(T=>T.retryAction?.kind==="resend-user"||T.retryAction?.kind==="continue-assistant"));St(()=>{let T=d.value;return()=>{let O=de.current;!O||O.conversationId!==T||(de.current=null,st(!1),O.controller.abort())}},[d.value]);let ng=j(()=>{if(de.current){Re.info("stop uploads"),de.current.controller.abort();return}if(ts){Re.info("stop page tools"),r.emit("stop",void 0),vc();return}if(!$e.stop())return;Re.info("stop"),r.emit("stop",void 0);let T=g.value.at(-1);T&&T.role!=="user"&&T.status==="streaming"&&(T.canceled=!0,g.value=[...g.value])},[$e,r,g,ts,vc]),og=j(T=>{Re.info("card action",{text:T}),rs.current(T,[])},[]),ig=j(T=>{if(K)return;let O=g.value,X=pa(O,T);if(X)switch(Re.info("retry",{kind:X.kind,messageId:X.messageId}),X.kind){case"continue-assistant":{if(lr.value!=="ai-agent"||T.role!=="assistant"||(T.serverMessageId??T.id)!==X.messageId)return;T.status="streaming",T.errorText=void 0,T.retryAction=void 0,T.awaitingContinuation=!0,g.value=[...O],mr({continueExisting:!0,turn:T});return}case"resend-user":{let re=O.find(le=>le.role==="user"&&le.id===X.messageId);if(!re)return;let me=le=>{le&&hn.current?.acceptQueuedMessage(X.messageId)};if(re.status="complete",re.errorText=void 0,re.retryAction=void 0,lr.value!=="ai-agent"){g.value=T.role==="assistant"?O.filter(le=>le!==T):[...O],bn(re).then(me);return}let Z=cr();g.value=T.role==="assistant"?O.map(le=>le===T?Z:le):[...O,Z],mr({continueExisting:!1,turn:re}).then(me);return}case"repeat-user":{let re=O.find(Ae=>Ae.role==="user"&&Ae.id===X.messageId);if(!re)return;let me=xl(Ye(re),re.attachments?.map(Ae=>({...Ae}))??[]),Z=new Set(me.attachments?.flatMap(Ae=>Ae.url?[Ae.url]:[])??[]),le=re.partsSig.value.flatMap(Ae=>Ae.kind==="file"&&!Z.has(Ae.url)?[{...Ae}]:[]);if(le.length>0&&(me.partsSig.value=[...me.partsSig.value,...le]),lr.value!=="ai-agent"){g.value=[...O,me],bn(me);return}g.value=[...O,me,cr()],mr({continueExisting:!1,turn:me});return}default:return X}},[K,g,lr,mr,bn]),ri=j(()=>{if(zp(e.mode,Ee)==="exit-fullscreen"){Re.info("close \u2192 exit-fullscreen",{mode:e.mode}),Kt("normal"),r.emit("fullscreen",!1);return}Re.info("close \u2192 panel closed",{mode:e.mode}),Ke.current=t.contains(t.ownerDocument.activeElement),ce(!1),c.savePanelOpen(!1),r.emit("close",void 0),e.onClose?.()},[r,e,c,Ee,t]);fm({hostElement:t,mode:e.mode,panelSize:Ee,isOpen:z,surfaceReady:A,onClose:ri}),F(()=>{z||!Ke.current||(Ke.current=!1,It.current?.focus())},[z]);let Jn=j(()=>{Re.info("open",{mode:e.mode}),fe.unlock(),Bt(!0),ce(!0),c.savePanelOpen(!0),!se&&!ye&&we(),setTimeout(()=>Bt(!1),dS),r.emit("open",void 0),e.onOpen?.()},[r,e,fe,c,se,ye,we]),ni=j(()=>{let T=g.value.some(O=>O.role==="user");if(ve.current===d.value&&!T&&d.value){Re.info("clear \u2192 reusing empty conversation",{conversationId:d.value}),g.value.length===0&&Zo(bt.current?.messages);return}return Re.info("clear \u2192 new conversation",{wasStreaming:K}),r.emit("clear",void 0),$e.settle(),f.current=!1,ae.current=void 0,ve.current=void 0,er(()=>{g.value=[],d.value=void 0,Kn({controlMode:"ai-agent",controlRevision:0})}),c.clearConversation(),xt([]),yn({newConversation:!0})},[K,g,d,c,yn,r,Zo,$e,Kn]);gc.current=async T=>(Re.info("conversation not found \u2192 new conversation",{messageId:T.id}),await ni(),T.status="complete",T.errorText=void 0,T.retryAction=void 0,g.value=[...g.value,T,cr()],mr({continueExisting:!1,turn:T,movedFromConversation:!0}));let oi=j(()=>{let T=ni();L("chat");let O=e.modules.list.find(X=>X.layout==="chat")?.id;return O&&P.switchTab(O),T},[ni,P,e]),ag=j(async T=>{await oi(),await rs.current(T,[])||hn.current?.fill(T)},[oi]),ns=j(()=>{let T=Ee==="expanded"?"normal":"expanded";Re.info("expand",{from:Ee,expanded:T==="expanded"}),Kt(T),c.savePanelSize(T),r.emit("expand",T==="expanded")},[r,Ee,c]),os=j(()=>{let T=Ee==="fullscreen"?"normal":"fullscreen";Re.info("fullscreen",{from:Ee,fullscreen:T==="fullscreen"}),Kt(T),c.savePanelSize(T),r.emit("fullscreen",T==="fullscreen")},[r,Ee,c]),sg=j(()=>{L(T=>{let O=T==="history"?"chat":"history";return Re.info("toggleHistory",{view:O}),r.emit("toggleHistory",{view:O}),O})},[r]),lg=j(()=>{Jo(T=>{let O=!T;return Re.info("sidebarToggle",{collapsed:O}),c.saveSidebarCollapsed(O),r.emit("sidebarToggle",{collapsed:O}),O})},[c,r]),cg=j(T=>{Re.info("resize",T),lc({widgetSize:T}),r.emit("resize",T)},[lc,r]),dg=j(async T=>{let O=T.conversationId;if(O===d.value&&uc(O)){Re.info("selectConversation",{conversationId:O,cached:!0}),r.emit("selectConversation",{conversationId:O}),Q.publishConversation(T),L("chat");let Z=w();Z&&P.switchTab(Z),vn(O);return}let re=++Qn.current;fr.current++,y(!1);function me(){return re!==Qn.current}Re.info("selectConversation",{conversationId:O,wasStreaming:K}),r.emit("selectConversation",{conversationId:O}),Q.publishConversation(T);try{let Z=await Q.loadConversation(O);if(me())return;$e.settle(),f.current=!0,ae.current=void 0;let le=Or(Z.messages),Ae=Z.conversationId!==d.value,Ue=Ae?le:Rl(le,g.value);ve.current=Ue.some(ze=>ze.role==="user")?void 0:Z.conversationId,er(()=>{g.value=ei(Ue),Ae&&(v.value=Z.conversationId),d.value=Z.conversationId}),c.saveConversationId(Z.conversationId),Q.primeIdentity(u,Z.conversationId),Qt({conversationId:Z.conversationId,reference:Z.ticketReference}),Z.controlState&&Kn(Z.controlState);let gr=Ue.findLast(ze=>ze.role==="assistant"&&!ze.ephemeral);xt(gr?.suggestions??[]),Ae?Xa(Z.conversationId):vn(Z.conversationId),L("chat");let Ze=w();Ze&&P.switchTab(Ze)}catch(Z){if(me())return;r.emit("error",Z),e.onError?.(Z)}},[Q,g,d,v,r,e,c,ei,K,u,$e,Xa,vn,uc,P]),ii=B(void 0),ai=j(T=>{let O=e.modules.list.find(re=>re.layout===sS[T.to]);if(!O){Re.warn("open: the widget has no such tab",{to:T.to});return}let X=T.id&&(O.layout==="help"||O.layout==="news")?{kind:"content",id:T.id,title:""}:void 0;P.open(O.id,X)},[e.modules,P]),Pc=j(T=>{if(z||Jn(),T!=null){if(!lu(T)){Re.warn("open: unknown target",{detail:T});return}A?ai(T):ii.current=T}},[z,Jn,A,ai]);F(()=>{!A||!ii.current||(ai(ii.current),ii.current=void 0)},[A,ai]);let xc=A&&!k&&(!ti||!bc.value),[Vr,is]=U(),Sc=j(T=>{let O=cu(T);if(!O){Re.warn("ask: expected { text, send? } with non-empty text",{detail:T});return}z||Jn(),is(O)},[z,Jn]),as=z&&A&&!k,wc=as&&xc&&!Pe&&!(ti&&(K||yc));F(()=>{if(Vr===void 0||!(Vr.send?wc:as))return;let T=w();if(!T){Re.warn("ask: the widget has no chat"),is(void 0);return}if($!=="chat"||!h()){L("chat"),P.switchTab(T);return}if(is(void 0),!Vr.send){hn.current?.fill(Vr.text);return}Pn(Vr.text,[]).then(O=>{O||hn.current?.fill(Vr.text)})},[Vr,as,wc,$,R,e.modules,P,Pn]),F(()=>{if(e.widgetId!=="default")return;let T=`data-${q.cssPrefix}-`,O=["ask","open","close"].map(re=>T+re);function X(re){let me=re.composedPath().find(Ae=>Ae instanceof Element&&O.some(Ue=>Ae.hasAttribute(Ue)));if(!(me instanceof Element))return;re.preventDefault();let Z=me.getAttribute(`${T}ask`),le=me.getAttribute(`${T}open`);Z!==null?or(t,"ask",po(Z||(me.textContent??""),{send:me.hasAttribute(`${T}send`)})):le!==null?or(t,"open",Li(le)):or(t,"close")}return document.addEventListener("click",X),()=>document.removeEventListener("click",X)},[e.widgetId,t]),F(()=>{if(e.widgetId!=="default")return;let T=pu(location.href);T&&(history.replaceState(history.state,"",T.url),T.ask?or(t,"ask",po(T.ask)):or(t,"open",T.target))},[e.widgetId,t]);let kc=B(_o),Cc=e.mode==="page"||e.mode==="inline"||e.mode==="standalone";F(()=>nr(()=>{let T=d.value,O={open:Cc||z,ready:A,unread:cc.value,...T?{conversationId:T}:{}},X=kc.current;O.open===X.open&&O.ready===X.ready&&O.unread===X.unread&&O.conversationId===X.conversationId||(kc.current=O,r.emit("state",O),O.unread!==X.unread&&r.emit("unread",O.unread))}),[r,Cc,z,A,cc,d]);let xn=B({handleOpenCommand:Pc,handleClose:ri,handleExpand:ns,handleFullscreen:os,handleAskCommand:Sc});xn.current={handleOpenCommand:Pc,handleClose:ri,handleExpand:ns,handleFullscreen:os,handleAskCommand:Sc},St(()=>uu(t,{open:T=>xn.current.handleOpenCommand(T),close:()=>xn.current.handleClose(),expand:()=>xn.current.handleExpand(),fullscreen:()=>xn.current.handleFullscreen(),ask:T=>xn.current.handleAskCommand(T)}),[t]);let ft=Ce(()=>Ms(e,At,pr,_r),[e,At,pr,_r]);He.current=ft.strings,F(()=>{let T=Tt.current;if(!T?.translations?.length)return;let O=Kr(T,At);Mt(O.agent),O.site&&Ks(O.site)&&fn(O.site),O.blocks&&Qs(O.blocks)&&mn(O.blocks)},[At]);function ss(T){dg(T)}let Tc={options:ft,transport:Q,feedback:fe,bus:r,persistence:c,conversationId:d.value??"",composerKey:v.value,composerApiRef:hn,view:$,isStreaming:K,pageToolRunning:ts,isMemoryCompacting:yc,canReleaseQueuedMessages:xc,queueManualMessages:ti&&bc.value,replyAwaitsCard:ti&&rg.value,sendPreparing:Pe,attachmentUploadsSig:Be,composerActive:ft.mode==="page"||ft.mode==="inline"||ft.mode==="standalone"||z,controlMode:lr.value,assignedOperator:qm.value,operatorAvailable:Um.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:zm,onCancelOperatorRequest:Fm,loadingMessages:k,onLoadPreviousMessages:Jm,messagesSig:g,reconnectingSig:x,agent:je,ticketReference:Vt?.conversationId===d.value?Vt?.reference:void 0,login:Za,onStartAsGuest:a,maxMessageCharacters:V,suggestions:_t,initialWidgetSize:_.widgetSize??null,onClear:ni,onExpand:ns,onFullscreen:os,onSoundToggle:Dm,onToggleHistory:sg,onSelectHistoryConversation:ss,onNewConversation:oi,onLocaleChange:Nm,onThemeChange:Om,onTextSizeChange:$m,onWidgetSizeChange:cg,onSend:Pn,onStop:ng,onSuggestion:T=>{if(de.current)return;let O=T.text??T.label;Re.info("suggestion",{text:O,autoSend:e.autoSendSuggestions}),r.emit("suggestion",{text:O}),e.autoSendSuggestions?Pn(O,[]):hn.current?.fill(O)},tool:Zm,onRetry:ig,onMessageFeedback:eg,onCardAction:og};if(M)return l("div",{class:`${Yo}-anchor`,children:l(ic,{strings:ft.strings,text:ft.strings.chatUnavailable})});if(!A)return null;let Xn=ft.modules.list;function ls(T){let O=On("close",ft.mode,T)?ri:void 0;return Xn.length===0?l(ic,{strings:ft.strings,text:ft.strings.modulesEmpty,onClose:O}):Xn.length===1&&Xn[0]?.layout==="chat"?l(em,{...Tc,panelSize:T,onClose:O}):l(tm,{panelProps:{...Tc,panelSize:T,onClose:O},enabledModules:Xn,nav:P,bus:r,hasUnread:jm.value,latestNews:Qm,onSelectConversation:ss,onStartNewConversation:ag,onSetPanelSize:Kt})}if(e.mode==="page"){let T=e.history.enabled&&Xn.some(O=>O.layout==="chat");return l("div",{class:`${Yo}-anchor`,children:l(om,{site:_n,blocks:Fr,transport:Q,strings:ft.strings,locale:ft.locale,persistence:c,showConversations:T,onSelectConversation:ss,onNewConversation:oi,sidebarCollapsed:Hr,onToggleSidebarCollapsed:lg,children:ls("fullscreen")})})}if(H){let T=e.mode==="standalone"?"fullscreen":Ee;return l("div",{class:`${Yo}-anchor`,children:ls(T)})}let Ic=e.mode==="drawer",Rc=!(e.mode==="modal")&&!e.launcher.hidden&&(!z||Ge),Ac=Rc&&!Ge&&!se&&!Ic?ft.launcher.callout:null;return l("div",{class:`${Yo}-anchor`,"data-launcher-size":ft.launcher.size,children:[z||pe?l("div",{class:`${Yo}-surface`,hidden:!z,children:ls(Ee)}):null,Rc?l(S_,{buttonRef:It,onToggle:Jn,launcher:ft.launcher,strings:ft.strings,leaving:Ge,edgeTab:Ic}):null,Ac?l(w_,{callout:Ac,launcherPosition:ft.position,strings:ft.strings,closeLabel:ft.strings.close,onDismiss:we}):null]})}function lS(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var cS={AI_AGENT_PUBLIC_ACCESS_NOT_FOUND:"the deployment was not found or is turned off",AI_AGENT_PUBLIC_ORIGIN_NOT_ALLOWED:"this website is not in the deployment's allowed origins"},dS=120,Rm=new WeakMap;async function uS(e,t,r,n,o){return(await Promise.all(t.map(async a=>{try{n(a.id,{status:"uploading"});let i=Rm.get(a)??await e.uploadFile(a.file,r,c=>n(a.id,{status:"uploading",fraction:c}));return Rm.set(a,i),n(a.id,{status:"done"}),{id:i.id,name:i.originalName,mediaType:i.mimeType,size:i.fileSize,url:i.url}}catch(i){n(a.id,r.aborted?void 0:{status:"error",refusal:i instanceof qe&&i.status===400?i.errorCode:void 0}),o(i);return}}))).filter(a=>a!==void 0)}var pS=ie.scope("error-boundary"),Qa=class extends Zt{constructor(){super(...arguments);ee(this,"state",{crashed:!("toSorted"in Array.prototype)})}componentDidCatch(r,n){pS.error("widget render crashed",{error:r,componentStack:n?.componentStack}),this.setState({crashed:!0}),this.props.onError(r,n?.componentStack)}render(){return this.state.crashed?this.props.fallback:this.props.children}};function Em(e){let{bus:t,host:r,appRoot:n,persistence:o,reportError:s}=e,a=e.initialRaw,i,c,u=wn(a),p=o.loadUserPrefs().locale??u.locale,_=!0,d=0,f=0,v=Cd(t);function g(){let m=i&&Kr({config:i,translations:c},p).config;u=wn(m?Ls(a,m):a)}function x(){Bs(r,Ci(u.mode)),Ud(r,{...u,themeMode:to(u.themeMode,o.loadUserPrefs().themeMode)}),_&&(Ti(r,_S(u)),_=!1)}function k(){x(),Rr(Ir(Qa,{onError:s},Ir(Am,{key:d,bus:t,hostElement:r,options:u,recentHostEvents:v,loginRevision:f,onPersonChanged:b,onStartAsGuest:w})),n)}t.on("handshake",m=>{m.config&&(m.config.storageVersion&&o.rememberStorageVersion(m.config.storageVersion),i=m.config,c=m.translations,g(),k())}),t.on("localeChange",m=>{p=m,c?.length&&(g(),k())});let y=Id(t,{getOptions:()=>u,getVisitorId:()=>o.getVisitorId(),getConversationId:()=>o.loadConversationId()});function S(){let m=o.takeLoginReturn();return m?(o.saveConversationId(m.conversationId),o.saveDraft(m.conversationId,m.draft),o.savePanelOpen(!0),!0):!1}a.userToken&&S();function b(){o.reset(),v.length=0,d+=1,_=!0,g(),k()}function w(){a={...a,userContext:void 0,userToken:void 0},b()}function h(m){"userToken"in m&&m.userToken&&!a.userToken&&S()&&(d+=1),a={...a,...m},g(),k()}return{getOptions:()=>u,getUserOptions:()=>a,render:k,setUserOptions:m=>{a=m,g(),k()},patchUserOptions:h,login:m=>{f+=1,h({userToken:m})},reset:()=>w(),destroy:()=>y()}}function _S(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=Cn(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:r,panelSize:n}=Ao(e,Dn(),t.loadPanelOpen(),t.loadPanelSize());return ma(e.mode,n,r)}var sc=class extends HTMLElement{constructor(){super(...arguments);ee(this,"bus",new Oi);ee(this,"widgetState",_o);ee(this,"userToken");ee(this,"pageTools",[]);ee(this,"markReady",()=>{});ee(this,"ready",new Promise(r=>{this.markReady=r}));ee(this,"mountResult",null);ee(this,"runtime",null)}static get observedAttributes(){return Ns}connectedCallback(){if(Object.hasOwn(this,"tools")){let r=Reflect.get(this,"tools");Reflect.deleteProperty(this,"tools"),this.pageTools=Array.isArray(r)?r:[]}this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,Rr(null,this.mountResult.appRoot),this.bus.clear(),this.widgetState=_o)}attributeChangedCallback(){this.isConnected&&this.boot()}open(r){or(this,"open",r)}close(){or(this,"close")}expand(){or(this,"expand")}ask(r,n){or(this,"ask",po(r,n))}get state(){return this.widgetState}reset(){this.userToken=void 0,this.runtime?.reset()}login(r){this.userToken=r,this.runtime?.login(r)}track(r,n){let o=kd(r,n);o&&this.bus.emit("hostEvent",o)}get tools(){return this.pageTools}set tools(r){this.pageTools=r,this.runtime?.patchUserOptions({tools:r})}registerTool(r,n){Sf(r,n)}on(r,n){return this.bus.on(r,n)}boot(){let r={...Os(s=>this.getAttribute(s)),...this.userToken?{userToken:this.userToken}:{},tools:this.pageTools};if(!r.aiAgentDeploymentId)throw new Error("ai-agent-deployment-id is required");if(this.runtime){this.runtime.setUserOptions(r);return}let n=wn(r);this.mountResult??(this.mountResult=qd({existingHost:this,position:Ci(n.mode)}));let o=Cn(n.widgetId,n.storage,n.aiAgentDeploymentId);this.bus.on("state",s=>{this.widgetState=s,s.ready&&this.markReady()}),this.runtime=Em({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:o,initialRaw:r,reportError:s=>this.bus.emit("error",s)}),this.runtime.render()}},Mm=!1;function fS(){if(Mm||typeof customElements>"u")return;let e=q.tagName;customElements.get(e)||customElements.define(e,sc),Mm=!0}typeof customElements<"u"&&fS();export{fS as registerWebComponent};
|
|
75
|
+
`).trim(),ye=!A&&t!=="error"&&!C.value&&Re.length>0,Oe=e.canceled===!0||t==="error";function fe(ae){return u&&t==="complete"&&ta(e,ae)}let tt=new Map;for(let[ae,ve]of P.entries()){if(ve.kind!=="tool")continue;let _e=er(ve.toolMetadata),be=Xc(Ff(ve),{turn:{live:B||_e&&!p,cutOff:Oe,superseded:p,submitted:e.continuationStreaming===!0&&ve.approvalSig.value?.approved===void 0,canAct:fe(ae),interrupted:_e&&Mf(ve.errorSig.value)},reader:{decides:!0},display:l,strings:r});tt.set(ve.toolCallId,be.placement==="card"&&!_?.humanInLoop?{...be,placement:"hidden"}:be)}function ht(ae){let ve=tt.get(ae.toolCallId);if(!ve)throw new Error(`no step view for ${ae.toolCallId}`);return ve}let nt=Jf(P,{showReasoning:s,showSources:c,viewOf:ht}),bt=Xf(P),Ee=e.canceled===!0&&!$&&k.value&&g.value,Ue=nt.at(-1),Tt=Ue?.kind==="steps"?Ue.indices.at(-1):Ue?.index;function mt(ae,ve){return a(Ix,{part:ae,generativeUi:e.role==="assistant",onCardAction:w,current:B&&ve===Tt,reasoningMs:e.stepTimings?.[bt[ve]??-1]?.reasoningMs,strings:r,locale:o,showReasoning:s,showSources:c,view:ae.kind==="tool"?tt.get(ae.toolCallId):void 0,canAct:fe(ve),superseded:p,continuationStreaming:e.continuationStreaming===!0,tool:_},`${Lx(ae)}#${ve}`)}let ze=Te||ye;return a("div",{class:`${Ge}-bubble-row`,"data-role":e.role,"aria-busy":B?"true":void 0,"data-testid":ft(L.messageBubble,e.serverMessageId??e.id),children:a("div",{class:`${Ge}-bubble-col`,children:[a("div",{class:`${Ge}-bubble`,children:[e.role==="operator"&&e.operatorInitials?a("span",{class:`${Ge}-bubble-author`,children:e.operatorInitials}):null,a("div",{class:`${Ge}-bubble-body`,children:[j?a(Nx,{label:r.loading}):nt.flatMap((ae,ve)=>ae.kind==="part"?[mt(ae.part,ae.index)]:ae.rows.some(_e=>_e.kind==="tool")?[a(Zf,{rows:ae.rows,steps:ae.indices.map(_e=>bt[_e]??-1),stepTimings:e.stepTimings,timed:!Oe,strings:r,running:B&&ve===nt.length-1,runStartedAt:e.runStartedAt,renderCard:(_e,be)=>be.card==="questions"&&_?a(ec,{part:_e,strings:r,active:!1,superseded:be.status==="replaced",folded:!0,onDecision:_.onDecision,onEdit:_.onEdit}):void 0},`steps#${ae.indices[0]}`)]:ae.rows.map((_e,be)=>mt(_e.part,ae.indices[be]??be))),Ee?a("div",{class:`${Ge}-steps-row`,"data-status":"stopped","data-testid":L.replyStopped,children:[a("span",{class:`${Ge}-steps-row-icon`,"aria-hidden":"true",children:a(wn,{})}),a("div",{class:`${Ge}-steps-row-main`,children:a("span",{class:`${Ge}-steps-stopped-label`,children:r.statusStopped})})]}):null,Y&&!m?a(Ox,{}):null,t==="error"||C.value?a(Ro,{text:Mx(e,t,r),retryLabel:r.errorRetry,onRetry:d?()=>d(e):void 0,retryTestId:L.messageRetry}):null,m&&B?a(Ro,{text:r.errorReconnecting,retryTestId:L.messageRetry}):null]})]}),ie||ze?a("div",{class:`${Ge}-bubble-meta`,children:[ie?a("time",{class:`${Ge}-bubble-time`,dateTime:ie.iso,title:ie.full,children:ie.short}):null,ze?a("div",{class:`${Ge}-bubble-actions`,children:[Te&&e.serverMessageId?a(Of,{messageId:e.serverMessageId,initial:e.feedback??null,strings:r,onFeedback:v}):null,ye?a(Rx,{text:Re,strings:r}):null]}):null]}):null]})})}function Rx({text:e,strings:t}){let[n,r]=N(!1);function o(){navigator.clipboard?.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)}).catch(()=>{})}let i=n?t.copied:t.copy;return a("button",{type:"button",class:`${Ge}-msg-action`,"data-active":n?"true":void 0,"aria-label":i,title:i,onClick:o,"data-testid":L.messageCopy,children:n?a(Rr,{}):a(P_,{})})}function Ax(e,t){if(typeof e!="number"||!Number.isFinite(e))return null;try{let n=new Date(e);return{short:n.toLocaleTimeString(t,{hour:"numeric",minute:"2-digit"}),full:n.toLocaleString(t,{dateStyle:"full",timeStyle:"short"}),iso:n.toISOString()}}catch{return null}}function Ix({part:e,generativeUi:t,onCardAction:n,current:r,reasoningMs:o,strings:i,locale:s,showReasoning:l,showSources:c,view:u,canAct:p,superseded:_,continuationStreaming:d,tool:f}){switch(e.kind){case"step-start":return null;case"text":return a(Co,{textSig:e.textSig,doneSig:e.doneSig,generativeUi:t,strings:i,onCardAction:n});case"reasoning":return l?a(tc,{part:e,current:r,reasoningMs:o,strings:i,standalone:!0}):null;case"tool":return u?.placement!=="card"||!f?null:u.card==="questions"?a(ec,{part:e,strings:i,active:p,superseded:_,continuationStreaming:d,onDecision:f.onDecision,onEdit:f.onEdit}):a(Hf,{part:e,view:u,strings:i,locale:s,canAct:p,onDecision:f.onDecision,onEdit:f.onEdit,preview:f.preview});case"file":return a(Ex,{part:e,strings:i});case"source":return c?a(Bf,{part:e,strings:i}):null}}function Ex({part:e,strings:t}){let n=e.filename??t.file;if(e.mediaType.startsWith("image/"))return a("a",{class:`${Ge}-file-image`,href:e.url,target:"_blank",rel:"noreferrer noopener",title:n,"data-testid":L.messageFile,children:a("img",{src:e.url,alt:n,loading:"lazy"})});let r=(n.includes(".")?n.split(".").pop():e.mediaType.split("/").pop())?.toUpperCase(),o=e.fileSize===void 0?void 0:Mr(e.fileSize);return a("a",{class:`${Ge}-file-chip`,href:e.url,target:"_blank",rel:"noreferrer noopener",title:n,"data-testid":L.messageFile,children:[a("span",{class:`${Ge}-file-chip-icon`,"aria-hidden":"true",children:a(pa,{})}),a("span",{class:`${Ge}-file-chip-text`,children:[a("span",{class:`${Ge}-file-chip-name`,children:n}),a("span",{class:`${Ge}-file-chip-meta`,children:[r,o].filter(Boolean).join(" \xB7 ")})]})]})}function Mx(e,t,n){return e.errorText?e.errorText:t==="error"&&e.role==="assistant"?n.errorServer:n.errorGeneric}function Lx(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 Ox(){return a("span",{class:`${Ge}-typing`,"data-testid":L.typingDots,"aria-hidden":"true",children:[a("span",{}),a("span",{}),a("span",{})]})}function Nx({label:e}){return a("span",{class:`${Ge}-loading`,role:"status",children:[a("span",{class:`${Ge}-loading-spinner`,"aria-hidden":"true"}),a("span",{class:`${Ge}-loading-label`,children:e})]})}var dn=O.cssPrefix,Oa=120,$x=350;function tm({messagesSig:e,reconnectingSig:t,pageToolRunning:n,strings:r,notice:o,locale:i,responseMode:s,showReasoning:l,stepDisplay:c,showSources:u,enableMessageFeedback:p,onFeedback:_,loading:d,onLoadPreviousMessages:f,idle:v,controlMode:m="ai-agent",tool:b,onRetry:w,onCardAction:y}){let P=D(null),C=gt(()=>e.value),x=Dx(i),[g,h]=N(!1),[k,$]=N(!1),I=D(!1),B=D(!1),[A,z]=N(),j=D(!1),Y=D(!1),ie=D(!1),K=D(0);function Te(){return ie.current||performance.now()-K.current<$x}let Re=D(0);function ye(M){let R=M.scrollHeight-M.clientHeight>1;M.dataset.fadeTop=R&&M.scrollTop>1?"true":"false",M.dataset.fadeBottom=R&&M.scrollHeight-M.scrollTop-M.clientHeight>1?"true":"false"}function Oe(M){return h(M.scrollHeight-M.scrollTop-M.clientHeight>Oa*2)}function fe(M){Re.current=performance.now(),M.scrollTop=M.scrollHeight,ye(M)}function tt(M,R){fe(M);let G=R,V=0;function ee(){Y.current||Te()||(fe(M),--G>0&&(V=requestAnimationFrame(ee)))}return R>0&&(V=requestAnimationFrame(ee)),()=>cancelAnimationFrame(V)}function ht(M,R){let G,V,ee,me=-1;function le(){G.disconnect(),V.disconnect(),clearTimeout(ee)}function ge(){if(Y.current||Te()||me>=0&&M.scrollTop<me-4)return le();fe(M),me=M.scrollTop}return G=new ResizeObserver(ge),V=new MutationObserver(ge),ge(),G.observe(M),V.observe(M,{childList:!0,subtree:!0,characterData:!0}),ee=setTimeout(le,R),le}let nt=C.value[0]?.id;ut(()=>{let M=P.current;if(M&&C.value.length!==0&&!B.current&&(j.current=!0,!!C.value.some(R=>R.role==="user")))return ht(M,300)},[nt]);let bt=D(0);U(()=>{let M=P.current,R=C.value,G=bt.current;if(bt.current=R.length,!M||!j.current||B.current)return;if(R.slice(G).some(ee=>ee.role==="user"))return Y.current=!1,tt(M,3);if(!R.some(ee=>ee.role==="user")||Y.current||Te())return;M.scrollHeight-M.scrollTop-M.clientHeight<Oa&&fe(M)},[C.value.length]);let Ee=D(null);U(()=>{let M=P.current,R=C.value.at(-1),G=Ee.current;if(Ee.current=R?{id:R.id,streaming:R.status==="streaming"}:null,!!M&&j.current&&!(!R||R.id!==G?.id||G.streaming||R.status!=="streaming"))return Y.current=!1,tt(M,3)},[C.value]),U(()=>{let M=P.current;if(!M)return;let R=C.value.at(-1);if(!R||R.status!=="streaming"&&!C.value.some(ee=>ee.role==="user"))return;let G=()=>{if(Y.current||Te())return;M.scrollHeight-M.scrollTop-M.clientHeight<Oa*2&&fe(M)};if(R.status!=="streaming")return ht(M,300);G();let V=new MutationObserver(G);return V.observe(M,{childList:!0,subtree:!0,characterData:!0}),()=>V.disconnect()},[C.value]),U(()=>{let M=P.current;if(!M)return;let R=()=>{Oe(M),ye(M),performance.now()-Re.current>150&&(Y.current=M.scrollHeight-M.scrollTop-M.clientHeight>8)};function G(){Y.current=!0}function V($e){$e.deltaY<0&&G()}let ee=0;function me($e){ee=$e.touches[0]?.clientY??0,ie.current=!0}function le($e){($e.touches[0]?.clientY??0)>ee+4&&G()}function ge(){ie.current=!1,K.current=performance.now()}function Ye(){ie.current=!0}return M.addEventListener("scroll",R,{passive:!0}),M.addEventListener("wheel",V,{passive:!0}),M.addEventListener("touchstart",me,{passive:!0}),M.addEventListener("touchmove",le,{passive:!0}),M.addEventListener("touchend",ge,{passive:!0}),M.addEventListener("touchcancel",ge,{passive:!0}),M.addEventListener("pointerdown",Ye,{passive:!0}),window.addEventListener("pointerup",ge,{passive:!0}),window.addEventListener("pointercancel",ge,{passive:!0}),Oe(M),()=>{M.removeEventListener("scroll",R),M.removeEventListener("wheel",V),M.removeEventListener("touchstart",me),M.removeEventListener("touchmove",le),M.removeEventListener("touchend",ge),M.removeEventListener("touchcancel",ge),M.removeEventListener("pointerdown",Ye),window.removeEventListener("pointerup",ge),window.removeEventListener("pointercancel",ge)}},[]),U(()=>{let M=P.current;if(!M)return;let R=M.clientHeight,G=new ResizeObserver(()=>{if(M.clientHeight===R)return;let V=M.scrollHeight-M.scrollTop-R<=Oa;R=M.clientHeight,!(!V||B.current)&&C.value.some(ee=>ee.role==="user")&&(Y.current=!1,fe(M))});return G.observe(M),()=>G.disconnect()},[]);function Ue(){let M=P.current;M&&(Y.current=!1,fe(M))}let Tt=C.value.filter(M=>!M.ephemeral),mt=Tt[0],ze=mt?.serverMessageId??mt?.id,ae=!!(f&&Tt.length>=El&&ze!==A);async function ve(){if(!f||I.current)return;let M=P.current,R=M?.scrollHeight??0,G=M?.scrollTop??0;I.current=!0,B.current=!0,$(!0);try{let V=await f();V===!1&&ze&&z(ze),V&&M&&(await new Promise(ee=>requestAnimationFrame(()=>requestAnimationFrame(()=>ee()))),M.scrollTop=G+M.scrollHeight-R,ye(M),Oe(M))}finally{B.current=!1,I.current=!1,$(!1)}}let _e=[],be="",Ce=C.value.at(-1)?.id,Lt=t?.value===!0,ct=n===!0;for(let M of C.value){if(M.role==="assistant"&&M.id!==Ce&&Qn(M))continue;let R=Bx(M.createdAt);R&&R!==be&&(_e.push(a("div",{class:`${dn}-date-divider`,children:a("span",{class:`${dn}-date-pill`,title:Ux(M.createdAt,x),children:zx(M.createdAt,r,x)})},`day:${R}`)),be=R);let V=M.retryAction!==void 0||M.role==="assistant"&&M.id===Ce?oa(C.value,M):void 0,ee=V!==void 0&&(V.kind!=="continue-assistant"||m==="ai-agent");_e.push(a(em,{message:M,status:M.status,createdAt:M.createdAt,strings:r,locale:x,responseMode:s,showReasoning:l,stepDisplay:c,showSources:u,interactive:!!v&&m==="ai-agent"&&M.id===Ce,superseded:M.id!==Ce,tool:b,onRetry:v&&ee&&(M.role==="user"||M.id===Ce)?w:void 0,enableMessageFeedback:p,onFeedback:_,reconnecting:Lt&&M.id===Ce,clientToolRunning:ct&&M.id===Ce&&M.role==="assistant",onCardAction:y},M.id))}return a("div",{class:`${dn}-list-wrap`,children:[a("div",{ref:P,class:`${dn}-list ${dn}-list--fade`,part:"messages",role:"log","aria-live":"polite","aria-relevant":"additions text",children:[d&&C.value.length===0?a("div",{class:`${dn}-list-loading`,role:"status",children:r.conversationLoading}):null,o&&!ae?a("div",{class:`${dn}-chat-notice`,role:"note","data-testid":L.chatNotice,children:a(ha,{text:o})}):null,ae?a("div",{class:`${dn}-load-previous`,children:a("button",{type:"button",onClick:ve,disabled:k,"aria-busy":k,"data-testid":L.loadPreviousMessages,children:r.loadPreviousMessages})}):null,_e]}),g?a("button",{type:"button",class:`${dn}-jump`,onClick:Ue,"aria-label":r.scrollToBottom,title:r.scrollToBottom,"data-testid":L.scrollToBottom,children:a(Wt,{})}):null]})}function Dx(e){try{return Intl.getCanonicalLocales(e)[0]}catch{return}}function Bx(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Ux(e,t){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(t,{dateStyle:"full"})}catch{return""}}function zx(e,t,n){let r=new Date(e);function o(s){return new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime()}let i=Math.round((o(new Date)-o(r))/864e5);return i<=0?t.dateToday:i===1?t.dateYesterday:i<7?r.toLocaleDateString(n,{weekday:"long"}):r.toLocaleDateString(n,{month:"long",day:"numeric",year:"numeric"})}var Fx=16,qx=64;function Na({panelEl:e,resize:t,position:n,edge:r,initialSize:o,onSizeChange:i,onResizeStart:s,strings:l}){let c=O.cssPrefix,u=D(null),[p,_]=N(null),d=o?.width,f=o?.height;if(U(()=>{if(!e)return;let A=e.style;A.setProperty(`--${c}-resize-min-w`,t.minWidth??"320px"),A.setProperty(`--${c}-resize-min-h`,t.minHeight??"400px"),t.maxWidth&&A.setProperty(`--${c}-resize-max-w`,t.maxWidth),t.maxHeight&&A.setProperty(`--${c}-resize-max-h`,t.maxHeight),d!==void 0&&f!==void 0&&(A.setProperty(`--${c}-widget-w`,`${d}px`),A.setProperty(`--${c}-widget-h`,`${f}px`)),_(Math.round(e.getBoundingClientRect().width/window.innerWidth*100))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,c,d,f]),!e)return null;let v=n.startsWith("top-"),m=n.endsWith("-right"),b=m?-1:1,w=v?1:-1,y=`${c}-resize-grip--${r?"edge":`${v?"bottom":"top"}-${m?"left":"right"}`}`;function P(A){A.setAttribute("data-resizing",""),s?.()}function C(A,z,j){A.style.setProperty(`--${c}-widget-w`,`${z}px`),r||A.style.setProperty(`--${c}-widget-h`,`${j}px`)}function x(A){let z=A.getBoundingClientRect(),j={width:Math.round(z.width),height:Math.round(z.height)};A.style.setProperty(`--${c}-widget-w`,`${j.width}px`),r||A.style.setProperty(`--${c}-widget-h`,`${j.height}px`),_(Math.round(j.width/window.innerWidth*100)),i(j)}function g(A){if(!e)return;let z=e.getBoundingClientRect();u.current={pointerId:A.pointerId,startX:A.clientX,startY:A.clientY,startW:z.width,startH:z.height,moved:!1},A.currentTarget.setPointerCapture(A.pointerId),A.preventDefault()}function h(A){let z=u.current;if(!z||A.pointerId!==z.pointerId||!e)return;let j=(A.clientX-z.startX)*b,Y=r?0:(A.clientY-z.startY)*w;!z.moved&&j===0&&Y===0||(z.moved||P(e),z.moved=!0,C(e,z.startW+j,z.startH+Y))}function k(A){let z=u.current;!z||A.pointerId!==z.pointerId||!e||(A.currentTarget.releasePointerCapture(A.pointerId),u.current=null,z.moved&&(e.removeAttribute("data-resizing"),x(e)))}function $(A){return A==="ArrowLeft"?[-1,0]:A==="ArrowRight"?[1,0]:r?null:A==="ArrowUp"?[0,-1]:A==="ArrowDown"?[0,1]:null}function I(A){let z=$(A.key);if(!z||!e)return;A.preventDefault();let j=A.shiftKey?qx:Fx;A.repeat||P(e);let Y=e.getBoundingClientRect();C(e,Y.width+z[0]*j*b,Y.height+z[1]*j*w)}function B(A){!$(A.key)||!e||(e.removeAttribute("data-resizing"),x(e))}return a("div",{class:`${c}-resize-grip ${y}`,role:"separator","aria-orientation":"vertical","aria-label":l.resizeHandle,"aria-valuenow":p??void 0,tabIndex:0,title:l.resizeHandle,onPointerDown:g,onPointerMove:h,onPointerUp:k,onPointerCancel:k,onKeyDown:I,onKeyUp:B,"data-testid":L.resizeGrip,children:r?null:a(l_,{})})}var nm=O.cssPrefix;function rm({suggestions:e,strings:t,onPick:n,disabled:r=!1}){let o=D(null),[i,s]=N({start:!1,end:!1});return U(()=>{let l=o.current;if(!l)return;function c(){if(!l)return;let p=Math.abs(l.scrollLeft),_=p>1,d=p<l.scrollWidth-l.clientWidth-1;s(f=>f.start===_&&f.end===d?f:{start:_,end:d})}c(),l.addEventListener("scroll",c,{passive:!0});let u=typeof ResizeObserver>"u"?void 0:new ResizeObserver(c);return u?.observe(l),()=>{l.removeEventListener("scroll",c),u?.disconnect()}},[e]),e.length===0?null:a("div",{ref:o,class:`${nm}-suggestions`,role:"group","aria-label":t.suggestedReplies,"data-cut-start":i.start?"true":void 0,"data-cut-end":i.end?"true":void 0,children:e.map((l,c)=>a("button",{type:"button",class:`${nm}-suggestion`,onClick:()=>n(l),disabled:r,"data-testid":ft(L.suggestion,c),children:l.label},l.id))})}var tr=O.cssPrefix,Hx=`.${tr}-header, .${tr}-back-header, .${tr}-home-hero`,jx='button, a, input, textarea, select, [role="tab"], [contenteditable]',om=56;function $a(e,t){U(()=>{if(!t||!e)return;function n(c){return Number.parseFloat(c)||0}function r(c,u){return Math.min(u,Math.max(-u,c))}let o=null,i=c=>{let u=c.target;if(!(u instanceof Element)||!u.closest(Hx)||u.closest(jx))return;let p=e.getBoundingClientRect();o={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${tr}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${tr}-modal-dy`)),maxX:(window.innerWidth+p.width)/2-om,maxY:(window.innerHeight+p.height)/2-om},e.dataset.dragging="true",c.preventDefault()},s=c=>{if(!o||c.pointerId!==o.id)return;let u=r(o.dx+c.clientX-o.x,o.maxX),p=r(o.dy+c.clientY-o.y,o.maxY);e.style.setProperty(`--${tr}-modal-dx`,`${u}px`),e.style.setProperty(`--${tr}-modal-dy`,`${p}px`)},l=c=>{!o||c.pointerId!==o.id||(o=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",i),window.addEventListener("pointermove",s),window.addEventListener("pointerup",l),window.addEventListener("pointercancel",l),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",l),window.removeEventListener("pointercancel",l)}},[e,t])}function Da({containerRef:e,onDrop:t,accept:n,disabled:r=!1}){let[o,i]=N();return U(()=>{if(r){i(void 0);return}let s=e.current;if(!s)return;let l=0;function c(d){l+=1,d.dataTransfer?.types.includes("Files")&&(d.preventDefault(),i([...d.dataTransfer.items].every(f=>f.kind!=="file"||V_(f.type,n))?"accept":"reject"))}function u(){l-=1,!(l>0)&&(l=0,i(void 0))}function p(d){d.dataTransfer?.types.includes("Files")&&d.preventDefault()}function _(d){l=0,i(void 0),d.dataTransfer&&(d.preventDefault(),t(d.dataTransfer.items))}return s.addEventListener("dragenter",c),s.addEventListener("dragleave",u),s.addEventListener("dragover",p),s.addEventListener("drop",_),()=>{s.removeEventListener("dragenter",c),s.removeEventListener("dragleave",u),s.removeEventListener("dragover",p),s.removeEventListener("drop",_)}},[n,e,r,t]),r?void 0:o}var Se=O.cssPrefix;function im(e){let{options:t,onClose:n}=e,r=t.strings,o=D(null);U(()=>{let u=o.current;if(!u||!n)return;let p=Ir(u);function _(d){d.key==="Escape"&&n?.()}return u.addEventListener("keydown",_),()=>{p(),u.removeEventListener("keydown",_)}},[n]);let i=e.composerApiRef,s=e.composerActive&&e.view==="chat"&&!e.sendPreparing&&e.options.features.fileUpload,l=F(u=>{s&&i.current?.attachFromDrop(u)},[i,s]),c=Da({containerRef:o,onDrop:l,accept:e.options.attachments.accept,disabled:!s});return $a(o.current,t.mode==="modal"),a("div",{ref:o,class:`${Se}-panel`,part:"panel",role:"dialog","aria-modal":"false","aria-label":r.panelTitle,style:{position:"relative"},"data-testid":L.panel,children:[a(nc,{...e,containerEl:o.current,dragOver:c}),a(rc,{poweredBy:e.options.poweredBy,strings:e.options.strings})]})}function nc(e){let{options:t,transport:n,feedback:r,bus:o,persistence:i,conversationId:s,composerKey:l,panelSize:c,view:u,isStreaming:p,isMemoryCompacting:_,canReleaseQueuedMessages:d,queueManualMessages:f,replyAwaitsCard:v,sendPreparing:m,attachmentUploadsSig:b,controlMode:w,assignedOperator:y,operatorAvailable:P,operatorRequestEnabled:C,onRequestOperator:x,onCancelOperatorRequest:g,loadingMessages:h,onLoadPreviousMessages:k,messagesSig:$,reconnectingSig:I,agent:B,ticketReference:A,login:z,onStartAsGuest:j,suggestions:Y,initialWidgetSize:ie,onClose:K,onBack:Te,onExpand:Re,onToggleHistory:ye,onSelectHistoryConversation:Oe,onNewConversation:fe,onWidgetSizeChange:tt,onSend:ht,onStop:nt,onSuggestion:bt,tool:Ee,onRetry:Ue,onMessageFeedback:Tt,onCardAction:mt,containerEl:ze,dragOver:ae,composerApiRef:ve}=e,_e=t.strings,be=w==="operator"?y:void 0,Ce=be?{name:be.name??be.initials,avatar:be.avatar,title:_e.operatorBadgeTitle,status:"online"}:B,Lt=t.header.showNotice?at(_e,t.header.notice||"chatNotice"):void 0,ct=gt(()=>$.value.some(le=>!le.ephemeral&&le.role!=="system")).value,M=gt(()=>$.value.length>0).value,[R,G]=N(),V=R===s,ee=t.features.emailTranscript&&ct?()=>G(s):void 0,me=z.gate?a(Jx,{login:{...z,gate:z.gate},alone:!M,onStartAsGuest:j,strings:_e}):a(pe,{children:[w&&w!=="ai-agent"?a(Wx,{controlMode:w,operatorName:y?.name??y?.initials,operatorAvailable:P,onCancelOperatorRequest:g,strings:_e}):null,_&&w==="ai-agent"?a("div",{class:`${Se}-loading ${Se}-compaction-status`,role:"status","data-testid":L.compactionStatus,children:[a("span",{class:`${Se}-loading-spinner`,"aria-hidden":"true"}),_e.compactingContext]}):null,!p&&!_&&w==="ai-agent"&&a(rm,{suggestions:Y,strings:_e,onPick:bt,disabled:m}),a(J_,{options:t,transport:n,feedback:r,bus:o,persistence:i,conversationId:s,maxMessageCharacters:e.maxMessageCharacters,isStreaming:p,pageToolRunning:e.pageToolRunning,isMemoryCompacting:_,canReleaseQueuedMessages:d,queueManualMessages:f,replyAwaitsCard:v,active:e.composerActive&&u==="chat",isPreparing:m,attachmentUploadsSig:b,operatorRequestEnabled:C,canRequestOperator:ct,controlMode:w,onRequestOperator:x,onSend:ht,onStop:nt,apiRef:ve},l)]});return a(pe,{children:[u==="history"?a(Vx,{strings:_e,onBack:ye,onClose:K,showClose:aa(t.mode,c,t.actions)}):a("header",{class:`${Se}-header`,part:"header","data-variant":t.header.variant,"data-testid":L.panelHeader,children:[Te?a("button",{type:"button",class:`${Se}-icon-btn`,onClick:Te,"aria-label":_e.moduleBack,title:_e.moduleBack,children:a(xo,{})}):null,Ce?a(of,{agent:Ce,strings:_e,ticketReference:A,person:!!be}):a("h1",{children:_e.panelTitle}),a(Yt,{panelProps:z.gate?{...e,options:{...t,actions:t.actions.filter(le=>le!=="history")}}:e,variant:"chat",onEmailTranscript:ee,onLogIn:z.menuLogIn})]}),u==="history"?a(Ta,{transport:n,strings:_e,locale:t.locale,persistence:i,onSelect:Oe,onNewConversation:fe}):a(pe,{children:[a(uf,{state:ae,strings:_e}),z.strip?a(Qx,{strip:z.strip,onLogIn:z.onLogIn,onHide:z.onHidePrompt,strings:_e}):null,z.gate&&!M?null:a(tm,{messagesSig:$,reconnectingSig:I,pageToolRunning:e.pageToolRunning,strings:_e,notice:Lt,locale:t.locale,responseMode:t.responseMode,showReasoning:t.showReasoning,stepDisplay:t.stepDisplay,showSources:t.showSources,enableMessageFeedback:t.enableMessageFeedback,onFeedback:Tt,loading:h,onLoadPreviousMessages:k,idle:!p&&!m,controlMode:w,tool:Ee,onRetry:Ue,onCardAction:mt}),me,a(Kx,{disclaimer:t.composerDisclaimer}),V?a(ff,{transport:n,strings:_e,knownEmail:_f({tokenEmail:z.email,userContext:t.userContext}),onClose:()=>G(void 0)}):null]}),t.size.resize?.enabled?a(Na,{panelEl:ze,resize:t.size.resize,position:t.position,edge:t.mode==="drawer",initialSize:ie,onSizeChange:tt,onResizeStart:t.mode==="floating"&&c==="expanded"?Re:void 0,strings:_e}):null]})}function Vx({strings:e,onBack:t,onClose:n,showClose:r}){return a("header",{class:`${Se}-header`,part:"header",children:[a("button",{type:"button",class:`${Se}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:a(xo,{})}),a("h1",{children:e.historyTitle}),r?a("button",{type:"button",class:`${Se}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:a(wt,{})}):null]})}function Wx({controlMode:e,operatorName:t,operatorAvailable:n,onCancelOperatorRequest:r,strings:o}){let[i,s]=N(!1),l=Gx(e,t,n,o);function c(){r&&(s(!0),r().finally(()=>s(!1)))}return a("div",{class:`${Se}-operator-banner`,"data-mode":e,"data-available":n===!1?"false":void 0,"data-testid":L.operatorBanner,children:[a("span",{class:`${Se}-operator-pulse`,"aria-hidden":"true"}),a("span",{class:`${Se}-operator-label`,role:"status",children:l}),e==="awaiting-operator"&&r?a("button",{type:"button",class:`${Se}-icon-btn ${Se}-operator-dismiss`,onClick:c,disabled:i,"aria-label":o.cancelOperatorRequest,title:o.cancelOperatorRequest,"data-testid":L.cancelOperatorRequest,children:a(wt,{})}):null]})}function Gx(e,t,n,r){return e==="operator"?r.chattingWithOperator.replace("{operator}",t??""):n===!1?r.noOperatorAvailable:r.connectingOperator}function Kx({disclaimer:e}){return e?a("div",{class:`${Se}-composer-footer`,children:a("div",{class:`${Se}-disclaimer`,children:e})}):null}function Qx({strip:e,onLogIn:t,onHide:n,strings:r}){let o=e.kind==="user";return a("div",{class:`${Se}-login-bar`,"data-kind":e.kind,role:o?"status":"note","data-testid":o?L.loggedIn:L.loginBar,children:[a("span",{class:`${Se}-login-bar-icon`,"aria-hidden":"true",children:a(ln,{})}),o?a("span",{class:`${Se}-login-bar-text`,children:e.who?r.loggedInAs.replace("{name}",e.who):r.loggedIn}):a(pe,{children:[a("span",{class:`${Se}-login-bar-text`,children:r.loginPrompt}),a("button",{type:"button",class:`${Se}-login-bar-action`,onClick:t,"data-testid":L.loginBarAction,children:r.loginAction}),a("button",{type:"button",class:`${Se}-icon-btn ${Se}-login-bar-hide`,onClick:n,"aria-label":r.dismissLoginPrompt,title:r.dismissLoginPrompt,"data-testid":L.loginBarHide,children:a(wt,{})})]})]})}function Yx(e,t){return e.gate==="required"?t.loginRequired:e.canStartAsGuest?t.loginExpiredGuest:t.loginExpired}function Jx({login:e,alone:t,onStartAsGuest:n,strings:r}){return a("div",{class:`${Se}-login-gate`,"data-gate":e.gate,"data-alone":t?"":void 0,"data-testid":L.loginGate,children:[a("span",{class:`${Se}-login-gate-icon`,"aria-hidden":"true",children:a(ln,{})}),a("p",{class:`${Se}-login-gate-title`,role:"status",children:Yx(e,r)}),e.canLogIn||e.canStartAsGuest?a("div",{class:`${Se}-form-actions ${Se}-login-gate-actions`,children:[e.canStartAsGuest?a("button",{type:"button",class:`${Se}-form-skip`,onClick:n,"data-testid":L.loginGateGuest,children:r.startAsGuest}):null,e.canLogIn?a("button",{type:"button",class:`${Se}-form-submit`,onClick:e.onLogIn,"data-testid":L.loginGateAction,children:r.loginAction}):null]}):null]})}function rc({poweredBy:e,strings:t}){return e?a("div",{class:`${Se}-poweredby-bar`,children:a(Xx,{logoUrl:e.logoUrl,text:e.text??t.poweredBy.replace("{name}",O.displayName),href:e.href})}):null}function Xx({logoUrl:e,text:t,href:n}){let r=a(pe,{children:[e?a("img",{class:`${Se}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?a("span",{children:t}):null]});return n?a("a",{class:`${Se}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:r}):a("span",{class:`${Se}-poweredby`,children:r})}var Ba=O.cssPrefix;function am({panelProps:e,enabledModules:t,nav:n,bus:r,hasUnread:o,latestNews:i,onSelectConversation:s,onStartNewConversation:l,onSetPanelSize:c}){let u=e.options,p=u.strings,_=D(null),d=D(new Set);U(()=>{let j=_.current;if(!j||!e.onClose)return;let Y=Ir(j);function ie(K){K.key==="Escape"&&e.onClose?.()}return j.addEventListener("keydown",ie),()=>{Y(),j.removeEventListener("keydown",ie)}},[e.onClose]);let f=gt(()=>n.sig.value).value,v=Yp(f),m=u.modules.byId[f.activeTab],b=e.composerActive&&m?.layout==="chat"&&v===void 0,w=e.composerApiRef,y=b&&e.view==="chat"&&!e.sendPreparing&&e.options.features.fileUpload,P=F(j=>{y&&w.current?.attachFromDrop(j)},[w,y]),C=Da({containerRef:_,onDrop:P,accept:e.options.attachments.accept,disabled:!y});$a(_.current,u.mode==="modal");let x=v?.kind==="content",g=t.length>1&&Jp(f),h=D(null);U(()=>{if(x&&h.current===null)h.current=e.panelSize,e.panelSize==="normal"&&c("expanded");else if(!x&&h.current!==null){let j=h.current;h.current=null,c(j)}},[x]);let k={push:j=>n.push(j),pop:()=>n.pop(),switchTab:j=>n.switchTab(j),switchToLayout:j=>{let Y=t.find(ie=>ie.layout===j);Y&&n.switchTab(Y.id)},selectConversation:s,startNewConversation:l};function $(j){return{options:u,transport:e.transport,strings:p,config:j,nav:k,bus:r,panelProps:e,latestNews:i}}let I=a(Yt,{panelProps:e,variant:"plain"});m&&d.current.add(m.id);let B=t.filter(j=>d.current.has(j.id));function A(j){if(j.layout==="chat")return a(nc,{...e,composerActive:b,containerEl:_.current,dragOver:C});let Y=Ca[j.layout].Root;return Y?a(Y,{...$(j)}):null}function z(){return v?.kind==="content"?a($_,{id:v.id,title:v.title,transport:e.transport,strings:p,bus:r,onBack:()=>n.pop(),actions:I}):null}return a("div",{ref:_,class:`${Ba}-panel ${Ba}-messenger`,part:"panel",role:"dialog","aria-modal":"false","aria-label":p.panelTitle,style:{position:"relative"},"data-testid":L.messengerHome,children:[a("div",{class:`${Ba}-messenger-body`,children:[B.map(j=>a("div",{class:`${Ba}-messenger-pane`,hidden:x||j.id!==m?.id,children:A(j)},j.id)),z()]}),g?a(rf,{modules:t,activeTab:f.activeTab,strings:p,hasUnread:o,onSelect:j=>n.switchTab(j)}):null,a(rc,{poweredBy:u.poweredBy,strings:u.strings}),u.size.resize?.enabled&&!(m?.layout==="chat"&&!v)?a(Na,{panelEl:_.current,resize:u.size.resize,position:u.position,edge:u.mode==="drawer",initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,onResizeStart:u.mode==="floating"&&e.panelSize==="expanded"?e.onExpand:void 0,strings:p}):null]})}function sm(e){let t=O.cssPrefix,{site:n,blocks:r,strings:o,collapsed:i}=e,s=r?.navigation??[],l=r?.linkCards??[],c=i?o.expandSidebar:o.collapseSidebar;return a("aside",{class:`${t}-sidebar`,"data-collapsed":i?"true":"false","data-testid":L.sidebar,children:[a("div",{class:`${t}-sidebar-header`,children:[a(Zx,{site:n}),a("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":i?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":L.sidebarToggle,children:a(eS,{collapsed:i})})]}),i?null:a(pe,{children:[s.length>0?a("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:a(tS,{items:s})}):null,l.length>0?a("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:a(nS,{items:l})}):null,e.showConversations?a("div",{class:`${t}-sidebar-conversations`,children:a(Ta,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function Zx({site:e}){let t=O.cssPrefix;if(e?.logo?.url){let n=e.logo.alt??e.title??"Logo";return a("picture",{children:[e.logoDark?.url?a("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,a("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:n})]})}return a("div",{class:`${t}-sidebar-title`,children:e?.title??O.name})}function eS({collapsed:e}){return a("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?a("polyline",{points:"9 6 15 12 9 18"}):a("polyline",{points:"15 6 9 12 15 18"})})}function tS({items:e}){let t=O.cssPrefix;return a("ul",{class:`${t}-sidebar-nav`,children:e.map(n=>a("li",{children:a("a",{class:`${t}-sidebar-nav-item`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[n.icon?a("span",{class:`${t}-sidebar-nav-icon`,"data-icon":n.icon}):null,a("span",{class:`${t}-sidebar-nav-label`,children:n.label})]})},n.id??n.label))})}function nS({items:e}){let t=O.cssPrefix;return a("div",{class:`${t}-sidebar-cards`,children:e.map(n=>a("a",{class:`${t}-sidebar-card`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[a("div",{class:`${t}-sidebar-card-label`,children:n.label}),n.description?a("div",{class:`${t}-sidebar-card-desc`,children:n.description}):null]},n.id??n.label))})}var lm=O.cssPrefix;function cm(e){return a("main",{class:`${lm}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[a(sm,{site:e.site,blocks:e.blocks,transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,showConversations:e.showConversations,onSelectConversation:e.onSelectConversation,onNewConversation:e.onNewConversation,collapsed:e.sidebarCollapsed,onToggleCollapsed:e.onToggleSidebarCollapsed}),a("section",{class:`${lm}-page-chat`,"aria-label":e.strings.panelTitle,children:e.children})]})}var No=O.cssPrefix;function oc({strings:e,text:t,onClose:n}){return a("div",{class:`${No}-panel ${No}-panel-notice`,part:"panel",role:"dialog","aria-label":e.panelTitle,"data-testid":L.panelNotice,children:[n?a("button",{type:"button",class:`${No}-icon-btn ${No}-panel-notice-close`,onClick:n,"aria-label":e.close,title:e.close,children:a(wt,{})}):null,a("p",{class:`${No}-panel-notice-text`,children:t})]})}var $o=oe.scope("hitl");function Do(e){return e.kind==="tool"&&er(e.toolMetadata)&&(e.stateSig.value==="input-available"||e.stateSig.value==="approval-responded"&&e.approvalSig.value?.approved===!0)}function dm(e,t){t.errorSig.value=Yl(t.toolCallId),t.stateSig.value="output-error",e.partsSig.value=[...e.partsSig.value]}function um(e,t){let n=e.slice(0,e.indexOf(t)).findLast(r=>r.role==="user");return n!==void 0&&kt.sentHere(n.id)}function pm(e){let{streaming:t,controlModeSig:n,messagesSig:r,sendAiTurn:o,bus:i,humanInLoop:s,tools:l}=e,c=D(t);c.current=t;let u=D(l);u.current=l;let p=D(new Map),_=gt(()=>{let P=r.value,C=P.at(-1);return n.value!=="ai-agent"||C?.role!=="assistant"||C.status!=="complete"?!1:C.partsSig.value.some(x=>Do(x)&&kt.get(x.toolCallId)?.state!=="stopped")&&um(P,C)}).value,d=F((P,C,x)=>{if(c.current||n.value!=="ai-agent")return!1;let g=r.value.at(-1),h=g?.partsSig.value.findIndex(I=>I.kind==="tool"&&I.toolCallId===P)??-1,k=g?.partsSig.value[h];if(!g||k?.kind!=="tool")return $o.warn("decideTool: tool part not found",{toolCallId:P}),!1;if(g.status!=="complete"||!ta(g,h)||!C(k))return!1;if(x(k),g.partsSig.value=[...g.partsSig.value],!Yn(g)||g.partsSig.value.some(Do))return!0;g.status="streaming",g.retryAction={kind:"continue-assistant",messageId:g.serverMessageId??g.id},g.awaitingContinuation=!0,r.value=[...r.value];let $=g.partsSig.value.flatMap(I=>I.kind==="tool"?[I.toolCallId]:[]);return o({continueExisting:!0}).then(I=>I&&kt.clear($)),!0},[n,r,o]),f=F((P,C)=>{let{toolCallId:x,toolName:g}=C;p.current.has(x)||(p.current.set(x,P),Ef({toolCallId:x,toolName:g,input:C.inputSig.value,optionTools:u.current??[],onSettled:(h,k)=>{$o.info("toolResult",{toolCallId:x,status:h}),i.emit("toolResult",{toolCallId:x,name:$r(g),status:h,durationMs:k})}}).then(h=>{p.current.delete(x)&&d(x,Do,k=>{h.state==="output-available"?k.outputSig.value=h.output:k.errorSig.value=h.errorText,k.stateSig.value=h.state})}))},[i,d]),v=F(()=>{let P=r.value;for(let[g,h]of p.current){let k=P.findIndex($=>$.id===h);k<0||k===P.length-1||(p.current.delete(g),Lf(g))}let C=P.at(-1);if(c.current||C?.role!=="assistant"||C.status!=="complete")return;let x=C.partsSig.value.filter(Do);if(!(x.length===0||!um(P,C)))for(let g of x)kt.get(g.toolCallId)?.state==="stopped"?dm(C,g):f(C.id,g)},[r,f]);U(()=>v(),[t,v]),U(()=>r.subscribe(()=>v()),[r,v]);let m=F((P,C,x)=>{let g=!1,h;if(!d(P,I=>I.stateSig.value==="approval-requested",I=>{er(I.toolMetadata)&&(h=I),g=I.toolMetadata?.card==="questions";let B=I.approvalSig.value?.id??P;I.approvalSig.value={id:B,approved:C,reason:x},I.stateSig.value="approval-responded"}))return;let $=r.value.at(-1);if(h&&C&&$&&f($.id,h),h&&!C&&i.emit("toolResult",{toolCallId:P,name:$r(h.toolName),status:"declined",durationMs:0}),g){$o.info("toolResult",{toolCallId:P}),i.emit("toolResult",{toolCallId:P});return}$o.info("toolDecision",{toolCallId:P,approved:C}),i.emit("toolDecision",{toolCallId:P,approved:C})},[i,d,r,f]),b=F(P=>{d(P,C=>C.stateSig.value==="approval-responded"&&C.approvalSig.value?.approved!==void 0&&!Do(C),C=>{let x=C.approvalSig.value?.id??P;C.approvalSig.value={id:x},C.stateSig.value="approval-requested"})},[d]),w=xe(()=>({humanInLoop:s,onDecision:m,onEdit:b,preview:(P,C)=>If({toolName:P,input:C,optionTools:u.current??[]})}),[s,m,b]),y=F(()=>{let P=r.value.at(-1);for(let C of p.current.keys()){let x=P?.partsSig.value.find(g=>g.kind==="tool"&&g.toolCallId===C);P&&x?dm(P,x):Yl(C),$o.info("toolResult",{toolCallId:C,status:"stopped"}),i.emit("toolResult",{toolCallId:C,name:x?$r(x.toolName):void 0,status:"stopped",durationMs:0})}p.current.clear()},[i,r]);return{toolInteraction:w,pageToolsRunning:_,stopPageTools:y}}var rS=oe.scope("latest-news");function _m({transport:e,options:t,persistence:n,enabled:r}){let o=t.modules.list.find(_=>_.layout==="news")?.contentCollectionIds,i=o?.join(","),[s,l]=N(),[c,u]=N(()=>n.loadSeenNewsId());U(()=>{if(!r||!o?.length)return;let _=!1;return e.listContent({contentCollectionIds:o,sortBy:"publishedAt",sortOrder:"desc",limit:1}).then(d=>{_||l(d.items[0])}).catch(d=>rS.debug("listContent (latest news) failed (non-fatal)",{err:d})),()=>{_=!0}},[e,r,i]);let p=F(_=>{n.saveSeenNewsId(_),u(_)},[n]);return{item:s,unseen:s!==void 0&&s.id!==c,markSeen:p}}function fm({callout:e,persistence:t}){let n=e?.text??"",r=e?.persistent??!0,[o,i]=N(()=>r?!1:t.loadCalloutDismissed(n));U(()=>{i(r?!1:t.loadCalloutDismissed(n))},[n,r,t]);let s=F(()=>{i(!0),r||t.saveCalloutDismissed(n)},[t,n,r]);return{dismissed:o,dismissCallout:s}}var oS=oe.scope("login");function iS(e,t){switch(e.status){case"required":return"required";case"expired":return"expired";case"anonymous":return t?"required":void 0;case"pending":case"loggedIn":return;default:return e}}function aS(e,t,n){if(e.status==="loggedIn")return t.hideUser?void 0:{kind:"user",who:e.name??e.email};if(!(e.status!=="anonymous"||!t.url||t.hidePrompt||n))return{kind:"prompt"}}function mm(e){let{state:t,deployment:n,bus:r,persistence:o,conversationIdSig:i}=e,[s,l]=N(()=>o.loadLoginPromptDismissedIn()),c=gt(()=>i.value).value,u=s!==void 0&&s===c,p=(t.status==="required"?t.loginUrl:void 0)??n.url,_=iS(t,n.required),d=F(()=>{let m=Su(),b=r.listensTo("loginRequested");if(oS.info("loginRequested",{pageLogsIn:b}),r.emit("loginRequested",{returnTo:m}),b||!p)return;let w=i.value;w&&o.saveLoginReturn({conversationId:w,draft:o.loadDraft(w)}),o.savePanelOpen(!1),wu(bu(p,m))},[r,i,p,o]),f=F(()=>{let m=i.value;m&&(o.dismissLoginPromptIn(m),l(m))},[i,o]),v=!!p||r.listensTo("loginRequested");return{strip:aS(t,n,!!_||u),gate:_,canStartAsGuest:_==="expired"&&!n.required,email:t.status==="loggedIn"?t.email:void 0,canLogIn:v,onLogIn:d,menuLogIn:t.status==="anonymous"&&!_&&v?d:void 0,onHidePrompt:f}}function gm(e){let{transport:t,conversationIdSig:n}=e,r=Pt("ai-agent"),o=Pt(void 0),i=Pt(void 0),s=D(void 0),l=F(_=>{let d=_.controlRevision,f=s.current;if(f&&f.conversationId===n.value&&d<f.revision)return;s.current={conversationId:n.value,revision:d},r.value=_.controlMode;let v=_.assignedOperatorInitials;o.value=v?{initials:v,name:_.assignedOperatorName,avatar:_.assignedOperatorAvatar}:void 0,_.controlMode!=="awaiting-operator"?i.value=void 0:_.operatorAvailable!==void 0&&(i.value=_.operatorAvailable)},[n,r,o,i]),c=F(_=>{if(_.type!=="data-control-state")return;let d=Ji(_.data);d&&l(d)},[l]),u=F(async()=>{let _=n.value,d=await t.requestOperator();d&&n.value===_&&l(d)},[t,n,l]),p=F(async()=>{let _=n.value,d=await t.cancelOperatorRequest();d&&n.value===_&&l(d)},[t,n,l]);return{controlModeSig:r,assignedOperatorSig:o,operatorAvailableSig:i,applyControlState:l,adoptControlStateChunk:c,requestOperator:u,cancelOperatorRequest:p}}var Ua=O.cssPrefix,hm=`--${Ua}-visual-viewport-height`,vm=`--${Ua}-visual-viewport-top`;function bm(e){let{hostElement:t,mode:n,panelSize:r,isOpen:o,surfaceReady:i,onClose:s}=e;ut(()=>{vi(t,sa(n,r,o))},[t,o,r,n]),ut(()=>{if(!o||!i)return;let l=t.ownerDocument.defaultView,c=l?.visualViewport,u=t.shadowRoot?.querySelector(`.${Ua}-anchor`);if(!l||!c||!u)return;let p=()=>{u.style.setProperty(hm,`${c.height}px`),u.style.setProperty(vm,`${c.offsetTop}px`)},_=0,d=()=>{l.cancelAnimationFrame(_),_=l.requestAnimationFrame(()=>{_=l.requestAnimationFrame(p)})};return p(),c.addEventListener("resize",d),c.addEventListener("scroll",d),()=>{l.cancelAnimationFrame(_),c.removeEventListener("resize",d),c.removeEventListener("scroll",d),u.style.removeProperty(hm),u.style.removeProperty(vm)}},[t,o,i]),U(()=>{if(n!=="modal"||!o)return;function l(c){c.composedPath().some(p=>p instanceof HTMLElement&&p.classList.contains(`${Ua}-panel`))||s()}return t.addEventListener("click",l),()=>t.removeEventListener("click",l)},[t,o,n,s]),U(()=>{if(n!=="drawer"||!o)return;function l(c){c.key==="Escape"&&!c.composedPath().includes(t)&&s()}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,o,n,s])}var ic=oe.scope("reducer"),za=class{constructor(t,n){Z(this,"messagesSig",t);Z(this,"onReconcileNeeded",n);Z(this,"active",null);Z(this,"openTextParts",new Map);Z(this,"partSeq",0);Z(this,"replay",null);Z(this,"turnChunks",[]);Z(this,"turnRow",null)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.replay=null,this.openTextParts.clear()}beginReplay(t,n){let r=Qt();r.id=t.id;let o=nr(t)||Jn(t)&&(t.status!=="streaming"||Yn(t)),i=t.status==="streaming"&&Yn(t)&&go(t);this.replay={baseline:t,shadow:r,chunks:[n],probeContinuation:o,continuationTailReplay:i,liveCatchUp:t.status==="streaming"&&!o},this.attach(r),this.apply(n)}refreshReplayBaseline(){let t=this.replay;if(!t)return null;let n=t.shadow.serverMessageId??t.baseline.serverMessageId,r=this.messagesSig.value,o=r.at(-1),i=o===t.baseline||o?.id===t.baseline.id||n!==void 0&&o?.serverMessageId===n?o:r.find(l=>l===t.baseline)??r.find(l=>l.id===t.baseline.id||n!==void 0&&l.serverMessageId===n);if(!i)return this.detach(),null;if(i===t.baseline)return t;let s=t.baseline;return t.baseline=i,ym(s,i),t.liveCatchUp&&nr(t.shadow)&&(i.status==="streaming"||Jn(i))?(t.probeContinuation=!1,t.continuationTailReplay=!1,t):(t.probeContinuation=nr(i)||Jn(i)&&(i.status!=="streaming"||Yn(i)),t.continuationTailReplay=i.status==="streaming"&&Yn(i)&&go(i),t.liveCatchUp=i.status==="streaming"&&!t.probeContinuation,t)}refreshActive(){let t=this.active;if(!t)return null;let n=t.serverMessageId,r=this.messagesSig.value,o=r.at(-1),i=o===t||o?.id===t.id||n!==void 0&&o?.serverMessageId===n?o:r.find(l=>l===t)??r.find(l=>l.id===t.id||n!==void 0&&l.serverMessageId===n);if(!i)return this.detach(),null;if(i===t)return t;ym(t,i);let s=nr(t)&&Jn(i);return i.status!=="streaming"&&!s?(this.detach(),null):(this.replayTurn(),this.replay?this.replay.shadow:this.active)}replayTurn(){let[t,...n]=this.turnChunks;if(t?.type!=="start")return;let r=this.messagesSig.value.find(o=>o.serverMessageId===t.messageId);if(!(r===void 0||r===this.turnRow)){this.detach();for(let o of[t,...n])this.applyResume(o)}}promoteReplay(t){let{baseline:n,shadow:r}=t;return zt(()=>{n.role=r.role,n.serverMessageId=r.serverMessageId,n.operatorInitials=r.operatorInitials,n.status=r.status,r.canceled&&(n.canceled=!0),n.finishReason=r.finishReason,n.errorText=r.errorText,n.suggestions=r.suggestions??n.suggestions,n.runStartedAt=r.runStartedAt??n.runStartedAt,n.stepTimings=r.stepTimings??n.stepTimings,n.partsSig.value=r.partsSig.value,this.messagesSig.value=[...this.messagesSig.value]}),this.replay=null,this.active=n,n}promoteContinuation(t){let{baseline:n,chunks:r}=t,o=na(n);return this.replay=null,zt(()=>{n.partsSig.value=n.partsSig.value.slice(0,sS(n,r)+1),n.awaitingContinuation=!1,n.status="streaming",n.finishReason=void 0,n.errorText=void 0,n.suggestions=void 0,this.attach(n);for(let i of r)this.apply(i);n.continuationStreaming=o||void 0,this.messagesSig.value=[...this.messagesSig.value]}),n}settleOwnedContinuation(t,n){let{baseline:r}=t,o=na(r);return this.replay=null,zt(()=>{r.awaitingContinuation=!1,r.status="streaming",r.finishReason=void 0,r.errorText=void 0,r.suggestions=void 0,this.attach(r),this.apply(n),r.continuationStreaming=o||void 0,this.messagesSig.value=[...this.messagesSig.value]}),r}applyResume(t){t.type==="start"&&(this.turnChunks=[]);let n=this.applyTurnChunk(t);return this.turnChunks.push(t),this.turnRow=n??this.replay?.baseline??this.active??this.turnRow,n}applyTurnChunk(t){if(t.type==="start"){let o=(this.replay?.baseline??this.active)?.serverMessageId;o!==void 0&&t.messageId!==void 0&&o!==t.messageId&&this.onReconcileNeeded?.({messageId:o}),this.detach();let i=t.messageId,s=i!==void 0?this.messagesSig.value.find(p=>p.serverMessageId===i||p.id===i):void 0;if(s!==void 0)return t.messageMetadata?.senderRole==="visitor"&&s.role==="user"&&(s.status==="pending"||s.status==="error")&&(s.serverMessageId=i,s.status="complete",s.errorText=void 0,s.retryAction=void 0,this.messagesSig.value=[...this.messagesSig.value]),this.beginReplay(s,t),null;let l=t.messageMetadata?.senderRole,c=this.messagesSig.value.at(-1);if(l===void 0&&c?.role==="assistant"&&c.status==="streaming"&&c.serverMessageId===void 0&&!Vt(c))return this.attach(c),this.apply(t),null;let u=Qt();return this.attach(u),this.messagesSig.value=[...this.messagesSig.value,u],this.apply(t),null}if(this.replay){let r=this.refreshReplayBaseline();if(!r)return null;r.chunks.push(t),t.type==="data-control-state"&&(r.baseline.operatorRoutedTurn=t.data.controlMode!=="ai-agent"),this.apply(t);let{baseline:o,shadow:i,probeContinuation:s,continuationTailReplay:l,liveCatchUp:c}=r,u=t.type==="finish"||t.type==="error"||t.type==="abort";if(s){if(!dS(o,i,t)){if(u){if(o.status==="streaming"&&o.awaitingContinuation!==!0){let d=this.settleOwnedContinuation(r,t);return this.detach(),d}fS(o,i)&&(o.continuationStreaming=!0,this.messagesSig.value=[...this.messagesSig.value],this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id})),this.detach()}return null}let _=nr(o)&&u?this.settleOwnedContinuation(r,t):this.promoteContinuation(r);return u?(_.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:_.serverMessageId??_.id}):_.continuationStreaming=!1),this.detach(),_):null}if(l&&cS(o,i)){let _=this.promoteContinuation(r);return u?(this.detach(),_):null}if(!c)return u&&this.detach(),null;if(u&&!Vt(o)&&Vt(i)){let _=this.promoteReplay(r);return this.detach(),_}if(!lS(o,i))return u&&(this.onReconcileNeeded?.({messageId:o.serverMessageId??o.id}),this.detach()),null;let p=this.promoteReplay(r);return u?(this.detach(),p):null}let n=this.refreshActive();if(!n)return null;if(this.replay)return this.applyTurnChunk(t);if(this.apply(t),t.type==="finish"||t.type==="error"||t.type==="abort"){let r=n;return r.continuationStreaming&&(t.type==="finish"?this.onReconcileNeeded?.({messageId:r.serverMessageId??r.id}):r.continuationStreaming=!1),this.detach(),r}return null}ensureTextPart(t,n,r){let o=`${n}:${r}`,i=this.openTextParts.get(o);if(i)return i;let s={kind:n,id:`${r}#${this.partSeq++}`,textSig:re(""),doneSig:re(!1)};return this.openTextParts.set(o,s),Bo(t,s),s}apply(t){let n=this.active;if(n)switch(t.type){case"start":{t.messageId&&(n.serverMessageId=t.messageId);let r=t.messageMetadata;r?.runStartedAt&&(n.runStartedAt=r.runStartedAt),r?.senderRole==="operator"?(n.role="operator",r.operatorInitials&&(n.operatorInitials=r.operatorInitials)):r?.senderRole==="visitor"&&(n.role="user");return}case"finish-step":this.openTextParts.clear();return;case"start-step":Bo(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"message-metadata":n.stepTimings=Zi(t.messageMetadata?.steps)??n.stepTimings;return;case"finish":ic.debug("finish",{reason:t.finishReason}),n.stepTimings=Zi(t.messageMetadata?.steps)??n.stepTimings,n.status="complete",n.retryAction=void 0,t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":ic.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=void 0,this.bumpDone(n);return;case"abort":ic.debug("stream abort chunk (canceled)"),n.status="complete",n.canceled=!0,n.retryAction=void 0,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-input-error":case"tool-output-available":case"tool-output-error":case"tool-output-denied":case"tool-approval-request":case"tool-approval-response":mS(n,t);return;case"file":Bo(n,{kind:"file",url:t.url,mediaType:t.mediaType,filename:t.filename,fileId:t.fileId,fileSize:t.fileSize});return;case"source-url":Pm(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":Pm(n,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-suggestions":n.suggestions=Xi(t.data);return;case"data-control-state":n.operatorRoutedTurn=t.data.controlMode!=="ai-agent";return;case"data-memory-compaction-state":return;default:{let r=t}}}bumpDone(t){zt(()=>{t.partsSig.value=[...t.partsSig.value],this.messagesSig.value.includes(t)&&(this.messagesSig.value=[...this.messagesSig.value])})}};function nr(e){return e.awaitingContinuation===!0||e.continuationStreaming===!0||e.retryAction?.kind==="continue-assistant"}function ym(e,t){e.canceled&&(t.canceled=!0),!(!nr(e)||t.status!=="streaming"&&!Jn(t))&&(t.awaitingContinuation??(t.awaitingContinuation=e.awaitingContinuation),t.continuationStreaming??(t.continuationStreaming=e.continuationStreaming),t.retryAction===void 0&&(t.retryAction=e.retryAction))}function sS(e,t){let n=e.partsSig.value,r=t.findIndex(l=>l.type==="start-step"),o=new Set(t.slice(0,r<0?t.length:r).flatMap(l=>"toolCallId"in l&&l.type.startsWith("tool-output")?[l.toolCallId]:[])),i=n.findLastIndex(l=>l.kind==="tool"&&(l.stateSig.value==="approval-requested"||l.stateSig.value==="approval-responded"||o.has(l.toolCallId)));if(i>=0)return i;let s=new Set(t.flatMap(l=>l.type==="tool-input-start"||l.type==="tool-input-available"?[l.toolCallId]:[]));return n.some(l=>l.kind==="tool"&&s.has(l.toolCallId))?-1:n.findLastIndex(l=>l.kind==="tool")}function lS(e,t){let n=e.partsSig.value,r=t.partsSig.value;return e.role!==t.role||r.length<n.length?!1:n.every((o,i)=>xm(o,r[i]))}function cS(e,t){let n=e.partsSig.value,r=n.findLastIndex(l=>l.kind==="tool"),o=new Set(n.slice(0,r+1).flatMap(l=>l.kind==="tool"?[l.toolCallId]:[])),i=t.partsSig.value.filter(l=>l.kind!=="tool"||!o.has(l.toolCallId)),s=n.slice(r+1);return i.length<s.length?!1:s.every((l,c)=>xm(l,i[c]))}function xm(e,t){switch(e.kind){case"text":case"reasoning":return t?.kind===e.kind&&t.textSig.value.startsWith(e.textSig.value);case"step-start":return t?.kind==="step-start";case"tool":{if(t?.kind!=="tool"||t.toolCallId!==e.toolCallId||!ra(t.toolName,e.toolName)||Sr[t.stateSig.value]<Sr[e.stateSig.value])return!1;let n=e.approvalSig.value?.approved;return n===void 0||t.approvalSig.value?.approved===n}case"file":return t?.kind==="file"&&t.url===e.url&&t.mediaType===e.mediaType;case"source":return t?.kind==="source"&&t.sourceId===e.sourceId&&t.url===e.url&&t.title===e.title&&t.filename===e.filename&&t.mediaType===e.mediaType;default:return e}}function dS(e,t,n){return uS(e,n)||!pS(e,t)?!0:n.type!=="finish"&&n.type!=="error"&&n.type!=="abort"?!1:go(t)||e.awaitingContinuation===!0&&n.type!=="finish"?!0:e.awaitingContinuation===!0&&t.partsSig.value.every(r=>r.kind==="step-start")}function uS(e,t){if(t.type!=="tool-output-available"&&t.type!=="tool-output-error"&&t.type!=="tool-output-denied")return!1;let n=e.partsSig.value.find(r=>r.kind==="tool"&&r.toolCallId===t.toolCallId);return n!==void 0&&Sr[n.stateSig.value]<4}function pS(e,t){let n=t.partsSig.value;if(n.length===0)return!0;let r=e.partsSig.value;return r.some((o,i)=>n.every((s,l)=>_S(r[i+l],s)))}function _S(e,t){switch(t.kind){case"text":case"reasoning":return e?.kind===t.kind&&e.textSig.value.startsWith(t.textSig.value);case"step-start":return e?.kind==="step-start";case"tool":return e?.kind==="tool"&&e.toolCallId===t.toolCallId&&(t.toolName==="tool"||ra(e.toolName,t.toolName));case"file":return e?.kind==="file"&&e.url===t.url&&e.mediaType===t.mediaType;case"source":return e?.kind==="source"&&e.sourceId===t.sourceId&&e.url===t.url&&e.title===t.title&&e.filename===t.filename&&e.mediaType===t.mediaType;default:return t}}function fS(e,t){if(nr(e)||!Jn(e))return!1;let n=new Set(e.partsSig.value.filter(o=>o.kind==="tool").map(o=>o.toolCallId));return!t.partsSig.value.some(o=>o.kind==="tool"&&n.has(o.toolCallId))}function An(e,t,n={}){let r=e.partsSig.value.find(i=>i.kind==="tool"&&i.toolCallId===t);if(r)return n.dynamic&&(r.dynamic=!0),r.toolMetadata??(r.toolMetadata=n.toolMetadata),r.title=n.title??r.title,r;let o={kind:"tool",toolCallId:t,toolName:n.toolName??"tool",title:n.title,dynamic:n.dynamic?!0:void 0,toolMetadata:n.toolMetadata,inputPartialSig:re(""),inputSig:re(void 0),outputSig:re(void 0),errorSig:re(void 0),stateSig:re("input-streaming"),approvalSig:re(void 0)};return Bo(e,o),o}function Bo(e,t){e.partsSig.value=[...e.partsSig.value,t]}function Pm(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||Bo(e,t)}function mS(e,t){switch(t.type){case"tool-input-start":An(e,t.toolCallId,t);return;case"tool-input-delta":{let n=An(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=An(e,t.toolCallId,t);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-input-error":{let n=An(e,t.toolCallId,t);n.inputSig.value=t.input,n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-approval-request":{let n=An(e,t.toolCallId,t);if(t.isAutomatic){n.approvalSig.value={id:t.approvalId,isAutomatic:!0};return}n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-approval-response":{let n=e.partsSig.value.find(r=>r.kind==="tool"&&r.approvalSig.value?.id===t.approvalId);n?.approvalSig.value&&(n.approvalSig.value={...n.approvalSig.value,approved:t.approved,reason:t.reason});return}case"tool-output-available":{let n=An(e,t.toolCallId,t);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=An(e,t.toolCallId,t);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=An(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}async function Sm(e){let t=1e3,n=!1,r=!1,o=!1;function i(){o||e.signal.aborted||(o=!0,e.onInitialBoundaryReady())}for(;!e.signal.aborted;){let s,l="held";try{l=await e.connect(()=>{if(e.signal.aborted)return;s=e.now();let c=n||r;n=!0,r=!1,o?c&&e.backfill():i()})}catch{}if(e.signal.aborted||(!n&&s===void 0&&(r=!0,i()),l==="unavailable"))return;e.onDropped?.(),s!==void 0&&e.now()-s>=1e3&&(t=1e3),await e.sleep(t),t=Math.min(t*2,15e3)}}var gS=120;function wm(e){let{activated:t,conversationReady:n,paused:r,conversationIdSig:o,messagesSig:i,optionsRef:s,transport:l,visitorId:c,adoptControlStateChunk:u,adoptMemoryCompactionStateChunk:p,settleSuggestions:_,recordConversationReply:d,transcriptRecoverySig:f,beginConversationTranscript:v,commitConversationTranscript:m,runCancellation:b,feedback:w,bus:y,loadInitialThread:P,shouldReconcileOnConnect:C,reconnectingSig:x}=e,g=D(0);U(()=>{if(!t||!n||r||!o.value)return;let h=o.value,k=new AbortController,$=R=>{},I=new za(i,R=>$(R));l.primeIdentity(c,h);let B=!1,A=!1,z,j=!1,Y,ie=0,K,Te,Re=Date.now(),ye,Oe=!1,fe=!1,tt=!1,ht;function nt(R,G){if(!Vt(R))return;let V=i.value.findLast(me=>!me.ephemeral),ee=R.serverMessageId??R.id;if(!(V&&(V.serverMessageId??V.id)!==ee)){if(ye&&Oe&&!i.value.some(me=>me.role==="user"&&!me.ephemeral)){ht={replyId:ee,activityAt:G};return}return ea(i.value,R,h,s.current.strings.newConversation,G)}}function bt(R,G,V){let ee=nt(R,V);if(!ee)return;let le=`${R.serverMessageId??R.id}:${G}:${ee.preview??""}`;le!==Te&&(Te=le,l.publishConversation({...ee,hasUnread:!0},!0))}let Ee;function Ue(){Ee&&(clearTimeout(Ee.timer),Ee=void 0)}function Tt(){let R=Ee;if(!R)return;clearTimeout(R.timer),Ee=void 0;let G=i.value.find(V=>(V.serverMessageId??V.id)===R.replyId);G?.role!=="assistant"&&G?.role!=="operator"||bt(G,R.generation,R.activityAt)}function mt(R,G,V){Ue(),Ee={replyId:R.serverMessageId??R.id,generation:G,activityAt:V,timer:setTimeout(Tt,gS)}}function ze(R,G,V=Date.now(),ee=!0){Ue();let me=nt(R,V);if(!me)return;let ge=`${R.serverMessageId??R.id}:${G}`;ge!==K&&(K=ge,d(me),ee&&ye&&!Oe&&(fe=!0))}function ae(R,G){(R||!b.localSendRef.current)&&b.settle(G)}function ve(R,G=[],V=!1,ee,me=ie,le=Date.now(),ge=!0){let Ye=s.current;if(R.canceled){ze(R,me,le,ge),ae(V,ee);return}let $e=!0,rt=R.status==="error";switch(Ep(R,rt)){case"drop":i.value=i.value.filter(Be=>Be!==R),$e=!1;break;case"complete-operator-routed":R.status="complete",V&&(w.play("messageReceived"),Cr(y,Ye,"assistant",qe(R)));break;case"error":{if(R.status="error",V){w.play("error");let Be=new Error(rt?"stream error chunk":"empty reply");y.emit("error",Be),Ye.onError?.(Be)}break}case"complete":R.status="complete",V&&(w.play("messageReceived"),Cr(y,Ye,"assistant",qe(R))),_(R,G);break}$e&&ze(R,me,le,ge),ae(V,ee)}function _e(R){if(k.signal.aborted||o.value!==h)return;if(u(R),p?.(R),R.type==="start"){let ot=function(dt){return dt.role==="assistant"&&dt.retryAction?.kind==="resend-user"&&dt.retryAction.messageId===Ot};var Be=ot;Tt();let yt=R.messageId===void 0?void 0:i.value.find(dt=>dt.serverMessageId===R.messageId||dt.id===R.messageId);j=yt!==void 0&&yt.status!=="streaming";let Et=Y?.senderRole==="visitor"?Y.messageId:void 0;Y={messageId:R.messageId,senderRole:R.messageMetadata?.senderRole},ie+=1,Re=Date.now(),Te=void 0,B=R.messageMetadata?.senderRole===void 0,A=!1,z=B?R.messageMetadata?.runId:void 0;let Ot=B?R.messageMetadata?.senderMessageId:void 0;if(Ot&&i.value.some(ot)&&(i.value=i.value.filter(dt=>!ot(dt))),B){let dt=R.messageId!==void 0&&i.value.some(In=>In.serverMessageId===R.messageId||In.id===R.messageId),Bt=i.value.at(-1),rr=R.messageId!==void 0&&(Bt?.serverMessageId===R.messageId||Bt?.id===R.messageId),or=b.localSendRef.current&&(!dt||rr)&&Bt?.role==="assistant"&&Bt.status==="streaming"&&(rr||Bt.serverMessageId===void 0&&Bt.partsSig.value.length===0);A=b.captureStart(h,R,or,Et)}}let G=B&&(R.type==="finish"||R.type==="error"||R.type==="abort"),V=G?z:void 0,ee=G&&(A||b.ownsLocalRun(V)),me=ie,le=j;G&&(B=!1,A=!1,z=void 0);let ge=I.applyResume(R),Ye=Y?.messageId,$e=Ye===void 0?void 0:i.value.find(yt=>yt.serverMessageId===Ye||yt.id===Ye);j&&Y?.senderRole!=="visitor"&&(ge!==null||$e?.status==="streaming")&&(j=!1,le=!1);let rt=!j&&($e?.role==="assistant"||$e?.role==="operator");if(R.type==="text-delta"&&rt&&mt($e,ie,Re),R.type==="text-end"&&(Ue(),rt&&bt($e,ie,Re)),!ge){G&&(ee||!b.localSendRef.current)&&b.settle(V);return}if(ge.role==="operator"){le||(w.play("messageReceived"),Cr(y,s.current,"operator",qe(ge))),ze(ge,me,Re),j=!1,G&&(ee||!b.localSendRef.current)&&b.settle(V);return}ge.role==="assistant"&&(ve(ge,[],ee,V,me,Re),j=!1)}async function be(R){let G=ie,V=await l.loadConversation(h,R?{ids:[R]}:void 0).catch(()=>null);if(k.signal.aborted||o.value!==h||!V)return!1;V.controlState&&u({type:"data-control-state",data:V.controlState});let ee=i.value.at(-1),me=G===ie&&(R===void 0||ee!==void 0&&(ee.serverMessageId===R||ee.id===R));if(V.messages.length===0)return!0;let le=i.value,ge=R===void 0?le.at(-1):le.find(ot=>ot.serverMessageId===R||ot.id===R),Ye=ho(le,Sn(V.messages)),$e=Rp(V.messages),rt=Ye.messages.filter(ot=>!(ot.role==="assistant"&&ot.retryAction?.kind==="resend-user"&&$e.has(ot.retryAction.messageId)));if(!Ye.changed&&rt.length===Ye.messages.length)return!0;i.value=rt;let Be=R===void 0?rt.at(-1):rt.find(ot=>ot.serverMessageId===R||ot.id===R),yt=ge!==void 0&&Be!==void 0&&(ge.id===Be.id||ge.serverMessageId!==void 0&&ge.serverMessageId===Be.serverMessageId),Et=Be!==void 0&&Be.status!=="streaming"&&(!yt||ge?.status==="streaming"),Ot=yt&&ge?.status==="streaming"?Date.now():Be?.createdAt;return me&&Et&&Be.role==="assistant"?ve(Be,Be.suggestions??[],b.localSendRef.current,void 0,G,Ot,!1):me&&Et&&Be.role==="operator"?ze(Be,G,Ot,!1):me&&Be?.role==="assistant"&&Be.status!=="streaming"&&_(Be,Be.suggestions??[]),!0}let Ce=new Set;$=({messageId:R})=>{if(Ce.has(R)||!i.value.some(V=>V.serverMessageId===R||V.id===R))return;Ce.add(R);function G(){return Ce.delete(R)}be(R).then(G,G)};function Lt(){let R=ht;ht=void 0;let G=R&&i.value.find(ee=>(ee.serverMessageId??ee.id)===R.replyId),V=G&&nt(G,R.activityAt);V&&d(V)}function ct(R=!1){if(k.signal.aborted||o.value!==h){fe=!1;return}if(ye){fe=!0;return}let G=R?P(h):void 0,V=G??(!R||C()?be():void 0);if(!V)return;v(h),ye=V,Oe=G!==void 0;function ee(me=!1){if(ye===V){if(ye=void 0,I.replayTurn(),fe){fe=!1,ct();return}Lt(),me&&m(h)}}V.then(ee,()=>ee(!1))}let M=f.subscribe(R=>{R<=g.current||(g.current=R,tt&&ct())});return Sm({signal:k.signal,now:()=>performance.now(),sleep:R=>Xn(R,k.signal),connect:R=>l.connectResumeStream({signal:k.signal,onChunk:_e,onConnected:()=>{x.value=!1,R()}}),onDropped:()=>{x.value=!0},onInitialBoundaryReady:()=>{tt=!0,ct(!0)},backfill:()=>ct()}),()=>{k.abort(),x.value=!1,Ue(),M(),I.detach()}},[t,n,r,o,o.value,c,l,u,p,_,d,f,v,m,b,i,y,w,P,C,x])}var hS=32;function km(e){let{transport:t,setStreaming:n}=e,r=D(void 0),o=D(void 0),i=D(!1),s=D(void 0),l=D(!1),c=D(new Map),u=D(new Set),p=F((x,g)=>{let h=`${x}:${g}`;s.current!==h&&(s.current=h,t.cancelTurn(x,g))},[t]),_=F(x=>{r.current=void 0,o.current=x,i.current=!1,s.current=void 0,l.current=!0,n(!0)},[n]),d=F((x,g)=>{c.current.set(x,{messageId:g})},[]),f=F(x=>{if(x!==void 0){u.current.add(x);let g=u.current.values().next().value;u.current.size>hS&&g!==void 0&&u.current.delete(g)}x!==void 0&&r.current?.runId!==x||(r.current=void 0,o.current=void 0,i.current=!1,l.current=!1,n(!1))},[n]),v=F((x,g)=>o.current!==x?g.runId&&r.current?.runId===g.runId?(r.current={conversationId:g.conversationId,runId:g.runId},i.current&&p(g.conversationId,g.runId),!0):!1:(o.current=void 0,g.runId?(r.current={conversationId:g.conversationId,runId:g.runId},n(!0),i.current&&p(g.conversationId,g.runId),!0):(f(),!0)),[p,n,f]),m=F((x,g)=>{let h=c.current.get(x);return h?(c.current.delete(x),!g.runId||u.current.has(g.runId)?!0:h.runId!==void 0?(h.runId!==g.runId||r.current?.runId===g.runId&&(r.current={conversationId:g.conversationId,runId:g.runId},i.current&&p(g.conversationId,g.runId)),!0):(l.current||o.current||(r.current={conversationId:g.conversationId,runId:g.runId},o.current=void 0,i.current=!1,s.current=void 0,l.current=!0,n(!0)),!0)):!1},[p,n]),b=F(x=>o.current!==x?!1:(f(),!0),[f]),w=F(x=>{let g=c.current.get(x);return g?(c.current.delete(x),g.runId===void 0):!1},[]),y=F((x,g,h,k)=>{let $=g.messageMetadata?.runId;if(g.messageMetadata?.senderRole!==void 0||typeof $!="string"||!$||u.current.has($))return!1;if(r.current?.runId===$)return l.current;if(l.current)return r.current||!h?!1:(o.current=void 0,r.current={conversationId:x,runId:$},n(!0),i.current&&p(x,$),!0);let B=[...c.current.values()].filter(A=>A.runId===void 0).find(A=>A.messageId===k);return B?(B.runId=$,r.current={conversationId:x,runId:$},o.current=void 0,i.current=!1,s.current=void 0,l.current=!0,n(!0),!0):(o.current=void 0,r.current={conversationId:x,runId:$},n(!0),i.current&&p(x,$),l.current)},[p,n]),P=F(x=>typeof x=="string"&&r.current?.runId===x&&l.current,[]),C=F(()=>{let x=r.current;if(x)return i.current=!0,p(x.conversationId,x.runId),!0;let g=o.current;return g?(i.current=!0,g.then(h=>{h.runId&&p(h.conversationId,h.runId)}).catch(()=>{}),!0):!1},[p]);return xe(()=>({localSendRef:l,begin:_,beginRouted:d,acceptAck:v,acceptRoutedAck:m,reject:b,rejectRouted:w,captureStart:y,ownsLocalRun:P,settle:f,stop:C}),[v,m,_,d,y,P,b,w,f,C])}var vS=oe.scope("send");function Rm(e,t,n,r,o){e.publishConversation({...ea(t,n,r,o),hasUnread:!1},!0)}function Am(e,t){return e.id===t.id||(e.serverMessageId??e.id)===(t.serverMessageId??t.id)}function Im(e){return e.findLast(t=>!t.ephemeral&&t.role!=="system"&&(t.role==="user"||t.status!=="streaming"||Vt(t)))}function Uo(e,t,n,r,o){let i=Im(t);i?.role!=="user"||!Am(i,n)||Rm(e,t,i,r,o)}function Cm(e){return e instanceof Le&&e.status===404&&e.errorCode==="CONVERSATION_NOT_FOUND"}function Tm(e){return!(e instanceof Le)||e.code==="network"||e.status===void 0||e.status===202?!0:e.status===408||e.status===425||e.status===429||e.status>=500&&e.status<600}function Em(e){let{transport:t,messagesSig:n,conversationIdSig:r,options:o,bus:i,feedback:s,persistence:l,visitorId:c,adoptConversationId:u,applyControlState:p,setTicket:_,settleSuggestions:d,runCancellation:f,onConversationNotFound:v}=e,m=F(()=>{let y=r.value??Mt();return r.value||(r.value=y,l.saveConversationId(y)),y},[r,l]),b=F(async({continueExisting:y,turn:P,movedFromConversation:C=!1})=>{let x=m(),g=n.value.at(-1),h=P?[P]:wp(n.value,y),k=h[0];k?.role==="user"&&kt.markSent(k.id);let $=h.map(wl),I=l.loadUserPrefs(),B=Lo(o.tools).then(A=>t.sendTurn(bl({messages:$,conversationId:x,visitorId:c,userPrefs:I,clientTools:Ql(A)}),{keepalive:y}));f.begin(B);try{let A=await B;if(r.value!==x||!f.acceptAck(B,A))return!1;if(u(A.conversationId),_({conversationId:A.conversationId,reference:A.ticketReference}),A.runId&&k?.role==="user"&&Uo(t,n.value,k,A.conversationId,o.strings.newConversation),!A.runId){let z=await t.loadConversation(A.conversationId).catch(()=>null);if(r.value!==A.conversationId)return!0;if(z){z.controlState&&p(z.controlState);let j=Sn(z.messages),{messages:Y,changed:ie}=ho(n.value,j);ie&&(n.value=Y);let K=j.findLast(ye=>!ye.ephemeral&&ye.role!=="system"),Te=Im(n.value);Te&&K&&Am(Te,K)&&Rm(t,n.value,Te,A.conversationId,o.strings.newConversation);let Re=g?n.value.find(ye=>ye.id===g.id&&ye.role==="assistant"&&ye.status!=="streaming"):void 0;Re&&d(Re,Re.suggestions??[]),!y&&g?.role==="assistant"&&n.value.includes(g)&&g.serverMessageId===void 0&&!Vt(g)&&(n.value=n.value.filter(ye=>ye!==g))}else g?.role==="assistant"&&n.value.includes(g)&&(g.status="error",g.errorText=o.strings.errorGeneric,y?g.retryAction={kind:"continue-assistant",messageId:g.serverMessageId??g.id}:g.retryAction=k?.role==="user"?{kind:"resend-user",messageId:k.id}:null,n.value=[...n.value])}return!0}catch(A){if(r.value!==x)return!1;if(!f.reject(B))return k?.role==="user"&&Uo(t,n.value,k,x,o.strings.newConversation),!0;if(!y&&!C&&k?.role==="user"&&Cm(A))return v(k);if(!y&&k?.role==="user"&&A instanceof Le&&A.status===401){let ie=g?.role==="assistant"&&g.serverMessageId===void 0?g:void 0;return n.value=n.value.filter(K=>K!==k&&K!==ie),l.saveDraft(x,qe(k)),!1}let z=cn(A,o.strings),j=Tm(A),Y=P?.role==="assistant"?P:n.value.at(-1);if(y&&Y?.role==="assistant"&&A instanceof Le&&A.status===409){let ie=Y.serverMessageId??Y.id,K=await t.loadConversation(x,{ids:[ie]}).catch(()=>null);if(r.value!==x)return!1;if(K){K.controlState&&p(K.controlState);let Te=Sn(K.messages),Re=Te.find(ye=>(ye.serverMessageId??ye.id)===ie);if(Re&&Ap(Y,Re)){let{messages:ye,changed:Oe}=ho(n.value,Te),fe=ye.find(tt=>(tt.serverMessageId??tt.id)===ie);if(Oe&&fe&&fe!==Y)return fe.awaitingContinuation=!1,fe.continuationStreaming=void 0,fe.retryAction=null,n.value=ye,fe.status!=="streaming"&&d(fe,fe.suggestions??[]),!0}}if(!n.value.includes(Y)||Y.status!=="streaming")return!1;Y.continuationStreaming=!0}if(y&&Y?.role==="assistant")Y.status="error",Y.errorText=z,Y.retryAction=j?{kind:"continue-assistant",messageId:Y.serverMessageId??Y.id}:null,n.value=[...n.value];else if(g?.role==="assistant"&&n.value.includes(g)){g.status="error",g.errorText=z;let ie=h[0];g.retryAction=j&&ie?.role==="user"?{kind:"resend-user",messageId:ie.id}:null,n.value=[...n.value]}else{let ie=Qt();ie.status="error",ie.errorText=z;let K=h[0];ie.retryAction=j&&K?.role==="user"?{kind:"resend-user",messageId:K.id}:null,n.value=[...n.value,ie]}return s.play("error"),i.emit("error",A),o.onError?.(A),!1}},[t,n,o,i,s,l,c,u,p,_,d,m,f,v]),w=F(async y=>{let P=m();y.status="pending",y.errorText=void 0,y.retryAction=void 0,n.value.includes(y)&&(n.value=[...n.value]),kt.markSent(y.id);let C=[wl(y)],x=l.loadUserPrefs(),g=Lo(o.tools).then(h=>t.sendTurn(bl({messages:C,conversationId:P,visitorId:c,userPrefs:x,clientTools:Ql(h)})));f.beginRouted(g,y.id);try{let h=await g;return r.value!==P?(f.rejectRouted(g),!1):f.acceptRoutedAck(g,h)?(u(h.conversationId),_({conversationId:h.conversationId,reference:h.ticketReference}),Uo(t,n.value,y,h.conversationId,o.strings.newConversation),y.status==="pending"&&(y.status="complete",n.value.includes(y)&&(n.value=[...n.value])),!0):!1}catch(h){let k=f.rejectRouted(g);if(r.value!==P)return!1;if(!k)return Uo(t,n.value,y,P,o.strings.newConversation),y.status==="pending"&&(y.status="complete",n.value.includes(y)&&(n.value=[...n.value])),!0;if(y.status!=="pending")return Uo(t,n.value,y,P,o.strings.newConversation),!0;if(Cm(h))return v(y);vS.debug("operator-routed send failed",{error:h});let $=h instanceof Error?h:new Error(String(h));return y.status="error",y.errorText=cn(h,o.strings),y.retryAction=Tm(h)?{kind:"resend-user",messageId:y.id}:null,n.value.includes(y)&&(n.value=[...n.value]),s.play("error"),i.emit("error",$),o.onError?.($),!1}},[t,n,o,i,s,l,c,u,_,m,f,v]);return{sendAiTurn:b,sendRoutedTurn:w}}var bS=oe.scope("unread");function Mm(e){let{transport:t,options:n,conversationIdSig:r,isConversationVisibleRef:o,activated:i,conversationReady:s}=e,l=Pt(!1),c=Pt(0),u=Pt(0),p=D([]),_=D(void 0),d=D(!1),f=D(!1),v=F(()=>{let h=r.value,k=o.current()&&_.current===h?h:void 0,$=p.current.filter(I=>I.hasUnread&&I.conversationId!==k).length;c.value=$,l.value=$>0},[r,l,c,o]),m=F(h=>{let k=r.value,$=p.current.find(z=>z.conversationId===k),I=sn(p.current,h),B=I.find(z=>z.conversationId===k),A=h.type==="snapshot"&&k!==void 0&&B?.hasUnread===!0&&_.current===k&&$!==void 0&&$.lastMessageAt!==B.lastMessageAt;A&&(_.current=void 0),p.current=I,v(),A&&(u.value+=1)},[r,v,u]),b=F(()=>{if(v(),!o.current())return;let h=r.value;if(!h||_.current!==h)return;let k=p.current.find($=>$.conversationId===h);k?.hasUnread&&t.markRead(h,k.lastMessageAt)},[r,o,v,t]),w=F(h=>{r.value===h&&(_.current=void 0,v())},[r,v]),y=F(h=>{r.value===h&&(_.current=h,b())},[r,b]),P=F(h=>_.current===h,[]),C=F((h=!1)=>{if(!n.history.enabled||!n.modules.list.some($=>$.layout==="chat"))return;function k($){if(d.current){$&&(f.current=!0);return}d.current=!0,t.listConversations({limit:50},$).then(I=>{$||m({type:"snapshot",result:I,requestedRevision:0}),b()}).catch(I=>bS.debug("refreshUnread failed (non-fatal)",{err:I})).finally(()=>{d.current=!1,f.current&&(f.current=!1,k(!0))})}k(h)},[m,b,n.history.enabled,n.modules,t]),x=F(h=>{let k=h.conversationId,$=o.current()&&r.value===k&&_.current===k,I=p.current.find(A=>A.conversationId===k),B=$&&(I?.lastMessageAt!==h.lastMessageAt||I.hasUnread);t.publishConversation({...h,hasUnread:!$},!0),B&&t.markRead(k,h.lastMessageAt)},[r,o,t]);U(()=>t.subscribeConversationChanges(m),[m,t]);let g=D(!1);return U(()=>{!i||!s||g.current||(g.current=!0,C())},[i,s,C]),U(()=>{if(!i)return;function h(){document.visibilityState==="visible"&&(b(),C(!0))}return document.addEventListener("visibilitychange",h),()=>document.removeEventListener("visibilitychange",h)},[i,b,C]),{hasUnreadSig:l,unreadCountSig:c,transcriptRecoverySig:u,markVisibleConversationRead:b,beginConversationTranscript:w,commitConversationTranscript:y,isConversationTranscriptCommitted:P,recordConversationReply:x,refreshUnread:C}}var zo=oe.scope("settings");function Lm(e){let{options:t,persistence:n,transport:r,feedback:o,hostElement:i,bus:s}=e,l=n.loadUserPrefs(),[c,u]=N(()=>l.locale??t.locale),[p,_]=N(l.themeMode),d=Vr(t.themeMode,p),[f,v]=N(()=>l.textSize??t.textSize),m=F(x=>{n.patchUserPrefs(x),r.saveUserPrefs(n.loadUserPrefs()).catch(g=>zo.warn("saveUserPrefs failed",{err:g}))},[n,r]);U(()=>{l.soundMuted!==void 0&&o.setMuted(l.soundMuted)},[]),U(()=>{if(d!=="host"){i.dataset.theme=d;return}return Nd(x=>{i.dataset.theme=x})},[i,d,t]),U(()=>{i.dataset.textSize=f},[i,f,t]),U(()=>{let x=!0;return o.mutedSig.subscribe(g=>{if(x){x=!1;return}m({soundMuted:g})})},[o,m]);let b=mr(c,t.availableLocales,t.defaultLocale);U(()=>{r.setLocale(b)},[r,b]),U(()=>{i.dir=si(b)?"rtl":"ltr"},[i,b]),U(()=>{b!==c&&u(b)},[b,c]);let w=F(x=>{zo.info("localeChange",{locale:x}),u(x),m({locale:x}),s.emit("localeChange",x)},[m,s]),y=F(x=>{zo.info("themeChange",{mode:x}),_(x),i.dataset.theme=x,m({themeMode:x}),s.emit("themeChange",x)},[i,m,s]),P=F(x=>{zo.info("textSizeChange",{size:x}),v(x),i.dataset.textSize=x,m({textSize:x}),s.emit("textSizeChange",x)},[i,m,s]),C=F(()=>{o.toggleMuted();let x=o.mutedSig.value;zo.info("soundToggle",{muted:x}),s.emit("soundToggle",{muted:x})},[o,s]);return{activeLocale:c,activeThemeMode:d,activeTextSize:f,setActiveLocale:u,setActiveThemeMode:_,setActiveTextSize:v,patchAndSync:m,handleLocaleChange:w,handleThemeChange:y,handleTextSizeChange:P,handleSoundToggle:C}}var we=oe.scope("app"),Fo=O.cssPrefix,yS={home:"home",chats:"chat",help:"help",news:"news"};function Nm({options:e,hostElement:t,bus:n,recentHostEvents:r,loginRevision:o=0,onPersonChanged:i,onStartAsGuest:s}){let l=e.aiAgentDeploymentId;if(!l)throw new Error("aiAgentDeploymentId is required");let[c]=N(()=>gr(e.widgetId,e.storage,e.aiAgentDeploymentId)),[u,p]=N(()=>c.getVisitorId()),_=c.loadUserPrefs(),d=Pt(c.loadConversationId()),f=D(d.value!==void 0),v=Pt(d.value??""),m=Pt([]),b=Pt(!1),[w,y]=N(!1),P=D(void 0);function C(){let S=e.modules.list,E=new Set(S.map(te=>te.id)),J=c.loadActiveModule();return J&&E.has(J)?J:S[0]?.id??""}function x(){return e.modules.list.find(S=>S.layout==="chat")?.id}function g(){let S=x();return S?e.modules.list.length===1?!0:k.sig.value.activeTab===S:!1}let h=D(void 0);if(!h.current){let S=e.modules.list.map(J=>J.id),E=c.loadActiveModule()??S[0]??"";h.current=Kp(E,E?[...S,E]:S,J=>c.saveActiveModule(J))}let k=h.current,$=gt(()=>k.sig.value.activeTab).value,I=gt(()=>d.value).value,[B,A]=N(!1),[z,j]=N(!1),Y=e.mode==="standalone"||e.mode==="inline",ie=D(Po(e,Tr(),c.loadPanelOpen(),c.loadPanelSize())),[K,Te]=N(ie.current.panelOpen),[Re,ye]=N(ie.current.panelOpen),Oe=D(void 0),fe=D(void 0),tt=D(!1),ht=D(void 0),nt=D(e.strings),bt=D(void 0);U(()=>{K&&ye(!0)},[K]);let Ee=D(!1),[Ue,Tt]=N(!1),mt=D(null),ze=D(!1),{dismissed:ae,dismissCallout:ve}=fm({callout:e.launcher.callout,persistence:c}),_e=e.launcher.callout?.persistent??!0,be=F(()=>{we.info("calloutDismiss"),n.emit("calloutDismiss",void 0),ve()},[n,ve]),[Ce,Lt]=N(ie.current.panelSize),ct=D(!1),[M,R]=N("chat"),G=D(()=>!1);G.current=()=>K&&M==="chat"&&!document.hidden&&g();let[V,ee]=N(!1),me=D(V);me.current=V;let le=D(null),[ge,Ye]=N(!1),$e=Pt(new Map),rt=F((S,E)=>{let J=new Map($e.value);E?J.set(S,E):J.delete(S),$e.value=J},[$e]),[Be,yt]=N(null),[Et,Ot]=N(),[ot,dt]=N([]),Bt=D(e);Bt.current=e;let[rr,or]=N(void 0),[In,ir]=N(void 0),[En,qo]=N(()=>c.loadSidebarCollapsed()??!1),[Mn,ar]=N({status:"anonymous"}),[qa,Ho]=N({}),[q,Q]=N(),[W]=N(()=>new ia({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:au({publicKey:e.publicKey,aiAgentDeploymentId:l,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints,recentHostEvents:r,onLoginState:ar,continueLink:e.continueLink})),[ce]=N(()=>new Ai(e.sound,e.haptics)),Me=km({transport:W,setStreaming:ee}),{activeLocale:vt,activeThemeMode:Xt,activeTextSize:Zt,setActiveLocale:Rt,setActiveThemeMode:Ha,setActiveTextSize:Bm,patchAndSync:sc,handleLocaleChange:Um,handleThemeChange:zm,handleTextSizeChange:Fm,handleSoundToggle:qm}=Lm({options:e,persistence:c,transport:W,feedback:ce,hostElement:t,bus:n}),{controlModeSig:Gt,assignedOperatorSig:Hm,operatorAvailableSig:jm,applyControlState:Br,adoptControlStateChunk:Vm,requestOperator:Wm,cancelOperatorRequest:Gm}=gm({transport:W,conversationIdSig:d}),un=Pt(new Map),Km=F(S=>{if(S.type!=="data-memory-compaction-state")return;let E=d.value;if(!E)return;let J=xp(S.data);if(!J)return;let te=un.value.get(E);if(te&&(J.postFinishSequence<te.postFinishSequence||J.postFinishSequence===te.postFinishSequence&&(te.status==="ready"||te.status===J.status)))return;let de=new Map(un.value);de.set(E,J),un.value=de},[d,un]),{hasUnreadSig:Qm,unreadCountSig:lc,transcriptRecoverySig:Ym,markVisibleConversationRead:cc,beginConversationTranscript:ja,commitConversationTranscript:sr,isConversationTranscriptCommitted:dc,recordConversationReply:Jm,refreshUnread:Xm}=Mm({transport:W,options:e,conversationIdSig:d,isConversationVisibleRef:G,activated:Re,conversationReady:B}),Va=mm({state:Mn,deployment:qa,bus:n,persistence:c,conversationIdSig:d}),Zm=K&&e.modules.byId[$]?.layout==="home",eg=_m({transport:W,options:e,persistence:c,enabled:B&&Zm});U(()=>{cc()},[$,K,M,I,cc]),U(()=>{ce.update(e.sound,e.haptics)},[ce,e.sound,e.haptics]),U(()=>()=>ce.destroy(),[ce]),U(()=>{ct.current||!e.size.initialSize||(ct.current=!0,!c.loadPanelSize()&&Lt(Ll(e.mode,e.size,Tr())))},[e.mode,e.size,c]),U(()=>{if(!B||Ee.current)return;Ee.current=!0;let S=Po(e,Tr(),c.loadPanelOpen(),c.loadPanelSize());Te(S.panelOpen),Lt(S.panelSize)},[B,e,c]);let lr=D(null);U(()=>{B&&k.reconcile(e.modules.list.map(S=>S.id),C())},[B,e.modules.list,k]);let jo=F(S=>{!S||S.length===0||(m.value=S.map(E=>xl({...E,text:at(nt.current,E.text)})))},[m]),Ur=D(0),en=D(0),Wa=F(S=>{if(S===d.value)return;let E=d.value;en.current++,y(!1),E&&(c.saveDraft(S,c.loadDraft(E)),c.saveDraft(E,""),c.saveMessageQueue(S,c.loadMessageQueue(E)),c.saveMessageQueue(E,[])),d.value=S,c.saveConversationId(S),W.primeIdentity(void 0,S),we.info("conversation rebound",{previous:E,current:S}),E&&n.emit("conversationRebound",{previous:E,current:S})},[n,d,c,W]),Vo=F(S=>{let E=S.map(de=>de.createdAt).filter(de=>de!==void 0),J=(E.length?Math.min(...E):Date.now())-1;return[...(ht.current?.messages??[]).map(de=>{let X=xl({...de,text:at(nt.current,de.text)});return X.createdAt=J,X}),...S]},[]),uc=F(async S=>{let E=en.current;function J(){return E!==en.current||d.value!==S}fe.current===S&&(fe.current=void 0),y(!0);try{let te=await W.loadConversation(S);if(J())return!1;let de=Sn(te.messages),X=Vo(Rl(de,m.value));if(m.value=X,fe.current=X.some(ke=>ke.role==="user")?void 0:S,de.length>0||te.controlState!==void 0){Ot({conversationId:S,reference:te.ticketReference}),te.controlState&&Br(te.controlState);let ke=de.findLast(Ne=>Ne.role==="assistant"&&!Ne.ephemeral);dt(ke?.suggestions??[])}return!0}catch(te){return J()||(we.warn("loadThread failed; keeping conversation active",{err:te,conversationId:S}),n.emit("error",te),Bt.current.onError?.(te)),!1}finally{J()||y(!1)}},[W,m,d,Vo,n]),tg=F(S=>{if(Oe.current===S)return Oe.current=void 0,uc(S)},[uc]),ng=F(()=>{if(P.current)return Promise.resolve(void 0);let S=d.value,E=m.value.find(se=>se.serverMessageId!==void 0),J=E?.serverMessageId,te=E?new Date(E.createdAt).toISOString():void 0;if(!S||!J||!te)return Promise.resolve(void 0);let de=en.current,X={};return P.current=X,(async()=>{try{let se=await W.loadConversation(S,{beforeId:J,beforeCreatedAt:te});if(P.current!==X||en.current!==de||d.value!==S)return;if(se.messages.length===0)return!1;let ke=se.messages.map(Sl),Ne=m.value,nn=Cp(Ne,ke);if(nn!==Ne){let je=Math.min(...ke.map(De=>De.createdAt??1/0));if(Number.isFinite(je))for(let De of Ne){if(!De.ephemeral)break;(De.createdAt??1/0)>=je&&(De.createdAt=je-1)}m.value=nn}return!0}catch(se){if(P.current!==X||en.current!==de||d.value!==S)return;we.warn("load previous messages failed",{err:se,conversationId:S,beforeId:J}),n.emit("error",se),e.onError?.(se);return}finally{P.current===X&&(P.current=void 0)}})()},[n,d,m,e,W]),cr=F(async({newConversation:S})=>{let E=++Ur.current;function J(){return E!==Ur.current}if(!S){let je=await W.userSub(),De=c.loadLastUserSub();if(J())return;if(De&&De!==je){i?.();return}je&&c.saveLastUserSub(je)}let te=d.value,de=S||!te?Mt():te;de!==te&&(en.current++,y(!1),zt(()=>{d.value=de,v.value=de}),c.saveConversationId(de)),W.primeIdentity(u,de);let X;try{X=await W.handshake({visitorId:u,conversationId:de,userPrefs:c.loadUserPrefs(),locale:vt})}catch(je){if(J())return;n.emit("error",je),e.onError?.(je);let De=je instanceof Le&&je.errorCode?xS[je.errorCode]:void 0;if(De){we.warn(`the widget is not shown: ${De}`),(Y||e.mode==="page")&&j(!0);return}S||A(!0);return}if(J())return;e.continueLink&&X.visitorId!==u&&p(X.visitorId),X.conversationId!==de&&Wa(X.conversationId),bt.current=X;let se=$n(X,vt);yt(se.agent),Ho(Ii(X.config?.login));let ke=X.config?.maxMessageCharacters;Q(typeof ke=="number"&&ke>0?ke:void 0),se.site&&zs(se.site)?or(se.site):se.site&&we.warn("invalid site config, using fallback",{site:se.site}),se.blocks&&Fs(se.blocks)?ir(se.blocks):se.blocks&&we.warn("invalid blocks config, using fallback",{blocks:se.blocks});let Ne=Rs(X.userPrefs);if(Object.keys(Ne).length>0&&!S&&(c.saveUserPrefs(Ne),Ne.locale&&Rt(Ne.locale),Ne.soundMuted!==void 0&&ce.setMuted(Ne.soundMuted),Ne.themeMode&&Ha(Ne.themeMode),Ne.textSize&&Bm(Ne.textSize)),ht.current=se.welcome,S||n.emit("handshake",X),se.welcome?.suggestions){let je=nt.current;dt(se.welcome.suggestions.map(De=>({...De,label:at(je,De.label),...De.text===void 0?{}:{text:at(je,De.text)}})))}let nn=!S&&(X.conversationId===te||e.continueLink!==void 0);f.current=nn,nn?tt.current||(Oe.current=X.conversationId):(fe.current=X.conversationId,jo(se.welcome?.messages),sr(X.conversationId)),S||A(!0)},[W,u,c,e,n,d,v,ce,jo,vt,Wa,sr,i]),zr=JSON.stringify(e.userContext??null),rg=JSON.stringify(e.pageContext??null);U(()=>{W.setContext(e.userContext,PS(e.pageContext))},[W,zr,rg]);let pc=D(!1);U(()=>{if(W.setUserToken(e.userToken),!pc.current){pc.current=!0;return}cr({newConversation:!1}).then(()=>{Re&&Xm(!0)})},[W,e.userToken,o]);let _c=F((S,E=[])=>dt(S.suggestions??E),[]);U(()=>(W.primeIdentity(u,d.value),cr({newConversation:!1}),()=>{Ur.current++,en.current++}),[]),U(()=>{!Re||!B||tt.current||(tt.current=!0,Oe.current===d.value&&y(!0))},[Re,B]);let fc=D(zr);U(()=>{!B||fc.current===zr||(fc.current=zr,cr({newConversation:!1}))},[zr,B,cr]);let mc=D(async()=>!1),{sendAiTurn:tn,sendRoutedTurn:dr}=Em({onConversationNotFound:S=>mc.current(S),transport:W,messagesSig:m,conversationIdSig:d,options:e,bus:n,feedback:ce,persistence:c,visitorId:u,adoptConversationId:Wa,applyControlState:Br,setTicket:Ot,settleSuggestions:_c,runCancellation:Me}),{toolInteraction:og,pageToolsRunning:Ga,stopPageTools:gc}=pm({streaming:V,controlModeSig:Gt,messagesSig:m,sendAiTurn:tn,bus:n,humanInLoop:e.features.humanInLoop,tools:e.tools}),ig=F((S,E)=>{let J=m.value.find(te=>te.serverMessageId===S);J&&(J.feedback=E),we.info("messageFeedback",{messageId:S,value:E}),n.emit("messageFeedback",{messageId:S,value:E}),W.submitFeedback({messageId:S,value:E})},[n,m,W]),ag=F(()=>f.current||m.value.some(S=>!S.ephemeral&&S.role==="user"),[m]);wm({activated:Re,conversationReady:B,paused:Mn.status==="pending"||Mn.status==="expired",conversationIdSig:d,messagesSig:m,optionsRef:Bt,transport:W,visitorId:u,adoptControlStateChunk:Vm,adoptMemoryCompactionStateChunk:Km,settleSuggestions:_c,recordConversationReply:Jm,transcriptRecoverySig:Ym,beginConversationTranscript:ja,commitConversationTranscript:sr,runCancellation:Me,feedback:ce,bus:n,loadInitialThread:tg,shouldReconcileOnConnect:ag,reconnectingSig:b});let ur=F(async(S,E,J)=>{if(le.current||Va.gate)return!1;let te=d.value,de=te?un.value.get(te):void 0,X=Gt.value!=="ai-agent";if(!X&&de?.status==="compacting"||(we.info("send",{textLen:S.length,attachments:E.length,streaming:me.current,routedToOperator:X}),me.current&&!X))return!1;let se=new AbortController,ke={conversationId:te,controller:se};le.current=ke,Ye(!0);try{ce.unlock(),$e.value=new Map;let Ne=await wS(W,E,se.signal,rt,ts=>{se.signal.aborted||(we.warn("upload failed",{err:ts}),n.emit("error",ts),e.onError?.(ts))});if(se.signal.aborted||d.value!==te)return!1;let nn=te?un.value.get(te):void 0,je=Gt.value!=="ai-agent";if(!je&&nn?.status==="compacting"||me.current&&!je||!J&&Ne.length<E.length||!S&&Ne.length===0)return!1;n.emit("send",{text:S,attachmentCount:E.length}),ot.length>0&&dt([]),ce.play("messageSent");let De=Pl(S,Ne,J);return Cr(n,e,"user",S),je?(m.value=[...m.value,De],J?await dr(De):(dr(De),!0)):(m.value=[...m.value,De,Qt()],J?await tn({continueExisting:!1}):(tn({continueExisting:!1}),!0))}finally{le.current===ke&&(le.current=null,Ye(!1))}},[W,n,e,ot.length,m,d,un,tn,dr,Gt,$e,rt,Va.gate]),Ka=D(ur);Ka.current=ur;let hc=d.value,vc=(hc?un.value.get(hc):void 0)?.status==="compacting",Wo=Gt.value==="ai-agent",sg=gt(()=>{let S=m.value.at(-1);return S?.role==="assistant"&&S.partsSig.value.some(E=>E.kind==="tool"&&(E.stateSig.value==="approval-requested"||E.stateSig.value==="approval-responded"))}),bc=gt(()=>m.value.some(S=>S.retryAction?.kind==="resend-user"||S.retryAction?.kind==="continue-assistant"));ut(()=>{let S=d.value;return()=>{let E=le.current;!E||E.conversationId!==S||(le.current=null,Ye(!1),E.controller.abort())}},[d.value]);let lg=F(()=>{if(le.current){we.info("stop uploads"),le.current.controller.abort();return}if(Ga){we.info("stop page tools"),n.emit("stop",void 0),gc();return}if(!Me.stop())return;we.info("stop"),n.emit("stop",void 0);let S=m.value.at(-1);S&&S.role!=="user"&&S.status==="streaming"&&(S.canceled=!0,m.value=[...m.value])},[Me,n,m,Ga,gc]),cg=F(S=>{we.info("card action",{text:S}),Ka.current(S,[])},[]),dg=F(S=>{if(V)return;let E=m.value,J=oa(E,S);if(J)switch(we.info("retry",{kind:J.kind,messageId:J.messageId}),J.kind){case"continue-assistant":{if(Gt.value!=="ai-agent"||S.role!=="assistant"||(S.serverMessageId??S.id)!==J.messageId)return;S.status="streaming",S.errorText=void 0,S.retryAction=void 0,S.awaitingContinuation=!0,m.value=[...E],tn({continueExisting:!0,turn:S});return}case"resend-user":{let te=E.find(se=>se.role==="user"&&se.id===J.messageId);if(!te)return;let de=se=>{se&&lr.current?.acceptQueuedMessage(J.messageId)};if(te.status="complete",te.errorText=void 0,te.retryAction=void 0,Gt.value!=="ai-agent"){m.value=S.role==="assistant"?E.filter(se=>se!==S):[...E],dr(te).then(de);return}let X=Qt();m.value=S.role==="assistant"?E.map(se=>se===S?X:se):[...E,X],tn({continueExisting:!1,turn:te}).then(de);return}case"repeat-user":{let te=E.find(ke=>ke.role==="user"&&ke.id===J.messageId);if(!te)return;let de=Pl(qe(te),te.attachments?.map(ke=>({...ke}))??[]),X=new Set(de.attachments?.flatMap(ke=>ke.url?[ke.url]:[])??[]),se=te.partsSig.value.flatMap(ke=>ke.kind==="file"&&!X.has(ke.url)?[{...ke}]:[]);if(se.length>0&&(de.partsSig.value=[...de.partsSig.value,...se]),Gt.value!=="ai-agent"){m.value=[...E,de],dr(de);return}m.value=[...E,de,Qt()],tn({continueExisting:!1,turn:de});return}default:return J}},[V,m,Gt,tn,dr]),Go=F(()=>{if(Wp(e.mode,Ce)==="exit-fullscreen"){we.info("close \u2192 exit-fullscreen",{mode:e.mode}),Lt("normal"),n.emit("fullscreen",!1);return}we.info("close \u2192 panel closed",{mode:e.mode}),ze.current=t.contains(t.ownerDocument.activeElement),Te(!1),c.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,c,Ce,t]);bm({hostElement:t,mode:e.mode,panelSize:Ce,isOpen:K,surfaceReady:B,onClose:Go}),U(()=>{K||!ze.current||(ze.current=!1,mt.current?.focus())},[K]);let Fr=F(()=>{we.info("open",{mode:e.mode}),ce.unlock(),Tt(!0),Te(!0),c.savePanelOpen(!0),!ae&&!_e&&be(),setTimeout(()=>Tt(!1),SS),n.emit("open",void 0),e.onOpen?.()},[n,e,ce,c,ae,_e,be]),Ko=F(()=>{let S=m.value.some(E=>E.role==="user");if(fe.current===d.value&&!S&&d.value){we.info("clear \u2192 reusing empty conversation",{conversationId:d.value}),m.value.length===0&&jo(ht.current?.messages);return}return we.info("clear \u2192 new conversation",{wasStreaming:V}),n.emit("clear",void 0),Me.settle(),f.current=!1,Oe.current=void 0,fe.current=void 0,zt(()=>{m.value=[],d.value=void 0,Br({controlMode:"ai-agent",controlRevision:0})}),c.clearConversation(),dt([]),cr({newConversation:!0})},[V,m,d,c,cr,n,jo,Me,Br]);mc.current=async S=>(we.info("conversation not found \u2192 new conversation",{messageId:S.id}),await Ko(),S.status="complete",S.errorText=void 0,S.retryAction=void 0,m.value=[...m.value,S,Qt()],tn({continueExisting:!1,turn:S,movedFromConversation:!0}));let Qo=F(()=>{let S=Ko();R("chat");let E=e.modules.list.find(J=>J.layout==="chat")?.id;return E&&k.switchTab(E),S},[Ko,k,e]),ug=F(async S=>{await Qo(),await Ka.current(S,[])||lr.current?.fill(S)},[Qo]),Qa=F(()=>{let S=Ce==="expanded"?"normal":"expanded";we.info("expand",{from:Ce,expanded:S==="expanded"}),Lt(S),c.savePanelSize(S),n.emit("expand",S==="expanded")},[n,Ce,c]),Ya=F(()=>{let S=Ce==="fullscreen"?"normal":"fullscreen";we.info("fullscreen",{from:Ce,fullscreen:S==="fullscreen"}),Lt(S),c.savePanelSize(S),n.emit("fullscreen",S==="fullscreen")},[n,Ce,c]),pg=F(()=>{R(S=>{let E=S==="history"?"chat":"history";return we.info("toggleHistory",{view:E}),n.emit("toggleHistory",{view:E}),E})},[n]),_g=F(()=>{qo(S=>{let E=!S;return we.info("sidebarToggle",{collapsed:E}),c.saveSidebarCollapsed(E),n.emit("sidebarToggle",{collapsed:E}),E})},[c,n]),fg=F(S=>{we.info("resize",S),sc({widgetSize:S}),n.emit("resize",S)},[sc,n]),mg=F(async S=>{let E=S.conversationId;if(E===d.value&&dc(E)){we.info("selectConversation",{conversationId:E,cached:!0}),n.emit("selectConversation",{conversationId:E}),W.publishConversation(S),R("chat");let X=x();X&&k.switchTab(X),sr(E);return}let te=++Ur.current;en.current++,y(!1);function de(){return te!==Ur.current}we.info("selectConversation",{conversationId:E,wasStreaming:V}),n.emit("selectConversation",{conversationId:E}),W.publishConversation(S);try{let X=await W.loadConversation(E);if(de())return;Me.settle(),f.current=!0,Oe.current=void 0;let se=Sn(X.messages),ke=X.conversationId!==d.value,Ne=ke?se:Rl(se,m.value);fe.current=Ne.some(De=>De.role==="user")?void 0:X.conversationId,zt(()=>{m.value=Vo(Ne),ke&&(v.value=X.conversationId),d.value=X.conversationId}),c.saveConversationId(X.conversationId),W.primeIdentity(u,X.conversationId),Ot({conversationId:X.conversationId,reference:X.ticketReference}),X.controlState&&Br(X.controlState);let nn=Ne.findLast(De=>De.role==="assistant"&&!De.ephemeral);dt(nn?.suggestions??[]),ke?ja(X.conversationId):sr(X.conversationId),R("chat");let je=x();je&&k.switchTab(je)}catch(X){if(de())return;n.emit("error",X),e.onError?.(X)}},[W,m,d,v,n,e,c,Vo,V,u,Me,ja,sr,dc,k]),Yo=D(void 0),Jo=F(S=>{let E=e.modules.list.find(te=>te.layout===yS[S.to]);if(!E){we.warn("open: the widget has no such tab",{to:S.to});return}let J=S.id&&(E.layout==="help"||E.layout==="news")?{kind:"content",id:S.id,title:""}:void 0;k.open(E.id,J)},[e.modules,k]),yc=F(S=>{if(K||Fr(),S!=null){if(!su(S)){we.warn("open: unknown target",{detail:S});return}B?Jo(S):Yo.current=S}},[K,Fr,B,Jo]);U(()=>{!B||!Yo.current||(Jo(Yo.current),Yo.current=void 0)},[B,Jo]);let Pc=B&&!w&&(!Wo||!bc.value),[Ln,Ja]=N(),xc=F(S=>{let E=lu(S);if(!E){we.warn("ask: expected { text, send? } with non-empty text",{detail:S});return}K||Fr(),Ja(E)},[K,Fr]),Xa=K&&B&&!w,Sc=Xa&&Pc&&!ge&&!(Wo&&(V||vc));U(()=>{if(Ln===void 0||!(Ln.send?Sc:Xa))return;let S=x();if(!S){we.warn("ask: the widget has no chat"),Ja(void 0);return}if(M!=="chat"||!g()){R("chat"),k.switchTab(S);return}if(Ja(void 0),!Ln.send){lr.current?.fill(Ln.text);return}ur(Ln.text,[]).then(E=>{E||lr.current?.fill(Ln.text)})},[Ln,Xa,Sc,M,$,e.modules,k,ur]),U(()=>{if(e.widgetId!=="default")return;let S=`data-${O.cssPrefix}-`,E=["ask","open","close"].map(te=>S+te);function J(te){let de=te.composedPath().find(ke=>ke instanceof Element&&E.some(Ne=>ke.hasAttribute(Ne)));if(!(de instanceof Element))return;te.preventDefault();let X=de.getAttribute(`${S}ask`),se=de.getAttribute(`${S}open`);X!==null?Ht(t,"ask",to(X||(de.textContent??""),{send:de.hasAttribute(`${S}send`)})):se!==null?Ht(t,"open",wi(se)):Ht(t,"close")}return document.addEventListener("click",J),()=>document.removeEventListener("click",J)},[e.widgetId,t]),U(()=>{if(e.widgetId!=="default")return;let S=uu(location.href);S&&(history.replaceState(history.state,"",S.url),S.ask?Ht(t,"ask",to(S.ask)):Ht(t,"open",S.target))},[e.widgetId,t]);let wc=D(no),kc=e.mode==="page"||e.mode==="inline"||e.mode==="standalone";U(()=>qt(()=>{let S=d.value,E={open:kc||K,ready:B,unread:lc.value,...S?{conversationId:S}:{}},J=wc.current;E.open===J.open&&E.ready===J.ready&&E.unread===J.unread&&E.conversationId===J.conversationId||(wc.current=E,n.emit("state",E),E.unread!==J.unread&&n.emit("unread",E.unread))}),[n,kc,K,B,lc,d]);let pr=D({handleOpenCommand:yc,handleClose:Go,handleExpand:Qa,handleFullscreen:Ya,handleAskCommand:xc});pr.current={handleOpenCommand:yc,handleClose:Go,handleExpand:Qa,handleFullscreen:Ya,handleAskCommand:xc},ut(()=>du(t,{open:S=>pr.current.handleOpenCommand(S),close:()=>pr.current.handleClose(),expand:()=>pr.current.handleExpand(),fullscreen:()=>pr.current.handleFullscreen(),ask:S=>pr.current.handleAskCommand(S)}),[t]);let it=xe(()=>ws(e,vt,Xt,Zt),[e,vt,Xt,Zt]);nt.current=it.strings,U(()=>{let S=bt.current;if(!S?.translations?.length)return;let E=$n(S,vt);yt(E.agent),E.site&&zs(E.site)&&or(E.site),E.blocks&&Fs(E.blocks)&&ir(E.blocks)},[vt]);function Za(S){mg(S)}let Cc={options:it,transport:W,feedback:ce,bus:n,persistence:c,conversationId:d.value??"",composerKey:v.value,composerApiRef:lr,view:M,isStreaming:V,pageToolRunning:Ga,isMemoryCompacting:vc,canReleaseQueuedMessages:Pc,queueManualMessages:Wo&&bc.value,replyAwaitsCard:Wo&&sg.value,sendPreparing:ge,attachmentUploadsSig:$e,composerActive:it.mode==="page"||it.mode==="inline"||it.mode==="standalone"||K,controlMode:Gt.value,assignedOperator:Hm.value,operatorAvailable:jm.value,operatorRequestEnabled:e.features.operatorRequest,onRequestOperator:Wm,onCancelOperatorRequest:Gm,loadingMessages:w,onLoadPreviousMessages:ng,messagesSig:m,reconnectingSig:b,agent:Be,ticketReference:Et?.conversationId===d.value?Et?.reference:void 0,login:Va,onStartAsGuest:s,maxMessageCharacters:q,suggestions:ot,initialWidgetSize:_.widgetSize??null,onClear:Ko,onExpand:Qa,onFullscreen:Ya,onSoundToggle:qm,onToggleHistory:pg,onSelectHistoryConversation:Za,onNewConversation:Qo,onLocaleChange:Um,onThemeChange:zm,onTextSizeChange:Fm,onWidgetSizeChange:fg,onSend:ur,onStop:lg,onSuggestion:S=>{if(le.current)return;let E=S.text??S.label;we.info("suggestion",{text:E,autoSend:e.autoSendSuggestions}),n.emit("suggestion",{text:E}),e.autoSendSuggestions?ur(E,[]):lr.current?.fill(E)},tool:og,onRetry:dg,onMessageFeedback:ig,onCardAction:cg};if(z)return a("div",{class:`${Fo}-anchor`,children:a(oc,{strings:it.strings,text:it.strings.chatUnavailable})});if(!B)return null;let qr=it.modules.list;function es(S){let E=kr("close",it.mode,S)?Go:void 0;return qr.length===0?a(oc,{strings:it.strings,text:it.strings.modulesEmpty,onClose:E}):qr.length===1&&qr[0]?.layout==="chat"?a(im,{...Cc,panelSize:S,onClose:E}):a(am,{panelProps:{...Cc,panelSize:S,onClose:E},enabledModules:qr,nav:k,bus:n,hasUnread:Qm.value,latestNews:eg,onSelectConversation:Za,onStartNewConversation:ug,onSetPanelSize:Lt})}if(e.mode==="page"){let S=e.history.enabled&&qr.some(E=>E.layout==="chat");return a("div",{class:`${Fo}-anchor`,children:a(cm,{site:rr,blocks:In,transport:W,strings:it.strings,locale:it.locale,persistence:c,showConversations:S,onSelectConversation:Za,onNewConversation:Qo,sidebarCollapsed:En,onToggleSidebarCollapsed:_g,children:es("fullscreen")})})}if(Y){let S=e.mode==="standalone"?"fullscreen":Ce;return a("div",{class:`${Fo}-anchor`,children:es(S)})}let Tc=e.mode==="drawer",Rc=!(e.mode==="modal")&&!e.launcher.hidden&&(!K||Ue),Ac=Rc&&!Ue&&!ae&&!Tc?it.launcher.callout:null;return a("div",{class:`${Fo}-anchor`,"data-launcher-size":it.launcher.size,children:[K||Re?a("div",{class:`${Fo}-surface`,hidden:!K,children:es(Ce)}):null,Rc?a(R_,{buttonRef:mt,onToggle:Fr,launcher:it.launcher,strings:it.strings,leaving:Ue,edgeTab:Tc}):null,Ac?a(A_,{callout:Ac,launcherPosition:it.position,strings:it.strings,closeLabel:it.strings.close,onDismiss:be}):null]})}function PS(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var xS={AI_AGENT_PUBLIC_ACCESS_NOT_FOUND:"the deployment was not found or is turned off",AI_AGENT_PUBLIC_ORIGIN_NOT_ALLOWED:"this website is not in the deployment's allowed origins"},SS=120,Om=new WeakMap;async function wS(e,t,n,r,o){return(await Promise.all(t.map(async s=>{try{r(s.id,{status:"uploading"});let l=Om.get(s)??await e.uploadFile(s.file,n,c=>r(s.id,{status:"uploading",fraction:c}));return Om.set(s,l),r(s.id,{status:"done"}),{id:l.id,name:l.originalName,mediaType:l.mimeType,size:l.fileSize,url:l.url}}catch(l){r(s.id,n.aborted?void 0:{status:"error",refusal:l instanceof Le&&l.status===400?l.errorCode:void 0}),o(l);return}}))).filter(s=>s!==void 0)}var kS=oe.scope("error-boundary"),Fa=class extends Ut{constructor(){super(...arguments);Z(this,"state",{crashed:!("toSorted"in Array.prototype)})}componentDidCatch(n,r){kS.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}};function $m(e){let{bus:t,host:n,appRoot:r,persistence:o,reportError:i}=e,s=e.initialRaw,l,c,u=fr(s),p=o.loadUserPrefs().locale??u.locale,_=!0,d=0,f=0,v=kd(t);function m(){let h=l&&$n({config:l,translations:c},p).config;u=fr(h?ks(s,h):s)}function b(){Ms(n,hi(u.mode)),Bd(n,{...u,themeMode:Vr(u.themeMode,o.loadUserPrefs().themeMode)}),_&&(vi(n,CS(u)),_=!1)}function w(){b(),mn(fn(Fa,{onError:i},fn(Nm,{key:d,bus:t,hostElement:n,options:u,recentHostEvents:v,loginRevision:f,onPersonChanged:C,onStartAsGuest:x})),r)}t.on("handshake",h=>{h.config&&(h.config.storageVersion&&o.rememberStorageVersion(h.config.storageVersion),l=h.config,c=h.translations,m(),w())}),t.on("localeChange",h=>{p=h,c?.length&&(m(),w())});let y=Td(t,{getOptions:()=>u,getVisitorId:()=>o.getVisitorId(),getConversationId:()=>o.loadConversationId()});function P(){let h=o.takeLoginReturn();return h?(o.saveConversationId(h.conversationId),o.saveDraft(h.conversationId,h.draft),o.savePanelOpen(!0),!0):!1}s.userToken&&P();function C(){o.reset(),v.length=0,d+=1,_=!0,m(),w()}function x(){s={...s,userContext:void 0,userToken:void 0},C()}function g(h){"userToken"in h&&h.userToken&&!s.userToken&&P()&&(d+=1),s={...s,...h},m(),w()}return{getOptions:()=>u,getUserOptions:()=>s,render:w,setUserOptions:h=>{s=h,m(),w()},patchUserOptions:g,login:h=>{f+=1,g({userToken:h})},reset:()=>x(),destroy:()=>y()}}function CS(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=gr(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:r}=Po(e,Tr(),t.loadPanelOpen(),t.loadPanelSize());return sa(e.mode,r,n)}var ac=class extends HTMLElement{constructor(){super(...arguments);Z(this,"bus",new Ci);Z(this,"widgetState",no);Z(this,"userToken");Z(this,"pageTools",[]);Z(this,"markReady",()=>{});Z(this,"ready",new Promise(n=>{this.markReady=n}));Z(this,"mountResult",null);Z(this,"runtime",null)}static get observedAttributes(){return Cs}connectedCallback(){if(Object.hasOwn(this,"tools")){let n=Reflect.get(this,"tools");Reflect.deleteProperty(this,"tools"),this.pageTools=Array.isArray(n)?n:[]}this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,mn(null,this.mountResult.appRoot),this.bus.clear(),this.widgetState=no)}attributeChangedCallback(){this.isConnected&&this.boot()}open(n){Ht(this,"open",n)}close(){Ht(this,"close")}expand(){Ht(this,"expand")}ask(n,r){Ht(this,"ask",to(n,r))}get state(){return this.widgetState}reset(){this.userToken=void 0,this.runtime?.reset()}login(n){this.userToken=n,this.runtime?.login(n)}track(n,r){let o=wd(n,r);o&&this.bus.emit("hostEvent",o)}get tools(){return this.pageTools}set tools(n){this.pageTools=n,this.runtime?.patchUserOptions({tools:n})}registerTool(n,r){Rf(n,r)}on(n,r){return this.bus.on(n,r)}boot(){let n={...Ts(i=>this.getAttribute(i)),...this.userToken?{userToken:this.userToken}:{},tools:this.pageTools};if(!n.aiAgentDeploymentId)throw new Error("ai-agent-deployment-id is required");if(this.runtime){this.runtime.setUserOptions(n);return}let r=fr(n);this.mountResult??(this.mountResult=Dd({existingHost:this,position:hi(r.mode)}));let o=gr(r.widgetId,r.storage,r.aiAgentDeploymentId);this.bus.on("state",i=>{this.widgetState=i,i.ready&&this.markReady()}),this.runtime=$m({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:o,initialRaw:n,reportError:i=>this.bus.emit("error",i)}),this.runtime.render()}},Dm=!1;function TS(){if(Dm||typeof customElements>"u")return;let e=O.tagName;customElements.get(e)||customElements.define(e,ac),Dm=!0}typeof customElements<"u"&&TS();export{TS as registerWebComponent};
|
|
72
76
|
//# sourceMappingURL=elements-web-component.esm.js.map
|