@helpai/elements 0.54.2 → 0.55.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.js CHANGED
@@ -1,21 +1,21 @@
1
- "use strict";var HelpAI=(()=>{var vr=Object.defineProperty;var gd=Object.getOwnPropertyDescriptor;var hd=Object.getOwnPropertyNames;var vd=Object.prototype.hasOwnProperty;var bd=(e,t,n)=>t in e?vr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var xd=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of hd(t))!vd.call(e,a)&&a!==n&&vr(e,a,{get:()=>t[a],enumerable:!(o=gd(t,a))||o.enumerable});return e};var yd=e=>xd(vr({},"__esModule",{value:!0}),e);var q=(e,t,n)=>bd(e,typeof t!="symbol"?t+"":t,n);var Am={};var y={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 Ya={attach:"Attach files",attachmentMimeRejected:"File type not supported",attachmentTooLarge:"File is too large",attachmentTooMany:"Attachment limit reached",conversationClosed:"This conversation is closed",conversationLoading:"Loading conversation\u2026",close:"Close",collapse:"Collapse",collapseSidebar:"Collapse sidebar",composerPlaceholder:"Type a message\u2026",dateLastWeek:"Last 7 days",dateOlder:"Older",dateToday:"Today",dateYesterday:"Yesterday",dropZone:"Drop files to attach",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous conversations yet",historyLoading:"Loading your conversations\u2026",historyContinue:"Continue the conversation",historyTitle:"Conversation history",language:"Language",launcherOpen:"Open chat",launcherLabel:"Chat with us",micStart:"Start voice input",micStop:"Stop voice input",micUnsupported:"Voice input is not supported in this browser",moreActions:"More actions",newConversation:"New conversation",panelTitle:"Chat",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",soundOff:"Sound off",soundOn:"Sound on",startNewConversation:"Start a new conversation",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",thinking:"Thinking\u2026",thoughts:"Thoughts",usedTool:"Used tool",toolResult:"Result",sources:"Sources",tabHome:"Home",tabConversations:"Conversations",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",moduleBack:"Back",contentLoading:"Loading\u2026",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results found",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsBack:"Back to news",newsPublishedAt:"Published {date}",formSubmit:"Submit",formSkip:"Maybe later",formSubmitted:"Completed",formSkipped:"Maybe later",formFillOut:"Fill out",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidUrl:"Enter a valid URL",formInvalidNumber:"Enter a valid number",formTooShort:"Too short (min {min} characters)",formTooLong:"Too long (max {max} characters)",formNumberTooSmall:"Must be at least {min}",formNumberTooLarge:"Must be at most {max}",formPatternMismatch:"Please match the requested format",formChooseAtLeast:"Choose at least {min}",formChooseAtMost:"Choose at most {max}",formOther:"Other",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"Questions for you",inputBadge:"Questions",inputAnswered:"Answered",inputSkipped:"Skipped",inputSubmit:"Submit answers",inputSubmitHint:"Enter to send \xB7 Shift+Enter = new line",inputSkip:"Skip",confirmYes:"Yes",confirmNo:"No",approvalRequired:"Approval required",approve:"Approve",reject:"Reject",approved:"Approved",rejected:"Rejected",approvalReason:"Add a reason (optional)",approvalPrompt:"{tool} requires your approval to execute.",approvalBody:"Review the tool input above and decide whether to allow this action.",approvalYourResponse:"Your response: {decision}",approvalEditHint:"You can edit this response until this step continues.",approvalSubmitting:"Response submitted. Request in progress\u2026",edit:"Edit",toolParameters:"Parameters",statusAwaiting:"Awaiting Approval",statusResponded:"Responded",statusRunning:"Running",statusCompleted:"Completed",statusDenied:"Denied",statusError:"Error",statusSuperseded:"Skipped"},Pd={attach:"Joindre des fichiers",attachmentMimeRejected:"Type de fichier non pris en charge",attachmentTooLarge:"Le fichier est trop volumineux",attachmentTooMany:"Limite de pi\xE8ces jointes atteinte",conversationClosed:"Cette conversation est ferm\xE9e",conversationLoading:"Chargement de la conversation\u2026",close:"Fermer",collapse:"R\xE9duire",collapseSidebar:"R\xE9duire la barre lat\xE9rale",composerPlaceholder:"\xC9crivez un message\u2026",dateLastWeek:"7 derniers jours",dateOlder:"Plus ancien",dateToday:"Aujourd'hui",dateYesterday:"Hier",dropZone:"D\xE9posez les fichiers \xE0 joindre",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRetry:"R\xE9essayer",expand:"Agrandir",expandSidebar:"D\xE9velopper la barre lat\xE9rale",exitFullscreen:"Quitter le plein \xE9cran",fullscreen:"Plein \xE9cran",history:"Historique",historyBack:"Retour au chat",historyEmpty:"Aucune conversation pour le moment",historyContinue:"Poursuivre la conversation",historyLoading:"Chargement de vos conversations\u2026",historyTitle:"Historique des conversations",language:"Langue",launcherOpen:"Ouvrir le chat",launcherLabel:"Discuter avec nous",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",micUnsupported:"La saisie vocale n'est pas prise en charge par ce navigateur",moreActions:"Plus d'actions",newConversation:"Nouvelle conversation",panelTitle:"Chat",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",startNewConversation:"D\xE9marrer une nouvelle conversation",stop:"Arr\xEAter",theme:"Th\xE8me",themeAuto:"Auto",themeDark:"Sombre",themeLight:"Clair",textSize:"Taille du texte",textSizeSmall:"Petite",textSizeNormal:"Normale",textSizeLarge:"Grande",loading:"Chargement\u2026",thinking:"R\xE9flexion\u2026",thoughts:"R\xE9flexions",usedTool:"Outil utilis\xE9",toolResult:"R\xE9sultat",sources:"Sources",tabHome:"Accueil",tabConversations:"Conversations",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeContentTitle:"Articles populaires",homeStatus:"Statut",helpTitle:"Aide",helpSearchPlaceholder:"Rechercher de l'aide",helpEmpty:"Aucun article d'aide pour le moment",helpLoading:"Chargement de l'aide\u2026",helpSearchEmpty:"Aucun r\xE9sultat trouv\xE9",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsBack:"Retour aux actualit\xE9s",newsPublishedAt:"Publi\xE9 le {date}",formSubmit:"Envoyer",formSkip:"Plus tard",formSubmitted:"Termin\xE9",formSkipped:"Plus tard",formFillOut:"Remplir",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidUrl:"Saisissez une URL valide",formInvalidNumber:"Saisissez un nombre valide",formTooShort:"Trop court (min. {min} caract\xE8res)",formTooLong:"Trop long (max. {max} caract\xE8res)",formNumberTooSmall:"Doit \xEAtre au moins {min}",formNumberTooLarge:"Doit \xEAtre au plus {max}",formPatternMismatch:"Veuillez respecter le format demand\xE9",formChooseAtLeast:"Choisissez au moins {min}",formChooseAtMost:"Choisissez au plus {max}",formOther:"Autre",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Questions pour vous",inputBadge:"Questions",inputAnswered:"R\xE9pondu",inputSkipped:"Ignor\xE9",inputSubmit:"Envoyer les r\xE9ponses",inputSubmitHint:"Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e = saut de ligne",inputSkip:"Ignorer",confirmYes:"Oui",confirmNo:"Non",approvalRequired:"Approbation requise",approve:"Approuver",reject:"Refuser",approved:"Approuv\xE9",rejected:"Refus\xE9",approvalReason:"Ajouter une raison (facultatif)",approvalPrompt:"{tool} n\xE9cessite votre approbation pour s'ex\xE9cuter.",approvalBody:"V\xE9rifiez les param\xE8tres ci-dessus et d\xE9cidez d'autoriser ou non cette action.",approvalYourResponse:"Votre r\xE9ponse : {decision}",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",approvalSubmitting:"R\xE9ponse envoy\xE9e. Traitement en cours\u2026",edit:"Modifier",toolParameters:"Param\xE8tres",statusAwaiting:"En attente d'approbation",statusResponded:"R\xE9pondu",statusRunning:"En cours",statusCompleted:"Termin\xE9",statusDenied:"Refus\xE9",statusError:"Erreur",statusSuperseded:"Ignor\xE9"},Sd={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645",attachmentTooLarge:"\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627",attachmentTooMany:"\u062A\u0645 \u0628\u0644\u0648\u063A \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A",conversationClosed:"\u062A\u0645 \u0625\u063A\u0644\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629\u2026",close:"\u0625\u063A\u0644\u0627\u0642",collapse:"\u0637\u064A\u0651",collapseSidebar:"\u0637\u064A\u0651 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",composerPlaceholder:"\u0627\u0643\u062A\u0628 \u0631\u0633\u0627\u0644\u0629\u2026",dateLastWeek:"\u0622\u062E\u0631 \u0667 \u0623\u064A\u0627\u0645",dateOlder:"\u0623\u0642\u062F\u0645",dateToday:"\u0627\u0644\u064A\u0648\u0645",dateYesterday:"\u0623\u0645\u0633",dropZone:"\u0623\u0641\u0644\u062A \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0644\u0625\u0631\u0641\u0627\u0642\u0647\u0627",errorGeneric:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0627",errorRateLimited:"\u0637\u0644\u0628\u0627\u062A \u0643\u062B\u064A\u0631\u0629 \u062C\u062F\u064B\u0627 \u2014 \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0628\u0639\u062F \u0644\u062D\u0638\u0629.",errorRetry:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",expand:"\u062A\u0648\u0633\u064A\u0639",expandSidebar:"\u062A\u0648\u0633\u064A\u0639 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",exitFullscreen:"\u0625\u0646\u0647\u0627\u0621 \u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",fullscreen:"\u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",history:"\u0627\u0644\u0633\u062C\u0644",historyBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",historyEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u062D\u0627\u062F\u062B\u0627\u062A \u0633\u0627\u0628\u0642\u0629 \u0628\u0639\u062F",historyContinue:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",historyLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0645\u062D\u0627\u062F\u062B\u0627\u062A\u0643\u2026",historyTitle:"\u0633\u062C\u0644 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0627\u062A",language:"\u0627\u0644\u0644\u063A\u0629",launcherOpen:"\u0641\u062A\u062D \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",launcherLabel:"\u062A\u062D\u062F\u062B \u0645\u0639\u0646\u0627",micStart:"\u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micStop:"\u0625\u064A\u0642\u0627\u0641 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micUnsupported:"\u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645 \u0641\u064A \u0647\u0630\u0627 \u0627\u0644\u0645\u062A\u0635\u0641\u062D",moreActions:"\u0625\u062C\u0631\u0627\u0621\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629",newConversation:"\u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629",panelTitle:"\u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",resizeHandle:"\u0627\u0633\u062D\u0628 \u0644\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u062D\u062C\u0645",scrollToBottom:"\u0627\u0644\u0627\u0646\u062A\u0642\u0627\u0644 \u0625\u0644\u0649 \u0627\u0644\u0623\u062D\u062F\u062B",send:"\u0625\u0631\u0633\u0627\u0644",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",startNewConversation:"\u0628\u062F\u0621 \u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629",stop:"\u0625\u064A\u0642\u0627\u0641",theme:"\u0627\u0644\u0645\u0638\u0647\u0631",themeAuto:"\u062A\u0644\u0642\u0627\u0626\u064A",themeDark:"\u062F\u0627\u0643\u0646",themeLight:"\u0641\u0627\u062A\u062D",textSize:"\u062D\u062C\u0645 \u0627\u0644\u0646\u0635",textSizeSmall:"\u0635\u063A\u064A\u0631",textSizeNormal:"\u0639\u0627\u062F\u064A",textSizeLarge:"\u0643\u0628\u064A\u0631",loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thoughts:"\u0627\u0644\u0623\u0641\u0643\u0627\u0631",usedTool:"\u0623\u062F\u0627\u0629 \u0645\u064F\u0633\u062A\u062E\u062F\u064E\u0645\u0629",toolResult:"\u0627\u0644\u0646\u062A\u064A\u062C\u0629",sources:"\u0627\u0644\u0645\u0635\u0627\u062F\u0631",tabHome:"\u0627\u0644\u0631\u0626\u064A\u0633\u064A\u0629",tabConversations:"\u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0627\u062A",tabHelp:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",tabNews:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",modulesEmpty:"\u0644\u0627 \u0634\u064A\u0621 \u0647\u0646\u0627 \u0628\u0639\u062F",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",homeGreeting:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeGreetingNamed:"\u0645\u0631\u062D\u0628\u064B\u0627 {name} \u{1F44B}",homeGreetingLead:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",homeContentTitle:"\u0645\u0642\u0627\u0644\u0627\u062A \u0634\u0627\u0626\u0639\u0629",homeStatus:"\u0627\u0644\u062D\u0627\u0644\u0629",helpTitle:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",helpSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",helpEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u0642\u0627\u0644\u0627\u062A \u0645\u0633\u0627\u0639\u062F\u0629 \u0628\u0639\u062F",helpLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629\u2026",helpSearchEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C",newsTitle:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0623\u062E\u0628\u0627\u0631 \u0628\u0639\u062F",newsLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0623\u062E\u0628\u0627\u0631\u2026",newsBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsPublishedAt:"\u0646\u064F\u0634\u0631 \u0641\u064A {date}",formSubmit:"\u0625\u0631\u0633\u0627\u0644",formSkip:"\u0644\u0627\u062D\u0642\u064B\u0627",formSubmitted:"\u062A\u0645",formSkipped:"\u0644\u0627\u062D\u0642\u064B\u0627",formFillOut:"\u062A\u0639\u0628\u0626\u0629",formRequired:"\u0647\u0630\u0627 \u0627\u0644\u062D\u0642\u0644 \u0645\u0637\u0644\u0648\u0628",formInvalidEmail:"\u0623\u062F\u062E\u0644 \u0628\u0631\u064A\u062F\u064B\u0627 \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidTel:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidUrl:"\u0623\u062F\u062E\u0644 \u0631\u0627\u0628\u0637\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formTooShort:"\u0642\u0635\u064A\u0631 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 {min} \u062D\u0631\u0641\u064B\u0627)",formTooLong:"\u0637\u0648\u064A\u0644 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 {max} \u062D\u0631\u0641\u064B\u0627)",formNumberTooSmall:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0642\u0644 \u0639\u0646 {min}",formNumberTooLarge:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0632\u064A\u062F \u0639\u0646 {max}",formPatternMismatch:"\u064A\u0631\u062C\u0649 \u0645\u0637\u0627\u0628\u0642\u0629 \u0627\u0644\u0635\u064A\u063A\u0629 \u0627\u0644\u0645\u0637\u0644\u0648\u0628\u0629",formChooseAtLeast:"\u0627\u062E\u062A\u0631 {min} \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644",formChooseAtMost:"\u0627\u062E\u062A\u0631 {max} \u0639\u0644\u0649 \u0627\u0644\u0623\u0643\u062B\u0631",formOther:"\u0623\u062E\u0631\u0649",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0623\u0633\u0626\u0644\u0629 \u0644\u0643",inputBadge:"\u0623\u0633\u0626\u0644\u0629",inputAnswered:"\u062A\u0645\u062A \u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputSkipped:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A",inputSubmit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A",inputSubmitHint:"Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter = \u0633\u0637\u0631 \u062C\u062F\u064A\u062F",inputSkip:"\u062A\u062E\u0637\u064D\u0651",confirmYes:"\u0646\u0639\u0645",confirmNo:"\u0644\u0627",approvalRequired:"\u0645\u0637\u0644\u0648\u0628 \u0645\u0648\u0627\u0641\u0642\u0629",approve:"\u0645\u0648\u0627\u0641\u0642\u0629",reject:"\u0631\u0641\u0636",approved:"\u062A\u0645\u062A \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",rejected:"\u0645\u0631\u0641\u0648\u0636",approvalReason:"\u0623\u0636\u0641 \u0633\u0628\u0628\u064B\u0627 (\u0627\u062E\u062A\u064A\u0627\u0631\u064A)",approvalPrompt:"\u062A\u062A\u0637\u0644\u0628 {tool} \u0645\u0648\u0627\u0641\u0642\u062A\u0643 \u0644\u0644\u062A\u0646\u0641\u064A\u0630.",approvalBody:"\u0631\u0627\u062C\u0639 \u0645\u064F\u0639\u0637\u064A\u0627\u062A \u0627\u0644\u0623\u062F\u0627\u0629 \u0623\u0639\u0644\u0627\u0647 \u0648\u0642\u0631\u0651\u0631 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \u0623\u0648 \u0631\u0641\u0636\u0647.",approvalYourResponse:"\u0631\u062F\u0651\u0643: {decision}",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u0639\u062F\u064A\u0644 \u0631\u062F\u0651\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",approvalSubmitting:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062F. \u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",edit:"\u062A\u0639\u062F\u064A\u0644",toolParameters:"\u0627\u0644\u0645\u0639\u0637\u064A\u0627\u062A",statusAwaiting:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",statusResponded:"\u062A\u0645 \u0627\u0644\u0631\u062F",statusRunning:"\u0642\u064A\u062F \u0627\u0644\u062A\u0646\u0641\u064A\u0630",statusCompleted:"\u0645\u0643\u062A\u0645\u0644",statusDenied:"\u0645\u0631\u0641\u0648\u0636",statusError:"\u062E\u0637\u0623",statusSuperseded:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A"},kd={attach:"Adjuntar archivos",attachmentMimeRejected:"Tipo de archivo no admitido",attachmentTooLarge:"El archivo es demasiado grande",attachmentTooMany:"Se alcanz\xF3 el l\xEDmite de adjuntos",conversationClosed:"Esta conversaci\xF3n est\xE1 cerrada",conversationLoading:"Cargando conversaci\xF3n\u2026",close:"Cerrar",collapse:"Contraer",collapseSidebar:"Contraer la barra lateral",composerPlaceholder:"Escribe un mensaje\u2026",dateLastWeek:"\xDAltimos 7 d\xEDas",dateOlder:"Anteriores",dateToday:"Hoy",dateYesterday:"Ayer",dropZone:"Suelta los archivos para adjuntarlos",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRetry:"Reintentar",expand:"Ampliar",expandSidebar:"Expandir la barra lateral",exitFullscreen:"Salir de pantalla completa",fullscreen:"Pantalla completa",history:"Historial",historyBack:"Volver al chat",historyEmpty:"A\xFAn no tienes conversaciones",historyContinue:"Continuar la conversaci\xF3n",historyLoading:"Cargando tus conversaciones\u2026",historyTitle:"Historial de conversaciones",language:"Idioma",launcherOpen:"Abrir el chat",launcherLabel:"Chatea con nosotros",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",micUnsupported:"Este navegador no admite la entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nueva conversaci\xF3n",panelTitle:"Chat",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",soundOff:"Sonido desactivado",soundOn:"Sonido activado",startNewConversation:"Iniciar una conversaci\xF3n nueva",stop:"Detener",theme:"Tema",themeAuto:"Autom\xE1tico",themeDark:"Oscuro",themeLight:"Claro",textSize:"Tama\xF1o del texto",textSizeSmall:"Peque\xF1o",textSizeNormal:"Normal",textSizeLarge:"Grande",loading:"Cargando\u2026",thinking:"Pensando\u2026",thoughts:"Razonamiento",usedTool:"Herramienta usada",toolResult:"Resultado",sources:"Fuentes",tabHome:"Inicio",tabConversations:"Conversaciones",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeContentTitle:"Art\xEDculos populares",homeStatus:"Estado",helpTitle:"Ayuda",helpSearchPlaceholder:"Buscar ayuda",helpEmpty:"A\xFAn no hay art\xEDculos de ayuda",helpLoading:"Cargando la ayuda\u2026",helpSearchEmpty:"No se encontraron resultados",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsBack:"Volver a novedades",newsPublishedAt:"Publicado el {date}",formSubmit:"Enviar",formSkip:"Quiz\xE1 m\xE1s tarde",formSubmitted:"Completado",formSkipped:"Quiz\xE1 m\xE1s tarde",formFillOut:"Completar",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidUrl:"Introduce una URL v\xE1lida",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formTooShort:"Demasiado corto (m\xEDn. {min} caracteres)",formTooLong:"Demasiado largo (m\xE1x. {max} caracteres)",formNumberTooSmall:"Debe ser al menos {min}",formNumberTooLarge:"Debe ser como m\xE1ximo {max}",formPatternMismatch:"Respeta el formato solicitado",formChooseAtLeast:"Elige al menos {min}",formChooseAtMost:"Elige como m\xE1ximo {max}",formOther:"Otro",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Preguntas para ti",inputBadge:"Preguntas",inputAnswered:"Respondido",inputSkipped:"Omitido",inputSubmit:"Enviar respuestas",inputSubmitHint:"Enter para enviar \xB7 May\xFAs+Enter = nueva l\xEDnea",inputSkip:"Omitir",confirmYes:"S\xED",confirmNo:"No",approvalRequired:"Aprobaci\xF3n requerida",approve:"Aprobar",reject:"Rechazar",approved:"Aprobado",rejected:"Rechazado",approvalReason:"A\xF1ade un motivo (opcional)",approvalPrompt:"{tool} requiere tu aprobaci\xF3n para ejecutarse.",approvalBody:"Revisa los par\xE1metros de arriba y decide si permites esta acci\xF3n.",approvalYourResponse:"Tu respuesta: {decision}",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",approvalSubmitting:"Respuesta enviada. Procesando\u2026",edit:"Editar",toolParameters:"Par\xE1metros",statusAwaiting:"Esperando aprobaci\xF3n",statusResponded:"Respondido",statusRunning:"En curso",statusCompleted:"Completado",statusDenied:"Denegado",statusError:"Error",statusSuperseded:"Omitido"},wd={attach:"\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",attachmentMimeRejected:"\u05E1\u05D5\u05D2 \u05D4\u05E7\u05D5\u05D1\u05E5 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA",attachmentTooLarge:"\u05D4\u05E7\u05D5\u05D1\u05E5 \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9",attachmentTooMany:"\u05D4\u05D2\u05E2\u05EA \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D4\u05DE\u05E8\u05D1\u05D9 \u05E9\u05DC \u05E7\u05D1\u05E6\u05D9\u05DD \u05DE\u05E6\u05D5\u05E8\u05E4\u05D9\u05DD",conversationClosed:"\u05D4\u05E9\u05D9\u05D7\u05D4 \u05D4\u05D6\u05D5 \u05E0\u05E1\u05D2\u05E8\u05D4",conversationLoading:"\u05D8\u05D5\u05E2\u05DF \u05E9\u05D9\u05D7\u05D4\u2026",close:"\u05E1\u05D2\u05D9\u05E8\u05D4",collapse:"\u05DB\u05D9\u05D5\u05D5\u05E5",collapseSidebar:"\u05DB\u05D9\u05D5\u05D5\u05E5 \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",composerPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D4\u05D5\u05D3\u05E2\u05D4\u2026",dateLastWeek:"7 \u05D4\u05D9\u05DE\u05D9\u05DD \u05D4\u05D0\u05D7\u05E8\u05D5\u05E0\u05D9\u05DD",dateOlder:"\u05D9\u05E9\u05DF \u05D9\u05D5\u05EA\u05E8",dateToday:"\u05D4\u05D9\u05D5\u05DD",dateYesterday:"\u05D0\u05EA\u05DE\u05D5\u05DC",dropZone:"\u05E9\u05D7\u05E8\u05E8 \u05E7\u05D1\u05E6\u05D9\u05DD \u05DB\u05D3\u05D9 \u05DC\u05E6\u05E8\u05E3",errorGeneric:"\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9",errorRateLimited:"\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 \u05E8\u05D2\u05E2.",errorRetry:"\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1",expand:"\u05D4\u05E8\u05D7\u05D1\u05D4",expandSidebar:"\u05D4\u05E8\u05D7\u05D1\u05EA \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",exitFullscreen:"\u05D9\u05E6\u05D9\u05D0\u05D4 \u05DE\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",fullscreen:"\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",history:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D4",historyBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05E9\u05D9\u05D7\u05D4",historyEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05E9\u05D9\u05D7\u05D5\u05EA \u05E7\u05D5\u05D3\u05DE\u05D5\u05EA",historyContinue:"\u05D4\u05DE\u05E9\u05DA \u05E9\u05D9\u05D7\u05D4",historyLoading:"\u05D8\u05D5\u05E2\u05DF \u05D0\u05EA \u05D4\u05E9\u05D9\u05D7\u05D5\u05EA \u05E9\u05DC\u05DA\u2026",historyTitle:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D9\u05EA \u05E9\u05D9\u05D7\u05D5\u05EA",language:"\u05E9\u05E4\u05D4",launcherOpen:"\u05E4\u05EA\u05D9\u05D7\u05EA \u05E6\u05F3\u05D0\u05D8",launcherLabel:"\u05D3\u05D1\u05E8\u05D5 \u05D0\u05D9\u05EA\u05E0\u05D5",micStart:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micStop:"\u05E2\u05E6\u05D9\u05E8\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micUnsupported:"\u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA \u05D1\u05D3\u05E4\u05D3\u05E4\u05DF \u05D6\u05D4",moreActions:"\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",newConversation:"\u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4",panelTitle:"\u05E9\u05D9\u05D7\u05D4",resizeHandle:"\u05D2\u05E8\u05D5\u05E8 \u05DC\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05D2\u05D5\u05D3\u05DC",scrollToBottom:"\u05DE\u05E2\u05D1\u05E8 \u05DC\u05D7\u05D3\u05E9 \u05D1\u05D9\u05D5\u05EA\u05E8",send:"\u05E9\u05DC\u05D9\u05D7\u05D4",soundOff:"\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",soundOn:"\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",startNewConversation:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E9\u05D9\u05D7\u05D4 \u05D7\u05D3\u05E9\u05D4",stop:"\u05E2\u05E6\u05D9\u05E8\u05D4",theme:"\u05E2\u05E8\u05DB\u05EA \u05E0\u05D5\u05E9\u05D0",themeAuto:"\u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9",themeDark:"\u05DB\u05D4\u05D4",themeLight:"\u05D1\u05D4\u05D9\u05E8",textSize:"\u05D2\u05D5\u05D3\u05DC \u05D8\u05E7\u05E1\u05D8",textSizeSmall:"\u05E7\u05D8\u05DF",textSizeNormal:"\u05E8\u05D2\u05D9\u05DC",textSizeLarge:"\u05D2\u05D3\u05D5\u05DC",loading:"\u05D8\u05D5\u05E2\u05DF\u2026",thinking:"\u05D7\u05D5\u05E9\u05D1\u2026",thoughts:"\u05DE\u05D7\u05E9\u05D1\u05D5\u05EA",usedTool:"\u05DB\u05DC\u05D9 \u05D1\u05E9\u05D9\u05DE\u05D5\u05E9",toolResult:"\u05EA\u05D5\u05E6\u05D0\u05D4",sources:"\u05DE\u05E7\u05D5\u05E8\u05D5\u05EA",tabHome:"\u05D1\u05D9\u05EA",tabConversations:"\u05E9\u05D9\u05D7\u05D5\u05EA",tabHelp:"\u05E2\u05D6\u05E8\u05D4",tabNews:"\u05D7\u05D3\u05E9\u05D5\u05EA",modulesEmpty:"\u05D0\u05D9\u05DF \u05DB\u05D0\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DB\u05DC\u05D5\u05DD",moduleBack:"\u05D7\u05D6\u05E8\u05D4",contentLoading:"\u05D8\u05D5\u05E2\u05DF\u2026",homeGreeting:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeGreetingNamed:"\u05E9\u05DC\u05D5\u05DD {name} \u{1F44B}",homeGreetingLead:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",homeContentTitle:"\u05DE\u05D0\u05DE\u05E8\u05D9\u05DD \u05E4\u05D5\u05E4\u05D5\u05DC\u05E8\u05D9\u05D9\u05DD",homeStatus:"\u05E1\u05D8\u05D8\u05D5\u05E1",helpTitle:"\u05E2\u05D6\u05E8\u05D4",helpSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",helpEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DE\u05D0\u05DE\u05E8\u05D9 \u05E2\u05D6\u05E8\u05D4",helpLoading:"\u05D8\u05D5\u05E2\u05DF \u05E2\u05D6\u05E8\u05D4\u2026",helpSearchEmpty:"\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA",newsTitle:"\u05D7\u05D3\u05E9\u05D5\u05EA",newsEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA",newsLoading:"\u05D8\u05D5\u05E2\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA\u2026",newsBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05D7\u05D3\u05E9\u05D5\u05EA",newsPublishedAt:"\u05E4\u05D5\u05E8\u05E1\u05DD \u05D1-{date}",formSubmit:"\u05E9\u05DC\u05D9\u05D7\u05D4",formSkip:"\u05D0\u05D7\u05E8 \u05DB\u05DA",formSubmitted:"\u05E0\u05E9\u05DC\u05D7",formSkipped:"\u05D3\u05D5\u05DC\u05D2",formFillOut:"\u05DE\u05D9\u05DC\u05D5\u05D9",formRequired:"\u05E9\u05D3\u05D4 \u05D7\u05D5\u05D1\u05D4",formInvalidEmail:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidTel:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05EA\u05E7\u05D9\u05DF",formInvalidUrl:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA URL \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidNumber:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",formTooShort:"\u05E7\u05E6\u05E8 \u05DE\u05D3\u05D9 (\u05DC\u05E4\u05D7\u05D5\u05EA {min} \u05EA\u05D5\u05D5\u05D9\u05DD)",formTooLong:"\u05D0\u05E8\u05D5\u05DA \u05DE\u05D3\u05D9 (\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max} \u05EA\u05D5\u05D5\u05D9\u05DD)",formNumberTooSmall:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formNumberTooLarge:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formPatternMismatch:"\u05D4\u05EA\u05D0\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D4\u05E0\u05D3\u05E8\u05E9\u05EA",formChooseAtLeast:"\u05D1\u05D7\u05E8 \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formChooseAtMost:"\u05D1\u05D7\u05E8 \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formOther:"\u05D0\u05D7\u05E8",formOtherPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D0\u05EA \u05EA\u05E9\u05D5\u05D1\u05EA\u05DA\u2026",inputRequired:"\u05E9\u05D0\u05DC\u05D5\u05EA \u05E2\u05D1\u05D5\u05E8\u05DA",inputBadge:"\u05E9\u05D0\u05DC\u05D5\u05EA",inputAnswered:"\u05E0\u05E2\u05E0\u05D4",inputSkipped:"\u05D3\u05D5\u05DC\u05D2",inputSubmit:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05E9\u05D5\u05D1\u05D5\u05EA",inputSubmitHint:"Enter \u05DC\u05E9\u05DC\u05D9\u05D7\u05D4 \xB7 Shift+Enter = \u05E9\u05D5\u05E8\u05D4 \u05D7\u05D3\u05E9\u05D4",inputSkip:"\u05D3\u05D9\u05DC\u05D5\u05D2",confirmYes:"\u05DB\u05DF",confirmNo:"\u05DC\u05D0",approvalRequired:"\u05E0\u05D3\u05E8\u05E9 \u05D0\u05D9\u05E9\u05D5\u05E8",approve:"\u05D0\u05D9\u05E9\u05D5\u05E8",reject:"\u05D3\u05D7\u05D9\u05D9\u05D4",approved:"\u05D0\u05D5\u05E9\u05E8",rejected:"\u05E0\u05D3\u05D7\u05D4",approvalReason:"\u05D4\u05D5\u05E1\u05E3 \u05E1\u05D9\u05D1\u05D4 (\u05D0\u05D5\u05E4\u05E6\u05D9\u05D5\u05E0\u05DC\u05D9)",approvalPrompt:"\u05D4\u05DB\u05DC\u05D9 {tool} \u05D3\u05D5\u05E8\u05E9 \u05D0\u05EA \u05D0\u05D9\u05E9\u05D5\u05E8\u05DA \u05DB\u05D3\u05D9 \u05DC\u05E4\u05E2\u05D5\u05DC.",approvalBody:"\u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05E4\u05E8\u05DE\u05D8\u05E8\u05D9 \u05D4\u05DB\u05DC\u05D9 \u05E9\u05DC\u05DE\u05E2\u05DC\u05D4 \u05D5\u05D4\u05D7\u05DC\u05D8 \u05D0\u05DD \u05DC\u05D0\u05E9\u05E8 \u05E4\u05E2\u05D5\u05DC\u05D4 \u05D6\u05D5.",approvalYourResponse:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA: {decision}",approvalEditHint:"\u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D5\u05DA \u05D0\u05EA \u05EA\u05D2\u05D5\u05D1\u05EA\u05DA \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05EA\u05D7\u05D3\u05E9.",approvalSubmitting:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05DE\u05D1\u05E6\u05E2\u2026",edit:"\u05E2\u05E8\u05D9\u05DB\u05D4",toolParameters:"\u05E4\u05E8\u05DE\u05D8\u05E8\u05D9\u05DD",statusAwaiting:"\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8",statusResponded:"\u05E0\u05E2\u05E0\u05D4",statusRunning:"\u05E4\u05D5\u05E2\u05DC",statusCompleted:"\u05D4\u05D5\u05E9\u05DC\u05DD",statusDenied:"\u05E0\u05D3\u05D7\u05D4",statusError:"\u05E9\u05D2\u05D9\u05D0\u05D4",statusSuperseded:"\u05D3\u05D5\u05DC\u05D2"},Cd={en:Ya,fr:Pd,ar:Sd,es:kd,he:wd};function zn(e,t){let n=Ja(e),o=Un(t),a=n==="en"?{}:Cd[n]??{},i=o?t[n]??{}:t??{},l=o?t.en??{}:{};return{...Ya,...a,...l,...i}}function Ja(e){return(e.split("-")[0]??"en").toLowerCase()}var Ed=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function Qa(e){return Ed.has(Ja(e))}function Te(e,t){return e[t]??t}function Un(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function Za(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function ei(e,t){let{translations:n,defaultLocale:o,...a}=e,i=Za(n,t);return i?{...a,title:i.title??a.title,description:i.description??a.description,content:i.content??a.content}:a}function ti(e,t){let{translations:n,defaultLocale:o,...a}=e,i=Za(n,t);if(!i)return a;let l=new Map((i.fields??[]).map(c=>[c.name,c])),s=a.fields.map(c=>{let d=l.get(c.name);if(!d)return c;let u=new Map((d.options??[]).map(_=>[_.value,_]));return{...c,label:d.label??c.label,placeholder:d.placeholder??c.placeholder,validationHint:d.validationHint??c.validationHint,options:c.options?.map(_=>{let g=u.get(_.value);return g?{..._,label:g.label??_.label,description:g.description??_.description}:_})}});return{...a,title:i.title??a.title,description:i.description??a.description,submitLabel:i.submitLabel??a.submitLabel,fields:s}}var br=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{}}},Wn=new br;var Pr=["off","error","warn","info","debug","trace"],Sr=y.cssPrefix,ni=`${Sr}.debug`,Td=`__${y.global}_DEBUG__`,Rd=`${Sr}-debug`,qn=2,xr=null;function Ad(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(Rd);if(e!==null){let t=yr(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(ni);if(e){let t=yr(e);if(t>=0)return t}}catch{}return window[Td]?4:2}function yr(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=Pr.indexOf(e);if(t>=0)return t}return-1}function Gn(e){let t=yr(e);if(!(t<0)){qn=t;try{window.localStorage?.setItem(ni,Pr[t])}catch{}}}function an(){return Pr[qn]}qn=Ad();function oi(e){let t=`[${Sr}:${e}]`,n=(o,a,i)=>(l,s)=>{if(!(qn<o)&&(s===void 0?console[a](t,l):console[a](t,l,s),xr))try{xr({level:i,scope:e,message:l,payload:s})}catch{}};return{error:n(1,"error","error"),warn:n(2,"warn","warn"),info:n(3,"info","info"),debug:n(4,"debug","debug"),trace:n(5,"debug","trace"),scope:o=>oi(`${e}:${o}`)}}var F=oi("core");function sn(e){xr=e}var ht=F.scope("context"),Id=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),ri=50,kr=1024,Ld=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function wr(e){return ai(e,"userContext",!0)}function Cr(e){return ai(e,"pageContext",!1)}function ai(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){ht.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let o={},a=0;for(let[i,l]of Object.entries(e)){if(Id.has(i)){ht.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(l==null)continue;if(a>=ri){ht.warn(`${t} truncated at ${ri} keys \u2014 dropped "${i}"`);continue}let s=Md(t,i,l);s!==void 0&&(o[i]=s,a++)}return n&&typeof o.email=="string"&&!Ld.test(o.email)&&(ht.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function Md(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){ht.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let o=n.trim();return o===""?void 0:o.length>kr?(ht.warn(`truncated ${e}.${t} to ${kr} chars`),o.slice(0,kr)):o}ht.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var Vn={maxBytes:10485760,maxCount:10,accept:"*/*"},Kn={files:!0,voice:"local",humanInLoop:!0},ii={list:[],byTrigger:{}},Er={enabled:!0,sampleRate:1},jn={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},Lt={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},si={floating:["theme","textSize","history","close","clear","expand","fullscreen","sound","language"],inline:["theme","textSize","history","close","clear","fullscreen","sound","language"],standalone:["theme","textSize","history","clear","sound","language"],page:["theme","textSize","history","clear","sound","language"],modal:["theme","textSize","history","close","clear","fullscreen","sound","language"],drawer:["theme","textSize","history","close","clear","fullscreen","sound","language"]},Tr={enabled:!0,volume:.3,events:void 0},li={enabled:!0,events:void 0},ci=[{label:"tabConversations",layout:"chat"}],di={showSearchBar:!0};function ct(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},o=t.behavior??{},a=t.i18n??{},i=t.feedback??{},l=t.footer??{},s=t.header??{},{themeMode:c,themeOverrides:d}=Nd(t.theme),u=n.mode??"floating",_=Dd(a.defaultLocale),g=a.availableLocales??[a.locale??_],f=Mt(a.locale??_,g,_),m=(t.baseUrl??y.defaultBaseUrl).replace(/\/$/,""),P=(t.agentApiBaseUrl??`${m}/api/agent`).replace(/\/$/,""),v=(t.dataApiBaseUrl??`${m}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:m,agentApiBaseUrl:P,dataApiBaseUrl:v,userContext:wr(t.userContext),pageContext:Cr(t.pageContext),position:n.position??"bottom-right",themeMode:c,textSize:"normal",themeOverrides:d,mode:u,iframe:n.iframe??!1,responseMode:o.responseMode??"streaming",showReasoning:o.showReasoning??!1,showToolCalls:o.showToolCalls??!1,showSources:o.showSources??!1,features:{files:t.features?.files??Kn.files,voice:t.features?.voice??Kn.voice,humanInLoop:t.features?.humanInLoop??Kn.humanInLoop,tools:t.features?.tools},forms:ln(t.forms,f),endpoints:{upload:t.endpoints?.upload??jn.upload,transcribe:t.endpoints?.transcribe??jn.transcribe,submitForm:t.endpoints?.submitForm??jn.submitForm},attachments:{accept:t.composer?.attachments?.accept??Vn.accept,maxBytes:t.composer?.attachments?.maxBytes??Vn.maxBytes,maxCount:t.composer?.attachments?.maxCount??Vn.maxCount},locale:f,defaultLocale:_,availableLocales:g,startMinimized:o.startMinimized??!0,actions:Od(u,s.actions),size:n.size??{},launcher:qd(t.launcher),sound:$d(i.sound),haptics:Hd(i.haptics),strings:zn(f,a.strings),stringsOverride:a.strings,composerDisclaimer:l.composerDisclaimer??"",poweredBy:Fd(l.poweredBy),composer:zd(t.composer),modules:Ud(t.modules),tracking:Bd(t.tracking,v),storage:t.storage??Wn,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function Nd(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function Dd(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function Mt(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function Od(e,t){return t??si[e]}function $d(e){return{enabled:e?.enabled??Tr.enabled,volume:e?.volume??Tr.volume,events:e?.events}}function Hd(e){return{enabled:e?.enabled??li.enabled,events:e?.events}}function Bd(e,t){let n=e?.sampleRate??Er.sampleRate;return{enabled:e?.enabled??Er.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 Fd(e){let n={...{text:`Powered by ${y.displayName}`,href:y.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function zd(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function Ud(e){let t=e===void 0?ci:e,n=new Set,o=[];for(let i of t.slice(0,4)){if(!i?.label||!i?.layout)continue;let l=i.contentTags?.filter(Boolean),s=i.id??l?.[0]??i.layout;for(;n.has(s);)s=`${s}-${o.length}`;n.add(s);let c={id:s,label:i.label,layout:i.layout};l&&l.length>0&&(c.contentTags=l),i.layout==="home"&&(c.brandName=i.brandName,c.greetingText=i.greetingText,c.showGreeting=i.showGreeting??!0,c.showSearchBar=i.showSearchBar??di.showSearchBar,c.showRecentConversations=i.showRecentConversations??!0,i.userAvatars&&i.userAvatars.length>0&&(c.userAvatars=i.userAvatars),i.status&&(c.status=i.status),c.contentBlockTitle=i.contentBlockTitle),o.push(c)}let a=Object.fromEntries(o.map(i=>[i.id,i]));return{list:o,byId:a}}function ln(e,t){var i;if(!e?.length)return ii;let n=[],o=new Set;for(let l of e){if(!l?.id||o.has(l.id))continue;let s=ti(l,t),c=(s.fields??[]).filter(u=>!!(u&&u.name&&u.label&&u.type)),d=(Array.isArray(s.on)?s.on:[s.on]).map(Wd).filter(u=>u!==null);c.length===0||d.length===0||(o.add(s.id),n.push({id:s.id,triggers:d,when:s.when,fields:c,title:s.title,description:s.description,submitLabel:s.submitLabel,skippable:s.skippable??!1,frequency:s.frequency??"once",mirrorToContext:s.mirrorToContext??!0,reopenable:s.reopenable??!0,reviewable:s.reviewable??!0}))}let a={};for(let l of n)for(let s of l.triggers)(a[i=s.kind]??(a[i]=[])).push(l);return{list:n,byTrigger:a}}function Wd(e){if(typeof e!="string")return null;if(e==="pre-chat"||e==="conversation-closed"||e==="panel-close"||e==="manual")return{kind:e};let[t,n]=e.split(":",2);if(t==="after-messages"){let o=Number(n);return Number.isFinite(o)&&o>0?{kind:"after-messages",param:o}:null}if(t==="idle"){let o=Number(n);return Number.isFinite(o)&&o>0?{kind:"idle",param:o}:null}return t==="page-area"&&n?{kind:"page-area",param:n}:null}function qd(e){let t=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??Lt.variant,size:e?.size??Lt.size,label:e?.label??Lt.label,icon:e?.icon??Lt.icon,hidden:e?.hidden??Lt.hidden,callout:t}}function Rr(e,t,n,o){let a=Mt(t,e.availableLocales,e.defaultLocale);if(a===e.locale&&n===e.themeMode&&o===e.textSize)return e;let i={...e};return a!==e.locale&&(i.locale=a,i.strings=zn(a,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),o!==e.textSize&&(i.textSize=o),i}var Gd=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Ar(e,t){if(!t)return e;let n={...e};for(let i of Gd){let l=t[i];if(l===void 0)continue;let s=e[i];if(i==="theme"){s===void 0&&(n[i]=l);continue}i!=="i18n"&&(n[i]=_i(l,s))}t.modules!==void 0&&e.modules===void 0&&(n.modules=t.modules),t.dataApiBaseUrl!==void 0&&e.dataApiBaseUrl===void 0&&(n.dataApiBaseUrl=t.dataApiBaseUrl);let o=e.i18n,a=t.i18n;if(o||a){let i=_i(a??{},o);a?.availableLocales!==void 0&&(i.availableLocales=a.availableLocales),a?.defaultLocale!==void 0&&(i.defaultLocale=a.defaultLocale);let l=o?.strings,s=a?.strings;(l||s)&&(i.strings=Vd(s,l)),n.i18n=i}return n}function _i(e,t){if(!t)return e;let n={...e};for(let[o,a]of Object.entries(t))a!==void 0&&(n[o]=a);return n}function Vd(e,t){if(!e)return t;if(!t)return e;let n=Un(e),o=Un(t);if(!n&&!o)return{...e,...t};let a={},i=n?e:{en:e},l=o?t:{en:t};for(let[s,c]of Object.entries(i))a[s]={...c};for(let[s,c]of Object.entries(l))a[s]={...a[s],...c};return a}var Kd=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],bt=e=>e!=="false",pi=e=>e.split(",").map(t=>t.trim()).filter(Boolean),mi=[["public-key","publicKey"],["ai-agent-deployment-id","aiAgentDeploymentId"],["base-url","baseUrl"],["agent-api-base-url","agentApiBaseUrl"],["data-api-base-url","dataApiBaseUrl"],["theme","theme",e=>e]],fi=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",bt]],gi=[["width","width"],["height","height"]],hi=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",bt],["show-reasoning","showReasoning",bt],["show-tool-calls","showToolCalls",bt],["show-sources","showSources",bt]],vi=[["locale","locale"]],jd=new Set(Kd),Xd=e=>pi(e).filter(t=>jd.has(t)),bi=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",bt]],xi=[["features-files","files",bt],["features-voice","voice",e=>e],["features-tools","tools",pi]],yi=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Pi=[["user-id","id"],["user-email","email"],["user-name","name"]],Si=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],Yd=["launcher-label","callout-text","callout-delay","actions-main","actions-overflow","user-context","page-context"],Jd=[mi,fi,gi,hi,vi,bi,xi,yi,Pi,Si],Qd=new Set(["iframe","start-minimized"]),Ir=[...Jd.flatMap(e=>e.map(([t])=>t).filter(t=>!Qd.has(t))),...Yd];function Xn(e){let t={},n=f=>{let m=e(f);return m===null||m===""?void 0:m};for(let[f,m,P]of mi){let v=n(f);v!==void 0&&(t[m]=P?P(v):v)}let o=vt(n,fi),a=vt(n,gi);(o||a)&&(t.presentation={...o,...a?{size:a}:{}});let i=vt(n,hi);i&&(t.behavior=i);let l=vt(n,vi);l&&(t.i18n=l);let s=e_(e,n);s&&(t.launcher=s);let c=vt(n,xi);c&&(t.features=c);let d=vt(n,yi);d&&(t.endpoints=d);let u=ui(n,Pi,"user-context");u&&(t.userContext=u);let _=ui(n,Si,"page-context");_&&(t.pageContext=_);let g=n("actions");return g!==void 0&&(t.header={actions:Xd(g)}),t}function Lr(e){return e?Xn(t=>e[Zd(t)]??null):{}}function Zd(e){return e.replaceAll(/-([a-z])/g,(t,n)=>n.toUpperCase())}function vt(e,t){let n={};for(let[o,a,i]of t){let l=e(o);l!==void 0&&(n[a]=i?i(l):l)}return Object.keys(n).length>0?n:null}function ui(e,t,n){let o={};for(let[s,c]of t){let d=e(s);d!==void 0&&(o[c]=d)}let a={},i=e(n);if(i)try{let s=JSON.parse(i);s&&typeof s=="object"&&!Array.isArray(s)&&(a=s)}catch{}let l={...a,...o};return Object.keys(l).length>0?l:null}function e_(e,t){let n=vt(t,bi)??{},o=e("launcher-label");o!==null&&(n.label=o);let a=t("callout-text");if(a){let i=Number.parseInt(t("callout-delay")??"",10);n.callout={text:a,...Number.isFinite(i)?{delayMs:i}:{}}}return Object.keys(n).length>0?n:null}var no,Z,Ti,$r,dt,ki,Ri,Ai,Mr,Jn,cn,Ii,Hr,Nr,Dr,t_,Zn={},eo=[],n_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,oo=Array.isArray;function tt(e,t){for(var n in t)e[n]=t[n];return e}function Br(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ro(e,t,n){var o,a,i,l={};for(i in t)i=="key"?o=t[i]:i=="ref"?a=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?no.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)l[i]===void 0&&(l[i]=e.defaultProps[i]);return Qn(e,l,o,a,null)}function Qn(e,t,n,o,a){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++Ti,__i:-1,__u:0};return a==null&&Z.vnode!=null&&Z.vnode(i),i}function te(e){return e.children}function _t(e,t){this.props=e,this.context=t}function Nt(e,t){if(t==null)return e.__?Nt(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Nt(e):null}function o_(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],a=[],i=tt({},t);i.__v=t.__v+1,Z.vnode&&Z.vnode(i),Fr(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??Nt(t),!!(32&t.__u),a),i.__v=t.__v,i.__.__k[i.__i]=i,Di(o,i,a),t.__e=t.__=null,i.__e!=n&&Li(i)}}function Li(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),Li(e)}function wi(e){(!e.__d&&(e.__d=!0)&&dt.push(e)&&!to.__r++||ki!=Z.debounceRendering)&&((ki=Z.debounceRendering)||Ri)(to)}function to(){try{for(var e,t=1;dt.length;)dt.length>t&&dt.sort(Ai),e=dt.shift(),t=dt.length,o_(e)}finally{dt.length=to.__r=0}}function Mi(e,t,n,o,a,i,l,s,c,d,u){var _,g,f,m,P,v,b,S=o&&o.__k||eo,x=t.length;for(c=r_(n,t,S,c,x),_=0;_<x;_++)(f=n.__k[_])!=null&&(g=f.__i!=-1&&S[f.__i]||Zn,f.__i=_,v=Fr(e,f,g,a,i,l,s,c,d,u),m=f.__e,f.ref&&g.ref!=f.ref&&(g.ref&&zr(g.ref,null,f),u.push(f.ref,f.__c||m,f)),P==null&&m!=null&&(P=m),(b=!!(4&f.__u))||g.__k===f.__k?(c=Ni(f,c,e,b),b&&g.__e&&(g.__e=null)):typeof f.type=="function"&&v!==void 0?c=v:m&&(c=m.nextSibling),f.__u&=-7);return n.__e=P,c}function r_(e,t,n,o,a){var i,l,s,c,d,u=n.length,_=u,g=0;for(e.__k=new Array(a),i=0;i<a;i++)(l=t[i])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[i]=Qn(null,l,null,null,null):oo(l)?l=e.__k[i]=Qn(te,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[i]=Qn(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[i]=l,c=i+g,l.__=e,l.__b=e.__b+1,s=null,(d=l.__i=a_(l,n,c,_))!=-1&&(_--,(s=n[d])&&(s.__u|=2)),s==null||s.__v==null?(d==-1&&(a>u?g--:a<u&&g++),typeof l.type!="function"&&(l.__u|=4)):d!=c&&(d==c-1?g--:d==c+1?g++:(d>c?g--:g++,l.__u|=4))):e.__k[i]=null;if(_)for(i=0;i<u;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=Nt(s)),$i(s,s));return o}function Ni(e,t,n,o){var a,i;if(typeof e.type=="function"){for(a=e.__k,i=0;a&&i<a.length;i++)a[i]&&(a[i].__=e,t=Ni(a[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Nt(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function a_(e,t,n,o){var a,i,l,s=e.key,c=e.type,d=t[n],u=d!=null&&(2&d.__u)==0;if(d===null&&s==null||u&&s==d.key&&c==d.type)return n;if(o>(u?1:0)){for(a=n-1,i=n+1;a>=0||i<t.length;)if((d=t[l=a>=0?a--:i++])!=null&&(2&d.__u)==0&&s==d.key&&c==d.type)return l}return-1}function Ci(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||n_.test(t)?n:n+"px"}function Yn(e,t,n,o,a){var i,l;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||Ci(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Ci(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Ii,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n[cn]=o[cn]:(n[cn]=Hr,e.addEventListener(t,i?Dr:Nr,i)):e.removeEventListener(t,i?Dr:Nr,i);else{if(a=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Ei(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[Jn]==null)t[Jn]=Hr++;else if(t[Jn]<n[cn])return;return n(Z.event?Z.event(t):t)}}}function Fr(e,t,n,o,a,i,l,s,c,d){var u,_,g,f,m,P,v,b,S,x,R,z,j,L,V,B=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[s=t.__e=n.__e]),(u=Z.__b)&&u(t);e:if(typeof B=="function")try{if(b=t.props,S=B.prototype&&B.prototype.render,x=(u=B.contextType)&&o[u.__c],R=u?x?x.props.value:u.__:o,n.__c?v=(_=t.__c=n.__c).__=_.__E:(S?t.__c=_=new B(b,R):(t.__c=_=new _t(b,R),_.constructor=B,_.render=s_),x&&x.sub(_),_.state||(_.state={}),_.__n=o,g=_.__d=!0,_.__h=[],_._sb=[]),S&&_.__s==null&&(_.__s=_.state),S&&B.getDerivedStateFromProps!=null&&(_.__s==_.state&&(_.__s=tt({},_.__s)),tt(_.__s,B.getDerivedStateFromProps(b,_.__s))),f=_.props,m=_.state,_.__v=t,g)S&&B.getDerivedStateFromProps==null&&_.componentWillMount!=null&&_.componentWillMount(),S&&_.componentDidMount!=null&&_.__h.push(_.componentDidMount);else{if(S&&B.getDerivedStateFromProps==null&&b!==f&&_.componentWillReceiveProps!=null&&_.componentWillReceiveProps(b,R),t.__v==n.__v||!_.__e&&_.shouldComponentUpdate!=null&&_.shouldComponentUpdate(b,_.__s,R)===!1){t.__v!=n.__v&&(_.props=b,_.state=_.__s,_.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(X){X&&(X.__=t)}),eo.push.apply(_.__h,_._sb),_._sb=[],_.__h.length&&l.push(_);break e}_.componentWillUpdate!=null&&_.componentWillUpdate(b,_.__s,R),S&&_.componentDidUpdate!=null&&_.__h.push(function(){_.componentDidUpdate(f,m,P)})}if(_.context=R,_.props=b,_.__P=e,_.__e=!1,z=Z.__r,j=0,S)_.state=_.__s,_.__d=!1,z&&z(t),u=_.render(_.props,_.state,_.context),eo.push.apply(_.__h,_._sb),_._sb=[];else do _.__d=!1,z&&z(t),u=_.render(_.props,_.state,_.context),_.state=_.__s;while(_.__d&&++j<25);_.state=_.__s,_.getChildContext!=null&&(o=tt(tt({},o),_.getChildContext())),S&&!g&&_.getSnapshotBeforeUpdate!=null&&(P=_.getSnapshotBeforeUpdate(f,m)),L=u!=null&&u.type===te&&u.key==null?Oi(u.props.children):u,s=Mi(e,oo(L)?L:[L],t,n,o,a,i,l,s,c,d),_.base=t.__e,t.__u&=-161,_.__h.length&&l.push(_),v&&(_.__E=_.__=null)}catch(X){if(t.__v=null,c||i!=null)if(X.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s}else{for(V=i.length;V--;)Br(i[V]);Or(t)}else t.__e=n.__e,t.__k=n.__k,X.then||Or(t);Z.__e(X,t,n)}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=i_(n.__e,t,n,o,a,i,l,c,d);return(u=Z.diffed)&&u(t),128&t.__u?void 0:s}function Or(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Or))}function Di(e,t,n){for(var o=0;o<n.length;o++)zr(n[o],n[++o],n[++o]);Z.__c&&Z.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){Z.__e(i,a.__v)}})}function Oi(e){return typeof e!="object"||e==null||e.__b>0?e:oo(e)?e.map(Oi):e.constructor!==void 0?null:tt({},e)}function i_(e,t,n,o,a,i,l,s,c){var d,u,_,g,f,m,P,v=n.props||Zn,b=t.props,S=t.type;if(S=="svg"?a="http://www.w3.org/2000/svg":S=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((f=i[d])&&"setAttribute"in f==!!S&&(S?f.localName==S:f.nodeType==3)){e=f,i[d]=null;break}}if(e==null){if(S==null)return document.createTextNode(b);e=document.createElementNS(a,S,b.is&&b),s&&(Z.__m&&Z.__m(t,i),s=!1),i=null}if(S==null)v===b||s&&e.data==b||(e.data=b);else{if(i=S=="textarea"&&b.defaultValue!=null?null:i&&no.call(e.childNodes),!s&&i!=null)for(v={},d=0;d<e.attributes.length;d++)v[(f=e.attributes[d]).name]=f.value;for(d in v)f=v[d],d=="dangerouslySetInnerHTML"?_=f:d=="children"||d in b||d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b||Yn(e,d,null,f,a);for(d in b)f=b[d],d=="children"?g=f:d=="dangerouslySetInnerHTML"?u=f:d=="value"?m=f:d=="checked"?P=f:s&&typeof f!="function"||v[d]===f||Yn(e,d,f,v[d],a);if(u)s||_&&(u.__html==_.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(_&&(e.innerHTML=""),Mi(t.type=="template"?e.content:e,oo(g)?g:[g],t,n,o,S=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,l,i?i[0]:n.__k&&Nt(n,0),s,c),i!=null)for(d=i.length;d--;)Br(i[d]);s&&S!="textarea"||(d="value",S=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[d]||S=="progress"&&!m||S=="option"&&m!=v[d])&&Yn(e,d,m,v[d],a),d="checked",P!=null&&P!=e[d]&&Yn(e,d,P,v[d],a))}return e}function zr(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(a){Z.__e(a,n)}}function $i(e,t,n){var o,a;if(Z.unmount&&Z.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||zr(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){Z.__e(i,t)}o.base=o.__P=null}if(o=e.__k)for(a=0;a<o.length;a++)o[a]&&$i(o[a],t,n||typeof e.type!="function");n||Br(e.__e),e.__c=e.__=e.__e=void 0}function s_(e,t,n){return this.constructor(e,n)}function Dt(e,t,n){var o,a,i,l;t==document&&(t=document.documentElement),Z.__&&Z.__(e,t),a=(o=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],Fr(t,e=(!o&&n||t).__k=ro(te,null,[e]),a||Zn,Zn,t.namespaceURI,!o&&n?[n]:a?null:t.firstChild?no.call(t.childNodes):null,i,!o&&n?n:a?a.__e:t.firstChild,o,l),Di(i,e,l)}no=eo.slice,Z={__e:function(e,t,n,o){for(var a,i,l;t=t.__;)if((a=t.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(e)),l=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,o||{}),l=a.__d),l)return a.__E=a}catch(s){e=s}throw e}},Ti=0,$r=function(e){return e!=null&&e.constructor===void 0},_t.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=tt({},this.state),typeof e=="function"&&(e=e(tt({},n),this.props)),e&&tt(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),wi(this))},_t.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),wi(this))},_t.prototype.render=te,dt=[],Ri=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ai=function(e,t){return e.__v.__b-t.__v.__b},to.__r=0,Mr=Math.random().toString(8),Jn="__d"+Mr,cn="__a"+Mr,Ii=/(PointerCapture)$|Capture$/i,Hr=0,Nr=Ei(!1),Dr=Ei(!0),t_=0;var Ot="0.54.2";function Hi(e){return`${y.cssPrefix}:${e}`}function dn(e,t,n){e.dispatchEvent(new CustomEvent(Hi(t),{detail:n}))}function Bi(e,t){let o=Object.entries(t).map(([a,i])=>{let l=Hi(a),s=c=>i(c.detail);return e.addEventListener(l,s),[l,s]});return()=>{for(let[a,i]of o)e.removeEventListener(a,i)}}function Ue(){let e=Date.now(),t=new Uint8Array(16);t[0]=Math.floor(e/2**40)&255,t[1]=Math.floor(e/2**32)&255,t[2]=e>>>24&255,t[3]=e>>>16&255,t[4]=e>>>8&255,t[5]=e&255,l_(t.subarray(6)),t[6]=t[6]&15|112,t[8]=t[8]&63|128;let n=Array.from(t,o=>o.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function l_(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 xt=F.scope("persistence");function ut(e,t=Wn,n){let o=n?`${e}.${n}`:e,a=`${y.cssPrefix}.storageVersion`,i=t.get(a)??void 0,l=i?`.v${i}`:"",s=`${y.cssPrefix}.${o}${l}`,c=`${y.cssPrefix}${l}.visitorId`,d=`${s}.conversationId`,u=`${s}.userPrefs`,_=`${s}.panelOpen`,g=`${s}.panelSize`,f=`${s}.calloutDismissed`,m=`${s}.sidebarCollapsed`,P=`${s}.activeModule`,v=`${s}.historyCount`,b=`${s}.formsDone`,S={getVisitorId(){let x=t.get(c);if(x)return x;let R=Ue();return t.set(c,R),R},setVisitorId(x){xt.debug("setVisitorId (rebind)",{id:x,scope:o}),t.set(c,x)},loadConversationId(){return t.get(d)??void 0},saveConversationId(x){xt.trace("saveConversationId",{id:x,scope:o}),x?t.set(d,x):t.remove(d)},loadUserPrefs(){let x=t.get(u);if(!x)return{};try{let R=JSON.parse(x);return Fi(R)?R:{}}catch(R){return xt.warn("loadUserPrefs parse failed",{error:R}),{}}},saveUserPrefs(x){try{t.set(u,JSON.stringify(x))}catch(R){xt.warn("saveUserPrefs serialise failed",{error:R})}},patchUserPrefs(x){let R=S.loadUserPrefs();S.saveUserPrefs({...R,...x})},loadPanelOpen(){let x=t.get(_);return x==="1"?!0:x==="0"?!1:null},savePanelOpen(x){t.set(_,x?"1":"0")},loadPanelSize(){let x=t.get(g);return x==="normal"||x==="expanded"||x==="fullscreen"?x:null},savePanelSize(x){t.set(g,x)},loadCalloutDismissed(x){if(!x)return!1;let R=t.get(f);return!!R&&R===x},saveCalloutDismissed(x){x?t.set(f,x):t.remove(f)},loadSidebarCollapsed(){let x=t.get(m);return x==="1"?!0:x==="0"?!1:null},saveSidebarCollapsed(x){t.set(m,x?"1":"0")},loadActiveModule(){return t.get(P)||null},saveActiveModule(x){t.set(P,x)},loadHistoryCount(){let x=t.get(v);if(!x)return null;let R=Number.parseInt(x,10);return Number.isFinite(R)&&R>=0?R:null},saveHistoryCount(x){t.set(v,String(x))},loadFormsDone(){let x=t.get(b);if(!x)return{};try{let R=JSON.parse(x);return Fi(R)?R:{}}catch(R){return xt.warn("loadFormsDone parse failed",{error:R}),{}}},saveFormDone(x){try{let R=S.loadFormsDone();R[x]=Date.now(),t.set(b,JSON.stringify(R))}catch(R){xt.warn("saveFormDone serialise failed",{error:R})}},rememberStorageVersion(x){x&&x!==t.get(a)&&(xt.debug("rememberStorageVersion (force-reset on next load)",{version:x}),t.set(a,x))},clearConversation(){t.remove(d)}};return S}function Fi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var zi=`:host{--__P__-accent-user: __BRAND_ACCENT__;--__P__-accent: var(--__P__-accent-user);--__P__-accent-text-user: __BRAND_ACCENT_TEXT__;--__P__-accent-text: var(--__P__-accent-text-user);--__P__-radius: __BRAND_RADIUS__;--__P__-radius-sm: 8px;--__P__-radius-md: 10px;--__P__-radius-lg: 16px;--__P__-font: __BRAND_FONT__;--__P__-font-display: var(--__P__-font);--__P__-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;--__P__-bg: oklch(1 0 0);--__P__-bg-elevated: oklch(.9789 .0029 278.3);--__P__-surface: var(--__P__-bg-elevated);--__P__-muted: var(--__P__-fg-muted);--__P__-hover: oklch(.1686 .011 278.3 / .06);--__P__-fg: oklch(.1686 .011 278.3);--__P__-fg-muted: oklch(.4932 .0301 278.3);--__P__-border: oklch(.9312 .0084 278.3);--__P__-border-strong: oklch(.8757 .0131 278.3);--__P__-bubble-user: var(--__P__-accent);--__P__-bubble-user-text: var(--__P__-accent-text);--__P__-bubble-assistant: oklch(.9638 .0058 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-on-accent: var(--__P__-accent-text);--__P__-success: oklch(.6456 .1654 151.53);--__P__-warning: oklch(.7135 .1494 74.05);--__P__-danger: oklch(.5966 .1818 24.51);--__P__-danger-text: oklch(.5054 .1905 27.52);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .1);--__P__-neutral: oklch(.7137 .0192 278.3);--__P__-focus: var(--__P__-accent);--__P__-shadow-panel: 0 8px 24px -8px rgba(13, 15, 20, .18), 0 24px 64px -24px rgba(13, 15, 20, .24);--__P__-shadow-card: 0 1px 2px rgba(13, 15, 20, .06), 0 4px 12px -6px rgba(13, 15, 20, .12);--__P__-backdrop: oklch(.1686 .011 278.3 / .55);--__P__-shadow-fab: 0 6px 16px -4px color-mix(in oklch, var(--__P__-accent) 45%, transparent), 0 12px 32px -12px rgba(13, 15, 20, .25);--__P__-z-fab: 2147483600;--__P__-z-panel: 2147483601;--__P__-panel-w: 380px;--__P__-panel-h: 600px;--__P__-fab-size: 56px;--__P__-conversation-max: 768px;--__P__-space-1: 4px;--__P__-space-2: 8px;--__P__-space-3: 12px;--__P__-space-4: 16px;--__P__-space-5: 20px;--__P__-space-6: 24px;--__P__-space-8: 32px;--__P__-text-scale: 1;--__P__-text-xs: calc(12px * var(--__P__-text-scale));--__P__-text-sm: calc(13px * var(--__P__-text-scale));--__P__-text-base: calc(15px * var(--__P__-text-scale));--__P__-text-md: calc(16px * var(--__P__-text-scale));--__P__-text-lg: calc(18px * var(--__P__-text-scale));--__P__-text-xl: calc(22px * var(--__P__-text-scale));--__P__-text-2xl: calc(30px * var(--__P__-text-scale))}:host([data-text-size="small"]){--__P__-text-scale: .9}:host([data-text-size="large"]){--__P__-text-scale: 1.15}:host{--__P__-ease: cubic-bezier(.2, .7, .2, 1);--__P__-ease-out: cubic-bezier(.2, .7, .2, 1);--__P__-ease-in: cubic-bezier(.4, 0, 1, 1);--__P__-ease-in-out: cubic-bezier(.65, 0, .35, 1);--__P__-dur-quick: .12s;--__P__-dur-base: .22s;--__P__-dur-slow: .32s;font-family:var(--__P__-font);color:var(--__P__-fg);color-scheme:light;--__P__-color-scheme: light}:host([data-theme="dark"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-danger-text: oklch(.8077 .1035 19.57);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .18);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);--__P__-shadow-card: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px -6px rgba(0, 0, 0, .5);--__P__-backdrop: rgba(0, 0, 0, .65);color-scheme:dark;--__P__-color-scheme: dark}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);color-scheme:dark;--__P__-color-scheme: dark}}@supports (color: oklch(from red l c h)){:host{--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.3, l, .62) c h);--__P__-accent-text: oklch(from var(--__P__-accent) clamp(0, (l / .623 - 1) * -infinity, 1) 0 h)}:host([data-theme="dark"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h)}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h)}}}@media(prefers-reduced-motion:reduce){:host{--__P__-dur-quick: 1ms;--__P__-dur-base: 1ms;--__P__-dur-slow: 1ms}}
2
- `;var Ui=`*,*:before,*:after{box-sizing:border-box;margin:0;padding:0;border:0}button{font:inherit;color:inherit;background:none;cursor:pointer;-webkit-appearance:none;appearance:none;line-height:1}button:focus-visible,[tabindex]:focus-visible,textarea:focus-visible,input:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}textarea,input{font:inherit;color:inherit;background:none;border:0;outline:0;resize:none}a{color:var(--__P__-accent);text-decoration:underline;text-underline-offset:2px}img,svg{display:block;max-width:100%}ul,ol{list-style:none}.__P__-app{display:block;width:100%;height:100%;font-family:var(--__P__-font);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:"cv11","ss01","ss03"}.__P__-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
3
- `;var Wi=`.__P__-anchor{color-scheme:var(--__P__-color-scheme, light);right:16px;bottom:16px}.__P__-surface{display:contents}.__P__-surface[hidden]{display:none}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:calc(14px * var(--__P__-text-scale))}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:calc(14px * var(--__P__-text-scale));background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:color-mix(in srgb,currentColor 15%,transparent)}.__P__-callout-close:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}@media(prefers-reduced-motion:no-preference){.__P__-panel{transition:width var(--__P__-dur-base) var(--__P__-ease),height var(--__P__-dur-base) var(--__P__-ease),max-width var(--__P__-dur-base) var(--__P__-ease),max-height var(--__P__-dur-base) var(--__P__-ease)}.__P__-panel[data-resizing]{transition:none}}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;padding:0;justify-content:flex-end;align-items:flex-end}:host([data-mode="fullscreen"][data-position*="top"]) .__P__-anchor{justify-content:flex-start}:host([data-mode="fullscreen"][data-position*="left"]) .__P__-anchor{align-items:flex-start}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}@media(max-width:640px){:host([data-mode="open"]) .__P__-anchor,:host([data-mode="expanded"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="open"]) .__P__-panel,:host([data-mode="expanded"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-inline-start:auto;display:flex;align-items:center;gap:var(--__P__-space-1);flex-shrink:0}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list,.__P__-history,.__P__-module-scroll,.__P__-home-scroll,.__P__-help-list,.__P__-toolui-code,.__P__-sidebar-conversations{scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;overscroll-behavior:contain;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar,.__P__-history::-webkit-scrollbar,.__P__-module-scroll::-webkit-scrollbar,.__P__-home-scroll::-webkit-scrollbar,.__P__-help-list::-webkit-scrollbar,.__P__-toolui-code::-webkit-scrollbar,.__P__-sidebar-conversations::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb,.__P__-history::-webkit-scrollbar-thumb,.__P__-module-scroll::-webkit-scrollbar-thumb,.__P__-home-scroll::-webkit-scrollbar-thumb,.__P__-help-list::-webkit-scrollbar-thumb,.__P__-toolui-code::-webkit-scrollbar-thumb,.__P__-sidebar-conversations::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-list-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;inset-inline-end:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px}.__P__-list>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-date-divider{display:flex;justify-content:center;margin-block:var(--__P__-space-3)}.__P__-date-pill{padding:3px 10px;border-radius:999px;font-size:calc(11px * var(--__P__-text-scale));font-weight:600;color:var(--__P__-fg-muted);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);box-shadow:var(--__P__-shadow-card)}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:100%;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:calc(14px * var(--__P__-text-scale));word-wrap:break-word;overflow-wrap:break-word;box-shadow:0 1px 2px #0000000a,0 1px 8px -4px #0000000f;animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-bubble ::selection{background:color-mix(in srgb,var(--__P__-accent) 30%,transparent)}.__P__-bubble-row[data-role=user] .__P__-bubble ::selection{background:#fff6;color:var(--__P__-bubble-user-text)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-end-end-radius:5px}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-end-start-radius:5px}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui){width:100%}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui) .__P__-bubble{width:100%}@media(max-width:640px){.__P__-bubble-col{max-width:92%}.__P__-toolui:not(.__P__-toolui-collapsible){padding:var(--__P__-space-3);gap:var(--__P__-space-2)}details.__P__-toolui-collapsible>summary{padding:var(--__P__-space-2) var(--__P__-space-3)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-3)}.__P__-toolui-section,.__P__-toolui-desc{padding:var(--__P__-space-2) var(--__P__-space-3)}}.__P__-bubble-time{margin-top:3px;padding:0 4px;font-size:calc(11px * var(--__P__-text-scale));line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-inline-start:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-inline-start:2px}.__P__-md li::marker{color:var(--__P__-fg-muted)}.__P__-md li>p{margin:6px 0}.__P__-md li>ul,.__P__-md li>ol{margin:6px 0}.__P__-md strong,.__P__-md b{font-weight:650;letter-spacing:-.005em}.__P__-md em,.__P__-md i{font-style:italic}.__P__-md code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:calc(12.5px * var(--__P__-text-scale));padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-inline-start:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-start-end-radius:var(--__P__-radius-sm);border-end-end-radius:var(--__P__-radius-sm);color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:start}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:5px;height:5px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-inline-start:var(--__P__-space-3);border-inline-start:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary:hover{color:var(--__P__-fg)}.__P__-reasoning-summary:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-inline-end:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-source{display:inline-flex;align-items:center;gap:6px;max-width:100%;margin-top:6px;margin-inline-end:6px;padding:var(--__P__-space-1) var(--__P__-space-2);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);text-decoration:none}a.__P__-source:hover{color:var(--__P__-fg);border-color:var(--__P__-accent)}.__P__-source-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:calc(14px * var(--__P__-text-scale));line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-sm);background:color-mix(in oklab,var(--__P__-danger) 8%,var(--__P__-bg-elevated));border:1px solid color-mix(in oklab,var(--__P__-danger) 20%,transparent);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error span{min-width:0}.__P__-error button{margin-inline-start:auto;flex-shrink:0;border:0;background:none;padding:0;color:var(--__P__-accent);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;text-decoration:underline;white-space:nowrap;cursor:pointer}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-3)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:14px 4px 8px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-card{display:flex;flex-direction:column;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);overflow:hidden}.__P__-history-item{all:unset;display:flex;align-items:center;gap:var(--__P__-space-3);padding:12px var(--__P__-space-3);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item+.__P__-history-item{border-top:1px solid var(--__P__-border)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-avatar{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent)}.__P__-history-avatar svg{width:18px;height:18px}.__P__-history-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.__P__-history-row{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2)}.__P__-history-title{flex:1;min-width:0;font-size:calc(14px * var(--__P__-text-scale));font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-time{flex:none;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-history-preview{flex:1;min-width:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-history-item[data-unread=true] .__P__-history-title{font-weight:600}.__P__-history-item[data-closed=true] .__P__-history-title{color:var(--__P__-fg-muted)}.__P__-history-item-skeleton{cursor:default;pointer-events:none}.__P__-skeleton{display:block;border-radius:4px;background:linear-gradient(90deg,color-mix(in oklab,var(--__P__-fg) 9%,transparent) 30%,color-mix(in oklab,var(--__P__-fg) 17%,transparent),color-mix(in oklab,var(--__P__-fg) 9%,transparent) 70%);background-size:200% 100%;animation:__P__-skeleton-shimmer 1.8s ease-in-out infinite}.__P__-history-avatar.__P__-skeleton{border-radius:50%}.__P__-skeleton-heading{width:52px;height:8px}.__P__-skeleton-title{width:55%;height:12px}.__P__-skeleton-time{width:34px;height:10px}.__P__-skeleton-preview{width:80%;height:10px}@keyframes __P__-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.__P__-skeleton{animation:none}}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:calc(11px * var(--__P__-text-scale));line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:calc(11px * var(--__P__-text-scale));letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;inset-inline-end:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent)}.__P__-menu-check svg{width:14px;height:14px}.__P__-menu-item-segmented{cursor:default}.__P__-menu-item-segmented:hover{background:transparent}.__P__-segmented{display:inline-flex;gap:2px;padding:2px;background:var(--__P__-bg-elevated);border-radius:var(--__P__-radius-sm)}.__P__-segment{all:unset;min-width:26px;padding:3px 8px;font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.02em;text-align:center;color:var(--__P__-fg-muted);border-radius:calc(var(--__P__-radius-sm) - 2px);cursor:pointer;transition:color .12s ease,background .12s ease}.__P__-segment:hover{color:var(--__P__-fg)}.__P__-segment[data-on=true]{background:var(--__P__-bg);color:var(--__P__-accent);box-shadow:var(--__P__-shadow-card)}.__P__-segment:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body,.__P__-messenger-pane{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-pane[hidden]{display:none}@keyframes __P__-view-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}@media(prefers-reduced-motion:no-preference){.__P__-module,.__P__-history{animation:__P__-view-in .18s var(--__P__-ease-out)}}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{container-type:inline-size;background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-4px;left:calc(50% + 6px);min-width:16px;height:16px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:var(--__P__-accent);color:var(--__P__-on-accent);font-size:calc(10px * var(--__P__-text-scale));font-weight:600;line-height:1}.__P__-home-hero{flex-shrink:0;padding:var(--__P__-space-5) var(--__P__-space-5) var(--__P__-space-3);color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-home-hero-top{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);min-height:32px}.__P__-home-brand{font-size:clamp(calc(12px * var(--__P__-text-scale)),calc(3.2cqi * var(--__P__-text-scale)),calc(14px * var(--__P__-text-scale)));font-weight:600;letter-spacing:.01em;color:color-mix(in srgb,#fff 82%,transparent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.__P__-home-brand-spacer{flex:1}.__P__-home-hero-actions{display:flex;align-items:center;gap:var(--__P__-space-2);flex-shrink:0}.__P__-home-hero-actions .__P__-icon-btn{color:#fff}.__P__-home-hero-actions .__P__-icon-btn:hover{background:color-mix(in srgb,#fff 18%,transparent);color:#fff}.__P__-home-hero-actions .__P__-icon-btn:active{background:color-mix(in srgb,#fff 26%,transparent)}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(19px * var(--__P__-text-scale)),calc(5.5cqi * var(--__P__-text-scale)),var(--__P__-text-2xl));font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:10px 0 0;font-family:var(--__P__-font-display);font-size:clamp(calc(15px * var(--__P__-text-scale)),calc(4.2cqi * var(--__P__-text-scale)),var(--__P__-text-xl));font-weight:600;line-height:1.25;letter-spacing:-.005em;color:color-mix(in srgb,var(--__P__-on-accent) 78%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-inline-start:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-inline-start:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:start;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:start}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:calc(14px * var(--__P__-text-scale));color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:start;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-hover)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:start;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;inset-inline-end:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-form{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-field{display:flex;flex-direction:column;gap:6px}.__P__-field-label{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-field-req{color:var(--__P__-danger)}.__P__-field-input{width:100%;min-width:0;max-width:100%;box-sizing:border-box;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);resize:vertical;transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-field-input:focus-visible{outline:none;border-color:var(--__P__-accent)}.__P__-field[data-invalid=true] .__P__-field-input{border-color:var(--__P__-danger)}.__P__-field-input[type=date],.__P__-field-input[type=time]{appearance:none;-webkit-appearance:none}@media(pointer:coarse){.__P__-field-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}}.__P__-field-hint{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-field-error{font-size:var(--__P__-text-xs);color:var(--__P__-danger)}.__P__-field-choices{display:flex;flex-direction:column;gap:10px;padding-top:2px}.__P__-choice{display:flex;align-items:flex-start;gap:10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);cursor:pointer}.__P__-choice input{margin-top:2px;accent-color:var(--__P__-accent)}.__P__-form-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}.__P__-form-hint{flex:1 1 auto;min-width:6rem;margin-inline-end:auto;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-form-submit{padding:var(--__P__-space-2) var(--__P__-space-4);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-submit:hover:not(:disabled){filter:brightness(1.06)}.__P__-form-submit:disabled{opacity:.6;cursor:default}.__P__-form-skip{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:transparent;color:var(--__P__-fg-muted);font:inherit;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-skip:hover:not(:disabled){background:var(--__P__-bg-elevated)}@media(max-width:640px){.__P__-form-hint{flex-basis:100%;margin-inline-end:0;font-size:var(--__P__-text-xs)}.__P__-form-submit,.__P__-form-skip{flex:1 1 0;text-align:center}}.__P__-form-gate{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-form-gate-title{margin:0;font-size:var(--__P__-text-base);font-weight:700;color:var(--__P__-fg)}.__P__-form-gate-desc{margin:0 0 var(--__P__-space-1);font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-form-done{display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border:1px dashed var(--__P__-border);border-radius:999px;align-self:center;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted)}.__P__-form-done svg{width:14px;height:14px;color:var(--__P__-success, #22c55e)}.__P__-form-done[data-outcome=skipped] svg{color:var(--__P__-fg-muted)}.__P__-form-done-fill{border:0;background:none;padding:0 2px;cursor:pointer;font:inherit;font-weight:600;color:var(--__P__-accent)}.__P__-form-done-fill:hover{text-decoration:underline}details.__P__-form-done{display:block;padding:0;border-radius:var(--__P__-radius-md)}details[open].__P__-form-done{width:min(100%,420px);background:var(--__P__-surface)}.__P__-form-done-summary{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;cursor:pointer;list-style:none}.__P__-form-done-summary::-webkit-details-marker{display:none}.__P__-form-done-summary>svg:last-child{color:var(--__P__-fg-muted);transition:transform .15s var(--__P__-ease)}details[open]>.__P__-form-done-summary>svg:last-child{transform:rotate(90deg)}.__P__-form-answers{margin:0;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);display:grid;gap:var(--__P__-space-3);text-align:start}.__P__-form-answer{display:grid;gap:6px}.__P__-form-answer dt{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-form-answer dd{margin:0;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);font-size:var(--__P__-text-sm);font-weight:400;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui{margin-block:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);background:var(--__P__-bg-elevated);font-size:var(--__P__-text-sm)}.__P__-toolui:not(.__P__-toolui-collapsible){display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-group{display:flex;flex-direction:column;gap:var(--__P__-space-3);margin-block:var(--__P__-space-3)}.__P__-toolui-group>.__P__-toolui{margin-block:0}.__P__-toolui-stale{opacity:.7}details.__P__-toolui-collapsible>summary{display:flex;align-items:center;gap:var(--__P__-space-2);padding:var(--__P__-space-3) var(--__P__-space-4);cursor:pointer;list-style:none}details.__P__-toolui-collapsible>summary::-webkit-details-marker{display:none}details.__P__-toolui-collapsible[open]>summary{border-bottom:1px solid var(--__P__-border)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-4)}details.__P__-toolui-collapsible>.__P__-toolui-section~.__P__-toolui-section{margin-top:calc(-1 * var(--__P__-space-2))}.__P__-toolui-wrench{display:inline-flex;color:var(--__P__-fg-muted)}.__P__-toolui-wrench svg{width:15px;height:15px}.__P__-toolui-title{font-weight:600;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui-chevron{display:inline-flex;margin-inline-start:auto;color:var(--__P__-fg-muted);transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-toolui-chevron svg{width:16px;height:16px}details.__P__-toolui-collapsible[open]>summary .__P__-toolui-chevron{transform:rotate(180deg)}.__P__-toolui-badge{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:999px;border:1px solid var(--__P__-border-strong);background:var(--__P__-bg);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;white-space:nowrap}.__P__-toolui-badge-accent{border-color:color-mix(in oklab,var(--__P__-warning, #f59e0b) 55%,transparent);background:color-mix(in oklab,var(--__P__-warning, #f59e0b) 12%,transparent);color:var(--__P__-warning, #f59e0b)}.__P__-toolui-badge-muted{border-color:color-mix(in oklab,var(--__P__-fg-muted) 50%,transparent);background:color-mix(in oklab,var(--__P__-fg-muted) 14%,transparent);color:var(--__P__-fg)}.__P__-toolui-status-icon{display:inline-flex}.__P__-toolui-status-icon svg{width:14px;height:14px}.__P__-toolui-status[data-status=awaiting] .__P__-toolui-status-icon{color:var(--__P__-warning, #f59e0b)}.__P__-toolui-status[data-status=responded] .__P__-toolui-status-icon{color:var(--__P__-accent)}.__P__-toolui-status[data-status=completed] .__P__-toolui-status-icon{color:var(--__P__-success, #16a34a)}.__P__-toolui-status[data-status=denied] .__P__-toolui-status-icon{color:#ea580c}.__P__-toolui-status[data-status=error] .__P__-toolui-status-icon{color:var(--__P__-danger, #dc2626)}.__P__-toolui-head{display:flex;align-items:center;flex-wrap:wrap;gap:var(--__P__-space-2)}.__P__-toolui-desc{margin:0;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-section{display:flex;flex-direction:column;gap:8px;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border)}.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-section,.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-desc{padding:0;background:none;border:0;border-radius:0}.__P__-toolui-label{font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--__P__-fg-muted)}.__P__-toolui-text{margin:0;font-size:var(--__P__-text-base);font-weight:600;color:var(--__P__-fg);line-height:1.55;overflow-wrap:anywhere}.__P__-toolui-code{margin:0;max-height:240px;overflow:auto;color:var(--__P__-fg);font-family:var(--__P__-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:var(--__P__-text-xs);line-height:1.5;white-space:pre-wrap;word-break:break-word}.__P__-toolui-code[data-error=true]{color:var(--__P__-danger, #dc2626)}.__P__-toolui-body{gap:6px}.__P__-toolui-prompt{margin:0;font-weight:600;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui-subtle{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}:host([dir="rtl"]) .__P__-icon-dir{transform:scaleX(-1)}:host([dir="rtl"]) .__P__-field-input[type=date],:host([dir="rtl"]) .__P__-field-input[type=time]{position:relative;text-align:right;padding-left:34px}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-datetime-edit,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-datetime-edit{text-align:right}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-calendar-picker-indicator,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-calendar-picker-indicator{position:absolute;left:var(--__P__-space-3);margin:0}
4
- `;var qi=`.__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}
5
- `;var Gi=`:host([data-mode="page"]){min-height:0}:host([data-mode="page"]) .__P__-page-shell{display:grid;grid-template-columns:280px 1fr;width:100%;height:100%;min-height:0;background:var(--__P__-bg);color:var(--__P__-fg);transition:grid-template-columns var(--__P__-dur-base) var(--__P__-ease-in-out)}:host([data-mode="page"]) .__P__-page-shell[data-sidebar-collapsed=true]{grid-template-columns:48px 1fr}:host([data-mode="page"]) .__P__-page-chat{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}:host([data-mode="page"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-width:0;min-height:0;flex:1 1 0}:host([data-mode="page"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;border-radius:0;border:0;box-shadow:none;animation:none}:host([data-mode="page"]) .__P__-sidebar{border-inline-end:1px solid var(--__P__-border);display:flex;flex-direction:column;overflow:hidden;background:var(--__P__-surface)}:host([data-mode="page"]) .__P__-sidebar-header{padding:var(--__P__-space-4) var(--__P__-space-5);border-bottom:1px solid var(--__P__-border);display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2);min-height:56px;box-sizing:border-box}:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-header{padding:var(--__P__-space-4) var(--__P__-space-2);justify-content:center}:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-logo,:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-title{display:none}:host([data-mode="page"]) .__P__-sidebar-toggle{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid var(--__P__-border);border-radius:6px;background:transparent;color:var(--__P__-fg);cursor:pointer;transition:background .12s,border-color .12s}:host([data-mode="page"]) .__P__-sidebar-toggle:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}:host([data-mode="page"]) .__P__-sidebar-toggle:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}:host([data-mode="page"]) .__P__-sidebar-logo{height:32px;display:block}:host([data-mode="page"]) .__P__-sidebar-title{font-size:var(--__P__-text-md);font-weight:600}:host([data-mode="page"]) .__P__-sidebar-section{padding:var(--__P__-space-3) var(--__P__-space-4);border-bottom:1px solid var(--__P__-border)}:host([data-mode="page"]) .__P__-sidebar-nav{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}:host([data-mode="page"]) .__P__-sidebar-nav-item{display:flex;align-items:center;gap:10px;padding:var(--__P__-space-2) var(--__P__-space-3);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);text-decoration:none;font-size:calc(14px * var(--__P__-text-scale));transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}:host([data-mode="page"]) .__P__-sidebar-nav-item:hover{background:var(--__P__-hover)}:host([data-mode="page"]) .__P__-sidebar-nav-item:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}:host([data-mode="page"]) .__P__-sidebar-cards{display:grid;grid-template-columns:1fr;gap:var(--__P__-space-2)}:host([data-mode="page"]) .__P__-sidebar-card{display:block;padding:10px 12px;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm);text-decoration:none;color:var(--__P__-fg);transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}:host([data-mode="page"]) .__P__-sidebar-card:hover{border-color:var(--__P__-accent)}:host([data-mode="page"]) .__P__-sidebar-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}:host([data-mode="page"]) .__P__-sidebar-card-label{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}:host([data-mode="page"]) .__P__-sidebar-card-desc{font-size:var(--__P__-text-xs);color:var(--__P__-muted);margin-top:2px}:host([data-mode="page"]) .__P__-sidebar-conversations{flex:1 1 auto;overflow-y:auto;padding:var(--__P__-space-3) var(--__P__-space-4)}:host([data-mode="page"]) .__P__-page-chat{display:flex;flex-direction:column;overflow:hidden}@media(max-width:768px){:host([data-mode="page"]) .__P__-page-shell{grid-template-columns:1fr}:host([data-mode="page"]) .__P__-sidebar{display:none}}
6
- `;var m_="helpai",f_="#5B5BD6",g_="#FFFFFF",h_="12px",v_="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",Ur=[zi,Ui,Wi,qi,Gi].join(`
7
- `).replace(/__P__/g,m_).replaceAll("__BRAND_ACCENT_TEXT__",g_).replaceAll("__BRAND_ACCENT__",f_).replaceAll("__BRAND_RADIUS__",h_).replaceAll("__BRAND_FONT__",v_);var b_=F.scope("mount"),Vi=new WeakMap,Ki={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 ji(e,t){e.style.cssText=Ki[t]}function yt(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function $t(e={}){let t=e.position??"flow";b_.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${y.cssPrefix}-chat-host`;typeof customElements<"u"&&!customElements.get(n)&&customElements.define(n,class extends HTMLElement{});let o;e.existingHost?o=e.existingHost:(o=document.createElement(n),(e.target??document.body).appendChild(o)),o.setAttribute("data-brand",y.id),o.style.cssText=Ki[t];let a=o.shadowRoot??o.attachShadow({mode:"open"}),i=o.ownerDocument;if(!x_(a,i)){let s=i.createElement("style");s.textContent=Ur,a.appendChild(s)}let l=document.createElement("div");return l.className=`${y.cssPrefix}-app`,a.appendChild(l),{appRoot:l,destroy:()=>o.remove(),hostElement:o,shadowRoot:a}}function x_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let o=Vi.get(t);if(!o)try{o=new n.CSSStyleSheet,o.replaceSync(Ur),Vi.set(t,o)}catch{return!1}try{return e.adoptedStyleSheets=[o],!0}catch{return!1}}function y_(e,t){let n=y.cssPrefix;t.accent&&e.style.setProperty(`--${n}-accent-user`,t.accent),t.accentText&&e.style.setProperty(`--${n}-accent-text-user`,t.accentText),t.radius&&e.style.setProperty(`--${n}-radius`,t.radius),t.fontFamily&&e.style.setProperty(`--${n}-font`,t.fontFamily)}function P_(e,t){e.dataset.theme=t}function S_(e,t){let n=y.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 k_(e,t){e.dataset.position=t}function ao(e,t){e.dataset.mode=t}function Xi(e,t){P_(e,t.themeMode),y_(e,t.themeOverrides),k_(e,t.position),S_(e,t.size)}var w_=F.scope("iframe"),C_='<!doctype html><html><head><meta charset="utf-8"><style>html,body{margin:0;padding:0;background:transparent;overflow:hidden}</style></head><body></body></html>';function Qi(e,t,n="closed",o="floating",a=null){w_.debug("createIframeMount",{position:t,initialMode:n,layoutMode:o,hasTarget:!!a});let i=document.createElement("iframe");i.title=`${y.name} chat`,i.setAttribute("allow","microphone; clipboard-write"),Ji(i,t,n,o),(o==="inline"&&a?a:document.body).appendChild(i);let s=i.contentDocument;if(!s)throw new Error("iframe contentDocument unavailable (cross-origin?)");s.open(),s.write(C_),s.close();let c=$t({...e,target:s.body}),d=new MutationObserver(()=>{Ji(i,t,c.hostElement.dataset.mode??"closed",o)});return d.observe(c.hostElement,{attributes:!0,attributeFilter:["data-mode"]}),{...c,iframeElement:i,destroy(){d.disconnect(),c.destroy(),i.remove()}}}var io="border:0;background:transparent;z-index:2147483647;pointer-events:auto;",Yi={closed:{w:"88px",h:"88px"},expanded:{w:"min(calc(100vw - 32px), 680px)",h:"min(calc(100vh - 32px), 860px)"},open:{w:"min(calc(100vw - 32px), 440px)",h:"min(calc(100vh - 32px), 700px)"}};function Ji(e,t,n,o){if(n==="fullscreen"||o==="standalone"){e.style.cssText=`${io}position:fixed;inset:0;width:100vw;height:100vh;`;return}if(o==="inline"){e.style.cssText=`${io}position:static;display:block;width:100%;height:100%;`;return}if(typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches&&(n==="open"||n==="expanded")){e.style.cssText=`${io}position:fixed;inset:0;width:100vw;height:100vh;`;return}let i=t.startsWith("top-")?"top":"bottom",l=t.endsWith("-left")?"left":"right",{w:s,h:c}=Yi[n]??Yi.open;e.style.cssText=`${io}position:fixed;${i}:16px;${l}:16px;width:${s};height:${c};`}var Ht=class{constructor(){q(this,"handlers",new Map)}on(t,n){let o=this.handlers.get(t);return o||(o=new Set,this.handlers.set(t,o)),o.add(n),()=>this.handlers.get(t)?.delete(n)}emit(t,n){let o=this.handlers.get(t);if(o)for(let a of o)try{a(n)}catch{}}clear(){this.handlers.clear()}};var Bt,pe,Wr,Zi,_n=0,ss=[],fe=Z,es=fe.__b,ts=fe.__r,ns=fe.diffed,os=fe.__c,rs=fe.unmount,as=fe.__;function lo(e,t){fe.__h&&fe.__h(pe,e,_n||t),_n=0;var n=pe.__H||(pe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function A(e){return _n=1,E_(ls,e)}function E_(e,t,n){var o=lo(Bt++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):ls(void 0,t),function(s){var c=o.__N?o.__N[0]:o.__[0],d=o.t(c,s);c!==d&&(o.__N=[d,o.__[1]],o.__c.setState({}))}],o.__c=pe,!pe.__f)){var a=function(s,c,d){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(g){return g.__c});if(u.every(function(g){return!g.__N}))return!i||i.call(this,s,c,d);var _=o.__c.props!==s;return u.some(function(g){if(g.__N){var f=g.__[0];g.__=g.__N,g.__N=void 0,f!==g.__[0]&&(_=!0)}}),i&&i.call(this,s,c,d)||_};pe.__f=!0;var i=pe.shouldComponentUpdate,l=pe.componentWillUpdate;pe.componentWillUpdate=function(s,c,d){if(this.__e){var u=i;i=void 0,a(s,c,d),i=u}l&&l.call(this,s,c,d)},pe.shouldComponentUpdate=a}return o.__N||o.__}function T(e,t){var n=lo(Bt++,3);!fe.__s&&Gr(n.__H,t)&&(n.__=e,n.u=t,pe.__H.__h.push(n))}function Pt(e,t){var n=lo(Bt++,4);!fe.__s&&Gr(n.__H,t)&&(n.__=e,n.u=t,pe.__h.push(n))}function D(e){return _n=5,Re(function(){return{current:e}},[])}function Re(e,t){var n=lo(Bt++,7);return Gr(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function O(e,t){return _n=8,Re(function(){return e},t)}function T_(){for(var e;e=ss.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(so),t.__h.some(qr),t.__h=[]}catch(n){t.__h=[],fe.__e(n,e.__v)}}}fe.__b=function(e){pe=null,es&&es(e)},fe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),as&&as(e,t)},fe.__r=function(e){ts&&ts(e),Bt=0;var t=(pe=e.__c).__H;t&&(Wr===pe?(t.__h=[],pe.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(so),t.__h.some(qr),t.__h=[],Bt=0)),Wr=pe},fe.diffed=function(e){ns&&ns(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ss.push(t)!==1&&Zi===fe.requestAnimationFrame||((Zi=fe.requestAnimationFrame)||R_)(T_)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Wr=pe=null},fe.__c=function(e,t){t.some(function(n){try{n.__h.some(so),n.__h=n.__h.filter(function(o){return!o.__||qr(o)})}catch(o){t.some(function(a){a.__h&&(a.__h=[])}),t=[],fe.__e(o,n.__v)}}),os&&os(e,t)},fe.unmount=function(e){rs&&rs(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{so(o)}catch(a){t=a}}),n.__H=void 0,t&&fe.__e(t,n.__v))};var is=typeof requestAnimationFrame=="function";function R_(e){var t,n=function(){clearTimeout(o),is&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);is&&(t=requestAnimationFrame(n))}function so(e){var t=pe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),pe=t}function qr(e){var t=pe;e.__c=e.__(),pe=t}function Gr(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function ls(e,t){return typeof t=="function"?t(e):t}var A_=Symbol.for("preact-signals");function po(){if(nt>1)nt--;else{var e,t=!1;for((function(){var a=_o;for(_o=void 0;a!==void 0;)a.S.v===a.v&&(a.S.i=a.i),a=a.o})();un!==void 0;){var n=un;for(un=void 0,co++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&_s(n))try{n.c()}catch(a){t||(e=a,t=!0)}n=o}}if(co=0,nt--,t)throw e}}function Ft(e){if(nt>0)return e();Vr=++I_,nt++;try{return e()}finally{po()}}var le=void 0;function pn(e){var t=le;le=void 0;try{return e()}finally{le=t}}var cs,un=void 0,nt=0,co=0,I_=0,Vr=0,_o=void 0,uo=0;function ds(e){if(le!==void 0){var t=e.n;if(t===void 0||t.t!==le)return t={i:0,S:e,p:le.s,n:void 0,t:le,e:void 0,x:void 0,r:t},le.s!==void 0&&(le.s.n=t),le.s=t,e.n=t,32&le.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=le.s,t.n=void 0,le.s.n=t,le.s=t),t}}function ve(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}ve.prototype.brand=A_;ve.prototype.h=function(){return!0};ve.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:pn(function(){var o;(o=t.W)==null||o.call(t)}))};ve.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,o=e.x;n!==void 0&&(n.x=o,e.e=void 0),o!==void 0&&(o.e=n,e.x=void 0),e===this.t&&(this.t=o,o===void 0&&pn(function(){var a;(a=t.Z)==null||a.call(t)}))}};ve.prototype.subscribe=function(e){var t=this;return ot(function(){var n=t.value;pn(function(){return e(n)})},{name:"sub"})};ve.prototype.valueOf=function(){return this.value};ve.prototype.toString=function(){return this.value+""};ve.prototype.toJSON=function(){return this.value};ve.prototype.peek=function(){var e=this;return pn(function(){return e.value})};Object.defineProperty(ve.prototype,"value",{get:function(){var e=ds(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(co>100)throw new Error("Cycle detected");(function(n){nt!==0&&co===0&&n.l!==Vr&&(n.l=Vr,_o={S:n,v:n.v,i:n.i,o:_o})})(this),this.v=e,this.i++,uo++,nt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{po()}}}});function H(e,t){return new ve(e,t)}function _s(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 us(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 ps(e){for(var t=e.s,n=void 0;t!==void 0;){var o=t.p;t.i===-1?(t.S.U(t),o!==void 0&&(o.n=t.n),t.n!==void 0&&(t.n.p=o)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=o}e.s=n}function St(e,t){ve.call(this,void 0,t),this.x=e,this.s=void 0,this.g=uo-1,this.f=4}St.prototype=new ve;St.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===uo))return!0;if(this.g=uo,this.f|=1,this.i>0&&!_s(this))return this.f&=-2,!0;var e=le;try{us(this),le=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return le=e,ps(this),this.f&=-2,!0};St.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}ve.prototype.S.call(this,e)};St.prototype.U=function(e){if(this.t!==void 0&&(ve.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};St.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(St.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=ds(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function mn(e,t){return new St(e,t)}function ms(e){var t=e.m;if(e.m=void 0,typeof t=="function"){nt++;var n=le;le=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,Kr(e),o}finally{le=n,po()}}}function Kr(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ms(e)}function L_(e){if(le!==this)throw new Error("Out-of-order effect");ps(this),le=e,this.f&=-2,8&this.f&&Kr(this),po()}function zt(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,cs&&cs.push(this)}zt.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};zt.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ms(this),us(this),nt++;var e=le;return le=this,L_.bind(this,e)};zt.prototype.N=function(){2&this.f||(this.f|=2,this.u=un,un=this)};zt.prototype.d=function(){this.f|=8,1&this.f||Kr(this)};zt.prototype.dispose=function(){this.d()};function ot(e,t){var n=new zt(e,t);try{n.c()}catch(a){throw n.d(),a}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var fs,go,mo,M_=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var gs=[];ot(function(){fs=this.N})();function Ut(e,t){Z[e]=t.bind(null,Z[e]||function(){})}function fo(e){if(mo){var t=mo;mo=void 0,t()}mo=e&&e.S()}function hs(e){var t=this,n=e.data,o=fn(n);o.value=n;var a=Re(function(){for(var s=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var d=mn(function(){var f=o.value.value;return f===0?0:f===!0?"":f||""}),u=mn(function(){return!Array.isArray(d.value)&&!$r(d.value)}),_=ot(function(){if(this.N=vs,u.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),g=t.__$u.d;return t.__$u.d=function(){_(),g.call(this)},[u,d]},[]),i=a[0],l=a[1];return i.value?l.peek():l.value}hs.displayName="ReactiveTextNode";Object.defineProperties(ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:hs},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Ut("__b",function(e,t){if(typeof t.type=="string"){var n,o=t.props;for(var a in o)if(a!=="children"){var i=o[a];i instanceof ve&&(n||(t.__np=n={}),n[a]=i,o[a]=i.peek())}}e(t)});Ut("__r",function(e,t){if(e(t),t.type!==te){fo();var n,o=t.__c;o&&(o.__$f&=-2,(n=o.__$u)===void 0&&(o.__$u=n=(function(a,i){var l;return ot(function(){l=this},{name:i}),l.c=a,l})(function(){var a;M_&&((a=n.y)==null||a.call(n)),o.__$f|=1,o.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),go=o,fo(n)}});Ut("__e",function(e,t,n,o){fo(),go=void 0,e(t,n,o)});Ut("diffed",function(e,t){fo(),go=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var o=t.__np,a=t.props;if(o){var i=n.U;if(i)for(var l in i){var s=i[l];s!==void 0&&!(l in o)&&(s.d(),i[l]=void 0)}else i={},n.U=i;for(var c in o){var d=i[c],u=o[c];d===void 0?(d=N_(n,c,u,a),i[c]=d):d.o(u,a)}}}e(t)});function N_(e,t,n,o){var a=t in e&&e.ownerSVGElement===void 0,i=H(n);return{o:function(l,s){i.value=l,o=s},d:ot(function(){this.N=vs;var l=i.value.value;o[t]!==l&&(o[t]=l,a?e[t]=l:l!=null&&(l!==!1||t[4]==="-")?e.setAttribute(t,l):e.removeAttribute(t))})}}Ut("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var o=n.U;if(o){n.U=void 0;for(var a in o){var i=o[a];i&&i.d()}}}var l=t.__np;if(l){var s=t.props;for(var c in l)s[c]=l[c]}t.__np=void 0}else{var d=t.__c;if(d){var u=d.__$u;u&&(d.__$u=void 0,u.d())}}e(t)});Ut("__h",function(e,t,n,o){(o<3||o===9)&&(t.__$f|=2),e(t,n,o)});_t.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,o=n&&n.s!==void 0;for(var a in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(o||i||4&this.__$f)||1&this.__$f)return!0}else if(!(o||4&this.__$f)||3&this.__$f)return!0;for(var l in e)if(l!=="__source"&&e[l]!==this.props[l])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function fn(e,t){return Re(function(){return H(e,t)},[])}function J(e,t){var n=D(e);return n.current=e,go.__$f|=4,Re(function(){return mn(function(){return n.current()},t)},[])}var D_=function(e){queueMicrotask(function(){queueMicrotask(e)})};function O_(){Ft(function(){for(var e;e=gs.shift();)fs.call(e)})}function vs(){gs.push(this)===1&&(Z.requestAnimationFrame||D_)(O_)}function bs(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function xs(e){return bs(e)}function ys(e){return!(!bs(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function ho(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 $_=900;function jr(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let o=t.initialSize;if(o==="expanded"||o==="fullscreen"||o==="normal")return o;if(o==="auto"){let a=t.autoSizeBreakpoint??$_;return n>=a?"expanded":"normal"}return"normal"}function gn(e,t,n,o=null){let i=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),s=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&o?o:jr(e.mode,e.size,t);return{panelOpen:i,panelSize:s}}function Wt(){return typeof window>"u"?0:window.innerWidth}var H_="x-public-key",B_="x-ai-agent-deployment-id";function Ps(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[B_]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??H_]=e.publicKey),t}}}var We=class extends Error{constructor(n,o,a,i){super(n);q(this,"code",o);q(this,"status",a);q(this,"cause",i);this.name="StreamError"}};var Ss=F.scope("parser");async function*Xr(e,t){if(!e.ok){let a=await e.text().catch(()=>"");throw new We(`server responded ${e.status}: ${a.slice(0,200)}`,"server",e.status)}if(!e.body)throw new We("response has no body","no-body");let n=e.body.pipeThrough(new TextDecoderStream).getReader(),o="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:a,value:i}=await n.read();if(a){let s=o.trim();if(s){let c=ks(s);c&&(yield c)}return}o+=i;let l;for(;(l=o.indexOf(`
1
+ "use strict";var HelpAI=(()=>{var Sr=Object.defineProperty;var Pd=Object.getOwnPropertyDescriptor;var kd=Object.getOwnPropertyNames;var Sd=Object.prototype.hasOwnProperty;var wd=(e,t,n)=>t in e?Sr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Cd=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of kd(t))!Sd.call(e,a)&&a!==n&&Sr(e,a,{get:()=>t[a],enumerable:!(o=Pd(t,a))||o.enumerable});return e};var Td=e=>Cd(Sr({},"__esModule",{value:!0}),e);var j=(e,t,n)=>wd(e,typeof t!="symbol"?t+"":t,n);var Hm={};var P={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 ti={attach:"Attach files",attachmentMimeRejected:"File type not supported",attachmentTooLarge:"File is too large",attachmentTooMany:"Attachment limit reached",conversationClosed:"This chat is closed",conversationLoading:"Loading chat\u2026",close:"Close",collapse:"Collapse",collapseSidebar:"Collapse sidebar",composerPlaceholder:"Type a message\u2026",dateLastWeek:"Last 7 days",dateOlder:"Older",dateToday:"Today",dateYesterday:"Yesterday",dropZone:"Drop files to attach",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous chats yet",historyLoading:"Loading your chats\u2026",historyContinue:"Continue the chat",historyTitle:"Chat history",language:"Language",launcherOpen:"Open chat",launcherLabel:"Chat with us",micStart:"Start voice input",micStop:"Stop voice input",micUnsupported:"Voice input is not supported in this browser",moreActions:"More actions",newConversation:"New chat",panelTitle:"Chat",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",soundOff:"Sound off",soundOn:"Sound on",startNewConversation:"Start a new chat",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",thinking:"Thinking\u2026",thoughts:"Thoughts",usedTool:"Used tool",toolResult:"Result",sources:"Sources",feedbackUp:"Good response",feedbackDown:"Bad response",feedbackThanks:"Thanks for your feedback",newMessages:"New messages",tabHome:"Home",tabConversations:"Chats",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",moduleBack:"Back",contentLoading:"Loading\u2026",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results found",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsBack:"Back to news",newsPublishedAt:"Published {date}",formSubmit:"Submit",formSkip:"Maybe later",formSubmitted:"Completed",formSkipped:"Maybe later",formFillOut:"Fill out",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidUrl:"Enter a valid URL",formInvalidNumber:"Enter a valid number",formTooShort:"Too short (min {min} characters)",formTooLong:"Too long (max {max} characters)",formNumberTooSmall:"Must be at least {min}",formNumberTooLarge:"Must be at most {max}",formPatternMismatch:"Please match the requested format",formChooseAtLeast:"Choose at least {min}",formChooseAtMost:"Choose at most {max}",formOther:"Other",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"Questions for you",inputBadge:"Questions",inputAnswered:"Answered",inputSkipped:"Skipped",inputSubmit:"Submit answers",inputSubmitHint:"Enter to send \xB7 Shift+Enter = new line",inputSkip:"Skip",confirmYes:"Yes",confirmNo:"No",approvalRequired:"Approval required",approve:"Approve",reject:"Reject",approved:"Approved",rejected:"Rejected",approvalReason:"Add a reason (optional)",approvalPrompt:"{tool} requires your approval to execute.",approvalBody:"Review the tool input above and decide whether to allow this action.",approvalYourResponse:"Your response: {decision}",approvalEditHint:"You can edit this response until this step continues.",approvalSubmitting:"Response submitted. Request in progress\u2026",edit:"Edit",toolParameters:"Parameters",statusAwaiting:"Awaiting Approval",statusResponded:"Responded",statusRunning:"Running",statusCompleted:"Completed",statusDenied:"Denied",statusError:"Error",statusSuperseded:"Skipped"},Ed={attach:"Joindre des fichiers",attachmentMimeRejected:"Type de fichier non pris en charge",attachmentTooLarge:"Le fichier est trop volumineux",attachmentTooMany:"Limite de pi\xE8ces jointes atteinte",conversationClosed:"Ce chat est ferm\xE9",conversationLoading:"Chargement du chat\u2026",close:"Fermer",collapse:"R\xE9duire",collapseSidebar:"R\xE9duire la barre lat\xE9rale",composerPlaceholder:"\xC9crivez un message\u2026",dateLastWeek:"7 derniers jours",dateOlder:"Plus ancien",dateToday:"Aujourd'hui",dateYesterday:"Hier",dropZone:"D\xE9posez les fichiers \xE0 joindre",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRetry:"R\xE9essayer",expand:"Agrandir",expandSidebar:"D\xE9velopper la barre lat\xE9rale",exitFullscreen:"Quitter le plein \xE9cran",fullscreen:"Plein \xE9cran",history:"Historique",historyBack:"Retour au chat",historyEmpty:"Aucun chat pour le moment",historyContinue:"Poursuivre le chat",historyLoading:"Chargement de vos chats\u2026",historyTitle:"Historique des chats",language:"Langue",launcherOpen:"Ouvrir le chat",launcherLabel:"Discuter avec nous",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",micUnsupported:"La saisie vocale n'est pas prise en charge par ce navigateur",moreActions:"Plus d'actions",newConversation:"Nouveau chat",panelTitle:"Chat",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",startNewConversation:"D\xE9marrer un nouveau chat",stop:"Arr\xEAter",theme:"Th\xE8me",themeAuto:"Auto",themeDark:"Sombre",themeLight:"Clair",textSize:"Taille du texte",textSizeSmall:"Petite",textSizeNormal:"Normale",textSizeLarge:"Grande",loading:"Chargement\u2026",thinking:"R\xE9flexion\u2026",thoughts:"R\xE9flexions",usedTool:"Outil utilis\xE9",toolResult:"R\xE9sultat",sources:"Sources",feedbackUp:"Bonne r\xE9ponse",feedbackDown:"Mauvaise r\xE9ponse",feedbackThanks:"Merci pour votre retour",newMessages:"Nouveaux messages",tabHome:"Accueil",tabConversations:"Chats",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeContentTitle:"Articles populaires",homeStatus:"Statut",helpTitle:"Aide",helpSearchPlaceholder:"Rechercher de l'aide",helpEmpty:"Aucun article d'aide pour le moment",helpLoading:"Chargement de l'aide\u2026",helpSearchEmpty:"Aucun r\xE9sultat trouv\xE9",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsBack:"Retour aux actualit\xE9s",newsPublishedAt:"Publi\xE9 le {date}",formSubmit:"Envoyer",formSkip:"Plus tard",formSubmitted:"Termin\xE9",formSkipped:"Plus tard",formFillOut:"Remplir",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidUrl:"Saisissez une URL valide",formInvalidNumber:"Saisissez un nombre valide",formTooShort:"Trop court (min. {min} caract\xE8res)",formTooLong:"Trop long (max. {max} caract\xE8res)",formNumberTooSmall:"Doit \xEAtre au moins {min}",formNumberTooLarge:"Doit \xEAtre au plus {max}",formPatternMismatch:"Veuillez respecter le format demand\xE9",formChooseAtLeast:"Choisissez au moins {min}",formChooseAtMost:"Choisissez au plus {max}",formOther:"Autre",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Questions pour vous",inputBadge:"Questions",inputAnswered:"R\xE9pondu",inputSkipped:"Ignor\xE9",inputSubmit:"Envoyer les r\xE9ponses",inputSubmitHint:"Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e = saut de ligne",inputSkip:"Ignorer",confirmYes:"Oui",confirmNo:"Non",approvalRequired:"Approbation requise",approve:"Approuver",reject:"Refuser",approved:"Approuv\xE9",rejected:"Refus\xE9",approvalReason:"Ajouter une raison (facultatif)",approvalPrompt:"{tool} n\xE9cessite votre approbation pour s'ex\xE9cuter.",approvalBody:"V\xE9rifiez les param\xE8tres ci-dessus et d\xE9cidez d'autoriser ou non cette action.",approvalYourResponse:"Votre r\xE9ponse : {decision}",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",approvalSubmitting:"R\xE9ponse envoy\xE9e. Traitement en cours\u2026",edit:"Modifier",toolParameters:"Param\xE8tres",statusAwaiting:"En attente d'approbation",statusResponded:"R\xE9pondu",statusRunning:"En cours",statusCompleted:"Termin\xE9",statusDenied:"Refus\xE9",statusError:"Erreur",statusSuperseded:"Ignor\xE9"},Rd={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645",attachmentTooLarge:"\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627",attachmentTooMany:"\u062A\u0645 \u0628\u0644\u0648\u063A \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A",conversationClosed:"\u062A\u0645 \u0625\u063A\u0644\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u062F\u0631\u062F\u0634\u0629",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u062F\u0631\u062F\u0634\u0629\u2026",close:"\u0625\u063A\u0644\u0627\u0642",collapse:"\u0637\u064A\u0651",collapseSidebar:"\u0637\u064A\u0651 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",composerPlaceholder:"\u0627\u0643\u062A\u0628 \u0631\u0633\u0627\u0644\u0629\u2026",dateLastWeek:"\u0622\u062E\u0631 \u0667 \u0623\u064A\u0627\u0645",dateOlder:"\u0623\u0642\u062F\u0645",dateToday:"\u0627\u0644\u064A\u0648\u0645",dateYesterday:"\u0623\u0645\u0633",dropZone:"\u0623\u0641\u0644\u062A \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0644\u0625\u0631\u0641\u0627\u0642\u0647\u0627",errorGeneric:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0627",errorRateLimited:"\u0637\u0644\u0628\u0627\u062A \u0643\u062B\u064A\u0631\u0629 \u062C\u062F\u064B\u0627 \u2014 \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0628\u0639\u062F \u0644\u062D\u0638\u0629.",errorRetry:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",expand:"\u062A\u0648\u0633\u064A\u0639",expandSidebar:"\u062A\u0648\u0633\u064A\u0639 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",exitFullscreen:"\u0625\u0646\u0647\u0627\u0621 \u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",fullscreen:"\u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",history:"\u0627\u0644\u0633\u062C\u0644",historyBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\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",language:"\u0627\u0644\u0644\u063A\u0629",launcherOpen:"\u0641\u062A\u062D \u0627\u0644\u062F\u0631\u062F\u0634\u0629",launcherLabel:"\u062A\u062D\u062F\u062B \u0645\u0639\u0646\u0627",micStart:"\u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micStop:"\u0625\u064A\u0642\u0627\u0641 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micUnsupported:"\u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645 \u0641\u064A \u0647\u0630\u0627 \u0627\u0644\u0645\u062A\u0635\u0641\u062D",moreActions:"\u0625\u062C\u0631\u0627\u0621\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629",newConversation:"\u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",panelTitle:"\u0627\u0644\u062F\u0631\u062F\u0634\u0629",resizeHandle:"\u0627\u0633\u062D\u0628 \u0644\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u062D\u062C\u0645",scrollToBottom:"\u0627\u0644\u0627\u0646\u062A\u0642\u0627\u0644 \u0625\u0644\u0649 \u0627\u0644\u0623\u062D\u062F\u062B",send:"\u0625\u0631\u0633\u0627\u0644",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",startNewConversation:"\u0628\u062F\u0621 \u062F\u0631\u062F\u0634\u0629 \u062C\u062F\u064A\u062F\u0629",stop:"\u0625\u064A\u0642\u0627\u0641",theme:"\u0627\u0644\u0645\u0638\u0647\u0631",themeAuto:"\u062A\u0644\u0642\u0627\u0626\u064A",themeDark:"\u062F\u0627\u0643\u0646",themeLight:"\u0641\u0627\u062A\u062D",textSize:"\u062D\u062C\u0645 \u0627\u0644\u0646\u0635",textSizeSmall:"\u0635\u063A\u064A\u0631",textSizeNormal:"\u0639\u0627\u062F\u064A",textSizeLarge:"\u0643\u0628\u064A\u0631",loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thoughts:"\u0627\u0644\u0623\u0641\u0643\u0627\u0631",usedTool:"\u0623\u062F\u0627\u0629 \u0645\u064F\u0633\u062A\u062E\u062F\u064E\u0645\u0629",toolResult:"\u0627\u0644\u0646\u062A\u064A\u062C\u0629",sources:"\u0627\u0644\u0645\u0635\u0627\u062F\u0631",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",newMessages:"\u0631\u0633\u0627\u0626\u0644 \u062C\u062F\u064A\u062F\u0629",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",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",homeGreeting:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeGreetingNamed:"\u0645\u0631\u062D\u0628\u064B\u0627 {name} \u{1F44B}",homeGreetingLead:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",homeContentTitle:"\u0645\u0642\u0627\u0644\u0627\u062A \u0634\u0627\u0626\u0639\u0629",homeStatus:"\u0627\u0644\u062D\u0627\u0644\u0629",helpTitle:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",helpSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",helpEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u0642\u0627\u0644\u0627\u062A \u0645\u0633\u0627\u0639\u062F\u0629 \u0628\u0639\u062F",helpLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629\u2026",helpSearchEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C",newsTitle:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0623\u062E\u0628\u0627\u0631 \u0628\u0639\u062F",newsLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0623\u062E\u0628\u0627\u0631\u2026",newsBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsPublishedAt:"\u0646\u064F\u0634\u0631 \u0641\u064A {date}",formSubmit:"\u0625\u0631\u0633\u0627\u0644",formSkip:"\u0644\u0627\u062D\u0642\u064B\u0627",formSubmitted:"\u062A\u0645",formSkipped:"\u0644\u0627\u062D\u0642\u064B\u0627",formFillOut:"\u062A\u0639\u0628\u0626\u0629",formRequired:"\u0647\u0630\u0627 \u0627\u0644\u062D\u0642\u0644 \u0645\u0637\u0644\u0648\u0628",formInvalidEmail:"\u0623\u062F\u062E\u0644 \u0628\u0631\u064A\u062F\u064B\u0627 \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidTel:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidUrl:"\u0623\u062F\u062E\u0644 \u0631\u0627\u0628\u0637\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formTooShort:"\u0642\u0635\u064A\u0631 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 {min} \u062D\u0631\u0641\u064B\u0627)",formTooLong:"\u0637\u0648\u064A\u0644 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 {max} \u062D\u0631\u0641\u064B\u0627)",formNumberTooSmall:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0642\u0644 \u0639\u0646 {min}",formNumberTooLarge:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0632\u064A\u062F \u0639\u0646 {max}",formPatternMismatch:"\u064A\u0631\u062C\u0649 \u0645\u0637\u0627\u0628\u0642\u0629 \u0627\u0644\u0635\u064A\u063A\u0629 \u0627\u0644\u0645\u0637\u0644\u0648\u0628\u0629",formChooseAtLeast:"\u0627\u062E\u062A\u0631 {min} \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644",formChooseAtMost:"\u0627\u062E\u062A\u0631 {max} \u0639\u0644\u0649 \u0627\u0644\u0623\u0643\u062B\u0631",formOther:"\u0623\u062E\u0631\u0649",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0623\u0633\u0626\u0644\u0629 \u0644\u0643",inputBadge:"\u0623\u0633\u0626\u0644\u0629",inputAnswered:"\u062A\u0645\u062A \u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputSkipped:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A",inputSubmit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0627\u062A",inputSubmitHint:"Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter = \u0633\u0637\u0631 \u062C\u062F\u064A\u062F",inputSkip:"\u062A\u062E\u0637\u064D\u0651",confirmYes:"\u0646\u0639\u0645",confirmNo:"\u0644\u0627",approvalRequired:"\u0645\u0637\u0644\u0648\u0628 \u0645\u0648\u0627\u0641\u0642\u0629",approve:"\u0645\u0648\u0627\u0641\u0642\u0629",reject:"\u0631\u0641\u0636",approved:"\u062A\u0645\u062A \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",rejected:"\u0645\u0631\u0641\u0648\u0636",approvalReason:"\u0623\u0636\u0641 \u0633\u0628\u0628\u064B\u0627 (\u0627\u062E\u062A\u064A\u0627\u0631\u064A)",approvalPrompt:"\u062A\u062A\u0637\u0644\u0628 {tool} \u0645\u0648\u0627\u0641\u0642\u062A\u0643 \u0644\u0644\u062A\u0646\u0641\u064A\u0630.",approvalBody:"\u0631\u0627\u062C\u0639 \u0645\u064F\u0639\u0637\u064A\u0627\u062A \u0627\u0644\u0623\u062F\u0627\u0629 \u0623\u0639\u0644\u0627\u0647 \u0648\u0642\u0631\u0651\u0631 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \u0623\u0648 \u0631\u0641\u0636\u0647.",approvalYourResponse:"\u0631\u062F\u0651\u0643: {decision}",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u0639\u062F\u064A\u0644 \u0631\u062F\u0651\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",approvalSubmitting:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062F. \u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",edit:"\u062A\u0639\u062F\u064A\u0644",toolParameters:"\u0627\u0644\u0645\u0639\u0637\u064A\u0627\u062A",statusAwaiting:"\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",statusResponded:"\u062A\u0645 \u0627\u0644\u0631\u062F",statusRunning:"\u0642\u064A\u062F \u0627\u0644\u062A\u0646\u0641\u064A\u0630",statusCompleted:"\u0645\u0643\u062A\u0645\u0644",statusDenied:"\u0645\u0631\u0641\u0648\u0636",statusError:"\u062E\u0637\u0623",statusSuperseded:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A"},Id={attach:"Adjuntar archivos",attachmentMimeRejected:"Tipo de archivo no admitido",attachmentTooLarge:"El archivo es demasiado grande",attachmentTooMany:"Se alcanz\xF3 el l\xEDmite de adjuntos",conversationClosed:"Este chat est\xE1 cerrado",conversationLoading:"Cargando chat\u2026",close:"Cerrar",collapse:"Contraer",collapseSidebar:"Contraer la barra lateral",composerPlaceholder:"Escribe un mensaje\u2026",dateLastWeek:"\xDAltimos 7 d\xEDas",dateOlder:"Anteriores",dateToday:"Hoy",dateYesterday:"Ayer",dropZone:"Suelta los archivos para adjuntarlos",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRetry:"Reintentar",expand:"Ampliar",expandSidebar:"Expandir la barra lateral",exitFullscreen:"Salir de pantalla completa",fullscreen:"Pantalla completa",history:"Historial",historyBack:"Volver al chat",historyEmpty:"A\xFAn no tienes chats",historyContinue:"Continuar el chat",historyLoading:"Cargando tus chats\u2026",historyTitle:"Historial de chats",language:"Idioma",launcherOpen:"Abrir el chat",launcherLabel:"Chatea con nosotros",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",micUnsupported:"Este navegador no admite la entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nuevo chat",panelTitle:"Chat",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",soundOff:"Sonido desactivado",soundOn:"Sonido activado",startNewConversation:"Iniciar un chat nuevo",stop:"Detener",theme:"Tema",themeAuto:"Autom\xE1tico",themeDark:"Oscuro",themeLight:"Claro",textSize:"Tama\xF1o del texto",textSizeSmall:"Peque\xF1o",textSizeNormal:"Normal",textSizeLarge:"Grande",loading:"Cargando\u2026",thinking:"Pensando\u2026",thoughts:"Razonamiento",usedTool:"Herramienta usada",toolResult:"Resultado",sources:"Fuentes",feedbackUp:"Buena respuesta",feedbackDown:"Mala respuesta",feedbackThanks:"Gracias por tu opini\xF3n",newMessages:"Mensajes nuevos",tabHome:"Inicio",tabConversations:"Chats",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeContentTitle:"Art\xEDculos populares",homeStatus:"Estado",helpTitle:"Ayuda",helpSearchPlaceholder:"Buscar ayuda",helpEmpty:"A\xFAn no hay art\xEDculos de ayuda",helpLoading:"Cargando la ayuda\u2026",helpSearchEmpty:"No se encontraron resultados",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsBack:"Volver a novedades",newsPublishedAt:"Publicado el {date}",formSubmit:"Enviar",formSkip:"Quiz\xE1 m\xE1s tarde",formSubmitted:"Completado",formSkipped:"Quiz\xE1 m\xE1s tarde",formFillOut:"Completar",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidUrl:"Introduce una URL v\xE1lida",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formTooShort:"Demasiado corto (m\xEDn. {min} caracteres)",formTooLong:"Demasiado largo (m\xE1x. {max} caracteres)",formNumberTooSmall:"Debe ser al menos {min}",formNumberTooLarge:"Debe ser como m\xE1ximo {max}",formPatternMismatch:"Respeta el formato solicitado",formChooseAtLeast:"Elige al menos {min}",formChooseAtMost:"Elige como m\xE1ximo {max}",formOther:"Otro",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Preguntas para ti",inputBadge:"Preguntas",inputAnswered:"Respondido",inputSkipped:"Omitido",inputSubmit:"Enviar respuestas",inputSubmitHint:"Enter para enviar \xB7 May\xFAs+Enter = nueva l\xEDnea",inputSkip:"Omitir",confirmYes:"S\xED",confirmNo:"No",approvalRequired:"Aprobaci\xF3n requerida",approve:"Aprobar",reject:"Rechazar",approved:"Aprobado",rejected:"Rechazado",approvalReason:"A\xF1ade un motivo (opcional)",approvalPrompt:"{tool} requiere tu aprobaci\xF3n para ejecutarse.",approvalBody:"Revisa los par\xE1metros de arriba y decide si permites esta acci\xF3n.",approvalYourResponse:"Tu respuesta: {decision}",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",approvalSubmitting:"Respuesta enviada. Procesando\u2026",edit:"Editar",toolParameters:"Par\xE1metros",statusAwaiting:"Esperando aprobaci\xF3n",statusResponded:"Respondido",statusRunning:"En curso",statusCompleted:"Completado",statusDenied:"Denegado",statusError:"Error",statusSuperseded:"Omitido"},Ad={attach:"\u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D1\u05E6\u05D9\u05DD",attachmentMimeRejected:"\u05E1\u05D5\u05D2 \u05D4\u05E7\u05D5\u05D1\u05E5 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA",attachmentTooLarge:"\u05D4\u05E7\u05D5\u05D1\u05E5 \u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9",attachmentTooMany:"\u05D4\u05D2\u05E2\u05EA \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D4\u05DE\u05E8\u05D1\u05D9 \u05E9\u05DC \u05E7\u05D1\u05E6\u05D9\u05DD \u05DE\u05E6\u05D5\u05E8\u05E4\u05D9\u05DD",conversationClosed:"\u05D4\u05E6\u05F3\u05D0\u05D8 \u05D4\u05D6\u05D4 \u05E0\u05E1\u05D2\u05E8",conversationLoading:"\u05D8\u05D5\u05E2\u05DF \u05E6\u05F3\u05D0\u05D8\u2026",close:"\u05E1\u05D2\u05D9\u05E8\u05D4",collapse:"\u05DB\u05D9\u05D5\u05D5\u05E5",collapseSidebar:"\u05DB\u05D9\u05D5\u05D5\u05E5 \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",composerPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D4\u05D5\u05D3\u05E2\u05D4\u2026",dateLastWeek:"7 \u05D4\u05D9\u05DE\u05D9\u05DD \u05D4\u05D0\u05D7\u05E8\u05D5\u05E0\u05D9\u05DD",dateOlder:"\u05D9\u05E9\u05DF \u05D9\u05D5\u05EA\u05E8",dateToday:"\u05D4\u05D9\u05D5\u05DD",dateYesterday:"\u05D0\u05EA\u05DE\u05D5\u05DC",dropZone:"\u05E9\u05D7\u05E8\u05E8 \u05E7\u05D1\u05E6\u05D9\u05DD \u05DB\u05D3\u05D9 \u05DC\u05E6\u05E8\u05E3",errorGeneric:"\u05DE\u05E9\u05D4\u05D5 \u05D4\u05E9\u05EA\u05D1\u05E9",errorRateLimited:"\u05D9\u05D5\u05EA\u05E8 \u05DE\u05D3\u05D9 \u05D1\u05E7\u05E9\u05D5\u05EA \u2014 \u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1 \u05D1\u05E2\u05D5\u05D3 \u05E8\u05D2\u05E2.",errorRetry:"\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1",expand:"\u05D4\u05E8\u05D7\u05D1\u05D4",expandSidebar:"\u05D4\u05E8\u05D7\u05D1\u05EA \u05E1\u05E8\u05D2\u05DC \u05D4\u05E6\u05D3",exitFullscreen:"\u05D9\u05E6\u05D9\u05D0\u05D4 \u05DE\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",fullscreen:"\u05DE\u05E1\u05DA \u05DE\u05DC\u05D0",history:"\u05D4\u05D9\u05E1\u05D8\u05D5\u05E8\u05D9\u05D4",historyBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\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",language:"\u05E9\u05E4\u05D4",launcherOpen:"\u05E4\u05EA\u05D9\u05D7\u05EA \u05E6\u05F3\u05D0\u05D8",launcherLabel:"\u05D3\u05D1\u05E8\u05D5 \u05D0\u05D9\u05EA\u05E0\u05D5",micStart:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micStop:"\u05E2\u05E6\u05D9\u05E8\u05EA \u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9",micUnsupported:"\u05E7\u05DC\u05D8 \u05E7\u05D5\u05DC\u05D9 \u05D0\u05D9\u05E0\u05D5 \u05E0\u05EA\u05DE\u05DA \u05D1\u05D3\u05E4\u05D3\u05E4\u05DF \u05D6\u05D4",moreActions:"\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA \u05E0\u05D5\u05E1\u05E4\u05D5\u05EA",newConversation:"\u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",panelTitle:"\u05E6\u05F3\u05D0\u05D8",resizeHandle:"\u05D2\u05E8\u05D5\u05E8 \u05DC\u05E9\u05D9\u05E0\u05D5\u05D9 \u05D4\u05D2\u05D5\u05D3\u05DC",scrollToBottom:"\u05DE\u05E2\u05D1\u05E8 \u05DC\u05D7\u05D3\u05E9 \u05D1\u05D9\u05D5\u05EA\u05E8",send:"\u05E9\u05DC\u05D9\u05D7\u05D4",soundOff:"\u05D4\u05E9\u05EA\u05E7\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",soundOn:"\u05D4\u05E4\u05E2\u05DC\u05EA \u05D4\u05E6\u05DC\u05D9\u05DC",startNewConversation:"\u05D4\u05EA\u05D7\u05DC\u05EA \u05E6\u05F3\u05D0\u05D8 \u05D7\u05D3\u05E9",stop:"\u05E2\u05E6\u05D9\u05E8\u05D4",theme:"\u05E2\u05E8\u05DB\u05EA \u05E0\u05D5\u05E9\u05D0",themeAuto:"\u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9",themeDark:"\u05DB\u05D4\u05D4",themeLight:"\u05D1\u05D4\u05D9\u05E8",textSize:"\u05D2\u05D5\u05D3\u05DC \u05D8\u05E7\u05E1\u05D8",textSizeSmall:"\u05E7\u05D8\u05DF",textSizeNormal:"\u05E8\u05D2\u05D9\u05DC",textSizeLarge:"\u05D2\u05D3\u05D5\u05DC",loading:"\u05D8\u05D5\u05E2\u05DF\u2026",thinking:"\u05D7\u05D5\u05E9\u05D1\u2026",thoughts:"\u05DE\u05D7\u05E9\u05D1\u05D5\u05EA",usedTool:"\u05DB\u05DC\u05D9 \u05D1\u05E9\u05D9\u05DE\u05D5\u05E9",toolResult:"\u05EA\u05D5\u05E6\u05D0\u05D4",sources:"\u05DE\u05E7\u05D5\u05E8\u05D5\u05EA",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",newMessages:"\u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05D7\u05D3\u05E9\u05D5\u05EA",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",moduleBack:"\u05D7\u05D6\u05E8\u05D4",contentLoading:"\u05D8\u05D5\u05E2\u05DF\u2026",homeGreeting:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeGreetingNamed:"\u05E9\u05DC\u05D5\u05DD {name} \u{1F44B}",homeGreetingLead:"\u05DB\u05D9\u05E6\u05D3 \u05E0\u05D5\u05DB\u05DC \u05DC\u05E2\u05D6\u05D5\u05E8?",homeSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",homeContentTitle:"\u05DE\u05D0\u05DE\u05E8\u05D9\u05DD \u05E4\u05D5\u05E4\u05D5\u05DC\u05E8\u05D9\u05D9\u05DD",homeStatus:"\u05E1\u05D8\u05D8\u05D5\u05E1",helpTitle:"\u05E2\u05D6\u05E8\u05D4",helpSearchPlaceholder:"\u05D7\u05D9\u05E4\u05D5\u05E9 \u05E2\u05D6\u05E8\u05D4",helpEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05DE\u05D0\u05DE\u05E8\u05D9 \u05E2\u05D6\u05E8\u05D4",helpLoading:"\u05D8\u05D5\u05E2\u05DF \u05E2\u05D6\u05E8\u05D4\u2026",helpSearchEmpty:"\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA",newsTitle:"\u05D7\u05D3\u05E9\u05D5\u05EA",newsEmpty:"\u05D0\u05D9\u05DF \u05E2\u05D3\u05D9\u05D9\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA",newsLoading:"\u05D8\u05D5\u05E2\u05DF \u05D7\u05D3\u05E9\u05D5\u05EA\u2026",newsBack:"\u05D7\u05D6\u05E8\u05D4 \u05DC\u05D7\u05D3\u05E9\u05D5\u05EA",newsPublishedAt:"\u05E4\u05D5\u05E8\u05E1\u05DD \u05D1-{date}",formSubmit:"\u05E9\u05DC\u05D9\u05D7\u05D4",formSkip:"\u05D0\u05D7\u05E8 \u05DB\u05DA",formSubmitted:"\u05E0\u05E9\u05DC\u05D7",formSkipped:"\u05D3\u05D5\u05DC\u05D2",formFillOut:"\u05DE\u05D9\u05DC\u05D5\u05D9",formRequired:"\u05E9\u05D3\u05D4 \u05D7\u05D5\u05D1\u05D4",formInvalidEmail:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidTel:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05EA\u05E7\u05D9\u05DF",formInvalidUrl:"\u05D4\u05D6\u05DF \u05DB\u05EA\u05D5\u05D1\u05EA URL \u05EA\u05E7\u05D9\u05E0\u05D4",formInvalidNumber:"\u05D4\u05D6\u05DF \u05DE\u05E1\u05E4\u05E8 \u05EA\u05E7\u05D9\u05DF",formTooShort:"\u05E7\u05E6\u05E8 \u05DE\u05D3\u05D9 (\u05DC\u05E4\u05D7\u05D5\u05EA {min} \u05EA\u05D5\u05D5\u05D9\u05DD)",formTooLong:"\u05D0\u05E8\u05D5\u05DA \u05DE\u05D3\u05D9 (\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max} \u05EA\u05D5\u05D5\u05D9\u05DD)",formNumberTooSmall:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formNumberTooLarge:"\u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formPatternMismatch:"\u05D4\u05EA\u05D0\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D4\u05E0\u05D3\u05E8\u05E9\u05EA",formChooseAtLeast:"\u05D1\u05D7\u05E8 \u05DC\u05E4\u05D7\u05D5\u05EA {min}",formChooseAtMost:"\u05D1\u05D7\u05E8 \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8 {max}",formOther:"\u05D0\u05D7\u05E8",formOtherPlaceholder:"\u05DB\u05EA\u05D5\u05D1 \u05D0\u05EA \u05EA\u05E9\u05D5\u05D1\u05EA\u05DA\u2026",inputRequired:"\u05E9\u05D0\u05DC\u05D5\u05EA \u05E2\u05D1\u05D5\u05E8\u05DA",inputBadge:"\u05E9\u05D0\u05DC\u05D5\u05EA",inputAnswered:"\u05E0\u05E2\u05E0\u05D4",inputSkipped:"\u05D3\u05D5\u05DC\u05D2",inputSubmit:"\u05E9\u05DC\u05D9\u05D7\u05EA \u05EA\u05E9\u05D5\u05D1\u05D5\u05EA",inputSubmitHint:"Enter \u05DC\u05E9\u05DC\u05D9\u05D7\u05D4 \xB7 Shift+Enter = \u05E9\u05D5\u05E8\u05D4 \u05D7\u05D3\u05E9\u05D4",inputSkip:"\u05D3\u05D9\u05DC\u05D5\u05D2",confirmYes:"\u05DB\u05DF",confirmNo:"\u05DC\u05D0",approvalRequired:"\u05E0\u05D3\u05E8\u05E9 \u05D0\u05D9\u05E9\u05D5\u05E8",approve:"\u05D0\u05D9\u05E9\u05D5\u05E8",reject:"\u05D3\u05D7\u05D9\u05D9\u05D4",approved:"\u05D0\u05D5\u05E9\u05E8",rejected:"\u05E0\u05D3\u05D7\u05D4",approvalReason:"\u05D4\u05D5\u05E1\u05E3 \u05E1\u05D9\u05D1\u05D4 (\u05D0\u05D5\u05E4\u05E6\u05D9\u05D5\u05E0\u05DC\u05D9)",approvalPrompt:"\u05D4\u05DB\u05DC\u05D9 {tool} \u05D3\u05D5\u05E8\u05E9 \u05D0\u05EA \u05D0\u05D9\u05E9\u05D5\u05E8\u05DA \u05DB\u05D3\u05D9 \u05DC\u05E4\u05E2\u05D5\u05DC.",approvalBody:"\u05D1\u05D3\u05D5\u05E7 \u05D0\u05EA \u05E4\u05E8\u05DE\u05D8\u05E8\u05D9 \u05D4\u05DB\u05DC\u05D9 \u05E9\u05DC\u05DE\u05E2\u05DC\u05D4 \u05D5\u05D4\u05D7\u05DC\u05D8 \u05D0\u05DD \u05DC\u05D0\u05E9\u05E8 \u05E4\u05E2\u05D5\u05DC\u05D4 \u05D6\u05D5.",approvalYourResponse:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E9\u05DC\u05DA: {decision}",approvalEditHint:"\u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D5\u05DA \u05D0\u05EA \u05EA\u05D2\u05D5\u05D1\u05EA\u05DA \u05E2\u05D3 \u05E9\u05D4\u05E9\u05DC\u05D1 \u05D4\u05D6\u05D4 \u05D9\u05EA\u05D7\u05D3\u05E9.",approvalSubmitting:"\u05D4\u05EA\u05D2\u05D5\u05D1\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4. \u05DE\u05D1\u05E6\u05E2\u2026",edit:"\u05E2\u05E8\u05D9\u05DB\u05D4",toolParameters:"\u05E4\u05E8\u05DE\u05D8\u05E8\u05D9\u05DD",statusAwaiting:"\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8",statusResponded:"\u05E0\u05E2\u05E0\u05D4",statusRunning:"\u05E4\u05D5\u05E2\u05DC",statusCompleted:"\u05D4\u05D5\u05E9\u05DC\u05DD",statusDenied:"\u05E0\u05D3\u05D7\u05D4",statusError:"\u05E9\u05D2\u05D9\u05D0\u05D4",statusSuperseded:"\u05D3\u05D5\u05DC\u05D2"},Ld={en:ti,fr:Ed,ar:Rd,es:Id,he:Ad};function Yn(e,t){let n=ni(e),o=Jn(t),a=n==="en"?{}:Ld[n]??{},i=o?t[n]??{}:t??{},l=o?t.en??{}:{};return{...ti,...a,...l,...i}}function ni(e){return(e.split("-")[0]??"en").toLowerCase()}var Md=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function oi(e){return Md.has(ni(e))}function Ie(e,t){return e[t]??t}function Jn(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function ri(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function ai(e,t){let{translations:n,defaultLocale:o,...a}=e,i=ri(n,t);return i?{...a,title:i.title??a.title,description:i.description??a.description,content:i.content??a.content}:a}function ii(e,t){let{translations:n,defaultLocale:o,...a}=e,i=ri(n,t);if(!i)return a;let l=new Map((i.fields??[]).map(c=>[c.name,c])),s=a.fields.map(c=>{let d=l.get(c.name);if(!d)return c;let u=new Map((d.options??[]).map(h=>[h.value,h]));return{...c,label:d.label??c.label,placeholder:d.placeholder??c.placeholder,validationHint:d.validationHint??c.validationHint,options:c.options?.map(h=>{let _=u.get(h.value);return _?{...h,label:_.label??h.label,description:_.description??h.description}:h})}});return{...a,title:i.title??a.title,description:i.description??a.description,submitLabel:i.submitLabel??a.submitLabel,fields:s}}var wr=class{get(t){try{return localStorage.getItem(t)}catch{return null}}set(t,n){try{localStorage.setItem(t,n)}catch{}}remove(t){try{localStorage.removeItem(t)}catch{}}},Qn=new wr;var Er=["off","error","warn","info","debug","trace"],Rr=P.cssPrefix,si=`${Rr}.debug`,Nd=`__${P.global}_DEBUG__`,Dd=`${Rr}-debug`,Zn=2,Cr=null;function Od(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(Dd);if(e!==null){let t=Tr(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(si);if(e){let t=Tr(e);if(t>=0)return t}}catch{}return window[Nd]?4:2}function Tr(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=Er.indexOf(e);if(t>=0)return t}return-1}function eo(e){let t=Tr(e);if(!(t<0)){Zn=t;try{window.localStorage?.setItem(si,Er[t])}catch{}}}function vn(){return Er[Zn]}Zn=Od();function li(e){let t=`[${Rr}:${e}]`,n=(o,a,i)=>(l,s)=>{if(!(Zn<o)&&(s===void 0?console[a](t,l):console[a](t,l,s),Cr))try{Cr({level:i,scope:e,message:l,payload:s})}catch{}};return{error:n(1,"error","error"),warn:n(2,"warn","warn"),info:n(3,"info","info"),debug:n(4,"debug","debug"),trace:n(5,"debug","trace"),scope:o=>li(`${e}:${o}`)}}var W=li("core");function bn(e){Cr=e}var Ct=W.scope("context"),$d=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),ci=50,Ir=1024,Hd=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Ar(e){return di(e,"userContext",!0)}function Lr(e){return di(e,"pageContext",!1)}function di(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){Ct.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let o={},a=0;for(let[i,l]of Object.entries(e)){if($d.has(i)){Ct.warn(`dropped reserved ${t} key "${i}" \u2014 managed by the widget, not host-settable`);continue}if(l==null)continue;if(a>=ci){Ct.warn(`${t} truncated at ${ci} keys \u2014 dropped "${i}"`);continue}let s=Fd(t,i,l);s!==void 0&&(o[i]=s,a++)}return n&&typeof o.email=="string"&&!Hd.test(o.email)&&(Ct.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function Fd(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){Ct.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let o=n.trim();return o===""?void 0:o.length>Ir?(Ct.warn(`truncated ${e}.${t} to ${Ir} chars`),o.slice(0,Ir)):o}Ct.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var to={maxBytes:10485760,maxCount:10,accept:"*/*"},no={files:!0,voice:"local",humanInLoop:!0},_i={list:[],byTrigger:{}},Mr={enabled:!0,sampleRate:1},oo={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},zt={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},ui={floating:["theme","textSize","history","close","clear","expand","fullscreen","sound","language"],inline:["theme","textSize","history","close","clear","fullscreen","sound","language"],standalone:["theme","textSize","history","clear","sound","language"],page:["theme","textSize","history","clear","sound","language"],modal:["theme","textSize","history","close","clear","fullscreen","sound","language"],drawer:["theme","textSize","history","close","clear","fullscreen","sound","language"]},Nr={enabled:!0,volume:.3,events:void 0},pi={enabled:!0,events:void 0},mi=[{label:"tabConversations",layout:"chat"}],fi={showSearchBar:!0};function mt(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},o=t.behavior??{},a=t.i18n??{},i=t.feedback??{},l=t.footer??{},s=t.header??{},{themeMode:c,themeOverrides:d}=Bd(t.theme),u=n.mode??"floating",h=zd(a.defaultLocale),_=a.availableLocales??[a.locale??h],f=Ut(a.locale??h,_,h),m=(t.baseUrl??P.defaultBaseUrl).replace(/\/$/,""),y=(t.agentApiBaseUrl??`${m}/api/agent`).replace(/\/$/,""),x=(t.dataApiBaseUrl??`${m}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:m,agentApiBaseUrl:y,dataApiBaseUrl:x,userContext:Ar(t.userContext),pageContext:Lr(t.pageContext),position:n.position??"bottom-right",themeMode:c,textSize:"normal",themeOverrides:d,mode:u,iframe:n.iframe??!1,responseMode:o.responseMode??"streaming",showReasoning:o.showReasoning??!1,showToolCalls:o.showToolCalls??!1,showSources:o.showSources??!1,scrollFade:o.scrollFade??!0,scrollAnchor:o.scrollAnchor??"bottom",enableMessageFeedback:o.enableMessageFeedback??!0,features:{files:t.features?.files??no.files,voice:t.features?.voice??no.voice,humanInLoop:t.features?.humanInLoop??no.humanInLoop,tools:t.features?.tools},forms:xn(t.forms,f),endpoints:{upload:t.endpoints?.upload??oo.upload,transcribe:t.endpoints?.transcribe??oo.transcribe,submitForm:t.endpoints?.submitForm??oo.submitForm},attachments:{accept:t.composer?.attachments?.accept??to.accept,maxBytes:t.composer?.attachments?.maxBytes??to.maxBytes,maxCount:t.composer?.attachments?.maxCount??to.maxCount},locale:f,defaultLocale:h,availableLocales:_,startMinimized:o.startMinimized??!0,actions:Ud(u,s.actions),size:n.size??{},launcher:Yd(t.launcher),sound:Wd(i.sound),haptics:Vd(i.haptics),strings:Yn(f,a.strings),stringsOverride:a.strings,composerDisclaimer:l.composerDisclaimer??"",poweredBy:Gd(l.poweredBy),composer:Kd(t.composer),modules:jd(t.modules),tracking:qd(t.tracking,x),storage:t.storage??Qn,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function Bd(e){return typeof e=="string"?{themeMode:e,themeOverrides:{}}:e&&typeof e=="object"?{themeMode:"auto",themeOverrides:e}:{themeMode:"auto",themeOverrides:{}}}function zd(e){return e&&e!=="auto"?e:typeof navigator<"u"&&navigator.language?navigator.language:"en"}function Ut(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function Ud(e,t){return t??ui[e]}function Wd(e){return{enabled:e?.enabled??Nr.enabled,volume:e?.volume??Nr.volume,events:e?.events}}function Vd(e){return{enabled:e?.enabled??pi.enabled,events:e?.events}}function qd(e,t){let n=e?.sampleRate??Mr.sampleRate;return{enabled:e?.enabled??Mr.enabled,endpoint:e?.endpoint??`${t}/pai/elements-px.gif`,sampleRate:Math.min(1,Math.max(0,Number.isFinite(n)?n:1)),token:e?.token}}function Gd(e){let n={...{text:`Powered by ${P.displayName}`,href:P.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function Kd(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function jd(e){let t=e===void 0?mi:e,n=new Set,o=[];for(let i of t.slice(0,4)){if(!i?.label||!i?.layout)continue;let l=i.contentTags?.filter(Boolean),s=i.id??l?.[0]??i.layout;for(;n.has(s);)s=`${s}-${o.length}`;n.add(s);let c={id:s,label:i.label,layout:i.layout};l&&l.length>0&&(c.contentTags=l),i.layout==="home"&&(c.brandName=i.brandName,c.greetingText=i.greetingText,c.showGreeting=i.showGreeting??!0,c.showSearchBar=i.showSearchBar??fi.showSearchBar,c.showRecentConversations=i.showRecentConversations??!0,i.userAvatars&&i.userAvatars.length>0&&(c.userAvatars=i.userAvatars),i.status&&(c.status=i.status),c.contentBlockTitle=i.contentBlockTitle),o.push(c)}let a=Object.fromEntries(o.map(i=>[i.id,i]));return{list:o,byId:a}}function xn(e,t){var i;if(!e?.length)return _i;let n=[],o=new Set;for(let l of e){if(!l?.id||o.has(l.id))continue;let s=ii(l,t),c=(s.fields??[]).filter(u=>!!(u&&u.name&&u.label&&u.type)),d=(Array.isArray(s.on)?s.on:[s.on]).map(Xd).filter(u=>u!==null);c.length===0||d.length===0||(o.add(s.id),n.push({id:s.id,triggers:d,when:s.when,fields:c,title:s.title,description:s.description,submitLabel:s.submitLabel,skippable:s.skippable??!1,frequency:s.frequency??"once",mirrorToContext:s.mirrorToContext??!0,reopenable:s.reopenable??!0,reviewable:s.reviewable??!0}))}let a={};for(let l of n)for(let s of l.triggers)(a[i=s.kind]??(a[i]=[])).push(l);return{list:n,byTrigger:a}}function Xd(e){if(typeof e!="string")return null;if(e==="pre-chat"||e==="conversation-closed"||e==="panel-close"||e==="manual")return{kind:e};let[t,n]=e.split(":",2);if(t==="after-messages"){let o=Number(n);return Number.isFinite(o)&&o>0?{kind:"after-messages",param:o}:null}if(t==="idle"){let o=Number(n);return Number.isFinite(o)&&o>0?{kind:"idle",param:o}:null}return t==="page-area"&&n?{kind:"page-area",param:n}:null}function Yd(e){let t=e?.callout?.text?{shape:"pill",position:"auto",delayMs:1200,autoDismissMs:0,animated:!0,persistent:!0,...e.callout}:null;return{variant:e?.variant??zt.variant,size:e?.size??zt.size,label:e?.label??zt.label,icon:e?.icon??zt.icon,hidden:e?.hidden??zt.hidden,callout:t}}function Dr(e,t,n,o){let a=Ut(t,e.availableLocales,e.defaultLocale);if(a===e.locale&&n===e.themeMode&&o===e.textSize)return e;let i={...e};return a!==e.locale&&(i.locale=a,i.strings=Yn(a,e.stringsOverride)),n!==e.themeMode&&(i.themeMode=n),o!==e.textSize&&(i.textSize=o),i}var Jd=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Or(e,t){if(!t)return e;let n={...e};for(let i of Jd){let l=t[i];if(l===void 0)continue;let s=e[i];if(i==="theme"){s===void 0&&(n[i]=l);continue}i!=="i18n"&&(n[i]=gi(l,s))}t.modules!==void 0&&e.modules===void 0&&(n.modules=t.modules),t.dataApiBaseUrl!==void 0&&e.dataApiBaseUrl===void 0&&(n.dataApiBaseUrl=t.dataApiBaseUrl);let o=e.i18n,a=t.i18n;if(o||a){let i=gi(a??{},o);a?.availableLocales!==void 0&&(i.availableLocales=a.availableLocales),a?.defaultLocale!==void 0&&(i.defaultLocale=a.defaultLocale);let l=o?.strings,s=a?.strings;(l||s)&&(i.strings=Qd(s,l)),n.i18n=i}return n}function gi(e,t){if(!t)return e;let n={...e};for(let[o,a]of Object.entries(t))a!==void 0&&(n[o]=a);return n}function Qd(e,t){if(!e)return t;if(!t)return e;let n=Jn(e),o=Jn(t);if(!n&&!o)return{...e,...t};let a={},i=n?e:{en:e},l=o?t:{en:t};for(let[s,c]of Object.entries(i))a[s]={...c};for(let[s,c]of Object.entries(l))a[s]={...a[s],...c};return a}var Zd=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],ft=e=>e!=="false",vi=e=>e.split(",").map(t=>t.trim()).filter(Boolean),bi=[["public-key","publicKey"],["ai-agent-deployment-id","aiAgentDeploymentId"],["base-url","baseUrl"],["agent-api-base-url","agentApiBaseUrl"],["data-api-base-url","dataApiBaseUrl"],["theme","theme",e=>e]],xi=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",ft]],yi=[["width","width"],["height","height"]],Pi=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",ft],["show-reasoning","showReasoning",ft],["show-tool-calls","showToolCalls",ft],["show-sources","showSources",ft],["enable-message-feedback","enableMessageFeedback",ft]],ki=[["locale","locale"]],e_=new Set(Zd),t_=e=>vi(e).filter(t=>e_.has(t)),Si=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",ft]],wi=[["features-files","files",ft],["features-voice","voice",e=>e],["features-tools","tools",vi]],Ci=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],Ti=[["user-id","id"],["user-email","email"],["user-name","name"]],Ei=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],n_=["launcher-label","callout-text","callout-delay","actions-main","actions-overflow","user-context","page-context"],o_=[bi,xi,yi,Pi,ki,Si,wi,Ci,Ti,Ei],r_=new Set(["iframe","start-minimized"]),$r=[...o_.flatMap(e=>e.map(([t])=>t).filter(t=>!r_.has(t))),...n_];function ro(e){let t={},n=f=>{let m=e(f);return m===null||m===""?void 0:m};for(let[f,m,y]of bi){let x=n(f);x!==void 0&&(t[m]=y?y(x):x)}let o=Tt(n,xi),a=Tt(n,yi);(o||a)&&(t.presentation={...o,...a?{size:a}:{}});let i=Tt(n,Pi);i&&(t.behavior=i);let l=Tt(n,ki);l&&(t.i18n=l);let s=i_(e,n);s&&(t.launcher=s);let c=Tt(n,wi);c&&(t.features=c);let d=Tt(n,Ci);d&&(t.endpoints=d);let u=hi(n,Ti,"user-context");u&&(t.userContext=u);let h=hi(n,Ei,"page-context");h&&(t.pageContext=h);let _=n("actions");return _!==void 0&&(t.header={actions:t_(_)}),t}function Hr(e){return e?ro(t=>e[a_(t)]??null):{}}function a_(e){return e.replaceAll(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Tt(e,t){let n={};for(let[o,a,i]of t){let l=e(o);l!==void 0&&(n[a]=i?i(l):l)}return Object.keys(n).length>0?n:null}function hi(e,t,n){let o={};for(let[s,c]of t){let d=e(s);d!==void 0&&(o[c]=d)}let a={},i=e(n);if(i)try{let s=JSON.parse(i);s&&typeof s=="object"&&!Array.isArray(s)&&(a=s)}catch{}let l={...a,...o};return Object.keys(l).length>0?l:null}function i_(e,t){let n=Tt(t,Si)??{},o=e("launcher-label");o!==null&&(n.label=o);let a=t("callout-text");if(a){let i=Number.parseInt(t("callout-delay")??"",10);n.callout={text:a,...Number.isFinite(i)?{delayMs:i}:{}}}return Object.keys(n).length>0?n:null}var uo,Z,Mi,Wr,gt,Ri,Ni,Di,Fr,io,yn,Oi,Vr,Br,zr,s_,lo={},co=[],l_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,po=Array.isArray;function at(e,t){for(var n in t)e[n]=t[n];return e}function qr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function mo(e,t,n){var o,a,i,l={};for(i in t)i=="key"?o=t[i]:i=="ref"?a=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?uo.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)l[i]===void 0&&(l[i]=e.defaultProps[i]);return so(e,l,o,a,null)}function so(e,t,n,o,a){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++Mi,__i:-1,__u:0};return a==null&&Z.vnode!=null&&Z.vnode(i),i}function ne(e){return e.children}function ht(e,t){this.props=e,this.context=t}function Wt(e,t){if(t==null)return e.__?Wt(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Wt(e):null}function c_(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],a=[],i=at({},t);i.__v=t.__v+1,Z.vnode&&Z.vnode(i),Gr(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??Wt(t),!!(32&t.__u),a),i.__v=t.__v,i.__.__k[i.__i]=i,Bi(o,i,a),t.__e=t.__=null,i.__e!=n&&$i(i)}}function $i(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),$i(e)}function Ii(e){(!e.__d&&(e.__d=!0)&&gt.push(e)&&!_o.__r++||Ri!=Z.debounceRendering)&&((Ri=Z.debounceRendering)||Ni)(_o)}function _o(){try{for(var e,t=1;gt.length;)gt.length>t&&gt.sort(Di),e=gt.shift(),t=gt.length,c_(e)}finally{gt.length=_o.__r=0}}function Hi(e,t,n,o,a,i,l,s,c,d,u){var h,_,f,m,y,x,k,S=o&&o.__k||co,b=t.length;for(c=d_(n,t,S,c,b),h=0;h<b;h++)(f=n.__k[h])!=null&&(_=f.__i!=-1&&S[f.__i]||lo,f.__i=h,x=Gr(e,f,_,a,i,l,s,c,d,u),m=f.__e,f.ref&&_.ref!=f.ref&&(_.ref&&Kr(_.ref,null,f),u.push(f.ref,f.__c||m,f)),y==null&&m!=null&&(y=m),(k=!!(4&f.__u))||_.__k===f.__k?(c=Fi(f,c,e,k),k&&_.__e&&(_.__e=null)):typeof f.type=="function"&&x!==void 0?c=x:m&&(c=m.nextSibling),f.__u&=-7);return n.__e=y,c}function d_(e,t,n,o,a){var i,l,s,c,d,u=n.length,h=u,_=0;for(e.__k=new Array(a),i=0;i<a;i++)(l=t[i])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[i]=so(null,l,null,null,null):po(l)?l=e.__k[i]=so(ne,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[i]=so(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[i]=l,c=i+_,l.__=e,l.__b=e.__b+1,s=null,(d=l.__i=__(l,n,c,h))!=-1&&(h--,(s=n[d])&&(s.__u|=2)),s==null||s.__v==null?(d==-1&&(a>u?_--:a<u&&_++),typeof l.type!="function"&&(l.__u|=4)):d!=c&&(d==c-1?_--:d==c+1?_++:(d>c?_--:_++,l.__u|=4))):e.__k[i]=null;if(h)for(i=0;i<u;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=Wt(s)),Ui(s,s));return o}function Fi(e,t,n,o){var a,i;if(typeof e.type=="function"){for(a=e.__k,i=0;a&&i<a.length;i++)a[i]&&(a[i].__=e,t=Fi(a[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Wt(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function __(e,t,n,o){var a,i,l,s=e.key,c=e.type,d=t[n],u=d!=null&&(2&d.__u)==0;if(d===null&&s==null||u&&s==d.key&&c==d.type)return n;if(o>(u?1:0)){for(a=n-1,i=n+1;a>=0||i<t.length;)if((d=t[l=a>=0?a--:i++])!=null&&(2&d.__u)==0&&s==d.key&&c==d.type)return l}return-1}function Ai(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||l_.test(t)?n:n+"px"}function ao(e,t,n,o,a){var i,l;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||Ai(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Ai(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Oi,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n[yn]=o[yn]:(n[yn]=Vr,e.addEventListener(t,i?zr:Br,i)):e.removeEventListener(t,i?zr:Br,i);else{if(a=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Li(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[io]==null)t[io]=Vr++;else if(t[io]<n[yn])return;return n(Z.event?Z.event(t):t)}}}function Gr(e,t,n,o,a,i,l,s,c,d){var u,h,_,f,m,y,x,k,S,b,I,G,re,N,Y,$,B=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[s=t.__e=n.__e]),(u=Z.__b)&&u(t);e:if(typeof B=="function"){h=l.length;try{if(S=t.props,b=B.prototype&&B.prototype.render,I=(u=B.contextType)&&o[u.__c],G=u?I?I.props.value:u.__:o,n.__c?k=(_=t.__c=n.__c).__=_.__E:(b?t.__c=_=new B(S,G):(t.__c=_=new ht(S,G),_.constructor=B,_.render=p_),I&&I.sub(_),_.state||(_.state={}),_.__n=o,f=_.__d=!0,_.__h=[],_._sb=[]),b&&_.__s==null&&(_.__s=_.state),b&&B.getDerivedStateFromProps!=null&&(_.__s==_.state&&(_.__s=at({},_.__s)),at(_.__s,B.getDerivedStateFromProps(S,_.__s))),m=_.props,y=_.state,_.__v=t,f)b&&B.getDerivedStateFromProps==null&&_.componentWillMount!=null&&_.componentWillMount(),b&&_.componentDidMount!=null&&_.__h.push(_.componentDidMount);else{if(b&&B.getDerivedStateFromProps==null&&S!==m&&_.componentWillReceiveProps!=null&&_.componentWillReceiveProps(S,G),t.__v==n.__v||!_.__e&&_.shouldComponentUpdate!=null&&_.shouldComponentUpdate(S,_.__s,G)===!1){t.__v!=n.__v&&(_.props=S,_.state=_.__s,_.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(U){U&&(U.__=t)}),co.push.apply(_.__h,_._sb),_._sb=[],_.__h.length&&l.push(_);break e}_.componentWillUpdate!=null&&_.componentWillUpdate(S,_.__s,G),b&&_.componentDidUpdate!=null&&_.__h.push(function(){_.componentDidUpdate(m,y,x)})}if(_.context=G,_.props=S,_.__P=e,_.__e=!1,re=Z.__r,N=0,b)_.state=_.__s,_.__d=!1,re&&re(t),u=_.render(_.props,_.state,_.context),co.push.apply(_.__h,_._sb),_._sb=[];else do _.__d=!1,re&&re(t),u=_.render(_.props,_.state,_.context),_.state=_.__s;while(_.__d&&++N<25);_.state=_.__s,_.getChildContext!=null&&(o=at(at({},o),_.getChildContext())),b&&!f&&_.getSnapshotBeforeUpdate!=null&&(x=_.getSnapshotBeforeUpdate(m,y)),Y=u!=null&&u.type===ne&&u.key==null?zi(u.props.children):u,s=Hi(e,po(Y)?Y:[Y],t,n,o,a,i,l,s,c,d),_.base=t.__e,t.__u&=-161,_.__h.length&&l.push(_),k&&(_.__E=_.__=null)}catch(U){if(l.length=h,t.__v=null,c||i!=null)if(U.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i!=null&&(i[i.indexOf(s)]=null),t.__e=s}else{if(i!=null)for($=i.length;$--;)qr(i[$]);Ur(t)}else t.__e=n.__e,!t.__k&&n.__k&&(t.__k=n.__k),U.then||Ur(t);Z.__e(U,t,n)}}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=u_(n.__e,t,n,o,a,i,l,c,d);return(u=Z.diffed)&&u(t),128&t.__u?void 0:s}function Ur(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Ur))}function Bi(e,t,n){for(var o=0;o<n.length;o++)Kr(n[o],n[++o],n[++o]);Z.__c&&Z.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(i){i.call(a)})}catch(i){Z.__e(i,a.__v)}})}function zi(e){return typeof e!="object"||e==null||e.__b>0?e:po(e)?e.map(zi):e.constructor!==void 0?null:at({},e)}function u_(e,t,n,o,a,i,l,s,c){var d,u,h,_,f,m,y,x=n.props||lo,k=t.props,S=t.type;if(S=="svg"?a="http://www.w3.org/2000/svg":S=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((f=i[d])&&"setAttribute"in f==!!S&&(S?f.localName==S:f.nodeType==3)){e=f,i[d]=null;break}}if(e==null){if(S==null)return document.createTextNode(k);e=document.createElementNS(a,S,k.is&&k),s&&(Z.__m&&Z.__m(t,i),s=!1),i=null}if(S==null)x===k||s&&e.data==k||(e.data=k);else{if(i=S=="textarea"&&k.defaultValue!=null?null:i&&uo.call(e.childNodes),!s&&i!=null)for(x={},d=0;d<e.attributes.length;d++)x[(f=e.attributes[d]).name]=f.value;for(d in x)f=x[d],d=="dangerouslySetInnerHTML"?h=f:d=="children"||d in k||d=="value"&&"defaultValue"in k||d=="checked"&&"defaultChecked"in k||ao(e,d,null,f,a);for(d in k)f=k[d],d=="children"?_=f:d=="dangerouslySetInnerHTML"?u=f:d=="value"?m=f:d=="checked"?y=f:s&&typeof f!="function"||x[d]===f||ao(e,d,f,x[d],a);if(u)s||h&&(u.__html==h.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(h&&(e.innerHTML=""),Hi(t.type=="template"?e.content:e,po(_)?_:[_],t,n,o,S=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,l,i?i[0]:n.__k&&Wt(n,0),s,c),i!=null)for(d=i.length;d--;)qr(i[d]);s&&S!="textarea"||(d="value",S=="progress"&&m==null?e.removeAttribute("value"):m!=null&&(m!==e[d]||S=="progress"&&!m||S=="option"&&m!=x[d])&&ao(e,d,m,x[d],a),d="checked",y!=null&&y!=e[d]&&ao(e,d,y,x[d],a))}return e}function Kr(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(a){Z.__e(a,n)}}function Ui(e,t,n){var o,a;if(Z.unmount&&Z.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Kr(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){Z.__e(i,t)}o.base=o.__P=o.__n=null}if(o=e.__k)for(a=0;a<o.length;a++)o[a]&&Ui(o[a],t,n||typeof e.type!="function");n||qr(e.__e),e.__c=e.__=e.__e=void 0}function p_(e,t,n){return this.constructor(e,n)}function Vt(e,t,n){var o,a,i,l;t==document&&(t=document.documentElement),Z.__&&Z.__(e,t),a=(o=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],Gr(t,e=(!o&&n||t).__k=mo(ne,null,[e]),a||lo,lo,t.namespaceURI,!o&&n?[n]:a?null:t.firstChild?uo.call(t.childNodes):null,i,!o&&n?n:a?a.__e:t.firstChild,o,l),Bi(i,e,l),e.props.children=null}uo=co.slice,Z={__e:function(e,t,n,o){for(var a,i,l;t=t.__;)if((a=t.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(e)),l=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(e,o||{}),l=a.__d),l)return a.__E=a}catch(s){e=s}throw e}},Mi=0,Wr=function(e){return e!=null&&e.constructor===void 0},ht.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=at({},this.state),typeof e=="function"&&(e=e(at({},n),this.props)),e&&at(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ii(this))},ht.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ii(this))},ht.prototype.render=ne,gt=[],Ni=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Di=function(e,t){return e.__v.__b-t.__v.__b},_o.__r=0,Fr=Math.random().toString(8),io="__d"+Fr,yn="__a"+Fr,Oi=/(PointerCapture)$|Capture$/i,Vr=0,Br=Li(!1),zr=Li(!0),s_=0;var qt="0.55.0";function Wi(e){return`${P.cssPrefix}:${e}`}function Pn(e,t,n){e.dispatchEvent(new CustomEvent(Wi(t),{detail:n}))}function Vi(e,t){let o=Object.entries(t).map(([a,i])=>{let l=Wi(a),s=c=>i(c.detail);return e.addEventListener(l,s),[l,s]});return()=>{for(let[a,i]of o)e.removeEventListener(a,i)}}function Ve(){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,m_(t.subarray(6)),t[6]=t[6]&15|112,t[8]=t[8]&63|128;let n=Array.from(t,o=>o.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}function m_(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 Et=W.scope("persistence");function vt(e,t=Qn,n){let o=n?`${e}.${n}`:e,a=`${P.cssPrefix}.storageVersion`,i=t.get(a)??void 0,l=i?`.v${i}`:"",s=`${P.cssPrefix}.${o}${l}`,c=`${P.cssPrefix}${l}.visitorId`,d=`${s}.conversationId`,u=`${s}.userPrefs`,h=`${s}.panelOpen`,_=`${s}.panelSize`,f=`${s}.calloutDismissed`,m=`${s}.sidebarCollapsed`,y=`${s}.activeModule`,x=`${s}.historyCount`,k=`${s}.formsDone`,S={getVisitorId(){let b=t.get(c);if(b)return b;let I=Ve();return t.set(c,I),I},setVisitorId(b){Et.debug("setVisitorId (rebind)",{id:b,scope:o}),t.set(c,b)},loadConversationId(){return t.get(d)??void 0},saveConversationId(b){Et.trace("saveConversationId",{id:b,scope:o}),b?t.set(d,b):t.remove(d)},loadUserPrefs(){let b=t.get(u);if(!b)return{};try{let I=JSON.parse(b);return qi(I)?I:{}}catch(I){return Et.warn("loadUserPrefs parse failed",{error:I}),{}}},saveUserPrefs(b){try{t.set(u,JSON.stringify(b))}catch(I){Et.warn("saveUserPrefs serialise failed",{error:I})}},patchUserPrefs(b){let I=S.loadUserPrefs();S.saveUserPrefs({...I,...b})},loadPanelOpen(){let b=t.get(h);return b==="1"?!0:b==="0"?!1:null},savePanelOpen(b){t.set(h,b?"1":"0")},loadPanelSize(){let b=t.get(_);return b==="normal"||b==="expanded"||b==="fullscreen"?b:null},savePanelSize(b){t.set(_,b)},loadCalloutDismissed(b){if(!b)return!1;let I=t.get(f);return!!I&&I===b},saveCalloutDismissed(b){b?t.set(f,b):t.remove(f)},loadSidebarCollapsed(){let b=t.get(m);return b==="1"?!0:b==="0"?!1:null},saveSidebarCollapsed(b){t.set(m,b?"1":"0")},loadActiveModule(){return t.get(y)||null},saveActiveModule(b){t.set(y,b)},loadHistoryCount(){let b=t.get(x);if(!b)return null;let I=Number.parseInt(b,10);return Number.isFinite(I)&&I>=0?I:null},saveHistoryCount(b){t.set(x,String(b))},loadFormsDone(){let b=t.get(k);if(!b)return{};try{let I=JSON.parse(b);return qi(I)?I:{}}catch(I){return Et.warn("loadFormsDone parse failed",{error:I}),{}}},saveFormDone(b){try{let I=S.loadFormsDone();I[b]=Date.now(),t.set(k,JSON.stringify(I))}catch(I){Et.warn("saveFormDone serialise failed",{error:I})}},rememberStorageVersion(b){b&&b!==t.get(a)&&(Et.debug("rememberStorageVersion (force-reset on next load)",{version:b}),t.set(a,b))},clearConversation(){t.remove(d)}};return S}function qi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Gi=`:host{--__P__-accent-user: __BRAND_ACCENT__;--__P__-accent: var(--__P__-accent-user);--__P__-accent-text-user: __BRAND_ACCENT_TEXT__;--__P__-accent-text: var(--__P__-accent-text-user);--__P__-radius: __BRAND_RADIUS__;--__P__-radius-sm: 8px;--__P__-radius-md: 10px;--__P__-radius-lg: 16px;--__P__-font: __BRAND_FONT__;--__P__-font-display: var(--__P__-font);--__P__-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;--__P__-bg: oklch(1 0 0);--__P__-bg-elevated: oklch(.9789 .0029 278.3);--__P__-surface: var(--__P__-bg-elevated);--__P__-muted: var(--__P__-fg-muted);--__P__-hover: oklch(.1686 .011 278.3 / .06);--__P__-fg: oklch(.1686 .011 278.3);--__P__-fg-muted: oklch(.4932 .0301 278.3);--__P__-border: oklch(.9312 .0084 278.3);--__P__-border-strong: oklch(.8757 .0131 278.3);--__P__-bubble-user: var(--__P__-accent);--__P__-bubble-user-text: var(--__P__-accent-text);--__P__-bubble-assistant: oklch(.9638 .0058 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-on-accent: var(--__P__-accent-text);--__P__-success: oklch(.6456 .1654 151.53);--__P__-warning: oklch(.7135 .1494 74.05);--__P__-danger: oklch(.5966 .1818 24.51);--__P__-danger-text: oklch(.5054 .1905 27.52);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .1);--__P__-neutral: oklch(.7137 .0192 278.3);--__P__-focus: var(--__P__-accent);--__P__-shadow-panel: 0 8px 24px -8px rgba(13, 15, 20, .18), 0 24px 64px -24px rgba(13, 15, 20, .24);--__P__-shadow-card: 0 1px 2px rgba(13, 15, 20, .06), 0 4px 12px -6px rgba(13, 15, 20, .12);--__P__-backdrop: oklch(.1686 .011 278.3 / .55);--__P__-shadow-fab: 0 6px 16px -4px color-mix(in oklch, var(--__P__-accent) 45%, transparent), 0 12px 32px -12px rgba(13, 15, 20, .25);--__P__-z-fab: 2147483600;--__P__-z-panel: 2147483601;--__P__-panel-w: 380px;--__P__-panel-h: 600px;--__P__-fab-size: 56px;--__P__-conversation-max: 768px;--__P__-space-1: 4px;--__P__-space-2: 8px;--__P__-space-3: 12px;--__P__-space-4: 16px;--__P__-space-5: 20px;--__P__-space-6: 24px;--__P__-space-8: 32px;--__P__-text-scale: 1;--__P__-text-xs: calc(12px * var(--__P__-text-scale));--__P__-text-sm: calc(13px * var(--__P__-text-scale));--__P__-text-base: calc(15px * var(--__P__-text-scale));--__P__-text-md: calc(16px * var(--__P__-text-scale));--__P__-text-lg: calc(18px * var(--__P__-text-scale));--__P__-text-xl: calc(22px * var(--__P__-text-scale));--__P__-text-2xl: calc(30px * var(--__P__-text-scale))}:host([data-text-size="small"]){--__P__-text-scale: .9}:host([data-text-size="large"]){--__P__-text-scale: 1.15}:host{--__P__-ease: cubic-bezier(.2, .7, .2, 1);--__P__-ease-out: cubic-bezier(.2, .7, .2, 1);--__P__-ease-in: cubic-bezier(.4, 0, 1, 1);--__P__-ease-in-out: cubic-bezier(.65, 0, .35, 1);--__P__-dur-quick: .12s;--__P__-dur-base: .22s;--__P__-dur-slow: .32s;font-family:var(--__P__-font);color:var(--__P__-fg);color-scheme:light;--__P__-color-scheme: light}:host([data-theme="dark"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-danger-text: oklch(.8077 .1035 19.57);--__P__-danger-bg: oklch(.5966 .1818 24.51 / .18);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);--__P__-shadow-card: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px -6px rgba(0, 0, 0, .5);--__P__-backdrop: rgba(0, 0, 0, .65);color-scheme:dark;--__P__-color-scheme: dark}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-bg: oklch(.1783 .0128 278.3);--__P__-bg-elevated: oklch(.2232 .0182 278.3);--__P__-fg: oklch(.9368 .01 278.3);--__P__-fg-muted: oklch(.7048 .0296 278.3);--__P__-border: oklch(.2752 .0266 278.3);--__P__-border-strong: oklch(.335 .0291 278.3);--__P__-hover: oklch(.9368 .01 278.3 / .08);--__P__-bubble-assistant: oklch(.2474 .0311 278.3);--__P__-bubble-assistant-text: var(--__P__-fg);--__P__-shadow-panel: 0 8px 24px -8px rgba(0, 0, 0, .6), 0 24px 64px -24px rgba(0, 0, 0, .7);color-scheme:dark;--__P__-color-scheme: dark}}@supports (color: oklch(from red l c h)){:host{--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.3, l, .62) c h);--__P__-accent-text: oklch(from var(--__P__-accent) clamp(0, (l / .623 - 1) * -infinity, 1) 0 h)}:host([data-theme="dark"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h)}@media(prefers-color-scheme:dark){:host([data-theme="auto"]){--__P__-accent: oklch(from var(--__P__-accent-user) clamp(.65, l, .85) c h)}}}@media(prefers-reduced-motion:reduce){:host{--__P__-dur-quick: 1ms;--__P__-dur-base: 1ms;--__P__-dur-slow: 1ms}}
2
+ `;var Ki=`*,*:before,*:after{box-sizing:border-box;margin:0;padding:0;border:0}button{font:inherit;color:inherit;background:none;cursor:pointer;-webkit-appearance:none;appearance:none;line-height:1}button:focus-visible,[tabindex]:focus-visible,textarea:focus-visible,input:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}textarea,input{font:inherit;color:inherit;background:none;border:0;outline:0;resize:none}a{color:var(--__P__-accent);text-decoration:underline;text-underline-offset:2px}img,svg{display:block;max-width:100%}ul,ol{list-style:none}.__P__-app{display:block;width:100%;height:100%;font-family:var(--__P__-font);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:"cv11","ss01","ss03"}.__P__-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
3
+ `;var ji=`.__P__-anchor{color-scheme:var(--__P__-color-scheme, light);right:16px;bottom:16px}.__P__-surface{display:contents}.__P__-surface[hidden]{display:none}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:calc(14px * var(--__P__-text-scale))}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:calc(14px * var(--__P__-text-scale));background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:color-mix(in srgb,currentColor 15%,transparent)}.__P__-callout-close:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}@media(prefers-reduced-motion:no-preference){.__P__-panel{transition:width var(--__P__-dur-base) var(--__P__-ease),height var(--__P__-dur-base) var(--__P__-ease),max-width var(--__P__-dur-base) var(--__P__-ease),max-height var(--__P__-dur-base) var(--__P__-ease)}.__P__-panel[data-resizing]{transition:none}}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;padding:0;justify-content:flex-end;align-items:flex-end}:host([data-mode="fullscreen"][data-position*="top"]) .__P__-anchor{justify-content:flex-start}:host([data-mode="fullscreen"][data-position*="left"]) .__P__-anchor{align-items:flex-start}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}@media(max-width:640px){:host([data-mode="open"]) .__P__-anchor,:host([data-mode="expanded"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="open"]) .__P__-panel,:host([data-mode="expanded"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-inline-start:auto;display:flex;align-items:center;gap:var(--__P__-space-1);flex-shrink:0}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:calc(14px * var(--__P__-text-scale));font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list,.__P__-history,.__P__-module-scroll,.__P__-home-scroll,.__P__-help-list,.__P__-toolui-code,.__P__-sidebar-conversations{scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;overscroll-behavior:contain;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar,.__P__-history::-webkit-scrollbar,.__P__-module-scroll::-webkit-scrollbar,.__P__-home-scroll::-webkit-scrollbar,.__P__-help-list::-webkit-scrollbar,.__P__-toolui-code::-webkit-scrollbar,.__P__-sidebar-conversations::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb,.__P__-history::-webkit-scrollbar-thumb,.__P__-module-scroll::-webkit-scrollbar-thumb,.__P__-home-scroll::-webkit-scrollbar-thumb,.__P__-help-list::-webkit-scrollbar-thumb,.__P__-toolui-code::-webkit-scrollbar-thumb,.__P__-sidebar-conversations::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-list-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;inset-inline-end:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-jump--new{width:auto;gap:5px;padding-inline:11px}.__P__-jump-count{font-size:12px;font-weight:600;line-height:1}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px}.__P__-list--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__-turn-spacer{flex:0 0 auto;min-block-size:0}.__P__-list>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-date-divider{display:flex;justify-content:center;margin-block:var(--__P__-space-3)}.__P__-date-pill{padding:3px 10px;border-radius:999px;font-size:calc(11px * var(--__P__-text-scale));font-weight:600;color:var(--__P__-fg-muted);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);box-shadow:var(--__P__-shadow-card)}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:100%;min-width:0;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:calc(14px * var(--__P__-text-scale));word-wrap:break-word;overflow-wrap:break-word;box-shadow:0 1px 2px #0000000a,0 1px 8px -4px #0000000f;animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-bubble ::selection{background:color-mix(in srgb,var(--__P__-accent) 30%,transparent)}.__P__-bubble-row[data-role=user] .__P__-bubble ::selection{background:#fff6;color:var(--__P__-bubble-user-text)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-end-end-radius:5px}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-end-start-radius:5px}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui){width:100%}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col:has(.__P__-toolui) .__P__-bubble{width:100%}@media(max-width:640px){.__P__-bubble-col{max-width:92%}.__P__-toolui:not(.__P__-toolui-collapsible){padding:var(--__P__-space-3);gap:var(--__P__-space-2)}details.__P__-toolui-collapsible>summary{padding:var(--__P__-space-2) var(--__P__-space-3)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-3)}.__P__-toolui-section,.__P__-toolui-desc{padding:var(--__P__-space-2) var(--__P__-space-3)}}.__P__-bubble-time{margin-top:3px;padding:0 4px;font-size:calc(11px * var(--__P__-text-scale));line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-feedback{display:flex;gap:2px;margin-top:4px;padding:0 2px}.__P__-feedback-btn{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border:0;border-radius:var(--__P__-radius-sm);background:transparent;color:var(--__P__-fg-muted);cursor:pointer;opacity:.7;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__-feedback-btn:hover{opacity:1;background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-feedback-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;opacity:1}.__P__-feedback-btn[data-active=true]{opacity:1;color:var(--__P__-accent)}.__P__-feedback-btn 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 code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:calc(12.5px * var(--__P__-text-scale));padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-inline-start:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-start-end-radius:var(--__P__-radius-sm);border-end-end-radius:var(--__P__-radius-sm);color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:start}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:5px;height:5px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-inline-start:var(--__P__-space-3);border-inline-start:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary:hover{color:var(--__P__-fg)}.__P__-reasoning-summary:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px;border-radius:var(--__P__-radius-sm)}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-inline-end:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-source{display:inline-flex;align-items:center;gap:6px;max-width:100%;margin-top:6px;margin-inline-end:6px;padding:var(--__P__-space-1) var(--__P__-space-2);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);text-decoration:none}a.__P__-source:hover{color:var(--__P__-fg);border-color:var(--__P__-accent)}.__P__-source-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer>*{width:100%;max-width:var(--__P__-conversation-max, 768px);margin-inline:auto}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:calc(14px * var(--__P__-text-scale));line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 12px;border-radius:var(--__P__-radius-sm);background:color-mix(in oklab,var(--__P__-danger) 8%,var(--__P__-bg-elevated));border:1px solid color-mix(in oklab,var(--__P__-danger) 20%,transparent);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error span{min-width:0}.__P__-error button{margin-inline-start:auto;flex-shrink:0;border:0;background:none;padding:0;color:var(--__P__-accent);font:inherit;font-size:var(--__P__-text-sm);font-weight:600;text-decoration:underline;white-space:nowrap;cursor:pointer}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-3)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:14px 4px 8px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-card{display:flex;flex-direction:column;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);overflow:hidden}.__P__-history-item{all:unset;display:flex;align-items:center;gap:var(--__P__-space-3);padding:12px var(--__P__-space-3);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item+.__P__-history-item{border-top:1px solid var(--__P__-border)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-avatar{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:color-mix(in oklab,var(--__P__-accent) 12%,transparent);color:var(--__P__-accent)}.__P__-history-avatar svg{width:18px;height:18px}.__P__-history-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.__P__-history-row{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2)}.__P__-history-title{flex:1;min-width:0;font-size:calc(14px * var(--__P__-text-scale));font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-time{flex:none;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-history-preview{flex:1;min-width:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--__P__-accent)}.__P__-history-item[data-unread=true] .__P__-history-title{font-weight:600}.__P__-history-item[data-closed=true] .__P__-history-title{color:var(--__P__-fg-muted)}.__P__-history-item-skeleton{cursor:default;pointer-events:none}.__P__-skeleton{display:block;border-radius:4px;background:linear-gradient(90deg,color-mix(in oklab,var(--__P__-fg) 9%,transparent) 30%,color-mix(in oklab,var(--__P__-fg) 17%,transparent),color-mix(in oklab,var(--__P__-fg) 9%,transparent) 70%);background-size:200% 100%;animation:__P__-skeleton-shimmer 1.8s ease-in-out infinite}.__P__-history-avatar.__P__-skeleton{border-radius:50%}.__P__-skeleton-heading{width:52px;height:8px}.__P__-skeleton-title{width:55%;height:12px}.__P__-skeleton-time{width:34px;height:10px}.__P__-skeleton-preview{width:80%;height:10px}@keyframes __P__-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.__P__-skeleton{animation:none}}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:calc(11px * var(--__P__-text-scale));line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:calc(11px * var(--__P__-text-scale));letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;inset-inline-end:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent)}.__P__-menu-check svg{width:14px;height:14px}.__P__-menu-item-segmented{cursor:default}.__P__-menu-item-segmented:hover{background:transparent}.__P__-segmented{display:inline-flex;gap:2px;padding:2px;background:var(--__P__-bg-elevated);border-radius:var(--__P__-radius-sm)}.__P__-segment{all:unset;min-width:26px;padding:3px 8px;font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.02em;text-align:center;color:var(--__P__-fg-muted);border-radius:calc(var(--__P__-radius-sm) - 2px);cursor:pointer;transition:color .12s ease,background .12s ease}.__P__-segment:hover{color:var(--__P__-fg)}.__P__-segment[data-on=true]{background:var(--__P__-bg);color:var(--__P__-accent);box-shadow:var(--__P__-shadow-card)}.__P__-segment:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body,.__P__-messenger-pane{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-pane[hidden]{display:none}@keyframes __P__-view-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}@media(prefers-reduced-motion:no-preference){.__P__-module,.__P__-history{animation:__P__-view-in .18s var(--__P__-ease-out)}}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{container-type:inline-size;background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-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:999px;overflow:hidden;margin-inline-start:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-inline-start:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:start;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:start}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale))}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:calc(14px * var(--__P__-text-scale));color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:start;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-hover)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:start;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:calc(14px * var(--__P__-text-scale));display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;inset-inline-end:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-form{display:flex;flex-direction:column;gap:var(--__P__-space-4)}.__P__-field{display:flex;flex-direction:column;gap:6px}.__P__-field-label{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-field-req{color:var(--__P__-danger)}.__P__-field-input{width:100%;min-width:0;max-width:100%;box-sizing:border-box;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);resize:vertical;transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-field-input:focus-visible{outline:none;border-color:var(--__P__-accent)}.__P__-field[data-invalid=true] .__P__-field-input{border-color:var(--__P__-danger)}.__P__-field-input[type=date],.__P__-field-input[type=time]{appearance:none;-webkit-appearance:none}@media(pointer:coarse){.__P__-field-input{font-size:max(16px,calc(16px * var(--__P__-text-scale)))}}.__P__-field-hint{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-field-error{font-size:var(--__P__-text-xs);color:var(--__P__-danger)}.__P__-field-choices{display:flex;flex-direction:column;gap:10px;padding-top:2px}.__P__-choice{display:flex;align-items:flex-start;gap:10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);cursor:pointer}.__P__-choice input{margin-top:2px;accent-color:var(--__P__-accent)}.__P__-form-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}.__P__-form-hint{flex:1 1 auto;min-width:6rem;margin-inline-end:auto;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-form-submit{padding:var(--__P__-space-2) var(--__P__-space-4);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-submit:hover:not(:disabled){filter:brightness(1.06)}.__P__-form-submit:disabled{opacity:.6;cursor:default}.__P__-form-skip{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:transparent;color:var(--__P__-fg-muted);font:inherit;font-size:var(--__P__-text-sm);white-space:nowrap;flex-shrink:0;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-skip:hover:not(:disabled){background:var(--__P__-bg-elevated)}@media(max-width:640px){.__P__-form-hint{flex-basis:100%;margin-inline-end:0;font-size:var(--__P__-text-xs)}.__P__-form-submit,.__P__-form-skip{flex:1 1 0;text-align:center}}.__P__-form-gate{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-form-gate-title{margin:0;font-size:var(--__P__-text-base);font-weight:700;color:var(--__P__-fg)}.__P__-form-gate-desc{margin:0 0 var(--__P__-space-1);font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-form-done{display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 12px;border:1px dashed var(--__P__-border);border-radius:999px;align-self:center;font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted)}.__P__-form-done svg{width:14px;height:14px;color:var(--__P__-success, #22c55e)}.__P__-form-done[data-outcome=skipped] svg{color:var(--__P__-fg-muted)}.__P__-form-done-fill{border:0;background:none;padding:0 2px;cursor:pointer;font:inherit;font-weight:600;color:var(--__P__-accent)}.__P__-form-done-fill:hover{text-decoration:underline}details.__P__-form-done{display:block;padding:0;border-radius:var(--__P__-radius-md)}details[open].__P__-form-done{width:min(100%,420px);background:var(--__P__-surface)}.__P__-form-done-summary{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 12px;cursor:pointer;list-style:none}.__P__-form-done-summary::-webkit-details-marker{display:none}.__P__-form-done-summary>svg:last-child{color:var(--__P__-fg-muted);transition:transform .15s var(--__P__-ease)}details[open]>.__P__-form-done-summary>svg:last-child{transform:rotate(90deg)}.__P__-form-answers{margin:0;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);display:grid;gap:var(--__P__-space-3);text-align:start}.__P__-form-answer{display:grid;gap:6px}.__P__-form-answer dt{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-form-answer dd{margin:0;padding:10px var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);font-size:var(--__P__-text-sm);font-weight:400;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui{margin-block:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-lg, 14px);background:var(--__P__-bg-elevated);font-size:var(--__P__-text-sm)}.__P__-toolui:not(.__P__-toolui-collapsible){display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:var(--__P__-space-4)}.__P__-toolui-group{display:flex;flex-direction:column;gap:var(--__P__-space-3);margin-block:var(--__P__-space-3)}.__P__-toolui-group>.__P__-toolui{margin-block:0}.__P__-toolui-stale{opacity:.7}details.__P__-toolui-collapsible>summary{display:flex;align-items:center;gap:var(--__P__-space-2);padding:var(--__P__-space-3) var(--__P__-space-4);cursor:pointer;list-style:none}details.__P__-toolui-collapsible>summary::-webkit-details-marker{display:none}details.__P__-toolui-collapsible[open]>summary{border-bottom:1px solid var(--__P__-border)}details.__P__-toolui-collapsible>.__P__-toolui-section{margin:var(--__P__-space-4)}details.__P__-toolui-collapsible>.__P__-toolui-section~.__P__-toolui-section{margin-top:calc(-1 * var(--__P__-space-2))}.__P__-toolui-wrench{display:inline-flex;color:var(--__P__-fg-muted)}.__P__-toolui-wrench svg{width:15px;height:15px}.__P__-toolui-title{font-weight:600;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui-chevron{display:inline-flex;margin-inline-start:auto;color:var(--__P__-fg-muted);transition:transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-toolui-chevron svg{width:16px;height:16px}details.__P__-toolui-collapsible[open]>summary .__P__-toolui-chevron{transform:rotate(180deg)}.__P__-toolui-badge{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:999px;border:1px solid var(--__P__-border-strong);background:var(--__P__-bg);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;white-space:nowrap}.__P__-toolui-badge-accent{border-color:color-mix(in oklab,var(--__P__-warning, #f59e0b) 55%,transparent);background:color-mix(in oklab,var(--__P__-warning, #f59e0b) 12%,transparent);color:var(--__P__-warning, #f59e0b)}.__P__-toolui-badge-muted{border-color:color-mix(in oklab,var(--__P__-fg-muted) 50%,transparent);background:color-mix(in oklab,var(--__P__-fg-muted) 14%,transparent);color:var(--__P__-fg)}.__P__-toolui-status-icon{display:inline-flex}.__P__-toolui-status-icon svg{width:14px;height:14px}.__P__-toolui-status[data-status=awaiting] .__P__-toolui-status-icon{color:var(--__P__-warning, #f59e0b)}.__P__-toolui-status[data-status=responded] .__P__-toolui-status-icon{color:var(--__P__-accent)}.__P__-toolui-status[data-status=completed] .__P__-toolui-status-icon{color:var(--__P__-success, #16a34a)}.__P__-toolui-status[data-status=denied] .__P__-toolui-status-icon{color:#ea580c}.__P__-toolui-status[data-status=error] .__P__-toolui-status-icon{color:var(--__P__-danger, #dc2626)}.__P__-toolui-head{display:flex;align-items:center;flex-wrap:wrap;gap:var(--__P__-space-2)}.__P__-toolui-desc{margin:0;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-section{display:flex;flex-direction:column;gap:8px;padding:var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);border:1px solid var(--__P__-border)}.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-section,.__P__-toolui:not(.__P__-toolui-collapsible) .__P__-toolui-desc{padding:0;background:none;border:0;border-radius:0}.__P__-toolui-label{font-size:var(--__P__-text-xs);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--__P__-fg-muted)}.__P__-toolui-text{margin:0;font-size:var(--__P__-text-base);font-weight:600;color:var(--__P__-fg);line-height:1.55;overflow-wrap:anywhere}.__P__-toolui-code{margin:0;max-height:240px;overflow:auto;color:var(--__P__-fg);font-family:var(--__P__-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);font-size:var(--__P__-text-xs);line-height:1.5;white-space:pre-wrap;word-break:break-word}.__P__-toolui-code[data-error=true]{color:var(--__P__-danger, #dc2626)}.__P__-toolui-body{gap:6px}.__P__-toolui-prompt{margin:0;font-weight:600;color:var(--__P__-fg);overflow-wrap:anywhere}.__P__-toolui-subtle{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);line-height:1.5}.__P__-toolui-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:var(--__P__-space-2)}:host([dir="rtl"]) .__P__-icon-dir{transform:scaleX(-1)}:host([dir="rtl"]) .__P__-field-input[type=date],:host([dir="rtl"]) .__P__-field-input[type=time]{position:relative;text-align:right;padding-left:34px}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-datetime-edit,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-datetime-edit{text-align:right}:host([dir="rtl"]) .__P__-field-input[type=date]::-webkit-calendar-picker-indicator,:host([dir="rtl"]) .__P__-field-input[type=time]::-webkit-calendar-picker-indicator{position:absolute;left:var(--__P__-space-3);margin:0}
4
+ `;var Xi=`.__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}
5
+ `;var Yi=`:host([data-mode="page"]){min-height:0}:host([data-mode="page"]) .__P__-page-shell{display:grid;grid-template-columns:280px 1fr;width:100%;height:100%;min-height:0;background:var(--__P__-bg);color:var(--__P__-fg);transition:grid-template-columns var(--__P__-dur-base) var(--__P__-ease-in-out)}:host([data-mode="page"]) .__P__-page-shell[data-sidebar-collapsed=true]{grid-template-columns:48px 1fr}:host([data-mode="page"]) .__P__-page-chat{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}:host([data-mode="page"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-width:0;min-height:0;flex:1 1 0}:host([data-mode="page"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;border-radius:0;border:0;box-shadow:none;animation:none}:host([data-mode="page"]) .__P__-sidebar{border-inline-end:1px solid var(--__P__-border);display:flex;flex-direction:column;overflow:hidden;background:var(--__P__-surface)}:host([data-mode="page"]) .__P__-sidebar-header{padding:var(--__P__-space-4) var(--__P__-space-5);border-bottom:1px solid var(--__P__-border);display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-2);min-height:56px;box-sizing:border-box}:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-header{padding:var(--__P__-space-4) var(--__P__-space-2);justify-content:center}:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-logo,:host([data-mode="page"]) .__P__-sidebar[data-collapsed=true] .__P__-sidebar-title{display:none}:host([data-mode="page"]) .__P__-sidebar-toggle{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid var(--__P__-border);border-radius:6px;background:transparent;color:var(--__P__-fg);cursor:pointer;transition:background .12s,border-color .12s}:host([data-mode="page"]) .__P__-sidebar-toggle:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}:host([data-mode="page"]) .__P__-sidebar-toggle:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}:host([data-mode="page"]) .__P__-sidebar-logo{height:32px;display:block}:host([data-mode="page"]) .__P__-sidebar-title{font-size:var(--__P__-text-md);font-weight:600}:host([data-mode="page"]) .__P__-sidebar-section{padding:var(--__P__-space-3) var(--__P__-space-4);border-bottom:1px solid var(--__P__-border)}:host([data-mode="page"]) .__P__-sidebar-nav{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}:host([data-mode="page"]) .__P__-sidebar-nav-item{display:flex;align-items:center;gap:10px;padding:var(--__P__-space-2) var(--__P__-space-3);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);text-decoration:none;font-size:calc(14px * var(--__P__-text-scale));transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}:host([data-mode="page"]) .__P__-sidebar-nav-item:hover{background:var(--__P__-hover)}:host([data-mode="page"]) .__P__-sidebar-nav-item:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}:host([data-mode="page"]) .__P__-sidebar-cards{display:grid;grid-template-columns:1fr;gap:var(--__P__-space-2)}:host([data-mode="page"]) .__P__-sidebar-card{display:block;padding:10px 12px;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-sm);text-decoration:none;color:var(--__P__-fg);transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}:host([data-mode="page"]) .__P__-sidebar-card:hover{border-color:var(--__P__-accent)}:host([data-mode="page"]) .__P__-sidebar-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}:host([data-mode="page"]) .__P__-sidebar-card-label{font-weight:600;font-size:calc(14px * var(--__P__-text-scale))}:host([data-mode="page"]) .__P__-sidebar-card-desc{font-size:var(--__P__-text-xs);color:var(--__P__-muted);margin-top:2px}:host([data-mode="page"]) .__P__-sidebar-conversations{flex:1 1 auto;overflow-y:auto;padding:var(--__P__-space-3) var(--__P__-space-4)}:host([data-mode="page"]) .__P__-page-chat{display:flex;flex-direction:column;overflow:hidden}@media(max-width:768px){:host([data-mode="page"]) .__P__-page-shell{grid-template-columns:1fr}:host([data-mode="page"]) .__P__-sidebar{display:none}}
6
+ `;var x_="helpai",y_="#5B5BD6",P_="#FFFFFF",k_="12px",S_="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",jr=[Gi,Ki,ji,Xi,Yi].join(`
7
+ `).replace(/__P__/g,x_).replaceAll("__BRAND_ACCENT_TEXT__",P_).replaceAll("__BRAND_ACCENT__",y_).replaceAll("__BRAND_RADIUS__",k_).replaceAll("__BRAND_FONT__",S_);var w_=W.scope("mount"),Ji=new WeakMap,Qi={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 Zi(e,t){e.style.cssText=Qi[t]}function Rt(e){return e==="floating"||e==="modal"||e==="drawer"?"floating":e==="standalone"||e==="page"?"viewport":"flow"}function Gt(e={}){let t=e.position??"flow";w_.debug("createShadowMount",{position:t,hasTarget:!!e.target,hasHost:!!e.existingHost});let n=`${P.cssPrefix}-chat-host`;typeof customElements<"u"&&!customElements.get(n)&&customElements.define(n,class extends HTMLElement{});let o;e.existingHost?o=e.existingHost:(o=document.createElement(n),(e.target??document.body).appendChild(o)),o.setAttribute("data-brand",P.id),o.style.cssText=Qi[t];let a=o.shadowRoot??o.attachShadow({mode:"open"}),i=o.ownerDocument;if(!C_(a,i)){let s=i.createElement("style");s.textContent=jr,a.appendChild(s)}let l=document.createElement("div");return l.className=`${P.cssPrefix}-app`,a.appendChild(l),{appRoot:l,destroy:()=>o.remove(),hostElement:o,shadowRoot:a}}function C_(e,t){if(!("adoptedStyleSheets"in e))return!1;let n=t.defaultView;if(!n||typeof n.CSSStyleSheet!="function")return!1;let o=Ji.get(t);if(!o)try{o=new n.CSSStyleSheet,o.replaceSync(jr),Ji.set(t,o)}catch{return!1}try{return e.adoptedStyleSheets=[o],!0}catch{return!1}}function T_(e,t){let n=P.cssPrefix;t.accent&&e.style.setProperty(`--${n}-accent-user`,t.accent),t.accentText&&e.style.setProperty(`--${n}-accent-text-user`,t.accentText),t.radius&&e.style.setProperty(`--${n}-radius`,t.radius),t.fontFamily&&e.style.setProperty(`--${n}-font`,t.fontFamily)}function E_(e,t){e.dataset.theme=t}function R_(e,t){let n=P.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 I_(e,t){e.dataset.position=t}function fo(e,t){e.dataset.mode=t}function es(e,t){E_(e,t.themeMode),T_(e,t.themeOverrides),I_(e,t.position),R_(e,t.size)}var A_=W.scope("iframe"),L_='<!doctype html><html><head><meta charset="utf-8"><style>html,body{margin:0;padding:0;background:transparent;overflow:hidden}</style></head><body></body></html>';function os(e,t,n="closed",o="floating",a=null){A_.debug("createIframeMount",{position:t,initialMode:n,layoutMode:o,hasTarget:!!a});let i=document.createElement("iframe");i.title=`${P.name} chat`,i.setAttribute("allow","microphone; clipboard-write"),ns(i,t,n,o),(o==="inline"&&a?a:document.body).appendChild(i);let s=i.contentDocument;if(!s)throw new Error("iframe contentDocument unavailable (cross-origin?)");s.open(),s.write(L_),s.close();let c=Gt({...e,target:s.body}),d=new MutationObserver(()=>{ns(i,t,c.hostElement.dataset.mode??"closed",o)});return d.observe(c.hostElement,{attributes:!0,attributeFilter:["data-mode"]}),{...c,iframeElement:i,destroy(){d.disconnect(),c.destroy(),i.remove()}}}var go="border:0;background:transparent;z-index:2147483647;pointer-events:auto;",ts={closed:{w:"88px",h:"88px"},expanded:{w:"min(calc(100vw - 32px), 680px)",h:"min(calc(100vh - 32px), 860px)"},open:{w:"min(calc(100vw - 32px), 440px)",h:"min(calc(100vh - 32px), 700px)"}};function ns(e,t,n,o){if(n==="fullscreen"||o==="standalone"){e.style.cssText=`${go}position:fixed;inset:0;width:100vw;height:100vh;`;return}if(o==="inline"){e.style.cssText=`${go}position:static;display:block;width:100%;height:100%;`;return}if(typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches&&(n==="open"||n==="expanded")){e.style.cssText=`${go}position:fixed;inset:0;width:100vw;height:100vh;`;return}let i=t.startsWith("top-")?"top":"bottom",l=t.endsWith("-left")?"left":"right",{w:s,h:c}=ts[n]??ts.open;e.style.cssText=`${go}position:fixed;${i}:16px;${l}:16px;width:${s};height:${c};`}var Kt=class{constructor(){j(this,"handlers",new Map)}on(t,n){let o=this.handlers.get(t);return o||(o=new Set,this.handlers.set(t,o)),o.add(n),()=>this.handlers.get(t)?.delete(n)}emit(t,n){let o=this.handlers.get(t);if(o)for(let a of o)try{a(n)}catch{}}clear(){this.handlers.clear()}};var jt,ve,Xr,rs,kn=0,ps=[],ye=Z,as=ye.__b,is=ye.__r,ss=ye.diffed,ls=ye.__c,cs=ye.unmount,ds=ye.__;function ho(e,t){ye.__h&&ye.__h(ve,e,kn||t),kn=0;var n=ve.__H||(ve.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function R(e){return kn=1,M_(fs,e)}function M_(e,t,n){var o=ho(jt++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):fs(void 0,t),function(s){var c=o.__N?o.__N[0]:o.__[0],d=o.t(c,s);c!==d&&(o.__N=[d,o.__[1]],o.__c.setState({}))}],o.__c=ve,!ve.__f)){var a=function(s,c,d){if(!o.__c.__H)return!0;var u=!1,h=o.__c.props!==s;if(o.__c.__H.__.some(function(f){if(f.__N){u=!0;var m=f.__[0];f.__=f.__N,f.__N=void 0,m!==f.__[0]&&(h=!0)}}),i){var _=i.call(this,s,c,d);return u?_||h:_}return!u||h};ve.__f=!0;var i=ve.shouldComponentUpdate,l=ve.componentWillUpdate;ve.componentWillUpdate=function(s,c,d){if(this.__e){var u=i;i=void 0,a(s,c,d),i=u}l&&l.call(this,s,c,d)},ve.shouldComponentUpdate=a}return o.__N||o.__}function T(e,t){var n=ho(jt++,3);!ye.__s&&Jr(n.__H,t)&&(n.__=e,n.u=t,ve.__H.__h.push(n))}function It(e,t){var n=ho(jt++,4);!ye.__s&&Jr(n.__H,t)&&(n.__=e,n.u=t,ve.__h.push(n))}function D(e){return kn=5,Ae(function(){return{current:e}},[])}function Ae(e,t){var n=ho(jt++,7);return Jr(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function H(e,t){return kn=8,Ae(function(){return e},t)}function _s(){for(var e;e=ps.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Yr),t.__h.some(ms),t.__h=[]}catch(n){t.__h=[],ye.__e(n,e.__v)}}}ye.__b=function(e){ve=null,as&&as(e)},ye.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ds&&ds(e,t)},ye.__r=function(e){is&&is(e),jt=0;var t=(ve=e.__c).__H;t&&(Xr===ve?(t.__h=[],ve.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.length&&_s(),jt=0)),Xr=ve},ye.diffed=function(e){ss&&ss(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ps.push(t)!==1&&rs===ye.requestAnimationFrame||((rs=ye.requestAnimationFrame)||N_)(_s)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),Xr=ve=null},ye.__c=function(e,t){t.some(function(n){try{n.__h.some(Yr),n.__h=n.__h.filter(function(o){return!o.__||ms(o)})}catch(o){t.some(function(a){a.__h&&(a.__h=[])}),t=[],ye.__e(o,n.__v)}}),ls&&ls(e,t)},ye.unmount=function(e){cs&&cs(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(o){try{Yr(o)}catch(a){t=a}}),n.__H=void 0,t&&ye.__e(t,n.__v))};var us=typeof requestAnimationFrame=="function";function N_(e){var t,n=function(){clearTimeout(o),us&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);us&&(t=requestAnimationFrame(n))}function Yr(e){var t=ve,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),ve=t}function ms(e){var t=ve;e.__c=e.__(),ve=t}function Jr(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function fs(e,t){return typeof t=="function"?t(e):t}var D_=Symbol.for("preact-signals");function yo(){if(it>1)it--;else{var e,t=!1;for((function(){var a=bo;for(bo=void 0;a!==void 0;)a.S.v===a.v&&(a.S.i=a.i),a=a.o})();Sn!==void 0;){var n=Sn;for(Sn=void 0,vo++;n!==void 0;){var o=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&vs(n))try{n.c()}catch(a){t||(e=a,t=!0)}n=o}}if(vo=0,it--,t)throw e}}function Xt(e){if(it>0)return e();Qr=++O_,it++;try{return e()}finally{yo()}}var ue=void 0;function wn(e){var t=ue;ue=void 0;try{return e()}finally{ue=t}}var gs,Sn=void 0,it=0,vo=0,O_=0,Qr=0,bo=void 0,xo=0;function hs(e){if(ue!==void 0){var t=e.n;if(t===void 0||t.t!==ue)return t={i:0,S:e,p:ue.s,n:void 0,t:ue,e:void 0,x:void 0,r:t},ue.s!==void 0&&(ue.s.n=t),ue.s=t,e.n=t,32&ue.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=ue.s,t.n=void 0,ue.s.n=t,ue.s=t),t}}function Se(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}Se.prototype.brand=D_;Se.prototype.h=function(){return!0};Se.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:wn(function(){var o;(o=t.W)==null||o.call(t)}))};Se.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,o=e.x;n!==void 0&&(n.x=o,e.e=void 0),o!==void 0&&(o.e=n,e.x=void 0),e===this.t&&(this.t=o,o===void 0&&wn(function(){var a;(a=t.Z)==null||a.call(t)}))}};Se.prototype.subscribe=function(e){var t=this;return st(function(){var n=t.value;wn(function(){return e(n)})},{name:"sub"})};Se.prototype.valueOf=function(){return this.value};Se.prototype.toString=function(){return this.value+""};Se.prototype.toJSON=function(){return this.value};Se.prototype.peek=function(){var e=this;return wn(function(){return e.value})};Object.defineProperty(Se.prototype,"value",{get:function(){var e=hs(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(vo>100)throw new Error("Cycle detected");(function(n){it!==0&&vo===0&&n.l!==Qr&&(n.l=Qr,bo={S:n,v:n.v,i:n.i,o:bo})})(this),this.v=e,this.i++,xo++,it++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{yo()}}}});function z(e,t){return new Se(e,t)}function vs(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 bs(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 xs(e){for(var t=e.s,n=void 0;t!==void 0;){var o=t.p;t.i===-1?(t.S.U(t),o!==void 0&&(o.n=t.n),t.n!==void 0&&(t.n.p=o)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=o}e.s=n}function At(e,t){Se.call(this,void 0,t),this.x=e,this.s=void 0,this.g=xo-1,this.f=4}At.prototype=new Se;At.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===xo))return!0;if(this.g=xo,this.f|=1,this.i>0&&!vs(this))return this.f&=-2,!0;var e=ue;try{bs(this),ue=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 ue=e,xs(this),this.f&=-2,!0};At.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}Se.prototype.S.call(this,e)};At.prototype.U=function(e){if(this.t!==void 0&&(Se.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};At.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(At.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=hs(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Cn(e,t){return new At(e,t)}function ys(e){var t=e.m;if(e.m=void 0,typeof t=="function"){it++;var n=ue;ue=void 0;try{t()}catch(o){throw e.f&=-2,e.f|=8,Zr(e),o}finally{ue=n,yo()}}}function Zr(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ys(e)}function $_(e){if(ue!==this)throw new Error("Out-of-order effect");xs(this),ue=e,this.f&=-2,8&this.f&&Zr(this),yo()}function Yt(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,gs&&gs.push(this)}Yt.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};Yt.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ys(this),bs(this),it++;var e=ue;return ue=this,$_.bind(this,e)};Yt.prototype.N=function(){2&this.f||(this.f|=2,this.u=Sn,Sn=this)};Yt.prototype.d=function(){this.f|=8,1&this.f||Zr(this)};Yt.prototype.dispose=function(){this.d()};function st(e,t){var n=new Yt(e,t);try{n.c()}catch(a){throw n.d(),a}var o=n.d.bind(n);return o[Symbol.dispose]=o,o}var Ps,So,Po,H_=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__;var ks=[];st(function(){Ps=this.N})();function Jt(e,t){Z[e]=t.bind(null,Z[e]||function(){})}function ko(e){if(Po){var t=Po;Po=void 0,t()}Po=e&&e.S()}function Ss(e){var t=this,n=e.data,o=Tn(n);o.value=n;var a=Ae(function(){for(var s=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var d=Cn(function(){var f=o.value.value;return f===0?0:f===!0?"":f||""}),u=Cn(function(){return!Array.isArray(d.value)&&!Wr(d.value)}),h=st(function(){if(this.N=ws,u.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),_=t.__$u.d;return t.__$u.d=function(){h(),_.call(this)},[u,d]},[]),i=a[0],l=a[1];return i.value?l.peek():l.value}Ss.displayName="ReactiveTextNode";Object.defineProperties(Se.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Ss},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}});Jt("__b",function(e,t){if(typeof t.type=="string"){var n,o=t.props;for(var a in o)if(a!=="children"){var i=o[a];i instanceof Se&&(n||(t.__np=n={}),n[a]=i,o[a]=i.peek())}}e(t)});Jt("__r",function(e,t){if(e(t),t.type!==ne){ko();var n,o=t.__c;o&&(o.__$f&=-2,(n=o.__$u)===void 0&&(o.__$u=n=(function(a,i){var l;return st(function(){l=this},{name:i}),l.c=a,l})(function(){var a;H_&&((a=n.y)==null||a.call(n)),o.__$f|=1,o.setState({})},typeof t.type=="function"?t.type.displayName||t.type.name:""))),So=o,ko(n)}});Jt("__e",function(e,t,n,o){ko(),So=void 0,e(t,n,o)});Jt("diffed",function(e,t){ko(),So=void 0;var n;if(typeof t.type=="string"&&(n=t.__e)){var o=t.__np,a=t.props;if(o){var i=n.U;if(i)for(var l in i){var s=i[l];s!==void 0&&!(l in o)&&(s.d(),i[l]=void 0)}else i={},n.U=i;for(var c in o){var d=i[c],u=o[c];d===void 0?(d=F_(n,c,u,a),i[c]=d):d.o(u,a)}}}e(t)});function F_(e,t,n,o){var a=t in e&&e.ownerSVGElement===void 0,i=z(n);return{o:function(l,s){i.value=l,o=s},d:st(function(){this.N=ws;var l=i.value.value;o[t]!==l&&(o[t]=l,a?e[t]=l:l!=null&&(l!==!1||t[4]==="-")?e.setAttribute(t,l):e.removeAttribute(t))})}}Jt("unmount",function(e,t){if(typeof t.type=="string"){var n=t.__e;if(n){var o=n.U;if(o){n.U=void 0;for(var a in o){var i=o[a];i&&i.d()}}}var l=t.__np;if(l){var s=t.props;for(var c in l)s[c]=l[c]}t.__np=void 0}else{var d=t.__c;if(d){var u=d.__$u;u&&(d.__$u=void 0,u.d())}}e(t)});Jt("__h",function(e,t,n,o){(o<3||o===9)&&(t.__$f|=2),e(t,n,o)});ht.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,o=n&&n.s!==void 0;for(var a in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(o||i||4&this.__$f)||1&this.__$f)return!0}else if(!(o||4&this.__$f)||3&this.__$f)return!0;for(var l in e)if(l!=="__source"&&e[l]!==this.props[l])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function Tn(e,t){return Ae(function(){return z(e,t)},[])}function X(e,t){var n=D(e);return n.current=e,So.__$f|=4,Ae(function(){return Cn(function(){return n.current()},t)},[])}var B_=function(e){queueMicrotask(function(){queueMicrotask(e)})};function z_(){Xt(function(){for(var e;e=ks.shift();)Ps.call(e)})}function ws(){ks.push(this)===1&&(Z.requestAnimationFrame||B_)(z_)}function Cs(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Ts(e){return Cs(e)}function Es(e){return!(!Cs(e)||e.navigation!==void 0&&!Array.isArray(e.navigation)||e.linkCards!==void 0&&!Array.isArray(e.linkCards))}function wo(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 U_=900;function ea(e,t,n){if(e==="standalone"||e==="page")return"fullscreen";let o=t.initialSize;if(o==="expanded"||o==="fullscreen"||o==="normal")return o;if(o==="auto"){let a=t.autoSizeBreakpoint??U_;return n>=a?"expanded":"normal"}return"normal"}function En(e,t,n,o=null){let i=e.mode==="inline"||e.mode==="standalone"||e.mode==="page"||(n??!e.startMinimized),s=e.mode!=="standalone"&&e.mode!=="page"&&e.mode!=="inline"&&o?o:ea(e.mode,e.size,t);return{panelOpen:i,panelSize:s}}function Qt(){return typeof window>"u"?0:window.innerWidth}var W_="x-public-key",V_="x-ai-agent-deployment-id";function Rs(e){return{headers(){let t={};return e.aiAgentDeploymentId&&(t[V_]=e.aiAgentDeploymentId),e.publicKey&&(t[e.publicKeyHeader??W_]=e.publicKey),t}}}var qe=class extends Error{constructor(n,o,a,i){super(n);j(this,"code",o);j(this,"status",a);j(this,"cause",i);this.name="StreamError"}};var Is=W.scope("parser");async function*ta(e,t){if(!e.ok){let a=await e.text().catch(()=>"");throw new qe(`server responded ${e.status}: ${a.slice(0,200)}`,"server",e.status)}if(!e.body)throw new qe("response has no body","no-body");let n=e.body.pipeThrough(new TextDecoderStream).getReader(),o="";try{for(;;){if(t.aborted)throw new DOMException("aborted","AbortError");let{done:a,value:i}=await n.read();if(a){let s=o.trim();if(s){let c=As(s);c&&(yield c)}return}o+=i;let l;for(;(l=o.indexOf(`
8
8
 
9
- `))!==-1;){let s=o.slice(0,l);o=o.slice(l+2);let c=ks(s);c&&(yield c)}}}finally{n.releaseLock()}}function ks(e){let t="",n;for(let o of e.split(`
9
+ `))!==-1;){let s=o.slice(0,l);o=o.slice(l+2);let c=As(s);c&&(yield c)}}}finally{n.releaseLock()}}function As(e){let t="",n;for(let o of e.split(`
10
10
  `))if(!(o===""||o.startsWith(":"))){if(o.startsWith("data:")){let a=o.slice(5).replace(/^ /,"");t=t?`${t}
11
- ${a}`:a;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(!t||t==="[DONE]")return null;try{let o=JSON.parse(t);return Ss.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){return Ss.trace("frame parse failed",{err:o,payload:t.slice(0,200)}),null}}function F_(e){let t=new TextEncoder().encode(e),n="";for(let o of t)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var ws=e=>e&&Object.keys(e).length>0?e:void 0;function Cs(e,t){let n=ws(e),o=ws(t);if(!n&&!o)return;let a={};return n&&(a.user=n),o&&(a.page=o),F_(JSON.stringify(a))}function vo(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function z_(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function Es(e){return e.startsWith("tool-")?e.slice(5):e}var qe={handshake:"/pai/handshake",streamMessage:"/pai/stream-message",streamResume:"/pai/stream-resume",cancelStream:"/pai/cancel-stream",listConversations:"/pai/list-conversations",listMessages:"/pai/list-messages",updateSettings:"/pai/update-settings",markRead:"/pai/mark-read",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},Ts="context";function Rs(e){let t=e.messages.map(i=>({id:i.serverMessageId??i.id,parts:q_(i),role:i.role,createdAt:i.createdAt!==void 0?new Date(i.createdAt).toISOString():void 0})),n={messages:t,conversationId:e.conversationId,trigger:e.trigger??"submit-message"},o=t.at(-1)?.id;o&&(n.messageId=o),e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs);let a=e.tools?.map(W_).filter(i=>i!==null);return a?.length&&(n.data={tools:a}),n}function U_(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function W_(e){return typeof e=="string"?e?{code:e}:null:e?.code?e:null}function q_(e){let t=[];for(let n of e.parts)if(n.kind==="step-start"&&t.push({type:"step-start"}),n.kind==="reasoning"&&n.text&&t.push({type:"reasoning",text:n.text,state:n.done?"done":"streaming"}),n.kind==="text"&&n.text&&t.push({text:n.text,type:"text"}),n.kind==="file"&&n.url&&t.push({mediaType:n.mediaType,type:"file",url:n.url}),n.kind==="tool"&&U_(n)){let o={type:z_(n.toolName),toolCallId:n.toolCallId,state:n.state};n.input!==void 0&&(o.input=n.input),n.output!==void 0&&(o.output=n.output),n.error!==void 0&&(o.errorText=n.error),n.approval&&n.approval.approved!==void 0&&(o.approval=n.approval),t.push(o)}for(let n of e.attachments??[])n.url&&t.push({type:"file",url:n.url,mediaType:n.mediaType,filename:n.name,fileId:n.id,fileSize:n.size});return t}var ee=F.scope("transport"),As=3,Ns=400,G_=6e4,Is=1e4,Ls=3,V_=new Set([408,425,429,500,502,503,504]);function Ms(e){return Ns*2**e+Math.floor(Math.random()*250)}function K_(e){let t=e.get("retry-after");if(!t)return null;let n=Number(t),o=Number.isFinite(n)?n*1e3:Date.parse(t)-Date.now();return Number.isFinite(o)&&o>=0?Math.min(o,3e4):null}function Yr(e,t){return new Promise(n=>{if(t?.aborted)return n();let o=setTimeout(i,e),a=()=>i();t?.addEventListener("abort",a,{once:!0});function i(){clearTimeout(o),t?.removeEventListener("abort",a),n()}})}var bo=class{constructor(t){q(this,"opts",t);q(this,"visitorId");q(this,"conversationId");q(this,"resumeStatus");q(this,"userContext");q(this,"pageContext");q(this,"locale");q(this,"conversationsCache",new Map);q(this,"contentCache",new Map)}setContext(t,n){this.userContext=t,this.pageContext=n}setLocale(t){this.locale=t}primeIdentity(t,n){t&&(this.visitorId=t),n&&(this.conversationId=n)}envelope(){let t={_ev:Ot};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=Cs(this.userContext,this.pageContext);return n&&(t[Ts]=n),t}withEnvelope(t){return{...this.envelope(),...t}}appendEnvelope(t){for(let[n,o]of Object.entries(this.envelope()))t.append(n,o);return t}withEnvelopeQuery(t){let n=new URL(this.url(t));for(let[o,a]of Object.entries(this.envelope()))n.searchParams.has(o)||n.searchParams.set(o,a);return n.toString()}async handshake(t){ee.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson(qe.handshake,t,"handshake");return ee.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),X_(n)||ee.warn("handshake response did not match expected shape; using raw response",{response:n}),this.visitorId=n.visitorId??t.visitorId,this.conversationId=n.conversationId,n}async uploadFile(t){ee.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let n=new FormData;n.append("file",t,t.name);let o=await this.postForm(this.uploadPath,n,"upload");return ee.debug("uploadFile \u2190",{id:o.id,url:o.url}),o}async transcribe(t,n="audio/webm"){ee.debug("transcribe \u2192",{size:t.size,mimeType:n});let o=new FormData;o.append("audio",t,`voice.${j_(n)}`),o.append("mimeType",n);let a=await this.postForm(this.transcribePath,o,"transcribe");return ee.debug("transcribe \u2190",{textLen:a.text.length}),a}conversationsKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){let n=this.conversationsCache.get(this.conversationsKey(t));if(n?.value&&Date.now()-n.at<Is)return n.value}listConversations(t={}){let n=this.conversationsKey(t),o=this.conversationsCache.get(n);if(o&&Date.now()-o.at<Is)return ee.debug("listConversations \u2192 cache",t),o.result;let a={at:Date.now(),result:this.fetchConversations(t).then(i=>(a.value=i,i)).catch(i=>{throw this.conversationsCache.delete(n),i})};return this.conversationsCache.set(n,a),a.result}async fetchConversations(t){let n=new URL(this.url(qe.listConversations));t.visitorId&&n.searchParams.set("visitorId",t.visitorId),t.limit&&n.searchParams.set("limit",String(t.limit)),t.cursor&&n.searchParams.set("cursor",t.cursor),ee.debug("listConversations \u2192",{visitorId:t.visitorId??this.visitorId,limit:t.limit,cursor:t.cursor});let o=await this.getJson(n.toString(),"listConversations"),a=o.conversations??[];return ee.debug("listConversations \u2190",{count:a.length,nextCursor:o.nextCursor}),{conversations:a.map(i=>({conversationId:i.conversationId,title:i.title,lastMessageAt:i.lastMessageAt,preview:i.preview,canContinue:i.canContinue,unreadCount:i.unreadCount})),nextCursor:o.nextCursor}}async loadConversation(t){let n=new URL(this.url(qe.listMessages));n.searchParams.set("conversationId",t),ee.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId});let o=await this.getJson(n.toString(),"loadConversation"),a=o.messages??[];return ee.debug("loadConversation \u2190",{conversationId:o.conversationId,canContinue:o.canContinue,messageCount:a.length,hasSuggestions:!!o.suggestions}),{conversationId:o.conversationId,canContinue:o.canContinue??!0,messages:a,agent:o.agent,suggestions:o.suggestions}}async markRead(t){if(!(!this.visitorId||!t)){this.conversationsCache.clear(),ee.debug("markRead \u2192",{conversationId:t,visitorId:this.visitorId});try{await this.postJson(qe.markRead,{conversationId:t},"markRead")}catch(n){ee.debug("markRead failed (non-fatal)",{err:n})}}}listContent(t={}){let n=`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`,o=this.contentCache.get(n);if(o&&Date.now()-o.at<G_)return ee.debug("listContent \u2192 cache",t),o.result;let a=this.fetchContent(t).catch(i=>{throw this.contentCache.delete(n),i});return this.contentCache.set(n,{at:Date.now(),result:a}),a}async fetchContent(t){let n=new URL(this.dataUrl(qe.content));for(let[i,l]of Object.entries(t))l!==void 0&&n.searchParams.set(i,Array.isArray(l)?l.join(","):String(l));ee.debug("listContent \u2192",t);let o=await this.getJson(n.toString(),"listContent"),a=(o.items??[]).map(i=>ei(i,this.locale));return ee.debug("listContent \u2190",{count:a.length,total:o.pagination?.total}),{...o,items:a}}async bootstrap(t){let n=new URL(this.dataUrl(qe.bootstrap));t&&n.searchParams.set("conversationId",t),ee.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let o=await this.getJson(n.toString(),"bootstrap"),a=o.forms??[],i=o.formSubmissions??[];return ee.debug("bootstrap \u2190",{forms:a.length,formSubmissions:i.length}),{forms:a,formSubmissions:i}}async saveUserPrefs(t){ee.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson(qe.updateSettings,{userPrefs:t},"saveUserPrefs");return ee.debug("saveUserPrefs \u2190",{ok:n.ok}),n}get uploadPath(){return this.opts.endpoints?.upload??"/pai/upload-file"}get transcribePath(){return this.opts.endpoints?.transcribe??"/pai/transcribe-audio"}get submitFormPath(){return this.opts.endpoints?.submitForm??qe.submitForm}async submitForm(t){ee.debug("submitForm \u2192",{formId:t.formId,trigger:t.trigger,fields:Object.keys(t.values).length});try{await this.postJson(this.dataUrl(this.submitFormPath),t,"submitForm")}catch(n){ee.debug("submitForm failed (non-fatal)",{err:n})}}sendMessage(t){this.conversationsCache.clear(),ee.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageId:t.messageId,messageCount:t.messages.length,trigger:t.trigger,tools:t.data?.tools?.map(l=>l.code)});let n=new AbortController,o=new Set;return{iter:this.runStream(t,n,o),cancel:()=>this.cancelStream(n,t.conversationId),detach:()=>n.abort()}}resumeStream(){let t=new AbortController,n=new Set;this.resumeStatus=void 0;let o=this.resumeStreamGen(t,n,!0),a=()=>t.abort();return{iter:o,cancel:a,detach:a}}async*runStream(t,n,o){(yield*this.drain(this.openMessageStream(t,n.signal),o,n))||(yield*this.resumeStreamGen(n,o,!1))}async*resumeStreamGen(t,n,o){for(let a=1;a<=As&&!t.signal.aborted;a++){if((!o||a>1)&&(await Yr(Ns*a,t.signal),t.signal.aborted))return;let i;try{i=await this.fetchImpl(this.resumeUrl(n.size),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(c){if(t.signal.aborted)return;ee.debug("resume fetch failed \u2014 retrying",{attempt:a,err:c});continue}if(i.status===204||!i.ok){ee.debug("resume \u2192 no in-flight stream",{status:i.status});return}if(!(i.headers.get("content-type")??"").includes("text/event-stream")){let c=await i.json().then(d=>d.status).catch(()=>{});if(ee.debug("resume \u2192 no live stream (status response)",{status:c,attempt:a}),c==="pending"&&a<As)continue;this.resumeStatus=c==="needs-generation"?"needs-generation":"completed";return}this.resumeStatus="live";let s=n.size;if(yield*this.drain(Xr(i,t.signal),n,t))return;if(n.size===s){ee.debug("resume \u2192 stream closed with no new events; nothing to resume");return}}if(!t.signal.aborted)throw new We("stream incomplete after resume attempts","server")}async*drain(t,n,o){try{for await(let a of t){if(o.signal.aborted)return!0;if(a.eventId){if(n.has(a.eventId))continue;n.add(a.eventId)}if(yield a,a.chunk.type==="finish"||a.chunk.type==="error")return!0}}catch(a){if(o.signal.aborted)return!0;if(a instanceof We&&a.status!==void 0)throw a;ee.debug("stream segment dropped",{err:a})}return!1}cancelStream(t,n){t.signal.aborted||(ee.debug("cancel stream",{conversationId:n,visitorId:this.visitorId}),t.abort(),!(!this.visitorId||!n)&&this.fetchImpl(this.url(qe.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({})),keepalive:!0}).catch(o=>ee.debug("cancel POST failed (non-fatal)",{err:o})))}async*openMessageStream(t,n){let o=await this.fetchImpl(this.url(qe.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"text/event-stream","content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(t)),signal:n});yield*Xr(o,n)}resumeUrl(t){let n=new URL(this.withEnvelopeQuery(qe.streamResume));return n.searchParams.set("resumeAt",String(t)),n.toString()}async postJson(t,n,o){let a=await this.fetchWithRetry(()=>[this.url(t),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(n))}],o);return this.assertOk(a,o)}async postForm(t,n,o){let a=await this.fetchImpl(this.url(t),{method:"POST",credentials:"omit",headers:this.opts.auth.headers(),body:this.appendEnvelope(n)});return this.assertOk(a,o)}async getJson(t,n){let o=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.opts.auth.headers()}}],n);return this.assertOk(o,n)}async fetchWithRetry(t,n){for(let o=0;;o++){let[a,i]=t(),l;try{l=await this.fetchImpl(a,i)}catch(c){if(o>=Ls)throw new We(`${n} failed: network error`,"network",void 0,c);ee.debug("request network error \u2014 retrying",{label:n,attempt:o}),await Yr(Ms(o));continue}if(l.ok||!V_.has(l.status)||o>=Ls)return l;let s=K_(l.headers)??Ms(o);ee.debug("request retryable status \u2014 retrying",{label:n,status:l.status,attempt:o,wait:s}),await Yr(s)}}async assertOk(t,n){if(!t.ok)throw new We(`${n} failed: ${t.status}`,"server",t.status);return await t.json()}url(t){return/^https?:\/\//i.test(t)?t:`${this.opts.agentApiBaseUrl}${t}`}dataUrl(t){return/^https?:\/\//i.test(t)?t:`${this.opts.dataApiBaseUrl}${t}`}get fetchImpl(){return this.opts.fetchImpl??globalThis.fetch.bind(globalThis)}};function j_(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 X_(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.conversationId=="string"}function Ds(e,t){let n=e?[{kind:"text",id:"t0",textSig:H(e),doneSig:H(!0)}]:[];return{id:Ue(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:H(n)}}function hn(){return{id:Ue(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:H([])}}function Os(e){let t=Ue();return Y_({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function Y_(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,canceled:e.canceled,errorText:e.errorText,finishReason:e.finishReason,serverMessageId:e.serverMessageId,ephemeral:e.ephemeral,attachments:e.attachments,partsSig:H(e.parts.map(tu))}}function J_(e){let t=e.parts.map((n,o)=>n.type==="text"?{kind:"text",id:`${e.id}-t${o}`,textSig:H(n.text),doneSig:H(!0)}:n.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${o}`,textSig:H(n.text),doneSig:H(n.state!=="streaming")}:n.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${o}`}:n.type==="file"?{kind:"file",url:n.url,mediaType:n.mediaType}:n.type==="source-url"?{kind:"source",sourceId:n.sourceId,url:n.url,title:n.title}:n.type==="source-document"?{kind:"source",sourceId:n.sourceId,title:n.title,filename:n.filename,mediaType:n.mediaType}:n.type.startsWith("tool-")?{kind:"tool",toolCallId:n.toolCallId,toolName:Es(n.type),inputPartialSig:H(""),inputSig:H(n.input),outputSig:H(n.output),errorSig:H(n.errorText),stateSig:H(n.state),approvalSig:H(n.approval)}:null).filter(n=>n!==null);return{id:e.id,role:e.role,serverMessageId:e.id,createdAt:vo(e.createdAt)??Date.now(),status:e.status==="failed"?"error":"complete",canceled:e.status==="canceled",partsSig:H(t)}}var Q_=new Set(["completed","failed","canceled"]);function Z_(e){return!e.parts.some(t=>t.type==="text"&&t.text.trim()!==""||t.type.startsWith("tool-")||t.type==="file"||t.type==="source-url"||t.type==="source-document")}function eu(e){return e.role==="assistant"&&e.status!=null&&!Q_.has(e.status)&&Z_(e)}function Qr(e){return e.filter(t=>!eu(t)).map(J_)}function $s(e){return{id:e.id,role:e.role,createdAt:e.createdAt,status:e.status,canceled:e.canceled,errorText:e.errorText,finishReason:e.finishReason,serverMessageId:e.serverMessageId,ephemeral:e.ephemeral,attachments:e.attachments,parts:e.partsSig.value.map(nu)}}function xo(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function yo(e){return xo(e).trim()!==""?!1:!e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function rt(e){return e.role==="assistant"&&e.status!=="streaming"&&yo(e)}function Hs(e){return e.canceled===!0&&rt(e)}function tu(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:H(e.text),doneSig:H(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartialSig:H(e.inputPartial),inputSig:H(e.input),outputSig:H(e.output),errorSig:H(e.error),stateSig:H(e.state),approvalSig:H(e.approval)}:e}function nu(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,text:e.textSig.value,done:e.doneSig.value}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartial:e.inputPartialSig.value,input:e.inputSig.value,output:e.outputSig.value,error:e.errorSig.value,state:e.stateSig.value,approval:e.approvalSig.value}:e}var Bs=F.scope("reducer"),Po=class{constructor(t){q(this,"messagesSig",t);q(this,"active",null);q(this,"openTextParts",new Map);q(this,"partSeq",0)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.openTextParts.clear()}ensureTextPart(t,n,o){let a=`${n}:${o}`,i=this.openTextParts.get(a);if(i)return i;let l={kind:n,id:`${o}#${this.partSeq++}`,textSig:H(""),doneSig:H(!1)};return this.openTextParts.set(a,l),vn(t,l),l}apply(t){let n=this.active;if(n)switch(t.type){case"start":t.messageId&&(n.serverMessageId=t.messageId);return;case"finish-step":this.openTextParts.clear();return;case"start-step":vn(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":Bs.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":Bs.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=t.errorText,this.bumpDone(n);return;case"text-start":this.ensureTextPart(n,"text",t.id);return;case"text-delta":{let o=this.ensureTextPart(n,"text",t.id);o.textSig.value+=t.delta;return}case"text-end":this.ensureTextPart(n,"text",t.id).doneSig.value=!0;return;case"reasoning-start":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!1;return;case"reasoning-delta":{let o=this.ensureTextPart(n,"reasoning",t.id);o.textSig.value+=t.delta;return}case"reasoning-end":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!0;return;case"tool-input-start":case"tool-input-delta":case"tool-input-available":case"tool-output-available":case"tool-output-error":case"tool-output-denied":case"tool-approval-request":ou(n,t);return;case"file":vn(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":Fs(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":Fs(n,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-notification":return;case"data-conversation-rebind":return;default:{let o=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value=[...this.messagesSig.value]}};function kt(e,t,n){let o=e.partsSig.value.find(i=>i.kind==="tool"&&i.toolCallId===t);if(o)return o;let a={kind:"tool",toolCallId:t,toolName:n??"tool",inputPartialSig:H(""),inputSig:H(void 0),outputSig:H(void 0),errorSig:H(void 0),stateSig:H("input-streaming"),approvalSig:H(void 0)};return vn(e,a),a}function vn(e,t){e.partsSig.value=[...e.partsSig.value,t]}function Fs(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||vn(e,t)}function ou(e,t){switch(t.type){case"tool-input-start":kt(e,t.toolCallId,t.toolName);return;case"tool-input-delta":{let n=kt(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=kt(e,t.toolCallId,t.toolName);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-approval-request":{let n=kt(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=kt(e,t.toolCallId);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=kt(e,t.toolCallId);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=kt(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}var zs=F.scope("feedback:audio"),So=class{constructor(){q(this,"ctx",null);q(this,"master",null);q(this,"buffers",new Map)}unlock(){if(this.ctx){this.ctx.state==="suspended"&&this.ctx.resume();return}let t=globalThis.AudioContext??globalThis.webkitAudioContext;if(t)try{this.ctx=new t,this.master=this.ctx.createGain(),this.master.gain.value=1,this.master.connect(this.ctx.destination)}catch(n){zs.warn("AudioContext init failed",{err:n})}}setVolume(t){if(!this.master||!this.ctx)return;let n=Math.max(0,Math.min(1,t));this.master.gain.setTargetAtTime(n,this.ctx.currentTime,.01)}playTone(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let a=n.currentTime,i=t.noteMs/1e3;t.notes.forEach((l,s)=>{let c=n.createOscillator();c.type=t.type,c.frequency.value=l;let d=n.createGain(),u=a+s*i;d.gain.setValueAtTime(1e-4,u),d.gain.exponentialRampToValueAtTime(t.peakGain,u+.005),d.gain.exponentialRampToValueAtTime(1e-4,u+i),c.connect(d).connect(o),c.start(u),c.stop(u+i+.01)})}async playUrl(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let a=await this.getBuffer(t);if(!a)return;let i=n.createBufferSource();i.buffer=a,i.connect(o),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 o=this.ctx,a=fetch(t).then(i=>i.ok?i.arrayBuffer():Promise.reject(new Error(`fetch ${i.status}`))).then(i=>o.decodeAudioData(i)).then(i=>(this.buffers.set(t,i),i)).catch(i=>(zs.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,a),a}};var Us={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},Ws={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 pt=null,ko=0;function ru(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function au(){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=`__${y.cssPrefix}_haptic_${Math.random().toString(36).slice(2)}`;let t=document.createElement("label");t.htmlFor=e.id,t.setAttribute("aria-hidden","true");let n="position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;opacity:0!important;pointer-events:none!important;";return e.style.cssText=n,t.style.cssText=n,document.body.append(e,t),{input:e,label:t}}function qs(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(ru())try{navigator.vibrate(e);return}catch{}if(pt||(pt=au()),!!pt)try{pt.label.click()}catch{}}}function Gs(){ko++;let e=!1;return()=>{e||(e=!0,ko=Math.max(0,ko-1),ko===0&&pt&&(pt.input.remove(),pt.label.remove(),pt=null))}}var iu=F.scope("feedback"),su=100,wo=class{constructor(t,n){q(this,"mutedSig",H(!1));q(this,"audio",new So);q(this,"releaseHaptics");q(this,"sound");q(this,"haptics");q(this,"lastPlayed",new Map);q(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=Gs(),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<su}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(a=>iu.warn("audio play failed",{err:a,url:n}));return}let o=Ws[t];o&&this.audio.playTone(o)}playHaptic(t){if(this.reducedMotionMq?.matches)return;let n=this.haptics.events?.[t];if(n===!1)return;let o=n===!0||n===void 0?Us[t]:n;qs(o)}effectiveVolume(){let t=this.sound.volume??.3;return this.reducedMotionMq?.matches?t*.5:t}isTouchDevice(){return typeof window>"u"?!1:matchMedia("(hover: none) and (pointer: coarse)").matches}};function wt(e,t){return e instanceof We&&e.status===429?t.errorRateLimited:t.errorGeneric}var lu=0;function r(e,t,n,o,a,i){t||(t={});var l,s,c=t;if("ref"in c)for(s in c={},t)s=="ref"?l=t[s]:c[s]=t[s];var d={type:e,props:c,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--lu,__i:-1,__u:0,__source:a,__self:i};if(typeof e=="function"&&(l=e.defaultProps))for(s in l)c[s]===void 0&&(c[s]=l[s]);return Z.vnode&&Z.vnode(d),d}var $={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},bn=`${y.cssPrefix}-icon-dir`,cu=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})}),Xe=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M18 6 6 18M6 6l12 12"})}),Vs=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M12 5v14M5 12h14"})}),Ks=()=>r("svg",{...$,class:bn,"aria-hidden":"true",children:[r("path",{d:"m22 2-7 20-4-9-9-4Z"}),r("path",{d:"M22 2 11 13"})]}),js=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M12 19V5M5 12l7-7 7 7"})}),Xs=()=>r("svg",{...$,class:bn,"aria-hidden":"true",children:r("path",{d:"M3 20V4l18 8-18 8Z"})}),qt=()=>r("svg",{...$,class:bn,"aria-hidden":"true",children:r("path",{d:"m9 18 6-6-6-6"})}),Ys=()=>r("svg",{...$,"aria-hidden":"true",children:r("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),Js=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"m21 11-9 9a5.5 5.5 0 0 1-7.78-7.78l8.49-8.49a3.67 3.67 0 0 1 5.19 5.19l-8.49 8.49a1.83 1.83 0 0 1-2.6-2.6l7.78-7.78"})}),Qs=()=>r("svg",{...$,"aria-hidden":"true",children:[r("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),r("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]}),Zs=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),el=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),tl=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),nl=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),ol=()=>r("svg",{...$,"aria-hidden":"true",viewBox:"0 0 10 10",children:r("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),rl=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]}),al=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})}),il=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),sl=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),r("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]}),ll=()=>r("svg",{...$,class:bn,"aria-hidden":"true",children:r("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),xn=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M20 6 9 17l-5-5"})}),cl=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M3 3v6h6"}),r("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),r("path",{d:"M12 7v5l3 2"})]}),dl=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("path",{d:"M2 12h20"}),r("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),yn=()=>r("svg",{...$,class:bn,"aria-hidden":"true",children:r("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),_l=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M12 20h9"}),r("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),Co=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"m6 9 6 6 6-6"})}),ul=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),r("path",{d:"M14 2v6h6"})]}),du=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),r("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]}),Zr=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})}),ea=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),r("path",{d:"M12 17h.01"})]}),_u=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"m15 4 3 3-9 9-3-3z"}),r("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]}),uu=()=>r("svg",{...$,"aria-hidden":"true",children:[r("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),r("path",{d:"M12 8V4"}),r("circle",{cx:"12",cy:"3",r:"1"}),r("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]}),pu=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),r("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),r("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),r("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]}),mu=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("circle",{cx:"12",cy:"12",r:"4"}),r("path",{d:"m4.93 4.93 4.24 4.24M14.83 14.83l4.24 4.24M14.83 9.17l4.24-4.24M4.93 19.07l4.24-4.24"})]}),ta=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"11",cy:"11",r:"7"}),r("path",{d:"m21 21-4.3-4.3"})]}),pl=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),ml=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M3 9.5 12 3l9 6.5"}),r("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]}),fl=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"m3 11 15-5v12L3 13z"}),r("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),r("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),r("path",{d:"M21 10a3 3 0 0 1 0 4"})]}),Pn=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),r("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}),gl=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"4"}),r("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}),hl=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),vl=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 3v18"}),r("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]}),fu=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),r("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),r("path",{d:"m20 20-4.4-4.4"})]}),gu=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M12 3.5 13.6 9 19 10.5 13.6 12 12 17.5 10.4 12 5 10.5 10.4 9z"}),r("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]}),hu=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M4 18h16"}),r("path",{d:"M5 18a7 7 0 0 1 14 0"}),r("path",{d:"M12 8V6"}),r("path",{d:"M10 6h4"})]}),vu=()=>r("svg",{...$,"aria-hidden":"true",children:[r("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),r("path",{d:"M16 9.5a1.5 1.5 0 0 1 3 0v2.5a7 7 0 0 1-7 7 7 7 0 0 1-6.4-4.2L4 12.5a1.5 1.5 0 0 1 2.6-1.5L7 11"})]}),bl=()=>r("svg",{...$,"aria-hidden":"true",children:r("path",{d:"M14.7 6.3a4 4 0 0 0-5.4 5.3L3 18l3 3 6.4-6.3a4 4 0 0 0 5.3-5.4l-2.7 2.7-2.6-.7-.7-2.6z"})}),xl=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 7v5l3 2"})]}),yl=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Pl=()=>r("svg",{...$,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m15 9-6 6M9 9l6 6"})]}),Sl={chat:cu,message:Zr,bubbles:Pn,spark:du,wand:_u,bot:uu,help:ea,lifebuoy:mu,headset:pu,search:fu,sparkles:gu,concierge:hu,wave:vu};var M=y.cssPrefix,w={launcher:`${M}-launcher`,callout:`${M}-callout`,calloutDismiss:`${M}-callout-dismiss`,panel:`${M}-panel`,panelHeader:`${M}-panel-header`,resizeGrip:`${M}-resize-grip`,scrollToBottom:`${M}-scroll-to-bottom`,actionHistory:`${M}-action-history`,actionClose:`${M}-action-close`,langSegment:`${M}-lang-segment`,composer:`${M}-composer`,composerInput:`${M}-composer-input`,composerSend:`${M}-composer-send`,composerStop:`${M}-composer-stop`,composerAttach:`${M}-composer-attach`,composerFileInput:`${M}-composer-file-input`,composerVoice:`${M}-composer-voice`,attachmentChip:`${M}-attachment-chip`,attachmentRemove:`${M}-attachment-remove`,suggestion:`${M}-suggestion`,messageBubble:`${M}-message`,messageRetry:`${M}-message-retry`,historyPane:`${M}-history-pane`,historyBack:`${M}-history-back`,historyItem:`${M}-history-item`,sidebar:`${M}-sidebar`,sidebarToggle:`${M}-sidebar-toggle`,sidebarNewConversation:`${M}-sidebar-new-conversation`,sidebarItem:`${M}-sidebar-item`,messengerHome:`${M}-messenger-home`,modulesEmpty:`${M}-modules-empty`,tab:`${M}-tab`,tabBadge:`${M}-tab-badge`,homeView:`${M}-home-view`,homeGreeting:`${M}-home-greeting`,homeBrand:`${M}-home-brand`,backHeader:`${M}-back-header`,contentView:`${M}-content-view`,contentScroll:`${M}-content-scroll`,homeSearch:`${M}-home-search`,helpSearch:`${M}-help-search`,homeRecent:`${M}-home-recent`,homeContentRow:`${M}-home-content-row`,helpArticle:`${M}-help-article`,newsItem:`${M}-news-item`,formGate:`${M}-form-gate`,formDone:`${M}-form-done`,formDoneToggle:`${M}-form-done-toggle`,formAnswers:`${M}-form-answers`,formFill:`${M}-form-fill`,formSubmit:`${M}-form-submit`,formSkip:`${M}-form-skip`,formField:`${M}-form-field`,toolAskQuestions:`${M}-tool-ask-questions`,toolInputSubmit:`${M}-tool-input-submit`,toolInputSkip:`${M}-tool-input-skip`,toolApproval:`${M}-tool-approval`,toolApprove:`${M}-tool-approve`,toolReject:`${M}-tool-reject`,toolEdit:`${M}-tool-edit`,toolDecision:`${M}-tool-decision`,toolCall:`${M}-tool-call`,source:`${M}-source`};function be(e,t){return`${e}-${t}`}var Eo=y.cssPrefix;function kl({onToggle:e,launcher:t,strings:n,leaving:o,edgeTab:a}){let i=t.variant!=="circle"&&!!t.label;return r("button",{type:"button",class:`${Eo}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":a?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":w.launcher,onClick:e,"aria-label":n.launcherOpen,children:[bu(t.icon),i?r("span",{class:`${Eo}-fab-label`,children:Te(n,t.label??"")}):null]})}function bu(e){let t=Sl[e];return t?r(t,{}):r(xu,{source:e})}function xu({source:e}){return r("span",{ref:t=>{t&&yu(t,e)},"aria-hidden":"true"})}function yu(e,t){if(e.dataset.svgMounted!==t)try{let o=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;o&&o.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(o,!0)),e.dataset.svgMounted=t)}catch{}}function wl({callout:e,launcherPosition:t,strings:n,closeLabel:o,onDismiss:a}){let[i,l]=A(!1);return T(()=>{let s=setTimeout(()=>l(!0),e.delayMs);return()=>clearTimeout(s)},[e.delayMs]),T(()=>{if(!i||e.autoDismissMs<=0)return;let s=setTimeout(a,e.autoDismissMs);return()=>clearTimeout(s)},[i,e.autoDismissMs,a]),i?r("div",{class:`${Eo}-callout`,role:"status","data-shape":e.shape,"data-position":Pu(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":w.callout,children:[r("span",{children:Te(n,e.text)}),r("button",{type:"button",class:`${Eo}-callout-close`,onClick:a,"aria-label":o,title:o,"data-testid":w.calloutDismiss,children:r(Xe,{})})]}):null}function Pu(e,t){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"?o?"top":"bottom":n?"left":"right"}function To({panelEl:e,resize:t,position:n,initialSize:o,onSizeChange:a,strings:i}){let l=y.cssPrefix,s=D(null);if(T(()=>{if(!e)return;let m=e.style;t.minWidth&&m.setProperty(`--${l}-resize-min-w`,t.minWidth),t.maxWidth&&m.setProperty(`--${l}-resize-max-w`,t.maxWidth),t.minHeight&&m.setProperty(`--${l}-resize-min-h`,t.minHeight),t.maxHeight&&m.setProperty(`--${l}-resize-max-h`,t.maxHeight),o&&(m.setProperty(`--${l}-widget-w`,`${o.width}px`),m.setProperty(`--${l}-widget-h`,`${o.height}px`))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,l,o]),!e)return null;let c=n.startsWith("top-"),d=n.endsWith("-right"),u=`${l}-resize-grip ${l}-resize-grip--${c?"bottom":"top"}-${d?"left":"right"}`,_=m=>{if(!e)return;let P=m.currentTarget,v=e.getBoundingClientRect();s.current={pointerId:m.pointerId,startX:m.clientX,startY:m.clientY,startW:v.width,startH:v.height,dirX:d?-1:1,dirY:c?1:-1},P.setPointerCapture(m.pointerId),e.setAttribute("data-resizing",""),m.preventDefault()},g=m=>{let P=s.current;if(!P||m.pointerId!==P.pointerId||!e)return;let v=(m.clientX-P.startX)*P.dirX,b=(m.clientY-P.startY)*P.dirY;e.style.setProperty(`--${l}-widget-w`,`${P.startW+v}px`),e.style.setProperty(`--${l}-widget-h`,`${P.startH+b}px`)},f=m=>{let P=s.current;if(!P||m.pointerId!==P.pointerId||!e)return;m.currentTarget.releasePointerCapture(m.pointerId),e.removeAttribute("data-resizing");let v=e.getBoundingClientRect();a({width:Math.round(v.width),height:Math.round(v.height)}),s.current=null};return r("div",{class:u,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,title:i.resizeHandle,onPointerDown:_,onPointerMove:g,onPointerUp:f,onPointerCancel:f,"data-testid":w.resizeGrip,children:r(ol,{})})}var Ct=y.cssPrefix,Su=`.${Ct}-header, .${Ct}-back-header, .${Ct}-home-hero`,ku='button, a, input, textarea, select, [role="tab"], [contenteditable]',Cl=56;function Ro(e,t){T(()=>{if(!t||!e)return;let n=c=>Number.parseFloat(c)||0,o=(c,d)=>Math.min(d,Math.max(-d,c)),a=null,i=c=>{let d=c.target;if(!(d instanceof Element)||!d.closest(Su)||d.closest(ku))return;let u=e.getBoundingClientRect();a={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${Ct}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${Ct}-modal-dy`)),maxX:(window.innerWidth+u.width)/2-Cl,maxY:(window.innerHeight+u.height)/2-Cl},e.dataset.dragging="true",c.preventDefault()},l=c=>{if(!a||c.pointerId!==a.id)return;let d=o(a.dx+c.clientX-a.x,a.maxX),u=o(a.dy+c.clientY-a.y,a.maxY);e.style.setProperty(`--${Ct}-modal-dx`,`${d}px`),e.style.setProperty(`--${Ct}-modal-dy`,`${u}px`)},s=c=>{!a||c.pointerId!==a.id||(a=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",i),window.addEventListener("pointermove",l),window.addEventListener("pointerup",s),window.addEventListener("pointercancel",s),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s)}},[e,t])}function Sn(e,t,n){switch(e){case"clear":case"sound":case"history":case"language":case"theme":case"textSize":return!0;case"expand":return t==="floating";case"fullscreen":return t!=="standalone";case"close":return t==="standalone"||t==="page"?!1:t==="inline"?n==="fullscreen":!0}}function Ao(e,t,n){return Sn("close",e,t)?n.includes("close"):!1}function El(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var wu='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Io(e){let t=n=>{if(n.key!=="Tab")return;let o=[...e.querySelectorAll(wu)].filter(s=>s.offsetParent!==null||s===document.activeElement);if(o.length===0){n.preventDefault();return}let a=o[0],i=o[o.length-1];if(!a||!i)return;let l=e.getRootNode().activeElement;n.shiftKey&&l===a?(n.preventDefault(),i.focus()):!n.shiftKey&&l===i&&(n.preventDefault(),a.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}function Lo(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var na=y.cssPrefix;function Tl({agent:e,strings:t}){let n=e.status??"online",o=Te(t,e.name),a=e.title?Te(t,e.title):null;return r("div",{class:`${na}-agent`,children:[r("div",{class:`${na}-agent-avatar`,"data-status":n,children:e.avatar?r("img",{src:e.avatar,alt:""}):r("span",{children:Lo(o)})}),r("div",{class:`${na}-agent-meta`,children:[r("strong",{children:o}),a?r("span",{children:a}):null]})]})}var Rl=F.scope("attachments");function Mo(e,t,n){let o=Eu(e),a=[],i=[],l=Au(n.accept),s=t.reduce((d,u)=>d+u.size,0),c=t.length;for(let d of o){let u=Cu(d,c,s,n,l);if(u){i.push({file:d,reason:u});continue}a.push(Ru(d)),s+=d.size,c+=1}return(a.length||i.length)&&Rl.debug("ingest",{accepted:a.length,rejected:i.map(d=>({name:d.file.name,reason:d.reason}))}),{accepted:a,rejected:i}}function oa(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){Rl.debug("revokeObjectURL failed",{error:t})}}function Cu(e,t,n,o,a){return t>=o.maxCount?"count":n+e.size>o.maxBytes?"bytes":Iu(e,a)?null:"mime"}function Eu(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:Tu(t)).filter(t=>t!==null):[]}function Tu(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function Ru(e){return{file:e,id:Ue(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function Au(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean).map(t=>{if(t.startsWith("."))return{kind:"ext",ext:t};let[n="*",o="*"]=t.split("/");return{kind:"mime",type:n,subtype:o}})}function Iu(e,t){if(t.length===0)return!0;let[n="*",o="*"]=(e.type||"").toLowerCase().split("/"),a=(e.name||"").toLowerCase();return t.some(i=>i.kind==="ext"?a.endsWith(i.ext):(i.type==="*"||i.type===n)&&(i.subtype==="*"||i.subtype===o))}var kn=y.cssPrefix;function Al({attachment:e,onRemove:t}){let n=e.mediaType.startsWith("image/");return r("span",{class:`${kn}-attachment-chip`,title:e.name,"data-testid":be(w.attachmentChip,e.id),children:[n?r("img",{class:`${kn}-attachment-thumb`,src:e.previewUrl,alt:""}):r("span",{class:`${kn}-attachment-thumb`,"aria-hidden":"true",children:r(ul,{})}),r("span",{class:`${kn}-attachment-name`,children:e.name}),r("button",{type:"button",class:`${kn}-attachment-remove`,onClick:t,"aria-label":`Remove ${e.name}`,"data-testid":be(w.attachmentRemove,e.id),children:r(Xe,{})})]})}var ra={isSupported:!1,start:()=>{},stop:()=>{}};function aa(e,t,n){return e==="disabled"?ra:e==="server"?Du(n):Lu(t)}function Lu(e){let t=Mu();if(!t)return ra;let n=null;return{isSupported:!0,start(o,a){n=new t,n.continuous=!0,n.interimResults=!0,n.lang=e,n.addEventListener("result",l=>{let s=l,c="",d=!1;for(let u=s.resultIndex;u<s.results.length;u++){let _=s.results[u];_&&(c+=_[0].transcript,_.isFinal&&(d=!0))}o(c,d)});let i=()=>{n=null,a()};n.addEventListener("end",i),n.addEventListener("error",i),n.start()},stop(){n?.stop()}}}function Mu(){let e=globalThis;return e.SpeechRecognition??e.webkitSpeechRecognition}var Nu=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function Du(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return ra;let t=null,n=null,o=[],a=()=>{for(let i of n?.getTracks()??[])i.stop();n=null};return{isSupported:!0,async start(i,l){try{n=await navigator.mediaDevices.getUserMedia({audio:!0});let s=Ou();t=new MediaRecorder(n,s?{mimeType:s}:void 0),o=[],t.addEventListener("dataavailable",c=>{c.data.size>0&&o.push(c.data)}),t.addEventListener("stop",async()=>{let c=t?.mimeType??"audio/webm";a();let d=new Blob(o,{type:c});o=[];try{let{text:u}=await e(d,c);u&&i(u,!0)}catch{}finally{l()}}),t.start()}catch{a(),l()}},stop(){t?.stop()}}}function Ou(){for(let e of Nu)if(MediaRecorder.isTypeSupported(e))return e}var He=y.cssPrefix,Et=F.scope("composer");function Gt(e){return e.reduce((t,n)=>t+n.size,0)}var $u={arrowUp:js,paperPlane:Ks,send:Xs,chevron:qt};function Il({options:e,transport:t,feedback:n,bus:o,isStreaming:a,onSend:i,onStop:l,attachApiRef:s}){let c=e.strings,[d,u]=A(""),[_,g]=A([]),[f,m]=A(!1),P=D(null),v=D(null),b=e.features.files,S=e.features.voice,[x,R]=A(()=>aa(S,e.locale,(C,Y)=>t.transcribe(C,Y)));T(()=>{f||S==="disabled"||R(aa(S,e.locale,(C,Y)=>t.transcribe(C,Y)))},[e.locale,S,t,f]),T(()=>{let C=P.current;if(!C)return;let Y=C.getRootNode(),re="activeElement"in Y?Y.activeElement:null;re&&C.closest(`.${He}-panel`)?.contains(re)||C.focus({preventScroll:!0})},[]),T(()=>{let C=P.current;if(C){if(d.length===0){C.style.height="";return}C.style.height="auto",C.style.height=`${Math.min(C.scrollHeight,160)}px`}},[d]);let z=D(_);z.current=_,T(()=>()=>z.current.forEach(oa),[]),T(()=>{if(s)return s.current={attachFromDrop:C=>{let Y=Mo(C,z.current,e.attachments);Y.accepted.length!==0&&(Et.info("attach (drop)",{count:Y.accepted.length,totalBytes:Gt(Y.accepted)}),o.emit("attach",{count:Y.accepted.length,totalBytes:Gt(Y.accepted)}),g(re=>[...re,...Y.accepted]))}},()=>{s.current&&(s.current=null)}},[s,e.attachments]),T(()=>{let C=P.current;if(!C)return;let Y=C.closest(`.${He}-panel`);if(!Y)return;let re=ce=>{let _e=ce.clipboardData;if(!_e)return;if(b){let ae=Mo(_e.items,z.current,e.attachments);if(ae.accepted.length>0){ce.preventDefault(),Et.info("attach (paste)",{count:ae.accepted.length,totalBytes:Gt(ae.accepted)}),o.emit("attach",{count:ae.accepted.length,totalBytes:Gt(ae.accepted)}),g(xe=>[...xe,...ae.accepted]);return}}if(ce.target===C)return;let Ie=_e.getData("text/plain");Ie&&(ce.preventDefault(),u(ae=>ae+Ie),C.focus())};return Y.addEventListener("paste",re),()=>Y.removeEventListener("paste",re)},[b,e.attachments,He]);let j=()=>{let C=d.trim();!C&&_.length===0||a||(i(C,_),u(""),g([]))},L=C=>{C.key!=="Enter"||C.shiftKey||C.isComposing||(C.preventDefault(),a?l():j())},V=C=>{let Y=C.target,re=Mo(Y.files,_,e.attachments);re.accepted.length>0&&(Et.info("attach (file picker)",{count:re.accepted.length,totalBytes:Gt(re.accepted)}),o.emit("attach",{count:re.accepted.length,totalBytes:Gt(re.accepted)}),g(ce=>[...ce,...re.accepted])),Y.value=""},B=C=>{Et.info("removeAttachment",{id:C}),o.emit("removeAttachment",{id:C}),g(Y=>{let re=Y.find(ce=>ce.id===C);return re&&oa(re),Y.filter(ce=>ce.id!==C)})},X=D(null),Q=()=>{if(x.isSupported){if(f){let C=X.current?Date.now()-X.current:0;Et.info("voiceStop",{durationMs:C}),o.emit("voiceStop",{durationMs:C}),x.stop(),m(!1),n.play("voiceStop"),X.current=null;return}X.current=Date.now(),Et.info("voiceStart"),o.emit("voiceStart",void 0),m(!0),n.play("voiceStart"),x.start((C,Y)=>u(re=>Y?`${re}${C} `:re),()=>{if(m(!1),X.current){let C=Date.now()-X.current;Et.debug("voiceStop (auto)",{durationMs:C}),o.emit("voiceStop",{durationMs:C}),X.current=null}})}},he=$u[e.composer.sendButton.icon];return r("div",{class:`${He}-composer`,"data-testid":w.composer,children:[_.length>0?r("div",{class:`${He}-attachments`,children:_.map(C=>r(Al,{attachment:C,onRemove:()=>B(C.id)},C.id))}):null,r("div",{class:`${He}-composer-row`,children:[r("div",{class:`${He}-composer-actions`,children:[b?r("button",{type:"button",class:`${He}-icon-btn`,onClick:()=>v.current?.click(),"aria-label":c.attach,"data-testid":w.composerAttach,children:r(Js,{})}):null,x.isSupported?r("button",{type:"button",class:`${He}-icon-btn`,onClick:Q,"aria-label":f?c.micStop:c.micStart,"aria-pressed":f,"data-recording":f?"true":void 0,"data-testid":w.composerVoice,children:r(Qs,{})}):null]}),r("textarea",{ref:P,class:`${He}-textarea`,rows:1,value:d,placeholder:c.composerPlaceholder,onInput:C=>u(C.target.value),onKeyDown:L,"aria-label":c.composerPlaceholder,"data-testid":w.composerInput}),a?r("button",{type:"button",class:`${He}-send`,onClick:l,"aria-label":c.stop,"data-testid":w.composerStop,children:r(Ys,{})}):r("button",{type:"button",class:`${He}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:j,disabled:!d.trim()&&_.length===0,"aria-label":c.send,"data-testid":w.composerSend,children:r(he,{})})]}),r("input",{ref:v,type:"file",multiple:!0,accept:e.attachments.accept,onChange:V,class:`${He}-sr-only`,"data-testid":w.composerFileInput})]})}var Hu=y.cssPrefix;function Ll({visible:e,strings:t}){return e?r("div",{class:`${Hu}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function No({containerRef:e,onDrop:t}){let[n,o]=A(!1);return T(()=>{let a=e.current;if(!a)return;let i=0,l=u=>{i+=1,u.dataTransfer?.types.includes("Files")&&(u.preventDefault(),o(!0))},s=()=>{i-=1,!(i>0)&&(i=0,o(!1))},c=u=>{u.dataTransfer?.types.includes("Files")&&u.preventDefault()},d=u=>{i=0,o(!1),u.dataTransfer&&(u.preventDefault(),t(u.dataTransfer.items))};return a.addEventListener("dragenter",l),a.addEventListener("dragleave",s),a.addEventListener("dragover",c),a.addEventListener("drop",d),()=>{a.removeEventListener("dragenter",l),a.removeEventListener("dragleave",s),a.removeEventListener("dragover",c),a.removeEventListener("drop",d)}},[e,t]),{visible:n}}function Ml({itemCount:e,initialFocusIndex:t}){let[n,o]=A(!1),a=D(null),i=D(null),[l,s]=A(-1),c=O(()=>{o(!1),s(-1),a.current?.focus()},[]),d=O(()=>o(g=>!g),[]);T(()=>{if(!n)return;let g=f=>{let m=i.current,P=a.current;if(!m||!P)return;let v=f.composedPath();v.includes(m)||v.includes(P)||(o(!1),s(-1))};return document.addEventListener("click",g,!0),()=>document.removeEventListener("click",g,!0)},[n]),T(()=>{if(!n||e===0)return;let g=t?.()??0,f=g<0||g>=e?0:g;s(f)},[n,e,t]),T(()=>{if(!n||l<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[l]?.focus()},[n,l]);let u=O(g=>{(g.key==="ArrowDown"||g.key==="Enter"||g.key===" ")&&(g.preventDefault(),o(!0))},[]),_=O(g=>{if(e!==0)switch(g.key){case"Escape":g.preventDefault(),c();return;case"ArrowDown":g.preventDefault(),s(f=>(f+1)%e);return;case"ArrowUp":g.preventDefault(),s(f=>(f-1+e)%e);return;case"Home":g.preventDefault(),s(0);return;case"End":g.preventDefault(),s(e-1)}},[e,c]);return{open:n,focusIndex:l,triggerRef:a,menuRef:i,toggle:d,close:c,onTriggerKey:u,onMenuKey:_}}function Nl({items:e,triggerLabel:t}){let n=y.cssPrefix,o=Ml({itemCount:e.length}),a=s=>{s.disabled||(s.onSelect?.(),s.keepOpen||o.close())},i=(s,c)=>s.onSelectValue?.(c),l=(s,c)=>{let d=c.segments;if(!d?.length)return;let u=Math.max(0,d.findIndex(g=>g.value===c.value)),_=-1;if(s.key==="ArrowRight"||s.key==="Enter"||s.key===" ")_=(u+1)%d.length;else if(s.key==="ArrowLeft")_=(u-1+d.length)%d.length;else return;s.preventDefault(),s.stopPropagation(),i(c,d[_].value)};return r("div",{class:`${n}-menu-wrap`,children:[r("button",{ref:o.triggerRef,type:"button",class:`${n}-icon-btn`,"aria-label":t,"aria-haspopup":"menu","aria-expanded":o.open,title:t,onClick:o.toggle,onKeyDown:o.onTriggerKey,children:r(rl,{})}),o.open?r("div",{ref:o.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:o.onMenuKey,tabIndex:-1,children:e.map(s=>s.segments?r("div",{role:"menuitem",class:`${n}-menu-item ${n}-menu-item-segmented`,"aria-label":s.label,tabIndex:-1,onKeyDown:c=>l(c,s),children:[s.icon?r("span",{class:`${n}-menu-icon`,children:s.icon}):null,r("span",{class:`${n}-menu-label`,children:s.label}),r("span",{class:`${n}-segmented`,role:"group","aria-label":s.label,children:s.segments.map(c=>{let d=c.value===s.value;return r("button",{type:"button",role:"menuitemradio","aria-checked":d,class:`${n}-segment`,"data-on":d?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${w.langSegment}-${c.value}`,onClick:()=>i(s,c.value),children:c.label},c.value)})})]},s.id):r("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":s.type==="switch"?s.on:void 0,disabled:s.disabled,onClick:()=>a(s),children:[s.icon?r("span",{class:`${n}-menu-icon`,children:s.icon}):null,r("span",{class:`${n}-menu-label`,children:s.label}),s.type==="switch"&&s.on?r("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:r(xn,{})}):null]},s.id))}):null]})}var ia=y.cssPrefix;function Bu(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 Fu={normal:"large",large:"small",small:"normal"};function zu(e){return e==="light"?r(gl,{}):e==="dark"?r(hl,{}):r(vl,{})}function Uu(e){return(e.split("-")[0]??e).toUpperCase()}function Ye({panelProps:e,variant:t}){let{options:n,panelSize:o,feedback:a,onClose:i,onClear:l,onExpand:s,onFullscreen:c,onSoundToggle:d}=e,{onToggleHistory:u,onLocaleChange:_,onThemeChange:g,onTextSizeChange:f}=e,m=n.strings,P=n.mode,v=t==="chat",b=J(()=>a.mutedSig.value).value,S=new Set(n.actions),x=C=>S.has(C),R=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,z=C=>R?!1:Sn(C,P,o),j=n.themeMode,L={auto:m.themeAuto,light:m.themeLight,dark:m.themeDark},V=n.textSize,B={small:m.textSizeSmall,normal:m.textSizeNormal,large:m.textSizeLarge},X=[];if(v&&x("clear")&&X.push({id:"clear",icon:r(_l,{}),label:m.newConversation,onSelect:l}),x("expand")&&z("expand")){let C=o==="expanded";X.push({id:"expand",icon:C?r(el,{}):r(Zs,{}),label:C?m.collapse:m.expand,type:"switch",on:C,onSelect:s})}if(x("fullscreen")&&z("fullscreen")){let C=o==="fullscreen";X.push({id:"fullscreen",icon:C?r(nl,{}):r(tl,{}),label:C?m.exitFullscreen:m.fullscreen,type:"switch",on:C,onSelect:c})}v&&x("sound")&&X.push({id:"sound",icon:b?r(il,{}):r(al,{}),label:b?m.soundOff:m.soundOn,type:"switch",on:!b,onSelect:d}),x("theme")&&X.push({id:"theme",icon:zu(j),label:`${m.theme}: ${L[j]}`,onSelect:()=>g(Bu(j)),keepOpen:!0}),x("textSize")&&X.push({id:"textSize",icon:r(sl,{}),label:`${m.textSize}: ${B[V]}`,onSelect:()=>f(Fu[V]),keepOpen:!0}),x("language")&&n.availableLocales.length>1&&X.push({id:"language",icon:r(dl,{}),label:m.language,segments:n.availableLocales.map(C=>({value:C,label:Uu(C),lang:C})),value:n.locale,onSelectValue:_});let Q=!!i&&Ao(P,o,n.actions),he=v&&x("history");return r("div",{class:`${ia}-header-actions`,children:[he?r("button",{type:"button",class:`${ia}-icon-btn`,onClick:u,"aria-label":m.history,title:m.history,"data-testid":w.actionHistory,children:r(cl,{})}):null,X.length>0?r(Nl,{items:X,triggerLabel:m.moreActions}):null,Q?r("button",{type:"button",class:`${ia}-icon-btn`,onClick:i,"aria-label":m.close,title:m.close,"data-testid":w.actionClose,children:r(Xe,{})}):null]})}var Wu=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,qu=/^https?:\/\/[^\s.]+\.[^\s]+$/i,Gu=/^[+]?[\d\s().-]{6,}$/;function Vt(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>String(t[o]??`{${o}}`))}function Vu(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function Ku(e,t,n){let o=e.required??!0,a=e.validation;if(e.type==="multiselect"){let l=Vu(t);return o&&l===0?n.formRequired:l===0?void 0:a?.minSelections!=null&&l<a.minSelections?Vt(n.formChooseAtLeast,{min:a.minSelections}):a?.maxSelections!=null&&l>a.maxSelections?Vt(n.formChooseAtMost,{max:a.maxSelections}):void 0}let i=typeof t=="string"?t.trim():"";if(!i)return o?n.formRequired:void 0;switch(e.type){case"email":if(!Wu.test(i))return n.formInvalidEmail;break;case"url":if(!qu.test(i))return n.formInvalidUrl;break;case"tel":if(!Gu.test(i))return n.formInvalidTel;break;case"number":{let l=Number(i);if(!Number.isFinite(l))return n.formInvalidNumber;if(a?.min!=null&&l<a.min)return Vt(n.formNumberTooSmall,{min:a.min});if(a?.max!=null&&l>a.max)return Vt(n.formNumberTooLarge,{max:a.max});break}default:break}if(a?.minLength!=null&&i.length<a.minLength)return Vt(n.formTooShort,{min:a.minLength});if(a?.maxLength!=null&&i.length>a.maxLength)return Vt(n.formTooLong,{max:a.maxLength});if(a?.pattern)try{if(!new RegExp(a.pattern).test(i))return n.formPatternMismatch}catch{}}function Dl(e,t,n){let o={};for(let a of e){let i=Ku(a,t[a.name],n);i&&(o[a.name]=i)}return o}function Ol(e){let t={};for(let[n,o]of Object.entries(e)){let a=Array.isArray(o)?o.join(", "):o;a&&a.trim()&&(t[n]=a.trim())}return t}var de=y.cssPrefix,Do="__other__";function Oo({fields:e,strings:t,submitLabel:n,onSubmit:o,skipLabel:a,onSkip:i,footerHint:l,submitOnEnter:s,disabled:c,rootTestId:d,submitTestId:u,skipTestId:_}){let[g,f]=A(()=>Ju(e)),[m,P]=A({}),[v,b]=A({}),S=L=>{v[L]&&b(V=>({...V,[L]:""}))},x=(L,V)=>{f(B=>({...B,[L]:V})),S(L)},R=(L,V)=>{P(B=>({...B,[L]:V})),S(L)},z=L=>{if(L.preventDefault(),c)return;let V=Qu(e,g,m),B=Dl(e,V,t);if(Object.keys(B).length>0){b(B);return}o(Ol(V))},j=L=>{!s||L.key!=="Enter"||L.shiftKey||L.isComposing||L.target?.tagName==="TEXTAREA"&&z(L)};return r("form",{class:`${de}-form`,onSubmit:z,onKeyDown:j,"data-testid":d,noValidate:!0,children:[e.map(L=>r(ju,{field:L,value:g[L.name],otherText:m[L.name]??"",error:v[L.name],disabled:c,strings:t,onChange:V=>x(L.name,V),onOtherChange:V=>R(L.name,V)},L.name)),r("div",{class:`${de}-form-actions`,children:[l?r("span",{class:`${de}-form-hint`,children:l}):null,a&&i?r("button",{type:"button",class:`${de}-form-skip`,onClick:i,disabled:c,"data-testid":_,children:a}):null,r("button",{type:"submit",class:`${de}-form-submit`,disabled:c,"data-testid":u,children:n})]})]})}function ju({field:e,value:t,otherText:n,error:o,disabled:a,strings:i,onChange:l,onOtherChange:s}){let c=be(w.formField,e.name),d=Xu({field:e,value:t,otherText:n,disabled:a,strings:i,onChange:l,onOtherChange:s,fieldTid:c});return r("label",{class:`${de}-field`,"data-field":e.name,"data-invalid":o?"true":void 0,children:[r("span",{class:`${de}-field-label`,children:[e.label,e.required??!0?r("span",{class:`${de}-field-req`,"aria-hidden":"true",children:" *"}):null]}),d,e.validationHint&&!o?r("span",{class:`${de}-field-hint`,children:e.validationHint}):null,o?r("span",{class:`${de}-field-error`,role:"alert",children:o}):null]})}function Xu(e){let{field:t,value:n,otherText:o,disabled:a,strings:i,onChange:l,onOtherChange:s,fieldTid:c}=e,d=typeof n=="string"?n:"";switch(t.type){case"textarea":return r("textarea",{class:`${de}-field-input`,rows:3,value:d,placeholder:t.placeholder,disabled:a,onInput:u=>l(u.target.value),"data-testid":c});case"select":return r("select",{class:`${de}-field-input`,value:d,disabled:a,onChange:u=>l(u.target.value),"data-testid":c,children:[r("option",{value:"",children:t.placeholder??"\u2014"}),(t.options??[]).map(u=>r("option",{value:u.value,children:u.label??u.value},u.value))]});case"radio":{let u=t.allowOther&&d===Do;return r("div",{class:`${de}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(_=>r("label",{class:`${de}-choice`,children:[r("input",{type:"radio",name:`${de}-${t.name}`,checked:d===_.value,disabled:a,onChange:()=>l(_.value)}),r("span",{children:_.label??_.value})]},_.value)),t.allowOther?r("label",{class:`${de}-choice`,children:[r("input",{type:"radio",name:`${de}-${t.name}`,checked:d===Do,disabled:a,onChange:()=>l(Do)}),r("span",{children:i.formOther})]}):null,u?r("input",{class:`${de}-field-input`,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:_=>s(_.target.value)}):null]})}case"checkbox":return r("label",{class:`${de}-choice`,children:[r("input",{type:"checkbox",checked:d==="true",disabled:a,onChange:u=>l(u.target.checked?"true":""),"data-testid":c}),r("span",{children:t.placeholder??t.label})]});case"multiselect":{let u=Array.isArray(n)?n:[],_=(g,f)=>l(f?[...u,g]:u.filter(m=>m!==g));return r("div",{class:`${de}-field-choices`,"data-testid":c,children:[(t.options??[]).map(g=>r("label",{class:`${de}-choice`,children:[r("input",{type:"checkbox",checked:u.includes(g.value),disabled:a,onChange:f=>_(g.value,f.target.checked)}),r("span",{children:g.label??g.value})]},g.value)),t.allowOther||(t.options??[]).length===0?r("textarea",{class:`${de}-field-input`,rows:2,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:g=>s(g.target.value)}):null]})}default:return r("input",{class:`${de}-field-input`,type:Yu(t.type),value:d,placeholder:t.placeholder,disabled:a,onInput:u=>l(u.target.value),"data-testid":c})}}function Yu(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function Ju(e){let t={};for(let n of e)n.defaultValue!=null&&(t[n.name]=n.type==="multiselect"?n.defaultValue.split(",").map(o=>o.trim()).filter(Boolean):n.defaultValue);return t}function Qu(e,t,n){let o={...t};for(let a of e){let i=n[a.name]?.trim();if(a.type==="radio"&&a.allowOther&&t[a.name]===Do)o[a.name]=i??"";else if(a.type==="multiselect"&&i){let l=i.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),s=Array.isArray(t[a.name])?t[a.name]:[];o[a.name]=[...s,...l]}}return o}var Je=y.cssPrefix;function sa({form:e,strings:t,onSubmit:n,onSkip:o}){return r("div",{class:`${Je}-form-gate`,"data-testid":w.formGate,children:[e.title?r("h3",{class:`${Je}-form-gate-title`,children:e.title}):null,e.description?r("p",{class:`${Je}-form-gate-desc`,children:e.description}):null,r(Oo,{fields:e.fields,strings:t,submitLabel:e.submitLabel??t.formSubmit,onSubmit:n,skipLabel:e.skippable?t.formSkip:void 0,onSkip:e.skippable?o:void 0,submitTestId:w.formSubmit,skipTestId:w.formSkip})]})}function $l({marker:e,strings:t,onFill:n}){let o=e.outcome==="skipped",a=o?t.formSkipped:t.formSubmitted,i=e.title?r(te,{children:[r("span",{children:e.title}),r("span",{class:`${Je}-sr-only`,children:a})]}):r("span",{children:a}),l=e.form?.reviewable??!1,s=!o&&l&&e.values&&Object.keys(e.values).length>0?e.values:null;if(s){let c=d=>e.form?.fields.find(u=>u.name===d)?.label??d;return r("details",{class:`${Je}-form-done`,"data-outcome":e.outcome,"data-testid":w.formDone,children:[r("summary",{class:`${Je}-form-done-summary`,"data-testid":w.formDoneToggle,children:[r(xn,{}),i,r(qt,{})]}),r("dl",{class:`${Je}-form-answers`,"data-testid":w.formAnswers,children:Object.entries(s).map(([d,u])=>r("div",{class:`${Je}-form-answer`,children:[r("dt",{children:c(d)}),r("dd",{children:u})]},d))})]})}return r("div",{class:`${Je}-form-done`,"data-outcome":e.outcome,"data-testid":w.formDone,role:"status",children:[o?r(ll,{}):r(xn,{}),i,o&&e.form?.reopenable&&n?r("button",{type:"button",class:`${Je}-form-done-fill`,"data-testid":w.formFill,onClick:n,children:t.formFillOut}):null]})}function Hl(e){if(!e)return!1;let t=e.startsWith("tool:")?e.slice(5):e;return t==="ask-user-questions"||t==="ask_user_questions"}var da=1,Fl=2,zl=4,Ul=8,Wl=16;function Zu(e){switch(e){case da:return"href";case Fl:return"src";case zl:return"class";case Ul:return"checked";case Wl:return"start"}}var ep=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}},tp=ep;var Bl=24;function ua(e){let t=new Uint32Array(Bl);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(Bl),indent:"",indent_len:0,table_state:0}}function ql(e){e.pending.length>0&&Ce(e,`
12
- `)}function ne(e){e.text.length!==0&&(console.assert(e.len>0,"Never adding text to root"),e.renderer.add_text(e.renderer.data,e.text),e.text="")}function me(e){console.assert(e.len>0,"No nodes to end"),e.len-=1,e.token=e.tokens[e.len],e.renderer.end_token(e.renderer.data)}function oe(e,t){(e.tokens[e.len]===24||e.tokens[e.len]===23)&&t!==25&&me(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function np(e,t,n){for(;n<=e.len;){if(e.tokens[n]===t)return n;n+=1}return-1}function Tt(e,t){for(e.fence_start=0;e.len>t;)me(e)}function $o(e,t){let n=0;for(let o=0;o<=e.len&&(t-=e.spaces[o],!(t<0));o+=1)switch(e.tokens[o]){case 9:case 10:case 20:case 25:n=o;break}for(;e.len>n;)me(e);return t}function la(e,t){let n=-1,o=-1;for(let a=e.blockquote_idx+1;a<=e.len;a+=1)if(e.tokens[a]===25){if(e.indent_len<e.spaces[a]){o=-1;break}o=a}else e.tokens[a]===t&&(n=a);return o===-1?n===-1?(Tt(e,e.blockquote_idx),oe(e,t),!0):(Tt(e,n),!1):(Tt(e,o),oe(e,t),!0)}function ca(e,t){oe(e,25),e.spaces[e.len]=e.indent_len+t,at(e),e.token=103}function at(e){e.indent="",e.indent_len=0,e.pending=""}function _a(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 op(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 rp(e){return _a(e)||op(e)}function Ce(e,t){for(let n of t){if(e.token===101){switch(n){case" ":e.indent_len+=1;continue;case" ":e.indent_len+=4;continue}let a=$o(e,e.indent_len);e.indent_len=0,e.token=e.tokens[e.len],a>0&&Ce(e," ".repeat(a))}let o=e.pending+n;switch(e.token){case 21:case 1:case 20:case 24:case 23:switch(console.assert(e.text.length===0,"Root should not have any text"),e.pending[0]){case void 0:e.pending=n;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=1;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=4;continue;case`
13
- `:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){me(e),at(e),e.pending=n;continue}Tt(e,e.blockquote_idx),at(e),e.blockquote_idx=0,e.fence_start=0,e.pending=n;continue;case"#":switch(n){case"#":if(e.pending.length<6){e.pending=o;continue}break;case" ":$o(e,e.indent_len),oe(e,tp(e.pending.length)),at(e);continue}break;case">":{let i=np(e,20,e.blockquote_idx+1);i===-1?(Tt(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,oe(e,20)):e.blockquote_idx=i,at(e),e.pending=n;continue}case"-":case"*":case"_":if(e.hr_chars===0&&(console.assert(e.pending.length===1,"Pending should be one character"),e.hr_chars=1,e.hr_char=e.pending),e.hr_chars>0){switch(n){case e.hr_char:e.hr_chars+=1,e.pending=o;continue;case" ":e.pending=o;continue;case`
14
- `:if(e.hr_chars<3)break;$o(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),at(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){la(e,23),ca(e,2),Ce(e,o.slice(2));continue}break;case"`":if(e.pending.length<3){if(n==="`"){e.pending=o,e.fence_start=o.length;continue}e.fence_start=0;break}switch(n){case"`":e.pending.length===e.fence_start?(e.pending=o,e.fence_start=o.length):(oe(e,2),at(e),e.fence_start=0,Ce(e,o));continue;case`
15
- `:{$o(e,e.indent_len),oe(e,10),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,zl,e.pending.slice(e.fence_start)),at(e),e.token=101;continue}default:e.pending=o;continue}case"+":if(n!==" ")break;la(e,23),ca(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;la(e,24)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,Wl,e.pending.slice(0,-1)),ca(e,e.pending.length+1);continue}else{let i=n.charCodeAt(0);if(i===46||_a(i)){e.pending=o;continue}}break;case"|":Tt(e,e.blockquote_idx),oe(e,27),oe(e,28),e.pending="",Ce(e,n);continue}let a=o;if(e.token===21)e.token=e.tokens[e.len],e.renderer.add_token(e.renderer.data,21),e.renderer.end_token(e.renderer.data);else if(e.indent_len>=4){let i=0;for(;i<4;i+=1)if(e.indent[i]===" "){i=i+1;break}a=e.indent.slice(i)+o,oe(e,9)}else oe(e,2);at(e),Ce(e,a);continue;case 27:if(e.table_state===1)switch(n){case"-":case" ":case"|":case":":e.pending=o;continue;case`
16
- `:e.table_state=2,e.pending="";continue;default:me(e),e.table_state=0;break}else switch(e.pending){case"|":oe(e,28),e.pending="",Ce(e,n);continue;case`
17
- `:me(e),e.pending="",e.table_state=0,Ce(e,n);continue}break;case 28:switch(e.pending){case"":break;case"|":oe(e,29),me(e),e.pending="",Ce(e,n);continue;case`
18
- `:me(e),e.table_state=Math.min(e.table_state+1,2),e.pending="",Ce(e,n);continue;default:oe(e,29),Ce(e,n);continue}break;case 29:if(e.pending==="|"){ne(e),me(e),e.pending="",Ce(e,n);continue}break;case 9:switch(o){case`
11
+ ${a}`:a;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(!t||t==="[DONE]")return null;try{let o=JSON.parse(t);return Is.trace("chunk",{type:o.type,eventId:n}),{chunk:o,eventId:n}}catch(o){return Is.trace("frame parse failed",{err:o,payload:t.slice(0,200)}),null}}function q_(e){let t=new TextEncoder().encode(e),n="";for(let o of t)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var Ls=e=>e&&Object.keys(e).length>0?e:void 0;function Ms(e,t){let n=Ls(e),o=Ls(t);if(!n&&!o)return;let a={};return n&&(a.user=n),o&&(a.page=o),q_(JSON.stringify(a))}function Co(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?t:void 0}function G_(e){return`tool-${e.startsWith("tool:")?e.slice(5):e}`}function Ns(e){return e.startsWith("tool-")?e.slice(5):e}var Be={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",bootstrap:"/pai/bootstrap",content:"/pai/content",submitForm:"/pai/submit-form"},Ds="context";function Os(e){let t=e.messages.map(i=>({id:i.serverMessageId??i.id,parts:X_(i),role:i.role,createdAt:i.createdAt!==void 0?new Date(i.createdAt).toISOString():void 0})),n={messages:t,conversationId:e.conversationId,trigger:e.trigger??"submit-message"},o=t.at(-1)?.id;o&&(n.messageId=o),e.visitorId&&(n.visitorId=e.visitorId),e.userPrefs&&(n.userPrefs=e.userPrefs);let a=e.tools?.map(j_).filter(i=>i!==null);return a?.length&&(n.data={tools:a}),n}function K_(e){return e.state==="output-available"||e.state==="output-error"||e.state==="output-denied"||e.approval?.approved!==void 0}function j_(e){return typeof e=="string"?e?{code:e}:null:e?.code?e:null}function X_(e){let t=[];for(let n of e.parts)if(n.kind==="step-start"&&t.push({type:"step-start"}),n.kind==="reasoning"&&n.text&&t.push({type:"reasoning",text:n.text,state:n.done?"done":"streaming"}),n.kind==="text"&&n.text&&t.push({text:n.text,type:"text"}),n.kind==="file"&&n.url&&t.push({mediaType:n.mediaType,type:"file",url:n.url}),n.kind==="tool"&&K_(n)){let o={type:G_(n.toolName),toolCallId:n.toolCallId,state:n.state};n.input!==void 0&&(o.input=n.input),n.output!==void 0&&(o.output=n.output),n.error!==void 0&&(o.errorText=n.error),n.approval&&n.approval.approved!==void 0&&(o.approval=n.approval),t.push(o)}for(let n of e.attachments??[])n.url&&t.push({type:"file",url:n.url,mediaType:n.mediaType,filename:n.name,fileId:n.id,fileSize:n.size});return t}var J=W.scope("transport"),$s=3,zs=400,Y_=6e4,Hs=1e4,Fs=3,J_=new Set([408,425,429,500,502,503,504]);function Bs(e){return zs*2**e+Math.floor(Math.random()*250)}function Q_(e){let t=e.get("retry-after");if(!t)return null;let n=Number(t),o=Number.isFinite(n)?n*1e3:Date.parse(t)-Date.now();return Number.isFinite(o)&&o>=0?Math.min(o,3e4):null}function na(e,t){return new Promise(n=>{if(t?.aborted)return n();let o=setTimeout(i,e),a=()=>i();t?.addEventListener("abort",a,{once:!0});function i(){clearTimeout(o),t?.removeEventListener("abort",a),n()}})}var To=class{constructor(t){j(this,"opts",t);j(this,"visitorId");j(this,"conversationId");j(this,"resumeStatus");j(this,"userContext");j(this,"pageContext");j(this,"locale");j(this,"conversationsCache",new Map);j(this,"contentCache",new Map)}setContext(t,n){this.userContext=t,this.pageContext=n}setLocale(t){this.locale=t}primeIdentity(t,n){t&&(this.visitorId=t),n&&(this.conversationId=n)}envelope(){let t={_ev:qt};this.visitorId&&(t.visitorId=this.visitorId),this.conversationId&&(t.conversationId=this.conversationId),this.locale&&(t.locale=this.locale);let n=Ms(this.userContext,this.pageContext);return n&&(t[Ds]=n),t}withEnvelope(t){return{...this.envelope(),...t}}appendEnvelope(t){for(let[n,o]of Object.entries(this.envelope()))t.append(n,o);return t}withEnvelopeQuery(t){let n=new URL(this.url(t));for(let[o,a]of Object.entries(this.envelope()))n.searchParams.has(o)||n.searchParams.set(o,a);return n.toString()}async handshake(t){J.debug("handshake \u2192",{visitorId:t.visitorId,conversationId:t.conversationId,locale:t.locale});let n=await this.postJson(Be.handshake,t,"handshake");return J.debug("handshake \u2190",{visitorId:n.visitorId,conversationId:n.conversationId,hasWelcome:!!n.welcome,hasConfig:!!n.config,rebind:n.rebind}),eu(n)||J.warn("handshake response did not match expected shape; using raw response",{response:n}),this.visitorId=n.visitorId??t.visitorId,this.conversationId=n.conversationId,n}async uploadFile(t){J.debug("uploadFile \u2192",{name:t.name,size:t.size,type:t.type});let n=new FormData;n.append("file",t,t.name);let o=await this.postForm(this.uploadPath,n,"upload");return J.debug("uploadFile \u2190",{id:o.id,url:o.url}),o}async transcribe(t,n="audio/webm"){J.debug("transcribe \u2192",{size:t.size,mimeType:n});let o=new FormData;o.append("audio",t,`voice.${Z_(n)}`),o.append("mimeType",n);let a=await this.postForm(this.transcribePath,o,"transcribe");return J.debug("transcribe \u2190",{textLen:a.text.length}),a}conversationsKey(t){return`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`}peekConversations(t={}){let n=this.conversationsCache.get(this.conversationsKey(t));if(n?.value&&Date.now()-n.at<Hs)return n.value}listConversations(t={}){let n=this.conversationsKey(t),o=this.conversationsCache.get(n);if(o&&Date.now()-o.at<Hs)return J.debug("listConversations \u2192 cache",t),o.result;let a={at:Date.now(),result:this.fetchConversations(t).then(i=>(a.value=i,i)).catch(i=>{throw this.conversationsCache.delete(n),i})};return this.conversationsCache.set(n,a),a.result}async fetchConversations(t){let n=new URL(this.url(Be.listConversations));t.visitorId&&n.searchParams.set("visitorId",t.visitorId),t.limit&&n.searchParams.set("limit",String(t.limit)),t.cursor&&n.searchParams.set("cursor",t.cursor),J.debug("listConversations \u2192",{visitorId:t.visitorId??this.visitorId,limit:t.limit,cursor:t.cursor});let o=await this.getJson(n.toString(),"listConversations"),a=o.conversations??[];return J.debug("listConversations \u2190",{count:a.length,nextCursor:o.nextCursor}),{conversations:a.map(i=>({conversationId:i.conversationId,title:i.title,lastMessageAt:i.lastMessageAt,preview:i.preview,canContinue:i.canContinue,hasUnread:i.hasUnread})),nextCursor:o.nextCursor}}async loadConversation(t){let n=new URL(this.url(Be.listMessages));n.searchParams.set("conversationId",t),J.debug("loadConversation \u2192",{conversationId:t,visitorId:this.visitorId});let o=await this.getJson(n.toString(),"loadConversation"),a=o.messages??[];return J.debug("loadConversation \u2190",{conversationId:o.conversationId,canContinue:o.canContinue,messageCount:a.length,hasSuggestions:!!o.suggestions}),{conversationId:o.conversationId,canContinue:o.canContinue??!0,messages:a,agent:o.agent,suggestions:o.suggestions}}async markRead(t){if(!(!this.visitorId||!t)){this.conversationsCache.clear(),J.debug("markRead \u2192",{conversationId:t,visitorId:this.visitorId});try{await this.postJson(Be.markRead,{conversationId:t},"markRead")}catch(n){J.debug("markRead failed (non-fatal)",{err:n})}}}listContent(t={}){let n=`${this.locale??""}|${JSON.stringify(t,Object.keys(t).toSorted())}`,o=this.contentCache.get(n);if(o&&Date.now()-o.at<Y_)return J.debug("listContent \u2192 cache",t),o.result;let a=this.fetchContent(t).catch(i=>{throw this.contentCache.delete(n),i});return this.contentCache.set(n,{at:Date.now(),result:a}),a}async fetchContent(t){let n=new URL(this.dataUrl(Be.content));for(let[i,l]of Object.entries(t))l!==void 0&&n.searchParams.set(i,Array.isArray(l)?l.join(","):String(l));J.debug("listContent \u2192",t);let o=await this.getJson(n.toString(),"listContent"),a=(o.items??[]).map(i=>ai(i,this.locale));return J.debug("listContent \u2190",{count:a.length,total:o.pagination?.total}),{...o,items:a}}async bootstrap(t){let n=new URL(this.dataUrl(Be.bootstrap));t&&n.searchParams.set("conversationId",t),J.debug("bootstrap \u2192",{conversationId:t??this.conversationId});let o=await this.getJson(n.toString(),"bootstrap"),a=o.forms??[],i=o.formSubmissions??[];return J.debug("bootstrap \u2190",{forms:a.length,formSubmissions:i.length}),{forms:a,formSubmissions:i}}async saveUserPrefs(t){J.debug("saveUserPrefs \u2192",{visitorId:this.visitorId,conversationId:this.conversationId,settingsKeys:Object.keys(t)});let n=await this.postJson(Be.updateSettings,{userPrefs:t},"saveUserPrefs");return J.debug("saveUserPrefs \u2190",{ok:n.ok}),n}get uploadPath(){return this.opts.endpoints?.upload??"/pai/upload-file"}get transcribePath(){return this.opts.endpoints?.transcribe??"/pai/transcribe-audio"}get submitFormPath(){return this.opts.endpoints?.submitForm??Be.submitForm}async submitForm(t){J.debug("submitForm \u2192",{formId:t.formId,trigger:t.trigger,fields:Object.keys(t.values).length});try{await this.postJson(this.dataUrl(this.submitFormPath),t,"submitForm")}catch(n){J.debug("submitForm failed (non-fatal)",{err:n})}}async submitFeedback(t){J.debug("submitFeedback \u2192",{messageId:t.messageId,value:t.value});try{await this.postJson(Be.messageFeedback,{messageId:t.messageId,set:{feedback:t.value}},"submitFeedback")}catch(n){J.debug("submitFeedback failed (non-fatal)",{err:n})}}sendMessage(t){this.conversationsCache.clear(),J.debug("message \u2192",{conversationId:t.conversationId,visitorId:t.visitorId,messageId:t.messageId,messageCount:t.messages.length,trigger:t.trigger,tools:t.data?.tools?.map(l=>l.code)});let n=new AbortController,o=new Set;return{iter:this.runStream(t,n,o),cancel:()=>this.cancelStream(n,t.conversationId),detach:()=>n.abort()}}resumeStream(){let t=new AbortController,n=new Set;this.resumeStatus=void 0;let o=this.resumeStreamGen(t,n,!0),a=()=>t.abort();return{iter:o,cancel:a,detach:a}}async*runStream(t,n,o){(yield*this.drain(this.openMessageStream(t,n.signal),o,n))||(yield*this.resumeStreamGen(n,o,!1))}async*resumeStreamGen(t,n,o){for(let a=1;a<=$s&&!t.signal.aborted;a++){if((!o||a>1)&&(await na(zs*a,t.signal),t.signal.aborted))return;let i;try{i=await this.fetchImpl(this.resumeUrl(n.size),{method:"GET",credentials:"omit",headers:{accept:"text/event-stream",...this.opts.auth.headers()},signal:t.signal})}catch(c){if(t.signal.aborted)return;J.debug("resume fetch failed \u2014 retrying",{attempt:a,err:c});continue}if(i.status===204||!i.ok){J.debug("resume \u2192 no in-flight stream",{status:i.status});return}if(!(i.headers.get("content-type")??"").includes("text/event-stream")){let c=await i.json().then(d=>d.status).catch(()=>{});if(J.debug("resume \u2192 no live stream (status response)",{status:c,attempt:a}),c==="pending"&&a<$s)continue;this.resumeStatus=c==="needs-generation"?"needs-generation":"completed";return}this.resumeStatus="live";let s=n.size;if(yield*this.drain(ta(i,t.signal),n,t))return;if(n.size===s){J.debug("resume \u2192 stream closed with no new events; nothing to resume");return}}if(!t.signal.aborted)throw new qe("stream incomplete after resume attempts","server")}async*drain(t,n,o){try{for await(let a of t){if(o.signal.aborted)return!0;if(a.eventId){if(n.has(a.eventId))continue;n.add(a.eventId)}if(yield a,a.chunk.type==="finish"||a.chunk.type==="error")return!0}}catch(a){if(o.signal.aborted)return!0;if(a instanceof qe&&a.status!==void 0)throw a;J.debug("stream segment dropped",{err:a})}return!1}cancelStream(t,n){t.signal.aborted||(J.debug("cancel stream",{conversationId:n,visitorId:this.visitorId}),t.abort(),!(!this.visitorId||!n)&&this.fetchImpl(this.url(Be.cancelStream),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope({})),keepalive:!0}).catch(o=>J.debug("cancel POST failed (non-fatal)",{err:o})))}async*openMessageStream(t,n){let o=await this.fetchImpl(this.url(Be.streamMessage),{method:"POST",credentials:"omit",headers:{accept:"text/event-stream","content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(t)),signal:n});yield*ta(o,n)}resumeUrl(t){let n=new URL(this.withEnvelopeQuery(Be.streamResume));return n.searchParams.set("resumeAt",String(t)),n.toString()}async postJson(t,n,o){let a=await this.fetchWithRetry(()=>[this.url(t),{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...this.opts.auth.headers()},body:JSON.stringify(this.withEnvelope(n))}],o);return this.assertOk(a,o)}async postForm(t,n,o){let a=await this.fetchImpl(this.url(t),{method:"POST",credentials:"omit",headers:this.opts.auth.headers(),body:this.appendEnvelope(n)});return this.assertOk(a,o)}async getJson(t,n){let o=await this.fetchWithRetry(()=>[this.withEnvelopeQuery(t),{method:"GET",credentials:"omit",headers:{accept:"application/json",...this.opts.auth.headers()}}],n);return this.assertOk(o,n)}async fetchWithRetry(t,n){for(let o=0;;o++){let[a,i]=t(),l;try{l=await this.fetchImpl(a,i)}catch(c){if(o>=Fs)throw new qe(`${n} failed: network error`,"network",void 0,c);J.debug("request network error \u2014 retrying",{label:n,attempt:o}),await na(Bs(o));continue}if(l.ok||!J_.has(l.status)||o>=Fs)return l;let s=Q_(l.headers)??Bs(o);J.debug("request retryable status \u2014 retrying",{label:n,status:l.status,attempt:o,wait:s}),await na(s)}}async assertOk(t,n){if(!t.ok)throw new qe(`${n} failed: ${t.status}`,"server",t.status);return await t.json()}url(t){return/^https?:\/\//i.test(t)?t:`${this.opts.agentApiBaseUrl}${t}`}dataUrl(t){return/^https?:\/\//i.test(t)?t:`${this.opts.dataApiBaseUrl}${t}`}get fetchImpl(){return this.opts.fetchImpl??globalThis.fetch.bind(globalThis)}};function Z_(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 eu(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.visitorId=="string"&&typeof t.conversationId=="string"}function Us(e,t){let n=e?[{kind:"text",id:"t0",textSig:z(e),doneSig:z(!0)}]:[];return{id:Ve(),role:"user",createdAt:Date.now(),status:"complete",attachments:t,partsSig:z(n)}}function Rn(){return{id:Ve(),role:"assistant",createdAt:Date.now(),status:"streaming",partsSig:z([])}}function Ws(e){let t=Ve();return tu({id:t,role:e.role,createdAt:Date.now(),status:"complete",ephemeral:!0,parts:[{kind:"text",id:`${t}-t0`,text:e.text,done:!0}]})}function tu(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:z(e.parts.map(iu))}}function nu(e){let t=e.parts.map((n,o)=>n.type==="text"?{kind:"text",id:`${e.id}-t${o}`,textSig:z(n.text),doneSig:z(!0)}:n.type==="reasoning"?{kind:"reasoning",id:`${e.id}-r${o}`,textSig:z(n.text),doneSig:z(n.state!=="streaming")}:n.type==="step-start"?{kind:"step-start",id:`${e.id}-ss${o}`}:n.type==="file"?{kind:"file",url:n.url,mediaType:n.mediaType}:n.type==="source-url"?{kind:"source",sourceId:n.sourceId,url:n.url,title:n.title}:n.type==="source-document"?{kind:"source",sourceId:n.sourceId,title:n.title,filename:n.filename,mediaType:n.mediaType}:n.type.startsWith("tool-")?{kind:"tool",toolCallId:n.toolCallId,toolName:Ns(n.type),inputPartialSig:z(""),inputSig:z(n.input),outputSig:z(n.output),errorSig:z(n.errorText),stateSig:z(n.state),approvalSig:z(n.approval)}:null).filter(n=>n!==null);return{id:e.id,role:e.role,serverMessageId:e.id,createdAt:Co(e.createdAt)??Date.now(),status:e.status==="failed"?"error":"complete",canceled:e.status==="canceled",feedback:e.feedback??null,partsSig:z(t)}}var ou=new Set(["completed","failed","canceled"]);function ru(e){return!e.parts.some(t=>t.type==="text"&&t.text.trim()!==""||t.type.startsWith("tool-")||t.type==="file"||t.type==="source-url"||t.type==="source-document")}function au(e){return e.role==="assistant"&&e.status!=null&&!ou.has(e.status)&&ru(e)}function ra(e){return e.filter(t=>!au(t)).map(nu)}function Vs(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(su)}}function Eo(e){let t="";for(let n of e.partsSig.value)n.kind==="text"&&(t+=n.textSig.value);return t}function Ro(e){return Eo(e).trim()!==""?!1:!e.partsSig.value.some(t=>t.kind==="tool"||t.kind==="file"||t.kind==="source")}function lt(e){return e.role==="assistant"&&e.status!=="streaming"&&Ro(e)}function qs(e){return e.canceled===!0&&lt(e)}function iu(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,textSig:z(e.text),doneSig:z(e.done)}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartialSig:z(e.inputPartial),inputSig:z(e.input),outputSig:z(e.output),errorSig:z(e.error),stateSig:z(e.state),approvalSig:z(e.approval)}:e}function su(e){return e.kind==="text"||e.kind==="reasoning"?{kind:e.kind,id:e.id,text:e.textSig.value,done:e.doneSig.value}:e.kind==="tool"?{kind:"tool",toolCallId:e.toolCallId,toolName:e.toolName,inputPartial:e.inputPartialSig.value,input:e.inputSig.value,output:e.outputSig.value,error:e.errorSig.value,state:e.stateSig.value,approval:e.approvalSig.value}:e}var Gs=W.scope("reducer"),Io=class{constructor(t){j(this,"messagesSig",t);j(this,"active",null);j(this,"openTextParts",new Map);j(this,"partSeq",0)}attach(t){this.active=t,this.openTextParts.clear()}detach(){this.active=null,this.openTextParts.clear()}ensureTextPart(t,n,o){let a=`${n}:${o}`,i=this.openTextParts.get(a);if(i)return i;let l={kind:n,id:`${o}#${this.partSeq++}`,textSig:z(""),doneSig:z(!1)};return this.openTextParts.set(a,l),In(t,l),l}apply(t){let n=this.active;if(n)switch(t.type){case"start":t.messageId&&(n.serverMessageId=t.messageId);return;case"finish-step":this.openTextParts.clear();return;case"start-step":In(n,{kind:"step-start",id:`ss-${this.partSeq++}`});return;case"finish":Gs.debug("finish",{reason:t.finishReason,canContinue:t.canContinue}),n.status="complete",t.finishReason&&(n.finishReason=t.finishReason),this.bumpDone(n);return;case"error":Gs.warn("stream error chunk",{errorText:t.errorText}),n.status="error",n.errorText=t.errorText,this.bumpDone(n);return;case"text-start":this.ensureTextPart(n,"text",t.id);return;case"text-delta":{let o=this.ensureTextPart(n,"text",t.id);o.textSig.value+=t.delta;return}case"text-end":this.ensureTextPart(n,"text",t.id).doneSig.value=!0;return;case"reasoning-start":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!1;return;case"reasoning-delta":{let o=this.ensureTextPart(n,"reasoning",t.id);o.textSig.value+=t.delta;return}case"reasoning-end":this.ensureTextPart(n,"reasoning",t.id).doneSig.value=!0;return;case"tool-input-start":case"tool-input-delta":case"tool-input-available":case"tool-output-available":case"tool-output-error":case"tool-output-denied":case"tool-approval-request":lu(n,t);return;case"file":In(n,{kind:"file",url:t.url,mediaType:t.mediaType});return;case"source-url":Ks(n,{kind:"source",sourceId:t.sourceId,url:t.url,title:t.title});return;case"source-document":Ks(n,{kind:"source",sourceId:t.sourceId,title:t.title,filename:t.filename,mediaType:t.mediaType});return;case"data-notification":return;case"data-conversation-rebind":return;default:{let o=t}}}bumpDone(t){t.partsSig.value=[...t.partsSig.value],this.messagesSig.value=[...this.messagesSig.value]}};function Lt(e,t,n){let o=e.partsSig.value.find(i=>i.kind==="tool"&&i.toolCallId===t);if(o)return o;let a={kind:"tool",toolCallId:t,toolName:n??"tool",inputPartialSig:z(""),inputSig:z(void 0),outputSig:z(void 0),errorSig:z(void 0),stateSig:z("input-streaming"),approvalSig:z(void 0)};return In(e,a),a}function In(e,t){e.partsSig.value=[...e.partsSig.value,t]}function Ks(e,t){e.partsSig.value.some(n=>n.kind==="source"&&n.sourceId===t.sourceId)||In(e,t)}function lu(e,t){switch(t.type){case"tool-input-start":Lt(e,t.toolCallId,t.toolName);return;case"tool-input-delta":{let n=Lt(e,t.toolCallId);n.inputPartialSig.value+=t.inputTextDelta;return}case"tool-input-available":{let n=Lt(e,t.toolCallId,t.toolName);n.inputSig.value=t.input,n.stateSig.value="input-available";return}case"tool-approval-request":{let n=Lt(e,t.toolCallId,t.toolName);n.approvalSig.value={id:t.approvalId},n.stateSig.value="approval-requested";return}case"tool-output-available":{let n=Lt(e,t.toolCallId);n.outputSig.value=t.output,n.stateSig.value="output-available";return}case"tool-output-error":{let n=Lt(e,t.toolCallId);n.errorSig.value=t.errorText,n.stateSig.value="output-error";return}case"tool-output-denied":{let n=Lt(e,t.toolCallId);n.stateSig.value="output-denied";return}default:return}}var js=W.scope("feedback:audio"),Ao=class{constructor(){j(this,"ctx",null);j(this,"master",null);j(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){js.warn("AudioContext init failed",{err:n})}}setVolume(t){if(!this.master||!this.ctx)return;let n=Math.max(0,Math.min(1,t));this.master.gain.setTargetAtTime(n,this.ctx.currentTime,.01)}playTone(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let a=n.currentTime,i=t.noteMs/1e3;t.notes.forEach((l,s)=>{let c=n.createOscillator();c.type=t.type,c.frequency.value=l;let d=n.createGain(),u=a+s*i;d.gain.setValueAtTime(1e-4,u),d.gain.exponentialRampToValueAtTime(t.peakGain,u+.005),d.gain.exponentialRampToValueAtTime(1e-4,u+i),c.connect(d).connect(o),c.start(u),c.stop(u+i+.01)})}async playUrl(t){let n=this.ctx,o=this.master;if(!n||!o||n.state!=="running")return;let a=await this.getBuffer(t);if(!a)return;let i=n.createBufferSource();i.buffer=a,i.connect(o),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 o=this.ctx,a=fetch(t).then(i=>i.ok?i.arrayBuffer():Promise.reject(new Error(`fetch ${i.status}`))).then(i=>o.decodeAudioData(i)).then(i=>(this.buffers.set(t,i),i)).catch(i=>(js.warn("audio fetch/decode failed",{url:t,err:i}),this.buffers.delete(t),null));return this.buffers.set(t,a),a}};var Xs={messageReceived:10,messageSent:0,error:[20,40,20],voiceStart:10,voiceStop:0},Ys={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 bt=null,Lo=0;function cu(){return typeof navigator<"u"&&typeof navigator.vibrate=="function"}function du(){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=`__${P.cssPrefix}_haptic_${Math.random().toString(36).slice(2)}`;let t=document.createElement("label");t.htmlFor=e.id,t.setAttribute("aria-hidden","true");let n="position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;opacity:0!important;pointer-events:none!important;";return e.style.cssText=n,t.style.cssText=n,document.body.append(e,t),{input:e,label:t}}function Js(e){if(!(e===0||Array.isArray(e)&&e.every(t=>t===0))){if(cu())try{navigator.vibrate(e);return}catch{}if(bt||(bt=du()),!!bt)try{bt.label.click()}catch{}}}function Qs(){Lo++;let e=!1;return()=>{e||(e=!0,Lo=Math.max(0,Lo-1),Lo===0&&bt&&(bt.input.remove(),bt.label.remove(),bt=null))}}var _u=W.scope("feedback"),uu=100,Mo=class{constructor(t,n){j(this,"mutedSig",z(!1));j(this,"audio",new Ao);j(this,"releaseHaptics");j(this,"sound");j(this,"haptics");j(this,"lastPlayed",new Map);j(this,"reducedMotionMq",null);this.sound=t,this.haptics=n,this.releaseHaptics=Qs(),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<uu}playSound(t){let n=this.sound.events?.[t];if(n===!1)return;if(typeof n=="string"){this.audio.playUrl(n).catch(a=>_u.warn("audio play failed",{err:a,url:n}));return}let o=Ys[t];o&&this.audio.playTone(o)}playHaptic(t){if(this.reducedMotionMq?.matches)return;let n=this.haptics.events?.[t];if(n===!1)return;let o=n===!0||n===void 0?Xs[t]:n;Js(o)}effectiveVolume(){let t=this.sound.volume??.3;return this.reducedMotionMq?.matches?t*.5:t}isTouchDevice(){return typeof window>"u"?!1:matchMedia("(hover: none) and (pointer: coarse)").matches}};function Mt(e,t){return e instanceof qe&&e.status===429?t.errorRateLimited:t.errorGeneric}var pu=0;function r(e,t,n,o,a,i){t||(t={});var l,s,c=t;if("ref"in c)for(s in c={},t)s=="ref"?l=t[s]:c[s]=t[s];var d={type:e,props:c,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--pu,__i:-1,__u:0,__source:a,__self:i};if(typeof e=="function"&&(l=e.defaultProps))for(s in l)c[s]===void 0&&(c[s]=l[s]);return Z.vnode&&Z.vnode(d),d}var F={fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},An=`${P.cssPrefix}-icon-dir`,mu=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M21 12a8 8 0 0 1-12 6.93L3 21l1.65-5.16A8 8 0 1 1 21 12Z"})}),Ze=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M18 6 6 18M6 6l12 12"})}),Zs=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M12 5v14M5 12h14"})}),el=()=>r("svg",{...F,class:An,"aria-hidden":"true",children:[r("path",{d:"m22 2-7 20-4-9-9-4Z"}),r("path",{d:"M22 2 11 13"})]}),tl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M12 19V5M5 12l7-7 7 7"})}),nl=()=>r("svg",{...F,class:An,"aria-hidden":"true",children:r("path",{d:"M3 20V4l18 8-18 8Z"})}),Zt=()=>r("svg",{...F,class:An,"aria-hidden":"true",children:r("path",{d:"m9 18 6-6-6-6"})}),ol=()=>r("svg",{...F,"aria-hidden":"true",children:r("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}),rl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"m21 11-9 9a5.5 5.5 0 0 1-7.78-7.78l8.49-8.49a3.67 3.67 0 0 1 5.19 5.19l-8.49 8.49a1.83 1.83 0 0 1-2.6-2.6l7.78-7.78"})}),al=()=>r("svg",{...F,"aria-hidden":"true",children:[r("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),r("path",{d:"M5 10a7 7 0 0 0 14 0M12 19v3"})]}),il=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M3 8V3h5M21 8V3h-5M3 16v5h5M21 16v5h-5"})}),sl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M8 3v5H3M16 3v5h5M8 21v-5H3M16 21v-5h5"})}),ll=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M3 3h7v2H5v5H3zM21 3h-7v2h5v5h2zM3 21h7v-2H5v-5H3zM21 21h-7v-2h5v-5h2z"})}),cl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M10 3v5H3M14 3v5h7M10 21v-5H3M14 21v-5h7"})}),dl=()=>r("svg",{...F,"aria-hidden":"true",viewBox:"0 0 10 10",children:r("path",{d:"M9 1L1 9M9 5L5 9M9 9H9",strokeWidth:"1.5"})}),_l=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"5",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),r("circle",{cx:"12",cy:"19",r:"1.5",fill:"currentColor",stroke:"none"})]}),ul=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM15 9a5 5 0 0 1 0 6M18 7a9 9 0 0 1 0 10"})}),pl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6"})}),ml=()=>r("svg",{...F,"aria-hidden":"true",children:[r("path",{d:"M3 18 8 6l5 12M4.7 14h6.6"}),r("path",{d:"M14.5 18l3.2-7 3.2 7M15.6 15.8h4.2"})]}),fl=()=>r("svg",{...F,class:An,"aria-hidden":"true",children:r("path",{d:"m5 6 6 6-6 6M13 6l6 6-6 6"})}),Ln=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M20 6 9 17l-5-5"})}),gl=()=>r("svg",{...F,"aria-hidden":"true",children:[r("path",{d:"M3 3v6h6"}),r("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 9"}),r("path",{d:"M12 7v5l3 2"})]}),hl=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("path",{d:"M2 12h20"}),r("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),Mn=()=>r("svg",{...F,class:An,"aria-hidden":"true",children:r("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),vl=()=>r("svg",{...F,"aria-hidden":"true",children:[r("path",{d:"M12 20h9"}),r("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"})]}),No=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"m6 9 6 6 6-6"})}),bl=()=>r("svg",{...F,"aria-hidden":"true",children:[r("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"}),r("path",{d:"M14 2v6h6"})]}),fu=()=>r("svg",{...F,"aria-hidden":"true",children:[r("path",{d:"m12 3-1.5 4.5L6 9l4.5 1.5L12 15l1.5-4.5L18 9l-4.5-1.5Z"}),r("path",{d:"M19 15v4M17 17h4M5 3v2M4 4h2"})]}),aa=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2Z"})}),ia=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),r("path",{d:"M12 17h.01"})]}),gu=()=>r("svg",{...F,"aria-hidden":"true",children:[r("path",{d:"m15 4 3 3-9 9-3-3z"}),r("path",{d:"M18 2v2M20 4h2M3 20l3-3M3 16h2M5 14v2"})]}),hu=()=>r("svg",{...F,"aria-hidden":"true",children:[r("rect",{x:"4",y:"8",width:"16",height:"12",rx:"2"}),r("path",{d:"M12 8V4"}),r("circle",{cx:"12",cy:"3",r:"1"}),r("path",{d:"M2 14h2M20 14h2M9 13h.01M15 13h.01M9.5 17h5"})]}),vu=()=>r("svg",{...F,"aria-hidden":"true",children:[r("path",{d:"M4 14v-2a8 8 0 0 1 16 0v2"}),r("rect",{x:"2",y:"14",width:"4",height:"6",rx:"1.5"}),r("rect",{x:"18",y:"14",width:"4",height:"6",rx:"1.5"}),r("path",{d:"M20 20v1a3 3 0 0 1-3 3h-5"})]}),bu=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("circle",{cx:"12",cy:"12",r:"4"}),r("path",{d:"m4.93 4.93 4.24 4.24M14.83 14.83l4.24 4.24M14.83 9.17l4.24-4.24M4.93 19.07l4.24-4.24"})]}),sa=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"11",cy:"11",r:"7"}),r("path",{d:"m21 21-4.3-4.3"})]}),xl=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),yl=()=>r("svg",{...F,"aria-hidden":"true",children:[r("path",{d:"M3 9.5 12 3l9 6.5"}),r("path",{d:"M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9"})]}),Pl=()=>r("svg",{...F,"aria-hidden":"true",children:[r("path",{d:"m3 11 15-5v12L3 13z"}),r("path",{d:"M3 11v2a2 2 0 0 0 2 2h1V9H5a2 2 0 0 0-2 2z"}),r("path",{d:"M7 15v3a2 2 0 0 0 4 0v-2"}),r("path",{d:"M21 10a3 3 0 0 1 0 4"})]}),Nn=()=>r("svg",{...F,"aria-hidden":"true",children:[r("path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z"}),r("path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1"})]}),kl=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"4"}),r("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}),Sl=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),wl=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 3v18"}),r("path",{d:"M12 3a9 9 0 0 1 0 18z",fill:"currentColor",stroke:"none"})]}),xu=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"10.5",cy:"10.5",r:"6.5"}),r("path",{d:"M8 11a2.5 2.5 0 0 0 5 0"}),r("path",{d:"m20 20-4.4-4.4"})]}),yu=()=>r("svg",{...F,"aria-hidden":"true",children:[r("path",{d:"M12 3.5 13.6 9 19 10.5 13.6 12 12 17.5 10.4 12 5 10.5 10.4 9z"}),r("path",{d:"M18.5 4v3M20 5.5h-3M5.5 16v2.5M6.75 17.25h-2.5"})]}),Pu=()=>r("svg",{...F,"aria-hidden":"true",children:[r("path",{d:"M4 18h16"}),r("path",{d:"M5 18a7 7 0 0 1 14 0"}),r("path",{d:"M12 8V6"}),r("path",{d:"M10 6h4"})]}),ku=()=>r("svg",{...F,"aria-hidden":"true",children:[r("path",{d:"M7 11V6.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M10 10V5.5a1.5 1.5 0 0 1 3 0V10"}),r("path",{d:"M13 10V6.5a1.5 1.5 0 0 1 3 0V12"}),r("path",{d:"M16 9.5a1.5 1.5 0 0 1 3 0v2.5a7 7 0 0 1-7 7 7 7 0 0 1-6.4-4.2L4 12.5a1.5 1.5 0 0 1 2.6-1.5L7 11"})]}),Cl=()=>r("svg",{...F,"aria-hidden":"true",children:[r("path",{d:"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1z"}),r("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"})]}),Tl=()=>r("svg",{...F,"aria-hidden":"true",children:[r("path",{d:"M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1z"}),r("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"})]}),El=()=>r("svg",{...F,"aria-hidden":"true",children:r("path",{d:"M14.7 6.3a4 4 0 0 0-5.4 5.3L3 18l3 3 6.4-6.3a4 4 0 0 0 5.3-5.4l-2.7 2.7-2.6-.7-.7-2.6z"})}),Rl=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 7v5l3 2"})]}),Il=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m8.5 12 2.5 2.5 4.5-5"})]}),Al=()=>r("svg",{...F,"aria-hidden":"true",children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"m15 9-6 6M9 9l6 6"})]}),Ll={chat:mu,message:aa,bubbles:Nn,spark:fu,wand:gu,bot:hu,help:ia,lifebuoy:bu,headset:vu,search:xu,sparkles:yu,concierge:Pu,wave:ku};var M=P.cssPrefix,w={launcher:`${M}-launcher`,callout:`${M}-callout`,calloutDismiss:`${M}-callout-dismiss`,panel:`${M}-panel`,panelHeader:`${M}-panel-header`,resizeGrip:`${M}-resize-grip`,scrollToBottom:`${M}-scroll-to-bottom`,actionHistory:`${M}-action-history`,actionClose:`${M}-action-close`,langSegment:`${M}-lang-segment`,composer:`${M}-composer`,composerInput:`${M}-composer-input`,composerSend:`${M}-composer-send`,composerStop:`${M}-composer-stop`,composerAttach:`${M}-composer-attach`,composerFileInput:`${M}-composer-file-input`,composerVoice:`${M}-composer-voice`,attachmentChip:`${M}-attachment-chip`,attachmentRemove:`${M}-attachment-remove`,suggestion:`${M}-suggestion`,messageBubble:`${M}-message`,messageRetry:`${M}-message-retry`,messageFeedback:`${M}-message-feedback`,feedbackUp:`${M}-feedback-up`,feedbackDown:`${M}-feedback-down`,historyPane:`${M}-history-pane`,historyBack:`${M}-history-back`,historyItem:`${M}-history-item`,sidebar:`${M}-sidebar`,sidebarToggle:`${M}-sidebar-toggle`,sidebarNewConversation:`${M}-sidebar-new-conversation`,sidebarItem:`${M}-sidebar-item`,messengerHome:`${M}-messenger-home`,modulesEmpty:`${M}-modules-empty`,tab:`${M}-tab`,tabBadge:`${M}-tab-badge`,homeView:`${M}-home-view`,homeGreeting:`${M}-home-greeting`,homeBrand:`${M}-home-brand`,backHeader:`${M}-back-header`,contentView:`${M}-content-view`,contentScroll:`${M}-content-scroll`,homeSearch:`${M}-home-search`,helpSearch:`${M}-help-search`,homeRecent:`${M}-home-recent`,homeContentRow:`${M}-home-content-row`,helpArticle:`${M}-help-article`,newsItem:`${M}-news-item`,formGate:`${M}-form-gate`,formDone:`${M}-form-done`,formDoneToggle:`${M}-form-done-toggle`,formAnswers:`${M}-form-answers`,formFill:`${M}-form-fill`,formSubmit:`${M}-form-submit`,formSkip:`${M}-form-skip`,formField:`${M}-form-field`,toolAskQuestions:`${M}-tool-ask-questions`,toolInputSubmit:`${M}-tool-input-submit`,toolInputSkip:`${M}-tool-input-skip`,toolApproval:`${M}-tool-approval`,toolApprove:`${M}-tool-approve`,toolReject:`${M}-tool-reject`,toolEdit:`${M}-tool-edit`,toolDecision:`${M}-tool-decision`,toolCall:`${M}-tool-call`,source:`${M}-source`};function we(e,t){return`${e}-${t}`}var Do=P.cssPrefix;function Ml({onToggle:e,launcher:t,strings:n,leaving:o,edgeTab:a}){let i=t.variant!=="circle"&&!!t.label;return r("button",{type:"button",class:`${Do}-fab`,"data-variant":t.variant,"data-size":t.size,"data-edge-tab":a?"true":void 0,"data-leaving":o?"true":void 0,"data-testid":w.launcher,onClick:e,"aria-label":n.launcherOpen,children:[Su(t.icon),i?r("span",{class:`${Do}-fab-label`,children:Ie(n,t.label??"")}):null]})}function Su(e){let t=Ll[e];return t?r(t,{}):r(wu,{source:e})}function wu({source:e}){return r("span",{ref:t=>{t&&Cu(t,e)},"aria-hidden":"true"})}function Cu(e,t){if(e.dataset.svgMounted!==t)try{let o=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;o&&o.tagName.toLowerCase()==="svg"&&(e.replaceChildren(document.importNode(o,!0)),e.dataset.svgMounted=t)}catch{}}function Nl({callout:e,launcherPosition:t,strings:n,closeLabel:o,onDismiss:a}){let[i,l]=R(!1);return T(()=>{let s=setTimeout(()=>l(!0),e.delayMs);return()=>clearTimeout(s)},[e.delayMs]),T(()=>{if(!i||e.autoDismissMs<=0)return;let s=setTimeout(a,e.autoDismissMs);return()=>clearTimeout(s)},[i,e.autoDismissMs,a]),i?r("div",{class:`${Do}-callout`,role:"status","data-shape":e.shape,"data-position":Tu(e.position,t),"data-animated":e.animated?"true":void 0,"data-testid":w.callout,children:[r("span",{children:Ie(n,e.text)}),r("button",{type:"button",class:`${Do}-callout-close`,onClick:a,"aria-label":o,title:o,"data-testid":w.calloutDismiss,children:r(Ze,{})})]}):null}function Tu(e,t){let n=t.endsWith("-right"),o=t.startsWith("bottom-");return e==="vertical"?o?"top":"bottom":n?"left":"right"}function Oo({panelEl:e,resize:t,position:n,initialSize:o,onSizeChange:a,strings:i}){let l=P.cssPrefix,s=D(null);if(T(()=>{if(!e)return;let m=e.style;t.minWidth&&m.setProperty(`--${l}-resize-min-w`,t.minWidth),t.maxWidth&&m.setProperty(`--${l}-resize-max-w`,t.maxWidth),t.minHeight&&m.setProperty(`--${l}-resize-min-h`,t.minHeight),t.maxHeight&&m.setProperty(`--${l}-resize-max-h`,t.maxHeight),o&&(m.setProperty(`--${l}-widget-w`,`${o.width}px`),m.setProperty(`--${l}-widget-h`,`${o.height}px`))},[e,t.minWidth,t.maxWidth,t.minHeight,t.maxHeight,l,o]),!e)return null;let c=n.startsWith("top-"),d=n.endsWith("-right"),u=`${l}-resize-grip ${l}-resize-grip--${c?"bottom":"top"}-${d?"left":"right"}`,h=m=>{if(!e)return;let y=m.currentTarget,x=e.getBoundingClientRect();s.current={pointerId:m.pointerId,startX:m.clientX,startY:m.clientY,startW:x.width,startH:x.height,dirX:d?-1:1,dirY:c?1:-1},y.setPointerCapture(m.pointerId),e.setAttribute("data-resizing",""),m.preventDefault()},_=m=>{let y=s.current;if(!y||m.pointerId!==y.pointerId||!e)return;let x=(m.clientX-y.startX)*y.dirX,k=(m.clientY-y.startY)*y.dirY;e.style.setProperty(`--${l}-widget-w`,`${y.startW+x}px`),e.style.setProperty(`--${l}-widget-h`,`${y.startH+k}px`)},f=m=>{let y=s.current;if(!y||m.pointerId!==y.pointerId||!e)return;m.currentTarget.releasePointerCapture(m.pointerId),e.removeAttribute("data-resizing");let x=e.getBoundingClientRect();a({width:Math.round(x.width),height:Math.round(x.height)}),s.current=null};return r("div",{class:u,role:"separator","aria-orientation":"vertical","aria-label":i.resizeHandle,title:i.resizeHandle,onPointerDown:h,onPointerMove:_,onPointerUp:f,onPointerCancel:f,"data-testid":w.resizeGrip,children:r(dl,{})})}var Nt=P.cssPrefix,Eu=`.${Nt}-header, .${Nt}-back-header, .${Nt}-home-hero`,Ru='button, a, input, textarea, select, [role="tab"], [contenteditable]',Dl=56;function $o(e,t){T(()=>{if(!t||!e)return;let n=c=>Number.parseFloat(c)||0,o=(c,d)=>Math.min(d,Math.max(-d,c)),a=null,i=c=>{let d=c.target;if(!(d instanceof Element)||!d.closest(Eu)||d.closest(Ru))return;let u=e.getBoundingClientRect();a={id:c.pointerId,x:c.clientX,y:c.clientY,dx:n(e.style.getPropertyValue(`--${Nt}-modal-dx`)),dy:n(e.style.getPropertyValue(`--${Nt}-modal-dy`)),maxX:(window.innerWidth+u.width)/2-Dl,maxY:(window.innerHeight+u.height)/2-Dl},e.dataset.dragging="true",c.preventDefault()},l=c=>{if(!a||c.pointerId!==a.id)return;let d=o(a.dx+c.clientX-a.x,a.maxX),u=o(a.dy+c.clientY-a.y,a.maxY);e.style.setProperty(`--${Nt}-modal-dx`,`${d}px`),e.style.setProperty(`--${Nt}-modal-dy`,`${u}px`)},s=c=>{!a||c.pointerId!==a.id||(a=null,delete e.dataset.dragging)};return e.addEventListener("pointerdown",i),window.addEventListener("pointermove",l),window.addEventListener("pointerup",s),window.addEventListener("pointercancel",s),()=>{e.removeEventListener("pointerdown",i),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s)}},[e,t])}function Dn(e,t,n){switch(e){case"clear":case"sound":case"history":case"language":case"theme":case"textSize":return!0;case"expand":return t==="floating";case"fullscreen":return t!=="standalone";case"close":return t==="standalone"||t==="page"?!1:t==="inline"?n==="fullscreen":!0}}function Ho(e,t,n){return Dn("close",e,t)?n.includes("close"):!1}function Ol(e,t){return e==="inline"&&t==="fullscreen"?"exit-fullscreen":"close"}var Iu='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function Fo(e){let t=n=>{if(n.key!=="Tab")return;let o=[...e.querySelectorAll(Iu)].filter(s=>s.offsetParent!==null||s===document.activeElement);if(o.length===0){n.preventDefault();return}let a=o[0],i=o[o.length-1];if(!a||!i)return;let l=e.getRootNode().activeElement;n.shiftKey&&l===a?(n.preventDefault(),i.focus()):!n.shiftKey&&l===i&&(n.preventDefault(),a.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}function Bo(e){return e.trim().split(/\s+/).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")}var la=P.cssPrefix;function $l({agent:e,strings:t}){let n=e.status??"online",o=Ie(t,e.name),a=e.title?Ie(t,e.title):null;return r("div",{class:`${la}-agent`,children:[r("div",{class:`${la}-agent-avatar`,"data-status":n,children:e.avatar?r("img",{src:e.avatar,alt:""}):r("span",{children:Bo(o)})}),r("div",{class:`${la}-agent-meta`,children:[r("strong",{children:o}),a?r("span",{children:a}):null]})]})}var Hl=W.scope("attachments");function zo(e,t,n){let o=Lu(e),a=[],i=[],l=Du(n.accept),s=t.reduce((d,u)=>d+u.size,0),c=t.length;for(let d of o){let u=Au(d,c,s,n,l);if(u){i.push({file:d,reason:u});continue}a.push(Nu(d)),s+=d.size,c+=1}return(a.length||i.length)&&Hl.debug("ingest",{accepted:a.length,rejected:i.map(d=>({name:d.file.name,reason:d.reason}))}),{accepted:a,rejected:i}}function ca(e){try{URL.revokeObjectURL(e.previewUrl)}catch(t){Hl.debug("revokeObjectURL failed",{error:t})}}function Au(e,t,n,o,a){return t>=o.maxCount?"count":n+e.size>o.maxBytes?"bytes":Ou(e,a)?null:"mime"}function Lu(e){return e?Array.isArray(e)?e.filter(t=>t instanceof File):[...e].map(t=>t instanceof File?t:Mu(t)).filter(t=>t!==null):[]}function Mu(e){let t=e;return!t?.getAsFile||t.kind!=="file"?null:t.getAsFile()}function Nu(e){return{file:e,id:Ve(),mediaType:e.type||"application/octet-stream",name:e.name||"pasted-file",previewUrl:URL.createObjectURL(e),size:e.size}}function Du(e){return e.split(",").map(t=>t.trim().toLowerCase()).filter(Boolean).map(t=>{if(t.startsWith("."))return{kind:"ext",ext:t};let[n="*",o="*"]=t.split("/");return{kind:"mime",type:n,subtype:o}})}function Ou(e,t){if(t.length===0)return!0;let[n="*",o="*"]=(e.type||"").toLowerCase().split("/"),a=(e.name||"").toLowerCase();return t.some(i=>i.kind==="ext"?a.endsWith(i.ext):(i.type==="*"||i.type===n)&&(i.subtype==="*"||i.subtype===o))}var On=P.cssPrefix;function Fl({attachment:e,onRemove:t}){let n=e.mediaType.startsWith("image/");return r("span",{class:`${On}-attachment-chip`,title:e.name,"data-testid":we(w.attachmentChip,e.id),children:[n?r("img",{class:`${On}-attachment-thumb`,src:e.previewUrl,alt:""}):r("span",{class:`${On}-attachment-thumb`,"aria-hidden":"true",children:r(bl,{})}),r("span",{class:`${On}-attachment-name`,children:e.name}),r("button",{type:"button",class:`${On}-attachment-remove`,onClick:t,"aria-label":`Remove ${e.name}`,"data-testid":we(w.attachmentRemove,e.id),children:r(Ze,{})})]})}var da={isSupported:!1,start:()=>{},stop:()=>{}};function _a(e,t,n){return e==="disabled"?da:e==="server"?Bu(n):$u(t)}function $u(e){let t=Hu();if(!t)return da;let n=null;return{isSupported:!0,start(o,a){n=new t,n.continuous=!0,n.interimResults=!0,n.lang=e,n.addEventListener("result",l=>{let s=l,c="",d=!1;for(let u=s.resultIndex;u<s.results.length;u++){let h=s.results[u];h&&(c+=h[0].transcript,h.isFinal&&(d=!0))}o(c,d)});let i=()=>{n=null,a()};n.addEventListener("end",i),n.addEventListener("error",i),n.start()},stop(){n?.stop()}}}function Hu(){let e=globalThis;return e.SpeechRecognition??e.webkitSpeechRecognition}var Fu=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];function Bu(e){if(typeof MediaRecorder>"u"||!navigator?.mediaDevices?.getUserMedia)return da;let t=null,n=null,o=[],a=()=>{for(let i of n?.getTracks()??[])i.stop();n=null};return{isSupported:!0,async start(i,l){try{n=await navigator.mediaDevices.getUserMedia({audio:!0});let s=zu();t=new MediaRecorder(n,s?{mimeType:s}:void 0),o=[],t.addEventListener("dataavailable",c=>{c.data.size>0&&o.push(c.data)}),t.addEventListener("stop",async()=>{let c=t?.mimeType??"audio/webm";a();let d=new Blob(o,{type:c});o=[];try{let{text:u}=await e(d,c);u&&i(u,!0)}catch{}finally{l()}}),t.start()}catch{a(),l()}},stop(){t?.stop()}}}function zu(){for(let e of Fu)if(MediaRecorder.isTypeSupported(e))return e}var ze=P.cssPrefix,Dt=W.scope("composer");function en(e){return e.reduce((t,n)=>t+n.size,0)}var Uu={arrowUp:tl,paperPlane:el,send:nl,chevron:Zt};function Bl({options:e,transport:t,feedback:n,bus:o,isStreaming:a,onSend:i,onStop:l,attachApiRef:s}){let c=e.strings,[d,u]=R(""),[h,_]=R([]),[f,m]=R(!1),y=D(null),x=D(null),k=e.features.files,S=e.features.voice,[b,I]=R(()=>_a(S,e.locale,(C,Q)=>t.transcribe(C,Q)));T(()=>{f||S==="disabled"||I(_a(S,e.locale,(C,Q)=>t.transcribe(C,Q)))},[e.locale,S,t,f]),T(()=>{let C=y.current;if(!C)return;let Q=C.getRootNode(),se="activeElement"in Q?Q.activeElement:null;se&&C.closest(`.${ze}-panel`)?.contains(se)||C.focus({preventScroll:!0})},[]),T(()=>{let C=y.current;if(C){if(d.length===0){C.style.height="";return}C.style.height="auto",C.style.height=`${Math.min(C.scrollHeight,160)}px`}},[d]);let G=D(h);G.current=h,T(()=>()=>G.current.forEach(ca),[]),T(()=>{if(s)return s.current={attachFromDrop:C=>{let Q=zo(C,G.current,e.attachments);Q.accepted.length!==0&&(Dt.info("attach (drop)",{count:Q.accepted.length,totalBytes:en(Q.accepted)}),o.emit("attach",{count:Q.accepted.length,totalBytes:en(Q.accepted)}),_(se=>[...se,...Q.accepted]))}},()=>{s.current&&(s.current=null)}},[s,e.attachments]),T(()=>{let C=y.current;if(!C)return;let Q=C.closest(`.${ze}-panel`);if(!Q)return;let se=xe=>{let pe=xe.clipboardData;if(!pe)return;if(k){let ce=zo(pe.items,G.current,e.attachments);if(ce.accepted.length>0){xe.preventDefault(),Dt.info("attach (paste)",{count:ce.accepted.length,totalBytes:en(ce.accepted)}),o.emit("attach",{count:ce.accepted.length,totalBytes:en(ce.accepted)}),_(Xe=>[...Xe,...ce.accepted]);return}}if(xe.target===C)return;let Le=pe.getData("text/plain");Le&&(xe.preventDefault(),u(ce=>ce+Le),C.focus())};return Q.addEventListener("paste",se),()=>Q.removeEventListener("paste",se)},[k,e.attachments,ze]);let re=()=>{let C=d.trim();!C&&h.length===0||a||(i(C,h),u(""),_([]))},N=C=>{C.key!=="Enter"||C.shiftKey||C.isComposing||(C.preventDefault(),a?l():re())},Y=C=>{let Q=C.target,se=zo(Q.files,h,e.attachments);se.accepted.length>0&&(Dt.info("attach (file picker)",{count:se.accepted.length,totalBytes:en(se.accepted)}),o.emit("attach",{count:se.accepted.length,totalBytes:en(se.accepted)}),_(xe=>[...xe,...se.accepted])),Q.value=""},$=C=>{Dt.info("removeAttachment",{id:C}),o.emit("removeAttachment",{id:C}),_(Q=>{let se=Q.find(xe=>xe.id===C);return se&&ca(se),Q.filter(xe=>xe.id!==C)})},B=D(null),U=()=>{if(b.isSupported){if(f){let C=B.current?Date.now()-B.current:0;Dt.info("voiceStop",{durationMs:C}),o.emit("voiceStop",{durationMs:C}),b.stop(),m(!1),n.play("voiceStop"),B.current=null;return}B.current=Date.now(),Dt.info("voiceStart"),o.emit("voiceStart",void 0),m(!0),n.play("voiceStart"),b.start((C,Q)=>u(se=>Q?`${se}${C} `:se),()=>{if(m(!1),B.current){let C=Date.now()-B.current;Dt.debug("voiceStop (auto)",{durationMs:C}),o.emit("voiceStop",{durationMs:C}),B.current=null}})}},ee=Uu[e.composer.sendButton.icon];return r("div",{class:`${ze}-composer`,"data-testid":w.composer,children:[h.length>0?r("div",{class:`${ze}-attachments`,children:h.map(C=>r(Fl,{attachment:C,onRemove:()=>$(C.id)},C.id))}):null,r("div",{class:`${ze}-composer-row`,children:[r("div",{class:`${ze}-composer-actions`,children:[k?r("button",{type:"button",class:`${ze}-icon-btn`,onClick:()=>x.current?.click(),"aria-label":c.attach,"data-testid":w.composerAttach,children:r(rl,{})}):null,b.isSupported?r("button",{type:"button",class:`${ze}-icon-btn`,onClick:U,"aria-label":f?c.micStop:c.micStart,"aria-pressed":f,"data-recording":f?"true":void 0,"data-testid":w.composerVoice,children:r(al,{})}):null]}),r("textarea",{ref:y,class:`${ze}-textarea`,rows:1,value:d,placeholder:c.composerPlaceholder,onInput:C=>u(C.target.value),onKeyDown:N,"aria-label":c.composerPlaceholder,"data-testid":w.composerInput}),a?r("button",{type:"button",class:`${ze}-send`,onClick:l,"aria-label":c.stop,"data-testid":w.composerStop,children:r(ol,{})}):r("button",{type:"button",class:`${ze}-send`,"data-shape":e.composer.sendButton.shape,"data-variant":e.composer.sendButton.variant,onClick:re,disabled:!d.trim()&&h.length===0,"aria-label":c.send,"data-testid":w.composerSend,children:r(ee,{})})]}),r("input",{ref:x,type:"file",multiple:!0,accept:e.attachments.accept,onChange:Y,class:`${ze}-sr-only`,"data-testid":w.composerFileInput})]})}var Wu=P.cssPrefix;function zl({visible:e,strings:t}){return e?r("div",{class:`${Wu}-dropzone`,role:"status","aria-live":"polite",children:t.dropZone}):null}function Uo({containerRef:e,onDrop:t}){let[n,o]=R(!1);return T(()=>{let a=e.current;if(!a)return;let i=0,l=u=>{i+=1,u.dataTransfer?.types.includes("Files")&&(u.preventDefault(),o(!0))},s=()=>{i-=1,!(i>0)&&(i=0,o(!1))},c=u=>{u.dataTransfer?.types.includes("Files")&&u.preventDefault()},d=u=>{i=0,o(!1),u.dataTransfer&&(u.preventDefault(),t(u.dataTransfer.items))};return a.addEventListener("dragenter",l),a.addEventListener("dragleave",s),a.addEventListener("dragover",c),a.addEventListener("drop",d),()=>{a.removeEventListener("dragenter",l),a.removeEventListener("dragleave",s),a.removeEventListener("dragover",c),a.removeEventListener("drop",d)}},[e,t]),{visible:n}}function Ul({itemCount:e,initialFocusIndex:t}){let[n,o]=R(!1),a=D(null),i=D(null),[l,s]=R(-1),c=H(()=>{o(!1),s(-1),a.current?.focus()},[]),d=H(()=>o(_=>!_),[]);T(()=>{if(!n)return;let _=f=>{let m=i.current,y=a.current;if(!m||!y)return;let x=f.composedPath();x.includes(m)||x.includes(y)||(o(!1),s(-1))};return document.addEventListener("click",_,!0),()=>document.removeEventListener("click",_,!0)},[n]),T(()=>{if(!n||e===0)return;let _=t?.()??0,f=_<0||_>=e?0:_;s(f)},[n,e,t]),T(()=>{if(!n||l<0)return;i.current?.querySelectorAll("[role='menuitem']")?.[l]?.focus()},[n,l]);let u=H(_=>{(_.key==="ArrowDown"||_.key==="Enter"||_.key===" ")&&(_.preventDefault(),o(!0))},[]),h=H(_=>{if(e!==0)switch(_.key){case"Escape":_.preventDefault(),c();return;case"ArrowDown":_.preventDefault(),s(f=>(f+1)%e);return;case"ArrowUp":_.preventDefault(),s(f=>(f-1+e)%e);return;case"Home":_.preventDefault(),s(0);return;case"End":_.preventDefault(),s(e-1)}},[e,c]);return{open:n,focusIndex:l,triggerRef:a,menuRef:i,toggle:d,close:c,onTriggerKey:u,onMenuKey:h}}function Wl({items:e,triggerLabel:t}){let n=P.cssPrefix,o=Ul({itemCount:e.length}),a=s=>{s.disabled||(s.onSelect?.(),s.keepOpen||o.close())},i=(s,c)=>s.onSelectValue?.(c),l=(s,c)=>{let d=c.segments;if(!d?.length)return;let u=Math.max(0,d.findIndex(_=>_.value===c.value)),h=-1;if(s.key==="ArrowRight"||s.key==="Enter"||s.key===" ")h=(u+1)%d.length;else if(s.key==="ArrowLeft")h=(u-1+d.length)%d.length;else return;s.preventDefault(),s.stopPropagation(),i(c,d[h].value)};return r("div",{class:`${n}-menu-wrap`,children:[r("button",{ref:o.triggerRef,type:"button",class:`${n}-icon-btn`,"aria-label":t,"aria-haspopup":"menu","aria-expanded":o.open,title:t,onClick:o.toggle,onKeyDown:o.onTriggerKey,children:r(_l,{})}),o.open?r("div",{ref:o.menuRef,class:`${n}-menu`,role:"menu","aria-label":t,onKeyDown:o.onMenuKey,tabIndex:-1,children:e.map(s=>s.segments?r("div",{role:"menuitem",class:`${n}-menu-item ${n}-menu-item-segmented`,"aria-label":s.label,tabIndex:-1,onKeyDown:c=>l(c,s),children:[s.icon?r("span",{class:`${n}-menu-icon`,children:s.icon}):null,r("span",{class:`${n}-menu-label`,children:s.label}),r("span",{class:`${n}-segmented`,role:"group","aria-label":s.label,children:s.segments.map(c=>{let d=c.value===s.value;return r("button",{type:"button",role:"menuitemradio","aria-checked":d,class:`${n}-segment`,"data-on":d?"true":void 0,lang:c.lang,title:c.value,tabIndex:-1,"data-testid":`${w.langSegment}-${c.value}`,onClick:()=>i(s,c.value),children:c.label},c.value)})})]},s.id):r("button",{type:"button",role:"menuitem",class:`${n}-menu-item`,"aria-pressed":s.type==="switch"?s.on:void 0,disabled:s.disabled,onClick:()=>a(s),children:[s.icon?r("span",{class:`${n}-menu-icon`,children:s.icon}):null,r("span",{class:`${n}-menu-label`,children:s.label}),s.type==="switch"&&s.on?r("span",{class:`${n}-menu-check`,"aria-hidden":"true",children:r(Ln,{})}):null]},s.id))}):null]})}var ua=P.cssPrefix;function Vu(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 qu={normal:"large",large:"small",small:"normal"};function Gu(e){return e==="light"?r(kl,{}):e==="dark"?r(Sl,{}):r(wl,{})}function Ku(e){return(e.split("-")[0]??e).toUpperCase()}function et({panelProps:e,variant:t}){let{options:n,panelSize:o,feedback:a,onClose:i,onClear:l,onExpand:s,onFullscreen:c,onSoundToggle:d}=e,{onToggleHistory:u,onLocaleChange:h,onThemeChange:_,onTextSizeChange:f}=e,m=n.strings,y=n.mode,x=t==="chat",k=X(()=>a.mutedSig.value).value,S=new Set(n.actions),b=C=>S.has(C),I=typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches,G=C=>I?!1:Dn(C,y,o),re=n.themeMode,N={auto:m.themeAuto,light:m.themeLight,dark:m.themeDark},Y=n.textSize,$={small:m.textSizeSmall,normal:m.textSizeNormal,large:m.textSizeLarge},B=[];if(x&&b("clear")&&B.push({id:"clear",icon:r(vl,{}),label:m.newConversation,onSelect:l}),b("expand")&&G("expand")){let C=o==="expanded";B.push({id:"expand",icon:C?r(sl,{}):r(il,{}),label:C?m.collapse:m.expand,type:"switch",on:C,onSelect:s})}if(b("fullscreen")&&G("fullscreen")){let C=o==="fullscreen";B.push({id:"fullscreen",icon:C?r(cl,{}):r(ll,{}),label:C?m.exitFullscreen:m.fullscreen,type:"switch",on:C,onSelect:c})}x&&b("sound")&&B.push({id:"sound",icon:k?r(pl,{}):r(ul,{}),label:k?m.soundOff:m.soundOn,type:"switch",on:!k,onSelect:d}),b("theme")&&B.push({id:"theme",icon:Gu(re),label:`${m.theme}: ${N[re]}`,onSelect:()=>_(Vu(re)),keepOpen:!0}),b("textSize")&&B.push({id:"textSize",icon:r(ml,{}),label:`${m.textSize}: ${$[Y]}`,onSelect:()=>f(qu[Y]),keepOpen:!0}),b("language")&&n.availableLocales.length>1&&B.push({id:"language",icon:r(hl,{}),label:m.language,segments:n.availableLocales.map(C=>({value:C,label:Ku(C),lang:C})),value:n.locale,onSelectValue:h});let U=!!i&&Ho(y,o,n.actions),ee=x&&b("history");return r("div",{class:`${ua}-header-actions`,children:[ee?r("button",{type:"button",class:`${ua}-icon-btn`,onClick:u,"aria-label":m.history,title:m.history,"data-testid":w.actionHistory,children:r(gl,{})}):null,B.length>0?r(Wl,{items:B,triggerLabel:m.moreActions}):null,U?r("button",{type:"button",class:`${ua}-icon-btn`,onClick:i,"aria-label":m.close,title:m.close,"data-testid":w.actionClose,children:r(Ze,{})}):null]})}var ju=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Xu=/^https?:\/\/[^\s.]+\.[^\s]+$/i,Yu=/^[+]?[\d\s().-]{6,}$/;function tn(e,t){return e.replace(/\{(\w+)\}/g,(n,o)=>String(t[o]??`{${o}}`))}function Ju(e){return Array.isArray(e)?e.length:e&&e.trim()?1:0}function Qu(e,t,n){let o=e.required??!0,a=e.validation;if(e.type==="multiselect"){let l=Ju(t);return o&&l===0?n.formRequired:l===0?void 0:a?.minSelections!=null&&l<a.minSelections?tn(n.formChooseAtLeast,{min:a.minSelections}):a?.maxSelections!=null&&l>a.maxSelections?tn(n.formChooseAtMost,{max:a.maxSelections}):void 0}let i=typeof t=="string"?t.trim():"";if(!i)return o?n.formRequired:void 0;switch(e.type){case"email":if(!ju.test(i))return n.formInvalidEmail;break;case"url":if(!Xu.test(i))return n.formInvalidUrl;break;case"tel":if(!Yu.test(i))return n.formInvalidTel;break;case"number":{let l=Number(i);if(!Number.isFinite(l))return n.formInvalidNumber;if(a?.min!=null&&l<a.min)return tn(n.formNumberTooSmall,{min:a.min});if(a?.max!=null&&l>a.max)return tn(n.formNumberTooLarge,{max:a.max});break}default:break}if(a?.minLength!=null&&i.length<a.minLength)return tn(n.formTooShort,{min:a.minLength});if(a?.maxLength!=null&&i.length>a.maxLength)return tn(n.formTooLong,{max:a.maxLength});if(a?.pattern)try{if(!new RegExp(a.pattern).test(i))return n.formPatternMismatch}catch{}}function Vl(e,t,n){let o={};for(let a of e){let i=Qu(a,t[a.name],n);i&&(o[a.name]=i)}return o}function ql(e){let t={};for(let[n,o]of Object.entries(e)){let a=Array.isArray(o)?o.join(", "):o;a&&a.trim()&&(t[n]=a.trim())}return t}var ge=P.cssPrefix,Wo="__other__";function Vo({fields:e,strings:t,submitLabel:n,onSubmit:o,skipLabel:a,onSkip:i,footerHint:l,submitOnEnter:s,disabled:c,rootTestId:d,submitTestId:u,skipTestId:h}){let[_,f]=R(()=>np(e)),[m,y]=R({}),[x,k]=R({}),S=N=>{x[N]&&k(Y=>({...Y,[N]:""}))},b=(N,Y)=>{f($=>({...$,[N]:Y})),S(N)},I=(N,Y)=>{y($=>({...$,[N]:Y})),S(N)},G=N=>{if(N.preventDefault(),c)return;let Y=op(e,_,m),$=Vl(e,Y,t);if(Object.keys($).length>0){k($);return}o(ql(Y))},re=N=>{!s||N.key!=="Enter"||N.shiftKey||N.isComposing||N.target?.tagName==="TEXTAREA"&&G(N)};return r("form",{class:`${ge}-form`,onSubmit:G,onKeyDown:re,"data-testid":d,noValidate:!0,children:[e.map(N=>r(Zu,{field:N,value:_[N.name],otherText:m[N.name]??"",error:x[N.name],disabled:c,strings:t,onChange:Y=>b(N.name,Y),onOtherChange:Y=>I(N.name,Y)},N.name)),r("div",{class:`${ge}-form-actions`,children:[l?r("span",{class:`${ge}-form-hint`,children:l}):null,a&&i?r("button",{type:"button",class:`${ge}-form-skip`,onClick:i,disabled:c,"data-testid":h,children:a}):null,r("button",{type:"submit",class:`${ge}-form-submit`,disabled:c,"data-testid":u,children:n})]})]})}function Zu({field:e,value:t,otherText:n,error:o,disabled:a,strings:i,onChange:l,onOtherChange:s}){let c=we(w.formField,e.name),d=ep({field:e,value:t,otherText:n,disabled:a,strings:i,onChange:l,onOtherChange:s,fieldTid:c});return r("label",{class:`${ge}-field`,"data-field":e.name,"data-invalid":o?"true":void 0,children:[r("span",{class:`${ge}-field-label`,children:[e.label,e.required??!0?r("span",{class:`${ge}-field-req`,"aria-hidden":"true",children:" *"}):null]}),d,e.validationHint&&!o?r("span",{class:`${ge}-field-hint`,children:e.validationHint}):null,o?r("span",{class:`${ge}-field-error`,role:"alert",children:o}):null]})}function ep(e){let{field:t,value:n,otherText:o,disabled:a,strings:i,onChange:l,onOtherChange:s,fieldTid:c}=e,d=typeof n=="string"?n:"";switch(t.type){case"textarea":return r("textarea",{class:`${ge}-field-input`,rows:3,value:d,placeholder:t.placeholder,disabled:a,onInput:u=>l(u.target.value),"data-testid":c});case"select":return r("select",{class:`${ge}-field-input`,value:d,disabled:a,onChange:u=>l(u.target.value),"data-testid":c,children:[r("option",{value:"",children:t.placeholder??"\u2014"}),(t.options??[]).map(u=>r("option",{value:u.value,children:u.label??u.value},u.value))]});case"radio":{let u=t.allowOther&&d===Wo;return r("div",{class:`${ge}-field-choices`,role:"radiogroup","data-testid":c,children:[(t.options??[]).map(h=>r("label",{class:`${ge}-choice`,children:[r("input",{type:"radio",name:`${ge}-${t.name}`,checked:d===h.value,disabled:a,onChange:()=>l(h.value)}),r("span",{children:h.label??h.value})]},h.value)),t.allowOther?r("label",{class:`${ge}-choice`,children:[r("input",{type:"radio",name:`${ge}-${t.name}`,checked:d===Wo,disabled:a,onChange:()=>l(Wo)}),r("span",{children:i.formOther})]}):null,u?r("input",{class:`${ge}-field-input`,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:h=>s(h.target.value)}):null]})}case"checkbox":return r("label",{class:`${ge}-choice`,children:[r("input",{type:"checkbox",checked:d==="true",disabled:a,onChange:u=>l(u.target.checked?"true":""),"data-testid":c}),r("span",{children:t.placeholder??t.label})]});case"multiselect":{let u=Array.isArray(n)?n:[],h=(_,f)=>l(f?[...u,_]:u.filter(m=>m!==_));return r("div",{class:`${ge}-field-choices`,"data-testid":c,children:[(t.options??[]).map(_=>r("label",{class:`${ge}-choice`,children:[r("input",{type:"checkbox",checked:u.includes(_.value),disabled:a,onChange:f=>h(_.value,f.target.checked)}),r("span",{children:_.label??_.value})]},_.value)),t.allowOther||(t.options??[]).length===0?r("textarea",{class:`${ge}-field-input`,rows:2,value:o,placeholder:t.placeholder??i.formOtherPlaceholder,disabled:a,onInput:_=>s(_.target.value)}):null]})}default:return r("input",{class:`${ge}-field-input`,type:tp(t.type),value:d,placeholder:t.placeholder,disabled:a,onInput:u=>l(u.target.value),"data-testid":c})}}function tp(e){switch(e){case"number":case"email":case"tel":case"url":case"date":case"time":return e;default:return"text"}}function np(e){let t={};for(let n of e)n.defaultValue!=null&&(t[n.name]=n.type==="multiselect"?n.defaultValue.split(",").map(o=>o.trim()).filter(Boolean):n.defaultValue);return t}function op(e,t,n){let o={...t};for(let a of e){let i=n[a.name]?.trim();if(a.type==="radio"&&a.allowOther&&t[a.name]===Wo)o[a.name]=i??"";else if(a.type==="multiselect"&&i){let l=i.split(/[,\n;]+/).map(c=>c.trim()).filter(Boolean),s=Array.isArray(t[a.name])?t[a.name]:[];o[a.name]=[...s,...l]}}return o}var tt=P.cssPrefix;function pa({form:e,strings:t,onSubmit:n,onSkip:o}){return r("div",{class:`${tt}-form-gate`,"data-testid":w.formGate,children:[e.title?r("h3",{class:`${tt}-form-gate-title`,children:e.title}):null,e.description?r("p",{class:`${tt}-form-gate-desc`,children:e.description}):null,r(Vo,{fields:e.fields,strings:t,submitLabel:e.submitLabel??t.formSubmit,onSubmit:n,skipLabel:e.skippable?t.formSkip:void 0,onSkip:e.skippable?o:void 0,submitTestId:w.formSubmit,skipTestId:w.formSkip})]})}function Gl({marker:e,strings:t,onFill:n}){let o=e.outcome==="skipped",a=o?t.formSkipped:t.formSubmitted,i=e.title?r(ne,{children:[r("span",{children:e.title}),r("span",{class:`${tt}-sr-only`,children:a})]}):r("span",{children:a}),l=e.form?.reviewable??!1,s=!o&&l&&e.values&&Object.keys(e.values).length>0?e.values:null;if(s){let c=d=>e.form?.fields.find(u=>u.name===d)?.label??d;return r("details",{class:`${tt}-form-done`,"data-outcome":e.outcome,"data-testid":w.formDone,children:[r("summary",{class:`${tt}-form-done-summary`,"data-testid":w.formDoneToggle,children:[r(Ln,{}),i,r(Zt,{})]}),r("dl",{class:`${tt}-form-answers`,"data-testid":w.formAnswers,children:Object.entries(s).map(([d,u])=>r("div",{class:`${tt}-form-answer`,children:[r("dt",{children:c(d)}),r("dd",{children:u})]},d))})]})}return r("div",{class:`${tt}-form-done`,"data-outcome":e.outcome,"data-testid":w.formDone,role:"status",children:[o?r(fl,{}):r(Ln,{}),i,o&&e.form?.reopenable&&n?r("button",{type:"button",class:`${tt}-form-done-fill`,"data-testid":w.formFill,onClick:n,children:t.formFillOut}):null]})}function Kl(e){if(!e)return!1;let t=e.startsWith("tool:")?e.slice(5):e;return t==="ask-user-questions"||t==="ask_user_questions"}var ga=1,Xl=2,Yl=4,Jl=8,Ql=16;function rp(e){switch(e){case ga:return"href";case Xl:return"src";case Yl:return"class";case Jl:return"checked";case Ql:return"start"}}var ap=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}},ip=ap;var jl=24;function va(e){let t=new Uint32Array(jl);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(jl),indent:"",indent_len:0,table_state:0}}function Zl(e){e.pending.length>0&&Te(e,`
12
+ `)}function oe(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 be(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&&be(e),e.len+=1,e.tokens[e.len]=t,e.token=t,e.renderer.add_token(e.renderer.data,t)}function sp(e,t,n){for(;n<=e.len;){if(e.tokens[n]===t)return n;n+=1}return-1}function Ot(e,t){for(e.fence_start=0;e.len>t;)be(e)}function qo(e,t){let n=0;for(let o=0;o<=e.len&&(t-=e.spaces[o],!(t<0));o+=1)switch(e.tokens[o]){case 9:case 10:case 20:case 25:n=o;break}for(;e.len>n;)be(e);return t}function ma(e,t){let n=-1,o=-1;for(let a=e.blockquote_idx+1;a<=e.len;a+=1)if(e.tokens[a]===25){if(e.indent_len<e.spaces[a]){o=-1;break}o=a}else e.tokens[a]===t&&(n=a);return o===-1?n===-1?(Ot(e,e.blockquote_idx),ie(e,t),!0):(Ot(e,n),!1):(Ot(e,o),ie(e,t),!0)}function fa(e,t){ie(e,25),e.spaces[e.len]=e.indent_len+t,ct(e),e.token=103}function ct(e){e.indent="",e.indent_len=0,e.pending=""}function ha(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 lp(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 cp(e){return ha(e)||lp(e)}function Te(e,t){for(let n of t){if(e.token===101){switch(n){case" ":e.indent_len+=1;continue;case" ":e.indent_len+=4;continue}let a=qo(e,e.indent_len);e.indent_len=0,e.token=e.tokens[e.len],a>0&&Te(e," ".repeat(a))}let o=e.pending+n;switch(e.token){case 21:case 1:case 20:case 24:case 23:switch(console.assert(e.text.length===0,"Root should not have any text"),e.pending[0]){case void 0:e.pending=n;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=1;continue;case" ":console.assert(e.pending.length===1),e.pending=n,e.indent+=" ",e.indent_len+=4;continue;case`
13
+ `:if(console.assert(e.pending.length===1),e.tokens[e.len]===25&&e.token===21){be(e),ct(e),e.pending=n;continue}Ot(e,e.blockquote_idx),ct(e),e.blockquote_idx=0,e.fence_start=0,e.pending=n;continue;case"#":switch(n){case"#":if(e.pending.length<6){e.pending=o;continue}break;case" ":qo(e,e.indent_len),ie(e,ip(e.pending.length)),ct(e);continue}break;case">":{let i=sp(e,20,e.blockquote_idx+1);i===-1?(Ot(e,e.blockquote_idx),e.blockquote_idx+=1,e.fence_start=0,ie(e,20)):e.blockquote_idx=i,ct(e),e.pending=n;continue}case"-":case"*":case"_":if(e.hr_chars===0&&(console.assert(e.pending.length===1,"Pending should be one character"),e.hr_chars=1,e.hr_char=e.pending),e.hr_chars>0){switch(n){case e.hr_char:e.hr_chars+=1,e.pending=o;continue;case" ":e.pending=o;continue;case`
14
+ `:if(e.hr_chars<3)break;qo(e,e.indent_len),e.renderer.add_token(e.renderer.data,22),e.renderer.end_token(e.renderer.data),ct(e),e.hr_chars=0;continue}e.hr_chars=0}if(e.pending[0]!=="_"&&e.pending[1]===" "){ma(e,23),fa(e,2),Te(e,o.slice(2));continue}break;case"`":if(e.pending.length<3){if(n==="`"){e.pending=o,e.fence_start=o.length;continue}e.fence_start=0;break}switch(n){case"`":e.pending.length===e.fence_start?(e.pending=o,e.fence_start=o.length):(ie(e,2),ct(e),e.fence_start=0,Te(e,o));continue;case`
15
+ `:{qo(e,e.indent_len),ie(e,10),e.pending.length>e.fence_start&&e.renderer.set_attr(e.renderer.data,Yl,e.pending.slice(e.fence_start)),ct(e),e.token=101;continue}default:e.pending=o;continue}case"+":if(n!==" ")break;ma(e,23),fa(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;ma(e,24)&&e.pending!=="1."&&e.renderer.set_attr(e.renderer.data,Ql,e.pending.slice(0,-1)),fa(e,e.pending.length+1);continue}else{let i=n.charCodeAt(0);if(i===46||ha(i)){e.pending=o;continue}}break;case"|":Ot(e,e.blockquote_idx),ie(e,27),ie(e,28),e.pending="",Te(e,n);continue}let a=o;if(e.token===21)e.token=e.tokens[e.len],e.renderer.add_token(e.renderer.data,21),e.renderer.end_token(e.renderer.data);else if(e.indent_len>=4){let i=0;for(;i<4;i+=1)if(e.indent[i]===" "){i=i+1;break}a=e.indent.slice(i)+o,ie(e,9)}else ie(e,2);ct(e),Te(e,a);continue;case 27:if(e.table_state===1)switch(n){case"-":case" ":case"|":case":":e.pending=o;continue;case`
16
+ `:e.table_state=2,e.pending="";continue;default:be(e),e.table_state=0;break}else switch(e.pending){case"|":ie(e,28),e.pending="",Te(e,n);continue;case`
17
+ `:be(e),e.pending="",e.table_state=0,Te(e,n);continue}break;case 28:switch(e.pending){case"":break;case"|":ie(e,29),be(e),e.pending="",Te(e,n);continue;case`
18
+ `:be(e),e.table_state=Math.min(e.table_state+1,2),e.pending="",Te(e,n);continue;default:ie(e,29),Te(e,n);continue}break;case 29:if(e.pending==="|"){oe(e),be(e),e.pending="",Te(e,n);continue}break;case 9:switch(o){case`
19
19
  `:case`
20
20
  `:case`
21
21
  `:case`
@@ -25,16 +25,16 @@ ${a}`:a;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(!t||t==="[DONE]")
25
25
  `:case`
26
26
  `:case`
27
27
  `:case`
28
- `:e.pending=o;continue;default:e.pending.length!==0?(ne(e),me(e),e.pending=n):e.text+=n;continue}case 10:switch(n){case"`":e.pending=o;continue;case`
29
- `:if(o.length===e.fence_start+e.fence_end+1){ne(e),me(e),e.pending="",e.fence_start=0,e.fence_end=0,e.token=101;continue}e.token=101;break;case" ":if(e.pending[0]===`
30
- `){e.pending=o,e.fence_end+=1;continue}break}e.text+=e.pending,e.pending=n,e.fence_end=1;continue;case 11:switch(n){case"`":o.length===e.fence_start+ +(e.pending[0]===" ")?(ne(e),me(e),e.pending="",e.fence_start=0):e.pending=o;continue;case`
31
- `:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,ne(e);continue;case" ":e.text+=e.pending,e.pending=n;continue;default:e.text+=o,e.pending="";continue}case 103:switch(e.pending.length){case 0:if(n!=="[")break;e.pending=o;continue;case 1:if(n!==" "&&n!=="x")break;e.pending=o;continue;case 2:if(n!=="]")break;e.pending=o;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,Ul,""),e.renderer.end_token(e.renderer.data),e.pending=" ";continue}e.token=e.tokens[e.len],e.pending="",Ce(e,o);continue;case 14:case 15:{let i="*",l=12;if(e.token===15&&(i="_",l=13),i===e.pending){if(ne(e),i===n){me(e),e.pending="";continue}oe(e,l),e.pending=n;continue}break}case 12:case 13:{let i="*",l=14;switch(e.token===13&&(i="_",l=15),e.pending){case i:i===n?e.tokens[e.len-1]===l?e.pending=o:(ne(e),oe(e,l),e.pending=""):(ne(e),me(e),e.pending=n);continue;case i+i:let s=e.token;ne(e),me(e),me(e),i!==n?(oe(e,s),e.pending=n):e.pending="";continue}break}case 16:if(o==="~~"){ne(e),me(e),e.pending="";continue}break;case 105:n===`
32
- `?(ne(e),oe(e,30),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",Ce(e,n));continue;case 30:if(o==="\\]"||o==="$$"){ne(e),me(e),e.pending="";continue}break;case 31:if(o==="\\)"||e.pending[0]==="$"){ne(e),me(e),n===")"?e.pending="":e.pending=n;continue}break;case 102:o==="http://"||o==="https://"?(ne(e),oe(e,18),e.pending=o,e.text=o):"http:/"[e.pending.length]===n||"https:/"[e.pending.length]===n?e.pending=o:(e.token=e.tokens[e.len],Ce(e,n));continue;case 17:case 19:if(e.pending==="]"){ne(e),n==="("?e.pending=o:(me(e),e.pending=n);continue}if(e.pending[0]==="]"&&e.pending[1]==="("){if(n===")"){let i=e.token===17?da:Fl,l=e.pending.slice(2);e.renderer.set_attr(e.renderer.data,i,l),me(e),e.pending=""}else e.pending+=n;continue}break;case 18:n===" "||n===`
33
- `||n==="\\"?(e.renderer.set_attr(e.renderer.data,da,e.pending),ne(e),me(e),e.pending=n):(e.text+=n,e.pending=o);continue;case 104:if(o.startsWith("<br")){if(o.length===3||n===" "||n==="/"&&(o.length===4||e.pending[e.pending.length-1]===" ")){e.pending=o;continue}if(n===">"){ne(e),e.token=e.tokens[e.len],e.renderer.add_token(e.renderer.data,21),e.renderer.end_token(e.renderer.data),e.pending="";continue}}e.token=e.tokens[e.len],e.text+="<",e.pending=e.pending.slice(1),Ce(e,n);continue}switch(e.pending[0]){case"\\":if(e.token===19||e.token===30||e.token===31)break;switch(n){case"(":ne(e),oe(e,31),e.pending="";continue;case"[":e.token=105,e.pending=o;continue;case`
34
- `:e.pending=n;continue;default:let a=n.charCodeAt(0);e.pending="",e.text+=_a(a)||a>=65&&a<=90||a>=97&&a<=122?o:n;continue}case`
35
- `:switch(e.token){case 19:case 30:case 31:break;case 3:case 4:case 5:case 6:case 7:case 8:ne(e),Tt(e,e.blockquote_idx),e.blockquote_idx=0,e.pending=n;continue;default:ne(e),e.pending=n,e.token=21,e.blockquote_idx=0;continue}break;case"<":if(e.token!==19&&e.token!==30&&e.token!==31){ne(e),e.pending=o,e.token=104;continue}break;case"`":if(e.token===19)break;n==="`"?(e.fence_start+=1,e.pending=o):(e.fence_start+=1,ne(e),oe(e,11),e.text=n===" "||n===`
28
+ `:e.pending=o;continue;default:e.pending.length!==0?(oe(e),be(e),e.pending=n):e.text+=n;continue}case 10:switch(n){case"`":e.pending=o;continue;case`
29
+ `:if(o.length===e.fence_start+e.fence_end+1){oe(e),be(e),e.pending="",e.fence_start=0,e.fence_end=0,e.token=101;continue}e.token=101;break;case" ":if(e.pending[0]===`
30
+ `){e.pending=o,e.fence_end+=1;continue}break}e.text+=e.pending,e.pending=n,e.fence_end=1;continue;case 11:switch(n){case"`":o.length===e.fence_start+ +(e.pending[0]===" ")?(oe(e),be(e),e.pending="",e.fence_start=0):e.pending=o;continue;case`
31
+ `:e.text+=e.pending,e.pending="",e.token=21,e.blockquote_idx=0,oe(e);continue;case" ":e.text+=e.pending,e.pending=n;continue;default:e.text+=o,e.pending="";continue}case 103:switch(e.pending.length){case 0:if(n!=="[")break;e.pending=o;continue;case 1:if(n!==" "&&n!=="x")break;e.pending=o;continue;case 2:if(n!=="]")break;e.pending=o;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,Jl,""),e.renderer.end_token(e.renderer.data),e.pending=" ";continue}e.token=e.tokens[e.len],e.pending="",Te(e,o);continue;case 14:case 15:{let i="*",l=12;if(e.token===15&&(i="_",l=13),i===e.pending){if(oe(e),i===n){be(e),e.pending="";continue}ie(e,l),e.pending=n;continue}break}case 12:case 13:{let i="*",l=14;switch(e.token===13&&(i="_",l=15),e.pending){case i:i===n?e.tokens[e.len-1]===l?e.pending=o:(oe(e),ie(e,l),e.pending=""):(oe(e),be(e),e.pending=n);continue;case i+i:let s=e.token;oe(e),be(e),be(e),i!==n?(ie(e,s),e.pending=n):e.pending="";continue}break}case 16:if(o==="~~"){oe(e),be(e),e.pending="";continue}break;case 105:n===`
32
+ `?(oe(e),ie(e,30),e.pending=""):(e.token=e.tokens[e.len],e.pending[0]==="\\"?e.text+="[":e.text+="$$",e.pending="",Te(e,n));continue;case 30:if(o==="\\]"||o==="$$"){oe(e),be(e),e.pending="";continue}break;case 31:if(o==="\\)"||e.pending[0]==="$"){oe(e),be(e),n===")"?e.pending="":e.pending=n;continue}break;case 102:o==="http://"||o==="https://"?(oe(e),ie(e,18),e.pending=o,e.text=o):"http:/"[e.pending.length]===n||"https:/"[e.pending.length]===n?e.pending=o:(e.token=e.tokens[e.len],Te(e,n));continue;case 17:case 19:if(e.pending==="]"){oe(e),n==="("?e.pending=o:(be(e),e.pending=n);continue}if(e.pending[0]==="]"&&e.pending[1]==="("){if(n===")"){let i=e.token===17?ga:Xl,l=e.pending.slice(2);e.renderer.set_attr(e.renderer.data,i,l),be(e),e.pending=""}else e.pending+=n;continue}break;case 18:n===" "||n===`
33
+ `||n==="\\"?(e.renderer.set_attr(e.renderer.data,ga,e.pending),oe(e),be(e),e.pending=n):(e.text+=n,e.pending=o);continue;case 104:if(o.startsWith("<br")){if(o.length===3||n===" "||n==="/"&&(o.length===4||e.pending[e.pending.length-1]===" ")){e.pending=o;continue}if(n===">"){oe(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),Te(e,n);continue}switch(e.pending[0]){case"\\":if(e.token===19||e.token===30||e.token===31)break;switch(n){case"(":oe(e),ie(e,31),e.pending="";continue;case"[":e.token=105,e.pending=o;continue;case`
34
+ `:e.pending=n;continue;default:let a=n.charCodeAt(0);e.pending="",e.text+=ha(a)||a>=65&&a<=90||a>=97&&a<=122?o:n;continue}case`
35
+ `:switch(e.token){case 19:case 30:case 31:break;case 3:case 4:case 5:case 6:case 7:case 8:oe(e),Ot(e,e.blockquote_idx),e.blockquote_idx=0,e.pending=n;continue;default:oe(e),e.pending=n,e.token=21,e.blockquote_idx=0;continue}break;case"<":if(e.token!==19&&e.token!==30&&e.token!==31){oe(e),e.pending=o,e.token=104;continue}break;case"`":if(e.token===19)break;n==="`"?(e.fence_start+=1,e.pending=o):(e.fence_start+=1,oe(e),ie(e,11),e.text=n===" "||n===`
36
36
  `?"":n,e.pending="");continue;case"_":case"*":{if(e.token===19||e.token===30||e.token===31||e.token===14)break;let a=12,i=14,l=e.pending[0];if(l==="_"&&(a=13,i=15),e.pending.length===1){if(l===n){e.pending=o;continue}if(n!==" "&&n!==`
37
- `){ne(e),oe(e,a),e.pending=n;continue}}else{if(l===n){ne(e),oe(e,i),oe(e,a),e.pending="";continue}if(n!==" "&&n!==`
38
- `){ne(e),oe(e,i),e.pending=n;continue}}break}case"~":if(e.token!==19&&e.token!==16){if(e.pending==="~"){if(n==="~"){e.pending=o;continue}}else if(n!==" "&&n!==`
39
- `){ne(e),oe(e,16),e.pending=n;continue}}break;case"$":if(e.token!==19&&e.token!==16&&e.pending==="$")if(n==="$"){e.token=105,e.pending=o;continue}else{if(rp(n.charCodeAt(0)))break;ne(e),oe(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){ne(e),oe(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){ne(e),oe(e,19),e.pending="";continue}break;case" ":if(e.pending.length===1&&n===" ")continue;break}if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n==="h"&&(e.pending===" "||e.pending==="")){e.text+=e.pending,e.pending=n,e.token=102;continue}e.text+=e.pending,e.pending=n}ne(e)}function pa(e){return{add_token:ap,end_token:ip,add_text:sp,set_attr:lp,data:{nodes:[e,,,,,],index:0}}}function ap(e,t){let n=e.nodes[e.index],o;switch(t){case 1:return;case 20:o=document.createElement("blockquote");break;case 2:o=document.createElement("p");break;case 21:o=document.createElement("br");break;case 22:o=document.createElement("hr");break;case 3:o=document.createElement("h1");break;case 4:o=document.createElement("h2");break;case 5:o=document.createElement("h3");break;case 6:o=document.createElement("h4");break;case 7:o=document.createElement("h5");break;case 8:o=document.createElement("h6");break;case 12:case 13:o=document.createElement("em");break;case 14:case 15:o=document.createElement("strong");break;case 16:o=document.createElement("s");break;case 11:o=document.createElement("code");break;case 18:case 17:o=document.createElement("a");break;case 19:o=document.createElement("img");break;case 23:o=document.createElement("ul");break;case 24:o=document.createElement("ol");break;case 25:o=document.createElement("li");break;case 26:let a=o=document.createElement("input");a.type="checkbox",a.disabled=!0;break;case 9:case 10:n=n.appendChild(document.createElement("pre")),o=document.createElement("code");break;case 27:o=document.createElement("table");break;case 28:switch(n.children.length){case 0:n=n.appendChild(document.createElement("thead"));break;case 1:n=n.appendChild(document.createElement("tbody"));break;default:n=n.children[1]}o=document.createElement("tr");break;case 29:o=document.createElement(n.parentElement?.tagName==="THEAD"?"th":"td");break;case 30:o=document.createElement("equation-block");break;case 31:o=document.createElement("equation-inline");break}e.nodes[++e.index]=n.appendChild(o)}function ip(e){e.index-=1}function sp(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function lp(e,t,n){e.nodes[e.index].setAttribute(Zu(t),n)}function Ho({textSig:e,doneSig:t}){let n=D(null);return Pt(()=>{let o=n.current;if(!o)return;o.classList.add(`${y.cssPrefix}-md`);let a=pa(o),i=ua(a),l=0,s=ot(()=>{let u=e.value,_=t.value;u.length<l&&(o.replaceChildren(),a=pa(o),i=ua(a),l=0);let g=u.slice(l);g&&Ce(i,g),l=u.length,_&&ql(i)}),c=new MutationObserver(u=>{for(let _ of u)for(let g of _.addedNodes){if(!(g instanceof HTMLElement))continue;let f=g.matches?.("a")?[g]:[...g.querySelectorAll?.("a")??[]];for(let m of f)Gl(m)}});c.observe(o,{childList:!0,subtree:!0});for(let u of o.querySelectorAll("a"))Gl(u);let d=u=>{let _=u.target?.closest?.("a");if(!_||!(_ instanceof HTMLAnchorElement))return;let g=_.getAttribute("href")??"";!g||g.startsWith("#")||(u.preventDefault(),window.open(g,"_blank","noopener,noreferrer"))};return o.addEventListener("click",d),()=>{s(),c.disconnect(),o.removeEventListener("click",d)}},[e,t]),r("div",{ref:n})}function Vl({text:e}){let t=Re(()=>H(e),[e]),n=Re(()=>H(!0),[]);return r(Ho,{textSig:t,doneSig:n})}function Gl(e){let t=e.getAttribute("href")??"";if(!t||t.startsWith("#"))return;e.target!=="_blank"&&(e.target="_blank");let n=new Set((e.rel||"").split(/\s+/).filter(Boolean));n.add("noopener"),n.add("noreferrer"),e.rel=[...n].join(" ")}var Kt=y.cssPrefix;function Kl({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?r("a",{class:`${Kt}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":w.source,children:[r("span",{class:`${Kt}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),r("span",{class:`${Kt}-source-label`,children:n})]}):r("span",{class:`${Kt}-source`,"data-testid":w.source,children:[r("span",{class:`${Kt}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),r("span",{class:`${Kt}-source-label`,children:n})]})}var it=y.cssPrefix;function Bo(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function Fo(e,t){let n=e==="output-available"||e==="output-error"||e==="output-denied",o=e==="approval-responded"||t?.approved!==void 0;return{terminal:n,responded:o,decided:n||o}}function dp(e,t){return e==="output-error"?"error":e==="output-denied"||t?.approved===!1?"denied":e==="output-available"?"completed":e==="approval-responded"||t?.approved===!0?"responded":e==="approval-requested"?"awaiting":"running"}function _p({status:e}){return e==="denied"||e==="error"||e==="superseded"?r(Pl,{}):e==="completed"||e==="responded"?r(yl,{}):r(xl,{})}function up(e,t){switch(e){case"awaiting":return t.statusAwaiting;case"responded":return t.statusResponded;case"completed":return t.statusCompleted;case"denied":return t.statusDenied;case"error":return t.statusError;case"superseded":return t.statusSuperseded;default:return t.statusRunning}}function pp({state:e,approval:t,strings:n,superseded:o}){let a=dp(e,t),i=o&&(a==="awaiting"||a==="running")?"superseded":a;return r("span",{class:`${it}-toolui-badge ${it}-toolui-status`,"data-status":i,children:[r("span",{class:`${it}-toolui-status-icon`,children:r(_p,{status:i})}),up(i,n)]})}function zo({name:e,state:t,approval:n,strings:o,superseded:a}){return r(te,{children:[r("span",{class:`${it}-toolui-wrench`,children:r(bl,{})}),r("strong",{class:`${it}-toolui-title`,children:e}),r(pp,{state:t,approval:n,strings:o,superseded:a}),r("span",{class:`${it}-toolui-chevron`,children:r(Co,{})})]})}function mt({label:e,value:t,error:n}){let o=n?String(t??""):Uo(ma(t));return o?r("div",{class:`${it}-toolui-section`,children:[r("span",{class:`${it}-toolui-label`,children:e}),r("pre",{class:`${it}-toolui-code`,"data-error":n?"true":void 0,children:o})]}):null}function ma(e){if(e&&typeof e=="object"){let t=e;if(t.storage==="tool-result-ref"&&"summary"in t)return t.summary}return e}function Uo(e){if(e==null)return"";try{let t=typeof e=="string"?e:JSON.stringify(e,null,2);return!t||t==="{}"||t==="[]"||t==='""'?"":t.length>800?`${t.slice(0,800)}\u2026`:t}catch{return""}}var Ae=y.cssPrefix;function jl({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=J(()=>e.approvalSig.value),s=J(()=>e.stateSig.value),c=J(()=>e.inputSig.value),d=J(()=>e.outputSig.value),u=J(()=>e.errorSig.value),_=Bo(e.toolName),g=l.value?.approved,{terminal:f,responded:m,decided:P}=Fo(s.value,l.value),v=m&&n&&!f,b=o&&!P,S=e.toolCallId;return r("div",{class:`${Ae}-toolui-group`,"data-testid":P?w.toolDecision:w.toolApproval,children:[r("details",{class:`${Ae}-toolui ${Ae}-toolui-collapsible`,children:[r("summary",{class:`${Ae}-toolui-head`,children:r(zo,{name:_,state:s.value,approval:l.value,strings:t,superseded:b})}),r(mt,{label:t.toolParameters,value:c.value}),d.value!==void 0?r(mt,{label:t.toolResult,value:d.value}):null,u.value?r(mt,{label:t.statusError,value:u.value,error:!0}):null]}),b||f?null:r("div",{class:`${Ae}-toolui ${Ae}-toolui-body`,children:[m?r(te,{children:[r("p",{class:`${Ae}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",g?t.approve:t.reject),l.value?.reason?` \u2014 ${l.value.reason}`:""]}),v?r("p",{class:`${Ae}-toolui-subtle`,children:t.approvalEditHint}):null,!v&&!f?r("p",{class:`${Ae}-toolui-subtle`,children:t.approvalSubmitting}):null]}):r(te,{children:[r("p",{class:`${Ae}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",_)}),r("p",{class:`${Ae}-toolui-subtle`,children:t.approvalBody})]}),!P&&n?r("div",{class:`${Ae}-toolui-actions`,children:[r("button",{type:"button",class:`${Ae}-form-skip`,onClick:()=>a(S,!1),"data-testid":w.toolReject,children:t.reject}),r("button",{type:"button",class:`${Ae}-form-submit`,onClick:()=>a(S,!0),"data-testid":w.toolApprove,children:t.approve})]}):v?r("div",{class:`${Ae}-toolui-actions`,children:r("button",{type:"button",class:`${Ae}-form-skip`,onClick:()=>i(S),"data-testid":w.toolEdit,children:t.edit})}):null]})]})}var mp=new Set(["text","email","phone","number","date","single-select","multi-select","boolean"]);function Xl(e){let t=e&&typeof e=="object"?e:{},o=(Array.isArray(t.questions)?t.questions:[]).map(fp).filter(a=>a!==null);return{intro:Wo(t.intro),questions:o}}function fp(e,t){if(!e||typeof e!="object")return null;let n=e,o=mp.has(n.type)?n.type:"text";return{key:Wo(n.key)??`q${t+1}`,question:Wo(n.question)??"Please provide the missing information.",type:o,options:Array.isArray(n.options)?n.options.filter(a=>typeof a=="string"&&a.trim().length>0):void 0,required:typeof n.required=="boolean"?n.required:void 0,helpText:Wo(n.helpText)}}function gp(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 Yl(e,t,n){return e.questions.map(o=>{let a=gp(o.type),i=o.type==="boolean"?[{value:"yes",label:t},{value:"no",label:n}]:(o.options??[]).map(l=>({value:l,label:l}));return{name:o.key,label:o.question,type:a,required:o.required??!1,options:i.length>0?i:void 0,validationHint:o.helpText}})}function Wo(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var ge=y.cssPrefix;function Jl({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=J(()=>e.stateSig.value),s=J(()=>e.approvalSig.value),c=J(()=>Xl(e.inputSig.value)),{terminal:d,responded:u,decided:_}=Fo(l.value,s.value),g=c.value;if(_)return r(bp,{part:e,strings:t,req:g,editable:u&&n&&!d,onEdit:()=>i(e.toolCallId)});let f=o;return r("div",{class:`${ge}-toolui${f?` ${ge}-toolui-stale`:""}`,"data-testid":w.toolAskQuestions,children:[r("div",{class:`${ge}-toolui-head`,children:f?r(te,{children:[r("span",{class:`${ge}-toolui-badge ${ge}-toolui-badge-accent`,children:t.inputBadge}),r("span",{class:`${ge}-toolui-badge ${ge}-toolui-badge-muted`,children:t.statusSuperseded})]}):r("span",{class:`${ge}-toolui-badge ${ge}-toolui-badge-accent`,children:t.inputRequired})}),g.intro?r("div",{class:`${ge}-toolui-desc`,children:g.intro}):null,f?null:r(hp,{req:g,strings:t,resolve:(m,P)=>a(e.toolCallId,P,m)})]})}function hp({req:e,strings:t,resolve:n}){let o=Yl(e,t.confirmYes,t.confirmNo),a=e.questions.length===1&&e.questions[0]?.type==="text";return r(Oo,{fields:o,strings:t,submitLabel:t.inputSubmit,footerHint:a?t.inputSubmitHint:void 0,onSubmit:i=>n(vp(e.questions,i),!0),skipLabel:t.inputSkip,onSkip:()=>n(void 0,!1),submitOnEnter:a,submitTestId:w.toolInputSubmit,skipTestId:w.toolInputSkip})}function vp(e,t){let n=e.flatMap(o=>{let a=t[o.key];if(a==null||a.trim()==="")return[];let i=o.type==="multi-select"?a.split(",").map(l=>l.trim()).filter(Boolean):a;return[{key:o.key,value:i}]});return JSON.stringify({answers:n})}function bp({part:e,strings:t,req:n,editable:o,onEdit:a}){let i=J(()=>e.approvalSig.value),l=i.value?.approved===!1,s=i.value?.approved?xp(i.value.reason):{};return r("div",{class:`${ge}-toolui`,"data-testid":w.toolDecision,children:[r("div",{class:`${ge}-toolui-head`,children:[r("span",{class:`${ge}-toolui-badge ${ge}-toolui-badge-accent`,children:t.inputBadge}),r("span",{class:`${ge}-toolui-badge`,children:l?t.inputSkipped:t.inputAnswered})]}),n.intro?r("div",{class:`${ge}-toolui-desc`,children:n.intro}):null,n.questions.map(c=>{let d=l?"":s[c.key]??"";return r("div",{class:`${ge}-toolui-section`,children:[r("span",{class:`${ge}-toolui-label`,children:c.question}),d?r("p",{class:`${ge}-toolui-text`,children:d}):null]},c.key)}),o?r("div",{class:`${ge}-toolui-actions`,children:r("button",{type:"button",class:`${ge}-form-skip`,onClick:a,"data-testid":w.toolEdit,children:t.edit})}):null]})}function xp(e){if(!e)return{};let n=(()=>{try{return JSON.parse(e)}catch{return}})()?.answers;if(!Array.isArray(n))return{};let o={};for(let a of n){if(!a||typeof a!="object")continue;let{key:i,value:l}=a;typeof i=="string"&&(o[i]=Array.isArray(l)?l.filter(s=>typeof s=="string").join(", "):String(l??""))}return o}var fa=y.cssPrefix;function Ql({part:e,strings:t}){let n=J(()=>e.inputSig.value),o=J(()=>e.outputSig.value),a=J(()=>e.errorSig.value),i=J(()=>e.stateSig.value),l=J(()=>e.approvalSig.value);return J(()=>!!Uo(n.value)||!!a.value||!!Uo(ma(o.value))).value?r("details",{class:`${fa}-toolui ${fa}-toolui-collapsible`,"data-testid":w.toolCall,children:[r("summary",{class:`${fa}-toolui-head`,children:r(zo,{name:Bo(e.toolName),state:i.value,approval:l.value,strings:t})}),r(mt,{label:t.toolParameters,value:n.value}),o.value!==void 0?r(mt,{label:t.toolResult,value:o.value}):null,a.value?r(mt,{label:t.statusError,value:a.value,error:!0}):null]}):null}var Oe=y.cssPrefix;function Zl({message:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:l=!1,superseded:s=!1,tool:c,onRetry:d}){let _=J(()=>e.partsSig.value).value,g=J(()=>rt(e)),f=J(()=>Hs(e)),m=J(()=>e.partsSig.value.some(j=>j.kind==="text"&&j.textSig.value.length>0)),P=J(()=>o&&e.partsSig.value.some(j=>j.kind==="reasoning")),v=J(()=>{let j=e.partsSig.value,L=-1;for(let V=0;V<j.length;V++){let B=j[V]?.kind;(B==="text"||B==="file"||B==="source")&&(L=V)}return L}),b=e.role==="assistant"&&e.status==="streaming",S=n==="buffered"&&b,x=b&&!m.value,R=b&&!S&&!(P.value&&x);if(f.value)return null;let z=yp(e.createdAt);return r("div",{class:`${Oe}-bubble-row`,"data-role":e.role,"data-testid":be(w.messageBubble,e.id),children:r("div",{class:`${Oe}-bubble-col`,children:[r("div",{class:`${Oe}-bubble`,children:[S?r(Ep,{label:t.loading}):_.map((j,L)=>r(Pp,{part:j,active:x,strings:t,showReasoning:o,showToolCalls:a,showSources:i,interactive:l&&(j.kind!=="tool"||L>v.value),superseded:s,tool:c},wp(j))),R&&r(Cp,{}),e.status==="error"&&e.errorText||g.value?r("div",{class:`${Oe}-error`,role:"alert",children:[r("span",{children:e.errorText??t.errorGeneric}),d?r("button",{type:"button",class:`${Oe}-error-retry`,onClick:d,"data-testid":w.messageRetry,children:t.errorRetry}):null]}):null]}),z?r("time",{class:`${Oe}-bubble-time`,dateTime:z.iso,title:z.full,children:z.short}):null]})})}function yp(e){if(typeof e!="number"||!Number.isFinite(e))return null;try{let t=new Date(e);return{short:t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),full:t.toLocaleString(void 0,{dateStyle:"full",timeStyle:"short"}),iso:t.toISOString()}}catch{return null}}function Pp({part:e,active:t,strings:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:l,superseded:s,tool:c}){switch(e.kind){case"step-start":return null;case"text":return r(Ho,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return o?r(kp,{part:e,active:t,strings:n}):null;case"tool":return r(Sp,{part:e,strings:n,showToolCalls:a,interactive:l,superseded:s,tool:c});case"file":return e.mediaType.startsWith("image/")?r("img",{src:e.url,alt:"",loading:"lazy"}):r("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",children:e.url});case"source":return i?r(Kl,{part:e,strings:n}):null}}function Sp({part:e,strings:t,showToolCalls:n,interactive:o,superseded:a,tool:i}){let l=J(()=>e.approvalSig.value!==void 0);if(i?.humanInLoop){if(Hl(e.toolName))return r(Jl,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit});if(l.value)return r(jl,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit})}return n?r(Ql,{part:e,strings:t}):null}function kp({part:e,active:t,strings:n}){return r("details",{class:`${Oe}-reasoning`,open:t,"data-active":t?"true":void 0,children:[r("summary",{class:`${Oe}-reasoning-summary`,children:r("span",{class:`${Oe}-reasoning-label`,children:t?n.thinking:n.thoughts})}),r("div",{class:`${Oe}-reasoning-body`,children:r(Ho,{textSig:e.textSig,doneSig:e.doneSig})})]})}function wp(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 Cp(){return r("span",{class:`${Oe}-typing`,"aria-hidden":"true",children:[r("span",{}),r("span",{}),r("span",{})]})}function Ep({label:e}){return r("span",{class:`${Oe}-loading`,role:"status",children:[r("span",{class:`${Oe}-loading-spinner`,"aria-hidden":"true"}),r("span",{class:`${Oe}-loading-label`,children:e})]})}var jt=y.cssPrefix,ga=120,Tp=350;function ec({messagesSig:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,loading:l,idle:s,tool:c,onRetry:d,form:u,formMarkers:_,onFillForm:g}){let f=D(null),m=J(()=>e.value),[P,v]=A(!1),b=D(!1),S=D(!1),x=D(!1),R=D(0),z=()=>x.current||performance.now()-R.current<Tp,j=D(0),L=k=>{j.current=performance.now(),k.scrollTop=k.scrollHeight},V=(k,U)=>{L(k);let ye=U,Pe=0,Se=()=>{L(k),--ye>0&&(Pe=requestAnimationFrame(Se))};return U>0&&(Pe=requestAnimationFrame(Se)),()=>cancelAnimationFrame(Pe)},B=(k,U)=>{let ye,Pe,Se,Ve=-1,Ke=()=>{ye.disconnect(),Pe.disconnect(),clearTimeout(Se)},et=()=>{if(S.current||z()||Ve>=0&&k.scrollTop<Ve-4)return Ke();L(k),Ve=k.scrollTop};return ye=new ResizeObserver(et),Pe=new MutationObserver(et),et(),ye.observe(k),Pe.observe(k,{childList:!0,subtree:!0,characterData:!0}),Se=setTimeout(Ke,U),Ke},X=m.value[0]?.id;Pt(()=>{let k=f.current;if(k&&m.value.length!==0&&(b.current=!0,!!m.value.some(U=>U.role==="user")))return B(k,300)},[X]);let Q=D(0);T(()=>{let k=f.current,U=m.value,ye=Q.current;if(Q.current=U.length,!k||!b.current)return;if(U.slice(ye).some(Se=>Se.role==="user"))return S.current=!1,V(k,3);if(!U.some(Se=>Se.role==="user")||S.current||z())return;k.scrollHeight-k.scrollTop-k.clientHeight<ga&&L(k)},[m.value.length]);let he=D(null);T(()=>{let k=f.current,U=m.value.at(-1),ye=he.current;if(he.current=U?.id??null,!!k&&b.current&&!(!U||U.id!==ye||U.status!=="streaming"))return S.current=!1,V(k,3)},[m.value]),T(()=>{let k=f.current;if(!k)return;let U=m.value.at(-1);if(!U||U.status!=="streaming"&&!m.value.some(Se=>Se.role==="user"))return;let ye=()=>{if(S.current||z())return;k.scrollHeight-k.scrollTop-k.clientHeight<ga*2&&L(k)};if(U.status!=="streaming")return B(k,300);ye();let Pe=new MutationObserver(ye);return Pe.observe(k,{childList:!0,subtree:!0,characterData:!0}),()=>Pe.disconnect()},[m.value]);let C=u?.form.id,Y=!!u&&(_??[]).some(k=>k.formId===u.form.id);Pt(()=>{let k=f.current;!k||!C||S.current||m.value.some(U=>U.role==="user")&&(Y?k.querySelector(`[data-testid="${w.formGate}"]`)?.scrollIntoView({block:"nearest"}):L(k))},[C,Y]),T(()=>{let k=f.current;if(!k)return;let U=()=>v(k.scrollHeight-k.scrollTop-k.clientHeight>ga*2),ye=()=>{U(),performance.now()-j.current>150&&(S.current=k.scrollHeight-k.scrollTop-k.clientHeight>8)},Pe=()=>{S.current=!0},Se=Fe=>{Fe.deltaY<0&&Pe()},Ve=0,Ke=Fe=>{Ve=Fe.touches[0]?.clientY??0,x.current=!0},et=Fe=>{(Fe.touches[0]?.clientY??0)>Ve+4&&Pe()},Be=()=>{x.current=!1,R.current=performance.now()},Le=()=>{x.current=!0};return k.addEventListener("scroll",ye,{passive:!0}),k.addEventListener("wheel",Se,{passive:!0}),k.addEventListener("touchstart",Ke,{passive:!0}),k.addEventListener("touchmove",et,{passive:!0}),k.addEventListener("touchend",Be,{passive:!0}),k.addEventListener("touchcancel",Be,{passive:!0}),k.addEventListener("pointerdown",Le,{passive:!0}),window.addEventListener("pointerup",Be,{passive:!0}),window.addEventListener("pointercancel",Be,{passive:!0}),U(),()=>{k.removeEventListener("scroll",ye),k.removeEventListener("wheel",Se),k.removeEventListener("touchstart",Ke),k.removeEventListener("touchmove",et),k.removeEventListener("touchend",Be),k.removeEventListener("touchcancel",Be),k.removeEventListener("pointerdown",Le),window.removeEventListener("pointerup",Be),window.removeEventListener("pointercancel",Be)}},[]);let re=()=>{let k=f.current;k&&(S.current=!1,L(k))},ce=[],_e="",Ie=m.value.at(-1)?.id,ae=[..._??[]].toSorted((k,U)=>(k.createdAt??1/0)-(U.createdAt??1/0)),xe=k=>u&&k.formId===u.form.id?r(sa,{form:u.form,strings:t,onSubmit:u.onSubmit,onSkip:u.onSkip},`gate:${k.formId}`):r($l,{marker:k,strings:t,onFill:!u&&g?()=>g(k.formId):void 0},k.key),Ze=k=>{for(let U=ae[0];U?.createdAt!==void 0&&!(k!==void 0&&U.createdAt>k);U=ae[0])ae.shift(),ce.push(xe(U))};for(let k of m.value){if(k.role==="assistant"&&k.id!==Ie&&rt(k))continue;Ze(k.createdAt);let U=Rp(k.createdAt);U&&U!==_e&&(ce.push(r("div",{class:`${jt}-date-divider`,children:r("span",{class:`${jt}-date-pill`,title:Ap(k.createdAt),children:Ip(k.createdAt,t)})},`day:${U}`)),_e=U),ce.push(r(Zl,{message:k,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:!!s&&k.id===Ie,superseded:k.id!==Ie,tool:c,onRetry:s&&k.id===Ie?d:void 0},k.id))}for(let k of ae)ce.push(xe(k));return r("div",{class:`${jt}-list-wrap`,children:[r("div",{ref:f,class:`${jt}-list`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[l&&m.value.length===0?r("div",{class:`${jt}-list-loading`,role:"status",children:t.conversationLoading}):null,ce,u&&!Y?r(sa,{form:u.form,strings:t,onSubmit:u.onSubmit,onSkip:u.onSkip}):null]}),P?r("button",{type:"button",class:`${jt}-jump`,onClick:re,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":w.scrollToBottom,children:r(Co,{})}):null]})}function Rp(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Ap(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function Ip(e,t){let n=new Date(e),o=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),a=Math.round((o(new Date)-o(n))/864e5);return a<=0?t.dateToday:a===1?t.dateYesterday:a<7?n.toLocaleDateString(void 0,{weekday:"long"}):n.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}var Lp=["today","yesterday","lastWeek","older"];function Mp(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let o=Math.floor((tc(e)-tc(n))/(1440*60*1e3));return o<=0?"today":o===1?"yesterday":o<7?"lastWeek":"older"}function nc(e,t){let n=new Map;for(let o of t){let a=Mp(e,o.lastMessageAt),i=n.get(a);i?i.push(o):n.set(a,[o])}return Lp.filter(o=>n.has(o)).map(o=>({bucket:o,conversations:n.get(o)}))}function tc(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var Np=F.scope("history"),Dp=3,Op=6,$p={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function Hp(e,t,n){let o=Date.parse(e);return Number.isFinite(o)?new Date(o).toDateString()===new Date(t).toDateString()?new Intl.DateTimeFormat(n,{hour:"numeric",minute:"2-digit"}).format(o):t-o<10080*60*1e3?new Intl.DateTimeFormat(n,{weekday:"short"}).format(o):new Intl.DateTimeFormat(n,{month:"short",day:"numeric"}).format(o):""}function qo({transport:e,strings:t,locale:n,persistence:o,visitorId:a,onSelect:i,onNewConversation:l}){let s=y.cssPrefix,c=e.peekConversations({visitorId:a}),[d,u]=A(c?"loaded":"loading"),[_,g]=A(c?.conversations??[]);T(()=>{let v=!1;return e.listConversations({visitorId:a}).then(b=>{if(v)return;let S=b.conversations??[];g(S),u("loaded"),o.saveHistoryCount(S.length)}).catch(b=>{v||(Np.warn("listConversations failed",{err:b}),u("error"))}),()=>{v=!0}},[e,a,o]);let f=l?r("div",{class:`${s}-history-footer`,children:r("button",{type:"button",class:`${s}-history-new`,onClick:l,"data-testid":w.sidebarNewConversation,children:[r(Vs,{}),t.newConversation]})}):null;if(d==="loading"){let v=Math.min(o.loadHistoryCount()??Dp,Op);return r(te,{children:[r("div",{class:`${s}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:r("div",{class:`${s}-history-group`,"aria-hidden":"true",children:[r("div",{class:`${s}-history-heading`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-heading`})}),r("div",{class:`${s}-history-card`,children:Array.from({length:Math.max(1,v)},(b,S)=>r("div",{class:`${s}-history-item ${s}-history-item-skeleton`,children:[r("span",{class:`${s}-history-avatar ${s}-skeleton`}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-title`})}),r("span",{class:`${s}-history-time`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-time`})})]}),r("span",{class:`${s}-history-row`,children:r("span",{class:`${s}-history-preview`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-preview`})})})]})]},S))})]})}),f]})}if(d==="error"||_.length===0)return r(te,{children:[r("div",{class:`${s}-history-empty`,children:t.historyEmpty}),f]});let m=Date.now(),P=nc(m,_);return r(te,{children:[r("div",{class:`${s}-history`,role:"list",children:P.map(v=>r("div",{class:`${s}-history-group`,children:[r("div",{class:`${s}-history-heading`,children:t[$p[v.bucket]]}),r("div",{class:`${s}-history-card`,children:v.conversations.map(b=>r("button",{type:"button",role:"listitem",class:`${s}-history-item`,onClick:()=>i(b),"data-closed":b.canContinue?void 0:"true","data-unread":(b.unreadCount??0)>0?"true":void 0,"data-testid":be(w.historyItem,b.conversationId),children:[r("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:r(Zr,{})}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:b.title}),r("span",{class:`${s}-history-time`,children:Hp(b.lastMessageAt,m,n)})]}),r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-preview`,children:b.preview??(b.canContinue?t.historyContinue:t.conversationClosed)}),(b.unreadCount??0)>0?r("span",{class:`${s}-history-dot`}):null]})]})]},b.conversationId))})]},v.bucket))}),f]})}var oc=y.cssPrefix;function rc({suggestions:e,onPick:t}){return e.length===0?null:r("div",{class:`${oc}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((n,o)=>r("button",{type:"button",class:`${oc}-suggestion`,onClick:()=>t(n),"data-testid":be(w.suggestion,o),children:n.label},n.id))})}var Ne=y.cssPrefix;function ac(e){let{options:t,onClose:n}=e,o=t.strings,a=D(null);T(()=>{let c=a.current;if(!c)return;let d=Io(c),u=_=>{_.key==="Escape"&&n?.()};return c.addEventListener("keydown",u),()=>{d(),c.removeEventListener("keydown",u)}},[n]);let i=D(null),l=O(c=>{i.current?.attachFromDrop(c)},[]),{visible:s}=No({containerRef:a,onDrop:l});return Ro(a.current,t.mode==="modal"),r("div",{ref:a,class:`${Ne}-panel`,role:"dialog","aria-modal":"false","aria-label":o.panelTitle,style:{position:"relative"},"data-testid":w.panel,children:[r(ha,{...e,containerEl:a.current,dragOver:s,composerAttachApiRef:i}),r(va,{poweredBy:e.options.poweredBy})]})}function ha(e){let{options:t,transport:n,feedback:o,bus:a,persistence:i,panelSize:l,view:s,canSend:c,isStreaming:d,loadingMessages:u,messagesSig:_,agent:g,suggestions:f,initialWidgetSize:m,visitorId:P,onClose:v,onBack:b,onClear:S,onToggleHistory:x,onSelectHistoryConversation:R,onNewConversation:z,onWidgetSizeChange:j,onSend:L,onStop:V,onSuggestion:B,activeForm:X,formMarkers:Q,onFormSubmit:he,onFormSkip:C,onFormFill:Y,tool:re,onRetry:ce,containerEl:_e,dragOver:Ie,composerAttachApiRef:ae}=e,xe=t.strings,Ze;return X?Ze=null:c?Ze=r(te,{children:[r(rc,{suggestions:f,onPick:B}),r(Il,{options:t,transport:n,feedback:o,bus:a,isStreaming:d,onSend:L,onStop:V,attachApiRef:ae})]}):Ze=r(Fp,{label:xe.conversationClosed,ctaLabel:xe.startNewConversation,onNewConversation:S}),r(te,{children:[s==="history"?r(Bp,{strings:xe,onBack:x,onClose:v,showClose:Ao(t.mode,l,t.actions)}):r("header",{class:`${Ne}-header`,"data-testid":w.panelHeader,children:[b?r("button",{type:"button",class:`${Ne}-icon-btn`,onClick:b,"aria-label":xe.moduleBack,title:xe.moduleBack,children:r(yn,{})}):null,g?r(Tl,{agent:g,strings:xe}):r("h1",{children:xe.panelTitle}),r(Ye,{panelProps:e,variant:"chat"})]}),s==="history"?r(qo,{transport:n,strings:xe,locale:t.locale,persistence:i,visitorId:P,onSelect:k=>R(k.conversationId),onNewConversation:z}):r(te,{children:[r(Ll,{visible:Ie,strings:xe}),r(ec,{messagesSig:_,strings:xe,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,loading:u,idle:!d,tool:re,onRetry:ce,form:X?{form:X,onSubmit:he,onSkip:C}:null,formMarkers:Q,onFillForm:Y}),Ze,r(zp,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?r(To,{panelEl:_e,resize:t.size.resize,position:t.position,initialSize:m,onSizeChange:j,strings:xe}):null]})}function Bp({strings:e,onBack:t,onClose:n,showClose:o}){return r("header",{class:`${Ne}-header`,children:[r("button",{type:"button",class:`${Ne}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:r(yn,{})}),r("h1",{children:e.historyTitle}),o?r("button",{type:"button",class:`${Ne}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:r(Xe,{})}):null]})}function Fp({label:e,ctaLabel:t,onNewConversation:n}){return r("div",{class:`${Ne}-readonly-banner`,role:"note",children:[r("span",{class:`${Ne}-readonly-label`,children:e}),r("button",{type:"button",class:`${Ne}-readonly-cta`,onClick:n,children:t})]})}function zp({disclaimer:e}){return e?r("div",{class:`${Ne}-composer-footer`,children:r("div",{class:`${Ne}-disclaimer`,children:e})}):null}function va({poweredBy:e}){return e?r("div",{class:`${Ne}-poweredby-bar`,children:r(Up,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function Up({logoUrl:e,text:t,href:n}){let o=r(te,{children:[e?r("img",{class:`${Ne}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?r("span",{children:t}):null]});return n?r("a",{class:`${Ne}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:o}):r("span",{class:`${Ne}-poweredby`,children:o})}function ic(e){let t=D(e);t.current=e;let n=D(null);return n.current??(n.current=Wp(t)),n.current}function Wp(e){let t=H(null),n=new Set,o=c=>`${e.current.conversationId()??""}:${c}`,a=c=>c.frequency==="always"?!1:c.frequency==="conversation"?n.has(o(c.id)):c.id in e.current.persistence.loadFormsDone(),i=(c,d)=>{if(t.value)return;let u=e.current;if(c==="manual"){let _=u.forms.list.find(g=>g.id===d);_&&(t.value={form:_,trigger:"manual"});return}for(let _ of u.forms.byTrigger[c]??[]){let g=_.triggers.find(f=>f.kind===c);if(!(!g||!qp(g,u)||a(_)||!Gp(_,u))){t.value={form:_,trigger:c};return}}},l=(c,d)=>{let u=t.value;if(!u)return;t.value=null;let{form:_,trigger:g}=u;_.frequency==="conversation"?n.add(o(_.id)):_.frequency!=="always"&&e.current.persistence.saveFormDone(_.id),e.current.onComplete(_,g,c,d)};return{activeForm:t,fire:i,refresh:()=>{let c=t.value;if(!c)return;let d=e.current.forms.list.find(u=>u.id===c.form.id);d&&d!==c.form&&(t.value={form:d,trigger:c.trigger})},complete:c=>l(c,!1),skip:()=>l({},!0)}}function qp(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function Gp(e,t){let n=e.when;if(!n)return!0;if(n.missingContext?.length){let a=t.userContext()??{};if(n.missingContext.some(i=>a[i]!==void 0&&a[i]!==""))return!1}if(n.pageArea&&!(Array.isArray(n.pageArea)?n.pageArea:[n.pageArea]).includes(t.pageArea()??""))return!1;let o=t.messageCount();return!(n.minMessages!=null&&o<n.minMessages||n.maxMessages!=null&&o>n.maxMessages)}function sc(e){let t=y.cssPrefix,{site:n,blocks:o,strings:a,collapsed:i}=e,l=o?.navigation??[],s=o?.linkCards??[],c=i?a.expandSidebar:a.collapseSidebar;return r("aside",{class:`${t}-sidebar`,"data-collapsed":i?"true":"false","data-testid":w.sidebar,children:[r("div",{class:`${t}-sidebar-header`,children:[r(Vp,{site:n}),r("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":i?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":w.sidebarToggle,children:r(Kp,{collapsed:i})})]}),i?null:r(te,{children:[l.length>0?r("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:r(jp,{items:l})}):null,s.length>0?r("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:r(Xp,{items:s})}):null,e.showConversations?r("div",{class:`${t}-sidebar-conversations`,children:r(qo,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function Vp({site:e}){let t=y.cssPrefix;if(e?.logo?.url){let n=e.logo.alt??e.title??"Logo";return r("picture",{children:[e.logoDark?.url?r("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,r("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:n})]})}return r("div",{class:`${t}-sidebar-title`,children:e?.title??y.name})}function Kp({collapsed:e}){return r("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?r("polyline",{points:"9 6 15 12 9 18"}):r("polyline",{points:"15 6 9 12 15 18"})})}function jp({items:e}){let t=y.cssPrefix;return r("ul",{class:`${t}-sidebar-nav`,children:e.map(n=>r("li",{children:r("a",{class:`${t}-sidebar-nav-item`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[n.icon?r("span",{class:`${t}-sidebar-nav-icon`,"data-icon":n.icon}):null,r("span",{class:`${t}-sidebar-nav-label`,children:n.label})]})},n.id??n.label))})}function Xp({items:e}){let t=y.cssPrefix;return r("div",{class:`${t}-sidebar-cards`,children:e.map(n=>r("a",{class:`${t}-sidebar-card`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[r("div",{class:`${t}-sidebar-card-label`,children:n.label}),n.description?r("div",{class:`${t}-sidebar-card-desc`,children:n.description}):null]},n.id??n.label))})}var lc=y.cssPrefix;function cc(e){return r("main",{class:`${lc}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[r(sc,{site:e.site,blocks:e.blocks,transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,showConversations:e.showConversations,onSelectConversation:e.onSelectConversation,onNewConversation:e.onNewConversation,collapsed:e.sidebarCollapsed,onToggleCollapsed:e.onToggleSidebarCollapsed}),r("section",{class:`${lc}-page-chat`,"aria-label":"Chat",children:e.children})]})}var dc=e=>Object.fromEntries(e.map(t=>[t,[]]));function _c(e,t,n){let o=H({activeTab:e,stacks:dc(t)});return{sig:o,switchTab(a){o.value.activeTab!==a&&(o.value={...o.value,activeTab:a},n?.(a))},push(a){let i=o.value,l=i.stacks[i.activeTab]??[];o.value={...i,stacks:{...i.stacks,[i.activeTab]:[...l,a]}}},pop(){let a=o.value,i=a.stacks[a.activeTab]??[];i.length!==0&&(o.value={...a,stacks:{...a.stacks,[a.activeTab]:i.slice(0,-1)}})},reset(a){o.value={activeTab:a,stacks:dc(t)}}}}var uc=e=>e.stacks[e.activeTab]??[],pc=e=>uc(e).at(-1),mc=e=>uc(e).length===0;var fc={Icon:Pn};var ft=y.cssPrefix;function Go({title:e,actions:t}){return r("header",{class:`${ft}-back-header`,"data-variant":"title",children:[r("span",{class:`${ft}-back-spacer`,"aria-hidden":"true"}),r("h1",{class:`${ft}-back-title`,children:e}),t??r("span",{class:`${ft}-back-spacer`,"aria-hidden":"true"})]})}function Vo({title:e,backLabel:t,onBack:n,actions:o,testid:a}){return r("header",{class:`${ft}-back-header`,"data-testid":a,children:[r("button",{type:"button",class:`${ft}-icon-btn`,onClick:n,"aria-label":t,title:t,children:r(yn,{})}),r("h1",{class:`${ft}-back-title`,children:e}),o??r("span",{class:`${ft}-back-spacer`,"aria-hidden":"true"})]})}var Xt=y.cssPrefix;function gc({placeholder:e,onActivate:t}){return r("button",{type:"button",class:`${Xt}-home-search`,onClick:t,"data-testid":w.homeSearch,children:[r("span",{class:`${Xt}-home-search-text`,children:e}),r("span",{class:`${Xt}-home-search-icon`,"aria-hidden":"true",children:r(ta,{})})]})}function hc({placeholder:e,value:t,onInput:n}){return r("div",{class:`${Xt}-home-search`,"data-input":"true",children:[r("input",{type:"search",class:`${Xt}-home-search-input`,placeholder:e,value:t,onInput:o=>n(o.currentTarget.value),"data-testid":w.helpSearch}),r("span",{class:`${Xt}-home-search-icon`,"aria-hidden":"true",children:r(ta,{})})]})}var wn=y.cssPrefix;function Ko({title:e,subtitle:t,onClick:n,testid:o}){return r("button",{type:"button",class:`${wn}-list-row`,onClick:n,"data-testid":o,children:[r("span",{class:`${wn}-list-row-body`,children:[r("span",{class:`${wn}-list-row-title`,children:e}),t?r("span",{class:`${wn}-list-row-sub`,children:t}):null]}),r("span",{class:`${wn}-list-row-chevron`,"aria-hidden":"true",children:r(qt,{})})]})}var vc=y.cssPrefix;function Ge({tone:e="info",message:t,onRetry:n,strings:o}){return r("div",{class:`${vc}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[r("span",{children:t}),n?r("button",{type:"button",class:`${vc}-module-retry`,onClick:n,children:o.errorRetry}):null]})}var Rt=y.cssPrefix,Yp=F.scope("help"),Jp=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function Qp(e){let t=new Map;for(let n of e){let o=n.categories?.[0]??"";(t.get(o)??t.set(o,[]).get(o)).push(n)}return[...t.entries()]}function bc(e,t){let n=t.toLowerCase(),o=n.indexOf(e);if(o!==-1)return 100-Math.min(o,99);let a=0;for(let i of e){if(a=n.indexOf(i,a),a===-1)return 0;a+=1}return 1}function Zp(e,t){let n=t.toLowerCase().trim();return n?e.map(o=>({item:o,score:Math.max(bc(n,o.title)*2,bc(n,o.description??""))})).filter(o=>o.score>0).toSorted((o,a)=>a.score-o.score).map(o=>o.item):[]}function xc({article:e,nav:t}){return r(Ko,{title:e.title,subtitle:e.description,onClick:()=>Jp(t,e),testid:be(w.helpArticle,e.id)})}function em({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=A("loading"),[d,u]=A(t.errorGeneric),[_,g]=A([]),[f,m]=A(""),[P,v]=A(0);T(()=>{let x=!1;return c("loading"),e.listContent({tags:l,sortBy:"order",limit:100}).then(R=>{if(x)return;let z=R.items??[];g(z),c("loaded"),a.emit("contentView",{section:"help",tags:l?.join(","),count:z.length})}).catch(R=>{x||(Yp.warn("listContent (help) failed",{err:R}),u(wt(R,t)),c("error"))}),()=>{x=!0}},[e,l,P,a]);let b=Re(()=>Zp(_,f),[_,f]);T(()=>{let x=f.trim();if(!x)return;let R=setTimeout(()=>a.emit("contentSearch",{queryLength:x.length,hitCount:b.length}),600);return()=>clearTimeout(R)},[f,b,a]);function S(){return f.trim().length>0?b.length===0?r(Ge,{message:t.helpSearchEmpty,strings:t}):r("div",{class:`${Rt}-help-card`,children:b.map(x=>r(xc,{article:x,nav:o},x.id))}):s==="loading"?r(Ge,{message:t.helpLoading,strings:t}):s==="error"?r(Ge,{tone:"error",message:d,onRetry:()=>v(x=>x+1),strings:t}):_.length===0?r(Ge,{message:t.helpEmpty,strings:t}):Qp(_).map(([x,R])=>r("section",{class:`${Rt}-help-group`,children:[x?r("h2",{class:`${Rt}-help-section-title`,children:x}):null,r("div",{class:`${Rt}-help-card`,children:R.map(z=>r(xc,{article:z,nav:o},z.id))})]},x))}return r("div",{class:`${Rt}-module`,children:[r(Go,{title:t.helpTitle,actions:r(Ye,{panelProps:i,variant:"plain"})}),r("div",{class:`${Rt}-module-pad`,children:r(hc,{placeholder:t.helpSearchPlaceholder,value:f,onInput:m})}),r("div",{class:`${Rt}-help-list`,children:S()})]})}var yc={Icon:ea,Root:e=>r(em,{...e})};var Pc=y.cssPrefix;function ba({onClick:e,children:t,testid:n}){return e?r("button",{type:"button",class:`${Pc}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):r("div",{class:`${Pc}-home-card`,"data-testid":n,children:t})}var se=y.cssPrefix,Sc=F.scope("home");function tm(e){let t=e.options.userContext?.name,n=e.config.greetingText?Te(e.strings,e.config.greetingText):void 0;return n?{title:t?n.replace("{name}",t):n.replace(/\s*\{name\}\s*/," ").trim(),subtitle:e.strings.homeGreetingLead}:t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}var nm=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function om(e){let{transport:t,strings:n,config:o,nav:a,bus:i,panelProps:l}=e,[s,c]=A(null),[d,u]=A([]),_=o.contentTags?.join(",");T(()=>{if(!o.showRecentConversations)return;let b=!1;return t.listConversations({limit:1}).then(S=>!b&&c(S.conversations?.[0]??null)).catch(S=>!b&&Sc.warn("listConversations (home) failed",{err:S})),()=>{b=!0}},[t,o.showRecentConversations]),T(()=>{if(!o.contentTags?.length)return;let b=!1;return t.listContent({tags:o.contentTags,limit:6}).then(S=>{if(b)return;let x=S.items??[];u(x),i.emit("contentView",{section:"home",tags:_,count:x.length})}).catch(S=>!b&&Sc.warn("listContent (home) failed",{err:S})),()=>{b=!0}},[t,_,i]);let g=tm(e),f=o.userAvatars??[],m=o.status,P=m?.text?Te(n,m.text):n.homeStatus,v=o.contentBlockTitle?Te(n,o.contentBlockTitle):n.homeContentTitle;return r("div",{class:`${se}-module ${se}-home`,"data-testid":w.homeView,children:r("div",{class:`${se}-home-scroll`,children:[r("div",{class:`${se}-home-hero`,children:[r("div",{class:`${se}-home-hero-top`,children:[o.brandName?r("span",{class:`${se}-home-brand`,"data-testid":w.homeBrand,children:o.brandName}):r("span",{class:`${se}-home-brand-spacer`,"aria-hidden":"true"}),r("div",{class:`${se}-home-hero-actions`,children:[f.length>0?r("div",{class:`${se}-home-avatars`,children:f.map(b=>r("span",{class:`${se}-home-avatar`,title:b.role?`${b.name} \xB7 ${b.role}`:b.name,children:b.avatar?r("img",{src:b.avatar,alt:"",loading:"lazy"}):r("span",{children:Lo(b.name)})},b.name))}):null,r(Ye,{panelProps:l,variant:"plain"})]})]}),o.showGreeting!==!1?r(te,{children:[r("h1",{class:`${se}-home-greeting`,"data-testid":w.homeGreeting,children:g.title}),g.subtitle?r("p",{class:`${se}-home-lead`,children:g.subtitle}):null]}):null]}),r("div",{class:`${se}-home-cards`,children:[o.showSearchBar!==!1?r(gc,{placeholder:n.homeSearchPlaceholder,onActivate:()=>a.switchToLayout("help")}):null,s?r(ba,{onClick:()=>a.selectConversation(s.conversationId),testid:w.homeRecent,children:r("div",{class:`${se}-home-recent-row`,"data-unread":(s.unreadCount??0)>0?"true":void 0,children:[r("span",{class:`${se}-home-recent-avatar`,"aria-hidden":"true",children:r(Pn,{})}),r("span",{class:`${se}-home-recent-body`,children:[r("span",{class:`${se}-home-recent-title`,children:s.title}),s.preview?r("span",{class:`${se}-home-recent-preview`,children:s.preview}):null]}),(s.unreadCount??0)>0?r("span",{class:`${se}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,m?r(ba,{onClick:m.url?()=>a.push({kind:"iframe",url:m.url,title:P}):void 0,children:r("div",{class:`${se}-home-status`,"data-level":m.level??"operational",children:[r("span",{class:`${se}-home-status-icon`,"aria-hidden":"true",children:r(pl,{})}),r("span",{class:`${se}-home-status-text`,children:P})]})}):null,d.length>0?r("section",{class:`${se}-home-content`,children:[r("div",{class:`${se}-home-content-title`,children:v}),r("div",{class:`${se}-home-content-list`,children:d.map(b=>r(Ko,{title:b.title,subtitle:b.description,onClick:()=>nm(a,b),testid:be(w.homeContentRow,b.id)},b.id))})]}):null]})]})})}var kc={Icon:ml,Root:e=>r(om,{...e})};var gt=y.cssPrefix,rm=F.scope("news");function am({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=A("loading"),[d,u]=A(t.errorGeneric),[_,g]=A([]),[f,m]=A(0);T(()=>{let v=!1;return c("loading"),e.listContent({tags:l,sortBy:"publishedAt",sortOrder:"desc"}).then(b=>{if(v)return;let S=b.items??[];g(S),c("loaded"),a.emit("contentView",{section:"news",tags:l?.join(","),count:S.length})}).catch(b=>{v||(rm.warn("listContent (news) failed",{err:b}),u(wt(b,t)),c("error"))}),()=>{v=!0}},[e,l,f,a]);function P(){return s==="loading"?r(Ge,{message:t.newsLoading,strings:t}):s==="error"?r(Ge,{tone:"error",message:d,onRetry:()=>m(v=>v+1),strings:t}):_.length===0?r(Ge,{message:t.newsEmpty,strings:t}):r("div",{class:`${gt}-news-list`,children:_.map(v=>r("button",{type:"button",class:`${gt}-news-card`,onClick:()=>o.push({kind:"content",id:v.id,title:v.title}),"data-testid":be(w.newsItem,v.id),children:[v.image?r("img",{class:`${gt}-news-hero`,src:v.image,alt:"",loading:"lazy"}):null,r("span",{class:`${gt}-news-body`,children:[r("span",{class:`${gt}-news-title`,children:v.title}),v.description?r("span",{class:`${gt}-news-summary`,children:v.description}):null]})]},v.id))})}return r("div",{class:`${gt}-module`,children:[r(Go,{title:t.newsTitle,actions:r(Ye,{panelProps:i,variant:"plain"})}),r("div",{class:`${gt}-module-scroll`,children:P()})]})}var wc={Icon:fl,Root:e=>r(am,{...e})};var jo={chat:fc,home:kc,help:yc,news:wc};var Cn=y.cssPrefix;function Cc({modules:e,activeTab:t,strings:n,unreadCount:o,onSelect:a}){return r("nav",{class:`${Cn}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let l=jo[i.layout].Icon,s=i.id===t,c=i.layout==="chat"&&o>0?o>9?"9+":String(o):null;return r("button",{type:"button",role:"tab","aria-selected":s,class:`${Cn}-tab`,onClick:()=>a(i.id),"data-testid":be(w.tab,i.id),children:[r("span",{class:`${Cn}-tab-icon`,"aria-hidden":"true",children:[r(l,{}),c?r("span",{class:`${Cn}-tab-badge`,"data-testid":w.tabBadge,children:c}):null]}),r("span",{class:`${Cn}-tab-label`,children:Te(n,i.label)})]},i.id)})})}var Ec=y.cssPrefix,im="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function Tc({url:e,title:t,strings:n,onBack:o,actions:a}){return r("div",{class:`${Ec}-module`,children:[r(Vo,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:o,actions:a}),r("iframe",{class:`${Ec}-content-frame`,src:e,title:t||"content",sandbox:im,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var En=y.cssPrefix,sm=F.scope("content"),lm=5e3;function Rc({id:e,title:t,transport:n,strings:o,bus:a,onBack:i,actions:l}){let[s,c]=A(null),[d,u]=A(!1),[_,g]=A(0),f=O(()=>{u(!1),c(null),g(v=>v+1)},[]);T(()=>{let v=!1;return n.listContent({ids:[e],limit:1}).then(b=>{if(v)return;let S=b.items[0];S?(c(S),a.emit("contentOpen",{contentId:e,tags:S.tags?.length?S.tags.join(","):void 0})):u(!0)}).catch(b=>{v||(sm.warn("listContent (reader) failed",{err:b}),u(!0))}),()=>{v=!0}},[n,e,_,a]),T(()=>{if(!s)return;let v=setTimeout(()=>a.emit("contentRead",{contentId:e}),lm);return()=>clearTimeout(v)},[s,e,a]);let m=O(v=>{let S=v.target?.closest?.("a")?.getAttribute("href")??"";S&&!S.startsWith("#")&&a.emit("contentLinkClick",{contentId:e})},[a,e]);function P(){return d?r(Ge,{tone:"error",message:o.errorGeneric,onRetry:f,strings:o}):s===null?r(Ge,{message:o.contentLoading,strings:o}):r("article",{class:`${En}-content`,"data-testid":w.contentView,onClick:m,children:[s.image?r("img",{class:`${En}-content-hero`,src:s.image,alt:"",loading:"lazy"}):null,s.description?r("p",{class:`${En}-content-subtitle`,children:s.description}):null,r(Vl,{text:s.content??""})]})}return r("div",{class:`${En}-module`,children:[r(Vo,{title:s?.title||t||o.moduleBack,backLabel:o.moduleBack,onBack:i,actions:l,testid:w.backHeader}),r("div",{class:`${En}-module-scroll`,"data-testid":w.contentScroll,children:P()})]})}var Xo=y.cssPrefix;function Ac({panelProps:e,enabledModules:t,nav:n,bus:o,unreadCount:a,onSelectConversation:i,onStartNewConversation:l,onSetPanelSize:s}){let c=e.options,d=c.strings,u=D(null),_=D(new Set);T(()=>{let Q=u.current;if(!Q)return;let he=Io(Q),C=Y=>{Y.key==="Escape"&&e.onClose?.()};return Q.addEventListener("keydown",C),()=>{he(),Q.removeEventListener("keydown",C)}},[e.onClose]);let g=D(null),f=O(Q=>{g.current?.attachFromDrop(Q)},[]),{visible:m}=No({containerRef:u,onDrop:f});Ro(u.current,c.mode==="modal");let P=J(()=>n.sig.value).value,v=pc(P),b=c.modules.byId[P.activeTab],S=v?.kind==="iframe"||v?.kind==="content",x=t.length>1&&(mc(P)||!S),R=D(null);T(()=>{if(S&&R.current===null)R.current=e.panelSize,e.panelSize==="normal"&&s("expanded");else if(!S&&R.current!==null){let Q=R.current;R.current=null,s(Q)}},[S]);let z={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:Q=>{let he=t.find(C=>C.layout===Q);he&&n.switchTab(he.id)},selectConversation:i,startNewConversation:l},j=Q=>({options:c,transport:e.transport,strings:d,config:Q,visitorId:e.visitorId,nav:z,bus:o,panelProps:e}),L=r(Ye,{panelProps:e,variant:"plain"});b&&_.current.add(b.id);let V=t.filter(Q=>_.current.has(Q.id)),B=Q=>{if(Q.layout==="chat")return r(ha,{...e,containerEl:u.current,dragOver:m,composerAttachApiRef:g});let he=jo[Q.layout].Root;return he?r(he,{...j(Q)}):null},X=()=>v?.kind==="iframe"?r(Tc,{url:v.url,title:v.title,strings:d,onBack:n.pop,actions:L}):v?.kind==="content"?r(Rc,{id:v.id,title:v.title,transport:e.transport,strings:d,bus:o,onBack:n.pop,actions:L}):null;return r("div",{ref:u,class:`${Xo}-panel ${Xo}-messenger`,role:"dialog","aria-modal":"false","aria-label":d.panelTitle,style:{position:"relative"},"data-testid":w.messengerHome,children:[r("div",{class:`${Xo}-messenger-body`,children:[V.map(Q=>r("div",{class:`${Xo}-messenger-pane`,hidden:S||Q.id!==b?.id,children:B(Q)},Q.id)),X()]}),x?r(Cc,{modules:t,activeTab:P.activeTab,strings:d,unreadCount:a,onSelect:n.switchTab}):null,r(va,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(b?.layout==="chat"&&!v)?r(To,{panelEl:u.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:d}):null]})}var Tn=y.cssPrefix;function Ic({strings:e,onClose:t}){return r("div",{class:`${Tn}-panel ${Tn}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":w.modulesEmpty,children:[t?r("button",{type:"button",class:`${Tn}-icon-btn ${Tn}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:r(Xe,{})}):null,r("p",{class:`${Tn}-modules-empty-text`,children:e.modulesEmpty})]})}function Lc({callout:e,persistence:t}){let n=e?.text??"",o=e?.persistent??!0,[a,i]=A(()=>o?!1:t.loadCalloutDismissed(n));T(()=>{i(o?!1:t.loadCalloutDismissed(n))},[n,o,t]);let l=O(()=>{i(!0),o||t.saveCalloutDismissed(n)},[t,n,o]);return{dismissed:a,dismissCallout:l}}var G=F.scope("app"),Yo=y.cssPrefix;function Mc(e,t){return Os({...e,text:Te(t,e.text)})}function cm(e){let t=e.partsSig.value.filter(n=>n.kind==="tool");return t.length>0&&t.every(n=>{let o=n.stateSig.value;return o==="output-available"||o==="output-error"||o==="output-denied"||o==="approval-responded"})}function Nc(e){return e instanceof DOMException?e.name==="AbortError":e?.name==="AbortError"}function Dc({options:e,hostElement:t,bus:n}){let[o]=A(()=>ut(e.widgetId,e.storage,e.aiAgentDeploymentId)),[a,i]=A(()=>o.getVisitorId()),l=o.loadUserPrefs(),[s,c]=A(()=>l.locale??e.locale),[d,u]=A(()=>l.themeMode??e.themeMode),[_,g]=A(()=>l.textSize??e.textSize),f=fn(o.loadConversationId()),m=fn([]),P=fn(0),[v,b]=A(!1),[S,x]=A([]);function R(){let p=e.modules.list,h=new Set(p.map(N=>N.id)),E=o.loadActiveModule();return E&&h.has(E)?E:p[0]?.id??""}function z(){return e.modules.list.find(p=>p.layout==="chat")?.id}let j=D();if(!j.current){let p=e.modules.list.map(h=>h.id);j.current=_c(R(),p,h=>o.saveActiveModule(h))}let L=j.current,V=D(void 0);V.current=z();let[B,X]=A(!1),[Q,he]=A(null),[C,Y]=A(!1),re=e.mode==="standalone"||e.mode==="inline",ce=D(gn(e,Wt(),o.loadPanelOpen(),o.loadPanelSize())),[_e,Ie]=A(ce.current.panelOpen),[ae,xe]=A(ce.current.panelOpen),Ze=D(ae);Ze.current=ae;let k=D(!1),U=D(void 0);T(()=>{_e&&xe(!0)},[_e]);let ye=D(!1),[Pe,Se]=A(!1),{dismissed:Ve,dismissCallout:Ke}=Lc({callout:e.launcher.callout,persistence:o}),et=e.launcher.callout?.persistent??!0,Be=O(()=>{G.info("calloutDismiss"),n.emit("calloutDismiss",void 0),Ke()},[n,Ke]),[Le,Fe]=A(ce.current.panelSize),tr=D(!1),[qc,nr]=A("chat"),[Yt,Jt]=A(!0),[ke,Rn]=A(!1),[Gc,Ia]=A(null),[or,An]=A([]),[La,In]=A(null),[Ln,Mn]=A(null),Nn=D(e.strings),[Vc,Kc]=A(void 0),[jc,Xc]=A(void 0),[Yc,Jc]=A(()=>o.loadSidebarCollapsed()??!1),[rr,Qc]=A({}),[K]=A(()=>new bo({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Ps({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[Me]=A(()=>new Po(m)),[ie]=A(()=>new wo(e.sound,e.haptics)),je=O(p=>{o.patchUserPrefs(p),K.saveUserPrefs(o.loadUserPrefs()).catch(h=>{G.warn("saveUserPrefs failed",{err:h})})},[o,K]);T(()=>{l.soundMuted!==void 0&&ie.setMuted(l.soundMuted)},[]),T(()=>{t.dataset.theme=d},[t,d,e]),T(()=>{t.dataset.textSize=_},[t,_,e]),T(()=>{ie.update(e.sound,e.haptics)},[ie,e.sound,e.haptics]),T(()=>()=>ie.destroy(),[ie]),T(()=>{let p=!0;return ie.mutedSig.subscribe(h=>{if(p){p=!1;return}je({soundMuted:h})})},[ie,je]),T(()=>{tr.current||!e.size.initialSize||(tr.current=!0,!o.loadPanelSize()&&Fe(jr(e.mode,e.size,Wt())))},[e.mode,e.size,o]),T(()=>{if(!B||ye.current)return;ye.current=!0;let p=gn(e,Wt(),o.loadPanelOpen(),o.loadPanelSize());Ie(p.panelOpen),Fe(p.panelSize)},[B,e,o]);let Ma=D(!1),Na=D(!1),Qt=D(null),ar=D(null),ir=D(!1);T(()=>{if(!(!B||Ma.current)){if(Ma.current=!0,Na.current){let p=V.current;p&&L.switchTab(p);return}L.reset(R())}},[B]);let Dn=O(p=>{!p||p.length===0||(m.value=p.map(h=>Mc(h,Nn.current)))},[m]),sr=D(null),On=O(async p=>{try{let{formSubmissions:h}=await(p?K.bootstrap(p):sr.current??K.bootstrap()),E=new Map;return h.forEach((N,W)=>E.set(N.formId,W)),h.filter((N,W)=>!N.skipped||E.get(N.formId)===W).map((N,W)=>({key:`wire:${N.formId}:${N.createdAt??W}`,formId:N.formId,outcome:N.skipped?"skipped":"submitted",createdAt:vo(N.createdAt),values:N.values}))}catch(h){return G.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:h}),[]}},[K]),Zt=D(0),en=O((p,h)=>{let E=[...p.map(I=>I.createdAt),...h.map(I=>I.createdAt)].filter(I=>I!==void 0),N=(E.length?Math.min(...E):Date.now())-1;return[...(U.current?.messages??[]).map(I=>{let Ee=Mc(I,Nn.current);return Ee.createdAt=N,Ee}),...p]},[]),lr=O(async p=>{let h=Zt.current,E=()=>h!==Zt.current;b(!0);try{let[N,W]=await Promise.all([K.loadConversation(p),On()]);if(E())return;let I=Qr(N.messages??[]);x(W);let Ee=Qt.current?[Qt.current]:[];I.length||Ee.length?(m.value=[...en(I,W),...Ee],Jt(N.canContinue??!0),An(N.suggestions??[])):m.value=en([],W),K.resumeStatus==="needs-generation"&&ar.current?.()}catch(N){if(E())return;G.warn("loadThread failed; resetting conversationId",{err:N,conversationId:p}),f.value=void 0,o.saveConversationId(void 0)}finally{E()||b(!1)}},[K,On,m,f,o,en]),tn=O(async({newConversation:p})=>{let h=++Zt.current,E=()=>h!==Zt.current,N=f.value,W=p||!N?Ue():N;W!==N&&(f.value=W,o.saveConversationId(W));let I;try{I=await K.handshake({visitorId:a,conversationId:W,userPrefs:o.loadUserPrefs(),locale:s})}catch(ze){if(E())return;n.emit("error",ze),e.onError?.(ze),p||X(!0);return}if(E())return;if(I.visitorId&&I.visitorId!==a&&(G.info("visitor rebound",{previous:a,current:I.visitorId,reason:I.rebind?.visitorId}),o.setVisitorId(I.visitorId),i(I.visitorId),n.emit("visitorRebound",{previous:a,current:I.visitorId,reason:I.rebind?.visitorId})),I.conversationId&&I.conversationId!==W&&(G.info("conversation rebound",{previous:W,current:I.conversationId,reason:I.rebind?.conversationId}),n.emit("conversationRebound",{previous:W,current:I.conversationId,reason:I.rebind?.conversationId})),I.agent&&Ia(I.agent),e.mode==="page"&&(I.site&&xs(I.site)?Kc(I.site):I.site&&G.warn("invalid site config, using fallback",{site:I.site}),I.blocks&&ys(I.blocks)?Xc(I.blocks):I.blocks&&G.warn("invalid blocks config, using fallback",{blocks:I.blocks})),I.userPrefs&&!p&&(o.saveUserPrefs(I.userPrefs),I.userPrefs.locale&&c(I.userPrefs.locale),I.userPrefs.soundMuted!==void 0&&ie.setMuted(I.userPrefs.soundMuted),I.userPrefs.themeMode&&u(I.userPrefs.themeMode),I.userPrefs.textSize&&g(I.userPrefs.textSize)),U.current=I.welcome,p||n.emit("handshake",I),I.welcome?.suggestions){let ze=Nn.current;An(I.welcome.suggestions.map(we=>({...we,label:Te(ze,we.label),...we.text===void 0?{}:{text:Te(ze,we.text)}})))}!p&&N&&I.conversationId===N?Ze.current?lr(N):k.current=!0:(f.value=I.conversationId,o.saveConversationId(I.conversationId),Dn(I.welcome?.messages)),p||X(!0)},[K,a,o,e,n,f,ie,Dn,lr,s]),nn=JSON.stringify(e.userContext??null),Zc=JSON.stringify(e.pageContext??null),ed=JSON.stringify(rr);T(()=>{let p=Object.keys(rr).length?{...rr,...e.userContext}:e.userContext;K.setContext(p,dm(e.pageContext))},[K,nn,Zc,ed]);let $e=Mt(s,e.availableLocales,e.defaultLocale);T(()=>{K.setLocale($e)},[K,$e]),T(()=>{t.dir=Qa($e)?"rtl":"ltr"},[t,$e]),T(()=>{$e!==s&&c($e)},[$e,s]);let $n=O(p=>{if(p.type!=="data-conversation-rebind")return!1;let h=p.data?.conversationId;if(h&&h!==f.value){let E=f.value;f.value=h,o.saveConversationId(h),K.primeIdentity(void 0,h),G.info("conversation rebound (in-stream)",{previous:E,current:h}),E&&n.emit("conversationRebound",{previous:E,current:h,reason:h})}return!0},[f,o,K,n]),Da=O(async p=>{let h=null;try{for await(let E of p.iter)if(!$n(E.chunk)){if(!h){h=hn(),Qt.current=h,Me.attach(h),m.value=[...m.value,h],Rn(!0),In(()=>p.cancel),Mn(()=>p.detach),Na.current=!0;let N=V.current;N&&L.switchTab(N),G.info("resumed in-flight reply on mount")}Me.apply(E.chunk),E.chunk.type==="finish"&&E.chunk.canContinue===!1&&Jt(!1)}h&&(h.status==="error"||rt(h)?(h.status="error",h.errorText=e.strings.errorGeneric,ie.play("error")):(h.status="complete",ie.play("messageReceived"),xa(n,e,"assistant",xo(h))))}catch(E){h&&(Nc(E)?yo(h)?m.value=m.value.filter(N=>N!==h):h.status="complete":(h.status="error",h.errorText=wt(E,e.strings),ie.play("error"))),G.debug("resume ended without completing",{err:E})}finally{Qt.current=null,h&&(Me.detach(),Rn(!1),In(null),Mn(null),m.value=[...m.value])}},[Me,m,ie,n,e,L,$n]),Oa=D(null),cr=O(async()=>{let p=K.resumeStream();Oa.current=p,await Da(p),K.resumeStatus==="needs-generation"&&ar.current?.()},[K,Da]);T(()=>{let p=f.value;return p&&K.primeIdentity(a,p),tn({newConversation:!1}),()=>{Zt.current++,Oa.current?.cancel()}},[]),T(()=>{ae&&(sr.current=K.bootstrap(),(async()=>{try{let p=await sr.current;he(ln((p??{forms:[]}).forms,$e))}catch(p){G.debug("bootstrap failed \u2014 treating as no forms",{err:p})}finally{Y(!0)}})(),(async()=>{let p=[];if(k.current){k.current=!1;let h=f.value;h&&p.push(lr(h))}f.value&&p.push(cr()),p.length!==0&&await Promise.allSettled(p)})())},[ae]);let Hn=D(null);T(()=>{if(!ae)return;if(Hn.current===null){Hn.current=$e;return}if(Hn.current===$e)return;Hn.current=$e;let p=!1;return K.bootstrap().then(h=>{p||he(ln((h??{forms:[]}).forms,$e))}).catch(h=>G.debug("forms re-localize failed \u2014 keeping current copy",{err:h})),()=>{p=!0}},[ae,$e,K]);let $a=D(nn);T(()=>{!B||$a.current===nn||($a.current=nn,tn({newConversation:!1}))},[nn,B,tn]),Pt(()=>{ao(t,ho(e.mode,Le,_e))},[t,_e,Le,e.mode]),T(()=>{if(e.mode!=="modal"||!_e)return;let p=h=>{h.composedPath().some(W=>W instanceof HTMLElement&&W.classList.contains(`${y.cssPrefix}-panel`))||Ie(!1)};return t.addEventListener("click",p),()=>t.removeEventListener("click",p)},[t,_e,e.mode]),T(()=>{if(e.mode!=="drawer"||!_e)return;let p=h=>{h.key==="Escape"&&Ie(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[_e,e.mode]);let lt=O(async(p,{continueExisting:h})=>{let E=f.value??Ue();f.value||(f.value=E,o.saveConversationId(E));let N=(h?m.value:m.value.slice(0,-1)).filter(Ee=>!Ee.ephemeral),W=Rs({messages:N.map($s),conversationId:E,tools:e.features.tools,visitorId:a,userPrefs:o.loadUserPrefs()});Rn(!0);let I=K.sendMessage(W);In(()=>I.cancel),Mn(()=>I.detach);try{for await(let we of I.iter)$n(we.chunk)||(Me.apply(we.chunk),we.chunk.type==="finish"&&we.chunk.canContinue===!1&&Jt(!1));let Ee=p.status==="error",ze=rt(p);if(Ee||ze){p.status="error",p.errorText=e.strings.errorGeneric,ie.play("error");let we=new Error(Ee?"stream error chunk":"empty reply");n.emit("error",we),e.onError?.(we)}else p.status="complete",ie.play("messageReceived"),xa(n,e,"assistant",xo(p))}catch(Ee){Nc(Ee)?yo(p)?m.value=m.value.filter(ze=>ze!==p):p.status="complete":(p.status="error",p.errorText=wt(Ee,e.strings),ie.play("error"),n.emit("error",Ee),e.onError?.(Ee))}finally{Me.detach(),Rn(!1),In(null),Mn(null),m.value=[...m.value]}},[K,Me,m,f,e,n,ie,o,a,$n]),Ha=O(()=>{if(ke||ir.current||Qt.current||m.value.filter(E=>!E.ephemeral).at(-1)?.role!=="user")return;ir.current=!0,G.info("regenerating dangling user turn (needs-generation)");let h=hn();m.value=[...m.value,h],Me.attach(h),lt(h,{continueExisting:!1}).finally(()=>{ir.current=!1})},[ke,m,Me,lt]);T(()=>{ar.current=Ha},[Ha]);let Bn=O((p,h)=>{if(ke)return;let E=m.value.at(-1),N=E?.partsSig.value.find(W=>W.kind==="tool"&&W.toolCallId===p);if(!E||!N){G.warn("decideTool: tool part not found",{toolCallId:p});return}h(N),E.partsSig.value=[...E.partsSig.value],cm(E)&&(E.status="streaming",m.value=[...m.value],Me.attach(E),lt(E,{continueExisting:!0}))},[ke,m,Me,lt]),Ba=O((p,h)=>{G.info("toolResult",{toolCallId:p}),n.emit("toolResult",{toolCallId:p}),Bn(p,E=>{E.outputSig.value=h,E.stateSig.value="output-available"})},[n,Bn]),Fa=O((p,h,E)=>{G.info("toolDecision",{toolCallId:p,approved:h}),n.emit("toolDecision",{toolCallId:p,approved:h}),Bn(p,N=>{let W=N.approvalSig.value?.id??p;N.approvalSig.value={id:W,approved:h,reason:E},N.stateSig.value="approval-responded"})},[n,Bn]),za=O(p=>{if(ke)return;let h=m.value.at(-1),E=h?.partsSig.value.find(W=>W.kind==="tool"&&W.toolCallId===p);if(!h||!E)return;let N=E.approvalSig.value?.id??p;E.approvalSig.value={id:N},E.stateSig.value="approval-requested",h.partsSig.value=[...h.partsSig.value]},[ke,m]),td=Re(()=>({humanInLoop:e.features.humanInLoop,onResult:Ba,onDecision:Fa,onEdit:za}),[e.features.humanInLoop,Ba,Fa,za]),nd=()=>m.value.reduce((p,h)=>p+(h.role==="user"?1:0),0),At=e.forms.list.length>0?e.forms:Q??e.forms,ue=ic({forms:At,persistence:o,userContext:()=>e.userContext,messageCount:nd,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>f.value,onComplete:(p,h,E,N)=>{G.info("formSubmit",{formId:p.id,trigger:h,skipped:N}),n.emit("formSubmit",{formId:p.id,values:E,skipped:N}),x(I=>{let ze=I.find(we=>we.formId===p.id&&we.outcome==="skipped")?.createdAt??Date.now();return[...I.filter(we=>!(we.formId===p.id&&we.outcome==="skipped")),{key:`local:${p.id}:${ze}`,formId:p.id,outcome:N?"skipped":"submitted",createdAt:ze,...N?{}:{values:E}}]});let W=f.value??Ue();f.value||(f.value=W,o.saveConversationId(W),K.primeIdentity(void 0,W)),!N&&p.mirrorToContext&&Qc(I=>({...I,...E})),K.submitForm({formId:p.id,conversationId:W,trigger:h,values:E,skipped:N})}}),od=J(()=>ue.activeForm.value);T(()=>{ue.refresh()},[At,ue]);let Ua=e.pageContext?.area?String(e.pageContext.area):void 0,rd=J(()=>m.value.length);T(()=>{B&&C&&ue.fire("pre-chat")},[B,C,ue]),T(()=>{C&&!Yt&&ue.fire("conversation-closed")},[C,Yt,ue]),T(()=>{B&&C&&Ua&&ue.fire("page-area")},[B,C,Ua,ue]);let dr=Re(()=>{let p=At.list.flatMap(h=>h.triggers).filter(h=>h.kind==="idle").map(h=>Number(h.param));return p.length?Math.min(...p)*1e3:0},[At]);T(()=>{if(!dr||!_e)return;let p=setTimeout(()=>ue.fire("idle"),dr);return()=>clearTimeout(p)},[dr,_e,ue,rd.value]);let Wa=O(async(p,h)=>{if(G.info("send",{textLen:p.length,attachments:h.length,streaming:ke}),ke)return;n.emit("send",{text:p,attachmentCount:h.length}),or.length>0&&An([]);let E=await um(K,h,I=>{G.warn("upload failed",{err:I}),n.emit("error",I),e.onError?.(I)});ie.unlock(),ie.play("messageSent");let N=Ds(p,E),W=hn();m.value=[...m.value,N,W],Me.attach(W),xa(n,e,"user",p),await lt(W,{continueExisting:!1}),ue.fire("after-messages")},[ke,K,n,e,or.length,m,Me,lt,ue]),ad=O(()=>{G.info("stop"),n.emit("stop",void 0),La?.()},[La,n]),id=O(()=>{if(ke)return;let p=m.value,h=p.at(-1);if(!h||h.role!=="assistant"||h.status!=="error"&&!rt(h))return;let E=hn();m.value=[...p.slice(0,-1),E],Me.attach(E),G.info("retry"),lt(E,{continueExisting:!1})},[ke,m,Me,lt]),sd=O(()=>{ie.toggleMuted();let p=ie.mutedSig.value;G.info("soundToggle",{muted:p}),n.emit("soundToggle",{muted:p})},[ie,n]),on=O(()=>{if(El(e.mode,Le)==="exit-fullscreen"){G.info("close \u2192 exit-fullscreen",{mode:e.mode}),Fe("normal"),n.emit("fullscreen",!1);return}G.info("close \u2192 panel closed",{mode:e.mode}),ue.fire("panel-close"),Ie(!1),o.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,o,Le,ue]),It=O(()=>{e.modules.list.some(p=>p.layout==="chat")&&K.listConversations({limit:50}).then(p=>{P.value=p.conversations.reduce((h,E)=>h+(E.unreadCount??0),0)}).catch(p=>G.debug("refreshUnread failed (non-fatal)",{err:p}))},[K,e.modules,P]),qa=D(!1);T(()=>{!ae||!B||qa.current||(qa.current=!0,It())},[ae,B,It]);let _r=O(()=>{G.info("open",{mode:e.mode}),ie.unlock(),Se(!0),Ie(!0),o.savePanelOpen(!0),!Ve&&!et&&Be(),setTimeout(()=>Se(!1),_m),It(),n.emit("open",void 0),e.onOpen?.()},[n,e,ie,o,Ve,et,Be,It]),ur=O(()=>{if(!m.value.some(h=>h.role==="user")&&Yt&&f.value){G.info("clear \u2192 reusing empty conversation",{conversationId:f.value}),m.value.length===0&&Dn(U.current?.messages);return}G.info("clear \u2192 new conversation",{wasStreaming:ke}),n.emit("clear",void 0),ke&&Ln?.(),Ft(()=>{m.value=[],f.value=void 0}),o.clearConversation(),Jt(!0),x([]),tn({newConversation:!0})},[ke,Ln,m,f,o,tn,n,Yt,Dn]),pr=O(()=>{ur(),nr("chat");let p=e.modules.list.find(h=>h.layout==="chat")?.id;p&&L.switchTab(p)},[ur,L,e]),mr=O(()=>{let p=Le==="expanded"?"normal":"expanded";G.info("expand",{from:Le,expanded:p==="expanded"}),Fe(p),o.savePanelSize(p),n.emit("expand",p==="expanded")},[n,Le,o]),fr=O(()=>{let p=Le==="fullscreen"?"normal":"fullscreen";G.info("fullscreen",{from:Le,fullscreen:p==="fullscreen"}),Fe(p),o.savePanelSize(p),n.emit("fullscreen",p==="fullscreen")},[n,Le,o]),ld=O(()=>{nr(p=>{let h=p==="history"?"chat":"history";return G.info("toggleHistory",{view:h}),n.emit("toggleHistory",{view:h}),h})},[n]),cd=O(p=>{G.info("localeChange",{locale:p}),c(p),je({locale:p}),n.emit("localeChange",p)},[je,n]),dd=O(p=>{G.info("themeChange",{mode:p}),u(p),t.dataset.theme=p,je({themeMode:p}),n.emit("themeChange",p)},[t,je,n]),_d=O(p=>{G.info("textSizeChange",{size:p}),g(p),t.dataset.textSize=p,je({textSize:p}),n.emit("textSizeChange",p)},[t,je,n]),ud=O(()=>{Jc(p=>{let h=!p;return G.info("sidebarToggle",{collapsed:h}),o.saveSidebarCollapsed(h),n.emit("sidebarToggle",{collapsed:h}),h})},[o,n]),pd=O(p=>{G.info("resize",p),je({widgetSize:p}),n.emit("resize",p)},[je,n]),gr=O(async p=>{G.info("selectConversation",{conversationId:p,wasStreaming:ke}),n.emit("selectConversation",{conversationId:p}),ke&&Ln?.();try{let[h,E]=await Promise.all([K.loadConversation(p),On(p)]),N=Qr(h.messages);Ft(()=>{m.value=en(N,E),f.value=h.conversationId}),x(E),o.saveConversationId(h.conversationId),K.primeIdentity(a,h.conversationId),h.agent&&Ia(h.agent),Jt(h.canContinue),An(h.suggestions??[]),nr("chat"),cr(),await K.markRead(p),It()}catch(h){n.emit("error",h),e.onError?.(h)}},[K,m,f,n,e,o,It,On,en,ke,Ln,a,cr]),Fn=D(null),Ga=O(p=>{typeof p=="string"&&(C?ue.fire("manual",p):Fn.current=p)},[C,ue]);T(()=>{!C||!Fn.current||(ue.fire("manual",Fn.current),Fn.current=null)},[C,ue]),T(()=>Bi(t,{open:_r,close:on,expand:mr,fullscreen:fr,openForm:Ga}),[t,_r,on,mr,fr,Ga]);let De=Re(()=>Rr(e,s,d,_),[e,s,d,_]);Nn.current=De.strings;let md=Re(()=>S.map(p=>{let h=At.list.find(E=>E.id===p.formId);return{...p,title:h?.title,form:h}}),[S,At]),Va={options:De,transport:K,feedback:ie,bus:n,persistence:o,view:qc,canSend:Yt,isStreaming:ke,loadingMessages:v,messagesSig:m,agent:Gc,suggestions:or,initialWidgetSize:l.widgetSize??null,visitorId:a,onClose:on,onClear:ur,onExpand:mr,onFullscreen:fr,onSoundToggle:sd,onToggleHistory:ld,onSelectHistoryConversation:gr,onNewConversation:pr,onLocaleChange:cd,onThemeChange:dd,onTextSizeChange:_d,onWidgetSizeChange:pd,onSend:Wa,onStop:ad,onSuggestion:p=>{let h=p.text??p.label;G.info("suggestion",{text:h}),n.emit("suggestion",{text:h}),Wa(h,[])},activeForm:od.value?.form??null,formMarkers:md,onFormSubmit:ue.complete,onFormSkip:ue.skip,onFormFill:p=>ue.fire("manual",p),tool:td,onRetry:id},fd=p=>{gr(p);let h=z();h&&L.switchTab(h)};if(!B)return null;let rn=De.modules.list,hr=p=>{let h=Sn("close",De.mode,p);return rn.length===0?r(Ic,{strings:De.strings,onClose:h?on:void 0}):rn.length===1&&rn[0]?.layout==="chat"?r(ac,{...Va,panelSize:p}):r(Ac,{panelProps:{...Va,panelSize:p,onClose:h?on:void 0},enabledModules:rn,nav:L,bus:n,unreadCount:P.value,onSelectConversation:fd,onStartNewConversation:pr,onSetPanelSize:Fe})};if(e.mode==="page"){let p=E=>{gr(E.conversationId)},h=rn.some(E=>E.layout==="chat");return r("div",{class:`${Yo}-anchor`,children:r(cc,{site:Vc,blocks:jc,transport:K,strings:De.strings,locale:De.locale,persistence:o,visitorId:a,showConversations:h,onSelectConversation:p,onNewConversation:pr,sidebarCollapsed:Yc,onToggleSidebarCollapsed:ud,children:hr("fullscreen")})})}if(re){let p=e.mode==="standalone"?"fullscreen":Le;return r("div",{class:`${Yo}-anchor`,children:hr(p)})}let Ka=e.mode==="drawer",ja=!(e.mode==="modal")&&!e.launcher.hidden&&(!_e||Pe),Xa=ja&&!Pe&&!Ve&&!Ka?De.launcher.callout:null;return r("div",{class:`${Yo}-anchor`,"data-launcher-size":De.launcher.size,children:[_e||ae?r("div",{class:`${Yo}-surface`,hidden:!_e,children:hr(Le)}):null,ja?r(kl,{onToggle:_r,launcher:De.launcher,strings:De.strings,leaving:Pe,edgeTab:Ka}):null,Xa?r(wl,{callout:Xa,launcherPosition:De.position,strings:De.strings,closeLabel:De.strings.close,onDismiss:Be}):null]})}function dm(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var _m=120;async function um(e,t,n){let o=[];for(let a of t)try{let{id:i,url:l}=await e.uploadFile(a.file);o.push({id:i,name:a.name,mediaType:a.mediaType,size:a.size,url:l})}catch(i){n(i)}return o}function xa(e,t,n,o){let a={role:n,text:o};e.emit("message",a),t.onMessage?.(a)}var pm=F.scope("error-boundary"),Jo=class extends _t{constructor(){super(...arguments);q(this,"state",{crashed:!1})}componentDidCatch(n,o){pm.error("widget render crashed",{error:n,componentStack:o?.componentStack}),this.setState({crashed:!0}),this.props.onError(n,o?.componentStack)}render(){return this.state.crashed?this.props.fallback:this.props.children}};var mm="1",fm=60,gm=2e3,Oc={open:()=>{},close:()=>{},expand:e=>({on:e}),fullscreen:e=>({on:e}),send:e=>({attachments:e.attachmentCount}),message:e=>({role:e.role}),stop:()=>{},clear:()=>{},suggestion:()=>{},toggleHistory:e=>({view:e.view}),handshake:()=>{},formSubmit:e=>({formId:e.formId,skipped:e.skipped}),toolResult:()=>{},toolDecision:e=>({approved:e.approved}),contentView:e=>({section:e.section,tags:e.tags,count:e.count}),contentOpen:e=>({contentId:e.contentId,tags:e.tags}),contentSearch:e=>({qlen:e.queryLength,hits:e.hitCount}),contentRead:e=>({contentId:e.contentId}),contentLinkClick:e=>({contentId:e.contentId}),attach:e=>({count:e.count,bytes:e.totalBytes}),voiceStart:()=>{},voiceStop:e=>({ms:e.durationMs}),voiceCancel:()=>{},localeChange:e=>({locale:e}),themeChange:e=>({theme:e}),textSizeChange:e=>({size:e}),soundToggle:e=>({muted:e.muted}),sidebarToggle:e=>({collapsed:e.collapsed}),calloutDismiss:()=>{},error:()=>{}};function hm(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function vm(){return location.origin+location.pathname}function bm(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function $c(e,t){let n=Math.random(),o=0,a=0,i=new Set,l=(c,d)=>{let{tracking:u,publicKey:_,aiAgentDeploymentId:g,mode:f,themeMode:m}=t.getOptions();if(!u.enabled||hm()||n>=u.sampleRate)return;let P=performance.now();if(P-o>6e4&&(o=P,a=0),++a>fm)return;let v=new URLSearchParams;v.set("v",mm),v.set("_ev",Ot),v.set("e",c),u.token&&v.set("tk",u.token),_&&v.set("pk",_),g&&v.set("dep",g),v.set("vid",t.getVisitorId());let b=t.getConversationId();b&&v.set("cid",b),v.set("url",vm());let S=bm();S&&v.set("ref",S),v.set("sw",String(screen.width)),v.set("sh",String(screen.height)),v.set("vw",String(innerWidth)),v.set("vh",String(innerHeight)),v.set("dpr",String(devicePixelRatio)),v.set("lang",navigator.language);try{v.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(v.set("m",f),v.set("th",m),d)for(let[j,L]of Object.entries(d))L!==void 0&&v.set(j,String(L));v.set("ts",String(Date.now()));let x=`${u.endpoint}?${v}`;if(x.length>gm)return;let R=new Image(1,1);i.add(R);let z=()=>i.delete(R);R.addEventListener("load",z,{once:!0}),R.addEventListener("error",z,{once:!0}),R.src=x},s=Object.keys(Oc).map(c=>e.on(c,d=>l(c,Oc[c]?.(d))));return()=>{for(let c of s)c();i.clear()}}function Qo(e){let{bus:t,host:n,appRoot:o,persistence:a,reportError:i}=e,l=e.initialRaw,s,c=ct(l),d=!0,u=()=>{c=ct(s?Ar(l,s):l)},_=()=>{ji(n,yt(c.mode));let m=a.loadUserPrefs().themeMode;Xi(n,m?{...c,themeMode:m}:c),d&&(ao(n,ya(c)),d=!1)},g=()=>{_(),Dt(ro(Jo,{onError:i},ro(Dc,{bus:t,hostElement:n,options:c})),o)};t.on("handshake",m=>{m.config&&(m.config.storageVersion&&a.rememberStorageVersion(m.config.storageVersion),s=m.config,u(),g())});let f=$c(t,{getOptions:()=>c,getVisitorId:()=>a.getVisitorId(),getConversationId:()=>a.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>l,render:g,setUserOptions:m=>{l=m,u(),g()},patchUserOptions:m=>{l={...l,...m},u(),g()},destroy:()=>f()}}function ya(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=ut(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:o}=gn(e,Wt(),t.loadPanelOpen(),t.loadPanelSize());return ho(e.mode,o,n)}var xm=F.scope("hooks"),Sa="*",Pa=new Set;function ka(e,t,n){let o={widgetId:e,event:t,listener:n};return Pa.add(o),()=>{Pa.delete(o)}}function ym(e,t,n){let o=[...Pa];for(let a of o)if(Pm(a.widgetId,e.widgetId)&&!(a.event!==Sa&&a.event!==t))try{a.listener(e,t,n)}catch(i){xm.warn("hook listener threw",{event:t,error:i})}}function Hc(e,t){let n=[];for(let o of Sm)n.push(t.on(o,a=>{ym(e,o,a)}));return()=>{for(let o of n)o()}}function wa(e){if(Array.isArray(e))for(let t of e){let n=km(t);n&&ka(n.widgetId,n.event,n.listener)}}function Pm(e,t){return e===Sa||e===t}var Sm=["open","close","expand","fullscreen","resize","message","send","stop","clear","selectConversation","suggestion","toggleHistory","formSubmit","toolResult","toolDecision","contentView","contentOpen","contentSearch","contentRead","contentLinkClick","attach","removeAttachment","voiceStart","voiceStop","voiceCancel","localeChange","themeChange","textSizeChange","soundToggle","sidebarToggle","calloutDismiss","error","handshake","visitorRebound","conversationRebound"];function km(e){let t,n,o;if(Array.isArray(e))[t,n,o]=e;else if(e&&typeof e=="object")({widgetId:t,event:n,listener:o}=e);else return null;return typeof t!="string"||typeof n!="string"||typeof o!="function"?null:{widgetId:t,event:n,listener:o}}var st=new Map;function Zo(e){e.debug!==void 0&&Gn(e.debug);let t=F.scope("mount");t.info("mount",{widgetId:e.widgetId,publicKey:e.publicKey,mode:e.presentation?.mode});let n=ct(e),o=n.widgetId,a=st.get(o);a&&(t.debug("destroy existing instance at slot",{widgetId:o}),a.destroy());let i=ya(n),l=n.iframe?Qi({position:yt(n.mode)},n.position,i,n.mode,e.target??null):$t({position:yt(n.mode),target:e.target??null});l.hostElement.dataset.widgetId=o;let s=new Ht,c=ut(o,n.storage,n.aiAgentDeploymentId),d=P=>{s.emit("error",P),u.getOptions().onError?.(P)},u=Qo({bus:s,host:l.hostElement,appRoot:l.appRoot,persistence:c,initialRaw:e,reportError:d});u.render();let _=l.hostElement,g=null,f=P=>{P.debug!==void 0&&Gn(P.debug),u.patchUserOptions(P)},m={widgetId:o,open:()=>dn(_,"open"),close:()=>dn(_,"close"),expand:()=>dn(_,"expand"),openForm:P=>dn(_,"openForm",P),on:(P,v)=>s.on(P,v),update:P=>{t.debug("update",{patch:P}),f(P)},setUserContext:P=>{t.debug("setUserContext",{keys:Object.keys(P)}),f({userContext:{...u.getUserOptions().userContext,...P}})},clearUserContext:()=>{t.debug("clearUserContext"),f({userContext:void 0})},setPageContext:P=>{t.debug("setPageContext",{keys:Object.keys(P)}),f({pageContext:{...u.getUserOptions().pageContext,...P}})},clearPageContext:()=>{t.debug("clearPageContext"),f({pageContext:void 0})},setDebug:P=>{Gn(P),t.info("debug level set",{level:an()})},debugLevel:()=>an(),onLog:P=>sn(P),destroy:()=>{t.info("destroy",{widgetId:o}),g?.(),u.destroy(),s.clear(),Dt(null,l.appRoot),l.destroy(),st.get(o)===m&&st.delete(o)}};return g=Hc(m,s),st.set(o,m),m}function er(e){let t=e.widgetId??"default",n=st.get(t);return n?(n.update(e),n):Zo(e)}function Ca(e){if(e!==void 0){st.get(e)?.destroy();return}let t=[...st.values()];for(let n of t)n.destroy()}function Qe(e="default"){return st.get(e)??null}function Bc(){return[...st.values()]}function Ea(e,t,n){return ka(e,t,n)}var Fc=Ot;var Ta=class extends HTMLElement{constructor(){super(...arguments);q(this,"bus",new Ht);q(this,"mountResult",null);q(this,"runtime",null)}static get observedAttributes(){return Ir}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,Dt(null,this.mountResult.appRoot),this.bus.clear())}attributeChangedCallback(){this.isConnected&&this.boot()}boot(){let n=Xn(i=>this.getAttribute(i));if(this.runtime){this.runtime.setUserOptions(n);return}let o=ct(n);this.mountResult||(this.mountResult=$t({existingHost:this,position:yt(o.mode)}));let a=ut(o.widgetId,o.storage,o.aiAgentDeploymentId);this.runtime=Qo({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:a,initialRaw:n,reportError:i=>this.bus.emit("error",i)}),this.runtime.render()}},zc=!1;function Ra(){if(zc||typeof customElements>"u")return;let e=y.tagName;customElements.get(e)||customElements.define(e,Ta),zc=!0}typeof customElements<"u"&&Ra();var Uc=F.scope("iife"),Aa={close:()=>Qe()?.close(),destroy:()=>Ca(),expand:()=>Qe()?.expand(),hook:(e,t,n)=>typeof e=="string"&&typeof t=="string"&&typeof n=="function"?Ea(e,t,n):void 0,init:e=>er(e),mount:e=>Zo(e),on:(e,t)=>Qe()?.on(e,t),onLog:e=>sn(e),open:()=>Qe()?.open(),setDebug:e=>Qe()?.setDebug(e),update:e=>Qe()?.update(e)};function Wc(e,...t){let n=Aa[e];if(!n){Uc.warn("unknown command",{command:e});return}return n(...t)}function wm(){let e=((n,...o)=>Wc(n,...o));e.init=er,e.mount=Zo,e.destroy=Ca,e.getInstance=Qe,e.getAllInstances=Bc,e.version=Fc,e.hook=Ea,e.debugLevel=()=>an(),e.onLog=sn;let t=new Set(["init","mount","hook","onLog"]);for(let n of Object.keys(Aa))t.has(n)||(e[n]=(...o)=>Aa[n](...o));return e}function Cm(e){let t=e?.q;if(t)for(let n of t){let o=[...n],[a,...i]=o;if(typeof a=="string")try{Wc(a,...i)}catch(l){Uc.warn("queued command failed",{command:a,error:l})}}}function Em(){let e=[],t=e.push.bind(e);return e.push=(...n)=>{for(let o of n)wa([o]);return t(...n)},e}function Tm(){let e=document.scripts;for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.src.includes("elements"))return n}return null}function Rm(){if(typeof window>"u"||typeof document>"u")return;let e=globalThis[y.global],t=wm();globalThis[y.global]=t,Ra();let n=`${y.global}Hooks`,o=globalThis[n];if(wa(o),globalThis[n]=Em(),Cm(e),Qe())return;let a=document.currentScript??Tm(),i=Lr(a?.dataset);if(!i.publicKey)return;let l=()=>{Qe()||er(i)};if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",l,{once:!0});return}l()}Rm();return yd(Am);})();
37
+ `){oe(e),ie(e,a),e.pending=n;continue}}else{if(l===n){oe(e),ie(e,i),ie(e,a),e.pending="";continue}if(n!==" "&&n!==`
38
+ `){oe(e),ie(e,i),e.pending=n;continue}}break}case"~":if(e.token!==19&&e.token!==16){if(e.pending==="~"){if(n==="~"){e.pending=o;continue}}else if(n!==" "&&n!==`
39
+ `){oe(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=o;continue}else{if(cp(n.charCodeAt(0)))break;oe(e),ie(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){oe(e),ie(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){oe(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}oe(e)}function ba(e){return{add_token:dp,end_token:_p,add_text:up,set_attr:pp,data:{nodes:[e,,,,,],index:0}}}function dp(e,t){let n=e.nodes[e.index],o;switch(t){case 1:return;case 20:o=document.createElement("blockquote");break;case 2:o=document.createElement("p");break;case 21:o=document.createElement("br");break;case 22:o=document.createElement("hr");break;case 3:o=document.createElement("h1");break;case 4:o=document.createElement("h2");break;case 5:o=document.createElement("h3");break;case 6:o=document.createElement("h4");break;case 7:o=document.createElement("h5");break;case 8:o=document.createElement("h6");break;case 12:case 13:o=document.createElement("em");break;case 14:case 15:o=document.createElement("strong");break;case 16:o=document.createElement("s");break;case 11:o=document.createElement("code");break;case 18:case 17:o=document.createElement("a");break;case 19:o=document.createElement("img");break;case 23:o=document.createElement("ul");break;case 24:o=document.createElement("ol");break;case 25:o=document.createElement("li");break;case 26:let a=o=document.createElement("input");a.type="checkbox",a.disabled=!0;break;case 9:case 10:n=n.appendChild(document.createElement("pre")),o=document.createElement("code");break;case 27:o=document.createElement("table");break;case 28:switch(n.children.length){case 0:n=n.appendChild(document.createElement("thead"));break;case 1:n=n.appendChild(document.createElement("tbody"));break;default:n=n.children[1]}o=document.createElement("tr");break;case 29:o=document.createElement(n.parentElement?.tagName==="THEAD"?"th":"td");break;case 30:o=document.createElement("equation-block");break;case 31:o=document.createElement("equation-inline");break}e.nodes[++e.index]=n.appendChild(o)}function _p(e){e.index-=1}function up(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function pp(e,t,n){e.nodes[e.index].setAttribute(rp(t),n)}function Go({textSig:e,doneSig:t}){let n=D(null);return It(()=>{let o=n.current;if(!o)return;o.classList.add(`${P.cssPrefix}-md`);let a=ba(o),i=va(a),l=0,s=st(()=>{let u=e.value,h=t.value;u.length<l&&(o.replaceChildren(),a=ba(o),i=va(a),l=0);let _=u.slice(l);_&&Te(i,_),l=u.length,h&&Zl(i)}),c=new MutationObserver(u=>{for(let h of u)for(let _ of h.addedNodes){if(!(_ instanceof HTMLElement))continue;let f=_.matches?.("a")?[_]:[..._.querySelectorAll?.("a")??[]];for(let m of f)ec(m)}});c.observe(o,{childList:!0,subtree:!0});for(let u of o.querySelectorAll("a"))ec(u);let d=u=>{let h=u.target?.closest?.("a");if(!h||!(h instanceof HTMLAnchorElement))return;let _=h.getAttribute("href")??"";!_||_.startsWith("#")||(u.preventDefault(),window.open(_,"_blank","noopener,noreferrer"))};return o.addEventListener("click",d),()=>{s(),c.disconnect(),o.removeEventListener("click",d)}},[e,t]),r("div",{ref:n})}function tc({text:e}){let t=Ae(()=>z(e),[e]),n=Ae(()=>z(!0),[]);return r(Go,{textSig:t,doneSig:n})}function ec(e){let t=e.getAttribute("href")??"";if(!t||t.startsWith("#"))return;e.target!=="_blank"&&(e.target="_blank");let n=new Set((e.rel||"").split(/\s+/).filter(Boolean));n.add("noopener"),n.add("noreferrer"),e.rel=[...n].join(" ")}var Ko=P.cssPrefix;function nc({messageId:e,initial:t,strings:n,onFeedback:o}){let[a,i]=R(t),l=s=>{let c=a===s?null:s;i(c),o(e,c)};return r("div",{class:`${Ko}-feedback`,role:"group","data-testid":w.messageFeedback,children:[r("button",{type:"button",class:`${Ko}-feedback-btn`,"data-active":a==="up"?"true":void 0,"aria-pressed":a==="up","aria-label":n.feedbackUp,title:n.feedbackUp,onClick:()=>l("up"),"data-testid":w.feedbackUp,children:r(Cl,{})}),r("button",{type:"button",class:`${Ko}-feedback-btn`,"data-active":a==="down"?"true":void 0,"aria-pressed":a==="down","aria-label":n.feedbackDown,title:n.feedbackDown,onClick:()=>l("down"),"data-testid":w.feedbackDown,children:r(Tl,{})}),r("span",{class:`${Ko}-sr-only`,role:"status","aria-live":"polite",children:a?n.feedbackThanks:""})]})}var nn=P.cssPrefix;function oc({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?r("a",{class:`${nn}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":w.source,children:[r("span",{class:`${nn}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),r("span",{class:`${nn}-source-label`,children:n})]}):r("span",{class:`${nn}-source`,"data-testid":w.source,children:[r("span",{class:`${nn}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),r("span",{class:`${nn}-source-label`,children:n})]})}var Ge=P.cssPrefix;function ya(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function jo(e,t){let n=e==="output-available"||e==="output-error"||e==="output-denied",o=e==="approval-responded"||t?.approved!==void 0;return{terminal:n,responded:o,decided:n||o}}function fp(e,t){return e==="output-error"?"error":e==="output-denied"||t?.approved===!1?"denied":e==="output-available"?"completed":e==="approval-responded"||t?.approved===!0?"responded":e==="approval-requested"?"awaiting":"running"}function gp({status:e}){return e==="denied"||e==="error"||e==="superseded"?r(Al,{}):e==="completed"||e==="responded"?r(Il,{}):r(Rl,{})}function hp(e,t){switch(e){case"awaiting":return t.statusAwaiting;case"responded":return t.statusResponded;case"completed":return t.statusCompleted;case"denied":return t.statusDenied;case"error":return t.statusError;case"superseded":return t.statusSuperseded;default:return t.statusRunning}}function vp({state:e,approval:t,strings:n,superseded:o}){let a=fp(e,t),i=o&&(a==="awaiting"||a==="running")?"superseded":a;return r("span",{class:`${Ge}-toolui-badge ${Ge}-toolui-status`,"data-status":i,children:[r("span",{class:`${Ge}-toolui-status-icon`,children:r(gp,{status:i})}),hp(i,n)]})}function bp({name:e,state:t,approval:n,strings:o,superseded:a}){return r(ne,{children:[r("span",{class:`${Ge}-toolui-wrench`,children:r(El,{})}),r("strong",{class:`${Ge}-toolui-title`,children:e}),r(vp,{state:t,approval:n,strings:o,superseded:a}),r("span",{class:`${Ge}-toolui-chevron`,children:r(No,{})})]})}function Xo({part:e,strings:t,testid:n,superseded:o}){let a=X(()=>e.inputSig.value),i=X(()=>e.outputSig.value),l=X(()=>e.errorSig.value),s=X(()=>e.stateSig.value),c=X(()=>e.approvalSig.value);return r("details",{class:`${Ge}-toolui ${Ge}-toolui-collapsible`,"data-testid":n,children:[r("summary",{class:`${Ge}-toolui-head`,children:r(bp,{name:ya(e.toolName),state:s.value,approval:c.value,strings:t,superseded:o})}),r(xa,{label:t.toolParameters,value:a.value}),i.value!==void 0?r(xa,{label:t.toolResult,value:i.value}):null,l.value?r(xa,{label:t.statusError,value:l.value,error:!0}):null]})}function xa({label:e,value:t,error:n}){let o=n?String(t??""):Yo(Pa(t));return o?r("div",{class:`${Ge}-toolui-section`,children:[r("span",{class:`${Ge}-toolui-label`,children:e}),r("pre",{class:`${Ge}-toolui-code`,"data-error":n?"true":void 0,children:o})]}):null}function Pa(e){if(e&&typeof e=="object"){let t=e;if(t.storage==="tool-result-ref"&&"summary"in t)return t.summary}return e}function Yo(e){if(e==null)return"";try{let t=typeof e=="string"?e:JSON.stringify(e,null,2);return!t||t==="{}"||t==="[]"||t==='""'?"":t.length>800?`${t.slice(0,800)}\u2026`:t}catch{return""}}var Ue=P.cssPrefix;function rc({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=X(()=>e.approvalSig.value),s=X(()=>e.stateSig.value),c=ya(e.toolName),d=l.value?.approved,{terminal:u,responded:h,decided:_}=jo(s.value,l.value),f=h&&n&&!u,m=o&&!_,y=e.toolCallId;return r("div",{class:`${Ue}-toolui-group`,"data-testid":_?w.toolDecision:w.toolApproval,children:[r(Xo,{part:e,strings:t,superseded:m}),m||u?null:r("div",{class:`${Ue}-toolui ${Ue}-toolui-body`,children:[h?r(ne,{children:[r("p",{class:`${Ue}-toolui-prompt`,children:[t.approvalYourResponse.replace("{decision}",d?t.approve:t.reject),l.value?.reason?` \u2014 ${l.value.reason}`:""]}),f?r("p",{class:`${Ue}-toolui-subtle`,children:t.approvalEditHint}):null,!f&&!u?r("p",{class:`${Ue}-toolui-subtle`,children:t.approvalSubmitting}):null]}):r(ne,{children:[r("p",{class:`${Ue}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",c)}),r("p",{class:`${Ue}-toolui-subtle`,children:t.approvalBody})]}),!_&&n?r("div",{class:`${Ue}-toolui-actions`,children:[r("button",{type:"button",class:`${Ue}-form-skip`,onClick:()=>a(y,!1),"data-testid":w.toolReject,children:t.reject}),r("button",{type:"button",class:`${Ue}-form-submit`,onClick:()=>a(y,!0),"data-testid":w.toolApprove,children:t.approve})]}):null,f?r("div",{class:`${Ue}-toolui-actions`,children:r("button",{type:"button",class:`${Ue}-form-skip`,onClick:()=>i(y),"data-testid":w.toolEdit,children:t.edit})}):null]})]})}var xp=new Set(["text","email","phone","number","date","single-select","multi-select","boolean"]);function ac(e){let t=e&&typeof e=="object"?e:{},o=(Array.isArray(t.questions)?t.questions:[]).map(yp).filter(a=>a!==null);return{intro:Jo(t.intro),questions:o}}function yp(e,t){if(!e||typeof e!="object")return null;let n=e,o=xp.has(n.type)?n.type:"text";return{key:Jo(n.key)??`q${t+1}`,question:Jo(n.question)??"Please provide the missing information.",type:o,options:Array.isArray(n.options)?n.options.filter(a=>typeof a=="string"&&a.trim().length>0):void 0,required:typeof n.required=="boolean"?n.required:void 0,helpText:Jo(n.helpText)}}function Pp(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 ic(e,t,n){return e.questions.map(o=>{let a=Pp(o.type),i=o.type==="boolean"?[{value:"yes",label:t},{value:"no",label:n}]:(o.options??[]).map(l=>({value:l,label:l}));return{name:o.key,label:o.question,type:a,required:o.required??!1,options:i.length>0?i:void 0,validationHint:o.helpText}})}function Jo(e){return typeof e=="string"&&e.trim()?e.trim():void 0}var Pe=P.cssPrefix;function sc({part:e,strings:t,active:n,superseded:o=!1,onDecision:a,onEdit:i}){let l=X(()=>e.stateSig.value),s=X(()=>e.approvalSig.value),c=X(()=>ac(e.inputSig.value)),{terminal:d,responded:u,decided:h}=jo(l.value,s.value),_=c.value;if(h)return r(wp,{part:e,strings:t,req:_,editable:u&&n&&!d,onEdit:()=>i(e.toolCallId)});let f=o;return r("div",{class:`${Pe}-toolui${f?` ${Pe}-toolui-stale`:""}`,"data-testid":w.toolAskQuestions,children:[r("div",{class:`${Pe}-toolui-head`,children:f?r(ne,{children:[r("span",{class:`${Pe}-toolui-badge ${Pe}-toolui-badge-accent`,children:t.inputBadge}),r("span",{class:`${Pe}-toolui-badge ${Pe}-toolui-badge-muted`,children:t.statusSuperseded})]}):r("span",{class:`${Pe}-toolui-badge ${Pe}-toolui-badge-accent`,children:t.inputRequired})}),_.intro?r("div",{class:`${Pe}-toolui-desc`,children:_.intro}):null,f?null:r(kp,{req:_,strings:t,resolve:(m,y)=>a(e.toolCallId,y,m)})]})}function kp({req:e,strings:t,resolve:n}){let o=ic(e,t.confirmYes,t.confirmNo),a=e.questions.length===1&&e.questions[0]?.type==="text";return r(Vo,{fields:o,strings:t,submitLabel:t.inputSubmit,footerHint:a?t.inputSubmitHint:void 0,onSubmit:i=>n(Sp(e.questions,i),!0),skipLabel:t.inputSkip,onSkip:()=>n(void 0,!1),submitOnEnter:a,submitTestId:w.toolInputSubmit,skipTestId:w.toolInputSkip})}function Sp(e,t){let n=e.flatMap(o=>{let a=t[o.key];if(a==null||a.trim()==="")return[];let i=o.type==="multi-select"?a.split(",").map(l=>l.trim()).filter(Boolean):a;return[{key:o.key,value:i}]});return JSON.stringify({answers:n})}function wp({part:e,strings:t,req:n,editable:o,onEdit:a}){let i=X(()=>e.approvalSig.value),l=i.value?.approved===!1,s=i.value?.approved?Cp(i.value.reason):{};return r("div",{class:`${Pe}-toolui`,"data-testid":w.toolDecision,children:[r("div",{class:`${Pe}-toolui-head`,children:[r("span",{class:`${Pe}-toolui-badge ${Pe}-toolui-badge-accent`,children:t.inputBadge}),r("span",{class:`${Pe}-toolui-badge`,children:l?t.inputSkipped:t.inputAnswered})]}),n.intro?r("div",{class:`${Pe}-toolui-desc`,children:n.intro}):null,n.questions.map(c=>{let d=l?"":s[c.key]??"";return r("div",{class:`${Pe}-toolui-section`,children:[r("span",{class:`${Pe}-toolui-label`,children:c.question}),d?r("p",{class:`${Pe}-toolui-text`,children:d}):null]},c.key)}),o?r("div",{class:`${Pe}-toolui-actions`,children:r("button",{type:"button",class:`${Pe}-form-skip`,onClick:a,"data-testid":w.toolEdit,children:t.edit})}):null]})}function Cp(e){if(!e)return{};let n=(()=>{try{return JSON.parse(e)}catch{return}})()?.answers;if(!Array.isArray(n))return{};let o={};for(let a of n){if(!a||typeof a!="object")continue;let{key:i,value:l}=a;typeof i=="string"&&(o[i]=Array.isArray(l)?l.filter(s=>typeof s=="string").join(", "):String(l??""))}return o}function lc({part:e,strings:t}){let n=X(()=>e.inputSig.value),o=X(()=>e.outputSig.value),a=X(()=>e.errorSig.value);return X(()=>!!Yo(n.value)||!!a.value||!!Yo(Pa(o.value))).value?r(Xo,{part:e,strings:t,testid:w.toolCall}):null}var He=P.cssPrefix;function cc({message:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:l=!1,superseded:s=!1,tool:c,onRetry:d,enableMessageFeedback:u=!1,onFeedback:h}){let f=X(()=>e.partsSig.value).value,m=X(()=>lt(e)),y=X(()=>qs(e)),x=X(()=>e.partsSig.value.some($=>$.kind==="text"&&$.textSig.value.length>0)),k=X(()=>o&&e.partsSig.value.some($=>$.kind==="reasoning")),S=X(()=>{let $=e.partsSig.value,B=-1;for(let U=0;U<$.length;U++){let ee=$[U]?.kind;(ee==="text"||ee==="file"||ee==="source")&&(B=U)}return B}),b=e.role==="assistant"&&e.status==="streaming",I=n==="buffered"&&b,G=b&&!x.value,re=b&&!I&&!(k.value&&G);if(y.value)return null;let N=Tp(e.createdAt),Y=u&&!!h&&!!e.serverMessageId&&e.role==="assistant"&&!b&&e.status!=="error"&&!m.value;return r("div",{class:`${He}-bubble-row`,"data-role":e.role,"data-mid":e.serverMessageId??e.id,"data-testid":we(w.messageBubble,e.id),children:r("div",{class:`${He}-bubble-col`,children:[r("div",{class:`${He}-bubble`,children:[I?r(Mp,{label:t.loading}):f.map(($,B)=>r(Ep,{part:$,active:G,strings:t,showReasoning:o,showToolCalls:a,showSources:i,interactive:l&&($.kind!=="tool"||B>S.value),superseded:s,tool:c},Ap($))),re&&r(Lp,{}),e.status==="error"&&e.errorText||m.value?r("div",{class:`${He}-error`,role:"alert",children:[r("span",{children:e.errorText??t.errorGeneric}),d?r("button",{type:"button",class:`${He}-error-retry`,onClick:d,"data-testid":w.messageRetry,children:t.errorRetry}):null]}):null]}),N?r("time",{class:`${He}-bubble-time`,dateTime:N.iso,title:N.full,children:N.short}):null,Y&&e.serverMessageId?r(nc,{messageId:e.serverMessageId,initial:e.feedback??null,strings:t,onFeedback:h}):null]})})}function Tp(e){if(typeof e!="number"||!Number.isFinite(e))return null;try{let t=new Date(e);return{short:t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),full:t.toLocaleString(void 0,{dateStyle:"full",timeStyle:"short"}),iso:t.toISOString()}}catch{return null}}function Ep({part:e,active:t,strings:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:l,superseded:s,tool:c}){switch(e.kind){case"step-start":return null;case"text":return r(Go,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return o?r(Ip,{part:e,active:t,strings:n}):null;case"tool":return r(Rp,{part:e,strings:n,showToolCalls:a,interactive:l,superseded:s,tool:c});case"file":return e.mediaType.startsWith("image/")?r("img",{src:e.url,alt:"",loading:"lazy"}):r("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",children:e.url});case"source":return i?r(oc,{part:e,strings:n}):null}}function Rp({part:e,strings:t,showToolCalls:n,interactive:o,superseded:a,tool:i}){let l=X(()=>e.approvalSig.value!==void 0);if(i?.humanInLoop){if(Kl(e.toolName))return r(sc,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit});if(l.value)return r(rc,{part:e,strings:t,active:o,superseded:a,onDecision:i.onDecision,onEdit:i.onEdit})}return n?r(lc,{part:e,strings:t}):null}function Ip({part:e,active:t,strings:n}){return r("details",{class:`${He}-reasoning`,open:t,"data-active":t?"true":void 0,children:[r("summary",{class:`${He}-reasoning-summary`,children:r("span",{class:`${He}-reasoning-label`,children:t?n.thinking:n.thoughts})}),r("div",{class:`${He}-reasoning-body`,children:r(Go,{textSig:e.textSig,doneSig:e.doneSig})})]})}function Ap(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 Lp(){return r("span",{class:`${He}-typing`,"aria-hidden":"true",children:[r("span",{}),r("span",{}),r("span",{})]})}function Mp({label:e}){return r("span",{class:`${He}-loading`,role:"status",children:[r("span",{class:`${He}-loading-spinner`,"aria-hidden":"true"}),r("span",{class:`${He}-loading-label`,children:e})]})}var Ke=P.cssPrefix,Qo=120,Np=350,Dp=12,Op=8;function dc({messagesSig:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,scrollFade:l,scrollAnchor:s,enableMessageFeedback:c,onFeedback:d,onMessageSeen:u,loading:h,idle:_,tool:f,onRetry:m,form:y,formMarkers:x,onFillForm:k}){let S=D(null),b=X(()=>e.value),[I,G]=R(!1),re=D(null),N=D(new Set),Y=D(new Set),[$,B]=R(0),U=D(!1),ee=D(!1),C=D(!1),Q=D(0),se=()=>C.current||performance.now()-Q.current<Np,xe=D(0),pe=g=>g.serverMessageId??g.id,Le=g=>{if(!l)return;let A=g.scrollHeight-g.clientHeight>1;g.dataset.fadeTop=A&&g.scrollTop>1?"true":"false",g.dataset.fadeBottom=A&&g.scrollHeight-g.scrollTop-g.clientHeight>1?"true":"false"},ce=g=>G(g.scrollHeight-g.scrollTop-g.clientHeight>Qo*2),Xe=g=>{if(g.scrollHeight-g.scrollTop-g.clientHeight<=Qo*2)return B(0);let A=0;for(let te of b.value)te.role==="assistant"&&!N.current.has(pe(te))&&A++;B(A)},Pt=()=>{for(let g of b.value)g.role==="assistant"&&N.current.add(pe(g));B(0)},me=g=>{xe.current=performance.now(),g.scrollTop=g.scrollHeight,Le(g)},Ye=(g,A)=>{me(g);let te=A,le=0,ae=()=>{me(g),--te>0&&(le=requestAnimationFrame(ae))};return A>0&&(le=requestAnimationFrame(ae)),()=>cancelAnimationFrame(le)},kt=(g,A)=>{let te,le,ae,Ee=-1,ke=()=>{te.disconnect(),le.disconnect(),clearTimeout(ae)},Oe=()=>{if(ee.current||se()||Ee>=0&&g.scrollTop<Ee-4)return ke();me(g),Ee=g.scrollTop};return te=new ResizeObserver(Oe),le=new MutationObserver(Oe),Oe(),te.observe(g),le.observe(g,{childList:!0,subtree:!0,characterData:!0}),ae=setTimeout(ke,A),ke},Ht=(g,A)=>A.getBoundingClientRect().top-g.getBoundingClientRect().top+g.scrollTop,rn=g=>{let A=g.querySelectorAll(`.${Ke}-bubble-row[data-role="user"]`);return A[A.length-1]},St=g=>{let A=re.current;if(!A)return;let te=s==="turn"?rn(g):void 0;if(!te){A.style.minBlockSize="0px";return}let le=g.scrollHeight-Ht(g,te)-A.offsetHeight;A.style.minBlockSize=`${Math.max(0,g.clientHeight-le-Op)}px`},an=g=>{let A=rn(g);A&&(St(g),xe.current=performance.now(),g.scrollTop=Math.max(0,Ht(g,A)-Dp),Le(g))},Ft=(g,A)=>{an(g);let te=A,le=0,ae=()=>{an(g),--te>0&&(le=requestAnimationFrame(ae))};return A>0&&(le=requestAnimationFrame(ae)),()=>cancelAnimationFrame(le)},sn=b.value[0]?.id;It(()=>{let g=S.current;if(g&&b.value.length!==0){U.current=!0;for(let A of b.value)A.role==="assistant"&&N.current.add(pe(A));if(b.value.some(A=>A.role==="user"))return s==="turn"?Ft(g,6):kt(g,300)}},[sn]);let Me=D(0);T(()=>{let g=S.current,A=b.value,te=Me.current;if(Me.current=A.length,!g||!U.current)return;if(A.slice(te).some(ae=>ae.role==="user"))return ee.current=!1,B(0),s==="turn"?Ft(g,6):Ye(g,3);if(!A.some(ae=>ae.role==="user"))return;if(s==="turn"){St(g),Xe(g);return}if(ee.current||se())return Xe(g);g.scrollHeight-g.scrollTop-g.clientHeight<Qo&&me(g)},[b.value.length]);let ot=D(null);T(()=>{let g=S.current,A=b.value.at(-1),te=ot.current;if(ot.current=A?.id??null,!!g&&U.current&&!(!A||A.id!==te||A.status!=="streaming"))return ee.current=!1,s==="turn"?Ft(g,6):Ye(g,3)},[b.value]),T(()=>{let g=S.current;if(!g)return;let A=b.value.at(-1);if(!A||A.status!=="streaming"&&!b.value.some(ae=>ae.role==="user"))return;if(s==="turn"){let ae=()=>{St(g),Le(g),ce(g),Xe(g)};if(ae(),A.status!=="streaming")return;let Ee=new MutationObserver(ae);return Ee.observe(g,{childList:!0,subtree:!0,characterData:!0}),()=>Ee.disconnect()}let te=()=>{if(ee.current||se())return;g.scrollHeight-g.scrollTop-g.clientHeight<Qo*2&&me(g)};if(A.status!=="streaming")return kt(g,300);te();let le=new MutationObserver(te);return le.observe(g,{childList:!0,subtree:!0,characterData:!0}),()=>le.disconnect()},[b.value]);let ln=y?.form.id,cn=!!y&&(x??[]).some(g=>g.formId===y.form.id);It(()=>{let g=S.current;!g||!ln||ee.current||b.value.some(A=>A.role==="user")&&(cn?g.querySelector(`[data-testid="${w.formGate}"]`)?.scrollIntoView({block:"nearest"}):me(g))},[ln,cn]),T(()=>{let g=S.current;if(!g)return;let A=()=>{ce(g),Le(g),g.scrollHeight-g.scrollTop-g.clientHeight<=8?Pt():Xe(g),performance.now()-xe.current>150&&(ee.current=g.scrollHeight-g.scrollTop-g.clientHeight>8)},te=()=>{ee.current=!0},le=wt=>{wt.deltaY<0&&te()},ae=0,Ee=wt=>{ae=wt.touches[0]?.clientY??0,C.current=!0},ke=wt=>{(wt.touches[0]?.clientY??0)>ae+4&&te()},Oe=()=>{C.current=!1,Q.current=performance.now()},Wn=()=>{C.current=!0};return g.addEventListener("scroll",A,{passive:!0}),g.addEventListener("wheel",le,{passive:!0}),g.addEventListener("touchstart",Ee,{passive:!0}),g.addEventListener("touchmove",ke,{passive:!0}),g.addEventListener("touchend",Oe,{passive:!0}),g.addEventListener("touchcancel",Oe,{passive:!0}),g.addEventListener("pointerdown",Wn,{passive:!0}),window.addEventListener("pointerup",Oe,{passive:!0}),window.addEventListener("pointercancel",Oe,{passive:!0}),ce(g),()=>{g.removeEventListener("scroll",A),g.removeEventListener("wheel",le),g.removeEventListener("touchstart",Ee),g.removeEventListener("touchmove",ke),g.removeEventListener("touchend",Oe),g.removeEventListener("touchcancel",Oe),g.removeEventListener("pointerdown",Wn),window.removeEventListener("pointerup",Oe),window.removeEventListener("pointercancel",Oe)}},[]);let dn=()=>{let g=S.current;g&&(ee.current=!1,me(g),Pt())};T(()=>{let g=S.current;if(!g||typeof IntersectionObserver>"u")return;let A=new IntersectionObserver(te=>{let le=!1;for(let ae of te){if(!ae.isIntersecting)continue;let Ee=ae.target,ke=Ee.dataset.mid;Ee.dataset.role!=="assistant"||!ke||(Y.current.has(ke)||(Y.current.add(ke),u?.(ke)),N.current.has(ke)||(N.current.add(ke),le=!0))}le&&Xe(g)},{root:g,threshold:.01});return g.querySelectorAll(`.${Ke}-bubble-row[data-role="assistant"]`).forEach(te=>A.observe(te)),()=>A.disconnect()},[b.value.length]);let Je=[],_t="",fe=b.value.at(-1)?.id,rt=[...x??[]].toSorted((g,A)=>(g.createdAt??1/0)-(A.createdAt??1/0)),zn=g=>y&&g.formId===y.form.id?r(pa,{form:y.form,strings:t,onSubmit:y.onSubmit,onSkip:y.onSkip},`gate:${g.formId}`):r(Gl,{marker:g,strings:t,onFill:!y&&k?()=>k(g.formId):void 0},g.key),Un=g=>{for(let A=rt[0];A?.createdAt!==void 0&&!(g!==void 0&&A.createdAt>g);A=rt[0])rt.shift(),Je.push(zn(A))};for(let g of b.value){if(g.role==="assistant"&&g.id!==fe&&lt(g))continue;Un(g.createdAt);let A=$p(g.createdAt);A&&A!==_t&&(Je.push(r("div",{class:`${Ke}-date-divider`,children:r("span",{class:`${Ke}-date-pill`,title:Hp(g.createdAt),children:Fp(g.createdAt,t)})},`day:${A}`)),_t=A),Je.push(r(cc,{message:g,strings:t,responseMode:n,showReasoning:o,showToolCalls:a,showSources:i,interactive:!!_&&g.id===fe,superseded:g.id!==fe,tool:f,onRetry:_&&g.id===fe?m:void 0,enableMessageFeedback:c,onFeedback:d},g.id))}for(let g of rt)Je.push(zn(g));return r("div",{class:`${Ke}-list-wrap`,children:[r("div",{ref:S,class:`${Ke}-list${l?` ${Ke}-list--fade`:""}`,role:"log","aria-live":"polite","aria-relevant":"additions text",children:[h&&b.value.length===0?r("div",{class:`${Ke}-list-loading`,role:"status",children:t.conversationLoading}):null,Je,y&&!cn?r(pa,{form:y.form,strings:t,onSubmit:y.onSubmit,onSkip:y.onSkip}):null,s==="turn"?r("div",{ref:re,class:`${Ke}-turn-spacer`,"aria-hidden":"true"}):null]}),I?r("button",{type:"button",class:`${Ke}-jump${$>0?` ${Ke}-jump--new`:""}`,onClick:dn,"aria-label":$>0?`${$} ${t.newMessages}`:t.scrollToBottom,title:$>0?`${$} ${t.newMessages}`:t.scrollToBottom,"data-testid":w.scrollToBottom,children:[$>0?r("span",{class:`${Ke}-jump-count`,children:$}):null,r(No,{})]}):null]})}function $p(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Hp(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function Fp(e,t){let n=new Date(e),o=i=>new Date(i.getFullYear(),i.getMonth(),i.getDate()).getTime(),a=Math.round((o(new Date)-o(n))/864e5);return a<=0?t.dateToday:a===1?t.dateYesterday:a<7?n.toLocaleDateString(void 0,{weekday:"long"}):n.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}var Bp=["today","yesterday","lastWeek","older"];function zp(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let o=Math.floor((_c(e)-_c(n))/(1440*60*1e3));return o<=0?"today":o===1?"yesterday":o<7?"lastWeek":"older"}function uc(e,t){let n=new Map;for(let o of t){let a=zp(e,o.lastMessageAt),i=n.get(a);i?i.push(o):n.set(a,[o])}return Bp.filter(o=>n.has(o)).map(o=>({bucket:o,conversations:n.get(o)}))}function _c(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var Up=W.scope("history"),Wp=3,Vp=6,qp={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function Gp(e,t,n){let o=Date.parse(e);return Number.isFinite(o)?new Date(o).toDateString()===new Date(t).toDateString()?new Intl.DateTimeFormat(n,{hour:"numeric",minute:"2-digit"}).format(o):t-o<10080*60*1e3?new Intl.DateTimeFormat(n,{weekday:"short"}).format(o):new Intl.DateTimeFormat(n,{month:"short",day:"numeric"}).format(o):""}function Zo({transport:e,strings:t,locale:n,persistence:o,visitorId:a,onSelect:i,onNewConversation:l}){let s=P.cssPrefix,c=e.peekConversations({visitorId:a}),[d,u]=R(c?"loaded":"loading"),[h,_]=R(c?.conversations??[]);T(()=>{let x=!1;return e.listConversations({visitorId:a}).then(k=>{if(x)return;let S=k.conversations??[];_(S),u("loaded"),o.saveHistoryCount(S.length)}).catch(k=>{x||(Up.warn("listConversations failed",{err:k}),u("error"))}),()=>{x=!0}},[e,a,o]);let f=l?r("div",{class:`${s}-history-footer`,children:r("button",{type:"button",class:`${s}-history-new`,onClick:l,"data-testid":w.sidebarNewConversation,children:[r(Zs,{}),t.newConversation]})}):null;if(d==="loading"){let x=Math.min(o.loadHistoryCount()??Wp,Vp);return r(ne,{children:[r("div",{class:`${s}-history`,"aria-busy":"true","aria-label":t.historyLoading,children:r("div",{class:`${s}-history-group`,"aria-hidden":"true",children:[r("div",{class:`${s}-history-heading`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-heading`})}),r("div",{class:`${s}-history-card`,children:Array.from({length:Math.max(1,x)},(k,S)=>r("div",{class:`${s}-history-item ${s}-history-item-skeleton`,children:[r("span",{class:`${s}-history-avatar ${s}-skeleton`}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-title`})}),r("span",{class:`${s}-history-time`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-time`})})]}),r("span",{class:`${s}-history-row`,children:r("span",{class:`${s}-history-preview`,children:r("span",{class:`${s}-skeleton ${s}-skeleton-preview`})})})]})]},S))})]})}),f]})}if(d==="error"||h.length===0)return r(ne,{children:[r("div",{class:`${s}-history-empty`,children:t.historyEmpty}),f]});let m=Date.now(),y=uc(m,h);return r(ne,{children:[r("div",{class:`${s}-history`,role:"list",children:y.map(x=>r("div",{class:`${s}-history-group`,children:[r("div",{class:`${s}-history-heading`,children:t[qp[x.bucket]]}),r("div",{class:`${s}-history-card`,children:x.conversations.map(k=>r("button",{type:"button",role:"listitem",class:`${s}-history-item`,onClick:()=>i(k),"data-closed":k.canContinue?void 0:"true","data-unread":k.hasUnread?"true":void 0,"data-testid":we(w.historyItem,k.conversationId),children:[r("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:r(aa,{})}),r("span",{class:`${s}-history-body`,children:[r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-title`,children:k.title}),r("span",{class:`${s}-history-time`,children:Gp(k.lastMessageAt,m,n)})]}),r("span",{class:`${s}-history-row`,children:[r("span",{class:`${s}-history-preview`,children:k.preview??(k.canContinue?t.historyContinue:t.conversationClosed)}),k.hasUnread?r("span",{class:`${s}-history-dot`}):null]})]})]},k.conversationId))})]},x.bucket))}),f]})}var pc=P.cssPrefix;function mc({suggestions:e,onPick:t}){return e.length===0?null:r("div",{class:`${pc}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((n,o)=>r("button",{type:"button",class:`${pc}-suggestion`,onClick:()=>t(n),"data-testid":we(w.suggestion,o),children:n.label},n.id))})}var De=P.cssPrefix;function fc(e){let{options:t,onClose:n}=e,o=t.strings,a=D(null);T(()=>{let c=a.current;if(!c)return;let d=Fo(c),u=h=>{h.key==="Escape"&&n?.()};return c.addEventListener("keydown",u),()=>{d(),c.removeEventListener("keydown",u)}},[n]);let i=D(null),l=H(c=>{i.current?.attachFromDrop(c)},[]),{visible:s}=Uo({containerRef:a,onDrop:l});return $o(a.current,t.mode==="modal"),r("div",{ref:a,class:`${De}-panel`,role:"dialog","aria-modal":"false","aria-label":o.panelTitle,style:{position:"relative"},"data-testid":w.panel,children:[r(ka,{...e,containerEl:a.current,dragOver:s,composerAttachApiRef:i}),r(Sa,{poweredBy:e.options.poweredBy})]})}function ka(e){let{options:t,transport:n,feedback:o,bus:a,persistence:i,panelSize:l,view:s,canSend:c,isStreaming:d,loadingMessages:u,messagesSig:h,agent:_,suggestions:f,initialWidgetSize:m,visitorId:y,onClose:x,onBack:k,onClear:S,onToggleHistory:b,onSelectHistoryConversation:I,onNewConversation:G,onWidgetSizeChange:re,onSend:N,onStop:Y,onSuggestion:$,activeForm:B,formMarkers:U,onFormSubmit:ee,onFormSkip:C,onFormFill:Q,tool:se,onRetry:xe,onMessageFeedback:pe,onMessageSeen:Le,containerEl:ce,dragOver:Xe,composerAttachApiRef:Pt}=e,me=t.strings,Ye;return B?Ye=null:c?Ye=r(ne,{children:[r(mc,{suggestions:f,onPick:$}),r(Bl,{options:t,transport:n,feedback:o,bus:a,isStreaming:d,onSend:N,onStop:Y,attachApiRef:Pt})]}):Ye=r(jp,{label:me.conversationClosed,ctaLabel:me.startNewConversation,onNewConversation:S}),r(ne,{children:[s==="history"?r(Kp,{strings:me,onBack:b,onClose:x,showClose:Ho(t.mode,l,t.actions)}):r("header",{class:`${De}-header`,"data-testid":w.panelHeader,children:[k?r("button",{type:"button",class:`${De}-icon-btn`,onClick:k,"aria-label":me.moduleBack,title:me.moduleBack,children:r(Mn,{})}):null,_?r($l,{agent:_,strings:me}):r("h1",{children:me.panelTitle}),r(et,{panelProps:e,variant:"chat"})]}),s==="history"?r(Zo,{transport:n,strings:me,locale:t.locale,persistence:i,visitorId:y,onSelect:kt=>I(kt.conversationId),onNewConversation:G}):r(ne,{children:[r(zl,{visible:Xe,strings:me}),r(dc,{messagesSig:h,strings:me,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,scrollFade:t.scrollFade,scrollAnchor:t.scrollAnchor,enableMessageFeedback:t.enableMessageFeedback,onFeedback:pe,onMessageSeen:Le,loading:u,idle:!d,tool:se,onRetry:xe,form:B?{form:B,onSubmit:ee,onSkip:C}:null,formMarkers:U,onFillForm:Q}),Ye,r(Xp,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?r(Oo,{panelEl:ce,resize:t.size.resize,position:t.position,initialSize:m,onSizeChange:re,strings:me}):null]})}function Kp({strings:e,onBack:t,onClose:n,showClose:o}){return r("header",{class:`${De}-header`,children:[r("button",{type:"button",class:`${De}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:r(Mn,{})}),r("h1",{children:e.historyTitle}),o?r("button",{type:"button",class:`${De}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:r(Ze,{})}):null]})}function jp({label:e,ctaLabel:t,onNewConversation:n}){return r("div",{class:`${De}-readonly-banner`,role:"note",children:[r("span",{class:`${De}-readonly-label`,children:e}),r("button",{type:"button",class:`${De}-readonly-cta`,onClick:n,children:t})]})}function Xp({disclaimer:e}){return e?r("div",{class:`${De}-composer-footer`,children:r("div",{class:`${De}-disclaimer`,children:e})}):null}function Sa({poweredBy:e}){return e?r("div",{class:`${De}-poweredby-bar`,children:r(Yp,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function Yp({logoUrl:e,text:t,href:n}){let o=r(ne,{children:[e?r("img",{class:`${De}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?r("span",{children:t}):null]});return n?r("a",{class:`${De}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:o}):r("span",{class:`${De}-poweredby`,children:o})}function gc(e){let t=D(e);t.current=e;let n=D(null);return n.current??(n.current=Jp(t)),n.current}function Jp(e){let t=z(null),n=new Set,o=c=>`${e.current.conversationId()??""}:${c}`,a=c=>c.frequency==="always"?!1:c.frequency==="conversation"?n.has(o(c.id)):c.id in e.current.persistence.loadFormsDone(),i=(c,d)=>{if(t.value)return;let u=e.current;if(c==="manual"){let h=u.forms.list.find(_=>_.id===d);h&&(t.value={form:h,trigger:"manual"});return}for(let h of u.forms.byTrigger[c]??[]){let _=h.triggers.find(f=>f.kind===c);if(!(!_||!Qp(_,u)||a(h)||!Zp(h,u))){t.value={form:h,trigger:c};return}}},l=(c,d)=>{let u=t.value;if(!u)return;t.value=null;let{form:h,trigger:_}=u;h.frequency==="conversation"?n.add(o(h.id)):h.frequency!=="always"&&e.current.persistence.saveFormDone(h.id),e.current.onComplete(h,_,c,d)};return{activeForm:t,fire:i,refresh:()=>{let c=t.value;if(!c)return;let d=e.current.forms.list.find(u=>u.id===c.form.id);d&&d!==c.form&&(t.value={form:d,trigger:c.trigger})},complete:c=>l(c,!1),skip:()=>l({},!0)}}function Qp(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function Zp(e,t){let n=e.when;if(!n)return!0;if(n.missingContext?.length){let a=t.userContext()??{};if(n.missingContext.some(i=>a[i]!==void 0&&a[i]!==""))return!1}if(n.pageArea&&!(Array.isArray(n.pageArea)?n.pageArea:[n.pageArea]).includes(t.pageArea()??""))return!1;let o=t.messageCount();return!(n.minMessages!=null&&o<n.minMessages||n.maxMessages!=null&&o>n.maxMessages)}function hc(e){let t=P.cssPrefix,{site:n,blocks:o,strings:a,collapsed:i}=e,l=o?.navigation??[],s=o?.linkCards??[],c=i?a.expandSidebar:a.collapseSidebar;return r("aside",{class:`${t}-sidebar`,"data-collapsed":i?"true":"false","data-testid":w.sidebar,children:[r("div",{class:`${t}-sidebar-header`,children:[r(em,{site:n}),r("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":i?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":w.sidebarToggle,children:r(tm,{collapsed:i})})]}),i?null:r(ne,{children:[l.length>0?r("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:r(nm,{items:l})}):null,s.length>0?r("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:r(om,{items:s})}):null,e.showConversations?r("div",{class:`${t}-sidebar-conversations`,children:r(Zo,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function em({site:e}){let t=P.cssPrefix;if(e?.logo?.url){let n=e.logo.alt??e.title??"Logo";return r("picture",{children:[e.logoDark?.url?r("source",{srcset:e.logoDark.url,media:"(prefers-color-scheme: dark)"}):null,r("img",{class:`${t}-sidebar-logo`,src:e.logo.url,alt:n})]})}return r("div",{class:`${t}-sidebar-title`,children:e?.title??P.name})}function tm({collapsed:e}){return r("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true",children:e?r("polyline",{points:"9 6 15 12 9 18"}):r("polyline",{points:"15 6 9 12 15 18"})})}function nm({items:e}){let t=P.cssPrefix;return r("ul",{class:`${t}-sidebar-nav`,children:e.map(n=>r("li",{children:r("a",{class:`${t}-sidebar-nav-item`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[n.icon?r("span",{class:`${t}-sidebar-nav-icon`,"data-icon":n.icon}):null,r("span",{class:`${t}-sidebar-nav-label`,children:n.label})]})},n.id??n.label))})}function om({items:e}){let t=P.cssPrefix;return r("div",{class:`${t}-sidebar-cards`,children:e.map(n=>r("a",{class:`${t}-sidebar-card`,href:n.href,target:n.href?"_blank":void 0,rel:n.href?"noreferrer":void 0,children:[r("div",{class:`${t}-sidebar-card-label`,children:n.label}),n.description?r("div",{class:`${t}-sidebar-card-desc`,children:n.description}):null]},n.id??n.label))})}var vc=P.cssPrefix;function bc(e){return r("main",{class:`${vc}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[r(hc,{site:e.site,blocks:e.blocks,transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,showConversations:e.showConversations,onSelectConversation:e.onSelectConversation,onNewConversation:e.onNewConversation,collapsed:e.sidebarCollapsed,onToggleCollapsed:e.onToggleSidebarCollapsed}),r("section",{class:`${vc}-page-chat`,"aria-label":"Chat",children:e.children})]})}var xc=e=>Object.fromEntries(e.map(t=>[t,[]]));function yc(e,t,n){let o=z({activeTab:e,stacks:xc(t)});return{sig:o,switchTab(a){o.value.activeTab!==a&&(o.value={...o.value,activeTab:a},n?.(a))},push(a){let i=o.value,l=i.stacks[i.activeTab]??[];o.value={...i,stacks:{...i.stacks,[i.activeTab]:[...l,a]}}},pop(){let a=o.value,i=a.stacks[a.activeTab]??[];i.length!==0&&(o.value={...a,stacks:{...a.stacks,[a.activeTab]:i.slice(0,-1)}})},reset(a){o.value={activeTab:a,stacks:xc(t)}}}}var Pc=e=>e.stacks[e.activeTab]??[],kc=e=>Pc(e).at(-1),Sc=e=>Pc(e).length===0;var wc={Icon:Nn};var xt=P.cssPrefix;function er({title:e,actions:t}){return r("header",{class:`${xt}-back-header`,"data-variant":"title",children:[r("span",{class:`${xt}-back-spacer`,"aria-hidden":"true"}),r("h1",{class:`${xt}-back-title`,children:e}),t??r("span",{class:`${xt}-back-spacer`,"aria-hidden":"true"})]})}function tr({title:e,backLabel:t,onBack:n,actions:o,testid:a}){return r("header",{class:`${xt}-back-header`,"data-testid":a,children:[r("button",{type:"button",class:`${xt}-icon-btn`,onClick:n,"aria-label":t,title:t,children:r(Mn,{})}),r("h1",{class:`${xt}-back-title`,children:e}),o??r("span",{class:`${xt}-back-spacer`,"aria-hidden":"true"})]})}var on=P.cssPrefix;function Cc({placeholder:e,onActivate:t}){return r("button",{type:"button",class:`${on}-home-search`,onClick:t,"data-testid":w.homeSearch,children:[r("span",{class:`${on}-home-search-text`,children:e}),r("span",{class:`${on}-home-search-icon`,"aria-hidden":"true",children:r(sa,{})})]})}function Tc({placeholder:e,value:t,onInput:n}){return r("div",{class:`${on}-home-search`,"data-input":"true",children:[r("input",{type:"search",class:`${on}-home-search-input`,placeholder:e,value:t,onInput:o=>n(o.currentTarget.value),"data-testid":w.helpSearch}),r("span",{class:`${on}-home-search-icon`,"aria-hidden":"true",children:r(sa,{})})]})}var $n=P.cssPrefix;function nr({title:e,subtitle:t,onClick:n,testid:o}){return r("button",{type:"button",class:`${$n}-list-row`,onClick:n,"data-testid":o,children:[r("span",{class:`${$n}-list-row-body`,children:[r("span",{class:`${$n}-list-row-title`,children:e}),t?r("span",{class:`${$n}-list-row-sub`,children:t}):null]}),r("span",{class:`${$n}-list-row-chevron`,"aria-hidden":"true",children:r(Zt,{})})]})}var Ec=P.cssPrefix;function je({tone:e="info",message:t,onRetry:n,strings:o}){return r("div",{class:`${Ec}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[r("span",{children:t}),n?r("button",{type:"button",class:`${Ec}-module-retry`,onClick:n,children:o.errorRetry}):null]})}var $t=P.cssPrefix,rm=W.scope("help"),am=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function im(e){let t=new Map;for(let n of e){let o=n.categories?.[0]??"";(t.get(o)??t.set(o,[]).get(o)).push(n)}return[...t.entries()]}function Rc(e,t){let n=t.toLowerCase(),o=n.indexOf(e);if(o!==-1)return 100-Math.min(o,99);let a=0;for(let i of e){if(a=n.indexOf(i,a),a===-1)return 0;a+=1}return 1}function sm(e,t){let n=t.toLowerCase().trim();return n?e.map(o=>({item:o,score:Math.max(Rc(n,o.title)*2,Rc(n,o.description??""))})).filter(o=>o.score>0).toSorted((o,a)=>a.score-o.score).map(o=>o.item):[]}function Ic({article:e,nav:t}){return r(nr,{title:e.title,subtitle:e.description,onClick:()=>am(t,e),testid:we(w.helpArticle,e.id)})}function lm({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=R("loading"),[d,u]=R(t.errorGeneric),[h,_]=R([]),[f,m]=R(""),[y,x]=R(0);T(()=>{let b=!1;return c("loading"),e.listContent({tags:l,sortBy:"order",limit:100}).then(I=>{if(b)return;let G=I.items??[];_(G),c("loaded"),a.emit("contentView",{section:"help",tags:l?.join(","),count:G.length})}).catch(I=>{b||(rm.warn("listContent (help) failed",{err:I}),u(Mt(I,t)),c("error"))}),()=>{b=!0}},[e,l,y,a]);let k=Ae(()=>sm(h,f),[h,f]);T(()=>{let b=f.trim();if(!b)return;let I=setTimeout(()=>a.emit("contentSearch",{queryLength:b.length,hitCount:k.length}),600);return()=>clearTimeout(I)},[f,k,a]);function S(){return f.trim().length>0?k.length===0?r(je,{message:t.helpSearchEmpty,strings:t}):r("div",{class:`${$t}-help-card`,children:k.map(b=>r(Ic,{article:b,nav:o},b.id))}):s==="loading"?r(je,{message:t.helpLoading,strings:t}):s==="error"?r(je,{tone:"error",message:d,onRetry:()=>x(b=>b+1),strings:t}):h.length===0?r(je,{message:t.helpEmpty,strings:t}):im(h).map(([b,I])=>r("section",{class:`${$t}-help-group`,children:[b?r("h2",{class:`${$t}-help-section-title`,children:b}):null,r("div",{class:`${$t}-help-card`,children:I.map(G=>r(Ic,{article:G,nav:o},G.id))})]},b))}return r("div",{class:`${$t}-module`,children:[r(er,{title:t.helpTitle,actions:r(et,{panelProps:i,variant:"plain"})}),r("div",{class:`${$t}-module-pad`,children:r(Tc,{placeholder:t.helpSearchPlaceholder,value:f,onInput:m})}),r("div",{class:`${$t}-help-list`,children:S()})]})}var Ac={Icon:ia,Root:e=>r(lm,{...e})};var Lc=P.cssPrefix;function wa({onClick:e,children:t,testid:n}){return e?r("button",{type:"button",class:`${Lc}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):r("div",{class:`${Lc}-home-card`,"data-testid":n,children:t})}var _e=P.cssPrefix,Mc=W.scope("home");function cm(e){let t=e.options.userContext?.name,n=e.config.greetingText?Ie(e.strings,e.config.greetingText):void 0;return n?{title:t?n.replace("{name}",t):n.replace(/\s*\{name\}\s*/," ").trim(),subtitle:e.strings.homeGreetingLead}:t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}var dm=(e,t)=>t.url?e.push({kind:"iframe",url:t.url,title:t.title}):e.push({kind:"content",id:t.id,title:t.title});function _m(e){let{transport:t,strings:n,config:o,nav:a,bus:i,panelProps:l}=e,[s,c]=R(null),[d,u]=R([]),h=o.contentTags?.join(",");T(()=>{if(!o.showRecentConversations)return;let k=!1;return t.listConversations({limit:1}).then(S=>!k&&c(S.conversations?.[0]??null)).catch(S=>!k&&Mc.warn("listConversations (home) failed",{err:S})),()=>{k=!0}},[t,o.showRecentConversations]),T(()=>{if(!o.contentTags?.length)return;let k=!1;return t.listContent({tags:o.contentTags,limit:6}).then(S=>{if(k)return;let b=S.items??[];u(b),i.emit("contentView",{section:"home",tags:h,count:b.length})}).catch(S=>!k&&Mc.warn("listContent (home) failed",{err:S})),()=>{k=!0}},[t,h,i]);let _=cm(e),f=o.userAvatars??[],m=o.status,y=m?.text?Ie(n,m.text):n.homeStatus,x=o.contentBlockTitle?Ie(n,o.contentBlockTitle):n.homeContentTitle;return r("div",{class:`${_e}-module ${_e}-home`,"data-testid":w.homeView,children:r("div",{class:`${_e}-home-scroll`,children:[r("div",{class:`${_e}-home-hero`,children:[r("div",{class:`${_e}-home-hero-top`,children:[o.brandName?r("span",{class:`${_e}-home-brand`,"data-testid":w.homeBrand,children:o.brandName}):r("span",{class:`${_e}-home-brand-spacer`,"aria-hidden":"true"}),r("div",{class:`${_e}-home-hero-actions`,children:[f.length>0?r("div",{class:`${_e}-home-avatars`,children:f.map(k=>r("span",{class:`${_e}-home-avatar`,title:k.role?`${k.name} \xB7 ${k.role}`:k.name,children:k.avatar?r("img",{src:k.avatar,alt:"",loading:"lazy"}):r("span",{children:Bo(k.name)})},k.name))}):null,r(et,{panelProps:l,variant:"plain"})]})]}),o.showGreeting!==!1?r(ne,{children:[r("h1",{class:`${_e}-home-greeting`,"data-testid":w.homeGreeting,children:_.title}),_.subtitle?r("p",{class:`${_e}-home-lead`,children:_.subtitle}):null]}):null]}),r("div",{class:`${_e}-home-cards`,children:[o.showSearchBar!==!1?r(Cc,{placeholder:n.homeSearchPlaceholder,onActivate:()=>a.switchToLayout("help")}):null,s?r(wa,{onClick:()=>a.selectConversation(s.conversationId),testid:w.homeRecent,children:r("div",{class:`${_e}-home-recent-row`,"data-unread":s.hasUnread?"true":void 0,children:[r("span",{class:`${_e}-home-recent-avatar`,"aria-hidden":"true",children:r(Nn,{})}),r("span",{class:`${_e}-home-recent-body`,children:[r("span",{class:`${_e}-home-recent-title`,children:s.title}),s.preview?r("span",{class:`${_e}-home-recent-preview`,children:s.preview}):null]}),s.hasUnread?r("span",{class:`${_e}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,m?r(wa,{onClick:m.url?()=>a.push({kind:"iframe",url:m.url,title:y}):void 0,children:r("div",{class:`${_e}-home-status`,"data-level":m.level??"operational",children:[r("span",{class:`${_e}-home-status-icon`,"aria-hidden":"true",children:r(xl,{})}),r("span",{class:`${_e}-home-status-text`,children:y})]})}):null,d.length>0?r("section",{class:`${_e}-home-content`,children:[r("div",{class:`${_e}-home-content-title`,children:x}),r("div",{class:`${_e}-home-content-list`,children:d.map(k=>r(nr,{title:k.title,subtitle:k.description,onClick:()=>dm(a,k),testid:we(w.homeContentRow,k.id)},k.id))})]}):null]})]})})}var Nc={Icon:yl,Root:e=>r(_m,{...e})};var yt=P.cssPrefix,um=W.scope("news");function pm({transport:e,strings:t,config:n,nav:o,bus:a,panelProps:i}){let l=n.contentTags,[s,c]=R("loading"),[d,u]=R(t.errorGeneric),[h,_]=R([]),[f,m]=R(0);T(()=>{let x=!1;return c("loading"),e.listContent({tags:l,sortBy:"publishedAt",sortOrder:"desc"}).then(k=>{if(x)return;let S=k.items??[];_(S),c("loaded"),a.emit("contentView",{section:"news",tags:l?.join(","),count:S.length})}).catch(k=>{x||(um.warn("listContent (news) failed",{err:k}),u(Mt(k,t)),c("error"))}),()=>{x=!0}},[e,l,f,a]);function y(){return s==="loading"?r(je,{message:t.newsLoading,strings:t}):s==="error"?r(je,{tone:"error",message:d,onRetry:()=>m(x=>x+1),strings:t}):h.length===0?r(je,{message:t.newsEmpty,strings:t}):r("div",{class:`${yt}-news-list`,children:h.map(x=>r("button",{type:"button",class:`${yt}-news-card`,onClick:()=>o.push({kind:"content",id:x.id,title:x.title}),"data-testid":we(w.newsItem,x.id),children:[x.image?r("img",{class:`${yt}-news-hero`,src:x.image,alt:"",loading:"lazy"}):null,r("span",{class:`${yt}-news-body`,children:[r("span",{class:`${yt}-news-title`,children:x.title}),x.description?r("span",{class:`${yt}-news-summary`,children:x.description}):null]})]},x.id))})}return r("div",{class:`${yt}-module`,children:[r(er,{title:t.newsTitle,actions:r(et,{panelProps:i,variant:"plain"})}),r("div",{class:`${yt}-module-scroll`,children:y()})]})}var Dc={Icon:Pl,Root:e=>r(pm,{...e})};var or={chat:wc,home:Nc,help:Ac,news:Dc};var Hn=P.cssPrefix;function Oc({modules:e,activeTab:t,strings:n,hasUnread:o,onSelect:a}){return r("nav",{class:`${Hn}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(i=>{let l=or[i.layout].Icon,s=i.id===t,c=i.layout==="chat"&&o;return r("button",{type:"button",role:"tab","aria-selected":s,class:`${Hn}-tab`,onClick:()=>a(i.id),"data-testid":we(w.tab,i.id),children:[r("span",{class:`${Hn}-tab-icon`,"aria-hidden":"true",children:[r(l,{}),c?r("span",{class:`${Hn}-tab-badge`,"data-testid":w.tabBadge,"aria-label":"Unread"}):null]}),r("span",{class:`${Hn}-tab-label`,children:Ie(n,i.label)})]},i.id)})})}var $c=P.cssPrefix,mm="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function Hc({url:e,title:t,strings:n,onBack:o,actions:a}){return r("div",{class:`${$c}-module`,children:[r(tr,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:o,actions:a}),r("iframe",{class:`${$c}-content-frame`,src:e,title:t||"content",sandbox:mm,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var Fn=P.cssPrefix,fm=W.scope("content"),gm=5e3;function Fc({id:e,title:t,transport:n,strings:o,bus:a,onBack:i,actions:l}){let[s,c]=R(null),[d,u]=R(!1),[h,_]=R(0),f=H(()=>{u(!1),c(null),_(x=>x+1)},[]);T(()=>{let x=!1;return n.listContent({ids:[e],limit:1}).then(k=>{if(x)return;let S=k.items[0];S?(c(S),a.emit("contentOpen",{contentId:e,tags:S.tags?.length?S.tags.join(","):void 0})):u(!0)}).catch(k=>{x||(fm.warn("listContent (reader) failed",{err:k}),u(!0))}),()=>{x=!0}},[n,e,h,a]),T(()=>{if(!s)return;let x=setTimeout(()=>a.emit("contentRead",{contentId:e}),gm);return()=>clearTimeout(x)},[s,e,a]);let m=H(x=>{let S=x.target?.closest?.("a")?.getAttribute("href")??"";S&&!S.startsWith("#")&&a.emit("contentLinkClick",{contentId:e})},[a,e]);function y(){return d?r(je,{tone:"error",message:o.errorGeneric,onRetry:f,strings:o}):s===null?r(je,{message:o.contentLoading,strings:o}):r("article",{class:`${Fn}-content`,"data-testid":w.contentView,onClick:m,children:[s.image?r("img",{class:`${Fn}-content-hero`,src:s.image,alt:"",loading:"lazy"}):null,s.description?r("p",{class:`${Fn}-content-subtitle`,children:s.description}):null,r(tc,{text:s.content??""})]})}return r("div",{class:`${Fn}-module`,children:[r(tr,{title:s?.title||t||o.moduleBack,backLabel:o.moduleBack,onBack:i,actions:l,testid:w.backHeader}),r("div",{class:`${Fn}-module-scroll`,"data-testid":w.contentScroll,children:y()})]})}var rr=P.cssPrefix;function Bc({panelProps:e,enabledModules:t,nav:n,bus:o,hasUnread:a,onSelectConversation:i,onStartNewConversation:l,onSetPanelSize:s}){let c=e.options,d=c.strings,u=D(null),h=D(new Set);T(()=>{let U=u.current;if(!U)return;let ee=Fo(U),C=Q=>{Q.key==="Escape"&&e.onClose?.()};return U.addEventListener("keydown",C),()=>{ee(),U.removeEventListener("keydown",C)}},[e.onClose]);let _=D(null),f=H(U=>{_.current?.attachFromDrop(U)},[]),{visible:m}=Uo({containerRef:u,onDrop:f});$o(u.current,c.mode==="modal");let y=X(()=>n.sig.value).value,x=kc(y),k=c.modules.byId[y.activeTab],S=x?.kind==="iframe"||x?.kind==="content",b=t.length>1&&(Sc(y)||!S),I=D(null);T(()=>{if(S&&I.current===null)I.current=e.panelSize,e.panelSize==="normal"&&s("expanded");else if(!S&&I.current!==null){let U=I.current;I.current=null,s(U)}},[S]);let G={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:U=>{let ee=t.find(C=>C.layout===U);ee&&n.switchTab(ee.id)},selectConversation:i,startNewConversation:l},re=U=>({options:c,transport:e.transport,strings:d,config:U,visitorId:e.visitorId,nav:G,bus:o,panelProps:e}),N=r(et,{panelProps:e,variant:"plain"});k&&h.current.add(k.id);let Y=t.filter(U=>h.current.has(U.id)),$=U=>{if(U.layout==="chat")return r(ka,{...e,containerEl:u.current,dragOver:m,composerAttachApiRef:_});let ee=or[U.layout].Root;return ee?r(ee,{...re(U)}):null},B=()=>x?.kind==="iframe"?r(Hc,{url:x.url,title:x.title,strings:d,onBack:n.pop,actions:N}):x?.kind==="content"?r(Fc,{id:x.id,title:x.title,transport:e.transport,strings:d,bus:o,onBack:n.pop,actions:N}):null;return r("div",{ref:u,class:`${rr}-panel ${rr}-messenger`,role:"dialog","aria-modal":"false","aria-label":d.panelTitle,style:{position:"relative"},"data-testid":w.messengerHome,children:[r("div",{class:`${rr}-messenger-body`,children:[Y.map(U=>r("div",{class:`${rr}-messenger-pane`,hidden:S||U.id!==k?.id,children:$(U)},U.id)),B()]}),b?r(Oc,{modules:t,activeTab:y.activeTab,strings:d,hasUnread:a,onSelect:n.switchTab}):null,r(Sa,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(k?.layout==="chat"&&!x)?r(Oo,{panelEl:u.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:d}):null]})}var Bn=P.cssPrefix;function zc({strings:e,onClose:t}){return r("div",{class:`${Bn}-panel ${Bn}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":w.modulesEmpty,children:[t?r("button",{type:"button",class:`${Bn}-icon-btn ${Bn}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:r(Ze,{})}):null,r("p",{class:`${Bn}-modules-empty-text`,children:e.modulesEmpty})]})}function Uc({callout:e,persistence:t}){let n=e?.text??"",o=e?.persistent??!0,[a,i]=R(()=>o?!1:t.loadCalloutDismissed(n));T(()=>{i(o?!1:t.loadCalloutDismissed(n))},[n,o,t]);let l=H(()=>{i(!0),o||t.saveCalloutDismissed(n)},[t,n,o]);return{dismissed:a,dismissCallout:l}}var q=W.scope("app"),ar=P.cssPrefix;function Wc(e,t){return Ws({...e,text:Ie(t,e.text)})}function hm(e){let t=e.partsSig.value.filter(n=>n.kind==="tool");return t.length>0&&t.every(n=>{let o=n.stateSig.value;return o==="output-available"||o==="output-error"||o==="output-denied"||o==="approval-responded"})}function Vc(e){return e instanceof DOMException?e.name==="AbortError":e?.name==="AbortError"}function qc({options:e,hostElement:t,bus:n}){let[o]=R(()=>vt(e.widgetId,e.storage,e.aiAgentDeploymentId)),[a,i]=R(()=>o.getVisitorId()),l=o.loadUserPrefs(),[s,c]=R(()=>l.locale??e.locale),[d,u]=R(()=>l.themeMode??e.themeMode),[h,_]=R(()=>l.textSize??e.textSize),f=Tn(o.loadConversationId()),m=Tn([]),y=Tn(!1),[x,k]=R(!1),[S,b]=R([]);function I(){let p=e.modules.list,v=new Set(p.map(O=>O.id)),E=o.loadActiveModule();return E&&v.has(E)?E:p[0]?.id??""}function G(){return e.modules.list.find(p=>p.layout==="chat")?.id}let re=D();if(!re.current){let p=e.modules.list.map(v=>v.id);re.current=yc(I(),p,v=>o.saveActiveModule(v))}let N=re.current,Y=D(void 0);Y.current=G();let[$,B]=R(!1),[U,ee]=R(null),[C,Q]=R(!1),se=e.mode==="standalone"||e.mode==="inline",xe=D(En(e,Qt(),o.loadPanelOpen(),o.loadPanelSize())),[pe,Le]=R(xe.current.panelOpen),[ce,Xe]=R(xe.current.panelOpen),Pt=D(ce);Pt.current=ce;let me=D(!1),Ye=D(void 0);T(()=>{pe&&Xe(!0)},[pe]);let kt=D(!1),[Ht,rn]=R(!1),{dismissed:St,dismissCallout:an}=Uc({callout:e.launcher.callout,persistence:o}),Ft=e.launcher.callout?.persistent??!0,sn=H(()=>{q.info("calloutDismiss"),n.emit("calloutDismiss",void 0),an()},[n,an]),[Me,ot]=R(xe.current.panelSize),ln=D(!1),[cn,dn]=R("chat"),[Je,_t]=R(!0),[fe,rt]=R(!1),[zn,Un]=R(null),[g,A]=R([]),[te,le]=R(null),[ae,Ee]=R(null),ke=D(e.strings),[Oe,Wn]=R(void 0),[wt,$a]=R(void 0),[ed,td]=R(()=>o.loadSidebarCollapsed()??!1),[dr,nd]=R({}),[K]=R(()=>new To({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:Rs({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[Ne]=R(()=>new Io(m)),[de]=R(()=>new Mo(e.sound,e.haptics)),Qe=H(p=>{o.patchUserPrefs(p),K.saveUserPrefs(o.loadUserPrefs()).catch(v=>{q.warn("saveUserPrefs failed",{err:v})})},[o,K]);T(()=>{l.soundMuted!==void 0&&de.setMuted(l.soundMuted)},[]),T(()=>{t.dataset.theme=d},[t,d,e]),T(()=>{t.dataset.textSize=h},[t,h,e]),T(()=>{de.update(e.sound,e.haptics)},[de,e.sound,e.haptics]),T(()=>()=>de.destroy(),[de]),T(()=>{let p=!0;return de.mutedSig.subscribe(v=>{if(p){p=!1;return}Qe({soundMuted:v})})},[de,Qe]),T(()=>{ln.current||!e.size.initialSize||(ln.current=!0,!o.loadPanelSize()&&ot(ea(e.mode,e.size,Qt())))},[e.mode,e.size,o]),T(()=>{if(!$||kt.current)return;kt.current=!0;let p=En(e,Qt(),o.loadPanelOpen(),o.loadPanelSize());Le(p.panelOpen),ot(p.panelSize)},[$,e,o]);let Ha=D(!1),Fa=D(!1),_n=D(null),_r=D(null),ur=D(!1);T(()=>{if(!(!$||Ha.current)){if(Ha.current=!0,Fa.current){let p=Y.current;p&&N.switchTab(p);return}N.reset(I())}},[$]);let Vn=H(p=>{!p||p.length===0||(m.value=p.map(v=>Wc(v,ke.current)))},[m]),pr=D(null),qn=H(async p=>{try{let{formSubmissions:v}=await(p?K.bootstrap(p):pr.current??K.bootstrap()),E=new Map;return v.forEach((O,V)=>E.set(O.formId,V)),v.filter((O,V)=>!O.skipped||E.get(O.formId)===V).map((O,V)=>({key:`wire:${O.formId}:${O.createdAt??V}`,formId:O.formId,outcome:O.skipped?"skipped":"submitted",createdAt:Co(O.createdAt),values:O.values}))}catch(v){return q.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:v}),[]}},[K]),un=D(0),pn=H((p,v)=>{let E=[...p.map(L=>L.createdAt),...v.map(L=>L.createdAt)].filter(L=>L!==void 0),O=(E.length?Math.min(...E):Date.now())-1;return[...(Ye.current?.messages??[]).map(L=>{let Re=Wc(L,ke.current);return Re.createdAt=O,Re}),...p]},[]),mr=H(async p=>{let v=un.current,E=()=>v!==un.current;k(!0);try{let[O,V]=await Promise.all([K.loadConversation(p),qn()]);if(E())return;let L=ra(O.messages??[]);b(V);let Re=_n.current?[_n.current]:[];L.length||Re.length?(m.value=[...pn(L,V),...Re],_t(O.canContinue??!0),A(O.suggestions??[])):m.value=pn([],V),K.resumeStatus==="needs-generation"&&_r.current?.()}catch(O){if(E())return;q.warn("loadThread failed; resetting conversationId",{err:O,conversationId:p}),f.value=void 0,o.saveConversationId(void 0)}finally{E()||k(!1)}},[K,qn,m,f,o,pn]),mn=H(async({newConversation:p})=>{let v=++un.current,E=()=>v!==un.current,O=f.value,V=p||!O?Ve():O;V!==O&&(f.value=V,o.saveConversationId(V));let L;try{L=await K.handshake({visitorId:a,conversationId:V,userPrefs:o.loadUserPrefs(),locale:s})}catch(We){if(E())return;n.emit("error",We),e.onError?.(We),p||B(!0);return}if(E())return;if(L.visitorId&&L.visitorId!==a&&(q.info("visitor rebound",{previous:a,current:L.visitorId,reason:L.rebind?.visitorId}),o.setVisitorId(L.visitorId),i(L.visitorId),n.emit("visitorRebound",{previous:a,current:L.visitorId,reason:L.rebind?.visitorId})),L.conversationId&&L.conversationId!==V&&(q.info("conversation rebound",{previous:V,current:L.conversationId,reason:L.rebind?.conversationId}),n.emit("conversationRebound",{previous:V,current:L.conversationId,reason:L.rebind?.conversationId})),L.agent&&Un(L.agent),e.mode==="page"&&(L.site&&Ts(L.site)?Wn(L.site):L.site&&q.warn("invalid site config, using fallback",{site:L.site}),L.blocks&&Es(L.blocks)?$a(L.blocks):L.blocks&&q.warn("invalid blocks config, using fallback",{blocks:L.blocks})),L.userPrefs&&!p&&(o.saveUserPrefs(L.userPrefs),L.userPrefs.locale&&c(L.userPrefs.locale),L.userPrefs.soundMuted!==void 0&&de.setMuted(L.userPrefs.soundMuted),L.userPrefs.themeMode&&u(L.userPrefs.themeMode),L.userPrefs.textSize&&_(L.userPrefs.textSize)),Ye.current=L.welcome,p||n.emit("handshake",L),L.welcome?.suggestions){let We=ke.current;A(L.welcome.suggestions.map(Ce=>({...Ce,label:Ie(We,Ce.label),...Ce.text===void 0?{}:{text:Ie(We,Ce.text)}})))}!p&&O&&L.conversationId===O?Pt.current?mr(O):me.current=!0:(f.value=L.conversationId,o.saveConversationId(L.conversationId),Vn(L.welcome?.messages)),p||B(!0)},[K,a,o,e,n,f,de,Vn,mr,s]),fn=JSON.stringify(e.userContext??null),od=JSON.stringify(e.pageContext??null),rd=JSON.stringify(dr);T(()=>{let p=Object.keys(dr).length?{...dr,...e.userContext}:e.userContext;K.setContext(p,vm(e.pageContext))},[K,fn,od,rd]);let Fe=Ut(s,e.availableLocales,e.defaultLocale);T(()=>{K.setLocale(Fe)},[K,Fe]),T(()=>{t.dir=oi(Fe)?"rtl":"ltr"},[t,Fe]),T(()=>{Fe!==s&&c(Fe)},[Fe,s]);let Gn=H(p=>{if(p.type!=="data-conversation-rebind")return!1;let v=p.data?.conversationId;if(v&&v!==f.value){let E=f.value;f.value=v,o.saveConversationId(v),K.primeIdentity(void 0,v),q.info("conversation rebound (in-stream)",{previous:E,current:v}),E&&n.emit("conversationRebound",{previous:E,current:v,reason:v})}return!0},[f,o,K,n]),Ba=H(async p=>{let v=null;try{for await(let E of p.iter)if(!Gn(E.chunk)){if(!v){v=Rn(),_n.current=v,Ne.attach(v),m.value=[...m.value,v],rt(!0),le(()=>p.cancel),Ee(()=>p.detach),Fa.current=!0;let O=Y.current;O&&N.switchTab(O),q.info("resumed in-flight reply on mount")}Ne.apply(E.chunk),E.chunk.type==="finish"&&E.chunk.canContinue===!1&&_t(!1)}v&&(v.status==="error"||lt(v)?(v.status="error",v.errorText=e.strings.errorGeneric,de.play("error")):(v.status="complete",de.play("messageReceived"),Ca(n,e,"assistant",Eo(v))))}catch(E){v&&(Vc(E)?Ro(v)?m.value=m.value.filter(O=>O!==v):v.status="complete":(v.status="error",v.errorText=Mt(E,e.strings),de.play("error"))),q.debug("resume ended without completing",{err:E})}finally{_n.current=null,v&&(Ne.detach(),rt(!1),le(null),Ee(null),m.value=[...m.value])}},[Ne,m,de,n,e,N,Gn]),za=D(null),fr=H(async()=>{let p=K.resumeStream();za.current=p,await Ba(p),K.resumeStatus==="needs-generation"&&_r.current?.()},[K,Ba]);T(()=>{let p=f.value;return p&&K.primeIdentity(a,p),mn({newConversation:!1}),()=>{un.current++,za.current?.cancel()}},[]),T(()=>{ce&&(pr.current=K.bootstrap(),(async()=>{try{let p=await pr.current;ee(xn((p??{forms:[]}).forms,Fe))}catch(p){q.debug("bootstrap failed \u2014 treating as no forms",{err:p})}finally{Q(!0)}})(),(async()=>{let p=[];if(me.current){me.current=!1;let v=f.value;v&&p.push(mr(v))}f.value&&p.push(fr()),p.length!==0&&await Promise.allSettled(p)})())},[ce]);let Kn=D(null);T(()=>{if(!ce)return;if(Kn.current===null){Kn.current=Fe;return}if(Kn.current===Fe)return;Kn.current=Fe;let p=!1;return K.bootstrap().then(v=>{p||ee(xn((v??{forms:[]}).forms,Fe))}).catch(v=>q.debug("forms re-localize failed \u2014 keeping current copy",{err:v})),()=>{p=!0}},[ce,Fe,K]);let Ua=D(fn);T(()=>{!$||Ua.current===fn||(Ua.current=fn,mn({newConversation:!1}))},[fn,$,mn]),It(()=>{fo(t,wo(e.mode,Me,pe))},[t,pe,Me,e.mode]),T(()=>{if(e.mode!=="modal"||!pe)return;let p=v=>{v.composedPath().some(V=>V instanceof HTMLElement&&V.classList.contains(`${P.cssPrefix}-panel`))||Le(!1)};return t.addEventListener("click",p),()=>t.removeEventListener("click",p)},[t,pe,e.mode]),T(()=>{if(e.mode!=="drawer"||!pe)return;let p=v=>{v.key==="Escape"&&Le(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[pe,e.mode]);let ut=H(async(p,{continueExisting:v})=>{let E=f.value??Ve();f.value||(f.value=E,o.saveConversationId(E));let O=(v?m.value:m.value.slice(0,-1)).filter(Re=>!Re.ephemeral),V=Os({messages:O.map(Vs),conversationId:E,tools:e.features.tools,visitorId:a,userPrefs:o.loadUserPrefs()});rt(!0);let L=K.sendMessage(V);le(()=>L.cancel),Ee(()=>L.detach);try{for await(let Ce of L.iter)Gn(Ce.chunk)||(Ne.apply(Ce.chunk),Ce.chunk.type==="finish"&&Ce.chunk.canContinue===!1&&_t(!1));let Re=p.status==="error",We=lt(p);if(Re||We){p.status="error",p.errorText=e.strings.errorGeneric,de.play("error");let Ce=new Error(Re?"stream error chunk":"empty reply");n.emit("error",Ce),e.onError?.(Ce)}else p.status="complete",de.play("messageReceived"),Ca(n,e,"assistant",Eo(p))}catch(Re){Vc(Re)?Ro(p)?m.value=m.value.filter(We=>We!==p):p.status="complete":(p.status="error",p.errorText=Mt(Re,e.strings),de.play("error"),n.emit("error",Re),e.onError?.(Re))}finally{Ne.detach(),rt(!1),le(null),Ee(null),m.value=[...m.value]}},[K,Ne,m,f,e,n,de,o,a,Gn]),Wa=H(()=>{if(fe||ur.current||_n.current||m.value.findLast(E=>!E.ephemeral)?.role!=="user")return;ur.current=!0,q.info("regenerating dangling user turn (needs-generation)");let v=Rn();m.value=[...m.value,v],Ne.attach(v),ut(v,{continueExisting:!1}).finally(()=>{ur.current=!1})},[fe,m,Ne,ut]);T(()=>{_r.current=Wa},[Wa]);let jn=H((p,v)=>{if(fe)return;let E=m.value.at(-1),O=E?.partsSig.value.find(V=>V.kind==="tool"&&V.toolCallId===p);if(!E||!O){q.warn("decideTool: tool part not found",{toolCallId:p});return}v(O),E.partsSig.value=[...E.partsSig.value],hm(E)&&(E.status="streaming",m.value=[...m.value],Ne.attach(E),ut(E,{continueExisting:!0}))},[fe,m,Ne,ut]),Va=H((p,v)=>{q.info("toolResult",{toolCallId:p}),n.emit("toolResult",{toolCallId:p}),jn(p,E=>{E.outputSig.value=v,E.stateSig.value="output-available"})},[n,jn]),qa=H((p,v,E)=>{q.info("toolDecision",{toolCallId:p,approved:v}),n.emit("toolDecision",{toolCallId:p,approved:v}),jn(p,O=>{let V=O.approvalSig.value?.id??p;O.approvalSig.value={id:V,approved:v,reason:E},O.stateSig.value="approval-responded"})},[n,jn]),Ga=H(p=>{if(fe)return;let v=m.value.at(-1),E=v?.partsSig.value.find(V=>V.kind==="tool"&&V.toolCallId===p);if(!v||!E)return;let O=E.approvalSig.value?.id??p;E.approvalSig.value={id:O},E.stateSig.value="approval-requested",v.partsSig.value=[...v.partsSig.value]},[fe,m]),ad=H((p,v)=>{q.info("messageFeedback",{messageId:p,value:v}),n.emit("messageFeedback",{messageId:p,value:v}),K.submitFeedback({messageId:p,value:v})},[n,K]),id=H(p=>{n.emit("messageSeen",{messageId:p})},[n]),sd=Ae(()=>({humanInLoop:e.features.humanInLoop,onResult:Va,onDecision:qa,onEdit:Ga}),[e.features.humanInLoop,Va,qa,Ga]),ld=()=>m.value.reduce((p,v)=>p+(v.role==="user"?1:0),0),Bt=e.forms.list.length>0?e.forms:U??e.forms,he=gc({forms:Bt,persistence:o,userContext:()=>e.userContext,messageCount:ld,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>f.value,onComplete:(p,v,E,O)=>{q.info("formSubmit",{formId:p.id,trigger:v,skipped:O}),n.emit("formSubmit",{formId:p.id,values:E,skipped:O}),b(L=>{let We=L.find(Ce=>Ce.formId===p.id&&Ce.outcome==="skipped")?.createdAt??Date.now();return[...L.filter(Ce=>!(Ce.formId===p.id&&Ce.outcome==="skipped")),{key:`local:${p.id}:${We}`,formId:p.id,outcome:O?"skipped":"submitted",createdAt:We,...O?{}:{values:E}}]});let V=f.value??Ve();f.value||(f.value=V,o.saveConversationId(V),K.primeIdentity(void 0,V)),!O&&p.mirrorToContext&&nd(L=>({...L,...E})),K.submitForm({formId:p.id,conversationId:V,trigger:v,values:E,skipped:O})}}),cd=X(()=>he.activeForm.value);T(()=>{he.refresh()},[Bt,he]);let Ka=e.pageContext?.area?String(e.pageContext.area):void 0,dd=X(()=>m.value.length);T(()=>{$&&C&&he.fire("pre-chat")},[$,C,he]),T(()=>{C&&!Je&&he.fire("conversation-closed")},[C,Je,he]),T(()=>{$&&C&&Ka&&he.fire("page-area")},[$,C,Ka,he]);let gr=Ae(()=>{let p=Bt.list.flatMap(v=>v.triggers).filter(v=>v.kind==="idle").map(v=>Number(v.param));return p.length?Math.min(...p)*1e3:0},[Bt]);T(()=>{if(!gr||!pe)return;let p=setTimeout(()=>he.fire("idle"),gr);return()=>clearTimeout(p)},[gr,pe,he,dd.value]);let ja=H(async(p,v)=>{if(q.info("send",{textLen:p.length,attachments:v.length,streaming:fe}),fe)return;n.emit("send",{text:p,attachmentCount:v.length}),g.length>0&&A([]);let E=await xm(K,v,L=>{q.warn("upload failed",{err:L}),n.emit("error",L),e.onError?.(L)});de.unlock(),de.play("messageSent");let O=Us(p,E),V=Rn();m.value=[...m.value,O,V],Ne.attach(V),Ca(n,e,"user",p),await ut(V,{continueExisting:!1}),he.fire("after-messages")},[fe,K,n,e,g.length,m,Ne,ut,he]),_d=H(()=>{q.info("stop"),n.emit("stop",void 0),te?.()},[te,n]),ud=H(()=>{if(fe)return;let p=m.value,v=p.at(-1);if(!v||v.role!=="assistant"||v.status!=="error"&&!lt(v))return;let E=Rn();m.value=[...p.slice(0,-1),E],Ne.attach(E),q.info("retry"),ut(E,{continueExisting:!1})},[fe,m,Ne,ut]),pd=H(()=>{de.toggleMuted();let p=de.mutedSig.value;q.info("soundToggle",{muted:p}),n.emit("soundToggle",{muted:p})},[de,n]),gn=H(()=>{if(Ol(e.mode,Me)==="exit-fullscreen"){q.info("close \u2192 exit-fullscreen",{mode:e.mode}),ot("normal"),n.emit("fullscreen",!1);return}q.info("close \u2192 panel closed",{mode:e.mode}),he.fire("panel-close"),Le(!1),o.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,o,Me,he]),pt=H(()=>{e.modules.list.some(p=>p.layout==="chat")&&K.listConversations({limit:50}).then(p=>{y.value=p.conversations.some(v=>v.hasUnread)}).catch(p=>q.debug("refreshUnread failed (non-fatal)",{err:p}))},[K,e.modules,y]),Xa=D(!1);T(()=>{!ce||!$||Xa.current||(Xa.current=!0,pt())},[ce,$,pt]),T(()=>{if(!ce)return;let p=()=>{document.visibilityState==="visible"&&pt()};return document.addEventListener("visibilitychange",p),()=>document.removeEventListener("visibilitychange",p)},[ce,pt]);let hr=H(()=>{q.info("open",{mode:e.mode}),de.unlock(),rn(!0),Le(!0),o.savePanelOpen(!0),!St&&!Ft&&sn(),setTimeout(()=>rn(!1),bm),pt(),n.emit("open",void 0),e.onOpen?.()},[n,e,de,o,St,Ft,sn,pt]),vr=H(()=>{if(!m.value.some(v=>v.role==="user")&&Je&&f.value){q.info("clear \u2192 reusing empty conversation",{conversationId:f.value}),m.value.length===0&&Vn(Ye.current?.messages);return}q.info("clear \u2192 new conversation",{wasStreaming:fe}),n.emit("clear",void 0),fe&&ae?.(),Xt(()=>{m.value=[],f.value=void 0}),o.clearConversation(),_t(!0),b([]),mn({newConversation:!0})},[fe,ae,m,f,o,mn,n,Je,Vn]),br=H(()=>{vr(),dn("chat");let p=e.modules.list.find(v=>v.layout==="chat")?.id;p&&N.switchTab(p)},[vr,N,e]),xr=H(()=>{let p=Me==="expanded"?"normal":"expanded";q.info("expand",{from:Me,expanded:p==="expanded"}),ot(p),o.savePanelSize(p),n.emit("expand",p==="expanded")},[n,Me,o]),yr=H(()=>{let p=Me==="fullscreen"?"normal":"fullscreen";q.info("fullscreen",{from:Me,fullscreen:p==="fullscreen"}),ot(p),o.savePanelSize(p),n.emit("fullscreen",p==="fullscreen")},[n,Me,o]),md=H(()=>{dn(p=>{let v=p==="history"?"chat":"history";return q.info("toggleHistory",{view:v}),n.emit("toggleHistory",{view:v}),v})},[n]),fd=H(p=>{q.info("localeChange",{locale:p}),c(p),Qe({locale:p}),n.emit("localeChange",p)},[Qe,n]),gd=H(p=>{q.info("themeChange",{mode:p}),u(p),t.dataset.theme=p,Qe({themeMode:p}),n.emit("themeChange",p)},[t,Qe,n]),hd=H(p=>{q.info("textSizeChange",{size:p}),_(p),t.dataset.textSize=p,Qe({textSize:p}),n.emit("textSizeChange",p)},[t,Qe,n]),vd=H(()=>{td(p=>{let v=!p;return q.info("sidebarToggle",{collapsed:v}),o.saveSidebarCollapsed(v),n.emit("sidebarToggle",{collapsed:v}),v})},[o,n]),bd=H(p=>{q.info("resize",p),Qe({widgetSize:p}),n.emit("resize",p)},[Qe,n]),Pr=H(async p=>{q.info("selectConversation",{conversationId:p,wasStreaming:fe}),n.emit("selectConversation",{conversationId:p}),fe&&ae?.();try{let[v,E]=await Promise.all([K.loadConversation(p),qn(p)]),O=ra(v.messages);Xt(()=>{m.value=pn(O,E),f.value=v.conversationId}),b(E),o.saveConversationId(v.conversationId),K.primeIdentity(a,v.conversationId),v.agent&&Un(v.agent),_t(v.canContinue),A(v.suggestions??[]),dn("chat"),fr(),await K.markRead(p),pt()}catch(v){n.emit("error",v),e.onError?.(v)}},[K,m,f,n,e,o,pt,qn,pn,fe,ae,a,fr]),Xn=D(null),Ya=H(p=>{typeof p=="string"&&(C?he.fire("manual",p):Xn.current=p)},[C,he]);T(()=>{!C||!Xn.current||(he.fire("manual",Xn.current),Xn.current=null)},[C,he]),T(()=>Vi(t,{open:hr,close:gn,expand:xr,fullscreen:yr,openForm:Ya}),[t,hr,gn,xr,yr,Ya]);let $e=Ae(()=>Dr(e,s,d,h),[e,s,d,h]);ke.current=$e.strings;let xd=Ae(()=>S.map(p=>{let v=Bt.list.find(E=>E.id===p.formId);return{...p,title:v?.title,form:v}}),[S,Bt]),Ja={options:$e,transport:K,feedback:de,bus:n,persistence:o,view:cn,canSend:Je,isStreaming:fe,loadingMessages:x,messagesSig:m,agent:zn,suggestions:g,initialWidgetSize:l.widgetSize??null,visitorId:a,onClose:gn,onClear:vr,onExpand:xr,onFullscreen:yr,onSoundToggle:pd,onToggleHistory:md,onSelectHistoryConversation:Pr,onNewConversation:br,onLocaleChange:fd,onThemeChange:gd,onTextSizeChange:hd,onWidgetSizeChange:bd,onSend:ja,onStop:_d,onSuggestion:p=>{let v=p.text??p.label;q.info("suggestion",{text:v}),n.emit("suggestion",{text:v}),ja(v,[])},activeForm:cd.value?.form??null,formMarkers:xd,onFormSubmit:he.complete,onFormSkip:he.skip,onFormFill:p=>he.fire("manual",p),tool:sd,onRetry:ud,onMessageFeedback:ad,onMessageSeen:id},yd=p=>{Pr(p);let v=G();v&&N.switchTab(v)};if(!$)return null;let hn=$e.modules.list,kr=p=>{let v=Dn("close",$e.mode,p);return hn.length===0?r(zc,{strings:$e.strings,onClose:v?gn:void 0}):hn.length===1&&hn[0]?.layout==="chat"?r(fc,{...Ja,panelSize:p}):r(Bc,{panelProps:{...Ja,panelSize:p,onClose:v?gn:void 0},enabledModules:hn,nav:N,bus:n,hasUnread:y.value,onSelectConversation:yd,onStartNewConversation:br,onSetPanelSize:ot})};if(e.mode==="page"){let p=E=>{Pr(E.conversationId)},v=hn.some(E=>E.layout==="chat");return r("div",{class:`${ar}-anchor`,children:r(bc,{site:Oe,blocks:wt,transport:K,strings:$e.strings,locale:$e.locale,persistence:o,visitorId:a,showConversations:v,onSelectConversation:p,onNewConversation:br,sidebarCollapsed:ed,onToggleSidebarCollapsed:vd,children:kr("fullscreen")})})}if(se){let p=e.mode==="standalone"?"fullscreen":Me;return r("div",{class:`${ar}-anchor`,children:kr(p)})}let Qa=e.mode==="drawer",Za=!(e.mode==="modal")&&!e.launcher.hidden&&(!pe||Ht),ei=Za&&!Ht&&!St&&!Qa?$e.launcher.callout:null;return r("div",{class:`${ar}-anchor`,"data-launcher-size":$e.launcher.size,children:[pe||ce?r("div",{class:`${ar}-surface`,hidden:!pe,children:kr(Me)}):null,Za?r(Ml,{onToggle:hr,launcher:$e.launcher,strings:$e.strings,leaving:Ht,edgeTab:Qa}):null,ei?r(Nl,{callout:ei,launcherPosition:$e.position,strings:$e.strings,closeLabel:$e.strings.close,onDismiss:sn}):null]})}function vm(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var bm=120;async function xm(e,t,n){let o=[];for(let a of t)try{let{id:i,url:l}=await e.uploadFile(a.file);o.push({id:i,name:a.name,mediaType:a.mediaType,size:a.size,url:l})}catch(i){n(i)}return o}function Ca(e,t,n,o){let a={role:n,text:o};e.emit("message",a),t.onMessage?.(a)}var ym=W.scope("error-boundary"),ir=class extends ht{constructor(){super(...arguments);j(this,"state",{crashed:!1})}componentDidCatch(n,o){ym.error("widget render crashed",{error:n,componentStack:o?.componentStack}),this.setState({crashed:!0}),this.props.onError(n,o?.componentStack)}render(){return this.state.crashed?this.props.fallback:this.props.children}};var Pm="1",km=60,Sm=2e3,Gc={open:()=>{},close:()=>{},expand:e=>({on:e}),fullscreen:e=>({on:e}),send:e=>({attachments:e.attachmentCount}),message:e=>({role:e.role}),stop:()=>{},clear:()=>{},suggestion:()=>{},toggleHistory:e=>({view:e.view}),handshake:()=>{},formSubmit:e=>({formId:e.formId,skipped:e.skipped}),toolResult:()=>{},toolDecision:e=>({approved:e.approved}),messageFeedback:e=>({value:e.value??"none"}),messageSeen:()=>{},contentView:e=>({section:e.section,tags:e.tags,count:e.count}),contentOpen:e=>({contentId:e.contentId,tags:e.tags}),contentSearch:e=>({qlen:e.queryLength,hits:e.hitCount}),contentRead:e=>({contentId:e.contentId}),contentLinkClick:e=>({contentId:e.contentId}),attach:e=>({count:e.count,bytes:e.totalBytes}),voiceStart:()=>{},voiceStop:e=>({ms:e.durationMs}),voiceCancel:()=>{},localeChange:e=>({locale:e}),themeChange:e=>({theme:e}),textSizeChange:e=>({size:e}),soundToggle:e=>({muted:e.muted}),sidebarToggle:e=>({collapsed:e.collapsed}),calloutDismiss:()=>{},error:()=>{}};function wm(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function Cm(){return location.origin+location.pathname}function Tm(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function Kc(e,t){let n=Math.random(),o=0,a=0,i=new Set,l=(c,d)=>{let{tracking:u,publicKey:h,aiAgentDeploymentId:_,mode:f,themeMode:m}=t.getOptions();if(!u.enabled||wm()||n>=u.sampleRate)return;let y=performance.now();if(y-o>6e4&&(o=y,a=0),++a>km)return;let x=new URLSearchParams;x.set("v",Pm),x.set("_ev",qt),x.set("e",c),u.token&&x.set("tk",u.token),h&&x.set("pk",h),_&&x.set("dep",_),x.set("vid",t.getVisitorId());let k=t.getConversationId();k&&x.set("cid",k),x.set("url",Cm());let S=Tm();S&&x.set("ref",S),x.set("sw",String(screen.width)),x.set("sh",String(screen.height)),x.set("vw",String(innerWidth)),x.set("vh",String(innerHeight)),x.set("dpr",String(devicePixelRatio)),x.set("lang",navigator.language);try{x.set("tz",Intl.DateTimeFormat().resolvedOptions().timeZone)}catch{}if(x.set("m",f),x.set("th",m),d)for(let[re,N]of Object.entries(d))N!==void 0&&x.set(re,String(N));x.set("ts",String(Date.now()));let b=`${u.endpoint}?${x}`;if(b.length>Sm)return;let I=new Image(1,1);i.add(I);let G=()=>i.delete(I);I.addEventListener("load",G,{once:!0}),I.addEventListener("error",G,{once:!0}),I.src=b},s=Object.keys(Gc).map(c=>e.on(c,d=>l(c,Gc[c]?.(d))));return()=>{for(let c of s)c();i.clear()}}function sr(e){let{bus:t,host:n,appRoot:o,persistence:a,reportError:i}=e,l=e.initialRaw,s,c=mt(l),d=!0,u=()=>{c=mt(s?Or(l,s):l)},h=()=>{Zi(n,Rt(c.mode));let m=a.loadUserPrefs().themeMode;es(n,m?{...c,themeMode:m}:c),d&&(fo(n,Ta(c)),d=!1)},_=()=>{h(),Vt(mo(ir,{onError:i},mo(qc,{bus:t,hostElement:n,options:c})),o)};t.on("handshake",m=>{m.config&&(m.config.storageVersion&&a.rememberStorageVersion(m.config.storageVersion),s=m.config,u(),_())});let f=Kc(t,{getOptions:()=>c,getVisitorId:()=>a.getVisitorId(),getConversationId:()=>a.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>l,render:_,setUserOptions:m=>{l=m,u(),_()},patchUserOptions:m=>{l={...l,...m},u(),_()},destroy:()=>f()}}function Ta(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=vt(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:o}=En(e,Qt(),t.loadPanelOpen(),t.loadPanelSize());return wo(e.mode,o,n)}var Em=W.scope("hooks"),Ra="*",Ea=new Set;function Ia(e,t,n){let o={widgetId:e,event:t,listener:n};return Ea.add(o),()=>{Ea.delete(o)}}function Rm(e,t,n){let o=[...Ea];for(let a of o)if(Im(a.widgetId,e.widgetId)&&!(a.event!==Ra&&a.event!==t))try{a.listener(e,t,n)}catch(i){Em.warn("hook listener threw",{event:t,error:i})}}function jc(e,t){let n=[];for(let o of Am)n.push(t.on(o,a=>{Rm(e,o,a)}));return()=>{for(let o of n)o()}}function Aa(e){if(Array.isArray(e))for(let t of e){let n=Lm(t);n&&Ia(n.widgetId,n.event,n.listener)}}function Im(e,t){return e===Ra||e===t}var Am=["open","close","expand","fullscreen","resize","message","send","stop","clear","selectConversation","suggestion","toggleHistory","formSubmit","toolResult","toolDecision","messageFeedback","messageSeen","contentView","contentOpen","contentSearch","contentRead","contentLinkClick","attach","removeAttachment","voiceStart","voiceStop","voiceCancel","localeChange","themeChange","textSizeChange","soundToggle","sidebarToggle","calloutDismiss","error","handshake","visitorRebound","conversationRebound"];function Lm(e){let t,n,o;if(Array.isArray(e))[t,n,o]=e;else if(e&&typeof e=="object")({widgetId:t,event:n,listener:o}=e);else return null;return typeof t!="string"||typeof n!="string"||typeof o!="function"?null:{widgetId:t,event:n,listener:o}}var dt=new Map;function lr(e){e.debug!==void 0&&eo(e.debug);let t=W.scope("mount");t.info("mount",{widgetId:e.widgetId,publicKey:e.publicKey,mode:e.presentation?.mode});let n=mt(e),o=n.widgetId,a=dt.get(o);a&&(t.debug("destroy existing instance at slot",{widgetId:o}),a.destroy());let i=Ta(n),l=n.iframe?os({position:Rt(n.mode)},n.position,i,n.mode,e.target??null):Gt({position:Rt(n.mode),target:e.target??null});l.hostElement.dataset.widgetId=o;let s=new Kt,c=vt(o,n.storage,n.aiAgentDeploymentId),d=y=>{s.emit("error",y),u.getOptions().onError?.(y)},u=sr({bus:s,host:l.hostElement,appRoot:l.appRoot,persistence:c,initialRaw:e,reportError:d});u.render();let h=l.hostElement,_=null,f=y=>{y.debug!==void 0&&eo(y.debug),u.patchUserOptions(y)},m={widgetId:o,open:()=>Pn(h,"open"),close:()=>Pn(h,"close"),expand:()=>Pn(h,"expand"),openForm:y=>Pn(h,"openForm",y),on:(y,x)=>s.on(y,x),update:y=>{t.debug("update",{patch:y}),f(y)},setUserContext:y=>{t.debug("setUserContext",{keys:Object.keys(y)}),f({userContext:{...u.getUserOptions().userContext,...y}})},clearUserContext:()=>{t.debug("clearUserContext"),f({userContext:void 0})},setPageContext:y=>{t.debug("setPageContext",{keys:Object.keys(y)}),f({pageContext:{...u.getUserOptions().pageContext,...y}})},clearPageContext:()=>{t.debug("clearPageContext"),f({pageContext:void 0})},setDebug:y=>{eo(y),t.info("debug level set",{level:vn()})},debugLevel:()=>vn(),onLog:y=>bn(y),destroy:()=>{t.info("destroy",{widgetId:o}),_?.(),u.destroy(),s.clear(),Vt(null,l.appRoot),l.destroy(),dt.get(o)===m&&dt.delete(o)}};return _=jc(m,s),dt.set(o,m),m}function cr(e){let t=e.widgetId??"default",n=dt.get(t);return n?(n.update(e),n):lr(e)}function La(e){if(e!==void 0){dt.get(e)?.destroy();return}let t=[...dt.values()];for(let n of t)n.destroy()}function nt(e="default"){return dt.get(e)??null}function Xc(){return[...dt.values()]}function Ma(e,t,n){return Ia(e,t,n)}var Yc=qt;var Na=class extends HTMLElement{constructor(){super(...arguments);j(this,"bus",new Kt);j(this,"mountResult",null);j(this,"runtime",null)}static get observedAttributes(){return $r}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,Vt(null,this.mountResult.appRoot),this.bus.clear())}attributeChangedCallback(){this.isConnected&&this.boot()}boot(){let n=ro(i=>this.getAttribute(i));if(this.runtime){this.runtime.setUserOptions(n);return}let o=mt(n);this.mountResult||(this.mountResult=Gt({existingHost:this,position:Rt(o.mode)}));let a=vt(o.widgetId,o.storage,o.aiAgentDeploymentId);this.runtime=sr({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:a,initialRaw:n,reportError:i=>this.bus.emit("error",i)}),this.runtime.render()}},Jc=!1;function Da(){if(Jc||typeof customElements>"u")return;let e=P.tagName;customElements.get(e)||customElements.define(e,Na),Jc=!0}typeof customElements<"u"&&Da();var Qc=W.scope("iife"),Oa={close:()=>nt()?.close(),destroy:()=>La(),expand:()=>nt()?.expand(),hook:(e,t,n)=>typeof e=="string"&&typeof t=="string"&&typeof n=="function"?Ma(e,t,n):void 0,init:e=>cr(e),mount:e=>lr(e),on:(e,t)=>nt()?.on(e,t),onLog:e=>bn(e),open:()=>nt()?.open(),setDebug:e=>nt()?.setDebug(e),update:e=>nt()?.update(e)};function Zc(e,...t){let n=Oa[e];if(!n){Qc.warn("unknown command",{command:e});return}return n(...t)}function Mm(){let e=((n,...o)=>Zc(n,...o));e.init=cr,e.mount=lr,e.destroy=La,e.getInstance=nt,e.getAllInstances=Xc,e.version=Yc,e.hook=Ma,e.debugLevel=()=>vn(),e.onLog=bn;let t=new Set(["init","mount","hook","onLog"]);for(let n of Object.keys(Oa))t.has(n)||(e[n]=(...o)=>Oa[n](...o));return e}function Nm(e){let t=e?.q;if(t)for(let n of t){let o=[...n],[a,...i]=o;if(typeof a=="string")try{Zc(a,...i)}catch(l){Qc.warn("queued command failed",{command:a,error:l})}}}function Dm(){let e=[],t=e.push.bind(e);return e.push=(...n)=>{for(let o of n)Aa([o]);return t(...n)},e}function Om(){let e=document.scripts;for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.src.includes("elements"))return n}return null}function $m(){if(typeof window>"u"||typeof document>"u")return;let e=globalThis[P.global],t=Mm();globalThis[P.global]=t,Da();let n=`${P.global}Hooks`,o=globalThis[n];if(Aa(o),globalThis[n]=Dm(),Nm(e),nt())return;let a=document.currentScript??Om(),i=Hr(a?.dataset);if(!i.publicKey)return;let l=()=>{nt()||cr(i)};if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",l,{once:!0});return}l()}$m();return Td(Hm);})();
40
40
  //# sourceMappingURL=elements.js.map