ai-helper-agent 2.8.9 → 2.8.10
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.
- package/dist/assets/background.js +68 -68
- package/dist/assets/{chat-export-CCgB_PeN.js → chat-export-DduslUlT.js} +1 -1
- package/dist/assets/content.js +48 -41
- package/dist/assets/{context-indicator-CWyjBBv3.js → context-indicator-Bs34HFah.js} +74 -74
- package/dist/assets/options.js +1 -1
- package/dist/assets/side_panel.js +94 -95
- package/dist/assets/{version-DUmOB_mV.js → version-h3EcDzjp.js} +2 -2
- package/dist/manifest.json +1 -1
- package/dist/options.html +1 -1
- package/dist/side_panel.html +2 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-store-QTeMyM9O.js","assets/chunk-CMxvf4Kt.js","assets/model-profiles-C3kJEHM6.js","assets/i18n-DvmxOw8q.js","assets/pdf-DnVqBaAN.js","assets/__vite-browser-external-CM3Eme-n.js","assets/lib-YwkWjNcC.js","assets/jszip.min-DO6SOhXU.js","assets/dist-DuuG_8Br.js","assets/chat-export-
|
|
2
|
-
import{o as e,r as t}from"./chunk-CMxvf4Kt.js";import{a as n,c as r,l as i,r as a}from"./i18n-DvmxOw8q.js";import{$ as o,At as s,Dt as c,Et as l,H as u,Ht as d,Jt as f,Lt as p,Ot as m,Pt as h,Rt as g,S as _,St as v,U as y,Ut as b,Y as x,Yt as S,b as C,ct as w,dt as T,kt as E,lt as D,ut as O,wt as k,x as A}from"./model-profiles-C3kJEHM6.js";import{A as j,B as M,C as N,D as ee,E as te,M as ne,O as re,S as ie,T as ae,a as oe,b as se,c as ce,d as le,f as ue,h as de,j as fe,k as pe,l as me,m as he,n as ge,o as _e,p as ve,r as ye,s as be,t as xe,u as Se,v as Ce,w as we,x as Te,y as Ee}from"./session-store-owqj23pJ.js";import{a as De,n as Oe,r as ke,t as Ae}from"./voice-shortcut-Dtt3nhkz.js";import{A as je,B as Me,C as Ne,E as Pe,F as Fe,H as Ie,I as Le,K as Re,L as ze,M as P,O as Be,R as Ve,S as He,T as Ue,U as We,V as Ge,W as Ke,X as qe,Y as F,Z as Je,_ as Ye,b as Xe,d as Ze,f as Qe,g as $e,h as et,i as tt,j as nt,k as rt,l as it,m as at,n as ot,p as st,u as ct,v as lt,w as ut,x as dt,z as I}from"./version-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-store-QTeMyM9O.js","assets/chunk-CMxvf4Kt.js","assets/model-profiles-C3kJEHM6.js","assets/i18n-DvmxOw8q.js","assets/pdf-DnVqBaAN.js","assets/__vite-browser-external-CM3Eme-n.js","assets/lib-YwkWjNcC.js","assets/jszip.min-DO6SOhXU.js","assets/dist-DuuG_8Br.js","assets/chat-export-DduslUlT.js","assets/dist-BUuoW_84.js","assets/version-h3EcDzjp.js","assets/session-store-owqj23pJ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e,r as t}from"./chunk-CMxvf4Kt.js";import{a as n,c as r,l as i,r as a}from"./i18n-DvmxOw8q.js";import{$ as o,At as s,Dt as c,Et as l,H as u,Ht as d,Jt as f,Lt as p,Ot as m,Pt as h,Rt as g,S as _,St as v,U as y,Ut as b,Y as x,Yt as S,b as C,ct as w,dt as T,kt as E,lt as D,ut as O,wt as k,x as A}from"./model-profiles-C3kJEHM6.js";import{A as j,B as M,C as N,D as ee,E as te,M as ne,O as re,S as ie,T as ae,a as oe,b as se,c as ce,d as le,f as ue,h as de,j as fe,k as pe,l as me,m as he,n as ge,o as _e,p as ve,r as ye,s as be,t as xe,u as Se,v as Ce,w as we,x as Te,y as Ee}from"./session-store-owqj23pJ.js";import{a as De,n as Oe,r as ke,t as Ae}from"./voice-shortcut-Dtt3nhkz.js";import{A as je,B as Me,C as Ne,E as Pe,F as Fe,H as Ie,I as Le,K as Re,L as ze,M as P,O as Be,R as Ve,S as He,T as Ue,U as We,V as Ge,W as Ke,X as qe,Y as F,Z as Je,_ as Ye,b as Xe,d as Ze,f as Qe,g as $e,h as et,i as tt,j as nt,k as rt,l as it,m as at,n as ot,p as st,u as ct,v as lt,w as ut,x as dt,z as I}from"./version-h3EcDzjp.js";import{a as ft,c as pt,i as mt,n as ht,o as gt,r as _t,s as vt}from"./agent-store-QTeMyM9O.js";import{A as yt,C as bt,D as xt,E as St,M as Ct,O as wt,S as Tt,T as Et,_ as Dt,a as Ot,b as kt,c as At,d as jt,f as Mt,g as Nt,h as Pt,i as Ft,k as It,l as Lt,m as Rt,n as zt,o as Bt,p as Vt,r as Ht,s as Ut,t as Wt,u as Gt,v as Kt,w as qt,x as Jt,y as Yt}from"./workspace-manager-DVPkwn2d.js";var Xt=ne.map(e=>e.id),Zt=[...new Set([...S,`mcp`,`knowledge`])],Qt=[{labelKey:`presetMode.preciseLabel`,tipKey:`presetMode.preciseTip`,temp:.2,topP:1},{labelKey:`presetMode.generalLabel`,tipKey:`presetMode.generalTip`,temp:.45,topP:.9},{labelKey:`presetMode.divergentLabel`,tipKey:`presetMode.divergentTip`,temp:.65,topP:.9},{labelKey:`presetMode.creativeLabel`,tipKey:`presetMode.creativeTip`,temp:.9,topP:.9}];n(`zh`,{contextUsage:{compactionInjection:`[上下文摘要|压缩了{count}条历史]`}}),n(`en`,{contextUsage:{compactionInjection:`[Context Summary | {count} messages compacted]`}});var $t=2e3,en=.7,tn=1e3;function nn(e,{isolateChat:t=!0,maxMemoryMessages:n=null,compaction:r=null,historyBudget:i=1/0,currentMessage:a=null}={}){let o=a||{role:`user`,content:``};if(!t)return{messages:[o],keptHistory:[],compactionApplied:!1,trimmedCount:0,historySummaryText:null};let c=Array.isArray(e)?e:[],l=!1,u=-1;r&&r.summary&&r.upToMessageId&&(u=c.findIndex(e=>e.messageId===r.upToMessageId),l=u>=0);let f=c,p=c.map((e,t)=>t);n&&n>0&&c.length>n&&(f=c.slice(c.length-n),p=p.slice(c.length-n));let m=[];for(let e=0;e<f.length;e++)l&&p[e]<=u||m.push(f[e]);let g=[],_=E([o]);for(let e=m.length-1;e>=0;e--){let t=m[e],n=E([{...t,content:d(t.content)}]);if(_+n<=i)g.unshift(t),_+=n;else break}let v=null,y=m.length-g.length;if(y>0){let e=h(m.slice(0,y));e&&(v=s(e)>tn?e.substring(0,tn*4)+`
|
|
3
3
|
...[历史摘要已截断]`:e)}return{messages:[...g,o],keptHistory:g,compactionApplied:l,trimmedCount:y,historySummaryText:v}}function rn(e,t){return!t||!t.summary?e:`${e}\n\n${r(`contextUsage.compactionInjection`,{count:t.compressedCount||0})}\n${t.summary}`}function an(e,t,n,r){return t?.compactionApplied&&n?.summary?e[0]={...e[0],content:rn(e[0].content,n)}:n?.summary&&r?.warn(`[SidePanel] contextCompaction invalid (upToMessageId not found), ignored this send`),e}function on({model:e,customModelMap:t=null,systemPromptText:n=``,toolCount:r=0,history:i=[],inputText:a=``,maxMemoryMessages:o=null,compaction:u=null,isolateChat:d=!0,userConfiguredWindow:f=0}={}){let m=p(e,f,t),h=m-s(n)-l-$t,g=Math.floor(Math.max(h,0)*en),_={role:`user`,content:a},v=d?u:null,y=nn(i,{isolateChat:d,maxMemoryMessages:o,compaction:v,historyBudget:g,currentMessage:_}),b=s(y.compactionApplied?rn(n,v):n),x=r*200,S=E(y.keptHistory),C=a&&a.trim()?E([_]):0,w=b+x+S+C,T=c(w,m);return{usedTokens:w,contextWindow:m,ratio:m>0?w/m:0,level:T.level,breakdown:{system:b,tools:x,history:S,input:C,outputReserve:l,safetyMargin:$t,selectedCount:y.keptHistory.length,totalCount:i.length,trimmedCount:y.trimmedCount,compactionApplied:y.compactionApplied,compactionInvalid:!!(v&&v.summary&&!y.compactionApplied),historyBudget:g}}}function sn(e,{maxMemoryMessages:t=null,compaction:n=null}={}){let r=nn(e,{isolateChat:!0,maxMemoryMessages:t,compaction:n,historyBudget:1/0,currentMessage:null}),i=[],a=!!(r.compactionApplied&&n?.summary);a&&i.push({role:`user`,content:`【已有摘要】\n${n.summary}`});for(let e of r.keptHistory){let t=d(e.content);i.push({role:e.role,content:typeof t==`string`?t:JSON.stringify(t??``)||``})}return{material:i,includedCount:r.keptHistory.length,hasOldSummary:a}}function cn(e){if(!e||!e.trim()||e.trim()==`/`)return;let t=e.trim(),n=C.inputHistory.indexOf(t);n!==-1&&C.inputHistory.splice(n,1),C.inputHistory.push(t),C.inputHistory.length>20&&C.inputHistory.shift(),ln()}function ln(){try{chrome.storage.local.set({inputHistory:C.inputHistory}),i.debug(`[SidePanel] input history saved,count:`,C.inputHistory.length)}catch(e){i.error(`[SidePanel] saveinput history failed:`,e)}}var un=[`workspace`,`bookmark`,`toc`,`search`,`todo`,`schedule`],dn=`.workspace-panel.expanded, .bookmark-panel.expanded, .message-toc-panel.expanded, .search-panel.expanded, .schedule-panel.open`,fn=null,pn=null;function mn(){if(fn)return fn;fn=document.createElement(`div`),fn.className=`side-rail`,fn.id=`sideRail`,fn.innerHTML=un.map(e=>`<div class="side-rail-slot" data-slot="${e}"></div>`).join(``),document.body.appendChild(fn),gn();let e=document.getElementById(`chatContainer`);return e&&typeof ResizeObserver<`u`&&new ResizeObserver(gn).observe(e),window.addEventListener(`resize`,gn),fn}function hn(e){return(fn||mn()).querySelector(`.side-rail-slot[data-slot="${e}"]`)}function gn(){if(!fn)return;let e=document.getElementById(`chatContainer`);if(!e)return;let t=e.getBoundingClientRect(),n=window.innerHeight;fn.style.top=`${Math.max(0,Math.round(t.top))}px`,fn.style.bottom=`${Math.max(0,Math.round(n-t.bottom))}px`,_n()}function _n(){pn&&clearTimeout(pn),pn=setTimeout(()=>{pn=null,document.querySelectorAll(dn).forEach(Be)},120)}n(`zh`,{messageToc:{toggleTitle:`显示目录(H{count}个标题)`,title:`目录`,headingCount:`{count} 个`,lock:`锁定目录(不自动收起)`,unlock:`解锁目录`,close:`关闭目录`}}),n(`en`,{messageToc:{toggleTitle:`Show table of contents (H{count} headings)`,title:`Contents`,headingCount:`{count}`,lock:`Pin table of contents`,unlock:`Unpin table of contents`,close:`Close table of contents`}});var vn=`messageTocLocked`,yn=!1,bn=`<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 9.9-1"/></svg>`,xn=`<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>`;function Sn(e){e&&(e.innerHTML=yn?xn:bn,e.title=r(yn?`messageToc.unlock`:`messageToc.lock`),e.classList.toggle(`locked`,yn))}function Cn(){try{let e=chrome.storage?.local?.set?.({[vn]:yn});e&&typeof e.catch==`function`&&e.catch(()=>{})}catch{}}function wn(){document.addEventListener(`mouseover`,Tn,!0),document.addEventListener(`mouseout`,En,!0);try{let e=chrome.storage?.local?.get?.(vn);e&&typeof e.then==`function`?e.then(e=>{yn=!!(e&&e[vn])}).catch(()=>{}):e&&typeof e==`object`&&(yn=!!e[vn])}catch{}i.debug(`[SidePanel] messagedirectory featureinitializing`)}function Tn(e){if(!(e.target instanceof Element))return;if(e.target.closest(`.message-toc-container`)){C.isMouseOverToc=!0;return}let t=e.target.closest(`.message.assistant`),n=e.target.closest(`.workspace-preview-markdown`);if(!t&&!n)return;let r=t||n,i=r.querySelectorAll(`.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6`);if(i.length===0){yn||Nn();return}Mn(r,i)}function En(e){if(!(e.target instanceof Element))return;if(e.target.closest(`.message-toc-container`)){C.isMouseOverToc=!1,C.tocHideTimer&&=(clearTimeout(C.tocHideTimer),null);return}let t=e.target.closest(`.message.assistant`),n=e.target.closest(`.workspace-preview-markdown`);if(!t&&!n||yn)return;let r=e.relatedTarget;r&&(r.closest(`.message-toc-container`)||r.closest(`.message.assistant`)||r.closest(`.workspace-preview-markdown`))||C.isMouseOverToc||(C.tocHideTimer&&clearTimeout(C.tocHideTimer),C.tocHideTimer=setTimeout(()=>{C.isMouseOverToc||Nn(),C.tocHideTimer=null},800))}var Dn=null,On=null;function kn(e){let t=e.parentElement;for(;t&&t!==document.body&&t!==document.documentElement;){let e=getComputedStyle(t).overflowY;if((e===`auto`||e===`scroll`||e===`overlay`)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}function An(e,t,n,r){if(jn(),n.length===0)return;let i=kn(t),a=e.querySelector(`.message-toc-content`),o=Array.from(e.querySelectorAll(`.message-toc-item`)),s=new Map(o.map(e=>[e.dataset.target,e])),c=0,l=null,u=-1,d=e=>{if(!a)return;let t=e.getBoundingClientRect(),n=a.getBoundingClientRect();(t.top<n.top||t.bottom>n.bottom)&&(a.scrollTop+=t.top-n.top-(n.height-t.height)/2)},f=()=>{let e=window.innerHeight||document.documentElement.clientHeight||0;if(!i)return{top:0,bottom:e};let t=i.getBoundingClientRect();return{top:Math.max(t.top,0),bottom:Math.min(t.top+i.clientHeight,e)}},p=()=>{if(i)return i.scrollTop+i.clientHeight>=i.scrollHeight-2;let e=document.documentElement;return window.scrollY+window.innerHeight>=e.scrollHeight-2},m=()=>i?i.scrollTop<=2:window.scrollY<=2,h=()=>{if(c=0,!e.isConnected)return;let t=f(),i=t.top,a=t.bottom,h=Math.max(a-i,1),g=n.map(e=>e.getBoundingClientRect().top),_=0;for(let e=0;e<g.length&&g[e]<=i;e++)_=e;let v=i+h*.75,y=_,b=_+1;if(b<g.length){let e=g[b];u===b?e<=a&&(y=b):e<=v&&(y=b)}m()?y=0:p()&&(y=n.length-1);let x=n[y];if(!x||x.id===l)return;u=y,l=x.id,o.forEach(e=>e.classList.toggle(`active`,e.dataset.target===l));let S=s.get(l);S&&r.classList.contains(`expanded`)&&d(S)},g=()=>{c||=requestAnimationFrame(h)};document.addEventListener(`scroll`,g,{capture:!0,passive:!0}),window.addEventListener(`resize`,g,{passive:!0});let _=typeof IntersectionObserver==`function`?new IntersectionObserver(g,{threshold:[0,.25,.5,.75,1]}):null;_&&n.forEach(e=>_.observe(e)),h(),On=()=>{if(h(),!l)return;let e=s.get(l);e&&d(e)},Dn=()=>{c&&cancelAnimationFrame(c),c=0,document.removeEventListener(`scroll`,g,{capture:!0}),window.removeEventListener(`resize`,g),_&&_.disconnect()}}function jn(){Dn&&=(Dn(),null),On=null}function Mn(e,t){let n=Array.from(t);C.messageTocContainer&&Nn(),n.forEach((e,t)=>{e.id||=`toc-heading-${Date.now()}-${t}`});let i=document.createElement(`div`);i.className=`message-toc-container`,i.dataset.headingsCount=n.length;let a=0,o=n.map(e=>{let t=parseInt(e.tagName.charAt(1)),n=e.textContent.trim(),r=n.length>30?n.substring(0,30)+`...`:n,i=`H${t}`;return a++,`
|
|
4
4
|
<li class="message-toc-item level-${t}"
|
|
5
5
|
data-target="${e.id}"
|
|
@@ -57,7 +57,7 @@ import{o as e,r as t}from"./chunk-CMxvf4Kt.js";import{a as n,c as r,l as i,r as
|
|
|
57
57
|
`,i.addEventListener(`click`,()=>Va(t)),g.appendChild(i)}),a)){let e=document.createElement(`div`);e.className=`clarify-option-item`,e.dataset.index=-1,e.setAttribute(`role`,`radio`),e.setAttribute(`aria-checked`,`false`),e.setAttribute(`tabindex`,`-1`),e.innerHTML=`
|
|
58
58
|
<div class="clarify-option-radio"></div>
|
|
59
59
|
<div class="clarify-option-content clarify-option-other">${r(`clarify.otherOption`)}</div>
|
|
60
|
-
`,e.addEventListener(`click`,()=>Va(-1)),g.appendChild(e);let t=document.getElementById(`clarifyCustomInput`);t&&g.appendChild(t)}let _=document.getElementById(`clarifyCustomInput`);_&&_.classList.remove(`show`);let v=document.getElementById(`clarifyAdditionalInfo`);v&&v.classList.toggle(`show`,o);let y=document.getElementById(`clarifyCustomTextarea`);y&&(y.value=``);let b=document.getElementById(`clarifyAdditionalTextarea`);b&&(b.value=``),l.classList.add(`show`);let x=document.querySelector(`#clarifyContainer .clarify-content`),S=document.querySelector(`#clarifyContainer .clarify-header`);return x&&(x.scrollTop=0),S&&S.classList.remove(`scrolled`),ba=null,xa=!1,Da(),Ta(s),i.debug(`[SidePanel] clarification dialogshown:`,e.toolCallId,t),!0}function Na(){if(z)return!0;if(ya.length===0)return!1;let e=ya.shift();return Ma(e)?(z=e,_a(va,e),!0):(i.error(`[SidePanel] clarify overlay missing, settle as unanswered:`,e.toolCallId),Pa(e),F(r(`clarify.dropped`),`warning`),!1)}function Pa(e){Promise.resolve(chrome.runtime.sendMessage({type:`CLARIFY_RESPONSE`,toolCallId:e.toolCallId,selectedOption:-1,customInput:``,additionalInfo:``})).catch(e=>{i.debug(`[SidePanel] send unanswered clarify response failed:`,e?.message)})}function Fa(){if(ya.length>0){da(va);return}Ia(),fa(va)}function Ia(){let e=document.getElementById(`clarifyOverlay`);e&&e.classList.remove(`show`),C.currentClarifyToolCallId=null,C.currentClarifySessionId=null,Ea()}function La(){z=null,Fa()}function Ra(e,t){return!!e.toolCallId&&e.toolCallId===t.toolCallId&&(e.sessionId||null)===(t.sessionId||null)&&e.question===t.question}function za(e){let t={...e,sessionId:e.sessionId||null};if(i.debug(`[SidePanel] showclarification dialog:`,t.toolCallId,e),z&&Ra(z,t)){i.debug(`[SidePanel] duplicate clarify request, ignored:`,t.toolCallId);return}if(ya.some(e=>Ra(e,t))){i.debug(`[SidePanel] queued duplicate clarify, ignored:`,t.toolCallId);return}ya.push(t),da(va),ja(),ha(va)}function Ba(){if(z){La();return}Ia()}function Va(e){document.querySelectorAll(`.clarify-option-item`).forEach(e=>{e.classList.remove(`selected`),e.setAttribute(`aria-checked`,`false`),e.setAttribute(`tabindex`,`-1`)});let t=document.querySelector(`.clarify-option-item[data-index="${e}"]`);t&&(t.classList.add(`selected`),t.setAttribute(`aria-checked`,`true`),t.setAttribute(`tabindex`,`0`));let n=document.getElementById(`clarifyCustomInput`);if(n)if(e===-1){n.classList.add(`show`);let e=document.getElementById(`clarifyCustomTextarea`);e&&e.focus()}else n.classList.remove(`show`);i.debug(`[SidePanel] selectclarificationselect :`,e)}function Ha(){if(!z){i.error(`[SidePanel] no has currenttool callID`);return}let e=z.toolCallId,t=z.sessionId,n=-1;document.querySelectorAll(`.clarify-option-item`).forEach((e,t)=>{e.classList.contains(`selected`)&&(n=parseInt(e.dataset.index))});let r=document.getElementById(`clarifyCustomTextarea`),a=r?r.value.trim():``,o=document.getElementById(`clarifyAdditionalTextarea`),s=o?o.value.trim():``,c={type:`CLARIFY_RESPONSE`,toolCallId:e,sessionId:t,selectedOption:n,customInput:a,additionalInfo:s};i.debug(`[SidePanel] send clarificationresponse:`,c),chrome.runtime.sendMessage(c),La()}function Ua(){if(z){let e={type:`CLARIFY_RESPONSE`,toolCallId:z.toolCallId,sessionId:z.sessionId,selectedOption:-1,customInput:``,additionalInfo:``};chrome.runtime.sendMessage(e)}Ba()}function Wa(e){return e?.reason===`timeout`&&e?.defaultOption||null}function Ga(e){i.debug(`[SidePanel] received clarificationtimeoutnotification:`,e);let t=e?.toolCallId;if(!t){if(e?.sessionId&&C.currentClarifySessionId&&e.sessionId!==C.currentClarifySessionId){i.debug(`[SidePanel] clarificationtimeoutfrom othersession,ignore`);return}if(!z)return;Ka(Wa(e));return}if(z&&z.toolCallId===t){Ka(Wa(e));return}let n=ya.findIndex(e=>e.toolCallId===t);n>=0&&(i.debug(`[SidePanel] drop queued clarify (already settled by background):`,t),ya.splice(n,1),ja(),ha(va))}function Ka(e=null){let t=z?.question;La(),F(e?r(`clarify.timedOutDefaulted`,{option:e}):`${r(`clarify.timedOut`)}${t?`:${t}`:``}`,`warning`),Ca(`error`)}ua(va,{present:Na,pendingCount:()=>ya.length,refresh:ja});function qa(){let e=document.getElementById(`clarifyConfirmBtn`);e&&e.addEventListener(`click`,Ha);let t=document.getElementById(`clarifyCancelBtn`);t&&t.addEventListener(`click`,Ua);let n=document.getElementById(`clarifyExtendBtn`);n&&n.addEventListener(`click`,Oa);let r=document.querySelector(`#clarifyContainer .clarify-content`),a=document.querySelector(`#clarifyContainer .clarify-header`);r&&a&&r.addEventListener(`scroll`,()=>{a.classList.toggle(`scrolled`,r.scrollTop>2)}),chrome.runtime.onMessage.addListener((e,t,n)=>{e.type===`SHOW_CLARIFY_DIALOG`?(i.debug(`[SidePanel] received clarificationrequested :`,e,`currently activesession:`,C.activeSessionId),za(e.data),n({success:!0})):e.type===`PLAY_NOTIFICATION_SOUND`?(i.debug(`[SidePanel] recei to play soundrequested :`,e),Ca(e.soundType),n({success:!0})):e.type===`CLARIFY_TIMEOUT`?Ga(e):e.type===`CLARIFY_EXTENDED`&&ka(e)}),i.debug(`[SidePanel] clarification dialogeventinitializing`)}var Ja=oa.CONFIRM,Ya=[],Xa=null,Za=null,Qa=null;function $a(e){let t=Math.floor(e/60),n=e%60;return`${t}:${String(n).padStart(2,`0`)}`}function eo(){Za&&=(clearInterval(Za),null),Qa&&=(clearTimeout(Qa),null)}function to(e,t){return!!e.toolCallId&&e.toolCallId===t.toolCallId&&(e.sessionId||null)===(t.sessionId||null)&&JSON.stringify(e.args??null)===JSON.stringify(t.args??null)}function no(e){let t=e.message||r(`dialog.confirmAction`,{name:e.toolLabel||e.toolName}),n=Ya.length,i=ga(Ja),a=t;return n>0&&(a+=` ${r(`dialog.pendingQueue`,{count:n})}`),i>0&&(a+=` ${r(`dialog.otherPending`,{count:i})}`),a}function ro(e){let{toolName:t,toolLabel:n,args:a,timeout:o=3e5}=e;C.currentConfirmToolCallId=e.toolCallId,C.currentConfirmSessionId=e.sessionId||null;let s=document.getElementById(`confirmOverlay`);if(!s)return!1;document.getElementById(`confirmToolName`).textContent=n||t;let c=e.variant===`network`,l=document.getElementById(`confirmTitle`);l&&(l.textContent=r(c?`dialog.networkTitle`:`dialog.operationConfirm`));let u=document.getElementById(`confirmApproveLoopBtn`);u&&(u.textContent=r(c?`dialog.approveWhitelist`:`dialog.approveLoop`));let d=document.getElementById(`confirmArgsSummary`);if(d&&a){let e=Object.entries(a).filter(([e,t])=>t!=null&&t!==``).slice(0,5);e.length>0?(d.textContent=``,e.forEach(([e,t],n)=>{n>0&&d.appendChild(document.createTextNode(`、 `));let r=typeof t==`string`?t:JSON.stringify(t),i=r.length>80?r.substring(0,80)+`...`:r,a=document.createElement(`span`);a.className=`confirm-arg`,a.style.marginRight=`8px`,r.length>80&&(a.title=r);let o=document.createElement(`strong`);o.textContent=`${e}:`,a.appendChild(o),a.appendChild(document.createTextNode(` ${i}`)),d.appendChild(a)}),d.style.display=`block`):d.style.display=`none`}let f=document.getElementById(`confirmMessage`);f&&(f.textContent=no(e)),eo();let p=Math.floor(o/1e3),m=document.getElementById(`confirmCountdownText`),h=document.getElementById(`confirmCountdown`);return m&&h&&(h.classList.remove(`warning`),h.style.display=`flex`,m.textContent=r(`dialog.remainingTime`,{time:$a(p)}),Za=setInterval(()=>{if(p--,p<=0){clearInterval(Za),Za=null,m.textContent=r(`dialog.remainingTime`,{time:`0:00`});return}m.textContent=r(`dialog.remainingTime`,{time:$a(p)}),p<=30&&h.classList.add(`warning`)},1e3)),s.style.display=`flex`,Qa=setTimeout(()=>{i.debug(`[SidePanel] confirm dialogtimeout,autodeny`),lo(!1,`single`)},o),!0}function io(){if(Xa)return!0;if(Ya.length===0)return!1;let e=Ya.shift();return ro(e)?(Xa=e,_a(Ja,e),!0):(e.resolve&&e.resolve(!1),!1)}function ao(){let e=document.getElementById(`confirmOverlay`);e&&(e.style.display=`none`);let t=document.getElementById(`confirmCountdown`);t&&(t.classList.remove(`warning`),t.style.display=`none`),C.currentConfirmToolCallId=null,C.currentConfirmSessionId=null}function oo(){if(Ya.length>0){da(Ja);return}ao(),fa(Ja)}function so(e){let t=Xa?.resolve;Xa=null,eo(),t&&t(e),oo()}function co(e){let t={...e,sessionId:e.sessionId||null};return i.debug(`[SidePanel] showconfirm dialog:`,t.toolName,e),Xa&&to(Xa,t)?(i.debug(`[SidePanel] duplicate confirm request, ignored:`,t.toolCallId),Promise.resolve(!1)):Ya.some(e=>to(e,t))?(i.debug(`[SidePanel] queued duplicate confirm, ignored:`,t.toolCallId),Promise.resolve(!1)):new Promise(e=>{Ya.push({...t,resolve:e}),da(Ja),Xa&&uo(),ha(Ja)})}function lo(e,t=`single`){if(!Xa)return;let n=Xa.toolCallId,r=Xa.sessionId;eo(),chrome.runtime.sendMessage({type:`TOOL_CONFIRMATION_RESPONSE`,toolCallId:n,confirmed:e,scope:t,sessionId:r}).catch(e=>{i.debug(`[SidePanel] send confirmationresponse failed:`,e.message)}),so(e)}function uo(){if(!Xa)return;let e=document.getElementById(`confirmMessage`);e&&(e.textContent=no(Xa))}function fo(e){let t=e?.toolCallId;if(!t)return;if(Xa&&Xa.toolCallId===t){i.debug(`[SidePanel] dismiss active confirm dialog (already settled by background):`,t),so(!1);return}let n=Ya.findIndex(e=>e.toolCallId===t);if(n>=0){i.debug(`[SidePanel] drop queued confirm dialog (already settled by background):`,t);let[e]=Ya.splice(n,1);e.resolve&&e.resolve(!1),uo(),ha(Ja)}}ua(Ja,{present:io,pendingCount:()=>Ya.length,refresh:()=>{Xa&&uo()}});function po(){let e=document.getElementById(`confirmApproveOnceBtn`),t=document.getElementById(`confirmApproveLoopBtn`),n=document.getElementById(`confirmDenyBtn`);e&&e.addEventListener(`click`,()=>lo(!0,`single`)),t&&t.addEventListener(`click`,()=>{lo(!0,Xa?.variant===`network`?`whitelist`:`loop`)}),n&&n.addEventListener(`click`,()=>lo(!1,`single`)),chrome.runtime.onMessage.addListener((e,t,n)=>e.type===`SHOW_CONFIRM_DIALOG`?(co(e.data),n({received:!0}),!1):e.type===`DISMISS_CONFIRM_DIALOG`?(fo(e.data),n({received:!0}),!1):!1)}var mo=t({closeCurrentSession:()=>ac,handleDuplicateSession:()=>Xs,handleSessionSwitch:()=>Ys,newSession:()=>xo,renderSessionTabs:()=>yo});n(`zh`,{session:{newSession:`新会话`,closeSession:`关闭会话`,taskCompleted:`任务已完成`,noMatch:`未找到匹配的会话`,rename:`重命名`,duplicate:`复制会话`,confirmCloseMessageWithTitle:`确定要关闭会话 "{title}" 吗?`,confirmCloseAllMessage:`确定要关闭所有 {count} 个会话吗?`,confirmCloseAllTitle:`关闭全部会话`,forkedFrom:`已从 "{title}" 分叉`,forkedSession:`已复制会话 "{title}"`,operationFailed:`操作失败:{message}`,sessionListTitle:`会话列表`,closeGroupAll:`全部关闭`,confirmCloseGroupMessage:`确定要关闭“{group}”下的 {count} 个会话吗?`,today:`今天`,yesterday:`昨天`,last7Days:`近 7 天`,earlier:`更早`,todayFormat:`{hour}:{minute}`,yesterdayFormat:`昨天 {hour}:{minute}`,daysAgo:`{count} 天前`,archive:`归档会话`,archiveEntry:`归档区`,archiveEntryTitle:`查看归档会话`,archivePanelTitle:`归档区`,archiveSearchPlaceholder:`搜索归档会话...`,archiveEmpty:`暂无归档会话`,archiveNoMatch:`未找到匹配的归档会话`,archiveHint:`归档只是移出视野,随时可以恢复`,archiveBusyRunning:`该会话任务还在执行,完成后再归档`,archiveBusyQueued:`该会话还有排队任务,先清空队列再归档`,archived:`已归档到归档区`,archivedRestored:`已恢复会话「{title}」`,archivedAt:`归档于 {time}`,restore:`恢复`,restoreTitle:`恢复到会话列表`,deleteForever:`彻底删除`,confirmDeleteForeverTitle:`彻底删除会话`,confirmDeleteForeverMessage:`「{title}」将被彻底删除,消息与执行记录都无法恢复。确定继续吗?`,archiveDeleted:`已彻底删除会话「{title}」`,backToSessionList:`返回会话列表`,expandSidebar:`展开会话列表`,collapseSidebar:`收起会话列表`,searchSessions:`搜索会话`,sortModeTitle:`会话排序`,sortManual:`手动排序(拖拽调整,与标签栏一致)`,sortRecent:`最近更新优先(按时间倒序,带时间分组)`}}),n(`en`,{session:{newSession:`New Session`,closeSession:`Close Session`,taskCompleted:`Task completed`,noMatch:`No matching sessions found`,rename:`Rename`,duplicate:`Duplicate`,confirmCloseMessageWithTitle:`Are you sure you want to close session "{title}"?`,confirmCloseAllMessage:`Are you sure you want to close all {count} sessions?`,confirmCloseAllTitle:`Close All Sessions`,forkedFrom:`Forked from "{title}"`,forkedSession:`Duplicated session "{title}"`,operationFailed:`Operation failed: {message}`,sessionListTitle:`Sessions`,closeGroupAll:`Close all`,confirmCloseGroupMessage:`Are you sure you want to close {count} sessions in "{group}"?`,today:`Today`,yesterday:`Yesterday`,last7Days:`Last 7 days`,earlier:`Earlier`,todayFormat:`{hour}:{minute}`,yesterdayFormat:`Yesterday {hour}:{minute}`,daysAgo:`{count}d ago`,archive:`Archive session`,archiveEntry:`Archived`,archiveEntryTitle:`View archived sessions`,archivePanelTitle:`Archived sessions`,archiveSearchPlaceholder:`Search archived sessions...`,archiveEmpty:`No archived sessions`,archiveNoMatch:`No archived sessions found`,archiveHint:`Archiving only hides a session — you can restore it anytime`,archiveBusyRunning:`This session is still running. Archive it when it finishes`,archiveBusyQueued:`This session still has queued tasks. Clear the queue first`,archived:`Moved to archive`,archivedRestored:`Session "{title}" restored`,archivedAt:`Archived {time}`,restore:`Restore`,restoreTitle:`Restore to session list`,deleteForever:`Delete permanently`,confirmDeleteForeverTitle:`Delete session permanently`,confirmDeleteForeverMessage:`"{title}" will be permanently deleted. Messages and execution logs cannot be recovered. Continue?`,archiveDeleted:`Session "{title}" permanently deleted`,backToSessionList:`Back to sessions`,expandSidebar:`Expand session list`,collapseSidebar:`Collapse session list`,searchSessions:`Search sessions`,sortModeTitle:`Session order`,sortManual:`Manual order (drag to arrange, same as tabs)`,sortRecent:`Most recent first (time order with day groups)`}});var B={visible:!1,highlightIndex:-1,filteredSessions:[]},ho={draggedId:null,sourceType:null};function go(e){if(!e)return``;let t=new Date(e),n=new Date,i=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),a=t.getTime();if(a>=i)return r(`session.todayFormat`,{hour:String(t.getHours()).padStart(2,`0`),minute:String(t.getMinutes()).padStart(2,`0`)});if(a>=i-864e5)return r(`session.yesterdayFormat`,{hour:String(t.getHours()).padStart(2,`0`),minute:String(t.getMinutes()).padStart(2,`0`)});let o=Math.floor((i-a)/864e5);return o<=7?r(`session.daysAgo`,{count:o}):t.getFullYear()===n.getFullYear()?`${t.getMonth()+1}/${t.getDate()}`:`${t.getFullYear()}/${t.getMonth()+1}/${t.getDate()}`}function _o(e){return e.sort((e,t)=>{let n=e.updatedAt?new Date(e.updatedAt).getTime():0;return(t.updatedAt?new Date(t.updatedAt).getTime():0)-n})}function vo(e){if(!e)return`earlier`;let t=new Date(e),n=new Date,r=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),i=t.getTime();return i>=r?`today`:i>=r-864e5?`yesterday`:Math.floor((r-i)/864e5)<=7?`last7Days`:`earlier`}async function yo(e=null){let t=e||await ti({withActiveHistory:!1});C.sessions=t.list,C.activeSessionId=t.activeSessionId;let n=document.getElementById(`sessionTabs`),i=document.getElementById(`sessionTabsScroll`),a=document.getElementById(`sessionTabsActions`);!n||!i||!a||(i.style.opacity=``,i.innerHTML=``,t.list.forEach(e=>{let t=document.createElement(`div`);t.className=`session-tab`,t.dataset.sessionId=e.id,e.id===C.activeSessionId&&t.classList.add(`active`),t.title=e.title;let n=document.createElement(`span`);n.className=`session-tab-title`,n.textContent=e.title||r(`session.newSession`),t.appendChild(n);let a=document.createElement(`span`);if(a.className=`session-tab-close`,a.innerHTML=`✕`,a.title=r(`session.closeSession`),a.addEventListener(`click`,async t=>{if(t.stopPropagation(),(e.id===C.activeSessionId?C.messageHistory?.length||0:e.messageCount??e.messageHistory?.length??0)===0){Jo(await qo(e.id)),await ic();return}tc(e,async()=>{await ic()})}),t.appendChild(a),e.isGenerating||C.generatingSessionIds.has(e.id)){let e=document.createElement(`span`);e.className=`session-tab-indicator`,t.appendChild(e)}else if(C.completedSessionIds.has(e.id)&&e.id!==C.activeSessionId){let e=document.createElement(`span`);e.className=`session-tab-completed-indicator`,e.title=r(`session.taskCompleted`),t.appendChild(e)}let o=fr(e.id);if(o>0){let e=document.createElement(`span`);e.className=`session-tab-queue-badge`,e.textContent=String(o>99?`99+`:o),e.title=r(`queue.badgeTitle`,{count:o}),t.appendChild(e)}t.addEventListener(`click`,async n=>{if(n.preventDefault(),e.id!==C.activeSessionId&&!Gs){Gs=!0,i.querySelectorAll(`.session-tab.active`).forEach(e=>e.classList.remove(`active`)),t.classList.add(`active`);try{await Ys(e.id)}finally{Gs=!1,C.activeSessionId!==e.id&&yo({list:C.sessions,activeSessionId:C.activeSessionId})}}}),t.addEventListener(`contextmenu`,t=>{t.preventDefault(),nc(t,e)}),t.addEventListener(`mousedown`,async t=>{t.button===1&&(t.preventDefault(),t.stopPropagation(),Jo(await qo(e.id)),await ic())}),t.draggable=!0,t.addEventListener(`dragstart`,t=>Ao(t,e.id)),t.addEventListener(`dragover`,e=>jo(e)),t.addEventListener(`dragleave`,e=>Mo(e)),t.addEventListener(`drop`,t=>No(t,e.id)),t.addEventListener(`dragend`,e=>Po(e)),i.appendChild(t)}),bo(),So(),Qo(),Ws(),$s(i),To(i),Eo(i),ko(i),Cs(),As())}function bo(){let e=document.getElementById(`sessionTabsMore`);if(!e)return;let t=e.cloneNode(!0);e.parentNode.replaceChild(t,e),t.addEventListener(`click`,e=>{e.stopPropagation(),vs()})}async function xo(){let e=C.activeSessionId;await ni();let t=await ai();C.activeSessionId=t.id,C.messageHistory=[],C.activeCompaction=null,ri(t),document.dispatchEvent(new CustomEvent(`session-switched`,{detail:{sessionId:t.id,previousSessionId:e}})),yo()}function So(){let e=document.getElementById(`sessionTabsAdd`);if(!e)return;let t=e.cloneNode(!0);e.parentNode.replaceChild(t,e),t.addEventListener(`click`,()=>xo())}var Co=0,wo=0;function To(e){let t=document.getElementById(`sessionTabsMore`);if(!t)return;if(!fs()){t.style.display=`none`;return}let n=e.scrollWidth>e.clientWidth;t.style.display=n||Co>0?`flex`:`none`}async function Eo(e){let t=++wo,n;try{n=await di()}catch{return}t===wo&&(Co=n.length,To(e))}var Do=null;function Oo(){if(Do)return;let e=document.getElementById(`sessionTabsScroll`);e&&(Do=new ResizeObserver(()=>{requestAnimationFrame(()=>{To(e)})}),Do.observe(e))}function ko(e){let t=e.querySelector(`.session-tab.active`);if(t){let n=t.offsetLeft,r=t.offsetWidth;e.scrollLeft=n-(e.clientWidth-r)/2}e.style.opacity=`1`}function Ao(e,t){ho.draggedId=t,ho.sourceType=`tab`,e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t),e.currentTarget.classList.add(`dragging`)}function jo(e){e.preventDefault(),e.dataTransfer.dropEffect=`move`,e.currentTarget.classList.add(`drag-over`)}function Mo(e){e.currentTarget.classList.remove(`drag-over`)}async function No(e,t){e.preventDefault(),e.currentTarget.classList.remove(`drag-over`);let n=ho.draggedId;if(!n||n===t)return;let r=C.sessions||[],i=r.findIndex(e=>e.id===n),a=r.findIndex(e=>e.id===t);if(i===-1||a===-1)return;let o=[...r],[s]=o.splice(i,1);o.splice(a,0,s),C.sessions=o,await li(o.map(e=>e.id)),yo()}function Po(e){e.currentTarget.classList.remove(`dragging`),document.querySelectorAll(`.session-tab.drag-over`).forEach(e=>e.classList.remove(`drag-over`)),ho.draggedId=null,ho.sourceType=null}function Fo(){B.visible?Lo():Io()}async function Io(){let e=document.getElementById(`sessionTabsMore`),t=document.getElementById(`sessionDropdown`);if(!e||!t)return;let n=await ti();C.sessions=n.list,C.activeSessionId=n.activeSessionId,B.filteredSessions=_o([...n.list]),B.highlightIndex=-1,B.visible=!0,Is(),zo(),t.classList.add(`show`);let r=document.getElementById(`sessionDropdownCloseBtn`);r&&(r.onclick=()=>Lo());let i=document.getElementById(`sessionDropdownSearch`),a=document.getElementById(`sessionDropdownSearchClear`);i&&(i.value=B.lastSearchText||``,Ro(),B.lastSearchText&&Go(B.lastSearchText),setTimeout(()=>i.focus(),50),i.oninput=()=>{B.lastSearchText=i.value,Ro(),Go(i.value)},i.onkeydown=e=>{$o(e)}),a&&(a.onclick=()=>{i&&(i.value=``,B.lastSearchText=``,Ro(),Go(``),i.focus())}),e.classList.add(`active`)}function Lo(){let e=document.getElementById(`sessionTabsMore`),t=document.getElementById(`sessionDropdown`);t&&t.classList.remove(`show`),e&&e.classList.remove(`active`);let n=document.getElementById(`sessionDropdownSearch`);n&&(B.lastSearchText=n.value,n.oninput=null,n.onkeydown=null);let r=document.getElementById(`sessionDropdownSearchClear`);r&&(r.onclick=null),B.visible=!1,B.highlightIndex=-1,B.filteredSessions=[]}function Ro(){let e=document.getElementById(`sessionDropdownSearch`),t=document.getElementById(`sessionDropdownSearchClear`);t&&e&&(t.style.display=e.value?`flex`:`none`)}function zo(){Bo({listEl:document.getElementById(`sessionDropdownList`),filteredSessions:B.filteredSessions,highlightIndex:B.highlightIndex,onSelect:e=>Ko(e)})}function Bo({listEl:e,filteredSessions:t,highlightIndex:n,onSelect:i,grouped:a=!0,draggable:o=!1}){if(!e)return;if(e.innerHTML=``,t.length===0){let t=document.createElement(`div`);t.className=`session-dropdown-empty`,t.textContent=r(`session.noMatch`),e.appendChild(t);return}let s={today:r(`session.today`),yesterday:r(`session.yesterday`),last7Days:r(`session.last7Days`),earlier:r(`session.earlier`)},c={};a&&t.forEach(e=>{let t=vo(e.updatedAt);c[t]=(c[t]||0)+1});let l=null;t.forEach((t,u)=>{if(a){let n=vo(t.updatedAt);if(n!==l){l=n;let t=document.createElement(`div`);t.className=`session-dropdown-group-header`;let i=document.createElement(`span`);if(i.textContent=s[n]||n,t.appendChild(i),(c[n]||0)>0){let e=document.createElement(`button`);e.className=`session-dropdown-group-close`,e.textContent=r(`session.closeGroupAll`),e.onclick=e=>{e.stopPropagation(),Zo(n,s[n]||n)},t.appendChild(e)}e.appendChild(t)}}let d=Wo(t,{index:u,highlightIndex:n,onSelect:i});o&&Ho(d,t.id),e.appendChild(d)})}var Vo=null;function Ho(e,t){e.draggable=!0,e.classList.add(`draggable`),e.addEventListener(`dragstart`,n=>{Vo=t,n.dataTransfer.effectAllowed=`move`,n.dataTransfer.setData(`text/plain`,t),e.classList.add(`dragging`)}),e.addEventListener(`dragover`,n=>{!Vo||Vo===t||(n.preventDefault(),n.dataTransfer.dropEffect=`move`,e.classList.add(`drag-over`))}),e.addEventListener(`dragleave`,()=>e.classList.remove(`drag-over`)),e.addEventListener(`drop`,n=>{n.preventDefault(),n.stopPropagation(),e.classList.remove(`drag-over`),Uo(Vo,t)}),e.addEventListener(`dragend`,()=>{e.classList.remove(`dragging`),document.querySelectorAll(`.session-dropdown-item.drag-over`).forEach(e=>e.classList.remove(`drag-over`)),Vo=null})}async function Uo(e,t){let n=e;if(Vo=null,!n||n===t)return;let r=C.sessions||[],i=r.findIndex(e=>e.id===n),a=r.findIndex(e=>e.id===t);if(i===-1||a===-1)return;let o=[...r],[s]=o.splice(i,1);o.splice(a,0,s),C.sessions=o,await li(o.map(e=>e.id)),await yo()}function Wo(e,{index:t,highlightIndex:n,onSelect:i}){let a=document.createElement(`div`);a.className=`session-dropdown-item`,a.dataset.sessionId=e.id,a.dataset.index=t,e.id===C.activeSessionId&&a.classList.add(`active`),t===n&&a.classList.add(`highlighted`);let o=e.isGenerating||C.generatingSessionIds.has(e.id);if(C.completedSessionIds.has(e.id)&&e.id!==C.activeSessionId&&!o){let e=document.createElement(`span`);e.className=`session-dropdown-item-completed`,e.title=r(`session.taskCompleted`),a.appendChild(e)}let s=fr(e.id);if(s>0){let e=document.createElement(`span`);e.className=`session-dropdown-item-queue`,e.textContent=String(s>99?`99+`:s),e.title=r(`queue.badgeTitle`,{count:s}),a.appendChild(e)}let c=document.createElement(`span`);if(c.className=`session-dropdown-item-icon`,o){let e=document.createElement(`span`);e.className=`session-dropdown-item-running`,c.appendChild(e)}else c.innerHTML=`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>`;a.appendChild(c);let l=document.createElement(`span`);if(l.className=`session-dropdown-item-title`,l.textContent=e.title||r(`session.newSession`),l.title=e.title||r(`session.newSession`),a.appendChild(l),e.id===C.activeSessionId){let e=document.createElement(`span`);e.className=`session-dropdown-item-check`,e.innerHTML=`<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>`,a.appendChild(e)}let u=document.createElement(`span`);u.className=`session-dropdown-item-time`,u.textContent=go(e.updatedAt),a.appendChild(u);let d=document.createElement(`span`);d.className=`session-dropdown-item-actions`;let f=document.createElement(`span`);f.className=`session-dropdown-item-rename`,f.title=r(`session.rename`),f.innerHTML=`<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>`,f.addEventListener(`click`,t=>{t.stopPropagation(),t.preventDefault(),ec(e)}),d.appendChild(f);let p=document.createElement(`span`);p.className=`session-dropdown-item-duplicate`,p.title=r(`session.duplicate`),p.innerHTML=`<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="6" cy="6" r="2.5"/><circle cx="6" cy="18" r="2.5"/><circle cx="18" cy="6" r="2.5"/><path d="M6 8.5v7"/><path d="M18 8.5c0 4-6 3.5-6 3.5"/></svg>`,p.addEventListener(`click`,async t=>{t.stopPropagation(),t.preventDefault(),await Xs(e.id);let n=await ti({withActiveHistory:!1});C.sessions=n.list,C.activeSessionId=n.activeSessionId,Go(document.getElementById(`sessionDropdownSearch`)?.value||``)}),d.appendChild(p);let m=document.createElement(`span`);m.className=`session-dropdown-item-archive`,m.title=r(`session.archive`),m.innerHTML=`<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 8v13H3V8"/><rect x="1" y="3" width="22" height="5"/><line x1="10" y1="12" x2="14" y2="12"/></svg>`,m.addEventListener(`click`,async t=>{t.stopPropagation(),t.preventDefault(),await Ps(e.id),Go(document.getElementById(`sessionDropdownSearch`)?.value||``)}),d.appendChild(m);let h=document.createElement(`span`);return h.className=`session-dropdown-item-close`,h.innerHTML=`✕`,h.title=r(`session.closeSession`),h.addEventListener(`click`,async t=>{t.stopPropagation(),t.preventDefault(),await Yo(e.id)}),d.appendChild(h),a.appendChild(d),a.addEventListener(`click`,async t=>{t.preventDefault(),await i(e.id)}),a}function Go(e){let t=C.sessions||[],n;if(!e.trim())n=[...t];else{let i=e.trim().toLowerCase();n=t.filter(e=>(e.title||r(`session.newSession`)).toLowerCase().includes(i))}B.filteredSessions=_o(n),B.highlightIndex=-1,zo()}async function Ko(e){Lo(),e!==C.activeSessionId&&await Ys(e)}async function qo(e){let t=fr(e)+ur(e).length;return await si(e),t}function Jo(e){e<=0||F(r(`queue.sessionDropped`,{count:e}),`info`,3e3)}async function Yo(e){let t=(C.sessions||[]).find(t=>t.id===e);t&&((e===C.activeSessionId?C.messageHistory?.length||0:t.messageCount??t.messageHistory?.length??0)>0&&!await js(r(`session.confirmCloseMessageWithTitle`,{title:t.title}),r(`session.closeSession`))||(Jo(await qo(e)),await ic(),Go(document.getElementById(`sessionDropdownSearch`)?.value||``)))}async function Xo(){let e=C.sessions||[];if(e.length===0||!await js(r(`session.confirmCloseAllMessage`,{count:e.length}),r(`session.confirmCloseAllTitle`)))return;let t=0;for(let n of e)t+=await qo(n.id);Jo(t),await ic(),Go(document.getElementById(`sessionDropdownSearch`)?.value||``)}async function Zo(e,t){let n=(C.sessions||[]).filter(t=>vo(t.updatedAt)===e);if(n.length===0||!await js(r(`session.confirmCloseGroupMessage`,{group:t,count:n.length}),r(`session.closeSession`)))return;let i=0;for(let e of n)i+=await qo(e.id);Jo(i),await ic(),Go(document.getElementById(`sessionDropdownSearch`)?.value||``)}function Qo(){let e=document.getElementById(`sessionDropdownCloseAll`),t=document.getElementById(`sessionDropdown`);if(t){if(e){let t=e.cloneNode(!0);e.parentNode.replaceChild(t,e),t.addEventListener(`click`,async e=>{e.stopPropagation(),await Xo()})}t.addEventListener(`click`,e=>{e.stopPropagation()})}}function $o(e){if(!B.visible)return;let t=B.filteredSessions.length;if(t===0){e.key===`Escape`&&Lo();return}switch(e.key){case`ArrowDown`:e.preventDefault(),B.highlightIndex=Math.min(B.highlightIndex+1,t-1),zo(),es(document.getElementById(`sessionDropdownList`));break;case`ArrowUp`:e.preventDefault(),B.highlightIndex=Math.max(B.highlightIndex-1,0),zo(),es(document.getElementById(`sessionDropdownList`));break;case`Enter`:if(e.preventDefault(),B.highlightIndex>=0&&B.highlightIndex<t){let e=B.filteredSessions[B.highlightIndex];Ko(e.id)}break;case`Escape`:e.preventDefault(),Lo();break}}function es(e){let t=(e||document).querySelector(`.session-dropdown-item.highlighted`);t&&t.scrollIntoView({block:`nearest`})}var ts=560,ns=200,rs=480,is=360,as=240,os=`sessionSidebarExpanded`,ss=`sessionSidebarWidth`,cs=`sessionSidebarSortMode`,ls=`manual`,us=`recent`,V={expanded:!1,width:as,sortMode:ls,narrow:!1,pendingRestore:!1,highlightIndex:-1,filteredSessions:[],inited:!1,lastActiveId:null};function ds(e){let t=document.getElementById(`mainRow`),n=t?Math.max(ns,t.clientWidth-is):rs;return Math.max(ns,Math.min(e,rs,n))}function fs(){let e=document.getElementById(`mainRow`);return e?e.clientWidth<ts:!0}function ps(){let e=document.getElementById(`sessionSidebar`);if(!e)return;V.narrow=fs(),e.classList.toggle(`sidebar-hidden`,V.narrow),e.classList.toggle(`expanded`,!V.narrow&&V.expanded),e.style.setProperty(`--session-sidebar-width`,`${V.width}px`),ms();let t=document.getElementById(`sessionSidebarToggle`);t&&t.classList.toggle(`sidebar-hidden`,V.narrow||V.expanded);let n=document.getElementById(`sessionTabs`);if(n){let e=!V.narrow&&V.expanded;if(n.classList.toggle(`tabs-hidden`,e),!e){let e=document.getElementById(`sessionTabsScroll`);e&&ko(e)}}}function ms(){let e=!V.narrow&&V.expanded?V.width:0;document.body.style.setProperty(`--session-sidebar-offset`,`${e}px`)}async function hs(){try{await chrome.storage.local.set({[os]:V.expanded,[ss]:V.width,[cs]:V.sortMode})}catch{}}function gs(){fs()||(V.expanded=!0,ps(),hs(),Cs())}function _s(){V.expanded=!1,ps(),hs()}function vs(){if(fs()){Fo();return}V.expanded?_s():gs()}function ys(){let e=document.getElementById(`sessionSidebarList`),t=V.sortMode===us,n=!!(document.getElementById(`sessionSidebarSearch`)?.value||``).trim();Bo({listEl:e,filteredSessions:V.filteredSessions,highlightIndex:V.highlightIndex,onSelect:e=>ws(e),grouped:t,draggable:!t&&!n});let r=C.activeSessionId;r&&V.lastActiveId!==r&&(V.lastActiveId=r,e?.querySelector(`.session-dropdown-item.active`)?.scrollIntoView({block:`nearest`}))}function bs(e){let t=C.sessions||[],n;if(!e.trim())n=[...t];else{let i=e.trim().toLowerCase();n=t.filter(e=>(e.title||r(`session.newSession`)).toLowerCase().includes(i))}V.filteredSessions=V.sortMode===us?_o(n):n.reverse(),V.highlightIndex=-1,ys()}function xs(){document.querySelectorAll(`.session-sidebar-sort-btn`).forEach(e=>{let t=e.dataset.mode===V.sortMode;e.classList.toggle(`active`,t),e.setAttribute(`aria-pressed`,t?`true`:`false`)})}function Ss(e){e!==ls&&e!==us||V.sortMode!==e&&(V.sortMode=e,xs(),V.lastActiveId=null,bs(document.getElementById(`sessionSidebarSearch`)?.value||``),hs())}function Cs(){let e=document.getElementById(`sessionSidebar`);!e||!e.classList.contains(`expanded`)||bs(document.getElementById(`sessionSidebarSearch`)?.value||``)}async function ws(e){e!==C.activeSessionId&&await Ys(e)}function Ts(e){let t=V.filteredSessions,n=t.length;if(n===0){e.key===`Escape`&&_s();return}switch(e.key){case`ArrowDown`:e.preventDefault(),V.highlightIndex=Math.min(V.highlightIndex+1,n-1),ys(),es(document.getElementById(`sessionSidebarList`));break;case`ArrowUp`:e.preventDefault(),V.highlightIndex=Math.max(V.highlightIndex-1,0),ys(),es(document.getElementById(`sessionSidebarList`));break;case`Enter`:e.preventDefault(),V.highlightIndex>=0&&V.highlightIndex<n&&ws(t[V.highlightIndex].id);break;case`Escape`:e.preventDefault(),_s();break}}function Es(){let e=document.getElementById(`sessionSidebarSearch`),t=document.getElementById(`sessionSidebarSearchClear`);t&&e&&(t.style.display=e.value?`flex`:`none`)}function Ds(){let e=document.getElementById(`sessionSidebar`),t=document.getElementById(`sessionSidebarGrip`);!e||!t||t.addEventListener(`mousedown`,t=>{t.preventDefault();let n=t.clientX,r=V.width;e.classList.add(`resizing`);function i(t){let i=ds(r+(t.clientX-n));V.width=i,e.style.setProperty(`--session-sidebar-width`,`${i}px`),ms()}function a(){document.removeEventListener(`mousemove`,i),document.removeEventListener(`mouseup`,a),e.classList.remove(`resizing`),hs()}document.addEventListener(`mousemove`,i),document.addEventListener(`mouseup`,a)})}function Os(){let e=document.getElementById(`mainRow`);!e||typeof ResizeObserver>`u`||new ResizeObserver(()=>{requestAnimationFrame(()=>{let e=fs();e!==V.narrow&&(e&&V.expanded?V.pendingRestore=!0:!e&&V.pendingRestore&&(V.pendingRestore=!1),ps(),!e&&V.expanded&&Cs())})}).observe(e)}function ks(){fs()?Io():gs()}async function As(){if(V.inited||!document.getElementById(`sessionSidebar`))return;V.inited=!0;try{let e=await chrome.storage.local.get([os,ss,cs]);V.expanded=e[os]===!0,typeof e[ss]==`number`&&(V.width=ds(e[ss])),(e[cs]===us||e[cs]===ls)&&(V.sortMode=e[cs])}catch{}xs(),fs()&&V.expanded&&(V.pendingRestore=!0),ps(),Cs(),document.getElementById(`sessionSidebarToggle`)?.addEventListener(`click`,()=>vs()),document.getElementById(`sessionSidebarAdd`)?.addEventListener(`click`,()=>{xo()}),document.getElementById(`sessionSidebarCollapse`)?.addEventListener(`click`,()=>_s()),document.querySelectorAll(`.session-sidebar-sort-btn`).forEach(e=>{e.addEventListener(`click`,()=>Ss(e.dataset.mode))}),document.getElementById(`sessionSidebarArchiveEntry`)?.addEventListener(`click`,()=>{Ls()}),document.getElementById(`sessionSidebarCloseAll`)?.addEventListener(`click`,async e=>{e.stopPropagation(),await Xo()});let e=document.getElementById(`sessionSidebarSearch`),t=document.getElementById(`sessionSidebarSearchClear`);e&&(e.addEventListener(`input`,()=>{Es(),bs(e.value)}),e.addEventListener(`keydown`,e=>{Ts(e)})),t&&t.addEventListener(`click`,()=>{e&&(e.value=``,Es(),bs(``),e.focus())}),Ds(),Os(),Is()}function js(e,t){return new Promise(t=>{let n=document.getElementById(`sessionDeleteModal`),r=document.getElementById(`sessionDeleteMessage`),i=document.getElementById(`sessionDeleteConfirmBtn`),a=document.getElementById(`sessionDeleteCancelBtn`),o=document.getElementById(`sessionDeleteCloseBtn`);if(!n||!r){t(!1);return}r.textContent=e;let s=()=>{n.classList.remove(`show`),i.removeEventListener(`click`,c),a.removeEventListener(`click`,l),o.removeEventListener(`click`,l)},c=()=>{s(),t(!0)},l=()=>{s(),t(!1)};i.addEventListener(`click`,c),a.addEventListener(`click`,l),o.addEventListener(`click`,l),n.classList.add(`show`)})}var Ms=``,Ns=!1;async function Ps(e){if(!e)return;let t=fi(e);if(!t.ok){t.reason===`running`?F(r(`session.archiveBusyRunning`),`warning`):t.reason===`queued`&&F(r(`session.archiveBusyQueued`),`warning`);return}let n=e===C.activeSessionId,i=await pi(e);if(!i?.ok){i?.reason===`running`?F(r(`session.archiveBusyRunning`),`warning`):i?.reason===`queued`?F(r(`session.archiveBusyQueued`),`warning`):F(r(`session.operationFailed`,{message:i?.reason||`unknown`}),`error`);return}if(document.dispatchEvent(new CustomEvent(`session-archived`,{detail:{sessionId:e}})),n)await Fs(e);else{let e=await ti();C.sessions=e.list,yo(e)}await Is(),F(r(`session.archived`),`info`)}async function Fs(e){let t=_o([...(await ti()).list]).filter(t=>t.id!==e);if(t.length>0){await Ys(t[0].id);return}await ai(),await ic()}async function Is(){let e=[`sessionArchiveEntryLabel`,`sessionSidebarArchiveLabel`].map(e=>document.getElementById(e));if(!e.some(Boolean))return;Co=(await di()).length;let t=document.getElementById(`sessionTabsScroll`);t&&To(t);let n=r(`session.archiveEntry`);e.forEach(e=>{e&&(e.textContent=n)})}async function Ls(){let e=document.getElementById(`sessionArchivePanel`);if(!e)return;Ws(),Ms=``;let t=document.getElementById(`sessionArchiveSearch`);t&&(t.value=``),zs(),await Bs(),e.classList.add(`show`),Lo()}function Rs(){let e=document.getElementById(`sessionArchivePanel`);e&&e.classList.remove(`show`)}function zs(){let e=document.getElementById(`sessionArchiveSearchClear`);e&&(e.style.display=Ms?`flex`:`none`)}async function Bs(){let e=document.getElementById(`sessionArchiveList`);if(!e)return;let t=await di(),n=Ms.trim().toLowerCase(),i=n?t.filter(e=>(e.title||``).toLowerCase().includes(n)):t;if(e.innerHTML=``,i.length===0){let t=document.createElement(`div`);t.className=`session-dropdown-empty`,t.textContent=r(n?`session.archiveNoMatch`:`session.archiveEmpty`),e.appendChild(t);return}let a={today:r(`session.today`),yesterday:r(`session.yesterday`),last7Days:r(`session.last7Days`),earlier:r(`session.earlier`)},o=null;i.forEach(t=>{let n=vo(t.archivedAt);if(n!==o){o=n;let t=document.createElement(`div`);t.className=`session-dropdown-group-header`;let r=document.createElement(`span`);r.textContent=a[n]||n,t.appendChild(r),e.appendChild(t)}e.appendChild(Vs(t))})}function Vs(e){let t=document.createElement(`div`);t.className=`session-dropdown-item session-archive-item`,t.dataset.sessionId=e.id,t.title=e.title||r(`session.newSession`);let n=document.createElement(`span`);n.className=`session-dropdown-item-icon`,n.innerHTML=`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 8v13H3V8"/><rect x="1" y="3" width="22" height="5"/><line x1="10" y1="12" x2="14" y2="12"/></svg>`,t.appendChild(n);let i=document.createElement(`span`);i.className=`session-dropdown-item-title`,i.textContent=e.title||r(`session.newSession`),t.appendChild(i);let a=document.createElement(`span`);a.className=`session-dropdown-item-time`,a.textContent=r(`session.archivedAt`,{time:go(e.archivedAt)}),t.appendChild(a);let o=document.createElement(`span`);o.className=`session-dropdown-item-actions`;let s=document.createElement(`span`);s.className=`session-dropdown-item-restore`,s.title=r(`session.restoreTitle`),s.innerHTML=`<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 14 4 9 9 4"/><path d="M20 20v-7a4 4 0 0 0-4-4H4"/></svg>`,s.addEventListener(`click`,async t=>{t.stopPropagation(),await Hs(e.id)}),o.appendChild(s);let c=document.createElement(`span`);return c.className=`session-dropdown-item-delete`,c.title=r(`session.deleteForever`),c.innerHTML=`✕`,c.addEventListener(`click`,async t=>{t.stopPropagation(),await Us(e)}),o.appendChild(c),t.appendChild(o),t.addEventListener(`click`,async()=>{await Hs(e.id,{enter:!0})}),t}async function Hs(e,{enter:t=!1}={}){if(!await mi(e)){F(r(`session.operationFailed`,{message:`not found`}),`error`),await Bs();return}let n=await ti();C.sessions=n.list;let i=n.list.find(t=>t.id===e)?.title||r(`session.newSession`);Rs(),await Bs(),await Is(),t?await Ys(e):yo(n),F(r(`session.archivedRestored`,{title:i}),`success`)}async function Us(e){let t=e.title||r(`session.newSession`);await js(r(`session.confirmDeleteForeverMessage`,{title:t}),r(`session.confirmDeleteForeverTitle`))&&(await hi(e.id),await Bs(),await Is(),document.dispatchEvent(new CustomEvent(`session-deleted`,{detail:{sessionId:e.id}})),F(r(`session.archiveDeleted`,{title:t}),`success`))}function Ws(){if(Ns)return;let e=document.getElementById(`sessionArchivePanel`),t=document.getElementById(`sessionArchiveEntry`);if(!e||!t)return;Ns=!0,t.addEventListener(`click`,()=>{Ls()});let n=document.getElementById(`sessionArchiveBackBtn`);n&&n.addEventListener(`click`,()=>{Rs(),ks()});let r=document.getElementById(`sessionArchiveCloseBtn`);r&&r.addEventListener(`click`,()=>Rs());let i=document.getElementById(`sessionArchiveSearch`),a=document.getElementById(`sessionArchiveSearchClear`);i&&(i.addEventListener(`input`,()=>{Ms=i.value,zs(),Bs()}),i.addEventListener(`keydown`,e=>{e.key===`Escape`&&(e.stopPropagation(),Rs(),ks())})),a&&a.addEventListener(`click`,()=>{i&&(i.value=``,Ms=``,zs(),Bs(),i.focus())}),document.addEventListener(`session-archived`,()=>{e.classList.contains(`show`)&&Bs()}),document.addEventListener(`session-deleted`,()=>{e.classList.contains(`show`)&&Bs()})}var Gs=!1,Ks=500;function qs(e){let t=`scrollPosition_${e||`default`}`;chrome.storage.local.get([t],e=>{let n=document.getElementById(`chatContainer`);n&&e[t]!==void 0&&(n.scrollTop=e[t]),A(async()=>{let{updateScrollButtonState:e}=await Promise.resolve().then(()=>yS);return{updateScrollButtonState:e}},void 0).then(({updateScrollButtonState:e})=>e()).catch(()=>{})})}function Js(e,t){setTimeout(()=>{C.activeSessionId===e&&(Fe(t)||qs(e))},Ks)}async function Ys(e,{focusMessageId:t=null}={}){let n=C.activeSessionId;if(!await oi(e))return;let r=`agentEnabledTools_${C.activeAgentId||`default`}`,i=`agentMcpClosedServers_${C.activeAgentId||`default`}`,[a,o,s,c]=await Promise.all([ti(),chrome.storage.local.get([i,`ragTools`,`ragToolsIntroduced`]),chrome.storage.local.get([r,`enabledTools`]),C.activeAgentId?ft(C.activeAgentId):Promise.resolve(null)]);C.sessions=a.list,C.activeSessionId=e;let l=o.ragTools||[];C.mcpClosedServers=o[i]||[];let u=!!s[r],d=s[r]||s.enabledTools;if(u||d&&d.length>0){let e=ta(l),t=d.filter(t=>e.has(t));if(u)C.enabledTools=t;else{let e=f.filter(e=>e.enabled&&!t.includes(e.id)).map(e=>e.id);C.enabledTools=[...t,...e]}let n=ea(C.enabledTools,l,o.ragToolsIntroduced);C.enabledTools=n.tools,C.enabledTools.length!==d.length&&chrome.storage.local.set({[r]:C.enabledTools,...n.migrated?{ragToolsIntroduced:!0}:{}})}else{C.enabledTools=f.filter(e=>e.enabled).map(e=>e.id);let e=ea(C.enabledTools,l,o.ragToolsIntroduced);C.enabledTools=e.tools,e.migrated&&chrome.storage.local.set({ragToolsIntroduced:!0,[r]:C.enabledTools})}C.activeAgentToolIds=c?c.toolIds:null,C.activeAgentMcpExcludedServerIds=c?c.mcpExcludedServerIds??null:null,document.dispatchEvent(new CustomEvent(`session-switched`,{detail:{sessionId:e,previousSessionId:n,...t?{skipScrollRestore:!0}:{}}})),ei(e),yo(a),Zs(),LT();try{let{refreshBookmarkPanel:e,updateBookmarkButtons:t}=await A(async()=>{let{refreshBookmarkPanel:e,updateBookmarkButtons:t}=await Promise.resolve().then(()=>Rm);return{refreshBookmarkPanel:e,updateBookmarkButtons:t}},void 0);e(),setTimeout(()=>t(),100)}catch{}let p=document.getElementById(`toolsPopupOverlay`);p&&p.classList.contains(`show`)&&(Bi(),Ji(),Yi()),Qi(),t&&Js(e,t)}async function Xs(e,t=null){if(e)try{let n=await vi(e,t);await Ys(n.id),F(r(t?`session.forkedFrom`:`session.forkedSession`,{title:n.title}),`success`)}catch(e){i.error(`[SessionUI] copy/forksession failed:`,e),F(r(`session.operationFailed`,{message:e.message}),`error`)}}function Zs(){let e=document.querySelector(`.model-display`);e&&C.currentModel&&(e.textContent=C.currentModel);let t=document.getElementById(`enableToolsBtn`);t&&(t.checked=C.useTools);let n=document.getElementById(`tempIconValue`);n&&C.temperature!==void 0&&(n.textContent=C.temperature.toFixed(2))}var Qs=new WeakSet;function $s(e){Qs.has(e)||(Qs.add(e),e.addEventListener(`wheel`,t=>{e.scrollWidth<=e.clientWidth||(t.preventDefault(),e.scrollLeft+=t.deltaY)},{passive:!1}))}function ec(e){let t=document.getElementById(`sessionRenameModal`),n=document.getElementById(`sessionRenameInput`),r=document.getElementById(`sessionRenameConfirmBtn`),i=document.getElementById(`sessionRenameCancelBtn`),a=document.getElementById(`sessionRenameCloseBtn`);if(!t||!n)return;n.value=e.title;let o=()=>{t.classList.remove(`show`),r.removeEventListener(`click`,s),i.removeEventListener(`click`,c),a.removeEventListener(`click`,c)},s=async()=>{let t=n.value.trim();if(t&&t!==e.title){await ci(e.id,t),yo();let n=await ti();C.sessions=n.list,C.activeSessionId=n.activeSessionId,Go(document.getElementById(`sessionDropdownSearch`)?.value||``)}o()},c=()=>{o()};r.addEventListener(`click`,s),i.addEventListener(`click`,c),a.addEventListener(`click`,c),n.onkeydown=e=>{e.key===`Enter`?s():e.key===`Escape`&&c()},t.classList.add(`show`),setTimeout(()=>{n.focus(),n.select()},50)}function tc(e,t){let n=document.getElementById(`sessionDeleteModal`),i=document.getElementById(`sessionDeleteMessage`),a=document.getElementById(`sessionDeleteConfirmBtn`),o=document.getElementById(`sessionDeleteCancelBtn`),s=document.getElementById(`sessionDeleteCloseBtn`);if(!n||!i)return;i.textContent=r(`session.confirmCloseMessageWithTitle`,{title:e.title});let c=()=>{n.classList.remove(`show`),a.removeEventListener(`click`,l),o.removeEventListener(`click`,u),s.removeEventListener(`click`,u)},l=async()=>{Jo(await qo(e.id)),t&&await t(),c()},u=()=>{c()};a.addEventListener(`click`,l),o.addEventListener(`click`,u),s.addEventListener(`click`,u),n.classList.add(`show`),requestAnimationFrame(()=>a.focus())}function nc(e,t){let n=document.querySelector(`.session-context-menu`);n&&n.remove();let i=document.createElement(`div`);i.className=`session-context-menu`,i.style.left=e.clientX+`px`,i.style.top=e.clientY+`px`;let a=rc(r(`session.rename`),`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>`,()=>{i.remove(),ec(t)});i.appendChild(a);let o=rc(r(`session.duplicate`),`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="6" cy="6" r="2.5"/><circle cx="6" cy="18" r="2.5"/><circle cx="18" cy="6" r="2.5"/><path d="M6 8.5v7"/><path d="M18 8.5c0 4-6 3.5-6 3.5"/></svg>`,()=>{i.remove(),Xs(t.id)});i.appendChild(o);let s=rc(r(`session.archive`),`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 8v13H3V8"/><rect x="1" y="3" width="22" height="5"/><line x1="10" y1="12" x2="14" y2="12"/></svg>`,async()=>{i.remove(),await Ps(t.id)});i.appendChild(s);let c=rc(r(`session.closeSession`),`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>`,async()=>{if(i.remove(),(t.id===C.activeSessionId?C.messageHistory?.length||0:t.messageCount??t.messageHistory?.length??0)===0){Jo(await qo(t.id)),await ic();return}tc(t,async()=>{await ic()})},`danger`);i.appendChild(c),document.body.appendChild(i);let l=e=>{i.contains(e.target)||(i.remove(),document.removeEventListener(`click`,l))};setTimeout(()=>document.addEventListener(`click`,l),0)}function rc(e,t=``,n,r=``){let i=document.createElement(`div`);return i.className=`session-context-menu-item `+r,t?i.innerHTML=`${t}<span>${e}</span>`:i.textContent=e,i.addEventListener(`click`,n),i}async function ic(){let e=C.activeSessionId,t=await ti();t.activeSessionId||(await ai(),t=await ti()),C.activeSessionId=t.activeSessionId,C.sessions=t.list;let n=t.list.find(e=>e.id===t.activeSessionId);if(C.messageHistory=n&&n.messageHistory||[],C.activeCompaction=n?.contextCompaction||null,ri(n),C.activeAgentId=n&&n.agentId||null,C.activeAgentId){let e=await ft(C.activeAgentId);C.activeAgentToolIds=e?e.toolIds:null,C.activeAgentMcpExcludedServerIds=e?e.mcpExcludedServerIds??null:null}else C.activeAgentToolIds=null,C.activeAgentMcpExcludedServerIds=null;document.dispatchEvent(new CustomEvent(`session-switched`,{detail:{sessionId:C.activeSessionId,previousSessionId:e}})),yo(),await LT()}async function ac(){let e=C.activeSessionId;if(!e)return;let t=C.sessions?.find(t=>t.id===e);if(t){if((C.messageHistory?.length||0)===0){Jo(await qo(e)),await ic();return}tc(t,async()=>{await ic()})}}document.addEventListener(`generating-state-changed`,()=>{yo()}),document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,()=>{Oo(),As()}):(Oo(),As()),[`<svg viewBox="0 0 16 16" fill="currentColor">`,`<path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25zM5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25z"/>`,`</svg>`].join(``),[`<svg viewBox="0 0 16 16" fill="currentColor">`,`<path d="M12.146.146a.5.5 0 0 1 .708 0l2.5 2.5a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12h.5a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5h-.5a.5.5 0 0 1-.468-.325z"/>`,`</svg>`].join(``),[`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">`,`<circle cx="12" cy="12" r="10"></circle>`,`<polyline points="12 6 12 12 16 14"></polyline>`,`</svg>`].join(``),[`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">`,`<line x1="18" y1="6" x2="6" y2="18"></line>`,`<line x1="6" y1="6" x2="18" y2="18"></line>`,`</svg>`].join(``),[`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">`,`<polyline points="7 13 12 18 17 13"></polyline>`,`<polyline points="7 6 12 11 17 6"></polyline>`,`</svg>`].join(``);var oc=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>`,sc=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>`,cc=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>`,lc=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>`,uc=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>`,dc=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>`;[`<svg class="tool-call-icon exec" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">`,`<polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/>`,`</svg>`].join(``),[`<svg class="tool-call-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">`,`<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>`,`<polyline points="14 2 14 8 20 8"/>`,`</svg>`].join(``),[`<svg class="tool-call-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">`,`<circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/>`,`</svg>`].join(``),[`<svg class="tool-call-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">`,`<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/>`,`</svg>`].join(``),n(`zh`,{uiProto:{defaultTitle:`原型`,optimizePrompt:`请帮我优化这个UI原型界面 {id}({title}),`,loadFailed:`加载失败`,noDescription:`暂无描述`,previewInPanel:`面板内预览`,continueOptimizeTitle:`继续优化`,downloadPrototype:`下载原型`,confirmDeleteTitle:`确认删除`,confirmDeleteMessage:`确定删除原型 "{title}" 吗?此操作不可撤销。`,deleteFailed:`删除失败: {message}`,justNow:`刚刚`,minutesAgo:`{count} 分钟前`,hoursAgo:`{count} 小时前`}}),n(`en`,{uiProto:{defaultTitle:`Prototype`,optimizePrompt:`Please help me optimize this UI prototype {id} ({title}), `,loadFailed:`Load failed`,noDescription:`No description`,previewInPanel:`Preview in panel`,continueOptimizeTitle:`Continue optimizing`,downloadPrototype:`Download prototype`,confirmDeleteTitle:`Confirm delete`,confirmDeleteMessage:`Are you sure you want to delete prototype "{title}"? This action cannot be undone.`,deleteFailed:`Delete failed: {message}`,justNow:`Just now`,minutesAgo:`{count} minutes ago`,hoursAgo:`{count} hours ago`}});var fc=null,pc=1,mc=.25,hc=2,gc=.1;function _c(e){let t=e.trim();return/^\s*<!DOCTYPE\s/i.test(t)||/^\s*<html[\s>]/i.test(t)?/<\/head>/i.test(t)?t.replace(/<\/head>/i,`<style>html,body{overflow:auto!important;height:auto!important;}</style></head>`):/<body[\s>]/i.test(t)?t.replace(/<body([\s>])/i,`<body$1<style>html,body{overflow:auto!important;height:auto!important;}</style>`):t:`<!DOCTYPE html>
|
|
60
|
+
`,e.addEventListener(`click`,()=>Va(-1)),g.appendChild(e);let t=document.getElementById(`clarifyCustomInput`);t&&g.appendChild(t)}let _=document.getElementById(`clarifyCustomInput`);_&&_.classList.remove(`show`);let v=document.getElementById(`clarifyAdditionalInfo`);v&&v.classList.toggle(`show`,o);let y=document.getElementById(`clarifyCustomTextarea`);y&&(y.value=``);let b=document.getElementById(`clarifyAdditionalTextarea`);b&&(b.value=``),l.classList.add(`show`);let x=document.querySelector(`#clarifyContainer .clarify-content`),S=document.querySelector(`#clarifyContainer .clarify-header`);return x&&(x.scrollTop=0),S&&S.classList.remove(`scrolled`),ba=null,xa=!1,Da(),Ta(s),i.debug(`[SidePanel] clarification dialogshown:`,e.toolCallId,t),!0}function Na(){if(z)return!0;if(ya.length===0)return!1;let e=ya.shift();return Ma(e)?(z=e,_a(va,e),!0):(i.error(`[SidePanel] clarify overlay missing, settle as unanswered:`,e.toolCallId),Pa(e),F(r(`clarify.dropped`),`warning`),!1)}function Pa(e){Promise.resolve(chrome.runtime.sendMessage({type:`CLARIFY_RESPONSE`,toolCallId:e.toolCallId,selectedOption:-1,customInput:``,additionalInfo:``})).catch(e=>{i.debug(`[SidePanel] send unanswered clarify response failed:`,e?.message)})}function Fa(){if(ya.length>0){da(va);return}Ia(),fa(va)}function Ia(){let e=document.getElementById(`clarifyOverlay`);e&&e.classList.remove(`show`),C.currentClarifyToolCallId=null,C.currentClarifySessionId=null,Ea()}function La(){z=null,Fa()}function Ra(e,t){return!!e.toolCallId&&e.toolCallId===t.toolCallId&&(e.sessionId||null)===(t.sessionId||null)&&e.question===t.question}function za(e){let t={...e,sessionId:e.sessionId||null};if(i.debug(`[SidePanel] showclarification dialog:`,t.toolCallId,e),z&&Ra(z,t)){i.debug(`[SidePanel] duplicate clarify request, ignored:`,t.toolCallId);return}if(ya.some(e=>Ra(e,t))){i.debug(`[SidePanel] queued duplicate clarify, ignored:`,t.toolCallId);return}ya.push(t),da(va),ja(),ha(va)}function Ba(){if(z){La();return}Ia()}function Va(e){document.querySelectorAll(`.clarify-option-item`).forEach(e=>{e.classList.remove(`selected`),e.setAttribute(`aria-checked`,`false`),e.setAttribute(`tabindex`,`-1`)});let t=document.querySelector(`.clarify-option-item[data-index="${e}"]`);t&&(t.classList.add(`selected`),t.setAttribute(`aria-checked`,`true`),t.setAttribute(`tabindex`,`0`));let n=document.getElementById(`clarifyCustomInput`);if(n)if(e===-1){n.classList.add(`show`);let e=document.getElementById(`clarifyCustomTextarea`);e&&e.focus()}else n.classList.remove(`show`);i.debug(`[SidePanel] selectclarificationselect :`,e)}function Ha(){if(!z){i.error(`[SidePanel] no has currenttool callID`);return}let e=z.toolCallId,t=z.sessionId,n=-1;document.querySelectorAll(`.clarify-option-item`).forEach((e,t)=>{e.classList.contains(`selected`)&&(n=parseInt(e.dataset.index))});let r=document.getElementById(`clarifyCustomTextarea`),a=r?r.value.trim():``,o=document.getElementById(`clarifyAdditionalTextarea`),s=o?o.value.trim():``,c={type:`CLARIFY_RESPONSE`,toolCallId:e,sessionId:t,selectedOption:n,customInput:a,additionalInfo:s};i.debug(`[SidePanel] send clarificationresponse:`,c),chrome.runtime.sendMessage(c),La()}function Ua(){if(z){let e={type:`CLARIFY_RESPONSE`,toolCallId:z.toolCallId,sessionId:z.sessionId,selectedOption:-1,customInput:``,additionalInfo:``};chrome.runtime.sendMessage(e)}Ba()}function Wa(e){return e?.reason===`timeout`&&e?.defaultOption||null}function Ga(e){i.debug(`[SidePanel] received clarificationtimeoutnotification:`,e);let t=e?.toolCallId;if(!t){if(e?.sessionId&&C.currentClarifySessionId&&e.sessionId!==C.currentClarifySessionId){i.debug(`[SidePanel] clarificationtimeoutfrom othersession,ignore`);return}if(!z)return;Ka(Wa(e));return}if(z&&z.toolCallId===t){Ka(Wa(e));return}let n=ya.findIndex(e=>e.toolCallId===t);n>=0&&(i.debug(`[SidePanel] drop queued clarify (already settled by background):`,t),ya.splice(n,1),ja(),ha(va))}function Ka(e=null){let t=z?.question;La(),F(e?r(`clarify.timedOutDefaulted`,{option:e}):`${r(`clarify.timedOut`)}${t?`:${t}`:``}`,`warning`),Ca(`error`)}ua(va,{present:Na,pendingCount:()=>ya.length,refresh:ja});function qa(){let e=document.getElementById(`clarifyConfirmBtn`);e&&e.addEventListener(`click`,Ha);let t=document.getElementById(`clarifyCancelBtn`);t&&t.addEventListener(`click`,Ua);let n=document.getElementById(`clarifyExtendBtn`);n&&n.addEventListener(`click`,Oa);let r=document.querySelector(`#clarifyContainer .clarify-content`),a=document.querySelector(`#clarifyContainer .clarify-header`);r&&a&&r.addEventListener(`scroll`,()=>{a.classList.toggle(`scrolled`,r.scrollTop>2)}),chrome.runtime.onMessage.addListener((e,t,n)=>{e.type===`SHOW_CLARIFY_DIALOG`?(i.debug(`[SidePanel] received clarificationrequested :`,e,`currently activesession:`,C.activeSessionId),za(e.data),n({success:!0})):e.type===`PLAY_NOTIFICATION_SOUND`?(i.debug(`[SidePanel] recei to play soundrequested :`,e),Ca(e.soundType),n({success:!0})):e.type===`CLARIFY_TIMEOUT`?Ga(e):e.type===`CLARIFY_EXTENDED`&&ka(e)}),i.debug(`[SidePanel] clarification dialogeventinitializing`)}var Ja=oa.CONFIRM,Ya=[],Xa=null,Za=null,Qa=null;function $a(e){let t=Math.floor(e/60),n=e%60;return`${t}:${String(n).padStart(2,`0`)}`}function eo(){Za&&=(clearInterval(Za),null),Qa&&=(clearTimeout(Qa),null)}function to(e,t){return!!e.toolCallId&&e.toolCallId===t.toolCallId&&(e.sessionId||null)===(t.sessionId||null)&&JSON.stringify(e.args??null)===JSON.stringify(t.args??null)}function no(e){let t=e.message||r(`dialog.confirmAction`,{name:e.toolLabel||e.toolName}),n=Ya.length,i=ga(Ja),a=t;return n>0&&(a+=` ${r(`dialog.pendingQueue`,{count:n})}`),i>0&&(a+=` ${r(`dialog.otherPending`,{count:i})}`),a}function ro(e){let{toolName:t,toolLabel:n,args:a,timeout:o=3e5}=e;C.currentConfirmToolCallId=e.toolCallId,C.currentConfirmSessionId=e.sessionId||null;let s=document.getElementById(`confirmOverlay`);if(!s)return!1;document.getElementById(`confirmToolName`).textContent=n||t;let c=e.variant===`network`,l=document.getElementById(`confirmTitle`);l&&(l.textContent=r(c?`dialog.networkTitle`:`dialog.operationConfirm`));let u=document.getElementById(`confirmApproveLoopBtn`);u&&(u.textContent=r(c?`dialog.approveWhitelist`:`dialog.approveLoop`));let d=document.getElementById(`confirmArgsSummary`);if(d&&a){let e=Object.entries(a).filter(([e,t])=>t!=null&&t!==``).slice(0,5);e.length>0?(d.textContent=``,e.forEach(([e,t],n)=>{n>0&&d.appendChild(document.createTextNode(`、 `));let r=typeof t==`string`?t:JSON.stringify(t),i=r.length>80?r.substring(0,80)+`...`:r,a=document.createElement(`span`);a.className=`confirm-arg`,a.style.marginRight=`8px`,r.length>80&&(a.title=r);let o=document.createElement(`strong`);o.textContent=`${e}:`,a.appendChild(o),a.appendChild(document.createTextNode(` ${i}`)),d.appendChild(a)}),d.style.display=`block`):d.style.display=`none`}let f=document.getElementById(`confirmMessage`);f&&(f.textContent=no(e)),eo();let p=Math.floor(o/1e3),m=document.getElementById(`confirmCountdownText`),h=document.getElementById(`confirmCountdown`);return m&&h&&(h.classList.remove(`warning`),h.style.display=`flex`,m.textContent=r(`dialog.remainingTime`,{time:$a(p)}),Za=setInterval(()=>{if(p--,p<=0){clearInterval(Za),Za=null,m.textContent=r(`dialog.remainingTime`,{time:`0:00`});return}m.textContent=r(`dialog.remainingTime`,{time:$a(p)}),p<=30&&h.classList.add(`warning`)},1e3)),s.style.display=`flex`,Qa=setTimeout(()=>{i.debug(`[SidePanel] confirm dialogtimeout,autodeny`),lo(!1,`single`)},o),!0}function io(){if(Xa)return!0;if(Ya.length===0)return!1;let e=Ya.shift();return ro(e)?(Xa=e,_a(Ja,e),!0):(e.resolve&&e.resolve(!1),!1)}function ao(){let e=document.getElementById(`confirmOverlay`);e&&(e.style.display=`none`);let t=document.getElementById(`confirmCountdown`);t&&(t.classList.remove(`warning`),t.style.display=`none`),C.currentConfirmToolCallId=null,C.currentConfirmSessionId=null}function oo(){if(Ya.length>0){da(Ja);return}ao(),fa(Ja)}function so(e){let t=Xa?.resolve;Xa=null,eo(),t&&t(e),oo()}function co(e){let t={...e,sessionId:e.sessionId||null};return i.debug(`[SidePanel] showconfirm dialog:`,t.toolName,e),Xa&&to(Xa,t)?(i.debug(`[SidePanel] duplicate confirm request, ignored:`,t.toolCallId),Promise.resolve(!1)):Ya.some(e=>to(e,t))?(i.debug(`[SidePanel] queued duplicate confirm, ignored:`,t.toolCallId),Promise.resolve(!1)):new Promise(e=>{Ya.push({...t,resolve:e}),da(Ja),Xa&&uo(),ha(Ja)})}function lo(e,t=`single`){if(!Xa)return;let n=Xa.toolCallId,r=Xa.sessionId;eo(),chrome.runtime.sendMessage({type:`TOOL_CONFIRMATION_RESPONSE`,toolCallId:n,confirmed:e,scope:t,sessionId:r}).catch(e=>{i.debug(`[SidePanel] send confirmationresponse failed:`,e.message)}),so(e)}function uo(){if(!Xa)return;let e=document.getElementById(`confirmMessage`);e&&(e.textContent=no(Xa))}function fo(e){let t=e?.toolCallId;if(!t)return;if(Xa&&Xa.toolCallId===t){i.debug(`[SidePanel] dismiss active confirm dialog (already settled by background):`,t),so(!1);return}let n=Ya.findIndex(e=>e.toolCallId===t);if(n>=0){i.debug(`[SidePanel] drop queued confirm dialog (already settled by background):`,t);let[e]=Ya.splice(n,1);e.resolve&&e.resolve(!1),uo(),ha(Ja)}}ua(Ja,{present:io,pendingCount:()=>Ya.length,refresh:()=>{Xa&&uo()}});function po(){let e=document.getElementById(`confirmApproveOnceBtn`),t=document.getElementById(`confirmApproveLoopBtn`),n=document.getElementById(`confirmDenyBtn`);e&&e.addEventListener(`click`,()=>lo(!0,`single`)),t&&t.addEventListener(`click`,()=>{lo(!0,Xa?.variant===`network`?`whitelist`:`loop`)}),n&&n.addEventListener(`click`,()=>lo(!1,`single`)),chrome.runtime.onMessage.addListener((e,t,n)=>e.type===`SHOW_CONFIRM_DIALOG`?(co(e.data),n({received:!0}),!1):e.type===`DISMISS_CONFIRM_DIALOG`?(fo(e.data),n({received:!0}),!1):!1)}var mo=t({closeCurrentSession:()=>ac,handleDuplicateSession:()=>Xs,handleSessionSwitch:()=>Ys,newSession:()=>xo,renderSessionTabs:()=>yo});n(`zh`,{session:{newSession:`新会话`,closeSession:`关闭会话`,taskCompleted:`任务已完成`,noMatch:`未找到匹配的会话`,rename:`重命名`,duplicate:`复制会话`,confirmCloseMessageWithTitle:`确定要关闭会话 "{title}" 吗?`,confirmCloseAllMessage:`确定要关闭所有 {count} 个会话吗?`,confirmCloseAllTitle:`关闭全部会话`,forkedFrom:`已从 "{title}" 分叉`,forkedSession:`已复制会话 "{title}"`,operationFailed:`操作失败:{message}`,sessionListTitle:`会话列表`,closeGroupAll:`全部关闭`,confirmCloseGroupMessage:`确定要关闭“{group}”下的 {count} 个会话吗?`,today:`今天`,yesterday:`昨天`,last7Days:`近 7 天`,earlier:`更早`,todayFormat:`{hour}:{minute}`,yesterdayFormat:`昨天 {hour}:{minute}`,daysAgo:`{count} 天前`,archive:`归档会话`,archiveEntry:`归档区`,archiveEntryTitle:`查看归档会话`,archivePanelTitle:`归档区`,archiveSearchPlaceholder:`搜索归档会话...`,archiveEmpty:`暂无归档会话`,archiveNoMatch:`未找到匹配的归档会话`,archiveHint:`归档只是移出视野,随时可以恢复`,archiveBusyRunning:`该会话任务还在执行,完成后再归档`,archiveBusyQueued:`该会话还有排队任务,先清空队列再归档`,archived:`已归档到归档区`,archivedRestored:`已恢复会话「{title}」`,archivedAt:`归档于 {time}`,restore:`恢复`,restoreTitle:`恢复到会话列表`,deleteForever:`彻底删除`,confirmDeleteForeverTitle:`彻底删除会话`,confirmDeleteForeverMessage:`「{title}」将被彻底删除,消息与执行记录都无法恢复。确定继续吗?`,archiveDeleted:`已彻底删除会话「{title}」`,backToSessionList:`返回会话列表`,expandSidebar:`展开会话列表`,collapseSidebar:`收起会话列表`,searchSessions:`搜索会话`,sortModeTitle:`会话排序`,sortManual:`手动排序(拖拽调整,与标签栏一致)`,sortRecent:`最近更新优先(按时间倒序,带时间分组)`}}),n(`en`,{session:{newSession:`New Session`,closeSession:`Close Session`,taskCompleted:`Task completed`,noMatch:`No matching sessions found`,rename:`Rename`,duplicate:`Duplicate`,confirmCloseMessageWithTitle:`Are you sure you want to close session "{title}"?`,confirmCloseAllMessage:`Are you sure you want to close all {count} sessions?`,confirmCloseAllTitle:`Close All Sessions`,forkedFrom:`Forked from "{title}"`,forkedSession:`Duplicated session "{title}"`,operationFailed:`Operation failed: {message}`,sessionListTitle:`Sessions`,closeGroupAll:`Close all`,confirmCloseGroupMessage:`Are you sure you want to close {count} sessions in "{group}"?`,today:`Today`,yesterday:`Yesterday`,last7Days:`Last 7 days`,earlier:`Earlier`,todayFormat:`{hour}:{minute}`,yesterdayFormat:`Yesterday {hour}:{minute}`,daysAgo:`{count}d ago`,archive:`Archive session`,archiveEntry:`Archived`,archiveEntryTitle:`View archived sessions`,archivePanelTitle:`Archived sessions`,archiveSearchPlaceholder:`Search archived sessions...`,archiveEmpty:`No archived sessions`,archiveNoMatch:`No archived sessions found`,archiveHint:`Archiving only hides a session — you can restore it anytime`,archiveBusyRunning:`This session is still running. Archive it when it finishes`,archiveBusyQueued:`This session still has queued tasks. Clear the queue first`,archived:`Moved to archive`,archivedRestored:`Session "{title}" restored`,archivedAt:`Archived {time}`,restore:`Restore`,restoreTitle:`Restore to session list`,deleteForever:`Delete permanently`,confirmDeleteForeverTitle:`Delete session permanently`,confirmDeleteForeverMessage:`"{title}" will be permanently deleted. Messages and execution logs cannot be recovered. Continue?`,archiveDeleted:`Session "{title}" permanently deleted`,backToSessionList:`Back to sessions`,expandSidebar:`Expand session list`,collapseSidebar:`Collapse session list`,searchSessions:`Search sessions`,sortModeTitle:`Session order`,sortManual:`Manual order (drag to arrange, same as tabs)`,sortRecent:`Most recent first (time order with day groups)`}});var B={visible:!1,highlightIndex:-1,filteredSessions:[]},ho={draggedId:null,sourceType:null};function go(e){if(!e)return``;let t=new Date(e),n=new Date,i=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),a=t.getTime();if(a>=i)return r(`session.todayFormat`,{hour:String(t.getHours()).padStart(2,`0`),minute:String(t.getMinutes()).padStart(2,`0`)});if(a>=i-864e5)return r(`session.yesterdayFormat`,{hour:String(t.getHours()).padStart(2,`0`),minute:String(t.getMinutes()).padStart(2,`0`)});let o=Math.floor((i-a)/864e5);return o<=7?r(`session.daysAgo`,{count:o}):t.getFullYear()===n.getFullYear()?`${t.getMonth()+1}/${t.getDate()}`:`${t.getFullYear()}/${t.getMonth()+1}/${t.getDate()}`}function _o(e){return e.sort((e,t)=>{let n=e.updatedAt?new Date(e.updatedAt).getTime():0;return(t.updatedAt?new Date(t.updatedAt).getTime():0)-n})}function vo(e){if(!e)return`earlier`;let t=new Date(e),n=new Date,r=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),i=t.getTime();return i>=r?`today`:i>=r-864e5?`yesterday`:Math.floor((r-i)/864e5)<=7?`last7Days`:`earlier`}async function yo(e=null){let t=e||await ti({withActiveHistory:!1});C.sessions=t.list,C.activeSessionId=t.activeSessionId;let n=document.getElementById(`sessionTabs`),i=document.getElementById(`sessionTabsScroll`),a=document.getElementById(`sessionTabsActions`);!n||!i||!a||(i.style.opacity=``,i.innerHTML=``,t.list.forEach(e=>{let t=document.createElement(`div`);t.className=`session-tab`,t.dataset.sessionId=e.id,e.id===C.activeSessionId&&t.classList.add(`active`),t.title=e.title;let n=document.createElement(`span`);n.className=`session-tab-title`,n.textContent=e.title||r(`session.newSession`),t.appendChild(n);let a=document.createElement(`span`);if(a.className=`session-tab-close`,a.innerHTML=`✕`,a.title=r(`session.closeSession`),a.addEventListener(`click`,async t=>{if(t.stopPropagation(),(e.id===C.activeSessionId?C.messageHistory?.length||0:e.messageCount??e.messageHistory?.length??0)===0){Jo(await qo(e.id)),await ic();return}tc(e,async()=>{await ic()})}),t.appendChild(a),e.isGenerating||C.generatingSessionIds.has(e.id)){let e=document.createElement(`span`);e.className=`session-tab-indicator`,t.appendChild(e)}else if(C.completedSessionIds.has(e.id)&&e.id!==C.activeSessionId){let e=document.createElement(`span`);e.className=`session-tab-completed-indicator`,e.title=r(`session.taskCompleted`),t.appendChild(e)}let o=fr(e.id);if(o>0){let e=document.createElement(`span`);e.className=`session-tab-queue-badge`,e.textContent=String(o>99?`99+`:o),e.title=r(`queue.badgeTitle`,{count:o}),t.appendChild(e)}t.addEventListener(`click`,async n=>{if(n.preventDefault(),e.id!==C.activeSessionId&&!Gs){Gs=!0,i.querySelectorAll(`.session-tab.active`).forEach(e=>e.classList.remove(`active`)),t.classList.add(`active`);try{await Ys(e.id)}finally{Gs=!1,C.activeSessionId!==e.id&&yo({list:C.sessions,activeSessionId:C.activeSessionId})}}}),t.addEventListener(`contextmenu`,t=>{t.preventDefault(),nc(t,e)}),t.addEventListener(`mousedown`,async t=>{t.button===1&&(t.preventDefault(),t.stopPropagation(),Jo(await qo(e.id)),await ic())}),t.draggable=!0,t.addEventListener(`dragstart`,t=>Ao(t,e.id)),t.addEventListener(`dragover`,e=>jo(e)),t.addEventListener(`dragleave`,e=>Mo(e)),t.addEventListener(`drop`,t=>No(t,e.id)),t.addEventListener(`dragend`,e=>Po(e)),i.appendChild(t)}),bo(),So(),Qo(),Ws(),$s(i),To(i),Eo(i),ko(i),Cs(),As())}function bo(){let e=document.getElementById(`sessionTabsMore`);if(!e)return;let t=e.cloneNode(!0);e.parentNode.replaceChild(t,e),t.addEventListener(`click`,e=>{e.stopPropagation(),vs()})}async function xo(){let e=C.activeSessionId;await ni();let t=await ai();C.activeSessionId=t.id,C.messageHistory=[],C.activeCompaction=null,ri(t),document.dispatchEvent(new CustomEvent(`session-switched`,{detail:{sessionId:t.id,previousSessionId:e}})),yo()}function So(){let e=document.getElementById(`sessionTabsAdd`);if(!e)return;let t=e.cloneNode(!0);e.parentNode.replaceChild(t,e),t.addEventListener(`click`,()=>xo())}var Co=0,wo=0;function To(e){let t=document.getElementById(`sessionTabsMore`);if(!t)return;if(!fs()){t.style.display=`none`;return}let n=e.scrollWidth>e.clientWidth;t.style.display=n||Co>0?`flex`:`none`}async function Eo(e){let t=++wo,n;try{n=await di()}catch{return}t===wo&&(Co=n.length,To(e))}var Do=null;function Oo(){if(Do)return;let e=document.getElementById(`sessionTabsScroll`);e&&(Do=new ResizeObserver(()=>{requestAnimationFrame(()=>{To(e)})}),Do.observe(e))}function ko(e){let t=e.querySelector(`.session-tab.active`);if(t){let n=t.offsetLeft,r=t.offsetWidth;e.scrollLeft=n-(e.clientWidth-r)/2}e.style.opacity=`1`}function Ao(e,t){ho.draggedId=t,ho.sourceType=`tab`,e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t),e.currentTarget.classList.add(`dragging`)}function jo(e){e.preventDefault(),e.dataTransfer.dropEffect=`move`,e.currentTarget.classList.add(`drag-over`)}function Mo(e){e.currentTarget.classList.remove(`drag-over`)}async function No(e,t){e.preventDefault(),e.currentTarget.classList.remove(`drag-over`);let n=ho.draggedId;if(!n||n===t)return;let r=C.sessions||[],i=r.findIndex(e=>e.id===n),a=r.findIndex(e=>e.id===t);if(i===-1||a===-1)return;let o=[...r],[s]=o.splice(i,1);o.splice(a,0,s),C.sessions=o,await li(o.map(e=>e.id)),yo()}function Po(e){e.currentTarget.classList.remove(`dragging`),document.querySelectorAll(`.session-tab.drag-over`).forEach(e=>e.classList.remove(`drag-over`)),ho.draggedId=null,ho.sourceType=null}function Fo(){B.visible?Lo():Io()}async function Io(){let e=document.getElementById(`sessionTabsMore`),t=document.getElementById(`sessionDropdown`);if(!e||!t)return;let n=await ti();C.sessions=n.list,C.activeSessionId=n.activeSessionId,B.filteredSessions=_o([...n.list]),B.highlightIndex=-1,B.visible=!0,Is(),zo(),t.classList.add(`show`);let r=document.getElementById(`sessionDropdownCloseBtn`);r&&(r.onclick=()=>Lo());let i=document.getElementById(`sessionDropdownSearch`),a=document.getElementById(`sessionDropdownSearchClear`);i&&(i.value=B.lastSearchText||``,Ro(),B.lastSearchText&&Go(B.lastSearchText),setTimeout(()=>i.focus(),50),i.oninput=()=>{B.lastSearchText=i.value,Ro(),Go(i.value)},i.onkeydown=e=>{$o(e)}),a&&(a.onclick=()=>{i&&(i.value=``,B.lastSearchText=``,Ro(),Go(``),i.focus())}),e.classList.add(`active`)}function Lo(){let e=document.getElementById(`sessionTabsMore`),t=document.getElementById(`sessionDropdown`);t&&t.classList.remove(`show`),e&&e.classList.remove(`active`);let n=document.getElementById(`sessionDropdownSearch`);n&&(B.lastSearchText=n.value,n.oninput=null,n.onkeydown=null);let r=document.getElementById(`sessionDropdownSearchClear`);r&&(r.onclick=null),B.visible=!1,B.highlightIndex=-1,B.filteredSessions=[]}function Ro(){let e=document.getElementById(`sessionDropdownSearch`),t=document.getElementById(`sessionDropdownSearchClear`);t&&e&&(t.style.display=e.value?`flex`:`none`)}function zo(){Bo({listEl:document.getElementById(`sessionDropdownList`),filteredSessions:B.filteredSessions,highlightIndex:B.highlightIndex,onSelect:e=>Ko(e)})}function Bo({listEl:e,filteredSessions:t,highlightIndex:n,onSelect:i,grouped:a=!0,draggable:o=!1}){if(!e)return;if(e.innerHTML=``,t.length===0){let t=document.createElement(`div`);t.className=`session-dropdown-empty`,t.textContent=r(`session.noMatch`),e.appendChild(t);return}let s={today:r(`session.today`),yesterday:r(`session.yesterday`),last7Days:r(`session.last7Days`),earlier:r(`session.earlier`)},c={};a&&t.forEach(e=>{let t=vo(e.updatedAt);c[t]=(c[t]||0)+1});let l=null;t.forEach((t,u)=>{if(a){let n=vo(t.updatedAt);if(n!==l){l=n;let t=document.createElement(`div`);t.className=`session-dropdown-group-header`;let i=document.createElement(`span`);if(i.textContent=s[n]||n,t.appendChild(i),(c[n]||0)>0){let e=document.createElement(`button`);e.className=`session-dropdown-group-close`,e.textContent=r(`session.closeGroupAll`),e.onclick=e=>{e.stopPropagation(),Zo(n,s[n]||n)},t.appendChild(e)}e.appendChild(t)}}let d=Wo(t,{index:u,highlightIndex:n,onSelect:i});o&&Ho(d,t.id),e.appendChild(d)})}var Vo=null;function Ho(e,t){e.draggable=!0,e.classList.add(`draggable`),e.addEventListener(`dragstart`,n=>{Vo=t,n.dataTransfer.effectAllowed=`move`,n.dataTransfer.setData(`text/plain`,t),e.classList.add(`dragging`)}),e.addEventListener(`dragover`,n=>{!Vo||Vo===t||(n.preventDefault(),n.dataTransfer.dropEffect=`move`,e.classList.add(`drag-over`))}),e.addEventListener(`dragleave`,()=>e.classList.remove(`drag-over`)),e.addEventListener(`drop`,n=>{n.preventDefault(),n.stopPropagation(),e.classList.remove(`drag-over`),Uo(Vo,t)}),e.addEventListener(`dragend`,()=>{e.classList.remove(`dragging`),document.querySelectorAll(`.session-dropdown-item.drag-over`).forEach(e=>e.classList.remove(`drag-over`)),Vo=null})}async function Uo(e,t){let n=e;if(Vo=null,!n||n===t)return;let r=C.sessions||[],i=r.findIndex(e=>e.id===n),a=r.findIndex(e=>e.id===t);if(i===-1||a===-1)return;let o=[...r],[s]=o.splice(i,1);o.splice(a,0,s),C.sessions=o,await li(o.map(e=>e.id)),await yo()}function Wo(e,{index:t,highlightIndex:n,onSelect:i}){let a=document.createElement(`div`);a.className=`session-dropdown-item`,a.dataset.sessionId=e.id,a.dataset.index=t,e.id===C.activeSessionId&&a.classList.add(`active`),t===n&&a.classList.add(`highlighted`);let o=e.isGenerating||C.generatingSessionIds.has(e.id);if(C.completedSessionIds.has(e.id)&&e.id!==C.activeSessionId&&!o){let e=document.createElement(`span`);e.className=`session-dropdown-item-completed`,e.title=r(`session.taskCompleted`),a.appendChild(e)}let s=fr(e.id);if(s>0){let e=document.createElement(`span`);e.className=`session-dropdown-item-queue`,e.textContent=String(s>99?`99+`:s),e.title=r(`queue.badgeTitle`,{count:s}),a.appendChild(e)}let c=document.createElement(`span`);if(c.className=`session-dropdown-item-icon`,o){let e=document.createElement(`span`);e.className=`session-dropdown-item-running`,c.appendChild(e)}else c.innerHTML=`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>`;a.appendChild(c);let l=document.createElement(`span`);if(l.className=`session-dropdown-item-title`,l.textContent=e.title||r(`session.newSession`),l.title=e.title||r(`session.newSession`),a.appendChild(l),e.id===C.activeSessionId){let e=document.createElement(`span`);e.className=`session-dropdown-item-check`,e.innerHTML=`<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>`,a.appendChild(e)}let u=document.createElement(`span`);u.className=`session-dropdown-item-time`,u.textContent=go(e.updatedAt),a.appendChild(u);let d=document.createElement(`span`);d.className=`session-dropdown-item-actions`;let f=document.createElement(`span`);f.className=`session-dropdown-item-rename`,f.title=r(`session.rename`),f.innerHTML=`<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>`,f.addEventListener(`click`,t=>{t.stopPropagation(),t.preventDefault(),ec(e)}),d.appendChild(f);let p=document.createElement(`span`);p.className=`session-dropdown-item-duplicate`,p.title=r(`session.duplicate`),p.innerHTML=`<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="6" cy="6" r="2.5"/><circle cx="6" cy="18" r="2.5"/><circle cx="18" cy="6" r="2.5"/><path d="M6 8.5v7"/><path d="M18 8.5c0 4-6 3.5-6 3.5"/></svg>`,p.addEventListener(`click`,async t=>{t.stopPropagation(),t.preventDefault(),await Xs(e.id);let n=await ti({withActiveHistory:!1});C.sessions=n.list,C.activeSessionId=n.activeSessionId,Go(document.getElementById(`sessionDropdownSearch`)?.value||``)}),d.appendChild(p);let m=document.createElement(`span`);m.className=`session-dropdown-item-archive`,m.title=r(`session.archive`),m.innerHTML=`<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 8v13H3V8"/><rect x="1" y="3" width="22" height="5"/><line x1="10" y1="12" x2="14" y2="12"/></svg>`,m.addEventListener(`click`,async t=>{t.stopPropagation(),t.preventDefault(),await Ps(e.id),Go(document.getElementById(`sessionDropdownSearch`)?.value||``)}),d.appendChild(m);let h=document.createElement(`span`);return h.className=`session-dropdown-item-close`,h.innerHTML=`✕`,h.title=r(`session.closeSession`),h.addEventListener(`click`,async t=>{t.stopPropagation(),t.preventDefault(),await Yo(e.id)}),d.appendChild(h),a.appendChild(d),a.addEventListener(`click`,async t=>{t.preventDefault(),await i(e.id)}),a}function Go(e){let t=C.sessions||[],n;if(!e.trim())n=[...t];else{let i=e.trim().toLowerCase();n=t.filter(e=>(e.title||r(`session.newSession`)).toLowerCase().includes(i))}B.filteredSessions=_o(n),B.highlightIndex=-1,zo()}async function Ko(e){Lo(),e!==C.activeSessionId&&await Ys(e)}async function qo(e){let t=fr(e)+ur(e).length;return await si(e),t}function Jo(e){e<=0||F(r(`queue.sessionDropped`,{count:e}),`info`,3e3)}async function Yo(e){let t=(C.sessions||[]).find(t=>t.id===e);t&&((e===C.activeSessionId?C.messageHistory?.length||0:t.messageCount??t.messageHistory?.length??0)>0&&!await js(r(`session.confirmCloseMessageWithTitle`,{title:t.title}),r(`session.closeSession`))||(Jo(await qo(e)),await ic(),Go(document.getElementById(`sessionDropdownSearch`)?.value||``)))}async function Xo(){let e=C.sessions||[];if(e.length===0||!await js(r(`session.confirmCloseAllMessage`,{count:e.length}),r(`session.confirmCloseAllTitle`)))return;let t=0;for(let n of e)t+=await qo(n.id);Jo(t),await ic(),Go(document.getElementById(`sessionDropdownSearch`)?.value||``)}async function Zo(e,t){let n=(C.sessions||[]).filter(t=>vo(t.updatedAt)===e);if(n.length===0||!await js(r(`session.confirmCloseGroupMessage`,{group:t,count:n.length}),r(`session.closeSession`)))return;let i=0;for(let e of n)i+=await qo(e.id);Jo(i),await ic(),Go(document.getElementById(`sessionDropdownSearch`)?.value||``)}function Qo(){let e=document.getElementById(`sessionDropdownCloseAll`),t=document.getElementById(`sessionDropdown`);if(t){if(e){let t=e.cloneNode(!0);e.parentNode.replaceChild(t,e),t.addEventListener(`click`,async e=>{e.stopPropagation(),await Xo()})}t.addEventListener(`click`,e=>{e.stopPropagation()})}}function $o(e){if(!B.visible)return;let t=B.filteredSessions.length;if(t===0){e.key===`Escape`&&Lo();return}switch(e.key){case`ArrowDown`:e.preventDefault(),B.highlightIndex=Math.min(B.highlightIndex+1,t-1),zo(),es(document.getElementById(`sessionDropdownList`));break;case`ArrowUp`:e.preventDefault(),B.highlightIndex=Math.max(B.highlightIndex-1,0),zo(),es(document.getElementById(`sessionDropdownList`));break;case`Enter`:if(e.preventDefault(),B.highlightIndex>=0&&B.highlightIndex<t){let e=B.filteredSessions[B.highlightIndex];Ko(e.id)}break;case`Escape`:e.preventDefault(),Lo();break}}function es(e){let t=(e||document).querySelector(`.session-dropdown-item.highlighted`);t&&t.scrollIntoView({block:`nearest`})}var ts=560,ns=200,rs=480,is=360,as=240,os=`sessionSidebarExpanded`,ss=`sessionSidebarWidth`,cs=`sessionSidebarSortMode`,ls=`manual`,us=`recent`,V={expanded:!1,width:as,sortMode:ls,narrow:!1,pendingRestore:!1,highlightIndex:-1,filteredSessions:[],inited:!1,lastActiveId:null};function ds(e){let t=document.getElementById(`mainRow`),n=t?Math.max(ns,t.clientWidth-is):rs;return Math.max(ns,Math.min(e,rs,n))}function fs(){let e=document.getElementById(`mainRow`);return e?e.clientWidth<ts:!0}function ps(){let e=document.getElementById(`sessionSidebar`);if(!e)return;V.narrow=fs(),e.classList.toggle(`sidebar-hidden`,V.narrow),e.classList.toggle(`expanded`,!V.narrow&&V.expanded),e.style.setProperty(`--session-sidebar-width`,`${V.width}px`),ms();let t=document.getElementById(`sessionSidebarToggle`);t&&t.classList.toggle(`sidebar-hidden`,V.narrow||V.expanded);let n=document.getElementById(`sessionTabs`);if(n){let e=!V.narrow&&V.expanded;if(n.classList.toggle(`tabs-hidden`,e),!e){let e=document.getElementById(`sessionTabsScroll`);e&&ko(e)}}}function ms(){let e=!V.narrow&&V.expanded?V.width:0;document.body.style.setProperty(`--session-sidebar-offset`,`${e}px`)}async function hs(){try{await chrome.storage.local.set({[os]:V.expanded,[ss]:V.width,[cs]:V.sortMode})}catch{}}function gs(){fs()||(V.expanded=!0,ps(),hs(),Cs())}function _s(){V.expanded=!1,ps(),hs()}function vs(){if(fs()){Fo();return}V.expanded?_s():gs()}function ys(){let e=document.getElementById(`sessionSidebarList`),t=V.sortMode===us,n=!!(document.getElementById(`sessionSidebarSearch`)?.value||``).trim();Bo({listEl:e,filteredSessions:V.filteredSessions,highlightIndex:V.highlightIndex,onSelect:e=>ws(e),grouped:t,draggable:!t&&!n});let r=C.activeSessionId;r&&V.lastActiveId!==r&&(V.lastActiveId=r,e?.querySelector(`.session-dropdown-item.active`)?.scrollIntoView({block:`nearest`}))}function bs(e){let t=C.sessions||[],n;if(!e.trim())n=[...t];else{let i=e.trim().toLowerCase();n=t.filter(e=>(e.title||r(`session.newSession`)).toLowerCase().includes(i))}V.filteredSessions=V.sortMode===us?_o(n):n.reverse(),V.highlightIndex=-1,ys()}function xs(){document.querySelectorAll(`.session-sidebar-sort-btn`).forEach(e=>{let t=e.dataset.mode===V.sortMode;e.classList.toggle(`active`,t),e.setAttribute(`aria-pressed`,t?`true`:`false`)})}function Ss(e){e!==ls&&e!==us||V.sortMode!==e&&(V.sortMode=e,xs(),V.lastActiveId=null,bs(document.getElementById(`sessionSidebarSearch`)?.value||``),hs())}function Cs(){let e=document.getElementById(`sessionSidebar`);!e||!e.classList.contains(`expanded`)||bs(document.getElementById(`sessionSidebarSearch`)?.value||``)}async function ws(e){e!==C.activeSessionId&&await Ys(e)}function Ts(e){let t=V.filteredSessions,n=t.length;if(n===0){e.key===`Escape`&&_s();return}switch(e.key){case`ArrowDown`:e.preventDefault(),V.highlightIndex=Math.min(V.highlightIndex+1,n-1),ys(),es(document.getElementById(`sessionSidebarList`));break;case`ArrowUp`:e.preventDefault(),V.highlightIndex=Math.max(V.highlightIndex-1,0),ys(),es(document.getElementById(`sessionSidebarList`));break;case`Enter`:e.preventDefault(),V.highlightIndex>=0&&V.highlightIndex<n&&ws(t[V.highlightIndex].id);break;case`Escape`:e.preventDefault(),_s();break}}function Es(){let e=document.getElementById(`sessionSidebarSearch`),t=document.getElementById(`sessionSidebarSearchClear`);t&&e&&(t.style.display=e.value?`flex`:`none`)}function Ds(){let e=document.getElementById(`sessionSidebar`),t=document.getElementById(`sessionSidebarGrip`);!e||!t||t.addEventListener(`mousedown`,t=>{t.preventDefault();let n=t.clientX,r=V.width;e.classList.add(`resizing`);function i(t){let i=ds(r+(t.clientX-n));V.width=i,e.style.setProperty(`--session-sidebar-width`,`${i}px`),ms()}function a(){document.removeEventListener(`mousemove`,i),document.removeEventListener(`mouseup`,a),e.classList.remove(`resizing`),hs()}document.addEventListener(`mousemove`,i),document.addEventListener(`mouseup`,a)})}function Os(){let e=document.getElementById(`mainRow`);!e||typeof ResizeObserver>`u`||new ResizeObserver(()=>{requestAnimationFrame(()=>{let e=fs();e!==V.narrow&&(e&&V.expanded?V.pendingRestore=!0:!e&&V.pendingRestore&&(V.pendingRestore=!1),ps(),!e&&V.expanded&&Cs())})}).observe(e)}function ks(){fs()?Io():gs()}async function As(){if(V.inited||!document.getElementById(`sessionSidebar`))return;V.inited=!0;try{let e=await chrome.storage.local.get([os,ss,cs]);V.expanded=e[os]===!0,typeof e[ss]==`number`&&(V.width=ds(e[ss])),(e[cs]===us||e[cs]===ls)&&(V.sortMode=e[cs])}catch{}xs(),fs()&&V.expanded&&(V.pendingRestore=!0),ps(),Cs(),document.getElementById(`sessionSidebarToggle`)?.addEventListener(`click`,()=>vs()),document.getElementById(`sessionSidebarAdd`)?.addEventListener(`click`,()=>{xo()}),document.getElementById(`sessionSidebarCollapse`)?.addEventListener(`click`,()=>_s()),document.querySelectorAll(`.session-sidebar-sort-btn`).forEach(e=>{e.addEventListener(`click`,()=>Ss(e.dataset.mode))}),document.getElementById(`sessionSidebarArchiveEntry`)?.addEventListener(`click`,()=>{Ls()}),document.getElementById(`sessionSidebarCloseAll`)?.addEventListener(`click`,async e=>{e.stopPropagation(),await Xo()});let e=document.getElementById(`sessionSidebarSearch`),t=document.getElementById(`sessionSidebarSearchClear`);e&&(e.addEventListener(`input`,()=>{Es(),bs(e.value)}),e.addEventListener(`keydown`,e=>{Ts(e)})),t&&t.addEventListener(`click`,()=>{e&&(e.value=``,Es(),bs(``),e.focus())}),Ds(),Os(),Is()}function js(e,t){return new Promise(t=>{let n=document.getElementById(`sessionDeleteModal`),r=document.getElementById(`sessionDeleteMessage`),i=document.getElementById(`sessionDeleteConfirmBtn`),a=document.getElementById(`sessionDeleteCancelBtn`),o=document.getElementById(`sessionDeleteCloseBtn`);if(!n||!r){t(!1);return}r.textContent=e;let s=()=>{n.classList.remove(`show`),i.removeEventListener(`click`,c),a.removeEventListener(`click`,l),o.removeEventListener(`click`,l)},c=()=>{s(),t(!0)},l=()=>{s(),t(!1)};i.addEventListener(`click`,c),a.addEventListener(`click`,l),o.addEventListener(`click`,l),n.classList.add(`show`)})}var Ms=``,Ns=!1;async function Ps(e){if(!e)return;let t=fi(e);if(!t.ok){t.reason===`running`?F(r(`session.archiveBusyRunning`),`warning`):t.reason===`queued`&&F(r(`session.archiveBusyQueued`),`warning`);return}let n=e===C.activeSessionId,i=await pi(e);if(!i?.ok){i?.reason===`running`?F(r(`session.archiveBusyRunning`),`warning`):i?.reason===`queued`?F(r(`session.archiveBusyQueued`),`warning`):F(r(`session.operationFailed`,{message:i?.reason||`unknown`}),`error`);return}if(document.dispatchEvent(new CustomEvent(`session-archived`,{detail:{sessionId:e}})),n)await Fs(e);else{let e=await ti();C.sessions=e.list,yo(e)}await Is(),F(r(`session.archived`),`info`)}async function Fs(e){let t=_o([...(await ti()).list]).filter(t=>t.id!==e);if(t.length>0){await Ys(t[0].id);return}await ai(),await ic()}async function Is(){let e=[`sessionArchiveEntryLabel`,`sessionSidebarArchiveLabel`].map(e=>document.getElementById(e));if(!e.some(Boolean))return;Co=(await di()).length;let t=document.getElementById(`sessionTabsScroll`);t&&To(t);let n=r(`session.archiveEntry`);e.forEach(e=>{e&&(e.textContent=n)})}async function Ls(){let e=document.getElementById(`sessionArchivePanel`);if(!e)return;Ws(),Ms=``;let t=document.getElementById(`sessionArchiveSearch`);t&&(t.value=``),zs(),await Bs(),e.classList.add(`show`),Lo()}function Rs(){let e=document.getElementById(`sessionArchivePanel`);e&&e.classList.remove(`show`)}function zs(){let e=document.getElementById(`sessionArchiveSearchClear`);e&&(e.style.display=Ms?`flex`:`none`)}async function Bs(){let e=document.getElementById(`sessionArchiveList`);if(!e)return;let t=await di(),n=Ms.trim().toLowerCase(),i=n?t.filter(e=>(e.title||``).toLowerCase().includes(n)):t;if(e.innerHTML=``,i.length===0){let t=document.createElement(`div`);t.className=`session-dropdown-empty`,t.textContent=r(n?`session.archiveNoMatch`:`session.archiveEmpty`),e.appendChild(t);return}let a={today:r(`session.today`),yesterday:r(`session.yesterday`),last7Days:r(`session.last7Days`),earlier:r(`session.earlier`)},o=null;i.forEach(t=>{let n=vo(t.archivedAt);if(n!==o){o=n;let t=document.createElement(`div`);t.className=`session-dropdown-group-header`;let r=document.createElement(`span`);r.textContent=a[n]||n,t.appendChild(r),e.appendChild(t)}e.appendChild(Vs(t))})}function Vs(e){let t=document.createElement(`div`);t.className=`session-dropdown-item session-archive-item`,t.dataset.sessionId=e.id,t.title=e.title||r(`session.newSession`);let n=document.createElement(`span`);n.className=`session-dropdown-item-icon`,n.innerHTML=`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 8v13H3V8"/><rect x="1" y="3" width="22" height="5"/><line x1="10" y1="12" x2="14" y2="12"/></svg>`,t.appendChild(n);let i=document.createElement(`span`);i.className=`session-dropdown-item-title`,i.textContent=e.title||r(`session.newSession`),t.appendChild(i);let a=document.createElement(`span`);a.className=`session-dropdown-item-time`,a.textContent=r(`session.archivedAt`,{time:go(e.archivedAt)}),t.appendChild(a);let o=document.createElement(`span`);o.className=`session-dropdown-item-actions`;let s=document.createElement(`span`);s.className=`session-dropdown-item-restore`,s.title=r(`session.restoreTitle`),s.innerHTML=`<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 14 4 9 9 4"/><path d="M20 20v-7a4 4 0 0 0-4-4H4"/></svg>`,s.addEventListener(`click`,async t=>{t.stopPropagation(),await Hs(e.id)}),o.appendChild(s);let c=document.createElement(`span`);return c.className=`session-dropdown-item-delete`,c.title=r(`session.deleteForever`),c.innerHTML=`✕`,c.addEventListener(`click`,async t=>{t.stopPropagation(),await Us(e)}),o.appendChild(c),t.appendChild(o),t.addEventListener(`click`,async()=>{await Hs(e.id,{enter:!0})}),t}async function Hs(e,{enter:t=!1}={}){if(!await mi(e)){F(r(`session.operationFailed`,{message:`not found`}),`error`),await Bs();return}let n=await ti();C.sessions=n.list;let i=n.list.find(t=>t.id===e)?.title||r(`session.newSession`);Rs(),await Bs(),await Is(),t?await Ys(e):yo(n),F(r(`session.archivedRestored`,{title:i}),`success`)}async function Us(e){let t=e.title||r(`session.newSession`);await js(r(`session.confirmDeleteForeverMessage`,{title:t}),r(`session.confirmDeleteForeverTitle`))&&(await hi(e.id),await Bs(),await Is(),document.dispatchEvent(new CustomEvent(`session-deleted`,{detail:{sessionId:e.id}})),F(r(`session.archiveDeleted`,{title:t}),`success`))}function Ws(){if(Ns)return;let e=document.getElementById(`sessionArchivePanel`),t=document.getElementById(`sessionArchiveEntry`);if(!e||!t)return;Ns=!0,t.addEventListener(`click`,()=>{Ls()});let n=document.getElementById(`sessionArchiveBackBtn`);n&&n.addEventListener(`click`,()=>{Rs(),ks()});let r=document.getElementById(`sessionArchiveCloseBtn`);r&&r.addEventListener(`click`,()=>Rs());let i=document.getElementById(`sessionArchiveSearch`),a=document.getElementById(`sessionArchiveSearchClear`);i&&(i.addEventListener(`input`,()=>{Ms=i.value,zs(),Bs()}),i.addEventListener(`keydown`,e=>{e.key===`Escape`&&(e.stopPropagation(),Rs(),ks())})),a&&a.addEventListener(`click`,()=>{i&&(i.value=``,Ms=``,zs(),Bs(),i.focus())}),document.addEventListener(`session-archived`,()=>{e.classList.contains(`show`)&&Bs()}),document.addEventListener(`session-deleted`,()=>{e.classList.contains(`show`)&&Bs()})}var Gs=!1,Ks=500;function qs(e){let t=`scrollPosition_${e||`default`}`;chrome.storage.local.get([t],e=>{let n=document.getElementById(`chatContainer`);n&&e[t]!==void 0&&(n.scrollTop=e[t]),A(async()=>{let{updateScrollButtonState:e}=await Promise.resolve().then(()=>yS);return{updateScrollButtonState:e}},void 0).then(({updateScrollButtonState:e})=>e()).catch(()=>{})})}function Js(e,t){setTimeout(()=>{C.activeSessionId===e&&(Fe(t)||qs(e))},Ks)}async function Ys(e,{focusMessageId:t=null}={}){let n=C.activeSessionId;if(!await oi(e))return;let r=`agentEnabledTools_${C.activeAgentId||`default`}`,i=`agentMcpClosedServers_${C.activeAgentId||`default`}`,[a,o,s,c]=await Promise.all([ti(),chrome.storage.local.get([i,`ragTools`,`ragToolsIntroduced`]),chrome.storage.local.get([r,`enabledTools`]),C.activeAgentId?ft(C.activeAgentId):Promise.resolve(null)]);C.sessions=a.list,C.activeSessionId=e;let l=o.ragTools||[];C.mcpClosedServers=o[i]||[];let u=!!s[r],d=s[r]||s.enabledTools;if(u||d&&d.length>0){let e=ta(l),t=d.filter(t=>e.has(t));if(u)C.enabledTools=t;else{let e=f.filter(e=>e.enabled&&!t.includes(e.id)).map(e=>e.id);C.enabledTools=[...t,...e]}let n=ea(C.enabledTools,l,o.ragToolsIntroduced);C.enabledTools=n.tools,C.enabledTools.length!==d.length&&chrome.storage.local.set({[r]:C.enabledTools,...n.migrated?{ragToolsIntroduced:!0}:{}})}else{C.enabledTools=f.filter(e=>e.enabled).map(e=>e.id);let e=ea(C.enabledTools,l,o.ragToolsIntroduced);C.enabledTools=e.tools,e.migrated&&chrome.storage.local.set({ragToolsIntroduced:!0,[r]:C.enabledTools})}C.activeAgentToolIds=c?c.toolIds:null,C.activeAgentMcpExcludedServerIds=c?c.mcpExcludedServerIds??null:null,document.dispatchEvent(new CustomEvent(`session-switched`,{detail:{sessionId:e,previousSessionId:n,...t?{skipScrollRestore:!0}:{}}})),ei(e),yo(a),Zs(),KT();try{let{refreshBookmarkPanel:e,updateBookmarkButtons:t}=await A(async()=>{let{refreshBookmarkPanel:e,updateBookmarkButtons:t}=await Promise.resolve().then(()=>Rm);return{refreshBookmarkPanel:e,updateBookmarkButtons:t}},void 0);e(),setTimeout(()=>t(),100)}catch{}let p=document.getElementById(`toolsPopupOverlay`);p&&p.classList.contains(`show`)&&(Bi(),Ji(),Yi()),Qi(),t&&Js(e,t)}async function Xs(e,t=null){if(e)try{let n=await vi(e,t);await Ys(n.id),F(r(t?`session.forkedFrom`:`session.forkedSession`,{title:n.title}),`success`)}catch(e){i.error(`[SessionUI] copy/forksession failed:`,e),F(r(`session.operationFailed`,{message:e.message}),`error`)}}function Zs(){let e=document.querySelector(`.model-display`);e&&C.currentModel&&(e.textContent=C.currentModel);let t=document.getElementById(`enableToolsBtn`);t&&(t.checked=C.useTools);let n=document.getElementById(`tempIconValue`);n&&C.temperature!==void 0&&(n.textContent=C.temperature.toFixed(2))}var Qs=new WeakSet;function $s(e){Qs.has(e)||(Qs.add(e),e.addEventListener(`wheel`,t=>{e.scrollWidth<=e.clientWidth||(t.preventDefault(),e.scrollLeft+=t.deltaY)},{passive:!1}))}function ec(e){let t=document.getElementById(`sessionRenameModal`),n=document.getElementById(`sessionRenameInput`),r=document.getElementById(`sessionRenameConfirmBtn`),i=document.getElementById(`sessionRenameCancelBtn`),a=document.getElementById(`sessionRenameCloseBtn`);if(!t||!n)return;n.value=e.title;let o=()=>{t.classList.remove(`show`),r.removeEventListener(`click`,s),i.removeEventListener(`click`,c),a.removeEventListener(`click`,c)},s=async()=>{let t=n.value.trim();if(t&&t!==e.title){await ci(e.id,t),yo();let n=await ti();C.sessions=n.list,C.activeSessionId=n.activeSessionId,Go(document.getElementById(`sessionDropdownSearch`)?.value||``)}o()},c=()=>{o()};r.addEventListener(`click`,s),i.addEventListener(`click`,c),a.addEventListener(`click`,c),n.onkeydown=e=>{e.key===`Enter`?s():e.key===`Escape`&&c()},t.classList.add(`show`),setTimeout(()=>{n.focus(),n.select()},50)}function tc(e,t){let n=document.getElementById(`sessionDeleteModal`),i=document.getElementById(`sessionDeleteMessage`),a=document.getElementById(`sessionDeleteConfirmBtn`),o=document.getElementById(`sessionDeleteCancelBtn`),s=document.getElementById(`sessionDeleteCloseBtn`);if(!n||!i)return;i.textContent=r(`session.confirmCloseMessageWithTitle`,{title:e.title});let c=()=>{n.classList.remove(`show`),a.removeEventListener(`click`,l),o.removeEventListener(`click`,u),s.removeEventListener(`click`,u)},l=async()=>{Jo(await qo(e.id)),t&&await t(),c()},u=()=>{c()};a.addEventListener(`click`,l),o.addEventListener(`click`,u),s.addEventListener(`click`,u),n.classList.add(`show`),requestAnimationFrame(()=>a.focus())}function nc(e,t){let n=document.querySelector(`.session-context-menu`);n&&n.remove();let i=document.createElement(`div`);i.className=`session-context-menu`,i.style.left=e.clientX+`px`,i.style.top=e.clientY+`px`;let a=rc(r(`session.rename`),`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>`,()=>{i.remove(),ec(t)});i.appendChild(a);let o=rc(r(`session.duplicate`),`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="6" cy="6" r="2.5"/><circle cx="6" cy="18" r="2.5"/><circle cx="18" cy="6" r="2.5"/><path d="M6 8.5v7"/><path d="M18 8.5c0 4-6 3.5-6 3.5"/></svg>`,()=>{i.remove(),Xs(t.id)});i.appendChild(o);let s=rc(r(`session.archive`),`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 8v13H3V8"/><rect x="1" y="3" width="22" height="5"/><line x1="10" y1="12" x2="14" y2="12"/></svg>`,async()=>{i.remove(),await Ps(t.id)});i.appendChild(s);let c=rc(r(`session.closeSession`),`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>`,async()=>{if(i.remove(),(t.id===C.activeSessionId?C.messageHistory?.length||0:t.messageCount??t.messageHistory?.length??0)===0){Jo(await qo(t.id)),await ic();return}tc(t,async()=>{await ic()})},`danger`);i.appendChild(c),document.body.appendChild(i);let l=e=>{i.contains(e.target)||(i.remove(),document.removeEventListener(`click`,l))};setTimeout(()=>document.addEventListener(`click`,l),0)}function rc(e,t=``,n,r=``){let i=document.createElement(`div`);return i.className=`session-context-menu-item `+r,t?i.innerHTML=`${t}<span>${e}</span>`:i.textContent=e,i.addEventListener(`click`,n),i}async function ic(){let e=C.activeSessionId,t=await ti();t.activeSessionId||(await ai(),t=await ti()),C.activeSessionId=t.activeSessionId,C.sessions=t.list;let n=t.list.find(e=>e.id===t.activeSessionId);if(C.messageHistory=n&&n.messageHistory||[],C.activeCompaction=n?.contextCompaction||null,ri(n),C.activeAgentId=n&&n.agentId||null,C.activeAgentId){let e=await ft(C.activeAgentId);C.activeAgentToolIds=e?e.toolIds:null,C.activeAgentMcpExcludedServerIds=e?e.mcpExcludedServerIds??null:null}else C.activeAgentToolIds=null,C.activeAgentMcpExcludedServerIds=null;document.dispatchEvent(new CustomEvent(`session-switched`,{detail:{sessionId:C.activeSessionId,previousSessionId:e}})),yo(),await KT()}async function ac(){let e=C.activeSessionId;if(!e)return;let t=C.sessions?.find(t=>t.id===e);if(t){if((C.messageHistory?.length||0)===0){Jo(await qo(e)),await ic();return}tc(t,async()=>{await ic()})}}document.addEventListener(`generating-state-changed`,()=>{yo()}),document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,()=>{Oo(),As()}):(Oo(),As()),[`<svg viewBox="0 0 16 16" fill="currentColor">`,`<path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25zM5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25z"/>`,`</svg>`].join(``),[`<svg viewBox="0 0 16 16" fill="currentColor">`,`<path d="M12.146.146a.5.5 0 0 1 .708 0l2.5 2.5a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12h.5a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5h-.5a.5.5 0 0 1-.468-.325z"/>`,`</svg>`].join(``),[`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">`,`<circle cx="12" cy="12" r="10"></circle>`,`<polyline points="12 6 12 12 16 14"></polyline>`,`</svg>`].join(``),[`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">`,`<line x1="18" y1="6" x2="6" y2="18"></line>`,`<line x1="6" y1="6" x2="18" y2="18"></line>`,`</svg>`].join(``),[`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">`,`<polyline points="7 13 12 18 17 13"></polyline>`,`<polyline points="7 6 12 11 17 6"></polyline>`,`</svg>`].join(``);var oc=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>`,sc=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>`,cc=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>`,lc=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>`,uc=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>`,dc=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>`;[`<svg class="tool-call-icon exec" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">`,`<polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/>`,`</svg>`].join(``),[`<svg class="tool-call-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">`,`<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>`,`<polyline points="14 2 14 8 20 8"/>`,`</svg>`].join(``),[`<svg class="tool-call-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">`,`<circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/>`,`</svg>`].join(``),[`<svg class="tool-call-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">`,`<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/>`,`</svg>`].join(``),n(`zh`,{uiProto:{defaultTitle:`原型`,optimizePrompt:`请帮我优化这个UI原型界面 {id}({title}),`,loadFailed:`加载失败`,noDescription:`暂无描述`,previewInPanel:`面板内预览`,continueOptimizeTitle:`继续优化`,downloadPrototype:`下载原型`,confirmDeleteTitle:`确认删除`,confirmDeleteMessage:`确定删除原型 "{title}" 吗?此操作不可撤销。`,deleteFailed:`删除失败: {message}`,justNow:`刚刚`,minutesAgo:`{count} 分钟前`,hoursAgo:`{count} 小时前`}}),n(`en`,{uiProto:{defaultTitle:`Prototype`,optimizePrompt:`Please help me optimize this UI prototype {id} ({title}), `,loadFailed:`Load failed`,noDescription:`No description`,previewInPanel:`Preview in panel`,continueOptimizeTitle:`Continue optimizing`,downloadPrototype:`Download prototype`,confirmDeleteTitle:`Confirm delete`,confirmDeleteMessage:`Are you sure you want to delete prototype "{title}"? This action cannot be undone.`,deleteFailed:`Delete failed: {message}`,justNow:`Just now`,minutesAgo:`{count} minutes ago`,hoursAgo:`{count} hours ago`}});var fc=null,pc=1,mc=.25,hc=2,gc=.1;function _c(e){let t=e.trim();return/^\s*<!DOCTYPE\s/i.test(t)||/^\s*<html[\s>]/i.test(t)?/<\/head>/i.test(t)?t.replace(/<\/head>/i,`<style>html,body{overflow:auto!important;height:auto!important;}</style></head>`):/<body[\s>]/i.test(t)?t.replace(/<body([\s>])/i,`<body$1<style>html,body{overflow:auto!important;height:auto!important;}</style>`):t:`<!DOCTYPE html>
|
|
61
61
|
<html>
|
|
62
62
|
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"></head>
|
|
63
63
|
<body style="margin:0;padding:0;overflow:auto;">${t}</body>
|
|
@@ -1124,7 +1124,7 @@ It is this session's directory or the agent default, so it stays accessible (wor
|
|
|
1124
1124
|
<source src="${c}" type="${Z(o)}">
|
|
1125
1125
|
</audio>
|
|
1126
1126
|
<div id="mediaUnsupportedHint" style="display:none;">${u}</div>
|
|
1127
|
-
</div>`;let d=i.querySelector(`video, audio`),f=i.querySelector(`#mediaUnsupportedHint`);if(d){let e=()=>{d.style.display=`none`,f&&(f.style.display=`block`)};d.addEventListener(`error`,e),i.querySelectorAll(`source`).forEach(t=>t.addEventListener(`error`,e))}}var w_=!1;function T_(e,t){let n=e.getBoundingClientRect();t.style.top=n.bottom+4+`px`;let r=n.right-160;t.style.left=Math.max(4,r)+`px`,t.style.right=`auto`}function E_(e,t){T_(e,t),t.classList.add(`show`)}function D_(){let e=document.getElementById(`workspacePreviewExportMenu`),t=document.getElementById(`workspacePreviewExportBtn`),n=document.getElementById(`workspacePreviewExportDropdown`);if(!e||!t||!n)return;document.body.appendChild(n),t.addEventListener(`click`,e=>{e.stopPropagation(),n.classList.contains(`show`)?n.classList.remove(`show`):E_(t,n)});let r=null,i=null;e.addEventListener(`mouseenter`,()=>{i&&=(clearTimeout(i),null),r=setTimeout(()=>{E_(t,n)},200)}),e.addEventListener(`mouseleave`,()=>{r&&=(clearTimeout(r),null),i=setTimeout(()=>{!e.matches(`:hover`)&&!n.matches(`:hover`)&&n.classList.remove(`show`)},300)}),n.addEventListener(`mouseenter`,()=>{i&&=(clearTimeout(i),null)}),n.addEventListener(`mouseleave`,()=>{i=setTimeout(()=>{!e.matches(`:hover`)&&!n.matches(`:hover`)&&n.classList.remove(`show`)},200)}),n.querySelectorAll(`.ws-export-dropdown-item`).forEach(e=>{e.addEventListener(`click`,t=>{t.stopPropagation();let r=e.dataset.exportType;n.classList.remove(`show`),k_(r)})}),document.addEventListener(`click`,t=>{!e.contains(t.target)&&!n.contains(t.target)&&n.classList.remove(`show`)});let a=()=>{n.classList.contains(`show`)&&T_(t,n)};document.getElementById(`workspacePreviewContent`)?.addEventListener(`scroll`,a),window.addEventListener(`resize`,a)}function O_(){return document.getElementById(`workspacePreviewArea`).dataset.markdownText||``}async function k_(e){if(w_)return;w_=!0;let t=document.getElementById(`workspacePreviewExportBtn`);document.getElementById(`workspacePreviewExportMenu`);let n=document.getElementById(`workspacePreviewExportDropdown`),a=document.getElementById(`workspacePreviewArea`).dataset.previewName||`export`,o=t.innerHTML;t.innerHTML=`<svg viewBox="0 0 24 24" fill="none" style="animation: spin 0.8s linear infinite; width: 14px; height: 14px; flex-shrink: 0;"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-dasharray="31.4" stroke-dashoffset="10" opacity="0.25"/><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-dasharray="31.4" stroke-dashoffset="10"/></svg>`,t.disabled=!0,t.style.opacity=`0.6`;try{switch(e){case`docx`:await M_(a);break;case`pdf`:await P_(a);break;case`image`:await F_(a);break;case`md`:I_(a);break}}catch(e){i.error(`[WorkspacePanel] export failed:`,e),F(r(`chatExport.exportFailed`,{message:e.message}),`error`)}finally{w_=!1,t.innerHTML=o,t.disabled=!1,t.style.opacity=`1`,n.classList.remove(`show`)}}async function A_(e){if(typeof mermaid>`u`)return;let{renderMermaidInContainer:t,convertSvgsToImages:n}=await A(async()=>{let{renderMermaidInContainer:e,convertSvgsToImages:t}=await import(`./chat-export-
|
|
1127
|
+
</div>`;let d=i.querySelector(`video, audio`),f=i.querySelector(`#mediaUnsupportedHint`);if(d){let e=()=>{d.style.display=`none`,f&&(f.style.display=`block`)};d.addEventListener(`error`,e),i.querySelectorAll(`source`).forEach(t=>t.addEventListener(`error`,e))}}var w_=!1;function T_(e,t){let n=e.getBoundingClientRect();t.style.top=n.bottom+4+`px`;let r=n.right-160;t.style.left=Math.max(4,r)+`px`,t.style.right=`auto`}function E_(e,t){T_(e,t),t.classList.add(`show`)}function D_(){let e=document.getElementById(`workspacePreviewExportMenu`),t=document.getElementById(`workspacePreviewExportBtn`),n=document.getElementById(`workspacePreviewExportDropdown`);if(!e||!t||!n)return;document.body.appendChild(n),t.addEventListener(`click`,e=>{e.stopPropagation(),n.classList.contains(`show`)?n.classList.remove(`show`):E_(t,n)});let r=null,i=null;e.addEventListener(`mouseenter`,()=>{i&&=(clearTimeout(i),null),r=setTimeout(()=>{E_(t,n)},200)}),e.addEventListener(`mouseleave`,()=>{r&&=(clearTimeout(r),null),i=setTimeout(()=>{!e.matches(`:hover`)&&!n.matches(`:hover`)&&n.classList.remove(`show`)},300)}),n.addEventListener(`mouseenter`,()=>{i&&=(clearTimeout(i),null)}),n.addEventListener(`mouseleave`,()=>{i=setTimeout(()=>{!e.matches(`:hover`)&&!n.matches(`:hover`)&&n.classList.remove(`show`)},200)}),n.querySelectorAll(`.ws-export-dropdown-item`).forEach(e=>{e.addEventListener(`click`,t=>{t.stopPropagation();let r=e.dataset.exportType;n.classList.remove(`show`),k_(r)})}),document.addEventListener(`click`,t=>{!e.contains(t.target)&&!n.contains(t.target)&&n.classList.remove(`show`)});let a=()=>{n.classList.contains(`show`)&&T_(t,n)};document.getElementById(`workspacePreviewContent`)?.addEventListener(`scroll`,a),window.addEventListener(`resize`,a)}function O_(){return document.getElementById(`workspacePreviewArea`).dataset.markdownText||``}async function k_(e){if(w_)return;w_=!0;let t=document.getElementById(`workspacePreviewExportBtn`);document.getElementById(`workspacePreviewExportMenu`);let n=document.getElementById(`workspacePreviewExportDropdown`),a=document.getElementById(`workspacePreviewArea`).dataset.previewName||`export`,o=t.innerHTML;t.innerHTML=`<svg viewBox="0 0 24 24" fill="none" style="animation: spin 0.8s linear infinite; width: 14px; height: 14px; flex-shrink: 0;"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-dasharray="31.4" stroke-dashoffset="10" opacity="0.25"/><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-dasharray="31.4" stroke-dashoffset="10"/></svg>`,t.disabled=!0,t.style.opacity=`0.6`;try{switch(e){case`docx`:await M_(a);break;case`pdf`:await P_(a);break;case`image`:await F_(a);break;case`md`:I_(a);break}}catch(e){i.error(`[WorkspacePanel] export failed:`,e),F(r(`chatExport.exportFailed`,{message:e.message}),`error`)}finally{w_=!1,t.innerHTML=o,t.disabled=!1,t.style.opacity=`1`,n.classList.remove(`show`)}}async function A_(e){if(typeof mermaid>`u`)return;let{renderMermaidInContainer:t,convertSvgsToImages:n}=await A(async()=>{let{renderMermaidInContainer:e,convertSvgsToImages:t}=await import(`./chat-export-DduslUlT.js`);return{renderMermaidInContainer:e,convertSvgsToImages:t}},__vite__mapDeps([9,10,1,11,2,3,0]));await t(e),await n(e)}async function j_(e){if(typeof mermaid>`u`||!/```mermaid/i.test(e))return e;let{renderMermaidInContainer:t,convertSvgsToImages:n}=await A(async()=>{let{renderMermaidInContainer:e,convertSvgsToImages:t}=await import(`./chat-export-DduslUlT.js`);return{renderMermaidInContainer:e,convertSvgsToImages:t}},__vite__mapDeps([9,10,1,11,2,3,0]));try{let r=et(e),i=document.createElement(`div`);i.style.cssText=`position:fixed;left:-9999px;top:-9999px;`,i.innerHTML=r,document.body.appendChild(i),await t(i),await n(i);let a=i.querySelectorAll(`.mermaid`),o=[];for(let e of a){let t=e.querySelector(`img`);t&&t.src&&t.src.startsWith(`data:`)?o.push(t.src):o.push(null)}if(document.body.removeChild(i),o.length===0)return e;let s=0;return e.replace(/```\s*mermaid\s*[\r\n]+([\s\S]*?)```/gi,e=>{let t=o[s];return s++,t?``:e})}catch(t){return i.warn(`[WorkspacePanel] Mermaid pre-render failed:`,t.message),e}}async function M_(e){let{Packer:t}=await A(async()=>{let{Packer:e}=await import(`./dist-BUuoW_84.js`);return{Packer:e}},__vite__mapDeps([10,1])),{createDocxDocument:n}=await A(async()=>{let{createDocxDocument:e}=await import(`./chat-export-DduslUlT.js`);return{createDocxDocument:e}},__vite__mapDeps([9,10,1,11,2,3,0])),i=O_();if(!i){F(r(`chatExport.noContent`),`error`);return}i=await j_(i);let a=n(await N_(i)),o=await t.toBlob(a),s=`word-${new Date().getTime()}.docx`;L_(o,s),F(r(`workspace.downloaded`,{name:s}),`success`)}async function N_(e){let{Document:t,Packer:n,Paragraph:r,TextRun:i,HeadingLevel:a,Table:o,TableRow:s,TableCell:c,AlignmentType:l,WidthType:u,BorderStyle:d,ImageRun:f,ExternalHyperlink:p,convertInchesToTwip:m}=await A(async()=>{let{Document:e,Packer:t,Paragraph:n,TextRun:r,HeadingLevel:i,Table:a,TableRow:o,TableCell:s,AlignmentType:c,WidthType:l,BorderStyle:u,ImageRun:d,ExternalHyperlink:f,convertInchesToTwip:p}=await import(`./dist-BUuoW_84.js`);return{Document:e,Packer:t,Paragraph:n,TextRun:r,HeadingLevel:i,Table:a,TableRow:o,TableCell:s,AlignmentType:c,WidthType:l,BorderStyle:u,ImageRun:d,ExternalHyperlink:f,convertInchesToTwip:p}},__vite__mapDeps([10,1])),{createTextRuns:h,sanitizeDocxText:g,nextDocxImageId:_,isDocxEmbeddableImageType:v}=await A(async()=>{let{createTextRuns:e,sanitizeDocxText:t,nextDocxImageId:n,isDocxEmbeddableImageType:r}=await import(`./chat-export-DduslUlT.js`);return{createTextRuns:e,sanitizeDocxText:t,nextDocxImageId:n,isDocxEmbeddableImageType:r}},__vite__mapDeps([9,10,1,11,2,3,0]));if(!e||!e.trim())return[new r({children:[new i({text:``})]})];let y=[],b=g(e),x=[];b=b.replace(/```(\w*)\n([\s\S]*?)```/g,(e,t,n)=>{let r=x.length;return x.push({lang:t||``,code:n.trimEnd()}),`\n\n%%CODEBLOCK_${r}%%\n\n`});let S=[];b=b.replace(/<table[\s\S]*?<\/table>/gi,e=>{let t=S.length;return S.push(e),`\n\n%%HTMLTABLE_${t}%%\n\n`});let C=[];b=b.replace(/(?:^\|.+\|\s*$\n)+^\|[\s\-:|]+\|\s*$\n(?:^\|.+\|\s*$\n?)+/gm,e=>{let t=C.length;return C.push(e),`\n\n%%MDTABLE_${t}%%\n\n`});let w=b.split(/\n{2,}/).filter(e=>e.trim());function T(e){if(!e)return[];let t=/(\*\*(.+?)\*\*|(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)|__(.+?)__|(?<!_)_(?!_)(.+?)(?<!_)_(?!_)|`([^`]+)`|\[([^\]]+)\]\(([^)]+)\)|!\[([^\]]*)\]\(([^)]+)\))/,n=[],r=e;for(;r.length>0;){let e=r.match(t);if(!e){n.push(...h(r));break}let a=e.index;a>0&&n.push(...h(r.slice(0,a)));let o=e[1];if(e[2]!==void 0)n.push(...h(e[2],{bold:!0}));else if(e[3]!==void 0)n.push(...h(e[3],{italics:!0}));else if(e[4]!==void 0)n.push(...h(e[4],{bold:!0}));else if(e[5]!==void 0)n.push(...h(e[5],{italics:!0}));else if(e[6]!==void 0)n.push(new i({text:e[6],font:`Consolas`,size:20}));else if(e[7]!==void 0)n.push(new p({children:[new i({text:e[7],style:`Hyperlink`})],link:e[8]}));else if(e[9]!==void 0){let t=e[10];if(t.startsWith(`data:`))try{let[r,a]=t.split(`,`),o=r.match(/data:(image\/(\w+))/);if(o&&a&&v(o[2])){let t=atob(a),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);n.push(new f({data:r,transformation:{width:400,height:300},type:o[2],altText:{id:_(),name:e[9]||`image`}}))}else n.push(new i({text:`[Image: `+(e[9]||`image`)+`]`,italics:!0,color:`999999`}))}catch{n.push(new i({text:`[Image]`,italics:!0,color:`999999`}))}else n.push(new i({text:`[Image: `+(e[9]||t)+`]`,italics:!0,color:`999999`}))}r=r.slice(a+o.length)}return n}function E(e){let t=new DOMParser().parseFromString(e,`text/html`),n=[];return t.querySelectorAll(`tr`).forEach(e=>{let t=[];e.querySelectorAll(`th, td`).forEach(e=>t.push(e.textContent.trim())),t.length>0&&n.push(t)}),n}function D(e){let t=e.trim().split(`
|
|
1128
1128
|
`),n=[];for(let e of t){if(/^[\s\|:\-]+$/.test(e.replace(/\|/g,``)))continue;let t=Xe(e).slice(1,-1).map(e=>e.trim());t.length>0&&n.push(t)}return n}function O(e){if(e.length===0)return new r({children:[]});let t=Math.max(...e.map(e=>e.length));return new o({rows:e.map((e,n)=>{let i=[];for(let a=0;a<t;a++){let o=e[a]||``;i.push(new c({children:[new r({children:T(o),spacing:{before:40,after:40}})],shading:n===0?{fill:`F2F2F2`}:void 0,width:{size:Math.round(100/t*100)/100,type:u.PERCENTAGE}}))}return new s({children:i})}),width:{size:100,type:u.PERCENTAGE},borders:{top:{style:d.SINGLE,size:1,color:`DDDDDD`},bottom:{style:d.SINGLE,size:1,color:`DDDDDD`},left:{style:d.SINGLE,size:1,color:`DDDDDD`},right:{style:d.SINGLE,size:1,color:`DDDDDD`},insideHorizontal:{style:d.SINGLE,size:1,color:`DDDDDD`},insideVertical:{style:d.SINGLE,size:1,color:`DDDDDD`}}})}for(let e of w){let t=e.trim(),n=t.match(/^%%CODEBLOCK_(\d+)%%$/);if(n){let{lang:e,code:t}=x[parseInt(n[1])],a=e?`${e} code`:`code`;y.push(new r({children:[new i({text:a,bold:!0,font:`Consolas`,size:18})]}));let o=t.split(`
|
|
1129
1129
|
`);for(let e of o)y.push(new r({children:[new i({text:e||` `,font:`Consolas`,size:18})],spacing:{before:0,after:0,line:240},shading:{fill:`F5F5F5`}}));y.push(new r({children:[new i({text:``})]}));continue}let o=t.match(/^%%HTMLTABLE_(\d+)%%$/);if(o){let e=E(S[parseInt(o[1])]);e.length>0&&(y.push(O(e)),y.push(new r({children:[new i({text:``})]})));continue}let s=t.match(/^%%MDTABLE_(\d+)%%$/);if(s){let e=D(C[parseInt(s[1])]);y.push(O(e)),y.push(new r({children:[new i({text:``})]}));continue}let c=t.match(/^(#{1,6})\s+(.+)/);if(c){let e={1:a.HEADING_1,2:a.HEADING_2,3:a.HEADING_3,4:a.HEADING_4,5:a.HEADING_5,6:a.HEADING_6};y.push(new r({children:T(c[2]),heading:e[c[1].length]||a.HEADING_1,border:{bottom:{style:d.SINGLE,size:6,color:`EAECEF`}}}));let n=t.slice(c[0].length).replace(/^\n+/,``).trim();n&&y.push(new r({children:T(n),spacing:{before:60,after:60}}));continue}if(/^(---|\*\*\*|___)\s*$/.test(t)){y.push(new r({children:[],border:{bottom:{style:d.SINGLE,size:6,color:`CCCCCC`}},spacing:{before:200,after:200}}));continue}if(/^[\-\*\+]\s+/.test(t)){let t=e.split(/\n(?=[\-\*\+]\s+)/);for(let e of t)y.push(new r({children:T(e.replace(/^[\-\*\+]\s+/,``)),bullet:{level:0},spacing:{before:40,after:40}}));continue}if(/^\d+\.\s+/.test(t)){let t=e.split(/\n(?=\d+\.\s+)/);for(let e of t)y.push(new r({children:T(e.replace(/^\d+\.\s+/,``)),numbering:{reference:`default`,level:0},spacing:{before:40,after:40}}));continue}if(t.startsWith(`>`)){let t=e.split(`
|
|
1130
1130
|
`).map(e=>e.replace(/^>\s?/,``)).join(`
|
|
@@ -1285,7 +1285,7 @@ It is this session's directory or the agent default, so it stays accessible (wor
|
|
|
1285
1285
|
</tr>
|
|
1286
1286
|
</thead>
|
|
1287
1287
|
<tbody></tbody>
|
|
1288
|
-
`,a.appendChild(o);let s=document.createElement(`div`);s.className=`artifacts-modal-footer`;let c=document.createElement(`button`);c.className=`artifacts-modal-close-btn`,c.textContent=r(`artifacts.closeBtn`),c.addEventListener(`click`,ub),s.appendChild(c),n.appendChild(i),n.appendChild(a),n.appendChild(s),Ky.appendChild(n);let l=document.body,u=document.getElementById(`workspacePanelContainer`);if(u&&u.classList.contains(`embedded`)){let e=document.getElementById(`mainLeft`);e&&(Ky.classList.add(`embedded-mode`),e.style.position=`relative`,l=e)}l.appendChild(Ky),document.getElementById(`artifactsModalClose`).addEventListener(`click`,ub);let d=e=>{e.key===`Escape`&&(ub(),document.removeEventListener(`keydown`,d))};document.addEventListener(`keydown`,d),o.querySelectorAll(`th.sortable`).forEach(t=>{t.addEventListener(`click`,()=>{let r=t.dataset.sort;Jy===r?Yy=-Yy:(Jy=r,Yy=1),eb(n,e)})}),eb(n,e),ab(e).then(i=>{if(!(!i||!Ky)){if(e.length===0){let t=n.querySelector(`.artifacts-table tbody`);t&&(t.innerHTML=`<tr><td colspan="5" class="artifacts-empty">${r(`artifacts.emptyHint`)}</td></tr>`),ib(n,e)}else ib(n,e),eb(n,e);ob(t,e.length)}}).catch(()=>{})}function ub(){qy&&=(clearTimeout(qy),null),Ky&&=(Ky.remove(),null)}n(`zh`,{promptSelector:{noMatchAgent:`没有匹配的 Agent`,inheritGlobal:`继承全局设置`,editAgentTitle:`编辑此 Agent`,deleteAgentTitle:`删除此 Agent`,noMatchProxy:`没有匹配的代理`,unnamedProxy:`未命名代理`,enableTitle:`启用此代理`,disableTitle:`禁用此代理`,noMatchAll:`没有匹配的 Agent、网页或代理`,noTitle:`无标题`,proxyAddress:`代理地址`,deleteProxyTitle:`删除此代理`,confirmDeleteProxy:`确定要删除此代理吗?`},knowledgeSelector:{disabled:`知识库检索已关闭(可在设置页「知识库」中开启)`,notAvailable:`知识库不可用(请确认代理已连接、检索依赖已安装)`,noCollections:`暂无知识库(可在设置页「知识库」中创建)`,docChunk:`{docs} 文档 · {chunks} 分块`,disabledBadge:`已停用`,disabledTooltip:`已停用(大模型不会自主检索该库),仍可手动 @ 引用`,manualSuffix:`手动引用`}}),n(`en`,{promptSelector:{noMatchAgent:`No matching agent`,inheritGlobal:`Inherit global settings`,editAgentTitle:`Edit this agent`,deleteAgentTitle:`Delete this agent`,noMatchProxy:`No matching proxy`,unnamedProxy:`Unnamed proxy`,enableTitle:`Enable this proxy`,disableTitle:`Disable this proxy`,noMatchAll:`No matching agent, page or proxy`,noTitle:`Untitled`,proxyAddress:`Proxy address`,deleteProxyTitle:`Delete this proxy`,confirmDeleteProxy:`Are you sure you want to delete this proxy?`},knowledgeSelector:{disabled:`Knowledge retrieval is turned off (you can enable it in Settings - Knowledge)`,notAvailable:`Knowledge base unavailable (check the agent connection and installed retrieval dependencies)`,noCollections:`No knowledge base yet (create one in Settings - Knowledge)`,docChunk:`{docs} docs · {chunks} chunks`,disabledBadge:`Disabled`,disabledTooltip:`Disabled (the model won't search this knowledge base autonomously); you can still reference it manually via @`,manualSuffix:`manual`}});var db=`pages`;async function fb(){try{let e=await chrome.storage.local.get([`pairedAgents`,`activeAgentId`]);return(e.pairedAgents||[]).map(t=>({...t,isActive:t.id===e.activeAgentId,isDisabled:!!t.disabled}))}catch{return[]}}var pb=!1;async function mb(e=``,t=null){let n=document.getElementById(`agentAtSelector`),r=document.getElementById(`agentAtDropdown`);Je(),n.style.display=`block`,r.classList.add(`show`),_b(),t?await vb(t):await yb(e),hb()}async function hb(){try{let[e,t,n,i]=await Promise.all([gt(),Zb(),fb(),Gb()]),a=document.querySelector(`#agentAtTabs .prompt-tab[data-tab="agents"]`),o=document.querySelector(`#agentAtTabs .prompt-tab[data-tab="pages"]`),s=document.querySelector(`#agentAtTabs .prompt-tab[data-tab="proxies"]`),c=document.querySelector(`#agentAtTabs .prompt-tab[data-tab="knowledge"]`);a&&(a.textContent=r(`promptSelector.agentsCount`,{count:e.length})),o&&(o.textContent=r(`promptSelector.pagesCount`,{count:t.length})),s&&(s.textContent=r(`promptSelector.proxiesCount`,{count:n.length}),s.style.display=n.length>0?``:`none`),c&&(c.textContent=r(`promptSelector.knowledgeCount`,{count:i.collections.length}),c.style.display=i.ok?``:`none`,!i.ok&&db===`knowledge`&&vb(`pages`))}catch{}}function gb(){let e=document.getElementById(`agentAtSelector`),t=document.getElementById(`agentAtDropdown`);e.style.display=`none`,t.classList.remove(`show`),C.selectedAgentAtIndex=-1,C.selectedPageIndex=-1,C.selectedProxyAtIndex=-1,C.selectedKnowledgeAtIndex=-1}function _b(){let e=document.getElementById(`agentAtDropdown`);if(!e||e.dataset.initialized)return;e.dataset.initialized=`1`,e.addEventListener(`mousedown`,e=>{e.target.closest(`.prompt-item, .prompt-tab, .skill-list-item, .mcp-list-item`)&&e.preventDefault()});let t=document.getElementById(`agentAtTabs`);t&&t.querySelectorAll(`.prompt-tab`).forEach(e=>{e.addEventListener(`click`,()=>{vb(e.dataset.tab)})}),e.addEventListener(`click`,async e=>{if(e.target.closest(`#agentAddBtn`)){e.stopPropagation(),gb(),
|
|
1288
|
+
`,a.appendChild(o);let s=document.createElement(`div`);s.className=`artifacts-modal-footer`;let c=document.createElement(`button`);c.className=`artifacts-modal-close-btn`,c.textContent=r(`artifacts.closeBtn`),c.addEventListener(`click`,ub),s.appendChild(c),n.appendChild(i),n.appendChild(a),n.appendChild(s),Ky.appendChild(n);let l=document.body,u=document.getElementById(`workspacePanelContainer`);if(u&&u.classList.contains(`embedded`)){let e=document.getElementById(`mainLeft`);e&&(Ky.classList.add(`embedded-mode`),e.style.position=`relative`,l=e)}l.appendChild(Ky),document.getElementById(`artifactsModalClose`).addEventListener(`click`,ub);let d=e=>{e.key===`Escape`&&(ub(),document.removeEventListener(`keydown`,d))};document.addEventListener(`keydown`,d),o.querySelectorAll(`th.sortable`).forEach(t=>{t.addEventListener(`click`,()=>{let r=t.dataset.sort;Jy===r?Yy=-Yy:(Jy=r,Yy=1),eb(n,e)})}),eb(n,e),ab(e).then(i=>{if(!(!i||!Ky)){if(e.length===0){let t=n.querySelector(`.artifacts-table tbody`);t&&(t.innerHTML=`<tr><td colspan="5" class="artifacts-empty">${r(`artifacts.emptyHint`)}</td></tr>`),ib(n,e)}else ib(n,e),eb(n,e);ob(t,e.length)}}).catch(()=>{})}function ub(){qy&&=(clearTimeout(qy),null),Ky&&=(Ky.remove(),null)}n(`zh`,{promptSelector:{noMatchAgent:`没有匹配的 Agent`,inheritGlobal:`继承全局设置`,editAgentTitle:`编辑此 Agent`,deleteAgentTitle:`删除此 Agent`,noMatchProxy:`没有匹配的代理`,unnamedProxy:`未命名代理`,enableTitle:`启用此代理`,disableTitle:`禁用此代理`,noMatchAll:`没有匹配的 Agent、网页或代理`,noTitle:`无标题`,proxyAddress:`代理地址`,deleteProxyTitle:`删除此代理`,confirmDeleteProxy:`确定要删除此代理吗?`},knowledgeSelector:{disabled:`知识库检索已关闭(可在设置页「知识库」中开启)`,notAvailable:`知识库不可用(请确认代理已连接、检索依赖已安装)`,noCollections:`暂无知识库(可在设置页「知识库」中创建)`,docChunk:`{docs} 文档 · {chunks} 分块`,disabledBadge:`已停用`,disabledTooltip:`已停用(大模型不会自主检索该库),仍可手动 @ 引用`,manualSuffix:`手动引用`}}),n(`en`,{promptSelector:{noMatchAgent:`No matching agent`,inheritGlobal:`Inherit global settings`,editAgentTitle:`Edit this agent`,deleteAgentTitle:`Delete this agent`,noMatchProxy:`No matching proxy`,unnamedProxy:`Unnamed proxy`,enableTitle:`Enable this proxy`,disableTitle:`Disable this proxy`,noMatchAll:`No matching agent, page or proxy`,noTitle:`Untitled`,proxyAddress:`Proxy address`,deleteProxyTitle:`Delete this proxy`,confirmDeleteProxy:`Are you sure you want to delete this proxy?`},knowledgeSelector:{disabled:`Knowledge retrieval is turned off (you can enable it in Settings - Knowledge)`,notAvailable:`Knowledge base unavailable (check the agent connection and installed retrieval dependencies)`,noCollections:`No knowledge base yet (create one in Settings - Knowledge)`,docChunk:`{docs} docs · {chunks} chunks`,disabledBadge:`Disabled`,disabledTooltip:`Disabled (the model won't search this knowledge base autonomously); you can still reference it manually via @`,manualSuffix:`manual`}});var db=`pages`;async function fb(){try{let e=await chrome.storage.local.get([`pairedAgents`,`activeAgentId`]);return(e.pairedAgents||[]).map(t=>({...t,isActive:t.id===e.activeAgentId,isDisabled:!!t.disabled}))}catch{return[]}}var pb=!1;async function mb(e=``,t=null){let n=document.getElementById(`agentAtSelector`),r=document.getElementById(`agentAtDropdown`);Je(),n.style.display=`block`,r.classList.add(`show`),_b(),t?await vb(t):await yb(e),hb()}async function hb(){try{let[e,t,n,i]=await Promise.all([gt(),Zb(),fb(),Gb()]),a=document.querySelector(`#agentAtTabs .prompt-tab[data-tab="agents"]`),o=document.querySelector(`#agentAtTabs .prompt-tab[data-tab="pages"]`),s=document.querySelector(`#agentAtTabs .prompt-tab[data-tab="proxies"]`),c=document.querySelector(`#agentAtTabs .prompt-tab[data-tab="knowledge"]`);a&&(a.textContent=r(`promptSelector.agentsCount`,{count:e.length})),o&&(o.textContent=r(`promptSelector.pagesCount`,{count:t.length})),s&&(s.textContent=r(`promptSelector.proxiesCount`,{count:n.length}),s.style.display=n.length>0?``:`none`),c&&(c.textContent=r(`promptSelector.knowledgeCount`,{count:i.collections.length}),c.style.display=i.ok?``:`none`,!i.ok&&db===`knowledge`&&vb(`pages`))}catch{}}function gb(){let e=document.getElementById(`agentAtSelector`),t=document.getElementById(`agentAtDropdown`);e.style.display=`none`,t.classList.remove(`show`),C.selectedAgentAtIndex=-1,C.selectedPageIndex=-1,C.selectedProxyAtIndex=-1,C.selectedKnowledgeAtIndex=-1}function _b(){let e=document.getElementById(`agentAtDropdown`);if(!e||e.dataset.initialized)return;e.dataset.initialized=`1`,e.addEventListener(`mousedown`,e=>{e.target.closest(`.prompt-item, .prompt-tab, .skill-list-item, .mcp-list-item`)&&e.preventDefault()});let t=document.getElementById(`agentAtTabs`);t&&t.querySelectorAll(`.prompt-tab`).forEach(e=>{e.addEventListener(`click`,()=>{vb(e.dataset.tab)})}),e.addEventListener(`click`,async e=>{if(e.target.closest(`#agentAddBtn`)){e.stopPropagation(),gb(),uE(null);return}if(e.target.closest(`#proxyAddBtn`)){e.stopPropagation(),gb(),chrome.runtime.sendMessage({type:`OPEN_OPTIONS_PAGE`,hash:`agent`});return}if(e.target.closest(`#knowledgeAddBtn`)){e.stopPropagation(),gb(),chrome.runtime.sendMessage({type:`OPEN_OPTIONS_PAGE`,hash:`knowledge`});return}if(e.target.closest(`#pageAddBtn`)){e.stopPropagation(),gb(),chrome.tabs.create({});return}let t=e.target.closest(`.agent-edit-btn`);if(t){e.stopPropagation();let n=t.dataset.agentId;gb(),uE(n);return}let n=e.target.closest(`.agent-delete-btn`);if(n){e.stopPropagation();let t=n.dataset.agentId;if(await AE(t)){let e=document.getElementById(`userInput`);await yb(e?bb(e.value):``)}}})}async function vb(e){db=e;let t=document.getElementById(`agentAtTabs`);t&&t.querySelectorAll(`.prompt-tab`).forEach(t=>{t.classList.toggle(`active`,t.dataset.tab===e)});let n=document.getElementById(`agentAtList`),r=document.getElementById(`agentPageList`),i=document.getElementById(`agentProxyList`),a=document.getElementById(`agentKnowledgeList`);n&&(n.style.display=e===`agents`?``:`none`),r&&(r.style.display=e===`pages`?``:`none`),i&&(i.style.display=e===`proxies`?``:`none`),a&&(a.style.display=e===`knowledge`?``:`none`);let o=document.getElementById(`agentAtDropdown`);o&&o.setAttribute(`data-active-tab`,e);let s=document.getElementById(`userInput`);s&&s.focus(),await yb(s?bb(s.value):``)}async function yb(e=``){let t=document.getElementById(`agentAtTabs`),n=document.getElementById(`agentPageList`),r=document.getElementById(`agentAtList`),i=document.getElementById(`agentProxyList`),a=document.getElementById(`agentKnowledgeList`);if(e){pb=!0,t&&t.classList.add(`merged-mode`),n&&(n.style.display=`none`),i&&(i.style.display=`none`),a&&(a.style.display=`none`),r&&(r.style.display=``),await jb(e);let o=document.getElementById(`agentAtDropdown`);o&&o.setAttribute(`data-active-tab`,`merged`)}else{pb=!1,t&&t.classList.remove(`merged-mode`),t&&t.querySelectorAll(`.prompt-tab`).forEach(e=>{e.classList.toggle(`active`,e.dataset.tab===db)}),n&&(n.style.display=db===`pages`?``:`none`),r&&(r.style.display=db===`agents`?``:`none`),i&&(i.style.display=db===`proxies`?``:`none`),a&&(a.style.display=db===`knowledge`?``:`none`);let e=document.getElementById(`agentAtDropdown`);e&&e.setAttribute(`data-active-tab`,db),db===`pages`?await Qb(``):db===`proxies`?await Ab(``):db===`knowledge`?await Kb(``):await Cb(``)}}function bb(e){let t=e.lastIndexOf(`@`);return t===-1?``:e.substring(t+1)}function xb(e){return e.id==="default"?r(`agentMgr.defaultAgentName`):e.name}function Sb(e){return e.id==="default"?r(`agentMgr.defaultAgentDesc`):e.description}async function Cb(e=``){let t=document.getElementById(`agentAtList`);if(!t)return;let n=await gt(),i=(e||``).toLowerCase(),a=n.filter(t=>{if(!e)return!0;let n=xb(t),r=Sb(t);return n&&n.toLowerCase().includes(i)||r&&r.toLowerCase().includes(i)});if(a.length===0){t.innerHTML=`<div class="prompt-empty">${r(`promptSelector.noMatchAgent`)}</div>`,C.selectedAgentAtIndex=-1;return}C.selectedAgentAtIndex=0,t.innerHTML=a.map((e,t)=>{let n=e.id===C.activeAgentId||!C.activeAgentId&&e.id==="default",i=e.toolIds?e.toolIds.length:e.toolIds===null?null:0,a=i===null?r(`promptSelector.inheritGlobal`):r(`promptSelector.toolCount`,{count:i}),o=xb(e),s=Sb(e);return`
|
|
1289
1289
|
<div class="prompt-item ${t===0?`selected`:``} ${n?`agent-at-active`:``}"
|
|
1290
1290
|
data-index="${t}" data-agent-id="${P(e.id)}">
|
|
1291
1291
|
<span class="prompt-item-index">${t+1}</span>
|
|
@@ -1355,7 +1355,7 @@ It is this session's directory or the agent default, so it stays accessible (wor
|
|
|
1355
1355
|
${t?`<span class="agent-item-actions"><span class="agent-active-mark">✓</span></span>`:``}
|
|
1356
1356
|
${n?`<span class="proxy-enable-btn" data-action="enable" data-id="${P(e.id)}" title="${r(`promptSelector.enableTitle`)}">▶</span>`:`<span class="proxy-disable-btn" data-action="disable" data-id="${P(e.id)}" title="${r(`promptSelector.disableTitle`)}">⏸</span>`}
|
|
1357
1357
|
<span class="proxy-delete-btn" data-action="delete" data-id="${P(e.id)}" title="${r(`common.delete`)}">✕</span>
|
|
1358
|
-
</div>`,h++}),t.innerHTML=m,t.querySelectorAll(`img.favicon-img`).forEach(e=>{e.addEventListener(`error`,()=>{e.style.display=`none`})}),u.forEach(e=>kb(e)),t.querySelectorAll(`.prompt-item`).forEach(e=>{e.addEventListener(`click`,async t=>{let n=t.target.closest(`.page-action-btn`);if(n){t.stopPropagation(),rx(parseInt(n.dataset.tabId),n.dataset.action);return}let r=t.target.closest(`.proxy-disable-btn, .proxy-delete-btn, .proxy-enable-btn`);if(r){t.stopPropagation(),await Xb(r.dataset.action,r.dataset.id);return}if(t.target.closest(`.agent-edit-btn`)||t.target.closest(`.agent-delete-btn`))return;let i=e.dataset.type;i===`agent`?await Fb(e.dataset.agentId):i===`page`?Ib(parseInt(e.dataset.tabId)):i===`knowledge`?(Rb({id:e.dataset.kbId,name:e.dataset.kbName,enabled:e.dataset.kbDisabled!==`1`}),(t.ctrlKey||t.metaKey)&&gb()):i===`proxy`&&await qb(e.dataset.proxyId)})})}function Mb(e){let t;t=pb?C.selectedAgentAtIndex:db===`proxies`?C.selectedProxyAtIndex:db===`knowledge`?C.selectedKnowledgeAtIndex:C.selectedAgentAtIndex,e.forEach((e,n)=>{n===t?(e.classList.add(`selected`),e.scrollIntoView({block:`nearest`})):e.classList.remove(`selected`)})}function Nb(){let e=document.getElementById(`userInput`);if(!e)return;let t=e.value,n=t.lastIndexOf(`@`);n!==-1&&(e.value=t.substring(0,n)),e.focus(),e.selectionStart=e.selectionEnd=e.value.length}function Pb(){let e=document.getElementById(`userInput`);e&&(e.focus(),e.selectionStart=e.selectionEnd=e.value.length)}async function Fb(e,{clearTrigger:t=!0}={}){t?Nb():Pb(),gb(),await
|
|
1358
|
+
</div>`,h++}),t.innerHTML=m,t.querySelectorAll(`img.favicon-img`).forEach(e=>{e.addEventListener(`error`,()=>{e.style.display=`none`})}),u.forEach(e=>kb(e)),t.querySelectorAll(`.prompt-item`).forEach(e=>{e.addEventListener(`click`,async t=>{let n=t.target.closest(`.page-action-btn`);if(n){t.stopPropagation(),rx(parseInt(n.dataset.tabId),n.dataset.action);return}let r=t.target.closest(`.proxy-disable-btn, .proxy-delete-btn, .proxy-enable-btn`);if(r){t.stopPropagation(),await Xb(r.dataset.action,r.dataset.id);return}if(t.target.closest(`.agent-edit-btn`)||t.target.closest(`.agent-delete-btn`))return;let i=e.dataset.type;i===`agent`?await Fb(e.dataset.agentId):i===`page`?Ib(parseInt(e.dataset.tabId)):i===`knowledge`?(Rb({id:e.dataset.kbId,name:e.dataset.kbName,enabled:e.dataset.kbDisabled!==`1`}),(t.ctrlKey||t.metaKey)&&gb()):i===`proxy`&&await qb(e.dataset.proxyId)})})}function Mb(e){let t;t=pb?C.selectedAgentAtIndex:db===`proxies`?C.selectedProxyAtIndex:db===`knowledge`?C.selectedKnowledgeAtIndex:C.selectedAgentAtIndex,e.forEach((e,n)=>{n===t?(e.classList.add(`selected`),e.scrollIntoView({block:`nearest`})):e.classList.remove(`selected`)})}function Nb(){let e=document.getElementById(`userInput`);if(!e)return;let t=e.value,n=t.lastIndexOf(`@`);n!==-1&&(e.value=t.substring(0,n)),e.focus(),e.selectionStart=e.selectionEnd=e.value.length}function Pb(){let e=document.getElementById(`userInput`);e&&(e.focus(),e.selectionStart=e.selectionEnd=e.value.length)}async function Fb(e,{clearTrigger:t=!0}={}){t?Nb():Pb(),gb(),await XT(e),Ue()}function Ib(e){Nb(),chrome.tabs.get(e,e=>{if(chrome.runtime.lastError||!e){i.error(`[AgentAtSelector] getlabelpageinfo failed:`,chrome.runtime.lastError);return}ex(e),gb();let t=document.getElementById(`userInput`);t&&(t.focus(),Ue())})}function Lb(){let e=new Set(C.knowledgeRefs.map(e=>e.id));document.querySelectorAll(`.prompt-item-knowledge`).forEach(t=>{let n=e.has(t.dataset.kbId);t.classList.toggle(`agent-at-active`,n),t.classList.toggle(`picked`,n)})}function Rb(e,{clearTrigger:t=!0}={}){t?Nb():Pb();let n=C.knowledgeRefs.findIndex(t=>t.id===e.id);n>=0?C.knowledgeRefs.splice(n,1):C.knowledgeRefs.push({id:e.id,name:e.name||e.id,enabled:e.enabled!==!1}),Lb(),Vb(),Ue()}function zb(e){C.knowledgeRefs=C.knowledgeRefs.filter(t=>t.id!==e),Lb(),Vb()}function Bb(){C.knowledgeRefs=[],Lb(),Vb()}function Vb(){let e=document.getElementById(`knowledgeIndicator`);if(e){if(C.knowledgeRefs.length===0){e.style.display=`none`,e.innerHTML=``;return}e.innerHTML=C.knowledgeRefs.map(e=>{let t=e.enabled===!1,n=t?`${e.name} (${r(`knowledgeSelector.manualSuffix`)})`:e.name;return`
|
|
1359
1359
|
<span class="knowledge-chip${t?` knowledge-chip-manual`:``}">
|
|
1360
1360
|
<span class="knowledge-chip-name" title="${P(t?r(`knowledgeSelector.disabledTooltip`):e.name)}">📚 ${P(n)}</span>
|
|
1361
1361
|
<button class="knowledge-chip-close" data-kb-id="${P(e.id)}" title="${r(`common.delete`)}">✕</button>
|
|
@@ -1385,7 +1385,7 @@ It is this session's directory or the agent default, so it stays accessible (wor
|
|
|
1385
1385
|
<span class="page-action-btn" data-action="translate" data-tab-id="${e.id}" title="${r(`pageSelector.translatePage`)}">${r(`pageSelector.translatePage`)}</span>
|
|
1386
1386
|
</span>
|
|
1387
1387
|
</div>
|
|
1388
|
-
`}).join(``),t.querySelectorAll(`img.favicon-img`).forEach(e=>{e.addEventListener(`error`,()=>{e.style.display=`none`})}),t.querySelectorAll(`.prompt-item`).forEach(e=>{e.addEventListener(`click`,t=>{let n=t.target.closest(`.page-action-btn`);if(n){t.stopPropagation(),rx(parseInt(n.dataset.tabId),n.dataset.action);return}nx(parseInt(e.dataset.tabId))})})}function $b(e){e.forEach((e,t)=>{t===C.selectedPageIndex?(e.classList.add(`selected`),e.scrollIntoView({block:`nearest`})):e.classList.remove(`selected`)})}function ex(e){C.selectedPage={id:e.id,title:e.title||r(`pageSelector.noTitle`),url:e.url||``,favIconUrl:e.favIconUrl||``};let t=document.getElementById(`pageIndicator`),n=document.getElementById(`pageIndicatorName`);if(t&&n){let e=C.selectedPage.title&&C.selectedPage.title!==r(`pageSelector.noTitle`)?C.selectedPage.title:``,i=C.selectedPage.url||``;e&&i?n.textContent=`${e} · ${i}`:n.textContent=e||i,t.style.display=`flex`}}function tx(){C.selectedPage=null,C.selectedPageIndex=-1;let e=document.getElementById(`pageIndicator`);e&&(e.style.display=`none`)}function nx(e){let t=document.getElementById(`userInput`),n=t?t.value:``,r=n.lastIndexOf(`@`);r!==-1&&(t.value=n.substring(0,r)),t&&(t.focus(),t.selectionStart=t.selectionEnd=t.value.length),chrome.tabs.get(e,e=>{if(chrome.runtime.lastError||!e){i.error(`[PageSelector] getlabelpageinfo failed:`,chrome.runtime.lastError);return}ex(e),gb(),t&&(t.focus(),Ue())})}function rx(e,t){let n={interpret:r(`pageSelector.interpretMsg`),summarize:r(`pageSelector.summarizeMsg`),translate:r(`pageSelector.translateMsg`)}[t];n&&chrome.tabs.get(e,e=>{if(chrome.runtime.lastError||!e){i.error(`[PageSelector] get tab info failed:`,chrome.runtime.lastError);return}ex(e),gb();let t=document.getElementById(`userInput`);t&&(t.value=n,Ue()),lw()})}function ix(){let e=document.getElementById(`pageIndicatorClose`);e&&e.addEventListener(`click`,()=>{tx()})}n(`zh`,{msgFullscreen:{title:`全屏阅读`,btnTitle:`全屏查看本回答 (Alt+双击 / Alt+F)`,btnLabel:`全屏`,copy:`复制`,copyTitle:`复制回答内容(Ctrl/⌘+点击复制富文本)`,export:`导出`,exportTitle:`导出下载本回答`,exportWord:`导出 Word`,exportPdf:`导出 PDF`,exportImage:`导出图片`,exportMarkdown:`导出 Markdown`,close:`退出全屏`,closeTitle:`退出全屏 (Esc)`}}),n(`en`,{msgFullscreen:{title:`Fullscreen Reading`,btnTitle:`View this answer fullscreen (Alt+Double-click / Alt+F)`,btnLabel:`Fullscreen`,copy:`Copy`,copyTitle:`Copy answer (Ctrl/Cmd+click for rich text)`,export:`Export`,exportTitle:`Export / download this answer`,exportWord:`Export Word`,exportPdf:`Export PDF`,exportImage:`Export Image`,exportMarkdown:`Export Markdown`,close:`Exit fullscreen`,closeTitle:`Exit fullscreen (Esc)`}});var ax=`messageFullscreenOverlay`,ox=`messageFullscreenBody`,sx=`messageFullscreenTitle`,cx=`messageFullscreenCopyBtn`,lx=`messageFullscreenCloseBtn`,ux=`messageFullscreenExportBtn`,dx=`messageFullscreenExportDropdown`,fx=null,px=null,mx=null,hx=!1,gx=null,_x=!1;function vx(){return fx!==null}function yx(e){return!e||vx()?null:e.innerHTML}function bx(){let e=document.querySelectorAll(`#chatContainer .message.assistant`);return e.length?e[e.length-1]:null}function xx(){let e=document.createElement(`button`);return e.className=`fullscreen-btn`,e.title=r(`msgFullscreen.btnTitle`),e.innerHTML=[`<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" width="14" height="14">`,`<path d="M6 2H2v4M10 2h4v4M6 14H2v-4M10 14h4v-4"/>`,`</svg>`,`<span>${r(`msgFullscreen.btnLabel`)}</span>`].join(``),e}function Sx(){let e=document.getElementById(ax),t=document.getElementById(ox);return!e||!t?(i.warn(`[MsgFullscreen] overlay/body element missing`),null):{overlay:e,body:t,title:document.getElementById(sx),copyBtn:document.getElementById(cx),closeBtn:document.getElementById(lx)}}function Cx(e){if(!e)return;let t=Sx();if(t&&fx!==e){if(!fx){let e=document.getElementById(`chatContainer`);gx=e?e.scrollTop:null}fx&&(_x=!0,wx(),_x=!1),px=document.createComment(`msg-fullscreen-anchor`),e.parentNode.insertBefore(px,e),e.dataset.fullscreen=`1`,t.body.appendChild(e),fx=e,t.overlay.style.display=`flex`,document.body.classList.add(`message-fullscreen-viewing`),t.title&&(t.title.textContent=r(`msgFullscreen.title`)),t.copyBtn&&(t.copyBtn.title=r(`msgFullscreen.copyTitle`)),t.closeBtn&&(t.closeBtn.title=r(`msgFullscreen.closeTitle`)),Px(),Ex(t.body)}}function wx(){if(!fx)return;let e=Sx();if(Ox(),Fx(),px&&px.parentNode)px.parentNode.insertBefore(fx,px);else if(e){let e=document.getElementById(`chatContainer`);e&&e.appendChild(fx)}if(px&&px.parentNode&&px.parentNode.removeChild(px),delete fx.dataset.fullscreen,fx=null,px=null,e){e.overlay.style.display=`none`,e.body.innerHTML=``;let t=e.overlay.querySelector(`.message-fullscreen-rail`);t&&t.querySelectorAll(`.message-toc-container`).forEach(e=>e.remove())}if(document.body.classList.remove(`message-fullscreen-viewing`),!_x&&gx!==null){let e=document.getElementById(`chatContainer`);e&&(e.scrollTop=gx),gx=null}}function Tx(e){if(fx&&fx===e){wx();return}Cx(e||bx())}function Ex(e){Ox(),hx=!1,e.scrollTop=e.scrollHeight,e.addEventListener(`scroll`,Dx,{passive:!0}),typeof ResizeObserver<`u`&&(mx=new ResizeObserver(()=>{hx||(e.scrollTop=e.scrollHeight)}),mx.observe(e.firstElementChild||e))}function Dx(){let e=document.getElementById(ox);e&&(hx=e.scrollHeight-e.scrollTop-e.clientHeight>60)}function Ox(){let e=document.getElementById(ox);e&&e.removeEventListener(`scroll`,Dx),mx&&=(mx.disconnect(),null)}function kx(e){if(e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&e.code===`KeyF`){e.preventDefault(),fx?wx():Cx(bx());return}e.key===`Escape`&&fx&&(e.preventDefault(),e.stopImmediatePropagation(),wx())}function Ax(e){if(!e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;let t=e.target.closest?.(`#chatContainer .message.assistant`);t&&(e.preventDefault(),Tx(t))}async function jx(e){if(!fx)return;let{copyAssistantMessage:t}=await A(async()=>{let{copyAssistantMessage:e}=await Promise.resolve().then(()=>Rx);return{copyAssistantMessage:e}},void 0);t(fx,document.getElementById(cx),e)}var Mx={docx:`<path d="M4 1.5h6L13 4.5v10H4z"/><path d="M10 1.5v3h3"/><path d="M6 8h4M6 10.5h4"/>`,pdf:`<path d="M4 1.5h6L13 4.5v10H4z"/><path d="M10 1.5v3h3"/><path d="M6.5 11.5c2-1 2.5-4 1-4s-1 4 2 4"/>`,image:`<rect x="2.5" y="3" width="11" height="10" rx="1.2"/><circle cx="6" cy="6.5" r="1"/><path d="M13.5 10 10 6.5 4.5 12.5"/>`,markdown:`<path d="M2.5 12V4l3 3 3-3v8"/><path d="M12.5 4v6m0 0 2-2.2m-2 2.2L10.5 7.8"/>`};function Nx(){let e=document.createElement(`div`);e.className=`message-fullscreen-export`;let t=document.createElement(`button`);t.className=`message-fullscreen-icon-btn`,t.id=ux,t.type=`button`,t.title=r(`msgFullscreen.exportTitle`),t.innerHTML=[`<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" width="16" height="16">`,`<path d="M8 2v8m0 0 3-3M8 10 5 7M2.5 13.5h11"/>`,`</svg>`,`<span>${r(`msgFullscreen.export`)}</span>`,`<svg class="dropdown-arrow" width="8" height="6" viewBox="0 0 8 6" fill="currentColor"><path d="M0 0l4 6 4-6z"/></svg>`].join(``);let n=document.createElement(`div`);n.className=`message-fullscreen-export-dropdown`,n.id=dx;let i=e=>`<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round">${Mx[e]}</svg>`;n.innerHTML=[`<button class="export-dropdown-item export-docx-item" type="button">${i(`docx`)}<span>${r(`msgFullscreen.exportWord`)}</span></button>`,`<button class="export-dropdown-item export-pdf-item" type="button">${i(`pdf`)}<span>${r(`msgFullscreen.exportPdf`)}</span></button>`,`<button class="export-dropdown-item export-image-item" type="button">${i(`image`)}<span>${r(`msgFullscreen.exportImage`)}</span></button>`,`<button class="export-dropdown-item export-md-item" type="button">${i(`markdown`)}<span>${r(`msgFullscreen.exportMarkdown`)}</span></button>`].join(``),t.addEventListener(`click`,e=>{e.stopPropagation(),n.classList.toggle(`show`)});let a=(e,t)=>{let r=n.querySelector(e);r.addEventListener(`click`,async e=>{e.stopPropagation(),fx&&(n.classList.remove(`show`),(await A(()=>import(`./chat-export-CCgB_PeN.js`),__vite__mapDeps([9,10,1,11,2,3,0])))[t](fx,r,n))})};return a(`.export-docx-item`,`exportAssistantMessageToDocx`),a(`.export-pdf-item`,`exportAssistantMessageToPdf`),a(`.export-image-item`,`exportAssistantMessageToImage`),a(`.export-md-item`,`exportAssistantMessageToMarkdown`),e.appendChild(t),e.appendChild(n),e}function Px(){if(document.getElementById(ux))return;let e=document.getElementById(lx),t=e?e.parentNode:document.querySelector(`.message-fullscreen-actions`);t&&t.insertBefore(Nx(),e||null)}function Fx(){let e=document.getElementById(dx);e&&e.classList.remove(`show`)}var Ix=!1;function Lx(){Ix||(Ix=!0,document.addEventListener(`click`,e=>{let t=document.getElementById(dx);t&&t.classList.contains(`show`)&&!e.target.closest?.(`.message-fullscreen-export`)&&t.classList.remove(`show`);let n=e.target.closest?.(`.fullscreen-btn`);if(n){e.stopPropagation(),Tx(n.closest(`.message`));return}if(e.target.closest?.(`#messageFullscreenCloseBtn`)){e.stopPropagation(),wx();return}e.target.closest?.(`#messageFullscreenCopyBtn`)&&(e.stopPropagation(),jx(e))},!0),document.addEventListener(`keydown`,kx,!0),document.addEventListener(`dblclick`,Ax,!0))}var Rx=t({copyAssistantMessage:()=>Vx,copyMessage:()=>Bx,copyRichText:()=>Wx,fallbackCopyRichText:()=>Kx,fallbackCopyText:()=>Ux,quoteAndAsk:()=>Yx,setQuoteContextInjector:()=>Jx,showCopySuccess:()=>Hx,wrapHtmlWithStyles:()=>Gx});n(`zh`,{chatCopy:{copiedMarkdown:`已复制 Markdown`,copiedRich:`已复制富文本`,copyFailedManual:`复制失败,请手动复制`}}),n(`en`,{chatCopy:{copiedMarkdown:`Markdown copied`,copiedRich:`Rich text copied`,copyFailedManual:`Copy failed, please copy manually`}});function zx(e){let t=e.querySelectorAll(`.mermaid`),n=null;for(let e of t)try{if(!n&&e._pngDataUrl){let t=e._pngDataUrl.split(`,`)[1]||``,r=atob(t),i=r.length,a=new Uint8Array(i);for(let e=0;e<i;e++)a[e]=r.charCodeAt(e);n=new Blob([a],{type:`image/png`})}let t=e.getAttribute(`data-raw-code`),r=t?decodeURIComponent(t):e.dataset.rawMermaidCode||(e.textContent||``).trim();if(r){let t=r.split(`
|
|
1388
|
+
`}).join(``),t.querySelectorAll(`img.favicon-img`).forEach(e=>{e.addEventListener(`error`,()=>{e.style.display=`none`})}),t.querySelectorAll(`.prompt-item`).forEach(e=>{e.addEventListener(`click`,t=>{let n=t.target.closest(`.page-action-btn`);if(n){t.stopPropagation(),rx(parseInt(n.dataset.tabId),n.dataset.action);return}nx(parseInt(e.dataset.tabId))})})}function $b(e){e.forEach((e,t)=>{t===C.selectedPageIndex?(e.classList.add(`selected`),e.scrollIntoView({block:`nearest`})):e.classList.remove(`selected`)})}function ex(e){C.selectedPage={id:e.id,title:e.title||r(`pageSelector.noTitle`),url:e.url||``,favIconUrl:e.favIconUrl||``};let t=document.getElementById(`pageIndicator`),n=document.getElementById(`pageIndicatorName`);if(t&&n){let e=C.selectedPage.title&&C.selectedPage.title!==r(`pageSelector.noTitle`)?C.selectedPage.title:``,i=C.selectedPage.url||``;e&&i?n.textContent=`${e} · ${i}`:n.textContent=e||i,t.style.display=`flex`}}function tx(){C.selectedPage=null,C.selectedPageIndex=-1;let e=document.getElementById(`pageIndicator`);e&&(e.style.display=`none`)}function nx(e){let t=document.getElementById(`userInput`),n=t?t.value:``,r=n.lastIndexOf(`@`);r!==-1&&(t.value=n.substring(0,r)),t&&(t.focus(),t.selectionStart=t.selectionEnd=t.value.length),chrome.tabs.get(e,e=>{if(chrome.runtime.lastError||!e){i.error(`[PageSelector] getlabelpageinfo failed:`,chrome.runtime.lastError);return}ex(e),gb(),t&&(t.focus(),Ue())})}function rx(e,t){let n={interpret:r(`pageSelector.interpretMsg`),summarize:r(`pageSelector.summarizeMsg`),translate:r(`pageSelector.translateMsg`)}[t];n&&chrome.tabs.get(e,e=>{if(chrome.runtime.lastError||!e){i.error(`[PageSelector] get tab info failed:`,chrome.runtime.lastError);return}ex(e),gb();let t=document.getElementById(`userInput`);t&&(t.value=n,Ue()),vw()})}function ix(){let e=document.getElementById(`pageIndicatorClose`);e&&e.addEventListener(`click`,()=>{tx()})}n(`zh`,{msgFullscreen:{title:`全屏阅读`,btnTitle:`全屏查看本回答 (Alt+双击 / Alt+F)`,btnLabel:`全屏`,copy:`复制`,copyTitle:`复制回答内容(Ctrl/⌘+点击复制富文本)`,export:`导出`,exportTitle:`导出下载本回答`,exportWord:`导出 Word`,exportPdf:`导出 PDF`,exportImage:`导出图片`,exportMarkdown:`导出 Markdown`,close:`退出全屏`,closeTitle:`退出全屏 (Esc)`}}),n(`en`,{msgFullscreen:{title:`Fullscreen Reading`,btnTitle:`View this answer fullscreen (Alt+Double-click / Alt+F)`,btnLabel:`Fullscreen`,copy:`Copy`,copyTitle:`Copy answer (Ctrl/Cmd+click for rich text)`,export:`Export`,exportTitle:`Export / download this answer`,exportWord:`Export Word`,exportPdf:`Export PDF`,exportImage:`Export Image`,exportMarkdown:`Export Markdown`,close:`Exit fullscreen`,closeTitle:`Exit fullscreen (Esc)`}});var ax=`messageFullscreenOverlay`,ox=`messageFullscreenBody`,sx=`messageFullscreenTitle`,cx=`messageFullscreenCopyBtn`,lx=`messageFullscreenCloseBtn`,ux=`messageFullscreenExportBtn`,dx=`messageFullscreenExportDropdown`,fx=null,px=null,mx=null,hx=!1,gx=null,_x=!1;function vx(){return fx!==null}function yx(e){return!e||vx()?null:e.innerHTML}function bx(){let e=document.querySelectorAll(`#chatContainer .message.assistant`);return e.length?e[e.length-1]:null}function xx(){let e=document.createElement(`button`);return e.className=`fullscreen-btn`,e.title=r(`msgFullscreen.btnTitle`),e.innerHTML=[`<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" width="14" height="14">`,`<path d="M6 2H2v4M10 2h4v4M6 14H2v-4M10 14h4v-4"/>`,`</svg>`,`<span>${r(`msgFullscreen.btnLabel`)}</span>`].join(``),e}function Sx(){let e=document.getElementById(ax),t=document.getElementById(ox);return!e||!t?(i.warn(`[MsgFullscreen] overlay/body element missing`),null):{overlay:e,body:t,title:document.getElementById(sx),copyBtn:document.getElementById(cx),closeBtn:document.getElementById(lx)}}function Cx(e){if(!e)return;let t=Sx();if(t&&fx!==e){if(!fx){let e=document.getElementById(`chatContainer`);gx=e?e.scrollTop:null}fx&&(_x=!0,wx(),_x=!1),px=document.createComment(`msg-fullscreen-anchor`),e.parentNode.insertBefore(px,e),e.dataset.fullscreen=`1`,t.body.appendChild(e),fx=e,t.overlay.style.display=`flex`,document.body.classList.add(`message-fullscreen-viewing`),t.title&&(t.title.textContent=r(`msgFullscreen.title`)),t.copyBtn&&(t.copyBtn.title=r(`msgFullscreen.copyTitle`)),t.closeBtn&&(t.closeBtn.title=r(`msgFullscreen.closeTitle`)),Px(),Ex(t.body)}}function wx(){if(!fx)return;let e=Sx();if(Ox(),Fx(),px&&px.parentNode)px.parentNode.insertBefore(fx,px);else if(e){let e=document.getElementById(`chatContainer`);e&&e.appendChild(fx)}if(px&&px.parentNode&&px.parentNode.removeChild(px),delete fx.dataset.fullscreen,fx=null,px=null,e){e.overlay.style.display=`none`,e.body.innerHTML=``;let t=e.overlay.querySelector(`.message-fullscreen-rail`);t&&t.querySelectorAll(`.message-toc-container`).forEach(e=>e.remove())}if(document.body.classList.remove(`message-fullscreen-viewing`),!_x&&gx!==null){let e=document.getElementById(`chatContainer`);e&&(e.scrollTop=gx),gx=null}}function Tx(e){if(fx&&fx===e){wx();return}Cx(e||bx())}function Ex(e){Ox(),hx=!1,e.scrollTop=e.scrollHeight,e.addEventListener(`scroll`,Dx,{passive:!0}),typeof ResizeObserver<`u`&&(mx=new ResizeObserver(()=>{hx||(e.scrollTop=e.scrollHeight)}),mx.observe(e.firstElementChild||e))}function Dx(){let e=document.getElementById(ox);e&&(hx=e.scrollHeight-e.scrollTop-e.clientHeight>60)}function Ox(){let e=document.getElementById(ox);e&&e.removeEventListener(`scroll`,Dx),mx&&=(mx.disconnect(),null)}function kx(e){if(e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&e.code===`KeyF`){e.preventDefault(),fx?wx():Cx(bx());return}e.key===`Escape`&&fx&&(e.preventDefault(),e.stopImmediatePropagation(),wx())}function Ax(e){if(!e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;let t=e.target.closest?.(`#chatContainer .message.assistant`);t&&(e.preventDefault(),Tx(t))}async function jx(e){if(!fx)return;let{copyAssistantMessage:t}=await A(async()=>{let{copyAssistantMessage:e}=await Promise.resolve().then(()=>Rx);return{copyAssistantMessage:e}},void 0);t(fx,document.getElementById(cx),e)}var Mx={docx:`<path d="M4 1.5h6L13 4.5v10H4z"/><path d="M10 1.5v3h3"/><path d="M6 8h4M6 10.5h4"/>`,pdf:`<path d="M4 1.5h6L13 4.5v10H4z"/><path d="M10 1.5v3h3"/><path d="M6.5 11.5c2-1 2.5-4 1-4s-1 4 2 4"/>`,image:`<rect x="2.5" y="3" width="11" height="10" rx="1.2"/><circle cx="6" cy="6.5" r="1"/><path d="M13.5 10 10 6.5 4.5 12.5"/>`,markdown:`<path d="M2.5 12V4l3 3 3-3v8"/><path d="M12.5 4v6m0 0 2-2.2m-2 2.2L10.5 7.8"/>`};function Nx(){let e=document.createElement(`div`);e.className=`message-fullscreen-export`;let t=document.createElement(`button`);t.className=`message-fullscreen-icon-btn`,t.id=ux,t.type=`button`,t.title=r(`msgFullscreen.exportTitle`),t.innerHTML=[`<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" width="16" height="16">`,`<path d="M8 2v8m0 0 3-3M8 10 5 7M2.5 13.5h11"/>`,`</svg>`,`<span>${r(`msgFullscreen.export`)}</span>`,`<svg class="dropdown-arrow" width="8" height="6" viewBox="0 0 8 6" fill="currentColor"><path d="M0 0l4 6 4-6z"/></svg>`].join(``);let n=document.createElement(`div`);n.className=`message-fullscreen-export-dropdown`,n.id=dx;let i=e=>`<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round">${Mx[e]}</svg>`;n.innerHTML=[`<button class="export-dropdown-item export-docx-item" type="button">${i(`docx`)}<span>${r(`msgFullscreen.exportWord`)}</span></button>`,`<button class="export-dropdown-item export-pdf-item" type="button">${i(`pdf`)}<span>${r(`msgFullscreen.exportPdf`)}</span></button>`,`<button class="export-dropdown-item export-image-item" type="button">${i(`image`)}<span>${r(`msgFullscreen.exportImage`)}</span></button>`,`<button class="export-dropdown-item export-md-item" type="button">${i(`markdown`)}<span>${r(`msgFullscreen.exportMarkdown`)}</span></button>`].join(``),t.addEventListener(`click`,e=>{e.stopPropagation(),n.classList.toggle(`show`)});let a=(e,t)=>{let r=n.querySelector(e);r.addEventListener(`click`,async e=>{e.stopPropagation(),fx&&(n.classList.remove(`show`),(await A(()=>import(`./chat-export-DduslUlT.js`),__vite__mapDeps([9,10,1,11,2,3,0])))[t](fx,r,n))})};return a(`.export-docx-item`,`exportAssistantMessageToDocx`),a(`.export-pdf-item`,`exportAssistantMessageToPdf`),a(`.export-image-item`,`exportAssistantMessageToImage`),a(`.export-md-item`,`exportAssistantMessageToMarkdown`),e.appendChild(t),e.appendChild(n),e}function Px(){if(document.getElementById(ux))return;let e=document.getElementById(lx),t=e?e.parentNode:document.querySelector(`.message-fullscreen-actions`);t&&t.insertBefore(Nx(),e||null)}function Fx(){let e=document.getElementById(dx);e&&e.classList.remove(`show`)}var Ix=!1;function Lx(){Ix||(Ix=!0,document.addEventListener(`click`,e=>{let t=document.getElementById(dx);t&&t.classList.contains(`show`)&&!e.target.closest?.(`.message-fullscreen-export`)&&t.classList.remove(`show`);let n=e.target.closest?.(`.fullscreen-btn`);if(n){e.stopPropagation(),Tx(n.closest(`.message`));return}if(e.target.closest?.(`#messageFullscreenCloseBtn`)){e.stopPropagation(),wx();return}e.target.closest?.(`#messageFullscreenCopyBtn`)&&(e.stopPropagation(),jx(e))},!0),document.addEventListener(`keydown`,kx,!0),document.addEventListener(`dblclick`,Ax,!0))}var Rx=t({copyAssistantMessage:()=>Vx,copyMessage:()=>Bx,copyRichText:()=>Wx,fallbackCopyRichText:()=>Kx,fallbackCopyText:()=>Ux,quoteAndAsk:()=>Yx,setQuoteContextInjector:()=>Jx,showCopySuccess:()=>Hx,wrapHtmlWithStyles:()=>Gx});n(`zh`,{chatCopy:{copiedMarkdown:`已复制 Markdown`,copiedRich:`已复制富文本`,copyFailedManual:`复制失败,请手动复制`}}),n(`en`,{chatCopy:{copiedMarkdown:`Markdown copied`,copiedRich:`Rich text copied`,copyFailedManual:`Copy failed, please copy manually`}});function zx(e){let t=e.querySelectorAll(`.mermaid`),n=null;for(let e of t)try{if(!n&&e._pngDataUrl){let t=e._pngDataUrl.split(`,`)[1]||``,r=atob(t),i=r.length,a=new Uint8Array(i);for(let e=0;e<i;e++)a[e]=r.charCodeAt(e);n=new Blob([a],{type:`image/png`})}let t=e.getAttribute(`data-raw-code`),r=t?decodeURIComponent(t):e.dataset.rawMermaidCode||(e.textContent||``).trim();if(r){let t=r.split(`
|
|
1389
1389
|
`),n=document.createElement(`pre`);n.appendChild(document.createTextNode(t[0]||``));for(let e=1;e<t.length;e++)n.appendChild(document.createElement(`br`)),n.appendChild(document.createTextNode(t[e]));e.parentNode.replaceChild(n,e)}else e.remove()}catch(t){i.warn(`[SidePanel] Mermaid chartprocessing failed,remove:`,t.message),e.remove()}return{html:e.innerHTML,firstPngBlob:n}}function Bx(e,t){try{let n=e.dataset.textContent_||e.dataset.rawContent||``;navigator.clipboard.writeText(n).then(()=>{let e=t.innerHTML;t.innerHTML=`
|
|
1390
1390
|
<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor">
|
|
1391
1391
|
<path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 0 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0z"/>
|
|
@@ -1580,12 +1580,12 @@ It is this session's directory or the agent default, so it stays accessible (wor
|
|
|
1580
1580
|
${Uf(e)}
|
|
1581
1581
|
</div>
|
|
1582
1582
|
</div>
|
|
1583
|
-
`,document.body.appendChild(n),If(n),n.addEventListener(`click`,e=>{e.target===n&&n.remove()}),n.querySelector(`.log-close`).addEventListener(`click`,()=>{n.remove()});let p=n.querySelector(`.toggle-expand-btn`),m=n.querySelectorAll(`.timeline-content`),h=!1;p.addEventListener(`click`,()=>{h=!h,m.forEach(e=>{h?e.classList.add(`expanded`):e.classList.remove(`expanded`)});let e=p.querySelector(`svg`);h?(e.innerHTML=`<polyline points="17 11 12 6 7 11"></polyline><polyline points="17 18 12 13 7 18"></polyline>`,p.setAttribute(`title`,r(`chatPanels.collapseAll`))):(e.innerHTML=`<polyline points="7 13 12 18 17 13"></polyline><polyline points="7 6 12 11 17 6"></polyline>`,p.setAttribute(`title`,r(`chatPanels.expandAll`)))}),n.querySelectorAll(`.timeline-header`).forEach(e=>{e.addEventListener(`click`,()=>{e.parentElement.classList.toggle(`expanded`)})}),n.querySelectorAll(`.task-group-header`).forEach(e=>{e.addEventListener(`click`,()=>{e.parentElement.classList.toggle(`collapsed`)})});let g=n.querySelectorAll(`.combo-stat`),_=n.querySelectorAll(`.timeline-item`);g.forEach(e=>{e.addEventListener(`click`,()=>{let t=e.dataset.status,n=e.classList.contains(`active`);g.forEach(e=>e.classList.remove(`active`)),n?_.forEach(e=>{e.style.display=``}):(e.classList.add(`active`),_.forEach(e=>{if(t===`subtask`)e.classList.contains(`subtask-level`)?e.style.display=``:e.style.display=`none`;else{let n=e.querySelector(`.timeline-dot`);n&&n.classList.contains(t)?e.style.display=``:e.style.display=`none`}}))})})}n(`zh`,{chatResume:{title:`继续执行任务`,desc:`任务执行被中断,你可以提供补充说明帮助模型继续。`,budgetTitle:`执行预算已用完(部分完成)`,budgetDesc:`任务已到时间/轮数预算上限,以上回复是已完成部分与缺项清单。点击继续将在新的预算下接着未完成部分执行,可先补充说明调整目标。`,placeholder:`输入补充说明(可选)…`,continueBtn:`继续`,interruptedAgo:`({duration}前)`,taskInterrupted:`任务执行被中断{elapsed}`,checkpointNotFound:`检查点已失效,无法继续执行。请重新发送任务。`,taskCancelled:`任务已被用户停止`,swRestarted:`Service Worker 已重启,请重新发送任务`,resumeFailed:`恢复失败:{message}`,unknownError:`未知错误`}}),n(`en`,{chatResume:{title:`Continue Task`,desc:`The task was interrupted. You can provide additional guidance to help the model continue.`,budgetTitle:`Execution budget exhausted (partially complete)`,budgetDesc:`The task hit its time/round budget. The reply above lists what is completed and what remains. Press Continue to resume the unfinished parts with a fresh budget; you may add guidance first.`,placeholder:`Enter additional guidance (optional)…`,continueBtn:`Continue`,interruptedAgo:` ({duration} ago)`,taskInterrupted:`Task execution was interrupted{elapsed}`,checkpointNotFound:`The checkpoint has expired and the task cannot be resumed. Please resend the task.`,taskCancelled:`Task was stopped by user`,swRestarted:`Service Worker restarted. Please resend the task.`,resumeFailed:`Resume failed: {message}`,unknownError:`Unknown error`}});function Qx(e={}){return new Promise(t=>{let n=document.createElement(`div`);n.className=`modal-overlay resume-dialog-overlay`,n.style.cssText=`display:flex;position:fixed;inset:0;background:var(--scrim);z-index:10000;align-items:center;justify-content:center;`;let i=document.createElement(`div`);i.className=`modal-container resume-dialog-container`,i.style.cssText=`background:var(--bg-surface);border-radius:8px;padding:24px;width:90%;max-width:480px;box-shadow:0 8px 32px var(--shadow-md);`;let a=document.createElement(`h3`);a.textContent=r(e.budgetEnded?`chatResume.budgetTitle`:`chatResume.title`),a.style.cssText=`margin:0 0 8px 0;font-size:16px;color:var(--text-primary);`;let o=document.createElement(`p`);o.textContent=r(e.budgetEnded?`chatResume.budgetDesc`:`chatResume.desc`),o.style.cssText=`margin:0 0 16px 0;font-size:13px;color:var(--text-secondary);line-height:1.5;`;let s=document.createElement(`textarea`);s.className=`resume-dialog-textarea`,s.placeholder=r(`chatResume.placeholder`),s.style.cssText=`width:100%;min-height:80px;padding:8px 12px;border:1px solid var(--border-default);border-radius:4px;font-size:13px;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.5;`,s.rows=3;let c=document.createElement(`div`);c.style.cssText=`display:flex;justify-content:flex-end;gap:8px;margin-top:16px;`;let l=document.createElement(`button`);l.textContent=r(`common.cancel`),l.style.cssText=`padding:6px 16px;border:1px solid var(--border-default);background:var(--bg-surface);color:var(--text-secondary);border-radius:4px;cursor:pointer;font-size:13px;`;let u=document.createElement(`button`);u.textContent=r(`chatResume.continueBtn`),u.style.cssText=`padding:6px 16px;border:none;background:var(--info-500);color:var(--text-inverse);border-radius:4px;cursor:pointer;font-size:13px;font-weight:500;`,c.appendChild(l),c.appendChild(u),i.appendChild(a),i.appendChild(o),i.appendChild(s),i.appendChild(c),n.appendChild(i),document.body.appendChild(n),requestAnimationFrame(()=>s.focus());let d=()=>{n.remove(),document.removeEventListener(`keydown`,f)},f=e=>{e.key===`Escape`?(d(),t(null)):e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(d(),t(s.value.trim()))};l.addEventListener(`click`,()=>{d(),t(null)}),u.addEventListener(`click`,()=>{d(),t(s.value.trim())}),document.addEventListener(`keydown`,f)})}function $x(e){if(!e||e!==C.activeSessionId)return;let t=!1;for(let e of C.messageHistory)e.resumable&&(e.resumable=!1,t=!0);let n=document.getElementById(`chatContainer`);n&&n.querySelectorAll(`.message[data-resumable]:not([data-resumable="false"])`).forEach(e=>{e.removeAttribute(`data-resumable`);let t=e.querySelector(`.resume-task-btn`);t&&t.remove()}),t&&
|
|
1583
|
+
`,document.body.appendChild(n),If(n),n.addEventListener(`click`,e=>{e.target===n&&n.remove()}),n.querySelector(`.log-close`).addEventListener(`click`,()=>{n.remove()});let p=n.querySelector(`.toggle-expand-btn`),m=n.querySelectorAll(`.timeline-content`),h=!1;p.addEventListener(`click`,()=>{h=!h,m.forEach(e=>{h?e.classList.add(`expanded`):e.classList.remove(`expanded`)});let e=p.querySelector(`svg`);h?(e.innerHTML=`<polyline points="17 11 12 6 7 11"></polyline><polyline points="17 18 12 13 7 18"></polyline>`,p.setAttribute(`title`,r(`chatPanels.collapseAll`))):(e.innerHTML=`<polyline points="7 13 12 18 17 13"></polyline><polyline points="7 6 12 11 17 6"></polyline>`,p.setAttribute(`title`,r(`chatPanels.expandAll`)))}),n.querySelectorAll(`.timeline-header`).forEach(e=>{e.addEventListener(`click`,()=>{e.parentElement.classList.toggle(`expanded`)})}),n.querySelectorAll(`.task-group-header`).forEach(e=>{e.addEventListener(`click`,()=>{e.parentElement.classList.toggle(`collapsed`)})});let g=n.querySelectorAll(`.combo-stat`),_=n.querySelectorAll(`.timeline-item`);g.forEach(e=>{e.addEventListener(`click`,()=>{let t=e.dataset.status,n=e.classList.contains(`active`);g.forEach(e=>e.classList.remove(`active`)),n?_.forEach(e=>{e.style.display=``}):(e.classList.add(`active`),_.forEach(e=>{if(t===`subtask`)e.classList.contains(`subtask-level`)?e.style.display=``:e.style.display=`none`;else{let n=e.querySelector(`.timeline-dot`);n&&n.classList.contains(t)?e.style.display=``:e.style.display=`none`}}))})})}n(`zh`,{chatResume:{title:`继续执行任务`,desc:`任务执行被中断,你可以提供补充说明帮助模型继续。`,budgetTitle:`执行预算已用完(部分完成)`,budgetDesc:`任务已到时间/轮数预算上限,以上回复是已完成部分与缺项清单。点击继续将在新的预算下接着未完成部分执行,可先补充说明调整目标。`,placeholder:`输入补充说明(可选)…`,continueBtn:`继续`,interruptedAgo:`({duration}前)`,taskInterrupted:`任务执行被中断{elapsed}`,checkpointNotFound:`检查点已失效,无法继续执行。请重新发送任务。`,taskCancelled:`任务已被用户停止`,swRestarted:`Service Worker 已重启,请重新发送任务`,resumeFailed:`恢复失败:{message}`,unknownError:`未知错误`}}),n(`en`,{chatResume:{title:`Continue Task`,desc:`The task was interrupted. You can provide additional guidance to help the model continue.`,budgetTitle:`Execution budget exhausted (partially complete)`,budgetDesc:`The task hit its time/round budget. The reply above lists what is completed and what remains. Press Continue to resume the unfinished parts with a fresh budget; you may add guidance first.`,placeholder:`Enter additional guidance (optional)…`,continueBtn:`Continue`,interruptedAgo:` ({duration} ago)`,taskInterrupted:`Task execution was interrupted{elapsed}`,checkpointNotFound:`The checkpoint has expired and the task cannot be resumed. Please resend the task.`,taskCancelled:`Task was stopped by user`,swRestarted:`Service Worker restarted. Please resend the task.`,resumeFailed:`Resume failed: {message}`,unknownError:`Unknown error`}});function Qx(e={}){return new Promise(t=>{let n=document.createElement(`div`);n.className=`modal-overlay resume-dialog-overlay`,n.style.cssText=`display:flex;position:fixed;inset:0;background:var(--scrim);z-index:10000;align-items:center;justify-content:center;`;let i=document.createElement(`div`);i.className=`modal-container resume-dialog-container`,i.style.cssText=`background:var(--bg-surface);border-radius:8px;padding:24px;width:90%;max-width:480px;box-shadow:0 8px 32px var(--shadow-md);`;let a=document.createElement(`h3`);a.textContent=r(e.budgetEnded?`chatResume.budgetTitle`:`chatResume.title`),a.style.cssText=`margin:0 0 8px 0;font-size:16px;color:var(--text-primary);`;let o=document.createElement(`p`);o.textContent=r(e.budgetEnded?`chatResume.budgetDesc`:`chatResume.desc`),o.style.cssText=`margin:0 0 16px 0;font-size:13px;color:var(--text-secondary);line-height:1.5;`;let s=document.createElement(`textarea`);s.className=`resume-dialog-textarea`,s.placeholder=r(`chatResume.placeholder`),s.style.cssText=`width:100%;min-height:80px;padding:8px 12px;border:1px solid var(--border-default);border-radius:4px;font-size:13px;resize:vertical;box-sizing:border-box;font-family:inherit;line-height:1.5;`,s.rows=3;let c=document.createElement(`div`);c.style.cssText=`display:flex;justify-content:flex-end;gap:8px;margin-top:16px;`;let l=document.createElement(`button`);l.textContent=r(`common.cancel`),l.style.cssText=`padding:6px 16px;border:1px solid var(--border-default);background:var(--bg-surface);color:var(--text-secondary);border-radius:4px;cursor:pointer;font-size:13px;`;let u=document.createElement(`button`);u.textContent=r(`chatResume.continueBtn`),u.style.cssText=`padding:6px 16px;border:none;background:var(--info-500);color:var(--text-inverse);border-radius:4px;cursor:pointer;font-size:13px;font-weight:500;`,c.appendChild(l),c.appendChild(u),i.appendChild(a),i.appendChild(o),i.appendChild(s),i.appendChild(c),n.appendChild(i),document.body.appendChild(n),requestAnimationFrame(()=>s.focus());let d=()=>{n.remove(),document.removeEventListener(`keydown`,f)},f=e=>{e.key===`Escape`?(d(),t(null)):e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(d(),t(s.value.trim()))};l.addEventListener(`click`,()=>{d(),t(null)}),u.addEventListener(`click`,()=>{d(),t(s.value.trim())}),document.addEventListener(`keydown`,f)})}function $x(e){if(!e||e!==C.activeSessionId)return;let t=!1;for(let e of C.messageHistory)e.resumable&&(e.resumable=!1,t=!0);let n=document.getElementById(`chatContainer`);n&&n.querySelectorAll(`.message[data-resumable]:not([data-resumable="false"])`).forEach(e=>{e.removeAttribute(`data-resumable`);let t=e.querySelector(`.resume-task-btn`);t&&t.remove()}),t&&YC()}async function eS(e,t){if(!(!e||!t))try{if(!(await chrome.runtime.sendMessage({type:`GET_CHECKPOINT`,sessionId:t}))?.exists){e.removeAttribute(`data-resumable`);let t=e.querySelector(`.resume-task-btn`);t&&t.remove();let n=e.dataset.messageId,r=C.messageHistory.find(e=>e.messageId===n);r&&r.resumable&&(r.resumable=!1,YC())}}catch{}}function tS(e,t){if(!e||!t)return null;let n=e.querySelector(`:scope > .message-footer`);if(!n)return null;let i=n.querySelector(`.resume-task-btn`);if(i)return i;let a=t===`budget`,o=document.createElement(`button`);return o.className=`resume-task-btn`,o.type=`button`,o.title=r(a?`chatMsg.resumeTaskTitleBudget`:`chatMsg.resumeTaskTitle`),o.innerHTML=`
|
|
1584
1584
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1585
1585
|
<polygon points="5 3 19 12 5 21 5 3"></polygon>
|
|
1586
1586
|
</svg>
|
|
1587
1587
|
<span>${r(`chatMsg.resumeTaskBtn`)}</span>
|
|
1588
|
-
`,o.addEventListener(`click`,async e=>{if(e.stopPropagation(),o.disabled)return;let t=await Qx({budgetEnded:a});t!==null&&(o.disabled=!0,o.style.opacity=`0.6`,o.style.cursor=`not-allowed`,rS(C.activeSessionId,t).finally(()=>{o.disabled=!1,o.style.opacity=``,o.style.cursor=``}))}),n.appendChild(o),e.dataset.resumable=String(t),eS(e,C.activeSessionId),o}async function nS(){let e=C.activeSessionId;if(!e||C.pendingCallApiSessionIds&&C.pendingCallApiSessionIds.has(e))return;let t=C.messageHistory.some(e=>e.resumable),n=document.getElementById(`chatContainer`),a=n&&n.querySelector(`.resume-task-btn`);if(!(t&&a))try{let a=await chrome.runtime.sendMessage({type:`GET_CHECKPOINT`,sessionId:e});if(a?.running)return;if(a?.exists){i.debug(`[SidePanel] found abandoned checkpoint,auto addrestorehint card`),document.dispatchEvent(new CustomEvent(`session-cache-invalidate`,{detail:{sessionId:e}}));let o=a.checkpoint,s=o.updatedAt?Ve(Date.now()-o.updatedAt):``,c=r(`chatResume.taskInterrupted`,{elapsed:s?r(`chatResume.interruptedAgo`,{duration:s}):``});if(t){let e=C.messageHistory.find(e=>e.resumable);if(e&&(e.content=c,
|
|
1588
|
+
`,o.addEventListener(`click`,async e=>{if(e.stopPropagation(),o.disabled)return;let t=await Qx({budgetEnded:a});t!==null&&(o.disabled=!0,o.style.opacity=`0.6`,o.style.cursor=`not-allowed`,rS(C.activeSessionId,t).finally(()=>{o.disabled=!1,o.style.opacity=``,o.style.cursor=``}))}),n.appendChild(o),e.dataset.resumable=String(t),eS(e,C.activeSessionId),o}async function nS(){let e=C.activeSessionId;if(!e||C.pendingCallApiSessionIds&&C.pendingCallApiSessionIds.has(e))return;let t=C.messageHistory.some(e=>e.resumable),n=document.getElementById(`chatContainer`),a=n&&n.querySelector(`.resume-task-btn`);if(!(t&&a))try{let a=await chrome.runtime.sendMessage({type:`GET_CHECKPOINT`,sessionId:e});if(a?.running)return;if(a?.exists){i.debug(`[SidePanel] found abandoned checkpoint,auto addrestorehint card`),document.dispatchEvent(new CustomEvent(`session-cache-invalidate`,{detail:{sessionId:e}}));let o=a.checkpoint,s=o.updatedAt?Ve(Date.now()-o.updatedAt):``,c=r(`chatResume.taskInterrupted`,{elapsed:s?r(`chatResume.interruptedAgo`,{duration:s}):``});if(t){let e=C.messageHistory.find(e=>e.resumable);if(e&&(e.content=c,YC()),n){let e=n.querySelector(`.message[data-resumable]:not([data-resumable="false"])`);if(!e){let t=n.querySelectorAll(`.message.assistant`);for(let n of t)if((n.textContent||``).includes(`任务执行被中断`)){e=n;break}}e&&e.remove()}}let{element:l,messageId:u}=Ew(`assistant`,c,!0,[],null,!1,null,null,[],!0);t||(C.messageHistory.push({role:`assistant`,content:c,executionLog:[],messageId:u,resumable:!0,interrupted:!0}),YC()),eS(l,e)}}catch(e){i.warn(`[SidePanel] check abandoned checkpoint failed:`,e.message)}}async function rS(e,t=``){if(!e)return i.warn(`[SidePanel] resumeTask: missing sessionId`),!1;if(C.activeSessionId!==e)return i.warn(`[SidePanel] resumeTask: currently activesessionwith targetsession not consistent,please switch firstto targetsession`),!1;if(C.pendingCallApiSessionIds&&C.pendingCallApiSessionIds.has(e))return i.warn(`[SidePanel] resumeTask: currentsession has ongoingtask`),!1;i.debug(`[SidePanel] resumeTask: startrestoretask, sessionId:`,e,`userGuidance:`,t?`"${t.substring(0,50)}..."`:`( no )`);try{let t=await chrome.runtime.sendMessage({type:`GET_CHECKPOINT`,sessionId:e});if(!t?.exists){i.warn(`[SidePanel] resumeTask: checkpoint not found, no way to restore, sessionId:`,e);let t=r(`chatResume.checkpointNotFound`),{messageId:n}=Ew(`assistant`,t,!0,[]);return C.messageHistory.push({role:`assistant`,content:t,executionLog:[],messageId:n,resumable:!1,resumed:!0}),YC(),$x(e),!1}i.debug(`[SidePanel] resumeTask: checkpoint verified, iteration:`,t.checkpoint?.iteration)}catch(e){i.warn(`[SidePanel] resumeTask: verify checkpoint hourcommunication failed,continue tryrestore:`,e.message)}let n=e,a=Mw();C.isGenerating=!0;let o=``,s=[],c=null,l=!1,u=!1,d=!1,f=null,p=null;try{let e=await Vw(null,null,!1,{},{resumeFromCheckpoint:!0,userGuidance:t,loadingId:a});o=e.content,s=e.executionLog||[],c=e.reflectionScore,l=e.wasRevised||!1,u=e.wasStreamed||!1,f=e.streamingHtml||null,e.streamingConnected!==void 0&&e.streamingConnected,p=e.streamingMsgId||null,d=e.budgetEnded===!0}catch(e){if(C.activeSessionId!==n){let t=e.message===r(`chatMsg.errTaskStopped`),i=!!e.checkpoint||e.swRestarted||t;return t?_i(n,{role:`assistant`,content:r(`chatResume.taskCancelled`),executionLog:e.executionLog||[],resumable:i,resumed:!0}):e.swRestarted?_i(n,{role:`assistant`,content:r(`chatResume.swRestarted`),executionLog:e.executionLog||[],resumable:i,resumed:!0}):_i(n,{role:`assistant`,content:r(`chatResume.resumeFailed`,{message:e.message||r(`chatResume.unknownError`)}),executionLog:e.executionLog||[],resumable:!1,resumed:!0}),document.dispatchEvent(new CustomEvent(`session-cache-invalidate`,{detail:{sessionId:n}})),Nw(a),!1}if(e.message===r(`chatMsg.errTaskStopped`)){Nw(a);let{messageId:t}=Ew(`assistant`,r(`chatResume.taskCancelled`),!1,e.executionLog||[]);return C.messageHistory.push({role:`assistant`,content:r(`chatResume.taskCancelled`),executionLog:e.executionLog||[],messageId:t,resumable:!0,resumed:!0}),YC(),!1}if(e.swRestarted){Nw(a);let t=!!e.checkpoint,{messageId:n}=Ew(`assistant`,r(`chatResume.swRestarted`),!1,e.executionLog||[]);return C.messageHistory.push({role:`assistant`,content:r(`chatResume.swRestarted`),executionLog:e.executionLog||[],messageId:n,resumable:t,resumed:!0}),YC(),!1}Nw(a);let t=r(`chatResume.resumeFailed`,{message:e.message||r(`chatResume.unknownError`)}),{element:i,messageId:o}=Ew(`assistant`,t,!0,e.executionLog||[]);return C.messageHistory.push({role:`assistant`,content:t,executionLog:e.executionLog||[],messageId:o,resumable:!1,resumed:!0}),YC(),!1}finally{jl(n)}$x(n);let m=d?`budget`:!1;if(C.activeSessionId!==n){let e={role:`assistant`,content:o,executionLog:s,reflectionScore:c,wasRevised:l,resumable:m,resumed:!0};return u&&f&&(e.htmlContent=f),_i(n,e),document.dispatchEvent(new CustomEvent(`session-cache-invalidate`,{detail:{sessionId:n}})),Nw(a),!0}if(u&&f){let e=p;return C.messageHistory.push({role:`assistant`,content:o,executionLog:s,reflectionScore:c,wasRevised:l,resumable:m,messageId:e,resumed:!0,htmlContent:f}),YC(),m&&tS(e?document.querySelector(`[data-message-id="${e}"]`):null,m),!0}Nw(a);let{element:h,messageId:g}=Ew(`assistant`,o,!0,s,c,l,null,null,[],m);return C.messageHistory.push({role:`assistant`,content:o,executionLog:s,reflectionScore:c,wasRevised:l,resumable:m,messageId:g,resumed:!0}),YC(),h&<(h),!0}var iS=300*1024,aS=typeof TextEncoder<`u`?new TextEncoder:null;function oS(e){return e?aS?aS.encode(e).length:e.length*3:0}var sS=`streamSnap|`,cS=e=>`${sS}${e}`,lS=new Map,uS=null;function dS(){return typeof chrome<`u`&&chrome.storage&&chrome.storage.session&&typeof chrome.storage.session.set==`function`}function fS(){if(uS||typeof window>`u`||!window.addEventListener||typeof document>`u`||!document.addEventListener)return;let e=()=>{gS()},t=()=>{document.visibilityState===`hidden`&&e()};uS={pagehide:e,onVisibility:t},window.addEventListener(`pagehide`,e),document.addEventListener(`visibilitychange`,t)}function pS(e,t,n){if(!e||!t||typeof n!=`function`||!dS())return;fS();let r=lS.get(e)||{};r.callId!==t&&(r.oversizeWarned=!1),r.callId=t,r.read=n,r.timer||=setTimeout(()=>{let t=lS.get(e);t&&(t.timer=null,mS(e).catch(()=>{}))},700),lS.set(e,r)}async function mS(e){let t=lS.get(e);if(!t||(t.timer&&=(clearTimeout(t.timer),null),!dS()))return;let n;try{n=t.read()||{}}catch(e){i.debug(`[StreamSnapshot] 读取气泡内容失败(忽略):`,e?.message||e);return}let r=typeof n.html==`string`?n.html:``,a=typeof n.accumulated==`string`?n.accumulated:``,o=r,s=oS(r);s>307200&&(t.oversizeWarned||(t.oversizeWarned=!0,i.warn(`[StreamSnapshot] 快照 HTML ${s} 字节超过上限 ${iS},本次只存正文(接管后看不到工具卡片等富结构)`)),o=``),await chrome.storage.session.set({[cS(e)]:{sessionId:e,callId:t.callId,html:o,accumulated:a,ts:Date.now()}})}function hS(e){let t=lS.get(e);t&&(t.timer&&clearTimeout(t.timer),lS.delete(e))}function gS(){return Promise.all([...lS.keys()].map(e=>mS(e).catch(e=>{i.debug(`[StreamSnapshot] 卸载前刷盘失败(忽略):`,e?.message||e)})))}async function _S(e){if(!e||!dS())return null;try{let t=await chrome.storage.session.get(cS(e)),n=t&&t[cS(e)];return!n||!n.callId?null:Date.now()-(n.ts||0)>18e5?(await vS(e),null):n}catch(e){return i.debug(`[StreamSnapshot] 读取快照失败(忽略):`,e?.message||e),null}}async function vS(e){let t=lS.get(e);if(t&&t.timer&&clearTimeout(t.timer),lS.delete(e),dS())try{await chrome.storage.session.remove(cS(e))}catch(e){i.debug(`[StreamSnapshot] 清除快照失败(忽略):`,e?.message||e)}}var yS=t({addStreamingMessage:()=>nC,appendThinkingIndicator:()=>oC,appendToolCallItems:()=>bC,appendToolResult:()=>jC,applyStreamSnapshot:()=>iC,attachAgentStreamChunk:()=>kC,autoScrollToBottom:()=>DS,bindProcessHeaderClick:()=>NS,cancelStreamingTask:()=>PC,createAgentStreamOutput:()=>SC,createCodeBlockHtml:()=>xC,createPreSelectCard:()=>MC,createStreamingElementAccessor:()=>HS,deleteStreamingState:()=>US,finalizeCancelledStream:()=>FC,finalizeStreamingMessage:()=>NC,flushPendingAgentStreams:()=>AC,getPendingPreselectLog:()=>KS,getProcessStartTime:()=>XS,getReasoningContent:()=>QS,getStreamedContent:()=>WS,getThinkingStartTime:()=>JS,initScrollToBottomBtn:()=>AS,markStreamingRetrying:()=>aC,mountStreamingElement:()=>cC,notifyNonStreamContentArrived:()=>jS,reconnectStreamingElement:()=>lC,refreshAgentNames:()=>PS,registerAgentStreamStore:()=>wC,renderStreamingContentFull:()=>vC,resetScrollState:()=>kS,resolveToolCallCard:()=>EC,scrollStreamingToBottom:()=>OS,setPendingPreselectLog:()=>qS,setProcessStartTime:()=>ZS,setReasoningContent:()=>$S,setStreamedContent:()=>GS,setThinkingStartTime:()=>YS,updateScrollButtonState:()=>TS,updateStreamingMessage:()=>yC});n(`zh`,{chatStream:{thinking:`思考中...`,outputting:`输出中...`,retrying:`连接异常,正在重试 ({attempt}/{max})...`,stopGenerating:`停止生成`,thinkingResult:`思考结果`,toolActionOperate:`操作`,toolActionUpload:`上传`,toolActionDownload:`下载`,toolActionRequest:`请求`,toolActionInteract:`交互`,toolActionFill:`填写`,toolActionDispatch:`分派`,toolActionPreview:`预览`,toolActionRead:`读取`,toolActionWrite:`写入`,terminateCommand:`终止命令`,abortWaiting:`终止等待(跳过当前工具执行等待,不终止实际进程)`,executing:`执行中...`,terminating:`正在终止...`,copyCode:`复制代码`,truncatedTitle:`原始结果过大,已截断显示`,truncatedNote:`(输出过长已截断)`,noOutput:`(无输出)`,execFailed:`执行失败`,clickToExpand:`
|
|
1589
1589
|
... (点击展开查看完整输出)`,execResult:`执行结果`,statusFailed:`失败`,statusCompleted:`完成`,preselectFiltered:`从 {total} 个工具中筛选出 <strong>{count}</strong> 个:`,preselectSkippedAll:`跳过筛选({reason}),使用全部工具`,preselectSkippedCount:`跳过筛选({reason}),工具总数 {count}`,preselectDirectAnswer:`模型直接回答:`,toolPreselect:`工具预筛选`,toolsAfterFilter:`筛选后工具数:<strong>{count}</strong>`,listSeparator:`、`,totalNodes:`总节点`,successLabel:`成功`,failedLabel:`失败`,tokenLabel:`Token`,tokenUsageTitle:`Token 消耗: {total} (Prompt: {prompt}, Completion: {completion})`,thinkingProcess:`思考过程`,copyMarkdown:`复制 Markdown 内容 (Ctrl/Cmd + 点击复制富文本)`,copy:`复制`,quoteTitle:`引用该内容问答`,quote:`引用`,export:`导出`,exportWord:`导出 Word`,exportPdf:`导出 PDF`,exportImage:`导出图片`,exportMarkdown:`导出 Markdown`,executionLog:`执行日志`,reflectionRoundsTag:` ({count}轮)`,qualityAssessmentTitle:`AI 质量评估: {score}/10{rounds}
|
|
1590
1590
|
点击查看评估详情`,reflectionFailedTitle:`反思评估失败(点击查看执行日志)`,reflectionFailedBadge:`⚠️ 反思失败`,prototypeOpenedLocal:`已在本地浏览器打开,点击可在面板内查看`,viewUiPrototype:`查看 UI 原型`,bookmarkMessage:`收藏消息`,removeBookmark:`取消收藏`,forkSession:`从此处分叉会话(仅复制到此条消息)`,deleteMessage:`删除消息`,stopping:`停止中...`,taskStopped:`任务已被用户停止`,cancelled:`已取消`}}),n(`en`,{chatStream:{thinking:`Thinking...`,outputting:`Outputting...`,retrying:`Connection unstable, retrying ({attempt}/{max})...`,stopGenerating:`Stop generating`,thinkingResult:`Thinking result`,toolActionOperate:`Operate`,toolActionUpload:`Upload`,toolActionDownload:`Download`,toolActionRequest:`Request`,toolActionInteract:`Interact`,toolActionFill:`Fill`,toolActionDispatch:`Dispatch`,toolActionPreview:`Preview`,toolActionRead:`Read`,toolActionWrite:`Write`,terminateCommand:`Terminate command`,abortWaiting:`Abort waiting (skip current tool wait, does not terminate the actual process)`,executing:`Executing...`,terminating:`Terminating...`,copyCode:`Copy code`,truncatedTitle:`Original result too large, truncated for display`,truncatedNote:`(output too long, truncated)`,noOutput:`(no output)`,execFailed:`Execution failed`,clickToExpand:`
|
|
1591
1591
|
... (click to expand and view full output)`,execResult:`Execution result`,statusFailed:`Failed`,statusCompleted:`Completed`,preselectFiltered:`Filtered <strong>{count}</strong> of {total} tools: `,preselectSkippedAll:`Skipped filtering ({reason}), using all tools`,preselectSkippedCount:`Skipped filtering ({reason}), total tools: {count}`,preselectDirectAnswer:`Model direct answer: `,toolPreselect:`Tool Pre-filter`,toolsAfterFilter:`Tools after filtering: <strong>{count}</strong>`,listSeparator:`, `,totalNodes:`Total nodes`,successLabel:`Success`,failedLabel:`Failed`,tokenLabel:`Token`,tokenUsageTitle:`Token usage: {total} (Prompt: {prompt}, Completion: {completion})`,thinkingProcess:`Thinking process`,copyMarkdown:`Copy Markdown content (Ctrl/Cmd + click to copy rich text)`,copy:`Copy`,quoteTitle:`Quote this content for Q&A`,quote:`Quote`,export:`Export`,exportWord:`Export Word`,exportPdf:`Export PDF`,exportImage:`Export Image`,exportMarkdown:`Export Markdown`,executionLog:`Execution log`,reflectionRoundsTag:` ({count} rounds)`,qualityAssessmentTitle:`AI quality assessment: {score}/10{rounds}
|
|
@@ -1604,7 +1604,7 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
1604
1604
|
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
1605
1605
|
</svg>
|
|
1606
1606
|
</button>
|
|
1607
|
-
`}function tC(e){e&&e.querySelectorAll(`.streaming-stop-btn`).forEach(e=>{e.addEventListener(`click`,t=>{t.stopPropagation(),
|
|
1607
|
+
`}function tC(e){e&&e.querySelectorAll(`.streaming-stop-btn`).forEach(e=>{e.addEventListener(`click`,t=>{t.stopPropagation(),PC(e)})})}function nC(e){let t=document.getElementById(`chatContainer`),n=document.createElement(`div`);n.className=`message-wrapper assistant streaming`;let r=`msg_`+Date.now().toString(36)+`_`+Math.random().toString(36).substring(2,8);return n.dataset.messageId=r,n.dataset.sessionId=e||``,n.innerHTML=`
|
|
1608
1608
|
<div class="message-content">
|
|
1609
1609
|
<div class="stream-content"></div>
|
|
1610
1610
|
<div class="thinking-indicator">${eC()}</div>
|
|
@@ -1642,7 +1642,7 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
1642
1642
|
<div class="tool-call-body">
|
|
1643
1643
|
${xC(P(s))}
|
|
1644
1644
|
</div>
|
|
1645
|
-
`,l){let e=d.querySelector(`.tool-call-summary`);e&&(e.title=l)}if(it(),f){let e=d.querySelector(`.tool-call-terminate-btn`);e&&e.addEventListener(`click`,e=>{e.stopPropagation(),
|
|
1645
|
+
`,l){let e=d.querySelector(`.tool-call-summary`);e&&(e.title=l)}if(it(),f){let e=d.querySelector(`.tool-call-terminate-btn`);e&&e.addEventListener(`click`,e=>{e.stopPropagation(),Lw(C.activeSessionId)})}let h=d.querySelector(`.tool-call-abort-btn`);h&&h.addEventListener(`click`,e=>{e.stopPropagation(),chrome.runtime.sendMessage({type:`ABORT_CURRENT_TOOL`,sessionId:C.activeSessionId}),h.disabled=!0,h.title=r(`chatStream.terminating`)}),d.querySelector(`.tool-call-header`).addEventListener(`click`,e=>{e.ctrlKey||e.metaKey||d.classList.toggle(`expanded`)}),n.appendChild(d)}),AC(null,e),rC(e),e.isConnected&&requestAnimationFrame(()=>{let e=document.getElementById(`chatContainer`);e&&DS(e)})}function xC(e,t=``){let n=t?` class="${t}"`:``;return`<div class="code-block-container" style="position: relative;">
|
|
1646
1646
|
<button class="code-copy-btn" title="${r(`chatStream.copyCode`)}">
|
|
1647
1647
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
1648
1648
|
<path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25zM5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25z"/>
|
|
@@ -1652,18 +1652,19 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
1652
1652
|
</div>`}function SC(e,t){let n=document.createElement(`div`);n.className=`agent-stream-output`,n.innerHTML=`
|
|
1653
1653
|
<div class="tool-result-title">${r(`chatMsg.toolResultTitle`)}</div>
|
|
1654
1654
|
${xC(``,`agent-stream-content`)}
|
|
1655
|
-
`;let i=(e?e.querySelector(`.tool-call-body`)||e:null)||t;return i&&i.appendChild(n),n}function
|
|
1655
|
+
`;let i=(e?e.querySelector(`.tool-call-body`)||e:null)||t;return i&&i.appendChild(n),n}var CC=new WeakMap;function wC(e,t){e&&t&&CC.set(e,t)}function TC(e){return typeof CSS<`u`&&typeof CSS.escape==`function`?CSS.escape(String(e)):String(e).replace(/["\\]/g,`\\$&`)}function EC(e,t){if(!t)return null;let n=`.tool-call-item[data-tool-call-id="${TC(t)}"]`,r=e&&typeof e.querySelector==`function`?e.querySelector(n):null;if(r)return r;if(typeof document>`u`)return null;let i=document.querySelectorAll(n);return i.length?i[i.length-1]:null}function DC(e){let t=e.querySelector(`.agent-stream-output`),n=t?t.querySelector(`code`):null;if(t&&n)return{element:t,codeEl:n};let r=SC(e,null);return{element:r,codeEl:r.querySelector(`code`)}}function OC(e,t,n){let r=e.codeEl;if(!r||!n)return;let i=document.createTextNode(n);if(t===`stderr`){if(!e.stderrSeparator){let t=document.createTextNode(`
|
|
1656
|
+
`);r.appendChild(t),e.stderrSeparator=t}r.appendChild(i)}else e.stderrSeparator?r.insertBefore(i,e.stderrSeparator):r.appendChild(i)}function kC(e,t,n){if(!e||!n||!n.execId)return null;let r=typeof e.get==`function`?e.get(n.execId):e[n.execId];if(!r){let i=EC(t,n.toolCallId);if(i){let{element:e,codeEl:t}=DC(i);r={element:e,codeEl:t,stderrSeparator:null,toolCallId:n.toolCallId||``,pending:null},it()}else if(n.toolCallId)r={element:null,codeEl:null,stderrSeparator:null,toolCallId:n.toolCallId,pending:{stdout:``,stderr:``}};else{let e=SC(null,t?t.querySelector(`.stream-content`):null);r={element:e,codeEl:e.querySelector(`code`),stderrSeparator:null,toolCallId:``,pending:null},it()}typeof e.set==`function`?e.set(n.execId,r):e[n.execId]=r}let i=n.data||``;if(r.codeEl){OC(r,n.streamType,i);let e=r.codeEl.parentElement;e&&(e.scrollTop=e.scrollHeight)}else r.pending&&i&&(n.streamType===`stderr`?r.pending.stderr+=i:r.pending.stdout+=i);return r}function AC(e,t){let n=e||(t?CC.get(t):null);if(!n)return;let r=typeof n.values==`function`?[...n.values()]:Object.values(n);for(let e of r){if(!e||e.codeEl||!e.pending)continue;let n=EC(t,e.toolCallId);if(!n)continue;let{element:r,codeEl:i}=DC(n),{stdout:a,stderr:o}=e.pending;e.element=r,e.codeEl=i,e.stderrSeparator=null,e.pending=null,a&&OC(e,`stdout`,a),o&&OC(e,`stderr`,o);let s=i.parentElement;s&&(s.scrollTop=s.scrollHeight),it()}}function jC(e,t){if(!e?.toolCallId)return;let n=t;if(!n)return;let i=n.querySelector(`.tool-call-item[data-tool-call-id="${e.toolCallId}"]`);if(!i)return;i.classList.add(`has-result`),i.dataset.status=e.success?`success`:`failed`,AC(null,n);let a=parseInt(i.getAttribute(`data-created-at`),10),o=Date.now()-a,s=o<400&&o>=0?400-o:0,c=()=>{let n=i.querySelector(`.tool-call-executing`);n&&n.remove();let a=i.querySelector(`.tool-call-terminate-btn`);a&&(a.style.display=`none`);let o=i.querySelector(`.tool-call-abort-btn`);o&&(o.style.display=`none`);let s=i.querySelector(`.tool-call-result`);s&&s.remove();let c=e.truncated?`<span class="tool-result-truncated" title="${r(`chatStream.truncatedTitle`)}">${r(`chatStream.truncatedNote`)}</span>`:``,l=i.getAttribute(`data-meta-type`)===`exec`,u=i.querySelector(`.tool-call-header`),d=`
|
|
1656
1657
|
<span class="tool-result-status ${e.success?`success`:`fail`}">
|
|
1657
1658
|
${e.success?`<svg viewBox="0 0 24 24" fill="currentColor" width="16" height="16"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>`:`<svg viewBox="0 0 24 24" fill="currentColor" width="16" height="16"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>`}
|
|
1658
1659
|
</span>
|
|
1659
1660
|
${e.duration?`<span class="tool-result-duration">${Ve(e.duration)}</span>`:``}
|
|
1660
1661
|
${c}
|
|
1661
|
-
`,f=u.querySelector(`.tool-call-chevron`);
|
|
1662
|
+
`,f=u.querySelector(`.tool-call-chevron`);f?f.insertAdjacentHTML(`beforebegin`,d):u.insertAdjacentHTML(`beforeend`,d);let p=i.querySelector(`.agent-stream-output code`),m=!!(p&&p.textContent.trim());if(!l||!e.success&&!m){let t=e.content||(e.success?r(`chatStream.noOutput`):r(`chatStream.execFailed`)),n=t.length>500?t.substring(0,500)+r(`chatStream.clickToExpand`):t,a=t,o=document.createElement(`div`);if(o.className=`tool-call-result`,o.innerHTML=`
|
|
1662
1663
|
<div class="tool-result-title">${r(`chatStream.execResult`)}</div>
|
|
1663
1664
|
<div class="tool-result-content">
|
|
1664
1665
|
${xC(P(n))}
|
|
1665
1666
|
</div>
|
|
1666
|
-
`,a.length>500){let e=o.querySelector(`code`);e.dataset.fullContent=a;let t=!1;o.style.cursor=`pointer`,o.addEventListener(`click`,r=>{r.ctrlKey||r.metaKey||(t=!t,e.textContent=t?a:n)})}let s=i.querySelector(`.tool-call-body`);s?s.appendChild(o):i.appendChild(o)}it(),rC(t),t.isConnected&&requestAnimationFrame(()=>{let e=document.getElementById(`chatContainer`);e&&DS(e)})};s>0?setTimeout(c,s):c()}function
|
|
1667
|
+
`,a.length>500){let e=o.querySelector(`code`);e.dataset.fullContent=a;let t=!1;o.style.cursor=`pointer`,o.addEventListener(`click`,r=>{r.ctrlKey||r.metaKey||(t=!t,e.textContent=t?a:n)})}let s=i.querySelector(`.tool-call-body`);s?s.appendChild(o):i.appendChild(o)}it(),rC(t),t.isConnected&&requestAnimationFrame(()=>{let e=document.getElementById(`chatContainer`);e&&DS(e)})};s>0?setTimeout(c,s):c()}function MC(e){let t=document.createElement(`div`);t.className=`tool-call-item preselect-card`+(C.chatConfig?.streamExpandTools?` expanded`:``);let n=e.status===`failed`,i=``,a=``;if(e.action?.params?.selected){let t=e.action.params.selected;i=`<div class="tool-call-summary"><span>${r(`chatStream.preselectFiltered`,{total:e.apiRequest?.toolCount||`?`,count:t.length})}</span></div>`,a=`<span class="preselect-summary">${t.map(e=>`<code>${P(e)}</code>`).join(r(`chatStream.listSeparator`))}</span>`}else e.action?.name===`all_tools`?(i=`<div class="tool-call-summary"><span>${P(e.action.params.reason||``)}</span></div>`,a=`<span class="preselect-summary">${r(`chatStream.preselectSkippedAll`,{reason:P(e.action.params.reason||``)})}</span>`):e.action?.name===`skip`?(i=`<div class="tool-call-summary"><span>${P(e.action.params.reason||``)}</span></div>`,a=`<span class="preselect-summary">${r(`chatStream.preselectSkippedCount`,{reason:P(e.action.params.reason||``),count:e.action.params.toolCount||`?`})}</span>`):e.error?(i=`<div class="tool-call-summary"><span style="color:var(--danger-500);">${P(e.error)}</span></div>`,a=`<span class="preselect-summary" style="color:var(--danger-500);">${P(e.error)}</span>`):e.thought&&(i=`<div class="tool-call-summary"><span>${r(`chatStream.preselectDirectAnswer`)}</span></div>`,a=`<span class="preselect-summary">${r(`chatStream.preselectDirectAnswer`)}${P(e.thought).substring(0,200)}</span>`);let o=e.duration?Ve(e.duration):``,s=n?`<svg viewBox="0 0 24 24" fill="currentColor" width="16" height="16"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>`:`<svg viewBox="0 0 24 24" fill="currentColor" width="16" height="16"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>`;return t.innerHTML=`
|
|
1667
1668
|
<div class="tool-call-header">
|
|
1668
1669
|
<svg class="tool-call-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1669
1670
|
<circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/>
|
|
@@ -1678,7 +1679,7 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
1678
1679
|
${a}
|
|
1679
1680
|
${e.apiResponse?.toolCountAfter===void 0?``:`<div class="preselect-meta">${r(`chatStream.toolsAfterFilter`,{count:e.apiResponse.toolCountAfter})}</div>`}
|
|
1680
1681
|
</div>
|
|
1681
|
-
`,t.querySelector(`.tool-call-header`).addEventListener(`click`,e=>{e.ctrlKey||e.metaKey||t.classList.toggle(`expanded`)}),t}function
|
|
1682
|
+
`,t.querySelector(`.tool-call-header`).addEventListener(`click`,e=>{e.ctrlKey||e.metaKey||t.classList.toggle(`expanded`)}),t}function NC(e,t,n=[],a=null,o=null,s=!1){if(!e)return;e.dataset.sessionId&&vS(e.dataset.sessionId);let c=e.querySelector(`.message-content`),l=e.querySelector(`.stream-content`),u=e.querySelector(`.thinking-indicator:not(.hidden)`);if(u&&l){let e=zS>0?Ve(Date.now()-zS):``,t=document.createElement(`span`);if(t.className=`thinking-badge`,t.innerHTML=`<svg class="thinking-icon-static" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2a3 3 0 0 0-3 3v1a3 3 0 0 0 3 3 3 3 0 0 1 3 3v1a3 3 0 0 1-3 3 3 3 0 0 0-3 3v1a3 3 0 0 0 3 3"/><circle cx="8" cy="12" r="1.5"/><circle cx="16" cy="12" r="1.5"/></svg>${r(`chatStream.thinkingResult`)}${e?` <span class="thinking-duration">`+e+`</span>`:``}`,t.dataset.status=`success`,l.contains(u)){let e=u.previousElementSibling;e&&e.classList.contains(`thinking-content`)?l.insertBefore(t,e):l.insertBefore(t,u),u.classList.add(`hidden`)}else{let e=l.querySelectorAll(`.thinking-content`);if(e.length>0){let n=e[e.length-1],r=n.nextElementSibling;!r||!r.classList.contains(`thinking-badge`)?l.insertBefore(t,n):l.appendChild(t)}else l.appendChild(t);u.classList.add(`hidden`),u.remove()}}e.querySelectorAll(`.thinking-indicator`).forEach(e=>e.classList.add(`hidden`));let d=e.querySelector(`.stream-status`);if(d&&d.remove(),e.classList.remove(`streaming`),c&&c.querySelector(`.tool-call-item`)||l&&l.querySelector(`.tool-call-item`)){let e=BS>0?Ve(Date.now()-BS):``,a=(n||[]).filter(e=>e.nodeType===`api_call`||e.nodeType===`tool_exec`),o=a.filter(e=>e.status===`success`).length,u=a.filter(e=>e.status===`failed`).length,d=a.length,f=Pe(n),p=document.createElement(`div`);p.className=`thinking-process collapsed`;let m=document.createElement(`div`);m.className=`thinking-process-header`;let h=d>0?`
|
|
1682
1683
|
<span class="thinking-process-stat">
|
|
1683
1684
|
<span class="stat-icon node-icon">◉</span>
|
|
1684
1685
|
<span class="stat-label">${r(`chatStream.totalNodes`)}</span>
|
|
@@ -1713,7 +1714,7 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
1713
1714
|
<svg class="thinking-process-chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1714
1715
|
<polyline points="6 9 12 15 18 9"/>
|
|
1715
1716
|
</svg>
|
|
1716
|
-
`,f){let e=m.querySelector(`.token-stat`);e&&(e.style.cursor=`pointer`,e.addEventListener(`click`,t=>{t.stopPropagation(),qe(f,e)}))}let _=document.createElement(`div`);_.className=`thinking-process-body`;let v=document.createElement(`div`);if(v.className=`thinking-process-content`,_.appendChild(v),l)for(;l.firstChild;)v.appendChild(l.firstChild);c.querySelectorAll(`.tool-call-item`).forEach(e=>v.appendChild(e)),v.querySelectorAll(`.preselect-card`).forEach(e=>e.remove());let y=(n||[]).filter(e=>e.nodeType===`preselect`);i.debug(`[finalizeStreamingMessage] executionLog length:`,(n||[]).length,`preselectEntries:`,y.length),y.forEach(e=>{i.debug(`[finalizeStreamingMessage] creating preselect card for entry:`,e);let t=
|
|
1717
|
+
`,f){let e=m.querySelector(`.token-stat`);e&&(e.style.cursor=`pointer`,e.addEventListener(`click`,t=>{t.stopPropagation(),qe(f,e)}))}let _=document.createElement(`div`);_.className=`thinking-process-body`;let v=document.createElement(`div`);if(v.className=`thinking-process-content`,_.appendChild(v),l)for(;l.firstChild;)v.appendChild(l.firstChild);c.querySelectorAll(`.tool-call-item`).forEach(e=>v.appendChild(e)),v.querySelectorAll(`.preselect-card`).forEach(e=>e.remove());let y=(n||[]).filter(e=>e.nodeType===`preselect`);i.debug(`[finalizeStreamingMessage] executionLog length:`,(n||[]).length,`preselectEntries:`,y.length),y.forEach(e=>{i.debug(`[finalizeStreamingMessage] creating preselect card for entry:`,e);let t=MC(e);v.insertBefore(t,v.firstChild)});let b=v.querySelectorAll(`.thinking-content`),x=BC(t).trim();if(b.length>0){let e=b[b.length-1],t=e.textContent.trim();if(!s||s&&t===x){let t=e.previousElementSibling;for(;t;){if(t.classList.contains(`thinking-badge`)){t.remove();break}t=t.previousElementSibling}e.remove()}}if(v.children.length>0&&v.textContent.trim()){p.appendChild(m),p.appendChild(_);let e=document.createElement(`div`);e.className=`final-answer`;let n=BC(t);n&&n.trim()&&(e.innerHTML=$e(n));let r=c.querySelector(`.thinking-indicator`);r&&r.remove(),l&&(l.innerHTML=``),c.appendChild(p),c.appendChild(e),NS(m)}else{let e=c.querySelector(`.thinking-indicator`);if(e&&e.remove(),l){let e=BC(t);e&&e.trim()&&(l.innerHTML=$e(e))}}}else if(l){let e=BC(t);if(l.querySelector(`.thinking-content`)){let t=BS>0?Ve(Date.now()-BS):``,i=(n||[]).filter(e=>e.nodeType===`api_call`||e.nodeType===`tool_exec`),a=i.filter(e=>e.status===`success`).length,o=i.filter(e=>e.status===`failed`).length,u=i.length,d=Pe(n),f=document.createElement(`div`);f.className=`thinking-process collapsed`;let p=document.createElement(`div`);p.className=`thinking-process-header`;let m=u>0?`
|
|
1717
1718
|
<span class="thinking-process-stat">
|
|
1718
1719
|
<span class="stat-icon node-icon">◉</span>
|
|
1719
1720
|
<span class="stat-label">${r(`chatStream.totalNodes`)}</span>
|
|
@@ -1748,7 +1749,7 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
1748
1749
|
<svg class="thinking-process-chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1749
1750
|
<polyline points="6 9 12 15 18 9"/>
|
|
1750
1751
|
</svg>
|
|
1751
|
-
`,d){let e=p.querySelector(`.token-stat`);e&&(e.style.cursor=`pointer`,e.addEventListener(`click`,t=>{t.stopPropagation(),qe(d,e)}))}let g=document.createElement(`div`);g.className=`thinking-process-body`;let _=document.createElement(`div`);for(_.className=`thinking-process-content`,g.appendChild(_);l.firstChild;)_.appendChild(l.firstChild);let v=_.querySelectorAll(`.thinking-content`),y=e.trim();if(v.length>0){let e=v[v.length-1],t=e.textContent.trim();if(!s||s&&t===y){let t=e.previousElementSibling;for(;t;){if(t.classList.contains(`thinking-badge`)){t.remove();break}t=t.previousElementSibling}e.remove()}}if(_.children.length>0&&_.textContent.trim()){f.appendChild(p),f.appendChild(g);let t=document.createElement(`div`);t.className=`final-answer`,e&&e.trim()&&(t.innerHTML=$e(e));let n=c.querySelector(`.thinking-indicator`);n&&n.remove(),c.appendChild(f),c.appendChild(t),NS(p)}else{let t=c.querySelector(`.thinking-indicator`);t&&t.remove(),e&&e.trim()&&(l.innerHTML=$e(e))}}else e&&e.trim()&&(l.innerHTML=$e(e))}e.classList.add(`assistant`,`message`),e.dataset.rawContent=typeof t==`string`?dt(t):JSON.stringify(t),e.dataset.textContent_=dt(MC(t)),e.dataset.executionLog=JSON.stringify(n);let f=document.createElement(`div`);f.className=`message-footer`;let p=document.createElement(`button`);p.className=`copy-btn`,p.title=r(`chatStream.copyMarkdown`),p.innerHTML=[`<svg viewBox="0 0 16 16" fill="currentColor">`,`<path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25zM5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25z"/>`,`</svg>`,`<span>`+r(`chatStream.copy`)+`</span>`].join(``),p.addEventListener(`click`,t=>{t.stopPropagation(),Vx(e,p,t)}),f.appendChild(p);let m=document.createElement(`button`);m.className=`quote-btn`,m.title=r(`chatStream.quoteTitle`),m.innerHTML=[`<svg t="1781246498458" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9645" width="14" height="14"><path d="M156.09136 606.57001a457.596822 457.596822 0 0 1 221.680239-392.516385 50.844091 50.844091 0 1 1 50.844091 86.943396 355.90864 355.90864 0 0 0-138.804369 152.532274h16.77855a152.532274 152.532274 0 1 1-152.532274 152.532274z m406.752731 0a457.596822 457.596822 0 0 1 221.680239-392.007944 50.844091 50.844091 0 1 1 50.844091 86.943396 355.90864 355.90864 0 0 0-138.804369 152.532274h16.77855a152.532274 152.532274 0 1 1-152.532274 152.532274z" fill="#8a8a8a" p-id="9646"></path></svg>`,`<span>`+r(`chatStream.quote`)+`</span>`].join(``),m.addEventListener(`click`,t=>{t.stopPropagation(),Yx(e)}),f.appendChild(m),f.appendChild(xx());let h=document.createElement(`div`);h.className=`export-menu-container`;let g=document.createElement(`button`);g.className=`export-trigger-btn`,g.innerHTML=`<svg t="1781245244396" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5115" width="14" height="14"><path d="M496.213333 739.84c2.133333 2.133333 4.693333 3.84 7.68 5.12 0.853333 0.426667 2.133333 0.426667 2.986667 0.853333 1.706667 0.426667 2.986667 0.853333 4.693333 0.853334 5.546667 0 11.093333-2.133333 14.933334-6.4l256-256c8.533333-8.533333 8.533333-21.76 0-30.293334s-21.76-8.533333-30.293334 0L533.333333 674.133333V128c0-11.946667-9.386667-21.333333-21.333333-21.333333s-21.333333 9.386667-21.333333 21.333333v545.706667l-219.306667-219.306667c-8.533333-8.533333-21.76-8.533333-30.293333 0s-8.533333 21.76 0 30.293333l255.146666 255.146667zM768 874.666667H256c-11.946667 0-21.333333 9.386667-21.333333 21.333333s9.386667 21.333333 21.333333 21.333333h512c11.946667 0 21.333333-9.386667 21.333333-21.333333s-9.386667-21.333333-21.333333-21.333333z" fill="#8a8a8a" p-id="5116"></path></svg><span>`+r(`chatStream.export`)+`</span><svg class="dropdown-arrow" width="8" height="6" viewBox="0 0 8 6" fill="currentColor"><path d="M0 0l4 6 4-6z"/></svg>`;let _=document.createElement(`div`);_.className=`export-dropdown`,_.innerHTML=[`<button class="export-dropdown-item export-docx-item" type="button">`,`<svg t="1781245550030" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6544" width="32" height="32"><path d="M747.936 901.171H276.819c-72.2 0-130.953-55.224-130.953-123.078V244.721c0-67.854 58.752-123.078 130.953-123.078h383.525c6.597 0 12.937 2.505 17.795 6.954l192.363 178.046c5.317 4.96 8.386 11.914 8.386 19.227v452.223c0 67.854-58.752 123.078-130.952 123.078zM276.819 174.004c-43.31 0-78.592 31.703-78.592 70.717v533.372c0 39.015 35.282 70.718 78.592 70.718h471.117c43.31 0 78.592-31.703 78.592-70.718V337.324l-176.461-163.32H276.819z" fill="#8a8a8a" p-id="6545"></path><path d="M830.567 331.546H669.446c-14.471 0-26.18-11.71-26.18-26.181V156.209c0-14.471 11.709-26.18 26.18-26.18s26.181 11.709 26.181 26.18v122.976h134.94c14.471 0 26.181 11.709 26.181 26.18s-11.711 26.181-26.181 26.181z" fill="#8a8a8a" p-id="6546"></path><path d="M730.214 428.749l-92.04 343.616h-53.179L511.363 498.29l-75.677 274.074h-53.179l-92.04-343.616h49.088l69.542 255.667 69.541-255.667h63.406l69.541 255.667 69.541-255.667h49.088z" fill="#8a8a8a" p-id="6547"></path></svg>`,`<span>`+r(`chatStream.exportWord`)+`</span>`,`</button>`,`<button class="export-dropdown-item export-pdf-item" type="button">`,`<svg t="1781245863206" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8152" width="32" height="32"><path d="M582.4 864H170.666667c-6.4 0-10.666667-4.266667-10.666667-10.666667V170.666667c0-6.4 4.266667-10.666667 10.666667-10.666667h309.333333V320c0 40.533333 34.133333 74.666667 74.666667 74.666667h160v38.4c0 17.066667 14.933333 32 32 32s32-14.933333 32-32V298.666667c0-8.533333-4.266667-17.066667-8.533334-23.466667l-170.666666-170.666667c-6.4-6.4-14.933333-8.533333-23.466667-8.533333H170.666667C130.133333 96 96 130.133333 96 170.666667v682.666666c0 40.533333 34.133333 74.666667 74.666667 74.666667h411.733333c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32z m132.266667-550.4v17.066667H554.666667c-6.4 0-10.666667-4.266667-10.666667-10.666667V160h19.2l151.466667 153.6z" fill="#8a8a8a" p-id="8153"></path><path d="M332.8 533.333333c-12.8 0-19.2 2.133333-25.6 6.4-6.4 4.266667-8.533333 12.8-8.533333 23.466667v206.933333c0 6.4 2.133333 12.8 6.4 19.2 4.266667 4.266667 10.666667 8.533333 21.333333 8.533334s17.066667-4.266667 21.333333-8.533334c4.266667-4.266667 6.4-10.666667 6.4-19.2v-64h32c57.6 0 89.6-29.866667 89.6-87.466666 0-27.733333-8.533333-51.2-23.466666-64-14.933333-14.933333-36.266667-21.333333-66.133334-21.333334h-53.333333z m87.466667 85.333334c0 12.8-2.133333 23.466667-8.533334 27.733333-4.266667 4.266667-14.933333 8.533333-27.733333 8.533333h-32v-70.4H384c12.8 0 21.333333 2.133333 27.733333 8.533334 6.4 4.266667 8.533333 12.8 8.533334 25.6zM667.733333 571.733333c-8.533333-12.8-21.333333-21.333333-34.133333-29.866666-14.933333-4.266667-32-8.533333-51.2-8.533334h-61.866667c-8.533333 0-17.066667 0-23.466666 8.533334-2.133333 4.266667-4.266667 10.666667-4.266667 19.2V768c0 8.533333 2.133333 14.933333 4.266667 19.2 6.4 8.533333 14.933333 8.533333 23.466666 8.533333h64c19.2 0 34.133333-4.266667 49.066667-10.666666 12.8-6.4 25.6-17.066667 34.133333-29.866667 8.533333-12.8 14.933333-25.6 19.2-42.666667 4.266667-14.933333 6.4-32 6.4-49.066666 0-17.066667-2.133333-34.133333-6.4-49.066667-4.266667-14.933333-10.666667-29.866667-19.2-42.666667z m-42.666666 153.6c-8.533333 12.8-21.333333 19.2-38.4 19.2h-38.4v-160H576c21.333333 0 38.4 6.4 46.933333 19.2 10.666667 12.8 14.933333 34.133333 14.933334 59.733334 2.133333 27.733333-4.266667 46.933333-12.8 61.866666zM851.2 533.333333h-106.666667c-8.533333 0-17.066667 2.133333-21.333333 6.4-6.4 4.266667-8.533333 12.8-8.533333 21.333334v209.066666c0 6.4 2.133333 12.8 6.4 17.066667 4.266667 6.4 10.666667 8.533333 21.333333 8.533333 8.533333 0 17.066667-2.133333 21.333333-8.533333 2.133333-4.266667 6.4-8.533333 6.4-19.2v-85.333333h72.533334c12.8 0 23.466667-6.4 25.6-17.066667 2.133333-8.533333 2.133333-14.933333 0-17.066667-2.133333-4.266667-6.4-17.066667-25.6-17.066666H768v-49.066667h81.066667c8.533333 0 14.933333-2.133333 19.2-4.266667 4.266667-2.133333 8.533333-8.533333 8.533333-21.333333 2.133333-12.8-8.533333-23.466667-25.6-23.466667z" fill="#8a8a8a" p-id="8154"></path></svg>`,`<span>`+r(`chatStream.exportPdf`)+`</span>`,`</button>`,`<button class="export-dropdown-item export-image-item" type="button">`,`<svg t="1784207887308" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5993" width="32" height="32"><path d="M400.696 268.795c-17.249 0-31.233 13.986-31.233 31.233v30.471c0 17.249 13.986 31.233 31.233 31.233s31.233-13.986 31.233-31.233v-30.471c0-17.249-13.985-31.233-31.233-31.233z" fill="#8a8a8a" p-id="5994"></path><path d="M623.649 361.734c17.249 0 31.234-13.986 31.234-31.233v-30.471c0-17.249-13.986-31.233-31.234-31.233s-31.233 13.986-31.233 31.233v30.471c-0.001 17.248 13.985 31.233 31.233 31.233z" fill="#8a8a8a" p-id="5995"></path><path d="M438.295 388.804c-14.656 9.104-19.155 28.362-10.050 43.013 11.209 18.047 41.976 48.59 86.157 48.59 43.958 0 75.1-30.313 86.574-48.223 9.303-14.529 5.068-33.847-9.455-43.15-14.539-9.298-33.852-5.068-43.15 9.455-0.122 0.199-13.38 19.45-33.969 19.45-20.009 0-32.444-18.128-33.278-19.373-9.166-14.423-28.28-18.805-42.829-9.761z" fill="#8a8a8a" p-id="5996"></path><path d="M824.508503 116.690676 571.592236 116.690676c-17.248849 0-31.233352 13.985526-31.233352 31.233352s13.985526 31.233352 31.233352 31.233352l252.916267 0c40.181141 0 72.878844 32.692586 72.878844 72.878844l0 396.966057-189.334159-165.29465c-12.20088-10.655687-30.517037-10.207479-42.173518 0.9967L468.578048 674.16231 309.521472 517.519714c-11.895935-11.70253-30.903847-12.002358-43.154869-0.645706L126.957507 646.163629l0-394.126382c0-40.186258 32.692586-72.878844 72.878844-72.878844l252.916267 0c17.248849 0 31.233352-13.985526 31.233352-31.233352S470.000444 116.690676 452.751594 116.690676L199.836351 116.690676c-74.632791 0-135.346571 60.71378-135.346571 135.346571l0 520.56405c0 74.632791 60.71378 135.346571 135.346571 135.346571l252.916267 0c17.248849 0 31.233352-13.985526 31.233352-31.233352s-13.985526-31.233352-31.233352-31.233352L199.836351 845.481164c-40.186258 0-72.878844-32.692586-72.878844-72.878844l0-41.23924 160.003134-148.385539 159.428036 157.007917c12.048407 11.865235 31.361265 11.981892 43.546795 0.274246l198.576661-190.68697 208.876238 182.346001 0 40.683585c0 40.186258-32.697703 72.878844-72.878844 72.878844L571.592236 845.481164c-17.248849 0-31.233352 13.985526-31.233352 31.233352s13.985526 31.233352 31.233352 31.233352l252.916267 0c74.627674 0 135.346571-60.71378 135.346571-135.346571L959.855074 252.037247C959.855074 177.404456 899.136178 116.690676 824.508503 116.690676z" fill="#8a8a8a" p-id="5997"></path></svg>`,`<span>`+r(`chatStream.exportImage`)+`</span>`,`</button>`,`<button class="export-dropdown-item export-md-item" type="button">`,`<svg t="1784038824502" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1666" width="32" height="32"><path d="M601.216 85.333333a42.666667 42.666667 0 0 1 30.485333 12.821334l209.450667 213.973333a42.666667 42.666667 0 0 1 12.181333 29.866667V853.333333a85.333333 85.333333 0 0 1-85.333333 85.333334H256a85.333333 85.333333 0 0 1-85.333333-85.333334V170.666667a85.333333 85.333333 0 0 1 85.333333-85.333334h345.216z m-35.584 64H256a21.333333 21.333333 0 0 0-21.333333 21.333334v682.666666a21.333333 21.333333 0 0 0 21.333333 21.333334h512a21.333333 21.333333 0 0 0 21.333333-21.333334V395.413333h-191.68a32 32 0 0 1-32-32L565.632 149.333333z m64 38.186667v143.893333h140.821333L629.632 187.52z" fill="#8a8a8a" p-id="1667"></path><path d="M384.341333 800l-3.072-0.106667a32 32 0 0 1-29.162666-34.624l21.973333-256c2.752-32.256 46.165333-40.490667 60.544-11.477333l77.290667 156.010667 78.805333-156.224c14.08-27.925333 55.082667-20.906667 60.074667 8.789333l0.384 3.050667 20.714666 256a32 32 0 0 1-63.786666 5.162666l-11.541334-142.549333-56.341333 111.722667c-11.413333 22.613333-42.88 23.381333-55.744 2.517333l-1.493333-2.730667-54.912-110.826666-12.181334 142.016a32 32 0 0 1-31.552 29.269333z" fill="#8a8a8a" p-id="1668"></path></svg>`,`<span>`+r(`chatStream.exportMarkdown`)+`</span>`,`</button>`].join(``);let v=_.querySelector(`.export-docx-item`);v.addEventListener(`click`,async t=>{t.stopPropagation();let{exportAssistantMessageToDocx:n}=await A(async()=>{let{exportAssistantMessageToDocx:e}=await import(`./chat-export-CCgB_PeN.js`);return{exportAssistantMessageToDocx:e}},__vite__mapDeps([9,10,1,11,2,3,0]));n(e,v,_)});let y=_.querySelector(`.export-md-item`);y.addEventListener(`click`,async t=>{t.stopPropagation();let{exportAssistantMessageToMarkdown:n}=await A(async()=>{let{exportAssistantMessageToMarkdown:e}=await import(`./chat-export-CCgB_PeN.js`);return{exportAssistantMessageToMarkdown:e}},__vite__mapDeps([9,10,1,11,2,3,0]));n(e,y,_)});let b=_.querySelector(`.export-pdf-item`);b.addEventListener(`click`,async t=>{t.stopPropagation();let{exportAssistantMessageToPdf:n}=await A(async()=>{let{exportAssistantMessageToPdf:e}=await import(`./chat-export-CCgB_PeN.js`);return{exportAssistantMessageToPdf:e}},__vite__mapDeps([9,10,1,11,2,3,0]));n(e,b,_)});let x=_.querySelector(`.export-image-item`);x.addEventListener(`click`,async t=>{t.stopPropagation();let{exportAssistantMessageToImage:n}=await A(async()=>{let{exportAssistantMessageToImage:e}=await import(`./chat-export-CCgB_PeN.js`);return{exportAssistantMessageToImage:e}},__vite__mapDeps([9,10,1,11,2,3,0]));n(e,x,_)}),g.addEventListener(`click`,e=>{e.stopPropagation(),document.querySelectorAll(`.export-dropdown.show`).forEach(e=>{e!==_&&e.classList.remove(`show`)}),_.classList.toggle(`show`)});let S=null;h.addEventListener(`mouseenter`,()=>{S=setTimeout(()=>{document.querySelectorAll(`.export-dropdown.show`).forEach(e=>{e!==_&&e.classList.remove(`show`)}),_.classList.add(`show`)},300)}),h.addEventListener(`mouseleave`,()=>{S&&=(clearTimeout(S),null),setTimeout(()=>{!h.matches(`:hover`)&&!_.matches(`:hover`)&&_.classList.remove(`show`)},100)}),h.appendChild(g),h.appendChild(_),f.appendChild(h);let w=document.createElement(`div`);w.className=`footer-right-actions`,w.style.marginLeft=`auto`,w.style.display=`flex`,w.style.alignItems=`center`,w.style.gap=`8px`;let T=Pe(n);if(T){let e=document.createElement(`span`);e.className=`token-usage-tag`,e.title=r(`chatStream.tokenUsageTitle`,{total:I(T.totalTokens),prompt:I(T.promptTokens),completion:I(T.completionTokens)}),e.innerHTML=`<span class="token-tag-icon">⬤</span><span class="token-tag-value">${I(T.totalTokens)}</span>`,e.style.cursor=`pointer`,e.addEventListener(`click`,t=>{t.stopPropagation(),qe(T,e)}),w.appendChild(e)}let E=Vy(t),D=Wy(n,t);if(E.length&&(e.dataset.declaredArtifacts=JSON.stringify(E)),cb(D),D.length>0){let e=document.createElement(`button`);e.className=`artifacts-btn`,e.type=`button`,e.title=r(`artifacts.btnTitle`,{count:D.length}),e.innerHTML=`
|
|
1752
|
+
`,d){let e=p.querySelector(`.token-stat`);e&&(e.style.cursor=`pointer`,e.addEventListener(`click`,t=>{t.stopPropagation(),qe(d,e)}))}let g=document.createElement(`div`);g.className=`thinking-process-body`;let _=document.createElement(`div`);for(_.className=`thinking-process-content`,g.appendChild(_);l.firstChild;)_.appendChild(l.firstChild);let v=_.querySelectorAll(`.thinking-content`),y=e.trim();if(v.length>0){let e=v[v.length-1],t=e.textContent.trim();if(!s||s&&t===y){let t=e.previousElementSibling;for(;t;){if(t.classList.contains(`thinking-badge`)){t.remove();break}t=t.previousElementSibling}e.remove()}}if(_.children.length>0&&_.textContent.trim()){f.appendChild(p),f.appendChild(g);let t=document.createElement(`div`);t.className=`final-answer`,e&&e.trim()&&(t.innerHTML=$e(e));let n=c.querySelector(`.thinking-indicator`);n&&n.remove(),c.appendChild(f),c.appendChild(t),NS(p)}else{let t=c.querySelector(`.thinking-indicator`);t&&t.remove(),e&&e.trim()&&(l.innerHTML=$e(e))}}else e&&e.trim()&&(l.innerHTML=$e(e))}e.classList.add(`assistant`,`message`),e.dataset.rawContent=typeof t==`string`?dt(t):JSON.stringify(t),e.dataset.textContent_=dt(BC(t)),e.dataset.executionLog=JSON.stringify(n);let f=document.createElement(`div`);f.className=`message-footer`;let p=document.createElement(`button`);p.className=`copy-btn`,p.title=r(`chatStream.copyMarkdown`),p.innerHTML=[`<svg viewBox="0 0 16 16" fill="currentColor">`,`<path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25zM5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25z"/>`,`</svg>`,`<span>`+r(`chatStream.copy`)+`</span>`].join(``),p.addEventListener(`click`,t=>{t.stopPropagation(),Vx(e,p,t)}),f.appendChild(p);let m=document.createElement(`button`);m.className=`quote-btn`,m.title=r(`chatStream.quoteTitle`),m.innerHTML=[`<svg t="1781246498458" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9645" width="14" height="14"><path d="M156.09136 606.57001a457.596822 457.596822 0 0 1 221.680239-392.516385 50.844091 50.844091 0 1 1 50.844091 86.943396 355.90864 355.90864 0 0 0-138.804369 152.532274h16.77855a152.532274 152.532274 0 1 1-152.532274 152.532274z m406.752731 0a457.596822 457.596822 0 0 1 221.680239-392.007944 50.844091 50.844091 0 1 1 50.844091 86.943396 355.90864 355.90864 0 0 0-138.804369 152.532274h16.77855a152.532274 152.532274 0 1 1-152.532274 152.532274z" fill="#8a8a8a" p-id="9646"></path></svg>`,`<span>`+r(`chatStream.quote`)+`</span>`].join(``),m.addEventListener(`click`,t=>{t.stopPropagation(),Yx(e)}),f.appendChild(m),f.appendChild(xx());let h=document.createElement(`div`);h.className=`export-menu-container`;let g=document.createElement(`button`);g.className=`export-trigger-btn`,g.innerHTML=`<svg t="1781245244396" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5115" width="14" height="14"><path d="M496.213333 739.84c2.133333 2.133333 4.693333 3.84 7.68 5.12 0.853333 0.426667 2.133333 0.426667 2.986667 0.853333 1.706667 0.426667 2.986667 0.853333 4.693333 0.853334 5.546667 0 11.093333-2.133333 14.933334-6.4l256-256c8.533333-8.533333 8.533333-21.76 0-30.293334s-21.76-8.533333-30.293334 0L533.333333 674.133333V128c0-11.946667-9.386667-21.333333-21.333333-21.333333s-21.333333 9.386667-21.333333 21.333333v545.706667l-219.306667-219.306667c-8.533333-8.533333-21.76-8.533333-30.293333 0s-8.533333 21.76 0 30.293333l255.146666 255.146667zM768 874.666667H256c-11.946667 0-21.333333 9.386667-21.333333 21.333333s9.386667 21.333333 21.333333 21.333333h512c11.946667 0 21.333333-9.386667 21.333333-21.333333s-9.386667-21.333333-21.333333-21.333333z" fill="#8a8a8a" p-id="5116"></path></svg><span>`+r(`chatStream.export`)+`</span><svg class="dropdown-arrow" width="8" height="6" viewBox="0 0 8 6" fill="currentColor"><path d="M0 0l4 6 4-6z"/></svg>`;let _=document.createElement(`div`);_.className=`export-dropdown`,_.innerHTML=[`<button class="export-dropdown-item export-docx-item" type="button">`,`<svg t="1781245550030" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6544" width="32" height="32"><path d="M747.936 901.171H276.819c-72.2 0-130.953-55.224-130.953-123.078V244.721c0-67.854 58.752-123.078 130.953-123.078h383.525c6.597 0 12.937 2.505 17.795 6.954l192.363 178.046c5.317 4.96 8.386 11.914 8.386 19.227v452.223c0 67.854-58.752 123.078-130.952 123.078zM276.819 174.004c-43.31 0-78.592 31.703-78.592 70.717v533.372c0 39.015 35.282 70.718 78.592 70.718h471.117c43.31 0 78.592-31.703 78.592-70.718V337.324l-176.461-163.32H276.819z" fill="#8a8a8a" p-id="6545"></path><path d="M830.567 331.546H669.446c-14.471 0-26.18-11.71-26.18-26.181V156.209c0-14.471 11.709-26.18 26.18-26.18s26.181 11.709 26.181 26.18v122.976h134.94c14.471 0 26.181 11.709 26.181 26.18s-11.711 26.181-26.181 26.181z" fill="#8a8a8a" p-id="6546"></path><path d="M730.214 428.749l-92.04 343.616h-53.179L511.363 498.29l-75.677 274.074h-53.179l-92.04-343.616h49.088l69.542 255.667 69.541-255.667h63.406l69.541 255.667 69.541-255.667h49.088z" fill="#8a8a8a" p-id="6547"></path></svg>`,`<span>`+r(`chatStream.exportWord`)+`</span>`,`</button>`,`<button class="export-dropdown-item export-pdf-item" type="button">`,`<svg t="1781245863206" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8152" width="32" height="32"><path d="M582.4 864H170.666667c-6.4 0-10.666667-4.266667-10.666667-10.666667V170.666667c0-6.4 4.266667-10.666667 10.666667-10.666667h309.333333V320c0 40.533333 34.133333 74.666667 74.666667 74.666667h160v38.4c0 17.066667 14.933333 32 32 32s32-14.933333 32-32V298.666667c0-8.533333-4.266667-17.066667-8.533334-23.466667l-170.666666-170.666667c-6.4-6.4-14.933333-8.533333-23.466667-8.533333H170.666667C130.133333 96 96 130.133333 96 170.666667v682.666666c0 40.533333 34.133333 74.666667 74.666667 74.666667h411.733333c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32z m132.266667-550.4v17.066667H554.666667c-6.4 0-10.666667-4.266667-10.666667-10.666667V160h19.2l151.466667 153.6z" fill="#8a8a8a" p-id="8153"></path><path d="M332.8 533.333333c-12.8 0-19.2 2.133333-25.6 6.4-6.4 4.266667-8.533333 12.8-8.533333 23.466667v206.933333c0 6.4 2.133333 12.8 6.4 19.2 4.266667 4.266667 10.666667 8.533333 21.333333 8.533334s17.066667-4.266667 21.333333-8.533334c4.266667-4.266667 6.4-10.666667 6.4-19.2v-64h32c57.6 0 89.6-29.866667 89.6-87.466666 0-27.733333-8.533333-51.2-23.466666-64-14.933333-14.933333-36.266667-21.333333-66.133334-21.333334h-53.333333z m87.466667 85.333334c0 12.8-2.133333 23.466667-8.533334 27.733333-4.266667 4.266667-14.933333 8.533333-27.733333 8.533333h-32v-70.4H384c12.8 0 21.333333 2.133333 27.733333 8.533334 6.4 4.266667 8.533333 12.8 8.533334 25.6zM667.733333 571.733333c-8.533333-12.8-21.333333-21.333333-34.133333-29.866666-14.933333-4.266667-32-8.533333-51.2-8.533334h-61.866667c-8.533333 0-17.066667 0-23.466666 8.533334-2.133333 4.266667-4.266667 10.666667-4.266667 19.2V768c0 8.533333 2.133333 14.933333 4.266667 19.2 6.4 8.533333 14.933333 8.533333 23.466666 8.533333h64c19.2 0 34.133333-4.266667 49.066667-10.666666 12.8-6.4 25.6-17.066667 34.133333-29.866667 8.533333-12.8 14.933333-25.6 19.2-42.666667 4.266667-14.933333 6.4-32 6.4-49.066666 0-17.066667-2.133333-34.133333-6.4-49.066667-4.266667-14.933333-10.666667-29.866667-19.2-42.666667z m-42.666666 153.6c-8.533333 12.8-21.333333 19.2-38.4 19.2h-38.4v-160H576c21.333333 0 38.4 6.4 46.933333 19.2 10.666667 12.8 14.933333 34.133333 14.933334 59.733334 2.133333 27.733333-4.266667 46.933333-12.8 61.866666zM851.2 533.333333h-106.666667c-8.533333 0-17.066667 2.133333-21.333333 6.4-6.4 4.266667-8.533333 12.8-8.533333 21.333334v209.066666c0 6.4 2.133333 12.8 6.4 17.066667 4.266667 6.4 10.666667 8.533333 21.333333 8.533333 8.533333 0 17.066667-2.133333 21.333333-8.533333 2.133333-4.266667 6.4-8.533333 6.4-19.2v-85.333333h72.533334c12.8 0 23.466667-6.4 25.6-17.066667 2.133333-8.533333 2.133333-14.933333 0-17.066667-2.133333-4.266667-6.4-17.066667-25.6-17.066666H768v-49.066667h81.066667c8.533333 0 14.933333-2.133333 19.2-4.266667 4.266667-2.133333 8.533333-8.533333 8.533333-21.333333 2.133333-12.8-8.533333-23.466667-25.6-23.466667z" fill="#8a8a8a" p-id="8154"></path></svg>`,`<span>`+r(`chatStream.exportPdf`)+`</span>`,`</button>`,`<button class="export-dropdown-item export-image-item" type="button">`,`<svg t="1784207887308" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5993" width="32" height="32"><path d="M400.696 268.795c-17.249 0-31.233 13.986-31.233 31.233v30.471c0 17.249 13.986 31.233 31.233 31.233s31.233-13.986 31.233-31.233v-30.471c0-17.249-13.985-31.233-31.233-31.233z" fill="#8a8a8a" p-id="5994"></path><path d="M623.649 361.734c17.249 0 31.234-13.986 31.234-31.233v-30.471c0-17.249-13.986-31.233-31.234-31.233s-31.233 13.986-31.233 31.233v30.471c-0.001 17.248 13.985 31.233 31.233 31.233z" fill="#8a8a8a" p-id="5995"></path><path d="M438.295 388.804c-14.656 9.104-19.155 28.362-10.050 43.013 11.209 18.047 41.976 48.59 86.157 48.59 43.958 0 75.1-30.313 86.574-48.223 9.303-14.529 5.068-33.847-9.455-43.15-14.539-9.298-33.852-5.068-43.15 9.455-0.122 0.199-13.38 19.45-33.969 19.45-20.009 0-32.444-18.128-33.278-19.373-9.166-14.423-28.28-18.805-42.829-9.761z" fill="#8a8a8a" p-id="5996"></path><path d="M824.508503 116.690676 571.592236 116.690676c-17.248849 0-31.233352 13.985526-31.233352 31.233352s13.985526 31.233352 31.233352 31.233352l252.916267 0c40.181141 0 72.878844 32.692586 72.878844 72.878844l0 396.966057-189.334159-165.29465c-12.20088-10.655687-30.517037-10.207479-42.173518 0.9967L468.578048 674.16231 309.521472 517.519714c-11.895935-11.70253-30.903847-12.002358-43.154869-0.645706L126.957507 646.163629l0-394.126382c0-40.186258 32.692586-72.878844 72.878844-72.878844l252.916267 0c17.248849 0 31.233352-13.985526 31.233352-31.233352S470.000444 116.690676 452.751594 116.690676L199.836351 116.690676c-74.632791 0-135.346571 60.71378-135.346571 135.346571l0 520.56405c0 74.632791 60.71378 135.346571 135.346571 135.346571l252.916267 0c17.248849 0 31.233352-13.985526 31.233352-31.233352s-13.985526-31.233352-31.233352-31.233352L199.836351 845.481164c-40.186258 0-72.878844-32.692586-72.878844-72.878844l0-41.23924 160.003134-148.385539 159.428036 157.007917c12.048407 11.865235 31.361265 11.981892 43.546795 0.274246l198.576661-190.68697 208.876238 182.346001 0 40.683585c0 40.186258-32.697703 72.878844-72.878844 72.878844L571.592236 845.481164c-17.248849 0-31.233352 13.985526-31.233352 31.233352s13.985526 31.233352 31.233352 31.233352l252.916267 0c74.627674 0 135.346571-60.71378 135.346571-135.346571L959.855074 252.037247C959.855074 177.404456 899.136178 116.690676 824.508503 116.690676z" fill="#8a8a8a" p-id="5997"></path></svg>`,`<span>`+r(`chatStream.exportImage`)+`</span>`,`</button>`,`<button class="export-dropdown-item export-md-item" type="button">`,`<svg t="1784038824502" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1666" width="32" height="32"><path d="M601.216 85.333333a42.666667 42.666667 0 0 1 30.485333 12.821334l209.450667 213.973333a42.666667 42.666667 0 0 1 12.181333 29.866667V853.333333a85.333333 85.333333 0 0 1-85.333333 85.333334H256a85.333333 85.333333 0 0 1-85.333333-85.333334V170.666667a85.333333 85.333333 0 0 1 85.333333-85.333334h345.216z m-35.584 64H256a21.333333 21.333333 0 0 0-21.333333 21.333334v682.666666a21.333333 21.333333 0 0 0 21.333333 21.333334h512a21.333333 21.333333 0 0 0 21.333333-21.333334V395.413333h-191.68a32 32 0 0 1-32-32L565.632 149.333333z m64 38.186667v143.893333h140.821333L629.632 187.52z" fill="#8a8a8a" p-id="1667"></path><path d="M384.341333 800l-3.072-0.106667a32 32 0 0 1-29.162666-34.624l21.973333-256c2.752-32.256 46.165333-40.490667 60.544-11.477333l77.290667 156.010667 78.805333-156.224c14.08-27.925333 55.082667-20.906667 60.074667 8.789333l0.384 3.050667 20.714666 256a32 32 0 0 1-63.786666 5.162666l-11.541334-142.549333-56.341333 111.722667c-11.413333 22.613333-42.88 23.381333-55.744 2.517333l-1.493333-2.730667-54.912-110.826666-12.181334 142.016a32 32 0 0 1-31.552 29.269333z" fill="#8a8a8a" p-id="1668"></path></svg>`,`<span>`+r(`chatStream.exportMarkdown`)+`</span>`,`</button>`].join(``);let v=_.querySelector(`.export-docx-item`);v.addEventListener(`click`,async t=>{t.stopPropagation();let{exportAssistantMessageToDocx:n}=await A(async()=>{let{exportAssistantMessageToDocx:e}=await import(`./chat-export-DduslUlT.js`);return{exportAssistantMessageToDocx:e}},__vite__mapDeps([9,10,1,11,2,3,0]));n(e,v,_)});let y=_.querySelector(`.export-md-item`);y.addEventListener(`click`,async t=>{t.stopPropagation();let{exportAssistantMessageToMarkdown:n}=await A(async()=>{let{exportAssistantMessageToMarkdown:e}=await import(`./chat-export-DduslUlT.js`);return{exportAssistantMessageToMarkdown:e}},__vite__mapDeps([9,10,1,11,2,3,0]));n(e,y,_)});let b=_.querySelector(`.export-pdf-item`);b.addEventListener(`click`,async t=>{t.stopPropagation();let{exportAssistantMessageToPdf:n}=await A(async()=>{let{exportAssistantMessageToPdf:e}=await import(`./chat-export-DduslUlT.js`);return{exportAssistantMessageToPdf:e}},__vite__mapDeps([9,10,1,11,2,3,0]));n(e,b,_)});let x=_.querySelector(`.export-image-item`);x.addEventListener(`click`,async t=>{t.stopPropagation();let{exportAssistantMessageToImage:n}=await A(async()=>{let{exportAssistantMessageToImage:e}=await import(`./chat-export-DduslUlT.js`);return{exportAssistantMessageToImage:e}},__vite__mapDeps([9,10,1,11,2,3,0]));n(e,x,_)}),g.addEventListener(`click`,e=>{e.stopPropagation(),document.querySelectorAll(`.export-dropdown.show`).forEach(e=>{e!==_&&e.classList.remove(`show`)}),_.classList.toggle(`show`)});let S=null;h.addEventListener(`mouseenter`,()=>{S=setTimeout(()=>{document.querySelectorAll(`.export-dropdown.show`).forEach(e=>{e!==_&&e.classList.remove(`show`)}),_.classList.add(`show`)},300)}),h.addEventListener(`mouseleave`,()=>{S&&=(clearTimeout(S),null),setTimeout(()=>{!h.matches(`:hover`)&&!_.matches(`:hover`)&&_.classList.remove(`show`)},100)}),h.appendChild(g),h.appendChild(_),f.appendChild(h);let w=document.createElement(`div`);w.className=`footer-right-actions`,w.style.marginLeft=`auto`,w.style.display=`flex`,w.style.alignItems=`center`,w.style.gap=`8px`;let T=Pe(n);if(T){let e=document.createElement(`span`);e.className=`token-usage-tag`,e.title=r(`chatStream.tokenUsageTitle`,{total:I(T.totalTokens),prompt:I(T.promptTokens),completion:I(T.completionTokens)}),e.innerHTML=`<span class="token-tag-icon">⬤</span><span class="token-tag-value">${I(T.totalTokens)}</span>`,e.style.cursor=`pointer`,e.addEventListener(`click`,t=>{t.stopPropagation(),qe(T,e)}),w.appendChild(e)}let E=Vy(t),D=Wy(n,t);if(E.length&&(e.dataset.declaredArtifacts=JSON.stringify(E)),cb(D),D.length>0){let e=document.createElement(`button`);e.className=`artifacts-btn`,e.type=`button`,e.title=r(`artifacts.btnTitle`,{count:D.length}),e.innerHTML=`
|
|
1752
1753
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="14" height="14">
|
|
1753
1754
|
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
|
|
1754
1755
|
<polyline points="14 2 14 8 20 8"/>
|
|
@@ -1770,27 +1771,27 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
1770
1771
|
<polyline points="3 6 5 6 21 6"></polyline>
|
|
1771
1772
|
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
|
|
1772
1773
|
</svg>
|
|
1773
|
-
`,te.addEventListener(`click`,t=>{t.stopPropagation(),
|
|
1774
|
+
`,te.addEventListener(`click`,t=>{t.stopPropagation(),zw(e)}),w.appendChild(te),f.appendChild(w),e.querySelector(`.message-content`).appendChild(f),kw(),jw(),it(),lt(e),requestAnimationFrame(()=>{if(ES(),!SS){let t=document.getElementById(`chatContainer`);t&&e.offsetHeight>t.clientHeight*.6&&e.scrollIntoView({behavior:`smooth`,block:`start`})}TS()})}function PC(e){if(!e||e.disabled)return!1;try{document.dispatchEvent(new CustomEvent(`task-stop-requested`,{detail:{sessionId:C.activeSessionId}}))}catch{}e.disabled=!0,e.style.opacity=`0.4`,e.style.cursor=`not-allowed`;let t=document.querySelector(`.loading-message .stop-task-btn`);if(t){t.disabled=!0,t.style.opacity=`0.6`,t.style.cursor=`not-allowed`;let e=document.querySelector(`.loading-message .loading-text`);e&&(e.textContent=r(`chatStream.stopping`))}return chrome.runtime.sendMessage({type:`CANCEL_REACT`,tabId:null,sessionId:C.activeSessionId}),C.pendingCancelApi&&C.pendingCancelApi({message:r(`chatStream.taskStopped`),executionLog:C.currentExecutionStatus?.executionLog||[]}),!0}function FC(e){if(!e)return;e.querySelectorAll(`.thinking-indicator`).forEach(e=>e.classList.add(`hidden`));let t=e.querySelector(`.stream-status`);t&&(t.textContent=``),e.querySelectorAll(`.tool-call-executing`).forEach(e=>{e.textContent=r(`chatStream.cancelled`),e.classList.add(`tool-call-cancelled`)}),e.querySelectorAll(`.subtask-status-label`).forEach(e=>{let t=e.querySelector(`.subtask-spinner`);t&&t.remove(),e.textContent.includes(r(`chatStream.executing`))&&(e.textContent=r(`chatStream.cancelled`))}),e.querySelectorAll(`.subtask-progress-active`).forEach(e=>e.classList.remove(`subtask-progress-active`)),e.querySelectorAll(`.subtask-node-spinner`).forEach(e=>e.replaceWith(`○`)),e.querySelectorAll(`.subtask-spinner, .thinking-spinner, .loading-dots`).forEach(e=>e.remove()),e.classList.remove(`streaming`),e.classList.add(`stream-cancelled`),e.querySelectorAll(`.tool-call-abort-btn`).forEach(e=>e.style.display=`none`),e.querySelectorAll(`.tool-call-terminate-btn`).forEach(e=>e.style.display=`none`)}var IC=t({_checkForAbandonedCheckpoint:()=>nS,addContextBubble:()=>Sw,addLoadingMessage:()=>Mw,addMessage:()=>Ew,applyNodeFilter:()=>cw,bindExecutionLogDelegate:()=>kw,bindReflectionBadgeDelegate:()=>jw,bindSubtaskProgressClicks:()=>pw,buildKnowledgeContextText:()=>tw,buildUserContent:()=>Vp,callApi:()=>Vw,cancelStreamingTask:()=>PC,classifySubtaskNodeStats:()=>iw,classifySubtaskOutcome:()=>rw,clearChatHistory:()=>ZC,clearSelectedContext:()=>UC,deleteMessage:()=>zw,directSend:()=>xw,editAndResendMessage:()=>Hw,extractSubtaskPlan:()=>dw,extractTextContent:()=>BC,fillSidePanelInput:()=>bw,hideModal:()=>$C,insertSubtaskRowInOrder:()=>mw,isSubtaskReplaySkipped:()=>ow,loadChatHistory:()=>qC,mapApiErrorToUserMessage:()=>hw,openImagePreview:()=>jp,rebindAllMessages:()=>Iw,refreshSelectionIndicatorFromState:()=>HC,removeLoadingMessage:()=>Nw,renderImagePreviewsFromChat:()=>Bp,renderKnowledgeContextBubbles:()=>nw,renderMessageMermaid:()=>lt,renderPendingSubtaskRow:()=>fw,resolveRunningNodeLabel:()=>aw,restoreMessageFromHtml:()=>Fw,restorePendingSessionsFromStorage:()=>zC,saveChatHistory:()=>YC,saveChatHistoryAsync:()=>XC,sendMessage:()=>vw,setMessageTimestampVisible:()=>Dw,setQuoteContext:()=>VC,showCommandTerminateDialog:()=>Lw,showModal:()=>QC,stripImagesFromContent:()=>Hp,syncPendingSessionsToStorage:()=>RC,toggleNodeFilter:()=>sw,triggerSelectionSearch:()=>yw});Jx(VC),n(`zh`,{chatMsg:{searchPrompt:`搜索一下`,exportWord:`导出 Word`,exportPdf:`导出 PDF`,exportImage:`导出图片`,exportMarkdown:`导出 Markdown`,executionLogTitle:`执行日志`,revisedTag:`已修订`,roundsTag:` ({count}轮)`,revisedSuffix:`(已修订)`,scoreBadgeTitle:`AI 质量评估: {score}/10{rounds}{revised}
|
|
1774
1775
|
点击查看评估详情`,reflectionFailedTitle:`反思评估失败(点击查看执行日志)`,reflectionFailedBadge:`⚠️ 反思失败`,prototypeLocalOpened:`已在本地浏览器打开,点击可在面板内查看`,prototypeView:`查看 UI 原型`,bookmarkMessage:`收藏消息`,unbookmarkMessage:`取消收藏`,forkSession:`从此处分叉会话(仅复制到此条消息)`,deleteMessageTitle:`删除消息`,resumeTaskTitle:`从上次中断处继续执行任务`,resumeTaskTitleBudget:`执行预算已用完(部分完成):点击后可在新的预算下接着未完成的部分继续`,resumeTaskBtn:`继续执行`,clickToEnlarge:`点击查看大图`,fileExtracting:` 提取中...`,fileFailed:` 失败`,fileExtractFailed:`提取失败`,copyMessageTitle:`复制消息内容`,editAndResend:`编辑后重新发送`,thinking:`思考中...`,stopTask:`停止任务`,viewExecutionLog:`查看执行日志`,preparing:`准备中...`,emptyModelReply:`模型未返回任何内容。若你发送了图片,请确认所选模型支持视觉识别(图片识别需选择支持多模态视觉的模型),或更换模型后重试。`,stopping:`停止中...`,copyCode:`复制代码`,aborting:`正在终止...`,terminateCommandTitle:`终止命令执行`,terminateCommandPrompt:`请选择终止方式:`,terminateWaitTitle:`终止等待`,terminateWaitDesc:`仅停止等待命令输出,后台进程继续运行。<br/>适用于挂起型服务(如 npm run dev)。`,terminateCommandBtnTitle:`终止命令`,terminateCommandBtnDesc:`直接终止后台命令进程,释放资源。`,confirmDeleteMessage:`确认删除消息`,deleteMessageWarning:`删除后消息将从对话历史中移除,且无法恢复。`,confirmDelete:`确认删除`,quotedContextLabel:`💬 已引用: {text}`,selectedContextLabel:`📌 已选中: {text}`,subtaskDone:`完成`,subtaskFailed:`失败`,subtaskPartial:`部分完成`,subtaskFailReason:`中断原因:{error}`,subtaskExecuting:`执行中...`,subtaskPending:`待执行`,subtaskDescLabel:`任务描述:`,subtaskResultLabel:`产出摘要:`,subtaskAllDone:`✓ 全部完成`,subtaskReplaySkipped:`已跳过重放`,subtaskReplaySkippedHint:`中断前已成功完成,本轮未重复执行,写操作不会二次生效`,subtaskFilterEmpty:`当前过滤下无匹配节点`,subtaskFilterHint:`点击按此状态过滤节点,再点取消`,subtaskStatOtherHint:`已取消 / 未完成节点(用户拒绝确认、任务终止时仍在执行等),点击过滤`,subtaskPartialFail:`✗ {success}/{total} 完成,{fail} 个节点失败`,unknownNode:`未知`,stopGeneration:`停止生成`,toolResultTitle:`执行结果`,reflectionInProgress:`质量评估中...`,cannotGetMessageContent:`无法获取消息内容`,editFailed:`编辑失败: {message}`,errTaskStopped:`任务已被用户停止`,errTaskReplaced:`任务已被新请求替代`,errSwRestarted:`后台服务异常重启,API 调用已中断`,errTimeout:`请求超时({seconds}秒)`,cancelBtn:`取消`}}),n(`en`,{chatMsg:{searchPrompt:`Search`,exportWord:`Export Word`,exportPdf:`Export PDF`,exportImage:`Export Image`,exportMarkdown:`Export Markdown`,executionLogTitle:`Execution Log`,revisedTag:`Revised`,roundsTag:` ({count} rounds)`,revisedSuffix:` (Revised)`,scoreBadgeTitle:`AI Quality Assessment: {score}/10{rounds}{revised}
|
|
1775
|
-
Click to view assessment details`,reflectionFailedTitle:`Reflection assessment failed (click to view execution log)`,reflectionFailedBadge:`⚠️ Reflection Failed`,prototypeLocalOpened:`Opened in local browser, click to view in panel`,prototypeView:`View UI Prototype`,bookmarkMessage:`Bookmark message`,unbookmarkMessage:`Remove bookmark`,forkSession:`Fork session from here (copy up to this message only)`,deleteMessageTitle:`Delete message`,resumeTaskTitle:`Resume task from last interruption`,resumeTaskTitleBudget:`Execution budget exhausted (partially complete): click to continue the unfinished parts with a fresh budget`,resumeTaskBtn:`Resume`,clickToEnlarge:`Click to view full size`,fileExtracting:` extracting...`,fileFailed:` failed`,fileExtractFailed:`Extraction failed`,copyMessageTitle:`Copy message content`,editAndResend:`Edit and resend`,thinking:`Thinking...`,stopTask:`Stop task`,viewExecutionLog:`View execution log`,preparing:`Preparing...`,emptyModelReply:`The model returned no content. If you sent an image, make sure the selected model supports vision (image recognition requires a multimodal vision model), or switch model and retry.`,stopping:`Stopping...`,copyCode:`Copy code`,aborting:`Aborting...`,terminateCommandTitle:`Terminate Command Execution`,terminateCommandPrompt:`Please select a termination method:`,terminateWaitTitle:`Stop Waiting`,terminateWaitDesc:`Only stop waiting for command output; the background process continues running.<br/>Suitable for hanging services (e.g. npm run dev).`,terminateCommandBtnTitle:`Terminate Command`,terminateCommandBtnDesc:`Directly terminate the background command process and release resources.`,confirmDeleteMessage:`Confirm Delete Message`,deleteMessageWarning:`After deletion, the message will be removed from the conversation history and cannot be recovered.`,confirmDelete:`Confirm Delete`,quotedContextLabel:`💬 Quoted: {text}`,selectedContextLabel:`📌 Selected: {text}`,subtaskDone:`Done`,subtaskFailed:`Failed`,subtaskPartial:`Partial`,subtaskFailReason:`Interrupted: {error}`,subtaskExecuting:`Executing...`,subtaskPending:`Pending`,subtaskDescLabel:`Description: `,subtaskResultLabel:`Output summary: `,subtaskAllDone:`✓ All done`,subtaskReplaySkipped:`replay skipped`,subtaskReplaySkippedHint:`Already completed before the interruption; not re-run this round, so side effects do not apply twice`,subtaskFilterEmpty:`No nodes match this filter`,subtaskFilterHint:`Click to filter nodes by this status, click again to clear`,subtaskStatOtherHint:`Cancelled / unfinished nodes (denied confirmations, still running when the task ended). Click to filter`,subtaskPartialFail:`✗ {success}/{total} done, {fail} nodes failed`,unknownNode:`Unknown`,stopGeneration:`Stop generation`,toolResultTitle:`Execution Result`,reflectionInProgress:`Assessing quality...`,cannotGetMessageContent:`Cannot get message content`,editFailed:`Edit failed: {message}`,errTaskStopped:`Task stopped by user`,errTaskReplaced:`Task replaced by new request`,errSwRestarted:`Background service restarted unexpectedly, API call interrupted`,errTimeout:`Request timeout ({seconds}s)`,cancelBtn:`Cancel`}});var
|
|
1776
|
+
Click to view assessment details`,reflectionFailedTitle:`Reflection assessment failed (click to view execution log)`,reflectionFailedBadge:`⚠️ Reflection Failed`,prototypeLocalOpened:`Opened in local browser, click to view in panel`,prototypeView:`View UI Prototype`,bookmarkMessage:`Bookmark message`,unbookmarkMessage:`Remove bookmark`,forkSession:`Fork session from here (copy up to this message only)`,deleteMessageTitle:`Delete message`,resumeTaskTitle:`Resume task from last interruption`,resumeTaskTitleBudget:`Execution budget exhausted (partially complete): click to continue the unfinished parts with a fresh budget`,resumeTaskBtn:`Resume`,clickToEnlarge:`Click to view full size`,fileExtracting:` extracting...`,fileFailed:` failed`,fileExtractFailed:`Extraction failed`,copyMessageTitle:`Copy message content`,editAndResend:`Edit and resend`,thinking:`Thinking...`,stopTask:`Stop task`,viewExecutionLog:`View execution log`,preparing:`Preparing...`,emptyModelReply:`The model returned no content. If you sent an image, make sure the selected model supports vision (image recognition requires a multimodal vision model), or switch model and retry.`,stopping:`Stopping...`,copyCode:`Copy code`,aborting:`Aborting...`,terminateCommandTitle:`Terminate Command Execution`,terminateCommandPrompt:`Please select a termination method:`,terminateWaitTitle:`Stop Waiting`,terminateWaitDesc:`Only stop waiting for command output; the background process continues running.<br/>Suitable for hanging services (e.g. npm run dev).`,terminateCommandBtnTitle:`Terminate Command`,terminateCommandBtnDesc:`Directly terminate the background command process and release resources.`,confirmDeleteMessage:`Confirm Delete Message`,deleteMessageWarning:`After deletion, the message will be removed from the conversation history and cannot be recovered.`,confirmDelete:`Confirm Delete`,quotedContextLabel:`💬 Quoted: {text}`,selectedContextLabel:`📌 Selected: {text}`,subtaskDone:`Done`,subtaskFailed:`Failed`,subtaskPartial:`Partial`,subtaskFailReason:`Interrupted: {error}`,subtaskExecuting:`Executing...`,subtaskPending:`Pending`,subtaskDescLabel:`Description: `,subtaskResultLabel:`Output summary: `,subtaskAllDone:`✓ All done`,subtaskReplaySkipped:`replay skipped`,subtaskReplaySkippedHint:`Already completed before the interruption; not re-run this round, so side effects do not apply twice`,subtaskFilterEmpty:`No nodes match this filter`,subtaskFilterHint:`Click to filter nodes by this status, click again to clear`,subtaskStatOtherHint:`Cancelled / unfinished nodes (denied confirmations, still running when the task ended). Click to filter`,subtaskPartialFail:`✗ {success}/{total} done, {fail} nodes failed`,unknownNode:`Unknown`,stopGeneration:`Stop generation`,toolResultTitle:`Execution Result`,reflectionInProgress:`Assessing quality...`,cannotGetMessageContent:`Cannot get message content`,editFailed:`Edit failed: {message}`,errTaskStopped:`Task stopped by user`,errTaskReplaced:`Task replaced by new request`,errSwRestarted:`Background service restarted unexpectedly, API call interrupted`,errTimeout:`Request timeout ({seconds}s)`,cancelBtn:`Cancel`}});var LC=`pendingCallApiSessions`;function RC(){chrome.storage.session.set({[LC]:[...C.pendingCallApiSessionIds]}).catch(()=>{})}async function zC(){try{let e=await chrome.storage.session.get([LC]);e[LC]&&Array.isArray(e[LC])&&(C.pendingCallApiSessionIds=new Set(e[LC]))}catch{}}function BC(e){if(Array.isArray(e))return e.filter(e=>e.type===`text`).map(e=>e.text).join(``);if(typeof e==`string`&&e.startsWith(`[`))try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(e=>e.type===`text`).map(e=>e.text).join(``)}catch{}return e}function VC(e){let t=BC(e);C.quotedContextText=t;let n=document.getElementById(`selectionIndicator`),i=document.getElementById(`selectionText`),a=document.getElementById(`userInput`);if(n&&i&&a){let e;e=t.length>100?t.substring(0,100)+`...`:t.length>50?t.substring(0,50)+`...`:t,i.textContent=r(`chat.quotedPrefix`,{text:e}),n.classList.add(`show`)}}function HC(){let e=document.getElementById(`selectionIndicator`),t=document.getElementById(`selectionText`);if(!e||!t)return;let n=(C.quotedContextText||``).trim(),i=(C.selectedContextText||``).trim(),a=n||i;if(!a){e.classList.remove(`show`);return}let o;o=a.length>100?a.substring(0,100)+`...`:a.length>50?a.substring(0,50)+`...`:a,t.textContent=r(n?`chatMsg.quotedContextLabel`:`chatMsg.selectedContextLabel`,{text:o}),e.classList.add(`show`)}function UC(){i.debug(`[SidePanel] clear selectedcontenttext `),C.selectedContextText=``,C.quotedContextText=``;let e=document.getElementById(`selectionIndicator`),t=document.getElementById(`userInput`);if(e&&(e.classList.remove(`show`),i.debug(`[SidePanel] hiddenselected contentprompt`)),typeof window.hideFloatingMenu==`function`&&window.hideFloatingMenu(),t&&t.value.startsWith(`[选中内容]`)){let e=t.value.split(`
|
|
1776
1777
|
`),n=e.findIndex(e=>e.startsWith(`[用户问题]`));n===-1?t.value=``:t.value=e.slice(n+1).join(`
|
|
1777
|
-
`).trim()}}var
|
|
1778
|
+
`).trim()}}var WC,GC=new Promise(e=>{WC=e});function KC(){C.activeSessionId&&document.dispatchEvent(new CustomEvent(`session-hydrated`,{detail:{sessionId:C.activeSessionId,workdir:C.sessionWorkdir||null}}))}async function qC(){try{await JC()}finally{WC(),document.dispatchEvent(new CustomEvent(`chat-history-rendered`,{detail:{sessionId:C.activeSessionId||null}}))}}async function JC(){let e=await ti();if(e.activeSessionId&&e.list.length>0){C.activeSessionId=e.activeSessionId,C.sessions=e.list;let t=e.list.find(t=>t.id===e.activeSessionId);if(t){if(C.messageHistory=t.messageHistory||[],C.activeCompaction=t.contextCompaction||null,ri(t),KC(),C.currentModel=t.model||C.currentModel,C.useTools=t.useTools===void 0?C.useTools:t.useTools,C.temperature=t.temperature===void 0?C.temperature:t.temperature,C.topP=t.topP===void 0?C.topP:t.topP,C.activeAgentId=t.agentId||null,C.activeAgentId&&C.activeAgentId!=="default"){try{let{getAgent:e}=await A(async()=>{let{getAgent:e}=await import(`./agent-store-QTeMyM9O.js`).then(e=>e.t);return{getAgent:e}},__vite__mapDeps([0,1,2,3])),t=await e(C.activeAgentId);t&&(C.activeAgentMcpExcludedServerIds=t.mcpExcludedServerIds??null,t.model&&(C.currentModel=t.model),t.temperature!==null&&t.temperature!==void 0&&(C.temperature=t.temperature,C.topP=t.topP!==null&&t.topP!==void 0?t.topP:1),document.dispatchEvent(new CustomEvent(`agent-model-changed`)))}catch{}C.activeAgentMcpExcludedServerIds=null}else{C.activeAgentMcpExcludedServerIds=null;try{let e=await chrome.storage.local.get([`modelName`,`temperature`,`topP`]);e.modelName&&(C.currentModel=e.modelName),e.temperature!==void 0&&(C.temperature=e.temperature),e.topP!==void 0&&(C.topP=e.topP)}catch{}document.dispatchEvent(new CustomEvent(`agent-model-changed`))}let e=`agentMcpClosedServers_${C.activeAgentId||`default`}`;C.mcpClosedServers=(await chrome.storage.local.get([e]))[e]||[]}let n=document.getElementById(`chatContainer`);n&&n.querySelectorAll(`.message, .user-context-bubble`).forEach(e=>e.remove()),C.messageHistory.forEach(e=>{let t=e.wasRevised;if(!t&&e.executionLog)try{t=(typeof e.executionLog==`string`?JSON.parse(e.executionLog):e.executionLog).some(e=>e.nodeType===`reflection`&&e.reflectionType===`post`&&e.action?.decision===`revised`)}catch{}if(e.role===`user`&&e.contextBubbles&&Array.isArray(e.contextBubbles)&&e.contextBubbles.forEach(e=>{let t=``;switch(e.type){case`skill`:t=r(`contextBubble.bubbleSkill`,{name:e.name,desc:e.description?`:`+e.description:``});break;case`mcp`:t=r(`contextBubble.bubbleMcp`,{name:e.serverName});break;case`page`:t=r(`contextBubble.bubblePage`,{title:e.title,url:e.url});break;case`file`:t=`${e.name} (${fm(e.size||0)})`;break;case`knowledge`:{let t=Array.isArray(e.refs)?e.refs:[];t.length>0&&nw(t,e.failed===!0);break}}t&&e.type!==`file`&&Sw(e.type,t,!1)}),e.htmlContent)Fw(e.htmlContent,e.messageId,e.resumable);else{let n=(e.contextBubbles||[]).filter(e=>e.type===`file`).map(e=>({name:e.name,size:e.size||0,type:e.fileType||``}));Ew(e.role,e.content,!1,e.executionLog||[],e.reflectionScore,t,null,e.messageId,n,e.resumable,e.timestamp??null)}}),kw(),jw(),st();let i=document.querySelector(`.welcome-message`);i&&C.messageHistory.length>0&&i.remove(),Ye(),it(),tD(),e.activeSessionId===C.activeSessionId?yo(e):yo(),await nS();let a=`scrollPosition_`+(C.activeSessionId||`default`);chrome.storage.local.get([a],e=>{e[a]!==void 0&&setTimeout(()=>{let t=document.getElementById(`chatContainer`);t.scrollTop=e[a]},100)})}else{await ai();let e=await ti();e.activeSessionId&&(C.activeSessionId=e.activeSessionId,C.sessions=e.list,ri(e.list.find(t=>t.id===e.activeSessionId)),KC()),yo(e)}}function YC(){try{ni().catch(e=>{i.error(`[SidePanel] save currentsession failed:`,e)})}catch(e){i.error(`[SidePanel] save conversationhistory exception:`,e)}}async function XC(){try{await ni()}catch(e){i.error(`[SidePanel] save conversationhistory exception:`,e)}}function ZC(){C.messageHistory&&C.messageHistory.length>0&&ui().then(()=>{C.messageHistory=[],C.activeCompaction=null;let e=document.getElementById(`chatContainer`);if(e){e.innerHTML=``;let t=document.createElement(`div`);t.className=`welcome-message`,t.innerHTML=`
|
|
1778
1779
|
<div class="icon-wrapper">
|
|
1779
1780
|
<div class="icon">💬</div>
|
|
1780
1781
|
</div>
|
|
1781
1782
|
<h2>${r(`chat.welcomeTitle`)}</h2>
|
|
1782
1783
|
<p>${r(`chat.welcomeSubtitle`)}</p>
|
|
1783
|
-
`,e.appendChild(t)}chrome.storage.local.remove(`scrollPosition_`+(C.activeSessionId||`default`)),yo()})}function
|
|
1784
|
+
`,e.appendChild(t)}chrome.storage.local.remove(`scrollPosition_`+(C.activeSessionId||`default`)),yo()})}function QC(){document.getElementById(`confirmModal`).classList.add(`show`)}function $C(){document.getElementById(`confirmModal`).classList.remove(`show`)}var ew=1500;async function tw(e,t){if(!t||t.length===0)return null;let{ragEnabled:n}=await chrome.storage.local.get(`ragEnabled`);if(n!==!0)return i.debug(`[SidePanel] RAG global switch off, skip knowledge context`),null;let a=await new Promise(n=>{try{chrome.runtime.sendMessage({type:`RAG_SEARCH`,params:{query:e,collectionIds:t.map(e=>e.id).filter(Boolean),topK:5}},e=>{if(chrome.runtime.lastError){n(null);return}n(e&&e.success?e:null)})}catch{n(null)}}),o=!a,s=a&&a.results||[],c=new Map(t.filter(e=>e.id).map(e=>[e.id,e.name])),l=new Map;s.forEach(e=>{let t=e.collectionId||``,n=l.get(t);n||(n={id:t,name:c.get(t)||t||r(`contextBubble.labelKnowledge`),hitCount:0,items:[]},l.set(t,n)),n.items.push(e),n.hitCount++});let u=Array.from(l.values()),d=s.length,f=e=>e.map(e=>{let t=String(e.content||``).trim();return{score:typeof e.score==`number`?e.score:Number(e.score)||0,content:t.slice(0,ew),truncated:t.length>ew,fullLength:t.length}}),p=t.map(e=>({id:e.id,name:e.name,hitCount:e.id&&l.get(e.id)?.hitCount||0,hits:e.id?f(l.get(e.id)?.items||[]):[]}));u.forEach(e=>{p.some(t=>t.id&&t.id===e.id)||p.push({id:e.id,name:e.name,hitCount:e.hitCount,hits:f(e.items)})});let m=[`[知识库检索结果](引用: ${t.map(e=>e.name).join(`、`)})`];return o?m.push(`知识库检索失败:检索服务暂时不可用(这不代表知识库中没有相关内容)。`):d===0?m.push(`未找到与问题相关的内容。`):u.forEach(e=>{m.push(``),m.push(`【${e.name}】`),e.items.forEach(e=>{let t=typeof e.score==`number`?e.score.toFixed(3):String(e.score??``);m.push(`· 相关度 ${t}`),m.push(String(e.content||``).trim().slice(0,ew)),m.push(``)})}),m.push(`[/知识库检索结果]`),{text:m.join(`
|
|
1784
1785
|
`)+`
|
|
1785
1786
|
|
|
1786
|
-
`,refs:p,failed:o}}function
|
|
1787
|
+
`,refs:p,failed:o}}function nw(e,t=!1){if(!Array.isArray(e)||e.length===0)return;let n=e.reduce((e,t)=>e+(t.hitCount||0),0);if(t){Sw(`knowledge`,r(`contextBubble.bubbleKnowledgeFailed`,{name:e.map(e=>e.name).join(`、`)}),!1);return}if(n===0){Sw(`knowledge`,r(`contextBubble.bubbleKnowledgeMiss`,{name:e.map(e=>e.name).join(`、`)}),!1);return}e.forEach(e=>{(e.hitCount||0)>0?Sw(`knowledge`,r(`contextBubble.bubbleKnowledge`,{name:e.name,count:e.hitCount}),!1,Array.isArray(e.hits)?e.hits:null):Sw(`knowledge`,r(`contextBubble.bubbleKnowledgeMiss`,{name:e.name}),!1)})}function rw(e,t,n,r=.8){return e===`failed`?!n||n<=0?`failed`:t/n>=r?`partial`:`failed`:e}function iw(e){let t=Array.isArray(e)?e:[],n=0,r=0;for(let e of t)e&&e.status===`success`?n++:e&&e.status===`failed`&&r++;return{total:t.length,success:n,failed:r,other:t.length-n-r}}function aw(e){let t=e&&e.nodeName?e.nodeName:r(`chatMsg.subtaskExecuting`);return P(String(t))}function ow(e,t){return(Array.isArray(e)?e:[]).some(e=>!!e&&e.nodeType===`subtask`&&e.subtaskIndex===t&&e.skippedReplay===!0)}function sw(e,t){return t!==`success`&&t!==`failed`&&t!==`other`?e||null:e===t?null:t}function cw(e,t){let n=Array.isArray(e)?e:[];return t!==`success`&&t!==`failed`&&t!==`other`?n:t===`other`?n.filter(e=>!e||e.status!==`success`&&e.status!==`failed`):n.filter(e=>e&&e.status===t)}var lw=`<svg class="subtask-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="17" rx="2"/><line x1="8" y1="2" x2="8" y2="4"/><line x1="16" y1="2" x2="16" y2="4"/><line x1="3" y1="10" x2="21" y2="10"/></svg>`,uw=`<svg class="subtask-chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>`;function dw(e){let t=Array.isArray(e)?e:[],n=null;for(let e of t)!e||e.nodeType!==`subtask_plan`||!Array.isArray(e.items)||(!n||new Date(e.timestamp||0)>=new Date(n.timestamp||0))&&(n=e);if(!n)return null;let r=n.items,i=r.filter(e=>e&&typeof e.index==`number`);return{total:n.subtaskTotal||r.length,items:i,timestamp:n.timestamp}}function fw(e,t){let n=e.description?String(e.description).replace(/\s+/g,` `).trim():``,i=n?`<div class="subtask-detail-desc"><span class="subtask-detail-label">${r(`chatMsg.subtaskDescLabel`)}</span>${P(n)}</div>`:``;return`
|
|
1787
1788
|
<div class="subtask-header">
|
|
1788
|
-
${
|
|
1789
|
+
${uw}${lw}${`<span class="subtask-badge">${e.index+1}/${t}</span>`}<span class="subtask-name" title="${nt(n)}">${P(e.name||``)}</span><span class="subtask-status-pending">${r(`chatMsg.subtaskPending`)}</span>
|
|
1789
1790
|
</div>
|
|
1790
1791
|
<div class="subtask-detail-body">${i}</div>
|
|
1791
|
-
`}function
|
|
1792
|
+
`}function pw(e){!e||e._clickDelegated||(e._clickDelegated=!0,e.addEventListener(`click`,t=>{let n=t.target.closest(`[data-node-filter]`);if(n){t.stopPropagation(),e._nodeFilter=sw(e._nodeFilter||null,n.dataset.nodeFilter),e._nodeFilter&&e.classList.add(`subtask-expanded`),e._renderNodes?.();return}t.target.closest(`.subtask-header`)&&e.classList.toggle(`subtask-expanded`)}))}function mw(e,t){let n=Number(t.dataset.subtaskIndex),r=Array.from(e.querySelectorAll(`.subtask-progress[data-subtask-index]`)).find(e=>Number(e.dataset.subtaskIndex)>n);r?e.insertBefore(t,r):e.appendChild(t)}function hw(e){let t=e||r(`chatResume.unknownError`),n=t.toLowerCase();return n.includes(`network`)||n.includes(`failed to fetch`)||n.includes(`load failed`)?r(`chat.networkError`):n.includes(`timeout`)||t.includes(`超时`)?r(`chat.timeoutError`,{message:t}):r(`chat.requestFailed`,{message:t})}var gw=Object.freeze({quotedContextText:``,selectedContextText:``,selectedSkills:[],selectedMcpServices:[],knowledgeRefs:[],selectedPage:null,attachedFiles:[],attachedImages:[]});function _w(){return{quotedContextText:C.quotedContextText||``,selectedContextText:C.selectedContextText||``,selectedSkills:(C.selectedSkills||[]).slice(),selectedMcpServices:(C.selectedMcpServices||[]).slice(),knowledgeRefs:(C.knowledgeRefs||[]).slice(),selectedPage:C.selectedPage||null,attachedFiles:(C.attachedFiles||[]).slice(),attachedImages:(C.attachedImages||[]).slice()}}async function vw(e={}){await GC;let t=document.getElementById(`userInput`),n=document.getElementById(`chatContainer`),a=e.sessionId||C.activeSessionId,o=a===C.activeSessionId,l=o?null:e.sessionState||{},u=o?C.messageHistory:l.messageHistory||[],d=e.context||(o?_w():gw),f=!e.context,h=o?C.currentModel:l.model||C.currentModel,g=o||l.useTools===void 0?C.useTools:l.useTools,_=o?C.enabledTools:l.enabledTools||C.enabledTools,v=o?C.activeCompaction:l.contextCompaction||null,y=String(e.text==null?t?.value||``:e.text).trim(),x=y||od(d);if(!x)return{ok:!1,reason:`empty`};if(o&&f&&dd())return F(r(`queue.filesStillExtracting`),`warning`,4e3),{ok:!1,reason:`files_extracting`};if(e.fromQueue||Uu(),C.generatingSessionIds.has(a))return{ok:!1,reason:`generating`};try{let e=await chrome.runtime.sendMessage({type:`QUERY_SESSION_RUNNING`,sessionId:a});if(e?.running===!0||Array.isArray(e?.activeSessionIds)&&e.activeSessionIds.includes(a)||e?.activeCallIds&&e.activeCallIds[a])return{ok:!1,reason:`generating`}}catch{}if($x(a),chrome.runtime.sendMessage({type:`DELETE_CHECKPOINT`,sessionId:a}),o&&await Xc({state:C,getRatio:()=>BE().usage?.ratio??0,compact:YE}),o){let e=n?.querySelector(`.welcome-message`);e&&e.remove()}let S=x,w=d.selectedContextText&&d.selectedContextText.trim(),T=d.quotedContextText&&d.quotedContextText.trim(),D=[];if(T){let e=d.quotedContextText.trim(),{compressed:t,wasCompressed:n}=m(e);S=`[引用内容${n?`摘要`:``}]\n${t}\n\n[用户问题]\n${x}`,o&&Sw(`quoted`,e,!1),D.push({type:`quoted`,text:e}),o&&f&&C.quotedContextText===d.quotedContextText&&(C.quotedContextText=``)}else if(w){let e=d.selectedContextText.trim(),{compressed:t,wasCompressed:n}=m(e);S=`[选中内容${n?`摘要`:``}]\n${t}\n\n[用户问题]\n${x}`,o&&Sw(`selected`,e,!1),D.push({type:`selected`,text:e}),o&&f&&C.selectedContextText===d.selectedContextText&&(C.selectedContextText=``)}let O=await jT(d.selectedSkills);if(O){S=O+S;for(let e of d.selectedSkills||[])o&&Sw(`skill`,r(`contextBubble.bubbleSkill`,{name:e.name,desc:e.description?`:`+e.description:``}),!1),D.push({type:`skill`,name:e.name,description:e.description||``});if(o){let e=new Set(d.selectedSkills||[]),t=C.selectedSkills.filter(t=>!e.has(t));t.length!==C.selectedSkills.length&&(C.selectedSkills=t,C.selectedSkillIndex=-1,TT(),ET())}}let k=null,A=RT(d.selectedMcpServices);if(A){let e=(d.selectedMcpServices||[]).map(e=>e.serverId).filter(Boolean);k=e.length>0?e:null,S=A+S;for(let e of d.selectedMcpServices||[])o&&Sw(`mcp`,r(`contextBubble.bubbleMcp`,{name:e.serverName}),!1),D.push({type:`mcp`,serverName:e.serverName,serverId:e.serverId||``});if(o){let e=new Set(d.selectedMcpServices||[]),t=C.selectedMcpServices.filter(t=>!e.has(t));t.length!==C.selectedMcpServices.length&&(C.selectedMcpServices=t,C.selectedMcpServiceIndex=-1,zT(),BT())}}if((d.knowledgeRefs||[]).length>0){let e=d.knowledgeRefs.slice();o&&(C.isGenerating=!0);let t=o?Sw(`knowledge`,r(`contextBubble.bubbleKnowledgeSearching`),!0):null,n=null;try{n=await tw(y||r(`sidePanel.defaultKnowledgeQuery`),e)}catch(e){i.warn(`[SidePanel] knowledge search failed:`,e)}if(t&&t.parentNode&&t.remove(),n&&(S=n.text+S,o&&nw(n.refs,n.failed===!0),D.push({type:`knowledge`,refs:n.refs,failed:n.failed||void 0})),o){let t=new Set(e),n=C.knowledgeRefs.filter(e=>!t.has(e));n.length!==C.knowledgeRefs.length&&(C.knowledgeRefs=n,Lb(),Vb())}}if(d.selectedPage){let e=d.selectedPage;S=`[网页上下文]\n标题: ${e.title}\nURL: ${e.url}\ntabId: ${e.id}\n`+S,o&&Sw(`page`,r(`contextBubble.bubblePage`,{title:e.title,url:e.url}),!1),D.push({type:`page`,title:e.title,url:e.url}),o&&C.selectedPage===d.selectedPage&&tx()}let M=!1,N=(d.attachedFiles||[]).slice();if(N.length>0){let e=Am(N);e&&(S+=e),N.forEach(e=>{e.status===`done`&&D.push({type:`file`,name:e.name,size:e.size,fileType:e.type})})}let ee=(d.attachedImages||[]).slice(),te=null;if(N.length>0||ee.length>0)try{te=await j(a,N,ee)}catch(e){i.warn(`[Chat] save doc image snapshot failed:`,e.message)}let ne=Te(te?.chatStart,te?.chatCount);ne&&(S+=ne);let re=`msg_`+Date.now().toString(36)+`_`+Math.random().toString(36).substring(2,8),ie=new Date().toISOString(),ae={role:`user`,content:Vp(S,d.attachedImages),messageId:re,timestamp:ie,contextBubbles:D};o?(Ew(`user`,Vp(x,d.attachedImages),!0,[],null,!1,S,re,N,!1,ie),C.messageHistory.push(ae),YC(),y&&cn(y),C.inputHistoryIndex=-1):u.push(ae),M=!0,o&&!e.fromQueue&&(t.value=``,t.style.height=`auto`),o&&(w||T)&&(!C.quotedContextText&&!C.selectedContextText?UC():HC()),C.generatingSessionIds.add(a),document.dispatchEvent(new CustomEvent(`generating-state-changed`));let oe=o?Mw():null,se=C.enableImageInput&&(d.attachedImages||[]).length>0&&C.imageModelName||h;if(o&&(d.attachedImages||[]).length>0){let e=new Set(d.attachedImages),t=C.attachedImages.filter(t=>!e.has(t));t.length!==C.attachedImages.length&&(C.attachedImages=t,Bp())}if(o&&N.length>0){let e=new Set(N),t=C.attachedFiles.filter(t=>!e.has(t));if(t.length!==C.attachedFiles.length){for(let t of C.attachedFiles)e.has(t)&&t.dataUrl&&URL.revokeObjectURL(t.dataUrl);C.attachedFiles=t,km()}}let ce=e=>{if(!o){u.push(e);return}if(C.activeSessionId!==a){_i(a,e);return}C.messageHistory.push(e)};try{await je();let e=await jE(o?C.activeAgentId:l.agentId||null),t=ME(e),n=e?.skillIds??null;o&&(C.activeAgentToolIds=t,C.activeAgentSkillIds=n,C.activeAgentMcpExcludedServerIds=e?e.mcpExcludedServerIds??null:null);let f={agentId:o?C.activeAgentId:l.agentId||null,agentToolIds:t,agentSkillIds:n,agentMcpExcludedServerIds:e?e.mcpExcludedServerIds??null:null};i.debug(`[SidePanel] sendmessagedebuginfo:`),i.debug(` - agent:`,e?e.name:`default assistant`),i.debug(` - agentToolIds:`,t),i.debug(` - isolateChat:`,C.isolateChat),i.debug(` - chatConfig:`,C.chatConfig),i.debug(` - messageHistory.length:`,u.length);let m=[{role:`system`,content:await Ke(e,{sessionId:a})}];if(C.isolateChat){let e=s(m[0]?.content||``),t=p(se,0,C.customModelMap)-e-4096-2e3;Math.floor(t*.7);let n=u[u.length-1],r=nn(u.slice(0,-1),{isolateChat:!0,maxMemoryMessages:C.chatConfig.maxMemoryMessages,compaction:v,currentMessage:n});an(m,r,v,i),r.historySummaryText&&(m[0]={...m[0],content:m[0].content+`
|
|
1792
1793
|
|
|
1793
|
-
`+r.historySummaryText}),i.debug(`[SidePanel] history selection: keep ${r.keptHistory.length}/${u.length-1}, trimmed ${r.trimmedCount}, compactionApplied: ${r.compactionApplied}`),m=[...m,...r.messages];for(let e=0;e<m.length-1;e++)m[e]={...m[e],content:Hp(m[e].content)}}else{let e=Vp(S,d.attachedImages);m.push({role:`user`,content:e})}let h=await Ge(o?null:{temperature:l.temperature,topP:l.topP});if(o&&(h._loadingId=oe),o)try{let e=await xf({sessionId:a,text:x,attachments:Sf(d)});e&&(h.goal=e)}catch(e){i.warn(`[SidePanel] prepare goal for send failed:`,e?.message)}let y=E(m),w=p(se,0,C.customModelMap),T=c(y,w);if(i.debug(`[SidePanel] send context: ${y} tokens (message: ${m.length} ), pressure: ${T.level}(${Math.round(T.ratio*100)}%)`),T.level===`critical`){i.warn(`[SidePanel] context pressure too high,maindynamictrimming...`);let e=s(m[0]?.content||``),t=await
|
|
1794
|
+
`+r.historySummaryText}),i.debug(`[SidePanel] history selection: keep ${r.keptHistory.length}/${u.length-1}, trimmed ${r.trimmedCount}, compactionApplied: ${r.compactionApplied}`),m=[...m,...r.messages];for(let e=0;e<m.length-1;e++)m[e]={...m[e],content:Hp(m[e].content)}}else{let e=Vp(S,d.attachedImages);m.push({role:`user`,content:e})}let h=await Ge(o?null:{temperature:l.temperature,topP:l.topP});if(o&&(h._loadingId=oe),o)try{let e=await xf({sessionId:a,text:x,attachments:Sf(d)});e&&(h.goal=e)}catch(e){i.warn(`[SidePanel] prepare goal for send failed:`,e?.message)}let y=E(m),w=p(se,0,C.customModelMap),T=c(y,w);if(i.debug(`[SidePanel] send context: ${y} tokens (message: ${m.length} ), pressure: ${T.level}(${Math.round(T.ratio*100)}%)`),T.level===`critical`){i.warn(`[SidePanel] context pressure too high,maindynamictrimming...`);let e=s(m[0]?.content||``),t=await Bw(k),n=(_.length+t)*200,r=w-e-n-4096-2e3,a=b(m,Math.max(r,2e3),{generateSummary:!1});m=a.messages,i.warn(`[SidePanel] proactively trimmed: ${y} → ${E(m)} tokens (${a.trimmedCount} )`)}let D,O,A,j=!1,M=!1,N=null,ee=!0,te=null,ne=!1;try{let e=await Vw(m,se,g,h,{forcedMcpServerIds:k,sessionId:a,agent:f});D=e.content,O=e.executionLog||[],A=e.reflectionScore,j=e.wasRevised||!1,M=e.wasStreamed||!1,N=e.streamingHtml||null,ee=e.streamingConnected===void 0?!0:e.streamingConnected,te=e.streamingMsgId||null,ne=e.budgetEnded===!0}catch(e){if(!o||C.activeSessionId!==a){let t=!!e.checkpoint||e.swRestarted||e.message===r(`chatMsg.errTaskStopped`);return ce({role:`assistant`,content:e.message===r(`chatMsg.errTaskStopped`)?r(`chatResume.taskCancelled`):e.swRestarted?r(`chat.taskInterruptedSwRestart`):hw(e.message),executionLog:e.executionLog||[],resumable:t}),document.dispatchEvent(new CustomEvent(`session-cache-invalidate`,{detail:{sessionId:a}})),oe&&Nw(oe),C.substituteLoadingIds.delete(a),{ok:!1,delivered:!0,reason:`inactive`}}if(e.message===r(`chatMsg.errTaskStopped`)){oe&&Nw(oe),C.substituteLoadingIds.delete(a);let{messageId:t}=Ew(`assistant`,r(`chatResume.taskCancelled`),!1,e.executionLog||[],null,!1,null,null,[],!0);return C.messageHistory.push({role:`assistant`,content:r(`chatResume.taskCancelled`),executionLog:e.executionLog||[],messageId:t,resumable:!0}),YC(),{ok:!1,delivered:!0,reason:`cancelled`}}if(e.swRestarted){oe&&Nw(oe),C.substituteLoadingIds.delete(a);let t=!!e.checkpoint,{messageId:n}=Ew(`assistant`,r(`chat.taskInterruptedSwRestart`),!1,e.executionLog||[],null,!1,null,null,[],t);return C.messageHistory.push({role:`assistant`,content:r(`chat.taskInterruptedSwRestart`),executionLog:e.executionLog||[],messageId:n,resumable:t}),YC(),Ol(a,r(`chat.taskInterruptedSwRestart`),x),{ok:!1,delivered:!0,reason:`sw_restarted`}}oe&&Nw(oe),C.substituteLoadingIds.delete(a),D=hw(e.message),O=e.executionLog||[];let{messageId:t}=Ew(`assistant`,D,!0,O,A,!1,null,null,[],!0);return C.messageHistory.push({role:`assistant`,content:D,executionLog:O,reflectionScore:A,messageId:t,resumable:!0}),Ol(a,D,x),{ok:!1,delivered:!0,reason:`error`}}if(!o||C.activeSessionId!==a){let e={role:`assistant`,content:D,executionLog:O,reflectionScore:A,wasRevised:j,resumable:ne?`budget`:!1,messageId:te||`msg_`+Date.now().toString(36)+`_`+Math.random().toString(36).substring(2,8)};return M&&N&&(e.htmlContent=N),ce(e),document.dispatchEvent(new CustomEvent(`session-cache-invalidate`,{detail:{sessionId:a}})),oe&&Nw(oe),C.substituteLoadingIds.delete(a),{ok:!0,delivered:!0}}let re=null;if(!M||!N)if(oe&&Nw(oe),C.substituteLoadingIds.has(a)&&(Nw(C.substituteLoadingIds.get(a)),C.substituteLoadingIds.delete(a)),M)C.substituteLoadingIds.has(a)&&(Nw(C.substituteLoadingIds.get(a)),C.substituteLoadingIds.delete(a)),re=te;else{let{element:e,messageId:t}=Ew(`assistant`,D,!0,O,A,j,null,null,[],ne?`budget`:!1);re=t,await lt(e),jS()}else re=te;ne&&tS(re?document.querySelector(`[data-message-id="${re}"]`):null,`budget`);let ie={role:`assistant`,content:D,executionLog:O,reflectionScore:A,wasRevised:j,resumable:ne?`budget`:!1,messageId:re};if(M&&N&&(ie.htmlContent=N,!ee&&!document.querySelector(`[data-message-id="${re}"]`))){Fw(N,re,ne?`budget`:!1),kw(),jw();let e=document.getElementById(`chatContainer`);e&&(e.scrollTop=e.scrollHeight)}return C.messageHistory.push(ie),Dl(a,x),{ok:!0,delivered:!0}}catch(e){return i.error(`[SidePanel] sendMessage exception:`,e?.message||e),{ok:!1,delivered:M,reason:e?.message||`exception`}}finally{o?YC():(await ii(a,{messageHistory:u,model:l.model,useTools:l.useTools,enabledTools:l.enabledTools,agentId:l.agentId,temperature:l.temperature,topP:l.topP,activeCompaction:l.contextCompaction,workdir:l.workdir,workdirAgentId:l.workdirAgentId,goalMode:l.goalMode}),document.dispatchEvent(new CustomEvent(`session-cache-invalidate`,{detail:{sessionId:a}}))),jl(a),o&&t.focus()}}function yw(e,t){let n=document.getElementById(`userInput`);if(!t||C.isGenerating){i.debug(`[SidePanel] triggerSelectionSearch skip:`,{hasText:!!t,isGenerating:C.isGenerating});return}C.selectedContextText=t,C.quotedContextText=``,n.value=r(`chatMsg.searchPrompt`),n.dispatchEvent(new Event(`input`)),vw()}function bw(e){let t=document.getElementById(`userInput`);!t||!e||(t.value=e,t.dispatchEvent(new Event(`input`)),t.focus())}async function xw(e,t=``){await GC;let n=document.getElementById(`userInput`);if(!(!n||!e)){if(t&&(C.selectedContextText=t,C.quotedContextText=``),C.isGenerating){n.value=e,n.dispatchEvent(new Event(`input`)),await hd();return}n.value=e,n.dispatchEvent(new Event(`input`)),n.focus(),vw()}}function Sw(e,t,n=!0,i=null){let a=document.getElementById(`chatContainer`),o=document.createElement(`div`);o.className=`user-context-bubble`,o.dataset.role=`context`;let s=e===`quoted`?`💬`:e===`skill`?`🧩`:e===`mcp`?`🔌`:e===`page`?`🌐`:e===`file`?`📎`:e===`knowledge`?`📚`:`📌`,c=r(e===`quoted`?`contextBubble.labelQuoted`:e===`skill`?`contextBubble.labelSkill`:e===`mcp`?`contextBubble.labelMcp`:e===`page`?`contextBubble.labelPage`:e===`file`?`contextBubble.labelFile`:e===`knowledge`?`contextBubble.labelKnowledge`:`contextBubble.labelSelection`),l=P(t);if(e===`knowledge`&&Array.isArray(i)&&i.length>0){let e=i.map(e=>{let t=typeof e.score==`number`?e.score.toFixed(3):``,n=t?`<span class="kb-bubble-hit-score">${t}</span>`:``,i=e.truncated?`<span class="kb-bubble-hit-truncated" title="${r(`contextBubble.kbHitTruncatedTitle`)}">${r(`contextBubble.kbHitTruncated`,{total:e.fullLength||0,kept:ew})}</span>`:``;return`<div class="kb-bubble-hit"><div class="kb-bubble-hit-text" title="${r(`contextBubble.kbHitToggle`)}">${n}${P(e.content||``)}</div>${i}</div>`}).join(``),n=i.filter(e=>e.truncated).length,a=n>0?`<span class="kb-bubble-truncated-badge">${r(`contextBubble.kbHitTruncatedBadge`,{count:n})}</span>`:``;l=`<div class="kb-bubble-summary">${P(t)}${a}</div>${e}`}o.innerHTML=`
|
|
1794
1795
|
<div class="context-bubble-inner">
|
|
1795
1796
|
<div class="context-bubble-header" title="${r(`contextBubble.clickToExpand`)}">
|
|
1796
1797
|
<span class="context-icon">${s}</span>
|
|
@@ -1798,7 +1799,7 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
1798
1799
|
</div>
|
|
1799
1800
|
<div class="context-bubble-content">${l}</div>
|
|
1800
1801
|
</div>
|
|
1801
|
-
`;let u=o.querySelector(`.context-bubble-header`),d=o.querySelector(`.context-bubble-content`);return u.addEventListener(`click`,e=>{e.stopPropagation(),d.classList.toggle(`expanded`)}),e===`knowledge`&&o.querySelectorAll(`.kb-bubble-hit-text`).forEach(e=>{e.addEventListener(`click`,t=>{t.stopPropagation(),e.classList.toggle(`expanded`)})}),a.appendChild(o),n&&(a.scrollTop=a.scrollHeight),o}function mw(e){let t=e,n;do n=t,t=t.replace(/^\[(?:已选技能|Selected skill): [^\]]+\]\n[\s\S]*?(?:请根据上述技能说明[\s\S]*?处理以下问题[::]|Please use the relevant tools[\s\S]*?handle the following problem[.:])\s*\n/,``).replace(/^\[(?:已选技能|Selected skill): [^\]]+\]\n(?:请|Please)[^\n]*(?:处理以下问题|handle the following problem)[^。\n]*。?\s*\n/,``);while(t!==n);return t}function hw(e){let t=e,n;do n=t,t=t.replace(/^\[(?:已选MCP服务|Selected MCP service):\s*[^\]]+\]\n(?:请使用「[^」]+」MCP服务来处理以下问题:|Please use the "[^"]+" MCP service to handle the following problem:)\s*\n/,``);while(t!==n);return t}var gw=e=>!!e&&e.dataset.resumable===`budget`;function _w(e,t,n=!0,a=[],o=null,s=!1,c=null,l=null,u=[],d=!1,f=void 0){let p=document.getElementById(`chatContainer`),m=document.createElement(`div`);m.className=`message ${e}`;let h=f===void 0?new Date().toISOString():f||null;h&&(m.dataset.timestamp=h);let g=l||`msg_`+Date.now().toString(36)+`_`+Math.random().toString(36).substring(2,8);m.dataset.messageId=g;let _=Array.isArray(t)?t.filter(e=>e.type===`text`).map(e=>e.text).join(``):t,v=e===`user`?fe(_):_,y=Array.isArray(t)&&t.some(e=>e.type===`image_url`);m.dataset.rawContent=Array.isArray(t)?JSON.stringify(t):dt(t),m.dataset.textContent_=dt(e===`user`?fe(c||v):c||v);let b=v;if(m.dataset.executionLog=JSON.stringify(a),s&&(m.dataset.wasRevised=`true`),e===`assistant`){m.innerHTML=$e(t);let e=document.createElement(`div`);e.className=`message-footer`;let n=document.createElement(`button`);n.className=`copy-btn`,n.title=r(`chatStream.copyMarkdown`),n.innerHTML=[`<svg viewBox="0 0 16 16" fill="currentColor">`,`<path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25zM5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25z"/>`,`</svg>`,`<span>${r(`common.copy`)}</span>`].join(``),n.addEventListener(`click`,e=>{e.stopPropagation(),Vx(m,n,e)}),e.appendChild(n);let c=document.createElement(`button`);c.className=`quote-btn`,c.title=r(`chat.quoteTitle`),c.innerHTML=[`<svg t="1781246498458" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9645" width="14" height="14"><path d="M156.09136 606.57001a457.596822 457.596822 0 0 1 221.680239-392.516385 50.844091 50.844091 0 1 1 50.844091 86.943396 355.90864 355.90864 0 0 0-138.804369 152.532274h16.77855a152.532274 152.532274 0 1 1-152.532274 152.532274z m406.752731 0a457.596822 457.596822 0 0 1 221.680239-392.007944 50.844091 50.844091 0 1 1 50.844091 86.943396 355.90864 355.90864 0 0 0-138.804369 152.532274h16.77855a152.532274 152.532274 0 1 1-152.532274 152.532274z" fill="#8a8a8a" p-id="9646"></path></svg>`,`<span>${r(`chat.quote`)}</span>`].join(``),c.addEventListener(`click`,e=>{e.stopPropagation(),Yx(m)}),e.appendChild(c),e.appendChild(xx());let l=document.createElement(`div`);l.className=`export-menu-container`;let u=document.createElement(`button`);u.className=`export-trigger-btn`,u.innerHTML=`<svg t="1781245244396" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5115" width="14" height="14"><path d="M496.213333 739.84c2.133333 2.133333 4.693333 3.84 7.68 5.12 0.853333 0.426667 2.133333 0.426667 2.986667 0.853333 1.706667 0.426667 2.986667 0.853333 4.693333 0.853334 5.546667 0 11.093333-2.133333 14.933334-6.4l256-256c8.533333-8.533333 8.533333-21.76 0-30.293334s-21.76-8.533333-30.293334 0L533.333333 674.133333V128c0-11.946667-9.386667-21.333333-21.333333-21.333333s-21.333333 9.386667-21.333333 21.333333v545.706667l-219.306667-219.306667c-8.533333-8.533333-21.76-8.533333-30.293333 0s-8.533333 21.76 0 30.293333l255.146666 255.146667zM768 874.666667H256c-11.946667 0-21.333333 9.386667-21.333333 21.333333s9.386667 21.333333 21.333333 21.333333h512c11.946667 0 21.333333-9.386667 21.333333-21.333333s-9.386667-21.333333-21.333333-21.333333z" fill="#8a8a8a" p-id="5116"></path></svg><span>${r(`chat.export`)}</span><svg class="dropdown-arrow" width="8" height="6" viewBox="0 0 8 6" fill="currentColor"><path d="M0 0l4 6 4-6z"/></svg>`;let f=document.createElement(`div`);f.className=`export-dropdown`,f.innerHTML=[`<button class="export-dropdown-item export-docx-item" type="button">`,`<svg t="1781245550030" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6544" width="32" height="32"><path d="M747.936 901.171H276.819c-72.2 0-130.953-55.224-130.953-123.078V244.721c0-67.854 58.752-123.078 130.953-123.078h383.525c6.597 0 12.937 2.505 17.795 6.954l192.363 178.046c5.317 4.96 8.386 11.914 8.386 19.227v452.223c0 67.854-58.752 123.078-130.952 123.078zM276.819 174.004c-43.31 0-78.592 31.703-78.592 70.717v533.372c0 39.015 35.282 70.718 78.592 70.718h471.117c43.31 0 78.592-31.703 78.592-70.718V337.324l-176.461-163.32H276.819z" fill="#8a8a8a" p-id="6545"></path><path d="M830.567 331.546H669.446c-14.471 0-26.18-11.71-26.18-26.181V156.209c0-14.471 11.709-26.18 26.18-26.18s26.181 11.709 26.181 26.18v122.976h134.94c14.471 0 26.181 11.709 26.181 26.18s-11.711 26.181-26.181 26.181z" fill="#8a8a8a" p-id="6546"></path><path d="M730.214 428.749l-92.04 343.616h-53.179L511.363 498.29l-75.677 274.074h-53.179l-92.04-343.616h49.088l69.542 255.667 69.541-255.667h63.406l69.541 255.667 69.541-255.667h49.088z" fill="#8a8a8a" p-id="6547"></path></svg>`,`<span>${r(`chatMsg.exportWord`)}</span>`,`</button>`,`<button class="export-dropdown-item export-pdf-item" type="button">`,`<svg t="1781245863206" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8152" width="32" height="32"><path d="M582.4 864H170.666667c-6.4 0-10.666667-4.266667-10.666667-10.666667V170.666667c0-6.4 4.266667-10.666667 10.666667-10.666667h309.333333V320c0 40.533333 34.133333 74.666667 74.666667 74.666667h160v38.4c0 17.066667 14.933333 32 32 32s32-14.933333 32-32V298.666667c0-8.533333-4.266667-17.066667-8.533334-23.466667l-170.666666-170.666667c-6.4-6.4-14.933333-8.533333-23.466667-8.533333H170.666667C130.133333 96 96 130.133333 96 170.666667v682.666666c0 40.533333 34.133333 74.666667 74.666667 74.666667h411.733333c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32z m132.266667-550.4v17.066667H554.666667c-6.4 0-10.666667-4.266667-10.666667-10.666667V160h19.2l151.466667 153.6z" fill="#8a8a8a" p-id="8153"></path><path d="M332.8 533.333333c-12.8 0-19.2 2.133333-25.6 6.4-6.4 4.266667-8.533333 12.8-8.533333 23.466667v206.933333c0 6.4 2.133333 12.8 6.4 19.2 4.266667 4.266667 10.666667 8.533333 21.333333 8.533334s17.066667-4.266667 21.333333-8.533334c4.266667-4.266667 6.4-10.666667 6.4-19.2v-64h32c57.6 0 89.6-29.866667 89.6-87.466666 0-27.733333-8.533333-51.2-23.466666-64-14.933333-14.933333-36.266667-21.333333-66.133334-21.333334h-53.333333z m87.466667 85.333334c0 12.8-2.133333 23.466667-8.533334 27.733333-4.266667 4.266667-14.933333 8.533333-27.733333 8.533333h-32v-70.4H384c12.8 0 21.333333 2.133333 27.733333 8.533334 6.4 4.266667 8.533333 12.8 8.533334 25.6zM667.733333 571.733333c-8.533333-12.8-21.333333-21.333333-34.133333-29.866666-14.933333-4.266667-32-8.533333-51.2-8.533334h-61.866667c-8.533333 0-17.066667 0-23.466666 8.533334-2.133333 4.266667-4.266667 10.666667-4.266667 19.2V768c0 8.533333 2.133333 14.933333 4.266667 19.2 6.4 8.533333 14.933333 8.533333 23.466666 8.533333h64c19.2 0 34.133333-4.266667 49.066667-10.666666 12.8-6.4 25.6-17.066667 34.133333-29.866667 8.533333-12.8 14.933333-25.6 19.2-42.666667 4.266667-14.933333 6.4-32 6.4-49.066666 0-17.066667-2.133333-34.133333-6.4-49.066667-4.266667-14.933333-10.666667-29.866667-19.2-42.666667z m-42.666666 153.6c-8.533333 12.8-21.333333 19.2-38.4 19.2h-38.4v-160H576c21.333333 0 38.4 6.4 46.933333 19.2 10.666667 12.8 14.933333 34.133333 14.933334 59.733334 2.133333 27.733333-4.266667 46.933333-12.8 61.866666zM851.2 533.333333h-106.666667c-8.533333 0-17.066667 2.133333-21.333333 6.4-6.4 4.266667-8.533333 12.8-8.533333 21.333334v209.066666c0 6.4 2.133333 12.8 6.4 17.066667 4.266667 6.4 10.666667 8.533333 21.333333 8.533333 8.533333 0 17.066667-2.133333 21.333333-8.533333 2.133333-4.266667 6.4-8.533333 6.4-19.2v-85.333333h72.533334c12.8 0 23.466667-6.4 25.6-17.066667 2.133333-8.533333 2.133333-14.933333 0-17.066667-2.133333-4.266667-6.4-17.066667-25.6-17.066666H768v-49.066667h81.066667c8.533333 0 14.933333-2.133333 19.2-4.266667 4.266667-2.133333 8.533333-8.533333 8.533333-21.333333 2.133333-12.8-8.533333-23.466667-25.6-23.466667z" fill="#8a8a8a" p-id="8154"></path></svg>`,`<span>${r(`chatMsg.exportPdf`)}</span>`,`</button>`,`<button class="export-dropdown-item export-image-item" type="button">`,`<svg t="1784207887308" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5993" width="32" height="32"><path d="M400.696 268.795c-17.249 0-31.233 13.986-31.233 31.233v30.471c0 17.249 13.986 31.233 31.233 31.233s31.233-13.986 31.233-31.233v-30.471c0-17.249-13.985-31.233-31.233-31.233z" fill="#8a8a8a" p-id="5994"></path><path d="M623.649 361.734c17.249 0 31.234-13.986 31.234-31.233v-30.471c0-17.249-13.986-31.233-31.234-31.233s-31.233 13.986-31.233 31.233v30.471c-0.001 17.248 13.985 31.233 31.233 31.233z" fill="#8a8a8a" p-id="5995"></path><path d="M438.295 388.804c-14.656 9.104-19.155 28.362-10.050 43.013 11.209 18.047 41.976 48.59 86.157 48.59 43.958 0 75.1-30.313 86.574-48.223 9.303-14.529 5.068-33.847-9.455-43.15-14.539-9.298-33.852-5.068-43.15 9.455-0.122 0.199-13.38 19.45-33.969 19.45-20.009 0-32.444-18.128-33.278-19.373-9.166-14.423-28.28-18.805-42.829-9.761z" fill="#8a8a8a" p-id="5996"></path><path d="M824.508503 116.690676 571.592236 116.690676c-17.248849 0-31.233352 13.985526-31.233352 31.233352s13.985526 31.233352 31.233352 31.233352l252.916267 0c40.181141 0 72.878844 32.692586 72.878844 72.878844l0 396.966057-189.334159-165.29465c-12.20088-10.655687-30.517037-10.207479-42.173518 0.9967L468.578048 674.16231 309.521472 517.519714c-11.895935-11.70253-30.903847-12.002358-43.154869-0.645706L126.957507 646.163629l0-394.126382c0-40.186258 32.692586-72.878844 72.878844-72.878844l252.916267 0c17.248849 0 31.233352-13.985526 31.233352-31.233352S470.000444 116.690676 452.751594 116.690676L199.836351 116.690676c-74.632791 0-135.346571 60.71378-135.346571 135.346571l0 520.56405c0 74.632791 60.71378 135.346571 135.346571 135.346571l252.916267 0c17.248849 0 31.233352-13.985526 31.233352-31.233352s-13.985526-31.233352-31.233352-31.233352L199.836351 845.481164c-40.186258 0-72.878844-32.692586-72.878844-72.878844l0-41.23924 160.003134-148.385539 159.428036 157.007917c12.048407 11.865235 31.361265 11.981892 43.546795 0.274246l198.576661-190.68697 208.876238 182.346001 0 40.683585c0 40.186258-32.697703 72.878844-72.878844 72.878844L571.592236 845.481164c-17.248849 0-31.233352 13.985526-31.233352 31.233352s13.985526 31.233352 31.233352 31.233352l252.916267 0c74.627674 0 135.346571-60.71378 135.346571-135.346571L959.855074 252.037247C959.855074 177.404456 899.136178 116.690676 824.508503 116.690676z" fill="#8a8a8a" p-id="5997"></path></svg>`,`<span>${r(`chatMsg.exportImage`)}</span>`,`</button>`,`<button class="export-dropdown-item export-md-item" type="button">`,`<svg t="1784038824502" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1666" width="32" height="32"><path d="M601.216 85.333333a42.666667 42.666667 0 0 1 30.485333 12.821334l209.450667 213.973333a42.666667 42.666667 0 0 1 12.181333 29.866667V853.333333a85.333333 85.333333 0 0 1-85.333333 85.333334H256a85.333333 85.333333 0 0 1-85.333333-85.333334V170.666667a85.333333 85.333333 0 0 1 85.333333-85.333334h345.216z m-35.584 64H256a21.333333 21.333333 0 0 0-21.333333 21.333334v682.666666a21.333333 21.333333 0 0 0 21.333333 21.333334h512a21.333333 21.333333 0 0 0 21.333333-21.333334V395.413333h-191.68a32 32 0 0 1-32-32L565.632 149.333333z m64 38.186667v143.893333h140.821333L629.632 187.52z" fill="#8a8a8a" p-id="1667"></path><path d="M384.341333 800l-3.072-0.106667a32 32 0 0 1-29.162666-34.624l21.973333-256c2.752-32.256 46.165333-40.490667 60.544-11.477333l77.290667 156.010667 78.805333-156.224c14.08-27.925333 55.082667-20.906667 60.074667 8.789333l0.384 3.050667 20.714666 256a32 32 0 0 1-63.786666 5.162666l-11.541334-142.549333-56.341333 111.722667c-11.413333 22.613333-42.88 23.381333-55.744 2.517333l-1.493333-2.730667-54.912-110.826666-12.181334 142.016a32 32 0 0 1-31.552 29.269333z" fill="#8a8a8a" p-id="1668"></path></svg>`,`<span>${r(`chatMsg.exportMarkdown`)}</span>`,`</button>`].join(``);let p=f.querySelector(`.export-docx-item`);p.addEventListener(`click`,async e=>{e.stopPropagation();let{exportAssistantMessageToDocx:t}=await A(async()=>{let{exportAssistantMessageToDocx:e}=await import(`./chat-export-CCgB_PeN.js`);return{exportAssistantMessageToDocx:e}},__vite__mapDeps([9,10,1,11,2,3,0]));t(m,p,f)});let h=f.querySelector(`.export-md-item`);h.addEventListener(`click`,async e=>{e.stopPropagation();let{exportAssistantMessageToMarkdown:t}=await A(async()=>{let{exportAssistantMessageToMarkdown:e}=await import(`./chat-export-CCgB_PeN.js`);return{exportAssistantMessageToMarkdown:e}},__vite__mapDeps([9,10,1,11,2,3,0]));t(m,h,f)});let _=f.querySelector(`.export-pdf-item`);_.addEventListener(`click`,async e=>{e.stopPropagation();let{exportAssistantMessageToPdf:t}=await A(async()=>{let{exportAssistantMessageToPdf:e}=await import(`./chat-export-CCgB_PeN.js`);return{exportAssistantMessageToPdf:e}},__vite__mapDeps([9,10,1,11,2,3,0]));t(m,_,f)});let v=f.querySelector(`.export-image-item`);v.addEventListener(`click`,async e=>{e.stopPropagation();let{exportAssistantMessageToImage:t}=await A(async()=>{let{exportAssistantMessageToImage:e}=await import(`./chat-export-CCgB_PeN.js`);return{exportAssistantMessageToImage:e}},__vite__mapDeps([9,10,1,11,2,3,0]));t(m,v,f)}),u.addEventListener(`click`,e=>{e.stopPropagation(),document.querySelectorAll(`.export-dropdown.show`).forEach(e=>{e!==f&&e.classList.remove(`show`)}),f.classList.toggle(`show`)});let y=null;l.addEventListener(`mouseenter`,()=>{y=setTimeout(()=>{document.querySelectorAll(`.export-dropdown.show`).forEach(e=>{e!==f&&e.classList.remove(`show`)}),f.classList.add(`show`)},300)}),l.addEventListener(`mouseleave`,()=>{y&&=(clearTimeout(y),null),setTimeout(()=>{!l.matches(`:hover`)&&!f.matches(`:hover`)&&f.classList.remove(`show`)},100)}),l.appendChild(u),l.appendChild(f),e.appendChild(l);let b=document.createElement(`div`);b.className=`footer-right-actions`,b.style.marginLeft=`auto`,b.style.display=`flex`,b.style.alignItems=`center`,b.style.gap=`8px`;let x=Pe(a);if(x){let e=document.createElement(`span`);e.className=`token-usage-tag`,e.title=r(`chatStream.tokenUsageTitle`,{total:I(x.totalTokens),prompt:I(x.promptTokens),completion:I(x.completionTokens)}),e.innerHTML=`<span class="token-tag-icon">⬤</span><span class="token-tag-value">${I(x.totalTokens)}</span>`,e.style.cursor=`pointer`,e.addEventListener(`click`,t=>{t.stopPropagation(),qe(x,e)}),b.appendChild(e)}let S=a&&a.length>0,w=o!=null,T=a?a.filter(e=>e.nodeType===`reflection`&&e.reflectionType===`post`&&e.status===`success`).length:0;bw(),Sw(),st();let E=a?.find(e=>e.nodeType===`reflection`&&e.reflectionType===`post`),D=Vy(t),O=Wy(a,t);if(D.length&&(m.dataset.declaredArtifacts=JSON.stringify(D)),cb(O),console.log(`[addMessage] executionLog entries:`,a?.length,`| agent_file entries:`,a?.filter(e=>e.nodeType===`tool_exec`&&e.action?.name===`agent_file`).length,`| artifacts:`,O.length),O.length>0){let e=document.createElement(`button`);e.className=`artifacts-btn`,e.type=`button`,e.title=r(`artifacts.btnTitle`,{count:O.length}),e.innerHTML=`
|
|
1802
|
+
`;let u=o.querySelector(`.context-bubble-header`),d=o.querySelector(`.context-bubble-content`);return u.addEventListener(`click`,e=>{e.stopPropagation(),d.classList.toggle(`expanded`)}),e===`knowledge`&&o.querySelectorAll(`.kb-bubble-hit-text`).forEach(e=>{e.addEventListener(`click`,t=>{t.stopPropagation(),e.classList.toggle(`expanded`)})}),a.appendChild(o),n&&(a.scrollTop=a.scrollHeight),o}function Cw(e){let t=e,n;do n=t,t=t.replace(/^\[(?:已选技能|Selected skill): [^\]]+\]\n[\s\S]*?(?:请根据上述技能说明[\s\S]*?处理以下问题[::]|Please use the relevant tools[\s\S]*?handle the following problem[.:])\s*\n/,``).replace(/^\[(?:已选技能|Selected skill): [^\]]+\]\n(?:请|Please)[^\n]*(?:处理以下问题|handle the following problem)[^。\n]*。?\s*\n/,``);while(t!==n);return t}function ww(e){let t=e,n;do n=t,t=t.replace(/^\[(?:已选MCP服务|Selected MCP service):\s*[^\]]+\]\n(?:请使用「[^」]+」MCP服务来处理以下问题:|Please use the "[^"]+" MCP service to handle the following problem:)\s*\n/,``);while(t!==n);return t}var Tw=e=>!!e&&e.dataset.resumable===`budget`;function Ew(e,t,n=!0,a=[],o=null,s=!1,c=null,l=null,u=[],d=!1,f=void 0){let p=document.getElementById(`chatContainer`),m=document.createElement(`div`);m.className=`message ${e}`;let h=f===void 0?new Date().toISOString():f||null;h&&(m.dataset.timestamp=h);let g=l||`msg_`+Date.now().toString(36)+`_`+Math.random().toString(36).substring(2,8);m.dataset.messageId=g;let _=Array.isArray(t)?t.filter(e=>e.type===`text`).map(e=>e.text).join(``):t,v=e===`user`?fe(_):_,y=Array.isArray(t)&&t.some(e=>e.type===`image_url`);m.dataset.rawContent=Array.isArray(t)?JSON.stringify(t):dt(t),m.dataset.textContent_=dt(e===`user`?fe(c||v):c||v);let b=v;if(m.dataset.executionLog=JSON.stringify(a),s&&(m.dataset.wasRevised=`true`),e===`assistant`){m.innerHTML=$e(t);let e=document.createElement(`div`);e.className=`message-footer`;let n=document.createElement(`button`);n.className=`copy-btn`,n.title=r(`chatStream.copyMarkdown`),n.innerHTML=[`<svg viewBox="0 0 16 16" fill="currentColor">`,`<path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25zM5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25z"/>`,`</svg>`,`<span>${r(`common.copy`)}</span>`].join(``),n.addEventListener(`click`,e=>{e.stopPropagation(),Vx(m,n,e)}),e.appendChild(n);let c=document.createElement(`button`);c.className=`quote-btn`,c.title=r(`chat.quoteTitle`),c.innerHTML=[`<svg t="1781246498458" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9645" width="14" height="14"><path d="M156.09136 606.57001a457.596822 457.596822 0 0 1 221.680239-392.516385 50.844091 50.844091 0 1 1 50.844091 86.943396 355.90864 355.90864 0 0 0-138.804369 152.532274h16.77855a152.532274 152.532274 0 1 1-152.532274 152.532274z m406.752731 0a457.596822 457.596822 0 0 1 221.680239-392.007944 50.844091 50.844091 0 1 1 50.844091 86.943396 355.90864 355.90864 0 0 0-138.804369 152.532274h16.77855a152.532274 152.532274 0 1 1-152.532274 152.532274z" fill="#8a8a8a" p-id="9646"></path></svg>`,`<span>${r(`chat.quote`)}</span>`].join(``),c.addEventListener(`click`,e=>{e.stopPropagation(),Yx(m)}),e.appendChild(c),e.appendChild(xx());let l=document.createElement(`div`);l.className=`export-menu-container`;let u=document.createElement(`button`);u.className=`export-trigger-btn`,u.innerHTML=`<svg t="1781245244396" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5115" width="14" height="14"><path d="M496.213333 739.84c2.133333 2.133333 4.693333 3.84 7.68 5.12 0.853333 0.426667 2.133333 0.426667 2.986667 0.853333 1.706667 0.426667 2.986667 0.853333 4.693333 0.853334 5.546667 0 11.093333-2.133333 14.933334-6.4l256-256c8.533333-8.533333 8.533333-21.76 0-30.293334s-21.76-8.533333-30.293334 0L533.333333 674.133333V128c0-11.946667-9.386667-21.333333-21.333333-21.333333s-21.333333 9.386667-21.333333 21.333333v545.706667l-219.306667-219.306667c-8.533333-8.533333-21.76-8.533333-30.293333 0s-8.533333 21.76 0 30.293333l255.146666 255.146667zM768 874.666667H256c-11.946667 0-21.333333 9.386667-21.333333 21.333333s9.386667 21.333333 21.333333 21.333333h512c11.946667 0 21.333333-9.386667 21.333333-21.333333s-9.386667-21.333333-21.333333-21.333333z" fill="#8a8a8a" p-id="5116"></path></svg><span>${r(`chat.export`)}</span><svg class="dropdown-arrow" width="8" height="6" viewBox="0 0 8 6" fill="currentColor"><path d="M0 0l4 6 4-6z"/></svg>`;let f=document.createElement(`div`);f.className=`export-dropdown`,f.innerHTML=[`<button class="export-dropdown-item export-docx-item" type="button">`,`<svg t="1781245550030" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6544" width="32" height="32"><path d="M747.936 901.171H276.819c-72.2 0-130.953-55.224-130.953-123.078V244.721c0-67.854 58.752-123.078 130.953-123.078h383.525c6.597 0 12.937 2.505 17.795 6.954l192.363 178.046c5.317 4.96 8.386 11.914 8.386 19.227v452.223c0 67.854-58.752 123.078-130.952 123.078zM276.819 174.004c-43.31 0-78.592 31.703-78.592 70.717v533.372c0 39.015 35.282 70.718 78.592 70.718h471.117c43.31 0 78.592-31.703 78.592-70.718V337.324l-176.461-163.32H276.819z" fill="#8a8a8a" p-id="6545"></path><path d="M830.567 331.546H669.446c-14.471 0-26.18-11.71-26.18-26.181V156.209c0-14.471 11.709-26.18 26.18-26.18s26.181 11.709 26.181 26.18v122.976h134.94c14.471 0 26.181 11.709 26.181 26.18s-11.711 26.181-26.181 26.181z" fill="#8a8a8a" p-id="6546"></path><path d="M730.214 428.749l-92.04 343.616h-53.179L511.363 498.29l-75.677 274.074h-53.179l-92.04-343.616h49.088l69.542 255.667 69.541-255.667h63.406l69.541 255.667 69.541-255.667h49.088z" fill="#8a8a8a" p-id="6547"></path></svg>`,`<span>${r(`chatMsg.exportWord`)}</span>`,`</button>`,`<button class="export-dropdown-item export-pdf-item" type="button">`,`<svg t="1781245863206" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8152" width="32" height="32"><path d="M582.4 864H170.666667c-6.4 0-10.666667-4.266667-10.666667-10.666667V170.666667c0-6.4 4.266667-10.666667 10.666667-10.666667h309.333333V320c0 40.533333 34.133333 74.666667 74.666667 74.666667h160v38.4c0 17.066667 14.933333 32 32 32s32-14.933333 32-32V298.666667c0-8.533333-4.266667-17.066667-8.533334-23.466667l-170.666666-170.666667c-6.4-6.4-14.933333-8.533333-23.466667-8.533333H170.666667C130.133333 96 96 130.133333 96 170.666667v682.666666c0 40.533333 34.133333 74.666667 74.666667 74.666667h411.733333c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32z m132.266667-550.4v17.066667H554.666667c-6.4 0-10.666667-4.266667-10.666667-10.666667V160h19.2l151.466667 153.6z" fill="#8a8a8a" p-id="8153"></path><path d="M332.8 533.333333c-12.8 0-19.2 2.133333-25.6 6.4-6.4 4.266667-8.533333 12.8-8.533333 23.466667v206.933333c0 6.4 2.133333 12.8 6.4 19.2 4.266667 4.266667 10.666667 8.533333 21.333333 8.533334s17.066667-4.266667 21.333333-8.533334c4.266667-4.266667 6.4-10.666667 6.4-19.2v-64h32c57.6 0 89.6-29.866667 89.6-87.466666 0-27.733333-8.533333-51.2-23.466666-64-14.933333-14.933333-36.266667-21.333333-66.133334-21.333334h-53.333333z m87.466667 85.333334c0 12.8-2.133333 23.466667-8.533334 27.733333-4.266667 4.266667-14.933333 8.533333-27.733333 8.533333h-32v-70.4H384c12.8 0 21.333333 2.133333 27.733333 8.533334 6.4 4.266667 8.533333 12.8 8.533334 25.6zM667.733333 571.733333c-8.533333-12.8-21.333333-21.333333-34.133333-29.866666-14.933333-4.266667-32-8.533333-51.2-8.533334h-61.866667c-8.533333 0-17.066667 0-23.466666 8.533334-2.133333 4.266667-4.266667 10.666667-4.266667 19.2V768c0 8.533333 2.133333 14.933333 4.266667 19.2 6.4 8.533333 14.933333 8.533333 23.466666 8.533333h64c19.2 0 34.133333-4.266667 49.066667-10.666666 12.8-6.4 25.6-17.066667 34.133333-29.866667 8.533333-12.8 14.933333-25.6 19.2-42.666667 4.266667-14.933333 6.4-32 6.4-49.066666 0-17.066667-2.133333-34.133333-6.4-49.066667-4.266667-14.933333-10.666667-29.866667-19.2-42.666667z m-42.666666 153.6c-8.533333 12.8-21.333333 19.2-38.4 19.2h-38.4v-160H576c21.333333 0 38.4 6.4 46.933333 19.2 10.666667 12.8 14.933333 34.133333 14.933334 59.733334 2.133333 27.733333-4.266667 46.933333-12.8 61.866666zM851.2 533.333333h-106.666667c-8.533333 0-17.066667 2.133333-21.333333 6.4-6.4 4.266667-8.533333 12.8-8.533333 21.333334v209.066666c0 6.4 2.133333 12.8 6.4 17.066667 4.266667 6.4 10.666667 8.533333 21.333333 8.533333 8.533333 0 17.066667-2.133333 21.333333-8.533333 2.133333-4.266667 6.4-8.533333 6.4-19.2v-85.333333h72.533334c12.8 0 23.466667-6.4 25.6-17.066667 2.133333-8.533333 2.133333-14.933333 0-17.066667-2.133333-4.266667-6.4-17.066667-25.6-17.066666H768v-49.066667h81.066667c8.533333 0 14.933333-2.133333 19.2-4.266667 4.266667-2.133333 8.533333-8.533333 8.533333-21.333333 2.133333-12.8-8.533333-23.466667-25.6-23.466667z" fill="#8a8a8a" p-id="8154"></path></svg>`,`<span>${r(`chatMsg.exportPdf`)}</span>`,`</button>`,`<button class="export-dropdown-item export-image-item" type="button">`,`<svg t="1784207887308" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5993" width="32" height="32"><path d="M400.696 268.795c-17.249 0-31.233 13.986-31.233 31.233v30.471c0 17.249 13.986 31.233 31.233 31.233s31.233-13.986 31.233-31.233v-30.471c0-17.249-13.985-31.233-31.233-31.233z" fill="#8a8a8a" p-id="5994"></path><path d="M623.649 361.734c17.249 0 31.234-13.986 31.234-31.233v-30.471c0-17.249-13.986-31.233-31.234-31.233s-31.233 13.986-31.233 31.233v30.471c-0.001 17.248 13.985 31.233 31.233 31.233z" fill="#8a8a8a" p-id="5995"></path><path d="M438.295 388.804c-14.656 9.104-19.155 28.362-10.050 43.013 11.209 18.047 41.976 48.59 86.157 48.59 43.958 0 75.1-30.313 86.574-48.223 9.303-14.529 5.068-33.847-9.455-43.15-14.539-9.298-33.852-5.068-43.15 9.455-0.122 0.199-13.38 19.45-33.969 19.45-20.009 0-32.444-18.128-33.278-19.373-9.166-14.423-28.28-18.805-42.829-9.761z" fill="#8a8a8a" p-id="5996"></path><path d="M824.508503 116.690676 571.592236 116.690676c-17.248849 0-31.233352 13.985526-31.233352 31.233352s13.985526 31.233352 31.233352 31.233352l252.916267 0c40.181141 0 72.878844 32.692586 72.878844 72.878844l0 396.966057-189.334159-165.29465c-12.20088-10.655687-30.517037-10.207479-42.173518 0.9967L468.578048 674.16231 309.521472 517.519714c-11.895935-11.70253-30.903847-12.002358-43.154869-0.645706L126.957507 646.163629l0-394.126382c0-40.186258 32.692586-72.878844 72.878844-72.878844l252.916267 0c17.248849 0 31.233352-13.985526 31.233352-31.233352S470.000444 116.690676 452.751594 116.690676L199.836351 116.690676c-74.632791 0-135.346571 60.71378-135.346571 135.346571l0 520.56405c0 74.632791 60.71378 135.346571 135.346571 135.346571l252.916267 0c17.248849 0 31.233352-13.985526 31.233352-31.233352s-13.985526-31.233352-31.233352-31.233352L199.836351 845.481164c-40.186258 0-72.878844-32.692586-72.878844-72.878844l0-41.23924 160.003134-148.385539 159.428036 157.007917c12.048407 11.865235 31.361265 11.981892 43.546795 0.274246l198.576661-190.68697 208.876238 182.346001 0 40.683585c0 40.186258-32.697703 72.878844-72.878844 72.878844L571.592236 845.481164c-17.248849 0-31.233352 13.985526-31.233352 31.233352s13.985526 31.233352 31.233352 31.233352l252.916267 0c74.627674 0 135.346571-60.71378 135.346571-135.346571L959.855074 252.037247C959.855074 177.404456 899.136178 116.690676 824.508503 116.690676z" fill="#8a8a8a" p-id="5997"></path></svg>`,`<span>${r(`chatMsg.exportImage`)}</span>`,`</button>`,`<button class="export-dropdown-item export-md-item" type="button">`,`<svg t="1784038824502" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1666" width="32" height="32"><path d="M601.216 85.333333a42.666667 42.666667 0 0 1 30.485333 12.821334l209.450667 213.973333a42.666667 42.666667 0 0 1 12.181333 29.866667V853.333333a85.333333 85.333333 0 0 1-85.333333 85.333334H256a85.333333 85.333333 0 0 1-85.333333-85.333334V170.666667a85.333333 85.333333 0 0 1 85.333333-85.333334h345.216z m-35.584 64H256a21.333333 21.333333 0 0 0-21.333333 21.333334v682.666666a21.333333 21.333333 0 0 0 21.333333 21.333334h512a21.333333 21.333333 0 0 0 21.333333-21.333334V395.413333h-191.68a32 32 0 0 1-32-32L565.632 149.333333z m64 38.186667v143.893333h140.821333L629.632 187.52z" fill="#8a8a8a" p-id="1667"></path><path d="M384.341333 800l-3.072-0.106667a32 32 0 0 1-29.162666-34.624l21.973333-256c2.752-32.256 46.165333-40.490667 60.544-11.477333l77.290667 156.010667 78.805333-156.224c14.08-27.925333 55.082667-20.906667 60.074667 8.789333l0.384 3.050667 20.714666 256a32 32 0 0 1-63.786666 5.162666l-11.541334-142.549333-56.341333 111.722667c-11.413333 22.613333-42.88 23.381333-55.744 2.517333l-1.493333-2.730667-54.912-110.826666-12.181334 142.016a32 32 0 0 1-31.552 29.269333z" fill="#8a8a8a" p-id="1668"></path></svg>`,`<span>${r(`chatMsg.exportMarkdown`)}</span>`,`</button>`].join(``);let p=f.querySelector(`.export-docx-item`);p.addEventListener(`click`,async e=>{e.stopPropagation();let{exportAssistantMessageToDocx:t}=await A(async()=>{let{exportAssistantMessageToDocx:e}=await import(`./chat-export-DduslUlT.js`);return{exportAssistantMessageToDocx:e}},__vite__mapDeps([9,10,1,11,2,3,0]));t(m,p,f)});let h=f.querySelector(`.export-md-item`);h.addEventListener(`click`,async e=>{e.stopPropagation();let{exportAssistantMessageToMarkdown:t}=await A(async()=>{let{exportAssistantMessageToMarkdown:e}=await import(`./chat-export-DduslUlT.js`);return{exportAssistantMessageToMarkdown:e}},__vite__mapDeps([9,10,1,11,2,3,0]));t(m,h,f)});let _=f.querySelector(`.export-pdf-item`);_.addEventListener(`click`,async e=>{e.stopPropagation();let{exportAssistantMessageToPdf:t}=await A(async()=>{let{exportAssistantMessageToPdf:e}=await import(`./chat-export-DduslUlT.js`);return{exportAssistantMessageToPdf:e}},__vite__mapDeps([9,10,1,11,2,3,0]));t(m,_,f)});let v=f.querySelector(`.export-image-item`);v.addEventListener(`click`,async e=>{e.stopPropagation();let{exportAssistantMessageToImage:t}=await A(async()=>{let{exportAssistantMessageToImage:e}=await import(`./chat-export-DduslUlT.js`);return{exportAssistantMessageToImage:e}},__vite__mapDeps([9,10,1,11,2,3,0]));t(m,v,f)}),u.addEventListener(`click`,e=>{e.stopPropagation(),document.querySelectorAll(`.export-dropdown.show`).forEach(e=>{e!==f&&e.classList.remove(`show`)}),f.classList.toggle(`show`)});let y=null;l.addEventListener(`mouseenter`,()=>{y=setTimeout(()=>{document.querySelectorAll(`.export-dropdown.show`).forEach(e=>{e!==f&&e.classList.remove(`show`)}),f.classList.add(`show`)},300)}),l.addEventListener(`mouseleave`,()=>{y&&=(clearTimeout(y),null),setTimeout(()=>{!l.matches(`:hover`)&&!f.matches(`:hover`)&&f.classList.remove(`show`)},100)}),l.appendChild(u),l.appendChild(f),e.appendChild(l);let b=document.createElement(`div`);b.className=`footer-right-actions`,b.style.marginLeft=`auto`,b.style.display=`flex`,b.style.alignItems=`center`,b.style.gap=`8px`;let x=Pe(a);if(x){let e=document.createElement(`span`);e.className=`token-usage-tag`,e.title=r(`chatStream.tokenUsageTitle`,{total:I(x.totalTokens),prompt:I(x.promptTokens),completion:I(x.completionTokens)}),e.innerHTML=`<span class="token-tag-icon">⬤</span><span class="token-tag-value">${I(x.totalTokens)}</span>`,e.style.cursor=`pointer`,e.addEventListener(`click`,t=>{t.stopPropagation(),qe(x,e)}),b.appendChild(e)}let S=a&&a.length>0,w=o!=null,T=a?a.filter(e=>e.nodeType===`reflection`&&e.reflectionType===`post`&&e.status===`success`).length:0;kw(),jw(),st();let E=a?.find(e=>e.nodeType===`reflection`&&e.reflectionType===`post`),D=Vy(t),O=Wy(a,t);if(D.length&&(m.dataset.declaredArtifacts=JSON.stringify(D)),cb(O),console.log(`[addMessage] executionLog entries:`,a?.length,`| agent_file entries:`,a?.filter(e=>e.nodeType===`tool_exec`&&e.action?.name===`agent_file`).length,`| artifacts:`,O.length),O.length>0){let e=document.createElement(`button`);e.className=`artifacts-btn`,e.type=`button`,e.title=r(`artifacts.btnTitle`,{count:O.length}),e.innerHTML=`
|
|
1802
1803
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="14" height="14">
|
|
1803
1804
|
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
|
|
1804
1805
|
<polyline points="14 2 14 8 20 8"/>
|
|
@@ -1820,12 +1821,12 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
1820
1821
|
<polyline points="3 6 5 6 21 6"></polyline>
|
|
1821
1822
|
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
|
|
1822
1823
|
</svg>
|
|
1823
|
-
`,N.addEventListener(`click`,e=>{e.stopPropagation(),
|
|
1824
|
+
`,N.addEventListener(`click`,e=>{e.stopPropagation(),zw(m)}),b.appendChild(N),e.appendChild(b),m.appendChild(e),d&&tS(m,d)}else{let e=b;e=e.replace(/^\[网页上下文\]\n标题: .+\nURL: .+\ntabId: \d+\n/,``),e=e.replace(/\[知识库检索结果\][^\n]*\n[\s\S]*?\[\/知识库检索结果\]\n\n?/,``),e=ww(e),e=Cw(e);let n=e.match(/^\[引用内容(?:摘要)?\]\n([\s\S]+?)\n\n\[用户问题\]\n([\s\S]*)$/),i=e.match(/^\[选中内容(?:摘要)?\]\n([\s\S]+?)\n\n\[用户问题\]\n([\s\S]*)$/),a=n||i;if(a){let e=n?`quoted`:`selected`,t=a[1].trim(),r=a[2].trim();if(u&&u.length>0){let e=r.search(/\n\n\[(?:工作目录)?文件(?:内容)?:/);e!==-1&&(r=r.substring(0,e))}r=r.replace(/^\[网页上下文\]\n标题: .+\nURL: .+\ntabId: \d+\n/,``),r=ww(r),r=Cw(r),r=r.replace(/\[工作目录文件: [^\]]+\]/g,``),m._pendingContext={type:e,contextText:t,userQuestion:r},m.textContent=r}else{let e=b;if(u&&u.length>0){let t=e.search(/\n\n\[(?:工作目录)?文件(?:内容)?:/);t!==-1&&(e=e.substring(0,t))}e=e.replace(/^\[网页上下文\]\n标题: .+\nURL: .+\ntabId: \d+\n/,``),e=e.replace(/\[知识库检索结果\][^\n]*\n[\s\S]*?\[\/知识库检索结果\]\n\n?/,``),e=ww(e),e=Cw(e),e=e.replace(/\[工作目录文件: [^\]]+\]/g,``),m.textContent=e}if(y){let e=document.createElement(`div`);e.className=`user-message-images`,t.filter(e=>e.type===`image_url`).forEach((t,n)=>{let i=document.createElement(`img`),a=t.image_url.original_url||t.image_url.url;i.src=a,i.className=`user-message-image`,i.title=r(`chatMsg.clickToEnlarge`),i.addEventListener(`click`,()=>{jp(a,i)}),e.appendChild(i)}),m.appendChild(e)}if(u&&u.length>0){m.dataset.attachedFiles=JSON.stringify(u.map(e=>({name:e.name,size:e.size,type:e.type,text:e.text,status:e.status,agentPath:e.agentPath||``})));let e=document.createElement(`div`);e.className=`user-message-files`;let t=u.filter(e=>e.status===`done`),n=u.filter(e=>e.status!==`done`);[...t,...n].forEach(t=>{let n=document.createElement(`span`);n.className=`user-message-file-tag ${t.status}`,n.textContent=`${dm(t.name)} ${t.name} (${fm(t.size)})`,t.status===`extracting`?n.textContent+=r(`chatMsg.fileExtracting`):t.status===`error`&&(n.textContent+=r(`chatMsg.fileFailed`),n.title=t.error||r(`chatMsg.fileExtractFailed`)),e.appendChild(n)}),m.appendChild(e)}let o=document.createElement(`div`);o.className=`message-toolbar`;let s=document.createElement(`button`);s.className=`message-toolbar-btn copy-btn`,s.title=r(`chatMsg.copyMessageTitle`),s.innerHTML=[`<svg viewBox="0 0 16 16" fill="currentColor">`,`<path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25zM5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25z"/>`,`</svg>`].join(``),s.addEventListener(`click`,e=>{e.stopPropagation(),Bx(m,s)});let c=document.createElement(`button`);c.className=`message-toolbar-btn edit-btn`,c.title=r(`chatMsg.editAndResend`),c.innerHTML=[`<svg viewBox="0 0 16 16" fill="currentColor">`,`<path d="M12.146.146a.5.5 0 0 1 .708 0l2.5 2.5a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12h.5a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5h-.5a.5.5 0 0 1-.468-.325z"/>`,`</svg>`].join(``),c.addEventListener(`click`,e=>{e.stopPropagation(),Hw(m)}),o.appendChild(s),o.appendChild(c);let l=document.createElement(`button`);if(l.className=`message-toolbar-btn delete-btn`,l.title=r(`chatMsg.deleteMessageTitle`),l.innerHTML=`
|
|
1824
1825
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1825
1826
|
<polyline points="3 6 5 6 21 6"></polyline>
|
|
1826
1827
|
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
|
|
1827
1828
|
</svg>
|
|
1828
|
-
`,l.addEventListener(`click`,e=>{e.stopPropagation(),
|
|
1829
|
+
`,l.addEventListener(`click`,e=>{e.stopPropagation(),zw(m)}),o.appendChild(l),m.appendChild(o),h){m.classList.add(`has-time`);let e=document.createElement(`time`);e.className=`message-time`,e.dateTime=h,e.textContent=Le(h),e.title=ze(h),m.appendChild(e)}}if(p.appendChild(m),m._pendingContext){let{type:e,contextText:t}=m._pendingContext,n=Sw(e,t,!1);p.insertBefore(n,m),delete m._pendingContext}return n&&DS(p,{smooth:!0}),e===`assistant`&&it(),{element:m,messageId:g,timestamp:h}}function Dw(e){let t=document.getElementById(`chatContainer`);t&&t.classList.toggle(`timestamps-hidden`,e===!1)}var Ow=!1;function kw(){if(Ow)return;let e=document.getElementById(`chatContainer`);e&&(e.addEventListener(`click`,e=>{let t=e.target.closest(`.execution-log-btn`);if(!t)return;let n=t.closest(`.message`);if(!n)return;e.preventDefault(),e.stopPropagation();let r=n.dataset.executionLog;if(r)try{let e=JSON.parse(r);i.debug(`[chat-manager] exec log buttonclick(delegate), entries:`,e.length),Zx(e)}catch(e){i.error(`[chat-manager] parse executionLog failed:`,e)}}),Ow=!0)}var Aw=!1;function jw(){if(Aw)return;let e=document.getElementById(`chatContainer`);e&&(e.addEventListener(`click`,e=>{let t=e.target.closest(`.reflection-score-btn`);if(!t)return;e.preventDefault(),e.stopPropagation();let n=t.dataset.reflectionData;if(n)try{Xx(JSON.parse(n),t)}catch(e){i.error(`[chat-manager] parse reflectionData failed:`,e)}}),Aw=!0)}function Mw(){let e=document.getElementById(`chatContainer`),t=`loading-`+Date.now(),n=document.createElement(`div`);n.className=`loading-message`,n.id=t,n.innerHTML=`
|
|
1829
1830
|
<div class="loading-content">
|
|
1830
1831
|
<div class="loading-dots">
|
|
1831
1832
|
<span></span>
|
|
@@ -1849,7 +1850,7 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
1849
1850
|
<span class="current-node-name">${r(`chatMsg.preparing`)}</span>
|
|
1850
1851
|
</div>
|
|
1851
1852
|
</div>
|
|
1852
|
-
`,e.appendChild(n),requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight});let a=n.querySelector(`.stop-task-btn`),o=n.querySelector(`.loading-text`);a&&a.addEventListener(`click`,e=>{e.stopPropagation(),a.disabled=!0,a.style.opacity=`0.6`,a.style.cursor=`not-allowed`,o&&(o.textContent=r(`chatMsg.stopping`)),chrome.runtime.sendMessage({type:`CANCEL_REACT`,tabId:null,sessionId:C.activeSessionId}),C.pendingCancelApi&&C.pendingCancelApi({message:r(`chatMsg.errTaskStopped`),executionLog:C.currentExecutionStatus?.executionLog||[]})});let s=C.activeSessionId;if(C.executionLogListener=(e,n,r)=>e.sessionId&&e.sessionId!==s?!1:e.type===`EXECUTION_STATUS_UPDATE`?(i.debug(`[SidePanel] recei to execution statusupdate:`,e.nodeName,e.status,`log count:`,e.executionLog?.length),Zf(t,e.nodeName,e.status,e.executionLog),!1):!1,chrome.runtime.onMessage.addListener(C.executionLogListener),C.chatConfig.enableExecutionLog){let e=n.querySelector(`.execution-status-container`);e&&(e.style.display=`flex`)}let c=n.querySelector(`.execution-log-toggle-btn`);return c&&c.addEventListener(`click`,e=>{e.stopPropagation(),Xf(t)}),t}function
|
|
1853
|
+
`,e.appendChild(n),requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight});let a=n.querySelector(`.stop-task-btn`),o=n.querySelector(`.loading-text`);a&&a.addEventListener(`click`,e=>{e.stopPropagation(),a.disabled=!0,a.style.opacity=`0.6`,a.style.cursor=`not-allowed`,o&&(o.textContent=r(`chatMsg.stopping`)),chrome.runtime.sendMessage({type:`CANCEL_REACT`,tabId:null,sessionId:C.activeSessionId}),C.pendingCancelApi&&C.pendingCancelApi({message:r(`chatMsg.errTaskStopped`),executionLog:C.currentExecutionStatus?.executionLog||[]})});let s=C.activeSessionId;if(C.executionLogListener=(e,n,r)=>e.sessionId&&e.sessionId!==s?!1:e.type===`EXECUTION_STATUS_UPDATE`?(i.debug(`[SidePanel] recei to execution statusupdate:`,e.nodeName,e.status,`log count:`,e.executionLog?.length),Zf(t,e.nodeName,e.status,e.executionLog),!1):!1,chrome.runtime.onMessage.addListener(C.executionLogListener),C.chatConfig.enableExecutionLog){let e=n.querySelector(`.execution-status-container`);e&&(e.style.display=`flex`)}let c=n.querySelector(`.execution-log-toggle-btn`);return c&&c.addEventListener(`click`,e=>{e.stopPropagation(),Xf(t)}),t}function Nw(e){let t=document.getElementById(e);if(t){let e=t.querySelector(`.loading-text`);e&&(e.textContent=r(`chatMsg.thinking`)),t.remove()}C.executionLogListener&&=(chrome.runtime.onMessage.removeListener(C.executionLogListener),null),C.currentExecutionStatus=null;let n=document.querySelector(`.execution-log-panel.realtime-mode`);n&&n.remove()}function Pw(e){if(!e)return;let t=By((()=>{try{let t=e.dataset.executionLog;return t?JSON.parse(t):[]}catch{return[]}})()),n=[];try{n=JSON.parse(e.dataset.declaredArtifacts||`[]`)}catch{n=[]}let i=n.length?Uy(t,n):t;if(cb(i),Qe(e,i.map(e=>e.path)).catch(()=>{}),i.length===0)return;let a=e.querySelector(`.artifacts-btn`);if(!a){let t=e.querySelector(`.footer-right-actions`);if(!t)return;a=document.createElement(`button`),a.className=`artifacts-btn`,a.type=`button`,a.title=r(`artifacts.btnTitle`,{count:i.length}),a.innerHTML=`
|
|
1853
1854
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="14" height="14">
|
|
1854
1855
|
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
|
|
1855
1856
|
<polyline points="14 2 14 8 20 8"/>
|
|
@@ -1857,15 +1858,15 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
1857
1858
|
<line x1="9" y1="15" x2="15" y2="15"/>
|
|
1858
1859
|
</svg>
|
|
1859
1860
|
<span class="artifacts-btn-count">${i.length}</span>
|
|
1860
|
-
`;let n=t.querySelector(`.execution-log-btn`);n?t.insertBefore(a,n):t.prepend(a)}a._artifactsBound||(a.addEventListener(`click`,e=>{e.stopPropagation(),lb(i,a)}),a._artifactsBound=!0,sb(i,a))}function
|
|
1861
|
+
`;let n=t.querySelector(`.execution-log-btn`);n?t.insertBefore(a,n):t.prepend(a)}a._artifactsBound||(a.addEventListener(`click`,e=>{e.stopPropagation(),lb(i,a)}),a._artifactsBound=!0,sb(i,a))}function Fw(e,t=null,n=!1){let a=document.getElementById(`chatContainer`);if(!a||!e)return;let o=document.createElement(`div`);o.innerHTML=e;let s=o.firstElementChild;if(!s)return;t&&(s.dataset.messageId=t),n&&tS(s,n),s.classList.remove(`streaming`);let c=s.querySelector(`.thinking-process-header`);c&&NS(c),s.querySelectorAll(`.tool-call-header`).forEach(e=>{e.addEventListener(`click`,t=>{t.ctrlKey||t.metaKey||e.closest(`.tool-call-item`).classList.toggle(`expanded`)})}),s.querySelectorAll(`.tool-call-result`).forEach(e=>{let t=e.querySelector(`code`);if(!t)return;let n=t.dataset.fullContent;if(!n||n.length<=500)return;let r=t.textContent||``,i=!1;e.style.cursor=`pointer`,e.addEventListener(`click`,e=>{e.ctrlKey||e.metaKey||(e.stopPropagation(),i=!i,t.textContent=i?n:r)})}),s.querySelectorAll(`.tool-call-body > pre, .tool-result-content > pre, .agent-stream-output > pre`).forEach(e=>{if(e.parentElement.classList.contains(`code-block-container`))return;let t=document.createElement(`div`);t.className=`code-block-container`,t.style.position=`relative`,t.innerHTML=`<button class="code-copy-btn" title="${r(`chatMsg.copyCode`)}">
|
|
1861
1862
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
1862
1863
|
<path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25zM5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25z"/>
|
|
1863
1864
|
</svg>
|
|
1864
|
-
</button>`,e.parentElement.insertBefore(t,e),t.appendChild(e)}),s.querySelectorAll(`.subtask-progress`).forEach(e=>{
|
|
1865
|
+
</button>`,e.parentElement.insertBefore(t,e),t.appendChild(e)}),s.querySelectorAll(`.subtask-progress`).forEach(e=>{pw(e)}),s.querySelectorAll(`.tool-call-terminate-btn, .agent-stream-terminate-btn`).forEach(e=>{e.addEventListener(`click`,e=>{e.stopPropagation(),Lw(C.activeSessionId)})}),s.querySelectorAll(`.tool-call-abort-btn`).forEach(e=>{e.addEventListener(`click`,t=>{t.stopPropagation(),chrome.runtime.sendMessage({type:`ABORT_CURRENT_TOOL`,sessionId:C.activeSessionId}),e.disabled=!0,e.title=r(`chatMsg.aborting`)})});let l=s.querySelector(`.message-footer`);if(l){let e=l.querySelector(`.copy-btn`);e&&e.addEventListener(`click`,t=>{t.stopPropagation(),Vx(s,e,t)});let t=l.querySelector(`.quote-btn`);t&&t.addEventListener(`click`,e=>{e.stopPropagation(),Yx(s)});let n=l.querySelector(`.export-trigger-btn`),r=l.querySelector(`.export-dropdown`);n&&r&&(n.addEventListener(`click`,e=>{e.stopPropagation(),document.querySelectorAll(`.export-dropdown.show`).forEach(e=>{e!==r&&e.classList.remove(`show`)}),r.classList.toggle(`show`)}),r.querySelector(`.export-docx-item`)?.addEventListener(`click`,async e=>{e.stopPropagation();let t=e.currentTarget,{exportAssistantMessageToDocx:n}=await A(async()=>{let{exportAssistantMessageToDocx:e}=await import(`./chat-export-DduslUlT.js`);return{exportAssistantMessageToDocx:e}},__vite__mapDeps([9,10,1,11,2,3,0]));n(s,t,r)}),r.querySelector(`.export-md-item`)?.addEventListener(`click`,async e=>{e.stopPropagation();let t=e.currentTarget,{exportAssistantMessageToMarkdown:n}=await A(async()=>{let{exportAssistantMessageToMarkdown:e}=await import(`./chat-export-DduslUlT.js`);return{exportAssistantMessageToMarkdown:e}},__vite__mapDeps([9,10,1,11,2,3,0]));n(s,t,r)}),r.querySelector(`.export-pdf-item`)?.addEventListener(`click`,async e=>{e.stopPropagation();let t=e.currentTarget,{exportAssistantMessageToPdf:n}=await A(async()=>{let{exportAssistantMessageToPdf:e}=await import(`./chat-export-DduslUlT.js`);return{exportAssistantMessageToPdf:e}},__vite__mapDeps([9,10,1,11,2,3,0]));n(s,t,r)}),r.querySelector(`.export-image-item`)?.addEventListener(`click`,async e=>{e.stopPropagation();let t=e.currentTarget,{exportAssistantMessageToImage:n}=await A(async()=>{let{exportAssistantMessageToImage:e}=await import(`./chat-export-DduslUlT.js`);return{exportAssistantMessageToImage:e}},__vite__mapDeps([9,10,1,11,2,3,0]));n(s,t,r)}));let a=l.querySelector(`.prototype-btn-small`);if(a){let e=(()=>{try{let e=s.dataset.executionLog;return e?JSON.parse(e):[]}catch{return[]}})().find(e=>e.nodeType===`tool_exec`&&e.action?.name===`preview_ui`||e.action?.name===`preview_preview_ui`&&e.status===`success`);e&&a.addEventListener(`click`,()=>{let t=e.prototypeId;if(!t&&e.observation)try{t=(typeof e.observation==`string`?JSON.parse(e.observation):e.observation)?.prototypeId}catch{}t?Cc(t):i.error(`[SidePanel] not found prototypeId,entry keys:`,Object.keys(e),`observation:`,e.observation)})}let o=l.querySelector(`.bookmark-btn`);o&&(Km(o,C.activeSessionId,s.dataset.messageId),o.addEventListener(`click`,async e=>{e.stopPropagation();let t=C.activeSessionId,n=s.dataset.messageId;if(o.classList.contains(`bookmarked`)){await Pm(t,n),Km(o,t,n);let{refreshBookmarkPanel:e}=await A(async()=>{let{refreshBookmarkPanel:e}=await Promise.resolve().then(()=>Rm);return{refreshBookmarkPanel:e}},void 0);e()}else{await Nm(t,n,s.dataset.textContent_||``,C.sessions.find(e=>e.id===t)?.title||``),Km(o,t,n);let{refreshBookmarkPanel:e}=await A(async()=>{let{refreshBookmarkPanel:e}=await Promise.resolve().then(()=>Rm);return{refreshBookmarkPanel:e}},void 0);e()}}));let c=l.querySelector(`.delete-btn`);c&&c.addEventListener(`click`,e=>{e.stopPropagation(),zw(s)});let u=l.querySelector(`.fork-btn`);u&&u.addEventListener(`click`,async e=>{e.stopPropagation();let t=s.dataset.messageId;t&&await Xs(C.activeSessionId,t)});let d=l.querySelector(`.resume-task-btn`);d&&d.addEventListener(`click`,async e=>{if(e.stopPropagation(),d.disabled)return;let t=await Qx({budgetEnded:Tw(s)});t!==null&&(d.disabled=!0,d.style.opacity=`0.6`,d.style.cursor=`not-allowed`,rS(C.activeSessionId,t).finally(()=>{d.disabled=!1,d.style.opacity=``,d.style.cursor=``}))}),Pw(s);let f=l.querySelector(`.token-usage-tag`);f&&!f._clickBound&&(f._clickBound=!0,f.style.cursor=`pointer`,f.addEventListener(`click`,e=>{e.stopPropagation();try{let e=s.dataset.executionLog,t=Pe(e?JSON.parse(e):[]);t&&qe(t,f)}catch{}}))}let u=s.querySelector(`.message-toolbar`);if(u){let e=u.querySelector(`.edit-btn`);e&&e.addEventListener(`click`,e=>{e.stopPropagation(),Hw(s)});let t=u.querySelector(`.copy-btn`);t&&t.addEventListener(`click`,e=>{e.stopPropagation(),Bx(s,t)});let n=u.querySelector(`.delete-btn`);n&&n.addEventListener(`click`,e=>{e.stopPropagation(),zw(s)})}s.querySelectorAll(`.user-message-image`).forEach(e=>{e.addEventListener(`click`,()=>{jp(e.src,e)})}),a.appendChild(s),tD()}function Iw(e){e.querySelectorAll(`.tool-call-body > pre, .tool-result-content > pre, .agent-stream-output > pre`).forEach(e=>{if(e.parentElement.classList.contains(`code-block-container`))return;let t=document.createElement(`div`);t.className=`code-block-container`,t.style.position=`relative`,t.innerHTML=`<button class="code-copy-btn" title="${r(`chatMsg.copyCode`)}">
|
|
1865
1866
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
1866
1867
|
<path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25zM5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25z"/>
|
|
1867
1868
|
</svg>
|
|
1868
|
-
</button>`,e.parentElement.insertBefore(t,e),t.appendChild(e)}),e.querySelectorAll(`.thinking-process-header`).forEach(e=>{NS(e)}),e.querySelectorAll(`.tool-call-header`).forEach(e=>{e.addEventListener(`click`,t=>{if(t.ctrlKey||t.metaKey)return;let n=e.closest(`.tool-call-item`);n&&n.classList.toggle(`expanded`)})}),e.querySelectorAll(`.tool-call-result`).forEach(e=>{let t=e.querySelector(`code`);if(!t)return;let n=t.dataset.fullContent;if(!n||n.length<=500)return;let r=t.textContent||``,i=!1;e.style.cursor=`pointer`,e.addEventListener(`click`,e=>{e.ctrlKey||e.metaKey||(e.stopPropagation(),i=!i,t.textContent=i?n:r)})}),e.querySelectorAll(`.subtask-progress`).forEach(e=>{
|
|
1869
|
+
</button>`,e.parentElement.insertBefore(t,e),t.appendChild(e)}),e.querySelectorAll(`.thinking-process-header`).forEach(e=>{NS(e)}),e.querySelectorAll(`.tool-call-header`).forEach(e=>{e.addEventListener(`click`,t=>{if(t.ctrlKey||t.metaKey)return;let n=e.closest(`.tool-call-item`);n&&n.classList.toggle(`expanded`)})}),e.querySelectorAll(`.tool-call-result`).forEach(e=>{let t=e.querySelector(`code`);if(!t)return;let n=t.dataset.fullContent;if(!n||n.length<=500)return;let r=t.textContent||``,i=!1;e.style.cursor=`pointer`,e.addEventListener(`click`,e=>{e.ctrlKey||e.metaKey||(e.stopPropagation(),i=!i,t.textContent=i?n:r)})}),e.querySelectorAll(`.subtask-progress`).forEach(e=>{pw(e)}),e.querySelectorAll(`.tool-call-terminate-btn, .agent-stream-terminate-btn`).forEach(e=>{e.addEventListener(`click`,e=>{e.stopPropagation(),Lw(C.activeSessionId)})}),e.querySelectorAll(`.tool-call-abort-btn`).forEach(e=>{e.addEventListener(`click`,t=>{t.stopPropagation(),chrome.runtime.sendMessage({type:`ABORT_CURRENT_TOOL`,sessionId:C.activeSessionId}),e.disabled=!0,e.title=r(`chatMsg.aborting`)})}),e.querySelectorAll(`.message-footer`).forEach(e=>{let t=e.closest(`.message`);if(!t)return;let n=e.querySelector(`.copy-btn`);n&&n.addEventListener(`click`,e=>{e.stopPropagation(),Vx(t,n,e)});let r=e.querySelector(`.quote-btn`);r&&r.addEventListener(`click`,e=>{e.stopPropagation(),Yx(t)});let i=e.querySelector(`.export-trigger-btn`),a=e.querySelector(`.export-dropdown`);i&&a&&(i.addEventListener(`click`,e=>{e.stopPropagation(),document.querySelectorAll(`.export-dropdown.show`).forEach(e=>{e!==a&&e.classList.remove(`show`)}),a.classList.toggle(`show`)}),a.querySelector(`.export-docx-item`)?.addEventListener(`click`,async e=>{e.stopPropagation();let n=e.currentTarget,{exportAssistantMessageToDocx:r}=await A(async()=>{let{exportAssistantMessageToDocx:e}=await import(`./chat-export-DduslUlT.js`);return{exportAssistantMessageToDocx:e}},__vite__mapDeps([9,10,1,11,2,3,0]));r(t,n,a)}),a.querySelector(`.export-md-item`)?.addEventListener(`click`,async e=>{e.stopPropagation();let n=e.currentTarget,{exportAssistantMessageToMarkdown:r}=await A(async()=>{let{exportAssistantMessageToMarkdown:e}=await import(`./chat-export-DduslUlT.js`);return{exportAssistantMessageToMarkdown:e}},__vite__mapDeps([9,10,1,11,2,3,0]));r(t,n,a)}),a.querySelector(`.export-pdf-item`)?.addEventListener(`click`,async e=>{e.stopPropagation();let n=e.currentTarget,{exportAssistantMessageToPdf:r}=await A(async()=>{let{exportAssistantMessageToPdf:e}=await import(`./chat-export-DduslUlT.js`);return{exportAssistantMessageToPdf:e}},__vite__mapDeps([9,10,1,11,2,3,0]));r(t,n,a)}),a.querySelector(`.export-image-item`)?.addEventListener(`click`,async e=>{e.stopPropagation();let n=e.currentTarget,{exportAssistantMessageToImage:r}=await A(async()=>{let{exportAssistantMessageToImage:e}=await import(`./chat-export-DduslUlT.js`);return{exportAssistantMessageToImage:e}},__vite__mapDeps([9,10,1,11,2,3,0]));r(t,n,a)}));let o=e.querySelector(`.prototype-btn-small`);if(o){let e=(()=>{try{let e=t.dataset.executionLog;return e?JSON.parse(e):[]}catch{return[]}})().find(e=>e.nodeType===`tool_exec`&&e.action?.name===`preview_ui`||e.action?.name===`preview_preview_ui`&&e.status===`success`);e&&o.addEventListener(`click`,()=>{let t=e.prototypeId;if(!t&&e.observation)try{t=(typeof e.observation==`string`?JSON.parse(e.observation):e.observation)?.prototypeId}catch{}t&&Cc(t)})}let s=e.querySelector(`.bookmark-btn`);s&&(Km(s,C.activeSessionId,t.dataset.messageId),s.addEventListener(`click`,async e=>{e.stopPropagation();let n=C.activeSessionId,r=t.dataset.messageId;if(s.classList.contains(`bookmarked`)){await Pm(n,r),Km(s,n,r);let{refreshBookmarkPanel:e}=await A(async()=>{let{refreshBookmarkPanel:e}=await Promise.resolve().then(()=>Rm);return{refreshBookmarkPanel:e}},void 0);e()}else{await Nm(n,r,t.dataset.textContent_||``,C.sessions.find(e=>e.id===n)?.title||``),Km(s,n,r);let{refreshBookmarkPanel:e}=await A(async()=>{let{refreshBookmarkPanel:e}=await Promise.resolve().then(()=>Rm);return{refreshBookmarkPanel:e}},void 0);e()}}));let c=e.querySelector(`.delete-btn`);c&&c.addEventListener(`click`,e=>{e.stopPropagation(),zw(t)});let l=e.querySelector(`.fork-btn`);l&&l.addEventListener(`click`,async e=>{e.stopPropagation();let n=t.dataset.messageId;n&&await Xs(C.activeSessionId,n)});let u=e.querySelector(`.resume-task-btn`);u&&u.addEventListener(`click`,async e=>{if(e.stopPropagation(),u.disabled)return;let n=await Qx({budgetEnded:Tw(t)});n!==null&&(u.disabled=!0,u.style.opacity=`0.6`,u.style.cursor=`not-allowed`,rS(C.activeSessionId,n).finally(()=>{u.disabled=!1,u.style.opacity=``,u.style.cursor=``}))}),Pw(t);let d=e.querySelector(`.token-usage-tag`);d&&!d._clickBound&&(d._clickBound=!0,d.style.cursor=`pointer`,d.addEventListener(`click`,e=>{e.stopPropagation();try{let e=t.dataset.executionLog,n=Pe(e?JSON.parse(e):[]);n&&qe(n,d)}catch{}}))}),e.querySelectorAll(`.message-toolbar`).forEach(e=>{let t=e.closest(`.message`);if(!t)return;let n=e.querySelector(`.edit-btn`);n&&n.addEventListener(`click`,e=>{e.stopPropagation(),Hw(t)});let r=e.querySelector(`.copy-btn`);r&&r.addEventListener(`click`,e=>{e.stopPropagation(),Bx(t,r)});let i=e.querySelector(`.delete-btn`);i&&i.addEventListener(`click`,e=>{e.stopPropagation(),zw(t)})}),e.querySelectorAll(`.user-message-image`).forEach(e=>{e.addEventListener(`click`,()=>{jp(e.src,e)})}),e.querySelectorAll(`.mermaid-controls`).forEach(e=>e.remove()),Ze(),kw(),jw(),tD()}function Lw(e){return new Promise(t=>{let n=document.querySelector(`.command-terminate-overlay`);n&&n.remove();let i=document.createElement(`div`);i.className=`command-terminate-overlay`,i.innerHTML=`
|
|
1869
1870
|
<div class="command-terminate-modal">
|
|
1870
1871
|
<div class="command-terminate-header">
|
|
1871
1872
|
<div class="command-terminate-icon">⏹</div>
|
|
@@ -1894,7 +1895,7 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
1894
1895
|
<button class="command-terminate-cancel">${r(`common.cancel`)}</button>
|
|
1895
1896
|
</div>
|
|
1896
1897
|
</div>
|
|
1897
|
-
`,document.body.appendChild(i);let a=()=>{i.remove()};i.querySelector(`.command-terminate-cancel`).addEventListener(`click`,()=>{a(),t(null)}),i.querySelector(`.wait-btn`).addEventListener(`click`,()=>{a(),chrome.runtime.sendMessage({type:`TERMINATE_COMMAND`,sessionId:e,mode:`wait`}),t(`wait`)}),i.querySelector(`.kill-btn`).addEventListener(`click`,()=>{a(),chrome.runtime.sendMessage({type:`TERMINATE_COMMAND`,sessionId:e,mode:`kill`}),t(`kill`)})})}function
|
|
1898
|
+
`,document.body.appendChild(i);let a=()=>{i.remove()};i.querySelector(`.command-terminate-cancel`).addEventListener(`click`,()=>{a(),t(null)}),i.querySelector(`.wait-btn`).addEventListener(`click`,()=>{a(),chrome.runtime.sendMessage({type:`TERMINATE_COMMAND`,sessionId:e,mode:`wait`}),t(`wait`)}),i.querySelector(`.kill-btn`).addEventListener(`click`,()=>{a(),chrome.runtime.sendMessage({type:`TERMINATE_COMMAND`,sessionId:e,mode:`kill`}),t(`kill`)})})}function Rw(e){return new Promise(t=>{let n=document.querySelector(`.delete-confirm-overlay`);n&&n.remove();let i=document.createElement(`div`);i.className=`delete-confirm-overlay`;let a=e.length>50?e.substring(0,50)+`...`:e;i.innerHTML=`
|
|
1898
1899
|
<div class="delete-confirm-modal">
|
|
1899
1900
|
<div class="delete-confirm-header">
|
|
1900
1901
|
<div class="delete-confirm-icon">🗑️</div>
|
|
@@ -1909,7 +1910,7 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
1909
1910
|
<button class="delete-confirm-confirm">${r(`chatMsg.confirmDelete`)}</button>
|
|
1910
1911
|
</div>
|
|
1911
1912
|
</div>
|
|
1912
|
-
`,document.body.appendChild(i);let o=i.querySelector(`.delete-confirm-cancel`),s=i.querySelector(`.delete-confirm-confirm`);o.addEventListener(`click`,()=>{i.remove(),t(!1)}),s.addEventListener(`click`,()=>{i.remove(),t(!0)}),i.addEventListener(`click`,e=>{e.target})})}async function
|
|
1913
|
+
`,document.body.appendChild(i);let o=i.querySelector(`.delete-confirm-cancel`),s=i.querySelector(`.delete-confirm-confirm`);o.addEventListener(`click`,()=>{i.remove(),t(!1)}),s.addEventListener(`click`,()=>{i.remove(),t(!0)}),i.addEventListener(`click`,e=>{e.target})})}async function zw(e,t=!1){let n=e.dataset.messageId,a=e.classList.contains(`user`)?`user`:`assistant`,o=``;if(o=a===`user`?e.textContent.trim():e.dataset.textContent_||``,!t&&!await Rw(o))return;if(n){let e=C.messageHistory.findIndex(e=>e.messageId===n);e!==-1&&C.messageHistory.splice(e,1)}else{let t=e.dataset.timestamp,n=C.messageHistory.findIndex(e=>e.timestamp===t);n!==-1&&C.messageHistory.splice(n,1)}let s=e.previousElementSibling;s&&s.classList.contains(`user-context-bubble`)&&s.remove(),e.remove();let c=document.getElementById(`chatContainer`);c.querySelectorAll(`.message`).length===0&&(c.innerHTML=`
|
|
1913
1914
|
<div class="welcome-message">
|
|
1914
1915
|
<div class="icon-wrapper">
|
|
1915
1916
|
<div class="icon">💬</div>
|
|
@@ -1917,7 +1918,7 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
1917
1918
|
<h2>${r(`chat.welcomeTitle`)}</h2>
|
|
1918
1919
|
<p>${r(`chat.welcomeSubtitle`)}</p>
|
|
1919
1920
|
</div>
|
|
1920
|
-
`),await
|
|
1921
|
+
`),await XC(),n&&C.activeSessionId&&y(C.activeSessionId,n).then(e=>{e||i.warn(`[SidePanel] IndexedDB messagecleanup failed, messageId:`,n)}).catch(e=>{i.error(`[SidePanel] IndexedDB messagecleanup exception:`,e)}),i.debug(`[SidePanel] deletedmessage: ${a}, messageId: ${n}`)}async function Bw(e=null){try{let{mcpTools:t}=await chrome.storage.local.get([`mcpTools`]),n=t||[],r=new Set(Array.isArray(C.mcpClosedServers)?C.mcpClosedServers:[]),i=new Set(Array.isArray(C.activeAgentMcpExcludedServerIds)?C.activeAgentMcpExcludedServerIds:[]),a=new Set(Array.isArray(e)?e:[]);return n.filter(e=>{let t=e.serverId||`unknown`;return a.has(t)?!0:!r.has(t)&&!i.has(t)}).length}catch{return 0}}async function Vw(e,t,n=!1,a={},o={}){let{resumeFromCheckpoint:s=!1,userGuidance:c=``,loadingId:l=null,forcedMcpServerIds:u=null,sessionId:d=null,agent:f=null}=o,p=f?f.agentId:C.activeAgentId,m=f?f.agentToolIds:C.activeAgentToolIds,h=f?f.agentSkillIds:C.activeAgentSkillIds,g=f?f.agentMcpExcludedServerIds:C.activeAgentMcpExcludedServerIds,_=await We(),v=(_.toolTimeout||0)+3*(_.apiTimeout||0)+6e4,y=_.loopTimeout+v,b=await new Promise(e=>{chrome.storage.local.get(`reflectionConfig`,t=>{e(t.reflectionConfig||{enabled:!1})})}),x=d||C.activeSessionId,S=s?`resume_${Date.now()}_${Math.random().toString(36).substring(2,8)}`:`call_${Date.now()}_${Math.random().toString(36).substring(2,8)}`;if(i.debug(`[SidePanel] callApi: generating callId: ${S}${s?` (restoremode)`:``}`),s&&l&&(a={...a,_loadingId:l}),C.pendingCancelApiMap&&C.pendingCancelApiMap.has(x)){i.debug(`[SidePanel] callApi: detectedsession has ongoing API call with , first cancelold`);let e=C.pendingCancelApiMap.get(x);e&&e({message:r(`chatMsg.errTaskReplaced`),executionLog:[]})}C.pendingCallApiSessionIds&&C.pendingCallApiSessionIds.has(x)&&(C.pendingCallApiSessionIds.delete(x),RC());let w=HS(x),T=chrome.runtime.connect({name:`keepalive-`+x});i.debug(`[SidePanel] keepalive portconnected, sessionId:`,x),nl(x);try{let e=tl();T.postMessage({type:`KEEPALIVE_IDENTITY`,identity:e==null?null:{windowId:e}})}catch{}let E={restarted:!1,rejectFn:null,cleanup:null,checkpoint:null};T.onMessage.addListener(e=>{if(e.type===`HOST_TAB_RESOLVED`&&e.sessionId===x){rl(x,e.hostTabId);return}e.type===`SW_RESTARTED`&&e.sessionId===x&&(i.warn(`[SidePanel] ⚠️ recei to SW_RESTARTED notification,background re started,API call lost`),E.restarted=!0,E.checkpoint=e.checkpoint||null,E.rejectFn&&E.cleanup&&(E.cleanup(),E.rejectFn({message:r(`chatMsg.errSwRestarted`),executionLog:[],checkpoint:E.checkpoint,swRestarted:!0}))),e.type===`SHOW_CLARIFY_DIALOG`?za(e.data):e.type===`CLARIFY_TIMEOUT`?Ga(e):e.type===`CLARIFY_EXTENDED`?ka(e):e.type===`SHOW_CONFIRM_DIALOG`?co(e.data):e.type===`DISMISS_CONFIRM_DIALOG`&&fo(e.data)});let D={timeoutId:null,removeListener:()=>{}},O=()=>{try{T.disconnect()}catch{}D.timeoutId&&=(clearTimeout(D.timeoutId),null),D.removeListener(),C.pendingCancelApiMap.delete(x),C.pendingCallApiSessionIds.delete(x),US(x),RC()};return new Promise((o,l)=>{if(E.cleanup=O,E.rejectFn=l,E.restarted){O(),l({message:r(`chatMsg.errSwRestarted`),executionLog:[],checkpoint:E.checkpoint,swRestarted:!0});return}let d=[],f=Math.round(_.loopTimeout/1e3);w(null),qS(null),ZS(0);let v=``,T=new Map,k=e=>{w()&&(vC(w(),v),FC(w())),O(),(!e.executionLog||e.executionLog.length===0||d.length>0)&&(e.executionLog=d),l(e)};C.pendingCancelApiMap.set(x,k),C.pendingCallApiSessionIds.add(x),RC(),i.debug(`[SidePanel] callApi: add pendingCallApiSessionIds, mySessionId =`,x,`, set:`,[...C.pendingCallApiSessionIds]),D.timeoutId=setTimeout(()=>{k({message:r(`chatMsg.errTimeout`,{seconds:f}),executionLog:d}),chrome.runtime.sendMessage({type:`CANCEL_REACT`,tabId:C.currentTabId,sessionId:x}).catch(e=>{i.debug(`[SidePanel] sendcancelrequest failed:`,e.message)})},y);let A=Date.now(),j=0,M=null,N=()=>{M===null&&D.timeoutId!==null&&(M=Date.now(),clearTimeout(D.timeoutId),D.timeoutId=null,i.debug(`[SidePanel] before sidetimeoutpaused (waitinguser response:clarification/sensitive toolconfirm)`))},ee=()=>{if(M!==null){let e=Date.now()-M;j+=e,M=null;let t=Date.now()-A,n=y+j-t;if(n<=0){k({message:r(`chatMsg.errTimeout`,{seconds:f}),executionLog:d});return}D.timeoutId=setTimeout(()=>{k({message:r(`chatMsg.errTimeout`,{seconds:f}),executionLog:d}),chrome.runtime.sendMessage({type:`CANCEL_REACT`,tabId:C.currentTabId,sessionId:x}).catch(e=>{i.debug(`[SidePanel] sendcancelrequest failed:`,e.message)})},n),i.debug(`[SidePanel] before sidetimeoutrestored,pause duration:`,Math.round(e/1e3),`s,remaining time:`,Math.round(n/1e3),`s`)}},te=e=>{if(e.sessionId&&e.sessionId!==x||e.callId&&e.callId!==S)return!1;if(e.type===`EXECUTION_STATUS_UPDATE`){let t=e.executionLog||[];if(t.length>0&&t.forEach(e=>{let t=d.findIndex(t=>t.id===e.id);t===-1?d.push(e):d[t]={...d[t],...e}}),e.subtaskTotal&&e.subtaskTotal>0){let t=w();if(t){let n=t.querySelector(`.stream-content`);if(n){let t=e.subtaskIndex??0,i=dw(d);i&&[...i.items].sort((e,t)=>e.index-t.index).forEach(r=>{if(r.index===t)return;let a=`.subtask-progress[data-subtask-index="${r.index}"]`;if(n.querySelector(a))return;let o=document.createElement(`div`);o.className=`subtask-progress subtask-progress-pending`,o.dataset.subtaskIndex=r.index,o.innerHTML=fw(r,i.total||e.subtaskTotal),mw(n,o),pw(o)});let a=`.subtask-progress[data-subtask-index="${t}"]`,o=n.querySelector(a),s=o?o.classList.contains(`subtask-expanded`):!1;o||(o=document.createElement(`div`),o.className=`subtask-progress`,o.dataset.subtaskIndex=t,mw(n,o));let c=lw,l=t+1,u=e.subtaskTotal,f=e.subtaskName||``,p=`<span class="subtask-badge">${l}/${u}</span>`,m=uw,h=e.status!==`success`&&e.status!==`failed`,g=d.filter(e=>e.subtaskIndex===t&&e.nodeType!==`subtask`),_=iw(g),v=_.total,y=_.success,b=_.failed,x=_.other,S=g.find(e=>e.status===`processing`),C=rw(e.status,y,v),w=i?i.items.find(e=>e.index===t):null,T=w&&w.description?String(w.description).replace(/\s+/g,` `).trim():``,E=d.find(e=>e.subtaskIndex===t&&e.nodeType===`subtask`),D=ow(d,t)?`<span class="subtask-replay-skipped" title="${nt(r(`chatMsg.subtaskReplaySkippedHint`))}">${r(`chatMsg.subtaskReplaySkipped`)}</span>`:``;o.classList.remove(`subtask-progress-pending`);let O=``;e.status===`success`?(O=`<span class="subtask-status-done">${r(`chatMsg.subtaskDone`)}</span>`,o.classList.add(`subtask-progress-done`),o.classList.remove(`subtask-progress-active`)):C===`partial`?(O=`<span class="subtask-status-partial">${r(`chatMsg.subtaskPartial`)}</span>`,o.classList.add(`subtask-progress-failed`),o.classList.remove(`subtask-progress-active`)):e.status===`failed`?(O=`<span class="subtask-status-failed">${r(`chatMsg.subtaskFailed`)}</span>`,o.classList.add(`subtask-progress-failed`),o.classList.remove(`subtask-progress-active`)):(O=`<span class="subtask-status-label"><span class="subtask-spinner"></span>${r(`chatMsg.subtaskExecuting`)}</span>`,o.classList.add(`subtask-progress-active`));let k=``;if(h&&v>0){let e=S?S.nodeType===`tool_exec`?`🔧`:S.nodeType===`api_call`?`📡`:S.nodeType===`reflection`?`🎯`:S.nodeType===`preselect`?`🔍`:`○`:`○`,t=aw(S),n=S?Rf(S):``;k=`<div class="subtask-progress-line">
|
|
1921
1922
|
<span class="subtask-current-node"><span class="subtask-current-spinner"></span><span class="node-label">${e} ${t}</span>${n?` <span class="subtask-current-cmd" title="${nt(n)}">${P(n)}</span>`:``}</span>
|
|
1922
1923
|
<span class="subtask-node-stats">
|
|
1923
1924
|
<span class="subtask-stat-total">${v}</span>
|
|
@@ -1945,12 +1946,12 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
1945
1946
|
</div>
|
|
1946
1947
|
${k}
|
|
1947
1948
|
<div class="subtask-detail-body"></div>
|
|
1948
|
-
`,s&&o.classList.add(`subtask-expanded`);let A=o.querySelector(`.subtask-detail-body`);o._renderNodes=()=>{if(!A)return;let e=[];T&&e.push(`<div class="subtask-detail-desc"><span class="subtask-detail-label">${r(`chatMsg.subtaskDescLabel`)}</span>${P(T)}</div>`);let n=E&&E.result?String(E.result).trim():``;n&&e.push(`<div class="subtask-detail-result"><span class="subtask-detail-label">${r(`chatMsg.subtaskResultLabel`)}</span>${P(n)}</div>`);let i=d.filter(e=>e.subtaskIndex===t&&e.nodeType!==`subtask`),a
|
|
1949
|
+
`,s&&o.classList.add(`subtask-expanded`);let A=o.querySelector(`.subtask-detail-body`);o._renderNodes=()=>{if(!A)return;let e=[];T&&e.push(`<div class="subtask-detail-desc"><span class="subtask-detail-label">${r(`chatMsg.subtaskDescLabel`)}</span>${P(T)}</div>`);let n=E&&E.result?String(E.result).trim():``;n&&e.push(`<div class="subtask-detail-result"><span class="subtask-detail-label">${r(`chatMsg.subtaskResultLabel`)}</span>${P(n)}</div>`);let i=d.filter(e=>e.subtaskIndex===t&&e.nodeType!==`subtask`),a=cw(i,o._nodeFilter),s=``;i.length>0&&a.length===0?s=`<div class="subtask-node-empty">${P(r(`chatMsg.subtaskFilterEmpty`))}</div>`:a.length>0&&(s=a.map(e=>{let t=e.nodeType===`tool_exec`?`🔧`:e.nodeType===`api_call`?`📡`:e.nodeType===`reflection`?`🎯`:e.nodeType===`preselect`?`🔍`:`○`,n=e.status===`success`?`✓`:e.status===`failed`?`✗`:h?`<span class="subtask-node-spinner"></span>`:`○`,i=e.status===`success`?`done`:e.status===`failed`?`failed`:`processing`,a=e.duration?Ve(e.duration):``,o=P(e.nodeName||r(`chatMsg.unknownNode`)),s=``;if(e.nodeType===`tool_exec`){let t=Rf(e);t&&(s=`<span class="subtask-node-cmd" title="${nt(t)}">${P(t)}</span>`)}return`<div class="subtask-node ${i}">
|
|
1949
1950
|
<span class="subtask-node-icon">${t}</span>
|
|
1950
1951
|
<span class="subtask-node-status">${n}</span>
|
|
1951
1952
|
<span class="subtask-node-name">${o}${s}</span>
|
|
1952
1953
|
${a?`<span class="subtask-node-dur">${a}</span>`:``}
|
|
1953
|
-
</div>`}).join(``)),A.innerHTML=e.join(``)+s},o._renderNodes(),
|
|
1954
|
+
</div>`}).join(``)),A.innerHTML=e.join(``)+s},o._renderNodes(),pw(o),e.status===`success`&&l>=u&&n.querySelectorAll(`.subtask-progress`).forEach(e=>e.classList.add(`subtask-progress-all-done`))}}}return!1}if(e.type===`CLARIFY_START`)return N(),!1;if(e.type===`CLARIFY_END`)return ee(),!1;if(e.type===`TOOL_CONFIRM_START`)return N(),!1;if(e.type===`TOOL_CONFIRM_END`)return ee(),!1;if(e.type===`STREAM_PRESELECT`){if(i.debug(`[SidePanel] received pre-filterlog,:`,e.preselectLog?.length),qS(e.preselectLog||null),w()&&KS()&&KS().length>0){let e=w().querySelector(`.message-content`);e&&(KS().forEach(t=>{let n=MC(t);e.insertBefore(n,e.firstChild)}),qS(null),i.debug(`[SidePanel] pre-filtercard imageappended to existingstreamingelement`))}return!1}if(e.type===`API_RETRYING`){let t=w();if(t)aC(t,e.attempt,e.maxRetries);else{let t=document.querySelector(`.loading-message .loading-text`);t&&(t.textContent=r(`chatStream.retrying`,{attempt:e.attempt,max:e.maxRetries}))}return!1}if(e.type===`STREAM_START`){i.debug(`[SidePanel] streamingoutput start`);let e=a._loadingId,t=e?document.getElementById(e):document.querySelector(`.loading-message`);if(t&&t.remove(),C.executionLogListener&&=(chrome.runtime.onMessage.removeListener(C.executionLogListener),null),C.currentExecutionStatus=null,w()){let e=w().querySelector(`.stream-content`);if(e){let t=e.querySelector(`.thinking-indicator:not(.hidden)`);if(t&&i.warn(`[STREAM_START] has can seen thinking indicator,skipcreate:`,t),!t){let t=document.createElement(`div`);t.className=`thinking-indicator`,t.innerHTML=`
|
|
1954
1955
|
<svg class="thinking-icon pulse-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
1955
1956
|
<path d="M12 2a3 3 0 0 0-3 3v1a3 3 0 0 0 3 3 3 3 0 0 1 3 3v1a3 3 0 0 1-3 3 3 3 0 0 0-3 3v1a3 3 0 0 0 3 3"/>
|
|
1956
1957
|
<circle cx="8" cy="12" r="1.5"/>
|
|
@@ -1963,17 +1964,16 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
1963
1964
|
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
1964
1965
|
</svg>
|
|
1965
1966
|
</button>
|
|
1966
|
-
`;let n=t.querySelector(`.streaming-stop-btn`);n&&n.addEventListener(`click`,e=>{e.stopPropagation(),
|
|
1967
|
-
`);n.appendChild(e),t.stderrSeparator=e}n.appendChild(i)}else t.stderrSeparator?n.insertBefore(i,t.stderrSeparator):n.appendChild(i)}let i=n.parentElement;i&&(i.scrollTop=i.scrollHeight)}}return!1}if(e.type===`AGENT_STREAM_DONE`){if(e.execId){let t=T[e.execId];t&&e.exitCode!==0&&t.element.classList.add(`agent-stream-error`)}return!1}if(e.type===`STREAM_DONE`){if(w()){let e=w().querySelector(`.stream-status`);e&&(b?.enabled?e.textContent=r(`chatMsg.reflectionInProgress`):e.textContent=``)}return!1}if(e.type===`API_COMPLETE`){let t=e.content&&String(e.content).trim()?e.content:r(`chatMsg.emptyModelReply`);w()&&TC(w(),t,e.executionLog||[],e.reflectionScore,e.reasoningContent,e.wasRevised);let n=w(),i=!!n,a=n?n.dataset.htmlContent||n.outerHTML:null,s=n?n.isConnected:!1,c=n?n.dataset.messageId:null;return O(),console.log(`[callApi API_COMPLETE] wasStreamed:`,i,`| message.executionLog entries:`,e.executionLog?.length||0,`| local executionLog entries:`,d.length,`| agent_file entries:`,(e.executionLog||d)?.filter(e=>e.nodeType===`tool_exec`&&e.action?.name===`agent_file`).length||0),o({content:t,executionLog:e.executionLog||d,reflectionScore:e.reflectionScore,wasStreamed:i,wasRevised:e.wasRevised,streamingHtml:a,streamingConnected:s,streamingMsgId:c,budgetEnded:e.budgetEnded===!0}),!1}else if(e.type===`API_ERROR`){let t=w();return t&&t.isConnected&&t.remove(),O(),l({message:e.error,executionLog:e.executionLog||d}),!1}return!1};if(chrome.runtime.onMessage.addListener(te),D.removeListener=()=>{chrome.runtime.onMessage.removeListener(te)},s)i.debug(`[SidePanel] send RESUME_REACT message,sessionId:`,x,`userGuidance:`,c?`"${c.substring(0,50)}..."`:`( no )`,`timeout:`,y),chrome.runtime.sendMessage({type:`RESUME_REACT`,sessionId:x,callId:S,userGuidance:c||``});else{let r=e.some(e=>Array.isArray(e.content)&&e.content.some(e=>e&&e.type===`image_url`));i.debug(`[SidePanel] send CALL_API message,useTools:`,n,`tabId:`,C.currentTabId,`sessionId:`,x,`apiParams:`,a,`timeout:`,y),chrome.runtime.sendMessage({type:`CALL_API`,sessionId:x,messages:e,model:t,useTools:n,tabId:C.currentTabId,apiParams:a,agentId:p,agentToolIds:m,agentSkillIds:h,forcedMcpServerIds:Array.isArray(u)&&u.length>0?u:null,agentMcpExcludedServerIds:g??null,callId:S,imageApiBase:C.enableImageInput&&r&&C.imageApiBase||``,imageApiKey:C.enableImageInput&&r&&C.imageApiKey||``})}})}function Nw(e){try{let t=e.dataset.rawContent||``,n=e.dataset.textContent_||``;if(!n&&!t){F(r(`chatMsg.cannotGetMessageContent`),`error`);return}let a=[];if(t.startsWith(`[`))try{let e=JSON.parse(t);if(Array.isArray(e)){let t=e.filter(e=>e.type===`image_url`);for(let e of t){let t=e.image_url.original_url||e.image_url.url;a.push({originalUrl:t,compressedUrl:e.image_url.url,width:e.image_url.width,height:e.image_url.height})}}}catch{}a.length>0&&(C.attachedImages=a,Bp());let o=[];if(e.dataset.attachedFiles)try{let t=JSON.parse(e.dataset.attachedFiles);for(let e of t)o.push({name:e.name,size:e.size,type:e.type,text:e.text||``,status:e.status||`done`,agentPath:e.agentPath||``})}catch{}o.length>0&&(C.attachedFiles=o,A(()=>Promise.resolve().then(()=>cm).then(e=>{e.renderFilePreviews()}),void 0));let s=n.match(/^\[网页上下文\]\n标题: (.+)\nURL: (.+)\ntabId: (\d+)\n/);if(s){tx(),C.selectedPage={id:parseInt(s[3]),title:s[1],url:s[2],favIconUrl:``};let e=document.getElementById(`pageIndicator`),t=document.getElementById(`pageIndicatorName`);if(e&&t){let n=s[1],r=s[2];n&&n!==`无标题`&&r?t.textContent=`${n} · ${r}`:t.textContent=n||r,e.style.display=`flex`}}let c=n.match(/\[知识库检索结果\](引用: ([^)]+))/);if(c){let e=c[1].split(`、`).map(e=>e.trim()).filter(Boolean);e.length>0&&(Bb(),C.knowledgeRefs=e.map(e=>({id:``,name:e})),Vb(),Gb().then(e=>{if(e&&e.ok){let t=new Map((e.collections||[]).map(e=>[e.name,e]));C.knowledgeRefs=C.knowledgeRefs.map(e=>{if(e.id)return e;let n=t.get(e.name);return{id:n?.id||``,name:e.name,enabled:n?n.enabled!==!1:!0}}),Vb()}}).catch(()=>{}))}let l=Array.from(new Set([...n.matchAll(/\[(?:已选技能|Selected skill):\s*([^\n\]]+)\]/g)].map(e=>e[1].split(` - `)[0].trim()).filter(Boolean)));l.length>0&&(hT(),C.selectedSkills=l.map(e=>({name:e,description:``,type:`agent`})),gT());let u=Array.from(new Set([...n.matchAll(/\[(?:已选MCP服务|Selected MCP service):\s*([^\n\]]+)\]/g)].map(e=>e[1].split(` - `)[0].trim()).filter(Boolean)));u.length>0&&(OT(),C.selectedMcpServices=u.map(e=>({serverId:``,serverName:e,toolCount:0})),AT(),chrome.storage.local.get([`mcpTools`],e=>{let t=e.mcpTools||[];u.forEach(e=>{let n=C.selectedMcpServices.find(t=>t.serverName===e);if(!n||n.serverId)return;let r=t.find(t=>(t.serverName||``)===e)||t.find(t=>(t.serverName||``).startsWith(e));r&&(n.serverId=r.serverId||``,n.toolCount=t.filter(e=>e.serverId===r.serverId).length)}),AT()}));let d=n;s&&(d=d.replace(/^\[网页上下文\]\n标题: .+\nURL: .+\ntabId: \d+\n/,``)),c&&(d=d.replace(/\[知识库检索结果\][^\n]*\n[\s\S]*?\[\/知识库检索结果\]\n\n?/,``)),u.length>0&&(d=hw(d)),l.length>0&&(d=mw(d));let f=C.quotedContextText,p=C.selectedContextText;C.quotedContextText=``,C.selectedContextText=``;let m=d.match(/^\[引用内容(?:摘要)?\]\n([\s\S]+?)\n\n\[用户问题\]\n([\s\S]*)$/),h=d.match(/^\[选中内容(?:摘要)?\]\n([\s\S]+?)\n\n\[用户问题\]\n([\s\S]*)$/),g=m||h,_=d;if(g){let e=m?`quoted`:`selected`,t=g[1].trim(),n=g[2].trim();if(o.length>0){let e=n.search(/\n\n\[(?:工作目录)?文件(?:内容)?:/);e!==-1&&(n=n.substring(0,e).trim())}let i=document.getElementById(`selectionIndicator`),a=document.getElementById(`selectionText`);if(i&&a){let n;n=t.length>100?t.substring(0,100)+`...`:t.length>50?t.substring(0,50)+`...`:t,e===`quoted`?(C.quotedContextText=t,C.selectedContextText=p,a.textContent=r(`chatMsg.quotedContextLabel`,{text:n})):(C.selectedContextText=t,C.quotedContextText=f,a.textContent=r(`chatMsg.selectedContextLabel`,{text:n})),i.classList.add(`show`)}_=n}else if(C.quotedContextText=f,C.selectedContextText=p,o.length>0){let e=_.search(/\n\n\[(?:工作目录)?文件(?:内容)?:/);e!==-1&&(_=_.substring(0,e).trim())}let v=document.getElementById(`userInput`);v.value=_,Ue(),v.focus(),v.selectionStart=v.selectionEnd=v.value.length,i.debug(`[SidePanel] loadedmessagecontent to input box,waitingafter user editsend`)}catch(e){i.error(`[SidePanel] editmessage failed:`,e),F(r(`chatMsg.editFailed`,{message:e.message}),`error`)}}n(`zh`,{promptMgr:{promptsTabCount:`提示词 ({count})`,skillsTabCount:`技能 ({count})`,mcpTabCount:`MCP ({count})`,noMatchPrompt:`暂无匹配的提示词`,mergedHeaderHint:`方向键切换 · Enter发送/选择 · Ctrl+Enter带入/选中并关闭 · Esc取消`,noMatchResult:`暂无匹配结果`,requestFailed:`❌ 请求失败:{message}`,emptyPromptHint:`暂无提示词,请添加`,menuDisplayTitle:`菜单显示`,codeAndContentRequired:`请填写编码和内容`,codeExists:`编码已存在`,saveChanges:`保存修改`,confirmDeletePrompt:`确定要删除提示词 "/{code}" 吗?`}}),n(`en`,{promptMgr:{promptsTabCount:`Prompts ({count})`,skillsTabCount:`Skills ({count})`,mcpTabCount:`MCP ({count})`,noMatchPrompt:`No matching prompts`,mergedHeaderHint:`Arrow keys to switch · Enter to send/select · Ctrl+Enter to insert/select & close · Esc to cancel`,noMatchResult:`No matching results`,requestFailed:`❌ Request failed: {message}`,emptyPromptHint:`No prompts yet, please add one`,menuDisplayTitle:`Show in menu`,codeAndContentRequired:`Please fill in both code and content`,codeExists:`Code already exists`,saveChanges:`Save changes`,confirmDeletePrompt:`Are you sure you want to delete prompt "/{code}"?`}});var Pw=`<svg viewBox="0 0 1024 1024" width="12" height="12" fill="currentColor"><path d="M674.56 231.552l101.568 56.96-56.896-101.632 56.96-101.568-101.632 56.896-101.632-56.896 56.96 101.568-56.896 101.632 101.568-56.96zM186.944 629.76l-101.504-56.896 56.832 101.632-56.832 101.568 101.504-56.96 101.632 56.96-56.896-101.568 56.896-101.568-101.568 56.832zM85.44 85.312l56.832 101.568-56.832 101.632 101.504-56.96 101.632 56.96L231.68 186.88l56.896-101.568-101.568 56.896-101.568-56.896z m351.872 438.016l-99.2-99.136L424.32 337.984l99.072 99.264-86.08 86.144m-41.856-223.04L300.352 395.392a40.448 40.448 0 0 0 0 57.28l474.24 474.112a40.448 40.448 0 0 0 57.344 0l94.912-95.04a40.448 40.448 0 0 0 0-57.344L452.736 300.288a40.448 40.448 0 0 0-57.28 0z"/></svg>`;function Fw(){i.debug(`[SidePanel] clear selectedcontenttext `),C.selectedContextText=``,C.quotedContextText=``;let e=document.getElementById(`selectionIndicator`),t=document.getElementById(`userInput`);if(e&&(e.classList.remove(`show`),i.debug(`[SidePanel] hiddenselected contentprompt`)),typeof window.hideFloatingMenu==`function`&&window.hideFloatingMenu(),t&&t.value.startsWith(`[选中内容]`)){let e=t.value.split(`
|
|
1967
|
+
`;let n=t.querySelector(`.streaming-stop-btn`);n&&n.addEventListener(`click`,e=>{e.stopPropagation(),PC(n)}),e.appendChild(t)}}}else if(w(nC(x)),ZS(Date.now()),KS()&&KS().length>0){let e=w().querySelector(`.message-content`);KS().forEach(t=>{let n=MC(t);e.insertBefore(n,e.firstChild)}),qS(null)}return w().dataset.callId=S,v=``,GS(x,``),YS(Date.now()),$S(``),OS(w()),!1}if(e.type===`STREAM_CHUNK`)return w()&&(v+=e.delta,GS(x,v),w().isConnected&&yC(w(),v)),!1;if(e.type===`STREAM_TOOL_CALL`)return w()||(w(nC(x)),ZS(Date.now())),w()&&e.toolCalls?.length>0&&(vC(w(),e.thinkingContent||v),bC(w(),e.toolCalls)),!1;if(e.type===`STREAM_TOOL_RESULT`)return w()&&e.result&&jC(e.result,w()),!1;if(e.type===`AGENT_STREAM`){if(w()&&e.execId){let t=w();wC(t,T),kC(T,t,e)}return!1}if(e.type===`AGENT_STREAM_DONE`){if(e.execId){let t=T.get(e.execId);t&&t.element&&e.exitCode!==0&&t.element.classList.add(`agent-stream-error`)}return!1}if(e.type===`STREAM_DONE`){if(w()){let e=w().querySelector(`.stream-status`);e&&(b?.enabled?e.textContent=r(`chatMsg.reflectionInProgress`):e.textContent=``)}return!1}if(e.type===`API_COMPLETE`){let t=e.content&&String(e.content).trim()?e.content:r(`chatMsg.emptyModelReply`);w()&&NC(w(),t,e.executionLog||[],e.reflectionScore,e.reasoningContent,e.wasRevised);let n=w(),i=!!n,a=n?n.dataset.htmlContent||n.outerHTML:null,s=n?n.isConnected:!1,c=n?n.dataset.messageId:null;return O(),console.log(`[callApi API_COMPLETE] wasStreamed:`,i,`| message.executionLog entries:`,e.executionLog?.length||0,`| local executionLog entries:`,d.length,`| agent_file entries:`,(e.executionLog||d)?.filter(e=>e.nodeType===`tool_exec`&&e.action?.name===`agent_file`).length||0),o({content:t,executionLog:e.executionLog||d,reflectionScore:e.reflectionScore,wasStreamed:i,wasRevised:e.wasRevised,streamingHtml:a,streamingConnected:s,streamingMsgId:c,budgetEnded:e.budgetEnded===!0}),!1}else if(e.type===`API_ERROR`){let t=w();return t&&t.isConnected&&t.remove(),O(),l({message:e.error,executionLog:e.executionLog||d}),!1}return!1};if(chrome.runtime.onMessage.addListener(te),D.removeListener=()=>{chrome.runtime.onMessage.removeListener(te)},s)i.debug(`[SidePanel] send RESUME_REACT message,sessionId:`,x,`userGuidance:`,c?`"${c.substring(0,50)}..."`:`( no )`,`timeout:`,y),chrome.runtime.sendMessage({type:`RESUME_REACT`,sessionId:x,callId:S,userGuidance:c||``});else{let r=e.some(e=>Array.isArray(e.content)&&e.content.some(e=>e&&e.type===`image_url`));i.debug(`[SidePanel] send CALL_API message,useTools:`,n,`tabId:`,C.currentTabId,`sessionId:`,x,`apiParams:`,a,`timeout:`,y),chrome.runtime.sendMessage({type:`CALL_API`,sessionId:x,messages:e,model:t,useTools:n,tabId:C.currentTabId,apiParams:a,agentId:p,agentToolIds:m,agentSkillIds:h,forcedMcpServerIds:Array.isArray(u)&&u.length>0?u:null,agentMcpExcludedServerIds:g??null,callId:S,imageApiBase:C.enableImageInput&&r&&C.imageApiBase||``,imageApiKey:C.enableImageInput&&r&&C.imageApiKey||``})}})}function Hw(e){try{let t=e.dataset.rawContent||``,n=e.dataset.textContent_||``;if(!n&&!t){F(r(`chatMsg.cannotGetMessageContent`),`error`);return}let a=[];if(t.startsWith(`[`))try{let e=JSON.parse(t);if(Array.isArray(e)){let t=e.filter(e=>e.type===`image_url`);for(let e of t){let t=e.image_url.original_url||e.image_url.url;a.push({originalUrl:t,compressedUrl:e.image_url.url,width:e.image_url.width,height:e.image_url.height})}}}catch{}a.length>0&&(C.attachedImages=a,Bp());let o=[];if(e.dataset.attachedFiles)try{let t=JSON.parse(e.dataset.attachedFiles);for(let e of t)o.push({name:e.name,size:e.size,type:e.type,text:e.text||``,status:e.status||`done`,agentPath:e.agentPath||``})}catch{}o.length>0&&(C.attachedFiles=o,A(()=>Promise.resolve().then(()=>cm).then(e=>{e.renderFilePreviews()}),void 0));let s=n.match(/^\[网页上下文\]\n标题: (.+)\nURL: (.+)\ntabId: (\d+)\n/);if(s){tx(),C.selectedPage={id:parseInt(s[3]),title:s[1],url:s[2],favIconUrl:``};let e=document.getElementById(`pageIndicator`),t=document.getElementById(`pageIndicatorName`);if(e&&t){let n=s[1],r=s[2];n&&n!==`无标题`&&r?t.textContent=`${n} · ${r}`:t.textContent=n||r,e.style.display=`flex`}}let c=n.match(/\[知识库检索结果\](引用: ([^)]+))/);if(c){let e=c[1].split(`、`).map(e=>e.trim()).filter(Boolean);e.length>0&&(Bb(),C.knowledgeRefs=e.map(e=>({id:``,name:e})),Vb(),Gb().then(e=>{if(e&&e.ok){let t=new Map((e.collections||[]).map(e=>[e.name,e]));C.knowledgeRefs=C.knowledgeRefs.map(e=>{if(e.id)return e;let n=t.get(e.name);return{id:n?.id||``,name:e.name,enabled:n?n.enabled!==!1:!0}}),Vb()}}).catch(()=>{}))}let l=Array.from(new Set([...n.matchAll(/\[(?:已选技能|Selected skill):\s*([^\n\]]+)\]/g)].map(e=>e[1].split(` - `)[0].trim()).filter(Boolean)));l.length>0&&(wT(),C.selectedSkills=l.map(e=>({name:e,description:``,type:`agent`})),TT());let u=Array.from(new Set([...n.matchAll(/\[(?:已选MCP服务|Selected MCP service):\s*([^\n\]]+)\]/g)].map(e=>e[1].split(` - `)[0].trim()).filter(Boolean)));u.length>0&&(LT(),C.selectedMcpServices=u.map(e=>({serverId:``,serverName:e,toolCount:0})),zT(),chrome.storage.local.get([`mcpTools`],e=>{let t=e.mcpTools||[];u.forEach(e=>{let n=C.selectedMcpServices.find(t=>t.serverName===e);if(!n||n.serverId)return;let r=t.find(t=>(t.serverName||``)===e)||t.find(t=>(t.serverName||``).startsWith(e));r&&(n.serverId=r.serverId||``,n.toolCount=t.filter(e=>e.serverId===r.serverId).length)}),zT()}));let d=n;s&&(d=d.replace(/^\[网页上下文\]\n标题: .+\nURL: .+\ntabId: \d+\n/,``)),c&&(d=d.replace(/\[知识库检索结果\][^\n]*\n[\s\S]*?\[\/知识库检索结果\]\n\n?/,``)),u.length>0&&(d=ww(d)),l.length>0&&(d=Cw(d));let f=C.quotedContextText,p=C.selectedContextText;C.quotedContextText=``,C.selectedContextText=``;let m=d.match(/^\[引用内容(?:摘要)?\]\n([\s\S]+?)\n\n\[用户问题\]\n([\s\S]*)$/),h=d.match(/^\[选中内容(?:摘要)?\]\n([\s\S]+?)\n\n\[用户问题\]\n([\s\S]*)$/),g=m||h,_=d;if(g){let e=m?`quoted`:`selected`,t=g[1].trim(),n=g[2].trim();if(o.length>0){let e=n.search(/\n\n\[(?:工作目录)?文件(?:内容)?:/);e!==-1&&(n=n.substring(0,e).trim())}let i=document.getElementById(`selectionIndicator`),a=document.getElementById(`selectionText`);if(i&&a){let n;n=t.length>100?t.substring(0,100)+`...`:t.length>50?t.substring(0,50)+`...`:t,e===`quoted`?(C.quotedContextText=t,C.selectedContextText=p,a.textContent=r(`chatMsg.quotedContextLabel`,{text:n})):(C.selectedContextText=t,C.quotedContextText=f,a.textContent=r(`chatMsg.selectedContextLabel`,{text:n})),i.classList.add(`show`)}_=n}else if(C.quotedContextText=f,C.selectedContextText=p,o.length>0){let e=_.search(/\n\n\[(?:工作目录)?文件(?:内容)?:/);e!==-1&&(_=_.substring(0,e).trim())}let v=document.getElementById(`userInput`);v.value=_,Ue(),v.focus(),v.selectionStart=v.selectionEnd=v.value.length,i.debug(`[SidePanel] loadedmessagecontent to input box,waitingafter user editsend`)}catch(e){i.error(`[SidePanel] editmessage failed:`,e),F(r(`chatMsg.editFailed`,{message:e.message}),`error`)}}n(`zh`,{promptMgr:{promptsTabCount:`提示词 ({count})`,skillsTabCount:`技能 ({count})`,mcpTabCount:`MCP ({count})`,noMatchPrompt:`暂无匹配的提示词`,mergedHeaderHint:`方向键切换 · Enter发送/选择 · Ctrl+Enter带入/选中并关闭 · Esc取消`,noMatchResult:`暂无匹配结果`,requestFailed:`❌ 请求失败:{message}`,emptyPromptHint:`暂无提示词,请添加`,menuDisplayTitle:`菜单显示`,codeAndContentRequired:`请填写编码和内容`,codeExists:`编码已存在`,saveChanges:`保存修改`,confirmDeletePrompt:`确定要删除提示词 "/{code}" 吗?`}}),n(`en`,{promptMgr:{promptsTabCount:`Prompts ({count})`,skillsTabCount:`Skills ({count})`,mcpTabCount:`MCP ({count})`,noMatchPrompt:`No matching prompts`,mergedHeaderHint:`Arrow keys to switch · Enter to send/select · Ctrl+Enter to insert/select & close · Esc to cancel`,noMatchResult:`No matching results`,requestFailed:`❌ Request failed: {message}`,emptyPromptHint:`No prompts yet, please add one`,menuDisplayTitle:`Show in menu`,codeAndContentRequired:`Please fill in both code and content`,codeExists:`Code already exists`,saveChanges:`Save changes`,confirmDeletePrompt:`Are you sure you want to delete prompt "/{code}"?`}});var Uw=`<svg viewBox="0 0 1024 1024" width="12" height="12" fill="currentColor"><path d="M674.56 231.552l101.568 56.96-56.896-101.632 56.96-101.568-101.632 56.896-101.632-56.896 56.96 101.568-56.896 101.632 101.568-56.96zM186.944 629.76l-101.504-56.896 56.832 101.632-56.832 101.568 101.504-56.96 101.632 56.96-56.896-101.568 56.896-101.568-101.568 56.832zM85.44 85.312l56.832 101.568-56.832 101.632 101.504-56.96 101.632 56.96L231.68 186.88l56.896-101.568-101.568 56.896-101.568-56.896z m351.872 438.016l-99.2-99.136L424.32 337.984l99.072 99.264-86.08 86.144m-41.856-223.04L300.352 395.392a40.448 40.448 0 0 0 0 57.28l474.24 474.112a40.448 40.448 0 0 0 57.344 0l94.912-95.04a40.448 40.448 0 0 0 0-57.344L452.736 300.288a40.448 40.448 0 0 0-57.28 0z"/></svg>`;function Ww(){i.debug(`[SidePanel] clear selectedcontenttext `),C.selectedContextText=``,C.quotedContextText=``;let e=document.getElementById(`selectionIndicator`),t=document.getElementById(`userInput`);if(e&&(e.classList.remove(`show`),i.debug(`[SidePanel] hiddenselected contentprompt`)),typeof window.hideFloatingMenu==`function`&&window.hideFloatingMenu(),t&&t.value.startsWith(`[选中内容]`)){let e=t.value.split(`
|
|
1968
1968
|
`),n=0;for(let t=0;t<e.length;t++)if(e[t].startsWith(`[用户问题]`)){n=t;break}n>0&&(t.value=e.slice(n).join(`
|
|
1969
|
-
`),t.dispatchEvent(new Event(`input`)),i.debug(`[SidePanel] removedinput box selected content before suffix`))}C.lastSelectedText=``,C.currentSelectionRange=null}function
|
|
1969
|
+
`),t.dispatchEvent(new Event(`input`)),i.debug(`[SidePanel] removedinput box selected content before suffix`))}C.lastSelectedText=``,C.currentSelectionRange=null}function Gw(){let e=document.getElementById(`promptManageList`).querySelectorAll(`.prompt-manage-item`);e.forEach(t=>{t.addEventListener(`dragstart`,e=>{C.draggedItemIndex=parseInt(t.dataset.index),t.classList.add(`dragging`),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,C.draggedItemIndex)}),t.addEventListener(`dragend`,()=>{t.classList.remove(`dragging`),e.forEach(e=>e.classList.remove(`drag-over`)),C.draggedItemIndex=null}),t.addEventListener(`dragover`,e=>{e.preventDefault(),e.dataTransfer.dropEffect=`move`,t.classList.add(`drag-over`)}),t.addEventListener(`dragleave`,()=>{t.classList.remove(`drag-over`)}),t.addEventListener(`drop`,e=>{e.stopPropagation(),e.preventDefault();let n=parseInt(t.dataset.index);if(C.draggedItemIndex!==null&&C.draggedItemIndex!==n){let e=C.customPrompts[C.draggedItemIndex];C.customPrompts.splice(C.draggedItemIndex,1),C.customPrompts.splice(n,0,e),chrome.storage.local.set({customPrompts:C.customPrompts}),iT()}t.classList.remove(`drag-over`)})})}function Kw(){let e=document.querySelector(`#promptDropdown .prompt-dropdown-header`);if(!e||e.querySelector(`.prompt-manage-btn`))return;let t=document.createElement(`button`);t.className=`prompt-manage-btn`,t.title=r(`promptManager.title`),t.style.fontSize=`13px`,t.innerHTML=`✚`,t.addEventListener(`click`,e=>{e.stopPropagation(),nT()}),e.appendChild(t)}async function qw(e=``,t=null){let n=document.getElementById(`promptSelector`),r=document.getElementById(`promptDropdown`);Je(),n.style.display=`block`,r.classList.add(`show`);let i=document.getElementById(`skillsTab`),a=document.getElementById(`mcpTab`),o=i?await _T():!1,s=a?await MT():!1;if(i&&(i.style.display=o?`block`:`none`),a&&(a.style.display=s?`block`:`none`),Yw(o,s),e)await Qw(e);else{let n=t||C.lastActiveDropdownTab||`prompts`,r=document.querySelector(`#promptDropdownTabs .prompt-tab[data-tab="${n}"]`),i=`prompts`;if(r&&r.style.display!==`none`)i=n;else{let e=document.querySelectorAll(`#promptDropdownTabs .prompt-tab`);for(let t of e)if(t.style.display!==`none`){i=t.dataset.tab;break}}await OT(i),Zw(e)}}function Jw(){let e=document.getElementById(`promptSelector`),t=document.getElementById(`promptDropdown`);e.style.display=`none`,t.classList.remove(`show`),C.selectedPromptIndex=-1,C.showMergedList=!1;let n=document.getElementById(`promptDropdownTabs`);n&&n.classList.remove(`merged-mode`)}async function Yw(e,t){try{let n=C.customPrompts.length,i=document.querySelector(`#promptDropdownTabs .prompt-tab[data-tab="prompts"]`);if(i&&(i.textContent=r(`promptMgr.promptsTabCount`,{count:n})),e){let e=await yT(),t=document.getElementById(`skillsTab`);t&&(t.textContent=r(`promptMgr.skillsTabCount`,{count:e.length}))}if(t){let e=await NT(),t=document.getElementById(`mcpTab`);t&&(t.textContent=r(`promptMgr.mcpTabCount`,{count:e.length}))}}catch{}}function Xw(e=``){e?Qw(e):Zw(e)}function Zw(e=``){let t=document.getElementById(`promptList`),n=e.toLowerCase(),i=C.customPrompts.filter(t=>e?t.code.toLowerCase().includes(n)||t.content.toLowerCase().includes(n):!0);if(i.length===0){t.innerHTML=`<div class="prompt-empty">${r(`promptMgr.noMatchPrompt`)}</div>`,C.selectedPromptIndex=-1;return}C.selectedPromptIndex=0,t.innerHTML=i.map((e,t)=>`
|
|
1970
1970
|
<div class="prompt-item ${t===C.selectedPromptIndex?`selected`:``}" data-index="${t}" data-code="${e.code}">
|
|
1971
1971
|
<span class="prompt-item-index">${t+1}</span>
|
|
1972
|
-
<span class="prompt-item-icon">${
|
|
1972
|
+
<span class="prompt-item-icon">${Uw}</span>
|
|
1973
1973
|
<span class="prompt-item-content">${e.content}</span>
|
|
1974
1974
|
<span class="prompt-item-code">/${e.code}</span>
|
|
1975
1975
|
</div>
|
|
1976
|
-
`).join(``),t.querySelectorAll(`.prompt-item`).forEach(e=>{e.addEventListener(`click`,t=>{let n=e.dataset.code;t.ctrlKey||t.metaKey?
|
|
1976
|
+
`).join(``),t.querySelectorAll(`.prompt-item`).forEach(e=>{e.addEventListener(`click`,t=>{let n=e.dataset.code;t.ctrlKey||t.metaKey?eT(n):tT(n)})})}async function Qw(e=``){let t=document.getElementById(`promptList`),n=document.getElementById(`skillList`),i=document.getElementById(`mcpList`),a=document.getElementById(`promptDropdownTabs`),o=document.querySelector(`#promptDropdownHeader .prompt-dropdown-header-text`),s=document.querySelector(`#promptDropdownHeader .prompt-manage-btn`),c=document.querySelector(`#promptDropdownHeader .skill-manage-btn`),l=document.querySelector(`#promptDropdownHeader .mcp-manage-btn`);a&&a.classList.add(`merged-mode`),n&&(n.style.display=`none`),i&&(i.style.display=`none`),t&&(t.style.display=`block`),o&&(o.textContent=r(`promptMgr.mergedHeaderHint`)),s&&(s.style.display=``),c&&(c.style.display=`none`),l&&(l.style.display=`none`),C.showMergedList=!0,C.activeDropdownTab=`prompts`;let u=e.toLowerCase(),d=C.customPrompts.filter(t=>e?t.code.toLowerCase().includes(u)||t.content.toLowerCase().includes(u):!0),f=[];await _T()&&(f=(await yT()).filter(t=>e?(t.name||``).toLowerCase().includes(u)||(t.description||``).toLowerCase().includes(u):!0));let p=[];await MT()&&(p=(await NT()).filter(t=>e?(t.serverName||``).toLowerCase().includes(u)||(t.serverId||``).toLowerCase().includes(u):!0));let m=d.length+f.length+p.length,h=document.getElementById(`promptMergedTitle`);if(h&&(h.textContent=r(`promptSelector.mergedTitleCount`,{count:m})),m===0){t.innerHTML=`<div class="prompt-empty">${r(`promptMgr.noMatchResult`)}</div>`,C.selectedPromptIndex=-1;return}C.selectedPromptIndex=0;let g=0,_=d.map(e=>{let t=`
|
|
1977
1977
|
<div class="prompt-item ${g===0?`selected`:``}" data-index="${g}" data-type="prompt" data-code="${e.code}">
|
|
1978
1978
|
<span class="prompt-item-index">${g+1}</span>
|
|
1979
1979
|
<span class="prompt-item-icon">📋</span>
|
|
@@ -1991,13 +1991,13 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
1991
1991
|
<span class="prompt-item-content">🔌 ${P(e.serverName)}</span>
|
|
1992
1992
|
${t?`<span class="merged-item-badge badge-mcp-inactive">${r(`skillSelector.mcpInactiveBadge`)}</span>`:``}
|
|
1993
1993
|
<span class="merged-item-badge badge-mcp">MCP</span>
|
|
1994
|
-
</div>`;return g++,n}).join(``);t.innerHTML=_+v+y,t.querySelectorAll(`.prompt-item`).forEach(e=>{e.addEventListener(`click`,async t=>{let n=e.dataset.type;if(n===`skill`){let n=e.dataset.skillName;
|
|
1994
|
+
</div>`;return g++,n}).join(``);t.innerHTML=_+v+y,t.querySelectorAll(`.prompt-item`).forEach(e=>{e.addEventListener(`click`,async t=>{let n=e.dataset.type;if(n===`skill`){let n=e.dataset.skillName;CT(n,await yT()),(t.ctrlKey||t.metaKey)&&Jw()}else if(n===`mcp`){let n=e.dataset.serverId,r=e.dataset.serverName;IT(n,r,await NT()),(t.ctrlKey||t.metaKey)&&Jw()}else{let n=e.dataset.code;t.ctrlKey||t.metaKey?eT(n):tT(n)}})}),ET(),BT()}function $w(e){e.forEach((e,t)=>{t===C.selectedPromptIndex?(e.classList.add(`selected`),e.scrollIntoView({block:`nearest`})):e.classList.remove(`selected`)})}function eT(e,{skipTriggerStrip:t=!1}={}){let n=C.customPrompts.find(t=>t.code===e);if(!n)return;let r=document.getElementById(`userInput`),a=r.value,o=a.lastIndexOf(`/`),s=a;if(!t&&o!==-1){let e=-1;for(let t=o-1;t>=0;t--)if(a[t]===`
|
|
1995
1995
|
`){e=t;break}s=e===-1?a.substring(0,o).trimEnd():a.substring(0,e+1).trimEnd()}r.value=s+(s&&!s.endsWith(`
|
|
1996
1996
|
`)?`
|
|
1997
1997
|
|
|
1998
|
-
`:``)+n.content,r.focus(),r.selectionStart=r.selectionEnd=r.value.length,
|
|
1998
|
+
`:``)+n.content,r.focus(),r.selectionStart=r.selectionEnd=r.value.length,Jw(),Ue(),i.debug(`[SidePanel] trackaddpromptword to input box:`,n.code,n.content)}async function tT(e){let t=C.customPrompts.find(t=>t.code===e);if(!t)return;if(C.isGenerating){i.debug(`[SidePanel] generating,please wait...`);return}let n=document.getElementById(`userInput`)?.value||``,a={quotedContextText:C.quotedContextText||``,selectedContextText:C.selectedContextText||``,selectedSkills:C.selectedSkills.slice(),selectedMcpServices:C.selectedMcpServices.slice(),knowledgeRefs:C.knowledgeRefs.slice(),selectedPage:C.selectedPage,attachedImages:C.attachedImages.slice(),attachedFiles:C.attachedFiles.slice()};await Xc({state:C,getRatio:()=>BE().usage?.ratio??0,compact:YE}),Jw();let o=document.getElementById(`chatContainer`).querySelector(`.welcome-message`);o&&o.remove();let s=t.content,c=a.selectedContextText&&a.selectedContextText.trim(),l=a.quotedContextText&&a.quotedContextText.trim(),u=[];if(l){let e=a.quotedContextText.trim(),{compressed:n,wasCompressed:r}=m(e);s=`[引用内容${r?`摘要`:``}]\n${n}\n\n[用户问题]\n${t.content}`,Sw(`quoted`,e,!1),u.push({type:`quoted`,text:e}),C.quotedContextText===a.quotedContextText&&(C.quotedContextText=``)}else if(c){let e=a.selectedContextText.trim(),{compressed:n,wasCompressed:r}=m(e);s=`[选中内容${r?`摘要`:``}]\n${n}\n\n[用户问题]\n${t.content}`,Sw(`selected`,e,!1),u.push({type:`selected`,text:e}),C.selectedContextText===a.selectedContextText&&(C.selectedContextText=``)}let d=a.selectedSkills,f=await jT(d);if(f){s=f+s;for(let e of d)Sw(`skill`,r(`contextBubble.bubbleSkill`,{name:e.name,desc:e.description?`:`+e.description:``}),!1),u.push({type:`skill`,name:e.name,description:e.description||``});let e=new Set(d),t=C.selectedSkills.filter(t=>!e.has(t));t.length!==C.selectedSkills.length&&(C.selectedSkills=t,C.selectedSkillIndex=-1,TT(),ET())}let p=null,h=a.selectedMcpServices,_=RT(h);if(_){let e=h.map(e=>e.serverId).filter(Boolean);p=e.length>0?e:null,s=_+s;for(let e of h)Sw(`mcp`,r(`contextBubble.bubbleMcp`,{name:e.serverName}),!1),u.push({type:`mcp`,serverName:e.serverName,serverId:e.serverId||``});let t=new Set(h),n=C.selectedMcpServices.filter(e=>!t.has(e));n.length!==C.selectedMcpServices.length&&(C.selectedMcpServices=n,C.selectedMcpServiceIndex=-1,zT(),BT())}let v=a.knowledgeRefs;if(v.length>0){let e=Sw(`knowledge`,r(`contextBubble.bubbleKnowledgeSearching`),!1),n=null;try{n=await tw(t.content,v)}catch(e){i.warn(`[SidePanel] knowledge search failed:`,e)}e&&e.parentNode&&e.remove(),n&&(s=n.text+s,nw(n.refs,n.failed===!0),u.push({type:`knowledge`,refs:n.refs,failed:n.failed||void 0}));let a=new Set(v),o=C.knowledgeRefs.filter(e=>!a.has(e));o.length!==C.knowledgeRefs.length&&(C.knowledgeRefs=o,Lb(),Vb())}let y=a.selectedPage;y&&(s=`[网页上下文]\n标题: ${y.title}\nURL: ${y.url}\ntabId: ${y.id}\n`+s,Sw(`page`,r(`contextBubble.bubblePage`,{title:y.title,url:y.url}),!1),u.push({type:`page`,title:y.title,url:y.url}),C.selectedPage===y&&tx()),(c||l)&&(!C.quotedContextText&&!C.selectedContextText?Ww():HC());let b=a.attachedFiles,x=(a.attachedImages||[]).slice();if(b.length>0){let e=Am(b);e&&(s+=e),b.forEach(e=>{e.status===`done`&&u.push({type:`file`,name:e.name,size:e.size,fileType:e.type})})}let S=null;if(b.length>0||x.length>0)try{S=await j(C.activeSessionId,b,x)}catch(e){i.warn(`[Prompt] save doc image snapshot failed:`,e.message)}let w=Te(S?.chatStart,S?.chatCount);w&&(s+=w);let T=Vp(s,x),{messageId:E,timestamp:D}=Ew(`user`,Vp(t.content,x),!0,[],null,!1,s,null,b);C.messageHistory.push({role:`user`,content:T,messageId:E,timestamp:D,contextBubbles:u}),YC(),cn(t.content);let O=document.getElementById(`userInput`);O.value===n&&(O.value=``,O.style.height=`auto`),C.isGenerating=!0;let k=Mw(),A=C.activeSessionId,M=C.enableImageInput&&x.length>0&&C.imageModelName||C.currentModel;if(x.length>0){let e=new Set(x),t=C.attachedImages.filter(t=>!e.has(t));t.length!==C.attachedImages.length&&(C.attachedImages=t,Bp())}if(b.length>0){let e=new Set(b),t=C.attachedFiles.filter(t=>!e.has(t));if(t.length!==C.attachedFiles.length){for(let t of C.attachedFiles)e.has(t)&&t.dataUrl&&URL.revokeObjectURL(t.dataUrl);C.attachedFiles=t,km()}}try{await je(),i.debug(`[SidePanel] sendmessagedebuginfo:`),i.debug(` - isolateChat:`,C.isolateChat),i.debug(` - chatConfig:`,C.chatConfig),i.debug(` - messageHistory.length:`,C.messageHistory.length);let e=[{role:`system`,content:await Ke(null,{sessionId:A})}];if(C.isolateChat){let t=g(M,C.enabledTools.length||50,0,C.customModelMap),n=Math.floor(t*.7),r=C.messageHistory[C.messageHistory.length-1],a=nn(C.messageHistory.slice(0,-1),{isolateChat:!0,maxMemoryMessages:C.chatConfig.maxMemoryMessages,compaction:C.activeCompaction,historyBudget:n,currentMessage:r});an(e,a,C.activeCompaction,i),a.historySummaryText&&(e[0]={...e[0],content:e[0].content+`
|
|
1999
1999
|
|
|
2000
|
-
`+a.historySummaryText}),e=[...e,...a.messages];for(let t=0;t<e.length-1;t++)e[t]={...e[t],content:Hp(e[t].content)}}else e.push({role:`user`,content:T});let n=await Ge(),a,o,s=!1,c=null,l=null;try{let t=await
|
|
2000
|
+
`+a.historySummaryText}),e=[...e,...a.messages];for(let t=0;t<e.length-1;t++)e[t]={...e[t],content:Hp(e[t].content)}}else e.push({role:`user`,content:T});let n=await Ge(),a,o,s=!1,c=null,l=null;try{let t=await Vw(e,M,C.useTools,n,{forcedMcpServerIds:p});a=t.content,o=t.executionLog||[],s=t.wasStreamed||!1,c=t.streamingHtml||null,t.streamingConnected!==void 0&&t.streamingConnected,l=t.streamingMsgId||null}catch(e){Nw(k),a=r(`promptMgr.requestFailed`,{message:e.message||r(`agentConfig.unknownError`)}),o=e.executionLog||[];let{element:n,messageId:i}=Ew(`assistant`,a,!0,o);throw C.messageHistory.push({role:`assistant`,content:a,executionLog:o,messageId:i}),YC(),e.message!==r(`chatMsg.errTaskStopped`)&&Ol(A,a,t.content),e}let u=null;if(!s||!c)if(Nw(k),s)u=l;else{let{element:e,messageId:t}=Ew(`assistant`,a,!0,o);u=t,await lt(e)}else u=l;C.messageHistory.push({role:`assistant`,content:a,executionLog:o,messageId:u}),YC(),Dl(A,t.content)}catch{}finally{jl(A),O.focus()}}function nT(){document.getElementById(`promptManageModal`).classList.add(`show`),iT()}function rT(){document.getElementById(`promptManageModal`).classList.remove(`show`);let e=document.getElementById(`editPromptIndex`),t=document.getElementById(`newPromptCode`),n=document.getElementById(`newPromptContent`),i=document.getElementById(`promptManageAddBtn`);e&&(e.value=``),t&&(t.value=``),n&&(n.value=``),i&&(i.textContent=r(`promptManager.addPrompt`),i.style.background=`var(--brand-500)`)}function iT(){let e=document.getElementById(`promptManageList`);if(C.customPrompts.length===0){e.innerHTML=`<div class="prompt-empty">${r(`promptMgr.emptyPromptHint`)}</div>`;return}e.innerHTML=C.customPrompts.map((e,t)=>`
|
|
2001
2001
|
<div class="prompt-manage-item" draggable="true" data-index="${t}">
|
|
2002
2002
|
<div class="prompt-manage-item-left">
|
|
2003
2003
|
<span class="prompt-drag-handle" title="${r(`toolbar.dragSort`)}">⋮⋮</span>
|
|
@@ -2025,7 +2025,7 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
2025
2025
|
</button>
|
|
2026
2026
|
</div>
|
|
2027
2027
|
</div>
|
|
2028
|
-
`).join(``),e.querySelectorAll(`.move-up-btn`).forEach(e=>{e.addEventListener(`click`,t=>{t.stopPropagation();let n=parseInt(e.dataset.index);if(n>0){let e=C.customPrompts[n];C.customPrompts[n]=C.customPrompts[n-1],C.customPrompts[n-1]=e,chrome.storage.local.set({customPrompts:C.customPrompts}),
|
|
2028
|
+
`).join(``),e.querySelectorAll(`.move-up-btn`).forEach(e=>{e.addEventListener(`click`,t=>{t.stopPropagation();let n=parseInt(e.dataset.index);if(n>0){let e=C.customPrompts[n];C.customPrompts[n]=C.customPrompts[n-1],C.customPrompts[n-1]=e,chrome.storage.local.set({customPrompts:C.customPrompts}),iT()}})}),e.querySelectorAll(`.move-down-btn`).forEach(e=>{e.addEventListener(`click`,t=>{t.stopPropagation();let n=parseInt(e.dataset.index);if(n<C.customPrompts.length-1){let e=C.customPrompts[n];C.customPrompts[n]=C.customPrompts[n+1],C.customPrompts[n+1]=e,chrome.storage.local.set({customPrompts:C.customPrompts}),iT()}})}),e.querySelectorAll(`.menu-toggle-btn`).forEach(e=>{e.addEventListener(`click`,t=>{t.stopPropagation();let n=parseInt(e.dataset.index);C.customPrompts[n].enabledInMenu=!C.customPrompts[n].enabledInMenu,chrome.storage.local.set({customPrompts:C.customPrompts}),iT()})}),e.querySelectorAll(`.edit-btn`).forEach(e=>{e.addEventListener(`click`,()=>{cT(parseInt(e.dataset.index))})}),e.querySelectorAll(`.delete-btn`).forEach(e=>{e.addEventListener(`click`,()=>{lT(parseInt(e.dataset.index))})}),Gw()}function aT(e){let t=document.getElementById(`promptErrorModal`),n=document.getElementById(`promptErrorMessage`);n.textContent=e,t.classList.add(`show`)}function oT(){document.getElementById(`promptErrorModal`).classList.remove(`show`)}function sT(){let e=document.getElementById(`editPromptIndex`),t=document.getElementById(`newPromptCode`),n=document.getElementById(`newPromptContent`),i=t.value.trim(),a=n.value.trim();if(!i||!a){aT(r(`promptMgr.codeAndContentRequired`));return}let o=e?parseInt(e.value):-1,s=C.customPrompts.findIndex(e=>e.code===i);if(s!==-1&&s!==o){aT(r(`promptMgr.codeExists`));return}o>=0&&o<C.customPrompts.length?C.customPrompts[o]={...C.customPrompts[o],code:i,content:a}:C.customPrompts.push({code:i,content:a,enabledInMenu:!1}),chrome.storage.local.set({customPrompts:C.customPrompts}),t.value=``,n.value=``,e&&(e.value=``);let c=document.getElementById(`promptManageAddBtn`);c.textContent=r(`promptManager.addPrompt`),c.style.background=`var(--brand-500)`,iT()}function cT(e){let t=C.customPrompts[e];if(!t)return;let n=document.getElementById(`editPromptIndex`),i=document.getElementById(`newPromptCode`),a=document.getElementById(`newPromptContent`),o=document.getElementById(`promptManageAddBtn`);n&&(n.value=e),i.value=t.code,a.value=t.content,o.textContent=r(`promptMgr.saveChanges`),o.style.background=`var(--warning-500)`,i.scrollIntoView({behavior:`smooth`})}function lT(e){let t=C.customPrompts[e];if(!t)return;C.pendingDeleteIndex=e;let n=document.getElementById(`deleteConfirmModal`),i=document.getElementById(`deleteConfirmMessage`);i.textContent=r(`promptMgr.confirmDeletePrompt`,{code:t.code}),n.classList.add(`show`)}function uT(){document.getElementById(`deleteConfirmModal`).classList.remove(`show`),C.pendingDeleteIndex=-1}function dT(e){C.customPrompts.splice(e,1),chrome.storage.local.set({customPrompts:C.customPrompts}),iT()}function fT(){let e=document.getElementById(`promptManageCancelBtn`),t=document.getElementById(`promptManageAddBtn`),n=document.getElementById(`promptModalCloseBtn`);e&&e.addEventListener(`click`,rT),t&&t.addEventListener(`click`,sT),n&&n.addEventListener(`click`,rT);let r=document.getElementById(`deleteCancelBtn`),i=document.getElementById(`deleteConfirmBtn`);r&&r.addEventListener(`click`,uT),i&&i.addEventListener(`click`,()=>{C.pendingDeleteIndex>=0&&dT(C.pendingDeleteIndex),uT()});let a=document.getElementById(`deleteConfirmModal`);a&&a.addEventListener(`click`,e=>{e.target===a&&uT()});let o=document.getElementById(`promptErrorConfirmBtn`);o&&o.addEventListener(`click`,oT);let s=document.getElementById(`promptErrorModal`);s&&s.addEventListener(`click`,e=>{e.target===s&&oT()});let c=document.getElementById(`promptDropdown`);c&&c.addEventListener(`mousedown`,e=>{e.target.closest(`.prompt-item, .prompt-tab, .skill-list-item, .mcp-list-item`)&&e.preventDefault()})}n(`zh`,{promptSelector:{noMatchSkill:`暂无匹配的技能`,skillManageTitle:`管理技能`,noMatchMcp:`暂无匹配的 MCP 服务`,toolCount:`{count} 个工具`,mcpManageTitle:`管理 MCP 服务`}}),n(`en`,{promptSelector:{noMatchSkill:`No matching skills`,skillManageTitle:`Manage skills`,noMatchMcp:`No matching MCP services`,toolCount:`{count} tools`,mcpManageTitle:`Manage MCP services`}}),n(`zh`,{skillSelector:{selectedSkillStart:`[已选技能: {name}`,useSkillToolsHint:`请根据上述技能说明,使用相关工具处理以下问题:
|
|
2029
2029
|
`,loadSkillHint:"请使用 `agent_skill`(action=load)加载「{name}」的完整说明,然后根据说明自主调用相关工具处理以下问题。\n",runSkillHint:"请使用 `agent_skill`(action=run)执行「{name}」技能来处理以下问题",requiredParam:`必填`,optionalParam:`可选`,callParamsPrefix:`,调用参数:`,paramItem:`({flag},{type}:{desc})`,paramJoin:`、`,sentenceEnd:`。
|
|
2030
2030
|
`,selectedMcpContext:`[已选MCP服务: {name}]
|
|
2031
2031
|
请使用「{name}」MCP服务来处理以下问题:
|
|
@@ -2033,7 +2033,7 @@ Click to view assessment details`,reflectionFailedTitle:`Reflection assessment f
|
|
|
2033
2033
|
`,loadSkillHint:'Please use `agent_skill` (action=load) to load the full description of "{name}", then autonomously call relevant tools to handle the following problem.\n',runSkillHint:'Please use `agent_skill` (action=run) to execute the "{name}" skill to handle the following problem',requiredParam:`required`,optionalParam:`optional`,callParamsPrefix:`, parameters: `,paramItem:`({flag}, {type}: {desc})`,paramJoin:`, `,sentenceEnd:`.
|
|
2034
2034
|
`,selectedMcpContext:`[Selected MCP service: {name}]
|
|
2035
2035
|
Please use the "{name}" MCP service to handle the following problem:
|
|
2036
|
-
`,disabledBadge:`Disabled`,disabledTooltip:`Not enabled (won't be auto-injected into the AI prompt), but you can still select and use it manually`,mcpInactiveBadge:`Inactive`,mcpInactiveTooltip:`This service is currently inactive (closed or excluded by the current agent). Selecting it will force-enable it for this request.`,manualUseSuffix:`Manual`}});var
|
|
2036
|
+
`,disabledBadge:`Disabled`,disabledTooltip:`Not enabled (won't be auto-injected into the AI prompt), but you can still select and use it manually`,mcpInactiveBadge:`Inactive`,mcpInactiveTooltip:`This service is currently inactive (closed or excluded by the current agent). Selecting it will force-enable it for this request.`,manualUseSuffix:`Manual`}});var pT=[],mT=0,hT=3e4;async function gT(e=!1){let t=Date.now();return!e&&pT.length>0&&t-mT<hT?pT:new Promise(e=>{chrome.runtime.sendMessage({type:`GET_SKILL_LIST`},t=>{if(chrome.runtime.lastError||!t?.success){e(pT);return}pT=t.skills||[],mT=Date.now(),e(pT)})})}async function _T(){if(!C.agentPlatform?.connected||(await new Promise(e=>{chrome.storage.local.get([`skillsEnabled`],e)})).skillsEnabled===!1)return!1;try{return(await yT()).length>0}catch{return!1}}async function vT(e=!1){return(await gT(e)).filter(e=>e.enabled!==!1)}async function yT(e=!1){let t=[...await gT(e)];return t.sort((e,t)=>(e.enabled===!1)-+(t.enabled===!1)),t}async function bT(e=``){let t=document.getElementById(`skillList`);if(!t)return;let n=await yT(!0),i=e.toLowerCase(),a=n.filter(t=>e?(t.name||``).toLowerCase().includes(i)||(t.description||``).toLowerCase().includes(i):!0);if(a.length===0){t.innerHTML=`<div class="prompt-empty">${r(`promptSelector.noMatchSkill`)}</div>`,C.selectedSkillIndex=-1;return}C.selectedSkillIndex=0,t.innerHTML=a.map((e,t)=>{let n=e.type===`agent`?`Agent`:`Workflow`,i=e.description||``,a=e.enabled===!1,o=a?`${e.name}\n${r(`skillSelector.disabledTooltip`)}`:e.name;return`
|
|
2037
2037
|
<div class="skill-list-item ${t===0?`selected`:``} ${a?`skill-list-item-disabled`:``}" data-index="${t}" data-skill-name="${P(e.name)}" title="${nt(o)}">
|
|
2038
2038
|
<span class="skill-list-item-index">${t+1}</span>
|
|
2039
2039
|
<span class="skill-list-item-icon">🧩</span>
|
|
@@ -2044,15 +2044,15 @@ Please use the "{name}" MCP service to handle the following problem:
|
|
|
2044
2044
|
<span class="skill-list-item-badge">${n}</span>
|
|
2045
2045
|
${a?`<span class="skill-list-item-badge badge-disabled">${r(`skillSelector.disabledBadge`)}</span>`:``}
|
|
2046
2046
|
</div>
|
|
2047
|
-
`}).join(``),t.querySelectorAll(`.skill-list-item`).forEach(e=>{e.addEventListener(`click`,t=>{let r=e.dataset.skillName;
|
|
2047
|
+
`}).join(``),t.querySelectorAll(`.skill-list-item`).forEach(e=>{e.addEventListener(`click`,t=>{let r=e.dataset.skillName;CT(r,n),(t.ctrlKey||t.metaKey)&&Jw()})}),ET()}function xT(e){e.forEach((e,t)=>{t===C.selectedSkillIndex?(e.classList.add(`selected`),e.scrollIntoView({block:`nearest`})):e.classList.remove(`selected`)})}function ST(){let e=document.getElementById(`userInput`);if(!e)return;let t=e.value,n=t.lastIndexOf(`/`);n!==-1&&(e.value=t.substring(0,n)),e.focus(),e.selectionStart=e.selectionEnd=e.value.length,Ue()}function CT(e,t,{clearTrigger:n=!0}={}){let r=t.find(t=>t.name===e);if(!r)return;let a=C.selectedSkills.findIndex(t=>t.name===e);if(a>=0?C.selectedSkills.splice(a,1):C.selectedSkills.push({name:r.name,description:r.description||``,type:r.type||`agent`,stepCount:r.stepCount||0,parameters:r.parameters||{},enabled:r.enabled!==!1}),ET(),TT(),n)ST();else{let e=document.getElementById(`userInput`);e&&(e.focus(),e.selectionStart=e.selectionEnd=e.value.length),Ue()}i.debug(`[SidePanel] skill toggled:`,r.name,`count:`,C.selectedSkills.length)}function wT(){C.selectedSkills=[],C.selectedSkillIndex=-1,TT(),ET(),i.debug(`[SidePanel] skill clearedselect`)}function TT(){let e=document.getElementById(`skillIndicator`);if(e){if(C.selectedSkills.length===0){e.style.display=`none`,e.innerHTML=``;return}e.innerHTML=C.selectedSkills.map(e=>{let t=e.enabled===!1,n=t?`${e.name} (${r(`skillSelector.manualUseSuffix`)})`:e.name,i=t?r(`skillSelector.disabledTooltip`):e.name;return`
|
|
2048
2048
|
<span class="ref-chip skill-ref-chip${t?` skill-ref-chip-manual`:``}">
|
|
2049
2049
|
<span class="ref-chip-name" title="${nt(i)}">🧩 ${P(n)}</span>
|
|
2050
2050
|
<button class="ref-chip-close" data-skill-name="${nt(e.name)}" title="${r(`common.delete`)}">✕</button>
|
|
2051
2051
|
</span>
|
|
2052
|
-
`}).join(``),e.querySelectorAll(`.ref-chip-close`).forEach(e=>{e.addEventListener(`click`,t=>{t.stopPropagation(),C.selectedSkills=C.selectedSkills.filter(t=>t.name!==e.dataset.skillName),
|
|
2052
|
+
`}).join(``),e.querySelectorAll(`.ref-chip-close`).forEach(e=>{e.addEventListener(`click`,t=>{t.stopPropagation(),C.selectedSkills=C.selectedSkills.filter(t=>t.name!==e.dataset.skillName),TT(),ET()})}),e.style.display=`flex`}}function ET(){let e=new Set(C.selectedSkills.map(e=>e.name));document.querySelectorAll(`.skill-list-item, .merged-skill-item`).forEach(t=>{t.classList.toggle(`picked`,e.has(t.dataset.skillName))})}function DT(){let e=document.getElementById(`skillIndicatorClose`);e&&e.addEventListener(`click`,wT)}async function OT(e){C.activeDropdownTab=e,C.lastActiveDropdownTab=e,C.showMergedList=!1;let t=document.getElementById(`promptList`),n=document.getElementById(`skillList`),i=document.getElementById(`mcpList`),a=document.getElementById(`promptDropdownTabs`),o=document.querySelectorAll(`#promptDropdownTabs .prompt-tab`),s=document.querySelector(`#promptDropdownHeader .prompt-dropdown-header-text`);a&&a.classList.remove(`merged-mode`),o.forEach(t=>{t.classList.toggle(`active`,t.dataset.tab===e)}),e===`skills`?(t&&(t.style.display=`none`),n&&(n.style.display=`block`),i&&(i.style.display=`none`),s&&(s.textContent=r(`promptSelector.switchHintSelect`)),C.selectedPromptIndex=-1,C.selectedMcpServiceIndex=-1,await bT()):e===`mcp`?(t&&(t.style.display=`none`),n&&(n.style.display=`none`),i&&(i.style.display=`block`),s&&(s.textContent=r(`promptSelector.switchHintSelect`)),C.selectedPromptIndex=-1,C.selectedSkillIndex=-1,await PT()):(t&&(t.style.display=`block`),n&&(n.style.display=`none`),i&&(i.style.display=`none`),s&&(s.textContent=r(`promptSelector.switchHint`)),C.selectedSkillIndex=-1,C.selectedMcpServiceIndex=-1);let c=document.querySelector(`#promptDropdownHeader .prompt-manage-btn`),l=document.querySelector(`#promptDropdownHeader .skill-manage-btn`),u=document.querySelector(`#promptDropdownHeader .mcp-manage-btn`);c&&(c.style.display=e===`prompts`?``:`none`),l&&(l.style.display=e===`skills`?``:`none`),u&&(u.style.display=e===`mcp`?``:`none`);let d=document.getElementById(`userInput`);d&&d.focus()}function kT(){let e=document.getElementById(`promptDropdownHeader`);if(!e||e.querySelector(`.skill-manage-btn`))return;let t=document.createElement(`button`);t.className=`skill-manage-btn`,t.title=r(`promptSelector.skillManageTitle`),t.style.display=`none`,t.style.fontSize=`13px`,t.innerHTML=`✚`,t.addEventListener(`click`,e=>{e.stopPropagation(),chrome.runtime.sendMessage({type:`OPEN_OPTIONS_PAGE`,hash:`toolbox`})}),e.appendChild(t)}function AT(){let e=document.getElementById(`promptDropdownTabs`);e&&(kT(),HT(),e.addEventListener(`click`,e=>{let t=e.target.closest(`.prompt-tab`);if(!t)return;let n=t.dataset.tab;n!==C.activeDropdownTab&&OT(n)}))}async function jT(e){let t=e||C.selectedSkills||[];if(t.length===0)return``;let n=[];for(let e of t){let t=e.type===`agent`,i=r(`skillSelector.selectedSkillStart`,{name:e.name});if(e.description&&(i+=` - ${e.description}`),i+=`]
|
|
2053
2053
|
`,t)try{let t=await new Promise(t=>{chrome.runtime.sendMessage({type:`GET_AGENT_SKILL_PROMPT`,name:e.name},e=>{if(chrome.runtime.lastError||!e?.success){t(null);return}t(e)})});t&&t.prompt?i+=`${t.prompt}\n\n${r(`skillSelector.useSkillToolsHint`)}`:i+=r(`skillSelector.loadSkillHint`,{name:e.name})}catch{i+=r(`skillSelector.loadSkillHint`,{name:e.name})}else{i+=r(`skillSelector.runSkillHint`,{name:e.name});let t=e.parameters;if(t&&t.properties&&Object.keys(t.properties).length>0){let e=t.required||[],n=Object.entries(t.properties).map(([t,n])=>r(`skillSelector.paramItem`,{flag:e.includes(t)?r(`skillSelector.requiredParam`):r(`skillSelector.optionalParam`),type:n.type||`string`,desc:n.description||``})).join(r(`skillSelector.paramJoin`));i+=r(`skillSelector.callParamsPrefix`)+n}i+=r(`skillSelector.sentenceEnd`)}n.push(i)}return n.join(`
|
|
2054
2054
|
|
|
2055
|
-
`)}async function
|
|
2055
|
+
`)}async function MT(){return!C.agentPlatform?.connected||!await new Promise(e=>{chrome.storage.local.get([`mcpEnabled`],t=>e(t.mcpEnabled))})?!1:(await NT()).length>0}async function NT(){return new Promise(e=>{chrome.storage.local.get([`mcpTools`],t=>{let n=t.mcpTools||[],r=new Set(Array.isArray(C.mcpClosedServers)?C.mcpClosedServers:[]),i=new Set(Array.isArray(C.activeAgentMcpExcludedServerIds)?C.activeAgentMcpExcludedServerIds:[]),a=new Map;n.forEach(e=>{let t=e.serverId||`unknown`;a.has(t)||a.set(t,{serverId:t,serverName:e.serverName||t,toolCount:0,effectiveOpen:!r.has(t)&&!i.has(t)}),a.get(t).toolCount++});let o=Array.from(a.values());e([...o.filter(e=>e.effectiveOpen),...o.filter(e=>!e.effectiveOpen)])})})}async function PT(e=``){let t=document.getElementById(`mcpList`);if(!t)return;let n=await NT(),i=e.toLowerCase(),a=n.filter(t=>e?(t.serverName||``).toLowerCase().includes(i)||(t.serverId||``).toLowerCase().includes(i):!0);if(a.length===0){t.innerHTML=`<div class="prompt-empty">${r(`promptSelector.noMatchMcp`)}</div>`,C.selectedMcpServiceIndex=-1;return}C.selectedMcpServiceIndex=0,t.innerHTML=a.map((e,t)=>{let n=e.effectiveOpen===!1,i=n?`${e.serverName}\n${r(`skillSelector.mcpInactiveTooltip`)}`:e.serverName;return`
|
|
2056
2056
|
<div class="mcp-list-item ${t===0?`selected`:``} ${n?`mcp-list-item-inactive`:``}" data-index="${t}" data-server-id="${P(e.serverId)}" data-server-name="${P(e.serverName)}" title="${nt(i)}">
|
|
2057
2057
|
<span class="mcp-list-item-index">${t+1}</span>
|
|
2058
2058
|
<span class="mcp-list-item-icon">🔌</span>
|
|
@@ -2063,20 +2063,20 @@ Please use the "{name}" MCP service to handle the following problem:
|
|
|
2063
2063
|
${n?`<span class="mcp-list-item-badge mcp-badge-inactive">${r(`skillSelector.mcpInactiveBadge`)}</span>`:``}
|
|
2064
2064
|
<span class="mcp-list-item-badge">${r(`promptSelector.toolCount`,{count:e.toolCount})}</span>
|
|
2065
2065
|
</div>
|
|
2066
|
-
`}).join(``),t.querySelectorAll(`.mcp-list-item`).forEach(e=>{e.addEventListener(`click`,t=>{let r=e.dataset.serverId,i=e.dataset.serverName;
|
|
2067
|
-
`)}function
|
|
2066
|
+
`}).join(``),t.querySelectorAll(`.mcp-list-item`).forEach(e=>{e.addEventListener(`click`,t=>{let r=e.dataset.serverId,i=e.dataset.serverName;IT(r,i,n),(t.ctrlKey||t.metaKey)&&Jw()})}),BT()}function FT(e){e.forEach((e,t)=>{t===C.selectedMcpServiceIndex?(e.classList.add(`selected`),e.scrollIntoView({block:`nearest`})):e.classList.remove(`selected`)})}function IT(e,t,n,{clearTrigger:r=!0}={}){let a=n?.find(t=>t.serverId===e)?.toolCount||0,o=t||e,s=C.selectedMcpServices.findIndex(e=>e.serverName===o);if(s>=0?C.selectedMcpServices.splice(s,1):C.selectedMcpServices.push({serverId:e,serverName:o,toolCount:a}),BT(),zT(),r)ST();else{let e=document.getElementById(`userInput`);e&&(e.focus(),e.selectionStart=e.selectionEnd=e.value.length),Ue()}i.debug(`[SidePanel] MCP service toggled:`,o,`count:`,C.selectedMcpServices.length)}function LT(){C.selectedMcpServices=[],C.selectedMcpServiceIndex=-1,zT(),BT(),i.debug(`[SidePanel] cleared MCP serviceselect`)}function RT(e){let t=e||C.selectedMcpServices||[];return t.length===0?``:t.map(e=>r(`skillSelector.selectedMcpContext`,{name:e.serverName})).join(`
|
|
2067
|
+
`)}function zT(){let e=document.getElementById(`mcpIndicator`);if(e){if(C.selectedMcpServices.length===0){e.style.display=`none`,e.innerHTML=``;return}e.innerHTML=C.selectedMcpServices.map(e=>`
|
|
2068
2068
|
<span class="ref-chip mcp-ref-chip">
|
|
2069
2069
|
<span class="ref-chip-name" title="${nt(e.serverName)}">🔌 ${P(e.serverName)}</span>
|
|
2070
2070
|
<button class="ref-chip-close" data-server-name="${nt(e.serverName)}" title="${r(`common.delete`)}">✕</button>
|
|
2071
2071
|
</span>
|
|
2072
|
-
`).join(``),e.querySelectorAll(`.ref-chip-close`).forEach(e=>{e.addEventListener(`click`,t=>{t.stopPropagation(),C.selectedMcpServices=C.selectedMcpServices.filter(t=>t.serverName!==e.dataset.serverName),AT(),jT()})}),e.style.display=`flex`}}function jT(){let e=new Set(C.selectedMcpServices.map(e=>e.serverName));document.querySelectorAll(`.mcp-list-item, .merged-mcp-item`).forEach(t=>{t.classList.toggle(`picked`,e.has(t.dataset.serverName))})}function MT(){let e=document.getElementById(`mcpIndicatorClose`);e&&e.addEventListener(`click`,OT)}function NT(){let e=document.getElementById(`promptDropdownHeader`);if(!e||e.querySelector(`.mcp-manage-btn`))return;let t=document.createElement(`button`);t.className=`mcp-manage-btn`,t.title=r(`promptSelector.mcpManageTitle`),t.style.display=`none`,t.style.fontSize=`13px`,t.innerHTML=`✚`,t.addEventListener(`click`,e=>{e.stopPropagation(),chrome.runtime.sendMessage({type:`OPEN_OPTIONS_PAGE`,hash:`toolbox`})}),e.appendChild(t)}var PT=[[`🀄`,`mahjong tile red dragon`,`symbols`,`麻将,红中`],[`🃏`,`playing card black joker`,`symbols`,``],[`🅰`,`negative squared latin capital letter a`,`symbols`,``],[`🅱`,`negative squared latin capital letter b`,`symbols`,``],[`🅾`,`negative squared latin capital letter o`,`symbols`,``],[`🅿`,`negative squared latin capital letter p`,`symbols`,``],[`🆎`,`negative squared ab`,`symbols`,``],[`🆑`,`squared cl`,`symbols`,``],[`🆒`,`squared cool`,`symbols`,``],[`🆓`,`squared free`,`symbols`,``],[`🆔`,`squared id`,`symbols`,``],[`🆕`,`squared new`,`symbols`,``],[`🆖`,`squared ng`,`symbols`,``],[`🆗`,`squared ok`,`symbols`,``],[`🆘`,`squared sos`,`symbols`,``],[`🆙`,`squared up with exclamation mark`,`symbols`,``],[`🆚`,`squared vs`,`symbols`,``],[`🇨🇩`,`regional indicator symbol letter c`,`flags`,``],[`🇬🇭`,`regional indicator symbol letter g`,`flags`,``],[`🇲🇳`,`regional indicator symbol letter m`,`flags`,``],[`🇷🇸`,`regional indicator symbol letter r`,`flags`,``],[`🈁`,`squared katakana koko`,`symbols`,``],[`🈂`,`squared katakana sa`,`symbols`,``],[`🈚`,`squared cjk unified ideograph-7121`,`symbols`,``],[`🈯`,`squared cjk unified ideograph-6307`,`symbols`,``],[`🈲`,`squared cjk unified ideograph-7981`,`symbols`,``],[`🈳`,`squared cjk unified ideograph-7a7a`,`symbols`,``],[`🈴`,`squared cjk unified ideograph-5408`,`symbols`,``],[`🈵`,`squared cjk unified ideograph-6e80`,`symbols`,``],[`🈶`,`squared cjk unified ideograph-6709`,`symbols`,``],[`🈷`,`squared cjk unified ideograph-6708`,`symbols`,``],[`🈸`,`squared cjk unified ideograph-7533`,`symbols`,``],[`🈹`,`squared cjk unified ideograph-5272`,`symbols`,``],[`🈺`,`squared cjk unified ideograph-55b6`,`symbols`,``],[`🉐`,`circled ideograph advantage`,`symbols`,``],[`🉑`,`circled ideograph accept`,`symbols`,``],[`🌀`,`cyclone`,`symbols`,`台风,龙卷风,旋风`],[`🌁`,`foggy`,`symbols`,`雾,雾霾,朦胧`],[`🌂`,`closed umbrella`,`symbols`,``],[`🌃`,`night with stars`,`symbols`,`夜晚,星空,城市`],[`🌄`,`sunrise over mountains`,`symbols`,`日出,山,早晨`],[`🌅`,`sunrise`,`symbols`,`日出,太阳,早晨`],[`🌆`,`cityscape at dusk`,`symbols`,`黄昏,傍晚,城市`],[`🌇`,`sunset over buildings`,`symbols`,`日落,黄昏`],[`🌈`,`rainbow`,`symbols`,`彩虹,雨后`],[`🌉`,`bridge at night`,`symbols`,`桥,大桥`],[`🌊`,`water wave`,`symbols`,`海浪,波浪,海`],[`🌋`,`volcano`,`symbols`,`火山,爆发`],[`🌌`,`milky way`,`symbols`,``],[`🌍`,`earth globe europe-africa`,`symbols`,``],[`🌎`,`earth globe americas`,`symbols`,`地球,美洲`],[`🌏`,`earth globe asia-australia`,`symbols`,`地球,亚洲`],[`🌐`,`globe with meridians`,`symbols`,``],[`🌑`,`new moon symbol`,`symbols`,``],[`🌒`,`waxing crescent moon symbol`,`symbols`,``],[`🌓`,`first quarter moon symbol`,`symbols`,``],[`🌔`,`waxing gibbous moon symbol`,`symbols`,``],[`🌕`,`full moon symbol`,`symbols`,``],[`🌖`,`waning gibbous moon symbol`,`symbols`,``],[`🌗`,`last quarter moon symbol`,`symbols`,``],[`🌘`,`waning crescent moon symbol`,`symbols`,``],[`🌙`,`crescent moon`,`symbols`,``],[`🌚`,`new moon with face`,`symbols`,``],[`🌛`,`first quarter moon with face`,`symbols`,``],[`🌜`,`last quarter moon with face`,`symbols`,``],[`🌝`,`full moon with face`,`symbols`,``],[`🌞`,`sun with face`,`symbols`,``],[`🌟`,`glowing star`,`symbols`,`星星,闪光,闪耀`],[`🌠`,`shooting star`,`symbols`,``],[`🌡`,`thermometer`,`symbols`,``],[`🌤`,`white sun with small cloud`,`symbols`,``],[`🌥`,`white sun behind cloud`,`symbols`,``],[`🌦`,`white sun behind cloud with rain`,`symbols`,``],[`🌧`,`cloud with rain`,`symbols`,``],[`🌨`,`cloud with snow`,`symbols`,``],[`🌩`,`cloud with lightning`,`symbols`,``],[`🌪`,`cloud with tornado`,`symbols`,``],[`🌫`,`fog`,`symbols`,``],[`🌬`,`wind blowing face`,`symbols`,``],[`🌭`,`hot dog`,`food`,`热狗`],[`🌮`,`taco`,`food`,`墨西哥卷饼`],[`🌯`,`burrito`,`food`,`墨西哥卷,卷饼`],[`🌰`,`chestnut`,`food`,`栗子,坚果`],[`🌱`,`seedling`,`food`,``],[`🌲`,`evergreen tree`,`food`,`松树,树`],[`🌳`,`deciduous tree`,`food`,`树,大树`],[`🌴`,`palm tree`,`food`,`棕榈树,热带,度假`],[`🌵`,`cactus`,`food`,`仙人掌,沙漠`],[`🌶`,`hot pepper`,`food`,``],[`🌷`,`tulip`,`food`,`郁金香,花`],[`🌸`,`cherry blossom`,`food`,`樱花,花,春天`],[`🌹`,`rose`,`food`,`玫瑰,花,爱情`],[`🌺`,`hibiscus`,`food`,`花,芙蓉`],[`🌻`,`sunflower`,`food`,`向日葵,花,太阳`],[`🌼`,`blossom`,`food`,`雏菊,花`],[`🌽`,`ear of maize`,`food`,`玉米`],[`🌾`,`ear of rice`,`food`,``],[`🌿`,`herb`,`food`,`草,植物,草药`],[`🍀`,`four leaf clover`,`food`,`四叶草,幸运,好运`],[`🍁`,`maple leaf`,`food`,`枫叶,秋天,红叶`],[`🍂`,`fallen leaf`,`food`,`落叶,秋天`],[`🍃`,`leaf fluttering in wind`,`food`,`树叶,风`],[`🍄`,`mushroom`,`food`,`蘑菇,菌`],[`🍅`,`tomato`,`food`,`番茄,西红柿`],[`🍆`,`aubergine`,`food`,`茄子`],[`🍇`,`grapes`,`food`,`葡萄`],[`🍈`,`melon`,`food`,`哈密瓜,甜瓜`],[`🍉`,`watermelon`,`food`,`西瓜`],[`🍊`,`tangerine`,`food`,`橙子,橘子`],[`🍋`,`lemon`,`food`,`柠檬`],[`🍌`,`banana`,`food`,`香蕉`],[`🍍`,`pineapple`,`food`,`菠萝`],[`🍎`,`red apple`,`food`,`苹果`],[`🍏`,`green apple`,`food`,``],[`🍐`,`pear`,`food`,`梨`],[`🍑`,`peach`,`food`,`桃子,蜜桃`],[`🍒`,`cherries`,`food`,`樱桃,车厘子`],[`🍓`,`strawberry`,`food`,`草莓`],[`🍔`,`hamburger`,`food`,`汉堡,汉堡包`],[`🍕`,`slice of pizza`,`food`,`披萨,比萨`],[`🍖`,`meat on bone`,`food`,`骨头,肉,排骨`],[`🍗`,`poultry leg`,`food`,`鸡腿,炸鸡`],[`🍘`,`rice cracker`,`food`,`米饼,仙贝`],[`🍙`,`rice ball`,`food`,`饭团`],[`🍚`,`cooked rice`,`food`,`米饭,饭`],[`🍛`,`curry and rice`,`food`,`咖喱,咖喱饭`],[`🍜`,`steaming bowl`,`food`,`面条,拉面,面`],[`🍝`,`spaghetti`,`food`,`意大利面,意面`],[`🍞`,`bread`,`food`,`面包`],[`🍟`,`french fries`,`food`,`薯条,炸薯条`],[`🍠`,`roasted sweet potato`,`food`,`红薯,地瓜`],[`🍡`,`dango`,`food`,`团子,丸子`],[`🍢`,`oden`,`food`,`关东煮,串`],[`🍣`,`sushi`,`food`,`寿司,三文鱼`],[`🍤`,`fried shrimp`,`food`,`炸虾,天妇罗`],[`🍥`,`fish cake with swirl design`,`food`,`鱼板,鸣门卷`],[`🍦`,`soft ice cream`,`food`,`冰淇淋,甜筒`],[`🍧`,`shaved ice`,`food`,`刨冰,冰沙`],[`🍨`,`ice cream`,`food`,`冰淇淋,圣代`],[`🍩`,`doughnut`,`food`,``],[`🍪`,`cookie`,`food`,``],[`🍫`,`chocolate bar`,`food`,`巧克力`],[`🍬`,`candy`,`food`,`糖果,糖`],[`🍭`,`lollipop`,`food`,`棒棒糖`],[`🍮`,`custard`,`food`,`布丁,焦糖`],[`🍯`,`honey pot`,`food`,`蜂蜜,蜜`],[`🍰`,`shortcake`,`food`,`蛋糕,奶油蛋糕`],[`🍱`,`bento box`,`food`,`便当,盒饭`],[`🍲`,`pot of food`,`food`,`火锅,汤锅,炖菜`],[`🍳`,`cooking`,`food`,`煎蛋,鸡蛋`],[`🍴`,`fork and knife`,`food`,`刀叉,餐具`],[`🍵`,`teacup without handle`,`food`,`绿茶,茶,抹茶`],[`🍶`,`sake bottle and cup`,`food`,`清酒,日本酒`],[`🍷`,`wine glass`,`food`,`红酒,葡萄酒,酒`],[`🍸`,`cocktail glass`,`food`,`鸡尾酒,马提尼`],[`🍹`,`tropical drink`,`food`,`果汁,鸡尾酒`],[`🍺`,`beer mug`,`food`,`啤酒,啤酒杯`],[`🍻`,`clinking beer mugs`,`food`,`干杯,碰杯,啤酒`],[`🍼`,`baby bottle`,`food`,`奶瓶,婴儿,奶粉`],[`🍽`,`fork and knife with plate`,`food`,``],[`🍾`,`bottle with popping cork`,`food`,`香槟,起泡酒,庆祝`],[`🍿`,`popcorn`,`food`,``],[`🎀`,`ribbon`,`activity`,`蝴蝶结,礼物,装饰`],[`🎁`,`wrapped present`,`activity`,`礼物,礼盒,生日`],[`🎂`,`birthday cake`,`activity`,`生日蛋糕,生日,蛋糕`],[`🎃`,`jack-o-lantern`,`activity`,``],[`🎄`,`christmas tree`,`activity`,``],[`🎅`,`father christmas`,`activity`,`圣诞老人,圣诞,圣诞节`],[`🎆`,`fireworks`,`activity`,``],[`🎇`,`firework sparkler`,`activity`,``],[`🎈`,`balloon`,`activity`,`气球,庆祝,派对`],[`🎉`,`party popper`,`activity`,`彩带,庆祝,派对,欢呼`],[`🎊`,`confetti ball`,`activity`,`庆祝`],[`🎋`,`tanabata tree`,`activity`,``],[`🎌`,`crossed flags`,`flags`,`旗,日本,交叉旗`],[`🎍`,`pine decoration`,`activity`,``],[`🎎`,`japanese dolls`,`activity`,`人偶,日本人偶`],[`🎏`,`carp streamer`,`activity`,`鲤鱼旗,日本,端午节`],[`🎐`,`wind chime`,`activity`,`风铃,夏天`],[`🎑`,`moon viewing ceremony`,`activity`,``],[`🎒`,`school satchel`,`activity`,`书包,背包`],[`🎓`,`graduation cap`,`activity`,`学士帽,毕业,学位`],[`🎖`,`military medal`,`activity`,``],[`🎗`,`reminder ribbon`,`activity`,``],[`🎙`,`studio microphone`,`activity`,``],[`🎚`,`level slider`,`activity`,``],[`🎛`,`control knobs`,`activity`,``],[`🎞`,`film frames`,`activity`,``],[`🎟`,`admission tickets`,`activity`,``],[`🎠`,`carousel horse`,`activity`,`旋转木马,游乐园`],[`🎡`,`ferris wheel`,`activity`,`摩天轮,游乐园`],[`🎢`,`roller coaster`,`activity`,`过山车,游乐园`],[`🎣`,`fishing pole and fish`,`activity`,`钓鱼`],[`🎤`,`microphone`,`activity`,`麦克风,唱歌,K歌`],[`🎥`,`movie camera`,`activity`,`摄影机,电影,拍摄`],[`🎦`,`cinema`,`activity`,``],[`🎧`,`headphone`,`activity`,`耳机,听歌,音乐,戴`],[`🎨`,`artist palette`,`activity`,`调色板,画画,美术,艺术`],[`🎩`,`top hat`,`activity`,`礼帽,魔术帽,帽子`],[`🎪`,`circus tent`,`activity`,`马戏团`],[`🎫`,`ticket`,`activity`,`门票,票,入场券`],[`🎬`,`clapper board`,`activity`,`场记板,电影,拍戏,导演`],[`🎭`,`performing arts`,`activity`,`面具,戏剧,表演,舞台`],[`🎮`,`video game`,`activity`,`游戏机,游戏,手柄,玩`],[`🎯`,`direct hit`,`activity`,`目标`],[`🎰`,`slot machine`,`activity`,``],[`🎱`,`billiards`,`activity`,`台球`],[`🎲`,`game die`,`activity`,`骰子,赌博,游戏`],[`🎳`,`bowling`,`activity`,`保龄球,球`],[`🎴`,`flower playing cards`,`activity`,`花牌,卡牌,纸牌`],[`🎵`,`musical note`,`activity`,`音符,音乐,歌`],[`🎶`,`multiple musical notes`,`activity`,`音符,音乐,唱歌`],[`🎷`,`saxophone`,`activity`,`萨克斯,爵士,乐器`],[`🎸`,`guitar`,`activity`,`吉他,弹吉他,摇滚`],[`🎹`,`musical keyboard`,`activity`,`钢琴,键盘,弹琴`],[`🎺`,`trumpet`,`activity`,`小号,喇叭,乐器`],[`🎻`,`violin`,`activity`,`小提琴,弦乐`],[`🎼`,`musical score`,`activity`,`乐谱,音乐,谱`],[`🎽`,`running shirt with sash`,`activity`,`背心`],[`🎾`,`tennis racquet and ball`,`activity`,`网球,球`],[`🎿`,`ski and ski boot`,`activity`,`滑雪`],[`🏀`,`basketball and hoop`,`activity`,`篮球,球`],[`🏁`,`chequered flag`,`flags`,`终点,旗帜,赛车,比赛`],[`🏂`,`snowboarder`,`activity`,``],[`🏃`,`runner`,`activity`,`跑步,跑,奔跑`],[`🏄`,`surfer`,`activity`,``],[`🏅`,`sports medal`,`activity`,`奖牌,奖章,荣誉`],[`🏆`,`trophy`,`activity`,``],[`🏇`,`horse racing`,`activity`,``],[`🏈`,`american football`,`activity`,`橄榄球,美式足球`],[`🏉`,`rugby football`,`activity`,`橄榄球,英式`],[`🏊`,`swimmer`,`activity`,``],[`🏋`,`weight lifter`,`activity`,``],[`🏌`,`golfer`,`activity`,``],[`🏍`,`racing motorcycle`,`activity`,``],[`🏎`,`racing car`,`activity`,``],[`🏏`,`cricket bat and ball`,`activity`,``],[`🏐`,`volleyball`,`activity`,`排球,球`],[`🏑`,`field hockey stick and ball`,`activity`,``],[`🏒`,`ice hockey stick and puck`,`activity`,``],[`🏓`,`table tennis paddle and ball`,`activity`,`乒乓球,乒乓,球`],[`🏔`,`snow capped mountain`,`activity`,``],[`🏕`,`camping`,`activity`,``],[`🏖`,`beach with umbrella`,`activity`,``],[`🏗`,`building construction`,`activity`,``],[`🏘`,`house buildings`,`activity`,``],[`🏙`,`cityscape`,`activity`,``],[`🏚`,`derelict house building`,`activity`,``],[`🏛`,`classical building`,`activity`,``],[`🏜`,`desert`,`activity`,``],[`🏝`,`desert island`,`activity`,``],[`🏞`,`national park`,`activity`,``],[`🏟`,`stadium`,`activity`,``],[`🏠`,`house building`,`travel`,`房子,家,住宅`],[`🏡`,`house with garden`,`travel`,`房子,家,花园`],[`🏢`,`office building`,`travel`,`办公楼,大楼,写字楼`],[`🏣`,`japanese post office`,`travel`,`邮局,邮政`],[`🏤`,`european post office`,`travel`,`邮局`],[`🏥`,`hospital`,`travel`,`医院,医疗`],[`🏦`,`bank`,`travel`,`银行,金融`],[`🏧`,`automated teller machine`,`travel`,``],[`🏨`,`hotel`,`travel`,`酒店,旅馆`],[`🏩`,`love hotel`,`travel`,`爱情旅馆,酒店`],[`🏪`,`convenience store`,`travel`,`便利店,商店`],[`🏫`,`school`,`travel`,`学校,校园`],[`🏬`,`department store`,`travel`,`商场,百货,购物`],[`🏭`,`factory`,`travel`,`工厂,工业`],[`🏮`,`izakaya lantern`,`travel`,``],[`🏯`,`japanese castle`,`objects`,`城堡,日本城堡`],[`🏰`,`european castle`,`travel`,`城堡,童话`],[`🏳`,`waving white flag`,`flags`,``],[`🏴`,`waving black flag`,`flags`,`黑旗`],[`🏵`,`rosette`,`objects`,``],[`🏷`,`label`,`objects`,``],[`🏸`,`badminton racquet and shuttlecock`,`activity`,`羽毛球,球`],[`🏹`,`bow and arrow`,`activity`,`射箭,弓箭,弓`],[`🏺`,`amphora`,`activity`,`陶罐,花瓶,双耳瓶`],[`🏻`,`emoji modifier fitzpatrick type-1-2`,`symbols`,``],[`🏼`,`emoji modifier fitzpatrick type-3`,`symbols`,``],[`🏽`,`emoji modifier fitzpatrick type-4`,`symbols`,``],[`🏾`,`emoji modifier fitzpatrick type-5`,`symbols`,``],[`🏿`,`emoji modifier fitzpatrick type-6`,`symbols`,``],[`🐀`,`rat`,`animals`,`老鼠,鼠`],[`🐁`,`mouse`,`animals`,`老鼠,鼠`],[`🐂`,`ox`,`animals`,`公牛,牛`],[`🐃`,`water buffalo`,`animals`,`水牛,牛`],[`🐄`,`cow`,`animals`,`奶牛,牛`],[`🐅`,`tiger`,`animals`,``],[`🐆`,`leopard`,`animals`,``],[`🐇`,`rabbit`,`animals`,`兔子,兔`],[`🐈`,`cat`,`animals`,`猫,猫咪`],[`🐉`,`dragon`,`animals`,`龙,中国龙`],[`🐊`,`crocodile`,`animals`,`鳄鱼,短吻鳄`],[`🐋`,`whale`,`animals`,`鲸鱼`],[`🐌`,`snail`,`animals`,``],[`🐍`,`snake`,`animals`,`蛇,爬行动物`],[`🐎`,`horse`,`animals`,``],[`🐏`,`ram`,`animals`,`羊,公羊`],[`🐐`,`goat`,`animals`,`山羊,羊`],[`🐑`,`sheep`,`animals`,`羊,绵羊`],[`🐒`,`monkey`,`animals`,``],[`🐓`,`rooster`,`animals`,`公鸡,鸡`],[`🐔`,`chicken`,`animals`,`鸡,母鸡`],[`🐕`,`dog`,`animals`,`狗,小狗`],[`🐖`,`pig`,`animals`,`猪`],[`🐗`,`boar`,`animals`,`野猪,猪`],[`🐘`,`elephant`,`animals`,`大象`],[`🐙`,`octopus`,`animals`,`章鱼,八爪鱼`],[`🐚`,`spiral shell`,`animals`,``],[`🐛`,`bug`,`animals`,``],[`🐜`,`ant`,`animals`,``],[`🐝`,`honeybee`,`animals`,``],[`🐞`,`lady beetle`,`animals`,``],[`🐟`,`fish`,`animals`,`鱼,鱼`],[`🐠`,`tropical fish`,`animals`,`热带鱼,鱼`],[`🐡`,`blowfish`,`animals`,`河豚,鱼`],[`🐢`,`turtle`,`animals`,`乌龟,慢`],[`🐣`,`hatching chick`,`animals`,`小鸡,破壳,孵化`],[`🐤`,`baby chick`,`animals`,`小鸡,黄,可爱`],[`🐥`,`front-facing baby chick`,`animals`,`小鸡,正面`],[`🐦`,`bird`,`animals`,`鸟`],[`🐧`,`penguin`,`animals`,`企鹅,南极`],[`🐨`,`koala`,`animals`,`考拉,无尾熊`],[`🐩`,`poodle`,`animals`,`贵宾犬,狗`],[`🐪`,`dromedary camel`,`animals`,`骆驼`],[`🐫`,`bactrian camel`,`animals`,`骆驼,双峰`],[`🐬`,`dolphin`,`animals`,`海豚,海洋`],[`🐭`,`mouse face`,`animals`,`老鼠,鼠`],[`🐮`,`cow face`,`animals`,`牛,奶牛`],[`🐯`,`tiger face`,`animals`,``],[`🐰`,`rabbit face`,`animals`,`兔子,兔,可爱`],[`🐱`,`cat face`,`animals`,``],[`🐲`,`dragon face`,`animals`,`龙,龙头`],[`🐳`,`spouting whale`,`animals`,`鲸鱼,喷水`],[`🐴`,`horse face`,`animals`,`马`],[`🐵`,`monkey face`,`animals`,``],[`🐶`,`dog face`,`animals`,``],[`🐷`,`pig face`,`animals`,`猪,猪头`],[`🐸`,`frog face`,`animals`,`青蛙,蛙`],[`🐹`,`hamster face`,`animals`,`仓鼠`],[`🐺`,`wolf face`,`animals`,``],[`🐻`,`bear face`,`animals`,`熊,泰迪熊`],[`🐼`,`panda face`,`animals`,``],[`🐽`,`pig nose`,`animals`,`猪鼻子,猪`],[`🐾`,`paw prints`,`animals`,`爪印,脚印`],[`🐿`,`chipmunk`,`animals`,``],[`👀`,`eyes`,`people`,``],[`👁`,`eye`,`people`,``],[`👂`,`ear`,`people`,`耳朵,听`],[`👃`,`nose`,`people`,`鼻子,闻`],[`👄`,`mouth`,`people`,`嘴巴,嘴唇,吻`],[`👅`,`tongue`,`people`,`舌头,舔`],[`👆`,`white up pointing backhand index`,`people`,`指,上面,向上`],[`👇`,`white down pointing backhand index`,`people`,`指,下面,向下`],[`👈`,`white left pointing backhand index`,`people`,`指,左边,指向`],[`👉`,`white right pointing backhand index`,`people`,`指,右边,指向`],[`👊`,`fisted hand sign`,`people`,`拳头,打,战斗`],[`👋`,`waving hand sign`,`people`,`挥手,再见,你好`],[`👌`,`ok hand sign`,`people`,`OK,好,可以`],[`👍`,`thumbs up sign`,`people`,`点赞,好,赞,棒`],[`👎`,`thumbs down sign`,`people`,`差评,不好,踩`],[`👏`,`clapping hands sign`,`people`,`鼓掌,拍手,掌声`],[`👐`,`open hands sign`,`people`,`张开,手,开放`],[`👑`,`crown`,`people`,`皇冠,王冠,国王,女王`],[`👒`,`womans hat`,`people`,`帽子,草帽,遮阳帽`],[`👓`,`eyeglasses`,`people`,`眼镜`],[`👔`,`necktie`,`people`,`领带,西装,工作`],[`👕`,`t-shirt`,`people`,`衣服,T恤`],[`👖`,`jeans`,`people`,`裤子,牛仔裤`],[`👗`,`dress`,`people`,`裙子,连衣裙`],[`👘`,`kimono`,`people`,`和服`],[`👙`,`bikini`,`people`,`比基尼,泳装`],[`👚`,`womans clothes`,`people`,`女装,衣服`],[`👛`,`purse`,`people`,`钱包,小包`],[`👜`,`handbag`,`people`,`手提包,包包`],[`👝`,`pouch`,`people`,`手拿包,包包`],[`👞`,`mans shoe`,`people`,`皮鞋,鞋`],[`👟`,`athletic shoe`,`people`,`运动鞋,跑鞋`],[`👠`,`high-heeled shoe`,`people`,`高跟鞋,鞋`],[`👡`,`womans sandal`,`people`,`凉鞋,鞋`],[`👢`,`womans boots`,`people`,`靴子,长靴`],[`👣`,`footprints`,`people`,`脚印,脚步,足迹`],[`👤`,`bust in silhouette`,`people`,`人,剪影,用户`],[`👥`,`busts in silhouette`,`people`,`人群,人,多个人`],[`👦`,`boy`,`people`,`男孩,小男孩`],[`👧`,`girl`,`people`,`女孩,小女孩`],[`👨`,`man`,`people`,`男人,男士`],[`👩`,`woman`,`people`,`女人,女士`],[`👪`,`family`,`people`,`家庭`],[`👫`,`woman and man holding hands`,`people`,``],[`👬`,`men holding hands`,`people`,``],[`👭`,`women holding hands`,`people`,``],[`👮`,`police officer`,`people`,`警察,警官`],[`👯`,`woman with bunny ears`,`people`,`兔子舞,蹦迪,派对`],[`👰`,`bride with veil`,`people`,`新娘,婚纱,结婚`],[`👱`,`person with blond hair`,`people`,``],[`👲`,`man with gua pi mao`,`people`,`中国人`],[`👳`,`man with turban`,`people`,`包头巾,印度,阿拉伯`],[`👴`,`older man`,`people`,`老人,老爷爷`],[`👵`,`older woman`,`people`,`老人,老奶奶`],[`👶`,`baby`,`people`,`婴儿,宝宝,小孩`],[`👷`,`construction worker`,`people`,`工人`],[`👸`,`princess`,`people`,`公主,女王`],[`👹`,`japanese ogre`,`people`,`妖怪,鬼,怪物`],[`👺`,`japanese goblin`,`people`,`天狗,怪物,鬼`],[`👻`,`ghost`,`people`,`幽灵,鬼,万圣节`],[`👼`,`baby angel`,`people`,`天使,婴儿,可爱`],[`👽`,`extraterrestrial alien`,`people`,`外星人,ET,飞碟`],[`👾`,`alien monster`,`people`,`外星人,怪兽,游戏`],[`👿`,`imp`,`people`,`恶魔,愤怒`],[`💀`,`skull`,`people`,`骷髅,死亡,骨头`],[`💁`,`information desk person`,`people`,``],[`💂`,`guardsman`,`people`,`卫兵,士兵`],[`💃`,`dancer`,`people`,`跳舞,舞女,跳舞`],[`💄`,`lipstick`,`people`,`口红,化妆`],[`💅`,`nail polish`,`people`,`美甲,指甲,涂`],[`💆`,`face massage`,`people`,`按摩,放松,头部`],[`💇`,`haircut`,`people`,`理发,剪发,发型`],[`💈`,`barber pole`,`people`,`理发店,理发`],[`💉`,`syringe`,`people`,`注射器,针,疫苗`],[`💊`,`pill`,`people`,`药丸,药,胶囊`],[`💋`,`kiss mark`,`people`,`吻,口红印,亲亲`],[`💌`,`love letter`,`people`,`情书,信,爱情`],[`💍`,`ring`,`people`,`戒指,钻戒,结婚`],[`💎`,`gem stone`,`people`,`钻石,宝石,珠宝`],[`💏`,`kiss`,`people`,``],[`💐`,`bouquet`,`smileys`,`花束,花,礼物`],[`💑`,`couple with heart`,`smileys`,``],[`💒`,`wedding`,`smileys`,`教堂,婚礼,教堂婚礼`],[`💓`,`beating heart`,`smileys`,`爱心,跳动,心跳`],[`💔`,`broken heart`,`smileys`,`心碎,伤心,破碎`],[`💕`,`two hearts`,`smileys`,`爱心,两个,喜欢`],[`💖`,`sparkling heart`,`smileys`,`爱心,闪光,喜欢`],[`💗`,`growing heart`,`smileys`,`爱心,跳动,喜欢`],[`💘`,`heart with arrow`,`smileys`,`爱心,箭,丘比特`],[`💙`,`blue heart`,`smileys`,``],[`💚`,`green heart`,`smileys`,``],[`💛`,`yellow heart`,`smileys`,``],[`💜`,`purple heart`,`smileys`,``],[`💝`,`heart with ribbon`,`smileys`,`爱心,礼物,蝴蝶结`],[`💞`,`revolving hearts`,`smileys`,`爱心,旋转,轮回`],[`💟`,`heart decoration`,`smileys`,`爱心,符号`],[`💠`,`diamond shape with a dot inside`,`objects`,``],[`💡`,`electric light bulb`,`objects`,``],[`💢`,`anger symbol`,`objects`,`生气,怒气`],[`💣`,`bomb`,`objects`,`炸弹,爆炸`],[`💤`,`sleeping symbol`,`objects`,`睡觉,打呼,困`],[`💥`,`collision symbol`,`objects`,``],[`💦`,`splashing sweat symbol`,`objects`,`汗,水,泪`],[`💧`,`droplet`,`objects`,`水滴,水,眼泪`],[`💨`,`dash symbol`,`objects`,`风,跑,快,烟雾`],[`💩`,`pile of poo`,`objects`,`大便,屎,狗屎`],[`💪`,`flexed biceps`,`people`,`肌肉,力量,加油,强壮`],[`💫`,`dizzy symbol`,`objects`,`星星,旋转`],[`💬`,`speech balloon`,`objects`,`对话,聊天`],[`💭`,`thought balloon`,`objects`,`想法,思考,气泡`],[`💮`,`white flower`,`objects`,``],[`💯`,`hundred points symbol`,`objects`,``],[`💰`,`money bag`,`objects`,`钱袋,钱,金钱`],[`💱`,`currency exchange`,`objects`,``],[`💲`,`heavy dollar sign`,`objects`,``],[`💳`,`credit card`,`objects`,`信用卡,银行卡,支付`],[`💴`,`banknote with yen sign`,`objects`,`日元,日圆,钱`],[`💵`,`banknote with dollar sign`,`objects`,`美元,美金,钱`],[`💶`,`banknote with euro sign`,`objects`,`欧元,钱`],[`💷`,`banknote with pound sign`,`objects`,`英镑,钱`],[`💸`,`money with wings`,`objects`,`钱,飞钱,花钱`],[`💹`,`chart with upwards trend and yen sign`,`objects`,`股票,上涨,图表,增长`],[`💺`,`seat`,`objects`,`座位,椅子,飞机座位`],[`💻`,`personal computer`,`objects`,`电脑,笔记本,笔记本电脑`],[`💼`,`briefcase`,`objects`,`公文包,工作,商务`],[`💽`,`minidisc`,`objects`,`光盘,磁盘`],[`💾`,`floppy disk`,`objects`,`软盘,保存`],[`💿`,`optical disc`,`objects`,`光盘,CD`],[`📀`,`dvd`,`objects`,`光盘,DVD`],[`📁`,`file folder`,`objects`,`文件夹`],[`📂`,`open file folder`,`objects`,`文件夹,打开`],[`📃`,`page with curl`,`objects`,`文件,文档`],[`📄`,`page facing up`,`objects`,`文件,文档,纸`],[`📅`,`calendar`,`objects`,`日历`],[`📆`,`tear-off calendar`,`objects`,`日历,日历页`],[`📇`,`card index`,`objects`,`名片,索引卡`],[`📈`,`chart with upwards trend`,`objects`,``],[`📉`,`chart with downwards trend`,`objects`,``],[`📊`,`bar chart`,`objects`,``],[`📋`,`clipboard`,`objects`,`剪贴板,清单,列表`],[`📌`,`pushpin`,`objects`,``],[`📍`,`round pushpin`,`objects`,``],[`📎`,`paperclip`,`objects`,``],[`📏`,`straight ruler`,`objects`,``],[`📐`,`triangular ruler`,`objects`,``],[`📑`,`bookmark tabs`,`objects`,`书签,标签,文件`],[`📒`,`ledger`,`objects`,``],[`📓`,`notebook`,`objects`,``],[`📔`,`notebook with decorative cover`,`objects`,``],[`📕`,`closed book`,`objects`,``],[`📖`,`open book`,`objects`,``],[`📗`,`green book`,`objects`,``],[`📘`,`blue book`,`objects`,``],[`📙`,`orange book`,`objects`,``],[`📚`,`books`,`objects`,``],[`📛`,`name badge`,`objects`,``],[`📜`,`scroll`,`objects`,``],[`📝`,`memo`,`objects`,`笔记,备忘录,写作,文档`],[`📞`,`telephone receiver`,`objects`,`电话`],[`📟`,`pager`,`objects`,`寻呼机,传呼机`],[`📠`,`fax machine`,`objects`,`传真机,传真`],[`📡`,`satellite antenna`,`objects`,`天线,卫星,信号`],[`📢`,`public address loudspeaker`,`objects`,``],[`📣`,`cheering megaphone`,`objects`,``],[`📤`,`outbox tray`,`objects`,`发送,输出,上传`],[`📥`,`inbox tray`,`objects`,`接收,下载,收件箱`],[`📦`,`package`,`objects`,`包裹,快递,箱子`],[`📧`,`e-mail symbol`,`objects`,`邮件,电子邮件`],[`📨`,`incoming envelope`,`objects`,`邮件,收到`],[`📩`,`envelope with downwards arrow above`,`objects`,`邮件,发送`],[`📪`,`closed mailbox with lowered flag`,`objects`,`邮箱,关闭`],[`📫`,`closed mailbox with raised flag`,`objects`,`邮箱,信箱,邮件`],[`📬`,`open mailbox with raised flag`,`objects`,`邮箱,有信`],[`📭`,`open mailbox with lowered flag`,`objects`,`邮箱,无信`],[`📮`,`postbox`,`objects`,`邮筒,邮政`],[`📯`,`postal horn`,`objects`,``],[`📰`,`newspaper`,`objects`,`报纸,新闻,报`],[`📱`,`mobile phone`,`objects`,`手机,智能手机,电话`],[`📲`,`mobile phone with rightwards arrow at left`,`objects`,`手机,接收,信号`],[`📳`,`vibration mode`,`objects`,``],[`📴`,`mobile phone off`,`objects`,``],[`📵`,`no mobile phones`,`objects`,``],[`📶`,`antenna with bars`,`objects`,``],[`📷`,`camera`,`objects`,`相机,拍照,照片`],[`📸`,`camera with flash`,`objects`,`相机,闪光灯,拍照`],[`📹`,`video camera`,`objects`,`摄像机,录像`],[`📺`,`television`,`objects`,``],[`📻`,`radio`,`objects`,`收音机,广播`],[`📼`,`videocassette`,`objects`,`录像带,磁带`],[`📽`,`film projector`,`objects`,``],[`📿`,`prayer beads`,`objects`,`念珠,佛珠,项链`],[`🔀`,`twisted rightwards arrows`,`objects`,``],[`🔁`,`clockwise rightwards and leftwards open circle arrows`,`objects`,``],[`🔂`,`clockwise rightwards and leftwards open circle arrows with circled one overlay`,`objects`,``],[`🔃`,`clockwise downwards and upwards open circle arrows`,`objects`,``],[`🔄`,`anticlockwise downwards and upwards open circle arrows`,`objects`,``],[`🔅`,`low brightness symbol`,`objects`,``],[`🔆`,`high brightness symbol`,`objects`,``],[`🔇`,`speaker with cancellation stroke`,`objects`,``],[`🔈`,`speaker`,`objects`,``],[`🔉`,`speaker with one sound wave`,`objects`,``],[`🔊`,`speaker with three sound waves`,`objects`,``],[`🔋`,`battery`,`objects`,``],[`🔌`,`electric plug`,`objects`,``],[`🔍`,`left-pointing magnifying glass`,`objects`,`搜索,放大镜,查找,查询`],[`🔎`,`right-pointing magnifying glass`,`objects`,`搜索,放大镜,查找`],[`🔏`,`lock with ink pen`,`objects`,`锁,保密,笔`],[`🔐`,`closed lock with key`,`objects`,`锁,安全,钥匙`],[`🔑`,`key`,`objects`,`钥匙,解锁`],[`🔒`,`lock`,`objects`,`锁,锁定,安全`],[`🔓`,`open lock`,`objects`,`解锁,打开`],[`🔔`,`bell`,`objects`,``],[`🔕`,`bell with cancellation stroke`,`objects`,``],[`🔖`,`bookmark`,`objects`,`书签,标记`],[`🔗`,`link symbol`,`objects`,``],[`🔘`,`radio button`,`objects`,``],[`🔙`,`back with leftwards arrow above`,`objects`,``],[`🔚`,`end with leftwards arrow above`,`objects`,``],[`🔛`,`on with exclamation mark with left right arrow above`,`objects`,``],[`🔜`,`soon with rightwards arrow above`,`objects`,``],[`🔝`,`top with upwards arrow above`,`objects`,``],[`🔞`,`no one under eighteen symbol`,`objects`,``],[`🔟`,`keycap 10`,`objects`,``],[`🔠`,`input symbol for latin capital letters`,`objects`,``],[`🔡`,`input symbol for latin small letters`,`objects`,``],[`🔢`,`input symbol for numbers`,`objects`,``],[`🔣`,`input symbol for symbols`,`objects`,``],[`🔤`,`input symbol for latin letters`,`objects`,``],[`🔥`,`fire`,`objects`,``],[`🔦`,`electric torch`,`objects`,``],[`🔧`,`wrench`,`objects`,`扳手,工具,维修`],[`🔨`,`hammer`,`objects`,`锤子,工具`],[`🔩`,`nut and bolt`,`objects`,`螺丝,螺母`],[`🔪`,`hocho`,`objects`,``],[`🔫`,`pistol`,`objects`,`枪`],[`🔬`,`microscope`,`objects`,`显微镜,科学,研究`],[`🔭`,`telescope`,`objects`,`望远镜,天文,观察`],[`🔮`,`crystal ball`,`objects`,``],[`🔯`,`six pointed star with middle dot`,`objects`,``],[`🔰`,`japanese symbol for beginner`,`objects`,``],[`🔱`,`trident emblem`,`objects`,``],[`🔲`,`black square button`,`objects`,``],[`🔳`,`white square button`,`objects`,``],[`🔴`,`large red circle`,`objects`,``],[`🔵`,`large blue circle`,`objects`,``],[`🔶`,`large orange diamond`,`objects`,``],[`🔷`,`large blue diamond`,`objects`,``],[`🔸`,`small orange diamond`,`objects`,``],[`🔹`,`small blue diamond`,`objects`,``],[`🔺`,`up-pointing red triangle`,`objects`,``],[`🔻`,`down-pointing red triangle`,`objects`,``],[`🔼`,`up-pointing small red triangle`,`objects`,``],[`🔽`,`down-pointing small red triangle`,`objects`,``],[`🕉`,`om symbol`,`objects`,``],[`🕊`,`dove of peace`,`objects`,``],[`🕋`,`kaaba`,`objects`,`天房,麦加,伊斯兰`],[`🕌`,`mosque`,`objects`,`清真寺,伊斯兰`],[`🕍`,`synagogue`,`objects`,`犹太教堂,犹太`],[`🕎`,`menorah with nine branches`,`objects`,``],[`🕐`,`clock face one oclock`,`objects`,`一点,时钟`],[`🕑`,`clock face two oclock`,`objects`,`两点,时钟`],[`🕒`,`clock face three oclock`,`objects`,`三点,时钟`],[`🕓`,`clock face four oclock`,`objects`,`四点,时钟`],[`🕔`,`clock face five oclock`,`objects`,`五点,时钟`],[`🕕`,`clock face six oclock`,`objects`,`六点,时钟`],[`🕖`,`clock face seven oclock`,`objects`,`七点,时钟`],[`🕗`,`clock face eight oclock`,`objects`,`八点,时钟`],[`🕘`,`clock face nine oclock`,`objects`,`九点,时钟`],[`🕙`,`clock face ten oclock`,`objects`,`十点,时钟`],[`🕚`,`clock face eleven oclock`,`objects`,`十一点,时钟`],[`🕛`,`clock face twelve oclock`,`objects`,`十二点,时钟,时间`],[`🕜`,`clock face one-thirty`,`objects`,``],[`🕝`,`clock face two-thirty`,`objects`,``],[`🕞`,`clock face three-thirty`,`objects`,``],[`🕟`,`clock face four-thirty`,`objects`,``],[`🕠`,`clock face five-thirty`,`objects`,``],[`🕡`,`clock face six-thirty`,`objects`,``],[`🕢`,`clock face seven-thirty`,`objects`,``],[`🕣`,`clock face eight-thirty`,`objects`,``],[`🕤`,`clock face nine-thirty`,`objects`,``],[`🕥`,`clock face ten-thirty`,`objects`,``],[`🕦`,`clock face eleven-thirty`,`objects`,``],[`🕧`,`clock face twelve-thirty`,`objects`,``],[`🕯`,`candle`,`objects`,``],[`🕰`,`mantelpiece clock`,`objects`,``],[`🕳`,`hole`,`objects`,``],[`🕴`,`man in business suit levitating`,`objects`,``],[`🕵`,`sleuth or spy`,`objects`,``],[`🕶`,`dark sunglasses`,`objects`,``],[`🕷`,`spider`,`objects`,``],[`🕸`,`spider web`,`objects`,``],[`🕹`,`joystick`,`objects`,``],[`🕺`,`man dancing`,`objects`,`跳舞,舞男`],[`🖇`,`linked paperclips`,`objects`,``],[`🖊`,`lower left ballpoint pen`,`objects`,``],[`🖋`,`lower left fountain pen`,`objects`,``],[`🖌`,`lower left paintbrush`,`objects`,``],[`🖍`,`lower left crayon`,`objects`,``],[`🖐`,`raised hand with fingers splayed`,`objects`,``],[`🖕`,`reversed hand with middle finger extended`,`objects`,`中指,骂人`],[`🖖`,`raised hand with part between middle and ring fingers`,`objects`,`瓦肯,举手,胜利`],[`🖤`,`black heart`,`objects`,``],[`🖥`,`desktop computer`,`objects`,``],[`🖨`,`printer`,`objects`,``],[`🖱`,`three button mouse`,`objects`,``],[`🖲`,`trackball`,`objects`,``],[`🖼`,`frame with picture`,`objects`,``],[`🗂`,`card index dividers`,`objects`,``],[`🗃`,`card file box`,`objects`,``],[`🗄`,`file cabinet`,`objects`,``],[`🗑`,`wastebasket`,`objects`,``],[`🗒`,`spiral note pad`,`objects`,``],[`🗓`,`spiral calendar pad`,`objects`,``],[`🗜`,`compression`,`objects`,``],[`🗝`,`old key`,`objects`,``],[`🗞`,`rolled-up newspaper`,`objects`,``],[`🗡`,`dagger knife`,`objects`,``],[`🗣`,`speaking head in silhouette`,`objects`,``],[`🗨`,`left speech bubble`,`objects`,``],[`🗯`,`right anger bubble`,`objects`,``],[`🗳`,`ballot box with ballot`,`objects`,``],[`🗺`,`world map`,`objects`,``],[`🗻`,`mount fuji`,`objects`,`富士山,山`],[`🗼`,`tokyo tower`,`objects`,`塔,东京塔`],[`🗽`,`statue of liberty`,`objects`,`自由女神像,纽约`],[`🗾`,`silhouette of japan`,`objects`,``],[`🗿`,`moyai`,`objects`,`雕像`],[`😀`,`grinning face`,`smileys`,`笑脸,开心,高兴`],[`😁`,`grinning face with smiling eyes`,`smileys`,`笑脸,开心`],[`😂`,`face with tears of joy`,`smileys`,`笑哭,大笑,笑`],[`😃`,`smiling face with open mouth`,`smileys`,`笑脸,开心`],[`😄`,`smiling face with open mouth and smiling eyes`,`smileys`,`笑脸,开心`],[`😅`,`smiling face with open mouth and cold sweat`,`smileys`,`笑脸,汗,尴尬`],[`😆`,`smiling face with open mouth and tightly-closed eyes`,`smileys`,`笑脸,大笑`],[`😇`,`smiling face with halo`,`smileys`,`天使,微笑,善良`],[`😈`,`smiling face with horns`,`smileys`,`恶魔,坏笑,邪恶`],[`😉`,`winking face`,`smileys`,`眨眼,调皮`],[`😊`,`smiling face with smiling eyes`,`smileys`,`微笑,开心,脸红`],[`😋`,`face savouring delicious food`,`smileys`,`好吃,美味,舔`],[`😌`,`relieved face`,`smileys`,`放松,安心`],[`😍`,`smiling face with heart-shaped eyes`,`smileys`,`爱,喜欢,花痴`],[`😎`,`smiling face with sunglasses`,`smileys`,`酷,墨镜,帅气`],[`😏`,`smirking face`,`smileys`,`得意,微笑,坏笑`],[`😐`,`neutral face`,`smileys`,`无语,面无表情`],[`😑`,`expressionless face`,`smileys`,`无语,面无表情`],[`😒`,`unamused face`,`smileys`,`不满,无语,翻白眼`],[`😓`,`face with cold sweat`,`smileys`,`冷汗,尴尬`],[`😔`,`pensive face`,`smileys`,`难过,低落`],[`😕`,`confused face`,`smileys`,`困惑,不解`],[`😖`,`confounded face`,`smileys`,`纠结,痛苦`],[`😗`,`kissing face`,`smileys`,`亲亲,吻`],[`😘`,`face throwing a kiss`,`smileys`,`飞吻,亲亲,爱`],[`😙`,`kissing face with smiling eyes`,`smileys`,``],[`😚`,`kissing face with closed eyes`,`smileys`,`亲亲,吻`],[`😛`,`face with stuck-out tongue`,`smileys`,`吐舌头,调皮`],[`😜`,`face with stuck-out tongue and winking eye`,`smileys`,`吐舌头,调皮,眨眼`],[`😝`,`face with stuck-out tongue and tightly-closed eyes`,`smileys`,`吐舌头,调皮`],[`😞`,`disappointed face`,`smileys`,`失望,难过`],[`😟`,`worried face`,`smileys`,`担心,忧虑`],[`😠`,`angry face`,`smileys`,`生气,愤怒`],[`😡`,`pouting face`,`smileys`,`生气,愤怒,红脸`],[`😢`,`crying face`,`smileys`,`哭,伤心,流泪`],[`😣`,`persevering face`,`smileys`,`挣扎,痛苦`],[`😤`,`face with look of triumph`,`smileys`,`生气,冒烟,气`],[`😥`,`disappointed but relieved face`,`smileys`,`难过,失望,松气`],[`😦`,`frowning face with open mouth`,`smileys`,`惊讶,张嘴`],[`😧`,`anguished face`,`smileys`,`震惊,痛苦`],[`😨`,`fearful face`,`smileys`,`害怕,恐惧`],[`😩`,`weary face`,`smileys`,`累,疲惫,哭`],[`😪`,`sleepy face`,`smileys`,`困,想睡`],[`😫`,`tired face`,`smileys`,`累,疲惫`],[`😬`,`grimacing face`,`smileys`,`尴尬,咧嘴`],[`😭`,`loudly crying face`,`smileys`,`大哭,伤心,哭`],[`😮`,`face with open mouth`,`smileys`,`惊讶,哇`],[`😯`,`hushed face`,`smileys`,`惊讶,安静`],[`😰`,`face with open mouth and cold sweat`,`smileys`,`担心,冷汗`],[`😱`,`face screaming in fear`,`smileys`,`尖叫,害怕,恐怖`],[`😲`,`astonished face`,`smileys`,`震惊,惊讶`],[`😳`,`flushed face`,`smileys`,`脸红,害羞,震惊`],[`😴`,`sleeping face`,`smileys`,`睡觉,睡觉`],[`😵`,`dizzy face`,`smileys`,`晕,头晕,死`],[`😶`,`face without mouth`,`smileys`,`沉默,无语`],[`😷`,`face with medical mask`,`smileys`,`生病,口罩,感冒`],[`😸`,`grinning cat face with smiling eyes`,`smileys`,`猫,笑脸`],[`😹`,`cat face with tears of joy`,`smileys`,`猫,笑哭`],[`😺`,`smiling cat face with open mouth`,`smileys`,`猫,笑脸,开心`],[`😻`,`smiling cat face with heart-shaped eyes`,`smileys`,`猫,爱,喜欢`],[`😼`,`cat face with wry smile`,`smileys`,`猫,坏笑`],[`😽`,`kissing cat face with closed eyes`,`smileys`,`猫,亲亲`],[`😾`,`pouting cat face`,`smileys`,`猫,生气`],[`😿`,`crying cat face`,`smileys`,`猫,哭,伤心`],[`🙀`,`weary cat face`,`smileys`,`猫,震惊,害怕`],[`🙁`,`slightly frowning face`,`smileys`,`难过,失望`],[`🙂`,`slightly smiling face`,`smileys`,`微笑,笑`],[`🙃`,`upside-down face`,`smileys`,`微笑,倒`],[`🙄`,`face with rolling eyes`,`smileys`,`翻白眼,无语`],[`🙅`,`face with no good gesture`,`smileys`,``],[`🙆`,`face with ok gesture`,`smileys`,``],[`🙇`,`person bowing deeply`,`smileys`,``],[`🙈`,`see-no-evil monkey`,`smileys`,``],[`🙉`,`hear-no-evil monkey`,`smileys`,``],[`🙊`,`speak-no-evil monkey`,`smileys`,``],[`🙋`,`happy person raising one hand`,`smileys`,``],[`🙌`,`person raising both hands in celebration`,`smileys`,`欢呼,举起,庆祝`],[`🙍`,`person frowning`,`smileys`,``],[`🙎`,`person with pouting face`,`smileys`,``],[`🙏`,`person with folded hands`,`smileys`,`祈祷,拜托,感谢,合十`],[`🚀`,`rocket`,`travel`,`火箭,发射,太空`],[`🚁`,`helicopter`,`travel`,`直升机`],[`🚂`,`steam locomotive`,`travel`,`火车,蒸汽火车`],[`🚃`,`railway car`,`travel`,`电车,火车`],[`🚄`,`high-speed train`,`travel`,`高铁,动车,火车`],[`🚅`,`high-speed train with bullet nose`,`travel`,``],[`🚆`,`train`,`travel`,`火车,铁路`],[`🚇`,`metro`,`travel`,`地铁,地铁站`],[`🚈`,`light rail`,`travel`,`轻轨,轨道交通`],[`🚉`,`station`,`travel`,`火车站,车站`],[`🚊`,`tram`,`travel`,`电车`],[`🚋`,`tram car`,`travel`,`电车,有轨电车`],[`🚌`,`bus`,`travel`,`公交车,巴士`],[`🚍`,`oncoming bus`,`travel`,`公交车`],[`🚎`,`trolleybus`,`travel`,`无轨电车,巴士`],[`🚏`,`bus stop`,`travel`,`公交站,车站`],[`🚐`,`minibus`,`travel`,`面包车,小巴`],[`🚑`,`ambulance`,`travel`,`救护车,急救`],[`🚒`,`fire engine`,`travel`,`消防车,救火`],[`🚓`,`police car`,`travel`,`警车,警察`],[`🚔`,`oncoming police car`,`travel`,`警车,巡逻`],[`🚕`,`taxi`,`travel`,`出租车,的士`],[`🚖`,`oncoming taxi`,`travel`,`出租车`],[`🚗`,`automobile`,`travel`,`汽车,轿车,车`],[`🚘`,`oncoming automobile`,`travel`,`汽车`],[`🚙`,`recreational vehicle`,`travel`,`SUV,越野车,汽车`],[`🚚`,`delivery truck`,`travel`,`卡车,货车`],[`🚛`,`articulated lorry`,`travel`,`卡车,货车`],[`🚜`,`tractor`,`travel`,`拖拉机,农用`],[`🚝`,`monorail`,`travel`,`单轨,单轨列车`],[`🚞`,`mountain railway`,`travel`,`火车,山区铁路`],[`🚟`,`suspension railway`,`travel`,`缆车,悬挂列车`],[`🚠`,`mountain cableway`,`travel`,`缆车,高山`],[`🚡`,`aerial tramway`,`travel`,`缆车,索道`],[`🚢`,`ship`,`travel`,`轮船,船,大海`],[`🚣`,`rowboat`,`travel`,``],[`🚤`,`speedboat`,`travel`,`快艇,汽艇`],[`🚥`,`horizontal traffic light`,`travel`,`红绿灯,交通信号灯`],[`🚦`,`vertical traffic light`,`travel`,`红绿灯,信号灯`],[`🚧`,`construction sign`,`travel`,`施工,施工中,路障`],[`🚨`,`police cars revolving light`,`travel`,`警车灯,警报,紧急`],[`🚩`,`triangular flag on post`,`travel`,`红旗,旗帜,标志`],[`🚪`,`door`,`travel`,`门,房门`],[`🚫`,`no entry sign`,`travel`,``],[`🚬`,`smoking symbol`,`travel`,`香烟,烟,吸烟`],[`🚭`,`no smoking symbol`,`travel`,``],[`🚮`,`put litter in its place symbol`,`travel`,`垃圾,清理`],[`🚯`,`do not litter symbol`,`travel`,``],[`🚰`,`potable water symbol`,`travel`,``],[`🚱`,`non-potable water symbol`,`travel`,``],[`🚲`,`bicycle`,`travel`,`自行车,单车,骑行`],[`🚳`,`no bicycles`,`travel`,``],[`🚴`,`bicyclist`,`travel`,``],[`🚵`,`mountain bicyclist`,`travel`,``],[`🚶`,`pedestrian`,`travel`,`走路,步行,散步`],[`🚷`,`no pedestrians`,`travel`,``],[`🚸`,`children crossing`,`travel`,``],[`🚹`,`mens symbol`,`travel`,``],[`🚺`,`womens symbol`,`travel`,``],[`🚻`,`restroom`,`travel`,``],[`🚼`,`baby symbol`,`travel`,``],[`🚽`,`toilet`,`travel`,`马桶,厕所,卫生间`],[`🚾`,`water closet`,`travel`,``],[`🚿`,`shower`,`travel`,`淋浴,洗澡`],[`🛀`,`bath`,`travel`,`泡澡`],[`🛁`,`bathtub`,`travel`,`浴缸,洗澡,泡澡`],[`🛂`,`passport control`,`travel`,``],[`🛃`,`customs`,`travel`,``],[`🛄`,`baggage claim`,`travel`,``],[`🛅`,`left luggage`,`travel`,``],[`🛋`,`couch and lamp`,`travel`,``],[`🛌`,`sleeping accommodation`,`travel`,`睡觉`],[`🛍`,`shopping bags`,`travel`,``],[`🛎`,`bellhop bell`,`travel`,``],[`🛏`,`bed`,`travel`,``],[`🛐`,`place of worship`,`travel`,``],[`🛑`,`octagonal sign`,`travel`,`停止,停车,红圈`],[`🛒`,`shopping trolley`,`travel`,`购物车,购物`],[`🛕`,`hindu temple`,`travel`,`印度教神庙`],[`🛖`,`hut`,`travel`,`草屋,小屋`],[`🛗`,`elevator`,`travel`,``],[`🛜`,`wireless`,`travel`,``],[`🛝`,`playground slide`,`travel`,``],[`🛞`,`wheel`,`travel`,`车轮,轮胎`],[`🛟`,`ring buoy`,`travel`,`救生圈,救生`],[`🛠`,`hammer and wrench`,`travel`,``],[`🛡`,`shield`,`travel`,``],[`🛢`,`oil drum`,`travel`,``],[`🛣`,`motorway`,`travel`,``],[`🛤`,`railway track`,`travel`,``],[`🛥`,`motor boat`,`travel`,``],[`🛩`,`small airplane`,`travel`,``],[`🛫`,`airplane departure`,`travel`,`起飞,飞机,出发`],[`🛬`,`airplane arriving`,`travel`,`降落,飞机,到达`],[`🛰`,`satellite`,`travel`,``],[`🛳`,`passenger ship`,`travel`,``],[`🛴`,`scooter`,`travel`,`滑板车,平衡车`],[`🛵`,`motor scooter`,`travel`,`摩托车,电动车,踏板车`],[`🛶`,`canoe`,`travel`,`独木舟,皮划艇`],[`🛷`,`sled`,`travel`,`雪橇,雪车`],[`🛸`,`flying saucer`,`travel`,`飞碟,UFO,外星人`],[`🛹`,`skateboard`,`travel`,`滑板`],[`🛺`,`auto rickshaw`,`travel`,`三轮车,突突车`],[`🛻`,`pickup truck`,`travel`,`皮卡,卡车`],[`🛼`,`roller skate`,`travel`,`轮滑`],[`🟠`,`large orange circle`,`symbols`,``],[`🟡`,`large yellow circle`,`symbols`,``],[`🟢`,`large green circle`,`symbols`,``],[`🟣`,`large purple circle`,`symbols`,``],[`🟤`,`large brown circle`,`symbols`,``],[`🟥`,`large red square`,`symbols`,``],[`🟦`,`large blue square`,`symbols`,``],[`🟧`,`large orange square`,`symbols`,``],[`🟨`,`large yellow square`,`symbols`,``],[`🟩`,`large green square`,`symbols`,``],[`🟪`,`large purple square`,`symbols`,``],[`🟫`,`large brown square`,`symbols`,``],[`🟰`,`heavy equals sign`,`symbols`,``],[`🤌`,`pinched fingers`,`symbols`,`手指,捏,意大利`],[`🤍`,`white heart`,`symbols`,`白心,白色,爱心`],[`🤎`,`brown heart`,`symbols`,`棕心,棕色,爱心`],[`🤏`,`pinching hand`,`symbols`,`捏,一点点,微小`],[`🤐`,`zipper-mouth face`,`smileys`,`闭嘴,不说`],[`🤑`,`money-mouth face`,`smileys`,`发财,金钱,贪婪`],[`🤒`,`face with thermometer`,`smileys`,`发烧,生病,温度计`],[`🤓`,`nerd face`,`smileys`,`书呆子,眼镜`],[`🤔`,`thinking face`,`smileys`,`思考,疑问,想`],[`🤕`,`face with head-bandage`,`smileys`,`受伤,包扎,头`],[`🤖`,`robot face`,`smileys`,`机器人,AI,机械`],[`🤗`,`hugging face`,`smileys`,`拥抱,欢迎`],[`🤘`,`sign of the horns`,`smileys`,`摇滚,手势,牛`],[`🤙`,`call me hand`,`smileys`,`打电话,挂,酷`],[`🤚`,`raised back of hand`,`smileys`,`手,举手,停`],[`🤛`,`left-facing fist`,`smileys`,`拳头,左边`],[`🤜`,`right-facing fist`,`smileys`,`拳头,右边`],[`🤝`,`handshake`,`smileys`,`握手,合作,协议`],[`🤞`,`hand with index and middle fingers crossed`,`smileys`,`祈祷,好运,手指交叉`],[`🤟`,`i love you hand sign`,`smileys`,`爱你,摇滚`],[`🤠`,`face with cowboy hat`,`smileys`,`牛仔,帽子`],[`🤡`,`clown face`,`smileys`,`小丑,马戏团`],[`🤢`,`nauseated face`,`smileys`,`恶心,呕吐`],[`🤣`,`rolling on the floor laughing`,`smileys`,`笑哭,大笑,笑`],[`🤤`,`drooling face`,`smileys`,`流口水,馋`],[`🤥`,`lying face`,`smileys`,`说谎,撒谎`],[`🤦`,`face palm`,`smileys`,`捂脸,无奈,扶额`],[`🤧`,`sneezing face`,`smileys`,`打喷嚏,感冒`],[`🤨`,`face with one eyebrow raised`,`symbols`,`怀疑,挑眉`],[`🤩`,`grinning face with star eyes`,`symbols`,`星星眼,兴奋,惊讶`],[`🤪`,`grinning face with one large and one small eye`,`symbols`,`疯狂,搞怪`],[`🤫`,`face with finger covering closed lips`,`symbols`,`嘘,安静`],[`🤬`,`serious face with symbols covering mouth`,`symbols`,`骂人,脏话,生气`],[`🤭`,`smiling face with smiling eyes and hand covering mouth`,`symbols`,`捂嘴,偷笑,惊讶`],[`🤮`,`face with open mouth vomiting`,`symbols`,`呕吐,恶心`],[`🤯`,`shocked face with exploding head`,`smileys`,`爆炸,震惊,头炸`],[`🤰`,`pregnant woman`,`people`,`孕妇,怀孕`],[`🤱`,`breast-feeding`,`people`,``],[`🤲`,`palms up together`,`people`,``],[`🤳`,`selfie`,`people`,`自拍,拍照`],[`🤴`,`prince`,`people`,`王子,国王`],[`🤵`,`man in tuxedo`,`people`,`新郎,西装,燕尾服`],[`🤶`,`mother christmas`,`people`,`圣诞奶奶,圣诞老人`],[`🤷`,`shrug`,`people`,`耸肩,无奈,不知道`],[`🤸`,`person doing cartwheel`,`people`,`翻跟头,体操,空翻`],[`🤹`,`juggling`,`people`,`杂耍`],[`🤺`,`fencer`,`people`,`击剑,剑术`],[`🤼`,`wrestlers`,`activity`,`摔跤,格斗`],[`🤽`,`water polo`,`activity`,``],[`🤾`,`handball`,`activity`,``],[`🤿`,`diving mask`,`activity`,`潜水面罩,潜水`],[`🥀`,`wilted flower`,`symbols`,``],[`🥁`,`drum with drumsticks`,`symbols`,`鼓,打鼓,乐器`],[`🥂`,`clinking glasses`,`symbols`,`干杯,香槟杯`],[`🥃`,`tumbler glass`,`symbols`,`威士忌,酒杯`],[`🥄`,`spoon`,`symbols`,`勺子,汤匙`],[`🥅`,`goal net`,`symbols`,`球门,网,进球`],[`🥇`,`first place medal`,`symbols`,`金牌,冠军,第一名,奖牌`],[`🥈`,`second place medal`,`symbols`,`银牌,第二名,奖牌`],[`🥉`,`third place medal`,`symbols`,`铜牌,第三名,奖牌`],[`🥊`,`boxing glove`,`symbols`,`拳击,拳击手套,打拳`],[`🥋`,`martial arts uniform`,`symbols`,`道服,武术,空手道`],[`🥌`,`curling stone`,`symbols`,`冰壶,冰壶`],[`🥍`,`lacrosse stick and ball`,`symbols`,``],[`🥎`,`softball`,`symbols`,`垒球,球`],[`🥏`,`flying disc`,`symbols`,`飞盘,飞碟`],[`🥐`,`croissant`,`food`,`牛角包,可颂`],[`🥑`,`avocado`,`food`,`牛油果,鳄梨`],[`🥒`,`cucumber`,`food`,`黄瓜`],[`🥓`,`bacon`,`food`,`培根,腊肉`],[`🥔`,`potato`,`food`,`土豆,马铃薯`],[`🥕`,`carrot`,`food`,`胡萝卜`],[`🥖`,`baguette bread`,`food`,`法棍,面包`],[`🥗`,`green salad`,`food`,`沙拉,蔬菜`],[`🥘`,`shallow pan of food`,`food`,`炖锅,海鲜饭`],[`🥙`,`stuffed flatbread`,`food`,`卷饼,肉夹馍`],[`🥚`,`egg`,`food`,`鸡蛋,蛋`],[`🥛`,`glass of milk`,`food`,`牛奶,奶`],[`🥜`,`peanuts`,`food`,``],[`🥝`,`kiwifruit`,`food`,`猕猴桃,奇异果`],[`🥞`,`pancakes`,`food`,`松饼,煎饼`],[`🥟`,`dumpling`,`food`,`饺子,锅贴`],[`🥠`,`fortune cookie`,`food`,`幸运饼干`],[`🥡`,`takeout box`,`food`,``],[`🥢`,`chopsticks`,`food`,`筷子`],[`🥣`,`bowl with spoon`,`food`,``],[`🥤`,`cup with straw`,`food`,`饮料,杯`],[`🥥`,`coconut`,`food`,`椰子`],[`🥦`,`broccoli`,`food`,`西兰花`],[`🥧`,`pie`,`food`,`派,馅饼`],[`🥨`,`pretzel`,`food`,`椒盐卷饼`],[`🥩`,`cut of meat`,`food`,`牛排,肉`],[`🥪`,`sandwich`,`food`,`三明治`],[`🥫`,`canned food`,`food`,`罐头,罐装`],[`🥬`,`leafy green`,`symbols`,`青菜,白菜,生菜`],[`🥭`,`mango`,`symbols`,`芒果`],[`🥮`,`moon cake`,`symbols`,``],[`🥯`,`bagel`,`symbols`,`贝果,面包圈`],[`🥰`,`smiling face with smiling eyes and three hearts`,`smileys`,`爱,微笑,爱心`],[`🥱`,`yawning face`,`smileys`,`打哈欠,困,无聊`],[`🥲`,`smiling face with tear`,`smileys`,``],[`🥳`,`face with party horn and party hat`,`smileys`,`庆祝,派对,欢呼`],[`🥴`,`face with uneven eyes and wavy mouth`,`smileys`,`晕,醉,头昏`],[`🥵`,`overheated face`,`smileys`,`热`],[`🥶`,`freezing face`,`smileys`,`冷`],[`🥷`,`ninja`,`people`,`忍者,忍者`],[`🥸`,`disguised face`,`symbols`,`伪装`],[`🥹`,`face holding back tears`,`symbols`,`感动,忍住,哭,泪目`],[`🥺`,`face with pleading eyes`,`smileys`,`可怜,委屈,求`],[`🥻`,`sari`,`symbols`,`纱丽,印度`],[`🥼`,`lab coat`,`symbols`,``],[`🥽`,`goggles`,`symbols`,``],[`🥾`,`hiking boot`,`symbols`,`靴子,登山鞋`],[`🥿`,`flat shoe`,`symbols`,`平底鞋,鞋`],[`🦀`,`crab`,`animals`,`螃蟹,海鲜`],[`🦁`,`lion face`,`animals`,``],[`🦂`,`scorpion`,`animals`,``],[`🦃`,`turkey`,`animals`,`火鸡,感恩节`],[`🦄`,`unicorn face`,`animals`,`独角兽,梦幻`],[`🦅`,`eagle`,`animals`,`老鹰,鹰`],[`🦆`,`duck`,`animals`,`鸭子,鸭`],[`🦇`,`bat`,`animals`,`蝙蝠`],[`🦈`,`shark`,`animals`,`鲨鱼,鱼`],[`🦉`,`owl`,`animals`,`猫头鹰,智慧`],[`🦊`,`fox face`,`animals`,``],[`🦋`,`butterfly`,`animals`,``],[`🦌`,`deer`,`animals`,`鹿,麋鹿`],[`🦍`,`gorilla`,`animals`,``],[`🦎`,`lizard`,`animals`,`蜥蜴,爬行动物`],[`🦏`,`rhinoceros`,`animals`,`犀牛`],[`🦐`,`shrimp`,`animals`,`虾,海鲜`],[`🦑`,`squid`,`animals`,`鱿鱼,海鲜`],[`🦒`,`giraffe face`,`animals`,`长颈鹿`],[`🦓`,`zebra face`,`animals`,`斑马`],[`🦔`,`hedgehog`,`animals`,`刺猬`],[`🦕`,`sauropod`,`animals`,`恐龙,雷龙`],[`🦖`,`t-rex`,`animals`,`恐龙,霸王龙`],[`🦗`,`cricket`,`animals`,``],[`🦘`,`kangaroo`,`animals`,`袋鼠`],[`🦙`,`llama`,`animals`,`羊驼,草泥马`],[`🦚`,`peacock`,`animals`,`孔雀,开屏`],[`🦛`,`hippopotamus`,`animals`,`河马`],[`🦜`,`parrot`,`animals`,`鹦鹉`],[`🦝`,`raccoon`,`animals`,`浣熊`],[`🦞`,`lobster`,`animals`,`龙虾,海鲜`],[`🦟`,`mosquito`,`animals`,``],[`🦠`,`microbe`,`animals`,``],[`🦡`,`badger`,`animals`,`獾`],[`🦢`,`swan`,`animals`,`天鹅,鹅`],[`🦣`,`mammoth`,`animals`,`猛犸象`],[`🦤`,`dodo`,`animals`,`渡渡鸟`],[`🦥`,`sloth`,`animals`,`树懒`],[`🦦`,`otter`,`animals`,`水獭`],[`🦧`,`orangutan`,`animals`,``],[`🦨`,`skunk`,`animals`,`臭鼬`],[`🦩`,`flamingo`,`animals`,`火烈鸟,红鹤`],[`🦪`,`oyster`,`animals`,`生蚝,牡蛎`],[`🦫`,`beaver`,`animals`,`河狸,海狸`],[`🦬`,`bison`,`animals`,`野牛,水牛`],[`🦭`,`seal`,`animals`,`海豹,海狮`],[`🦮`,`guide dog`,`animals`,`导盲犬,狗`],[`🦯`,`probing cane`,`symbols`,``],[`🦰`,`emoji component red hair`,`people`,`红发,头发,发色`],[`🦱`,`emoji component curly hair`,`people`,`卷发,头发`],[`🦲`,`emoji component bald`,`people`,`光头,秃头`],[`🦳`,`emoji component white hair`,`people`,`白发,头发`],[`🦴`,`bone`,`people`,``],[`🦵`,`leg`,`people`,`腿,大腿`],[`🦶`,`foot`,`people`,`脚,足`],[`🦷`,`tooth`,`people`,`牙齿,牙`],[`🦸`,`superhero`,`people`,`英雄`],[`🦹`,`supervillain`,`people`,`超级反派,坏人,反派`],[`🦺`,`safety vest`,`symbols`,``],[`🦻`,`ear with hearing aid`,`symbols`,`助听器,耳朵`],[`🦼`,`motorized wheelchair`,`people`,``],[`🦽`,`manual wheelchair`,`people`,``],[`🦾`,`mechanical arm`,`people`,`机械臂,机器人,义肢`],[`🦿`,`mechanical leg`,`people`,`机械腿,义肢`],[`🧀`,`cheese wedge`,`food`,`奶酪,芝士`],[`🧁`,`cupcake`,`food`,`纸杯蛋糕,杯子蛋糕`],[`🧂`,`salt shaker`,`food`,``],[`🧃`,`beverage box`,`food`,`果汁盒,饮料`],[`🧄`,`garlic`,`food`,`大蒜,蒜`],[`🧅`,`onion`,`food`,`洋葱`],[`🧆`,`falafel`,`food`,`鹰嘴豆丸子`],[`🧇`,`waffle`,`food`,`华夫饼`],[`🧈`,`butter`,`food`,`黄油,奶油`],[`🧉`,`mate drink`,`food`,`马黛茶`],[`🧊`,`ice cube`,`food`,`冰块,冰`],[`🧋`,`bubble tea`,`food`,`奶茶,珍珠奶茶`],[`🧌`,`troll`,`symbols`,`巨魔,妖怪`],[`🧍`,`standing person`,`symbols`,`站立,站着,人`],[`🧎`,`kneeling person`,`symbols`,`跪,跪下,祈祷`],[`🧏`,`deaf person`,`symbols`,``],[`🧐`,`face with monocle`,`people`,`检查,研究,眼镜`],[`🧑`,`adult`,`people`,`人`],[`🧒`,`child`,`people`,``],[`🧓`,`older adult`,`people`,`老人,奶奶,爷爷`],[`🧔`,`bearded person`,`people`,`胡子,胡须,大叔`],[`🧕`,`person with headscarf`,`people`,`头巾`],[`🧖`,`person in steamy room`,`people`,`桑拿,蒸汽,洗澡`],[`🧗`,`person climbing`,`people`,`攀岩`],[`🧘`,`person in lotus position`,`people`,`打坐`],[`🧙`,`mage`,`people`,`巫师,魔法师,法师`],[`🧚`,`fairy`,`people`,`仙女,精灵,小仙女`],[`🧛`,`vampire`,`people`,`吸血鬼,德古拉`],[`🧜`,`merperson`,`people`,`美人鱼,人鱼`],[`🧝`,`elf`,`people`,`精灵,耳朵`],[`🧞`,`genie`,`people`,`灯神,精灵,神灯`],[`🧟`,`zombie`,`people`,`僵尸,丧尸`],[`🧠`,`brain`,`people`,`大脑,思考,记忆,AI`],[`🧡`,`orange heart`,`people`,``],[`🧢`,`billed cap`,`people`,`棒球帽,帽子`],[`🧣`,`scarf`,`people`,`围巾,冬天`],[`🧤`,`gloves`,`people`,`手套,冬天`],[`🧥`,`coat`,`people`,`大衣,外套`],[`🧦`,`socks`,`people`,`袜子`],[`🧧`,`red gift envelope`,`objects`,`红包,利是,新年`],[`🧨`,`firecracker`,`objects`,``],[`🧩`,`jigsaw puzzle piece`,`objects`,`拼图,拼图游戏`],[`🧪`,`test tube`,`objects`,`试管,实验,化学,科学`],[`🧫`,`petri dish`,`objects`,`培养皿,实验,细菌`],[`🧬`,`dna double helix`,`objects`,`DNA,基因,生物`],[`🧭`,`compass`,`objects`,`指南针`],[`🧮`,`abacus`,`objects`,`算盘,计算`],[`🧯`,`fire extinguisher`,`objects`,`灭火器,消防`],[`🧰`,`toolbox`,`objects`,`工具箱,工具`],[`🧱`,`brick`,`objects`,`砖`],[`🧲`,`magnet`,`objects`,`磁铁,磁性`],[`🧳`,`luggage`,`objects`,`行李箱`],[`🧴`,`lotion bottle`,`objects`,`乳液,护肤,防晒`],[`🧵`,`spool of thread`,`objects`,`线,针线,缝纫`],[`🧶`,`ball of yarn`,`objects`,`毛线,织毛衣`],[`🧷`,`safety pin`,`objects`,`别针,安全别针`],[`🧸`,`teddy bear`,`objects`,`泰迪熊,玩具熊`],[`🧹`,`broom`,`objects`,`扫帚`],[`🧺`,`basket`,`objects`,`篮子`],[`🧻`,`roll of paper`,`objects`,`纸巾`],[`🧼`,`bar of soap`,`objects`,`肥皂,洗手,清洁`],[`🧽`,`sponge`,`objects`,`海绵,清洁`],[`🧾`,`receipt`,`objects`,`收据`],[`🧿`,`nazar amulet`,`objects`,`护身符`],[`🩰`,`ballet shoes`,`activity`,`芭蕾`],[`🩱`,`one-piece swimsuit`,`activity`,`泳衣`],[`🩲`,`briefs`,`activity`,`泳裤`],[`🩳`,`shorts`,`activity`,`短裤`],[`🩴`,`thong sandal`,`activity`,`凉拖`],[`🩵`,`light blue heart`,`activity`,`浅蓝`],[`🩶`,`grey heart`,`activity`,`灰心`],[`🩷`,`pink heart`,`activity`,`粉色`],[`🩸`,`drop of blood`,`activity`,`血`],[`🩹`,`adhesive bandage`,`activity`,`创可贴`],[`🩺`,`stethoscope`,`activity`,`听诊器`],[`🩻`,`x-ray`,`activity`,`X光`],[`🩼`,`crutch`,`activity`,`拐杖`],[`🪀`,`yo-yo`,`objects`,`玩具`],[`🪁`,`kite`,`objects`,`风筝`],[`🪂`,`parachute`,`objects`,`跳伞`],[`🪃`,`boomerang`,`objects`,``],[`🪄`,`magic wand`,`objects`,`魔杖,魔法,魔术`],[`🪅`,`pinata`,`objects`,`皮纳塔`],[`🪆`,`nesting dolls`,`objects`,``],[`🪇`,`maracas`,`objects`,`沙锤`],[`🪈`,`flute`,`objects`,`笛子`],[`🪐`,`ringed planet`,`objects`,``],[`🪑`,`chair`,`objects`,`椅子`],[`🪒`,`razor`,`objects`,`剃须刀,剃刀`],[`🪓`,`axe`,`objects`,`斧头,斧子`],[`🪔`,`diya lamp`,`objects`,`油灯`],[`🪕`,`banjo`,`objects`,`班卓琴`],[`🪖`,`military helmet`,`objects`,`军盔`],[`🪗`,`accordion`,`objects`,`手风琴`],[`🪘`,`long drum`,`objects`,`鼓`],[`🪙`,`coin`,`objects`,`金币`],[`🪚`,`carpentry saw`,`objects`,`锯子,锯`],[`🪛`,`screwdriver`,`objects`,`螺丝刀`],[`🪜`,`ladder`,`objects`,`梯子`],[`🪝`,`hook`,`objects`,`钩子,挂钩`],[`🪞`,`mirror`,`objects`,`镜子`],[`🪟`,`window`,`objects`,`窗户`],[`🪠`,`plunger`,`objects`,`皮搋子,通马桶`],[`🪡`,`sewing needle`,`objects`,`针,缝纫,刺绣`],[`🪢`,`knot`,`objects`,``],[`🪣`,`bucket`,`objects`,`水桶,桶`],[`🪤`,`mouse trap`,`objects`,`捕鼠器`],[`🪥`,`toothbrush`,`objects`,`牙刷,刷牙`],[`🪦`,`headstone`,`objects`,`墓碑`],[`🪧`,`placard`,`objects`,`告示牌`],[`🪨`,`rock`,`objects`,`石头,岩石`],[`🪩`,`mirror ball`,`objects`,`迪斯科球`],[`🪪`,`identification card`,`objects`,`身份证`],[`🪫`,`low battery`,`objects`,`电池,没电,低电量`],[`🪬`,`hamsa`,`objects`,`手掌印,护身符`],[`🪭`,`folding hand fan`,`objects`,``],[`🪮`,`hair pick`,`objects`,`梳子`],[`🪯`,`khanda`,`objects`,``],[`🪰`,`fly`,`objects`,`苍蝇,飞虫`],[`🪱`,`worm`,`objects`,``],[`🪲`,`beetle`,`objects`,`甲虫,昆虫`],[`🪳`,`cockroach`,`objects`,`蟑螂,虫子`],[`🪴`,`potted plant`,`objects`,`盆栽,植物,绿植`],[`🪵`,`wood`,`objects`,`木头,柴火,木`],[`🪶`,`feather`,`objects`,`羽毛,羽毛笔`],[`🪷`,`lotus`,`objects`,`莲花`],[`🪸`,`coral`,`objects`,`珊瑚`],[`🪹`,`empty nest`,`objects`,`鸟巢`],[`🪺`,`nest with eggs`,`objects`,`鸟巢`],[`🪻`,`hyacinth`,`objects`,`风信子`],[`🪼`,`jellyfish`,`objects`,`水母`],[`🪽`,`wing`,`objects`,`翅膀`],[`🪿`,`goose`,`objects`,`鹅`],[`🫀`,`anatomical heart`,`objects`,`心脏,心跳`],[`🫁`,`lungs`,`objects`,`肺,呼吸`],[`🫂`,`people hugging`,`objects`,`拥抱,人,朋友`],[`🫃`,`pregnant man`,`objects`,`孕妇,怀孕`],[`🫄`,`pregnant person`,`objects`,`孕妇,怀孕`],[`🫅`,`person with crown`,`objects`,`国王,王子,皇冠`],[`🫎`,`moose`,`objects`,`驼鹿,麋鹿`],[`🫏`,`donkey`,`objects`,`驴,动物`],[`🫐`,`blueberries`,`food`,`蓝莓`],[`🫑`,`bell pepper`,`food`,`甜椒,彩椒`],[`🫒`,`olive`,`food`,`橄榄`],[`🫓`,`flatbread`,`food`,`薄饼,饼`],[`🫔`,`tamale`,`food`,`玉米粉蒸肉`],[`🫕`,`fondue`,`food`,`奶酪火锅`],[`🫖`,`teapot`,`food`,`茶壶,茶`],[`🫗`,`pouring liquid`,`food`,`倒,倒水,水杯`],[`🫘`,`beans`,`food`,`豆子,红豆`],[`🫙`,`jar`,`food`,`罐子,玻璃罐`],[`🫚`,`ginger root`,`food`,`姜,生姜`],[`🫛`,`pea pod`,`food`,`豌豆荚,豆`],[`🫠`,`melting face`,`smileys`,`融化`],[`🫡`,`saluting face`,`smileys`,`敬礼`],[`🫢`,`face with open eyes and hand over mouth`,`smileys`,`捂眼`],[`🫣`,`face with peeking eye`,`smileys`,`偷看`],[`🫤`,`face with diagonal mouth`,`smileys`,`撇嘴`],[`🫥`,`dotted line face`,`smileys`,`隐形`],[`🫦`,`biting lip`,`smileys`,`咬唇,嘴唇`],[`🫧`,`bubbles`,`smileys`,`泡泡`],[`🫨`,`shaking face`,`smileys`,`摇晃,震动,抖`],[`🫰`,`hand with index finger and thumb crossed`,`people`,`比心,手指,捏`],[`🫱`,`rightwards hand`,`people`,`手,右边,推`],[`🫲`,`leftwards hand`,`people`,`手,左边,推`],[`🫳`,`palm down hand`,`people`,`手,向下,放`],[`🫴`,`palm up hand`,`people`,`手,向上,举`],[`🫵`,`index pointing at the viewer`,`people`,`指,你`],[`🫶`,`heart hands`,`people`,`比心,爱心,手势`],[`🫷`,`leftwards pushing hand`,`people`,`手,推,右边`],[`🫸`,`rightwards pushing hand`,`people`,`手,推,左边`],[`‼`,`double exclamation mark`,`symbols`,``],[`‼️`,`double exclamation mark`,`symbols`,``],[`⁉`,`exclamation question mark`,`symbols`,``],[`⁉️`,`exclamation question mark`,`symbols`,``],[`™`,`trade mark sign`,`symbols`,``],[`™️`,`trade mark sign`,`symbols`,``],[`ℹ`,`information source`,`symbols`,``],[`ℹ️`,`information source`,`symbols`,``],[`↔`,`left right arrow`,`symbols`,``],[`↔️`,`left right arrow`,`symbols`,``],[`↕`,`up down arrow`,`symbols`,``],[`↕️`,`up down arrow`,`symbols`,``],[`↖`,`north west arrow`,`symbols`,``],[`↖️`,`north west arrow`,`symbols`,``],[`↗`,`north east arrow`,`symbols`,``],[`↗️`,`north east arrow`,`symbols`,``],[`↘`,`south east arrow`,`symbols`,``],[`↘️`,`south east arrow`,`symbols`,``],[`↙`,`south west arrow`,`symbols`,``],[`↙️`,`south west arrow`,`symbols`,``],[`↩`,`leftwards arrow with hook`,`symbols`,``],[`↩️`,`leftwards arrow with hook`,`symbols`,``],[`↪`,`rightwards arrow with hook`,`symbols`,``],[`↪️`,`rightwards arrow with hook`,`symbols`,``],[`⌚`,`watch`,`objects`,`手表`],[`⌚️`,`watch`,`objects`,``],[`⌛`,`hourglass`,`objects`,`沙漏,时间,等待`],[`⌛️`,`hourglass`,`objects`,``],[`⌨`,`keyboard`,`symbols`,``],[`⌨️`,`keyboard`,`symbols`,`键盘,打字`],[`⏏`,`eject symbol`,`symbols`,``],[`⏏️`,`eject symbol`,`symbols`,``],[`⏩`,`black right-pointing double triangle`,`objects`,``],[`⏪`,`black left-pointing double triangle`,`objects`,``],[`⏫`,`black up-pointing double triangle`,`objects`,``],[`⏬`,`black down-pointing double triangle`,`objects`,``],[`⏭`,`black right-pointing double triangle with vertical bar`,`objects`,``],[`⏭️`,`black right-pointing double triangle with vertical bar`,`objects`,``],[`⏮`,`black left-pointing double triangle with vertical bar`,`objects`,``],[`⏮️`,`black left-pointing double triangle with vertical bar`,`objects`,``],[`⏯`,`black right-pointing triangle with double vertical bar`,`objects`,``],[`⏯️`,`black right-pointing triangle with double vertical bar`,`objects`,``],[`⏰`,`alarm clock`,`objects`,`闹钟,时间,起床`],[`⏱`,`stopwatch`,`objects`,``],[`⏱️`,`stopwatch`,`objects`,`秒表`],[`⏲`,`timer clock`,`objects`,``],[`⏲️`,`timer clock`,`objects`,`计时器`],[`⏳`,`hourglass with flowing sand`,`objects`,`沙漏`],[`⏸`,`double vertical bar`,`symbols`,``],[`⏸️`,`double vertical bar`,`symbols`,``],[`⏹`,`black square for stop`,`symbols`,``],[`⏹️`,`black square for stop`,`symbols`,``],[`⏺`,`black circle for record`,`symbols`,``],[`⏺️`,`black circle for record`,`symbols`,``],[`Ⓜ`,`circled latin capital letter m`,`symbols`,``],[`Ⓜ️`,`circled latin capital letter m`,`symbols`,``],[`▪`,`black small square`,`symbols`,``],[`▪️`,`black small square`,`symbols`,``],[`▫`,`white small square`,`symbols`,``],[`▫️`,`white small square`,`symbols`,``],[`▶`,`black right-pointing triangle`,`symbols`,``],[`▶️`,`black right-pointing triangle`,`symbols`,``],[`◀`,`black left-pointing triangle`,`symbols`,``],[`◀️`,`black left-pointing triangle`,`symbols`,``],[`◻`,`white medium square`,`symbols`,``],[`◻️`,`white medium square`,`symbols`,``],[`◼`,`black medium square`,`symbols`,``],[`◼️`,`black medium square`,`symbols`,``],[`◽`,`white medium small square`,`symbols`,``],[`◾`,`black medium small square`,`symbols`,``],[`◾️`,`black medium small square`,`symbols`,``],[`☀`,`black sun with rays`,`symbols`,``],[`☀️`,`black sun with rays`,`symbols`,`太阳,晴天,阳光`],[`☁`,`cloud`,`symbols`,``],[`☁️`,`cloud`,`symbols`,`云,多云,天气`],[`☂`,`umbrella`,`symbols`,``],[`☂️`,`umbrella`,`symbols`,``],[`☃`,`snowman`,`symbols`,``],[`☃️`,`snowman`,`symbols`,`雪人,冬天,雪`],[`☄`,`comet`,`symbols`,``],[`☄️`,`comet`,`symbols`,``],[`☎`,`black telephone`,`symbols`,``],[`☎️`,`black telephone`,`symbols`,`电话`],[`☑`,`ballot box with check`,`symbols`,``],[`☑️`,`ballot box with check`,`symbols`,``],[`☔`,`umbrella with rain drops`,`symbols`,``],[`☔️`,`umbrella with rain drops`,`symbols`,``],[`☕`,`hot beverage`,`food`,`咖啡,热饮`],[`☕️`,`hot beverage`,`food`,``],[`☘`,`shamrock`,`symbols`,``],[`☘️`,`shamrock`,`symbols`,``],[`☝`,`white up pointing index`,`symbols`,``],[`☝️`,`white up pointing index`,`symbols`,`指,上面,向上`],[`☠`,`skull and crossbones`,`symbols`,``],[`☠️`,`skull and crossbones`,`symbols`,`骷髅,死亡,危险`],[`☢`,`radioactive sign`,`symbols`,``],[`☢️`,`radioactive sign`,`symbols`,``],[`☣`,`biohazard sign`,`symbols`,``],[`☣️`,`biohazard sign`,`symbols`,``],[`☦`,`orthodox cross`,`symbols`,``],[`☦️`,`orthodox cross`,`symbols`,``],[`☪`,`star and crescent`,`symbols`,``],[`☪️`,`star and crescent`,`symbols`,``],[`☮`,`peace symbol`,`symbols`,``],[`☮️`,`peace symbol`,`symbols`,``],[`☯`,`yin yang`,`symbols`,``],[`☯️`,`yin yang`,`symbols`,``],[`☸`,`wheel of dharma`,`symbols`,``],[`☸️`,`wheel of dharma`,`symbols`,``],[`☹`,`white frowning face`,`smileys`,``],[`☹️`,`white frowning face`,`smileys`,``],[`☺`,`white smiling face`,`smileys`,``],[`☺️`,`white smiling face`,`smileys`,``],[`♀`,`female sign`,`symbols`,``],[`♀️`,`female sign`,`symbols`,``],[`♂`,`male sign`,`symbols`,``],[`♂️`,`male sign`,`symbols`,``],[`♈`,`aries`,`symbols`,``],[`♈️`,`aries`,`symbols`,``],[`♉`,`taurus`,`symbols`,``],[`♉️`,`taurus`,`symbols`,``],[`♊`,`gemini`,`symbols`,``],[`♊️`,`gemini`,`symbols`,``],[`♋`,`cancer`,`symbols`,``],[`♋️`,`cancer`,`symbols`,``],[`♌`,`leo`,`symbols`,``],[`♌️`,`leo`,`symbols`,``],[`♍`,`virgo`,`symbols`,``],[`♍️`,`virgo`,`symbols`,``],[`♎`,`libra`,`symbols`,``],[`♎️`,`libra`,`symbols`,``],[`♏`,`scorpius`,`symbols`,``],[`♏️`,`scorpius`,`symbols`,``],[`♐`,`sagittarius`,`symbols`,``],[`♐️`,`sagittarius`,`symbols`,``],[`♑`,`capricorn`,`symbols`,``],[`♑️`,`capricorn`,`symbols`,``],[`♒`,`aquarius`,`symbols`,``],[`♒️`,`aquarius`,`symbols`,``],[`♓`,`pisces`,`symbols`,``],[`♓️`,`pisces`,`symbols`,``],[`♟`,`black chess pawn`,`symbols`,``],[`♟️`,`black chess pawn`,`symbols`,`棋子,国际象棋,象棋`],[`♠`,`black spade suit`,`symbols`,``],[`♠️`,`black spade suit`,`symbols`,``],[`♣`,`black club suit`,`symbols`,``],[`♣️`,`black club suit`,`symbols`,``],[`♥`,`black heart suit`,`symbols`,``],[`♥️`,`black heart suit`,`symbols`,``],[`♦`,`black diamond suit`,`symbols`,``],[`♦️`,`black diamond suit`,`symbols`,``],[`♨`,`hot springs`,`symbols`,``],[`♨️`,`hot springs`,`symbols`,`温泉,热泉`],[`♻`,`black universal recycling symbol`,`symbols`,``],[`♻️`,`black universal recycling symbol`,`symbols`,``],[`♾`,`permanent paper sign`,`symbols`,``],[`♾️`,`permanent paper sign`,`symbols`,``],[`♿`,`wheelchair symbol`,`symbols`,``],[`♿️`,`wheelchair symbol`,`symbols`,``],[`⚒`,`hammer and pick`,`symbols`,``],[`⚒️`,`hammer and pick`,`symbols`,`锤子,工具`],[`⚓`,`anchor`,`symbols`,`锚,航海,停泊`],[`⚔`,`crossed swords`,`symbols`,``],[`⚔️`,`crossed swords`,`symbols`,`剑,交叉,战斗`],[`⚕`,`staff of aesculapius`,`symbols`,``],[`⚕️`,`staff of aesculapius`,`symbols`,``],[`⚖`,`scales`,`symbols`,``],[`⚖️`,`scales`,`symbols`,``],[`⚗`,`alembic`,`symbols`,``],[`⚗️`,`alembic`,`symbols`,``],[`⚙`,`gear`,`symbols`,``],[`⚙️`,`gear`,`symbols`,``],[`⚛`,`atom symbol`,`symbols`,``],[`⚛️`,`atom symbol`,`symbols`,``],[`⚜`,`fleur-de-lis`,`symbols`,``],[`⚜️`,`fleur-de-lis`,`symbols`,``],[`⚠`,`warning sign`,`symbols`,``],[`⚠️`,`warning sign`,`symbols`,``],[`⚡`,`high voltage sign`,`symbols`,``],[`⚧`,`male with stroke and male and female sign`,`symbols`,``],[`⚧️`,`male with stroke and male and female sign`,`symbols`,``],[`⚪`,`medium white circle`,`symbols`,``],[`⚪️`,`medium white circle`,`symbols`,``],[`⚫`,`medium black circle`,`symbols`,``],[`⚰`,`coffin`,`symbols`,``],[`⚰️`,`coffin`,`symbols`,`棺材,死亡`],[`⚱`,`funeral urn`,`symbols`,``],[`⚱️`,`funeral urn`,`symbols`,`骨灰盒,死亡`],[`⚽`,`soccer ball`,`activity`,`足球,球`],[`⚽️`,`soccer ball`,`activity`,``],[`⚾`,`baseball`,`activity`,`棒球,球`],[`⚾️`,`baseball`,`activity`,``],[`⛄`,`snowman without snow`,`symbols`,`雪人,冬天`],[`⛄️`,`snowman without snow`,`symbols`,``],[`⛅`,`sun behind cloud`,`symbols`,`太阳,云,多云`],[`⛈`,`thunder cloud and rain`,`symbols`,``],[`⛈️`,`thunder cloud and rain`,`symbols`,`雷雨,雷暴,天气`],[`⛎`,`ophiuchus`,`symbols`,``],[`⛏`,`pick`,`symbols`,``],[`⛏️`,`pick`,`symbols`,`镐,工具`],[`⛑`,`helmet with white cross`,`symbols`,``],[`⛑️`,`helmet with white cross`,`symbols`,`头盔,救援,安全`],[`⛓`,`chains`,`symbols`,``],[`⛓️`,`chains`,`symbols`,``],[`⛔`,`no entry`,`symbols`,``],[`⛩`,`shinto shrine`,`travel`,``],[`⛩️`,`shinto shrine`,`travel`,`鸟居,神社,日本`],[`⛪`,`church`,`travel`,`教堂`],[`⛰`,`mountain`,`travel`,``],[`⛰️`,`mountain`,`travel`,`山,山峰`],[`⛱`,`umbrella on ground`,`travel`,``],[`⛱️`,`umbrella on ground`,`travel`,``],[`⛲`,`fountain`,`travel`,`喷泉`],[`⛲️`,`fountain`,`travel`,``],[`⛳`,`flag in hole`,`activity`,`高尔夫,高尔夫球,球洞`],[`⛳️`,`flag in hole`,`activity`,``],[`⛴`,`ferry`,`travel`,``],[`⛴️`,`ferry`,`travel`,`渡轮,船`],[`⛵`,`sailboat`,`travel`,`帆船,船`],[`⛵️`,`sailboat`,`travel`,``],[`⛷`,`skier`,`activity`,``],[`⛷️`,`skier`,`activity`,``],[`⛸`,`ice skate`,`activity`,``],[`⛸️`,`ice skate`,`activity`,`溜冰,冰刀,滑冰`],[`⛹`,`person with ball`,`activity`,``],[`⛹️`,`person with ball`,`activity`,``],[`⛺`,`tent`,`travel`,`帐篷,露营`],[`⛺️`,`tent`,`travel`,``],[`⛽`,`fuel pump`,`travel`,`加油站,加油,汽油`],[`✂`,`black scissors`,`symbols`,``],[`✂️`,`black scissors`,`symbols`,``],[`✅`,`white heavy check mark`,`symbols`,``],[`✈`,`airplane`,`travel`,``],[`✈️`,`airplane`,`travel`,`飞机,航班,起飞`],[`✉`,`envelope`,`symbols`,``],[`✉️`,`envelope`,`symbols`,`信封,邮件,信`],[`✊`,`raised fist`,`people`,`拳头,加油,力量`],[`✋`,`raised hand`,`people`,`手,举手,停`],[`✌`,`victory hand`,`symbols`,``],[`✌️`,`victory hand`,`symbols`,`胜利,耶,剪刀手`],[`✍`,`writing hand`,`symbols`,``],[`✍️`,`writing hand`,`symbols`,`写字,写作,手`],[`✏`,`pencil`,`symbols`,``],[`✏️`,`pencil`,`symbols`,``],[`✒`,`black nib`,`symbols`,``],[`✒️`,`black nib`,`symbols`,``],[`✔`,`heavy check mark`,`symbols`,``],[`✔️`,`heavy check mark`,`symbols`,``],[`✖`,`heavy multiplication x`,`symbols`,``],[`✖️`,`heavy multiplication x`,`symbols`,``],[`✝`,`latin cross`,`symbols`,``],[`✝️`,`latin cross`,`symbols`,``],[`✡`,`star of david`,`symbols`,``],[`✡️`,`star of david`,`symbols`,``],[`✨`,`sparkles`,`symbols`,`星星,闪光,发光`],[`✳`,`eight spoked asterisk`,`symbols`,``],[`✳️`,`eight spoked asterisk`,`symbols`,``],[`✴`,`eight pointed black star`,`symbols`,``],[`✴️`,`eight pointed black star`,`symbols`,``],[`❄`,`snowflake`,`symbols`,``],[`❄️`,`snowflake`,`symbols`,`雪花,雪,冬天,冷`],[`❇`,`sparkle`,`symbols`,``],[`❇️`,`sparkle`,`symbols`,``],[`❌`,`cross mark`,`symbols`,``],[`❎`,`negative squared cross mark`,`symbols`,``],[`❓`,`black question mark ornament`,`symbols`,``],[`❔`,`white question mark ornament`,`symbols`,``],[`❕`,`white exclamation mark ornament`,`symbols`,``],[`❗`,`heavy exclamation mark symbol`,`symbols`,``],[`❗️`,`heavy exclamation mark symbol`,`symbols`,``],[`❣`,`heavy heart exclamation mark ornament`,`symbols`,``],[`❣️`,`heavy heart exclamation mark ornament`,`symbols`,`爱心,感叹号`],[`❤`,`heavy black heart`,`smileys`,``],[`❤️`,`heavy black heart`,`smileys`,`爱心,红心,爱`],[`➕`,`heavy plus sign`,`symbols`,``],[`➖`,`heavy minus sign`,`symbols`,``],[`➗`,`heavy division sign`,`symbols`,``],[`➡`,`black rightwards arrow`,`symbols`,``],[`➡️`,`black rightwards arrow`,`symbols`,``],[`➰`,`curly loop`,`symbols`,``],[`➿`,`double curly loop`,`symbols`,``],[`⬅`,`leftwards black arrow`,`symbols`,``],[`⬅️`,`leftwards black arrow`,`symbols`,``],[`⬆`,`upwards black arrow`,`symbols`,``],[`⬆️`,`upwards black arrow`,`symbols`,``],[`⬇`,`downwards black arrow`,`symbols`,``],[`⬇️`,`downwards black arrow`,`symbols`,``],[`⬛`,`black large square`,`symbols`,``],[`⬛️`,`black large square`,`symbols`,``],[`⬜`,`white large square`,`symbols`,``],[`⬜️`,`white large square`,`symbols`,``],[`⭐`,`white medium star`,`symbols`,`星星,五星,评分`],[`⭕`,`heavy large circle`,`symbols`,``],[`⭕️`,`heavy large circle`,`symbols`,``],[`⤴`,`arrow pointing rightwards then curving upwards`,`symbols`,``],[`⤴️`,`arrow pointing rightwards then curving upwards`,`symbols`,``],[`⤵`,`arrow pointing rightwards then curving downwards`,`symbols`,``],[`⤵️`,`arrow pointing rightwards then curving downwards`,`symbols`,``],[`〰`,`wavy dash`,`symbols`,``],[`〰️`,`wavy dash`,`symbols`,``],[`〽`,`part alternation mark`,`symbols`,``],[`〽️`,`part alternation mark`,`symbols`,``],[`㊗`,`circled ideograph congratulation`,`symbols`,``],[`㊗️`,`circled ideograph congratulation`,`symbols`,``],[`㊙`,`circled ideograph secret`,`symbols`,``],[`㊙️`,`circled ideograph secret`,`symbols`,``],[`©`,`copyright sign`,`symbols`,``],[`©️`,`copyright sign`,`symbols`,``],[`®`,`registered sign`,`symbols`,``],[`®️`,`registered sign`,`symbols`,``],[`👨💻`,`man technologist`,`people`,`程序员,开发者,工程师,码农`],[`👩💻`,`woman technologist`,`people`,`程序员,开发者,工程师`],[`🧑💻`,`technologist`,`people`,`程序员,开发者,工程师`],[`👨🔧`,`man mechanic`,`people`,``],[`👩🔧`,`woman mechanic`,`people`,``],[`👨🎨`,`man artist`,`people`,``],[`👩🎨`,`woman artist`,`people`,``],[`👨🚀`,`man astronaut`,`people`,``],[`👩🚀`,`woman astronaut`,`people`,``],[`👨⚕️`,`man health worker`,`people`,``],[`👩⚕️`,`woman health worker`,`people`,``],[`👨🏫`,`man teacher`,`people`,``],[`👩🏫`,`woman teacher`,`people`,``],[`👨🍳`,`man cook`,`people`,``],[`👩🍳`,`woman cook`,`people`,``],[`👨🌾`,`man farmer`,`people`,``],[`👩🌾`,`woman farmer`,`people`,``],[`👩🏭`,`woman factory worker`,`people`,``],[`👨🎓`,`man student`,`people`,``],[`👩🎓`,`woman student`,`people`,``],[`👨🚒`,`man firefighter`,`people`,``],[`👩🚒`,`woman firefighter`,`people`,``],[`👨⚖️`,`man judge`,`people`,``],[`👩⚖️`,`woman judge`,`people`,``],[`👨💼`,`man office worker`,`people`,``],[`👩💼`,`woman office worker`,`people`,``],[`👨🎤`,`man singer`,`people`,``],[`👩🎤`,`woman singer`,`people`,``],[`👨🦰`,`man red hair`,`people`,``],[`👩🦰`,`woman red hair`,`people`,``],[`👨🦱`,`man curly hair`,`people`,``],[`👩🦱`,`woman curly hair`,`people`,``],[`👩🦲`,`woman bald`,`people`,``],[`👨🦳`,`man white hair`,`people`,``],[`👩🦳`,`woman white hair`,`people`,``],[`👩❤️👨`,`couple with heart`,`people`,``],[`👨❤️👨`,`couple with heart`,`people`,``],[`👩❤️👩`,`couple with heart`,`people`,``],[`👨👩👧`,`family man woman girl`,`people`,``],[`👨👩👦`,`family man woman boy`,`people`,``],[`👨👩👧👦`,`family man woman girl boy`,`people`,``],[`👨👩👦👦`,`man`,`people`,``],[`👨👩👧👧`,`family man woman girl girl`,`people`,``],[`👩👩👧`,`family woman woman girl`,`people`,``],[`👨👨👧`,`family man man girl`,`people`,``],[`👨👦`,`family man boy`,`people`,``],[`👩👧`,`family woman girl`,`people`,``],[`👨👧👦`,`family man girl boy`,`people`,``],[`👩❤️💋👨`,`kiss woman man`,`people`,``],[`🧑🤝🧑`,`people holding hands`,`people`,``],[`❤️🔥`,`heart on fire`,`smileys`,``],[`🧑🚒`,`firefighter`,`people`,`消防员`],[`🧑🏭`,`factory worker`,`people`,``],[`🧑🎓`,`student`,`people`,`学生,毕业生,大学生`],[`🧑🏫`,`teacher`,`people`,`老师,教师,教授`],[`🧑🎤`,`singer`,`people`,`歌手,歌星`],[`🧑⚕️`,`health worker`,`people`,`医生,医疗`],[`🧑⚖️`,`judge`,`people`,`法官,审判`],[`🧑🍳`,`cook`,`people`,`厨师,大厨`],[`🧑🌾`,`farmer`,`people`,`农民,农夫`],[`🧑🎨`,`artist`,`people`,`画家,艺术家`],[`🧑🔬`,`scientist`,`people`,``],[`🧑🔧`,`mechanic`,`people`,`技工,维修工`],[`🧑💼`,`office worker`,`people`,`白领,上班族,职员`],[`🧑🚀`,`astronaut`,`people`,`宇航员,太空人`],[`🏃♂️`,`man running`,`activity`,``],[`🏃♀️`,`woman running`,`activity`,``],[`🚶♂️`,`man walking`,`travel`,``],[`🚶♀️`,`woman walking`,`travel`,``],[`🧎♂️`,`man kneeling`,`symbols`,``],[`🧎♀️`,`woman kneeling`,`symbols`,``],[`🏋️♂️`,`man lifting weights`,`activity`,``],[`🏋️♀️`,`woman lifting weights`,`activity`,``],[`🤸♂️`,`man cartwheeling`,`people`,``],[`🤸♀️`,`woman cartwheeling`,`people`,``],[`⛹️♂️`,`man bouncing ball`,`activity`,``],[`⛹️♀️`,`woman bouncing ball`,`activity`,``],[`🤾♂️`,`man playing handball`,`activity`,``],[`🤾♀️`,`woman playing handball`,`activity`,``],[`🧘♀️`,`woman in lotus position`,`people`,``],[`🏄♂️`,`man surfing`,`activity`,``],[`🏄♀️`,`woman surfing`,`activity`,``],[`🏊♂️`,`man swimming`,`activity`,``],[`🏊♀️`,`woman swimming`,`activity`,``],[`🚴♂️`,`man biking`,`travel`,``],[`🚴♀️`,`woman biking`,`travel`,``],[`🚵♂️`,`man mountain biking`,`travel`,``],[`🚵♀️`,`woman mountain biking`,`travel`,``],[`👯♂️`,`men with bunny ears`,`people`,``],[`👯♀️`,`women with bunny ears`,`people`,``],[`🧖♂️`,`man in steamy room`,`people`,``],[`🧖♀️`,`woman in steamy room`,`people`,``],[`🧗♂️`,`man climbing`,`people`,``],[`🧗♀️`,`woman climbing`,`people`,``],[`🤦♂️`,`man facepalming`,`smileys`,``],[`🤦♀️`,`woman facepalming`,`smileys`,``],[`🤷♂️`,`man shrugging`,`people`,``],[`🤷♀️`,`woman shrugging`,`people`,``],[`🙍♂️`,`person frowning`,`smileys`,``],[`🙍♀️`,`woman frowning`,`smileys`,``],[`🙎♂️`,`man pouting`,`smileys`,``],[`🙎♀️`,`woman pouting`,`smileys`,``],[`🙅♂️`,`man gesturing no`,`smileys`,``],[`🙅♀️`,`woman gesturing no`,`smileys`,``],[`🙆♂️`,`man gesturing ok`,`smileys`,``],[`🙆♀️`,`woman gesturing ok`,`smileys`,``],[`💁♂️`,`man tipping hand`,`people`,``],[`💁♀️`,`woman tipping hand`,`people`,``],[`🙋♂️`,`man raising hand`,`smileys`,``],[`🙋♀️`,`woman raising hand`,`smileys`,``],[`🙇♂️`,`man bowing`,`smileys`,``],[`🙇♀️`,`woman bowing`,`smileys`,``],[`💆♂️`,`man getting massage`,`people`,``],[`💆♀️`,`woman getting massage`,`people`,``],[`💇♂️`,`man getting haircut`,`people`,``],[`💇♀️`,`woman getting haircut`,`people`,``],[`🧞♂️`,`man genie`,`people`,``],[`🧞♀️`,`woman genie`,`people`,``],[`🧟♂️`,`man zombie`,`people`,``],[`🧟♀️`,`woman zombie`,`people`,``],[`🧜♂️`,`merman`,`people`,``],[`🧚♂️`,`man fairy`,`people`,``],[`🧚♀️`,`woman fairy`,`people`,``],[`🧛♂️`,`man vampire`,`people`,``],[`🧛♀️`,`woman vampire`,`people`,``],[`🧙♂️`,`man mage`,`people`,``],[`🧙♀️`,`mage`,`people`,``],[`🧝♂️`,`man elf`,`people`,``],[`🧝♀️`,`woman elf`,`people`,``],[`🦸♂️`,`man superhero`,`people`,``],[`🦸♀️`,`woman superhero`,`people`,``],[`🦹♂️`,`man supervillain`,`people`,``],[`🦹♀️`,`woman supervillain`,`people`,``],[`0️⃣`,`keycap 0`,`symbols`,``],[`1️⃣`,`keycap 1`,`symbols`,``],[`2️⃣`,`keycap 2`,`symbols`,``],[`3️⃣`,`keycap 3`,`symbols`,``],[`4️⃣`,`keycap 4`,`symbols`,``],[`5️⃣`,`keycap 5`,`symbols`,``],[`6️⃣`,`keycap 6`,`symbols`,``],[`7️⃣`,`keycap 7`,`symbols`,``],[`8️⃣`,`keycap 8`,`symbols`,``],[`9️⃣`,`keycap 9`,`symbols`,``],[`#️⃣`,`keycap #`,`symbols`,``],[`*️⃣`,`keycap *`,`symbols`,``],[`🇨🇳`,`flag china`,`flags`,`中国,国旗,五星红旗`],[`🇺🇸`,`flag united states`,`flags`,`美国,国旗,USA`],[`🇬🇧`,`flag united kingdom`,`flags`,`英国,国旗,UK`],[`🇯🇵`,`flag japan`,`flags`,`日本,国旗`],[`🇫🇷`,`flag france`,`flags`,`法国,国旗`],[`🇩🇪`,`flag germany`,`flags`,`德国,国旗`],[`🇮🇹`,`flag italy`,`flags`,`意大利,国旗`],[`🇪🇸`,`flag spain`,`flags`,`西班牙,国旗`],[`🇷🇺`,`flag russia`,`flags`,`俄罗斯,国旗`],[`🇮🇳`,`regional indicator symbol letter i`,`flags`,`印度,国旗`],[`🇧🇷`,`flag brazil`,`flags`,`巴西,国旗`],[`🇨🇦`,`flag canada`,`flags`,`加拿大,国旗`],[`🇦🇺`,`flag australia`,`flags`,`澳大利亚,国旗`],[`🇸🇬`,`flag singapore`,`flags`,`新加坡,国旗`],[`🇭🇰`,`flag hong kong`,`flags`,`香港,国旗,区旗`],[`🇹🇼`,`flag taiwan`,`flags`,`台湾,国旗`],[`🇲🇴`,`flag macau`,`flags`,`澳门,国旗`],[`🇻🇳`,`flag vietnam`,`flags`,`越南,国旗`],[`🇲🇾`,`regional indicator symbol letter m`,`flags`,`马来西亚,国旗`],[`🇮🇩`,`flag indonesia`,`flags`,`印尼,国旗`],[`🇵🇭`,`flag philippines`,`flags`,`菲律宾,国旗`],[`🇹🇷`,`flag turkey`,`flags`,`土耳其,国旗`],[`🇸🇦`,`flag saudi arabia`,`flags`,`沙特,国旗`],[`🇦🇪`,`flag united arab emirates`,`flags`,`阿联酋,国旗`],[`🇳🇱`,`flag netherlands`,`flags`,`荷兰,国旗`],[`🇸🇪`,`flag sweden`,`flags`,`瑞典,国旗`],[`🇨🇭`,`flag switzerland`,`flags`,`瑞士,国旗`],[`🇦🇹`,`flag austria`,`flags`,`奥地利,国旗`],[`🇧🇪`,`flag belgium`,`flags`,`比利时,国旗`],[`🇵🇹`,`flag portugal`,`flags`,`葡萄牙,国旗`],[`🇬🇷`,`flag greece`,`flags`,`希腊,国旗`],[`🇳🇴`,`flag norway`,`flags`,`挪威,国旗`],[`🇩🇰`,`flag denmark`,`flags`,`丹麦,国旗`],[`🇫🇮`,`flag finland`,`flags`,`芬兰,国旗`],[`🇵🇱`,`flag poland`,`flags`,`波兰,国旗`],[`🇺🇦`,`flag ukraine`,`flags`,`乌克兰,国旗`],[`🇮🇱`,`flag israel`,`flags`,`以色列,国旗`],[`🇪🇬`,`flag egypt`,`flags`,`埃及,国旗`],[`🇿🇦`,`flag south africa`,`flags`,`南非,国旗`],[`🇳🇬`,`flag nigeria`,`flags`,`尼日利亚,国旗`],[`🇲🇽`,`flag mexico`,`flags`,`墨西哥,国旗`],[`🇦🇷`,`flag argentina`,`flags`,``],[`🇨🇱`,`flag chile`,`flags`,`智利,国旗`],[`🇰🇿`,`flag kazakhstan`,`flags`,`哈萨克斯坦,国旗`],[`🇺🇿`,`flag uzbekistan`,`flags`,`乌兹别克斯坦,国旗`],[`🇳🇿`,`flag new zealand`,`flags`,`新西兰,国旗`],[`🇮🇪`,`flag ireland`,`flags`,`爱尔兰,国旗`],[`🇨🇿`,`flag czechia`,`flags`,`捷克,国旗`],[`👍🏻`,`thumbs up light skin`,`people`,``],[`👍🏽`,`thumbs up sign`,`people`,``],[`👍🏾`,`thumbs up medium dark skin`,`people`,``],[`👍🏿`,`thumbs up dark skin`,`people`,``],[`👏🏻`,`clapping hands light skin`,`people`,``],[`👏🏼`,`clapping hands medium light skin`,`people`,``],[`👏🏽`,`clapping hands medium skin`,`people`,``],[`👏🏾`,`clapping hands medium dark skin`,`people`,``],[`👏🏿`,`clapping hands dark skin`,`people`,``],[`🙏🏻`,`folded hands light skin`,`smileys`,``],[`🙏🏼`,`folded hands medium light skin`,`smileys`,``],[`🙏🏽`,`folded hands medium skin`,`smileys`,``],[`🙏🏾`,`folded hands medium dark skin`,`smileys`,``],[`🙏🏿`,`folded hands dark skin`,`smileys`,``],[`🏳️🌈`,`rainbow flag`,`flags`,``],[`🏴☠️`,`pirate flag`,`flags`,`海盗旗,海盗`]];n(`zh`,{agentMgr:{allTools:`全部`,defaultAgentName:`默认助手`,defaultAgentDesc:`全能 AI 助手,拥有所有工具能力`,switchedTo:`已切换到:{name}`,editAgent:`编辑助手`,templateLoaded:`已加载模板:{name}`,noSkillsHint:`暂无启用技能(请先确认 Agent 已连接且技能开关已开启)`,nameRequired:`请输入助手名称`,agentUpdated:`助手已更新`,agentCreated:`助手 "{name}" 已创建`,saveFailed:`保存失败:{message}`,confirmDeleteAgentMessage:`确定要删除助手 "{name}" 吗?
|
|
2072
|
+
`).join(``),e.querySelectorAll(`.ref-chip-close`).forEach(e=>{e.addEventListener(`click`,t=>{t.stopPropagation(),C.selectedMcpServices=C.selectedMcpServices.filter(t=>t.serverName!==e.dataset.serverName),zT(),BT()})}),e.style.display=`flex`}}function BT(){let e=new Set(C.selectedMcpServices.map(e=>e.serverName));document.querySelectorAll(`.mcp-list-item, .merged-mcp-item`).forEach(t=>{t.classList.toggle(`picked`,e.has(t.dataset.serverName))})}function VT(){let e=document.getElementById(`mcpIndicatorClose`);e&&e.addEventListener(`click`,LT)}function HT(){let e=document.getElementById(`promptDropdownHeader`);if(!e||e.querySelector(`.mcp-manage-btn`))return;let t=document.createElement(`button`);t.className=`mcp-manage-btn`,t.title=r(`promptSelector.mcpManageTitle`),t.style.display=`none`,t.style.fontSize=`13px`,t.innerHTML=`✚`,t.addEventListener(`click`,e=>{e.stopPropagation(),chrome.runtime.sendMessage({type:`OPEN_OPTIONS_PAGE`,hash:`toolbox`})}),e.appendChild(t)}var UT=[[`🀄`,`mahjong tile red dragon`,`symbols`,`麻将,红中`],[`🃏`,`playing card black joker`,`symbols`,``],[`🅰`,`negative squared latin capital letter a`,`symbols`,``],[`🅱`,`negative squared latin capital letter b`,`symbols`,``],[`🅾`,`negative squared latin capital letter o`,`symbols`,``],[`🅿`,`negative squared latin capital letter p`,`symbols`,``],[`🆎`,`negative squared ab`,`symbols`,``],[`🆑`,`squared cl`,`symbols`,``],[`🆒`,`squared cool`,`symbols`,``],[`🆓`,`squared free`,`symbols`,``],[`🆔`,`squared id`,`symbols`,``],[`🆕`,`squared new`,`symbols`,``],[`🆖`,`squared ng`,`symbols`,``],[`🆗`,`squared ok`,`symbols`,``],[`🆘`,`squared sos`,`symbols`,``],[`🆙`,`squared up with exclamation mark`,`symbols`,``],[`🆚`,`squared vs`,`symbols`,``],[`🇨🇩`,`regional indicator symbol letter c`,`flags`,``],[`🇬🇭`,`regional indicator symbol letter g`,`flags`,``],[`🇲🇳`,`regional indicator symbol letter m`,`flags`,``],[`🇷🇸`,`regional indicator symbol letter r`,`flags`,``],[`🈁`,`squared katakana koko`,`symbols`,``],[`🈂`,`squared katakana sa`,`symbols`,``],[`🈚`,`squared cjk unified ideograph-7121`,`symbols`,``],[`🈯`,`squared cjk unified ideograph-6307`,`symbols`,``],[`🈲`,`squared cjk unified ideograph-7981`,`symbols`,``],[`🈳`,`squared cjk unified ideograph-7a7a`,`symbols`,``],[`🈴`,`squared cjk unified ideograph-5408`,`symbols`,``],[`🈵`,`squared cjk unified ideograph-6e80`,`symbols`,``],[`🈶`,`squared cjk unified ideograph-6709`,`symbols`,``],[`🈷`,`squared cjk unified ideograph-6708`,`symbols`,``],[`🈸`,`squared cjk unified ideograph-7533`,`symbols`,``],[`🈹`,`squared cjk unified ideograph-5272`,`symbols`,``],[`🈺`,`squared cjk unified ideograph-55b6`,`symbols`,``],[`🉐`,`circled ideograph advantage`,`symbols`,``],[`🉑`,`circled ideograph accept`,`symbols`,``],[`🌀`,`cyclone`,`symbols`,`台风,龙卷风,旋风`],[`🌁`,`foggy`,`symbols`,`雾,雾霾,朦胧`],[`🌂`,`closed umbrella`,`symbols`,``],[`🌃`,`night with stars`,`symbols`,`夜晚,星空,城市`],[`🌄`,`sunrise over mountains`,`symbols`,`日出,山,早晨`],[`🌅`,`sunrise`,`symbols`,`日出,太阳,早晨`],[`🌆`,`cityscape at dusk`,`symbols`,`黄昏,傍晚,城市`],[`🌇`,`sunset over buildings`,`symbols`,`日落,黄昏`],[`🌈`,`rainbow`,`symbols`,`彩虹,雨后`],[`🌉`,`bridge at night`,`symbols`,`桥,大桥`],[`🌊`,`water wave`,`symbols`,`海浪,波浪,海`],[`🌋`,`volcano`,`symbols`,`火山,爆发`],[`🌌`,`milky way`,`symbols`,``],[`🌍`,`earth globe europe-africa`,`symbols`,``],[`🌎`,`earth globe americas`,`symbols`,`地球,美洲`],[`🌏`,`earth globe asia-australia`,`symbols`,`地球,亚洲`],[`🌐`,`globe with meridians`,`symbols`,``],[`🌑`,`new moon symbol`,`symbols`,``],[`🌒`,`waxing crescent moon symbol`,`symbols`,``],[`🌓`,`first quarter moon symbol`,`symbols`,``],[`🌔`,`waxing gibbous moon symbol`,`symbols`,``],[`🌕`,`full moon symbol`,`symbols`,``],[`🌖`,`waning gibbous moon symbol`,`symbols`,``],[`🌗`,`last quarter moon symbol`,`symbols`,``],[`🌘`,`waning crescent moon symbol`,`symbols`,``],[`🌙`,`crescent moon`,`symbols`,``],[`🌚`,`new moon with face`,`symbols`,``],[`🌛`,`first quarter moon with face`,`symbols`,``],[`🌜`,`last quarter moon with face`,`symbols`,``],[`🌝`,`full moon with face`,`symbols`,``],[`🌞`,`sun with face`,`symbols`,``],[`🌟`,`glowing star`,`symbols`,`星星,闪光,闪耀`],[`🌠`,`shooting star`,`symbols`,``],[`🌡`,`thermometer`,`symbols`,``],[`🌤`,`white sun with small cloud`,`symbols`,``],[`🌥`,`white sun behind cloud`,`symbols`,``],[`🌦`,`white sun behind cloud with rain`,`symbols`,``],[`🌧`,`cloud with rain`,`symbols`,``],[`🌨`,`cloud with snow`,`symbols`,``],[`🌩`,`cloud with lightning`,`symbols`,``],[`🌪`,`cloud with tornado`,`symbols`,``],[`🌫`,`fog`,`symbols`,``],[`🌬`,`wind blowing face`,`symbols`,``],[`🌭`,`hot dog`,`food`,`热狗`],[`🌮`,`taco`,`food`,`墨西哥卷饼`],[`🌯`,`burrito`,`food`,`墨西哥卷,卷饼`],[`🌰`,`chestnut`,`food`,`栗子,坚果`],[`🌱`,`seedling`,`food`,``],[`🌲`,`evergreen tree`,`food`,`松树,树`],[`🌳`,`deciduous tree`,`food`,`树,大树`],[`🌴`,`palm tree`,`food`,`棕榈树,热带,度假`],[`🌵`,`cactus`,`food`,`仙人掌,沙漠`],[`🌶`,`hot pepper`,`food`,``],[`🌷`,`tulip`,`food`,`郁金香,花`],[`🌸`,`cherry blossom`,`food`,`樱花,花,春天`],[`🌹`,`rose`,`food`,`玫瑰,花,爱情`],[`🌺`,`hibiscus`,`food`,`花,芙蓉`],[`🌻`,`sunflower`,`food`,`向日葵,花,太阳`],[`🌼`,`blossom`,`food`,`雏菊,花`],[`🌽`,`ear of maize`,`food`,`玉米`],[`🌾`,`ear of rice`,`food`,``],[`🌿`,`herb`,`food`,`草,植物,草药`],[`🍀`,`four leaf clover`,`food`,`四叶草,幸运,好运`],[`🍁`,`maple leaf`,`food`,`枫叶,秋天,红叶`],[`🍂`,`fallen leaf`,`food`,`落叶,秋天`],[`🍃`,`leaf fluttering in wind`,`food`,`树叶,风`],[`🍄`,`mushroom`,`food`,`蘑菇,菌`],[`🍅`,`tomato`,`food`,`番茄,西红柿`],[`🍆`,`aubergine`,`food`,`茄子`],[`🍇`,`grapes`,`food`,`葡萄`],[`🍈`,`melon`,`food`,`哈密瓜,甜瓜`],[`🍉`,`watermelon`,`food`,`西瓜`],[`🍊`,`tangerine`,`food`,`橙子,橘子`],[`🍋`,`lemon`,`food`,`柠檬`],[`🍌`,`banana`,`food`,`香蕉`],[`🍍`,`pineapple`,`food`,`菠萝`],[`🍎`,`red apple`,`food`,`苹果`],[`🍏`,`green apple`,`food`,``],[`🍐`,`pear`,`food`,`梨`],[`🍑`,`peach`,`food`,`桃子,蜜桃`],[`🍒`,`cherries`,`food`,`樱桃,车厘子`],[`🍓`,`strawberry`,`food`,`草莓`],[`🍔`,`hamburger`,`food`,`汉堡,汉堡包`],[`🍕`,`slice of pizza`,`food`,`披萨,比萨`],[`🍖`,`meat on bone`,`food`,`骨头,肉,排骨`],[`🍗`,`poultry leg`,`food`,`鸡腿,炸鸡`],[`🍘`,`rice cracker`,`food`,`米饼,仙贝`],[`🍙`,`rice ball`,`food`,`饭团`],[`🍚`,`cooked rice`,`food`,`米饭,饭`],[`🍛`,`curry and rice`,`food`,`咖喱,咖喱饭`],[`🍜`,`steaming bowl`,`food`,`面条,拉面,面`],[`🍝`,`spaghetti`,`food`,`意大利面,意面`],[`🍞`,`bread`,`food`,`面包`],[`🍟`,`french fries`,`food`,`薯条,炸薯条`],[`🍠`,`roasted sweet potato`,`food`,`红薯,地瓜`],[`🍡`,`dango`,`food`,`团子,丸子`],[`🍢`,`oden`,`food`,`关东煮,串`],[`🍣`,`sushi`,`food`,`寿司,三文鱼`],[`🍤`,`fried shrimp`,`food`,`炸虾,天妇罗`],[`🍥`,`fish cake with swirl design`,`food`,`鱼板,鸣门卷`],[`🍦`,`soft ice cream`,`food`,`冰淇淋,甜筒`],[`🍧`,`shaved ice`,`food`,`刨冰,冰沙`],[`🍨`,`ice cream`,`food`,`冰淇淋,圣代`],[`🍩`,`doughnut`,`food`,``],[`🍪`,`cookie`,`food`,``],[`🍫`,`chocolate bar`,`food`,`巧克力`],[`🍬`,`candy`,`food`,`糖果,糖`],[`🍭`,`lollipop`,`food`,`棒棒糖`],[`🍮`,`custard`,`food`,`布丁,焦糖`],[`🍯`,`honey pot`,`food`,`蜂蜜,蜜`],[`🍰`,`shortcake`,`food`,`蛋糕,奶油蛋糕`],[`🍱`,`bento box`,`food`,`便当,盒饭`],[`🍲`,`pot of food`,`food`,`火锅,汤锅,炖菜`],[`🍳`,`cooking`,`food`,`煎蛋,鸡蛋`],[`🍴`,`fork and knife`,`food`,`刀叉,餐具`],[`🍵`,`teacup without handle`,`food`,`绿茶,茶,抹茶`],[`🍶`,`sake bottle and cup`,`food`,`清酒,日本酒`],[`🍷`,`wine glass`,`food`,`红酒,葡萄酒,酒`],[`🍸`,`cocktail glass`,`food`,`鸡尾酒,马提尼`],[`🍹`,`tropical drink`,`food`,`果汁,鸡尾酒`],[`🍺`,`beer mug`,`food`,`啤酒,啤酒杯`],[`🍻`,`clinking beer mugs`,`food`,`干杯,碰杯,啤酒`],[`🍼`,`baby bottle`,`food`,`奶瓶,婴儿,奶粉`],[`🍽`,`fork and knife with plate`,`food`,``],[`🍾`,`bottle with popping cork`,`food`,`香槟,起泡酒,庆祝`],[`🍿`,`popcorn`,`food`,``],[`🎀`,`ribbon`,`activity`,`蝴蝶结,礼物,装饰`],[`🎁`,`wrapped present`,`activity`,`礼物,礼盒,生日`],[`🎂`,`birthday cake`,`activity`,`生日蛋糕,生日,蛋糕`],[`🎃`,`jack-o-lantern`,`activity`,``],[`🎄`,`christmas tree`,`activity`,``],[`🎅`,`father christmas`,`activity`,`圣诞老人,圣诞,圣诞节`],[`🎆`,`fireworks`,`activity`,``],[`🎇`,`firework sparkler`,`activity`,``],[`🎈`,`balloon`,`activity`,`气球,庆祝,派对`],[`🎉`,`party popper`,`activity`,`彩带,庆祝,派对,欢呼`],[`🎊`,`confetti ball`,`activity`,`庆祝`],[`🎋`,`tanabata tree`,`activity`,``],[`🎌`,`crossed flags`,`flags`,`旗,日本,交叉旗`],[`🎍`,`pine decoration`,`activity`,``],[`🎎`,`japanese dolls`,`activity`,`人偶,日本人偶`],[`🎏`,`carp streamer`,`activity`,`鲤鱼旗,日本,端午节`],[`🎐`,`wind chime`,`activity`,`风铃,夏天`],[`🎑`,`moon viewing ceremony`,`activity`,``],[`🎒`,`school satchel`,`activity`,`书包,背包`],[`🎓`,`graduation cap`,`activity`,`学士帽,毕业,学位`],[`🎖`,`military medal`,`activity`,``],[`🎗`,`reminder ribbon`,`activity`,``],[`🎙`,`studio microphone`,`activity`,``],[`🎚`,`level slider`,`activity`,``],[`🎛`,`control knobs`,`activity`,``],[`🎞`,`film frames`,`activity`,``],[`🎟`,`admission tickets`,`activity`,``],[`🎠`,`carousel horse`,`activity`,`旋转木马,游乐园`],[`🎡`,`ferris wheel`,`activity`,`摩天轮,游乐园`],[`🎢`,`roller coaster`,`activity`,`过山车,游乐园`],[`🎣`,`fishing pole and fish`,`activity`,`钓鱼`],[`🎤`,`microphone`,`activity`,`麦克风,唱歌,K歌`],[`🎥`,`movie camera`,`activity`,`摄影机,电影,拍摄`],[`🎦`,`cinema`,`activity`,``],[`🎧`,`headphone`,`activity`,`耳机,听歌,音乐,戴`],[`🎨`,`artist palette`,`activity`,`调色板,画画,美术,艺术`],[`🎩`,`top hat`,`activity`,`礼帽,魔术帽,帽子`],[`🎪`,`circus tent`,`activity`,`马戏团`],[`🎫`,`ticket`,`activity`,`门票,票,入场券`],[`🎬`,`clapper board`,`activity`,`场记板,电影,拍戏,导演`],[`🎭`,`performing arts`,`activity`,`面具,戏剧,表演,舞台`],[`🎮`,`video game`,`activity`,`游戏机,游戏,手柄,玩`],[`🎯`,`direct hit`,`activity`,`目标`],[`🎰`,`slot machine`,`activity`,``],[`🎱`,`billiards`,`activity`,`台球`],[`🎲`,`game die`,`activity`,`骰子,赌博,游戏`],[`🎳`,`bowling`,`activity`,`保龄球,球`],[`🎴`,`flower playing cards`,`activity`,`花牌,卡牌,纸牌`],[`🎵`,`musical note`,`activity`,`音符,音乐,歌`],[`🎶`,`multiple musical notes`,`activity`,`音符,音乐,唱歌`],[`🎷`,`saxophone`,`activity`,`萨克斯,爵士,乐器`],[`🎸`,`guitar`,`activity`,`吉他,弹吉他,摇滚`],[`🎹`,`musical keyboard`,`activity`,`钢琴,键盘,弹琴`],[`🎺`,`trumpet`,`activity`,`小号,喇叭,乐器`],[`🎻`,`violin`,`activity`,`小提琴,弦乐`],[`🎼`,`musical score`,`activity`,`乐谱,音乐,谱`],[`🎽`,`running shirt with sash`,`activity`,`背心`],[`🎾`,`tennis racquet and ball`,`activity`,`网球,球`],[`🎿`,`ski and ski boot`,`activity`,`滑雪`],[`🏀`,`basketball and hoop`,`activity`,`篮球,球`],[`🏁`,`chequered flag`,`flags`,`终点,旗帜,赛车,比赛`],[`🏂`,`snowboarder`,`activity`,``],[`🏃`,`runner`,`activity`,`跑步,跑,奔跑`],[`🏄`,`surfer`,`activity`,``],[`🏅`,`sports medal`,`activity`,`奖牌,奖章,荣誉`],[`🏆`,`trophy`,`activity`,``],[`🏇`,`horse racing`,`activity`,``],[`🏈`,`american football`,`activity`,`橄榄球,美式足球`],[`🏉`,`rugby football`,`activity`,`橄榄球,英式`],[`🏊`,`swimmer`,`activity`,``],[`🏋`,`weight lifter`,`activity`,``],[`🏌`,`golfer`,`activity`,``],[`🏍`,`racing motorcycle`,`activity`,``],[`🏎`,`racing car`,`activity`,``],[`🏏`,`cricket bat and ball`,`activity`,``],[`🏐`,`volleyball`,`activity`,`排球,球`],[`🏑`,`field hockey stick and ball`,`activity`,``],[`🏒`,`ice hockey stick and puck`,`activity`,``],[`🏓`,`table tennis paddle and ball`,`activity`,`乒乓球,乒乓,球`],[`🏔`,`snow capped mountain`,`activity`,``],[`🏕`,`camping`,`activity`,``],[`🏖`,`beach with umbrella`,`activity`,``],[`🏗`,`building construction`,`activity`,``],[`🏘`,`house buildings`,`activity`,``],[`🏙`,`cityscape`,`activity`,``],[`🏚`,`derelict house building`,`activity`,``],[`🏛`,`classical building`,`activity`,``],[`🏜`,`desert`,`activity`,``],[`🏝`,`desert island`,`activity`,``],[`🏞`,`national park`,`activity`,``],[`🏟`,`stadium`,`activity`,``],[`🏠`,`house building`,`travel`,`房子,家,住宅`],[`🏡`,`house with garden`,`travel`,`房子,家,花园`],[`🏢`,`office building`,`travel`,`办公楼,大楼,写字楼`],[`🏣`,`japanese post office`,`travel`,`邮局,邮政`],[`🏤`,`european post office`,`travel`,`邮局`],[`🏥`,`hospital`,`travel`,`医院,医疗`],[`🏦`,`bank`,`travel`,`银行,金融`],[`🏧`,`automated teller machine`,`travel`,``],[`🏨`,`hotel`,`travel`,`酒店,旅馆`],[`🏩`,`love hotel`,`travel`,`爱情旅馆,酒店`],[`🏪`,`convenience store`,`travel`,`便利店,商店`],[`🏫`,`school`,`travel`,`学校,校园`],[`🏬`,`department store`,`travel`,`商场,百货,购物`],[`🏭`,`factory`,`travel`,`工厂,工业`],[`🏮`,`izakaya lantern`,`travel`,``],[`🏯`,`japanese castle`,`objects`,`城堡,日本城堡`],[`🏰`,`european castle`,`travel`,`城堡,童话`],[`🏳`,`waving white flag`,`flags`,``],[`🏴`,`waving black flag`,`flags`,`黑旗`],[`🏵`,`rosette`,`objects`,``],[`🏷`,`label`,`objects`,``],[`🏸`,`badminton racquet and shuttlecock`,`activity`,`羽毛球,球`],[`🏹`,`bow and arrow`,`activity`,`射箭,弓箭,弓`],[`🏺`,`amphora`,`activity`,`陶罐,花瓶,双耳瓶`],[`🏻`,`emoji modifier fitzpatrick type-1-2`,`symbols`,``],[`🏼`,`emoji modifier fitzpatrick type-3`,`symbols`,``],[`🏽`,`emoji modifier fitzpatrick type-4`,`symbols`,``],[`🏾`,`emoji modifier fitzpatrick type-5`,`symbols`,``],[`🏿`,`emoji modifier fitzpatrick type-6`,`symbols`,``],[`🐀`,`rat`,`animals`,`老鼠,鼠`],[`🐁`,`mouse`,`animals`,`老鼠,鼠`],[`🐂`,`ox`,`animals`,`公牛,牛`],[`🐃`,`water buffalo`,`animals`,`水牛,牛`],[`🐄`,`cow`,`animals`,`奶牛,牛`],[`🐅`,`tiger`,`animals`,``],[`🐆`,`leopard`,`animals`,``],[`🐇`,`rabbit`,`animals`,`兔子,兔`],[`🐈`,`cat`,`animals`,`猫,猫咪`],[`🐉`,`dragon`,`animals`,`龙,中国龙`],[`🐊`,`crocodile`,`animals`,`鳄鱼,短吻鳄`],[`🐋`,`whale`,`animals`,`鲸鱼`],[`🐌`,`snail`,`animals`,``],[`🐍`,`snake`,`animals`,`蛇,爬行动物`],[`🐎`,`horse`,`animals`,``],[`🐏`,`ram`,`animals`,`羊,公羊`],[`🐐`,`goat`,`animals`,`山羊,羊`],[`🐑`,`sheep`,`animals`,`羊,绵羊`],[`🐒`,`monkey`,`animals`,``],[`🐓`,`rooster`,`animals`,`公鸡,鸡`],[`🐔`,`chicken`,`animals`,`鸡,母鸡`],[`🐕`,`dog`,`animals`,`狗,小狗`],[`🐖`,`pig`,`animals`,`猪`],[`🐗`,`boar`,`animals`,`野猪,猪`],[`🐘`,`elephant`,`animals`,`大象`],[`🐙`,`octopus`,`animals`,`章鱼,八爪鱼`],[`🐚`,`spiral shell`,`animals`,``],[`🐛`,`bug`,`animals`,``],[`🐜`,`ant`,`animals`,``],[`🐝`,`honeybee`,`animals`,``],[`🐞`,`lady beetle`,`animals`,``],[`🐟`,`fish`,`animals`,`鱼,鱼`],[`🐠`,`tropical fish`,`animals`,`热带鱼,鱼`],[`🐡`,`blowfish`,`animals`,`河豚,鱼`],[`🐢`,`turtle`,`animals`,`乌龟,慢`],[`🐣`,`hatching chick`,`animals`,`小鸡,破壳,孵化`],[`🐤`,`baby chick`,`animals`,`小鸡,黄,可爱`],[`🐥`,`front-facing baby chick`,`animals`,`小鸡,正面`],[`🐦`,`bird`,`animals`,`鸟`],[`🐧`,`penguin`,`animals`,`企鹅,南极`],[`🐨`,`koala`,`animals`,`考拉,无尾熊`],[`🐩`,`poodle`,`animals`,`贵宾犬,狗`],[`🐪`,`dromedary camel`,`animals`,`骆驼`],[`🐫`,`bactrian camel`,`animals`,`骆驼,双峰`],[`🐬`,`dolphin`,`animals`,`海豚,海洋`],[`🐭`,`mouse face`,`animals`,`老鼠,鼠`],[`🐮`,`cow face`,`animals`,`牛,奶牛`],[`🐯`,`tiger face`,`animals`,``],[`🐰`,`rabbit face`,`animals`,`兔子,兔,可爱`],[`🐱`,`cat face`,`animals`,``],[`🐲`,`dragon face`,`animals`,`龙,龙头`],[`🐳`,`spouting whale`,`animals`,`鲸鱼,喷水`],[`🐴`,`horse face`,`animals`,`马`],[`🐵`,`monkey face`,`animals`,``],[`🐶`,`dog face`,`animals`,``],[`🐷`,`pig face`,`animals`,`猪,猪头`],[`🐸`,`frog face`,`animals`,`青蛙,蛙`],[`🐹`,`hamster face`,`animals`,`仓鼠`],[`🐺`,`wolf face`,`animals`,``],[`🐻`,`bear face`,`animals`,`熊,泰迪熊`],[`🐼`,`panda face`,`animals`,``],[`🐽`,`pig nose`,`animals`,`猪鼻子,猪`],[`🐾`,`paw prints`,`animals`,`爪印,脚印`],[`🐿`,`chipmunk`,`animals`,``],[`👀`,`eyes`,`people`,``],[`👁`,`eye`,`people`,``],[`👂`,`ear`,`people`,`耳朵,听`],[`👃`,`nose`,`people`,`鼻子,闻`],[`👄`,`mouth`,`people`,`嘴巴,嘴唇,吻`],[`👅`,`tongue`,`people`,`舌头,舔`],[`👆`,`white up pointing backhand index`,`people`,`指,上面,向上`],[`👇`,`white down pointing backhand index`,`people`,`指,下面,向下`],[`👈`,`white left pointing backhand index`,`people`,`指,左边,指向`],[`👉`,`white right pointing backhand index`,`people`,`指,右边,指向`],[`👊`,`fisted hand sign`,`people`,`拳头,打,战斗`],[`👋`,`waving hand sign`,`people`,`挥手,再见,你好`],[`👌`,`ok hand sign`,`people`,`OK,好,可以`],[`👍`,`thumbs up sign`,`people`,`点赞,好,赞,棒`],[`👎`,`thumbs down sign`,`people`,`差评,不好,踩`],[`👏`,`clapping hands sign`,`people`,`鼓掌,拍手,掌声`],[`👐`,`open hands sign`,`people`,`张开,手,开放`],[`👑`,`crown`,`people`,`皇冠,王冠,国王,女王`],[`👒`,`womans hat`,`people`,`帽子,草帽,遮阳帽`],[`👓`,`eyeglasses`,`people`,`眼镜`],[`👔`,`necktie`,`people`,`领带,西装,工作`],[`👕`,`t-shirt`,`people`,`衣服,T恤`],[`👖`,`jeans`,`people`,`裤子,牛仔裤`],[`👗`,`dress`,`people`,`裙子,连衣裙`],[`👘`,`kimono`,`people`,`和服`],[`👙`,`bikini`,`people`,`比基尼,泳装`],[`👚`,`womans clothes`,`people`,`女装,衣服`],[`👛`,`purse`,`people`,`钱包,小包`],[`👜`,`handbag`,`people`,`手提包,包包`],[`👝`,`pouch`,`people`,`手拿包,包包`],[`👞`,`mans shoe`,`people`,`皮鞋,鞋`],[`👟`,`athletic shoe`,`people`,`运动鞋,跑鞋`],[`👠`,`high-heeled shoe`,`people`,`高跟鞋,鞋`],[`👡`,`womans sandal`,`people`,`凉鞋,鞋`],[`👢`,`womans boots`,`people`,`靴子,长靴`],[`👣`,`footprints`,`people`,`脚印,脚步,足迹`],[`👤`,`bust in silhouette`,`people`,`人,剪影,用户`],[`👥`,`busts in silhouette`,`people`,`人群,人,多个人`],[`👦`,`boy`,`people`,`男孩,小男孩`],[`👧`,`girl`,`people`,`女孩,小女孩`],[`👨`,`man`,`people`,`男人,男士`],[`👩`,`woman`,`people`,`女人,女士`],[`👪`,`family`,`people`,`家庭`],[`👫`,`woman and man holding hands`,`people`,``],[`👬`,`men holding hands`,`people`,``],[`👭`,`women holding hands`,`people`,``],[`👮`,`police officer`,`people`,`警察,警官`],[`👯`,`woman with bunny ears`,`people`,`兔子舞,蹦迪,派对`],[`👰`,`bride with veil`,`people`,`新娘,婚纱,结婚`],[`👱`,`person with blond hair`,`people`,``],[`👲`,`man with gua pi mao`,`people`,`中国人`],[`👳`,`man with turban`,`people`,`包头巾,印度,阿拉伯`],[`👴`,`older man`,`people`,`老人,老爷爷`],[`👵`,`older woman`,`people`,`老人,老奶奶`],[`👶`,`baby`,`people`,`婴儿,宝宝,小孩`],[`👷`,`construction worker`,`people`,`工人`],[`👸`,`princess`,`people`,`公主,女王`],[`👹`,`japanese ogre`,`people`,`妖怪,鬼,怪物`],[`👺`,`japanese goblin`,`people`,`天狗,怪物,鬼`],[`👻`,`ghost`,`people`,`幽灵,鬼,万圣节`],[`👼`,`baby angel`,`people`,`天使,婴儿,可爱`],[`👽`,`extraterrestrial alien`,`people`,`外星人,ET,飞碟`],[`👾`,`alien monster`,`people`,`外星人,怪兽,游戏`],[`👿`,`imp`,`people`,`恶魔,愤怒`],[`💀`,`skull`,`people`,`骷髅,死亡,骨头`],[`💁`,`information desk person`,`people`,``],[`💂`,`guardsman`,`people`,`卫兵,士兵`],[`💃`,`dancer`,`people`,`跳舞,舞女,跳舞`],[`💄`,`lipstick`,`people`,`口红,化妆`],[`💅`,`nail polish`,`people`,`美甲,指甲,涂`],[`💆`,`face massage`,`people`,`按摩,放松,头部`],[`💇`,`haircut`,`people`,`理发,剪发,发型`],[`💈`,`barber pole`,`people`,`理发店,理发`],[`💉`,`syringe`,`people`,`注射器,针,疫苗`],[`💊`,`pill`,`people`,`药丸,药,胶囊`],[`💋`,`kiss mark`,`people`,`吻,口红印,亲亲`],[`💌`,`love letter`,`people`,`情书,信,爱情`],[`💍`,`ring`,`people`,`戒指,钻戒,结婚`],[`💎`,`gem stone`,`people`,`钻石,宝石,珠宝`],[`💏`,`kiss`,`people`,``],[`💐`,`bouquet`,`smileys`,`花束,花,礼物`],[`💑`,`couple with heart`,`smileys`,``],[`💒`,`wedding`,`smileys`,`教堂,婚礼,教堂婚礼`],[`💓`,`beating heart`,`smileys`,`爱心,跳动,心跳`],[`💔`,`broken heart`,`smileys`,`心碎,伤心,破碎`],[`💕`,`two hearts`,`smileys`,`爱心,两个,喜欢`],[`💖`,`sparkling heart`,`smileys`,`爱心,闪光,喜欢`],[`💗`,`growing heart`,`smileys`,`爱心,跳动,喜欢`],[`💘`,`heart with arrow`,`smileys`,`爱心,箭,丘比特`],[`💙`,`blue heart`,`smileys`,``],[`💚`,`green heart`,`smileys`,``],[`💛`,`yellow heart`,`smileys`,``],[`💜`,`purple heart`,`smileys`,``],[`💝`,`heart with ribbon`,`smileys`,`爱心,礼物,蝴蝶结`],[`💞`,`revolving hearts`,`smileys`,`爱心,旋转,轮回`],[`💟`,`heart decoration`,`smileys`,`爱心,符号`],[`💠`,`diamond shape with a dot inside`,`objects`,``],[`💡`,`electric light bulb`,`objects`,``],[`💢`,`anger symbol`,`objects`,`生气,怒气`],[`💣`,`bomb`,`objects`,`炸弹,爆炸`],[`💤`,`sleeping symbol`,`objects`,`睡觉,打呼,困`],[`💥`,`collision symbol`,`objects`,``],[`💦`,`splashing sweat symbol`,`objects`,`汗,水,泪`],[`💧`,`droplet`,`objects`,`水滴,水,眼泪`],[`💨`,`dash symbol`,`objects`,`风,跑,快,烟雾`],[`💩`,`pile of poo`,`objects`,`大便,屎,狗屎`],[`💪`,`flexed biceps`,`people`,`肌肉,力量,加油,强壮`],[`💫`,`dizzy symbol`,`objects`,`星星,旋转`],[`💬`,`speech balloon`,`objects`,`对话,聊天`],[`💭`,`thought balloon`,`objects`,`想法,思考,气泡`],[`💮`,`white flower`,`objects`,``],[`💯`,`hundred points symbol`,`objects`,``],[`💰`,`money bag`,`objects`,`钱袋,钱,金钱`],[`💱`,`currency exchange`,`objects`,``],[`💲`,`heavy dollar sign`,`objects`,``],[`💳`,`credit card`,`objects`,`信用卡,银行卡,支付`],[`💴`,`banknote with yen sign`,`objects`,`日元,日圆,钱`],[`💵`,`banknote with dollar sign`,`objects`,`美元,美金,钱`],[`💶`,`banknote with euro sign`,`objects`,`欧元,钱`],[`💷`,`banknote with pound sign`,`objects`,`英镑,钱`],[`💸`,`money with wings`,`objects`,`钱,飞钱,花钱`],[`💹`,`chart with upwards trend and yen sign`,`objects`,`股票,上涨,图表,增长`],[`💺`,`seat`,`objects`,`座位,椅子,飞机座位`],[`💻`,`personal computer`,`objects`,`电脑,笔记本,笔记本电脑`],[`💼`,`briefcase`,`objects`,`公文包,工作,商务`],[`💽`,`minidisc`,`objects`,`光盘,磁盘`],[`💾`,`floppy disk`,`objects`,`软盘,保存`],[`💿`,`optical disc`,`objects`,`光盘,CD`],[`📀`,`dvd`,`objects`,`光盘,DVD`],[`📁`,`file folder`,`objects`,`文件夹`],[`📂`,`open file folder`,`objects`,`文件夹,打开`],[`📃`,`page with curl`,`objects`,`文件,文档`],[`📄`,`page facing up`,`objects`,`文件,文档,纸`],[`📅`,`calendar`,`objects`,`日历`],[`📆`,`tear-off calendar`,`objects`,`日历,日历页`],[`📇`,`card index`,`objects`,`名片,索引卡`],[`📈`,`chart with upwards trend`,`objects`,``],[`📉`,`chart with downwards trend`,`objects`,``],[`📊`,`bar chart`,`objects`,``],[`📋`,`clipboard`,`objects`,`剪贴板,清单,列表`],[`📌`,`pushpin`,`objects`,``],[`📍`,`round pushpin`,`objects`,``],[`📎`,`paperclip`,`objects`,``],[`📏`,`straight ruler`,`objects`,``],[`📐`,`triangular ruler`,`objects`,``],[`📑`,`bookmark tabs`,`objects`,`书签,标签,文件`],[`📒`,`ledger`,`objects`,``],[`📓`,`notebook`,`objects`,``],[`📔`,`notebook with decorative cover`,`objects`,``],[`📕`,`closed book`,`objects`,``],[`📖`,`open book`,`objects`,``],[`📗`,`green book`,`objects`,``],[`📘`,`blue book`,`objects`,``],[`📙`,`orange book`,`objects`,``],[`📚`,`books`,`objects`,``],[`📛`,`name badge`,`objects`,``],[`📜`,`scroll`,`objects`,``],[`📝`,`memo`,`objects`,`笔记,备忘录,写作,文档`],[`📞`,`telephone receiver`,`objects`,`电话`],[`📟`,`pager`,`objects`,`寻呼机,传呼机`],[`📠`,`fax machine`,`objects`,`传真机,传真`],[`📡`,`satellite antenna`,`objects`,`天线,卫星,信号`],[`📢`,`public address loudspeaker`,`objects`,``],[`📣`,`cheering megaphone`,`objects`,``],[`📤`,`outbox tray`,`objects`,`发送,输出,上传`],[`📥`,`inbox tray`,`objects`,`接收,下载,收件箱`],[`📦`,`package`,`objects`,`包裹,快递,箱子`],[`📧`,`e-mail symbol`,`objects`,`邮件,电子邮件`],[`📨`,`incoming envelope`,`objects`,`邮件,收到`],[`📩`,`envelope with downwards arrow above`,`objects`,`邮件,发送`],[`📪`,`closed mailbox with lowered flag`,`objects`,`邮箱,关闭`],[`📫`,`closed mailbox with raised flag`,`objects`,`邮箱,信箱,邮件`],[`📬`,`open mailbox with raised flag`,`objects`,`邮箱,有信`],[`📭`,`open mailbox with lowered flag`,`objects`,`邮箱,无信`],[`📮`,`postbox`,`objects`,`邮筒,邮政`],[`📯`,`postal horn`,`objects`,``],[`📰`,`newspaper`,`objects`,`报纸,新闻,报`],[`📱`,`mobile phone`,`objects`,`手机,智能手机,电话`],[`📲`,`mobile phone with rightwards arrow at left`,`objects`,`手机,接收,信号`],[`📳`,`vibration mode`,`objects`,``],[`📴`,`mobile phone off`,`objects`,``],[`📵`,`no mobile phones`,`objects`,``],[`📶`,`antenna with bars`,`objects`,``],[`📷`,`camera`,`objects`,`相机,拍照,照片`],[`📸`,`camera with flash`,`objects`,`相机,闪光灯,拍照`],[`📹`,`video camera`,`objects`,`摄像机,录像`],[`📺`,`television`,`objects`,``],[`📻`,`radio`,`objects`,`收音机,广播`],[`📼`,`videocassette`,`objects`,`录像带,磁带`],[`📽`,`film projector`,`objects`,``],[`📿`,`prayer beads`,`objects`,`念珠,佛珠,项链`],[`🔀`,`twisted rightwards arrows`,`objects`,``],[`🔁`,`clockwise rightwards and leftwards open circle arrows`,`objects`,``],[`🔂`,`clockwise rightwards and leftwards open circle arrows with circled one overlay`,`objects`,``],[`🔃`,`clockwise downwards and upwards open circle arrows`,`objects`,``],[`🔄`,`anticlockwise downwards and upwards open circle arrows`,`objects`,``],[`🔅`,`low brightness symbol`,`objects`,``],[`🔆`,`high brightness symbol`,`objects`,``],[`🔇`,`speaker with cancellation stroke`,`objects`,``],[`🔈`,`speaker`,`objects`,``],[`🔉`,`speaker with one sound wave`,`objects`,``],[`🔊`,`speaker with three sound waves`,`objects`,``],[`🔋`,`battery`,`objects`,``],[`🔌`,`electric plug`,`objects`,``],[`🔍`,`left-pointing magnifying glass`,`objects`,`搜索,放大镜,查找,查询`],[`🔎`,`right-pointing magnifying glass`,`objects`,`搜索,放大镜,查找`],[`🔏`,`lock with ink pen`,`objects`,`锁,保密,笔`],[`🔐`,`closed lock with key`,`objects`,`锁,安全,钥匙`],[`🔑`,`key`,`objects`,`钥匙,解锁`],[`🔒`,`lock`,`objects`,`锁,锁定,安全`],[`🔓`,`open lock`,`objects`,`解锁,打开`],[`🔔`,`bell`,`objects`,``],[`🔕`,`bell with cancellation stroke`,`objects`,``],[`🔖`,`bookmark`,`objects`,`书签,标记`],[`🔗`,`link symbol`,`objects`,``],[`🔘`,`radio button`,`objects`,``],[`🔙`,`back with leftwards arrow above`,`objects`,``],[`🔚`,`end with leftwards arrow above`,`objects`,``],[`🔛`,`on with exclamation mark with left right arrow above`,`objects`,``],[`🔜`,`soon with rightwards arrow above`,`objects`,``],[`🔝`,`top with upwards arrow above`,`objects`,``],[`🔞`,`no one under eighteen symbol`,`objects`,``],[`🔟`,`keycap 10`,`objects`,``],[`🔠`,`input symbol for latin capital letters`,`objects`,``],[`🔡`,`input symbol for latin small letters`,`objects`,``],[`🔢`,`input symbol for numbers`,`objects`,``],[`🔣`,`input symbol for symbols`,`objects`,``],[`🔤`,`input symbol for latin letters`,`objects`,``],[`🔥`,`fire`,`objects`,``],[`🔦`,`electric torch`,`objects`,``],[`🔧`,`wrench`,`objects`,`扳手,工具,维修`],[`🔨`,`hammer`,`objects`,`锤子,工具`],[`🔩`,`nut and bolt`,`objects`,`螺丝,螺母`],[`🔪`,`hocho`,`objects`,``],[`🔫`,`pistol`,`objects`,`枪`],[`🔬`,`microscope`,`objects`,`显微镜,科学,研究`],[`🔭`,`telescope`,`objects`,`望远镜,天文,观察`],[`🔮`,`crystal ball`,`objects`,``],[`🔯`,`six pointed star with middle dot`,`objects`,``],[`🔰`,`japanese symbol for beginner`,`objects`,``],[`🔱`,`trident emblem`,`objects`,``],[`🔲`,`black square button`,`objects`,``],[`🔳`,`white square button`,`objects`,``],[`🔴`,`large red circle`,`objects`,``],[`🔵`,`large blue circle`,`objects`,``],[`🔶`,`large orange diamond`,`objects`,``],[`🔷`,`large blue diamond`,`objects`,``],[`🔸`,`small orange diamond`,`objects`,``],[`🔹`,`small blue diamond`,`objects`,``],[`🔺`,`up-pointing red triangle`,`objects`,``],[`🔻`,`down-pointing red triangle`,`objects`,``],[`🔼`,`up-pointing small red triangle`,`objects`,``],[`🔽`,`down-pointing small red triangle`,`objects`,``],[`🕉`,`om symbol`,`objects`,``],[`🕊`,`dove of peace`,`objects`,``],[`🕋`,`kaaba`,`objects`,`天房,麦加,伊斯兰`],[`🕌`,`mosque`,`objects`,`清真寺,伊斯兰`],[`🕍`,`synagogue`,`objects`,`犹太教堂,犹太`],[`🕎`,`menorah with nine branches`,`objects`,``],[`🕐`,`clock face one oclock`,`objects`,`一点,时钟`],[`🕑`,`clock face two oclock`,`objects`,`两点,时钟`],[`🕒`,`clock face three oclock`,`objects`,`三点,时钟`],[`🕓`,`clock face four oclock`,`objects`,`四点,时钟`],[`🕔`,`clock face five oclock`,`objects`,`五点,时钟`],[`🕕`,`clock face six oclock`,`objects`,`六点,时钟`],[`🕖`,`clock face seven oclock`,`objects`,`七点,时钟`],[`🕗`,`clock face eight oclock`,`objects`,`八点,时钟`],[`🕘`,`clock face nine oclock`,`objects`,`九点,时钟`],[`🕙`,`clock face ten oclock`,`objects`,`十点,时钟`],[`🕚`,`clock face eleven oclock`,`objects`,`十一点,时钟`],[`🕛`,`clock face twelve oclock`,`objects`,`十二点,时钟,时间`],[`🕜`,`clock face one-thirty`,`objects`,``],[`🕝`,`clock face two-thirty`,`objects`,``],[`🕞`,`clock face three-thirty`,`objects`,``],[`🕟`,`clock face four-thirty`,`objects`,``],[`🕠`,`clock face five-thirty`,`objects`,``],[`🕡`,`clock face six-thirty`,`objects`,``],[`🕢`,`clock face seven-thirty`,`objects`,``],[`🕣`,`clock face eight-thirty`,`objects`,``],[`🕤`,`clock face nine-thirty`,`objects`,``],[`🕥`,`clock face ten-thirty`,`objects`,``],[`🕦`,`clock face eleven-thirty`,`objects`,``],[`🕧`,`clock face twelve-thirty`,`objects`,``],[`🕯`,`candle`,`objects`,``],[`🕰`,`mantelpiece clock`,`objects`,``],[`🕳`,`hole`,`objects`,``],[`🕴`,`man in business suit levitating`,`objects`,``],[`🕵`,`sleuth or spy`,`objects`,``],[`🕶`,`dark sunglasses`,`objects`,``],[`🕷`,`spider`,`objects`,``],[`🕸`,`spider web`,`objects`,``],[`🕹`,`joystick`,`objects`,``],[`🕺`,`man dancing`,`objects`,`跳舞,舞男`],[`🖇`,`linked paperclips`,`objects`,``],[`🖊`,`lower left ballpoint pen`,`objects`,``],[`🖋`,`lower left fountain pen`,`objects`,``],[`🖌`,`lower left paintbrush`,`objects`,``],[`🖍`,`lower left crayon`,`objects`,``],[`🖐`,`raised hand with fingers splayed`,`objects`,``],[`🖕`,`reversed hand with middle finger extended`,`objects`,`中指,骂人`],[`🖖`,`raised hand with part between middle and ring fingers`,`objects`,`瓦肯,举手,胜利`],[`🖤`,`black heart`,`objects`,``],[`🖥`,`desktop computer`,`objects`,``],[`🖨`,`printer`,`objects`,``],[`🖱`,`three button mouse`,`objects`,``],[`🖲`,`trackball`,`objects`,``],[`🖼`,`frame with picture`,`objects`,``],[`🗂`,`card index dividers`,`objects`,``],[`🗃`,`card file box`,`objects`,``],[`🗄`,`file cabinet`,`objects`,``],[`🗑`,`wastebasket`,`objects`,``],[`🗒`,`spiral note pad`,`objects`,``],[`🗓`,`spiral calendar pad`,`objects`,``],[`🗜`,`compression`,`objects`,``],[`🗝`,`old key`,`objects`,``],[`🗞`,`rolled-up newspaper`,`objects`,``],[`🗡`,`dagger knife`,`objects`,``],[`🗣`,`speaking head in silhouette`,`objects`,``],[`🗨`,`left speech bubble`,`objects`,``],[`🗯`,`right anger bubble`,`objects`,``],[`🗳`,`ballot box with ballot`,`objects`,``],[`🗺`,`world map`,`objects`,``],[`🗻`,`mount fuji`,`objects`,`富士山,山`],[`🗼`,`tokyo tower`,`objects`,`塔,东京塔`],[`🗽`,`statue of liberty`,`objects`,`自由女神像,纽约`],[`🗾`,`silhouette of japan`,`objects`,``],[`🗿`,`moyai`,`objects`,`雕像`],[`😀`,`grinning face`,`smileys`,`笑脸,开心,高兴`],[`😁`,`grinning face with smiling eyes`,`smileys`,`笑脸,开心`],[`😂`,`face with tears of joy`,`smileys`,`笑哭,大笑,笑`],[`😃`,`smiling face with open mouth`,`smileys`,`笑脸,开心`],[`😄`,`smiling face with open mouth and smiling eyes`,`smileys`,`笑脸,开心`],[`😅`,`smiling face with open mouth and cold sweat`,`smileys`,`笑脸,汗,尴尬`],[`😆`,`smiling face with open mouth and tightly-closed eyes`,`smileys`,`笑脸,大笑`],[`😇`,`smiling face with halo`,`smileys`,`天使,微笑,善良`],[`😈`,`smiling face with horns`,`smileys`,`恶魔,坏笑,邪恶`],[`😉`,`winking face`,`smileys`,`眨眼,调皮`],[`😊`,`smiling face with smiling eyes`,`smileys`,`微笑,开心,脸红`],[`😋`,`face savouring delicious food`,`smileys`,`好吃,美味,舔`],[`😌`,`relieved face`,`smileys`,`放松,安心`],[`😍`,`smiling face with heart-shaped eyes`,`smileys`,`爱,喜欢,花痴`],[`😎`,`smiling face with sunglasses`,`smileys`,`酷,墨镜,帅气`],[`😏`,`smirking face`,`smileys`,`得意,微笑,坏笑`],[`😐`,`neutral face`,`smileys`,`无语,面无表情`],[`😑`,`expressionless face`,`smileys`,`无语,面无表情`],[`😒`,`unamused face`,`smileys`,`不满,无语,翻白眼`],[`😓`,`face with cold sweat`,`smileys`,`冷汗,尴尬`],[`😔`,`pensive face`,`smileys`,`难过,低落`],[`😕`,`confused face`,`smileys`,`困惑,不解`],[`😖`,`confounded face`,`smileys`,`纠结,痛苦`],[`😗`,`kissing face`,`smileys`,`亲亲,吻`],[`😘`,`face throwing a kiss`,`smileys`,`飞吻,亲亲,爱`],[`😙`,`kissing face with smiling eyes`,`smileys`,``],[`😚`,`kissing face with closed eyes`,`smileys`,`亲亲,吻`],[`😛`,`face with stuck-out tongue`,`smileys`,`吐舌头,调皮`],[`😜`,`face with stuck-out tongue and winking eye`,`smileys`,`吐舌头,调皮,眨眼`],[`😝`,`face with stuck-out tongue and tightly-closed eyes`,`smileys`,`吐舌头,调皮`],[`😞`,`disappointed face`,`smileys`,`失望,难过`],[`😟`,`worried face`,`smileys`,`担心,忧虑`],[`😠`,`angry face`,`smileys`,`生气,愤怒`],[`😡`,`pouting face`,`smileys`,`生气,愤怒,红脸`],[`😢`,`crying face`,`smileys`,`哭,伤心,流泪`],[`😣`,`persevering face`,`smileys`,`挣扎,痛苦`],[`😤`,`face with look of triumph`,`smileys`,`生气,冒烟,气`],[`😥`,`disappointed but relieved face`,`smileys`,`难过,失望,松气`],[`😦`,`frowning face with open mouth`,`smileys`,`惊讶,张嘴`],[`😧`,`anguished face`,`smileys`,`震惊,痛苦`],[`😨`,`fearful face`,`smileys`,`害怕,恐惧`],[`😩`,`weary face`,`smileys`,`累,疲惫,哭`],[`😪`,`sleepy face`,`smileys`,`困,想睡`],[`😫`,`tired face`,`smileys`,`累,疲惫`],[`😬`,`grimacing face`,`smileys`,`尴尬,咧嘴`],[`😭`,`loudly crying face`,`smileys`,`大哭,伤心,哭`],[`😮`,`face with open mouth`,`smileys`,`惊讶,哇`],[`😯`,`hushed face`,`smileys`,`惊讶,安静`],[`😰`,`face with open mouth and cold sweat`,`smileys`,`担心,冷汗`],[`😱`,`face screaming in fear`,`smileys`,`尖叫,害怕,恐怖`],[`😲`,`astonished face`,`smileys`,`震惊,惊讶`],[`😳`,`flushed face`,`smileys`,`脸红,害羞,震惊`],[`😴`,`sleeping face`,`smileys`,`睡觉,睡觉`],[`😵`,`dizzy face`,`smileys`,`晕,头晕,死`],[`😶`,`face without mouth`,`smileys`,`沉默,无语`],[`😷`,`face with medical mask`,`smileys`,`生病,口罩,感冒`],[`😸`,`grinning cat face with smiling eyes`,`smileys`,`猫,笑脸`],[`😹`,`cat face with tears of joy`,`smileys`,`猫,笑哭`],[`😺`,`smiling cat face with open mouth`,`smileys`,`猫,笑脸,开心`],[`😻`,`smiling cat face with heart-shaped eyes`,`smileys`,`猫,爱,喜欢`],[`😼`,`cat face with wry smile`,`smileys`,`猫,坏笑`],[`😽`,`kissing cat face with closed eyes`,`smileys`,`猫,亲亲`],[`😾`,`pouting cat face`,`smileys`,`猫,生气`],[`😿`,`crying cat face`,`smileys`,`猫,哭,伤心`],[`🙀`,`weary cat face`,`smileys`,`猫,震惊,害怕`],[`🙁`,`slightly frowning face`,`smileys`,`难过,失望`],[`🙂`,`slightly smiling face`,`smileys`,`微笑,笑`],[`🙃`,`upside-down face`,`smileys`,`微笑,倒`],[`🙄`,`face with rolling eyes`,`smileys`,`翻白眼,无语`],[`🙅`,`face with no good gesture`,`smileys`,``],[`🙆`,`face with ok gesture`,`smileys`,``],[`🙇`,`person bowing deeply`,`smileys`,``],[`🙈`,`see-no-evil monkey`,`smileys`,``],[`🙉`,`hear-no-evil monkey`,`smileys`,``],[`🙊`,`speak-no-evil monkey`,`smileys`,``],[`🙋`,`happy person raising one hand`,`smileys`,``],[`🙌`,`person raising both hands in celebration`,`smileys`,`欢呼,举起,庆祝`],[`🙍`,`person frowning`,`smileys`,``],[`🙎`,`person with pouting face`,`smileys`,``],[`🙏`,`person with folded hands`,`smileys`,`祈祷,拜托,感谢,合十`],[`🚀`,`rocket`,`travel`,`火箭,发射,太空`],[`🚁`,`helicopter`,`travel`,`直升机`],[`🚂`,`steam locomotive`,`travel`,`火车,蒸汽火车`],[`🚃`,`railway car`,`travel`,`电车,火车`],[`🚄`,`high-speed train`,`travel`,`高铁,动车,火车`],[`🚅`,`high-speed train with bullet nose`,`travel`,``],[`🚆`,`train`,`travel`,`火车,铁路`],[`🚇`,`metro`,`travel`,`地铁,地铁站`],[`🚈`,`light rail`,`travel`,`轻轨,轨道交通`],[`🚉`,`station`,`travel`,`火车站,车站`],[`🚊`,`tram`,`travel`,`电车`],[`🚋`,`tram car`,`travel`,`电车,有轨电车`],[`🚌`,`bus`,`travel`,`公交车,巴士`],[`🚍`,`oncoming bus`,`travel`,`公交车`],[`🚎`,`trolleybus`,`travel`,`无轨电车,巴士`],[`🚏`,`bus stop`,`travel`,`公交站,车站`],[`🚐`,`minibus`,`travel`,`面包车,小巴`],[`🚑`,`ambulance`,`travel`,`救护车,急救`],[`🚒`,`fire engine`,`travel`,`消防车,救火`],[`🚓`,`police car`,`travel`,`警车,警察`],[`🚔`,`oncoming police car`,`travel`,`警车,巡逻`],[`🚕`,`taxi`,`travel`,`出租车,的士`],[`🚖`,`oncoming taxi`,`travel`,`出租车`],[`🚗`,`automobile`,`travel`,`汽车,轿车,车`],[`🚘`,`oncoming automobile`,`travel`,`汽车`],[`🚙`,`recreational vehicle`,`travel`,`SUV,越野车,汽车`],[`🚚`,`delivery truck`,`travel`,`卡车,货车`],[`🚛`,`articulated lorry`,`travel`,`卡车,货车`],[`🚜`,`tractor`,`travel`,`拖拉机,农用`],[`🚝`,`monorail`,`travel`,`单轨,单轨列车`],[`🚞`,`mountain railway`,`travel`,`火车,山区铁路`],[`🚟`,`suspension railway`,`travel`,`缆车,悬挂列车`],[`🚠`,`mountain cableway`,`travel`,`缆车,高山`],[`🚡`,`aerial tramway`,`travel`,`缆车,索道`],[`🚢`,`ship`,`travel`,`轮船,船,大海`],[`🚣`,`rowboat`,`travel`,``],[`🚤`,`speedboat`,`travel`,`快艇,汽艇`],[`🚥`,`horizontal traffic light`,`travel`,`红绿灯,交通信号灯`],[`🚦`,`vertical traffic light`,`travel`,`红绿灯,信号灯`],[`🚧`,`construction sign`,`travel`,`施工,施工中,路障`],[`🚨`,`police cars revolving light`,`travel`,`警车灯,警报,紧急`],[`🚩`,`triangular flag on post`,`travel`,`红旗,旗帜,标志`],[`🚪`,`door`,`travel`,`门,房门`],[`🚫`,`no entry sign`,`travel`,``],[`🚬`,`smoking symbol`,`travel`,`香烟,烟,吸烟`],[`🚭`,`no smoking symbol`,`travel`,``],[`🚮`,`put litter in its place symbol`,`travel`,`垃圾,清理`],[`🚯`,`do not litter symbol`,`travel`,``],[`🚰`,`potable water symbol`,`travel`,``],[`🚱`,`non-potable water symbol`,`travel`,``],[`🚲`,`bicycle`,`travel`,`自行车,单车,骑行`],[`🚳`,`no bicycles`,`travel`,``],[`🚴`,`bicyclist`,`travel`,``],[`🚵`,`mountain bicyclist`,`travel`,``],[`🚶`,`pedestrian`,`travel`,`走路,步行,散步`],[`🚷`,`no pedestrians`,`travel`,``],[`🚸`,`children crossing`,`travel`,``],[`🚹`,`mens symbol`,`travel`,``],[`🚺`,`womens symbol`,`travel`,``],[`🚻`,`restroom`,`travel`,``],[`🚼`,`baby symbol`,`travel`,``],[`🚽`,`toilet`,`travel`,`马桶,厕所,卫生间`],[`🚾`,`water closet`,`travel`,``],[`🚿`,`shower`,`travel`,`淋浴,洗澡`],[`🛀`,`bath`,`travel`,`泡澡`],[`🛁`,`bathtub`,`travel`,`浴缸,洗澡,泡澡`],[`🛂`,`passport control`,`travel`,``],[`🛃`,`customs`,`travel`,``],[`🛄`,`baggage claim`,`travel`,``],[`🛅`,`left luggage`,`travel`,``],[`🛋`,`couch and lamp`,`travel`,``],[`🛌`,`sleeping accommodation`,`travel`,`睡觉`],[`🛍`,`shopping bags`,`travel`,``],[`🛎`,`bellhop bell`,`travel`,``],[`🛏`,`bed`,`travel`,``],[`🛐`,`place of worship`,`travel`,``],[`🛑`,`octagonal sign`,`travel`,`停止,停车,红圈`],[`🛒`,`shopping trolley`,`travel`,`购物车,购物`],[`🛕`,`hindu temple`,`travel`,`印度教神庙`],[`🛖`,`hut`,`travel`,`草屋,小屋`],[`🛗`,`elevator`,`travel`,``],[`🛜`,`wireless`,`travel`,``],[`🛝`,`playground slide`,`travel`,``],[`🛞`,`wheel`,`travel`,`车轮,轮胎`],[`🛟`,`ring buoy`,`travel`,`救生圈,救生`],[`🛠`,`hammer and wrench`,`travel`,``],[`🛡`,`shield`,`travel`,``],[`🛢`,`oil drum`,`travel`,``],[`🛣`,`motorway`,`travel`,``],[`🛤`,`railway track`,`travel`,``],[`🛥`,`motor boat`,`travel`,``],[`🛩`,`small airplane`,`travel`,``],[`🛫`,`airplane departure`,`travel`,`起飞,飞机,出发`],[`🛬`,`airplane arriving`,`travel`,`降落,飞机,到达`],[`🛰`,`satellite`,`travel`,``],[`🛳`,`passenger ship`,`travel`,``],[`🛴`,`scooter`,`travel`,`滑板车,平衡车`],[`🛵`,`motor scooter`,`travel`,`摩托车,电动车,踏板车`],[`🛶`,`canoe`,`travel`,`独木舟,皮划艇`],[`🛷`,`sled`,`travel`,`雪橇,雪车`],[`🛸`,`flying saucer`,`travel`,`飞碟,UFO,外星人`],[`🛹`,`skateboard`,`travel`,`滑板`],[`🛺`,`auto rickshaw`,`travel`,`三轮车,突突车`],[`🛻`,`pickup truck`,`travel`,`皮卡,卡车`],[`🛼`,`roller skate`,`travel`,`轮滑`],[`🟠`,`large orange circle`,`symbols`,``],[`🟡`,`large yellow circle`,`symbols`,``],[`🟢`,`large green circle`,`symbols`,``],[`🟣`,`large purple circle`,`symbols`,``],[`🟤`,`large brown circle`,`symbols`,``],[`🟥`,`large red square`,`symbols`,``],[`🟦`,`large blue square`,`symbols`,``],[`🟧`,`large orange square`,`symbols`,``],[`🟨`,`large yellow square`,`symbols`,``],[`🟩`,`large green square`,`symbols`,``],[`🟪`,`large purple square`,`symbols`,``],[`🟫`,`large brown square`,`symbols`,``],[`🟰`,`heavy equals sign`,`symbols`,``],[`🤌`,`pinched fingers`,`symbols`,`手指,捏,意大利`],[`🤍`,`white heart`,`symbols`,`白心,白色,爱心`],[`🤎`,`brown heart`,`symbols`,`棕心,棕色,爱心`],[`🤏`,`pinching hand`,`symbols`,`捏,一点点,微小`],[`🤐`,`zipper-mouth face`,`smileys`,`闭嘴,不说`],[`🤑`,`money-mouth face`,`smileys`,`发财,金钱,贪婪`],[`🤒`,`face with thermometer`,`smileys`,`发烧,生病,温度计`],[`🤓`,`nerd face`,`smileys`,`书呆子,眼镜`],[`🤔`,`thinking face`,`smileys`,`思考,疑问,想`],[`🤕`,`face with head-bandage`,`smileys`,`受伤,包扎,头`],[`🤖`,`robot face`,`smileys`,`机器人,AI,机械`],[`🤗`,`hugging face`,`smileys`,`拥抱,欢迎`],[`🤘`,`sign of the horns`,`smileys`,`摇滚,手势,牛`],[`🤙`,`call me hand`,`smileys`,`打电话,挂,酷`],[`🤚`,`raised back of hand`,`smileys`,`手,举手,停`],[`🤛`,`left-facing fist`,`smileys`,`拳头,左边`],[`🤜`,`right-facing fist`,`smileys`,`拳头,右边`],[`🤝`,`handshake`,`smileys`,`握手,合作,协议`],[`🤞`,`hand with index and middle fingers crossed`,`smileys`,`祈祷,好运,手指交叉`],[`🤟`,`i love you hand sign`,`smileys`,`爱你,摇滚`],[`🤠`,`face with cowboy hat`,`smileys`,`牛仔,帽子`],[`🤡`,`clown face`,`smileys`,`小丑,马戏团`],[`🤢`,`nauseated face`,`smileys`,`恶心,呕吐`],[`🤣`,`rolling on the floor laughing`,`smileys`,`笑哭,大笑,笑`],[`🤤`,`drooling face`,`smileys`,`流口水,馋`],[`🤥`,`lying face`,`smileys`,`说谎,撒谎`],[`🤦`,`face palm`,`smileys`,`捂脸,无奈,扶额`],[`🤧`,`sneezing face`,`smileys`,`打喷嚏,感冒`],[`🤨`,`face with one eyebrow raised`,`symbols`,`怀疑,挑眉`],[`🤩`,`grinning face with star eyes`,`symbols`,`星星眼,兴奋,惊讶`],[`🤪`,`grinning face with one large and one small eye`,`symbols`,`疯狂,搞怪`],[`🤫`,`face with finger covering closed lips`,`symbols`,`嘘,安静`],[`🤬`,`serious face with symbols covering mouth`,`symbols`,`骂人,脏话,生气`],[`🤭`,`smiling face with smiling eyes and hand covering mouth`,`symbols`,`捂嘴,偷笑,惊讶`],[`🤮`,`face with open mouth vomiting`,`symbols`,`呕吐,恶心`],[`🤯`,`shocked face with exploding head`,`smileys`,`爆炸,震惊,头炸`],[`🤰`,`pregnant woman`,`people`,`孕妇,怀孕`],[`🤱`,`breast-feeding`,`people`,``],[`🤲`,`palms up together`,`people`,``],[`🤳`,`selfie`,`people`,`自拍,拍照`],[`🤴`,`prince`,`people`,`王子,国王`],[`🤵`,`man in tuxedo`,`people`,`新郎,西装,燕尾服`],[`🤶`,`mother christmas`,`people`,`圣诞奶奶,圣诞老人`],[`🤷`,`shrug`,`people`,`耸肩,无奈,不知道`],[`🤸`,`person doing cartwheel`,`people`,`翻跟头,体操,空翻`],[`🤹`,`juggling`,`people`,`杂耍`],[`🤺`,`fencer`,`people`,`击剑,剑术`],[`🤼`,`wrestlers`,`activity`,`摔跤,格斗`],[`🤽`,`water polo`,`activity`,``],[`🤾`,`handball`,`activity`,``],[`🤿`,`diving mask`,`activity`,`潜水面罩,潜水`],[`🥀`,`wilted flower`,`symbols`,``],[`🥁`,`drum with drumsticks`,`symbols`,`鼓,打鼓,乐器`],[`🥂`,`clinking glasses`,`symbols`,`干杯,香槟杯`],[`🥃`,`tumbler glass`,`symbols`,`威士忌,酒杯`],[`🥄`,`spoon`,`symbols`,`勺子,汤匙`],[`🥅`,`goal net`,`symbols`,`球门,网,进球`],[`🥇`,`first place medal`,`symbols`,`金牌,冠军,第一名,奖牌`],[`🥈`,`second place medal`,`symbols`,`银牌,第二名,奖牌`],[`🥉`,`third place medal`,`symbols`,`铜牌,第三名,奖牌`],[`🥊`,`boxing glove`,`symbols`,`拳击,拳击手套,打拳`],[`🥋`,`martial arts uniform`,`symbols`,`道服,武术,空手道`],[`🥌`,`curling stone`,`symbols`,`冰壶,冰壶`],[`🥍`,`lacrosse stick and ball`,`symbols`,``],[`🥎`,`softball`,`symbols`,`垒球,球`],[`🥏`,`flying disc`,`symbols`,`飞盘,飞碟`],[`🥐`,`croissant`,`food`,`牛角包,可颂`],[`🥑`,`avocado`,`food`,`牛油果,鳄梨`],[`🥒`,`cucumber`,`food`,`黄瓜`],[`🥓`,`bacon`,`food`,`培根,腊肉`],[`🥔`,`potato`,`food`,`土豆,马铃薯`],[`🥕`,`carrot`,`food`,`胡萝卜`],[`🥖`,`baguette bread`,`food`,`法棍,面包`],[`🥗`,`green salad`,`food`,`沙拉,蔬菜`],[`🥘`,`shallow pan of food`,`food`,`炖锅,海鲜饭`],[`🥙`,`stuffed flatbread`,`food`,`卷饼,肉夹馍`],[`🥚`,`egg`,`food`,`鸡蛋,蛋`],[`🥛`,`glass of milk`,`food`,`牛奶,奶`],[`🥜`,`peanuts`,`food`,``],[`🥝`,`kiwifruit`,`food`,`猕猴桃,奇异果`],[`🥞`,`pancakes`,`food`,`松饼,煎饼`],[`🥟`,`dumpling`,`food`,`饺子,锅贴`],[`🥠`,`fortune cookie`,`food`,`幸运饼干`],[`🥡`,`takeout box`,`food`,``],[`🥢`,`chopsticks`,`food`,`筷子`],[`🥣`,`bowl with spoon`,`food`,``],[`🥤`,`cup with straw`,`food`,`饮料,杯`],[`🥥`,`coconut`,`food`,`椰子`],[`🥦`,`broccoli`,`food`,`西兰花`],[`🥧`,`pie`,`food`,`派,馅饼`],[`🥨`,`pretzel`,`food`,`椒盐卷饼`],[`🥩`,`cut of meat`,`food`,`牛排,肉`],[`🥪`,`sandwich`,`food`,`三明治`],[`🥫`,`canned food`,`food`,`罐头,罐装`],[`🥬`,`leafy green`,`symbols`,`青菜,白菜,生菜`],[`🥭`,`mango`,`symbols`,`芒果`],[`🥮`,`moon cake`,`symbols`,``],[`🥯`,`bagel`,`symbols`,`贝果,面包圈`],[`🥰`,`smiling face with smiling eyes and three hearts`,`smileys`,`爱,微笑,爱心`],[`🥱`,`yawning face`,`smileys`,`打哈欠,困,无聊`],[`🥲`,`smiling face with tear`,`smileys`,``],[`🥳`,`face with party horn and party hat`,`smileys`,`庆祝,派对,欢呼`],[`🥴`,`face with uneven eyes and wavy mouth`,`smileys`,`晕,醉,头昏`],[`🥵`,`overheated face`,`smileys`,`热`],[`🥶`,`freezing face`,`smileys`,`冷`],[`🥷`,`ninja`,`people`,`忍者,忍者`],[`🥸`,`disguised face`,`symbols`,`伪装`],[`🥹`,`face holding back tears`,`symbols`,`感动,忍住,哭,泪目`],[`🥺`,`face with pleading eyes`,`smileys`,`可怜,委屈,求`],[`🥻`,`sari`,`symbols`,`纱丽,印度`],[`🥼`,`lab coat`,`symbols`,``],[`🥽`,`goggles`,`symbols`,``],[`🥾`,`hiking boot`,`symbols`,`靴子,登山鞋`],[`🥿`,`flat shoe`,`symbols`,`平底鞋,鞋`],[`🦀`,`crab`,`animals`,`螃蟹,海鲜`],[`🦁`,`lion face`,`animals`,``],[`🦂`,`scorpion`,`animals`,``],[`🦃`,`turkey`,`animals`,`火鸡,感恩节`],[`🦄`,`unicorn face`,`animals`,`独角兽,梦幻`],[`🦅`,`eagle`,`animals`,`老鹰,鹰`],[`🦆`,`duck`,`animals`,`鸭子,鸭`],[`🦇`,`bat`,`animals`,`蝙蝠`],[`🦈`,`shark`,`animals`,`鲨鱼,鱼`],[`🦉`,`owl`,`animals`,`猫头鹰,智慧`],[`🦊`,`fox face`,`animals`,``],[`🦋`,`butterfly`,`animals`,``],[`🦌`,`deer`,`animals`,`鹿,麋鹿`],[`🦍`,`gorilla`,`animals`,``],[`🦎`,`lizard`,`animals`,`蜥蜴,爬行动物`],[`🦏`,`rhinoceros`,`animals`,`犀牛`],[`🦐`,`shrimp`,`animals`,`虾,海鲜`],[`🦑`,`squid`,`animals`,`鱿鱼,海鲜`],[`🦒`,`giraffe face`,`animals`,`长颈鹿`],[`🦓`,`zebra face`,`animals`,`斑马`],[`🦔`,`hedgehog`,`animals`,`刺猬`],[`🦕`,`sauropod`,`animals`,`恐龙,雷龙`],[`🦖`,`t-rex`,`animals`,`恐龙,霸王龙`],[`🦗`,`cricket`,`animals`,``],[`🦘`,`kangaroo`,`animals`,`袋鼠`],[`🦙`,`llama`,`animals`,`羊驼,草泥马`],[`🦚`,`peacock`,`animals`,`孔雀,开屏`],[`🦛`,`hippopotamus`,`animals`,`河马`],[`🦜`,`parrot`,`animals`,`鹦鹉`],[`🦝`,`raccoon`,`animals`,`浣熊`],[`🦞`,`lobster`,`animals`,`龙虾,海鲜`],[`🦟`,`mosquito`,`animals`,``],[`🦠`,`microbe`,`animals`,``],[`🦡`,`badger`,`animals`,`獾`],[`🦢`,`swan`,`animals`,`天鹅,鹅`],[`🦣`,`mammoth`,`animals`,`猛犸象`],[`🦤`,`dodo`,`animals`,`渡渡鸟`],[`🦥`,`sloth`,`animals`,`树懒`],[`🦦`,`otter`,`animals`,`水獭`],[`🦧`,`orangutan`,`animals`,``],[`🦨`,`skunk`,`animals`,`臭鼬`],[`🦩`,`flamingo`,`animals`,`火烈鸟,红鹤`],[`🦪`,`oyster`,`animals`,`生蚝,牡蛎`],[`🦫`,`beaver`,`animals`,`河狸,海狸`],[`🦬`,`bison`,`animals`,`野牛,水牛`],[`🦭`,`seal`,`animals`,`海豹,海狮`],[`🦮`,`guide dog`,`animals`,`导盲犬,狗`],[`🦯`,`probing cane`,`symbols`,``],[`🦰`,`emoji component red hair`,`people`,`红发,头发,发色`],[`🦱`,`emoji component curly hair`,`people`,`卷发,头发`],[`🦲`,`emoji component bald`,`people`,`光头,秃头`],[`🦳`,`emoji component white hair`,`people`,`白发,头发`],[`🦴`,`bone`,`people`,``],[`🦵`,`leg`,`people`,`腿,大腿`],[`🦶`,`foot`,`people`,`脚,足`],[`🦷`,`tooth`,`people`,`牙齿,牙`],[`🦸`,`superhero`,`people`,`英雄`],[`🦹`,`supervillain`,`people`,`超级反派,坏人,反派`],[`🦺`,`safety vest`,`symbols`,``],[`🦻`,`ear with hearing aid`,`symbols`,`助听器,耳朵`],[`🦼`,`motorized wheelchair`,`people`,``],[`🦽`,`manual wheelchair`,`people`,``],[`🦾`,`mechanical arm`,`people`,`机械臂,机器人,义肢`],[`🦿`,`mechanical leg`,`people`,`机械腿,义肢`],[`🧀`,`cheese wedge`,`food`,`奶酪,芝士`],[`🧁`,`cupcake`,`food`,`纸杯蛋糕,杯子蛋糕`],[`🧂`,`salt shaker`,`food`,``],[`🧃`,`beverage box`,`food`,`果汁盒,饮料`],[`🧄`,`garlic`,`food`,`大蒜,蒜`],[`🧅`,`onion`,`food`,`洋葱`],[`🧆`,`falafel`,`food`,`鹰嘴豆丸子`],[`🧇`,`waffle`,`food`,`华夫饼`],[`🧈`,`butter`,`food`,`黄油,奶油`],[`🧉`,`mate drink`,`food`,`马黛茶`],[`🧊`,`ice cube`,`food`,`冰块,冰`],[`🧋`,`bubble tea`,`food`,`奶茶,珍珠奶茶`],[`🧌`,`troll`,`symbols`,`巨魔,妖怪`],[`🧍`,`standing person`,`symbols`,`站立,站着,人`],[`🧎`,`kneeling person`,`symbols`,`跪,跪下,祈祷`],[`🧏`,`deaf person`,`symbols`,``],[`🧐`,`face with monocle`,`people`,`检查,研究,眼镜`],[`🧑`,`adult`,`people`,`人`],[`🧒`,`child`,`people`,``],[`🧓`,`older adult`,`people`,`老人,奶奶,爷爷`],[`🧔`,`bearded person`,`people`,`胡子,胡须,大叔`],[`🧕`,`person with headscarf`,`people`,`头巾`],[`🧖`,`person in steamy room`,`people`,`桑拿,蒸汽,洗澡`],[`🧗`,`person climbing`,`people`,`攀岩`],[`🧘`,`person in lotus position`,`people`,`打坐`],[`🧙`,`mage`,`people`,`巫师,魔法师,法师`],[`🧚`,`fairy`,`people`,`仙女,精灵,小仙女`],[`🧛`,`vampire`,`people`,`吸血鬼,德古拉`],[`🧜`,`merperson`,`people`,`美人鱼,人鱼`],[`🧝`,`elf`,`people`,`精灵,耳朵`],[`🧞`,`genie`,`people`,`灯神,精灵,神灯`],[`🧟`,`zombie`,`people`,`僵尸,丧尸`],[`🧠`,`brain`,`people`,`大脑,思考,记忆,AI`],[`🧡`,`orange heart`,`people`,``],[`🧢`,`billed cap`,`people`,`棒球帽,帽子`],[`🧣`,`scarf`,`people`,`围巾,冬天`],[`🧤`,`gloves`,`people`,`手套,冬天`],[`🧥`,`coat`,`people`,`大衣,外套`],[`🧦`,`socks`,`people`,`袜子`],[`🧧`,`red gift envelope`,`objects`,`红包,利是,新年`],[`🧨`,`firecracker`,`objects`,``],[`🧩`,`jigsaw puzzle piece`,`objects`,`拼图,拼图游戏`],[`🧪`,`test tube`,`objects`,`试管,实验,化学,科学`],[`🧫`,`petri dish`,`objects`,`培养皿,实验,细菌`],[`🧬`,`dna double helix`,`objects`,`DNA,基因,生物`],[`🧭`,`compass`,`objects`,`指南针`],[`🧮`,`abacus`,`objects`,`算盘,计算`],[`🧯`,`fire extinguisher`,`objects`,`灭火器,消防`],[`🧰`,`toolbox`,`objects`,`工具箱,工具`],[`🧱`,`brick`,`objects`,`砖`],[`🧲`,`magnet`,`objects`,`磁铁,磁性`],[`🧳`,`luggage`,`objects`,`行李箱`],[`🧴`,`lotion bottle`,`objects`,`乳液,护肤,防晒`],[`🧵`,`spool of thread`,`objects`,`线,针线,缝纫`],[`🧶`,`ball of yarn`,`objects`,`毛线,织毛衣`],[`🧷`,`safety pin`,`objects`,`别针,安全别针`],[`🧸`,`teddy bear`,`objects`,`泰迪熊,玩具熊`],[`🧹`,`broom`,`objects`,`扫帚`],[`🧺`,`basket`,`objects`,`篮子`],[`🧻`,`roll of paper`,`objects`,`纸巾`],[`🧼`,`bar of soap`,`objects`,`肥皂,洗手,清洁`],[`🧽`,`sponge`,`objects`,`海绵,清洁`],[`🧾`,`receipt`,`objects`,`收据`],[`🧿`,`nazar amulet`,`objects`,`护身符`],[`🩰`,`ballet shoes`,`activity`,`芭蕾`],[`🩱`,`one-piece swimsuit`,`activity`,`泳衣`],[`🩲`,`briefs`,`activity`,`泳裤`],[`🩳`,`shorts`,`activity`,`短裤`],[`🩴`,`thong sandal`,`activity`,`凉拖`],[`🩵`,`light blue heart`,`activity`,`浅蓝`],[`🩶`,`grey heart`,`activity`,`灰心`],[`🩷`,`pink heart`,`activity`,`粉色`],[`🩸`,`drop of blood`,`activity`,`血`],[`🩹`,`adhesive bandage`,`activity`,`创可贴`],[`🩺`,`stethoscope`,`activity`,`听诊器`],[`🩻`,`x-ray`,`activity`,`X光`],[`🩼`,`crutch`,`activity`,`拐杖`],[`🪀`,`yo-yo`,`objects`,`玩具`],[`🪁`,`kite`,`objects`,`风筝`],[`🪂`,`parachute`,`objects`,`跳伞`],[`🪃`,`boomerang`,`objects`,``],[`🪄`,`magic wand`,`objects`,`魔杖,魔法,魔术`],[`🪅`,`pinata`,`objects`,`皮纳塔`],[`🪆`,`nesting dolls`,`objects`,``],[`🪇`,`maracas`,`objects`,`沙锤`],[`🪈`,`flute`,`objects`,`笛子`],[`🪐`,`ringed planet`,`objects`,``],[`🪑`,`chair`,`objects`,`椅子`],[`🪒`,`razor`,`objects`,`剃须刀,剃刀`],[`🪓`,`axe`,`objects`,`斧头,斧子`],[`🪔`,`diya lamp`,`objects`,`油灯`],[`🪕`,`banjo`,`objects`,`班卓琴`],[`🪖`,`military helmet`,`objects`,`军盔`],[`🪗`,`accordion`,`objects`,`手风琴`],[`🪘`,`long drum`,`objects`,`鼓`],[`🪙`,`coin`,`objects`,`金币`],[`🪚`,`carpentry saw`,`objects`,`锯子,锯`],[`🪛`,`screwdriver`,`objects`,`螺丝刀`],[`🪜`,`ladder`,`objects`,`梯子`],[`🪝`,`hook`,`objects`,`钩子,挂钩`],[`🪞`,`mirror`,`objects`,`镜子`],[`🪟`,`window`,`objects`,`窗户`],[`🪠`,`plunger`,`objects`,`皮搋子,通马桶`],[`🪡`,`sewing needle`,`objects`,`针,缝纫,刺绣`],[`🪢`,`knot`,`objects`,``],[`🪣`,`bucket`,`objects`,`水桶,桶`],[`🪤`,`mouse trap`,`objects`,`捕鼠器`],[`🪥`,`toothbrush`,`objects`,`牙刷,刷牙`],[`🪦`,`headstone`,`objects`,`墓碑`],[`🪧`,`placard`,`objects`,`告示牌`],[`🪨`,`rock`,`objects`,`石头,岩石`],[`🪩`,`mirror ball`,`objects`,`迪斯科球`],[`🪪`,`identification card`,`objects`,`身份证`],[`🪫`,`low battery`,`objects`,`电池,没电,低电量`],[`🪬`,`hamsa`,`objects`,`手掌印,护身符`],[`🪭`,`folding hand fan`,`objects`,``],[`🪮`,`hair pick`,`objects`,`梳子`],[`🪯`,`khanda`,`objects`,``],[`🪰`,`fly`,`objects`,`苍蝇,飞虫`],[`🪱`,`worm`,`objects`,``],[`🪲`,`beetle`,`objects`,`甲虫,昆虫`],[`🪳`,`cockroach`,`objects`,`蟑螂,虫子`],[`🪴`,`potted plant`,`objects`,`盆栽,植物,绿植`],[`🪵`,`wood`,`objects`,`木头,柴火,木`],[`🪶`,`feather`,`objects`,`羽毛,羽毛笔`],[`🪷`,`lotus`,`objects`,`莲花`],[`🪸`,`coral`,`objects`,`珊瑚`],[`🪹`,`empty nest`,`objects`,`鸟巢`],[`🪺`,`nest with eggs`,`objects`,`鸟巢`],[`🪻`,`hyacinth`,`objects`,`风信子`],[`🪼`,`jellyfish`,`objects`,`水母`],[`🪽`,`wing`,`objects`,`翅膀`],[`🪿`,`goose`,`objects`,`鹅`],[`🫀`,`anatomical heart`,`objects`,`心脏,心跳`],[`🫁`,`lungs`,`objects`,`肺,呼吸`],[`🫂`,`people hugging`,`objects`,`拥抱,人,朋友`],[`🫃`,`pregnant man`,`objects`,`孕妇,怀孕`],[`🫄`,`pregnant person`,`objects`,`孕妇,怀孕`],[`🫅`,`person with crown`,`objects`,`国王,王子,皇冠`],[`🫎`,`moose`,`objects`,`驼鹿,麋鹿`],[`🫏`,`donkey`,`objects`,`驴,动物`],[`🫐`,`blueberries`,`food`,`蓝莓`],[`🫑`,`bell pepper`,`food`,`甜椒,彩椒`],[`🫒`,`olive`,`food`,`橄榄`],[`🫓`,`flatbread`,`food`,`薄饼,饼`],[`🫔`,`tamale`,`food`,`玉米粉蒸肉`],[`🫕`,`fondue`,`food`,`奶酪火锅`],[`🫖`,`teapot`,`food`,`茶壶,茶`],[`🫗`,`pouring liquid`,`food`,`倒,倒水,水杯`],[`🫘`,`beans`,`food`,`豆子,红豆`],[`🫙`,`jar`,`food`,`罐子,玻璃罐`],[`🫚`,`ginger root`,`food`,`姜,生姜`],[`🫛`,`pea pod`,`food`,`豌豆荚,豆`],[`🫠`,`melting face`,`smileys`,`融化`],[`🫡`,`saluting face`,`smileys`,`敬礼`],[`🫢`,`face with open eyes and hand over mouth`,`smileys`,`捂眼`],[`🫣`,`face with peeking eye`,`smileys`,`偷看`],[`🫤`,`face with diagonal mouth`,`smileys`,`撇嘴`],[`🫥`,`dotted line face`,`smileys`,`隐形`],[`🫦`,`biting lip`,`smileys`,`咬唇,嘴唇`],[`🫧`,`bubbles`,`smileys`,`泡泡`],[`🫨`,`shaking face`,`smileys`,`摇晃,震动,抖`],[`🫰`,`hand with index finger and thumb crossed`,`people`,`比心,手指,捏`],[`🫱`,`rightwards hand`,`people`,`手,右边,推`],[`🫲`,`leftwards hand`,`people`,`手,左边,推`],[`🫳`,`palm down hand`,`people`,`手,向下,放`],[`🫴`,`palm up hand`,`people`,`手,向上,举`],[`🫵`,`index pointing at the viewer`,`people`,`指,你`],[`🫶`,`heart hands`,`people`,`比心,爱心,手势`],[`🫷`,`leftwards pushing hand`,`people`,`手,推,右边`],[`🫸`,`rightwards pushing hand`,`people`,`手,推,左边`],[`‼`,`double exclamation mark`,`symbols`,``],[`‼️`,`double exclamation mark`,`symbols`,``],[`⁉`,`exclamation question mark`,`symbols`,``],[`⁉️`,`exclamation question mark`,`symbols`,``],[`™`,`trade mark sign`,`symbols`,``],[`™️`,`trade mark sign`,`symbols`,``],[`ℹ`,`information source`,`symbols`,``],[`ℹ️`,`information source`,`symbols`,``],[`↔`,`left right arrow`,`symbols`,``],[`↔️`,`left right arrow`,`symbols`,``],[`↕`,`up down arrow`,`symbols`,``],[`↕️`,`up down arrow`,`symbols`,``],[`↖`,`north west arrow`,`symbols`,``],[`↖️`,`north west arrow`,`symbols`,``],[`↗`,`north east arrow`,`symbols`,``],[`↗️`,`north east arrow`,`symbols`,``],[`↘`,`south east arrow`,`symbols`,``],[`↘️`,`south east arrow`,`symbols`,``],[`↙`,`south west arrow`,`symbols`,``],[`↙️`,`south west arrow`,`symbols`,``],[`↩`,`leftwards arrow with hook`,`symbols`,``],[`↩️`,`leftwards arrow with hook`,`symbols`,``],[`↪`,`rightwards arrow with hook`,`symbols`,``],[`↪️`,`rightwards arrow with hook`,`symbols`,``],[`⌚`,`watch`,`objects`,`手表`],[`⌚️`,`watch`,`objects`,``],[`⌛`,`hourglass`,`objects`,`沙漏,时间,等待`],[`⌛️`,`hourglass`,`objects`,``],[`⌨`,`keyboard`,`symbols`,``],[`⌨️`,`keyboard`,`symbols`,`键盘,打字`],[`⏏`,`eject symbol`,`symbols`,``],[`⏏️`,`eject symbol`,`symbols`,``],[`⏩`,`black right-pointing double triangle`,`objects`,``],[`⏪`,`black left-pointing double triangle`,`objects`,``],[`⏫`,`black up-pointing double triangle`,`objects`,``],[`⏬`,`black down-pointing double triangle`,`objects`,``],[`⏭`,`black right-pointing double triangle with vertical bar`,`objects`,``],[`⏭️`,`black right-pointing double triangle with vertical bar`,`objects`,``],[`⏮`,`black left-pointing double triangle with vertical bar`,`objects`,``],[`⏮️`,`black left-pointing double triangle with vertical bar`,`objects`,``],[`⏯`,`black right-pointing triangle with double vertical bar`,`objects`,``],[`⏯️`,`black right-pointing triangle with double vertical bar`,`objects`,``],[`⏰`,`alarm clock`,`objects`,`闹钟,时间,起床`],[`⏱`,`stopwatch`,`objects`,``],[`⏱️`,`stopwatch`,`objects`,`秒表`],[`⏲`,`timer clock`,`objects`,``],[`⏲️`,`timer clock`,`objects`,`计时器`],[`⏳`,`hourglass with flowing sand`,`objects`,`沙漏`],[`⏸`,`double vertical bar`,`symbols`,``],[`⏸️`,`double vertical bar`,`symbols`,``],[`⏹`,`black square for stop`,`symbols`,``],[`⏹️`,`black square for stop`,`symbols`,``],[`⏺`,`black circle for record`,`symbols`,``],[`⏺️`,`black circle for record`,`symbols`,``],[`Ⓜ`,`circled latin capital letter m`,`symbols`,``],[`Ⓜ️`,`circled latin capital letter m`,`symbols`,``],[`▪`,`black small square`,`symbols`,``],[`▪️`,`black small square`,`symbols`,``],[`▫`,`white small square`,`symbols`,``],[`▫️`,`white small square`,`symbols`,``],[`▶`,`black right-pointing triangle`,`symbols`,``],[`▶️`,`black right-pointing triangle`,`symbols`,``],[`◀`,`black left-pointing triangle`,`symbols`,``],[`◀️`,`black left-pointing triangle`,`symbols`,``],[`◻`,`white medium square`,`symbols`,``],[`◻️`,`white medium square`,`symbols`,``],[`◼`,`black medium square`,`symbols`,``],[`◼️`,`black medium square`,`symbols`,``],[`◽`,`white medium small square`,`symbols`,``],[`◾`,`black medium small square`,`symbols`,``],[`◾️`,`black medium small square`,`symbols`,``],[`☀`,`black sun with rays`,`symbols`,``],[`☀️`,`black sun with rays`,`symbols`,`太阳,晴天,阳光`],[`☁`,`cloud`,`symbols`,``],[`☁️`,`cloud`,`symbols`,`云,多云,天气`],[`☂`,`umbrella`,`symbols`,``],[`☂️`,`umbrella`,`symbols`,``],[`☃`,`snowman`,`symbols`,``],[`☃️`,`snowman`,`symbols`,`雪人,冬天,雪`],[`☄`,`comet`,`symbols`,``],[`☄️`,`comet`,`symbols`,``],[`☎`,`black telephone`,`symbols`,``],[`☎️`,`black telephone`,`symbols`,`电话`],[`☑`,`ballot box with check`,`symbols`,``],[`☑️`,`ballot box with check`,`symbols`,``],[`☔`,`umbrella with rain drops`,`symbols`,``],[`☔️`,`umbrella with rain drops`,`symbols`,``],[`☕`,`hot beverage`,`food`,`咖啡,热饮`],[`☕️`,`hot beverage`,`food`,``],[`☘`,`shamrock`,`symbols`,``],[`☘️`,`shamrock`,`symbols`,``],[`☝`,`white up pointing index`,`symbols`,``],[`☝️`,`white up pointing index`,`symbols`,`指,上面,向上`],[`☠`,`skull and crossbones`,`symbols`,``],[`☠️`,`skull and crossbones`,`symbols`,`骷髅,死亡,危险`],[`☢`,`radioactive sign`,`symbols`,``],[`☢️`,`radioactive sign`,`symbols`,``],[`☣`,`biohazard sign`,`symbols`,``],[`☣️`,`biohazard sign`,`symbols`,``],[`☦`,`orthodox cross`,`symbols`,``],[`☦️`,`orthodox cross`,`symbols`,``],[`☪`,`star and crescent`,`symbols`,``],[`☪️`,`star and crescent`,`symbols`,``],[`☮`,`peace symbol`,`symbols`,``],[`☮️`,`peace symbol`,`symbols`,``],[`☯`,`yin yang`,`symbols`,``],[`☯️`,`yin yang`,`symbols`,``],[`☸`,`wheel of dharma`,`symbols`,``],[`☸️`,`wheel of dharma`,`symbols`,``],[`☹`,`white frowning face`,`smileys`,``],[`☹️`,`white frowning face`,`smileys`,``],[`☺`,`white smiling face`,`smileys`,``],[`☺️`,`white smiling face`,`smileys`,``],[`♀`,`female sign`,`symbols`,``],[`♀️`,`female sign`,`symbols`,``],[`♂`,`male sign`,`symbols`,``],[`♂️`,`male sign`,`symbols`,``],[`♈`,`aries`,`symbols`,``],[`♈️`,`aries`,`symbols`,``],[`♉`,`taurus`,`symbols`,``],[`♉️`,`taurus`,`symbols`,``],[`♊`,`gemini`,`symbols`,``],[`♊️`,`gemini`,`symbols`,``],[`♋`,`cancer`,`symbols`,``],[`♋️`,`cancer`,`symbols`,``],[`♌`,`leo`,`symbols`,``],[`♌️`,`leo`,`symbols`,``],[`♍`,`virgo`,`symbols`,``],[`♍️`,`virgo`,`symbols`,``],[`♎`,`libra`,`symbols`,``],[`♎️`,`libra`,`symbols`,``],[`♏`,`scorpius`,`symbols`,``],[`♏️`,`scorpius`,`symbols`,``],[`♐`,`sagittarius`,`symbols`,``],[`♐️`,`sagittarius`,`symbols`,``],[`♑`,`capricorn`,`symbols`,``],[`♑️`,`capricorn`,`symbols`,``],[`♒`,`aquarius`,`symbols`,``],[`♒️`,`aquarius`,`symbols`,``],[`♓`,`pisces`,`symbols`,``],[`♓️`,`pisces`,`symbols`,``],[`♟`,`black chess pawn`,`symbols`,``],[`♟️`,`black chess pawn`,`symbols`,`棋子,国际象棋,象棋`],[`♠`,`black spade suit`,`symbols`,``],[`♠️`,`black spade suit`,`symbols`,``],[`♣`,`black club suit`,`symbols`,``],[`♣️`,`black club suit`,`symbols`,``],[`♥`,`black heart suit`,`symbols`,``],[`♥️`,`black heart suit`,`symbols`,``],[`♦`,`black diamond suit`,`symbols`,``],[`♦️`,`black diamond suit`,`symbols`,``],[`♨`,`hot springs`,`symbols`,``],[`♨️`,`hot springs`,`symbols`,`温泉,热泉`],[`♻`,`black universal recycling symbol`,`symbols`,``],[`♻️`,`black universal recycling symbol`,`symbols`,``],[`♾`,`permanent paper sign`,`symbols`,``],[`♾️`,`permanent paper sign`,`symbols`,``],[`♿`,`wheelchair symbol`,`symbols`,``],[`♿️`,`wheelchair symbol`,`symbols`,``],[`⚒`,`hammer and pick`,`symbols`,``],[`⚒️`,`hammer and pick`,`symbols`,`锤子,工具`],[`⚓`,`anchor`,`symbols`,`锚,航海,停泊`],[`⚔`,`crossed swords`,`symbols`,``],[`⚔️`,`crossed swords`,`symbols`,`剑,交叉,战斗`],[`⚕`,`staff of aesculapius`,`symbols`,``],[`⚕️`,`staff of aesculapius`,`symbols`,``],[`⚖`,`scales`,`symbols`,``],[`⚖️`,`scales`,`symbols`,``],[`⚗`,`alembic`,`symbols`,``],[`⚗️`,`alembic`,`symbols`,``],[`⚙`,`gear`,`symbols`,``],[`⚙️`,`gear`,`symbols`,``],[`⚛`,`atom symbol`,`symbols`,``],[`⚛️`,`atom symbol`,`symbols`,``],[`⚜`,`fleur-de-lis`,`symbols`,``],[`⚜️`,`fleur-de-lis`,`symbols`,``],[`⚠`,`warning sign`,`symbols`,``],[`⚠️`,`warning sign`,`symbols`,``],[`⚡`,`high voltage sign`,`symbols`,``],[`⚧`,`male with stroke and male and female sign`,`symbols`,``],[`⚧️`,`male with stroke and male and female sign`,`symbols`,``],[`⚪`,`medium white circle`,`symbols`,``],[`⚪️`,`medium white circle`,`symbols`,``],[`⚫`,`medium black circle`,`symbols`,``],[`⚰`,`coffin`,`symbols`,``],[`⚰️`,`coffin`,`symbols`,`棺材,死亡`],[`⚱`,`funeral urn`,`symbols`,``],[`⚱️`,`funeral urn`,`symbols`,`骨灰盒,死亡`],[`⚽`,`soccer ball`,`activity`,`足球,球`],[`⚽️`,`soccer ball`,`activity`,``],[`⚾`,`baseball`,`activity`,`棒球,球`],[`⚾️`,`baseball`,`activity`,``],[`⛄`,`snowman without snow`,`symbols`,`雪人,冬天`],[`⛄️`,`snowman without snow`,`symbols`,``],[`⛅`,`sun behind cloud`,`symbols`,`太阳,云,多云`],[`⛈`,`thunder cloud and rain`,`symbols`,``],[`⛈️`,`thunder cloud and rain`,`symbols`,`雷雨,雷暴,天气`],[`⛎`,`ophiuchus`,`symbols`,``],[`⛏`,`pick`,`symbols`,``],[`⛏️`,`pick`,`symbols`,`镐,工具`],[`⛑`,`helmet with white cross`,`symbols`,``],[`⛑️`,`helmet with white cross`,`symbols`,`头盔,救援,安全`],[`⛓`,`chains`,`symbols`,``],[`⛓️`,`chains`,`symbols`,``],[`⛔`,`no entry`,`symbols`,``],[`⛩`,`shinto shrine`,`travel`,``],[`⛩️`,`shinto shrine`,`travel`,`鸟居,神社,日本`],[`⛪`,`church`,`travel`,`教堂`],[`⛰`,`mountain`,`travel`,``],[`⛰️`,`mountain`,`travel`,`山,山峰`],[`⛱`,`umbrella on ground`,`travel`,``],[`⛱️`,`umbrella on ground`,`travel`,``],[`⛲`,`fountain`,`travel`,`喷泉`],[`⛲️`,`fountain`,`travel`,``],[`⛳`,`flag in hole`,`activity`,`高尔夫,高尔夫球,球洞`],[`⛳️`,`flag in hole`,`activity`,``],[`⛴`,`ferry`,`travel`,``],[`⛴️`,`ferry`,`travel`,`渡轮,船`],[`⛵`,`sailboat`,`travel`,`帆船,船`],[`⛵️`,`sailboat`,`travel`,``],[`⛷`,`skier`,`activity`,``],[`⛷️`,`skier`,`activity`,``],[`⛸`,`ice skate`,`activity`,``],[`⛸️`,`ice skate`,`activity`,`溜冰,冰刀,滑冰`],[`⛹`,`person with ball`,`activity`,``],[`⛹️`,`person with ball`,`activity`,``],[`⛺`,`tent`,`travel`,`帐篷,露营`],[`⛺️`,`tent`,`travel`,``],[`⛽`,`fuel pump`,`travel`,`加油站,加油,汽油`],[`✂`,`black scissors`,`symbols`,``],[`✂️`,`black scissors`,`symbols`,``],[`✅`,`white heavy check mark`,`symbols`,``],[`✈`,`airplane`,`travel`,``],[`✈️`,`airplane`,`travel`,`飞机,航班,起飞`],[`✉`,`envelope`,`symbols`,``],[`✉️`,`envelope`,`symbols`,`信封,邮件,信`],[`✊`,`raised fist`,`people`,`拳头,加油,力量`],[`✋`,`raised hand`,`people`,`手,举手,停`],[`✌`,`victory hand`,`symbols`,``],[`✌️`,`victory hand`,`symbols`,`胜利,耶,剪刀手`],[`✍`,`writing hand`,`symbols`,``],[`✍️`,`writing hand`,`symbols`,`写字,写作,手`],[`✏`,`pencil`,`symbols`,``],[`✏️`,`pencil`,`symbols`,``],[`✒`,`black nib`,`symbols`,``],[`✒️`,`black nib`,`symbols`,``],[`✔`,`heavy check mark`,`symbols`,``],[`✔️`,`heavy check mark`,`symbols`,``],[`✖`,`heavy multiplication x`,`symbols`,``],[`✖️`,`heavy multiplication x`,`symbols`,``],[`✝`,`latin cross`,`symbols`,``],[`✝️`,`latin cross`,`symbols`,``],[`✡`,`star of david`,`symbols`,``],[`✡️`,`star of david`,`symbols`,``],[`✨`,`sparkles`,`symbols`,`星星,闪光,发光`],[`✳`,`eight spoked asterisk`,`symbols`,``],[`✳️`,`eight spoked asterisk`,`symbols`,``],[`✴`,`eight pointed black star`,`symbols`,``],[`✴️`,`eight pointed black star`,`symbols`,``],[`❄`,`snowflake`,`symbols`,``],[`❄️`,`snowflake`,`symbols`,`雪花,雪,冬天,冷`],[`❇`,`sparkle`,`symbols`,``],[`❇️`,`sparkle`,`symbols`,``],[`❌`,`cross mark`,`symbols`,``],[`❎`,`negative squared cross mark`,`symbols`,``],[`❓`,`black question mark ornament`,`symbols`,``],[`❔`,`white question mark ornament`,`symbols`,``],[`❕`,`white exclamation mark ornament`,`symbols`,``],[`❗`,`heavy exclamation mark symbol`,`symbols`,``],[`❗️`,`heavy exclamation mark symbol`,`symbols`,``],[`❣`,`heavy heart exclamation mark ornament`,`symbols`,``],[`❣️`,`heavy heart exclamation mark ornament`,`symbols`,`爱心,感叹号`],[`❤`,`heavy black heart`,`smileys`,``],[`❤️`,`heavy black heart`,`smileys`,`爱心,红心,爱`],[`➕`,`heavy plus sign`,`symbols`,``],[`➖`,`heavy minus sign`,`symbols`,``],[`➗`,`heavy division sign`,`symbols`,``],[`➡`,`black rightwards arrow`,`symbols`,``],[`➡️`,`black rightwards arrow`,`symbols`,``],[`➰`,`curly loop`,`symbols`,``],[`➿`,`double curly loop`,`symbols`,``],[`⬅`,`leftwards black arrow`,`symbols`,``],[`⬅️`,`leftwards black arrow`,`symbols`,``],[`⬆`,`upwards black arrow`,`symbols`,``],[`⬆️`,`upwards black arrow`,`symbols`,``],[`⬇`,`downwards black arrow`,`symbols`,``],[`⬇️`,`downwards black arrow`,`symbols`,``],[`⬛`,`black large square`,`symbols`,``],[`⬛️`,`black large square`,`symbols`,``],[`⬜`,`white large square`,`symbols`,``],[`⬜️`,`white large square`,`symbols`,``],[`⭐`,`white medium star`,`symbols`,`星星,五星,评分`],[`⭕`,`heavy large circle`,`symbols`,``],[`⭕️`,`heavy large circle`,`symbols`,``],[`⤴`,`arrow pointing rightwards then curving upwards`,`symbols`,``],[`⤴️`,`arrow pointing rightwards then curving upwards`,`symbols`,``],[`⤵`,`arrow pointing rightwards then curving downwards`,`symbols`,``],[`⤵️`,`arrow pointing rightwards then curving downwards`,`symbols`,``],[`〰`,`wavy dash`,`symbols`,``],[`〰️`,`wavy dash`,`symbols`,``],[`〽`,`part alternation mark`,`symbols`,``],[`〽️`,`part alternation mark`,`symbols`,``],[`㊗`,`circled ideograph congratulation`,`symbols`,``],[`㊗️`,`circled ideograph congratulation`,`symbols`,``],[`㊙`,`circled ideograph secret`,`symbols`,``],[`㊙️`,`circled ideograph secret`,`symbols`,``],[`©`,`copyright sign`,`symbols`,``],[`©️`,`copyright sign`,`symbols`,``],[`®`,`registered sign`,`symbols`,``],[`®️`,`registered sign`,`symbols`,``],[`👨💻`,`man technologist`,`people`,`程序员,开发者,工程师,码农`],[`👩💻`,`woman technologist`,`people`,`程序员,开发者,工程师`],[`🧑💻`,`technologist`,`people`,`程序员,开发者,工程师`],[`👨🔧`,`man mechanic`,`people`,``],[`👩🔧`,`woman mechanic`,`people`,``],[`👨🎨`,`man artist`,`people`,``],[`👩🎨`,`woman artist`,`people`,``],[`👨🚀`,`man astronaut`,`people`,``],[`👩🚀`,`woman astronaut`,`people`,``],[`👨⚕️`,`man health worker`,`people`,``],[`👩⚕️`,`woman health worker`,`people`,``],[`👨🏫`,`man teacher`,`people`,``],[`👩🏫`,`woman teacher`,`people`,``],[`👨🍳`,`man cook`,`people`,``],[`👩🍳`,`woman cook`,`people`,``],[`👨🌾`,`man farmer`,`people`,``],[`👩🌾`,`woman farmer`,`people`,``],[`👩🏭`,`woman factory worker`,`people`,``],[`👨🎓`,`man student`,`people`,``],[`👩🎓`,`woman student`,`people`,``],[`👨🚒`,`man firefighter`,`people`,``],[`👩🚒`,`woman firefighter`,`people`,``],[`👨⚖️`,`man judge`,`people`,``],[`👩⚖️`,`woman judge`,`people`,``],[`👨💼`,`man office worker`,`people`,``],[`👩💼`,`woman office worker`,`people`,``],[`👨🎤`,`man singer`,`people`,``],[`👩🎤`,`woman singer`,`people`,``],[`👨🦰`,`man red hair`,`people`,``],[`👩🦰`,`woman red hair`,`people`,``],[`👨🦱`,`man curly hair`,`people`,``],[`👩🦱`,`woman curly hair`,`people`,``],[`👩🦲`,`woman bald`,`people`,``],[`👨🦳`,`man white hair`,`people`,``],[`👩🦳`,`woman white hair`,`people`,``],[`👩❤️👨`,`couple with heart`,`people`,``],[`👨❤️👨`,`couple with heart`,`people`,``],[`👩❤️👩`,`couple with heart`,`people`,``],[`👨👩👧`,`family man woman girl`,`people`,``],[`👨👩👦`,`family man woman boy`,`people`,``],[`👨👩👧👦`,`family man woman girl boy`,`people`,``],[`👨👩👦👦`,`man`,`people`,``],[`👨👩👧👧`,`family man woman girl girl`,`people`,``],[`👩👩👧`,`family woman woman girl`,`people`,``],[`👨👨👧`,`family man man girl`,`people`,``],[`👨👦`,`family man boy`,`people`,``],[`👩👧`,`family woman girl`,`people`,``],[`👨👧👦`,`family man girl boy`,`people`,``],[`👩❤️💋👨`,`kiss woman man`,`people`,``],[`🧑🤝🧑`,`people holding hands`,`people`,``],[`❤️🔥`,`heart on fire`,`smileys`,``],[`🧑🚒`,`firefighter`,`people`,`消防员`],[`🧑🏭`,`factory worker`,`people`,``],[`🧑🎓`,`student`,`people`,`学生,毕业生,大学生`],[`🧑🏫`,`teacher`,`people`,`老师,教师,教授`],[`🧑🎤`,`singer`,`people`,`歌手,歌星`],[`🧑⚕️`,`health worker`,`people`,`医生,医疗`],[`🧑⚖️`,`judge`,`people`,`法官,审判`],[`🧑🍳`,`cook`,`people`,`厨师,大厨`],[`🧑🌾`,`farmer`,`people`,`农民,农夫`],[`🧑🎨`,`artist`,`people`,`画家,艺术家`],[`🧑🔬`,`scientist`,`people`,``],[`🧑🔧`,`mechanic`,`people`,`技工,维修工`],[`🧑💼`,`office worker`,`people`,`白领,上班族,职员`],[`🧑🚀`,`astronaut`,`people`,`宇航员,太空人`],[`🏃♂️`,`man running`,`activity`,``],[`🏃♀️`,`woman running`,`activity`,``],[`🚶♂️`,`man walking`,`travel`,``],[`🚶♀️`,`woman walking`,`travel`,``],[`🧎♂️`,`man kneeling`,`symbols`,``],[`🧎♀️`,`woman kneeling`,`symbols`,``],[`🏋️♂️`,`man lifting weights`,`activity`,``],[`🏋️♀️`,`woman lifting weights`,`activity`,``],[`🤸♂️`,`man cartwheeling`,`people`,``],[`🤸♀️`,`woman cartwheeling`,`people`,``],[`⛹️♂️`,`man bouncing ball`,`activity`,``],[`⛹️♀️`,`woman bouncing ball`,`activity`,``],[`🤾♂️`,`man playing handball`,`activity`,``],[`🤾♀️`,`woman playing handball`,`activity`,``],[`🧘♀️`,`woman in lotus position`,`people`,``],[`🏄♂️`,`man surfing`,`activity`,``],[`🏄♀️`,`woman surfing`,`activity`,``],[`🏊♂️`,`man swimming`,`activity`,``],[`🏊♀️`,`woman swimming`,`activity`,``],[`🚴♂️`,`man biking`,`travel`,``],[`🚴♀️`,`woman biking`,`travel`,``],[`🚵♂️`,`man mountain biking`,`travel`,``],[`🚵♀️`,`woman mountain biking`,`travel`,``],[`👯♂️`,`men with bunny ears`,`people`,``],[`👯♀️`,`women with bunny ears`,`people`,``],[`🧖♂️`,`man in steamy room`,`people`,``],[`🧖♀️`,`woman in steamy room`,`people`,``],[`🧗♂️`,`man climbing`,`people`,``],[`🧗♀️`,`woman climbing`,`people`,``],[`🤦♂️`,`man facepalming`,`smileys`,``],[`🤦♀️`,`woman facepalming`,`smileys`,``],[`🤷♂️`,`man shrugging`,`people`,``],[`🤷♀️`,`woman shrugging`,`people`,``],[`🙍♂️`,`person frowning`,`smileys`,``],[`🙍♀️`,`woman frowning`,`smileys`,``],[`🙎♂️`,`man pouting`,`smileys`,``],[`🙎♀️`,`woman pouting`,`smileys`,``],[`🙅♂️`,`man gesturing no`,`smileys`,``],[`🙅♀️`,`woman gesturing no`,`smileys`,``],[`🙆♂️`,`man gesturing ok`,`smileys`,``],[`🙆♀️`,`woman gesturing ok`,`smileys`,``],[`💁♂️`,`man tipping hand`,`people`,``],[`💁♀️`,`woman tipping hand`,`people`,``],[`🙋♂️`,`man raising hand`,`smileys`,``],[`🙋♀️`,`woman raising hand`,`smileys`,``],[`🙇♂️`,`man bowing`,`smileys`,``],[`🙇♀️`,`woman bowing`,`smileys`,``],[`💆♂️`,`man getting massage`,`people`,``],[`💆♀️`,`woman getting massage`,`people`,``],[`💇♂️`,`man getting haircut`,`people`,``],[`💇♀️`,`woman getting haircut`,`people`,``],[`🧞♂️`,`man genie`,`people`,``],[`🧞♀️`,`woman genie`,`people`,``],[`🧟♂️`,`man zombie`,`people`,``],[`🧟♀️`,`woman zombie`,`people`,``],[`🧜♂️`,`merman`,`people`,``],[`🧚♂️`,`man fairy`,`people`,``],[`🧚♀️`,`woman fairy`,`people`,``],[`🧛♂️`,`man vampire`,`people`,``],[`🧛♀️`,`woman vampire`,`people`,``],[`🧙♂️`,`man mage`,`people`,``],[`🧙♀️`,`mage`,`people`,``],[`🧝♂️`,`man elf`,`people`,``],[`🧝♀️`,`woman elf`,`people`,``],[`🦸♂️`,`man superhero`,`people`,``],[`🦸♀️`,`woman superhero`,`people`,``],[`🦹♂️`,`man supervillain`,`people`,``],[`🦹♀️`,`woman supervillain`,`people`,``],[`0️⃣`,`keycap 0`,`symbols`,``],[`1️⃣`,`keycap 1`,`symbols`,``],[`2️⃣`,`keycap 2`,`symbols`,``],[`3️⃣`,`keycap 3`,`symbols`,``],[`4️⃣`,`keycap 4`,`symbols`,``],[`5️⃣`,`keycap 5`,`symbols`,``],[`6️⃣`,`keycap 6`,`symbols`,``],[`7️⃣`,`keycap 7`,`symbols`,``],[`8️⃣`,`keycap 8`,`symbols`,``],[`9️⃣`,`keycap 9`,`symbols`,``],[`#️⃣`,`keycap #`,`symbols`,``],[`*️⃣`,`keycap *`,`symbols`,``],[`🇨🇳`,`flag china`,`flags`,`中国,国旗,五星红旗`],[`🇺🇸`,`flag united states`,`flags`,`美国,国旗,USA`],[`🇬🇧`,`flag united kingdom`,`flags`,`英国,国旗,UK`],[`🇯🇵`,`flag japan`,`flags`,`日本,国旗`],[`🇫🇷`,`flag france`,`flags`,`法国,国旗`],[`🇩🇪`,`flag germany`,`flags`,`德国,国旗`],[`🇮🇹`,`flag italy`,`flags`,`意大利,国旗`],[`🇪🇸`,`flag spain`,`flags`,`西班牙,国旗`],[`🇷🇺`,`flag russia`,`flags`,`俄罗斯,国旗`],[`🇮🇳`,`regional indicator symbol letter i`,`flags`,`印度,国旗`],[`🇧🇷`,`flag brazil`,`flags`,`巴西,国旗`],[`🇨🇦`,`flag canada`,`flags`,`加拿大,国旗`],[`🇦🇺`,`flag australia`,`flags`,`澳大利亚,国旗`],[`🇸🇬`,`flag singapore`,`flags`,`新加坡,国旗`],[`🇭🇰`,`flag hong kong`,`flags`,`香港,国旗,区旗`],[`🇹🇼`,`flag taiwan`,`flags`,`台湾,国旗`],[`🇲🇴`,`flag macau`,`flags`,`澳门,国旗`],[`🇻🇳`,`flag vietnam`,`flags`,`越南,国旗`],[`🇲🇾`,`regional indicator symbol letter m`,`flags`,`马来西亚,国旗`],[`🇮🇩`,`flag indonesia`,`flags`,`印尼,国旗`],[`🇵🇭`,`flag philippines`,`flags`,`菲律宾,国旗`],[`🇹🇷`,`flag turkey`,`flags`,`土耳其,国旗`],[`🇸🇦`,`flag saudi arabia`,`flags`,`沙特,国旗`],[`🇦🇪`,`flag united arab emirates`,`flags`,`阿联酋,国旗`],[`🇳🇱`,`flag netherlands`,`flags`,`荷兰,国旗`],[`🇸🇪`,`flag sweden`,`flags`,`瑞典,国旗`],[`🇨🇭`,`flag switzerland`,`flags`,`瑞士,国旗`],[`🇦🇹`,`flag austria`,`flags`,`奥地利,国旗`],[`🇧🇪`,`flag belgium`,`flags`,`比利时,国旗`],[`🇵🇹`,`flag portugal`,`flags`,`葡萄牙,国旗`],[`🇬🇷`,`flag greece`,`flags`,`希腊,国旗`],[`🇳🇴`,`flag norway`,`flags`,`挪威,国旗`],[`🇩🇰`,`flag denmark`,`flags`,`丹麦,国旗`],[`🇫🇮`,`flag finland`,`flags`,`芬兰,国旗`],[`🇵🇱`,`flag poland`,`flags`,`波兰,国旗`],[`🇺🇦`,`flag ukraine`,`flags`,`乌克兰,国旗`],[`🇮🇱`,`flag israel`,`flags`,`以色列,国旗`],[`🇪🇬`,`flag egypt`,`flags`,`埃及,国旗`],[`🇿🇦`,`flag south africa`,`flags`,`南非,国旗`],[`🇳🇬`,`flag nigeria`,`flags`,`尼日利亚,国旗`],[`🇲🇽`,`flag mexico`,`flags`,`墨西哥,国旗`],[`🇦🇷`,`flag argentina`,`flags`,``],[`🇨🇱`,`flag chile`,`flags`,`智利,国旗`],[`🇰🇿`,`flag kazakhstan`,`flags`,`哈萨克斯坦,国旗`],[`🇺🇿`,`flag uzbekistan`,`flags`,`乌兹别克斯坦,国旗`],[`🇳🇿`,`flag new zealand`,`flags`,`新西兰,国旗`],[`🇮🇪`,`flag ireland`,`flags`,`爱尔兰,国旗`],[`🇨🇿`,`flag czechia`,`flags`,`捷克,国旗`],[`👍🏻`,`thumbs up light skin`,`people`,``],[`👍🏽`,`thumbs up sign`,`people`,``],[`👍🏾`,`thumbs up medium dark skin`,`people`,``],[`👍🏿`,`thumbs up dark skin`,`people`,``],[`👏🏻`,`clapping hands light skin`,`people`,``],[`👏🏼`,`clapping hands medium light skin`,`people`,``],[`👏🏽`,`clapping hands medium skin`,`people`,``],[`👏🏾`,`clapping hands medium dark skin`,`people`,``],[`👏🏿`,`clapping hands dark skin`,`people`,``],[`🙏🏻`,`folded hands light skin`,`smileys`,``],[`🙏🏼`,`folded hands medium light skin`,`smileys`,``],[`🙏🏽`,`folded hands medium skin`,`smileys`,``],[`🙏🏾`,`folded hands medium dark skin`,`smileys`,``],[`🙏🏿`,`folded hands dark skin`,`smileys`,``],[`🏳️🌈`,`rainbow flag`,`flags`,``],[`🏴☠️`,`pirate flag`,`flags`,`海盗旗,海盗`]];n(`zh`,{agentMgr:{allTools:`全部`,defaultAgentName:`默认助手`,defaultAgentDesc:`全能 AI 助手,拥有所有工具能力`,switchedTo:`已切换到:{name}`,editAgent:`编辑助手`,templateLoaded:`已加载模板:{name}`,noSkillsHint:`暂无启用技能(请先确认 Agent 已连接且技能开关已开启)`,nameRequired:`请输入助手名称`,agentUpdated:`助手已更新`,agentCreated:`助手 "{name}" 已创建`,saveFailed:`保存失败:{message}`,confirmDeleteAgentMessage:`确定要删除助手 "{name}" 吗?
|
|
2073
2073
|
正在使用该助手的会话将恢复为默认助手。`,deleteAgentTitle:`删除助手`,agentDeleted:`助手已删除`,deleteFailed:`删除失败:{message}`,cannotDeleteDefault:`默认助手不支持删除`,emojiCatSmileys:`笑脸与表情`,emojiCatPeople:`人物与身体`,emojiCatAnimals:`动物与自然`,emojiCatFood:`食物与饮品`,emojiCatTravel:`旅行与交通`,emojiCatActivity:`活动与运动`,emojiCatObjects:`物品`,emojiCatSymbols:`符号`,emojiCatFlags:`旗帜`,emojiSearchPlaceholder:`搜索 Emoji(英文名 / 中文关键词)`,emojiSearchClear:`清空搜索`,emojiNoMatch:`未找到匹配的 Emoji`,confirm:`确认`},agentTemplates:{codeReviewName:`代码审查专家`,codeReviewDesc:`专注于代码审查和质量保证`,webAutomationName:`网页自动化助手`,webAutomationDesc:`专注于网页交互和自动化`,dataAnalystName:`数据分析师`,dataAnalystDesc:`专注于数据提取、分析和可视化`,documentationName:`文档助手`,documentationDesc:`专注于技术文档和内容整理`}}),n(`en`,{agentMgr:{allTools:`All`,defaultAgentName:`Default Assistant`,defaultAgentDesc:`All-purpose AI assistant with all tool capabilities`,switchedTo:`Switched to: {name}`,editAgent:`Edit assistant`,templateLoaded:`Template loaded: {name}`,noSkillsHint:`No enabled skills (please confirm Agent is connected and skill switch is on)`,nameRequired:`Please enter assistant name`,agentUpdated:`Assistant updated`,agentCreated:`Assistant "{name}" created`,saveFailed:`Save failed: {message}`,confirmDeleteAgentMessage:`Are you sure you want to delete assistant "{name}"?
|
|
2074
|
-
Sessions using this assistant will revert to the default assistant.`,deleteAgentTitle:`Delete assistant`,agentDeleted:`Assistant deleted`,deleteFailed:`Delete failed: {message}`,cannotDeleteDefault:`Default assistant cannot be deleted`,emojiCatSmileys:`Smileys & Emotion`,emojiCatPeople:`People & Body`,emojiCatAnimals:`Animals & Nature`,emojiCatFood:`Food & Drink`,emojiCatTravel:`Travel & Places`,emojiCatActivity:`Activities`,emojiCatObjects:`Objects`,emojiCatSymbols:`Symbols`,emojiCatFlags:`Flags`,emojiSearchPlaceholder:`Search emoji (name / keyword)`,emojiSearchClear:`Clear search`,emojiNoMatch:`No matching emoji`,confirm:`Confirm`},agentTemplates:{codeReviewName:`Code Review Expert`,codeReviewDesc:`Focused on code review and quality assurance`,webAutomationName:`Web Automation Assistant`,webAutomationDesc:`Focused on web interaction and automation`,dataAnalystName:`Data Analyst`,dataAnalystDesc:`Focused on data extraction, analysis, and visualization`,documentationName:`Documentation Assistant`,documentationDesc:`Focused on technical documentation and content organization`}});async function
|
|
2074
|
+
Sessions using this assistant will revert to the default assistant.`,deleteAgentTitle:`Delete assistant`,agentDeleted:`Assistant deleted`,deleteFailed:`Delete failed: {message}`,cannotDeleteDefault:`Default assistant cannot be deleted`,emojiCatSmileys:`Smileys & Emotion`,emojiCatPeople:`People & Body`,emojiCatAnimals:`Animals & Nature`,emojiCatFood:`Food & Drink`,emojiCatTravel:`Travel & Places`,emojiCatActivity:`Activities`,emojiCatObjects:`Objects`,emojiCatSymbols:`Symbols`,emojiCatFlags:`Flags`,emojiSearchPlaceholder:`Search emoji (name / keyword)`,emojiSearchClear:`Clear search`,emojiNoMatch:`No matching emoji`,confirm:`Confirm`},agentTemplates:{codeReviewName:`Code Review Expert`,codeReviewDesc:`Focused on code review and quality assurance`,webAutomationName:`Web Automation Assistant`,webAutomationDesc:`Focused on web interaction and automation`,dataAnalystName:`Data Analyst`,dataAnalystDesc:`Focused on data extraction, analysis, and visualization`,documentationName:`Documentation Assistant`,documentationDesc:`Focused on technical documentation and content organization`}});async function WT(){await GT(),await KT(),YT(),ZT(),i.debug(`[AgentMgr] Agent managerinitialization complete, activeAgentId:`,C.activeAgentId)}async function GT(){let[e,t]=await Promise.all([mt(),gt()]);C.activeSessionId||(C.activeAgentId=e),C.customAgents=t.filter(e=>!e.isBuiltin);let n=C.activeAgentId||e,r=t.find(e=>e.id===n||!n&&e.id==="default");C.activeAgentToolIds=r?r.toolIds:null,i.debug(`[AgentMgr] Agent state loaded, activeAgentId:`,C.activeAgentId,`total:`,t.length,`toolIds:`,C.activeAgentToolIds)}async function KT(){let e=document.getElementById(`agentListItems`),t=document.getElementById(`agentDropdownFooter`);if(!e)return;let n=await gt(),i=C.activeAgentId,a=``;for(let e of n){let t=e.id===i||!i&&e.id==="default",n=e.toolIds?e.toolIds.length:r(`agentMgr.allTools`),o=e.id==="default"?r(`agentMgr.defaultAgentName`):e.name,s=e.id==="default"?r(`agentMgr.defaultAgentDesc`):e.description||r(`agentConfig.toolCount`,{count:n});a+=`
|
|
2075
2075
|
<div class="agent-item ${t?`active`:``} ${e.isBuiltin?``:`is-editable`}" data-agent-id="${$(e.id)}">
|
|
2076
|
-
<span class="agent-item-icon">${
|
|
2076
|
+
<span class="agent-item-icon">${NE(e.icon)}</span>
|
|
2077
2077
|
<div class="agent-item-info">
|
|
2078
|
-
<span class="agent-item-name">${
|
|
2079
|
-
<span class="agent-item-desc" title="${$(s)}">${
|
|
2078
|
+
<span class="agent-item-name">${NE(o)}</span>
|
|
2079
|
+
<span class="agent-item-desc" title="${$(s)}">${NE(s)}</span>
|
|
2080
2080
|
</div>
|
|
2081
2081
|
<div class="agent-item-actions">
|
|
2082
2082
|
${e.isBuiltin?``:`<button class="agent-item-edit" data-action="edit" data-agent-id="${$(e.id)}" title="${$(r(`common.edit`))}">✎</button>`}
|
|
@@ -2087,25 +2087,25 @@ Sessions using this assistant will revert to the default assistant.`,deleteAgent
|
|
|
2087
2087
|
<div class="agent-item" id="agentAddBtn" style="color:var(--brand-500);">
|
|
2088
2088
|
<span class="agent-item-icon" style="color:var(--brand-500);">+</span>
|
|
2089
2089
|
<span class="agent-item-name">${r(`agentEditor.createNew`)}</span>
|
|
2090
|
-
</div>`),RT(n,i)}function RT(e,t){let n=document.getElementById(`agentSelectorBtn`),i=document.getElementById(`agentSelectorText`),a=document.getElementById(`agentSelectorEmoji`);if(!n||!i)return;let o=e.find(e=>e.id===t)||e.find(e=>e.id==="default");if(o){let e=o.id==="default"?r(`agentMgr.defaultAgentName`):o.name;i.textContent=`${o.icon} ${e}`,a&&(a.textContent=o.icon),n.title=`${r(`header.switchAgent`)}: ${o.icon} ${e}`}else i.textContent=r(`header.defaultAssistant`),a&&(a.textContent=`🤖`),n.title=r(`header.switchAgent`)}function zT(){let e=document.getElementById(`agentSelectorBtn`),t=document.getElementById(`agentSelectorDropdown`),n=document.getElementById(`agentSelectorWrapper`);if(!e||!t||!n)return;let r=n.getBoundingClientRect(),i=document.body.clientWidth;t.style.left=``,t.style.right=`auto`,t.style.maxWidth=Math.min(320,i-16)+`px`;let a=t.getBoundingClientRect().width,o=Math.min(a,i-16),s=e.getBoundingClientRect(),c=s.left+s.width/2,l=i-o-8,u=Math.max(8,Math.min(l,c-o/2));t.style.left=u-r.left+`px`}function BT(){let e=document.getElementById(`agentSelectorBtn`),t=document.getElementById(`agentSelectorDropdown`);!e||!t||(e.addEventListener(`click`,async e=>{if(e.stopPropagation(),t.style.display===`flex`)t.style.display=`none`;else{t.style.left=``,t.style.right=`auto`,t.style.maxWidth=Math.min(320,document.body.clientWidth-16)+`px`,t.style.display=`flex`,zT();try{await LT()}catch{}zT()}}),document.addEventListener(`click`,()=>{t.style.display=`none`}),t.addEventListener(`click`,async e=>{let n=e.target.closest(`.agent-item`);if(!n)return;let r=e.target.closest(`[data-action]`);if(r&&r.dataset.action===`edit`){e.stopPropagation();let t=r.dataset.agentId;tE(t);return}if(r&&r.dataset.action===`delete`){e.stopPropagation(),await xE(r.dataset.agentId);return}if(n.id===`agentAddBtn`){tE(null);return}let i=n.dataset.agentId;i&&(await VT(i),t.style.display=`none`)}))}async function VT(e){let t=e?await ft(e):null;if(C.activeAgentId=e,C.activeAgentToolIds=t?t.toolIds:null,C.activeAgentMcpExcludedServerIds=t?t.mcpExcludedServerIds??null:null,await vt(e),ni().catch(()=>{}),t&&!t.isBuiltin)t.model&&(C.currentModel=t.model),t.temperature!==null&&t.temperature!==void 0&&(C.temperature=t.temperature,C.topP=t.topP!==null&&t.topP!==void 0?t.topP:1),document.dispatchEvent(new CustomEvent(`agent-model-changed`));else if(!t||t.isBuiltin)try{let e=await chrome.storage.local.get([`modelName`,`temperature`,`topP`]);e.modelName&&(C.currentModel=e.modelName),e.temperature!==void 0&&(C.temperature=e.temperature),e.topP!==void 0&&(C.topP=e.topP),document.dispatchEvent(new CustomEvent(`agent-model-changed`))}catch{}await LT();let n=`agentMcpClosedServers_${e||`default`}`,a=await chrome.storage.local.get([n,`ragTools`,`ragToolsIntroduced`]),o=a.ragTools||[];C.mcpClosedServers=a[n]||[];let s=`agentEnabledTools_${e||`default`}`,c=await chrome.storage.local.get([s,`enabledTools`]),l=!!c[s],u=c[s]||c.enabledTools;if(l||u&&u.length>0){let e=ta(o),t=u.filter(t=>e.has(t));if(l)C.enabledTools=t;else{let e=f.filter(e=>e.enabled&&!t.includes(e.id)).map(e=>e.id);C.enabledTools=[...t,...e]}let n=ea(C.enabledTools,o,a.ragToolsIntroduced);C.enabledTools=n.tools,C.enabledTools.length!==u.length&&chrome.storage.local.set({[s]:C.enabledTools,...n.migrated?{ragToolsIntroduced:!0}:{}})}else{C.enabledTools=f.filter(e=>e.enabled).map(e=>e.id);let e=ea(C.enabledTools,o,a.ragToolsIntroduced);C.enabledTools=e.tools,e.migrated&&chrome.storage.local.set({ragToolsIntroduced:!0,[s]:C.enabledTools})}let d=document.getElementById(`toolsPopupOverlay`);d&&d.classList.contains(`show`)&&(Bi(),Ji(),Yi()),Qi();let p=t&&t.id!=="default"?t.name:r(`agentMgr.defaultAgentName`);F(r(`agentMgr.switchedTo`,{name:p}),`info`,2e3),i.debug(`[AgentMgr] switched Agent:`,e,p)}function HT(){let e=document.getElementById(`agentEditModal`);if(!e)return;e.querySelector(`#agentModalCloseBtn`)?.addEventListener(`click`,nE),e.querySelector(`#agentSaveBtn`)?.addEventListener(`click`,yE),e.querySelector(`#agentDeleteBtn`)?.addEventListener(`click`,bE),e.querySelector(`#agentTemplateSelect`)?.addEventListener(`change`,iE),qT();let t=document.getElementById(`agentToolActions`);t&&t.addEventListener(`click`,e=>{let t=e.target.closest(`button`);if(!t)return;let n=t.dataset.action;n===`selectAll`?JT():n===`deselectAll`?YT():n===`toggleSelectedOnly`&&(aE.selectedOnly=!aE.selectedOnly,sE())});let n=document.getElementById(`agentToolSearchInput`);if(n){let e=null,t=document.getElementById(`agentToolSearchClear`),r=()=>{t&&(t.style.display=n.value?`block`:`none`)};n.addEventListener(`input`,()=>{r(),clearTimeout(e),e=setTimeout(()=>{aE.searchText=n.value,sE()},150)}),t&&t.addEventListener(`click`,()=>{clearTimeout(e),n.value=``,r(),aE.searchText=``,sE(),n.focus()}),r()}let r=document.getElementById(`agentSkillActions`);r&&r.addEventListener(`click`,e=>{let t=e.target.closest(`button`);if(!t)return;let n=t.dataset.action;n===`selectAllSkills`?XT():n===`deselectAllSkills`?ZT():n===`toggleSelectedOnlySkills`&&(dE.selectedOnly=!dE.selectedOnly,pE())});let i=document.getElementById(`agentSkillSearchInput`);if(i){let e=null,t=document.getElementById(`agentSkillSearchClear`),n=()=>{t&&(t.style.display=i.value?`block`:`none`)};i.addEventListener(`input`,()=>{n(),clearTimeout(e),e=setTimeout(()=>{dE.searchText=i.value,pE()},150)}),t&&t.addEventListener(`click`,()=>{clearTimeout(e),i.value=``,n(),dE.searchText=``,pE(),i.focus()}),n()}let a=document.getElementById(`agentToolList`);a&&(a.addEventListener(`click`,e=>{let t=e.target.closest(`.agent-mcp-expand-btn`);if(t){e.preventDefault(),cE(t.dataset.serverId,t);return}let n=e.target.closest(`.agent-mcp-service-item`);if(n&&!e.target.closest(`input[type="checkbox"]`)){e.preventDefault(),cE(n.dataset.mcpServerId,n.querySelector(`.agent-mcp-expand-btn`));return}let r=e.target.closest(`.agent-tool-category-clickable`);r&&QT(r.dataset.category)}),a.addEventListener(`change`,e=>{if(!e.target.matches(`input[type="checkbox"]`))return;let t=aE,n=e.target.dataset.toolId,r=e.target.dataset.mcpServerId;t.inheritMode=!1,n?e.target.checked?t.selectedSet.add(n):t.selectedSet.delete(n):r&&(e.target.checked?t.excludedSet.delete(r):t.excludedSet.add(r)),t.selectedOnly?sE():$T()}));let o=document.getElementById(`agentSkillList`);o&&o.addEventListener(`change`,e=>{if(!e.target.matches(`input[type="checkbox"]`))return;let t=dE;t.inheritMode=!1,e.target.checked?t.selectedSet.add(e.target.value):t.selectedSet.delete(e.target.value),t.selectedOnly&&!e.target.checked?pE():eE()}),document.addEventListener(`click`,e=>{let t=document.getElementById(`emojiPicker`),n=document.getElementById(`agentEditIconBtn`);t&&n&&t.style.display===`block`&&!n.contains(e.target)&&!t.contains(e.target)&&(t.style.display=`none`)})}var UT=[[`smileys`,`emojiCatSmileys`],[`people`,`emojiCatPeople`],[`animals`,`emojiCatAnimals`],[`food`,`emojiCatFood`],[`travel`,`emojiCatTravel`],[`activity`,`emojiCatActivity`],[`objects`,`emojiCatObjects`],[`symbols`,`emojiCatSymbols`],[`flags`,`emojiCatFlags`]];function WT(e,t){return!!(e[1].includes(t)||e[3]&&e[3].includes(t))}function GT(e){let t=``;for(let[e,n]of UT){let i=PT.filter(t=>t[2]===e);if(i.length){t+=`<div class="emoji-category-label">${r(`agentMgr.`+n)}</div>`,t+=`<div class="emoji-picker-grid">`;for(let e of i)t+=`<button type="button" class="emoji-picker-item" data-emoji="${$(e[0])}" title="${$(e[1])}">${e[0]}</button>`;t+=`</div>`}}e.innerHTML=t}function KT(e,t){let n=PT.filter(e=>WT(e,t));if(!n.length){e.innerHTML=`<div class="emoji-picker-empty">${r(`agentMgr.emojiNoMatch`)}</div>`;return}let i=`<div class="emoji-picker-grid">`;for(let e of n)i+=`<button type="button" class="emoji-picker-item" data-emoji="${$(e[0])}" title="${$(e[1])}">${e[0]}</button>`;i+=`</div>`,e.innerHTML=i}function qT(){let e=document.getElementById(`emojiPicker`),t=document.getElementById(`agentEditIconBtn`),n=document.getElementById(`agentEditIcon`),r=document.getElementById(`emojiSearchInput`),i=document.getElementById(`emojiSearchClear`),a=document.getElementById(`emojiPickerBody`);if(!e||!t)return;let o=()=>{let e=r?r.value.trim().toLowerCase():``;e?KT(a,e):GT(a),i&&(i.style.display=e?`flex`:`none`)};t.addEventListener(`click`,n=>{if(n.stopPropagation(),e.style.display===`block`){e.style.display=`none`;return}r&&(r.value=``),o();let i=t.getBoundingClientRect();document.body.clientWidth-i.left>=330?(e.style.left=`0`,e.style.right=`auto`):(e.style.left=`auto`,e.style.right=`0`),e.style.display=`block`}),r&&r.addEventListener(`input`,o),i&&i.addEventListener(`click`,e=>{e.stopPropagation(),r&&(r.value=``),o(),r&&r.focus()}),e.addEventListener(`click`,r=>{let i=r.target.closest(`.emoji-picker-item`);if(!i)return;let a=i.dataset.emoji;t.textContent=a,n&&(n.value=a),e.style.display=`none`})}function JT(){let e=aE;e.inheritMode=!1,e.allTools.forEach(t=>e.selectedSet.add(t.id)),e.mcpServices.forEach(t=>e.excludedSet.delete(t.serverId)),sE()}function YT(){let e=aE;e.inheritMode=!1,e.allTools.forEach(t=>e.selectedSet.delete(t.id)),e.mcpServices.forEach(t=>e.excludedSet.add(t.serverId)),sE()}function XT(){let e=dE;e.inheritMode=!1,e.skills.forEach(t=>e.selectedSet.add(t.name)),pE()}function ZT(){let e=dE;e.inheritMode=!1,e.selectedSet.clear(),pE()}function QT(e){let t=aE;if(e===`mcp`){if(t.mcpServices.length===0)return;t.inheritMode=!1;let e=t.mcpServices.every(e=>!t.excludedSet.has(e.serverId));t.mcpServices.forEach(n=>{e?t.excludedSet.add(n.serverId):t.excludedSet.delete(n.serverId)}),document.querySelectorAll(`#agentToolList .agent-mcp-service-item input[type="checkbox"]`).forEach(t=>{t.checked=!e})}else{let n=t.allTools.filter(t=>(t.category||`other`)===e);if(n.length===0)return;t.inheritMode=!1;let r=n.every(e=>t.selectedSet.has(e.id));n.forEach(e=>{r?t.selectedSet.delete(e.id):t.selectedSet.add(e.id)}),document.querySelectorAll(`#agentToolList .agent-tool-item[data-category="${e}"] input[type="checkbox"]`).forEach(e=>{e.checked=!r})}t.selectedOnly?sE():$T()}function $T(){let e=aE,t=document.getElementById(`agentToolList`);if(!t)return;let n=e.mcpServices.filter(t=>!e.excludedSet.has(t.serverId)).length;t.querySelectorAll(`.agent-tool-category-clickable`).forEach(t=>{let r=t.dataset.category,i=t.querySelector(`.agent-tool-cat-count`);if(i)if(r===`mcp`)i.textContent=`${n}/${e.mcpServices.length}`;else{let t=e.allTools.filter(e=>(e.category||`other`)===r);i.textContent=`${t.filter(t=>e.selectedSet.has(t.id)).length}/${t.length}`}});let i=document.getElementById(`agentToolCount`);if(i){let t=e.allTools.filter(t=>e.selectedSet.has(t.id)).length,a=e.allTools.length+e.mcpServices.length;i.textContent=r(`agentConfig.selectedTotalCount`,{selected:e.inheritMode?a:t+n,total:a})}}function eE(){let e=document.getElementById(`agentSkillCount`);if(!e)return;let t=dE,n=t.skills.length;e.textContent=r(`agentConfig.selectedTotalCount`,{selected:t.inheritMode?n:t.selectedSet.size,total:n})}async function tE(e){let t=document.getElementById(`agentEditModal`);if(!t)return;await hE(),gE(-1),t.querySelector(`#agentEditId`).value=``,t.querySelector(`#agentEditName`).value=``,t.querySelector(`#agentEditIcon`).value=`🤖`;let n=t.querySelector(`#agentEditIconBtn`);n&&(n.textContent=`🤖`),t.querySelector(`#agentEditDesc`).value=``,t.querySelector(`#agentEditPrompt`).value=``,t.querySelector(`#agentEditAllowSub`).checked=!1,t.querySelector(`#agentTemplateSelect`).value=``,t.querySelector(`#agentEditModel`).value=``;let i=t.querySelector(`#agentDeleteBtn`),a=t.querySelector(`#agentEditTitle`);if(e){let n=await ft(e);if(!n||n.isBuiltin)return;a.textContent=r(`agentMgr.editAgent`),t.querySelector(`#agentEditId`).value=n.id,t.querySelector(`#agentEditName`).value=n.name,t.querySelector(`#agentEditIcon`).value=n.icon||`🤖`;let o=t.querySelector(`#agentEditIconBtn`);o&&(o.textContent=n.icon||`🤖`),t.querySelector(`#agentEditDesc`).value=n.description||``,t.querySelector(`#agentEditPrompt`).value=n.systemPrompt||``,t.querySelector(`#agentEditAllowSub`).checked=n.allowSubDispatch||!1,t.querySelector(`#agentEditModel`).value=n.model||``,gE(vE(n.temperature,n.topP)),i.style.display=`block`,oE(n.toolIds,n.mcpExcludedServerIds??[]),fE(n.skillIds)}else a.textContent=r(`agentEditor.createNew`),i.style.display=`none`,oE(null,[]),fE(null);rE(),t.style.display=`flex`;let o=t.querySelector(`#agentEditModel`);if(o){let e=o.value,t=o.cloneNode(!0);o.parentNode.replaceChild(t,o),t.value=e,t.addEventListener(`mousedown`,()=>{let e=t.value;e&&(t.dataset._saved=e,t.value=``)}),t.addEventListener(`blur`,()=>{setTimeout(()=>{t.value||=t.dataset._saved||``},150)})}}function nE(){let e=document.getElementById(`agentEditModal`);e&&(e.style.display=`none`)}function rE(){let e=document.getElementById(`agentTemplateSelect`);if(!e)return;let t=[r(`agentTemplates.codeReviewName`),r(`agentTemplates.webAutomationName`),r(`agentTemplates.dataAnalystName`),r(`agentTemplates.documentationName`)],n=`<option value="">${r(`agentEditor.selectTemplate`)}</option>`;for(let e=0;e<_.length;e++){let r=_[e];n+=`<option value="${e}">${r.icon} ${t[e]}</option>`}e.innerHTML=n}function iE(e){let t=parseInt(e.target.value);if(isNaN(t)||t<0||t>=_.length)return;let n=_[t],i=document.getElementById(`agentEditModal`);if(!i)return;let o=[`agentTemplates.codeReviewName`,`agentTemplates.webAutomationName`,`agentTemplates.dataAnalystName`,`agentTemplates.documentationName`],s=[`agentTemplates.codeReviewDesc`,`agentTemplates.webAutomationDesc`,`agentTemplates.dataAnalystDesc`,`agentTemplates.documentationDesc`];i.querySelector(`#agentEditName`).value=r(o[t]),i.querySelector(`#agentEditIcon`).value=n.icon;let c=i.querySelector(`#agentEditIconBtn`);c&&(c.textContent=n.icon),i.querySelector(`#agentEditDesc`).value=r(s[t]),i.querySelector(`#agentEditPrompt`).value=a()===`en`?n.systemPrompt:n.systemPromptZh||n.systemPrompt,i.querySelector(`#agentEditAllowSub`).checked=n.allowSubDispatch||!1,i.querySelector(`#agentEditModel`).value=n.model||``,gE(vE(n.temperature,n.topP)),oE(n.toolIds,[]),fE(n.skillIds||null),F(r(`agentMgr.templateLoaded`,{name:n.name}),`info`,2e3)}var aE={allTools:[],mcpServices:[],selectedSet:new Set,excludedSet:new Set,searchText:``,selectedOnly:!1,inheritMode:!1};async function oE(e,t){if(!document.getElementById(`agentToolList`))return;let n=[];try{n=(await chrome.storage.local.get([`mcpTools`])).mcpTools||[]}catch{}let{mcpEnabled:r,skillsEnabled:i,ragTools:a}=await chrome.storage.local.get([`mcpEnabled`,`skillsEnabled`,`ragTools`]),o=C.agentPlatform?.connected===!0,s=[...f,...a||[]];o||(s=s.filter(e=>!e.id.startsWith(`agent_`)&&!e.id.startsWith(`knowledge_`))),i===!1&&(s=s.filter(e=>e.id!==`agent_skill`));let c=[];if(r===!0&&o){let e=new Map;for(let t of n){let n=t.serverId||`unknown`;e.has(n)||e.set(n,{serverId:n,serverName:t.serverName||n,tools:[]}),e.get(n).tools.push(t)}c=Array.from(e.values())}let l=new Set(Array.isArray(t)?t:[]),u=aE;u.allTools=s,u.mcpServices=c,u.selectedSet=new Set(e||[]),u.excludedSet=l,u.searchText=``,u.selectedOnly=!1,u.inheritMode=!e;let d=document.getElementById(`agentToolSearchInput`);d&&(d.value=``);let p=document.getElementById(`agentToolSearchClear`);p&&(p.style.display=`none`),sE()}function sE(){let e=document.getElementById(`agentToolList`);if(!e)return;let t=aE,n=aa({tools:t.allTools,services:t.mcpServices,selectedSet:t.selectedSet,excludedSet:t.excludedSet,query:t.searchText,selectedOnly:t.selectedOnly,getDesc:xi}),i=t.mcpServices.filter(e=>!t.excludedSet.has(e.serverId)).length,a={};for(let e of n.tools){let t=e.category||`other`;a[t]||(a[t]=[]),a[t].push(e)}let o=``;for(let[e,n]of Object.entries(a)){let i=r(`toolCategory.${e}`)===`toolCategory.${e}`?e:r(`toolCategory.${e}`),a=t.allTools.filter(t=>(t.category||`other`)===e),s=a.filter(e=>t.selectedSet.has(e.id)).length;o+=`<div class="agent-tool-category agent-tool-category-clickable" data-category="${$(e)}" title="${$(r(`agentConfig.toggleCategoryAll`))}">${i} <span class="agent-tool-cat-count" style="font-weight:400;color:var(--text-tertiary);">${s}/${a.length}</span></div>`;for(let r of n){let n=t.selectedSet.has(r.id)?`checked`:``,i=xi(r),a=i.length>40?i.substring(0,40)+`...`:i;o+=`
|
|
2090
|
+
</div>`),qT(n,i)}function qT(e,t){let n=document.getElementById(`agentSelectorBtn`),i=document.getElementById(`agentSelectorText`),a=document.getElementById(`agentSelectorEmoji`);if(!n||!i)return;let o=e.find(e=>e.id===t)||e.find(e=>e.id==="default");if(o){let e=o.id==="default"?r(`agentMgr.defaultAgentName`):o.name;i.textContent=`${o.icon} ${e}`,a&&(a.textContent=o.icon),n.title=`${r(`header.switchAgent`)}: ${o.icon} ${e}`}else i.textContent=r(`header.defaultAssistant`),a&&(a.textContent=`🤖`),n.title=r(`header.switchAgent`)}function JT(){let e=document.getElementById(`agentSelectorBtn`),t=document.getElementById(`agentSelectorDropdown`),n=document.getElementById(`agentSelectorWrapper`);if(!e||!t||!n)return;let r=n.getBoundingClientRect(),i=document.body.clientWidth;t.style.left=``,t.style.right=`auto`,t.style.maxWidth=Math.min(320,i-16)+`px`;let a=t.getBoundingClientRect().width,o=Math.min(a,i-16),s=e.getBoundingClientRect(),c=s.left+s.width/2,l=i-o-8,u=Math.max(8,Math.min(l,c-o/2));t.style.left=u-r.left+`px`}function YT(){let e=document.getElementById(`agentSelectorBtn`),t=document.getElementById(`agentSelectorDropdown`);!e||!t||(e.addEventListener(`click`,async e=>{if(e.stopPropagation(),t.style.display===`flex`)t.style.display=`none`;else{t.style.left=``,t.style.right=`auto`,t.style.maxWidth=Math.min(320,document.body.clientWidth-16)+`px`,t.style.display=`flex`,JT();try{await KT()}catch{}JT()}}),document.addEventListener(`click`,()=>{t.style.display=`none`}),t.addEventListener(`click`,async e=>{let n=e.target.closest(`.agent-item`);if(!n)return;let r=e.target.closest(`[data-action]`);if(r&&r.dataset.action===`edit`){e.stopPropagation();let t=r.dataset.agentId;uE(t);return}if(r&&r.dataset.action===`delete`){e.stopPropagation(),await AE(r.dataset.agentId);return}if(n.id===`agentAddBtn`){uE(null);return}let i=n.dataset.agentId;i&&(await XT(i),t.style.display=`none`)}))}async function XT(e){let t=e?await ft(e):null;if(C.activeAgentId=e,C.activeAgentToolIds=t?t.toolIds:null,C.activeAgentMcpExcludedServerIds=t?t.mcpExcludedServerIds??null:null,await vt(e),ni().catch(()=>{}),t&&!t.isBuiltin)t.model&&(C.currentModel=t.model),t.temperature!==null&&t.temperature!==void 0&&(C.temperature=t.temperature,C.topP=t.topP!==null&&t.topP!==void 0?t.topP:1),document.dispatchEvent(new CustomEvent(`agent-model-changed`));else if(!t||t.isBuiltin)try{let e=await chrome.storage.local.get([`modelName`,`temperature`,`topP`]);e.modelName&&(C.currentModel=e.modelName),e.temperature!==void 0&&(C.temperature=e.temperature),e.topP!==void 0&&(C.topP=e.topP),document.dispatchEvent(new CustomEvent(`agent-model-changed`))}catch{}await KT();let n=`agentMcpClosedServers_${e||`default`}`,a=await chrome.storage.local.get([n,`ragTools`,`ragToolsIntroduced`]),o=a.ragTools||[];C.mcpClosedServers=a[n]||[];let s=`agentEnabledTools_${e||`default`}`,c=await chrome.storage.local.get([s,`enabledTools`]),l=!!c[s],u=c[s]||c.enabledTools;if(l||u&&u.length>0){let e=ta(o),t=u.filter(t=>e.has(t));if(l)C.enabledTools=t;else{let e=f.filter(e=>e.enabled&&!t.includes(e.id)).map(e=>e.id);C.enabledTools=[...t,...e]}let n=ea(C.enabledTools,o,a.ragToolsIntroduced);C.enabledTools=n.tools,C.enabledTools.length!==u.length&&chrome.storage.local.set({[s]:C.enabledTools,...n.migrated?{ragToolsIntroduced:!0}:{}})}else{C.enabledTools=f.filter(e=>e.enabled).map(e=>e.id);let e=ea(C.enabledTools,o,a.ragToolsIntroduced);C.enabledTools=e.tools,e.migrated&&chrome.storage.local.set({ragToolsIntroduced:!0,[s]:C.enabledTools})}let d=document.getElementById(`toolsPopupOverlay`);d&&d.classList.contains(`show`)&&(Bi(),Ji(),Yi()),Qi();let p=t&&t.id!=="default"?t.name:r(`agentMgr.defaultAgentName`);F(r(`agentMgr.switchedTo`,{name:p}),`info`,2e3),i.debug(`[AgentMgr] switched Agent:`,e,p)}function ZT(){let e=document.getElementById(`agentEditModal`);if(!e)return;e.querySelector(`#agentModalCloseBtn`)?.addEventListener(`click`,dE),e.querySelector(`#agentSaveBtn`)?.addEventListener(`click`,OE),e.querySelector(`#agentDeleteBtn`)?.addEventListener(`click`,kE),e.querySelector(`#agentTemplateSelect`)?.addEventListener(`change`,pE),nE();let t=document.getElementById(`agentToolActions`);t&&t.addEventListener(`click`,e=>{let t=e.target.closest(`button`);if(!t)return;let n=t.dataset.action;n===`selectAll`?rE():n===`deselectAll`?iE():n===`toggleSelectedOnly`&&(mE.selectedOnly=!mE.selectedOnly,gE())});let n=document.getElementById(`agentToolSearchInput`);if(n){let e=null,t=document.getElementById(`agentToolSearchClear`),r=()=>{t&&(t.style.display=n.value?`block`:`none`)};n.addEventListener(`input`,()=>{r(),clearTimeout(e),e=setTimeout(()=>{mE.searchText=n.value,gE()},150)}),t&&t.addEventListener(`click`,()=>{clearTimeout(e),n.value=``,r(),mE.searchText=``,gE(),n.focus()}),r()}let r=document.getElementById(`agentSkillActions`);r&&r.addEventListener(`click`,e=>{let t=e.target.closest(`button`);if(!t)return;let n=t.dataset.action;n===`selectAllSkills`?aE():n===`deselectAllSkills`?oE():n===`toggleSelectedOnlySkills`&&(bE.selectedOnly=!bE.selectedOnly,SE())});let i=document.getElementById(`agentSkillSearchInput`);if(i){let e=null,t=document.getElementById(`agentSkillSearchClear`),n=()=>{t&&(t.style.display=i.value?`block`:`none`)};i.addEventListener(`input`,()=>{n(),clearTimeout(e),e=setTimeout(()=>{bE.searchText=i.value,SE()},150)}),t&&t.addEventListener(`click`,()=>{clearTimeout(e),i.value=``,n(),bE.searchText=``,SE(),i.focus()}),n()}let a=document.getElementById(`agentToolList`);a&&(a.addEventListener(`click`,e=>{let t=e.target.closest(`.agent-mcp-expand-btn`);if(t){e.preventDefault(),_E(t.dataset.serverId,t);return}let n=e.target.closest(`.agent-mcp-service-item`);if(n&&!e.target.closest(`input[type="checkbox"]`)){e.preventDefault(),_E(n.dataset.mcpServerId,n.querySelector(`.agent-mcp-expand-btn`));return}let r=e.target.closest(`.agent-tool-category-clickable`);r&&sE(r.dataset.category)}),a.addEventListener(`change`,e=>{if(!e.target.matches(`input[type="checkbox"]`))return;let t=mE,n=e.target.dataset.toolId,r=e.target.dataset.mcpServerId;t.inheritMode=!1,n?e.target.checked?t.selectedSet.add(n):t.selectedSet.delete(n):r&&(e.target.checked?t.excludedSet.delete(r):t.excludedSet.add(r)),t.selectedOnly?gE():cE()}));let o=document.getElementById(`agentSkillList`);o&&o.addEventListener(`change`,e=>{if(!e.target.matches(`input[type="checkbox"]`))return;let t=bE;t.inheritMode=!1,e.target.checked?t.selectedSet.add(e.target.value):t.selectedSet.delete(e.target.value),t.selectedOnly&&!e.target.checked?SE():lE()}),document.addEventListener(`click`,e=>{let t=document.getElementById(`emojiPicker`),n=document.getElementById(`agentEditIconBtn`);t&&n&&t.style.display===`block`&&!n.contains(e.target)&&!t.contains(e.target)&&(t.style.display=`none`)})}var QT=[[`smileys`,`emojiCatSmileys`],[`people`,`emojiCatPeople`],[`animals`,`emojiCatAnimals`],[`food`,`emojiCatFood`],[`travel`,`emojiCatTravel`],[`activity`,`emojiCatActivity`],[`objects`,`emojiCatObjects`],[`symbols`,`emojiCatSymbols`],[`flags`,`emojiCatFlags`]];function $T(e,t){return!!(e[1].includes(t)||e[3]&&e[3].includes(t))}function eE(e){let t=``;for(let[e,n]of QT){let i=UT.filter(t=>t[2]===e);if(i.length){t+=`<div class="emoji-category-label">${r(`agentMgr.`+n)}</div>`,t+=`<div class="emoji-picker-grid">`;for(let e of i)t+=`<button type="button" class="emoji-picker-item" data-emoji="${$(e[0])}" title="${$(e[1])}">${e[0]}</button>`;t+=`</div>`}}e.innerHTML=t}function tE(e,t){let n=UT.filter(e=>$T(e,t));if(!n.length){e.innerHTML=`<div class="emoji-picker-empty">${r(`agentMgr.emojiNoMatch`)}</div>`;return}let i=`<div class="emoji-picker-grid">`;for(let e of n)i+=`<button type="button" class="emoji-picker-item" data-emoji="${$(e[0])}" title="${$(e[1])}">${e[0]}</button>`;i+=`</div>`,e.innerHTML=i}function nE(){let e=document.getElementById(`emojiPicker`),t=document.getElementById(`agentEditIconBtn`),n=document.getElementById(`agentEditIcon`),r=document.getElementById(`emojiSearchInput`),i=document.getElementById(`emojiSearchClear`),a=document.getElementById(`emojiPickerBody`);if(!e||!t)return;let o=()=>{let e=r?r.value.trim().toLowerCase():``;e?tE(a,e):eE(a),i&&(i.style.display=e?`flex`:`none`)};t.addEventListener(`click`,n=>{if(n.stopPropagation(),e.style.display===`block`){e.style.display=`none`;return}r&&(r.value=``),o();let i=t.getBoundingClientRect();document.body.clientWidth-i.left>=330?(e.style.left=`0`,e.style.right=`auto`):(e.style.left=`auto`,e.style.right=`0`),e.style.display=`block`}),r&&r.addEventListener(`input`,o),i&&i.addEventListener(`click`,e=>{e.stopPropagation(),r&&(r.value=``),o(),r&&r.focus()}),e.addEventListener(`click`,r=>{let i=r.target.closest(`.emoji-picker-item`);if(!i)return;let a=i.dataset.emoji;t.textContent=a,n&&(n.value=a),e.style.display=`none`})}function rE(){let e=mE;e.inheritMode=!1,e.allTools.forEach(t=>e.selectedSet.add(t.id)),e.mcpServices.forEach(t=>e.excludedSet.delete(t.serverId)),gE()}function iE(){let e=mE;e.inheritMode=!1,e.allTools.forEach(t=>e.selectedSet.delete(t.id)),e.mcpServices.forEach(t=>e.excludedSet.add(t.serverId)),gE()}function aE(){let e=bE;e.inheritMode=!1,e.skills.forEach(t=>e.selectedSet.add(t.name)),SE()}function oE(){let e=bE;e.inheritMode=!1,e.selectedSet.clear(),SE()}function sE(e){let t=mE;if(e===`mcp`){if(t.mcpServices.length===0)return;t.inheritMode=!1;let e=t.mcpServices.every(e=>!t.excludedSet.has(e.serverId));t.mcpServices.forEach(n=>{e?t.excludedSet.add(n.serverId):t.excludedSet.delete(n.serverId)}),document.querySelectorAll(`#agentToolList .agent-mcp-service-item input[type="checkbox"]`).forEach(t=>{t.checked=!e})}else{let n=t.allTools.filter(t=>(t.category||`other`)===e);if(n.length===0)return;t.inheritMode=!1;let r=n.every(e=>t.selectedSet.has(e.id));n.forEach(e=>{r?t.selectedSet.delete(e.id):t.selectedSet.add(e.id)}),document.querySelectorAll(`#agentToolList .agent-tool-item[data-category="${e}"] input[type="checkbox"]`).forEach(e=>{e.checked=!r})}t.selectedOnly?gE():cE()}function cE(){let e=mE,t=document.getElementById(`agentToolList`);if(!t)return;let n=e.mcpServices.filter(t=>!e.excludedSet.has(t.serverId)).length;t.querySelectorAll(`.agent-tool-category-clickable`).forEach(t=>{let r=t.dataset.category,i=t.querySelector(`.agent-tool-cat-count`);if(i)if(r===`mcp`)i.textContent=`${n}/${e.mcpServices.length}`;else{let t=e.allTools.filter(e=>(e.category||`other`)===r);i.textContent=`${t.filter(t=>e.selectedSet.has(t.id)).length}/${t.length}`}});let i=document.getElementById(`agentToolCount`);if(i){let t=e.allTools.filter(t=>e.selectedSet.has(t.id)).length,a=e.allTools.length+e.mcpServices.length;i.textContent=r(`agentConfig.selectedTotalCount`,{selected:e.inheritMode?a:t+n,total:a})}}function lE(){let e=document.getElementById(`agentSkillCount`);if(!e)return;let t=bE,n=t.skills.length;e.textContent=r(`agentConfig.selectedTotalCount`,{selected:t.inheritMode?n:t.selectedSet.size,total:n})}async function uE(e){let t=document.getElementById(`agentEditModal`);if(!t)return;await wE(),TE(-1),t.querySelector(`#agentEditId`).value=``,t.querySelector(`#agentEditName`).value=``,t.querySelector(`#agentEditIcon`).value=`🤖`;let n=t.querySelector(`#agentEditIconBtn`);n&&(n.textContent=`🤖`),t.querySelector(`#agentEditDesc`).value=``,t.querySelector(`#agentEditPrompt`).value=``,t.querySelector(`#agentEditAllowSub`).checked=!1,t.querySelector(`#agentTemplateSelect`).value=``,t.querySelector(`#agentEditModel`).value=``;let i=t.querySelector(`#agentDeleteBtn`),a=t.querySelector(`#agentEditTitle`);if(e){let n=await ft(e);if(!n||n.isBuiltin)return;a.textContent=r(`agentMgr.editAgent`),t.querySelector(`#agentEditId`).value=n.id,t.querySelector(`#agentEditName`).value=n.name,t.querySelector(`#agentEditIcon`).value=n.icon||`🤖`;let o=t.querySelector(`#agentEditIconBtn`);o&&(o.textContent=n.icon||`🤖`),t.querySelector(`#agentEditDesc`).value=n.description||``,t.querySelector(`#agentEditPrompt`).value=n.systemPrompt||``,t.querySelector(`#agentEditAllowSub`).checked=n.allowSubDispatch||!1,t.querySelector(`#agentEditModel`).value=n.model||``,TE(DE(n.temperature,n.topP)),i.style.display=`block`,hE(n.toolIds,n.mcpExcludedServerIds??[]),xE(n.skillIds)}else a.textContent=r(`agentEditor.createNew`),i.style.display=`none`,hE(null,[]),xE(null);fE(),t.style.display=`flex`;let o=t.querySelector(`#agentEditModel`);if(o){let e=o.value,t=o.cloneNode(!0);o.parentNode.replaceChild(t,o),t.value=e,t.addEventListener(`mousedown`,()=>{let e=t.value;e&&(t.dataset._saved=e,t.value=``)}),t.addEventListener(`blur`,()=>{setTimeout(()=>{t.value||=t.dataset._saved||``},150)})}}function dE(){let e=document.getElementById(`agentEditModal`);e&&(e.style.display=`none`)}function fE(){let e=document.getElementById(`agentTemplateSelect`);if(!e)return;let t=[r(`agentTemplates.codeReviewName`),r(`agentTemplates.webAutomationName`),r(`agentTemplates.dataAnalystName`),r(`agentTemplates.documentationName`)],n=`<option value="">${r(`agentEditor.selectTemplate`)}</option>`;for(let e=0;e<_.length;e++){let r=_[e];n+=`<option value="${e}">${r.icon} ${t[e]}</option>`}e.innerHTML=n}function pE(e){let t=parseInt(e.target.value);if(isNaN(t)||t<0||t>=_.length)return;let n=_[t],i=document.getElementById(`agentEditModal`);if(!i)return;let o=[`agentTemplates.codeReviewName`,`agentTemplates.webAutomationName`,`agentTemplates.dataAnalystName`,`agentTemplates.documentationName`],s=[`agentTemplates.codeReviewDesc`,`agentTemplates.webAutomationDesc`,`agentTemplates.dataAnalystDesc`,`agentTemplates.documentationDesc`];i.querySelector(`#agentEditName`).value=r(o[t]),i.querySelector(`#agentEditIcon`).value=n.icon;let c=i.querySelector(`#agentEditIconBtn`);c&&(c.textContent=n.icon),i.querySelector(`#agentEditDesc`).value=r(s[t]),i.querySelector(`#agentEditPrompt`).value=a()===`en`?n.systemPrompt:n.systemPromptZh||n.systemPrompt,i.querySelector(`#agentEditAllowSub`).checked=n.allowSubDispatch||!1,i.querySelector(`#agentEditModel`).value=n.model||``,TE(DE(n.temperature,n.topP)),hE(n.toolIds,[]),xE(n.skillIds||null),F(r(`agentMgr.templateLoaded`,{name:n.name}),`info`,2e3)}var mE={allTools:[],mcpServices:[],selectedSet:new Set,excludedSet:new Set,searchText:``,selectedOnly:!1,inheritMode:!1};async function hE(e,t){if(!document.getElementById(`agentToolList`))return;let n=[];try{n=(await chrome.storage.local.get([`mcpTools`])).mcpTools||[]}catch{}let{mcpEnabled:r,skillsEnabled:i,ragTools:a}=await chrome.storage.local.get([`mcpEnabled`,`skillsEnabled`,`ragTools`]),o=C.agentPlatform?.connected===!0,s=[...f,...a||[]];o||(s=s.filter(e=>!e.id.startsWith(`agent_`)&&!e.id.startsWith(`knowledge_`))),i===!1&&(s=s.filter(e=>e.id!==`agent_skill`));let c=[];if(r===!0&&o){let e=new Map;for(let t of n){let n=t.serverId||`unknown`;e.has(n)||e.set(n,{serverId:n,serverName:t.serverName||n,tools:[]}),e.get(n).tools.push(t)}c=Array.from(e.values())}let l=new Set(Array.isArray(t)?t:[]),u=mE;u.allTools=s,u.mcpServices=c,u.selectedSet=new Set(e||[]),u.excludedSet=l,u.searchText=``,u.selectedOnly=!1,u.inheritMode=!e;let d=document.getElementById(`agentToolSearchInput`);d&&(d.value=``);let p=document.getElementById(`agentToolSearchClear`);p&&(p.style.display=`none`),gE()}function gE(){let e=document.getElementById(`agentToolList`);if(!e)return;let t=mE,n=aa({tools:t.allTools,services:t.mcpServices,selectedSet:t.selectedSet,excludedSet:t.excludedSet,query:t.searchText,selectedOnly:t.selectedOnly,getDesc:xi}),i=t.mcpServices.filter(e=>!t.excludedSet.has(e.serverId)).length,a={};for(let e of n.tools){let t=e.category||`other`;a[t]||(a[t]=[]),a[t].push(e)}let o=``;for(let[e,n]of Object.entries(a)){let i=r(`toolCategory.${e}`)===`toolCategory.${e}`?e:r(`toolCategory.${e}`),a=t.allTools.filter(t=>(t.category||`other`)===e),s=a.filter(e=>t.selectedSet.has(e.id)).length;o+=`<div class="agent-tool-category agent-tool-category-clickable" data-category="${$(e)}" title="${$(r(`agentConfig.toggleCategoryAll`))}">${i} <span class="agent-tool-cat-count" style="font-weight:400;color:var(--text-tertiary);">${s}/${a.length}</span></div>`;for(let r of n){let n=t.selectedSet.has(r.id)?`checked`:``,i=xi(r),a=i.length>40?i.substring(0,40)+`...`:i;o+=`
|
|
2091
2091
|
<label class="agent-tool-item" data-category="${$(e)}">
|
|
2092
2092
|
<input type="checkbox" value="${$(r.id)}" ${n} data-tool-id="${$(r.id)}">
|
|
2093
|
-
<span class="agent-tool-name" title="${$(r.name)}">${
|
|
2094
|
-
<span class="agent-tool-desc" title="${$(i)}">${
|
|
2095
|
-
</label>`}}if(n.services.length>0){let e=r(`toolCategory.mcp`)===`toolCategory.mcp`?`mcp`:r(`toolCategory.mcp`);o+=`<div class="agent-tool-category agent-tool-category-clickable" data-category="mcp" title="${$(r(`agentConfig.toggleCategoryAll`))}">${e} <span class="agent-tool-cat-count" style="font-weight:400;color:var(--text-tertiary);">${i}/${t.mcpServices.length}</span></div>`;for(let e of n.services){let n=t.excludedSet.has(e.serverId)?``:`checked`,i=r(`toolPanel.mcpServiceToolCount`,{count:e.tools.length}),a=e.tools.map(e=>e.name).join(`, `),s=e.tools.map(e=>{let t=e.name||``,n=Si(e);return`<div class="agent-mcp-tool-row" title="${$(n?`${t}:${n}`:t)}"><div class="agent-mcp-tool-name">${
|
|
2093
|
+
<span class="agent-tool-name" title="${$(r.name)}">${NE(r.name)}</span>
|
|
2094
|
+
<span class="agent-tool-desc" title="${$(i)}">${NE(a)}</span>
|
|
2095
|
+
</label>`}}if(n.services.length>0){let e=r(`toolCategory.mcp`)===`toolCategory.mcp`?`mcp`:r(`toolCategory.mcp`);o+=`<div class="agent-tool-category agent-tool-category-clickable" data-category="mcp" title="${$(r(`agentConfig.toggleCategoryAll`))}">${e} <span class="agent-tool-cat-count" style="font-weight:400;color:var(--text-tertiary);">${i}/${t.mcpServices.length}</span></div>`;for(let e of n.services){let n=t.excludedSet.has(e.serverId)?``:`checked`,i=r(`toolPanel.mcpServiceToolCount`,{count:e.tools.length}),a=e.tools.map(e=>e.name).join(`, `),s=e.tools.map(e=>{let t=e.name||``,n=Si(e);return`<div class="agent-mcp-tool-row" title="${$(n?`${t}:${n}`:t)}"><div class="agent-mcp-tool-name">${NE(t)}</div>`+(n?`<div class="agent-mcp-tool-desc">${NE(n)}</div>`:``)+`</div>`}).join(``);o+=`
|
|
2096
2096
|
<label class="agent-tool-item agent-mcp-service-item" data-category="mcp" data-mcp-server-id="${$(e.serverId)}">
|
|
2097
2097
|
<input type="checkbox" ${n} data-mcp-server-id="${$(e.serverId)}">
|
|
2098
|
-
<span class="agent-tool-name" title="${$(e.serverName)}">${
|
|
2099
|
-
<span class="agent-tool-desc" title="${$(a)}">${
|
|
2100
|
-
<span class="agent-mcp-service-id" title="ID: ${$(e.serverId)}">ID: ${
|
|
2098
|
+
<span class="agent-tool-name" title="${$(e.serverName)}">${NE(e.serverName)}</span>
|
|
2099
|
+
<span class="agent-tool-desc" title="${$(a)}">${NE(i)}</span>
|
|
2100
|
+
<span class="agent-mcp-service-id" title="ID: ${$(e.serverId)}">ID: ${NE(e.serverId)}</span>
|
|
2101
2101
|
<button type="button" class="agent-mcp-expand-btn" data-server-id="${$(e.serverId)}" title="${$(r(`toolPanel.mcpServiceExpand`))}">▶</button>
|
|
2102
2102
|
</label>
|
|
2103
|
-
<div class="agent-mcp-tool-list collapsed" data-server-id="${$(e.serverId)}">${s}</div>`}}o||=`<div class="agent-tool-empty">${
|
|
2103
|
+
<div class="agent-mcp-tool-list collapsed" data-server-id="${$(e.serverId)}">${s}</div>`}}o||=`<div class="agent-tool-empty">${NE(r(`toolPanel.noMatch`))}</div>`,e.innerHTML=o;let s=document.getElementById(`agentToolSelectedOnlyBtn`);if(s){s.classList.toggle(`active`,t.selectedOnly),s.textContent=r(t.selectedOnly?`agentEditor.showAllTools`:`agentEditor.selectedOnlyFilter`);let e=t.allTools.filter(e=>t.selectedSet.has(e.id)).length;s.title=r(`agentToolFilter.selectedCountHint`,{count:e+i})}cE()}function _E(e,t){let n=document.getElementById(`agentToolList`);if(!n||!e)return;let r=Array.from(n.querySelectorAll(`.agent-mcp-tool-list`)).find(t=>t.dataset.serverId===e);if(!r)return;let i=r.classList.toggle(`collapsed`),a=t||r.previousElementSibling?.querySelector(`.agent-mcp-expand-btn`);a&&(a.textContent=i?`▶`:`▼`)}function vE(){let e=mE,t=e.allTools.filter(t=>e.selectedSet.has(t.id)).map(e=>e.id),n=new Set(t),r=[...e.selectedSet].filter(e=>!n.has(e)),i=[...t,...r];return i.length>0?i:null}function yE(){let e=mE;if(e.mcpServices.length!==0)return e.mcpServices.filter(t=>e.excludedSet.has(t.serverId)).map(e=>e.serverId)}var bE={skills:[],selectedSet:new Set,searchText:``,selectedOnly:!1,inheritMode:!1};async function xE(e){if(!document.getElementById(`agentSkillList`))return;let t=[];try{t=await vT()}catch{}let n=bE;n.skills=t,n.selectedSet=new Set(e||[]),n.searchText=``,n.selectedOnly=!1,n.inheritMode=e==null;let r=document.getElementById(`agentSkillSearchInput`);r&&(r.value=``);let i=document.getElementById(`agentSkillSearchClear`);i&&(i.style.display=`none`),SE()}function SE(){let e=document.getElementById(`agentSkillList`);if(!e)return;let t=bE;if(t.skills.length===0)e.innerHTML=`<div style="color:var(--text-tertiary);font-size:12px;padding:8px;text-align:center;">${r(`agentMgr.noSkillsHint`)}</div>`;else{let n=aa({tools:t.skills.map(e=>({id:e.name,name:e.name,description:e.description||``})),services:[],selectedSet:t.selectedSet,excludedSet:new Set,query:t.searchText,selectedOnly:t.selectedOnly}).tools;n.length===0?e.innerHTML=`<div class="agent-tool-empty">${NE(r(`toolPanel.noMatch`))}</div>`:e.innerHTML=n.map(e=>{let n=t.selectedSet.has(e.name)?`checked`:``,r=e.description||``;return`
|
|
2104
2104
|
<label class="agent-tool-item">
|
|
2105
2105
|
<input type="checkbox" value="${$(e.name)}" ${n}>
|
|
2106
|
-
<span class="agent-tool-name" title="${$(e.name)}">${
|
|
2107
|
-
<span class="agent-tool-desc" title="${$(r)}">${
|
|
2108
|
-
</label>`}).join(``)}let n=document.getElementById(`agentSkillSelectedOnlyBtn`);n&&(n.classList.toggle(`active`,t.selectedOnly),n.textContent=r(t.selectedOnly?`agentEditor.showAllSkills`:`agentEditor.selectedOnlyFilter`),n.title=r(`agentToolFilter.selectedCountHint`,{count:t.selectedSet.size})),eE()}function mE(){let e=dE,t=e.skills.filter(t=>e.selectedSet.has(t.name)).map(e=>e.name),n=new Set(t),r=[...e.selectedSet].filter(e=>!n.has(e)),i=[...t,...r];return i.length>0?i:null}async function hE(){let e=document.getElementById(`agentModelList`);if(e)return new Promise(t=>{chrome.storage.local.get([`customModels`],n=>{let r=[];(n.customModels||[]).forEach(e=>{let t;typeof e==`string`?t=e:e&&e.name&&(t=e.name),t&&!r.includes(t)&&r.push(t)}),e.innerHTML=r.map(e=>`<option value="${$(e)}">`).join(``),t()})})}function gE(e){let t=document.getElementById(`agentEditTempPreset`);if(t){for(;t.options.length>1;)t.remove(1);Qt.forEach((e,n)=>{let i=document.createElement(`option`);i.value=n,i.textContent=`${r(e.labelKey)}(${e.temp.toFixed(2)})`,t.appendChild(i)}),e!==void 0&&e>=0?t.value=e:t.value=``}}function _E(){let e=document.getElementById(`agentEditTempPreset`);if(!e||e.value===``)return{temperature:null,topP:null};let t=parseInt(e.value);if(isNaN(t)||t<0||t>=Qt.length)return{temperature:null,topP:null};let n=Qt[t];return{temperature:n.temp,topP:n.topP}}function vE(e,t){if(e==null)return-1;for(let n=0;n<Qt.length;n++){let r=Qt[n];if(Math.abs(r.temp-e)<.001&&Math.abs(r.topP-(t||1))<.001)return n}return-1}async function yE(){let e=document.getElementById(`agentEditModal`);if(!e)return;let t=e.querySelector(`#agentEditId`).value,n=e.querySelector(`#agentEditName`).value.trim(),a=e.querySelector(`#agentEditIcon`).value.trim()||`🤖`,o=e.querySelector(`#agentEditDesc`).value.trim(),s=e.querySelector(`#agentEditPrompt`).value.trim(),c=e.querySelector(`#agentEditAllowSub`).checked,l=lE(),u=uE(),d=mE(),f=e.querySelector(`#agentEditModel`).value.trim()||null,{temperature:p,topP:m}=_E();if(!n){F(r(`agentMgr.nameRequired`),`warning`);return}let h={name:n,icon:a,description:o,systemPrompt:s,allowSubDispatch:c,toolIds:l,skillIds:d,model:f,temperature:p,topP:m};u!==void 0&&(h.mcpExcludedServerIds=u);try{t?(await pt(t,h),t===C.activeAgentId&&u!==void 0&&(C.activeAgentMcpExcludedServerIds=u),F(r(`agentMgr.agentUpdated`),`success`)):F(r(`agentMgr.agentCreated`,{name:(await ht(h)).name}),`success`),await IT(),await LT(),nE(),Qi()}catch(e){i.error(`[AgentMgr] save Agent failed:`,e),F(r(`agentMgr.saveFailed`,{message:e.message}),`error`)}}async function bE(){let e=document.getElementById(`agentEditModal`);if(!e)return;let t=e.querySelector(`#agentEditId`)?.value;if(!t)return;let n=await ft(t);if(await TE(r(`agentMgr.confirmDeleteAgentMessage`,{name:n?n.name:``}),r(`agentMgr.deleteAgentTitle`)))try{await _t(t),F(r(`agentMgr.agentDeleted`),`success`),await IT(),await LT(),nE()}catch(e){i.error(`[AgentMgr] delete Agent failed:`,e),F(r(`agentMgr.deleteFailed`,{message:e.message}),`error`)}}async function xE(e){if(!e)return!1;let t=await ft(e);if(!t||t.isBuiltin)return F(r(`agentMgr.cannotDeleteDefault`),`warning`),!1;if(!await TE(r(`agentMgr.confirmDeleteAgentMessage`,{name:t.name}),r(`agentMgr.deleteAgentTitle`)))return!1;try{return await _t(e),F(r(`agentMgr.agentDeleted`),`success`),await IT(),await LT(),!0}catch(e){return i.error(`[AgentMgr] delete Agent failed:`,e),F(r(`agentMgr.deleteFailed`,{message:e.message}),`error`),!1}}async function SE(e=C.activeAgentId){return e?await ft(e):null}function CE(e){return e?e.toolIds:null}function wE(e){if(!e)return``;let t=document.createElement(`div`);return t.textContent=e,t.innerHTML}function $(e){return e?e.replace(/["&<>]/g,e=>({'"':`"`,"&":`&`,"<":`<`,">":`>`})[e]):``}async function TE(e,t){return typeof window.showCustomConfirm==`function`?window.showCustomConfirm(e,t):new Promise(n=>{let i=document.getElementById(`agentConfirmModal`);if(!i){n(confirm(e));return}i.querySelector(`#agentConfirmMessage`).textContent=e,i.querySelector(`#agentConfirmTitle`).textContent=t||r(`agentMgr.confirm`),i.style.display=`flex`;let a=()=>{i.style.display=`none`,i.querySelector(`#agentConfirmOk`).removeEventListener(`click`,o),i.querySelector(`#agentConfirmCancel`).removeEventListener(`click`,s),i.removeEventListener(`click`,c)},o=()=>{a(),n(!0)},s=()=>{a(),n(!1)},c=e=>{e.target===i&&(a(),n(!1))};i.querySelector(`#agentConfirmOk`).addEventListener(`click`,o),i.querySelector(`#agentConfirmCancel`).addEventListener(`click`,s),i.addEventListener(`click`,c)})}n(`zh`,{contextUsage:{indicatorTitle:`上下文占用 {percent}%({used} / {total} tokens)· 点击查看详情`,memoryOffToast:`记忆已关闭,无可压缩内容`,generatingToast:`正在生成回复,请稍后再试`,nothingToCompactToast:`没有新的消息可压缩`,confirmTitle:`压缩上下文`,confirmMessage:`将压缩 {count} 条历史消息(约 {tokens} tokens)为一份摘要{summaryHint}。原始消息仍保留在会话中,发送新消息前可撤销。`,confirmWithOldSummary:`(含已有摘要,将合并为新摘要)`,confirmOk:`开始压缩`,compactingTitle:`正在压缩上下文`,compactingHint:`正在调用模型生成摘要,请稍候…(通常需要几秒到十几秒)`,compactDone:`压缩完成,节约约 {saved} tokens`,compactErrConfig:`无法压缩:API 配置缺失`,compactErrFailed:`压缩失败,请稍后重试`,compactErrEmpty:`模型未返回摘要内容`,compactErrHttp:`接口错误 HTTP {status}`,compactErrTimeout:`请求超时`,autoCompactedToast:`上下文接近上限,已自动压缩(预计省 {saved} tokens)`,undoTitle:`撤销压缩`,undoMessage:`撤销后,发送将恢复携带完整历史。确定撤销吗?`,undoOk:`撤销`,undoDone:`已撤销压缩`,dividerText:`⬆ 上方 {count} 条消息已压缩为摘要`,dividerView:`查看`,dividerUndo:`撤销`,popupTitle:`上下文占用明细`,rowSystem:`系统提示词`,rowTools:`工具定义`,rowHistory:`历史消息`,rowInput:`当前输入`,historyMeta:`选中 {selected} 条 / 共 {total} 条`,historyTrimmed:`为控制预算裁剪了 {count} 条(以规则摘要替代)`,refInfo:`输出预留 {output} · 安全余量 {safety}(不计入上方占用)`,memoryLabel:`记忆设置`,memoryAll:`携带全部历史`,memoryLimited:`携带最近 {n} 条`,memoryOff:`不携带历史(仅当前消息)`,compactionActive:`已压缩 {count} 条历史 · 摘要约 {tokens} tokens`,compactionInvalidHint:`压缩点已失效(对应消息已被删除),本次发送未使用压缩`,removeInvalid:`移除失效的压缩记录`,btnCompact:`压缩上下文`,btnCompactAgain:`再次压缩`,btnUndoCompact:`撤销压缩`,undoExpiredToast:`已发送新消息,无法再撤销压缩(可再次压缩合并更新)`,summaryTitle:`上下文摘要(压缩 {count} 条历史)`,summaryTabPreview:`预览`,summaryTabSource:`源码`}}),n(`en`,{contextUsage:{indicatorTitle:`Context usage {percent}% ({used} / {total} tokens) · Click for details`,memoryOffToast:`Memory is off, nothing to compact`,generatingToast:`Generating a reply, please try again later`,nothingToCompactToast:`No new messages to compact`,confirmTitle:`Compact Context`,confirmMessage:`Compact {count} history messages (~{tokens} tokens) into a summary{summaryHint}. Original messages remain in the session; undo is available before sending new messages.`,confirmWithOldSummary:` (including the existing summary, which will be merged into a new one)`,confirmOk:`Start Compaction`,compactingTitle:`Compacting Context`,compactingHint:`Generating a summary with the model, please wait… (usually takes a few seconds)`,compactDone:`Compaction complete, saved ~{saved} tokens`,compactErrConfig:`Cannot compact: API configuration missing`,compactErrFailed:`Compaction failed, please try again later`,compactErrEmpty:`the model returned no summary`,compactErrHttp:`API error HTTP {status}`,compactErrTimeout:`request timed out`,autoCompactedToast:`Context is near its limit; auto-compacted (est. {saved} tokens saved)`,undoTitle:`Undo Compaction`,undoMessage:`After undo, sending will include the full history again. Undo?`,undoOk:`Undo`,undoDone:`Compaction undone`,dividerText:`⬆ {count} messages above compacted into a summary`,dividerView:`View`,dividerUndo:`Undo`,popupTitle:`Context Usage Details`,rowSystem:`System prompt`,rowTools:`Tool definitions`,rowHistory:`History messages`,rowInput:`Current input`,historyMeta:`Selected {selected} / {total} total`,historyTrimmed:`{count} messages trimmed for budget (replaced by rule summary)`,refInfo:`Output reserve {output} · Safety margin {safety} (not counted above)`,memoryLabel:`Memory setting`,memoryAll:`Carry all history`,memoryLimited:`Carry latest {n} messages`,memoryOff:`No history (current message only)`,compactionActive:`{count} messages compacted · summary ~{tokens} tokens`,compactionInvalidHint:`Compaction point is stale (its message was deleted); this send ignores the compaction`,removeInvalid:`Remove stale compaction record`,btnCompact:`Compact Context`,btnCompactAgain:`Compact Again`,btnUndoCompact:`Undo Compaction`,undoExpiredToast:`New messages have been sent; compaction can no longer be undone (you can compact again)`,summaryTitle:`Context Summary ({count} messages compacted)`,summaryTabPreview:`Preview`,summaryTabSource:`Source`}});var EE=300,DE=``,OE=0,kE=null;async function AE(){try{let{mcpTools:e}=await chrome.storage.local.get([`mcpTools`]),t=e||[],n=new Set(Array.isArray(C.mcpClosedServers)?C.mcpClosedServers:[]),r=new Set(Array.isArray(C.activeAgentMcpExcludedServerIds)?C.activeAgentMcpExcludedServerIds:[]);return t.filter(e=>{let t=e.serverId||`unknown`;return!n.has(t)&&!r.has(t)}).length}catch{return 0}}function jE(){let e=document.getElementById(`userInput`)?.value||``;return{usage:on({model:C.currentModel,customModelMap:C.customModelMap,systemPromptText:DE,toolCount:(C.useTools?C.enabledTools.length:0)+OE,history:C.messageHistory,inputText:e,maxMemoryMessages:C.chatConfig?.maxMemoryMessages??null,compaction:C.activeCompaction,isolateChat:C.isolateChat}),inputText:e}}function ME(e){let t=document.getElementById(`contextUsageIndicator`);if(!t)return;t._lastUsage=e,t.dataset.level=e.level;let n=Math.round(e.ratio*100),i=t.querySelector(`.context-usage-percent`);i&&(i.textContent=`${n}%`),t.style.setProperty(`--usage-ratio`,String(Math.min(Math.max(e.ratio,0),1))),t.title=r(`contextUsage.indicatorTitle`,{percent:n,used:I(e.usedTokens),total:I(e.contextWindow)})}function NE(){try{let{usage:e}=jE();return ME(e),GE(),e}catch(e){return i.warn(`[ContextIndicator] update failed:`,e?.message),null}}function PE(){clearTimeout(kE),kE=setTimeout(()=>NE(),EE)}async function FE(e=null){let t=e===null?C.activeSessionId:e;try{DE=await Ke(await SE(),{sessionId:t})}catch(e){i.warn(`[ContextIndicator] refresh system prompt failed:`,e?.message)}try{OE=await AE()}catch{OE=0}NE()}function IE(){let e=document.getElementById(`contextUsageIndicator`);e&&(e.addEventListener(`click`,()=>YE()),document.getElementById(`userInput`)?.addEventListener(`input`,PE),document.addEventListener(`generating-state-changed`,()=>{FE()}),document.addEventListener(`agent-model-changed`,()=>{FE()}),document.addEventListener(`session-switched`,()=>{FE()}),document.addEventListener(`session-workdir-changed`,()=>{FE()}),chrome.storage.onChanged.addListener((e,t)=>{t===`local`&&((e.chatMaxMemoryMessages||e.isolateChat)&&PE(),(e.modelName||e.customModels)&&PE(),(e.isolateChat||e.mcpTools||e.mcpEnabled||e.enabledTools||e.enableTools)&&FE())}),FE())}function LE({title:e,message:t,okText:n}){return new Promise(i=>{let a=document.createElement(`div`);a.className=`modal-overlay show`,a.style.zIndex=`10200`,a.innerHTML=`
|
|
2106
|
+
<span class="agent-tool-name" title="${$(e.name)}">${NE(e.name)}</span>
|
|
2107
|
+
<span class="agent-tool-desc" title="${$(r)}">${NE(r.substring(0,40))}${r.length>40?`...`:``}</span>
|
|
2108
|
+
</label>`}).join(``)}let n=document.getElementById(`agentSkillSelectedOnlyBtn`);n&&(n.classList.toggle(`active`,t.selectedOnly),n.textContent=r(t.selectedOnly?`agentEditor.showAllSkills`:`agentEditor.selectedOnlyFilter`),n.title=r(`agentToolFilter.selectedCountHint`,{count:t.selectedSet.size})),lE()}function CE(){let e=bE,t=e.skills.filter(t=>e.selectedSet.has(t.name)).map(e=>e.name),n=new Set(t),r=[...e.selectedSet].filter(e=>!n.has(e)),i=[...t,...r];return i.length>0?i:null}async function wE(){let e=document.getElementById(`agentModelList`);if(e)return new Promise(t=>{chrome.storage.local.get([`customModels`],n=>{let r=[];(n.customModels||[]).forEach(e=>{let t;typeof e==`string`?t=e:e&&e.name&&(t=e.name),t&&!r.includes(t)&&r.push(t)}),e.innerHTML=r.map(e=>`<option value="${$(e)}">`).join(``),t()})})}function TE(e){let t=document.getElementById(`agentEditTempPreset`);if(t){for(;t.options.length>1;)t.remove(1);Qt.forEach((e,n)=>{let i=document.createElement(`option`);i.value=n,i.textContent=`${r(e.labelKey)}(${e.temp.toFixed(2)})`,t.appendChild(i)}),e!==void 0&&e>=0?t.value=e:t.value=``}}function EE(){let e=document.getElementById(`agentEditTempPreset`);if(!e||e.value===``)return{temperature:null,topP:null};let t=parseInt(e.value);if(isNaN(t)||t<0||t>=Qt.length)return{temperature:null,topP:null};let n=Qt[t];return{temperature:n.temp,topP:n.topP}}function DE(e,t){if(e==null)return-1;for(let n=0;n<Qt.length;n++){let r=Qt[n];if(Math.abs(r.temp-e)<.001&&Math.abs(r.topP-(t||1))<.001)return n}return-1}async function OE(){let e=document.getElementById(`agentEditModal`);if(!e)return;let t=e.querySelector(`#agentEditId`).value,n=e.querySelector(`#agentEditName`).value.trim(),a=e.querySelector(`#agentEditIcon`).value.trim()||`🤖`,o=e.querySelector(`#agentEditDesc`).value.trim(),s=e.querySelector(`#agentEditPrompt`).value.trim(),c=e.querySelector(`#agentEditAllowSub`).checked,l=vE(),u=yE(),d=CE(),f=e.querySelector(`#agentEditModel`).value.trim()||null,{temperature:p,topP:m}=EE();if(!n){F(r(`agentMgr.nameRequired`),`warning`);return}let h={name:n,icon:a,description:o,systemPrompt:s,allowSubDispatch:c,toolIds:l,skillIds:d,model:f,temperature:p,topP:m};u!==void 0&&(h.mcpExcludedServerIds=u);try{t?(await pt(t,h),t===C.activeAgentId&&u!==void 0&&(C.activeAgentMcpExcludedServerIds=u),F(r(`agentMgr.agentUpdated`),`success`)):F(r(`agentMgr.agentCreated`,{name:(await ht(h)).name}),`success`),await GT(),await KT(),dE(),Qi()}catch(e){i.error(`[AgentMgr] save Agent failed:`,e),F(r(`agentMgr.saveFailed`,{message:e.message}),`error`)}}async function kE(){let e=document.getElementById(`agentEditModal`);if(!e)return;let t=e.querySelector(`#agentEditId`)?.value;if(!t)return;let n=await ft(t);if(await PE(r(`agentMgr.confirmDeleteAgentMessage`,{name:n?n.name:``}),r(`agentMgr.deleteAgentTitle`)))try{await _t(t),F(r(`agentMgr.agentDeleted`),`success`),await GT(),await KT(),dE()}catch(e){i.error(`[AgentMgr] delete Agent failed:`,e),F(r(`agentMgr.deleteFailed`,{message:e.message}),`error`)}}async function AE(e){if(!e)return!1;let t=await ft(e);if(!t||t.isBuiltin)return F(r(`agentMgr.cannotDeleteDefault`),`warning`),!1;if(!await PE(r(`agentMgr.confirmDeleteAgentMessage`,{name:t.name}),r(`agentMgr.deleteAgentTitle`)))return!1;try{return await _t(e),F(r(`agentMgr.agentDeleted`),`success`),await GT(),await KT(),!0}catch(e){return i.error(`[AgentMgr] delete Agent failed:`,e),F(r(`agentMgr.deleteFailed`,{message:e.message}),`error`),!1}}async function jE(e=C.activeAgentId){return e?await ft(e):null}function ME(e){return e?e.toolIds:null}function NE(e){if(!e)return``;let t=document.createElement(`div`);return t.textContent=e,t.innerHTML}function $(e){return e?e.replace(/["&<>]/g,e=>({'"':`"`,"&":`&`,"<":`<`,">":`>`})[e]):``}async function PE(e,t){return typeof window.showCustomConfirm==`function`?window.showCustomConfirm(e,t):new Promise(n=>{let i=document.getElementById(`agentConfirmModal`);if(!i){n(confirm(e));return}i.querySelector(`#agentConfirmMessage`).textContent=e,i.querySelector(`#agentConfirmTitle`).textContent=t||r(`agentMgr.confirm`),i.style.display=`flex`;let a=()=>{i.style.display=`none`,i.querySelector(`#agentConfirmOk`).removeEventListener(`click`,o),i.querySelector(`#agentConfirmCancel`).removeEventListener(`click`,s),i.removeEventListener(`click`,c)},o=()=>{a(),n(!0)},s=()=>{a(),n(!1)},c=e=>{e.target===i&&(a(),n(!1))};i.querySelector(`#agentConfirmOk`).addEventListener(`click`,o),i.querySelector(`#agentConfirmCancel`).addEventListener(`click`,s),i.addEventListener(`click`,c)})}n(`zh`,{contextUsage:{indicatorTitle:`上下文占用 {percent}%({used} / {total} tokens)· 点击查看详情`,memoryOffToast:`记忆已关闭,无可压缩内容`,generatingToast:`正在生成回复,请稍后再试`,nothingToCompactToast:`没有新的消息可压缩`,confirmTitle:`压缩上下文`,confirmMessage:`将压缩 {count} 条历史消息(约 {tokens} tokens)为一份摘要{summaryHint}。原始消息仍保留在会话中,发送新消息前可撤销。`,confirmWithOldSummary:`(含已有摘要,将合并为新摘要)`,confirmOk:`开始压缩`,compactingTitle:`正在压缩上下文`,compactingHint:`正在调用模型生成摘要,请稍候…(通常需要几秒到十几秒)`,compactDone:`压缩完成,节约约 {saved} tokens`,compactErrConfig:`无法压缩:API 配置缺失`,compactErrFailed:`压缩失败,请稍后重试`,compactErrEmpty:`模型未返回摘要内容`,compactErrHttp:`接口错误 HTTP {status}`,compactErrTimeout:`请求超时`,autoCompactedToast:`上下文接近上限,已自动压缩(预计省 {saved} tokens)`,undoTitle:`撤销压缩`,undoMessage:`撤销后,发送将恢复携带完整历史。确定撤销吗?`,undoOk:`撤销`,undoDone:`已撤销压缩`,dividerText:`⬆ 上方 {count} 条消息已压缩为摘要`,dividerView:`查看`,dividerUndo:`撤销`,popupTitle:`上下文占用明细`,rowSystem:`系统提示词`,rowTools:`工具定义`,rowHistory:`历史消息`,rowInput:`当前输入`,historyMeta:`选中 {selected} 条 / 共 {total} 条`,historyTrimmed:`为控制预算裁剪了 {count} 条(以规则摘要替代)`,refInfo:`输出预留 {output} · 安全余量 {safety}(不计入上方占用)`,memoryLabel:`记忆设置`,memoryAll:`携带全部历史`,memoryLimited:`携带最近 {n} 条`,memoryOff:`不携带历史(仅当前消息)`,compactionActive:`已压缩 {count} 条历史 · 摘要约 {tokens} tokens`,compactionInvalidHint:`压缩点已失效(对应消息已被删除),本次发送未使用压缩`,removeInvalid:`移除失效的压缩记录`,btnCompact:`压缩上下文`,btnCompactAgain:`再次压缩`,btnUndoCompact:`撤销压缩`,undoExpiredToast:`已发送新消息,无法再撤销压缩(可再次压缩合并更新)`,summaryTitle:`上下文摘要(压缩 {count} 条历史)`,summaryTabPreview:`预览`,summaryTabSource:`源码`}}),n(`en`,{contextUsage:{indicatorTitle:`Context usage {percent}% ({used} / {total} tokens) · Click for details`,memoryOffToast:`Memory is off, nothing to compact`,generatingToast:`Generating a reply, please try again later`,nothingToCompactToast:`No new messages to compact`,confirmTitle:`Compact Context`,confirmMessage:`Compact {count} history messages (~{tokens} tokens) into a summary{summaryHint}. Original messages remain in the session; undo is available before sending new messages.`,confirmWithOldSummary:` (including the existing summary, which will be merged into a new one)`,confirmOk:`Start Compaction`,compactingTitle:`Compacting Context`,compactingHint:`Generating a summary with the model, please wait… (usually takes a few seconds)`,compactDone:`Compaction complete, saved ~{saved} tokens`,compactErrConfig:`Cannot compact: API configuration missing`,compactErrFailed:`Compaction failed, please try again later`,compactErrEmpty:`the model returned no summary`,compactErrHttp:`API error HTTP {status}`,compactErrTimeout:`request timed out`,autoCompactedToast:`Context is near its limit; auto-compacted (est. {saved} tokens saved)`,undoTitle:`Undo Compaction`,undoMessage:`After undo, sending will include the full history again. Undo?`,undoOk:`Undo`,undoDone:`Compaction undone`,dividerText:`⬆ {count} messages above compacted into a summary`,dividerView:`View`,dividerUndo:`Undo`,popupTitle:`Context Usage Details`,rowSystem:`System prompt`,rowTools:`Tool definitions`,rowHistory:`History messages`,rowInput:`Current input`,historyMeta:`Selected {selected} / {total} total`,historyTrimmed:`{count} messages trimmed for budget (replaced by rule summary)`,refInfo:`Output reserve {output} · Safety margin {safety} (not counted above)`,memoryLabel:`Memory setting`,memoryAll:`Carry all history`,memoryLimited:`Carry latest {n} messages`,memoryOff:`No history (current message only)`,compactionActive:`{count} messages compacted · summary ~{tokens} tokens`,compactionInvalidHint:`Compaction point is stale (its message was deleted); this send ignores the compaction`,removeInvalid:`Remove stale compaction record`,btnCompact:`Compact Context`,btnCompactAgain:`Compact Again`,btnUndoCompact:`Undo Compaction`,undoExpiredToast:`New messages have been sent; compaction can no longer be undone (you can compact again)`,summaryTitle:`Context Summary ({count} messages compacted)`,summaryTabPreview:`Preview`,summaryTabSource:`Source`}});var FE=300,IE=``,LE=0,RE=null;async function zE(){try{let{mcpTools:e}=await chrome.storage.local.get([`mcpTools`]),t=e||[],n=new Set(Array.isArray(C.mcpClosedServers)?C.mcpClosedServers:[]),r=new Set(Array.isArray(C.activeAgentMcpExcludedServerIds)?C.activeAgentMcpExcludedServerIds:[]);return t.filter(e=>{let t=e.serverId||`unknown`;return!n.has(t)&&!r.has(t)}).length}catch{return 0}}function BE(){let e=document.getElementById(`userInput`)?.value||``;return{usage:on({model:C.currentModel,customModelMap:C.customModelMap,systemPromptText:IE,toolCount:(C.useTools?C.enabledTools.length:0)+LE,history:C.messageHistory,inputText:e,maxMemoryMessages:C.chatConfig?.maxMemoryMessages??null,compaction:C.activeCompaction,isolateChat:C.isolateChat}),inputText:e}}function VE(e){let t=document.getElementById(`contextUsageIndicator`);if(!t)return;t._lastUsage=e,t.dataset.level=e.level;let n=Math.round(e.ratio*100),i=t.querySelector(`.context-usage-percent`);i&&(i.textContent=`${n}%`),t.style.setProperty(`--usage-ratio`,String(Math.min(Math.max(e.ratio,0),1))),t.title=r(`contextUsage.indicatorTitle`,{percent:n,used:I(e.usedTokens),total:I(e.contextWindow)})}function HE(){try{let{usage:e}=BE();return VE(e),eD(),e}catch(e){return i.warn(`[ContextIndicator] update failed:`,e?.message),null}}function UE(){clearTimeout(RE),RE=setTimeout(()=>HE(),FE)}async function WE(e=null){let t=e===null?C.activeSessionId:e;try{IE=await Ke(await jE(),{sessionId:t})}catch(e){i.warn(`[ContextIndicator] refresh system prompt failed:`,e?.message)}try{LE=await zE()}catch{LE=0}HE()}function GE(){let e=document.getElementById(`contextUsageIndicator`);e&&(e.addEventListener(`click`,()=>iD()),document.getElementById(`userInput`)?.addEventListener(`input`,UE),document.addEventListener(`generating-state-changed`,()=>{WE()}),document.addEventListener(`agent-model-changed`,()=>{WE()}),document.addEventListener(`session-switched`,()=>{WE()}),document.addEventListener(`session-workdir-changed`,()=>{WE()}),chrome.storage.onChanged.addListener((e,t)=>{t===`local`&&((e.chatMaxMemoryMessages||e.isolateChat)&&UE(),(e.modelName||e.customModels)&&UE(),(e.isolateChat||e.mcpTools||e.mcpEnabled||e.enabledTools||e.enableTools)&&WE())}),WE())}function KE({title:e,message:t,okText:n}){return new Promise(i=>{let a=document.createElement(`div`);a.className=`modal-overlay show`,a.style.zIndex=`10200`,a.innerHTML=`
|
|
2109
2109
|
<div class="modal-container">
|
|
2110
2110
|
<div class="modal-title"></div>
|
|
2111
2111
|
<div class="modal-message"></div>
|
|
@@ -2113,20 +2113,20 @@ Sessions using this assistant will revert to the default assistant.`,deleteAgent
|
|
|
2113
2113
|
<button class="modal-btn cancel">${r(`common.cancel`)}</button>
|
|
2114
2114
|
</div>
|
|
2115
2115
|
</div>
|
|
2116
|
-
`,a.querySelector(`.modal-title`).textContent=e,a.querySelector(`.modal-message`).textContent=t;let o=a.querySelector(`.modal-actions`),s=document.createElement(`button`);s.className=`modal-btn confirm`,s.textContent=n,o.appendChild(s),document.body.appendChild(a);let c=e=>{a.remove(),i(e)};a.querySelector(`.modal-btn.cancel`).addEventListener(`click`,()=>c(!1)),s.addEventListener(`click`,()=>c(!0)),a.addEventListener(`click`,e=>{e.target===a&&c(!1)})})}function
|
|
2116
|
+
`,a.querySelector(`.modal-title`).textContent=e,a.querySelector(`.modal-message`).textContent=t;let o=a.querySelector(`.modal-actions`),s=document.createElement(`button`);s.className=`modal-btn confirm`,s.textContent=n,o.appendChild(s),document.body.appendChild(a);let c=e=>{a.remove(),i(e)};a.querySelector(`.modal-btn.cancel`).addEventListener(`click`,()=>c(!1)),s.addEventListener(`click`,()=>c(!0)),a.addEventListener(`click`,e=>{e.target===a&&c(!1)})})}function qE(){let e=document.createElement(`div`);return e.className=`modal-overlay show context-usage-compacting-overlay`,e.style.zIndex=`10200`,e.innerHTML=`
|
|
2117
2117
|
<div class="modal-container context-usage-compacting-modal">
|
|
2118
2118
|
<div class="context-usage-compacting-spinner"></div>
|
|
2119
2119
|
<div class="modal-title"></div>
|
|
2120
2120
|
<div class="modal-message"></div>
|
|
2121
2121
|
</div>
|
|
2122
|
-
`,e.querySelector(`.modal-title`).textContent=r(`contextUsage.compactingTitle`),e.querySelector(`.modal-message`).textContent=r(`contextUsage.compactingHint`),document.body.appendChild(e),{close:()=>e.remove()}}function
|
|
2122
|
+
`,e.querySelector(`.modal-title`).textContent=r(`contextUsage.compactingTitle`),e.querySelector(`.modal-message`).textContent=r(`contextUsage.compactingHint`),document.body.appendChild(e),{close:()=>e.remove()}}function JE(e){let t=String(e||``);if(t===`empty_summary`)return r(`contextUsage.compactErrEmpty`);if(t.includes(`CHAT_STREAM_IDLE_TIMEOUT`))return r(`contextUsage.compactErrTimeout`);if(t.startsWith(`http_`)){let e=t.slice(5),n=e.indexOf(`:`),i=r(`contextUsage.compactErrHttp`,{status:n<0?e:e.slice(0,n)}),a=n<0?``:e.slice(n+1).trim();if(!a)return i;let o=a;try{let e=JSON.parse(a);o=e?.error?.message||e?.message||a}catch{}return`${i}: ${String(o).slice(0,200)}`}return t.includes(`超时`)||/timeout/i.test(t)?r(`contextUsage.compactErrTimeout`):t}async function YE({silent:e=!1}={}){if(!C.isolateChat)return e||F(r(`contextUsage.memoryOffToast`),`warning`),{success:!1,reason:`memory_off`};if(C.isGenerating)return e||F(r(`contextUsage.generatingToast`),`warning`),{success:!1,reason:`generating`};let t=C.messageHistory;if(!t.length)return e||F(r(`contextUsage.nothingToCompactToast`),`warning`),{success:!1,reason:`nothing_to_compact`};let n=C.activeCompaction,{material:a,includedCount:o,hasOldSummary:c}=sn(t,{maxMemoryMessages:C.chatConfig?.maxMemoryMessages??null,compaction:n});if(o===0)return e||F(r(`contextUsage.nothingToCompactToast`),`warning`),{success:!1,reason:`nothing_to_compact`};let l=E(a.map(e=>({role:e.role,content:e.content})));if(!e&&!await KE({title:r(`contextUsage.confirmTitle`),message:r(`contextUsage.confirmMessage`,{count:o,tokens:I(l),summaryHint:c?r(`contextUsage.confirmWithOldSummary`):``}),okText:r(`contextUsage.confirmOk`)}))return{success:!1,reason:`cancelled`};let u=e?null:qE();try{let i=await chrome.runtime.sendMessage({type:`COMPACT_CONTEXT_SUMMARY`,material:a,model:C.currentModel,sessionId:C.activeSessionId,persistSummaryToMemory:C.chatConfig?.persistSummaryToMemory!==!1,compressedCount:(n?.compressedCount||0)+o,revision:(n?.revision||0)+1,memoryId:n?.memoryId||null});if(!i?.success||!i.summary){if(!e)if(i?.error===`config_missing`)F(r(`contextUsage.compactErrConfig`),`error`);else{let e=JE(i?.error);F(`${r(`contextUsage.compactErrFailed`)}${e?`(${e})`:``}`,`error`)}return{success:!1,reason:i?.error||`failed`}}let c=t[t.length-1],u=s(i.summary);return C.activeCompaction={summary:i.summary,upToMessageId:c?.messageId,compressedCount:(n?.compressedCount||0)+o,summaryTokens:u,savedTokens:Math.max(l-u,0),model:C.currentModel,createdAt:Date.now(),revision:(n?.revision||0)+1,memoryId:i.memoryId||n?.memoryId||null},await ni(),tD(),HE(),Yc(),e?F(r(`contextUsage.autoCompactedToast`,{saved:I(C.activeCompaction.savedTokens)}),`info`):F(r(`contextUsage.compactDone`,{saved:I(C.activeCompaction.savedTokens)}),`success`),{success:!0,savedTokens:C.activeCompaction.savedTokens}}catch(t){if(i.warn(`[ContextIndicator] compaction failed:`,t?.message),!e){let e=JE(t?.message);F(`${r(`contextUsage.compactErrFailed`)}${e?`(${e})`:``}`,`error`)}return{success:!1,reason:`exception`}}finally{u?.close()}}async function XE(){await YE({silent:!1})}function ZE(){let e=C.activeCompaction;if(!e?.upToMessageId)return!1;let t=C.messageHistory||[],n=t.findIndex(t=>t.messageId===e.upToMessageId);return n>=0&&n<t.length-1}async function QE(e=!1){if(C.activeCompaction){if(ZE()){F(r(`contextUsage.undoExpiredToast`),`warning`);return}!e&&!await KE({title:r(`contextUsage.undoTitle`),message:r(`contextUsage.undoMessage`),okText:r(`contextUsage.undoOk`)})||(C.activeCompaction=null,await ni(),$E(),HE(),F(r(`contextUsage.undoDone`),`success`))}}function $E(){document.querySelectorAll(`.compaction-divider`).forEach(e=>e.remove())}function eD(){let e=ZE();document.querySelectorAll(`.compaction-divider [data-action="undo"]`).forEach(t=>{t.style.display=e?`none`:``})}function tD(){$E();let e=C.activeCompaction;if(!e?.upToMessageId)return;let t=document.getElementById(`chatContainer`);if(!t)return;let n=t.querySelector(`[data-message-id="${CSS.escape(e.upToMessageId)}"]`);if(!n)return;let i=document.createElement(`div`);i.className=`compaction-divider`;let a=!ZE();i.innerHTML=`
|
|
2123
2123
|
<span class="compaction-divider-text">${r(`contextUsage.dividerText`,{count:e.compressedCount})}</span>
|
|
2124
2124
|
<button class="compaction-divider-btn" data-action="view">${r(`contextUsage.dividerView`)}</button>
|
|
2125
2125
|
${a?`<button class="compaction-divider-btn" data-action="undo">${r(`contextUsage.dividerUndo`)}</button>`:``}
|
|
2126
|
-
`,i.querySelector(`[data-action="view"]`).addEventListener(`click`,()=>
|
|
2126
|
+
`,i.querySelector(`[data-action="view"]`).addEventListener(`click`,()=>aD(e)),i.querySelector(`[data-action="undo"]`)?.addEventListener(`click`,()=>QE()),n.after(i)}var nD=null;function rD(){document.querySelectorAll(`.context-usage-popup`).forEach(e=>e.remove());let e=document.getElementById(`contextUsageIndicator`);e&&(e._ctxPopupOpen=!1),nD&&=(document.removeEventListener(`click`,nD),null)}function iD(){let e=document.getElementById(`contextUsageIndicator`);if(!e)return;if(e._ctxPopupOpen){rD();return}rD(),e._ctxPopupOpen=!0;let{usage:t}=BE(),n=t.breakdown,i=Math.round(t.ratio*100),a;a=C.isolateChat?C.chatConfig?.maxMemoryMessages>0?r(`contextUsage.memoryLimited`,{n:C.chatConfig.maxMemoryMessages}):r(`contextUsage.memoryAll`):r(`contextUsage.memoryOff`);let o=C.activeCompaction,s;s=o&&n.compactionApplied?`
|
|
2127
2127
|
<div class="context-usage-compaction">
|
|
2128
2128
|
<div class="context-usage-dim">${r(`contextUsage.compactionActive`,{count:o.compressedCount,tokens:I(o.summaryTokens)})}</div>
|
|
2129
|
-
${
|
|
2129
|
+
${ZE()?`<button class="context-usage-btn primary" data-action="compact">${r(`contextUsage.btnCompactAgain`)}</button>`:`<button class="context-usage-btn danger-ghost" data-action="undo">${r(`contextUsage.btnUndoCompact`)}</button>`}
|
|
2130
2130
|
</div>`:n.compactionInvalid?`
|
|
2131
2131
|
<div class="context-usage-compaction">
|
|
2132
2132
|
<div class="context-usage-warn">${r(`contextUsage.compactionInvalidHint`)}</div>
|
|
@@ -2159,7 +2159,7 @@ Sessions using this assistant will revert to the default assistant.`,deleteAgent
|
|
|
2159
2159
|
</div>
|
|
2160
2160
|
${s}
|
|
2161
2161
|
</div>
|
|
2162
|
-
`,document.body.appendChild(u);let d=e.getBoundingClientRect();u.style.left=`${Math.max(d.left,8)}px`,u.style.bottom=`${window.innerHeight-d.top+6}px`,u.querySelector(`.context-usage-popup-close`).addEventListener(`click`,()=>
|
|
2162
|
+
`,document.body.appendChild(u);let d=e.getBoundingClientRect();u.style.left=`${Math.max(d.left,8)}px`,u.style.bottom=`${window.innerHeight-d.top+6}px`,u.querySelector(`.context-usage-popup-close`).addEventListener(`click`,()=>rD()),u.querySelector(`[data-action="compact"]`)?.addEventListener(`click`,()=>{rD(),XE()}),u.querySelector(`[data-action="undo"]`)?.addEventListener(`click`,()=>{rD(),QE(!0)}),u.querySelector(`[data-action="remove-invalid"]`)?.addEventListener(`click`,async()=>{rD(),C.activeCompaction=null,await ni(),$E(),HE()}),nD=e=>{e.target.closest(`.context-usage-popup, #contextUsageIndicator`)||rD()},setTimeout(()=>document.addEventListener(`click`,nD),0)}function aD(e=C.activeCompaction){if(!e?.summary)return;let t=document.createElement(`div`);t.className=`modal-overlay show`,t.style.zIndex=`10200`,t.innerHTML=`
|
|
2163
2163
|
<div class="modal-container context-usage-summary-modal">
|
|
2164
2164
|
<button type="button" class="context-usage-summary-close" title="${r(`common.close`)}">×</button>
|
|
2165
2165
|
<div class="modal-title">${r(`contextUsage.summaryTitle`,{count:e.compressedCount})}
|
|
@@ -2170,4 +2170,4 @@ Sessions using this assistant will revert to the default assistant.`,deleteAgent
|
|
|
2170
2170
|
</div>
|
|
2171
2171
|
<div class="context-usage-summary-body"></div>
|
|
2172
2172
|
</div>
|
|
2173
|
-
`,document.body.appendChild(t);let n=t.querySelector(`.context-usage-summary-body`),i=t.querySelectorAll(`.context-usage-summary-tab`),a=t=>{i.forEach(e=>e.classList.toggle(`active`,e.dataset.mode===t)),t===`preview`?(n.classList.add(`markdown-body`),n.innerHTML=et(e.summary),it()):(n.classList.remove(`markdown-body`),n.textContent=e.summary)};i.forEach(e=>e.addEventListener(`click`,()=>a(e.dataset.mode))),a(`preview`),t.querySelector(`.context-usage-summary-close`).addEventListener(`click`,()=>t.remove()),t.addEventListener(`click`,e=>{e.target===t&&t.remove()})}export{
|
|
2173
|
+
`,document.body.appendChild(t);let n=t.querySelector(`.context-usage-summary-body`),i=t.querySelectorAll(`.context-usage-summary-tab`),a=t=>{i.forEach(e=>e.classList.toggle(`active`,e.dataset.mode===t)),t===`preview`?(n.classList.add(`markdown-body`),n.innerHTML=et(e.summary),it()):(n.classList.remove(`markdown-body`),n.textContent=e.summary)};i.forEach(e=>e.addEventListener(`click`,()=>a(e.dataset.mode))),a(`preview`),t.querySelector(`.context-usage-summary-close`).addEventListener(`click`,()=>t.remove()),t.addEventListener(`click`,e=>{e.target===t&&t.remove()})}export{zC as $,Tc as $n,Rb as $t,tT as A,td as An,or as Ar,nS as At,Vw as B,pd as Bn,hn as Br,db as Bt,FT as C,zp as Cn,oi as Cr,OS as Ct,Jw as D,Qf as Dn,lr as Dr,YS as Dt,Kw as E,np as En,dr as Er,GS as Et,Sw as F,Yd as Fn,yr as Fr,tx as Ft,Hw as G,au as Gn,Qt as Gr,Db as Gt,ZC as H,Sd as Hn,cn as Hr,Gb as Ht,Mw as I,Fd as In,br as Ir,Zb as It,qC as J,Dl as Jn,gb as Jt,bw as K,Bu as Kn,fb as Kt,Ew as L,Nd as Ln,Tr as Lr,ix as Lt,qw as M,hd as Mn,pr as Mr,yx as Mt,Xw as N,id as Nn,mr as Nr,Lx as Nt,fT as O,rp as On,fr as Or,yC as Ot,$w as P,xd as Pn,Er as Pr,vx as Pt,Fw as Q,Hc as Qn,Fb as Qt,kw as R,bd as Rn,cr as Rr,ex as Rt,OT as S,km as Sn,Yr as Sr,vC as St,Uw as T,ip as Tn,hr as Tr,$S as Tt,UC as U,Hu as Un,an as Ur,Sb as Ut,IC as V,Xd as Vn,mn as Vr,Bb as Vt,xw as W,qu as Wn,nn as Wr,xb as Wt,HC as X,el as Xn,kb as Xt,Iw as Y,Ol as Yn,Lb as Yt,Nw as Z,Xc as Zn,Vb as Zt,TT as _,Rm as _n,$i as _r,NC as _t,WT as a,kh as an,qa as ar,yw as at,MT as b,Em as bn,$r as br,lC as bt,wT as c,jv as cn,ta as cr,bC as ct,VT as d,rh as dn,na as dr,kC as dt,qb as en,ac as er,YC as et,DT as f,ah as fn,Bi as fr,PC as ft,zT as g,Zm as gn,Ji as gr,US as gt,ET as h,Qm as hn,qi as hr,HS as ht,HE as i,hy as in,po as ir,QC as it,nT as j,ad as jn,gr as jr,wx as jt,eT as k,Df as kn,ur as kr,_S as kt,NT as l,oh as ln,Ki as lr,jC as lt,BT as m,eh as mn,Zi as mr,MC as mt,GE as n,vb as nn,xo as nr,Dw as nt,uE as o,Xh as on,ea as or,nC as ot,AT as p,th as pn,Xi as pr,yS as pt,$C as q,jl as qn,Ob as qt,YE as r,Mb as rn,mo as rr,VC as rt,LT as s,Av as sn,zi as sr,oC as st,BE as t,mb as tn,Ys as tr,vw as tt,yT as u,nh as un,Ri as ur,iC as ut,IT as v,zm as vn,Yi as vr,aC as vt,xT as w,Lp as wn,L as wr,ZS as wt,_T as x,Om as xn,Zr as xr,wC as xt,CT as y,jm as yn,Qi as yr,cC as yt,jw as z,md as zn,wn as zr,$b as zt};
|