@helpai/elements 0.51.1 → 0.51.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/elements-web-component.esm.js +3 -3
- package/elements-web-component.esm.js.map +2 -2
- package/elements.cjs.js +3 -3
- package/elements.cjs.js.map +2 -2
- package/elements.esm.js +3 -3
- package/elements.esm.js.map +2 -2
- package/elements.js +3 -3
- package/elements.js.map +2 -2
- package/index.mjs +3 -3
- package/package.json +1 -1
- package/style.css +1 -1
- package/web-component.mjs +3 -3
package/elements.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var HelpAI=(()=>{var hr=Object.defineProperty;var vd=Object.getOwnPropertyDescriptor;var bd=Object.getOwnPropertyNames;var xd=Object.prototype.hasOwnProperty;var Pd=(e,t,n)=>t in e?hr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var yd=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of bd(t))!xd.call(e,i)&&i!==n&&hr(e,i,{get:()=>t[i],enumerable:!(o=vd(t,i))||o.enumerable});return e};var Sd=e=>yd(hr({},"__esModule",{value:!0}),e);var U=(e,t,n)=>Pd(e,typeof t!="symbol"?t+"":t,n);var Em={};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 Xi={attach:"Attach files",attachmentMimeRejected:"File type not supported",attachmentTooLarge:"File is too large",attachmentTooMany:"Attachment limit reached",conversationClosed:"This conversation is closed",conversationLoading:"Loading conversation\u2026",close:"Close",collapse:"Collapse",collapseSidebar:"Collapse sidebar",composerPlaceholder:"Type a message\u2026",dateLastWeek:"Last 7 days",dateOlder:"Older",dateToday:"Today",dateYesterday:"Yesterday",dropZone:"Drop files to attach",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous conversations yet",historyLoading:"Loading your conversations\u2026",historyContinue:"Continue the conversation",historyTitle:"Conversation history",language:"Language",launcherOpen:"Open chat",launcherLabel:"Chat with us",micStart:"Start voice input",micStop:"Stop voice input",micUnsupported:"Voice input is not supported in this browser",moreActions:"More actions",newConversation:"New conversation",panelTitle:"Chat",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",soundOff:"Sound off",soundOn:"Sound on",startNewConversation:"Start a new conversation",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",thinking:"Thinking\u2026",thoughts:"Thoughts",usedTool:"Used tool",toolResult:"Result",sources:"Sources",tabHome:"Home",tabConversations:"Conversations",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",moduleBack:"Back",contentLoading:"Loading\u2026",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results found",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsBack:"Back to news",newsPublishedAt:"Published {date}",formSubmit:"Submit",formSkip:"Maybe later",formSubmitted:"Completed",formSkipped:"Maybe later",formFillOut:"Fill out",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidUrl:"Enter a valid URL",formInvalidNumber:"Enter a valid number",formTooShort:"Too short (min {min} characters)",formTooLong:"Too long (max {max} characters)",formNumberTooSmall:"Must be at least {min}",formNumberTooLarge:"Must be at most {max}",formPatternMismatch:"Please match the requested format",formChooseAtLeast:"Choose at least {min}",formChooseAtMost:"Choose at most {max}",formOther:"Other",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"User Input Required",inputBadge:"User Input",inputAnswered:"Answered",inputSkipped:"Skipped",inputQuestion:"Question",inputResponse:"Response",inputYourAnswer:"Your answer",inputSubmit:"Submit answer",inputSubmitHint:"Enter to submit \xB7 Shift+Enter for new line",inputAnswerPlaceholder:"Type your answer\u2026",inputSkip:"Skip",confirmYes:"Yes",confirmNo:"No",inputConfirmHint:"Choose yes or no.",inputOptionalNote:"Optional note",inputOptionalNotePlaceholder:"Optional comment\u2026",inputSubmitted:"Answer submitted",respFreeText:"Free Text",respSingleChoice:"Single Choice",respMultiChoice:"Multiple Choice",respConfirmation:"Confirmation",approvalRequired:"Approval required",approve:"Approve",reject:"Reject",approved:"Approved",rejected:"Rejected",approvalReason:"Add a reason (optional)",approvalPrompt:"{tool} requires your approval to execute.",approvalBody:"Review the tool input above and decide whether to allow this action.",approvalYourResponse:"Your response: {decision}",approvalEditHint:"You can edit this response until this step continues.",approvalSubmitting:"Response submitted. Request in progress\u2026",edit:"Edit",stepNoLongerActive:"This request is no longer active.",toolParameters:"Parameters",statusAwaiting:"Awaiting Approval",statusResponded:"Responded",statusRunning:"Running",statusCompleted:"Completed",statusDenied:"Denied",statusError:"Error"},wd={attach:"Joindre des fichiers",attachmentMimeRejected:"Type de fichier non pris en charge",attachmentTooLarge:"Le fichier est trop volumineux",attachmentTooMany:"Limite de pi\xE8ces jointes atteinte",conversationClosed:"Cette conversation est ferm\xE9e",conversationLoading:"Chargement de la conversation\u2026",close:"Fermer",collapse:"R\xE9duire",collapseSidebar:"R\xE9duire la barre lat\xE9rale",composerPlaceholder:"\xC9crivez un message\u2026",dateLastWeek:"7 derniers jours",dateOlder:"Plus ancien",dateToday:"Aujourd'hui",dateYesterday:"Hier",dropZone:"D\xE9posez les fichiers \xE0 joindre",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRetry:"R\xE9essayer",expand:"Agrandir",expandSidebar:"D\xE9velopper la barre lat\xE9rale",exitFullscreen:"Quitter le plein \xE9cran",fullscreen:"Plein \xE9cran",history:"Historique",historyBack:"Retour au chat",historyEmpty:"Aucune conversation pour le moment",historyContinue:"Poursuivre la conversation",historyLoading:"Chargement de vos conversations\u2026",historyTitle:"Historique des conversations",language:"Langue",launcherOpen:"Ouvrir le chat",launcherLabel:"Discuter avec nous",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",micUnsupported:"La saisie vocale n'est pas prise en charge par ce navigateur",moreActions:"Plus d'actions",newConversation:"Nouvelle conversation",panelTitle:"Chat",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",startNewConversation:"D\xE9marrer une nouvelle conversation",stop:"Arr\xEAter",theme:"Th\xE8me",themeAuto:"Auto",themeDark:"Sombre",themeLight:"Clair",textSize:"Taille du texte",textSizeSmall:"Petite",textSizeNormal:"Normale",textSizeLarge:"Grande",loading:"Chargement\u2026",thinking:"R\xE9flexion\u2026",thoughts:"R\xE9flexions",usedTool:"Outil utilis\xE9",toolResult:"R\xE9sultat",sources:"Sources",tabHome:"Accueil",tabConversations:"Conversations",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeContentTitle:"Articles populaires",homeStatus:"Statut",helpTitle:"Aide",helpSearchPlaceholder:"Rechercher de l'aide",helpEmpty:"Aucun article d'aide pour le moment",helpLoading:"Chargement de l'aide\u2026",helpSearchEmpty:"Aucun r\xE9sultat trouv\xE9",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsBack:"Retour aux actualit\xE9s",newsPublishedAt:"Publi\xE9 le {date}",formSubmit:"Envoyer",formSkip:"Plus tard",formSubmitted:"Termin\xE9",formSkipped:"Plus tard",formFillOut:"Remplir",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidUrl:"Saisissez une URL valide",formInvalidNumber:"Saisissez un nombre valide",formTooShort:"Trop court (min. {min} caract\xE8res)",formTooLong:"Trop long (max. {max} caract\xE8res)",formNumberTooSmall:"Doit \xEAtre au moins {min}",formNumberTooLarge:"Doit \xEAtre au plus {max}",formPatternMismatch:"Veuillez respecter le format demand\xE9",formChooseAtLeast:"Choisissez au moins {min}",formChooseAtMost:"Choisissez au plus {max}",formOther:"Autre",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Saisie requise",inputBadge:"Saisie",inputAnswered:"R\xE9pondu",inputSkipped:"Ignor\xE9",inputQuestion:"Question",inputResponse:"R\xE9ponse",inputYourAnswer:"Votre r\xE9ponse",inputSubmit:"Envoyer la r\xE9ponse",inputSubmitHint:"Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e pour un saut de ligne",inputAnswerPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputSkip:"Ignorer",confirmYes:"Oui",confirmNo:"Non",inputConfirmHint:"Choisissez oui ou non.",inputOptionalNote:"Note facultative",inputOptionalNotePlaceholder:"Commentaire facultatif\u2026",inputSubmitted:"R\xE9ponse envoy\xE9e",respFreeText:"Texte libre",respSingleChoice:"Choix unique",respMultiChoice:"Choix multiple",respConfirmation:"Confirmation",approvalRequired:"Approbation requise",approve:"Approuver",reject:"Refuser",approved:"Approuv\xE9",rejected:"Refus\xE9",approvalReason:"Ajouter une raison (facultatif)",approvalPrompt:"{tool} n\xE9cessite votre approbation pour s'ex\xE9cuter.",approvalBody:"V\xE9rifiez les param\xE8tres ci-dessus et d\xE9cidez d'autoriser ou non cette action.",approvalYourResponse:"Votre r\xE9ponse : {decision}",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",approvalSubmitting:"R\xE9ponse envoy\xE9e. Traitement en cours\u2026",edit:"Modifier",stepNoLongerActive:"Cette demande n'est plus active.",toolParameters:"Param\xE8tres",statusAwaiting:"En attente d'approbation",statusResponded:"R\xE9pondu",statusRunning:"En cours",statusCompleted:"Termin\xE9",statusDenied:"Refus\xE9",statusError:"Erreur"},kd={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645",attachmentTooLarge:"\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627",attachmentTooMany:"\u062A\u0645 \u0628\u0644\u0648\u063A \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A",conversationClosed:"\u062A\u0645 \u0625\u063A\u0644\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629\u2026",close:"\u0625\u063A\u0644\u0627\u0642",collapse:"\u0637\u064A\u0651",collapseSidebar:"\u0637\u064A\u0651 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",composerPlaceholder:"\u0627\u0643\u062A\u0628 \u0631\u0633\u0627\u0644\u0629\u2026",dateLastWeek:"\u0622\u062E\u0631 \u0667 \u0623\u064A\u0627\u0645",dateOlder:"\u0623\u0642\u062F\u0645",dateToday:"\u0627\u0644\u064A\u0648\u0645",dateYesterday:"\u0623\u0645\u0633",dropZone:"\u0623\u0641\u0644\u062A \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0644\u0625\u0631\u0641\u0627\u0642\u0647\u0627",errorGeneric:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0627",errorRateLimited:"\u0637\u0644\u0628\u0627\u062A \u0643\u062B\u064A\u0631\u0629 \u062C\u062F\u064B\u0627 \u2014 \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0628\u0639\u062F \u0644\u062D\u0638\u0629.",errorRetry:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",expand:"\u062A\u0648\u0633\u064A\u0639",expandSidebar:"\u062A\u0648\u0633\u064A\u0639 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",exitFullscreen:"\u0625\u0646\u0647\u0627\u0621 \u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",fullscreen:"\u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",history:"\u0627\u0644\u0633\u062C\u0644",historyBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",historyEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u062D\u0627\u062F\u062B\u0627\u062A \u0633\u0627\u0628\u0642\u0629 \u0628\u0639\u062F",historyContinue:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",historyLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0645\u062D\u0627\u062F\u062B\u0627\u062A\u0643\u2026",historyTitle:"\u0633\u062C\u0644 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0627\u062A",language:"\u0627\u0644\u0644\u063A\u0629",launcherOpen:"\u0641\u062A\u062D \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",launcherLabel:"\u062A\u062D\u062F\u062B \u0645\u0639\u0646\u0627",micStart:"\u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micStop:"\u0625\u064A\u0642\u0627\u0641 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micUnsupported:"\u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645 \u0641\u064A \u0647\u0630\u0627 \u0627\u0644\u0645\u062A\u0635\u0641\u062D",moreActions:"\u0625\u062C\u0631\u0627\u0621\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629",newConversation:"\u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629",panelTitle:"\u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",resizeHandle:"\u0627\u0633\u062D\u0628 \u0644\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u062D\u062C\u0645",scrollToBottom:"\u0627\u0644\u0627\u0646\u062A\u0642\u0627\u0644 \u0625\u0644\u0649 \u0627\u0644\u0623\u062D\u062F\u062B",send:"\u0625\u0631\u0633\u0627\u0644",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",startNewConversation:"\u0628\u062F\u0621 \u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629",stop:"\u0625\u064A\u0642\u0627\u0641",theme:"\u0627\u0644\u0645\u0638\u0647\u0631",themeAuto:"\u062A\u0644\u0642\u0627\u0626\u064A",themeDark:"\u062F\u0627\u0643\u0646",themeLight:"\u0641\u0627\u062A\u062D",textSize:"\u062D\u062C\u0645 \u0627\u0644\u0646\u0635",textSizeSmall:"\u0635\u063A\u064A\u0631",textSizeNormal:"\u0639\u0627\u062F\u064A",textSizeLarge:"\u0643\u0628\u064A\u0631",loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thoughts:"\u0627\u0644\u0623\u0641\u0643\u0627\u0631",usedTool:"\u0623\u062F\u0627\u0629 \u0645\u064F\u0633\u062A\u062E\u062F\u064E\u0645\u0629",toolResult:"\u0627\u0644\u0646\u062A\u064A\u062C\u0629",sources:"\u0627\u0644\u0645\u0635\u0627\u062F\u0631",tabHome:"\u0627\u0644\u0631\u0626\u064A\u0633\u064A\u0629",tabConversations:"\u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0627\u062A",tabHelp:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",tabNews:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",modulesEmpty:"\u0644\u0627 \u0634\u064A\u0621 \u0647\u0646\u0627 \u0628\u0639\u062F",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",homeGreeting:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeGreetingNamed:"\u0645\u0631\u062D\u0628\u064B\u0627 {name} \u{1F44B}",homeGreetingLead:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",homeContentTitle:"\u0645\u0642\u0627\u0644\u0627\u062A \u0634\u0627\u0626\u0639\u0629",homeStatus:"\u0627\u0644\u062D\u0627\u0644\u0629",helpTitle:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",helpSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",helpEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u0642\u0627\u0644\u0627\u062A \u0645\u0633\u0627\u0639\u062F\u0629 \u0628\u0639\u062F",helpLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629\u2026",helpSearchEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C",newsTitle:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0623\u062E\u0628\u0627\u0631 \u0628\u0639\u062F",newsLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0623\u062E\u0628\u0627\u0631\u2026",newsBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsPublishedAt:"\u0646\u064F\u0634\u0631 \u0641\u064A {date}",formSubmit:"\u0625\u0631\u0633\u0627\u0644",formSkip:"\u0644\u0627\u062D\u0642\u064B\u0627",formSubmitted:"\u062A\u0645",formSkipped:"\u0644\u0627\u062D\u0642\u064B\u0627",formFillOut:"\u062A\u0639\u0628\u0626\u0629",formRequired:"\u0647\u0630\u0627 \u0627\u0644\u062D\u0642\u0644 \u0645\u0637\u0644\u0648\u0628",formInvalidEmail:"\u0623\u062F\u062E\u0644 \u0628\u0631\u064A\u062F\u064B\u0627 \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidTel:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidUrl:"\u0623\u062F\u062E\u0644 \u0631\u0627\u0628\u0637\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formTooShort:"\u0642\u0635\u064A\u0631 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 {min} \u062D\u0631\u0641\u064B\u0627)",formTooLong:"\u0637\u0648\u064A\u0644 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 {max} \u062D\u0631\u0641\u064B\u0627)",formNumberTooSmall:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0642\u0644 \u0639\u0646 {min}",formNumberTooLarge:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0632\u064A\u062F \u0639\u0646 {max}",formPatternMismatch:"\u064A\u0631\u062C\u0649 \u0645\u0637\u0627\u0628\u0642\u0629 \u0627\u0644\u0635\u064A\u063A\u0629 \u0627\u0644\u0645\u0637\u0644\u0648\u0628\u0629",formChooseAtLeast:"\u0627\u062E\u062A\u0631 {min} \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644",formChooseAtMost:"\u0627\u062E\u062A\u0631 {max} \u0639\u0644\u0649 \u0627\u0644\u0623\u0643\u062B\u0631",formOther:"\u0623\u062E\u0631\u0649",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0645\u0637\u0644\u0648\u0628 \u0625\u062F\u062E\u0627\u0644 \u0645\u0646 \u0627\u0644\u0645\u0633\u062A\u062E\u062F\u0645",inputBadge:"\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0645\u0633\u062A\u062E\u062F\u0645",inputAnswered:"\u062A\u0645\u062A \u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputSkipped:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A",inputQuestion:"\u0627\u0644\u0633\u0624\u0627\u0644",inputResponse:"\u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputYourAnswer:"\u0625\u062C\u0627\u0628\u062A\u0643",inputSubmit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputSubmitHint:"\u0627\u0636\u063A\u0637 Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter \u0644\u0633\u0637\u0631 \u062C\u062F\u064A\u062F",inputAnswerPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputSkip:"\u062A\u062E\u0637\u064D\u0651",confirmYes:"\u0646\u0639\u0645",confirmNo:"\u0644\u0627",inputConfirmHint:"\u0627\u062E\u062A\u0631 \u0646\u0639\u0645 \u0623\u0648 \u0644\u0627.",inputOptionalNote:"\u0645\u0644\u0627\u062D\u0638\u0629 \u0627\u062E\u062A\u064A\u0627\u0631\u064A\u0629",inputOptionalNotePlaceholder:"\u062A\u0639\u0644\u064A\u0642 \u0627\u062E\u062A\u064A\u0627\u0631\u064A\u2026",inputSubmitted:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",respFreeText:"\u0646\u0635 \u062D\u0631",respSingleChoice:"\u0627\u062E\u062A\u064A\u0627\u0631 \u0648\u0627\u062D\u062F",respMultiChoice:"\u0627\u062E\u062A\u064A\u0627\u0631 \u0645\u062A\u0639\u062F\u062F",respConfirmation:"\u062A\u0623\u0643\u064A\u062F",approvalRequired:"\u0645\u0637\u0644\u0648\u0628 \u0645\u0648\u0627\u0641\u0642\u0629",approve:"\u0645\u0648\u0627\u0641\u0642\u0629",reject:"\u0631\u0641\u0636",approved:"\u062A\u0645\u062A \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",rejected:"\u0645\u0631\u0641\u0648\u0636",approvalReason:"\u0623\u0636\u0641 \u0633\u0628\u0628\u064B\u0627 (\u0627\u062E\u062A\u064A\u0627\u0631\u064A)",approvalPrompt:"\u062A\u062A\u0637\u0644\u0628 {tool} \u0645\u0648\u0627\u0641\u0642\u062A\u0643 \u0644\u0644\u062A\u0646\u0641\u064A\u0630.",approvalBody:"\u0631\u0627\u062C\u0639 \u0645\u064F\u0639\u0637\u064A\u0627\u062A \u0627\u0644\u0623\u062F\u0627\u0629 \u0623\u0639\u0644\u0627\u0647 \u0648\u0642\u0631\u0651\u0631 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \u0623\u0648 \u0631\u0641\u0636\u0647.",approvalYourResponse:"\u0631\u062F\u0651\u0643: {decision}",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u0639\u062F\u064A\u0644 \u0631\u062F\u0651\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",approvalSubmitting:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062F. \u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",edit:"\u062A\u0639\u062F\u064A\u0644",stepNoLongerActive:"\u0644\u0645 \u064A\u0639\u062F \u0647\u0630\u0627 \u0627\u0644\u0637\u0644\u0628 \u0646\u0634\u0637\u064B\u0627.",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"},Cd={attach:"Adjuntar archivos",attachmentMimeRejected:"Tipo de archivo no admitido",attachmentTooLarge:"El archivo es demasiado grande",attachmentTooMany:"Se alcanz\xF3 el l\xEDmite de adjuntos",conversationClosed:"Esta conversaci\xF3n est\xE1 cerrada",conversationLoading:"Cargando conversaci\xF3n\u2026",close:"Cerrar",collapse:"Contraer",collapseSidebar:"Contraer la barra lateral",composerPlaceholder:"Escribe un mensaje\u2026",dateLastWeek:"\xDAltimos 7 d\xEDas",dateOlder:"Anteriores",dateToday:"Hoy",dateYesterday:"Ayer",dropZone:"Suelta los archivos para adjuntarlos",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRetry:"Reintentar",expand:"Ampliar",expandSidebar:"Expandir la barra lateral",exitFullscreen:"Salir de pantalla completa",fullscreen:"Pantalla completa",history:"Historial",historyBack:"Volver al chat",historyEmpty:"A\xFAn no tienes conversaciones",historyContinue:"Continuar la conversaci\xF3n",historyLoading:"Cargando tus conversaciones\u2026",historyTitle:"Historial de conversaciones",language:"Idioma",launcherOpen:"Abrir el chat",launcherLabel:"Chatea con nosotros",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",micUnsupported:"Este navegador no admite la entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nueva conversaci\xF3n",panelTitle:"Chat",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",soundOff:"Sonido desactivado",soundOn:"Sonido activado",startNewConversation:"Iniciar una conversaci\xF3n nueva",stop:"Detener",theme:"Tema",themeAuto:"Autom\xE1tico",themeDark:"Oscuro",themeLight:"Claro",textSize:"Tama\xF1o del texto",textSizeSmall:"Peque\xF1o",textSizeNormal:"Normal",textSizeLarge:"Grande",loading:"Cargando\u2026",thinking:"Pensando\u2026",thoughts:"Razonamiento",usedTool:"Herramienta usada",toolResult:"Resultado",sources:"Fuentes",tabHome:"Inicio",tabConversations:"Conversaciones",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeContentTitle:"Art\xEDculos populares",homeStatus:"Estado",helpTitle:"Ayuda",helpSearchPlaceholder:"Buscar ayuda",helpEmpty:"A\xFAn no hay art\xEDculos de ayuda",helpLoading:"Cargando la ayuda\u2026",helpSearchEmpty:"No se encontraron resultados",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsBack:"Volver a novedades",newsPublishedAt:"Publicado el {date}",formSubmit:"Enviar",formSkip:"Quiz\xE1 m\xE1s tarde",formSubmitted:"Completado",formSkipped:"Quiz\xE1 m\xE1s tarde",formFillOut:"Completar",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidUrl:"Introduce una URL v\xE1lida",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formTooShort:"Demasiado corto (m\xEDn. {min} caracteres)",formTooLong:"Demasiado largo (m\xE1x. {max} caracteres)",formNumberTooSmall:"Debe ser al menos {min}",formNumberTooLarge:"Debe ser como m\xE1ximo {max}",formPatternMismatch:"Respeta el formato solicitado",formChooseAtLeast:"Elige al menos {min}",formChooseAtMost:"Elige como m\xE1ximo {max}",formOther:"Otro",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Entrada requerida",inputBadge:"Entrada",inputAnswered:"Respondido",inputSkipped:"Omitido",inputQuestion:"Pregunta",inputResponse:"Respuesta",inputYourAnswer:"Tu respuesta",inputSubmit:"Enviar respuesta",inputSubmitHint:"Enter para enviar \xB7 May\xFAs+Enter para una nueva l\xEDnea",inputAnswerPlaceholder:"Escribe tu respuesta\u2026",inputSkip:"Omitir",confirmYes:"S\xED",confirmNo:"No",inputConfirmHint:"Elige s\xED o no.",inputOptionalNote:"Nota opcional",inputOptionalNotePlaceholder:"Comentario opcional\u2026",inputSubmitted:"Respuesta enviada",respFreeText:"Texto libre",respSingleChoice:"Opci\xF3n \xFAnica",respMultiChoice:"Opci\xF3n m\xFAltiple",respConfirmation:"Confirmaci\xF3n",approvalRequired:"Aprobaci\xF3n requerida",approve:"Aprobar",reject:"Rechazar",approved:"Aprobado",rejected:"Rechazado",approvalReason:"A\xF1ade un motivo (opcional)",approvalPrompt:"{tool} requiere tu aprobaci\xF3n para ejecutarse.",approvalBody:"Revisa los par\xE1metros de arriba y decide si permites esta acci\xF3n.",approvalYourResponse:"Tu respuesta: {decision}",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",approvalSubmitting:"Respuesta enviada. Procesando\u2026",edit:"Editar",stepNoLongerActive:"Esta solicitud ya no est\xE1 activa.",toolParameters:"Par\xE1metros",statusAwaiting:"Esperando aprobaci\xF3n",statusResponded:"Respondido",statusRunning:"En curso",statusCompleted:"Completado",statusDenied:"Denegado",statusError:"Error"},Ed={en:Xi,fr:wd,ar:kd,es:Cd};function Un(e,t){let n=Ji(e),o=Wn(t),i=n==="en"?{}:Ed[n]??{},a=o?t[n]??{}:t??{},l=o?t.en??{}:{};return{...Xi,...i,...l,...a}}function Ji(e){return(e.split("-")[0]??"en").toLowerCase()}var Td=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function Qi(e){return Td.has(Ji(e))}function Ee(e,t){return e[t]??t}function Wn(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function Zi(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function ea(e,t){let{translations:n,defaultLocale:o,...i}=e,a=Zi(n,t);return a?{...i,title:a.title??i.title,description:a.description??i.description,content:a.content??i.content}:i}function ta(e,t){let{translations:n,defaultLocale:o,...i}=e,a=Zi(n,t);if(!a)return i;let l=new Map((a.fields??[]).map(c=>[c.name,c])),s=i.fields.map(c=>{let d=l.get(c.name);if(!d)return c;let u=new Map((d.options??[]).map(_=>[_.value,_]));return{...c,label:d.label??c.label,placeholder:d.placeholder??c.placeholder,validationHint:d.validationHint??c.validationHint,options:c.options?.map(_=>{let g=u.get(_.value);return g?{..._,label:g.label??_.label,description:g.description??_.description}:_})}});return{...i,title:a.title??i.title,description:a.description??i.description,submitLabel:a.submitLabel??i.submitLabel,fields:s}}var vr=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{}}},Vn=new vr;var Pr=["off","error","warn","info","debug","trace"],yr=P.cssPrefix,na=`${yr}.debug`,Rd=`__${P.global}_DEBUG__`,Id=`${yr}-debug`,qn=2,br=null;function Ad(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(Id);if(e!==null){let t=xr(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(na);if(e){let t=xr(e);if(t>=0)return t}}catch{}return window[Rd]?4:2}function xr(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=xr(e);if(!(t<0)){qn=t;try{window.localStorage?.setItem(na,Pr[t])}catch{}}}function an(){return Pr[qn]}qn=Ad();function oa(e){let t=`[${yr}:${e}]`,n=(o,i,a)=>(l,s)=>{if(!(qn<o)&&(s===void 0?console[i](t,l):console[i](t,l,s),br))try{br({level:a,scope:e,message:l,payload:s})}catch{}};return{error:n(1,"error","error"),warn:n(2,"warn","warn"),info:n(3,"info","info"),debug:n(4,"debug","debug"),trace:n(5,"debug","trace"),scope:o=>oa(`${e}:${o}`)}}var F=oa("core");function sn(e){br=e}var pt=F.scope("context"),Ld=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),ra=50,Sr=1024,Md=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function wr(e){return ia(e,"userContext",!0)}function kr(e){return ia(e,"pageContext",!1)}function ia(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){pt.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let o={},i=0;for(let[a,l]of Object.entries(e)){if(Ld.has(a)){pt.warn(`dropped reserved ${t} key "${a}" \u2014 managed by the widget, not host-settable`);continue}if(l==null)continue;if(i>=ra){pt.warn(`${t} truncated at ${ra} keys \u2014 dropped "${a}"`);continue}let s=Nd(t,a,l);s!==void 0&&(o[a]=s,i++)}return n&&typeof o.email=="string"&&!Md.test(o.email)&&(pt.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function Nd(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){pt.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let o=n.trim();return o===""?void 0:o.length>Sr?(pt.warn(`truncated ${e}.${t} to ${Sr} chars`),o.slice(0,Sr)):o}pt.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var Kn={maxBytes:10485760,maxCount:10,accept:"*/*"},jn={files:!0,voice:"local",humanInLoop:!0},aa={list:[],byTrigger:{}},Cr={enabled:!0,sampleRate:1},Yn={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},It={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},sa={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"]},Er={enabled:!0,volume:.3,events:void 0},la={enabled:!0,events:void 0},ca=[{label:"tabConversations",layout:"chat"}],da={showSearchBar:!0};function rt(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},o=t.behavior??{},i=t.i18n??{},a=t.feedback??{},l=t.footer??{},s=t.header??{},{themeMode:c,themeOverrides:d}=Od(t.theme),u=n.mode??"floating",_=Dd(i.defaultLocale),g=i.availableLocales??[i.locale??_],f=At(i.locale??_,g,_),p=(t.baseUrl??P.defaultBaseUrl).replace(/\/$/,""),y=(t.agentApiBaseUrl??`${p}/api/agent`).replace(/\/$/,""),v=(t.dataApiBaseUrl??`${p}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:p,agentApiBaseUrl:y,dataApiBaseUrl:v,userContext:wr(t.userContext),pageContext:kr(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??jn.files,voice:t.features?.voice??jn.voice,humanInLoop:t.features?.humanInLoop??jn.humanInLoop,tools:t.features?.tools},forms:ln(t.forms,f),endpoints:{upload:t.endpoints?.upload??Yn.upload,transcribe:t.endpoints?.transcribe??Yn.transcribe,submitForm:t.endpoints?.submitForm??Yn.submitForm},attachments:{accept:t.composer?.attachments?.accept??Kn.accept,maxBytes:t.composer?.attachments?.maxBytes??Kn.maxBytes,maxCount:t.composer?.attachments?.maxCount??Kn.maxCount},locale:f,defaultLocale:_,availableLocales:g,startMinimized:o.startMinimized??!0,actions:$d(u,s.actions),size:n.size??{},launcher:qd(t.launcher),sound:Hd(a.sound),haptics:Bd(a.haptics),strings:Un(f,i.strings),stringsOverride:i.strings,composerDisclaimer:l.composerDisclaimer??"",poweredBy:zd(l.poweredBy),composer:Ud(t.composer),modules:Wd(t.modules),tracking:Fd(t.tracking,v),storage:t.storage??Vn,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function Od(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 At(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function $d(e,t){return t??sa[e]}function Hd(e){return{enabled:e?.enabled??Er.enabled,volume:e?.volume??Er.volume,events:e?.events}}function Bd(e){return{enabled:e?.enabled??la.enabled,events:e?.events}}function Fd(e,t){let n=e?.sampleRate??Cr.sampleRate;return{enabled:e?.enabled??Cr.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 zd(e){let n={...{text:`Powered by ${P.displayName}`,href:P.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function Ud(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function Wd(e){let t=e===void 0?ca:e,n=new Set,o=[];for(let a of t.slice(0,4)){if(!a?.label||!a?.layout)continue;let l=a.contentTags?.filter(Boolean),s=a.id??l?.[0]??a.layout;for(;n.has(s);)s=`${s}-${o.length}`;n.add(s);let c={id:s,label:a.label,layout:a.layout};l&&l.length>0&&(c.contentTags=l),a.layout==="home"&&(c.brandName=a.brandName,c.greetingText=a.greetingText,c.showGreeting=a.showGreeting??!0,c.showSearchBar=a.showSearchBar??da.showSearchBar,c.showRecentConversations=a.showRecentConversations??!0,a.userAvatars&&a.userAvatars.length>0&&(c.userAvatars=a.userAvatars),a.status&&(c.status=a.status),c.contentBlockTitle=a.contentBlockTitle),o.push(c)}let i=Object.fromEntries(o.map(a=>[a.id,a]));return{list:o,byId:i}}function ln(e,t){var a;if(!e?.length)return aa;let n=[],o=new Set;for(let l of e){if(!l?.id||o.has(l.id))continue;let s=ta(l,t),c=(s.fields??[]).filter(u=>!!(u&&u.name&&u.label&&u.type)),d=(Array.isArray(s.on)?s.on:[s.on]).map(Vd).filter(u=>u!==null);c.length===0||d.length===0||(o.add(s.id),n.push({id:s.id,triggers:d,when:s.when,fields:c,title:s.title,description:s.description,submitLabel:s.submitLabel,skippable:s.skippable??!1,frequency:s.frequency??"once",mirrorToContext:s.mirrorToContext??!0,reopenable:s.reopenable??!0,reviewable:s.reviewable??!0}))}let i={};for(let l of n)for(let s of l.triggers)(i[a=s.kind]??(i[a]=[])).push(l);return{list:n,byTrigger:i}}function Vd(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??It.variant,size:e?.size??It.size,label:e?.label??It.label,icon:e?.icon??It.icon,hidden:e?.hidden??It.hidden,callout:t}}function Tr(e,t,n,o){let i=At(t,e.availableLocales,e.defaultLocale);if(i===e.locale&&n===e.themeMode&&o===e.textSize)return e;let a={...e};return i!==e.locale&&(a.locale=i,a.strings=Un(i,e.stringsOverride)),n!==e.themeMode&&(a.themeMode=n),o!==e.textSize&&(a.textSize=o),a}var Gd=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Rr(e,t){if(!t)return e;let n={...e};for(let a of Gd){let l=t[a];if(l===void 0)continue;let s=e[a];if(a==="theme"){s===void 0&&(n[a]=l);continue}a!=="i18n"&&(n[a]=_a(l,s))}t.modules!==void 0&&e.modules===void 0&&(n.modules=t.modules),t.dataApiBaseUrl!==void 0&&e.dataApiBaseUrl===void 0&&(n.dataApiBaseUrl=t.dataApiBaseUrl);let o=e.i18n,i=t.i18n;if(o||i){let a=_a(i??{},o);i?.availableLocales!==void 0&&(a.availableLocales=i.availableLocales),i?.defaultLocale!==void 0&&(a.defaultLocale=i.defaultLocale);let l=o?.strings,s=i?.strings;(l||s)&&(a.strings=Kd(s,l)),n.i18n=a}return n}function _a(e,t){if(!t)return e;let n={...e};for(let[o,i]of Object.entries(t))i!==void 0&&(n[o]=i);return n}function Kd(e,t){if(!e)return t;if(!t)return e;let n=Wn(e),o=Wn(t);if(!n&&!o)return{...e,...t};let i={},a=n?e:{en:e},l=o?t:{en:t};for(let[s,c]of Object.entries(a))i[s]={...c};for(let[s,c]of Object.entries(l))i[s]={...i[s],...c};return i}var jd=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],ft=e=>e!=="false",pa=e=>e.split(",").map(t=>t.trim()).filter(Boolean),ma=[["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]],fa=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",ft]],ga=[["width","width"],["height","height"]],ha=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",ft],["show-reasoning","showReasoning",ft],["show-tool-calls","showToolCalls",ft],["show-sources","showSources",ft]],va=[["locale","locale"]],Yd=new Set(jd),Xd=e=>pa(e).filter(t=>Yd.has(t)),ba=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",ft]],xa=[["features-files","files",ft],["features-voice","voice",e=>e],["features-tools","tools",pa]],Pa=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],ya=[["user-id","id"],["user-email","email"],["user-name","name"]],Sa=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],Jd=["launcher-label","callout-text","callout-delay","actions-main","actions-overflow","user-context","page-context"],Qd=[ma,fa,ga,ha,va,ba,xa,Pa,ya,Sa],Zd=new Set(["iframe","start-minimized"]),Ir=[...Qd.flatMap(e=>e.map(([t])=>t).filter(t=>!Zd.has(t))),...Jd];function Xn(e){let t={},n=f=>{let p=e(f);return p===null||p===""?void 0:p};for(let[f,p,y]of ma){let v=n(f);v!==void 0&&(t[p]=y?y(v):v)}let o=mt(n,fa),i=mt(n,ga);(o||i)&&(t.presentation={...o,...i?{size:i}:{}});let a=mt(n,ha);a&&(t.behavior=a);let l=mt(n,va);l&&(t.i18n=l);let s=t_(e,n);s&&(t.launcher=s);let c=mt(n,xa);c&&(t.features=c);let d=mt(n,Pa);d&&(t.endpoints=d);let u=ua(n,ya,"user-context");u&&(t.userContext=u);let _=ua(n,Sa,"page-context");_&&(t.pageContext=_);let g=n("actions");return g!==void 0&&(t.header={actions:Xd(g)}),t}function Ar(e){return e?Xn(t=>e[e_(t)]??null):{}}function e_(e){return e.replaceAll(/-([a-z])/g,(t,n)=>n.toUpperCase())}function mt(e,t){let n={};for(let[o,i,a]of t){let l=e(o);l!==void 0&&(n[i]=a?a(l):l)}return Object.keys(n).length>0?n:null}function ua(e,t,n){let o={};for(let[s,c]of t){let d=e(s);d!==void 0&&(o[c]=d)}let i={},a=e(n);if(a)try{let s=JSON.parse(a);s&&typeof s=="object"&&!Array.isArray(s)&&(i=s)}catch{}let l={...i,...o};return Object.keys(l).length>0?l:null}function t_(e,t){let n=mt(t,ba)??{},o=e("launcher-label");o!==null&&(n.label=o);let i=t("callout-text");if(i){let a=Number.parseInt(t("callout-delay")??"",10);n.callout={text:i,...Number.isFinite(a)?{delayMs:a}:{}}}return Object.keys(n).length>0?n:null}var oo,J,Ta,Dr,it,wa,Ra,Ia,Lr,Qn,cn,Aa,$r,Mr,Nr,n_,eo={},to=[],o_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ro=Array.isArray;function Ye(e,t){for(var n in t)e[n]=t[n];return e}function Hr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function io(e,t,n){var o,i,a,l={};for(a in t)a=="key"?o=t[a]:a=="ref"?i=t[a]:l[a]=t[a];if(arguments.length>2&&(l.children=arguments.length>3?oo.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)l[a]===void 0&&(l[a]=e.defaultProps[a]);return Zn(e,l,o,i,null)}function Zn(e,t,n,o,i){var a={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Ta,__i:-1,__u:0};return i==null&&J.vnode!=null&&J.vnode(a),a}function oe(e){return e.children}function at(e,t){this.props=e,this.context=t}function Lt(e,t){if(t==null)return e.__?Lt(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"?Lt(e):null}function r_(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],i=[],a=Ye({},t);a.__v=t.__v+1,J.vnode&&J.vnode(a),Br(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??Lt(t),!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,Oa(o,a,i),t.__e=t.__=null,a.__e!=n&&La(a)}}function La(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),La(e)}function ka(e){(!e.__d&&(e.__d=!0)&&it.push(e)&&!no.__r++||wa!=J.debounceRendering)&&((wa=J.debounceRendering)||Ra)(no)}function no(){try{for(var e,t=1;it.length;)it.length>t&&it.sort(Ia),e=it.shift(),t=it.length,r_(e)}finally{it.length=no.__r=0}}function Ma(e,t,n,o,i,a,l,s,c,d,u){var _,g,f,p,y,v,b,w=o&&o.__k||to,x=t.length;for(c=i_(n,t,w,c,x),_=0;_<x;_++)(f=n.__k[_])!=null&&(g=f.__i!=-1&&w[f.__i]||eo,f.__i=_,v=Br(e,f,g,i,a,l,s,c,d,u),p=f.__e,f.ref&&g.ref!=f.ref&&(g.ref&&Fr(g.ref,null,f),u.push(f.ref,f.__c||p,f)),y==null&&p!=null&&(y=p),(b=!!(4&f.__u))||g.__k===f.__k?(c=Na(f,c,e,b),b&&g.__e&&(g.__e=null)):typeof f.type=="function"&&v!==void 0?c=v:p&&(c=p.nextSibling),f.__u&=-7);return n.__e=y,c}function i_(e,t,n,o,i){var a,l,s,c,d,u=n.length,_=u,g=0;for(e.__k=new Array(i),a=0;a<i;a++)(l=t[a])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[a]=Zn(null,l,null,null,null):ro(l)?l=e.__k[a]=Zn(oe,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[a]=Zn(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[a]=l,c=a+g,l.__=e,l.__b=e.__b+1,s=null,(d=l.__i=a_(l,n,c,_))!=-1&&(_--,(s=n[d])&&(s.__u|=2)),s==null||s.__v==null?(d==-1&&(i>u?g--:i<u&&g++),typeof l.type!="function"&&(l.__u|=4)):d!=c&&(d==c-1?g--:d==c+1?g++:(d>c?g--:g++,l.__u|=4))):e.__k[a]=null;if(_)for(a=0;a<u;a++)(s=n[a])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=Lt(s)),$a(s,s));return o}function Na(e,t,n,o){var i,a;if(typeof e.type=="function"){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=Na(i[a],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Lt(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 i,a,l,s=e.key,c=e.type,d=t[n],u=d!=null&&(2&d.__u)==0;if(d===null&&s==null||u&&s==d.key&&c==d.type)return n;if(o>(u?1:0)){for(i=n-1,a=n+1;i>=0||a<t.length;)if((d=t[l=i>=0?i--:a++])!=null&&(2&d.__u)==0&&s==d.key&&c==d.type)return l}return-1}function Ca(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||o_.test(t)?n:n+"px"}function Jn(e,t,n,o,i){var a,l;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||Ca(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Ca(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")a=t!=(t=t.replace(Aa,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?o?n[cn]=o[cn]:(n[cn]=$r,e.addEventListener(t,a?Nr:Mr,a)):e.removeEventListener(t,a?Nr:Mr,a);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Ea(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[Qn]==null)t[Qn]=$r++;else if(t[Qn]<n[cn])return;return n(J.event?J.event(t):t)}}}function Br(e,t,n,o,i,a,l,s,c,d){var u,_,g,f,p,y,v,b,w,x,E,V,se,O,Z,B=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(u=J.__b)&&u(t);e:if(typeof B=="function")try{if(b=t.props,w=B.prototype&&B.prototype.render,x=(u=B.contextType)&&o[u.__c],E=u?x?x.props.value:u.__:o,n.__c?v=(_=t.__c=n.__c).__=_.__E:(w?t.__c=_=new B(b,E):(t.__c=_=new at(b,E),_.constructor=B,_.render=l_),x&&x.sub(_),_.state||(_.state={}),_.__n=o,g=_.__d=!0,_.__h=[],_._sb=[]),w&&_.__s==null&&(_.__s=_.state),w&&B.getDerivedStateFromProps!=null&&(_.__s==_.state&&(_.__s=Ye({},_.__s)),Ye(_.__s,B.getDerivedStateFromProps(b,_.__s))),f=_.props,p=_.state,_.__v=t,g)w&&B.getDerivedStateFromProps==null&&_.componentWillMount!=null&&_.componentWillMount(),w&&_.componentDidMount!=null&&_.__h.push(_.componentDidMount);else{if(w&&B.getDerivedStateFromProps==null&&b!==f&&_.componentWillReceiveProps!=null&&_.componentWillReceiveProps(b,E),t.__v==n.__v||!_.__e&&_.shouldComponentUpdate!=null&&_.shouldComponentUpdate(b,_.__s,E)===!1){t.__v!=n.__v&&(_.props=b,_.state=_.__s,_.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(j){j&&(j.__=t)}),to.push.apply(_.__h,_._sb),_._sb=[],_.__h.length&&l.push(_);break e}_.componentWillUpdate!=null&&_.componentWillUpdate(b,_.__s,E),w&&_.componentDidUpdate!=null&&_.__h.push(function(){_.componentDidUpdate(f,p,y)})}if(_.context=E,_.props=b,_.__P=e,_.__e=!1,V=J.__r,se=0,w)_.state=_.__s,_.__d=!1,V&&V(t),u=_.render(_.props,_.state,_.context),to.push.apply(_.__h,_._sb),_._sb=[];else do _.__d=!1,V&&V(t),u=_.render(_.props,_.state,_.context),_.state=_.__s;while(_.__d&&++se<25);_.state=_.__s,_.getChildContext!=null&&(o=Ye(Ye({},o),_.getChildContext())),w&&!g&&_.getSnapshotBeforeUpdate!=null&&(y=_.getSnapshotBeforeUpdate(f,p)),O=u!=null&&u.type===oe&&u.key==null?Da(u.props.children):u,s=Ma(e,ro(O)?O:[O],t,n,o,i,a,l,s,c,d),_.base=t.__e,t.__u&=-161,_.__h.length&&l.push(_),v&&(_.__E=_.__=null)}catch(j){if(t.__v=null,c||a!=null)if(j.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__e=s}else{for(Z=a.length;Z--;)Hr(a[Z]);Or(t)}else t.__e=n.__e,t.__k=n.__k,j.then||Or(t);J.__e(j,t,n)}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=s_(n.__e,t,n,o,i,a,l,c,d);return(u=J.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 Oa(e,t,n){for(var o=0;o<n.length;o++)Fr(n[o],n[++o],n[++o]);J.__c&&J.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(a){a.call(i)})}catch(a){J.__e(a,i.__v)}})}function Da(e){return typeof e!="object"||e==null||e.__b>0?e:ro(e)?e.map(Da):e.constructor!==void 0?null:Ye({},e)}function s_(e,t,n,o,i,a,l,s,c){var d,u,_,g,f,p,y,v=n.props||eo,b=t.props,w=t.type;if(w=="svg"?i="http://www.w3.org/2000/svg":w=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),a!=null){for(d=0;d<a.length;d++)if((f=a[d])&&"setAttribute"in f==!!w&&(w?f.localName==w:f.nodeType==3)){e=f,a[d]=null;break}}if(e==null){if(w==null)return document.createTextNode(b);e=document.createElementNS(i,w,b.is&&b),s&&(J.__m&&J.__m(t,a),s=!1),a=null}if(w==null)v===b||s&&e.data==b||(e.data=b);else{if(a=w=="textarea"&&b.defaultValue!=null?null:a&&oo.call(e.childNodes),!s&&a!=null)for(v={},d=0;d<e.attributes.length;d++)v[(f=e.attributes[d]).name]=f.value;for(d in v)f=v[d],d=="dangerouslySetInnerHTML"?_=f:d=="children"||d in b||d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b||Jn(e,d,null,f,i);for(d in b)f=b[d],d=="children"?g=f:d=="dangerouslySetInnerHTML"?u=f:d=="value"?p=f:d=="checked"?y=f:s&&typeof f!="function"||v[d]===f||Jn(e,d,f,v[d],i);if(u)s||_&&(u.__html==_.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(_&&(e.innerHTML=""),Ma(t.type=="template"?e.content:e,ro(g)?g:[g],t,n,o,w=="foreignObject"?"http://www.w3.org/1999/xhtml":i,a,l,a?a[0]:n.__k&&Lt(n,0),s,c),a!=null)for(d=a.length;d--;)Hr(a[d]);s&&w!="textarea"||(d="value",w=="progress"&&p==null?e.removeAttribute("value"):p!=null&&(p!==e[d]||w=="progress"&&!p||w=="option"&&p!=v[d])&&Jn(e,d,p,v[d],i),d="checked",y!=null&&y!=e[d]&&Jn(e,d,y,v[d],i))}return e}function Fr(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(i){J.__e(i,n)}}function $a(e,t,n){var o,i;if(J.unmount&&J.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Fr(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(a){J.__e(a,t)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&$a(o[i],t,n||typeof e.type!="function");n||Hr(e.__e),e.__c=e.__=e.__e=void 0}function l_(e,t,n){return this.constructor(e,n)}function Mt(e,t,n){var o,i,a,l;t==document&&(t=document.documentElement),J.__&&J.__(e,t),i=(o=typeof n=="function")?null:n&&n.__k||t.__k,a=[],l=[],Br(t,e=(!o&&n||t).__k=io(oe,null,[e]),i||eo,eo,t.namespaceURI,!o&&n?[n]:i?null:t.firstChild?oo.call(t.childNodes):null,a,!o&&n?n:i?i.__e:t.firstChild,o,l),Oa(a,e,l)}oo=to.slice,J={__e:function(e,t,n,o){for(var i,a,l;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),l=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,o||{}),l=i.__d),l)return i.__E=i}catch(s){e=s}throw e}},Ta=0,Dr=function(e){return e!=null&&e.constructor===void 0},at.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ye({},this.state),typeof e=="function"&&(e=e(Ye({},n),this.props)),e&&Ye(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ka(this))},at.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ka(this))},at.prototype.render=oe,it=[],Ra=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ia=function(e,t){return e.__v.__b-t.__v.__b},no.__r=0,Lr=Math.random().toString(8),Qn="__d"+Lr,cn="__a"+Lr,Aa=/(PointerCapture)$|Capture$/i,$r=0,Mr=Ea(!1),Nr=Ea(!0),n_=0;var Nt="0.51.1";function Ha(e){return`${P.cssPrefix}:${e}`}function dn(e,t,n){e.dispatchEvent(new CustomEvent(Ha(t),{detail:n}))}function Ba(e,t){let o=Object.entries(t).map(([i,a])=>{let l=Ha(i),s=c=>a(c.detail);return e.addEventListener(l,s),[l,s]});return()=>{for(let[i,a]of o)e.removeEventListener(i,a)}}function He(){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,c_(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 c_(e){if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"){crypto.getRandomValues(e);return}for(let t=0;t<e.length;t++)e[t]=Math.floor(Math.random()*256)}var gt=F.scope("persistence");function st(e,t=Vn,n){let o=n?`${e}.${n}`:e,i=`${P.cssPrefix}.storageVersion`,a=t.get(i)??void 0,l=a?`.v${a}`:"",s=`${P.cssPrefix}.${o}${l}`,c=`${P.cssPrefix}${l}.visitorId`,d=`${s}.conversationId`,u=`${s}.userPrefs`,_=`${s}.panelOpen`,g=`${s}.panelSize`,f=`${s}.calloutDismissed`,p=`${s}.sidebarCollapsed`,y=`${s}.activeModule`,v=`${s}.historyCount`,b=`${s}.formsDone`,w={getVisitorId(){let x=t.get(c);if(x)return x;let E=He();return t.set(c,E),E},setVisitorId(x){gt.debug("setVisitorId (rebind)",{id:x,scope:o}),t.set(c,x)},loadConversationId(){return t.get(d)??void 0},saveConversationId(x){gt.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 E=JSON.parse(x);return Fa(E)?E:{}}catch(E){return gt.warn("loadUserPrefs parse failed",{error:E}),{}}},saveUserPrefs(x){try{t.set(u,JSON.stringify(x))}catch(E){gt.warn("saveUserPrefs serialise failed",{error:E})}},patchUserPrefs(x){let E=w.loadUserPrefs();w.saveUserPrefs({...E,...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 E=t.get(f);return!!E&&E===x},saveCalloutDismissed(x){x?t.set(f,x):t.remove(f)},loadSidebarCollapsed(){let x=t.get(p);return x==="1"?!0:x==="0"?!1:null},saveSidebarCollapsed(x){t.set(p,x?"1":"0")},loadActiveModule(){return t.get(y)||null},saveActiveModule(x){t.set(y,x)},loadHistoryCount(){let x=t.get(v);if(!x)return null;let E=Number.parseInt(x,10);return Number.isFinite(E)&&E>=0?E:null},saveHistoryCount(x){t.set(v,String(x))},loadFormsDone(){let x=t.get(b);if(!x)return{};try{let E=JSON.parse(x);return Fa(E)?E:{}}catch(E){return gt.warn("loadFormsDone parse failed",{error:E}),{}}},saveFormDone(x){try{let E=w.loadFormsDone();E[x]=Date.now(),t.set(b,JSON.stringify(E))}catch(E){gt.warn("saveFormDone serialise failed",{error:E})}},rememberStorageVersion(x){x&&x!==t.get(i)&&(gt.debug("rememberStorageVersion (force-reset on next load)",{version:x}),t.set(i,x))},clearConversation(){t.remove(d)}};return w}function Fa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var za=`: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}}
|
|
1
|
+
"use strict";var HelpAI=(()=>{var hr=Object.defineProperty;var vd=Object.getOwnPropertyDescriptor;var bd=Object.getOwnPropertyNames;var xd=Object.prototype.hasOwnProperty;var Pd=(e,t,n)=>t in e?hr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var yd=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of bd(t))!xd.call(e,i)&&i!==n&&hr(e,i,{get:()=>t[i],enumerable:!(o=vd(t,i))||o.enumerable});return e};var Sd=e=>yd(hr({},"__esModule",{value:!0}),e);var U=(e,t,n)=>Pd(e,typeof t!="symbol"?t+"":t,n);var Em={};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 Xi={attach:"Attach files",attachmentMimeRejected:"File type not supported",attachmentTooLarge:"File is too large",attachmentTooMany:"Attachment limit reached",conversationClosed:"This conversation is closed",conversationLoading:"Loading conversation\u2026",close:"Close",collapse:"Collapse",collapseSidebar:"Collapse sidebar",composerPlaceholder:"Type a message\u2026",dateLastWeek:"Last 7 days",dateOlder:"Older",dateToday:"Today",dateYesterday:"Yesterday",dropZone:"Drop files to attach",errorGeneric:"Something went wrong",errorRateLimited:"Too many requests \u2014 please try again in a moment.",errorRetry:"Retry",expand:"Expand",expandSidebar:"Expand sidebar",exitFullscreen:"Exit fullscreen",fullscreen:"Fullscreen",history:"History",historyBack:"Back to chat",historyEmpty:"No previous conversations yet",historyLoading:"Loading your conversations\u2026",historyContinue:"Continue the conversation",historyTitle:"Conversation history",language:"Language",launcherOpen:"Open chat",launcherLabel:"Chat with us",micStart:"Start voice input",micStop:"Stop voice input",micUnsupported:"Voice input is not supported in this browser",moreActions:"More actions",newConversation:"New conversation",panelTitle:"Chat",resizeHandle:"Drag to resize",scrollToBottom:"Scroll to latest",send:"Send",soundOff:"Sound off",soundOn:"Sound on",startNewConversation:"Start a new conversation",stop:"Stop",theme:"Theme",themeAuto:"Auto",themeDark:"Dark",themeLight:"Light",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",loading:"Loading\u2026",thinking:"Thinking\u2026",thoughts:"Thoughts",usedTool:"Used tool",toolResult:"Result",sources:"Sources",tabHome:"Home",tabConversations:"Conversations",tabHelp:"Help",tabNews:"News",modulesEmpty:"Nothing here yet",moduleBack:"Back",contentLoading:"Loading\u2026",homeGreeting:"How can we help?",homeGreetingNamed:"Hi {name} \u{1F44B}",homeGreetingLead:"How can we help?",homeSearchPlaceholder:"Search for help",homeContentTitle:"Popular articles",homeStatus:"Status",helpTitle:"Help",helpSearchPlaceholder:"Search for help",helpEmpty:"No help articles yet",helpLoading:"Loading help\u2026",helpSearchEmpty:"No results found",newsTitle:"News",newsEmpty:"No news yet",newsLoading:"Loading news\u2026",newsBack:"Back to news",newsPublishedAt:"Published {date}",formSubmit:"Submit",formSkip:"Maybe later",formSubmitted:"Completed",formSkipped:"Maybe later",formFillOut:"Fill out",formRequired:"This field is required",formInvalidEmail:"Enter a valid email address",formInvalidTel:"Enter a valid phone number",formInvalidUrl:"Enter a valid URL",formInvalidNumber:"Enter a valid number",formTooShort:"Too short (min {min} characters)",formTooLong:"Too long (max {max} characters)",formNumberTooSmall:"Must be at least {min}",formNumberTooLarge:"Must be at most {max}",formPatternMismatch:"Please match the requested format",formChooseAtLeast:"Choose at least {min}",formChooseAtMost:"Choose at most {max}",formOther:"Other",formOtherPlaceholder:"Type your answer\u2026",inputRequired:"User Input Required",inputBadge:"User Input",inputAnswered:"Answered",inputSkipped:"Skipped",inputQuestion:"Question",inputResponse:"Response",inputYourAnswer:"Your answer",inputSubmit:"Submit answer",inputSubmitHint:"Enter to submit \xB7 Shift+Enter for new line",inputAnswerPlaceholder:"Type your answer\u2026",inputSkip:"Skip",confirmYes:"Yes",confirmNo:"No",inputConfirmHint:"Choose yes or no.",inputOptionalNote:"Optional note",inputOptionalNotePlaceholder:"Optional comment\u2026",inputSubmitted:"Answer submitted",respFreeText:"Free Text",respSingleChoice:"Single Choice",respMultiChoice:"Multiple Choice",respConfirmation:"Confirmation",approvalRequired:"Approval required",approve:"Approve",reject:"Reject",approved:"Approved",rejected:"Rejected",approvalReason:"Add a reason (optional)",approvalPrompt:"{tool} requires your approval to execute.",approvalBody:"Review the tool input above and decide whether to allow this action.",approvalYourResponse:"Your response: {decision}",approvalEditHint:"You can edit this response until this step continues.",approvalSubmitting:"Response submitted. Request in progress\u2026",edit:"Edit",stepNoLongerActive:"This request is no longer active.",toolParameters:"Parameters",statusAwaiting:"Awaiting Approval",statusResponded:"Responded",statusRunning:"Running",statusCompleted:"Completed",statusDenied:"Denied",statusError:"Error"},wd={attach:"Joindre des fichiers",attachmentMimeRejected:"Type de fichier non pris en charge",attachmentTooLarge:"Le fichier est trop volumineux",attachmentTooMany:"Limite de pi\xE8ces jointes atteinte",conversationClosed:"Cette conversation est ferm\xE9e",conversationLoading:"Chargement de la conversation\u2026",close:"Fermer",collapse:"R\xE9duire",collapseSidebar:"R\xE9duire la barre lat\xE9rale",composerPlaceholder:"\xC9crivez un message\u2026",dateLastWeek:"7 derniers jours",dateOlder:"Plus ancien",dateToday:"Aujourd'hui",dateYesterday:"Hier",dropZone:"D\xE9posez les fichiers \xE0 joindre",errorGeneric:"Une erreur s'est produite",errorRateLimited:"Trop de requ\xEAtes \u2014 veuillez r\xE9essayer dans un instant.",errorRetry:"R\xE9essayer",expand:"Agrandir",expandSidebar:"D\xE9velopper la barre lat\xE9rale",exitFullscreen:"Quitter le plein \xE9cran",fullscreen:"Plein \xE9cran",history:"Historique",historyBack:"Retour au chat",historyEmpty:"Aucune conversation pour le moment",historyContinue:"Poursuivre la conversation",historyLoading:"Chargement de vos conversations\u2026",historyTitle:"Historique des conversations",language:"Langue",launcherOpen:"Ouvrir le chat",launcherLabel:"Discuter avec nous",micStart:"D\xE9marrer la saisie vocale",micStop:"Arr\xEAter la saisie vocale",micUnsupported:"La saisie vocale n'est pas prise en charge par ce navigateur",moreActions:"Plus d'actions",newConversation:"Nouvelle conversation",panelTitle:"Chat",resizeHandle:"Glisser pour redimensionner",scrollToBottom:"Aller au plus r\xE9cent",send:"Envoyer",soundOff:"Son d\xE9sactiv\xE9",soundOn:"Son activ\xE9",startNewConversation:"D\xE9marrer une nouvelle conversation",stop:"Arr\xEAter",theme:"Th\xE8me",themeAuto:"Auto",themeDark:"Sombre",themeLight:"Clair",textSize:"Taille du texte",textSizeSmall:"Petite",textSizeNormal:"Normale",textSizeLarge:"Grande",loading:"Chargement\u2026",thinking:"R\xE9flexion\u2026",thoughts:"R\xE9flexions",usedTool:"Outil utilis\xE9",toolResult:"R\xE9sultat",sources:"Sources",tabHome:"Accueil",tabConversations:"Conversations",tabHelp:"Aide",tabNews:"Actualit\xE9s",modulesEmpty:"Rien pour le moment",moduleBack:"Retour",contentLoading:"Chargement\u2026",homeGreeting:"Comment pouvons-nous vous aider ?",homeGreetingNamed:"Bonjour {name} \u{1F44B}",homeGreetingLead:"Comment pouvons-nous vous aider ?",homeSearchPlaceholder:"Rechercher de l'aide",homeContentTitle:"Articles populaires",homeStatus:"Statut",helpTitle:"Aide",helpSearchPlaceholder:"Rechercher de l'aide",helpEmpty:"Aucun article d'aide pour le moment",helpLoading:"Chargement de l'aide\u2026",helpSearchEmpty:"Aucun r\xE9sultat trouv\xE9",newsTitle:"Actualit\xE9s",newsEmpty:"Aucune actualit\xE9 pour le moment",newsLoading:"Chargement des actualit\xE9s\u2026",newsBack:"Retour aux actualit\xE9s",newsPublishedAt:"Publi\xE9 le {date}",formSubmit:"Envoyer",formSkip:"Plus tard",formSubmitted:"Termin\xE9",formSkipped:"Plus tard",formFillOut:"Remplir",formRequired:"Ce champ est obligatoire",formInvalidEmail:"Saisissez une adresse e-mail valide",formInvalidTel:"Saisissez un num\xE9ro de t\xE9l\xE9phone valide",formInvalidUrl:"Saisissez une URL valide",formInvalidNumber:"Saisissez un nombre valide",formTooShort:"Trop court (min. {min} caract\xE8res)",formTooLong:"Trop long (max. {max} caract\xE8res)",formNumberTooSmall:"Doit \xEAtre au moins {min}",formNumberTooLarge:"Doit \xEAtre au plus {max}",formPatternMismatch:"Veuillez respecter le format demand\xE9",formChooseAtLeast:"Choisissez au moins {min}",formChooseAtMost:"Choisissez au plus {max}",formOther:"Autre",formOtherPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputRequired:"Saisie requise",inputBadge:"Saisie",inputAnswered:"R\xE9pondu",inputSkipped:"Ignor\xE9",inputQuestion:"Question",inputResponse:"R\xE9ponse",inputYourAnswer:"Votre r\xE9ponse",inputSubmit:"Envoyer la r\xE9ponse",inputSubmitHint:"Entr\xE9e pour envoyer \xB7 Maj+Entr\xE9e pour un saut de ligne",inputAnswerPlaceholder:"Saisissez votre r\xE9ponse\u2026",inputSkip:"Ignorer",confirmYes:"Oui",confirmNo:"Non",inputConfirmHint:"Choisissez oui ou non.",inputOptionalNote:"Note facultative",inputOptionalNotePlaceholder:"Commentaire facultatif\u2026",inputSubmitted:"R\xE9ponse envoy\xE9e",respFreeText:"Texte libre",respSingleChoice:"Choix unique",respMultiChoice:"Choix multiple",respConfirmation:"Confirmation",approvalRequired:"Approbation requise",approve:"Approuver",reject:"Refuser",approved:"Approuv\xE9",rejected:"Refus\xE9",approvalReason:"Ajouter une raison (facultatif)",approvalPrompt:"{tool} n\xE9cessite votre approbation pour s'ex\xE9cuter.",approvalBody:"V\xE9rifiez les param\xE8tres ci-dessus et d\xE9cidez d'autoriser ou non cette action.",approvalYourResponse:"Votre r\xE9ponse : {decision}",approvalEditHint:"Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",approvalSubmitting:"R\xE9ponse envoy\xE9e. Traitement en cours\u2026",edit:"Modifier",stepNoLongerActive:"Cette demande n'est plus active.",toolParameters:"Param\xE8tres",statusAwaiting:"En attente d'approbation",statusResponded:"R\xE9pondu",statusRunning:"En cours",statusCompleted:"Termin\xE9",statusDenied:"Refus\xE9",statusError:"Erreur"},kd={attach:"\u0625\u0631\u0641\u0627\u0642 \u0645\u0644\u0641\u0627\u062A",attachmentMimeRejected:"\u0646\u0648\u0639 \u0627\u0644\u0645\u0644\u0641 \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645",attachmentTooLarge:"\u062D\u062C\u0645 \u0627\u0644\u0645\u0644\u0641 \u0643\u0628\u064A\u0631 \u062C\u062F\u064B\u0627",attachmentTooMany:"\u062A\u0645 \u0628\u0644\u0648\u063A \u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u0645\u0631\u0641\u0642\u0627\u062A",conversationClosed:"\u062A\u0645 \u0625\u063A\u0644\u0627\u0642 \u0647\u0630\u0647 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",conversationLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629\u2026",close:"\u0625\u063A\u0644\u0627\u0642",collapse:"\u0637\u064A\u0651",collapseSidebar:"\u0637\u064A\u0651 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",composerPlaceholder:"\u0627\u0643\u062A\u0628 \u0631\u0633\u0627\u0644\u0629\u2026",dateLastWeek:"\u0622\u062E\u0631 \u0667 \u0623\u064A\u0627\u0645",dateOlder:"\u0623\u0642\u062F\u0645",dateToday:"\u0627\u0644\u064A\u0648\u0645",dateYesterday:"\u0623\u0645\u0633",dropZone:"\u0623\u0641\u0644\u062A \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0644\u0625\u0631\u0641\u0627\u0642\u0647\u0627",errorGeneric:"\u062D\u062F\u062B \u062E\u0637\u0623 \u0645\u0627",errorRateLimited:"\u0637\u0644\u0628\u0627\u062A \u0643\u062B\u064A\u0631\u0629 \u062C\u062F\u064B\u0627 \u2014 \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0628\u0639\u062F \u0644\u062D\u0638\u0629.",errorRetry:"\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629",expand:"\u062A\u0648\u0633\u064A\u0639",expandSidebar:"\u062A\u0648\u0633\u064A\u0639 \u0627\u0644\u0634\u0631\u064A\u0637 \u0627\u0644\u062C\u0627\u0646\u0628\u064A",exitFullscreen:"\u0625\u0646\u0647\u0627\u0621 \u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",fullscreen:"\u0645\u0644\u0621 \u0627\u0644\u0634\u0627\u0634\u0629",history:"\u0627\u0644\u0633\u062C\u0644",historyBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",historyEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u062D\u0627\u062F\u062B\u0627\u062A \u0633\u0627\u0628\u0642\u0629 \u0628\u0639\u062F",historyContinue:"\u0645\u062A\u0627\u0628\u0639\u0629 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",historyLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0645\u062D\u0627\u062F\u062B\u0627\u062A\u0643\u2026",historyTitle:"\u0633\u062C\u0644 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0627\u062A",language:"\u0627\u0644\u0644\u063A\u0629",launcherOpen:"\u0641\u062A\u062D \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",launcherLabel:"\u062A\u062D\u062F\u062B \u0645\u0639\u0646\u0627",micStart:"\u0628\u062F\u0621 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micStop:"\u0625\u064A\u0642\u0627\u0641 \u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A",micUnsupported:"\u0627\u0644\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0635\u0648\u062A\u064A \u063A\u064A\u0631 \u0645\u062F\u0639\u0648\u0645 \u0641\u064A \u0647\u0630\u0627 \u0627\u0644\u0645\u062A\u0635\u0641\u062D",moreActions:"\u0625\u062C\u0631\u0627\u0621\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629",newConversation:"\u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629",panelTitle:"\u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629",resizeHandle:"\u0627\u0633\u062D\u0628 \u0644\u062A\u063A\u064A\u064A\u0631 \u0627\u0644\u062D\u062C\u0645",scrollToBottom:"\u0627\u0644\u0627\u0646\u062A\u0642\u0627\u0644 \u0625\u0644\u0649 \u0627\u0644\u0623\u062D\u062F\u062B",send:"\u0625\u0631\u0633\u0627\u0644",soundOff:"\u0643\u062A\u0645 \u0627\u0644\u0635\u0648\u062A",soundOn:"\u062A\u0634\u063A\u064A\u0644 \u0627\u0644\u0635\u0648\u062A",startNewConversation:"\u0628\u062F\u0621 \u0645\u062D\u0627\u062F\u062B\u0629 \u062C\u062F\u064A\u062F\u0629",stop:"\u0625\u064A\u0642\u0627\u0641",theme:"\u0627\u0644\u0645\u0638\u0647\u0631",themeAuto:"\u062A\u0644\u0642\u0627\u0626\u064A",themeDark:"\u062F\u0627\u0643\u0646",themeLight:"\u0641\u0627\u062A\u062D",textSize:"\u062D\u062C\u0645 \u0627\u0644\u0646\u0635",textSizeSmall:"\u0635\u063A\u064A\u0631",textSizeNormal:"\u0639\u0627\u062F\u064A",textSizeLarge:"\u0643\u0628\u064A\u0631",loading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",thinking:"\u064A\u0641\u0643\u0651\u0631\u2026",thoughts:"\u0627\u0644\u0623\u0641\u0643\u0627\u0631",usedTool:"\u0623\u062F\u0627\u0629 \u0645\u064F\u0633\u062A\u062E\u062F\u064E\u0645\u0629",toolResult:"\u0627\u0644\u0646\u062A\u064A\u062C\u0629",sources:"\u0627\u0644\u0645\u0635\u0627\u062F\u0631",tabHome:"\u0627\u0644\u0631\u0626\u064A\u0633\u064A\u0629",tabConversations:"\u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0627\u062A",tabHelp:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",tabNews:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",modulesEmpty:"\u0644\u0627 \u0634\u064A\u0621 \u0647\u0646\u0627 \u0628\u0639\u062F",moduleBack:"\u0631\u062C\u0648\u0639",contentLoading:"\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026",homeGreeting:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeGreetingNamed:"\u0645\u0631\u062D\u0628\u064B\u0627 {name} \u{1F44B}",homeGreetingLead:"\u0643\u064A\u0641 \u064A\u0645\u0643\u0646\u0646\u0627 \u0645\u0633\u0627\u0639\u062F\u062A\u0643\u061F",homeSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",homeContentTitle:"\u0645\u0642\u0627\u0644\u0627\u062A \u0634\u0627\u0626\u0639\u0629",homeStatus:"\u0627\u0644\u062D\u0627\u0644\u0629",helpTitle:"\u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629",helpSearchPlaceholder:"\u0627\u0628\u062D\u062B \u0639\u0646 \u0645\u0633\u0627\u0639\u062F\u0629",helpEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0645\u0642\u0627\u0644\u0627\u062A \u0645\u0633\u0627\u0639\u062F\u0629 \u0628\u0639\u062F",helpLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0645\u0633\u0627\u0639\u062F\u0629\u2026",helpSearchEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C",newsTitle:"\u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsEmpty:"\u0644\u0627 \u062A\u0648\u062C\u062F \u0623\u062E\u0628\u0627\u0631 \u0628\u0639\u062F",newsLoading:"\u062C\u0627\u0631\u064D \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u0623\u062E\u0628\u0627\u0631\u2026",newsBack:"\u0627\u0644\u0639\u0648\u062F\u0629 \u0625\u0644\u0649 \u0627\u0644\u0623\u062E\u0628\u0627\u0631",newsPublishedAt:"\u0646\u064F\u0634\u0631 \u0641\u064A {date}",formSubmit:"\u0625\u0631\u0633\u0627\u0644",formSkip:"\u0644\u0627\u062D\u0642\u064B\u0627",formSubmitted:"\u062A\u0645",formSkipped:"\u0644\u0627\u062D\u0642\u064B\u0627",formFillOut:"\u062A\u0639\u0628\u0626\u0629",formRequired:"\u0647\u0630\u0627 \u0627\u0644\u062D\u0642\u0644 \u0645\u0637\u0644\u0648\u0628",formInvalidEmail:"\u0623\u062F\u062E\u0644 \u0628\u0631\u064A\u062F\u064B\u0627 \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidTel:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidUrl:"\u0623\u062F\u062E\u0644 \u0631\u0627\u0628\u0637\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formInvalidNumber:"\u0623\u062F\u062E\u0644 \u0631\u0642\u0645\u064B\u0627 \u0635\u062D\u064A\u062D\u064B\u0627",formTooShort:"\u0642\u0635\u064A\u0631 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u062F\u0646\u0649 {min} \u062D\u0631\u0641\u064B\u0627)",formTooLong:"\u0637\u0648\u064A\u0644 \u062C\u062F\u064B\u0627 (\u0627\u0644\u062D\u062F \u0627\u0644\u0623\u0642\u0635\u0649 {max} \u062D\u0631\u0641\u064B\u0627)",formNumberTooSmall:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0642\u0644 \u0639\u0646 {min}",formNumberTooLarge:"\u064A\u062C\u0628 \u0623\u0644\u0627 \u064A\u0632\u064A\u062F \u0639\u0646 {max}",formPatternMismatch:"\u064A\u0631\u062C\u0649 \u0645\u0637\u0627\u0628\u0642\u0629 \u0627\u0644\u0635\u064A\u063A\u0629 \u0627\u0644\u0645\u0637\u0644\u0648\u0628\u0629",formChooseAtLeast:"\u0627\u062E\u062A\u0631 {min} \u0639\u0644\u0649 \u0627\u0644\u0623\u0642\u0644",formChooseAtMost:"\u0627\u062E\u062A\u0631 {max} \u0639\u0644\u0649 \u0627\u0644\u0623\u0643\u062B\u0631",formOther:"\u0623\u062E\u0631\u0649",formOtherPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputRequired:"\u0645\u0637\u0644\u0648\u0628 \u0625\u062F\u062E\u0627\u0644 \u0645\u0646 \u0627\u0644\u0645\u0633\u062A\u062E\u062F\u0645",inputBadge:"\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0645\u0633\u062A\u062E\u062F\u0645",inputAnswered:"\u062A\u0645\u062A \u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputSkipped:"\u062A\u0645 \u0627\u0644\u062A\u062E\u0637\u064A",inputQuestion:"\u0627\u0644\u0633\u0624\u0627\u0644",inputResponse:"\u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputYourAnswer:"\u0625\u062C\u0627\u0628\u062A\u0643",inputSubmit:"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",inputSubmitHint:"\u0627\u0636\u063A\u0637 Enter \u0644\u0644\u0625\u0631\u0633\u0627\u0644 \xB7 Shift+Enter \u0644\u0633\u0637\u0631 \u062C\u062F\u064A\u062F",inputAnswerPlaceholder:"\u0627\u0643\u062A\u0628 \u0625\u062C\u0627\u0628\u062A\u0643\u2026",inputSkip:"\u062A\u062E\u0637\u064D\u0651",confirmYes:"\u0646\u0639\u0645",confirmNo:"\u0644\u0627",inputConfirmHint:"\u0627\u062E\u062A\u0631 \u0646\u0639\u0645 \u0623\u0648 \u0644\u0627.",inputOptionalNote:"\u0645\u0644\u0627\u062D\u0638\u0629 \u0627\u062E\u062A\u064A\u0627\u0631\u064A\u0629",inputOptionalNotePlaceholder:"\u062A\u0639\u0644\u064A\u0642 \u0627\u062E\u062A\u064A\u0627\u0631\u064A\u2026",inputSubmitted:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",respFreeText:"\u0646\u0635 \u062D\u0631",respSingleChoice:"\u0627\u062E\u062A\u064A\u0627\u0631 \u0648\u0627\u062D\u062F",respMultiChoice:"\u0627\u062E\u062A\u064A\u0627\u0631 \u0645\u062A\u0639\u062F\u062F",respConfirmation:"\u062A\u0623\u0643\u064A\u062F",approvalRequired:"\u0645\u0637\u0644\u0648\u0628 \u0645\u0648\u0627\u0641\u0642\u0629",approve:"\u0645\u0648\u0627\u0641\u0642\u0629",reject:"\u0631\u0641\u0636",approved:"\u062A\u0645\u062A \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",rejected:"\u0645\u0631\u0641\u0648\u0636",approvalReason:"\u0623\u0636\u0641 \u0633\u0628\u0628\u064B\u0627 (\u0627\u062E\u062A\u064A\u0627\u0631\u064A)",approvalPrompt:"\u062A\u062A\u0637\u0644\u0628 {tool} \u0645\u0648\u0627\u0641\u0642\u062A\u0643 \u0644\u0644\u062A\u0646\u0641\u064A\u0630.",approvalBody:"\u0631\u0627\u062C\u0639 \u0645\u064F\u0639\u0637\u064A\u0627\u062A \u0627\u0644\u0623\u062F\u0627\u0629 \u0623\u0639\u0644\u0627\u0647 \u0648\u0642\u0631\u0651\u0631 \u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0647\u0630\u0627 \u0627\u0644\u0625\u062C\u0631\u0627\u0621 \u0623\u0648 \u0631\u0641\u0636\u0647.",approvalYourResponse:"\u0631\u062F\u0651\u0643: {decision}",approvalEditHint:"\u064A\u0645\u0643\u0646\u0643 \u062A\u0639\u062F\u064A\u0644 \u0631\u062F\u0651\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",approvalSubmitting:"\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062F. \u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",edit:"\u062A\u0639\u062F\u064A\u0644",stepNoLongerActive:"\u0644\u0645 \u064A\u0639\u062F \u0647\u0630\u0627 \u0627\u0644\u0637\u0644\u0628 \u0646\u0634\u0637\u064B\u0627.",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"},Cd={attach:"Adjuntar archivos",attachmentMimeRejected:"Tipo de archivo no admitido",attachmentTooLarge:"El archivo es demasiado grande",attachmentTooMany:"Se alcanz\xF3 el l\xEDmite de adjuntos",conversationClosed:"Esta conversaci\xF3n est\xE1 cerrada",conversationLoading:"Cargando conversaci\xF3n\u2026",close:"Cerrar",collapse:"Contraer",collapseSidebar:"Contraer la barra lateral",composerPlaceholder:"Escribe un mensaje\u2026",dateLastWeek:"\xDAltimos 7 d\xEDas",dateOlder:"Anteriores",dateToday:"Hoy",dateYesterday:"Ayer",dropZone:"Suelta los archivos para adjuntarlos",errorGeneric:"Algo sali\xF3 mal",errorRateLimited:"Demasiadas solicitudes: int\xE9ntalo de nuevo en un momento.",errorRetry:"Reintentar",expand:"Ampliar",expandSidebar:"Expandir la barra lateral",exitFullscreen:"Salir de pantalla completa",fullscreen:"Pantalla completa",history:"Historial",historyBack:"Volver al chat",historyEmpty:"A\xFAn no tienes conversaciones",historyContinue:"Continuar la conversaci\xF3n",historyLoading:"Cargando tus conversaciones\u2026",historyTitle:"Historial de conversaciones",language:"Idioma",launcherOpen:"Abrir el chat",launcherLabel:"Chatea con nosotros",micStart:"Iniciar entrada de voz",micStop:"Detener entrada de voz",micUnsupported:"Este navegador no admite la entrada de voz",moreActions:"M\xE1s acciones",newConversation:"Nueva conversaci\xF3n",panelTitle:"Chat",resizeHandle:"Arrastra para cambiar el tama\xF1o",scrollToBottom:"Ir a lo m\xE1s reciente",send:"Enviar",soundOff:"Sonido desactivado",soundOn:"Sonido activado",startNewConversation:"Iniciar una conversaci\xF3n nueva",stop:"Detener",theme:"Tema",themeAuto:"Autom\xE1tico",themeDark:"Oscuro",themeLight:"Claro",textSize:"Tama\xF1o del texto",textSizeSmall:"Peque\xF1o",textSizeNormal:"Normal",textSizeLarge:"Grande",loading:"Cargando\u2026",thinking:"Pensando\u2026",thoughts:"Razonamiento",usedTool:"Herramienta usada",toolResult:"Resultado",sources:"Fuentes",tabHome:"Inicio",tabConversations:"Conversaciones",tabHelp:"Ayuda",tabNews:"Novedades",modulesEmpty:"A\xFAn no hay nada aqu\xED",moduleBack:"Atr\xE1s",contentLoading:"Cargando\u2026",homeGreeting:"\xBFC\xF3mo podemos ayudarte?",homeGreetingNamed:"Hola, {name} \u{1F44B}",homeGreetingLead:"\xBFC\xF3mo podemos ayudarte?",homeSearchPlaceholder:"Buscar ayuda",homeContentTitle:"Art\xEDculos populares",homeStatus:"Estado",helpTitle:"Ayuda",helpSearchPlaceholder:"Buscar ayuda",helpEmpty:"A\xFAn no hay art\xEDculos de ayuda",helpLoading:"Cargando la ayuda\u2026",helpSearchEmpty:"No se encontraron resultados",newsTitle:"Novedades",newsEmpty:"A\xFAn no hay novedades",newsLoading:"Cargando novedades\u2026",newsBack:"Volver a novedades",newsPublishedAt:"Publicado el {date}",formSubmit:"Enviar",formSkip:"Quiz\xE1 m\xE1s tarde",formSubmitted:"Completado",formSkipped:"Quiz\xE1 m\xE1s tarde",formFillOut:"Completar",formRequired:"Este campo es obligatorio",formInvalidEmail:"Introduce un correo electr\xF3nico v\xE1lido",formInvalidTel:"Introduce un n\xFAmero de tel\xE9fono v\xE1lido",formInvalidUrl:"Introduce una URL v\xE1lida",formInvalidNumber:"Introduce un n\xFAmero v\xE1lido",formTooShort:"Demasiado corto (m\xEDn. {min} caracteres)",formTooLong:"Demasiado largo (m\xE1x. {max} caracteres)",formNumberTooSmall:"Debe ser al menos {min}",formNumberTooLarge:"Debe ser como m\xE1ximo {max}",formPatternMismatch:"Respeta el formato solicitado",formChooseAtLeast:"Elige al menos {min}",formChooseAtMost:"Elige como m\xE1ximo {max}",formOther:"Otro",formOtherPlaceholder:"Escribe tu respuesta\u2026",inputRequired:"Entrada requerida",inputBadge:"Entrada",inputAnswered:"Respondido",inputSkipped:"Omitido",inputQuestion:"Pregunta",inputResponse:"Respuesta",inputYourAnswer:"Tu respuesta",inputSubmit:"Enviar respuesta",inputSubmitHint:"Enter para enviar \xB7 May\xFAs+Enter para una nueva l\xEDnea",inputAnswerPlaceholder:"Escribe tu respuesta\u2026",inputSkip:"Omitir",confirmYes:"S\xED",confirmNo:"No",inputConfirmHint:"Elige s\xED o no.",inputOptionalNote:"Nota opcional",inputOptionalNotePlaceholder:"Comentario opcional\u2026",inputSubmitted:"Respuesta enviada",respFreeText:"Texto libre",respSingleChoice:"Opci\xF3n \xFAnica",respMultiChoice:"Opci\xF3n m\xFAltiple",respConfirmation:"Confirmaci\xF3n",approvalRequired:"Aprobaci\xF3n requerida",approve:"Aprobar",reject:"Rechazar",approved:"Aprobado",rejected:"Rechazado",approvalReason:"A\xF1ade un motivo (opcional)",approvalPrompt:"{tool} requiere tu aprobaci\xF3n para ejecutarse.",approvalBody:"Revisa los par\xE1metros de arriba y decide si permites esta acci\xF3n.",approvalYourResponse:"Tu respuesta: {decision}",approvalEditHint:"Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",approvalSubmitting:"Respuesta enviada. Procesando\u2026",edit:"Editar",stepNoLongerActive:"Esta solicitud ya no est\xE1 activa.",toolParameters:"Par\xE1metros",statusAwaiting:"Esperando aprobaci\xF3n",statusResponded:"Respondido",statusRunning:"En curso",statusCompleted:"Completado",statusDenied:"Denegado",statusError:"Error"},Ed={en:Xi,fr:wd,ar:kd,es:Cd};function Un(e,t){let n=Ji(e),o=Wn(t),i=n==="en"?{}:Ed[n]??{},a=o?t[n]??{}:t??{},l=o?t.en??{}:{};return{...Xi,...i,...l,...a}}function Ji(e){return(e.split("-")[0]??"en").toLowerCase()}var Td=new Set(["ar","he","iw","fa","ur","ps","sd","ug","yi","dv","ckb","ks","nqo","prs","syr"]);function Qi(e){return Td.has(Ji(e))}function Ee(e,t){return e[t]??t}function Wn(e){if(!e)return!1;for(let t of Object.values(e))if(t&&typeof t=="object")return!0;return!1}function Zi(e,t){if(!(!e?.length||!t))return e.find(n=>n.locale===t)}function ea(e,t){let{translations:n,defaultLocale:o,...i}=e,a=Zi(n,t);return a?{...i,title:a.title??i.title,description:a.description??i.description,content:a.content??i.content}:i}function ta(e,t){let{translations:n,defaultLocale:o,...i}=e,a=Zi(n,t);if(!a)return i;let l=new Map((a.fields??[]).map(c=>[c.name,c])),s=i.fields.map(c=>{let d=l.get(c.name);if(!d)return c;let u=new Map((d.options??[]).map(_=>[_.value,_]));return{...c,label:d.label??c.label,placeholder:d.placeholder??c.placeholder,validationHint:d.validationHint??c.validationHint,options:c.options?.map(_=>{let g=u.get(_.value);return g?{..._,label:g.label??_.label,description:g.description??_.description}:_})}});return{...i,title:a.title??i.title,description:a.description??i.description,submitLabel:a.submitLabel??i.submitLabel,fields:s}}var vr=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{}}},Vn=new vr;var Pr=["off","error","warn","info","debug","trace"],yr=P.cssPrefix,na=`${yr}.debug`,Rd=`__${P.global}_DEBUG__`,Id=`${yr}-debug`,qn=2,br=null;function Ad(){if(typeof window>"u")return 2;try{let e=new URLSearchParams(window.location.search).get(Id);if(e!==null){let t=xr(e);if(t>=0)return t}}catch{}try{let e=window.localStorage?.getItem(na);if(e){let t=xr(e);if(t>=0)return t}}catch{}return window[Rd]?4:2}function xr(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=xr(e);if(!(t<0)){qn=t;try{window.localStorage?.setItem(na,Pr[t])}catch{}}}function an(){return Pr[qn]}qn=Ad();function oa(e){let t=`[${yr}:${e}]`,n=(o,i,a)=>(l,s)=>{if(!(qn<o)&&(s===void 0?console[i](t,l):console[i](t,l,s),br))try{br({level:a,scope:e,message:l,payload:s})}catch{}};return{error:n(1,"error","error"),warn:n(2,"warn","warn"),info:n(3,"info","info"),debug:n(4,"debug","debug"),trace:n(5,"debug","trace"),scope:o=>oa(`${e}:${o}`)}}var F=oa("core");function sn(e){br=e}var pt=F.scope("context"),Ld=new Set(["visitorId","conversationId","conversationId","jwt","token","authorization","password"]),ra=50,Sr=1024,Md=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function wr(e){return ia(e,"userContext",!0)}function kr(e){return ia(e,"pageContext",!1)}function ia(e,t,n){if(e==null)return;if(typeof e!="object"||Array.isArray(e)){pt.warn(`ignored ${t} \u2014 expected an object`,{type:Array.isArray(e)?"array":typeof e});return}let o={},i=0;for(let[a,l]of Object.entries(e)){if(Ld.has(a)){pt.warn(`dropped reserved ${t} key "${a}" \u2014 managed by the widget, not host-settable`);continue}if(l==null)continue;if(i>=ra){pt.warn(`${t} truncated at ${ra} keys \u2014 dropped "${a}"`);continue}let s=Nd(t,a,l);s!==void 0&&(o[a]=s,i++)}return n&&typeof o.email=="string"&&!Md.test(o.email)&&(pt.warn(`dropped malformed ${t}.email "${o.email}"`),delete o.email),Object.keys(o).length>0?o:void 0}function Nd(e,t,n){if(typeof n=="boolean")return n;if(typeof n=="number"){if(!Number.isFinite(n)){pt.warn(`dropped non-finite ${e}.${t}`);return}return n}if(typeof n=="string"){let o=n.trim();return o===""?void 0:o.length>Sr?(pt.warn(`truncated ${e}.${t} to ${Sr} chars`),o.slice(0,Sr)):o}pt.warn(`dropped ${e}.${t} \u2014 only string/number/boolean values are allowed`,{type:typeof n})}var Kn={maxBytes:10485760,maxCount:10,accept:"*/*"},jn={files:!0,voice:"local",humanInLoop:!0},aa={list:[],byTrigger:{}},Cr={enabled:!0,sampleRate:1},Yn={upload:"/pai/upload-file",transcribe:"/pai/transcribe-audio",submitForm:"/pai/submit-form"},It={variant:"circle",size:"md",label:void 0,icon:"chat",hidden:!1},sa={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"]},Er={enabled:!0,volume:.3,events:void 0},la={enabled:!0,events:void 0},ca=[{label:"tabConversations",layout:"chat"}],da={showSearchBar:!0};function rt(e){let t=e!==null&&typeof e=="object"?e:{},n=t.presentation??{},o=t.behavior??{},i=t.i18n??{},a=t.feedback??{},l=t.footer??{},s=t.header??{},{themeMode:c,themeOverrides:d}=Od(t.theme),u=n.mode??"floating",_=Dd(i.defaultLocale),g=i.availableLocales??[i.locale??_],f=At(i.locale??_,g,_),p=(t.baseUrl??P.defaultBaseUrl).replace(/\/$/,""),y=(t.agentApiBaseUrl??`${p}/api/agent`).replace(/\/$/,""),v=(t.dataApiBaseUrl??`${p}/api/data`).replace(/\/$/,"");return{widgetId:t.widgetId??"default",publicKey:t.publicKey,aiAgentDeploymentId:t.aiAgentDeploymentId,baseUrl:p,agentApiBaseUrl:y,dataApiBaseUrl:v,userContext:wr(t.userContext),pageContext:kr(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??jn.files,voice:t.features?.voice??jn.voice,humanInLoop:t.features?.humanInLoop??jn.humanInLoop,tools:t.features?.tools},forms:ln(t.forms,f),endpoints:{upload:t.endpoints?.upload??Yn.upload,transcribe:t.endpoints?.transcribe??Yn.transcribe,submitForm:t.endpoints?.submitForm??Yn.submitForm},attachments:{accept:t.composer?.attachments?.accept??Kn.accept,maxBytes:t.composer?.attachments?.maxBytes??Kn.maxBytes,maxCount:t.composer?.attachments?.maxCount??Kn.maxCount},locale:f,defaultLocale:_,availableLocales:g,startMinimized:o.startMinimized??!0,actions:$d(u,s.actions),size:n.size??{},launcher:qd(t.launcher),sound:Hd(a.sound),haptics:Bd(a.haptics),strings:Un(f,i.strings),stringsOverride:i.strings,composerDisclaimer:l.composerDisclaimer??"",poweredBy:zd(l.poweredBy),composer:Ud(t.composer),modules:Wd(t.modules),tracking:Fd(t.tracking,v),storage:t.storage??Vn,onMessage:t.onMessage,onOpen:t.onOpen,onClose:t.onClose,onError:t.onError}}function Od(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 At(e,t,n){return t.length<=1||t.includes(e)?e:t.includes(n)?n:t[0]??e}function $d(e,t){return t??sa[e]}function Hd(e){return{enabled:e?.enabled??Er.enabled,volume:e?.volume??Er.volume,events:e?.events}}function Bd(e){return{enabled:e?.enabled??la.enabled,events:e?.events}}function Fd(e,t){let n=e?.sampleRate??Cr.sampleRate;return{enabled:e?.enabled??Cr.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 zd(e){let n={...{text:`Powered by ${P.displayName}`,href:P.siteUrl},...e};return!!(n.text||n.logoUrl)?n:null}function Ud(e){let t=e?.sendButton;return{sendButton:{shape:t?.shape??"circle",icon:t?.icon??"arrowUp",variant:t?.variant??"filled"}}}function Wd(e){let t=e===void 0?ca:e,n=new Set,o=[];for(let a of t.slice(0,4)){if(!a?.label||!a?.layout)continue;let l=a.contentTags?.filter(Boolean),s=a.id??l?.[0]??a.layout;for(;n.has(s);)s=`${s}-${o.length}`;n.add(s);let c={id:s,label:a.label,layout:a.layout};l&&l.length>0&&(c.contentTags=l),a.layout==="home"&&(c.brandName=a.brandName,c.greetingText=a.greetingText,c.showGreeting=a.showGreeting??!0,c.showSearchBar=a.showSearchBar??da.showSearchBar,c.showRecentConversations=a.showRecentConversations??!0,a.userAvatars&&a.userAvatars.length>0&&(c.userAvatars=a.userAvatars),a.status&&(c.status=a.status),c.contentBlockTitle=a.contentBlockTitle),o.push(c)}let i=Object.fromEntries(o.map(a=>[a.id,a]));return{list:o,byId:i}}function ln(e,t){var a;if(!e?.length)return aa;let n=[],o=new Set;for(let l of e){if(!l?.id||o.has(l.id))continue;let s=ta(l,t),c=(s.fields??[]).filter(u=>!!(u&&u.name&&u.label&&u.type)),d=(Array.isArray(s.on)?s.on:[s.on]).map(Vd).filter(u=>u!==null);c.length===0||d.length===0||(o.add(s.id),n.push({id:s.id,triggers:d,when:s.when,fields:c,title:s.title,description:s.description,submitLabel:s.submitLabel,skippable:s.skippable??!1,frequency:s.frequency??"once",mirrorToContext:s.mirrorToContext??!0,reopenable:s.reopenable??!0,reviewable:s.reviewable??!0}))}let i={};for(let l of n)for(let s of l.triggers)(i[a=s.kind]??(i[a]=[])).push(l);return{list:n,byTrigger:i}}function Vd(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??It.variant,size:e?.size??It.size,label:e?.label??It.label,icon:e?.icon??It.icon,hidden:e?.hidden??It.hidden,callout:t}}function Tr(e,t,n,o){let i=At(t,e.availableLocales,e.defaultLocale);if(i===e.locale&&n===e.themeMode&&o===e.textSize)return e;let a={...e};return i!==e.locale&&(a.locale=i,a.strings=Un(i,e.stringsOverride)),n!==e.themeMode&&(a.themeMode=n),o!==e.textSize&&(a.textSize=o),a}var Gd=["presentation","behavior","theme","launcher","header","composer","feedback","i18n","footer","features","tracking","endpoints"];function Rr(e,t){if(!t)return e;let n={...e};for(let a of Gd){let l=t[a];if(l===void 0)continue;let s=e[a];if(a==="theme"){s===void 0&&(n[a]=l);continue}a!=="i18n"&&(n[a]=_a(l,s))}t.modules!==void 0&&e.modules===void 0&&(n.modules=t.modules),t.dataApiBaseUrl!==void 0&&e.dataApiBaseUrl===void 0&&(n.dataApiBaseUrl=t.dataApiBaseUrl);let o=e.i18n,i=t.i18n;if(o||i){let a=_a(i??{},o);i?.availableLocales!==void 0&&(a.availableLocales=i.availableLocales),i?.defaultLocale!==void 0&&(a.defaultLocale=i.defaultLocale);let l=o?.strings,s=i?.strings;(l||s)&&(a.strings=Kd(s,l)),n.i18n=a}return n}function _a(e,t){if(!t)return e;let n={...e};for(let[o,i]of Object.entries(t))i!==void 0&&(n[o]=i);return n}function Kd(e,t){if(!e)return t;if(!t)return e;let n=Wn(e),o=Wn(t);if(!n&&!o)return{...e,...t};let i={},a=n?e:{en:e},l=o?t:{en:t};for(let[s,c]of Object.entries(a))i[s]={...c};for(let[s,c]of Object.entries(l))i[s]={...i[s],...c};return i}var jd=["clear","expand","fullscreen","sound","history","language","theme","textSize","close"],ft=e=>e!=="false",pa=e=>e.split(",").map(t=>t.trim()).filter(Boolean),ma=[["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]],fa=[["mode","mode",e=>e],["position","position",e=>e],["iframe","iframe",ft]],ga=[["width","width"],["height","height"]],ha=[["response-mode","responseMode",e=>e],["start-minimized","startMinimized",ft],["show-reasoning","showReasoning",ft],["show-tool-calls","showToolCalls",ft],["show-sources","showSources",ft]],va=[["locale","locale"]],Yd=new Set(jd),Xd=e=>pa(e).filter(t=>Yd.has(t)),ba=[["launcher-variant","variant",e=>e],["launcher-size","size",e=>e],["launcher-icon","icon"],["launcher-hidden","hidden",ft]],xa=[["features-files","files",ft],["features-voice","voice",e=>e],["features-tools","tools",pa]],Pa=[["endpoint-upload","upload"],["endpoint-transcribe","transcribe"]],ya=[["user-id","id"],["user-email","email"],["user-name","name"]],Sa=[["page-area","area"],["page-url","url"],["page-path","path"],["page-title","title"]],Jd=["launcher-label","callout-text","callout-delay","actions-main","actions-overflow","user-context","page-context"],Qd=[ma,fa,ga,ha,va,ba,xa,Pa,ya,Sa],Zd=new Set(["iframe","start-minimized"]),Ir=[...Qd.flatMap(e=>e.map(([t])=>t).filter(t=>!Zd.has(t))),...Jd];function Xn(e){let t={},n=f=>{let p=e(f);return p===null||p===""?void 0:p};for(let[f,p,y]of ma){let v=n(f);v!==void 0&&(t[p]=y?y(v):v)}let o=mt(n,fa),i=mt(n,ga);(o||i)&&(t.presentation={...o,...i?{size:i}:{}});let a=mt(n,ha);a&&(t.behavior=a);let l=mt(n,va);l&&(t.i18n=l);let s=t_(e,n);s&&(t.launcher=s);let c=mt(n,xa);c&&(t.features=c);let d=mt(n,Pa);d&&(t.endpoints=d);let u=ua(n,ya,"user-context");u&&(t.userContext=u);let _=ua(n,Sa,"page-context");_&&(t.pageContext=_);let g=n("actions");return g!==void 0&&(t.header={actions:Xd(g)}),t}function Ar(e){return e?Xn(t=>e[e_(t)]??null):{}}function e_(e){return e.replaceAll(/-([a-z])/g,(t,n)=>n.toUpperCase())}function mt(e,t){let n={};for(let[o,i,a]of t){let l=e(o);l!==void 0&&(n[i]=a?a(l):l)}return Object.keys(n).length>0?n:null}function ua(e,t,n){let o={};for(let[s,c]of t){let d=e(s);d!==void 0&&(o[c]=d)}let i={},a=e(n);if(a)try{let s=JSON.parse(a);s&&typeof s=="object"&&!Array.isArray(s)&&(i=s)}catch{}let l={...i,...o};return Object.keys(l).length>0?l:null}function t_(e,t){let n=mt(t,ba)??{},o=e("launcher-label");o!==null&&(n.label=o);let i=t("callout-text");if(i){let a=Number.parseInt(t("callout-delay")??"",10);n.callout={text:i,...Number.isFinite(a)?{delayMs:a}:{}}}return Object.keys(n).length>0?n:null}var oo,J,Ta,Dr,it,wa,Ra,Ia,Lr,Qn,cn,Aa,$r,Mr,Nr,n_,eo={},to=[],o_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ro=Array.isArray;function Ye(e,t){for(var n in t)e[n]=t[n];return e}function Hr(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function io(e,t,n){var o,i,a,l={};for(a in t)a=="key"?o=t[a]:a=="ref"?i=t[a]:l[a]=t[a];if(arguments.length>2&&(l.children=arguments.length>3?oo.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)l[a]===void 0&&(l[a]=e.defaultProps[a]);return Zn(e,l,o,i,null)}function Zn(e,t,n,o,i){var a={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Ta,__i:-1,__u:0};return i==null&&J.vnode!=null&&J.vnode(a),a}function oe(e){return e.children}function at(e,t){this.props=e,this.context=t}function Lt(e,t){if(t==null)return e.__?Lt(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"?Lt(e):null}function r_(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],i=[],a=Ye({},t);a.__v=t.__v+1,J.vnode&&J.vnode(a),Br(e.__P,a,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??Lt(t),!!(32&t.__u),i),a.__v=t.__v,a.__.__k[a.__i]=a,Oa(o,a,i),t.__e=t.__=null,a.__e!=n&&La(a)}}function La(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),La(e)}function ka(e){(!e.__d&&(e.__d=!0)&&it.push(e)&&!no.__r++||wa!=J.debounceRendering)&&((wa=J.debounceRendering)||Ra)(no)}function no(){try{for(var e,t=1;it.length;)it.length>t&&it.sort(Ia),e=it.shift(),t=it.length,r_(e)}finally{it.length=no.__r=0}}function Ma(e,t,n,o,i,a,l,s,c,d,u){var _,g,f,p,y,v,b,w=o&&o.__k||to,x=t.length;for(c=i_(n,t,w,c,x),_=0;_<x;_++)(f=n.__k[_])!=null&&(g=f.__i!=-1&&w[f.__i]||eo,f.__i=_,v=Br(e,f,g,i,a,l,s,c,d,u),p=f.__e,f.ref&&g.ref!=f.ref&&(g.ref&&Fr(g.ref,null,f),u.push(f.ref,f.__c||p,f)),y==null&&p!=null&&(y=p),(b=!!(4&f.__u))||g.__k===f.__k?(c=Na(f,c,e,b),b&&g.__e&&(g.__e=null)):typeof f.type=="function"&&v!==void 0?c=v:p&&(c=p.nextSibling),f.__u&=-7);return n.__e=y,c}function i_(e,t,n,o,i){var a,l,s,c,d,u=n.length,_=u,g=0;for(e.__k=new Array(i),a=0;a<i;a++)(l=t[a])!=null&&typeof l!="boolean"&&typeof l!="function"?(typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?l=e.__k[a]=Zn(null,l,null,null,null):ro(l)?l=e.__k[a]=Zn(oe,{children:l},null,null,null):l.constructor===void 0&&l.__b>0?l=e.__k[a]=Zn(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[a]=l,c=a+g,l.__=e,l.__b=e.__b+1,s=null,(d=l.__i=a_(l,n,c,_))!=-1&&(_--,(s=n[d])&&(s.__u|=2)),s==null||s.__v==null?(d==-1&&(i>u?g--:i<u&&g++),typeof l.type!="function"&&(l.__u|=4)):d!=c&&(d==c-1?g--:d==c+1?g++:(d>c?g--:g++,l.__u|=4))):e.__k[a]=null;if(_)for(a=0;a<u;a++)(s=n[a])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=Lt(s)),$a(s,s));return o}function Na(e,t,n,o){var i,a;if(typeof e.type=="function"){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=Na(i[a],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=Lt(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 i,a,l,s=e.key,c=e.type,d=t[n],u=d!=null&&(2&d.__u)==0;if(d===null&&s==null||u&&s==d.key&&c==d.type)return n;if(o>(u?1:0)){for(i=n-1,a=n+1;i>=0||a<t.length;)if((d=t[l=i>=0?i--:a++])!=null&&(2&d.__u)==0&&s==d.key&&c==d.type)return l}return-1}function Ca(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||o_.test(t)?n:n+"px"}function Jn(e,t,n,o,i){var a,l;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||Ca(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Ca(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")a=t!=(t=t.replace(Aa,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?o?n[cn]=o[cn]:(n[cn]=$r,e.addEventListener(t,a?Nr:Mr,a)):e.removeEventListener(t,a?Nr:Mr,a);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Ea(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[Qn]==null)t[Qn]=$r++;else if(t[Qn]<n[cn])return;return n(J.event?J.event(t):t)}}}function Br(e,t,n,o,i,a,l,s,c,d){var u,_,g,f,p,y,v,b,w,x,E,V,se,O,Z,B=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(u=J.__b)&&u(t);e:if(typeof B=="function")try{if(b=t.props,w=B.prototype&&B.prototype.render,x=(u=B.contextType)&&o[u.__c],E=u?x?x.props.value:u.__:o,n.__c?v=(_=t.__c=n.__c).__=_.__E:(w?t.__c=_=new B(b,E):(t.__c=_=new at(b,E),_.constructor=B,_.render=l_),x&&x.sub(_),_.state||(_.state={}),_.__n=o,g=_.__d=!0,_.__h=[],_._sb=[]),w&&_.__s==null&&(_.__s=_.state),w&&B.getDerivedStateFromProps!=null&&(_.__s==_.state&&(_.__s=Ye({},_.__s)),Ye(_.__s,B.getDerivedStateFromProps(b,_.__s))),f=_.props,p=_.state,_.__v=t,g)w&&B.getDerivedStateFromProps==null&&_.componentWillMount!=null&&_.componentWillMount(),w&&_.componentDidMount!=null&&_.__h.push(_.componentDidMount);else{if(w&&B.getDerivedStateFromProps==null&&b!==f&&_.componentWillReceiveProps!=null&&_.componentWillReceiveProps(b,E),t.__v==n.__v||!_.__e&&_.shouldComponentUpdate!=null&&_.shouldComponentUpdate(b,_.__s,E)===!1){t.__v!=n.__v&&(_.props=b,_.state=_.__s,_.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(j){j&&(j.__=t)}),to.push.apply(_.__h,_._sb),_._sb=[],_.__h.length&&l.push(_);break e}_.componentWillUpdate!=null&&_.componentWillUpdate(b,_.__s,E),w&&_.componentDidUpdate!=null&&_.__h.push(function(){_.componentDidUpdate(f,p,y)})}if(_.context=E,_.props=b,_.__P=e,_.__e=!1,V=J.__r,se=0,w)_.state=_.__s,_.__d=!1,V&&V(t),u=_.render(_.props,_.state,_.context),to.push.apply(_.__h,_._sb),_._sb=[];else do _.__d=!1,V&&V(t),u=_.render(_.props,_.state,_.context),_.state=_.__s;while(_.__d&&++se<25);_.state=_.__s,_.getChildContext!=null&&(o=Ye(Ye({},o),_.getChildContext())),w&&!g&&_.getSnapshotBeforeUpdate!=null&&(y=_.getSnapshotBeforeUpdate(f,p)),O=u!=null&&u.type===oe&&u.key==null?Da(u.props.children):u,s=Ma(e,ro(O)?O:[O],t,n,o,i,a,l,s,c,d),_.base=t.__e,t.__u&=-161,_.__h.length&&l.push(_),v&&(_.__E=_.__=null)}catch(j){if(t.__v=null,c||a!=null)if(j.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__e=s}else{for(Z=a.length;Z--;)Hr(a[Z]);Or(t)}else t.__e=n.__e,t.__k=n.__k,j.then||Or(t);J.__e(j,t,n)}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=s_(n.__e,t,n,o,i,a,l,c,d);return(u=J.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 Oa(e,t,n){for(var o=0;o<n.length;o++)Fr(n[o],n[++o],n[++o]);J.__c&&J.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(a){a.call(i)})}catch(a){J.__e(a,i.__v)}})}function Da(e){return typeof e!="object"||e==null||e.__b>0?e:ro(e)?e.map(Da):e.constructor!==void 0?null:Ye({},e)}function s_(e,t,n,o,i,a,l,s,c){var d,u,_,g,f,p,y,v=n.props||eo,b=t.props,w=t.type;if(w=="svg"?i="http://www.w3.org/2000/svg":w=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),a!=null){for(d=0;d<a.length;d++)if((f=a[d])&&"setAttribute"in f==!!w&&(w?f.localName==w:f.nodeType==3)){e=f,a[d]=null;break}}if(e==null){if(w==null)return document.createTextNode(b);e=document.createElementNS(i,w,b.is&&b),s&&(J.__m&&J.__m(t,a),s=!1),a=null}if(w==null)v===b||s&&e.data==b||(e.data=b);else{if(a=w=="textarea"&&b.defaultValue!=null?null:a&&oo.call(e.childNodes),!s&&a!=null)for(v={},d=0;d<e.attributes.length;d++)v[(f=e.attributes[d]).name]=f.value;for(d in v)f=v[d],d=="dangerouslySetInnerHTML"?_=f:d=="children"||d in b||d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b||Jn(e,d,null,f,i);for(d in b)f=b[d],d=="children"?g=f:d=="dangerouslySetInnerHTML"?u=f:d=="value"?p=f:d=="checked"?y=f:s&&typeof f!="function"||v[d]===f||Jn(e,d,f,v[d],i);if(u)s||_&&(u.__html==_.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(_&&(e.innerHTML=""),Ma(t.type=="template"?e.content:e,ro(g)?g:[g],t,n,o,w=="foreignObject"?"http://www.w3.org/1999/xhtml":i,a,l,a?a[0]:n.__k&&Lt(n,0),s,c),a!=null)for(d=a.length;d--;)Hr(a[d]);s&&w!="textarea"||(d="value",w=="progress"&&p==null?e.removeAttribute("value"):p!=null&&(p!==e[d]||w=="progress"&&!p||w=="option"&&p!=v[d])&&Jn(e,d,p,v[d],i),d="checked",y!=null&&y!=e[d]&&Jn(e,d,y,v[d],i))}return e}function Fr(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(i){J.__e(i,n)}}function $a(e,t,n){var o,i;if(J.unmount&&J.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||Fr(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(a){J.__e(a,t)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&$a(o[i],t,n||typeof e.type!="function");n||Hr(e.__e),e.__c=e.__=e.__e=void 0}function l_(e,t,n){return this.constructor(e,n)}function Mt(e,t,n){var o,i,a,l;t==document&&(t=document.documentElement),J.__&&J.__(e,t),i=(o=typeof n=="function")?null:n&&n.__k||t.__k,a=[],l=[],Br(t,e=(!o&&n||t).__k=io(oe,null,[e]),i||eo,eo,t.namespaceURI,!o&&n?[n]:i?null:t.firstChild?oo.call(t.childNodes):null,a,!o&&n?n:i?i.__e:t.firstChild,o,l),Oa(a,e,l)}oo=to.slice,J={__e:function(e,t,n,o){for(var i,a,l;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),l=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,o||{}),l=i.__d),l)return i.__E=i}catch(s){e=s}throw e}},Ta=0,Dr=function(e){return e!=null&&e.constructor===void 0},at.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Ye({},this.state),typeof e=="function"&&(e=e(Ye({},n),this.props)),e&&Ye(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ka(this))},at.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ka(this))},at.prototype.render=oe,it=[],Ra=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ia=function(e,t){return e.__v.__b-t.__v.__b},no.__r=0,Lr=Math.random().toString(8),Qn="__d"+Lr,cn="__a"+Lr,Aa=/(PointerCapture)$|Capture$/i,$r=0,Mr=Ea(!1),Nr=Ea(!0),n_=0;var Nt="0.51.2";function Ha(e){return`${P.cssPrefix}:${e}`}function dn(e,t,n){e.dispatchEvent(new CustomEvent(Ha(t),{detail:n}))}function Ba(e,t){let o=Object.entries(t).map(([i,a])=>{let l=Ha(i),s=c=>a(c.detail);return e.addEventListener(l,s),[l,s]});return()=>{for(let[i,a]of o)e.removeEventListener(i,a)}}function He(){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,c_(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 c_(e){if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"){crypto.getRandomValues(e);return}for(let t=0;t<e.length;t++)e[t]=Math.floor(Math.random()*256)}var gt=F.scope("persistence");function st(e,t=Vn,n){let o=n?`${e}.${n}`:e,i=`${P.cssPrefix}.storageVersion`,a=t.get(i)??void 0,l=a?`.v${a}`:"",s=`${P.cssPrefix}.${o}${l}`,c=`${P.cssPrefix}${l}.visitorId`,d=`${s}.conversationId`,u=`${s}.userPrefs`,_=`${s}.panelOpen`,g=`${s}.panelSize`,f=`${s}.calloutDismissed`,p=`${s}.sidebarCollapsed`,y=`${s}.activeModule`,v=`${s}.historyCount`,b=`${s}.formsDone`,w={getVisitorId(){let x=t.get(c);if(x)return x;let E=He();return t.set(c,E),E},setVisitorId(x){gt.debug("setVisitorId (rebind)",{id:x,scope:o}),t.set(c,x)},loadConversationId(){return t.get(d)??void 0},saveConversationId(x){gt.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 E=JSON.parse(x);return Fa(E)?E:{}}catch(E){return gt.warn("loadUserPrefs parse failed",{error:E}),{}}},saveUserPrefs(x){try{t.set(u,JSON.stringify(x))}catch(E){gt.warn("saveUserPrefs serialise failed",{error:E})}},patchUserPrefs(x){let E=w.loadUserPrefs();w.saveUserPrefs({...E,...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 E=t.get(f);return!!E&&E===x},saveCalloutDismissed(x){x?t.set(f,x):t.remove(f)},loadSidebarCollapsed(){let x=t.get(p);return x==="1"?!0:x==="0"?!1:null},saveSidebarCollapsed(x){t.set(p,x?"1":"0")},loadActiveModule(){return t.get(y)||null},saveActiveModule(x){t.set(y,x)},loadHistoryCount(){let x=t.get(v);if(!x)return null;let E=Number.parseInt(x,10);return Number.isFinite(E)&&E>=0?E:null},saveHistoryCount(x){t.set(v,String(x))},loadFormsDone(){let x=t.get(b);if(!x)return{};try{let E=JSON.parse(x);return Fa(E)?E:{}}catch(E){return gt.warn("loadFormsDone parse failed",{error:E}),{}}},saveFormDone(x){try{let E=w.loadFormsDone();E[x]=Date.now(),t.set(b,JSON.stringify(E))}catch(E){gt.warn("saveFormDone serialise failed",{error:E})}},rememberStorageVersion(x){x&&x!==t.get(i)&&(gt.debug("rememberStorageVersion (force-reset on next load)",{version:x}),t.set(i,x))},clearConversation(){t.remove(d)}};return w}function Fa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var za=`: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
2
|
`;var Ua=`*,*: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 Wa=`.__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{position:sticky;top:var(--__P__-space-2);z-index:2;display:flex;justify-content:center;align-items:flex-start;height:0;margin:0;pointer-events:none}.__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);opacity:0;pointer-events:none;transition:opacity var(--__P__-dur-base) var(--__P__-ease)}.__P__-list[data-scrolling=true] .__P__-date-pill{opacity:1;pointer-events:auto}@media(prefers-reduced-motion:reduce){.__P__-date-pill{transition:none}}.__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}@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__-module-cta{padding:var(--__P__-space-3);border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-4px;left:calc(50% + 6px);min-width:16px;height:16px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:var(--__P__-accent);color:var(--__P__-on-accent);font-size: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-at{color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);flex-shrink:0}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size: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)}.__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);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-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-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.4;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)}.__P__-toolui-note{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}: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}
|
|
3
|
+
`;var Wa=`.__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{position:sticky;top:var(--__P__-space-2);z-index:2;display:flex;justify-content:center;align-items:flex-start;height:0;margin:0;pointer-events:none}.__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);opacity:0;pointer-events:none;transition:opacity var(--__P__-dur-base) var(--__P__-ease)}.__P__-list[data-scrolling=true] .__P__-date-pill{opacity:1;pointer-events:auto}@media(prefers-reduced-motion:reduce){.__P__-date-pill{transition:none}}.__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}@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__-module-cta{padding:var(--__P__-space-3);border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-4px;left:calc(50% + 6px);min-width:16px;height:16px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:var(--__P__-accent);color:var(--__P__-on-accent);font-size: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-at{color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);flex-shrink:0}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size: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)}.__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);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-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.4;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)}.__P__-toolui-note{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}: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
4
|
`;var Va=`.__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}
|
|
5
5
|
`;var qa=`: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
6
|
`;var f_="helpai",g_="#5B5BD6",h_="#FFFFFF",v_="12px",b_="Inter, system-ui, -apple-system, 'Segoe UI', sans-serif",zr=[za,Ua,Wa,Va,qa].join(`
|
|
@@ -36,5 +36,5 @@ ${i}`:i;continue}o.startsWith("id:")&&(n=o.slice(3).trim())}if(!t||t==="[DONE]")
|
|
|
36
36
|
`?"":n,e.pending="");continue;case"_":case"*":{if(e.token===19||e.token===30||e.token===31||e.token===14)break;let i=12,a=14,l=e.pending[0];if(l==="_"&&(i=13,a=15),e.pending.length===1){if(l===n){e.pending=o;continue}if(n!==" "&&n!==`
|
|
37
37
|
`){ee(e),te(e,i),e.pending=n;continue}}else{if(l===n){ee(e),te(e,a),te(e,i),e.pending="";continue}if(n!==" "&&n!==`
|
|
38
38
|
`){ee(e),te(e,a),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
|
-
`){ee(e),te(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(tp(n.charCodeAt(0)))break;ee(e),te(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){ee(e),te(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){ee(e),te(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}ee(e)}function _i(e){return{add_token:np,end_token:op,add_text:rp,set_attr:ip,data:{nodes:[e,,,,,],index:0}}}function np(e,t){let n=e.nodes[e.index],o;switch(t){case 1:return;case 20:o=document.createElement("blockquote");break;case 2:o=document.createElement("p");break;case 21:o=document.createElement("br");break;case 22:o=document.createElement("hr");break;case 3:o=document.createElement("h1");break;case 4:o=document.createElement("h2");break;case 5:o=document.createElement("h3");break;case 6:o=document.createElement("h4");break;case 7:o=document.createElement("h5");break;case 8:o=document.createElement("h6");break;case 12:case 13:o=document.createElement("em");break;case 14:case 15:o=document.createElement("strong");break;case 16:o=document.createElement("s");break;case 11:o=document.createElement("code");break;case 18:case 17:o=document.createElement("a");break;case 19:o=document.createElement("img");break;case 23:o=document.createElement("ul");break;case 24:o=document.createElement("ol");break;case 25:o=document.createElement("li");break;case 26:let i=o=document.createElement("input");i.type="checkbox",i.disabled=!0;break;case 9:case 10:n=n.appendChild(document.createElement("pre")),o=document.createElement("code");break;case 27:o=document.createElement("table");break;case 28:switch(n.children.length){case 0:n=n.appendChild(document.createElement("thead"));break;case 1:n=n.appendChild(document.createElement("tbody"));break;default:n=n.children[1]}o=document.createElement("tr");break;case 29:o=document.createElement(n.parentElement?.tagName==="THEAD"?"th":"td");break;case 30:o=document.createElement("equation-block");break;case 31:o=document.createElement("equation-inline");break}e.nodes[++e.index]=n.appendChild(o)}function op(e){e.index-=1}function rp(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function ip(e,t,n){e.nodes[e.index].setAttribute(Xu(t),n)}function Bo({textSig:e,doneSig:t}){let n=N(null);return vt(()=>{let o=n.current;if(!o)return;o.classList.add(`${P.cssPrefix}-md`);let i=_i(o),a=di(i),l=0,s=Je(()=>{let u=e.value,_=t.value;u.length<l&&(o.replaceChildren(),i=_i(o),a=di(i),l=0);let g=u.slice(l);g&&we(a,g),l=u.length,_&&ql(a)}),c=new MutationObserver(u=>{for(let _ of u)for(let g of _.addedNodes){if(!(g instanceof HTMLElement))continue;let f=g.matches?.("a")?[g]:[...g.querySelectorAll?.("a")??[]];for(let p of f)Gl(p)}});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 Kl({text:e}){let t=Te(()=>H(e),[e]),n=Te(()=>H(!0),[]);return r(Bo,{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 qt=P.cssPrefix;function jl({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?r("a",{class:`${qt}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":S.source,children:[r("span",{class:`${qt}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),r("span",{class:`${qt}-source-label`,children:n})]}):r("span",{class:`${qt}-source`,"data-testid":S.source,children:[r("span",{class:`${qt}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),r("span",{class:`${qt}-source-label`,children:n})]})}var et=P.cssPrefix;function Fo(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function zo(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 sp(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 lp({status:e}){return e==="denied"||e==="error"?r(yl,{}):e==="completed"||e==="responded"?r(Pl,{}):r(xl,{})}function cp(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;default:return t.statusRunning}}function dp({state:e,approval:t,strings:n}){let o=sp(e,t);return r("span",{class:`${et}-toolui-badge ${et}-toolui-status`,"data-status":o,children:[r("span",{class:`${et}-toolui-status-icon`,children:r(lp,{status:o})}),cp(o,n)]})}function Uo({name:e,state:t,approval:n,strings:o}){return r(oe,{children:[r("span",{class:`${et}-toolui-wrench`,children:r(bl,{})}),r("strong",{class:`${et}-toolui-title`,children:e}),r(dp,{state:t,approval:n,strings:o}),r("span",{class:`${et}-toolui-chevron`,children:r(Eo,{})})]})}function ct({label:e,value:t,error:n}){let o=n?String(t??""):Wo(ui(t));return o?r("div",{class:`${et}-toolui-section`,children:[r("span",{class:`${et}-toolui-label`,children:e}),r("pre",{class:`${et}-toolui-code`,"data-error":n?"true":void 0,children:o})]}):null}function ui(e){if(e&&typeof e=="object"){let t=e;if(t.storage==="tool-result-ref"&&"summary"in t)return t.summary}return e}function Wo(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 ke=P.cssPrefix;function Yl({part:e,strings:t,active:n,onDecision:o,onEdit:i}){let a=Y(()=>e.approvalSig.value),l=Y(()=>e.stateSig.value),s=Y(()=>e.inputSig.value),c=Y(()=>e.outputSig.value),d=Y(()=>e.errorSig.value),u=Fo(e.toolName),_=a.value?.approved,{terminal:g,responded:f,decided:p}=zo(l.value,a.value),y=f&&n&&!g,v=e.toolCallId;return r("div",{class:`${ke}-toolui-group`,"data-testid":p?S.toolDecision:S.toolApproval,children:[r("details",{class:`${ke}-toolui ${ke}-toolui-collapsible`,children:[r("summary",{class:`${ke}-toolui-head`,children:r(Uo,{name:u,state:l.value,approval:a.value,strings:t})}),r(ct,{label:t.toolParameters,value:s.value}),c.value!==void 0?r(ct,{label:t.toolResult,value:c.value}):null,d.value?r(ct,{label:t.statusError,value:d.value,error:!0}):null]}),r("div",{class:`${ke}-toolui ${ke}-toolui-body`,children:[r("p",{class:`${ke}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",u)}),r("p",{class:`${ke}-toolui-subtle`,children:t.approvalBody}),f?r("p",{class:`${ke}-toolui-subtle`,children:[t.approvalYourResponse.replace("{decision}",_?t.approve:t.reject),a.value?.reason?` \u2014 ${a.value.reason}`:""]}):null,y?r("p",{class:`${ke}-toolui-subtle`,children:t.approvalEditHint}):null,f&&!y&&!g?r("p",{class:`${ke}-toolui-subtle`,children:t.approvalSubmitting}):null,!p&&!n?r("p",{class:`${ke}-toolui-subtle`,children:t.stepNoLongerActive}):null,!p&&n?r("div",{class:`${ke}-toolui-actions`,children:[r("button",{type:"button",class:`${ke}-form-skip`,onClick:()=>o(v,!1),"data-testid":S.toolReject,children:t.reject}),r("button",{type:"button",class:`${ke}-form-submit`,onClick:()=>o(v,!0),"data-testid":S.toolApprove,children:t.approve})]}):y?r("div",{class:`${ke}-toolui-actions`,children:r("button",{type:"button",class:`${ke}-form-skip`,onClick:()=>i(v),"data-testid":S.toolEdit,children:t.edit})}):null]})]})}function Jl(e){let t=e&&typeof e=="object"?e:{},n=t.responseType;return{title:kn(t.title),question:kn(t.question)??"Please provide the missing information.",description:kn(t.description),placeholder:kn(t.placeholder),responseType:n==="single-choice"||n==="multi-choice"||n==="confirmation"||n==="free-text"?n:"free-text",choices:Array.isArray(t.choices)?t.choices:void 0,allowOther:typeof t.allowOther=="boolean"?t.allowOther:void 0,required:typeof t.required=="boolean"?t.required:!0,defaultValues:Array.isArray(t.defaultValues)?t.defaultValues.filter(o=>typeof o=="string"):void 0,minSelections:Xl(t.minSelections),maxSelections:Xl(t.maxSelections),validationHint:kn(t.validationHint)}}function Ql(e){if(e.responseType==="confirmation")return[];let t=(e.choices??[]).map(_p).filter(i=>i!==null),n="textarea";e.responseType==="single-choice"&&t.length>0?n="radio":e.responseType==="multi-choice"&&(n="multiselect");let o=n==="multiselect"?e.defaultValues?.join(", "):e.defaultValues?.[0];return[{name:"answer",label:e.question,type:n,placeholder:e.placeholder,required:e.required??!0,defaultValue:o,options:t.length>0?t:void 0,allowOther:e.allowOther,validationHint:e.validationHint,validation:n==="multiselect"?{minSelections:e.minSelections,maxSelections:e.maxSelections}:void 0}]}function _p(e){return typeof e=="string"?e?{value:e,label:e}:null:e&&typeof e.value=="string"&&e.value?{value:e.value,label:e.label??e.value,description:e.description}:null}function kn(e){return typeof e=="string"&&e.trim()?e.trim():void 0}function Xl(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}var re=P.cssPrefix;function up(e,t){switch(e.responseType){case"single-choice":return t.respSingleChoice;case"multi-choice":return t.respMultiChoice;case"confirmation":return t.respConfirmation;default:return t.respFreeText}}function Zl({part:e,strings:t,active:n,onSubmit:o,onDecision:i,onEdit:a}){let l=Y(()=>e.stateSig.value),s=Y(()=>e.approvalSig.value),c=Y(()=>Jl(e.inputSig.value)),{terminal:d,responded:u,decided:_}=zo(l.value,s.value),g=s.value!==void 0,f=(v,b)=>{g?i(e.toolCallId,b,v):c.value.responseType==="confirmation"?o(e.toolCallId,{confirmed:b}):o(e.toolCallId,b?{answer:v}:{})},p=c.value;if(_)return r(fp,{part:e,strings:t,req:p,editable:u&&n&&!d,onEdit:()=>a(e.toolCallId)});let y=!n;return r("div",{class:`${re}-toolui${y?` ${re}-toolui-stale`:""}`,"data-testid":S.toolAskInput,children:[r("div",{class:`${re}-toolui-head`,children:[r("span",{class:`${re}-toolui-badge ${re}-toolui-badge-accent`,children:t.inputRequired}),r("span",{class:`${re}-toolui-badge`,children:up(p,t)})]}),p.description?r("div",{class:`${re}-toolui-desc`,children:p.description}):null,r(pi,{label:t.inputQuestion,text:p.question}),y?r("p",{class:`${re}-toolui-note`,children:t.stepNoLongerActive}):r(pp,{req:p,strings:t,resolve:f})]})}function pp({req:e,strings:t,resolve:n}){if(e.responseType==="confirmation")return r(mp,{req:e,strings:t,resolve:n});let o=Ql(e).map(i=>(i.label=t.inputYourAnswer,i.placeholder=i.placeholder??t.inputAnswerPlaceholder,i));return r($o,{fields:o,strings:t,submitLabel:t.inputSubmit,footerHint:t.inputSubmitHint,onSubmit:i=>n(i.answer??Object.values(i).join(", "),!0),skipLabel:t.inputSkip,onSkip:()=>n(void 0,!1),submitOnEnter:!0,submitTestId:S.toolInputSubmit,skipTestId:S.toolInputSkip})}function mp({req:e,strings:t,resolve:n}){let[o,i]=I(""),a=e.allowOther??!0,l=()=>n(o.trim()||void 0,!0),s=()=>n(void 0,!1),c=d=>{d.key!=="Enter"||d.shiftKey||d.isComposing||(d.preventDefault(),l())};return r(oe,{children:[a?r("label",{class:`${re}-field`,children:[r("span",{class:`${re}-field-label`,children:t.inputOptionalNote}),r("textarea",{class:`${re}-field-input`,rows:2,value:o,placeholder:e.placeholder??t.inputOptionalNotePlaceholder,onInput:d=>i(d.target.value),onKeyDown:c,"data-testid":`${S.formField}-note`})]}):null,r("div",{class:`${re}-form-actions`,children:[r("span",{class:`${re}-form-hint`,children:t.inputConfirmHint}),r("button",{type:"button",class:`${re}-form-skip`,onClick:s,"data-testid":S.toolInputSkip,children:t.confirmNo}),r("button",{type:"button",class:`${re}-form-submit`,onClick:l,"data-testid":S.toolInputSubmit,children:t.confirmYes})]})]})}function pi({label:e,text:t}){return r("div",{class:`${re}-toolui-section`,children:[r("span",{class:`${re}-toolui-label`,children:e}),r("p",{class:`${re}-toolui-text`,children:t})]})}function fp({part:e,strings:t,req:n,editable:o,onEdit:i}){let a=Y(()=>e.outputSig.value),l=Y(()=>e.approvalSig.value),s=l.value?.approved===!1,c=l.value?.approved!==void 0?l.value.reason??"":gp(a.value,t);return r("div",{class:`${re}-toolui`,"data-testid":S.toolDecision,children:[r("div",{class:`${re}-toolui-head`,children:[r("span",{class:`${re}-toolui-badge ${re}-toolui-badge-accent`,children:t.inputBadge}),r("span",{class:`${re}-toolui-badge`,children:s?t.inputSkipped:t.inputAnswered})]}),n.description?r("div",{class:`${re}-toolui-desc`,children:n.description}):null,r(pi,{label:t.inputQuestion,text:n.question}),!s&&c?r(pi,{label:t.inputResponse,text:c}):null,o?r("div",{class:`${re}-toolui-actions`,children:r("button",{type:"button",class:`${re}-form-skip`,onClick:i,"data-testid":S.toolEdit,children:t.edit})}):null]})}function gp(e,t){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="object"){let n=e;return"confirmed"in n?n.confirmed?t.confirmYes:t.confirmNo:typeof n.responseText=="string"&&n.responseText?n.responseText:Object.values(n).filter(o=>typeof o=="string"||typeof o=="number").join(", ")}return String(e)}var mi=P.cssPrefix;function ec({part:e,strings:t}){let n=Y(()=>e.inputSig.value),o=Y(()=>e.outputSig.value),i=Y(()=>e.errorSig.value),a=Y(()=>e.stateSig.value),l=Y(()=>e.approvalSig.value);return Y(()=>!!Wo(n.value)||!!i.value||!!Wo(ui(o.value))).value?r("details",{class:`${mi}-toolui ${mi}-toolui-collapsible`,"data-testid":S.toolCall,children:[r("summary",{class:`${mi}-toolui-head`,children:r(Uo,{name:Fo(e.toolName),state:a.value,approval:l.value,strings:t})}),r(ct,{label:t.toolParameters,value:n.value}),o.value!==void 0?r(ct,{label:t.toolResult,value:o.value}):null,i.value?r(ct,{label:t.statusError,value:i.value,error:!0}):null]}):null}var Me=P.cssPrefix;function tc({message:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:i,showSources:a,interactive:l=!1,tool:s,onRetry:c}){let u=Y(()=>e.partsSig.value).value,_=Y(()=>Qe(e)),g=Y(()=>Hs(e)),f=Y(()=>e.partsSig.value.some(E=>E.kind==="text"&&E.textSig.value.length>0)),p=Y(()=>o&&e.partsSig.value.some(E=>E.kind==="reasoning")),y=e.role==="assistant"&&e.status==="streaming",v=n==="buffered"&&y,b=y&&!f.value,w=y&&!v&&!(p.value&&b);if(g.value)return null;let x=hp(e.createdAt);return r("div",{class:`${Me}-bubble-row`,"data-role":e.role,"data-testid":Pe(S.messageBubble,e.id),children:r("div",{class:`${Me}-bubble-col`,children:[r("div",{class:`${Me}-bubble`,children:[v?r(Sp,{label:t.loading}):u.map(E=>r(vp,{part:E,active:b,strings:t,showReasoning:o,showToolCalls:i,showSources:a,interactive:l,tool:s},Pp(E))),w&&r(yp,{}),e.status==="error"&&e.errorText||_.value?r("div",{class:`${Me}-error`,role:"alert",children:[r("span",{children:e.errorText??t.errorGeneric}),c?r("button",{type:"button",class:`${Me}-error-retry`,onClick:c,"data-testid":S.messageRetry,children:t.errorRetry}):null]}):null]}),x?r("time",{class:`${Me}-bubble-time`,dateTime:x.iso,title:x.full,children:x.short}):null]})})}function hp(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 vp({part:e,active:t,strings:n,showReasoning:o,showToolCalls:i,showSources:a,interactive:l,tool:s}){switch(e.kind){case"step-start":return null;case"text":return r(Bo,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return o?r(xp,{part:e,active:t,strings:n}):null;case"tool":return r(bp,{part:e,strings:n,showToolCalls:i,interactive:l,tool:s});case"file":return e.mediaType.startsWith("image/")?r("img",{src:e.url,alt:"",loading:"lazy"}):r("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",children:e.url});case"source":return a?r(jl,{part:e,strings:n}):null}}function bp({part:e,strings:t,showToolCalls:n,interactive:o,tool:i}){let a=Y(()=>e.approvalSig.value!==void 0);if(i?.humanInLoop){if(Bl(e.toolName))return r(Zl,{part:e,strings:t,active:o,onSubmit:i.onResult,onDecision:i.onDecision,onEdit:i.onEdit});if(a.value)return r(Yl,{part:e,strings:t,active:o,onDecision:i.onDecision,onEdit:i.onEdit})}return n?r(ec,{part:e,strings:t}):null}function xp({part:e,active:t,strings:n}){return r("details",{class:`${Me}-reasoning`,open:t,"data-active":t?"true":void 0,children:[r("summary",{class:`${Me}-reasoning-summary`,children:r("span",{class:`${Me}-reasoning-label`,children:t?n.thinking:n.thoughts})}),r("div",{class:`${Me}-reasoning-body`,children:r(Bo,{textSig:e.textSig,doneSig:e.doneSig})})]})}function Pp(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 yp(){return r("span",{class:`${Me}-typing`,"aria-hidden":"true",children:[r("span",{}),r("span",{}),r("span",{})]})}function Sp({label:e}){return r("span",{class:`${Me}-loading`,role:"status",children:[r("span",{class:`${Me}-loading-spinner`,"aria-hidden":"true"}),r("span",{class:`${Me}-loading-label`,children:e})]})}var Gt=P.cssPrefix,fi=120,wp=350,kp=1200;function nc({messagesSig:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:i,showSources:a,loading:l,idle:s,tool:c,onRetry:d,form:u,formMarkers:_,onFillForm:g}){let f=N(null),p=Y(()=>e.value),[y,v]=I(!1),[b,w]=I(!1),x=N(!1),E=N(!1),V=N(!1),se=N(0),O=()=>V.current||performance.now()-se.current<wp,Z=N(0),B=k=>{Z.current=performance.now(),k.scrollTop=k.scrollHeight},j=p.value[0]?.id;vt(()=>{let k=f.current;if(!k||p.value.length===0||(x.current=!0,!p.value.some(nt=>nt.role==="user")))return;let K=()=>B(k);K();let ve=new ResizeObserver(K);ve.observe(k);let Ae=new MutationObserver(K);Ae.observe(k,{childList:!0,subtree:!0,characterData:!0});let Ce=setTimeout(()=>{ve.disconnect(),Ae.disconnect()},300);return()=>{ve.disconnect(),Ae.disconnect(),clearTimeout(Ce)}},[j]);let X=N(0);R(()=>{let k=f.current,K=p.value,ve=X.current;if(X.current=K.length,!k||!x.current)return;if(K.slice(ve).some(Ce=>Ce.role==="user")){E.current=!1,B(k);return}if(!K.some(Ce=>Ce.role==="user")||E.current||O())return;k.scrollHeight-k.scrollTop-k.clientHeight<fi&&B(k)},[p.value.length]),R(()=>{let k=f.current;if(!k)return;let K=p.value.at(-1);if(!K||K.status!=="streaming"&&!p.value.some(Ce=>Ce.role==="user"))return;let ve=()=>{if(E.current||O())return;k.scrollHeight-k.scrollTop-k.clientHeight<fi*2&&B(k)};if(K.status!=="streaming"){let Ce=requestAnimationFrame(ve);return()=>cancelAnimationFrame(Ce)}ve();let Ae=new MutationObserver(ve);return Ae.observe(k,{childList:!0,subtree:!0,characterData:!0}),()=>Ae.disconnect()},[p.value]);let he=u?.form.id;vt(()=>{let k=f.current;!k||!he||E.current||p.value.some(K=>K.role==="user")&&B(k)},[he]),R(()=>{let k=f.current;if(!k)return;let K=()=>v(k.scrollHeight-k.scrollTop-k.clientHeight>fi*2),ve,Ae=()=>{K(),performance.now()-Z.current>150&&(E.current=k.scrollHeight-k.scrollTop-k.clientHeight>8),w(!0),clearTimeout(ve),ve=setTimeout(()=>w(!1),kp)},Ce=()=>{E.current=!0},nt=ye=>{ye.deltaY<0&&Ce()},jt=0,Ct=ye=>{jt=ye.touches[0]?.clientY??0,V.current=!0},Yt=ye=>{(ye.touches[0]?.clientY??0)>jt+4&&Ce()},Ue=()=>{V.current=!1,se.current=performance.now()},Et=()=>{V.current=!0};return k.addEventListener("scroll",Ae,{passive:!0}),k.addEventListener("wheel",nt,{passive:!0}),k.addEventListener("touchstart",Ct,{passive:!0}),k.addEventListener("touchmove",Yt,{passive:!0}),k.addEventListener("touchend",Ue,{passive:!0}),k.addEventListener("touchcancel",Ue,{passive:!0}),k.addEventListener("pointerdown",Et,{passive:!0}),window.addEventListener("pointerup",Ue,{passive:!0}),window.addEventListener("pointercancel",Ue,{passive:!0}),K(),()=>{k.removeEventListener("scroll",Ae),k.removeEventListener("wheel",nt),k.removeEventListener("touchstart",Ct),k.removeEventListener("touchmove",Yt),k.removeEventListener("touchend",Ue),k.removeEventListener("touchcancel",Ue),k.removeEventListener("pointerdown",Et),window.removeEventListener("pointerup",Ue),window.removeEventListener("pointercancel",Ue),clearTimeout(ve)}},[]);let C=()=>{let k=f.current;k&&(E.current=!1,B(k))},q=[],ne="",fe=p.value.at(-1)?.id,le=[..._??[]].toSorted((k,K)=>(k.createdAt??1/0)-(K.createdAt??1/0)),Ne=k=>r(Hl,{marker:k,strings:t,onFill:!u&&g?()=>g(k.formId):void 0},k.key),_e=k=>{for(let K=le[0];K?.createdAt!==void 0&&!(k!==void 0&&K.createdAt>k);K=le[0])le.shift(),q.push(Ne(K))};for(let k of p.value){if(k.role==="assistant"&&k.id!==fe&&Qe(k))continue;_e(k.createdAt);let K=Cp(k.createdAt);K&&K!==ne&&(q.push(r("div",{class:`${Gt}-date-divider`,children:r("span",{class:`${Gt}-date-pill`,title:Ep(k.createdAt),children:Tp(k.createdAt,t)})},`day:${K}`)),ne=K),q.push(r(tc,{message:k,strings:t,responseMode:n,showReasoning:o,showToolCalls:i,showSources:a,interactive:!!s&&k.id===fe,tool:c,onRetry:s&&k.id===fe?d:void 0},k.id))}for(let k of le)q.push(Ne(k));return r("div",{class:`${Gt}-list-wrap`,children:[r("div",{ref:f,class:`${Gt}-list`,role:"log","aria-live":"polite","aria-relevant":"additions text","data-scrolling":b?"true":void 0,children:[l&&p.value.length===0?r("div",{class:`${Gt}-list-loading`,role:"status",children:t.conversationLoading}):null,q,u?r($l,{form:u.form,strings:t,onSubmit:u.onSubmit,onSkip:u.onSkip}):null]}),y?r("button",{type:"button",class:`${Gt}-jump`,onClick:C,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":S.scrollToBottom,children:r(Eo,{})}):null]})}function Cp(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Ep(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function Tp(e,t){let n=new Date(e),o=a=>new Date(a.getFullYear(),a.getMonth(),a.getDate()).getTime(),i=Math.round((o(new Date)-o(n))/864e5);return i<=0?t.dateToday:i===1?t.dateYesterday:i<7?n.toLocaleDateString(void 0,{weekday:"long"}):n.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}var Rp=["today","yesterday","lastWeek","older"];function Ip(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let o=Math.floor((oc(e)-oc(n))/(1440*60*1e3));return o<=0?"today":o===1?"yesterday":o<7?"lastWeek":"older"}function rc(e,t){let n=new Map;for(let o of t){let i=Ip(e,o.lastMessageAt),a=n.get(i);a?a.push(o):n.set(i,[o])}return Rp.filter(o=>n.has(o)).map(o=>({bucket:o,conversations:n.get(o)}))}function oc(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var Ap=F.scope("history"),Lp=3,Mp=6,Np={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function Op(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 Vo({transport:e,strings:t,locale:n,persistence:o,visitorId:i,onSelect:a,onNewConversation:l}){let s=P.cssPrefix,c=e.peekConversations({visitorId:i}),[d,u]=I(c?"loaded":"loading"),[_,g]=I(c?.conversations??[]);R(()=>{let v=!1;return e.listConversations({visitorId:i}).then(b=>{if(v)return;let w=b.conversations??[];g(w),u("loaded"),o.saveHistoryCount(w.length)}).catch(b=>{v||(Ap.warn("listConversations failed",{err:b}),u("error"))}),()=>{v=!0}},[e,i,o]);let f=l?r("div",{class:`${s}-history-footer`,children:r("button",{type:"button",class:`${s}-history-new`,onClick:l,"data-testid":S.sidebarNewConversation,children:[r(Gs,{}),t.newConversation]})}):null;if(d==="loading"){let v=Math.min(o.loadHistoryCount()??Lp,Mp);return r(oe,{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,w)=>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`})})})]})]},w))})]})}),f]})}if(d==="error"||_.length===0)return r(oe,{children:[r("div",{class:`${s}-history-empty`,children:t.historyEmpty}),f]});let p=Date.now(),y=rc(p,_);return r(oe,{children:[r("div",{class:`${s}-history`,role:"list",children:y.map(v=>r("div",{class:`${s}-history-group`,children:[r("div",{class:`${s}-history-heading`,children:t[Np[v.bucket]]}),r("div",{class:`${s}-history-card`,children:v.conversations.map(b=>r("button",{type:"button",role:"listitem",class:`${s}-history-item`,onClick:()=>a(b),"data-closed":b.canContinue?void 0:"true","data-unread":(b.unreadCount??0)>0?"true":void 0,"data-testid":Pe(S.historyItem,b.conversationId),children:[r("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:r(Qr,{})}),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:Op(b.lastMessageAt,p,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 ic=P.cssPrefix;function ac({suggestions:e,onPick:t}){return e.length===0?null:r("div",{class:`${ic}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((n,o)=>r("button",{type:"button",class:`${ic}-suggestion`,onClick:()=>t(n),"data-testid":Pe(S.suggestion,o),children:n.label},n.id))})}var Ie=P.cssPrefix;function sc(e){let{options:t,onClose:n}=e,o=t.strings,i=N(null);R(()=>{let c=i.current;if(!c)return;let d=Lo(c),u=_=>{_.key==="Escape"&&n?.()};return c.addEventListener("keydown",u),()=>{d(),c.removeEventListener("keydown",u)}},[n]);let a=N(null),l=D(c=>{a.current?.attachFromDrop(c)},[]),{visible:s}=Oo({containerRef:i,onDrop:l});return Io(i.current,t.mode==="modal"),r("div",{ref:i,class:`${Ie}-panel`,role:"dialog","aria-modal":"false","aria-label":o.panelTitle,style:{position:"relative"},"data-testid":S.panel,children:[r(gi,{...e,containerEl:i.current,dragOver:s,composerAttachApiRef:a}),r(hi,{poweredBy:e.options.poweredBy})]})}function gi(e){let{options:t,transport:n,feedback:o,bus:i,persistence:a,panelSize:l,view:s,canSend:c,isStreaming:d,loadingMessages:u,messagesSig:_,agent:g,suggestions:f,initialWidgetSize:p,visitorId:y,onClose:v,onBack:b,onClear:w,onToggleHistory:x,onSelectHistoryConversation:E,onNewConversation:V,onWidgetSizeChange:se,onSend:O,onStop:Z,onSuggestion:B,activeForm:j,formMarkers:X,onFormSubmit:he,onFormSkip:C,onFormFill:q,tool:ne,onRetry:fe,containerEl:le,dragOver:Ne,composerAttachApiRef:_e}=e,k=t.strings,K;return j?K=null:c?K=r(oe,{children:[r(ac,{suggestions:f,onPick:B}),r(Al,{options:t,transport:n,feedback:o,bus:i,isStreaming:d,onSend:O,onStop:Z,attachApiRef:_e})]}):K=r($p,{label:k.conversationClosed,ctaLabel:k.startNewConversation,onNewConversation:w}),r(oe,{children:[s==="history"?r(Dp,{strings:k,onBack:x,onClose:v,showClose:Ao(t.mode,l,t.actions)}):r("header",{class:`${Ie}-header`,"data-testid":S.panelHeader,children:[b?r("button",{type:"button",class:`${Ie}-icon-btn`,onClick:b,"aria-label":k.moduleBack,title:k.moduleBack,children:r(Pn,{})}):null,g?r(Tl,{agent:g,strings:k}):r("h1",{children:k.panelTitle}),r(qe,{panelProps:e,variant:"chat"})]}),s==="history"?r(Vo,{transport:n,strings:k,locale:t.locale,persistence:a,visitorId:y,onSelect:ve=>E(ve.conversationId),onNewConversation:V}):r(oe,{children:[r(Ll,{visible:Ne,strings:k}),r(nc,{messagesSig:_,strings:k,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,loading:u,idle:!d,tool:ne,onRetry:fe,form:j?{form:j,onSubmit:he,onSkip:C}:null,formMarkers:X,onFillForm:q}),K,r(Hp,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?r(Ro,{panelEl:le,resize:t.size.resize,position:t.position,initialSize:p,onSizeChange:se,strings:k}):null]})}function Dp({strings:e,onBack:t,onClose:n,showClose:o}){return r("header",{class:`${Ie}-header`,children:[r("button",{type:"button",class:`${Ie}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:r(Pn,{})}),r("h1",{children:e.historyTitle}),o?r("button",{type:"button",class:`${Ie}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:r(Ve,{})}):null]})}function $p({label:e,ctaLabel:t,onNewConversation:n}){return r("div",{class:`${Ie}-readonly-banner`,role:"note",children:[r("span",{class:`${Ie}-readonly-label`,children:e}),r("button",{type:"button",class:`${Ie}-readonly-cta`,onClick:n,children:t})]})}function Hp({disclaimer:e}){return e?r("div",{class:`${Ie}-composer-footer`,children:r("div",{class:`${Ie}-disclaimer`,children:e})}):null}function hi({poweredBy:e}){return e?r("div",{class:`${Ie}-poweredby-bar`,children:r(Bp,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function Bp({logoUrl:e,text:t,href:n}){let o=r(oe,{children:[e?r("img",{class:`${Ie}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?r("span",{children:t}):null]});return n?r("a",{class:`${Ie}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:o}):r("span",{class:`${Ie}-poweredby`,children:o})}function lc(e){let t=N(e);t.current=e;let n=N(null);return n.current??(n.current=Fp(t)),n.current}function Fp(e){let t=H(null),n=new Set,o=c=>`${e.current.conversationId()??""}:${c}`,i=c=>c.frequency==="always"?!1:c.frequency==="conversation"?n.has(o(c.id)):c.id in e.current.persistence.loadFormsDone(),a=(c,d)=>{if(t.value)return;let u=e.current;if(c==="manual"){let _=u.forms.list.find(g=>g.id===d);_&&(t.value={form:_,trigger:"manual"});return}for(let _ of u.forms.byTrigger[c]??[]){let g=_.triggers.find(f=>f.kind===c);if(!(!g||!zp(g,u)||i(_)||!Up(_,u))){t.value={form:_,trigger:c};return}}},l=(c,d)=>{let u=t.value;if(!u)return;t.value=null;let{form:_,trigger:g}=u;_.frequency==="conversation"?n.add(o(_.id)):_.frequency!=="always"&&e.current.persistence.saveFormDone(_.id),e.current.onComplete(_,g,c,d)};return{activeForm:t,fire:a,refresh:()=>{let c=t.value;if(!c)return;let d=e.current.forms.list.find(u=>u.id===c.form.id);d&&d!==c.form&&(t.value={form:d,trigger:c.trigger})},complete:c=>l(c,!1),skip:()=>l({},!0)}}function zp(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function Up(e,t){let n=e.when;if(!n)return!0;if(n.missingContext?.length){let i=t.userContext()??{};if(n.missingContext.some(a=>i[a]!==void 0&&i[a]!==""))return!1}if(n.pageArea&&!(Array.isArray(n.pageArea)?n.pageArea:[n.pageArea]).includes(t.pageArea()??""))return!1;let o=t.messageCount();return!(n.minMessages!=null&&o<n.minMessages||n.maxMessages!=null&&o>n.maxMessages)}function cc(e){let t=P.cssPrefix,{site:n,blocks:o,strings:i,collapsed:a}=e,l=o?.navigation??[],s=o?.linkCards??[],c=a?i.expandSidebar:i.collapseSidebar;return r("aside",{class:`${t}-sidebar`,"data-collapsed":a?"true":"false","data-testid":S.sidebar,children:[r("div",{class:`${t}-sidebar-header`,children:[r(Wp,{site:n}),r("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":a?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":S.sidebarToggle,children:r(Vp,{collapsed:a})})]}),a?null:r(oe,{children:[l.length>0?r("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:r(qp,{items:l})}):null,s.length>0?r("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:r(Gp,{items:s})}):null,e.showConversations?r("div",{class:`${t}-sidebar-conversations`,children:r(Vo,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function Wp({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 Vp({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 qp({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 Gp({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 dc=P.cssPrefix;function _c(e){return r("main",{class:`${dc}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[r(cc,{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:`${dc}-page-chat`,"aria-label":"Chat",children:e.children})]})}var uc=e=>Object.fromEntries(e.map(t=>[t,[]]));function pc(e,t,n){let o=H({activeTab:e,stacks:uc(t)});return{sig:o,switchTab(i){o.value.activeTab!==i&&(o.value={...o.value,activeTab:i},n?.(i))},push(i){let a=o.value,l=a.stacks[a.activeTab]??[];o.value={...a,stacks:{...a.stacks,[a.activeTab]:[...l,i]}}},pop(){let i=o.value,a=i.stacks[i.activeTab]??[];a.length!==0&&(o.value={...i,stacks:{...i.stacks,[i.activeTab]:a.slice(0,-1)}})},reset(i){o.value={activeTab:i,stacks:uc(t)}}}}var mc=e=>e.stacks[e.activeTab]??[],fc=e=>mc(e).at(-1),gc=e=>mc(e).length===0;var hc={Icon:yn};var dt=P.cssPrefix;function qo({title:e,actions:t}){return r("header",{class:`${dt}-back-header`,"data-variant":"title",children:[r("span",{class:`${dt}-back-spacer`,"aria-hidden":"true"}),r("h1",{class:`${dt}-back-title`,children:e}),t??r("span",{class:`${dt}-back-spacer`,"aria-hidden":"true"})]})}function Go({title:e,backLabel:t,onBack:n,actions:o,testid:i}){return r("header",{class:`${dt}-back-header`,"data-testid":i,children:[r("button",{type:"button",class:`${dt}-icon-btn`,onClick:n,"aria-label":t,title:t,children:r(Pn,{})}),r("h1",{class:`${dt}-back-title`,children:e}),o??r("span",{class:`${dt}-back-spacer`,"aria-hidden":"true"})]})}var Kt=P.cssPrefix;function vc({placeholder:e,onActivate:t}){return r("button",{type:"button",class:`${Kt}-home-search`,onClick:t,"data-testid":S.homeSearch,children:[r("span",{class:`${Kt}-home-search-text`,children:e}),r("span",{class:`${Kt}-home-search-icon`,"aria-hidden":"true",children:r(ei,{})})]})}function bc({placeholder:e,value:t,onInput:n}){return r("div",{class:`${Kt}-home-search`,"data-input":"true",children:[r("input",{type:"search",class:`${Kt}-home-search-input`,placeholder:e,value:t,onInput:o=>n(o.currentTarget.value),"data-testid":S.helpSearch}),r("span",{class:`${Kt}-home-search-icon`,"aria-hidden":"true",children:r(ei,{})})]})}var Cn=P.cssPrefix;function Ko({title:e,subtitle:t,onClick:n,testid:o}){return r("button",{type:"button",class:`${Cn}-list-row`,onClick:n,"data-testid":o,children:[r("span",{class:`${Cn}-list-row-body`,children:[r("span",{class:`${Cn}-list-row-title`,children:e}),t?r("span",{class:`${Cn}-list-row-sub`,children:t}):null]}),r("span",{class:`${Cn}-list-row-chevron`,"aria-hidden":"true",children:r(Ut,{})})]})}var xc=P.cssPrefix;function ze({tone:e="info",message:t,onRetry:n,strings:o}){return r("div",{class:`${xc}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[r("span",{children:t}),n?r("button",{type:"button",class:`${xc}-module-retry`,onClick:n,children:o.errorRetry}):null]})}var kt=P.cssPrefix,Kp=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 Yp(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 Pc(e,t){let n=t.toLowerCase(),o=n.indexOf(e);if(o!==-1)return 100-Math.min(o,99);let i=0;for(let a of e){if(i=n.indexOf(a,i),i===-1)return 0;i+=1}return 1}function Xp(e,t){let n=t.toLowerCase().trim();return n?e.map(o=>({item:o,score:Math.max(Pc(n,o.title)*2,Pc(n,o.description??""))})).filter(o=>o.score>0).toSorted((o,i)=>i.score-o.score).map(o=>o.item):[]}function yc({article:e,nav:t}){return r(Ko,{title:e.title,subtitle:e.description,onClick:()=>jp(t,e),testid:Pe(S.helpArticle,e.id)})}function Jp({transport:e,strings:t,config:n,nav:o,bus:i,panelProps:a}){let l=n.contentTags,[s,c]=I("loading"),[d,u]=I(t.errorGeneric),[_,g]=I([]),[f,p]=I(""),[y,v]=I(0);R(()=>{let x=!1;return c("loading"),e.listContent({tags:l,sortBy:"order",limit:100}).then(E=>{if(x)return;let V=E.items??[];g(V),c("loaded"),i.emit("contentView",{section:"help",tags:l?.join(","),count:V.length})}).catch(E=>{x||(Kp.warn("listContent (help) failed",{err:E}),u(Pt(E,t)),c("error"))}),()=>{x=!0}},[e,l,y,i]);let b=Te(()=>Xp(_,f),[_,f]);R(()=>{let x=f.trim();if(!x)return;let E=setTimeout(()=>i.emit("contentSearch",{queryLength:x.length,hitCount:b.length}),600);return()=>clearTimeout(E)},[f,b,i]);function w(){return f.trim().length>0?b.length===0?r(ze,{message:t.helpSearchEmpty,strings:t}):r("div",{class:`${kt}-help-card`,children:b.map(x=>r(yc,{article:x,nav:o},x.id))}):s==="loading"?r(ze,{message:t.helpLoading,strings:t}):s==="error"?r(ze,{tone:"error",message:d,onRetry:()=>v(x=>x+1),strings:t}):_.length===0?r(ze,{message:t.helpEmpty,strings:t}):Yp(_).map(([x,E])=>r("section",{class:`${kt}-help-group`,children:[x?r("h2",{class:`${kt}-help-section-title`,children:x}):null,r("div",{class:`${kt}-help-card`,children:E.map(V=>r(yc,{article:V,nav:o},V.id))})]},x))}return r("div",{class:`${kt}-module`,children:[r(qo,{title:t.helpTitle,actions:r(qe,{panelProps:a,variant:"plain"})}),r("div",{class:`${kt}-module-pad`,children:r(bc,{placeholder:t.helpSearchPlaceholder,value:f,onInput:p})}),r("div",{class:`${kt}-help-list`,children:w()})]})}var Sc={Icon:Zr,Root:e=>r(Jp,{...e})};var wc=P.cssPrefix;function vi({onClick:e,children:t,testid:n}){return e?r("button",{type:"button",class:`${wc}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):r("div",{class:`${wc}-home-card`,"data-testid":n,children:t})}var ae=P.cssPrefix,kc=F.scope("home");function Qp(e){let t=e.options.userContext?.name,n=e.config.greetingText?Ee(e.strings,e.config.greetingText):void 0;return n?{title:t?n.replace("{name}",t):n.replace(/\s*\{name\}\s*/," ").trim(),subtitle:e.strings.homeGreetingLead}:t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}var Zp=(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 em(e){let{transport:t,strings:n,config:o,nav:i,bus:a,panelProps:l}=e,[s,c]=I(null),[d,u]=I([]),_=o.contentTags?.join(",");R(()=>{if(!o.showRecentConversations)return;let b=!1;return t.listConversations({limit:1}).then(w=>!b&&c(w.conversations?.[0]??null)).catch(w=>!b&&kc.warn("listConversations (home) failed",{err:w})),()=>{b=!0}},[t,o.showRecentConversations]),R(()=>{if(!o.contentTags?.length)return;let b=!1;return t.listContent({tags:o.contentTags,limit:6}).then(w=>{if(b)return;let x=w.items??[];u(x),a.emit("contentView",{section:"home",tags:_,count:x.length})}).catch(w=>!b&&kc.warn("listContent (home) failed",{err:w})),()=>{b=!0}},[t,_,a]);let g=Qp(e),f=o.userAvatars??[],p=o.status,y=p?.text?Ee(n,p.text):n.homeStatus,v=o.contentBlockTitle?Ee(n,o.contentBlockTitle):n.homeContentTitle;return r("div",{class:`${ae}-module ${ae}-home`,"data-testid":S.homeView,children:r("div",{class:`${ae}-home-scroll`,children:[r("div",{class:`${ae}-home-hero`,children:[r("div",{class:`${ae}-home-hero-top`,children:[o.brandName?r("span",{class:`${ae}-home-brand`,"data-testid":S.homeBrand,children:o.brandName}):r("span",{class:`${ae}-home-brand-spacer`,"aria-hidden":"true"}),r("div",{class:`${ae}-home-hero-actions`,children:[f.length>0?r("div",{class:`${ae}-home-avatars`,children:f.map(b=>r("span",{class:`${ae}-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:Mo(b.name)})},b.name))}):null,r(qe,{panelProps:l,variant:"plain"})]})]}),o.showGreeting!==!1?r(oe,{children:[r("h1",{class:`${ae}-home-greeting`,"data-testid":S.homeGreeting,children:g.title}),g.subtitle?r("p",{class:`${ae}-home-lead`,children:g.subtitle}):null]}):null]}),r("div",{class:`${ae}-home-cards`,children:[o.showSearchBar!==!1?r(vc,{placeholder:n.homeSearchPlaceholder,onActivate:()=>i.switchToLayout("help")}):null,s?r(vi,{onClick:()=>i.selectConversation(s.conversationId),testid:S.homeRecent,children:r("div",{class:`${ae}-home-recent-row`,"data-unread":(s.unreadCount??0)>0?"true":void 0,children:[r("span",{class:`${ae}-home-recent-avatar`,"aria-hidden":"true",children:r(yn,{})}),r("span",{class:`${ae}-home-recent-body`,children:[r("span",{class:`${ae}-home-recent-title`,children:s.title}),s.preview?r("span",{class:`${ae}-home-recent-preview`,children:s.preview}):null]}),(s.unreadCount??0)>0?r("span",{class:`${ae}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,p?r(vi,{onClick:p.url?()=>i.push({kind:"iframe",url:p.url,title:y}):void 0,children:r("div",{class:`${ae}-home-status`,"data-level":p.level??"operational",children:[r("span",{class:`${ae}-home-status-icon`,"aria-hidden":"true",children:r(pl,{})}),r("span",{class:`${ae}-home-status-text`,children:y})]})}):null,d.length>0?r("section",{class:`${ae}-home-content`,children:[r("div",{class:`${ae}-home-content-title`,children:v}),r("div",{class:`${ae}-home-content-list`,children:d.map(b=>r(Ko,{title:b.title,subtitle:b.description,onClick:()=>Zp(i,b),testid:Pe(S.homeContentRow,b.id)},b.id))})]}):null]})]})})}var Cc={Icon:ml,Root:e=>r(em,{...e})};var _t=P.cssPrefix,tm=F.scope("news");function nm({transport:e,strings:t,config:n,nav:o,bus:i,panelProps:a}){let l=n.contentTags,[s,c]=I("loading"),[d,u]=I(t.errorGeneric),[_,g]=I([]),[f,p]=I(0);R(()=>{let v=!1;return c("loading"),e.listContent({tags:l,sortBy:"publishedAt",sortOrder:"desc"}).then(b=>{if(v)return;let w=b.items??[];g(w),c("loaded"),i.emit("contentView",{section:"news",tags:l?.join(","),count:w.length})}).catch(b=>{v||(tm.warn("listContent (news) failed",{err:b}),u(Pt(b,t)),c("error"))}),()=>{v=!0}},[e,l,f,i]);function y(){return s==="loading"?r(ze,{message:t.newsLoading,strings:t}):s==="error"?r(ze,{tone:"error",message:d,onRetry:()=>p(v=>v+1),strings:t}):_.length===0?r(ze,{message:t.newsEmpty,strings:t}):r("div",{class:`${_t}-news-list`,children:_.map(v=>r("button",{type:"button",class:`${_t}-news-card`,onClick:()=>o.push({kind:"content",id:v.id,title:v.title}),"data-testid":Pe(S.newsItem,v.id),children:[v.image?r("img",{class:`${_t}-news-hero`,src:v.image,alt:"",loading:"lazy"}):null,r("span",{class:`${_t}-news-body`,children:[r("span",{class:`${_t}-news-title`,children:v.title}),v.description?r("span",{class:`${_t}-news-summary`,children:v.description}):null]})]},v.id))})}return r("div",{class:`${_t}-module`,children:[r(qo,{title:t.newsTitle,actions:r(qe,{panelProps:a,variant:"plain"})}),r("div",{class:`${_t}-module-scroll`,children:y()})]})}var Ec={Icon:fl,Root:e=>r(nm,{...e})};var jo={chat:hc,home:Cc,help:Sc,news:Ec};var En=P.cssPrefix;function Tc({modules:e,activeTab:t,strings:n,unreadCount:o,onSelect:i}){return r("nav",{class:`${En}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(a=>{let l=jo[a.layout].Icon,s=a.id===t,c=a.layout==="chat"&&o>0?o>9?"9+":String(o):null;return r("button",{type:"button",role:"tab","aria-selected":s,class:`${En}-tab`,onClick:()=>i(a.id),"data-testid":Pe(S.tab,a.id),children:[r("span",{class:`${En}-tab-icon`,"aria-hidden":"true",children:[r(l,{}),c?r("span",{class:`${En}-tab-badge`,"data-testid":S.tabBadge,children:c}):null]}),r("span",{class:`${En}-tab-label`,children:Ee(n,a.label)})]},a.id)})})}var Rc=P.cssPrefix,om="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function Ic({url:e,title:t,strings:n,onBack:o,actions:i}){return r("div",{class:`${Rc}-module`,children:[r(Go,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:o,actions:i}),r("iframe",{class:`${Rc}-content-frame`,src:e,title:t||"content",sandbox:om,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var Tn=P.cssPrefix,rm=F.scope("content"),im=5e3;function Ac({id:e,title:t,transport:n,strings:o,bus:i,onBack:a,actions:l}){let[s,c]=I(null),[d,u]=I(!1),[_,g]=I(0),f=D(()=>{u(!1),c(null),g(v=>v+1)},[]);R(()=>{let v=!1;return n.listContent({ids:[e],limit:1}).then(b=>{if(v)return;let w=b.items[0];w?(c(w),i.emit("contentOpen",{contentId:e,tags:w.tags?.length?w.tags.join(","):void 0})):u(!0)}).catch(b=>{v||(rm.warn("listContent (reader) failed",{err:b}),u(!0))}),()=>{v=!0}},[n,e,_,i]),R(()=>{if(!s)return;let v=setTimeout(()=>i.emit("contentRead",{contentId:e}),im);return()=>clearTimeout(v)},[s,e,i]);let p=D(v=>{let w=v.target?.closest?.("a")?.getAttribute("href")??"";w&&!w.startsWith("#")&&i.emit("contentLinkClick",{contentId:e})},[i,e]);function y(){return d?r(ze,{tone:"error",message:o.errorGeneric,onRetry:f,strings:o}):s===null?r(ze,{message:o.contentLoading,strings:o}):r("article",{class:`${Tn}-content`,"data-testid":S.contentView,onClick:p,children:[s.image?r("img",{class:`${Tn}-content-hero`,src:s.image,alt:"",loading:"lazy"}):null,s.description?r("p",{class:`${Tn}-content-subtitle`,children:s.description}):null,r(Kl,{text:s.content??""})]})}return r("div",{class:`${Tn}-module`,children:[r(Go,{title:s?.title||t||o.moduleBack,backLabel:o.moduleBack,onBack:a,actions:l,testid:S.backHeader}),r("div",{class:`${Tn}-module-scroll`,"data-testid":S.contentScroll,children:y()})]})}var Yo=P.cssPrefix;function Lc({panelProps:e,enabledModules:t,nav:n,bus:o,unreadCount:i,onSelectConversation:a,onStartNewConversation:l,onSetPanelSize:s}){let c=e.options,d=c.strings,u=N(null),_=N(new Set);R(()=>{let X=u.current;if(!X)return;let he=Lo(X),C=q=>{q.key==="Escape"&&e.onClose?.()};return X.addEventListener("keydown",C),()=>{he(),X.removeEventListener("keydown",C)}},[e.onClose]);let g=N(null),f=D(X=>{g.current?.attachFromDrop(X)},[]),{visible:p}=Oo({containerRef:u,onDrop:f});Io(u.current,c.mode==="modal");let y=Y(()=>n.sig.value).value,v=fc(y),b=c.modules.byId[y.activeTab],w=v?.kind==="iframe"||v?.kind==="content",x=t.length>1&&(gc(y)||!w),E=N(null);R(()=>{if(w&&E.current===null)E.current=e.panelSize,e.panelSize==="normal"&&s("expanded");else if(!w&&E.current!==null){let X=E.current;E.current=null,s(X)}},[w]);let V={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:X=>{let he=t.find(C=>C.layout===X);he&&n.switchTab(he.id)},selectConversation:a,startNewConversation:l},se=X=>({options:c,transport:e.transport,strings:d,config:X,visitorId:e.visitorId,nav:V,bus:o,panelProps:e}),O=r(qe,{panelProps:e,variant:"plain"});b&&_.current.add(b.id);let Z=t.filter(X=>_.current.has(X.id)),B=X=>{if(X.layout==="chat")return r(gi,{...e,containerEl:u.current,dragOver:p,composerAttachApiRef:g});let he=jo[X.layout].Root;return he?r(he,{...se(X)}):null},j=()=>v?.kind==="iframe"?r(Ic,{url:v.url,title:v.title,strings:d,onBack:n.pop,actions:O}):v?.kind==="content"?r(Ac,{id:v.id,title:v.title,transport:e.transport,strings:d,bus:o,onBack:n.pop,actions:O}):null;return r("div",{ref:u,class:`${Yo}-panel ${Yo}-messenger`,role:"dialog","aria-modal":"false","aria-label":d.panelTitle,style:{position:"relative"},"data-testid":S.messengerHome,children:[r("div",{class:`${Yo}-messenger-body`,children:[Z.map(X=>r("div",{class:`${Yo}-messenger-pane`,hidden:w||X.id!==b?.id,children:B(X)},X.id)),j()]}),x?r(Tc,{modules:t,activeTab:y.activeTab,strings:d,unreadCount:i,onSelect:n.switchTab}):null,r(hi,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(b?.layout==="chat"&&!v)?r(Ro,{panelEl:u.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:d}):null]})}var Rn=P.cssPrefix;function Mc({strings:e,onClose:t}){return r("div",{class:`${Rn}-panel ${Rn}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":S.modulesEmpty,children:[t?r("button",{type:"button",class:`${Rn}-icon-btn ${Rn}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:r(Ve,{})}):null,r("p",{class:`${Rn}-modules-empty-text`,children:e.modulesEmpty})]})}function Nc({callout:e,persistence:t}){let n=e?.text??"",o=e?.persistent??!0,[i,a]=I(()=>o?!1:t.loadCalloutDismissed(n));R(()=>{a(o?!1:t.loadCalloutDismissed(n))},[n,o,t]);let l=D(()=>{a(!0),o||t.saveCalloutDismissed(n)},[t,n,o]);return{dismissed:i,dismissCallout:l}}var W=F.scope("app"),Xo=P.cssPrefix;function Oc(e,t){return Ds({...e,text:Ee(t,e.text)})}function am(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 Dc(e){return e instanceof DOMException?e.name==="AbortError":e?.name==="AbortError"}function $c({options:e,hostElement:t,bus:n}){let[o]=I(()=>st(e.widgetId,e.storage,e.aiAgentDeploymentId)),[i,a]=I(()=>o.getVisitorId()),l=o.loadUserPrefs(),[s,c]=I(()=>l.locale??e.locale),[d,u]=I(()=>l.themeMode??e.themeMode),[_,g]=I(()=>l.textSize??e.textSize),f=fn(o.loadConversationId()),p=fn([]),y=fn(0),[v,b]=I(!1),[w,x]=I([]);function E(){let m=e.modules.list,h=new Set(m.map(M=>M.id)),T=o.loadActiveModule();return T&&h.has(T)?T:m[0]?.id??""}function V(){return e.modules.list.find(m=>m.layout==="chat")?.id}let se=N();if(!se.current){let m=e.modules.list.map(h=>h.id);se.current=pc(E(),m,h=>o.saveActiveModule(h))}let O=se.current,Z=N(void 0);Z.current=V();let[B,j]=I(!1),[X,he]=I(null),[C,q]=I(!1),ne=e.mode==="standalone"||e.mode==="inline",fe=N(gn(e,zt(),o.loadPanelOpen(),o.loadPanelSize())),[le,Ne]=I(fe.current.panelOpen),[_e,k]=I(fe.current.panelOpen),K=N(_e);K.current=_e;let ve=N(!1),Ae=N(void 0);R(()=>{le&&k(!0)},[le]);let Ce=N(!1),[nt,jt]=I(!1),{dismissed:Ct,dismissCallout:Yt}=Nc({callout:e.launcher.callout,persistence:o}),Ue=e.launcher.callout?.persistent??!0,Et=D(()=>{W.info("calloutDismiss"),n.emit("calloutDismiss",void 0),Yt()},[n,Yt]),[ye,ut]=I(fe.current.panelSize),Ii=N(!1),[Gc,tr]=I("chat"),[Xt,Jt]=I(!0),[Se,In]=I(!1),[Kc,Ai]=I(null),[nr,An]=I([]),[Li,Ln]=I(null),[Mn,Nn]=I(null),On=N(e.strings),[jc,Yc]=I(void 0),[Xc,Jc]=I(void 0),[Qc,Zc]=I(()=>o.loadSidebarCollapsed()??!1),[or,ed]=I({}),[G]=I(()=>new xo({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:ys({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[Re]=I(()=>new So(p)),[ie]=I(()=>new Co(e.sound,e.haptics)),We=D(m=>{o.patchUserPrefs(m),G.saveUserPrefs(o.loadUserPrefs()).catch(h=>{W.warn("saveUserPrefs failed",{err:h})})},[o,G]);R(()=>{l.soundMuted!==void 0&&ie.setMuted(l.soundMuted)},[]),R(()=>{t.dataset.theme=d},[t,d,e]),R(()=>{t.dataset.textSize=_},[t,_,e]),R(()=>{ie.update(e.sound,e.haptics)},[ie,e.sound,e.haptics]),R(()=>()=>ie.destroy(),[ie]),R(()=>{let m=!0;return ie.mutedSig.subscribe(h=>{if(m){m=!1;return}We({soundMuted:h})})},[ie,We]),R(()=>{Ii.current||!e.size.initialSize||(Ii.current=!0,!o.loadPanelSize()&&ut(Kr(e.mode,e.size,zt())))},[e.mode,e.size,o]),R(()=>{if(!B||Ce.current)return;Ce.current=!0;let m=gn(e,zt(),o.loadPanelOpen(),o.loadPanelSize());Ne(m.panelOpen),ut(m.panelSize)},[B,e,o]);let Mi=N(!1),Ni=N(!1),Qt=N(null),rr=N(null),ir=N(!1);R(()=>{if(!(!B||Mi.current)){if(Mi.current=!0,Ni.current){let m=Z.current;m&&O.switchTab(m);return}O.reset(E())}},[B]);let Dn=D(m=>{!m||m.length===0||(p.value=m.map(h=>Oc(h,On.current)))},[p]),ar=N(null),$n=D(async m=>{try{let{formSubmissions:h}=await(m?G.bootstrap(m):ar.current??G.bootstrap()),T=new Map;return h.forEach((M,z)=>T.set(M.formId,z)),h.filter((M,z)=>!M.skipped||T.get(M.formId)===z).map((M,z)=>({key:`wire:${M.formId}:${M.createdAt??z}`,formId:M.formId,outcome:M.skipped?"skipped":"submitted",createdAt:bo(M.createdAt),values:M.values}))}catch(h){return W.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:h}),[]}},[G]),Zt=N(0),en=D((m,h)=>{let T=[...m.map(A=>A.createdAt),...h.map(A=>A.createdAt)].filter(A=>A!==void 0),M=(T.length?Math.min(...T):Date.now())-1;return[...(Ae.current?.messages??[]).map(A=>{let be=Oc(A,On.current);return be.createdAt=M,be}),...m]},[]),sr=D(async m=>{let h=Zt.current,T=()=>h!==Zt.current;b(!0);try{let[M,z]=await Promise.all([G.loadConversation(m),$n()]);if(T())return;let A=(M.messages??[]).map(Jr);x(z);let be=Qt.current?[Qt.current]:[];A.length||be.length?(p.value=[...en(A,z),...be],Jt(M.canContinue??!0),An(M.suggestions??[])):p.value=en([],z),G.resumeStatus==="needs-generation"&&rr.current?.()}catch(M){if(T())return;W.warn("loadThread failed; resetting conversationId",{err:M,conversationId:m}),f.value=void 0,o.saveConversationId(void 0)}finally{T()||b(!1)}},[G,$n,p,f,o,en]),tn=D(async({newConversation:m})=>{let h=++Zt.current,T=()=>h!==Zt.current,M=f.value,z=m||!M?He():M;z!==M&&(f.value=z,o.saveConversationId(z));let A;try{A=await G.handshake({visitorId:i,conversationId:z,userPrefs:o.loadUserPrefs(),locale:s})}catch(je){if(T())return;n.emit("error",je),e.onError?.(je),m||j(!0);return}if(T())return;if(A.visitorId&&A.visitorId!==i&&(W.info("visitor rebound",{previous:i,current:A.visitorId,reason:A.rebind?.visitorId}),o.setVisitorId(A.visitorId),a(A.visitorId),n.emit("visitorRebound",{previous:i,current:A.visitorId,reason:A.rebind?.visitorId})),A.conversationId&&A.conversationId!==z&&(W.info("conversation rebound",{previous:z,current:A.conversationId,reason:A.rebind?.conversationId}),n.emit("conversationRebound",{previous:z,current:A.conversationId,reason:A.rebind?.conversationId})),A.agent&&Ai(A.agent),e.mode==="page"&&(A.site&&xs(A.site)?Yc(A.site):A.site&&W.warn("invalid site config, using fallback",{site:A.site}),A.blocks&&Ps(A.blocks)?Jc(A.blocks):A.blocks&&W.warn("invalid blocks config, using fallback",{blocks:A.blocks})),A.userPrefs&&!m&&(o.saveUserPrefs(A.userPrefs),A.userPrefs.locale&&c(A.userPrefs.locale),A.userPrefs.soundMuted!==void 0&&ie.setMuted(A.userPrefs.soundMuted),A.userPrefs.themeMode&&u(A.userPrefs.themeMode),A.userPrefs.textSize&&g(A.userPrefs.textSize)),Ae.current=A.welcome,m||n.emit("handshake",A),A.welcome?.suggestions){let je=On.current;An(A.welcome.suggestions.map($e=>({...$e,label:Ee(je,$e.label),...$e.text===void 0?{}:{text:Ee(je,$e.text)}})))}!m&&M&&A.conversationId===M?K.current?sr(M):ve.current=!0:(f.value=A.conversationId,o.saveConversationId(A.conversationId),Dn(A.welcome?.messages)),m||j(!0)},[G,i,o,e,n,f,ie,Dn,sr,s]),nn=JSON.stringify(e.userContext??null),td=JSON.stringify(e.pageContext??null),nd=JSON.stringify(or);R(()=>{let m=Object.keys(or).length?{...or,...e.userContext}:e.userContext;G.setContext(m,sm(e.pageContext))},[G,nn,td,nd]);let Oe=At(s,e.availableLocales,e.defaultLocale);R(()=>{G.setLocale(Oe)},[G,Oe]),R(()=>{t.dir=Qi(Oe)?"rtl":"ltr"},[t,Oe]),R(()=>{Oe!==s&&c(Oe)},[Oe,s]);let Hn=D(m=>{if(m.type!=="data-conversation-rebind")return!1;let h=m.data?.conversationId;if(h&&h!==f.value){let T=f.value;f.value=h,o.saveConversationId(h),G.primeIdentity(void 0,h),W.info("conversation rebound (in-stream)",{previous:T,current:h}),T&&n.emit("conversationRebound",{previous:T,current:h,reason:h})}return!0},[f,o,G,n]),Oi=D(async m=>{let h=null;try{for await(let T of m.iter)if(!Hn(T.chunk)){if(!h){h=hn(),Qt.current=h,Re.attach(h),p.value=[...p.value,h],In(!0),Ln(()=>m.cancel),Nn(()=>m.detach),Ni.current=!0;let M=Z.current;M&&O.switchTab(M),W.info("resumed in-flight reply on mount")}Re.apply(T.chunk),T.chunk.type==="finish"&&T.chunk.canContinue===!1&&Jt(!1)}h&&(h.status==="error"||Qe(h)?(h.status="error",h.errorText=e.strings.errorGeneric,ie.play("error")):(h.status="complete",ie.play("messageReceived"),bi(n,e,"assistant",Po(h))))}catch(T){h&&(Dc(T)?yo(h)?p.value=p.value.filter(M=>M!==h):h.status="complete":(h.status="error",h.errorText=Pt(T,e.strings),ie.play("error"))),W.debug("resume ended without completing",{err:T})}finally{Qt.current=null,h&&(Re.detach(),In(!1),Ln(null),Nn(null),p.value=[...p.value])}},[Re,p,ie,n,e,O,Hn]),Di=N(null),lr=D(async()=>{let m=G.resumeStream();Di.current=m,await Oi(m),G.resumeStatus==="needs-generation"&&rr.current?.()},[G,Oi]);R(()=>{let m=f.value;return m&&G.primeIdentity(i,m),tn({newConversation:!1}),()=>{Zt.current++,Di.current?.cancel()}},[]),R(()=>{_e&&(ar.current=G.bootstrap(),(async()=>{try{let m=await ar.current;he(ln((m??{forms:[]}).forms,Oe))}catch(m){W.debug("bootstrap failed \u2014 treating as no forms",{err:m})}finally{q(!0)}})(),(async()=>{let m=[];if(ve.current){ve.current=!1;let h=f.value;h&&m.push(sr(h))}f.value&&m.push(lr()),m.length!==0&&await Promise.allSettled(m)})())},[_e]);let Bn=N(null);R(()=>{if(!_e)return;if(Bn.current===null){Bn.current=Oe;return}if(Bn.current===Oe)return;Bn.current=Oe;let m=!1;return G.bootstrap().then(h=>{m||he(ln((h??{forms:[]}).forms,Oe))}).catch(h=>W.debug("forms re-localize failed \u2014 keeping current copy",{err:h})),()=>{m=!0}},[_e,Oe,G]);let $i=N(nn);R(()=>{!B||$i.current===nn||($i.current=nn,tn({newConversation:!1}))},[nn,B,tn]),vt(()=>{ao(t,vo(e.mode,ye,le))},[t,le,ye,e.mode]),R(()=>{if(e.mode!=="modal"||!le)return;let m=h=>{h.composedPath().some(z=>z instanceof HTMLElement&&z.classList.contains(`${P.cssPrefix}-panel`))||Ne(!1)};return t.addEventListener("click",m),()=>t.removeEventListener("click",m)},[t,le,e.mode]),R(()=>{if(e.mode!=="drawer"||!le)return;let m=h=>{h.key==="Escape"&&Ne(!1)};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[le,e.mode]);let ot=D(async(m,{continueExisting:h})=>{let T=f.value??He();f.value||(f.value=T,o.saveConversationId(T));let M=(h?p.value:p.value.slice(0,-1)).filter(be=>!be.ephemeral),z=Rs({messages:M.map($s),conversationId:T,tools:e.features.tools,visitorId:i,userPrefs:o.loadUserPrefs()});In(!0);let A=G.sendMessage(z);Ln(()=>A.cancel),Nn(()=>A.detach);try{for await(let $e of A.iter)Hn($e.chunk)||(Re.apply($e.chunk),$e.chunk.type==="finish"&&$e.chunk.canContinue===!1&&Jt(!1));let be=m.status==="error",je=Qe(m);if(be||je){m.status="error",m.errorText=e.strings.errorGeneric,ie.play("error");let $e=new Error(be?"stream error chunk":"empty reply");n.emit("error",$e),e.onError?.($e)}else m.status="complete",ie.play("messageReceived"),bi(n,e,"assistant",Po(m))}catch(be){Dc(be)?yo(m)?p.value=p.value.filter(je=>je!==m):m.status="complete":(m.status="error",m.errorText=Pt(be,e.strings),ie.play("error"),n.emit("error",be),e.onError?.(be))}finally{Re.detach(),In(!1),Ln(null),Nn(null),p.value=[...p.value]}},[G,Re,p,f,e,n,ie,o,i,Hn]),Hi=D(()=>{if(Se||ir.current||Qt.current||p.value.filter(T=>!T.ephemeral).at(-1)?.role!=="user")return;ir.current=!0,W.info("regenerating dangling user turn (needs-generation)");let h=hn();p.value=[...p.value,h],Re.attach(h),ot(h,{continueExisting:!1}).finally(()=>{ir.current=!1})},[Se,p,Re,ot]);R(()=>{rr.current=Hi},[Hi]);let Fn=D((m,h)=>{if(Se)return;let T=p.value.at(-1),M=T?.partsSig.value.find(z=>z.kind==="tool"&&z.toolCallId===m);if(!T||!M){W.warn("decideTool: tool part not found",{toolCallId:m});return}h(M),T.partsSig.value=[...T.partsSig.value],am(T)&&(T.status="streaming",Re.attach(T),ot(T,{continueExisting:!0}))},[Se,p,Re,ot]),Bi=D((m,h)=>{W.info("toolResult",{toolCallId:m}),n.emit("toolResult",{toolCallId:m}),Fn(m,T=>{T.outputSig.value=h,T.stateSig.value="output-available"})},[n,Fn]),Fi=D((m,h,T)=>{W.info("toolDecision",{toolCallId:m,approved:h}),n.emit("toolDecision",{toolCallId:m,approved:h}),Fn(m,M=>{let z=M.approvalSig.value?.id??m;M.approvalSig.value={id:z,approved:h,reason:T},M.stateSig.value="approval-responded"})},[n,Fn]),zi=D(m=>{if(Se)return;let h=p.value.at(-1),T=h?.partsSig.value.find(z=>z.kind==="tool"&&z.toolCallId===m);if(!h||!T)return;let M=T.approvalSig.value?.id??m;T.approvalSig.value={id:M},T.stateSig.value="approval-requested",h.partsSig.value=[...h.partsSig.value]},[Se,p]),od=Te(()=>({humanInLoop:e.features.humanInLoop,onResult:Bi,onDecision:Fi,onEdit:zi}),[e.features.humanInLoop,Bi,Fi,zi]),rd=()=>p.value.reduce((m,h)=>m+(h.role==="user"?1:0),0),Tt=e.forms.list.length>0?e.forms:X??e.forms,ue=lc({forms:Tt,persistence:o,userContext:()=>e.userContext,messageCount:rd,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>f.value,onComplete:(m,h,T,M)=>{W.info("formSubmit",{formId:m.id,trigger:h,skipped:M}),n.emit("formSubmit",{formId:m.id,values:T,skipped:M}),x(A=>[...A.filter(be=>!(be.formId===m.id&&be.outcome==="skipped")),{key:`local:${m.id}:${Date.now()}`,formId:m.id,outcome:M?"skipped":"submitted",createdAt:Date.now(),...M?{}:{values:T}}]);let z=f.value??He();f.value||(f.value=z,o.saveConversationId(z),G.primeIdentity(void 0,z)),!M&&m.mirrorToContext&&ed(A=>({...A,...T})),G.submitForm({formId:m.id,conversationId:z,trigger:h,values:T,skipped:M})}}),id=Y(()=>ue.activeForm.value);R(()=>{ue.refresh()},[Tt,ue]);let Ui=e.pageContext?.area?String(e.pageContext.area):void 0,ad=Y(()=>p.value.length);R(()=>{B&&C&&ue.fire("pre-chat")},[B,C,ue]),R(()=>{C&&!Xt&&ue.fire("conversation-closed")},[C,Xt,ue]),R(()=>{B&&C&&Ui&&ue.fire("page-area")},[B,C,Ui,ue]);let cr=Te(()=>{let m=Tt.list.flatMap(h=>h.triggers).filter(h=>h.kind==="idle").map(h=>Number(h.param));return m.length?Math.min(...m)*1e3:0},[Tt]);R(()=>{if(!cr||!le)return;let m=setTimeout(()=>ue.fire("idle"),cr);return()=>clearTimeout(m)},[cr,le,ue,ad.value]);let Wi=D(async(m,h)=>{if(W.info("send",{textLen:m.length,attachments:h.length,streaming:Se}),Se)return;n.emit("send",{text:m,attachmentCount:h.length}),nr.length>0&&An([]);let T=await cm(G,h,A=>{W.warn("upload failed",{err:A}),n.emit("error",A),e.onError?.(A)});ie.unlock(),ie.play("messageSent");let M=Os(m,T),z=hn();p.value=[...p.value,M,z],Re.attach(z),bi(n,e,"user",m),await ot(z,{continueExisting:!1}),ue.fire("after-messages")},[Se,G,n,e,nr.length,p,Re,ot,ue]),sd=D(()=>{W.info("stop"),n.emit("stop",void 0),Li?.()},[Li,n]),ld=D(()=>{if(Se)return;let m=p.value,h=m.at(-1);if(!h||h.role!=="assistant"||h.status!=="error"&&!Qe(h))return;let T=hn();p.value=[...m.slice(0,-1),T],Re.attach(T),W.info("retry"),ot(T,{continueExisting:!1})},[Se,p,Re,ot]),cd=D(()=>{ie.toggleMuted();let m=ie.mutedSig.value;W.info("soundToggle",{muted:m}),n.emit("soundToggle",{muted:m})},[ie,n]),on=D(()=>{if(El(e.mode,ye)==="exit-fullscreen"){W.info("close \u2192 exit-fullscreen",{mode:e.mode}),ut("normal"),n.emit("fullscreen",!1);return}W.info("close \u2192 panel closed",{mode:e.mode}),ue.fire("panel-close"),Ne(!1),o.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,o,ye,ue]),Rt=D(()=>{e.modules.list.some(m=>m.layout==="chat")&&G.listConversations({limit:50}).then(m=>{y.value=m.conversations.reduce((h,T)=>h+(T.unreadCount??0),0)}).catch(m=>W.debug("refreshUnread failed (non-fatal)",{err:m}))},[G,e.modules,y]),Vi=N(!1);R(()=>{!_e||!B||Vi.current||(Vi.current=!0,Rt())},[_e,B,Rt]);let dr=D(()=>{W.info("open",{mode:e.mode}),ie.unlock(),jt(!0),Ne(!0),o.savePanelOpen(!0),!Ct&&!Ue&&Et(),setTimeout(()=>jt(!1),lm),Rt(),n.emit("open",void 0),e.onOpen?.()},[n,e,ie,o,Ct,Ue,Et,Rt]),_r=D(()=>{if(!p.value.some(h=>h.role==="user")&&Xt&&f.value){W.info("clear \u2192 reusing empty conversation",{conversationId:f.value}),p.value.length===0&&Dn(Ae.current?.messages);return}W.info("clear \u2192 new conversation",{wasStreaming:Se}),n.emit("clear",void 0),Se&&Mn?.(),Ht(()=>{p.value=[],f.value=void 0}),o.clearConversation(),Jt(!0),x([]),tn({newConversation:!0})},[Se,Mn,p,f,o,tn,n,Xt,Dn]),ur=D(()=>{_r(),tr("chat");let m=e.modules.list.find(h=>h.layout==="chat")?.id;m&&O.switchTab(m)},[_r,O,e]),pr=D(()=>{let m=ye==="expanded"?"normal":"expanded";W.info("expand",{from:ye,expanded:m==="expanded"}),ut(m),o.savePanelSize(m),n.emit("expand",m==="expanded")},[n,ye,o]),mr=D(()=>{let m=ye==="fullscreen"?"normal":"fullscreen";W.info("fullscreen",{from:ye,fullscreen:m==="fullscreen"}),ut(m),o.savePanelSize(m),n.emit("fullscreen",m==="fullscreen")},[n,ye,o]),dd=D(()=>{tr(m=>{let h=m==="history"?"chat":"history";return W.info("toggleHistory",{view:h}),n.emit("toggleHistory",{view:h}),h})},[n]),_d=D(m=>{W.info("localeChange",{locale:m}),c(m),We({locale:m}),n.emit("localeChange",m)},[We,n]),ud=D(m=>{W.info("themeChange",{mode:m}),u(m),t.dataset.theme=m,We({themeMode:m}),n.emit("themeChange",m)},[t,We,n]),pd=D(m=>{W.info("textSizeChange",{size:m}),g(m),t.dataset.textSize=m,We({textSize:m}),n.emit("textSizeChange",m)},[t,We,n]),md=D(()=>{Zc(m=>{let h=!m;return W.info("sidebarToggle",{collapsed:h}),o.saveSidebarCollapsed(h),n.emit("sidebarToggle",{collapsed:h}),h})},[o,n]),fd=D(m=>{W.info("resize",m),We({widgetSize:m}),n.emit("resize",m)},[We,n]),fr=D(async m=>{W.info("selectConversation",{conversationId:m,wasStreaming:Se}),n.emit("selectConversation",{conversationId:m}),Se&&Mn?.();try{let[h,T]=await Promise.all([G.loadConversation(m),$n(m)]),M=h.messages.map(Jr);Ht(()=>{p.value=en(M,T),f.value=h.conversationId}),x(T),o.saveConversationId(h.conversationId),G.primeIdentity(i,h.conversationId),h.agent&&Ai(h.agent),Jt(h.canContinue),An(h.suggestions??[]),tr("chat"),lr(),await G.markRead(m),Rt()}catch(h){n.emit("error",h),e.onError?.(h)}},[G,p,f,n,e,o,Rt,$n,en,Se,Mn,i,lr]),zn=N(null),qi=D(m=>{typeof m=="string"&&(C?ue.fire("manual",m):zn.current=m)},[C,ue]);R(()=>{!C||!zn.current||(ue.fire("manual",zn.current),zn.current=null)},[C,ue]),R(()=>Ba(t,{open:dr,close:on,expand:pr,fullscreen:mr,openForm:qi}),[t,dr,on,pr,mr,qi]);let Le=Te(()=>Tr(e,s,d,_),[e,s,d,_]);On.current=Le.strings;let gd=Te(()=>w.map(m=>{let h=Tt.list.find(T=>T.id===m.formId);return{...m,title:h?.title,form:h}}),[w,Tt]),Gi={options:Le,transport:G,feedback:ie,bus:n,persistence:o,view:Gc,canSend:Xt,isStreaming:Se,loadingMessages:v,messagesSig:p,agent:Kc,suggestions:nr,initialWidgetSize:l.widgetSize??null,visitorId:i,onClose:on,onClear:_r,onExpand:pr,onFullscreen:mr,onSoundToggle:cd,onToggleHistory:dd,onSelectHistoryConversation:fr,onNewConversation:ur,onLocaleChange:_d,onThemeChange:ud,onTextSizeChange:pd,onWidgetSizeChange:fd,onSend:Wi,onStop:sd,onSuggestion:m=>{let h=m.text??m.label;W.info("suggestion",{text:h}),n.emit("suggestion",{text:h}),Wi(h,[])},activeForm:id.value?.form??null,formMarkers:gd,onFormSubmit:ue.complete,onFormSkip:ue.skip,onFormFill:m=>ue.fire("manual",m),tool:od,onRetry:ld},hd=m=>{fr(m);let h=V();h&&O.switchTab(h)};if(!B)return null;let rn=Le.modules.list,gr=m=>{let h=Sn("close",Le.mode,m);return rn.length===0?r(Mc,{strings:Le.strings,onClose:h?on:void 0}):rn.length===1&&rn[0]?.layout==="chat"?r(sc,{...Gi,panelSize:m}):r(Lc,{panelProps:{...Gi,panelSize:m,onClose:h?on:void 0},enabledModules:rn,nav:O,bus:n,unreadCount:y.value,onSelectConversation:hd,onStartNewConversation:ur,onSetPanelSize:ut})};if(e.mode==="page"){let m=T=>{fr(T.conversationId)},h=rn.some(T=>T.layout==="chat");return r("div",{class:`${Xo}-anchor`,children:r(_c,{site:jc,blocks:Xc,transport:G,strings:Le.strings,locale:Le.locale,persistence:o,visitorId:i,showConversations:h,onSelectConversation:m,onNewConversation:ur,sidebarCollapsed:Qc,onToggleSidebarCollapsed:md,children:gr("fullscreen")})})}if(ne){let m=e.mode==="standalone"?"fullscreen":ye;return r("div",{class:`${Xo}-anchor`,children:gr(m)})}let Ki=e.mode==="drawer",ji=!(e.mode==="modal")&&!e.launcher.hidden&&(!le||nt),Yi=ji&&!nt&&!Ct&&!Ki?Le.launcher.callout:null;return r("div",{class:`${Xo}-anchor`,"data-launcher-size":Le.launcher.size,children:[le||_e?r("div",{class:`${Xo}-surface`,hidden:!le,children:gr(ye)}):null,ji?r(wl,{onToggle:dr,launcher:Le.launcher,strings:Le.strings,leaving:nt,edgeTab:Ki}):null,Yi?r(kl,{callout:Yi,launcherPosition:Le.position,strings:Le.strings,closeLabel:Le.strings.close,onDismiss:Et}):null]})}function sm(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var lm=120;async function cm(e,t,n){let o=[];for(let i of t)try{let{id:a,url:l}=await e.uploadFile(i.file);o.push({id:a,name:i.name,mediaType:i.mediaType,size:i.size,url:l})}catch(a){n(a)}return o}function bi(e,t,n,o){let i={role:n,text:o};e.emit("message",i),t.onMessage?.(i)}var dm=F.scope("error-boundary"),Jo=class extends at{constructor(){super(...arguments);U(this,"state",{crashed:!1})}componentDidCatch(n,o){dm.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 _m="1",um=60,pm=2e3,Hc={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 mm(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function fm(){return location.origin+location.pathname}function gm(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function Bc(e,t){let n=Math.random(),o=0,i=0,a=new Set,l=(c,d)=>{let{tracking:u,publicKey:_,aiAgentDeploymentId:g,mode:f,themeMode:p}=t.getOptions();if(!u.enabled||mm()||n>=u.sampleRate)return;let y=performance.now();if(y-o>6e4&&(o=y,i=0),++i>um)return;let v=new URLSearchParams;v.set("v",_m),v.set("_ev",Nt),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",fm());let w=gm();w&&v.set("ref",w),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",p),d)for(let[se,O]of Object.entries(d))O!==void 0&&v.set(se,String(O));v.set("ts",String(Date.now()));let x=`${u.endpoint}?${v}`;if(x.length>pm)return;let E=new Image(1,1);a.add(E);let V=()=>a.delete(E);E.addEventListener("load",V,{once:!0}),E.addEventListener("error",V,{once:!0}),E.src=x},s=Object.keys(Hc).map(c=>e.on(c,d=>l(c,Hc[c]?.(d))));return()=>{for(let c of s)c();a.clear()}}function Qo(e){let{bus:t,host:n,appRoot:o,persistence:i,reportError:a}=e,l=e.initialRaw,s,c=rt(l),d=!0,u=()=>{c=rt(s?Rr(l,s):l)},_=()=>{ja(n,ht(c.mode));let p=i.loadUserPrefs().themeMode;Ya(n,p?{...c,themeMode:p}:c),d&&(ao(n,xi(c)),d=!1)},g=()=>{_(),Mt(io(Jo,{onError:a},io($c,{bus:t,hostElement:n,options:c})),o)};t.on("handshake",p=>{p.config&&(p.config.storageVersion&&i.rememberStorageVersion(p.config.storageVersion),s=p.config,u(),g())});let f=Bc(t,{getOptions:()=>c,getVisitorId:()=>i.getVisitorId(),getConversationId:()=>i.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>l,render:g,setUserOptions:p=>{l=p,u(),g()},patchUserOptions:p=>{l={...l,...p},u(),g()},destroy:()=>f()}}function xi(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=st(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:o}=gn(e,zt(),t.loadPanelOpen(),t.loadPanelSize());return vo(e.mode,o,n)}var hm=F.scope("hooks"),yi="*",Pi=new Set;function Si(e,t,n){let o={widgetId:e,event:t,listener:n};return Pi.add(o),()=>{Pi.delete(o)}}function vm(e,t,n){let o=[...Pi];for(let i of o)if(bm(i.widgetId,e.widgetId)&&!(i.event!==yi&&i.event!==t))try{i.listener(e,t,n)}catch(a){hm.warn("hook listener threw",{event:t,error:a})}}function Fc(e,t){let n=[];for(let o of xm)n.push(t.on(o,i=>{vm(e,o,i)}));return()=>{for(let o of n)o()}}function wi(e){if(Array.isArray(e))for(let t of e){let n=Pm(t);n&&Si(n.widgetId,n.event,n.listener)}}function bm(e,t){return e===yi||e===t}var xm=["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 Pm(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 tt=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=rt(e),o=n.widgetId,i=tt.get(o);i&&(t.debug("destroy existing instance at slot",{widgetId:o}),i.destroy());let a=xi(n),l=n.iframe?Qa({position:ht(n.mode)},n.position,a,n.mode,e.target??null):Ot({position:ht(n.mode),target:e.target??null});l.hostElement.dataset.widgetId=o;let s=new Dt,c=st(o,n.storage,n.aiAgentDeploymentId),d=y=>{s.emit("error",y),u.getOptions().onError?.(y)},u=Qo({bus:s,host:l.hostElement,appRoot:l.appRoot,persistence:c,initialRaw:e,reportError:d});u.render();let _=l.hostElement,g=null,f=y=>{y.debug!==void 0&&Gn(y.debug),u.patchUserOptions(y)},p={widgetId:o,open:()=>dn(_,"open"),close:()=>dn(_,"close"),expand:()=>dn(_,"expand"),openForm:y=>dn(_,"openForm",y),on:(y,v)=>s.on(y,v),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=>{Gn(y),t.info("debug level set",{level:an()})},debugLevel:()=>an(),onLog:y=>sn(y),destroy:()=>{t.info("destroy",{widgetId:o}),g?.(),u.destroy(),s.clear(),Mt(null,l.appRoot),l.destroy(),tt.get(o)===p&&tt.delete(o)}};return g=Fc(p,s),tt.set(o,p),p}function er(e){let t=e.widgetId??"default",n=tt.get(t);return n?(n.update(e),n):Zo(e)}function ki(e){if(e!==void 0){tt.get(e)?.destroy();return}let t=[...tt.values()];for(let n of t)n.destroy()}function Ke(e="default"){return tt.get(e)??null}function zc(){return[...tt.values()]}function Ci(e,t,n){return Si(e,t,n)}var Uc=Nt;var Ei=class extends HTMLElement{constructor(){super(...arguments);U(this,"bus",new Dt);U(this,"mountResult",null);U(this,"runtime",null)}static get observedAttributes(){return Ir}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,Mt(null,this.mountResult.appRoot),this.bus.clear())}attributeChangedCallback(){this.isConnected&&this.boot()}boot(){let n=Xn(a=>this.getAttribute(a));if(this.runtime){this.runtime.setUserOptions(n);return}let o=rt(n);this.mountResult||(this.mountResult=Ot({existingHost:this,position:ht(o.mode)}));let i=st(o.widgetId,o.storage,o.aiAgentDeploymentId);this.runtime=Qo({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:i,initialRaw:n,reportError:a=>this.bus.emit("error",a)}),this.runtime.render()}},Wc=!1;function Ti(){if(Wc||typeof customElements>"u")return;let e=P.tagName;customElements.get(e)||customElements.define(e,Ei),Wc=!0}typeof customElements<"u"&&Ti();var Vc=F.scope("iife"),Ri={close:()=>Ke()?.close(),destroy:()=>ki(),expand:()=>Ke()?.expand(),hook:(e,t,n)=>typeof e=="string"&&typeof t=="string"&&typeof n=="function"?Ci(e,t,n):void 0,init:e=>er(e),mount:e=>Zo(e),on:(e,t)=>Ke()?.on(e,t),onLog:e=>sn(e),open:()=>Ke()?.open(),setDebug:e=>Ke()?.setDebug(e),update:e=>Ke()?.update(e)};function qc(e,...t){let n=Ri[e];if(!n){Vc.warn("unknown command",{command:e});return}return n(...t)}function ym(){let e=((n,...o)=>qc(n,...o));e.init=er,e.mount=Zo,e.destroy=ki,e.getInstance=Ke,e.getAllInstances=zc,e.version=Uc,e.hook=Ci,e.debugLevel=()=>an(),e.onLog=sn;let t=new Set(["init","mount","hook","onLog"]);for(let n of Object.keys(Ri))t.has(n)||(e[n]=(...o)=>Ri[n](...o));return e}function Sm(e){let t=e?.q;if(t)for(let n of t){let o=[...n],[i,...a]=o;if(typeof i=="string")try{qc(i,...a)}catch(l){Vc.warn("queued command failed",{command:i,error:l})}}}function wm(){let e=[],t=e.push.bind(e);return e.push=(...n)=>{for(let o of n)wi([o]);return t(...n)},e}function km(){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 Cm(){if(typeof window>"u"||typeof document>"u")return;let e=globalThis[P.global],t=ym();globalThis[P.global]=t,Ti();let n=`${P.global}Hooks`,o=globalThis[n];if(wi(o),globalThis[n]=wm(),Sm(e),Ke())return;let i=document.currentScript??km(),a=Ar(i?.dataset);if(!a.publicKey)return;let l=()=>{Ke()||er(a)};if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",l,{once:!0});return}l()}Cm();return Sd(Em);})();
|
|
39
|
+
`){ee(e),te(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(tp(n.charCodeAt(0)))break;ee(e),te(e,31),e.pending=n;continue}break;case"[":if(e.token!==19&&e.token!==17&&e.token!==30&&e.token!==31&&n!=="]"){ee(e),te(e,17),e.pending=n;continue}break;case"!":if(e.token!==19&&n==="["){ee(e),te(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}ee(e)}function _i(e){return{add_token:np,end_token:op,add_text:rp,set_attr:ip,data:{nodes:[e,,,,,],index:0}}}function np(e,t){let n=e.nodes[e.index],o;switch(t){case 1:return;case 20:o=document.createElement("blockquote");break;case 2:o=document.createElement("p");break;case 21:o=document.createElement("br");break;case 22:o=document.createElement("hr");break;case 3:o=document.createElement("h1");break;case 4:o=document.createElement("h2");break;case 5:o=document.createElement("h3");break;case 6:o=document.createElement("h4");break;case 7:o=document.createElement("h5");break;case 8:o=document.createElement("h6");break;case 12:case 13:o=document.createElement("em");break;case 14:case 15:o=document.createElement("strong");break;case 16:o=document.createElement("s");break;case 11:o=document.createElement("code");break;case 18:case 17:o=document.createElement("a");break;case 19:o=document.createElement("img");break;case 23:o=document.createElement("ul");break;case 24:o=document.createElement("ol");break;case 25:o=document.createElement("li");break;case 26:let i=o=document.createElement("input");i.type="checkbox",i.disabled=!0;break;case 9:case 10:n=n.appendChild(document.createElement("pre")),o=document.createElement("code");break;case 27:o=document.createElement("table");break;case 28:switch(n.children.length){case 0:n=n.appendChild(document.createElement("thead"));break;case 1:n=n.appendChild(document.createElement("tbody"));break;default:n=n.children[1]}o=document.createElement("tr");break;case 29:o=document.createElement(n.parentElement?.tagName==="THEAD"?"th":"td");break;case 30:o=document.createElement("equation-block");break;case 31:o=document.createElement("equation-inline");break}e.nodes[++e.index]=n.appendChild(o)}function op(e){e.index-=1}function rp(e,t){e.nodes[e.index].appendChild(document.createTextNode(t))}function ip(e,t,n){e.nodes[e.index].setAttribute(Xu(t),n)}function Bo({textSig:e,doneSig:t}){let n=N(null);return vt(()=>{let o=n.current;if(!o)return;o.classList.add(`${P.cssPrefix}-md`);let i=_i(o),a=di(i),l=0,s=Je(()=>{let u=e.value,_=t.value;u.length<l&&(o.replaceChildren(),i=_i(o),a=di(i),l=0);let g=u.slice(l);g&&we(a,g),l=u.length,_&&ql(a)}),c=new MutationObserver(u=>{for(let _ of u)for(let g of _.addedNodes){if(!(g instanceof HTMLElement))continue;let f=g.matches?.("a")?[g]:[...g.querySelectorAll?.("a")??[]];for(let p of f)Gl(p)}});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 Kl({text:e}){let t=Te(()=>H(e),[e]),n=Te(()=>H(!0),[]);return r(Bo,{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 qt=P.cssPrefix;function jl({part:e,strings:t}){let n=e.title||e.filename||e.url||t.sources;return e.url?r("a",{class:`${qt}-source`,href:e.url,target:"_blank",rel:"noreferrer noopener","data-testid":S.source,children:[r("span",{class:`${qt}-source-icon`,"aria-hidden":"true",children:"\u{1F517}"}),r("span",{class:`${qt}-source-label`,children:n})]}):r("span",{class:`${qt}-source`,"data-testid":S.source,children:[r("span",{class:`${qt}-source-icon`,"aria-hidden":"true",children:"\u{1F4C4}"}),r("span",{class:`${qt}-source-label`,children:n})]})}var et=P.cssPrefix;function Fo(e){return e.startsWith("tool:")||e.startsWith("tool-")?e.slice(5):e}function zo(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 sp(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 lp({status:e}){return e==="denied"||e==="error"?r(yl,{}):e==="completed"||e==="responded"?r(Pl,{}):r(xl,{})}function cp(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;default:return t.statusRunning}}function dp({state:e,approval:t,strings:n}){let o=sp(e,t);return r("span",{class:`${et}-toolui-badge ${et}-toolui-status`,"data-status":o,children:[r("span",{class:`${et}-toolui-status-icon`,children:r(lp,{status:o})}),cp(o,n)]})}function Uo({name:e,state:t,approval:n,strings:o}){return r(oe,{children:[r("span",{class:`${et}-toolui-wrench`,children:r(bl,{})}),r("strong",{class:`${et}-toolui-title`,children:e}),r(dp,{state:t,approval:n,strings:o}),r("span",{class:`${et}-toolui-chevron`,children:r(Eo,{})})]})}function ct({label:e,value:t,error:n}){let o=n?String(t??""):Wo(ui(t));return o?r("div",{class:`${et}-toolui-section`,children:[r("span",{class:`${et}-toolui-label`,children:e}),r("pre",{class:`${et}-toolui-code`,"data-error":n?"true":void 0,children:o})]}):null}function ui(e){if(e&&typeof e=="object"){let t=e;if(t.storage==="tool-result-ref"&&"summary"in t)return t.summary}return e}function Wo(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 ke=P.cssPrefix;function Yl({part:e,strings:t,active:n,onDecision:o,onEdit:i}){let a=Y(()=>e.approvalSig.value),l=Y(()=>e.stateSig.value),s=Y(()=>e.inputSig.value),c=Y(()=>e.outputSig.value),d=Y(()=>e.errorSig.value),u=Fo(e.toolName),_=a.value?.approved,{terminal:g,responded:f,decided:p}=zo(l.value,a.value),y=f&&n&&!g,v=e.toolCallId;return r("div",{class:`${ke}-toolui-group`,"data-testid":p?S.toolDecision:S.toolApproval,children:[r("details",{class:`${ke}-toolui ${ke}-toolui-collapsible`,children:[r("summary",{class:`${ke}-toolui-head`,children:r(Uo,{name:u,state:l.value,approval:a.value,strings:t})}),r(ct,{label:t.toolParameters,value:s.value}),c.value!==void 0?r(ct,{label:t.toolResult,value:c.value}):null,d.value?r(ct,{label:t.statusError,value:d.value,error:!0}):null]}),r("div",{class:`${ke}-toolui ${ke}-toolui-body`,children:[r("p",{class:`${ke}-toolui-prompt`,children:t.approvalPrompt.replace("{tool}",u)}),r("p",{class:`${ke}-toolui-subtle`,children:t.approvalBody}),f?r("p",{class:`${ke}-toolui-subtle`,children:[t.approvalYourResponse.replace("{decision}",_?t.approve:t.reject),a.value?.reason?` \u2014 ${a.value.reason}`:""]}):null,y?r("p",{class:`${ke}-toolui-subtle`,children:t.approvalEditHint}):null,f&&!y&&!g?r("p",{class:`${ke}-toolui-subtle`,children:t.approvalSubmitting}):null,!p&&!n?r("p",{class:`${ke}-toolui-subtle`,children:t.stepNoLongerActive}):null,!p&&n?r("div",{class:`${ke}-toolui-actions`,children:[r("button",{type:"button",class:`${ke}-form-skip`,onClick:()=>o(v,!1),"data-testid":S.toolReject,children:t.reject}),r("button",{type:"button",class:`${ke}-form-submit`,onClick:()=>o(v,!0),"data-testid":S.toolApprove,children:t.approve})]}):y?r("div",{class:`${ke}-toolui-actions`,children:r("button",{type:"button",class:`${ke}-form-skip`,onClick:()=>i(v),"data-testid":S.toolEdit,children:t.edit})}):null]})]})}function Jl(e){let t=e&&typeof e=="object"?e:{},n=t.responseType;return{title:kn(t.title),question:kn(t.question)??"Please provide the missing information.",description:kn(t.description),placeholder:kn(t.placeholder),responseType:n==="single-choice"||n==="multi-choice"||n==="confirmation"||n==="free-text"?n:"free-text",choices:Array.isArray(t.choices)?t.choices:void 0,allowOther:typeof t.allowOther=="boolean"?t.allowOther:void 0,required:typeof t.required=="boolean"?t.required:!0,defaultValues:Array.isArray(t.defaultValues)?t.defaultValues.filter(o=>typeof o=="string"):void 0,minSelections:Xl(t.minSelections),maxSelections:Xl(t.maxSelections),validationHint:kn(t.validationHint)}}function Ql(e){if(e.responseType==="confirmation")return[];let t=(e.choices??[]).map(_p).filter(i=>i!==null),n="textarea";e.responseType==="single-choice"&&t.length>0?n="radio":e.responseType==="multi-choice"&&(n="multiselect");let o=n==="multiselect"?e.defaultValues?.join(", "):e.defaultValues?.[0];return[{name:"answer",label:e.question,type:n,placeholder:e.placeholder,required:e.required??!0,defaultValue:o,options:t.length>0?t:void 0,allowOther:e.allowOther,validationHint:e.validationHint,validation:n==="multiselect"?{minSelections:e.minSelections,maxSelections:e.maxSelections}:void 0}]}function _p(e){return typeof e=="string"?e?{value:e,label:e}:null:e&&typeof e.value=="string"&&e.value?{value:e.value,label:e.label??e.value,description:e.description}:null}function kn(e){return typeof e=="string"&&e.trim()?e.trim():void 0}function Xl(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}var re=P.cssPrefix;function up(e,t){switch(e.responseType){case"single-choice":return t.respSingleChoice;case"multi-choice":return t.respMultiChoice;case"confirmation":return t.respConfirmation;default:return t.respFreeText}}function Zl({part:e,strings:t,active:n,onSubmit:o,onDecision:i,onEdit:a}){let l=Y(()=>e.stateSig.value),s=Y(()=>e.approvalSig.value),c=Y(()=>Jl(e.inputSig.value)),{terminal:d,responded:u,decided:_}=zo(l.value,s.value),g=s.value!==void 0,f=(v,b)=>{g?i(e.toolCallId,b,v):c.value.responseType==="confirmation"?o(e.toolCallId,{confirmed:b}):o(e.toolCallId,b?{answer:v}:{})},p=c.value;if(_)return r(fp,{part:e,strings:t,req:p,editable:u&&n&&!d,onEdit:()=>a(e.toolCallId)});let y=!n;return r("div",{class:`${re}-toolui${y?` ${re}-toolui-stale`:""}`,"data-testid":S.toolAskInput,children:[r("div",{class:`${re}-toolui-head`,children:[r("span",{class:`${re}-toolui-badge ${re}-toolui-badge-accent`,children:t.inputRequired}),r("span",{class:`${re}-toolui-badge`,children:up(p,t)})]}),p.description?r("div",{class:`${re}-toolui-desc`,children:p.description}):null,r(pi,{label:t.inputQuestion,text:p.question}),y?r("p",{class:`${re}-toolui-note`,children:t.stepNoLongerActive}):r(pp,{req:p,strings:t,resolve:f})]})}function pp({req:e,strings:t,resolve:n}){if(e.responseType==="confirmation")return r(mp,{req:e,strings:t,resolve:n});let o=Ql(e).map(i=>(i.label=t.inputYourAnswer,i.placeholder=i.placeholder??t.inputAnswerPlaceholder,i));return r($o,{fields:o,strings:t,submitLabel:t.inputSubmit,footerHint:e.responseType==="free-text"?t.inputSubmitHint:void 0,onSubmit:i=>n(i.answer??Object.values(i).join(", "),!0),skipLabel:t.inputSkip,onSkip:()=>n(void 0,!1),submitOnEnter:!0,submitTestId:S.toolInputSubmit,skipTestId:S.toolInputSkip})}function mp({req:e,strings:t,resolve:n}){let[o,i]=I(""),a=e.allowOther??!0,l=()=>n(o.trim()||void 0,!0),s=()=>n(void 0,!1),c=d=>{d.key!=="Enter"||d.shiftKey||d.isComposing||(d.preventDefault(),l())};return r(oe,{children:[a?r("label",{class:`${re}-field`,children:[r("span",{class:`${re}-field-label`,children:t.inputOptionalNote}),r("textarea",{class:`${re}-field-input`,rows:2,value:o,placeholder:e.placeholder??t.inputOptionalNotePlaceholder,onInput:d=>i(d.target.value),onKeyDown:c,"data-testid":`${S.formField}-note`})]}):null,r("div",{class:`${re}-form-actions`,children:[r("span",{class:`${re}-form-hint`,children:t.inputConfirmHint}),r("button",{type:"button",class:`${re}-form-skip`,onClick:s,"data-testid":S.toolInputSkip,children:t.confirmNo}),r("button",{type:"button",class:`${re}-form-submit`,onClick:l,"data-testid":S.toolInputSubmit,children:t.confirmYes})]})]})}function pi({label:e,text:t}){return r("div",{class:`${re}-toolui-section`,children:[r("span",{class:`${re}-toolui-label`,children:e}),r("p",{class:`${re}-toolui-text`,children:t})]})}function fp({part:e,strings:t,req:n,editable:o,onEdit:i}){let a=Y(()=>e.outputSig.value),l=Y(()=>e.approvalSig.value),s=l.value?.approved===!1,c=l.value?.approved!==void 0?l.value.reason??"":gp(a.value,t);return r("div",{class:`${re}-toolui`,"data-testid":S.toolDecision,children:[r("div",{class:`${re}-toolui-head`,children:[r("span",{class:`${re}-toolui-badge ${re}-toolui-badge-accent`,children:t.inputBadge}),r("span",{class:`${re}-toolui-badge`,children:s?t.inputSkipped:t.inputAnswered})]}),n.description?r("div",{class:`${re}-toolui-desc`,children:n.description}):null,r(pi,{label:t.inputQuestion,text:n.question}),!s&&c?r(pi,{label:t.inputResponse,text:c}):null,o?r("div",{class:`${re}-toolui-actions`,children:r("button",{type:"button",class:`${re}-form-skip`,onClick:i,"data-testid":S.toolEdit,children:t.edit})}):null]})}function gp(e,t){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="object"){let n=e;return"confirmed"in n?n.confirmed?t.confirmYes:t.confirmNo:typeof n.responseText=="string"&&n.responseText?n.responseText:Object.values(n).filter(o=>typeof o=="string"||typeof o=="number").join(", ")}return String(e)}var mi=P.cssPrefix;function ec({part:e,strings:t}){let n=Y(()=>e.inputSig.value),o=Y(()=>e.outputSig.value),i=Y(()=>e.errorSig.value),a=Y(()=>e.stateSig.value),l=Y(()=>e.approvalSig.value);return Y(()=>!!Wo(n.value)||!!i.value||!!Wo(ui(o.value))).value?r("details",{class:`${mi}-toolui ${mi}-toolui-collapsible`,"data-testid":S.toolCall,children:[r("summary",{class:`${mi}-toolui-head`,children:r(Uo,{name:Fo(e.toolName),state:a.value,approval:l.value,strings:t})}),r(ct,{label:t.toolParameters,value:n.value}),o.value!==void 0?r(ct,{label:t.toolResult,value:o.value}):null,i.value?r(ct,{label:t.statusError,value:i.value,error:!0}):null]}):null}var Me=P.cssPrefix;function tc({message:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:i,showSources:a,interactive:l=!1,tool:s,onRetry:c}){let u=Y(()=>e.partsSig.value).value,_=Y(()=>Qe(e)),g=Y(()=>Hs(e)),f=Y(()=>e.partsSig.value.some(E=>E.kind==="text"&&E.textSig.value.length>0)),p=Y(()=>o&&e.partsSig.value.some(E=>E.kind==="reasoning")),y=e.role==="assistant"&&e.status==="streaming",v=n==="buffered"&&y,b=y&&!f.value,w=y&&!v&&!(p.value&&b);if(g.value)return null;let x=hp(e.createdAt);return r("div",{class:`${Me}-bubble-row`,"data-role":e.role,"data-testid":Pe(S.messageBubble,e.id),children:r("div",{class:`${Me}-bubble-col`,children:[r("div",{class:`${Me}-bubble`,children:[v?r(Sp,{label:t.loading}):u.map(E=>r(vp,{part:E,active:b,strings:t,showReasoning:o,showToolCalls:i,showSources:a,interactive:l,tool:s},Pp(E))),w&&r(yp,{}),e.status==="error"&&e.errorText||_.value?r("div",{class:`${Me}-error`,role:"alert",children:[r("span",{children:e.errorText??t.errorGeneric}),c?r("button",{type:"button",class:`${Me}-error-retry`,onClick:c,"data-testid":S.messageRetry,children:t.errorRetry}):null]}):null]}),x?r("time",{class:`${Me}-bubble-time`,dateTime:x.iso,title:x.full,children:x.short}):null]})})}function hp(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 vp({part:e,active:t,strings:n,showReasoning:o,showToolCalls:i,showSources:a,interactive:l,tool:s}){switch(e.kind){case"step-start":return null;case"text":return r(Bo,{textSig:e.textSig,doneSig:e.doneSig});case"reasoning":return o?r(xp,{part:e,active:t,strings:n}):null;case"tool":return r(bp,{part:e,strings:n,showToolCalls:i,interactive:l,tool:s});case"file":return e.mediaType.startsWith("image/")?r("img",{src:e.url,alt:"",loading:"lazy"}):r("a",{href:e.url,target:"_blank",rel:"noreferrer noopener",children:e.url});case"source":return a?r(jl,{part:e,strings:n}):null}}function bp({part:e,strings:t,showToolCalls:n,interactive:o,tool:i}){let a=Y(()=>e.approvalSig.value!==void 0);if(i?.humanInLoop){if(Bl(e.toolName))return r(Zl,{part:e,strings:t,active:o,onSubmit:i.onResult,onDecision:i.onDecision,onEdit:i.onEdit});if(a.value)return r(Yl,{part:e,strings:t,active:o,onDecision:i.onDecision,onEdit:i.onEdit})}return n?r(ec,{part:e,strings:t}):null}function xp({part:e,active:t,strings:n}){return r("details",{class:`${Me}-reasoning`,open:t,"data-active":t?"true":void 0,children:[r("summary",{class:`${Me}-reasoning-summary`,children:r("span",{class:`${Me}-reasoning-label`,children:t?n.thinking:n.thoughts})}),r("div",{class:`${Me}-reasoning-body`,children:r(Bo,{textSig:e.textSig,doneSig:e.doneSig})})]})}function Pp(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 yp(){return r("span",{class:`${Me}-typing`,"aria-hidden":"true",children:[r("span",{}),r("span",{}),r("span",{})]})}function Sp({label:e}){return r("span",{class:`${Me}-loading`,role:"status",children:[r("span",{class:`${Me}-loading-spinner`,"aria-hidden":"true"}),r("span",{class:`${Me}-loading-label`,children:e})]})}var Gt=P.cssPrefix,fi=120,wp=350,kp=1200;function nc({messagesSig:e,strings:t,responseMode:n,showReasoning:o,showToolCalls:i,showSources:a,loading:l,idle:s,tool:c,onRetry:d,form:u,formMarkers:_,onFillForm:g}){let f=N(null),p=Y(()=>e.value),[y,v]=I(!1),[b,w]=I(!1),x=N(!1),E=N(!1),V=N(!1),se=N(0),O=()=>V.current||performance.now()-se.current<wp,Z=N(0),B=k=>{Z.current=performance.now(),k.scrollTop=k.scrollHeight},j=p.value[0]?.id;vt(()=>{let k=f.current;if(!k||p.value.length===0||(x.current=!0,!p.value.some(nt=>nt.role==="user")))return;let K=()=>B(k);K();let ve=new ResizeObserver(K);ve.observe(k);let Ae=new MutationObserver(K);Ae.observe(k,{childList:!0,subtree:!0,characterData:!0});let Ce=setTimeout(()=>{ve.disconnect(),Ae.disconnect()},300);return()=>{ve.disconnect(),Ae.disconnect(),clearTimeout(Ce)}},[j]);let X=N(0);R(()=>{let k=f.current,K=p.value,ve=X.current;if(X.current=K.length,!k||!x.current)return;if(K.slice(ve).some(Ce=>Ce.role==="user")){E.current=!1,B(k);return}if(!K.some(Ce=>Ce.role==="user")||E.current||O())return;k.scrollHeight-k.scrollTop-k.clientHeight<fi&&B(k)},[p.value.length]),R(()=>{let k=f.current;if(!k)return;let K=p.value.at(-1);if(!K||K.status!=="streaming"&&!p.value.some(Ce=>Ce.role==="user"))return;let ve=()=>{if(E.current||O())return;k.scrollHeight-k.scrollTop-k.clientHeight<fi*2&&B(k)};if(K.status!=="streaming"){let Ce=requestAnimationFrame(ve);return()=>cancelAnimationFrame(Ce)}ve();let Ae=new MutationObserver(ve);return Ae.observe(k,{childList:!0,subtree:!0,characterData:!0}),()=>Ae.disconnect()},[p.value]);let he=u?.form.id;vt(()=>{let k=f.current;!k||!he||E.current||p.value.some(K=>K.role==="user")&&B(k)},[he]),R(()=>{let k=f.current;if(!k)return;let K=()=>v(k.scrollHeight-k.scrollTop-k.clientHeight>fi*2),ve,Ae=()=>{K(),performance.now()-Z.current>150&&(E.current=k.scrollHeight-k.scrollTop-k.clientHeight>8),w(!0),clearTimeout(ve),ve=setTimeout(()=>w(!1),kp)},Ce=()=>{E.current=!0},nt=ye=>{ye.deltaY<0&&Ce()},jt=0,Ct=ye=>{jt=ye.touches[0]?.clientY??0,V.current=!0},Yt=ye=>{(ye.touches[0]?.clientY??0)>jt+4&&Ce()},Ue=()=>{V.current=!1,se.current=performance.now()},Et=()=>{V.current=!0};return k.addEventListener("scroll",Ae,{passive:!0}),k.addEventListener("wheel",nt,{passive:!0}),k.addEventListener("touchstart",Ct,{passive:!0}),k.addEventListener("touchmove",Yt,{passive:!0}),k.addEventListener("touchend",Ue,{passive:!0}),k.addEventListener("touchcancel",Ue,{passive:!0}),k.addEventListener("pointerdown",Et,{passive:!0}),window.addEventListener("pointerup",Ue,{passive:!0}),window.addEventListener("pointercancel",Ue,{passive:!0}),K(),()=>{k.removeEventListener("scroll",Ae),k.removeEventListener("wheel",nt),k.removeEventListener("touchstart",Ct),k.removeEventListener("touchmove",Yt),k.removeEventListener("touchend",Ue),k.removeEventListener("touchcancel",Ue),k.removeEventListener("pointerdown",Et),window.removeEventListener("pointerup",Ue),window.removeEventListener("pointercancel",Ue),clearTimeout(ve)}},[]);let C=()=>{let k=f.current;k&&(E.current=!1,B(k))},q=[],ne="",fe=p.value.at(-1)?.id,le=[..._??[]].toSorted((k,K)=>(k.createdAt??1/0)-(K.createdAt??1/0)),Ne=k=>r(Hl,{marker:k,strings:t,onFill:!u&&g?()=>g(k.formId):void 0},k.key),_e=k=>{for(let K=le[0];K?.createdAt!==void 0&&!(k!==void 0&&K.createdAt>k);K=le[0])le.shift(),q.push(Ne(K))};for(let k of p.value){if(k.role==="assistant"&&k.id!==fe&&Qe(k))continue;_e(k.createdAt);let K=Cp(k.createdAt);K&&K!==ne&&(q.push(r("div",{class:`${Gt}-date-divider`,children:r("span",{class:`${Gt}-date-pill`,title:Ep(k.createdAt),children:Tp(k.createdAt,t)})},`day:${K}`)),ne=K),q.push(r(tc,{message:k,strings:t,responseMode:n,showReasoning:o,showToolCalls:i,showSources:a,interactive:!!s&&k.id===fe,tool:c,onRetry:s&&k.id===fe?d:void 0},k.id))}for(let k of le)q.push(Ne(k));return r("div",{class:`${Gt}-list-wrap`,children:[r("div",{ref:f,class:`${Gt}-list`,role:"log","aria-live":"polite","aria-relevant":"additions text","data-scrolling":b?"true":void 0,children:[l&&p.value.length===0?r("div",{class:`${Gt}-list-loading`,role:"status",children:t.conversationLoading}):null,q,u?r($l,{form:u.form,strings:t,onSubmit:u.onSubmit,onSkip:u.onSkip}):null]}),y?r("button",{type:"button",class:`${Gt}-jump`,onClick:C,"aria-label":t.scrollToBottom,title:t.scrollToBottom,"data-testid":S.scrollToBottom,children:r(Eo,{})}):null]})}function Cp(e){if(typeof e!="number"||!Number.isFinite(e))return"";let t=new Date(e);return`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`}function Ep(e){if(typeof e!="number"||!Number.isFinite(e))return"";try{return new Date(e).toLocaleDateString(void 0,{dateStyle:"full"})}catch{return""}}function Tp(e,t){let n=new Date(e),o=a=>new Date(a.getFullYear(),a.getMonth(),a.getDate()).getTime(),i=Math.round((o(new Date)-o(n))/864e5);return i<=0?t.dateToday:i===1?t.dateYesterday:i<7?n.toLocaleDateString(void 0,{weekday:"long"}):n.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}var Rp=["today","yesterday","lastWeek","older"];function Ip(e,t){let n=Date.parse(t);if(!Number.isFinite(n))return"older";let o=Math.floor((oc(e)-oc(n))/(1440*60*1e3));return o<=0?"today":o===1?"yesterday":o<7?"lastWeek":"older"}function rc(e,t){let n=new Map;for(let o of t){let i=Ip(e,o.lastMessageAt),a=n.get(i);a?a.push(o):n.set(i,[o])}return Rp.filter(o=>n.has(o)).map(o=>({bucket:o,conversations:n.get(o)}))}function oc(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t.getTime()}var Ap=F.scope("history"),Lp=3,Mp=6,Np={today:"dateToday",yesterday:"dateYesterday",lastWeek:"dateLastWeek",older:"dateOlder"};function Op(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 Vo({transport:e,strings:t,locale:n,persistence:o,visitorId:i,onSelect:a,onNewConversation:l}){let s=P.cssPrefix,c=e.peekConversations({visitorId:i}),[d,u]=I(c?"loaded":"loading"),[_,g]=I(c?.conversations??[]);R(()=>{let v=!1;return e.listConversations({visitorId:i}).then(b=>{if(v)return;let w=b.conversations??[];g(w),u("loaded"),o.saveHistoryCount(w.length)}).catch(b=>{v||(Ap.warn("listConversations failed",{err:b}),u("error"))}),()=>{v=!0}},[e,i,o]);let f=l?r("div",{class:`${s}-history-footer`,children:r("button",{type:"button",class:`${s}-history-new`,onClick:l,"data-testid":S.sidebarNewConversation,children:[r(Gs,{}),t.newConversation]})}):null;if(d==="loading"){let v=Math.min(o.loadHistoryCount()??Lp,Mp);return r(oe,{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,w)=>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`})})})]})]},w))})]})}),f]})}if(d==="error"||_.length===0)return r(oe,{children:[r("div",{class:`${s}-history-empty`,children:t.historyEmpty}),f]});let p=Date.now(),y=rc(p,_);return r(oe,{children:[r("div",{class:`${s}-history`,role:"list",children:y.map(v=>r("div",{class:`${s}-history-group`,children:[r("div",{class:`${s}-history-heading`,children:t[Np[v.bucket]]}),r("div",{class:`${s}-history-card`,children:v.conversations.map(b=>r("button",{type:"button",role:"listitem",class:`${s}-history-item`,onClick:()=>a(b),"data-closed":b.canContinue?void 0:"true","data-unread":(b.unreadCount??0)>0?"true":void 0,"data-testid":Pe(S.historyItem,b.conversationId),children:[r("span",{class:`${s}-history-avatar`,"aria-hidden":"true",children:r(Qr,{})}),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:Op(b.lastMessageAt,p,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 ic=P.cssPrefix;function ac({suggestions:e,onPick:t}){return e.length===0?null:r("div",{class:`${ic}-suggestions`,role:"group","aria-label":"Suggested replies",children:e.map((n,o)=>r("button",{type:"button",class:`${ic}-suggestion`,onClick:()=>t(n),"data-testid":Pe(S.suggestion,o),children:n.label},n.id))})}var Ie=P.cssPrefix;function sc(e){let{options:t,onClose:n}=e,o=t.strings,i=N(null);R(()=>{let c=i.current;if(!c)return;let d=Lo(c),u=_=>{_.key==="Escape"&&n?.()};return c.addEventListener("keydown",u),()=>{d(),c.removeEventListener("keydown",u)}},[n]);let a=N(null),l=D(c=>{a.current?.attachFromDrop(c)},[]),{visible:s}=Oo({containerRef:i,onDrop:l});return Io(i.current,t.mode==="modal"),r("div",{ref:i,class:`${Ie}-panel`,role:"dialog","aria-modal":"false","aria-label":o.panelTitle,style:{position:"relative"},"data-testid":S.panel,children:[r(gi,{...e,containerEl:i.current,dragOver:s,composerAttachApiRef:a}),r(hi,{poweredBy:e.options.poweredBy})]})}function gi(e){let{options:t,transport:n,feedback:o,bus:i,persistence:a,panelSize:l,view:s,canSend:c,isStreaming:d,loadingMessages:u,messagesSig:_,agent:g,suggestions:f,initialWidgetSize:p,visitorId:y,onClose:v,onBack:b,onClear:w,onToggleHistory:x,onSelectHistoryConversation:E,onNewConversation:V,onWidgetSizeChange:se,onSend:O,onStop:Z,onSuggestion:B,activeForm:j,formMarkers:X,onFormSubmit:he,onFormSkip:C,onFormFill:q,tool:ne,onRetry:fe,containerEl:le,dragOver:Ne,composerAttachApiRef:_e}=e,k=t.strings,K;return j?K=null:c?K=r(oe,{children:[r(ac,{suggestions:f,onPick:B}),r(Al,{options:t,transport:n,feedback:o,bus:i,isStreaming:d,onSend:O,onStop:Z,attachApiRef:_e})]}):K=r($p,{label:k.conversationClosed,ctaLabel:k.startNewConversation,onNewConversation:w}),r(oe,{children:[s==="history"?r(Dp,{strings:k,onBack:x,onClose:v,showClose:Ao(t.mode,l,t.actions)}):r("header",{class:`${Ie}-header`,"data-testid":S.panelHeader,children:[b?r("button",{type:"button",class:`${Ie}-icon-btn`,onClick:b,"aria-label":k.moduleBack,title:k.moduleBack,children:r(Pn,{})}):null,g?r(Tl,{agent:g,strings:k}):r("h1",{children:k.panelTitle}),r(qe,{panelProps:e,variant:"chat"})]}),s==="history"?r(Vo,{transport:n,strings:k,locale:t.locale,persistence:a,visitorId:y,onSelect:ve=>E(ve.conversationId),onNewConversation:V}):r(oe,{children:[r(Ll,{visible:Ne,strings:k}),r(nc,{messagesSig:_,strings:k,responseMode:t.responseMode,showReasoning:t.showReasoning,showToolCalls:t.showToolCalls,showSources:t.showSources,loading:u,idle:!d,tool:ne,onRetry:fe,form:j?{form:j,onSubmit:he,onSkip:C}:null,formMarkers:X,onFillForm:q}),K,r(Hp,{disclaimer:t.composerDisclaimer})]}),t.size.resize?.enabled?r(Ro,{panelEl:le,resize:t.size.resize,position:t.position,initialSize:p,onSizeChange:se,strings:k}):null]})}function Dp({strings:e,onBack:t,onClose:n,showClose:o}){return r("header",{class:`${Ie}-header`,children:[r("button",{type:"button",class:`${Ie}-icon-btn`,onClick:t,"aria-label":e.historyBack,title:e.historyBack,children:r(Pn,{})}),r("h1",{children:e.historyTitle}),o?r("button",{type:"button",class:`${Ie}-icon-btn`,onClick:n,"aria-label":e.close,title:e.close,children:r(Ve,{})}):null]})}function $p({label:e,ctaLabel:t,onNewConversation:n}){return r("div",{class:`${Ie}-readonly-banner`,role:"note",children:[r("span",{class:`${Ie}-readonly-label`,children:e}),r("button",{type:"button",class:`${Ie}-readonly-cta`,onClick:n,children:t})]})}function Hp({disclaimer:e}){return e?r("div",{class:`${Ie}-composer-footer`,children:r("div",{class:`${Ie}-disclaimer`,children:e})}):null}function hi({poweredBy:e}){return e?r("div",{class:`${Ie}-poweredby-bar`,children:r(Bp,{logoUrl:e.logoUrl,text:e.text,href:e.href})}):null}function Bp({logoUrl:e,text:t,href:n}){let o=r(oe,{children:[e?r("img",{class:`${Ie}-poweredby-logo`,src:e,alt:"",loading:"lazy"}):null,t?r("span",{children:t}):null]});return n?r("a",{class:`${Ie}-poweredby`,href:n,target:"_blank",rel:"noopener noreferrer",children:o}):r("span",{class:`${Ie}-poweredby`,children:o})}function lc(e){let t=N(e);t.current=e;let n=N(null);return n.current??(n.current=Fp(t)),n.current}function Fp(e){let t=H(null),n=new Set,o=c=>`${e.current.conversationId()??""}:${c}`,i=c=>c.frequency==="always"?!1:c.frequency==="conversation"?n.has(o(c.id)):c.id in e.current.persistence.loadFormsDone(),a=(c,d)=>{if(t.value)return;let u=e.current;if(c==="manual"){let _=u.forms.list.find(g=>g.id===d);_&&(t.value={form:_,trigger:"manual"});return}for(let _ of u.forms.byTrigger[c]??[]){let g=_.triggers.find(f=>f.kind===c);if(!(!g||!zp(g,u)||i(_)||!Up(_,u))){t.value={form:_,trigger:c};return}}},l=(c,d)=>{let u=t.value;if(!u)return;t.value=null;let{form:_,trigger:g}=u;_.frequency==="conversation"?n.add(o(_.id)):_.frequency!=="always"&&e.current.persistence.saveFormDone(_.id),e.current.onComplete(_,g,c,d)};return{activeForm:t,fire:a,refresh:()=>{let c=t.value;if(!c)return;let d=e.current.forms.list.find(u=>u.id===c.form.id);d&&d!==c.form&&(t.value={form:d,trigger:c.trigger})},complete:c=>l(c,!1),skip:()=>l({},!0)}}function zp(e,t){return e.kind==="after-messages"?t.messageCount()>=Number(e.param??0):e.kind==="page-area"?t.pageArea()===e.param:!0}function Up(e,t){let n=e.when;if(!n)return!0;if(n.missingContext?.length){let i=t.userContext()??{};if(n.missingContext.some(a=>i[a]!==void 0&&i[a]!==""))return!1}if(n.pageArea&&!(Array.isArray(n.pageArea)?n.pageArea:[n.pageArea]).includes(t.pageArea()??""))return!1;let o=t.messageCount();return!(n.minMessages!=null&&o<n.minMessages||n.maxMessages!=null&&o>n.maxMessages)}function cc(e){let t=P.cssPrefix,{site:n,blocks:o,strings:i,collapsed:a}=e,l=o?.navigation??[],s=o?.linkCards??[],c=a?i.expandSidebar:i.collapseSidebar;return r("aside",{class:`${t}-sidebar`,"data-collapsed":a?"true":"false","data-testid":S.sidebar,children:[r("div",{class:`${t}-sidebar-header`,children:[r(Wp,{site:n}),r("button",{type:"button",class:`${t}-sidebar-toggle`,"aria-label":c,"aria-expanded":a?"false":"true",title:c,onClick:e.onToggleCollapsed,"data-testid":S.sidebarToggle,children:r(Vp,{collapsed:a})})]}),a?null:r(oe,{children:[l.length>0?r("nav",{class:`${t}-sidebar-section`,"data-section":"navigation",children:r(qp,{items:l})}):null,s.length>0?r("div",{class:`${t}-sidebar-section`,"data-section":"link-cards",children:r(Gp,{items:s})}):null,e.showConversations?r("div",{class:`${t}-sidebar-conversations`,children:r(Vo,{transport:e.transport,strings:e.strings,locale:e.locale,persistence:e.persistence,visitorId:e.visitorId,onSelect:e.onSelectConversation,onNewConversation:e.onNewConversation})}):null]})]})}function Wp({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 Vp({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 qp({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 Gp({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 dc=P.cssPrefix;function _c(e){return r("main",{class:`${dc}-page-shell`,"data-sidebar-collapsed":e.sidebarCollapsed?"true":"false",children:[r(cc,{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:`${dc}-page-chat`,"aria-label":"Chat",children:e.children})]})}var uc=e=>Object.fromEntries(e.map(t=>[t,[]]));function pc(e,t,n){let o=H({activeTab:e,stacks:uc(t)});return{sig:o,switchTab(i){o.value.activeTab!==i&&(o.value={...o.value,activeTab:i},n?.(i))},push(i){let a=o.value,l=a.stacks[a.activeTab]??[];o.value={...a,stacks:{...a.stacks,[a.activeTab]:[...l,i]}}},pop(){let i=o.value,a=i.stacks[i.activeTab]??[];a.length!==0&&(o.value={...i,stacks:{...i.stacks,[i.activeTab]:a.slice(0,-1)}})},reset(i){o.value={activeTab:i,stacks:uc(t)}}}}var mc=e=>e.stacks[e.activeTab]??[],fc=e=>mc(e).at(-1),gc=e=>mc(e).length===0;var hc={Icon:yn};var dt=P.cssPrefix;function qo({title:e,actions:t}){return r("header",{class:`${dt}-back-header`,"data-variant":"title",children:[r("span",{class:`${dt}-back-spacer`,"aria-hidden":"true"}),r("h1",{class:`${dt}-back-title`,children:e}),t??r("span",{class:`${dt}-back-spacer`,"aria-hidden":"true"})]})}function Go({title:e,backLabel:t,onBack:n,actions:o,testid:i}){return r("header",{class:`${dt}-back-header`,"data-testid":i,children:[r("button",{type:"button",class:`${dt}-icon-btn`,onClick:n,"aria-label":t,title:t,children:r(Pn,{})}),r("h1",{class:`${dt}-back-title`,children:e}),o??r("span",{class:`${dt}-back-spacer`,"aria-hidden":"true"})]})}var Kt=P.cssPrefix;function vc({placeholder:e,onActivate:t}){return r("button",{type:"button",class:`${Kt}-home-search`,onClick:t,"data-testid":S.homeSearch,children:[r("span",{class:`${Kt}-home-search-text`,children:e}),r("span",{class:`${Kt}-home-search-icon`,"aria-hidden":"true",children:r(ei,{})})]})}function bc({placeholder:e,value:t,onInput:n}){return r("div",{class:`${Kt}-home-search`,"data-input":"true",children:[r("input",{type:"search",class:`${Kt}-home-search-input`,placeholder:e,value:t,onInput:o=>n(o.currentTarget.value),"data-testid":S.helpSearch}),r("span",{class:`${Kt}-home-search-icon`,"aria-hidden":"true",children:r(ei,{})})]})}var Cn=P.cssPrefix;function Ko({title:e,subtitle:t,onClick:n,testid:o}){return r("button",{type:"button",class:`${Cn}-list-row`,onClick:n,"data-testid":o,children:[r("span",{class:`${Cn}-list-row-body`,children:[r("span",{class:`${Cn}-list-row-title`,children:e}),t?r("span",{class:`${Cn}-list-row-sub`,children:t}):null]}),r("span",{class:`${Cn}-list-row-chevron`,"aria-hidden":"true",children:r(Ut,{})})]})}var xc=P.cssPrefix;function ze({tone:e="info",message:t,onRetry:n,strings:o}){return r("div",{class:`${xc}-module-empty`,role:e==="error"?"alert":"status","aria-live":"polite",children:[r("span",{children:t}),n?r("button",{type:"button",class:`${xc}-module-retry`,onClick:n,children:o.errorRetry}):null]})}var kt=P.cssPrefix,Kp=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 Yp(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 Pc(e,t){let n=t.toLowerCase(),o=n.indexOf(e);if(o!==-1)return 100-Math.min(o,99);let i=0;for(let a of e){if(i=n.indexOf(a,i),i===-1)return 0;i+=1}return 1}function Xp(e,t){let n=t.toLowerCase().trim();return n?e.map(o=>({item:o,score:Math.max(Pc(n,o.title)*2,Pc(n,o.description??""))})).filter(o=>o.score>0).toSorted((o,i)=>i.score-o.score).map(o=>o.item):[]}function yc({article:e,nav:t}){return r(Ko,{title:e.title,subtitle:e.description,onClick:()=>jp(t,e),testid:Pe(S.helpArticle,e.id)})}function Jp({transport:e,strings:t,config:n,nav:o,bus:i,panelProps:a}){let l=n.contentTags,[s,c]=I("loading"),[d,u]=I(t.errorGeneric),[_,g]=I([]),[f,p]=I(""),[y,v]=I(0);R(()=>{let x=!1;return c("loading"),e.listContent({tags:l,sortBy:"order",limit:100}).then(E=>{if(x)return;let V=E.items??[];g(V),c("loaded"),i.emit("contentView",{section:"help",tags:l?.join(","),count:V.length})}).catch(E=>{x||(Kp.warn("listContent (help) failed",{err:E}),u(Pt(E,t)),c("error"))}),()=>{x=!0}},[e,l,y,i]);let b=Te(()=>Xp(_,f),[_,f]);R(()=>{let x=f.trim();if(!x)return;let E=setTimeout(()=>i.emit("contentSearch",{queryLength:x.length,hitCount:b.length}),600);return()=>clearTimeout(E)},[f,b,i]);function w(){return f.trim().length>0?b.length===0?r(ze,{message:t.helpSearchEmpty,strings:t}):r("div",{class:`${kt}-help-card`,children:b.map(x=>r(yc,{article:x,nav:o},x.id))}):s==="loading"?r(ze,{message:t.helpLoading,strings:t}):s==="error"?r(ze,{tone:"error",message:d,onRetry:()=>v(x=>x+1),strings:t}):_.length===0?r(ze,{message:t.helpEmpty,strings:t}):Yp(_).map(([x,E])=>r("section",{class:`${kt}-help-group`,children:[x?r("h2",{class:`${kt}-help-section-title`,children:x}):null,r("div",{class:`${kt}-help-card`,children:E.map(V=>r(yc,{article:V,nav:o},V.id))})]},x))}return r("div",{class:`${kt}-module`,children:[r(qo,{title:t.helpTitle,actions:r(qe,{panelProps:a,variant:"plain"})}),r("div",{class:`${kt}-module-pad`,children:r(bc,{placeholder:t.helpSearchPlaceholder,value:f,onInput:p})}),r("div",{class:`${kt}-help-list`,children:w()})]})}var Sc={Icon:Zr,Root:e=>r(Jp,{...e})};var wc=P.cssPrefix;function vi({onClick:e,children:t,testid:n}){return e?r("button",{type:"button",class:`${wc}-home-card`,"data-interactive":"true",onClick:e,"data-testid":n,children:t}):r("div",{class:`${wc}-home-card`,"data-testid":n,children:t})}var ae=P.cssPrefix,kc=F.scope("home");function Qp(e){let t=e.options.userContext?.name,n=e.config.greetingText?Ee(e.strings,e.config.greetingText):void 0;return n?{title:t?n.replace("{name}",t):n.replace(/\s*\{name\}\s*/," ").trim(),subtitle:e.strings.homeGreetingLead}:t?{title:e.strings.homeGreetingNamed.replace("{name}",t),subtitle:e.strings.homeGreetingLead}:{title:e.strings.homeGreeting}}var Zp=(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 em(e){let{transport:t,strings:n,config:o,nav:i,bus:a,panelProps:l}=e,[s,c]=I(null),[d,u]=I([]),_=o.contentTags?.join(",");R(()=>{if(!o.showRecentConversations)return;let b=!1;return t.listConversations({limit:1}).then(w=>!b&&c(w.conversations?.[0]??null)).catch(w=>!b&&kc.warn("listConversations (home) failed",{err:w})),()=>{b=!0}},[t,o.showRecentConversations]),R(()=>{if(!o.contentTags?.length)return;let b=!1;return t.listContent({tags:o.contentTags,limit:6}).then(w=>{if(b)return;let x=w.items??[];u(x),a.emit("contentView",{section:"home",tags:_,count:x.length})}).catch(w=>!b&&kc.warn("listContent (home) failed",{err:w})),()=>{b=!0}},[t,_,a]);let g=Qp(e),f=o.userAvatars??[],p=o.status,y=p?.text?Ee(n,p.text):n.homeStatus,v=o.contentBlockTitle?Ee(n,o.contentBlockTitle):n.homeContentTitle;return r("div",{class:`${ae}-module ${ae}-home`,"data-testid":S.homeView,children:r("div",{class:`${ae}-home-scroll`,children:[r("div",{class:`${ae}-home-hero`,children:[r("div",{class:`${ae}-home-hero-top`,children:[o.brandName?r("span",{class:`${ae}-home-brand`,"data-testid":S.homeBrand,children:o.brandName}):r("span",{class:`${ae}-home-brand-spacer`,"aria-hidden":"true"}),r("div",{class:`${ae}-home-hero-actions`,children:[f.length>0?r("div",{class:`${ae}-home-avatars`,children:f.map(b=>r("span",{class:`${ae}-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:Mo(b.name)})},b.name))}):null,r(qe,{panelProps:l,variant:"plain"})]})]}),o.showGreeting!==!1?r(oe,{children:[r("h1",{class:`${ae}-home-greeting`,"data-testid":S.homeGreeting,children:g.title}),g.subtitle?r("p",{class:`${ae}-home-lead`,children:g.subtitle}):null]}):null]}),r("div",{class:`${ae}-home-cards`,children:[o.showSearchBar!==!1?r(vc,{placeholder:n.homeSearchPlaceholder,onActivate:()=>i.switchToLayout("help")}):null,s?r(vi,{onClick:()=>i.selectConversation(s.conversationId),testid:S.homeRecent,children:r("div",{class:`${ae}-home-recent-row`,"data-unread":(s.unreadCount??0)>0?"true":void 0,children:[r("span",{class:`${ae}-home-recent-avatar`,"aria-hidden":"true",children:r(yn,{})}),r("span",{class:`${ae}-home-recent-body`,children:[r("span",{class:`${ae}-home-recent-title`,children:s.title}),s.preview?r("span",{class:`${ae}-home-recent-preview`,children:s.preview}):null]}),(s.unreadCount??0)>0?r("span",{class:`${ae}-home-recent-dot`,"aria-label":"Unread"}):null]})}):null,p?r(vi,{onClick:p.url?()=>i.push({kind:"iframe",url:p.url,title:y}):void 0,children:r("div",{class:`${ae}-home-status`,"data-level":p.level??"operational",children:[r("span",{class:`${ae}-home-status-icon`,"aria-hidden":"true",children:r(pl,{})}),r("span",{class:`${ae}-home-status-text`,children:y})]})}):null,d.length>0?r("section",{class:`${ae}-home-content`,children:[r("div",{class:`${ae}-home-content-title`,children:v}),r("div",{class:`${ae}-home-content-list`,children:d.map(b=>r(Ko,{title:b.title,subtitle:b.description,onClick:()=>Zp(i,b),testid:Pe(S.homeContentRow,b.id)},b.id))})]}):null]})]})})}var Cc={Icon:ml,Root:e=>r(em,{...e})};var _t=P.cssPrefix,tm=F.scope("news");function nm({transport:e,strings:t,config:n,nav:o,bus:i,panelProps:a}){let l=n.contentTags,[s,c]=I("loading"),[d,u]=I(t.errorGeneric),[_,g]=I([]),[f,p]=I(0);R(()=>{let v=!1;return c("loading"),e.listContent({tags:l,sortBy:"publishedAt",sortOrder:"desc"}).then(b=>{if(v)return;let w=b.items??[];g(w),c("loaded"),i.emit("contentView",{section:"news",tags:l?.join(","),count:w.length})}).catch(b=>{v||(tm.warn("listContent (news) failed",{err:b}),u(Pt(b,t)),c("error"))}),()=>{v=!0}},[e,l,f,i]);function y(){return s==="loading"?r(ze,{message:t.newsLoading,strings:t}):s==="error"?r(ze,{tone:"error",message:d,onRetry:()=>p(v=>v+1),strings:t}):_.length===0?r(ze,{message:t.newsEmpty,strings:t}):r("div",{class:`${_t}-news-list`,children:_.map(v=>r("button",{type:"button",class:`${_t}-news-card`,onClick:()=>o.push({kind:"content",id:v.id,title:v.title}),"data-testid":Pe(S.newsItem,v.id),children:[v.image?r("img",{class:`${_t}-news-hero`,src:v.image,alt:"",loading:"lazy"}):null,r("span",{class:`${_t}-news-body`,children:[r("span",{class:`${_t}-news-title`,children:v.title}),v.description?r("span",{class:`${_t}-news-summary`,children:v.description}):null]})]},v.id))})}return r("div",{class:`${_t}-module`,children:[r(qo,{title:t.newsTitle,actions:r(qe,{panelProps:a,variant:"plain"})}),r("div",{class:`${_t}-module-scroll`,children:y()})]})}var Ec={Icon:fl,Root:e=>r(nm,{...e})};var jo={chat:hc,home:Cc,help:Sc,news:Ec};var En=P.cssPrefix;function Tc({modules:e,activeTab:t,strings:n,unreadCount:o,onSelect:i}){return r("nav",{class:`${En}-tabbar`,role:"tablist","aria-label":n.panelTitle,children:e.map(a=>{let l=jo[a.layout].Icon,s=a.id===t,c=a.layout==="chat"&&o>0?o>9?"9+":String(o):null;return r("button",{type:"button",role:"tab","aria-selected":s,class:`${En}-tab`,onClick:()=>i(a.id),"data-testid":Pe(S.tab,a.id),children:[r("span",{class:`${En}-tab-icon`,"aria-hidden":"true",children:[r(l,{}),c?r("span",{class:`${En}-tab-badge`,"data-testid":S.tabBadge,children:c}):null]}),r("span",{class:`${En}-tab-label`,children:Ee(n,a.label)})]},a.id)})})}var Rc=P.cssPrefix,om="allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";function Ic({url:e,title:t,strings:n,onBack:o,actions:i}){return r("div",{class:`${Rc}-module`,children:[r(Go,{title:t||n.moduleBack,backLabel:n.moduleBack,onBack:o,actions:i}),r("iframe",{class:`${Rc}-content-frame`,src:e,title:t||"content",sandbox:om,referrerpolicy:"no-referrer",loading:"lazy",allow:"fullscreen"})]})}var Tn=P.cssPrefix,rm=F.scope("content"),im=5e3;function Ac({id:e,title:t,transport:n,strings:o,bus:i,onBack:a,actions:l}){let[s,c]=I(null),[d,u]=I(!1),[_,g]=I(0),f=D(()=>{u(!1),c(null),g(v=>v+1)},[]);R(()=>{let v=!1;return n.listContent({ids:[e],limit:1}).then(b=>{if(v)return;let w=b.items[0];w?(c(w),i.emit("contentOpen",{contentId:e,tags:w.tags?.length?w.tags.join(","):void 0})):u(!0)}).catch(b=>{v||(rm.warn("listContent (reader) failed",{err:b}),u(!0))}),()=>{v=!0}},[n,e,_,i]),R(()=>{if(!s)return;let v=setTimeout(()=>i.emit("contentRead",{contentId:e}),im);return()=>clearTimeout(v)},[s,e,i]);let p=D(v=>{let w=v.target?.closest?.("a")?.getAttribute("href")??"";w&&!w.startsWith("#")&&i.emit("contentLinkClick",{contentId:e})},[i,e]);function y(){return d?r(ze,{tone:"error",message:o.errorGeneric,onRetry:f,strings:o}):s===null?r(ze,{message:o.contentLoading,strings:o}):r("article",{class:`${Tn}-content`,"data-testid":S.contentView,onClick:p,children:[s.image?r("img",{class:`${Tn}-content-hero`,src:s.image,alt:"",loading:"lazy"}):null,s.description?r("p",{class:`${Tn}-content-subtitle`,children:s.description}):null,r(Kl,{text:s.content??""})]})}return r("div",{class:`${Tn}-module`,children:[r(Go,{title:s?.title||t||o.moduleBack,backLabel:o.moduleBack,onBack:a,actions:l,testid:S.backHeader}),r("div",{class:`${Tn}-module-scroll`,"data-testid":S.contentScroll,children:y()})]})}var Yo=P.cssPrefix;function Lc({panelProps:e,enabledModules:t,nav:n,bus:o,unreadCount:i,onSelectConversation:a,onStartNewConversation:l,onSetPanelSize:s}){let c=e.options,d=c.strings,u=N(null),_=N(new Set);R(()=>{let X=u.current;if(!X)return;let he=Lo(X),C=q=>{q.key==="Escape"&&e.onClose?.()};return X.addEventListener("keydown",C),()=>{he(),X.removeEventListener("keydown",C)}},[e.onClose]);let g=N(null),f=D(X=>{g.current?.attachFromDrop(X)},[]),{visible:p}=Oo({containerRef:u,onDrop:f});Io(u.current,c.mode==="modal");let y=Y(()=>n.sig.value).value,v=fc(y),b=c.modules.byId[y.activeTab],w=v?.kind==="iframe"||v?.kind==="content",x=t.length>1&&(gc(y)||!w),E=N(null);R(()=>{if(w&&E.current===null)E.current=e.panelSize,e.panelSize==="normal"&&s("expanded");else if(!w&&E.current!==null){let X=E.current;E.current=null,s(X)}},[w]);let V={push:n.push,pop:n.pop,switchTab:n.switchTab,switchToLayout:X=>{let he=t.find(C=>C.layout===X);he&&n.switchTab(he.id)},selectConversation:a,startNewConversation:l},se=X=>({options:c,transport:e.transport,strings:d,config:X,visitorId:e.visitorId,nav:V,bus:o,panelProps:e}),O=r(qe,{panelProps:e,variant:"plain"});b&&_.current.add(b.id);let Z=t.filter(X=>_.current.has(X.id)),B=X=>{if(X.layout==="chat")return r(gi,{...e,containerEl:u.current,dragOver:p,composerAttachApiRef:g});let he=jo[X.layout].Root;return he?r(he,{...se(X)}):null},j=()=>v?.kind==="iframe"?r(Ic,{url:v.url,title:v.title,strings:d,onBack:n.pop,actions:O}):v?.kind==="content"?r(Ac,{id:v.id,title:v.title,transport:e.transport,strings:d,bus:o,onBack:n.pop,actions:O}):null;return r("div",{ref:u,class:`${Yo}-panel ${Yo}-messenger`,role:"dialog","aria-modal":"false","aria-label":d.panelTitle,style:{position:"relative"},"data-testid":S.messengerHome,children:[r("div",{class:`${Yo}-messenger-body`,children:[Z.map(X=>r("div",{class:`${Yo}-messenger-pane`,hidden:w||X.id!==b?.id,children:B(X)},X.id)),j()]}),x?r(Tc,{modules:t,activeTab:y.activeTab,strings:d,unreadCount:i,onSelect:n.switchTab}):null,r(hi,{poweredBy:c.poweredBy}),c.size.resize?.enabled&&!(b?.layout==="chat"&&!v)?r(Ro,{panelEl:u.current,resize:c.size.resize,position:c.position,initialSize:e.initialWidgetSize,onSizeChange:e.onWidgetSizeChange,strings:d}):null]})}var Rn=P.cssPrefix;function Mc({strings:e,onClose:t}){return r("div",{class:`${Rn}-panel ${Rn}-modules-empty`,role:"dialog","aria-label":e.panelTitle,"data-testid":S.modulesEmpty,children:[t?r("button",{type:"button",class:`${Rn}-icon-btn ${Rn}-modules-empty-close`,onClick:t,"aria-label":e.close,title:e.close,children:r(Ve,{})}):null,r("p",{class:`${Rn}-modules-empty-text`,children:e.modulesEmpty})]})}function Nc({callout:e,persistence:t}){let n=e?.text??"",o=e?.persistent??!0,[i,a]=I(()=>o?!1:t.loadCalloutDismissed(n));R(()=>{a(o?!1:t.loadCalloutDismissed(n))},[n,o,t]);let l=D(()=>{a(!0),o||t.saveCalloutDismissed(n)},[t,n,o]);return{dismissed:i,dismissCallout:l}}var W=F.scope("app"),Xo=P.cssPrefix;function Oc(e,t){return Ds({...e,text:Ee(t,e.text)})}function am(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 Dc(e){return e instanceof DOMException?e.name==="AbortError":e?.name==="AbortError"}function $c({options:e,hostElement:t,bus:n}){let[o]=I(()=>st(e.widgetId,e.storage,e.aiAgentDeploymentId)),[i,a]=I(()=>o.getVisitorId()),l=o.loadUserPrefs(),[s,c]=I(()=>l.locale??e.locale),[d,u]=I(()=>l.themeMode??e.themeMode),[_,g]=I(()=>l.textSize??e.textSize),f=fn(o.loadConversationId()),p=fn([]),y=fn(0),[v,b]=I(!1),[w,x]=I([]);function E(){let m=e.modules.list,h=new Set(m.map(M=>M.id)),T=o.loadActiveModule();return T&&h.has(T)?T:m[0]?.id??""}function V(){return e.modules.list.find(m=>m.layout==="chat")?.id}let se=N();if(!se.current){let m=e.modules.list.map(h=>h.id);se.current=pc(E(),m,h=>o.saveActiveModule(h))}let O=se.current,Z=N(void 0);Z.current=V();let[B,j]=I(!1),[X,he]=I(null),[C,q]=I(!1),ne=e.mode==="standalone"||e.mode==="inline",fe=N(gn(e,zt(),o.loadPanelOpen(),o.loadPanelSize())),[le,Ne]=I(fe.current.panelOpen),[_e,k]=I(fe.current.panelOpen),K=N(_e);K.current=_e;let ve=N(!1),Ae=N(void 0);R(()=>{le&&k(!0)},[le]);let Ce=N(!1),[nt,jt]=I(!1),{dismissed:Ct,dismissCallout:Yt}=Nc({callout:e.launcher.callout,persistence:o}),Ue=e.launcher.callout?.persistent??!0,Et=D(()=>{W.info("calloutDismiss"),n.emit("calloutDismiss",void 0),Yt()},[n,Yt]),[ye,ut]=I(fe.current.panelSize),Ii=N(!1),[Gc,tr]=I("chat"),[Xt,Jt]=I(!0),[Se,In]=I(!1),[Kc,Ai]=I(null),[nr,An]=I([]),[Li,Ln]=I(null),[Mn,Nn]=I(null),On=N(e.strings),[jc,Yc]=I(void 0),[Xc,Jc]=I(void 0),[Qc,Zc]=I(()=>o.loadSidebarCollapsed()??!1),[or,ed]=I({}),[G]=I(()=>new xo({agentApiBaseUrl:e.agentApiBaseUrl,dataApiBaseUrl:e.dataApiBaseUrl,auth:ys({publicKey:e.publicKey,aiAgentDeploymentId:e.aiAgentDeploymentId,publicKeyHeader:"x-public-key"}),endpoints:e.endpoints})),[Re]=I(()=>new So(p)),[ie]=I(()=>new Co(e.sound,e.haptics)),We=D(m=>{o.patchUserPrefs(m),G.saveUserPrefs(o.loadUserPrefs()).catch(h=>{W.warn("saveUserPrefs failed",{err:h})})},[o,G]);R(()=>{l.soundMuted!==void 0&&ie.setMuted(l.soundMuted)},[]),R(()=>{t.dataset.theme=d},[t,d,e]),R(()=>{t.dataset.textSize=_},[t,_,e]),R(()=>{ie.update(e.sound,e.haptics)},[ie,e.sound,e.haptics]),R(()=>()=>ie.destroy(),[ie]),R(()=>{let m=!0;return ie.mutedSig.subscribe(h=>{if(m){m=!1;return}We({soundMuted:h})})},[ie,We]),R(()=>{Ii.current||!e.size.initialSize||(Ii.current=!0,!o.loadPanelSize()&&ut(Kr(e.mode,e.size,zt())))},[e.mode,e.size,o]),R(()=>{if(!B||Ce.current)return;Ce.current=!0;let m=gn(e,zt(),o.loadPanelOpen(),o.loadPanelSize());Ne(m.panelOpen),ut(m.panelSize)},[B,e,o]);let Mi=N(!1),Ni=N(!1),Qt=N(null),rr=N(null),ir=N(!1);R(()=>{if(!(!B||Mi.current)){if(Mi.current=!0,Ni.current){let m=Z.current;m&&O.switchTab(m);return}O.reset(E())}},[B]);let Dn=D(m=>{!m||m.length===0||(p.value=m.map(h=>Oc(h,On.current)))},[p]),ar=N(null),$n=D(async m=>{try{let{formSubmissions:h}=await(m?G.bootstrap(m):ar.current??G.bootstrap()),T=new Map;return h.forEach((M,z)=>T.set(M.formId,z)),h.filter((M,z)=>!M.skipped||T.get(M.formId)===z).map((M,z)=>({key:`wire:${M.formId}:${M.createdAt??z}`,formId:M.formId,outcome:M.skipped?"skipped":"submitted",createdAt:bo(M.createdAt),values:M.values}))}catch(h){return W.debug("bootstrap failed \u2014 no form markers (non-fatal)",{err:h}),[]}},[G]),Zt=N(0),en=D((m,h)=>{let T=[...m.map(A=>A.createdAt),...h.map(A=>A.createdAt)].filter(A=>A!==void 0),M=(T.length?Math.min(...T):Date.now())-1;return[...(Ae.current?.messages??[]).map(A=>{let be=Oc(A,On.current);return be.createdAt=M,be}),...m]},[]),sr=D(async m=>{let h=Zt.current,T=()=>h!==Zt.current;b(!0);try{let[M,z]=await Promise.all([G.loadConversation(m),$n()]);if(T())return;let A=(M.messages??[]).map(Jr);x(z);let be=Qt.current?[Qt.current]:[];A.length||be.length?(p.value=[...en(A,z),...be],Jt(M.canContinue??!0),An(M.suggestions??[])):p.value=en([],z),G.resumeStatus==="needs-generation"&&rr.current?.()}catch(M){if(T())return;W.warn("loadThread failed; resetting conversationId",{err:M,conversationId:m}),f.value=void 0,o.saveConversationId(void 0)}finally{T()||b(!1)}},[G,$n,p,f,o,en]),tn=D(async({newConversation:m})=>{let h=++Zt.current,T=()=>h!==Zt.current,M=f.value,z=m||!M?He():M;z!==M&&(f.value=z,o.saveConversationId(z));let A;try{A=await G.handshake({visitorId:i,conversationId:z,userPrefs:o.loadUserPrefs(),locale:s})}catch(je){if(T())return;n.emit("error",je),e.onError?.(je),m||j(!0);return}if(T())return;if(A.visitorId&&A.visitorId!==i&&(W.info("visitor rebound",{previous:i,current:A.visitorId,reason:A.rebind?.visitorId}),o.setVisitorId(A.visitorId),a(A.visitorId),n.emit("visitorRebound",{previous:i,current:A.visitorId,reason:A.rebind?.visitorId})),A.conversationId&&A.conversationId!==z&&(W.info("conversation rebound",{previous:z,current:A.conversationId,reason:A.rebind?.conversationId}),n.emit("conversationRebound",{previous:z,current:A.conversationId,reason:A.rebind?.conversationId})),A.agent&&Ai(A.agent),e.mode==="page"&&(A.site&&xs(A.site)?Yc(A.site):A.site&&W.warn("invalid site config, using fallback",{site:A.site}),A.blocks&&Ps(A.blocks)?Jc(A.blocks):A.blocks&&W.warn("invalid blocks config, using fallback",{blocks:A.blocks})),A.userPrefs&&!m&&(o.saveUserPrefs(A.userPrefs),A.userPrefs.locale&&c(A.userPrefs.locale),A.userPrefs.soundMuted!==void 0&&ie.setMuted(A.userPrefs.soundMuted),A.userPrefs.themeMode&&u(A.userPrefs.themeMode),A.userPrefs.textSize&&g(A.userPrefs.textSize)),Ae.current=A.welcome,m||n.emit("handshake",A),A.welcome?.suggestions){let je=On.current;An(A.welcome.suggestions.map($e=>({...$e,label:Ee(je,$e.label),...$e.text===void 0?{}:{text:Ee(je,$e.text)}})))}!m&&M&&A.conversationId===M?K.current?sr(M):ve.current=!0:(f.value=A.conversationId,o.saveConversationId(A.conversationId),Dn(A.welcome?.messages)),m||j(!0)},[G,i,o,e,n,f,ie,Dn,sr,s]),nn=JSON.stringify(e.userContext??null),td=JSON.stringify(e.pageContext??null),nd=JSON.stringify(or);R(()=>{let m=Object.keys(or).length?{...or,...e.userContext}:e.userContext;G.setContext(m,sm(e.pageContext))},[G,nn,td,nd]);let Oe=At(s,e.availableLocales,e.defaultLocale);R(()=>{G.setLocale(Oe)},[G,Oe]),R(()=>{t.dir=Qi(Oe)?"rtl":"ltr"},[t,Oe]),R(()=>{Oe!==s&&c(Oe)},[Oe,s]);let Hn=D(m=>{if(m.type!=="data-conversation-rebind")return!1;let h=m.data?.conversationId;if(h&&h!==f.value){let T=f.value;f.value=h,o.saveConversationId(h),G.primeIdentity(void 0,h),W.info("conversation rebound (in-stream)",{previous:T,current:h}),T&&n.emit("conversationRebound",{previous:T,current:h,reason:h})}return!0},[f,o,G,n]),Oi=D(async m=>{let h=null;try{for await(let T of m.iter)if(!Hn(T.chunk)){if(!h){h=hn(),Qt.current=h,Re.attach(h),p.value=[...p.value,h],In(!0),Ln(()=>m.cancel),Nn(()=>m.detach),Ni.current=!0;let M=Z.current;M&&O.switchTab(M),W.info("resumed in-flight reply on mount")}Re.apply(T.chunk),T.chunk.type==="finish"&&T.chunk.canContinue===!1&&Jt(!1)}h&&(h.status==="error"||Qe(h)?(h.status="error",h.errorText=e.strings.errorGeneric,ie.play("error")):(h.status="complete",ie.play("messageReceived"),bi(n,e,"assistant",Po(h))))}catch(T){h&&(Dc(T)?yo(h)?p.value=p.value.filter(M=>M!==h):h.status="complete":(h.status="error",h.errorText=Pt(T,e.strings),ie.play("error"))),W.debug("resume ended without completing",{err:T})}finally{Qt.current=null,h&&(Re.detach(),In(!1),Ln(null),Nn(null),p.value=[...p.value])}},[Re,p,ie,n,e,O,Hn]),Di=N(null),lr=D(async()=>{let m=G.resumeStream();Di.current=m,await Oi(m),G.resumeStatus==="needs-generation"&&rr.current?.()},[G,Oi]);R(()=>{let m=f.value;return m&&G.primeIdentity(i,m),tn({newConversation:!1}),()=>{Zt.current++,Di.current?.cancel()}},[]),R(()=>{_e&&(ar.current=G.bootstrap(),(async()=>{try{let m=await ar.current;he(ln((m??{forms:[]}).forms,Oe))}catch(m){W.debug("bootstrap failed \u2014 treating as no forms",{err:m})}finally{q(!0)}})(),(async()=>{let m=[];if(ve.current){ve.current=!1;let h=f.value;h&&m.push(sr(h))}f.value&&m.push(lr()),m.length!==0&&await Promise.allSettled(m)})())},[_e]);let Bn=N(null);R(()=>{if(!_e)return;if(Bn.current===null){Bn.current=Oe;return}if(Bn.current===Oe)return;Bn.current=Oe;let m=!1;return G.bootstrap().then(h=>{m||he(ln((h??{forms:[]}).forms,Oe))}).catch(h=>W.debug("forms re-localize failed \u2014 keeping current copy",{err:h})),()=>{m=!0}},[_e,Oe,G]);let $i=N(nn);R(()=>{!B||$i.current===nn||($i.current=nn,tn({newConversation:!1}))},[nn,B,tn]),vt(()=>{ao(t,vo(e.mode,ye,le))},[t,le,ye,e.mode]),R(()=>{if(e.mode!=="modal"||!le)return;let m=h=>{h.composedPath().some(z=>z instanceof HTMLElement&&z.classList.contains(`${P.cssPrefix}-panel`))||Ne(!1)};return t.addEventListener("click",m),()=>t.removeEventListener("click",m)},[t,le,e.mode]),R(()=>{if(e.mode!=="drawer"||!le)return;let m=h=>{h.key==="Escape"&&Ne(!1)};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[le,e.mode]);let ot=D(async(m,{continueExisting:h})=>{let T=f.value??He();f.value||(f.value=T,o.saveConversationId(T));let M=(h?p.value:p.value.slice(0,-1)).filter(be=>!be.ephemeral),z=Rs({messages:M.map($s),conversationId:T,tools:e.features.tools,visitorId:i,userPrefs:o.loadUserPrefs()});In(!0);let A=G.sendMessage(z);Ln(()=>A.cancel),Nn(()=>A.detach);try{for await(let $e of A.iter)Hn($e.chunk)||(Re.apply($e.chunk),$e.chunk.type==="finish"&&$e.chunk.canContinue===!1&&Jt(!1));let be=m.status==="error",je=Qe(m);if(be||je){m.status="error",m.errorText=e.strings.errorGeneric,ie.play("error");let $e=new Error(be?"stream error chunk":"empty reply");n.emit("error",$e),e.onError?.($e)}else m.status="complete",ie.play("messageReceived"),bi(n,e,"assistant",Po(m))}catch(be){Dc(be)?yo(m)?p.value=p.value.filter(je=>je!==m):m.status="complete":(m.status="error",m.errorText=Pt(be,e.strings),ie.play("error"),n.emit("error",be),e.onError?.(be))}finally{Re.detach(),In(!1),Ln(null),Nn(null),p.value=[...p.value]}},[G,Re,p,f,e,n,ie,o,i,Hn]),Hi=D(()=>{if(Se||ir.current||Qt.current||p.value.filter(T=>!T.ephemeral).at(-1)?.role!=="user")return;ir.current=!0,W.info("regenerating dangling user turn (needs-generation)");let h=hn();p.value=[...p.value,h],Re.attach(h),ot(h,{continueExisting:!1}).finally(()=>{ir.current=!1})},[Se,p,Re,ot]);R(()=>{rr.current=Hi},[Hi]);let Fn=D((m,h)=>{if(Se)return;let T=p.value.at(-1),M=T?.partsSig.value.find(z=>z.kind==="tool"&&z.toolCallId===m);if(!T||!M){W.warn("decideTool: tool part not found",{toolCallId:m});return}h(M),T.partsSig.value=[...T.partsSig.value],am(T)&&(T.status="streaming",Re.attach(T),ot(T,{continueExisting:!0}))},[Se,p,Re,ot]),Bi=D((m,h)=>{W.info("toolResult",{toolCallId:m}),n.emit("toolResult",{toolCallId:m}),Fn(m,T=>{T.outputSig.value=h,T.stateSig.value="output-available"})},[n,Fn]),Fi=D((m,h,T)=>{W.info("toolDecision",{toolCallId:m,approved:h}),n.emit("toolDecision",{toolCallId:m,approved:h}),Fn(m,M=>{let z=M.approvalSig.value?.id??m;M.approvalSig.value={id:z,approved:h,reason:T},M.stateSig.value="approval-responded"})},[n,Fn]),zi=D(m=>{if(Se)return;let h=p.value.at(-1),T=h?.partsSig.value.find(z=>z.kind==="tool"&&z.toolCallId===m);if(!h||!T)return;let M=T.approvalSig.value?.id??m;T.approvalSig.value={id:M},T.stateSig.value="approval-requested",h.partsSig.value=[...h.partsSig.value]},[Se,p]),od=Te(()=>({humanInLoop:e.features.humanInLoop,onResult:Bi,onDecision:Fi,onEdit:zi}),[e.features.humanInLoop,Bi,Fi,zi]),rd=()=>p.value.reduce((m,h)=>m+(h.role==="user"?1:0),0),Tt=e.forms.list.length>0?e.forms:X??e.forms,ue=lc({forms:Tt,persistence:o,userContext:()=>e.userContext,messageCount:rd,pageArea:()=>e.pageContext?.area?String(e.pageContext.area):void 0,conversationId:()=>f.value,onComplete:(m,h,T,M)=>{W.info("formSubmit",{formId:m.id,trigger:h,skipped:M}),n.emit("formSubmit",{formId:m.id,values:T,skipped:M}),x(A=>[...A.filter(be=>!(be.formId===m.id&&be.outcome==="skipped")),{key:`local:${m.id}:${Date.now()}`,formId:m.id,outcome:M?"skipped":"submitted",createdAt:Date.now(),...M?{}:{values:T}}]);let z=f.value??He();f.value||(f.value=z,o.saveConversationId(z),G.primeIdentity(void 0,z)),!M&&m.mirrorToContext&&ed(A=>({...A,...T})),G.submitForm({formId:m.id,conversationId:z,trigger:h,values:T,skipped:M})}}),id=Y(()=>ue.activeForm.value);R(()=>{ue.refresh()},[Tt,ue]);let Ui=e.pageContext?.area?String(e.pageContext.area):void 0,ad=Y(()=>p.value.length);R(()=>{B&&C&&ue.fire("pre-chat")},[B,C,ue]),R(()=>{C&&!Xt&&ue.fire("conversation-closed")},[C,Xt,ue]),R(()=>{B&&C&&Ui&&ue.fire("page-area")},[B,C,Ui,ue]);let cr=Te(()=>{let m=Tt.list.flatMap(h=>h.triggers).filter(h=>h.kind==="idle").map(h=>Number(h.param));return m.length?Math.min(...m)*1e3:0},[Tt]);R(()=>{if(!cr||!le)return;let m=setTimeout(()=>ue.fire("idle"),cr);return()=>clearTimeout(m)},[cr,le,ue,ad.value]);let Wi=D(async(m,h)=>{if(W.info("send",{textLen:m.length,attachments:h.length,streaming:Se}),Se)return;n.emit("send",{text:m,attachmentCount:h.length}),nr.length>0&&An([]);let T=await cm(G,h,A=>{W.warn("upload failed",{err:A}),n.emit("error",A),e.onError?.(A)});ie.unlock(),ie.play("messageSent");let M=Os(m,T),z=hn();p.value=[...p.value,M,z],Re.attach(z),bi(n,e,"user",m),await ot(z,{continueExisting:!1}),ue.fire("after-messages")},[Se,G,n,e,nr.length,p,Re,ot,ue]),sd=D(()=>{W.info("stop"),n.emit("stop",void 0),Li?.()},[Li,n]),ld=D(()=>{if(Se)return;let m=p.value,h=m.at(-1);if(!h||h.role!=="assistant"||h.status!=="error"&&!Qe(h))return;let T=hn();p.value=[...m.slice(0,-1),T],Re.attach(T),W.info("retry"),ot(T,{continueExisting:!1})},[Se,p,Re,ot]),cd=D(()=>{ie.toggleMuted();let m=ie.mutedSig.value;W.info("soundToggle",{muted:m}),n.emit("soundToggle",{muted:m})},[ie,n]),on=D(()=>{if(El(e.mode,ye)==="exit-fullscreen"){W.info("close \u2192 exit-fullscreen",{mode:e.mode}),ut("normal"),n.emit("fullscreen",!1);return}W.info("close \u2192 panel closed",{mode:e.mode}),ue.fire("panel-close"),Ne(!1),o.savePanelOpen(!1),n.emit("close",void 0),e.onClose?.()},[n,e,o,ye,ue]),Rt=D(()=>{e.modules.list.some(m=>m.layout==="chat")&&G.listConversations({limit:50}).then(m=>{y.value=m.conversations.reduce((h,T)=>h+(T.unreadCount??0),0)}).catch(m=>W.debug("refreshUnread failed (non-fatal)",{err:m}))},[G,e.modules,y]),Vi=N(!1);R(()=>{!_e||!B||Vi.current||(Vi.current=!0,Rt())},[_e,B,Rt]);let dr=D(()=>{W.info("open",{mode:e.mode}),ie.unlock(),jt(!0),Ne(!0),o.savePanelOpen(!0),!Ct&&!Ue&&Et(),setTimeout(()=>jt(!1),lm),Rt(),n.emit("open",void 0),e.onOpen?.()},[n,e,ie,o,Ct,Ue,Et,Rt]),_r=D(()=>{if(!p.value.some(h=>h.role==="user")&&Xt&&f.value){W.info("clear \u2192 reusing empty conversation",{conversationId:f.value}),p.value.length===0&&Dn(Ae.current?.messages);return}W.info("clear \u2192 new conversation",{wasStreaming:Se}),n.emit("clear",void 0),Se&&Mn?.(),Ht(()=>{p.value=[],f.value=void 0}),o.clearConversation(),Jt(!0),x([]),tn({newConversation:!0})},[Se,Mn,p,f,o,tn,n,Xt,Dn]),ur=D(()=>{_r(),tr("chat");let m=e.modules.list.find(h=>h.layout==="chat")?.id;m&&O.switchTab(m)},[_r,O,e]),pr=D(()=>{let m=ye==="expanded"?"normal":"expanded";W.info("expand",{from:ye,expanded:m==="expanded"}),ut(m),o.savePanelSize(m),n.emit("expand",m==="expanded")},[n,ye,o]),mr=D(()=>{let m=ye==="fullscreen"?"normal":"fullscreen";W.info("fullscreen",{from:ye,fullscreen:m==="fullscreen"}),ut(m),o.savePanelSize(m),n.emit("fullscreen",m==="fullscreen")},[n,ye,o]),dd=D(()=>{tr(m=>{let h=m==="history"?"chat":"history";return W.info("toggleHistory",{view:h}),n.emit("toggleHistory",{view:h}),h})},[n]),_d=D(m=>{W.info("localeChange",{locale:m}),c(m),We({locale:m}),n.emit("localeChange",m)},[We,n]),ud=D(m=>{W.info("themeChange",{mode:m}),u(m),t.dataset.theme=m,We({themeMode:m}),n.emit("themeChange",m)},[t,We,n]),pd=D(m=>{W.info("textSizeChange",{size:m}),g(m),t.dataset.textSize=m,We({textSize:m}),n.emit("textSizeChange",m)},[t,We,n]),md=D(()=>{Zc(m=>{let h=!m;return W.info("sidebarToggle",{collapsed:h}),o.saveSidebarCollapsed(h),n.emit("sidebarToggle",{collapsed:h}),h})},[o,n]),fd=D(m=>{W.info("resize",m),We({widgetSize:m}),n.emit("resize",m)},[We,n]),fr=D(async m=>{W.info("selectConversation",{conversationId:m,wasStreaming:Se}),n.emit("selectConversation",{conversationId:m}),Se&&Mn?.();try{let[h,T]=await Promise.all([G.loadConversation(m),$n(m)]),M=h.messages.map(Jr);Ht(()=>{p.value=en(M,T),f.value=h.conversationId}),x(T),o.saveConversationId(h.conversationId),G.primeIdentity(i,h.conversationId),h.agent&&Ai(h.agent),Jt(h.canContinue),An(h.suggestions??[]),tr("chat"),lr(),await G.markRead(m),Rt()}catch(h){n.emit("error",h),e.onError?.(h)}},[G,p,f,n,e,o,Rt,$n,en,Se,Mn,i,lr]),zn=N(null),qi=D(m=>{typeof m=="string"&&(C?ue.fire("manual",m):zn.current=m)},[C,ue]);R(()=>{!C||!zn.current||(ue.fire("manual",zn.current),zn.current=null)},[C,ue]),R(()=>Ba(t,{open:dr,close:on,expand:pr,fullscreen:mr,openForm:qi}),[t,dr,on,pr,mr,qi]);let Le=Te(()=>Tr(e,s,d,_),[e,s,d,_]);On.current=Le.strings;let gd=Te(()=>w.map(m=>{let h=Tt.list.find(T=>T.id===m.formId);return{...m,title:h?.title,form:h}}),[w,Tt]),Gi={options:Le,transport:G,feedback:ie,bus:n,persistence:o,view:Gc,canSend:Xt,isStreaming:Se,loadingMessages:v,messagesSig:p,agent:Kc,suggestions:nr,initialWidgetSize:l.widgetSize??null,visitorId:i,onClose:on,onClear:_r,onExpand:pr,onFullscreen:mr,onSoundToggle:cd,onToggleHistory:dd,onSelectHistoryConversation:fr,onNewConversation:ur,onLocaleChange:_d,onThemeChange:ud,onTextSizeChange:pd,onWidgetSizeChange:fd,onSend:Wi,onStop:sd,onSuggestion:m=>{let h=m.text??m.label;W.info("suggestion",{text:h}),n.emit("suggestion",{text:h}),Wi(h,[])},activeForm:id.value?.form??null,formMarkers:gd,onFormSubmit:ue.complete,onFormSkip:ue.skip,onFormFill:m=>ue.fire("manual",m),tool:od,onRetry:ld},hd=m=>{fr(m);let h=V();h&&O.switchTab(h)};if(!B)return null;let rn=Le.modules.list,gr=m=>{let h=Sn("close",Le.mode,m);return rn.length===0?r(Mc,{strings:Le.strings,onClose:h?on:void 0}):rn.length===1&&rn[0]?.layout==="chat"?r(sc,{...Gi,panelSize:m}):r(Lc,{panelProps:{...Gi,panelSize:m,onClose:h?on:void 0},enabledModules:rn,nav:O,bus:n,unreadCount:y.value,onSelectConversation:hd,onStartNewConversation:ur,onSetPanelSize:ut})};if(e.mode==="page"){let m=T=>{fr(T.conversationId)},h=rn.some(T=>T.layout==="chat");return r("div",{class:`${Xo}-anchor`,children:r(_c,{site:jc,blocks:Xc,transport:G,strings:Le.strings,locale:Le.locale,persistence:o,visitorId:i,showConversations:h,onSelectConversation:m,onNewConversation:ur,sidebarCollapsed:Qc,onToggleSidebarCollapsed:md,children:gr("fullscreen")})})}if(ne){let m=e.mode==="standalone"?"fullscreen":ye;return r("div",{class:`${Xo}-anchor`,children:gr(m)})}let Ki=e.mode==="drawer",ji=!(e.mode==="modal")&&!e.launcher.hidden&&(!le||nt),Yi=ji&&!nt&&!Ct&&!Ki?Le.launcher.callout:null;return r("div",{class:`${Xo}-anchor`,"data-launcher-size":Le.launcher.size,children:[le||_e?r("div",{class:`${Xo}-surface`,hidden:!le,children:gr(ye)}):null,ji?r(wl,{onToggle:dr,launcher:Le.launcher,strings:Le.strings,leaving:nt,edgeTab:Ki}):null,Yi?r(kl,{callout:Yi,launcherPosition:Le.position,strings:Le.strings,closeLabel:Le.strings.close,onDismiss:Et}):null]})}function sm(e){let t=e?.url??(typeof location<"u"?location.href:void 0);if(!(!e&&!t))return{...e,...t?{url:t}:{}}}var lm=120;async function cm(e,t,n){let o=[];for(let i of t)try{let{id:a,url:l}=await e.uploadFile(i.file);o.push({id:a,name:i.name,mediaType:i.mediaType,size:i.size,url:l})}catch(a){n(a)}return o}function bi(e,t,n,o){let i={role:n,text:o};e.emit("message",i),t.onMessage?.(i)}var dm=F.scope("error-boundary"),Jo=class extends at{constructor(){super(...arguments);U(this,"state",{crashed:!1})}componentDidCatch(n,o){dm.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 _m="1",um=60,pm=2e3,Hc={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 mm(){let e=navigator;return e.globalPrivacyControl===!0||e.doNotTrack==="1"}function fm(){return location.origin+location.pathname}function gm(){try{return document.referrer?new URL(document.referrer).origin:""}catch{return""}}function Bc(e,t){let n=Math.random(),o=0,i=0,a=new Set,l=(c,d)=>{let{tracking:u,publicKey:_,aiAgentDeploymentId:g,mode:f,themeMode:p}=t.getOptions();if(!u.enabled||mm()||n>=u.sampleRate)return;let y=performance.now();if(y-o>6e4&&(o=y,i=0),++i>um)return;let v=new URLSearchParams;v.set("v",_m),v.set("_ev",Nt),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",fm());let w=gm();w&&v.set("ref",w),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",p),d)for(let[se,O]of Object.entries(d))O!==void 0&&v.set(se,String(O));v.set("ts",String(Date.now()));let x=`${u.endpoint}?${v}`;if(x.length>pm)return;let E=new Image(1,1);a.add(E);let V=()=>a.delete(E);E.addEventListener("load",V,{once:!0}),E.addEventListener("error",V,{once:!0}),E.src=x},s=Object.keys(Hc).map(c=>e.on(c,d=>l(c,Hc[c]?.(d))));return()=>{for(let c of s)c();a.clear()}}function Qo(e){let{bus:t,host:n,appRoot:o,persistence:i,reportError:a}=e,l=e.initialRaw,s,c=rt(l),d=!0,u=()=>{c=rt(s?Rr(l,s):l)},_=()=>{ja(n,ht(c.mode));let p=i.loadUserPrefs().themeMode;Ya(n,p?{...c,themeMode:p}:c),d&&(ao(n,xi(c)),d=!1)},g=()=>{_(),Mt(io(Jo,{onError:a},io($c,{bus:t,hostElement:n,options:c})),o)};t.on("handshake",p=>{p.config&&(p.config.storageVersion&&i.rememberStorageVersion(p.config.storageVersion),s=p.config,u(),g())});let f=Bc(t,{getOptions:()=>c,getVisitorId:()=>i.getVisitorId(),getConversationId:()=>i.loadConversationId()});return{getOptions:()=>c,getUserOptions:()=>l,render:g,setUserOptions:p=>{l=p,u(),g()},patchUserOptions:p=>{l={...l,...p},u(),g()},destroy:()=>f()}}function xi(e){if(e.mode==="standalone")return"standalone";if(e.mode==="inline")return"inline";let t=st(e.widgetId,e.storage,e.aiAgentDeploymentId),{panelOpen:n,panelSize:o}=gn(e,zt(),t.loadPanelOpen(),t.loadPanelSize());return vo(e.mode,o,n)}var hm=F.scope("hooks"),yi="*",Pi=new Set;function Si(e,t,n){let o={widgetId:e,event:t,listener:n};return Pi.add(o),()=>{Pi.delete(o)}}function vm(e,t,n){let o=[...Pi];for(let i of o)if(bm(i.widgetId,e.widgetId)&&!(i.event!==yi&&i.event!==t))try{i.listener(e,t,n)}catch(a){hm.warn("hook listener threw",{event:t,error:a})}}function Fc(e,t){let n=[];for(let o of xm)n.push(t.on(o,i=>{vm(e,o,i)}));return()=>{for(let o of n)o()}}function wi(e){if(Array.isArray(e))for(let t of e){let n=Pm(t);n&&Si(n.widgetId,n.event,n.listener)}}function bm(e,t){return e===yi||e===t}var xm=["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 Pm(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 tt=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=rt(e),o=n.widgetId,i=tt.get(o);i&&(t.debug("destroy existing instance at slot",{widgetId:o}),i.destroy());let a=xi(n),l=n.iframe?Qa({position:ht(n.mode)},n.position,a,n.mode,e.target??null):Ot({position:ht(n.mode),target:e.target??null});l.hostElement.dataset.widgetId=o;let s=new Dt,c=st(o,n.storage,n.aiAgentDeploymentId),d=y=>{s.emit("error",y),u.getOptions().onError?.(y)},u=Qo({bus:s,host:l.hostElement,appRoot:l.appRoot,persistence:c,initialRaw:e,reportError:d});u.render();let _=l.hostElement,g=null,f=y=>{y.debug!==void 0&&Gn(y.debug),u.patchUserOptions(y)},p={widgetId:o,open:()=>dn(_,"open"),close:()=>dn(_,"close"),expand:()=>dn(_,"expand"),openForm:y=>dn(_,"openForm",y),on:(y,v)=>s.on(y,v),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=>{Gn(y),t.info("debug level set",{level:an()})},debugLevel:()=>an(),onLog:y=>sn(y),destroy:()=>{t.info("destroy",{widgetId:o}),g?.(),u.destroy(),s.clear(),Mt(null,l.appRoot),l.destroy(),tt.get(o)===p&&tt.delete(o)}};return g=Fc(p,s),tt.set(o,p),p}function er(e){let t=e.widgetId??"default",n=tt.get(t);return n?(n.update(e),n):Zo(e)}function ki(e){if(e!==void 0){tt.get(e)?.destroy();return}let t=[...tt.values()];for(let n of t)n.destroy()}function Ke(e="default"){return tt.get(e)??null}function zc(){return[...tt.values()]}function Ci(e,t,n){return Si(e,t,n)}var Uc=Nt;var Ei=class extends HTMLElement{constructor(){super(...arguments);U(this,"bus",new Dt);U(this,"mountResult",null);U(this,"runtime",null)}static get observedAttributes(){return Ir}connectedCallback(){this.boot()}disconnectedCallback(){this.mountResult&&(this.runtime?.destroy(),this.runtime=null,Mt(null,this.mountResult.appRoot),this.bus.clear())}attributeChangedCallback(){this.isConnected&&this.boot()}boot(){let n=Xn(a=>this.getAttribute(a));if(this.runtime){this.runtime.setUserOptions(n);return}let o=rt(n);this.mountResult||(this.mountResult=Ot({existingHost:this,position:ht(o.mode)}));let i=st(o.widgetId,o.storage,o.aiAgentDeploymentId);this.runtime=Qo({bus:this.bus,host:this.mountResult.hostElement,appRoot:this.mountResult.appRoot,persistence:i,initialRaw:n,reportError:a=>this.bus.emit("error",a)}),this.runtime.render()}},Wc=!1;function Ti(){if(Wc||typeof customElements>"u")return;let e=P.tagName;customElements.get(e)||customElements.define(e,Ei),Wc=!0}typeof customElements<"u"&&Ti();var Vc=F.scope("iife"),Ri={close:()=>Ke()?.close(),destroy:()=>ki(),expand:()=>Ke()?.expand(),hook:(e,t,n)=>typeof e=="string"&&typeof t=="string"&&typeof n=="function"?Ci(e,t,n):void 0,init:e=>er(e),mount:e=>Zo(e),on:(e,t)=>Ke()?.on(e,t),onLog:e=>sn(e),open:()=>Ke()?.open(),setDebug:e=>Ke()?.setDebug(e),update:e=>Ke()?.update(e)};function qc(e,...t){let n=Ri[e];if(!n){Vc.warn("unknown command",{command:e});return}return n(...t)}function ym(){let e=((n,...o)=>qc(n,...o));e.init=er,e.mount=Zo,e.destroy=ki,e.getInstance=Ke,e.getAllInstances=zc,e.version=Uc,e.hook=Ci,e.debugLevel=()=>an(),e.onLog=sn;let t=new Set(["init","mount","hook","onLog"]);for(let n of Object.keys(Ri))t.has(n)||(e[n]=(...o)=>Ri[n](...o));return e}function Sm(e){let t=e?.q;if(t)for(let n of t){let o=[...n],[i,...a]=o;if(typeof i=="string")try{qc(i,...a)}catch(l){Vc.warn("queued command failed",{command:i,error:l})}}}function wm(){let e=[],t=e.push.bind(e);return e.push=(...n)=>{for(let o of n)wi([o]);return t(...n)},e}function km(){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 Cm(){if(typeof window>"u"||typeof document>"u")return;let e=globalThis[P.global],t=ym();globalThis[P.global]=t,Ti();let n=`${P.global}Hooks`,o=globalThis[n];if(wi(o),globalThis[n]=wm(),Sm(e),Ke())return;let i=document.currentScript??km(),a=Ar(i?.dataset);if(!a.publicKey)return;let l=()=>{Ke()||er(a)};if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",l,{once:!0});return}l()}Cm();return Sd(Em);})();
|
|
40
40
|
//# sourceMappingURL=elements.js.map
|