UNPKG

captivate-chat-api

Version:

This is a wrapper for captivate chat api socket custom channel

1 lines 22.3 kB
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(this,(()=>(()=>{"use strict";var e={86:function(e,t,n){var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(s,i){function r(e){try{c(o.next(e))}catch(e){i(e)}}function a(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}c((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.CaptivateChatAPI=void 0;const s=n(52);let i;if("undefined"!=typeof window&&window.WebSocket)i=window.WebSocket;else if(void 0!==n.g&&n.g.WebSocket)i=n.g.WebSocket;else try{i=n(591)}catch(e){throw new Error("WebSocket not available in this environment and ws module could not be loaded")}function r(e){return new Proxy(e,{get(e,t,n){const s=e[t];return"function"!=typeof s||["isSocketActive","connect","reconnect","getSocket"].includes(t)?s:function(...n){return o(this,void 0,void 0,(function*(){if("function"==typeof e.isSocketActive&&!e.isSocketActive()){console.log("Socket not active, attempting to reconnect...");try{if("function"!=typeof e.reconnect)throw new Error("Reconnect method not available");yield e.reconnect()}catch(e){throw new Error(`Socket reconnection failed. Cannot execute ${String(t)}: ${e.message}`)}}return s.apply(e,n)}))}}})}class a{constructor(e,t="prod"){this.reconnectAttempts=0,this.maxReconnectAttempts=5,this.reconnectDelay=3e3,this.apiKey=e,this.mode=t,this.url="prod"===this.mode?`wss://channel.wss.captivatechat.ai/dev?apiKey=${e}`:`wss://channel-dev.wss.captivatechat.ai/dev?apiKey=${e}`,this.socket=null,this.conversations=new Map}_send(e){this.socket&&this.socket.readyState===i.OPEN?this.socket.send(JSON.stringify(e)):console.error("Socket is not open. Message not sent:",e)}connect(){return o(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{try{this.socket=new i(this.url);const n=setTimeout((()=>{t(new Error("Connection timeout: socket_connected not received"))}),1e4);this.socket.onopen=()=>{console.log("WebSocket connected, waiting for API confirmation...")},this.socket.onmessage=t=>{var o;try{"socket_connected"===(null===(o=JSON.parse(t.data.toString()).event)||void 0===o?void 0:o.event_type)&&(console.log("API Successfully Connected"),clearTimeout(n),e())}catch(e){console.error("Error parsing message:",e)}},this.socket.onerror=e=>{console.error("WebSocket Error:",e.message||e),clearTimeout(n),t(new Error(e.message||"WebSocket error"))},this.socket.onclose=e=>{console.log("WebSocket connection closed with",e.code),1e3!==e.code&&(console.log("Attempting to reconnect..."),setTimeout((()=>this.connect()),3e3))}}catch(e){t(e)}}))}))}createConversation(e){return o(this,arguments,void 0,(function*(e,t={},n={},o="bot-first",i={}){return new Promise(((a,c)=>{var d;try{const l=Object.assign({},n);i&&(l.private=i),this._send({action:"sendMessage",event:{event_type:"conversation_start",event_payload:{userId:e,userBasicInfo:t,metadata:l}}});const h=e=>{var t,n;try{const i=JSON.parse(e.data.toString());if("conversation_start_success"===(null===(t=i.event)||void 0===t?void 0:t.event_type)){const e=i.event.event_payload.conversation_id;null===(n=this.socket)||void 0===n||n.removeEventListener("message",h);const t=r(new s.Conversation(e,this.socket,{},this.apiKey,this.mode));this.conversations.set(e,t),"bot-first"===o?t.sendMessage({type:"text",text:""}).then((()=>a(t))).catch(c):a(t)}}catch(e){console.error("Error processing message:",e)}};null===(d=this.socket)||void 0===d||d.addEventListener("message",h),setTimeout((()=>{var e;null===(e=this.socket)||void 0===e||e.removeEventListener("message",h),c(new Error("Timeout: No response for createConversation"))}),1e4)}catch(e){c(e)}}))}))}getConversation(e){let t=this.conversations.get(e);if(!t){if(null===this.socket)throw console.error("Socket is not initialized"),new Error("WebSocket connection not established");t=r(new s.Conversation(e,this.socket,{},this.apiKey,this.mode)),this.conversations.set(e,t)}return null==t||t.restartListeners(),t}getUserConversations(e){return o(this,void 0,void 0,(function*(){const t="string"==typeof e?{userId:e}:e,{userId:n,filter:o={},search:i={},pagination:a={},apiKeys:c}=t,d=[];let l;const h=o&&Object.keys(o).length>0||i&&Object.keys(i).length>0||a&&Object.keys(a).length>0||c&&Array.isArray(c)&&c.length>0;return new Promise(((e,t)=>{var v;try{if(h){const e={userId:n};o&&Object.keys(o).length>0&&(e.filter=o),i&&Object.keys(i).length>0&&(e.search=i),a&&Object.keys(a).length>0&&(e.pagination=a),c&&Array.isArray(c)&&c.length>0&&(e.apiKeys=c),this._send({action:"sendMessage",event:{event_type:"get_user_conversations_v2",event_payload:e}})}else this._send({action:"sendMessage",event:{event_type:"get_user_conversations",event_payload:{userId:n}}});const u=n=>{var o,i;try{const t=JSON.parse(n.data.toString());if("user_conversations"===(null===(o=t.event)||void 0===o?void 0:o.event_type)){null===(i=this.socket)||void 0===i||i.removeEventListener("message",u);const n=t.event.event_payload.conversations;for(const e of n){const{conversation_id:t,metadata:n,apiKey:o}=e;null!==this.socket&&d.push(r(new s.Conversation(t,this.socket,n,o||this.apiKey,this.mode)))}t.event.event_payload.pagination&&(l=t.event.event_payload.pagination),e({conversations:d,pagination:l})}}catch(e){console.error("Error processing message:",e),t(e)}};null===(v=this.socket)||void 0===v||v.addEventListener("message",u),setTimeout((()=>{var e;null===(e=this.socket)||void 0===e||e.removeEventListener("message",u),t(new Error("Timeout: No response for getUserConversations"))}),1e4)}catch(e){t(e)}}))}))}deleteUserConversations(e){return o(this,void 0,void 0,(function*(){return new Promise(((t,n)=>{var o;if(!e)return n(new Error("User ID must be provided."));try{this._send({action:"sendMessage",event:{event_type:"delete_conversation",event_payload:{userId:e}}});const s=o=>{var i,r;try{const n=JSON.parse(o.data.toString());"delete_conversation_success"===(null===(i=n.event)||void 0===i?void 0:i.event_type)&&n.event.event_payload.userId===e&&(null===(r=this.socket)||void 0===r||r.removeEventListener("message",s),t())}catch(e){n(e)}};null===(o=this.socket)||void 0===o||o.addEventListener("message",s),setTimeout((()=>{var t;null===(t=this.socket)||void 0===t||t.removeEventListener("message",s),n(new Error(`Timeout: No response for deleting conversations for user ${e}`))}),1e4)}catch(e){n(e)}}))}))}getSocket(){return this.socket}isSocketActive(){return!!this.socket&&this.socket.readyState===i.OPEN}reconnect(){return o(this,void 0,void 0,(function*(){if(this.reconnectAttempts>=this.maxReconnectAttempts)throw new Error(`Max reconnection attempts (${this.maxReconnectAttempts}) reached`);this.reconnectAttempts++,console.log(`Attempting to reconnect... (${this.reconnectAttempts}/${this.maxReconnectAttempts})`);try{yield this.connect(),this.reconnectAttempts=0,console.log("Reconnection successful")}catch(e){if(console.error(`Reconnection attempt ${this.reconnectAttempts} failed:`,e),this.reconnectAttempts<this.maxReconnectAttempts)return yield new Promise((e=>setTimeout(e,this.reconnectDelay))),this.reconnect();throw e}}))}static create(e){return o(this,arguments,void 0,(function*(e,t="prod"){const n=new a(e,t);return yield n.connect(),r(n)}))}}t.CaptivateChatAPI=a},67:function(e,t){var n=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(s,i){function r(e){try{c(o.next(e))}catch(e){i(e)}}function a(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}c((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.CaptivateChatFileManager=void 0;class o{constructor(e,t,n){this.type="files",this.files=[{filename:t.metadata.originalFileName,type:n,file:e,textContent:t}]}static create(e){return n(this,void 0,void 0,(function*(){const t=e.file,n=void 0===e.storage||e.storage;if(!1===n&&!e.url)throw new Error("URL is required when storage is false for sendMessage compatibility");const s=e.fileName||(t instanceof File?t.name:`attachment_${Date.now()}`),i=e.fileType||(t instanceof File?t.type:t.type||"application/octet-stream"),r=yield o.convertFileToText(t,s,!0,n),a=new o(t,{type:"file_content",text:r.text,metadata:{source:"file_attachment",originalFileName:s,storageType:"direct"}},i);return n&&r.storageInfo&&(a.files[0].storage=r.storageInfo),!1===n&&e.url&&(a.files[0].url=e.url),o.createProxy(a)}))}getFirstFile(){return this.files[0]}getFilename(){var e;return null===(e=this.files[0])||void 0===e?void 0:e.filename}getTextContent(){var e,t;return(null===(t=null===(e=this.files[0])||void 0===e?void 0:e.textContent)||void 0===t?void 0:t.text)||""}getFileType(){var e;return null===(e=this.files[0])||void 0===e?void 0:e.type}toFilesArray(){return this.files}*[Symbol.iterator](){yield*this.files}get[Symbol.toStringTag](){return"Array"}get length(){return this.files.length}refreshSecureUrl(){return n(this,arguments,void 0,(function*(e=7200){var t;const n=this.files[0];if(n&&(null===(t=n.storage)||void 0===t?void 0:t.fileKey))return yield o.getSecureFileUrl(n.storage.fileKey,e)}))}static createProxy(e){return new Proxy(e,{get:(e,t)=>t===Symbol.iterator||"length"===t||"number"==typeof t?e.files[t]:e[t]})}static createFile(e){return n(this,void 0,void 0,(function*(){return(yield o.create({file:e.file,fileName:e.fileName,fileType:e.fileType,storage:e.storage,url:e.url})).getFirstFile()}))}static createMultiple(e){return n(this,void 0,void 0,(function*(){const t=void 0===e.storage||e.storage;if(!1===t&&(!e.urls||e.urls.length!==e.files.length))throw new Error("URLs array is required when storage is false and must match the number of files");const n=e.files,s=(yield Promise.all(n.map(((n,s)=>o.create({file:n,storage:t,url:!1===t?e.urls[s]:void 0}))))).flatMap((e=>e.files)),i=new o(n[0],{type:"file_content",text:"",metadata:{source:"file_attachment",originalFileName:"multiple_files",storageType:"direct"}},"application/octet-stream");return i.files=s,o.createProxy(i)}))}static getSecureFileUrl(e){return n(this,arguments,void 0,(function*(e,t=7200){const n=o.PRESIGNED_URL_API_URL;try{const o=yield fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fileKey:e,expiresIn:t})});if(!o.ok){const e=yield o.json().catch((()=>({})));throw new Error(`Secure URL generation failed: ${o.status} ${o.statusText}. ${e.error||""}`)}const s=yield o.json();if(!s.success)throw new Error(`Secure URL generation failed: ${s.error||"Unknown error"}`);return s.presignedUrl||""}catch(e){if(e.message.includes("Secure URL generation failed"))throw e;throw new Error(`Failed to generate secure URL: ${e.message}`)}}))}static convertFileToText(e,t,s,i){return n(this,void 0,void 0,(function*(){const n=o.FILE_TO_TEXT_API_URL,r=new FormData;r.append("file",e,t),r.append("includeMetadata",s.toString()),r.append("storage",i.toString());try{const e=yield fetch(n,{method:"POST",body:r});if(!e.ok){const t=yield e.json().catch((()=>({})));throw new Error(`File conversion failed: ${e.status} ${e.statusText}. ${t.error||""}`)}const t=yield e.json();if(!t.success)throw new Error(`File conversion failed: ${t.error||"Unknown error"}`);return{text:t.text||"",storageInfo:i?{fileKey:t.fileKey,presignedUrl:t.presignedUrl,expiresIn:t.expiresIn,fileSize:t.fileSize,processingTime:t.processingTime}:void 0}}catch(e){if(e.message.includes("File conversion failed"))throw e;throw new Error(`Failed to convert file to text: ${e.message}`)}}))}}t.CaptivateChatFileManager=o,o.FILE_TO_TEXT_API_URL="https://file-to-text.prod.captivat.io/api/file-to-text",o.PRESIGNED_URL_API_URL="https://file-to-text.prod.captivat.io/api/presigned-url"},629:function(e,t,n){var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(s,i){function r(e){try{c(o.next(e))}catch(e){i(e)}}function a(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}c((o=o.apply(e,t||[])).next())}))},s=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(o=Object.getOwnPropertySymbols(e);s<o.length;s++)t.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(e,o[s])&&(n[o[s]]=e[o[s]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.CaptivateChatManager=void 0;const i=n(86),r=n(52);class a{constructor(e,t="prod"){this.apiInstances={};for(const n of e)this.apiInstances[n]=new i.CaptivateChatAPI(n,t)}static create(e){return o(this,arguments,void 0,(function*(e,t="prod"){const n=Object.create(a.prototype);n.apiInstances={};for(const o of e)n.apiInstances[o]=yield i.CaptivateChatAPI.create(o,t);return n}))}connectAll(){return o(this,void 0,void 0,(function*(){yield Promise.all(Object.values(this.apiInstances).map((e=>e.connect())))}))}getUserConversations(e){return o(this,void 0,void 0,(function*(){const t=e.apiKeys||Object.keys(this.apiInstances),n=this.apiInstances[t[0]],{apiKeys:o}=e,i=s(e,["apiKeys"]),a=yield n.getUserConversations(Object.assign(Object.assign({},i),{apiKeys:t}));return{conversations:a.conversations.map((e=>{const t=e.apiKey,n=this.apiInstances[t];if(!n)throw new Error(`No CaptivateChatAPI instance for apiKey: ${t}`);if(!n.getSocket())throw new Error(`WebSocket not initialized for apiKey: ${t}`);return new r.Conversation(e.conversationId,n.getSocket(),e.metadata,t)})),pagination:a.pagination}}))}getApiInstance(e){return this.apiInstances[e]}}t.CaptivateChatManager=a},52:function(e,t,n){var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(s,i){function r(e){try{c(o.next(e))}catch(e){i(e)}}function a(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}c((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Conversation=void 0;const s=n(67);t.Conversation=class{constructor(e,t,n,o,s){this.apiKey=o||"",this.conversationId=e,this.socket=t,this.listeners=new Map,this.metadata=n||null,this.local_id=Math.floor(1e4*Math.random()),this.mode=s||"prod",this.socket.onmessage=this.handleMessage.bind(this)}handleMessage(e){var t,n;const o=JSON.parse(e.data),s=null===(t=o.event)||void 0===t?void 0:t.event_type;if(s&&this.listeners.has(s)){const e=o.event.event_payload;null===(n=this.listeners.get(s))||void 0===n||n.forEach((t=>t(e)))}}restartListeners(){this.socket.onmessage=this.handleMessage.bind(this)}addListener(e,t){var n;this.restartListeners(),this.listeners.has(e)||this.listeners.set(e,[]),null===(n=this.listeners.get(e))||void 0===n||n.push(t)}onMessage(e){this.addListener("bot_message",(t=>e(t.content,"ai_agent"))),this.addListener("livechat_message",(t=>e(t.content,"human_agent"))),this.addListener("general_error",(t=>o(this,void 0,void 0,(function*(){if(413===t.error_code&&t.message_link)try{const n=yield fetch(t.message_link,{method:"GET",headers:{"x-api-key":this.apiKey,Accept:"application/json"}});if(!n.ok)throw new Error(`Failed to fetch large message: ${n.status} ${n.statusText}`);const o=yield n.json();e(o.botMessage.content,"ai_agent")}catch(t){console.error("Error fetching large message:",t),e(`[Error fetching large message: ${t.message}]`,"error")}else console.log("Not a large message error or no message_link provided"),e(`[Error: ${t.error_desc||"Unknown error"}]`,"error")}))))}onActionReceived(e){this.addListener("action",(t=>e(t.actions)))}onConversationUpdate(e){this.addListener("conversation_update",(t=>{e({type:t.type,conversationId:t.conversation_id,data:t.data})}))}onError(e){this.addListener("general_error",(t=>{e({conversationId:t.conversation_id,errorCode:t.error_code,errorDesc:t.error_desc})}))}sendMessage(e){return o(this,void 0,void 0,(function*(){return"string"==typeof e&&(e={type:"text",text:e}),this.sendPayload("user_message",{type:"message_create",client_msg_id:`unique-message-id-${Date.now()}`,conversation_id:this.conversationId,content:e})}))}setMetadata(e){return o(this,void 0,void 0,(function*(){if("object"!=typeof e||null===e)throw new Error("Metadata must be a non-null object.");return new Promise(((t,n)=>{const o={action:"sendMessage",event:{event_type:"metadata",event_payload:{metadata:e,client_msg_id:`metadata-${Date.now()}`,conversation_id:this.conversationId}}};this.socket.send(JSON.stringify(o));const s=e=>{e.conversation_id===this.conversationId&&(this.removeListener("metadata_update_success",s),t(e))};this.addListener("metadata_update_success",s),setTimeout((()=>{this.removeListener("metadata_update_success",s),n(new Error("Timeout: No response for metadata update"))}),15e3)}))}))}setPrivateMetadata(e){return o(this,void 0,void 0,(function*(){if("object"!=typeof e||null===e)throw new Error("Private metadata must be a non-null object.");return this.setMetadata({private:e})}))}sendAction(e){return o(this,arguments,void 0,(function*(e,t={}){return this.sendPayload("action",{type:"normal",id:e,data:t,conversation_id:this.conversationId})}))}getTranscript(){return o(this,void 0,void 0,(function*(){if(!this.apiKey)throw new Error("API key is required to fetch transcript via REST.");const e=`${"prod"===this.mode?"https://channel.prod.captivat.io":"https://channel.dev.captivat.io"}/api/transcript?conversation_id=${encodeURIComponent(this.conversationId)}`,t=yield fetch(e,{method:"GET",headers:{"x-api-key":this.apiKey,Accept:"application/json"}});if(!t.ok)throw new Error(`Failed to fetch transcript: ${t.status} ${t.statusText}`);const n=yield t.json();return yield this.refreshExpiredFileUrls(n.transcript)}))}refreshExpiredFileUrls(e){return o(this,void 0,void 0,(function*(){const t=[];for(const n of e)if(n.files&&n.files.length>0){const e=[];for(const t of n.files)if(t.storage&&t.storage.fileKey)try{const n=Math.floor(Date.now()/1e3);if(t.storage.expiresIn-n<300){console.log(`Refreshing expired URL for file: ${t.filename}`);const o=yield s.CaptivateChatFileManager.getSecureFileUrl(t.storage.fileKey,7200);e.push(Object.assign(Object.assign({},t),{storage:Object.assign(Object.assign({},t.storage),{presignedUrl:o,expiresIn:n+7200})}))}else e.push(t)}catch(n){console.error(`Failed to refresh file ${t.filename}:`,n),e.push(t)}else e.push(t);t.push(Object.assign(Object.assign({},n),{files:e}))}else t.push(n);return t}))}getMetadata(){return o(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{const n={action:"sendMessage",event:{event_type:"metadata_request",event_payload:{conversation_id:this.conversationId}}};this.socket.send(JSON.stringify(n));const o=t=>{t.conversation_id===this.conversationId&&(this.removeListener("conversation_metadata",o),e(t.content))};this.addListener("conversation_metadata",o),setTimeout((()=>{this.removeListener("conversation_metadata",o),t(new Error("Timeout: No response for metadata request"))}),1e4)}))}))}delete(){return o(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{try{const n={action:"sendMessage",event:{event_type:"delete_conversation",event_payload:{conversation_id:this.conversationId}}};this.socket.send(JSON.stringify(n));const o=t=>{var n;const s=JSON.parse(t.data);"delete_conversation_success"===(null===(n=s.event)||void 0===n?void 0:n.event_type)&&s.event.event_payload.conversation_id===this.conversationId&&(this.socket.removeEventListener("message",o),e())};this.socket.addEventListener("message",o),setTimeout((()=>{this.socket.removeEventListener("message",o),t(new Error(`Timeout: No response for deleting conversation ${this.conversationId}`))}),1e4)}catch(e){t(e)}}))}))}fileToBase64(e){return new Promise(((t,n)=>{const o=new FileReader;o.onload=()=>{const e=o.result.split(",")[1];t(e)},o.onerror=n,o.readAsDataURL(e)}))}blobToBase64(e){return new Promise(((t,n)=>{const o=new FileReader;o.onload=()=>{const e=o.result.split(",")[1];t(e)},o.onerror=n,o.readAsDataURL(e)}))}editMessage(e,t){return o(this,void 0,void 0,(function*(){return"string"==typeof t&&(t={type:"text",text:t}),new Promise(((n,o)=>{this.sendPayload("edit_message",{type:"message_create",client_msg_id:`edit-message-id-${Date.now()}`,conversation_id:this.conversationId,message_id:e,content:t});const s=t=>{t.conversation_id===this.conversationId&&t.message_id===e&&(this.removeListener("message_edited_success",s),n())};this.addListener("message_edited_success",s),setTimeout((()=>{this.removeListener("message_edited_success",s),o(new Error("Timeout: No response for message edit"))}),1e4)}))}))}sendPayload(e,t){return o(this,void 0,void 0,(function*(){return new Promise(((n,o)=>{try{const o={action:"sendMessage",event:{event_type:e,event_payload:t}};this.socket.send(JSON.stringify(o)),n()}catch(e){o(e)}}))}))}removeListener(e,t){const n=this.listeners.get(e);n&&this.listeners.set(e,n.filter((e=>e!==t)))}getConversationId(){return this.conversationId}}},591:e=>{e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}},t={};function n(o){var s=t[o];if(void 0!==s)return s.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var o={};return(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.CaptivateChatFileManager=e.CaptivateChatManager=e.CaptivateChatAPI=void 0;const t=n(86);Object.defineProperty(e,"CaptivateChatAPI",{enumerable:!0,get:function(){return t.CaptivateChatAPI}});const s=n(629);Object.defineProperty(e,"CaptivateChatManager",{enumerable:!0,get:function(){return s.CaptivateChatManager}});const i=n(67);Object.defineProperty(e,"CaptivateChatFileManager",{enumerable:!0,get:function(){return i.CaptivateChatFileManager}}),"undefined"!=typeof window&&(window.CaptivateChatAPI=t.CaptivateChatAPI,window.CaptivateChatManager=s.CaptivateChatManager,window.CaptivateChatFileManager=i.CaptivateChatFileManager)})(),o})()));