@sendbird/ai-agent-messenger-react 1.13.1 → 1.13.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),g=require("dompurify"),c=require("markdown-to-jsx"),b=require("styled-components"),n=require("./DwrHbIrU.cjs"),l=t=>t&&t.__esModule?t:{default:t};function x(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const o=x(p),u=l(g),m=l(c),f=l(b),w=(t,e,i,r)=>e.type===c.RuleType.textStrikethroughed?o.createElement("span",{key:r.key},`~~${i(e.children,r)}~~`):t(),y=({className:t,children:e,style:i,onClickImage:r})=>{const h=p.useCallback(d=>{const a=o.createElement("img",{...d,alt:d.alt||""}),s=d.src;return r&&s?o.createElement("button",{type:"button",onClick:()=>r(s),style:{border:"none",padding:0,background:"none",cursor:"pointer",display:"inline-block"}},a):a},[]);return o.createElement(k,{className:t,style:i},o.createElement(m.default,{options:{renderRule:w,overrides:{a:{component:({children:d,...a})=>o.createElement("a",{...a,target:"_blank",rel:n.ANCHOR_REL},d)},img:{component:h}}}},u.default.sanitize(n.escapeMarkdownSyntax(e))))},k=f.default.div`*{&:first-child{margin-top:0;}&:last-child{margin-bottom:0;}}hr{border-top:1px solid ${n.cssVars.themedColor.textDisabled};margin:21px 0;}h1{margin-top:0;margin-bottom:12.4px;padding:0;font-size:22.4px;line-height:27.6px;font-weight:700;letter-spacing:-0.6px;}h2{font-weight:600;margin:24px 0 12px;font-size:18.2px;line-height:22.3px;}& :where(h3 + *){margin-top:0;}h3,h4,h5,h6{font-weight:600;margin:16px 0 8px;font-size:15.4px;line-height:22.4px;}p{font-size:14px;line-height:20px;margin-bottom:8px;margin-top:0;&:not(:first-child){margin-top:8px;}}a{color:inherit;font-weight:700;text-decoration:underline;}code{white-space:pre-wrap;border-radius:0.25rem;font-size:0.875em;font-weight:500;padding:2.4px 4.8px;background-color:${n.cssVars.themedColor.textDisabled};}menu{list-style:none;}ul{list-style-type:disc;}ol{list-style-type:decimal;}ul,ol{padding-inline-start:16px;margin:8px 0;& > li{padding-inline-start:0;margin:8px 0;& > ul,& > ol{margin-top:8px;& > li{margin:4px 0;}}}}p + ul,p + ol{margin-top:0;}blockquote{line-height:20px;margin:0;padding:4.8px 0;margin-inline-start:8px;padding-inline-start:16px;box-sizing:border-box;position:relative;font-style:normal;font-weight:500;border-inline-start-width:4px;&::before{border-radius:100px;content:'';position:absolute;top:0;left:0;height:100%;width:4px;background-color:${n.cssVars.themedColor.textDisabled};}}input[type='checkbox']{vertical-align:middle;margin:0;}table{unicode-bidi:isolate;overflow-wrap:break-word;white-space:normal;display:block;overflow-x:scroll;max-width:100%;text-indent:0;border-collapse:separate;border-spacing:0;margin:4px 0;text-align:start;font-size:12.3px;table-layout:auto;width:100%;*,&:after,&:before{border:0 solid;box-sizing:border-box;}}th:first-child{border-start-start-radius:6px;padding-inline-start:10.5px;}th:last-child{border-inline-end-width:1px;border-start-end-radius:6px;padding-inline-end:10.5px;}th{border-inline-start-width:1px;background-color:rgba(0,0,0,0.1);border-bottom-width:1px;border-color:${n.cssVars.themedColor.textDisabled};border-top-width:1px;padding:4px 10.5px;text-align:start;}& :where(thead th:first-child){padding-inline-start:0;}& :where(thead th:last-child){padding-inline-end:0;}& :where(thead th){padding-bottom:8px;padding-inline:8px;vertical-align:bottom;}& :where(tbody tr){border-bottom-width:1px;}& :where(tbody tr:last-child){border-bottom-width:0;}td:first-child{padding-inline-start:10.5px;}td:last-child{border-inline-end-width:1px;padding-inline-end:10.5px;}& :where(tbody td:first-child,tfoot td:first-child){padding-inline-start:0;}& :where(tbody td:last-child,tfoot td:last-child){padding-inline-end:0;}td{border-inline-start-width:1px;border-bottom-width:1px;border-color:${n.cssVars.themedColor.textDisabled};padding:4px 10.5px;text-align:start;}& :where(tbody td,tfoot td){padding:8px;}& :where(tbody td){vertical-align:baseline;}tbody tr:last-child td:first-child{border-end-start-radius:6px;}tbody tr:last-child td:last-child{border-end-end-radius:6px;}img{max-width:100%;height:auto;}`;exports.MarkdownText=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),g=require("dompurify"),c=require("markdown-to-jsx"),b=require("styled-components"),n=require("./Coha9Fqu.cjs"),l=t=>t&&t.__esModule?t:{default:t};function x(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const o=x(p),u=l(g),m=l(c),f=l(b),w=(t,e,i,r)=>e.type===c.RuleType.textStrikethroughed?o.createElement("span",{key:r.key},`~~${i(e.children,r)}~~`):t(),y=({className:t,children:e,style:i,onClickImage:r})=>{const h=p.useCallback(d=>{const a=o.createElement("img",{...d,alt:d.alt||""}),s=d.src;return r&&s?o.createElement("button",{type:"button",onClick:()=>r(s),style:{border:"none",padding:0,background:"none",cursor:"pointer",display:"inline-block"}},a):a},[]);return o.createElement(k,{className:t,style:i},o.createElement(m.default,{options:{renderRule:w,overrides:{a:{component:({children:d,...a})=>o.createElement("a",{...a,target:"_blank",rel:n.ANCHOR_REL},d)},img:{component:h}}}},u.default.sanitize(n.escapeMarkdownSyntax(e))))},k=f.default.div`*{&:first-child{margin-top:0;}&:last-child{margin-bottom:0;}}hr{border-top:1px solid ${n.cssVars.themedColor.textDisabled};margin:21px 0;}h1{margin-top:0;margin-bottom:12.4px;padding:0;font-size:22.4px;line-height:27.6px;font-weight:700;letter-spacing:-0.6px;}h2{font-weight:600;margin:24px 0 12px;font-size:18.2px;line-height:22.3px;}& :where(h3 + *){margin-top:0;}h3,h4,h5,h6{font-weight:600;margin:16px 0 8px;font-size:15.4px;line-height:22.4px;}p{font-size:14px;line-height:20px;margin-bottom:8px;margin-top:0;&:not(:first-child){margin-top:8px;}}a{color:inherit;font-weight:700;text-decoration:underline;}code{white-space:pre-wrap;border-radius:0.25rem;font-size:0.875em;font-weight:500;padding:2.4px 4.8px;background-color:${n.cssVars.themedColor.textDisabled};}menu{list-style:none;}ul{list-style-type:disc;}ol{list-style-type:decimal;}ul,ol{padding-inline-start:16px;margin:8px 0;& > li{padding-inline-start:0;margin:8px 0;& > ul,& > ol{margin-top:8px;& > li{margin:4px 0;}}}}p + ul,p + ol{margin-top:0;}blockquote{line-height:20px;margin:0;padding:4.8px 0;margin-inline-start:8px;padding-inline-start:16px;box-sizing:border-box;position:relative;font-style:normal;font-weight:500;border-inline-start-width:4px;&::before{border-radius:100px;content:'';position:absolute;top:0;left:0;height:100%;width:4px;background-color:${n.cssVars.themedColor.textDisabled};}}input[type='checkbox']{vertical-align:middle;margin:0;}table{unicode-bidi:isolate;overflow-wrap:break-word;white-space:normal;display:block;overflow-x:scroll;max-width:100%;text-indent:0;border-collapse:separate;border-spacing:0;margin:4px 0;text-align:start;font-size:12.3px;table-layout:auto;width:100%;*,&:after,&:before{border:0 solid;box-sizing:border-box;}}th:first-child{border-start-start-radius:6px;padding-inline-start:10.5px;}th:last-child{border-inline-end-width:1px;border-start-end-radius:6px;padding-inline-end:10.5px;}th{border-inline-start-width:1px;background-color:rgba(0,0,0,0.1);border-bottom-width:1px;border-color:${n.cssVars.themedColor.textDisabled};border-top-width:1px;padding:4px 10.5px;text-align:start;}& :where(thead th:first-child){padding-inline-start:0;}& :where(thead th:last-child){padding-inline-end:0;}& :where(thead th){padding-bottom:8px;padding-inline:8px;vertical-align:bottom;}& :where(tbody tr){border-bottom-width:1px;}& :where(tbody tr:last-child){border-bottom-width:0;}td:first-child{padding-inline-start:10.5px;}td:last-child{border-inline-end-width:1px;padding-inline-end:10.5px;}& :where(tbody td:first-child,tfoot td:first-child){padding-inline-start:0;}& :where(tbody td:last-child,tfoot td:last-child){padding-inline-end:0;}td{border-inline-start-width:1px;border-bottom-width:1px;border-color:${n.cssVars.themedColor.textDisabled};padding:4px 10.5px;text-align:start;}& :where(tbody td,tfoot td){padding:8px;}& :where(tbody td){vertical-align:baseline;}tbody tr:last-child td:first-child{border-end-start-radius:6px;}tbody tr:last-child td:last-child{border-end-end-radius:6px;}img{max-width:100%;height:auto;}`;exports.MarkdownText=y;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./DwrHbIrU.cjs"),n=require("date-fns/locale/pt"),r={conversation:{input_placeholder:"Fazer uma pergunta",input_placeholder_disabled:"O chat não está disponível neste canal",input_placeholder_wait_ai_agent_response:"Aguardando a resposta do agente...",input_placeholder_active_form:"Por favor, preencha o formulário para prosseguir.",input_placeholder_reconnecting:"Reconectando. Atualize se persistir.",unknown_message_type:"(Tipo de mensagem desconhecido)",powered_by:"Desenvolvido por",citation_title:"Fonte",start_new_conversation_label:"Iniciar uma conversa",scroll_to_new_messages_label:()=>"Nova mensagem",failed_message_resend:"Tentar novamente",failed_message_remove:"Remover",file_upload_no_supported_files:"Nenhum tipo de arquivo suportado disponível.",a11y_message_list:"Mensagens do chat",a11y_scroll_to_bottom:"Rolar para baixo",a11y_scroll_to_new_messages:"Rolar para novas mensagens",a11y_open_conversation_list:"Abrir lista de conversas"},conversation_list:{header_title:"Conversas",ended:"Encerrada",footer_title:"Iniciar uma conversa"},date_format:{just_now:"Agora mesmo",minutes_ago:e=>`Há ${e} minutos`,hours_ago:e=>`Há ${e} horas`,date_short:"dd/MM/yyyy",date_separator:"d 'de' MMMM 'de' yyyy",message_timestamp:"p"},csat:{title:"Seu feedback é importante para nós",submitted_label:"Enviado com sucesso!",cre_question:"Seu problema foi resolvido?",cre_positive_label:"Sim, obrigado! 👍",cre_negative_label:"Não, isso não ajudou.",reason_placeholder:"Compartilhe seu feedback",question:"Como você avaliaria sua experiência?",submit_label:"Enviar",submission_expired:"Desculpe, o período da pesquisa foi encerrado."},form:{optional_label:"opcional",validation_required:"Esta pergunta é obrigatória"},common:{placeholder_something_went_wrong:"Algo deu errado",placeholder_no_messages:"Nenhuma mensagem",placeholder_no_conversations:"Nenhuma conversa ainda",placeholder_something_went_wrong_retry_label:"Tentar novamente"},feedback:{title:"Enviar feedback",good:"Bom",bad:"Ruim",comment_label:"Comentário (opcional)",comment_placeholder:"Deixe um comentário",cancel:"Cancelar",submit:"Enviar",save:"Salvar",edit:"Editar feedback",remove:"Remover feedback"}},a={language:"pt",strings:r,dateLocale:n.pt},o=_.mapCommonStringsToReactFormat(a.strings),t={...o,HEADER_BUTTON__AGENT_HANDOFF:"Conectar-se com um agente",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Selecione uma opção para continuar",BUTTON__CANCEL:"Cancelar",BUTTON__SUBMIT:"Enviar",SUBMITTED:"Enviado",TRY_AGAIN:"Tente novamente.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"Você não pode enviar mais de uma imagem.",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"O tamanho máximo por arquivo é de %d MB.",FILE_VIEWER__UNSUPPORT:"Mensagem não suportada",CSAT5_RATING_SCORE_1:"Terrível",CSAT5_RATING_SCORE_2:"Ruim",CSAT5_RATING_SCORE_3:"Ok",CSAT5_RATING_SCORE_4:"Bom",CSAT5_RATING_SCORE_5:"Ótimo",FORM_UNAVAILABLE:"O formulário não está mais disponível.",FORM_NOT_SUPPORTED:"Este formulário não é suportado na versão atual.",FORM_VALIDATION_MIN_LENGTH:e=>`Mínimo de ${e} caracteres necessários`,FORM_VALIDATION_MAX_LENGTH:e=>`Máximo de ${e} caracteres permitidos`,FORM_VALIDATION_MIN:e=>`Valor mínimo é ${e}`,FORM_VALIDATION_MAX:e=>`Valor máximo é ${e}`,FORM_VALIDATION_MIN_SELECT:e=>`Selecione pelo menos ${e} opções`,FORM_VALIDATION_MAX_SELECT:e=>`Selecione no máximo ${e} opções`,FORM_VALIDATION_REGEX_FAILED:"Formato inválido",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:o.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"Sem categoria",CONVERSATION_CLOSED_FOOTER_LABEL:"Sua conversa foi encerrada",START_NEW_CONVERSATION:"💬 Iniciar uma nova conversa",RETURN_TO_CONVERSATION:"💬 Retornar à conversa",BUTTON__SAVE:"Salvar",BUTTON__OK:"OK",NO_NAME:"(Sem nome)",CHANNEL_FROZEN:"Canal congelado"},s={language:a.language,dateLocale:a.dateLocale,stringSet:t};exports.default=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./Coha9Fqu.cjs"),n=require("date-fns/locale/pt"),r={conversation:{input_placeholder:"Fazer uma pergunta",input_placeholder_disabled:"O chat não está disponível neste canal",input_placeholder_wait_ai_agent_response:"Aguardando a resposta do agente...",input_placeholder_active_form:"Por favor, preencha o formulário para prosseguir.",input_placeholder_reconnecting:"Reconectando. Atualize se persistir.",unknown_message_type:"(Tipo de mensagem desconhecido)",powered_by:"Desenvolvido por",citation_title:"Fonte",start_new_conversation_label:"Iniciar uma conversa",scroll_to_new_messages_label:()=>"Nova mensagem",failed_message_resend:"Tentar novamente",failed_message_remove:"Remover",file_upload_no_supported_files:"Nenhum tipo de arquivo suportado disponível.",a11y_message_list:"Mensagens do chat",a11y_scroll_to_bottom:"Rolar para baixo",a11y_scroll_to_new_messages:"Rolar para novas mensagens",a11y_open_conversation_list:"Abrir lista de conversas"},conversation_list:{header_title:"Conversas",ended:"Encerrada",footer_title:"Iniciar uma conversa"},date_format:{just_now:"Agora mesmo",minutes_ago:e=>`Há ${e} minutos`,hours_ago:e=>`Há ${e} horas`,date_short:"dd/MM/yyyy",date_separator:"d 'de' MMMM 'de' yyyy",message_timestamp:"p"},csat:{title:"Seu feedback é importante para nós",submitted_label:"Enviado com sucesso!",cre_question:"Seu problema foi resolvido?",cre_positive_label:"Sim, obrigado! 👍",cre_negative_label:"Não, isso não ajudou.",reason_placeholder:"Compartilhe seu feedback",question:"Como você avaliaria sua experiência?",submit_label:"Enviar",submission_expired:"Desculpe, o período da pesquisa foi encerrado."},form:{optional_label:"opcional",validation_required:"Esta pergunta é obrigatória"},common:{placeholder_something_went_wrong:"Algo deu errado",placeholder_no_messages:"Nenhuma mensagem",placeholder_no_conversations:"Nenhuma conversa ainda",placeholder_something_went_wrong_retry_label:"Tentar novamente"},feedback:{title:"Enviar feedback",good:"Bom",bad:"Ruim",comment_label:"Comentário (opcional)",comment_placeholder:"Deixe um comentário",cancel:"Cancelar",submit:"Enviar",save:"Salvar",edit:"Editar feedback",remove:"Remover feedback"}},a={language:"pt",strings:r,dateLocale:n.pt},o=_.mapCommonStringsToReactFormat(a.strings),t={...o,HEADER_BUTTON__AGENT_HANDOFF:"Conectar-se com um agente",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Selecione uma opção para continuar",BUTTON__CANCEL:"Cancelar",BUTTON__SUBMIT:"Enviar",SUBMITTED:"Enviado",TRY_AGAIN:"Tente novamente.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"Você não pode enviar mais de uma imagem.",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"O tamanho máximo por arquivo é de %d MB.",FILE_VIEWER__UNSUPPORT:"Mensagem não suportada",CSAT5_RATING_SCORE_1:"Terrível",CSAT5_RATING_SCORE_2:"Ruim",CSAT5_RATING_SCORE_3:"Ok",CSAT5_RATING_SCORE_4:"Bom",CSAT5_RATING_SCORE_5:"Ótimo",FORM_UNAVAILABLE:"O formulário não está mais disponível.",FORM_NOT_SUPPORTED:"Este formulário não é suportado na versão atual.",FORM_VALIDATION_MIN_LENGTH:e=>`Mínimo de ${e} caracteres necessários`,FORM_VALIDATION_MAX_LENGTH:e=>`Máximo de ${e} caracteres permitidos`,FORM_VALIDATION_MIN:e=>`Valor mínimo é ${e}`,FORM_VALIDATION_MAX:e=>`Valor máximo é ${e}`,FORM_VALIDATION_MIN_SELECT:e=>`Selecione pelo menos ${e} opções`,FORM_VALIDATION_MAX_SELECT:e=>`Selecione no máximo ${e} opções`,FORM_VALIDATION_REGEX_FAILED:"Formato inválido",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:o.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"Sem categoria",CONVERSATION_CLOSED_FOOTER_LABEL:"Sua conversa foi encerrada",START_NEW_CONVERSATION:"💬 Iniciar uma nova conversa",RETURN_TO_CONVERSATION:"💬 Retornar à conversa",BUTTON__SAVE:"Salvar",BUTTON__OK:"OK",NO_NAME:"(Sem nome)",CHANNEL_FROZEN:"Canal congelado"},s={language:a.language,dateLocale:a.dateLocale,stringSet:t};exports.default=s;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./DwrHbIrU.cjs"),r=require("date-fns/locale/fr"),_={conversation:{input_placeholder:"Poser une question",input_placeholder_disabled:"Le chat n'est pas disponible dans ce canal",input_placeholder_wait_ai_agent_response:"En attente de la réponse de l'agent...",input_placeholder_active_form:"Veuillez remplir le formulaire pour continuer.",input_placeholder_reconnecting:"Reconnexion. Actualisez si persiste.",unknown_message_type:"(Type de message inconnu)",powered_by:"Propulsé par",citation_title:"Source",start_new_conversation_label:"Démarrer une conversation",scroll_to_new_messages_label:()=>"Nouveau message",failed_message_resend:"Réessayer",failed_message_remove:"Supprimer",file_upload_no_supported_files:"Aucun type de fichier pris en charge disponible.",a11y_message_list:"Messages du chat",a11y_scroll_to_bottom:"Faire défiler vers le bas",a11y_scroll_to_new_messages:"Aller aux nouveaux messages",a11y_open_conversation_list:"Ouvrir la liste des conversations"},conversation_list:{header_title:"Conversations",ended:"Terminée",footer_title:"Démarrer une conversation"},date_format:{just_now:"À l'instant",minutes_ago:e=>`Il y a ${e} minutes`,hours_ago:e=>`Il y a ${e} heures`,date_short:"dd/MM/yyyy",date_separator:"d MMMM yyyy",message_timestamp:"p"},csat:{title:"Vos commentaires comptent pour nous",submitted_label:"Soumis avec succès!",cre_question:"Votre problème a-t-il été résolu ?",cre_positive_label:"Oui, merci ! 👍",cre_negative_label:"Non, cela n'a pas aidé.",reason_placeholder:"Partagez votre avis",question:"Comment évalueriez-vous votre expérience ?",submit_label:"Envoyer",submission_expired:"Désolé, la période de l'enquête est terminée."},form:{optional_label:"optionnel",validation_required:"Cette question est obligatoire"},common:{placeholder_something_went_wrong:"Une erreur est survenue",placeholder_no_messages:"Aucun message",placeholder_no_conversations:"Aucune conversation pour le moment",placeholder_something_went_wrong_retry_label:"Réessayer"},feedback:{title:"Envoyer des commentaires",good:"Bien",bad:"Mauvais",comment_label:"Commentaire (optionnel)",comment_placeholder:"Laissez un commentaire",cancel:"Annuler",submit:"Envoyer",save:"Enregistrer",edit:"Modifier les commentaires",remove:"Supprimer les commentaires"}},a={language:"fr",strings:_,dateLocale:r.fr},n=o.mapCommonStringsToReactFormat(a.strings),s={...n,HEADER_BUTTON__AGENT_HANDOFF:"Se connecter avec un agent",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Sélectionnez une option pour continuer",BUTTON__CANCEL:"Annuler",BUTTON__SUBMIT:"Soumettre",SUBMITTED:"Soumis",TRY_AGAIN:"Veuillez réessayer.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"Vous ne pouvez pas télécharger plus d'une image.",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"La taille maximale par fichier est de %d MB.",FILE_VIEWER__UNSUPPORT:"Message non pris en charge",CSAT5_RATING_SCORE_1:"Terrible",CSAT5_RATING_SCORE_2:"Mauvais",CSAT5_RATING_SCORE_3:"Correct",CSAT5_RATING_SCORE_4:"Bon",CSAT5_RATING_SCORE_5:"Excellent",FORM_UNAVAILABLE:"Le formulaire n'est plus disponible.",FORM_NOT_SUPPORTED:"Ce formulaire n'est pas pris en charge dans la version actuelle.",FORM_VALIDATION_MIN_LENGTH:e=>`Minimum ${e} caractères requis`,FORM_VALIDATION_MAX_LENGTH:e=>`Maximum ${e} caractères autorisés`,FORM_VALIDATION_MIN:e=>`La valeur minimale est ${e}`,FORM_VALIDATION_MAX:e=>`La valeur maximale est ${e}`,FORM_VALIDATION_MIN_SELECT:e=>`Sélectionnez au moins ${e} options`,FORM_VALIDATION_MAX_SELECT:e=>`Sélectionnez au maximum ${e} options`,FORM_VALIDATION_REGEX_FAILED:"Format invalide",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:n.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"Aucune catégorie",CONVERSATION_CLOSED_FOOTER_LABEL:"Votre conversation est terminée",START_NEW_CONVERSATION:"💬 Démarrer une nouvelle conversation",RETURN_TO_CONVERSATION:"💬 Retourner à la conversation",BUTTON__SAVE:"Enregistrer",BUTTON__OK:"OK",NO_NAME:"(Sans nom)",CHANNEL_FROZEN:"Canal gelé"},t={language:a.language,dateLocale:a.dateLocale,stringSet:s};exports.default=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./Coha9Fqu.cjs"),r=require("date-fns/locale/fr"),_={conversation:{input_placeholder:"Poser une question",input_placeholder_disabled:"Le chat n'est pas disponible dans ce canal",input_placeholder_wait_ai_agent_response:"En attente de la réponse de l'agent...",input_placeholder_active_form:"Veuillez remplir le formulaire pour continuer.",input_placeholder_reconnecting:"Reconnexion. Actualisez si persiste.",unknown_message_type:"(Type de message inconnu)",powered_by:"Propulsé par",citation_title:"Source",start_new_conversation_label:"Démarrer une conversation",scroll_to_new_messages_label:()=>"Nouveau message",failed_message_resend:"Réessayer",failed_message_remove:"Supprimer",file_upload_no_supported_files:"Aucun type de fichier pris en charge disponible.",a11y_message_list:"Messages du chat",a11y_scroll_to_bottom:"Faire défiler vers le bas",a11y_scroll_to_new_messages:"Aller aux nouveaux messages",a11y_open_conversation_list:"Ouvrir la liste des conversations"},conversation_list:{header_title:"Conversations",ended:"Terminée",footer_title:"Démarrer une conversation"},date_format:{just_now:"À l'instant",minutes_ago:e=>`Il y a ${e} minutes`,hours_ago:e=>`Il y a ${e} heures`,date_short:"dd/MM/yyyy",date_separator:"d MMMM yyyy",message_timestamp:"p"},csat:{title:"Vos commentaires comptent pour nous",submitted_label:"Soumis avec succès!",cre_question:"Votre problème a-t-il été résolu ?",cre_positive_label:"Oui, merci ! 👍",cre_negative_label:"Non, cela n'a pas aidé.",reason_placeholder:"Partagez votre avis",question:"Comment évalueriez-vous votre expérience ?",submit_label:"Envoyer",submission_expired:"Désolé, la période de l'enquête est terminée."},form:{optional_label:"optionnel",validation_required:"Cette question est obligatoire"},common:{placeholder_something_went_wrong:"Une erreur est survenue",placeholder_no_messages:"Aucun message",placeholder_no_conversations:"Aucune conversation pour le moment",placeholder_something_went_wrong_retry_label:"Réessayer"},feedback:{title:"Envoyer des commentaires",good:"Bien",bad:"Mauvais",comment_label:"Commentaire (optionnel)",comment_placeholder:"Laissez un commentaire",cancel:"Annuler",submit:"Envoyer",save:"Enregistrer",edit:"Modifier les commentaires",remove:"Supprimer les commentaires"}},a={language:"fr",strings:_,dateLocale:r.fr},n=o.mapCommonStringsToReactFormat(a.strings),s={...n,HEADER_BUTTON__AGENT_HANDOFF:"Se connecter avec un agent",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Sélectionnez une option pour continuer",BUTTON__CANCEL:"Annuler",BUTTON__SUBMIT:"Soumettre",SUBMITTED:"Soumis",TRY_AGAIN:"Veuillez réessayer.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"Vous ne pouvez pas télécharger plus d'une image.",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"La taille maximale par fichier est de %d MB.",FILE_VIEWER__UNSUPPORT:"Message non pris en charge",CSAT5_RATING_SCORE_1:"Terrible",CSAT5_RATING_SCORE_2:"Mauvais",CSAT5_RATING_SCORE_3:"Correct",CSAT5_RATING_SCORE_4:"Bon",CSAT5_RATING_SCORE_5:"Excellent",FORM_UNAVAILABLE:"Le formulaire n'est plus disponible.",FORM_NOT_SUPPORTED:"Ce formulaire n'est pas pris en charge dans la version actuelle.",FORM_VALIDATION_MIN_LENGTH:e=>`Minimum ${e} caractères requis`,FORM_VALIDATION_MAX_LENGTH:e=>`Maximum ${e} caractères autorisés`,FORM_VALIDATION_MIN:e=>`La valeur minimale est ${e}`,FORM_VALIDATION_MAX:e=>`La valeur maximale est ${e}`,FORM_VALIDATION_MIN_SELECT:e=>`Sélectionnez au moins ${e} options`,FORM_VALIDATION_MAX_SELECT:e=>`Sélectionnez au maximum ${e} options`,FORM_VALIDATION_REGEX_FAILED:"Format invalide",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:n.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"Aucune catégorie",CONVERSATION_CLOSED_FOOTER_LABEL:"Votre conversation est terminée",START_NEW_CONVERSATION:"💬 Démarrer une nouvelle conversation",RETURN_TO_CONVERSATION:"💬 Retourner à la conversation",BUTTON__SAVE:"Enregistrer",BUTTON__OK:"OK",NO_NAME:"(Sans nom)",CHANNEL_FROZEN:"Canal gelé"},t={language:a.language,dateLocale:a.dateLocale,stringSet:s};exports.default=t;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./DwrHbIrU.cjs"),n=require("date-fns/locale/it"),_={conversation:{input_placeholder:"Fai una domanda",input_placeholder_disabled:"La chat non è disponibile in questo canale",input_placeholder_wait_ai_agent_response:"In attesa della risposta dell'agente...",input_placeholder_active_form:"Compila il modulo per procedere.",input_placeholder_reconnecting:"Riconnessione. Aggiorna se persiste.",unknown_message_type:"(Tipo di messaggio sconosciuto)",powered_by:"Powered by",citation_title:"Fonte",start_new_conversation_label:"Inizia una conversazione",scroll_to_new_messages_label:()=>"Nuovo messaggio",failed_message_resend:"Riprova",failed_message_remove:"Rimuovi",file_upload_no_supported_files:"Nessun tipo di file supportato disponibile.",a11y_message_list:"Messaggi della chat",a11y_scroll_to_bottom:"Scorri in basso",a11y_scroll_to_new_messages:"Scorri ai nuovi messaggi",a11y_open_conversation_list:"Apri elenco conversazioni"},conversation_list:{header_title:"Conversazioni",ended:"Terminata",footer_title:"Inizia una conversazione"},date_format:{just_now:"Proprio ora",minutes_ago:e=>`${e} minuti fa`,hours_ago:e=>`${e} ore fa`,date_short:"dd/MM/yyyy",date_separator:"d MMMM yyyy",message_timestamp:"p"},csat:{title:"Il tuo feedback è importante per noi",submitted_label:"Inviato con successo!",cre_question:"Il tuo problema è stato risolto?",cre_positive_label:"Sì, grazie! 👍",cre_negative_label:"No, non è servito.",reason_placeholder:"Condividi il tuo feedback",question:"Come valuteresti la tua esperienza?",submit_label:"Invia",submission_expired:"Ci dispiace, il periodo per partecipare al sondaggio è terminato."},form:{optional_label:"opzionale",validation_required:"Questa domanda è obbligatoria"},common:{placeholder_something_went_wrong:"Qualcosa è andato storto",placeholder_no_messages:"Nessun messaggio",placeholder_no_conversations:"Nessuna conversazione ancora",placeholder_something_went_wrong_retry_label:"Riprova"},feedback:{title:"Invia feedback",good:"Buono",bad:"Cattivo",comment_label:"Commento (opzionale)",comment_placeholder:"Lascia un commento",cancel:"Annulla",submit:"Invia",save:"Salva",edit:"Modifica feedback",remove:"Rimuovi feedback"}},o={language:"it",strings:_,dateLocale:n.it},a=i.mapCommonStringsToReactFormat(o.strings),t={...a,HEADER_BUTTON__AGENT_HANDOFF:"Connettersi con un agente",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Seleziona un'opzione per continuare",BUTTON__CANCEL:"Annulla",BUTTON__SUBMIT:"Invia",SUBMITTED:"Inviato",TRY_AGAIN:"Per favore, riprova.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"Non puoi caricare più di un'immagine.",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"La dimensione massima per file è di %d MB.",FILE_VIEWER__UNSUPPORT:"Messaggio non supportato",CSAT5_RATING_SCORE_1:"Terribile",CSAT5_RATING_SCORE_2:"Brutto",CSAT5_RATING_SCORE_3:"Ok",CSAT5_RATING_SCORE_4:"Buono",CSAT5_RATING_SCORE_5:"Ottimo",FORM_UNAVAILABLE:"Il modulo non è più disponibile.",FORM_NOT_SUPPORTED:"Questo modulo non è supportato nella versione attuale.",FORM_VALIDATION_MIN_LENGTH:e=>`Minimo ${e} caratteri richiesti`,FORM_VALIDATION_MAX_LENGTH:e=>`Massimo ${e} caratteri consentiti`,FORM_VALIDATION_MIN:e=>`Il valore minimo è ${e}`,FORM_VALIDATION_MAX:e=>`Il valore massimo è ${e}`,FORM_VALIDATION_MIN_SELECT:e=>`Seleziona almeno ${e} opzioni`,FORM_VALIDATION_MAX_SELECT:e=>`Seleziona al massimo ${e} opzioni`,FORM_VALIDATION_REGEX_FAILED:"Formato non valido",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:a.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"Nessuna categoria",CONVERSATION_CLOSED_FOOTER_LABEL:"La tua conversazione è terminata",START_NEW_CONVERSATION:"💬 Inizia una nuova conversazione",RETURN_TO_CONVERSATION:"💬 Torna alla conversazione",BUTTON__SAVE:"Salva",BUTTON__OK:"OK",NO_NAME:"(Senza nome)",CHANNEL_FROZEN:"Canale bloccato"},s={language:o.language,dateLocale:o.dateLocale,stringSet:t};exports.default=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./Coha9Fqu.cjs"),n=require("date-fns/locale/it"),_={conversation:{input_placeholder:"Fai una domanda",input_placeholder_disabled:"La chat non è disponibile in questo canale",input_placeholder_wait_ai_agent_response:"In attesa della risposta dell'agente...",input_placeholder_active_form:"Compila il modulo per procedere.",input_placeholder_reconnecting:"Riconnessione. Aggiorna se persiste.",unknown_message_type:"(Tipo di messaggio sconosciuto)",powered_by:"Powered by",citation_title:"Fonte",start_new_conversation_label:"Inizia una conversazione",scroll_to_new_messages_label:()=>"Nuovo messaggio",failed_message_resend:"Riprova",failed_message_remove:"Rimuovi",file_upload_no_supported_files:"Nessun tipo di file supportato disponibile.",a11y_message_list:"Messaggi della chat",a11y_scroll_to_bottom:"Scorri in basso",a11y_scroll_to_new_messages:"Scorri ai nuovi messaggi",a11y_open_conversation_list:"Apri elenco conversazioni"},conversation_list:{header_title:"Conversazioni",ended:"Terminata",footer_title:"Inizia una conversazione"},date_format:{just_now:"Proprio ora",minutes_ago:e=>`${e} minuti fa`,hours_ago:e=>`${e} ore fa`,date_short:"dd/MM/yyyy",date_separator:"d MMMM yyyy",message_timestamp:"p"},csat:{title:"Il tuo feedback è importante per noi",submitted_label:"Inviato con successo!",cre_question:"Il tuo problema è stato risolto?",cre_positive_label:"Sì, grazie! 👍",cre_negative_label:"No, non è servito.",reason_placeholder:"Condividi il tuo feedback",question:"Come valuteresti la tua esperienza?",submit_label:"Invia",submission_expired:"Ci dispiace, il periodo per partecipare al sondaggio è terminato."},form:{optional_label:"opzionale",validation_required:"Questa domanda è obbligatoria"},common:{placeholder_something_went_wrong:"Qualcosa è andato storto",placeholder_no_messages:"Nessun messaggio",placeholder_no_conversations:"Nessuna conversazione ancora",placeholder_something_went_wrong_retry_label:"Riprova"},feedback:{title:"Invia feedback",good:"Buono",bad:"Cattivo",comment_label:"Commento (opzionale)",comment_placeholder:"Lascia un commento",cancel:"Annulla",submit:"Invia",save:"Salva",edit:"Modifica feedback",remove:"Rimuovi feedback"}},o={language:"it",strings:_,dateLocale:n.it},a=i.mapCommonStringsToReactFormat(o.strings),t={...a,HEADER_BUTTON__AGENT_HANDOFF:"Connettersi con un agente",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Seleziona un'opzione per continuare",BUTTON__CANCEL:"Annulla",BUTTON__SUBMIT:"Invia",SUBMITTED:"Inviato",TRY_AGAIN:"Per favore, riprova.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"Non puoi caricare più di un'immagine.",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"La dimensione massima per file è di %d MB.",FILE_VIEWER__UNSUPPORT:"Messaggio non supportato",CSAT5_RATING_SCORE_1:"Terribile",CSAT5_RATING_SCORE_2:"Brutto",CSAT5_RATING_SCORE_3:"Ok",CSAT5_RATING_SCORE_4:"Buono",CSAT5_RATING_SCORE_5:"Ottimo",FORM_UNAVAILABLE:"Il modulo non è più disponibile.",FORM_NOT_SUPPORTED:"Questo modulo non è supportato nella versione attuale.",FORM_VALIDATION_MIN_LENGTH:e=>`Minimo ${e} caratteri richiesti`,FORM_VALIDATION_MAX_LENGTH:e=>`Massimo ${e} caratteri consentiti`,FORM_VALIDATION_MIN:e=>`Il valore minimo è ${e}`,FORM_VALIDATION_MAX:e=>`Il valore massimo è ${e}`,FORM_VALIDATION_MIN_SELECT:e=>`Seleziona almeno ${e} opzioni`,FORM_VALIDATION_MAX_SELECT:e=>`Seleziona al massimo ${e} opzioni`,FORM_VALIDATION_REGEX_FAILED:"Formato non valido",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:a.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"Nessuna categoria",CONVERSATION_CLOSED_FOOTER_LABEL:"La tua conversazione è terminata",START_NEW_CONVERSATION:"💬 Inizia una nuova conversazione",RETURN_TO_CONVERSATION:"💬 Torna alla conversazione",BUTTON__SAVE:"Salva",BUTTON__OK:"OK",NO_NAME:"(Senza nome)",CHANNEL_FROZEN:"Canale bloccato"},s={language:o.language,dateLocale:o.dateLocale,stringSet:t};exports.default=s;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./DwrHbIrU.cjs"),_=require("date-fns/locale/es"),i={conversation:{input_placeholder:"Hacer una pregunta",input_placeholder_disabled:"El chat no está disponible en este canal",input_placeholder_wait_ai_agent_response:"Esperando la respuesta del agente...",input_placeholder_active_form:"Por favor, complete el formulario para continuar.",input_placeholder_reconnecting:"Reconectando. Actualiza si persiste.",unknown_message_type:"(Tipo de mensaje desconocido)",powered_by:"Desarrollado por",citation_title:"Fuente",start_new_conversation_label:"Iniciar una conversación",scroll_to_new_messages_label:()=>"Nuevo mensaje",failed_message_resend:"Reintentar",failed_message_remove:"Eliminar",file_upload_no_supported_files:"No hay tipos de archivo compatibles disponibles.",a11y_message_list:"Mensajes del chat",a11y_scroll_to_bottom:"Desplazarse hacia abajo",a11y_scroll_to_new_messages:"Desplazarse a nuevos mensajes",a11y_open_conversation_list:"Abrir lista de conversaciones"},conversation_list:{header_title:"Conversaciones",ended:"Finalizado",footer_title:"Iniciar una conversación"},date_format:{just_now:"Ahora mismo",minutes_ago:e=>`Hace ${e} minutos`,hours_ago:e=>`Hace ${e} horas`,date_short:"dd/MM/yyyy",date_separator:"d 'de' MMMM 'de' yyyy",message_timestamp:"p"},csat:{title:"Tus comentarios nos importan",submitted_label:"Enviado con éxito!",cre_question:"¿Se resolvió su problema?",cre_positive_label:"¡Sí, gracias! 👍",cre_negative_label:"No, eso no ayudó.",reason_placeholder:"Comparte tu opinión",question:"¿Cómo calificarías tu experiencia?",submit_label:"Enviar",submission_expired:"Lo sentimos, el período de la encuesta ha terminado."},form:{optional_label:"opcional",validation_required:"Esta pregunta es obligatoria"},common:{placeholder_something_went_wrong:"Algo salió mal",placeholder_no_messages:"No hay mensajes",placeholder_no_conversations:"Aún no hay conversaciones",placeholder_something_went_wrong_retry_label:"Reintentar"},feedback:{title:"Enviar comentarios",good:"Bueno",bad:"Malo",comment_label:"Comentario (opcional)",comment_placeholder:"Deja un comentario",cancel:"Cancelar",submit:"Enviar",save:"Guardar",edit:"Editar comentarios",remove:"Eliminar comentarios"}},a={language:"es",strings:i,dateLocale:_.es},o=n.mapCommonStringsToReactFormat(a.strings),s={...o,HEADER_BUTTON__AGENT_HANDOFF:"Conectarse con un agente",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Selecciona una opción para continuar",BUTTON__CANCEL:"Cancelar",BUTTON__SUBMIT:"Enviar",SUBMITTED:"Enviado",TRY_AGAIN:"Por favor, inténtalo de nuevo.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"No puedes subir más de una imagen.",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"El tamaño máximo por archivo es de %d MB.",FILE_VIEWER__UNSUPPORT:"Mensaje no compatible",CSAT5_RATING_SCORE_1:"Terrible",CSAT5_RATING_SCORE_2:"Malo",CSAT5_RATING_SCORE_3:"Regular",CSAT5_RATING_SCORE_4:"Bueno",CSAT5_RATING_SCORE_5:"Excelente",FORM_UNAVAILABLE:"El formulario ya no está disponible.",FORM_NOT_SUPPORTED:"Este formulario no es compatible con la versión actual.",FORM_VALIDATION_MIN_LENGTH:e=>`Mínimo ${e} caracteres requeridos`,FORM_VALIDATION_MAX_LENGTH:e=>`Máximo ${e} caracteres permitidos`,FORM_VALIDATION_MIN:e=>`El valor mínimo es ${e}`,FORM_VALIDATION_MAX:e=>`El valor máximo es ${e}`,FORM_VALIDATION_MIN_SELECT:e=>`Selecciona al menos ${e} opciones`,FORM_VALIDATION_MAX_SELECT:e=>`Selecciona como máximo ${e} opciones`,FORM_VALIDATION_REGEX_FAILED:"Formato inválido",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:o.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"Sin categoría",CONVERSATION_CLOSED_FOOTER_LABEL:"Tu conversación ha terminado",START_NEW_CONVERSATION:"💬 Iniciar una nueva conversación",RETURN_TO_CONVERSATION:"💬 Volver a la conversación",BUTTON__SAVE:"Guardar",BUTTON__OK:"Aceptar",NO_NAME:"(Sin nombre)",CHANNEL_FROZEN:"Canal congelado"},r={language:a.language,dateLocale:a.dateLocale,stringSet:s};exports.default=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./Coha9Fqu.cjs"),_=require("date-fns/locale/es"),i={conversation:{input_placeholder:"Hacer una pregunta",input_placeholder_disabled:"El chat no está disponible en este canal",input_placeholder_wait_ai_agent_response:"Esperando la respuesta del agente...",input_placeholder_active_form:"Por favor, complete el formulario para continuar.",input_placeholder_reconnecting:"Reconectando. Actualiza si persiste.",unknown_message_type:"(Tipo de mensaje desconocido)",powered_by:"Desarrollado por",citation_title:"Fuente",start_new_conversation_label:"Iniciar una conversación",scroll_to_new_messages_label:()=>"Nuevo mensaje",failed_message_resend:"Reintentar",failed_message_remove:"Eliminar",file_upload_no_supported_files:"No hay tipos de archivo compatibles disponibles.",a11y_message_list:"Mensajes del chat",a11y_scroll_to_bottom:"Desplazarse hacia abajo",a11y_scroll_to_new_messages:"Desplazarse a nuevos mensajes",a11y_open_conversation_list:"Abrir lista de conversaciones"},conversation_list:{header_title:"Conversaciones",ended:"Finalizado",footer_title:"Iniciar una conversación"},date_format:{just_now:"Ahora mismo",minutes_ago:e=>`Hace ${e} minutos`,hours_ago:e=>`Hace ${e} horas`,date_short:"dd/MM/yyyy",date_separator:"d 'de' MMMM 'de' yyyy",message_timestamp:"p"},csat:{title:"Tus comentarios nos importan",submitted_label:"Enviado con éxito!",cre_question:"¿Se resolvió su problema?",cre_positive_label:"¡Sí, gracias! 👍",cre_negative_label:"No, eso no ayudó.",reason_placeholder:"Comparte tu opinión",question:"¿Cómo calificarías tu experiencia?",submit_label:"Enviar",submission_expired:"Lo sentimos, el período de la encuesta ha terminado."},form:{optional_label:"opcional",validation_required:"Esta pregunta es obligatoria"},common:{placeholder_something_went_wrong:"Algo salió mal",placeholder_no_messages:"No hay mensajes",placeholder_no_conversations:"Aún no hay conversaciones",placeholder_something_went_wrong_retry_label:"Reintentar"},feedback:{title:"Enviar comentarios",good:"Bueno",bad:"Malo",comment_label:"Comentario (opcional)",comment_placeholder:"Deja un comentario",cancel:"Cancelar",submit:"Enviar",save:"Guardar",edit:"Editar comentarios",remove:"Eliminar comentarios"}},a={language:"es",strings:i,dateLocale:_.es},o=n.mapCommonStringsToReactFormat(a.strings),s={...o,HEADER_BUTTON__AGENT_HANDOFF:"Conectarse con un agente",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Selecciona una opción para continuar",BUTTON__CANCEL:"Cancelar",BUTTON__SUBMIT:"Enviar",SUBMITTED:"Enviado",TRY_AGAIN:"Por favor, inténtalo de nuevo.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"No puedes subir más de una imagen.",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"El tamaño máximo por archivo es de %d MB.",FILE_VIEWER__UNSUPPORT:"Mensaje no compatible",CSAT5_RATING_SCORE_1:"Terrible",CSAT5_RATING_SCORE_2:"Malo",CSAT5_RATING_SCORE_3:"Regular",CSAT5_RATING_SCORE_4:"Bueno",CSAT5_RATING_SCORE_5:"Excelente",FORM_UNAVAILABLE:"El formulario ya no está disponible.",FORM_NOT_SUPPORTED:"Este formulario no es compatible con la versión actual.",FORM_VALIDATION_MIN_LENGTH:e=>`Mínimo ${e} caracteres requeridos`,FORM_VALIDATION_MAX_LENGTH:e=>`Máximo ${e} caracteres permitidos`,FORM_VALIDATION_MIN:e=>`El valor mínimo es ${e}`,FORM_VALIDATION_MAX:e=>`El valor máximo es ${e}`,FORM_VALIDATION_MIN_SELECT:e=>`Selecciona al menos ${e} opciones`,FORM_VALIDATION_MAX_SELECT:e=>`Selecciona como máximo ${e} opciones`,FORM_VALIDATION_REGEX_FAILED:"Formato inválido",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:o.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"Sin categoría",CONVERSATION_CLOSED_FOOTER_LABEL:"Tu conversación ha terminado",START_NEW_CONVERSATION:"💬 Iniciar una nueva conversación",RETURN_TO_CONVERSATION:"💬 Volver a la conversación",BUTTON__SAVE:"Guardar",BUTTON__OK:"Aceptar",NO_NAME:"(Sin nombre)",CHANNEL_FROZEN:"Canal congelado"},r={language:a.language,dateLocale:a.dateLocale,stringSet:s};exports.default=r;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./DwrHbIrU.cjs"),a=require("date-fns/locale/ko"),T={conversation:{input_placeholder:"질문하기",input_placeholder_disabled:"이 채널에서는 채팅을 사용할 수 없습니다.",input_placeholder_wait_ai_agent_response:"상담사의 답변을 기다리는 중...",input_placeholder_active_form:"계속 진행하려면 양식을 작성해 주세요.",input_placeholder_reconnecting:"재연결 시도 중. 계속되면 새로고침하세요.",unknown_message_type:"(알 수 없는 메시지 유형)",powered_by:"Powered by",citation_title:"출처",start_new_conversation_label:"대화 시작",scroll_to_new_messages_label:()=>"새 메시지",failed_message_resend:"다시 시도",failed_message_remove:"삭제",file_upload_no_supported_files:"사용 가능한 지원 파일 형식이 없습니다.",a11y_message_list:"채팅 메시지",a11y_scroll_to_bottom:"맨 아래로 스크롤",a11y_scroll_to_new_messages:"새 메시지로 스크롤",a11y_open_conversation_list:"대화 목록 열기"},conversation_list:{header_title:"대화",ended:"종료됨",footer_title:"대화 시작"},date_format:{just_now:"방금",minutes_ago:_=>`${_}분 전`,hours_ago:_=>`${_}시간 전`,date_short:"yyyy/MM/dd",date_separator:"yyyy년 M월 d일",message_timestamp:"p"},csat:{title:"귀하의 피드백은 우리에게 중요합니다.",submitted_label:"성공적으로 제출되었습니다!",cre_question:"문제가 해결되었나요?",cre_positive_label:"네, 감사합니다! 👍",cre_negative_label:"아니요, 도움이 되지 않았어요.",reason_placeholder:"의견을 공유해주세요.",question:"귀하의 경험을 어떻게 평가하시겠습니까?",submit_label:"제출",submission_expired:"죄송합니다. 설문 응답 기간이 종료되었습니다."},form:{optional_label:"선택",validation_required:"이 항목은 필수입니다"},common:{placeholder_something_went_wrong:"문제가 발생했습니다.",placeholder_no_messages:"메시지가 없습니다.",placeholder_no_conversations:"아직 대화가 없습니다",placeholder_something_went_wrong_retry_label:"다시 시도"},feedback:{title:"피드백 제출",good:"좋아요",bad:"별로예요",comment_label:"코멘트 (선택사항)",comment_placeholder:"코멘트를 남겨주세요",cancel:"취소",submit:"제출",save:"저장",edit:"피드백 수정",remove:"피드백 삭제"}},e={language:"ko",strings:T,dateLocale:a.ko},o=t.mapCommonStringsToReactFormat(e.strings),s={...o,HEADER_BUTTON__AGENT_HANDOFF:"상담사와 연결하기",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"계속하려면 옵션을 선택하세요",BUTTON__CANCEL:"취소",BUTTON__SUBMIT:"제출",SUBMITTED:"제출됨",TRY_AGAIN:"다시 시도해 주세요.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"한 번에 하나의 이미지만 업로드할 수 있습니다.",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"파일당 최대 크기는 %d MB입니다.",FILE_VIEWER__UNSUPPORT:"지원되지 않는 메시지",CSAT5_RATING_SCORE_1:"최악이에요.",CSAT5_RATING_SCORE_2:"별로예요.",CSAT5_RATING_SCORE_3:"괜찮아요.",CSAT5_RATING_SCORE_4:"좋아요.",CSAT5_RATING_SCORE_5:"최고예요.",FORM_UNAVAILABLE:"양식을 더 이상 사용할 수 없습니다.",FORM_NOT_SUPPORTED:"이 양식은 현재 버전에서 지원되지 않습니다.",FORM_VALIDATION_MIN_LENGTH:_=>`최소 ${_}자가 필요합니다`,FORM_VALIDATION_MAX_LENGTH:_=>`최대 ${_}자까지 입력 가능합니다`,FORM_VALIDATION_MIN:_=>`최소값은 ${_}입니다`,FORM_VALIDATION_MAX:_=>`최대값은 ${_}입니다`,FORM_VALIDATION_MIN_SELECT:_=>`최소 ${_}개 옵션을 선택해 주세요`,FORM_VALIDATION_MAX_SELECT:_=>`최대 ${_}개 옵션을 선택해 주세요`,FORM_VALIDATION_REGEX_FAILED:"유효하지 않은 형식",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:o.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"a h:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"카테고리 없음",CONVERSATION_CLOSED_FOOTER_LABEL:"대화가 종료되었습니다",START_NEW_CONVERSATION:"💬 새로운 대화 시작하기",RETURN_TO_CONVERSATION:"💬 대화로 돌아가기",BUTTON__SAVE:"저장",BUTTON__OK:"확인",NO_NAME:"(이름 없음)",CHANNEL_FROZEN:"채널이 동결되었습니다."},l={language:e.language,dateLocale:e.dateLocale,stringSet:s};exports.default=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./Coha9Fqu.cjs"),a=require("date-fns/locale/ko"),T={conversation:{input_placeholder:"질문하기",input_placeholder_disabled:"이 채널에서는 채팅을 사용할 수 없습니다.",input_placeholder_wait_ai_agent_response:"상담사의 답변을 기다리는 중...",input_placeholder_active_form:"계속 진행하려면 양식을 작성해 주세요.",input_placeholder_reconnecting:"재연결 시도 중. 계속되면 새로고침하세요.",unknown_message_type:"(알 수 없는 메시지 유형)",powered_by:"Powered by",citation_title:"출처",start_new_conversation_label:"대화 시작",scroll_to_new_messages_label:()=>"새 메시지",failed_message_resend:"다시 시도",failed_message_remove:"삭제",file_upload_no_supported_files:"사용 가능한 지원 파일 형식이 없습니다.",a11y_message_list:"채팅 메시지",a11y_scroll_to_bottom:"맨 아래로 스크롤",a11y_scroll_to_new_messages:"새 메시지로 스크롤",a11y_open_conversation_list:"대화 목록 열기"},conversation_list:{header_title:"대화",ended:"종료됨",footer_title:"대화 시작"},date_format:{just_now:"방금",minutes_ago:_=>`${_}분 전`,hours_ago:_=>`${_}시간 전`,date_short:"yyyy/MM/dd",date_separator:"yyyy년 M월 d일",message_timestamp:"p"},csat:{title:"귀하의 피드백은 우리에게 중요합니다.",submitted_label:"성공적으로 제출되었습니다!",cre_question:"문제가 해결되었나요?",cre_positive_label:"네, 감사합니다! 👍",cre_negative_label:"아니요, 도움이 되지 않았어요.",reason_placeholder:"의견을 공유해주세요.",question:"귀하의 경험을 어떻게 평가하시겠습니까?",submit_label:"제출",submission_expired:"죄송합니다. 설문 응답 기간이 종료되었습니다."},form:{optional_label:"선택",validation_required:"이 항목은 필수입니다"},common:{placeholder_something_went_wrong:"문제가 발생했습니다.",placeholder_no_messages:"메시지가 없습니다.",placeholder_no_conversations:"아직 대화가 없습니다",placeholder_something_went_wrong_retry_label:"다시 시도"},feedback:{title:"피드백 제출",good:"좋아요",bad:"별로예요",comment_label:"코멘트 (선택사항)",comment_placeholder:"코멘트를 남겨주세요",cancel:"취소",submit:"제출",save:"저장",edit:"피드백 수정",remove:"피드백 삭제"}},e={language:"ko",strings:T,dateLocale:a.ko},o=t.mapCommonStringsToReactFormat(e.strings),s={...o,HEADER_BUTTON__AGENT_HANDOFF:"상담사와 연결하기",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"계속하려면 옵션을 선택하세요",BUTTON__CANCEL:"취소",BUTTON__SUBMIT:"제출",SUBMITTED:"제출됨",TRY_AGAIN:"다시 시도해 주세요.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"한 번에 하나의 이미지만 업로드할 수 있습니다.",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"파일당 최대 크기는 %d MB입니다.",FILE_VIEWER__UNSUPPORT:"지원되지 않는 메시지",CSAT5_RATING_SCORE_1:"최악이에요.",CSAT5_RATING_SCORE_2:"별로예요.",CSAT5_RATING_SCORE_3:"괜찮아요.",CSAT5_RATING_SCORE_4:"좋아요.",CSAT5_RATING_SCORE_5:"최고예요.",FORM_UNAVAILABLE:"양식을 더 이상 사용할 수 없습니다.",FORM_NOT_SUPPORTED:"이 양식은 현재 버전에서 지원되지 않습니다.",FORM_VALIDATION_MIN_LENGTH:_=>`최소 ${_}자가 필요합니다`,FORM_VALIDATION_MAX_LENGTH:_=>`최대 ${_}자까지 입력 가능합니다`,FORM_VALIDATION_MIN:_=>`최소값은 ${_}입니다`,FORM_VALIDATION_MAX:_=>`최대값은 ${_}입니다`,FORM_VALIDATION_MIN_SELECT:_=>`최소 ${_}개 옵션을 선택해 주세요`,FORM_VALIDATION_MAX_SELECT:_=>`최대 ${_}개 옵션을 선택해 주세요`,FORM_VALIDATION_REGEX_FAILED:"유효하지 않은 형식",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:o.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"a h:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"카테고리 없음",CONVERSATION_CLOSED_FOOTER_LABEL:"대화가 종료되었습니다",START_NEW_CONVERSATION:"💬 새로운 대화 시작하기",RETURN_TO_CONVERSATION:"💬 대화로 돌아가기",BUTTON__SAVE:"저장",BUTTON__OK:"확인",NO_NAME:"(이름 없음)",CHANNEL_FROZEN:"채널이 동결되었습니다."},l={language:e.language,dateLocale:e.dateLocale,stringSet:s};exports.default=l;
@@ -1,4 +1,4 @@
1
- "use strict";var oo=Object.defineProperty;var so=(e,t,n)=>t in e?oo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var U=(e,t,n)=>so(e,typeof t!="symbol"?t+"":t,n);const u=require("react"),Z=require("@sendbird/chat"),S=require("styled-components"),ye=require("date-fns"),ao=require("date-fns/locale/en-US"),_e=require("@sendbird/chat/message"),q=require("@sendbird/chat/aiAgent"),lt=require("@sendbird/chat/groupChannel"),io=require("react-dom"),Lt=require("@sendbird/react-uikit-message-template-view"),lo=require("@sendbird/uikit-message-template"),Ue=require("@sendbird/uikit-tools"),co=require("dompurify"),uo=require("date-fns/isSameDay"),mo=require("@emotion/is-prop-valid"),gt=e=>e&&e.__esModule?e:{default:e};function go(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const o=go(u),ho=gt(Z),f=gt(S),Jn=gt(co),fo=gt(mo),X=(e,t)=>{const n=u.createContext(null),r=({children:i,value:l})=>o.createElement(n.Provider,{value:l},typeof i=="function"?i(l):i),s=({children:i})=>o.createElement(n.Consumer,null,l=>l?typeof i=="function"?i(l):i:null),a=()=>{const i=u.useContext(n);if(!i)throw new Error(`use${e}Context must be used within a ${e}Provider`);return i};return n.displayName=`${e}Context`,r.displayName=`${e}Provider`,s.displayName=`${e}Consumer`,a.displayName=`use${e}Context`,{Context:n,Provider:r,Consumer:s,useContext:a}};function pe(e){const t=u.createContext({Template:e.template,updateTemplate:()=>{},components:e.components,updateComponent:()=>{}});function n({children:a}){const[i,l]=u.useState(()=>e.template),[c,d]=u.useState(e.components),h={Template:i,updateTemplate:b=>l(()=>b),components:c,updateComponent:(b,E)=>d(C=>({...C,[b]:E}))};return o.createElement(t.Provider,{value:h},a)}function r({template:a,children:i}){const{updateTemplate:l}=u.useContext(t);return u.useLayoutEffect(()=>{a&&l(a)},[a]),o.createElement(o.Fragment,null,i)}function s({children:a}){return o.createElement(n,null,a)}return s.defaults=e,s.useContext=()=>u.useContext(t),s.Context=t,s.Template=r,Object.keys(e.components).forEach(a=>{s[a]=function({component:l}){const{updateComponent:c}=u.useContext(t);return u.useLayoutEffect(()=>{l&&c(a,l)},[l]),null}}),s}function po(...e){return function({children:n}){return e.reduce((r,s)=>o.createElement(s,null,r),n)}}const Te=e=>{var t,n;return!!(e!=null&&e.isAIAgent&&((t=e==null?void 0:e.conversation)==null?void 0:t.status)===q.ConversationStatus.CLOSED||e!=null&&e.isDesk&&((n=e==null?void 0:e.helpdeskInfo)==null?void 0:n.ticketStatus)==="closed")},Wt=e=>{var t,n;return!!(e!=null&&e.isAIAgent&&((t=e==null?void 0:e.conversation)==null?void 0:t.status)===q.ConversationStatus.OPEN||e!=null&&e.isDesk&&((n=e==null?void 0:e.helpdeskInfo)==null?void 0:n.ticketStatus)==="open")};function Be(e){var n,r,s;return typeof(((n=e==null?void 0:e.conversation)==null?void 0:n.handedOverAt)??((s=(r=e==null?void 0:e.conversation)==null?void 0:r.handoff)==null?void 0:s.timestamp))=="number"}function bo(e){var t;if(((t=e==null?void 0:e.resolution)==null?void 0:t.determinedBy)==="user")return e.resolution.isResolved}function En(e){return!!e&&e<Date.now()}function Eo(e){return!e.title}function xo(e,t){var n;if(e)return Eo(e)?{...e,title:t.title,csat_question:t.question,csat_scores:[{label:"",image_url:"https://static.dashboard.sendbird.com/assets/ai-agent/angry-active.png"},{label:"",image_url:"https://static.dashboard.sendbird.com/assets/ai-agent/suspicious-active.png"},{label:"",image_url:"https://static.dashboard.sendbird.com/assets/ai-agent/neutral-active.png"},{label:"",image_url:"https://static.dashboard.sendbird.com/assets/ai-agent/smile-active.png"},{label:"",image_url:"https://static.dashboard.sendbird.com/assets/ai-agent/happy-active.png"}],cre:{required:((n=e.cre)==null?void 0:n.required)??!0,question:t.cre.question,positive_label:t.cre.positive_label,negative_label:t.cre.negative_label},follow_up:[{response_type:"free_text",scores:[1,2,3,4,5],question:t.followUp.question}],csat_submit_label:t.submit_label,csat_submitted_label:t.submitted_label}:e}function vo(e){const t=e.lastMessage;return t!=null&&t.isUserMessage()||t!=null&&t.isAdminMessage()?t.message||"":t!=null&&t.isFileMessage()?t.message||t.name||"FILE":e.name}function Co(e,t,n){var i;const r=new Date,s=new Date(((i=e.lastMessage)==null?void 0:i.createdAt)||e.createdAt),a=ye.differenceInMinutes(r,s);return a<1?n.justNow:a<60?n.minutesAgo(a):ye.isToday(s)?n.hoursAgo(ye.differenceInHours(r,s)):t(s,n.dateShortFormat)}const Ne="sb-agent",Qn="KEY_IMG_ASPECT_RATIO",yo="*/*",B={BODY_MAX_WIDTH:244,WIDE_BODY_MAX_WIDTH:640,AVATAR_SIZE:26,BODY_TIME_GAP:4,HORIZONTAL_PADDING:12,GAP_GROUPED:2,GAP_UNGROUPED:16},he=e=>!!e&&"sender"in e,_o=e=>he(e)?e.sendingStatus==="succeeded"?String(e.messageId):e.reqId:String(e.messageId),So=(e,t,n,r=!0)=>{if(!r||!he(e))return"single";const s=()=>{if(!t||!he(t))return!1;const c=t.sender.userId===e.sender.userId,d=ye.isSameMinute(t.createdAt,e.createdAt);return c&&d},a=()=>{if(!n||!he(n))return!1;const c=n.sender.userId===e.sender.userId,d=ye.isSameMinute(n.createdAt,e.createdAt);return c&&d},i=s(),l=a();return i&&l?"middle":i?"bottom":l?"top":"single"},je=(e,t)=>(()=>{var r;return he(e)?e.sender.userId:((r=e==null?void 0:e.sender)==null?void 0:r.userId)??void 0})()===t,De={isAdmin:e=>e.isAdminMessage(),isCSAT:e=>{var t;return e.isAdminMessage()&&!!((t=e.extendedMessagePayload)!=null&&t.csat)},isIncoming:(e,t)=>he(e)&&e.sender.userId!==t,isOutgoing:(e,t)=>he(e)&&(e.sender.userId===t||e.sendingStatus===_e.SendingStatus.PENDING)},er=e=>e.startsWith("image/"),tr=e=>e.startsWith("video/"),qt=(e,t)=>{if(e&&!e.startsWith(".")){const n=e.split(".").pop();if(n&&n!==e)return n.toUpperCase()}if(t){const[,n]=t.split("/");if(n)return n.toUpperCase()}return"FILE"},nr=e=>e.messageType==="file"?e.message.length>0&&e.file.name!==e.message:e.message.length>0,jt=e=>{switch(e){case"top":case"middle":return B.GAP_GROUPED;default:return B.GAP_UNGROUPED}},To=(e,t)=>{const n=/```(\w+)?\n([\s\S]*?)```/g,r=[];let s=0;return e.replace(n,(a,...i)=>{const[l,c,d]=i;return s<d&&r.push({type:"text",value:e.slice(s,d).trim()}),r.push({type:"code",value:c.trim(),language:l?l.trim():"plaintext"}),s=d+a.length,a}),s<e.length&&r.push({type:"text",value:e.slice(s).trim()}),t?r.map(a=>a.type!=="text"?a:{...a,value:t(a.value)}):r},Ao=e=>e.replace(/\[([^\]]+)\](?!\()/g,"\\[$1\\]"),wo=e=>e.replace(/([a-zA-Z0-9])_(?=[a-zA-Z0-9])/g,"$1\\_"),ko=e=>e.replace(/~~/g,"\\~\\~"),Io=e=>{let t=e;return t=Ao(t),t=wo(t),t=ko(t),t},$o=typeof navigator<"u"&&navigator.product==="ReactNative",xn=(e,t)=>{const n=r=>!t||t.length===0?!0:he(r)&&t.includes(r.sendingStatus);return $o?e.find(n):e.findLast(n)};function fe(){}function Mo(){const e=typeof navigator<"u"?navigator.userAgent:"",t=/iPad|iPhone|iPod/.test(e),n=/Android/.test(e);return t||n}function Lo(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t.toString(16)}const Ot=e=>{try{return JSON.parse(e===""?"{}":e)}catch{return{}}},Se={isStreaming(e){const t=Ot(e.data);return typeof t=="object"&&!!t.stream},isWelcomeMessage(e,t){var n;if(((n=e.extendedMessagePayload)==null?void 0:n.bot_message_type)==="welcome")return!0;if(je(e,t)){const r=Ot(e.data);return!(r!=null&&r.respond_mesg_id)&&!(r!=null&&r.stream)}return!1},isGeneratedMessage(e){var t;return((t=e.extendedMessagePayload)==null?void 0:t.bot_message_type)==="generated"},hasFeedback(e){var t;return!!((t=e.extendedMessagePayload)!=null&&t.feedback)}},Tt=`@${Ne}`,vn=({appId:e,aiAgentId:t,storage:n})=>{const r={templateBase:`${Tt}-template`,template:s=>`${r.templateBase}/templates/${s}`,templateToken:()=>`${r.templateBase}-template/message-template/tokens`,messengerSession:s=>{const a=Lo(`${e}/${t}/${s}`);return`${Tt}-udata/${a}`},anonUserSession:()=>`${Tt}-session/${e}/${t}`};return{template:{set:(s,a)=>n.set(r.template(s),a),get:s=>n.get(r.template(s)),setCachedToken:s=>n.set(r.templateToken(),s),getCachedToken:()=>n.get(r.templateToken()),clear:()=>{n.getKeys(r.templateBase).forEach(n.delete)}},messenger:{getSettings:s=>{try{const a=n.get(r.messengerSession(s));return a?JSON.parse(a):null}catch{return null}},setSettings:(s,a)=>{try{delete a.auto_created_user;const i=JSON.stringify(a);n.set(r.messengerSession(s),i)}catch{return}},getAnonUser:()=>{try{const s=n.get(r.anonUserSession());return s?JSON.parse(s):null}catch{return null}},setAnonUser:s=>{try{const a=JSON.stringify(s);n.set(r.anonUserSession(),a)}catch{return}},clear:s=>{try{s&&n.delete(r.messengerSession(s)),n.delete(r.anonUserSession())}catch{return}}}}};class rr{constructor(t){U(this,"subscribers",{});this.logger=t}async send(t){const n=Oo(),r=this.subscribers[t.type];if(r){this.logger.debug(`messenger.dispatcher: dispatching command: ${t.type}`,t.payload);const s=r.map(a=>a(t.payload));await Promise.all(s).catch(a=>{this.logger.error(`messenger.dispatcher: error in callback for command: ${t.type}`,a)})}return n.resolve(),n.promise}subscribe(t,n){this.subscribers[t]||(this.subscribers[t]=[]),this.subscribers[t].push(n)}unsubscribe(t,n){this.subscribers[t]&&(this.subscribers[t]=this.subscribers[t].filter(r=>r!==n))}}const Oo=()=>{let e=fe,t=fe;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}};var Kt=(e=>(e[e.VERBOSE=0]="VERBOSE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.NONE=5]="NONE",e))(Kt||{});class or{constructor(t){U(this,"level");this.level=t}verbose(...t){this.level<=0&&console.log(`[${Ne}/verbose]`,...t)}debug(...t){this.level<=1&&console.log(`[${Ne}/debug]`,...t)}info(...t){this.level<=2&&console.log(`[${Ne}/info]`,...t)}warn(...t){this.level<=3&&console.warn(`[${Ne}/warn]`,...t)}error(...t){this.level<=4&&console.error(`[${Ne}/error]`,...t)}}function Cn(e,t,n,r){const s=ho.default.init({appId:e,modules:[new lt.GroupChannelModule,new q.AIAgentModule],localCacheEnabled:!0,options:new Z.SendbirdChatOptions({typingIndicatorInvalidateTime:2e4}),...r});return s.addSendbirdExtensions([{version:n,product:Z.SendbirdProduct.AI_AGENT,platform:t.platform}],{platform:t.deviceOSPlatform,version:t.deviceOSVersion},t.customData)||console.warn("Invalid Sendbird Extensions",t),s}function Ro(e){const t=n=>{throw new Error(`Please initialize chat sdk with ${n}`)};typeof e.groupChannel!="object"&&t("GroupChannelModule"),typeof e.aiAgent!="object"&&t("AIAgentModule")}const Ce={conversation:{isTalkToAgentViewEnabled:!0,scrollMode:"auto",newMessageIndicatorEnabled:!0,senderAvatarEnabled:!0,header:{avatarEnabled:!0},input:{camera:{photoEnabled:!0},gallery:{photoEnabled:!0},fileEnabled:!0},fileViewer:{downloadEnabled:!0}}},Do=e=>{var t,n,r,s,a,i,l,c,d,h,b,E,C,y;return e?{...Ce,...e,conversation:{...Ce.conversation,...e==null?void 0:e.conversation,header:{...(t=Ce.conversation)==null?void 0:t.header,...(n=e==null?void 0:e.conversation)==null?void 0:n.header},input:{...(r=Ce.conversation)==null?void 0:r.input,...(s=e==null?void 0:e.conversation)==null?void 0:s.input,camera:{...(i=(a=Ce.conversation)==null?void 0:a.input)==null?void 0:i.camera,...(c=(l=e==null?void 0:e.conversation)==null?void 0:l.input)==null?void 0:c.camera},gallery:{...(h=(d=Ce.conversation)==null?void 0:d.input)==null?void 0:h.gallery,...(E=(b=e==null?void 0:e.conversation)==null?void 0:b.input)==null?void 0:E.gallery}},fileViewer:{...(C=Ce.conversation)==null?void 0:C.fileViewer,...(y=e==null?void 0:e.conversation)==null?void 0:y.fileViewer}}}:Ce},{Provider:No,useContext:K}=X("AIAgent");function Po({appId:e,aiAgentId:t,keyValueStorage:n,networkStateAdapter:r,language:s,countryCode:a,context:i,queryParams:l,config:c,chatSDK:d,chatParams:h,children:b,logger:E,dispatcher:C,messengerVersion:y,extensions:x={platform:Z.SendbirdPlatform.JS,deviceOSPlatform:Mo()?Z.DeviceOsPlatform.MOBILE_WEB:Z.DeviceOsPlatform.WEB}}){const[m,p]=u.useState(()=>{const v=E??new or(Kt.WARN),_=C??new rr(v);return{logger:v,dispatcher:_,chatSDK:d??Cn(e,x,y,h),cache:vn({appId:e,aiAgentId:t,storage:n})}});return u.useEffect(()=>{p(v=>{let _=v.logger,I=v.dispatcher,T=v.chatSDK;return E&&E!==v.logger&&(_=E),C&&C!==v.dispatcher&&(I=C),d&&d!==v.chatSDK?T=d:!d&&v.chatSDK.appId!==e&&(T=Cn(e,x,y,{newInstance:!0,...h})),{...v,logger:_,dispatcher:I,chatSDK:T,cache:vn({appId:e,aiAgentId:t,storage:n})}})},[e,t,E,C,d,n]),u.useEffect(()=>()=>{m.chatSDK.disconnectWebSocket()},[m.chatSDK]),Ro(m.chatSDK),o.createElement(No,{value:{...m,appId:e,aiAgentId:t,context:i,language:s,countryCode:a,queryParams:l,config:Do(c),networkStateAdapter:r}},b)}const Bo=(e,t,n)=>Ue.useGroupChannelMessages(e,t,{...n,strictStreamingOrder:!0});var Rt=(e=>(e.ConversationClose="conv.close",e))(Rt||{});class Fo{constructor(t={}){U(this,"payload");this.payload=t}toJSON(){return JSON.stringify({type:this.type,payload:this.payload})}}const sr={CloseConversation:e=>new Uo(e)};class Uo extends Fo{constructor(){super(...arguments);U(this,"type","conv.close")}}const ar=(e,t,n={})=>{let r=null,s=null,a=null;const{leading:i=!0,trailing:l=!0}=n,c=(...d)=>{const h=Date.now();if(a===null||h-a>=t)i?(e(...d),a=h):(s=d,a=h);else if(s=d,l&&!r){const b=t-(h-a);r=setTimeout(()=>{s&&l&&(e(...s),a=Date.now()),r=null,s=null},b)}};return c.cancel=()=>{r&&(clearTimeout(r),r=null),s=null,a=null},c},qe={DEFAULT_PRIMARY:"#000000",DEFAULT_BOT_MSG_BG:"#ECECEC",WHITE:"#ffffff",BLACK:"#000000"};function ir(e){return e.length===4?`#${[...e.slice(1)].map(t=>t+t).join("")}`:e}function Ho(e){const t=ir(e);return[parseInt(t.slice(1,3),16),parseInt(t.slice(3,5),16),parseInt(t.slice(5,7),16)]}function zo(e){return`#${e.map(t=>t.toString(16).padStart(2,"0")).join("")}`}function Vo(e,t,n){e/=255,t/=255,n/=255;const r=Math.max(e,t,n),s=Math.min(e,t,n),a=r-s;let i=0,l=0;const c=(r+s)/2;return r!==s&&(l=c>.5?a/(2-r-s):a/(r+s)),r===e?i=(t-n)/a+(t<n?6:0):r===t?i=(n-e)/a+2:r===n&&(i=(e-t)/a+4),i/=6,[i,l,c]}function Go(e,t,n){let r,s,a;if(t===0)r=s=a=n;else{const i=function(h,b,E){return E<0&&(E+=1),E>1&&(E-=1),E<.16666666666666666?h+(b-h)*6*E:E<.5?b:E<.6666666666666666?h+(b-h)*(.6666666666666666-E)*6:h},l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;r=i(c,l,e+1/3),s=i(c,l,e),a=i(c,l,e-1/3)}return[Math.round(r*255),Math.round(s*255),Math.round(a*255)]}function Qe(e,t,n){const[r,s,a]=Ho(e),[i,l,c]=Vo(r,s,a),d=Math.max(0,Math.min(1,c*t)),h=Math.max(0,Math.min(1,l*n)),[b,E,C]=Go(i,h,d);return zo([Math.round(b),Math.round(E),Math.round(C)])}function Wo(e,t="light"){return{extraDark:Qe(e,.6,1.2),dark:Qe(e,.85,1.1),main:e,light:Qe(e,t==="dark"?1.1:1.5,t==="dark"?.95:.9),extraLight:Qe(e,t==="dark"?1.2:1.75,t==="dark"?.9:.8)}}function Dt(e){const t=ir(e),n=149,r=+`0x${t[1]}${t[2]}`,s=+`0x${t[3]}${t[4]}`,a=+`0x${t[5]}${t[6]}`;return r*.299+s*.587+a*.114>n?qe.BLACK:qe.WHITE}function qo(e,t,n,r,s){return{base:{primary:t,primaryContrastContent:n,background:e.background50,headerBackground:e.background50,modalContentBackground:e.background50},metadata:{errorContent:e.ondark.textHighEmphasis},messageInput:{text:e.onlight.textHighEmphasis,placeholderText:e.onlight.textLowEmphasis,background:e.background100},messageIncoming:{text:s,background:r},messageOutgoing:{text:n,background:t},csat:{background:e.background100}}}const jo=(e,t,n,r,s)=>({base:{primary:t,primaryContrastContent:n,background:e.background600,headerBackground:e.background500,modalContentBackground:e.background500},metadata:{errorContent:e.ondark.textHighEmphasis},messageInput:{text:e.ondark.textHighEmphasis,placeholderText:e.ondark.textLowEmphasis,background:e.background400},messageIncoming:{text:s,background:r},messageOutgoing:{text:n,background:t},csat:{background:e.background400}}),et={primary:{extraDark:"#491389",dark:"#6211c8",main:"#742ddd",light:"#c2a9fa",extraLight:"#dbd1ff"},secondary:{extraDark:"#066858",dark:"#027d69",main:"#259c72",light:"#69c085",extraLight:"#a8e2ab"},error:{extraDark:"#9d091e",dark:"#bf0711",main:"#de360b",light:"#f66161",extraLight:"#fdaaaa"},information:{extraDark:"#241389",dark:"#362ca9",main:"#4a48cd",light:"#a9bbfa",extraLight:"#d1dbff"},background700:"#000000",background600:"#161616",background500:"#2c2c2c",background400:"#393939",background300:"#bdbdbd",background200:"#e0e0e0",background100:"#eeeeee",background50:"#ffffff",onlight:{textHighEmphasis:"rgba(0, 0, 0, 0.88)",textMidEmphasis:"rgba(0, 0, 0, 0.5)",textLowEmphasis:"rgba(0, 0, 0, 0.38)",textDisabled:"rgba(0, 0, 0, 0.12)"},ondark:{textHighEmphasis:"rgba(255, 255, 255, 0.88)",textMidEmphasis:"rgba(255, 255, 255, 0.5)",textLowEmphasis:"rgba(255, 255, 255, 0.38)",textDisabled:"rgba(255, 255, 255, 0.12)"},overlay:{dark:"rgba(0, 0, 0, 0.55)",light:"rgba(22, 22, 22, 0.32)"}},At={h1:{fontSize:18,fontWeight:700},h2:{fontSize:16,fontWeight:700},subtitle1:{fontSize:16,fontWeight:500},subtitle2:{fontSize:16,fontWeight:400},body1:{fontSize:16,fontWeight:400},body2:{fontSize:14,fontWeight:500},body3:{fontSize:14,fontWeight:400},button:{fontSize:14,fontWeight:700},caption1:{fontSize:12,fontWeight:700},caption2:{fontSize:12,fontWeight:400},caption3:{fontSize:11,fontWeight:700},caption4:{fontSize:11,fontWeight:400}};function yn(e){const t=Ko(e),{colors:n,aiAgentColorVariables:r}=Yo(e,t),s=Xo(e);return{selectedTheme:e.selectedTheme,palette:t,colors:n,aiAgentColorVariables:r,typography:s}}function Ko({selectedTheme:e,palette:t,primary:n}){const r=t!=null&&t.primary?t.primary:n?n===et.primary.main?et.primary:Wo(n,e):et.primary;return{...et,primary:r,...t}}function Yo({selectedTheme:e,primaryContrast:t,botMessageBackground:n,botMessageBackgroundContrast:r},s){const a=s.primary.main,i=t??Dt(a),l=n??qe.DEFAULT_BOT_MSG_BG,c=r??Dt(l);return{colors:(e==="light"?qo:jo)(s,a,i,l,c),aiAgentColorVariables:{primary_color:a,bot_message_bg_color:l,primary_contrast_color:i,bot_message_bg_contrast_color:c}}}function Zo(e,t,n){const r={...e};return n.forEach(s=>{const a=t[s];a!=null&&(r[s]=a)}),r}function Xo({typography:e}){if(!e)return At;const t={...At};return Object.keys(e).forEach(n=>{const r=e[n];if(r&&typeof r=="object"){const s=At[n],a=["fontSize","fontWeight","fontFamily","lineHeight"];t[n]=Zo(s,r,a)}}),t}const{Provider:Jo,useContext:Yt}=X("AIAgentTheme");function Qo({logger:e,palette:t,typography:n,appearance:r,children:s}){const a=u.useRef(null),[i,l]=u.useState(()=>yn({selectedTheme:(r==null?void 0:r.theme)??"light",palette:t,typography:n,primary:r==null?void 0:r.primaryColor,botMessageBackground:r==null?void 0:r.botMessageBackgroundColor})),c=u.useCallback((d,h)=>{h&&(a.current=h);const b=(r==null?void 0:r.theme)??d,E=a.current?a.current.themes[b]:null,C={primary:r==null?void 0:r.primaryColor,primaryContrast:void 0,botMessageBackground:r==null?void 0:r.botMessageBackgroundColor,botMessageBackgroundContrast:void 0};!C.primary&&(E!=null&&E.primary_color)&&(C.primary=E.primary_color,C.primaryContrast=E.primary_contrast_color),!C.botMessageBackground&&(E!=null&&E.bot_message_bg_color)&&(C.botMessageBackground=E.bot_message_bg_color,C.botMessageBackgroundContrast=E.bot_message_bg_contrast_color);const y=yn({selectedTheme:b,palette:t,typography:n,...C});l(y),e==null||e.info("theme.update:",b)},[r==null?void 0:r.theme,r==null?void 0:r.primaryColor,r==null?void 0:r.botMessageBackgroundColor,t,n,e]);return u.useEffect(()=>{(r!=null&&r.theme||r!=null&&r.primaryColor||r!=null&&r.botMessageBackgroundColor)&&c(i.selectedTheme)},[r==null?void 0:r.theme,r==null?void 0:r.primaryColor,r==null?void 0:r.botMessageBackgroundColor]),o.createElement(Jo,{value:{theme:i,updateTheme:c}},s)}const _n=25*1024*1024,es={off:"off",always:"always",handed_off_only:"handed_off_only"},ts=()=>{const[e,t]=u.useState(()=>({maxAttachmentCount:1,attachmentMode:"handed_off_only",defaultUploadSizeLimit:_n,uploadSizeLimitPerType:new Map,supportedImageMimeTypes:new Set(["image/png","image/jpeg","image/jpg"]),supportedFileMimeTypes:new Set(["application/pdf"])})),n=u.useCallback(({active_channel:s,upload_restriction:a})=>{const{maxAttachmentCount:i,attachmentMode:l,defaultUploadSizeLimit:c,supportedImageMimeTypes:d,supportedFileMimeTypes:h}=e;t({maxAttachmentCount:i,attachmentMode:es[s.attachment_mode]??l,defaultUploadSizeLimit:(a==null?void 0:a.default_upload_size_limit)??c,uploadSizeLimitPerType:new Map(Object.entries((a==null?void 0:a.upload_size_limit_per_type)??[])),supportedImageMimeTypes:new Set((a==null?void 0:a.supported_image_mime_types)??d),supportedFileMimeTypes:new Set((a==null?void 0:a.supported_file_mime_types)??h)})},[]),r=u.useCallback(s=>{const{channel:a,uploadSizeLimit:i=_n}=s,l=(d=!0)=>a!=null&&a.isAIAgent?d?Be(a):!1:!0,c=d=>{if(l())return e.defaultUploadSizeLimit??i;const h=e.defaultUploadSizeLimit??i,b=e.uploadSizeLimitPerType.get(d)??h;return Math.min(h,b)};return{maxAttachmentCount:e.maxAttachmentCount,isEnabled:()=>{if(l(!1))return!0;switch(e.attachmentMode){case"off":return!1;case"always":return!0;case"handed_off_only":return Be(a);default:return!0}},get supportedMimeTypes(){return l()?[yo]:[...e.supportedImageMimeTypes,...e.supportedFileMimeTypes]},isSupportedMimeType:d=>l()?!0:e.supportedImageMimeTypes.has(d)||e.supportedFileMimeTypes.has(d),getUploadSizeLimit:c,getUploadSizeLimitInMB:d=>c(d)/(1024*1024)}},[e]);return{updateBaseAttachmentRules:n,createAttachmentRules:r}};function lr(){const{chatSDK:e,logger:t}=K();return u.useCallback(async n=>{if(n.userId===""){const r=new Error("userId cannot be empty string for messenger settings request");throw t.error("requestMessengerSettings: invalid userId",r),r}return await e.aiAgent.requestMessengerSettings(n)},[e,t])}function ns(){const{chatSDK:e,logger:t}=K(),n=u.useCallback(async(s,a,i)=>{if(t.debug("useChatConnection.connect: start, session",s.userId),a){const l=new Z.SessionHandler({...a,onSessionTokenRequired:rs(a.onSessionTokenRequired,i)});e.setSessionHandler(l)}try{return await e.connect(s.userId,s.authToken),t.debug("useChatConnection.connect: end, currentUser",e.currentUser),e.currentUser}catch(l){const c=l;if(e.isCacheEnabled){if(ss(c))t.warn("useChatConnection.connect","offline connect restricted",c.message,c.code),t.warn("useChatConnection.connect","clear cached-data"),await e.clearCachedData().catch(d=>t.warn("useChatConnection.connect","clear cached-data failure",d));else if(e.currentUser)return t.debug("useChatConnection.connect: end (offline), currentUser",e.currentUser),e.currentUser}throw t.warn("useChatConnection.connect","connect failure",c.message,c.code),c}},[e,t]),r=u.useCallback(async()=>{t.debug("useChatConnection.disconnect: start"),await e.disconnect(),t.debug("useChatConnection.disconnect: end")},[e,t]);return{connect:n,disconnect:r}}function rs(e,t){if(e)return async(n,r)=>{new Promise((s,a)=>e==null?void 0:e(s,a)).then(s=>{s&&(t==null||t(s)),n(s)}).catch(s=>{r(s)})}}const os=[400300,400301,400302,400310];function ss(e){return os.some(t=>e.code===t)}class cr{constructor({userId:t,authToken:n,sessionHandler:r}){U(this,"userId");U(this,"authToken");U(this,"sessionHandler");this.userId=t,this.authToken=n,this.sessionHandler=r}}class Nt{constructor(){U(this,"userId");U(this,"authToken");U(this,"sessionHandler")}}const as=1440*60*1e3,is=e=>{const{logger:t,cache:n}=K(),r=()=>{const a=n.messenger.getAnonUser();return a?a.expireAt-as<=Date.now()?(t.debug("useUserSessionCandidate.getAnonymousSessionInfo: auto session expired, clear cache"),n.messenger.clear(a.userId),null):(t.debug("useUserSessionCandidate.getAnonymousSessionInfo: auto session info detected"),a):null},s=()=>{if(!e||e instanceof Nt)throw new Error("userSessionInfo must be an instance of ManualSessionInfo");if(typeof e.userId!="string")throw new Error("userSessionInfo.userId must be a string");const a=["userId","authToken","sessionHandler"].filter(i=>!(i in e));return a.length>0&&t.error(`useUserSessionCandidate.getManualSessionInfo: missing required keys in userSessionInfo: ${a.join(", ")}`),t.debug("useUserSessionCandidate.getManualSessionInfo: manual session info detected"),e};return u.useMemo(()=>e instanceof cr?{type:"manual",userSessionCandidate:s()}:e instanceof Nt?{type:"anonymous",userSessionCandidate:r()}:e&&typeof e=="object"?(t.warn("Please use ManualSessionInfo instead of the old userSessionInfo format."),{type:"manual",userSessionCandidate:s()}):e===void 0?(t.warn("Please use AnonymousSessionInfo instead of undefined userSessionInfo."),{type:"anonymous",userSessionCandidate:r()}):{type:"anonymous",userSessionCandidate:null},[t,e==null?void 0:e.userId,e==null?void 0:e.authToken,e==null?void 0:e.sessionHandler,n.messenger.getAnonUser,n.messenger.clear])};function ls({userSessionInfo:e,onUpdateMessengerSettings:t,onPreAuth:n,onPostAuth:r,onErrorAuth:s,onAuthTokenRefreshed:a,onPostDeauth:i,forceCreateChannel:l}){const{aiAgentId:c,language:d,context:h,countryCode:b,logger:E,cache:C}=K(),{connect:y,disconnect:x}=ns(),{type:m,userSessionCandidate:p}=is(e),v=lr(),_=u.useCallback(async()=>{var M;E.debug("useAuthentication.authenticate: start");const T=p!=null&&p.userId?C.messenger.getSettings(p.userId):null;T!=null&&T.bot&&(t(T),E.debug("useAuthentication.authenticate: cached messenger settings",T));const L=await v({aiAgentId:c,userId:p==null?void 0:p.userId,language:d,country:b,context:h,forceCreateChannel:l,knownActiveChannelUrl:(M=T==null?void 0:T.active_channel)==null?void 0:M.channel_url});E.debug("useAuthentication.authenticate: messenger settings response",L);let $=null;if(L.auto_created_user)if(m==="manual")E.warn("Received auto created user info but current session is manual. Ignoring auto created user info."),$={userId:p.userId,authToken:p.authToken};else{const{user_id:R,session_token:z,expire_at:G}=L.auto_created_user;C.messenger.setAnonUser({userId:R,authToken:z,expireAt:G}),$={userId:R,authToken:z}}else $={userId:(p==null?void 0:p.userId)??"",authToken:(p==null?void 0:p.authToken)??""};C.messenger.setSettings($.userId,L),t(L);try{await n(L,$),await y($,p==null?void 0:p.sessionHandler,a),await r(L,$)}catch(R){throw R instanceof Error&&(s(R),E.error("useAuthentication.authenticate: failed to connect",R)),R}return L},[v,y,m,p==null?void 0:p.userId,p==null?void 0:p.sessionHandler,p==null?void 0:p.authToken,c,d,h,b,l,C.messenger.setAnonUser,C.messenger.getSettings,C.messenger.setSettings,t,n,r,s,a]),I=u.useCallback(async()=>{E.debug("useAuthentication.deauthenticate: start"),await x(),i(),E.debug("useAuthentication.deauthenticate: completed")},[x,E,i]);return{authenticate:_,deauthenticate:I,userSessionCandidate:p}}const ur=e=>{try{const t=JSON.parse(e);return typeof t=="string"?JSON.stringify(t).slice(1,-1):e.trim()}catch{return JSON.stringify(e).slice(1,-1)}},Ke=e=>JSON.parse(e),ht=e=>JSON.parse(e);function cs(e,t){const[n,r]=t.split(",").map(s=>s.trim());return e==="dark"&&r||n}function us(e){const t={};function n(r,s=""){for(const[a,i]of Object.entries(r)){const l=s?`${s}.${a}`:a;i&&typeof i=="object"&&!Array.isArray(i)?n(i,l):t[l]=i}}return n(e),t}function Zt({template:e,variables:t,variableKeyPattern:n,variableValueTransformer:r}){return Object.entries(t).reduce((s,[a,i])=>{if(!r&&!["number","boolean","string"].includes(typeof i))throw new Error(`If transformer is not provided, value(${a}:${i}) must be a {string, number, or boolean}`);const l=r?r(i):String(i),c=n(a);return s.replace(c,ur(l))},e)}async function ds({template:e,variables:t,variableKeyPattern:n,variableValueTransformer:r}){return(await Promise.all(Object.entries(t).map(async([a,i])=>{const l=await r(i);return{regex:n(a),transformedValue:l}}))).reduce((a,{regex:i,transformedValue:l})=>a.replace(i,ur(l)),e)}const ms=()=>{const{chatSDK:e,logger:t,cache:n}=K(),r=u.useCallback(()=>{var l,c;const a=(c=(l=e.appInfo)==null?void 0:l.aiAgentInfo)==null?void 0:c.templateListToken;if(!a)return!1;const i=n.template.getCachedToken();return i?a!==i:!0},[e,n.template.getCachedToken]),s=u.useCallback(async()=>{try{const{templates:a,token:i}=await e.aiAgent.getMessageTemplates({limit:20});for(const{template:l}of a){const{key:c}=Ke(l);n.template.set(c,l)}n.template.setCachedToken(i)}catch(a){t==null||t.error("messageTemplateContext.syncCachedTemplates: error:",a)}},[e,t,n.template.set,n.template.setCachedToken]);return{shouldSyncCachedTemplate:r,syncCachedTemplates:s}},{Provider:gs,useContext:ft}=X("AIAgentMessengerSession"),hs=u.forwardRef(function({userSessionInfo:e,forceCreateChannel:t,children:n},r){const{appId:s,aiAgentId:a,chatSDK:i,language:l,countryCode:c,context:d,cache:h,logger:b}=K(),{updateTheme:E}=Yt(),[C,y]=u.useState(void 0),[x,m]=u.useState(void 0),[p,v]=u.useState(null),[_,I]=u.useState(null),[T,L]=u.useState(null),[$,M]=u.useState(null),{updateBaseAttachmentRules:R,createAttachmentRules:z}=ts(),{shouldSyncCachedTemplate:G,syncCachedTemplates:Ee}=ms(),xe=lr(),{authenticate:Ie,deauthenticate:j}=ls({userSessionInfo:e,forceCreateChannel:t,onUpdateMessengerSettings:u.useCallback(N=>{const{appearance:A,bot:O,launcher:V}=N;E(A.selected_theme,A),L({userId:O.bot_userid,profileUrl:O.bot_profile_url,nickname:O.bot_nickname,replyToFile:O.reply_to_file,specialNotice:O.special_notice,specialNoticeEnabled:O.is_special_notice_enabled,showHandoffButton:O.show_handoff_button??!0,isMultipleActiveConversationsEnabled:O.is_multiple_active_conversations_enabled??!0,isUserFeedbackEnabled:N.bot.is_user_feedback_enabled??!1,isUserFeedbackCommentOptionEnabled:N.bot.is_user_feedback_comment_option_enabled??!1}),M({type:V.image_type||"default_icon",imageUrl:V.image_url}),R(N)},[E]),onPreAuth:u.useCallback((N,A)=>{y(void 0),I(A)},[]),onPostAuth:u.useCallback(async N=>{v(i.currentUser),G()&&await Ee(),m({url:N.active_channel.channel_url,status:q.ConversationStatus.OPEN})},[i,G,Ee]),onErrorAuth:u.useCallback(N=>{y(N)},[]),onAuthTokenRefreshed:u.useCallback(N=>{I(A=>A?{...A,authToken:N}:null)},[]),onPostDeauth:u.useCallback(()=>{h.template.clear(),h.messenger.clear(_==null?void 0:_.userId),v(null),m(void 0),I(null),L(null),M(null)},[h.template.clear,h.messenger.clear,_])}),ne=u.useCallback(async()=>{var N;if(_){b.debug("agentMessengerSession.refreshActiveChannel: try to refresh active channel"),m(void 0);const A=await xe({aiAgentId:a,userId:_.userId,language:l,country:c,context:d,forceCreateChannel:t,knownActiveChannelUrl:(N=h.messenger.getSettings(_.userId))==null?void 0:N.active_channel.channel_url});return h.messenger.setSettings(_.userId,A),m({url:A.active_channel.channel_url,status:q.ConversationStatus.OPEN}),b.info("agentMessengerSession.refreshActiveChannel: refreshed active channel",A.active_channel.channel_url),A.active_channel.channel_url}else throw b.error("agentMessengerSession.refreshActiveChannel: userSession is not ready"),new Error("userSession is not ready")},[xe,s,a,_==null?void 0:_.userId,l,c,d,t,h.messenger.getSettings,h.messenger.setSettings]),ve=u.useCallback(async N=>{if(!(_!=null&&_.userId))throw new Error("Current user is not authenticated. Please authenticate first.");const A=await xe({...N,userId:_.userId,knownActiveChannelUrl:void 0}),O=A.active_channel.channel_url;return h.messenger.setSettings(_.userId,A),O},[_==null?void 0:_.userId,xe]),[w]=u.useState(()=>ar(N=>{var A;b.info("agentMessengerSession.channelChanged: channel.conversation",N.conversation),m({url:N.url,status:((A=N.conversation)==null?void 0:A.status)??q.ConversationStatus.OPEN})},250,{trailing:!1,leading:!0}));return Ue.useGroupChannelHandler(i,{onChannelChanged:N=>{N.isGroupChannel()&&N.url===(x==null?void 0:x.url)&&w(N)}}),u.useEffect(()=>()=>{w.cancel()},[w]),u.useImperativeHandle(r,()=>{const N=async()=>{if(!x)throw new Error("No active conversation. Please start a conversation first.");return await i.groupChannel.getChannel(x.url)};return{activeChannel:x,chatSDK:i,authenticate:Ie,deauthenticate:j,updateContext:async A=>{const V=await(await N()).updateContext(a,A);return{...V,context:V.context??{}}},patchContext:async A=>{const V=await(await N()).patchContext(a,A);return{...V,context:V.context??{}}},getContextObject:async()=>{const O=await(await N()).getContextObject(a);return{...O,context:O.context??{}}}}},[Ie,j,x,i,a,b]),o.createElement(gs,{value:{sdkUser:p,userSessionInfo:e,userSession:_,activeChannel:x,setActiveChannel:m,refreshActiveChannel:ne,createConversation:ve,connectionError:C,aiAgentInfo:T,launcherInfo:$,authenticate:Ie,deauthenticate:j,createAttachmentRules:z}},n)}),fs=()=>{const e=u.useId(),{chatSDK:t,networkStateAdapter:n}=K(),[r,s]=u.useState(()=>n?n.isOnline()?"connected":"reconnecting":"connected");return u.useEffect(()=>{const a=new Z.ConnectionHandler({onDisconnected:()=>s("disconnected"),onConnected:()=>s("connected"),onReconnectStarted:()=>s("reconnecting"),onReconnectSucceeded:()=>s("connected"),onReconnectFailed:()=>s("disconnected"),onConnectionLost:()=>s("reconnecting")});return t.addConnectionHandler(e,a),()=>{t.removeConnectionHandler(e)}},[t,e]),u.useEffect(()=>{if(n)return n.subscribe(()=>{s("reconnecting")})},[n]),r},dr=e=>{const{chatSDK:t}=K(),[n,r]=u.useState([]);return Ue.useGroupChannelHandler(t,{onTypingStatusUpdated(s){if(s.url===(e==null?void 0:e.url)){const a=s.getTypingUsers();r(a)}}}),n},ps=({channel:e,messages:t,isStreamAnimating:n})=>{const{aiAgentInfo:r,userSession:s}=ft(),a=fs(),i=bs({channel:e,lastMessage:xn(t,[_e.SendingStatus.SUCCEEDED]),aiAgentUserId:(r==null?void 0:r.userId)??"",isStreamAnimating:n}),l=Cs({shouldApply:!!(e!=null&&e.isAIAgent)&&!Be(e),isDisabledWhileAIResponding:i,lastMessage:xn(t,[_e.SendingStatus.PENDING,_e.SendingStatus.SUCCEEDED]),currentUserId:(s==null?void 0:s.userId)??""});if(!e||a==="disconnected")return{disabled:!0,disabledBy:"unavailable"};if(a==="reconnecting")return{disabled:!0,disabledBy:"reconnecting"};if(Te(e))return{disabled:!0,disabledBy:"conversation_closed"};if(Es(e))return{disabled:!0,disabledBy:"form_active"};const c=xs(e);return c?{disabled:!0,disabledBy:c}:i||l?{disabled:!0,disabledBy:"ai_responding"}:{disabled:!1,disabledBy:""}},bs=({channel:e,lastMessage:t,aiAgentUserId:n,isStreamAnimating:r})=>{const[s,a]=u.useState(!1),i=dr(e);return u.useEffect(()=>{if(!t)return;const l=i.some(d=>d.userId===n),c=je(t,n)&&(Se.isStreaming(t)||r);a(!!(c||l))},[i,t,n,r]),s},Es=e=>{var i;const t=e==null?void 0:e.lastMessage;if(!t||!e)return!1;const n=t.extendedMessagePayload,r=n==null?void 0:n.form,s=r&&!r.submitted_at&&!r.canceled_at,a=e.isAIAgent&&!!((i=e.conversation)!=null&&i.handedOverAt);return s&&!a},xs=e=>{const t=e==null?void 0:e.lastMessage,n=t==null?void 0:t.extendedMessagePayload;return n==null?void 0:n.user_input_disabled_by},vs=3e4,Cs=({shouldApply:e,lastMessage:t,isDisabledWhileAIResponding:n,currentUserId:r})=>{const[s,a]=u.useState(!1),i=u.useRef(null),l=t&&je(t,r)?t.createdAt:0;return u.useEffect(()=>{const c=()=>{i.current&&(clearTimeout(i.current),i.current=null),a(!1)},d=E=>{i.current&&clearTimeout(i.current),a(!0),i.current=setTimeout(()=>{a(!1),i.current=null},E)},h=Date.now()-l,b=vs-h;return n||b<=0?c():d(b),()=>{i.current&&clearTimeout(i.current)}},[n,l]),s&&e},ys=()=>{const[e,t]=u.useState(new Set),n=u.useCallback(s=>{t(a=>{if(a.has(s))return a;const i=new Set(a);return i.add(s),i})},[]),r=u.useCallback(s=>{t(a=>{if(!a.has(s))return a;const i=new Set(a);return i.delete(s),i})},[]);return{isAnimating:e.size>0,start:n,stop:r}},{Provider:_s}=X("AIAgentConversation");function Ss({children:e,channelUrl:t,onChannelDeleted:n,onMessagesReceived:r,onMessagesUpdated:s,onConversationClosedStatusChanged:a,onConversationClosedViaDispatcher:i,onBeforeSendMessage:l,onAfterSendMessage:c=fe,shouldMarkAsRead:d=!0,shouldCountNewMessages:h=()=>!1,sortComparator:b}){var M;const E=()=>d&&(m==null?void 0:m.markAsRead()),{chatSDK:C,logger:y,dispatcher:x}=K(),{channel:m,channelFetchError:p,fetchChannel:v}=Ts(t),_=Bo(C,m,{replyType:_e.ReplyType.ONLY_REPLY_TO_CHANNEL,shouldCountNewMessages:h,onChannelDeleted:n,onMessagesReceived:R=>r==null?void 0:r(R),onMessagesUpdated:R=>s==null?void 0:s(R),logger:y,markAsRead:E,sortComparator:b}),I=ys(),T=ps({channel:m,messages:_.messages,isStreamAnimating:I.isAnimating});u.useEffect(()=>{E()},[d]);const L=Te(m);u.useEffect(()=>{a==null||a(L)},[L,a]),u.useEffect(()=>{const R=async z=>{const G=typeof(z==null?void 0:z.channelUrl)=="string";m&&G&&z.channelUrl!==m.url||(y.debug("conversation.dispatcher: try to close conversation",m),m!=null&&m.conversation&&m.conversation.status===q.ConversationStatus.OPEN&&(await m.closeConversation(),i==null||i()))};return x.subscribe(Rt.ConversationClose,R),()=>{x.unsubscribe(Rt.ConversationClose,R)}},[x,(M=m==null?void 0:m.conversation)==null?void 0:M.status,i]);const $={conversation:(m==null?void 0:m.conversation)??void 0,channelSource:{channel:m,error:p,refetch:()=>v(),closeConversation:async()=>{Te(m)||await(m==null?void 0:m.closeConversation())}},messageSource:{messages:_.messages,newMessages:_.newMessages,initialized:_.initialized,loadPrevious:()=>_.loadPrevious(),loadNext:()=>_.loadNext(),deleteMessage:R=>_.deleteMessage(R),resendMessage:R=>_.resendMessage(R),resetNewMessages:()=>_.resetNewMessages(),sendUserMessage:async R=>{var G;if(((G=m==null?void 0:m.conversation)==null?void 0:G.status)===q.ConversationStatus.CLOSED)throw new Error("Conversation is closed");l&&(R=await l(R));const z=await _.sendUserMessage(R,c);return c==null||c(z),z},sendFileMessage:async R=>{var G;if(((G=m==null?void 0:m.conversation)==null?void 0:G.status)===q.ConversationStatus.CLOSED)throw new Error("Conversation is closed");l&&(R=await l(R));const z=await _.sendFileMessage(R,c);return c==null||c(z),z}},state:{streamAnimation:I,input:T}};return o.createElement(_s,{value:$},e)}function Ts(e){const{chatSDK:t,logger:n}=K(),{sdkUser:r}=ft(),[s,a]=u.useState(void 0),[i,l]=u.useState(void 0);async function c(){if(!r){n.debug("conversation.fetchChannel: no sdk user, skip fetching channel");return}if(n.debug("conversation.fetchChannel: start"),a(void 0),l(void 0),e)try{n.debug("conversation.fetchChannel: get channel",e);const d=await t.groupChannel.getChannel(e);a(d),n.debug("conversation.fetchChannel: fetched channel",d)}catch(d){d instanceof Z.SendbirdError&&l(d),n.error("conversation.fetchChannel: error",d)}}return As(s),u.useEffect(()=>{c()},[t,r,e]),{channel:s,channelFetchError:i,fetchChannel:c}}function As(e){const{chatSDK:t}=K(),{activeChannel:n,setActiveChannel:r}=ft(),s=u.useId();u.useEffect(()=>{if(!e||!n)return;const a=new Z.ConnectionHandler({onReconnectSucceeded:async()=>{var l;const i=await e.refresh();i.url===n.url&&r({url:i.url,status:((l=i.conversation)==null?void 0:l.status)??q.ConversationStatus.OPEN})}});return t.addConnectionHandler(s,a),()=>{t.removeConnectionHandler(s)}},[t,e,n])}class ws{constructor(t,{filter:n,limit:r=20}){U(this,"filter");U(this,"_sdk");U(this,"_pinnedChannels");U(this,"_channels");U(this,"_isDisposed",!1);U(this,"_handlerId",`handler-id-${Date.now()}`);U(this,"_order",lt.GroupChannelListOrder.LATEST_LAST_MESSAGE);U(this,"_limit");U(this,"_query");U(this,"_token");U(this,"_timestamp");U(this,"_isSyncing");U(this,"_channelHandler");U(this,"_connectionHandler");U(this,"_collectionEventHandler");U(this,"_throttledOnChannelChanged");var s,a,i,l,c,d,h;this.filter=n,this._sdk=t,this._pinnedChannels=[],this._channels=[],this._limit=r,this._query=this._sdk.aiAgent.createMyGroupChannelListQuery({aiAgentChannelFilter:(s=this.filter)==null?void 0:s.aiAgentChannelFilter,aiAgentConversationStatusFilter:(a=this.filter)==null?void 0:a.aiAgentConversationStatusFilter,aiAgentIds:(i=this.filter)==null?void 0:i.aiAgentIds,deskChannelFilter:(l=this.filter)==null?void 0:l.deskChannelFilter,pinnedChannelUrls:(c=this.filter)==null?void 0:c.pinnedChannelUrls,copilotConversationOnly:(d=this.filter)==null?void 0:d.copilotConversationOnly,copilotSupportChannelUrl:(h=this.filter)==null?void 0:h.copilotSupportChannelUrl,limit:this._limit}),this._token="",this._timestamp=Number.MAX_SAFE_INTEGER,this._isSyncing=!1,this._throttledOnChannelChanged=ar(b=>{b.isGroupChannel()&&(this._query.belongsTo(b)?this._addChannelsToView([b],!1):this._removeChannelsFromView([b.url]))},250,{trailing:!1,leading:!0}),this._channelHandler=new lt.GroupChannelHandler({onChannelChanged:this._throttledOnChannelChanged,onChannelDeleted:b=>{this._removeChannelsFromView([b])}}),this._connectionHandler=new Z.ConnectionHandler({onReconnectSucceeded:()=>{this._isDefaultChangelogSyncTimestampUpdated&&this._syncChannelChangelogs()}}),this._sdk.addConnectionHandler(this._handlerId,this._connectionHandler),this._sdk.groupChannel.addGroupChannelHandler(this._handlerId,this._channelHandler)}get _isDefaultChangelogSyncTimestampUpdated(){return this._timestamp!==Number.MAX_SAFE_INTEGER}_setDefaultChangelogsSyncTimestamp(t){var a,i;const n=new Set(((a=this.filter)==null?void 0:a.pinnedChannelUrls)??[]),r=t.find(l=>!n.has(l.url));let s;r?s=((i=r.lastMessage)==null?void 0:i.createdAt)??r.createdAt:s=this._query.lastResponseAt,this._timestamp>s&&(this._timestamp=s)}async _syncChannelChangelogs(){if(this._isDisposed)return[];if(this._isSyncing)return[];try{this._isSyncing=!0;let t;for(this._token?t=await this._sdk.aiAgent.getMyGroupChannelChangeLogsByToken(this._token,this.filter):t=await this._sdk.aiAgent.getMyGroupChannelChangeLogsByTimestamp(this._timestamp,this.filter),this._token=t.token,this._addChannelsToView(t.updatedChannels),this._removeChannelsFromView(t.deletedChannelUrls);t.hasMore&&t.token;)t=await this._sdk.aiAgent.getMyGroupChannelChangeLogsByToken(this._token,this.filter),this._token=t.token,this._addChannelsToView(t.updatedChannels),this._removeChannelsFromView(t.deletedChannelUrls)}catch{}finally{this._isSyncing=!1}return[]}_upsertPinnedChannelsToArray(t){var l;const n=((l=this.filter)==null?void 0:l.pinnedChannelUrls)??[],r=new Map(n.map((c,d)=>[c,d])),s=[],a=[],i=[];for(const c of t){if(!this._query.belongsTo(c)){i.push(c.url);continue}const d=r.get(c.url);if(d===void 0)continue;const h=Pt(this._pinnedChannels,c);h>=0?(this._pinnedChannels.splice(h,1),a.push(c)):s.push(c);const E=this._pinnedChannels.findIndex(y=>(r.get(y.url)??1/0)>d),C=E===-1?this._pinnedChannels.length:E;this._pinnedChannels.splice(C,0,c)}return{addedChannels:s,updatedChannels:a,unmatchedChannelUrls:i}}_upsertRegularChannelsToArray(t,n=!1){const r=[],s=[],a=[];for(const i of t){if(!this._query.belongsTo(i)){r.push(i.url);continue}const l=Pt(this._channels,i),c=l<0;!c&&this._channels.splice(l,1);const h=ks(this._channels,i,this._order).place,b=h===this._channels.length;c?b?(n||!this.hasMore)&&(this._channels.push(i),s.push(i)):(this._channels.splice(h,0,i),s.push(i)):(this._channels.splice(h,0,i),a.push(i))}return{addedChannels:s,updatedChannels:a,unmatchedChannelUrls:r}}_addChannelsToView(t,n=!1){var b,E,C,y,x;const r=new Set(((b=this.filter)==null?void 0:b.pinnedChannelUrls)??[]),s=[],a=[];for(const m of t)r.has(m.url)?s.push(m):a.push(m);const i=this._upsertPinnedChannelsToArray(s),l=this._upsertRegularChannelsToArray(a,n),c=i.addedChannels.concat(l.addedChannels),d=i.updatedChannels.concat(l.updatedChannels),h=i.unmatchedChannelUrls.concat(l.unmatchedChannelUrls);c.length>0&&((C=(E=this._collectionEventHandler)==null?void 0:E.onChannelsAdded)==null||C.call(E,{},c)),d.length>0&&((x=(y=this._collectionEventHandler)==null?void 0:y.onChannelsUpdated)==null||x.call(y,{},d)),h.length>0&&this._removeChannelsFromView(h)}_removeChannelsFromView(t){var s,a,i;const n=new Set(((s=this.filter)==null?void 0:s.pinnedChannelUrls)??[]),r=[];for(const l of t)if(n.has(l)){const c=this._pinnedChannels.findIndex(d=>d.url===l);c>=0&&(r.push(l),this._pinnedChannels.splice(c,1))}else{const c=this._channels.findIndex(d=>d.url===l);c>=0&&(r.push(l),this._channels.splice(c,1))}r.length>0&&((i=(a=this._collectionEventHandler)==null?void 0:a.onChannelsDeleted)==null||i.call(a,{},r))}get channels(){return this._isDisposed?[]:[...this._pinnedChannels,...this._channels]}get hasMore(){return this._isDisposed?!1:this._query.hasNext}async loadMore(){if(this._isDisposed)return[];if(this.hasMore){const t=await this._query.next();return this._setDefaultChangelogsSyncTimestamp(t),this._addChannelsToView(t,!0),t}return[]}setConversationListCollectionHandler(t){this._collectionEventHandler=t}dispose(){this._isDisposed||(this._isDisposed=!0,this._throttledOnChannelChanged.cancel(),this._collectionEventHandler=void 0,this._sdk.removeConnectionHandler(this._handlerId),this._sdk.groupChannel.removeGroupChannelHandler(this._handlerId),this._pinnedChannels.length=0,this._channels.length=0)}}const Pt=(e,t)=>e.findIndex(n=>n.isIdentical(t)),ks=(e,t,n)=>{if(e.length>0){const r=Pt(e,t);let s=0,a=e.length-1,i=Math.floor((s+a)/2);for(;s<a;){const c=Sn(e[i],t,n);if(c>0)a=i,i=Math.floor((s+a)/2);else if(c<0)s=i+1,i=Math.floor((s+a)/2);else return{place:i,oldPosition:r}}return{place:Sn(e[i],t,n)>=0?i:i+1,oldPosition:r}}return{place:e.length,oldPosition:-1}},Sn=(e,t,n)=>{switch(n){case lt.GroupChannelListOrder.LATEST_LAST_MESSAGE:if(e.lastMessage&&t.lastMessage){const r=t.lastMessage.createdAt-e.lastMessage.createdAt;return r===0?t.createdAt-e.createdAt:r}else return e.lastMessage?-1:t.lastMessage?1:t.createdAt-e.createdAt;default:return 0}};function Is(e,t){var y,x,m,p,v,_,I,T,L,$;const n=u.useId(),[r,s]=u.useState(!1),[a,i]=u.useState(null),[l,c]=u.useState([]),[d,h]=u.useState(null),b=u.useRef(!1),E=u.useCallback(async()=>{if(!b.current&&e.currentUser){b.current=!0,s(!1),i(null),c([]);try{d==null||d.dispose();const M=new ws(e,t);M.setConversationListCollectionHandler({onChannelsAdded:()=>{c(M.channels)},onChannelsUpdated:()=>{c(M.channels)},onChannelsDeleted:()=>{c(M.channels)}}),await M.loadMore(),h(M),i(null)}catch(M){h(null),i(M)}finally{s(!0),b.current=!1}}},[e,e.currentUser,(y=t.filter)==null?void 0:y.aiAgentChannelFilter,(m=(x=t.filter)==null?void 0:x.aiAgentConversationStatusFilter)==null?void 0:m.join(),(v=(p=t.filter)==null?void 0:p.aiAgentIds)==null?void 0:v.join(),(_=t.filter)==null?void 0:_.deskChannelFilter,(T=(I=t.filter)==null?void 0:I.pinnedChannelUrls)==null?void 0:T.join(),(L=t.filter)==null?void 0:L.copilotConversationOnly,($=t.filter)==null?void 0:$.copilotSupportChannelUrl,t.limit]),C=u.useCallback(async()=>{if(d)try{await d.loadMore()}catch(M){i(M)}},[d]);return u.useEffect(()=>(e.addConnectionHandler(n,new Z.ConnectionHandler({onConnected:()=>E()})),()=>e.removeConnectionHandler(n)),[e,n,E]),u.useEffect(()=>{E()},[E]),u.useEffect(()=>()=>{b.current=!1,d==null||d.dispose()},[d]),{initialized:r,error:a,channels:l,loadMore:C}}const{Provider:$s}=X("AIAgentConversationList");function Ms({conversationListLimit:e,conversationListFilter:t,children:n}){var b,E;const{chatSDK:r,aiAgentId:s,queryParams:a}=K(),i={aiAgentIds:[s],aiAgentConversationStatusFilter:[q.ConversationStatus.CLOSED,q.ConversationStatus.OPEN]},l=e??((b=a==null?void 0:a.conversationListParams)==null?void 0:b.limit),c={...i,...(E=a==null?void 0:a.conversationListParams)==null?void 0:E.filter,...t},d=Is(r,{limit:l,filter:c}),h={listSource:{initialized:d.initialized,error:d.error??void 0,channels:d.channels,loadMore:()=>d.loadMore()}};return o.createElement($s,{value:h},n)}function Ls(e){let t="pending",n=e.then(r=>{t="resolved",n=r}).catch(r=>{t="rejected",n=r});return{get value(){if(t==="resolved")return n;throw n}}}const{Provider:Os,useContext:mr}=X("MessageTemplateFetching");function Rs({children:e,internalVariables:t}){const n=u.useRef({}),r=u.useRef({}),[s,a]=u.useState({}),i=u.useCallback((d,h)=>{a(b=>({...b,[d]:{fetching:!1,error:!1,...b[d],...h}}))},[]),l=u.useCallback(async({onRequestTemplate:d,onGetCachedTemplate:h,templateKey:b,suspense:E=!1})=>{const C=h(b);if(C)return C;const y=r.current[b];if(y)return y;E||i(b,{fetching:!0});const x=d(b).catch(m=>{throw E||i(b,{error:!0}),m}).finally(()=>{E||i(b,{fetching:!1}),delete r.current[b]});return r.current[b]=x,x},[i]),c={internalVariables:t,fetchTemplate:l,suspend:(d,h)=>{if(n.current[d])return n.current[d];const b=Ls(h());return n.current[d]=b,b},getIsFetching:d=>{var h;return((h=s[d])==null?void 0:h.fetching)??!1},getHasError:d=>{var h;return((h=s[d])==null?void 0:h.error)??!1}};return o.createElement(Os,{value:c},e)}const pt={VARIABLE:e=>new RegExp(`\\{${e}\\}`,"g"),VIEW_VARIABLE:e=>new RegExp(`"{@${e}}"`,"g")};function Ae({uiTemplateString:e,variables:t={}}){const n=us(t);return Zt({template:e,variables:n,variableKeyPattern:r=>pt.VARIABLE(r)})}function we({theme:e,uiTemplateString:t,colorVariables:n={}}){return Zt({template:t,variables:n,variableKeyPattern:r=>pt.VARIABLE(r),variableValueTransformer:r=>cs(e,r)})}function Ds({theme:e,uiTemplateString:t,viewVariables:n={},aiAgentColorVariables:r,internalVariables:s,onRequestTemplate:a}){const l=Object.values(n).flat().map(d=>d.key);return[...new Set(l)].some(d=>!a(d))?null:Zt({template:t,variables:n,variableKeyPattern:d=>pt.VIEW_VARIABLE(d),variableValueTransformer:d=>{const h=d.map(({key:b,variables:E})=>{const C=a(b),{ui_template:y,color_variables:x}=Ke(C);let m=JSON.stringify(y);return m=Ae({uiTemplateString:m,variables:s}),m=we({theme:e,uiTemplateString:m,colorVariables:x}),m=we({theme:e,uiTemplateString:m,colorVariables:r}),m=Ae({uiTemplateString:m,variables:E}),ht(m)});return JSON.stringify(h)}})}async function Ns({theme:e,uiTemplateString:t,viewVariables:n={},aiAgentColorVariables:r,internalVariables:s,onRequestTemplate:a}){return ds({template:t,variables:n,variableKeyPattern:i=>pt.VIEW_VARIABLE(i),variableValueTransformer:async i=>{const l=i.map(async({key:d,variables:h})=>{const b=await a(d),{ui_template:E,color_variables:C}=Ke(b);let y=JSON.stringify(E);return y=Ae({uiTemplateString:y,variables:s}),y=we({theme:e,uiTemplateString:y,colorVariables:C}),y=we({theme:e,uiTemplateString:y,colorVariables:r}),y=Ae({uiTemplateString:y,variables:h}),ht(y)}),c=await Promise.all(l);return JSON.stringify(c)}})}const Ps=({rawTemplate:e,aiAgentColorVariables:t,internalVariables:n,...r})=>{const{ui_template:s,color_variables:a}=Ke(e);let i=JSON.stringify(s);if(Object.keys(r.viewVariables??{}).length>0){const c=Ds({...r,uiTemplateString:i,aiAgentColorVariables:t,internalVariables:n});if(c===null)return null;i=c}return i=Ae({...r,uiTemplateString:i,variables:n}),i=we({...r,uiTemplateString:i,colorVariables:a}),i=we({...r,uiTemplateString:i,colorVariables:t}),i=Ae({...r,uiTemplateString:i}),ht(i)},Bs=async({rawTemplate:e,aiAgentColorVariables:t,internalVariables:n,...r})=>{const{ui_template:s,color_variables:a}=Ke(e);let i=JSON.stringify(s);return Object.keys(r.viewVariables??{}).length>0&&(i=await Ns({...r,uiTemplateString:i,aiAgentColorVariables:t,internalVariables:n})),i=Ae({...r,uiTemplateString:i,variables:n}),i=we({...r,uiTemplateString:i,colorVariables:a}),i=we({...r,uiTemplateString:i,colorVariables:t}),i=Ae({...r,uiTemplateString:i}),ht(i)},Fs=e=>{const{aiAgentColorVariables:t={}}=e,{internalVariables:n}=mr();return u.useState(()=>{const r=e.onGetCachedTemplate(e.templateKey);return r?Ps({...e,rawTemplate:r,aiAgentColorVariables:t,internalVariables:n,onRequestTemplate:e.onGetCachedTemplate}):null})},Us=e=>{const[t]=Fs(e);if(t)return t;const{aiAgentColorVariables:n={}}=e,{internalVariables:r,fetchTemplate:s,suspend:a}=mr();return a(e.templateKey,async()=>{const l=await s({...e,suspense:!0});return await Bs({...e,rawTemplate:l,aiAgentColorVariables:n,internalVariables:r})}).value},Hs="remove_powered_by",Xt=(e,t)=>{var s,a;const{chatSDK:n}=K(),{aiAgentInfo:r}=ft();if(e==="handoff-button"){const i=!!((s=t==null?void 0:t.conversation)!=null&&s.handoff);return!!(t!=null&&t.isAIAgent)&&!!(r!=null&&r.showHandoffButton)&&i&&Wt(t)}if(e==="special-notice")return!!(t!=null&&t.isAIAgent)&&!!(r!=null&&r.specialNoticeEnabled)&&!!(r!=null&&r.specialNotice);if(e==="powered-by"){const i=(a=n==null?void 0:n.appInfo)==null?void 0:a.applicationAttributes;return u.useMemo(()=>!(Array.isArray(i)&&i.includes(Hs)),[i])}throw new Error("Unsupported feature")},zs={required:"This question is required",minLength:e=>`Minimum ${e} characters required`,maxLength:e=>`Maximum ${e} characters allowed`,min:e=>`Minimum value is ${e}`,max:e=>`Maximum value is ${e}`,minSelect:e=>`Select at least ${e} options`,maxSelect:e=>`Select at most ${e} options`,regex:"Invalid format",invalidSelection:"Invalid selection"},Vs={getValueOrDefault:e=>e.value??e.default_value??null,validate:(e,t,n)=>{const r=t;if(e.required&&(!r||r.trim()===""))return{isValid:!1,error:n.required};if(!r)return{isValid:!0};const{rules:s}=e;if(s){if(s.min_length!==void 0&&r.length<s.min_length)return{isValid:!1,error:typeof n.minLength=="function"?n.minLength(s.min_length):n.minLength};if(s.max_length!==void 0&&r.length>s.max_length)return{isValid:!1,error:typeof n.maxLength=="function"?n.maxLength(s.max_length):n.maxLength};if(s.regex&&!new RegExp(s.regex).test(r))return{isValid:!1,error:n.regex}}return{isValid:!0}}},Gs={getValueOrDefault:e=>e.value??e.default_value??null,validate:(e,t,n)=>{const r=t;if(e.required&&r===null)return{isValid:!1,error:n.required};if(r===null)return{isValid:!0};const{rules:s}=e;if(s){if(s.min!==void 0&&r<s.min)return{isValid:!1,error:typeof n.min=="function"?n.min(s.min):n.min};if(s.max!==void 0&&r>s.max)return{isValid:!1,error:typeof n.max=="function"?n.max(s.max):n.max}}return{isValid:!0}}},Ws={getValueOrDefault:e=>e.value??e.default_value??null,validate:(e,t,n)=>{const r=t;return e.required&&!r?{isValid:!1,error:n.required}:r&&!e.options.includes(r)?{isValid:!1,error:n.invalidSelection}:{isValid:!0}}},qs={getValueOrDefault:e=>e.values??e.default_values??null,validate:(e,t,n)=>{const r=t;if(e.required&&(!r||r.length===0))return{isValid:!1,error:n.required};if(!r||r.length===0)return{isValid:!0};if(r.filter(i=>!e.options.includes(i)).length>0)return{isValid:!1,error:n.invalidSelection};const{rules:a}=e;if(a){if(a.min_select!==void 0&&r.length<a.min_select)return{isValid:!1,error:typeof n.minSelect=="function"?n.minSelect(a.min_select):n.minSelect};if(a.max_select!==void 0&&r.length>a.max_select)return{isValid:!1,error:typeof n.maxSelect=="function"?n.maxSelect(a.max_select):n.maxSelect}}return{isValid:!0}}},js={text:Vs,number:Gs,"single-select":Ws,"multi-select":qs},Ks={getValueOrDefault:()=>null,validate:()=>({isValid:!1})};function gr(e){return js[e.type]||Ks}function Tn(e){return gr(e).getValueOrDefault(e)}function Ys(e,t,n={}){const r={...zs,...n};return gr(e).validate(e,t,r)}const Zs=(e,t={})=>{const{labels:n={},onSubmit:r,onCancel:s}=t,[a,i]=u.useState({}),[l,c]=u.useState(()=>{const x={};return e.fields.forEach(m=>{x[m.key]=Tn(m)}),x}),d=u.useMemo(()=>e.submitted_at?"submitted":e.canceled_at?"canceled":"draft",[e.submitted_at,e.canceled_at]);u.useEffect(()=>{if(d==="submitted"||d==="canceled"){const x={};let m=!1;e.fields.forEach(p=>{const v=Tn(p);JSON.stringify(l[p.key])!==JSON.stringify(v)&&(m=!0),x[p.key]=v}),m&&c(x)}},[d]);const h=(x,m)=>{c(p=>({...p,[x]:m})),i(p=>({...p,[x]:void 0}))},b=e.fields.map(x=>{var v,_,I;const m=l[x.key]??null,p={key:x.key,label:x.label,error:a[x.key],required:x.required};return x.type==="text"?{...p,type:"text",layout:x.layout,value:m,...x.placeholder&&{placeholder:x.placeholder},...((v=x.rules)==null?void 0:v.max_length)&&{maxLength:x.rules.max_length}}:x.type==="number"?{...p,type:"number",layout:x.layout,value:m,...x.placeholder&&{placeholder:x.placeholder},...((_=x.rules)==null?void 0:_.max)&&{max:x.rules.max}}:x.type==="single-select"?{...p,type:"single-select",layout:x.layout,value:m,options:x.options}:x.type==="multi-select"?{...p,type:"multi-select",layout:x.layout,value:m,options:x.options,...((I=x.rules)==null?void 0:I.max_select)&&{maxSelect:x.rules.max_select}}:{...p,type:"unknown",layout:"default",value:null}});return{state:d,fields:b,getField:x=>b.find(m=>m.key===x),updateFieldValue:h,submit:async()=>{const x={};let m=!1;for(const p of e.fields){const v=l[p.key]??null,_=Ys(p,v,n);_.isValid||(x[p.key]=_.error,m=!0)}if(i(x),!m&&r){const p={};e.fields.forEach(v=>{p[v.key]=l[v.key]??null}),await r(p)}},cancel:async()=>{await(s==null?void 0:s())}}},hr=({channel:e,userSession:t,aiAgentInfo:n})=>{if(!t||!n||!e)return{fallbackIcon:"delight",url:void 0,title:""};const r=(()=>{const[a]=e.members.filter(i=>i.userId!==t.userId);return a})(),s={ai(a){return{fallbackIcon:a,url:n.profileUrl,title:n.nickname}},human(a){return{fallbackIcon:a,url:r==null?void 0:r.profileUrl,title:(r==null?void 0:r.nickname)||n.nickname}},channel(a){return{fallbackIcon:a,url:e==null?void 0:e.coverUrl,title:(e==null?void 0:e.name)??""}}};return e.isAIAgent?Be(e)?s.human("agent"):s.ai("delight"):e.isDesk?s.human("agent"):s.channel("user")},An=e=>u.useReducer((t,n)=>({...t,...n}),e);var le=(e=>(e.AI_AGENT_CSAT_5="AI_AGENT_CSAT_5",e.AI_AGENT_CSAT_5_WITH_CRE="AI_AGENT_CSAT_5_WITH_CRE",e.HELPDESK_CSAT_5="HELPDESK_CSAT_5",e))(le||{});const Xs=new Set(["free_text","single_choice"]),Js=({csatPayload:e,type:t,initialCsat:n,initialCsatReason:r,initialIsResolved:s})=>{const[a,i]=An({csatType:t,csat:n,csatReason:r,isResolved:s}),[l,c]=An({followUpItem:!1}),d=u.useMemo(()=>{var x;const C=a.csat;if(typeof C!="number")return;const y=(x=e.follow_up)==null?void 0:x.find(m=>m.scores.includes(C));if(Xs.has(y==null?void 0:y.response_type))return y},[a.csat,e.follow_up]),h=(()=>{var C;if(typeof n=="number")return"submitted";if((t===le.AI_AGENT_CSAT_5||t===le.HELPDESK_CSAT_5)&&typeof a.csat=="number")return"submittable";if(t===le.AI_AGENT_CSAT_5_WITH_CRE){const y=typeof a.csat=="number",x=!((C=e.cre)!=null&&C.required)||typeof a.isResolved=="boolean";if(y&&x)return"submittable"}return"unsubmittable"})(),b=u.useCallback(()=>typeof a.csat>"u"?!1:d!=null&&d.required&&!a.csatReason?(c({followUpItem:!0}),!1):!0,[a,d,c]);return u.useEffect(()=>{r||(i({csatReason:""}),c({followUpItem:!1}))},[r,d,i,c]),{params:a,setParams:i,error:l,setError:c,followUpItem:d,state:h,validateParams:b,itemProps:{csatPayload:e,state:h,submitted:h==="submitted"}}},wt=5,Qs=250,ea=50,wn=e=>Math.max(0,e-ea),ta=e=>e<1e3?{speed:wt*.5,chunkSize:2}:e<2e3?{speed:wt*.8,chunkSize:2}:{speed:wt*.6,chunkSize:3},na=e=>{const{text:t,enabled:n=!1,onAnimationStart:r,onAnimationProgress:s,onAnimationComplete:a}=e,[i,l]=u.useState(()=>wn(t.length)),c=u.useRef(null),d=u.useRef({startTime:0,lastUpdate:0,lastProgressCall:0}).current,h=u.useRef({onStart:r,onProgress:s,onComplete:a}).current,b=u.useRef({startCalled:!1,completeCalled:!1}).current,E=u.useRef({initialEnabled:n,textLength:t.length,enabled:n}).current,C=n,y=i<t.length,x=E.initialEnabled&&(C||y);return u.useLayoutEffect(()=>{h.onStart=r,h.onProgress=s,h.onComplete=a,E.textLength=t.length,E.enabled=n}),u.useLayoutEffect(()=>{var m;E.initialEnabled&&(b.startCalled||(b.startCalled=!0,(m=h.onStart)==null||m.call(h)),l(p=>t.length<p?t.length:p))},[t]),u.useEffect(()=>{if(!E.initialEnabled)return;let m=wn(t.length);d.lastUpdate=0,d.startTime=0,d.lastProgressCall=0;const p=v=>{var z;d.lastUpdate===0&&(d.lastUpdate=v,d.startTime=v,d.lastProgressCall=v);const _=E.textLength,I=v-d.lastUpdate,T=v-d.startTime,{speed:L,chunkSize:$}=ta(T),M=L*$;I>=M&&m<_&&(m=Math.min(m+$,_),l(m),d.lastUpdate=v),v-d.lastProgressCall>=Qs&&(d.lastProgressCall=v,(z=h.onProgress)==null||z.call(h)),(m<_||E.enabled)&&(c.current=requestAnimationFrame(p))};return c.current=requestAnimationFrame(p),()=>{c.current&&cancelAnimationFrame(c.current)}},[]),u.useEffect(()=>{var _;const m=E.initialEnabled&&b.startCalled,p=!n,v=i>=t.length&&t.length>0;m&&p&&v&&!b.completeCalled&&(b.completeCalled=!0,(_=h.onComplete)==null||_.call(h))},[n,i,t.length]),{streamText:E.initialEnabled?t.slice(0,i):t,isAnimating:x}},ra='@import"https://fonts.googleapis.com/css?family=Roboto:400,500,600,700&display=swap";.sb-message-template__border{position:relative}.sb-message-template__border:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;box-shadow:inset 0 0 0 var(--border-width) var(--border-color);border-radius:var(--border-radius);pointer-events:none}.sb-message-template__action{cursor:pointer}.sb-message-template__parent{font-family:Roboto,serif}.sb-message-template__text{font-family:inherit;font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;letter-spacing:normal;text-align:left}.sb-message-template__text-button{font-family:inherit;background-color:#e0e0e0;text-align:center;padding:10px;border-radius:6px;font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;letter-spacing:normal}.sendbird-theme--light .sb-message-template__text-button{color:#742ddd}.sendbird-theme--dark .sb-message-template__text-button{color:#c2a9fa}.sb-message-template__text-button:hover{opacity:1;box-shadow:#0000001a 0 1px 3px,#0000000f 0 1px 2px}.sb-message-template__text-button,.sb-message-template__image-button{cursor:pointer;border-style:none}.sb-message-template__parent{border-radius:unset;background-color:transparent;overflow:hidden}.sb-message-template__parent *{box-sizing:border-box;line-height:1.3}.sb-message-template__carousel{display:flex;width:100%;box-sizing:border-box;touch-action:pan-y}',oa={conversation:{input_placeholder:"Ask a question",input_placeholder_disabled:"Chat is unavailable in this channel",input_placeholder_wait_ai_agent_response:"Waiting for the agent's reply...",input_placeholder_active_form:"Please fill out the form to move forward.",input_placeholder_reconnecting:"Trying to reconnect. Refresh if persists.",unknown_message_type:"(Unknown message type)",powered_by:"Powered by",citation_title:"Source",start_new_conversation_label:"Start a conversation",scroll_to_new_messages_label:()=>"New message",failed_message_resend:"Retry",failed_message_remove:"Remove",file_upload_no_supported_files:"No supported file types available.",a11y_message_list:"Chat messages",a11y_scroll_to_bottom:"Scroll to bottom",a11y_scroll_to_new_messages:"Scroll to new messages",a11y_open_conversation_list:"Open conversation list"},conversation_list:{header_title:"Conversations",ended:"Ended",footer_title:"Start a conversation"},date_format:{just_now:"Just now",minutes_ago:e=>`${e} minutes ago`,hours_ago:e=>`${e} hours ago`,date_short:"MM/dd/yyyy",date_separator:"MMMM dd, yyyy",message_timestamp:"p"},csat:{title:"Your feedback matters to us",submitted_label:"Successfully submitted!",cre_question:"Was your issue resolved?",cre_positive_label:"Yes, thank you! 👍",cre_negative_label:"No, that didn't help.",reason_placeholder:"Share your feedback",question:"How would you rate your experience?",submit_label:"Submit",submission_expired:"We're sorry, the survey period has ended."},form:{optional_label:"optional",validation_required:"This question is required"},common:{placeholder_something_went_wrong:"Something went wrong",placeholder_no_messages:"No messages",placeholder_no_conversations:"No conversations yet",placeholder_something_went_wrong_retry_label:"Retry"},feedback:{title:"Submit feedback",good:"Good",bad:"Bad",comment_label:"Comment (optional)",comment_placeholder:"Leave a comment",cancel:"Cancel",submit:"Submit",save:"Save",edit:"Edit feedback",remove:"Remove feedback"}},Bt={language:"en",strings:oa,dateLocale:ao.enUS},fr=e=>({MESSAGE_INPUT__PLACE_HOLDER:e.conversation.input_placeholder,MESSAGE_INPUT__PLACE_HOLDER__DISABLED:e.conversation.input_placeholder_disabled,MESSAGE_INPUT__PLACE_HOLDER__WAIT_AI_AGENT_RESPONSE:e.conversation.input_placeholder_wait_ai_agent_response,MESSAGE_INPUT__PLACE_HOLDER__RECONNECTING:e.conversation.input_placeholder_reconnecting,UNKNOWN__UNKNOWN_MESSAGE_TYPE:e.conversation.unknown_message_type,POWERED_BY:e.conversation.powered_by,CSAT_TITLE_UNSUBMITTED:e.csat.title,CSAT_TITLE_SUBMITTED:e.csat.submitted_label,CSAT_CRE_TITLE:e.csat.cre_question,CSAT_CRE_SOLVED:e.csat.cre_positive_label,CSAT_CRE_NOT_SOLVED:e.csat.cre_negative_label,CSAT_REASON_PLACEHOLDER:e.csat.reason_placeholder,CSAT_RATING_TITLE:e.csat.question,CSAT_SUBMIT_LABEL:e.csat.submit_label,CSAT_SUBMISSION_EXPIRED:e.csat.submission_expired,DATE_FORMAT__JUST_NOW:e.date_format.just_now,DATE_FORMAT__MINUTES_AGO:e.date_format.minutes_ago,DATE_FORMAT__HOURS_AGO:e.date_format.hours_ago,DATE_FORMAT__DATE_SHORT:e.date_format.date_short,DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR:e.date_format.date_separator,DATE_FORMAT__MESSAGE_TIMESTAMP:e.date_format.message_timestamp,CONVERSATION_LIST__HEADER_TITLE:e.conversation_list.header_title,CONVERSATION_LIST__ENDED:e.conversation_list.ended,CONVERSATION_LIST__NO_CONVERSATIONS:e.common.placeholder_no_conversations,TALK_TO_AGENT:e.conversation.start_new_conversation_label,CITATION_SOURCE_TITLE:e.conversation.citation_title,FORM_PLACEHOLDER:e.conversation.input_placeholder_active_form,FORM_VALIDATION_REQUIRED:e.form.validation_required,OPTIONAL:e.form.optional_label,PLACE_HOLDER__WRONG:e.common.placeholder_something_went_wrong,PLACE_HOLDER__NO_MESSAGES:e.common.placeholder_no_messages,RETRY:e.common.placeholder_something_went_wrong_retry_label,FAILED_MESSAGE_RESEND:e.conversation.failed_message_resend,FAILED_MESSAGE_REMOVE:e.conversation.failed_message_remove,FILE_UPLOAD_NO_SUPPORTED_FILES:e.conversation.file_upload_no_supported_files,FEEDBACK_TITLE:e.feedback.title,FEEDBACK_GOOD:e.feedback.good,FEEDBACK_BAD:e.feedback.bad,FEEDBACK_COMMENT_LABEL:e.feedback.comment_label,FEEDBACK_COMMENT_PLACEHOLDER:e.feedback.comment_placeholder,FEEDBACK_CANCEL:e.feedback.cancel,FEEDBACK_SUBMIT:e.feedback.submit,FEEDBACK_SAVE:e.feedback.save,FEEDBACK_EDIT:e.feedback.edit,FEEDBACK_REMOVE:e.feedback.remove,A11Y_MESSAGE_LIST:e.conversation.a11y_message_list,A11Y_SCROLL_TO_BOTTOM:e.conversation.a11y_scroll_to_bottom,A11Y_SCROLL_TO_NEW_MESSAGES:e.conversation.a11y_scroll_to_new_messages,A11Y_OPEN_CONVERSATION_LIST:e.conversation.a11y_open_conversation_list,SCROLL_TO_NEW_MESSAGES_LABEL:e.conversation.scroll_to_new_messages_label}),sa=e=>{var t;return((t=e.split("-"))==null?void 0:t[0])??bt},bt="en",aa=new Set([bt,"ko","es","pt","fr","hi","it","de","tr","ja"]),ia=(e,t,n)=>{const r=e[t];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((s,a)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(a.bind(null,new Error("Unknown variable dynamic import: "+t+(t.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})},kn=fr(Bt.strings),la={...kn,HEADER_BUTTON__AGENT_HANDOFF:"Connect with an agent",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Select an option to continue",BUTTON__CANCEL:"Cancel",BUTTON__SUBMIT:"Submit",SUBMITTED:"Submitted",TRY_AGAIN:"Please try again.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"You can't upload more than one image",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"The maximum size per file is %d MB.",FILE_VIEWER__UNSUPPORT:"Unsupported message",CSAT5_RATING_SCORE_1:"Terrible",CSAT5_RATING_SCORE_2:"Bad",CSAT5_RATING_SCORE_3:"Okay",CSAT5_RATING_SCORE_4:"Good",CSAT5_RATING_SCORE_5:"Great",FORM_UNAVAILABLE:"Form is no longer available.",FORM_NOT_SUPPORTED:"This form is not supported in the current version.",FORM_VALIDATION_MIN_LENGTH:e=>`Minimum ${e} characters required`,FORM_VALIDATION_MAX_LENGTH:e=>`Maximum ${e} characters allowed`,FORM_VALIDATION_MIN:e=>`Minimum value is ${e}`,FORM_VALIDATION_MAX:e=>`Maximum value is ${e}`,FORM_VALIDATION_MIN_SELECT:e=>`Select at least ${e} options`,FORM_VALIDATION_MAX_SELECT:e=>`Select at most ${e} options`,FORM_VALIDATION_REGEX_FAILED:"Invalid format",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:kn.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"h:mma",CONVERSATION_LIST__TOPICS_FALLBACK:"No category",CONVERSATION_CLOSED_FOOTER_LABEL:"Your conversation has ended",START_NEW_CONVERSATION:"💬 Start a new conversation",RETURN_TO_CONVERSATION:"💬 Return to conversation",BUTTON__SAVE:"Save",BUTTON__OK:"OK",NO_NAME:"(No name)",CHANNEL_FROZEN:"Channel frozen"},ct={language:Bt.language,dateLocale:Bt.dateLocale,stringSet:la},ca=Object.freeze(Object.defineProperty({__proto__:null,default:ct},Symbol.toStringTag,{value:"Module"})),Ft=new Map([[bt,ct]]);async function ua(e){const t=Ft.get(e);if(t)return t;try{if(aa.has(e)){const{default:n}=await ia(Object.assign({"./languages/de.ts":()=>Promise.resolve().then(()=>require("./BdwWrAAp.cjs")),"./languages/en.ts":()=>Promise.resolve().then(()=>ca),"./languages/es.ts":()=>Promise.resolve().then(()=>require("./C0ghQ00S.cjs")),"./languages/fr.ts":()=>Promise.resolve().then(()=>require("./Cfl_OFPL.cjs")),"./languages/hi.ts":()=>Promise.resolve().then(()=>require("./BKGMHnw9.cjs")),"./languages/it.ts":()=>Promise.resolve().then(()=>require("./DHKyBmS2.cjs")),"./languages/ja.ts":()=>Promise.resolve().then(()=>require("./PZ2du4si.cjs")),"./languages/ko.ts":()=>Promise.resolve().then(()=>require("./BPwCUUtB.cjs")),"./languages/pt.ts":()=>Promise.resolve().then(()=>require("./C6epASKA.cjs")),"./languages/tr.ts":()=>Promise.resolve().then(()=>require("./DEtHXyvH.cjs"))}),`./languages/${e}.ts`,3);return Ft.set(e,n),n}return ct}catch{return ct}}const{Provider:da,useContext:F}=X("Localization"),ma=({language:e=navigator.language,logger:t,stringSet:n,children:r})=>{const[s,a]=u.useState(Ft.get(bt));return u.useEffect(()=>{const i=sa(e);s.language!==i&&(t==null||t.debug("localization.useEffect: update language",{from:s.language,to:i}),ua(i).then(a))},[e,t]),o.createElement(da,{value:{language:s.language,stringSet:{...s.stringSet,...n},dateLocale:s.dateLocale,format:(i,l,c)=>ye.format(i,l,{locale:s.dateLocale,...c})}},r)},ut="data-sb-agent-theme",In=e=>(t,...n)=>{let r="";return t.forEach((s,a)=>{r+=s+(n[a]??"")}),`[${ut}='${e}'] & { ${r} }`},D={light:In("light"),dark:In("dark")},ga=S.css(({theme:e})=>{const{palette:t}=e;return`
1
+ "use strict";var oo=Object.defineProperty;var so=(e,t,n)=>t in e?oo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var U=(e,t,n)=>so(e,typeof t!="symbol"?t+"":t,n);const u=require("react"),Z=require("@sendbird/chat"),S=require("styled-components"),ye=require("date-fns"),ao=require("date-fns/locale/en-US"),_e=require("@sendbird/chat/message"),q=require("@sendbird/chat/aiAgent"),lt=require("@sendbird/chat/groupChannel"),io=require("react-dom"),Lt=require("@sendbird/react-uikit-message-template-view"),lo=require("@sendbird/uikit-message-template"),Ue=require("@sendbird/uikit-tools"),co=require("dompurify"),uo=require("date-fns/isSameDay"),mo=require("@emotion/is-prop-valid"),gt=e=>e&&e.__esModule?e:{default:e};function go(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const o=go(u),ho=gt(Z),f=gt(S),Jn=gt(co),fo=gt(mo),X=(e,t)=>{const n=u.createContext(null),r=({children:i,value:l})=>o.createElement(n.Provider,{value:l},typeof i=="function"?i(l):i),s=({children:i})=>o.createElement(n.Consumer,null,l=>l?typeof i=="function"?i(l):i:null),a=()=>{const i=u.useContext(n);if(!i)throw new Error(`use${e}Context must be used within a ${e}Provider`);return i};return n.displayName=`${e}Context`,r.displayName=`${e}Provider`,s.displayName=`${e}Consumer`,a.displayName=`use${e}Context`,{Context:n,Provider:r,Consumer:s,useContext:a}};function pe(e){const t=u.createContext({Template:e.template,updateTemplate:()=>{},components:e.components,updateComponent:()=>{}});function n({children:a}){const[i,l]=u.useState(()=>e.template),[c,d]=u.useState(e.components),h={Template:i,updateTemplate:b=>l(()=>b),components:c,updateComponent:(b,E)=>d(C=>({...C,[b]:E}))};return o.createElement(t.Provider,{value:h},a)}function r({template:a,children:i}){const{updateTemplate:l}=u.useContext(t);return u.useLayoutEffect(()=>{a&&l(a)},[a]),o.createElement(o.Fragment,null,i)}function s({children:a}){return o.createElement(n,null,a)}return s.defaults=e,s.useContext=()=>u.useContext(t),s.Context=t,s.Template=r,Object.keys(e.components).forEach(a=>{s[a]=function({component:l}){const{updateComponent:c}=u.useContext(t);return u.useLayoutEffect(()=>{l&&c(a,l)},[l]),null}}),s}function po(...e){return function({children:n}){return e.reduce((r,s)=>o.createElement(s,null,r),n)}}const Te=e=>{var t,n;return!!(e!=null&&e.isAIAgent&&((t=e==null?void 0:e.conversation)==null?void 0:t.status)===q.ConversationStatus.CLOSED||e!=null&&e.isDesk&&((n=e==null?void 0:e.helpdeskInfo)==null?void 0:n.ticketStatus)==="closed")},Wt=e=>{var t,n;return!!(e!=null&&e.isAIAgent&&((t=e==null?void 0:e.conversation)==null?void 0:t.status)===q.ConversationStatus.OPEN||e!=null&&e.isDesk&&((n=e==null?void 0:e.helpdeskInfo)==null?void 0:n.ticketStatus)==="open")};function Be(e){var n,r,s;return typeof(((n=e==null?void 0:e.conversation)==null?void 0:n.handedOverAt)??((s=(r=e==null?void 0:e.conversation)==null?void 0:r.handoff)==null?void 0:s.timestamp))=="number"}function bo(e){var t;if(((t=e==null?void 0:e.resolution)==null?void 0:t.determinedBy)==="user")return e.resolution.isResolved}function En(e){return!!e&&e<Date.now()}function Eo(e){return!e.title}function xo(e,t){var n;if(e)return Eo(e)?{...e,title:t.title,csat_question:t.question,csat_scores:[{label:"",image_url:"https://static.dashboard.sendbird.com/assets/ai-agent/angry-active.png"},{label:"",image_url:"https://static.dashboard.sendbird.com/assets/ai-agent/suspicious-active.png"},{label:"",image_url:"https://static.dashboard.sendbird.com/assets/ai-agent/neutral-active.png"},{label:"",image_url:"https://static.dashboard.sendbird.com/assets/ai-agent/smile-active.png"},{label:"",image_url:"https://static.dashboard.sendbird.com/assets/ai-agent/happy-active.png"}],cre:{required:((n=e.cre)==null?void 0:n.required)??!0,question:t.cre.question,positive_label:t.cre.positive_label,negative_label:t.cre.negative_label},follow_up:[{response_type:"free_text",scores:[1,2,3,4,5],question:t.followUp.question,always_visible:!1}],csat_submit_label:t.submit_label,csat_submitted_label:t.submitted_label}:e}function vo(e){const t=e.lastMessage;return t!=null&&t.isUserMessage()||t!=null&&t.isAdminMessage()?t.message||"":t!=null&&t.isFileMessage()?t.message||t.name||"FILE":e.name}function Co(e,t,n){var i;const r=new Date,s=new Date(((i=e.lastMessage)==null?void 0:i.createdAt)||e.createdAt),a=ye.differenceInMinutes(r,s);return a<1?n.justNow:a<60?n.minutesAgo(a):ye.isToday(s)?n.hoursAgo(ye.differenceInHours(r,s)):t(s,n.dateShortFormat)}const Ne="sb-agent",Qn="KEY_IMG_ASPECT_RATIO",yo="*/*",B={BODY_MAX_WIDTH:244,WIDE_BODY_MAX_WIDTH:640,AVATAR_SIZE:26,BODY_TIME_GAP:4,HORIZONTAL_PADDING:12,GAP_GROUPED:2,GAP_UNGROUPED:16},he=e=>!!e&&"sender"in e,_o=e=>he(e)?e.sendingStatus==="succeeded"?String(e.messageId):e.reqId:String(e.messageId),So=(e,t,n,r=!0)=>{if(!r||!he(e))return"single";const s=()=>{if(!t||!he(t))return!1;const c=t.sender.userId===e.sender.userId,d=ye.isSameMinute(t.createdAt,e.createdAt);return c&&d},a=()=>{if(!n||!he(n))return!1;const c=n.sender.userId===e.sender.userId,d=ye.isSameMinute(n.createdAt,e.createdAt);return c&&d},i=s(),l=a();return i&&l?"middle":i?"bottom":l?"top":"single"},je=(e,t)=>(()=>{var r;return he(e)?e.sender.userId:((r=e==null?void 0:e.sender)==null?void 0:r.userId)??void 0})()===t,De={isAdmin:e=>e.isAdminMessage(),isCSAT:e=>{var t;return e.isAdminMessage()&&!!((t=e.extendedMessagePayload)!=null&&t.csat)},isIncoming:(e,t)=>he(e)&&e.sender.userId!==t,isOutgoing:(e,t)=>he(e)&&(e.sender.userId===t||e.sendingStatus===_e.SendingStatus.PENDING)},er=e=>e.startsWith("image/"),tr=e=>e.startsWith("video/"),qt=(e,t)=>{if(e&&!e.startsWith(".")){const n=e.split(".").pop();if(n&&n!==e)return n.toUpperCase()}if(t){const[,n]=t.split("/");if(n)return n.toUpperCase()}return"FILE"},nr=e=>e.messageType==="file"?e.message.length>0&&e.file.name!==e.message:e.message.length>0,jt=e=>{switch(e){case"top":case"middle":return B.GAP_GROUPED;default:return B.GAP_UNGROUPED}},To=(e,t)=>{const n=/```(\w+)?\n([\s\S]*?)```/g,r=[];let s=0;return e.replace(n,(a,...i)=>{const[l,c,d]=i;return s<d&&r.push({type:"text",value:e.slice(s,d).trim()}),r.push({type:"code",value:c.trim(),language:l?l.trim():"plaintext"}),s=d+a.length,a}),s<e.length&&r.push({type:"text",value:e.slice(s).trim()}),t?r.map(a=>a.type!=="text"?a:{...a,value:t(a.value)}):r},Ao=e=>e.replace(/\[([^\]]+)\](?!\()/g,"\\[$1\\]"),wo=e=>e.replace(/([a-zA-Z0-9])_(?=[a-zA-Z0-9])/g,"$1\\_"),ko=e=>e.replace(/~~/g,"\\~\\~"),Io=e=>{let t=e;return t=Ao(t),t=wo(t),t=ko(t),t},$o=typeof navigator<"u"&&navigator.product==="ReactNative",xn=(e,t)=>{const n=r=>!t||t.length===0?!0:he(r)&&t.includes(r.sendingStatus);return $o?e.find(n):e.findLast(n)};function fe(){}function Mo(){const e=typeof navigator<"u"?navigator.userAgent:"",t=/iPad|iPhone|iPod/.test(e),n=/Android/.test(e);return t||n}function Lo(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t.toString(16)}const Ot=e=>{try{return JSON.parse(e===""?"{}":e)}catch{return{}}},Se={isStreaming(e){const t=Ot(e.data);return typeof t=="object"&&!!t.stream},isWelcomeMessage(e,t){var n;if(((n=e.extendedMessagePayload)==null?void 0:n.bot_message_type)==="welcome")return!0;if(je(e,t)){const r=Ot(e.data);return!(r!=null&&r.respond_mesg_id)&&!(r!=null&&r.stream)}return!1},isGeneratedMessage(e){var t;return((t=e.extendedMessagePayload)==null?void 0:t.bot_message_type)==="generated"},hasFeedback(e){var t;return!!((t=e.extendedMessagePayload)!=null&&t.feedback)}},Tt=`@${Ne}`,vn=({appId:e,aiAgentId:t,storage:n})=>{const r={templateBase:`${Tt}-template`,template:s=>`${r.templateBase}/templates/${s}`,templateToken:()=>`${r.templateBase}-template/message-template/tokens`,messengerSession:s=>{const a=Lo(`${e}/${t}/${s}`);return`${Tt}-udata/${a}`},anonUserSession:()=>`${Tt}-session/${e}/${t}`};return{template:{set:(s,a)=>n.set(r.template(s),a),get:s=>n.get(r.template(s)),setCachedToken:s=>n.set(r.templateToken(),s),getCachedToken:()=>n.get(r.templateToken()),clear:()=>{n.getKeys(r.templateBase).forEach(n.delete)}},messenger:{getSettings:s=>{try{const a=n.get(r.messengerSession(s));return a?JSON.parse(a):null}catch{return null}},setSettings:(s,a)=>{try{delete a.auto_created_user;const i=JSON.stringify(a);n.set(r.messengerSession(s),i)}catch{return}},getAnonUser:()=>{try{const s=n.get(r.anonUserSession());return s?JSON.parse(s):null}catch{return null}},setAnonUser:s=>{try{const a=JSON.stringify(s);n.set(r.anonUserSession(),a)}catch{return}},clear:s=>{try{s&&n.delete(r.messengerSession(s)),n.delete(r.anonUserSession())}catch{return}}}}};class rr{constructor(t){U(this,"subscribers",{});this.logger=t}async send(t){const n=Oo(),r=this.subscribers[t.type];if(r){this.logger.debug(`messenger.dispatcher: dispatching command: ${t.type}`,t.payload);const s=r.map(a=>a(t.payload));await Promise.all(s).catch(a=>{this.logger.error(`messenger.dispatcher: error in callback for command: ${t.type}`,a)})}return n.resolve(),n.promise}subscribe(t,n){this.subscribers[t]||(this.subscribers[t]=[]),this.subscribers[t].push(n)}unsubscribe(t,n){this.subscribers[t]&&(this.subscribers[t]=this.subscribers[t].filter(r=>r!==n))}}const Oo=()=>{let e=fe,t=fe;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}};var Kt=(e=>(e[e.VERBOSE=0]="VERBOSE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.NONE=5]="NONE",e))(Kt||{});class or{constructor(t){U(this,"level");this.level=t}verbose(...t){this.level<=0&&console.log(`[${Ne}/verbose]`,...t)}debug(...t){this.level<=1&&console.log(`[${Ne}/debug]`,...t)}info(...t){this.level<=2&&console.log(`[${Ne}/info]`,...t)}warn(...t){this.level<=3&&console.warn(`[${Ne}/warn]`,...t)}error(...t){this.level<=4&&console.error(`[${Ne}/error]`,...t)}}function Cn(e,t,n,r){const s=ho.default.init({appId:e,modules:[new lt.GroupChannelModule,new q.AIAgentModule],localCacheEnabled:!0,options:new Z.SendbirdChatOptions({typingIndicatorInvalidateTime:2e4}),...r});return s.addSendbirdExtensions([{version:n,product:Z.SendbirdProduct.AI_AGENT,platform:t.platform}],{platform:t.deviceOSPlatform,version:t.deviceOSVersion},t.customData)||console.warn("Invalid Sendbird Extensions",t),s}function Ro(e){const t=n=>{throw new Error(`Please initialize chat sdk with ${n}`)};typeof e.groupChannel!="object"&&t("GroupChannelModule"),typeof e.aiAgent!="object"&&t("AIAgentModule")}const Ce={conversation:{isTalkToAgentViewEnabled:!0,scrollMode:"auto",newMessageIndicatorEnabled:!0,senderAvatarEnabled:!0,header:{avatarEnabled:!0},input:{camera:{photoEnabled:!0},gallery:{photoEnabled:!0},fileEnabled:!0},fileViewer:{downloadEnabled:!0}}},Do=e=>{var t,n,r,s,a,i,l,c,d,h,b,E,C,y;return e?{...Ce,...e,conversation:{...Ce.conversation,...e==null?void 0:e.conversation,header:{...(t=Ce.conversation)==null?void 0:t.header,...(n=e==null?void 0:e.conversation)==null?void 0:n.header},input:{...(r=Ce.conversation)==null?void 0:r.input,...(s=e==null?void 0:e.conversation)==null?void 0:s.input,camera:{...(i=(a=Ce.conversation)==null?void 0:a.input)==null?void 0:i.camera,...(c=(l=e==null?void 0:e.conversation)==null?void 0:l.input)==null?void 0:c.camera},gallery:{...(h=(d=Ce.conversation)==null?void 0:d.input)==null?void 0:h.gallery,...(E=(b=e==null?void 0:e.conversation)==null?void 0:b.input)==null?void 0:E.gallery}},fileViewer:{...(C=Ce.conversation)==null?void 0:C.fileViewer,...(y=e==null?void 0:e.conversation)==null?void 0:y.fileViewer}}}:Ce},{Provider:No,useContext:K}=X("AIAgent");function Po({appId:e,aiAgentId:t,keyValueStorage:n,networkStateAdapter:r,language:s,countryCode:a,context:i,queryParams:l,config:c,chatSDK:d,chatParams:h,children:b,logger:E,dispatcher:C,messengerVersion:y,extensions:x={platform:Z.SendbirdPlatform.JS,deviceOSPlatform:Mo()?Z.DeviceOsPlatform.MOBILE_WEB:Z.DeviceOsPlatform.WEB}}){const[m,p]=u.useState(()=>{const v=E??new or(Kt.WARN),_=C??new rr(v);return{logger:v,dispatcher:_,chatSDK:d??Cn(e,x,y,h),cache:vn({appId:e,aiAgentId:t,storage:n})}});return u.useEffect(()=>{p(v=>{let _=v.logger,I=v.dispatcher,T=v.chatSDK;return E&&E!==v.logger&&(_=E),C&&C!==v.dispatcher&&(I=C),d&&d!==v.chatSDK?T=d:!d&&v.chatSDK.appId!==e&&(T=Cn(e,x,y,{newInstance:!0,...h})),{...v,logger:_,dispatcher:I,chatSDK:T,cache:vn({appId:e,aiAgentId:t,storage:n})}})},[e,t,E,C,d,n]),u.useEffect(()=>()=>{m.chatSDK.connectionState==="OPEN"&&m.chatSDK.disconnectWebSocket()},[m.chatSDK]),Ro(m.chatSDK),o.createElement(No,{value:{...m,appId:e,aiAgentId:t,context:i,language:s,countryCode:a,queryParams:l,config:Do(c),networkStateAdapter:r}},b)}const Bo=(e,t,n)=>Ue.useGroupChannelMessages(e,t,{...n,strictStreamingOrder:!0});var Rt=(e=>(e.ConversationClose="conv.close",e))(Rt||{});class Fo{constructor(t={}){U(this,"payload");this.payload=t}toJSON(){return JSON.stringify({type:this.type,payload:this.payload})}}const sr={CloseConversation:e=>new Uo(e)};class Uo extends Fo{constructor(){super(...arguments);U(this,"type","conv.close")}}const ar=(e,t,n={})=>{let r=null,s=null,a=null;const{leading:i=!0,trailing:l=!0}=n,c=(...d)=>{const h=Date.now();if(a===null||h-a>=t)i?(e(...d),a=h):(s=d,a=h);else if(s=d,l&&!r){const b=t-(h-a);r=setTimeout(()=>{s&&l&&(e(...s),a=Date.now()),r=null,s=null},b)}};return c.cancel=()=>{r&&(clearTimeout(r),r=null),s=null,a=null},c},qe={DEFAULT_PRIMARY:"#000000",DEFAULT_BOT_MSG_BG:"#ECECEC",WHITE:"#ffffff",BLACK:"#000000"};function ir(e){return e.length===4?`#${[...e.slice(1)].map(t=>t+t).join("")}`:e}function Ho(e){const t=ir(e);return[parseInt(t.slice(1,3),16),parseInt(t.slice(3,5),16),parseInt(t.slice(5,7),16)]}function zo(e){return`#${e.map(t=>t.toString(16).padStart(2,"0")).join("")}`}function Vo(e,t,n){e/=255,t/=255,n/=255;const r=Math.max(e,t,n),s=Math.min(e,t,n),a=r-s;let i=0,l=0;const c=(r+s)/2;return r!==s&&(l=c>.5?a/(2-r-s):a/(r+s)),r===e?i=(t-n)/a+(t<n?6:0):r===t?i=(n-e)/a+2:r===n&&(i=(e-t)/a+4),i/=6,[i,l,c]}function Go(e,t,n){let r,s,a;if(t===0)r=s=a=n;else{const i=function(h,b,E){return E<0&&(E+=1),E>1&&(E-=1),E<.16666666666666666?h+(b-h)*6*E:E<.5?b:E<.6666666666666666?h+(b-h)*(.6666666666666666-E)*6:h},l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;r=i(c,l,e+1/3),s=i(c,l,e),a=i(c,l,e-1/3)}return[Math.round(r*255),Math.round(s*255),Math.round(a*255)]}function Qe(e,t,n){const[r,s,a]=Ho(e),[i,l,c]=Vo(r,s,a),d=Math.max(0,Math.min(1,c*t)),h=Math.max(0,Math.min(1,l*n)),[b,E,C]=Go(i,h,d);return zo([Math.round(b),Math.round(E),Math.round(C)])}function Wo(e,t="light"){return{extraDark:Qe(e,.6,1.2),dark:Qe(e,.85,1.1),main:e,light:Qe(e,t==="dark"?1.1:1.5,t==="dark"?.95:.9),extraLight:Qe(e,t==="dark"?1.2:1.75,t==="dark"?.9:.8)}}function Dt(e){const t=ir(e),n=149,r=+`0x${t[1]}${t[2]}`,s=+`0x${t[3]}${t[4]}`,a=+`0x${t[5]}${t[6]}`;return r*.299+s*.587+a*.114>n?qe.BLACK:qe.WHITE}function qo(e,t,n,r,s){return{base:{primary:t,primaryContrastContent:n,background:e.background50,headerBackground:e.background50,modalContentBackground:e.background50},metadata:{errorContent:e.ondark.textHighEmphasis},messageInput:{text:e.onlight.textHighEmphasis,placeholderText:e.onlight.textLowEmphasis,background:e.background100},messageIncoming:{text:s,background:r},messageOutgoing:{text:n,background:t},csat:{background:e.background100}}}const jo=(e,t,n,r,s)=>({base:{primary:t,primaryContrastContent:n,background:e.background600,headerBackground:e.background500,modalContentBackground:e.background500},metadata:{errorContent:e.ondark.textHighEmphasis},messageInput:{text:e.ondark.textHighEmphasis,placeholderText:e.ondark.textLowEmphasis,background:e.background400},messageIncoming:{text:s,background:r},messageOutgoing:{text:n,background:t},csat:{background:e.background400}}),et={primary:{extraDark:"#491389",dark:"#6211c8",main:"#742ddd",light:"#c2a9fa",extraLight:"#dbd1ff"},secondary:{extraDark:"#066858",dark:"#027d69",main:"#259c72",light:"#69c085",extraLight:"#a8e2ab"},error:{extraDark:"#9d091e",dark:"#bf0711",main:"#de360b",light:"#f66161",extraLight:"#fdaaaa"},information:{extraDark:"#241389",dark:"#362ca9",main:"#4a48cd",light:"#a9bbfa",extraLight:"#d1dbff"},background700:"#000000",background600:"#161616",background500:"#2c2c2c",background400:"#393939",background300:"#bdbdbd",background200:"#e0e0e0",background100:"#eeeeee",background50:"#ffffff",onlight:{textHighEmphasis:"rgba(0, 0, 0, 0.88)",textMidEmphasis:"rgba(0, 0, 0, 0.5)",textLowEmphasis:"rgba(0, 0, 0, 0.38)",textDisabled:"rgba(0, 0, 0, 0.12)"},ondark:{textHighEmphasis:"rgba(255, 255, 255, 0.88)",textMidEmphasis:"rgba(255, 255, 255, 0.5)",textLowEmphasis:"rgba(255, 255, 255, 0.38)",textDisabled:"rgba(255, 255, 255, 0.12)"},overlay:{dark:"rgba(0, 0, 0, 0.55)",light:"rgba(22, 22, 22, 0.32)"}},At={h1:{fontSize:18,fontWeight:700},h2:{fontSize:16,fontWeight:700},subtitle1:{fontSize:16,fontWeight:500},subtitle2:{fontSize:16,fontWeight:400},body1:{fontSize:16,fontWeight:400},body2:{fontSize:14,fontWeight:500},body3:{fontSize:14,fontWeight:400},button:{fontSize:14,fontWeight:700},caption1:{fontSize:12,fontWeight:700},caption2:{fontSize:12,fontWeight:400},caption3:{fontSize:11,fontWeight:700},caption4:{fontSize:11,fontWeight:400}};function yn(e){const t=Ko(e),{colors:n,aiAgentColorVariables:r}=Yo(e,t),s=Xo(e);return{selectedTheme:e.selectedTheme,palette:t,colors:n,aiAgentColorVariables:r,typography:s}}function Ko({selectedTheme:e,palette:t,primary:n}){const r=t!=null&&t.primary?t.primary:n?n===et.primary.main?et.primary:Wo(n,e):et.primary;return{...et,primary:r,...t}}function Yo({selectedTheme:e,primaryContrast:t,botMessageBackground:n,botMessageBackgroundContrast:r},s){const a=s.primary.main,i=t??Dt(a),l=n??qe.DEFAULT_BOT_MSG_BG,c=r??Dt(l);return{colors:(e==="light"?qo:jo)(s,a,i,l,c),aiAgentColorVariables:{primary_color:a,bot_message_bg_color:l,primary_contrast_color:i,bot_message_bg_contrast_color:c}}}function Zo(e,t,n){const r={...e};return n.forEach(s=>{const a=t[s];a!=null&&(r[s]=a)}),r}function Xo({typography:e}){if(!e)return At;const t={...At};return Object.keys(e).forEach(n=>{const r=e[n];if(r&&typeof r=="object"){const s=At[n],a=["fontSize","fontWeight","fontFamily","lineHeight"];t[n]=Zo(s,r,a)}}),t}const{Provider:Jo,useContext:Yt}=X("AIAgentTheme");function Qo({logger:e,palette:t,typography:n,appearance:r,children:s}){const a=u.useRef(null),[i,l]=u.useState(()=>yn({selectedTheme:(r==null?void 0:r.theme)??"light",palette:t,typography:n,primary:r==null?void 0:r.primaryColor,botMessageBackground:r==null?void 0:r.botMessageBackgroundColor})),c=u.useCallback((d,h)=>{h&&(a.current=h);const b=(r==null?void 0:r.theme)??d,E=a.current?a.current.themes[b]:null,C={primary:r==null?void 0:r.primaryColor,primaryContrast:void 0,botMessageBackground:r==null?void 0:r.botMessageBackgroundColor,botMessageBackgroundContrast:void 0};!C.primary&&(E!=null&&E.primary_color)&&(C.primary=E.primary_color,C.primaryContrast=E.primary_contrast_color),!C.botMessageBackground&&(E!=null&&E.bot_message_bg_color)&&(C.botMessageBackground=E.bot_message_bg_color,C.botMessageBackgroundContrast=E.bot_message_bg_contrast_color);const y=yn({selectedTheme:b,palette:t,typography:n,...C});l(y),e==null||e.info("theme.update:",b)},[r==null?void 0:r.theme,r==null?void 0:r.primaryColor,r==null?void 0:r.botMessageBackgroundColor,t,n,e]);return u.useEffect(()=>{(r!=null&&r.theme||r!=null&&r.primaryColor||r!=null&&r.botMessageBackgroundColor)&&c(i.selectedTheme)},[r==null?void 0:r.theme,r==null?void 0:r.primaryColor,r==null?void 0:r.botMessageBackgroundColor]),o.createElement(Jo,{value:{theme:i,updateTheme:c}},s)}const _n=25*1024*1024,es={off:"off",always:"always",handed_off_only:"handed_off_only"},ts=()=>{const[e,t]=u.useState(()=>({maxAttachmentCount:1,attachmentMode:"handed_off_only",defaultUploadSizeLimit:_n,uploadSizeLimitPerType:new Map,supportedImageMimeTypes:new Set(["image/png","image/jpeg","image/jpg"]),supportedFileMimeTypes:new Set(["application/pdf"])})),n=u.useCallback(({active_channel:s,upload_restriction:a})=>{const{maxAttachmentCount:i,attachmentMode:l,defaultUploadSizeLimit:c,supportedImageMimeTypes:d,supportedFileMimeTypes:h}=e;t({maxAttachmentCount:i,attachmentMode:es[s.attachment_mode]??l,defaultUploadSizeLimit:(a==null?void 0:a.default_upload_size_limit)??c,uploadSizeLimitPerType:new Map(Object.entries((a==null?void 0:a.upload_size_limit_per_type)??[])),supportedImageMimeTypes:new Set((a==null?void 0:a.supported_image_mime_types)??d),supportedFileMimeTypes:new Set((a==null?void 0:a.supported_file_mime_types)??h)})},[]),r=u.useCallback(s=>{const{channel:a,uploadSizeLimit:i=_n}=s,l=(d=!0)=>a!=null&&a.isAIAgent?d?Be(a):!1:!0,c=d=>{if(l())return e.defaultUploadSizeLimit??i;const h=e.defaultUploadSizeLimit??i,b=e.uploadSizeLimitPerType.get(d)??h;return Math.min(h,b)};return{maxAttachmentCount:e.maxAttachmentCount,isEnabled:()=>{if(l(!1))return!0;switch(e.attachmentMode){case"off":return!1;case"always":return!0;case"handed_off_only":return Be(a);default:return!0}},get supportedMimeTypes(){return l()?[yo]:[...e.supportedImageMimeTypes,...e.supportedFileMimeTypes]},isSupportedMimeType:d=>l()?!0:e.supportedImageMimeTypes.has(d)||e.supportedFileMimeTypes.has(d),getUploadSizeLimit:c,getUploadSizeLimitInMB:d=>c(d)/(1024*1024)}},[e]);return{updateBaseAttachmentRules:n,createAttachmentRules:r}};function lr(){const{chatSDK:e,logger:t}=K();return u.useCallback(async n=>{if(n.userId===""){const r=new Error("userId cannot be empty string for messenger settings request");throw t.error("requestMessengerSettings: invalid userId",r),r}return await e.aiAgent.requestMessengerSettings(n)},[e,t])}function ns(){const{chatSDK:e,logger:t}=K(),n=u.useCallback(async(s,a,i)=>{if(t.debug("useChatConnection.connect: start, session",s.userId),a){const l=new Z.SessionHandler({...a,onSessionTokenRequired:rs(a.onSessionTokenRequired,i)});e.setSessionHandler(l)}try{return await e.connect(s.userId,s.authToken),t.debug("useChatConnection.connect: end, currentUser",e.currentUser),e.currentUser}catch(l){const c=l;if(e.isCacheEnabled){if(ss(c))t.warn("useChatConnection.connect","offline connect restricted",c.message,c.code),t.warn("useChatConnection.connect","clear cached-data"),await e.clearCachedData().catch(d=>t.warn("useChatConnection.connect","clear cached-data failure",d));else if(e.currentUser)return t.debug("useChatConnection.connect: end (offline), currentUser",e.currentUser),e.currentUser}throw t.warn("useChatConnection.connect","connect failure",c.message,c.code),c}},[e,t]),r=u.useCallback(async()=>{t.debug("useChatConnection.disconnect: start"),await e.disconnect(),t.debug("useChatConnection.disconnect: end")},[e,t]);return{connect:n,disconnect:r}}function rs(e,t){if(e)return async(n,r)=>{new Promise((s,a)=>e==null?void 0:e(s,a)).then(s=>{s&&(t==null||t(s)),n(s)}).catch(s=>{r(s)})}}const os=[400300,400301,400302,400310];function ss(e){return os.some(t=>e.code===t)}class cr{constructor({userId:t,authToken:n,sessionHandler:r}){U(this,"userId");U(this,"authToken");U(this,"sessionHandler");this.userId=t,this.authToken=n,this.sessionHandler=r}}class Nt{constructor(){U(this,"userId");U(this,"authToken");U(this,"sessionHandler")}}const as=1440*60*1e3,is=e=>{const{logger:t,cache:n}=K(),r=()=>{const a=n.messenger.getAnonUser();return a?a.expireAt-as<=Date.now()?(t.debug("useUserSessionCandidate.getAnonymousSessionInfo: auto session expired, clear cache"),n.messenger.clear(a.userId),null):(t.debug("useUserSessionCandidate.getAnonymousSessionInfo: auto session info detected"),a):null},s=()=>{if(!e||e instanceof Nt)throw new Error("userSessionInfo must be an instance of ManualSessionInfo");if(typeof e.userId!="string")throw new Error("userSessionInfo.userId must be a string");const a=["userId","authToken","sessionHandler"].filter(i=>!(i in e));return a.length>0&&t.error(`useUserSessionCandidate.getManualSessionInfo: missing required keys in userSessionInfo: ${a.join(", ")}`),t.debug("useUserSessionCandidate.getManualSessionInfo: manual session info detected"),e};return u.useMemo(()=>e instanceof cr?{type:"manual",userSessionCandidate:s()}:e instanceof Nt?{type:"anonymous",userSessionCandidate:r()}:e&&typeof e=="object"?(t.warn("Please use ManualSessionInfo instead of the old userSessionInfo format."),{type:"manual",userSessionCandidate:s()}):e===void 0?(t.warn("Please use AnonymousSessionInfo instead of undefined userSessionInfo."),{type:"anonymous",userSessionCandidate:r()}):{type:"anonymous",userSessionCandidate:null},[t,e==null?void 0:e.userId,e==null?void 0:e.authToken,e==null?void 0:e.sessionHandler,n.messenger.getAnonUser,n.messenger.clear])};function ls({userSessionInfo:e,onUpdateMessengerSettings:t,onPreAuth:n,onPostAuth:r,onErrorAuth:s,onAuthTokenRefreshed:a,onPostDeauth:i,forceCreateChannel:l}){const{aiAgentId:c,language:d,context:h,countryCode:b,logger:E,cache:C}=K(),{connect:y,disconnect:x}=ns(),{type:m,userSessionCandidate:p}=is(e),v=lr(),_=u.useCallback(async()=>{var M;E.debug("useAuthentication.authenticate: start");const T=p!=null&&p.userId?C.messenger.getSettings(p.userId):null;T!=null&&T.bot&&(t(T),E.debug("useAuthentication.authenticate: cached messenger settings",T));const L=await v({aiAgentId:c,userId:p==null?void 0:p.userId,language:d,country:b,context:h,forceCreateChannel:l,knownActiveChannelUrl:(M=T==null?void 0:T.active_channel)==null?void 0:M.channel_url});E.debug("useAuthentication.authenticate: messenger settings response",L);let $=null;if(L.auto_created_user)if(m==="manual")E.warn("Received auto created user info but current session is manual. Ignoring auto created user info."),$={userId:p.userId,authToken:p.authToken};else{const{user_id:R,session_token:z,expire_at:G}=L.auto_created_user;C.messenger.setAnonUser({userId:R,authToken:z,expireAt:G}),$={userId:R,authToken:z}}else $={userId:(p==null?void 0:p.userId)??"",authToken:(p==null?void 0:p.authToken)??""};C.messenger.setSettings($.userId,L),t(L);try{await n(L,$),await y($,p==null?void 0:p.sessionHandler,a),await r(L,$)}catch(R){throw R instanceof Error&&(s(R),E.error("useAuthentication.authenticate: failed to connect",R)),R}return L},[v,y,m,p==null?void 0:p.userId,p==null?void 0:p.sessionHandler,p==null?void 0:p.authToken,c,d,h,b,l,C.messenger.setAnonUser,C.messenger.getSettings,C.messenger.setSettings,t,n,r,s,a]),I=u.useCallback(async()=>{E.debug("useAuthentication.deauthenticate: start"),await x(),i(),E.debug("useAuthentication.deauthenticate: completed")},[x,E,i]);return{authenticate:_,deauthenticate:I,userSessionCandidate:p}}const ur=e=>{try{const t=JSON.parse(e);return typeof t=="string"?JSON.stringify(t).slice(1,-1):e.trim()}catch{return JSON.stringify(e).slice(1,-1)}},Ke=e=>JSON.parse(e),ht=e=>JSON.parse(e);function cs(e,t){const[n,r]=t.split(",").map(s=>s.trim());return e==="dark"&&r||n}function us(e){const t={};function n(r,s=""){for(const[a,i]of Object.entries(r)){const l=s?`${s}.${a}`:a;i&&typeof i=="object"&&!Array.isArray(i)?n(i,l):t[l]=i}}return n(e),t}function Zt({template:e,variables:t,variableKeyPattern:n,variableValueTransformer:r}){return Object.entries(t).reduce((s,[a,i])=>{if(!r&&!["number","boolean","string"].includes(typeof i))throw new Error(`If transformer is not provided, value(${a}:${i}) must be a {string, number, or boolean}`);const l=r?r(i):String(i),c=n(a);return s.replace(c,ur(l))},e)}async function ds({template:e,variables:t,variableKeyPattern:n,variableValueTransformer:r}){return(await Promise.all(Object.entries(t).map(async([a,i])=>{const l=await r(i);return{regex:n(a),transformedValue:l}}))).reduce((a,{regex:i,transformedValue:l})=>a.replace(i,ur(l)),e)}const ms=()=>{const{chatSDK:e,logger:t,cache:n}=K(),r=u.useCallback(()=>{var l,c;const a=(c=(l=e.appInfo)==null?void 0:l.aiAgentInfo)==null?void 0:c.templateListToken;if(!a)return!1;const i=n.template.getCachedToken();return i?a!==i:!0},[e,n.template.getCachedToken]),s=u.useCallback(async()=>{try{const{templates:a,token:i}=await e.aiAgent.getMessageTemplates({limit:20});for(const{template:l}of a){const{key:c}=Ke(l);n.template.set(c,l)}n.template.setCachedToken(i)}catch(a){t==null||t.error("messageTemplateContext.syncCachedTemplates: error:",a)}},[e,t,n.template.set,n.template.setCachedToken]);return{shouldSyncCachedTemplate:r,syncCachedTemplates:s}},{Provider:gs,useContext:ft}=X("AIAgentMessengerSession"),hs=u.forwardRef(function({userSessionInfo:e,forceCreateChannel:t,children:n},r){const{appId:s,aiAgentId:a,chatSDK:i,language:l,countryCode:c,context:d,cache:h,logger:b}=K(),{updateTheme:E}=Yt(),[C,y]=u.useState(void 0),[x,m]=u.useState(void 0),[p,v]=u.useState(null),[_,I]=u.useState(null),[T,L]=u.useState(null),[$,M]=u.useState(null),{updateBaseAttachmentRules:R,createAttachmentRules:z}=ts(),{shouldSyncCachedTemplate:G,syncCachedTemplates:Ee}=ms(),xe=lr(),{authenticate:Ie,deauthenticate:j}=ls({userSessionInfo:e,forceCreateChannel:t,onUpdateMessengerSettings:u.useCallback(N=>{const{appearance:A,bot:O,launcher:V}=N;E(A.selected_theme,A),L({userId:O.bot_userid,profileUrl:O.bot_profile_url,nickname:O.bot_nickname,replyToFile:O.reply_to_file,specialNotice:O.special_notice,specialNoticeEnabled:O.is_special_notice_enabled,showHandoffButton:O.show_handoff_button??!0,isMultipleActiveConversationsEnabled:O.is_multiple_active_conversations_enabled??!0,isUserFeedbackEnabled:N.bot.is_user_feedback_enabled??!1,isUserFeedbackCommentOptionEnabled:N.bot.is_user_feedback_comment_option_enabled??!1}),M({type:V.image_type||"default_icon",imageUrl:V.image_url}),R(N)},[E]),onPreAuth:u.useCallback((N,A)=>{y(void 0),I(A)},[]),onPostAuth:u.useCallback(async N=>{v(i.currentUser),G()&&await Ee(),m({url:N.active_channel.channel_url,status:q.ConversationStatus.OPEN})},[i,G,Ee]),onErrorAuth:u.useCallback(N=>{y(N)},[]),onAuthTokenRefreshed:u.useCallback(N=>{I(A=>A?{...A,authToken:N}:null)},[]),onPostDeauth:u.useCallback(()=>{h.template.clear(),h.messenger.clear(_==null?void 0:_.userId),v(null),m(void 0),I(null),L(null),M(null)},[h.template.clear,h.messenger.clear,_])}),ne=u.useCallback(async()=>{var N;if(_){b.debug("agentMessengerSession.refreshActiveChannel: try to refresh active channel"),m(void 0);const A=await xe({aiAgentId:a,userId:_.userId,language:l,country:c,context:d,forceCreateChannel:t,knownActiveChannelUrl:(N=h.messenger.getSettings(_.userId))==null?void 0:N.active_channel.channel_url});return h.messenger.setSettings(_.userId,A),m({url:A.active_channel.channel_url,status:q.ConversationStatus.OPEN}),b.info("agentMessengerSession.refreshActiveChannel: refreshed active channel",A.active_channel.channel_url),A.active_channel.channel_url}else throw b.error("agentMessengerSession.refreshActiveChannel: userSession is not ready"),new Error("userSession is not ready")},[xe,s,a,_==null?void 0:_.userId,l,c,d,t,h.messenger.getSettings,h.messenger.setSettings]),ve=u.useCallback(async N=>{if(!(_!=null&&_.userId))throw new Error("Current user is not authenticated. Please authenticate first.");const A=await xe({...N,userId:_.userId,knownActiveChannelUrl:void 0}),O=A.active_channel.channel_url;return h.messenger.setSettings(_.userId,A),O},[_==null?void 0:_.userId,xe]),[w]=u.useState(()=>ar(N=>{var A;b.info("agentMessengerSession.channelChanged: channel.conversation",N.conversation),m({url:N.url,status:((A=N.conversation)==null?void 0:A.status)??q.ConversationStatus.OPEN})},250,{trailing:!1,leading:!0}));return Ue.useGroupChannelHandler(i,{onChannelChanged:N=>{N.isGroupChannel()&&N.url===(x==null?void 0:x.url)&&w(N)}}),u.useEffect(()=>()=>{w.cancel()},[w]),u.useImperativeHandle(r,()=>{const N=async()=>{if(!x)throw new Error("No active conversation. Please start a conversation first.");return await i.groupChannel.getChannel(x.url)};return{activeChannel:x,chatSDK:i,authenticate:Ie,deauthenticate:j,updateContext:async A=>{const V=await(await N()).updateContext(a,A);return{...V,context:V.context??{}}},patchContext:async A=>{const V=await(await N()).patchContext(a,A);return{...V,context:V.context??{}}},getContextObject:async()=>{const O=await(await N()).getContextObject(a);return{...O,context:O.context??{}}}}},[Ie,j,x,i,a,b]),o.createElement(gs,{value:{sdkUser:p,userSessionInfo:e,userSession:_,activeChannel:x,setActiveChannel:m,refreshActiveChannel:ne,createConversation:ve,connectionError:C,aiAgentInfo:T,launcherInfo:$,authenticate:Ie,deauthenticate:j,createAttachmentRules:z}},n)}),fs=()=>{const e=u.useId(),{chatSDK:t,networkStateAdapter:n}=K(),[r,s]=u.useState(()=>n?n.isOnline()?"connected":"reconnecting":"connected");return u.useEffect(()=>{const a=new Z.ConnectionHandler({onDisconnected:()=>s("disconnected"),onConnected:()=>s("connected"),onReconnectStarted:()=>s("reconnecting"),onReconnectSucceeded:()=>s("connected"),onReconnectFailed:()=>s("disconnected"),onConnectionLost:()=>s("reconnecting")});return t.addConnectionHandler(e,a),()=>{t.removeConnectionHandler(e)}},[t,e]),u.useEffect(()=>{if(n)return n.subscribe(()=>{s("reconnecting")})},[n]),r},dr=e=>{const{chatSDK:t}=K(),[n,r]=u.useState([]);return Ue.useGroupChannelHandler(t,{onTypingStatusUpdated(s){if(s.url===(e==null?void 0:e.url)){const a=s.getTypingUsers();r(a)}}}),n},ps=({channel:e,messages:t,isStreamAnimating:n})=>{const{aiAgentInfo:r,userSession:s}=ft(),a=fs(),i=bs({channel:e,lastMessage:xn(t,[_e.SendingStatus.SUCCEEDED]),aiAgentUserId:(r==null?void 0:r.userId)??"",isStreamAnimating:n}),l=Cs({shouldApply:!!(e!=null&&e.isAIAgent)&&!Be(e),isDisabledWhileAIResponding:i,lastMessage:xn(t,[_e.SendingStatus.PENDING,_e.SendingStatus.SUCCEEDED]),currentUserId:(s==null?void 0:s.userId)??""});if(!e||a==="disconnected")return{disabled:!0,disabledBy:"unavailable"};if(a==="reconnecting")return{disabled:!0,disabledBy:"reconnecting"};if(Te(e))return{disabled:!0,disabledBy:"conversation_closed"};if(Es(e))return{disabled:!0,disabledBy:"form_active"};const c=xs(e);return c?{disabled:!0,disabledBy:c}:i||l?{disabled:!0,disabledBy:"ai_responding"}:{disabled:!1,disabledBy:""}},bs=({channel:e,lastMessage:t,aiAgentUserId:n,isStreamAnimating:r})=>{const[s,a]=u.useState(!1),i=dr(e);return u.useEffect(()=>{if(!t)return;const l=i.some(d=>d.userId===n),c=je(t,n)&&(Se.isStreaming(t)||r);a(!!(c||l))},[i,t,n,r]),s},Es=e=>{var i;const t=e==null?void 0:e.lastMessage;if(!t||!e)return!1;const n=t.extendedMessagePayload,r=n==null?void 0:n.form,s=r&&!r.submitted_at&&!r.canceled_at,a=e.isAIAgent&&!!((i=e.conversation)!=null&&i.handedOverAt);return s&&!a},xs=e=>{const t=e==null?void 0:e.lastMessage,n=t==null?void 0:t.extendedMessagePayload;return n==null?void 0:n.user_input_disabled_by},vs=3e4,Cs=({shouldApply:e,lastMessage:t,isDisabledWhileAIResponding:n,currentUserId:r})=>{const[s,a]=u.useState(!1),i=u.useRef(null),l=t&&je(t,r)?t.createdAt:0;return u.useEffect(()=>{const c=()=>{i.current&&(clearTimeout(i.current),i.current=null),a(!1)},d=E=>{i.current&&clearTimeout(i.current),a(!0),i.current=setTimeout(()=>{a(!1),i.current=null},E)},h=Date.now()-l,b=vs-h;return n||b<=0?c():d(b),()=>{i.current&&clearTimeout(i.current)}},[n,l]),s&&e},ys=()=>{const[e,t]=u.useState(new Set),n=u.useCallback(s=>{t(a=>{if(a.has(s))return a;const i=new Set(a);return i.add(s),i})},[]),r=u.useCallback(s=>{t(a=>{if(!a.has(s))return a;const i=new Set(a);return i.delete(s),i})},[]);return{isAnimating:e.size>0,start:n,stop:r}},{Provider:_s}=X("AIAgentConversation");function Ss({children:e,channelUrl:t,onChannelDeleted:n,onMessagesReceived:r,onMessagesUpdated:s,onConversationClosedStatusChanged:a,onConversationClosedViaDispatcher:i,onBeforeSendMessage:l,onAfterSendMessage:c=fe,shouldMarkAsRead:d=!0,shouldCountNewMessages:h=()=>!1,sortComparator:b}){var M;const E=()=>d&&(m==null?void 0:m.markAsRead()),{chatSDK:C,logger:y,dispatcher:x}=K(),{channel:m,channelFetchError:p,fetchChannel:v}=Ts(t),_=Bo(C,m,{replyType:_e.ReplyType.ONLY_REPLY_TO_CHANNEL,shouldCountNewMessages:h,onChannelDeleted:n,onMessagesReceived:R=>r==null?void 0:r(R),onMessagesUpdated:R=>s==null?void 0:s(R),logger:y,markAsRead:E,sortComparator:b}),I=ys(),T=ps({channel:m,messages:_.messages,isStreamAnimating:I.isAnimating});u.useEffect(()=>{E()},[d]);const L=Te(m);u.useEffect(()=>{a==null||a(L)},[L,a]),u.useEffect(()=>{const R=async z=>{const G=typeof(z==null?void 0:z.channelUrl)=="string";m&&G&&z.channelUrl!==m.url||(y.debug("conversation.dispatcher: try to close conversation",m),m!=null&&m.conversation&&m.conversation.status===q.ConversationStatus.OPEN&&(await m.closeConversation(),i==null||i()))};return x.subscribe(Rt.ConversationClose,R),()=>{x.unsubscribe(Rt.ConversationClose,R)}},[x,(M=m==null?void 0:m.conversation)==null?void 0:M.status,i]);const $={conversation:(m==null?void 0:m.conversation)??void 0,channelSource:{channel:m,error:p,refetch:()=>v(),closeConversation:async()=>{Te(m)||await(m==null?void 0:m.closeConversation())}},messageSource:{messages:_.messages,newMessages:_.newMessages,initialized:_.initialized,loadPrevious:()=>_.loadPrevious(),loadNext:()=>_.loadNext(),deleteMessage:R=>_.deleteMessage(R),resendMessage:R=>_.resendMessage(R),resetNewMessages:()=>_.resetNewMessages(),sendUserMessage:async R=>{var G;if(((G=m==null?void 0:m.conversation)==null?void 0:G.status)===q.ConversationStatus.CLOSED)throw new Error("Conversation is closed");l&&(R=await l(R));const z=await _.sendUserMessage(R,c);return c==null||c(z),z},sendFileMessage:async R=>{var G;if(((G=m==null?void 0:m.conversation)==null?void 0:G.status)===q.ConversationStatus.CLOSED)throw new Error("Conversation is closed");l&&(R=await l(R));const z=await _.sendFileMessage(R,c);return c==null||c(z),z}},state:{streamAnimation:I,input:T}};return o.createElement(_s,{value:$},e)}function Ts(e){const{chatSDK:t,logger:n}=K(),{sdkUser:r}=ft(),[s,a]=u.useState(void 0),[i,l]=u.useState(void 0);async function c(){if(!r){n.debug("conversation.fetchChannel: no sdk user, skip fetching channel");return}if(n.debug("conversation.fetchChannel: start"),a(void 0),l(void 0),e)try{n.debug("conversation.fetchChannel: get channel",e);const d=await t.groupChannel.getChannel(e);a(d),n.debug("conversation.fetchChannel: fetched channel",d)}catch(d){d instanceof Z.SendbirdError&&l(d),n.error("conversation.fetchChannel: error",d)}}return As(s),u.useEffect(()=>{c()},[t,r,e]),{channel:s,channelFetchError:i,fetchChannel:c}}function As(e){const{chatSDK:t}=K(),{activeChannel:n,setActiveChannel:r}=ft(),s=u.useId();u.useEffect(()=>{if(!e||!n)return;const a=new Z.ConnectionHandler({onReconnectSucceeded:async()=>{var l;const i=await e.refresh();i.url===n.url&&r({url:i.url,status:((l=i.conversation)==null?void 0:l.status)??q.ConversationStatus.OPEN})}});return t.addConnectionHandler(s,a),()=>{t.removeConnectionHandler(s)}},[t,e,n])}class ws{constructor(t,{filter:n,limit:r=20}){U(this,"filter");U(this,"_sdk");U(this,"_pinnedChannels");U(this,"_channels");U(this,"_isDisposed",!1);U(this,"_handlerId",`handler-id-${Date.now()}`);U(this,"_order",lt.GroupChannelListOrder.LATEST_LAST_MESSAGE);U(this,"_limit");U(this,"_query");U(this,"_token");U(this,"_timestamp");U(this,"_isSyncing");U(this,"_channelHandler");U(this,"_connectionHandler");U(this,"_collectionEventHandler");U(this,"_throttledOnChannelChanged");var s,a,i,l,c,d,h;this.filter=n,this._sdk=t,this._pinnedChannels=[],this._channels=[],this._limit=r,this._query=this._sdk.aiAgent.createMyGroupChannelListQuery({aiAgentChannelFilter:(s=this.filter)==null?void 0:s.aiAgentChannelFilter,aiAgentConversationStatusFilter:(a=this.filter)==null?void 0:a.aiAgentConversationStatusFilter,aiAgentIds:(i=this.filter)==null?void 0:i.aiAgentIds,deskChannelFilter:(l=this.filter)==null?void 0:l.deskChannelFilter,pinnedChannelUrls:(c=this.filter)==null?void 0:c.pinnedChannelUrls,copilotConversationOnly:(d=this.filter)==null?void 0:d.copilotConversationOnly,copilotSupportChannelUrl:(h=this.filter)==null?void 0:h.copilotSupportChannelUrl,limit:this._limit}),this._token="",this._timestamp=Number.MAX_SAFE_INTEGER,this._isSyncing=!1,this._throttledOnChannelChanged=ar(b=>{b.isGroupChannel()&&(this._query.belongsTo(b)?this._addChannelsToView([b],!1):this._removeChannelsFromView([b.url]))},250,{trailing:!1,leading:!0}),this._channelHandler=new lt.GroupChannelHandler({onChannelChanged:this._throttledOnChannelChanged,onChannelDeleted:b=>{this._removeChannelsFromView([b])}}),this._connectionHandler=new Z.ConnectionHandler({onReconnectSucceeded:()=>{this._isDefaultChangelogSyncTimestampUpdated&&this._syncChannelChangelogs()}}),this._sdk.addConnectionHandler(this._handlerId,this._connectionHandler),this._sdk.groupChannel.addGroupChannelHandler(this._handlerId,this._channelHandler)}get _isDefaultChangelogSyncTimestampUpdated(){return this._timestamp!==Number.MAX_SAFE_INTEGER}_setDefaultChangelogsSyncTimestamp(t){var a,i;const n=new Set(((a=this.filter)==null?void 0:a.pinnedChannelUrls)??[]),r=t.find(l=>!n.has(l.url));let s;r?s=((i=r.lastMessage)==null?void 0:i.createdAt)??r.createdAt:s=this._query.lastResponseAt,this._timestamp>s&&(this._timestamp=s)}async _syncChannelChangelogs(){if(this._isDisposed)return[];if(this._isSyncing)return[];try{this._isSyncing=!0;let t;for(this._token?t=await this._sdk.aiAgent.getMyGroupChannelChangeLogsByToken(this._token,this.filter):t=await this._sdk.aiAgent.getMyGroupChannelChangeLogsByTimestamp(this._timestamp,this.filter),this._token=t.token,this._addChannelsToView(t.updatedChannels),this._removeChannelsFromView(t.deletedChannelUrls);t.hasMore&&t.token;)t=await this._sdk.aiAgent.getMyGroupChannelChangeLogsByToken(this._token,this.filter),this._token=t.token,this._addChannelsToView(t.updatedChannels),this._removeChannelsFromView(t.deletedChannelUrls)}catch{}finally{this._isSyncing=!1}return[]}_upsertPinnedChannelsToArray(t){var l;const n=((l=this.filter)==null?void 0:l.pinnedChannelUrls)??[],r=new Map(n.map((c,d)=>[c,d])),s=[],a=[],i=[];for(const c of t){if(!this._query.belongsTo(c)){i.push(c.url);continue}const d=r.get(c.url);if(d===void 0)continue;const h=Pt(this._pinnedChannels,c);h>=0?(this._pinnedChannels.splice(h,1),a.push(c)):s.push(c);const E=this._pinnedChannels.findIndex(y=>(r.get(y.url)??1/0)>d),C=E===-1?this._pinnedChannels.length:E;this._pinnedChannels.splice(C,0,c)}return{addedChannels:s,updatedChannels:a,unmatchedChannelUrls:i}}_upsertRegularChannelsToArray(t,n=!1){const r=[],s=[],a=[];for(const i of t){if(!this._query.belongsTo(i)){r.push(i.url);continue}const l=Pt(this._channels,i),c=l<0;!c&&this._channels.splice(l,1);const h=ks(this._channels,i,this._order).place,b=h===this._channels.length;c?b?(n||!this.hasMore)&&(this._channels.push(i),s.push(i)):(this._channels.splice(h,0,i),s.push(i)):(this._channels.splice(h,0,i),a.push(i))}return{addedChannels:s,updatedChannels:a,unmatchedChannelUrls:r}}_addChannelsToView(t,n=!1){var b,E,C,y,x;const r=new Set(((b=this.filter)==null?void 0:b.pinnedChannelUrls)??[]),s=[],a=[];for(const m of t)r.has(m.url)?s.push(m):a.push(m);const i=this._upsertPinnedChannelsToArray(s),l=this._upsertRegularChannelsToArray(a,n),c=i.addedChannels.concat(l.addedChannels),d=i.updatedChannels.concat(l.updatedChannels),h=i.unmatchedChannelUrls.concat(l.unmatchedChannelUrls);c.length>0&&((C=(E=this._collectionEventHandler)==null?void 0:E.onChannelsAdded)==null||C.call(E,{},c)),d.length>0&&((x=(y=this._collectionEventHandler)==null?void 0:y.onChannelsUpdated)==null||x.call(y,{},d)),h.length>0&&this._removeChannelsFromView(h)}_removeChannelsFromView(t){var s,a,i;const n=new Set(((s=this.filter)==null?void 0:s.pinnedChannelUrls)??[]),r=[];for(const l of t)if(n.has(l)){const c=this._pinnedChannels.findIndex(d=>d.url===l);c>=0&&(r.push(l),this._pinnedChannels.splice(c,1))}else{const c=this._channels.findIndex(d=>d.url===l);c>=0&&(r.push(l),this._channels.splice(c,1))}r.length>0&&((i=(a=this._collectionEventHandler)==null?void 0:a.onChannelsDeleted)==null||i.call(a,{},r))}get channels(){return this._isDisposed?[]:[...this._pinnedChannels,...this._channels]}get hasMore(){return this._isDisposed?!1:this._query.hasNext}async loadMore(){if(this._isDisposed)return[];if(this.hasMore){const t=await this._query.next();return this._setDefaultChangelogsSyncTimestamp(t),this._addChannelsToView(t,!0),t}return[]}setConversationListCollectionHandler(t){this._collectionEventHandler=t}dispose(){this._isDisposed||(this._isDisposed=!0,this._throttledOnChannelChanged.cancel(),this._collectionEventHandler=void 0,this._sdk.removeConnectionHandler(this._handlerId),this._sdk.groupChannel.removeGroupChannelHandler(this._handlerId),this._pinnedChannels.length=0,this._channels.length=0)}}const Pt=(e,t)=>e.findIndex(n=>n.isIdentical(t)),ks=(e,t,n)=>{if(e.length>0){const r=Pt(e,t);let s=0,a=e.length-1,i=Math.floor((s+a)/2);for(;s<a;){const c=Sn(e[i],t,n);if(c>0)a=i,i=Math.floor((s+a)/2);else if(c<0)s=i+1,i=Math.floor((s+a)/2);else return{place:i,oldPosition:r}}return{place:Sn(e[i],t,n)>=0?i:i+1,oldPosition:r}}return{place:e.length,oldPosition:-1}},Sn=(e,t,n)=>{switch(n){case lt.GroupChannelListOrder.LATEST_LAST_MESSAGE:if(e.lastMessage&&t.lastMessage){const r=t.lastMessage.createdAt-e.lastMessage.createdAt;return r===0?t.createdAt-e.createdAt:r}else return e.lastMessage?-1:t.lastMessage?1:t.createdAt-e.createdAt;default:return 0}};function Is(e,t){var y,x,m,p,v,_,I,T,L,$;const n=u.useId(),[r,s]=u.useState(!1),[a,i]=u.useState(null),[l,c]=u.useState([]),[d,h]=u.useState(null),b=u.useRef(!1),E=u.useCallback(async()=>{if(!b.current&&e.currentUser){b.current=!0,s(!1),i(null),c([]);try{d==null||d.dispose();const M=new ws(e,t);M.setConversationListCollectionHandler({onChannelsAdded:()=>{c(M.channels)},onChannelsUpdated:()=>{c(M.channels)},onChannelsDeleted:()=>{c(M.channels)}}),await M.loadMore(),h(M),i(null)}catch(M){h(null),i(M)}finally{s(!0),b.current=!1}}},[e,e.currentUser,(y=t.filter)==null?void 0:y.aiAgentChannelFilter,(m=(x=t.filter)==null?void 0:x.aiAgentConversationStatusFilter)==null?void 0:m.join(),(v=(p=t.filter)==null?void 0:p.aiAgentIds)==null?void 0:v.join(),(_=t.filter)==null?void 0:_.deskChannelFilter,(T=(I=t.filter)==null?void 0:I.pinnedChannelUrls)==null?void 0:T.join(),(L=t.filter)==null?void 0:L.copilotConversationOnly,($=t.filter)==null?void 0:$.copilotSupportChannelUrl,t.limit]),C=u.useCallback(async()=>{if(d)try{await d.loadMore()}catch(M){i(M)}},[d]);return u.useEffect(()=>(e.addConnectionHandler(n,new Z.ConnectionHandler({onConnected:()=>E()})),()=>e.removeConnectionHandler(n)),[e,n,E]),u.useEffect(()=>{E()},[E]),u.useEffect(()=>()=>{b.current=!1,d==null||d.dispose()},[d]),{initialized:r,error:a,channels:l,loadMore:C}}const{Provider:$s}=X("AIAgentConversationList");function Ms({conversationListLimit:e,conversationListFilter:t,children:n}){var b,E;const{chatSDK:r,aiAgentId:s,queryParams:a}=K(),i={aiAgentIds:[s],aiAgentConversationStatusFilter:[q.ConversationStatus.CLOSED,q.ConversationStatus.OPEN]},l=e??((b=a==null?void 0:a.conversationListParams)==null?void 0:b.limit),c={...i,...(E=a==null?void 0:a.conversationListParams)==null?void 0:E.filter,...t},d=Is(r,{limit:l,filter:c}),h={listSource:{initialized:d.initialized,error:d.error??void 0,channels:d.channels,loadMore:()=>d.loadMore()}};return o.createElement($s,{value:h},n)}function Ls(e){let t="pending",n=e.then(r=>{t="resolved",n=r}).catch(r=>{t="rejected",n=r});return{get value(){if(t==="resolved")return n;throw n}}}const{Provider:Os,useContext:mr}=X("MessageTemplateFetching");function Rs({children:e,internalVariables:t}){const n=u.useRef({}),r=u.useRef({}),[s,a]=u.useState({}),i=u.useCallback((d,h)=>{a(b=>({...b,[d]:{fetching:!1,error:!1,...b[d],...h}}))},[]),l=u.useCallback(async({onRequestTemplate:d,onGetCachedTemplate:h,templateKey:b,suspense:E=!1})=>{const C=h(b);if(C)return C;const y=r.current[b];if(y)return y;E||i(b,{fetching:!0});const x=d(b).catch(m=>{throw E||i(b,{error:!0}),m}).finally(()=>{E||i(b,{fetching:!1}),delete r.current[b]});return r.current[b]=x,x},[i]),c={internalVariables:t,fetchTemplate:l,suspend:(d,h)=>{if(n.current[d])return n.current[d];const b=Ls(h());return n.current[d]=b,b},getIsFetching:d=>{var h;return((h=s[d])==null?void 0:h.fetching)??!1},getHasError:d=>{var h;return((h=s[d])==null?void 0:h.error)??!1}};return o.createElement(Os,{value:c},e)}const pt={VARIABLE:e=>new RegExp(`\\{${e}\\}`,"g"),VIEW_VARIABLE:e=>new RegExp(`"{@${e}}"`,"g")};function Ae({uiTemplateString:e,variables:t={}}){const n=us(t);return Zt({template:e,variables:n,variableKeyPattern:r=>pt.VARIABLE(r)})}function we({theme:e,uiTemplateString:t,colorVariables:n={}}){return Zt({template:t,variables:n,variableKeyPattern:r=>pt.VARIABLE(r),variableValueTransformer:r=>cs(e,r)})}function Ds({theme:e,uiTemplateString:t,viewVariables:n={},aiAgentColorVariables:r,internalVariables:s,onRequestTemplate:a}){const l=Object.values(n).flat().map(d=>d.key);return[...new Set(l)].some(d=>!a(d))?null:Zt({template:t,variables:n,variableKeyPattern:d=>pt.VIEW_VARIABLE(d),variableValueTransformer:d=>{const h=d.map(({key:b,variables:E})=>{const C=a(b),{ui_template:y,color_variables:x}=Ke(C);let m=JSON.stringify(y);return m=Ae({uiTemplateString:m,variables:s}),m=we({theme:e,uiTemplateString:m,colorVariables:x}),m=we({theme:e,uiTemplateString:m,colorVariables:r}),m=Ae({uiTemplateString:m,variables:E}),ht(m)});return JSON.stringify(h)}})}async function Ns({theme:e,uiTemplateString:t,viewVariables:n={},aiAgentColorVariables:r,internalVariables:s,onRequestTemplate:a}){return ds({template:t,variables:n,variableKeyPattern:i=>pt.VIEW_VARIABLE(i),variableValueTransformer:async i=>{const l=i.map(async({key:d,variables:h})=>{const b=await a(d),{ui_template:E,color_variables:C}=Ke(b);let y=JSON.stringify(E);return y=Ae({uiTemplateString:y,variables:s}),y=we({theme:e,uiTemplateString:y,colorVariables:C}),y=we({theme:e,uiTemplateString:y,colorVariables:r}),y=Ae({uiTemplateString:y,variables:h}),ht(y)}),c=await Promise.all(l);return JSON.stringify(c)}})}const Ps=({rawTemplate:e,aiAgentColorVariables:t,internalVariables:n,...r})=>{const{ui_template:s,color_variables:a}=Ke(e);let i=JSON.stringify(s);if(Object.keys(r.viewVariables??{}).length>0){const c=Ds({...r,uiTemplateString:i,aiAgentColorVariables:t,internalVariables:n});if(c===null)return null;i=c}return i=Ae({...r,uiTemplateString:i,variables:n}),i=we({...r,uiTemplateString:i,colorVariables:a}),i=we({...r,uiTemplateString:i,colorVariables:t}),i=Ae({...r,uiTemplateString:i}),ht(i)},Bs=async({rawTemplate:e,aiAgentColorVariables:t,internalVariables:n,...r})=>{const{ui_template:s,color_variables:a}=Ke(e);let i=JSON.stringify(s);return Object.keys(r.viewVariables??{}).length>0&&(i=await Ns({...r,uiTemplateString:i,aiAgentColorVariables:t,internalVariables:n})),i=Ae({...r,uiTemplateString:i,variables:n}),i=we({...r,uiTemplateString:i,colorVariables:a}),i=we({...r,uiTemplateString:i,colorVariables:t}),i=Ae({...r,uiTemplateString:i}),ht(i)},Fs=e=>{const{aiAgentColorVariables:t={}}=e,{internalVariables:n}=mr();return u.useState(()=>{const r=e.onGetCachedTemplate(e.templateKey);return r?Ps({...e,rawTemplate:r,aiAgentColorVariables:t,internalVariables:n,onRequestTemplate:e.onGetCachedTemplate}):null})},Us=e=>{const[t]=Fs(e);if(t)return t;const{aiAgentColorVariables:n={}}=e,{internalVariables:r,fetchTemplate:s,suspend:a}=mr();return a(e.templateKey,async()=>{const l=await s({...e,suspense:!0});return await Bs({...e,rawTemplate:l,aiAgentColorVariables:n,internalVariables:r})}).value},Hs="remove_powered_by",Xt=(e,t)=>{var s,a;const{chatSDK:n}=K(),{aiAgentInfo:r}=ft();if(e==="handoff-button"){const i=!!((s=t==null?void 0:t.conversation)!=null&&s.handoff);return!!(t!=null&&t.isAIAgent)&&!!(r!=null&&r.showHandoffButton)&&i&&Wt(t)}if(e==="special-notice")return!!(t!=null&&t.isAIAgent)&&!!(r!=null&&r.specialNoticeEnabled)&&!!(r!=null&&r.specialNotice);if(e==="powered-by"){const i=(a=n==null?void 0:n.appInfo)==null?void 0:a.applicationAttributes;return u.useMemo(()=>!(Array.isArray(i)&&i.includes(Hs)),[i])}throw new Error("Unsupported feature")},zs={required:"This question is required",minLength:e=>`Minimum ${e} characters required`,maxLength:e=>`Maximum ${e} characters allowed`,min:e=>`Minimum value is ${e}`,max:e=>`Maximum value is ${e}`,minSelect:e=>`Select at least ${e} options`,maxSelect:e=>`Select at most ${e} options`,regex:"Invalid format",invalidSelection:"Invalid selection"},Vs={getValueOrDefault:e=>e.value??e.default_value??null,validate:(e,t,n)=>{const r=t;if(e.required&&(!r||r.trim()===""))return{isValid:!1,error:n.required};if(!r)return{isValid:!0};const{rules:s}=e;if(s){if(s.min_length!==void 0&&r.length<s.min_length)return{isValid:!1,error:typeof n.minLength=="function"?n.minLength(s.min_length):n.minLength};if(s.max_length!==void 0&&r.length>s.max_length)return{isValid:!1,error:typeof n.maxLength=="function"?n.maxLength(s.max_length):n.maxLength};if(s.regex&&!new RegExp(s.regex).test(r))return{isValid:!1,error:n.regex}}return{isValid:!0}}},Gs={getValueOrDefault:e=>e.value??e.default_value??null,validate:(e,t,n)=>{const r=t;if(e.required&&r===null)return{isValid:!1,error:n.required};if(r===null)return{isValid:!0};const{rules:s}=e;if(s){if(s.min!==void 0&&r<s.min)return{isValid:!1,error:typeof n.min=="function"?n.min(s.min):n.min};if(s.max!==void 0&&r>s.max)return{isValid:!1,error:typeof n.max=="function"?n.max(s.max):n.max}}return{isValid:!0}}},Ws={getValueOrDefault:e=>e.value??e.default_value??null,validate:(e,t,n)=>{const r=t;return e.required&&!r?{isValid:!1,error:n.required}:r&&!e.options.includes(r)?{isValid:!1,error:n.invalidSelection}:{isValid:!0}}},qs={getValueOrDefault:e=>e.values??e.default_values??null,validate:(e,t,n)=>{const r=t;if(e.required&&(!r||r.length===0))return{isValid:!1,error:n.required};if(!r||r.length===0)return{isValid:!0};if(r.filter(i=>!e.options.includes(i)).length>0)return{isValid:!1,error:n.invalidSelection};const{rules:a}=e;if(a){if(a.min_select!==void 0&&r.length<a.min_select)return{isValid:!1,error:typeof n.minSelect=="function"?n.minSelect(a.min_select):n.minSelect};if(a.max_select!==void 0&&r.length>a.max_select)return{isValid:!1,error:typeof n.maxSelect=="function"?n.maxSelect(a.max_select):n.maxSelect}}return{isValid:!0}}},js={text:Vs,number:Gs,"single-select":Ws,"multi-select":qs},Ks={getValueOrDefault:()=>null,validate:()=>({isValid:!1})};function gr(e){return js[e.type]||Ks}function Tn(e){return gr(e).getValueOrDefault(e)}function Ys(e,t,n={}){const r={...zs,...n};return gr(e).validate(e,t,r)}const Zs=(e,t={})=>{const{labels:n={},onSubmit:r,onCancel:s}=t,[a,i]=u.useState({}),[l,c]=u.useState(()=>{const x={};return e.fields.forEach(m=>{x[m.key]=Tn(m)}),x}),d=u.useMemo(()=>e.submitted_at?"submitted":e.canceled_at?"canceled":"draft",[e.submitted_at,e.canceled_at]);u.useEffect(()=>{if(d==="submitted"||d==="canceled"){const x={};let m=!1;e.fields.forEach(p=>{const v=Tn(p);JSON.stringify(l[p.key])!==JSON.stringify(v)&&(m=!0),x[p.key]=v}),m&&c(x)}},[d]);const h=(x,m)=>{c(p=>({...p,[x]:m})),i(p=>({...p,[x]:void 0}))},b=e.fields.map(x=>{var v,_,I;const m=l[x.key]??null,p={key:x.key,label:x.label,error:a[x.key],required:x.required};return x.type==="text"?{...p,type:"text",layout:x.layout,value:m,...x.placeholder&&{placeholder:x.placeholder},...((v=x.rules)==null?void 0:v.max_length)&&{maxLength:x.rules.max_length}}:x.type==="number"?{...p,type:"number",layout:x.layout,value:m,...x.placeholder&&{placeholder:x.placeholder},...((_=x.rules)==null?void 0:_.max)&&{max:x.rules.max}}:x.type==="single-select"?{...p,type:"single-select",layout:x.layout,value:m,options:x.options}:x.type==="multi-select"?{...p,type:"multi-select",layout:x.layout,value:m,options:x.options,...((I=x.rules)==null?void 0:I.max_select)&&{maxSelect:x.rules.max_select}}:{...p,type:"unknown",layout:"default",value:null}});return{state:d,fields:b,getField:x=>b.find(m=>m.key===x),updateFieldValue:h,submit:async()=>{const x={};let m=!1;for(const p of e.fields){const v=l[p.key]??null,_=Ys(p,v,n);_.isValid||(x[p.key]=_.error,m=!0)}if(i(x),!m&&r){const p={};e.fields.forEach(v=>{p[v.key]=l[v.key]??null}),await r(p)}},cancel:async()=>{await(s==null?void 0:s())}}},hr=({channel:e,userSession:t,aiAgentInfo:n})=>{if(!t||!n||!e)return{fallbackIcon:"delight",url:void 0,title:""};const r=(()=>{const[a]=e.members.filter(i=>i.userId!==t.userId);return a})(),s={ai(a){return{fallbackIcon:a,url:n.profileUrl,title:n.nickname}},human(a){return{fallbackIcon:a,url:r==null?void 0:r.profileUrl,title:(r==null?void 0:r.nickname)||n.nickname}},channel(a){return{fallbackIcon:a,url:e==null?void 0:e.coverUrl,title:(e==null?void 0:e.name)??""}}};return e.isAIAgent?Be(e)?s.human("agent"):s.ai("delight"):e.isDesk?s.human("agent"):s.channel("user")},An=e=>u.useReducer((t,n)=>({...t,...n}),e);var le=(e=>(e.AI_AGENT_CSAT_5="AI_AGENT_CSAT_5",e.AI_AGENT_CSAT_5_WITH_CRE="AI_AGENT_CSAT_5_WITH_CRE",e.HELPDESK_CSAT_5="HELPDESK_CSAT_5",e))(le||{});const Xs=new Set(["free_text","single_choice"]),Js=({csatPayload:e,type:t,initialCsat:n,initialCsatReason:r,initialIsResolved:s})=>{const[a,i]=An({csatType:t,csat:n,csatReason:r,isResolved:s}),[l,c]=An({followUpItem:!1}),d=u.useMemo(()=>{var m;const C=a.csat,y=typeof C=="number",x=(m=e.follow_up)==null?void 0:m.find(p=>y?p.scores.includes(C):p.always_visible??!1);if(Xs.has(x==null?void 0:x.response_type))return x},[a.csat,e.follow_up]),h=(()=>{var C;if(typeof n=="number")return"submitted";if((t===le.AI_AGENT_CSAT_5||t===le.HELPDESK_CSAT_5)&&typeof a.csat=="number")return"submittable";if(t===le.AI_AGENT_CSAT_5_WITH_CRE){const y=typeof a.csat=="number",x=!((C=e.cre)!=null&&C.required)||typeof a.isResolved=="boolean";if(y&&x)return"submittable"}return"unsubmittable"})(),b=u.useCallback(()=>typeof a.csat>"u"?!1:d!=null&&d.required&&!a.csatReason?(c({followUpItem:!0}),!1):!0,[a,d,c]);return u.useEffect(()=>{r||(i({csatReason:""}),c({followUpItem:!1}))},[r,d,i,c]),{params:a,setParams:i,error:l,setError:c,followUpItem:d,state:h,validateParams:b,itemProps:{csatPayload:e,state:h,submitted:h==="submitted"}}},wt=5,Qs=250,ea=50,wn=e=>Math.max(0,e-ea),ta=e=>e<1e3?{speed:wt*.5,chunkSize:2}:e<2e3?{speed:wt*.8,chunkSize:2}:{speed:wt*.6,chunkSize:3},na=e=>{const{text:t,enabled:n=!1,onAnimationStart:r,onAnimationProgress:s,onAnimationComplete:a}=e,[i,l]=u.useState(()=>wn(t.length)),c=u.useRef(null),d=u.useRef({startTime:0,lastUpdate:0,lastProgressCall:0}).current,h=u.useRef({onStart:r,onProgress:s,onComplete:a}).current,b=u.useRef({startCalled:!1,completeCalled:!1}).current,E=u.useRef({initialEnabled:n,textLength:t.length,enabled:n}).current,C=n,y=i<t.length,x=E.initialEnabled&&(C||y);return u.useLayoutEffect(()=>{h.onStart=r,h.onProgress=s,h.onComplete=a,E.textLength=t.length,E.enabled=n}),u.useLayoutEffect(()=>{var m;E.initialEnabled&&(b.startCalled||(b.startCalled=!0,(m=h.onStart)==null||m.call(h)),l(p=>t.length<p?t.length:p))},[t]),u.useEffect(()=>{if(!E.initialEnabled)return;let m=wn(t.length);d.lastUpdate=0,d.startTime=0,d.lastProgressCall=0;const p=v=>{var z;d.lastUpdate===0&&(d.lastUpdate=v,d.startTime=v,d.lastProgressCall=v);const _=E.textLength,I=v-d.lastUpdate,T=v-d.startTime,{speed:L,chunkSize:$}=ta(T),M=L*$;I>=M&&m<_&&(m=Math.min(m+$,_),l(m),d.lastUpdate=v),v-d.lastProgressCall>=Qs&&(d.lastProgressCall=v,(z=h.onProgress)==null||z.call(h)),(m<_||E.enabled)&&(c.current=requestAnimationFrame(p))};return c.current=requestAnimationFrame(p),()=>{c.current&&cancelAnimationFrame(c.current)}},[]),u.useEffect(()=>{var _;const m=E.initialEnabled&&b.startCalled,p=!n,v=i>=t.length&&t.length>0;m&&p&&v&&!b.completeCalled&&(b.completeCalled=!0,(_=h.onComplete)==null||_.call(h))},[n,i,t.length]),{streamText:E.initialEnabled?t.slice(0,i):t,isAnimating:x}},ra='@import"https://fonts.googleapis.com/css?family=Roboto:400,500,600,700&display=swap";.sb-message-template__border{position:relative}.sb-message-template__border:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;box-shadow:inset 0 0 0 var(--border-width) var(--border-color);border-radius:var(--border-radius);pointer-events:none}.sb-message-template__action{cursor:pointer}.sb-message-template__parent{font-family:Roboto,serif}.sb-message-template__text{font-family:inherit;font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;letter-spacing:normal;text-align:left}.sb-message-template__text-button{font-family:inherit;background-color:#e0e0e0;text-align:center;padding:10px;border-radius:6px;font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;letter-spacing:normal}.sendbird-theme--light .sb-message-template__text-button{color:#742ddd}.sendbird-theme--dark .sb-message-template__text-button{color:#c2a9fa}.sb-message-template__text-button:hover{opacity:1;box-shadow:#0000001a 0 1px 3px,#0000000f 0 1px 2px}.sb-message-template__text-button,.sb-message-template__image-button{cursor:pointer;border-style:none}.sb-message-template__parent{border-radius:unset;background-color:transparent;overflow:hidden}.sb-message-template__parent *{box-sizing:border-box;line-height:1.3}.sb-message-template__carousel{display:flex;width:100%;box-sizing:border-box;touch-action:pan-y}',oa={conversation:{input_placeholder:"Ask a question",input_placeholder_disabled:"Chat is unavailable in this channel",input_placeholder_wait_ai_agent_response:"Waiting for the agent's reply...",input_placeholder_active_form:"Please fill out the form to move forward.",input_placeholder_reconnecting:"Trying to reconnect. Refresh if persists.",unknown_message_type:"(Unknown message type)",powered_by:"Powered by",citation_title:"Source",start_new_conversation_label:"Start a conversation",scroll_to_new_messages_label:()=>"New message",failed_message_resend:"Retry",failed_message_remove:"Remove",file_upload_no_supported_files:"No supported file types available.",a11y_message_list:"Chat messages",a11y_scroll_to_bottom:"Scroll to bottom",a11y_scroll_to_new_messages:"Scroll to new messages",a11y_open_conversation_list:"Open conversation list"},conversation_list:{header_title:"Conversations",ended:"Ended",footer_title:"Start a conversation"},date_format:{just_now:"Just now",minutes_ago:e=>`${e} minutes ago`,hours_ago:e=>`${e} hours ago`,date_short:"MM/dd/yyyy",date_separator:"MMMM dd, yyyy",message_timestamp:"p"},csat:{title:"Your feedback matters to us",submitted_label:"Successfully submitted!",cre_question:"Was your issue resolved?",cre_positive_label:"Yes, thank you! 👍",cre_negative_label:"No, that didn't help.",reason_placeholder:"Share your feedback",question:"How would you rate your experience?",submit_label:"Submit",submission_expired:"We're sorry, the survey period has ended."},form:{optional_label:"optional",validation_required:"This question is required"},common:{placeholder_something_went_wrong:"Something went wrong",placeholder_no_messages:"No messages",placeholder_no_conversations:"No conversations yet",placeholder_something_went_wrong_retry_label:"Retry"},feedback:{title:"Submit feedback",good:"Good",bad:"Bad",comment_label:"Comment (optional)",comment_placeholder:"Leave a comment",cancel:"Cancel",submit:"Submit",save:"Save",edit:"Edit feedback",remove:"Remove feedback"}},Bt={language:"en",strings:oa,dateLocale:ao.enUS},fr=e=>({MESSAGE_INPUT__PLACE_HOLDER:e.conversation.input_placeholder,MESSAGE_INPUT__PLACE_HOLDER__DISABLED:e.conversation.input_placeholder_disabled,MESSAGE_INPUT__PLACE_HOLDER__WAIT_AI_AGENT_RESPONSE:e.conversation.input_placeholder_wait_ai_agent_response,MESSAGE_INPUT__PLACE_HOLDER__RECONNECTING:e.conversation.input_placeholder_reconnecting,UNKNOWN__UNKNOWN_MESSAGE_TYPE:e.conversation.unknown_message_type,POWERED_BY:e.conversation.powered_by,CSAT_TITLE_UNSUBMITTED:e.csat.title,CSAT_TITLE_SUBMITTED:e.csat.submitted_label,CSAT_CRE_TITLE:e.csat.cre_question,CSAT_CRE_SOLVED:e.csat.cre_positive_label,CSAT_CRE_NOT_SOLVED:e.csat.cre_negative_label,CSAT_REASON_PLACEHOLDER:e.csat.reason_placeholder,CSAT_RATING_TITLE:e.csat.question,CSAT_SUBMIT_LABEL:e.csat.submit_label,CSAT_SUBMISSION_EXPIRED:e.csat.submission_expired,DATE_FORMAT__JUST_NOW:e.date_format.just_now,DATE_FORMAT__MINUTES_AGO:e.date_format.minutes_ago,DATE_FORMAT__HOURS_AGO:e.date_format.hours_ago,DATE_FORMAT__DATE_SHORT:e.date_format.date_short,DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR:e.date_format.date_separator,DATE_FORMAT__MESSAGE_TIMESTAMP:e.date_format.message_timestamp,CONVERSATION_LIST__HEADER_TITLE:e.conversation_list.header_title,CONVERSATION_LIST__ENDED:e.conversation_list.ended,CONVERSATION_LIST__NO_CONVERSATIONS:e.common.placeholder_no_conversations,TALK_TO_AGENT:e.conversation.start_new_conversation_label,CITATION_SOURCE_TITLE:e.conversation.citation_title,FORM_PLACEHOLDER:e.conversation.input_placeholder_active_form,FORM_VALIDATION_REQUIRED:e.form.validation_required,OPTIONAL:e.form.optional_label,PLACE_HOLDER__WRONG:e.common.placeholder_something_went_wrong,PLACE_HOLDER__NO_MESSAGES:e.common.placeholder_no_messages,RETRY:e.common.placeholder_something_went_wrong_retry_label,FAILED_MESSAGE_RESEND:e.conversation.failed_message_resend,FAILED_MESSAGE_REMOVE:e.conversation.failed_message_remove,FILE_UPLOAD_NO_SUPPORTED_FILES:e.conversation.file_upload_no_supported_files,FEEDBACK_TITLE:e.feedback.title,FEEDBACK_GOOD:e.feedback.good,FEEDBACK_BAD:e.feedback.bad,FEEDBACK_COMMENT_LABEL:e.feedback.comment_label,FEEDBACK_COMMENT_PLACEHOLDER:e.feedback.comment_placeholder,FEEDBACK_CANCEL:e.feedback.cancel,FEEDBACK_SUBMIT:e.feedback.submit,FEEDBACK_SAVE:e.feedback.save,FEEDBACK_EDIT:e.feedback.edit,FEEDBACK_REMOVE:e.feedback.remove,A11Y_MESSAGE_LIST:e.conversation.a11y_message_list,A11Y_SCROLL_TO_BOTTOM:e.conversation.a11y_scroll_to_bottom,A11Y_SCROLL_TO_NEW_MESSAGES:e.conversation.a11y_scroll_to_new_messages,A11Y_OPEN_CONVERSATION_LIST:e.conversation.a11y_open_conversation_list,SCROLL_TO_NEW_MESSAGES_LABEL:e.conversation.scroll_to_new_messages_label}),sa=e=>{var t;return((t=e.split("-"))==null?void 0:t[0])??bt},bt="en",aa=new Set([bt,"ko","es","pt","fr","hi","it","de","tr","ja"]),ia=(e,t,n)=>{const r=e[t];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((s,a)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(a.bind(null,new Error("Unknown variable dynamic import: "+t+(t.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})},kn=fr(Bt.strings),la={...kn,HEADER_BUTTON__AGENT_HANDOFF:"Connect with an agent",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Select an option to continue",BUTTON__CANCEL:"Cancel",BUTTON__SUBMIT:"Submit",SUBMITTED:"Submitted",TRY_AGAIN:"Please try again.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"You can't upload more than one image",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"The maximum size per file is %d MB.",FILE_VIEWER__UNSUPPORT:"Unsupported message",CSAT5_RATING_SCORE_1:"Terrible",CSAT5_RATING_SCORE_2:"Bad",CSAT5_RATING_SCORE_3:"Okay",CSAT5_RATING_SCORE_4:"Good",CSAT5_RATING_SCORE_5:"Great",FORM_UNAVAILABLE:"Form is no longer available.",FORM_NOT_SUPPORTED:"This form is not supported in the current version.",FORM_VALIDATION_MIN_LENGTH:e=>`Minimum ${e} characters required`,FORM_VALIDATION_MAX_LENGTH:e=>`Maximum ${e} characters allowed`,FORM_VALIDATION_MIN:e=>`Minimum value is ${e}`,FORM_VALIDATION_MAX:e=>`Maximum value is ${e}`,FORM_VALIDATION_MIN_SELECT:e=>`Select at least ${e} options`,FORM_VALIDATION_MAX_SELECT:e=>`Select at most ${e} options`,FORM_VALIDATION_REGEX_FAILED:"Invalid format",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:kn.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"h:mma",CONVERSATION_LIST__TOPICS_FALLBACK:"No category",CONVERSATION_CLOSED_FOOTER_LABEL:"Your conversation has ended",START_NEW_CONVERSATION:"💬 Start a new conversation",RETURN_TO_CONVERSATION:"💬 Return to conversation",BUTTON__SAVE:"Save",BUTTON__OK:"OK",NO_NAME:"(No name)",CHANNEL_FROZEN:"Channel frozen"},ct={language:Bt.language,dateLocale:Bt.dateLocale,stringSet:la},ca=Object.freeze(Object.defineProperty({__proto__:null,default:ct},Symbol.toStringTag,{value:"Module"})),Ft=new Map([[bt,ct]]);async function ua(e){const t=Ft.get(e);if(t)return t;try{if(aa.has(e)){const{default:n}=await ia(Object.assign({"./languages/de.ts":()=>Promise.resolve().then(()=>require("./D8WAgf2q.cjs")),"./languages/en.ts":()=>Promise.resolve().then(()=>ca),"./languages/es.ts":()=>Promise.resolve().then(()=>require("./CflBRC31.cjs")),"./languages/fr.ts":()=>Promise.resolve().then(()=>require("./BQZpik7b.cjs")),"./languages/hi.ts":()=>Promise.resolve().then(()=>require("./DTBJZVXN.cjs")),"./languages/it.ts":()=>Promise.resolve().then(()=>require("./C_NT_8QQ.cjs")),"./languages/ja.ts":()=>Promise.resolve().then(()=>require("./DbAfG9g2.cjs")),"./languages/ko.ts":()=>Promise.resolve().then(()=>require("./ChSKTLIk.cjs")),"./languages/pt.ts":()=>Promise.resolve().then(()=>require("./BHMTi5u8.cjs")),"./languages/tr.ts":()=>Promise.resolve().then(()=>require("./DWT-4cxP.cjs"))}),`./languages/${e}.ts`,3);return Ft.set(e,n),n}return ct}catch{return ct}}const{Provider:da,useContext:F}=X("Localization"),ma=({language:e=navigator.language,logger:t,stringSet:n,children:r})=>{const[s,a]=u.useState(Ft.get(bt));return u.useEffect(()=>{const i=sa(e);s.language!==i&&(t==null||t.debug("localization.useEffect: update language",{from:s.language,to:i}),ua(i).then(a))},[e,t]),o.createElement(da,{value:{language:s.language,stringSet:{...s.stringSet,...n},dateLocale:s.dateLocale,format:(i,l,c)=>ye.format(i,l,{locale:s.dateLocale,...c})}},r)},ut="data-sb-agent-theme",In=e=>(t,...n)=>{let r="";return t.forEach((s,a)=>{r+=s+(n[a]??"")}),`[${ut}='${e}'] & { ${r} }`},D={light:In("light"),dark:In("dark")},ga=S.css(({theme:e})=>{const{palette:t}=e;return`
2
2
  :root,
3
3
  :host {
4
4
  --sendbird-primary-extra-dark: ${t.primary.extraDark};
@@ -49,13 +49,13 @@
49
49
  }
50
50
  `}),ha=S.css`[${ut}='light'] &{--sb-text-high-emphasis:var(--sendbird-onlight-text-high-emphasis);--sb-text-mid-emphasis:var(--sendbird-onlight-text-mid-emphasis);--sb-text-low-emphasis:var(--sendbird-onlight-text-low-emphasis);--sb-text-disabled:var(--sendbird-onlight-text-disabled);--sb-text-high-emphasis-inverse:var(--sendbird-ondark-text-high-emphasis);--sb-text-mid-emphasis-inverse:var(--sendbird-ondark-text-mid-emphasis);--sb-text-low-emphasis-inverse:var(--sendbird-ondark-text-low-emphasis);--sb-text-disabled-inverse:var(--sendbird-ondark-text-disabled);--sb-bg-50-600:var(--sendbird-background-50);--sb-bg-100-500:var(--sendbird-background-100);--sb-bg-200-400:var(--sendbird-background-200);--sb-primary:var(--sendbird-primary-main);--sb-secondary:var(--sendbird-secondary-main);--sb-error:var(--sendbird-error-main);--sb-information:var(--sendbird-information-light);}[${ut}='dark'] &{--sb-text-high-emphasis:var(--sendbird-ondark-text-high-emphasis);--sb-text-mid-emphasis:var(--sendbird-ondark-text-mid-emphasis);--sb-text-low-emphasis:var(--sendbird-ondark-text-low-emphasis);--sb-text-disabled:var(--sendbird-ondark-text-disabled);--sb-text-high-emphasis-inverse:var(--sendbird-onlight-text-high-emphasis);--sb-text-mid-emphasis-inverse:var(--sendbird-onlight-text-mid-emphasis);--sb-text-low-emphasis-inverse:var(--sendbird-onlight-text-low-emphasis);--sb-text-disabled-inverse:var(--sendbird-onlight-text-disabled);--sb-bg-50-600:var(--sendbird-background-600);--sb-bg-100-500:var(--sendbird-background-500);--sb-bg-200-400:var(--sendbird-background-400);--sb-primary:var(--sendbird-primary-light);--sb-secondary:var(--sendbird-secondary-light);--sb-error:var(--sendbird-error-light);--sb-information:var(--sendbird-information-light);}`,g={color:{primary:{dark:"var(--sendbird-primary-dark)",main:"var(--sendbird-primary-main)"},information:{main:"var(--sendbird-information-main)",light:"var(--sendbird-information-light)"},background700:"var(--sendbird-background-700)",background600:"var(--sendbird-background-600)",background500:"var(--sendbird-background-500)",background400:"var(--sendbird-background-400)",background200:"var(--sendbird-background-200)",background100:"var(--sendbird-background-100)",background50:"var(--sendbird-background-50)",onlight:{textLowEmphasis:"var(--sendbird-onlight-text-low-emphasis)"},ondark:{textMidEmphasis:"var(--sendbird-ondark-text-mid-emphasis)",textLowEmphasis:"var(--sendbird-ondark-text-low-emphasis)",textDisabled:"var(--sendbird-ondark-text-disabled)"},overlay:{dark:"var(--sendbird-overlay-dark)"}},themedColor:{textHighEmphasis:"var(--sb-text-high-emphasis)",textMidEmphasis:"var(--sb-text-mid-emphasis)",textLowEmphasis:"var(--sb-text-low-emphasis)",textDisabled:"var(--sb-text-disabled)",textHighEmphasisInverse:"var(--sb-text-high-emphasis-inverse)",textLowEmphasisInverse:"var(--sb-text-low-emphasis-inverse)",bg_50_600:"var(--sb-bg-50-600)",bg_100_500:"var(--sb-bg-100-500)",bg_200_400:"var(--sb-bg-200-400)",primary:"var(--sb-primary)",error:"var(--sb-error)",secondary:"var(--sb-secondary)"}},{Provider:fa,useContext:pr}=X("MessengerTheme");function pa(e){const{theme:t,appearance:n,logger:r}=e;return o.createElement(Qo,{appearance:n,palette:t==null?void 0:t.palette,typography:t==null?void 0:t.typography,logger:r},o.createElement(ba,{...e}))}function ba({rootElement:e=document.body,children:t}){const{theme:n,updateTheme:r}=Yt();return u.useLayoutEffect(()=>{e.setAttribute(ut,n.selectedTheme)},[e,n.selectedTheme]),o.createElement(S.ThemeProvider,{theme:n},o.createElement(fa,{value:{theme:n,updateTheme:r,rootElement:e}},t))}function Me(e,t){const n=e.getRootNode({composed:t});return n instanceof ShadowRoot||n instanceof Document?n:document}const Ea=(e,t)=>{u.useEffect(()=>{const n=Me(t)instanceof ShadowRoot,r=Me(t,!0);if(!(n?t:r).querySelector(`link[href*='${e}']`)){const a=r.createElement("link");a.rel="stylesheet",a.href=e,(n?t:r.head).appendChild(a)}},[e,t])},xa=(e,t=document.body)=>{u.useEffect(()=>{const n=Me(t),s=n instanceof ShadowRoot?t:n.head;if(!s)return;const a=`sba-${btoa(e).slice(0,10)}`;let i=s.querySelector(`style#${a}`);i?i.textContent!==e&&(i.textContent=e):(i=s.ownerDocument.createElement("style"),i.id=a,i.textContent=e,s.appendChild(i))},[e,t])},{Provider:va,Consumer:br,useContext:W}=X("Messenger");function Ca({children:e,state:t,enableCloseConversationButton:n=!1,enableExpandButton:r=!0,enableAutoDisconnectInLauncher:s=!0,...a}){const[i,l]=u.useState(!1),[c,d]=u.useState(!1),h={opened:(t==null?void 0:t.opened)??i,setOpened:(t==null?void 0:t.setOpened)??l,expanded:(t==null?void 0:t.expanded)??c,setExpanded:(t==null?void 0:t.setExpanded)??d};return o.createElement(Po,{...a},b=>o.createElement(va,{value:{...a,...b,state:h,enableCloseConversationButton:n,enableExpandButton:r,enableAutoDisconnectInLauncher:s}},e))}const ce=e=>{const t=e;return typeof t=="number"?`${t}px`:t},k=({as:e,variant:t="body1",color:n,maxTextLines:r,className:s,...a})=>o.createElement(Sa,{as:e,$variant:t,className:s,$color:n,$maxTextLines:r,...a}),$n=new WeakMap,ya=(e,t)=>{let n=$n.get(t);n||(n=new Map,$n.set(t,n));const r=n.get(e);if(r)return r;const s=t[e]??t.body1,a=S.css`font-size:${ce(s.fontSize)};font-weight:${s.fontWeight};${s.fontFamily?`font-family: ${s.fontFamily};`:""}
51
51
  ${s.lineHeight?`line-height: ${s.lineHeight};`:"line-height: 100%;"}
52
- `;return n.set(e,a),a},_a=e=>e?S.css`display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:${e};overflow:hidden;`:"",Sa=f.default.span`font-stretch:normal;letter-spacing:normal;${({$variant:e,theme:t})=>ya(e,t.typography)}color:${({$color:e})=>e};${({$maxTextLines:e})=>_a(e)}`;class dt extends u.PureComponent{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){const{fallback:t=null,errorFallback:n=t,loadingFallback:r=t,children:s}=this.props;return this.state.hasError?n:o.createElement(u.Suspense,{fallback:r},s)}}const Ta=e=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",...e},o.createElement("path",{className:"fill",d:"M52.552 11.448a2.666 2.666 0 0 1 .222 3.52l-.222.251-16.781 16.78 16.781 16.782a2.665 2.665 0 0 1 0 3.771 2.666 2.666 0 0 1-3.52.222l-.251-.222L32 35.771 15.219 52.552a2.665 2.665 0 0 1-3.771 0 2.666 2.666 0 0 1-.222-3.52l.222-.251L28.228 32l-16.78-16.781a2.665 2.665 0 0 1 0-3.771 2.666 2.666 0 0 1 3.52-.222l.251.222 16.78 16.78 16.782-16.78a2.665 2.665 0 0 1 3.771 0z",fill:"#000",fillRule:"evenodd"})),Aa=e=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",...e},o.createElement("path",{className:"fill",d:"M7.33348 7.3335L2.00015 7.3335L2.00015 6.00016H5.05735L1.3335 2.27631L2.27631 1.3335L6.00015 5.05734V2.00016L7.33348 2.00016L7.33348 7.3335ZM8.66683 8.66683H14.0002V10.0002L10.943 10.0002L14.6668 13.724L13.724 14.6668L10.0002 10.943V14.0002H8.66683L8.66683 8.66683Z",fill:"#000",fillRule:"evenodd"})),wa=e=>o.createElement("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",...e},o.createElement("path",{className:"fill",fillRule:"evenodd",clipRule:"evenodd",d:"M2 2H7.33333V3.33333L4.27613 3.33333L7.99999 7.05719L7.05718 8L3.33333 4.27616L3.33333 7.33333H2V2ZM14 14H8.66667V12.6667H11.7239L8.00001 8.94281L8.94282 8L12.6667 11.7238V8.66667H14V14Z",fill:"#000"})),ka=e=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",fill:"evenodd",...e},o.createElement("path",{className:"fill",fill:"#0D0D0D",d:"M50.667 18.667H13.333v-5.334h37.334zM50.667 34.667H13.333v-5.334h37.334zM13.333 50.667h37.334v-5.334H13.333z"})),Ia=e=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",...e},o.createElement("path",{fill:"#000",fillRule:"evenodd",d:"M59.795 29.43 7.329 2.979C4.691 1.802 1.76 4.153 2.932 6.798l6.925 18.609a2 2 0 0 0 1.544 1.275l32.273 5.394L11.4 37.47a1.998 1.998 0 0 0-1.544 1.275L2.932 57.353c-.879 2.645 1.76 4.997 4.397 3.527l52.466-26.453c2.051-.882 2.051-3.82 0-4.996z",className:"fill"})),$a=new Set(["send","chat","message","chevron-right","good","good-filled","bad","bad-filled"]),Ma={close:Ta,send:Ia,menu:ka,expand:wa,collapse:Aa,spinner:u.lazy(()=>Promise.resolve().then(()=>require("./Cf3-irI8.cjs"))),chat:u.lazy(()=>Promise.resolve().then(()=>require("./BmdfYY9c.cjs"))),message:u.lazy(()=>Promise.resolve().then(()=>require("./CmWLVNPR.cjs"))),error:u.lazy(()=>Promise.resolve().then(()=>require("./DNmdC4-j.cjs"))),info:u.lazy(()=>Promise.resolve().then(()=>require("./ohTjxqcW.cjs"))),refresh:u.lazy(()=>Promise.resolve().then(()=>require("./D00MOxhE.cjs"))),"chevron-down":u.lazy(()=>Promise.resolve().then(()=>require("./wf-LdaaN.cjs"))),"chevron-right":u.lazy(()=>Promise.resolve().then(()=>require("./B0k-GApQ.cjs"))),done:u.lazy(()=>Promise.resolve().then(()=>require("./kp5wcW4s.cjs"))),user:u.lazy(()=>Promise.resolve().then(()=>require("./CtHfgPDp.cjs"))),"file-document":u.lazy(()=>Promise.resolve().then(()=>require("./_YfLwFkX.cjs"))),download:u.lazy(()=>Promise.resolve().then(()=>require("./BN09c8-A.cjs"))),attach:u.lazy(()=>Promise.resolve().then(()=>require("./DcDTXo8_.cjs"))),delete:u.lazy(()=>Promise.resolve().then(()=>require("./CKPzhVy2.cjs"))),"close-filled":u.lazy(()=>Promise.resolve().then(()=>require("./D1kINslt.cjs"))),agent:u.lazy(()=>Promise.resolve().then(()=>require("./Ce1MzjFq.cjs"))),question:u.lazy(()=>Promise.resolve().then(()=>require("./JA0x62Fd.cjs"))),actionbook:u.lazy(()=>Promise.resolve().then(()=>require("./CXa-CGHE.cjs"))),function:u.lazy(()=>Promise.resolve().then(()=>require("./zbLY6xl_.cjs"))),"radio-on":u.lazy(()=>Promise.resolve().then(()=>require("./B9NJk4MI.cjs"))),"radio-off":u.lazy(()=>Promise.resolve().then(()=>require("./Bb0r6Nhu.cjs"))),confluence:u.lazy(()=>Promise.resolve().then(()=>require("./c6TZaE94.cjs"))),zendesk:u.lazy(()=>Promise.resolve().then(()=>require("./DqpDy_26.cjs"))),salesforce:u.lazy(()=>Promise.resolve().then(()=>require("./BsgzT_SF.cjs"))),sprinklr:u.lazy(()=>Promise.resolve().then(()=>require("./D97ZpKUC.cjs"))),website:u.lazy(()=>Promise.resolve().then(()=>require("./ygZY2D-5.cjs"))),snippet:u.lazy(()=>Promise.resolve().then(()=>require("./BCFOnu0u.cjs"))),template:u.lazy(()=>Promise.resolve().then(()=>require("./eJXfXI1_.cjs"))),source:u.lazy(()=>Promise.resolve().then(()=>require("./yVmX6iux.cjs"))),bot:u.lazy(()=>Promise.resolve().then(()=>require("./PhHbzZB_.cjs"))),"bot-filled":u.lazy(()=>Promise.resolve().then(()=>require("./DlvMdI1f.cjs"))),copy:u.lazy(()=>Promise.resolve().then(()=>require("./COgkkyBM.cjs"))),show:u.lazy(()=>Promise.resolve().then(()=>require("./DM-WWpci.cjs"))),mute:u.lazy(()=>Promise.resolve().then(()=>require("./P_ra76fq.cjs"))),good:u.lazy(()=>Promise.resolve().then(()=>require("./DEgUVAck.cjs"))),bad:u.lazy(()=>Promise.resolve().then(()=>require("./C0s7eAf7.cjs"))),"good-filled":u.lazy(()=>Promise.resolve().then(()=>require("./Chg8xHXT.cjs"))),"bad-filled":u.lazy(()=>Promise.resolve().then(()=>require("./CGkmTaBn.cjs"))),delight:u.lazy(()=>Promise.resolve().then(()=>require("./DCB0iTxd.cjs")))},P=({type:e,size:t=24,className:n,color:r})=>{const s=Ma[e];return o.createElement(Oa,{className:n,$rtlFlip:$a.has(e),$size:t,$color:r??g.color.primary.main},o.createElement(dt,{errorFallback:o.createElement(Ra,null)},o.createElement(s,null)))},La=S.css`[dir='rtl'] &{transform:scaleX(-1);}`,Oa=f.default.div`width:${({$size:e})=>ce(e)};height:${({$size:e})=>ce(e)};display:inline-block;&:focus{outline:none;}svg{display:block;}[class*='fill']{fill:${({$color:e})=>e};}[class*='stroke']{stroke:${({$color:e})=>e};stroke-width:2px;stroke-linejoin:round;}${({$rtlFlip:e})=>e&&La};`,Ra=()=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64"},o.createElement("rect",{x:"8",y:"8",width:"48",height:"48",fill:"none",className:"stroke",rx:"4"}),o.createElement("line",{x1:"20",y1:"20",x2:"44",y2:"44",className:"stroke"}),o.createElement("line",{x1:"44",y1:"20",x2:"20",y2:"44",className:"stroke"}));function Jt({name:e,type:t="FILE",iconColor:n,iconBackgroundColor:r,onClick:s}){const{colors:a}=S.useTheme();return o.createElement(Da,{onClick:s,$clickable:!!s},o.createElement(Pa,{$bgColor:r??a.base.primary},o.createElement(P,{type:"file-document",size:24,color:n??a.base.primaryContrastContent})),o.createElement(Ba,null,o.createElement(Fa,{variant:"button",color:g.themedColor.textHighEmphasis},e),o.createElement(k,{color:g.themedColor.textMidEmphasis,variant:"caption3"},t)))}const Da=f.default.div`border-radius:12px;gap:8px;width:${B.BODY_MAX_WIDTH}px;height:64px;display:flex;align-items:center;padding:12px;box-sizing:border-box;border:1px solid ${g.themedColor.textDisabled};background-color:${g.themedColor.bg_50_600};${({$clickable:e})=>e&&Na}`,Na=S.css`cursor:pointer;&:hover{background-color:${g.themedColor.bg_100_500};}`,Pa=f.default.div`border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background-color:${({$bgColor:e})=>e};`,Ba=f.default.div`display:flex;flex:1;flex-direction:column;gap:4px;min-width:0;`,Fa=f.default(k)`text-overflow:ellipsis;white-space:nowrap;overflow:hidden;`;function Ua({file:e,children:t,onClickFile:n}){return o.createElement(Ha,null,o.createElement(Jt,{name:e.name,type:qt(e.name,e.type),onClick:n&&(()=>n==null?void 0:n(e))}),t)}const Ha=f.default.div`display:flex;flex-direction:column;align-items:flex-start;gap:${B.GAP_GROUPED}px;`,za="1.13.1",oe="sb-agent",se={ENTRY:`${oe}-entry`,MODAL_ROOT:`${oe}-modal-root`,WINDOW:`${oe}-window`,LAUNCHER:`${oe}-launcher`},tt=2147483647,Oe={MODAL:tt-1,TOOLTIP:tt-2,WINDOW:tt-3,LAUNCHER:tt-4},Er=36,Va=100,Ga=za,Qt="noopener noreferrer nofollow",be=`${oe}-incoming-msg`,Wa=`${oe}-marked-text`;function qa({file:e,onClickMedia:t,children:n}){const r=()=>e.type.startsWith("image")?o.createElement(Ya,{src:e.url,alt:"image-message"}):e.type.startsWith("video")?o.createElement(Za,{controls:!0},o.createElement("source",{src:e.url}),o.createElement("track",{kind:"captions"})):null;if(r){const s={id:`${be}-media-body`,onClick:()=>t==null?void 0:t(e)};return o.createElement(ja,null,o.createElement(Ka,{...s},r()),n)}return null}const ja=f.default.div`display:flex;flex-direction:column;align-items:flex-start;gap:${B.GAP_GROUPED}px;`,Ka=f.default.div`width:${B.BODY_MAX_WIDTH}px;height:160px;border-radius:12px;overflow:hidden;cursor:pointer;${D.light`
52
+ `;return n.set(e,a),a},_a=e=>e?S.css`display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:${e};overflow:hidden;`:"",Sa=f.default.span`font-stretch:normal;letter-spacing:normal;${({$variant:e,theme:t})=>ya(e,t.typography)}color:${({$color:e})=>e};${({$maxTextLines:e})=>_a(e)}`;class dt extends u.PureComponent{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){const{fallback:t=null,errorFallback:n=t,loadingFallback:r=t,children:s}=this.props;return this.state.hasError?n:o.createElement(u.Suspense,{fallback:r},s)}}const Ta=e=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",...e},o.createElement("path",{className:"fill",d:"M52.552 11.448a2.666 2.666 0 0 1 .222 3.52l-.222.251-16.781 16.78 16.781 16.782a2.665 2.665 0 0 1 0 3.771 2.666 2.666 0 0 1-3.52.222l-.251-.222L32 35.771 15.219 52.552a2.665 2.665 0 0 1-3.771 0 2.666 2.666 0 0 1-.222-3.52l.222-.251L28.228 32l-16.78-16.781a2.665 2.665 0 0 1 0-3.771 2.666 2.666 0 0 1 3.52-.222l.251.222 16.78 16.78 16.782-16.78a2.665 2.665 0 0 1 3.771 0z",fill:"#000",fillRule:"evenodd"})),Aa=e=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",...e},o.createElement("path",{className:"fill",d:"M7.33348 7.3335L2.00015 7.3335L2.00015 6.00016H5.05735L1.3335 2.27631L2.27631 1.3335L6.00015 5.05734V2.00016L7.33348 2.00016L7.33348 7.3335ZM8.66683 8.66683H14.0002V10.0002L10.943 10.0002L14.6668 13.724L13.724 14.6668L10.0002 10.943V14.0002H8.66683L8.66683 8.66683Z",fill:"#000",fillRule:"evenodd"})),wa=e=>o.createElement("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",...e},o.createElement("path",{className:"fill",fillRule:"evenodd",clipRule:"evenodd",d:"M2 2H7.33333V3.33333L4.27613 3.33333L7.99999 7.05719L7.05718 8L3.33333 4.27616L3.33333 7.33333H2V2ZM14 14H8.66667V12.6667H11.7239L8.00001 8.94281L8.94282 8L12.6667 11.7238V8.66667H14V14Z",fill:"#000"})),ka=e=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",fill:"evenodd",...e},o.createElement("path",{className:"fill",fill:"#0D0D0D",d:"M50.667 18.667H13.333v-5.334h37.334zM50.667 34.667H13.333v-5.334h37.334zM13.333 50.667h37.334v-5.334H13.333z"})),Ia=e=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",...e},o.createElement("path",{fill:"#000",fillRule:"evenodd",d:"M59.795 29.43 7.329 2.979C4.691 1.802 1.76 4.153 2.932 6.798l6.925 18.609a2 2 0 0 0 1.544 1.275l32.273 5.394L11.4 37.47a1.998 1.998 0 0 0-1.544 1.275L2.932 57.353c-.879 2.645 1.76 4.997 4.397 3.527l52.466-26.453c2.051-.882 2.051-3.82 0-4.996z",className:"fill"})),$a=new Set(["send","chat","message","chevron-right","good","good-filled","bad","bad-filled"]),Ma={close:Ta,send:Ia,menu:ka,expand:wa,collapse:Aa,spinner:u.lazy(()=>Promise.resolve().then(()=>require("./Cf3-irI8.cjs"))),chat:u.lazy(()=>Promise.resolve().then(()=>require("./BmdfYY9c.cjs"))),message:u.lazy(()=>Promise.resolve().then(()=>require("./CmWLVNPR.cjs"))),error:u.lazy(()=>Promise.resolve().then(()=>require("./DNmdC4-j.cjs"))),info:u.lazy(()=>Promise.resolve().then(()=>require("./ohTjxqcW.cjs"))),refresh:u.lazy(()=>Promise.resolve().then(()=>require("./D00MOxhE.cjs"))),"chevron-down":u.lazy(()=>Promise.resolve().then(()=>require("./wf-LdaaN.cjs"))),"chevron-right":u.lazy(()=>Promise.resolve().then(()=>require("./B0k-GApQ.cjs"))),done:u.lazy(()=>Promise.resolve().then(()=>require("./kp5wcW4s.cjs"))),user:u.lazy(()=>Promise.resolve().then(()=>require("./CtHfgPDp.cjs"))),"file-document":u.lazy(()=>Promise.resolve().then(()=>require("./_YfLwFkX.cjs"))),download:u.lazy(()=>Promise.resolve().then(()=>require("./BN09c8-A.cjs"))),attach:u.lazy(()=>Promise.resolve().then(()=>require("./DcDTXo8_.cjs"))),delete:u.lazy(()=>Promise.resolve().then(()=>require("./CKPzhVy2.cjs"))),"close-filled":u.lazy(()=>Promise.resolve().then(()=>require("./D1kINslt.cjs"))),agent:u.lazy(()=>Promise.resolve().then(()=>require("./Ce1MzjFq.cjs"))),question:u.lazy(()=>Promise.resolve().then(()=>require("./JA0x62Fd.cjs"))),actionbook:u.lazy(()=>Promise.resolve().then(()=>require("./CXa-CGHE.cjs"))),function:u.lazy(()=>Promise.resolve().then(()=>require("./zbLY6xl_.cjs"))),"radio-on":u.lazy(()=>Promise.resolve().then(()=>require("./B9NJk4MI.cjs"))),"radio-off":u.lazy(()=>Promise.resolve().then(()=>require("./Bb0r6Nhu.cjs"))),confluence:u.lazy(()=>Promise.resolve().then(()=>require("./c6TZaE94.cjs"))),zendesk:u.lazy(()=>Promise.resolve().then(()=>require("./DqpDy_26.cjs"))),salesforce:u.lazy(()=>Promise.resolve().then(()=>require("./BsgzT_SF.cjs"))),sprinklr:u.lazy(()=>Promise.resolve().then(()=>require("./D97ZpKUC.cjs"))),website:u.lazy(()=>Promise.resolve().then(()=>require("./ygZY2D-5.cjs"))),snippet:u.lazy(()=>Promise.resolve().then(()=>require("./BCFOnu0u.cjs"))),template:u.lazy(()=>Promise.resolve().then(()=>require("./eJXfXI1_.cjs"))),source:u.lazy(()=>Promise.resolve().then(()=>require("./yVmX6iux.cjs"))),bot:u.lazy(()=>Promise.resolve().then(()=>require("./PhHbzZB_.cjs"))),"bot-filled":u.lazy(()=>Promise.resolve().then(()=>require("./DlvMdI1f.cjs"))),copy:u.lazy(()=>Promise.resolve().then(()=>require("./COgkkyBM.cjs"))),show:u.lazy(()=>Promise.resolve().then(()=>require("./DM-WWpci.cjs"))),mute:u.lazy(()=>Promise.resolve().then(()=>require("./P_ra76fq.cjs"))),good:u.lazy(()=>Promise.resolve().then(()=>require("./DEgUVAck.cjs"))),bad:u.lazy(()=>Promise.resolve().then(()=>require("./C0s7eAf7.cjs"))),"good-filled":u.lazy(()=>Promise.resolve().then(()=>require("./Chg8xHXT.cjs"))),"bad-filled":u.lazy(()=>Promise.resolve().then(()=>require("./CGkmTaBn.cjs"))),delight:u.lazy(()=>Promise.resolve().then(()=>require("./DCB0iTxd.cjs")))},P=({type:e,size:t=24,className:n,color:r})=>{const s=Ma[e];return o.createElement(Oa,{className:n,$rtlFlip:$a.has(e),$size:t,$color:r??g.color.primary.main},o.createElement(dt,{errorFallback:o.createElement(Ra,null)},o.createElement(s,null)))},La=S.css`[dir='rtl'] &{transform:scaleX(-1);}`,Oa=f.default.div`width:${({$size:e})=>ce(e)};height:${({$size:e})=>ce(e)};display:inline-block;&:focus{outline:none;}svg{display:block;}[class*='fill']{fill:${({$color:e})=>e};}[class*='stroke']{stroke:${({$color:e})=>e};stroke-width:2px;stroke-linejoin:round;}${({$rtlFlip:e})=>e&&La};`,Ra=()=>o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64"},o.createElement("rect",{x:"8",y:"8",width:"48",height:"48",fill:"none",className:"stroke",rx:"4"}),o.createElement("line",{x1:"20",y1:"20",x2:"44",y2:"44",className:"stroke"}),o.createElement("line",{x1:"44",y1:"20",x2:"20",y2:"44",className:"stroke"}));function Jt({name:e,type:t="FILE",iconColor:n,iconBackgroundColor:r,onClick:s}){const{colors:a}=S.useTheme();return o.createElement(Da,{onClick:s,$clickable:!!s},o.createElement(Pa,{$bgColor:r??a.base.primary},o.createElement(P,{type:"file-document",size:24,color:n??a.base.primaryContrastContent})),o.createElement(Ba,null,o.createElement(Fa,{variant:"button",color:g.themedColor.textHighEmphasis},e),o.createElement(k,{color:g.themedColor.textMidEmphasis,variant:"caption3"},t)))}const Da=f.default.div`border-radius:12px;gap:8px;width:${B.BODY_MAX_WIDTH}px;height:64px;display:flex;align-items:center;padding:12px;box-sizing:border-box;border:1px solid ${g.themedColor.textDisabled};background-color:${g.themedColor.bg_50_600};${({$clickable:e})=>e&&Na}`,Na=S.css`cursor:pointer;&:hover{background-color:${g.themedColor.bg_100_500};}`,Pa=f.default.div`border-radius:8px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;background-color:${({$bgColor:e})=>e};`,Ba=f.default.div`display:flex;flex:1;flex-direction:column;gap:4px;min-width:0;`,Fa=f.default(k)`text-overflow:ellipsis;white-space:nowrap;overflow:hidden;`;function Ua({file:e,children:t,onClickFile:n}){return o.createElement(Ha,null,o.createElement(Jt,{name:e.name,type:qt(e.name,e.type),onClick:n&&(()=>n==null?void 0:n(e))}),t)}const Ha=f.default.div`display:flex;flex-direction:column;align-items:flex-start;gap:${B.GAP_GROUPED}px;`,za="1.13.2",oe="sb-agent",se={ENTRY:`${oe}-entry`,MODAL_ROOT:`${oe}-modal-root`,WINDOW:`${oe}-window`,LAUNCHER:`${oe}-launcher`},tt=2147483647,Oe={MODAL:tt-1,TOOLTIP:tt-2,WINDOW:tt-3,LAUNCHER:tt-4},Er=36,Va=100,Ga=za,Qt="noopener noreferrer nofollow",be=`${oe}-incoming-msg`,Wa=`${oe}-marked-text`;function qa({file:e,onClickMedia:t,children:n}){const r=()=>e.type.startsWith("image")?o.createElement(Ya,{src:e.url,alt:"image-message"}):e.type.startsWith("video")?o.createElement(Za,{controls:!0},o.createElement("source",{src:e.url}),o.createElement("track",{kind:"captions"})):null;if(r){const s={id:`${be}-media-body`,onClick:()=>t==null?void 0:t(e)};return o.createElement(ja,null,o.createElement(Ka,{...s},r()),n)}return null}const ja=f.default.div`display:flex;flex-direction:column;align-items:flex-start;gap:${B.GAP_GROUPED}px;`,Ka=f.default.div`width:${B.BODY_MAX_WIDTH}px;height:160px;border-radius:12px;overflow:hidden;cursor:pointer;${D.light`
53
53
  background-color: ${g.color.background100};
54
54
  `}
55
55
  ${D.dark`
56
56
  background-color: ${g.color.background400};
57
57
  `}
58
- `,Ya=f.default.img`width:100%;height:100%;object-fit:cover;`,Za=f.default.video`width:100%;height:100%;object-fit:cover;`,Xa="✱",xr=e=>{const t=new RegExp(`(\`+)([^\`]+?)\\1|(${Xa}+)`,"g");return e.replace(t,(n,r,s,a)=>r?n:a?`<span id=${Wa} aria-label="masked-text">${a}</span>`:n)},Ja=e=>e.replace(/\*\*(.*?)\*\*/g,"<b>$1</b>"),Qa=u.lazy(async()=>({default:(await Promise.resolve().then(()=>require("./CgKaFsNM.cjs"))).MarkdownText})),ei=u.lazy(async()=>({default:(await Promise.resolve().then(()=>require("./DlvEEpWX.cjs"))).CodeBlock}));function Mn(e){var s,a;const t=e.maxBodyWidth??B.BODY_MAX_WIDTH,n=u.useMemo(()=>To(e.message,xr),[e.message]),r={id:`${be}-text-body`,$maxWidth:t,$color:(s=e.customStyle)==null?void 0:s.bubbleContentColor,$bgColor:(a=e.customStyle)==null?void 0:a.bubbleBackgroundColor};return n.length===0?e.children?o.createElement(Ln,{...r},e.children):null:o.createElement(Ln,{...r},n.map((i,l)=>i.type==="text"?o.createElement(On,{key:l,variant:"body3"},o.createElement(dt,{fallback:i.value},o.createElement(Qa,{onClickImage:c=>{var d;return(d=e.onClickMedia)==null?void 0:d.call(e,{url:c,type:"image/*"})}},i.value))):i.type==="code"?o.createElement(dt,{key:l,fallback:o.createElement(On,{variant:"body3"},i.value)},o.createElement(ei,{code:i.value,language:i.language})):null),e.children)}const Ln=f.default.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({$maxWidth:e})=>e}px;${({theme:e,$color:t,$bgColor:n})=>S.css`
58
+ `,Ya=f.default.img`width:100%;height:100%;object-fit:cover;`,Za=f.default.video`width:100%;height:100%;object-fit:cover;`,Xa="✱",xr=e=>{const t=new RegExp(`(\`+)([^\`]+?)\\1|(${Xa}+)`,"g");return e.replace(t,(n,r,s,a)=>r?n:a?`<span id=${Wa} aria-label="masked-text">${a}</span>`:n)},Ja=e=>e.replace(/\*\*(.*?)\*\*/g,"<b>$1</b>"),Qa=u.lazy(async()=>({default:(await Promise.resolve().then(()=>require("./-IxhxYLl.cjs"))).MarkdownText})),ei=u.lazy(async()=>({default:(await Promise.resolve().then(()=>require("./DlvEEpWX.cjs"))).CodeBlock}));function Mn(e){var s,a;const t=e.maxBodyWidth??B.BODY_MAX_WIDTH,n=u.useMemo(()=>To(e.message,xr),[e.message]),r={id:`${be}-text-body`,$maxWidth:t,$color:(s=e.customStyle)==null?void 0:s.bubbleContentColor,$bgColor:(a=e.customStyle)==null?void 0:a.bubbleBackgroundColor};return n.length===0?e.children?o.createElement(Ln,{...r},e.children):null:o.createElement(Ln,{...r},n.map((i,l)=>i.type==="text"?o.createElement(On,{key:l,variant:"body3"},o.createElement(dt,{fallback:i.value},o.createElement(Qa,{onClickImage:c=>{var d;return(d=e.onClickMedia)==null?void 0:d.call(e,{url:c,type:"image/*"})}},i.value))):i.type==="code"?o.createElement(dt,{key:l,fallback:o.createElement(On,{variant:"body3"},i.value)},o.createElement(ei,{code:i.value,language:i.language})):null),e.children)}const Ln=f.default.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({$maxWidth:e})=>e}px;${({theme:e,$color:t,$bgColor:n})=>S.css`
59
59
  color: ${t||e.colors.messageIncoming.text};
60
60
  background-color: ${n||e.colors.messageIncoming.background};
61
61
  `}
@@ -279,7 +279,7 @@
279
279
  color: ${g.color.information.main};
280
280
  `};
281
281
  }
282
- `,Zd=u.lazy(()=>Promise.resolve().then(()=>require("./CgKaFsNM.cjs")).then(e=>({default:e.MarkdownText}))),Xd=()=>{const{aiAgentInfo:e,userSession:t}=J(),{messageSource:n,channelSource:r}=Q(),[s,a]=u.useState(null),i=Xt("special-notice",r.channel),l=u.useCallback(()=>r.channel?i?n.messages.some(c=>je(c,(t==null?void 0:t.userId)??"")):!0:null,[r.channel,i,n.messages,t==null?void 0:t.userId]);return u.useEffect(()=>{s||a(l())},[l,s]),s||!e.specialNotice?null:o.createElement(Yd,null,o.createElement(Zd,null,e.specialNotice))},Jd=()=>o.createElement(Qd,null,o.createElement(Xd,null),o.createElement(Fd,null,o.createElement(Kd,null))),Qd=f.default.div`z-index:0;border:none;width:100%;`,em=()=>{var s;const{testerType:e}=He(),{channelSource:t}=Q(),n=Te(t.channel),r=!!e&&((s=t.channel)==null?void 0:s.isAIAgent);return n&&r?o.createElement(Pd,null):o.createElement(Jd,null)},Br=({children:e,onNavigateToConversationList:t,channelUrl:n,onClearChannelUrl:r,shouldMarkAsRead:s,closedChannelUrl:a,onClearClosedChannelUrl:i})=>{const{Template:l}=yt.useContext();return o.createElement(Lr,{onNavigateToConversationList:t,channelUrl:n??a,onClearChannelUrl:r??i,shouldMarkAsRead:s},o.createElement(zt,null,o.createElement(zt.Consumer,null,c=>o.createElement(o.Fragment,null,o.createElement(nm,{...c},o.createElement(l,null)),e))))},yt=pe({template:tm,components:{Header:Gu,Body:Nd,Footer:em}});function tm(){const{components:e}=yt.useContext();return o.createElement(o.Fragment,null,o.createElement(e.Header,null),o.createElement(e.Body,null),o.createElement(e.Footer,null))}const nm=f.default.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({theme:e})=>e.colors.base.background};`,{Provider:rm,Context:om,useContext:dn}=X("ConversationList");function Fr({conversationListLimit:e,conversationListFilter:t,onOpenConversationView:n=fe,children:r}){return o.createElement(Ms,{conversationListLimit:e,conversationListFilter:t},s=>o.createElement(rm,{value:{...s,onOpenConversationView:n}},r))}const sm=({channel:e})=>o.createElement(Or,{channel:e}),mn=pe({template:am,components:{}}),Gt=99;function am(e){const{channel:t,onClick:n}=e,{stringSet:r,format:s}=F(),a=vo(t),i=Co(t,s,{justNow:r.DATE_FORMAT__JUST_NOW,minutesAgo:r.DATE_FORMAT__MINUTES_AGO,hoursAgo:r.DATE_FORMAT__HOURS_AGO,dateShortFormat:r.DATE_FORMAT__DATE_SHORT}),l=t.unreadMessageCount;return o.createElement(im,{role:"button",onClick:()=>n==null?void 0:n()},o.createElement(lm,null,o.createElement(sm,{...e})),o.createElement(cm,null,o.createElement(um,null,o.createElement(k,{variant:"subtitle1",color:g.themedColor.textHighEmphasis,maxTextLines:1},a),o.createElement(dm,null,Te(t)&&o.createElement(o.Fragment,null,o.createElement(k,{variant:"caption1",color:g.themedColor.textMidEmphasis,maxTextLines:1},r.CONVERSATION_LIST__ENDED),o.createElement(mm,null)),o.createElement(k,{variant:"caption2",color:g.themedColor.textLowEmphasis,maxTextLines:1},i))),l>0&&o.createElement(gm,{$count:l},o.createElement(k,{variant:"caption3",color:g.themedColor.textHighEmphasisInverse},l<=Gt?l:`${Gt}+`))))}const im=f.default.div`display:flex;flex-shrink:0;flex-direction:row;align-items:center;position:relative;width:100%;height:72px;box-sizing:border-box;gap:16px;cursor:pointer;`,lm=f.default.div`display:flex;align-items:center;justify-content:center;padding-inline-start:16px;`,cm=f.default.div`display:flex;flex-direction:row;align-items:center;flex:1;padding-inline-end:16px;height:100%;gap:8px;border-bottom:1px solid ${g.themedColor.textDisabled};`,um=f.default.div`display:flex;flex-direction:column;justify-content:center;flex:1;gap:4px;word-break:break-word;overflow-wrap:break-word;`,dm=f.default.div`display:flex;align-items:center;gap:6px;`,mm=f.default.div`width:2px;height:2px;border-radius:1px;background-color:${g.themedColor.textLowEmphasis};`,gm=f.default.div`display:flex;align-items:center;justify-content:center;height:20px;padding:4px;border-radius:10px;background-color:${g.themedColor.error};${({$count:e})=>e<=Gt&&S.css`
282
+ `,Zd=u.lazy(()=>Promise.resolve().then(()=>require("./-IxhxYLl.cjs")).then(e=>({default:e.MarkdownText}))),Xd=()=>{const{aiAgentInfo:e,userSession:t}=J(),{messageSource:n,channelSource:r}=Q(),[s,a]=u.useState(null),i=Xt("special-notice",r.channel),l=u.useCallback(()=>r.channel?i?n.messages.some(c=>je(c,(t==null?void 0:t.userId)??"")):!0:null,[r.channel,i,n.messages,t==null?void 0:t.userId]);return u.useEffect(()=>{s||a(l())},[l,s]),s||!e.specialNotice?null:o.createElement(Yd,null,o.createElement(Zd,null,e.specialNotice))},Jd=()=>o.createElement(Qd,null,o.createElement(Xd,null),o.createElement(Fd,null,o.createElement(Kd,null))),Qd=f.default.div`z-index:0;border:none;width:100%;`,em=()=>{var s;const{testerType:e}=He(),{channelSource:t}=Q(),n=Te(t.channel),r=!!e&&((s=t.channel)==null?void 0:s.isAIAgent);return n&&r?o.createElement(Pd,null):o.createElement(Jd,null)},Br=({children:e,onNavigateToConversationList:t,channelUrl:n,onClearChannelUrl:r,shouldMarkAsRead:s,closedChannelUrl:a,onClearClosedChannelUrl:i})=>{const{Template:l}=yt.useContext();return o.createElement(Lr,{onNavigateToConversationList:t,channelUrl:n??a,onClearChannelUrl:r??i,shouldMarkAsRead:s},o.createElement(zt,null,o.createElement(zt.Consumer,null,c=>o.createElement(o.Fragment,null,o.createElement(nm,{...c},o.createElement(l,null)),e))))},yt=pe({template:tm,components:{Header:Gu,Body:Nd,Footer:em}});function tm(){const{components:e}=yt.useContext();return o.createElement(o.Fragment,null,o.createElement(e.Header,null),o.createElement(e.Body,null),o.createElement(e.Footer,null))}const nm=f.default.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({theme:e})=>e.colors.base.background};`,{Provider:rm,Context:om,useContext:dn}=X("ConversationList");function Fr({conversationListLimit:e,conversationListFilter:t,onOpenConversationView:n=fe,children:r}){return o.createElement(Ms,{conversationListLimit:e,conversationListFilter:t},s=>o.createElement(rm,{value:{...s,onOpenConversationView:n}},r))}const sm=({channel:e})=>o.createElement(Or,{channel:e}),mn=pe({template:am,components:{}}),Gt=99;function am(e){const{channel:t,onClick:n}=e,{stringSet:r,format:s}=F(),a=vo(t),i=Co(t,s,{justNow:r.DATE_FORMAT__JUST_NOW,minutesAgo:r.DATE_FORMAT__MINUTES_AGO,hoursAgo:r.DATE_FORMAT__HOURS_AGO,dateShortFormat:r.DATE_FORMAT__DATE_SHORT}),l=t.unreadMessageCount;return o.createElement(im,{role:"button",onClick:()=>n==null?void 0:n()},o.createElement(lm,null,o.createElement(sm,{...e})),o.createElement(cm,null,o.createElement(um,null,o.createElement(k,{variant:"subtitle1",color:g.themedColor.textHighEmphasis,maxTextLines:1},a),o.createElement(dm,null,Te(t)&&o.createElement(o.Fragment,null,o.createElement(k,{variant:"caption1",color:g.themedColor.textMidEmphasis,maxTextLines:1},r.CONVERSATION_LIST__ENDED),o.createElement(mm,null)),o.createElement(k,{variant:"caption2",color:g.themedColor.textLowEmphasis,maxTextLines:1},i))),l>0&&o.createElement(gm,{$count:l},o.createElement(k,{variant:"caption3",color:g.themedColor.textHighEmphasisInverse},l<=Gt?l:`${Gt}+`))))}const im=f.default.div`display:flex;flex-shrink:0;flex-direction:row;align-items:center;position:relative;width:100%;height:72px;box-sizing:border-box;gap:16px;cursor:pointer;`,lm=f.default.div`display:flex;align-items:center;justify-content:center;padding-inline-start:16px;`,cm=f.default.div`display:flex;flex-direction:row;align-items:center;flex:1;padding-inline-end:16px;height:100%;gap:8px;border-bottom:1px solid ${g.themedColor.textDisabled};`,um=f.default.div`display:flex;flex-direction:column;justify-content:center;flex:1;gap:4px;word-break:break-word;overflow-wrap:break-word;`,dm=f.default.div`display:flex;align-items:center;gap:6px;`,mm=f.default.div`width:2px;height:2px;border-radius:1px;background-color:${g.themedColor.textLowEmphasis};`,gm=f.default.div`display:flex;align-items:center;justify-content:center;height:20px;padding:4px;border-radius:10px;background-color:${g.themedColor.error};${({$count:e})=>e<=Gt&&S.css`
283
283
  width: 20px;
284
284
  `}
285
285
  `,hm=({items:e,renderItem:t,onEndReached:n})=>{const r=s=>{const a=s.target;a.scrollHeight-a.scrollTop===a.clientHeight&&(n==null||n())};return o.createElement(fm,{onScroll:s=>r(s)},e.map((s,a)=>t(s,a)))},fm=f.default.div`width:100%;height:100%;display:flex;flex-direction:column;flex:1;overflow:auto;overscroll-behavior:contain;`,pm=()=>{const{stringSet:e}=F(),{listSource:t,onOpenConversationView:n}=dn(),{Template:r}=mn.useContext();return t.initialized?t.channels.length===0?o.createElement(Fe,{type:"noChannels",label:e.CONVERSATION_LIST__NO_CONVERSATIONS}):o.createElement(hm,{items:t.channels,renderItem:s=>{var a,i,l;return o.createElement(r,{key:s.url,channel:s,onClick:()=>n(s.url,Te(s)?"closed":"open"),channelUrl:s.url,title:(i=(a=s.conversation)==null?void 0:a.topics)==null?void 0:i.join(", "),lastMessageTimestamp:(l=s.lastMessage)==null?void 0:l.createdAt})},onEndReached:()=>{t.loadMore()}}):o.createElement(Fe,{type:"loading"})},bm=()=>{const{stringSet:e}=F(),{language:t,countryCode:n,context:r}=W(),{aiAgentInfo:s,refreshActiveChannel:a,createConversation:i,setActiveChannel:l}=J(),{onOpenConversationView:c}=dn();return o.createElement(Em,{role:"button",onClick:async()=>{if(s.isMultipleActiveConversationsEnabled){const d=await i({aiAgentId:s.userId,language:t,country:n,context:r});l({url:d,status:q.ConversationStatus.OPEN}),c(d,q.ConversationStatus.OPEN)}else{const d=await a();c(d,q.ConversationStatus.OPEN)}}},o.createElement(xm,{variant:"h1"},e.TALK_TO_AGENT))},Em=f.default.div`background-color:${({theme:e})=>e.colors.base.primary};display:flex;align-items:center;justify-content:center;padding:16px;cursor:pointer;`,xm=f.default(k)`color:${({theme:e})=>e.colors.base.primaryContrastContent};overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`,vm=()=>{const{state:e}=W(),t=ze(),n=()=>{e.setOpened(!1)};return o.createElement(ke,{"aria-label":"close messenger",type:"close",size:t,onClick:n})},Cm=()=>{const{stringSet:e}=F();return o.createElement(ym,{variant:"h2",color:g.themedColor.textHighEmphasis},e.CONVERSATION_LIST__HEADER_TITLE)},ym=f.default(k)`padding:0 4px;width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;`,_m=e=>{const{components:t}=Ve.useContext();return o.createElement(sn,{start:o.createElement(t.StartArea,null),title:o.createElement(t.TitleArea,null),titleAlign:e.titleAlign,end:o.createElement(t.EndArea,null)})},Sm=()=>null,Tm=()=>{const{components:e}=Ve.useContext();return o.createElement(e.Title,null)},Am=()=>{const{components:e}=Ve.useContext();return o.createElement(e.CloseButton,null)},Ve=pe({template:_m,components:{StartArea:Sm,TitleArea:Tm,EndArea:Am,Title:Cm,CloseButton:vm}}),wm=()=>{const{Template:e}=Ve.useContext();return o.createElement(e,{titleAlign:"start"})},Ur=({conversationListLimit:e,conversationListFilter:t,children:n,onOpenConversationView:r})=>{const{Template:s}=_t.useContext();return o.createElement(Fr,{conversationListLimit:e,conversationListFilter:t,onOpenConversationView:r},o.createElement(Im,null,o.createElement(s,null)),n)},_t=pe({template:km,components:{Header:wm,Body:pm,Footer:bm}});function km(){const{components:e}=_t.useContext();return o.createElement(o.Fragment,null,o.createElement(e.Header,null),o.createElement(e.Body,null),o.createElement(e.Footer,null))}const Im=f.default.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({theme:e})=>e.colors.base.background};`,$m=S.css`:where(#${se.ENTRY}) :not(code *){font-family:'Roboto',sans-serif;box-sizing:border-box;}`,Mm=[$m,ga,ha],Lm=(e,...t)=>S.createGlobalStyle(e,...Mm,...t),Om=Lm``,Rm=po(yt,Le,xt,vt,_t,Re,mn,Ve,Ct);function Hr({appearance:e,rootElement:t,logger:n,language:r,stringSet:s,children:a,messageTemplate:i,theme:l}){return xa(ra,t),o.createElement(S.StyleSheetManager,{target:t},o.createElement(pa,{rootElement:t,logger:n,appearance:e,theme:l},o.createElement(Rs,{internalVariables:i==null?void 0:i.__internalVariables},o.createElement(ma,{stringSet:s,logger:n,language:r},o.createElement(Rm,null,a,o.createElement(Om,null))))))}const Dm={isOnline:()=>typeof window>"u"?!0:navigator.onLine,subscribe:e=>{if(typeof window>"u")return fe;const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t),window.addEventListener("offline",n),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}},ot={},st={getItem:e=>{try{return localStorage.getItem(e)}catch{return ot[e]??null}},setItem:(e,t)=>{try{localStorage.setItem(e,t)}catch{ot[e]=t}},deleteItem:e=>{try{localStorage.removeItem(e)}catch{delete ot[e]}},getKeys:e=>{try{const t=[];for(let n=0;n<localStorage.length;n++){const r=localStorage.key(n);r&&r.startsWith(e)&&t.push(r)}return t}catch{return Object.keys(ot).filter(t=>t.startsWith(e))}}},gn=u.forwardRef(function({rootElement:t=document.body,logLevel:n=Z.LogLevel.WARN,language:r=navigator.language,userSessionInfo:s,children:a,chatParams:i,...l},c){var d,h;return We.level!==n&&(We.level=n),Ea("https://fonts.googleapis.com/css2?family=Roboto&display=swap",t),o.createElement("div",{id:se.ENTRY,style:{width:"fit-content",height:"fit-content",...l.entryStyle}},o.createElement(Hr,{logger:We,rootElement:t,appearance:(d=l.agentPreviewConfigs)==null?void 0:d.appearance,stringSet:l.stringSet,language:r,messageTemplate:l.messageTemplate,theme:l.theme},o.createElement(Ca,{rootElement:t,keyValueStorage:{get:st.getItem,set:st.setItem,delete:st.deleteItem,getKeys:st.getKeys},networkStateAdapter:Dm,language:r,logger:We,dispatcher:zr,chatParams:{...i,customApiHost:l.customApiHost,customWebSocketHost:l.customWebSocketHost},chatSDK:l.customChatSDK,messengerVersion:Ga,...l},o.createElement(mu,{ref:c,userSessionInfo:s,forceCreateChannel:(h=l.agentPreviewConfigs)==null?void 0:h.forceCreateChannel},o.createElement(jc,{...l._UNSAFE_INTERNAL_dashboardTester},a,o.createElement("div",{id:se.MODAL_ROOT,dir:l.dir}))))))}),We=new or(Z.LogLevel.WARN),zr=new rr(We),{Provider:Nm,useContext:hn}=X("PageChildren"),Vr=({children:e})=>{const[t,n]=u.useState(null),[r,s]=u.useState(null);return o.createElement(Nm,{value:{conversationChildren:t,setConversationChildren:n,conversationListChildren:r,setConversationListChildren:s}},e)},Gr=({children:e,isOpened:t})=>{const{dir:n,rootElement:r}=W(),s=Me(r,!0);return u.useEffect(()=>{const a="sb-agent-block-scroll";return t?s.body.classList.add(a):s.body.classList.remove(a),()=>{s.body.classList.remove(a)}},[s,t]),o.createElement(Pm,{dir:n,$visible:t},e)},Pm=f.default.div`width:100%;height:100%;position:fixed;top:0;left:0;z-index:${Oe.WINDOW};visibility:${({$visible:e})=>e?"visible":"hidden"};`,Bm=48,Fm=2/3;function Wr({className:e,isOpened:t,onClick:n,type:r,imageUrl:s,dir:a,animated:i=!0,backgroundColor:l,size:c=Bm}){const d=Dt(l),h=Math.round(c*Fm);return o.createElement(zm,{dir:a,id:se.LAUNCHER,className:e,"aria-label":"Sendbird AIAgent Launcher",onClick:n,$animated:i,$backgroundColor:l,$size:c},o.createElement(Vm,{$isOpened:t,$animated:i,$fillColor:d,$iconSize:h},o.createElement(Xn.Open,{url:s,isDefaultIcon:r==="default_icon",size:h})),o.createElement(Gm,{$isOpened:t,$animated:i,$fillColor:d,$iconSize:h},o.createElement(Xn.Close,{size:h})))}const Um=S.css`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transform:scale(1.1);}&:active{transform:scale(0.8);}`,Hm=S.css`img{width:100%;height:100%;object-fit:cover;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-drag:none;&[data-default-icon='true']{width:${({$iconSize:e})=>e}px;height:${({$iconSize:e})=>e}px;filter:${({$fillColor:e})=>e===qe.WHITE?"grayscale(100%) brightness(2000%)":"grayscale(100%) invert(100%) saturate(0%) brightness(0%) contrast(1000%)"};}}`,qr=S.css`svg{width:${({$iconSize:e})=>e}px;height:${({$iconSize:e})=>e}px;${({$fillColor:e})=>S.css`
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./DwrHbIrU.cjs"),r=require("date-fns/locale/de"),a={conversation:{input_placeholder:"Eine Frage stellen",input_placeholder_disabled:"Chat ist in diesem Kanal nicht verfügbar",input_placeholder_wait_ai_agent_response:"Warten auf die Antwort des Agenten...",input_placeholder_active_form:"Bitte fülle das Formular aus, um fortzufahren.",input_placeholder_reconnecting:"Neu verbinden. Aktualisieren falls anhaltend.",unknown_message_type:"(Unbekannter Nachrichtentyp)",powered_by:"Unterstützt von",citation_title:"Quelle",start_new_conversation_label:"Ein Gespräch starten",scroll_to_new_messages_label:()=>"Neue Nachricht",failed_message_resend:"Erneut versuchen",failed_message_remove:"Entfernen",file_upload_no_supported_files:"Keine unterstützten Dateitypen verfügbar.",a11y_message_list:"Chat-Nachrichten",a11y_scroll_to_bottom:"Nach unten scrollen",a11y_scroll_to_new_messages:"Zu neuen Nachrichten scrollen",a11y_open_conversation_list:"Konversationsliste öffnen"},conversation_list:{header_title:"Gespräche",ended:"Beendet",footer_title:"Ein Gespräch starten"},date_format:{just_now:"Gerade eben",minutes_ago:e=>`Vor ${e} Minuten`,hours_ago:e=>`Vor ${e} Stunden`,date_short:"dd.MM.yyyy",date_separator:"d. MMMM yyyy",message_timestamp:"p"},csat:{title:"Ihr Feedback ist uns wichtig",submitted_label:"Erfolgreich gesendet!",cre_question:"Wurde Ihr Problem gelöst?",cre_positive_label:"Ja, danke! 👍",cre_negative_label:"Nein, das hat nicht geholfen.",reason_placeholder:"Dein Feedback teilen",question:"Wie würden Sie Ihre Erfahrung bewerten?",submit_label:"Absenden",submission_expired:"Die Umfrage ist leider nicht mehr verfügbar."},form:{optional_label:"optional",validation_required:"Diese Frage ist erforderlich"},common:{placeholder_something_went_wrong:"Etwas ist schiefgelaufen",placeholder_no_messages:"Keine Nachrichten",placeholder_no_conversations:"Noch keine Unterhaltungen",placeholder_something_went_wrong_retry_label:"Erneut versuchen"},feedback:{title:"Feedback senden",good:"Gut",bad:"Schlecht",comment_label:"Kommentar (optional)",comment_placeholder:"Hinterlasse einen Kommentar",cancel:"Abbrechen",submit:"Senden",save:"Speichern",edit:"Feedback bearbeiten",remove:"Feedback entfernen"}},n={language:"de",strings:a,dateLocale:r.de},t=_.mapCommonStringsToReactFormat(n.strings),i={...t,HEADER_BUTTON__AGENT_HANDOFF:"Mit einem Agenten verbinden",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Wählen Sie eine Option zum Fortfahren",BUTTON__CANCEL:"Abbrechen",BUTTON__SUBMIT:"Absenden",SUBMITTED:"Gesendet",TRY_AGAIN:"Bitte versuche es erneut.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"Du kannst nicht mehr als ein Bild hochladen.",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"Die maximale Dateigröße beträgt %d MB.",FILE_VIEWER__UNSUPPORT:"Nicht unterstützte Nachricht",CSAT5_RATING_SCORE_1:"Schrecklich",CSAT5_RATING_SCORE_2:"Schlecht",CSAT5_RATING_SCORE_3:"Okay",CSAT5_RATING_SCORE_4:"Gut",CSAT5_RATING_SCORE_5:"Großartig",FORM_UNAVAILABLE:"Das Formular ist nicht mehr verfügbar.",FORM_NOT_SUPPORTED:"Dieses Formular wird in der aktuellen Version nicht unterstützt.",FORM_VALIDATION_MIN_LENGTH:e=>`Mindestens ${e} Zeichen erforderlich`,FORM_VALIDATION_MAX_LENGTH:e=>`Maximal ${e} Zeichen erlaubt`,FORM_VALIDATION_MIN:e=>`Mindestwert ist ${e}`,FORM_VALIDATION_MAX:e=>`Maximalwert ist ${e}`,FORM_VALIDATION_MIN_SELECT:e=>`Wähle mindestens ${e} Optionen`,FORM_VALIDATION_MAX_SELECT:e=>`Wähle höchstens ${e} Optionen`,FORM_VALIDATION_REGEX_FAILED:"Ungültiges Format",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:t.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"Keine Kategorie",CONVERSATION_CLOSED_FOOTER_LABEL:"Deine Unterhaltung wurde beendet",START_NEW_CONVERSATION:"💬 Neue Unterhaltung starten",RETURN_TO_CONVERSATION:"💬 Zurück zur Unterhaltung",BUTTON__SAVE:"Speichern",BUTTON__OK:"OK",NO_NAME:"(Kein Name)",CHANNEL_FROZEN:"Kanal eingefroren"},s={language:n.language,dateLocale:n.dateLocale,stringSet:i};exports.default=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./Coha9Fqu.cjs"),r=require("date-fns/locale/de"),a={conversation:{input_placeholder:"Eine Frage stellen",input_placeholder_disabled:"Chat ist in diesem Kanal nicht verfügbar",input_placeholder_wait_ai_agent_response:"Warten auf die Antwort des Agenten...",input_placeholder_active_form:"Bitte fülle das Formular aus, um fortzufahren.",input_placeholder_reconnecting:"Neu verbinden. Aktualisieren falls anhaltend.",unknown_message_type:"(Unbekannter Nachrichtentyp)",powered_by:"Unterstützt von",citation_title:"Quelle",start_new_conversation_label:"Ein Gespräch starten",scroll_to_new_messages_label:()=>"Neue Nachricht",failed_message_resend:"Erneut versuchen",failed_message_remove:"Entfernen",file_upload_no_supported_files:"Keine unterstützten Dateitypen verfügbar.",a11y_message_list:"Chat-Nachrichten",a11y_scroll_to_bottom:"Nach unten scrollen",a11y_scroll_to_new_messages:"Zu neuen Nachrichten scrollen",a11y_open_conversation_list:"Konversationsliste öffnen"},conversation_list:{header_title:"Gespräche",ended:"Beendet",footer_title:"Ein Gespräch starten"},date_format:{just_now:"Gerade eben",minutes_ago:e=>`Vor ${e} Minuten`,hours_ago:e=>`Vor ${e} Stunden`,date_short:"dd.MM.yyyy",date_separator:"d. MMMM yyyy",message_timestamp:"p"},csat:{title:"Ihr Feedback ist uns wichtig",submitted_label:"Erfolgreich gesendet!",cre_question:"Wurde Ihr Problem gelöst?",cre_positive_label:"Ja, danke! 👍",cre_negative_label:"Nein, das hat nicht geholfen.",reason_placeholder:"Dein Feedback teilen",question:"Wie würden Sie Ihre Erfahrung bewerten?",submit_label:"Absenden",submission_expired:"Die Umfrage ist leider nicht mehr verfügbar."},form:{optional_label:"optional",validation_required:"Diese Frage ist erforderlich"},common:{placeholder_something_went_wrong:"Etwas ist schiefgelaufen",placeholder_no_messages:"Keine Nachrichten",placeholder_no_conversations:"Noch keine Unterhaltungen",placeholder_something_went_wrong_retry_label:"Erneut versuchen"},feedback:{title:"Feedback senden",good:"Gut",bad:"Schlecht",comment_label:"Kommentar (optional)",comment_placeholder:"Hinterlasse einen Kommentar",cancel:"Abbrechen",submit:"Senden",save:"Speichern",edit:"Feedback bearbeiten",remove:"Feedback entfernen"}},n={language:"de",strings:a,dateLocale:r.de},t=_.mapCommonStringsToReactFormat(n.strings),i={...t,HEADER_BUTTON__AGENT_HANDOFF:"Mit einem Agenten verbinden",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Wählen Sie eine Option zum Fortfahren",BUTTON__CANCEL:"Abbrechen",BUTTON__SUBMIT:"Absenden",SUBMITTED:"Gesendet",TRY_AGAIN:"Bitte versuche es erneut.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"Du kannst nicht mehr als ein Bild hochladen.",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"Die maximale Dateigröße beträgt %d MB.",FILE_VIEWER__UNSUPPORT:"Nicht unterstützte Nachricht",CSAT5_RATING_SCORE_1:"Schrecklich",CSAT5_RATING_SCORE_2:"Schlecht",CSAT5_RATING_SCORE_3:"Okay",CSAT5_RATING_SCORE_4:"Gut",CSAT5_RATING_SCORE_5:"Großartig",FORM_UNAVAILABLE:"Das Formular ist nicht mehr verfügbar.",FORM_NOT_SUPPORTED:"Dieses Formular wird in der aktuellen Version nicht unterstützt.",FORM_VALIDATION_MIN_LENGTH:e=>`Mindestens ${e} Zeichen erforderlich`,FORM_VALIDATION_MAX_LENGTH:e=>`Maximal ${e} Zeichen erlaubt`,FORM_VALIDATION_MIN:e=>`Mindestwert ist ${e}`,FORM_VALIDATION_MAX:e=>`Maximalwert ist ${e}`,FORM_VALIDATION_MIN_SELECT:e=>`Wähle mindestens ${e} Optionen`,FORM_VALIDATION_MAX_SELECT:e=>`Wähle höchstens ${e} Optionen`,FORM_VALIDATION_REGEX_FAILED:"Ungültiges Format",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:t.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"Keine Kategorie",CONVERSATION_CLOSED_FOOTER_LABEL:"Deine Unterhaltung wurde beendet",START_NEW_CONVERSATION:"💬 Neue Unterhaltung starten",RETURN_TO_CONVERSATION:"💬 Zurück zur Unterhaltung",BUTTON__SAVE:"Speichern",BUTTON__OK:"OK",NO_NAME:"(Kein Name)",CHANNEL_FROZEN:"Kanal eingefroren"},s={language:n.language,dateLocale:n.dateLocale,stringSet:i};exports.default=s;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./DwrHbIrU.cjs"),a=require("date-fns/locale/hi"),T={conversation:{input_placeholder:"एक प्रश्न पूछें",input_placeholder_disabled:"इस चैनल में चैट उपलब्ध नहीं है",input_placeholder_wait_ai_agent_response:"एजेंट के उत्तर की प्रतीक्षा कर रहे हैं...",input_placeholder_active_form:"आगे बढ़ने के लिए कृपया फॉर्म भरें।",input_placeholder_reconnecting:"पुनः कनेक्ट हो रहा है। जारी रहे तो रिफ्रेश करें।",unknown_message_type:"(अज्ञात संदेश प्रकार)",powered_by:"द्वारा संचालित",citation_title:"स्रोत",start_new_conversation_label:"एक बातचीत शुरू करें",scroll_to_new_messages_label:()=>"नया संदेश",failed_message_resend:"पुनः प्रयास करें",failed_message_remove:"हटाएं",file_upload_no_supported_files:"कोई समर्थित फ़ाइल प्रकार उपलब्ध नहीं हैं।",a11y_message_list:"चैट संदेश",a11y_scroll_to_bottom:"नीचे स्क्रॉल करें",a11y_scroll_to_new_messages:"नए संदेशों पर स्क्रॉल करें",a11y_open_conversation_list:"बातचीत सूची खोलें"},conversation_list:{header_title:"बातचीत",ended:"समाप्त",footer_title:"एक बातचीत शुरू करें"},date_format:{just_now:"अभी",minutes_ago:_=>`${_} मिनट पहले`,hours_ago:_=>`${_} घंटे पहले`,date_short:"dd/MM/yyyy",date_separator:"d MMMM yyyy",message_timestamp:"p"},csat:{title:"आपकी प्रतिक्रिया हमारे लिए मायने रखती है",submitted_label:"सफलतापूर्वक सबमिट किया गया!",cre_question:"क्या आपकी समस्या का समाधान हुआ?",cre_positive_label:"हाँ, धन्यवाद! 👍",cre_negative_label:"नहीं, इससे मदद नहीं मिली।",reason_placeholder:"अपनी प्रतिक्रिया साझा करें",question:"आप अपने अनुभव का मूल्यांकन कैसे करेंगे?",submit_label:"सबमिट करें",submission_expired:"क्षमा करें, सर्वेक्षण अवधि समाप्त हो गई है।"},form:{optional_label:"वैकल्पिक",validation_required:"यह प्रश्न आवश्यक है"},common:{placeholder_something_went_wrong:"कुछ गलत हो गया",placeholder_no_messages:"कोई संदेश नहीं",placeholder_no_conversations:"अभी तक कोई बातचीत नहीं",placeholder_something_went_wrong_retry_label:"पुनः प्रयास करें"},feedback:{title:"प्रतिक्रिया भेजें",good:"अच्छा",bad:"बुरा",comment_label:"टिप्पणी (वैकल्पिक)",comment_placeholder:"एक टिप्पणी छोड़ें",cancel:"रद्द करें",submit:"भेजें",save:"सहेजें",edit:"प्रतिक्रिया संपादित करें",remove:"प्रतिक्रिया हटाएं"}},e={language:"hi",strings:T,dateLocale:a.hi},t=o.mapCommonStringsToReactFormat(e.strings),s={...t,HEADER_BUTTON__AGENT_HANDOFF:"एजेंट से कनेक्ट करें",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"जारी रखने के लिए एक विकल्प चुनें",BUTTON__CANCEL:"रद्द करें",BUTTON__SUBMIT:"सबमिट करें",SUBMITTED:"सबमिट किया गया",TRY_AGAIN:"कृपया पुनः प्रयास करें।",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"आप एक से अधिक छवि अपलोड नहीं कर सकते।",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"प्रति फ़ाइल अधिकतम आकार %d MB है।",FILE_VIEWER__UNSUPPORT:"असमर्थित संदेश",CSAT5_RATING_SCORE_1:"भयानक",CSAT5_RATING_SCORE_2:"खराब",CSAT5_RATING_SCORE_3:"ठीक",CSAT5_RATING_SCORE_4:"अच्छा",CSAT5_RATING_SCORE_5:"बढ़िया",FORM_UNAVAILABLE:"फॉर्म अब उपलब्ध नहीं है।",FORM_NOT_SUPPORTED:"यह फॉर्म वर्तमान संस्करण में समर्थित नहीं है।",FORM_VALIDATION_MIN_LENGTH:_=>`न्यूनतम ${_} अक्षर आवश्यक हैं`,FORM_VALIDATION_MAX_LENGTH:_=>`अधिकतम ${_} अक्षर अनुमतित हैं`,FORM_VALIDATION_MIN:_=>`न्यूनतम मान ${_} है`,FORM_VALIDATION_MAX:_=>`अधिकतम मान ${_} है`,FORM_VALIDATION_MIN_SELECT:_=>`कम से कम ${_} विकल्प चुनें`,FORM_VALIDATION_MAX_SELECT:_=>`अधिकतम ${_} विकल्प चुनें`,FORM_VALIDATION_REGEX_FAILED:"गलत प्रारूप",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:t.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"कोई श्रेणी नहीं",CONVERSATION_CLOSED_FOOTER_LABEL:"आपकी बातचीत समाप्त हो गई है",START_NEW_CONVERSATION:"💬 नई बातचीत शुरू करें",RETURN_TO_CONVERSATION:"💬 बातचीत पर वापस जाएं",BUTTON__SAVE:"सहेजें",BUTTON__OK:"ठीक है",NO_NAME:"(कोई नाम नहीं)",CHANNEL_FROZEN:"चैनल फ्रीज हो गया"},l={language:e.language,dateLocale:e.dateLocale,stringSet:s};exports.default=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./Coha9Fqu.cjs"),a=require("date-fns/locale/hi"),T={conversation:{input_placeholder:"एक प्रश्न पूछें",input_placeholder_disabled:"इस चैनल में चैट उपलब्ध नहीं है",input_placeholder_wait_ai_agent_response:"एजेंट के उत्तर की प्रतीक्षा कर रहे हैं...",input_placeholder_active_form:"आगे बढ़ने के लिए कृपया फॉर्म भरें।",input_placeholder_reconnecting:"पुनः कनेक्ट हो रहा है। जारी रहे तो रिफ्रेश करें।",unknown_message_type:"(अज्ञात संदेश प्रकार)",powered_by:"द्वारा संचालित",citation_title:"स्रोत",start_new_conversation_label:"एक बातचीत शुरू करें",scroll_to_new_messages_label:()=>"नया संदेश",failed_message_resend:"पुनः प्रयास करें",failed_message_remove:"हटाएं",file_upload_no_supported_files:"कोई समर्थित फ़ाइल प्रकार उपलब्ध नहीं हैं।",a11y_message_list:"चैट संदेश",a11y_scroll_to_bottom:"नीचे स्क्रॉल करें",a11y_scroll_to_new_messages:"नए संदेशों पर स्क्रॉल करें",a11y_open_conversation_list:"बातचीत सूची खोलें"},conversation_list:{header_title:"बातचीत",ended:"समाप्त",footer_title:"एक बातचीत शुरू करें"},date_format:{just_now:"अभी",minutes_ago:_=>`${_} मिनट पहले`,hours_ago:_=>`${_} घंटे पहले`,date_short:"dd/MM/yyyy",date_separator:"d MMMM yyyy",message_timestamp:"p"},csat:{title:"आपकी प्रतिक्रिया हमारे लिए मायने रखती है",submitted_label:"सफलतापूर्वक सबमिट किया गया!",cre_question:"क्या आपकी समस्या का समाधान हुआ?",cre_positive_label:"हाँ, धन्यवाद! 👍",cre_negative_label:"नहीं, इससे मदद नहीं मिली।",reason_placeholder:"अपनी प्रतिक्रिया साझा करें",question:"आप अपने अनुभव का मूल्यांकन कैसे करेंगे?",submit_label:"सबमिट करें",submission_expired:"क्षमा करें, सर्वेक्षण अवधि समाप्त हो गई है।"},form:{optional_label:"वैकल्पिक",validation_required:"यह प्रश्न आवश्यक है"},common:{placeholder_something_went_wrong:"कुछ गलत हो गया",placeholder_no_messages:"कोई संदेश नहीं",placeholder_no_conversations:"अभी तक कोई बातचीत नहीं",placeholder_something_went_wrong_retry_label:"पुनः प्रयास करें"},feedback:{title:"प्रतिक्रिया भेजें",good:"अच्छा",bad:"बुरा",comment_label:"टिप्पणी (वैकल्पिक)",comment_placeholder:"एक टिप्पणी छोड़ें",cancel:"रद्द करें",submit:"भेजें",save:"सहेजें",edit:"प्रतिक्रिया संपादित करें",remove:"प्रतिक्रिया हटाएं"}},e={language:"hi",strings:T,dateLocale:a.hi},t=o.mapCommonStringsToReactFormat(e.strings),s={...t,HEADER_BUTTON__AGENT_HANDOFF:"एजेंट से कनेक्ट करें",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"जारी रखने के लिए एक विकल्प चुनें",BUTTON__CANCEL:"रद्द करें",BUTTON__SUBMIT:"सबमिट करें",SUBMITTED:"सबमिट किया गया",TRY_AGAIN:"कृपया पुनः प्रयास करें।",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"आप एक से अधिक छवि अपलोड नहीं कर सकते।",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"प्रति फ़ाइल अधिकतम आकार %d MB है।",FILE_VIEWER__UNSUPPORT:"असमर्थित संदेश",CSAT5_RATING_SCORE_1:"भयानक",CSAT5_RATING_SCORE_2:"खराब",CSAT5_RATING_SCORE_3:"ठीक",CSAT5_RATING_SCORE_4:"अच्छा",CSAT5_RATING_SCORE_5:"बढ़िया",FORM_UNAVAILABLE:"फॉर्म अब उपलब्ध नहीं है।",FORM_NOT_SUPPORTED:"यह फॉर्म वर्तमान संस्करण में समर्थित नहीं है।",FORM_VALIDATION_MIN_LENGTH:_=>`न्यूनतम ${_} अक्षर आवश्यक हैं`,FORM_VALIDATION_MAX_LENGTH:_=>`अधिकतम ${_} अक्षर अनुमतित हैं`,FORM_VALIDATION_MIN:_=>`न्यूनतम मान ${_} है`,FORM_VALIDATION_MAX:_=>`अधिकतम मान ${_} है`,FORM_VALIDATION_MIN_SELECT:_=>`कम से कम ${_} विकल्प चुनें`,FORM_VALIDATION_MAX_SELECT:_=>`अधिकतम ${_} विकल्प चुनें`,FORM_VALIDATION_REGEX_FAILED:"गलत प्रारूप",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:t.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"कोई श्रेणी नहीं",CONVERSATION_CLOSED_FOOTER_LABEL:"आपकी बातचीत समाप्त हो गई है",START_NEW_CONVERSATION:"💬 नई बातचीत शुरू करें",RETURN_TO_CONVERSATION:"💬 बातचीत पर वापस जाएं",BUTTON__SAVE:"सहेजें",BUTTON__OK:"ठीक है",NO_NAME:"(कोई नाम नहीं)",CHANNEL_FROZEN:"चैनल फ्रीज हो गया"},l={language:e.language,dateLocale:e.dateLocale,stringSet:s};exports.default=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./DwrHbIrU.cjs"),r=require("date-fns/locale/tr"),n={conversation:{input_placeholder:"Bir soru sor",input_placeholder_disabled:"Bu kanalda sohbet mevcut değil",input_placeholder_wait_ai_agent_response:"Temsilcinin yanıtını bekliyor...",input_placeholder_active_form:"İlerlemek için lütfen formu doldurun.",input_placeholder_reconnecting:"Yeniden bağlanıyor. Devam ederse yenile.",unknown_message_type:"(Bilinmeyen mesaj türü)",powered_by:"Tarafından desteklenmektedir",citation_title:"Kaynak",start_new_conversation_label:"Bir sohbet başlat",scroll_to_new_messages_label:()=>"Yeni mesaj",failed_message_resend:"Tekrar dene",failed_message_remove:"Kaldır",file_upload_no_supported_files:"Desteklenen dosya türü mevcut değil.",a11y_message_list:"Sohbet mesajları",a11y_scroll_to_bottom:"Aşağı kaydır",a11y_scroll_to_new_messages:"Yeni mesajlara kaydır",a11y_open_conversation_list:"Görüşme listesini aç"},conversation_list:{header_title:"Görüşmeler",ended:"Sona erdi",footer_title:"Bir sohbet başlat"},date_format:{just_now:"Az önce",minutes_ago:e=>`${e} dakika önce`,hours_ago:e=>`${e} saat önce`,date_short:"dd/MM/yyyy",date_separator:"d MMMM yyyy",message_timestamp:"p"},csat:{title:"Görüşleriniz bizim için önemli",submitted_label:"Başarıyla gönderildi!",cre_question:"Sorununuz çözüldü mü?",cre_positive_label:"Evet, teşekkürler! 👍",cre_negative_label:"Hayır, bu yardımcı olmadı.",reason_placeholder:"Geri bildiriminizi paylaşın",question:"Deneyiminizi nasıl değerlendirirsiniz?",submit_label:"Gönder",submission_expired:"Üzgünüz, anket süresi sona erdi."},form:{optional_label:"İsteğe bağlı",validation_required:"Bu soru gereklidir"},common:{placeholder_something_went_wrong:"Bir şeyler ters gitti",placeholder_no_messages:"Mesaj yok",placeholder_no_conversations:"Henüz görüşme yok",placeholder_something_went_wrong_retry_label:"Tekrar dene"},feedback:{title:"Geri bildirim gönder",good:"İyi",bad:"Kötü",comment_label:"Yorum (isteğe bağlı)",comment_placeholder:"Bir yorum bırakın",cancel:"İptal",submit:"Gönder",save:"Kaydet",edit:"Geri bildirimi düzenle",remove:"Geri bildirimi kaldır"}},_={language:"tr",strings:n,dateLocale:r.tr},a=i.mapCommonStringsToReactFormat(_.strings),t={...a,HEADER_BUTTON__AGENT_HANDOFF:"Bir temsilciyle bağlan",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Devam etmek için bir seçenek seçin",BUTTON__CANCEL:"İptal et",BUTTON__SUBMIT:"Gönder",SUBMITTED:"Gönderildi",TRY_AGAIN:"Lütfen tekrar deneyin.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"Birden fazla resim yükleyemezsiniz.",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"Maksimum dosya boyutu %d MB'dir.",FILE_VIEWER__UNSUPPORT:"Desteklenmeyen mesaj",CSAT5_RATING_SCORE_1:"Berbat",CSAT5_RATING_SCORE_2:"Kötü",CSAT5_RATING_SCORE_3:"İdare eder",CSAT5_RATING_SCORE_4:"İyi",CSAT5_RATING_SCORE_5:"Harika",FORM_UNAVAILABLE:"Form artık kullanılamıyor.",FORM_NOT_SUPPORTED:"Bu form mevcut sürümde desteklenmiyor.",FORM_VALIDATION_MIN_LENGTH:e=>`Minimum ${e} karakter gereklidir`,FORM_VALIDATION_MAX_LENGTH:e=>`Maksimum ${e} karakter izin verilir`,FORM_VALIDATION_MIN:e=>`Minimum değer ${e}`,FORM_VALIDATION_MAX:e=>`Maksimum değer ${e}`,FORM_VALIDATION_MIN_SELECT:e=>`En az ${e} seçenek seçin`,FORM_VALIDATION_MAX_SELECT:e=>`En fazla ${e} seçenek seçin`,FORM_VALIDATION_REGEX_FAILED:"Geçersiz format",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:a.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"Kategori yok",CONVERSATION_CLOSED_FOOTER_LABEL:"Görüşmeniz sona erdi",START_NEW_CONVERSATION:"💬 Yeni bir görüşme başlat",RETURN_TO_CONVERSATION:"💬 Görüşmeye dön",BUTTON__SAVE:"Kaydet",BUTTON__OK:"Tamam",NO_NAME:"(İsimsiz)",CHANNEL_FROZEN:"Kanal dondu"},l={language:_.language,dateLocale:_.dateLocale,stringSet:t};exports.default=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./Coha9Fqu.cjs"),r=require("date-fns/locale/tr"),n={conversation:{input_placeholder:"Bir soru sor",input_placeholder_disabled:"Bu kanalda sohbet mevcut değil",input_placeholder_wait_ai_agent_response:"Temsilcinin yanıtını bekliyor...",input_placeholder_active_form:"İlerlemek için lütfen formu doldurun.",input_placeholder_reconnecting:"Yeniden bağlanıyor. Devam ederse yenile.",unknown_message_type:"(Bilinmeyen mesaj türü)",powered_by:"Tarafından desteklenmektedir",citation_title:"Kaynak",start_new_conversation_label:"Bir sohbet başlat",scroll_to_new_messages_label:()=>"Yeni mesaj",failed_message_resend:"Tekrar dene",failed_message_remove:"Kaldır",file_upload_no_supported_files:"Desteklenen dosya türü mevcut değil.",a11y_message_list:"Sohbet mesajları",a11y_scroll_to_bottom:"Aşağı kaydır",a11y_scroll_to_new_messages:"Yeni mesajlara kaydır",a11y_open_conversation_list:"Görüşme listesini aç"},conversation_list:{header_title:"Görüşmeler",ended:"Sona erdi",footer_title:"Bir sohbet başlat"},date_format:{just_now:"Az önce",minutes_ago:e=>`${e} dakika önce`,hours_ago:e=>`${e} saat önce`,date_short:"dd/MM/yyyy",date_separator:"d MMMM yyyy",message_timestamp:"p"},csat:{title:"Görüşleriniz bizim için önemli",submitted_label:"Başarıyla gönderildi!",cre_question:"Sorununuz çözüldü mü?",cre_positive_label:"Evet, teşekkürler! 👍",cre_negative_label:"Hayır, bu yardımcı olmadı.",reason_placeholder:"Geri bildiriminizi paylaşın",question:"Deneyiminizi nasıl değerlendirirsiniz?",submit_label:"Gönder",submission_expired:"Üzgünüz, anket süresi sona erdi."},form:{optional_label:"İsteğe bağlı",validation_required:"Bu soru gereklidir"},common:{placeholder_something_went_wrong:"Bir şeyler ters gitti",placeholder_no_messages:"Mesaj yok",placeholder_no_conversations:"Henüz görüşme yok",placeholder_something_went_wrong_retry_label:"Tekrar dene"},feedback:{title:"Geri bildirim gönder",good:"İyi",bad:"Kötü",comment_label:"Yorum (isteğe bağlı)",comment_placeholder:"Bir yorum bırakın",cancel:"İptal",submit:"Gönder",save:"Kaydet",edit:"Geri bildirimi düzenle",remove:"Geri bildirimi kaldır"}},_={language:"tr",strings:n,dateLocale:r.tr},a=i.mapCommonStringsToReactFormat(_.strings),t={...a,HEADER_BUTTON__AGENT_HANDOFF:"Bir temsilciyle bağlan",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Devam etmek için bir seçenek seçin",BUTTON__CANCEL:"İptal et",BUTTON__SUBMIT:"Gönder",SUBMITTED:"Gönderildi",TRY_AGAIN:"Lütfen tekrar deneyin.",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"Birden fazla resim yükleyemezsiniz.",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"Maksimum dosya boyutu %d MB'dir.",FILE_VIEWER__UNSUPPORT:"Desteklenmeyen mesaj",CSAT5_RATING_SCORE_1:"Berbat",CSAT5_RATING_SCORE_2:"Kötü",CSAT5_RATING_SCORE_3:"İdare eder",CSAT5_RATING_SCORE_4:"İyi",CSAT5_RATING_SCORE_5:"Harika",FORM_UNAVAILABLE:"Form artık kullanılamıyor.",FORM_NOT_SUPPORTED:"Bu form mevcut sürümde desteklenmiyor.",FORM_VALIDATION_MIN_LENGTH:e=>`Minimum ${e} karakter gereklidir`,FORM_VALIDATION_MAX_LENGTH:e=>`Maksimum ${e} karakter izin verilir`,FORM_VALIDATION_MIN:e=>`Minimum değer ${e}`,FORM_VALIDATION_MAX:e=>`Maksimum değer ${e}`,FORM_VALIDATION_MIN_SELECT:e=>`En az ${e} seçenek seçin`,FORM_VALIDATION_MAX_SELECT:e=>`En fazla ${e} seçenek seçin`,FORM_VALIDATION_REGEX_FAILED:"Geçersiz format",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:a.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"Kategori yok",CONVERSATION_CLOSED_FOOTER_LABEL:"Görüşmeniz sona erdi",START_NEW_CONVERSATION:"💬 Yeni bir görüşme başlat",RETURN_TO_CONVERSATION:"💬 Görüşmeye dön",BUTTON__SAVE:"Kaydet",BUTTON__OK:"Tamam",NO_NAME:"(İsimsiz)",CHANNEL_FROZEN:"Kanal dondu"},l={language:_.language,dateLocale:_.dateLocale,stringSet:t};exports.default=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./DwrHbIrU.cjs"),o=require("date-fns/locale/ja"),T={conversation:{input_placeholder:"質問する",input_placeholder_disabled:"このチャンネルではチャットを利用できません",input_placeholder_wait_ai_agent_response:"エージェントの返信を待っています…",input_placeholder_active_form:"続行するには、フォームに記入してください。",input_placeholder_reconnecting:"再接続中。続く場合は更新してください。",unknown_message_type:"(不明なメッセージタイプ)",powered_by:"Powered by",citation_title:"出典",start_new_conversation_label:"会話を始める",scroll_to_new_messages_label:()=>"新しいメッセージ",failed_message_resend:"再試行",failed_message_remove:"削除",file_upload_no_supported_files:"サポートされているファイルタイプがありません。",a11y_message_list:"チャットメッセージ",a11y_scroll_to_bottom:"一番下にスクロール",a11y_scroll_to_new_messages:"新しいメッセージにスクロール",a11y_open_conversation_list:"会話リストを開く"},conversation_list:{header_title:"会話",ended:"終了",footer_title:"会話を始める"},date_format:{just_now:"たった今",minutes_ago:_=>`${_}分前`,hours_ago:_=>`${_}時間前`,date_short:"yyyy/MM/dd",date_separator:"yyyy年 M月 d日",message_timestamp:"p"},csat:{title:"あなたのフィードバックは私たちにとって重要です",submitted_label:"正常に送信されました!",cre_question:"問題は解決されましたか?",cre_positive_label:"はい、ありがとうございます! 👍",cre_negative_label:"いいえ、役に立ちませんでした。",reason_placeholder:"フィードバックを共有する",question:"あなたの経験をどう評価しますか?",submit_label:"送信",submission_expired:"申し訳ありません、アンケートの受付期間は終了しました。"},form:{optional_label:"任意",validation_required:"この質問は必須です"},common:{placeholder_something_went_wrong:"問題が発生しました",placeholder_no_messages:"メッセージがありません",placeholder_no_conversations:"まだ会話がありません",placeholder_something_went_wrong_retry_label:"再試行"},feedback:{title:"フィードバックを送信",good:"良い",bad:"悪い",comment_label:"コメント(オプション)",comment_placeholder:"コメントを残してください",cancel:"キャンセル",submit:"送信",save:"保存",edit:"フィードバックを編集",remove:"フィードバックを削除"}},e={language:"ja",strings:T,dateLocale:o.ja},t=a.mapCommonStringsToReactFormat(e.strings),s={...t,HEADER_BUTTON__AGENT_HANDOFF:"エージェントに接続",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"続行するにはオプションを選択してください",BUTTON__CANCEL:"キャンセル",BUTTON__SUBMIT:"送信",SUBMITTED:"送信済み",TRY_AGAIN:"もう一度お試しください。",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"画像は1枚までアップロードできます。",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"ファイルの最大サイズは%dMBです。",FILE_VIEWER__UNSUPPORT:"サポートされていないメッセージ",CSAT5_RATING_SCORE_1:"最悪",CSAT5_RATING_SCORE_2:"悪い",CSAT5_RATING_SCORE_3:"普通",CSAT5_RATING_SCORE_4:"良い",CSAT5_RATING_SCORE_5:"素晴らしい",FORM_UNAVAILABLE:"このフォームはもう利用できません。",FORM_NOT_SUPPORTED:"このフォームは現在のバージョンではサポートされていません。",FORM_VALIDATION_MIN_LENGTH:_=>`最低${_}文字が必要です`,FORM_VALIDATION_MAX_LENGTH:_=>`最大${_}文字まで入力できます`,FORM_VALIDATION_MIN:_=>`最小値は${_}です`,FORM_VALIDATION_MAX:_=>`最大値は${_}です`,FORM_VALIDATION_MIN_SELECT:_=>`少なくとも${_}個のオプションを選択してください`,FORM_VALIDATION_MAX_SELECT:_=>`最大${_}個のオプションを選択してください`,FORM_VALIDATION_REGEX_FAILED:"無効な形式",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:t.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"カテゴリなし",CONVERSATION_CLOSED_FOOTER_LABEL:"会話が終了しました",START_NEW_CONVERSATION:"💬 新しい会話を始める",RETURN_TO_CONVERSATION:"💬 会話に戻る",BUTTON__SAVE:"保存",BUTTON__OK:"OK",NO_NAME:"(名前なし)",CHANNEL_FROZEN:"チャンネルが凍結されました"},l={language:e.language,dateLocale:e.dateLocale,stringSet:s};exports.default=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./Coha9Fqu.cjs"),o=require("date-fns/locale/ja"),T={conversation:{input_placeholder:"質問する",input_placeholder_disabled:"このチャンネルではチャットを利用できません",input_placeholder_wait_ai_agent_response:"エージェントの返信を待っています…",input_placeholder_active_form:"続行するには、フォームに記入してください。",input_placeholder_reconnecting:"再接続中。続く場合は更新してください。",unknown_message_type:"(不明なメッセージタイプ)",powered_by:"Powered by",citation_title:"出典",start_new_conversation_label:"会話を始める",scroll_to_new_messages_label:()=>"新しいメッセージ",failed_message_resend:"再試行",failed_message_remove:"削除",file_upload_no_supported_files:"サポートされているファイルタイプがありません。",a11y_message_list:"チャットメッセージ",a11y_scroll_to_bottom:"一番下にスクロール",a11y_scroll_to_new_messages:"新しいメッセージにスクロール",a11y_open_conversation_list:"会話リストを開く"},conversation_list:{header_title:"会話",ended:"終了",footer_title:"会話を始める"},date_format:{just_now:"たった今",minutes_ago:_=>`${_}分前`,hours_ago:_=>`${_}時間前`,date_short:"yyyy/MM/dd",date_separator:"yyyy年 M月 d日",message_timestamp:"p"},csat:{title:"あなたのフィードバックは私たちにとって重要です",submitted_label:"正常に送信されました!",cre_question:"問題は解決されましたか?",cre_positive_label:"はい、ありがとうございます! 👍",cre_negative_label:"いいえ、役に立ちませんでした。",reason_placeholder:"フィードバックを共有する",question:"あなたの経験をどう評価しますか?",submit_label:"送信",submission_expired:"申し訳ありません、アンケートの受付期間は終了しました。"},form:{optional_label:"任意",validation_required:"この質問は必須です"},common:{placeholder_something_went_wrong:"問題が発生しました",placeholder_no_messages:"メッセージがありません",placeholder_no_conversations:"まだ会話がありません",placeholder_something_went_wrong_retry_label:"再試行"},feedback:{title:"フィードバックを送信",good:"良い",bad:"悪い",comment_label:"コメント(オプション)",comment_placeholder:"コメントを残してください",cancel:"キャンセル",submit:"送信",save:"保存",edit:"フィードバックを編集",remove:"フィードバックを削除"}},e={language:"ja",strings:T,dateLocale:o.ja},t=a.mapCommonStringsToReactFormat(e.strings),s={...t,HEADER_BUTTON__AGENT_HANDOFF:"エージェントに接続",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"続行するにはオプションを選択してください",BUTTON__CANCEL:"キャンセル",BUTTON__SUBMIT:"送信",SUBMITTED:"送信済み",TRY_AGAIN:"もう一度お試しください。",FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT:"画像は1枚までアップロードできます。",FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT:"ファイルの最大サイズは%dMBです。",FILE_VIEWER__UNSUPPORT:"サポートされていないメッセージ",CSAT5_RATING_SCORE_1:"最悪",CSAT5_RATING_SCORE_2:"悪い",CSAT5_RATING_SCORE_3:"普通",CSAT5_RATING_SCORE_4:"良い",CSAT5_RATING_SCORE_5:"素晴らしい",FORM_UNAVAILABLE:"このフォームはもう利用できません。",FORM_NOT_SUPPORTED:"このフォームは現在のバージョンではサポートされていません。",FORM_VALIDATION_MIN_LENGTH:_=>`最低${_}文字が必要です`,FORM_VALIDATION_MAX_LENGTH:_=>`最大${_}文字まで入力できます`,FORM_VALIDATION_MIN:_=>`最小値は${_}です`,FORM_VALIDATION_MAX:_=>`最大値は${_}です`,FORM_VALIDATION_MIN_SELECT:_=>`少なくとも${_}個のオプションを選択してください`,FORM_VALIDATION_MAX_SELECT:_=>`最大${_}個のオプションを選択してください`,FORM_VALIDATION_REGEX_FAILED:"無効な形式",DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE:t.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm",CONVERSATION_LIST__TOPICS_FALLBACK:"カテゴリなし",CONVERSATION_CLOSED_FOOTER_LABEL:"会話が終了しました",START_NEW_CONVERSATION:"💬 新しい会話を始める",RETURN_TO_CONVERSATION:"💬 会話に戻る",BUTTON__SAVE:"保存",BUTTON__OK:"OK",NO_NAME:"(名前なし)",CHANNEL_FROZEN:"チャンネルが凍結されました"},l={language:e.language,dateLocale:e.dateLocale,stringSet:s};exports.default=l;
@@ -1,4 +1,4 @@
1
- import { m as t } from "./By2XFBR_.js";
1
+ import { m as t } from "./CshK3mQ2.js";
2
2
  import { hi as a } from "date-fns/locale/hi";
3
3
  const T = {
4
4
  conversation: {
@@ -1,4 +1,4 @@
1
- import { m as n } from "./By2XFBR_.js";
1
+ import { m as n } from "./CshK3mQ2.js";
2
2
  import { es as _ } from "date-fns/locale/es";
3
3
  const i = {
4
4
  conversation: {
@@ -1,4 +1,4 @@
1
- import { m as o } from "./By2XFBR_.js";
1
+ import { m as o } from "./CshK3mQ2.js";
2
2
  import { fr as _ } from "date-fns/locale/fr";
3
3
  const r = {
4
4
  conversation: {
@@ -3,7 +3,7 @@ import { useCallback as s } from "react";
3
3
  import h from "dompurify";
4
4
  import x, { RuleType as g } from "markdown-to-jsx";
5
5
  import b from "styled-components";
6
- import { A as c, e as m, c as r } from "./By2XFBR_.js";
6
+ import { A as c, e as m, c as r } from "./CshK3mQ2.js";
7
7
  const w = (d, o, a, e) => o.type === g.textStrikethroughed ? /* @__PURE__ */ t.createElement("span", { key: e.key }, `~~${a(o.children, e)}~~`) : d(), v = ({ className: d, children: o, style: a, onClickImage: e }) => {
8
8
  const p = s((i) => {
9
9
  const n = /* @__PURE__ */ t.createElement("img", { ...i, alt: i.alt || "" }), l = i.src;
@@ -1,4 +1,4 @@
1
- import { m as o } from "./By2XFBR_.js";
1
+ import { m as o } from "./CshK3mQ2.js";
2
2
  import { ja as t } from "date-fns/locale/ja";
3
3
  const T = {
4
4
  conversation: {
@@ -1,4 +1,4 @@
1
- import { m as _ } from "./By2XFBR_.js";
1
+ import { m as _ } from "./CshK3mQ2.js";
2
2
  import { de as a } from "date-fns/locale/de";
3
3
  const r = {
4
4
  conversation: {
@@ -1,4 +1,4 @@
1
- import { m as a } from "./By2XFBR_.js";
1
+ import { m as a } from "./CshK3mQ2.js";
2
2
  import { ko as t } from "date-fns/locale/ko";
3
3
  const T = {
4
4
  conversation: {
@@ -130,7 +130,8 @@ function Yo(e, t) {
130
130
  {
131
131
  response_type: "free_text",
132
132
  scores: [1, 2, 3, 4, 5],
133
- question: t.followUp.question
133
+ question: t.followUp.question,
134
+ always_visible: !1
134
135
  }
135
136
  ],
136
137
  csat_submit_label: t.submit_label,
@@ -497,7 +498,7 @@ function ms({
497
498
  };
498
499
  });
499
500
  }, [e, t, b, v, d, n]), P(() => () => {
500
- u.chatSDK.disconnectWebSocket();
501
+ u.chatSDK.connectionState === "OPEN" && u.chatSDK.disconnectWebSocket();
501
502
  }, [u.chatSDK]), cs(u.chatSDK), /* @__PURE__ */ o.createElement(
502
503
  us,
503
504
  {
@@ -2300,13 +2301,9 @@ const Ii = /* @__PURE__ */ new Set(["free_text", "single_choice"]), ki = ({ csat
2300
2301
  csatReason: r,
2301
2302
  isResolved: s
2302
2303
  }), [l, c] = Mn({ followUpItem: !1 }), d = ie(() => {
2303
- var E;
2304
- const v = i.csat;
2305
- if (typeof v != "number") return;
2306
- const _ = (E = e.follow_up) == null ? void 0 : E.find(
2307
- (u) => u.scores.includes(v)
2308
- );
2309
- if (Ii.has(_ == null ? void 0 : _.response_type)) return _;
2304
+ var u;
2305
+ const v = i.csat, _ = typeof v == "number", E = (u = e.follow_up) == null ? void 0 : u.find((p) => _ ? p.scores.includes(v) : p.always_visible ?? !1);
2306
+ if (Ii.has(E == null ? void 0 : E.response_type)) return E;
2310
2307
  }, [i.csat, e.follow_up]), g = (() => {
2311
2308
  var v;
2312
2309
  if (typeof n == "number")
@@ -2593,7 +2590,7 @@ async function Vi(e) {
2593
2590
  if (t) return t;
2594
2591
  try {
2595
2592
  if (Fi.has(e)) {
2596
- const { default: n } = await Pi(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./YUOGDsml.js"), "./languages/en.ts": () => Promise.resolve().then(() => Hi), "./languages/es.ts": () => import("./CFFZNjOj.js"), "./languages/fr.ts": () => import("./-WWqhsdP.js"), "./languages/hi.ts": () => import("./Bsb8urZu.js"), "./languages/it.ts": () => import("./C3PP_RTM.js"), "./languages/ja.ts": () => import("./yBEMlNSs.js"), "./languages/ko.ts": () => import("./BDvtEnu9.js"), "./languages/pt.ts": () => import("./nGzMJZzZ.js"), "./languages/tr.ts": () => import("./DIrWtn8H.js") }), `./languages/${e}.ts`, 3);
2593
+ const { default: n } = await Pi(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./CKwRUTWf.js"), "./languages/en.ts": () => Promise.resolve().then(() => Hi), "./languages/es.ts": () => import("./BFDsyE0U.js"), "./languages/fr.ts": () => import("./BjIIfKfq.js"), "./languages/hi.ts": () => import("./0G0uAQF0.js"), "./languages/it.ts": () => import("./qvmX8RYv.js"), "./languages/ja.ts": () => import("./C47C5cAt.js"), "./languages/ko.ts": () => import("./CrrAkB9T.js"), "./languages/pt.ts": () => import("./sFGDuw6U.js"), "./languages/tr.ts": () => import("./DDHQIfx_.js") }), `./languages/${e}.ts`, 3);
2597
2594
  return Pt.set(e, n), n;
2598
2595
  }
2599
2596
  return pt;
@@ -2938,7 +2935,7 @@ function Ea({ file: e, children: t, onClickFile: n }) {
2938
2935
  }
2939
2936
  ), t);
2940
2937
  }
2941
- const xa = h.div`display:flex;flex-direction:column;align-items:flex-start;gap:${V.GAP_GROUPED}px;`, va = "1.13.1", ce = "sb-agent", de = {
2938
+ const xa = h.div`display:flex;flex-direction:column;align-items:flex-start;gap:${V.GAP_GROUPED}px;`, va = "1.13.2", ce = "sb-agent", de = {
2942
2939
  ENTRY: `${ce}-entry`,
2943
2940
  MODAL_ROOT: `${ce}-modal-root`,
2944
2941
  WINDOW: `${ce}-window`,
@@ -2970,7 +2967,7 @@ const Ta = h.div`display:flex;flex-direction:column;align-items:flex-start;gap:$
2970
2967
  `, wa = h.img`width:100%;height:100%;object-fit:cover;`, Ia = h.video`width:100%;height:100%;object-fit:cover;`, ka = "✱", Ir = (e) => {
2971
2968
  const t = new RegExp(`(\`+)([^\`]+?)\\1|(${ka}+)`, "g");
2972
2969
  return e.replace(t, (n, r, s, i) => r ? n : i ? `<span id=${Ca} aria-label="masked-text">${i}</span>` : n);
2973
- }, $a = (e) => e.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>"), Ma = D(async () => ({ default: (await import("./7nVEVfxl.js")).MarkdownText })), La = D(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
2970
+ }, $a = (e) => e.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>"), Ma = D(async () => ({ default: (await import("./BpCkIOcH.js")).MarkdownText })), La = D(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
2974
2971
  function Nn(e) {
2975
2972
  var s, i;
2976
2973
  const t = e.maxBodyWidth ?? V.BODY_MAX_WIDTH, n = ie(() => ts(e.message, Ir), [e.message]), r = {
@@ -5431,7 +5428,7 @@ const vm = (e, t) => {
5431
5428
  color: ${m.color.information.main};
5432
5429
  `};
5433
5430
  }
5434
- `, km = D(() => import("./7nVEVfxl.js").then((e) => ({ default: e.MarkdownText }))), $m = () => {
5431
+ `, km = D(() => import("./BpCkIOcH.js").then((e) => ({ default: e.MarkdownText }))), $m = () => {
5435
5432
  const { aiAgentInfo: e, userSession: t } = ne(), { messageSource: n, channelSource: r } = re(), [s, i] = C(null), a = Xt("special-notice", r.channel), l = L(() => r.channel ? a ? n.messages.some((c) => Qe(c, (t == null ? void 0 : t.userId) ?? "")) : !0 : null, [r.channel, a, n.messages, t == null ? void 0 : t.userId]);
5436
5433
  return P(() => {
5437
5434
  s || i(l());
@@ -1,4 +1,4 @@
1
- import { m as i } from "./By2XFBR_.js";
1
+ import { m as i } from "./CshK3mQ2.js";
2
2
  import { tr as r } from "date-fns/locale/tr";
3
3
  const n = {
4
4
  conversation: {
@@ -1,4 +1,4 @@
1
- import { m as i } from "./By2XFBR_.js";
1
+ import { m as i } from "./CshK3mQ2.js";
2
2
  import { it as n } from "date-fns/locale/it";
3
3
  const _ = {
4
4
  conversation: {
@@ -1,4 +1,4 @@
1
- import { m as _ } from "./By2XFBR_.js";
1
+ import { m as _ } from "./CshK3mQ2.js";
2
2
  import { pt as n } from "date-fns/locale/pt";
3
3
  const r = {
4
4
  conversation: {
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./cjs/DwrHbIrU.cjs");require("react");exports.AgentProviderContainer=e.AgentProviderContainer;exports.AgentUIProviderContainer=e.AgentUIProviderContainer;exports.AnonymousSessionInfo=e.AnonymousSessionInfo;exports.CSATType=e.CSATType;exports.Commands=e.DispatcherCommands;exports.Conversation=e.Conversation;exports.ConversationContext=e.ConversationContext;exports.ConversationContextProvider=e.ConversationContextProvider;exports.ConversationHeaderLayout=e.ConversationHeaderLayout;exports.ConversationLayout=e.ConversationLayout;exports.ConversationList=e.ConversationList;exports.ConversationListContext=e.ConversationListContext;exports.ConversationListContextProvider=e.ConversationListContextProvider;exports.ConversationListHeaderLayout=e.ConversationListHeaderLayout;exports.ConversationListItemLayout=e.ConversationListItemLayout;exports.ConversationListLayout=e.ConversationListLayout;exports.DefaultMessenger=e.DefaultMessenger;exports.FixedMessenger=e.FixedMessenger;exports.IncomingMessageLayout=e.IncomingMessageLayout;exports.LauncherBase=e.LauncherBase;exports.LogLevel=e.LogLevel;exports.ManualSessionInfo=e.ManualSessionInfo;exports.MessageLogs=e.MessageLogs;exports.OutgoingMessageLayout=e.OutgoingMessageLayout;exports.PlaceholderLayout=e.PlaceholderLayout;exports.SystemMessageLayout=e.SystemMessageLayout;exports.messengerDispatcher=e.messengerDispatcher;exports.useConversationContext=e.useConversationContext;exports.useConversationListContext=e.useConversationListContext;exports.useLocalizationContext=e.useLocalizationContext;exports.useMessengerContext=e.useMessengerContext;exports.useMessengerSessionContext=e.useMessengerSessionContext;exports.useRefreshActiveChannel=e.useRefreshActiveChannel;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./cjs/Coha9Fqu.cjs");require("react");exports.AgentProviderContainer=e.AgentProviderContainer;exports.AgentUIProviderContainer=e.AgentUIProviderContainer;exports.AnonymousSessionInfo=e.AnonymousSessionInfo;exports.CSATType=e.CSATType;exports.Commands=e.DispatcherCommands;exports.Conversation=e.Conversation;exports.ConversationContext=e.ConversationContext;exports.ConversationContextProvider=e.ConversationContextProvider;exports.ConversationHeaderLayout=e.ConversationHeaderLayout;exports.ConversationLayout=e.ConversationLayout;exports.ConversationList=e.ConversationList;exports.ConversationListContext=e.ConversationListContext;exports.ConversationListContextProvider=e.ConversationListContextProvider;exports.ConversationListHeaderLayout=e.ConversationListHeaderLayout;exports.ConversationListItemLayout=e.ConversationListItemLayout;exports.ConversationListLayout=e.ConversationListLayout;exports.DefaultMessenger=e.DefaultMessenger;exports.FixedMessenger=e.FixedMessenger;exports.IncomingMessageLayout=e.IncomingMessageLayout;exports.LauncherBase=e.LauncherBase;exports.LogLevel=e.LogLevel;exports.ManualSessionInfo=e.ManualSessionInfo;exports.MessageLogs=e.MessageLogs;exports.OutgoingMessageLayout=e.OutgoingMessageLayout;exports.PlaceholderLayout=e.PlaceholderLayout;exports.SystemMessageLayout=e.SystemMessageLayout;exports.messengerDispatcher=e.messengerDispatcher;exports.useConversationContext=e.useConversationContext;exports.useConversationListContext=e.useConversationListContext;exports.useLocalizationContext=e.useLocalizationContext;exports.useMessengerContext=e.useMessengerContext;exports.useMessengerSessionContext=e.useMessengerSessionContext;exports.useRefreshActiveChannel=e.useRefreshActiveChannel;
package/dist/index.d.ts CHANGED
@@ -1239,6 +1239,7 @@ export declare interface ExtendedMessagePayload {
1239
1239
  question: string;
1240
1240
  scores: number[]; // One or more CSAT scores that trigger this follow-up question.
1241
1241
  required?: boolean;
1242
+ always_visible?: boolean; // Can only be enabled in Dashboard when there is exactly 1 follow-up item and scores are set to [1,2,3,4,5].
1242
1243
  }
1243
1244
  | {
1244
1245
  response_type: 'single_choice';
@@ -1246,6 +1247,7 @@ export declare interface ExtendedMessagePayload {
1246
1247
  scores: number[]; // One or more CSAT scores that trigger this follow-up question.
1247
1248
  options: string[]; // Up to 5 predefined answer choices
1248
1249
  required?: boolean;
1250
+ always_visible?: boolean; // Can only be enabled in Dashboard when there is exactly 1 follow-up item and scores are set to [1,2,3,4,5].
1249
1251
  }
1250
1252
  >;
1251
1253
  };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as o, b as n, B as t, x as i, D as r, j as C, n as L, o as u, l as v, k as g, q as y, t as x, v as d, s as M, C as m, r as l, h as c, F as f, I as h, L as I, y as P, z as S, M as p, O as A, P as D, S as z, g as B, p as F, w as H, f as O, u as T, d as b, i as j } from "./es/By2XFBR_.js";
1
+ import { a as o, b as n, B as t, x as i, D as r, j as C, n as L, o as u, l as v, k as g, q as y, t as x, v as d, s as M, C as m, r as l, h as c, F as f, I as h, L as I, y as P, z as S, M as p, O as A, P as D, S as z, g as B, p as F, w as H, f as O, u as T, d as b, i as j } from "./es/CshK3mQ2.js";
2
2
  import "react";
3
3
  export {
4
4
  o as AgentProviderContainer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendbird/ai-agent-messenger-react",
3
- "version": "1.13.1",
3
+ "version": "1.13.2",
4
4
  "description": "Delight AI Agent Messenger for React",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -20,9 +20,9 @@
20
20
  "sideEffects": false,
21
21
  "dependencies": {
22
22
  "@emotion/is-prop-valid": "^1.3.1",
23
- "@sendbird/react-uikit-message-template-view": "0.0.21",
24
- "@sendbird/uikit-message-template": "0.0.21",
25
- "@sendbird/uikit-tools": "0.0.21",
23
+ "@sendbird/react-uikit-message-template-view": "^0.1.0",
24
+ "@sendbird/uikit-message-template": "^0.1.0",
25
+ "@sendbird/uikit-tools": "^0.1.0",
26
26
  "date-fns": "^4.1.0",
27
27
  "dompurify": "^3.2.4",
28
28
  "markdown-to-jsx": "^7.7.12",
@@ -44,8 +44,8 @@
44
44
  "react-dom": "^19.0.0",
45
45
  "strip-json-comments": "^5.0.1",
46
46
  "styled-components": "^6.1.15",
47
+ "@sendbird/ai-agent-core": "1.13.2",
47
48
  "@sendbird/vite-tools": "0.0.1",
48
- "@sendbird/ai-agent-core": "1.13.1",
49
49
  "@sendbird/config-editor": "0.1.0"
50
50
  },
51
51
  "msw": {