@hivegpt/hiveai-angular 0.0.331 → 0.0.332

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","domain","headers","HttpHeaders","Content-Type","x-api-key","hive-bot-id","domain-authority","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","window","location","hostname","includes","domainAuthorityValue","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.Renderer","href","title","markdownContent","marked.parse","prepareHtml","lang","code","escapedCode","escapeHtml","copyToClipboard","clipboard","writeText","alert","toggleCollapse","toggleCollapseGraph","toggleCollapseFGraph","getDomainName","URL","getFaviconUrl","onCardClick","sources","sourcesDrawer","openOuterEditor","onCloseEditor","onDrawerClosed","onCloseSource","toggleDrawer","todo","updateButtonVisibility","openLinkInNewTab","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","first_name","firstName","last_name","lastName","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","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,OA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AI,qBAEZ,IAAMI,EAASpF,KAAK2O,YAAY7L,WAAU,gDAAgD9C,KAAK8f,eAAc,UAAU9f,KAAK8D,MACtHiE,EAAU,IAAIC,EAAAA,YAAY,CAC9BC,eAAgB,mBAChBJ,OAAQ,6BAGNmL,EAAO,CACTmV,KAAMnoB,KAAKuqB,aACX5R,QAAS3Y,KAAK8qB,eAGhB,OAAO9qB,KAAKyH,KAAKyjB,IAAI9lB,EAAK4N,EAAM,CAAEjL,QAAOA,IAAIO,KAC3CuL,EAAAA,WAAU,SAACxM,GAMT,OAFA1C,EAAKwE,IAAIiG,eAEF0E,EAAAA,GAAGzM,MAEZ0M,EAAAA,YAAW,SAAC3S,GAGV,OAFA2D,QAAQ3D,MAAM,kCAAmCA,GAE1C0S,EAAAA,GAAG,oCArHjBgT,EAAAA,UAAStiB,KAAA,CAAC,CACTuiB,SAAU,sBACVC,SAAA,4hBA7BAK,EAAAA,yBAHOte,EAAAA,qDAoCN4e,EAAAA,+BACAA,EAAAA,+BACAA,EAAAA,8BACAA,EAAAA,qBACAA,EAAAA,eCvBH,iCALCwD,EAAAA,SAAQ3mB,KAAA,CAAC,CACR4mB,aAAc,CAACvD,EAAkB7e,EAAqBof,EAAsBJ,EAAcsC,GAC1Fe,QAAS,CAACC,EAAAA,aAAcC,EAAAA,cAAeC,EAAAA,iBAAkBC,EAAAA,YAAaC,EAAAA,aACtEC,QAAS,CAAC9D,EAAkB7e,EAAqBof","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, domain) {\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 'domain-authority': domain\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\r\n domainAuthorityValue: any;\r\n\r\n ngOnInit(): void {\r\n this.environment = this.isDev ? dev_environment : prod_environment;\r\n\r\n const domain = window.location.hostname;\r\n\r\n // Determine the header value based on the domain\r\n\r\n\r\n if (domain.includes('pre-app.social27.com')) {\r\n this.domainAuthorityValue = 'pre-prod-lite';\r\n } else if (domain.includes('app.social27.com')) {\r\n this.domainAuthorityValue = 'prod-lite';\r\n } else if (domain.includes('hivegpt.io')) {\r\n this.domainAuthorityValue = 'hivegpt';\r\n }\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, this.domainAuthorityValue).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 'domain-authority': this.domainAuthorityValue\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 'domain-authority': this.domainAuthorityValue\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 'domain-authority': this.domainAuthorityValue\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 'domain-authority': this.domainAuthorityValue\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 'domain-authority': this.domainAuthorityValue\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 'domain-authority': this.domainAuthorityValue\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 // Create a custom renderer to modify <a> tags\r\n const renderer = new marked.Renderer();\r\n\r\n // Customize anchor tags to include target=\"_blank\"\r\n renderer.link = (href: string, title: string, text: string) => {\r\n return `<a href=\"${href}\" title=\"${title || ''\r\n }\" target=\"_blank\">${text}</a>`;\r\n };\r\n\r\n // Parse the markdown content to HTML using marked with the custom renderer\r\n const markdownContent = marked.parse(markdown, { renderer: renderer });\r\n\r\n // Sanitize the parsed HTML using Angular's DomSanitizer\r\n const sanitizedHtml = this.sanitizer.bypassSecurityTrustHtml(\r\n markdownContent\r\n );\r\n\r\n // Return the safe HTML content for display\r\n return sanitizedHtml;\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 first_name: this.firstName,\r\n last_name: this.lastName\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\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 'domain-authority': this.domainAuthorityValue\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","domain","headers","HttpHeaders","Content-Type","x-api-key","hive-bot-id","domain-authority","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","window","location","hostname","includes","domainAuthorityValue","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.Renderer","href","title","markdownContent","marked.parse","prepareHtml","lang","code","escapedCode","escapeHtml","copyToClipboard","clipboard","writeText","alert","toggleCollapse","toggleCollapseGraph","toggleCollapseFGraph","getDomainName","URL","getFaviconUrl","onCardClick","sources","sourcesDrawer","openOuterEditor","onCloseEditor","onDrawerClosed","onCloseSource","toggleDrawer","todo","updateButtonVisibility","openLinkInNewTab","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","makeAskRequest_fetch","workflowId","workflow_inputs","user_question","user_id","first_name","firstName","last_name","lastName","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","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,EA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(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, domain) {\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 'domain-authority': domain\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\r\n domainAuthorityValue: any;\r\n\r\n ngOnInit(): void {\r\n this.environment = this.isDev ? dev_environment : prod_environment;\r\n\r\n const domain = window.location.hostname;\r\n\r\n // Determine the header value based on the domain\r\n\r\n\r\n if (domain.includes('pre-app.social27.com')) {\r\n this.domainAuthorityValue = 'pre-prod-lite';\r\n } else if (domain.includes('app.social27.com')) {\r\n this.domainAuthorityValue = 'prod-lite';\r\n } else if (domain.includes('hivegpt.io')) {\r\n this.domainAuthorityValue = 'hivegpt';\r\n }\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, this.domainAuthorityValue).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 'domain-authority': this.domainAuthorityValue\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 'domain-authority': this.domainAuthorityValue\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 'domain-authority': this.domainAuthorityValue\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 'domain-authority': this.domainAuthorityValue\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 'domain-authority': this.domainAuthorityValue\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 'domain-authority': this.domainAuthorityValue\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 // Create a custom renderer to modify <a> tags\r\n const renderer = new marked.Renderer();\r\n\r\n // Customize anchor tags to include target=\"_blank\"\r\n renderer.link = (href: string, title: string, text: string) => {\r\n return `<a href=\"${href}\" title=\"${title || ''\r\n }\" target=\"_blank\">${text}</a>`;\r\n };\r\n\r\n // Parse the markdown content to HTML using marked with the custom renderer\r\n const markdownContent = marked.parse(markdown, { renderer: renderer });\r\n\r\n // Sanitize the parsed HTML using Angular's DomSanitizer\r\n const sanitizedHtml = this.sanitizer.bypassSecurityTrustHtml(\r\n markdownContent\r\n );\r\n\r\n // Return the safe HTML content for display\r\n return sanitizedHtml;\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_fetch(\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 first_name: this.firstName,\r\n last_name: this.lastName\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\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 'domain-authority': this.domainAuthorityValue\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\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 const url = `${this.environment.BASE_URL}/ai/ask`;\r\n\r\n const body: any = {\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 first_name: this.firstName,\r\n last_name: this.lastName,\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 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 'domain-authority': this.domainAuthorityValue,\r\n });\r\n\r\n this.http.post(url, body, { headers })\r\n .subscribe({\r\n next: (data) => {\r\n console.log(data);\r\n // Additional response handling if needed\r\n },\r\n error: (err) => {\r\n console.error('Error: ', err);\r\n this.isChatingWithAi = false;\r\n },\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\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"]}