export const __webpack_esm_id__=48475;export const __webpack_esm_ids__=[7809,16664,48475,94608];export const __webpack_esm_modules__={7809(t,e,s){s.d(e,{g:()=>a,p:()=>i});class a{constructor(t={}){this._chatId=t.chatId,this._chatName=t.chatName||"",this._timestamp=t.timestamp,this._messages=t.messages||[],this._continueRunId=t.continueRunId,this.tokenUsageInfo=t.tokenUsageInfo}get chatId(){return this._chatId}set chatId(t){this._chatId=t}get chatName(){return this._chatName}set chatName(t){this._chatName=t}get timestamp(){return this._timestamp}set timestamp(t){this._timestamp=t}get messages(){return this._messages}set messages(t){this._messages=t}get continueRunId(){return this._continueRunId}set continueRunId(t){this._continueRunId=t}}class i{constructor(t,e){this._chatItem=t,this._runId=e}get chatId(){return this._chatItem.chatId}toContinueRunRequestPayload(){return{conversationId:this.chatId,runId:this._runId,agentId:this._chatItem.agentId,tzOffset:-(new Date).getTimezoneOffset()}}}},94608(t,e,s){s.d(e,{T:()=>i,s:()=>n});var a=s(16664);class i{constructor(t,e){this._chatId=t,this._agentId=void 0,this._question=e,this._answers=[]}get chatId(){return this._chatId}set chatId(t){this._chatId=t}get agentId(){return this._agentId}set agentId(t){this._agentId=t}get question(){return this._question}set question(t){this._question=t}get answers(){return this._answers}set answers(t){this._answers=t}setQuestionMessage(t){this._question||(this._question=new a.Z({role:a.W.USER})),this._question.message=t}getQuestionMessage(){return this._question.message}toCreateChatRequestPayload(){return{agentId:this._agentId,question:this._question.message}}toAskRequestPayload(){return{conversationId:this._chatId,agentId:this._agentId,question:this._question.message,tzOffset:-(new Date).getTimezoneOffset()}}toExplainResponsePayload(t){return{conversationId:this._chatId,answerId:t}}}class n{constructor(t=[]){this._items=t}isEmpty(){return 0===this._items.length}appendItem(t){this._items.push(t)}get items(){return this._items}set items(t){this._items=t||[]}getLast(){if(!this.isEmpty())return this._items[this._items.length-1]}}},16664(t,e,s){s.d(e,{W:()=>i,Z:()=>a});class a{constructor(t){this._id=t.id,this._role=t.role,this._message=t.message,this._timestamp=1e3*t.timestamp,this.tokenUsageInfo=t.tokenUsageInfo,this._isTerminalState=t.isTerminalState,this._status=t.status}addToChatAnswer(t){t.messages=[this]}get id(){return this._id}set id(t){this._id=t}get role(){return this._role}set role(t){this._role=t}get message(){return this._message}set message(t){this._message=t}get timestamp(){return this._timestamp}set timestamp(t){this._timestamp=t}get isTerminalState(){return this._isTerminalState}set isTerminalState(t){this._isTerminalState=t}get status(){return this._status}set status(t){this._status=t}}const i={USER:"user",ASSISTANT:"assistant"}},48475(t,e,s){s.d(e,{Bn:()=>o,Pq:()=>r});var a=s(16664),i=s(94608),n=s(7809);const h=t=>t?t.map(t=>m(t)):[],r=(t=[])=>{const e=[];let s;return t.forEach(t=>{const n=t.conversationId;a.W.USER===t.role?(s&&e.push(s),s=new i.T(n,m(t))):(s||(s=new i.T(n,null)),s.answers.push(m(t)),s.agentId=t.agentId)}),s&&e.push(s),new i.s(e)},m=t=>{if(t)return new a.Z({id:t.id,role:t.role,message:t.message,timestamp:t.timestamp,tokenUsageInfo:t.usage,data:t,isTerminalState:t.isTerminalState,status:t.terminalStatusCode})},o=t=>{if(t)return new n.g({chatId:t.id,chatName:t.name,timestamp:t.timestamp,messages:h(t.messages),continueRunId:t.continueRunId,tokenUsageInfo:t.usage})}}};
//# sourceMappingURL=48475.4a5e24f512db5d486b20.bundle.js.map