@hivegpt/hiveai-angular 0.0.320 → 0.0.321

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
- {"version":3,"sources":["../../../../node_modules/tslib/tslib.es6.js","../../../../projects/hivegpt/eventsgpt-angular/src/lib/utils/utils.ts","../../../../projects/hivegpt/eventsgpt-angular/src/environments/environment.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/components/conversation.service.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/components/NotificationSocket.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/components/socket-service.service.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/components/bot.service.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/components/chat-drawer/chat-drawer.component.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/components/chatbot/chatbot.component.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/pipes/safe-html.pipe.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/components/video-player/video-player.component.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/components/bot-html-editor/bot-html-editor.component.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/hivegpt.module.ts"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","__values","o","s","Symbol","iterator","m","i","length","next","value","done","__read","n","r","e","ar","push","error","__spread","arguments","concat","SuppressedError","formatHoursAndMinutes","date","hours","getHours","minutes","getMinutes","formatNow","timezone","now","Date","options","hour12","hour","minute","timeZone","toLocaleString","formatTimeStamps","timestamps","prod_environment","USERS_API","BASE_URL","AGENTS_API","API_KEY","SocketUrl","dev_environment","ConversationService","storageKey","userSepecificNotification","Subject","generateKey","Math","floor","getTime","toString","replace","random","getKey","botId","resetKey","localStorage","getItem","setItem","sendValidatedUserData","message","getUserSpecificNotification","asObservable","Injectable","args","providedIn","NotificationSocket","_this","_super","socketConfig","on","console","log","warn","err","Socket","url","transports","reconnection","autoConnect","upgrade","reconnectionDelay","reconnectionDelayMax","reconnectionAttempts","Infinity","SocketService","conversationService","notificationSocket","isCommonSocketInitialized","isUserSpecificSocketInitialized","isUserSpecificEventReleased","messageQueue","releaseInterval","intervalSetup","startReleasingMessages","isSocketInitialized","isCommon","disconnectSocketConnection","disconnect","connectSocketConnection","connect","registerUserSpecificHiveSocket","conversation_id","org_id","groupId","groupId_org","emit","fromEvent","subscribe","res","setInterval","shift","BotsService","http","eventDescription","bot_api","fetchSpeechAuthorizationToken","apiKey","headers","HttpHeaders","Content-Type","x-api-key","hive-bot-id","get","pipe","map","resp","token","getWorkflowsByOrgId","orgId","getWorkflowExecutionById","executionId","apiUrl","HttpClient","ChatDrawerComponent","fb","botService","cdr","sanitizer","elementRef","renderer","socketService","bodyOverflowClass","isCollapsedTrue","copilotName","feedbackEvent","EventEmitter","onCloseEvent","openPage","sessionActions","closeBot","connectWithUser","scheduleMeeting","refreshToken","autogenKey","addToMyAgendaAction","myUpcomingSessionAction","connectOrFollowAction","aiResponse","chatLog","decoder","TextDecoder","feedbackDone","greetingMsg","hasBackdropValue","input","listenerAdded","loading","mode","quickPrompts","thumbsDownMsgIndex","userName","showStartAgain","isIOSDevice","showFeedBackIconsIndex","temperature","speakers","currentWorkflowActionProgress","currentWorkflowAction","recognizedText","authorizationToken","region","isChatingWithAi","readAllChunks","stream","reader","getReader","allSuggestions","closed","catch","scrollToBottom","ReadableStream","start","controller","pump","currentMessageForEditor","currentIndexForEditor","isDropdownOpen","selectedAgents","allSelected","isDocInEditMode","isContentLoaded","isCollapsed","isCollapsedForGraph","isCollapsedForFGraph","dateTime","toISOString","currentSourcesList","isShowEditorButton","isDrawerOpen","chatMain","ElementRef","ngOnChanges","changes","s27Token","currentValue","previousValue","isFetchDataFor","msg","chat","is401","fetchDataFor","fetchData","initializeSocket","ngOnInit","environment","isDev","changeTemperature","fetchBotConfig","markForCheck","fetchChatHistory","response","mapChatHistory","initializeSpeechRecognizer","setTimeout","listenSockets","eventSubscription","unsubscribe","_b","_a","OtherFields","workflow_id","_g","_c","percentage","output","action_name","current_action_name_1","current_action_name","workflow_execution_id","time_stamp","actionIndex","workflowExecutionDetails","Actions","findIndex","a","Name","currentWorkflowExecutionDetails","executingWorkflow","detectChanges","_d","_h","_e","message_id_1","bot_id","message_id","answer","web_results","search_results","graphs","execution_graphs","suggestions","_f","currentChatMessage","find","_id","type","time","isArray","searchTerms","sourcesList","displayedSources","slice","remainingSources","processMessageForDisplay","executionGraphs","relatedListItems","initializeSocketAndListen","handleEvent","data","ngOnDestroy","newTemperature","wrapper","document","querySelector","classList","remove","add","onStartAgain","archieveMessages","userId","post","switchMap","of","catchError","botName","botIcon","Icon","botSkills","Skills","Greeting","thumbsDownMessages","NegativeResponses","QuickPrompts","conversationKey","accept","handleError","operation","result","chats","Messages","forEach","Type","Text","InsertTimestamp","copied","WorkflowExecutionId","WebLinks","ExecutionGraphs","Graphs","SearchTerms","processMessage","trim","markdownLinkRegex","urlRegex","test","html","sanitizeHtml","match","hashes","text","level","ngAfterViewChecked","nativeElement","querySelectorAll","link","addEventListener","onFeedbackClick","bind","bypassSecurityTrustHtml","onClose","removeClass","body","sendMessageWithTile","prompt","textarea","myInput","style","height","makeAskRequest","agents","inputMsg","fetchSmallTalk","smallTalk","isFeedbackMsg","read","then","lastItem","pop","close","decodedChunk","decode","suggestionsMatch","aiFormattedData","JSON","parse","section_id","fetchMyConnections","fetchPendingRequests","speakerIds","content","session","getSpeakersByStaffIds","sectionId","sessionIds","usersLen","search","connetUserIds","is_open_page","isMobileBrowser","action","addCloseBotClickEvent","enqueue","submitFeedback","flag","fetch","method","stringify","messageId","isHelpful","thumbsUpMessage","handleKeydown","event","key","shiftKey","preventDefault","handleSubmit","handleUpClick","idx","liked","unliked","handleDownClick","copyText","id","index","textElement","getElementById","tempTextArea","createElement","innerText","appendChild","select","execCommand","removeChild","handleCopyClick","sanitizeHTML","doc","DOMParser","parseFromString","fragment","createDocumentFragment","from","childNodes","node","cloneNode","simplifiedDiv","script","innerHTML","handleEditorClick","isEditor","editorsDrawer","open","button","display","counter","interval","scrollTop","scrollHeight","clearInterval","handleAction","info","ngAfterViewInit","drawer","opened","setBodyOverflow","openedChange","removeBodyOverflow","myTextarea","focus","addClass","ids","eventId","Authorization","ok","json","Error","speaker","performSessionAction","sessionId","element","listen","navigator","userAgent","connectToUser","canDisconnect","scheduleMeetingWithUser","user","canConnect","pendingRequests","myConnections","conn","toggleDropdown","fetchAgents","onSelectAll","agent","selected","onAgentChange","agentFound","filter","areAllSelected","every","getDropdownHeaderText","fetchAgents_http","assign","fetchContent_http","conversationId","documentContent","status","fetchEditorContent","markdown","marked.parse","prepareHtml","lang","code","escapedCode","escapeHtml","copyToClipboard","clipboard","writeText","alert","toggleCollapse","toggleCollapseGraph","toggleCollapseFGraph","getDomainName","URL","hostname","getFaviconUrl","onCardClick","sources","sourcesDrawer","openOuterEditor","onCloseEditor","onDrawerClosed","onCloseSource","toggleDrawer","todo","updateButtonVisibility","openLinkInNewTab","window","adjustTextareaHeight","target","overflowY","toggleWorkflows","checkForCop29BotId","orgWorkflows","isWorkflowOpen","selectedWorkflow","openWorkflowInput","initializeForm","formControls","Trigger","InputSchema","InputId","Value","Required","Validators","required","workflowForm","group","onWorkflowSelected","workflow","onWorkflowSubmit","valid","generateMarkdown","showWorkflowExecutionLoader","Inputs","workflowInputs","WorkflowName","workflowId","workflow_inputs","user_question","user_id","title","obj","key_label","this_1","Label","entries","_j","_k","showWorkflowHistoryDetails","showWorkflowExecutionDetails","InsertTimeStamp","closeModal","objectToArray","keys","startNewConversation","speechConfig","SpeechSDK.SpeechConfig","fromAuthorizationToken","audioConfig","SpeechSDK.AudioConfig","fromDefaultMicrophoneInput","recognizer","SpeechSDK.SpeechRecognizer","recognizing","reason","SpeechSDK.ResultReason","RecognizingSpeech","recognized","RecognizedSpeech","toggleRecording","canceled","errorDetails","sessionStopped","stopContinuousRecognitionAsync","isRecording","startRecognition","stopRecognition","startContinuousRecognitionAsync","getLatestTime","toLocaleTimeString","Component","selector","template","changeDetection","ChangeDetectionStrategy","OnPush","FormBuilder","ChangeDetectorRef","DomSanitizer","Renderer2","ViewChild","ViewChildren","static","Input","Output","ChatBotComponent","visible","toggle","SafeHtmlPipe","transform","Pipe","name","VideoPlayerComponent","el","isMuted","isFullscreen","isFullscreenvideoPlaying","toggleSound","video","muted","togglePlay","playState","videoEl","videoObj","isPlaying","play","pause","innerWidth","observer","IntersectionObserver","isIntersecting","threshold","observe","toggleFullscreen","fullscreenvideo","toggleFullscreenPlay","followUser","checkPendingSentRequest","myPendingSentRequests","canUnfollowUser","canFollowUser","getIniNames","firstName","lastName","charAt","toUpperCase","Inject","DOCUMENT","BotHtmlEditorComponent","documentName","quillConfig","toolbar","header","font","list","filldataInForm","editorContent","saveContent","saveContent_http","updateContent_http","put","NgModule","declarations","imports","CommonModule","MatIconModule","MatSidenavModule","FormsModule","QuillModule","exports"],"mappings":"4nCAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOC,OAAOK,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,MAC3EN,EAAGC,aAGZS,EAAUV,EAAGC,GACzB,GAAiB,mBAANA,GAA0B,OAANA,EAC3B,MAAM,IAAIU,UAAU,uBAAyBC,OAAOX,GAAK,iCAE7D,SAASY,IAAOC,KAAKC,YAAcf,EADnCD,EAAcC,EAAGC,GAEjBD,EAAEO,UAAkB,OAANN,EAAaC,OAAOc,OAAOf,IAAMY,EAAGN,UAAYN,EAAEM,UAAW,IAAIM,GA4HtDX,OAAOc,gBAgBpBC,EAASC,GACrB,IAAIC,EAAsB,mBAAXC,QAAyBA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AKjO,EAAKqN,EAAM,CAAE3K,QAAOA,IAAIM,KAC5CkL,EAAAA,WAAU,SAACjM,GAMT,OAFA1C,EAAKsE,IAAI4F,eAEF0E,EAAAA,GAAGlM,MAEZmM,EAAAA,YAAW,SAACpS,GAGV,OAFA2D,QAAQ3D,MAAM,kCAAmCA,GAE1CmS,EAAAA,GAAG,WAKhBqW,EAAAnqB,UAAA8qB,mBAAA,WAAA,IAAA5lB,EAAA3E,KACE+E,QAAQC,IAAI,qBAEZ,IAAMI,EAASpF,KAAKyO,YAAY3L,WAAU,gDAAgD9C,KAAKuf,eAAc,UAAUvf,KAAK8D,MACtHgE,EAAU,IAAIC,EAAAA,YAAY,CAC9BC,eAAgB,mBAChBH,OAAQ,6BAGN4K,EAAO,CACT8U,KAAMvnB,KAAK6pB,aACXzR,QAASpY,KAAKoqB,eAGhB,OAAOpqB,KAAKyH,KAAK+iB,IAAIplB,EAAKqN,EAAM,CAAE3K,QAAOA,IAAIM,KAC3CkL,EAAAA,WAAU,SAACjM,GAMT,OAFA1C,EAAKsE,IAAI4F,eAEF0E,EAAAA,GAAGlM,MAEZmM,EAAAA,YAAW,SAACpS,GAGV,OAFA2D,QAAQ3D,MAAM,kCAAmCA,GAE1CmS,EAAAA,GAAG,oCArHjB2S,EAAAA,UAAS1hB,KAAA,CAAC,CACT2hB,SAAU,sBACVC,SAAA,4hBA7BAK,EAAAA,yBAHO5d,EAAAA,qDAoCNke,EAAAA,+BACAA,EAAAA,+BACAA,EAAAA,8BACAA,EAAAA,qBACAA,EAAAA,eCvBH,iCALC0D,EAAAA,SAAQjmB,KAAA,CAAC,CACRkmB,aAAc,CAACzD,EAAkBne,EAAqB0e,EAAsBJ,EAAcwC,GAC1Fe,QAAS,CAACC,EAAAA,aAAcC,EAAAA,cAAeC,EAAAA,iBAAkBC,EAAAA,YAAaC,EAAAA,aACtEC,QAAS,CAAChE,EAAkBne,EAAqB0e","sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","const formatHoursAndMinutes = (date: Date) => {\r\n let hours = date.getHours() % 12;\r\n const minutes = date.getMinutes();\r\n const amPm = date.getHours() < 12 ? 'AM' : 'PM';\r\n if(hours === 0) hours = 12;\r\n\r\n const formattedHours = hours < 10 ? `0${hours}` : hours;\r\n const formattedMinutes = minutes < 10 ? `0${minutes}` : minutes;\r\n\r\n return `${formattedHours}:${formattedMinutes} ${amPm}`;\r\n};\r\n\r\nexport const formatNow = (timezone?: string) => {\r\n const now = new Date();\r\n if (timezone) {\r\n const options: any = {\r\n hour12: true,\r\n hour: 'numeric',\r\n minute: 'numeric',\r\n timeZone: timezone,\r\n };\r\n return now.toLocaleString('en-US', options);\r\n }\r\n return formatHoursAndMinutes(now);\r\n};\r\n\r\nexport const formatTimeStamps = (timezone: string, timestamps: any) => {\r\n const date = new Date(timestamps + 'Z');\r\n\r\n const options: any = {\r\n hour12: true,\r\n hour: 'numeric',\r\n minute: 'numeric',\r\n timeZone: timezone,\r\n };\r\n return date.toLocaleString('en-US', options);\r\n};\r\n","\r\n\r\nexport const prod_environment = {\r\n USERS_API: 'https://es-user.social27.com/api',\r\n BASE_URL: 'https://agent-api.hivegpt.ai',\r\n AGENTS_API: 'https://hive-ai.social27.com/api',\r\n API_KEY: 'b621eb3f-0bd2-41d5-a48c-a8f8ab7d38f8',\r\n SocketUrl: 'https://notif-v2-ws.social27.com/'\r\n}\r\n\r\nexport const dev_environment = {\r\n USERS_API: 'https://pre-user.social27.com/api',\r\n BASE_URL: 'https://agent-api.hivegpt.ai',\r\n AGENTS_API: 'https://hive-ai.social27.com/api',\r\n API_KEY: 'b621eb3f-0bd2-41d5-a48c-a8f8ab7d38f8',\r\n SocketUrl: 'https://notif-v2-ws.social27.com/'\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { Observable, Subject } from 'rxjs';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class ConversationService {\r\n private storageKey = 'conversationKey';\r\n\r\n constructor() { }\r\n generateKey(): string {\r\n const timestamp = Math.floor(new Date().getTime() / 1000).toString(16);\r\n const randomHex = 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, () => {\r\n return Math.floor(Math.random() * 16).toString(16);\r\n });\r\n return timestamp + randomHex;\r\n }\r\n\r\n getKey(botId: string, resetKey: boolean = false): string {\r\n const storageKey = `conversationKey_${botId}`;\r\n var value = localStorage.getItem(storageKey);\r\n\r\n if (!value || resetKey) {\r\n value = this.generateKey();\r\n localStorage.setItem(storageKey, value);\r\n }\r\n\r\n return value;\r\n }\r\n\r\n private userSepecificNotification: Subject<any> = new Subject<any>();\r\n sendValidatedUserData(message: any) {\r\n //console.log('lgging messages', message, new Date());\\\r\n\r\n this.userSepecificNotification.next(message);\r\n }\r\n getUserSpecificNotification(): Observable<any> {\r\n return this.userSepecificNotification.asObservable();\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { Socket, SocketIoConfig } from 'ngx-socket-io';\r\nimport { prod_environment } from '../../environments/environment';\r\n\r\n@Injectable({\r\n providedIn: 'root' // This ensures the service is available across the application\r\n})\r\nexport class NotificationSocket extends Socket {\r\n constructor() {\r\n super(socketConfig);\r\n\r\n // Log connection status\r\n this.on('connect', () => {\r\n console.log('Socket connected');\r\n });\r\n\r\n this.on('disconnect', () => {\r\n console.warn('Socket disconnected');\r\n });\r\n\r\n this.on('connect_error', (err) => {\r\n console.error('Socket connection error:', err);\r\n });\r\n }\r\n}\r\n\r\nconst socketConfig: SocketIoConfig = {\r\n url: prod_environment.SocketUrl,\r\n options: {\r\n transports: ['websocket', 'polling'],\r\n reconnection: true,\r\n autoConnect: true,\r\n upgrade: true,\r\n reconnectionDelay: 1000,\r\n reconnectionDelayMax: 5000,\r\n reconnectionAttempts: Infinity\r\n }\r\n};","import { Injectable } from '@angular/core';\r\n\r\nimport { Observable, Subject } from 'rxjs';\r\nimport { webSocket, WebSocketSubject } from 'rxjs/webSocket';\r\nimport { ConversationService } from './conversation.service';\r\nimport { NotificationSocket } from './NotificationSocket';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class SocketService {\r\n public testMessage: string;\r\n private isCommonSocketInitialized = false;\r\n private isUserSpecificSocketInitialized = false;\r\n private isUserSpecificEventReleased = true;\r\n private messageQueue: any[] = [];\r\n private releaseInterval = 1000;\r\n private intervalSetup: boolean = false;\r\n\r\n constructor(\r\n private conversationService: ConversationService,\r\n private notificationSocket: NotificationSocket\r\n ) {\r\n this.startReleasingMessages();\r\n }\r\n\r\n isSocketInitialized(isCommon: boolean) {\r\n return isCommon\r\n ? this.isCommonSocketInitialized\r\n : this.isUserSpecificSocketInitialized &&\r\n !this.isUserSpecificEventReleased;\r\n }\r\n\r\n disconnectSocketConnection() {\r\n this.notificationSocket.disconnect();\r\n }\r\n connectSocketConnection() {\r\n this.notificationSocket.connect();\r\n }\r\n registerUserSpecificHiveSocket(botId: string, conversation_id: string, org_id: string) {\r\n const commonNotification = 'commonNotification';\r\n const groupId = `Hive_AI_Notifs_${botId}_${conversation_id}`;\r\n const groupId_org = `Hive_AI_Notifs_${org_id}`;\r\n\r\n // Remove any pre-existing listeners for commonNotification\r\n // this.notificationSocket.removeAllListeners(commonNotification);\r\n\r\n // Join the group again with updated botId and conversation_id\r\n this.notificationSocket.emit('joinData', { groupId });\r\n this.notificationSocket.emit('joinData', { groupId: groupId_org });\r\n\r\n // Re-register for common notifications\r\n this.notificationSocket.fromEvent(commonNotification).subscribe(\r\n (res) => {\r\n console.log('Received commonNotification:', res);\r\n this.conversationService.sendValidatedUserData(res);\r\n },\r\n (error) => {\r\n console.error('Error receiving commonNotification:', error);\r\n }\r\n );\r\n }\r\n\r\n private startReleasingMessages() {\r\n if (!this.intervalSetup) {\r\n setInterval(() => {\r\n if (this.messageQueue.length > 0) {\r\n const message = this.messageQueue.shift(); // Remove the first message from the queue\r\n // Handle the message here, e.g., send it to the server or process it\r\n console.log('Releasing message from queue:', message);\r\n // this.campaignService.sendValidatedUserData(message);\r\n }\r\n }, this.releaseInterval);\r\n this.intervalSetup = true; // Prevents multiple intervals\r\n }\r\n }\r\n}\r\n","import { HttpClient, HttpParams } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { catchError, map } from 'rxjs/operators';\r\n\r\nimport { HttpHeaders } from '@angular/common/http';\r\nimport { Observable, Subject, throwError } from 'rxjs';\r\nimport { AnyRecord } from 'dns';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class BotsService {\r\n eventDescription = new Subject();\r\n bot_api = 'https://agent-api.hivegpt.ai/';\r\n constructor(private http: HttpClient) { }\r\n\r\n fetchSpeechAuthorizationToken(botId, apiKey) {\r\n const headers = new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n 'x-api-key': apiKey,\r\n 'hive-bot-id': botId\r\n });\r\n\r\n const apiUrl = `${this.bot_api}speech/issue_token`;\r\n const url = `${apiUrl}`;\r\n return this.http.get(url, {headers}).pipe(\r\n map((resp: any) => {\r\n return resp.token;\r\n })\r\n );\r\n }\r\n\r\n getWorkflowsByOrgId(orgId: string): Observable<any> {\r\n const apiUrl = `${this.bot_api}workflows`;\r\n const url = `${apiUrl}?org_id=${orgId}`;\r\n return this.http.get(url).pipe(\r\n map((resp: any) => {\r\n return resp;\r\n })\r\n );\r\n }\r\n\r\n getWorkflowExecutionById(executionId: string): Observable<any> {\r\n const apiUrl = `${this.bot_api}workflows/execution/${executionId}`;\r\n return this.http.get(apiUrl).pipe(\r\n map((resp: any) => {\r\n return resp;\r\n })\r\n );\r\n }\r\n}","// import { Platform } from '@angular/cdk/platform';\r\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport {\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n HostListener,\r\n Input,\r\n OnChanges,\r\n OnInit,\r\n Output,\r\n QueryList,\r\n Renderer2,\r\n SimpleChanges,\r\n ViewChild,\r\n ViewChildren,\r\n} from '@angular/core';\r\nimport { MatDrawer } from '@angular/material/sidenav';\r\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\r\nimport { of, Subscription } from 'rxjs';\r\nimport { catchError, switchMap } from 'rxjs/operators';\r\nimport { formatNow, formatTimeStamps } from '../../utils/utils';\r\nimport {\r\n dev_environment,\r\n prod_environment,\r\n} from '../../../environments/environment';\r\nimport { ConversationService } from '../conversation.service';\r\nimport { Observable } from 'rxjs';\r\nimport { SocketService } from '../socket-service.service';\r\n\r\nimport { FormBuilder, Validators } from '@angular/forms';\r\nimport * as SpeechSDK from 'microsoft-cognitiveservices-speech-sdk';\r\nimport { BotsService } from '../bot.service';\r\nimport * as marked from 'marked'; // Import marked\r\n\r\n@Component({\r\n selector: 'hivegpt-chat-drawer-package',\r\n templateUrl: './chat-drawer.component.html',\r\n styleUrls: ['./chat-drawer.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class ChatDrawerComponent implements OnInit, OnChanges {\r\n @ViewChild('chatMain') private chatMain: ElementRef;\r\n @ViewChild('myInput') private myInput: ElementRef;\r\n @ViewChildren('closeplaygroundbutton')\r\n closePlaygroundButtons: QueryList<ElementRef>;\r\n @ViewChild('drawer') drawer!: MatDrawer;\r\n @ViewChild('sourcesDrawer') sourcesDrawer!: MatDrawer;\r\n @ViewChild('editorsDrawer') editorsDrawer!: MatDrawer;\r\n private bodyOverflowClass = 'body-overflow-hidden';\r\n @ViewChild('myTextarea', { static: false })\r\n myTextarea!: ElementRef<HTMLTextAreaElement>; // Reference to the textarea\r\n isCollapsedTrue = false;\r\n @Input() copilotName: string = 'HiveXGPT';\r\n @Input() firstName!: string;\r\n @Input() lastName!: string;\r\n @Input() apiKey!: string;\r\n @Input() bgBubbleAi!: string;\r\n @Input() bgBubbleUser!: string;\r\n @Input() bgGradient!: string[];\r\n @Input() botName!: string;\r\n @Input() botSkills!: string;\r\n @Input() botId!: string;\r\n @Input() orgId!: string;\r\n @Input() closeButtonColor!: string;\r\n @Input() closeButtonbgColor!: string;\r\n @Input() credentials!: [];\r\n @Input() dateTimeColor!: string;\r\n @Input() dateTextColor!: string;\r\n @Input() eventId!: string;\r\n @Input() s27Token!: string;\r\n @Input() eventName!: string;\r\n @Input() botIcon!: string;\r\n @Input() formFieldBgColor!: string;\r\n @Input() formFieldTextColor!: string;\r\n @Input() fullView!: boolean;\r\n @Input() gradientColors!: string[];\r\n @Input() greeting!: string;\r\n @Input() messageTextColorAi!: string;\r\n @Input() messageTextColorUser!: string;\r\n @Input() rules!: string;\r\n @Input() sendButtonColor!: string;\r\n @Input() sendButtonTextColor!: string;\r\n @Input() showClose!: boolean;\r\n @Input() thumbsDownMessages!: string[];\r\n @Input() thumbsUpMessage!: string;\r\n @Input() timezone!: string;\r\n @Input() unknownResponses!: [];\r\n @Input() useOpenAi!: boolean;\r\n @Input() userId!: string;\r\n @Input() isDev!: boolean;\r\n\r\n @Input() againButtonColor!: string[];\r\n @Input() againButtonTextColor!: string[];\r\n @Output() feedbackEvent = new EventEmitter<string>();\r\n @Output() onCloseEvent = new EventEmitter<void>();\r\n @Output() openPage = new EventEmitter<any>();\r\n @Output() sessionActions = new EventEmitter<any>();\r\n @Output() closeBot = new EventEmitter<any>();\r\n @Output() connectWithUser = new EventEmitter<any>();\r\n @Output() scheduleMeeting = new EventEmitter<string>();\r\n @Output() refreshToken = new EventEmitter<any>();\r\n\r\n autogenKey = 'Autogen_eDJTtEU-NB0RtIpzq1w';\r\n addToMyAgendaAction = 'add_to_my_agenda';\r\n myUpcomingSessionAction = 'my_upcomming_session';\r\n connectOrFollowAction = 'connect_or_follow';\r\n aiResponse: string = '';\r\n chatLog: any[] = [];\r\n decoder = new TextDecoder();\r\n feedbackDone: boolean = false;\r\n greetingMsg: string = '';\r\n hasBackdropValue: boolean = false;\r\n input: string = '';\r\n listenerAdded = false;\r\n loading: boolean = false;\r\n mode: string = 'over';\r\n quickPrompts: any[] = [];\r\n thumbsDownMsgIndex = 0;\r\n userName: string = '';\r\n showStartAgain: boolean = false;\r\n isIOSDevice: boolean = false;\r\n showFeedBackIconsIndex: number | null = null;\r\n temperature: number = 1;\r\n speakers = [];\r\n environment: {\r\n USERS_API;\r\n BASE_URL;\r\n AGENTS_API;\r\n };\r\n pendingRequests: any;\r\n myConnections: any;\r\n conversationKey: string;\r\n isFetchDataFor: boolean;\r\n is401: boolean;\r\n msg: any;\r\n chat: any;\r\n isWorkflowOpen: boolean;\r\n orgWorkflows: any;\r\n openWorkflowInput: boolean;\r\n selectedWorkflow: any;\r\n workflowForm: any;\r\n currentWorkflowActionProgress: number = 0;\r\n currentWorkflowAction: string = '';\r\n executingWorkflow: boolean;\r\n workflowExecutionDetails: any;\r\n showWorkflowExecutionDetails: any;\r\n currentWorkflowExecutionDetails: any;\r\n\r\n speechConfig: SpeechSDK.SpeechConfig;\r\n recognizer: SpeechSDK.SpeechRecognizer;\r\n recognizedText: string = '';\r\n authorizationToken: string = '';\r\n region: string = 'westeurope'; // Set your Azure region here\r\n isRecording: boolean;\r\n\r\n constructor(\r\n private fb: FormBuilder,\r\n private botService: BotsService,\r\n private cdr: ChangeDetectorRef,\r\n private http: HttpClient,\r\n private sanitizer: DomSanitizer,\r\n private elementRef: ElementRef,\r\n private renderer: Renderer2,\r\n private socketService: SocketService,\r\n private conversationService: ConversationService // private platform: Platform\r\n ) {\r\n this.chatMain = new ElementRef(null);\r\n\r\n // if (this.platform.IOS) {\r\n // this.isIOSDevice = true;\r\n // }\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (changes.s27Token) {\r\n if (changes.s27Token.currentValue != changes.s27Token.previousValue) {\r\n this.s27Token = changes.s27Token.currentValue;\r\n\r\n console.log('isFetchDataFor: ', this.isFetchDataFor);\r\n console.log('msg: ', this.msg);\r\n console.log('chat: ', this.chat);\r\n if (this.is401) {\r\n if (this.isFetchDataFor) {\r\n this.fetchDataFor(this.msg, this.chat);\r\n } else {\r\n this.fetchData(this.msg);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (changes.orgId) {\r\n if (\r\n changes.orgId.currentValue != changes.orgId.previousValue &&\r\n changes.orgId.currentValue\r\n ) {\r\n this.initializeSocket();\r\n\r\n }\r\n }\r\n }\r\n\r\n ngOnInit(): void {\r\n this.environment = this.isDev ? dev_environment : prod_environment;\r\n\r\n // this.fetchMyConnections().subscribe();\r\n // this.fetchPendingRequests().subscribe();\r\n\r\n this.changeTemperature(this.temperature);\r\n this.fetchBotConfig().subscribe(\r\n (res) => {\r\n this.cdr.markForCheck();\r\n\r\n this.fetchChatHistory().subscribe(\r\n (response) => {\r\n this.loading = false;\r\n this.mapChatHistory(response);\r\n this.cdr.markForCheck();\r\n },\r\n (err) => {\r\n console.error('Error fetching chat history:', err);\r\n }\r\n );\r\n },\r\n (err) => {\r\n console.error('Error fetching chat history:', err);\r\n }\r\n );\r\n // this.fetchAgents();\r\n // this.fetchEditorContent();\r\n this.cdr.markForCheck();\r\n // this.initializeSocket();\r\n this.botService.fetchSpeechAuthorizationToken(this.botId, this.apiKey).subscribe((token) => {\r\n this.authorizationToken = token;\r\n this.initializeSpeechRecognizer(token);\r\n });\r\n }\r\n\r\n private eventSubscription: Subscription;\r\n initializeSocket() {\r\n try {\r\n this.socketService.disconnectSocketConnection();\r\n } catch (error) { }\r\n setTimeout(() => {\r\n this.socketService.connectSocketConnection();\r\n setTimeout(() => {\r\n console.log('YES INIT');\r\n const conversation_id = this.conversationService.getKey(this.botId);\r\n\r\n this.socketService.registerUserSpecificHiveSocket(\r\n this.botId,\r\n conversation_id,\r\n this.orgId\r\n );\r\n setTimeout(() => {\r\n this.listenSockets();\r\n }, 300);\r\n }, 200);\r\n }, 300);\r\n }\r\n\r\n subscriptionNew: any;\r\n socketData: any;\r\n\r\n listenSockets() {\r\n if (this.eventSubscription) {\r\n this.eventSubscription.unsubscribe();\r\n }\r\n console.log('Listen Socket');\r\n this.eventSubscription = this.conversationService\r\n .getUserSpecificNotification()\r\n .subscribe(\r\n (res) => {\r\n console.log('Listen Socket response');\r\n console.log(res);\r\n // Check if OtherFields exists in the response\r\n if (res?.m?.OtherFields?.workflow_id) {\r\n const {\r\n percentage,\r\n output,\r\n action_name,\r\n current_action_name,\r\n workflow_execution_id,\r\n time_stamp,\r\n } = res?.m?.OtherFields;\r\n\r\n this.currentWorkflowActionProgress = percentage;\r\n this.currentWorkflowAction = action_name;\r\n\r\n const actionIndex = this.workflowExecutionDetails.Actions.findIndex(\r\n (a) => a.Name == current_action_name\r\n );\r\n\r\n if (actionIndex !== -1) {\r\n this.workflowExecutionDetails.Actions[actionIndex][\r\n 'Output'\r\n ] = output;\r\n this.workflowExecutionDetails.Actions[actionIndex][\r\n 'InsertTimeStamp'\r\n ] = formatTimeStamps(this.timezone, time_stamp);\r\n } else {\r\n console.error(`Action with name ${action_name} not found`);\r\n }\r\n\r\n this.currentWorkflowExecutionDetails = this.workflowExecutionDetails;\r\n\r\n if (this.currentWorkflowActionProgress == 100) {\r\n this.chatLog[this.chatLog.length - 1][\r\n 'WorkflowExecutionId'\r\n ] = workflow_execution_id;\r\n this.isChatingWithAi = false;\r\n this.executingWorkflow = false;\r\n }\r\n\r\n this.cdr.detectChanges();\r\n } else if (res?.m?.OtherFields) {\r\n const {\r\n conversation_id,\r\n bot_id,\r\n message_id,\r\n answer,\r\n web_results,\r\n search_results,\r\n graphs,\r\n execution_graphs,\r\n suggestions,\r\n } = res?.m?.OtherFields;\r\n console.log('message_id1');\r\n console.log(res?.m?.OtherFields);\r\n var currentChatMessage = this.chatLog.find(\r\n (p) => p._id == message_id\r\n );\r\n console.log(this.chatLog);\r\n if (!currentChatMessage) {\r\n console.log('message_id2');\r\n console.log(message_id);\r\n currentChatMessage = {\r\n _id: message_id,\r\n type: 'ai',\r\n time: formatNow(this.timezone),\r\n };\r\n\r\n this.chatLog.push(currentChatMessage);\r\n\r\n this.showFeedBackIconsIndex = this.chatLog.length - 1;\r\n console.log('message_id3');\r\n console.log(message_id);\r\n this.cdr.detectChanges();\r\n }\r\n\r\n // Handle the fields based on their presence\r\n if (search_results && Array.isArray(search_results)) {\r\n console.log('Online Search Terms:', search_results);\r\n currentChatMessage.searchTerms = search_results;\r\n this.cdr.detectChanges();\r\n }\r\n\r\n if (web_results && Array.isArray(web_results)) {\r\n console.log('Web Results:', web_results);\r\n currentChatMessage.sourcesList = web_results;\r\n currentChatMessage.displayedSources = web_results?.slice(0, 3); // First 3 cards\r\n currentChatMessage.remainingSources = web_results?.slice(3); // Remaining items\r\n this.cdr.detectChanges();\r\n }\r\n\r\n if (answer) {\r\n this.isChatingWithAi = false;\r\n console.log('Answer:', answer);\r\n\r\n currentChatMessage.message = this.processMessageForDisplay(\r\n answer\r\n );\r\n this.cdr.detectChanges();\r\n this.scrollToBottom();\r\n }\r\n\r\n if (graphs && Array.isArray(graphs)) {\r\n console.log('Graphs:', graphs);\r\n currentChatMessage.graphs = graphs;\r\n this.cdr.detectChanges();\r\n }\r\n\r\n if (execution_graphs && Array.isArray(execution_graphs)) {\r\n console.log('Execution Graphs:', execution_graphs);\r\n currentChatMessage.executionGraphs = execution_graphs;\r\n this.cdr.detectChanges();\r\n }\r\n\r\n if (suggestions && Array.isArray(suggestions)) {\r\n console.log('suggestions:', suggestions);\r\n currentChatMessage.relatedListItems = suggestions;\r\n this.cdr.detectChanges();\r\n // Process online search terms as needed\r\n }\r\n\r\n // Add any other fields and their processing here\r\n } else {\r\n console.warn('OtherFields is missing in the response');\r\n }\r\n },\r\n (err) => {\r\n this.eventSubscription.unsubscribe();\r\n console.error('Error in fetching data from socket', err);\r\n }\r\n );\r\n }\r\n\r\n initializeSocketAndListen() { }\r\n handleEvent(data: any, type: string) {\r\n switch (type) {\r\n case 'webresult':\r\n break;\r\n case 'answer':\r\n break;\r\n case 'graph':\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n ngOnDestroy(): void {\r\n if (this.eventSubscription) {\r\n this.eventSubscription.unsubscribe();\r\n }\r\n this.socketService.disconnectSocketConnection();\r\n //this.socketService.close();\r\n }\r\n changeTemperature(newTemperature: number) {\r\n if (this.loading) return;\r\n this.temperature = newTemperature;\r\n const wrapper = document.querySelector('.hivegpt-chat-wrapper');\r\n // Remove existing theme classes from body\r\n wrapper?.classList.remove('creative', 'balanced', 'precise');\r\n\r\n switch (newTemperature) {\r\n case 0:\r\n wrapper?.classList.add('creative');\r\n break;\r\n case 1:\r\n wrapper?.classList.add('balanced');\r\n break;\r\n case 2:\r\n wrapper?.classList.add('precise');\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n onStartAgain() {\r\n if (this.loading) return;\r\n this.showStartAgain = false;\r\n this.chatLog = [];\r\n this.chatLog.push({\r\n type: 'ai',\r\n message: this.greetingMsg,\r\n\r\n time: formatNow(this.timezone),\r\n });\r\n this.archieveMessages().subscribe();\r\n }\r\n\r\n archieveMessages() {\r\n const headers = new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n 'x-api-key': this.apiKey,\r\n 'hive-bot-id': this.botId\r\n });\r\n const url = `${this.environment.BASE_URL}/bot/clear-history/${this.botId}/${this.userId}`;\r\n return this.http.post(url, { headers }).pipe(\r\n switchMap((res: any) => {\r\n return of(res);\r\n }),\r\n catchError((error) => {\r\n return of(null);\r\n })\r\n );\r\n }\r\n\r\n fetchBotConfig() {\r\n this.loading = true;\r\n const headers = new HttpHeaders({\r\n 'x-api-key': this.apiKey,\r\n 'hive-bot-id': this.botId\r\n });\r\n const url = `${this.environment.BASE_URL}/bots?bot_id=${this.botId}`;\r\n return this.http.get(url, { headers }).pipe(\r\n switchMap((res: any) => {\r\n this.botName = res.Name;\r\n this.botIcon = res.Icon;\r\n this.botSkills = res?.Skills;\r\n this.greetingMsg = res.Greeting;\r\n\r\n this.thumbsDownMessages = res?.NegativeResponses?.length\r\n ? res.NegativeResponses\r\n : [\r\n \"We are sorry we've not been able to answer your question.<br/> However, our dedicated support team is happy to help. <span class='feedback-link' style='cursor: pointer; text-decoration: underline; font-weight: 700; color: #17235B;'><a href='mailto:support@social27.com' style='color: inherit; text-decoration: none;'>Please click here</a></span> and a human agent will assist you as soon as possible\",\r\n ];\r\n this.quickPrompts = res.QuickPrompts;\r\n this.cdr.markForCheck();\r\n this.loading = false;\r\n return of(res);\r\n }),\r\n catchError((error) => {\r\n console.error('Error fetching chatbot config: ', error);\r\n this.loading = false;\r\n return of(null);\r\n })\r\n );\r\n }\r\n\r\n fetchChatHistory(): Observable<any> {\r\n this.loading = true;\r\n\r\n this.conversationKey = this.conversationService.getKey(this.botId, false);\r\n const url = `${this.environment.BASE_URL}/conversations/${this.conversationKey}`;\r\n const headers = new HttpHeaders({\r\n accept: 'application/json',\r\n 'x-api-key': this.apiKey,\r\n 'hive-bot-id': this.botId\r\n });\r\n\r\n return this.http\r\n .get(url, { headers })\r\n .pipe(catchError(this.handleError<any>('fetchConversation')));\r\n }\r\n\r\n private handleError<T>(operation = 'operation', result?: T) {\r\n return (error: any): Observable<T> => {\r\n console.error(`${operation} failed: ${error.message}`);\r\n return of(result as T);\r\n };\r\n }\r\n // fetchChatHistory() {\r\n // this.loading = true;\r\n // const headers = new HttpHeaders({\r\n // 'Content-Type': 'application/json',\r\n // 'x-api-key': this.apiKey,\r\n // });\r\n // return this.http\r\n // .get(`${this.environment.BASE_URL}/conversations/${this.conversationKey}`, { headers })\r\n // .pipe(\r\n // switchMap((res: any) => {\r\n // this.loading = false;\r\n // return of(res);\r\n // }),\r\n // catchError((error: any) => {\r\n // console.error('Error fetching chat history: ', error);\r\n // this.loading = false;\r\n // return of(null);\r\n // })\r\n // );\r\n // }\r\n\r\n mapChatHistory(chats: any) {\r\n this.chatLog.push({\r\n type: 'ai',\r\n message: this.greetingMsg,\r\n time: formatNow(this.timezone),\r\n });\r\n if (chats && chats?.Messages?.length) {\r\n chats?.Messages.forEach((chat: any) => {\r\n if (chat.Type == 'user') {\r\n this.chatLog.push({\r\n type: 'user',\r\n message: this.processMessageForDisplay(chat.Text),\r\n time: formatTimeStamps(this.timezone, chat.InsertTimestamp),\r\n copied: false,\r\n isCollapsedTrue: false,\r\n WorkflowExecutionId: chat.WorkflowExecutionId,\r\n _id: chat._id\r\n });\r\n }\r\n if (chat.Type == 'ai') {\r\n var sourcesList = chat.WebLinks || [];\r\n var displayedSources = chat.WebLinks.slice(0, 3); // First 3 cards\r\n var remainingSources = chat.WebLinks.slice(3); // Remaining items\r\n\r\n this.chatLog.push({\r\n type: 'ai',\r\n message: this.processMessageForDisplay(chat.Text),\r\n executionGraphs: chat.ExecutionGraphs,\r\n graphs: chat.Graphs,\r\n searchTerms: chat.SearchTerms,\r\n sourcesList: sourcesList,\r\n displayedSources: displayedSources,\r\n remainingSources: remainingSources,\r\n time: formatTimeStamps(this.timezone, chat.InsertTimestamp),\r\n copied: false,\r\n isCollapsedTrue: false,\r\n _id: chat._id\r\n });\r\n this.showFeedBackIconsIndex = this.chatLog.length - 1;\r\n }\r\n });\r\n this.showStartAgain = true;\r\n }\r\n this.scrollToBottom();\r\n this.cdr.markForCheck();\r\n }\r\n\r\n processMessage(message: string): SafeHtml {\r\n if (!message || !(message?.length > 0)) {\r\n return '';\r\n }\r\n\r\n // console.log('here is my message')\r\n // console.log(message);\r\n\r\n message = message.trim();\r\n\r\n const markdownLinkRegex = /\\[([^[]+)]\\(([^)]+)\\)/g;\r\n const urlRegex = /(?<!href=\")\\bhttps?:\\/\\/\\S+(?<![.,])/gi;\r\n\r\n if (markdownLinkRegex.test(message)) {\r\n const html = message.replace(\r\n markdownLinkRegex,\r\n '<a href=\"$2\" target=\"_blank\">$1</a>'\r\n );\r\n //console.log('Sanitized message: ', message);\r\n return this.sanitizeHtml(html);\r\n }\r\n\r\n if (urlRegex.test(message)) {\r\n const html = message.replace(\r\n urlRegex,\r\n '<a href=\"$&\" target=\"_blank\">$&</a>'\r\n );\r\n // console.log('Sanitized message: ', message);\r\n return this.sanitizeHtml(html);\r\n }\r\n\r\n message = message.replace(/(?:\\r\\n|\\r|\\n)/g, '<br>');\r\n\r\n message = message.replace(/\\*\\*(.*?)\\*\\*/g, '<strong>$1</strong>');\r\n // Convert Markdown headers to HTML headers\r\n message = message.replace(/^(#{1,6})\\s+(.*)$/gm, (match, hashes, text) => {\r\n const level = hashes.length;\r\n return `<h${level}>${text}</h${level}>`;\r\n });\r\n\r\n this.cdr.markForCheck();\r\n const sanitizedMessage = this.sanitizeHtml(message);\r\n return sanitizedMessage;\r\n }\r\n\r\n ngAfterViewChecked() {\r\n const feedbackLinks = this.elementRef.nativeElement.querySelectorAll(\r\n '.feedback-link'\r\n );\r\n feedbackLinks.forEach((link: any) => {\r\n link.addEventListener(\r\n 'click',\r\n this.onFeedbackClick.bind(this, 'zendesk')\r\n );\r\n });\r\n // if (this.elementRef.nativeElement.querySelector('.feedback-link')) {\r\n // this.elementRef.nativeElement\r\n // .querySelector('.feedback-link')\r\n // .addEventListener('click', this.onFeedbackClick.bind(this, 'zendesk'));\r\n // }\r\n }\r\n\r\n sanitizeHtml(html: string): SafeHtml {\r\n return this.sanitizer.bypassSecurityTrustHtml(html);\r\n }\r\n\r\n onFeedbackClick(value: string) {\r\n this.feedbackEvent.emit(value);\r\n }\r\n\r\n onClose() {\r\n this.renderer.removeClass(document.body, this.bodyOverflowClass);\r\n this.onCloseEvent.emit();\r\n }\r\n\r\n sendMessageWithTile(prompt: string) {\r\n this.input = prompt;\r\n this.fetchData();\r\n this.scrollToBottom();\r\n }\r\n isChatingWithAi = false;\r\n fetchData(msg = null) {\r\n this.input = msg || this.input?.trim();\r\n this.msg = this.input;\r\n if (!this.input || this.loading) {\r\n return;\r\n }\r\n\r\n this.chatLog.push({\r\n type: 'user',\r\n message: this.processMessageForDisplay(this.input),\r\n time: formatNow(this.timezone),\r\n copied: false,\r\n isCollapsedTrue: false,\r\n });\r\n\r\n try {\r\n const textarea = this.myInput.nativeElement;\r\n textarea.style.height = 'hidden'; // Reset the height\r\n textarea.style.height = `62px`;\r\n } catch (error) { }\r\n this.cdr.markForCheck();\r\n\r\n this.aiResponse = '';\r\n this.isChatingWithAi = true;\r\n\r\n this.makeAskRequest(this.input, this.agents, this.conversationKey);\r\n }\r\n fetchDataFor(msg, chat) {\r\n const inputMsg = msg?.trim();\r\n if (!inputMsg || this.loading) {\r\n return;\r\n }\r\n try {\r\n chat.relatedListItems = [];\r\n this.cdr.detectChanges();\r\n } catch (error) { }\r\n\r\n this.scrollToBottom();\r\n this.chatLog.push({\r\n type: 'user',\r\n message: this.processMessageForDisplay(inputMsg),\r\n time: formatNow(this.timezone),\r\n copied: false,\r\n isCollapsedTrue: false,\r\n });\r\n\r\n this.cdr.markForCheck();\r\n\r\n this.aiResponse = '';\r\n this.isChatingWithAi = true;\r\n\r\n this.makeAskRequest(inputMsg, this.agents, this.conversationKey, msg, chat);\r\n }\r\n fetchSmallTalk() {\r\n this.loading = true;\r\n this.cdr.markForCheck();\r\n\r\n const url = `${this.environment.BASE_URL}/bot/small-talk/${this.botId}/${this.userId}`;\r\n\r\n this.http\r\n .get<{ smallTalk: string }>(url, {\r\n headers: {\r\n 'x-api-key': this.apiKey,\r\n 'hive-bot-id': this.botId\r\n },\r\n })\r\n .pipe(\r\n catchError((error) => {\r\n console.error('Error while fetching small talk:', error);\r\n\r\n return of(null);\r\n })\r\n )\r\n .subscribe((response) => {\r\n this.loading = false;\r\n this.cdr.markForCheck();\r\n\r\n if (!response) {\r\n return;\r\n }\r\n\r\n if (response && response.smallTalk) {\r\n this.chatLog.push({\r\n type: 'ai',\r\n message: this.processMessage(response.smallTalk),\r\n time: formatNow(this.timezone),\r\n isFeedbackMsg: true,\r\n });\r\n this.showFeedBackIconsIndex = this.chatLog.length - 2;\r\n // this.scrollToBottom();\r\n this.cdr.markForCheck();\r\n }\r\n });\r\n }\r\n\r\n readAllChunks = (stream: any) => {\r\n const reader = stream.getReader();\r\n const allSuggestions: string[] = [];\r\n\r\n reader.closed.catch((err: any) => {\r\n if (err) {\r\n console.error('Error reading stream: ', err);\r\n }\r\n\r\n this.isChatingWithAi = false;\r\n this.scrollToBottom();\r\n return;\r\n });\r\n\r\n return new ReadableStream({\r\n start: (controller) => {\r\n return this.pump(controller, reader, allSuggestions);\r\n },\r\n });\r\n };\r\n\r\n pump(controller: any, reader: any, allSuggestions: string[]) {\r\n reader.read().then(({ done, value }: any) => {\r\n const lastItem = this.chatLog[this.chatLog.length - 1];\r\n\r\n if (done) {\r\n lastItem.message = this.processMessageForDisplay(lastItem.message);\r\n this.chatLog.pop();\r\n this.chatLog.push(lastItem);\r\n if (allSuggestions?.length) {\r\n this.chatLog.push({\r\n type: 'suggestions',\r\n suggestions: allSuggestions,\r\n });\r\n }\r\n\r\n controller.close();\r\n this.isChatingWithAi = false;\r\n // this.scrollToBottom();\r\n this.cdr.markForCheck();\r\n this.showStartAgain = true;\r\n\r\n // setTimeout(() => {\r\n // this.fetchSmallTalk();\r\n // },1000)\r\n return;\r\n }\r\n\r\n let decodedChunk = this.decoder.decode(value, { stream: true });\r\n this.aiResponse += decodedChunk;\r\n if (lastItem.type === 'ai') {\r\n const suggestionsMatch = this.aiResponse.match(/<sug>(.*?)<\\/sug>/g);\r\n if (suggestionsMatch) {\r\n suggestionsMatch.forEach((match) => {\r\n this.aiResponse = this.aiResponse.replace(match, '');\r\n allSuggestions.push(match?.replace(/<\\/?sug>/g, ''));\r\n });\r\n }\r\n\r\n lastItem.message = this.aiResponse;\r\n this.cdr.markForCheck();\r\n } else {\r\n this.isChatingWithAi = false;\r\n\r\n let aiFormattedData: any;\r\n\r\n try {\r\n console.log('parsing json ');\r\n aiFormattedData = JSON.parse(JSON.parse(this.aiResponse));\r\n } catch (e) {\r\n try {\r\n console.log('parsing json 2');\r\n aiFormattedData = JSON.parse(this.aiResponse);\r\n } catch (e) { }\r\n }\r\n\r\n console.log('parsing json done');\r\n\r\n if (aiFormattedData && aiFormattedData?.section_id?.length > 0) {\r\n if (\r\n aiFormattedData.section_id == 'company_search' ||\r\n aiFormattedData.section_id == 'user_search' ||\r\n aiFormattedData.section_id == 'industry_company_search'\r\n ) {\r\n this.fetchMyConnections().subscribe();\r\n this.fetchPendingRequests().subscribe();\r\n }\r\n\r\n if (aiFormattedData.section_id == this.myUpcomingSessionAction) {\r\n var speakerIds = [];\r\n aiFormattedData.content?.forEach((session) => {\r\n speakerIds = [...speakerIds, ...session.speakers];\r\n });\r\n\r\n if (speakerIds?.length > 0) this.getSpeakersByStaffIds(speakerIds);\r\n }\r\n\r\n if (\r\n aiFormattedData.section_id == this.addToMyAgendaAction &&\r\n aiFormattedData.content?.length > 0\r\n ) {\r\n this.openPage.next({\r\n sectionId: aiFormattedData.section_id,\r\n sessionIds: aiFormattedData.content,\r\n });\r\n }\r\n\r\n if (aiFormattedData.section_id == this.connectOrFollowAction) {\r\n let usersLen = aiFormattedData.content?.length;\r\n if (usersLen > 1) {\r\n this.openPage.next({\r\n sectionId: 'open_networking_drawer',\r\n search: aiFormattedData.content,\r\n });\r\n } else if (usersLen == 1) {\r\n this.openPage.next({\r\n sectionId: aiFormattedData.section_id,\r\n connetUserIds: [aiFormattedData.content[0].userId],\r\n });\r\n }\r\n }\r\n\r\n if (aiFormattedData.is_open_page == 'true') {\r\n this.openPage.next({\r\n sectionId: aiFormattedData.section_id,\r\n search: aiFormattedData.content,\r\n });\r\n\r\n if (this.isMobileBrowser()) {\r\n aiFormattedData.message +=\r\n '\\n\\n' + '<a id=\"closeBotNow\">Click Here</a> to see results.';\r\n }\r\n }\r\n\r\n this.chatLog.push({\r\n type: 'ai',\r\n message: aiFormattedData.message,\r\n action: aiFormattedData,\r\n time: formatNow(this.timezone),\r\n });\r\n\r\n if (this.isMobileBrowser()) {\r\n setTimeout(() => {\r\n this.addCloseBotClickEvent();\r\n }, 500);\r\n }\r\n\r\n this.aiResponse = '';\r\n } else {\r\n this.chatLog.push({\r\n type: 'ai',\r\n message: this.aiResponse,\r\n time: formatNow(this.timezone),\r\n });\r\n }\r\n\r\n this.showFeedBackIconsIndex = this.chatLog.length - 1;\r\n this.cdr.markForCheck();\r\n }\r\n\r\n this.scrollToBottom();\r\n\r\n // Enqueue the next data chunk into our target stream\r\n controller.enqueue(value);\r\n this.pump(controller, reader, allSuggestions);\r\n });\r\n }\r\n\r\n submitFeedback(flag: boolean, message) {\r\n console.log(message);\r\n\r\n this.feedbackDone = true;\r\n this.showFeedBackIconsIndex = null;\r\n const conversation_id = this.conversationService.getKey(this.botId);\r\n const url = `${this.environment.AGENTS_API}/Conversation/coPilot/${this.botId}/conversation/${conversation_id}/helpful-response`;\r\n fetch(url, {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'apiKey': 'Conversation_WIz/qAm+EEmfOkFaUA/weA==',\r\n 'hive-bot-id': this.botId\r\n },\r\n body: JSON.stringify({ messageId: message._id, isHelpful: flag }),\r\n }).then(() => {\r\n if (flag) {\r\n this.chatLog.push({\r\n type: 'ai',\r\n message:\r\n this.thumbsUpMessage ||\r\n `Great. May I assist you with anything else?`,\r\n time: formatNow(this.timezone),\r\n isFeedbackMsg: true,\r\n });\r\n\r\n this.scrollToBottom();\r\n this.cdr.markForCheck();\r\n this.feedbackDone = false;\r\n this.showFeedBackIconsIndex = null;\r\n return;\r\n }\r\n\r\n this.chatLog.push({\r\n type: 'ai',\r\n message: this.processMessage(\r\n this.thumbsDownMessages[this.thumbsDownMsgIndex]\r\n ),\r\n time: formatNow(this.timezone),\r\n isFeedbackMsg: true,\r\n });\r\n this.thumbsDownMsgIndex =\r\n (this.thumbsDownMsgIndex + 1) % this.thumbsDownMessages.length;\r\n this.scrollToBottom();\r\n this.cdr.markForCheck();\r\n this.feedbackDone = false;\r\n this.showFeedBackIconsIndex = null;\r\n });\r\n }\r\n handleKeydown(event: KeyboardEvent) {\r\n if (event.key === 'Enter' && !event.shiftKey) {\r\n // Prevent default behavior (new line)\r\n event.preventDefault();\r\n // Call your submit function\r\n this.handleSubmit(event);\r\n }\r\n }\r\n handleSubmit(event) {\r\n this.fetchData();\r\n this.scrollToBottom();\r\n\r\n }\r\n\r\n handleUpClick(idx: any) {\r\n if (this.feedbackDone) {\r\n return;\r\n }\r\n\r\n this.submitFeedback(true, this.chatLog[idx]);\r\n this.chatLog[idx].liked = !this.chatLog[idx].liked;\r\n\r\n if (this.chatLog[idx].unliked) {\r\n this.chatLog[idx].unliked = !this.chatLog[idx].unliked;\r\n }\r\n\r\n this.cdr.markForCheck();\r\n }\r\n\r\n handleDownClick(idx: any) {\r\n if (this.feedbackDone) return;\r\n this.submitFeedback(false, this.chatLog[idx]);\r\n this.chatLog[idx].unliked = !this.chatLog[idx].unliked;\r\n if (this.chatLog[idx].liked)\r\n this.chatLog[idx].liked = !this.chatLog[idx].liked;\r\n }\r\n // handleCopyClick(index: any) {\r\n // // Copy the message to the clipboard\r\n // const contentToCopy = this.chatLog[index].message;\r\n // console.log('contentToCopy');\r\n // console.log(contentToCopy);\r\n // navigator.clipboard.writeText(contentToCopy).then(() => {\r\n // // Indicate that the message was copied\r\n // this.chatLog[index].copied = true;\r\n // this.cdr.detectChanges();\r\n // // Reset the copied state after a delay\r\n // setTimeout(() => {\r\n // this.chatLog[index].copied = false;\r\n // this.cdr.detectChanges();\r\n // }, 2000); // Reset after 2 seconds\r\n // });\r\n // }\r\n copyText(id, index) {\r\n // Get the text element\r\n var textElement = document.getElementById(id);\r\n\r\n // Create a temporary textarea element to copy the text\r\n var tempTextArea = document.createElement('textarea');\r\n tempTextArea.value = textElement.innerText;\r\n\r\n // Append the textarea to the body (necessary for the execCommand to work)\r\n document.body.appendChild(tempTextArea);\r\n\r\n // Select the text inside the textarea\r\n tempTextArea.select();\r\n\r\n // Copy the text to the clipboard\r\n document.execCommand('copy');\r\n\r\n // Remove the temporary textarea\r\n document.body.removeChild(tempTextArea);\r\n\r\n // Optionally, you can alert the user or change the button text to indicate the copy was successful\r\n // alert('Text copied to clipboard!');\r\n\r\n this.chatLog[index].copied = true;\r\n this.cdr.detectChanges();\r\n // Reset the copied state after a delay\r\n setTimeout(() => {\r\n this.chatLog[index].copied = false;\r\n this.cdr.detectChanges();\r\n }, 2000); // Reset after 2 seconds\r\n }\r\n handleCopyClick(index: any) {\r\n // Copy the message to the clipboard\r\n const contentToCopy = this.chatLog[index].message;\r\n const resutlt = this.copyText('messageText_' + index, index);\r\n }\r\n\r\n sanitizeHTML(html: string): string {\r\n const doc = new DOMParser().parseFromString(html, 'text/html');\r\n\r\n // Create a new document fragment to hold the simplified content\r\n const fragment = document.createDocumentFragment();\r\n\r\n // Append the children of the body of the parsed document to the fragment\r\n Array.from(doc.body.childNodes).forEach((node) => {\r\n fragment.appendChild(node.cloneNode(true));\r\n });\r\n\r\n // Create a new div element to hold the simplified HTML\r\n const simplifiedDiv = document.createElement('div');\r\n simplifiedDiv.appendChild(fragment);\r\n\r\n // Remove complex tags or attributes as needed\r\n // Example: remove scripts\r\n simplifiedDiv\r\n .querySelectorAll('script')\r\n .forEach((script) => script.remove());\r\n\r\n // Return the simplified HTML as a string\r\n return simplifiedDiv.innerHTML;\r\n }\r\n\r\n currentMessageForEditor: any = '';\r\n currentIndexForEditor: any = -1;\r\n handleEditorClick(index: any) {\r\n if (this.currentIndexForEditor == -1) {\r\n this.currentIndexForEditor = index;\r\n this.currentMessageForEditor = this.sanitizeHTML(\r\n this.chatLog[index].message\r\n );\r\n this.currentMessageForEditor = this.currentMessageForEditor.replace(\r\n 'SafeValue must use [property]=binding:',\r\n ''\r\n );\r\n\r\n this.cdr.detectChanges();\r\n } else {\r\n if (this.currentIndexForEditor == index) {\r\n this.currentMessageForEditor += this.sanitizeHTML(\r\n this.chatLog[index].message\r\n );\r\n this.currentMessageForEditor = this.currentMessageForEditor.replace(\r\n 'SafeValue must use [property]=binding:',\r\n ''\r\n );\r\n this.cdr.detectChanges();\r\n } else {\r\n this.currentIndexForEditor = index;\r\n this.currentMessageForEditor = this.sanitizeHTML(\r\n this.chatLog[index].message\r\n );\r\n this.currentMessageForEditor = this.currentMessageForEditor.replace(\r\n 'SafeValue must use [property]=binding:',\r\n ''\r\n );\r\n this.cdr.detectChanges();\r\n }\r\n }\r\n this.chatLog[index].isEditor = true;\r\n this.cdr.detectChanges();\r\n // Reset the copied state after a delay\r\n setTimeout(() => {\r\n this.chatLog[index].isEditor = false;\r\n this.cdr.detectChanges();\r\n }, 2000); // Reset after 2 seconds\r\n this.editorsDrawer.open();\r\n const button = document.getElementById('botcloseplaygroundbutton');\r\n if (button) {\r\n button.style.display = 'none';\r\n }\r\n this.cdr.detectChanges();\r\n }\r\n scrollToBottom() {\r\n let counter = 0;\r\n const interval = setInterval(() => {\r\n this.chatMain.nativeElement.scrollTop = this.chatMain.nativeElement.scrollHeight;\r\n if (counter++ > 5) clearInterval(interval);\r\n }, 5);\r\n }\r\n\r\n handleAction(action: any) {\r\n console.info('incoming action from the chatbot AI');\r\n console.info(action);\r\n\r\n if (action?.content) {\r\n }\r\n }\r\n\r\n ngAfterViewInit() {\r\n // Check if the drawer is initially open and apply overflow hidden to body if so\r\n if (this.drawer.opened) {\r\n this.setBodyOverflow();\r\n }\r\n\r\n // Listen to changes in the drawer being opened or closed\r\n this.drawer.openedChange.subscribe((opened: boolean) => {\r\n if (opened) {\r\n this.setBodyOverflow();\r\n } else {\r\n this.removeBodyOverflow();\r\n }\r\n });\r\n\r\n this.drawer.openedChange.subscribe((opened) => {\r\n if (opened) {\r\n setTimeout(() => {\r\n if (this.myTextarea && this.myTextarea.nativeElement) {\r\n this.myTextarea.nativeElement.focus(); // Focus on the textarea\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n private setBodyOverflow() {\r\n this.renderer.addClass(document.body, this.bodyOverflowClass);\r\n }\r\n\r\n private removeBodyOverflow() {\r\n this.renderer.removeClass(document.body, this.bodyOverflowClass);\r\n }\r\n\r\n getSpeakersByStaffIds(ids) {\r\n const url = `${this.environment.USERS_API}/events/${this.eventId}/users/get-by-staff-ids`;\r\n fetch(url, {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n Authorization: 'Bearer ' + 'your_token_here',\r\n },\r\n body: JSON.stringify(ids),\r\n })\r\n .then((response) => {\r\n if (response.ok) {\r\n return response.json(); // Parse the JSON body of the response\r\n } else {\r\n throw new Error('Network response was not ok.');\r\n }\r\n })\r\n .then((data) => {\r\n if (data?.length > 0) {\r\n data.forEach((speaker) => {\r\n this.speakers[speaker.id] = speaker;\r\n });\r\n\r\n this.cdr.markForCheck();\r\n }\r\n })\r\n .catch((err) => {\r\n console.error('Error fetching data:', err);\r\n this.loading = false;\r\n });\r\n }\r\n\r\n performSessionAction(sessionId, action) {\r\n this.sessionActions.next({\r\n sessionId,\r\n action,\r\n });\r\n }\r\n\r\n addCloseBotClickEvent() {\r\n const element = this.elementRef.nativeElement.querySelector('#closeBotNow');\r\n if (element) {\r\n this.renderer.listen(element, 'click', () => {\r\n this.closeBot.next();\r\n });\r\n }\r\n }\r\n\r\n isMobileBrowser() {\r\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\r\n navigator.userAgent\r\n );\r\n }\r\n\r\n connectToUser(userId) {\r\n this.connectWithUser.emit({\r\n connect: !this.canDisconnect(userId),\r\n userId,\r\n });\r\n\r\n setTimeout(() => {\r\n this.fetchMyConnections().subscribe((res) => {\r\n this.cdr.markForCheck();\r\n });\r\n this.fetchPendingRequests().subscribe((res) => {\r\n this.cdr.markForCheck();\r\n });\r\n }, 500);\r\n }\r\n\r\n scheduleMeetingWithUser(user) {\r\n this.scheduleMeeting.emit(user);\r\n }\r\n\r\n canConnect(userId) {\r\n return !(\r\n this.canDisconnect(userId) ||\r\n this.pendingRequests.find((a) => a == userId)\r\n );\r\n }\r\n\r\n canDisconnect(userId) {\r\n return this.myConnections.find((conn) => conn.userId == userId);\r\n }\r\n\r\n fetchPendingRequests() {\r\n const headers = new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n apiKey: this.autogenKey,\r\n });\r\n return this.http\r\n .get(\r\n `${this.environment.USERS_API}/events/${this.eventId}/connection-requests/autogen/pending-sent-requests?userId=${this.userId}`,\r\n { headers }\r\n )\r\n .pipe(\r\n switchMap((res: any) => {\r\n this.pendingRequests = res;\r\n this.cdr.markForCheck();\r\n return of(res);\r\n }),\r\n catchError((error: any) => {\r\n console.error('Error fetching pending requests: ', error);\r\n return of(null);\r\n })\r\n );\r\n }\r\n\r\n fetchMyConnections() {\r\n const headers = new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n apiKey: this.autogenKey,\r\n });\r\n return this.http\r\n .get(\r\n `${this.environment.USERS_API}/events/${this.eventId}/users-connections/autogen?userId=${this.userId}`,\r\n { headers }\r\n )\r\n .pipe(\r\n switchMap((res: any) => {\r\n this.myConnections = res;\r\n this.cdr.markForCheck();\r\n return of(res);\r\n }),\r\n catchError((error: any) => {\r\n console.error('Error fetching pending requests: ', error);\r\n return of(null);\r\n })\r\n );\r\n }\r\n\r\n isDropdownOpen: boolean = false;\r\n agents: any;\r\n selectedAgents = [];\r\n allSelected = false;\r\n // Toggle the dropdown visibility\r\n toggleDropdown() {\r\n if (!this.agents)\r\n this.fetchAgents();\r\n this.isDropdownOpen = !this.isDropdownOpen;\r\n this.cdr.detectChanges();\r\n }\r\n\r\n onSelectAll(event: Event): void {\r\n this.agents?.forEach((agent) => (agent.selected = false));\r\n this.cdr.detectChanges();\r\n }\r\n\r\n onAgentChange(agent: any): void {\r\n //agent.selected = !agent.selected;\r\n //console.log(agent);\r\n let agentFound = this.agents.filter((p) => p.id == agent.id);\r\n if (agentFound && agentFound.length > 0) {\r\n agentFound[0].selected = !agentFound[0].selected;\r\n this.cdr.detectChanges();\r\n }\r\n this.cdr.detectChanges();\r\n }\r\n\r\n areAllSelected(): boolean {\r\n return this.agents?.every((agent) => !agent.selected);\r\n }\r\n\r\n getDropdownHeaderText(): string {\r\n const selectedAgents = this.agents?.filter((agent) => agent.selected);\r\n if (!selectedAgents) {\r\n return 'All Agents';\r\n } else {\r\n if (selectedAgents && selectedAgents?.length === 0) {\r\n return 'All Agents';\r\n } else {\r\n return selectedAgents?.length > 1\r\n ? `${selectedAgents?.length} Agents Selected`\r\n : `${selectedAgents?.length} Agent Selected`;\r\n }\r\n }\r\n }\r\n fetchAgents_http() {\r\n this.loading = true;\r\n const url = `${this.environment.AGENTS_API}/CoPilot/${this.botId}/active-agents`;\r\n const headers = new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n });\r\n\r\n return this.http.post(url, {}, { headers }).pipe(\r\n switchMap((res: any) => {\r\n if (res) {\r\n this.agents = res.map((agent) => ({\r\n ...agent,\r\n selected: false,\r\n }));\r\n }\r\n this.cdr.markForCheck();\r\n\r\n return of(res);\r\n }),\r\n catchError((error) => {\r\n console.error('Error fetching chatbot config: ', error);\r\n\r\n return of(null);\r\n })\r\n );\r\n }\r\n isDocInEditMode = false;\r\n documentContent: any;\r\n\r\n conversationId: any;\r\n isContentLoaded = false;\r\n\r\n fetchContent_http() {\r\n this.isDocInEditMode = false;\r\n this.isContentLoaded = false;\r\n console.log('API call function');\r\n this.loading = true;\r\n const conversation_id = this.conversationService.getKey(this.botId);\r\n this.conversationId = conversation_id;\r\n const url = `${this.environment.AGENTS_API}/ConversationDocuments?conversationId=${conversation_id}&botId=${this.botId}`;\r\n const headers = new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n apiKey: 'WIz/qAm+EEmfOkFaUA/weA==',\r\n });\r\n\r\n return this.http.get(url, { headers }).pipe(\r\n switchMap((res: any) => {\r\n if (res) {\r\n this.isDocInEditMode = true;\r\n this.documentContent = res;\r\n console.log('Get API callled success');\r\n this.isContentLoaded = true;\r\n console.log(res);\r\n }\r\n this.cdr.markForCheck();\r\n\r\n return of(res);\r\n }),\r\n catchError((error) => {\r\n console.error('Error fetching chatbot config DJ: ', error);\r\n this.isDocInEditMode = false;\r\n this.isContentLoaded = true;\r\n\r\n if (error?.status == 404) {\r\n console.log('dash');\r\n this.isDocInEditMode = false;\r\n this.isContentLoaded = true;\r\n }\r\n return of(null);\r\n })\r\n );\r\n }\r\n\r\n fetchAgents() {\r\n this.fetchAgents_http().subscribe();\r\n }\r\n\r\n fetchEditorContent() {\r\n this.fetchContent_http().subscribe();\r\n }\r\n\r\n // events/${eventId}/users-connections\r\n processMessageForDisplay(markdown: string): SafeHtml {\r\n try {\r\n // Parse the markdown content to HTML using marked\r\n const markdownContent = marked.parse(markdown);\r\n\r\n // Sanitize the parsed HTML using Angular's DomSanitizer\r\n // const sanitizedHtml = this.sanitizer.bypassSecurityTrustHtml(markdownContent);\r\n\r\n // Return the safe HTML content for display\r\n return markdownContent;\r\n\r\n } catch (error) {\r\n console.error('Error processing markdown:', error);\r\n return ''; // Return an empty string or handle the error appropriately\r\n }\r\n }\r\n\r\n prepareHtml(markdown: string): string {\r\n if (!markdown || !(markdown.length > 0)) {\r\n console.error('Input Markdown is null or empty');\r\n return '';\r\n }\r\n\r\n // Convert Markdown headers (### or ##) to <strong> for bold headings\r\n let html = markdown.replace(/^(#{1,6})\\s+(.*)$/gm, (match, hashes, text) => {\r\n const level = hashes.length;\r\n if (level === 3) {\r\n return `<h3><strong>${text}</strong></h3>`;\r\n } else if (level === 4) {\r\n return `<h4><strong>${text}</strong></h4>`;\r\n }\r\n return `<strong>${text}</strong>`;\r\n });\r\n\r\n // Convert Markdown code blocks with language to preformatted HTML\r\n html = html.replace(/```(\\w+)?\\n([\\s\\S]*?)```/g, (match, lang, code) => {\r\n const escapedCode = this.escapeHtml(code);\r\n const language = lang || 'plaintext';\r\n\r\n // Create a copy button for the code block\r\n return `\r\n <div class=\"code-container\">\r\n <button id=\"copy-button\" class=\"copy-button\" (click)=\"copyToClipboard('\\`${escapedCode}\\`')\">Copy</button>\r\n <pre class=\"code_block diff\"><code class=\"language-${language}\">${escapedCode}</code></pre>\r\n </div>`;\r\n });\r\n\r\n // Convert inline code (wrapped in `backticks`) to inline <code> tags\r\n html = html.replace(/`([^`]+)`/g, '<code>$1</code>');\r\n\r\n // Convert Markdown bold to HTML <strong>\r\n html = html.replace(/\\*\\*(.*?)\\*\\*/g, '<strong>$1</strong>');\r\n\r\n // Convert numbered lists\r\n html = html.replace(/^\\d+\\.\\s+(.*)$/gm, '<li>$1</li>');\r\n\r\n // Convert bullet point lists\r\n html = html.replace(/^\\-\\s+(.*)$/gm, '<li>$1</li>');\r\n\r\n // Convert Markdown links to HTML links\r\n html = html.replace(/\\[([^\\]]+)]\\(([^)]+)\\)/g, '<a href=\"$2\" target=\"_blank\">$1</a>');\r\n\r\n // Convert new lines to <br> tags for paragraphs\r\n html = html.replace(/(?:\\r\\n|\\r|\\n)/g, '<br>');\r\n\r\n return html;\r\n }\r\n\r\n // Helper function to escape HTML characters for code blocks\r\n escapeHtml(code: string): string {\r\n return code\r\n .replace(/&/g, '&amp;')\r\n .replace(/</g, '&lt;')\r\n .replace(/>/g, '&gt;')\r\n .replace(/\"/g, '&quot;')\r\n .replace(/'/g, '&#039;');\r\n }\r\n\r\n // Function to copy text to clipboard\r\n public copyToClipboard(text: string) {\r\n navigator.clipboard.writeText(text).then(() => {\r\n alert('Code copied to clipboard!');\r\n }, (err) => {\r\n console.error('Could not copy text: ', err);\r\n });\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n isCollapsed = false;\r\n isCollapsedForGraph = false;\r\n isCollapsedForFGraph = false;\r\n toggleCollapse() {\r\n this.isCollapsed = !this.isCollapsed;\r\n this.cdr.detectChanges();\r\n }\r\n\r\n toggleCollapseGraph() {\r\n this.isCollapsedForGraph = !this.isCollapsedForGraph;\r\n this.cdr.detectChanges();\r\n }\r\n toggleCollapseFGraph() {\r\n this.isCollapsedForFGraph = !this.isCollapsedForFGraph;\r\n this.cdr.detectChanges();\r\n }\r\n // [\r\n // {\r\n // \"title\": \"AI News January 2024: In-Depth and Concise - The AI Track\",\r\n // \"desc\": \"Each month, we compile significant news, trends, and happenings in AI, providing detailed summaries with key points in bullet form for concise yet complete understanding.\",\r\n // \"link\": \"https://theaitrack.com/ai-news-january-2024/\"\r\n // },\r\n // {\r\n // \"title\": \"Top AI News, January 2024 - Everypixel Journal\",\r\n // \"desc\": \"In this monthly roundup, we spotlight the top AI news stories from January, including the OpenAI vs. The New York Times Lawsuit.\",\r\n // \"link\": \"https://journal.everypixel.com/top-ai-news-january-2024\"\r\n // },\r\n // {\r\n // \"title\": \"AI News July 2024: In-Depth and Concise - The AI Track\",\r\n // \"desc\": \"This page features AI News for July 2024, highlighting significant events such as Canva acquiring Leonardo AI.\",\r\n // \"link\": \"https://theaitrack.com/ai-news-july-2024-in-depth-and-concise/\"\r\n // },\r\n // {\r\n // \"title\": \"January news roundup: What's new in the world of AI? - Pluralsight\",\r\n // \"desc\": \"OpenAI’s new GPT store, business-ready ChatGPT plans, and a predicted rise in AI-powered cybercrime.\",\r\n // \"link\": \"https://www.pluralsight.com/resources/blog/data/ai-this-month-january-2024\"\r\n // },\r\n // {\r\n // \"title\": \"AI News August 2024: In-Depth and Concise - The AI Track\",\r\n // \"desc\": \"This page features AI News for August 2024, with highlights such as Nvidia delaying the “Blackwell” B200 AI chips delivery.\",\r\n // \"link\": \"https://theaitrack.com/ai-news-august-2024-in-depth-and-concise-duplicate/\"\r\n // }\r\n // ]\r\n dateTime = { now: new Date().toISOString() };\r\n // Extracts the domain from a URL\r\n getDomainName(url: string): string {\r\n try {\r\n const { hostname } = new URL(url);\r\n return hostname.replace(/^www\\./, ''); // Remove 'www.' if present\r\n } catch {\r\n return 'unknown';\r\n }\r\n }\r\n\r\n // Generates the favicon URL\r\n getFaviconUrl(url: string): string {\r\n const domain = this.getDomainName(url);\r\n return `https://www.google.com/s2/favicons?sz=128&domain=${domain}`;\r\n }\r\n currentSourcesList: any = [];\r\n onCardClick(sources): void {\r\n this.currentSourcesList = sources;\r\n this.cdr.detectChanges();\r\n this.sourcesDrawer.open();\r\n const button = document.getElementById('botcloseplaygroundbutton');\r\n if (button) {\r\n button.style.display = 'none';\r\n }\r\n }\r\n\r\n isShowEditorButton = true;\r\n\r\n openOuterEditor() {\r\n this.fetchEditorContent();\r\n this.editorsDrawer.open();\r\n this.isDrawerOpen = true;\r\n this.isShowEditorButton = false;\r\n this.cdr.detectChanges();\r\n\r\n const button = document.getElementById('botcloseplaygroundbutton');\r\n if (button) {\r\n button.style.display = 'none';\r\n }\r\n }\r\n\r\n onCloseEditor() {\r\n this.editorsDrawer.close();\r\n this.isDrawerOpen = false;\r\n this.isShowEditorButton = true;\r\n this.cdr.detectChanges(); // Trigger change detection if needed\r\n this.onDrawerClosed();\r\n }\r\n\r\n onCloseSource() {\r\n this.sourcesDrawer.close();\r\n this.isDrawerOpen = false;\r\n this.cdr.detectChanges(); // Trigger change detection if needed\r\n this.onDrawerClosed();\r\n }\r\n onDrawerClosed() {\r\n setTimeout(() => {\r\n this.isDrawerOpen = true;\r\n this.cdr.detectChanges(); // Trigger change detection if needed\r\n // Use ngClass to dynamically apply the class\r\n const button = document.getElementById('botcloseplaygroundbutton');\r\n if (button) {\r\n button.style.display = 'block';\r\n }\r\n }, 800);\r\n }\r\n isDrawerOpen = true;\r\n\r\n toggleDrawer(todo) {\r\n this.isDrawerOpen = todo;\r\n this.cdr.detectChanges();\r\n this.updateButtonVisibility();\r\n }\r\n updateButtonVisibility() {\r\n const button = document.getElementById('botcloseplaygroundbutton');\r\n if (button) {\r\n button.style.display = this.isDrawerOpen ? 'block' : 'none';\r\n }\r\n }\r\n openLinkInNewTab(link: string): void {\r\n window.open(link, '_blank');\r\n }\r\n adjustTextareaHeight(event: any): void {\r\n try {\r\n if (event.key === 'Enter' && !event.shiftKey) {\r\n // Prevents a new line from being added\r\n event.preventDefault();\r\n }\r\n } catch (error) {\r\n\r\n }\r\n const textarea = event.target as HTMLTextAreaElement;\r\n textarea.style.height = 'auto'; // Reset the height\r\n textarea.style.height = `${textarea.scrollHeight}px`; // Adjust height to match content\r\n // Ensure the height doesn't exceed the max-height set in CSS\r\n if (textarea.scrollHeight > 150) {\r\n textarea.style.height = `150px`; // Adjust height to match content\r\n textarea.style.overflowY = 'auto'; // Enable scrolling if content exceeds 400px\r\n } else {\r\n textarea.style.overflowY = 'hidden'; // Hide scrollbar if content is within limits\r\n }\r\n }\r\n\r\n toggleWorkflows(value = null) {\r\n\r\n if (!this.checkForCop29BotId()) {\r\n this.botService.getWorkflowsByOrgId(this.orgId).subscribe((res) => {\r\n this.orgWorkflows = res;\r\n this.isWorkflowOpen = value == null ? !this.isWorkflowOpen : value;\r\n\r\n if (!this.isWorkflowOpen) {\r\n this.selectedWorkflow = null;\r\n this.openWorkflowInput = false;\r\n }\r\n\r\n this.cdr.detectChanges();\r\n });\r\n }\r\n\r\n }\r\n\r\n initializeForm() {\r\n // Create form controls dynamically based on selectedWorkflow.Trigger.InputSchema\r\n const formControls = {};\r\n if (this.selectedWorkflow?.Trigger?.InputSchema) {\r\n this.selectedWorkflow.Trigger.InputSchema.forEach((input) => {\r\n formControls[input.InputId] = [\r\n input.Value || '',\r\n input.Required ? Validators.required : null,\r\n ];\r\n });\r\n }\r\n\r\n // Initialize the form\r\n this.workflowForm = this.fb.group(formControls);\r\n }\r\n\r\n onWorkflowSelected(workflow) {\r\n this.selectedWorkflow = workflow;\r\n this.initializeForm();\r\n this.isWorkflowOpen = false;\r\n this.openWorkflowInput = true;\r\n }\r\n\r\n onWorkflowSubmit() {\r\n const container = document.getElementById('allChats');\r\n if (this.workflowForm.valid) {\r\n console.log(this.workflowForm.value);\r\n\r\n var input = this.prepareHtml(\r\n this.generateMarkdown(\r\n this.selectedWorkflow.Name,\r\n this.workflowForm.value\r\n )\r\n );\r\n\r\n // update last two chatLog entries, set showWorkflowExecutionLoader = false\r\n try {\r\n this.chatLog[this.chatLog.length - 1][\r\n 'showWorkflowExecutionLoader'\r\n ] = false;\r\n this.chatLog[this.chatLog.length - 2][\r\n 'showWorkflowExecutionLoader'\r\n ] = false;\r\n } catch (error) { }\r\n\r\n this.chatLog.push({\r\n type: 'user',\r\n message: input,\r\n time: formatNow(this.timezone),\r\n copied: false,\r\n isCollapsedTrue: false,\r\n showWorkflowExecutionLoader: true,\r\n });\r\n\r\n console.log(input);\r\n\r\n this.currentWorkflowActionProgress = 0;\r\n this.currentWorkflowAction =\r\n 'Executing ' + this.selectedWorkflow.Actions[0].Name;\r\n this.isChatingWithAi = true;\r\n this.executingWorkflow = true;\r\n this.workflowExecutionDetails = {\r\n Actions: this.selectedWorkflow.Actions,\r\n Inputs: this.workflowForm.value,\r\n workflowInputs: this.workflowForm.value,\r\n WorkflowName: this.selectedWorkflow.Name,\r\n };\r\n this.currentWorkflowExecutionDetails = this.workflowExecutionDetails;\r\n this.scrollToBottom();\r\n\r\n this.cdr.detectChanges();\r\n\r\n // execute the ask endpoint with workflow input\r\n this.makeAskRequest(\r\n input,\r\n this.agents,\r\n this.conversationKey,\r\n '',\r\n null,\r\n this.selectedWorkflow['_id'],\r\n this.workflowForm.value\r\n );\r\n }\r\n }\r\n\r\n makeAskRequest(\r\n inputMsg: string,\r\n agents: any[],\r\n conversationId: string,\r\n msg?: any,\r\n chat?: any,\r\n workflowId?: string,\r\n workflow_inputs?: any\r\n ): void {\r\n var url = `${this.environment.BASE_URL}/ai/ask`;\r\n\r\n var body = {\r\n user_question: inputMsg,\r\n user_id: this.userId,\r\n bot_id: this.botId,\r\n message_id: this.conversationService.generateKey(),\r\n agents: agents?.filter((p) => p.selected).map((p) => p.id) ?? [],\r\n conversation_id: conversationId,\r\n };\r\n\r\n if (workflowId) {\r\n body['workflow_id'] = workflowId;\r\n body['workflow_inputs'] = workflow_inputs;\r\n }\r\n\r\n fetch(url, {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n Authorization: 'Bearer ' + this.s27Token,\r\n 'x-api-key': this.apiKey,\r\n 'hive-bot-id': this.botId\r\n },\r\n body: JSON.stringify(body),\r\n })\r\n .then((response) => {\r\n if (response.status === 401 || response.status === 403) {\r\n this.is401 = true;\r\n this.refreshToken.emit();\r\n\r\n // If `msg` and `chat` exist, handle them\r\n if (msg && chat) {\r\n this.msg = msg;\r\n this.chat = chat;\r\n this.isFetchDataFor = true;\r\n }\r\n } else {\r\n this.is401 = false;\r\n }\r\n return response.json();\r\n })\r\n .then((data) => {\r\n console.log(data);\r\n // Additional response handling if needed\r\n })\r\n .catch((err) => {\r\n console.error('Error: ', err);\r\n this.isChatingWithAi = false;\r\n });\r\n\r\n this.input = '';\r\n this.selectedWorkflow = null;\r\n this.openWorkflowInput = false;\r\n this.isWorkflowOpen = false;\r\n this.scrollToBottom();\r\n this.cdr.markForCheck();\r\n }\r\n\r\n generateMarkdown(title, obj) {\r\n // Initialize markdown with the title\r\n let markdown = `## ${title}\\n`;\r\n\r\n // Loop through the object and append the field names and values\r\n for (const [key, value] of Object.entries(obj)) {\r\n var key_label =\r\n this.selectedWorkflow.Trigger.InputSchema.find(\r\n (input) => input.InputId === key\r\n )?.Label || key;\r\n markdown += `- **${key_label}**: ${value}\\n`;\r\n }\r\n\r\n return markdown;\r\n }\r\n\r\n showWorkflowHistoryDetails(workflow_id) {\r\n if (!workflow_id) {\r\n this.workflowExecutionDetails = this.currentWorkflowExecutionDetails;\r\n this.showWorkflowExecutionDetails = true;\r\n this.cdr.detectChanges();\r\n return;\r\n }\r\n\r\n this.botService.getWorkflowExecutionById(workflow_id).subscribe((res) => {\r\n if (res && res.Actions && Array.isArray(res.Actions)) {\r\n res.Actions = res.Actions.map((action) => {\r\n if (action.InsertTimeStamp) {\r\n action.InsertTimeStamp = formatTimeStamps(\r\n this.timezone,\r\n action.InsertTimeStamp\r\n );\r\n }\r\n return action;\r\n });\r\n }\r\n\r\n res.InsertTimeStamp = formatTimeStamps(\r\n this.timezone,\r\n res.InsertTimeStamp\r\n );\r\n this.workflowExecutionDetails = res;\r\n this.showWorkflowExecutionDetails = true;\r\n this.cdr.detectChanges();\r\n });\r\n }\r\n\r\n closeModal() {\r\n this.showWorkflowExecutionDetails = false;\r\n }\r\n\r\n objectToArray(obj: any): any[] {\r\n return Object.keys(obj).map((key) => ({ key, value: obj[key] }));\r\n }\r\n\r\n startNewConversation() {\r\n this.conversationKey = this.conversationService.getKey(this.botId, true);\r\n this.chatLog = [this.chatLog[0]];\r\n this.isChatingWithAi = false;\r\n setTimeout(() => {\r\n this.initializeSocket();\r\n }, 200);\r\n this.scrollToBottom();\r\n this.cdr.detectChanges();\r\n }\r\n\r\n initializeSpeechRecognizer(token: string) {\r\n this.speechConfig = SpeechSDK.SpeechConfig.fromAuthorizationToken(\r\n token,\r\n this.region\r\n );\r\n const audioConfig = SpeechSDK.AudioConfig.fromDefaultMicrophoneInput();\r\n this.recognizer = new SpeechSDK.SpeechRecognizer(\r\n this.speechConfig,\r\n audioConfig\r\n );\r\n\r\n this.recognizer.recognizing = (s, e) => {\r\n if (e.result.reason === SpeechSDK.ResultReason.RecognizingSpeech) {\r\n this.input = e.result.text;\r\n console.log(`Recognizing: ${e.result.text}`);\r\n this.cdr.markForCheck();\r\n }\r\n };\r\n\r\n this.recognizer.recognized = (s, e) => {\r\n if (e.result.reason === SpeechSDK.ResultReason.RecognizedSpeech) {\r\n this.input = e.result.text;\r\n console.log(`Recognized: ${e.result.text}`);\r\n this.toggleRecording();\r\n this.cdr.markForCheck();\r\n }\r\n };\r\n\r\n this.recognizer.canceled = (s, e) => {\r\n console.error('Canceled: ', e.errorDetails);\r\n };\r\n\r\n this.recognizer.sessionStopped = (s, e) => {\r\n console.log('Session stopped.');\r\n this.recognizer.stopContinuousRecognitionAsync();\r\n this.fetchData();\r\n };\r\n }\r\n\r\n toggleRecording() {\r\n this.isRecording = !this.isRecording;\r\n\r\n if (this.isRecording) {\r\n this.startRecognition();\r\n } else {\r\n this.stopRecognition();\r\n }\r\n }\r\n\r\n startRecognition() {\r\n this.recognizer.startContinuousRecognitionAsync();\r\n }\r\n\r\n stopRecognition() {\r\n this.recognizer.stopContinuousRecognitionAsync();\r\n }\r\n\r\n checkForCop29BotId() {\r\n return this.botId == '66fa3f276c5d71e2717bfea8';\r\n }\r\n\r\n getLatestTime(time): string {\r\n if (time) {\r\n return time;\r\n }\r\n return new Date().toLocaleTimeString([], {\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n }); // returns current time in 'shortTime' format\r\n }\r\n}\r\n","import { Component, Input } from '@angular/core';\r\n@Component({\r\n selector: 'hivegpt-chatbot',\r\n templateUrl: './chatbot.component.html',\r\n styleUrls: ['./chatbot.component.scss'],\r\n})\r\nexport class ChatBotComponent {\r\n @Input() userId!: string;\r\n @Input() apiKey!: string;\r\n @Input() botName!: string;\r\n @Input() botSkills!: string;\r\n @Input() botId!: string;\r\n @Input() closeButtonColor!: string;\r\n @Input() gradientColors!: string[];\r\n @Input() greeting!: string;\r\n @Input() sendButtonColor!: string;\r\n @Input() useOpenAi!: boolean;\r\n @Input() showClose!: boolean;\r\n @Input() bgGradient!: string[];\r\n @Input() sendButtonTextColor!: string;\r\n @Input() fullView!: boolean;\r\n @Input() bgBubbleAi!: string;\r\n @Input() bgBubbleUser!: string;\r\n @Input() closeButtonbgColor!: string;\r\n @Input() messageTextColorAi!: string;\r\n @Input() messageTextColorUser!: string;\r\n @Input() dateTimeColor!: string;\r\n @Input() dateTextColor!: string;\r\n @Input() formFieldBgColor!: string;\r\n @Input() formFieldTextColor!: string;\r\n @Input() thumbsUpMessage!: string;\r\n @Input() thumbsDownMessages!: string[];\r\n @Input() timezone!: string;\r\n @Input() eventName!: string;\r\n @Input() credentials!: [];\r\n @Input() unknownResponses!: [];\r\n @Input() rules!: string;\r\n @Input() eventId!: string;\r\n visible = false;\r\n\r\n toggle() {\r\n this.visible = !this.visible;\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\nimport { DomSanitizer } from '@angular/platform-browser';\r\n\r\n@Pipe({\r\n name: 'safeHtml',\r\n})\r\nexport class SafeHtmlPipe implements PipeTransform {\r\n\r\n constructor(private sanitizer: DomSanitizer) {\r\n }\r\n\r\n transform(html): unknown {\r\n return html ? this.sanitizer.bypassSecurityTrustHtml(html) : '';\r\n }\r\n\r\n}\r\n","import {\r\n AfterViewInit,\r\n ChangeDetectorRef,\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n Inject,\r\n Input,\r\n OnInit,\r\n Output,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { IVideo } from '../../models/video';\r\nimport { DOCUMENT } from '@angular/common';\r\n\r\n@Component({\r\n selector: 'app-video-player',\r\n templateUrl: './video-player.component.html',\r\n styleUrls: ['./video-player.component.scss'],\r\n})\r\nexport class VideoPlayerComponent\r\n implements OnInit, AfterViewInit {\r\n @Input() currentUserId: string;\r\n @Input() user: any;\r\n @Input() eventId: string;\r\n @Input() videoObj: IVideo;\r\n @Input() isDev: boolean;\r\n myFollowingList: Array<string>;\r\n myPendingSentRequests: Array<string>;\r\n @Input() type: string;\r\n isMuted: boolean = true;\r\n private observer: IntersectionObserver;\r\n isFullscreen: boolean = false;\r\n @ViewChild('video') video: any;\r\n @ViewChild('fullscreenvideo') fullscreenvideo: any;\r\n isFullscreenvideoPlaying: boolean = false;\r\n\r\n @Output() connectWithUser = new EventEmitter<string>();\r\n @Output() scheduleMeeting = new EventEmitter<any>();\r\n\r\n constructor(\r\n @Inject(DOCUMENT) private doc: any,\r\n private el: ElementRef,\r\n private cdr: ChangeDetectorRef\r\n ) {\r\n }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n toggleSound(isMuted = null) {\r\n this.isMuted = isMuted != null ? isMuted : !this.isMuted;\r\n setTimeout(() => {\r\n const video: any = this.doc\r\n .getElementById(this.video.id.toString());\r\n if (video) {\r\n video.muted = this.isMuted;\r\n this.video.isMuted = this.isMuted;\r\n }\r\n\r\n this.cdr.markForCheck();\r\n //this.muteToggle.emit(this.isMuted);\r\n })\r\n}\r\n\r\n togglePlay(playState: boolean, videoEl) {\r\n this.videoObj.isPlaying = !this.videoObj.isPlaying;\r\n setTimeout(() => { \r\n if (playState) { \r\n this.videoObj.isPlaying = true;\r\n videoEl.play();\r\n var pauseBtn = document.getElementById('pause-btn');\r\n pauseBtn.classList.add('hide-pause-btn');\r\n\r\n this.toggleSound(false);\r\n }\r\n else{\r\n this.videoObj.isPlaying = false;\r\n videoEl.pause();\r\n }\r\n this.cdr.markForCheck();\r\n })\r\n }\r\n \r\n ngAfterViewInit() {\r\n if (window.innerWidth <= 576) {\r\n this.observer = new IntersectionObserver(\r\n (entries) => {\r\n if (entries[0].isIntersecting === true) {\r\n this.video.nativeElement.play();\r\n } else {\r\n this.video.nativeElement.pause();\r\n }\r\n },\r\n {\r\n threshold: 0.75,\r\n }\r\n );\r\n\r\n this.observer.observe(this.el.nativeElement as HTMLElement);\r\n }\r\n }\r\n\r\n toggleFullscreen() {\r\n this.isFullscreen = !this.isFullscreen;\r\n if (!this.isFullscreen) {\r\n this.fullscreenvideo.nativeElement.pause();\r\n }\r\n }\r\n\r\n toggleFullscreenPlay() {\r\n this.isFullscreenvideoPlaying = !this.isFullscreenvideoPlaying;\r\n\r\n if (this.isFullscreenvideoPlaying) {\r\n this.fullscreenvideo.nativeElement.play();\r\n } else {\r\n this.fullscreenvideo.nativeElement.pause();\r\n }\r\n }\r\n\r\n followUser(userId) {\r\n this.connectWithUser.emit(userId);\r\n }\r\n\r\n checkPendingSentRequest(userId) {\r\n return this.myPendingSentRequests?.find(a => a == userId);\r\n }\r\n\r\n canUnfollowUser() {\r\n return false;\r\n }\r\n\r\n canFollowUser() {\r\n return true;\r\n }\r\n\r\n getIniNames(firstName, lastName) {\r\n if(!firstName && !lastName) {\r\n return '';\r\n }\r\n \r\n if (firstName && lastName)\r\n return (\r\n firstName.charAt(0).toUpperCase() + lastName.charAt(0).toUpperCase()\r\n );\r\n else return firstName.charAt(0).toUpperCase();\r\n }\r\n}\r\n","import { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport {\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n Input,\r\n OnChanges,\r\n OnInit,\r\n Output,\r\n QueryList,\r\n Renderer2,\r\n SimpleChanges,\r\n ViewChild,\r\n ViewChildren,\r\n} from '@angular/core';\r\nimport { MatDrawer } from '@angular/material/sidenav';\r\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\r\nimport { of, Subscription } from 'rxjs';\r\nimport { catchError, switchMap } from 'rxjs/operators';\r\nimport { formatNow, formatTimeStamps } from '../../utils/utils';\r\nimport {\r\n dev_environment,\r\n prod_environment,\r\n} from '../../../environments/environment';\r\nimport { ConversationService } from '../conversation.service';\r\nimport { Observable } from 'rxjs';\r\nimport { SocketService } from '../socket-service.service';\r\n\r\n@Component({\r\n selector: 'lib-bot-html-editor',\r\n templateUrl: './bot-html-editor.component.html',\r\n styleUrls: ['./bot-html-editor.component.css'],\r\n})\r\nexport class BotHtmlEditorComponent implements OnInit {\r\n @Input() editorContent: Observable<string>;\r\n @Input() isDocInEditMode: any;\r\n @Input() documentContent: any;\r\n @Input() conversationId: any;\r\n @Input() botId: any;\r\n\r\n documentName: any = 'doc name';\r\n\r\n environment: {\r\n USERS_API;\r\n BASE_URL;\r\n AGENTS_API;\r\n };\r\n\r\n quillConfig = {\r\n toolbar: [\r\n [{ header: '1' }, { header: '2' }, { font: [] }],\r\n [{ list: 'ordered' }, { list: 'bullet' }],\r\n ['bold', 'italic', 'underline'],\r\n ['link'],\r\n ['clean'],\r\n ],\r\n };\r\n constructor(private cdr: ChangeDetectorRef, private http: HttpClient) {}\r\n\r\n ngOnInit(): void {\r\n this.environment = prod_environment;\r\n\r\n setTimeout(() => {\r\n if (this.isDocInEditMode) {\r\n console.log('In Edit mode');\r\n this.filldataInForm();\r\n } else {\r\n console.log('In save mode');\r\n }\r\n }, 2500);\r\n }\r\n\r\n filldataInForm() {\r\n if (this.documentContent) {\r\n this.documentName = this.documentContent?.name;\r\n this.editorContent = this.documentContent?.content;\r\n this.cdr.detectChanges();\r\n }\r\n }\r\n\r\n saveContent() {\r\n if (!this.isDocInEditMode) {\r\n this.saveContent_http().subscribe();\r\n } else {\r\n this.saveContent_http().subscribe();\r\n }\r\n }\r\n\r\n saveContent_http() {\r\n console.log('API call function');\r\n\r\n const url = `${this.environment.AGENTS_API}/ConversationDocuments?conversationId=${this.conversationId}&botId=${this.botId}`;\r\n const headers = new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n apiKey: 'WIz/qAm+EEmfOkFaUA/weA==',\r\n });\r\n\r\n let data = {\r\n name: this.documentName,\r\n content: this.editorContent,\r\n };\r\n\r\n return this.http.post(url, data, { headers }).pipe(\r\n switchMap((res: any) => {\r\n if (res) {\r\n // alert('Saved Successfully');\r\n }\r\n this.cdr.markForCheck();\r\n\r\n return of(res);\r\n }),\r\n catchError((error) => {\r\n console.error('Error fetching chatbot config: ', error);\r\n\r\n return of(null);\r\n })\r\n );\r\n }\r\n\r\n updateContent_http() {\r\n console.log('API call function');\r\n\r\n const url = `${this.environment.AGENTS_API}/ConversationDocuments/rename?conversationId=${this.conversationId}&botId=${this.botId}`;\r\n const headers = new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n apiKey: 'WIz/qAm+EEmfOkFaUA/weA==',\r\n });\r\n\r\n let data = {\r\n name: this.documentName,\r\n content: this.editorContent,\r\n };\r\n\r\n return this.http.put(url, data, { headers }).pipe(\r\n switchMap((res: any) => {\r\n if (res) {\r\n // alert('Updated Successfully');\r\n }\r\n this.cdr.markForCheck();\r\n\r\n return of(res);\r\n }),\r\n catchError((error) => {\r\n console.error('Error fetching chatbot config: ', error);\r\n\r\n return of(null);\r\n })\r\n );\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatSidenavModule } from '@angular/material/sidenav';\r\nimport { ChatDrawerComponent } from './components/chat-drawer/chat-drawer.component';\r\nimport { ChatBotComponent } from './components/chatbot/chatbot.component';\r\nimport { SafeHtmlPipe } from './pipes/safe-html.pipe';\r\nimport { VideoPlayerComponent } from './components/video-player/video-player.component';\r\nimport { QuillModule } from 'ngx-quill';\r\nimport { BotHtmlEditorComponent } from './components/bot-html-editor/bot-html-editor.component';\r\n\r\n@NgModule({\r\n declarations: [ChatBotComponent, ChatDrawerComponent, VideoPlayerComponent, SafeHtmlPipe, BotHtmlEditorComponent],\r\n imports: [CommonModule, MatIconModule, MatSidenavModule, FormsModule, QuillModule],\r\n exports: [ChatBotComponent, ChatDrawerComponent, VideoPlayerComponent]\r\n})\r\nexport class HiveGptModule { }\r\n"]}
1
+ {"version":3,"sources":["../../../../node_modules/tslib/tslib.es6.js","../../../../projects/hivegpt/eventsgpt-angular/src/lib/utils/utils.ts","../../../../projects/hivegpt/eventsgpt-angular/src/environments/environment.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/components/conversation.service.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/components/NotificationSocket.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/components/socket-service.service.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/components/bot.service.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/components/chat-drawer/chat-drawer.component.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/components/chatbot/chatbot.component.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/pipes/safe-html.pipe.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/components/video-player/video-player.component.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/components/bot-html-editor/bot-html-editor.component.ts","../../../../projects/hivegpt/eventsgpt-angular/src/lib/hivegpt.module.ts"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","__values","o","s","Symbol","iterator","m","i","length","next","value","done","__read","n","r","e","ar","push","error","__spread","arguments","concat","SuppressedError","formatHoursAndMinutes","date","hours","getHours","minutes","getMinutes","formatNow","timezone","now","Date","options","hour12","hour","minute","timeZone","toLocaleString","formatTimeStamps","timestamps","prod_environment","USERS_API","BASE_URL","AGENTS_API","API_KEY","SocketUrl","dev_environment","ConversationService","storageKey","userSepecificNotification","Subject","generateKey","Math","floor","getTime","toString","replace","random","getKey","botId","resetKey","localStorage","getItem","setItem","sendValidatedUserData","message","getUserSpecificNotification","asObservable","Injectable","args","providedIn","NotificationSocket","_this","_super","socketConfig","on","console","log","warn","err","Socket","url","transports","reconnection","autoConnect","upgrade","reconnectionDelay","reconnectionDelayMax","reconnectionAttempts","Infinity","SocketService","conversationService","notificationSocket","isCommonSocketInitialized","isUserSpecificSocketInitialized","isUserSpecificEventReleased","messageQueue","releaseInterval","intervalSetup","startReleasingMessages","isSocketInitialized","isCommon","disconnectSocketConnection","disconnect","connectSocketConnection","connect","registerUserSpecificHiveSocket","conversation_id","org_id","groupId","groupId_org","emit","fromEvent","subscribe","res","setInterval","shift","BotsService","http","eventDescription","bot_api","fetchSpeechAuthorizationToken","apiKey","headers","HttpHeaders","Content-Type","x-api-key","hive-bot-id","get","pipe","map","resp","token","getWorkflowsByOrgId","orgId","getWorkflowExecutionById","executionId","apiUrl","HttpClient","ChatDrawerComponent","fb","botService","cdr","sanitizer","elementRef","renderer","socketService","bodyOverflowClass","isCollapsedTrue","copilotName","feedbackEvent","EventEmitter","onCloseEvent","openPage","sessionActions","closeBot","connectWithUser","scheduleMeeting","refreshToken","autogenKey","addToMyAgendaAction","myUpcomingSessionAction","connectOrFollowAction","aiResponse","chatLog","decoder","TextDecoder","feedbackDone","greetingMsg","hasBackdropValue","input","listenerAdded","loading","mode","quickPrompts","thumbsDownMsgIndex","userName","showStartAgain","isIOSDevice","showFeedBackIconsIndex","temperature","speakers","currentWorkflowActionProgress","currentWorkflowAction","recognizedText","authorizationToken","region","isChatingWithAi","readAllChunks","stream","reader","getReader","allSuggestions","closed","catch","scrollToBottom","ReadableStream","start","controller","pump","currentMessageForEditor","currentIndexForEditor","isDropdownOpen","selectedAgents","allSelected","isDocInEditMode","isContentLoaded","isCollapsed","isCollapsedForGraph","isCollapsedForFGraph","dateTime","toISOString","currentSourcesList","isShowEditorButton","isDrawerOpen","chatMain","ElementRef","ngOnChanges","changes","s27Token","currentValue","previousValue","isFetchDataFor","msg","chat","is401","fetchDataFor","fetchData","initializeSocket","ngOnInit","environment","isDev","changeTemperature","fetchBotConfig","markForCheck","fetchChatHistory","response","mapChatHistory","initializeSpeechRecognizer","setTimeout","listenSockets","eventSubscription","unsubscribe","_b","_a","OtherFields","workflow_id","_g","_c","percentage","output","action_name","current_action_name_1","current_action_name","workflow_execution_id","time_stamp","actionIndex","workflowExecutionDetails","Actions","findIndex","a","Name","currentWorkflowExecutionDetails","executingWorkflow","detectChanges","_d","_h","_e","message_id_1","bot_id","message_id","answer","web_results","search_results","graphs","execution_graphs","suggestions","_f","currentChatMessage","find","_id","type","time","isArray","searchTerms","sourcesList","displayedSources","slice","remainingSources","processMessageForDisplay","executionGraphs","relatedListItems","initializeSocketAndListen","handleEvent","data","ngOnDestroy","newTemperature","wrapper","document","querySelector","classList","remove","add","onStartAgain","archieveMessages","userId","post","switchMap","of","catchError","botName","botIcon","Icon","botSkills","Skills","Greeting","thumbsDownMessages","NegativeResponses","QuickPrompts","conversationKey","accept","handleError","operation","result","chats","Messages","forEach","Type","Text","InsertTimestamp","copied","WorkflowExecutionId","WebLinks","ExecutionGraphs","Graphs","SearchTerms","processMessage","trim","markdownLinkRegex","urlRegex","test","html","sanitizeHtml","match","hashes","text","level","ngAfterViewChecked","nativeElement","querySelectorAll","link","addEventListener","onFeedbackClick","bind","bypassSecurityTrustHtml","onClose","removeClass","body","sendMessageWithTile","prompt","textarea","myInput","style","height","makeAskRequest","agents","inputMsg","fetchSmallTalk","smallTalk","isFeedbackMsg","read","then","lastItem","pop","close","decodedChunk","decode","suggestionsMatch","aiFormattedData","JSON","parse","section_id","fetchMyConnections","fetchPendingRequests","speakerIds","content","session","getSpeakersByStaffIds","sectionId","sessionIds","usersLen","search","connetUserIds","is_open_page","isMobileBrowser","action","addCloseBotClickEvent","enqueue","submitFeedback","flag","fetch","method","stringify","messageId","isHelpful","thumbsUpMessage","handleKeydown","event","key","shiftKey","preventDefault","handleSubmit","handleUpClick","idx","liked","unliked","handleDownClick","copyText","id","index","textElement","getElementById","tempTextArea","createElement","innerText","appendChild","select","execCommand","removeChild","handleCopyClick","sanitizeHTML","doc","DOMParser","parseFromString","fragment","createDocumentFragment","from","childNodes","node","cloneNode","simplifiedDiv","script","innerHTML","handleEditorClick","isEditor","editorsDrawer","open","button","display","counter","interval","scrollTop","scrollHeight","clearInterval","handleAction","info","ngAfterViewInit","drawer","opened","setBodyOverflow","openedChange","removeBodyOverflow","myTextarea","focus","addClass","ids","eventId","Authorization","ok","json","Error","speaker","performSessionAction","sessionId","element","listen","navigator","userAgent","connectToUser","canDisconnect","scheduleMeetingWithUser","user","canConnect","pendingRequests","myConnections","conn","toggleDropdown","fetchAgents","onSelectAll","agent","selected","onAgentChange","agentFound","filter","areAllSelected","every","getDropdownHeaderText","fetchAgents_http","assign","fetchContent_http","conversationId","documentContent","status","fetchEditorContent","markdown","marked.parse","prepareHtml","lang","code","escapedCode","escapeHtml","copyToClipboard","clipboard","writeText","alert","toggleCollapse","toggleCollapseGraph","toggleCollapseFGraph","getDomainName","URL","hostname","getFaviconUrl","onCardClick","sources","sourcesDrawer","openOuterEditor","onCloseEditor","onDrawerClosed","onCloseSource","toggleDrawer","todo","updateButtonVisibility","openLinkInNewTab","window","adjustTextareaHeight","target","overflowY","toggleWorkflows","checkForCop29BotId","orgWorkflows","isWorkflowOpen","selectedWorkflow","openWorkflowInput","initializeForm","formControls","Trigger","InputSchema","InputId","Value","Required","Validators","required","workflowForm","group","onWorkflowSelected","workflow","onWorkflowSubmit","valid","generateMarkdown","showWorkflowExecutionLoader","Inputs","workflowInputs","WorkflowName","workflowId","workflow_inputs","user_question","user_id","title","obj","key_label","this_1","Label","entries","_j","_k","showWorkflowHistoryDetails","showWorkflowExecutionDetails","InsertTimeStamp","closeModal","objectToArray","keys","startNewConversation","speechConfig","SpeechSDK.SpeechConfig","fromAuthorizationToken","audioConfig","SpeechSDK.AudioConfig","fromDefaultMicrophoneInput","recognizer","SpeechSDK.SpeechRecognizer","recognizing","reason","SpeechSDK.ResultReason","RecognizingSpeech","recognized","RecognizedSpeech","toggleRecording","canceled","errorDetails","sessionStopped","stopContinuousRecognitionAsync","isRecording","startRecognition","stopRecognition","startContinuousRecognitionAsync","getLatestTime","toLocaleTimeString","Component","selector","template","changeDetection","ChangeDetectionStrategy","OnPush","FormBuilder","ChangeDetectorRef","DomSanitizer","Renderer2","ViewChild","ViewChildren","static","Input","Output","ChatBotComponent","visible","toggle","SafeHtmlPipe","transform","Pipe","name","VideoPlayerComponent","el","isMuted","isFullscreen","isFullscreenvideoPlaying","toggleSound","video","muted","togglePlay","playState","videoEl","videoObj","isPlaying","play","pause","innerWidth","observer","IntersectionObserver","isIntersecting","threshold","observe","toggleFullscreen","fullscreenvideo","toggleFullscreenPlay","followUser","checkPendingSentRequest","myPendingSentRequests","canUnfollowUser","canFollowUser","getIniNames","firstName","lastName","charAt","toUpperCase","Inject","DOCUMENT","BotHtmlEditorComponent","documentName","quillConfig","toolbar","header","font","list","filldataInForm","editorContent","saveContent","saveContent_http","updateContent_http","put","NgModule","declarations","imports","CommonModule","MatIconModule","MatSidenavModule","FormsModule","QuillModule","exports"],"mappings":"4nCAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOC,OAAOK,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,MAC3EN,EAAGC,aAGZS,EAAUV,EAAGC,GACzB,GAAiB,mBAANA,GAA0B,OAANA,EAC3B,MAAM,IAAIU,UAAU,uBAAyBC,OAAOX,GAAK,iCAE7D,SAASY,IAAOC,KAAKC,YAAcf,EADnCD,EAAcC,EAAGC,GAEjBD,EAAEO,UAAkB,OAANN,EAAaC,OAAOc,OAAOf,IAAMY,EAAGN,UAAYN,EAAEM,UAAW,IAAIM,GA4HtDX,OAAOc,gBAgBpB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cesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","const formatHoursAndMinutes = (date: Date) => {\r\n let hours = date.getHours() % 12;\r\n const minutes = date.getMinutes();\r\n const amPm = date.getHours() < 12 ? 'AM' : 'PM';\r\n if(hours === 0) hours = 12;\r\n\r\n const formattedHours = hours < 10 ? `0${hours}` : hours;\r\n const formattedMinutes = minutes < 10 ? `0${minutes}` : minutes;\r\n\r\n return `${formattedHours}:${formattedMinutes} ${amPm}`;\r\n};\r\n\r\nexport const formatNow = (timezone?: string) => {\r\n const now = new Date();\r\n if (timezone) {\r\n const options: any = {\r\n hour12: true,\r\n hour: 'numeric',\r\n minute: 'numeric',\r\n timeZone: timezone,\r\n };\r\n return now.toLocaleString('en-US', options);\r\n }\r\n return formatHoursAndMinutes(now);\r\n};\r\n\r\nexport const formatTimeStamps = (timezone: string, timestamps: any) => {\r\n const date = new Date(timestamps + 'Z');\r\n\r\n const options: any = {\r\n hour12: true,\r\n hour: 'numeric',\r\n minute: 'numeric',\r\n timeZone: timezone,\r\n };\r\n return date.toLocaleString('en-US', options);\r\n};\r\n","\r\n\r\nexport const prod_environment = {\r\n USERS_API: 'https://es-user.social27.com/api',\r\n BASE_URL: 'https://agent-api.hivegpt.ai',\r\n AGENTS_API: 'https://hive-ai.social27.com/api',\r\n API_KEY: 'b621eb3f-0bd2-41d5-a48c-a8f8ab7d38f8',\r\n SocketUrl: 'https://notif-v2-ws.social27.com/'\r\n}\r\n\r\nexport const dev_environment = {\r\n USERS_API: 'https://pre-user.social27.com/api',\r\n BASE_URL: 'https://agent-api.hivegpt.ai',\r\n AGENTS_API: 'https://hive-ai.social27.com/api',\r\n API_KEY: 'b621eb3f-0bd2-41d5-a48c-a8f8ab7d38f8',\r\n SocketUrl: 'https://notif-v2-ws.social27.com/'\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { Observable, Subject } from 'rxjs';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class ConversationService {\r\n private storageKey = 'conversationKey';\r\n\r\n constructor() { }\r\n generateKey(): string {\r\n const timestamp = Math.floor(new Date().getTime() / 1000).toString(16);\r\n const randomHex = 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, () => {\r\n return Math.floor(Math.random() * 16).toString(16);\r\n });\r\n return timestamp + randomHex;\r\n }\r\n\r\n getKey(botId: string, resetKey: boolean = false): string {\r\n const storageKey = `conversationKey_${botId}`;\r\n var value = localStorage.getItem(storageKey);\r\n\r\n if (!value || resetKey) {\r\n value = this.generateKey();\r\n localStorage.setItem(storageKey, value);\r\n }\r\n\r\n return value;\r\n }\r\n\r\n private userSepecificNotification: Subject<any> = new Subject<any>();\r\n sendValidatedUserData(message: any) {\r\n //console.log('lgging messages', message, new Date());\\\r\n\r\n this.userSepecificNotification.next(message);\r\n }\r\n getUserSpecificNotification(): Observable<any> {\r\n return this.userSepecificNotification.asObservable();\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { Socket, SocketIoConfig } from 'ngx-socket-io';\r\nimport { prod_environment } from '../../environments/environment';\r\n\r\n@Injectable({\r\n providedIn: 'root' // This ensures the service is available across the application\r\n})\r\nexport class NotificationSocket extends Socket {\r\n constructor() {\r\n super(socketConfig);\r\n\r\n // Log connection status\r\n this.on('connect', () => {\r\n console.log('Socket connected');\r\n });\r\n\r\n this.on('disconnect', () => {\r\n console.warn('Socket disconnected');\r\n });\r\n\r\n this.on('connect_error', (err) => {\r\n console.error('Socket connection error:', err);\r\n });\r\n }\r\n}\r\n\r\nconst socketConfig: SocketIoConfig = {\r\n url: prod_environment.SocketUrl,\r\n options: {\r\n transports: ['websocket', 'polling'],\r\n reconnection: true,\r\n autoConnect: true,\r\n upgrade: true,\r\n reconnectionDelay: 1000,\r\n reconnectionDelayMax: 5000,\r\n reconnectionAttempts: Infinity\r\n }\r\n};","import { Injectable } from '@angular/core';\r\n\r\nimport { Observable, Subject } from 'rxjs';\r\nimport { webSocket, WebSocketSubject } from 'rxjs/webSocket';\r\nimport { ConversationService } from './conversation.service';\r\nimport { NotificationSocket } from './NotificationSocket';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class SocketService {\r\n public testMessage: string;\r\n private isCommonSocketInitialized = false;\r\n private isUserSpecificSocketInitialized = false;\r\n private isUserSpecificEventReleased = true;\r\n private messageQueue: any[] = [];\r\n private releaseInterval = 1000;\r\n private intervalSetup: boolean = false;\r\n\r\n constructor(\r\n private conversationService: ConversationService,\r\n private notificationSocket: NotificationSocket\r\n ) {\r\n this.startReleasingMessages();\r\n }\r\n\r\n isSocketInitialized(isCommon: boolean) {\r\n return isCommon\r\n ? this.isCommonSocketInitialized\r\n : this.isUserSpecificSocketInitialized &&\r\n !this.isUserSpecificEventReleased;\r\n }\r\n\r\n disconnectSocketConnection() {\r\n this.notificationSocket.disconnect();\r\n }\r\n connectSocketConnection() {\r\n this.notificationSocket.connect();\r\n }\r\n registerUserSpecificHiveSocket(botId: string, conversation_id: string, org_id: string) {\r\n const commonNotification = 'commonNotification';\r\n const groupId = `Hive_AI_Notifs_${botId}_${conversation_id}`;\r\n const groupId_org = `Hive_AI_Notifs_${org_id}`;\r\n\r\n // Remove any pre-existing listeners for commonNotification\r\n // this.notificationSocket.removeAllListeners(commonNotification);\r\n\r\n // Join the group again with updated botId and conversation_id\r\n this.notificationSocket.emit('joinData', { groupId });\r\n this.notificationSocket.emit('joinData', { groupId: groupId_org });\r\n\r\n // Re-register for common notifications\r\n this.notificationSocket.fromEvent(commonNotification).subscribe(\r\n (res) => {\r\n console.log('Received commonNotification:', res);\r\n this.conversationService.sendValidatedUserData(res);\r\n },\r\n (error) => {\r\n console.error('Error receiving commonNotification:', error);\r\n }\r\n );\r\n }\r\n\r\n private startReleasingMessages() {\r\n if (!this.intervalSetup) {\r\n setInterval(() => {\r\n if (this.messageQueue.length > 0) {\r\n const message = this.messageQueue.shift(); // Remove the first message from the queue\r\n // Handle the message here, e.g., send it to the server or process it\r\n console.log('Releasing message from queue:', message);\r\n // this.campaignService.sendValidatedUserData(message);\r\n }\r\n }, this.releaseInterval);\r\n this.intervalSetup = true; // Prevents multiple intervals\r\n }\r\n }\r\n}\r\n","import { HttpClient, HttpParams } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { catchError, map } from 'rxjs/operators';\r\n\r\nimport { HttpHeaders } from '@angular/common/http';\r\nimport { Observable, Subject, throwError } from 'rxjs';\r\nimport { AnyRecord } from 'dns';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class BotsService {\r\n eventDescription = new Subject();\r\n bot_api = 'https://agent-api.hivegpt.ai/';\r\n constructor(private http: HttpClient) { }\r\n\r\n fetchSpeechAuthorizationToken(botId, apiKey) {\r\n const headers = new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n 'x-api-key': apiKey,\r\n 'hive-bot-id': botId\r\n });\r\n\r\n const apiUrl = `${this.bot_api}speech/issue_token`;\r\n const url = `${apiUrl}`;\r\n return this.http.get(url, {headers}).pipe(\r\n map((resp: any) => {\r\n return resp.token;\r\n })\r\n );\r\n }\r\n\r\n getWorkflowsByOrgId(orgId: string): Observable<any> {\r\n const apiUrl = `${this.bot_api}workflows`;\r\n const url = `${apiUrl}?org_id=${orgId}`;\r\n return this.http.get(url).pipe(\r\n map((resp: any) => {\r\n return resp;\r\n })\r\n );\r\n }\r\n\r\n getWorkflowExecutionById(executionId: string): Observable<any> {\r\n const apiUrl = `${this.bot_api}workflows/execution/${executionId}`;\r\n return this.http.get(apiUrl).pipe(\r\n map((resp: any) => {\r\n return resp;\r\n })\r\n );\r\n }\r\n}","// import { Platform } from '@angular/cdk/platform';\r\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport {\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n HostListener,\r\n Input,\r\n OnChanges,\r\n OnInit,\r\n Output,\r\n QueryList,\r\n Renderer2,\r\n SimpleChanges,\r\n ViewChild,\r\n ViewChildren,\r\n} from '@angular/core';\r\nimport { MatDrawer } from '@angular/material/sidenav';\r\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\r\nimport { of, Subscription } from 'rxjs';\r\nimport { catchError, switchMap } from 'rxjs/operators';\r\nimport { formatNow, formatTimeStamps } from '../../utils/utils';\r\nimport {\r\n dev_environment,\r\n prod_environment,\r\n} from '../../../environments/environment';\r\nimport { ConversationService } from '../conversation.service';\r\nimport { Observable } from 'rxjs';\r\nimport { SocketService } from '../socket-service.service';\r\n\r\nimport { FormBuilder, Validators } from '@angular/forms';\r\nimport * as SpeechSDK from 'microsoft-cognitiveservices-speech-sdk';\r\nimport { BotsService } from '../bot.service';\r\nimport * as marked from 'marked'; // Import marked\r\n\r\n@Component({\r\n selector: 'hivegpt-chat-drawer-package',\r\n templateUrl: './chat-drawer.component.html',\r\n styleUrls: ['./chat-drawer.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class ChatDrawerComponent implements OnInit, OnChanges {\r\n @ViewChild('chatMain') private chatMain: ElementRef;\r\n @ViewChild('myInput') private myInput: ElementRef;\r\n @ViewChildren('closeplaygroundbutton')\r\n closePlaygroundButtons: QueryList<ElementRef>;\r\n @ViewChild('drawer') drawer!: MatDrawer;\r\n @ViewChild('sourcesDrawer') sourcesDrawer!: MatDrawer;\r\n @ViewChild('editorsDrawer') editorsDrawer!: MatDrawer;\r\n private bodyOverflowClass = 'body-overflow-hidden';\r\n @ViewChild('myTextarea', { static: false })\r\n myTextarea!: ElementRef<HTMLTextAreaElement>; // Reference to the textarea\r\n isCollapsedTrue = false;\r\n @Input() copilotName: string = 'HiveXGPT';\r\n @Input() firstName!: string;\r\n @Input() lastName!: string;\r\n @Input() apiKey!: string;\r\n @Input() bgBubbleAi!: string;\r\n @Input() bgBubbleUser!: string;\r\n @Input() bgGradient!: string[];\r\n @Input() botName!: string;\r\n @Input() botSkills!: string;\r\n @Input() botId!: string;\r\n @Input() orgId!: string;\r\n @Input() closeButtonColor!: string;\r\n @Input() closeButtonbgColor!: string;\r\n @Input() credentials!: [];\r\n @Input() dateTimeColor!: string;\r\n @Input() dateTextColor!: string;\r\n @Input() eventId!: string;\r\n @Input() s27Token!: string;\r\n @Input() eventName!: string;\r\n @Input() botIcon!: string;\r\n @Input() formFieldBgColor!: string;\r\n @Input() formFieldTextColor!: string;\r\n @Input() fullView!: boolean;\r\n @Input() gradientColors!: string[];\r\n @Input() greeting!: string;\r\n @Input() messageTextColorAi!: string;\r\n @Input() messageTextColorUser!: string;\r\n @Input() rules!: string;\r\n @Input() sendButtonColor!: string;\r\n @Input() sendButtonTextColor!: string;\r\n @Input() showClose!: boolean;\r\n @Input() thumbsDownMessages!: string[];\r\n @Input() thumbsUpMessage!: string;\r\n @Input() timezone!: string;\r\n @Input() unknownResponses!: [];\r\n @Input() useOpenAi!: boolean;\r\n @Input() userId!: string;\r\n @Input() isDev!: boolean;\r\n\r\n @Input() againButtonColor!: string[];\r\n @Input() againButtonTextColor!: string[];\r\n @Output() feedbackEvent = new EventEmitter<string>();\r\n @Output() onCloseEvent = new EventEmitter<void>();\r\n @Output() openPage = new EventEmitter<any>();\r\n @Output() sessionActions = new EventEmitter<any>();\r\n @Output() closeBot = new EventEmitter<any>();\r\n @Output() connectWithUser = new EventEmitter<any>();\r\n @Output() scheduleMeeting = new EventEmitter<string>();\r\n @Output() refreshToken = new EventEmitter<any>();\r\n\r\n autogenKey = 'Autogen_eDJTtEU-NB0RtIpzq1w';\r\n addToMyAgendaAction = 'add_to_my_agenda';\r\n myUpcomingSessionAction = 'my_upcomming_session';\r\n connectOrFollowAction = 'connect_or_follow';\r\n aiResponse: string = '';\r\n chatLog: any[] = [];\r\n decoder = new TextDecoder();\r\n feedbackDone: boolean = false;\r\n greetingMsg: string = '';\r\n hasBackdropValue: boolean = false;\r\n input: string = '';\r\n listenerAdded = false;\r\n loading: boolean = false;\r\n mode: string = 'over';\r\n quickPrompts: any[] = [];\r\n thumbsDownMsgIndex = 0;\r\n userName: string = '';\r\n showStartAgain: boolean = false;\r\n isIOSDevice: boolean = false;\r\n showFeedBackIconsIndex: number | null = null;\r\n temperature: number = 1;\r\n speakers = [];\r\n environment: {\r\n USERS_API;\r\n BASE_URL;\r\n AGENTS_API;\r\n };\r\n pendingRequests: any;\r\n myConnections: any;\r\n conversationKey: string;\r\n isFetchDataFor: boolean;\r\n is401: boolean;\r\n msg: any;\r\n chat: any;\r\n isWorkflowOpen: boolean;\r\n orgWorkflows: any;\r\n openWorkflowInput: boolean;\r\n selectedWorkflow: any;\r\n workflowForm: any;\r\n currentWorkflowActionProgress: number = 0;\r\n currentWorkflowAction: string = '';\r\n executingWorkflow: boolean;\r\n workflowExecutionDetails: any;\r\n showWorkflowExecutionDetails: any;\r\n currentWorkflowExecutionDetails: any;\r\n\r\n speechConfig: SpeechSDK.SpeechConfig;\r\n recognizer: SpeechSDK.SpeechRecognizer;\r\n recognizedText: string = '';\r\n authorizationToken: string = '';\r\n region: string = 'westeurope'; // Set your Azure region here\r\n isRecording: boolean;\r\n\r\n constructor(\r\n private fb: FormBuilder,\r\n private botService: BotsService,\r\n private cdr: ChangeDetectorRef,\r\n private http: HttpClient,\r\n private sanitizer: DomSanitizer,\r\n private elementRef: ElementRef,\r\n private renderer: Renderer2,\r\n private socketService: SocketService,\r\n private conversationService: ConversationService // private platform: Platform\r\n ) {\r\n this.chatMain = new ElementRef(null);\r\n\r\n // if (this.platform.IOS) {\r\n // this.isIOSDevice = true;\r\n // }\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (changes.s27Token) {\r\n if (changes.s27Token.currentValue != changes.s27Token.previousValue) {\r\n this.s27Token = changes.s27Token.currentValue;\r\n\r\n console.log('isFetchDataFor: ', this.isFetchDataFor);\r\n console.log('msg: ', this.msg);\r\n console.log('chat: ', this.chat);\r\n if (this.is401) {\r\n if (this.isFetchDataFor) {\r\n this.fetchDataFor(this.msg, this.chat);\r\n } else {\r\n this.fetchData(this.msg);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (changes.orgId) {\r\n if (\r\n changes.orgId.currentValue != changes.orgId.previousValue &&\r\n changes.orgId.currentValue\r\n ) {\r\n this.initializeSocket();\r\n\r\n }\r\n }\r\n }\r\n\r\n ngOnInit(): void {\r\n this.environment = this.isDev ? dev_environment : prod_environment;\r\n\r\n // this.fetchMyConnections().subscribe();\r\n // this.fetchPendingRequests().subscribe();\r\n\r\n this.changeTemperature(this.temperature);\r\n this.fetchBotConfig().subscribe(\r\n (res) => {\r\n this.cdr.markForCheck();\r\n\r\n this.fetchChatHistory().subscribe(\r\n (response) => {\r\n this.loading = false;\r\n this.mapChatHistory(response);\r\n this.cdr.markForCheck();\r\n },\r\n (err) => {\r\n console.error('Error fetching chat history:', err);\r\n }\r\n );\r\n },\r\n (err) => {\r\n console.error('Error fetching chat history:', err);\r\n }\r\n );\r\n // this.fetchAgents();\r\n // this.fetchEditorContent();\r\n this.cdr.markForCheck();\r\n // this.initializeSocket();\r\n this.botService.fetchSpeechAuthorizationToken(this.botId, this.apiKey).subscribe((token) => {\r\n this.authorizationToken = token;\r\n this.initializeSpeechRecognizer(token);\r\n });\r\n }\r\n\r\n private eventSubscription: Subscription;\r\n initializeSocket() {\r\n try {\r\n this.socketService.disconnectSocketConnection();\r\n } catch (error) { }\r\n setTimeout(() => {\r\n this.socketService.connectSocketConnection();\r\n setTimeout(() => {\r\n console.log('YES INIT');\r\n const conversation_id = this.conversationService.getKey(this.botId);\r\n\r\n this.socketService.registerUserSpecificHiveSocket(\r\n this.botId,\r\n conversation_id,\r\n this.orgId\r\n );\r\n setTimeout(() => {\r\n this.listenSockets();\r\n }, 300);\r\n }, 200);\r\n }, 300);\r\n }\r\n\r\n subscriptionNew: any;\r\n socketData: any;\r\n\r\n listenSockets() {\r\n if (this.eventSubscription) {\r\n this.eventSubscription.unsubscribe();\r\n }\r\n console.log('Listen Socket');\r\n this.eventSubscription = this.conversationService\r\n .getUserSpecificNotification()\r\n .subscribe(\r\n (res) => {\r\n console.log('Listen Socket response');\r\n console.log(res);\r\n // Check if OtherFields exists in the response\r\n if (res?.m?.OtherFields?.workflow_id) {\r\n const {\r\n percentage,\r\n output,\r\n action_name,\r\n current_action_name,\r\n workflow_execution_id,\r\n time_stamp,\r\n } = res?.m?.OtherFields;\r\n\r\n this.currentWorkflowActionProgress = percentage;\r\n this.currentWorkflowAction = action_name;\r\n\r\n const actionIndex = this.workflowExecutionDetails.Actions.findIndex(\r\n (a) => a.Name == current_action_name\r\n );\r\n\r\n if (actionIndex !== -1) {\r\n this.workflowExecutionDetails.Actions[actionIndex][\r\n 'Output'\r\n ] = output;\r\n this.workflowExecutionDetails.Actions[actionIndex][\r\n 'InsertTimeStamp'\r\n ] = formatTimeStamps(this.timezone, time_stamp);\r\n } else {\r\n console.error(`Action with name ${action_name} not found`);\r\n }\r\n\r\n this.currentWorkflowExecutionDetails = this.workflowExecutionDetails;\r\n\r\n if (this.currentWorkflowActionProgress == 100) {\r\n this.chatLog[this.chatLog.length - 1][\r\n 'WorkflowExecutionId'\r\n ] = workflow_execution_id;\r\n this.isChatingWithAi = false;\r\n this.executingWorkflow = false;\r\n }\r\n\r\n this.cdr.detectChanges();\r\n } else if (res?.m?.OtherFields) {\r\n const {\r\n conversation_id,\r\n bot_id,\r\n message_id,\r\n answer,\r\n web_results,\r\n search_results,\r\n graphs,\r\n execution_graphs,\r\n suggestions,\r\n } = res?.m?.OtherFields;\r\n console.log('message_id1');\r\n console.log(res?.m?.OtherFields);\r\n var currentChatMessage = this.chatLog.find(\r\n (p) => p._id == message_id\r\n );\r\n console.log(this.chatLog);\r\n if (!currentChatMessage) {\r\n console.log('message_id2');\r\n console.log(message_id);\r\n currentChatMessage = {\r\n _id: message_id,\r\n type: 'ai',\r\n time: formatNow(this.timezone),\r\n };\r\n\r\n this.chatLog.push(currentChatMessage);\r\n\r\n this.showFeedBackIconsIndex = this.chatLog.length - 1;\r\n console.log('message_id3');\r\n console.log(message_id);\r\n this.cdr.detectChanges();\r\n }\r\n\r\n // Handle the fields based on their presence\r\n if (search_results && Array.isArray(search_results)) {\r\n console.log('Online Search Terms:', search_results);\r\n currentChatMessage.searchTerms = search_results;\r\n this.cdr.detectChanges();\r\n }\r\n\r\n if (web_results && Array.isArray(web_results)) {\r\n console.log('Web Results:', web_results);\r\n currentChatMessage.sourcesList = web_results;\r\n currentChatMessage.displayedSources = web_results?.slice(0, 3); // First 3 cards\r\n currentChatMessage.remainingSources = web_results?.slice(3); // Remaining items\r\n this.cdr.detectChanges();\r\n }\r\n\r\n if (answer) {\r\n this.isChatingWithAi = false;\r\n console.log('Answer:', answer);\r\n\r\n currentChatMessage.message = this.processMessageForDisplay(\r\n answer\r\n );\r\n this.cdr.detectChanges();\r\n this.scrollToBottom();\r\n }\r\n\r\n if (graphs && Array.isArray(graphs)) {\r\n console.log('Graphs:', graphs);\r\n currentChatMessage.graphs = graphs;\r\n this.cdr.detectChanges();\r\n }\r\n\r\n if (execution_graphs && Array.isArray(execution_graphs)) {\r\n console.log('Execution Graphs:', execution_graphs);\r\n currentChatMessage.executionGraphs = execution_graphs;\r\n this.cdr.detectChanges();\r\n }\r\n\r\n if (suggestions && Array.isArray(suggestions)) {\r\n console.log('suggestions:', suggestions);\r\n currentChatMessage.relatedListItems = suggestions;\r\n this.cdr.detectChanges();\r\n // Process online search terms as needed\r\n }\r\n\r\n // Add any other fields and their processing here\r\n } else {\r\n console.warn('OtherFields is missing in the response');\r\n }\r\n },\r\n (err) => {\r\n this.eventSubscription.unsubscribe();\r\n console.error('Error in fetching data from socket', err);\r\n }\r\n );\r\n }\r\n\r\n initializeSocketAndListen() { }\r\n handleEvent(data: any, type: string) {\r\n switch (type) {\r\n case 'webresult':\r\n break;\r\n case 'answer':\r\n break;\r\n case 'graph':\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n ngOnDestroy(): void {\r\n if (this.eventSubscription) {\r\n this.eventSubscription.unsubscribe();\r\n }\r\n this.socketService.disconnectSocketConnection();\r\n //this.socketService.close();\r\n }\r\n changeTemperature(newTemperature: number) {\r\n if (this.loading) return;\r\n this.temperature = newTemperature;\r\n const wrapper = document.querySelector('.hivegpt-chat-wrapper');\r\n // Remove existing theme classes from body\r\n wrapper?.classList.remove('creative', 'balanced', 'precise');\r\n\r\n switch (newTemperature) {\r\n case 0:\r\n wrapper?.classList.add('creative');\r\n break;\r\n case 1:\r\n wrapper?.classList.add('balanced');\r\n break;\r\n case 2:\r\n wrapper?.classList.add('precise');\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n onStartAgain() {\r\n if (this.loading) return;\r\n this.showStartAgain = false;\r\n this.chatLog = [];\r\n this.chatLog.push({\r\n type: 'ai',\r\n message: this.greetingMsg,\r\n\r\n time: formatNow(this.timezone),\r\n });\r\n this.archieveMessages().subscribe();\r\n }\r\n\r\n archieveMessages() {\r\n const headers = new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n 'x-api-key': this.apiKey,\r\n 'hive-bot-id': this.botId\r\n });\r\n const url = `${this.environment.BASE_URL}/bot/clear-history/${this.botId}/${this.userId}`;\r\n return this.http.post(url, { headers }).pipe(\r\n switchMap((res: any) => {\r\n return of(res);\r\n }),\r\n catchError((error) => {\r\n return of(null);\r\n })\r\n );\r\n }\r\n\r\n fetchBotConfig() {\r\n this.loading = true;\r\n const headers = new HttpHeaders({\r\n 'x-api-key': this.apiKey,\r\n 'hive-bot-id': this.botId\r\n });\r\n const url = `${this.environment.BASE_URL}/bots?bot_id=${this.botId}`;\r\n return this.http.get(url, { headers }).pipe(\r\n switchMap((res: any) => {\r\n this.botName = res.Name;\r\n this.botIcon = res.Icon;\r\n this.botSkills = res?.Skills;\r\n this.greetingMsg = res.Greeting;\r\n\r\n this.thumbsDownMessages = res?.NegativeResponses?.length\r\n ? res.NegativeResponses\r\n : [\r\n \"We are sorry we've not been able to answer your question.<br/> However, our dedicated support team is happy to help. <span class='feedback-link' style='cursor: pointer; text-decoration: underline; font-weight: 700; color: #17235B;'><a href='mailto:support@social27.com' style='color: inherit; text-decoration: none;'>Please click here</a></span> and a human agent will assist you as soon as possible\",\r\n ];\r\n this.quickPrompts = res.QuickPrompts;\r\n this.cdr.markForCheck();\r\n this.loading = false;\r\n return of(res);\r\n }),\r\n catchError((error) => {\r\n console.error('Error fetching chatbot config: ', error);\r\n this.loading = false;\r\n return of(null);\r\n })\r\n );\r\n }\r\n\r\n fetchChatHistory(): Observable<any> {\r\n this.loading = true;\r\n\r\n this.conversationKey = this.conversationService.getKey(this.botId, false);\r\n const url = `${this.environment.BASE_URL}/conversations/${this.conversationKey}`;\r\n const headers = new HttpHeaders({\r\n accept: 'application/json',\r\n 'x-api-key': this.apiKey,\r\n 'hive-bot-id': this.botId\r\n });\r\n\r\n return this.http\r\n .get(url, { headers })\r\n .pipe(catchError(this.handleError<any>('fetchConversation')));\r\n }\r\n\r\n private handleError<T>(operation = 'operation', result?: T) {\r\n return (error: any): Observable<T> => {\r\n console.error(`${operation} failed: ${error.message}`);\r\n return of(result as T);\r\n };\r\n }\r\n // fetchChatHistory() {\r\n // this.loading = true;\r\n // const headers = new HttpHeaders({\r\n // 'Content-Type': 'application/json',\r\n // 'x-api-key': this.apiKey,\r\n // });\r\n // return this.http\r\n // .get(`${this.environment.BASE_URL}/conversations/${this.conversationKey}`, { headers })\r\n // .pipe(\r\n // switchMap((res: any) => {\r\n // this.loading = false;\r\n // return of(res);\r\n // }),\r\n // catchError((error: any) => {\r\n // console.error('Error fetching chat history: ', error);\r\n // this.loading = false;\r\n // return of(null);\r\n // })\r\n // );\r\n // }\r\n\r\n mapChatHistory(chats: any) {\r\n this.chatLog.push({\r\n type: 'ai',\r\n message: this.greetingMsg,\r\n time: formatNow(this.timezone),\r\n });\r\n if (chats && chats?.Messages?.length) {\r\n chats?.Messages.forEach((chat: any) => {\r\n if (chat.Type == 'user') {\r\n this.chatLog.push({\r\n type: 'user',\r\n message: this.processMessageForDisplay(chat.Text),\r\n time: formatTimeStamps(this.timezone, chat.InsertTimestamp),\r\n copied: false,\r\n isCollapsedTrue: false,\r\n WorkflowExecutionId: chat.WorkflowExecutionId,\r\n _id: chat._id\r\n });\r\n }\r\n if (chat.Type == 'ai') {\r\n var sourcesList = chat.WebLinks || [];\r\n var displayedSources = chat.WebLinks.slice(0, 3); // First 3 cards\r\n var remainingSources = chat.WebLinks.slice(3); // Remaining items\r\n\r\n this.chatLog.push({\r\n type: 'ai',\r\n message: this.processMessageForDisplay(chat.Text),\r\n executionGraphs: chat.ExecutionGraphs,\r\n graphs: chat.Graphs,\r\n searchTerms: chat.SearchTerms,\r\n sourcesList: sourcesList,\r\n displayedSources: displayedSources,\r\n remainingSources: remainingSources,\r\n time: formatTimeStamps(this.timezone, chat.InsertTimestamp),\r\n copied: false,\r\n isCollapsedTrue: false,\r\n _id: chat._id\r\n });\r\n this.showFeedBackIconsIndex = this.chatLog.length - 1;\r\n }\r\n });\r\n this.showStartAgain = true;\r\n }\r\n this.scrollToBottom();\r\n this.cdr.markForCheck();\r\n }\r\n\r\n processMessage(message: string): SafeHtml {\r\n if (!message || !(message?.length > 0)) {\r\n return '';\r\n }\r\n\r\n // console.log('here is my message')\r\n // console.log(message);\r\n\r\n message = message.trim();\r\n\r\n const markdownLinkRegex = /\\[([^[]+)]\\(([^)]+)\\)/g;\r\n const urlRegex = /(?<!href=\")\\bhttps?:\\/\\/\\S+(?<![.,])/gi;\r\n\r\n if (markdownLinkRegex.test(message)) {\r\n const html = message.replace(\r\n markdownLinkRegex,\r\n '<a href=\"$2\" target=\"_blank\">$1</a>'\r\n );\r\n //console.log('Sanitized message: ', message);\r\n return this.sanitizeHtml(html);\r\n }\r\n\r\n if (urlRegex.test(message)) {\r\n const html = message.replace(\r\n urlRegex,\r\n '<a href=\"$&\" target=\"_blank\">$&</a>'\r\n );\r\n // console.log('Sanitized message: ', message);\r\n return this.sanitizeHtml(html);\r\n }\r\n\r\n message = message.replace(/(?:\\r\\n|\\r|\\n)/g, '<br>');\r\n\r\n message = message.replace(/\\*\\*(.*?)\\*\\*/g, '<strong>$1</strong>');\r\n // Convert Markdown headers to HTML headers\r\n message = message.replace(/^(#{1,6})\\s+(.*)$/gm, (match, hashes, text) => {\r\n const level = hashes.length;\r\n return `<h${level}>${text}</h${level}>`;\r\n });\r\n\r\n this.cdr.markForCheck();\r\n const sanitizedMessage = this.sanitizeHtml(message);\r\n return sanitizedMessage;\r\n }\r\n\r\n ngAfterViewChecked() {\r\n const feedbackLinks = this.elementRef.nativeElement.querySelectorAll(\r\n '.feedback-link'\r\n );\r\n feedbackLinks.forEach((link: any) => {\r\n link.addEventListener(\r\n 'click',\r\n this.onFeedbackClick.bind(this, 'zendesk')\r\n );\r\n });\r\n // if (this.elementRef.nativeElement.querySelector('.feedback-link')) {\r\n // this.elementRef.nativeElement\r\n // .querySelector('.feedback-link')\r\n // .addEventListener('click', this.onFeedbackClick.bind(this, 'zendesk'));\r\n // }\r\n }\r\n\r\n sanitizeHtml(html: string): SafeHtml {\r\n return this.sanitizer.bypassSecurityTrustHtml(html);\r\n }\r\n\r\n onFeedbackClick(value: string) {\r\n this.feedbackEvent.emit(value);\r\n }\r\n\r\n onClose() {\r\n this.renderer.removeClass(document.body, this.bodyOverflowClass);\r\n this.onCloseEvent.emit();\r\n }\r\n\r\n sendMessageWithTile(prompt: string) {\r\n this.input = prompt;\r\n this.fetchData();\r\n this.scrollToBottom();\r\n }\r\n isChatingWithAi = false;\r\n fetchData(msg = null) {\r\n this.input = msg || this.input?.trim();\r\n this.msg = this.input;\r\n if (!this.input || this.loading) {\r\n return;\r\n }\r\n\r\n this.chatLog.push({\r\n type: 'user',\r\n message: this.processMessageForDisplay(this.input),\r\n time: formatNow(this.timezone),\r\n copied: false,\r\n isCollapsedTrue: false,\r\n });\r\n\r\n try {\r\n const textarea = this.myInput.nativeElement;\r\n textarea.style.height = 'hidden'; // Reset the height\r\n textarea.style.height = `62px`;\r\n } catch (error) { }\r\n this.cdr.markForCheck();\r\n\r\n this.aiResponse = '';\r\n this.isChatingWithAi = true;\r\n\r\n this.makeAskRequest(this.input, this.agents, this.conversationKey);\r\n }\r\n fetchDataFor(msg, chat) {\r\n const inputMsg = msg?.trim();\r\n if (!inputMsg || this.loading) {\r\n return;\r\n }\r\n try {\r\n chat.relatedListItems = [];\r\n this.cdr.detectChanges();\r\n } catch (error) { }\r\n\r\n this.scrollToBottom();\r\n this.chatLog.push({\r\n type: 'user',\r\n message: this.processMessageForDisplay(inputMsg),\r\n time: formatNow(this.timezone),\r\n copied: false,\r\n isCollapsedTrue: false,\r\n });\r\n\r\n this.cdr.markForCheck();\r\n\r\n this.aiResponse = '';\r\n this.isChatingWithAi = true;\r\n\r\n this.makeAskRequest(inputMsg, this.agents, this.conversationKey, msg, chat);\r\n }\r\n fetchSmallTalk() {\r\n this.loading = true;\r\n this.cdr.markForCheck();\r\n\r\n const url = `${this.environment.BASE_URL}/bot/small-talk/${this.botId}/${this.userId}`;\r\n\r\n this.http\r\n .get<{ smallTalk: string }>(url, {\r\n headers: {\r\n 'x-api-key': this.apiKey,\r\n 'hive-bot-id': this.botId\r\n },\r\n })\r\n .pipe(\r\n catchError((error) => {\r\n console.error('Error while fetching small talk:', error);\r\n\r\n return of(null);\r\n })\r\n )\r\n .subscribe((response) => {\r\n this.loading = false;\r\n this.cdr.markForCheck();\r\n\r\n if (!response) {\r\n return;\r\n }\r\n\r\n if (response && response.smallTalk) {\r\n this.chatLog.push({\r\n type: 'ai',\r\n message: this.processMessage(response.smallTalk),\r\n time: formatNow(this.timezone),\r\n isFeedbackMsg: true,\r\n });\r\n this.showFeedBackIconsIndex = this.chatLog.length - 2;\r\n // this.scrollToBottom();\r\n this.cdr.markForCheck();\r\n }\r\n });\r\n }\r\n\r\n readAllChunks = (stream: any) => {\r\n const reader = stream.getReader();\r\n const allSuggestions: string[] = [];\r\n\r\n reader.closed.catch((err: any) => {\r\n if (err) {\r\n console.error('Error reading stream: ', err);\r\n }\r\n\r\n this.isChatingWithAi = false;\r\n this.scrollToBottom();\r\n return;\r\n });\r\n\r\n return new ReadableStream({\r\n start: (controller) => {\r\n return this.pump(controller, reader, allSuggestions);\r\n },\r\n });\r\n };\r\n\r\n pump(controller: any, reader: any, allSuggestions: string[]) {\r\n reader.read().then(({ done, value }: any) => {\r\n const lastItem = this.chatLog[this.chatLog.length - 1];\r\n\r\n if (done) {\r\n lastItem.message = this.processMessageForDisplay(lastItem.message);\r\n this.chatLog.pop();\r\n this.chatLog.push(lastItem);\r\n if (allSuggestions?.length) {\r\n this.chatLog.push({\r\n type: 'suggestions',\r\n suggestions: allSuggestions,\r\n });\r\n }\r\n\r\n controller.close();\r\n this.isChatingWithAi = false;\r\n // this.scrollToBottom();\r\n this.cdr.markForCheck();\r\n this.showStartAgain = true;\r\n\r\n // setTimeout(() => {\r\n // this.fetchSmallTalk();\r\n // },1000)\r\n return;\r\n }\r\n\r\n let decodedChunk = this.decoder.decode(value, { stream: true });\r\n this.aiResponse += decodedChunk;\r\n if (lastItem.type === 'ai') {\r\n const suggestionsMatch = this.aiResponse.match(/<sug>(.*?)<\\/sug>/g);\r\n if (suggestionsMatch) {\r\n suggestionsMatch.forEach((match) => {\r\n this.aiResponse = this.aiResponse.replace(match, '');\r\n allSuggestions.push(match?.replace(/<\\/?sug>/g, ''));\r\n });\r\n }\r\n\r\n lastItem.message = this.aiResponse;\r\n this.cdr.markForCheck();\r\n } else {\r\n this.isChatingWithAi = false;\r\n\r\n let aiFormattedData: any;\r\n\r\n try {\r\n console.log('parsing json ');\r\n aiFormattedData = JSON.parse(JSON.parse(this.aiResponse));\r\n } catch (e) {\r\n try {\r\n console.log('parsing json 2');\r\n aiFormattedData = JSON.parse(this.aiResponse);\r\n } catch (e) { }\r\n }\r\n\r\n console.log('parsing json done');\r\n\r\n if (aiFormattedData && aiFormattedData?.section_id?.length > 0) {\r\n if (\r\n aiFormattedData.section_id == 'company_search' ||\r\n aiFormattedData.section_id == 'user_search' ||\r\n aiFormattedData.section_id == 'industry_company_search'\r\n ) {\r\n this.fetchMyConnections().subscribe();\r\n this.fetchPendingRequests().subscribe();\r\n }\r\n\r\n if (aiFormattedData.section_id == this.myUpcomingSessionAction) {\r\n var speakerIds = [];\r\n aiFormattedData.content?.forEach((session) => {\r\n speakerIds = [...speakerIds, ...session.speakers];\r\n });\r\n\r\n if (speakerIds?.length > 0) this.getSpeakersByStaffIds(speakerIds);\r\n }\r\n\r\n if (\r\n aiFormattedData.section_id == this.addToMyAgendaAction &&\r\n aiFormattedData.content?.length > 0\r\n ) {\r\n this.openPage.next({\r\n sectionId: aiFormattedData.section_id,\r\n sessionIds: aiFormattedData.content,\r\n });\r\n }\r\n\r\n if (aiFormattedData.section_id == this.connectOrFollowAction) {\r\n let usersLen = aiFormattedData.content?.length;\r\n if (usersLen > 1) {\r\n this.openPage.next({\r\n sectionId: 'open_networking_drawer',\r\n search: aiFormattedData.content,\r\n });\r\n } else if (usersLen == 1) {\r\n this.openPage.next({\r\n sectionId: aiFormattedData.section_id,\r\n connetUserIds: [aiFormattedData.content[0].userId],\r\n });\r\n }\r\n }\r\n\r\n if (aiFormattedData.is_open_page == 'true') {\r\n this.openPage.next({\r\n sectionId: aiFormattedData.section_id,\r\n search: aiFormattedData.content,\r\n });\r\n\r\n if (this.isMobileBrowser()) {\r\n aiFormattedData.message +=\r\n '\\n\\n' + '<a id=\"closeBotNow\">Click Here</a> to see results.';\r\n }\r\n }\r\n\r\n this.chatLog.push({\r\n type: 'ai',\r\n message: aiFormattedData.message,\r\n action: aiFormattedData,\r\n time: formatNow(this.timezone),\r\n });\r\n\r\n if (this.isMobileBrowser()) {\r\n setTimeout(() => {\r\n this.addCloseBotClickEvent();\r\n }, 500);\r\n }\r\n\r\n this.aiResponse = '';\r\n } else {\r\n this.chatLog.push({\r\n type: 'ai',\r\n message: this.aiResponse,\r\n time: formatNow(this.timezone),\r\n });\r\n }\r\n\r\n this.showFeedBackIconsIndex = this.chatLog.length - 1;\r\n this.cdr.markForCheck();\r\n }\r\n\r\n this.scrollToBottom();\r\n\r\n // Enqueue the next data chunk into our target stream\r\n controller.enqueue(value);\r\n this.pump(controller, reader, allSuggestions);\r\n });\r\n }\r\n\r\n submitFeedback(flag: boolean, message) {\r\n console.log(message);\r\n\r\n this.feedbackDone = true;\r\n this.showFeedBackIconsIndex = null;\r\n const conversation_id = this.conversationService.getKey(this.botId);\r\n const url = `${this.environment.AGENTS_API}/Conversation/coPilot/${this.botId}/conversation/${conversation_id}/helpful-response`;\r\n fetch(url, {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'apiKey': 'Conversation_WIz/qAm+EEmfOkFaUA/weA==',\r\n 'hive-bot-id': this.botId\r\n },\r\n body: JSON.stringify({ messageId: message._id, isHelpful: flag }),\r\n }).then(() => {\r\n if (flag) {\r\n this.chatLog.push({\r\n type: 'ai',\r\n message:\r\n this.thumbsUpMessage ||\r\n `Great. May I assist you with anything else?`,\r\n time: formatNow(this.timezone),\r\n isFeedbackMsg: true,\r\n });\r\n\r\n this.scrollToBottom();\r\n this.cdr.markForCheck();\r\n this.feedbackDone = false;\r\n this.showFeedBackIconsIndex = null;\r\n return;\r\n }\r\n\r\n this.chatLog.push({\r\n type: 'ai',\r\n message: this.processMessage(\r\n this.thumbsDownMessages[this.thumbsDownMsgIndex]\r\n ),\r\n time: formatNow(this.timezone),\r\n isFeedbackMsg: true,\r\n });\r\n this.thumbsDownMsgIndex =\r\n (this.thumbsDownMsgIndex + 1) % this.thumbsDownMessages.length;\r\n this.scrollToBottom();\r\n this.cdr.markForCheck();\r\n this.feedbackDone = false;\r\n this.showFeedBackIconsIndex = null;\r\n });\r\n }\r\n handleKeydown(event: KeyboardEvent) {\r\n if (event.key === 'Enter' && !event.shiftKey) {\r\n // Prevent default behavior (new line)\r\n event.preventDefault();\r\n // Call your submit function\r\n this.handleSubmit(event);\r\n }\r\n }\r\n handleSubmit(event) {\r\n this.fetchData();\r\n this.scrollToBottom();\r\n\r\n }\r\n\r\n handleUpClick(idx: any) {\r\n if (this.feedbackDone) {\r\n return;\r\n }\r\n\r\n this.submitFeedback(true, this.chatLog[idx]);\r\n this.chatLog[idx].liked = !this.chatLog[idx].liked;\r\n\r\n if (this.chatLog[idx].unliked) {\r\n this.chatLog[idx].unliked = !this.chatLog[idx].unliked;\r\n }\r\n\r\n this.cdr.markForCheck();\r\n }\r\n\r\n handleDownClick(idx: any) {\r\n if (this.feedbackDone) return;\r\n this.submitFeedback(false, this.chatLog[idx]);\r\n this.chatLog[idx].unliked = !this.chatLog[idx].unliked;\r\n if (this.chatLog[idx].liked)\r\n this.chatLog[idx].liked = !this.chatLog[idx].liked;\r\n }\r\n // handleCopyClick(index: any) {\r\n // // Copy the message to the clipboard\r\n // const contentToCopy = this.chatLog[index].message;\r\n // console.log('contentToCopy');\r\n // console.log(contentToCopy);\r\n // navigator.clipboard.writeText(contentToCopy).then(() => {\r\n // // Indicate that the message was copied\r\n // this.chatLog[index].copied = true;\r\n // this.cdr.detectChanges();\r\n // // Reset the copied state after a delay\r\n // setTimeout(() => {\r\n // this.chatLog[index].copied = false;\r\n // this.cdr.detectChanges();\r\n // }, 2000); // Reset after 2 seconds\r\n // });\r\n // }\r\n copyText(id, index) {\r\n // Get the text element\r\n var textElement = document.getElementById(id);\r\n\r\n // Create a temporary textarea element to copy the text\r\n var tempTextArea = document.createElement('textarea');\r\n tempTextArea.value = textElement.innerText;\r\n\r\n // Append the textarea to the body (necessary for the execCommand to work)\r\n document.body.appendChild(tempTextArea);\r\n\r\n // Select the text inside the textarea\r\n tempTextArea.select();\r\n\r\n // Copy the text to the clipboard\r\n document.execCommand('copy');\r\n\r\n // Remove the temporary textarea\r\n document.body.removeChild(tempTextArea);\r\n\r\n // Optionally, you can alert the user or change the button text to indicate the copy was successful\r\n // alert('Text copied to clipboard!');\r\n\r\n this.chatLog[index].copied = true;\r\n this.cdr.detectChanges();\r\n // Reset the copied state after a delay\r\n setTimeout(() => {\r\n this.chatLog[index].copied = false;\r\n this.cdr.detectChanges();\r\n }, 2000); // Reset after 2 seconds\r\n }\r\n handleCopyClick(index: any) {\r\n // Copy the message to the clipboard\r\n const contentToCopy = this.chatLog[index].message;\r\n const resutlt = this.copyText('messageText_' + index, index);\r\n }\r\n\r\n sanitizeHTML(html: string): string {\r\n const doc = new DOMParser().parseFromString(html, 'text/html');\r\n\r\n // Create a new document fragment to hold the simplified content\r\n const fragment = document.createDocumentFragment();\r\n\r\n // Append the children of the body of the parsed document to the fragment\r\n Array.from(doc.body.childNodes).forEach((node) => {\r\n fragment.appendChild(node.cloneNode(true));\r\n });\r\n\r\n // Create a new div element to hold the simplified HTML\r\n const simplifiedDiv = document.createElement('div');\r\n simplifiedDiv.appendChild(fragment);\r\n\r\n // Remove complex tags or attributes as needed\r\n // Example: remove scripts\r\n simplifiedDiv\r\n .querySelectorAll('script')\r\n .forEach((script) => script.remove());\r\n\r\n // Return the simplified HTML as a string\r\n return simplifiedDiv.innerHTML;\r\n }\r\n\r\n currentMessageForEditor: any = '';\r\n currentIndexForEditor: any = -1;\r\n handleEditorClick(index: any) {\r\n if (this.currentIndexForEditor == -1) {\r\n this.currentIndexForEditor = index;\r\n this.currentMessageForEditor = this.sanitizeHTML(\r\n this.chatLog[index].message\r\n );\r\n this.currentMessageForEditor = this.currentMessageForEditor.replace(\r\n 'SafeValue must use [property]=binding:',\r\n ''\r\n );\r\n\r\n this.cdr.detectChanges();\r\n } else {\r\n if (this.currentIndexForEditor == index) {\r\n this.currentMessageForEditor += this.sanitizeHTML(\r\n this.chatLog[index].message\r\n );\r\n this.currentMessageForEditor = this.currentMessageForEditor.replace(\r\n 'SafeValue must use [property]=binding:',\r\n ''\r\n );\r\n this.cdr.detectChanges();\r\n } else {\r\n this.currentIndexForEditor = index;\r\n this.currentMessageForEditor = this.sanitizeHTML(\r\n this.chatLog[index].message\r\n );\r\n this.currentMessageForEditor = this.currentMessageForEditor.replace(\r\n 'SafeValue must use [property]=binding:',\r\n ''\r\n );\r\n this.cdr.detectChanges();\r\n }\r\n }\r\n this.chatLog[index].isEditor = true;\r\n this.cdr.detectChanges();\r\n // Reset the copied state after a delay\r\n setTimeout(() => {\r\n this.chatLog[index].isEditor = false;\r\n this.cdr.detectChanges();\r\n }, 2000); // Reset after 2 seconds\r\n this.editorsDrawer.open();\r\n const button = document.getElementById('botcloseplaygroundbutton');\r\n if (button) {\r\n button.style.display = 'none';\r\n }\r\n this.cdr.detectChanges();\r\n }\r\n scrollToBottom() {\r\n let counter = 0;\r\n const interval = setInterval(() => {\r\n this.chatMain.nativeElement.scrollTop = this.chatMain.nativeElement.scrollHeight;\r\n if (counter++ > 5) clearInterval(interval);\r\n }, 5);\r\n }\r\n\r\n handleAction(action: any) {\r\n console.info('incoming action from the chatbot AI');\r\n console.info(action);\r\n\r\n if (action?.content) {\r\n }\r\n }\r\n\r\n ngAfterViewInit() {\r\n // Check if the drawer is initially open and apply overflow hidden to body if so\r\n if (this.drawer.opened) {\r\n this.setBodyOverflow();\r\n }\r\n\r\n // Listen to changes in the drawer being opened or closed\r\n this.drawer.openedChange.subscribe((opened: boolean) => {\r\n if (opened) {\r\n this.setBodyOverflow();\r\n } else {\r\n this.removeBodyOverflow();\r\n }\r\n });\r\n\r\n this.drawer.openedChange.subscribe((opened) => {\r\n if (opened) {\r\n setTimeout(() => {\r\n if (this.myTextarea && this.myTextarea.nativeElement) {\r\n this.myTextarea.nativeElement.focus(); // Focus on the textarea\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n private setBodyOverflow() {\r\n this.renderer.addClass(document.body, this.bodyOverflowClass);\r\n }\r\n\r\n private removeBodyOverflow() {\r\n this.renderer.removeClass(document.body, this.bodyOverflowClass);\r\n }\r\n\r\n getSpeakersByStaffIds(ids) {\r\n const url = `${this.environment.USERS_API}/events/${this.eventId}/users/get-by-staff-ids`;\r\n fetch(url, {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n Authorization: 'Bearer ' + 'your_token_here',\r\n },\r\n body: JSON.stringify(ids),\r\n })\r\n .then((response) => {\r\n if (response.ok) {\r\n return response.json(); // Parse the JSON body of the response\r\n } else {\r\n throw new Error('Network response was not ok.');\r\n }\r\n })\r\n .then((data) => {\r\n if (data?.length > 0) {\r\n data.forEach((speaker) => {\r\n this.speakers[speaker.id] = speaker;\r\n });\r\n\r\n this.cdr.markForCheck();\r\n }\r\n })\r\n .catch((err) => {\r\n console.error('Error fetching data:', err);\r\n this.loading = false;\r\n });\r\n }\r\n\r\n performSessionAction(sessionId, action) {\r\n this.sessionActions.next({\r\n sessionId,\r\n action,\r\n });\r\n }\r\n\r\n addCloseBotClickEvent() {\r\n const element = this.elementRef.nativeElement.querySelector('#closeBotNow');\r\n if (element) {\r\n this.renderer.listen(element, 'click', () => {\r\n this.closeBot.next();\r\n });\r\n }\r\n }\r\n\r\n isMobileBrowser() {\r\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\r\n navigator.userAgent\r\n );\r\n }\r\n\r\n connectToUser(userId) {\r\n this.connectWithUser.emit({\r\n connect: !this.canDisconnect(userId),\r\n userId,\r\n });\r\n\r\n setTimeout(() => {\r\n this.fetchMyConnections().subscribe((res) => {\r\n this.cdr.markForCheck();\r\n });\r\n this.fetchPendingRequests().subscribe((res) => {\r\n this.cdr.markForCheck();\r\n });\r\n }, 500);\r\n }\r\n\r\n scheduleMeetingWithUser(user) {\r\n this.scheduleMeeting.emit(user);\r\n }\r\n\r\n canConnect(userId) {\r\n return !(\r\n this.canDisconnect(userId) ||\r\n this.pendingRequests.find((a) => a == userId)\r\n );\r\n }\r\n\r\n canDisconnect(userId) {\r\n return this.myConnections.find((conn) => conn.userId == userId);\r\n }\r\n\r\n fetchPendingRequests() {\r\n const headers = new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n apiKey: this.autogenKey,\r\n });\r\n return this.http\r\n .get(\r\n `${this.environment.USERS_API}/events/${this.eventId}/connection-requests/autogen/pending-sent-requests?userId=${this.userId}`,\r\n { headers }\r\n )\r\n .pipe(\r\n switchMap((res: any) => {\r\n this.pendingRequests = res;\r\n this.cdr.markForCheck();\r\n return of(res);\r\n }),\r\n catchError((error: any) => {\r\n console.error('Error fetching pending requests: ', error);\r\n return of(null);\r\n })\r\n );\r\n }\r\n\r\n fetchMyConnections() {\r\n const headers = new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n apiKey: this.autogenKey,\r\n });\r\n return this.http\r\n .get(\r\n `${this.environment.USERS_API}/events/${this.eventId}/users-connections/autogen?userId=${this.userId}`,\r\n { headers }\r\n )\r\n .pipe(\r\n switchMap((res: any) => {\r\n this.myConnections = res;\r\n this.cdr.markForCheck();\r\n return of(res);\r\n }),\r\n catchError((error: any) => {\r\n console.error('Error fetching pending requests: ', error);\r\n return of(null);\r\n })\r\n );\r\n }\r\n\r\n isDropdownOpen: boolean = false;\r\n agents: any;\r\n selectedAgents = [];\r\n allSelected = false;\r\n // Toggle the dropdown visibility\r\n toggleDropdown() {\r\n if (!this.agents)\r\n this.fetchAgents();\r\n this.isDropdownOpen = !this.isDropdownOpen;\r\n this.cdr.detectChanges();\r\n }\r\n\r\n onSelectAll(event: Event): void {\r\n this.agents?.forEach((agent) => (agent.selected = false));\r\n this.cdr.detectChanges();\r\n }\r\n\r\n onAgentChange(agent: any): void {\r\n //agent.selected = !agent.selected;\r\n //console.log(agent);\r\n let agentFound = this.agents.filter((p) => p.id == agent.id);\r\n if (agentFound && agentFound.length > 0) {\r\n agentFound[0].selected = !agentFound[0].selected;\r\n this.cdr.detectChanges();\r\n }\r\n this.cdr.detectChanges();\r\n }\r\n\r\n areAllSelected(): boolean {\r\n return this.agents?.every((agent) => !agent.selected);\r\n }\r\n\r\n getDropdownHeaderText(): string {\r\n const selectedAgents = this.agents?.filter((agent) => agent.selected);\r\n if (!selectedAgents) {\r\n return 'All Agents';\r\n } else {\r\n if (selectedAgents && selectedAgents?.length === 0) {\r\n return 'All Agents';\r\n } else {\r\n return selectedAgents?.length > 1\r\n ? `${selectedAgents?.length} Agents Selected`\r\n : `${selectedAgents?.length} Agent Selected`;\r\n }\r\n }\r\n }\r\n fetchAgents_http() {\r\n this.loading = true;\r\n const url = `${this.environment.AGENTS_API}/CoPilot/${this.botId}/active-agents`;\r\n const headers = new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n });\r\n\r\n return this.http.post(url, {}, { headers }).pipe(\r\n switchMap((res: any) => {\r\n if (res) {\r\n this.agents = res.map((agent) => ({\r\n ...agent,\r\n selected: false,\r\n }));\r\n }\r\n this.cdr.markForCheck();\r\n\r\n return of(res);\r\n }),\r\n catchError((error) => {\r\n console.error('Error fetching chatbot config: ', error);\r\n\r\n return of(null);\r\n })\r\n );\r\n }\r\n isDocInEditMode = false;\r\n documentContent: any;\r\n\r\n conversationId: any;\r\n isContentLoaded = false;\r\n\r\n fetchContent_http() {\r\n this.isDocInEditMode = false;\r\n this.isContentLoaded = false;\r\n console.log('API call function');\r\n this.loading = true;\r\n const conversation_id = this.conversationService.getKey(this.botId);\r\n this.conversationId = conversation_id;\r\n const url = `${this.environment.AGENTS_API}/ConversationDocuments?conversationId=${conversation_id}&botId=${this.botId}`;\r\n const headers = new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n apiKey: 'WIz/qAm+EEmfOkFaUA/weA==',\r\n });\r\n\r\n return this.http.get(url, { headers }).pipe(\r\n switchMap((res: any) => {\r\n if (res) {\r\n this.isDocInEditMode = true;\r\n this.documentContent = res;\r\n console.log('Get API callled success');\r\n this.isContentLoaded = true;\r\n console.log(res);\r\n }\r\n this.cdr.markForCheck();\r\n\r\n return of(res);\r\n }),\r\n catchError((error) => {\r\n console.error('Error fetching chatbot config DJ: ', error);\r\n this.isDocInEditMode = false;\r\n this.isContentLoaded = true;\r\n\r\n if (error?.status == 404) {\r\n console.log('dash');\r\n this.isDocInEditMode = false;\r\n this.isContentLoaded = true;\r\n }\r\n return of(null);\r\n })\r\n );\r\n }\r\n\r\n fetchAgents() {\r\n this.fetchAgents_http().subscribe();\r\n }\r\n\r\n fetchEditorContent() {\r\n this.fetchContent_http().subscribe();\r\n }\r\n\r\n // events/${eventId}/users-connections\r\n processMessageForDisplay(markdown: string): SafeHtml {\r\n try {\r\n // Parse the markdown content to HTML using marked\r\n const markdownContent = marked.parse(markdown);\r\n\r\n // Sanitize the parsed HTML using Angular's DomSanitizer\r\n // const sanitizedHtml = this.sanitizer.bypassSecurityTrustHtml(markdownContent);\r\n\r\n // Return the safe HTML content for display\r\n return markdownContent;\r\n\r\n } catch (error) {\r\n console.error('Error processing markdown:', error);\r\n return ''; // Return an empty string or handle the error appropriately\r\n }\r\n }\r\n\r\n prepareHtml(markdown: string): string {\r\n if (!markdown || !(markdown.length > 0)) {\r\n console.error('Input Markdown is null or empty');\r\n return '';\r\n }\r\n\r\n // Convert Markdown headers (### or ##) to <strong> for bold headings\r\n let html = markdown.replace(/^(#{1,6})\\s+(.*)$/gm, (match, hashes, text) => {\r\n const level = hashes.length;\r\n if (level === 3) {\r\n return `<h3><strong>${text}</strong></h3>`;\r\n } else if (level === 4) {\r\n return `<h4><strong>${text}</strong></h4>`;\r\n }\r\n return `<strong>${text}</strong>`;\r\n });\r\n\r\n // Convert Markdown code blocks with language to preformatted HTML\r\n html = html.replace(/```(\\w+)?\\n([\\s\\S]*?)```/g, (match, lang, code) => {\r\n const escapedCode = this.escapeHtml(code);\r\n const language = lang || 'plaintext';\r\n\r\n // Create a copy button for the code block\r\n return `\r\n <div class=\"code-container\">\r\n <button id=\"copy-button\" class=\"copy-button\" (click)=\"copyToClipboard('\\`${escapedCode}\\`')\">Copy</button>\r\n <pre class=\"code_block diff\"><code class=\"language-${language}\">${escapedCode}</code></pre>\r\n </div>`;\r\n });\r\n\r\n // Convert inline code (wrapped in `backticks`) to inline <code> tags\r\n html = html.replace(/`([^`]+)`/g, '<code>$1</code>');\r\n\r\n // Convert Markdown bold to HTML <strong>\r\n html = html.replace(/\\*\\*(.*?)\\*\\*/g, '<strong>$1</strong>');\r\n\r\n // Convert numbered lists\r\n html = html.replace(/^\\d+\\.\\s+(.*)$/gm, '<li>$1</li>');\r\n\r\n // Convert bullet point lists\r\n html = html.replace(/^\\-\\s+(.*)$/gm, '<li>$1</li>');\r\n\r\n // Convert Markdown links to HTML links\r\n html = html.replace(/\\[([^\\]]+)]\\(([^)]+)\\)/g, '<a href=\"$2\" target=\"_blank\">$1</a>');\r\n\r\n // Convert new lines to <br> tags for paragraphs\r\n html = html.replace(/(?:\\r\\n|\\r|\\n)/g, '<br>');\r\n\r\n return html;\r\n }\r\n\r\n // Helper function to escape HTML characters for code blocks\r\n escapeHtml(code: string): string {\r\n return code\r\n .replace(/&/g, '&amp;')\r\n .replace(/</g, '&lt;')\r\n .replace(/>/g, '&gt;')\r\n .replace(/\"/g, '&quot;')\r\n .replace(/'/g, '&#039;');\r\n }\r\n\r\n // Function to copy text to clipboard\r\n public copyToClipboard(text: string) {\r\n navigator.clipboard.writeText(text).then(() => {\r\n alert('Code copied to clipboard!');\r\n }, (err) => {\r\n console.error('Could not copy text: ', err);\r\n });\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n isCollapsed = false;\r\n isCollapsedForGraph = false;\r\n isCollapsedForFGraph = false;\r\n toggleCollapse() {\r\n this.isCollapsed = !this.isCollapsed;\r\n this.cdr.detectChanges();\r\n }\r\n\r\n toggleCollapseGraph() {\r\n this.isCollapsedForGraph = !this.isCollapsedForGraph;\r\n this.cdr.detectChanges();\r\n }\r\n toggleCollapseFGraph() {\r\n this.isCollapsedForFGraph = !this.isCollapsedForFGraph;\r\n this.cdr.detectChanges();\r\n }\r\n // [\r\n // {\r\n // \"title\": \"AI News January 2024: In-Depth and Concise - The AI Track\",\r\n // \"desc\": \"Each month, we compile significant news, trends, and happenings in AI, providing detailed summaries with key points in bullet form for concise yet complete understanding.\",\r\n // \"link\": \"https://theaitrack.com/ai-news-january-2024/\"\r\n // },\r\n // {\r\n // \"title\": \"Top AI News, January 2024 - Everypixel Journal\",\r\n // \"desc\": \"In this monthly roundup, we spotlight the top AI news stories from January, including the OpenAI vs. The New York Times Lawsuit.\",\r\n // \"link\": \"https://journal.everypixel.com/top-ai-news-january-2024\"\r\n // },\r\n // {\r\n // \"title\": \"AI News July 2024: In-Depth and Concise - The AI Track\",\r\n // \"desc\": \"This page features AI News for July 2024, highlighting significant events such as Canva acquiring Leonardo AI.\",\r\n // \"link\": \"https://theaitrack.com/ai-news-july-2024-in-depth-and-concise/\"\r\n // },\r\n // {\r\n // \"title\": \"January news roundup: What's new in the world of AI? - Pluralsight\",\r\n // \"desc\": \"OpenAI’s new GPT store, business-ready ChatGPT plans, and a predicted rise in AI-powered cybercrime.\",\r\n // \"link\": \"https://www.pluralsight.com/resources/blog/data/ai-this-month-january-2024\"\r\n // },\r\n // {\r\n // \"title\": \"AI News August 2024: In-Depth and Concise - The AI Track\",\r\n // \"desc\": \"This page features AI News for August 2024, with highlights such as Nvidia delaying the “Blackwell” B200 AI chips delivery.\",\r\n // \"link\": \"https://theaitrack.com/ai-news-august-2024-in-depth-and-concise-duplicate/\"\r\n // }\r\n // ]\r\n dateTime = { now: new Date().toISOString() };\r\n // Extracts the domain from a URL\r\n getDomainName(url: string): string {\r\n try {\r\n const { hostname } = new URL(url);\r\n return hostname.replace(/^www\\./, ''); // Remove 'www.' if present\r\n } catch {\r\n return 'unknown';\r\n }\r\n }\r\n\r\n // Generates the favicon URL\r\n getFaviconUrl(url: string): string {\r\n const domain = this.getDomainName(url);\r\n return `https://www.google.com/s2/favicons?sz=128&domain=${domain}`;\r\n }\r\n currentSourcesList: any = [];\r\n onCardClick(sources): void {\r\n this.currentSourcesList = sources;\r\n this.cdr.detectChanges();\r\n this.sourcesDrawer.open();\r\n const button = document.getElementById('botcloseplaygroundbutton');\r\n if (button) {\r\n button.style.display = 'none';\r\n }\r\n }\r\n\r\n isShowEditorButton = true;\r\n\r\n openOuterEditor() {\r\n this.fetchEditorContent();\r\n this.editorsDrawer.open();\r\n this.isDrawerOpen = true;\r\n this.isShowEditorButton = false;\r\n this.cdr.detectChanges();\r\n\r\n const button = document.getElementById('botcloseplaygroundbutton');\r\n if (button) {\r\n button.style.display = 'none';\r\n }\r\n }\r\n\r\n onCloseEditor() {\r\n this.editorsDrawer.close();\r\n this.isDrawerOpen = false;\r\n this.isShowEditorButton = true;\r\n this.cdr.detectChanges(); // Trigger change detection if needed\r\n this.onDrawerClosed();\r\n }\r\n\r\n onCloseSource() {\r\n this.sourcesDrawer.close();\r\n this.isDrawerOpen = false;\r\n this.cdr.detectChanges(); // Trigger change detection if needed\r\n this.onDrawerClosed();\r\n }\r\n onDrawerClosed() {\r\n setTimeout(() => {\r\n this.isDrawerOpen = true;\r\n this.cdr.detectChanges(); // Trigger change detection if needed\r\n // Use ngClass to dynamically apply the class\r\n const button = document.getElementById('botcloseplaygroundbutton');\r\n if (button) {\r\n button.style.display = 'block';\r\n }\r\n }, 800);\r\n }\r\n isDrawerOpen = true;\r\n\r\n toggleDrawer(todo) {\r\n this.isDrawerOpen = todo;\r\n this.cdr.detectChanges();\r\n this.updateButtonVisibility();\r\n }\r\n updateButtonVisibility() {\r\n const button = document.getElementById('botcloseplaygroundbutton');\r\n if (button) {\r\n button.style.display = this.isDrawerOpen ? 'block' : 'none';\r\n }\r\n }\r\n openLinkInNewTab(link: string): void {\r\n window.open(link, '_blank');\r\n }\r\n adjustTextareaHeight(event: any): void {\r\n try {\r\n if (event.key === 'Enter' && !event.shiftKey) {\r\n // Prevents a new line from being added\r\n event.preventDefault();\r\n }\r\n } catch (error) {\r\n\r\n }\r\n const textarea = event.target as HTMLTextAreaElement;\r\n textarea.style.height = 'auto'; // Reset the height\r\n textarea.style.height = `${textarea.scrollHeight}px`; // Adjust height to match content\r\n // Ensure the height doesn't exceed the max-height set in CSS\r\n if (textarea.scrollHeight > 150) {\r\n textarea.style.height = `150px`; // Adjust height to match content\r\n textarea.style.overflowY = 'auto'; // Enable scrolling if content exceeds 400px\r\n } else {\r\n textarea.style.overflowY = 'hidden'; // Hide scrollbar if content is within limits\r\n }\r\n }\r\n\r\n toggleWorkflows(value = null) {\r\n\r\n if (!this.checkForCop29BotId()) {\r\n this.botService.getWorkflowsByOrgId(this.orgId).subscribe((res) => {\r\n this.orgWorkflows = res;\r\n this.isWorkflowOpen = value == null ? !this.isWorkflowOpen : value;\r\n\r\n if (!this.isWorkflowOpen) {\r\n this.selectedWorkflow = null;\r\n this.openWorkflowInput = false;\r\n }\r\n\r\n this.cdr.detectChanges();\r\n });\r\n }\r\n\r\n }\r\n\r\n initializeForm() {\r\n // Create form controls dynamically based on selectedWorkflow.Trigger.InputSchema\r\n const formControls = {};\r\n if (this.selectedWorkflow?.Trigger?.InputSchema) {\r\n this.selectedWorkflow.Trigger.InputSchema.forEach((input) => {\r\n formControls[input.InputId] = [\r\n input.Value || '',\r\n input.Required ? Validators.required : null,\r\n ];\r\n });\r\n }\r\n\r\n // Initialize the form\r\n this.workflowForm = this.fb.group(formControls);\r\n }\r\n\r\n onWorkflowSelected(workflow) {\r\n this.selectedWorkflow = workflow;\r\n this.initializeForm();\r\n this.isWorkflowOpen = false;\r\n this.openWorkflowInput = true;\r\n }\r\n\r\n onWorkflowSubmit() {\r\n const container = document.getElementById('allChats');\r\n if (this.workflowForm.valid) {\r\n console.log(this.workflowForm.value);\r\n\r\n var input = this.prepareHtml(\r\n this.generateMarkdown(\r\n this.selectedWorkflow.Name,\r\n this.workflowForm.value\r\n )\r\n );\r\n\r\n // update last two chatLog entries, set showWorkflowExecutionLoader = false\r\n try {\r\n this.chatLog[this.chatLog.length - 1][\r\n 'showWorkflowExecutionLoader'\r\n ] = false;\r\n this.chatLog[this.chatLog.length - 2][\r\n 'showWorkflowExecutionLoader'\r\n ] = false;\r\n } catch (error) { }\r\n\r\n this.chatLog.push({\r\n type: 'user',\r\n message: input,\r\n time: formatNow(this.timezone),\r\n copied: false,\r\n isCollapsedTrue: false,\r\n showWorkflowExecutionLoader: true,\r\n });\r\n\r\n console.log(input);\r\n\r\n this.currentWorkflowActionProgress = 0;\r\n this.currentWorkflowAction =\r\n 'Executing ' + this.selectedWorkflow.Actions[0].Name;\r\n this.isChatingWithAi = true;\r\n this.executingWorkflow = true;\r\n this.workflowExecutionDetails = {\r\n Actions: this.selectedWorkflow.Actions,\r\n Inputs: this.workflowForm.value,\r\n workflowInputs: this.workflowForm.value,\r\n WorkflowName: this.selectedWorkflow.Name,\r\n };\r\n this.currentWorkflowExecutionDetails = this.workflowExecutionDetails;\r\n this.scrollToBottom();\r\n\r\n this.cdr.detectChanges();\r\n\r\n // execute the ask endpoint with workflow input\r\n this.makeAskRequest(\r\n input,\r\n this.agents,\r\n this.conversationKey,\r\n '',\r\n null,\r\n this.selectedWorkflow['_id'],\r\n this.workflowForm.value\r\n );\r\n }\r\n }\r\n\r\n makeAskRequest(\r\n inputMsg: string,\r\n agents: any[],\r\n conversationId: string,\r\n msg?: any,\r\n chat?: any,\r\n workflowId?: string,\r\n workflow_inputs?: any\r\n ): void {\r\n var url = `${this.environment.BASE_URL}/ai/ask`;\r\n\r\n var body = {\r\n user_question: inputMsg,\r\n user_id: this.userId,\r\n bot_id: this.botId,\r\n message_id: this.conversationService.generateKey(),\r\n agents: agents?.filter((p) => p.selected).map((p) => p.id) ?? [],\r\n conversation_id: conversationId,\r\n };\r\n\r\n if (workflowId) {\r\n body['workflow_id'] = workflowId;\r\n body['workflow_inputs'] = workflow_inputs;\r\n }\r\n\r\n fetch(url, {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n Authorization: 'Bearer ' + this.s27Token,\r\n 'x-api-key': this.apiKey,\r\n 'hive-bot-id': this.botId\r\n },\r\n body: JSON.stringify(body),\r\n })\r\n .then((response) => {\r\n if (response.status === 401 || response.status === 403) {\r\n this.is401 = true;\r\n this.refreshToken.emit();\r\n\r\n // If `msg` and `chat` exist, handle them\r\n if (msg && chat) {\r\n this.msg = msg;\r\n this.chat = chat;\r\n this.isFetchDataFor = true;\r\n }\r\n } else {\r\n this.is401 = false;\r\n }\r\n return response.json();\r\n })\r\n .then((data) => {\r\n console.log(data);\r\n // Additional response handling if needed\r\n })\r\n .catch((err) => {\r\n console.error('Error: ', err);\r\n this.isChatingWithAi = false;\r\n });\r\n\r\n this.input = '';\r\n this.selectedWorkflow = null;\r\n this.openWorkflowInput = false;\r\n this.isWorkflowOpen = false;\r\n this.scrollToBottom();\r\n this.cdr.markForCheck();\r\n }\r\n\r\n generateMarkdown(title, obj) {\r\n // Initialize markdown with the title\r\n let markdown = `## ${title}\\n`;\r\n\r\n // Loop through the object and append the field names and values\r\n for (const [key, value] of Object.entries(obj)) {\r\n var key_label =\r\n this.selectedWorkflow.Trigger.InputSchema.find(\r\n (input) => input.InputId === key\r\n )?.Label || key;\r\n markdown += `- **${key_label}**: ${value}\\n`;\r\n }\r\n\r\n return markdown;\r\n }\r\n\r\n showWorkflowHistoryDetails(workflow_id) {\r\n if (!workflow_id) {\r\n this.workflowExecutionDetails = this.currentWorkflowExecutionDetails;\r\n this.showWorkflowExecutionDetails = true;\r\n this.cdr.detectChanges();\r\n return;\r\n }\r\n\r\n this.botService.getWorkflowExecutionById(workflow_id).subscribe((res) => {\r\n if (res && res.Actions && Array.isArray(res.Actions)) {\r\n res.Actions = res.Actions.map((action) => {\r\n if (action.InsertTimeStamp) {\r\n action.InsertTimeStamp = formatTimeStamps(\r\n this.timezone,\r\n action.InsertTimeStamp\r\n );\r\n }\r\n return action;\r\n });\r\n }\r\n\r\n res.InsertTimeStamp = formatTimeStamps(\r\n this.timezone,\r\n res.InsertTimeStamp\r\n );\r\n this.workflowExecutionDetails = res;\r\n this.showWorkflowExecutionDetails = true;\r\n this.cdr.detectChanges();\r\n });\r\n }\r\n\r\n closeModal() {\r\n this.showWorkflowExecutionDetails = false;\r\n }\r\n\r\n objectToArray(obj: any): any[] {\r\n return Object.keys(obj).map((key) => ({ key, value: obj[key] }));\r\n }\r\n\r\n startNewConversation() {\r\n this.conversationKey = this.conversationService.getKey(this.botId, true);\r\n this.chatLog = [this.chatLog[0]];\r\n this.isChatingWithAi = false;\r\n setTimeout(() => {\r\n this.initializeSocket();\r\n }, 200);\r\n this.scrollToBottom();\r\n this.cdr.detectChanges();\r\n }\r\n\r\n initializeSpeechRecognizer(token: string) {\r\n this.speechConfig = SpeechSDK.SpeechConfig.fromAuthorizationToken(\r\n token,\r\n this.region\r\n );\r\n const audioConfig = SpeechSDK.AudioConfig.fromDefaultMicrophoneInput();\r\n this.recognizer = new SpeechSDK.SpeechRecognizer(\r\n this.speechConfig,\r\n audioConfig\r\n );\r\n\r\n this.recognizer.recognizing = (s, e) => {\r\n if (e.result.reason === SpeechSDK.ResultReason.RecognizingSpeech) {\r\n this.input = e.result.text;\r\n console.log(`Recognizing: ${e.result.text}`);\r\n this.cdr.markForCheck();\r\n }\r\n };\r\n\r\n this.recognizer.recognized = (s, e) => {\r\n if (e.result.reason === SpeechSDK.ResultReason.RecognizedSpeech) {\r\n this.input = e.result.text;\r\n console.log(`Recognized: ${e.result.text}`);\r\n this.toggleRecording();\r\n this.cdr.markForCheck();\r\n }\r\n };\r\n\r\n this.recognizer.canceled = (s, e) => {\r\n console.error('Canceled: ', e.errorDetails);\r\n };\r\n\r\n this.recognizer.sessionStopped = (s, e) => {\r\n console.log('Session stopped.');\r\n this.recognizer.stopContinuousRecognitionAsync();\r\n this.fetchData();\r\n };\r\n }\r\n\r\n toggleRecording() {\r\n this.isRecording = !this.isRecording;\r\n\r\n if (this.isRecording) {\r\n this.startRecognition();\r\n } else {\r\n this.stopRecognition();\r\n }\r\n }\r\n\r\n startRecognition() {\r\n this.recognizer.startContinuousRecognitionAsync();\r\n }\r\n\r\n stopRecognition() {\r\n this.recognizer.stopContinuousRecognitionAsync();\r\n }\r\n\r\n checkForCop29BotId() {\r\n return this.botId == '66fa3f276c5d71e2717bfea8';\r\n }\r\n\r\n getLatestTime(time): string {\r\n if (time) {\r\n return time;\r\n }\r\n return new Date().toLocaleTimeString([], {\r\n hour: '2-digit',\r\n minute: '2-digit',\r\n }); // returns current time in 'shortTime' format\r\n }\r\n}\r\n","import { Component, Input } from '@angular/core';\r\n@Component({\r\n selector: 'hivegpt-chatbot',\r\n templateUrl: './chatbot.component.html',\r\n styleUrls: ['./chatbot.component.scss'],\r\n})\r\nexport class ChatBotComponent {\r\n @Input() userId!: string;\r\n @Input() apiKey!: string;\r\n @Input() botName!: string;\r\n @Input() botSkills!: string;\r\n @Input() botId!: string;\r\n @Input() closeButtonColor!: string;\r\n @Input() gradientColors!: string[];\r\n @Input() greeting!: string;\r\n @Input() sendButtonColor!: string;\r\n @Input() useOpenAi!: boolean;\r\n @Input() showClose!: boolean;\r\n @Input() bgGradient!: string[];\r\n @Input() sendButtonTextColor!: string;\r\n @Input() fullView!: boolean;\r\n @Input() bgBubbleAi!: string;\r\n @Input() bgBubbleUser!: string;\r\n @Input() closeButtonbgColor!: string;\r\n @Input() messageTextColorAi!: string;\r\n @Input() messageTextColorUser!: string;\r\n @Input() dateTimeColor!: string;\r\n @Input() dateTextColor!: string;\r\n @Input() formFieldBgColor!: string;\r\n @Input() formFieldTextColor!: string;\r\n @Input() thumbsUpMessage!: string;\r\n @Input() thumbsDownMessages!: string[];\r\n @Input() timezone!: string;\r\n @Input() eventName!: string;\r\n @Input() credentials!: [];\r\n @Input() unknownResponses!: [];\r\n @Input() rules!: string;\r\n @Input() eventId!: string;\r\n visible = false;\r\n\r\n toggle() {\r\n this.visible = !this.visible;\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\nimport { DomSanitizer } from '@angular/platform-browser';\r\n\r\n@Pipe({\r\n name: 'safeHtml',\r\n})\r\nexport class SafeHtmlPipe implements PipeTransform {\r\n\r\n constructor(private sanitizer: DomSanitizer) {\r\n }\r\n\r\n transform(html): unknown {\r\n return html ? this.sanitizer.bypassSecurityTrustHtml(html) : '';\r\n }\r\n\r\n}\r\n","import {\r\n AfterViewInit,\r\n ChangeDetectorRef,\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n Inject,\r\n Input,\r\n OnInit,\r\n Output,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { IVideo } from '../../models/video';\r\nimport { DOCUMENT } from '@angular/common';\r\n\r\n@Component({\r\n selector: 'app-video-player',\r\n templateUrl: './video-player.component.html',\r\n styleUrls: ['./video-player.component.scss'],\r\n})\r\nexport class VideoPlayerComponent\r\n implements OnInit, AfterViewInit {\r\n @Input() currentUserId: string;\r\n @Input() user: any;\r\n @Input() eventId: string;\r\n @Input() videoObj: IVideo;\r\n @Input() isDev: boolean;\r\n myFollowingList: Array<string>;\r\n myPendingSentRequests: Array<string>;\r\n @Input() type: string;\r\n isMuted: boolean = true;\r\n private observer: IntersectionObserver;\r\n isFullscreen: boolean = false;\r\n @ViewChild('video') video: any;\r\n @ViewChild('fullscreenvideo') fullscreenvideo: any;\r\n isFullscreenvideoPlaying: boolean = false;\r\n\r\n @Output() connectWithUser = new EventEmitter<string>();\r\n @Output() scheduleMeeting = new EventEmitter<any>();\r\n\r\n constructor(\r\n @Inject(DOCUMENT) private doc: any,\r\n private el: ElementRef,\r\n private cdr: ChangeDetectorRef\r\n ) {\r\n }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n toggleSound(isMuted = null) {\r\n this.isMuted = isMuted != null ? isMuted : !this.isMuted;\r\n setTimeout(() => {\r\n const video: any = this.doc\r\n .getElementById(this.video.id.toString());\r\n if (video) {\r\n video.muted = this.isMuted;\r\n this.video.isMuted = this.isMuted;\r\n }\r\n\r\n this.cdr.markForCheck();\r\n //this.muteToggle.emit(this.isMuted);\r\n })\r\n}\r\n\r\n togglePlay(playState: boolean, videoEl) {\r\n this.videoObj.isPlaying = !this.videoObj.isPlaying;\r\n setTimeout(() => { \r\n if (playState) { \r\n this.videoObj.isPlaying = true;\r\n videoEl.play();\r\n var pauseBtn = document.getElementById('pause-btn');\r\n pauseBtn.classList.add('hide-pause-btn');\r\n\r\n this.toggleSound(false);\r\n }\r\n else{\r\n this.videoObj.isPlaying = false;\r\n videoEl.pause();\r\n }\r\n this.cdr.markForCheck();\r\n })\r\n }\r\n \r\n ngAfterViewInit() {\r\n if (window.innerWidth <= 576) {\r\n this.observer = new IntersectionObserver(\r\n (entries) => {\r\n if (entries[0].isIntersecting === true) {\r\n this.video.nativeElement.play();\r\n } else {\r\n this.video.nativeElement.pause();\r\n }\r\n },\r\n {\r\n threshold: 0.75,\r\n }\r\n );\r\n\r\n this.observer.observe(this.el.nativeElement as HTMLElement);\r\n }\r\n }\r\n\r\n toggleFullscreen() {\r\n this.isFullscreen = !this.isFullscreen;\r\n if (!this.isFullscreen) {\r\n this.fullscreenvideo.nativeElement.pause();\r\n }\r\n }\r\n\r\n toggleFullscreenPlay() {\r\n this.isFullscreenvideoPlaying = !this.isFullscreenvideoPlaying;\r\n\r\n if (this.isFullscreenvideoPlaying) {\r\n this.fullscreenvideo.nativeElement.play();\r\n } else {\r\n this.fullscreenvideo.nativeElement.pause();\r\n }\r\n }\r\n\r\n followUser(userId) {\r\n this.connectWithUser.emit(userId);\r\n }\r\n\r\n checkPendingSentRequest(userId) {\r\n return this.myPendingSentRequests?.find(a => a == userId);\r\n }\r\n\r\n canUnfollowUser() {\r\n return false;\r\n }\r\n\r\n canFollowUser() {\r\n return true;\r\n }\r\n\r\n getIniNames(firstName, lastName) {\r\n if(!firstName && !lastName) {\r\n return '';\r\n }\r\n \r\n if (firstName && lastName)\r\n return (\r\n firstName.charAt(0).toUpperCase() + lastName.charAt(0).toUpperCase()\r\n );\r\n else return firstName.charAt(0).toUpperCase();\r\n }\r\n}\r\n","import { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport {\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n Input,\r\n OnChanges,\r\n OnInit,\r\n Output,\r\n QueryList,\r\n Renderer2,\r\n SimpleChanges,\r\n ViewChild,\r\n ViewChildren,\r\n} from '@angular/core';\r\nimport { MatDrawer } from '@angular/material/sidenav';\r\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\r\nimport { of, Subscription } from 'rxjs';\r\nimport { catchError, switchMap } from 'rxjs/operators';\r\nimport { formatNow, formatTimeStamps } from '../../utils/utils';\r\nimport {\r\n dev_environment,\r\n prod_environment,\r\n} from '../../../environments/environment';\r\nimport { ConversationService } from '../conversation.service';\r\nimport { Observable } from 'rxjs';\r\nimport { SocketService } from '../socket-service.service';\r\n\r\n@Component({\r\n selector: 'lib-bot-html-editor',\r\n templateUrl: './bot-html-editor.component.html',\r\n styleUrls: ['./bot-html-editor.component.css'],\r\n})\r\nexport class BotHtmlEditorComponent implements OnInit {\r\n @Input() editorContent: Observable<string>;\r\n @Input() isDocInEditMode: any;\r\n @Input() documentContent: any;\r\n @Input() conversationId: any;\r\n @Input() botId: any;\r\n\r\n documentName: any = 'doc name';\r\n\r\n environment: {\r\n USERS_API;\r\n BASE_URL;\r\n AGENTS_API;\r\n };\r\n\r\n quillConfig = {\r\n toolbar: [\r\n [{ header: '1' }, { header: '2' }, { font: [] }],\r\n [{ list: 'ordered' }, { list: 'bullet' }],\r\n ['bold', 'italic', 'underline'],\r\n ['link'],\r\n ['clean'],\r\n ],\r\n };\r\n constructor(private cdr: ChangeDetectorRef, private http: HttpClient) {}\r\n\r\n ngOnInit(): void {\r\n this.environment = prod_environment;\r\n\r\n setTimeout(() => {\r\n if (this.isDocInEditMode) {\r\n console.log('In Edit mode');\r\n this.filldataInForm();\r\n } else {\r\n console.log('In save mode');\r\n }\r\n }, 2500);\r\n }\r\n\r\n filldataInForm() {\r\n if (this.documentContent) {\r\n this.documentName = this.documentContent?.name;\r\n this.editorContent = this.documentContent?.content;\r\n this.cdr.detectChanges();\r\n }\r\n }\r\n\r\n saveContent() {\r\n if (!this.isDocInEditMode) {\r\n this.saveContent_http().subscribe();\r\n } else {\r\n this.saveContent_http().subscribe();\r\n }\r\n }\r\n\r\n saveContent_http() {\r\n console.log('API call function');\r\n\r\n const url = `${this.environment.AGENTS_API}/ConversationDocuments?conversationId=${this.conversationId}&botId=${this.botId}`;\r\n const headers = new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n apiKey: 'WIz/qAm+EEmfOkFaUA/weA==',\r\n });\r\n\r\n let data = {\r\n name: this.documentName,\r\n content: this.editorContent,\r\n };\r\n\r\n return this.http.post(url, data, { headers }).pipe(\r\n switchMap((res: any) => {\r\n if (res) {\r\n // alert('Saved Successfully');\r\n }\r\n this.cdr.markForCheck();\r\n\r\n return of(res);\r\n }),\r\n catchError((error) => {\r\n console.error('Error fetching chatbot config: ', error);\r\n\r\n return of(null);\r\n })\r\n );\r\n }\r\n\r\n updateContent_http() {\r\n console.log('API call function');\r\n\r\n const url = `${this.environment.AGENTS_API}/ConversationDocuments/rename?conversationId=${this.conversationId}&botId=${this.botId}`;\r\n const headers = new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n apiKey: 'WIz/qAm+EEmfOkFaUA/weA==',\r\n });\r\n\r\n let data = {\r\n name: this.documentName,\r\n content: this.editorContent,\r\n };\r\n\r\n return this.http.put(url, data, { headers }).pipe(\r\n switchMap((res: any) => {\r\n if (res) {\r\n // alert('Updated Successfully');\r\n }\r\n this.cdr.markForCheck();\r\n\r\n return of(res);\r\n }),\r\n catchError((error) => {\r\n console.error('Error fetching chatbot config: ', error);\r\n\r\n return of(null);\r\n })\r\n );\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatSidenavModule } from '@angular/material/sidenav';\r\nimport { ChatDrawerComponent } from './components/chat-drawer/chat-drawer.component';\r\nimport { ChatBotComponent } from './components/chatbot/chatbot.component';\r\nimport { SafeHtmlPipe } from './pipes/safe-html.pipe';\r\nimport { VideoPlayerComponent } from './components/video-player/video-player.component';\r\nimport { QuillModule } from 'ngx-quill';\r\nimport { BotHtmlEditorComponent } from './components/bot-html-editor/bot-html-editor.component';\r\n\r\n@NgModule({\r\n declarations: [ChatBotComponent, ChatDrawerComponent, VideoPlayerComponent, SafeHtmlPipe, BotHtmlEditorComponent],\r\n imports: [CommonModule, MatIconModule, MatSidenavModule, FormsModule, QuillModule],\r\n exports: [ChatBotComponent, ChatDrawerComponent, VideoPlayerComponent]\r\n})\r\nexport class HiveGptModule { }\r\n"]}