@sendbird/ai-agent-messenger-react 1.9.1 → 1.9.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 l=require("react"),c=require("dompurify"),s=require("markdown-to-jsx"),x=require("styled-components"),n=require("./Bz6nAOkq.cjs"),a=t=>t&&t.__esModule?t:{default:t};function b(t){if(t&&t.__esModule)return t;const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const e=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(i,r,e.get?e:{enumerable:!0,get:()=>t[r]})}}return i.default=t,Object.freeze(i)}const o=b(l),g=a(c),u=a(s),m=a(x),f=(t,i,r,e)=>i.type===s.RuleType.textStrikethroughed?o.createElement("span",{key:e.key},`~~${r(i.children,e)}~~`):t(),w=({className:t,children:i,style:r,onClickImage:e})=>{const p=l.useCallback(d=>o.createElement("img",{...d,onClick:()=>d.src&&(e==null?void 0:e(d.src))}),[]);return o.createElement(y,{className:t,style:r},o.createElement(u.default,{options:{renderRule:f,overrides:{a:{component:({children:d,...h})=>o.createElement("a",{...h,target:"_blank",rel:n.ANCHOR_REL},d)},img:{component:p}}}},g.default.sanitize(n.escapeMarkdownSyntax(i))))},y=m.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=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),c=require("dompurify"),s=require("markdown-to-jsx"),x=require("styled-components"),n=require("./CY_VZc_L.cjs"),a=t=>t&&t.__esModule?t:{default:t};function b(t){if(t&&t.__esModule)return t;const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const e=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(i,r,e.get?e:{enumerable:!0,get:()=>t[r]})}}return i.default=t,Object.freeze(i)}const o=b(l),g=a(c),u=a(s),m=a(x),f=(t,i,r,e)=>i.type===s.RuleType.textStrikethroughed?o.createElement("span",{key:e.key},`~~${r(i.children,e)}~~`):t(),w=({className:t,children:i,style:r,onClickImage:e})=>{const p=l.useCallback(d=>o.createElement("img",{...d,onClick:()=>d.src&&(e==null?void 0:e(d.src))}),[]);return o.createElement(y,{className:t,style:r},o.createElement(u.default,{options:{renderRule:f,overrides:{a:{component:({children:d,...h})=>o.createElement("a",{...h,target:"_blank",rel:n.ANCHOR_REL},d)},img:{component:p}}}},g.default.sanitize(n.escapeMarkdownSyntax(i))))},y=m.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=w;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./Bz6nAOkq.cjs"),a=require("date-fns/locale/hi"),o={conversation:{input_placeholder:"एक प्रश्न पूछें",input_placeholder_disabled:"इस चैनल में चैट उपलब्ध नहीं है",input_placeholder_wait_ai_agent_response:"एजेंट के उत्तर की प्रतीक्षा कर रहे हैं...",input_placeholder_active_form:"आगे बढ़ने के लिए कृपया फॉर्म भरें।",unknown_message_type:"(अज्ञात संदेश प्रकार)",powered_by:"द्वारा संचालित",citation_title:"स्रोत",start_new_conversation_label:"एजेंट से बात करें",failed_message_resend:"पुनः प्रयास करें",failed_message_remove:"हटाएं",file_upload_no_supported_files:"कोई समर्थित फ़ाइल प्रकार उपलब्ध नहीं हैं।"},conversation_list:{header_title:"बातचीत",ended:"समाप्त"},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:o,dateLocale:a.hi},T=t.mapCommonStringsToReactFormat(e.strings),n={...T,CHANNEL_FROZEN:"चैनल फ्रीज हो गया",HEADER_BUTTON__AGENT_HANDOFF:"एजेंट से कनेक्ट करें",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"जारी रखने के लिए एक विकल्प चुनें",BUTTON__CANCEL:"रद्द करें",BUTTON__SAVE:"सहेजें",BUTTON__OK:"ठीक है",BUTTON__SUBMIT:"सबमिट करें",NO_NAME:"(कोई नाम नहीं)",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:"बढ़िया",CONVERSATION_CLOSED_FOOTER_LABEL:"आपकी बातचीत समाप्त हो गई है",START_NEW_CONVERSATION:"💬 नई बातचीत शुरू करें",RETURN_TO_CONVERSATION:"💬 बातचीत पर वापस जाएं",CONVERSATION_LIST__TOPICS_FALLBACK:"कोई श्रेणी नहीं",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"},A={language:e.language,dateLocale:e.dateLocale,stringSet:n};exports.default=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./CY_VZc_L.cjs"),a=require("date-fns/locale/hi"),o={conversation:{input_placeholder:"एक प्रश्न पूछें",input_placeholder_disabled:"इस चैनल में चैट उपलब्ध नहीं है",input_placeholder_wait_ai_agent_response:"एजेंट के उत्तर की प्रतीक्षा कर रहे हैं...",input_placeholder_active_form:"आगे बढ़ने के लिए कृपया फॉर्म भरें।",unknown_message_type:"(अज्ञात संदेश प्रकार)",powered_by:"द्वारा संचालित",citation_title:"स्रोत",start_new_conversation_label:"एजेंट से बात करें",failed_message_resend:"पुनः प्रयास करें",failed_message_remove:"हटाएं",file_upload_no_supported_files:"कोई समर्थित फ़ाइल प्रकार उपलब्ध नहीं हैं।"},conversation_list:{header_title:"बातचीत",ended:"समाप्त"},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:o,dateLocale:a.hi},T=t.mapCommonStringsToReactFormat(e.strings),n={...T,CHANNEL_FROZEN:"चैनल फ्रीज हो गया",HEADER_BUTTON__AGENT_HANDOFF:"एजेंट से कनेक्ट करें",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"जारी रखने के लिए एक विकल्प चुनें",BUTTON__CANCEL:"रद्द करें",BUTTON__SAVE:"सहेजें",BUTTON__OK:"ठीक है",BUTTON__SUBMIT:"सबमिट करें",NO_NAME:"(कोई नाम नहीं)",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:"बढ़िया",CONVERSATION_CLOSED_FOOTER_LABEL:"आपकी बातचीत समाप्त हो गई है",START_NEW_CONVERSATION:"💬 नई बातचीत शुरू करें",RETURN_TO_CONVERSATION:"💬 बातचीत पर वापस जाएं",CONVERSATION_LIST__TOPICS_FALLBACK:"कोई श्रेणी नहीं",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"},A={language:e.language,dateLocale:e.dateLocale,stringSet:n};exports.default=A;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./Bz6nAOkq.cjs"),t=require("date-fns/locale/ja"),o={conversation:{input_placeholder:"質問する",input_placeholder_disabled:"このチャンネルではチャットを利用できません",input_placeholder_wait_ai_agent_response:"エージェントの返信を待っています…",input_placeholder_active_form:"続行するには、フォームに記入してください。",unknown_message_type:"(不明なメッセージタイプ)",powered_by:"Powered by",citation_title:"出典",start_new_conversation_label:"エージェントと話す",failed_message_resend:"再試行",failed_message_remove:"削除",file_upload_no_supported_files:"サポートされているファイルタイプがありません。"},conversation_list:{header_title:"会話",ended:"終了"},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:o,dateLocale:t.ja},a=T.mapCommonStringsToReactFormat(e.strings),O={...a,CHANNEL_FROZEN:"チャンネルが凍結されました",HEADER_BUTTON__AGENT_HANDOFF:"エージェントに接続",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"続行するにはオプションを選択してください",BUTTON__CANCEL:"キャンセル",BUTTON__SAVE:"保存",BUTTON__OK:"OK",BUTTON__SUBMIT:"送信",NO_NAME:"(名前なし)",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:"素晴らしい",CONVERSATION_CLOSED_FOOTER_LABEL:"会話が終了しました",START_NEW_CONVERSATION:"💬 新しい会話を始める",RETURN_TO_CONVERSATION:"💬 会話に戻る",CONVERSATION_LIST__TOPICS_FALLBACK:"カテゴリなし",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:a.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm"},n={language:e.language,dateLocale:e.dateLocale,stringSet:O};exports.default=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./CY_VZc_L.cjs"),t=require("date-fns/locale/ja"),o={conversation:{input_placeholder:"質問する",input_placeholder_disabled:"このチャンネルではチャットを利用できません",input_placeholder_wait_ai_agent_response:"エージェントの返信を待っています…",input_placeholder_active_form:"続行するには、フォームに記入してください。",unknown_message_type:"(不明なメッセージタイプ)",powered_by:"Powered by",citation_title:"出典",start_new_conversation_label:"エージェントと話す",failed_message_resend:"再試行",failed_message_remove:"削除",file_upload_no_supported_files:"サポートされているファイルタイプがありません。"},conversation_list:{header_title:"会話",ended:"終了"},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:o,dateLocale:t.ja},a=T.mapCommonStringsToReactFormat(e.strings),O={...a,CHANNEL_FROZEN:"チャンネルが凍結されました",HEADER_BUTTON__AGENT_HANDOFF:"エージェントに接続",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"続行するにはオプションを選択してください",BUTTON__CANCEL:"キャンセル",BUTTON__SAVE:"保存",BUTTON__OK:"OK",BUTTON__SUBMIT:"送信",NO_NAME:"(名前なし)",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:"素晴らしい",CONVERSATION_CLOSED_FOOTER_LABEL:"会話が終了しました",START_NEW_CONVERSATION:"💬 新しい会話を始める",RETURN_TO_CONVERSATION:"💬 会話に戻る",CONVERSATION_LIST__TOPICS_FALLBACK:"カテゴリなし",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:a.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm"},n={language:e.language,dateLocale:e.dateLocale,stringSet:O};exports.default=n;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./Bz6nAOkq.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.",unknown_message_type:"(Tipo di messaggio sconosciuto)",powered_by:"Powered by",citation_title:"Fonte",start_new_conversation_label:"Parla con un agente",failed_message_resend:"Riprova",failed_message_remove:"Rimuovi",file_upload_no_supported_files:"Nessun tipo di file supportato disponibile."},conversation_list:{header_title:"Conversazioni",ended:"Terminata"},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,CHANNEL_FROZEN:"Canale bloccato",HEADER_BUTTON__AGENT_HANDOFF:"Connettersi con un agente",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Seleziona un'opzione per continuare",BUTTON__CANCEL:"Annulla",BUTTON__SAVE:"Salva",BUTTON__OK:"OK",BUTTON__SUBMIT:"Invia",NO_NAME:"(Senza nome)",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",CONVERSATION_CLOSED_FOOTER_LABEL:"La tua conversazione è terminata",START_NEW_CONVERSATION:"💬 Inizia una nuova conversazione",RETURN_TO_CONVERSATION:"💬 Torna alla conversazione",CONVERSATION_LIST__TOPICS_FALLBACK:"Nessuna categoria",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"},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("./CY_VZc_L.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.",unknown_message_type:"(Tipo di messaggio sconosciuto)",powered_by:"Powered by",citation_title:"Fonte",start_new_conversation_label:"Parla con un agente",failed_message_resend:"Riprova",failed_message_remove:"Rimuovi",file_upload_no_supported_files:"Nessun tipo di file supportato disponibile."},conversation_list:{header_title:"Conversazioni",ended:"Terminata"},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,CHANNEL_FROZEN:"Canale bloccato",HEADER_BUTTON__AGENT_HANDOFF:"Connettersi con un agente",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Seleziona un'opzione per continuare",BUTTON__CANCEL:"Annulla",BUTTON__SAVE:"Salva",BUTTON__OK:"OK",BUTTON__SUBMIT:"Invia",NO_NAME:"(Senza nome)",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",CONVERSATION_CLOSED_FOOTER_LABEL:"La tua conversazione è terminata",START_NEW_CONVERSATION:"💬 Inizia una nuova conversazione",RETURN_TO_CONVERSATION:"💬 Torna alla conversazione",CONVERSATION_LIST__TOPICS_FALLBACK:"Nessuna categoria",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"},s={language:o.language,dateLocale:o.dateLocale,stringSet:t};exports.default=s;
@@ -1,4 +1,4 @@
1
- "use strict";var Jr=Object.defineProperty;var Qr=(e,t,n)=>t in e?Jr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var F=(e,t,n)=>Qr(e,typeof t!="symbol"?t+"":t,n);const d=require("react"),K=require("@sendbird/chat"),A=require("styled-components"),xe=require("date-fns"),eo=require("date-fns/locale/en-US"),z=require("@sendbird/chat/aiAgent"),Fe=require("@sendbird/uikit-tools"),Te=require("@sendbird/chat/message"),nt=require("@sendbird/chat/groupChannel"),to=require("react-dom"),kt=require("@sendbird/react-uikit-message-template-view"),no=require("@sendbird/uikit-message-template"),ro=require("dompurify"),oo=require("date-fns/isSameDay"),so=require("@emotion/is-prop-valid"),it=e=>e&&e.__esModule?e:{default:e};function ao(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 o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const r=ao(d),io=it(K),f=it(A),Wn=it(ro),lo=it(so),Z=(e,t)=>{const n=d.createContext(null),o=({children:i,value:l})=>r.createElement(n.Provider,{value:l},typeof i=="function"?i(l):i),s=({children:i})=>r.createElement(n.Consumer,null,l=>l?typeof i=="function"?i(l):i:null),a=()=>{const i=d.useContext(n);if(!i)throw new Error(`use${e}Context must be used within a ${e}Provider`);return i};return n.displayName=`${e}Context`,o.displayName=`${e}Provider`,s.displayName=`${e}Consumer`,a.displayName=`use${e}Context`,{Context:n,Provider:o,Consumer:s,useContext:a}};function ke(e){const t=d.createContext({Template:e.template,updateTemplate:()=>{},components:e.components,updateComponent:()=>{}});function n({children:a}){const[i,l]=d.useState(()=>e.template),[c,u]=d.useState(e.components),g={Template:i,updateTemplate:p=>l(()=>p),components:c,updateComponent:(p,x)=>u(C=>({...C,[p]:x}))};return r.createElement(t.Provider,{value:g},a)}function o({template:a,children:i}){const{updateTemplate:l}=d.useContext(t);return d.useLayoutEffect(()=>{a&&l(a)},[a]),r.createElement(r.Fragment,null,i)}function s({children:a}){return r.createElement(n,null,a)}return s.defaults=e,s.useContext=()=>d.useContext(t),s.Context=t,s.Template=o,Object.keys(e.components).forEach(a=>{s[a]=function({component:l}){const{updateComponent:c}=d.useContext(t);return d.useLayoutEffect(()=>{l&&c(a,l)},[l]),null}}),s}function co(...e){return function({children:n}){return e.reduce((o,s)=>r.createElement(s,null,o),n)}}const ve=e=>{var t,n;return!!(e!=null&&e.isAIAgent&&((t=e==null?void 0:e.conversation)==null?void 0:t.status)===z.ConversationStatus.CLOSED||e!=null&&e.isDesk&&((n=e==null?void 0:e.helpdeskInfo)==null?void 0:n.ticketStatus)==="closed")},It=e=>{var t,n;return!!(e!=null&&e.isAIAgent&&((t=e==null?void 0:e.conversation)==null?void 0:t.status)===z.ConversationStatus.OPEN||e!=null&&e.isDesk&&((n=e==null?void 0:e.helpdeskInfo)==null?void 0:n.ticketStatus)==="open")};function Ne(e){var n,o,s;return typeof(((n=e==null?void 0:e.conversation)==null?void 0:n.handedOverAt)??((s=(o=e==null?void 0:e.conversation)==null?void 0:o.handoff)==null?void 0:s.timestamp))=="number"}function uo(e){var t;if(((t=e==null?void 0:e.resolution)==null?void 0:t.determinedBy)==="user")return e.resolution.isResolved}function un(e){return!!e&&e<Date.now()}function mo(e){return!e.title}function go(e,t){var n;if(e)return mo(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 ho(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 fo(e,t,n){var i;const o=new Date,s=new Date(((i=e.lastMessage)==null?void 0:i.createdAt)||e.createdAt),a=xe.differenceInMinutes(o,s);return a<1?n.justNow:a<60?n.minutesAgo(a):xe.isToday(s)?n.hoursAgo(xe.differenceInHours(o,s)):t(s,n.dateShortFormat)}const po="1.9.1",De="sb-agent",bo=po,qn="KEY_IMG_ASPECT_RATIO",Eo="*/*",N={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},ue=e=>!!e&&"sender"in e,xo=e=>ue(e)?e.sendingStatus==="succeeded"?String(e.messageId):e.reqId:String(e.messageId),vo=(e,t,n,o=!0)=>{if(!o||!ue(e))return"single";const s=()=>{if(!t||!ue(t))return!1;const c=t.sender.userId===e.sender.userId,u=xe.isSameMinute(t.createdAt,e.createdAt);return c&&u},a=()=>{if(!n||!ue(n))return!1;const c=n.sender.userId===e.sender.userId,u=xe.isSameMinute(n.createdAt,e.createdAt);return c&&u},i=s(),l=a();return i&&l?"middle":i?"bottom":l?"top":"single"},Pe=(e,t)=>(()=>{var o;return ue(e)?e.sender.userId:((o=e==null?void 0:e.sender)==null?void 0:o.userId)??void 0})()===t,Le={isAdmin:e=>e.isAdminMessage(),isCSAT:e=>{var t;return e.isAdminMessage()&&!!((t=e.extendedMessagePayload)!=null&&t.csat)},isIncoming:(e,t)=>ue(e)&&e.sender.userId!==t,isOutgoing:(e,t)=>ue(e)&&(e.sender.userId===t||e.sendingStatus===Te.SendingStatus.PENDING)},jn=e=>e.startsWith("image/"),Kn=e=>e.startsWith("video/"),Vt=(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"},Zn=e=>e.messageType==="file"?e.message.length>0&&e.file.name!==e.message:e.message.length>0,Gt=e=>{switch(e){case"top":case"middle":return N.GAP_GROUPED;default:return N.GAP_UNGROUPED}},yo=(e,t)=>{const n=/```(\w+)?\n([\s\S]*?)```/g,o=[];let s=0;return e.replace(n,(a,...i)=>{const[l,c,u]=i;return s<u&&o.push({type:"text",value:e.slice(s,u).trim()}),o.push({type:"code",value:c.trim(),language:l?l.trim():"plaintext"}),s=u+a.length,a}),s<e.length&&o.push({type:"text",value:e.slice(s).trim()}),t?o.map(a=>a.type!=="text"?a:{...a,value:t(a.value)}):o},Co=e=>e.replace(/\[([^\]]+)\](?!\()/g,"\\[$1\\]"),_o=e=>e.replace(/([a-zA-Z0-9])_(?=[a-zA-Z0-9])/g,"$1\\_"),So=e=>e.replace(/~~/g,"\\~\\~"),To=e=>{let t=e;return t=Co(t),t=_o(t),t=So(t),t},Ao=typeof navigator<"u"&&navigator.product==="ReactNative",mn=(e,t)=>{const n=o=>!t||t.length===0?!0:ue(o)&&t.includes(o.sendingStatus);return Ao?e.find(n):e.findLast(n)};function ye(){}function wo(){const e=typeof navigator<"u"?navigator.userAgent:"",t=/iPad|iPhone|iPod/.test(e),n=/Android/.test(e);return t||n}function ko(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 $t=e=>{try{return JSON.parse(e===""?"{}":e)}catch{return{}}},me={isStreaming(e){const t=$t(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(Pe(e,t)){const o=$t(e.data);return!(o!=null&&o.respond_mesg_id)&&!(o!=null&&o.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)},checkExtendedFieldPresence(e){const t=e.extendedMessagePayload||{},n=i=>i.some(l=>typeof t[l]<"u"),o=n(vt.ui),s=n(vt.trail),a=n(vt.marking);return{ui:o,trail:s,marking:a}},shouldScrollToBottom(e,t,n=!1){if(Pe(e,t)){if(this.isGeneratedMessage(e)&&this.isStreaming(e))return!0;const{ui:o,trail:s,marking:a}=this.checkExtendedFieldPresence(e);return o?!(!n&&a):!!(n&&(s||a))}return!0}},vt={ui:["suggested_replies","cta_button","message_template","csat"],trail:["groundedness","manual","function_calls"],marking:["is_hallucination","is_moderated","flagged_types"]},yt=`@${De}`,gn=({appId:e,aiAgentId:t,storage:n})=>{const o={templateBase:`${yt}-template`,template:s=>`${o.templateBase}/templates/${s}`,templateToken:()=>`${o.templateBase}-template/message-template/tokens`,messengerSession:s=>{const a=ko(`${e}/${t}/${s}`);return`${yt}-udata/${a}`},anonUserSession:()=>`${yt}-session/${e}/${t}`};return{template:{set:(s,a)=>n.set(o.template(s),a),get:s=>n.get(o.template(s)),setCachedToken:s=>n.set(o.templateToken(),s),getCachedToken:()=>n.get(o.templateToken()),clear:()=>{n.getKeys(o.templateBase).forEach(n.delete)}},messenger:{getSettings:s=>{try{const a=n.get(o.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(o.messengerSession(s),i)}catch{return}},getAnonUser:()=>{try{const s=n.get(o.anonUserSession());return s?JSON.parse(s):null}catch{return null}},setAnonUser:s=>{try{const a=JSON.stringify(s);n.set(o.anonUserSession(),a)}catch{return}},clear:s=>{try{s&&n.delete(o.messengerSession(s)),n.delete(o.anonUserSession())}catch{return}}}}};class Yn{constructor(t){F(this,"subscribers",{});this.logger=t}async send(t){const n=Io(),o=this.subscribers[t.type];if(o){this.logger.debug(`messenger.dispatcher: dispatching command: ${t.type}`,t.payload);const s=o.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(o=>o!==n))}}const Io=()=>{let e=ye,t=ye;return{promise:new Promise((o,s)=>{e=o,t=s}),resolve:e,reject:t}};var Wt=(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))(Wt||{});class Xn{constructor(t){F(this,"level");this.level=t}verbose(...t){this.level<=0&&console.log(`[${De}/verbose]`,...t)}debug(...t){this.level<=1&&console.log(`[${De}/debug]`,...t)}info(...t){this.level<=2&&console.log(`[${De}/info]`,...t)}warn(...t){this.level<=3&&console.warn(`[${De}/warn]`,...t)}error(...t){this.level<=4&&console.error(`[${De}/error]`,...t)}}function hn(e,t,n){const o=io.default.init({appId:e,modules:[new nt.GroupChannelModule,new z.AIAgentModule],localCacheEnabled:!0,options:new K.SendbirdChatOptions({typingIndicatorInvalidateTime:2e4}),...n});return o.addSendbirdExtensions([{version:bo,product:K.SendbirdProduct.AI_AGENT,platform:t.platform}],{platform:t.deviceOSPlatform,version:t.deviceOSVersion},t.customData)||console.warn("Invalid Sendbird Extensions",t),o}function $o(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 Oe={conversation:{isTalkToAgentViewEnabled:!0,input:{camera:{photoEnabled:!0},gallery:{photoEnabled:!0},fileEnabled:!0}}},fn=e=>{var t,n,o,s,a,i,l,c,u,g;return e?{...Oe,...e,conversation:{...Oe.conversation,...e==null?void 0:e.conversation,input:{...(t=Oe.conversation)==null?void 0:t.input,...(n=e==null?void 0:e.conversation)==null?void 0:n.input,camera:{...(s=(o=Oe.conversation)==null?void 0:o.input)==null?void 0:s.camera,...(i=(a=e==null?void 0:e.conversation)==null?void 0:a.input)==null?void 0:i.camera},gallery:{...(c=(l=Oe.conversation)==null?void 0:l.input)==null?void 0:c.gallery,...(g=(u=e==null?void 0:e.conversation)==null?void 0:u.input)==null?void 0:g.gallery}}}}:Oe},{Provider:Mo,useContext:W}=Z("AIAgent");function Lo({appId:e,aiAgentId:t,keyValueStorage:n,language:o,countryCode:s,context:a,queryParams:i,config:l,chatSDK:c,chatParams:u,children:g,logger:p,dispatcher:x,extensions:C={platform:K.SendbirdPlatform.JS,deviceOSPlatform:wo()?K.DeviceOsPlatform.MOBILE_WEB:K.DeviceOsPlatform.WEB}}){const[v,E]=d.useState(()=>{const b=p??new Xn(Wt.WARN),h=x??new Yn(b);return{appId:e,aiAgentId:t,language:o,countryCode:s,context:a,queryParams:i,config:fn(l),keyValueStorage:n,logger:b,dispatcher:h,chatSDK:c??hn(e,C,u),cache:gn({appId:e,aiAgentId:t,storage:n})}});return d.useEffect(()=>{E(b=>{let h=b.logger,y=b.dispatcher,_=b.chatSDK;return p&&p!==b.logger&&(h=p),x&&x!==b.dispatcher&&(y=x),c&&c!==b.chatSDK?_=c:!c&&b.chatSDK.appId!==e&&(_=hn(e,C,{newInstance:!0,...u})),{...b,appId:e,aiAgentId:t,keyValueStorage:n,language:o,countryCode:s,context:a,queryParams:i,config:fn(l),logger:h,dispatcher:y,chatSDK:_,cache:gn({appId:e,aiAgentId:t,storage:n})}})},[e,t,o,s,a,l,p,x,c]),d.useEffect(()=>()=>{v.chatSDK.disconnectWebSocket()},[v.chatSDK]),$o(v.chatSDK),r.createElement(Mo,{value:v},g)}const Oo=(e,t,n)=>Fe.useGroupChannelMessages(e,t,{...n,strictStreamingOrder:!0});var Mt=(e=>(e.ConversationClose="conv.close",e))(Mt||{});class Do{constructor(t={}){F(this,"payload");this.payload=t}toJSON(){return JSON.stringify({type:this.type,payload:this.payload})}}const Jn={CloseConversation:e=>new Ro(e)};class Ro extends Do{constructor(){super(...arguments);F(this,"type","conv.close")}}const Lt={DEFAULT_BOT_MSG_BG:"#eeeeee",WHITE:"#ffffff",BLACK:"#000000"};function Qn(e){return e.length===4?`#${[...e.slice(1)].map(t=>t+t).join("")}`:e}function No(e){const t=Qn(e);return[parseInt(t.slice(1,3),16),parseInt(t.slice(3,5),16),parseInt(t.slice(5,7),16)]}function Po(e){return`#${e.map(t=>t.toString(16).padStart(2,"0")).join("")}`}function Bo(e,t,n){e/=255,t/=255,n/=255;const o=Math.max(e,t,n),s=Math.min(e,t,n),a=o-s;let i=0,l=0;const c=(o+s)/2;return o!==s&&(l=c>.5?a/(2-o-s):a/(o+s)),o===e?i=(t-n)/a+(t<n?6:0):o===t?i=(n-e)/a+2:o===n&&(i=(e-t)/a+4),i/=6,[i,l,c]}function Fo(e,t,n){let o,s,a;if(t===0)o=s=a=n;else{const i=function(g,p,x){return x<0&&(x+=1),x>1&&(x-=1),x<.16666666666666666?g+(p-g)*6*x:x<.5?p:x<.6666666666666666?g+(p-g)*(.6666666666666666-x)*6:g},l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;o=i(c,l,e+1/3),s=i(c,l,e),a=i(c,l,e-1/3)}return[Math.round(o*255),Math.round(s*255),Math.round(a*255)]}function Ke(e,t,n){const[o,s,a]=No(e),[i,l,c]=Bo(o,s,a),u=Math.max(0,Math.min(1,c*t)),g=Math.max(0,Math.min(1,l*n)),[p,x,C]=Fo(i,g,u);return Po([Math.round(p),Math.round(x),Math.round(C)])}function Uo(e,t="light"){return{extraDark:Ke(e,.6,1.2),dark:Ke(e,.85,1.1),main:e,light:Ke(e,t==="dark"?1.1:1.5,t==="dark"?.95:.9),extraLight:Ke(e,t==="dark"?1.2:1.75,t==="dark"?.9:.8)}}function Ot(e){const t=Qn(e),n=149,o=+`0x${t[1]}${t[2]}`,s=+`0x${t[3]}${t[4]}`,a=+`0x${t[5]}${t[6]}`;return o*.299+s*.587+a*.114>n?Lt.BLACK:Lt.WHITE}function Ho(e,t,n,o,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:o},messageOutgoing:{text:n,background:t},csat:{background:e.background100}}}const zo=(e,t,n,o,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:o},messageOutgoing:{text:n,background:t},csat:{background:e.background400}}),Ze={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)"}},Ct={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 pn(e){const t=Vo(e),{colors:n,aiAgentColorVariables:o}=Go(e,t),s=qo(e);return{selectedTheme:e.selectedTheme,palette:t,colors:n,aiAgentColorVariables:o,typography:s}}function Vo({selectedTheme:e,palette:t,primary:n}){const o=t!=null&&t.primary?t.primary:n?n===Ze.primary.main?Ze.primary:Uo(n,e):Ze.primary;return{...Ze,primary:o,...t}}function Go({selectedTheme:e,primaryContrast:t,botMessageBackground:n,botMessageBackgroundContrast:o},s){const a=s.primary.main,i=t??Ot(a),l=n??Lt.DEFAULT_BOT_MSG_BG,c=o??Ot(l);return{colors:(e==="light"?Ho:zo)(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 Wo(e,t,n){const o={...e};return n.forEach(s=>{const a=t[s];a!=null&&(o[s]=a)}),o}function qo({typography:e}){if(!e)return Ct;const t={...Ct};return Object.keys(e).forEach(n=>{const o=e[n];if(o&&typeof o=="object"){const s=Ct[n],a=["fontSize","fontWeight","fontFamily","lineHeight"];t[n]=Wo(s,o,a)}}),t}const{Provider:jo,useContext:qt}=Z("AIAgentTheme");function Ko({logger:e,palette:t,typography:n,appearance:o,children:s}){const a=d.useRef(null),[i,l]=d.useState(()=>pn({selectedTheme:(o==null?void 0:o.theme)??"light",palette:t,typography:n,primary:o==null?void 0:o.primaryColor,botMessageBackground:o==null?void 0:o.botMessageBackgroundColor})),c=d.useCallback((u,g)=>{g&&(a.current=g);const p=(o==null?void 0:o.theme)??u,x=a.current?a.current.themes[p]:null,C={primary:o==null?void 0:o.primaryColor,primaryContrast:void 0,botMessageBackground:o==null?void 0:o.botMessageBackgroundColor,botMessageBackgroundContrast:void 0};!C.primary&&(x!=null&&x.primary_color)&&(C.primary=x.primary_color,C.primaryContrast=x.primary_contrast_color),!C.botMessageBackground&&(x!=null&&x.bot_message_bg_color)&&(C.botMessageBackground=x.bot_message_bg_color,C.botMessageBackgroundContrast=x.bot_message_bg_contrast_color);const v=pn({selectedTheme:p,palette:t,typography:n,...C});l(v),e==null||e.info("theme.update:",p)},[o==null?void 0:o.theme,o==null?void 0:o.primaryColor,o==null?void 0:o.botMessageBackgroundColor,t,n,e]);return d.useEffect(()=>{(o!=null&&o.theme||o!=null&&o.primaryColor||o!=null&&o.botMessageBackgroundColor)&&c(i.selectedTheme)},[o==null?void 0:o.theme,o==null?void 0:o.primaryColor,o==null?void 0:o.botMessageBackgroundColor]),r.createElement(jo,{value:{theme:i,updateTheme:c}},s)}const bn=25*1024*1024,Zo={off:"off",always:"always",handed_off_only:"handed_off_only"},Yo=()=>{const[e,t]=d.useState(()=>({maxAttachmentCount:1,attachmentMode:"handed_off_only",defaultUploadSizeLimit:bn,uploadSizeLimitPerType:new Map,supportedImageMimeTypes:new Set(["image/png","image/jpeg","image/jpg"]),supportedFileMimeTypes:new Set(["application/pdf"])})),n=d.useCallback(({active_channel:s,upload_restriction:a})=>{const{maxAttachmentCount:i,attachmentMode:l,defaultUploadSizeLimit:c,supportedImageMimeTypes:u,supportedFileMimeTypes:g}=e;t({maxAttachmentCount:i,attachmentMode:Zo[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)??u),supportedFileMimeTypes:new Set((a==null?void 0:a.supported_file_mime_types)??g)})},[]),o=d.useCallback(s=>{const{channel:a,uploadSizeLimit:i=bn}=s,l=(u=!0)=>a!=null&&a.isAIAgent?u?Ne(a):!1:!0,c=u=>{if(l())return e.defaultUploadSizeLimit??i;const g=e.defaultUploadSizeLimit??i,p=e.uploadSizeLimitPerType.get(u)??g;return Math.min(g,p)};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 Ne(a);default:return!0}},get supportedMimeTypes(){return l()?[Eo]:[...e.supportedImageMimeTypes,...e.supportedFileMimeTypes]},isSupportedMimeType:u=>l()?!0:e.supportedImageMimeTypes.has(u)||e.supportedFileMimeTypes.has(u),getUploadSizeLimit:c,getUploadSizeLimitInMB:u=>c(u)/(1024*1024)}},[e]);return{updateBaseAttachmentRules:n,createAttachmentRules:o}};function er(){const{chatSDK:e,logger:t}=W();return d.useCallback(async n=>{if(n.userId===""){const o=new Error("userId cannot be empty string for messenger settings request");throw t.error("requestMessengerSettings: invalid userId",o),o}return await e.aiAgent.requestMessengerSettings(n)},[e,t])}function Xo(){const{chatSDK:e,logger:t}=W(),n=d.useCallback(async(s,a,i)=>{if(t.debug("useChatConnection.connect: start, session",s.userId),a){const l=new K.SessionHandler({...a,onSessionTokenRequired:Jo(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(es(c))t.warn("useChatConnection.connect","offline connect restricted",c.message,c.code),t.warn("useChatConnection.connect","clear cached-data"),await e.clearCachedData().catch(u=>t.warn("useChatConnection.connect","clear cached-data failure",u));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]),o=d.useCallback(async()=>{t.debug("useChatConnection.disconnect: start"),await e.disconnect(),t.debug("useChatConnection.disconnect: end")},[e,t]);return{connect:n,disconnect:o}}function Jo(e,t){if(e)return async(n,o)=>{new Promise((s,a)=>e==null?void 0:e(s,a)).then(s=>{s&&(t==null||t(s)),n(s)}).catch(s=>{o(s)})}}const Qo=[400300,400301,400302,400310];function es(e){return Qo.some(t=>e.code===t)}class tr{constructor({userId:t,authToken:n,sessionHandler:o}){F(this,"userId");F(this,"authToken");F(this,"sessionHandler");this.userId=t,this.authToken=n,this.sessionHandler=o}}class Dt{constructor(){F(this,"userId");F(this,"authToken");F(this,"sessionHandler")}}const ts=24*60*60*1e3,ns=e=>{const{logger:t,cache:n}=W(),o=()=>{const a=n.messenger.getAnonUser();return a?a.expireAt-ts<=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 Dt)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 d.useMemo(()=>e instanceof tr?{type:"manual",userSessionCandidate:s()}:e instanceof Dt?{type:"anonymous",userSessionCandidate:o()}: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:o()}):{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 rs({userSessionInfo:e,onUpdateMessengerSettings:t,onPreAuth:n,onPostAuth:o,onErrorAuth:s,onAuthTokenRefreshed:a,onPostDeauth:i,forceCreateChannel:l}){const{aiAgentId:c,language:u,context:g,countryCode:p,logger:x,cache:C}=W(),{connect:v,disconnect:E}=Xo(),{type:b,userSessionCandidate:h}=ns(e),y=er(),_=d.useCallback(async()=>{var R;x.debug("useAuthentication.authenticate: start");const S=h!=null&&h.userId?C.messenger.getSettings(h.userId):null;S!=null&&S.bot&&(t(S),x.debug("useAuthentication.authenticate: cached messenger settings",S));const k=await y({aiAgentId:c,userId:h==null?void 0:h.userId,language:u,country:p,context:g,forceCreateChannel:l,knownActiveChannelUrl:(R=S==null?void 0:S.active_channel)==null?void 0:R.channel_url});x.debug("useAuthentication.authenticate: messenger settings response",k);let $=null;if(k.auto_created_user)if(b==="manual")x.warn("Received auto created user info but current session is manual. Ignoring auto created user info."),$={userId:h.userId,authToken:h.authToken};else{const{user_id:X,session_token:J,expire_at:se}=k.auto_created_user;C.messenger.setAnonUser({userId:X,authToken:J,expireAt:se}),$={userId:X,authToken:J}}else $={userId:(h==null?void 0:h.userId)??"",authToken:(h==null?void 0:h.authToken)??""};C.messenger.setSettings($.userId,k),t(k);try{await n(k,$),await v($,h==null?void 0:h.sessionHandler,a),await o(k,$)}catch(X){throw X instanceof Error&&(s(X),x.error("useAuthentication.authenticate: failed to connect",X)),X}return k},[y,v,b,h==null?void 0:h.userId,h==null?void 0:h.sessionHandler,h==null?void 0:h.authToken,C.messenger.setAnonUser,C.messenger.getSettings,C.messenger.setSettings,t,n,o,s,a]),M=d.useCallback(async()=>{x.debug("useAuthentication.deauthenticate: start"),await E(),i(),x.debug("useAuthentication.deauthenticate: completed")},[E,x,i]);return{authenticate:_,deauthenticate:M,userSessionCandidate:h}}const nr=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)}},Ve=e=>JSON.parse(e),lt=e=>JSON.parse(e);function os(e,t){const[n,o]=t.split(",").map(s=>s.trim());return e==="dark"&&o||n}function ss(e){const t={};function n(o,s=""){for(const[a,i]of Object.entries(o)){const l=s?`${s}.${a}`:a;i&&typeof i=="object"&&!Array.isArray(i)?n(i,l):t[l]=i}}return n(e),t}function jt({template:e,variables:t,variableKeyPattern:n,variableValueTransformer:o}){return Object.entries(t).reduce((s,[a,i])=>{if(!o&&!["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=o?o(i):String(i),c=n(a);return s.replace(c,nr(l))},e)}async function as({template:e,variables:t,variableKeyPattern:n,variableValueTransformer:o}){return(await Promise.all(Object.entries(t).map(async([a,i])=>{const l=await o(i);return{regex:n(a),transformedValue:l}}))).reduce((a,{regex:i,transformedValue:l})=>a.replace(i,nr(l)),e)}const is=()=>{const{chatSDK:e,logger:t,cache:n}=W(),o=d.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=d.useCallback(async()=>{try{const{templates:a,token:i}=await e.aiAgent.getMessageTemplates({limit:20});for(const{template:l}of a){const{key:c}=Ve(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:o,syncCachedTemplates:s}},{Provider:ls,useContext:ct}=Z("AIAgentMessengerSession"),cs=d.forwardRef(function({userSessionInfo:e,forceCreateChannel:t,children:n},o){const{appId:s,aiAgentId:a,chatSDK:i,language:l,countryCode:c,context:u,cache:g,logger:p}=W(),{updateTheme:x}=qt(),[C,v]=d.useState(void 0),[E,b]=d.useState(void 0),[h,y]=d.useState(null),[_,M]=d.useState(null),[S,k]=d.useState(null),[$,R]=d.useState(null),{updateBaseAttachmentRules:X,createAttachmentRules:J}=Yo(),{shouldSyncCachedTemplate:se,syncCachedTemplates:he}=is(),fe=er(),{authenticate:Se,deauthenticate:V}=rs({userSessionInfo:e,forceCreateChannel:t,onUpdateMessengerSettings:d.useCallback(P=>{const{appearance:T,bot:O,launcher:H}=P;x(T.selected_theme,T),k({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:P.bot.is_user_feedback_enabled??!1,isUserFeedbackCommentOptionEnabled:P.bot.is_user_feedback_comment_option_enabled??!1}),R({type:H.image_type||"default_icon",imageUrl:H.image_url}),X(P)},[x]),onPreAuth:d.useCallback((P,T)=>{v(void 0),M(T)},[]),onPostAuth:d.useCallback(async P=>{y(i.currentUser),se()&&await he(),b({url:P.active_channel.channel_url,status:z.ConversationStatus.OPEN})},[i,se,he]),onErrorAuth:d.useCallback(P=>{v(P)},[]),onAuthTokenRefreshed:d.useCallback(P=>{M(T=>T?{...T,authToken:P}:null)},[]),onPostDeauth:d.useCallback(()=>{g.template.clear(),g.messenger.clear(_==null?void 0:_.userId),y(null),b(void 0),M(null),k(null),R(null)},[g.template.clear,g.messenger.clear,_])}),w=d.useCallback(async()=>{var P;if(_){p.debug("agentMessengerSession.refreshActiveChannel: try to refresh active channel"),b(void 0);const T=await fe({aiAgentId:a,userId:_.userId,language:l,country:c,context:u,forceCreateChannel:t,knownActiveChannelUrl:(P=g.messenger.getSettings(_.userId))==null?void 0:P.active_channel.channel_url});return g.messenger.setSettings(_.userId,T),b({url:T.active_channel.channel_url,status:z.ConversationStatus.OPEN}),p.info("agentMessengerSession.refreshActiveChannel: refreshed active channel",T.active_channel.channel_url),T.active_channel.channel_url}else throw p.error("agentMessengerSession.refreshActiveChannel: userSession is not ready"),new Error("userSession is not ready")},[fe,s,a,_==null?void 0:_.userId,l,c,u,t,g.messenger.getSettings,g.messenger.setSettings]),ae=d.useCallback(async P=>{if(!(_!=null&&_.userId))throw new Error("Current user is not authenticated. Please authenticate first.");const T=await fe({...P,userId:_.userId,knownActiveChannelUrl:void 0}),O=T.active_channel.channel_url;return g.messenger.setSettings(_.userId,T),O},[_==null?void 0:_.userId,fe]);return Fe.useGroupChannelHandler(i,{onChannelChanged:P=>{var T;P.isGroupChannel()&&P.url===(E==null?void 0:E.url)&&(p.info("agentMessengerSession.channelChanged: channel.conversation",P.conversation),b({url:P.url,status:((T=P.conversation)==null?void 0:T.status)??z.ConversationStatus.OPEN}))}}),d.useImperativeHandle(o,()=>{const P=async()=>{if(!E)throw new Error("No active conversation. Please start a conversation first.");return await i.groupChannel.getChannel(E.url)};return{activeChannel:E,chatSDK:i,authenticate:Se,deauthenticate:V,updateContext:async T=>{const H=await(await P()).updateContext(a,T);return{...H,context:H.context??{}}},patchContext:async T=>{const H=await(await P()).patchContext(a,T);return{...H,context:H.context??{}}},getContextObject:async()=>{const O=await(await P()).getContextObject(a);return{...O,context:O.context??{}}}}},[Se,V,E,i,a,p]),r.createElement(ls,{value:{sdkUser:h,userSessionInfo:e,userSession:_,activeChannel:E,setActiveChannel:b,refreshActiveChannel:w,createConversation:ae,connectionError:C,aiAgentInfo:S,launcherInfo:$,authenticate:Se,deauthenticate:V,createAttachmentRules:J}},n)}),rr=e=>{const{chatSDK:t}=W(),[n,o]=d.useState([]);return Fe.useGroupChannelHandler(t,{onTypingStatusUpdated(s){if(s.url===(e==null?void 0:e.url)){const a=s.getTypingUsers();o(a)}}}),n},ds=({channel:e,messages:t})=>{const{aiAgentInfo:n,userSession:o}=ct(),s=us(),a=ms({channel:e,lastMessage:mn(t,[Te.SendingStatus.SUCCEEDED]),aiAgentUserId:(n==null?void 0:n.userId)??""}),i=ps({shouldApply:!!(e!=null&&e.isAIAgent)&&!Ne(e),isDisabledWhileAIResponding:a,lastMessage:mn(t,[Te.SendingStatus.PENDING,Te.SendingStatus.SUCCEEDED]),currentUserId:(o==null?void 0:o.userId)??""});if(!e||!s)return{disabled:!0,disabledBy:"unavailable"};if(ve(e))return{disabled:!0,disabledBy:"conversation_closed"};if(gs(e))return{disabled:!0,disabledBy:"form_active"};const l=hs(e);return l?{disabled:!0,disabledBy:l}:a||i?{disabled:!0,disabledBy:"ai_responding"}:{disabled:!1,disabledBy:""}},us=()=>{const e=d.useId(),{chatSDK:t}=W(),[n,o]=d.useState(!0);return d.useEffect(()=>{const s=new K.ConnectionHandler({onDisconnected:()=>o(!1),onConnected:()=>o(!0),onReconnectSucceeded:()=>o(!0)});return t.addConnectionHandler(e,s),()=>{t.removeConnectionHandler(e)}},[t]),n},ms=({channel:e,lastMessage:t,aiAgentUserId:n})=>{const[o,s]=d.useState(!1),a=rr(e);return d.useEffect(()=>{if(!t)return;const i=a.some(c=>c.userId===n),l=Pe(t,n)&&me.isStreaming(t);s(!!(l||i))},[a,t,n]),o},gs=e=>{var i;const t=e==null?void 0:e.lastMessage;if(!t||!e)return!1;const n=t.extendedMessagePayload,o=n==null?void 0:n.form,s=o&&!o.submitted_at&&!o.canceled_at,a=e.isAIAgent&&!!((i=e.conversation)!=null&&i.handedOverAt);return s&&!a},hs=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},fs=3e4,ps=({shouldApply:e,lastMessage:t,isDisabledWhileAIResponding:n,currentUserId:o})=>{const[s,a]=d.useState(!1),i=d.useRef(null),l=t&&Pe(t,o)?t.createdAt:0;return d.useEffect(()=>{const c=()=>{i.current&&(clearTimeout(i.current),i.current=null),a(!1)},u=x=>{i.current&&clearTimeout(i.current),a(!0),i.current=setTimeout(()=>{a(!1),i.current=null},x)},g=Date.now()-l,p=fs-g;return n||p<=0?c():u(p),()=>{i.current&&clearTimeout(i.current)}},[n,l]),s&&e},{Provider:bs}=Z("AIAgentConversation");function Es({children:e,channelUrl:t,onChannelDeleted:n,onMessagesReceived:o,onMessagesUpdated:s,onConversationClosedViaDispatcher:a,onBeforeSendMessage:i,onAfterSendMessage:l=ye,shouldMarkAsRead:c=!0,sortComparator:u}){var M;const g=()=>c&&(v==null?void 0:v.markAsRead()),{chatSDK:p,logger:x,dispatcher:C}=W(),{channel:v,channelFetchError:E,fetchChannel:b}=xs(t),h=Oo(p,v,{shouldCountNewMessages:()=>!1,onChannelDeleted:n,onMessagesReceived:S=>o==null?void 0:o(S),onMessagesUpdated:S=>s==null?void 0:s(S),logger:x,markAsRead:g,sortComparator:u}),y=ds({channel:v,messages:h.messages});d.useEffect(()=>{g()},[c]),d.useEffect(()=>{const S=async k=>{const $=typeof(k==null?void 0:k.channelUrl)=="string";v&&$&&k.channelUrl!==v.url||(x.debug("conversation.dispatcher: try to close conversation",v),v!=null&&v.conversation&&v.conversation.status===z.ConversationStatus.OPEN&&(await v.closeConversation(),a==null||a()))};return C.subscribe(Mt.ConversationClose,S),()=>{C.unsubscribe(Mt.ConversationClose,S)}},[C,(M=v==null?void 0:v.conversation)==null?void 0:M.status,a]);const _={conversation:(v==null?void 0:v.conversation)??void 0,channelSource:{channel:v,error:E,refetch:()=>b(),closeConversation:async()=>{ve(v)||await(v==null?void 0:v.closeConversation())}},messageSource:{messages:h.messages,initialized:h.initialized,loadPrevious:()=>h.loadPrevious(),loadNext:()=>h.loadNext(),deleteMessage:S=>h.deleteMessage(S),resendMessage:S=>h.resendMessage(S),sendUserMessage:async S=>{var $;if((($=v==null?void 0:v.conversation)==null?void 0:$.status)===z.ConversationStatus.CLOSED)throw new Error("Conversation is closed");i&&(S=await i(S));const k=await h.sendUserMessage(S,l);return l==null||l(k),k},sendFileMessage:async S=>{var $;if((($=v==null?void 0:v.conversation)==null?void 0:$.status)===z.ConversationStatus.CLOSED)throw new Error("Conversation is closed");i&&(S=await i(S));const k=await h.sendFileMessage(S,l);return l==null||l(k),k}},state:{input:y}};return r.createElement(bs,{value:_},e)}function xs(e){const{chatSDK:t,logger:n}=W(),{sdkUser:o}=ct(),[s,a]=d.useState(void 0),[i,l]=d.useState(void 0);async function c(){if(!o){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 u=await t.groupChannel.getChannel(e);a(u),n.debug("conversation.fetchChannel: fetched channel",u)}catch(u){u instanceof K.SendbirdError&&l(u),n.error("conversation.fetchChannel: error",u)}}return vs(s),d.useEffect(()=>{c()},[t,o,e]),{channel:s,channelFetchError:i,fetchChannel:c}}function vs(e){const{chatSDK:t}=W(),{activeChannel:n,setActiveChannel:o}=ct(),s=d.useId();d.useEffect(()=>{if(!e||!n)return;const a=new K.ConnectionHandler({onReconnectSucceeded:async()=>{var l;const i=await e.refresh();i.url===n.url&&o({url:i.url,status:((l=i.conversation)==null?void 0:l.status)??z.ConversationStatus.OPEN})}});return t.addConnectionHandler(s,a),()=>{t.removeConnectionHandler(s)}},[t,e,n])}class ys{constructor(t,{filter:n,limit:o=20}){F(this,"filter");F(this,"_sdk");F(this,"_pinnedChannels");F(this,"_channels");F(this,"_isDisposed",!1);F(this,"_handlerId",`handler-id-${Date.now()}`);F(this,"_order",nt.GroupChannelListOrder.LATEST_LAST_MESSAGE);F(this,"_limit");F(this,"_query");F(this,"_token");F(this,"_timestamp");F(this,"_isSyncing");F(this,"_channelHandler");F(this,"_connectionHandler");F(this,"_collectionEventHandler");var s,a,i,l,c,u,g;this.filter=n,this._sdk=t,this._pinnedChannels=[],this._channels=[],this._limit=o,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:(u=this.filter)==null?void 0:u.copilotConversationOnly,copilotSupportChannelUrl:(g=this.filter)==null?void 0:g.copilotSupportChannelUrl,limit:this._limit}),this._token="",this._timestamp=Number.MAX_SAFE_INTEGER,this._isSyncing=!1,this._channelHandler=new nt.GroupChannelHandler({onChannelChanged:p=>{p.isGroupChannel()&&(this._query.belongsTo(p)?this._addChannelsToView([p],!1):this._removeChannelsFromView([p.url]))},onChannelDeleted:p=>{this._removeChannelsFromView([p])}}),this._connectionHandler=new K.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)??[]),o=t.find(l=>!n.has(l.url));let s;o?s=((i=o.lastMessage)==null?void 0:i.createdAt)??o.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)??[],o=new Map(n.map((c,u)=>[c,u])),s=[],a=[],i=[];for(const c of t){if(!this._query.belongsTo(c)){i.push(c.url);continue}const u=o.get(c.url);if(u===void 0)continue;const g=Rt(this._pinnedChannels,c);g>=0?(this._pinnedChannels.splice(g,1),a.push(c)):s.push(c);const x=this._pinnedChannels.findIndex(v=>(o.get(v.url)??1/0)>u),C=x===-1?this._pinnedChannels.length:x;this._pinnedChannels.splice(C,0,c)}return{addedChannels:s,updatedChannels:a,unmatchedChannelUrls:i}}_upsertRegularChannelsToArray(t,n=!1){const o=[],s=[],a=[];for(const i of t){if(!this._query.belongsTo(i)){o.push(i.url);continue}const l=Rt(this._channels,i),c=l<0;!c&&this._channels.splice(l,1);const g=Cs(this._channels,i,this._order).place,p=g===this._channels.length;c?p?(n||!this.hasMore)&&(this._channels.push(i),s.push(i)):(this._channels.splice(g,0,i),s.push(i)):(this._channels.splice(g,0,i),a.push(i))}return{addedChannels:s,updatedChannels:a,unmatchedChannelUrls:o}}_addChannelsToView(t,n=!1){var p,x,C,v,E;const o=new Set(((p=this.filter)==null?void 0:p.pinnedChannelUrls)??[]),s=[],a=[];for(const b of t)o.has(b.url)?s.push(b):a.push(b);const i=this._upsertPinnedChannelsToArray(s),l=this._upsertRegularChannelsToArray(a,n),c=i.addedChannels.concat(l.addedChannels),u=i.updatedChannels.concat(l.updatedChannels),g=i.unmatchedChannelUrls.concat(l.unmatchedChannelUrls);c.length>0&&((C=(x=this._collectionEventHandler)==null?void 0:x.onChannelsAdded)==null||C.call(x,{},c)),u.length>0&&((E=(v=this._collectionEventHandler)==null?void 0:v.onChannelsUpdated)==null||E.call(v,{},u)),g.length>0&&this._removeChannelsFromView(g)}_removeChannelsFromView(t){var s,a,i;const n=new Set(((s=this.filter)==null?void 0:s.pinnedChannelUrls)??[]),o=[];for(const l of t)if(n.has(l)){const c=this._pinnedChannels.findIndex(u=>u.url===l);c>=0&&(o.push(l),this._pinnedChannels.splice(c,1))}else{const c=this._channels.findIndex(u=>u.url===l);c>=0&&(o.push(l),this._channels.splice(c,1))}o.length>0&&((i=(a=this._collectionEventHandler)==null?void 0:a.onChannelsDeleted)==null||i.call(a,{},o))}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._collectionEventHandler=void 0,this._sdk.removeConnectionHandler(this._handlerId),this._sdk.groupChannel.removeGroupChannelHandler(this._handlerId),this._pinnedChannels.length=0,this._channels.length=0)}}const Rt=(e,t)=>e.findIndex(n=>n.isIdentical(t)),Cs=(e,t,n)=>{if(e.length>0){const o=Rt(e,t);let s=0,a=e.length-1,i=Math.floor((s+a)/2);for(;s<a;){const c=En(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:o}}return{place:En(e[i],t,n)>=0?i:i+1,oldPosition:o}}return{place:e.length,oldPosition:-1}},En=(e,t,n)=>{switch(n){case nt.GroupChannelListOrder.LATEST_LAST_MESSAGE:if(e.lastMessage&&t.lastMessage){const o=t.lastMessage.createdAt-e.lastMessage.createdAt;return o===0?t.createdAt-e.createdAt:o}else return e.lastMessage?-1:t.lastMessage?1:t.createdAt-e.createdAt;default:return 0}};function _s(e,t){var v,E,b,h,y,_,M,S,k,$;const n=d.useId(),[o,s]=d.useState(!1),[a,i]=d.useState(null),[l,c]=d.useState([]),[u,g]=d.useState(null),p=d.useRef(!1),x=d.useCallback(async()=>{if(!p.current&&e.currentUser){p.current=!0,s(!1),i(null),c([]);try{u==null||u.dispose();const R=new ys(e,t);R.setConversationListCollectionHandler({onChannelsAdded:()=>{c(R.channels)},onChannelsUpdated:()=>{c(R.channels)},onChannelsDeleted:()=>{c(R.channels)}}),await R.loadMore(),g(R),i(null)}catch(R){g(null),i(R)}finally{s(!0),p.current=!1}}},[e,e.currentUser,(v=t.filter)==null?void 0:v.aiAgentChannelFilter,(b=(E=t.filter)==null?void 0:E.aiAgentConversationStatusFilter)==null?void 0:b.join(),(y=(h=t.filter)==null?void 0:h.aiAgentIds)==null?void 0:y.join(),(_=t.filter)==null?void 0:_.deskChannelFilter,(S=(M=t.filter)==null?void 0:M.pinnedChannelUrls)==null?void 0:S.join(),(k=t.filter)==null?void 0:k.copilotConversationOnly,($=t.filter)==null?void 0:$.copilotSupportChannelUrl,t.limit]),C=d.useCallback(async()=>{if(u)try{await u.loadMore()}catch(R){i(R)}},[u]);return d.useEffect(()=>(e.addConnectionHandler(n,new K.ConnectionHandler({onConnected:()=>x()})),()=>e.removeConnectionHandler(n)),[e,n,x]),d.useEffect(()=>{x()},[x]),d.useEffect(()=>()=>{p.current=!1,u==null||u.dispose()},[u]),{initialized:o,error:a,channels:l,loadMore:C}}const{Provider:Ss}=Z("AIAgentConversationList");function Ts({conversationListLimit:e,conversationListFilter:t,children:n}){var p,x;const{chatSDK:o,aiAgentId:s,queryParams:a}=W(),i={aiAgentIds:[s],aiAgentConversationStatusFilter:[z.ConversationStatus.CLOSED,z.ConversationStatus.OPEN]},l=e??((p=a==null?void 0:a.conversationListParams)==null?void 0:p.limit),c={...i,...(x=a==null?void 0:a.conversationListParams)==null?void 0:x.filter,...t},u=_s(o,{limit:l,filter:c}),g={listSource:{initialized:u.initialized,error:u.error??void 0,channels:u.channels,loadMore:()=>u.loadMore()}};return r.createElement(Ss,{value:g},n)}function As(e){let t="pending",n=e.then(o=>{t="resolved",n=o}).catch(o=>{t="rejected",n=o});return{get value(){if(t==="resolved")return n;throw n}}}const{Provider:ws,useContext:or}=Z("MessageTemplateFetching");function ks({children:e,internalVariables:t}){const n=d.useRef({}),o=d.useRef({}),[s,a]=d.useState({}),i=d.useCallback((u,g)=>{a(p=>({...p,[u]:{fetching:!1,error:!1,...p[u],...g}}))},[]),l=d.useCallback(async({onRequestTemplate:u,onGetCachedTemplate:g,templateKey:p,suspense:x=!1})=>{const C=g(p);if(C)return C;const v=o.current[p];if(v)return v;x||i(p,{fetching:!0});const E=u(p).catch(b=>{throw x||i(p,{error:!0}),b}).finally(()=>{x||i(p,{fetching:!1}),delete o.current[p]});return o.current[p]=E,E},[i]),c={internalVariables:t,fetchTemplate:l,suspend:(u,g)=>{if(n.current[u])return n.current[u];const p=As(g());return n.current[u]=p,p},getIsFetching:u=>{var g;return((g=s[u])==null?void 0:g.fetching)??!1},getHasError:u=>{var g;return((g=s[u])==null?void 0:g.error)??!1}};return r.createElement(ws,{value:c},e)}const dt={VARIABLE:e=>new RegExp(`\\{${e}\\}`,"g"),VIEW_VARIABLE:e=>new RegExp(`"{@${e}}"`,"g")};function Ce({uiTemplateString:e,variables:t={}}){const n=ss(t);return jt({template:e,variables:n,variableKeyPattern:o=>dt.VARIABLE(o)})}function _e({theme:e,uiTemplateString:t,colorVariables:n={}}){return jt({template:t,variables:n,variableKeyPattern:o=>dt.VARIABLE(o),variableValueTransformer:o=>os(e,o)})}function Is({theme:e,uiTemplateString:t,viewVariables:n={},aiAgentColorVariables:o,internalVariables:s,onRequestTemplate:a}){const l=Object.values(n).flat().map(u=>u.key);return[...new Set(l)].some(u=>!a(u))?null:jt({template:t,variables:n,variableKeyPattern:u=>dt.VIEW_VARIABLE(u),variableValueTransformer:u=>{const g=u.map(({key:p,variables:x})=>{const C=a(p),{ui_template:v,color_variables:E}=Ve(C);let b=JSON.stringify(v);return b=Ce({uiTemplateString:b,variables:s}),b=_e({theme:e,uiTemplateString:b,colorVariables:E}),b=_e({theme:e,uiTemplateString:b,colorVariables:o}),b=Ce({uiTemplateString:b,variables:x}),lt(b)});return JSON.stringify(g)}})}async function $s({theme:e,uiTemplateString:t,viewVariables:n={},aiAgentColorVariables:o,internalVariables:s,onRequestTemplate:a}){return as({template:t,variables:n,variableKeyPattern:i=>dt.VIEW_VARIABLE(i),variableValueTransformer:async i=>{const l=i.map(async({key:u,variables:g})=>{const p=await a(u),{ui_template:x,color_variables:C}=Ve(p);let v=JSON.stringify(x);return v=Ce({uiTemplateString:v,variables:s}),v=_e({theme:e,uiTemplateString:v,colorVariables:C}),v=_e({theme:e,uiTemplateString:v,colorVariables:o}),v=Ce({uiTemplateString:v,variables:g}),lt(v)}),c=await Promise.all(l);return JSON.stringify(c)}})}const Ms=({rawTemplate:e,aiAgentColorVariables:t,internalVariables:n,...o})=>{const{ui_template:s,color_variables:a}=Ve(e);let i=JSON.stringify(s);if(Object.keys(o.viewVariables??{}).length>0){const c=Is({...o,uiTemplateString:i,aiAgentColorVariables:t,internalVariables:n});if(c===null)return null;i=c}return i=Ce({...o,uiTemplateString:i,variables:n}),i=_e({...o,uiTemplateString:i,colorVariables:a}),i=_e({...o,uiTemplateString:i,colorVariables:t}),i=Ce({...o,uiTemplateString:i}),lt(i)},Ls=async({rawTemplate:e,aiAgentColorVariables:t,internalVariables:n,...o})=>{const{ui_template:s,color_variables:a}=Ve(e);let i=JSON.stringify(s);return Object.keys(o.viewVariables??{}).length>0&&(i=await $s({...o,uiTemplateString:i,aiAgentColorVariables:t,internalVariables:n})),i=Ce({...o,uiTemplateString:i,variables:n}),i=_e({...o,uiTemplateString:i,colorVariables:a}),i=_e({...o,uiTemplateString:i,colorVariables:t}),i=Ce({...o,uiTemplateString:i}),lt(i)},Os=e=>{const{aiAgentColorVariables:t={}}=e,{internalVariables:n}=or();return d.useState(()=>{const o=e.onGetCachedTemplate(e.templateKey);return o?Ms({...e,rawTemplate:o,aiAgentColorVariables:t,internalVariables:n,onRequestTemplate:e.onGetCachedTemplate}):null})},Ds=e=>{const[t]=Os(e);if(t)return t;const{aiAgentColorVariables:n={}}=e,{internalVariables:o,fetchTemplate:s,suspend:a}=or();return a(e.templateKey,async()=>{const l=await s({...e,suspense:!0});return await Ls({...e,rawTemplate:l,aiAgentColorVariables:n,internalVariables:o})}).value},Rs="remove_powered_by",Kt=(e,t)=>{var s,a;const{chatSDK:n}=W(),{aiAgentInfo:o}=ct();if(e==="handoff-button"){const i=!!((s=t==null?void 0:t.conversation)!=null&&s.handoff);return!!(t!=null&&t.isAIAgent)&&!!(o!=null&&o.showHandoffButton)&&i&&It(t)}if(e==="special-notice")return!!(t!=null&&t.isAIAgent)&&!!(o!=null&&o.specialNoticeEnabled)&&!!(o!=null&&o.specialNotice);if(e==="powered-by"){const i=(a=n==null?void 0:n.appInfo)==null?void 0:a.applicationAttributes;return d.useMemo(()=>!(Array.isArray(i)&&i.includes(Rs)),[i])}throw new Error("Unsupported feature")},Ns={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"},Ps={getValueOrDefault:e=>e.value??e.default_value??null,validate:(e,t,n)=>{const o=t;if(e.required&&(!o||o.trim()===""))return{isValid:!1,error:n.required};if(!o)return{isValid:!0};const{rules:s}=e;if(s){if(s.min_length!==void 0&&o.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&&o.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(o))return{isValid:!1,error:n.regex}}return{isValid:!0}}},Bs={getValueOrDefault:e=>e.value??e.default_value??null,validate:(e,t,n)=>{const o=t;if(e.required&&o===null)return{isValid:!1,error:n.required};if(o===null)return{isValid:!0};const{rules:s}=e;if(s){if(s.min!==void 0&&o<s.min)return{isValid:!1,error:typeof n.min=="function"?n.min(s.min):n.min};if(s.max!==void 0&&o>s.max)return{isValid:!1,error:typeof n.max=="function"?n.max(s.max):n.max}}return{isValid:!0}}},Fs={getValueOrDefault:e=>e.value??e.default_value??null,validate:(e,t,n)=>{const o=t;return e.required&&!o?{isValid:!1,error:n.required}:o&&!e.options.includes(o)?{isValid:!1,error:n.invalidSelection}:{isValid:!0}}},Us={getValueOrDefault:e=>e.values??e.default_values??null,validate:(e,t,n)=>{const o=t;if(e.required&&(!o||o.length===0))return{isValid:!1,error:n.required};if(!o||o.length===0)return{isValid:!0};if(o.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&&o.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&&o.length>a.max_select)return{isValid:!1,error:typeof n.maxSelect=="function"?n.maxSelect(a.max_select):n.maxSelect}}return{isValid:!0}}},Hs={text:Ps,number:Bs,"single-select":Fs,"multi-select":Us},zs={getValueOrDefault:()=>null,validate:()=>({isValid:!1})};function sr(e){return Hs[e.type]||zs}function xn(e){return sr(e).getValueOrDefault(e)}function Vs(e,t,n={}){const o={...Ns,...n};return sr(e).validate(e,t,o)}const Gs=(e,t={})=>{const{labels:n={},onSubmit:o,onCancel:s}=t,[a,i]=d.useState({}),[l,c]=d.useState(()=>{const E={};return e.fields.forEach(b=>{E[b.key]=xn(b)}),E}),u=d.useMemo(()=>e.submitted_at?"submitted":e.canceled_at?"canceled":"draft",[e.submitted_at,e.canceled_at]);d.useEffect(()=>{if(u==="submitted"||u==="canceled"){const E={};let b=!1;e.fields.forEach(h=>{const y=xn(h);JSON.stringify(l[h.key])!==JSON.stringify(y)&&(b=!0),E[h.key]=y}),b&&c(E)}},[u]);const g=(E,b)=>{c(h=>({...h,[E]:b})),i(h=>({...h,[E]:void 0}))},p=e.fields.map(E=>{var y,_,M;const b=l[E.key]??null,h={key:E.key,label:E.label,error:a[E.key],required:E.required};return E.type==="text"?{...h,type:"text",layout:E.layout,value:b,...E.placeholder&&{placeholder:E.placeholder},...((y=E.rules)==null?void 0:y.max_length)&&{maxLength:E.rules.max_length}}:E.type==="number"?{...h,type:"number",layout:E.layout,value:b,...E.placeholder&&{placeholder:E.placeholder},...((_=E.rules)==null?void 0:_.max)&&{max:E.rules.max}}:E.type==="single-select"?{...h,type:"single-select",layout:E.layout,value:b,options:E.options}:E.type==="multi-select"?{...h,type:"multi-select",layout:E.layout,value:b,options:E.options,...((M=E.rules)==null?void 0:M.max_select)&&{maxSelect:E.rules.max_select}}:{...h,type:"unknown",layout:"default",value:null}});return{state:u,fields:p,getField:E=>p.find(b=>b.key===E),updateFieldValue:g,submit:async()=>{const E={};let b=!1;for(const h of e.fields){const y=l[h.key]??null,_=Vs(h,y,n);_.isValid||(E[h.key]=_.error,b=!0)}if(i(E),!b&&o){const h={};e.fields.forEach(y=>{h[y.key]=l[y.key]??null}),await o(h)}},cancel:async()=>{await(s==null?void 0:s())}}},ar=({channel:e,userSession:t,aiAgentInfo:n})=>{if(!t||!n)return{fallbackIcon:"bot-filled",url:void 0,title:""};const o={ai(a){return{fallbackIcon:a,url:n.profileUrl,title:n.nickname}},human(a){return{fallbackIcon:a,url:s==null?void 0:s.profileUrl,title:(s==null?void 0:s.nickname)||n.nickname}},channel(a){return{fallbackIcon:a,url:e==null?void 0:e.coverUrl,title:(e==null?void 0:e.name)??""}}};if(!e)return o.ai("bot-filled");const s=(()=>{const[a]=e.members.filter(i=>i.userId!==t.userId);return a})();return e.isAIAgent?Ne(e)?o.human("agent"):o.ai("bot-filled"):e.isDesk?o.human("agent"):o.channel("user")},vn=e=>d.useReducer((t,n)=>({...t,...n}),e);var re=(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))(re||{});const Ws=new Set(["free_text","single_choice"]),qs=({csatPayload:e,type:t,initialCsat:n,initialCsatReason:o,initialIsResolved:s})=>{const[a,i]=vn({csatType:t,csat:n,csatReason:o,isResolved:s}),[l,c]=vn({followUpItem:!1}),u=d.useMemo(()=>{var E;const C=a.csat;if(typeof C!="number")return;const v=(E=e.follow_up)==null?void 0:E.find(b=>b.scores.includes(C));if(Ws.has(v==null?void 0:v.response_type))return v},[a.csat,e.follow_up]),g=(()=>{var C;if(typeof n=="number")return"submitted";if((t===re.AI_AGENT_CSAT_5||t===re.HELPDESK_CSAT_5)&&typeof a.csat=="number")return"submittable";if(t===re.AI_AGENT_CSAT_5_WITH_CRE){const v=typeof a.csat=="number",E=!((C=e.cre)!=null&&C.required)||typeof a.isResolved=="boolean";if(v&&E)return"submittable"}return"unsubmittable"})(),p=d.useCallback(()=>typeof a.csat>"u"?!1:u!=null&&u.required&&!a.csatReason?(c({followUpItem:!0}),!1):!0,[a,u,c]);return d.useEffect(()=>{o||(i({csatReason:""}),c({followUpItem:!1}))},[o,u,i,c]),{params:a,setParams:i,error:l,setError:c,followUpItem:u,state:g,validateParams:p,itemProps:{csatPayload:e,state:g,submitted:g==="submitted"}}},_t=5,js=e=>e<1e3?{speed:_t*.5,chunkSize:2}:e<2e3?{speed:_t*.8,chunkSize:2}:{speed:_t*.6,chunkSize:3},Ks=(e,t=!1)=>{const[n,o]=d.useState(0),s=d.useRef(null),a=d.useRef(0),i=d.useRef(0),l=d.useRef(t);return d.useEffect(()=>{if(!l.current){o(e.length);return}o(c=>e.length<c?(a.current=0,i.current=0,0):c)},[e]),d.useEffect(()=>{if(!l.current||n>=e.length)return;const c=u=>{a.current===0&&(a.current=u,i.current=u);const g=u-a.current,p=u-i.current,{speed:x,chunkSize:C}=js(p),v=x*C;g>=v&&(o(E=>Math.min(E+C,e.length)),a.current=u),s.current=requestAnimationFrame(c)};return s.current=requestAnimationFrame(c),()=>{s.current&&cancelAnimationFrame(s.current)}},[e.length,n]),e.slice(0,n)},Zs='@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}',Ys={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.",unknown_message_type:"(Unknown message type)",powered_by:"Powered by",citation_title:"Source",start_new_conversation_label:"Talk to agent",failed_message_resend:"Retry",failed_message_remove:"Remove",file_upload_no_supported_files:"No supported file types available."},conversation_list:{header_title:"Conversations",ended:"Ended"},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"}},Nt={language:"en",strings:Ys,dateLocale:eo.enUS},ir=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,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}),Xs=e=>{var t;return((t=e.split("-"))==null?void 0:t[0])??ut},ut="en",Js=new Set([ut,"ko","es","pt","fr","hi","it","de","tr","ja"]),Qs=(e,t,n)=>{const o=e[t];return o?typeof o=="function"?o():Promise.resolve(o):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.":""))))})},yn=ir(Nt.strings),ea={...yn,CHANNEL_FROZEN:"Channel frozen",HEADER_BUTTON__AGENT_HANDOFF:"Connect with an agent",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Select an option to continue",BUTTON__CANCEL:"Cancel",BUTTON__SAVE:"Save",BUTTON__OK:"OK",BUTTON__SUBMIT:"Submit",NO_NAME:"(No name)",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",CONVERSATION_CLOSED_FOOTER_LABEL:"Your conversation has ended",START_NEW_CONVERSATION:"💬 Start a new conversation",RETURN_TO_CONVERSATION:"💬 Return to conversation",CONVERSATION_LIST__TOPICS_FALLBACK:"No category",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:yn.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"h:mma"},rt={language:Nt.language,dateLocale:Nt.dateLocale,stringSet:ea},ta=Object.freeze(Object.defineProperty({__proto__:null,default:rt},Symbol.toStringTag,{value:"Module"})),Pt=new Map([[ut,rt]]);async function na(e){const t=Pt.get(e);if(t)return t;try{if(Js.has(e)){const{default:n}=await Qs(Object.assign({"./languages/de.ts":()=>Promise.resolve().then(()=>require("./BxR58-VB.cjs")),"./languages/en.ts":()=>Promise.resolve().then(()=>ta),"./languages/es.ts":()=>Promise.resolve().then(()=>require("./CmZZbL5X.cjs")),"./languages/fr.ts":()=>Promise.resolve().then(()=>require("./BDAydJst.cjs")),"./languages/hi.ts":()=>Promise.resolve().then(()=>require("./Dnh-zu9I.cjs")),"./languages/it.ts":()=>Promise.resolve().then(()=>require("./B2XEqEtH.cjs")),"./languages/ja.ts":()=>Promise.resolve().then(()=>require("./BvXblDCo.cjs")),"./languages/ko.ts":()=>Promise.resolve().then(()=>require("./C7mYp-Sm.cjs")),"./languages/pt.ts":()=>Promise.resolve().then(()=>require("./BeDV3w9G.cjs")),"./languages/tr.ts":()=>Promise.resolve().then(()=>require("./ByqY2Frw.cjs"))}),`./languages/${e}.ts`,3);return Pt.set(e,n),n}return rt}catch{return rt}}const{Provider:ra,useContext:B}=Z("Localization"),oa=({language:e=navigator.language,logger:t,stringSet:n,children:o})=>{const[s,a]=d.useState(Pt.get(ut));return d.useEffect(()=>{const i=Xs(e);s.language!==i&&(t==null||t.debug("localization.useEffect: update language",{from:s.language,to:i}),na(i).then(a))},[e,t]),r.createElement(ra,{value:{language:s.language,stringSet:{...s.stringSet,...n},dateLocale:s.dateLocale,format:(i,l,c)=>xe.format(i,l,{locale:s.dateLocale,...c})}},o)},ot="data-sb-agent-theme",Cn=e=>(t,...n)=>{let o="";return t.forEach((s,a)=>{o+=s+(n[a]??"")}),`[${ot}='${e}'] & { ${o} }`},D={light:Cn("light"),dark:Cn("dark")},sa=A.css(({theme:e})=>{const{palette:t}=e;return`
1
+ "use strict";var Jr=Object.defineProperty;var Qr=(e,t,n)=>t in e?Jr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var F=(e,t,n)=>Qr(e,typeof t!="symbol"?t+"":t,n);const d=require("react"),K=require("@sendbird/chat"),A=require("styled-components"),xe=require("date-fns"),eo=require("date-fns/locale/en-US"),z=require("@sendbird/chat/aiAgent"),Fe=require("@sendbird/uikit-tools"),Te=require("@sendbird/chat/message"),nt=require("@sendbird/chat/groupChannel"),to=require("react-dom"),kt=require("@sendbird/react-uikit-message-template-view"),no=require("@sendbird/uikit-message-template"),ro=require("dompurify"),oo=require("date-fns/isSameDay"),so=require("@emotion/is-prop-valid"),it=e=>e&&e.__esModule?e:{default:e};function ao(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 o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const r=ao(d),io=it(K),f=it(A),Wn=it(ro),lo=it(so),Z=(e,t)=>{const n=d.createContext(null),o=({children:i,value:l})=>r.createElement(n.Provider,{value:l},typeof i=="function"?i(l):i),s=({children:i})=>r.createElement(n.Consumer,null,l=>l?typeof i=="function"?i(l):i:null),a=()=>{const i=d.useContext(n);if(!i)throw new Error(`use${e}Context must be used within a ${e}Provider`);return i};return n.displayName=`${e}Context`,o.displayName=`${e}Provider`,s.displayName=`${e}Consumer`,a.displayName=`use${e}Context`,{Context:n,Provider:o,Consumer:s,useContext:a}};function ke(e){const t=d.createContext({Template:e.template,updateTemplate:()=>{},components:e.components,updateComponent:()=>{}});function n({children:a}){const[i,l]=d.useState(()=>e.template),[c,u]=d.useState(e.components),g={Template:i,updateTemplate:p=>l(()=>p),components:c,updateComponent:(p,x)=>u(C=>({...C,[p]:x}))};return r.createElement(t.Provider,{value:g},a)}function o({template:a,children:i}){const{updateTemplate:l}=d.useContext(t);return d.useLayoutEffect(()=>{a&&l(a)},[a]),r.createElement(r.Fragment,null,i)}function s({children:a}){return r.createElement(n,null,a)}return s.defaults=e,s.useContext=()=>d.useContext(t),s.Context=t,s.Template=o,Object.keys(e.components).forEach(a=>{s[a]=function({component:l}){const{updateComponent:c}=d.useContext(t);return d.useLayoutEffect(()=>{l&&c(a,l)},[l]),null}}),s}function co(...e){return function({children:n}){return e.reduce((o,s)=>r.createElement(s,null,o),n)}}const ve=e=>{var t,n;return!!(e!=null&&e.isAIAgent&&((t=e==null?void 0:e.conversation)==null?void 0:t.status)===z.ConversationStatus.CLOSED||e!=null&&e.isDesk&&((n=e==null?void 0:e.helpdeskInfo)==null?void 0:n.ticketStatus)==="closed")},It=e=>{var t,n;return!!(e!=null&&e.isAIAgent&&((t=e==null?void 0:e.conversation)==null?void 0:t.status)===z.ConversationStatus.OPEN||e!=null&&e.isDesk&&((n=e==null?void 0:e.helpdeskInfo)==null?void 0:n.ticketStatus)==="open")};function Ne(e){var n,o,s;return typeof(((n=e==null?void 0:e.conversation)==null?void 0:n.handedOverAt)??((s=(o=e==null?void 0:e.conversation)==null?void 0:o.handoff)==null?void 0:s.timestamp))=="number"}function uo(e){var t;if(((t=e==null?void 0:e.resolution)==null?void 0:t.determinedBy)==="user")return e.resolution.isResolved}function un(e){return!!e&&e<Date.now()}function mo(e){return!e.title}function go(e,t){var n;if(e)return mo(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 ho(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 fo(e,t,n){var i;const o=new Date,s=new Date(((i=e.lastMessage)==null?void 0:i.createdAt)||e.createdAt),a=xe.differenceInMinutes(o,s);return a<1?n.justNow:a<60?n.minutesAgo(a):xe.isToday(s)?n.hoursAgo(xe.differenceInHours(o,s)):t(s,n.dateShortFormat)}const po="1.9.2",De="sb-agent",bo=po,qn="KEY_IMG_ASPECT_RATIO",Eo="*/*",N={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},ue=e=>!!e&&"sender"in e,xo=e=>ue(e)?e.sendingStatus==="succeeded"?String(e.messageId):e.reqId:String(e.messageId),vo=(e,t,n,o=!0)=>{if(!o||!ue(e))return"single";const s=()=>{if(!t||!ue(t))return!1;const c=t.sender.userId===e.sender.userId,u=xe.isSameMinute(t.createdAt,e.createdAt);return c&&u},a=()=>{if(!n||!ue(n))return!1;const c=n.sender.userId===e.sender.userId,u=xe.isSameMinute(n.createdAt,e.createdAt);return c&&u},i=s(),l=a();return i&&l?"middle":i?"bottom":l?"top":"single"},Pe=(e,t)=>(()=>{var o;return ue(e)?e.sender.userId:((o=e==null?void 0:e.sender)==null?void 0:o.userId)??void 0})()===t,Le={isAdmin:e=>e.isAdminMessage(),isCSAT:e=>{var t;return e.isAdminMessage()&&!!((t=e.extendedMessagePayload)!=null&&t.csat)},isIncoming:(e,t)=>ue(e)&&e.sender.userId!==t,isOutgoing:(e,t)=>ue(e)&&(e.sender.userId===t||e.sendingStatus===Te.SendingStatus.PENDING)},jn=e=>e.startsWith("image/"),Kn=e=>e.startsWith("video/"),Vt=(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"},Zn=e=>e.messageType==="file"?e.message.length>0&&e.file.name!==e.message:e.message.length>0,Gt=e=>{switch(e){case"top":case"middle":return N.GAP_GROUPED;default:return N.GAP_UNGROUPED}},yo=(e,t)=>{const n=/```(\w+)?\n([\s\S]*?)```/g,o=[];let s=0;return e.replace(n,(a,...i)=>{const[l,c,u]=i;return s<u&&o.push({type:"text",value:e.slice(s,u).trim()}),o.push({type:"code",value:c.trim(),language:l?l.trim():"plaintext"}),s=u+a.length,a}),s<e.length&&o.push({type:"text",value:e.slice(s).trim()}),t?o.map(a=>a.type!=="text"?a:{...a,value:t(a.value)}):o},Co=e=>e.replace(/\[([^\]]+)\](?!\()/g,"\\[$1\\]"),_o=e=>e.replace(/([a-zA-Z0-9])_(?=[a-zA-Z0-9])/g,"$1\\_"),So=e=>e.replace(/~~/g,"\\~\\~"),To=e=>{let t=e;return t=Co(t),t=_o(t),t=So(t),t},Ao=typeof navigator<"u"&&navigator.product==="ReactNative",mn=(e,t)=>{const n=o=>!t||t.length===0?!0:ue(o)&&t.includes(o.sendingStatus);return Ao?e.find(n):e.findLast(n)};function ye(){}function wo(){const e=typeof navigator<"u"?navigator.userAgent:"",t=/iPad|iPhone|iPod/.test(e),n=/Android/.test(e);return t||n}function ko(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 $t=e=>{try{return JSON.parse(e===""?"{}":e)}catch{return{}}},me={isStreaming(e){const t=$t(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(Pe(e,t)){const o=$t(e.data);return!(o!=null&&o.respond_mesg_id)&&!(o!=null&&o.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)},checkExtendedFieldPresence(e){const t=e.extendedMessagePayload||{},n=i=>i.some(l=>typeof t[l]<"u"),o=n(vt.ui),s=n(vt.trail),a=n(vt.marking);return{ui:o,trail:s,marking:a}},shouldScrollToBottom(e,t,n=!1){if(Pe(e,t)){if(this.isGeneratedMessage(e)&&this.isStreaming(e))return!0;const{ui:o,trail:s,marking:a}=this.checkExtendedFieldPresence(e);return o?!(!n&&a):!!(n&&(s||a))}return!0}},vt={ui:["suggested_replies","cta_button","message_template","csat"],trail:["groundedness","manual","function_calls"],marking:["is_hallucination","is_moderated","flagged_types"]},yt=`@${De}`,gn=({appId:e,aiAgentId:t,storage:n})=>{const o={templateBase:`${yt}-template`,template:s=>`${o.templateBase}/templates/${s}`,templateToken:()=>`${o.templateBase}-template/message-template/tokens`,messengerSession:s=>{const a=ko(`${e}/${t}/${s}`);return`${yt}-udata/${a}`},anonUserSession:()=>`${yt}-session/${e}/${t}`};return{template:{set:(s,a)=>n.set(o.template(s),a),get:s=>n.get(o.template(s)),setCachedToken:s=>n.set(o.templateToken(),s),getCachedToken:()=>n.get(o.templateToken()),clear:()=>{n.getKeys(o.templateBase).forEach(n.delete)}},messenger:{getSettings:s=>{try{const a=n.get(o.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(o.messengerSession(s),i)}catch{return}},getAnonUser:()=>{try{const s=n.get(o.anonUserSession());return s?JSON.parse(s):null}catch{return null}},setAnonUser:s=>{try{const a=JSON.stringify(s);n.set(o.anonUserSession(),a)}catch{return}},clear:s=>{try{s&&n.delete(o.messengerSession(s)),n.delete(o.anonUserSession())}catch{return}}}}};class Yn{constructor(t){F(this,"subscribers",{});this.logger=t}async send(t){const n=Io(),o=this.subscribers[t.type];if(o){this.logger.debug(`messenger.dispatcher: dispatching command: ${t.type}`,t.payload);const s=o.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(o=>o!==n))}}const Io=()=>{let e=ye,t=ye;return{promise:new Promise((o,s)=>{e=o,t=s}),resolve:e,reject:t}};var Wt=(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))(Wt||{});class Xn{constructor(t){F(this,"level");this.level=t}verbose(...t){this.level<=0&&console.log(`[${De}/verbose]`,...t)}debug(...t){this.level<=1&&console.log(`[${De}/debug]`,...t)}info(...t){this.level<=2&&console.log(`[${De}/info]`,...t)}warn(...t){this.level<=3&&console.warn(`[${De}/warn]`,...t)}error(...t){this.level<=4&&console.error(`[${De}/error]`,...t)}}function hn(e,t,n){const o=io.default.init({appId:e,modules:[new nt.GroupChannelModule,new z.AIAgentModule],localCacheEnabled:!0,options:new K.SendbirdChatOptions({typingIndicatorInvalidateTime:2e4}),...n});return o.addSendbirdExtensions([{version:bo,product:K.SendbirdProduct.AI_AGENT,platform:t.platform}],{platform:t.deviceOSPlatform,version:t.deviceOSVersion},t.customData)||console.warn("Invalid Sendbird Extensions",t),o}function $o(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 Oe={conversation:{isTalkToAgentViewEnabled:!0,input:{camera:{photoEnabled:!0},gallery:{photoEnabled:!0},fileEnabled:!0}}},fn=e=>{var t,n,o,s,a,i,l,c,u,g;return e?{...Oe,...e,conversation:{...Oe.conversation,...e==null?void 0:e.conversation,input:{...(t=Oe.conversation)==null?void 0:t.input,...(n=e==null?void 0:e.conversation)==null?void 0:n.input,camera:{...(s=(o=Oe.conversation)==null?void 0:o.input)==null?void 0:s.camera,...(i=(a=e==null?void 0:e.conversation)==null?void 0:a.input)==null?void 0:i.camera},gallery:{...(c=(l=Oe.conversation)==null?void 0:l.input)==null?void 0:c.gallery,...(g=(u=e==null?void 0:e.conversation)==null?void 0:u.input)==null?void 0:g.gallery}}}}:Oe},{Provider:Mo,useContext:W}=Z("AIAgent");function Lo({appId:e,aiAgentId:t,keyValueStorage:n,language:o,countryCode:s,context:a,queryParams:i,config:l,chatSDK:c,chatParams:u,children:g,logger:p,dispatcher:x,extensions:C={platform:K.SendbirdPlatform.JS,deviceOSPlatform:wo()?K.DeviceOsPlatform.MOBILE_WEB:K.DeviceOsPlatform.WEB}}){const[v,E]=d.useState(()=>{const b=p??new Xn(Wt.WARN),h=x??new Yn(b);return{appId:e,aiAgentId:t,language:o,countryCode:s,context:a,queryParams:i,config:fn(l),keyValueStorage:n,logger:b,dispatcher:h,chatSDK:c??hn(e,C,u),cache:gn({appId:e,aiAgentId:t,storage:n})}});return d.useEffect(()=>{E(b=>{let h=b.logger,y=b.dispatcher,_=b.chatSDK;return p&&p!==b.logger&&(h=p),x&&x!==b.dispatcher&&(y=x),c&&c!==b.chatSDK?_=c:!c&&b.chatSDK.appId!==e&&(_=hn(e,C,{newInstance:!0,...u})),{...b,appId:e,aiAgentId:t,keyValueStorage:n,language:o,countryCode:s,context:a,queryParams:i,config:fn(l),logger:h,dispatcher:y,chatSDK:_,cache:gn({appId:e,aiAgentId:t,storage:n})}})},[e,t,o,s,a,l,p,x,c]),d.useEffect(()=>()=>{v.chatSDK.disconnectWebSocket()},[v.chatSDK]),$o(v.chatSDK),r.createElement(Mo,{value:v},g)}const Oo=(e,t,n)=>Fe.useGroupChannelMessages(e,t,{...n,strictStreamingOrder:!0});var Mt=(e=>(e.ConversationClose="conv.close",e))(Mt||{});class Do{constructor(t={}){F(this,"payload");this.payload=t}toJSON(){return JSON.stringify({type:this.type,payload:this.payload})}}const Jn={CloseConversation:e=>new Ro(e)};class Ro extends Do{constructor(){super(...arguments);F(this,"type","conv.close")}}const Lt={DEFAULT_BOT_MSG_BG:"#eeeeee",WHITE:"#ffffff",BLACK:"#000000"};function Qn(e){return e.length===4?`#${[...e.slice(1)].map(t=>t+t).join("")}`:e}function No(e){const t=Qn(e);return[parseInt(t.slice(1,3),16),parseInt(t.slice(3,5),16),parseInt(t.slice(5,7),16)]}function Po(e){return`#${e.map(t=>t.toString(16).padStart(2,"0")).join("")}`}function Bo(e,t,n){e/=255,t/=255,n/=255;const o=Math.max(e,t,n),s=Math.min(e,t,n),a=o-s;let i=0,l=0;const c=(o+s)/2;return o!==s&&(l=c>.5?a/(2-o-s):a/(o+s)),o===e?i=(t-n)/a+(t<n?6:0):o===t?i=(n-e)/a+2:o===n&&(i=(e-t)/a+4),i/=6,[i,l,c]}function Fo(e,t,n){let o,s,a;if(t===0)o=s=a=n;else{const i=function(g,p,x){return x<0&&(x+=1),x>1&&(x-=1),x<.16666666666666666?g+(p-g)*6*x:x<.5?p:x<.6666666666666666?g+(p-g)*(.6666666666666666-x)*6:g},l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;o=i(c,l,e+1/3),s=i(c,l,e),a=i(c,l,e-1/3)}return[Math.round(o*255),Math.round(s*255),Math.round(a*255)]}function Ke(e,t,n){const[o,s,a]=No(e),[i,l,c]=Bo(o,s,a),u=Math.max(0,Math.min(1,c*t)),g=Math.max(0,Math.min(1,l*n)),[p,x,C]=Fo(i,g,u);return Po([Math.round(p),Math.round(x),Math.round(C)])}function Uo(e,t="light"){return{extraDark:Ke(e,.6,1.2),dark:Ke(e,.85,1.1),main:e,light:Ke(e,t==="dark"?1.1:1.5,t==="dark"?.95:.9),extraLight:Ke(e,t==="dark"?1.2:1.75,t==="dark"?.9:.8)}}function Ot(e){const t=Qn(e),n=149,o=+`0x${t[1]}${t[2]}`,s=+`0x${t[3]}${t[4]}`,a=+`0x${t[5]}${t[6]}`;return o*.299+s*.587+a*.114>n?Lt.BLACK:Lt.WHITE}function Ho(e,t,n,o,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:o},messageOutgoing:{text:n,background:t},csat:{background:e.background100}}}const zo=(e,t,n,o,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:o},messageOutgoing:{text:n,background:t},csat:{background:e.background400}}),Ze={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)"}},Ct={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 pn(e){const t=Vo(e),{colors:n,aiAgentColorVariables:o}=Go(e,t),s=qo(e);return{selectedTheme:e.selectedTheme,palette:t,colors:n,aiAgentColorVariables:o,typography:s}}function Vo({selectedTheme:e,palette:t,primary:n}){const o=t!=null&&t.primary?t.primary:n?n===Ze.primary.main?Ze.primary:Uo(n,e):Ze.primary;return{...Ze,primary:o,...t}}function Go({selectedTheme:e,primaryContrast:t,botMessageBackground:n,botMessageBackgroundContrast:o},s){const a=s.primary.main,i=t??Ot(a),l=n??Lt.DEFAULT_BOT_MSG_BG,c=o??Ot(l);return{colors:(e==="light"?Ho:zo)(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 Wo(e,t,n){const o={...e};return n.forEach(s=>{const a=t[s];a!=null&&(o[s]=a)}),o}function qo({typography:e}){if(!e)return Ct;const t={...Ct};return Object.keys(e).forEach(n=>{const o=e[n];if(o&&typeof o=="object"){const s=Ct[n],a=["fontSize","fontWeight","fontFamily","lineHeight"];t[n]=Wo(s,o,a)}}),t}const{Provider:jo,useContext:qt}=Z("AIAgentTheme");function Ko({logger:e,palette:t,typography:n,appearance:o,children:s}){const a=d.useRef(null),[i,l]=d.useState(()=>pn({selectedTheme:(o==null?void 0:o.theme)??"light",palette:t,typography:n,primary:o==null?void 0:o.primaryColor,botMessageBackground:o==null?void 0:o.botMessageBackgroundColor})),c=d.useCallback((u,g)=>{g&&(a.current=g);const p=(o==null?void 0:o.theme)??u,x=a.current?a.current.themes[p]:null,C={primary:o==null?void 0:o.primaryColor,primaryContrast:void 0,botMessageBackground:o==null?void 0:o.botMessageBackgroundColor,botMessageBackgroundContrast:void 0};!C.primary&&(x!=null&&x.primary_color)&&(C.primary=x.primary_color,C.primaryContrast=x.primary_contrast_color),!C.botMessageBackground&&(x!=null&&x.bot_message_bg_color)&&(C.botMessageBackground=x.bot_message_bg_color,C.botMessageBackgroundContrast=x.bot_message_bg_contrast_color);const v=pn({selectedTheme:p,palette:t,typography:n,...C});l(v),e==null||e.info("theme.update:",p)},[o==null?void 0:o.theme,o==null?void 0:o.primaryColor,o==null?void 0:o.botMessageBackgroundColor,t,n,e]);return d.useEffect(()=>{(o!=null&&o.theme||o!=null&&o.primaryColor||o!=null&&o.botMessageBackgroundColor)&&c(i.selectedTheme)},[o==null?void 0:o.theme,o==null?void 0:o.primaryColor,o==null?void 0:o.botMessageBackgroundColor]),r.createElement(jo,{value:{theme:i,updateTheme:c}},s)}const bn=25*1024*1024,Zo={off:"off",always:"always",handed_off_only:"handed_off_only"},Yo=()=>{const[e,t]=d.useState(()=>({maxAttachmentCount:1,attachmentMode:"handed_off_only",defaultUploadSizeLimit:bn,uploadSizeLimitPerType:new Map,supportedImageMimeTypes:new Set(["image/png","image/jpeg","image/jpg"]),supportedFileMimeTypes:new Set(["application/pdf"])})),n=d.useCallback(({active_channel:s,upload_restriction:a})=>{const{maxAttachmentCount:i,attachmentMode:l,defaultUploadSizeLimit:c,supportedImageMimeTypes:u,supportedFileMimeTypes:g}=e;t({maxAttachmentCount:i,attachmentMode:Zo[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)??u),supportedFileMimeTypes:new Set((a==null?void 0:a.supported_file_mime_types)??g)})},[]),o=d.useCallback(s=>{const{channel:a,uploadSizeLimit:i=bn}=s,l=(u=!0)=>a!=null&&a.isAIAgent?u?Ne(a):!1:!0,c=u=>{if(l())return e.defaultUploadSizeLimit??i;const g=e.defaultUploadSizeLimit??i,p=e.uploadSizeLimitPerType.get(u)??g;return Math.min(g,p)};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 Ne(a);default:return!0}},get supportedMimeTypes(){return l()?[Eo]:[...e.supportedImageMimeTypes,...e.supportedFileMimeTypes]},isSupportedMimeType:u=>l()?!0:e.supportedImageMimeTypes.has(u)||e.supportedFileMimeTypes.has(u),getUploadSizeLimit:c,getUploadSizeLimitInMB:u=>c(u)/(1024*1024)}},[e]);return{updateBaseAttachmentRules:n,createAttachmentRules:o}};function er(){const{chatSDK:e,logger:t}=W();return d.useCallback(async n=>{if(n.userId===""){const o=new Error("userId cannot be empty string for messenger settings request");throw t.error("requestMessengerSettings: invalid userId",o),o}return await e.aiAgent.requestMessengerSettings(n)},[e,t])}function Xo(){const{chatSDK:e,logger:t}=W(),n=d.useCallback(async(s,a,i)=>{if(t.debug("useChatConnection.connect: start, session",s.userId),a){const l=new K.SessionHandler({...a,onSessionTokenRequired:Jo(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(es(c))t.warn("useChatConnection.connect","offline connect restricted",c.message,c.code),t.warn("useChatConnection.connect","clear cached-data"),await e.clearCachedData().catch(u=>t.warn("useChatConnection.connect","clear cached-data failure",u));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]),o=d.useCallback(async()=>{t.debug("useChatConnection.disconnect: start"),await e.disconnect(),t.debug("useChatConnection.disconnect: end")},[e,t]);return{connect:n,disconnect:o}}function Jo(e,t){if(e)return async(n,o)=>{new Promise((s,a)=>e==null?void 0:e(s,a)).then(s=>{s&&(t==null||t(s)),n(s)}).catch(s=>{o(s)})}}const Qo=[400300,400301,400302,400310];function es(e){return Qo.some(t=>e.code===t)}class tr{constructor({userId:t,authToken:n,sessionHandler:o}){F(this,"userId");F(this,"authToken");F(this,"sessionHandler");this.userId=t,this.authToken=n,this.sessionHandler=o}}class Dt{constructor(){F(this,"userId");F(this,"authToken");F(this,"sessionHandler")}}const ts=24*60*60*1e3,ns=e=>{const{logger:t,cache:n}=W(),o=()=>{const a=n.messenger.getAnonUser();return a?a.expireAt-ts<=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 Dt)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 d.useMemo(()=>e instanceof tr?{type:"manual",userSessionCandidate:s()}:e instanceof Dt?{type:"anonymous",userSessionCandidate:o()}: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:o()}):{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 rs({userSessionInfo:e,onUpdateMessengerSettings:t,onPreAuth:n,onPostAuth:o,onErrorAuth:s,onAuthTokenRefreshed:a,onPostDeauth:i,forceCreateChannel:l}){const{aiAgentId:c,language:u,context:g,countryCode:p,logger:x,cache:C}=W(),{connect:v,disconnect:E}=Xo(),{type:b,userSessionCandidate:h}=ns(e),y=er(),_=d.useCallback(async()=>{var R;x.debug("useAuthentication.authenticate: start");const S=h!=null&&h.userId?C.messenger.getSettings(h.userId):null;S!=null&&S.bot&&(t(S),x.debug("useAuthentication.authenticate: cached messenger settings",S));const k=await y({aiAgentId:c,userId:h==null?void 0:h.userId,language:u,country:p,context:g,forceCreateChannel:l,knownActiveChannelUrl:(R=S==null?void 0:S.active_channel)==null?void 0:R.channel_url});x.debug("useAuthentication.authenticate: messenger settings response",k);let $=null;if(k.auto_created_user)if(b==="manual")x.warn("Received auto created user info but current session is manual. Ignoring auto created user info."),$={userId:h.userId,authToken:h.authToken};else{const{user_id:X,session_token:J,expire_at:se}=k.auto_created_user;C.messenger.setAnonUser({userId:X,authToken:J,expireAt:se}),$={userId:X,authToken:J}}else $={userId:(h==null?void 0:h.userId)??"",authToken:(h==null?void 0:h.authToken)??""};C.messenger.setSettings($.userId,k),t(k);try{await n(k,$),await v($,h==null?void 0:h.sessionHandler,a),await o(k,$)}catch(X){throw X instanceof Error&&(s(X),x.error("useAuthentication.authenticate: failed to connect",X)),X}return k},[y,v,b,h==null?void 0:h.userId,h==null?void 0:h.sessionHandler,h==null?void 0:h.authToken,C.messenger.setAnonUser,C.messenger.getSettings,C.messenger.setSettings,t,n,o,s,a]),M=d.useCallback(async()=>{x.debug("useAuthentication.deauthenticate: start"),await E(),i(),x.debug("useAuthentication.deauthenticate: completed")},[E,x,i]);return{authenticate:_,deauthenticate:M,userSessionCandidate:h}}const nr=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)}},Ve=e=>JSON.parse(e),lt=e=>JSON.parse(e);function os(e,t){const[n,o]=t.split(",").map(s=>s.trim());return e==="dark"&&o||n}function ss(e){const t={};function n(o,s=""){for(const[a,i]of Object.entries(o)){const l=s?`${s}.${a}`:a;i&&typeof i=="object"&&!Array.isArray(i)?n(i,l):t[l]=i}}return n(e),t}function jt({template:e,variables:t,variableKeyPattern:n,variableValueTransformer:o}){return Object.entries(t).reduce((s,[a,i])=>{if(!o&&!["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=o?o(i):String(i),c=n(a);return s.replace(c,nr(l))},e)}async function as({template:e,variables:t,variableKeyPattern:n,variableValueTransformer:o}){return(await Promise.all(Object.entries(t).map(async([a,i])=>{const l=await o(i);return{regex:n(a),transformedValue:l}}))).reduce((a,{regex:i,transformedValue:l})=>a.replace(i,nr(l)),e)}const is=()=>{const{chatSDK:e,logger:t,cache:n}=W(),o=d.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=d.useCallback(async()=>{try{const{templates:a,token:i}=await e.aiAgent.getMessageTemplates({limit:20});for(const{template:l}of a){const{key:c}=Ve(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:o,syncCachedTemplates:s}},{Provider:ls,useContext:ct}=Z("AIAgentMessengerSession"),cs=d.forwardRef(function({userSessionInfo:e,forceCreateChannel:t,children:n},o){const{appId:s,aiAgentId:a,chatSDK:i,language:l,countryCode:c,context:u,cache:g,logger:p}=W(),{updateTheme:x}=qt(),[C,v]=d.useState(void 0),[E,b]=d.useState(void 0),[h,y]=d.useState(null),[_,M]=d.useState(null),[S,k]=d.useState(null),[$,R]=d.useState(null),{updateBaseAttachmentRules:X,createAttachmentRules:J}=Yo(),{shouldSyncCachedTemplate:se,syncCachedTemplates:he}=is(),fe=er(),{authenticate:Se,deauthenticate:V}=rs({userSessionInfo:e,forceCreateChannel:t,onUpdateMessengerSettings:d.useCallback(P=>{const{appearance:T,bot:O,launcher:H}=P;x(T.selected_theme,T),k({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:P.bot.is_user_feedback_enabled??!1,isUserFeedbackCommentOptionEnabled:P.bot.is_user_feedback_comment_option_enabled??!1}),R({type:H.image_type||"default_icon",imageUrl:H.image_url}),X(P)},[x]),onPreAuth:d.useCallback((P,T)=>{v(void 0),M(T)},[]),onPostAuth:d.useCallback(async P=>{y(i.currentUser),se()&&await he(),b({url:P.active_channel.channel_url,status:z.ConversationStatus.OPEN})},[i,se,he]),onErrorAuth:d.useCallback(P=>{v(P)},[]),onAuthTokenRefreshed:d.useCallback(P=>{M(T=>T?{...T,authToken:P}:null)},[]),onPostDeauth:d.useCallback(()=>{g.template.clear(),g.messenger.clear(_==null?void 0:_.userId),y(null),b(void 0),M(null),k(null),R(null)},[g.template.clear,g.messenger.clear,_])}),w=d.useCallback(async()=>{var P;if(_){p.debug("agentMessengerSession.refreshActiveChannel: try to refresh active channel"),b(void 0);const T=await fe({aiAgentId:a,userId:_.userId,language:l,country:c,context:u,forceCreateChannel:t,knownActiveChannelUrl:(P=g.messenger.getSettings(_.userId))==null?void 0:P.active_channel.channel_url});return g.messenger.setSettings(_.userId,T),b({url:T.active_channel.channel_url,status:z.ConversationStatus.OPEN}),p.info("agentMessengerSession.refreshActiveChannel: refreshed active channel",T.active_channel.channel_url),T.active_channel.channel_url}else throw p.error("agentMessengerSession.refreshActiveChannel: userSession is not ready"),new Error("userSession is not ready")},[fe,s,a,_==null?void 0:_.userId,l,c,u,t,g.messenger.getSettings,g.messenger.setSettings]),ae=d.useCallback(async P=>{if(!(_!=null&&_.userId))throw new Error("Current user is not authenticated. Please authenticate first.");const T=await fe({...P,userId:_.userId,knownActiveChannelUrl:void 0}),O=T.active_channel.channel_url;return g.messenger.setSettings(_.userId,T),O},[_==null?void 0:_.userId,fe]);return Fe.useGroupChannelHandler(i,{onChannelChanged:P=>{var T;P.isGroupChannel()&&P.url===(E==null?void 0:E.url)&&(p.info("agentMessengerSession.channelChanged: channel.conversation",P.conversation),b({url:P.url,status:((T=P.conversation)==null?void 0:T.status)??z.ConversationStatus.OPEN}))}}),d.useImperativeHandle(o,()=>{const P=async()=>{if(!E)throw new Error("No active conversation. Please start a conversation first.");return await i.groupChannel.getChannel(E.url)};return{activeChannel:E,chatSDK:i,authenticate:Se,deauthenticate:V,updateContext:async T=>{const H=await(await P()).updateContext(a,T);return{...H,context:H.context??{}}},patchContext:async T=>{const H=await(await P()).patchContext(a,T);return{...H,context:H.context??{}}},getContextObject:async()=>{const O=await(await P()).getContextObject(a);return{...O,context:O.context??{}}}}},[Se,V,E,i,a,p]),r.createElement(ls,{value:{sdkUser:h,userSessionInfo:e,userSession:_,activeChannel:E,setActiveChannel:b,refreshActiveChannel:w,createConversation:ae,connectionError:C,aiAgentInfo:S,launcherInfo:$,authenticate:Se,deauthenticate:V,createAttachmentRules:J}},n)}),rr=e=>{const{chatSDK:t}=W(),[n,o]=d.useState([]);return Fe.useGroupChannelHandler(t,{onTypingStatusUpdated(s){if(s.url===(e==null?void 0:e.url)){const a=s.getTypingUsers();o(a)}}}),n},ds=({channel:e,messages:t})=>{const{aiAgentInfo:n,userSession:o}=ct(),s=us(),a=ms({channel:e,lastMessage:mn(t,[Te.SendingStatus.SUCCEEDED]),aiAgentUserId:(n==null?void 0:n.userId)??""}),i=ps({shouldApply:!!(e!=null&&e.isAIAgent)&&!Ne(e),isDisabledWhileAIResponding:a,lastMessage:mn(t,[Te.SendingStatus.PENDING,Te.SendingStatus.SUCCEEDED]),currentUserId:(o==null?void 0:o.userId)??""});if(!e||!s)return{disabled:!0,disabledBy:"unavailable"};if(ve(e))return{disabled:!0,disabledBy:"conversation_closed"};if(gs(e))return{disabled:!0,disabledBy:"form_active"};const l=hs(e);return l?{disabled:!0,disabledBy:l}:a||i?{disabled:!0,disabledBy:"ai_responding"}:{disabled:!1,disabledBy:""}},us=()=>{const e=d.useId(),{chatSDK:t}=W(),[n,o]=d.useState(!0);return d.useEffect(()=>{const s=new K.ConnectionHandler({onDisconnected:()=>o(!1),onConnected:()=>o(!0),onReconnectSucceeded:()=>o(!0)});return t.addConnectionHandler(e,s),()=>{t.removeConnectionHandler(e)}},[t]),n},ms=({channel:e,lastMessage:t,aiAgentUserId:n})=>{const[o,s]=d.useState(!1),a=rr(e);return d.useEffect(()=>{if(!t)return;const i=a.some(c=>c.userId===n),l=Pe(t,n)&&me.isStreaming(t);s(!!(l||i))},[a,t,n]),o},gs=e=>{var i;const t=e==null?void 0:e.lastMessage;if(!t||!e)return!1;const n=t.extendedMessagePayload,o=n==null?void 0:n.form,s=o&&!o.submitted_at&&!o.canceled_at,a=e.isAIAgent&&!!((i=e.conversation)!=null&&i.handedOverAt);return s&&!a},hs=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},fs=3e4,ps=({shouldApply:e,lastMessage:t,isDisabledWhileAIResponding:n,currentUserId:o})=>{const[s,a]=d.useState(!1),i=d.useRef(null),l=t&&Pe(t,o)?t.createdAt:0;return d.useEffect(()=>{const c=()=>{i.current&&(clearTimeout(i.current),i.current=null),a(!1)},u=x=>{i.current&&clearTimeout(i.current),a(!0),i.current=setTimeout(()=>{a(!1),i.current=null},x)},g=Date.now()-l,p=fs-g;return n||p<=0?c():u(p),()=>{i.current&&clearTimeout(i.current)}},[n,l]),s&&e},{Provider:bs}=Z("AIAgentConversation");function Es({children:e,channelUrl:t,onChannelDeleted:n,onMessagesReceived:o,onMessagesUpdated:s,onConversationClosedViaDispatcher:a,onBeforeSendMessage:i,onAfterSendMessage:l=ye,shouldMarkAsRead:c=!0,sortComparator:u}){var M;const g=()=>c&&(v==null?void 0:v.markAsRead()),{chatSDK:p,logger:x,dispatcher:C}=W(),{channel:v,channelFetchError:E,fetchChannel:b}=xs(t),h=Oo(p,v,{shouldCountNewMessages:()=>!1,onChannelDeleted:n,onMessagesReceived:S=>o==null?void 0:o(S),onMessagesUpdated:S=>s==null?void 0:s(S),logger:x,markAsRead:g,sortComparator:u}),y=ds({channel:v,messages:h.messages});d.useEffect(()=>{g()},[c]),d.useEffect(()=>{const S=async k=>{const $=typeof(k==null?void 0:k.channelUrl)=="string";v&&$&&k.channelUrl!==v.url||(x.debug("conversation.dispatcher: try to close conversation",v),v!=null&&v.conversation&&v.conversation.status===z.ConversationStatus.OPEN&&(await v.closeConversation(),a==null||a()))};return C.subscribe(Mt.ConversationClose,S),()=>{C.unsubscribe(Mt.ConversationClose,S)}},[C,(M=v==null?void 0:v.conversation)==null?void 0:M.status,a]);const _={conversation:(v==null?void 0:v.conversation)??void 0,channelSource:{channel:v,error:E,refetch:()=>b(),closeConversation:async()=>{ve(v)||await(v==null?void 0:v.closeConversation())}},messageSource:{messages:h.messages,initialized:h.initialized,loadPrevious:()=>h.loadPrevious(),loadNext:()=>h.loadNext(),deleteMessage:S=>h.deleteMessage(S),resendMessage:S=>h.resendMessage(S),sendUserMessage:async S=>{var $;if((($=v==null?void 0:v.conversation)==null?void 0:$.status)===z.ConversationStatus.CLOSED)throw new Error("Conversation is closed");i&&(S=await i(S));const k=await h.sendUserMessage(S,l);return l==null||l(k),k},sendFileMessage:async S=>{var $;if((($=v==null?void 0:v.conversation)==null?void 0:$.status)===z.ConversationStatus.CLOSED)throw new Error("Conversation is closed");i&&(S=await i(S));const k=await h.sendFileMessage(S,l);return l==null||l(k),k}},state:{input:y}};return r.createElement(bs,{value:_},e)}function xs(e){const{chatSDK:t,logger:n}=W(),{sdkUser:o}=ct(),[s,a]=d.useState(void 0),[i,l]=d.useState(void 0);async function c(){if(!o){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 u=await t.groupChannel.getChannel(e);a(u),n.debug("conversation.fetchChannel: fetched channel",u)}catch(u){u instanceof K.SendbirdError&&l(u),n.error("conversation.fetchChannel: error",u)}}return vs(s),d.useEffect(()=>{c()},[t,o,e]),{channel:s,channelFetchError:i,fetchChannel:c}}function vs(e){const{chatSDK:t}=W(),{activeChannel:n,setActiveChannel:o}=ct(),s=d.useId();d.useEffect(()=>{if(!e||!n)return;const a=new K.ConnectionHandler({onReconnectSucceeded:async()=>{var l;const i=await e.refresh();i.url===n.url&&o({url:i.url,status:((l=i.conversation)==null?void 0:l.status)??z.ConversationStatus.OPEN})}});return t.addConnectionHandler(s,a),()=>{t.removeConnectionHandler(s)}},[t,e,n])}class ys{constructor(t,{filter:n,limit:o=20}){F(this,"filter");F(this,"_sdk");F(this,"_pinnedChannels");F(this,"_channels");F(this,"_isDisposed",!1);F(this,"_handlerId",`handler-id-${Date.now()}`);F(this,"_order",nt.GroupChannelListOrder.LATEST_LAST_MESSAGE);F(this,"_limit");F(this,"_query");F(this,"_token");F(this,"_timestamp");F(this,"_isSyncing");F(this,"_channelHandler");F(this,"_connectionHandler");F(this,"_collectionEventHandler");var s,a,i,l,c,u,g;this.filter=n,this._sdk=t,this._pinnedChannels=[],this._channels=[],this._limit=o,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:(u=this.filter)==null?void 0:u.copilotConversationOnly,copilotSupportChannelUrl:(g=this.filter)==null?void 0:g.copilotSupportChannelUrl,limit:this._limit}),this._token="",this._timestamp=Number.MAX_SAFE_INTEGER,this._isSyncing=!1,this._channelHandler=new nt.GroupChannelHandler({onChannelChanged:p=>{p.isGroupChannel()&&(this._query.belongsTo(p)?this._addChannelsToView([p],!1):this._removeChannelsFromView([p.url]))},onChannelDeleted:p=>{this._removeChannelsFromView([p])}}),this._connectionHandler=new K.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)??[]),o=t.find(l=>!n.has(l.url));let s;o?s=((i=o.lastMessage)==null?void 0:i.createdAt)??o.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)??[],o=new Map(n.map((c,u)=>[c,u])),s=[],a=[],i=[];for(const c of t){if(!this._query.belongsTo(c)){i.push(c.url);continue}const u=o.get(c.url);if(u===void 0)continue;const g=Rt(this._pinnedChannels,c);g>=0?(this._pinnedChannels.splice(g,1),a.push(c)):s.push(c);const x=this._pinnedChannels.findIndex(v=>(o.get(v.url)??1/0)>u),C=x===-1?this._pinnedChannels.length:x;this._pinnedChannels.splice(C,0,c)}return{addedChannels:s,updatedChannels:a,unmatchedChannelUrls:i}}_upsertRegularChannelsToArray(t,n=!1){const o=[],s=[],a=[];for(const i of t){if(!this._query.belongsTo(i)){o.push(i.url);continue}const l=Rt(this._channels,i),c=l<0;!c&&this._channels.splice(l,1);const g=Cs(this._channels,i,this._order).place,p=g===this._channels.length;c?p?(n||!this.hasMore)&&(this._channels.push(i),s.push(i)):(this._channels.splice(g,0,i),s.push(i)):(this._channels.splice(g,0,i),a.push(i))}return{addedChannels:s,updatedChannels:a,unmatchedChannelUrls:o}}_addChannelsToView(t,n=!1){var p,x,C,v,E;const o=new Set(((p=this.filter)==null?void 0:p.pinnedChannelUrls)??[]),s=[],a=[];for(const b of t)o.has(b.url)?s.push(b):a.push(b);const i=this._upsertPinnedChannelsToArray(s),l=this._upsertRegularChannelsToArray(a,n),c=i.addedChannels.concat(l.addedChannels),u=i.updatedChannels.concat(l.updatedChannels),g=i.unmatchedChannelUrls.concat(l.unmatchedChannelUrls);c.length>0&&((C=(x=this._collectionEventHandler)==null?void 0:x.onChannelsAdded)==null||C.call(x,{},c)),u.length>0&&((E=(v=this._collectionEventHandler)==null?void 0:v.onChannelsUpdated)==null||E.call(v,{},u)),g.length>0&&this._removeChannelsFromView(g)}_removeChannelsFromView(t){var s,a,i;const n=new Set(((s=this.filter)==null?void 0:s.pinnedChannelUrls)??[]),o=[];for(const l of t)if(n.has(l)){const c=this._pinnedChannels.findIndex(u=>u.url===l);c>=0&&(o.push(l),this._pinnedChannels.splice(c,1))}else{const c=this._channels.findIndex(u=>u.url===l);c>=0&&(o.push(l),this._channels.splice(c,1))}o.length>0&&((i=(a=this._collectionEventHandler)==null?void 0:a.onChannelsDeleted)==null||i.call(a,{},o))}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._collectionEventHandler=void 0,this._sdk.removeConnectionHandler(this._handlerId),this._sdk.groupChannel.removeGroupChannelHandler(this._handlerId),this._pinnedChannels.length=0,this._channels.length=0)}}const Rt=(e,t)=>e.findIndex(n=>n.isIdentical(t)),Cs=(e,t,n)=>{if(e.length>0){const o=Rt(e,t);let s=0,a=e.length-1,i=Math.floor((s+a)/2);for(;s<a;){const c=En(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:o}}return{place:En(e[i],t,n)>=0?i:i+1,oldPosition:o}}return{place:e.length,oldPosition:-1}},En=(e,t,n)=>{switch(n){case nt.GroupChannelListOrder.LATEST_LAST_MESSAGE:if(e.lastMessage&&t.lastMessage){const o=t.lastMessage.createdAt-e.lastMessage.createdAt;return o===0?t.createdAt-e.createdAt:o}else return e.lastMessage?-1:t.lastMessage?1:t.createdAt-e.createdAt;default:return 0}};function _s(e,t){var v,E,b,h,y,_,M,S,k,$;const n=d.useId(),[o,s]=d.useState(!1),[a,i]=d.useState(null),[l,c]=d.useState([]),[u,g]=d.useState(null),p=d.useRef(!1),x=d.useCallback(async()=>{if(!p.current&&e.currentUser){p.current=!0,s(!1),i(null),c([]);try{u==null||u.dispose();const R=new ys(e,t);R.setConversationListCollectionHandler({onChannelsAdded:()=>{c(R.channels)},onChannelsUpdated:()=>{c(R.channels)},onChannelsDeleted:()=>{c(R.channels)}}),await R.loadMore(),g(R),i(null)}catch(R){g(null),i(R)}finally{s(!0),p.current=!1}}},[e,e.currentUser,(v=t.filter)==null?void 0:v.aiAgentChannelFilter,(b=(E=t.filter)==null?void 0:E.aiAgentConversationStatusFilter)==null?void 0:b.join(),(y=(h=t.filter)==null?void 0:h.aiAgentIds)==null?void 0:y.join(),(_=t.filter)==null?void 0:_.deskChannelFilter,(S=(M=t.filter)==null?void 0:M.pinnedChannelUrls)==null?void 0:S.join(),(k=t.filter)==null?void 0:k.copilotConversationOnly,($=t.filter)==null?void 0:$.copilotSupportChannelUrl,t.limit]),C=d.useCallback(async()=>{if(u)try{await u.loadMore()}catch(R){i(R)}},[u]);return d.useEffect(()=>(e.addConnectionHandler(n,new K.ConnectionHandler({onConnected:()=>x()})),()=>e.removeConnectionHandler(n)),[e,n,x]),d.useEffect(()=>{x()},[x]),d.useEffect(()=>()=>{p.current=!1,u==null||u.dispose()},[u]),{initialized:o,error:a,channels:l,loadMore:C}}const{Provider:Ss}=Z("AIAgentConversationList");function Ts({conversationListLimit:e,conversationListFilter:t,children:n}){var p,x;const{chatSDK:o,aiAgentId:s,queryParams:a}=W(),i={aiAgentIds:[s],aiAgentConversationStatusFilter:[z.ConversationStatus.CLOSED,z.ConversationStatus.OPEN]},l=e??((p=a==null?void 0:a.conversationListParams)==null?void 0:p.limit),c={...i,...(x=a==null?void 0:a.conversationListParams)==null?void 0:x.filter,...t},u=_s(o,{limit:l,filter:c}),g={listSource:{initialized:u.initialized,error:u.error??void 0,channels:u.channels,loadMore:()=>u.loadMore()}};return r.createElement(Ss,{value:g},n)}function As(e){let t="pending",n=e.then(o=>{t="resolved",n=o}).catch(o=>{t="rejected",n=o});return{get value(){if(t==="resolved")return n;throw n}}}const{Provider:ws,useContext:or}=Z("MessageTemplateFetching");function ks({children:e,internalVariables:t}){const n=d.useRef({}),o=d.useRef({}),[s,a]=d.useState({}),i=d.useCallback((u,g)=>{a(p=>({...p,[u]:{fetching:!1,error:!1,...p[u],...g}}))},[]),l=d.useCallback(async({onRequestTemplate:u,onGetCachedTemplate:g,templateKey:p,suspense:x=!1})=>{const C=g(p);if(C)return C;const v=o.current[p];if(v)return v;x||i(p,{fetching:!0});const E=u(p).catch(b=>{throw x||i(p,{error:!0}),b}).finally(()=>{x||i(p,{fetching:!1}),delete o.current[p]});return o.current[p]=E,E},[i]),c={internalVariables:t,fetchTemplate:l,suspend:(u,g)=>{if(n.current[u])return n.current[u];const p=As(g());return n.current[u]=p,p},getIsFetching:u=>{var g;return((g=s[u])==null?void 0:g.fetching)??!1},getHasError:u=>{var g;return((g=s[u])==null?void 0:g.error)??!1}};return r.createElement(ws,{value:c},e)}const dt={VARIABLE:e=>new RegExp(`\\{${e}\\}`,"g"),VIEW_VARIABLE:e=>new RegExp(`"{@${e}}"`,"g")};function Ce({uiTemplateString:e,variables:t={}}){const n=ss(t);return jt({template:e,variables:n,variableKeyPattern:o=>dt.VARIABLE(o)})}function _e({theme:e,uiTemplateString:t,colorVariables:n={}}){return jt({template:t,variables:n,variableKeyPattern:o=>dt.VARIABLE(o),variableValueTransformer:o=>os(e,o)})}function Is({theme:e,uiTemplateString:t,viewVariables:n={},aiAgentColorVariables:o,internalVariables:s,onRequestTemplate:a}){const l=Object.values(n).flat().map(u=>u.key);return[...new Set(l)].some(u=>!a(u))?null:jt({template:t,variables:n,variableKeyPattern:u=>dt.VIEW_VARIABLE(u),variableValueTransformer:u=>{const g=u.map(({key:p,variables:x})=>{const C=a(p),{ui_template:v,color_variables:E}=Ve(C);let b=JSON.stringify(v);return b=Ce({uiTemplateString:b,variables:s}),b=_e({theme:e,uiTemplateString:b,colorVariables:E}),b=_e({theme:e,uiTemplateString:b,colorVariables:o}),b=Ce({uiTemplateString:b,variables:x}),lt(b)});return JSON.stringify(g)}})}async function $s({theme:e,uiTemplateString:t,viewVariables:n={},aiAgentColorVariables:o,internalVariables:s,onRequestTemplate:a}){return as({template:t,variables:n,variableKeyPattern:i=>dt.VIEW_VARIABLE(i),variableValueTransformer:async i=>{const l=i.map(async({key:u,variables:g})=>{const p=await a(u),{ui_template:x,color_variables:C}=Ve(p);let v=JSON.stringify(x);return v=Ce({uiTemplateString:v,variables:s}),v=_e({theme:e,uiTemplateString:v,colorVariables:C}),v=_e({theme:e,uiTemplateString:v,colorVariables:o}),v=Ce({uiTemplateString:v,variables:g}),lt(v)}),c=await Promise.all(l);return JSON.stringify(c)}})}const Ms=({rawTemplate:e,aiAgentColorVariables:t,internalVariables:n,...o})=>{const{ui_template:s,color_variables:a}=Ve(e);let i=JSON.stringify(s);if(Object.keys(o.viewVariables??{}).length>0){const c=Is({...o,uiTemplateString:i,aiAgentColorVariables:t,internalVariables:n});if(c===null)return null;i=c}return i=Ce({...o,uiTemplateString:i,variables:n}),i=_e({...o,uiTemplateString:i,colorVariables:a}),i=_e({...o,uiTemplateString:i,colorVariables:t}),i=Ce({...o,uiTemplateString:i}),lt(i)},Ls=async({rawTemplate:e,aiAgentColorVariables:t,internalVariables:n,...o})=>{const{ui_template:s,color_variables:a}=Ve(e);let i=JSON.stringify(s);return Object.keys(o.viewVariables??{}).length>0&&(i=await $s({...o,uiTemplateString:i,aiAgentColorVariables:t,internalVariables:n})),i=Ce({...o,uiTemplateString:i,variables:n}),i=_e({...o,uiTemplateString:i,colorVariables:a}),i=_e({...o,uiTemplateString:i,colorVariables:t}),i=Ce({...o,uiTemplateString:i}),lt(i)},Os=e=>{const{aiAgentColorVariables:t={}}=e,{internalVariables:n}=or();return d.useState(()=>{const o=e.onGetCachedTemplate(e.templateKey);return o?Ms({...e,rawTemplate:o,aiAgentColorVariables:t,internalVariables:n,onRequestTemplate:e.onGetCachedTemplate}):null})},Ds=e=>{const[t]=Os(e);if(t)return t;const{aiAgentColorVariables:n={}}=e,{internalVariables:o,fetchTemplate:s,suspend:a}=or();return a(e.templateKey,async()=>{const l=await s({...e,suspense:!0});return await Ls({...e,rawTemplate:l,aiAgentColorVariables:n,internalVariables:o})}).value},Rs="remove_powered_by",Kt=(e,t)=>{var s,a;const{chatSDK:n}=W(),{aiAgentInfo:o}=ct();if(e==="handoff-button"){const i=!!((s=t==null?void 0:t.conversation)!=null&&s.handoff);return!!(t!=null&&t.isAIAgent)&&!!(o!=null&&o.showHandoffButton)&&i&&It(t)}if(e==="special-notice")return!!(t!=null&&t.isAIAgent)&&!!(o!=null&&o.specialNoticeEnabled)&&!!(o!=null&&o.specialNotice);if(e==="powered-by"){const i=(a=n==null?void 0:n.appInfo)==null?void 0:a.applicationAttributes;return d.useMemo(()=>!(Array.isArray(i)&&i.includes(Rs)),[i])}throw new Error("Unsupported feature")},Ns={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"},Ps={getValueOrDefault:e=>e.value??e.default_value??null,validate:(e,t,n)=>{const o=t;if(e.required&&(!o||o.trim()===""))return{isValid:!1,error:n.required};if(!o)return{isValid:!0};const{rules:s}=e;if(s){if(s.min_length!==void 0&&o.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&&o.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(o))return{isValid:!1,error:n.regex}}return{isValid:!0}}},Bs={getValueOrDefault:e=>e.value??e.default_value??null,validate:(e,t,n)=>{const o=t;if(e.required&&o===null)return{isValid:!1,error:n.required};if(o===null)return{isValid:!0};const{rules:s}=e;if(s){if(s.min!==void 0&&o<s.min)return{isValid:!1,error:typeof n.min=="function"?n.min(s.min):n.min};if(s.max!==void 0&&o>s.max)return{isValid:!1,error:typeof n.max=="function"?n.max(s.max):n.max}}return{isValid:!0}}},Fs={getValueOrDefault:e=>e.value??e.default_value??null,validate:(e,t,n)=>{const o=t;return e.required&&!o?{isValid:!1,error:n.required}:o&&!e.options.includes(o)?{isValid:!1,error:n.invalidSelection}:{isValid:!0}}},Us={getValueOrDefault:e=>e.values??e.default_values??null,validate:(e,t,n)=>{const o=t;if(e.required&&(!o||o.length===0))return{isValid:!1,error:n.required};if(!o||o.length===0)return{isValid:!0};if(o.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&&o.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&&o.length>a.max_select)return{isValid:!1,error:typeof n.maxSelect=="function"?n.maxSelect(a.max_select):n.maxSelect}}return{isValid:!0}}},Hs={text:Ps,number:Bs,"single-select":Fs,"multi-select":Us},zs={getValueOrDefault:()=>null,validate:()=>({isValid:!1})};function sr(e){return Hs[e.type]||zs}function xn(e){return sr(e).getValueOrDefault(e)}function Vs(e,t,n={}){const o={...Ns,...n};return sr(e).validate(e,t,o)}const Gs=(e,t={})=>{const{labels:n={},onSubmit:o,onCancel:s}=t,[a,i]=d.useState({}),[l,c]=d.useState(()=>{const E={};return e.fields.forEach(b=>{E[b.key]=xn(b)}),E}),u=d.useMemo(()=>e.submitted_at?"submitted":e.canceled_at?"canceled":"draft",[e.submitted_at,e.canceled_at]);d.useEffect(()=>{if(u==="submitted"||u==="canceled"){const E={};let b=!1;e.fields.forEach(h=>{const y=xn(h);JSON.stringify(l[h.key])!==JSON.stringify(y)&&(b=!0),E[h.key]=y}),b&&c(E)}},[u]);const g=(E,b)=>{c(h=>({...h,[E]:b})),i(h=>({...h,[E]:void 0}))},p=e.fields.map(E=>{var y,_,M;const b=l[E.key]??null,h={key:E.key,label:E.label,error:a[E.key],required:E.required};return E.type==="text"?{...h,type:"text",layout:E.layout,value:b,...E.placeholder&&{placeholder:E.placeholder},...((y=E.rules)==null?void 0:y.max_length)&&{maxLength:E.rules.max_length}}:E.type==="number"?{...h,type:"number",layout:E.layout,value:b,...E.placeholder&&{placeholder:E.placeholder},...((_=E.rules)==null?void 0:_.max)&&{max:E.rules.max}}:E.type==="single-select"?{...h,type:"single-select",layout:E.layout,value:b,options:E.options}:E.type==="multi-select"?{...h,type:"multi-select",layout:E.layout,value:b,options:E.options,...((M=E.rules)==null?void 0:M.max_select)&&{maxSelect:E.rules.max_select}}:{...h,type:"unknown",layout:"default",value:null}});return{state:u,fields:p,getField:E=>p.find(b=>b.key===E),updateFieldValue:g,submit:async()=>{const E={};let b=!1;for(const h of e.fields){const y=l[h.key]??null,_=Vs(h,y,n);_.isValid||(E[h.key]=_.error,b=!0)}if(i(E),!b&&o){const h={};e.fields.forEach(y=>{h[y.key]=l[y.key]??null}),await o(h)}},cancel:async()=>{await(s==null?void 0:s())}}},ar=({channel:e,userSession:t,aiAgentInfo:n})=>{if(!t||!n)return{fallbackIcon:"bot-filled",url:void 0,title:""};const o={ai(a){return{fallbackIcon:a,url:n.profileUrl,title:n.nickname}},human(a){return{fallbackIcon:a,url:s==null?void 0:s.profileUrl,title:(s==null?void 0:s.nickname)||n.nickname}},channel(a){return{fallbackIcon:a,url:e==null?void 0:e.coverUrl,title:(e==null?void 0:e.name)??""}}};if(!e)return o.ai("bot-filled");const s=(()=>{const[a]=e.members.filter(i=>i.userId!==t.userId);return a})();return e.isAIAgent?Ne(e)?o.human("agent"):o.ai("bot-filled"):e.isDesk?o.human("agent"):o.channel("user")},vn=e=>d.useReducer((t,n)=>({...t,...n}),e);var re=(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))(re||{});const Ws=new Set(["free_text","single_choice"]),qs=({csatPayload:e,type:t,initialCsat:n,initialCsatReason:o,initialIsResolved:s})=>{const[a,i]=vn({csatType:t,csat:n,csatReason:o,isResolved:s}),[l,c]=vn({followUpItem:!1}),u=d.useMemo(()=>{var E;const C=a.csat;if(typeof C!="number")return;const v=(E=e.follow_up)==null?void 0:E.find(b=>b.scores.includes(C));if(Ws.has(v==null?void 0:v.response_type))return v},[a.csat,e.follow_up]),g=(()=>{var C;if(typeof n=="number")return"submitted";if((t===re.AI_AGENT_CSAT_5||t===re.HELPDESK_CSAT_5)&&typeof a.csat=="number")return"submittable";if(t===re.AI_AGENT_CSAT_5_WITH_CRE){const v=typeof a.csat=="number",E=!((C=e.cre)!=null&&C.required)||typeof a.isResolved=="boolean";if(v&&E)return"submittable"}return"unsubmittable"})(),p=d.useCallback(()=>typeof a.csat>"u"?!1:u!=null&&u.required&&!a.csatReason?(c({followUpItem:!0}),!1):!0,[a,u,c]);return d.useEffect(()=>{o||(i({csatReason:""}),c({followUpItem:!1}))},[o,u,i,c]),{params:a,setParams:i,error:l,setError:c,followUpItem:u,state:g,validateParams:p,itemProps:{csatPayload:e,state:g,submitted:g==="submitted"}}},_t=5,js=e=>e<1e3?{speed:_t*.5,chunkSize:2}:e<2e3?{speed:_t*.8,chunkSize:2}:{speed:_t*.6,chunkSize:3},Ks=(e,t=!1)=>{const[n,o]=d.useState(0),s=d.useRef(null),a=d.useRef(0),i=d.useRef(0),l=d.useRef(t);return d.useEffect(()=>{if(!l.current){o(e.length);return}o(c=>e.length<c?(a.current=0,i.current=0,0):c)},[e]),d.useEffect(()=>{if(!l.current||n>=e.length)return;const c=u=>{a.current===0&&(a.current=u,i.current=u);const g=u-a.current,p=u-i.current,{speed:x,chunkSize:C}=js(p),v=x*C;g>=v&&(o(E=>Math.min(E+C,e.length)),a.current=u),s.current=requestAnimationFrame(c)};return s.current=requestAnimationFrame(c),()=>{s.current&&cancelAnimationFrame(s.current)}},[e.length,n]),e.slice(0,n)},Zs='@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}',Ys={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.",unknown_message_type:"(Unknown message type)",powered_by:"Powered by",citation_title:"Source",start_new_conversation_label:"Talk to agent",failed_message_resend:"Retry",failed_message_remove:"Remove",file_upload_no_supported_files:"No supported file types available."},conversation_list:{header_title:"Conversations",ended:"Ended"},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"}},Nt={language:"en",strings:Ys,dateLocale:eo.enUS},ir=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,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}),Xs=e=>{var t;return((t=e.split("-"))==null?void 0:t[0])??ut},ut="en",Js=new Set([ut,"ko","es","pt","fr","hi","it","de","tr","ja"]),Qs=(e,t,n)=>{const o=e[t];return o?typeof o=="function"?o():Promise.resolve(o):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.":""))))})},yn=ir(Nt.strings),ea={...yn,CHANNEL_FROZEN:"Channel frozen",HEADER_BUTTON__AGENT_HANDOFF:"Connect with an agent",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Select an option to continue",BUTTON__CANCEL:"Cancel",BUTTON__SAVE:"Save",BUTTON__OK:"OK",BUTTON__SUBMIT:"Submit",NO_NAME:"(No name)",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",CONVERSATION_CLOSED_FOOTER_LABEL:"Your conversation has ended",START_NEW_CONVERSATION:"💬 Start a new conversation",RETURN_TO_CONVERSATION:"💬 Return to conversation",CONVERSATION_LIST__TOPICS_FALLBACK:"No category",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:yn.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"h:mma"},rt={language:Nt.language,dateLocale:Nt.dateLocale,stringSet:ea},ta=Object.freeze(Object.defineProperty({__proto__:null,default:rt},Symbol.toStringTag,{value:"Module"})),Pt=new Map([[ut,rt]]);async function na(e){const t=Pt.get(e);if(t)return t;try{if(Js.has(e)){const{default:n}=await Qs(Object.assign({"./languages/de.ts":()=>Promise.resolve().then(()=>require("./tGGb6-qE.cjs")),"./languages/en.ts":()=>Promise.resolve().then(()=>ta),"./languages/es.ts":()=>Promise.resolve().then(()=>require("./DD4_-VGR.cjs")),"./languages/fr.ts":()=>Promise.resolve().then(()=>require("./DxFzlD-n.cjs")),"./languages/hi.ts":()=>Promise.resolve().then(()=>require("./BLGgSz7p.cjs")),"./languages/it.ts":()=>Promise.resolve().then(()=>require("./BuQ_QZ4-.cjs")),"./languages/ja.ts":()=>Promise.resolve().then(()=>require("./BQTRXuUH.cjs")),"./languages/ko.ts":()=>Promise.resolve().then(()=>require("./o5ARYAZY.cjs")),"./languages/pt.ts":()=>Promise.resolve().then(()=>require("./mKv2GmAz.cjs")),"./languages/tr.ts":()=>Promise.resolve().then(()=>require("./R03mJ8P7.cjs"))}),`./languages/${e}.ts`,3);return Pt.set(e,n),n}return rt}catch{return rt}}const{Provider:ra,useContext:B}=Z("Localization"),oa=({language:e=navigator.language,logger:t,stringSet:n,children:o})=>{const[s,a]=d.useState(Pt.get(ut));return d.useEffect(()=>{const i=Xs(e);s.language!==i&&(t==null||t.debug("localization.useEffect: update language",{from:s.language,to:i}),na(i).then(a))},[e,t]),r.createElement(ra,{value:{language:s.language,stringSet:{...s.stringSet,...n},dateLocale:s.dateLocale,format:(i,l,c)=>xe.format(i,l,{locale:s.dateLocale,...c})}},o)},ot="data-sb-agent-theme",Cn=e=>(t,...n)=>{let o="";return t.forEach((s,a)=>{o+=s+(n[a]??"")}),`[${ot}='${e}'] & { ${o} }`},D={light:Cn("light"),dark:Cn("dark")},sa=A.css(({theme:e})=>{const{palette:t}=e;return`
2
2
  :root,
3
3
  :host {
4
4
  --sendbird-primary-extra-dark: ${t.primary.extraDark};
@@ -55,7 +55,7 @@
55
55
  ${D.dark`
56
56
  background-color: ${m.color.background400};
57
57
  `}
58
- `,Ga=f.default.img`width:100%;height:100%;object-fit:cover;`,Wa=f.default.video`width:100%;height:100%;object-fit:cover;`,qa="✱",mr=e=>{const t=new RegExp(`(\`+)([^\`]+?)\\1|(${qa}+)`,"g");return e.replace(t,(n,o,s,a)=>o?n:a?`<span id=${Ua} aria-label="masked-text">${a}</span>`:n)},ja=e=>e.replace(/\*\*(.*?)\*\*/g,"<b>$1</b>"),Ka=d.lazy(async()=>({default:(await Promise.resolve().then(()=>require("./BzFcEwZu.cjs"))).MarkdownText})),Za=d.lazy(async()=>({default:(await Promise.resolve().then(()=>require("./DlvEEpWX.cjs"))).CodeBlock}));function Sn(e){var a,i;const t=e.maxBodyWidth??N.BODY_MAX_WIDTH,n=Ks(e.message,e.isStreaming),o=d.useMemo(()=>yo(n,mr),[n]),s={id:`${ge}-text-body`,$maxWidth:t,$color:(a=e.customStyle)==null?void 0:a.bubbleContentColor,$bgColor:(i=e.customStyle)==null?void 0:i.bubbleBackgroundColor};return o.length===0?e.children?r.createElement(Tn,{...s},e.children):null:r.createElement(Tn,{...s},o.map((l,c)=>l.type==="text"?r.createElement(An,{key:c,variant:"body3"},r.createElement(st,{fallback:l.value},r.createElement(Ka,{onClickImage:u=>{var g;return(g=e.onClickMedia)==null?void 0:g.call(e,{url:u,type:"image/*"})}},l.value))):l.type==="code"?r.createElement(st,{key:c,fallback:r.createElement(An,{variant:"body3"},l.value)},r.createElement(Za,{code:l.value,language:l.language})):null),e.children)}const Tn=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})=>A.css`
58
+ `,Ga=f.default.img`width:100%;height:100%;object-fit:cover;`,Wa=f.default.video`width:100%;height:100%;object-fit:cover;`,qa="✱",mr=e=>{const t=new RegExp(`(\`+)([^\`]+?)\\1|(${qa}+)`,"g");return e.replace(t,(n,o,s,a)=>o?n:a?`<span id=${Ua} aria-label="masked-text">${a}</span>`:n)},ja=e=>e.replace(/\*\*(.*?)\*\*/g,"<b>$1</b>"),Ka=d.lazy(async()=>({default:(await Promise.resolve().then(()=>require("./B0MxbJ5V.cjs"))).MarkdownText})),Za=d.lazy(async()=>({default:(await Promise.resolve().then(()=>require("./DlvEEpWX.cjs"))).CodeBlock}));function Sn(e){var a,i;const t=e.maxBodyWidth??N.BODY_MAX_WIDTH,n=Ks(e.message,e.isStreaming),o=d.useMemo(()=>yo(n,mr),[n]),s={id:`${ge}-text-body`,$maxWidth:t,$color:(a=e.customStyle)==null?void 0:a.bubbleContentColor,$bgColor:(i=e.customStyle)==null?void 0:i.bubbleBackgroundColor};return o.length===0?e.children?r.createElement(Tn,{...s},e.children):null:r.createElement(Tn,{...s},o.map((l,c)=>l.type==="text"?r.createElement(An,{key:c,variant:"body3"},r.createElement(st,{fallback:l.value},r.createElement(Ka,{onClickImage:u=>{var g;return(g=e.onClickMedia)==null?void 0:g.call(e,{url:u,type:"image/*"})}},l.value))):l.type==="code"?r.createElement(st,{key:c,fallback:r.createElement(An,{variant:"body3"},l.value)},r.createElement(Za,{code:l.value,language:l.language})):null),e.children)}const Tn=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})=>A.css`
59
59
  color: ${t||e.colors.messageIncoming.text};
60
60
  background-color: ${n||e.colors.messageIncoming.background};
61
61
  `}
@@ -227,7 +227,7 @@
227
227
  color: ${t};
228
228
  }
229
229
  `}
230
- `,Je=f.default.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`,at=f.default.div`display:flex;gap:8px;align-items:center;word-break:break-word;`,Fc=f.default(at)`cursor:pointer;gap:4px;`,At=f.default(at)`flex-direction:row;align-items:center;`,Nn=f.default.div`display:flex;gap:4px;flex-direction:column;align-items:flex-start;`,Sr=d.createContext(null);function Uc({testerType:e,origin:t,children:n}){return r.createElement(Sr.Provider,{value:{testerType:e,isActionbookTester:e==="actionbook",origin:t}},e&&r.createElement(Hc,null),n)}const $e=()=>{const e=d.useContext(Sr);if(!e)throw new Error("_UNSAFE_INTERNAL_DashboardTesterProvider not found");return e},Hc=()=>{const{isActionbookTester:e}=$e();return r.createElement(we.Template,{template:e?zc:void 0},r.createElement(we.MessageLogs,{component:Vc}))},zc=e=>r.createElement(vr,{...e,testerMode:!0,maxBodyWidth:N.WIDE_BODY_MAX_WIDTH}),Vc=({extendedMessagePayload:e={}})=>{const{handlers:t}=G(),{manual:n,groundedness:o,function_calls:s,agent_message_templates:a,is_thinking:i}=e;return i||!n&&!(o!=null&&o.length)&&!(s!=null&&s.length)&&!(a!=null&&a.length)?r.createElement(r.Fragment,null):r.createElement(Gc,null,r.createElement(Wc,{width:4}),r.createElement(_r,{actionbook:n,functionCalls:s,groundedness:o,agentMessageTemplates:a,onClickFunctionCallDetail:t==null?void 0:t.onFunctionCallDetailClick,style:{iconColor:m.themedColor.textHighEmphasis,textColor:m.themedColor.textHighEmphasis,barColor:m.themedColor.textDisabled},bottomContent:r.createElement(qc,{variant:"caption2",color:m.themedColor.textLowEmphasis},"Only visible in the tester")}))},Gc=f.default.div`display:flex;gap:16px;margin:16px ${N.HORIZONTAL_PADDING}px 0;align-self:stretch;`,Wc=f.default.div`width:${({width:e})=>e}px;background-color:${m.themedColor.textDisabled};border-radius:100px;flex-shrink:0;`,qc=f.default(I)`margin-top:5px;`,jc=e=>{const{chatSDK:t,handlers:n,logger:o}=G(),{aiAgentInfo:s}=Y(),a=d.useRef(new Set),i=g=>{if(!(n!=null&&n.onCustomEvent))return;ue(g)&&g.sender.userId===s.userId&&!me.isStreaming(g)&&!a.current.has(g.messageId)&&(o.debug("useCustomEventForMessageReceive: bot-message-received",g),n.onCustomEvent({type:"bot-message-received",data:{message:g}}),a.current.add(g.messageId))},l=g=>{if(n!=null&&n.onCustomEvent&&g.isAdminMessage()&&g.customType==="user_action_required"&&!a.current.has(g.messageId)){const p=$t(g.data);Array.isArray(p.history)&&p.history.length===0&&(o.debug("useCustomEventForMessageReceive: user_action_required",p),n.onCustomEvent({type:"user-action-requested",data:p}),a.current.add(g.messageId))}},c=(g,p)=>{g.url===e&&(i(p),l(p))},u=g=>{l(g)};return Fe.useGroupChannelHandler(t,{onMessageUpdated:c,onMessageReceived:c}),{checkForUserActionRequired:u}};function Kc(e){return new Promise(t=>{const n=new Image;n.onload=function(){const o=String(n.width),s=String(n.height);URL.revokeObjectURL(n.src),t({width:o,height:s})},n.src=URL.createObjectURL(e)})}async function Zc(e){if("file"in e&&e.file instanceof File&&e.file.type.startsWith("image/")){const{width:t,height:n}=await Kc(e.file);return new Te.MessageMetaArray({key:qn,value:[t,n]})}}const Yc=({onScrollAfterSendMessage:e})=>{const{agentPreviewConfigs:t,handlers:n}=G(),o=d.useRef(t==null?void 0:t.agentAttributes);return o.current=t==null?void 0:t.agentAttributes,{onBeforeSendMessage:async s=>{const a=await Zc(s),i={...s,metaArrays:a?[a]:void 0},l=Xc(o.current);return l?{...i,data:JSON.stringify(l)}:i},onAfterSendMessage:s=>{var a,i,l;e(),(a=n==null?void 0:n.onMessageSend)==null||a.call(n,s.message),s.sendingStatus===Te.SendingStatus.SUCCEEDED?(i=n==null?void 0:n.onCustomEvent)==null||i.call(n,{type:"message-sent-succeeded",data:{message:s}}):s.sendingStatus===Te.SendingStatus.PENDING&&((l=n==null?void 0:n.onCustomEvent)==null||l.call(n,{type:"message-sent-pending",data:{message:s}}))}}},Xc=e=>{if(!e)return null;const t={};return e.ai&&Object.keys(e.ai).length>0&&(t.ai_attrs=e.ai),e.safeguard&&Object.keys(e.safeguard).length>0&&(t.safeguard_attrs=e.safeguard),typeof e.use_prompt_cache=="boolean"&&(t.use_prompt_cache=e.use_prompt_cache),Object.keys(t).length>0?t:null},Tr=50,wt=Tr-20,{Provider:Jc,useContext:Qc}=Z("ConversationScroll"),Pn={viewport:0,contentHeight:0,contentSnapshotHeight:0,shouldRecalc:!1,shouldUpdate:!1};function ed({scrollMode:e,children:t}){const n=d.useRef(null),o=d.useRef(null),s=d.useRef(Pn),a=d.useRef(!1),i=d.useRef(null),[l,c]=d.useState(0),[u,g]=d.useState(0),[p,x]=d.useState(!1),[C,v]=d.useState(!1),[E,b]=d.useState(!1),h=d.useMemo(()=>p?"auto":e,[p,e]),y=d.useCallback(T=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{v(!1)},T)},[]),_=()=>{s.current.contentSnapshotHeight=s.current.contentHeight,s.current.shouldUpdate=!0,s.current.shouldRecalc=!0},M=()=>{const T=n.current;!T||!s.current.shouldUpdate||c(O=>{s.current.shouldUpdate=!1;const{contentHeight:H,contentSnapshotHeight:ie,shouldRecalc:le}=s.current,ee=T.clientHeight;if(ie>H)return O;const Me=S(T,{messageType:"outgoing"});let pe=0;if(Me){const be=Me.message.offsetTop-wt+ee;pe=Math.max(0,be-H)}else{const be=H-ie,He=ee-wt;pe=Math.max(0,be-He)}return O===0||pe!==O||le?(s.current.shouldRecalc=!1,pe):O})},S=d.useCallback((T,O)=>{const{messageType:H="all"}=O??{},ie=Array.from(T.querySelectorAll(`#${te}-message-item`));let le=ie;H==="outgoing"&&(le=ie.filter(xt=>xt.getAttribute("data-layout-id")==="outgoingmessage"));const ee=le[le.length-1];if(!ee)return null;const Me=T.getBoundingClientRect(),pe=ee.getBoundingClientRect(),be=T.scrollTop+(pe.top-Me.top),He=be+ee.offsetHeight;return{message:ee,scrollTop:be,lastMessageBottom:He}},[]),k=d.useCallback(()=>{const T=n.current;if(!T||h!=="fixed")return;const O=S(T);s.current.contentHeight=(O==null?void 0:O.lastMessageBottom)??T.scrollHeight,!a.current&&s.current.contentSnapshotHeight>0&&_();const H=Math.max(0,T.scrollHeight-T.scrollTop-T.clientHeight);g(H),M()},[h,S]),$=d.useCallback(()=>{o.current&&(o.current.disconnect(),o.current=null),s.current=Pn,c(0),g(0)},[]),R=d.useCallback((T=!0)=>{const O=n.current;O&&O.scrollTo({top:O.scrollHeight,behavior:T?"smooth":"auto"})},[]),X=d.useCallback(T=>{T&&(n.current=T,h==="fixed"&&($(),s.current.viewport=T.clientHeight,o.current=new MutationObserver(()=>{k()}),o.current.observe(T,{childList:!0,subtree:!0})))},[h,k,$]),J=d.useCallback(()=>{const T=n.current;if(!T)return;const O=S(T,{messageType:"outgoing"});O&&(T.scrollTo({top:O.message.offsetTop-wt,behavior:"smooth"}),y(500))},[S,y]),se=T=>{const{scrollHeight:O,scrollTop:H,clientHeight:ie}=T.currentTarget,le=Math.max(0,O-H-ie);g(le)},he=d.useCallback(()=>{h==="fixed"&&(v(!0),_())},[h]),fe=d.useCallback(()=>{h==="fixed"?setTimeout(()=>J(),300):R()},[h,J]),Se=d.useCallback(T=>{a.current=T,h==="fixed"&&_()},[h]),V=d.useCallback(T=>{x(T)},[]),w=d.useCallback(T=>{b(T),h==="auto"&&T&&R(!0)},[h,R]),P=!(u<=Tr)&&!C&&!E;return r.createElement(Jc,{value:{ref:X,state:{bottomSpace:l,shouldShowScrollButton:P},props:{onScroll:se},actions:{scrollToBottom:R,onBeforeMessageSend:he,onAfterMessageSend:fe,onStreamingUpdate:Se,onConversationClosed:V,onTypingIndicatorUpdate:w}}},t)}const{Provider:td,Context:nd,useContext:Q}=Z("Conversation"),rd=({children:e})=>{var s;const{channelSource:t}=Q(),n=(s=t.channel)==null?void 0:s.url,{checkForUserActionRequired:o}=jc(n);return d.useEffect(()=>{var i;const a=(i=t.channel)==null?void 0:i.lastMessage;a&&o(a)},[t.channel,o]),r.createElement(r.Fragment,null,e)},Ar=({channelUrl:e,onClearChannelUrl:t,onNavigateToConversationList:n,shouldMarkAsRead:o,children:s})=>{var y;const{config:a}=W(),{activeChannel:i,refreshActiveChannel:l,aiAgentInfo:c}=Y(),{testerType:u}=$e(),g=Qc(),p=((y=a==null?void 0:a.conversation)==null?void 0:y.scrollMode)??"auto",{onBeforeSendMessage:x,onAfterSendMessage:C}=Yc({onScrollAfterSendMessage:()=>{g.actions.onAfterMessageSend()}}),v=e||(i==null?void 0:i.url),E=d.useCallback(_=>(g.actions.onBeforeMessageSend(),x(_)),[g.actions,x]),b=d.useCallback(_=>{const M=_.some(S=>me.isStreaming(S));if(g.actions.onStreamingUpdate(M),p==="auto"){const S=_[_.length-1];S&&me.shouldScrollToBottom(S,c.userId,!!u)&&setTimeout(()=>g.actions.scrollToBottom(!0),100)}},[g.actions,p,c.userId,u]),h=d.useCallback(async()=>{await l(),e&&(t==null||t())},[l,e,t]);return r.createElement(Es,{channelUrl:v,onBeforeSendMessage:E,onAfterSendMessage:C,onMessagesUpdated:b,onMessagesReceived:b,onChannelDeleted:h,shouldMarkAsRead:o},_=>r.createElement(td,{value:{..._,scrollSource:g,goToActiveConversation:h,onNavigateToConversationList:n}},r.createElement(rd,null,s)))},nn=d.createContext({onDrop:ye,subscribe:()=>ye}),Ft=({children:e})=>{const t=d.useRef(new Set);return r.createElement(nn.Provider,{value:{onDrop:n=>{var o;if(n.preventDefault(),(o=n.dataTransfer)!=null&&o.files){const s=Array.from(n.dataTransfer.files);s.length>0&&t.current.forEach(a=>a(s))}},subscribe:n=>(t.current.add(n),()=>t.current.delete(n))}},e)},od=({onDropFiles:e})=>{const{subscribe:t}=d.useContext(nn);d.useEffect(()=>t(e),[e])};Ft.Consumer=({children:e})=>{const{onDrop:t}=d.useContext(nn);return e({onDrop:t,onDragOver:s=>s.preventDefault()})};const rn=({iconSize:e=64,icon:t,className:n,label:o,children:s})=>r.createElement(ad,{className:n},t&&r.createElement(L,{type:t,size:e,color:m.themedColor.textLowEmphasis}),o&&r.createElement(I,{variant:"body1",color:m.themedColor.textMidEmphasis},o),s),sd=f.default.div`position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;`,ad=f.default.div`display:flex;flex-direction:column;min-height:104px;align-items:center;gap:20px;text-align:center;`,id=({label:e="Something went wrong",icon:t="error",action:n,...o})=>r.createElement(rn,{icon:t,label:e,...o},n&&r.createElement(ld,{onClick:n.onClick,label:n.label??"Retry"})),ld=({label:e,onClick:t})=>r.createElement(cd,{tabIndex:0,onClick:t},r.createElement(L,{type:"refresh",size:20}),r.createElement(I,{variant:"button",color:m.color.primary.main},e)),cd=f.default.button`all:unset;display:flex;cursor:pointer;gap:4px;align-items:center;justify-content:center;`,dd=({iconSize:e=48,className:t})=>r.createElement(tn,{size:e,className:t}),ud=({label:e="No channels",icon:t="chat",...n})=>r.createElement(rn,{icon:t,label:e,...n}),md=({label:e="No messages",icon:t="message",...n})=>r.createElement(rn,{icon:t,label:e,...n}),gd=e=>{const{components:t}=pt.useContext(),n=e.type==="loading"?r.createElement(t.Loading,{...e}):e.type==="error"?r.createElement(t.Error,{...e}):e.type==="noChannels"?r.createElement(t.NoChannels,{...e}):e.type==="noMessages"?r.createElement(t.NoMessages,{...e}):null;return n&&r.createElement(sd,null,n)},pt=ke({template:gd,components:{Loading:dd,Error:id,NoChannels:ud,NoMessages:md}}),Be=e=>{const{Template:t}=pt.useContext();return r.createElement(t,{...e})},Bn=e=>jn(e)||Kn(e);function hd(e){return e.isAdminMessage()?e.message==="The channel's custom_type was updated.":!1}function fd(e,t){return e.filter(n=>me.isWelcomeMessage(n,t))}const pd=f.default.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none;`,bd=f.default.div`height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between;border-bottom:1px solid ${m.themedColor.textDisabled};background-color:${m.themedColor.bg_50_600};@media screen and (max-width:768px){position:relative;}`,Ed=f.default.div`box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px;width:calc(100% - 128px);`,xd=f.default.div`margin-inline-end:8px;`,vd=f.default.div`max-width:500px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;@media screen and (max-width:768px){position:absolute;inset-inline-start:64px;top:10px;display:block;max-width:calc(100vw - 240px);}`,yd=f.default.div`display:inline-block;margin-inline-start:8px;padding-top:5px;@media screen and (max-width:768px){position:absolute;inset-inline-start:56px;top:24px;}`,Cd=f.default.div`display:flex;width:160px;justify-content:flex-end;`,_d=f.default.div`inset-inline-end:0;display:flex;flex-direction:row;`,wr=f.default.div`width:64px;padding:21px;box-sizing:border-box;cursor:${e=>e.disabled?"not-allowed":"pointer"};`,Sd=f.default(wr)`border-inline-start:1px solid ${m.themedColor.textDisabled};`,Td=f.default.div`width:100%;height:100%;display:flex;align-items:center;justify-content:center;`,Ad=f.default.video`max-width:100%;max-height:100%;user-select:none;-webkit-user-drag:none;`,wd=f.default.img`max-width:calc(90% - 60px);max-height:calc(90% - 60px);user-select:none;-webkit-user-drag:none;`,kd=f.default.div`max-width:100%;max-height:100%;display:flex;justify-content:center;align-items:center;`,Id=({file:e,sender:t={},onClose:n,onDownloadClick:o})=>{const{type:s,url:a,name:i=""}=e,{profileUrl:l,nickname:c,userId:u}=t,{aiAgentInfo:g}=Y();return r.createElement(Md,{profileUrl:l??"",nickname:c??"",type:s,url:a,name:i,onClose:n,isBotMessage:u===g.userId,onDownloadClick:o})},$d=({profileUrl:e,isBotMessage:t})=>t&&!e?r.createElement(Ld,{$size:32},r.createElement(L,{type:"bot-filled",size:20})):r.createElement(Xt,{size:32,src:e}),Md=({profileUrl:e,isBotMessage:t,nickname:n,name:o,type:s,url:a,onClose:i,onDownloadClick:l})=>{const{stringSet:c}=B();return r.createElement(gt,{onClose:i,visible:!0,rootElementId:ne.MODAL_ROOT},r.createElement(pd,null,r.createElement(bd,null,r.createElement(Ed,null,r.createElement(xd,null,r.createElement($d,{profileUrl:e,isBotMessage:t})),r.createElement(vd,null,r.createElement(I,{variant:"h2",color:m.themedColor.textHighEmphasis},o)),r.createElement(yd,null,r.createElement(I,{variant:"body1",color:m.color.ondark.textMidEmphasis},n))),r.createElement(Cd,null,Bn(s)&&r.createElement(_d,null,r.createElement(wr,{as:"a",href:a,target:"_blank",rel:mt,onClick:l},r.createElement(L,{type:"download",color:m.themedColor.textHighEmphasis,size:24}))),r.createElement(Sd,{onClick:i},r.createElement(L,{type:"close",color:m.themedColor.textHighEmphasis,size:24})))),r.createElement(Td,{onClick:u=>u.currentTarget===u.target&&i()},Kn(s)&&r.createElement(Ad,{controls:!0},r.createElement("source",{src:a,type:s})),jn(s)&&r.createElement(wd,{src:a,alt:o}),!Bn(s)&&r.createElement(kd,null,r.createElement(I,{variant:"h1",color:m.themedColor.textHighEmphasis},c.FILE_VIEWER__UNSUPPORT)))))},Ld=f.default.div`width:${({$size:e})=>e}px;height:${({$size:e})=>e}px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;background-color:${({theme:e})=>e.colors.base.primary}!important;path{fill:${({theme:e})=>e.colors.base.primaryContrastContent}!important;}`,kr=({className:e,locale:t,date:n=Date.now(),formatString:o="MMMM dd, yyyy",style:s})=>r.createElement(Od,{id:`${te}-date-separator`,style:s,className:e},r.createElement(I,{variant:"caption4",color:m.themedColor.textMidEmphasis},xe.format(n,o,{locale:t}))),Od=f.default.div`display:flex;justify-content:center;align-items:center;text-align:center;word-break:break-word;`,Dd=d.forwardRef(function(t,n){const{messages:o,renderMessage:s,messageTopArea:a,messageBottomArea:i,overlayArea:l,onLoadPrev:c,onLoadNext:u,loadThreshold:g=.05,onScroll:p=ye,depsForResetScrollPositionToBottom:x,stackDirection:C="top",bottomSpacerHeight:v=0}=t,E=d.useRef(null),b=d.useCallback(k=>{E.current=k,n&&(typeof n=="function"?n(k):n.current=k)},[n]),h=d.useRef(!1),y=d.useRef(void 0),_=d.useRef(0),M=d.useRef(0);d.useLayoutEffect(()=>{E.current&&(E.current.scrollTop=E.current.scrollHeight)},x),d.useLayoutEffect(()=>{E.current&&(y.current==="top"&&(E.current.scrollTop=E.current.scrollHeight-M.current),y.current==="bottom"&&(E.current.scrollTop=_.current),y.current=void 0)},[E.current,o.length]);const S=async k=>{if(p==null||p(k),!E.current)return;const $=E.current;if(M.current=$.scrollHeight-$.scrollTop,_.current=$.scrollTop,h.current)return;const R=$.clientHeight*Math.min(Math.max(0,g),1);$.scrollTop<=R?(h.current=!0,y.current="top",await c(),h.current=!1):$.scrollHeight-$.scrollTop-$.clientHeight<=R?(h.current=!0,y.current="bottom",await u(),h.current=!1):y.current=void 0};return r.createElement(Rd,{id:"infinite-list-container"},r.createElement(Nd,{id:"infinite-list-inner",ref:b,onScroll:S},C==="bottom"&&r.createElement("div",{style:{flexGrow:1}}),a,o.map((k,$)=>s({message:k,index:$})),i,v>0&&r.createElement("div",{style:{minHeight:v}})),r.createElement(Pd,{id:"infinite-list-overlay-container"},r.createElement(Bd,{id:"infinite-list-overlay"},l)))}),Rd=f.default.div`display:flex;position:relative;flex:1;overflow:hidden;`,Nd=f.default.div`display:flex;flex:1;flex-direction:column;overflow-y:auto;scrollbar-color:${m.themedColor.textLowEmphasis}transparent;&::-webkit-scrollbar-thumb:hover{background-color:transparent;}`,Pd=f.default.div`position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;`,Bd=f.default.div`pointer-events:auto;`,Fd=({className:e,onClick:t})=>r.createElement(Ud,{className:e,onClick:t,tabIndex:0},r.createElement(L,{size:24,type:"chevron-down",color:m.color.primary.main})),Ud=f.default.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:24px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.08),0 4px 6px 0 rgba(0,0,0,0.12);${D.light`
230
+ `,Je=f.default.div`display:flex;align-items:center;justify-content:center;flex-shrink:0;`,at=f.default.div`display:flex;gap:8px;align-items:center;word-break:break-word;`,Fc=f.default(at)`cursor:pointer;gap:4px;`,At=f.default(at)`flex-direction:row;align-items:center;`,Nn=f.default.div`display:flex;gap:4px;flex-direction:column;align-items:flex-start;`,Sr=d.createContext(null);function Uc({testerType:e,origin:t,children:n}){return r.createElement(Sr.Provider,{value:{testerType:e,isActionbookTester:e==="actionbook",origin:t}},e&&r.createElement(Hc,null),n)}const $e=()=>{const e=d.useContext(Sr);if(!e)throw new Error("_UNSAFE_INTERNAL_DashboardTesterProvider not found");return e},Hc=()=>{const{isActionbookTester:e}=$e();return r.createElement(we.Template,{template:e?zc:void 0},r.createElement(we.MessageLogs,{component:Vc}))},zc=e=>r.createElement(vr,{...e,testerMode:!0,maxBodyWidth:N.WIDE_BODY_MAX_WIDTH}),Vc=({extendedMessagePayload:e={}})=>{const{handlers:t}=G(),{manual:n,groundedness:o,function_calls:s,agent_message_templates:a,is_thinking:i}=e;return i||!n&&!(o!=null&&o.length)&&!(s!=null&&s.length)&&!(a!=null&&a.length)?r.createElement(r.Fragment,null):r.createElement(Gc,null,r.createElement(Wc,{width:4}),r.createElement(_r,{actionbook:n,functionCalls:s,groundedness:o,agentMessageTemplates:a,onClickFunctionCallDetail:t==null?void 0:t.onFunctionCallDetailClick,style:{iconColor:m.themedColor.textHighEmphasis,textColor:m.themedColor.textHighEmphasis,barColor:m.themedColor.textDisabled},bottomContent:r.createElement(qc,{variant:"caption2",color:m.themedColor.textLowEmphasis},"Only visible in the tester")}))},Gc=f.default.div`display:flex;gap:16px;margin:16px ${N.HORIZONTAL_PADDING}px 0;align-self:stretch;`,Wc=f.default.div`width:${({width:e})=>e}px;background-color:${m.themedColor.textDisabled};border-radius:100px;flex-shrink:0;`,qc=f.default(I)`margin-top:5px;`,jc=e=>{const{chatSDK:t,handlers:n,logger:o}=G(),{aiAgentInfo:s}=Y(),a=d.useRef(new Set),i=g=>{if(!(n!=null&&n.onCustomEvent))return;ue(g)&&g.sender.userId===s.userId&&!me.isStreaming(g)&&!a.current.has(g.messageId)&&(o.debug("useCustomEventForMessageReceive: bot-message-received",g),n.onCustomEvent({type:"bot-message-received",data:{message:g}}),a.current.add(g.messageId))},l=g=>{if(n!=null&&n.onCustomEvent&&g.isAdminMessage()&&g.customType==="user_action_required"&&!a.current.has(g.messageId)){const p=$t(g.data);Array.isArray(p.history)&&p.history.length===0&&(o.debug("useCustomEventForMessageReceive: user_action_required",p),n.onCustomEvent({type:"user-action-requested",data:p}),a.current.add(g.messageId))}},c=(g,p)=>{g.url===e&&(i(p),l(p))},u=g=>{l(g)};return Fe.useGroupChannelHandler(t,{onMessageUpdated:c,onMessageReceived:c}),{checkForUserActionRequired:u}};function Kc(e){return new Promise(t=>{const n=new Image;n.onload=function(){const o=String(n.width),s=String(n.height);URL.revokeObjectURL(n.src),t({width:o,height:s})},n.src=URL.createObjectURL(e)})}async function Zc(e){if("file"in e&&e.file instanceof File&&e.file.type.startsWith("image/")){const{width:t,height:n}=await Kc(e.file);return new Te.MessageMetaArray({key:qn,value:[t,n]})}}const Yc=({onScrollAfterSendMessage:e})=>{const{agentPreviewConfigs:t,handlers:n}=G(),o=d.useRef(t==null?void 0:t.agentAttributes);return o.current=t==null?void 0:t.agentAttributes,{onBeforeSendMessage:async s=>{const a=await Zc(s),i={...s,metaArrays:a?[a]:void 0},l=Xc(o.current);return l?{...i,data:JSON.stringify(l)}:i},onAfterSendMessage:s=>{var a,i,l;e(),(a=n==null?void 0:n.onMessageSend)==null||a.call(n,s.message),s.sendingStatus===Te.SendingStatus.SUCCEEDED?(i=n==null?void 0:n.onCustomEvent)==null||i.call(n,{type:"message-sent-succeeded",data:{message:s}}):s.sendingStatus===Te.SendingStatus.PENDING&&((l=n==null?void 0:n.onCustomEvent)==null||l.call(n,{type:"message-sent-pending",data:{message:s}}))}}},Xc=e=>{if(!e)return null;const t={};return e.ai&&Object.keys(e.ai).length>0&&(t.ai_attrs=e.ai),e.safeguard&&Object.keys(e.safeguard).length>0&&(t.safeguard_attrs=e.safeguard),typeof e.use_prompt_cache=="boolean"&&(t.use_prompt_cache=e.use_prompt_cache),Object.keys(t).length>0?t:null},Tr=50,wt=Tr-40,{Provider:Jc,useContext:Qc}=Z("ConversationScroll"),Pn={viewport:0,contentHeight:0,contentSnapshotHeight:0,shouldRecalc:!1,shouldUpdate:!1};function ed({scrollMode:e,children:t}){const n=d.useRef(null),o=d.useRef(null),s=d.useRef(Pn),a=d.useRef(!1),i=d.useRef(null),[l,c]=d.useState(0),[u,g]=d.useState(0),[p,x]=d.useState(!1),[C,v]=d.useState(!1),[E,b]=d.useState(!1),h=d.useMemo(()=>p?"auto":e,[p,e]),y=d.useCallback(T=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{v(!1)},T)},[]),_=()=>{s.current.contentSnapshotHeight=s.current.contentHeight,s.current.shouldUpdate=!0,s.current.shouldRecalc=!0},M=()=>{const T=n.current;!T||!s.current.shouldUpdate||c(O=>{s.current.shouldUpdate=!1;const{contentHeight:H,contentSnapshotHeight:ie,shouldRecalc:le}=s.current,ee=T.clientHeight;if(ie>H)return O;const Me=S(T,{messageType:"outgoing"});let pe=0;if(Me){const be=Me.message.offsetTop-wt+ee;pe=Math.max(0,be-H)}else{const be=H-ie,He=ee-wt;pe=Math.max(0,be-He)}return O===0||pe!==O||le?(s.current.shouldRecalc=!1,pe):O})},S=d.useCallback((T,O)=>{const{messageType:H="all"}=O??{},ie=Array.from(T.querySelectorAll(`#${te}-message-item`));let le=ie;H==="outgoing"&&(le=ie.filter(xt=>xt.getAttribute("data-layout-id")==="outgoingmessage"));const ee=le[le.length-1];if(!ee)return null;const Me=T.getBoundingClientRect(),pe=ee.getBoundingClientRect(),be=T.scrollTop+(pe.top-Me.top),He=be+ee.offsetHeight;return{message:ee,scrollTop:be,lastMessageBottom:He}},[]),k=d.useCallback(()=>{const T=n.current;if(!T||h!=="fixed")return;const O=S(T);s.current.contentHeight=(O==null?void 0:O.lastMessageBottom)??T.scrollHeight,!a.current&&s.current.contentSnapshotHeight>0&&_();const H=Math.max(0,T.scrollHeight-T.scrollTop-T.clientHeight);g(H),M()},[h,S]),$=d.useCallback(()=>{o.current&&(o.current.disconnect(),o.current=null),s.current=Pn,c(0),g(0)},[]),R=d.useCallback((T=!0)=>{const O=n.current;O&&O.scrollTo({top:O.scrollHeight,behavior:T?"smooth":"auto"})},[]),X=d.useCallback(T=>{T&&(n.current=T,h==="fixed"&&($(),s.current.viewport=T.clientHeight,o.current=new MutationObserver(()=>{k()}),o.current.observe(T,{childList:!0,subtree:!0})))},[h,k,$]),J=d.useCallback(()=>{const T=n.current;if(!T)return;const O=S(T,{messageType:"outgoing"});O&&(T.scrollTo({top:O.message.offsetTop-wt,behavior:"smooth"}),y(500))},[S,y]),se=T=>{const{scrollHeight:O,scrollTop:H,clientHeight:ie}=T.currentTarget,le=Math.max(0,O-H-ie);g(le)},he=d.useCallback(()=>{h==="fixed"&&(v(!0),_())},[h]),fe=d.useCallback(()=>{h==="fixed"?setTimeout(()=>J(),300):R()},[h,J]),Se=d.useCallback(T=>{a.current=T,h==="fixed"&&_()},[h]),V=d.useCallback(T=>{x(T)},[]),w=d.useCallback(T=>{b(T),h==="auto"&&T&&R(!0)},[h,R]),P=!(u<=Tr)&&!C&&!E;return r.createElement(Jc,{value:{ref:X,state:{bottomSpace:l,shouldShowScrollButton:P},props:{onScroll:se},actions:{scrollToBottom:R,onBeforeMessageSend:he,onAfterMessageSend:fe,onStreamingUpdate:Se,onConversationClosed:V,onTypingIndicatorUpdate:w}}},t)}const{Provider:td,Context:nd,useContext:Q}=Z("Conversation"),rd=({children:e})=>{var s;const{channelSource:t}=Q(),n=(s=t.channel)==null?void 0:s.url,{checkForUserActionRequired:o}=jc(n);return d.useEffect(()=>{var i;const a=(i=t.channel)==null?void 0:i.lastMessage;a&&o(a)},[t.channel,o]),r.createElement(r.Fragment,null,e)},Ar=({channelUrl:e,onClearChannelUrl:t,onNavigateToConversationList:n,shouldMarkAsRead:o,children:s})=>{var y;const{config:a}=W(),{activeChannel:i,refreshActiveChannel:l,aiAgentInfo:c}=Y(),{testerType:u}=$e(),g=Qc(),p=((y=a==null?void 0:a.conversation)==null?void 0:y.scrollMode)??"auto",{onBeforeSendMessage:x,onAfterSendMessage:C}=Yc({onScrollAfterSendMessage:()=>{g.actions.onAfterMessageSend()}}),v=e||(i==null?void 0:i.url),E=d.useCallback(_=>(g.actions.onBeforeMessageSend(),x(_)),[g.actions,x]),b=d.useCallback(_=>{const M=_.some(S=>me.isStreaming(S));if(g.actions.onStreamingUpdate(M),p==="auto"){const S=_[_.length-1];S&&me.shouldScrollToBottom(S,c.userId,!!u)&&setTimeout(()=>g.actions.scrollToBottom(!0),100)}},[g.actions,p,c.userId,u]),h=d.useCallback(async()=>{await l(),e&&(t==null||t())},[l,e,t]);return r.createElement(Es,{channelUrl:v,onBeforeSendMessage:E,onAfterSendMessage:C,onMessagesUpdated:b,onMessagesReceived:b,onChannelDeleted:h,shouldMarkAsRead:o},_=>r.createElement(td,{value:{..._,scrollSource:g,goToActiveConversation:h,onNavigateToConversationList:n}},r.createElement(rd,null,s)))},nn=d.createContext({onDrop:ye,subscribe:()=>ye}),Ft=({children:e})=>{const t=d.useRef(new Set);return r.createElement(nn.Provider,{value:{onDrop:n=>{var o;if(n.preventDefault(),(o=n.dataTransfer)!=null&&o.files){const s=Array.from(n.dataTransfer.files);s.length>0&&t.current.forEach(a=>a(s))}},subscribe:n=>(t.current.add(n),()=>t.current.delete(n))}},e)},od=({onDropFiles:e})=>{const{subscribe:t}=d.useContext(nn);d.useEffect(()=>t(e),[e])};Ft.Consumer=({children:e})=>{const{onDrop:t}=d.useContext(nn);return e({onDrop:t,onDragOver:s=>s.preventDefault()})};const rn=({iconSize:e=64,icon:t,className:n,label:o,children:s})=>r.createElement(ad,{className:n},t&&r.createElement(L,{type:t,size:e,color:m.themedColor.textLowEmphasis}),o&&r.createElement(I,{variant:"body1",color:m.themedColor.textMidEmphasis},o),s),sd=f.default.div`position:relative;display:flex;justify-content:center;align-items:center;width:100%;height:100%;`,ad=f.default.div`display:flex;flex-direction:column;min-height:104px;align-items:center;gap:20px;text-align:center;`,id=({label:e="Something went wrong",icon:t="error",action:n,...o})=>r.createElement(rn,{icon:t,label:e,...o},n&&r.createElement(ld,{onClick:n.onClick,label:n.label??"Retry"})),ld=({label:e,onClick:t})=>r.createElement(cd,{tabIndex:0,onClick:t},r.createElement(L,{type:"refresh",size:20}),r.createElement(I,{variant:"button",color:m.color.primary.main},e)),cd=f.default.button`all:unset;display:flex;cursor:pointer;gap:4px;align-items:center;justify-content:center;`,dd=({iconSize:e=48,className:t})=>r.createElement(tn,{size:e,className:t}),ud=({label:e="No channels",icon:t="chat",...n})=>r.createElement(rn,{icon:t,label:e,...n}),md=({label:e="No messages",icon:t="message",...n})=>r.createElement(rn,{icon:t,label:e,...n}),gd=e=>{const{components:t}=pt.useContext(),n=e.type==="loading"?r.createElement(t.Loading,{...e}):e.type==="error"?r.createElement(t.Error,{...e}):e.type==="noChannels"?r.createElement(t.NoChannels,{...e}):e.type==="noMessages"?r.createElement(t.NoMessages,{...e}):null;return n&&r.createElement(sd,null,n)},pt=ke({template:gd,components:{Loading:dd,Error:id,NoChannels:ud,NoMessages:md}}),Be=e=>{const{Template:t}=pt.useContext();return r.createElement(t,{...e})},Bn=e=>jn(e)||Kn(e);function hd(e){return e.isAdminMessage()?e.message==="The channel's custom_type was updated.":!1}function fd(e,t){return e.filter(n=>me.isWelcomeMessage(n,t))}const pd=f.default.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none;`,bd=f.default.div`height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between;border-bottom:1px solid ${m.themedColor.textDisabled};background-color:${m.themedColor.bg_50_600};@media screen and (max-width:768px){position:relative;}`,Ed=f.default.div`box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px;width:calc(100% - 128px);`,xd=f.default.div`margin-inline-end:8px;`,vd=f.default.div`max-width:500px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;@media screen and (max-width:768px){position:absolute;inset-inline-start:64px;top:10px;display:block;max-width:calc(100vw - 240px);}`,yd=f.default.div`display:inline-block;margin-inline-start:8px;padding-top:5px;@media screen and (max-width:768px){position:absolute;inset-inline-start:56px;top:24px;}`,Cd=f.default.div`display:flex;width:160px;justify-content:flex-end;`,_d=f.default.div`inset-inline-end:0;display:flex;flex-direction:row;`,wr=f.default.div`width:64px;padding:21px;box-sizing:border-box;cursor:${e=>e.disabled?"not-allowed":"pointer"};`,Sd=f.default(wr)`border-inline-start:1px solid ${m.themedColor.textDisabled};`,Td=f.default.div`width:100%;height:100%;display:flex;align-items:center;justify-content:center;`,Ad=f.default.video`max-width:100%;max-height:100%;user-select:none;-webkit-user-drag:none;`,wd=f.default.img`max-width:calc(90% - 60px);max-height:calc(90% - 60px);user-select:none;-webkit-user-drag:none;`,kd=f.default.div`max-width:100%;max-height:100%;display:flex;justify-content:center;align-items:center;`,Id=({file:e,sender:t={},onClose:n,onDownloadClick:o})=>{const{type:s,url:a,name:i=""}=e,{profileUrl:l,nickname:c,userId:u}=t,{aiAgentInfo:g}=Y();return r.createElement(Md,{profileUrl:l??"",nickname:c??"",type:s,url:a,name:i,onClose:n,isBotMessage:u===g.userId,onDownloadClick:o})},$d=({profileUrl:e,isBotMessage:t})=>t&&!e?r.createElement(Ld,{$size:32},r.createElement(L,{type:"bot-filled",size:20})):r.createElement(Xt,{size:32,src:e}),Md=({profileUrl:e,isBotMessage:t,nickname:n,name:o,type:s,url:a,onClose:i,onDownloadClick:l})=>{const{stringSet:c}=B();return r.createElement(gt,{onClose:i,visible:!0,rootElementId:ne.MODAL_ROOT},r.createElement(pd,null,r.createElement(bd,null,r.createElement(Ed,null,r.createElement(xd,null,r.createElement($d,{profileUrl:e,isBotMessage:t})),r.createElement(vd,null,r.createElement(I,{variant:"h2",color:m.themedColor.textHighEmphasis},o)),r.createElement(yd,null,r.createElement(I,{variant:"body1",color:m.color.ondark.textMidEmphasis},n))),r.createElement(Cd,null,Bn(s)&&r.createElement(_d,null,r.createElement(wr,{as:"a",href:a,target:"_blank",rel:mt,onClick:l},r.createElement(L,{type:"download",color:m.themedColor.textHighEmphasis,size:24}))),r.createElement(Sd,{onClick:i},r.createElement(L,{type:"close",color:m.themedColor.textHighEmphasis,size:24})))),r.createElement(Td,{onClick:u=>u.currentTarget===u.target&&i()},Kn(s)&&r.createElement(Ad,{controls:!0},r.createElement("source",{src:a,type:s})),jn(s)&&r.createElement(wd,{src:a,alt:o}),!Bn(s)&&r.createElement(kd,null,r.createElement(I,{variant:"h1",color:m.themedColor.textHighEmphasis},c.FILE_VIEWER__UNSUPPORT)))))},Ld=f.default.div`width:${({$size:e})=>e}px;height:${({$size:e})=>e}px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;background-color:${({theme:e})=>e.colors.base.primary}!important;path{fill:${({theme:e})=>e.colors.base.primaryContrastContent}!important;}`,kr=({className:e,locale:t,date:n=Date.now(),formatString:o="MMMM dd, yyyy",style:s})=>r.createElement(Od,{id:`${te}-date-separator`,style:s,className:e},r.createElement(I,{variant:"caption4",color:m.themedColor.textMidEmphasis},xe.format(n,o,{locale:t}))),Od=f.default.div`display:flex;justify-content:center;align-items:center;text-align:center;word-break:break-word;`,Dd=d.forwardRef(function(t,n){const{messages:o,renderMessage:s,messageTopArea:a,messageBottomArea:i,overlayArea:l,onLoadPrev:c,onLoadNext:u,loadThreshold:g=.05,onScroll:p=ye,depsForResetScrollPositionToBottom:x,stackDirection:C="top",bottomSpacerHeight:v=0}=t,E=d.useRef(null),b=d.useCallback(k=>{E.current=k,n&&(typeof n=="function"?n(k):n.current=k)},[n]),h=d.useRef(!1),y=d.useRef(void 0),_=d.useRef(0),M=d.useRef(0);d.useLayoutEffect(()=>{E.current&&(E.current.scrollTop=E.current.scrollHeight)},x),d.useLayoutEffect(()=>{E.current&&(y.current==="top"&&(E.current.scrollTop=E.current.scrollHeight-M.current),y.current==="bottom"&&(E.current.scrollTop=_.current),y.current=void 0)},[E.current,o.length]);const S=async k=>{if(p==null||p(k),!E.current)return;const $=E.current;if(M.current=$.scrollHeight-$.scrollTop,_.current=$.scrollTop,h.current)return;const R=$.clientHeight*Math.min(Math.max(0,g),1);$.scrollTop<=R?(h.current=!0,y.current="top",await c(),h.current=!1):$.scrollHeight-$.scrollTop-$.clientHeight<=R?(h.current=!0,y.current="bottom",await u(),h.current=!1):y.current=void 0};return r.createElement(Rd,{id:"infinite-list-container"},r.createElement(Nd,{id:"infinite-list-inner",ref:b,onScroll:S},C==="bottom"&&r.createElement("div",{style:{flexGrow:1}}),a,o.map((k,$)=>s({message:k,index:$})),i,v>0&&r.createElement("div",{style:{minHeight:v}})),r.createElement(Pd,{id:"infinite-list-overlay-container"},r.createElement(Bd,{id:"infinite-list-overlay"},l)))}),Rd=f.default.div`display:flex;position:relative;flex:1;overflow:hidden;`,Nd=f.default.div`display:flex;flex:1;flex-direction:column;overflow-y:auto;scrollbar-color:${m.themedColor.textLowEmphasis}transparent;&::-webkit-scrollbar-thumb:hover{background-color:transparent;}`,Pd=f.default.div`position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;`,Bd=f.default.div`pointer-events:auto;`,Fd=({className:e,onClick:t})=>r.createElement(Ud,{className:e,onClick:t,tabIndex:0},r.createElement(L,{size:24,type:"chevron-down",color:m.color.primary.main})),Ud=f.default.button`all:unset;cursor:pointer;display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:24px;box-shadow:0 2px 8px 0 rgba(0,0,0,0.08),0 4px 6px 0 rgba(0,0,0,0.12);${D.light`
231
231
  background-color: ${m.color.background50};
232
232
  &:hover {
233
233
  background-color: ${m.color.background100};
@@ -279,7 +279,7 @@
279
279
  color: ${m.color.information.main};
280
280
  `};
281
281
  }
282
- `,mu=d.lazy(()=>Promise.resolve().then(()=>require("./BzFcEwZu.cjs")).then(e=>({default:e.MarkdownText}))),gu=()=>{const{aiAgentInfo:e,userSession:t}=Y(),{messageSource:n,channelSource:o}=Q(),[s,a]=d.useState(null),i=Kt("special-notice",o.channel),l=d.useCallback(()=>o.channel?i?n.messages.some(c=>Pe(c,(t==null?void 0:t.userId)??"")):!0:null,[o.channel,i,n.messages,t==null?void 0:t.userId]);return d.useEffect(()=>{s||a(l())},[l,s]),s?null:r.createElement(uu,null,r.createElement(mu,null,e.specialNotice))},hu=()=>r.createElement(fu,null,r.createElement(gu,null),r.createElement(tu,null,r.createElement(du,null))),fu=f.default.div`z-index:0;border:none;width:100%;`,pu=()=>{var s;const{testerType:e}=$e(),{channelSource:t}=Q(),n=ve(t.channel),o=!!e&&((s=t.channel)==null?void 0:s.isAIAgent);return n&&o?r.createElement(Qd,null):r.createElement(hu,null)},Lr=({channel:e,size:t=40})=>{const{userSession:n,aiAgentInfo:o}=Y(),{fallbackIcon:s,url:a}=ar({channel:e,aiAgentInfo:o,userSession:n}),i=A.useTheme();return a?r.createElement(Xt,{src:a,size:t}):r.createElement(bu,{$size:t,$bgColor:i.colors.base.primary},r.createElement(L,{type:s,size:t*.55,color:i.colors.base.primaryContrastContent}))},bu=f.default.div`width:${({$size:e})=>e}px;height:${({$size:e})=>e}px;border-radius:50%;background-color:${({$bgColor:e})=>e};display:flex;align-items:center;justify-content:center;flex-shrink:0;`,Eu=({label:e,children:t,position:n="top",disabled:o})=>o?t:r.createElement(Ht,null,t,r.createElement(yu,{$position:n},r.createElement(Cu,{variant:"caption1"},e),r.createElement(xu,{$position:n}))),xu=({$position:e})=>r.createElement("svg",{style:{transform:e==="top"?"rotate(0)":"rotate(180deg)"},xmlns:"http://www.w3.org/2000/svg",width:"12",height:"6",viewBox:"0 0 12 6",fill:"none"},r.createElement("path",{d:"M6 6L0 0h12L6 6Z",fill:m.themedColor.textHighEmphasis})),vu={top:A.css`flex-direction:column;top:0;transform:translate(-50%,-100%);`,bottom:A.css`flex-direction:column-reverse;bottom:0;transform:translate(-50%,100%);`},Ht=f.default.div`position:relative;`,yu=f.default.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${Ie.TOOLTIP};${({$position:e})=>vu[e]}opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;${Ht}:hover &,${Ht}:focus-within &{opacity:1;}`,Cu=f.default(I)`padding:6px 8px;background:${m.themedColor.textHighEmphasis};color:${m.themedColor.textHighEmphasisInverse};border-radius:4px;font-size:12px;white-space:nowrap;`,_u=()=>{const{state:e,logger:t,enableCloseConversationButton:n,enableExpandButton:o,dispatcher:s}=G(),{stringSet:a}=B(),{channelSource:i,onNavigateToConversationList:l}=Q(),{aiAgentInfo:c,userSession:u}=Y(),g=i.channel,x=Ue()?24:16,C=ar({channel:g,userSession:u,aiAgentInfo:c}),v=()=>{e.setOpened(!1)},E=async()=>{try{const _=await(g==null?void 0:g.markConversationAsHandoff());t.info("conversation.handleAgentHandoff: success",_)}catch(_){t.error("conversation.handleAgentHandoff: error",_)}},b=async()=>{g&&await s.send(Jn.CloseConversation({channelUrl:g.url}))},h=Kt("handoff-button",g),y=(g==null?void 0:g.isAIAgent)&&n;return r.createElement(ku,null,r.createElement(Iu,null,l&&r.createElement(We,{onClick:()=>l()},r.createElement(L,{type:"menu",size:24,color:m.themedColor.textHighEmphasis})),r.createElement(Lr,{channel:g,size:34}),r.createElement(Mu,{variant:"h2",color:m.themedColor.textHighEmphasis},C.title)),r.createElement($u,null,h&&r.createElement(wu,{tooltipLabel:a.HEADER_BUTTON__AGENT_HANDOFF,disabled:!It(g)||Ne(g),size:x,onClick:E}),y&&r.createElement(Au,{disabled:!It(g),size:x,onClick:b}),o&&r.createElement(Su,{size:x}),r.createElement(Tu,{size:x,onClick:v})))},Su=({size:e,disabled:t})=>{const{state:n}=G();return r.createElement(We,{"aria-label":"expand",onClick:()=>n.setExpanded(!n.expanded),disabled:t},r.createElement(L,{type:n.expanded?"collapse":"expand",size:e,color:m.themedColor.textHighEmphasis}))},Tu=({size:e,disabled:t,onClick:n})=>r.createElement(We,{"aria-label":"close messenger",onClick:n,disabled:t},r.createElement(L,{type:"close",size:e,color:m.themedColor.textHighEmphasis})),Au=({size:e,disabled:t,onClick:n})=>r.createElement(We,{"aria-label":"close conversation",onClick:n,disabled:t},r.createElement(L,{type:"mute",size:e,color:t?m.themedColor.textDisabled:m.themedColor.textHighEmphasis})),wu=({size:e,onClick:t,disabled:n,tooltipLabel:o})=>r.createElement(Eu,{label:o,position:"bottom",disabled:n},r.createElement(We,{"aria-label":"agent",onClick:t,disabled:n},r.createElement(L,{type:"agent",size:e,color:n?m.themedColor.textDisabled:m.themedColor.textHighEmphasis}))),ku=f.default.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${m.themedColor.textDisabled};background-color:${({theme:e})=>e.colors.base.headerBackground};`,Iu=f.default.div`display:flex;flex:1;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`,$u=f.default.div`display:flex;gap:10px;align-items:center;justify-content:center;`,Mu=f.default(I)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`,We=f.default.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`,Lu=()=>{const{isActionbookTester:e}=$e();return e?null:r.createElement(_u,null)},Or=({children:e,onNavigateToConversationList:t,channelUrl:n,onClearChannelUrl:o,shouldMarkAsRead:s,closedChannelUrl:a,onClearClosedChannelUrl:i})=>{var g;const{config:l}=W(),c=((g=l==null?void 0:l.conversation)==null?void 0:g.scrollMode)??"auto",{Template:u}=bt.useContext();return r.createElement(ed,{scrollMode:c},r.createElement(Ar,{onNavigateToConversationList:t,channelUrl:n??a,onClearChannelUrl:o??i,shouldMarkAsRead:s},r.createElement(Ft,null,r.createElement(Ft.Consumer,null,p=>r.createElement(r.Fragment,null,r.createElement(Du,{...p},r.createElement(u,null)),e)))))},bt=ke({template:Ou,components:{Header:Lu,Body:Jd,Footer:pu}});function Ou(){const{components:e}=bt.useContext();return r.createElement(r.Fragment,null,r.createElement(e.Header,null),r.createElement(e.Body,null),r.createElement(e.Footer,null))}const Du=f.default.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({theme:e})=>e.colors.base.background};`,{Provider:Ru,Context:Nu,useContext:sn}=Z("ConversationList");function Dr({conversationListLimit:e,conversationListFilter:t,onOpenConversationView:n=ye,children:o}){return r.createElement(Ts,{conversationListLimit:e,conversationListFilter:t},s=>r.createElement(Ru,{value:{...s,onOpenConversationView:n}},o))}const Pu=({channel:e})=>r.createElement(Lr,{channel:e}),an=ke({template:Bu,components:{}}),zt=99;function Bu(e){const{channel:t,onClick:n}=e,{stringSet:o,format:s}=B(),a=ho(t),i=fo(t,s,{justNow:o.DATE_FORMAT__JUST_NOW,minutesAgo:o.DATE_FORMAT__MINUTES_AGO,hoursAgo:o.DATE_FORMAT__HOURS_AGO,dateShortFormat:o.DATE_FORMAT__DATE_SHORT}),l=t.unreadMessageCount;return r.createElement(Fu,{role:"button",onClick:()=>n==null?void 0:n()},r.createElement(Uu,null,r.createElement(Pu,{...e})),r.createElement(Hu,null,r.createElement(zu,null,r.createElement(I,{variant:"subtitle1",color:m.themedColor.textHighEmphasis,maxTextLines:1},a),r.createElement(Vu,null,ve(t)&&r.createElement(r.Fragment,null,r.createElement(I,{variant:"caption1",color:m.themedColor.textMidEmphasis,maxTextLines:1},o.CONVERSATION_LIST__ENDED),r.createElement(Gu,null)),r.createElement(I,{variant:"caption2",color:m.themedColor.textLowEmphasis,maxTextLines:1},i))),l>0&&r.createElement(Wu,{$count:l},r.createElement(I,{variant:"caption3",color:m.themedColor.textHighEmphasisInverse},l<=zt?l:`${zt}+`))))}const Fu=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;`,Uu=f.default.div`display:flex;align-items:center;justify-content:center;padding-inline-start:16px;`,Hu=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 ${m.themedColor.textDisabled};`,zu=f.default.div`display:flex;flex-direction:column;justify-content:center;flex:1;gap:4px;word-break:break-word;overflow-wrap:break-word;`,Vu=f.default.div`display:flex;align-items:center;gap:6px;`,Gu=f.default.div`width:2px;height:2px;border-radius:1px;background-color:${m.themedColor.textLowEmphasis};`,Wu=f.default.div`display:flex;align-items:center;justify-content:center;height:20px;padding:4px;border-radius:10px;background-color:${m.themedColor.error};${({$count:e})=>e<=zt&&A.css`
282
+ `,mu=d.lazy(()=>Promise.resolve().then(()=>require("./B0MxbJ5V.cjs")).then(e=>({default:e.MarkdownText}))),gu=()=>{const{aiAgentInfo:e,userSession:t}=Y(),{messageSource:n,channelSource:o}=Q(),[s,a]=d.useState(null),i=Kt("special-notice",o.channel),l=d.useCallback(()=>o.channel?i?n.messages.some(c=>Pe(c,(t==null?void 0:t.userId)??"")):!0:null,[o.channel,i,n.messages,t==null?void 0:t.userId]);return d.useEffect(()=>{s||a(l())},[l,s]),s?null:r.createElement(uu,null,r.createElement(mu,null,e.specialNotice))},hu=()=>r.createElement(fu,null,r.createElement(gu,null),r.createElement(tu,null,r.createElement(du,null))),fu=f.default.div`z-index:0;border:none;width:100%;`,pu=()=>{var s;const{testerType:e}=$e(),{channelSource:t}=Q(),n=ve(t.channel),o=!!e&&((s=t.channel)==null?void 0:s.isAIAgent);return n&&o?r.createElement(Qd,null):r.createElement(hu,null)},Lr=({channel:e,size:t=40})=>{const{userSession:n,aiAgentInfo:o}=Y(),{fallbackIcon:s,url:a}=ar({channel:e,aiAgentInfo:o,userSession:n}),i=A.useTheme();return a?r.createElement(Xt,{src:a,size:t}):r.createElement(bu,{$size:t,$bgColor:i.colors.base.primary},r.createElement(L,{type:s,size:t*.55,color:i.colors.base.primaryContrastContent}))},bu=f.default.div`width:${({$size:e})=>e}px;height:${({$size:e})=>e}px;border-radius:50%;background-color:${({$bgColor:e})=>e};display:flex;align-items:center;justify-content:center;flex-shrink:0;`,Eu=({label:e,children:t,position:n="top",disabled:o})=>o?t:r.createElement(Ht,null,t,r.createElement(yu,{$position:n},r.createElement(Cu,{variant:"caption1"},e),r.createElement(xu,{$position:n}))),xu=({$position:e})=>r.createElement("svg",{style:{transform:e==="top"?"rotate(0)":"rotate(180deg)"},xmlns:"http://www.w3.org/2000/svg",width:"12",height:"6",viewBox:"0 0 12 6",fill:"none"},r.createElement("path",{d:"M6 6L0 0h12L6 6Z",fill:m.themedColor.textHighEmphasis})),vu={top:A.css`flex-direction:column;top:0;transform:translate(-50%,-100%);`,bottom:A.css`flex-direction:column-reverse;bottom:0;transform:translate(-50%,100%);`},Ht=f.default.div`position:relative;`,yu=f.default.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${Ie.TOOLTIP};${({$position:e})=>vu[e]}opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;${Ht}:hover &,${Ht}:focus-within &{opacity:1;}`,Cu=f.default(I)`padding:6px 8px;background:${m.themedColor.textHighEmphasis};color:${m.themedColor.textHighEmphasisInverse};border-radius:4px;font-size:12px;white-space:nowrap;`,_u=()=>{const{state:e,logger:t,enableCloseConversationButton:n,enableExpandButton:o,dispatcher:s}=G(),{stringSet:a}=B(),{channelSource:i,onNavigateToConversationList:l}=Q(),{aiAgentInfo:c,userSession:u}=Y(),g=i.channel,x=Ue()?24:16,C=ar({channel:g,userSession:u,aiAgentInfo:c}),v=()=>{e.setOpened(!1)},E=async()=>{try{const _=await(g==null?void 0:g.markConversationAsHandoff());t.info("conversation.handleAgentHandoff: success",_)}catch(_){t.error("conversation.handleAgentHandoff: error",_)}},b=async()=>{g&&await s.send(Jn.CloseConversation({channelUrl:g.url}))},h=Kt("handoff-button",g),y=(g==null?void 0:g.isAIAgent)&&n;return r.createElement(ku,null,r.createElement(Iu,null,l&&r.createElement(We,{onClick:()=>l()},r.createElement(L,{type:"menu",size:24,color:m.themedColor.textHighEmphasis})),r.createElement(Lr,{channel:g,size:34}),r.createElement(Mu,{variant:"h2",color:m.themedColor.textHighEmphasis},C.title)),r.createElement($u,null,h&&r.createElement(wu,{tooltipLabel:a.HEADER_BUTTON__AGENT_HANDOFF,disabled:!It(g)||Ne(g),size:x,onClick:E}),y&&r.createElement(Au,{disabled:!It(g),size:x,onClick:b}),o&&r.createElement(Su,{size:x}),r.createElement(Tu,{size:x,onClick:v})))},Su=({size:e,disabled:t})=>{const{state:n}=G();return r.createElement(We,{"aria-label":"expand",onClick:()=>n.setExpanded(!n.expanded),disabled:t},r.createElement(L,{type:n.expanded?"collapse":"expand",size:e,color:m.themedColor.textHighEmphasis}))},Tu=({size:e,disabled:t,onClick:n})=>r.createElement(We,{"aria-label":"close messenger",onClick:n,disabled:t},r.createElement(L,{type:"close",size:e,color:m.themedColor.textHighEmphasis})),Au=({size:e,disabled:t,onClick:n})=>r.createElement(We,{"aria-label":"close conversation",onClick:n,disabled:t},r.createElement(L,{type:"mute",size:e,color:t?m.themedColor.textDisabled:m.themedColor.textHighEmphasis})),wu=({size:e,onClick:t,disabled:n,tooltipLabel:o})=>r.createElement(Eu,{label:o,position:"bottom",disabled:n},r.createElement(We,{"aria-label":"agent",onClick:t,disabled:n},r.createElement(L,{type:"agent",size:e,color:n?m.themedColor.textDisabled:m.themedColor.textHighEmphasis}))),ku=f.default.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${m.themedColor.textDisabled};background-color:${({theme:e})=>e.colors.base.headerBackground};`,Iu=f.default.div`display:flex;flex:1;flex-direction:row;align-items:center;gap:6px;overflow:hidden;`,$u=f.default.div`display:flex;gap:10px;align-items:center;justify-content:center;`,Mu=f.default(I)`text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px 0;`,We=f.default.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`,Lu=()=>{const{isActionbookTester:e}=$e();return e?null:r.createElement(_u,null)},Or=({children:e,onNavigateToConversationList:t,channelUrl:n,onClearChannelUrl:o,shouldMarkAsRead:s,closedChannelUrl:a,onClearClosedChannelUrl:i})=>{var g;const{config:l}=W(),c=((g=l==null?void 0:l.conversation)==null?void 0:g.scrollMode)??"auto",{Template:u}=bt.useContext();return r.createElement(ed,{scrollMode:c},r.createElement(Ar,{onNavigateToConversationList:t,channelUrl:n??a,onClearChannelUrl:o??i,shouldMarkAsRead:s},r.createElement(Ft,null,r.createElement(Ft.Consumer,null,p=>r.createElement(r.Fragment,null,r.createElement(Du,{...p},r.createElement(u,null)),e)))))},bt=ke({template:Ou,components:{Header:Lu,Body:Jd,Footer:pu}});function Ou(){const{components:e}=bt.useContext();return r.createElement(r.Fragment,null,r.createElement(e.Header,null),r.createElement(e.Body,null),r.createElement(e.Footer,null))}const Du=f.default.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({theme:e})=>e.colors.base.background};`,{Provider:Ru,Context:Nu,useContext:sn}=Z("ConversationList");function Dr({conversationListLimit:e,conversationListFilter:t,onOpenConversationView:n=ye,children:o}){return r.createElement(Ts,{conversationListLimit:e,conversationListFilter:t},s=>r.createElement(Ru,{value:{...s,onOpenConversationView:n}},o))}const Pu=({channel:e})=>r.createElement(Lr,{channel:e}),an=ke({template:Bu,components:{}}),zt=99;function Bu(e){const{channel:t,onClick:n}=e,{stringSet:o,format:s}=B(),a=ho(t),i=fo(t,s,{justNow:o.DATE_FORMAT__JUST_NOW,minutesAgo:o.DATE_FORMAT__MINUTES_AGO,hoursAgo:o.DATE_FORMAT__HOURS_AGO,dateShortFormat:o.DATE_FORMAT__DATE_SHORT}),l=t.unreadMessageCount;return r.createElement(Fu,{role:"button",onClick:()=>n==null?void 0:n()},r.createElement(Uu,null,r.createElement(Pu,{...e})),r.createElement(Hu,null,r.createElement(zu,null,r.createElement(I,{variant:"subtitle1",color:m.themedColor.textHighEmphasis,maxTextLines:1},a),r.createElement(Vu,null,ve(t)&&r.createElement(r.Fragment,null,r.createElement(I,{variant:"caption1",color:m.themedColor.textMidEmphasis,maxTextLines:1},o.CONVERSATION_LIST__ENDED),r.createElement(Gu,null)),r.createElement(I,{variant:"caption2",color:m.themedColor.textLowEmphasis,maxTextLines:1},i))),l>0&&r.createElement(Wu,{$count:l},r.createElement(I,{variant:"caption3",color:m.themedColor.textHighEmphasisInverse},l<=zt?l:`${zt}+`))))}const Fu=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;`,Uu=f.default.div`display:flex;align-items:center;justify-content:center;padding-inline-start:16px;`,Hu=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 ${m.themedColor.textDisabled};`,zu=f.default.div`display:flex;flex-direction:column;justify-content:center;flex:1;gap:4px;word-break:break-word;overflow-wrap:break-word;`,Vu=f.default.div`display:flex;align-items:center;gap:6px;`,Gu=f.default.div`width:2px;height:2px;border-radius:1px;background-color:${m.themedColor.textLowEmphasis};`,Wu=f.default.div`display:flex;align-items:center;justify-content:center;height:20px;padding:4px;border-radius:10px;background-color:${m.themedColor.error};${({$count:e})=>e<=zt&&A.css`
283
283
  width: 20px;
284
284
  `}
285
285
  `,qu=({items:e,renderItem:t,onEndReached:n})=>{const o=s=>{const a=s.target;a.scrollHeight-a.scrollTop===a.clientHeight&&(n==null||n())};return r.createElement(ju,{onScroll:s=>o(s)},e.map((s,a)=>t(s,a)))},ju=f.default.div`width:100%;height:100%;display:flex;flex-direction:column;flex:1;overflow:auto;`,Ku=()=>{const{stringSet:e}=B(),{listSource:t,onOpenConversationView:n}=sn(),{Template:o}=an.useContext();return t.initialized?t.channels.length===0?r.createElement(Be,{type:"noChannels",label:e.CONVERSATION_LIST__NO_CONVERSATIONS}):r.createElement(qu,{items:t.channels,renderItem:s=>{var a,i,l;return r.createElement(o,{key:s.url,channel:s,onClick:()=>n(s.url,ve(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()}}):r.createElement(Be,{type:"loading"})},Zu=()=>{const{stringSet:e}=B(),{language:t,countryCode:n,context:o}=G(),{aiAgentInfo:s,refreshActiveChannel:a,createConversation:i,setActiveChannel:l}=Y(),{onOpenConversationView:c}=sn();return r.createElement(Yu,{role:"button",onClick:async()=>{if(s.isMultipleActiveConversationsEnabled){const u=await i({aiAgentId:s.userId,language:t,country:n,context:o});l({url:u,status:z.ConversationStatus.OPEN}),c(u,z.ConversationStatus.OPEN)}else{const u=await a();c(u,z.ConversationStatus.OPEN)}}},r.createElement(Xu,{variant:"h1"},e.TALK_TO_AGENT))},Yu=f.default.div`background-color:${({theme:e})=>e.colors.base.primary};display:flex;align-items:center;justify-content:center;padding:16px;cursor:pointer;`,Xu=f.default(I)`color:${({theme:e})=>e.colors.base.primaryContrastContent};overflow:hidden;text-overflow:ellipsis;white-space:nowrap;`,Ju=()=>{const{state:e}=G(),{stringSet:t}=B(),o=Ue()?24:16,s=()=>{e.setOpened(!1)};return r.createElement(em,null,r.createElement(tm,{variant:"h2",color:m.themedColor.textHighEmphasis},t.CONVERSATION_LIST__HEADER_TITLE),r.createElement(nm,null,r.createElement(Qu,{size:o,onClick:s})),r.createElement(rm,null))},Qu=({size:e,disabled:t,onClick:n})=>r.createElement(om,{"aria-label":"close messenger",onClick:n,disabled:t},r.createElement(L,{type:"close",size:e,color:m.themedColor.textHighEmphasis})),em=f.default.div`height:56px;box-sizing:border-box;display:flex;align-items:center;padding:11px 12px;border-bottom:1px solid ${m.themedColor.textDisabled};background-color:${({theme:e})=>e.colors.base.headerBackground};`,tm=f.default(I)`padding:0 4px;width:100%;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;`,nm=f.default.div`display:flex;gap:10px;align-items:center;justify-content:center;`,rm=f.default.div`position:absolute;bottom:0;width:100%;height:1px;background-color:${m.themedColor.textDisabled};`,om=f.default.button`all:unset;padding:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:disabled{cursor:not-allowed;}`,Rr=({conversationListLimit:e,conversationListFilter:t,children:n,onOpenConversationView:o})=>{const{Template:s}=Et.useContext();return r.createElement(Dr,{conversationListLimit:e,conversationListFilter:t,onOpenConversationView:o},r.createElement(am,null,r.createElement(s,null)),n)},Et=ke({template:sm,components:{Header:Ju,Body:Ku,Footer:Zu}});function sm(){const{components:e}=Et.useContext();return r.createElement(r.Fragment,null,r.createElement(e.Header,null),r.createElement(e.Body,null),r.createElement(e.Footer,null))}const am=f.default.div`height:100%;width:100%;display:flex;flex-direction:column;flex:1;background-color:${({theme:e})=>e.colors.base.background};`,im=A.css`:where(#${ne.ENTRY}) :not(code *){font-family:'Roboto',sans-serif;box-sizing:border-box;}`,lm=[im,sa,aa],cm=(e,...t)=>A.createGlobalStyle(e,...lm,...t),dm=cm``,um=co(bt,we,ht,ft,Et,an,pt);function Nr({appearance:e,rootElement:t,logger:n,language:o,stringSet:s,children:a,messageTemplate:i,theme:l}){return ua(Zs,t),r.createElement(A.StyleSheetManager,{target:t},r.createElement(la,{rootElement:t,logger:n,appearance:e,theme:l},r.createElement(ks,{internalVariables:i==null?void 0:i.__internalVariables},r.createElement(oa,{stringSet:s,logger:n,language:o},r.createElement(um,null,a,r.createElement(dm,null))))))}const Qe={},et={getItem:e=>{try{return localStorage.getItem(e)}catch{return Qe[e]??null}},setItem:(e,t)=>{try{localStorage.setItem(e,t)}catch{Qe[e]=t}},deleteItem:e=>{try{localStorage.removeItem(e)}catch{delete Qe[e]}},getKeys:e=>{try{const t=[];for(let n=0;n<localStorage.length;n++){const o=localStorage.key(n);o&&o.startsWith(e)&&t.push(o)}return t}catch{return Object.keys(Qe).filter(t=>t.startsWith(e))}}},ln=d.forwardRef(function({rootElement:t=document.body,logLevel:n=K.LogLevel.WARN,language:o=navigator.language,userSessionInfo:s,children:a,...i},l){var c,u;return ze.level!==n&&(ze.level=n),da("https://fonts.googleapis.com/css2?family=Roboto&display=swap",t),r.createElement("div",{id:ne.ENTRY,style:{width:"fit-content",height:"fit-content",...i.entryStyle}},r.createElement(Nr,{logger:ze,rootElement:t,appearance:(c=i.agentPreviewConfigs)==null?void 0:c.appearance,stringSet:i.stringSet,language:o,messageTemplate:i.messageTemplate,theme:i.theme},r.createElement(ha,{rootElement:t,keyValueStorage:{get:et.getItem,set:et.setItem,delete:et.deleteItem,getKeys:et.getKeys},language:o,logger:ze,dispatcher:Pr,chatParams:{...i.chatParams,customApiHost:i.customApiHost,customWebSocketHost:i.customWebSocketHost},chatSDK:i.customChatSDK,...i},r.createElement(pa,{ref:l,userSessionInfo:s,forceCreateChannel:(u=i.agentPreviewConfigs)==null?void 0:u.forceCreateChannel},r.createElement(Uc,{...i._UNSAFE_INTERNAL_dashboardTester},a,r.createElement("div",{id:ne.MODAL_ROOT}))))))}),ze=new Xn(K.LogLevel.WARN),Pr=new Yn(ze),Br=({children:e,isOpened:t})=>{const{dir:n,rootElement:o}=G(),s=Ae(o,!0);return d.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]),r.createElement(mm,{dir:n,$visible:t},e)},mm=f.default.div`width:100%;height:100%;position:fixed;top:0;left:0;z-index:${Ie.WINDOW};visibility:${({$visible:e})=>e?"visible":"hidden"};`,gm=48,hm=2/3;function Fr({className:e,isOpened:t,onClick:n,type:o,imageUrl:s,dir:a,animated:i=!0,backgroundColor:l,size:c=gm}){const u=Ot(l),g=Math.round(c*hm);return r.createElement(bm,{dir:a,id:ne.LAUNCHER,className:e,"aria-label":"Sendbird AIAgent Launcher",onClick:n,$animated:i,$backgroundColor:l,$size:c},r.createElement(Em,{$isOpened:t,$animated:i,$fillColor:u,$iconSize:g},r.createElement(Gn.Open,{url:s,isDefaultIcon:o==="default_icon",size:g})),r.createElement(xm,{$isOpened:t,$animated:i,$fillColor:u,$iconSize:g},r.createElement(Gn.Close,{size:g})))}const fm=A.css`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transform:scale(1.1);}&:active{transform:scale(0.8);}`,pm=A.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===dr.WHITE?"grayscale(100%) brightness(2000%)":"grayscale(100%) invert(100%) saturate(0%) brightness(0%) contrast(1000%)"};}}`,Ur=A.css`svg{width:${({$iconSize:e})=>e}px;height:${({$iconSize:e})=>e}px;${({$fillColor:e})=>A.css`
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./Bz6nAOkq.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.",unknown_message_type:"(Tipo de mensaje desconocido)",powered_by:"Desarrollado por",citation_title:"Fuente",start_new_conversation_label:"Hablar con un agente",failed_message_resend:"Reintentar",failed_message_remove:"Eliminar",file_upload_no_supported_files:"No hay tipos de archivo compatibles disponibles."},conversation_list:{header_title:"Conversaciones",ended:"Finalizado"},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),r={...o,CHANNEL_FROZEN:"Canal congelado",HEADER_BUTTON__AGENT_HANDOFF:"Conectarse con un agente",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Selecciona una opción para continuar",BUTTON__CANCEL:"Cancelar",BUTTON__SAVE:"Guardar",BUTTON__OK:"Aceptar",BUTTON__SUBMIT:"Enviar",NO_NAME:"(Sin nombre)",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",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",CONVERSATION_LIST__TOPICS_FALLBACK:"Sin categoría",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"},t={language:a.language,dateLocale:a.dateLocale,stringSet:r};exports.default=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./CY_VZc_L.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.",unknown_message_type:"(Tipo de mensaje desconocido)",powered_by:"Desarrollado por",citation_title:"Fuente",start_new_conversation_label:"Hablar con un agente",failed_message_resend:"Reintentar",failed_message_remove:"Eliminar",file_upload_no_supported_files:"No hay tipos de archivo compatibles disponibles."},conversation_list:{header_title:"Conversaciones",ended:"Finalizado"},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),r={...o,CHANNEL_FROZEN:"Canal congelado",HEADER_BUTTON__AGENT_HANDOFF:"Conectarse con un agente",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"Selecciona una opción para continuar",BUTTON__CANCEL:"Cancelar",BUTTON__SAVE:"Guardar",BUTTON__OK:"Aceptar",BUTTON__SUBMIT:"Enviar",NO_NAME:"(Sin nombre)",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",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",CONVERSATION_LIST__TOPICS_FALLBACK:"Sin categoría",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"},t={language:a.language,dateLocale:a.dateLocale,stringSet:r};exports.default=t;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./Bz6nAOkq.cjs"),_=require("date-fns/locale/fr"),o={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.",unknown_message_type:"(Type de message inconnu)",powered_by:"Propulsé par",citation_title:"Source",start_new_conversation_label:"Parler à un agent",failed_message_resend:"Réessayer",failed_message_remove:"Supprimer",file_upload_no_supported_files:"Aucun type de fichier pris en charge disponible."},conversation_list:{header_title:"Conversations",ended:"Terminée"},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"}},n={language:"fr",strings:o,dateLocale:_.fr},a=r.mapCommonStringsToReactFormat(n.strings),t={...a,CHANNEL_FROZEN:"Canal gelé",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__SAVE:"Enregistrer",BUTTON__OK:"OK",BUTTON__SUBMIT:"Soumettre",NO_NAME:"(Sans nom)",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",CONVERSATION_CLOSED_FOOTER_LABEL:"Votre conversation est terminée",START_NEW_CONVERSATION:"💬 Démarrer une nouvelle conversation",RETURN_TO_CONVERSATION:"💬 Retourner à la conversation",CONVERSATION_LIST__TOPICS_FALLBACK:"Aucune catégorie",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:a.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm"},s={language:n.language,dateLocale:n.dateLocale,stringSet:t};exports.default=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./CY_VZc_L.cjs"),_=require("date-fns/locale/fr"),o={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.",unknown_message_type:"(Type de message inconnu)",powered_by:"Propulsé par",citation_title:"Source",start_new_conversation_label:"Parler à un agent",failed_message_resend:"Réessayer",failed_message_remove:"Supprimer",file_upload_no_supported_files:"Aucun type de fichier pris en charge disponible."},conversation_list:{header_title:"Conversations",ended:"Terminée"},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"}},n={language:"fr",strings:o,dateLocale:_.fr},a=r.mapCommonStringsToReactFormat(n.strings),t={...a,CHANNEL_FROZEN:"Canal gelé",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__SAVE:"Enregistrer",BUTTON__OK:"OK",BUTTON__SUBMIT:"Soumettre",NO_NAME:"(Sans nom)",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",CONVERSATION_CLOSED_FOOTER_LABEL:"Votre conversation est terminée",START_NEW_CONVERSATION:"💬 Démarrer une nouvelle conversation",RETURN_TO_CONVERSATION:"💬 Retourner à la conversation",CONVERSATION_LIST__TOPICS_FALLBACK:"Aucune catégorie",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:a.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm"},s={language:n.language,dateLocale:n.dateLocale,stringSet:t};exports.default=s;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./Bz6nAOkq.cjs"),a=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.",unknown_message_type:"(Bilinmeyen mesaj türü)",powered_by:"Tarafından desteklenmektedir",citation_title:"Kaynak",start_new_conversation_label:"Temsilciyle konuş",failed_message_resend:"Tekrar dene",failed_message_remove:"Kaldır",file_upload_no_supported_files:"Desteklenen dosya türü mevcut değil."},conversation_list:{header_title:"Görüşmeler",ended:"Sona erdi"},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:a.tr},i=r.mapCommonStringsToReactFormat(_.strings),t={...i,CHANNEL_FROZEN:"Kanal dondu",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__SAVE:"Kaydet",BUTTON__OK:"Tamam",BUTTON__SUBMIT:"Gönder",NO_NAME:"(İsimsiz)",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",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",CONVERSATION_LIST__TOPICS_FALLBACK:"Kategori yok",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:i.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm"},l={language:_.language,dateLocale:_.dateLocale,stringSet:t};exports.default=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./CY_VZc_L.cjs"),a=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.",unknown_message_type:"(Bilinmeyen mesaj türü)",powered_by:"Tarafından desteklenmektedir",citation_title:"Kaynak",start_new_conversation_label:"Temsilciyle konuş",failed_message_resend:"Tekrar dene",failed_message_remove:"Kaldır",file_upload_no_supported_files:"Desteklenen dosya türü mevcut değil."},conversation_list:{header_title:"Görüşmeler",ended:"Sona erdi"},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:a.tr},i=r.mapCommonStringsToReactFormat(_.strings),t={...i,CHANNEL_FROZEN:"Kanal dondu",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__SAVE:"Kaydet",BUTTON__OK:"Tamam",BUTTON__SUBMIT:"Gönder",NO_NAME:"(İsimsiz)",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",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",CONVERSATION_LIST__TOPICS_FALLBACK:"Kategori yok",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:i.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm"},l={language:_.language,dateLocale:_.dateLocale,stringSet:t};exports.default=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./Bz6nAOkq.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.",unknown_message_type:"(Tipo de mensagem desconhecido)",powered_by:"Desenvolvido por",citation_title:"Fonte",start_new_conversation_label:"Falar com agente",failed_message_resend:"Tentar novamente",failed_message_remove:"Remover",file_upload_no_supported_files:"Nenhum tipo de arquivo suportado disponível."},conversation_list:{header_title:"Conversas",ended:"Encerrada"},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"}},o={language:"pt",strings:r,dateLocale:n.pt},a=_.mapCommonStringsToReactFormat(o.strings),t={...a,CHANNEL_FROZEN:"Canal congelado",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__SAVE:"Salvar",BUTTON__OK:"OK",BUTTON__SUBMIT:"Enviar",NO_NAME:"(Sem nome)",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",CONVERSATION_CLOSED_FOOTER_LABEL:"Sua conversa foi encerrada",START_NEW_CONVERSATION:"💬 Iniciar uma nova conversa",RETURN_TO_CONVERSATION:"💬 Retornar à conversa",CONVERSATION_LIST__TOPICS_FALLBACK:"Sem categoria",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:a.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm"},i={language:o.language,dateLocale:o.dateLocale,stringSet:t};exports.default=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./CY_VZc_L.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.",unknown_message_type:"(Tipo de mensagem desconhecido)",powered_by:"Desenvolvido por",citation_title:"Fonte",start_new_conversation_label:"Falar com agente",failed_message_resend:"Tentar novamente",failed_message_remove:"Remover",file_upload_no_supported_files:"Nenhum tipo de arquivo suportado disponível."},conversation_list:{header_title:"Conversas",ended:"Encerrada"},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"}},o={language:"pt",strings:r,dateLocale:n.pt},a=_.mapCommonStringsToReactFormat(o.strings),t={...a,CHANNEL_FROZEN:"Canal congelado",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__SAVE:"Salvar",BUTTON__OK:"OK",BUTTON__SUBMIT:"Enviar",NO_NAME:"(Sem nome)",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",CONVERSATION_CLOSED_FOOTER_LABEL:"Sua conversa foi encerrada",START_NEW_CONVERSATION:"💬 Iniciar uma nova conversa",RETURN_TO_CONVERSATION:"💬 Retornar à conversa",CONVERSATION_LIST__TOPICS_FALLBACK:"Sem categoria",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:a.DATE_FORMAT__DATE_SHORT,DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION:"HH:mm"},i={language:o.language,dateLocale:o.dateLocale,stringSet:t};exports.default=i;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./Bz6nAOkq.cjs"),t=require("date-fns/locale/ko"),a={conversation:{input_placeholder:"질문하기",input_placeholder_disabled:"이 채널에서는 채팅을 사용할 수 없습니다.",input_placeholder_wait_ai_agent_response:"상담사의 답변을 기다리는 중...",input_placeholder_active_form:"계속 진행하려면 양식을 작성해 주세요.",unknown_message_type:"(알 수 없는 메시지 유형)",powered_by:"Powered by",citation_title:"출처",start_new_conversation_label:"상담사와 대화",failed_message_resend:"다시 시도",failed_message_remove:"삭제",file_upload_no_supported_files:"사용 가능한 지원 파일 형식이 없습니다."},conversation_list:{header_title:"대화",ended:"종료됨"},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:a,dateLocale:t.ko},o=T.mapCommonStringsToReactFormat(e.strings),n={...o,CHANNEL_FROZEN:"채널이 동결되었습니다.",HEADER_BUTTON__AGENT_HANDOFF:"상담사와 연결하기",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"계속하려면 옵션을 선택하세요",BUTTON__CANCEL:"취소",BUTTON__SAVE:"저장",BUTTON__OK:"확인",BUTTON__SUBMIT:"제출",NO_NAME:"(이름 없음)",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:"최고예요.",CONVERSATION_CLOSED_FOOTER_LABEL:"대화가 종료되었습니다",START_NEW_CONVERSATION:"💬 새로운 대화 시작하기",RETURN_TO_CONVERSATION:"💬 대화로 돌아가기",CONVERSATION_LIST__TOPICS_FALLBACK:"카테고리 없음",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"},A={language:e.language,dateLocale:e.dateLocale,stringSet:n};exports.default=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./CY_VZc_L.cjs"),t=require("date-fns/locale/ko"),a={conversation:{input_placeholder:"질문하기",input_placeholder_disabled:"이 채널에서는 채팅을 사용할 수 없습니다.",input_placeholder_wait_ai_agent_response:"상담사의 답변을 기다리는 중...",input_placeholder_active_form:"계속 진행하려면 양식을 작성해 주세요.",unknown_message_type:"(알 수 없는 메시지 유형)",powered_by:"Powered by",citation_title:"출처",start_new_conversation_label:"상담사와 대화",failed_message_resend:"다시 시도",failed_message_remove:"삭제",file_upload_no_supported_files:"사용 가능한 지원 파일 형식이 없습니다."},conversation_list:{header_title:"대화",ended:"종료됨"},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:a,dateLocale:t.ko},o=T.mapCommonStringsToReactFormat(e.strings),n={...o,CHANNEL_FROZEN:"채널이 동결되었습니다.",HEADER_BUTTON__AGENT_HANDOFF:"상담사와 연결하기",MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES:"계속하려면 옵션을 선택하세요",BUTTON__CANCEL:"취소",BUTTON__SAVE:"저장",BUTTON__OK:"확인",BUTTON__SUBMIT:"제출",NO_NAME:"(이름 없음)",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:"최고예요.",CONVERSATION_CLOSED_FOOTER_LABEL:"대화가 종료되었습니다",START_NEW_CONVERSATION:"💬 새로운 대화 시작하기",RETURN_TO_CONVERSATION:"💬 대화로 돌아가기",CONVERSATION_LIST__TOPICS_FALLBACK:"카테고리 없음",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"},A={language:e.language,dateLocale:e.dateLocale,stringSet:n};exports.default=A;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./Bz6nAOkq.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.",unknown_message_type:"(Unbekannter Nachrichtentyp)",powered_by:"Unterstützt von",citation_title:"Quelle",start_new_conversation_label:"Mit Agent sprechen",failed_message_resend:"Erneut versuchen",failed_message_remove:"Entfernen",file_upload_no_supported_files:"Keine unterstützten Dateitypen verfügbar."},conversation_list:{header_title:"Gespräche",ended:"Beendet"},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,CHANNEL_FROZEN:"Kanal eingefroren",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__SAVE:"Speichern",BUTTON__OK:"OK",BUTTON__SUBMIT:"Absenden",NO_NAME:"(Kein Name)",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",CONVERSATION_CLOSED_FOOTER_LABEL:"Deine Unterhaltung wurde beendet",START_NEW_CONVERSATION:"💬 Neue Unterhaltung starten",RETURN_TO_CONVERSATION:"💬 Zurück zur Unterhaltung",CONVERSATION_LIST__TOPICS_FALLBACK:"Keine Kategorie",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"},s={language:n.language,dateLocale:n.dateLocale,stringSet:i};exports.default=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./CY_VZc_L.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.",unknown_message_type:"(Unbekannter Nachrichtentyp)",powered_by:"Unterstützt von",citation_title:"Quelle",start_new_conversation_label:"Mit Agent sprechen",failed_message_resend:"Erneut versuchen",failed_message_remove:"Entfernen",file_upload_no_supported_files:"Keine unterstützten Dateitypen verfügbar."},conversation_list:{header_title:"Gespräche",ended:"Beendet"},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,CHANNEL_FROZEN:"Kanal eingefroren",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__SAVE:"Speichern",BUTTON__OK:"OK",BUTTON__SUBMIT:"Absenden",NO_NAME:"(Kein Name)",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",CONVERSATION_CLOSED_FOOTER_LABEL:"Deine Unterhaltung wurde beendet",START_NEW_CONVERSATION:"💬 Neue Unterhaltung starten",RETURN_TO_CONVERSATION:"💬 Zurück zur Unterhaltung",CONVERSATION_LIST__TOPICS_FALLBACK:"Keine Kategorie",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"},s={language:n.language,dateLocale:n.dateLocale,stringSet:i};exports.default=s;
@@ -1,4 +1,4 @@
1
- import { m as _ } from "./C3QOlRLQ.js";
1
+ import { m as _ } from "./DhzmFx5G.js";
2
2
  import { de as r } from "date-fns/locale/de";
3
3
  const a = {
4
4
  conversation: {
@@ -1,4 +1,4 @@
1
- import { m as T } from "./C3QOlRLQ.js";
1
+ import { m as T } from "./DhzmFx5G.js";
2
2
  import { ko as a } from "date-fns/locale/ko";
3
3
  const t = {
4
4
  conversation: {
@@ -1,4 +1,4 @@
1
- import { m as i } from "./C3QOlRLQ.js";
1
+ import { m as i } from "./DhzmFx5G.js";
2
2
  import { it as _ } from "date-fns/locale/it";
3
3
  const n = {
4
4
  conversation: {
@@ -1,4 +1,4 @@
1
- import { m as n } from "./C3QOlRLQ.js";
1
+ import { m as n } from "./DhzmFx5G.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 _ } from "./C3QOlRLQ.js";
1
+ import { m as _ } from "./DhzmFx5G.js";
2
2
  import { fr as o } from "date-fns/locale/fr";
3
3
  const r = {
4
4
  conversation: {
@@ -1,4 +1,4 @@
1
- import { m as _ } from "./C3QOlRLQ.js";
1
+ import { m as _ } from "./DhzmFx5G.js";
2
2
  import { pt as n } from "date-fns/locale/pt";
3
3
  const r = {
4
4
  conversation: {
@@ -1,4 +1,4 @@
1
- import { m as a } from "./C3QOlRLQ.js";
1
+ import { m as a } from "./DhzmFx5G.js";
2
2
  import { tr as r } from "date-fns/locale/tr";
3
3
  const n = {
4
4
  conversation: {
@@ -146,7 +146,7 @@ function Wo(e, t, n) {
146
146
  const o = /* @__PURE__ */ new Date(), s = new Date(((a = e.lastMessage) == null ? void 0 : a.createdAt) || e.createdAt), i = vo(o, s);
147
147
  return i < 1 ? n.justNow : i < 60 ? n.minutesAgo(i) : yo(s) ? n.hoursAgo(_o(o, s)) : t(s, n.dateShortFormat);
148
148
  }
149
- const Go = "1.9.1", Be = "sb-agent", jo = Go, rr = "KEY_IMG_ASPECT_RATIO", qo = "*/*", F = {
149
+ const Go = "1.9.2", Be = "sb-agent", jo = Go, rr = "KEY_IMG_ASPECT_RATIO", qo = "*/*", F = {
150
150
  BODY_MAX_WIDTH: 244,
151
151
  WIDE_BODY_MAX_WIDTH: 640,
152
152
  AVATAR_SIZE: 26,
@@ -2467,7 +2467,7 @@ async function Li(e) {
2467
2467
  if (t) return t;
2468
2468
  try {
2469
2469
  if (Ii.has(e)) {
2470
- const { default: n } = await $i(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./DuyZf1Vo.js"), "./languages/en.ts": () => Promise.resolve().then(() => Oi), "./languages/es.ts": () => import("./DbVz_9m0.js"), "./languages/fr.ts": () => import("./BiYSaYUc.js"), "./languages/hi.ts": () => import("./DS-fbH3S.js"), "./languages/it.ts": () => import("./BqgL9sJP.js"), "./languages/ja.ts": () => import("./DXvyPOw8.js"), "./languages/ko.ts": () => import("./BNtwGyTL.js"), "./languages/pt.ts": () => import("./Nxjx0s3h.js"), "./languages/tr.ts": () => import("./BMhOEL86.js") }), `./languages/${e}.ts`, 3);
2470
+ const { default: n } = await $i(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./35A17kHz.js"), "./languages/en.ts": () => Promise.resolve().then(() => Oi), "./languages/es.ts": () => import("./CJ04407L.js"), "./languages/fr.ts": () => import("./CuOU5cbr.js"), "./languages/hi.ts": () => import("./DswcdEAx.js"), "./languages/it.ts": () => import("./BbcJjPB0.js"), "./languages/ja.ts": () => import("./lS_0kccT.js"), "./languages/ko.ts": () => import("./BCgu5Kyo.js"), "./languages/pt.ts": () => import("./CuyxSfnk.js"), "./languages/tr.ts": () => import("./DKDTytZX.js") }), `./languages/${e}.ts`, 3);
2471
2471
  return Nt.set(e, n), n;
2472
2472
  }
2473
2473
  return lt;
@@ -2891,7 +2891,7 @@ const xa = h.div`display:flex;flex-direction:column;align-items:flex-start;gap:$
2891
2891
  `, ya = h.img`width:100%;height:100%;object-fit:cover;`, _a = h.video`width:100%;height:100%;object-fit:cover;`, Ca = "✱", yr = (e) => {
2892
2892
  const t = new RegExp(`(\`+)([^\`]+?)\\1|(${Ca}+)`, "g");
2893
2893
  return e.replace(t, (n, o, s, i) => o ? n : i ? `<span id=${ba} aria-label="masked-text">${i}</span>` : n);
2894
- }, Sa = (e) => e.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>"), Ta = L(async () => ({ default: (await import("./DINOaKB4.js")).MarkdownText })), Aa = L(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
2894
+ }, Sa = (e) => e.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>"), Ta = L(async () => ({ default: (await import("./cVdWfMyk.js")).MarkdownText })), Aa = L(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
2895
2895
  function $n(e) {
2896
2896
  var i, a;
2897
2897
  const t = e.maxBodyWidth ?? F.BODY_MAX_WIDTH, n = Si(e.message, e.isStreaming), o = ne(() => Yo(n, yr), [n]), s = {
@@ -4258,7 +4258,7 @@ const kd = ({ onScrollAfterSendMessage: e }) => {
4258
4258
  if (!e) return null;
4259
4259
  const t = {};
4260
4260
  return e.ai && Object.keys(e.ai).length > 0 && (t.ai_attrs = e.ai), e.safeguard && Object.keys(e.safeguard).length > 0 && (t.safeguard_attrs = e.safeguard), typeof e.use_prompt_cache == "boolean" && (t.use_prompt_cache = e.use_prompt_cache), Object.keys(t).length > 0 ? t : null;
4261
- }, Lr = 50, kt = Lr - 20, {
4261
+ }, Lr = 50, kt = Lr - 40, {
4262
4262
  Provider: $d,
4263
4263
  useContext: Md
4264
4264
  } = J("ConversationScroll"), zn = {
@@ -5111,7 +5111,7 @@ const Ru = (e, t) => {
5111
5111
  color: ${u.color.information.main};
5112
5112
  `};
5113
5113
  }
5114
- `, Wu = L(() => import("./DINOaKB4.js").then((e) => ({ default: e.MarkdownText }))), Gu = () => {
5114
+ `, Wu = L(() => import("./cVdWfMyk.js").then((e) => ({ default: e.MarkdownText }))), Gu = () => {
5115
5115
  const { aiAgentInfo: e, userSession: t } = te(), { messageSource: n, channelSource: o } = ie(), [s, i] = T(null), a = qt("special-notice", o.channel), l = O(() => o.channel ? a ? n.messages.some((c) => He(c, (t == null ? void 0 : t.userId) ?? "")) : !0 : null, [o.channel, a, n.messages, t == null ? void 0 : t.userId]);
5116
5116
  return U(() => {
5117
5117
  s || i(l());
@@ -1,4 +1,4 @@
1
- import { m as a } from "./C3QOlRLQ.js";
1
+ import { m as a } from "./DhzmFx5G.js";
2
2
  import { hi as t } from "date-fns/locale/hi";
3
3
  const o = {
4
4
  conversation: {
@@ -3,7 +3,7 @@ import { useCallback as p } from "react";
3
3
  import s from "dompurify";
4
4
  import h, { RuleType as x } from "markdown-to-jsx";
5
5
  import g from "styled-components";
6
- import { A as b, e as c, c as i } from "./C3QOlRLQ.js";
6
+ import { A as b, e as c, c as i } from "./DhzmFx5G.js";
7
7
  const m = (d, o, n, t) => o.type === x.textStrikethroughed ? /* @__PURE__ */ r.createElement("span", { key: t.key }, `~~${n(o.children, t)}~~`) : d(), v = ({ className: d, children: o, style: n, onClickImage: t }) => {
8
8
  const a = p(
9
9
  (e) => /* @__PURE__ */ r.createElement("img", { ...e, onClick: () => e.src && (t == null ? void 0 : t(e.src)) }),
@@ -1,4 +1,4 @@
1
- import { m as T } from "./C3QOlRLQ.js";
1
+ import { m as T } from "./DhzmFx5G.js";
2
2
  import { ja as o } from "date-fns/locale/ja";
3
3
  const t = {
4
4
  conversation: {
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./cjs/Bz6nAOkq.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.ConversationLayout=e.ConversationLayout;exports.ConversationList=e.ConversationList;exports.ConversationListContext=e.ConversationListContext;exports.ConversationListContextProvider=e.ConversationListContextProvider;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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./cjs/CY_VZc_L.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.ConversationLayout=e.ConversationLayout;exports.ConversationList=e.ConversationList;exports.ConversationListContext=e.ConversationListContext;exports.ConversationListContextProvider=e.ConversationListContextProvider;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;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as o, b as n, x as t, t as i, D as r, i as C, k as L, l as u, j as g, o as v, q as x, r as y, C as M, p as m, h as d, F as l, I, L as P, v as S, w as c, M as f, O as p, P as h, S as A, g as D, n as F, s as O, f as T, u as b, d as j } from "./es/C3QOlRLQ.js";
1
+ import { a as o, b as n, x as t, t as i, D as r, i as C, k as L, l as u, j as g, o as v, q as x, r as y, C as M, p as m, h as d, F as l, I, L as P, v as S, w as c, M as f, O as p, P as h, S as A, g as D, n as F, s as O, f as T, u as b, d as j } from "./es/DhzmFx5G.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.9.1",
3
+ "version": "1.9.2",
4
4
  "description": "Sendbird AI Agent Messenger for React",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -44,7 +44,7 @@
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.9.1",
47
+ "@sendbird/ai-agent-core": "1.9.2",
48
48
  "@sendbird/vite-tools": "0.0.1",
49
49
  "@sendbird/config-editor": "0.1.0"
50
50
  },