ai_co_discuss 0.3.78 → 0.3.80

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/web/modern.js CHANGED
@@ -52,18 +52,18 @@ Defaulting to \`null\`.`),null)}function Iw(e){return Pw(e)&&!Number.isNaN(e)&&e
52
52
  `);if(e.length<=fJ)continue;n.setStart(t.firstChild,e.slice(0,fJ).join(`
53
53
  `).length)}return n.setEnd(e,e.childNodes.length),n.deleteContents(),!0}return!1}function mr(e){let t={truncated:!1,html:e.rendered_text};if(e.kind===`receipt`)return t;let n=document.createElement(`template`);n.innerHTML=e.rendered_text;let r=pr(n.content),i=document.createTreeWalker(n.content,NodeFilter.SHOW_TEXT,{acceptNode:e=>e.parentElement?.closest(`.katex-mathml`)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),a=[];for(;i.nextNode();)a.push(i.currentNode);let o=[...a.map(e=>e.textContent).join(``).trimEnd()];if(o.length<=uJ)return{truncated:r,html:n.innerHTML};let s=o.slice(0,uJ).join(``),c=[...s.matchAll(/[。!?;]\s*|[.!?;](?:\s|$)|\n/gu)].at(-1),l=c?c.index+c[0].length:0,u=[...s.slice(0,l)].length>=dJ,d=u?l:s.length;for(let e of a){if(d>e.textContent.length){d-=e.textContent.length;continue}let t=n.content.ownerDocument.createRange(),r=e.parentElement?.closest(`.katex`),i=e.parentElement?.closest(`tr`);i?.previousElementSibling?t.setStartBefore(i):i?t.setStartAfter(i):r?t.setStartAfter(r.closest(`.katex-display`)||r):t.setStart(e,d),t.setEnd(n.content,n.content.childNodes.length),t.deleteContents(),!u&&!r&&!i&&(e.textContent+=`…`);break}return{truncated:!0,html:n.innerHTML}}let hr=Q(()=>Cr.value),gr=st(()=>{let e=Date.parse(at.value?.session?.created_at||``);if(!e)return null;let t=hr.value;if(!t.some(e=>!e.slot_card&&Number(e.id)<=at.value.session.started_message_id))return null;let n=t.findIndex(t=>!t.slot_card&&Date.parse(t.created_at)>=e);return n<0&&(n=t.findLastIndex(e=>!e.slot_card)+1),n===0?null:n<t.length?t[n].id:`end`}),_r=st(()=>{let e=at.value?.session;if(e?.status!==`concluded`)return null;let t=hr.value,n=t.findIndex(t=>!t.slot_card&&Number(t.id)>e.ended_message_id);return n<0?`end`:t[n].id}),vr=Q(()=>{if(i.value.query||i.value.mention_only||i.value.host_only)return[];let e=new Map((at.value.free?.members||[]).map(e=>[e.id,e.name]));return(at.value.free?.executions||[]).filter(e=>e.status===`failed`).map(t=>({id:`failed-${t.id}`,author:t.member||e.get(t.member_id)||`成员`,slot_card:!0,created_at:t.created_at,execution_id:t.id,request_message_id:t.request_message_id,anchor_message_id:t.anchor_message_id,discussion_request:t.requests?.find(e=>e.discussion_session_id),failure:{...t,elapsed_seconds:t.finished_at?Math.max(0,t.finished_at-t.created_at):null}})).concat(yr())});function yr(){let e=new Map((at.value.free?.members||[]).filter(e=>e.adopt_error).map(e=>[e.id,e]));return(at.value.free?.requests||[]).filter(t=>t.status===`pending`&&e.has(t.member_id)).map(t=>({id:`undeliverable-${t.id}`,author:e.get(t.member_id).name,slot_card:!0,undeliverable:!0,created_at:t.created_at,request_message_id:t.message_id,failure:{role:e.get(t.member_id).role,result:e.get(t.member_id).adopt_error}}))}let br=I(new Set),xr=st(()=>{let e=new Map,t=new Set,n=null;for(let r of i.value.messages)r.withdrawn===`rewound`?(n===null&&(n=r.id,e.set(n,0)),e.set(n,e.get(n)+1),n!==r.id&&!br.value.has(n)&&t.add(r.id)):n=null;return{runs:e,hidden:t}});function Sr(e){let t=new Set(br.value);t.delete(e)||t.add(e),br.value=t}let Cr=Q(()=>{let e=i.value.messages.filter(e=>!xr.value.hidden.has(e.id)),t=new Set(e.filter(e=>!e.withdrawn).map(e=>e.id)),n=new Map,r=new Map((at.value.free?.executions||[]).map(e=>[e.id,e])),a=[],o=e=>a.findLast(t=>t<=e)??e,s=e=>{if(!e.execution_id&&!e.cancelled_turn&&!e.arrangement&&!e.undeliverable||e.withdrawn)return!1;let i=e.discussion_request||r.get(e.execution_id)?.requests?.find(e=>e.discussion_session_id),a=e.anchor_message_id??e.request_message_id,s=a===e.request_message_id?a:o(a),c=e.arrangement?.after_message_id??e.cancelled_turn?.after_message_id??(i?i.after_message_id:s);return!((i||e.cancelled_turn||e.arrangement)&&c===0)&&!t.has(c)?!1:(n.set(c,[...n.get(c)||[],e]),!0)},c=e.filter(e=>!s(e)&&(t.has(e.id)&&a.push(e.id),!0));if(vr.value.forEach(s),!i.value.query&&!i.value.mention_only&&!i.value.host_only){for(let e of at.value.host_arrangements||[])s({id:e.key||`plan-${e.id}`,slot_card:!0,arrangement:e,created_at:new Date(e.created_at).getTime()/1e3});for(let e of at.value.cancelled_turns||[])s({id:`cancelled-${e.key||e.id}`,author:e.expert,slot_card:!0,cancelled_turn:e,execution_id:e.execution_id,created_at:new Date(e.created_at).getTime()/1e3});let e=new Set((at.value.cancelled_turns||[]).map(e=>e.execution_id));for(let t of r.values()){if(t.status!==`cancelled`||t.answer_id||e.has(t.id))continue;let n=t.requests?.find(e=>e.discussion_session_id);(n||t.capabilities)&&s({id:`stopped-${t.id}`,author:t.member,slot_card:!0,cancelled_execution:t,execution_id:t.id,created_at:t.created_at,request_message_id:t.request_message_id,anchor_message_id:t.anchor_message_id,discussion_request:n})}}let l=vt.value.map(e=>({...e,slot_card:!0})).filter(e=>!s(e)),u=e=>r.get(e.execution_id)?.created_at??(typeof e.created_at==`number`?e.created_at:new Date(e.created_at).getTime()/1e3),d=(e,t)=>u(e)-u(t)||(e.execution_id||0)-(t.execution_id||0),f=[],p=e=>{f.push(e);for(let t of(n.get(e.id)||[]).sort(d))p(t)};return(n.get(0)||[]).sort(d).forEach(p),c.forEach(p),[...f,...l]});function wr(e,t){for(let n=Math.min(t,e.length-1);n>=0;n--)if(!e[n].slot_card)return Number(e[n].id);return 0}let Er=I(null),Dr=Q(()=>{let e=hr.value,t=Er.value??wr(e,e.length-RJ),n=e.findIndex(e=>!e.slot_card&&Number(e.id)>=t);return n>e.findIndex(e=>!e.slot_card)?n:0});z(it,e=>{!e&&Er.value===null&&(Er.value=wr(hr.value,hr.value.length-RJ))});function kr(e){let t=e==null?-1:hr.value.findIndex(t=>t.id===e);return t>=0&&t<Dr.value}let Ar=null,jr=UJ,Mr=!1,Nr=null,Pr=null,Fr=0,Ir=null;function Lr(e){return e.scrollTop<zJ||kr(Pr)||kr(Nr)}function Rr(e=!1){if(!Dr.value||Ar&&(Ar.urgent||!e))return;Ar?.cancel();let t=()=>{Ar=null,zr()};if(e){let n=requestAnimationFrame(t);Ar={urgent:e,cancel:()=>cancelAnimationFrame(n)}}else if(window.requestIdleCallback){let n=requestIdleCallback(t,{timeout:GJ});Ar={urgent:e,cancel:()=>cancelIdleCallback(n)}}else{let n=setTimeout(t,GJ);Ar={urgent:e,cancel:()=>clearTimeout(n)}}}ca(()=>Ar?.cancel());async function zr(){let e=p.value;if(Mr||!e?.clientHeight||!Dr.value)return;let t=Lr(e);if(!t&&(ni.isAnimating()||performance.now()-Fr<KJ))return Rr();Mr=!0;let n=performance.now(),r=e.scrollHeight-e.scrollTop;Er.value=wr(hr.value,Dr.value-jr),await ar(),Ir=e.scrollHeight-r,e.scrollTop!==Ir&&(e.scrollTop=Ir);let i=performance.now()-n,a=kr(Pr)?HJ:t?VJ:BJ;if(jr=Math.max(1,Math.min(WJ,Math.round(jr*a/Math.max(i,1)))),Mr=!1,Pr!==null&&!kr(Pr)){let e=Pr;Pr=null,ui(e)}Rr(Lr(e))}function Br(){p.value?.scrollTop!==Ir&&(Fr=performance.now()),Ir=null}let Vr=st(()=>{let e=[];for(let t of hr.value.slice(Dr.value)){if(t.slot_card&&e.length){e.at(-1).messages.push(t);continue}let n=new Date(t.slot_card?(t.created_at??0)*1e3:t.created_at),r=n.toLocaleDateString();e.at(-1)?.key!==r&&e.push({key:r,label:ln.format(n),messages:[]}),e.at(-1).messages.push(t)}return e}),Hr=Q(()=>{let e=[];for(let t of hr.value.filter(e=>!e.slot_card)){let n=a.round_groups(at.value)?.findLast(e=>e.start_id<=t.id),r=n&&(n.end_id==null||t.id<=n.end_id)?n:null,i=r?.number||0,o=r?.key||`ungrouped`;if(e.at(-1)?.key!==o){let t=i?`第 ${i} 轮`:`未分组`,n=r?`${r.opinions??r.speakers.length}/${r.participants??Object.keys(at.value.experts).length} 人已发言`:`尚无参与专家的观点`;e.push({key:o,number:i,label:t,description:`${t} · ${r?.completed?`已完成`:n}`,messages:[]})}e.at(-1).messages.push(t)}return e}),Ur=Q(()=>Hr.value.find(e=>e.messages.some(e=>e.id===Ne.value))?.number),Wr=st(()=>new Map(Hr.value.filter(e=>e.number).flatMap(e=>e.messages.map(t=>[t.id,e.label])))),Gr=Q(()=>{let e=0;return Hr.value.map(t=>({number:t.number,count:t.messages.length,entries:[{key:`round-${t.messages[0].id}`,round:!0,number:t.number,message:t.messages[0],label:t.description,index:e++},...t.messages.map(n=>({key:`message-${n.id}`,round:!1,message:n,label:`${t.label} · ${a.display_name(n.author)} 的发言 #${n.id}`,index:e++}))]}))}),Kr=Q(()=>Gr.value.flatMap(e=>e.entries));function qr(e){return e.getBoundingClientRect().top+(parseFloat(getComputedStyle(e).getPropertyValue(`--channel-topbar-height`))||0)}let Jr=null,Xr=null;function Zr(e){return Xr?.element!==e&&(Xr?.disconnect(),Jr=null,Xr=Object.assign(new MutationObserver(()=>{Jr=null}),{element:e}),Xr.observe(e,{childList:!0,subtree:!0})),(Xr.takeRecords().length||!Jr)&&(Jr=[...e.querySelectorAll(`[data-message-id]`)]),Jr}ca(()=>Xr?.disconnect());function Qr(){let e=p.value;if(!e||!e.clientHeight||ni.isAnimating()||ti?.stale())return;Rr(Lr(e)),it.value=e.scrollHeight-e.scrollTop-e.clientHeight<LJ;let t=e.getBoundingClientRect(),n=qr(e),r=Zr(e),i=Pe.value!=null&&r.find(e=>Number(e.dataset.messageId)===Pe.value);if(i&&i.getBoundingClientRect().bottom>n&&i.getBoundingClientRect().top<t.bottom){Ne.value=Pe.value;return}Pe.value=null;let a=0,o=r.length;for(;a<o;){let e=a+o>>1;r[e].getBoundingClientRect().bottom>n+qJ?o=e:a=e+1}Ne.value=r[a]?Number(r[a].dataset.messageId):null}let $r=0;function ei(){Br(),$r||=requestAnimationFrame(()=>{$r=0,Qr()})}ca(()=>cancelAnimationFrame($r));let ti=null;aa(()=>{let e=p.value;e&&(ti=nG(e,{reading_top:()=>qr(e),stick_bottom:()=>it.value,after_restore:Qr}))}),ca(()=>ti?.disconnect());let ni=UB(0,Ke);ni.on(`change`,e=>{p.value&&(p.value.scrollTop=e)}),ni.on(`animationComplete`,()=>Qr());async function ri(e=!1){await ar();let t=p.value;if(it.value&&t){let n=t.scrollHeight-t.clientHeight;(e===!0||ni.isAnimating()||i.value.sending_message)&&document.documentElement.dataset.motion!==`off`?(ni.isAnimating()||ni.jump(t.scrollTop),ni.set(n)):t.scrollTop=n}Qr()}z([()=>i.value.messages,vt,vr],()=>ri(),{immediate:!0});let ii=UB(1,Ke),ai=VB(ii,[0,1],[IJ,0]),oi=null,si=Q(()=>i.value.sending_preview?a.render_room_markdown(i.value.sending_preview.text):``);function ci(e){let t=oi&&p.value?.querySelector(`[data-message-id="${oi}"]`);t&&Object.assign(t.style,{opacity:e,transform:`translateY(${IJ*(1-e)}px)`})}ii.on(`change`,ci),ii.on(`animationComplete`,()=>{let e=oi&&p.value?.querySelector(`[data-message-id="${oi}"]`);e&&Object.assign(e.style,{opacity:``,transform:``}),oi=null}),z(()=>!!i.value.sending_preview,e=>{e&&(i.value.sending_preview.failed||(ii.jump(0),ii.set(1)),ri(!0))}),z(()=>i.value.messages,e=>{let t=ii.isAnimating()&&e.findLast(e=>e.just_sent);t&&(oi=t.id,ci(ii.get()))},{flush:`post`}),z([()=>i.value.room?.id,()=>i.value.query,()=>i.value.mention_only,()=>i.value.host_only],()=>{Pe.value=null,Ne.value=null,Ai(),it.value=!0,Er.value=null,Pr=Nr=null}),z(()=>i.value.tab,e=>{Ai(),e===`discussion`&&ri()}),z(()=>i.value.room?.id,()=>m.value.clear());async function li(e,t){let n=t.currentTarget.closest(`[data-message-id]`),r=m.value.has(e.id),i=p.value.scrollTop;it.value=!1,r?m.value.delete(e.id):m.value.add(e.id),Ai(),await ar(),r||(p.value.scrollTop=i),r&&n.getBoundingClientRect().top<qr(p.value)&&(p.value.scrollTop+=n.getBoundingClientRect().top-qr(p.value)-qJ),Qr()}function ui(e){if(kr(e)){ki(),Pr=e,Rr(!0);return}Pr=null;let t=p.value,n=t?.querySelector(`[data-message-id="${e}"]`);n&&(ki(),v.state.following=!1,Pe.value=e,Ne.value=e,t.scrollTop+=n.getBoundingClientRect().top-qr(t)-qJ,n.focus({preventScroll:!0}),Qr())}function di(e){v.state.following&&(e.type!==`keydown`||[`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `].includes(e.key))&&(e.type!==`pointerdown`||e.target===e.currentTarget)&&(v.state.following=!1)}function fi(e){ni.stop(),Pr=null,(e.type!==`keydown`||[`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `].includes(e.key))&&(Pe.value=null)}function B(e,t){let n={ArrowUp:t-1,ArrowDown:t+1,Home:0,End:Kr.value.length-1};if(!Object.hasOwn(n,e.key))return;e.preventDefault();let r=Math.max(0,Math.min(n[e.key],Kr.value.length-1));je.value.querySelectorAll(`button`)[r].focus({preventScroll:!0})}function pi(e){let t=je.value;if(!t?.clientHeight||!e)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();r.top<n.top+AJ?t.scrollTop+=r.top-n.top-AJ:r.bottom>n.bottom-AJ&&(t.scrollTop+=r.bottom-n.bottom+AJ)}async function mi(){await ar(),pi(je.value?.querySelector(`[data-jump-id="${Ne.value}"]`))}z(Ne,mi);function hi(e,t){!We&&t.currentTarget.matches(`:focus-visible`)&&(Me.value=!0,pi(e.round?t.currentTarget.parentElement.querySelector(`[data-jump-id]`):t.currentTarget),Oi(e,t))}function gi(e){Ge=!1,[`touch`,`pen`].includes(e.pointerType)&&!We&&(e.preventDefault(),Ge=!0,Me.value=!1,We={pointer:e.pointerId,start_x:e.clientX,start_y:e.clientY,x:e.clientX,y:e.clientY,moved:!1,key:null},We.frame=requestAnimationFrame(bi),yi())}function _i(e){let t=We;t?.pointer===e.pointerId&&(t.x=e.clientX,t.y=e.clientY,t.moved||=Math.hypot(t.x-t.start_x,t.y-t.start_y)>jJ,yi())}function vi(){let e=je.value.getBoundingClientRect();return We.x<e.left-PJ||We.x>e.right+PJ}function yi(){let e=je.value,t=We;if(!e||!t)return;if(vi()){t.key=null,Re.value=!1;return}let n=e.getBoundingClientRect(),r=Math.max(n.top+AJ,Math.min(t.y,n.bottom-AJ)),i=null,a=1/0;for(let t of e.querySelectorAll(`[data-jump-id]`)){let e=t.getBoundingClientRect(),n=Math.abs((e.top+e.bottom)/2-r);n<a&&([i,a]=[t,n])}let o=i&&`message-${i.dataset.jumpId}`;if(!o||o===t.key&&Re.value)return;let s=Kr.value.find(e=>e.key===o);if(s){if(t.key&&t.key!==o)try{navigator.vibrate?.(FJ)}catch{}t.key=o,Oi(s,{currentTarget:i})}}function bi(){let e=We;if(!e)return;let t=je.value;if(t&&e.moved&&!vi()){let n=t.getBoundingClientRect(),r=Math.min(1,Math.max(0,1-(e.y-n.top)/MJ)),i=Math.min(1,Math.max(0,1-(n.bottom-e.y)/MJ)),a=t.scrollTop;t.scrollTop+=(i-r)*NJ,t.scrollTop!==a&&yi()}e.frame=requestAnimationFrame(bi)}function xi(e){let t=We;if(t?.pointer!==e.pointerId)return;let n=e.type===`pointerup`&&t.key&&Re.value?Kr.value.find(e=>e.key===t.key):null;Si(),ki(),n&&ui(n.message.id)}function Si(){We&&cancelAnimationFrame(We.frame),We=null}function Ci(e,t){[`touch`,`pen`].includes(t.pointerType)||t.type===`pointerenter`&&Me.value||(Me.value=!1,(Ie.value!==e.key||!Re.value)&&Oi(e,t))}function wi(e,t){Ge&&t.detail!==0?(Ge=!1,t.preventDefault()):ui(e.message.id)}function Ti(e){We&&e.preventDefault()}function Ei(e){(e.deltaX||e.deltaY)&&(Me.value=!1,ki())}function Di(){ki(),v.state.following=!1,Pe.value=null,it.value=!0,Pr=null,ri()}async function Oi(e,t){let n=e.message,r=t.currentTarget.getBoundingClientRect(),i=je.value.getBoundingClientRect(),a=Math.min(mJ,innerWidth-24),o=i.right+_J;if(Be.value=Math.max(gJ,Math.min(o,innerWidth-a-gJ)),Fe.value=n.id,Nr=n.id,kr(n.id)&&Rr(!0),Ie.value=e.key,Le.value=e.round,Re.value=!0,await ar(),!Re.value||Ie.value!==e.key)return;He.value=ze.value.scrollHeight+hJ;let s=(Math.max(r.top,i.top+AJ)+Math.min(r.bottom,i.bottom-AJ))/2-He.value/2;Ve.value=Math.max(gJ,Math.min(s,innerHeight-He.value-gJ));let c=Ye.get()===0;qe[c?`jump`:`set`](Ve.value),Je[c?`jump`:`set`](He.value)}function ki(e){e?.relatedTarget?.closest?.(`.channel-message-map, .channel-nav-preview`)||(Re.value=!1)}function Ai(){Si(),Re.value=!1,Ye.jump(0),Fe.value=null}async function ji(){Ai(),r?.measure(),await ri(),await mi()}function Mi(e){let t=e.entries.length-1;return Math.max(-3,Math.min(t+wJ,nt.value-e.entries[0].index))}function Ni(e,t){let n=nt.value<0?1/0:Math.abs(t-nt.value),r=Math.max(0,1-n/wJ),i=Ne.value===e.message.id,a=n===0||i&&nt.value<0,o=yJ;return{transform:`scaleX(${a?bJ/o:i?xJ/o:1+r*TJ/o})`,height:`${a?CJ:SJ}px`,opacity:a?OJ:i?DJ:EJ+r*kJ}}z(Re,e=>Ye.set(+!!e)),aa(()=>window.addEventListener(`resize`,ji)),ca(()=>window.removeEventListener(`resize`,ji));function Pi(){let e=rt.value?.textareaRef;if(!e)return;e.rows=1;let t=getComputedStyle(e),n=(e.scrollHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom))/parseFloat(t.lineHeight);e.rows=Math.min(Math.max(Math.floor(n),1),Yq)}let Fi=0,Ii=new ResizeObserver(([e])=>{Math.round(e.contentRect.width)!==Fi&&(Fi=Math.round(e.contentRect.width),Pi())});aa(()=>rt.value?.textareaRef&&Ii.observe(rt.value.textareaRef)),ca(()=>Ii.disconnect()),ca(Si);let Li=I(``),Ri;function zi(){clearTimeout(Ri),Li.value=``}async function Bi(e){let t=at.value.id;zi(),await s(`copy_member_launch`,e)&&at.value?.id===t&&(Li.value=e,Ri=setTimeout(zi,tY))}z([()=>at.value?.id,()=>lt.value?.id],zi),ca(zi);function Vi(e){if(!i.value.access?.can_manage)return null;let t=e.requests?.find(e=>e.discussion_session_id),n=t?t.source_message_id:e.request_message_id;return i.value.messages.find(e=>e.id===n&&!e.withdrawn&&(!t||e.author===`用户`))}function Hi(e){return e.status===`failed`?Vi(e):null}function Ui(e){return!!(i.value.access?.can_manage&&e.requests?.length&&!e.requests.some(e=>e.discussion_session_id))}function Wi(e){let t=Vi(e);if(!t)return;let n=(at.value.free?.requests||[]).find(t=>e.request_ids?.includes(t.id));l.value=n?.purpose===`ask`&&n.member?`@${n.member} ${t.text}`:t.text,rt.value?.textareaRef?.focus()}function Gi(e){let t=(at.value.free?.members||[]).find(t=>t.id===e.member_id)?.name,n=[...new Set((e.denials||[]).map(e=>e.rule).filter(Boolean))];return t&&n.length&&i.value.launch?.available&&Vi(e)?{name:t,rules:n}:null}let Ki=I(0),qi=I({});async function Ji(e){let t=Gi(e);if(t&&!Ki.value){Ki.value=e.id,qi.value={...qi.value,[e.id]:``};try{await a.allow_denials(t),Wi(e)}catch(t){qi.value={...qi.value,[e.id]:t.message}}finally{Ki.value=0}}}function Yi(e){return[[...Qi(e)||Xi(e)?[{label:`回复`,icon:`i-lucide-corner-up-left`,onSelect:()=>xa(e)}]:[],...M.value&&e.kind!==`receipt`&&ta.value.id!==e.id?[v.state.message_id===e.id?{label:`停止朗读`,icon:`i-lucide-square`,onSelect:()=>v.stop()}:{label:`朗读`,icon:`i-lucide-volume-2`,onSelect:()=>v.start(e.id)}]:[],{label:`复制原文链接`,icon:`i-lucide-link`,onSelect:()=>Ta(e)},{label:`查看原文`,icon:`i-lucide-expand`,onSelect:()=>n(`detail`,e.id)},...Zi(e)&&e.author!==`用户`?[{label:`从这里分支`,icon:`i-lucide-git-branch`,onSelect:()=>s(`fork_room`,e.id)}]:[]]]}let Xi=e=>!!(i.value.access?.can_manage&&Et(e)&&ta.value.id!==e.id),Zi=e=>mt.value&&i.value.access?.can_manage&&!e.withdrawn&&!(at.value.session?.started_message_id>=e.id)&&!(at.value.discussions||[]).some(t=>[`active`,`paused`].includes(t.status)||t.started_message_id>=e.id),Qi=e=>Zi(e)&&e.author===`用户`&&!at.value.archived,$i=e=>Qi(e)&&(i.value.messages.at(-1)?.id===e.id||!(at.value.free?.requests||[]).some(t=>t.message_id===e.id&&[`delivering`,`completed`,`failed`].includes(t.status))),ea={id:0,text:``,plan:null,error:``},ta=I(ea),na=I(null);async function ra(e){na.value=e.member_id;try{await s(`change_member`,{member_id:e.member_id,name:e.author,action:`interrupt`})}finally{na.value=null}}let ia=Object.freeze([]),oa=I(0);async function sa(e){oa.value=e;try{await s(`retract_message`,e)}finally{oa.value=0}}let la={content:`channel-key-tip`},ua=nn(new Set),da=I(0),fa=(e,{slots:t})=>t.default?.();function pa(e,t){t.pointerType===`mouse`&&ua.add(e)}function ma(e){ua.add(e),da.value=e}function ha(e){let t=Et(e),n=Kt.value.get(e.id),r=ta.value.id===e.id,a=qt(e),o={message:e,identity_version:i.value.admin?.identity_version,narrow:M.value,reading:v.state.message_id===e.id,can_branch:Zi(e),can_take_back:Qi(e),can_retract:$i(e),retracting:oa.value===e.id,private_chat:Xi(e),editing:r,editing_plan:r&&ta.value.plan,editing_error:r&&ta.value.error,editing_pending:r&&c.value,round_label:Wr.value.get(e.id),expanded:m.value.has(e.id),preview:Ae.value.get(e.id),marks:de.value.get(e.id)||ia,waits:a,speaking_expert:a?lt.value?.expert:null,badges:Gt.value.get(e.id)||ia,elapsed:cn(e),recommendation:Zt.value.get(e.id),adopting:Xt.value===e.id,execution_id:t?.id,notes_count:t?.notes,notes:t?yt.value.get(t.id):void 0,reports:n||ia,allowing:n?Ki.value:0,allow_errors:n?qi.value:null,launch_available:n?i.value.launch?.available:null,report_messages:n?i.value.messages:null,armed:ua.has(e.id),menu_open:da.value===e.id};return o.deps=Object.values(o),o.actions=Yi(e),o.report_rows=o.reports.map(e=>({report:e,allowable:!!Gi(e),failed:!!Hi(e)})),o}async function ga(e){ta.value={...ea,id:e.id,text:e.text};try{let t=await a.rewind_plan(e.id);ta.value.id===e.id&&(ta.value={...ta.value,plan:t})}catch(t){ta.value.id===e.id&&(ta.value={...ta.value,error:t.message})}}function _a(){ta.value=ea}async function ya(){let{id:e,text:t,plan:n}=ta.value;n&&t.trim()&&!c.value&&(it.value=!0,await s(`rewind_and_send`,{message_id:e,revision:n.revision,text:t.trim()})&&_a())}function ba(e){let t=t=>e.members.filter(e=>e.session===t).map(e=>a.display_name(e.name)).join(`、`);return[`将回退 ${e.messages} 条记录(含这条),进行中的工作会停止`,t(`cut`)&&`${t(`cut`)} 的会话退回到这条消息之前`,t(`kept`)&&`${t(`kept`)} 的会话在其自己的窗口中,无法由本机回退`,`成员已改动的文件不会撤销`].filter(Boolean).join(`;`)+`。`}async function xa(e){await s(`reply`,e),rt.value?.textareaRef?.focus()}async function Sa(){if(!Mt.value||c.value||i.value.sending_message)return;hn.value=null,it.value=!0;let e=l.value,t=[At(),YW(jt.value)].filter(Boolean).join(`
54
54
 
55
- `);t&&(l.value=e.trim()?`${e.trimEnd()}\n\n${t}`:t);let n=l.value;await s(`send`),t&&l.value===n?l.value=e:t&&(kt.value=[],OW.excerpts=[]),await ri()}let H=0;function Ca(e){e.key!==`Escape`||e.isComposing||e.defaultPrevented||(e.target!==rt.value?.textareaRef&&e.target!==document.body||Mt.value&&!i.value.sending_message||i.value.sending_preview?.failed?H=0:e.timeStamp-H>Zq?H=e.timeStamp:(H=0,e.preventDefault(),a.execute(`retract_latest`)))}aa(()=>window.addEventListener(`keydown`,Ca)),ca(()=>window.removeEventListener(`keydown`,Ca));function wa(e){e.defaultPrevented||!RU||e.key!==`Enter`||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||e.isComposing||l.value.trim()||(i.value.attachment_drafts.length||kt.value.length||jt.value.length)&&(e.preventDefault(),e.stopPropagation(),Sa())}function Ta(e){s(`copy`,`${i.value.room_site}/r/${at.value.id}/messages/${e.id}`)}return(e,t)=>{let o=bA,h=tA,g=Yk,_=IV,w=PV,T=uV,D=MV,O=kV,A=cV,ee=xV;return W(),G(`section`,oG,[L(i).query||L(i).mention_only||L(i).host_only?(W(),G(`div`,sG,[q(`span`,null,F([L(i).query&&`“${L(i).query}”`,L(i).host_only&&`只看主持`,L(i).mention_only&&`@${L(a).display_name(e.author)}`].filter(Boolean).join(` · `))+` · `+F(L(i).total)+` 条结果`,1),J(o,{label:`清除筛选`,size:`xs`,variant:`link`,color:`neutral`,onClick:t[0]||=e=>{f.value=``,L(s)(`filter`,{query:``,mention:!1,host:!1})}})])):X(``,!0),L(i).messages.length?(W(),G(`nav`,{key:1,ref_key:`message_map`,ref:je,class:`channel-message-map`,style:ye({"--nav-entry-height":`${vJ}px`}),"aria-label":`发言快速导航`,onWheelPassive:_u(Ei,[`stop`]),onPointerleave:ki,onFocusout:ki,onKeydown:yu(_u(ki,[`stop`]),[`esc`]),onContextmenu:Ti,onPointerdown:gi,onPointermove:_i,onPointerup:xi,onPointercancel:xi},[q(`div`,lG,[(W(!0),G(U,null,V(Gr.value,(e,n,r,o)=>{let s=[e,Re.value,Ur.value===e.number?Ne.value:null,Mi(e)];if(o&&o.el&&o.key===e.entries[0].key&&uc(o,s))return o;let c=(W(),G(`div`,{key:e.entries[0].key,class:`channel-map-round`,style:ye({"--round-message-count":e.count})},[(W(!0),G(U,null,V(e.entries,(e,t,n,r)=>{let o=[e.message,e.label,e.index,Ne.value===e.message.id,e.message.id===(Ne.value||L(i).messages[0]?.id),nt.value<0?-1:Math.min(Math.abs(e.index-nt.value),wJ),Re.value&&Ie.value===e.key];if(r&&r.el&&r.key===e.key&&uc(r,o))return r;let s=(W(),G(`button`,{key:e.key,type:`button`,class:N([`channel-navigation-entry`,e.round?`channel-round-range`:`channel-message-jump`]),"data-author":e.round?void 0:L(a).identities[e.message.author]?.style,"data-jump-id":e.round?void 0:e.message.id,"data-round-jump":e.round?e.label:void 0,"aria-label":e.label,tabindex:!e.round&&e.message.id===(Ne.value||L(i).messages[0]?.id)?0:-1,"aria-current":!e.round&&Ne.value===e.message.id?`location`:void 0,"aria-describedby":Re.value&&Ie.value===e.key?`channel-navigation-preview`:void 0,onPointerenter:t=>Ci(e,t),onPointermove:t=>Ci(e,t),onFocus:t=>hi(e,t),onKeydown:t=>B(t,e.index),onClick:t=>wi(e,t)},[e.round?(W(),G(`span`,uG,F(e.number||``),1)):(W(),G(`span`,{key:1,class:`channel-jump-tick`,"aria-hidden":`true`,style:ye(Ni(e,e.index))},null,4))],42,[`data-author`,`data-jump-id`,`data-round-jump`,`aria-label`,`tabindex`,`aria-current`,`aria-describedby`,`onPointerenter`,`onPointermove`,`onFocus`,`onKeydown`,`onClick`]));return s.memo=o,s},t,1),128))],4));return c.memo=s,c},t,3),128))])],44,cG)):X(``,!0),(W(),K(Yr,{to:`body`},[$e.value?(W(),K(L(RB).div,{key:0,id:`channel-navigation-preview`,class:`channel-nav-preview`,role:`tooltip`,"aria-hidden":!Re.value,inert:!Re.value,"data-open":Re.value,style:ye({left:Be.value,y:L(qe),x:L(Ze),opacity:L(Qe),scale:L(Xe),height:L(Je),"--preview-gap":`${_J}px`}),onPointerleave:ki,onFocusout:ki,onKeydown:yu(_u(ki,[`stop`]),[`esc`])},{default:R(()=>[q(`div`,{ref_key:`preview_content`,ref:ze,class:`channel-nav-preview-content`},[Le.value?(W(),G(`h3`,dG,F(tt.value),1)):X(``,!0),q(`div`,fG,[J(h,{src:L(a).identities[$e.value.author]?.icon,text:L(a).identities[$e.value.author]?.initials||`?`,alt:L(a).display_name($e.value.author),size:`sm`,class:N([`channel-avatar`,L(a).identities[$e.value.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`strong`,null,F(L(a).display_name($e.value.author)),1),q(`span`,null,`#`+F($e.value.id),1)]),q(`div`,pG,[Y(F(tt.value)+` · `+F(L(a).sources[$e.value.source])+` · `+F(L(a).format_time($e.value.created_at)),1),$e.value.kind===`moderation`?(W(),G(`span`,mG,` · 主持人`)):$e.value.kind===`receipt`?(W(),G(`span`,hG,` · 运行回执`)):X(``,!0)]),q(`div`,{class:`channel-nav-preview-text markdown-body`,innerHTML:$e.value.summary?$e.value.rendered_summary:$e.value.rendered_text},null,8,gG)],512)]),_:1},8,[`aria-hidden`,`inert`,`data-open`,`style`,`onKeydown`])):X(``,!0)])),te.value&&!te.value.touch?(W(),G(`div`,{key:2,class:`channel-offer-marks`,style:ye({left:`${te.value.left}px`,top:`${te.value.top}px`})},[q(`button`,{type:`button`,class:`channel-listen-mark`,title:`把选中的文字作为摘录添加到对话`,onMousedown:t[5]||=_u(()=>{},[`prevent`]),onClick:ve},[J(g,{name:`i-lucide-message-square-quote`}),t[40]||=Y(`添加到对话`,-1)],32),te.value.speech?(W(),G(`button`,{key:0,type:`button`,class:`channel-listen-mark`,title:`从选中处开始朗读`,"aria-label":`从选中处开始朗读`,onMousedown:t[6]||=_u(()=>{},[`prevent`]),onClick:Oe},[J(g,{name:`i-lucide-headphones`}),t[41]||=Y(`朗读`,-1)],32)):X(``,!0)],4)):X(``,!0),se.value?(W(),G(`form`,{key:3,class:N([`selection-comment`,{"is-docked":se.value.touch}]),style:ye(se.value.touch?{}:{left:`${se.value.left}px`,top:`${se.value.top}px`}),onSubmit:_u(Te,[`prevent`])},[Tr(q(`input`,{ref_key:`quote_input`,ref:le,"onUpdate:modelValue":t[7]||=e=>ce.value=e,type:`text`,placeholder:`添加批注(可选)`,"aria-label":`摘录的批注(可选)`,enterkeyhint:`send`,onKeydown:Ee},null,544),[[nu,ce.value]]),q(`button`,{type:`button`,class:`selection-comment-cancel`,"aria-label":`取消添加`,title:`取消`,onClick:we},[J(g,{name:`i-lucide-x`})]),q(`button`,_G,[J(g,{name:`i-lucide-arrow-up`})])],38)):X(``,!0),ue.value?(W(),K(DW,{key:ue.value.excerpt.id,comment:ue.value.excerpt.comment,style:ye({left:`${ue.value.left}px`,top:`${ue.value.top}px`}),onSave:Ce,onCancel:Se,onRemove:P},null,8,[`comment`,`style`])):X(``,!0),lc([L(Vr),L(i).sending_preview,L(Wr),mt.value,at.value.session,ct.value,m.value.size,L(v).state.message_id,at.value.title,L(i).query,L(i).mention_only,L(i).host_only,L(gr),L(_r),L(Gt),L(Kt),L(Zt),Xt.value,L(en),L(rn),L(c),yt.value,wt.value,ta.value,L(xr),oa.value,ua.size,da.value,na.value,_t.value,Ki.value,qi.value,bt.value,Mt.value,L(i).sending_message,L(tn),lt.value,at.value.free],()=>(W(),G(`div`,{ref_key:`transcript`,ref:p,class:`channel-transcript`,"aria-label":`聊天记录`,onScroll:ei,onWheelPassive:t[16]||=e=>{fi(e),di(e)},onTouchstartPassive:fi,onTouchmovePassive:di,onPointerdown:di,onKeydown:t[17]||=e=>{fi(e),di(e)}},[!L(i).query&&!L(i).mention_only&&!L(i).host_only&&!L(gr)&&Dr.value===0?(W(),G(`div`,vG,[J(CH,{ref:e=>gn(r)?r.value=e:r=e,onEdit:t[8]||=e=>n(`edit`)},null,512)])):X(``,!0),(W(!0),G(U,null,V(L(Vr),e=>(W(),G(`div`,{key:e.key,class:`channel-message-group`},[J(_,{label:e.label,class:`channel-date-divider`},null,8,[`label`]),(W(!0),G(U,null,V(e.messages,e=>(W(),G(U,{key:e.id},[e.id===L(_r)&&!L(i).query&&!L(i).mention_only&&!L(i).host_only?(W(),K(ZH,{key:0})):X(``,!0),e.id===L(gr)&&!L(i).query&&!L(i).mention_only&&!L(i).host_only?(W(),K(CH,{key:1,ref_for:!0,ref:e=>gn(r)?r.value=e:r=e,onEdit:t[9]||=e=>n(`edit`)},null,512)):X(``,!0),e.arrangement?(W(),K(HV,{key:2,icon:`i-lucide-list-ordered`,plain:``,title:`主持人创建的发言安排`,label:`主持人安排`,"toggle-label":`展开或收起各专家的任务`},{text:R(()=>[Y(`主持人安排:`+F(L(rn).get(e.arrangement.after_message_id)?.find(t=>t.id===e.arrangement.id)?.label),1),e.arrangement.after_message_id?(W(),G(`small`,yG,`耗时 `+F(on(sn(e.arrangement,L(i).messages.find(t=>t.id===e.arrangement.after_message_id)))),1)):X(``,!0)]),default:R(()=>[(W(!0),G(U,null,V(e.arrangement.turns,t=>(W(),G(`p`,{key:`${e.id}-${t.expert}-${t.question}`},[q(`span`,null,F(L(a).display_name(t.expert))+`:`+F(t.question),1)]))),128))]),_:2},1024)):e.source===`goal`?(W(),K(oU,{key:3,message:e},null,8,[`message`])):e.source===`notice`?(W(),K(HV,{key:4,icon:`i-lucide-bell`,plain:``,expandable:!1,label:`程序通知主持人`},{text:R(()=>[Y(F(e.text),1)]),_:2},1024)):e.cancelled_turn||e.cancelled_execution?(W(),K(w,{key:5,id:e.id,"data-author":L(a).identities[e.author]?.style,role:`assistant`,parts:[],side:`left`,variant:`naked`,color:`neutral`,class:`channel-message`,ui:{header:`channel-message-header`,container:`channel-message-container`,body:`channel-message-body`}},{body:R(()=>[q(`div`,bG,[J(h,{src:L(a).identities[e.author]?.icon,text:L(a).identities[e.author]?.initials||`?`,alt:L(a).display_name(e.author),size:`md`,class:N([`channel-avatar`,L(a).identities[e.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`div`,xG,[q(`div`,SG,[q(`strong`,null,F(L(a).display_name(e.author)),1)])]),e.cancelled_turn?(W(),G(`span`,CG,`已错过 · 安排 #`+F(e.cancelled_turn.display_id||e.cancelled_turn.id),1)):(W(),G(`span`,wG,F(Ut(e.cancelled_execution).label)+` · 执行 #`+F(e.execution_id),1))]),q(`div`,TG,F(e.cancelled_turn?`本次发言已被跳过或取消,未回答。`:e.cancelled_execution.result||`本次执行已作废,未回答。`),1),(W(!0),G(U,null,V([e.cancelled_execution||(at.value.free?.executions||[]).find(t=>t.id===e.execution_id)].filter(e=>e&&Ut(e).note),e=>(W(),G(U,{key:e.id},[q(`p`,EG,F(Ut(e).note),1),e.late_answer&&L(i).access?.can_manage?(W(),G(`details`,{key:0,class:`channel-receipt`,onToggle:t=>xt(e.id,t)},[q(`summary`,{"aria-label":`查看 ${L(a).display_name(e.member)} 未采纳的回答`},`未采纳的回答`,8,OG),q(`div`,kG,F(bt.value.get(e.id)?.text??`正在读取…`),1)],40,DG)):X(``,!0)],64))),128))]),_:2},1032,[`id`,`data-author`])):e.slot_card&&!e.failure&&!e.retry?(W(),G(`div`,{key:6,id:`execution-${e.id}`,class:`channel-working-strip`,"data-author":L(a).identities[e.author]?.style},[q(`div`,jG,[J(h,{src:L(a).identities[e.author]?.icon,text:L(a).identities[e.author]?.initials||`?`,alt:L(a).display_name(e.author),size:`2xs`,class:N([`channel-avatar`,L(a).identities[e.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`strong`,MG,F(L(a).display_name(e.author)),1),q(`small`,NG,F(e.waiting?`手动启动${e.created_at?` · 已等 ${on(Math.max(0,_t.value-e.created_at))}`:``}`:`已用 ${on(Math.max(0,_t.value-e.created_at))}`)+F(e.attempt?` · 第 ${e.attempt}/${JJ} 次重试`:``),1)]),L(i).access?.can_manage&&Ht(e)&&e.execution_id?(W(),G(`div`,PG,[q(`div`,FG,[J(yV,{text:`私聊:查看它正在做什么`},{default:R(()=>[J(o,{icon:`i-lucide-messages-square`,class:`channel-private-chat-key`,size:`xs`,variant:`ghost`,color:`neutral`,"aria-label":`私聊 ${L(a).display_name(e.author)}:查看本次执行过程`,onClick:t=>L(LU)(L(s),e.author,e.execution_id)},null,8,[`aria-label`,`onClick`])]),_:2},1024)])])):X(``,!0),q(`div`,IG,[(W(!0),G(U,null,V([Dt(e)],t=>(W(),G(`span`,{key:e.id,class:N([`channel-working-status`,{"channel-working-warning":t.warning}]),role:`status`,title:Ht(e)?e.waiting?e.text:t.text:`此接入方式看不到进度,可在原窗口查看`},[e.waiting?(W(),G(`span`,RG,F(e.text),1)):t.live?(W(),K(bU,{key:1,text:t.text,seed:e.author,beat:e.activity_at,silent:_t.value-(e.activity_at||e.created_at),dots:``,muted:!Ht(e)},null,8,[`text`,`seed`,`beat`,`silent`,`muted`])):(W(),G(`span`,zG,F(t.text),1))],10,LG))),128)),L(i).access?.can_manage?(W(),G(`span`,BG,[lt.value?.expert===e.author&&e.discussion_request?(W(),G(U,{key:0},[J(yV,{text:`暂停讨论`},{default:R(()=>[J(o,{icon:`i-lucide-pause`,size:`xs`,variant:`ghost`,color:`neutral`,"aria-label":`暂停讨论,停止 ${L(a).display_name(e.author)} 本次发言`,disabled:!!L(c),loading:L(c)===`pause_discussion`,onClick:t[10]||=e=>L(s)(`pause_discussion`)},null,8,[`aria-label`,`disabled`,`loading`])]),_:2},1024),J(yV,{text:`停止本次发言,轮到下一位`},{default:R(()=>[J(o,{variant:`solid`,color:`neutral`,class:`channel-stop-button`,"aria-label":`停止 ${L(a).display_name(e.author)} 本次发言,轮到下一位`,disabled:!!L(c),loading:L(c)===`skip_turn`,onClick:t[11]||=e=>L(s)(`skip_turn`)},{default:R(()=>[...t[42]||=[q(`span`,{class:`channel-stop-square`},null,-1)]]),_:1},8,[`aria-label`,`disabled`,`loading`])]),_:2},1024)],64)):(W(),K(yV,{key:1,text:`停止`},{default:R(()=>[J(o,{variant:`solid`,color:`neutral`,class:`channel-stop-button`,"aria-label":`停止 ${L(a).display_name(e.author)} 本次执行`,disabled:!!L(c),loading:L(c)===`change_member`&&na.value===e.member_id,onClick:t=>ra(e)},{default:R(()=>[...t[43]||=[q(`span`,{class:`channel-stop-square`},null,-1)]]),_:1},8,[`aria-label`,`disabled`,`loading`,`onClick`])]),_:2},1024))])):X(``,!0)]),(W(!0),G(U,null,V([St(e)].filter(e=>e.length),t=>(W(),G(`div`,{key:e.execution_id,class:N([`channel-working-notes`,{"is-open":wt.value.has(e.execution_id),"is-single":t.length===1}])},[wt.value.has(e.execution_id)?(W(!0),G(U,{key:0},V(t.slice(0,-1),e=>(W(),G(`p`,{key:e.seq},F(e.text),1))),128)):X(``,!0),q(`p`,{class:`channel-working-latest`,onClick:n=>t.length===1||wt.value.has(e.execution_id)||Tt(e.execution_id)},[q(`span`,HG,F(t.at(-1).text),1),t.length>1?(W(),G(`button`,{key:0,type:`button`,class:`channel-working-count`,"aria-expanded":wt.value.has(e.execution_id),"aria-label":wt.value.has(e.execution_id)?`收起过程说明`:`展开全部 ${t.length} 段过程说明`,onClick:_u(t=>Tt(e.execution_id),[`stop`])},[Y(F(t.length)+` 段`,1),J(g,{name:`i-lucide-chevron-down`})],8,UG)):X(``,!0)],8,VG)],2))),128))],8,AG)):e.slot_card&&!e.failure?(W(),K(w,{key:7,id:`execution-${e.id}`,"data-author":L(a).identities[e.author]?.style,role:`assistant`,parts:[],side:`left`,variant:`naked`,color:`neutral`,class:`channel-message`,ui:{header:`channel-message-header`,container:`channel-message-container`,body:`channel-message-body`}},{body:R(()=>[q(`div`,WG,[J(h,{src:L(a).identities[e.author]?.icon,text:L(a).identities[e.author]?.initials||`?`,alt:L(a).display_name(e.author),size:`md`,class:N([`channel-avatar`,L(a).identities[e.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`div`,GG,[q(`div`,KG,[q(`strong`,null,F(L(a).display_name(e.author)),1)]),q(`div`,qG,[e.created_at?(W(),G(U,{key:0},[q(`time`,{title:new Date(e.created_at*1e3).toLocaleString(`zh-CN`)},F(L(a).format_time(e.created_at*1e3)),9,JG),t[44]||=Y(` · `,-1)],64)):X(``,!0),Y(F(e.waiting?`手动启动${e.created_at?` · 已等 ${on(Math.max(0,_t.value-e.created_at))}`:``}`:`已用 ${on(Math.max(0,_t.value-e.created_at))}`),1)])])]),q(`div`,YG,[(W(!0),G(U,null,V([Dt(e)],t=>(W(),G(`div`,{key:e.id,class:N([`channel-message-text`,{"channel-working-warning":t.warning}]),role:`status`,"aria-label":`${L(a).display_name(e.author)} ${t.text}`,title:Ht(e)?void 0:`此接入方式看不到进度,可在原窗口查看`},[e.waiting?(W(),G(`span`,ZG,F(e.text),1)):t.live?(W(),K(bU,{key:1,text:t.text,seed:e.author,beat:e.activity_at,silent:_t.value-(e.activity_at||e.created_at),dots:``,muted:!Ht(e)},null,8,[`text`,`seed`,`beat`,`silent`,`muted`])):(W(),G(`span`,QG,F(t.text),1))],10,XG))),128))]),e.retry?(W(),G(U,{key:0},[q(`p`,$G,F(e.retry.reason),1),q(`div`,eK,[q(`span`,tK,F(e.retry.retry_at>_t.value?`${e.retry.retry_at-_t.value} 秒后自动重试`:`正在重试`)+`(第 `+F(e.retry.attempt)+`/`+F(JJ)+` 次)`,1),L(i).access?.can_manage?(W(),G(U,{key:0},[J(o,{label:`立即重试`,icon:`i-lucide-rotate-ccw`,size:`sm`,variant:`soft`,color:`primary`,"aria-label":`立即重新投递给 ${L(a).display_name(e.author)}`,disabled:!!L(c),onClick:t=>L(s)(`retry_delivery`,{execution_id:e.execution_id,action:`retry_now`})},null,8,[`aria-label`,`disabled`,`onClick`]),J(o,{label:`停止`,icon:`i-lucide-circle-stop`,size:`sm`,variant:`soft`,color:`error`,"aria-label":`停止自动重试 ${L(a).display_name(e.author)} 的投递`,disabled:!!L(c),onClick:t=>L(s)(`retry_delivery`,{execution_id:e.execution_id,action:`retry_stop`})},null,8,[`aria-label`,`disabled`,`onClick`])],64)):X(``,!0)])],64)):X(``,!0),yt.value.get(e.execution_id)?.length?(W(),K(pU,{key:1,live:``,notes:yt.value.get(e.execution_id)},null,8,[`notes`])):X(``,!0)]),_:2},1032,[`id`,`data-author`])):e.failure?(W(),G(`section`,{key:8,id:e.id,class:`channel-message channel-failed-execution`,"data-author":L(a).identities[e.author]?.style,"aria-label":`${L(a).display_name(e.author)} ${e.undeliverable?`无法投递`:`执行失败`}`},[q(`div`,rK,[J(h,{src:L(a).identities[e.author]?.icon,text:L(a).identities[e.author]?.initials||`?`,alt:L(a).display_name(e.author),size:`md`,class:N([`channel-avatar`,L(a).identities[e.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`div`,iK,[q(`div`,aK,[q(`strong`,null,F(L(a).display_name(e.author)),1),e.failure.role===`host`?(W(),G(`span`,oK,`主持工作`)):X(``,!0),J(T,{label:e.undeliverable?`无法投递`:`执行失败`,color:`error`,variant:`soft`,size:`xs`},null,8,[`label`])]),(W(!0),G(U,null,V([e.slot_card?e.created_at*1e3:e.created_at],t=>(W(),G(`div`,{key:e.id,class:`channel-message-provenance`},[q(`time`,{title:new Date(t).toLocaleString(`zh-CN`)},F(L(a).format_time(t)),9,sK),e.failure.id?(W(),G(`span`,cK,`执行 #`+F(e.failure.id),1)):X(``,!0)]))),128))]),e.failure.elapsed_seconds==null?X(``,!0):(W(),G(`span`,lK,`耗时 `+F(on(e.failure.elapsed_seconds)),1))]),q(`div`,uK,[q(`p`,dK,F(e.failure.result||`执行失败,未提供原因`),1),Ui(e.failure)?(W(),G(`div`,fK,[J(yV,{text:`重试`},{default:R(()=>[J(o,{icon:`i-lucide-rotate-cw`,variant:`solid`,color:`neutral`,class:`channel-stop-button channel-retry-button`,"aria-label":`把执行 #${e.failure.id} 的请求重新派给 ${L(a).display_name(e.author)}`,disabled:!!L(c),loading:L(c)===`retry_delivery`,onClick:t=>L(s)(`retry_delivery`,{execution_id:e.failure.id,action:`retry`})},null,8,[`aria-label`,`disabled`,`loading`,`onClick`])]),_:2},1024)])):X(``,!0)]),e.failure.notes?(W(),K(pU,{key:0,count:e.failure.notes,notes:yt.value.get(e.failure.id),onLoad:t=>Ct(e.failure.id)},null,8,[`count`,`notes`,`onLoad`])):X(``,!0),e.failure.denials?.length?(W(),K(uU,{key:1,denials:e.failure.denials,allowable:!!Gi(e.failure),busy:Ki.value===e.failure.id,error:qi.value[e.failure.id],onAllow:t=>Ji(e.failure)},null,8,[`denials`,`allowable`,`busy`,`error`,`onAllow`])):X(``,!0)],8,nK)):e.withdrawn?(W(),G(`div`,{key:9,id:String(e.id),"data-message-id":e.id,class:`channel-withdrawn`,"data-author":L(a).identities[e.author]?.style},[J(g,{name:e.withdrawn===`retracted`?`i-lucide-undo-2`:`i-lucide-history`,class:`channel-withdrawn-icon`},null,8,[`name`]),e.withdrawn===`retracted`?(W(),G(`span`,mK,F(L(a).display_name(e.author))+` 撤回了一条消息`,1)):L(xr).runs.has(e.id)&&!br.value.has(e.id)?(W(),G(U,{key:1},[q(`span`,null,`已回退 `+F(L(xr).runs.get(e.id))+` 条记录`,1),J(o,{label:`展开`,size:`xs`,variant:`link`,color:`neutral`,"aria-label":`展开从 #${e.id} 起已回退的记录`,onClick:t=>Sr(e.id)},null,8,[`aria-label`,`onClick`])],64)):(W(),G(U,{key:2},[q(`strong`,null,F(L(a).display_name(e.author)),1),q(`span`,hK,F(e.text),1),J(o,{label:`#${e.id}`,size:`xs`,variant:`link`,color:`neutral`,"aria-label":`查看已回退的原文 #${e.id}`,onClick:t=>n(`detail`,e.id)},null,8,[`label`,`aria-label`,`onClick`]),L(xr).runs.has(e.id)?(W(),K(o,{key:0,label:`收起`,size:`xs`,variant:`link`,color:`neutral`,"aria-label":`收起从 #${e.id} 起已回退的记录`,onClick:t=>Sr(e.id)},null,8,[`aria-label`,`onClick`])):X(``,!0)],64))],8,pK)):(W(),G(U,{key:10},[(W(!0),G(U,null,V([ha(e)],r=>(W(),K(L(aG),{key:e.id,deps:r.deps},{default:R(()=>[J(w,{id:String(e.id),"data-message-id":e.id,"data-author":L(a).identities[e.author]?.style,tabindex:`-1`,onPointerenter:t=>r.armed||pa(e.id,t),role:e.author===`用户`?`user`:`assistant`,parts:[],side:`left`,variant:`naked`,color:`neutral`,class:`channel-message`,ui:{header:`channel-message-header`,container:`channel-message-container`,body:`channel-message-body`}},{body:R(()=>[q(`div`,gK,[J(h,{src:L(a).identities[e.author]?.icon,text:L(a).identities[e.author]?.initials||`?`,alt:L(a).display_name(e.author),size:`md`,class:N([`channel-avatar`,L(a).identities[e.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`div`,_K,[q(`div`,vK,[q(`strong`,null,F(L(a).display_name(e.author)),1),q(`span`,yK,F(r.round_label),1),J(T,{size:`xs`,color:`neutral`,variant:`soft`,class:`channel-source`},{default:R(()=>[Y(F(L(a).sources[e.source]),1)]),_:2},1024),e.kind===`moderation`?(W(),K(T,{key:0,size:`xs`,color:`neutral`,variant:`soft`,class:`channel-source`},{default:R(()=>[...t[45]||=[Y(`主持人`,-1)]]),_:1})):X(``,!0),e.kind===`receipt`?(W(),K(T,{key:1,size:`xs`,color:`neutral`,variant:`soft`,class:`channel-source`},{default:R(()=>[...t[46]||=[Y(`运行回执`,-1)]]),_:1})):X(``,!0),e.proactive?(W(),K(T,{key:2,size:`xs`,color:`neutral`,variant:`soft`,class:`channel-source`,title:`成员在自己的窗口里应用户要求主动发言,不是在回答房间的请求`},{default:R(()=>[...t[47]||=[Y(`主动发言`,-1)]]),_:1})):X(``,!0),r.waits?(W(),K(T,{key:3,size:`xs`,color:`warning`,variant:`soft`,class:`channel-source`,title:r.speaking_expert?`${L(a).display_name(r.speaking_expert)} 说完后交给主持人处理`:`等待主持人处理`},{default:R(()=>[...t[48]||=[Y(`待主持人处理`,-1)]]),_:1},8,[`title`])):X(``,!0),(W(!0),G(U,null,V(r.badges,e=>(W(),K(T,{key:e.key,size:`xs`,color:e.color,variant:`soft`,class:`channel-source`,title:e.title},{default:R(()=>[Y(F(e.label),1)]),_:2},1032,[`color`,`title`]))),128))]),q(`div`,bK,[q(`time`,{title:new Date(e.created_at).toLocaleString(`zh-CN`)},F(L(a).format_time(e.created_at)),9,xK),J(o,{label:`#${e.id}`,color:`neutral`,variant:`link`,size:`xs`,"aria-label":`查看原文 #${e.id}`,class:`channel-message-id`,onClick:t=>n(`detail`,e.id)},null,8,[`label`,`aria-label`,`onClick`]),e.submitted_by&&e.submitted_by!==e.author&&(e.source!==`proxy`||e.submitted_by!==`用户`)?(W(),G(`span`,SK,F(L(a).display_name(e.submitted_by))+` 代发`,1)):X(``,!0)])]),r.elapsed===null?X(``,!0):(W(),G(`span`,CK,`耗时 `+F(on(r.elapsed)),1))]),e.reply_to?(W(),K(o,{key:0,label:`回复 #${e.reply_to}`,icon:`i-lucide-corner-up-left`,variant:`link`,color:`neutral`,size:`xs`,class:`channel-message-reference`,"aria-label":`回复 #${e.reply_to} 查看原文`,onClick:t=>n(`detail`,e.reply_to)},null,8,[`label`,`aria-label`,`onClick`])):X(``,!0),e.kind===`receipt`?(W(),G(`details`,wK,[q(`summary`,{"aria-label":`查看运行回执 #${e.id}`},`运行回执详情`,8,TK),q(`div`,{class:`channel-message-text markdown-body`,innerHTML:e.rendered_text},null,8,EK)])):r.editing?(W(),G(`form`,{key:2,class:`channel-edit`,"aria-label":`编辑消息 #${e.id}`,onSubmit:_u(ya,[`prevent`])},[Tr(q(`textarea`,{"onUpdate:modelValue":t[12]||=e=>ta.value.text=e,rows:`3`,maxlength:L(a).max_message_length,"aria-label":`编辑后的消息`,onKeydown:[yu(_u(_a,[`prevent`]),[`esc`]),yu(_u(ya,[`ctrl`,`prevent`]),[`enter`]),yu(_u(ya,[`meta`,`prevent`]),[`enter`])]},null,40,OK),[[nu,ta.value.text]]),q(`p`,{class:N([`channel-edit-note`,{"is-error":r.editing_error}]),role:`status`},F(r.editing_error||(r.editing_plan?ba(r.editing_plan):`正在读取回退范围…`)),3),q(`div`,kK,[J(o,{label:`取消`,size:`xs`,variant:`ghost`,color:`neutral`,onClick:_a}),J(o,{type:`submit`,label:`回退并发送`,size:`xs`,color:`primary`,disabled:!r.editing_plan||!!r.editing_pending&&r.editing_pending!==`rewind_and_send`,loading:r.editing_pending===`rewind_and_send`},null,8,[`disabled`,`loading`])])],40,DK)):(W(),G(`div`,AK,[q(`div`,{id:`channel-answer-${e.id}`,class:`channel-message-text markdown-body`,innerHTML:r.expanded?e.rendered_text:r.preview.html},null,8,jK),(W(!0),G(U,null,V(r.marks,e=>(W(),G(`button`,{key:e.id,type:`button`,class:`excerpt-mark`,style:ye({left:`${e.left}px`,top:`${e.top}px`}),title:`摘录 ${e.number}:点击修改批注`,"aria-label":`修改摘录 ${e.number} 的批注`,onClick:t=>xe(e.id)},F(e.number),13,MK))),128)),r.preview.truncated?(W(),K(o,{key:0,label:r.expanded?`收起`:`展开全文`,"trailing-icon":r.expanded?`i-lucide-chevron-up`:`i-lucide-chevron-down`,variant:`link`,color:`neutral`,size:`xs`,class:`channel-answer-toggle`,"aria-label":`${r.expanded?`收起回答`:`展开完整回答`} #${e.id}`,"aria-expanded":r.expanded,"aria-controls":`channel-answer-${e.id}`,onClick:t=>li(e,t)},null,8,[`label`,`trailing-icon`,`aria-label`,`aria-expanded`,`aria-controls`,`onClick`])):X(``,!0)])),e.summary?(W(),G(`div`,NK,[q(`small`,null,[t[49]||=Y(`回答摘要`,-1),e.summary_by&&e.summary_by!==e.author?(W(),G(`span`,PK,` · `+F(L(a).display_name(e.summary_by))+` 整理`,1)):X(``,!0)]),q(`div`,{class:`channel-message-text markdown-body`,innerHTML:e.rendered_summary},null,8,FK)])):X(``,!0),r.notes_count?(W(),K(pU,{key:5,count:r.notes_count,notes:r.notes,onLoad:e=>Ct(r.execution_id)},null,8,[`count`,`notes`,`onLoad`])):X(``,!0),e.attachments?.length?(W(),G(`div`,{key:6,innerHTML:L(a).attachment_markup(e.attachments)},null,8,IK)):X(``,!0),r.recommendation?(W(),G(`div`,{key:7,class:N([`channel-recommendation`,`is-${r.recommendation.status}`]),"aria-label":`智能调度推荐`,"aria-live":`polite`},[(W(!0),G(U,null,V([r.recommendation],e=>(W(),G(U,{key:e.message_id},[J(g,{name:`i-lucide-zap`,class:`channel-recommendation-icon`}),e.status===`open`?(W(),G(`span`,LK,[t[50]||=Y(`智能调度建议让 `,-1),q(`strong`,null,F(L(a).display_name(e.member)),1),t[51]||=Y(` 回答`,-1),q(`small`,{title:`${e.label},置信度 ${Number(e.confidence).toFixed(2)}`},`置信度 `+F(Number(e.confidence).toFixed(2))+` · `+F(e.remaining)+` 秒`,9,RK)])):e.status===`waiting`?(W(),G(`span`,zK,`智能调度:主持人答完后请 `+F(L(a).display_name(e.member))+` 回答`,1)):(W(),G(`span`,BK,`智能调度:`+F(e.mode===`interrupt`?`已打断主持人,改由 ${L(a).display_name(e.member)} 回答`:`已请 ${L(a).display_name(e.member)} 回答`),1)),e.can_adopt?(W(),G(U,{key:3},[r.adopting?(W(),G(U,{key:1},[J(o,{label:`打断主持人,改由 ${L(a).display_name(e.member)} 回答`,size:`xs`,variant:`soft`,color:`warning`,onClick:t=>an(e.message_id,`interrupt`)},null,8,[`label`,`onClick`]),J(o,{label:`主持人答完后再请 ${L(a).display_name(e.member)}`,size:`xs`,variant:`soft`,color:`neutral`,onClick:t=>an(e.message_id,`after`)},null,8,[`label`,`onClick`]),J(o,{icon:`i-lucide-x`,"aria-label":`取消采纳`,size:`xs`,variant:`ghost`,color:`neutral`,onClick:t[13]||=e=>Xt.value=0})],64)):(W(),K(o,{key:0,label:`采纳`,icon:`i-lucide-check`,size:`xs`,variant:`soft`,color:`primary`,"aria-label":`采纳建议,请 ${e.member} 回答 #${e.message_id}`,onClick:t=>e.host_busy?Xt.value=e.message_id:an(e.message_id,`after`)},null,8,[`aria-label`,`onClick`]))],64)):X(``,!0)],64))),128))],2)):X(``,!0),(W(!0),G(U,null,V(r.report_rows,({report:e,allowable:t,failed:n})=>(W(),G(`section`,{key:e.id,class:`channel-execution-report`,"aria-label":`执行报告 #${e.id}`},[q(`div`,null,[q(`strong`,null,`执行 #`+F(e.id)+` · `+F(e.label),1)]),e.changes?.length?(W(),G(`p`,HK,`文件变化:`+F(e.changes.join(`、`)),1)):X(``,!0),e.status!==`completed`&&e.result?(W(),G(`p`,UK,F(e.result),1)):X(``,!0),e.denials?.length?(W(),K(uU,{key:2,denials:e.denials,allowable:t,busy:r.allowing===e.id,error:r.allow_errors?.[e.id],onAllow:t=>Ji(e)},null,8,[`denials`,`allowable`,`busy`,`error`,`onAllow`])):X(``,!0),n?(W(),K(o,{key:3,label:`重发`,icon:`i-lucide-rotate-ccw`,size:`xs`,variant:`soft`,color:`neutral`,"aria-label":`把执行 #${e.id} 的原消息填回输入框重发`,onClick:t=>Wi(e)},null,8,[`aria-label`,`onClick`])):X(``,!0)],8,VK))),128))]),header:R(()=>[q(`div`,WK,[q(`div`,GK,[r.private_chat?(W(),K(va(r.armed?yV:fa),{key:0,"disable-hoverable-content":``,ui:la,text:`私聊:查看这次执行的过程`},{default:R(()=>[J(o,{icon:`i-lucide-messages-square`,class:`channel-private-chat-key`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":`查看 #${e.id} 的执行过程`,onClick:t=>L(LU)(L(s),e.author,r.execution_id)},null,8,[`aria-label`,`onClick`])]),_:2},1024)):r.can_take_back?X(``,!0):(W(),K(va(r.armed?yV:fa),{key:1,"disable-hoverable-content":``,ui:la,text:`回复`},{default:R(()=>[J(o,{icon:`i-lucide-corner-up-left`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":`回复 #${e.id}`,onClick:t=>xa(e)},null,8,[`aria-label`,`onClick`])]),_:2},1024)),r.can_retract&&!r.editing?(W(),K(va(r.armed?yV:fa),{key:2,"disable-hoverable-content":``,ui:la,text:`撤回`},{default:R(()=>[J(o,{icon:`i-lucide-undo-2`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":`撤回 #${e.id}`,onClick:t=>sa(e.id),loading:r.retracting},null,8,[`aria-label`,`onClick`,`loading`])]),_:2},1024)):X(``,!0),r.can_take_back&&!r.editing?(W(),K(va(r.armed?yV:fa),{key:3,"disable-hoverable-content":``,ui:la,text:`编辑`},{default:R(()=>[J(o,{icon:`i-lucide-pencil`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":`编辑 #${e.id},回退到它之前重新发送`,onClick:t=>ga(e)},null,8,[`aria-label`,`onClick`])]),_:2},1024)):X(``,!0),!r.narrow&&e.kind!==`receipt`&&!r.editing?(W(),K(va(r.armed?yV:fa),{key:4,"disable-hoverable-content":``,ui:la,text:r.reading?`停止朗读`:`朗读`},{default:R(()=>[J(o,{icon:r.reading?`i-lucide-square`:`i-lucide-volume-2`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":r.reading?`停止朗读`:`从 #${e.id} 开始朗读`,onClick:t=>r.reading?L(v).stop():L(v).start(e.id)},null,8,[`icon`,`aria-label`,`onClick`])]),_:2},1032,[`text`])):X(``,!0),r.armed?(W(),K(D,{key:5,open:r.menu_open,items:r.actions,content:{align:`end`,sideOffset:5},ui:{content:`channel-menu`},"onUpdate:open":t=>da.value=t?e.id:0},{default:R(()=>[J(o,{icon:`i-lucide-ellipsis`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":`消息 #${e.id} 的更多操作`},null,8,[`aria-label`])]),_:2},1032,[`open`,`items`,`onUpdate:open`])):(W(),K(o,{key:6,icon:`i-lucide-ellipsis`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":`消息 #${e.id} 的更多操作`,"aria-haspopup":`menu`,onClick:t=>ma(e.id)},null,8,[`aria-label`,`onClick`]))])])]),_:2},1032,[`id`,`data-message-id`,`data-author`,`onPointerenter`,`role`])]),_:2},1032,[`deps`]))),128)),L(tn).has(e.id)&&!L(en).get(e.id)?.length?(W(),K(HV,{key:0,icon:`i-lucide-zap`,skipped:``,label:`智能调度分析中`,expandable:!1},{text:R(()=>[J(bU,{text:`智能调度:正在分析`,seed:`智能调度`,dots:``})]),_:1})):X(``,!0),(W(!0),G(U,null,V(L(en).get(e.id)||[],e=>(W(),K(uH,{key:`decision-${e.id}`,decision:e,free:mt.value},null,8,[`decision`,`free`]))),128))],64))],64))),128))]))),128)),L(i).sending_preview?(W(),K(L(RB).div,{key:1,class:`channel-message-group`,style:ye({opacity:L(ii),y:L(ai)})},{default:R(()=>[J(w,{id:`channel-sending-message`,"data-author":L(a).identities[L(i).sending_preview.author]?.style,role:`user`,parts:[],side:`left`,variant:`naked`,color:`neutral`,class:N([`channel-message channel-sending-message`,{"is-failed":L(i).sending_preview.failed}]),ui:{header:`channel-message-header`,container:`channel-message-container`,body:`channel-message-body`}},{body:R(()=>[q(`div`,KK,[J(h,{src:L(a).identities[L(i).sending_preview.author]?.icon,text:L(a).identities[L(i).sending_preview.author]?.initials||`?`,alt:L(a).display_name(L(i).sending_preview.author),size:`md`,class:N([`channel-avatar`,L(a).identities[L(i).sending_preview.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`div`,qK,[q(`div`,JK,[q(`strong`,null,F(L(a).display_name(L(i).sending_preview.author)),1),L(i).sending_preview.failed?(W(),K(T,{key:0,label:`发送失败`,color:`error`,variant:`soft`,size:`xs`})):X(``,!0)]),q(`div`,YK,[q(`time`,null,F(L(a).format_time(L(i).sending_preview.created_at)),1),L(i).sending_preview.failed?X(``,!0):(W(),G(`span`,XK,`发送中…`))])])]),q(`div`,ZK,[q(`div`,{class:`channel-message-text markdown-body`,innerHTML:si.value},null,8,QK)]),L(i).sending_preview.files.length?(W(),G(`div`,$K,`附件:`+F(L(i).sending_preview.files.join(`、`)),1)):X(``,!0),L(i).sending_preview.failed?(W(),G(U,{key:1},[q(`p`,eq,F(L(i).sending_preview.failed)+`;草稿已保留在输入框`,1),q(`div`,tq,[J(o,{label:`重试`,icon:`i-lucide-rotate-ccw`,size:`sm`,variant:`soft`,color:`primary`,"aria-label":`重新发送这条消息`,disabled:!Mt.value||L(i).sending_message,onClick:Sa},null,8,[`disabled`]),J(o,{label:`放弃`,icon:`i-lucide-x`,size:`sm`,variant:`soft`,color:`neutral`,"aria-label":`放弃发送,移除这张卡片`,disabled:L(i).sending_message,onClick:t[14]||=e=>L(s)(`discard_sending`)},null,8,[`disabled`])])],64)):X(``,!0)]),_:1},8,[`data-author`,`class`])]),_:1},8,[`style`])):X(``,!0),(L(gr)===`end`||L(_r)===`end`)&&!L(i).query&&!L(i).mention_only&&!L(i).host_only?(W(),G(`div`,nq,[L(gr)===`end`?(W(),K(CH,{key:0,ref:e=>gn(r)?r.value=e:r=e,onEdit:t[15]||=e=>n(`edit`)},null,512)):X(``,!0),L(_r)===`end`?(W(),K(ZH,{key:1})):X(``,!0)])):X(``,!0),!hr.value.length&&!vt.value.length?(W(),G(`div`,rq,[J(g,{name:L(i).query||L(i).mention_only||L(i).host_only?`i-lucide-search`:`i-lucide-hash`},null,8,[`name`]),q(`h2`,null,F(L(i).query||L(i).mention_only||L(i).host_only?`没有找到消息`:at.value.title),1),q(`p`,null,F(L(i).query||L(i).mention_only||L(i).host_only?`试试其他关键词,或清除筛选。`:L(a).empty_discussion_message(at.value)),1)])):X(``,!0)],544)),t,18),hr.value.length&&!it.value||te.value?.touch||L(v).state.message_id?(W(),G(`div`,iq,[te.value?.touch?(W(),G(`button`,{key:0,type:`button`,class:`channel-listen-pill`,onMousedown:t[19]||=_u(()=>{},[`prevent`]),onClick:ve},[J(g,{name:`i-lucide-message-square-quote`}),t[52]||=Y(`添加到对话`,-1)],32)):X(``,!0),te.value?.touch&&te.value.speech?(W(),G(`button`,{key:1,type:`button`,class:`channel-listen-pill`,"aria-label":`从选中处开始朗读`,onMousedown:t[20]||=_u(()=>{},[`prevent`]),onClick:Oe},[J(g,{name:`i-lucide-headphones`}),t[53]||=Y(`听当前`,-1)],32)):X(``,!0),L(v).state.message_id?(W(),G(`button`,{key:2,type:`button`,class:N([`channel-listen-pill`,{"is-on":L(v).state.following}]),"aria-pressed":L(v).state.following,title:L(v).state.following?`手动滚动即取消跟随`:`页面跟随朗读位置滚动`,onClick:t[21]||=e=>L(v).state.following?L(v).state.following=!1:L(v).follow()},[J(g,{name:`i-lucide-locate-fixed`}),Y(F(L(v).state.following?`跟随中`:`跟随`),1)],10,aq)):X(``,!0),L(v).state.reading?(W(),G(`button`,{key:3,type:`button`,class:`channel-listen-pill`,"aria-label":`退出朗读`,onClick:t[22]||=e=>L(v).stop()},[J(g,{name:`i-lucide-square`}),t[54]||=Y(`退出`,-1)])):X(``,!0),hr.value.length&&!it.value?(W(),K(o,{key:4,icon:`i-lucide-arrow-down`,color:`neutral`,variant:`outline`,"aria-label":`回到最新消息`,class:`channel-latest-button`,onClick:Di})):X(``,!0)])):X(``,!0),q(`div`,oq,[q(`div`,{class:`channel-composer-column`,onDragover:t[36]||=(...e)=>L(a).drop_attachments&&L(a).drop_attachments(...e),onDrop:t[37]||=(...e)=>L(a).drop_attachments&&L(a).drop_attachments(...e),onPaste:t[38]||=(...e)=>L(a).paste_attachments&&L(a).paste_attachments(...e),onKeydownCapture:t[39]||=e=>{or(e),wa(e)},onInput:$n,onClick:$n,onKeyup:$n,onSelect:$n,onCompositionstart:cr,onCompositionupdate:cr,onCompositionend:cr,onScrollCapture:mn},[J(O,{open:!!hn.value,reference:fr.value,content:{side:`top`,align:`start`,sideOffset:8,onOpenAutoFocus:lr,onCloseAutoFocus:lr},ui:{content:`channel-select-menu channel-mention-menu`},"onUpdate:open":t[24]||=e=>!e&&(hn.value=null)},{content:R(()=>[q(`div`,sq,[q(`span`,null,F(Kn.value),1),t[55]||=q(`small`,null,`↑↓ 选择 · Enter 确认`,-1)]),q(`div`,{id:`channel-mention-list`,ref_key:`mention_list`,ref:Cn,role:`listbox`,"aria-label":Kn.value,class:`channel-mention-list`},[(W(!0),G(U,null,V(Gn.value,(e,n)=>(W(),G(U,{key:e.key},[n===0||e.group!==Gn.value[n-1].group?(W(),G(`p`,lq,F(e.group),1)):X(``,!0),q(`button`,{id:`channel-mention-${n}`,type:`button`,role:`option`,"aria-selected":e===qn.value,tabindex:`-1`,class:`channel-mention-option`,onPointerdown:t[23]||=_u(()=>{},[`prevent`]),onClick:t=>tr(e),onPointermove:e=>Sn.value=n},[e.mode?(W(),G(U,{key:0},[J(g,{name:e.mode.command.startsWith(`/goal`)?`i-lucide-target`:`i-lucide-messages-square`,class:`channel-mention-file-icon`},null,8,[`name`]),q(`span`,{class:N({"channel-mention-disabled":e.mode.disabled})},F(e.mode.label),3),q(`small`,{title:e.mode.description},F(e.mode.description),9,dq)],64)):e.workflow?(W(),G(U,{key:1},[J(g,{name:`i-lucide-workflow`,class:`channel-mention-file-icon`}),q(`span`,{class:N({"channel-mention-disabled":e.disabled&&!e.enabled})},F(e.workflow.label),3),q(`small`,{title:e.workflow.description},F(e.enabled?`已启用`:e.disabled||e.workflow.description),9,fq)],64)):e.skill?(W(),G(U,{key:2},[J(g,{name:`i-lucide-sparkles`,class:`channel-mention-file-icon`}),q(`span`,null,F(e.skill.label),1),q(`small`,{title:e.skill.description},F(e.skill.description),9,pq)],64)):e.entry?(W(),G(U,{key:3},[J(g,{name:e.self?`i-lucide-folder-check`:e.entry.kind===`directory`?`i-lucide-folder`:`i-lucide-file-text`,class:`channel-mention-file-icon`},null,8,[`name`]),q(`span`,{title:e.entry.path},F(e.self?`引用此文件夹`:`${e.entry.name}${e.entry.kind===`directory`?`/`:``}`),9,mq),On.value?.search?(W(),G(`small`,{key:0,title:e.entry.path},F(e.entry.path.split(`/`).slice(0,-1).join(`/`)),9,hq)):X(``,!0),e.entry.kind===`directory`&&!e.self?(W(),K(g,{key:1,name:`i-lucide-chevron-right`,class:`channel-mention-file-icon channel-mention-drill`})):X(``,!0)],64)):(W(),G(U,{key:4},[yn[e.name]?(W(),K(h,{key:0,icon:yn[e.name].icon,alt:e.name,size:`xs`,class:`channel-avatar`},null,8,[`icon`,`alt`])):(W(),K(h,{key:1,src:L(a).identities[e.name]?.icon,text:L(a).identities[e.name]?.initials,alt:L(a).display_name(e.name),size:`xs`,class:N([`channel-avatar`,L(a).identities[e.name]?.style])},null,8,[`src`,`text`,`alt`,`class`])),q(`span`,null,F(yn[e.name]?e.name:L(a).display_name(e.name)),1),q(`small`,null,`@`+F(er(e.name)),1)],64))],40,uq)],64))),128)),Nn.value?(W(),G(`p`,gq,`正在读取项目目录…`)):Gn.value.length?X(``,!0):(W(),G(`p`,_q,F(hn.value?.command?`没有匹配的工作流或技能`:En.value?`没有匹配的成员或文件`:`没有匹配的成员`),1))],8,cq)]),_:1},8,[`open`,`reference`,`content`]),at.value.free?.queued_messages?(W(),K(PU,{key:0,queue:at.value.free.queued_messages,"room-id":at.value.id},null,8,[`queue`,`room-id`])):X(``,!0),J(ee,{ref_key:`prompt`,ref:rt,modelValue:L(l),"onUpdate:modelValue":t[35]||=e=>gn(l)?l.value=e:null,"submit-on-enter":L(RU),enterkeyhint:L(RU)?`send`:`enter`,autofocus:!1,rows:1,maxrows:Yq,placeholder:`发消息到 # ${at.value.title}`,"aria-label":`留言正文`,role:`combobox`,"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-expanded":!!hn.value,"aria-controls":hn.value?`channel-mention-list`:void 0,"aria-activedescendant":hn.value&&qn.value?`channel-mention-${Gn.value.indexOf(qn.value)}`:void 0,variant:`outline`,color:`neutral`,class:N([`channel-composer`,{"has-mentions":fn.value}]),ui:{header:`channel-composer-header`,base:`channel-editor`,footer:`channel-composer-footer`},onSubmit:Sa},{header:R(()=>[L(i).attachment_drafts.length||kt.value.length||jt.value.length?(W(),G(`div`,vq,[jt.value.length?(W(),K(O,{key:0,content:{side:`top`,align:`start`},"onUpdate:open":t[26]||=e=>Pt.value=0},{content:R(()=>[q(`ol`,xq,[(W(!0),G(U,null,V(jt.value,(e,n)=>(W(),G(`li`,{key:e.id},[q(`span`,Sq,F(n+1)+`.`,1),q(`div`,Cq,[q(`small`,null,`选中文字 · `+F(L(MW)(e)),1),q(`p`,wq,F(e.text),1),Pt.value===e.id?(W(),G(U,{key:0},[t[56]||=q(`small`,null,`批注`,-1),J(A,{modelValue:e.comment,"onUpdate:modelValue":t=>e.comment=t,rows:2,autoresize:``,autofocus:``,placeholder:`添加批注(可选)`,"aria-label":`摘录的批注`,class:`w-full`},null,8,[`modelValue`,`onUpdate:modelValue`])],64)):e.comment?(W(),G(U,{key:1},[t[57]||=q(`small`,null,`批注`,-1),q(`p`,Tq,F(e.comment),1)],64)):X(``,!0)]),q(`div`,Eq,[q(`button`,{type:`button`,"aria-label":`修改摘录 ${n+1} 的批注`,title:`修改批注`,onClick:t=>Pt.value=Pt.value===e.id?0:e.id},[J(g,{name:`i-lucide-pencil`})],8,Dq),q(`button`,{type:`button`,"aria-label":`移除摘录 ${n+1}`,title:`移除`,disabled:L(i).sending_message,onClick:t=>Nt(e)},[J(g,{name:`i-lucide-trash-2`})],8,Oq)])]))),128))])]),default:R(()=>[q(`div`,yq,[J(g,{name:`i-lucide-message-square-quote`}),q(`span`,null,F(jt.value.length)+` 条摘录`,1),q(`button`,{type:`button`,class:`excerpt-chip-clear`,"aria-label":`移除全部摘录`,title:`移除全部摘录`,disabled:L(i).sending_message,onClick:t[25]||=_u(e=>L(OW).excerpts=[],[`stop`])},[J(g,{name:`i-lucide-x`})],8,bq)])]),_:1})):X(``,!0),(W(!0),G(U,null,V(kt.value,e=>(W(),G(`div`,{key:`ref:${e.path}`,class:`attachment-draft-file attachment-draft-ref`,title:e.path},[e.kind===`file`?(W(),G(`span`,{key:0,innerHTML:L(a).attachment_file_icon(e.name)},null,8,Aq)):(W(),K(g,{key:1,name:`i-lucide-folder`,class:`attachment-ref-folder`})),q(`span`,jq,[q(`span`,null,F(e.name),1),q(`small`,null,F(e.kind===`directory`?`项目文件夹`:`项目文件`)+` · `+F(e.path),1)]),q(`button`,{type:`button`,class:`attachment-remove`,"aria-label":`移除 ${e.path}`,disabled:L(i).sending_message,onClick:t=>kt.value=kt.value.filter(t=>t!==e)},[J(g,{name:`i-lucide-x`})],8,Mq)],8,kq))),128)),(W(!0),G(U,null,V(L(i).attachment_drafts,e=>(W(),G(`div`,{key:e.id,class:N(e.preview_url?`attachment-draft-image`:`attachment-draft-file`)},[e.preview_url?(W(),G(`img`,{key:0,src:e.preview_url,alt:e.file_name,title:e.file_name},null,8,Nq)):(W(),G(U,{key:1},[q(`span`,{innerHTML:L(a).attachment_file_icon(e.file_name)},null,8,Pq),q(`span`,Fq,[q(`span`,{title:e.file_name},F(e.file_name),9,Iq),q(`small`,null,F(L(a).attachment_size(e.size)),1)])],64)),q(`button`,{type:`button`,class:`attachment-remove`,"aria-label":`移除 ${e.file_name}`,disabled:L(i).sending_message,onClick:t=>L(s)(`remove_attachment`,e.id)},[J(g,{name:`i-lucide-x`})],8,Lq),e.uploading?(W(),G(`span`,{key:2,class:`attachment-uploading`,role:`status`,"aria-label":`正在上传 ${e.file_name}`},[J(g,{name:`i-lucide-loader-circle`})],8,Rq)):X(``,!0)],2))),128))])):X(``,!0),(W(!0),G(U,null,V(ft.value,e=>(W(),G(`div`,{key:e.name,class:`channel-reply-draft channel-queue-hint`},[J(g,{name:`i-lucide-user-round-x`}),q(`span`,null,F(L(a).display_name(e.name))+` 待注册:在其会话中粘贴启动指令`,1),L(i).access?.can_manage?(W(),K(o,{key:0,icon:Li.value===e.name?`i-lucide-check`:`i-lucide-copy`,label:Li.value===e.name?`已复制`:`复制启动指令`,"aria-live":`polite`,size:`xs`,color:`neutral`,variant:`ghost`,class:`channel-launch-copy`,onClick:t=>Bi(e.name)},null,8,[`icon`,`label`,`onClick`])):X(``,!0)]))),128)),pt.value?(W(),G(`div`,zq,[J(g,{name:`i-lucide-clock`}),q(`span`,null,F(pt.value),1),ut(dt.value)&&L(i).access?.can_manage?(W(),K(o,{key:0,icon:Li.value===dt.value.name?`i-lucide-check`:`i-lucide-copy`,label:Li.value===dt.value.name?`已复制`:`复制启动指令`,"aria-live":`polite`,size:`xs`,color:`neutral`,variant:`ghost`,class:`channel-launch-copy`,onClick:t[27]||=e=>Bi(dt.value.name)},null,8,[`icon`,`label`])):X(``,!0)])):X(``,!0),L(i).editing_queued?(W(),G(`div`,Bq,[J(g,{name:`i-lucide-pencil`}),t[58]||=q(`span`,null,`编辑排队消息:发送即保存修改,仍按原位置排队`,-1),J(o,{icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`取消编辑排队消息`,onClick:t[28]||=e=>L(s)(`queue_cancel_edit`)})])):X(``,!0),L(i).reply_to?(W(),G(`div`,Vq,[J(g,{name:`i-lucide-corner-up-left`}),q(`span`,null,F(`回复 #${L(i).reply_to}`),1),J(o,{icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`取消回复`,onClick:t[29]||=e=>L(s)(`cancel_reply`)})])):X(``,!0)]),footer:R(()=>[L(x).state.status?(W(),G(U,{key:0},[J(yV,{text:L(RU)?`取消 · Esc`:`取消`},{default:R(()=>[J(o,{type:`button`,icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-voice-button`,"aria-label":`取消语音输入`,onClick:t[30]||=e=>L(x).cancel()})]),_:1},8,[`text`]),q(`span`,{class:N([`channel-voice-levels`,{"is-discarding":C.discard}]),role:`status`,"aria-label":L(x).state.status===`recording`?`正在录音 ${S(L(x).state.seconds)}`:`正在识别`},[L(x).state.status===`recording`?(W(),G(U,{key:0},[q(`span`,Wq,[(W(!0),G(U,null,V(L(x).state.levels,(e,t)=>(W(),G(`i`,{key:t,style:ye({transform:`scaleY(${.15+e*.85})`})},null,4))),128))]),q(`small`,null,F(S(L(x).state.seconds)),1),C.by?(W(),G(`small`,Gq,F(C.discard?`松开取消`:C.by===`touch`?`松开转文字 · 上滑取消`:`松开空格转文字`),1)):X(``,!0)],64)):(W(),G(`small`,Kq,`正在识别…`))],10,Uq),J(yV,{text:L(RU)?`完成,转成文字 · Enter`:`完成,转成文字`},{default:R(()=>[J(o,{type:`button`,icon:`i-lucide-check`,color:`neutral`,size:`sm`,class:`channel-primary-button channel-round-button`,"aria-label":`结束录音并转成文字`,loading:L(x).state.status===`transcribing`,onClick:t[31]||=e=>L(x).toggle()},null,8,[`loading`])]),_:1},8,[`text`])],64)):(W(),G(U,{key:1},[J(o,{type:`button`,icon:`i-lucide-paperclip`,"aria-label":`添加附件`,title:`图片、PDF 或其他文件 · 每个最多 20 MiB`,color:`neutral`,variant:`ghost`,size:`sm`,disabled:L(i).sending_message,onClick:t[32]||=e=>L(s)(`choose_attachments`)},null,8,[`disabled`]),b.value?(W(),K(yV,{key:0,text:L(y).on.value?`关闭语音播报`:`语音播报:新回复自动朗读摘要`},{default:R(()=>[J(o,{type:`button`,icon:`i-lucide-radio`,color:`neutral`,variant:`ghost`,size:`sm`,class:N([`channel-voice-button channel-broadcast-button`,{"is-on":L(y).on.value}]),"aria-pressed":L(y).on.value,"aria-label":L(y).on.value?`关闭语音播报`:`开启语音播报`,onClick:t[33]||=e=>L(y).toggle()},null,8,[`class`,`aria-pressed`,`aria-label`])]),_:1},8,[`text`])):X(``,!0),J(yV,{text:L(RU)?`语音输入 · 也可按住空格说话`:`按住说话,或轻点开始`},{default:R(()=>[J(o,{type:`button`,icon:`i-lucide-mic`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-voice-button channel-voice-mic`,"aria-label":`语音输入`,disabled:L(i).sending_message,onPointerdown:E,onClick:k,onContextmenu:t[34]||=_u(()=>{},[`prevent`])},null,8,[`disabled`])]),_:1},8,[`text`]),J(o,{type:`button`,icon:`i-lucide-arrow-up`,color:`neutral`,size:`sm`,class:`channel-primary-button channel-round-button channel-send`,"aria-label":`发送`,title:`发送 · Enter`,disabled:!Mt.value,onClick:Sa},null,8,[`disabled`])],64))]),default:R(()=>[fn.value?(W(),G(`div`,{key:0,ref_key:`mirror`,ref:pn,class:`channel-editor channel-editor-mirror`,"aria-hidden":`true`,innerHTML:fn.value},null,8,Hq)):X(``,!0)]),_:1},8,[`modelValue`,`submit-on-enter`,`enterkeyhint`,`placeholder`,`aria-expanded`,`aria-controls`,`aria-activedescendant`,`class`]),q(`div`,qq,[q(`span`,null,F(Ot.value),1),q(`span`,Jq,[u.value?(W(),G(`span`,{key:0,class:N({"is-near-limit":d.value})},[Y(F(u.value)+` / `+F(L(a).max_message_length),1),t[59]||=q(`span`,{class:`channel-note-divider`},`·`,-1)],2)):X(``,!0),t[60]||=q(`span`,{class:`channel-key-hint`},[q(`kbd`,null,`Enter`),Y(` 发送`),q(`span`,{class:`channel-note-divider`},`·`),q(`kbd`,null,`Shift`),Y(`+`),q(`kbd`,null,`Enter`),Y(` 换行`)],-1)])])],32)])])}}},[[`__scopeId`,`data-v-d73de54a`]]),rY={class:`page-heading`},iY={class:`topic-brief`},aY={key:0,class:`host-progress`},oY={key:1,class:`turn-panel host-turn`},sY={class:`turn-header`},cY={class:`turn-expert`},lY={class:`turn-question`},uY={class:`fine-print`},dY={key:2,class:`host-last-turn`},fY={class:`form-footer`},pY=[`href`],mY={key:0,class:`host-progress access-evidence`,"aria-label":`实际执行进展`,role:`status`},hY={key:1,class:`access-setup access-repair`,"aria-label":`本机接入设置`},gY={class:`access-repair-heading`},_Y={key:0,class:`access-repair-fields`},vY={key:2,class:`fine-print`},yY={key:3,class:`fine-print`},bY={key:4,class:`fine-print`},xY=EH({__name:`TopicPanel`,props:{section:{type:String,required:!0}},emits:[`open`,`detail`],setup(e){let t=e,{view:n,bridge:r,act:i,pending:a}=Or(`discussion`),o=Q(()=>n.value.room),s=Q(()=>o.value?.current_turn),c=Q(()=>s.value&&[`open`,`pending`,`notified`].includes(s.value.status)),l=Q(()=>o.value?.session?.status===`paused`),u=Q(()=>`${n.value.room_site}/r/${o.value?.id}`),d=Q(()=>o.value?.free?.executions?.[0]),f=Q(()=>n.value.launch.repair?.room_id===o.value?.id?n.value.launch.repair:null),p={dispatched:`唤醒中`,started:`执行中`,completed:`已完成`,failed:`失败`};return(e,m)=>{let h=bA,g=uV,_=tA,v=Yk,y=WV,b=aV,x=hV;return W(),K(L(RB).section,{class:N([`merged-section`,{"access-page":t.section===`access`,"host-page":t.section===`host`}]),"aria-label":t.section===`host`?`当前讨论`:`接入`,initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{duration:.16}},{default:R(()=>[t.section===`host`?(W(),G(U,{key:0},[q(`div`,rY,[q(`div`,null,[m[3]||=q(`span`,{class:`eyebrow`},`讨论进程`,-1),m[4]||=q(`h2`,null,`当前讨论`,-1),q(`p`,null,`当前由 `+F(L(r).display_name(o.value.host))+` 主持,围绕具体问题组织下一轮发言。`,1)]),J(h,{icon:`i-lucide-pencil`,label:`编辑议题`,variant:`outline`,color:`neutral`,class:`channel-surface-button`,onClick:m[0]||=t=>e.$emit(`open`,`edit`)})]),q(`div`,iY,[q(`div`,null,[m[5]||=q(`h3`,null,`讨论目标`,-1),q(`p`,null,F(o.value.session?.goal||o.value.goal||`待主持人根据用户原文补全`),1)]),q(`div`,null,[m[6]||=q(`h3`,null,`当前焦点`,-1),q(`p`,null,F(o.value.focus||`尚未设置当前焦点`),1)])]),o.value.limits?(W(),G(`div`,aY,[m[7]||=q(`span`,null,`进度`,-1),q(`p`,null,F(L(r).limits_label(o.value.limits)),1),J(g,{color:l.value?`warning`:`neutral`,variant:`subtle`},{default:R(()=>[Y(F(l.value?`已暂停`:`讨论中`),1)]),_:1},8,[`color`])])):X(``,!0),c.value?(W(),G(`section`,oY,[q(`div`,sY,[m[8]||=q(`h3`,null,`当前发言安排`,-1),J(g,{color:`primary`,variant:`subtle`},{default:R(()=>[Y(F(L(r).turn_label(s.value,o.value)),1)]),_:1})]),q(`div`,cY,[J(_,{src:L(r).identities[s.value.expert]?.icon,text:L(r).identities[s.value.expert]?.initials,alt:s.value.expert,class:N([`message-mark channel-avatar`,L(r).identities[s.value.expert]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`div`,null,[q(`strong`,null,F(s.value.expert),1),q(`small`,null,`发言安排 #`+F(s.value.id),1)])]),q(`p`,lY,F(s.value.question),1),q(`p`,uY,F(L(r).turn_guidance(s.value,o.value)),1)])):(W(),G(`p`,dY,F(l.value?`讨论已暂停,继续后由主持人重新安排。`:`等待主持人安排下一步。`),1)),q(`div`,fY,[q(`a`,{href:`${u.value}/turns`,target:`_blank`,rel:`noopener`,class:`subtle-link`},[m[9]||=Y(`发言安排历史 `,-1),J(v,{name:`i-lucide-arrow-up-right`})],8,pY)])],64)):(W(),G(U,{key:1},[m[13]||=q(`div`,{class:`page-heading access-heading`},[q(`div`,null,[q(`h2`,null,`本机连接`),q(`p`,null,`成员的接入操作在上方;讨论暂停后可修正本机软件连接。`)])],-1),d.value?(W(),G(`section`,mY,[m[10]||=q(`span`,null,`最近执行`,-1),q(`p`,null,`#`+F(d.value.id)+` `+F(L(r).display_name(d.value.member))+` · `+F(d.value.status===`cancelled`?L(r).stop_label(d.value):p[d.value.status]||d.value.status),1)])):X(``,!0),l.value&&L(n).launch.available&&!o.value.archived&&!L(n).launch.remote?(W(),G(`section`,hY,[q(`div`,gY,[m[11]||=q(`h3`,null,`修正本场软件连接`,-1),J(h,{label:`读取本场配置`,variant:`outline`,color:`neutral`,class:`channel-surface-button`,loading:L(a)===`load_room_configuration`,onClick:m[1]||=e=>L(i)(`load_room_configuration`)},null,8,[`loading`])]),m[12]||=q(`div`,{class:`access-repair-description`},[q(`p`,null,`修正软件路径,或切换 Codex 的 App / CLI 接入。保留原房间和会话,保存后到进度看板继续。`),q(`p`,{class:`fine-print`},`App 需保持运行,模型与文件权限沿用原聊天设置。切回 CLI 前,需让 App 释放原聊天。`)],-1),f.value?(W(),G(`div`,_Y,[(W(!0),G(U,null,V(f.value.participants,(e,t)=>(W(),G(`div`,{key:t,class:`form-two-columns`},[[`codex`,`codex_cli`].includes(e.adapter)?(W(),K(b,{key:0,label:`${t} · 接入方式`},{default:R(()=>[J(y,{"model-value":e.adapter,items:[{label:`Codex App`,value:`codex`},{label:`Codex CLI`,value:`codex_cli`}],class:`w-full`,"onUpdate:modelValue":e=>L(r).write_room_adapter(t,e)},null,8,[`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`label`])):X(``,!0),J(b,{label:`${t} · ${e.adapter===`antigravity`?`Sidecar 目录`:`软件路径`}`},{default:R(()=>[J(x,{"model-value":e[e.adapter===`antigravity`?`ipc_directory`:`executable`]||``,class:`w-full`,"onUpdate:modelValue":e=>L(r).write_room_connection(t,e)},null,8,[`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`label`])]))),128)),J(h,{label:`保存本场接入设置`,class:`channel-primary-button`,loading:L(a)===`save_room_configuration`,onClick:m[2]||=e=>L(i)(`save_room_configuration`)},null,8,[`loading`])])):X(``,!0)])):l.value&&L(n).launch.remote?(W(),G(`p`,vY,`线上连接暂不提供已登记房间的软件路径修正。`)):l.value?(W(),G(`p`,bY,`本机服务未连接,启动后可读取配置。`)):(W(),G(`p`,yY,`讨论正在运行;需要修正连接时,先在进度看板暂停。`))],64))]),_:1},8,[`class`,`aria-label`])}}},[[`__scopeId`,`data-v-f4ac3687`]]),SY={slots:{root:``,content:`data-[state=open]:animate-[collapsible-down_200ms_var(--ease-out)] data-[state=closed]:animate-[collapsible-up_200ms_var(--ease-out)] data-[state=closed]:overflow-hidden`}},CY={__name:`Collapsible`,props:{as:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,i=La(),a=AE(`collapsible`,n),o=Am(),s=jE(pm(a,`as`,`defaultOpen`,`open`,`disabled`,`unmountOnHide`),r),c=Q(()=>Jk({extend:SY,...o.ui?.collapsible||{}})());return(e,t)=>(W(),K(L(Qg),Z(L(s),{"data-slot":`root`,class:c.value.root({class:[L(a).ui?.root,L(a).class]})}),{default:R(({open:t})=>[i.default?(W(),K(L(e_),{key:0,"as-child":``},{default:R(()=>[H(e.$slots,`default`,{open:t})]),_:2},1024)):X(``,!0),J(L($g),{"data-slot":`content`,class:N(c.value.content({class:L(a).ui?.content}))},{default:R(()=>[H(e.$slots,`content`)]),_:3},8,[`class`])]),_:3},16,[`class`]))}},wY=[`read`,`write`,`auto`,`full`],TY=1e3,EY={stoppable:!0,progress:!0},DY={stoppable:!1,progress:!1},OY={codex_cli:{platform:`Codex`,label:`Codex CLI`,kind:`cli`,location:`executable`,fields:[`project_id`,`project_name`],efforts:[`low`,`medium`,`high`,`xhigh`,`max`,`ultra`],models:!0,access_levels:wY,per_tool_allow:!1,access_hints:{read:`只读沙箱`,write:`项目可写的沙箱,命令在沙箱内运行、可联网`,auto:`沙箱外的操作由模型申请提权,Codex 自动审核代替人工批准`,full:`无沙箱、无审批(--dangerously-bypass-approvals-and-sandbox)`},client:`codex`,adopt:`session`,host_existing:!0,session_family:`codex`,capabilities:{delivery:EY,rewind:`cut`,project:!0,access_env:!0,enforces_read_only:!0,limits_directories:!0,ripgrep:!0,chat:!0}},codex:{platform:`Codex`,label:`Codex App`,kind:`app`,location:`executable`,fields:[`source_thread_id`,`project_id`,`project_name`],efforts:null,models:!1,access_levels:null,per_tool_allow:!1,client:`codex`,adopt:`session`,host_existing:!0,session_family:`codex`,capabilities:{delivery:DY,rewind:`cut`,project:!0,chat:!0}},claude:{platform:`Claude`,label:`Claude Code`,kind:`cli`,location:`executable`,fields:[`allowed_tools`],efforts:[`low`,`medium`,`high`,`xhigh`,`max`],models:!0,access_levels:wY,per_tool_allow:!0,access_hints:{read:`只放行网站命令与草稿,不改项目文件、不跑其他命令`,write:`可改项目文件,Bash / PowerShell 命令全部放行(无沙箱)`,auto:`Claude auto 模式:由分类器判断,实测项目外写入和联网都会放行`,full:`bypassPermissions:跳过全部权限检查`},client:`claude`,adopt:`own_cwd`,host_existing:!0,restore_manual:!0,resume_command:e=>`claude --resume ${e}`,windows_command:`codiscuss`,capabilities:{delivery:EY,rewind:`cut`,project:!0,access_env:!0,chat:!0}},antigravity_cli:{platform:`Antigravity`,label:`Antigravity CLI`,kind:`cli`,location:`executable`,fields:[`project_id`,`project_name`],efforts:[`low`,`medium`,`high`,`xhigh`,`max`],efforts_per_model:!0,models:!0,defaults_by_query:!0,access_levels:[`read`,`write`,`full`],per_tool_allow:!0,access_hints:{read:`只放行网站命令;碰到未放行的命令会直接结束本轮`,write:`可写项目,命令全部放行(在 agy 沙箱内)`,full:`跳过全部权限确认(--dangerously-skip-permissions),并放开沙箱外命令与 MCP 工具`},unsupported_hints:{auto:`agy 只在交互窗口提供自动模式,后台运行(-p)不支持`},client:`antigravity`,adopt:`session`,host_existing:!1,own_project_when_bound:!0,capabilities:{delivery:EY,rewind:`cut`,project:!0,access_env:!0,chat:!0},task_rules:(e,{runs_commands:t})=>(t?``:`无人值守下 run_command 只能运行 ${e} 的 subcommands 子命令,其他命令会被自动拒绝并使会话直接结束;列目录、搜索或读取文件用 list_dir、find_by_name、grep_search、view_file。`)+`多步任务中,在关键转折处用一句话写出进展再继续:agy 不输出思考过程,网页只能靠这些话显示你做到哪一步。`},antigravity:{platform:`Antigravity`,label:`Antigravity App`,kind:`app`,location:`ipc_directory`,fields:[`project_id`,`project_name`],efforts:null,models:!1,access_levels:null,per_tool_allow:!1,client:`antigravity`,adopt:`session`,host_existing:!0,capabilities:{delivery:DY,rewind:`kept`,project:!0,chat:!0}},api:{platform:``,label:`模型 API`,kind:`api`,location:``,fields:[`base_url`,`api_protocol`,`api_key_ref`],efforts:null,models:!1,access_levels:[`read`,`write`],per_tool_allow:!1,adopt:``,host_existing:!1,access_hints:{read:`用接入程序的文件工具读取、搜索项目文件`,write:`还可新建、覆盖、局部编辑项目文件;没有命令行`},unsupported_hints:{auto:`API 成员没有命令行,没有需要软件审批的操作`,full:`API 成员没有命令行,没有需要软件审批的操作`},capabilities:{delivery:EY,rewind:`fresh`,project:!0,file_tools:!0,limits_directories:!0,chat:!0}}};Object.keys(OY);function kY(e){let t=OY[e];return t?{id:e,session_family:e,windows_command:`codiscuss.cmd`,...t}:null}function AY(e){return OY[e]?.capabilities||{delivery:DY,rewind:`kept`,project:!1}}var jY=[`aria-label`],MY=[`aria-label`,`disabled`],NY=[`maxlength`,`aria-label`,`value`,`disabled`],PY=[`aria-label`,`disabled`],FY=EH({__name:`NumberStepper`,props:{modelValue:{type:Number,required:!0},min:{type:Number,default:1},max:{type:Number,required:!0},step:{type:Number,default:1},label:{type:String,required:!0},disabled:Boolean},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t;function i(e){let t=Math.min(n.max,Math.max(n.min,e));t!==n.modelValue&&r(`update:modelValue`,t)}function a(e){let t=Number.parseInt(e.target.value,10);Number.isFinite(t)&&i(t),e.target.value=String(n.modelValue)}return(t,n)=>{let r=Yk;return W(),G(`span`,{class:`number-stepper`,role:`group`,"aria-label":e.label},[q(`button`,{type:`button`,class:`number-stepper-step`,"aria-label":`减少 ${e.step}`,disabled:e.disabled||e.modelValue<=e.min,onClick:n[0]||=t=>i(e.modelValue-e.step)},[J(r,{name:`i-lucide-minus`})],8,MY),q(`input`,{class:`number-stepper-value`,type:`text`,inputmode:`numeric`,pattern:`[0-9]*`,maxlength:String(e.max).length,"aria-label":e.label,value:e.modelValue,disabled:e.disabled,style:ye({width:`${String(e.max).length+1.5}ch`}),onFocus:n[1]||=e=>e.target.select(),onChange:a,onKeydown:n[2]||=yu(_u(e=>e.target.blur(),[`prevent`]),[`enter`])},null,44,NY),q(`button`,{type:`button`,class:`number-stepper-step`,"aria-label":`增加 ${e.step}`,disabled:e.disabled||e.modelValue>=e.max,onClick:n[3]||=t=>i(e.modelValue+e.step)},[J(r,{name:`i-lucide-plus`})],8,PY)],8,jY)}}},[[`__scopeId`,`data-v-37a42d72`]]),IY={class:`api-requests`},LY={class:`api-requests-sentence`},RY={key:0},zY={class:`api-requests-help`},BY=0,VY=10,HY=EH({__name:`ApiRequestsField`,props:{modelValue:{type:Number,required:!0},disabled:Boolean},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=I(300);return z(()=>n.modelValue,e=>{e!==BY&&(i.value=e)},{immediate:!0}),(t,n)=>{let a=TH;return W(),G(`span`,IY,[q(`span`,LY,[e.modelValue===BY?(W(),G(`span`,RY,`API 成员每次执行可一直调用模型,不限次数`)):(W(),G(U,{key:1},[n[2]||=q(`span`,null,`API 成员每次执行最多调用模型`,-1),J(FY,{"model-value":e.modelValue,max:L(TY),step:VY,label:`API 成员每次执行的模型请求上限`,disabled:e.disabled,"onUpdate:modelValue":n[0]||=e=>r(`update:modelValue`,e)},null,8,[`model-value`,`max`,`disabled`]),n[3]||=q(`span`,null,`次,然后停止`,-1)],64)),J(a,{"model-value":e.modelValue===BY,disabled:e.disabled,label:`不限`,"aria-label":`API 请求次数不限`,ui:{root:`items-center`},"onUpdate:modelValue":n[1]||=e=>r(`update:modelValue`,e?BY:i.value)},null,8,[`model-value`,`disabled`])]),q(`small`,zY,[n[4]||=Y(`每读、改一次文件或读一次房间都算一次。快到上限时会提醒它先提交已完成的部分;不限时只能靠“停止”打断,期间持续产生 API 费用。`,-1),H(t.$slots,`default`,{},void 0,!0)])])}}},[[`__scopeId`,`data-v-48ea4780`]]),UY={class:`chain-rounds`},WY={class:`chain-rounds-sentence`},GY={key:0},KY={class:`chain-rounds-help`},Oee=100,qY=0,JY=10,YY=EH({__name:`ChainRoundsField`,props:{modelValue:{type:Number,required:!0},disabled:Boolean},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=I(JY);return z(()=>n.modelValue,e=>{e!==qY&&(i.value=e)},{immediate:!0}),(t,n)=>{let a=TH;return W(),G(`span`,UY,[q(`span`,WY,[e.modelValue===qY?(W(),G(`span`,GY,`主持人收到你的一条消息后,可一直连续派活,不限轮数`)):(W(),G(U,{key:1},[n[2]||=q(`span`,null,`主持人收到你的一条消息后,最多连续派活`,-1),J(FY,{"model-value":e.modelValue,max:Oee,label:`主持人连续派活轮数`,disabled:e.disabled,"onUpdate:modelValue":n[0]||=e=>r(`update:modelValue`,e)},null,8,[`model-value`,`disabled`]),n[3]||=q(`span`,null,`轮,然后停下等你`,-1)],64)),J(a,{"model-value":e.modelValue===qY,disabled:e.disabled,label:`不限`,"aria-label":`主持人连续派活轮数不限`,ui:{root:`items-center`},"onUpdate:modelValue":n[1]||=e=>r(`update:modelValue`,e?qY:i.value)},null,8,[`model-value`,`disabled`])]),q(`small`,KY,[n[4]||=Y(`一轮 = 派活 → 成员回答 → 交回主持人汇总;依次接力走完一圈算一轮。到上限后可一键继续,主持人也可提前申请轮数等你批准;不限时只能靠“全部停止”打断。`,-1),H(t.$slots,`default`,{},void 0,!0)])])}}},[[`__scopeId`,`data-v-5044340b`]]),XY={class:`effort-field`},ZY={key:0,class:`effort-caption`,"aria-hidden":`true`},QY=[`aria-label`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`],$Y=[`title`],eX=4.5,tX=6,nX=8,rX=1/240,iX=.001,aX=.01,oX=.05,sX=10,cX=4,lX=EH({__name:`EffortSlider`,props:{items:{type:Array,required:!0},modelValue:{type:String,default:``},label:{type:String,required:!0},caption:{type:String,default:``}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=I(null),a=Q(()=>n.items.length-1),o=Q(()=>Math.max(0,n.items.findIndex(e=>e.value===n.modelValue))),s=nn({x:o.value,v:0,target:o.value,hand:null,pointer:null}),c=Q(()=>Math.min(a.value,Math.max(0,s.x))/a.value),l=Q(()=>Math.round(Math.min(a.value,Math.max(0,s.x)))),u=0,d=0,f=0,p=0,m=!1,h=e=>Math.min(a.value,Math.max(0,e)),g=(e,t,n)=>-((2*Math.PI*n)**2)*e-4*Math.PI*n*t;function _(e){let t=s.hand??s.target,n=s.hand===null?eX:tX,r=(e,r)=>g(e-t,r,n)+(e<0||e>a.value?g(e-h(e),r,nX):0),i=s.x,o=s.v,c=r(i,o),l=o+c*e/2,u=r(i+o*e/2,l),d=o+u*e/2,f=r(i+l*e/2,d),p=o+f*e,m=r(i+d*e,p);s.x+=e*(o+2*l+2*d+p)/6,s.v+=e*(c+2*u+2*f+m)/6}function v(e){u=0;let t=Math.min(oX,(e-d)/1e3);for(d=e;t>0;){let e=Math.min(rX,t);_(e),t-=e}let n=s.hand??s.target;Math.abs(s.x-n)<iX&&Math.abs(s.v)<aX?(s.x=n,s.v=0):u=requestAnimationFrame(v)}function y(){u||=(d=performance.now(),requestAnimationFrame(v))}function b(e){s.target=h(Math.round(e)),r(`update:modelValue`,n.items[s.target].value),y()}function x(e){let t=i.value.getBoundingClientRect();return h((e.clientX-t.left-sX)/Math.max(1,t.width-20)*a.value)}function S(e){e.isPrimary&&e.button===0&&s.pointer===null&&(e.preventDefault(),i.value.focus(),i.value.setPointerCapture(e.pointerId),s.pointer=e.pointerId,f=e.clientX,m=!1,p=e.target.closest(`.effort-slider-thumb`)?s.x-x(e):0,s.hand=h(x(e)+p),y())}function C(e){s.pointer===e.pointerId&&(m||=Math.abs(e.clientX-f)>cX,s.hand=h(x(e)+p),y())}function w(e){if(s.pointer!==e.pointerId)return;let t=m?s.x+s.v/(4*Math.PI*eX):s.hand;s.hand=null,s.pointer=null,b(t)}function T(e){s.pointer===e.pointerId&&(s.hand=null,s.pointer=null,s.target=o.value,y())}function E(e){let t={ArrowRight:o.value+1,ArrowUp:o.value+1,ArrowLeft:o.value-1,ArrowDown:o.value-1,Home:0,End:a.value};e.key in t&&(e.preventDefault(),b(t[e.key]))}return z([o,a],()=>{s.target=o.value,y()}),ca(()=>cancelAnimationFrame(u)),(t,n)=>(W(),G(`div`,XY,[e.caption?(W(),G(`div`,ZY,[q(`span`,null,F(e.caption),1),J(Ac,{name:`effort-value`,mode:`out-in`},{default:R(()=>[(W(),G(`strong`,{key:l.value},F(e.items[l.value].label),1))]),_:1})])):X(``,!0),q(`div`,{ref_key:`track`,ref:i,class:N([`effort-slider`,{"is-dragging":s.pointer!==null}]),style:ye({"--progress":c.value}),role:`slider`,tabindex:`0`,"aria-label":e.label,"aria-valuemin":`0`,"aria-valuemax":a.value,"aria-valuenow":o.value,"aria-valuetext":e.items[o.value].label,onKeydown:E,onPointerdown:S,onPointermove:C,onPointerup:w,onPointercancel:T,onLostpointercapture:T},[n[0]||=q(`span`,{class:`effort-slider-track`,"aria-hidden":`true`},[q(`span`,{class:`effort-slider-fill`})],-1),(W(!0),G(U,null,V(e.items,(e,t)=>(W(),G(`span`,{key:e.value,class:N([`effort-slider-stop`,{"is-active":t<l.value,"is-current":t===l.value}]),"aria-hidden":`true`,style:ye({"--at":t/a.value}),title:e.label},null,14,$Y))),128)),n[1]||=q(`span`,{class:`effort-slider-thumb`,"aria-hidden":`true`},null,-1)],46,QY)]))}},[[`__scopeId`,`data-v-2135d88d`]]);function uX(e,t){if(typeof e!=`object`||!e)return!1;let n=Ym(e,t);return n!=null&&n!==``}function dX(e,t){let n=t?{xs:44,sm:48,md:52,lg:56,xl:60}:{xs:24,sm:28,md:32,lg:36,xl:40};return n[e]??n.md}function fX(e,t,n,r){let i=dX(t,!0),a=dX(t,!1);return r?()=>i:n?t=>uX(e[t],n)?i:a:()=>a}var pX={slots:{root:`relative inline-flex items-center`,base:[`rounded-md`,`transition-colors`],leading:`absolute inset-y-0 start-0 flex items-center`,leadingIcon:`shrink-0 text-dimmed`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,trailing:`group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none`,trailingIcon:`shrink-0 text-dimmed`,trailingClear:`p-0`,arrow:`fill-bg stroke-default`,content:`max-h-[min(15rem,var(--reka-combobox-content-available-height,15rem))] w-(--reka-combobox-trigger-width) bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] origin-(--reka-combobox-content-transform-origin) pointer-events-auto flex flex-col`,viewport:`relative scroll-py-1 overflow-y-auto flex-1`,group:`p-1 isolate`,empty:`text-center text-muted`,label:`font-semibold text-highlighted`,separator:`-mx-1 my-1 h-px bg-border`,item:[`group relative w-full flex items-start gap-1.5 p-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50`,`transition-colors before:transition-colors`],itemLeadingIcon:[`shrink-0 text-dimmed group-data-highlighted:not-group-data-disabled:text-default`,`transition-colors`],itemLeadingAvatar:`shrink-0`,itemLeadingAvatarSize:``,itemLeadingChip:`shrink-0`,itemLeadingChipSize:``,itemTrailing:`ms-auto inline-flex gap-1.5 items-center`,itemTrailingIcon:`shrink-0`,itemWrapper:`flex-1 flex flex-col min-w-0`,itemLabel:`truncate`,itemDescription:`truncate text-muted`,tagsItem:`px-1.5 py-0.5 rounded-sm font-medium inline-flex items-center gap-0.5 ring ring-inset ring-accented bg-elevated text-default data-disabled:cursor-not-allowed data-disabled:opacity-75`,tagsItemText:`truncate`,tagsItemDelete:[`inline-flex items-center rounded-xs text-dimmed hover:text-default hover:bg-accented/75 disabled:pointer-events-none`,`transition-colors`],tagsItemDeleteIcon:`shrink-0`,tagsInput:`flex-1 border-0 bg-transparent placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75`},variants:{fieldGroup:{horizontal:{root:`group has-focus-visible:z-[1]`},vertical:{root:`group has-focus-visible:z-[1]`}},size:{xs:{base:`px-2 py-1 text-sm/4 gap-1`,leading:`ps-2`,trailing:`pe-2`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`,label:`p-1 text-[10px]/3 gap-1`,item:`p-1 text-xs gap-1`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailingIcon:`size-4`,tagsItem:`text-[10px]/3`,tagsItemDeleteIcon:`size-3`,empty:`p-2 text-xs`},sm:{base:`px-2.5 py-1.5 text-sm/4 gap-1.5`,leading:`ps-2.5`,trailing:`pe-2.5`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`,label:`p-1.5 text-[10px]/3 gap-1.5`,item:`p-1.5 text-xs gap-1.5`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailingIcon:`size-4`,tagsItem:`text-[10px]/3`,tagsItemDeleteIcon:`size-3`,empty:`p-2.5 text-xs`},md:{base:`px-2.5 py-1.5 text-base/5 gap-1.5`,leading:`ps-2.5`,trailing:`pe-2.5`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`,label:`p-1.5 text-xs gap-1.5`,item:`p-1.5 text-sm gap-1.5`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailingIcon:`size-5`,tagsItem:`text-xs`,tagsItemDeleteIcon:`size-3.5`,empty:`p-2.5 text-sm`},lg:{base:`px-3 py-2 text-base/5 gap-2`,leading:`ps-3`,trailing:`pe-3`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`,label:`p-2 text-xs gap-2`,item:`p-2 text-sm gap-2`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailingIcon:`size-5`,tagsItem:`text-xs`,tagsItemDeleteIcon:`size-3.5`,empty:`p-3 text-sm`},xl:{base:`px-3 py-2 text-base gap-2`,leading:`ps-3`,trailing:`pe-3`,leadingIcon:`size-6`,leadingAvatarSize:`xs`,trailingIcon:`size-6`,label:`p-2 text-sm gap-2`,item:`p-2 text-base gap-2`,itemLeadingIcon:`size-6`,itemLeadingAvatarSize:`xs`,itemLeadingChip:`size-6`,itemLeadingChipSize:`lg`,itemTrailingIcon:`size-6`,tagsItem:`text-sm`,tagsItemDeleteIcon:`size-4`,empty:`p-3 text-base`}},variant:{outline:`text-highlighted bg-default ring ring-inset ring-accented`,soft:`text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50`,subtle:`text-highlighted bg-elevated ring ring-inset ring-accented`,ghost:`text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent`,none:`text-highlighted bg-transparent focus:outline-none`},color:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},leading:{true:``},trailing:{true:``},loading:{true:``},highlight:{true:``},fixed:{false:``},type:{file:`file:me-1.5 file:font-medium file:text-muted file:outline-none`},virtualize:{true:{viewport:`p-1 isolate`},false:{viewport:`divide-y divide-default`}},multiple:{true:{root:`flex-wrap`},false:{base:`w-full border-0 placeholder:text-dimmed disabled:cursor-not-allowed disabled:opacity-75`}}},compoundVariants:[{multiple:!1,fieldGroup:`horizontal`,class:{base:`group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none`}},{multiple:!1,fieldGroup:`vertical`,class:{base:`group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none`}},{multiple:!0,fieldGroup:`horizontal`,class:{base:`not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]`}},{multiple:!0,fieldGroup:`vertical`,class:{base:`not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]`}},{variant:`soft`,multiple:!0,class:`has-focus:bg-elevated has-focus-visible:outline-3`},{variant:`ghost`,multiple:!0,class:`has-focus:bg-elevated has-focus-visible:outline-3`},{color:`primary`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-primary`},{color:`secondary`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-secondary`},{color:`success`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-success`},{color:`info`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-info`},{color:`warning`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-warning`},{color:`error`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-error`},{color:`neutral`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-inverted`},{color:`primary`,variant:[`outline`,`subtle`],class:`outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary`},{color:`secondary`,variant:[`outline`,`subtle`],class:`outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary`},{color:`success`,variant:[`outline`,`subtle`],class:`outline-success/25 focus-visible:outline-3 focus-visible:ring-success`},{color:`info`,variant:[`outline`,`subtle`],class:`outline-info/25 focus-visible:outline-3 focus-visible:ring-info`},{color:`warning`,variant:[`outline`,`subtle`],class:`outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning`},{color:`error`,variant:[`outline`,`subtle`],class:`outline-error/25 focus-visible:outline-3 focus-visible:ring-error`},{color:`primary`,variant:[`soft`,`ghost`],class:`outline-primary/25 focus-visible:outline-3`},{color:`secondary`,variant:[`soft`,`ghost`],class:`outline-secondary/25 focus-visible:outline-3`},{color:`success`,variant:[`soft`,`ghost`],class:`outline-success/25 focus-visible:outline-3`},{color:`info`,variant:[`soft`,`ghost`],class:`outline-info/25 focus-visible:outline-3`},{color:`warning`,variant:[`soft`,`ghost`],class:`outline-warning/25 focus-visible:outline-3`},{color:`error`,variant:[`soft`,`ghost`],class:`outline-error/25 focus-visible:outline-3`},{color:`primary`,highlight:!0,class:`ring ring-inset ring-primary`},{color:`secondary`,highlight:!0,class:`ring ring-inset ring-secondary`},{color:`success`,highlight:!0,class:`ring ring-inset ring-success`},{color:`info`,highlight:!0,class:`ring ring-inset ring-info`},{color:`warning`,highlight:!0,class:`ring ring-inset ring-warning`},{color:`error`,highlight:!0,class:`ring ring-inset ring-error`},{color:`neutral`,variant:[`outline`,`subtle`],class:`outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted`},{color:`neutral`,variant:[`soft`,`ghost`],class:`outline-inverted/25 focus-visible:outline-3`},{color:`neutral`,highlight:!0,class:`ring ring-inset ring-inverted`},{leading:!0,size:`xs`,class:`ps-7`},{leading:!0,size:`sm`,class:`ps-8`},{leading:!0,size:`md`,class:`ps-9`},{leading:!0,size:`lg`,class:`ps-10`},{leading:!0,size:`xl`,class:`ps-11`},{trailing:!0,size:`xs`,class:`pe-7`},{trailing:!0,size:`sm`,class:`pe-8`},{trailing:!0,size:`md`,class:`pe-9`},{trailing:!0,size:`lg`,class:`pe-10`},{trailing:!0,size:`xl`,class:`pe-11`},{loading:!0,leading:!0,class:{leadingIcon:`animate-spin`}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:`animate-spin`}},{fixed:!1,size:`xs`,class:`md:text-xs`},{fixed:!1,size:`sm`,class:`md:text-xs`},{fixed:!1,size:`md`,class:`md:text-sm`},{fixed:!1,size:`lg`,class:`md:text-sm`}],defaultVariants:{size:`md`,color:`primary`,variant:`outline`}},mX=Object.assign({inheritAttrs:!1},{__name:`InputMenu`,props:Ha({as:{type:null,required:!1},id:{type:String,required:!1},type:{type:null,required:!1,default:`text`},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},deleteIcon:{type:null,required:!1},clear:{type:[Boolean,Object],required:!1},clearIcon:{type:null,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},virtualize:{type:[Boolean,Object],required:!1,default:!1},valueKey:{type:null,required:!1},labelKey:{type:null,required:!1,default:`label`},descriptionKey:{type:null,required:!1,default:`description`},items:{type:null,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},multiple:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},mode:{type:String,required:!1,default:`combobox`},createItem:{type:[Boolean,String,Object],required:!1},filterFields:{type:Array,required:!1},ignoreFilter:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},resetSearchTermOnBlur:{type:Boolean,required:!1,default:!0},resetSearchTermOnSelect:{type:Boolean,required:!1,default:!0},resetModelValueOnClear:{type:Boolean,required:!1,default:!0},highlightOnHover:{type:Boolean,required:!1},openOnClick:{type:Boolean,required:!1},openOnFocus:{type:Boolean,required:!1},by:{type:[String,Function],required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},{searchTerm:{type:String,default:``},searchTermModifiers:{}}),emits:Ha([`change`,`blur`,`focus`,`create`,`clear`,`highlight`,`remove-tag`,`update:modelValue`,`update:open`],[`update:searchTerm`]),setup(e,{expose:t,emit:n}){let r=e,i=n,a=La(),o=AE(`inputMenu`,r),s=uo(e,`searchTerm`,{type:String,default:``}),{t:c}=ch(),l=Am(),{filterGroups:u}=WB(),d=Q(()=>o.mode===`autocomplete`),f=Q(()=>!!o.multiple&&!d.value),p=pm(o,`as`,`modelValue`,`defaultValue`,`open`,`defaultOpen`,`required`,`multiple`,`resetSearchTermOnBlur`,`resetSearchTermOnSelect`,`resetModelValueOnClear`,`highlightOnHover`,`openOnClick`,`openOnFocus`,`by`),m=fm(p,`multiple`,`resetSearchTermOnSelect`,`resetModelValueOnClear`,`by`),h=jE(Q(()=>d.value?m:p),i),g=Q(()=>d.value?SV:CV),_=Ra(),v=Q(()=>f.value?_[`data-slot`]??`base`:`base`),y=CE(kn(()=>o.portal)),b=kn(()=>Im(o.content,{side:`bottom`,sideOffset:8,collisionPadding:8,position:`popper`})),x=kn(()=>Im(o.arrow,{rounded:!0})),S=Q(()=>typeof o.clear==`object`?o.clear:{}),C=kn(()=>o.virtualize?Im(typeof o.virtualize==`boolean`?{}:o.virtualize,{estimateSize:fX(xe.value,ue.value??`md`,o.descriptionKey,!!a[`item-description`])}):!1),{emitFormBlur:w,emitFormFocus:T,emitFormChange:E,emitFormInput:D,size:O,color:k,id:A,name:ee,highlight:j,disabled:te,ariaAttrs:ne}=pA(r),{orientation:M,size:re}=iA(r),{isLeading:ie,isTrailing:ae,leadingIconName:oe,trailingIconName:se}=nA(Q(()=>({icon:o.icon,leading:o.leading,leadingIcon:o.leadingIcon,trailing:o.trailing,trailingIcon:o.trailingIcon??l.ui.icons.chevronDown,loading:o.loading,loadingIcon:o.loadingIcon}))),ce=Q(()=>k.value??o.color),le=Q(()=>j.value??o.highlight),ue=Q(()=>re.value??O.value??o.size),de=Q(()=>te.value??o.disabled),[fe,pe]=wm(),[me,he]=wm({props:{item:{type:[Object,String,Number,Boolean],required:!0},index:{type:Number,required:!1}}}),ge=Q(()=>Jk({extend:pX,...l.ui?.inputMenu||{}})({color:ce.value,variant:o.variant,size:ue.value,loading:o.loading,highlight:le.value,fixed:o.fixed,leading:ie.value||!!o.avatar||!!a.leading,trailing:ae.value||!!a.trailing,multiple:f.value,fieldGroup:M.value,virtualize:!!o.virtualize})),_e=Q(()=>ye.value.flatMap(e=>e));function ve(e){return $m(_e.value,e,{labelKey:o.labelKey,valueKey:o.valueKey,by:o.by})??``}let ye=Q(()=>o.items?.length?eh(o.items)?o.items:[o.items]:[]),be=Q(()=>{if(o.ignoreFilter||!s.value)return ye.value;let e=Array.isArray(o.filterFields)?o.filterFields:[o.labelKey];return u(ye.value,s.value,{fields:e,isStructural:e=>Le(e)&&!!e.type&&[`label`,`separator`].includes(e.type)})}),xe=Q(()=>be.value.flatMap(e=>e)),Se=Q(()=>{if(!o.createItem||!s.value)return!1;let e=o.valueKey?{[o.valueKey]:s.value}:s.value;return typeof o.createItem==`object`&&o.createItem.when===`always`||o.createItem===`always`?!xe.value.find(t=>Zm(t,e,o.by??o.valueKey)):!xe.value.length}),Ce=Q(()=>typeof o.createItem==`object`?o.createItem.position:`bottom`),we=hi(`inputRef`);function Te(){o.autofocus&&we.value?.$el?.focus()}let Ee;aa(()=>{ar(()=>{d.value?s.value=String(o.modelValue??o.defaultValue??``):s.value=``}),Ee=setTimeout(()=>{Te()},o.autofocusDelay)}),Be(()=>clearTimeout(Ee)),z(()=>o.modelValue,e=>{d.value&&(s.value=String(e??``))});function De(e){if(fn(o.modelValue)===e)return;o.modelModifiers?.trim&&(typeof e==`string`||e==null)&&(e=e?.trim()??null),o.modelModifiers?.number&&(e=Xm(e)),o.modelModifiers?.nullable&&(e??=null),o.modelModifiers?.optional&&!o.modelModifiers?.nullable&&e!==null&&(e??=void 0);let t=new Event(`change`,{target:{value:e}});i(`change`,t),E(),D(),d.value?s.value=String(e??``):o.resetSearchTermOnSelect&&(s.value=``)}function Oe(e){d.value||(s.value=e)}function ke(e){i(`blur`,e),w()}function Ae(e){i(`focus`,e),T()}let je=I(!1),Me;Be(()=>clearTimeout(Me));function Ne(e){if(je.value=e,e){let e=new FocusEvent(`focus`);i(`focus`,e),T(),clearTimeout(Me)}else{let e=new FocusEvent(`blur`);i(`blur`,e),w(),!d.value&&o.resetSearchTermOnBlur&&(Me=setTimeout(()=>{s.value=``},100))}}function Pe(e,t){if(o.multiple){let n=t.filter(t=>!Um(t,e));i(`update:modelValue`,n),i(`remove-tag`,e),De(n)}}function Fe(e){e.preventDefault(),e.stopPropagation(),i(`create`,s.value)}function Ie(e,t){Le(t)&&(t.disabled?e.preventDefault():t.onSelect?.(e))}function Le(e){return typeof e==`object`&&!!e}function Re(e){return o.multiple&&Array.isArray(e)?e.length===0:e==null||e===``}function ze(){de.value||i(`clear`)}function Ve(e){!e.isComposing&&s.value&&e.preventDefault()}let He=hi(`viewportRef`),Ue=hi(`comboboxRootRef`);return z(()=>o.items,async()=>{je.value&&o.createItem&&(await ar(),Ue.value?.highlightFirstItem?.())},{flush:`post`}),t({inputRef:kn(()=>we.value?.$el),viewportRef:kn(()=>He.value)}),(e,t)=>(W(),G(U,null,[J(L(fe),null,{default:R(()=>[J(L(g).Item,{"data-slot":`item`,class:N(ge.value.item({class:L(o).ui?.item})),value:s.value,onSelect:Fe},{default:R(()=>[q(`span`,{"data-slot":`itemLabel`,class:N(ge.value.itemLabel({class:L(o).ui?.itemLabel}))},[H(e.$slots,`create-item-label`,{item:s.value},()=>[Y(F(L(c)(`inputMenu.create`,{label:s.value})),1)])],2)]),_:3},8,[`class`,`value`])]),_:3}),J(L(me),null,{default:R(({item:t,index:n})=>[Le(t)&&t.type===`label`?(W(),K(L(g).Label,{key:0,"data-slot":`label`,class:N(ge.value.label({class:[L(o).ui?.label,t.ui?.label,t.class]}))},{default:R(()=>[Y(F(L(Ym)(t,L(o).labelKey)),1)]),_:2},1032,[`class`])):Le(t)&&t.type===`separator`?(W(),K(L(g).Separator,{key:1,"data-slot":`separator`,class:N(ge.value.separator({class:[L(o).ui?.separator,t.ui?.separator,t.class]}))},null,8,[`class`])):(W(),K(L(g).Item,{key:2,"data-slot":`item`,class:N(ge.value.item({class:[L(o).ui?.item,Le(t)&&t.ui?.item,Le(t)&&t.class]})),disabled:Le(t)&&t.disabled,value:L(o).valueKey&&Le(t)?L(Ym)(t,L(o).valueKey):t,onSelect:e=>Ie(e,t)},{default:R(()=>[H(e.$slots,`item`,{item:t,index:n,ui:ge.value},()=>[H(e.$slots,`item-leading`,{item:t,index:n,ui:ge.value},()=>[Le(t)&&t.icon?(W(),K(Yk,{key:0,name:t.icon,"data-slot":`itemLeadingIcon`,class:N(ge.value.itemLeadingIcon({class:[L(o).ui?.itemLeadingIcon,t.ui?.itemLeadingIcon]}))},null,8,[`name`,`class`])):Le(t)&&t.avatar?(W(),K(tA,Z({key:1,size:t.ui?.itemLeadingAvatarSize||L(o).ui?.itemLeadingAvatarSize||ge.value.itemLeadingAvatarSize()},t.avatar,{"data-slot":`itemLeadingAvatar`,class:ge.value.itemLeadingAvatar({class:[L(o).ui?.itemLeadingAvatar,t.ui?.itemLeadingAvatar]})}),null,16,[`size`,`class`])):Le(t)&&t.chip?(W(),K($k,Z({key:2,size:t.ui?.itemLeadingChipSize||L(o).ui?.itemLeadingChipSize||ge.value.itemLeadingChipSize(),inset:``,standalone:``},t.chip,{"data-slot":`itemLeadingChip`,class:ge.value.itemLeadingChip({class:[L(o).ui?.itemLeadingChip,t.ui?.itemLeadingChip]})}),null,16,[`size`,`class`])):X(``,!0)]),q(`span`,{"data-slot":`itemWrapper`,class:N(ge.value.itemWrapper({class:[L(o).ui?.itemWrapper,Le(t)&&t.ui?.itemWrapper]}))},[q(`span`,{"data-slot":`itemLabel`,class:N(ge.value.itemLabel({class:[L(o).ui?.itemLabel,Le(t)&&t.ui?.itemLabel]}))},[H(e.$slots,`item-label`,{item:t,index:n},()=>[Y(F(Le(t)?L(Ym)(t,L(o).labelKey):t),1)])],2),Le(t)&&(L(Ym)(t,L(o).descriptionKey)||a[`item-description`])?(W(),G(`span`,{key:0,"data-slot":`itemDescription`,class:N(ge.value.itemDescription({class:[L(o).ui?.itemDescription,Le(t)&&t.ui?.itemDescription]}))},[H(e.$slots,`item-description`,{item:t,index:n},()=>[Y(F(L(Ym)(t,L(o).descriptionKey)),1)])],2)):X(``,!0)],2),q(`span`,{"data-slot":`itemTrailing`,class:N(ge.value.itemTrailing({class:[L(o).ui?.itemTrailing,Le(t)&&t.ui?.itemTrailing]}))},[H(e.$slots,`item-trailing`,{item:t,index:n,ui:ge.value}),d.value?X(``,!0):(W(),K(L(g).ItemIndicator,{key:0,"as-child":``},{default:R(()=>[J(Yk,{name:L(o).selectedIcon||L(l).ui.icons.check,"data-slot":`itemTrailingIcon`,class:N(ge.value.itemTrailingIcon({class:[L(o).ui?.itemTrailingIcon,Le(t)&&t.ui?.itemTrailingIcon]}))},null,8,[`name`,`class`])]),_:2},1024))],2)])]),_:2},1032,[`class`,`disabled`,`value`,`onSelect`]))]),_:3}),J(L(g).Root,Z({ref_key:`comboboxRootRef`,ref:Ue},L(h),{name:L(ee),disabled:de.value,"data-slot":e.$attrs[`data-slot`]??`root`,class:ge.value.root({class:[L(o).ui?.root,L(o).class]}),"as-child":f.value,"ignore-filter":``,"onUpdate:modelValue":De,"onUpdate:open":Ne}),{default:R(({modelValue:n,open:r})=>[J(L(g).Anchor,{"as-child":!f.value,"data-slot":v.value,class:N(ge.value.base({class:L(o).ui?.base}))},{default:R(()=>[f.value?(W(),K(L(PT),{key:0,"model-value":n,disabled:de.value,required:L(o).required,delimiter:``,"as-child":``,onBlur:ke,onFocus:Ae,onRemoveTag:e=>Pe(e,n)},{default:R(({modelValue:n})=>[(W(!0),G(U,null,V(n,(t,n)=>(W(),K(L(RT),{key:n,value:t,"data-slot":`tagsItem`,class:N(ge.value.tagsItem({class:[L(o).ui?.tagsItem,Le(t)&&t.ui?.tagsItem]}))},{default:R(()=>[J(L(BT),{"data-slot":`tagsItemText`,class:N(ge.value.tagsItemText({class:[L(o).ui?.tagsItemText,Le(t)&&t.ui?.tagsItemText]}))},{default:R(()=>[H(e.$slots,`tags-item-text`,{item:t,index:n},()=>[Y(F(ve(t)),1)])]),_:2},1032,[`class`]),J(L(zT),{"data-slot":`tagsItemDelete`,class:N(ge.value.tagsItemDelete({class:[L(o).ui?.tagsItemDelete,Le(t)&&t.ui?.tagsItemDelete]})),disabled:de.value},{default:R(()=>[H(e.$slots,`tags-item-delete`,{item:t,index:n,ui:ge.value},()=>[J(Yk,{name:L(o).deleteIcon||L(l).ui.icons.close,"data-slot":`tagsItemDeleteIcon`,class:N(ge.value.tagsItemDeleteIcon({class:[L(o).ui?.tagsItemDeleteIcon,Le(t)&&t.ui?.tagsItemDeleteIcon]}))},null,8,[`name`,`class`])])]),_:2},1032,[`class`,`disabled`])]),_:2},1032,[`value`,`class`]))),128)),J(L(g).Input,{modelValue:s.value,"onUpdate:modelValue":t[1]||=e=>s.value=e,"as-child":``},{default:R(()=>[J(L(FT),Z({id:L(A),ref_key:`inputRef`,ref:we},{...e.$attrs,...L(ne)},{placeholder:L(o).placeholder,"data-slot":`tagsInput`,class:ge.value.tagsInput({class:L(o).ui?.tagsInput}),onChange:t[0]||=_u(()=>{},[`stop`]),onKeydown:yu(Ve,[`enter`])}),null,16,[`id`,`placeholder`,`class`])]),_:1},8,[`modelValue`])]),_:3},8,[`model-value`,`disabled`,`required`,`onRemoveTag`])):(W(),K(L(g).Input,Z({key:1,id:L(A),ref_key:`inputRef`,ref:we},{...d.value?{}:{displayValue:ve},...e.$attrs,...L(ne)},{"data-slot":`base`,type:L(o).type,placeholder:L(o).placeholder,required:L(o).required,onBlur:ke,onFocus:Ae,onChange:t[2]||=_u(()=>{},[`stop`]),"onUpdate:modelValue":Oe}),null,16,[`id`,`type`,`placeholder`,`required`])),L(ie)||L(o).avatar||a.leading?(W(),G(`span`,{key:2,"data-slot":`leading`,class:N(ge.value.leading({class:L(o).ui?.leading}))},[H(e.$slots,`leading`,{modelValue:n,open:r,ui:ge.value},()=>[L(ie)&&L(oe)?(W(),K(Yk,{key:0,name:L(oe),"data-slot":`leadingIcon`,class:N(ge.value.leadingIcon({class:L(o).ui?.leadingIcon}))},null,8,[`name`,`class`])):L(o).avatar?(W(),K(tA,Z({key:1,size:L(o).ui?.itemLeadingAvatarSize||ge.value.itemLeadingAvatarSize()},L(o).avatar,{"data-slot":`itemLeadingAvatar`,class:ge.value.itemLeadingAvatar({class:L(o).ui?.itemLeadingAvatar})}),null,16,[`size`,`class`])):X(``,!0)])],2)):X(``,!0),L(ae)||a.trailing||L(o).clear?(W(),K(L(g).Trigger,{key:3,"data-slot":`trailing`,class:N(ge.value.trailing({class:L(o).ui?.trailing}))},{default:R(()=>[H(e.$slots,`trailing`,{modelValue:n,open:r,ui:ge.value},()=>[L(o).clear&&!de.value&&!Re(n)?(W(),K(L(g).Cancel,{key:0,"as-child":``},{default:R(()=>[J(bA,Z({as:`span`,icon:L(o).clearIcon||L(l).ui.icons.close,size:ue.value,variant:`link`,color:`neutral`,tabindex:`-1`},S.value,{"data-slot":`trailingClear`,class:ge.value.trailingClear({class:L(o).ui?.trailingClear}),onClick:_u(ze,[`stop`])}),null,16,[`icon`,`size`,`class`])]),_:1})):L(se)?(W(),K(Yk,{key:1,name:L(se),"data-slot":`trailingIcon`,class:N(ge.value.trailingIcon({class:L(o).ui?.trailingIcon}))},null,8,[`name`,`class`])):X(``,!0)])]),_:2},1032,[`class`])):X(``,!0)]),_:2},1032,[`as-child`,`data-slot`,`class`]),J(L(g).Portal,P(ks(L(y))),{default:R(()=>[J(L(aA),null,{default:R(()=>[J(L(g).Content,Z({"data-slot":`content`,class:ge.value.content({class:L(o).ui?.content})},b.value,{onFocusOutside:t[3]||=_u(()=>{},[`prevent`])}),{default:R(()=>[H(e.$slots,`content-top`),J(L(g).Empty,{"data-slot":`empty`,class:N(ge.value.empty({class:L(o).ui?.empty}))},{default:R(()=>[H(e.$slots,`empty`,{searchTerm:s.value},()=>[Y(F(s.value?L(c)(`inputMenu.noMatch`,{searchTerm:s.value}):L(c)(`inputMenu.noData`)),1)])]),_:3},8,[`class`]),q(`div`,{ref_key:`viewportRef`,ref:He,role:`presentation`,"data-slot":`viewport`,class:N(ge.value.viewport({class:L(o).ui?.viewport}))},[L(o).virtualize?(W(),G(U,{key:0},[Se.value&&Ce.value===`top`?(W(),K(L(pe),{key:0})):X(``,!0),J(L(g).Virtualizer,Z({options:xe.value,"text-content":e=>Le(e)?L(Ym)(e,L(o).labelKey):String(e)},C.value),{default:R(({option:e,virtualItem:t})=>[J(L(he),{item:e,index:t.index},null,8,[`item`,`index`])]),_:1},16,[`options`,`text-content`]),Se.value&&Ce.value===`bottom`?(W(),K(L(pe),{key:1})):X(``,!0)],64)):(W(),G(U,{key:1},[Se.value&&Ce.value===`top`?(W(),K(L(g).Group,{key:0,"data-slot":`group`,class:N(ge.value.group({class:L(o).ui?.group}))},{default:R(()=>[J(L(pe))]),_:1},8,[`class`])):X(``,!0),(W(!0),G(U,null,V(be.value,(e,t)=>(W(),K(L(g).Group,{key:`group-${t}`,"data-slot":`group`,class:N(ge.value.group({class:L(o).ui?.group}))},{default:R(()=>[(W(!0),G(U,null,V(e,(e,n)=>(W(),K(L(he),{key:`group-${t}-${n}`,item:e,index:n},null,8,[`item`,`index`]))),128))]),_:2},1032,[`class`]))),128)),Se.value&&Ce.value===`bottom`?(W(),K(L(g).Group,{key:1,"data-slot":`group`,class:N(ge.value.group({class:L(o).ui?.group}))},{default:R(()=>[J(L(pe))]),_:1},8,[`class`])):X(``,!0)],64))],2),H(e.$slots,`content-bottom`),L(o).arrow?(W(),K(L(g).Arrow,Z({key:0},x.value,{"data-slot":`arrow`,class:ge.value.arrow({class:L(o).ui?.arrow})}),null,16,[`class`])):X(``,!0)]),_:3},16,[`class`])]),_:3})]),_:3},16)]),_:3},16,[`name`,`disabled`,`data-slot`,`class`,`as-child`])],64))}}),hX={class:`api-settings`},gX={class:`api-field`,title:`Base URL`},_X={class:`api-field`,title:`OpenRouter 等兼容服务可选 Chat Completions,并填写该服务的完整模型 ID。`},vX={class:`api-field`},yX={class:`api-field`},bX={class:`api-inline`},xX={key:0,role:`alert`},SX=`••••••••••••`,CX=EH({__name:`ApiSettings`,props:{name:{type:String,required:!0}},setup(e){let t=e,{view:n,bridge:r}=Or(`discussion`),i=Q(()=>n.value.launch.profiles[t.name]||{}),a=Q(()=>r.launch_model_state(t.name,n.value.launch)),o=I(``),s=I(!1),c=I(!1),l=I(``),u=[{value:`responses`,label:`OpenAI Responses`},{value:`chat`,label:`OpenAI Chat Completions`},{value:`anthropic`,label:`Anthropic Messages`},{value:`gemini`,label:`Gemini generateContent`}];z(()=>i.value.base_url,()=>{o.value=l.value=``});let d=(e,n)=>r.write_launch(t.name,e,n);async function f(){if(o.value.trim()&&o.value!==l.value&&n.value.launch.available&&!c.value){c.value=!0;try{await r.save_launch_api_key(t.name,o.value),l.value=o.value}catch(e){r.notify(`error`,e.message)}finally{c.value=!1}}}return(t,n)=>{let l=hV,p=WV,m=bA,h=mX;return W(),G(`div`,hX,[q(`label`,gX,[n[6]||=q(`span`,null,`地址`,-1),J(l,{"model-value":i.value.base_url||``,"aria-label":`${e.name} Base URL`,placeholder:`Base URL`,class:`w-full`,size:`xs`,"onUpdate:modelValue":n[0]||=e=>d(`base_url`,e)},null,8,[`model-value`,`aria-label`])]),q(`div`,_X,[n[7]||=q(`span`,null,`协议`,-1),J(p,{"model-value":i.value.api_protocol||``,items:u,"aria-label":`${e.name} API 请求协议`,class:`w-full`,size:`xs`,"onUpdate:modelValue":n[1]||=e=>d(`api_protocol`,e)},null,8,[`model-value`,`aria-label`])]),q(`div`,vX,[n[8]||=q(`span`,null,`密钥`,-1),J(l,{modelValue:o.value,"onUpdate:modelValue":n[3]||=e=>o.value=e,type:`text`,autocomplete:`off`,spellcheck:`false`,"data-1p-ignore":``,"data-lpignore":`true`,placeholder:i.value.api_key_ref?SX:`填写 API Key`,title:i.value.api_key_ref&&!o.value?`已保存;本机不回传密钥,输入新 Key 可更换`:void 0,"aria-label":`${e.name} API Key`,size:`xs`,class:`w-full`,loading:c.value,ui:{base:s.value?``:`api-key-masked`,trailing:`pe-0.5`},onChange:f},{trailing:R(()=>[J(m,{icon:s.value?`i-lucide-eye`:`i-lucide-eye-off`,disabled:!o.value,"aria-label":s.value?`隐藏密钥`:`显示密钥`,"aria-pressed":s.value,size:`xs`,color:`neutral`,variant:`link`,onClick:n[2]||=e=>s.value=!s.value},null,8,[`icon`,`disabled`,`aria-label`,`aria-pressed`])]),_:1},8,[`modelValue`,`placeholder`,`title`,`aria-label`,`loading`,`ui`])]),q(`div`,yX,[n[9]||=q(`span`,null,`模型`,-1),q(`div`,bX,[J(h,{mode:`autocomplete`,"ignore-filter":``,"model-value":i.value.model||``,items:a.value.items,"value-key":`value`,"aria-label":`${e.name} API 模型 ID`,placeholder:`推荐模型或完整 ID`,class:`w-full min-w-0`,size:`xs`,"onUpdate:modelValue":n[4]||=e=>d(`model`,e)},null,8,[`model-value`,`items`,`aria-label`]),J(m,{icon:`i-lucide-refresh-cw`,"aria-label":`读取 ${e.name} 的模型列表`,title:`读取模型列表`,size:`xs`,color:`neutral`,variant:`ghost`,loading:a.value.loading,disabled:!i.value.api_key_ref,onClick:n[5]||=t=>L(r).load_launch_models(e.name,!0)},null,8,[`aria-label`,`loading`,`disabled`])])]),a.value.error?(W(),G(`p`,xX,F(a.value.error),1)):X(``,!0)])}}},[[`__scopeId`,`data-v-d6ee9f93`]]),wX={key:0,class:`member-text-fixed`},TX={key:1,class:`member-text-source`},EX={class:`member-text-meta`},DX={class:`member-text-footer`},OX=EH({__name:`MemberTextDialog`,props:Ha({title:{type:String,required:!0},description:{type:String,default:``},label:{type:String,required:!0},placeholder:{type:String,default:``},max:{type:Number,required:!0},rows:{type:Number,default:5},note:{type:String,default:``},source:{type:Object,default:null},fixed:{type:Object,default:null},changed:Boolean,saving:Boolean,readonly:Boolean},{open:{type:Boolean,default:!1},openModifiers:{},draft:{type:String,default:``},draftModifiers:{}}),emits:Ha([`save`],[`update:open`,`update:draft`]),setup(e,{emit:t}){let n=e,r=uo(e,`open`),i=uo(e,`draft`),a=t,o=Q(()=>i.value.length>=n.max*.9);function s(){n.changed&&!n.saving&&!n.readonly&&a(`save`)}return(t,n)=>{let a=Yk,c=cV,l=bA,u=$B;return W(),K(u,{content:{onInteractOutside:e=>e.preventDefault()},open:r.value,"onUpdate:open":n[3]||=e=>r.value=e,title:e.title,description:e.description,ui:{content:`glass-panel studio-modal`,body:`dialog-body`}},{body:R(()=>[q(`form`,{class:`member-text`,onSubmit:_u(s,[`prevent`])},[H(t.$slots,`lead`,{},void 0,!0),e.fixed?(W(),G(`details`,wX,[q(`summary`,null,[J(a,{name:`i-lucide-lock`}),Y(F(e.fixed.summary),1),J(a,{name:`i-lucide-chevron-down`,class:`member-text-fixed-chevron`})]),(W(!0),G(U,null,V(e.fixed.sections,e=>(W(),G(`section`,{key:e.label},[q(`h4`,null,F(e.label),1),q(`p`,null,F(e.text),1)]))),128))])):X(``,!0),e.source&&!e.readonly?(W(),G(`div`,TX,[J(a,{name:`i-lucide-bookmark`}),q(`p`,null,[q(`b`,null,F(e.source.tag),1),Y(F(e.source.text),1)]),q(`button`,{type:`button`,onClick:n[0]||=t=>i.value=e.source.text},F(e.source.action),1)])):X(``,!0),J(c,{modelValue:i.value,"onUpdate:modelValue":n[1]||=e=>i.value=e,rows:e.rows,maxlength:e.max,autoresize:``,maxrows:e.rows*2,autofocus:``,class:`w-full`,"aria-label":e.label,placeholder:e.placeholder,readonly:e.readonly,onKeydown:[yu(_u(s,[`ctrl`,`prevent`]),[`enter`]),yu(_u(s,[`meta`,`prevent`]),[`enter`])]},null,8,[`modelValue`,`rows`,`maxlength`,`maxrows`,`aria-label`,`placeholder`,`readonly`,`onKeydown`]),q(`div`,EX,[q(`span`,null,F(e.note),1),q(`span`,{class:N({"is-near":o.value})},F(i.value.length)+` / `+F(e.max),3)]),q(`div`,DX,[q(`div`,null,[H(t.$slots,`extra`,{},void 0,!0)]),J(l,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:n[2]||=e=>r.value=!1}),e.readonly?X(``,!0):(W(),K(l,{key:0,type:`submit`,label:`保存`,class:`channel-primary-button`,loading:e.saving,disabled:!e.changed},null,8,[`loading`,`disabled`]))])],32)]),_:3},8,[`content`,`open`,`title`,`description`])}}},[[`__scopeId`,`data-v-97866b66`]]),kX={class:`member-label-field`},AX=500,jX=32,MX=EH({__name:`MemberDescriptionDialog`,props:Ha({name:{type:String,required:!0},platform:{type:String,default:``},text:{type:String,default:``},label:{type:String,default:``},default_label:{type:String,default:``},template:{type:String,default:``},saving:Boolean},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:Ha([`save`],[`update:open`]),setup(e,{emit:t}){let n=e,r=uo(e,`open`),i=t,a=I(``),o=I(``),s=I(!1),c=I({name:``,platform:``,text:``,template:``,label:``,default:``});z(r,e=>{e&&(c.value={name:n.name,platform:n.platform,text:n.text.trim(),template:n.template.trim(),label:n.label.trim(),default:n.default_label||n.name},a.value=n.text,o.value=n.label,s.value=!1)},{immediate:!0});let l=Q(()=>a.value.trim()),u=Q(()=>c.value.template&&l.value!==c.value.template?{tag:`${c.value.platform} 的默认描述`,text:c.value.template,action:`填入`}:null),d=Q(()=>!!(c.value.platform&&l.value&&l.value!==c.value.template)),f=Q(()=>o.value.trim()!==c.value.label),p=Q(()=>l.value!==c.value.text||f.value||s.value&&d.value),m=Q(()=>s.value&&d.value?`之后添加 ${c.value.platform} 时自动填入这段描述`:l.value?`标签或一段话都行,Ctrl + Enter 保存`:`留空表示不提供描述`);z(d,e=>{e||(s.value=!1)});function h(){i(`save`,{text:l.value,label:f.value?o.value.trim():void 0,as_template:s.value&&d.value})}return(t,n)=>{let i=hV,l=TH;return W(),K(OX,{open:r.value,"onUpdate:open":n[2]||=e=>r.value=e,draft:a.value,"onUpdate:draft":n[3]||=e=>a.value=e,title:`${c.value.label||c.value.default} 的名称与描述`,description:`名称只改显示的名字,成员 ID 不变。描述写擅长什么、适合分到什么工作,智能调度和 AI 主持人分派时参考,房间所有成员都能看到。`,label:`${c.value.name} 的描述`,placeholder:`例如:擅长前端和交互细节,适合出方案、做评审;大段重构交给别人`,max:AX,note:m.value,source:u.value,changed:p.value,saving:e.saving,onSave:h},{lead:R(()=>[q(`label`,kX,[n[4]||=q(`span`,null,`显示名称`,-1),J(i,{modelValue:o.value,"onUpdate:modelValue":n[0]||=e=>o.value=e,maxlength:jX,placeholder:`留空显示 ${c.value.default}`,"aria-label":`${c.value.name} 的显示名称`,class:`w-full`},null,8,[`modelValue`,`placeholder`,`aria-label`])])]),extra:R(()=>[d.value?(W(),K(l,{key:0,modelValue:s.value,"onUpdate:modelValue":n[1]||=e=>s.value=e,label:`存为 ${c.value.platform} 的默认描述`},null,8,[`modelValue`,`label`])):X(``,!0)]),_:1},8,[`open`,`draft`,`title`,`label`,`note`,`source`,`changed`,`saving`])}}},[[`__scopeId`,`data-v-83eeada0`]]),NX=4e3,PX={},FX=`用户为你单独设置的提示(补充做法与偏好,不改变权限与技能规则):`,IX=[`read`,`write`,`auto`,`full`],LX={read:`只读`,write:`可写`,auto:`自动`,full:`全放开`};function RX(e){return kY(e)?.access_levels||IX}function zX(e){let t=RX(e),n=kY(e);return IX.map(e=>t.includes(e)?{value:e,label:LX[e],hint:n?.access_hints?.[e]||``}:{value:e,label:LX[e],hint:n?.unsupported_hints?.[e]||`该软件不支持此档位`,disabled:!0})}function BX(e){return e===`own`?`自行决定`:LX[e]||`只读`}function VX(e,t=[]){let n=e.project_access;return[`own`,`auto`,`full`].includes(n)||n===`write`&&!!(e.cwd||e.workdir||t.some(e=>e.access===`write`))}function HX(e,t,n=[]){return e.project_access===`own`?`项目文件与命令权限沿用你自己会话的软件设置。`:e.project_access===`auto`?`由软件自动审批:可${t}修改项目文件并运行所需命令;被沙箱或审批拦下时按软件方式申请放行(Codex 申请提权),仍被拒绝就在回答中说明。`:e.project_access===`full`?`已跳过软件审批与沙箱,可${t}修改文件并运行所需命令。`:!e.cwd&&n.length?VX(e,n)?`用户允许${t}修改项目文件并运行所需命令。`:`项目文件只读,不修改。`:e.cwd?e.project_access===`write`?`用户允许${t}修改 cwd 中的项目文件并运行所需命令。`:`cwd 中的项目文件只读,不修改。`:`未指定项目目录。`}function UX(e,t,n=[]){return kY(e.adapter)?.task_rules?.(t,{runs_commands:VX(e,n)})||``}var WX=`读含中文的文件用 rg --encoding utf-8 . 文件路径,不用 Get-Content(Windows PowerShell 会读成乱码)。`;function GX({name:e,discussion:t,discussion_request:n,profile:r,cli:i,messages:a,read_after:o,task_path:s,access_file:c=``,read_rule:l=``,extra_directories:u=[]}){let d=t?`讨论进行中,用户直接向你提问(${a}):只回答这个提问,不改变讨论安排和进度。`:``,f=VX(r,u)?``:`命令只用 subcommands 列出的 ${i} 子命令。`,p=u.length?`extra_directories 是本房间的其他项目目录,access 为 read 的只读、不修改。`:``,m=`${UX(r,i,u)}${d}${HX(r,`按请求`,u)}${p}${f}草稿写在 draft_directory。`;if(n)return{instructions:m,prompt:`你(${e})收到了讨论中的${n.purpose===`discuss_host`?`主持任务`:`发言请求`}。先读任务文件 ${s},按其中列出的技能处理本次请求并保存结果。${l}`};let h=c?` --access-file ${c}`:``,g=`问候、致谢等简单消息可跳过技能:${i} message list --after ${o}${h} 看原文,${i} message post --body "回答"${h} 回复(正文含引号时先写草稿再用 --body-file)。`;return{instructions:m,prompt:`用户在${t?`讨论`:`自由协作`}房间点名了你(${e}),对应消息 ${a}。${g}其他请求先读任务文件 ${s},按其中列出的技能处理并提交一次回答。${l}`}}var KX=[`data-identity`,`data-face`],qX=[`inert`,`aria-hidden`],JX={class:`expert-card-identity`},YX={class:`expert-card-names`},XX={key:0},ZX={key:0,class:`member-id`},QX={key:0,class:`expert-card-badge`},$X={key:1},eZ={key:0,class:`member-id`},tZ={key:0,class:`expert-card-badge`},nZ=[`title`],rZ={class:`expert-card-facts`},iZ=[`title`],aZ={key:0,"aria-hidden":`true`},oZ={key:0,class:`expert-card-manual`},sZ={key:0},cZ={key:1,class:`expert-card-flip`},lZ=[`aria-label`],uZ=[`aria-checked`,`tabindex`,`data-mode`,`onClick`],dZ={class:`expert-card-tools`},fZ=[`aria-label`,`title`],pZ=[`aria-pressed`,`aria-label`,`title`],mZ=[`aria-label`],hZ=[`inert`,`aria-hidden`],gZ={class:`expert-card-back-body`},_Z={class:`expert-card-heading`},vZ={key:0},yZ={class:`expert-card-heading-tools`},bZ=[`aria-label`,`title`],xZ=[`title`,`aria-label`],SZ={key:0,class:`expert-card-field`},CZ={key:1,class:`expert-card-field`},wZ=[`aria-label`],TZ=[`title`,`disabled`,`aria-checked`,`onClick`],EZ={class:`expert-card-field`},DZ={key:0,class:`expert-card-catalog`},OZ={key:1,class:`expert-card-effort`},kZ={key:2,class:`expert-card-note`},AZ=[`aria-label`,`disabled`],jZ={key:4,class:`expert-card-note`},MZ={class:`expert-card-flip-actions`},NZ=[`aria-label`],PZ=[`aria-label`],FZ=[`aria-label`],IZ={class:`expert-card-naming-actions`},LZ=180,RZ=`[role='listbox'], [role='menu'], [data-reka-popper-content-wrapper]`,zZ=EH({__name:`ExpertCard`,props:Ha({name:{type:String,required:!0},mode:{type:String,default:``},choices:{type:Array,default:()=>[]},status:{type:Object,required:!0},host:Boolean,hostable:Boolean,hosting:Boolean,workflow:{type:String,default:``},access_locked:Boolean},{preset:{type:Object,default:null},presetModifiers:{}}),emits:Ha([`remove`,`mode`,`host`],[`update:preset`]),setup(e,{emit:t}){let n=e,r=uo(e,`preset`),i=t,{view:a,bridge:o}=Or(`discussion`),s=UB(0,{mass:1,stiffness:270.0323764138049,damping:31.550710806760762}),c=I(null),l=I(null),u=I(null),d=I(!1),f=I(!1),p=Q(()=>r.value?{...a.value.launch.profiles[o.platform_of(n.name)],model:``,effort:``,system_prompt:``,project_access:`read`,...r.value}:a.value.launch.profiles[n.name]||{}),m=Q(()=>r.value?r.value.label||o.default_name(n.name):o.member_label(n.name)),h=Q(()=>o.launch_clients[n.name]||[]),g=Q(()=>n.choices.filter(e=>e!==`manual`||h.value.some(e=>e.value!==`api`))),_=Q(()=>n.mode===`cli`),v={cli:`程序启动`,manual:`手动启动`},y=Q(()=>!r.value&&_.value&&p.value.adapter===`api`),b=I({state:``});z(()=>[p.value.base_url,p.value.api_protocol,p.value.model,p.value.api_key_ref],()=>{b.value={state:``}});async function x(){b.value={state:`loading`};try{await o.check_launch_api(n.name),b.value={state:`ok`},o.notify(`info`,`检查通过:模型已响应`)}catch(e){b.value={state:`error`},o.notify(`error`,e.message)}}let S=Q(()=>!a.value.launch.available&&a.value.launch.relay?.clients[o.platform_of(n.name)]),C=Q(()=>h.value.find(e=>e.value===(S.value||p.value.adapter))?.label||(a.value.launch.relay&&!a.value.launch.available?`电脑上未配置`:`待选择 App / CLI`)),w=Q(()=>n.mode===`manual`),T={Codex:`已实测:消息实时显示在已开窗口。`,Antigravity:`已实测:App 会话实时显示;agy CLI 窗口需重启才显示后台发言。`,Claude:`已实测:原窗口开着时消息实时送入;关闭后在后台续接同一会话。`},E=Q(()=>T[o.platform_of(n.name)]||``),D=Q(()=>!!p.value.session_id),O=Q(()=>!!r.value||_.value&&h.value.length>0&&!(a.value.launch.relay&&!a.value.launch.available)),k=Q(()=>r.value?`编辑 ${n.name} 的卡片`:`配置 ${n.name} 的启动方式`),A=Q(()=>o.launch_model_state(n.name,a.value.launch,p.value)),ee=Q(()=>r.value&&!kY(p.value.adapter)?.models),j=Q(()=>!!(r.value||_.value&&A.value.supported)),te=Q(()=>j.value&&me.value.length?`补齐上方连接后,可在这里选择模型与思考强度。`:p.value.adapter?`模型与思考强度在 App 原聊天中选择,本页不覆盖 App 设置。`:`先选择软件入口。支持启动参数的 CLI 可在这里设置模型与强度。`),ne={low:`Low`,medium:`Medium`,high:`High`,xhigh:`Extra High`,max:`Max`,ultra:`Ultra`},M=Q(()=>{let e=A.value.efforts||(r.value?kY(p.value.adapter)?.efforts:null);return e?.length?[{label:`默认强度`,value:``},...e.map(e=>({label:ne[e]||e,value:e}))]:null}),re=Q(()=>p.value.adapter===`antigravity_cli`&&p.value.model?``:A.value.defaults?.effort),ie=Q(()=>p.value.effort?ne[p.value.effort]||p.value.effort:re.value?ne[re.value]||re.value:`默认`),ae=Q(()=>!!r.value||_.value&&o.launch_can_set_access(n.name,a.value.launch)),oe=Q(()=>!r.value&&_.value&&p.value.adapter!==`api`),se=Q(()=>p.value.project_access||a.value.launch.workspace?.project_access||`read`),ce=Q(()=>n.mode===`manual`?`你来启动 · 自主发言`:`程序启动 · ${D.value?`续接会话`:p.value.adapter===`api`?`调用 API`:`新会话`}`),le=Q(()=>`不可(须本机唤醒)`),ue=Q(()=>r.value?[...r.value.needs_platform?[{label:`平台`,value:`本机未配置此软件`,tone:`warn`}]:[],{label:`模型`,value:p.value.model||`软件默认模型`},...p.value.effort?[{label:`强度`,value:ie.value}]:[],{label:`项目`,value:BX(se.value),...se.value===`read`?{}:{tone:`warn`}}]:[..._.value?[{label:`状态`,value:n.status.text,tone:n.status.tone}]:[],{label:`启动`,value:ce.value},..._.value?[{label:`软件`,value:C.value}]:[],...j.value?[{label:`模型`,value:p.value.model||A.value.defaults?.model||`软件默认模型`}]:[],...j.value&&p.value.adapter!==`api`?[{label:`强度`,value:ie.value}]:[],...ae.value?[{label:`项目`,value:BX(se.value),...n.workflow&&se.value!==`read`?{tone:`warn`}:{}}]:[],...n.hosting&&!n.host&&!n.hostable?[{label:`主持`,value:le.value}]:[]]),de={executable:{label:`路径`,placeholder:`可执行文件完整路径`},ipc_directory:{label:`IPC`,placeholder:`Sidecar IPC 目录`},source_thread_id:{label:`聊天`,placeholder:`Codex App 来源聊天 ID`}},fe=I([]),pe=()=>{let e=p.value.adapter;return!oe.value||!e?[]:(e===`antigravity`?[`ipc_directory`]:e===`codex`?[`executable`,`source_thread_id`]:[`executable`]).filter(e=>!p.value[e])},me=Q(()=>oe.value?[...new Set([...fe.value,...pe()])].map(e=>({field:e,...de[e]})):[]);function he(){ar(()=>{document.activeElement===c.value&&(f.value?u:l).value?.focus({preventScroll:!0})})}function ge(e){let t=e>=LZ/2;f.value!==t&&(f.value=t,he())}let _e=s.on(`change`,ge),ve=s.on(`animationComplete`,he),be=null;function xe(e){(!e||O.value)&&(c.value?.focus({preventScroll:!0}),fe.value=e?pe():[],e&&!d.value&&(be={profile:JSON.parse(JSON.stringify(r.value||p.value)),mode:n.mode}),d.value=e)}function Se(){be&&=(r.value?r.value=be.profile:o.restore_launch_profile(n.name,be.profile),be.mode!==n.mode&&i(`mode`,be.mode),null),xe(!1)}let Ce=Q(()=>r.value?(r.value.description||``).trim():a.value&&o.description_draft(n.name).trim()),P=I(!1),we=Q(()=>Ce.value?`描述:${Ce.value}`:`添加描述:擅长什么、适合分到什么工作`);function Te({text:e,label:t,as_template:i}){r.value?(r.value.description=e,t!==void 0&&(r.value.label=t)):(o.write_description_draft(n.name,e),t!==void 0&&o.write_label_draft(n.name,t),i&&o.save_description_template(n.name,e)),P.value=!1}let Ee=Q(()=>a.value.launch.presets.some(e=>e.name===n.name)),De=I(!1),Oe=I(``),ke=Q(()=>Oe.value.trim()),Ae=Q(()=>!ke.value||ke.value===`${o.default_name(o.platform_of(n.name))}-`),je=Q(()=>a.value&&!Ae.value?o.preset_identity(n.name,ke.value):``),Me=Q(()=>{if(!je.value)return`预设名称会显示在“预设”行和房间里,可以不带平台前缀。`;let e=o.expert_presets().find(e=>e.name===je.value);return[je.value===ke.value?``:`成员 ID:${je.value}`,e?`将覆盖已有预设「${e.label||e.name}」`:``].filter(Boolean).join(` · `)||`预设名称即成员 ID`});function Ne(){if(Ee.value)return o.save_expert_preset(n.name);let e=new Set(o.expert_presets().map(e=>e.name)),t=o.platform_of(n.name),r=1,i=o.default_name(t);for(;e.has(o.preset_identity(n.name,`${i}-${r}`));)r+=1;Oe.value=`${i}-${r}`,De.value=!0}async function Pe(){Ae.value||(await o.save_expert_preset(n.name,ke.value),De.value=!1)}let Fe=Q(()=>PX[p.value.adapter]||``),Ie=Q(()=>r.value?!!r.value.system_prompt?.trim():Object.hasOwn(p.value,`system_prompt`)),Le=Q(()=>(Ie.value?p.value.system_prompt:Fe.value).trim()),Re=Q(()=>Le.value?`专属提示词(${Ie.value?`自定义`:`软件预设`}):${Le.value.split(`
55
+ `);t&&(l.value=e.trim()?`${e.trimEnd()}\n\n${t}`:t);let n=l.value;await s(`send`),t&&l.value===n?l.value=e:t&&(kt.value=[],OW.excerpts=[]),await ri()}let H=0;function Ca(e){e.key!==`Escape`||e.isComposing||e.defaultPrevented||(e.target!==rt.value?.textareaRef&&e.target!==document.body||Mt.value&&!i.value.sending_message||i.value.sending_preview?.failed?H=0:e.timeStamp-H>Zq?H=e.timeStamp:(H=0,e.preventDefault(),a.execute(`retract_latest`)))}aa(()=>window.addEventListener(`keydown`,Ca)),ca(()=>window.removeEventListener(`keydown`,Ca));function wa(e){e.defaultPrevented||!RU||e.key!==`Enter`||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||e.isComposing||l.value.trim()||(i.value.attachment_drafts.length||kt.value.length||jt.value.length)&&(e.preventDefault(),e.stopPropagation(),Sa())}function Ta(e){s(`copy`,`${i.value.room_site}/r/${at.value.id}/messages/${e.id}`)}return(e,t)=>{let o=bA,h=tA,g=Yk,_=IV,w=PV,T=uV,D=MV,O=kV,A=cV,ee=xV;return W(),G(`section`,oG,[L(i).query||L(i).mention_only||L(i).host_only?(W(),G(`div`,sG,[q(`span`,null,F([L(i).query&&`“${L(i).query}”`,L(i).host_only&&`只看主持`,L(i).mention_only&&`@${L(a).display_name(e.author)}`].filter(Boolean).join(` · `))+` · `+F(L(i).total)+` 条结果`,1),J(o,{label:`清除筛选`,size:`xs`,variant:`link`,color:`neutral`,onClick:t[0]||=e=>{f.value=``,L(s)(`filter`,{query:``,mention:!1,host:!1})}})])):X(``,!0),L(i).messages.length?(W(),G(`nav`,{key:1,ref_key:`message_map`,ref:je,class:`channel-message-map`,style:ye({"--nav-entry-height":`${vJ}px`}),"aria-label":`发言快速导航`,onWheelPassive:_u(Ei,[`stop`]),onPointerleave:ki,onFocusout:ki,onKeydown:yu(_u(ki,[`stop`]),[`esc`]),onContextmenu:Ti,onPointerdown:gi,onPointermove:_i,onPointerup:xi,onPointercancel:xi},[q(`div`,lG,[(W(!0),G(U,null,V(Gr.value,(e,n,r,o)=>{let s=[e,Re.value,Ur.value===e.number?Ne.value:null,Mi(e)];if(o&&o.el&&o.key===e.entries[0].key&&uc(o,s))return o;let c=(W(),G(`div`,{key:e.entries[0].key,class:`channel-map-round`,style:ye({"--round-message-count":e.count})},[(W(!0),G(U,null,V(e.entries,(e,t,n,r)=>{let o=[e.message,e.label,e.index,Ne.value===e.message.id,e.message.id===(Ne.value||L(i).messages[0]?.id),nt.value<0?-1:Math.min(Math.abs(e.index-nt.value),wJ),Re.value&&Ie.value===e.key];if(r&&r.el&&r.key===e.key&&uc(r,o))return r;let s=(W(),G(`button`,{key:e.key,type:`button`,class:N([`channel-navigation-entry`,e.round?`channel-round-range`:`channel-message-jump`]),"data-author":e.round?void 0:L(a).identities[e.message.author]?.style,"data-jump-id":e.round?void 0:e.message.id,"data-round-jump":e.round?e.label:void 0,"aria-label":e.label,tabindex:!e.round&&e.message.id===(Ne.value||L(i).messages[0]?.id)?0:-1,"aria-current":!e.round&&Ne.value===e.message.id?`location`:void 0,"aria-describedby":Re.value&&Ie.value===e.key?`channel-navigation-preview`:void 0,onPointerenter:t=>Ci(e,t),onPointermove:t=>Ci(e,t),onFocus:t=>hi(e,t),onKeydown:t=>B(t,e.index),onClick:t=>wi(e,t)},[e.round?(W(),G(`span`,uG,F(e.number||``),1)):(W(),G(`span`,{key:1,class:`channel-jump-tick`,"aria-hidden":`true`,style:ye(Ni(e,e.index))},null,4))],42,[`data-author`,`data-jump-id`,`data-round-jump`,`aria-label`,`tabindex`,`aria-current`,`aria-describedby`,`onPointerenter`,`onPointermove`,`onFocus`,`onKeydown`,`onClick`]));return s.memo=o,s},t,1),128))],4));return c.memo=s,c},t,3),128))])],44,cG)):X(``,!0),(W(),K(Yr,{to:`body`},[$e.value?(W(),K(L(RB).div,{key:0,id:`channel-navigation-preview`,class:`channel-nav-preview`,role:`tooltip`,"aria-hidden":!Re.value,inert:!Re.value,"data-open":Re.value,style:ye({left:Be.value,y:L(qe),x:L(Ze),opacity:L(Qe),scale:L(Xe),height:L(Je),"--preview-gap":`${_J}px`}),onPointerleave:ki,onFocusout:ki,onKeydown:yu(_u(ki,[`stop`]),[`esc`])},{default:R(()=>[q(`div`,{ref_key:`preview_content`,ref:ze,class:`channel-nav-preview-content`},[Le.value?(W(),G(`h3`,dG,F(tt.value),1)):X(``,!0),q(`div`,fG,[J(h,{src:L(a).identities[$e.value.author]?.icon,text:L(a).identities[$e.value.author]?.initials||`?`,alt:L(a).display_name($e.value.author),size:`sm`,class:N([`channel-avatar`,L(a).identities[$e.value.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`strong`,null,F(L(a).display_name($e.value.author)),1),q(`span`,null,`#`+F($e.value.id),1)]),q(`div`,pG,[Y(F(tt.value)+` · `+F(L(a).sources[$e.value.source])+` · `+F(L(a).format_time($e.value.created_at)),1),$e.value.kind===`moderation`?(W(),G(`span`,mG,` · 主持人`)):$e.value.kind===`receipt`?(W(),G(`span`,hG,` · 运行回执`)):X(``,!0)]),q(`div`,{class:`channel-nav-preview-text markdown-body`,innerHTML:$e.value.summary?$e.value.rendered_summary:$e.value.rendered_text},null,8,gG)],512)]),_:1},8,[`aria-hidden`,`inert`,`data-open`,`style`,`onKeydown`])):X(``,!0)])),te.value&&!te.value.touch?(W(),G(`div`,{key:2,class:`channel-offer-marks`,style:ye({left:`${te.value.left}px`,top:`${te.value.top}px`})},[q(`button`,{type:`button`,class:`channel-listen-mark`,title:`把选中的文字作为摘录添加到对话`,onMousedown:t[5]||=_u(()=>{},[`prevent`]),onClick:ve},[J(g,{name:`i-lucide-message-square-quote`}),t[40]||=Y(`添加到对话`,-1)],32),te.value.speech?(W(),G(`button`,{key:0,type:`button`,class:`channel-listen-mark`,title:`从选中处开始朗读`,"aria-label":`从选中处开始朗读`,onMousedown:t[6]||=_u(()=>{},[`prevent`]),onClick:Oe},[J(g,{name:`i-lucide-headphones`}),t[41]||=Y(`朗读`,-1)],32)):X(``,!0)],4)):X(``,!0),se.value?(W(),G(`form`,{key:3,class:N([`selection-comment`,{"is-docked":se.value.touch}]),style:ye(se.value.touch?{}:{left:`${se.value.left}px`,top:`${se.value.top}px`}),onSubmit:_u(Te,[`prevent`])},[Tr(q(`input`,{ref_key:`quote_input`,ref:le,"onUpdate:modelValue":t[7]||=e=>ce.value=e,type:`text`,placeholder:`添加批注(可选)`,"aria-label":`摘录的批注(可选)`,enterkeyhint:`send`,onKeydown:Ee},null,544),[[nu,ce.value]]),q(`button`,{type:`button`,class:`selection-comment-cancel`,"aria-label":`取消添加`,title:`取消`,onClick:we},[J(g,{name:`i-lucide-x`})]),q(`button`,_G,[J(g,{name:`i-lucide-arrow-up`})])],38)):X(``,!0),ue.value?(W(),K(DW,{key:ue.value.excerpt.id,comment:ue.value.excerpt.comment,style:ye({left:`${ue.value.left}px`,top:`${ue.value.top}px`}),onSave:Ce,onCancel:Se,onRemove:P},null,8,[`comment`,`style`])):X(``,!0),lc([L(Vr),L(i).sending_preview,L(Wr),mt.value,at.value.session,ct.value,m.value.size,L(v).state.message_id,at.value.title,L(i).query,L(i).mention_only,L(i).host_only,L(gr),L(_r),L(Gt),L(Kt),L(Zt),Xt.value,L(en),L(rn),L(c),yt.value,wt.value,ta.value,L(xr),oa.value,ua.size,da.value,na.value,_t.value,Ki.value,qi.value,bt.value,Mt.value,L(i).sending_message,L(tn),lt.value,at.value.free],()=>(W(),G(`div`,{ref_key:`transcript`,ref:p,class:`channel-transcript`,"aria-label":`聊天记录`,onScroll:ei,onWheelPassive:t[16]||=e=>{fi(e),di(e)},onTouchstartPassive:fi,onTouchmovePassive:di,onPointerdown:di,onKeydown:t[17]||=e=>{fi(e),di(e)}},[!L(i).query&&!L(i).mention_only&&!L(i).host_only&&!L(gr)&&Dr.value===0?(W(),G(`div`,vG,[J(CH,{ref:e=>gn(r)?r.value=e:r=e,onEdit:t[8]||=e=>n(`edit`)},null,512)])):X(``,!0),(W(!0),G(U,null,V(L(Vr),e=>(W(),G(`div`,{key:e.key,class:`channel-message-group`},[J(_,{label:e.label,class:`channel-date-divider`},null,8,[`label`]),(W(!0),G(U,null,V(e.messages,e=>(W(),G(U,{key:e.id},[e.id===L(_r)&&!L(i).query&&!L(i).mention_only&&!L(i).host_only?(W(),K(ZH,{key:0})):X(``,!0),e.id===L(gr)&&!L(i).query&&!L(i).mention_only&&!L(i).host_only?(W(),K(CH,{key:1,ref_for:!0,ref:e=>gn(r)?r.value=e:r=e,onEdit:t[9]||=e=>n(`edit`)},null,512)):X(``,!0),e.arrangement?(W(),K(HV,{key:2,icon:`i-lucide-list-ordered`,plain:``,title:`主持人创建的发言安排`,label:`主持人安排`,"toggle-label":`展开或收起各专家的任务`},{text:R(()=>[Y(`主持人安排:`+F(L(rn).get(e.arrangement.after_message_id)?.find(t=>t.id===e.arrangement.id)?.label),1),e.arrangement.after_message_id?(W(),G(`small`,yG,`耗时 `+F(on(sn(e.arrangement,L(i).messages.find(t=>t.id===e.arrangement.after_message_id)))),1)):X(``,!0)]),default:R(()=>[(W(!0),G(U,null,V(e.arrangement.turns,t=>(W(),G(`p`,{key:`${e.id}-${t.expert}-${t.question}`},[q(`span`,null,F(L(a).display_name(t.expert))+`:`+F(t.question),1)]))),128))]),_:2},1024)):e.source===`goal`?(W(),K(oU,{key:3,message:e},null,8,[`message`])):e.source===`notice`?(W(),K(HV,{key:4,icon:`i-lucide-bell`,plain:``,expandable:!1,label:`程序通知主持人`},{text:R(()=>[Y(F(e.text),1)]),_:2},1024)):e.cancelled_turn||e.cancelled_execution?(W(),K(w,{key:5,id:e.id,"data-author":L(a).identities[e.author]?.style,role:`assistant`,parts:[],side:`left`,variant:`naked`,color:`neutral`,class:`channel-message`,ui:{header:`channel-message-header`,container:`channel-message-container`,body:`channel-message-body`}},{body:R(()=>[q(`div`,bG,[J(h,{src:L(a).identities[e.author]?.icon,text:L(a).identities[e.author]?.initials||`?`,alt:L(a).display_name(e.author),size:`md`,class:N([`channel-avatar`,L(a).identities[e.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`div`,xG,[q(`div`,SG,[q(`strong`,null,F(L(a).display_name(e.author)),1)])]),e.cancelled_turn?(W(),G(`span`,CG,`已错过 · 安排 #`+F(e.cancelled_turn.display_id||e.cancelled_turn.id),1)):(W(),G(`span`,wG,F(Ut(e.cancelled_execution).label)+` · 执行 #`+F(e.execution_id),1))]),q(`div`,TG,F(e.cancelled_turn?`本次发言已被跳过或取消,未回答。`:e.cancelled_execution.result||`本次执行已作废,未回答。`),1),(W(!0),G(U,null,V([e.cancelled_execution||(at.value.free?.executions||[]).find(t=>t.id===e.execution_id)].filter(e=>e&&Ut(e).note),e=>(W(),G(U,{key:e.id},[q(`p`,EG,F(Ut(e).note),1),e.late_answer&&L(i).access?.can_manage?(W(),G(`details`,{key:0,class:`channel-receipt`,onToggle:t=>xt(e.id,t)},[q(`summary`,{"aria-label":`查看 ${L(a).display_name(e.member)} 未采纳的回答`},`未采纳的回答`,8,OG),q(`div`,kG,F(bt.value.get(e.id)?.text??`正在读取…`),1)],40,DG)):X(``,!0)],64))),128))]),_:2},1032,[`id`,`data-author`])):e.slot_card&&!e.failure&&!e.retry?(W(),G(`div`,{key:6,id:`execution-${e.id}`,class:`channel-working-strip`,"data-author":L(a).identities[e.author]?.style},[q(`div`,jG,[J(h,{src:L(a).identities[e.author]?.icon,text:L(a).identities[e.author]?.initials||`?`,alt:L(a).display_name(e.author),size:`2xs`,class:N([`channel-avatar`,L(a).identities[e.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`strong`,MG,F(L(a).display_name(e.author)),1),q(`small`,NG,F(e.waiting?`手动启动${e.created_at?` · 已等 ${on(Math.max(0,_t.value-e.created_at))}`:``}`:`已用 ${on(Math.max(0,_t.value-e.created_at))}`)+F(e.attempt?` · 第 ${e.attempt}/${JJ} 次重试`:``),1)]),L(i).access?.can_manage&&Ht(e)&&e.execution_id?(W(),G(`div`,PG,[q(`div`,FG,[J(yV,{text:`私聊:查看它正在做什么`},{default:R(()=>[J(o,{icon:`i-lucide-message-square`,class:`channel-private-chat-key`,size:`xs`,variant:`ghost`,color:`neutral`,"aria-label":`私聊 ${L(a).display_name(e.author)}:查看本次执行过程`,onClick:t=>L(LU)(L(s),e.author,e.execution_id)},null,8,[`aria-label`,`onClick`])]),_:2},1024)])])):X(``,!0),q(`div`,IG,[(W(!0),G(U,null,V([Dt(e)],t=>(W(),G(`span`,{key:e.id,class:N([`channel-working-status`,{"channel-working-warning":t.warning}]),role:`status`,title:Ht(e)?e.waiting?e.text:t.text:`此接入方式看不到进度,可在原窗口查看`},[e.waiting?(W(),G(`span`,RG,F(e.text),1)):t.live?(W(),K(bU,{key:1,text:t.text,seed:e.author,beat:e.activity_at,silent:_t.value-(e.activity_at||e.created_at),dots:``,muted:!Ht(e)},null,8,[`text`,`seed`,`beat`,`silent`,`muted`])):(W(),G(`span`,zG,F(t.text),1))],10,LG))),128)),L(i).access?.can_manage?(W(),G(`span`,BG,[lt.value?.expert===e.author&&e.discussion_request?(W(),G(U,{key:0},[J(yV,{text:`暂停讨论`},{default:R(()=>[J(o,{icon:`i-lucide-pause`,size:`xs`,variant:`ghost`,color:`neutral`,"aria-label":`暂停讨论,停止 ${L(a).display_name(e.author)} 本次发言`,disabled:!!L(c),loading:L(c)===`pause_discussion`,onClick:t[10]||=e=>L(s)(`pause_discussion`)},null,8,[`aria-label`,`disabled`,`loading`])]),_:2},1024),J(yV,{text:`停止本次发言,轮到下一位`},{default:R(()=>[J(o,{variant:`solid`,color:`neutral`,class:`channel-stop-button`,"aria-label":`停止 ${L(a).display_name(e.author)} 本次发言,轮到下一位`,disabled:!!L(c),loading:L(c)===`skip_turn`,onClick:t[11]||=e=>L(s)(`skip_turn`)},{default:R(()=>[...t[42]||=[q(`span`,{class:`channel-stop-square`},null,-1)]]),_:1},8,[`aria-label`,`disabled`,`loading`])]),_:2},1024)],64)):(W(),K(yV,{key:1,text:`停止`},{default:R(()=>[J(o,{variant:`solid`,color:`neutral`,class:`channel-stop-button`,"aria-label":`停止 ${L(a).display_name(e.author)} 本次执行`,disabled:!!L(c),loading:L(c)===`change_member`&&na.value===e.member_id,onClick:t=>ra(e)},{default:R(()=>[...t[43]||=[q(`span`,{class:`channel-stop-square`},null,-1)]]),_:1},8,[`aria-label`,`disabled`,`loading`,`onClick`])]),_:2},1024))])):X(``,!0)]),(W(!0),G(U,null,V([St(e)].filter(e=>e.length),t=>(W(),G(`div`,{key:e.execution_id,class:N([`channel-working-notes`,{"is-open":wt.value.has(e.execution_id),"is-single":t.length===1}])},[wt.value.has(e.execution_id)?(W(!0),G(U,{key:0},V(t.slice(0,-1),e=>(W(),G(`p`,{key:e.seq},F(e.text),1))),128)):X(``,!0),q(`p`,{class:`channel-working-latest`,onClick:n=>t.length===1||wt.value.has(e.execution_id)||Tt(e.execution_id)},[q(`span`,HG,F(t.at(-1).text),1),t.length>1?(W(),G(`button`,{key:0,type:`button`,class:`channel-working-count`,"aria-expanded":wt.value.has(e.execution_id),"aria-label":wt.value.has(e.execution_id)?`收起过程说明`:`展开全部 ${t.length} 段过程说明`,onClick:_u(t=>Tt(e.execution_id),[`stop`])},[Y(F(t.length)+` 段`,1),J(g,{name:`i-lucide-chevron-down`})],8,UG)):X(``,!0)],8,VG)],2))),128))],8,AG)):e.slot_card&&!e.failure?(W(),K(w,{key:7,id:`execution-${e.id}`,"data-author":L(a).identities[e.author]?.style,role:`assistant`,parts:[],side:`left`,variant:`naked`,color:`neutral`,class:`channel-message`,ui:{header:`channel-message-header`,container:`channel-message-container`,body:`channel-message-body`}},{body:R(()=>[q(`div`,WG,[J(h,{src:L(a).identities[e.author]?.icon,text:L(a).identities[e.author]?.initials||`?`,alt:L(a).display_name(e.author),size:`md`,class:N([`channel-avatar`,L(a).identities[e.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`div`,GG,[q(`div`,KG,[q(`strong`,null,F(L(a).display_name(e.author)),1)]),q(`div`,qG,[e.created_at?(W(),G(U,{key:0},[q(`time`,{title:new Date(e.created_at*1e3).toLocaleString(`zh-CN`)},F(L(a).format_time(e.created_at*1e3)),9,JG),t[44]||=Y(` · `,-1)],64)):X(``,!0),Y(F(e.waiting?`手动启动${e.created_at?` · 已等 ${on(Math.max(0,_t.value-e.created_at))}`:``}`:`已用 ${on(Math.max(0,_t.value-e.created_at))}`),1)])])]),q(`div`,YG,[(W(!0),G(U,null,V([Dt(e)],t=>(W(),G(`div`,{key:e.id,class:N([`channel-message-text`,{"channel-working-warning":t.warning}]),role:`status`,"aria-label":`${L(a).display_name(e.author)} ${t.text}`,title:Ht(e)?void 0:`此接入方式看不到进度,可在原窗口查看`},[e.waiting?(W(),G(`span`,ZG,F(e.text),1)):t.live?(W(),K(bU,{key:1,text:t.text,seed:e.author,beat:e.activity_at,silent:_t.value-(e.activity_at||e.created_at),dots:``,muted:!Ht(e)},null,8,[`text`,`seed`,`beat`,`silent`,`muted`])):(W(),G(`span`,QG,F(t.text),1))],10,XG))),128))]),e.retry?(W(),G(U,{key:0},[q(`p`,$G,F(e.retry.reason),1),q(`div`,eK,[q(`span`,tK,F(e.retry.retry_at>_t.value?`${e.retry.retry_at-_t.value} 秒后自动重试`:`正在重试`)+`(第 `+F(e.retry.attempt)+`/`+F(JJ)+` 次)`,1),L(i).access?.can_manage?(W(),G(U,{key:0},[J(o,{label:`立即重试`,icon:`i-lucide-rotate-ccw`,size:`sm`,variant:`soft`,color:`primary`,"aria-label":`立即重新投递给 ${L(a).display_name(e.author)}`,disabled:!!L(c),onClick:t=>L(s)(`retry_delivery`,{execution_id:e.execution_id,action:`retry_now`})},null,8,[`aria-label`,`disabled`,`onClick`]),J(o,{label:`停止`,icon:`i-lucide-circle-stop`,size:`sm`,variant:`soft`,color:`error`,"aria-label":`停止自动重试 ${L(a).display_name(e.author)} 的投递`,disabled:!!L(c),onClick:t=>L(s)(`retry_delivery`,{execution_id:e.execution_id,action:`retry_stop`})},null,8,[`aria-label`,`disabled`,`onClick`])],64)):X(``,!0)])],64)):X(``,!0),yt.value.get(e.execution_id)?.length?(W(),K(pU,{key:1,live:``,notes:yt.value.get(e.execution_id)},null,8,[`notes`])):X(``,!0)]),_:2},1032,[`id`,`data-author`])):e.failure?(W(),G(`section`,{key:8,id:e.id,class:`channel-message channel-failed-execution`,"data-author":L(a).identities[e.author]?.style,"aria-label":`${L(a).display_name(e.author)} ${e.undeliverable?`无法投递`:`执行失败`}`},[q(`div`,rK,[J(h,{src:L(a).identities[e.author]?.icon,text:L(a).identities[e.author]?.initials||`?`,alt:L(a).display_name(e.author),size:`md`,class:N([`channel-avatar`,L(a).identities[e.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`div`,iK,[q(`div`,aK,[q(`strong`,null,F(L(a).display_name(e.author)),1),e.failure.role===`host`?(W(),G(`span`,oK,`主持工作`)):X(``,!0),J(T,{label:e.undeliverable?`无法投递`:`执行失败`,color:`error`,variant:`soft`,size:`xs`},null,8,[`label`])]),(W(!0),G(U,null,V([e.slot_card?e.created_at*1e3:e.created_at],t=>(W(),G(`div`,{key:e.id,class:`channel-message-provenance`},[q(`time`,{title:new Date(t).toLocaleString(`zh-CN`)},F(L(a).format_time(t)),9,sK),e.failure.id?(W(),G(`span`,cK,`执行 #`+F(e.failure.id),1)):X(``,!0)]))),128))]),e.failure.elapsed_seconds==null?X(``,!0):(W(),G(`span`,lK,`耗时 `+F(on(e.failure.elapsed_seconds)),1))]),q(`div`,uK,[q(`p`,dK,F(e.failure.result||`执行失败,未提供原因`),1),Ui(e.failure)?(W(),G(`div`,fK,[J(yV,{text:`重试`},{default:R(()=>[J(o,{icon:`i-lucide-rotate-cw`,variant:`solid`,color:`neutral`,class:`channel-stop-button channel-retry-button`,"aria-label":`把执行 #${e.failure.id} 的请求重新派给 ${L(a).display_name(e.author)}`,disabled:!!L(c),loading:L(c)===`retry_delivery`,onClick:t=>L(s)(`retry_delivery`,{execution_id:e.failure.id,action:`retry`})},null,8,[`aria-label`,`disabled`,`loading`,`onClick`])]),_:2},1024)])):X(``,!0)]),e.failure.notes?(W(),K(pU,{key:0,count:e.failure.notes,notes:yt.value.get(e.failure.id),onLoad:t=>Ct(e.failure.id)},null,8,[`count`,`notes`,`onLoad`])):X(``,!0),e.failure.denials?.length?(W(),K(uU,{key:1,denials:e.failure.denials,allowable:!!Gi(e.failure),busy:Ki.value===e.failure.id,error:qi.value[e.failure.id],onAllow:t=>Ji(e.failure)},null,8,[`denials`,`allowable`,`busy`,`error`,`onAllow`])):X(``,!0)],8,nK)):e.withdrawn?(W(),G(`div`,{key:9,id:String(e.id),"data-message-id":e.id,class:`channel-withdrawn`,"data-author":L(a).identities[e.author]?.style},[J(g,{name:e.withdrawn===`retracted`?`i-lucide-undo-2`:`i-lucide-history`,class:`channel-withdrawn-icon`},null,8,[`name`]),e.withdrawn===`retracted`?(W(),G(`span`,mK,F(L(a).display_name(e.author))+` 撤回了一条消息`,1)):L(xr).runs.has(e.id)&&!br.value.has(e.id)?(W(),G(U,{key:1},[q(`span`,null,`已回退 `+F(L(xr).runs.get(e.id))+` 条记录`,1),J(o,{label:`展开`,size:`xs`,variant:`link`,color:`neutral`,"aria-label":`展开从 #${e.id} 起已回退的记录`,onClick:t=>Sr(e.id)},null,8,[`aria-label`,`onClick`])],64)):(W(),G(U,{key:2},[q(`strong`,null,F(L(a).display_name(e.author)),1),q(`span`,hK,F(e.text),1),J(o,{label:`#${e.id}`,size:`xs`,variant:`link`,color:`neutral`,"aria-label":`查看已回退的原文 #${e.id}`,onClick:t=>n(`detail`,e.id)},null,8,[`label`,`aria-label`,`onClick`]),L(xr).runs.has(e.id)?(W(),K(o,{key:0,label:`收起`,size:`xs`,variant:`link`,color:`neutral`,"aria-label":`收起从 #${e.id} 起已回退的记录`,onClick:t=>Sr(e.id)},null,8,[`aria-label`,`onClick`])):X(``,!0)],64))],8,pK)):(W(),G(U,{key:10},[(W(!0),G(U,null,V([ha(e)],r=>(W(),K(L(aG),{key:e.id,deps:r.deps},{default:R(()=>[J(w,{id:String(e.id),"data-message-id":e.id,"data-author":L(a).identities[e.author]?.style,tabindex:`-1`,onPointerenter:t=>r.armed||pa(e.id,t),role:e.author===`用户`?`user`:`assistant`,parts:[],side:`left`,variant:`naked`,color:`neutral`,class:`channel-message`,ui:{header:`channel-message-header`,container:`channel-message-container`,body:`channel-message-body`}},{body:R(()=>[q(`div`,gK,[J(h,{src:L(a).identities[e.author]?.icon,text:L(a).identities[e.author]?.initials||`?`,alt:L(a).display_name(e.author),size:`md`,class:N([`channel-avatar`,L(a).identities[e.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`div`,_K,[q(`div`,vK,[q(`strong`,null,F(L(a).display_name(e.author)),1),q(`span`,yK,F(r.round_label),1),J(T,{size:`xs`,color:`neutral`,variant:`soft`,class:`channel-source`},{default:R(()=>[Y(F(L(a).sources[e.source]),1)]),_:2},1024),e.kind===`moderation`?(W(),K(T,{key:0,size:`xs`,color:`neutral`,variant:`soft`,class:`channel-source`},{default:R(()=>[...t[45]||=[Y(`主持人`,-1)]]),_:1})):X(``,!0),e.kind===`receipt`?(W(),K(T,{key:1,size:`xs`,color:`neutral`,variant:`soft`,class:`channel-source`},{default:R(()=>[...t[46]||=[Y(`运行回执`,-1)]]),_:1})):X(``,!0),e.proactive?(W(),K(T,{key:2,size:`xs`,color:`neutral`,variant:`soft`,class:`channel-source`,title:`成员在自己的窗口里应用户要求主动发言,不是在回答房间的请求`},{default:R(()=>[...t[47]||=[Y(`主动发言`,-1)]]),_:1})):X(``,!0),r.waits?(W(),K(T,{key:3,size:`xs`,color:`warning`,variant:`soft`,class:`channel-source`,title:r.speaking_expert?`${L(a).display_name(r.speaking_expert)} 说完后交给主持人处理`:`等待主持人处理`},{default:R(()=>[...t[48]||=[Y(`待主持人处理`,-1)]]),_:1},8,[`title`])):X(``,!0),(W(!0),G(U,null,V(r.badges,e=>(W(),K(T,{key:e.key,size:`xs`,color:e.color,variant:`soft`,class:`channel-source`,title:e.title},{default:R(()=>[Y(F(e.label),1)]),_:2},1032,[`color`,`title`]))),128))]),q(`div`,bK,[q(`time`,{title:new Date(e.created_at).toLocaleString(`zh-CN`)},F(L(a).format_time(e.created_at)),9,xK),J(o,{label:`#${e.id}`,color:`neutral`,variant:`link`,size:`xs`,"aria-label":`查看原文 #${e.id}`,class:`channel-message-id`,onClick:t=>n(`detail`,e.id)},null,8,[`label`,`aria-label`,`onClick`]),e.submitted_by&&e.submitted_by!==e.author&&(e.source!==`proxy`||e.submitted_by!==`用户`)?(W(),G(`span`,SK,F(L(a).display_name(e.submitted_by))+` 代发`,1)):X(``,!0)])]),r.elapsed===null?X(``,!0):(W(),G(`span`,CK,`耗时 `+F(on(r.elapsed)),1))]),e.reply_to?(W(),K(o,{key:0,label:`回复 #${e.reply_to}`,icon:`i-lucide-corner-up-left`,variant:`link`,color:`neutral`,size:`xs`,class:`channel-message-reference`,"aria-label":`回复 #${e.reply_to} 查看原文`,onClick:t=>n(`detail`,e.reply_to)},null,8,[`label`,`aria-label`,`onClick`])):X(``,!0),e.kind===`receipt`?(W(),G(`details`,wK,[q(`summary`,{"aria-label":`查看运行回执 #${e.id}`},`运行回执详情`,8,TK),q(`div`,{class:`channel-message-text markdown-body`,innerHTML:e.rendered_text},null,8,EK)])):r.editing?(W(),G(`form`,{key:2,class:`channel-edit`,"aria-label":`编辑消息 #${e.id}`,onSubmit:_u(ya,[`prevent`])},[Tr(q(`textarea`,{"onUpdate:modelValue":t[12]||=e=>ta.value.text=e,rows:`3`,maxlength:L(a).max_message_length,"aria-label":`编辑后的消息`,onKeydown:[yu(_u(_a,[`prevent`]),[`esc`]),yu(_u(ya,[`ctrl`,`prevent`]),[`enter`]),yu(_u(ya,[`meta`,`prevent`]),[`enter`])]},null,40,OK),[[nu,ta.value.text]]),q(`p`,{class:N([`channel-edit-note`,{"is-error":r.editing_error}]),role:`status`},F(r.editing_error||(r.editing_plan?ba(r.editing_plan):`正在读取回退范围…`)),3),q(`div`,kK,[J(o,{label:`取消`,size:`xs`,variant:`ghost`,color:`neutral`,onClick:_a}),J(o,{type:`submit`,label:`回退并发送`,size:`xs`,color:`primary`,disabled:!r.editing_plan||!!r.editing_pending&&r.editing_pending!==`rewind_and_send`,loading:r.editing_pending===`rewind_and_send`},null,8,[`disabled`,`loading`])])],40,DK)):(W(),G(`div`,AK,[q(`div`,{id:`channel-answer-${e.id}`,class:`channel-message-text markdown-body`,innerHTML:r.expanded?e.rendered_text:r.preview.html},null,8,jK),(W(!0),G(U,null,V(r.marks,e=>(W(),G(`button`,{key:e.id,type:`button`,class:`excerpt-mark`,style:ye({left:`${e.left}px`,top:`${e.top}px`}),title:`摘录 ${e.number}:点击修改批注`,"aria-label":`修改摘录 ${e.number} 的批注`,onClick:t=>xe(e.id)},F(e.number),13,MK))),128)),r.preview.truncated?(W(),K(o,{key:0,label:r.expanded?`收起`:`展开全文`,"trailing-icon":r.expanded?`i-lucide-chevron-up`:`i-lucide-chevron-down`,variant:`link`,color:`neutral`,size:`xs`,class:`channel-answer-toggle`,"aria-label":`${r.expanded?`收起回答`:`展开完整回答`} #${e.id}`,"aria-expanded":r.expanded,"aria-controls":`channel-answer-${e.id}`,onClick:t=>li(e,t)},null,8,[`label`,`trailing-icon`,`aria-label`,`aria-expanded`,`aria-controls`,`onClick`])):X(``,!0)])),e.summary?(W(),G(`div`,NK,[q(`small`,null,[t[49]||=Y(`回答摘要`,-1),e.summary_by&&e.summary_by!==e.author?(W(),G(`span`,PK,` · `+F(L(a).display_name(e.summary_by))+` 整理`,1)):X(``,!0)]),q(`div`,{class:`channel-message-text markdown-body`,innerHTML:e.rendered_summary},null,8,FK)])):X(``,!0),r.notes_count?(W(),K(pU,{key:5,count:r.notes_count,notes:r.notes,onLoad:e=>Ct(r.execution_id)},null,8,[`count`,`notes`,`onLoad`])):X(``,!0),e.attachments?.length?(W(),G(`div`,{key:6,innerHTML:L(a).attachment_markup(e.attachments)},null,8,IK)):X(``,!0),r.recommendation?(W(),G(`div`,{key:7,class:N([`channel-recommendation`,`is-${r.recommendation.status}`]),"aria-label":`智能调度推荐`,"aria-live":`polite`},[(W(!0),G(U,null,V([r.recommendation],e=>(W(),G(U,{key:e.message_id},[J(g,{name:`i-lucide-zap`,class:`channel-recommendation-icon`}),e.status===`open`?(W(),G(`span`,LK,[t[50]||=Y(`智能调度建议让 `,-1),q(`strong`,null,F(L(a).display_name(e.member)),1),t[51]||=Y(` 回答`,-1),q(`small`,{title:`${e.label},置信度 ${Number(e.confidence).toFixed(2)}`},`置信度 `+F(Number(e.confidence).toFixed(2))+` · `+F(e.remaining)+` 秒`,9,RK)])):e.status===`waiting`?(W(),G(`span`,zK,`智能调度:主持人答完后请 `+F(L(a).display_name(e.member))+` 回答`,1)):(W(),G(`span`,BK,`智能调度:`+F(e.mode===`interrupt`?`已打断主持人,改由 ${L(a).display_name(e.member)} 回答`:`已请 ${L(a).display_name(e.member)} 回答`),1)),e.can_adopt?(W(),G(U,{key:3},[r.adopting?(W(),G(U,{key:1},[J(o,{label:`打断主持人,改由 ${L(a).display_name(e.member)} 回答`,size:`xs`,variant:`soft`,color:`warning`,onClick:t=>an(e.message_id,`interrupt`)},null,8,[`label`,`onClick`]),J(o,{label:`主持人答完后再请 ${L(a).display_name(e.member)}`,size:`xs`,variant:`soft`,color:`neutral`,onClick:t=>an(e.message_id,`after`)},null,8,[`label`,`onClick`]),J(o,{icon:`i-lucide-x`,"aria-label":`取消采纳`,size:`xs`,variant:`ghost`,color:`neutral`,onClick:t[13]||=e=>Xt.value=0})],64)):(W(),K(o,{key:0,label:`采纳`,icon:`i-lucide-check`,size:`xs`,variant:`soft`,color:`primary`,"aria-label":`采纳建议,请 ${e.member} 回答 #${e.message_id}`,onClick:t=>e.host_busy?Xt.value=e.message_id:an(e.message_id,`after`)},null,8,[`aria-label`,`onClick`]))],64)):X(``,!0)],64))),128))],2)):X(``,!0),(W(!0),G(U,null,V(r.report_rows,({report:e,allowable:t,failed:n})=>(W(),G(`section`,{key:e.id,class:`channel-execution-report`,"aria-label":`执行报告 #${e.id}`},[q(`div`,null,[q(`strong`,null,`执行 #`+F(e.id)+` · `+F(e.label),1)]),e.changes?.length?(W(),G(`p`,HK,`文件变化:`+F(e.changes.join(`、`)),1)):X(``,!0),e.status!==`completed`&&e.result?(W(),G(`p`,UK,F(e.result),1)):X(``,!0),e.denials?.length?(W(),K(uU,{key:2,denials:e.denials,allowable:t,busy:r.allowing===e.id,error:r.allow_errors?.[e.id],onAllow:t=>Ji(e)},null,8,[`denials`,`allowable`,`busy`,`error`,`onAllow`])):X(``,!0),n?(W(),K(o,{key:3,label:`重发`,icon:`i-lucide-rotate-ccw`,size:`xs`,variant:`soft`,color:`neutral`,"aria-label":`把执行 #${e.id} 的原消息填回输入框重发`,onClick:t=>Wi(e)},null,8,[`aria-label`,`onClick`])):X(``,!0)],8,VK))),128))]),header:R(()=>[q(`div`,WK,[q(`div`,GK,[r.private_chat?(W(),K(va(r.armed?yV:fa),{key:0,"disable-hoverable-content":``,ui:la,text:`私聊:查看这次执行的过程`},{default:R(()=>[J(o,{icon:`i-lucide-message-square`,class:`channel-private-chat-key`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":`查看 #${e.id} 的执行过程`,onClick:t=>L(LU)(L(s),e.author,r.execution_id)},null,8,[`aria-label`,`onClick`])]),_:2},1024)):r.can_take_back?X(``,!0):(W(),K(va(r.armed?yV:fa),{key:1,"disable-hoverable-content":``,ui:la,text:`回复`},{default:R(()=>[J(o,{icon:`i-lucide-corner-up-left`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":`回复 #${e.id}`,onClick:t=>xa(e)},null,8,[`aria-label`,`onClick`])]),_:2},1024)),r.can_retract&&!r.editing?(W(),K(va(r.armed?yV:fa),{key:2,"disable-hoverable-content":``,ui:la,text:`撤回`},{default:R(()=>[J(o,{icon:`i-lucide-undo-2`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":`撤回 #${e.id}`,onClick:t=>sa(e.id),loading:r.retracting},null,8,[`aria-label`,`onClick`,`loading`])]),_:2},1024)):X(``,!0),r.can_take_back&&!r.editing?(W(),K(va(r.armed?yV:fa),{key:3,"disable-hoverable-content":``,ui:la,text:`编辑`},{default:R(()=>[J(o,{icon:`i-lucide-pencil`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":`编辑 #${e.id},回退到它之前重新发送`,onClick:t=>ga(e)},null,8,[`aria-label`,`onClick`])]),_:2},1024)):X(``,!0),!r.narrow&&e.kind!==`receipt`&&!r.editing?(W(),K(va(r.armed?yV:fa),{key:4,"disable-hoverable-content":``,ui:la,text:r.reading?`停止朗读`:`朗读`},{default:R(()=>[J(o,{icon:r.reading?`i-lucide-square`:`i-lucide-volume-2`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":r.reading?`停止朗读`:`从 #${e.id} 开始朗读`,onClick:t=>r.reading?L(v).stop():L(v).start(e.id)},null,8,[`icon`,`aria-label`,`onClick`])]),_:2},1032,[`text`])):X(``,!0),r.armed?(W(),K(D,{key:5,open:r.menu_open,items:r.actions,content:{align:`end`,sideOffset:5},ui:{content:`channel-menu`},"onUpdate:open":t=>da.value=t?e.id:0},{default:R(()=>[J(o,{icon:`i-lucide-ellipsis`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":`消息 #${e.id} 的更多操作`},null,8,[`aria-label`])]),_:2},1032,[`open`,`items`,`onUpdate:open`])):(W(),K(o,{key:6,icon:`i-lucide-ellipsis`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":`消息 #${e.id} 的更多操作`,"aria-haspopup":`menu`,onClick:t=>ma(e.id)},null,8,[`aria-label`,`onClick`]))])])]),_:2},1032,[`id`,`data-message-id`,`data-author`,`onPointerenter`,`role`])]),_:2},1032,[`deps`]))),128)),L(tn).has(e.id)&&!L(en).get(e.id)?.length?(W(),K(HV,{key:0,icon:`i-lucide-zap`,skipped:``,label:`智能调度分析中`,expandable:!1},{text:R(()=>[J(bU,{text:`智能调度:正在分析`,seed:`智能调度`,dots:``})]),_:1})):X(``,!0),(W(!0),G(U,null,V(L(en).get(e.id)||[],e=>(W(),K(uH,{key:`decision-${e.id}`,decision:e,free:mt.value},null,8,[`decision`,`free`]))),128))],64))],64))),128))]))),128)),L(i).sending_preview?(W(),K(L(RB).div,{key:1,class:`channel-message-group`,style:ye({opacity:L(ii),y:L(ai)})},{default:R(()=>[J(w,{id:`channel-sending-message`,"data-author":L(a).identities[L(i).sending_preview.author]?.style,role:`user`,parts:[],side:`left`,variant:`naked`,color:`neutral`,class:N([`channel-message channel-sending-message`,{"is-failed":L(i).sending_preview.failed}]),ui:{header:`channel-message-header`,container:`channel-message-container`,body:`channel-message-body`}},{body:R(()=>[q(`div`,KK,[J(h,{src:L(a).identities[L(i).sending_preview.author]?.icon,text:L(a).identities[L(i).sending_preview.author]?.initials||`?`,alt:L(a).display_name(L(i).sending_preview.author),size:`md`,class:N([`channel-avatar`,L(a).identities[L(i).sending_preview.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`div`,qK,[q(`div`,JK,[q(`strong`,null,F(L(a).display_name(L(i).sending_preview.author)),1),L(i).sending_preview.failed?(W(),K(T,{key:0,label:`发送失败`,color:`error`,variant:`soft`,size:`xs`})):X(``,!0)]),q(`div`,YK,[q(`time`,null,F(L(a).format_time(L(i).sending_preview.created_at)),1),L(i).sending_preview.failed?X(``,!0):(W(),G(`span`,XK,`发送中…`))])])]),q(`div`,ZK,[q(`div`,{class:`channel-message-text markdown-body`,innerHTML:si.value},null,8,QK)]),L(i).sending_preview.files.length?(W(),G(`div`,$K,`附件:`+F(L(i).sending_preview.files.join(`、`)),1)):X(``,!0),L(i).sending_preview.failed?(W(),G(U,{key:1},[q(`p`,eq,F(L(i).sending_preview.failed)+`;草稿已保留在输入框`,1),q(`div`,tq,[J(o,{label:`重试`,icon:`i-lucide-rotate-ccw`,size:`sm`,variant:`soft`,color:`primary`,"aria-label":`重新发送这条消息`,disabled:!Mt.value||L(i).sending_message,onClick:Sa},null,8,[`disabled`]),J(o,{label:`放弃`,icon:`i-lucide-x`,size:`sm`,variant:`soft`,color:`neutral`,"aria-label":`放弃发送,移除这张卡片`,disabled:L(i).sending_message,onClick:t[14]||=e=>L(s)(`discard_sending`)},null,8,[`disabled`])])],64)):X(``,!0)]),_:1},8,[`data-author`,`class`])]),_:1},8,[`style`])):X(``,!0),(L(gr)===`end`||L(_r)===`end`)&&!L(i).query&&!L(i).mention_only&&!L(i).host_only?(W(),G(`div`,nq,[L(gr)===`end`?(W(),K(CH,{key:0,ref:e=>gn(r)?r.value=e:r=e,onEdit:t[15]||=e=>n(`edit`)},null,512)):X(``,!0),L(_r)===`end`?(W(),K(ZH,{key:1})):X(``,!0)])):X(``,!0),!hr.value.length&&!vt.value.length?(W(),G(`div`,rq,[J(g,{name:L(i).query||L(i).mention_only||L(i).host_only?`i-lucide-search`:`i-lucide-hash`},null,8,[`name`]),q(`h2`,null,F(L(i).query||L(i).mention_only||L(i).host_only?`没有找到消息`:at.value.title),1),q(`p`,null,F(L(i).query||L(i).mention_only||L(i).host_only?`试试其他关键词,或清除筛选。`:L(a).empty_discussion_message(at.value)),1)])):X(``,!0)],544)),t,18),hr.value.length&&!it.value||te.value?.touch||L(v).state.message_id?(W(),G(`div`,iq,[te.value?.touch?(W(),G(`button`,{key:0,type:`button`,class:`channel-listen-pill`,onMousedown:t[19]||=_u(()=>{},[`prevent`]),onClick:ve},[J(g,{name:`i-lucide-message-square-quote`}),t[52]||=Y(`添加到对话`,-1)],32)):X(``,!0),te.value?.touch&&te.value.speech?(W(),G(`button`,{key:1,type:`button`,class:`channel-listen-pill`,"aria-label":`从选中处开始朗读`,onMousedown:t[20]||=_u(()=>{},[`prevent`]),onClick:Oe},[J(g,{name:`i-lucide-headphones`}),t[53]||=Y(`听当前`,-1)],32)):X(``,!0),L(v).state.message_id?(W(),G(`button`,{key:2,type:`button`,class:N([`channel-listen-pill`,{"is-on":L(v).state.following}]),"aria-pressed":L(v).state.following,title:L(v).state.following?`手动滚动即取消跟随`:`页面跟随朗读位置滚动`,onClick:t[21]||=e=>L(v).state.following?L(v).state.following=!1:L(v).follow()},[J(g,{name:`i-lucide-locate-fixed`}),Y(F(L(v).state.following?`跟随中`:`跟随`),1)],10,aq)):X(``,!0),L(v).state.reading?(W(),G(`button`,{key:3,type:`button`,class:`channel-listen-pill`,"aria-label":`退出朗读`,onClick:t[22]||=e=>L(v).stop()},[J(g,{name:`i-lucide-square`}),t[54]||=Y(`退出`,-1)])):X(``,!0),hr.value.length&&!it.value?(W(),K(o,{key:4,icon:`i-lucide-arrow-down`,color:`neutral`,variant:`outline`,"aria-label":`回到最新消息`,class:`channel-latest-button`,onClick:Di})):X(``,!0)])):X(``,!0),q(`div`,oq,[q(`div`,{class:`channel-composer-column`,onDragover:t[36]||=(...e)=>L(a).drop_attachments&&L(a).drop_attachments(...e),onDrop:t[37]||=(...e)=>L(a).drop_attachments&&L(a).drop_attachments(...e),onPaste:t[38]||=(...e)=>L(a).paste_attachments&&L(a).paste_attachments(...e),onKeydownCapture:t[39]||=e=>{or(e),wa(e)},onInput:$n,onClick:$n,onKeyup:$n,onSelect:$n,onCompositionstart:cr,onCompositionupdate:cr,onCompositionend:cr,onScrollCapture:mn},[J(O,{open:!!hn.value,reference:fr.value,content:{side:`top`,align:`start`,sideOffset:8,onOpenAutoFocus:lr,onCloseAutoFocus:lr},ui:{content:`channel-select-menu channel-mention-menu`},"onUpdate:open":t[24]||=e=>!e&&(hn.value=null)},{content:R(()=>[q(`div`,sq,[q(`span`,null,F(Kn.value),1),t[55]||=q(`small`,null,`↑↓ 选择 · Enter 确认`,-1)]),q(`div`,{id:`channel-mention-list`,ref_key:`mention_list`,ref:Cn,role:`listbox`,"aria-label":Kn.value,class:`channel-mention-list`},[(W(!0),G(U,null,V(Gn.value,(e,n)=>(W(),G(U,{key:e.key},[n===0||e.group!==Gn.value[n-1].group?(W(),G(`p`,lq,F(e.group),1)):X(``,!0),q(`button`,{id:`channel-mention-${n}`,type:`button`,role:`option`,"aria-selected":e===qn.value,tabindex:`-1`,class:`channel-mention-option`,onPointerdown:t[23]||=_u(()=>{},[`prevent`]),onClick:t=>tr(e),onPointermove:e=>Sn.value=n},[e.mode?(W(),G(U,{key:0},[J(g,{name:e.mode.command.startsWith(`/goal`)?`i-lucide-target`:`i-lucide-messages-square`,class:`channel-mention-file-icon`},null,8,[`name`]),q(`span`,{class:N({"channel-mention-disabled":e.mode.disabled})},F(e.mode.label),3),q(`small`,{title:e.mode.description},F(e.mode.description),9,dq)],64)):e.workflow?(W(),G(U,{key:1},[J(g,{name:`i-lucide-workflow`,class:`channel-mention-file-icon`}),q(`span`,{class:N({"channel-mention-disabled":e.disabled&&!e.enabled})},F(e.workflow.label),3),q(`small`,{title:e.workflow.description},F(e.enabled?`已启用`:e.disabled||e.workflow.description),9,fq)],64)):e.skill?(W(),G(U,{key:2},[J(g,{name:`i-lucide-sparkles`,class:`channel-mention-file-icon`}),q(`span`,null,F(e.skill.label),1),q(`small`,{title:e.skill.description},F(e.skill.description),9,pq)],64)):e.entry?(W(),G(U,{key:3},[J(g,{name:e.self?`i-lucide-folder-check`:e.entry.kind===`directory`?`i-lucide-folder`:`i-lucide-file-text`,class:`channel-mention-file-icon`},null,8,[`name`]),q(`span`,{title:e.entry.path},F(e.self?`引用此文件夹`:`${e.entry.name}${e.entry.kind===`directory`?`/`:``}`),9,mq),On.value?.search?(W(),G(`small`,{key:0,title:e.entry.path},F(e.entry.path.split(`/`).slice(0,-1).join(`/`)),9,hq)):X(``,!0),e.entry.kind===`directory`&&!e.self?(W(),K(g,{key:1,name:`i-lucide-chevron-right`,class:`channel-mention-file-icon channel-mention-drill`})):X(``,!0)],64)):(W(),G(U,{key:4},[yn[e.name]?(W(),K(h,{key:0,icon:yn[e.name].icon,alt:e.name,size:`xs`,class:`channel-avatar`},null,8,[`icon`,`alt`])):(W(),K(h,{key:1,src:L(a).identities[e.name]?.icon,text:L(a).identities[e.name]?.initials,alt:L(a).display_name(e.name),size:`xs`,class:N([`channel-avatar`,L(a).identities[e.name]?.style])},null,8,[`src`,`text`,`alt`,`class`])),q(`span`,null,F(yn[e.name]?e.name:L(a).display_name(e.name)),1),q(`small`,null,`@`+F(er(e.name)),1)],64))],40,uq)],64))),128)),Nn.value?(W(),G(`p`,gq,`正在读取项目目录…`)):Gn.value.length?X(``,!0):(W(),G(`p`,_q,F(hn.value?.command?`没有匹配的工作流或技能`:En.value?`没有匹配的成员或文件`:`没有匹配的成员`),1))],8,cq)]),_:1},8,[`open`,`reference`,`content`]),at.value.free?.queued_messages?(W(),K(PU,{key:0,queue:at.value.free.queued_messages,"room-id":at.value.id},null,8,[`queue`,`room-id`])):X(``,!0),J(ee,{ref_key:`prompt`,ref:rt,modelValue:L(l),"onUpdate:modelValue":t[35]||=e=>gn(l)?l.value=e:null,"submit-on-enter":L(RU),enterkeyhint:L(RU)?`send`:`enter`,autofocus:!1,rows:1,maxrows:Yq,placeholder:`发消息到 # ${at.value.title}`,"aria-label":`留言正文`,role:`combobox`,"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-expanded":!!hn.value,"aria-controls":hn.value?`channel-mention-list`:void 0,"aria-activedescendant":hn.value&&qn.value?`channel-mention-${Gn.value.indexOf(qn.value)}`:void 0,variant:`outline`,color:`neutral`,class:N([`channel-composer`,{"has-mentions":fn.value}]),ui:{header:`channel-composer-header`,base:`channel-editor`,footer:`channel-composer-footer`},onSubmit:Sa},{header:R(()=>[L(i).attachment_drafts.length||kt.value.length||jt.value.length?(W(),G(`div`,vq,[jt.value.length?(W(),K(O,{key:0,content:{side:`top`,align:`start`},"onUpdate:open":t[26]||=e=>Pt.value=0},{content:R(()=>[q(`ol`,xq,[(W(!0),G(U,null,V(jt.value,(e,n)=>(W(),G(`li`,{key:e.id},[q(`span`,Sq,F(n+1)+`.`,1),q(`div`,Cq,[q(`small`,null,`选中文字 · `+F(L(MW)(e)),1),q(`p`,wq,F(e.text),1),Pt.value===e.id?(W(),G(U,{key:0},[t[56]||=q(`small`,null,`批注`,-1),J(A,{modelValue:e.comment,"onUpdate:modelValue":t=>e.comment=t,rows:2,autoresize:``,autofocus:``,placeholder:`添加批注(可选)`,"aria-label":`摘录的批注`,class:`w-full`},null,8,[`modelValue`,`onUpdate:modelValue`])],64)):e.comment?(W(),G(U,{key:1},[t[57]||=q(`small`,null,`批注`,-1),q(`p`,Tq,F(e.comment),1)],64)):X(``,!0)]),q(`div`,Eq,[q(`button`,{type:`button`,"aria-label":`修改摘录 ${n+1} 的批注`,title:`修改批注`,onClick:t=>Pt.value=Pt.value===e.id?0:e.id},[J(g,{name:`i-lucide-pencil`})],8,Dq),q(`button`,{type:`button`,"aria-label":`移除摘录 ${n+1}`,title:`移除`,disabled:L(i).sending_message,onClick:t=>Nt(e)},[J(g,{name:`i-lucide-trash-2`})],8,Oq)])]))),128))])]),default:R(()=>[q(`div`,yq,[J(g,{name:`i-lucide-message-square-quote`}),q(`span`,null,F(jt.value.length)+` 条摘录`,1),q(`button`,{type:`button`,class:`excerpt-chip-clear`,"aria-label":`移除全部摘录`,title:`移除全部摘录`,disabled:L(i).sending_message,onClick:t[25]||=_u(e=>L(OW).excerpts=[],[`stop`])},[J(g,{name:`i-lucide-x`})],8,bq)])]),_:1})):X(``,!0),(W(!0),G(U,null,V(kt.value,e=>(W(),G(`div`,{key:`ref:${e.path}`,class:`attachment-draft-file attachment-draft-ref`,title:e.path},[e.kind===`file`?(W(),G(`span`,{key:0,innerHTML:L(a).attachment_file_icon(e.name)},null,8,Aq)):(W(),K(g,{key:1,name:`i-lucide-folder`,class:`attachment-ref-folder`})),q(`span`,jq,[q(`span`,null,F(e.name),1),q(`small`,null,F(e.kind===`directory`?`项目文件夹`:`项目文件`)+` · `+F(e.path),1)]),q(`button`,{type:`button`,class:`attachment-remove`,"aria-label":`移除 ${e.path}`,disabled:L(i).sending_message,onClick:t=>kt.value=kt.value.filter(t=>t!==e)},[J(g,{name:`i-lucide-x`})],8,Mq)],8,kq))),128)),(W(!0),G(U,null,V(L(i).attachment_drafts,e=>(W(),G(`div`,{key:e.id,class:N(e.preview_url?`attachment-draft-image`:`attachment-draft-file`)},[e.preview_url?(W(),G(`img`,{key:0,src:e.preview_url,alt:e.file_name,title:e.file_name},null,8,Nq)):(W(),G(U,{key:1},[q(`span`,{innerHTML:L(a).attachment_file_icon(e.file_name)},null,8,Pq),q(`span`,Fq,[q(`span`,{title:e.file_name},F(e.file_name),9,Iq),q(`small`,null,F(L(a).attachment_size(e.size)),1)])],64)),q(`button`,{type:`button`,class:`attachment-remove`,"aria-label":`移除 ${e.file_name}`,disabled:L(i).sending_message,onClick:t=>L(s)(`remove_attachment`,e.id)},[J(g,{name:`i-lucide-x`})],8,Lq),e.uploading?(W(),G(`span`,{key:2,class:`attachment-uploading`,role:`status`,"aria-label":`正在上传 ${e.file_name}`},[J(g,{name:`i-lucide-loader-circle`})],8,Rq)):X(``,!0)],2))),128))])):X(``,!0),(W(!0),G(U,null,V(ft.value,e=>(W(),G(`div`,{key:e.name,class:`channel-reply-draft channel-queue-hint`},[J(g,{name:`i-lucide-user-round-x`}),q(`span`,null,F(L(a).display_name(e.name))+` 待注册:在其会话中粘贴启动指令`,1),L(i).access?.can_manage?(W(),K(o,{key:0,icon:Li.value===e.name?`i-lucide-check`:`i-lucide-copy`,label:Li.value===e.name?`已复制`:`复制启动指令`,"aria-live":`polite`,size:`xs`,color:`neutral`,variant:`ghost`,class:`channel-launch-copy`,onClick:t=>Bi(e.name)},null,8,[`icon`,`label`,`onClick`])):X(``,!0)]))),128)),pt.value?(W(),G(`div`,zq,[J(g,{name:`i-lucide-clock`}),q(`span`,null,F(pt.value),1),ut(dt.value)&&L(i).access?.can_manage?(W(),K(o,{key:0,icon:Li.value===dt.value.name?`i-lucide-check`:`i-lucide-copy`,label:Li.value===dt.value.name?`已复制`:`复制启动指令`,"aria-live":`polite`,size:`xs`,color:`neutral`,variant:`ghost`,class:`channel-launch-copy`,onClick:t[27]||=e=>Bi(dt.value.name)},null,8,[`icon`,`label`])):X(``,!0)])):X(``,!0),L(i).editing_queued?(W(),G(`div`,Bq,[J(g,{name:`i-lucide-pencil`}),t[58]||=q(`span`,null,`编辑排队消息:发送即保存修改,仍按原位置排队`,-1),J(o,{icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`取消编辑排队消息`,onClick:t[28]||=e=>L(s)(`queue_cancel_edit`)})])):X(``,!0),L(i).reply_to?(W(),G(`div`,Vq,[J(g,{name:`i-lucide-corner-up-left`}),q(`span`,null,F(`回复 #${L(i).reply_to}`),1),J(o,{icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`取消回复`,onClick:t[29]||=e=>L(s)(`cancel_reply`)})])):X(``,!0)]),footer:R(()=>[L(x).state.status?(W(),G(U,{key:0},[J(yV,{text:L(RU)?`取消 · Esc`:`取消`},{default:R(()=>[J(o,{type:`button`,icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-voice-button`,"aria-label":`取消语音输入`,onClick:t[30]||=e=>L(x).cancel()})]),_:1},8,[`text`]),q(`span`,{class:N([`channel-voice-levels`,{"is-discarding":C.discard}]),role:`status`,"aria-label":L(x).state.status===`recording`?`正在录音 ${S(L(x).state.seconds)}`:`正在识别`},[L(x).state.status===`recording`?(W(),G(U,{key:0},[q(`span`,Wq,[(W(!0),G(U,null,V(L(x).state.levels,(e,t)=>(W(),G(`i`,{key:t,style:ye({transform:`scaleY(${.15+e*.85})`})},null,4))),128))]),q(`small`,null,F(S(L(x).state.seconds)),1),C.by?(W(),G(`small`,Gq,F(C.discard?`松开取消`:C.by===`touch`?`松开转文字 · 上滑取消`:`松开空格转文字`),1)):X(``,!0)],64)):(W(),G(`small`,Kq,`正在识别…`))],10,Uq),J(yV,{text:L(RU)?`完成,转成文字 · Enter`:`完成,转成文字`},{default:R(()=>[J(o,{type:`button`,icon:`i-lucide-check`,color:`neutral`,size:`sm`,class:`channel-primary-button channel-round-button`,"aria-label":`结束录音并转成文字`,loading:L(x).state.status===`transcribing`,onClick:t[31]||=e=>L(x).toggle()},null,8,[`loading`])]),_:1},8,[`text`])],64)):(W(),G(U,{key:1},[J(o,{type:`button`,icon:`i-lucide-paperclip`,"aria-label":`添加附件`,title:`图片、PDF 或其他文件 · 每个最多 20 MiB`,color:`neutral`,variant:`ghost`,size:`sm`,disabled:L(i).sending_message,onClick:t[32]||=e=>L(s)(`choose_attachments`)},null,8,[`disabled`]),b.value?(W(),K(yV,{key:0,text:L(y).on.value?`关闭语音播报`:`语音播报:新回复自动朗读摘要`},{default:R(()=>[J(o,{type:`button`,icon:`i-lucide-radio`,color:`neutral`,variant:`ghost`,size:`sm`,class:N([`channel-voice-button channel-broadcast-button`,{"is-on":L(y).on.value}]),"aria-pressed":L(y).on.value,"aria-label":L(y).on.value?`关闭语音播报`:`开启语音播报`,onClick:t[33]||=e=>L(y).toggle()},null,8,[`class`,`aria-pressed`,`aria-label`])]),_:1},8,[`text`])):X(``,!0),J(yV,{text:L(RU)?`语音输入 · 也可按住空格说话`:`按住说话,或轻点开始`},{default:R(()=>[J(o,{type:`button`,icon:`i-lucide-mic`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-voice-button channel-voice-mic`,"aria-label":`语音输入`,disabled:L(i).sending_message,onPointerdown:E,onClick:k,onContextmenu:t[34]||=_u(()=>{},[`prevent`])},null,8,[`disabled`])]),_:1},8,[`text`]),J(o,{type:`button`,icon:`i-lucide-arrow-up`,color:`neutral`,size:`sm`,class:`channel-primary-button channel-round-button channel-send`,"aria-label":`发送`,title:`发送 · Enter`,disabled:!Mt.value,onClick:Sa},null,8,[`disabled`])],64))]),default:R(()=>[fn.value?(W(),G(`div`,{key:0,ref_key:`mirror`,ref:pn,class:`channel-editor channel-editor-mirror`,"aria-hidden":`true`,innerHTML:fn.value},null,8,Hq)):X(``,!0)]),_:1},8,[`modelValue`,`submit-on-enter`,`enterkeyhint`,`placeholder`,`aria-expanded`,`aria-controls`,`aria-activedescendant`,`class`]),q(`div`,qq,[q(`span`,null,F(Ot.value),1),q(`span`,Jq,[u.value?(W(),G(`span`,{key:0,class:N({"is-near-limit":d.value})},[Y(F(u.value)+` / `+F(L(a).max_message_length),1),t[59]||=q(`span`,{class:`channel-note-divider`},`·`,-1)],2)):X(``,!0),t[60]||=q(`span`,{class:`channel-key-hint`},[q(`kbd`,null,`Enter`),Y(` 发送`),q(`span`,{class:`channel-note-divider`},`·`),q(`kbd`,null,`Shift`),Y(`+`),q(`kbd`,null,`Enter`),Y(` 换行`)],-1)])])],32)])])}}},[[`__scopeId`,`data-v-af1e668a`]]),rY={class:`page-heading`},iY={class:`topic-brief`},aY={key:0,class:`host-progress`},oY={key:1,class:`turn-panel host-turn`},sY={class:`turn-header`},cY={class:`turn-expert`},lY={class:`turn-question`},uY={class:`fine-print`},dY={key:2,class:`host-last-turn`},fY={class:`form-footer`},pY=[`href`],mY={key:0,class:`host-progress access-evidence`,"aria-label":`实际执行进展`,role:`status`},hY={key:1,class:`access-setup access-repair`,"aria-label":`本机接入设置`},gY={class:`access-repair-heading`},_Y={key:0,class:`access-repair-fields`},vY={key:2,class:`fine-print`},yY={key:3,class:`fine-print`},bY={key:4,class:`fine-print`},xY=EH({__name:`TopicPanel`,props:{section:{type:String,required:!0}},emits:[`open`,`detail`],setup(e){let t=e,{view:n,bridge:r,act:i,pending:a}=Or(`discussion`),o=Q(()=>n.value.room),s=Q(()=>o.value?.current_turn),c=Q(()=>s.value&&[`open`,`pending`,`notified`].includes(s.value.status)),l=Q(()=>o.value?.session?.status===`paused`),u=Q(()=>`${n.value.room_site}/r/${o.value?.id}`),d=Q(()=>o.value?.free?.executions?.[0]),f=Q(()=>n.value.launch.repair?.room_id===o.value?.id?n.value.launch.repair:null),p={dispatched:`唤醒中`,started:`执行中`,completed:`已完成`,failed:`失败`};return(e,m)=>{let h=bA,g=uV,_=tA,v=Yk,y=WV,b=aV,x=hV;return W(),K(L(RB).section,{class:N([`merged-section`,{"access-page":t.section===`access`,"host-page":t.section===`host`}]),"aria-label":t.section===`host`?`当前讨论`:`接入`,initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{duration:.16}},{default:R(()=>[t.section===`host`?(W(),G(U,{key:0},[q(`div`,rY,[q(`div`,null,[m[3]||=q(`span`,{class:`eyebrow`},`讨论进程`,-1),m[4]||=q(`h2`,null,`当前讨论`,-1),q(`p`,null,`当前由 `+F(L(r).display_name(o.value.host))+` 主持,围绕具体问题组织下一轮发言。`,1)]),J(h,{icon:`i-lucide-pencil`,label:`编辑议题`,variant:`outline`,color:`neutral`,class:`channel-surface-button`,onClick:m[0]||=t=>e.$emit(`open`,`edit`)})]),q(`div`,iY,[q(`div`,null,[m[5]||=q(`h3`,null,`讨论目标`,-1),q(`p`,null,F(o.value.session?.goal||o.value.goal||`待主持人根据用户原文补全`),1)]),q(`div`,null,[m[6]||=q(`h3`,null,`当前焦点`,-1),q(`p`,null,F(o.value.focus||`尚未设置当前焦点`),1)])]),o.value.limits?(W(),G(`div`,aY,[m[7]||=q(`span`,null,`进度`,-1),q(`p`,null,F(L(r).limits_label(o.value.limits)),1),J(g,{color:l.value?`warning`:`neutral`,variant:`subtle`},{default:R(()=>[Y(F(l.value?`已暂停`:`讨论中`),1)]),_:1},8,[`color`])])):X(``,!0),c.value?(W(),G(`section`,oY,[q(`div`,sY,[m[8]||=q(`h3`,null,`当前发言安排`,-1),J(g,{color:`primary`,variant:`subtle`},{default:R(()=>[Y(F(L(r).turn_label(s.value,o.value)),1)]),_:1})]),q(`div`,cY,[J(_,{src:L(r).identities[s.value.expert]?.icon,text:L(r).identities[s.value.expert]?.initials,alt:s.value.expert,class:N([`message-mark channel-avatar`,L(r).identities[s.value.expert]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`div`,null,[q(`strong`,null,F(s.value.expert),1),q(`small`,null,`发言安排 #`+F(s.value.id),1)])]),q(`p`,lY,F(s.value.question),1),q(`p`,uY,F(L(r).turn_guidance(s.value,o.value)),1)])):(W(),G(`p`,dY,F(l.value?`讨论已暂停,继续后由主持人重新安排。`:`等待主持人安排下一步。`),1)),q(`div`,fY,[q(`a`,{href:`${u.value}/turns`,target:`_blank`,rel:`noopener`,class:`subtle-link`},[m[9]||=Y(`发言安排历史 `,-1),J(v,{name:`i-lucide-arrow-up-right`})],8,pY)])],64)):(W(),G(U,{key:1},[m[13]||=q(`div`,{class:`page-heading access-heading`},[q(`div`,null,[q(`h2`,null,`本机连接`),q(`p`,null,`成员的接入操作在上方;讨论暂停后可修正本机软件连接。`)])],-1),d.value?(W(),G(`section`,mY,[m[10]||=q(`span`,null,`最近执行`,-1),q(`p`,null,`#`+F(d.value.id)+` `+F(L(r).display_name(d.value.member))+` · `+F(d.value.status===`cancelled`?L(r).stop_label(d.value):p[d.value.status]||d.value.status),1)])):X(``,!0),l.value&&L(n).launch.available&&!o.value.archived&&!L(n).launch.remote?(W(),G(`section`,hY,[q(`div`,gY,[m[11]||=q(`h3`,null,`修正本场软件连接`,-1),J(h,{label:`读取本场配置`,variant:`outline`,color:`neutral`,class:`channel-surface-button`,loading:L(a)===`load_room_configuration`,onClick:m[1]||=e=>L(i)(`load_room_configuration`)},null,8,[`loading`])]),m[12]||=q(`div`,{class:`access-repair-description`},[q(`p`,null,`修正软件路径,或切换 Codex 的 App / CLI 接入。保留原房间和会话,保存后到进度看板继续。`),q(`p`,{class:`fine-print`},`App 需保持运行,模型与文件权限沿用原聊天设置。切回 CLI 前,需让 App 释放原聊天。`)],-1),f.value?(W(),G(`div`,_Y,[(W(!0),G(U,null,V(f.value.participants,(e,t)=>(W(),G(`div`,{key:t,class:`form-two-columns`},[[`codex`,`codex_cli`].includes(e.adapter)?(W(),K(b,{key:0,label:`${t} · 接入方式`},{default:R(()=>[J(y,{"model-value":e.adapter,items:[{label:`Codex App`,value:`codex`},{label:`Codex CLI`,value:`codex_cli`}],class:`w-full`,"onUpdate:modelValue":e=>L(r).write_room_adapter(t,e)},null,8,[`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`label`])):X(``,!0),J(b,{label:`${t} · ${e.adapter===`antigravity`?`Sidecar 目录`:`软件路径`}`},{default:R(()=>[J(x,{"model-value":e[e.adapter===`antigravity`?`ipc_directory`:`executable`]||``,class:`w-full`,"onUpdate:modelValue":e=>L(r).write_room_connection(t,e)},null,8,[`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`label`])]))),128)),J(h,{label:`保存本场接入设置`,class:`channel-primary-button`,loading:L(a)===`save_room_configuration`,onClick:m[2]||=e=>L(i)(`save_room_configuration`)},null,8,[`loading`])])):X(``,!0)])):l.value&&L(n).launch.remote?(W(),G(`p`,vY,`线上连接暂不提供已登记房间的软件路径修正。`)):l.value?(W(),G(`p`,bY,`本机服务未连接,启动后可读取配置。`)):(W(),G(`p`,yY,`讨论正在运行;需要修正连接时,先在进度看板暂停。`))],64))]),_:1},8,[`class`,`aria-label`])}}},[[`__scopeId`,`data-v-f4ac3687`]]),SY={slots:{root:``,content:`data-[state=open]:animate-[collapsible-down_200ms_var(--ease-out)] data-[state=closed]:animate-[collapsible-up_200ms_var(--ease-out)] data-[state=closed]:overflow-hidden`}},CY={__name:`Collapsible`,props:{as:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,i=La(),a=AE(`collapsible`,n),o=Am(),s=jE(pm(a,`as`,`defaultOpen`,`open`,`disabled`,`unmountOnHide`),r),c=Q(()=>Jk({extend:SY,...o.ui?.collapsible||{}})());return(e,t)=>(W(),K(L(Qg),Z(L(s),{"data-slot":`root`,class:c.value.root({class:[L(a).ui?.root,L(a).class]})}),{default:R(({open:t})=>[i.default?(W(),K(L(e_),{key:0,"as-child":``},{default:R(()=>[H(e.$slots,`default`,{open:t})]),_:2},1024)):X(``,!0),J(L($g),{"data-slot":`content`,class:N(c.value.content({class:L(a).ui?.content}))},{default:R(()=>[H(e.$slots,`content`)]),_:3},8,[`class`])]),_:3},16,[`class`]))}},wY=[`read`,`write`,`auto`,`full`],TY=1e3,EY={stoppable:!0,progress:!0},DY={stoppable:!1,progress:!1},OY={codex_cli:{platform:`Codex`,label:`Codex CLI`,kind:`cli`,location:`executable`,fields:[`project_id`,`project_name`],efforts:[`low`,`medium`,`high`,`xhigh`,`max`,`ultra`],models:!0,access_levels:wY,per_tool_allow:!1,access_hints:{read:`只读沙箱`,write:`项目可写的沙箱,命令在沙箱内运行、可联网`,auto:`沙箱外的操作由模型申请提权,Codex 自动审核代替人工批准`,full:`无沙箱、无审批(--dangerously-bypass-approvals-and-sandbox)`},client:`codex`,adopt:`session`,host_existing:!0,session_family:`codex`,capabilities:{delivery:EY,rewind:`cut`,project:!0,access_env:!0,enforces_read_only:!0,limits_directories:!0,ripgrep:!0,chat:!0}},codex:{platform:`Codex`,label:`Codex App`,kind:`app`,location:`executable`,fields:[`source_thread_id`,`project_id`,`project_name`],efforts:null,models:!1,access_levels:null,per_tool_allow:!1,client:`codex`,adopt:`session`,host_existing:!0,session_family:`codex`,capabilities:{delivery:DY,rewind:`cut`,project:!0,chat:!0}},claude:{platform:`Claude`,label:`Claude Code`,kind:`cli`,location:`executable`,fields:[`allowed_tools`],efforts:[`low`,`medium`,`high`,`xhigh`,`max`],models:!0,access_levels:wY,per_tool_allow:!0,access_hints:{read:`只放行网站命令与草稿,不改项目文件、不跑其他命令`,write:`可改项目文件,Bash / PowerShell 命令全部放行(无沙箱)`,auto:`Claude auto 模式:由分类器判断,实测项目外写入和联网都会放行`,full:`bypassPermissions:跳过全部权限检查`},client:`claude`,adopt:`own_cwd`,host_existing:!0,restore_manual:!0,resume_command:e=>`claude --resume ${e}`,windows_command:`codiscuss`,capabilities:{delivery:EY,rewind:`cut`,project:!0,access_env:!0,chat:!0}},antigravity_cli:{platform:`Antigravity`,label:`Antigravity CLI`,kind:`cli`,location:`executable`,fields:[`project_id`,`project_name`],efforts:[`low`,`medium`,`high`,`xhigh`,`max`],efforts_per_model:!0,models:!0,defaults_by_query:!0,access_levels:[`read`,`write`,`full`],per_tool_allow:!0,access_hints:{read:`只放行网站命令;碰到未放行的命令会直接结束本轮`,write:`可写项目,命令全部放行(在 agy 沙箱内)`,full:`跳过全部权限确认(--dangerously-skip-permissions),并放开沙箱外命令与 MCP 工具`},unsupported_hints:{auto:`agy 只在交互窗口提供自动模式,后台运行(-p)不支持`},client:`antigravity`,adopt:`session`,host_existing:!1,own_project_when_bound:!0,capabilities:{delivery:EY,rewind:`cut`,project:!0,access_env:!0,chat:!0},task_rules:(e,{runs_commands:t})=>(t?``:`无人值守下 run_command 只能运行 ${e} 的 subcommands 子命令,其他命令会被自动拒绝并使会话直接结束;列目录、搜索或读取文件用 list_dir、find_by_name、grep_search、view_file。`)+`多步任务中,在关键转折处用一句话写出进展再继续:agy 不输出思考过程,网页只能靠这些话显示你做到哪一步。`},antigravity:{platform:`Antigravity`,label:`Antigravity App`,kind:`app`,location:`ipc_directory`,fields:[`project_id`,`project_name`],efforts:null,models:!1,access_levels:null,per_tool_allow:!1,client:`antigravity`,adopt:`session`,host_existing:!0,capabilities:{delivery:DY,rewind:`kept`,project:!0,chat:!0}},api:{platform:``,label:`模型 API`,kind:`api`,location:``,fields:[`base_url`,`api_protocol`,`api_key_ref`],efforts:null,models:!1,access_levels:[`read`,`write`],per_tool_allow:!1,adopt:``,host_existing:!1,access_hints:{read:`用接入程序的文件工具读取、搜索项目文件`,write:`还可新建、覆盖、局部编辑项目文件;没有命令行`},unsupported_hints:{auto:`API 成员没有命令行,没有需要软件审批的操作`,full:`API 成员没有命令行,没有需要软件审批的操作`},capabilities:{delivery:EY,rewind:`fresh`,project:!0,file_tools:!0,limits_directories:!0,chat:!0}}};Object.keys(OY);function kY(e){let t=OY[e];return t?{id:e,session_family:e,windows_command:`codiscuss.cmd`,...t}:null}function AY(e){return OY[e]?.capabilities||{delivery:DY,rewind:`kept`,project:!1}}var jY=[`aria-label`],MY=[`aria-label`,`disabled`],NY=[`maxlength`,`aria-label`,`value`,`disabled`],PY=[`aria-label`,`disabled`],FY=EH({__name:`NumberStepper`,props:{modelValue:{type:Number,required:!0},min:{type:Number,default:1},max:{type:Number,required:!0},step:{type:Number,default:1},label:{type:String,required:!0},disabled:Boolean},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t;function i(e){let t=Math.min(n.max,Math.max(n.min,e));t!==n.modelValue&&r(`update:modelValue`,t)}function a(e){let t=Number.parseInt(e.target.value,10);Number.isFinite(t)&&i(t),e.target.value=String(n.modelValue)}return(t,n)=>{let r=Yk;return W(),G(`span`,{class:`number-stepper`,role:`group`,"aria-label":e.label},[q(`button`,{type:`button`,class:`number-stepper-step`,"aria-label":`减少 ${e.step}`,disabled:e.disabled||e.modelValue<=e.min,onClick:n[0]||=t=>i(e.modelValue-e.step)},[J(r,{name:`i-lucide-minus`})],8,MY),q(`input`,{class:`number-stepper-value`,type:`text`,inputmode:`numeric`,pattern:`[0-9]*`,maxlength:String(e.max).length,"aria-label":e.label,value:e.modelValue,disabled:e.disabled,style:ye({width:`${String(e.max).length+1.5}ch`}),onFocus:n[1]||=e=>e.target.select(),onChange:a,onKeydown:n[2]||=yu(_u(e=>e.target.blur(),[`prevent`]),[`enter`])},null,44,NY),q(`button`,{type:`button`,class:`number-stepper-step`,"aria-label":`增加 ${e.step}`,disabled:e.disabled||e.modelValue>=e.max,onClick:n[3]||=t=>i(e.modelValue+e.step)},[J(r,{name:`i-lucide-plus`})],8,PY)],8,jY)}}},[[`__scopeId`,`data-v-37a42d72`]]),IY={class:`api-requests`},LY={class:`api-requests-sentence`},RY={key:0},zY={class:`api-requests-help`},BY=0,VY=10,HY=EH({__name:`ApiRequestsField`,props:{modelValue:{type:Number,required:!0},disabled:Boolean},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=I(300);return z(()=>n.modelValue,e=>{e!==BY&&(i.value=e)},{immediate:!0}),(t,n)=>{let a=TH;return W(),G(`span`,IY,[q(`span`,LY,[e.modelValue===BY?(W(),G(`span`,RY,`API 成员每次执行可一直调用模型,不限次数`)):(W(),G(U,{key:1},[n[2]||=q(`span`,null,`API 成员每次执行最多调用模型`,-1),J(FY,{"model-value":e.modelValue,max:L(TY),step:VY,label:`API 成员每次执行的模型请求上限`,disabled:e.disabled,"onUpdate:modelValue":n[0]||=e=>r(`update:modelValue`,e)},null,8,[`model-value`,`max`,`disabled`]),n[3]||=q(`span`,null,`次,然后停止`,-1)],64)),J(a,{"model-value":e.modelValue===BY,disabled:e.disabled,label:`不限`,"aria-label":`API 请求次数不限`,ui:{root:`items-center`},"onUpdate:modelValue":n[1]||=e=>r(`update:modelValue`,e?BY:i.value)},null,8,[`model-value`,`disabled`])]),q(`small`,zY,[n[4]||=Y(`每读、改一次文件或读一次房间都算一次。快到上限时会提醒它先提交已完成的部分;不限时只能靠“停止”打断,期间持续产生 API 费用。`,-1),H(t.$slots,`default`,{},void 0,!0)])])}}},[[`__scopeId`,`data-v-48ea4780`]]),UY={class:`chain-rounds`},WY={class:`chain-rounds-sentence`},GY={key:0},KY={class:`chain-rounds-help`},Oee=100,qY=0,JY=10,YY=EH({__name:`ChainRoundsField`,props:{modelValue:{type:Number,required:!0},disabled:Boolean},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=I(JY);return z(()=>n.modelValue,e=>{e!==qY&&(i.value=e)},{immediate:!0}),(t,n)=>{let a=TH;return W(),G(`span`,UY,[q(`span`,WY,[e.modelValue===qY?(W(),G(`span`,GY,`主持人收到你的一条消息后,可一直连续派活,不限轮数`)):(W(),G(U,{key:1},[n[2]||=q(`span`,null,`主持人收到你的一条消息后,最多连续派活`,-1),J(FY,{"model-value":e.modelValue,max:Oee,label:`主持人连续派活轮数`,disabled:e.disabled,"onUpdate:modelValue":n[0]||=e=>r(`update:modelValue`,e)},null,8,[`model-value`,`disabled`]),n[3]||=q(`span`,null,`轮,然后停下等你`,-1)],64)),J(a,{"model-value":e.modelValue===qY,disabled:e.disabled,label:`不限`,"aria-label":`主持人连续派活轮数不限`,ui:{root:`items-center`},"onUpdate:modelValue":n[1]||=e=>r(`update:modelValue`,e?qY:i.value)},null,8,[`model-value`,`disabled`])]),q(`small`,KY,[n[4]||=Y(`一轮 = 派活 → 成员回答 → 交回主持人汇总;依次接力走完一圈算一轮。到上限后可一键继续,主持人也可提前申请轮数等你批准;不限时只能靠“全部停止”打断。`,-1),H(t.$slots,`default`,{},void 0,!0)])])}}},[[`__scopeId`,`data-v-5044340b`]]),XY={class:`effort-field`},ZY={key:0,class:`effort-caption`,"aria-hidden":`true`},QY=[`aria-label`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`],$Y=[`title`],eX=4.5,tX=6,nX=8,rX=1/240,iX=.001,aX=.01,oX=.05,sX=10,cX=4,lX=EH({__name:`EffortSlider`,props:{items:{type:Array,required:!0},modelValue:{type:String,default:``},label:{type:String,required:!0},caption:{type:String,default:``}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=I(null),a=Q(()=>n.items.length-1),o=Q(()=>Math.max(0,n.items.findIndex(e=>e.value===n.modelValue))),s=nn({x:o.value,v:0,target:o.value,hand:null,pointer:null}),c=Q(()=>Math.min(a.value,Math.max(0,s.x))/a.value),l=Q(()=>Math.round(Math.min(a.value,Math.max(0,s.x)))),u=0,d=0,f=0,p=0,m=!1,h=e=>Math.min(a.value,Math.max(0,e)),g=(e,t,n)=>-((2*Math.PI*n)**2)*e-4*Math.PI*n*t;function _(e){let t=s.hand??s.target,n=s.hand===null?eX:tX,r=(e,r)=>g(e-t,r,n)+(e<0||e>a.value?g(e-h(e),r,nX):0),i=s.x,o=s.v,c=r(i,o),l=o+c*e/2,u=r(i+o*e/2,l),d=o+u*e/2,f=r(i+l*e/2,d),p=o+f*e,m=r(i+d*e,p);s.x+=e*(o+2*l+2*d+p)/6,s.v+=e*(c+2*u+2*f+m)/6}function v(e){u=0;let t=Math.min(oX,(e-d)/1e3);for(d=e;t>0;){let e=Math.min(rX,t);_(e),t-=e}let n=s.hand??s.target;Math.abs(s.x-n)<iX&&Math.abs(s.v)<aX?(s.x=n,s.v=0):u=requestAnimationFrame(v)}function y(){u||=(d=performance.now(),requestAnimationFrame(v))}function b(e){s.target=h(Math.round(e)),r(`update:modelValue`,n.items[s.target].value),y()}function x(e){let t=i.value.getBoundingClientRect();return h((e.clientX-t.left-sX)/Math.max(1,t.width-20)*a.value)}function S(e){e.isPrimary&&e.button===0&&s.pointer===null&&(e.preventDefault(),i.value.focus(),i.value.setPointerCapture(e.pointerId),s.pointer=e.pointerId,f=e.clientX,m=!1,p=e.target.closest(`.effort-slider-thumb`)?s.x-x(e):0,s.hand=h(x(e)+p),y())}function C(e){s.pointer===e.pointerId&&(m||=Math.abs(e.clientX-f)>cX,s.hand=h(x(e)+p),y())}function w(e){if(s.pointer!==e.pointerId)return;let t=m?s.x+s.v/(4*Math.PI*eX):s.hand;s.hand=null,s.pointer=null,b(t)}function T(e){s.pointer===e.pointerId&&(s.hand=null,s.pointer=null,s.target=o.value,y())}function E(e){let t={ArrowRight:o.value+1,ArrowUp:o.value+1,ArrowLeft:o.value-1,ArrowDown:o.value-1,Home:0,End:a.value};e.key in t&&(e.preventDefault(),b(t[e.key]))}return z([o,a],()=>{s.target=o.value,y()}),ca(()=>cancelAnimationFrame(u)),(t,n)=>(W(),G(`div`,XY,[e.caption?(W(),G(`div`,ZY,[q(`span`,null,F(e.caption),1),J(Ac,{name:`effort-value`,mode:`out-in`},{default:R(()=>[(W(),G(`strong`,{key:l.value},F(e.items[l.value].label),1))]),_:1})])):X(``,!0),q(`div`,{ref_key:`track`,ref:i,class:N([`effort-slider`,{"is-dragging":s.pointer!==null}]),style:ye({"--progress":c.value}),role:`slider`,tabindex:`0`,"aria-label":e.label,"aria-valuemin":`0`,"aria-valuemax":a.value,"aria-valuenow":o.value,"aria-valuetext":e.items[o.value].label,onKeydown:E,onPointerdown:S,onPointermove:C,onPointerup:w,onPointercancel:T,onLostpointercapture:T},[n[0]||=q(`span`,{class:`effort-slider-track`,"aria-hidden":`true`},[q(`span`,{class:`effort-slider-fill`})],-1),(W(!0),G(U,null,V(e.items,(e,t)=>(W(),G(`span`,{key:e.value,class:N([`effort-slider-stop`,{"is-active":t<l.value,"is-current":t===l.value}]),"aria-hidden":`true`,style:ye({"--at":t/a.value}),title:e.label},null,14,$Y))),128)),n[1]||=q(`span`,{class:`effort-slider-thumb`,"aria-hidden":`true`},null,-1)],46,QY)]))}},[[`__scopeId`,`data-v-2135d88d`]]);function uX(e,t){if(typeof e!=`object`||!e)return!1;let n=Ym(e,t);return n!=null&&n!==``}function dX(e,t){let n=t?{xs:44,sm:48,md:52,lg:56,xl:60}:{xs:24,sm:28,md:32,lg:36,xl:40};return n[e]??n.md}function fX(e,t,n,r){let i=dX(t,!0),a=dX(t,!1);return r?()=>i:n?t=>uX(e[t],n)?i:a:()=>a}var pX={slots:{root:`relative inline-flex items-center`,base:[`rounded-md`,`transition-colors`],leading:`absolute inset-y-0 start-0 flex items-center`,leadingIcon:`shrink-0 text-dimmed`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,trailing:`group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none`,trailingIcon:`shrink-0 text-dimmed`,trailingClear:`p-0`,arrow:`fill-bg stroke-default`,content:`max-h-[min(15rem,var(--reka-combobox-content-available-height,15rem))] w-(--reka-combobox-trigger-width) bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] origin-(--reka-combobox-content-transform-origin) pointer-events-auto flex flex-col`,viewport:`relative scroll-py-1 overflow-y-auto flex-1`,group:`p-1 isolate`,empty:`text-center text-muted`,label:`font-semibold text-highlighted`,separator:`-mx-1 my-1 h-px bg-border`,item:[`group relative w-full flex items-start gap-1.5 p-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50`,`transition-colors before:transition-colors`],itemLeadingIcon:[`shrink-0 text-dimmed group-data-highlighted:not-group-data-disabled:text-default`,`transition-colors`],itemLeadingAvatar:`shrink-0`,itemLeadingAvatarSize:``,itemLeadingChip:`shrink-0`,itemLeadingChipSize:``,itemTrailing:`ms-auto inline-flex gap-1.5 items-center`,itemTrailingIcon:`shrink-0`,itemWrapper:`flex-1 flex flex-col min-w-0`,itemLabel:`truncate`,itemDescription:`truncate text-muted`,tagsItem:`px-1.5 py-0.5 rounded-sm font-medium inline-flex items-center gap-0.5 ring ring-inset ring-accented bg-elevated text-default data-disabled:cursor-not-allowed data-disabled:opacity-75`,tagsItemText:`truncate`,tagsItemDelete:[`inline-flex items-center rounded-xs text-dimmed hover:text-default hover:bg-accented/75 disabled:pointer-events-none`,`transition-colors`],tagsItemDeleteIcon:`shrink-0`,tagsInput:`flex-1 border-0 bg-transparent placeholder:text-dimmed focus:outline-none disabled:cursor-not-allowed disabled:opacity-75`},variants:{fieldGroup:{horizontal:{root:`group has-focus-visible:z-[1]`},vertical:{root:`group has-focus-visible:z-[1]`}},size:{xs:{base:`px-2 py-1 text-sm/4 gap-1`,leading:`ps-2`,trailing:`pe-2`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`,label:`p-1 text-[10px]/3 gap-1`,item:`p-1 text-xs gap-1`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailingIcon:`size-4`,tagsItem:`text-[10px]/3`,tagsItemDeleteIcon:`size-3`,empty:`p-2 text-xs`},sm:{base:`px-2.5 py-1.5 text-sm/4 gap-1.5`,leading:`ps-2.5`,trailing:`pe-2.5`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`,label:`p-1.5 text-[10px]/3 gap-1.5`,item:`p-1.5 text-xs gap-1.5`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailingIcon:`size-4`,tagsItem:`text-[10px]/3`,tagsItemDeleteIcon:`size-3`,empty:`p-2.5 text-xs`},md:{base:`px-2.5 py-1.5 text-base/5 gap-1.5`,leading:`ps-2.5`,trailing:`pe-2.5`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`,label:`p-1.5 text-xs gap-1.5`,item:`p-1.5 text-sm gap-1.5`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailingIcon:`size-5`,tagsItem:`text-xs`,tagsItemDeleteIcon:`size-3.5`,empty:`p-2.5 text-sm`},lg:{base:`px-3 py-2 text-base/5 gap-2`,leading:`ps-3`,trailing:`pe-3`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`,label:`p-2 text-xs gap-2`,item:`p-2 text-sm gap-2`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailingIcon:`size-5`,tagsItem:`text-xs`,tagsItemDeleteIcon:`size-3.5`,empty:`p-3 text-sm`},xl:{base:`px-3 py-2 text-base gap-2`,leading:`ps-3`,trailing:`pe-3`,leadingIcon:`size-6`,leadingAvatarSize:`xs`,trailingIcon:`size-6`,label:`p-2 text-sm gap-2`,item:`p-2 text-base gap-2`,itemLeadingIcon:`size-6`,itemLeadingAvatarSize:`xs`,itemLeadingChip:`size-6`,itemLeadingChipSize:`lg`,itemTrailingIcon:`size-6`,tagsItem:`text-sm`,tagsItemDeleteIcon:`size-4`,empty:`p-3 text-base`}},variant:{outline:`text-highlighted bg-default ring ring-inset ring-accented`,soft:`text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50`,subtle:`text-highlighted bg-elevated ring ring-inset ring-accented`,ghost:`text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent`,none:`text-highlighted bg-transparent focus:outline-none`},color:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},leading:{true:``},trailing:{true:``},loading:{true:``},highlight:{true:``},fixed:{false:``},type:{file:`file:me-1.5 file:font-medium file:text-muted file:outline-none`},virtualize:{true:{viewport:`p-1 isolate`},false:{viewport:`divide-y divide-default`}},multiple:{true:{root:`flex-wrap`},false:{base:`w-full border-0 placeholder:text-dimmed disabled:cursor-not-allowed disabled:opacity-75`}}},compoundVariants:[{multiple:!1,fieldGroup:`horizontal`,class:{base:`group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none`}},{multiple:!1,fieldGroup:`vertical`,class:{base:`group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none`}},{multiple:!0,fieldGroup:`horizontal`,class:{base:`not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]`}},{multiple:!0,fieldGroup:`vertical`,class:{base:`not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]`}},{variant:`soft`,multiple:!0,class:`has-focus:bg-elevated has-focus-visible:outline-3`},{variant:`ghost`,multiple:!0,class:`has-focus:bg-elevated has-focus-visible:outline-3`},{color:`primary`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-primary`},{color:`secondary`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-secondary`},{color:`success`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-success`},{color:`info`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-info`},{color:`warning`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-warning`},{color:`error`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-error`},{color:`neutral`,multiple:!0,variant:[`outline`,`subtle`],class:`has-focus-visible:outline-3 has-focus-visible:ring-inverted`},{color:`primary`,variant:[`outline`,`subtle`],class:`outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary`},{color:`secondary`,variant:[`outline`,`subtle`],class:`outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary`},{color:`success`,variant:[`outline`,`subtle`],class:`outline-success/25 focus-visible:outline-3 focus-visible:ring-success`},{color:`info`,variant:[`outline`,`subtle`],class:`outline-info/25 focus-visible:outline-3 focus-visible:ring-info`},{color:`warning`,variant:[`outline`,`subtle`],class:`outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning`},{color:`error`,variant:[`outline`,`subtle`],class:`outline-error/25 focus-visible:outline-3 focus-visible:ring-error`},{color:`primary`,variant:[`soft`,`ghost`],class:`outline-primary/25 focus-visible:outline-3`},{color:`secondary`,variant:[`soft`,`ghost`],class:`outline-secondary/25 focus-visible:outline-3`},{color:`success`,variant:[`soft`,`ghost`],class:`outline-success/25 focus-visible:outline-3`},{color:`info`,variant:[`soft`,`ghost`],class:`outline-info/25 focus-visible:outline-3`},{color:`warning`,variant:[`soft`,`ghost`],class:`outline-warning/25 focus-visible:outline-3`},{color:`error`,variant:[`soft`,`ghost`],class:`outline-error/25 focus-visible:outline-3`},{color:`primary`,highlight:!0,class:`ring ring-inset ring-primary`},{color:`secondary`,highlight:!0,class:`ring ring-inset ring-secondary`},{color:`success`,highlight:!0,class:`ring ring-inset ring-success`},{color:`info`,highlight:!0,class:`ring ring-inset ring-info`},{color:`warning`,highlight:!0,class:`ring ring-inset ring-warning`},{color:`error`,highlight:!0,class:`ring ring-inset ring-error`},{color:`neutral`,variant:[`outline`,`subtle`],class:`outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted`},{color:`neutral`,variant:[`soft`,`ghost`],class:`outline-inverted/25 focus-visible:outline-3`},{color:`neutral`,highlight:!0,class:`ring ring-inset ring-inverted`},{leading:!0,size:`xs`,class:`ps-7`},{leading:!0,size:`sm`,class:`ps-8`},{leading:!0,size:`md`,class:`ps-9`},{leading:!0,size:`lg`,class:`ps-10`},{leading:!0,size:`xl`,class:`ps-11`},{trailing:!0,size:`xs`,class:`pe-7`},{trailing:!0,size:`sm`,class:`pe-8`},{trailing:!0,size:`md`,class:`pe-9`},{trailing:!0,size:`lg`,class:`pe-10`},{trailing:!0,size:`xl`,class:`pe-11`},{loading:!0,leading:!0,class:{leadingIcon:`animate-spin`}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:`animate-spin`}},{fixed:!1,size:`xs`,class:`md:text-xs`},{fixed:!1,size:`sm`,class:`md:text-xs`},{fixed:!1,size:`md`,class:`md:text-sm`},{fixed:!1,size:`lg`,class:`md:text-sm`}],defaultVariants:{size:`md`,color:`primary`,variant:`outline`}},mX=Object.assign({inheritAttrs:!1},{__name:`InputMenu`,props:Ha({as:{type:null,required:!1},id:{type:String,required:!1},type:{type:null,required:!1,default:`text`},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},deleteIcon:{type:null,required:!1},clear:{type:[Boolean,Object],required:!1},clearIcon:{type:null,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},virtualize:{type:[Boolean,Object],required:!1,default:!1},valueKey:{type:null,required:!1},labelKey:{type:null,required:!1,default:`label`},descriptionKey:{type:null,required:!1,default:`description`},items:{type:null,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},multiple:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},mode:{type:String,required:!1,default:`combobox`},createItem:{type:[Boolean,String,Object],required:!1},filterFields:{type:Array,required:!1},ignoreFilter:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},resetSearchTermOnBlur:{type:Boolean,required:!1,default:!0},resetSearchTermOnSelect:{type:Boolean,required:!1,default:!0},resetModelValueOnClear:{type:Boolean,required:!1,default:!0},highlightOnHover:{type:Boolean,required:!1},openOnClick:{type:Boolean,required:!1},openOnFocus:{type:Boolean,required:!1},by:{type:[String,Function],required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},{searchTerm:{type:String,default:``},searchTermModifiers:{}}),emits:Ha([`change`,`blur`,`focus`,`create`,`clear`,`highlight`,`remove-tag`,`update:modelValue`,`update:open`],[`update:searchTerm`]),setup(e,{expose:t,emit:n}){let r=e,i=n,a=La(),o=AE(`inputMenu`,r),s=uo(e,`searchTerm`,{type:String,default:``}),{t:c}=ch(),l=Am(),{filterGroups:u}=WB(),d=Q(()=>o.mode===`autocomplete`),f=Q(()=>!!o.multiple&&!d.value),p=pm(o,`as`,`modelValue`,`defaultValue`,`open`,`defaultOpen`,`required`,`multiple`,`resetSearchTermOnBlur`,`resetSearchTermOnSelect`,`resetModelValueOnClear`,`highlightOnHover`,`openOnClick`,`openOnFocus`,`by`),m=fm(p,`multiple`,`resetSearchTermOnSelect`,`resetModelValueOnClear`,`by`),h=jE(Q(()=>d.value?m:p),i),g=Q(()=>d.value?SV:CV),_=Ra(),v=Q(()=>f.value?_[`data-slot`]??`base`:`base`),y=CE(kn(()=>o.portal)),b=kn(()=>Im(o.content,{side:`bottom`,sideOffset:8,collisionPadding:8,position:`popper`})),x=kn(()=>Im(o.arrow,{rounded:!0})),S=Q(()=>typeof o.clear==`object`?o.clear:{}),C=kn(()=>o.virtualize?Im(typeof o.virtualize==`boolean`?{}:o.virtualize,{estimateSize:fX(xe.value,ue.value??`md`,o.descriptionKey,!!a[`item-description`])}):!1),{emitFormBlur:w,emitFormFocus:T,emitFormChange:E,emitFormInput:D,size:O,color:k,id:A,name:ee,highlight:j,disabled:te,ariaAttrs:ne}=pA(r),{orientation:M,size:re}=iA(r),{isLeading:ie,isTrailing:ae,leadingIconName:oe,trailingIconName:se}=nA(Q(()=>({icon:o.icon,leading:o.leading,leadingIcon:o.leadingIcon,trailing:o.trailing,trailingIcon:o.trailingIcon??l.ui.icons.chevronDown,loading:o.loading,loadingIcon:o.loadingIcon}))),ce=Q(()=>k.value??o.color),le=Q(()=>j.value??o.highlight),ue=Q(()=>re.value??O.value??o.size),de=Q(()=>te.value??o.disabled),[fe,pe]=wm(),[me,he]=wm({props:{item:{type:[Object,String,Number,Boolean],required:!0},index:{type:Number,required:!1}}}),ge=Q(()=>Jk({extend:pX,...l.ui?.inputMenu||{}})({color:ce.value,variant:o.variant,size:ue.value,loading:o.loading,highlight:le.value,fixed:o.fixed,leading:ie.value||!!o.avatar||!!a.leading,trailing:ae.value||!!a.trailing,multiple:f.value,fieldGroup:M.value,virtualize:!!o.virtualize})),_e=Q(()=>ye.value.flatMap(e=>e));function ve(e){return $m(_e.value,e,{labelKey:o.labelKey,valueKey:o.valueKey,by:o.by})??``}let ye=Q(()=>o.items?.length?eh(o.items)?o.items:[o.items]:[]),be=Q(()=>{if(o.ignoreFilter||!s.value)return ye.value;let e=Array.isArray(o.filterFields)?o.filterFields:[o.labelKey];return u(ye.value,s.value,{fields:e,isStructural:e=>Le(e)&&!!e.type&&[`label`,`separator`].includes(e.type)})}),xe=Q(()=>be.value.flatMap(e=>e)),Se=Q(()=>{if(!o.createItem||!s.value)return!1;let e=o.valueKey?{[o.valueKey]:s.value}:s.value;return typeof o.createItem==`object`&&o.createItem.when===`always`||o.createItem===`always`?!xe.value.find(t=>Zm(t,e,o.by??o.valueKey)):!xe.value.length}),Ce=Q(()=>typeof o.createItem==`object`?o.createItem.position:`bottom`),we=hi(`inputRef`);function Te(){o.autofocus&&we.value?.$el?.focus()}let Ee;aa(()=>{ar(()=>{d.value?s.value=String(o.modelValue??o.defaultValue??``):s.value=``}),Ee=setTimeout(()=>{Te()},o.autofocusDelay)}),Be(()=>clearTimeout(Ee)),z(()=>o.modelValue,e=>{d.value&&(s.value=String(e??``))});function De(e){if(fn(o.modelValue)===e)return;o.modelModifiers?.trim&&(typeof e==`string`||e==null)&&(e=e?.trim()??null),o.modelModifiers?.number&&(e=Xm(e)),o.modelModifiers?.nullable&&(e??=null),o.modelModifiers?.optional&&!o.modelModifiers?.nullable&&e!==null&&(e??=void 0);let t=new Event(`change`,{target:{value:e}});i(`change`,t),E(),D(),d.value?s.value=String(e??``):o.resetSearchTermOnSelect&&(s.value=``)}function Oe(e){d.value||(s.value=e)}function ke(e){i(`blur`,e),w()}function Ae(e){i(`focus`,e),T()}let je=I(!1),Me;Be(()=>clearTimeout(Me));function Ne(e){if(je.value=e,e){let e=new FocusEvent(`focus`);i(`focus`,e),T(),clearTimeout(Me)}else{let e=new FocusEvent(`blur`);i(`blur`,e),w(),!d.value&&o.resetSearchTermOnBlur&&(Me=setTimeout(()=>{s.value=``},100))}}function Pe(e,t){if(o.multiple){let n=t.filter(t=>!Um(t,e));i(`update:modelValue`,n),i(`remove-tag`,e),De(n)}}function Fe(e){e.preventDefault(),e.stopPropagation(),i(`create`,s.value)}function Ie(e,t){Le(t)&&(t.disabled?e.preventDefault():t.onSelect?.(e))}function Le(e){return typeof e==`object`&&!!e}function Re(e){return o.multiple&&Array.isArray(e)?e.length===0:e==null||e===``}function ze(){de.value||i(`clear`)}function Ve(e){!e.isComposing&&s.value&&e.preventDefault()}let He=hi(`viewportRef`),Ue=hi(`comboboxRootRef`);return z(()=>o.items,async()=>{je.value&&o.createItem&&(await ar(),Ue.value?.highlightFirstItem?.())},{flush:`post`}),t({inputRef:kn(()=>we.value?.$el),viewportRef:kn(()=>He.value)}),(e,t)=>(W(),G(U,null,[J(L(fe),null,{default:R(()=>[J(L(g).Item,{"data-slot":`item`,class:N(ge.value.item({class:L(o).ui?.item})),value:s.value,onSelect:Fe},{default:R(()=>[q(`span`,{"data-slot":`itemLabel`,class:N(ge.value.itemLabel({class:L(o).ui?.itemLabel}))},[H(e.$slots,`create-item-label`,{item:s.value},()=>[Y(F(L(c)(`inputMenu.create`,{label:s.value})),1)])],2)]),_:3},8,[`class`,`value`])]),_:3}),J(L(me),null,{default:R(({item:t,index:n})=>[Le(t)&&t.type===`label`?(W(),K(L(g).Label,{key:0,"data-slot":`label`,class:N(ge.value.label({class:[L(o).ui?.label,t.ui?.label,t.class]}))},{default:R(()=>[Y(F(L(Ym)(t,L(o).labelKey)),1)]),_:2},1032,[`class`])):Le(t)&&t.type===`separator`?(W(),K(L(g).Separator,{key:1,"data-slot":`separator`,class:N(ge.value.separator({class:[L(o).ui?.separator,t.ui?.separator,t.class]}))},null,8,[`class`])):(W(),K(L(g).Item,{key:2,"data-slot":`item`,class:N(ge.value.item({class:[L(o).ui?.item,Le(t)&&t.ui?.item,Le(t)&&t.class]})),disabled:Le(t)&&t.disabled,value:L(o).valueKey&&Le(t)?L(Ym)(t,L(o).valueKey):t,onSelect:e=>Ie(e,t)},{default:R(()=>[H(e.$slots,`item`,{item:t,index:n,ui:ge.value},()=>[H(e.$slots,`item-leading`,{item:t,index:n,ui:ge.value},()=>[Le(t)&&t.icon?(W(),K(Yk,{key:0,name:t.icon,"data-slot":`itemLeadingIcon`,class:N(ge.value.itemLeadingIcon({class:[L(o).ui?.itemLeadingIcon,t.ui?.itemLeadingIcon]}))},null,8,[`name`,`class`])):Le(t)&&t.avatar?(W(),K(tA,Z({key:1,size:t.ui?.itemLeadingAvatarSize||L(o).ui?.itemLeadingAvatarSize||ge.value.itemLeadingAvatarSize()},t.avatar,{"data-slot":`itemLeadingAvatar`,class:ge.value.itemLeadingAvatar({class:[L(o).ui?.itemLeadingAvatar,t.ui?.itemLeadingAvatar]})}),null,16,[`size`,`class`])):Le(t)&&t.chip?(W(),K($k,Z({key:2,size:t.ui?.itemLeadingChipSize||L(o).ui?.itemLeadingChipSize||ge.value.itemLeadingChipSize(),inset:``,standalone:``},t.chip,{"data-slot":`itemLeadingChip`,class:ge.value.itemLeadingChip({class:[L(o).ui?.itemLeadingChip,t.ui?.itemLeadingChip]})}),null,16,[`size`,`class`])):X(``,!0)]),q(`span`,{"data-slot":`itemWrapper`,class:N(ge.value.itemWrapper({class:[L(o).ui?.itemWrapper,Le(t)&&t.ui?.itemWrapper]}))},[q(`span`,{"data-slot":`itemLabel`,class:N(ge.value.itemLabel({class:[L(o).ui?.itemLabel,Le(t)&&t.ui?.itemLabel]}))},[H(e.$slots,`item-label`,{item:t,index:n},()=>[Y(F(Le(t)?L(Ym)(t,L(o).labelKey):t),1)])],2),Le(t)&&(L(Ym)(t,L(o).descriptionKey)||a[`item-description`])?(W(),G(`span`,{key:0,"data-slot":`itemDescription`,class:N(ge.value.itemDescription({class:[L(o).ui?.itemDescription,Le(t)&&t.ui?.itemDescription]}))},[H(e.$slots,`item-description`,{item:t,index:n},()=>[Y(F(L(Ym)(t,L(o).descriptionKey)),1)])],2)):X(``,!0)],2),q(`span`,{"data-slot":`itemTrailing`,class:N(ge.value.itemTrailing({class:[L(o).ui?.itemTrailing,Le(t)&&t.ui?.itemTrailing]}))},[H(e.$slots,`item-trailing`,{item:t,index:n,ui:ge.value}),d.value?X(``,!0):(W(),K(L(g).ItemIndicator,{key:0,"as-child":``},{default:R(()=>[J(Yk,{name:L(o).selectedIcon||L(l).ui.icons.check,"data-slot":`itemTrailingIcon`,class:N(ge.value.itemTrailingIcon({class:[L(o).ui?.itemTrailingIcon,Le(t)&&t.ui?.itemTrailingIcon]}))},null,8,[`name`,`class`])]),_:2},1024))],2)])]),_:2},1032,[`class`,`disabled`,`value`,`onSelect`]))]),_:3}),J(L(g).Root,Z({ref_key:`comboboxRootRef`,ref:Ue},L(h),{name:L(ee),disabled:de.value,"data-slot":e.$attrs[`data-slot`]??`root`,class:ge.value.root({class:[L(o).ui?.root,L(o).class]}),"as-child":f.value,"ignore-filter":``,"onUpdate:modelValue":De,"onUpdate:open":Ne}),{default:R(({modelValue:n,open:r})=>[J(L(g).Anchor,{"as-child":!f.value,"data-slot":v.value,class:N(ge.value.base({class:L(o).ui?.base}))},{default:R(()=>[f.value?(W(),K(L(PT),{key:0,"model-value":n,disabled:de.value,required:L(o).required,delimiter:``,"as-child":``,onBlur:ke,onFocus:Ae,onRemoveTag:e=>Pe(e,n)},{default:R(({modelValue:n})=>[(W(!0),G(U,null,V(n,(t,n)=>(W(),K(L(RT),{key:n,value:t,"data-slot":`tagsItem`,class:N(ge.value.tagsItem({class:[L(o).ui?.tagsItem,Le(t)&&t.ui?.tagsItem]}))},{default:R(()=>[J(L(BT),{"data-slot":`tagsItemText`,class:N(ge.value.tagsItemText({class:[L(o).ui?.tagsItemText,Le(t)&&t.ui?.tagsItemText]}))},{default:R(()=>[H(e.$slots,`tags-item-text`,{item:t,index:n},()=>[Y(F(ve(t)),1)])]),_:2},1032,[`class`]),J(L(zT),{"data-slot":`tagsItemDelete`,class:N(ge.value.tagsItemDelete({class:[L(o).ui?.tagsItemDelete,Le(t)&&t.ui?.tagsItemDelete]})),disabled:de.value},{default:R(()=>[H(e.$slots,`tags-item-delete`,{item:t,index:n,ui:ge.value},()=>[J(Yk,{name:L(o).deleteIcon||L(l).ui.icons.close,"data-slot":`tagsItemDeleteIcon`,class:N(ge.value.tagsItemDeleteIcon({class:[L(o).ui?.tagsItemDeleteIcon,Le(t)&&t.ui?.tagsItemDeleteIcon]}))},null,8,[`name`,`class`])])]),_:2},1032,[`class`,`disabled`])]),_:2},1032,[`value`,`class`]))),128)),J(L(g).Input,{modelValue:s.value,"onUpdate:modelValue":t[1]||=e=>s.value=e,"as-child":``},{default:R(()=>[J(L(FT),Z({id:L(A),ref_key:`inputRef`,ref:we},{...e.$attrs,...L(ne)},{placeholder:L(o).placeholder,"data-slot":`tagsInput`,class:ge.value.tagsInput({class:L(o).ui?.tagsInput}),onChange:t[0]||=_u(()=>{},[`stop`]),onKeydown:yu(Ve,[`enter`])}),null,16,[`id`,`placeholder`,`class`])]),_:1},8,[`modelValue`])]),_:3},8,[`model-value`,`disabled`,`required`,`onRemoveTag`])):(W(),K(L(g).Input,Z({key:1,id:L(A),ref_key:`inputRef`,ref:we},{...d.value?{}:{displayValue:ve},...e.$attrs,...L(ne)},{"data-slot":`base`,type:L(o).type,placeholder:L(o).placeholder,required:L(o).required,onBlur:ke,onFocus:Ae,onChange:t[2]||=_u(()=>{},[`stop`]),"onUpdate:modelValue":Oe}),null,16,[`id`,`type`,`placeholder`,`required`])),L(ie)||L(o).avatar||a.leading?(W(),G(`span`,{key:2,"data-slot":`leading`,class:N(ge.value.leading({class:L(o).ui?.leading}))},[H(e.$slots,`leading`,{modelValue:n,open:r,ui:ge.value},()=>[L(ie)&&L(oe)?(W(),K(Yk,{key:0,name:L(oe),"data-slot":`leadingIcon`,class:N(ge.value.leadingIcon({class:L(o).ui?.leadingIcon}))},null,8,[`name`,`class`])):L(o).avatar?(W(),K(tA,Z({key:1,size:L(o).ui?.itemLeadingAvatarSize||ge.value.itemLeadingAvatarSize()},L(o).avatar,{"data-slot":`itemLeadingAvatar`,class:ge.value.itemLeadingAvatar({class:L(o).ui?.itemLeadingAvatar})}),null,16,[`size`,`class`])):X(``,!0)])],2)):X(``,!0),L(ae)||a.trailing||L(o).clear?(W(),K(L(g).Trigger,{key:3,"data-slot":`trailing`,class:N(ge.value.trailing({class:L(o).ui?.trailing}))},{default:R(()=>[H(e.$slots,`trailing`,{modelValue:n,open:r,ui:ge.value},()=>[L(o).clear&&!de.value&&!Re(n)?(W(),K(L(g).Cancel,{key:0,"as-child":``},{default:R(()=>[J(bA,Z({as:`span`,icon:L(o).clearIcon||L(l).ui.icons.close,size:ue.value,variant:`link`,color:`neutral`,tabindex:`-1`},S.value,{"data-slot":`trailingClear`,class:ge.value.trailingClear({class:L(o).ui?.trailingClear}),onClick:_u(ze,[`stop`])}),null,16,[`icon`,`size`,`class`])]),_:1})):L(se)?(W(),K(Yk,{key:1,name:L(se),"data-slot":`trailingIcon`,class:N(ge.value.trailingIcon({class:L(o).ui?.trailingIcon}))},null,8,[`name`,`class`])):X(``,!0)])]),_:2},1032,[`class`])):X(``,!0)]),_:2},1032,[`as-child`,`data-slot`,`class`]),J(L(g).Portal,P(ks(L(y))),{default:R(()=>[J(L(aA),null,{default:R(()=>[J(L(g).Content,Z({"data-slot":`content`,class:ge.value.content({class:L(o).ui?.content})},b.value,{onFocusOutside:t[3]||=_u(()=>{},[`prevent`])}),{default:R(()=>[H(e.$slots,`content-top`),J(L(g).Empty,{"data-slot":`empty`,class:N(ge.value.empty({class:L(o).ui?.empty}))},{default:R(()=>[H(e.$slots,`empty`,{searchTerm:s.value},()=>[Y(F(s.value?L(c)(`inputMenu.noMatch`,{searchTerm:s.value}):L(c)(`inputMenu.noData`)),1)])]),_:3},8,[`class`]),q(`div`,{ref_key:`viewportRef`,ref:He,role:`presentation`,"data-slot":`viewport`,class:N(ge.value.viewport({class:L(o).ui?.viewport}))},[L(o).virtualize?(W(),G(U,{key:0},[Se.value&&Ce.value===`top`?(W(),K(L(pe),{key:0})):X(``,!0),J(L(g).Virtualizer,Z({options:xe.value,"text-content":e=>Le(e)?L(Ym)(e,L(o).labelKey):String(e)},C.value),{default:R(({option:e,virtualItem:t})=>[J(L(he),{item:e,index:t.index},null,8,[`item`,`index`])]),_:1},16,[`options`,`text-content`]),Se.value&&Ce.value===`bottom`?(W(),K(L(pe),{key:1})):X(``,!0)],64)):(W(),G(U,{key:1},[Se.value&&Ce.value===`top`?(W(),K(L(g).Group,{key:0,"data-slot":`group`,class:N(ge.value.group({class:L(o).ui?.group}))},{default:R(()=>[J(L(pe))]),_:1},8,[`class`])):X(``,!0),(W(!0),G(U,null,V(be.value,(e,t)=>(W(),K(L(g).Group,{key:`group-${t}`,"data-slot":`group`,class:N(ge.value.group({class:L(o).ui?.group}))},{default:R(()=>[(W(!0),G(U,null,V(e,(e,n)=>(W(),K(L(he),{key:`group-${t}-${n}`,item:e,index:n},null,8,[`item`,`index`]))),128))]),_:2},1032,[`class`]))),128)),Se.value&&Ce.value===`bottom`?(W(),K(L(g).Group,{key:1,"data-slot":`group`,class:N(ge.value.group({class:L(o).ui?.group}))},{default:R(()=>[J(L(pe))]),_:1},8,[`class`])):X(``,!0)],64))],2),H(e.$slots,`content-bottom`),L(o).arrow?(W(),K(L(g).Arrow,Z({key:0},x.value,{"data-slot":`arrow`,class:ge.value.arrow({class:L(o).ui?.arrow})}),null,16,[`class`])):X(``,!0)]),_:3},16,[`class`])]),_:3})]),_:3},16)]),_:3},16,[`name`,`disabled`,`data-slot`,`class`,`as-child`])],64))}}),hX={class:`api-settings`},gX={class:`api-field`,title:`Base URL`},_X={class:`api-field`,title:`OpenRouter 等兼容服务可选 Chat Completions,并填写该服务的完整模型 ID。`},vX={class:`api-field`},yX={class:`api-field`},bX={class:`api-inline`},xX={key:0,role:`alert`},SX=`••••••••••••`,CX=EH({__name:`ApiSettings`,props:{name:{type:String,required:!0}},setup(e){let t=e,{view:n,bridge:r}=Or(`discussion`),i=Q(()=>n.value.launch.profiles[t.name]||{}),a=Q(()=>r.launch_model_state(t.name,n.value.launch)),o=I(``),s=I(!1),c=I(!1),l=I(``),u=[{value:`responses`,label:`OpenAI Responses`},{value:`chat`,label:`OpenAI Chat Completions`},{value:`anthropic`,label:`Anthropic Messages`},{value:`gemini`,label:`Gemini generateContent`}];z(()=>i.value.base_url,()=>{o.value=l.value=``});let d=(e,n)=>r.write_launch(t.name,e,n);async function f(){if(o.value.trim()&&o.value!==l.value&&n.value.launch.available&&!c.value){c.value=!0;try{await r.save_launch_api_key(t.name,o.value),l.value=o.value}catch(e){r.notify(`error`,e.message)}finally{c.value=!1}}}return(t,n)=>{let l=hV,p=WV,m=bA,h=mX;return W(),G(`div`,hX,[q(`label`,gX,[n[6]||=q(`span`,null,`地址`,-1),J(l,{"model-value":i.value.base_url||``,"aria-label":`${e.name} Base URL`,placeholder:`Base URL`,class:`w-full`,size:`xs`,"onUpdate:modelValue":n[0]||=e=>d(`base_url`,e)},null,8,[`model-value`,`aria-label`])]),q(`div`,_X,[n[7]||=q(`span`,null,`协议`,-1),J(p,{"model-value":i.value.api_protocol||``,items:u,"aria-label":`${e.name} API 请求协议`,class:`w-full`,size:`xs`,"onUpdate:modelValue":n[1]||=e=>d(`api_protocol`,e)},null,8,[`model-value`,`aria-label`])]),q(`div`,vX,[n[8]||=q(`span`,null,`密钥`,-1),J(l,{modelValue:o.value,"onUpdate:modelValue":n[3]||=e=>o.value=e,type:`text`,autocomplete:`off`,spellcheck:`false`,"data-1p-ignore":``,"data-lpignore":`true`,placeholder:i.value.api_key_ref?SX:`填写 API Key`,title:i.value.api_key_ref&&!o.value?`已保存;本机不回传密钥,输入新 Key 可更换`:void 0,"aria-label":`${e.name} API Key`,size:`xs`,class:`w-full`,loading:c.value,ui:{base:s.value?``:`api-key-masked`,trailing:`pe-0.5`},onChange:f},{trailing:R(()=>[J(m,{icon:s.value?`i-lucide-eye`:`i-lucide-eye-off`,disabled:!o.value,"aria-label":s.value?`隐藏密钥`:`显示密钥`,"aria-pressed":s.value,size:`xs`,color:`neutral`,variant:`link`,onClick:n[2]||=e=>s.value=!s.value},null,8,[`icon`,`disabled`,`aria-label`,`aria-pressed`])]),_:1},8,[`modelValue`,`placeholder`,`title`,`aria-label`,`loading`,`ui`])]),q(`div`,yX,[n[9]||=q(`span`,null,`模型`,-1),q(`div`,bX,[J(h,{mode:`autocomplete`,"ignore-filter":``,"model-value":i.value.model||``,items:a.value.items,"value-key":`value`,"aria-label":`${e.name} API 模型 ID`,placeholder:`推荐模型或完整 ID`,class:`w-full min-w-0`,size:`xs`,"onUpdate:modelValue":n[4]||=e=>d(`model`,e)},null,8,[`model-value`,`items`,`aria-label`]),J(m,{icon:`i-lucide-refresh-cw`,"aria-label":`读取 ${e.name} 的模型列表`,title:`读取模型列表`,size:`xs`,color:`neutral`,variant:`ghost`,loading:a.value.loading,disabled:!i.value.api_key_ref,onClick:n[5]||=t=>L(r).load_launch_models(e.name,!0)},null,8,[`aria-label`,`loading`,`disabled`])])]),a.value.error?(W(),G(`p`,xX,F(a.value.error),1)):X(``,!0)])}}},[[`__scopeId`,`data-v-d6ee9f93`]]),wX={key:0,class:`member-text-fixed`},TX={key:1,class:`member-text-source`},EX={class:`member-text-meta`},DX={class:`member-text-footer`},OX=EH({__name:`MemberTextDialog`,props:Ha({title:{type:String,required:!0},description:{type:String,default:``},label:{type:String,required:!0},placeholder:{type:String,default:``},max:{type:Number,required:!0},rows:{type:Number,default:5},note:{type:String,default:``},source:{type:Object,default:null},fixed:{type:Object,default:null},changed:Boolean,saving:Boolean,readonly:Boolean},{open:{type:Boolean,default:!1},openModifiers:{},draft:{type:String,default:``},draftModifiers:{}}),emits:Ha([`save`],[`update:open`,`update:draft`]),setup(e,{emit:t}){let n=e,r=uo(e,`open`),i=uo(e,`draft`),a=t,o=Q(()=>i.value.length>=n.max*.9);function s(){n.changed&&!n.saving&&!n.readonly&&a(`save`)}return(t,n)=>{let a=Yk,c=cV,l=bA,u=$B;return W(),K(u,{content:{onInteractOutside:e=>e.preventDefault()},open:r.value,"onUpdate:open":n[3]||=e=>r.value=e,title:e.title,description:e.description,ui:{content:`glass-panel studio-modal`,body:`dialog-body`}},{body:R(()=>[q(`form`,{class:`member-text`,onSubmit:_u(s,[`prevent`])},[H(t.$slots,`lead`,{},void 0,!0),e.fixed?(W(),G(`details`,wX,[q(`summary`,null,[J(a,{name:`i-lucide-lock`}),Y(F(e.fixed.summary),1),J(a,{name:`i-lucide-chevron-down`,class:`member-text-fixed-chevron`})]),(W(!0),G(U,null,V(e.fixed.sections,e=>(W(),G(`section`,{key:e.label},[q(`h4`,null,F(e.label),1),q(`p`,null,F(e.text),1)]))),128))])):X(``,!0),e.source&&!e.readonly?(W(),G(`div`,TX,[J(a,{name:`i-lucide-bookmark`}),q(`p`,null,[q(`b`,null,F(e.source.tag),1),Y(F(e.source.text),1)]),q(`button`,{type:`button`,onClick:n[0]||=t=>i.value=e.source.text},F(e.source.action),1)])):X(``,!0),J(c,{modelValue:i.value,"onUpdate:modelValue":n[1]||=e=>i.value=e,rows:e.rows,maxlength:e.max,autoresize:``,maxrows:e.rows*2,autofocus:``,class:`w-full`,"aria-label":e.label,placeholder:e.placeholder,readonly:e.readonly,onKeydown:[yu(_u(s,[`ctrl`,`prevent`]),[`enter`]),yu(_u(s,[`meta`,`prevent`]),[`enter`])]},null,8,[`modelValue`,`rows`,`maxlength`,`maxrows`,`aria-label`,`placeholder`,`readonly`,`onKeydown`]),q(`div`,EX,[q(`span`,null,F(e.note),1),q(`span`,{class:N({"is-near":o.value})},F(i.value.length)+` / `+F(e.max),3)]),q(`div`,DX,[q(`div`,null,[H(t.$slots,`extra`,{},void 0,!0)]),J(l,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:n[2]||=e=>r.value=!1}),e.readonly?X(``,!0):(W(),K(l,{key:0,type:`submit`,label:`保存`,class:`channel-primary-button`,loading:e.saving,disabled:!e.changed},null,8,[`loading`,`disabled`]))])],32)]),_:3},8,[`content`,`open`,`title`,`description`])}}},[[`__scopeId`,`data-v-97866b66`]]),kX={class:`member-label-field`},AX=500,jX=32,MX=EH({__name:`MemberDescriptionDialog`,props:Ha({name:{type:String,required:!0},platform:{type:String,default:``},text:{type:String,default:``},label:{type:String,default:``},default_label:{type:String,default:``},template:{type:String,default:``},saving:Boolean},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:Ha([`save`],[`update:open`]),setup(e,{emit:t}){let n=e,r=uo(e,`open`),i=t,a=I(``),o=I(``),s=I(!1),c=I({name:``,platform:``,text:``,template:``,label:``,default:``});z(r,e=>{e&&(c.value={name:n.name,platform:n.platform,text:n.text.trim(),template:n.template.trim(),label:n.label.trim(),default:n.default_label||n.name},a.value=n.text,o.value=n.label,s.value=!1)},{immediate:!0});let l=Q(()=>a.value.trim()),u=Q(()=>c.value.template&&l.value!==c.value.template?{tag:`${c.value.platform} 的默认描述`,text:c.value.template,action:`填入`}:null),d=Q(()=>!!(c.value.platform&&l.value&&l.value!==c.value.template)),f=Q(()=>o.value.trim()!==c.value.label),p=Q(()=>l.value!==c.value.text||f.value||s.value&&d.value),m=Q(()=>s.value&&d.value?`之后添加 ${c.value.platform} 时自动填入这段描述`:l.value?`标签或一段话都行,Ctrl + Enter 保存`:`留空表示不提供描述`);z(d,e=>{e||(s.value=!1)});function h(){i(`save`,{text:l.value,label:f.value?o.value.trim():void 0,as_template:s.value&&d.value})}return(t,n)=>{let i=hV,l=TH;return W(),K(OX,{open:r.value,"onUpdate:open":n[2]||=e=>r.value=e,draft:a.value,"onUpdate:draft":n[3]||=e=>a.value=e,title:`${c.value.label||c.value.default} 的名称与描述`,description:`名称只改显示的名字,成员 ID 不变。描述写擅长什么、适合分到什么工作,智能调度和 AI 主持人分派时参考,房间所有成员都能看到。`,label:`${c.value.name} 的描述`,placeholder:`例如:擅长前端和交互细节,适合出方案、做评审;大段重构交给别人`,max:AX,note:m.value,source:u.value,changed:p.value,saving:e.saving,onSave:h},{lead:R(()=>[q(`label`,kX,[n[4]||=q(`span`,null,`显示名称`,-1),J(i,{modelValue:o.value,"onUpdate:modelValue":n[0]||=e=>o.value=e,maxlength:jX,placeholder:`留空显示 ${c.value.default}`,"aria-label":`${c.value.name} 的显示名称`,class:`w-full`},null,8,[`modelValue`,`placeholder`,`aria-label`])])]),extra:R(()=>[d.value?(W(),K(l,{key:0,modelValue:s.value,"onUpdate:modelValue":n[1]||=e=>s.value=e,label:`存为 ${c.value.platform} 的默认描述`},null,8,[`modelValue`,`label`])):X(``,!0)]),_:1},8,[`open`,`draft`,`title`,`label`,`note`,`source`,`changed`,`saving`])}}},[[`__scopeId`,`data-v-83eeada0`]]),NX=4e3,PX={},FX=`用户为你单独设置的提示(补充做法与偏好,不改变权限与技能规则):`,IX=[`read`,`write`,`auto`,`full`],LX={read:`只读`,write:`可写`,auto:`自动`,full:`全放开`};function RX(e){return kY(e)?.access_levels||IX}function zX(e){let t=RX(e),n=kY(e);return IX.map(e=>t.includes(e)?{value:e,label:LX[e],hint:n?.access_hints?.[e]||``}:{value:e,label:LX[e],hint:n?.unsupported_hints?.[e]||`该软件不支持此档位`,disabled:!0})}function BX(e){return e===`own`?`自行决定`:LX[e]||`只读`}function VX(e,t=[]){let n=e.project_access;return[`own`,`auto`,`full`].includes(n)||n===`write`&&!!(e.cwd||e.workdir||t.some(e=>e.access===`write`))}function HX(e,t,n=[]){return e.project_access===`own`?`项目文件与命令权限沿用你自己会话的软件设置。`:e.project_access===`auto`?`由软件自动审批:可${t}修改项目文件并运行所需命令;被沙箱或审批拦下时按软件方式申请放行(Codex 申请提权),仍被拒绝就在回答中说明。`:e.project_access===`full`?`已跳过软件审批与沙箱,可${t}修改文件并运行所需命令。`:!e.cwd&&n.length?VX(e,n)?`用户允许${t}修改项目文件并运行所需命令。`:`项目文件只读,不修改。`:e.cwd?e.project_access===`write`?`用户允许${t}修改 cwd 中的项目文件并运行所需命令。`:`cwd 中的项目文件只读,不修改。`:`未指定项目目录。`}function UX(e,t,n=[]){return kY(e.adapter)?.task_rules?.(t,{runs_commands:VX(e,n)})||``}var WX=`读含中文的文件用 rg --encoding utf-8 . 文件路径,不用 Get-Content(Windows PowerShell 会读成乱码)。`;function GX({name:e,discussion:t,discussion_request:n,profile:r,cli:i,messages:a,read_after:o,task_path:s,access_file:c=``,read_rule:l=``,extra_directories:u=[]}){let d=t?`讨论进行中,用户直接向你提问(${a}):只回答这个提问,不改变讨论安排和进度。`:``,f=VX(r,u)?``:`命令只用 subcommands 列出的 ${i} 子命令。`,p=u.length?`extra_directories 是本房间的其他项目目录,access 为 read 的只读、不修改。`:``,m=`${UX(r,i,u)}${d}${HX(r,`按请求`,u)}${p}${f}草稿写在 draft_directory。`;if(n)return{instructions:m,prompt:`你(${e})收到了讨论中的${n.purpose===`discuss_host`?`主持任务`:`发言请求`}。先读任务文件 ${s},按其中列出的技能处理本次请求并保存结果。${l}`};let h=c?` --access-file ${c}`:``,g=`问候、致谢等简单消息可跳过技能:${i} message list --after ${o}${h} 看原文,${i} message post --body "回答"${h} 回复(正文含引号时先写草稿再用 --body-file)。`;return{instructions:m,prompt:`用户在${t?`讨论`:`自由协作`}房间点名了你(${e}),对应消息 ${a}。${g}其他请求先读任务文件 ${s},按其中列出的技能处理并提交一次回答。${l}`}}var KX=[`data-identity`,`data-face`],qX=[`inert`,`aria-hidden`],JX={class:`expert-card-identity`},YX={class:`expert-card-names`},XX={key:0},ZX={key:0,class:`member-id`},QX={key:0,class:`expert-card-badge`},$X={key:1},eZ={key:0,class:`member-id`},tZ={key:0,class:`expert-card-badge`},nZ=[`title`],rZ={class:`expert-card-facts`},iZ=[`title`],aZ={key:0,"aria-hidden":`true`},oZ={key:0,class:`expert-card-manual`},sZ={key:0},cZ={key:1,class:`expert-card-flip`},lZ=[`aria-label`],uZ=[`aria-checked`,`tabindex`,`data-mode`,`onClick`],dZ={class:`expert-card-tools`},fZ=[`aria-label`,`title`],pZ=[`aria-pressed`,`aria-label`,`title`],mZ=[`aria-label`],hZ=[`inert`,`aria-hidden`],gZ={class:`expert-card-back-body`},_Z={class:`expert-card-heading`},vZ={key:0},yZ={class:`expert-card-heading-tools`},bZ=[`aria-label`,`title`],xZ=[`title`,`aria-label`],SZ={key:0,class:`expert-card-field`},CZ={key:1,class:`expert-card-field`},wZ=[`aria-label`],TZ=[`title`,`disabled`,`aria-checked`,`onClick`],EZ={class:`expert-card-field`},DZ={key:0,class:`expert-card-catalog`},OZ={key:1,class:`expert-card-effort`},kZ={key:2,class:`expert-card-note`},AZ=[`aria-label`,`disabled`],jZ={key:4,class:`expert-card-note`},MZ={class:`expert-card-flip-actions`},NZ=[`aria-label`],PZ=[`aria-label`],FZ=[`aria-label`],IZ={class:`expert-card-naming-actions`},LZ=180,RZ=`[role='listbox'], [role='menu'], [data-reka-popper-content-wrapper]`,zZ=EH({__name:`ExpertCard`,props:Ha({name:{type:String,required:!0},mode:{type:String,default:``},choices:{type:Array,default:()=>[]},status:{type:Object,required:!0},host:Boolean,hostable:Boolean,hosting:Boolean,workflow:{type:String,default:``},access_locked:Boolean},{preset:{type:Object,default:null},presetModifiers:{}}),emits:Ha([`remove`,`mode`,`host`],[`update:preset`]),setup(e,{emit:t}){let n=e,r=uo(e,`preset`),i=t,{view:a,bridge:o}=Or(`discussion`),s=UB(0,{mass:1,stiffness:270.0323764138049,damping:31.550710806760762}),c=I(null),l=I(null),u=I(null),d=I(!1),f=I(!1),p=Q(()=>r.value?{...a.value.launch.profiles[o.platform_of(n.name)],model:``,effort:``,system_prompt:``,project_access:`read`,...r.value}:a.value.launch.profiles[n.name]||{}),m=Q(()=>r.value?r.value.label||o.default_name(n.name):o.member_label(n.name)),h=Q(()=>o.launch_clients[n.name]||[]),g=Q(()=>n.choices.filter(e=>e!==`manual`||h.value.some(e=>e.value!==`api`))),_=Q(()=>n.mode===`cli`),v={cli:`程序启动`,manual:`手动启动`},y=Q(()=>!r.value&&_.value&&p.value.adapter===`api`),b=I({state:``});z(()=>[p.value.base_url,p.value.api_protocol,p.value.model,p.value.api_key_ref],()=>{b.value={state:``}});async function x(){b.value={state:`loading`};try{await o.check_launch_api(n.name),b.value={state:`ok`},o.notify(`info`,`检查通过:模型已响应`)}catch(e){b.value={state:`error`},o.notify(`error`,e.message)}}let S=Q(()=>!a.value.launch.available&&a.value.launch.relay?.clients[o.platform_of(n.name)]),C=Q(()=>h.value.find(e=>e.value===(S.value||p.value.adapter))?.label||(a.value.launch.relay&&!a.value.launch.available?`电脑上未配置`:`待选择 App / CLI`)),w=Q(()=>n.mode===`manual`),T={Codex:`已实测:消息实时显示在已开窗口。`,Antigravity:`已实测:App 会话实时显示;agy CLI 窗口需重启才显示后台发言。`,Claude:`已实测:原窗口开着时消息实时送入;关闭后在后台续接同一会话。`},E=Q(()=>T[o.platform_of(n.name)]||``),D=Q(()=>!!p.value.session_id),O=Q(()=>!!r.value||_.value&&h.value.length>0&&!(a.value.launch.relay&&!a.value.launch.available)),k=Q(()=>r.value?`编辑 ${n.name} 的卡片`:`配置 ${n.name} 的启动方式`),A=Q(()=>o.launch_model_state(n.name,a.value.launch,p.value)),ee=Q(()=>r.value&&!kY(p.value.adapter)?.models),j=Q(()=>!!(r.value||_.value&&A.value.supported)),te=Q(()=>j.value&&me.value.length?`补齐上方连接后,可在这里选择模型与思考强度。`:p.value.adapter?`模型与思考强度在 App 原聊天中选择,本页不覆盖 App 设置。`:`先选择软件入口。支持启动参数的 CLI 可在这里设置模型与强度。`),ne={low:`Low`,medium:`Medium`,high:`High`,xhigh:`Extra High`,max:`Max`,ultra:`Ultra`},M=Q(()=>{let e=A.value.efforts||(r.value?kY(p.value.adapter)?.efforts:null);return e?.length?[{label:`默认强度`,value:``},...e.map(e=>({label:ne[e]||e,value:e}))]:null}),re=Q(()=>p.value.adapter===`antigravity_cli`&&p.value.model?``:A.value.defaults?.effort),ie=Q(()=>p.value.effort?ne[p.value.effort]||p.value.effort:re.value?ne[re.value]||re.value:`默认`),ae=Q(()=>!!r.value||_.value&&o.launch_can_set_access(n.name,a.value.launch)),oe=Q(()=>!r.value&&_.value&&p.value.adapter!==`api`),se=Q(()=>p.value.project_access||a.value.launch.workspace?.project_access||`read`),ce=Q(()=>n.mode===`manual`?`你来启动 · 自主发言`:`程序启动 · ${D.value?`续接会话`:p.value.adapter===`api`?`调用 API`:`新会话`}`),le=Q(()=>`不可(须本机唤醒)`),ue=Q(()=>r.value?[...r.value.needs_platform?[{label:`平台`,value:`本机未配置此软件`,tone:`warn`}]:[],{label:`模型`,value:p.value.model||`软件默认模型`},...p.value.effort?[{label:`强度`,value:ie.value}]:[],{label:`项目`,value:BX(se.value),...se.value===`read`?{}:{tone:`warn`}}]:[..._.value?[{label:`状态`,value:n.status.text,tone:n.status.tone}]:[],{label:`启动`,value:ce.value},..._.value?[{label:`软件`,value:C.value}]:[],...j.value?[{label:`模型`,value:p.value.model||A.value.defaults?.model||`软件默认模型`}]:[],...j.value&&p.value.adapter!==`api`?[{label:`强度`,value:ie.value}]:[],...ae.value?[{label:`项目`,value:BX(se.value),...n.workflow&&se.value!==`read`?{tone:`warn`}:{}}]:[],...n.hosting&&!n.host&&!n.hostable?[{label:`主持`,value:le.value}]:[]]),de={executable:{label:`路径`,placeholder:`可执行文件完整路径`},ipc_directory:{label:`IPC`,placeholder:`Sidecar IPC 目录`},source_thread_id:{label:`聊天`,placeholder:`Codex App 来源聊天 ID`}},fe=I([]),pe=()=>{let e=p.value.adapter;return!oe.value||!e?[]:(e===`antigravity`?[`ipc_directory`]:e===`codex`?[`executable`,`source_thread_id`]:[`executable`]).filter(e=>!p.value[e])},me=Q(()=>oe.value?[...new Set([...fe.value,...pe()])].map(e=>({field:e,...de[e]})):[]);function he(){ar(()=>{document.activeElement===c.value&&(f.value?u:l).value?.focus({preventScroll:!0})})}function ge(e){let t=e>=LZ/2;f.value!==t&&(f.value=t,he())}let _e=s.on(`change`,ge),ve=s.on(`animationComplete`,he),be=null;function xe(e){(!e||O.value)&&(c.value?.focus({preventScroll:!0}),fe.value=e?pe():[],e&&!d.value&&(be={profile:JSON.parse(JSON.stringify(r.value||p.value)),mode:n.mode}),d.value=e)}function Se(){be&&=(r.value?r.value=be.profile:o.restore_launch_profile(n.name,be.profile),be.mode!==n.mode&&i(`mode`,be.mode),null),xe(!1)}let Ce=Q(()=>r.value?(r.value.description||``).trim():a.value&&o.description_draft(n.name).trim()),P=I(!1),we=Q(()=>Ce.value?`描述:${Ce.value}`:`添加描述:擅长什么、适合分到什么工作`);function Te({text:e,label:t,as_template:i}){r.value?(r.value.description=e,t!==void 0&&(r.value.label=t)):(o.write_description_draft(n.name,e),t!==void 0&&o.write_label_draft(n.name,t),i&&o.save_description_template(n.name,e)),P.value=!1}let Ee=Q(()=>a.value.launch.presets.some(e=>e.name===n.name)),De=I(!1),Oe=I(``),ke=Q(()=>Oe.value.trim()),Ae=Q(()=>!ke.value||ke.value===`${o.default_name(o.platform_of(n.name))}-`),je=Q(()=>a.value&&!Ae.value?o.preset_identity(n.name,ke.value):``),Me=Q(()=>{if(!je.value)return`预设名称会显示在“预设”行和房间里,可以不带平台前缀。`;let e=o.expert_presets().find(e=>e.name===je.value);return[je.value===ke.value?``:`成员 ID:${je.value}`,e?`将覆盖已有预设「${e.label||e.name}」`:``].filter(Boolean).join(` · `)||`预设名称即成员 ID`});function Ne(){if(Ee.value)return o.save_expert_preset(n.name);let e=new Set(o.expert_presets().map(e=>e.name)),t=o.platform_of(n.name),r=1,i=o.default_name(t);for(;e.has(o.preset_identity(n.name,`${i}-${r}`));)r+=1;Oe.value=`${i}-${r}`,De.value=!0}async function Pe(){Ae.value||(await o.save_expert_preset(n.name,ke.value),De.value=!1)}let Fe=Q(()=>PX[p.value.adapter]||``),Ie=Q(()=>r.value?!!r.value.system_prompt?.trim():Object.hasOwn(p.value,`system_prompt`)),Le=Q(()=>(Ie.value?p.value.system_prompt:Fe.value).trim()),Re=Q(()=>Le.value?`专属提示词(${Ie.value?`自定义`:`软件预设`}):${Le.value.split(`
56
56
  `)[0]}`:`专属提示词:未设置,点击添加`),ze=I(!1),Be=I(``),Ve=Q(()=>Be.value.trim()!==Le.value),He=Q(()=>{let e=Be.value.trim();return r.value?e?`保存到这张工作流卡片,Ctrl + Enter 保存`:`留空使用软件预设`:e?e===Fe.value.trim()?`与软件预设一致,预设更新时自动跟随`:Fe.value?`已改写,不再跟随软件预设`:`只发给这位专家,Ctrl + Enter 保存`:Fe.value?`留空:这位专家不使用预设,也没有专属提示词`:`留空表示不使用`}),Ue=Q(()=>Fe.value&&Be.value.trim()!==Fe.value.trim()?{tag:`软件预设`,text:Fe.value,action:`恢复预设`}:null),We=Q(()=>{if(r.value)return null;let e=p.value.adapter;if(!e||e===`api`)return null;let t=/Windows/.test(navigator.userAgent),i=t&&e!==`claude`?`codiscuss.cmd`:`codiscuss`,o=t?e===`codex_cli`?WX:`(本机装有 rg 时附加)${WX}`:``,{prompt:s,instructions:c}=GX({name:n.name,role:n.host?`host`:`member`,discussion:!1,profile:{...p.value,cwd:a.value.launch.workspace?.cwd||p.value.cwd},cli:i,room:`{房间}`,messages:`#{消息编号}`,read_after:`{已读编号}`,execution_id:`{执行编号}`,task_path:`{任务文件}`,access_file:[`claude`,`codex_cli`,`antigravity_cli`].includes(e)?``:`{凭据文件}`,read_rule:o});return{summary:`程序固定附加的说明(只读)`,sections:[{label:`每次唤醒随消息发送;填了专属提示词时,后面另起一段“${FX}”再接它`,text:s},{label:`任务文件中的说明(由 AI 读取)`,text:c},{label:`说明`,text:`以上是自由协作时的版本;房间开启讨论后改用讨论版说明。{…} 为每次执行时才确定的值。`}]}});function Ge(){Be.value=Le.value,ze.value=!0}function Ke(){let e=Be.value.trim();qe(`system_prompt`,r.value?e:e===Fe.value.trim()?null:e),ze.value=!1}function qe(e,t){r.value?r.value[e]=t:o.write_launch(n.name,e,t)}function Je(e){if(!r.value)return o.write_launch_model(n.name,e);qe(`model`,e===`__default__`?``:e),qe(`effort`,``)}function Ye(e=!1){return o.load_launch_models(n.name,e,p.value)}function Xe(){qe(`model`,``),qe(`effort`,``)}function Ze(e){e===`cli`&&o.default_launch_entry(n.name),e===`manual`&&o.write_description_draft(n.name,``),i(`mode`,e)}function Qe(e){let t={ArrowLeft:-1,ArrowUp:-1,ArrowRight:1,ArrowDown:1};if(!(e.key in t)&&![`Home`,`End`].includes(e.key))return;e.preventDefault();let r=g.value,i=r.indexOf(n.mode),a=e.key===`Home`?r[0]:e.key===`End`?r.at(-1):r[(i+t[e.key]+r.length)%r.length];Ze(a),e.currentTarget.querySelector(`[data-mode="${a}"]`)?.focus()}function $e(e){d.value&&(e.stopPropagation(),e.preventDefault(),Se())}function et(e){ze.value||P.value||De.value||c.value?.contains(e.target)||e.target.closest?.(RZ)||xe(!1)}return z(d,e=>{e?document.addEventListener(`pointerdown`,et,!0):document.removeEventListener(`pointerdown`,et,!0)}),z(d,e=>s.set(e?LZ:0)),z(()=>[j.value,a.value.launch.available,p.value.adapter],([e,t])=>{e&&t&&Ye()},{immediate:!0}),ca(()=>{document.removeEventListener(`pointerdown`,et,!0),_e(),ve(),s.stop()}),(t,n)=>{let d=tA,S=Yk,C=bA,T=WV,D=hV,ne=$B;return W(),G(`div`,{ref_key:`card`,ref:c,class:N([`expert-card`,{"is-configurable":j.value,"is-host":e.host,"is-static":!_.value,"is-manual":w.value}]),"data-identity":L(o).identities[e.name]?.style,"data-face":f.value?`back`:`front`,tabindex:`-1`,onKeydown:yu($e,[`esc`])},[J(L(RB).div,{class:`expert-card-turn`,style:ye({rotateY:L(s)})},{default:R(()=>[q(`div`,{class:`expert-card-face expert-card-front`,inert:f.value,"aria-hidden":f.value},[(W(),K(va(O.value?`button`:`div`),{ref_key:`front_button`,ref:l,type:O.value?`button`:void 0,class:N([`expert-card-open`,{"is-static":!O.value,"has-modes":g.value.length>1}]),"aria-label":O.value?k.value:void 0,title:O.value?`点击翻面设置`:void 0,onClick:n[0]||=e=>xe(!0)},{default:R(()=>[q(`span`,JX,[J(d,{src:L(o).identities[e.name]?.icon,text:L(o).identities[e.name]?.initials,alt:e.name,size:`sm`,class:N([`channel-avatar expert-card-avatar`,L(o).identities[e.name]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`span`,YX,[w.value?(W(),G(`span`,XX,[q(`strong`,null,[Y(F(L(o).display_name(e.name))+`(手动)`,1),L(o).display_name(e.name)===e.name?X(``,!0):(W(),G(`span`,ZX,F(e.name),1))]),e.host&&!e.hostable?(W(),G(`span`,QX,`主持`)):X(``,!0)])):(W(),G(`span`,$X,[q(`strong`,null,[Y(F(m.value),1),m.value===e.name?X(``,!0):(W(),G(`span`,eZ,F(e.name),1))]),e.host&&!e.hostable?(W(),G(`span`,tZ,`主持`)):X(``,!0)])),Ce.value?(W(),G(`small`,{key:2,title:Ce.value},F(Ce.value),9,nZ)):X(``,!0)])]),q(`dl`,rZ,[(W(!0),G(U,null,V(ue.value,e=>(W(),G(`div`,{key:e.label},[q(`dt`,null,F(e.label),1),q(`dd`,{class:N(e.tone?[`expert-card-status`,`is-${e.tone}`]:``),title:e.value},[e.tone?(W(),G(`i`,aZ)):X(``,!0),Y(F(e.value),1)],10,iZ)]))),128))]),w.value?(W(),G(`div`,oZ,[n[15]||=q(`p`,null,`会话自行注册后才算到场。`,-1),E.value?(W(),G(`p`,sZ,F(E.value),1)):X(``,!0)])):X(``,!0),O.value?(W(),G(`span`,cZ,[J(S,{name:`i-lucide-settings-2`}),n[16]||=Y(`设置`,-1)])):X(``,!0)]),_:1},8,[`type`,`class`,`aria-label`,`title`])),g.value.length>1?(W(),G(`div`,{key:0,class:`expert-card-modes expert-card-front-modes`,role:`radiogroup`,"aria-label":`${e.name} 启动方式`,onKeydown:Qe},[(W(!0),G(U,null,V(g.value,t=>(W(),G(`button`,{key:t,type:`button`,role:`radio`,"aria-checked":e.mode===t,tabindex:e.mode===t?0:-1,"data-mode":t,onClick:e=>Ze(t)},F(v[t]),9,uZ))),128))],40,lZ)):X(``,!0),q(`span`,dZ,[!O.value&&!w.value?(W(),G(`button`,{key:0,type:`button`,class:N({"is-set":Ce.value}),"aria-label":`编辑 ${e.name} 的描述`,title:we.value,onClick:n[1]||=e=>P.value=!0},[J(S,{name:`i-lucide-user-pen`})],10,fZ)):X(``,!0),e.hostable?(W(),G(`button`,{key:1,type:`button`,class:`expert-card-host`,"aria-pressed":e.host,"aria-label":e.host?`${e.name} 是主持人`:`设 ${e.name} 为主持人`,title:e.host?`主持人`:`设为主持人`,onClick:n[2]||=e=>i(`host`)},[J(S,{name:`i-lucide-crown`})],8,pZ)):X(``,!0),q(`button`,{type:`button`,"aria-label":`移出 ${e.name}`,title:`移出`,onClick:n[3]||=e=>i(`remove`)},[J(S,{name:`i-lucide-x`})],8,mZ)])],8,qX),O.value?(W(),G(`div`,{key:0,class:`expert-card-face expert-card-back`,inert:!f.value,"aria-hidden":!f.value},[q(`div`,gZ,[q(`div`,_Z,[q(`strong`,null,[Y(F(m.value),1),m.value===e.name?X(``,!0):(W(),G(`span`,vZ,F(e.name),1)),n[17]||=q(`span`,null,`设置`,-1)]),q(`span`,yZ,[q(`button`,{type:`button`,class:N([`expert-card-back-tool`,{"is-set":Ce.value}]),"aria-label":`编辑 ${e.name} 的描述`,title:we.value,onClick:n[4]||=e=>P.value=!0},[J(S,{name:`i-lucide-user-pen`})],10,bZ),r.value||p.value.adapter?(W(),G(`button`,{key:0,type:`button`,class:N([`expert-card-back-tool`,{"is-set":Le.value,"is-own":Ie.value&&Le.value}]),title:Re.value,"aria-label":`编辑 ${e.name} 的专属提示词`,onClick:Ge},[J(S,{name:`i-lucide-scroll-text`})],10,xZ)):X(``,!0),y.value?(W(),K(C,{key:1,icon:`i-lucide-zap`,"aria-label":`检查 ${e.name} 的 API 配置`,title:`检查配置:发送一次极短请求,核对地址、密钥、协议与模型`,size:`xs`,color:b.value.state===`ok`?`success`:b.value.state===`error`?`error`:`neutral`,variant:`ghost`,loading:b.value.state===`loading`,disabled:!p.value.api_key_ref||!p.value.model||!L(a).launch.available,onClick:x},null,8,[`aria-label`,`color`,`loading`,`disabled`])):X(``,!0)])]),!r.value&&_.value&&h.value.length>1?(W(),G(`div`,SZ,[n[18]||=q(`span`,null,`接入`,-1),J(T,{"model-value":p.value.adapter||``,items:h.value,placeholder:`选择 API / App / CLI`,"aria-label":`${e.name} 软件入口`,size:`xs`,class:`w-full`,"onUpdate:modelValue":n[5]||=t=>L(o).write_launch(e.name,`adapter`,t)},null,8,[`model-value`,`items`,`aria-label`])])):X(``,!0),(W(!0),G(U,null,V(me.value,t=>(W(),G(`div`,{key:t.field,class:`expert-card-field`},[q(`span`,null,F(t.label),1),J(D,{"model-value":p.value[t.field]||``,placeholder:t.placeholder,"aria-label":`${e.name} ${t.placeholder}`,size:`xs`,class:`w-full`,"onUpdate:modelValue":n=>L(o).write_launch(e.name,t.field,n)},null,8,[`model-value`,`placeholder`,`aria-label`,`onUpdate:modelValue`])]))),128)),ae.value?(W(),G(`div`,CZ,[n[19]||=q(`span`,null,`项目`,-1),q(`div`,{class:`expert-card-modes`,role:`radiogroup`,"aria-label":`${e.name} 的项目文件权限`},[(W(!0),G(U,null,V(L(zX)(p.value.adapter),t=>(W(),G(`button`,{key:t.value,type:`button`,role:`radio`,title:t.hint,disabled:e.access_locked||t.disabled,"aria-checked":se.value===t.value,onClick:e=>qe(`project_access`,t.value)},F(t.label),9,TZ))),128))],8,wZ)])):X(``,!0),y.value?(W(),K(CX,{key:2,name:e.name},null,8,[`name`])):j.value&&!me.value.length?(W(),G(U,{key:3},[q(`div`,EZ,[n[20]||=q(`span`,null,`模型`,-1),ee.value?(W(),K(D,{key:0,"model-value":p.value.model||``,placeholder:`留空使用默认模型`,"aria-label":`${e.name} 使用的模型`,size:`xs`,class:`w-full`,"onUpdate:modelValue":Je},null,8,[`model-value`,`aria-label`])):(W(),K(T,{key:1,"model-value":p.value.model||`__default__`,items:A.value.items,title:A.value.source,"aria-label":`${e.name} 使用的模型`,size:`xs`,class:`w-full`,"onUpdate:modelValue":Je},null,8,[`model-value`,`items`,`title`,`aria-label`]))]),A.value.loading||A.value.error?(W(),G(`div`,DZ,[q(`span`,null,F(A.value.loading?`正在读取软件模型列表…`:A.value.error),1),!A.value.loading&&A.value.error&&L(a).launch.available?(W(),G(`button`,{key:0,type:`button`,onClick:n[6]||=e=>Ye(!0)},`重试`)):X(``,!0)])):X(``,!0),M.value?(W(),G(`div`,OZ,[J(lX,{caption:`强度`,items:M.value,"model-value":p.value.effort||``,label:`${e.name} 的思考强度`,"onUpdate:modelValue":n[7]||=e=>qe(`effort`,e)},null,8,[`items`,`model-value`,`label`])])):(W(),G(`p`,kZ,F(A.value.effort_note),1)),q(`button`,{type:`button`,class:`expert-card-defaults`,title:`留空使用 CLI 默认值`,"aria-label":`恢复 ${e.name} 的默认模型与强度`,disabled:!p.value.model&&!p.value.effort,onClick:Xe},`恢复默认`,8,AZ)],64)):(W(),G(`p`,jZ,[J(S,{name:`i-lucide-monitor`}),Y(F(te.value),1)]))]),q(`span`,MZ,[L(a).launch.available&&!e.workflow&&!r.value?(W(),G(`button`,{key:0,type:`button`,class:`expert-card-flip is-cancel`,"aria-label":`${Ee.value?`更新`:`存为`}预设「${e.name}」`,title:`存下描述、提示词、项目权限、模型与强度,之后在“预设”行一键加入`,onClick:Ne},F(Ee.value?`更新预设`:`存为预设`),9,NZ)):X(``,!0),q(`button`,{type:`button`,class:`expert-card-flip is-cancel`,"aria-label":`放弃 ${e.name} 的修改`,onClick:Se},`取消`,8,PZ),q(`button`,{ref_key:`back_button`,ref:u,type:`button`,class:`expert-card-flip is-done`,"aria-label":`保存并返回 ${e.name} 角色卡片`,onClick:n[8]||=e=>xe(!1)},[J(S,{name:`i-lucide-check`}),n[21]||=Y(`完成`,-1)],8,FZ)])],8,hZ)):X(``,!0)]),_:1},8,[`style`]),J(MX,{open:P.value,"onUpdate:open":n[9]||=e=>P.value=e,name:e.name,platform:r.value?``:L(o).default_name(L(o).platform_of(e.name)),default_label:L(o).default_name(e.name),text:Ce.value,label:r.value?r.value.label||``:L(o).label_draft(e.name),template:r.value?``:L(o).description_template(e.name),onSave:Te},null,8,[`open`,`name`,`platform`,`default_label`,`text`,`label`,`template`]),J(OX,{open:ze.value,"onUpdate:open":n[10]||=e=>ze.value=e,draft:Be.value,"onUpdate:draft":n[11]||=e=>Be.value=e,title:`${e.name} 的专属提示词`,description:e.workflow?`来自工作流「${e.workflow}」,每次执行时按工作流里的这张卡片发送;请在“工作流”一行点“编辑”修改,修改会作用于所有启用它的房间。`:`只发给这位专家,补充它的做法与偏好;不改变权限和技能规则。`,label:`${e.name} 的专属提示词`,placeholder:`例如:回答先给结论,控制在三段以内。`,max:L(NX),rows:8,readonly:!!e.workflow,note:e.workflow?`只读`:He.value,source:Ue.value,fixed:We.value,changed:Ve.value,onSave:Ke},null,8,[`open`,`draft`,`title`,`description`,`label`,`max`,`readonly`,`note`,`source`,`fixed`,`changed`]),J(ne,{content:{onInteractOutside:e=>e.preventDefault()},open:De.value,"onUpdate:open":n[14]||=e=>De.value=e,title:`存为专家预设`,description:`存下描述、提示词、项目权限、模型与强度,之后在“预设”行一键加入。`,ui:{content:`glass-panel studio-modal`,body:`dialog-body`}},{body:R(()=>[q(`form`,{class:`expert-card-naming`,onSubmit:_u(Pe,[`prevent`])},[J(D,{modelValue:Oe.value,"onUpdate:modelValue":n[12]||=e=>Oe.value=e,maxlength:32,autofocus:``,class:`w-full`,"aria-label":`预设名称`,placeholder:`预设名称,如 评审官`},null,8,[`modelValue`]),q(`p`,null,F(Me.value),1),q(`div`,IZ,[J(C,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:n[13]||=e=>De.value=!1}),J(C,{type:`submit`,label:`保存`,class:`channel-primary-button`,disabled:Ae.value},null,8,[`disabled`])])],32)]),_:1},8,[`content`,`open`])],42,KX)}}},[[`__scopeId`,`data-v-6e5e9b44`]]),BZ={key:0,class:`project-field`},VZ=[`disabled`],HZ={key:0,class:`project-note`},UZ=[`title`,`disabled`],WZ={key:0},GZ=[`disabled`],KZ={key:0},qZ={key:0,class:`project-rows`,"aria-label":`常用项目`},JZ={class:`project-tile`},YZ={class:`project-edit`},XZ={class:`project-text`},ZZ=[`title`],QZ={class:`project-actions`},$Z={key:1,class:`project-add`,role:`group`,"aria-label":`添加项目`},eQ={class:`project-add-actions`},tQ={key:3,role:`alert`,class:`project-error`},nQ={class:`project-footer`},rQ={class:`folder-picker`},iQ={class:`folder-head`},aQ=[`title`],oQ={class:`folder-list`,"aria-label":`文件夹`},sQ=[`disabled`,`onClick`],cQ={key:0,class:`folder-empty`},lQ=[`disabled`],uQ={key:1,class:`project-note`},dQ={key:2,role:`alert`,class:`project-error`},fQ={class:`project-footer`},pQ=EH({__name:`ProjectDirectoryField`,props:{placeholder:{type:String,default:`输入完整路径,或选择项目`},disabled:{type:Boolean,default:!1},modelValue:{type:String,default:void 0},compact:{type:Boolean,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=Q(()=>n.modelValue!==void 0),{view:a,bridge:o}=Or(`discussion`),s=Q(()=>a.value.launch),c=Q(()=>s.value.available?null:s.value.relay),l=Q(()=>c.value?c.value.projects:s.value.projects||[]),u=Q(()=>s.value.available&&!s.value.remote),d=Q(()=>s.value.available),f=Q(()=>(i.value?n.modelValue:s.value.workspace.cwd)||``),p=Q(()=>c.value?l.value.find(e=>e.id===s.value.workspace.local_project):l.value.find(e=>m(e.path,f.value)));function m(e,t){let n=e=>String(e||``).replace(/[\\/]+$/,``).toLowerCase();return!!e&&n(e)===n(t)}let h=e=>i.value?r(`update:modelValue`,e):o.write_launch(`workspace`,`cwd`,e),g=e=>c.value?o.write_launch(`workspace`,`local_project`,e?.id||``):h(e.path),_=I(!1);async function v(){if(u.value){_.value=!0;try{if(!i.value)return await o.pick_launch_directory();let e=await o.browse_local_directory();e&&h(e)}catch(e){o.notify(`error`,e.message)}finally{_.value=!1}}else{let e=await S(f.value);e&&h(e)}}let y=I({open:!1,path:``,parent:null,entries:[],next_offset:null,truncated:!1,loading:!1,error:``}),b=null;async function x(e,t=!1){y.value.loading=!0,y.value.error=``;try{let n=await o.list_remote_directories(e,t?y.value.next_offset:0);y.value={...y.value,...n,entries:t?[...y.value.entries,...n.entries]:n.entries}}catch(n){if(y.value.error=n.message,e&&!t&&!y.value.entries.length)return x(``)}finally{y.value.loading=!1}}function S(e){return y.value={open:!0,path:``,parent:null,entries:[],next_offset:null,truncated:!1,loading:!1,error:``},x(e||``),new Promise(e=>{b=e})}function C(e){y.value.open=!1,b?.(e),b=null}let w=Q(()=>[[{type:`label`,label:c.value?`电脑「${c.value.name}」上的项目`:`常用项目`},...l.value.map(e=>({label:e.name,description:c.value?void 0:e.path,icon:`i-lucide-folder`,...p.value===e?{trailingIcon:`i-lucide-check`}:{},onSelect:()=>g(e)}))],c.value?p.value?[{label:`不指定项目`,icon:`i-lucide-circle-slash`,onSelect:()=>g(null)}]:[]:[{label:`管理项目…`,icon:`i-lucide-settings-2`,onSelect:te}]].filter(e=>e.length)),T=I(!1),E=I([]),D=I(-1),O=I(null),k=I(!1),A=I(``),ee=I(``),j=I(null);function te(){E.value=l.value.map(e=>({...e})),D.value=-1,O.value=E.value.length?null:{name:``,path:``},ee.value=``,T.value=!0}function ne(){D.value=-1,O.value={name:``,path:``},ar(()=>j.value?.inputRef?.focus())}function M(e){return String(e).split(/[\\/]+/).filter(Boolean).at(-1)||``}async function re(e,t){A.value=t,ee.value=``;try{let t=u.value?await o.browse_local_directory():await S(e.path);t&&(e.path=t,e.name.trim()||(e.name=M(t)))}catch(e){ee.value=e.message}finally{A.value=``}}let ie=e=>!!(e?.name.trim()&&e?.path.trim());function ae(){ie(O.value)&&(E.value.push({name:O.value.name.trim(),path:O.value.path.trim()}),O.value=null)}function oe(e){E.value.splice(e,1),D.value===e&&(D.value=-1)}async function se(){ie(O.value)&&ae(),k.value=!0,ee.value=``;try{await o.save_launch_projects(E.value),T.value=!1}catch(e){ee.value=e.message}finally{k.value=!1}}return(e,t)=>{let r=Yk,i=MV,a=hV,o=bA,s=aV,m=$B;return W(),G(U,null,[c.value?(W(),G(`div`,BZ,[J(i,{items:w.value,content:{align:`start`,sideOffset:4},ui:{content:`channel-menu project-menu`},disabled:n.disabled||!l.value.length},{default:R(()=>[q(`button`,{type:`button`,class:N([`project-select`,{"is-empty":!p.value}]),disabled:n.disabled||!l.value.length},[J(r,{name:p.value?`i-lucide-folder`:`i-lucide-folder-search`,class:`project-select-icon`},null,8,[`name`]),q(`span`,null,F(p.value?p.value.name:l.value.length?`选择项目`:`电脑「${c.value.name}」上还没有项目`),1),J(r,{name:`i-lucide-chevron-down`,class:`project-select-chevron`})],10,VZ)]),_:1},8,[`items`,`disabled`]),c.value.online?X(``,!0):(W(),G(`p`,HZ,[J(r,{name:`i-lucide-moon`}),Y(`电脑「`+F(c.value.name)+`」当前离线,创建请求会等它上线后执行。`,1)]))])):(W(),G(`div`,{key:1,class:N([`project-box`,{"is-disabled":n.disabled,"is-chosen":p.value}])},[l.value.length?(W(),K(i,{key:0,items:w.value,content:{align:`start`,sideOffset:6},ui:{content:`channel-menu project-menu`},disabled:n.disabled},{default:R(()=>[q(`button`,{type:`button`,class:N([`project-prefix`,{"is-chosen":p.value}]),title:p.value?p.value.path:`从常用项目中选择`,"aria-label":`选择常用项目`,disabled:n.disabled},[J(r,{name:p.value?`i-lucide-folder`:`i-lucide-folders`},null,8,[`name`]),n.compact?X(``,!0):(W(),G(`span`,WZ,F(p.value?p.value.name:`常用项目`),1)),J(r,{name:`i-lucide-chevron-down`,class:`project-prefix-chevron`})],10,UZ)]),_:1},8,[`items`,`disabled`])):(W(),G(`button`,{key:1,type:`button`,class:`project-prefix`,"aria-label":`添加常用项目`,title:`保存常用项目,之后一键选择;其他设备也能用`,disabled:n.disabled,onClick:te},[J(r,{name:`i-lucide-plus`}),n.compact?X(``,!0):(W(),G(`span`,KZ,`常用项目`))],8,GZ)),J(a,{"model-value":f.value,placeholder:n.placeholder,variant:`none`,class:`project-path`,"aria-label":`项目目录完整路径`,disabled:n.disabled,"onUpdate:modelValue":h},null,8,[`model-value`,`placeholder`,`disabled`]),d.value?(W(),K(o,{key:2,icon:`i-lucide-folder-open`,color:`neutral`,variant:`ghost`,size:`xs`,class:`project-browse`,"aria-label":u.value?`在本机选择项目目录`:`浏览电脑上的文件夹`,title:u.value?_.value?`目录选择窗口已打开,请在本机窗口中选择`:`在本机选择文件夹`:`浏览电脑上常用项目中的文件夹`,loading:_.value,disabled:n.disabled,onClick:v},null,8,[`aria-label`,`title`,`loading`,`disabled`])):X(``,!0)],2)),J(m,{content:{onInteractOutside:e=>e.preventDefault()},open:T.value,"onUpdate:open":t[7]||=e=>T.value=e,title:`常用项目`,description:`保存在运行 codiscuss 的这台电脑上。登录同一网站的手机、平板可直接选择,路径不会离开这台电脑。`,ui:{content:`glass-panel studio-modal project-modal`,body:`dialog-body`}},{body:R(()=>[q(`form`,{class:`project-manager dialog-form`,onSubmit:_u(se,[`prevent`])},[E.value.length?(W(),G(`ul`,qZ,[(W(!0),G(U,null,V(E.value,(e,n)=>(W(),G(`li`,{key:n,class:N([`project-row`,{"is-editing":D.value===n}])},[q(`span`,JZ,[J(r,{name:`i-lucide-folder`})]),D.value===n?(W(),G(U,{key:0},[q(`div`,YZ,[J(a,{modelValue:e.name,"onUpdate:modelValue":t=>e.name=t,placeholder:`项目名称`,"aria-label":`项目名称`,size:`sm`,class:`w-full`},null,8,[`modelValue`,`onUpdate:modelValue`]),J(a,{modelValue:e.path,"onUpdate:modelValue":t=>e.path=t,placeholder:`文件夹完整路径`,"aria-label":`文件夹完整路径`,size:`sm`,class:`w-full`,ui:{trailing:`pe-1`}},Sa({_:2},[d.value?{name:`trailing`,fn:R(()=>[J(o,{icon:`i-lucide-folder-open`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`选择文件夹`,loading:A.value===`row-${n}`,onClick:t=>re(e,`row-${n}`)},null,8,[`loading`,`onClick`])]),key:`0`}:void 0]),1032,[`modelValue`,`onUpdate:modelValue`])]),J(o,{icon:`i-lucide-check`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`完成编辑`,disabled:!ie(e),onClick:t[0]||=e=>D.value=-1},null,8,[`disabled`])],64)):(W(),G(U,{key:1},[q(`div`,XZ,[q(`strong`,null,F(e.name),1),q(`small`,{title:e.path},F(e.path),9,ZZ)]),q(`div`,QZ,[J(o,{icon:`i-lucide-pencil`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`编辑 ${e.name}`,onClick:e=>{O.value=null,D.value=n}},null,8,[`aria-label`,`onClick`]),J(o,{icon:`i-lucide-trash-2`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`移除 ${e.name}`,onClick:e=>oe(n)},null,8,[`aria-label`,`onClick`])])],64))],2))),128))])):X(``,!0),O.value?(W(),G(`div`,$Z,[J(s,{label:`文件夹`,description:u.value?``:d.value?`其他设备只能选择已有常用项目中的文件夹;更大的范围请在电脑上添加`:`运行 codiscuss 的电脑上的完整路径`},{default:R(()=>[J(a,{modelValue:O.value.path,"onUpdate:modelValue":t[2]||=e=>O.value.path=e,placeholder:`例如 D:\\Projects\\demo`,class:`w-full`,ui:{trailing:`pe-1`},onBlur:t[3]||=e=>!O.value.name.trim()&&(O.value.name=M(O.value.path))},Sa({_:2},[d.value?{name:`trailing`,fn:R(()=>[J(o,{icon:`i-lucide-folder-open`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`选择文件夹`,loading:A.value===`add`,onClick:t[1]||=e=>re(O.value,`add`)},null,8,[`loading`])]),key:`0`}:void 0]),1032,[`modelValue`])]),_:1},8,[`description`]),J(s,{label:`名称`},{default:R(()=>[J(a,{ref_key:`add_name`,ref:j,modelValue:O.value.name,"onUpdate:modelValue":t[4]||=e=>O.value.name=e,placeholder:`在列表中显示的名称`,maxlength:80,class:`w-full`,onKeydown:yu(_u(ae,[`prevent`]),[`enter`])},null,8,[`modelValue`,`onKeydown`])]),_:1}),q(`div`,eQ,[E.value.length?(W(),K(o,{key:0,label:`取消`,color:`neutral`,variant:`ghost`,size:`sm`,onClick:t[5]||=e=>O.value=null})):X(``,!0),J(o,{label:`加入列表`,icon:`i-lucide-plus`,color:`neutral`,variant:`soft`,size:`sm`,disabled:!ie(O.value),onClick:ae},null,8,[`disabled`])])])):(W(),G(`button`,{key:2,type:`button`,class:`project-add-trigger`,onClick:ne},[J(r,{name:`i-lucide-plus`}),t[13]||=Y(`添加项目`,-1)])),ee.value?(W(),G(`p`,tQ,[J(r,{name:`i-lucide-circle-alert`}),Y(F(ee.value),1)])):X(``,!0),q(`div`,nQ,[J(o,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:t[6]||=e=>T.value=!1}),J(o,{type:`submit`,label:`保存`,class:`channel-primary-button`,loading:k.value},null,8,[`loading`])])],32)]),_:1},8,[`content`,`open`]),J(m,{open:y.value.open,title:`选择电脑上的文件夹`,description:`只列出常用项目中的文件夹;范围由电脑决定。`,ui:{content:`glass-panel studio-modal project-modal`,body:`dialog-body`},"onUpdate:open":t[12]||=e=>!e&&C(``)},{body:R(()=>[q(`div`,rQ,[q(`div`,iQ,[J(o,{icon:`i-lucide-arrow-left`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`上一级`,disabled:!y.value.path||y.value.loading,onClick:t[8]||=e=>x(y.value.parent||``)},null,8,[`disabled`]),q(`span`,{class:`folder-path`,title:y.value.path},F(y.value.path||`常用项目`),9,aQ)]),q(`ul`,oQ,[(W(!0),G(U,null,V(y.value.entries,e=>(W(),G(`li`,{key:e.path},[q(`button`,{type:`button`,class:`folder-entry`,disabled:y.value.loading,onClick:t=>x(e.path)},[J(r,{name:`i-lucide-folder`}),Y(F(e.name),1)],8,sQ)]))),128)),!y.value.entries.length&&!y.value.loading?(W(),G(`li`,cQ,F(y.value.path?`没有子文件夹`:`电脑上还没有常用项目,请先在电脑上添加`),1)):X(``,!0)]),y.value.next_offset===null?X(``,!0):(W(),G(`button`,{key:0,type:`button`,class:`project-add-trigger`,disabled:y.value.loading,onClick:t[9]||=e=>x(y.value.path,!0)},`加载更多`,8,lQ)),y.value.truncated?(W(),G(`p`,uQ,`文件夹过多,只列出了一部分`)):X(``,!0),y.value.error?(W(),G(`p`,dQ,[J(r,{name:`i-lucide-circle-alert`}),Y(F(y.value.error),1)])):X(``,!0),q(`div`,fQ,[J(o,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:t[10]||=e=>C(``)}),J(o,{label:`选择此文件夹`,class:`channel-primary-button`,disabled:!y.value.path||y.value.loading,onClick:t[11]||=e=>C(y.value.path)},null,8,[`disabled`])])])]),_:1},8,[`open`])],64)}}},[[`__scopeId`,`data-v-0dc23df3`]]),mQ={class:`extra-directories`},hQ=[`disabled`],gQ={key:2,class:`extra-directory-note`},_Q=8,vQ=EH({__name:`ExtraDirectoriesField`,props:{modelValue:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{view:i}=Or(`discussion`),a=Q(()=>i.value.launch.available);function o(e,t){r(`update:modelValue`,n.modelValue.map((n,r)=>r===e?t:n))}let s=e=>r(`update:modelValue`,n.modelValue.filter((t,n)=>n!==e)),c=()=>r(`update:modelValue`,[...n.modelValue,``]);return(e,t)=>{let r=bA,i=Yk;return W(),G(`div`,mQ,[a.value?(W(!0),G(U,{key:0},V(n.modelValue,(e,t)=>(W(),G(`div`,{key:t,class:`extra-directory`},[J(pQ,{"model-value":e,compact:``,placeholder:`另一个项目目录的完整路径`,disabled:n.disabled,"onUpdate:modelValue":e=>o(t,e)},null,8,[`model-value`,`disabled`,`onUpdate:modelValue`]),J(r,{icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`移除项目目录 ${e}`,disabled:n.disabled,onClick:e=>s(t)},null,8,[`aria-label`,`disabled`,`onClick`])]))),128)):X(``,!0),(W(!0),G(U,null,V(a.value?[]:n.modelValue,e=>(W(),G(`code`,{key:e,class:`extra-directory-path`},F(e),1))),128)),a.value&&n.modelValue.length<_Q?(W(),G(`button`,{key:1,type:`button`,class:`extra-directory-add`,disabled:n.disabled,onClick:c},[J(i,{name:`i-lucide-plus`}),t[0]||=Y(`添加其他项目目录 `,-1)],8,hQ)):X(``,!0),a.value?X(``,!0):(W(),G(`p`,gQ,`其他项目目录须在电脑上或已连接电脑的网页中设置。`))])}}},[[`__scopeId`,`data-v-df191134`]]),yQ=[`aria-label`],bQ={class:`roster-add-label`},xQ={class:`roster-add-chips`},SQ=[`disabled`,`title`,`aria-label`,`aria-pressed`,`onClick`],CQ={class:`roster-add-name`},wQ=[`title`,`aria-label`,`onClick`],TQ=[`aria-pressed`],EQ=EH({__name:`RosterAdd`,props:{label:{type:String,required:!0},items:{type:Array,required:!0}},emits:[`add`,`remove`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=I(null),o=I(!1),s=Q(()=>{let e=r.items.findIndex(e=>e.separated);return e<0?[{label:`添加`,items:r.items}]:[{label:`添加`,items:r.items.slice(0,e)},{label:`预设`,items:r.items.slice(e)}].filter(e=>e.items.length)});function c(){a.value?.querySelector(`button:not(:disabled)`)?.focus({preventScroll:!0})}return t({focus_first:c}),(t,n)=>{let r=tA,c=Yk;return W(),G(`div`,{ref_key:`row`,ref:a,class:`roster-add`,role:`group`,"aria-label":e.label},[(W(!0),G(U,null,V(s.value,e=>(W(),G(U,{key:e.label},[q(`span`,bQ,F(e.label),1),q(`div`,xQ,[(W(!0),G(U,null,V(e.items,e=>(W(),G(`span`,{key:e.value,class:N([`roster-add-chip`,{"is-selected":e.selected,"is-disabled":e.disabled,"is-removable":o.value&&e.removable}])},[q(`button`,{type:`button`,class:`roster-add-main`,disabled:e.disabled,title:e.title,"aria-label":e.aria_label,"aria-pressed":e.selected===void 0?void 0:e.selected,onClick:t=>i(`add`,e.value)},[J(r,{src:e.icon,text:e.initials,alt:e.name,size:`3xs`,class:N([`channel-avatar`,e.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`span`,CQ,F(e.name),1),J(c,{name:e.selected?`i-lucide-check`:`i-lucide-plus`,class:`roster-add-mark`},null,8,[`name`])],8,SQ),o.value&&e.removable?(W(),G(`button`,{key:0,type:`button`,class:`roster-add-remove`,title:`删除预设「${e.name}」`,"aria-label":`删除预设 ${e.name}`,onClick:t=>i(`remove`,e.value)},[J(c,{name:`i-lucide-x`})],8,wQ)):X(``,!0)],2))),128)),e.items.some(e=>e.removable)?(W(),G(`button`,{key:0,type:`button`,class:`roster-add-manage`,"aria-pressed":o.value,onClick:n[0]||=e=>o.value=!o.value},F(o.value?`完成`:`管理`),9,TQ)):X(``,!0)])],64))),128))],8,yQ)}}},[[`__scopeId`,`data-v-a9be499f`]]),DQ={class:`scheduler-settings`},OQ={class:`scheduler-title`},kQ={class:`scheduler-description`},AQ={key:0,class:`scheduler-empty`},jQ={key:1,class:`scheduler-cards`},MQ={class:`scheduler-slot`},NQ={class:`scheduler-identity`},PQ={class:`scheduler-facts`},FQ=[`title`],IQ={class:`scheduler-flip`},LQ={class:`scheduler-tools`},RQ=[`aria-label`],zQ={class:`scheduler-back`},BQ={class:`scheduler-heading`},VQ={class:`scheduler-field`},HQ={class:`scheduler-field`},UQ={class:`scheduler-flip-actions`},WQ={key:2,class:`scheduler-mode`},GQ={class:`expert-card-modes`,role:`radiogroup`,"aria-label":`智能调度判断方式`},KQ=[`title`,`aria-checked`,`onClick`],qQ=`••••••••••••`,JQ=EH({__name:`SchedulerSettings`,props:{free:{type:Boolean,default:!1},blocker:{type:String,default:``}},setup(e){let t=e,{view:n,bridge:r}=Or(`discussion`),i=Q(()=>n.value.launch.scheduler||{}),a=Q(()=>Object.entries(n.value.launch.scheduler_providers||{}).map(([e,t])=>({value:e,label:t.label}))),o=Q(()=>(n.value.launch.scheduler_providers?.[i.value.provider]?.models||[]).map(e=>({label:e,value:e}))),s={jev:{icon:`/icons/typesafe.png`},decisions:{icon:`/icons/openai.svg`,style:`codex`}},c=Q(()=>!!i.value.enabled&&!t.blocker),l=I(null),u=Q(()=>a.value.map(({value:e,label:n})=>{let r=c.value&&i.value.provider===e;return{value:e,name:n,initials:n.slice(0,2),...s[e],disabled:!!t.blocker,selected:r,title:r?`当前决策模型`:c.value?`替换为 ${n}`:n,aria_label:c.value&&!r?`替换决策模型为 ${n}`:`添加决策模型 ${n}`}})),d=I(``),f=I(!1),p=I(!1),m=I(!1),h=null;function g(){let{model:e,api_key_ref:t}=i.value;h={model:e,api_key_ref:t},m.value=!0}function _(){if(h)for(let e of[`model`,`api_key_ref`])r.write_scheduler(e,h[e]);h=null,d.value=``,m.value=!1}function v(e){c.value&&i.value.provider===e||(m.value=!1,h=null,r.write_scheduler(`provider`,e),r.write_scheduler(`enabled`,!0))}function y(){r.write_scheduler(`enabled`,!1),ar(()=>l.value?.focus_first())}let b=Q(()=>a.value.find(e=>e.value===i.value.provider)?.label||`未选择`),x=Q(()=>i.value.model?i.value.api_key_ref?{tone:`ready`,text:`已配置`}:{tone:`warn`,text:`缺少密钥`}:{tone:`warn`,text:`未选模型`});z(()=>i.value.provider,()=>{d.value=``});let S=I({state:``});z(()=>[i.value.provider,i.value.model,i.value.api_key_ref],()=>{S.value={state:``}}),z(()=>i.value.enabled,e=>{e||(m.value=!1)});async function C(){S.value={state:`loading`};try{await r.check_scheduler(),S.value={state:`ok`},r.notify(`info`,`检查通过:决策模型已响应`)}catch(e){S.value={state:`error`},r.notify(`error`,e.message)}}let w=Q(()=>Object.entries(n.value.launch.scheduler_modes||{}).map(([e,t])=>({value:e,label:t}))),T=Q(()=>i.value.mode||n.value.launch.scheduler_default_mode||``),E={guided:`试验:说明目的与依据,由模型权衡;正在打磨,可能判错`,stable:`稳定:按固定顺序逐条核对,已通过回归评测`},D=Q(()=>t.free?`接入决策模型,推荐更适合回答的成员,由你一键采纳。`:`接入决策模型,自动安排插话回应与下一轮发言。`);async function O(){if(d.value.trim()&&!p.value){p.value=!0;try{await r.save_scheduler_api_key(d.value)}catch(e){r.notify(`error`,e.message)}finally{p.value=!1}}}return(t,a)=>{let h=uV,k=tA,A=Yk,ee=bA,j=mX,te=hV;return W(),G(`div`,DQ,[q(`div`,null,[q(`p`,OQ,[a[5]||=Y(`智能调度`,-1),J(h,{size:`xs`,variant:`soft`,class:`scheduler-badge`},{default:R(()=>[...a[4]||=[Y(`决策模型`,-1)]]),_:1}),a[6]||=q(`small`,null,`可选`,-1)]),q(`p`,kQ,F(e.blocker?`${D.value}(${e.blocker})`:D.value),1)]),J(EQ,{ref_key:`add_row`,ref:l,label:`添加决策模型`,items:u.value,onAdd:v},null,8,[`items`]),c.value?(W(),G(`div`,jQ,[q(`div`,MQ,[q(`div`,{class:N([`scheduler-card`,{"is-editing":m.value}])},[m.value?(W(),G(U,{key:1},[q(`div`,zQ,[q(`div`,BQ,[q(`strong`,null,[Y(F(b.value),1),a[11]||=q(`span`,null,`设置`,-1)]),J(ee,{icon:`i-lucide-zap`,"aria-label":`检查智能调度配置`,title:`检查配置:向决策模型发送一道极短的是非题,核对供应商、模型与密钥`,size:`xs`,variant:`ghost`,color:S.value.state===`ok`?`success`:S.value.state===`error`?`error`:`neutral`,loading:S.value.state===`loading`,disabled:!i.value.api_key_ref||!i.value.model||!L(n).launch.available,onClick:C},null,8,[`color`,`loading`,`disabled`])]),q(`div`,VQ,[a[12]||=q(`span`,null,`模型`,-1),J(j,{mode:`autocomplete`,"ignore-filter":``,"model-value":i.value.model||``,items:o.value,"value-key":`value`,"aria-label":`智能调度模型`,placeholder:`模型 ID`,size:`xs`,class:`w-full`,"onUpdate:modelValue":a[0]||=e=>L(r).write_scheduler(`model`,e)},null,8,[`model-value`,`items`])]),q(`div`,HQ,[a[13]||=q(`span`,null,`密钥`,-1),J(te,{modelValue:d.value,"onUpdate:modelValue":a[2]||=e=>d.value=e,type:`text`,autocomplete:`off`,spellcheck:`false`,"data-1p-ignore":``,"data-lpignore":`true`,placeholder:i.value.api_key_ref?qQ:`填写所选供应商的 API Key`,title:i.value.api_key_ref&&!d.value?`已保存;本机不回传密钥,输入新 Key 可更换`:void 0,"aria-label":`智能调度 API Key`,size:`xs`,class:`w-full`,loading:p.value,ui:{base:f.value?``:`scheduler-key-masked`,trailing:`pe-0.5`},onChange:O},{trailing:R(()=>[J(ee,{icon:f.value?`i-lucide-eye`:`i-lucide-eye-off`,disabled:!d.value,"aria-label":f.value?`隐藏密钥`:`显示密钥`,"aria-pressed":f.value,size:`xs`,color:`neutral`,variant:`link`,onClick:a[1]||=e=>f.value=!f.value},null,8,[`icon`,`disabled`,`aria-label`,`aria-pressed`])]),_:1},8,[`modelValue`,`placeholder`,`title`,`loading`,`ui`])]),a[14]||=q(`p`,{class:`scheduler-note`},`决策模型只做选择、不生成文本,只按输入计费。判断时会把房间标题和最近 10~20 条消息发给所选供应商;密钥只存本机。`,-1)]),q(`span`,UQ,[q(`button`,{type:`button`,class:`scheduler-flip is-cancel`,"aria-label":`放弃决策模型的修改`,onClick:_},`取消`),q(`button`,{type:`button`,class:`scheduler-flip is-done`,"aria-label":`完成并返回决策模型卡片`,onClick:a[3]||=e=>m.value=!1},[J(A,{name:`i-lucide-check`}),a[15]||=Y(`完成`,-1)])])],64)):(W(),G(U,{key:0},[q(`button`,{type:`button`,class:`scheduler-open`,"aria-label":`设置智能调度的决策模型`,title:`点击设置`,onClick:g},[q(`span`,NQ,[J(k,{src:s[i.value.provider]?.icon,text:b.value.slice(0,2),alt:b.value,size:`sm`,class:N([`channel-avatar scheduler-avatar`,s[i.value.provider]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`strong`,null,F(b.value),1)]),q(`dl`,PQ,[q(`div`,null,[a[8]||=q(`dt`,null,`状态`,-1),q(`dd`,{class:N(`is-${x.value.tone}`)},[a[7]||=q(`i`,{"aria-hidden":`true`},null,-1),Y(F(x.value.text),1)],2)]),q(`div`,null,[a[9]||=q(`dt`,null,`模型`,-1),q(`dd`,{title:i.value.model},F(i.value.model||`未选择`),9,FQ)])]),q(`span`,IQ,[J(A,{name:`i-lucide-settings-2`}),a[10]||=Y(`设置`,-1)])]),q(`span`,LQ,[q(`button`,{type:`button`,"aria-label":`移出决策模型 ${b.value}`,title:`移出`,onClick:y},[J(A,{name:`i-lucide-x`})],8,RQ)])],64))],2)])])):(W(),G(`p`,AQ,`未添加决策模型。只能放一个,点其他供应商会替换。`)),c.value&&e.free&&w.value.length>1?(W(),G(`div`,WQ,[a[16]||=q(`span`,null,`判断方式`,-1),q(`div`,GQ,[(W(!0),G(U,null,V(w.value,e=>(W(),G(`button`,{key:e.value,type:`button`,role:`radio`,title:E[e.value],"aria-checked":T.value===e.value,onClick:t=>L(r).write_scheduler(`mode`,e.value)},F(e.label),9,KQ))),128))])])):X(``,!0)])}}},[[`__scopeId`,`data-v-48c2717b`]]),YQ={key:0,class:`confirm-dialog-items`},XQ={class:`dialog-actions`},ZQ=EH({__name:`ConfirmDialog`,props:Ha({title:{type:String,required:!0},description:{type:String,default:``},items:{type:Array,default:()=>[]},confirmLabel:{type:String,default:`确认`},danger:Boolean},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:Ha([`confirm`],[`update:open`]),setup(e,{emit:t}){let n=uo(e,`open`),r=t;function i(){r(`confirm`),n.value=!1}return(t,r)=>{let a=bA,o=$B;return W(),K(o,{open:n.value,"onUpdate:open":r[1]||=e=>n.value=e,title:e.title,description:e.description,ui:{content:`glass-panel studio-modal channel-folder-modal channel-manage-modal`,body:`dialog-body`}},{body:R(()=>[e.items.length?(W(),G(`ul`,YQ,[(W(!0),G(U,null,V(e.items,e=>(W(),G(`li`,{key:e},F(e),1))),128))])):X(``,!0),q(`div`,XQ,[J(a,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:r[0]||=e=>n.value=!1}),J(a,{label:e.confirmLabel,color:e.danger?`error`:`primary`,onClick:i},null,8,[`label`,`color`])])]),_:1},8,[`open`,`title`,`description`])}}},[[`__scopeId`,`data-v-39a60d6d`]]),QQ={key:0,class:`fine-print`},$Q=[`aria-pressed`],e$=[`innerHTML`],t$={class:`workflow-editor-cards`,"aria-label":`成员卡片`},n$={key:0,class:`workflow-editor-grid`},r$={key:0,class:`workflow-editor-grant`},i$=[`checked`,`onChange`],a$={key:1,class:`workflow-editor-empty`},o$={key:0,class:`fine-print is-warn`},s$={key:1,class:`fine-print workflow-editor-path`},c$=2e4,l$=`preset:`,u$=EH({__name:`WorkflowEditor`,props:Ha({workflowId:{type:String,default:``},draft:{type:Object,default:null}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:Ha([`saved`,`deleted`],[`update:open`]),setup(e,{emit:t}){let n=uo(e,`open`),r=e,i=t,{view:a,bridge:o,act:s}=Or(`discussion`),c=/^[a-z0-9_]{1,14}$/,l=[`label`,`description`,`project_access`,`model`,`effort`,`system_prompt`],u=Object.keys(o.identities).filter(e=>e!==`用户`),d=I(null),f=I(!1),p=I(!1),m=I(!1),h=Q(()=>!!r.workflowId),g=Q(()=>!h.value&&(a.value.launch.workflows||[]).find(e=>e.id===d.value?.id)),_=Q(()=>p.value?window.discuss_markdown.render_markdown(d.value.skill||``):``),v=Q(()=>[...u.map(e=>({value:e,name:o.display_name(e),...o.identities[e],title:`添加一张 ${o.display_name(e)} 卡片`,aria_label:`添加 ${e} 卡片`})),...a.value&&o.expert_presets().map((e,t)=>({value:l$+e.name,name:e.label||e.name,...o.identities[o.platform_of(e.name)],separated:t===0,title:e.description||`专家预设`,aria_label:`按预设 ${e.label||e.name} 添加卡片`}))]);async function y(e){f.value=!0;try{return await e()}catch(e){return o.notify(`error`,e.message),null}finally{f.value=!1}}z(n,async e=>{if(e){if(p.value=!1,!r.workflowId){let e=JSON.parse(JSON.stringify(r.draft||{}));d.value={label:``,description:``,skill:``,agents:[],...e,id:e.id||`workflow-${Date.now().toString(36)}`}}else d.value=null,d.value=await y(()=>o.local_request(`workflows`,{action:`get`,id:r.workflowId})),d.value||(n.value=!1)}},{immediate:!0});function b(e){let t=new Set(d.value.agents.map(e=>e.card.toLowerCase())),n=c.test(e)?e:`role`;for(let e=1;;e++){let r=e===1&&n!==`role`?n:`${n}${e}`;if(!t.has(r))return r}}function x(e){if(!e.startsWith(l$)){let t=b(`role`);d.value.agents.push({card:t,name:`${e}-${t}`,project_access:`read`});return}let t=o.expert_presets().find(t=>t.name===e.slice(7));if(!t)return;let n=o.platform_of(t.name),r=b(t.name.slice(n.length+1).toLowerCase()),i=Object.fromEntries(l.filter(e=>t[e]).map(e=>[e,t[e]]));d.value.agents.push({project_access:`read`,...i,card:r,name:`${n}-${r}`})}async function S(){let e=await y(()=>o.local_request(`workflows`,{action:`room-cards`,room_id:a.value.room.id}));if(e){for(let t of e.cards){let e=b(t.card.toLowerCase().slice(0,14));d.value.agents.push({...t,card:e,name:`${o.platform_of(t.name)}-${e}`})}o.notify(`info`,`已从当前房间带入 ${e.cards.length} 张卡片;请删去不需要的,并确认提示词里没有本机路径或密钥`)}}function C(e,t){e.project_access=t?e.requested_access:`read`}async function w(){let{resources:e,...t}=d.value,r=await y(()=>o.local_request(`workflows`,{action:`save`,workflow:h.value?t:d.value}));r&&(o.notify(`info`,`已保存工作流「${r.label||r.id}」`),n.value=!1,i(`saved`,r))}async function T(){await y(()=>o.local_request(`workflows`,{action:`delete`,id:r.workflowId}))&&(n.value=!1,i(`deleted`,r.workflowId))}return(e,t)=>{let r=hV,i=aV,o=cV,c=bA,l=$B;return W(),G(U,null,[J(l,{content:{onInteractOutside:e=>e.preventDefault()},open:n.value,"onUpdate:open":t[7]||=e=>n.value=e,title:h.value?`编辑工作流`:`新建工作流`,description:`做法说明给主持人读,成员卡片是它带来的成员。启用后怎么做由主持人按说明组织,程序不保证工序。`,ui:{content:`glass-panel studio-modal workflow-editor-modal`,body:`dialog-body`}},{body:R(()=>[d.value?(W(),G(`form`,{key:1,id:`workflow-editor-form`,class:`workflow-editor`,onSubmit:_u(w,[`prevent`])},[J(i,{label:`名称`,required:``},{default:R(()=>[J(r,{modelValue:d.value.label,"onUpdate:modelValue":t[0]||=e=>d.value.label=e,maxlength:32,autofocus:``,placeholder:`例如:小说剧本连载`,class:`w-full`},null,8,[`modelValue`])]),_:1}),J(i,{label:`一句话描述`,description:`主持人凭它判断什么时候用这个工作流。`},{default:R(()=>[J(r,{modelValue:d.value.description,"onUpdate:modelValue":t[1]||=e=>d.value.description=e,maxlength:500,placeholder:`例如:主持人定方向与骨架,写手按任务书写集,批评家挑常识与设定硬伤。`,class:`w-full`},null,8,[`modelValue`])]),_:1}),J(i,{label:`做法说明(SKILL.md)`,required:``,description:`给主持人读:按成员名称说明分工、顺序和产物位置,不引用卡片提示词。${d.value.skill.length} / ${c$}`},{hint:R(()=>[q(`button`,{type:`button`,class:`workflow-editor-toggle`,"aria-pressed":p.value,onClick:t[2]||=e=>p.value=!p.value},F(p.value?`编辑`:`预览`),9,$Q)]),default:R(()=>[p.value?(W(),G(`div`,{key:0,class:`workflow-editor-preview markdown-body`,innerHTML:_.value},null,8,e$)):(W(),K(o,{key:1,modelValue:d.value.skill,"onUpdate:modelValue":t[3]||=e=>d.value.skill=e,rows:10,autoresize:``,maxrows:20,maxlength:c$,class:`w-full`},null,8,[`modelValue`]))]),_:1},8,[`description`]),q(`section`,t$,[q(`h4`,null,[t[9]||=Y(`成员卡片`,-1),q(`small`,null,F(d.value.agents.length),1)]),J(EQ,{label:`添加成员卡片`,items:v.value,onAdd:x},null,8,[`items`]),d.value.agents.length?(W(),G(`div`,n$,[(W(!0),G(U,null,V(d.value.agents,(e,t)=>(W(),G(`div`,{key:e.card,class:`workflow-editor-card`},[J(zZ,{preset:d.value.agents[t],"onUpdate:preset":e=>d.value.agents[t]=e,name:e.name,mode:`cli`,status:{text:``,tone:``},access_locked:!!(e.requested_access&&e.project_access===`read`),onRemove:e=>d.value.agents.splice(t,1)},null,8,[`preset`,`onUpdate:preset`,`name`,`access_locked`,`onRemove`]),e.requested_access?(W(),G(`label`,r$,[q(`input`,{type:`checkbox`,checked:e.project_access!==`read`,onChange:t=>C(e,t.target.checked)},null,40,i$),Y(` 允许卡片要求的「`+F(L(BX)(e.requested_access))+`」`,1)])):X(``,!0)]))),128))])):(W(),G(`p`,a$,`还没有成员卡片。点上方添加;只有做法说明时,主持人带着房间里已有的成员按它做。`)),L(a).room?.id?(W(),K(c,{key:2,icon:`i-lucide-users`,label:`从当前房间成员导入`,size:`xs`,color:`neutral`,variant:`soft`,class:`workflow-editor-room`,loading:f.value,onClick:S},null,8,[`loading`])):X(``,!0)]),g.value?(W(),G(`p`,o$,`工作流库里已有同 ID 的「`+F(g.value.label)+`」,保存会覆盖它。`,1)):X(``,!0),h.value?(W(),G(`p`,s$,[Y(`修改会作用于所有启用它的房间,成员下一次执行时读到新内容。文件夹:`+F(d.value.directory)+` `,1),J(c,{label:`复制路径`,size:`xs`,variant:`ghost`,icon:`i-lucide-copy`,onClick:t[4]||=e=>L(s)(`copy`,d.value.directory)})])):X(``,!0)],32)):(W(),G(`p`,QQ,`正在读取工作流…`))]),footer:R(()=>[h.value?(W(),K(c,{key:0,icon:`i-lucide-trash-2`,label:`删除`,color:`error`,variant:`ghost`,disabled:f.value||!d.value,onClick:t[5]||=e=>m.value=!0},null,8,[`disabled`])):X(``,!0),t[10]||=q(`span`,{class:`workflow-editor-spacer`},null,-1),J(c,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:t[6]||=e=>n.value=!1}),J(c,{type:`submit`,form:`workflow-editor-form`,label:`保存`,class:`channel-primary-button`,loading:f.value,disabled:!d.value||!d.value.label.trim()||!d.value.skill.trim()},null,8,[`loading`,`disabled`])]),_:1},8,[`content`,`open`,`title`]),J(ZQ,{open:m.value,title:`删除工作流「${d.value?.label||``}」`,description:`工作流文件夹会从本机删除,无法撤销。`,items:[`已启用它的房间会显示“工作流不可用”,成员改用房间里的设置。`,`房间成员、消息记录和项目文件不受影响。`],"confirm-label":`删除`,danger:``,"onUpdate:open":t[8]||=e=>{e||(m.value=!1)},onConfirm:T},null,8,[`open`,`title`])],64)}}},[[`__scopeId`,`data-v-ecff1213`]]),d$=1e6,f$=101010256,p$=33639248,m$=22,h$=65535,g$=/(^|\/)SKILL\.md$/,_$=new TextDecoder,v$=new TextDecoder(`utf-8`,{fatal:!0});function y$(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=-1;for(let r=e.length-m$;r>=Math.max(0,e.length-m$-h$);r--)if(t.getUint32(r,!0)===f$){n=r;break}if(n<0)throw Error(`不是有效的 zip 文件`);let r=t.getUint16(n+10,!0),i=t.getUint32(n+16,!0),a=[];for(let n=0;n<r;n++){if(i+46>e.length||t.getUint32(i,!0)!==p$)throw Error(`zip 文件目录损坏或使用了不支持的 zip64 格式`);let n=t.getUint16(i+8,!0),r=t.getUint16(i+10,!0),o=t.getUint32(i+20,!0),s=t.getUint32(i+24,!0),c=t.getUint16(i+28,!0),l=t.getUint16(i+30,!0),u=t.getUint16(i+32,!0),d=t.getUint32(i+42,!0),f=_$.decode(e.subarray(i+46,i+46+c)).replace(/\\/g,`/`);i+=46+c+l+u,!f.endsWith(`/`)&&a.push({path:f,size:s,read:async()=>{if(n&1)throw Error(`${f} 已加密,无法读取`);let i=d+30+t.getUint16(d+26,!0)+t.getUint16(d+28,!0),a=e.subarray(i,i+o);if(r===0)return a;if(r!==8)throw Error(`${f} 的压缩方式不支持`);return new Uint8Array(await new Response(new Blob([a]).stream().pipeThrough(new DecompressionStream(`deflate-raw`))).arrayBuffer())}})}return a}async function b$(e){let t=e.filter(e=>g$.test(e.path)&&!e.path.startsWith(`__MACOSX/`)).sort((e,t)=>e.path.split(`/`).length-t.path.split(`/`).length);if(!t.length)throw Error(`没有找到 SKILL.md`);let n=t[0].path.slice(0,-8),r={};for(let t of e){if(!t.path.startsWith(n))continue;let e=t.path.slice(n.length);if(t.size>d$){if(e===`SKILL.md`)throw Error(`${e} 超过 1 MB`);r[e]=null}else try{r[e]=v$.decode(await t.read())}catch(t){if(e===`SKILL.md`)throw t;r[e]=null}}return r}async function x$(e){return b$(y$(new Uint8Array(await e.arrayBuffer())))}async function S$(e){return b$(e.map(e=>({path:e.webkitRelativePath||e.name,size:e.size,read:async()=>new Uint8Array(await e.arrayBuffer())})))}var C$={key:0,class:`workflow-picker`},w$={class:`workflow-picker-chips`,role:`group`,"aria-label":`工作流`},T$=[`disabled`,`aria-expanded`,`title`,`onClick`],E$=[`disabled`],D$={key:0,class:`workflow-picker-detail`},O$={class:`workflow-picker-actions`},k$=[`disabled`],A$={key:0,class:`workflow-viewer`},j$=[`innerHTML`],M$={key:0},N$={key:0},P$={key:1,class:`fine-print`},F$=EH({__name:`WorkflowPicker`,props:{disabled:Boolean,remember:Boolean},setup(e){let t=e,{view:n,bridge:r}=Or(`discussion`),i=I(``),a=Q({get:()=>t.remember?n.value.launch.create_preferences?.workflow_id||``:i.value,set:e=>{t.remember?r.write_create_preferences({workflow_id:e}):i.value=e}}),o=Q(()=>n.value.launch.workflows||[]),s=Q(()=>o.value.find(e=>e.id===a.value)),c=I(!1),l=I(``),u=I(null),d=I(null),f=I(null),p=I(null),m=[[{label:`新建`,icon:`i-lucide-plus`,onSelect:()=>g(``,{agents:[]})},{label:`导入 zip`,icon:`i-lucide-file-archive`,onSelect:()=>f.value?.click()},{label:`导入文件夹`,icon:`i-lucide-folder-input`,onSelect:()=>p.value?.click()}]],h=Q(()=>d.value?window.discuss_markdown.render_markdown(d.value.skill||``):``);function g(e,t=null){l.value=e,u.value=t,c.value=!0}async function _(e){try{let t=await r.local_request(`workflows`,{action:`preview`,files:await e()});t.ignored?.length&&r.notify(`warning`,`已忽略不支持的文件:${t.ignored.join(`、`)}`),g(``,t)}catch(e){r.notify(`error`,e.message)}}function v(e){let[t]=e.target.files||[];e.target.value=``,t&&_(()=>x$(t))}function y(e){let t=[...e.target.files||[]];e.target.value=``,t.length&&_(()=>S$(t))}async function b(){try{d.value=await r.local_request(`workflows`,{action:`get`,id:a.value})}catch(e){r.notify(`error`,e.message)}}async function x(e){await r.reload_workflows(),a.value=e.id}async function S(e){await r.reload_workflows(),a.value===e&&(a.value=``)}return(t,r)=>{let i=Yk,_=MV,C=$B;return L(n).launch.available||L(n).launch.remote?(W(),G(`div`,C$,[r[7]||=q(`span`,{class:`workflow-picker-label`},`工作流`,-1),q(`div`,w$,[(W(!0),G(U,null,V(o.value,t=>(W(),G(`button`,{key:t.id,type:`button`,disabled:e.disabled||!!t.error,class:N({"is-broken":t.error}),"aria-expanded":a.value===t.id,title:t.error||`${t.label}(${t.cards} 张卡片)`,onClick:e=>a.value=a.value===t.id?``:t.id},[J(i,{name:t.error?`i-lucide-triangle-alert`:`i-lucide-workflow`},null,8,[`name`]),Y(F(t.label)+` `,1),J(i,{name:a.value===t.id?`i-lucide-chevron-up`:`i-lucide-chevron-down`},null,8,[`name`])],10,T$))),128)),J(_,{items:m,disabled:e.disabled,ui:{content:`channel-menu`}},{default:R(()=>[q(`button`,{type:`button`,class:`workflow-picker-add`,disabled:e.disabled},[J(i,{name:`i-lucide-plus`}),r[3]||=Y(`添加`,-1)],8,E$)]),_:1},8,[`disabled`])]),s.value?(W(),G(`div`,D$,[q(`p`,null,F(s.value.description||`没有描述。`),1),q(`span`,O$,[q(`button`,{type:`button`,onClick:b},[J(i,{name:`i-lucide-book-open`}),r[4]||=Y(`查看说明`,-1)]),q(`button`,{type:`button`,disabled:e.disabled,onClick:r[0]||=e=>g(s.value.id)},[J(i,{name:`i-lucide-pencil`}),r[5]||=Y(`编辑`,-1)],8,k$)])])):X(``,!0),q(`input`,{ref_key:`zip_input`,ref:f,type:`file`,accept:`.zip,application/zip`,hidden:``,onChange:v},null,544),q(`input`,{ref_key:`folder_input`,ref:p,type:`file`,webkitdirectory:``,hidden:``,onChange:y},null,544),J(u$,{open:c.value,"onUpdate:open":r[1]||=e=>c.value=e,"workflow-id":l.value,draft:u.value,onSaved:x,onDeleted:S},null,8,[`open`,`workflow-id`,`draft`]),J(C,{open:!!d.value,title:d.value?.label||d.value?.id||``,description:d.value?.description||`做法说明(SKILL.md)与成员卡片`,ui:{content:`glass-panel studio-modal workflow-viewer-modal`,body:`dialog-body`},"onUpdate:open":r[2]||=e=>{e||(d.value=null)}},{body:R(()=>[d.value?(W(),G(`div`,A$,[q(`div`,{class:`workflow-viewer-skill markdown-body`,innerHTML:h.value},null,8,j$),q(`h4`,null,[r[6]||=Y(`成员卡片`,-1),q(`small`,null,F(d.value.agents.length),1)]),d.value.agents.length?(W(),G(`ul`,M$,[(W(!0),G(U,null,V(d.value.agents,e=>(W(),G(`li`,{key:e.card},[q(`strong`,null,F(e.label||e.name),1),q(`small`,null,F(e.name)+` · `+F(e.model||`软件默认模型`)+` · 项目`+F(L(BX)(e.project_access)),1),e.description?(W(),G(`p`,N$,F(e.description),1)):X(``,!0)]))),128))])):(W(),G(`p`,P$,`没有成员卡片。`))])):X(``,!0)]),_:1},8,[`open`,`title`,`description`])])):X(``,!0)}}},[[`__scopeId`,`data-v-f1b70365`]]),I$={__name:`HostWorkflowSwitch`,props:{modelValue:Boolean,disabled:Boolean},emits:[`update:modelValue`],setup(e,{emit:t}){let n=t;return(t,r)=>{let i=TH;return W(),K(i,{"model-value":e.modelValue,disabled:e.disabled,label:`允许主持人自建工作流`,"aria-label":`允许主持人自建工作流`,description:`主持人可自行保存、启用工作流并邀请其中的成员,项目权限最高可写。`,"onUpdate:modelValue":r[0]||=e=>n(`update:modelValue`,e)},null,8,[`model-value`,`disabled`])}}},L$={class:`create-discussion`},R$={key:0,class:`create-connect`,role:`status`},z$={class:`create-connect-command`},B$={key:1,class:`channel-create-location`},V$={class:`create-section`},H$={class:`create-section`},U$={key:0,class:`create-experts`,role:`group`,"aria-label":`参与的 AI`},W$={key:1,class:`create-experts-empty`},G$={key:2,class:`fine-print create-hint create-host-hint`},K$={class:`create-section`},q$={class:`create-drive`},J$={class:`expert-card-modes`,role:`radiogroup`,"aria-label":`创建后的推进方式`},Y$=[`aria-checked`,`onClick`],X$={class:`fine-print create-drive-hint`},Z$=[`open`],Q$={class:`create-footer`},$$={class:`create-footer-row`},e1=[`title`],t1=`new-expert-modes`,n1=3e3,r1=`preset:`,i1=EH({__name:`CreateDiscussion`,props:{targetFolder:{type:Object,default:null}},emits:[`submit`,`cancel`],setup(e,{emit:t}){let n=t,{view:r,bridge:i,pending:a,act:o}=Or(`discussion`),s=Object.keys(i.identities).filter(e=>e!==`用户`),c=e=>`new-room-${e}`,l=e=>r.value.fields[c(e)]??``,u=(e,t)=>i.write_field(c(e),t),d=Q(()=>!!r.value.create_discussion),f=Q(()=>r.value.create_goal),p=Q(()=>d.value||!!f.value),m=I(null),h=Q(()=>r.value.experts[t1]||{}),g=I([]),_=Q(()=>Object.keys(h.value).filter(e=>h.value[e]));z(_,e=>{g.value=[...g.value.filter(t=>e.includes(t)),...e.filter(e=>!g.value.includes(e))]},{immediate:!0});let v=Q(()=>[..._.value].sort((e,t)=>g.value.indexOf(e)-g.value.indexOf(t))),y=e=>v.value.filter(t=>i.platform_of(t)===e).length,b=I(null),x=Q(()=>l(`host`)),S=Q(()=>v.value.filter(e=>!p.value||h.value[e]!==`manual`)),C=I(null),w=Q(()=>v.value.filter(e=>h.value[e]===`cli`)),T=Q(()=>w.value.length>0||te.value||O.value),E=Q(()=>r.value.launch.available?null:r.value.launch.relay),D=Q(()=>r.value.launch.available||!!E.value),O=Q(()=>r.value.launch.available?!!r.value.launch.workspace.cwd:!!(E.value&&r.value.launch.workspace.local_project)),k=e=>{if(E.value)return!!E.value.clients[i.platform_of(e)];let t=r.value.launch.profiles[e]||{};return t.adapter===`api`?!!(t.base_url&&t.api_protocol&&t.api_key_ref&&t.model):!!(t.adapter&&(t.adapter===`antigravity`?t.ipc_directory:t.executable))},A=Q(()=>T.value&&D.value),ee=Q(()=>v.value.length>0&&w.value.every(k)&&(!w.value.length||D.value)),j=Q(()=>r.value.launch.available),te=Q(()=>j.value&&!!r.value.launch.scheduler?.enabled),ne=Q(()=>r.value.launch.available?``:`连接本机服务后可开启`),M=Q(()=>{let e=r.value.launch.scheduler||{};return j.value&&e.enabled&&!(e.provider&&e.model&&e.api_key_ref)}),re=Q(()=>T.value&&!D.value),ie=0,ae=Q(()=>{if(d.value&&h.value[x.value]!==`cli`)return`开启讨论需要先添加一位由本机唤醒的主持人`;if(f.value&&h.value[x.value]!==`cli`)return`开启 Goal 需要先添加一位由本机唤醒的主持人`;if(f.value&&!f.value.objective.trim())return`填写 Goal 目标`;if(re.value)return`先连接本机服务,或把成员改为手动启动`;if(p.value&&!D.value)return`先连接本机服务`;let e=w.value.filter(e=>!k(e));return e.length&&E.value?`在电脑「${E.value.name}」上配置 ${e.join(`、`)}`:e.length?`补齐 ${e.join(`、`)} 的接入配置`:M.value?`补齐决策模型配置,或移出决策模型`:``}),oe=Q(()=>!ee.value||!!ae.value||M.value||a.value===`create`);function se(){S.value.includes(x.value)||u(`host`,S.value[0]||``)}aa(()=>{se(),ie=window.setInterval(()=>{re.value&&!document.hidden&&o(`check_launch_connection`)},n1)}),ca(()=>window.clearInterval(ie));let ce=[{value:`free`,label:`自由协作`},{value:`discussion`,label:`开启讨论`},{value:`goal`,label:`开启 Goal`}],le={free:`成员被点名时工作,做完就停下等你。讨论和 Goal 都可以建房后再开启。`,discussion:`主持人安排成员轮流发言,到上限或结束后回到自由协作。`,goal:`主持人持续推进一个目标,房间空闲时自动接着做,直到完成、卡住或你结束。`},ue=Q(()=>d.value?`discussion`:f.value?`goal`:`free`);function de(e){e===`goal`?i.write_create_goal({}):e===`discussion`?i.write_create_discussion(!0):(i.write_create_discussion(!1),i.write_create_goal(null)),ar(se)}let fe=e=>i.launch_clients[e]?.some(e=>e.value!==`api`),pe=e=>p.value&&e===x.value?[]:[`cli`,`manual`];function me(e,t){i.write_expert(t1,e,t),se()}function he(e){if(E.value)return k(e)?{text:`由电脑「${E.value.name}」唤醒`,tone:`ready`}:{text:`电脑上尚未配置此软件`,tone:`warn`};let t=r.value.launch.profiles[e]?.adapter===`api`;return k(e)?{text:t?`已配置 API`:`已配置本机软件`,tone:`ready`}:{text:t?`待补齐 API 配置`:`待补齐接入配置`,tone:`warn`}}function ge(e){return y(e)?`已加入 ${y(e)} 位 · 可继续添加`:fe(e)?`API / 本地 App / CLI / 手动启动`:`API / 手动启动`}let _e=Q(()=>[...s.map(e=>({value:e,name:i.display_name(e),...i.identities[e],disabled:!i.launch_clients[e],title:ge(e),aria_label:`添加 ${e} 实例`})),...r.value&&i.expert_presets().map((e,t)=>({value:r1+e.name,name:e.label||e.name,...i.identities[i.platform_of(e.name)],separated:t===0,title:e.description||`专家预设`,aria_label:`添加预设 ${e.label||e.name}`,removable:!0}))]);function ve(e){if(e.startsWith(r1)){let t=i.expert_presets().find(t=>t.name===e.slice(7));return t&&i.add_preset(t1,t,`cli`),se()}i.launch_clients[e]&&(i.default_launch_entry(e),y(e)?i.add_instance(t1,e,`cli`):me(e,`cli`),se())}function ye(e){me(e,``),ar(()=>b.value?.focus_first())}function be(){oe.value||(C.value?.settle(),m.value?.settle(),n(`submit`))}let xe=Q(()=>{let e=Object.keys(h.value),t=[`协作房间`,e.length?`${e.length} 位 AI`:`暂无成员`,x.value?`${i.member_label(x.value)} 主持`:`暂无主持人`];if(d.value){let e=l(`limit-max_rounds`),n=l(`limit-max_minutes`);t.push(`开启讨论`,[e&&Number(e)?`${e} 轮`:`不限轮次`,n&&Number(n)?GH(Number(n)):`不限时长`].join(` / `))}return f.value&&t.push(`开启 Goal`),t.join(` · `)});return(t,s)=>{let c=Yk,g=bA,_=hV,y=aV,w=cV,O=ya(`keep-reading`);return W(),G(`div`,L$,[Tr((W(),G(`form`,{id:`create-discussion-form`,class:`create-scroll dialog-form`,onSubmit:_u(be,[`prevent`])},[re.value?(W(),G(`div`,R$,[q(`p`,null,[J(c,{name:`i-lucide-plug-zap`}),s[16]||=Y(`本机服务未连接,连接后才能唤醒本机 AI。在运行 AI 的电脑上执行下面的命令并完成网页授权,连上后自动检测。`,-1)]),q(`div`,z$,[q(`code`,null,F(L(r).launch.connect_command),1),J(g,{icon:`i-lucide-copy`,"aria-label":`复制本机连接命令`,variant:`ghost`,color:`neutral`,onClick:s[0]||=e=>L(o)(`copy`,L(r).launch.connect_command)})])])):X(``,!0),e.targetFolder?.id?(W(),G(`p`,B$,[J(c,{name:`i-lucide-folder`}),Y(F(e.targetFolder.name),1)])):X(``,!0),q(`section`,V$,[s[17]||=q(`h3`,null,[q(`span`,null,`1`),Y(`这次做什么`)],-1),J(y,{label:`话题名称`,required:``},{default:R(()=>[J(_,{"model-value":l(`title`),maxlength:80,required:``,autofocus:``,size:`lg`,placeholder:`这次要一起做什么?`,class:`w-full`,"onUpdate:modelValue":s[1]||=e=>u(`title`,e)},null,8,[`model-value`])]),_:1}),J(y,{label:`项目目录(可选)`,description:L(r).launch.available?`本机唤醒的成员在此目录读写文件;不填则各用软件默认目录。`:E.value?`由电脑「${E.value.name}」唤醒的成员在所选项目中读写文件;不选则各用软件默认目录。`:`连接本机服务后可指定:本机唤醒的成员将在此目录读写文件。`},{default:R(()=>[J(pQ,{disabled:!D.value},null,8,[`disabled`]),L(r).launch.available&&L(r).launch.workspace.cwd?(W(),K(vQ,{key:0,class:`create-extra-directories`,"model-value":L(r).launch.workspace.extra_directories||[],"onUpdate:modelValue":s[2]||=e=>L(i).write_launch(`workspace`,`extra_directories`,e.length?e:void 0)},null,8,[`model-value`])):X(``,!0)]),_:1},8,[`description`])]),q(`section`,H$,[s[18]||=q(`h3`,null,[q(`span`,null,`2`),Y(`谁来参与`)],-1),J(EQ,{ref_key:`library`,ref:b,label:`添加 AI`,items:_e.value,onAdd:ve,onRemove:s[3]||=e=>L(i).delete_expert_preset(e.slice(7))},null,8,[`items`]),v.value.length?(W(),G(`div`,U$,[(W(!0),G(U,null,V(v.value,e=>(W(),K(zZ,{key:e,name:e,mode:h.value[e],choices:pe(e),status:he(e),host:x.value===e,hostable:S.value.includes(e),hosting:``,onHost:t=>u(`host`,e),onRemove:t=>ye(e),onMode:t=>me(e,t)},null,8,[`name`,`mode`,`choices`,`status`,`host`,`hostable`,`onHost`,`onRemove`,`onMode`]))),128))])):(W(),G(`p`,W$,`请至少添加一位成员。同一平台可添加多位,各自独立会话。`)),v.value.length?(W(),G(`div`,G$,[J(c,{name:`i-lucide-crown`}),q(`span`,null,F(S.value.length?`点卡片上的皇冠指定主持人:没 @ 任何人的消息由它分配;其他成员只在被你或主持人点名时发言。`:`需要一位本地 AI 做主持人,没 @ 的消息才有人接。`),1)])):X(``,!0),J(JQ,{free:!0,blocker:ne.value},null,8,[`blocker`])]),q(`section`,K$,[s[20]||=q(`h3`,null,[q(`span`,null,`3`),Y(`协作方式(可选)`)],-1),J(F$,{remember:``}),L(r).launch.available||L(r).launch.remote?(W(),K(I$,{key:0,"model-value":!!L(r).create_host_workflows,"onUpdate:modelValue":s[4]||=e=>L(i).write_create_host_workflows(e)},null,8,[`model-value`])):X(``,!0),q(`div`,q$,[s[19]||=q(`span`,null,`创建后`,-1),q(`div`,J$,[(W(),G(U,null,V(ce,e=>q(`button`,{key:e.value,type:`button`,role:`radio`,"aria-checked":ue.value===e.value,onClick:t=>de(e.value)},F(e.label),9,Y$)),64))])]),q(`p`,X$,F(le[ue.value]),1),d.value?(W(),G(U,{key:1},[J(y,{label:`讨论目标`,description:`写下问题、背景和顾虑,主持人据此推进。`},{default:R(()=>[J(w,{"model-value":l(`goal`),maxlength:1e3,rows:4,autoresize:``,maxrows:10,placeholder:`例如:我们在 A、B 两个方案之间犹豫,主要顾虑是成本和上线时间……`,class:`w-full`,"onUpdate:modelValue":s[5]||=e=>u(`goal`,e)},null,8,[`model-value`])]),_:1}),J(YH,{ref_key:`limit_picker`,ref:C,rounds:Number(l(`limit-max_rounds`)),minutes:Number(l(`limit-max_minutes`)),named_followup:!!L(r).named_followup,"onUpdate:rounds":s[6]||=e=>u(`limit-max_rounds`,String(e)),"onUpdate:minutes":s[7]||=e=>u(`limit-max_minutes`,String(e)),"onUpdate:named_followup":s[8]||=e=>L(i).write_named_followup(e)},null,8,[`rounds`,`minutes`,`named_followup`])],64)):X(``,!0),f.value?(W(),K(rU,{key:2,ref_key:`goal_config`,ref:m,objective:f.value.objective,continues:f.value.max_continues,minutes:f.value.max_minutes,"onUpdate:objective":s[9]||=e=>L(i).write_create_goal({objective:e}),"onUpdate:continues":s[10]||=e=>L(i).write_create_goal({max_continues:e}),"onUpdate:minutes":s[11]||=e=>L(i).write_create_goal({max_minutes:e})},null,8,[`objective`,`continues`,`minutes`])):X(``,!0)]),q(`details`,{class:`create-advanced`,open:!!L(r).launch.create_preferences?.advanced_open,onToggle:s[14]||=e=>L(i).write_create_preferences({advanced_open:e.target.open})},[q(`summary`,null,[J(c,{name:`i-lucide-chevron-right`,class:`create-advanced-icon`}),s[21]||=Y(`高级设置`,-1),q(`small`,null,F(L(r).create_chain_rounds?`连续派活 ${L(r).create_chain_rounds} 轮`:`连续派活不限轮数`)+F(L(r).launch.available||L(r).launch.remote?` · API 每次${L(r).create_api_max_requests?` ${L(r).create_api_max_requests} 次请求`:`不限请求`}`:``),1)]),J(YY,{"model-value":L(r).create_chain_rounds,"onUpdate:modelValue":s[12]||=e=>L(i).write_create_chain_rounds(e)},{default:R(()=>[...s[22]||=[Y(`建房后可在房间页修改。`,-1)]]),_:1},8,[`model-value`]),L(r).launch.available||L(r).launch.remote?(W(),K(HY,{key:0,class:`create-advanced-field`,"model-value":L(r).create_api_max_requests,"onUpdate:modelValue":s[13]||=e=>L(i).write_create_api_max_requests(e)},{default:R(()=>[...s[23]||=[Y(`建房后可在房间页修改。`,-1)]]),_:1},8,[`model-value`])):X(``,!0)],40,Z$)],32)),[[O]]),q(`footer`,Q$,[q(`div`,$$,[q(`span`,{class:N([`create-summary`,{"is-blocked":ae.value}]),title:ae.value||xe.value,role:`status`},[ae.value?(W(),K(c,{key:0,name:`i-lucide-circle-alert`})):X(``,!0),Y(F(ae.value?`还差:${ae.value}`:v.value.length||p.value?xe.value:``),1)],10,e1),J(g,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:s[15]||=e=>n(`cancel`)}),J(g,{type:`submit`,form:`create-discussion-form`,class:`channel-primary-button`,icon:A.value?`i-lucide-play`:`i-lucide-plus`,label:d.value?`创建并开启讨论`:f.value?`创建并开启 Goal`:T.value?`创建并连接`:`创建协作房间`,disabled:oe.value,loading:L(a)===`create`},null,8,[`icon`,`label`,`disabled`,`loading`])])])])}}},[[`__scopeId`,`data-v-a6fe44e0`]]),a1=(e=>(e[e.Border=-1]=`Border`,e[e.Data=0]=`Data`,e[e.Function=1]=`Function`,e[e.Position=2]=`Position`,e[e.Timing=3]=`Timing`,e[e.Alignment=4]=`Alignment`,e))(a1||{}),o1=Object.defineProperty,s1=(e,t,n)=>t in e?o1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c1=(e,t,n)=>(s1(e,typeof t==`symbol`?t:t+``,n),n),l1=[0,1],u1=[1,0],d1=[2,3],f1=[3,2],p1={L:l1,M:u1,Q:d1,H:f1},m1=/^[0-9]*$/,h1=/^[A-Z0-9 $%*+.\/:-]*$/,g1=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`,_1=1,v1=40,y1=3,b1=3,x1=40,S1=10,C1=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],w1=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],T1=class{constructor(e,t,n,r){if(this.version=e,this.ecc=t,c1(this,`size`),c1(this,`mask`),c1(this,`modules`,[]),c1(this,`types`,[]),e<_1||e>v1)throw RangeError(`Version value out of range`);if(r<-1||r>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let i=Array.from({length:this.size},()=>!1);for(let e=0;e<this.size;e++)this.modules.push(i.slice()),this.types.push(i.map(()=>0));this.drawFunctionPatterns();let a=this.addEccAndInterleave(n);if(this.drawCodewords(a),r===-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(r=t,e=n),this.applyMask(t)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0,a1.Timing),this.setFunctionModule(e,6,e%2==0,a1.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n===0&&r===0||n===0&&r===t-1||n===t-1&&r===0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.ecc[1]<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let r=(t<<10|n)^21522;for(let e=0;e<=5;e++)this.setFunctionModule(8,e,D1(r,e));this.setFunctionModule(8,7,D1(r,6)),this.setFunctionModule(8,8,D1(r,7)),this.setFunctionModule(7,8,D1(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,D1(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,D1(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,D1(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;for(let e=0;e<18;e++){let n=D1(t,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,n),this.setFunctionModule(i,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;a>=0&&a<this.size&&o>=0&&o<this.size&&this.setFunctionModule(a,o,i!==2&&i!==4,a1.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!==1,a1.Alignment)}setFunctionModule(e,t,n,r=a1.Function){this.modules[t][e]=n,this.types[t][e]=r}addEccAndInterleave(e){let t=this.version,n=this.ecc;if(e.length!==H1(t,n))throw RangeError(`Invalid argument`);let r=w1[n[0]][t],i=C1[n[0]][t],a=Math.floor(V1(t)/8),o=r-a%r,s=Math.floor(a/r),c=[],l=U1(i);for(let t=0,n=0;t<r;t++){let r=e.slice(n,n+s-i+(t<o?0:1));n+=r.length;let a=W1(r,l);t<o&&r.push(0),c.push(r.concat(a))}let u=[];for(let e=0;e<c[0].length;e++)c.forEach((t,n)=>{(e!==s-i||n>=o)&&u.push(t[e])});return u}drawCodewords(e){if(e.length!==Math.floor(V1(this.version)/8))throw RangeError(`Invalid argument`);let t=0;for(let n=this.size-1;n>=1;n-=2){n===6&&(n=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){let a=n-i,o=n+1&2?r:this.size-1-r;!this.types[o][a]&&t<e.length*8&&(this.modules[o][a]=D1(e[t>>>3],7-(t&7)),t++)}}}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.types[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[t][a]===n?(r++,r===5?e+=y1:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*x1),n=this.modules[t][a],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*x1}for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[a][t]===n?(r++,r===5?e+=y1:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*x1),n=this.modules[a][t],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*x1}for(let t=0;t<this.size-1;t++)for(let n=0;n<this.size-1;n++){let r=this.modules[t][n];r===this.modules[t][n+1]&&r===this.modules[t+1][n]&&r===this.modules[t+1][n+1]&&(e+=b1)}let t=0;for(let e of this.modules)t=e.reduce((e,t)=>e+ +!!t,t);let n=this.size*this.size,r=Math.ceil(Math.abs(t*20-n*10)/n)-1;return e+=r*S1,e}getAlignmentPatternPositions(){if(this.version===1)return[];{let e=Math.floor(this.version/7)+2,t=this.version===32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}finderPenaltyCountPatterns(e){let t=e[1],n=t>0&&e[2]===t&&e[3]===t*3&&e[4]===t&&e[5]===t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]===0&&(e+=this.size),t.pop(),t.unshift(e)}};function E1(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function D1(e,t){return!!(e>>>t&1)}var O1=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}getData(){return this.bitData.slice()}},k1=[1,10,12,14],A1=[2,9,11,13],j1=[4,8,16,16];function M1(e,t){return e[Math.floor((t+7)/17)+1]}function N1(e){let t=[];for(let n of e)E1(n,8,t);return new O1(j1,e.length,t)}function P1(e){if(!L1(e))throw RangeError(`String contains non-numeric characters`);let t=[];for(let n=0;n<e.length;){let r=Math.min(e.length-n,3);E1(Number.parseInt(e.substring(n,n+r),10),r*3+1,t),n+=r}return new O1(k1,e.length,t)}function F1(e){if(!R1(e))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let t=[],n=0;for(;n+2<=e.length;n+=2){let r=g1.indexOf(e.charAt(n))*45;r+=g1.indexOf(e.charAt(n+1)),E1(r,11,t)}return n<e.length&&E1(g1.indexOf(e.charAt(n)),6,t),new O1(A1,e.length,t)}function I1(e){return e===``?[]:L1(e)?[P1(e)]:R1(e)?[F1(e)]:[N1(B1(e))]}function L1(e){return m1.test(e)}function R1(e){return h1.test(e)}function z1(e,t){let n=0;for(let r of e){let e=M1(r.mode,t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}function B1(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)===`%`?(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}function V1(e){if(e<_1||e>v1)throw RangeError(`Version number out of range`);let t=(16*e+128)*e+64;if(e>=2){let n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function H1(e,t){return Math.floor(V1(e)/8)-C1[t[0]][e]*w1[t[0]][e]}function U1(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let n=1;for(let r=0;r<e;r++){for(let e=0;e<t.length;e++)t[e]=G1(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=G1(n,2)}return t}function W1(e,t){let n=t.map(e=>0);for(let r of e){let e=r^n.shift();n.push(0),t.forEach((t,r)=>n[r]^=G1(t,e))}return n}function G1(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return n}function K1(e,t,n=1,r=40,i=-1,a=!0){if(!(_1<=n&&n<=r&&r<=v1)||i<-1||i>7)throw RangeError(`Invalid value`);let o,s;for(o=n;;o++){let n=H1(o,t)*8,i=z1(e,o);if(i<=n){s=i;break}if(o>=r)throw RangeError(`Data too long`)}for(let e of[u1,d1,f1])a&&s<=H1(o,e)*8&&(t=e);let c=[];for(let t of e){E1(t.mode[0],4,c),E1(t.numChars,M1(t.mode,o),c);for(let e of t.getData())c.push(e)}let l=H1(o,t)*8;E1(0,Math.min(4,l-c.length),c),E1(0,(8-c.length%8)%8,c);for(let e=236;c.length<l;e^=253)E1(e,8,c);let u=Array.from({length:Math.ceil(c.length/8)},()=>0);return c.forEach((e,t)=>u[t>>>3]|=e<<7-(t&7)),new T1(o,t,u,i)}function q1(e,t){let{ecc:n=`L`,boostEcc:r=!1,minVersion:i=1,maxVersion:a=40,maskPattern:o=-1,border:s=1}=t||{},c=typeof e==`string`?I1(e):Array.isArray(e)?[N1(e)]:void 0;if(!c)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let l=K1(c,p1[n],i,a,o,r),u=J1({version:l.version,maskPattern:l.mask,size:l.size,data:l.modules,types:l.types},s);return t?.invert&&(u.data=u.data.map(e=>e.map(e=>!e))),t?.onEncoded?.(u),u}function J1(e,t=1){if(!t)return e;let{size:n}=e,r=n+t*2;e.size=r,e.data.forEach(e=>{for(let n=0;n<t;n++)e.unshift(!1),e.push(!1)});for(let n=0;n<t;n++)e.data.unshift(Array.from({length:r},e=>!1)),e.data.push(Array.from({length:r},e=>!1));let i=a1.Border;e.types.forEach(e=>{for(let n=0;n<t;n++)e.unshift(i),e.push(i)});for(let n=0;n<t;n++)e.types.unshift(Array.from({length:r},e=>i)),e.types.push(Array.from({length:r},e=>i));return e}function Y1(e,t={}){let n=q1(e,t),{pixelSize:r=10,whiteColor:i=`white`,blackColor:a=`black`}=t,o=n.size*r,s=n.size*r,c=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${s} ${o}">`,l=[];for(let e=0;e<n.size;e++)for(let t=0;t<n.size;t++){let i=t*r,a=e*r;n.data[e][t]&&l.push(`M${i},${a}h${r}v${r}h-${r}z`)}return c+=`<rect fill="${i}" width="${s}" height="${o}"/>`,c+=`<path fill="${a}" d="${l.join(``)}"/>`,c+=`</svg>`,c}var X1=l(o(((e,t,n)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.jsQR=r():n.jsQR=r()})(typeof self<`u`?self:n,function(){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=3)})([(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.BitMatrix=function(){function e(e,t){this.width=t,this.height=e.length/t,this.data=e}return e.createEmpty=function(t,n){return new e(new Uint8ClampedArray(t*n),t)},e.prototype.get=function(e,t){return e<0||e>=this.width||t<0||t>=this.height?!1:!!this.data[t*this.width+e]},e.prototype.set=function(e,t,n){this.data[t*this.width+e]=+!!n},e.prototype.setRegion=function(e,t,n,r,i){for(var a=t;a<t+r;a++)for(var o=e;o<e+n;o++)this.set(o,a,!!i)},e}()}),(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);function i(e,t){return e^t}t.addOrSubtractGF=i,t.default=function(){function e(e,t,n){this.primitive=e,this.size=t,this.generatorBase=n,this.expTable=Array(this.size),this.logTable=Array(this.size);for(var i=1,a=0;a<this.size;a++)this.expTable[a]=i,i*=2,i>=this.size&&(i=(i^this.primitive)&this.size-1);for(var a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new r.default(this,Uint8ClampedArray.from([0])),this.one=new r.default(this,Uint8ClampedArray.from([1]))}return e.prototype.multiply=function(e,t){return e===0||t===0?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]},e.prototype.inverse=function(e){if(e===0)throw Error(`Can't invert 0`);return this.expTable[this.size-this.logTable[e]-1]},e.prototype.buildMonomial=function(e,t){if(e<0)throw Error(`Invalid monomial degree less than 0`);if(t===0)return this.zero;var n=new Uint8ClampedArray(e+1);return n[0]=t,new r.default(this,n)},e.prototype.log=function(e){if(e===0)throw Error(`Can't take log(0)`);return this.logTable[e]},e.prototype.exp=function(e){return this.expTable[e]},e}()}),(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.default=function(){function e(e,t){if(t.length===0)throw Error(`No coefficients.`);this.field=e;var n=t.length;if(n>1&&t[0]===0){for(var r=1;r<n&&t[r]===0;)r++;if(r===n)this.coefficients=e.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(n-r);for(var i=0;i<this.coefficients.length;i++)this.coefficients[i]=t[r+i]}}else this.coefficients=t}return e.prototype.degree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return this.coefficients[0]===0},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.addOrSubtract=function(t){var n;if(this.isZero())return t;if(t.isZero())return this;var i=this.coefficients,a=t.coefficients;i.length>a.length&&(n=[a,i],i=n[0],a=n[1]);for(var o=new Uint8ClampedArray(a.length),s=a.length-i.length,c=0;c<s;c++)o[c]=a[c];for(var c=s;c<a.length;c++)o[c]=r.addOrSubtractGF(i[c-s],a[c]);return new e(this.field,o)},e.prototype.multiply=function(t){if(t===0)return this.field.zero;if(t===1)return this;for(var n=this.coefficients.length,r=new Uint8ClampedArray(n),i=0;i<n;i++)r[i]=this.field.multiply(this.coefficients[i],t);return new e(this.field,r)},e.prototype.multiplyPoly=function(t){if(this.isZero()||t.isZero())return this.field.zero;for(var n=this.coefficients,i=n.length,a=t.coefficients,o=a.length,s=new Uint8ClampedArray(i+o-1),c=0;c<i;c++)for(var l=n[c],u=0;u<o;u++)s[c+u]=r.addOrSubtractGF(s[c+u],this.field.multiply(l,a[u]));return new e(this.field,s)},e.prototype.multiplyByMonomial=function(t,n){if(t<0)throw Error(`Invalid degree less than 0`);if(n===0)return this.field.zero;for(var r=this.coefficients.length,i=new Uint8ClampedArray(r+t),a=0;a<r;a++)i[a]=this.field.multiply(this.coefficients[a],n);return new e(this.field,i)},e.prototype.evaluateAt=function(e){var t=0;if(e===0)return this.getCoefficient(0);var n=this.coefficients.length;if(e===1)return this.coefficients.forEach(function(e){t=r.addOrSubtractGF(t,e)}),t;t=this.coefficients[0];for(var i=1;i<n;i++)t=r.addOrSubtractGF(this.field.multiply(e,t),this.coefficients[i]);return t},e}()}),(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=n(5),a=n(11),o=n(12);function s(e){var t=o.locate(e);if(!t)return null;for(var n=0,r=t;n<r.length;n++){var s=r[n],c=a.extract(e,s),l=i.decode(c.matrix);if(l)return{binaryData:l.bytes,data:l.text,chunks:l.chunks,version:l.version,location:{topRightCorner:c.mappingFunction(s.dimension,0),topLeftCorner:c.mappingFunction(0,0),bottomRightCorner:c.mappingFunction(s.dimension,s.dimension),bottomLeftCorner:c.mappingFunction(0,s.dimension),topRightFinderPattern:s.topRight,topLeftFinderPattern:s.topLeft,bottomLeftFinderPattern:s.bottomLeft,bottomRightAlignmentPattern:s.alignmentPattern}}}return null}var c={inversionAttempts:`attemptBoth`};function l(e,t,n,i){i===void 0&&(i={});var a=c;Object.keys(a||{}).forEach(function(e){a[e]=i[e]||a[e]});var o=a.inversionAttempts===`attemptBoth`||a.inversionAttempts===`invertFirst`,l=a.inversionAttempts===`onlyInvert`||a.inversionAttempts===`invertFirst`,u=r.binarize(e,t,n,o),d=u.binarized,f=u.inverted,p=s(l?f:d);return!p&&(a.inversionAttempts===`attemptBoth`||a.inversionAttempts===`invertFirst`)&&(p=s(l?d:f)),p}l.default=l,t.default=l}),(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=8,a=24;function o(e,t,n){return e<t?t:e>n?n:e}var s=function(){function e(e,t){this.width=e,this.data=new Uint8ClampedArray(e*t)}return e.prototype.get=function(e,t){return this.data[t*this.width+e]},e.prototype.set=function(e,t,n){this.data[t*this.width+e]=n},e}();function c(e,t,n,c){if(e.length!==t*n*4)throw Error(`Malformed data passed to binarizer.`);for(var l=new s(t,n),u=0;u<t;u++)for(var d=0;d<n;d++){var f=e[(d*t+u)*4+0],p=e[(d*t+u)*4+1],m=e[(d*t+u)*4+2];l.set(u,d,.2126*f+.7152*p+.0722*m)}for(var h=Math.ceil(t/i),g=Math.ceil(n/i),_=new s(h,g),v=0;v<g;v++)for(var y=0;y<h;y++){for(var b=0,x=1/0,S=0,d=0;d<i;d++)for(var u=0;u<i;u++){var C=l.get(y*i+u,v*i+d);b+=C,x=Math.min(x,C),S=Math.max(S,C)}var w=b/i**2;if(S-x<=a&&(w=x/2,v>0&&y>0)){var T=(_.get(y,v-1)+2*_.get(y-1,v)+_.get(y-1,v-1))/4;x<T&&(w=T)}_.set(y,v,w)}var E=r.BitMatrix.createEmpty(t,n),D=null;c&&(D=r.BitMatrix.createEmpty(t,n));for(var v=0;v<g;v++)for(var y=0;y<h;y++){for(var O=o(y,2,h-3),k=o(v,2,g-3),b=0,A=-2;A<=2;A++)for(var ee=-2;ee<=2;ee++)b+=_.get(O+A,k+ee);for(var j=b/25,A=0;A<i;A++)for(var ee=0;ee<i;ee++){var u=y*i+A,d=v*i+ee,te=l.get(u,d);E.set(u,d,te<=j),c&&D.set(u,d,!(te<=j))}}return c?{binarized:E,inverted:D}:{binarized:E}}t.binarize=c}),(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(6),a=n(9),o=n(10);function s(e,t){for(var n=e^t,r=0;n;)r++,n&=n-1;return r}function c(e,t){return t<<1|e}var l=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],u=[function(e){return(e.y+e.x)%2==0},function(e){return e.y%2==0},function(e){return e.x%3==0},function(e){return(e.y+e.x)%3==0},function(e){return(Math.floor(e.y/2)+Math.floor(e.x/3))%2==0},function(e){return e.x*e.y%2+e.x*e.y%3==0},function(e){return(e.y*e.x%2+e.y*e.x%3)%2==0},function(e){return((e.y+e.x)%2+e.y*e.x%3)%2==0}];function d(e){var t=17+4*e.versionNumber,n=r.BitMatrix.createEmpty(t,t);n.setRegion(0,0,9,9,!0),n.setRegion(t-8,0,8,9,!0),n.setRegion(0,t-8,9,8,!0);for(var i=0,a=e.alignmentPatternCenters;i<a.length;i++)for(var o=a[i],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var l=c[s];o===6&&l===6||o===6&&l===t-7||o===t-7&&l===6||n.setRegion(o-2,l-2,5,5,!0)}return n.setRegion(6,9,1,t-17,!0),n.setRegion(9,6,t-17,1,!0),e.versionNumber>6&&(n.setRegion(t-11,0,3,6,!0),n.setRegion(0,t-11,6,3,!0)),n}function f(e,t,n){for(var r=u[n.dataMask],i=e.height,a=d(t),o=[],s=0,l=0,f=!0,p=i-1;p>0;p-=2){p===6&&p--;for(var m=0;m<i;m++)for(var h=f?i-1-m:m,g=0;g<2;g++){var _=p-g;if(!a.get(_,h)){l++;var v=e.get(_,h);r({y:h,x:_})&&(v=!v),s=c(v,s),l===8&&(o.push(s),l=0,s=0)}}f=!f}return o}function p(e){var t=e.height,n=Math.floor((t-17)/4);if(n<=6)return o.VERSIONS[n-1];for(var r=0,i=5;i>=0;i--)for(var a=t-9;a>=t-11;a--)r=c(e.get(a,i),r);for(var l=0,a=5;a>=0;a--)for(var i=t-9;i>=t-11;i--)l=c(e.get(a,i),l);for(var u=1/0,d,f=0,p=o.VERSIONS;f<p.length;f++){var m=p[f];if(m.infoBits===r||m.infoBits===l)return m;var h=s(r,m.infoBits);h<u&&(d=m,u=h),h=s(l,m.infoBits),h<u&&(d=m,u=h)}if(u<=3)return d}function m(e){for(var t=0,n=0;n<=8;n++)n!==6&&(t=c(e.get(n,8),t));for(var r=7;r>=0;r--)r!==6&&(t=c(e.get(8,r),t));for(var i=e.height,a=0,r=i-1;r>=i-7;r--)a=c(e.get(8,r),a);for(var n=i-8;n<i;n++)a=c(e.get(n,8),a);for(var o=1/0,u=null,d=0,f=l;d<f.length;d++){var p=f[d],m=p.bits,h=p.formatInfo;if(m===t||m===a)return h;var g=s(t,m);g<o&&(u=h,o=g),t!==a&&(g=s(a,m),g<o&&(u=h,o=g))}return o<=3?u:null}function h(e,t,n){var r=t.errorCorrectionLevels[n],i=[],a=0;if(r.ecBlocks.forEach(function(e){for(var t=0;t<e.numBlocks;t++)i.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),a+=e.dataCodewordsPerBlock+r.ecCodewordsPerBlock}),e.length<a)return null;e=e.slice(0,a);for(var o=r.ecBlocks[0].dataCodewordsPerBlock,s=0;s<o;s++)for(var c=0,l=i;c<l.length;c++){var u=l[c];u.codewords.push(e.shift())}if(r.ecBlocks.length>1)for(var d=r.ecBlocks[0].numBlocks,f=r.ecBlocks[1].numBlocks,s=0;s<f;s++)i[d+s].codewords.push(e.shift());for(;e.length>0;)for(var p=0,m=i;p<m.length;p++){var u=m[p];u.codewords.push(e.shift())}return i}function g(e){var t=p(e);if(!t)return null;var n=m(e);if(!n)return null;var r=h(f(e,t,n),t,n.errorCorrectionLevel);if(!r)return null;for(var o=r.reduce(function(e,t){return e+t.numDataCodewords},0),s=new Uint8ClampedArray(o),c=0,l=0,u=r;l<u.length;l++){var d=u[l],g=a.decode(d.codewords,d.codewords.length-d.numDataCodewords);if(!g)return null;for(var _=0;_<d.numDataCodewords;_++)s[c++]=g[_]}try{return i.decode(s,t.versionNumber)}catch{return null}}function _(e){if(e==null)return null;var t=g(e);if(t)return t;for(var n=0;n<e.width;n++)for(var r=n+1;r<e.height;r++)e.get(n,r)!==e.get(r,n)&&(e.set(n,r,!e.get(n,r)),e.set(r,n,!e.get(r,n)));return g(e)}t.decode=_}),(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=n(8),a;(function(e){e.Numeric=`numeric`,e.Alphanumeric=`alphanumeric`,e.Byte=`byte`,e.Kanji=`kanji`,e.ECI=`eci`})(a=t.Mode||={});var o;(function(e){e[e.Terminator=0]=`Terminator`,e[e.Numeric=1]=`Numeric`,e[e.Alphanumeric=2]=`Alphanumeric`,e[e.Byte=4]=`Byte`,e[e.Kanji=8]=`Kanji`,e[e.ECI=7]=`ECI`})(o||={});function s(e,t){for(var n=[],r=``,i=[10,12,14][t],a=e.readBits(i);a>=3;){var o=e.readBits(10);if(o>=1e3)throw Error(`Invalid numeric value above 999`);var s=Math.floor(o/100),c=Math.floor(o/10)%10,l=o%10;n.push(48+s,48+c,48+l),r+=s.toString()+c.toString()+l.toString(),a-=3}if(a===2){var o=e.readBits(7);if(o>=100)throw Error(`Invalid numeric value above 99`);var s=Math.floor(o/10),c=o%10;n.push(48+s,48+c),r+=s.toString()+c.toString()}else if(a===1){var o=e.readBits(4);if(o>=10)throw Error(`Invalid numeric value above 9`);n.push(48+o),r+=o.toString()}return{bytes:n,text:r}}var c=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function l(e,t){for(var n=[],r=``,i=[9,11,13][t],a=e.readBits(i);a>=2;){var o=e.readBits(11),s=Math.floor(o/45),l=o%45;n.push(c[s].charCodeAt(0),c[l].charCodeAt(0)),r+=c[s]+c[l],a-=2}if(a===1){var s=e.readBits(6);n.push(c[s].charCodeAt(0)),r+=c[s]}return{bytes:n,text:r}}function u(e,t){for(var n=[],r=``,i=[8,16,16][t],a=e.readBits(i),o=0;o<a;o++){var s=e.readBits(8);n.push(s)}try{r+=decodeURIComponent(n.map(function(e){return`%`+(`0`+e.toString(16)).substr(-2)}).join(``))}catch{}return{bytes:n,text:r}}function d(e,t){for(var n=[],r=``,a=[8,10,12][t],o=e.readBits(a),s=0;s<o;s++){var c=e.readBits(13),l=Math.floor(c/192)<<8|c%192;l+=l<7936?33088:49472,n.push(l>>8,l&255),r+=String.fromCharCode(i.shiftJISTable[l])}return{bytes:n,text:r}}function f(e,t){for(var n,i,c,f,p=new r.BitStream(e),m=t<=9?0:t<=26?1:2,h={text:``,bytes:[],chunks:[],version:t};p.available()>=4;){var g=p.readBits(4);if(g===o.Terminator)return h;if(g===o.ECI)p.readBits(1)===0?h.chunks.push({type:a.ECI,assignmentNumber:p.readBits(7)}):p.readBits(1)===0?h.chunks.push({type:a.ECI,assignmentNumber:p.readBits(14)}):p.readBits(1)===0?h.chunks.push({type:a.ECI,assignmentNumber:p.readBits(21)}):h.chunks.push({type:a.ECI,assignmentNumber:-1});else if(g===o.Numeric){var _=s(p,m);h.text+=_.text,(n=h.bytes).push.apply(n,_.bytes),h.chunks.push({type:a.Numeric,text:_.text})}else if(g===o.Alphanumeric){var v=l(p,m);h.text+=v.text,(i=h.bytes).push.apply(i,v.bytes),h.chunks.push({type:a.Alphanumeric,text:v.text})}else if(g===o.Byte){var y=u(p,m);h.text+=y.text,(c=h.bytes).push.apply(c,y.bytes),h.chunks.push({type:a.Byte,bytes:y.bytes,text:y.text})}else if(g===o.Kanji){var b=d(p,m);h.text+=b.text,(f=h.bytes).push.apply(f,b.bytes),h.chunks.push({type:a.Kanji,bytes:b.bytes,text:b.text})}}if(p.available()===0||p.readBits(p.available())===0)return h}t.decode=f}),(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.BitStream=function(){function e(e){this.byteOffset=0,this.bitOffset=0,this.bytes=e}return e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw Error(`Cannot read `+e.toString()+` bits`);var t=0;if(this.bitOffset>0){var n=8-this.bitOffset,r=e<n?e:n,i=n-r,a=255>>8-r<<i;t=(this.bytes[this.byteOffset]&a)>>i,e-=r,this.bitOffset+=r,this.bitOffset===8&&(this.bitOffset=0,this.byteOffset++)}if(e>0){for(;e>=8;)t=t<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,e-=8;if(e>0){var i=8-e,a=255>>i<<i;t=t<<e|(this.bytes[this.byteOffset]&a)>>i,this.bitOffset+=e}}return t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}()}),(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35e3:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36e3:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37e3:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38e3:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39e3:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,4e4:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58e3:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59e3:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,6e4:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}}),(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n(2);function a(e,t,n,r){var i;t.degree()<n.degree()&&(i=[n,t],t=i[0],n=i[1]);for(var a=t,o=n,s=e.zero,c=e.one;o.degree()>=r/2;){var l=a,u=s;if(a=o,s=c,a.isZero())return null;o=l;for(var d=e.zero,f=a.getCoefficient(a.degree()),p=e.inverse(f);o.degree()>=a.degree()&&!o.isZero();){var m=o.degree()-a.degree(),h=e.multiply(o.getCoefficient(o.degree()),p);d=d.addOrSubtract(e.buildMonomial(m,h)),o=o.addOrSubtract(a.multiplyByMonomial(m,h))}if(c=d.multiplyPoly(s).addOrSubtract(u),o.degree()>=a.degree())return null}var g=c.getCoefficient(0);if(g===0)return null;var _=e.inverse(g);return[c.multiply(_),o.multiply(_)]}function o(e,t){var n=t.degree();if(n===1)return[t.getCoefficient(1)];for(var r=Array(n),i=0,a=1;a<e.size&&i<n;a++)t.evaluateAt(a)===0&&(r[i]=e.inverse(a),i++);return i===n?r:null}function s(e,t,n){for(var i=n.length,a=Array(i),o=0;o<i;o++){for(var s=e.inverse(n[o]),c=1,l=0;l<i;l++)o!==l&&(c=e.multiply(c,r.addOrSubtractGF(1,e.multiply(n[l],s))));a[o]=e.multiply(t.evaluateAt(s),e.inverse(c)),e.generatorBase!==0&&(a[o]=e.multiply(a[o],s))}return a}function c(e,t){var n=new Uint8ClampedArray(e.length);n.set(e);for(var c=new r.default(285,256,0),l=new i.default(c,n),u=new Uint8ClampedArray(t),d=!1,f=0;f<t;f++){var p=l.evaluateAt(c.exp(f+c.generatorBase));u[u.length-1-f]=p,p!==0&&(d=!0)}if(!d)return n;var m=new i.default(c,u),h=a(c,c.buildMonomial(t,1),m,t);if(h===null)return null;var g=o(c,h[0]);if(g==null)return null;for(var _=s(c,h[1],g),v=0;v<g.length;v++){var y=n.length-1-c.log(g[v]);if(y<0)return null;n[y]=r.addOrSubtractGF(n[y],_[v])}return n}t.decode=c}),(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.VERSIONS=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},{numBlocks:61,dataCodewordsPerBlock:16}]}]}]}),(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);function i(e,t,n,r){var i=e.x-t.x+n.x-r.x,a=e.y-t.y+n.y-r.y;if(i===0&&a===0)return{a11:t.x-e.x,a12:t.y-e.y,a13:0,a21:n.x-t.x,a22:n.y-t.y,a23:0,a31:e.x,a32:e.y,a33:1};var o=t.x-n.x,s=r.x-n.x,c=t.y-n.y,l=r.y-n.y,u=o*l-s*c,d=(i*l-s*a)/u,f=(o*a-i*c)/u;return{a11:t.x-e.x+d*t.x,a12:t.y-e.y+d*t.y,a13:d,a21:r.x-e.x+f*r.x,a22:r.y-e.y+f*r.y,a23:f,a31:e.x,a32:e.y,a33:1}}function a(e,t,n,r){var a=i(e,t,n,r);return{a11:a.a22*a.a33-a.a23*a.a32,a12:a.a13*a.a32-a.a12*a.a33,a13:a.a12*a.a23-a.a13*a.a22,a21:a.a23*a.a31-a.a21*a.a33,a22:a.a11*a.a33-a.a13*a.a31,a23:a.a13*a.a21-a.a11*a.a23,a31:a.a21*a.a32-a.a22*a.a31,a32:a.a12*a.a31-a.a11*a.a32,a33:a.a11*a.a22-a.a12*a.a21}}function o(e,t){return{a11:e.a11*t.a11+e.a21*t.a12+e.a31*t.a13,a12:e.a12*t.a11+e.a22*t.a12+e.a32*t.a13,a13:e.a13*t.a11+e.a23*t.a12+e.a33*t.a13,a21:e.a11*t.a21+e.a21*t.a22+e.a31*t.a23,a22:e.a12*t.a21+e.a22*t.a22+e.a32*t.a23,a23:e.a13*t.a21+e.a23*t.a22+e.a33*t.a23,a31:e.a11*t.a31+e.a21*t.a32+e.a31*t.a33,a32:e.a12*t.a31+e.a22*t.a32+e.a32*t.a33,a33:e.a13*t.a31+e.a23*t.a32+e.a33*t.a33}}function s(e,t){for(var n=a({x:3.5,y:3.5},{x:t.dimension-3.5,y:3.5},{x:t.dimension-6.5,y:t.dimension-6.5},{x:3.5,y:t.dimension-3.5}),s=o(i(t.topLeft,t.topRight,t.alignmentPattern,t.bottomLeft),n),c=r.BitMatrix.createEmpty(t.dimension,t.dimension),l=function(e,t){var n=s.a13*e+s.a23*t+s.a33;return{x:(s.a11*e+s.a21*t+s.a31)/n,y:(s.a12*e+s.a22*t+s.a32)/n}},u=0;u<t.dimension;u++)for(var d=0;d<t.dimension;d++){var f=l(d+.5,u+.5);c.set(d,u,e.get(Math.floor(f.x),Math.floor(f.y)))}return{matrix:c,mappingFunction:l}}t.extract=s}),(function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=4,i=.5,a=1.5,o=function(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)};function s(e){return e.reduce(function(e,t){return e+t})}function c(e,t,n){var r,i,a,s,c=o(e,t),l=o(t,n),u=o(e,n),d,f,p;return l>=c&&l>=u?(r=[t,e,n],d=r[0],f=r[1],p=r[2]):u>=l&&u>=c?(i=[e,t,n],d=i[0],f=i[1],p=i[2]):(a=[e,n,t],d=a[0],f=a[1],p=a[2]),(p.x-f.x)*(d.y-f.y)-(p.y-f.y)*(d.x-f.x)<0&&(s=[p,d],d=s[0],p=s[1]),{bottomLeft:d,topLeft:f,topRight:p}}function l(e,t,n,r){var i=(s(d(e,n,r,5))/7+s(d(e,t,r,5))/7+s(d(n,e,r,5))/7+s(d(t,e,r,5))/7)/4;if(i<1)throw Error(`Invalid module size`);var a=Math.round(o(e,t)/i),c=Math.round(o(e,n)/i),l=Math.floor((a+c)/2)+7;switch(l%4){case 0:l++;break;case 2:l--}return{dimension:l,moduleSize:i}}function u(e,t,n,r){var i=[{x:Math.floor(e.x),y:Math.floor(e.y)}],a=Math.abs(t.y-e.y)>Math.abs(t.x-e.x),s,c,l,u;a?(s=Math.floor(e.y),c=Math.floor(e.x),l=Math.floor(t.y),u=Math.floor(t.x)):(s=Math.floor(e.x),c=Math.floor(e.y),l=Math.floor(t.x),u=Math.floor(t.y));for(var d=Math.abs(l-s),f=Math.abs(u-c),p=Math.floor(-d/2),m=s<l?1:-1,h=c<u?1:-1,g=!0,_=s,v=c;_!==l+m;_+=m){var y=a?v:_,b=a?_:v;if(n.get(y,b)!==g&&(g=!g,i.push({x:y,y:b}),i.length===r+1))break;if(p+=f,p>0){if(v===u)break;v+=h,p-=d}}for(var x=[],S=0;S<r;S++)i[S]&&i[S+1]?x.push(o(i[S],i[S+1])):x.push(0);return x}function d(e,t,n,r){var i,a=t.y-e.y,o=t.x-e.x,s=u(e,t,n,Math.ceil(r/2)),c=u(e,{x:e.x-o,y:e.y-a},n,Math.ceil(r/2)),l=s.shift()+c.shift()-1;return(i=c.concat(l)).concat.apply(i,s)}function f(e,t){var n=s(e)/s(t),r=0;return t.forEach(function(t,i){r+=(e[i]-t*n)**2}),{averageSize:n,error:r}}function p(e,t,n){try{var r=d(e,{x:-1,y:e.y},n,t.length),i=d(e,{x:e.x,y:-1},n,t.length),a=d(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},n,t.length),o=d(e,{x:Math.min(n.width,e.x+e.y)+1,y:Math.min(n.height,e.y+e.x)+1},n,t.length),s=f(r,t),c=f(i,t),l=f(a,t),u=f(o,t),p=Math.sqrt(s.error*s.error+c.error*c.error+l.error*l.error+u.error*u.error),m=(s.averageSize+c.averageSize+l.averageSize+u.averageSize)/4;return p+((s.averageSize-m)**2+(c.averageSize-m)**2+(l.averageSize-m)**2+(u.averageSize-m)**2)/m}catch{return 1/0}}function m(e,t){for(var n=Math.round(t.x);e.get(n,Math.round(t.y));)n--;for(var r=Math.round(t.x);e.get(r,Math.round(t.y));)r++;for(var i=(n+r)/2,a=Math.round(t.y);e.get(Math.round(i),a);)a--;for(var o=Math.round(t.y);e.get(Math.round(i),o);)o++;return{x:i,y:(a+o)/2}}function h(e){for(var t=[],n=[],o=[],l=[],u=function(r){for(var c=0,u=!1,d=[0,0,0,0,0],f=function(t){var o=e.get(t,r);if(o===u)c++;else{d=[d[1],d[2],d[3],d[4],c],c=1,u=o;var f=s(d)/7,p=Math.abs(d[0]-f)<f&&Math.abs(d[1]-f)<f&&Math.abs(d[2]-3*f)<3*f&&Math.abs(d[3]-f)<f&&Math.abs(d[4]-f)<f&&!o,m=s(d.slice(-3))/3,h=Math.abs(d[2]-m)<m&&Math.abs(d[3]-m)<m&&Math.abs(d[4]-m)<m&&o;if(p){var g=t-d[3]-d[4],_=g-d[2],v={startX:_,endX:g,y:r},y=n.filter(function(e){return _>=e.bottom.startX&&_<=e.bottom.endX||g>=e.bottom.startX&&_<=e.bottom.endX||_<=e.bottom.startX&&g>=e.bottom.endX&&d[2]/(e.bottom.endX-e.bottom.startX)<a&&d[2]/(e.bottom.endX-e.bottom.startX)>i});y.length>0?y[0].bottom=v:n.push({top:v,bottom:v})}if(h){var b=t-d[4],x=b-d[3],v={startX:x,y:r,endX:b},y=l.filter(function(e){return x>=e.bottom.startX&&x<=e.bottom.endX||b>=e.bottom.startX&&x<=e.bottom.endX||x<=e.bottom.startX&&b>=e.bottom.endX&&d[2]/(e.bottom.endX-e.bottom.startX)<a&&d[2]/(e.bottom.endX-e.bottom.startX)>i});y.length>0?y[0].bottom=v:l.push({top:v,bottom:v})}}},p=-1;p<=e.width;p++)f(p);t.push.apply(t,n.filter(function(e){return e.bottom.y!==r&&e.bottom.y-e.top.y>=2})),n=n.filter(function(e){return e.bottom.y===r}),o.push.apply(o,l.filter(function(e){return e.bottom.y!==r})),l=l.filter(function(e){return e.bottom.y===r})},d=0;d<=e.height;d++)u(d);t.push.apply(t,n.filter(function(e){return e.bottom.y-e.top.y>=2})),o.push.apply(o,l);var f=t.filter(function(e){return e.bottom.y-e.top.y>=2}).map(function(t){var n=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,r=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.round(n),Math.round(r))){var i=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1],a=s(i)/i.length;return{score:p({x:Math.round(n),y:Math.round(r)},[1,1,3,1,1],e),x:n,y:r,size:a}}}).filter(function(e){return!!e}).sort(function(e,t){return e.score-t.score}).map(function(e,t,n){if(t>r)return null;var i=n.filter(function(e,n){return t!==n}).map(function(t){return{x:t.x,y:t.y,score:t.score+(t.size-e.size)**2/e.size,size:t.size}}).sort(function(e,t){return e.score-t.score});if(i.length<2)return null;var a=e.score+i[0].score+i[1].score;return{points:[e].concat(i.slice(0,2)),score:a}}).filter(function(e){return!!e}).sort(function(e,t){return e.score-t.score});if(f.length===0)return null;var h=c(f[0].points[0],f[0].points[1],f[0].points[2]),_=h.topRight,v=h.topLeft,y=h.bottomLeft,b=g(e,o,_,v,y),x=[];b&&x.push({alignmentPattern:{x:b.alignmentPattern.x,y:b.alignmentPattern.y},bottomLeft:{x:y.x,y:y.y},dimension:b.dimension,topLeft:{x:v.x,y:v.y},topRight:{x:_.x,y:_.y}});var S=m(e,_),C=m(e,v),w=m(e,y),T=g(e,o,S,C,w);return T&&x.push({alignmentPattern:{x:T.alignmentPattern.x,y:T.alignmentPattern.y},bottomLeft:{x:w.x,y:w.y},topLeft:{x:C.x,y:C.y},topRight:{x:S.x,y:S.y},dimension:T.dimension}),x.length===0?null:x}t.locate=h;function g(e,t,n,r,i){var a,c,u;try{a=l(r,n,i,e),c=a.dimension,u=a.moduleSize}catch{return null}var d={x:n.x-r.x+i.x,y:n.y-r.y+i.y},f=(o(r,i)+o(r,n))/2/u,m=1-3/f,h={x:r.x+m*(d.x-r.x),y:r.y+m*(d.y-r.y)},g=t.map(function(t){var n=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,r=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.floor(n),Math.floor(r))){var i=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1];return s(i)/i.length,{x:n,y:r,score:p({x:Math.floor(n),y:Math.floor(r)},[1,1,1],e)+o({x:n,y:r},h)}}}).filter(function(e){return!!e}).sort(function(e,t){return e.score-t.score});return{alignmentPattern:f>=15&&g.length?g[0]:h,dimension:c}}})]).default})}))()),Z1={key:0,class:`device-settings`,"aria-labelledby":`device-heading`},Q1={key:0,class:`fine-print`},$1={class:`device-pair-row`},e0={key:0,class:`device-scan`},t0={class:`account-actions`},n0={key:2,class:`account-message is-error`,role:`status`},r0={class:`device-actions`},i0={key:0,class:`device-invite`,role:`status`},a0=[`innerHTML`],o0={key:0,class:`fine-print device-expired-note`},s0={key:1,class:`fine-print`},c0={key:1,class:`account-device-list`},l0={class:`device-row`},u0={key:0,class:`device-audit`},d0=[`aria-label`],f0={key:0,class:`device-empty`},p0={key:1,class:`device-revoked`},m0={class:`device-row`},h0={key:0,class:`device-audit`},g0={"aria-label":`已解绑设备的记录`},_0=6048e5,v0=3e3,y0=EH({__name:`DeviceSettings`,setup(e){let{view:t,bridge:n}=Or(`discussion`),r=Q(()=>t.value.admin.local),i=Q(()=>!r.value&&t.value.launch.available&&t.value.launch.remote),a=Q(()=>t.value.device),o=I(null),s=I([]),c=I(``),l=I(``),u=I(``),d=I(!1),f=I(!1),p=I(null),m=I(null),h=I(!1),g=null;z(()=>a.value.pairing_code,e=>{e&&(u.value=e)},{immediate:!0});async function _(e,t,r=``){if(l.value)return!1;l.value=e;try{return await t(),r&&n.notify(`info`,r),!0}catch(e){return!e.cancelled&&!e.need&&n.notify(`error`,e.message),!1}finally{l.value=``}}function v(){if(r.value||i.value)return _(`list`,async()=>{let e=await n.device.request(`device-list`);o.value=e.devices,s.value=e.audit||[]})}aa(v),z(i,e=>{e&&v()});let y=Q(()=>o.value?.find(e=>e.current)),b=Q(()=>!r.value&&t.value.admin.devices&&!t.value.admin.logged_in),x=Q(()=>y.value&&!y.value.temporary&&y.value.expires_at-Date.now()<_0);async function S(){await _(`pair`,()=>n.device.pair(u.value))&&await v()}let C=I(!1),w=I(null),T=null;function E(){T?.getTracks().forEach(e=>e.stop()),T=null,C.value=!1}async function D(){try{T=await navigator.mediaDevices.getUserMedia({video:{facingMode:`environment`},audio:!1})}catch{n.notify(`error`,`无法打开相机:请允许本网站使用相机,或用系统相机扫码`);return}C.value=!0,await new Promise(requestAnimationFrame),w.value.srcObject=T,await w.value.play().catch(()=>{});let e=document.createElement(`canvas`),t=e.getContext(`2d`,{willReadFrequently:!0}),r=()=>{if(!C.value)return;let{videoWidth:i,videoHeight:a}=w.value;if(i&&a){Object.assign(e,{width:i,height:a}),t.drawImage(w.value,0,0,i,a);let r=(0,X1.default)(t.getImageData(0,0,i,a).data,i,a,{inversionAttempts:`dontInvert`}),o=r&&n.device.take_scanned(r.data);if(o)return E(),u.value=o,S()}requestAnimationFrame(r)};requestAnimationFrame(r)}function O(){return _(`invite`,async()=>{let e=await n.device.invite(d.value,f.value);p.value={...e,svg:e.url?Y1(e.url,{border:1}):``,expired:!1},k(o.value?.length||0)})}function k(e){clearInterval(g),g=setInterval(async()=>{if(!p.value)return clearInterval(g);if(Date.now()>=p.value.expires_at)return p.value={...p.value,expired:!0},clearInterval(g);try{let t=await n.device.request(`device-list`);o.value=t.devices,s.value=t.audit||[],t.devices.length>e&&(p.value=null,clearInterval(g),n.notify(`info`,`新设备已配对`))}catch{}},v0)}la(()=>{clearInterval(g),E()});function A(e){m.value=e,h.value=!0}let ee=Q(()=>m.value?.current?[`这台设备会立即退出,要再用须回到电脑前重新扫码配对。`,`已经在运行的工作和已改动的文件不会撤回。`]:[`该设备会立即无法访问房间,要再用须在电脑前重新扫码配对。`,`已经在运行的工作和已改动的文件不会撤回。`]);async function j(e){let t=await _(`revoke`,()=>n.device.request(`device-revoke`,{device_id:e.id}),e.current?`这台设备已解绑`:`该设备已解绑`);t&&e.current?n.device.forget():t&&await v()}let te={"device.paired":`配对了新设备`,"device.revoked":`解绑了设备`,"device.renewed":`设备续期`,"pairing.started":`生成了配对码`,"device.unlocked":`确认解锁`,"passkey.registered":`创建了通行密钥`,"write.granted":`开启远程可写`,"write.revoked":`撤销远程可写`},ne=e=>e?o.value?.find(t=>t.id===e)?.label||`已解绑的设备(${e.slice(0,6)})`:`电脑本机`;function M(e,t){let n=t?`${ne(e.device)} `:``;if(e.event===`command`)return`${n}远程执行 ${e.action}${e.route?` ${e.route}`:``}${e.status>=400?`(被拒绝)`:``}`;let r=e.event===`device.paired`&&e.temporary?`(临时)`:``;return`${n}${te[e.event]||e.event}${r}${e.room?` · ${se(e.room)}`:``}`}let re=Q(()=>s.value.filter(e=>e.event!==`pairing.started`)),ie=e=>re.value.filter(t=>t.device===e),ae=Q(()=>re.value.filter(e=>!o.value?.some(t=>t.id===e.device))),oe=e=>{c.value=c.value===e?``:e},se=e=>t.value.rooms?.find(t=>t.id===e)?.title||e,ce=e=>new Date(e).toLocaleString(`zh-CN`,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`});return(e,t)=>{let s=hV,g=bA,y=TH;return r.value||i.value||b.value||a.value.needs?(W(),G(`section`,Z1,[t[13]||=q(`h4`,{id:`device-heading`},`已配对的设备`,-1),b.value?X(``,!0):(W(),G(`p`,Q1,`新设备须在电脑前扫码配对。`)),b.value?(W(),G(`form`,{key:1,class:`dialog-form device-pair`,"aria-label":`配对这台设备`,onSubmit:_u(S,[`prevent`])},[t[8]||=q(`p`,{class:`fine-print`},`扫描电脑本机网页 设置 → 添加设备 的二维码,或输入配对码。`,-1),q(`div`,$1,[J(s,{modelValue:u.value,"onUpdate:modelValue":t[0]||=e=>u.value=e,placeholder:`XXXX-XXXX-XXXX`,autocomplete:`off`,maxlength:16,class:`w-full`,"aria-label":`配对码`},null,8,[`modelValue`]),J(g,{icon:`i-lucide-scan-line`,color:`neutral`,variant:`outline`,"aria-label":`扫码`,title:`扫码`,disabled:!!l.value,onClick:D},null,8,[`disabled`])]),C.value?(W(),G(`div`,e0,[q(`video`,{ref_key:`video`,ref:w,muted:``,playsinline:``,"aria-label":`相机画面`},null,512),J(g,{label:`取消`,color:`neutral`,variant:`soft`,size:`xs`,onClick:E})])):X(``,!0),q(`div`,t0,[J(g,{type:`submit`,label:`配对`,class:`channel-primary-button`,loading:l.value===`pair`,disabled:!!l.value||!u.value.trim()},null,8,[`loading`,`disabled`])])],32)):a.value.needs===`renew`?(W(),G(`p`,n0,[t[9]||=Y(` 这台设备的授权已到期。`,-1),J(g,{label:`用通行密钥续期`,color:`neutral`,variant:`soft`,size:`xs`,loading:l.value===`renew`,disabled:!!l.value,onClick:t[1]||=e=>{_(`renew`,async()=>{await L(n).device.renew(),await v()})}},null,8,[`loading`,`disabled`])])):(W(),G(U,{key:3},[q(`div`,r0,[i.value&&x.value?(W(),K(g,{key:0,label:`续期这台设备`,color:`neutral`,variant:`soft`,size:`sm`,loading:l.value===`renew`,disabled:!!l.value,onClick:t[2]||=e=>{_(`renew`,async()=>{await L(n).device.renew(),await v()})}},null,8,[`loading`,`disabled`])):X(``,!0),r.value?(W(),K(g,{key:1,label:`添加设备`,icon:`i-lucide-qr-code`,color:`neutral`,variant:`outline`,size:`sm`,loading:l.value===`invite`,disabled:!!l.value,onClick:O},null,8,[`loading`,`disabled`])):X(``,!0),r.value?(W(),K(y,{key:2,modelValue:f.value,"onUpdate:modelValue":t[3]||=e=>f.value=e,label:`允许不用通行密钥`},null,8,[`modelValue`])):X(``,!0),r.value?(W(),K(y,{key:3,modelValue:d.value,"onUpdate:modelValue":t[4]||=e=>d.value=e,label:`临时设备(只授权 1 天)`},null,8,[`modelValue`])):X(``,!0)]),p.value?(W(),G(`div`,i0,[p.value.svg?(W(),G(`div`,{key:0,class:N([`device-qr`,{"device-expired":p.value.expired}]),"aria-label":`配对二维码`,innerHTML:p.value.svg},null,10,a0)):X(``,!0),q(`div`,null,[t[10]||=q(`p`,null,`用新设备的相机扫描二维码;没有摄像头就在新设备打开网站,输入配对码:`,-1),q(`p`,{class:N([`device-code`,{"device-expired":p.value.expired}])},F(p.value.code),3),p.value.expired?(W(),G(`p`,o0,`已过期,不能再用。`)):(W(),G(`p`,s0,F(ce(p.value.expires_at))+` 前有效(2 分钟),只能用一次`+F(p.value.temporary?`;临时设备只授权 1 天`:``)+F(p.value.without_passkey?`;允许不用通行密钥`:``)+`。`,1)),J(g,{label:`重新生成`,icon:`i-lucide-refresh-cw`,color:`neutral`,variant:`outline`,size:`xs`,loading:l.value===`invite`,disabled:!!l.value,onClick:O},null,8,[`loading`,`disabled`])])])):X(``,!0),o.value?(W(),G(`ul`,c0,[(W(!0),G(U,null,V(o.value,e=>(W(),G(`li`,{key:e.id},[q(`div`,l0,[q(`span`,null,[q(`strong`,null,[Y(F(e.label),1),e.current?(W(),G(U,{key:0},[Y(` · 当前设备`)],64)):X(``,!0),e.temporary?(W(),G(U,{key:1},[Y(` · 临时`)],64)):X(``,!0)]),q(`small`,null,F(e.expires_at>Date.now()?`授权至 ${ce(e.expires_at)}`:`授权已到期`)+F(e.passkeys?``:` · 未创建通行密钥`),1)]),ie(e.id).length?(W(),K(g,{key:0,icon:`i-lucide-history`,color:c.value===e.id?`primary`:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`使用记录`,title:`使用记录`,"aria-expanded":c.value===e.id,onClick:t=>oe(e.id)},null,8,[`color`,`aria-expanded`,`onClick`])):X(``,!0),J(g,{icon:`i-lucide-unlink`,color:`error`,variant:`ghost`,size:`xs`,"aria-label":`解绑`,title:e.current?`解绑这台设备`:`解绑`,disabled:!!l.value,onClick:t=>A(e)},null,8,[`title`,`disabled`,`onClick`])]),c.value===e.id?(W(),G(`div`,u0,[q(`ul`,{"aria-label":`${e.label} 的记录`},[(W(!0),G(U,null,V(ie(e.id),(e,t)=>(W(),G(`li`,{key:t},[q(`small`,null,F(ce(e.at)),1),Y(` `+F(M(e,!1)),1)]))),128))],8,d0),t[11]||=q(`p`,{class:`fine-print`},`记录由电脑保存。看到不是你做的操作,立即解绑这台设备。`,-1)])):X(``,!0)]))),128)),o.value.length?X(``,!0):(W(),G(`li`,f0,`还没有配对的设备`)),ae.value.length?(W(),G(`li`,p0,[q(`div`,m0,[t[12]||=q(`span`,null,[q(`small`,null,`已解绑设备的记录`)],-1),J(g,{icon:`i-lucide-history`,color:c.value===`revoked`?`primary`:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`使用记录`,title:`使用记录`,"aria-expanded":c.value===`revoked`,onClick:t[5]||=e=>oe(`revoked`)},null,8,[`color`,`aria-expanded`])]),c.value===`revoked`?(W(),G(`div`,h0,[q(`ul`,g0,[(W(!0),G(U,null,V(ae.value,(e,t)=>(W(),G(`li`,{key:t},[q(`small`,null,F(ce(e.at)),1),Y(` `+F(M(e,!0)),1)]))),128))])])):X(``,!0)])):X(``,!0)])):X(``,!0),J(ZQ,{open:h.value,"onUpdate:open":t[6]||=e=>h.value=e,title:m.value?.current?`解绑这台设备`:`解绑「${m.value?.label||``}」`,items:ee.value,"confirm-label":`解绑`,danger:``,onConfirm:t[7]||=e=>j(m.value)},null,8,[`open`,`title`,`items`])],64))])):X(``,!0)}}},[[`__scopeId`,`data-v-016a40bb`]]),b0={class:`account-settings`,"aria-labelledby":`account-heading`},x0={key:0,class:`fine-print`,role:`status`},S0=[`aria-label`],C0={class:`fine-print account-intro`},w0={key:0,class:`account-message is-error`,role:`status`},T0={key:1,class:`fine-print`},E0={key:1,class:`fine-print`},D0={class:`account-actions`},O0={key:3,class:`account-profile`},k0={class:`account-identity`},A0={class:`account-avatar-actions`},j0={class:`account-name-row`},M0={class:`account-devices`,"aria-labelledby":`account-devices-heading`},N0={class:`account-device-list`},P0={class:`account-actions`},F0={class:`account-signout account-actions`},I0=EH({__name:`AccountSettings`,setup(e){let{view:t,bridge:n}=Or(`discussion`),r=Q(()=>t.value.admin),i=Q(()=>r.value.profile),a=Q(()=>r.value.loaded?r.value.devices?r.value.logged_in?`profile`:`unpaired`:r.value.registered?r.value.logged_in?`profile`:`login`:`register`:`loading`),o=I(``),s=nn({username:``,password:``,confirm:``,setup_key:``}),c=I(``),l=I(null),u=Q(()=>c.value.trim()!==(i.value?.username||``)),d=Q(()=>a.value===`register`&&!r.value.setup_available);z(()=>i.value?.username,e=>{c.value=e||``},{immediate:!0}),z(a,()=>{Object.assign(s,{password:``,confirm:``,setup_key:``})});async function f(e,t,r=``){if(o.value)return!1;o.value=e;try{return await t(),r&&n.notify(`info`,r),!0}catch(e){return n.notify(`error`,e.message),!1}finally{o.value=``}}function p(){let e=a.value===`register`;if(!(e&&d.value))return f(e?`register`:`login`,()=>e?n.admin.register({...s}):n.admin.login({...s}),e?`管理员账号已创建,并已登录。`:`已登录。`)}function m(){if(u.value)return f(`name`,()=>n.admin.update_profile({username:c.value}),`名称已更新。`)}async function h(e){let t=e.target.files?.[0];e.target.value=``,t&&await f(`avatar`,async()=>n.admin.update_profile({avatar:await n.admin.avatar_from_file(t)}),`头像已更新。`)}function g(){return f(`avatar`,()=>n.admin.update_profile({avatar:``}),`已恢复默认头像。`)}async function _(){await f(`logout`,()=>n.admin.logout(),`已退出登录。`)}let v=I(null);function y(){return f(`sessions`,async()=>{v.value=await n.admin.sessions()})}async function b(e,t){await f(`revoke`,()=>n.admin.revoke(e),t)&&await y()}let x=e=>n.device.label(e);function S(e){return new Date(e*1e3).toLocaleString(`zh-CN`,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}let C=nn({current_password:``,password:``,confirm:``});async function w(){await f(`password`,()=>n.admin.change_password({...C}),`密码已更改,其他设备已退出登录。`)&&(Object.assign(C,{current_password:``,password:``,confirm:``}),v.value&&await y())}return(e,t)=>{let f=hV,T=aV,E=bA,D=tA;return W(),G(`section`,b0,[t[16]||=q(`h3`,{id:`account-heading`},`账号`,-1),a.value===`loading`?(W(),G(`p`,x0,`正在读取账号状态…`)):a.value===`unpaired`?(W(),K(y0,{key:1})):a.value===`register`||a.value===`login`?(W(),G(`form`,{key:2,class:`dialog-form account-form`,"aria-label":a.value===`register`?`设置管理员账号`:`登录管理员账号`,onSubmit:_u(p,[`prevent`])},[q(`p`,C0,[a.value===`register`?(W(),G(U,{key:0},[Y(`设置站点管理员账号:名称和头像对所有访客可见,登录后可在没有房间凭据的浏览器中存档、恢复、删除房间。`)],64)):(W(),G(U,{key:1},[Y(`登录后可管理房间;未登录时仍可阅读并使用本浏览器创建的房间。`)],64))]),J(T,{label:`用户名`,description:a.value===`register`?`1–30 个字符,也是公开显示的名称`:void 0,required:``},{default:R(()=>[J(f,{modelValue:s.username,"onUpdate:modelValue":t[0]||=e=>s.username=e,autocomplete:`username`,maxlength:30,required:``,class:`w-full`,"aria-label":`用户名`},null,8,[`modelValue`])]),_:1},8,[`description`]),J(T,{label:`密码`,description:a.value===`register`?`8–128 个字符`:void 0,required:``},{default:R(()=>[J(f,{modelValue:s.password,"onUpdate:modelValue":t[1]||=e=>s.password=e,type:`password`,autocomplete:a.value===`register`?`new-password`:`current-password`,maxlength:128,required:``,class:`w-full`,"aria-label":`密码`},null,8,[`modelValue`,`autocomplete`])]),_:1},8,[`description`]),a.value===`register`?(W(),G(U,{key:0},[J(T,{label:`确认密码`,required:``},{default:R(()=>[J(f,{modelValue:s.confirm,"onUpdate:modelValue":t[2]||=e=>s.confirm=e,type:`password`,autocomplete:`new-password`,maxlength:128,required:``,class:`w-full`,"aria-label":`确认密码`},null,8,[`modelValue`])]),_:1}),J(T,{label:`注册令牌`,required:``},{default:R(()=>[J(f,{modelValue:s.setup_key,"onUpdate:modelValue":t[3]||=e=>s.setup_key=e,type:`password`,autocomplete:`off`,required:``,disabled:d.value,class:`w-full`,"aria-label":`注册令牌`},null,8,[`modelValue`,`disabled`])]),_:1}),d.value?(W(),G(`p`,w0,[...t[10]||=[Y(`尚无可用的注册令牌。请在部署网站的电脑上运行 `,-1),q(`code`,null,`codiscuss token`,-1),Y(`,再刷新本页;本地版也可设置环境变量 DISCUSS_ADMIN_SETUP_KEY 后重启。`,-1)]])):(W(),G(`p`,T0,[...t[11]||=[Y(`首个注册者需要令牌,防止他人抢注:在部署网站的电脑上运行 `,-1),q(`code`,null,`codiscuss token`,-1),Y(` 获取(一次性);本地版也可用服务端启动日志里的安装令牌。密码只由你自己保管,本机不保存。忘记密码:本地版运行 `,-1),q(`code`,null,`python server.py --reset-admin`,-1),Y(` 后重新注册;Cloudflare 版需清空管理员表(见部署文档)。`,-1)]]))],64)):(W(),G(`p`,E0,[...t[12]||=[Y(`忘记密码:本地版运行 `,-1),q(`code`,null,`python server.py --reset-admin`,-1),Y(` 后重新注册;Cloudflare 版需清空管理员表(见部署文档)。`,-1)]])),q(`div`,D0,[J(E,{type:`submit`,class:`channel-primary-button`,label:a.value===`register`?`创建并登录`:`登录`,loading:o.value===`register`||o.value===`login`,disabled:!!o.value||d.value},null,8,[`label`,`loading`,`disabled`])])],40,S0)):(W(),G(`div`,O0,[q(`div`,k0,[J(D,{src:L(n).identities.用户.icon,alt:`${L(n).display_name(`用户`)} 的头像`,size:`lg`,class:`channel-avatar user account-avatar`},null,8,[`src`,`alt`]),q(`div`,A0,[q(`input`,{ref_key:`avatar_input`,ref:l,type:`file`,accept:`image/*`,class:`account-file`,tabindex:`-1`,"aria-hidden":`true`,onChange:h},null,544),J(E,{label:`更换头像`,icon:`i-lucide-image-up`,color:`neutral`,variant:`outline`,size:`sm`,loading:o.value===`avatar`,disabled:!!o.value,onClick:t[4]||=e=>l.value.click()},null,8,[`loading`,`disabled`]),J(E,{label:`恢复默认头像`,color:`neutral`,variant:`ghost`,size:`sm`,disabled:!!o.value||!i.value?.avatar,onClick:g},null,8,[`disabled`])])]),q(`form`,{class:`dialog-form account-form`,"aria-label":`显示名称`,onSubmit:_u(m,[`prevent`])},[J(T,{label:`显示名称`,description:`即用户名,对所有访客可见`},{default:R(()=>[q(`div`,j0,[J(f,{modelValue:c.value,"onUpdate:modelValue":t[5]||=e=>c.value=e,autocomplete:`username`,maxlength:30,required:``,class:`w-full`,"aria-label":`显示名称`},null,8,[`modelValue`]),J(E,{type:`submit`,label:`保存名称`,color:`neutral`,variant:`soft`,loading:o.value===`name`,disabled:!!o.value||!u.value||!c.value.trim()},null,8,[`loading`,`disabled`])])]),_:1})],32),J(y0),!r.value.local&&!r.value.devices?(W(),G(U,{key:0},[q(`section`,M0,[t[13]||=q(`h4`,{id:`account-devices-heading`},`网站登录`,-1),t[14]||=q(`p`,{class:`fine-print`},`登录一周不用或满一个月会自动失效。看到不认识的登录时,退出它并更改密码。没有配对的设备即使登录了网站,也操作不了电脑。`,-1),v.value?(W(),G(U,{key:1},[q(`ul`,N0,[(W(!0),G(U,null,V(v.value,e=>(W(),G(`li`,{key:e.id},[q(`span`,null,[q(`strong`,null,F(x(e.label)),1),q(`small`,null,F(e.current?`当前设备`:`最近使用 ${S(e.last_seen)}`),1)]),e.current?X(``,!0):(W(),K(E,{key:0,label:`退出`,color:`neutral`,variant:`ghost`,size:`xs`,disabled:!!o.value,onClick:t=>b({id:e.id},`该设备已退出登录。`)},null,8,[`disabled`,`onClick`]))]))),128))]),v.value.length>1?(W(),K(E,{key:0,label:`退出其他所有设备`,color:`neutral`,variant:`outline`,size:`sm`,loading:o.value===`revoke`,disabled:!!o.value,onClick:t[6]||=e=>b({others:!0},`其他设备已全部退出登录。`)},null,8,[`loading`,`disabled`])):X(``,!0)],64)):(W(),K(E,{key:0,label:`查看网站登录`,color:`neutral`,variant:`soft`,size:`sm`,loading:o.value===`sessions`,disabled:!!o.value,onClick:y},null,8,[`loading`,`disabled`]))]),q(`form`,{class:`dialog-form account-form`,"aria-label":`更改密码`,onSubmit:_u(w,[`prevent`])},[t[15]||=q(`h4`,null,`更改密码`,-1),J(T,{label:`当前密码`,required:``},{default:R(()=>[J(f,{modelValue:C.current_password,"onUpdate:modelValue":t[7]||=e=>C.current_password=e,type:`password`,autocomplete:`current-password`,maxlength:128,required:``,class:`w-full`,"aria-label":`当前密码`},null,8,[`modelValue`])]),_:1}),J(T,{label:`新密码`,description:`8–128 个字符;更改后其他设备都会退出登录`,required:``},{default:R(()=>[J(f,{modelValue:C.password,"onUpdate:modelValue":t[8]||=e=>C.password=e,type:`password`,autocomplete:`new-password`,maxlength:128,required:``,class:`w-full`,"aria-label":`新密码`},null,8,[`modelValue`])]),_:1}),J(T,{label:`确认新密码`,required:``},{default:R(()=>[J(f,{modelValue:C.confirm,"onUpdate:modelValue":t[9]||=e=>C.confirm=e,type:`password`,autocomplete:`new-password`,maxlength:128,required:``,class:`w-full`,"aria-label":`确认新密码`},null,8,[`modelValue`])]),_:1}),q(`div`,P0,[J(E,{type:`submit`,label:`更改密码`,color:`neutral`,variant:`soft`,loading:o.value===`password`,disabled:!!o.value||!C.current_password||!C.password},null,8,[`loading`,`disabled`])])],32),q(`div`,F0,[J(E,{label:`退出登录`,icon:`i-lucide-log-out`,color:`neutral`,variant:`outline`,size:`sm`,loading:o.value===`logout`,disabled:!!o.value,onClick:_},null,8,[`loading`,`disabled`])])],64)):X(``,!0)]))])}}},[[`__scopeId`,`data-v-30c71857`]]),L0={slots:{base:[`relative group rounded-md inline-flex items-center disabled:cursor-not-allowed disabled:opacity-75`,`transition-colors`],leading:`absolute inset-y-0 start-0 flex items-center`,leadingIcon:`shrink-0 text-dimmed`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,trailing:`absolute inset-y-0 end-0 flex items-center`,trailingIcon:`shrink-0 text-dimmed`,value:`truncate pointer-events-none`,placeholder:`truncate text-dimmed`,arrow:`fill-bg stroke-default`,content:[`max-h-[min(15rem,var(--reka-select-content-available-height,15rem))] w-(--reka-select-trigger-width) bg-default shadow-lg rounded-md ring ring-default overflow-hidden origin-(--reka-select-content-transform-origin) pointer-events-auto data-[state=closed]:pointer-events-none! flex flex-col`,`max-h-[min(15rem,var(--reka-combobox-content-available-height,15rem))] origin-(--reka-combobox-content-transform-origin) w-(--reka-combobox-trigger-width)`],viewport:`relative scroll-py-1 overflow-y-auto flex-1`,group:`p-1 isolate`,empty:`text-center text-muted`,label:`font-semibold text-highlighted`,separator:`-mx-1 my-1 h-px bg-border`,item:[`group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50`,`transition-colors before:transition-colors`],itemLeadingIcon:[`shrink-0 text-dimmed group-data-highlighted:not-group-data-disabled:text-default`,`transition-colors`],itemLeadingAvatar:`shrink-0`,itemLeadingAvatarSize:``,itemLeadingChip:`shrink-0`,itemLeadingChipSize:``,itemTrailing:`ms-auto inline-flex gap-1.5 items-center`,itemTrailingIcon:`shrink-0`,itemWrapper:`flex-1 flex flex-col min-w-0`,itemLabel:`truncate`,itemDescription:`truncate text-muted`,input:`border-b border-default`,focusScope:`flex flex-col min-h-0`,trailingClear:`p-0`},variants:{fieldGroup:{horizontal:`not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]`,vertical:`not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]`},size:{xs:{base:`px-2 py-1 text-sm/4 gap-1`,leading:`ps-2`,trailing:`pe-2`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`,label:`p-1 text-[10px]/3 gap-1`,item:`p-1 text-xs gap-1`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailingIcon:`size-4`,empty:`p-2 text-xs`},sm:{base:`px-2.5 py-1.5 text-sm/4 gap-1.5`,leading:`ps-2.5`,trailing:`pe-2.5`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`,label:`p-1.5 text-[10px]/3 gap-1.5`,item:`p-1.5 text-xs gap-1.5`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailingIcon:`size-4`,empty:`p-2.5 text-xs`},md:{base:`px-2.5 py-1.5 text-base/5 gap-1.5`,leading:`ps-2.5`,trailing:`pe-2.5`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`,label:`p-1.5 text-xs gap-1.5`,item:`p-1.5 text-sm gap-1.5`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailingIcon:`size-5`,empty:`p-2.5 text-sm`},lg:{base:`px-3 py-2 text-base/5 gap-2`,leading:`ps-3`,trailing:`pe-3`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`,label:`p-2 text-xs gap-2`,item:`p-2 text-sm gap-2`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailingIcon:`size-5`,empty:`p-3 text-sm`},xl:{base:`px-3 py-2 text-base gap-2`,leading:`ps-3`,trailing:`pe-3`,leadingIcon:`size-6`,leadingAvatarSize:`xs`,trailingIcon:`size-6`,label:`p-2 text-sm gap-2`,item:`p-2 text-base gap-2`,itemLeadingIcon:`size-6`,itemLeadingAvatarSize:`xs`,itemLeadingChip:`size-6`,itemLeadingChipSize:`lg`,itemTrailingIcon:`size-6`,empty:`p-3 text-base`}},variant:{outline:`text-highlighted bg-default ring ring-inset ring-accented hover:bg-elevated disabled:bg-default`,soft:`text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50`,subtle:`text-highlighted bg-elevated ring ring-inset ring-accented hover:bg-accented/75 disabled:bg-elevated`,ghost:`text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent`,none:`text-highlighted bg-transparent focus:outline-none`},color:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},leading:{true:``},trailing:{true:``},loading:{true:``},highlight:{true:``},fixed:{false:``},type:{file:`file:me-1.5 file:font-medium file:text-muted file:outline-none`},position:{popper:{content:`data-[state=open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)]`},"item-aligned":{content:``}},multiple:{true:``},virtualize:{true:{viewport:`p-1 isolate`},false:{viewport:`divide-y divide-default`}}},compoundVariants:[{color:`primary`,variant:[`outline`,`subtle`],class:`outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary`},{color:`secondary`,variant:[`outline`,`subtle`],class:`outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary`},{color:`success`,variant:[`outline`,`subtle`],class:`outline-success/25 focus-visible:outline-3 focus-visible:ring-success`},{color:`info`,variant:[`outline`,`subtle`],class:`outline-info/25 focus-visible:outline-3 focus-visible:ring-info`},{color:`warning`,variant:[`outline`,`subtle`],class:`outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning`},{color:`error`,variant:[`outline`,`subtle`],class:`outline-error/25 focus-visible:outline-3 focus-visible:ring-error`},{color:`primary`,variant:[`soft`,`ghost`],class:`outline-primary/25 focus-visible:outline-3`},{color:`secondary`,variant:[`soft`,`ghost`],class:`outline-secondary/25 focus-visible:outline-3`},{color:`success`,variant:[`soft`,`ghost`],class:`outline-success/25 focus-visible:outline-3`},{color:`info`,variant:[`soft`,`ghost`],class:`outline-info/25 focus-visible:outline-3`},{color:`warning`,variant:[`soft`,`ghost`],class:`outline-warning/25 focus-visible:outline-3`},{color:`error`,variant:[`soft`,`ghost`],class:`outline-error/25 focus-visible:outline-3`},{color:`primary`,highlight:!0,class:`ring ring-inset ring-primary`},{color:`secondary`,highlight:!0,class:`ring ring-inset ring-secondary`},{color:`success`,highlight:!0,class:`ring ring-inset ring-success`},{color:`info`,highlight:!0,class:`ring ring-inset ring-info`},{color:`warning`,highlight:!0,class:`ring ring-inset ring-warning`},{color:`error`,highlight:!0,class:`ring ring-inset ring-error`},{color:`neutral`,variant:[`outline`,`subtle`],class:`outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted`},{color:`neutral`,variant:[`soft`,`ghost`],class:`outline-inverted/25 focus-visible:outline-3`},{color:`neutral`,highlight:!0,class:`ring ring-inset ring-inverted`},{leading:!0,size:`xs`,class:`ps-7`},{leading:!0,size:`sm`,class:`ps-8`},{leading:!0,size:`md`,class:`ps-9`},{leading:!0,size:`lg`,class:`ps-10`},{leading:!0,size:`xl`,class:`ps-11`},{trailing:!0,size:`xs`,class:`pe-7`},{trailing:!0,size:`sm`,class:`pe-8`},{trailing:!0,size:`md`,class:`pe-9`},{trailing:!0,size:`lg`,class:`pe-10`},{trailing:!0,size:`xl`,class:`pe-11`},{loading:!0,leading:!0,class:{leadingIcon:`animate-spin`}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:`animate-spin`}},{fixed:!1,size:`xs`,class:`md:text-xs`},{fixed:!1,size:`sm`,class:`md:text-xs`},{fixed:!1,size:`md`,class:`md:text-sm`},{fixed:!1,size:`lg`,class:`md:text-sm`}],defaultVariants:{size:`md`,color:`primary`,variant:`outline`,position:`popper`}},R0=Object.assign({inheritAttrs:!1},{__name:`SelectMenu`,props:Ha({id:{type:String,required:!1},placeholder:{type:String,required:!1},searchInput:{type:[Boolean,Object],required:!1,default:!0},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},clear:{type:[Boolean,Object],required:!1},clearIcon:{type:null,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},virtualize:{type:[Boolean,Object],required:!1,default:!1},valueKey:{type:null,required:!1},labelKey:{type:null,required:!1,default:`label`},descriptionKey:{type:null,required:!1,default:`description`},items:{type:null,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},multiple:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},createItem:{type:[Boolean,String,Object],required:!1},filterFields:{type:Array,required:!1},ignoreFilter:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},resetSearchTermOnBlur:{type:Boolean,required:!1,default:!0},resetSearchTermOnSelect:{type:Boolean,required:!1,default:!0},resetModelValueOnClear:{type:Boolean,required:!1,default:!0},highlightOnHover:{type:Boolean,required:!1},by:{type:[String,Function],required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},{searchTerm:{type:String,default:``},searchTermModifiers:{}}),emits:Ha([`change`,`blur`,`focus`,`create`,`clear`,`highlight`,`update:modelValue`,`update:open`],[`update:searchTerm`]),setup(e,{expose:t,emit:n}){let r=e,i=n,a=La(),o=AE(`selectMenu`,r),s=uo(e,`searchTerm`,{type:String,default:``}),{t:c}=ch(),l=Am(),{filterGroups:u}=WB(),d=jE(pm(o,`modelValue`,`defaultValue`,`open`,`defaultOpen`,`required`,`multiple`,`resetSearchTermOnBlur`,`resetSearchTermOnSelect`,`resetModelValueOnClear`,`highlightOnHover`,`by`),i),f=CE(kn(()=>o.portal)),p=kn(()=>Im(o.content,{side:`bottom`,sideOffset:8,collisionPadding:8,position:`popper`})),m=kn(()=>Im(o.arrow,{rounded:!0})),h=Q(()=>typeof o.clear==`object`?o.clear:{}),g=kn(()=>o.virtualize?Im(typeof o.virtualize==`boolean`?{}:o.virtualize,{estimateSize:fX(he.value,ie.value??`md`,o.descriptionKey,!!a[`item-description`])}):!1),_=kn(()=>Im(o.searchInput,{placeholder:c(`selectMenu.search`),variant:`none`,fixed:o.fixed})),{emitFormBlur:v,emitFormFocus:y,emitFormInput:b,emitFormChange:x,size:S,color:C,id:w,name:T,highlight:E,disabled:D,ariaAttrs:O}=pA(r),{orientation:k,size:A}=iA(r),{isLeading:ee,isTrailing:j,leadingIconName:te,trailingIconName:ne}=nA(Q(()=>({icon:o.icon,leading:o.leading,leadingIcon:o.leadingIcon,trailing:o.trailing,trailingIcon:o.trailingIcon??l.ui.icons.chevronDown,loading:o.loading,loadingIcon:o.loadingIcon}))),M=Q(()=>C.value??o.color),re=Q(()=>E.value??o.highlight),ie=Q(()=>A.value??S.value??o.size),ae=Q(()=>D.value??o.disabled),[oe,se]=wm(),[ce,le]=wm({props:{item:{type:[Object,String,Number,Boolean],required:!0},index:{type:Number,required:!1}}}),ue=Q(()=>Jk({extend:L0,...l.ui?.selectMenu||{}})({color:M.value,variant:o.variant,size:ie.value,loading:o.loading,highlight:re.value,fixed:o.fixed,leading:ee.value||!!o.avatar||!!a.leading,trailing:j.value||!!a.trailing,fieldGroup:k.value,virtualize:!!o.virtualize,multiple:o.multiple}));function de(e){if(o.multiple&&Array.isArray(e)){let t=e.map(e=>$m(pe.value,e,{labelKey:o.labelKey,valueKey:o.valueKey,by:o.by})).filter(e=>e!=null&&e!==``);return t.length>0?t.join(`, `):void 0}return $m(pe.value,e,{labelKey:o.labelKey,valueKey:o.valueKey,by:o.by})}let fe=Q(()=>o.items?.length?eh(o.items)?o.items:[o.items]:[]),pe=Q(()=>fe.value.flatMap(e=>e)),me=Q(()=>{if(o.ignoreFilter||!s.value)return fe.value;let e=Array.isArray(o.filterFields)?o.filterFields:[o.labelKey];return u(fe.value,s.value,{fields:e,isStructural:e=>Oe(e)&&!!e.type&&[`label`,`separator`].includes(e.type)})}),he=Q(()=>me.value.flatMap(e=>e)),ge=Q(()=>{if(!o.createItem||!s.value)return!1;let e=o.valueKey?{[o.valueKey]:s.value}:s.value;return typeof o.createItem==`object`&&o.createItem.when===`always`||o.createItem===`always`?!he.value.find(t=>Zm(t,e,o.by??o.valueKey)):!he.value.length}),_e=Q(()=>typeof o.createItem==`object`?o.createItem.position:`bottom`),ve=hi(`triggerRef`);function ye(){o.autofocus&&ve.value?.$el?.focus({focusVisible:!0})}let be;aa(()=>{be=setTimeout(()=>{ye()},o.autofocusDelay)}),Be(()=>clearTimeout(be));function xe(e){if(fn(o.modelValue)===e)return;o.modelModifiers?.trim&&(typeof e==`string`||e==null)&&(e=e?.trim()??null),o.modelModifiers?.number&&(e=Xm(e)),o.modelModifiers?.nullable&&(e??=null),o.modelModifiers?.optional&&!o.modelModifiers?.nullable&&e!==null&&(e??=void 0);let t=new Event(`change`,{target:{value:e}});i(`change`,t),x(),b(),o.resetSearchTermOnSelect&&(s.value=``)}let Se=I(!1),Ce;Be(()=>clearTimeout(Ce));function we(e){if(Se.value=e,e){let e=new FocusEvent(`focus`);i(`focus`,e),y(),clearTimeout(Ce)}else{let e=new FocusEvent(`blur`);i(`blur`,e),v(),o.resetSearchTermOnBlur&&(Ce=setTimeout(()=>{s.value=``},100))}}function Te(e){if(Se.value)return;let t=e.currentTarget;e.preventDefault(),t.click()}function Ee(e){e.preventDefault(),e.stopPropagation(),i(`create`,s.value)}function De(e,t){Oe(t)&&(t.disabled?e.preventDefault():t.onSelect?.(e))}function Oe(e){return typeof e==`object`&&!!e}function ke(e){return o.multiple&&Array.isArray(e)?e.length===0:e==null||e===``}function Ae(){ae.value||i(`clear`)}function je(e){_.value.autofocus===!1&&e.preventDefault()}function Me(e){let t=document.activeElement;t&&t!==document.body&&!e.target.contains(t)&&e.preventDefault()}let Ne=hi(`viewportRef`),Pe=hi(`comboboxRootRef`);return z(()=>o.items,async()=>{Se.value&&o.createItem&&(await ar(),Pe.value?.highlightFirstItem?.())},{flush:`post`}),t({triggerRef:kn(()=>ve.value?.$el),viewportRef:kn(()=>Ne.value)}),(e,t)=>(W(),G(U,null,[J(L(oe),null,{default:R(()=>[J(L($x),{"data-slot":`item`,class:N(ue.value.item({class:L(o).ui?.item})),value:s.value,onSelect:Ee},{default:R(()=>[q(`span`,{"data-slot":`itemLabel`,class:N(ue.value.itemLabel({class:L(o).ui?.itemLabel}))},[H(e.$slots,`create-item-label`,{item:s.value},()=>[Y(F(L(c)(`selectMenu.create`,{label:s.value})),1)])],2)]),_:3},8,[`class`,`value`])]),_:3}),J(L(ce),null,{default:R(({item:t,index:n})=>[Oe(t)&&t.type===`label`?(W(),K(L(tS),{key:0,"data-slot":`label`,class:N(ue.value.label({class:[L(o).ui?.label,t.ui?.label,t.class]}))},{default:R(()=>[Y(F(L(Ym)(t,L(o).labelKey)),1)]),_:2},1032,[`class`])):Oe(t)&&t.type===`separator`?(W(),K(L(rS),{key:1,"data-slot":`separator`,class:N(ue.value.separator({class:[L(o).ui?.separator,t.ui?.separator,t.class]}))},null,8,[`class`])):(W(),K(L($x),{key:2,"data-slot":`item`,class:N(ue.value.item({class:[L(o).ui?.item,Oe(t)&&t.ui?.item,Oe(t)&&t.class]})),disabled:Oe(t)&&t.disabled,value:L(o).valueKey&&Oe(t)?L(Ym)(t,L(o).valueKey):t,onSelect:e=>De(e,t)},{default:R(()=>[H(e.$slots,`item`,{item:t,index:n,ui:ue.value},()=>[H(e.$slots,`item-leading`,{item:t,index:n,ui:ue.value},()=>[Oe(t)&&t.icon?(W(),K(Yk,{key:0,name:t.icon,"data-slot":`itemLeadingIcon`,class:N(ue.value.itemLeadingIcon({class:[L(o).ui?.itemLeadingIcon,t.ui?.itemLeadingIcon]}))},null,8,[`name`,`class`])):Oe(t)&&t.avatar?(W(),K(tA,Z({key:1,size:t.ui?.itemLeadingAvatarSize||L(o).ui?.itemLeadingAvatarSize||ue.value.itemLeadingAvatarSize()},t.avatar,{"data-slot":`itemLeadingAvatar`,class:ue.value.itemLeadingAvatar({class:[L(o).ui?.itemLeadingAvatar,t.ui?.itemLeadingAvatar]})}),null,16,[`size`,`class`])):Oe(t)&&t.chip?(W(),K($k,Z({key:2,size:t.ui?.itemLeadingChipSize||L(o).ui?.itemLeadingChipSize||ue.value.itemLeadingChipSize(),inset:``,standalone:``},t.chip,{"data-slot":`itemLeadingChip`,class:ue.value.itemLeadingChip({class:[L(o).ui?.itemLeadingChip,t.ui?.itemLeadingChip]})}),null,16,[`size`,`class`])):X(``,!0)]),q(`span`,{"data-slot":`itemWrapper`,class:N(ue.value.itemWrapper({class:[L(o).ui?.itemWrapper,Oe(t)&&t.ui?.itemWrapper]}))},[q(`span`,{"data-slot":`itemLabel`,class:N(ue.value.itemLabel({class:[L(o).ui?.itemLabel,Oe(t)&&t.ui?.itemLabel]}))},[H(e.$slots,`item-label`,{item:t,index:n},()=>[Y(F(Oe(t)?L(Ym)(t,L(o).labelKey):t),1)])],2),Oe(t)&&(L(Ym)(t,L(o).descriptionKey)||a[`item-description`])?(W(),G(`span`,{key:0,"data-slot":`itemDescription`,class:N(ue.value.itemDescription({class:[L(o).ui?.itemDescription,Oe(t)&&t.ui?.itemDescription]}))},[H(e.$slots,`item-description`,{item:t,index:n},()=>[Y(F(L(Ym)(t,L(o).descriptionKey)),1)])],2)):X(``,!0)],2),q(`span`,{"data-slot":`itemTrailing`,class:N(ue.value.itemTrailing({class:[L(o).ui?.itemTrailing,Oe(t)&&t.ui?.itemTrailing]}))},[H(e.$slots,`item-trailing`,{item:t,index:n,ui:ue.value}),J(L(eS),{"as-child":``},{default:R(()=>[J(Yk,{name:L(o).selectedIcon||L(l).ui.icons.check,"data-slot":`itemTrailingIcon`,class:N(ue.value.itemTrailingIcon({class:[L(o).ui?.itemTrailingIcon,Oe(t)&&t.ui?.itemTrailingIcon]}))},null,8,[`name`,`class`])]),_:2},1024)],2)])]),_:2},1032,[`class`,`disabled`,`value`,`onSelect`]))]),_:3}),J(L(Ix),Z({ref_key:`comboboxRootRef`,ref:Pe},L(d),{"ignore-filter":``,"as-child":``,name:L(T),disabled:ae.value,"onUpdate:modelValue":xe,"onUpdate:open":we}),{default:R(({modelValue:n,open:r})=>[J(L(Vx),{"as-child":``},{default:R(()=>[J(L(iS),Z({id:L(w),ref_key:`triggerRef`,ref:ve,"data-slot":`base`,class:ue.value.base({class:[L(o).ui?.base,L(o).class]}),tabindex:`0`},{"aria-label":void 0,...e.$attrs,...L(O)},{onKeydown:[yu(Te,[`down`]),yu(Te,[`up`])]}),{default:R(()=>[L(ee)||L(o).avatar||a.leading?(W(),G(`span`,{key:0,"data-slot":`leading`,class:N(ue.value.leading({class:L(o).ui?.leading}))},[H(e.$slots,`leading`,{modelValue:n,open:r,ui:ue.value},()=>[L(ee)&&L(te)?(W(),K(Yk,{key:0,name:L(te),"data-slot":`leadingIcon`,class:N(ue.value.leadingIcon({class:L(o).ui?.leadingIcon}))},null,8,[`name`,`class`])):L(o).avatar?(W(),K(tA,Z({key:1,size:L(o).ui?.itemLeadingAvatarSize||ue.value.itemLeadingAvatarSize()},L(o).avatar,{"data-slot":`itemLeadingAvatar`,class:ue.value.itemLeadingAvatar({class:L(o).ui?.itemLeadingAvatar})}),null,16,[`size`,`class`])):X(``,!0)])],2)):X(``,!0),H(e.$slots,`default`,{modelValue:n,open:r,ui:ue.value},()=>[(W(!0),G(U,null,V([de(n)],e=>(W(),G(U,{key:e},[e==null?(W(),G(`span`,{key:1,"data-slot":`placeholder`,class:N(ue.value.placeholder({class:L(o).ui?.placeholder}))},F(L(o).placeholder??`\xA0`),3)):(W(),G(`span`,{key:0,"data-slot":`value`,class:N(ue.value.value({class:L(o).ui?.value}))},F(e),3))],64))),128))]),L(j)||a.trailing||L(o).clear?(W(),G(`span`,{key:1,"data-slot":`trailing`,class:N(ue.value.trailing({class:L(o).ui?.trailing}))},[H(e.$slots,`trailing`,{modelValue:n,open:r,ui:ue.value},()=>[L(o).clear&&!ae.value&&!ke(n)?(W(),K(L(Kx),{key:0,"as-child":``},{default:R(()=>[J(bA,Z({as:`span`,icon:L(o).clearIcon||L(l).ui.icons.close,size:ie.value,variant:`link`,color:`neutral`,tabindex:`-1`},h.value,{"data-slot":`trailingClear`,class:ue.value.trailingClear({class:L(o).ui?.trailingClear}),onClick:_u(Ae,[`stop`])}),null,16,[`icon`,`size`,`class`])]),_:1})):L(ne)?(W(),K(Yk,{key:1,name:L(ne),"data-slot":`trailingIcon`,class:N(ue.value.trailingIcon({class:L(o).ui?.trailingIcon}))},null,8,[`name`,`class`])):X(``,!0)])],2)):X(``,!0)]),_:2},1040,[`id`,`class`])]),_:2},1024),J(L(nS),P(ks(L(f))),{default:R(()=>[J(L(aA),null,{default:R(()=>[J(L(qx),Z({"data-slot":`content`,class:ue.value.content({class:L(o).ui?.content})},p.value),{default:R(()=>[J(L(R_),{loop:``,"data-slot":`focusScope`,class:N(ue.value.focusScope({class:L(o).ui?.focusScope})),onMountAutoFocus:je,onUnmountAutoFocus:Me},{default:R(()=>[H(e.$slots,`content-top`),L(o).searchInput?(W(),K(L(Qx),{key:0,modelValue:s.value,"onUpdate:modelValue":t[1]||=e=>s.value=e,"display-value":()=>s.value,"as-child":``},{default:R(()=>[J(hV,Z({autofocus:``,autocomplete:`off`,size:ie.value},_.value,{"model-modifiers":{trim:L(o).modelModifiers?.trim},"data-slot":`input`,class:ue.value.input({class:L(o).ui?.input}),onChange:t[0]||=_u(()=>{},[`stop`])}),null,16,[`size`,`model-modifiers`,`class`])]),_:1},8,[`modelValue`,`display-value`])):X(``,!0),J(L(Jx),{"data-slot":`empty`,class:N(ue.value.empty({class:L(o).ui?.empty}))},{default:R(()=>[H(e.$slots,`empty`,{searchTerm:s.value},()=>[Y(F(s.value?L(c)(`selectMenu.noMatch`,{searchTerm:s.value}):L(c)(`selectMenu.noData`)),1)])]),_:3},8,[`class`]),q(`div`,{ref_key:`viewportRef`,ref:Ne,role:`presentation`,"data-slot":`viewport`,class:N(ue.value.viewport({class:L(o).ui?.viewport}))},[L(o).virtualize?(W(),G(U,{key:0},[ge.value&&_e.value===`top`?(W(),K(L(se),{key:0})):X(``,!0),J(L(sS),Z({options:he.value,"text-content":e=>Oe(e)?L(Ym)(e,L(o).labelKey):String(e)},g.value),{default:R(({option:e,virtualItem:t})=>[J(L(le),{item:e,index:t.index},null,8,[`item`,`index`])]),_:1},16,[`options`,`text-content`]),ge.value&&_e.value===`bottom`?(W(),K(L(se),{key:1})):X(``,!0)],64)):(W(),G(U,{key:1},[ge.value&&_e.value===`top`?(W(),K(L(Zx),{key:0,"data-slot":`group`,class:N(ue.value.group({class:L(o).ui?.group}))},{default:R(()=>[J(L(se))]),_:1},8,[`class`])):X(``,!0),(W(!0),G(U,null,V(me.value,(e,t)=>(W(),K(L(Zx),{key:`group-${t}`,"data-slot":`group`,class:N(ue.value.group({class:L(o).ui?.group}))},{default:R(()=>[(W(!0),G(U,null,V(e,(e,n)=>(W(),K(L(le),{key:`group-${t}-${n}`,item:e,index:n},null,8,[`item`,`index`]))),128))]),_:2},1032,[`class`]))),128)),ge.value&&_e.value===`bottom`?(W(),K(L(Zx),{key:1,"data-slot":`group`,class:N(ue.value.group({class:L(o).ui?.group}))},{default:R(()=>[J(L(se))]),_:1},8,[`class`])):X(``,!0)],64))],2),H(e.$slots,`content-bottom`)]),_:3},8,[`class`]),L(o).arrow?(W(),K(L(Gx),Z({key:0},m.value,{"data-slot":`arrow`,class:ue.value.arrow({class:L(o).ui?.arrow})}),null,16,[`class`])):X(``,!0)]),_:3},16,[`class`])]),_:3})]),_:3},16)]),_:3},16,[`name`,`disabled`])],64))}}),z0={class:`channel-reading-setting`},B0=[`aria-expanded`],V0={class:`speech-settings`},H0={key:0,class:`fine-print`},U0={class:`speech-row`},W0={class:`speech-rates`,role:`group`,"aria-label":`朗读语音服务`},G0=[`title`],K0=[`href`],q0={class:`speech-row`},J0={class:`speech-row`},Y0={class:`speech-row`},X0={class:`speech-inline`},Z0={class:`speech-row`},Q0={class:`speech-inline`},$0=[`title`],e2={class:`speech-inline`},t2={class:`speech-row`},n2={class:`speech-rates`,role:`group`,"aria-label":`朗读语速`},r2={class:`speech-row`},i2={class:`speech-row`},a2={key:2,class:`fine-print`},o2=`••••••••••••`,s2=`你好,我会用这个声音为你朗读房间里的消息。`,c2=`volcengine`,l2=`:file`,u2=EH({__name:`SpeechSettings`,setup(e){let{bridge:t}=Or(`discussion`),n=[{value:-20,label:`0.8×`},{value:0,label:`1×`},{value:20,label:`1.2×`},{value:50,label:`1.5×`},{value:100,label:`2×`}],r=nn({provider:`volcengine`,speech_rate:0,context:``,providers:{},catalog:[],api_key_ref:``}),i=Object.keys(t.launch_clients).map(e=>({name:e,label:t.identities[e]?.label||e})),a=I(!1),o=I(``),s=I(``),c=nn({}),l=nn({}),u=I(!1),d=Q(()=>r.catalog.find(e=>e.id===r.provider)||{}),f=Q(()=>r.providers[r.provider]||{member_voices:{}}),p=Q(()=>o.value?`需连接本机服务`:a.value?r.api_key_ref?`已配置 · ${d.value.label} · ${_.value.find(e=>e.value===f.value.speaker)?.label||f.value.speaker}`:`${d.value.label} · 未配置`:`读取中…`),m=Q(()=>r.provider===c2?null:r.catalog.find(e=>e.id===c2));aa(async()=>{try{Object.assign(r,await t.local_request(`tts-settings`,{})),a.value=!0}catch(e){o.value=e.message}});async function h(){let{provider:e,speech_rate:n,context:i,providers:a}=r;try{Object.assign(r,await t.local_request(`tts-settings`,{provider:e,speech_rate:n,context:i,providers:a}))}catch(e){t.notify(`error`,e.message)}}function g(e){e!==r.provider&&(r.provider=e,h())}let _=Q(()=>{let e=(d.value.voices||[]).map(e=>({label:e.label,value:e.id})),t=[f.value.speaker,f.value.file_voice,...Object.values(f.value.member_voices||{})].filter(t=>t&&!e.some(e=>e.value===t));return[...e,...[...new Set(t)].map(e=>({label:e,value:e}))]}),v=Q(()=>[{label:`跟随通用`,value:``},..._.value]),y=e=>(e===l2?f.value.file_voice:e?f.value.member_voices[e]:``)||f.value.speaker;function b(e,t){let n=String(t||``).trim(),r=f.value;e===l2?r.file_voice=n:e?r.member_voices={...r.member_voices,[e]:n}:n&&(r.speaker=n),h()}async function x(e){let n=String(c[e.id]||``).trim();if(n&&!s.value){s.value=`key:${e.id}`;try{let{api_key_ref:i}=await t.local_request(`api-key`,{base_url:e.key_base_url,api_key:n});r.providers[e.id].api_key_ref=i,c[e.id]=``,await h()}catch(e){t.notify(`error`,e.message)}finally{s.value=``}}}async function S(e){let n=new Audio;n.play().catch(()=>{}),s.value=`preview:${e}`;try{let r=y(e),{audio:i}=await t.local_request(`tts`,{text:s2,speaker:r});n.src=URL.createObjectURL(new Blob([Uint8Array.from(atob(i),e=>e.charCodeAt(0))],{type:`audio/mpeg`})),n.onended=()=>URL.revokeObjectURL(n.src),await n.play()}catch(e){t.notify(`error`,e.message)}finally{s.value=``}}return(e,t)=>{let y=Yk,C=bA,w=hV,T=R0,E=CY;return W(),G(`section`,z0,[J(E,{open:u.value,"onUpdate:open":t[14]||=e=>u.value=e},{content:R(()=>[q(`div`,V0,[o.value?(W(),G(`p`,H0,`语音由这台电脑的本机服务调用语音服务,需要连接本机服务或已配对电脑:`+F(o.value),1)):a.value?(W(),G(U,{key:1},[t[25]||=q(`h4`,null,`朗读`,-1),q(`div`,U0,[t[17]||=q(`span`,null,`服务`,-1),q(`div`,W0,[(W(!0),G(U,null,V(r.catalog,e=>(W(),K(C,{key:e.id,label:e.label,color:`neutral`,variant:`ghost`,size:`xs`,class:N({chosen:r.provider===e.id}),"aria-pressed":r.provider===e.id,onClick:t=>g(e.id)},null,8,[`label`,`class`,`aria-pressed`,`onClick`]))),128))])]),q(`p`,{class:`fine-print speech-note`,title:d.value.note},[Y(F(d.value.note)+` · `,1),q(`a`,{href:d.value.console_url,target:`_blank`,rel:`noopener`},`控制台`,8,K0)],8,G0),q(`label`,q0,[t[18]||=q(`span`,null,`密钥`,-1),J(w,{modelValue:c[d.value.id],"onUpdate:modelValue":t[1]||=e=>c[d.value.id]=e,type:`text`,autocomplete:`off`,spellcheck:`false`,"data-1p-ignore":``,"data-lpignore":`true`,placeholder:f.value.api_key_ref?o2:`粘贴 API Key,只存这台电脑`,title:f.value.api_key_ref&&!c[d.value.id]?`已保存;本机不回传密钥,输入新 Key 可更换`:void 0,"aria-label":`${d.value.label} API Key`,size:`sm`,class:`w-full`,loading:s.value===`key:${d.value.id}`,ui:{base:l[d.value.id]?``:`speech-key-masked`,trailing:`pe-0.5`},onChange:t[2]||=e=>x(d.value)},{trailing:R(()=>[J(C,{icon:l[d.value.id]?`i-lucide-eye`:`i-lucide-eye-off`,disabled:!c[d.value.id],"aria-label":l[d.value.id]?`隐藏密钥`:`显示密钥`,"aria-pressed":!!l[d.value.id],size:`xs`,color:`neutral`,variant:`link`,onClick:t[0]||=e=>l[d.value.id]=!l[d.value.id]},null,8,[`icon`,`disabled`,`aria-label`,`aria-pressed`])]),_:1},8,[`modelValue`,`placeholder`,`title`,`aria-label`,`loading`,`ui`])]),q(`label`,J0,[t[19]||=q(`span`,null,`区域`,-1),d.value.region?(W(),K(w,{key:0,modelValue:f.value.region,"onUpdate:modelValue":t[3]||=e=>f.value.region=e,placeholder:`语音资源所在区域,如 eastasia`,"aria-label":`Azure 区域`,size:`sm`,class:`w-full`,onChange:h},null,8,[`modelValue`])):(W(),K(w,{key:1,disabled:``,placeholder:`此服务无需区域`,"aria-label":`区域`,size:`sm`,class:`w-full`}))]),q(`div`,Y0,[t[20]||=q(`span`,null,`通用`,-1),q(`div`,X0,[J(T,{"model-value":f.value.speaker,items:_.value,"value-key":`value`,"create-item":``,"search-input":{placeholder:`搜索或输入音色 ID`},"aria-label":`通用音色`,size:`sm`,class:`min-w-0 flex-1`,"onUpdate:modelValue":t[4]||=e=>b(``,e),onCreate:t[5]||=e=>b(``,e)},null,8,[`model-value`,`items`]),J(C,{icon:`i-lucide-volume-2`,"aria-label":`试听通用音色`,color:`neutral`,variant:`ghost`,size:`sm`,loading:s.value===`preview:`,disabled:!r.api_key_ref||!!s.value,onClick:t[6]||=e=>S(``)},null,8,[`loading`,`disabled`])])]),q(`div`,Z0,[t[21]||=q(`span`,null,`文件`,-1),q(`div`,Q0,[J(T,{"model-value":f.value.file_voice||``,items:v.value,"value-key":`value`,"create-item":``,"search-input":{placeholder:`搜索或输入音色 ID`},"aria-label":`朗读文件的音色`,size:`sm`,class:`min-w-0 flex-1`,"onUpdate:modelValue":t[7]||=e=>b(l2,e),onCreate:t[8]||=e=>b(l2,e)},null,8,[`model-value`,`items`]),J(C,{icon:`i-lucide-volume-2`,"aria-label":`试听朗读文件的音色`,color:`neutral`,variant:`ghost`,size:`sm`,loading:s.value===`preview:${l2}`,disabled:!r.api_key_ref||!!s.value,onClick:t[9]||=e=>S(l2)},null,8,[`loading`,`disabled`])])]),(W(!0),G(U,null,V(L(i),e=>(W(),G(`div`,{key:e.name,class:`speech-row`},[q(`span`,{title:e.label},F(e.label),9,$0),q(`div`,e2,[J(T,{"model-value":f.value.member_voices[e.name]||``,items:v.value,"value-key":`value`,"create-item":``,"search-input":{placeholder:`搜索或输入音色 ID`},"aria-label":`${e.label} 的音色`,size:`sm`,class:`min-w-0 flex-1`,"onUpdate:modelValue":t=>b(e.name,t),onCreate:t=>b(e.name,t)},null,8,[`model-value`,`items`,`aria-label`,`onUpdate:modelValue`,`onCreate`]),J(C,{icon:`i-lucide-volume-2`,"aria-label":`试听 ${e.label} 的音色`,color:`neutral`,variant:`ghost`,size:`sm`,loading:s.value===`preview:${e.name}`,disabled:!r.api_key_ref||!!s.value,onClick:t=>S(e.name)},null,8,[`aria-label`,`loading`,`disabled`,`onClick`])])]))),128)),t[26]||=q(`p`,{class:`fine-print speech-note`},`未单独设置的 AI 与其他消息用通用音色`,-1),q(`div`,t2,[t[22]||=q(`span`,null,`语速`,-1),q(`div`,n2,[(W(),G(U,null,V(n,e=>J(C,{key:e.value,label:e.label,color:`neutral`,variant:`ghost`,size:`xs`,class:N({chosen:r.speech_rate===e.value}),"aria-pressed":r.speech_rate===e.value,onClick:t=>{r.speech_rate=e.value,h()}},null,8,[`label`,`class`,`aria-pressed`,`onClick`])),64))])]),q(`label`,r2,[t[23]||=q(`span`,null,`语气`,-1),d.value.context?(W(),K(w,{key:0,modelValue:r.context,"onUpdate:modelValue":t[10]||=e=>r.context=e,maxlength:200,placeholder:`可选,如:像朋友聊天一样自然地读`,"aria-label":`朗读语气提示`,size:`sm`,class:`w-full`,onChange:h},null,8,[`modelValue`])):(W(),K(w,{key:1,disabled:``,placeholder:`当前接入不支持自定义语气`,"aria-label":`朗读语气提示`,size:`sm`,class:`w-full`}))]),t[27]||=q(`p`,{class:`fine-print speech-note`},`输入框右下角的播报按钮自动读新回复摘要`,-1),t[28]||=q(`h4`,null,`语音输入`,-1),t[29]||=q(`p`,{class:`fine-print speech-note`},`用火山引擎识别,单次最长 5 分钟`,-1),q(`label`,i2,[t[24]||=q(`span`,null,`密钥`,-1),m.value?(W(),K(w,{key:0,modelValue:c[m.value.id],"onUpdate:modelValue":t[12]||=e=>c[m.value.id]=e,type:`text`,autocomplete:`off`,spellcheck:`false`,"data-1p-ignore":``,"data-lpignore":`true`,placeholder:r.providers[m.value.id]?.api_key_ref?o2:`粘贴火山引擎 API Key`,title:r.providers[m.value.id]?.api_key_ref&&!c[m.value.id]?`已保存;本机不回传密钥,输入新 Key 可更换`:void 0,"aria-label":`语音输入的火山引擎 API Key`,size:`sm`,class:`w-full`,loading:s.value===`key:${m.value.id}`,ui:{base:l[m.value.id]?``:`speech-key-masked`,trailing:`pe-0.5`},onChange:t[13]||=e=>x(m.value)},{trailing:R(()=>[J(C,{icon:l[m.value.id]?`i-lucide-eye`:`i-lucide-eye-off`,disabled:!c[m.value.id],"aria-label":l[m.value.id]?`隐藏密钥`:`显示密钥`,"aria-pressed":!!l[m.value.id],size:`xs`,color:`neutral`,variant:`link`,onClick:t[11]||=e=>l[m.value.id]=!l[m.value.id]},null,8,[`icon`,`disabled`,`aria-label`,`aria-pressed`])]),_:1},8,[`modelValue`,`placeholder`,`title`,`loading`,`ui`])):(W(),K(w,{key:1,disabled:``,placeholder:`与朗读共用上方的火山引擎 Key`,"aria-label":`语音输入的火山引擎 API Key`,size:`sm`,class:`w-full`}))])],64)):(W(),G(`p`,a2,`正在读取语音设置…`))])]),default:R(()=>[q(`button`,{type:`button`,class:`speech-header`,"aria-expanded":u.value},[t[15]||=q(`h3`,null,`语音`,-1),t[16]||=q(`small`,null,`朗读与语音输入`,-1),q(`span`,{class:N({"is-ready":r.api_key_ref})},F(p.value),3),J(y,{name:u.value?`i-lucide-chevron-up`:`i-lucide-chevron-down`},null,8,[`name`])],8,B0)]),_:1},8,[`open`])])}}},[[`__scopeId`,`data-v-b5dcc3a8`]]),d2={key:0,class:`channel-archive-manager`},f2={class:`channel-archive-toolbar`},p2={key:0,class:`channel-archive-confirm channel-archive-bulk`,role:`alert`},m2={class:`channel-archive-results`},h2={key:0,class:`channel-archive-list`,"aria-label":`已存档房间列表`},g2={class:`channel-archive-row`},_2={class:`channel-archive-info`},v2=[`title`,`disabled`,`onClick`],y2={key:0},b2=[`datetime`],x2={class:`channel-archive-actions`},S2={key:0,class:`channel-archive-confirm channel-archive-bulk`,role:`alert`},C2={key:1,class:`channel-archive-empty`},w2={class:`fine-print`},T2={key:0,class:`fine-print`},E2={class:`dialog-actions`},D2={class:`fine-print`},O2={class:`dialog-actions`},k2={class:`dialog-actions`},A2={class:`channel-management-target`},j2={key:0,class:`fine-print`},M2={key:1,class:`fine-print`},N2={key:2,class:`fine-print`},P2={class:`dialog-actions`},F2={key:5},I2={class:`theme-choices`},L2=[`aria-pressed`,`onClick`],R2={class:`theme-check`},z2={class:`channel-reading-setting`},B2={class:`channel-reading-options`,role:`group`,"aria-labelledby":`channel-reading-label`},V2={class:`channel-reading-setting`},H2={class:`channel-reading-options channel-effect-options`,role:`group`,"aria-labelledby":`channel-effects-label`},U2={class:`advanced-content`},W2={key:0,class:`fine-print`},G2={class:`advanced-content`},K2={class:`dialog-actions`},q2={key:8,class:`original-message`},J2={key:0,role:`alert`},Y2={class:`original-meta`},X2={class:`fine-print`},Z2={key:0,class:`channel-answer-summary`},Q2={class:`message-prose`},$2={class:`message-prose`},e4=[`innerHTML`],t4={key:2,class:`fine-print`},n4={__name:`WorkspaceDialogs`,props:Ha({detailId:{type:Number,default:null},targetRoom:{type:Object,default:null},targetFolder:{type:Object,default:null},readingOptions:{type:Array,default:()=>[]},effectOptions:{type:Array,default:()=>[]}},{modelValue:{type:String,default:``},modelModifiers:{},readingWidth:{type:String,default:`default`},readingWidthModifiers:{},effects:{type:String,default:`full`},effectsModifiers:{}}),emits:[`update:modelValue`,`update:readingWidth`,`update:effects`],setup(e){let t=e,n=uo(e,`modelValue`),r=uo(e,`readingWidth`),i=uo(e,`effects`),a=I(n.value);z(n,e=>{e&&(a.value=e)});let{view:o,bridge:s,act:c,pending:l}=Or(`discussion`),u=Q({get:()=>!!n.value,set:e=>{e||(n.value=``)}}),d={settings:`设置`,create:`新建房间`,folder:`新建文件夹`,"rename-folder":`重命名文件夹`,"delete-folder":`移除文件夹`,"archive-folder":`存档文件夹`,edit:`编辑议题`,message:`消息原文`};Object.assign(d,{rename:`重命名房间`,archive:`存档房间`,restore:`恢复房间`,delete:`删除房间`});let f={settings:`管理员账号与界面外观。`,create:`邀请 AI 一起协作;需要深入讨论时,可在创建时或之后随时开启。`,edit:`维护话题目标、背景与讨论默认上限。`,message:`保留作者、来源、提交人和引用关系。`};Object.assign(f,{rename:`名称变化不会影响讨论记录和阅读地址。`,archive:`保留所有记录,并暂停尚未收束的讨论。`,restore:`移回讨论列表,保持当前讨论阶段。`,delete:`永久删除房间及其所有记录,无法撤销。`}),d.archives=`已存档房间`,f.archives=`查看记录、恢复房间或彻底删除。`;let p=Q(()=>o.value.rooms.filter(e=>e.archived)),m=I(``),h=I(`all`),g=[{label:`全部房间`,value:`all`},{label:`有消息`,value:`messages`},{label:`无消息`,value:`empty`}],_=Q(()=>x(o.value.rooms,{query:m.value,content:h.value})),v=I(null),y=I(!1),b=Q(()=>p.value.find(e=>e.id===v.value));z(n,e=>{v.value=null,y.value=!1,e===`archives`&&(m.value=``,h.value=`all`)});function x(e,t){let n=t.query.trim().toLocaleLowerCase();return e.filter(e=>e.archived&&e.title.toLocaleLowerCase().includes(n)&&(t.content===`all`||(t.content===`messages`?e.message_count>0:e.message_count===0))).sort((e,t)=>(t.created_at||``).localeCompare(e.created_at||``))}function S(e){return new Date(e).toLocaleString(`zh-CN`,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function C(e){return o.value.archive_pending.includes(e.id)||[`rename`,`delete`].some(t=>o.value.directory_pending.includes(`${t}:${e.id}`))}function w(e){return n.value=``,c(`room`,e.id)}async function T(){let e=b.value;e&&!C(e)&&(v.value=null,await c(`manage_channel`,{id:e.id,action:`delete`}))}async function E(){let e=_.value.filter(e=>!C(e));y.value=!1;for(let t of e)await c(`manage_channel`,{id:t.id,action:`delete`})}let D=I(``),O=I(``);z(()=>[n.value,t.targetFolder?.id],()=>{O.value=n.value===`rename-folder`&&t.targetFolder?.name||``});let k=Q(()=>[`folder`,`rename-folder`,`delete-folder`,`archive-folder`].includes(a.value));z(()=>[n.value,t.targetRoom?.id],()=>{D.value=n.value===`rename`&&t.targetRoom?.title||``});async function A(){let e={id:t.targetRoom.id,action:n.value,title:D.value};n.value=``,await c(`manage_channel`,e)}async function ee(){let e=O.value.trim();if(!e||l.value)return;let r=n.value===`rename-folder`,i=r?{id:t.targetFolder.id,name:e}:e;n.value=``,await c(r?`rename_folder`:`create_folder`,i)}let j=Q(()=>o.value.rooms.filter(e=>!e.archived&&t.targetFolder?.id&&e.folder_id===t.targetFolder.id));async function te(e){let r=t.targetFolder.id,i=e?j.value:[];n.value=``;let a=!0;for(let e of i)a=await c(`manage_channel`,{id:e.id,action:`delete`})&&a;a&&await c(`delete_folder`,r)}async function ne(){let e=j.value;n.value=``;for(let t of e)await c(`manage_channel`,{id:t.id,action:`archive`})}let M=I(!1),re=I(null),ie=Q(()=>[`active`,`paused`].includes(o.value.room?.session?.status)),ae=I(null),oe=I(null),se=I(null),ce=I(``),le=[{value:`channel`,title:`协作频道`,description:`深灰界面 · 房间导航 · 成员侧栏`},{value:`channel-light`,title:`协作频道 · 浅色`,description:`纯白界面 · 中性灰阶 · 清晰阅读`}];function ue(e){return`topic-${e}-${e===`host`?`select`:`input`}`}async function de(){re.value?.settle();let e=n.value===`create`?`create`:`save_topic`;if(e===`create`){let r=t.targetFolder?.id??null,i=o.value.launch.scheduler||{},a=Object.values(o.value.experts[`new-expert-modes`]||{}).includes(`cli`)||o.value.launch.available&&!!(i.enabled&&i.provider&&i.model&&i.api_key_ref);a||(n.value=``),await c(e,r)&&a&&(n.value=``)}else await c(e)&&(n.value=``)}function fe(e){ae.value=e,n.value=``}function pe(){ae.value&&=(s.theme(ae.value),null)}function me(e){let t=e.target.closest(`[data-preview-attachment]`);t&&(e.stopPropagation(),oe.value={room_id:t.dataset.attachmentRoom,id:t.dataset.previewAttachment},n.value=``)}function he(){if(pe(),!oe.value)return;let e=oe.value;oe.value=null,c(`preview_attachment`,e)}z(()=>[n.value,t.detailId],async([e,t],n,r)=>{if(e!==`message`||!t||!o.value.room)return;let i=!1;r(()=>{i=!0}),se.value=null,ce.value=``;try{let e=await s.request(`/api/rooms/${o.value.room.id}/messages/${t}`);i||(se.value=e)}catch(e){i||(ce.value=e.message)}});async function ge(){try{se.value=await s.request(`/api/rooms/${o.value.room.id}/messages/${se.value.reply_to}`)}catch(e){ce.value=e.message}}let _e=e=>e.preventDefault();return(t,b)=>{let x=hV,ae=WV,oe=bA,pe=aV,ve=Yk,ye=cV,be=CY,xe=uV,Se=$B,Ce=ya(`keep-reading`);return W(),K(Se,{open:u.value,"onUpdate:open":b[22]||=e=>u.value=e,title:d[a.value]||`讨论`,description:f[a.value],ui:{content:[`glass-panel studio-modal`,k.value&&`channel-folder-modal`,[`rename`,`archive`,`restore`,`delete`].includes(a.value)&&`channel-folder-modal channel-manage-modal`,a.value===`archives`&&`channel-archive-modal`,a.value===`settings`&&`channel-settings-modal`,a.value===`create`&&`channel-create-modal`],body:`dialog-body`},content:{onInteractOutside:_e},"onAfter:leave":he},{body:R(()=>[a.value===`archives`?(W(),G(`section`,d2,[q(`div`,f2,[J(x,{modelValue:m.value,"onUpdate:modelValue":b[0]||=e=>m.value=e,icon:`i-lucide-search`,placeholder:`搜索已存档房间`,"aria-label":`搜索已存档房间`,class:`channel-archive-search`},null,8,[`modelValue`]),J(ae,{modelValue:h.value,"onUpdate:modelValue":b[1]||=e=>h.value=e,items:g,icon:`i-lucide-list-filter`,"aria-label":`筛选房间内容`},null,8,[`modelValue`]),J(oe,{label:`全部删除(${_.value.length})`,icon:`i-lucide-trash-2`,color:`error`,variant:`soft`,size:`sm`,class:`channel-archive-delete-all`,disabled:!_.value.length,onClick:b[2]||=e=>{y.value=!0,v.value=null}},null,8,[`label`,`disabled`])]),y.value&&_.value.length?(W(),G(`div`,p2,[q(`span`,null,`将永久删除当前列表中的 `+F(_.value.length)+` 个房间及其全部记录,无法撤销。`,1),J(oe,{label:`取消`,color:`neutral`,variant:`ghost`,size:`xs`,onClick:b[3]||=e=>y.value=!1}),J(oe,{label:`全部删除`,color:`error`,size:`xs`,onClick:E})])):X(``,!0),Tr((W(),G(`div`,m2,[_.value.length?(W(),G(`ul`,h2,[(W(!0),G(U,null,V(_.value,e=>(W(),G(`li`,{key:e.id,class:`channel-archive-item`},[q(`div`,g2,[q(`div`,_2,[q(`button`,{class:`channel-archive-title`,title:e.title,disabled:!!L(l),onClick:t=>w(e)},F(e.title),9,v2),q(`small`,null,[e.created_at?(W(),G(`span`,y2,[b[23]||=Y(`创建于 `,-1),q(`time`,{datetime:e.created_at},F(S(e.created_at)),9,b2),b[24]||=Y(` · `,-1)])):X(``,!0),Y(F(e.message_count)+` 条消息`,1)])]),q(`div`,x2,[J(oe,{"aria-label":`彻底删除 ${e.title}`,title:`彻底删除`,icon:`i-lucide-trash-2`,color:`neutral`,variant:`ghost`,size:`xs`,class:`channel-archive-delete`,disabled:C(e),onClick:t=>{v.value=e.id,y.value=!1}},null,8,[`aria-label`,`disabled`,`onClick`]),J(oe,{label:`恢复`,"aria-label":`恢复 ${e.title}`,color:`neutral`,variant:`soft`,size:`xs`,class:`channel-archive-restore`,disabled:C(e),onClick:t=>L(c)(`manage_channel`,{id:e.id,action:`restore`})},null,8,[`aria-label`,`disabled`,`onClick`])])]),v.value===e.id?(W(),G(`div`,S2,[q(`span`,null,`永久删除「`+F(e.title)+`」及其全部记录,无法撤销。`,1),J(oe,{label:`取消`,color:`neutral`,variant:`ghost`,size:`xs`,onClick:b[4]||=e=>v.value=null}),J(oe,{label:`删除`,color:`error`,size:`xs`,disabled:C(e),onClick:T},null,8,[`disabled`])])):X(``,!0)]))),128))])):(W(),G(`p`,C2,F(p.value.length?`没有匹配的存档房间`:`暂无已存档房间`),1))])),[[Ce]])])):a.value===`delete-folder`?(W(),G(`form`,{key:1,class:`dialog-form`,onSubmit:b[7]||=_u(e=>te(!1),[`prevent`])},[q(`p`,w2,`仅移除「`+F(e.targetFolder?.name)+`」时,房间变为未分组,所有消息和存档状态都会保留。`,1),j.value.length?(W(),G(`p`,T2,`也可以连同其中的 `+F(j.value.length)+` 个房间一起永久删除,无法撤销。`,1)):X(``,!0),q(`div`,E2,[J(oe,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:b[5]||=e=>n.value=``}),j.value.length?(W(),K(oe,{key:0,label:`连同 ${j.value.length} 个房间删除`,color:`error`,variant:`soft`,onClick:b[6]||=e=>te(!0)},null,8,[`label`])):X(``,!0),J(oe,{type:`submit`,label:`仅移除文件夹`,color:`neutral`,variant:`solid`})])],32)):a.value===`archive-folder`?(W(),G(`form`,{key:2,class:`dialog-form`,onSubmit:_u(ne,[`prevent`])},[q(`p`,D2,`存档「`+F(e.targetFolder?.name)+`」中的 `+F(j.value.length)+` 个房间,文件夹保留。存档后可在侧栏「已存档」中查阅与恢复;尚未收束的讨论会暂停。`,1),q(`div`,O2,[J(oe,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:b[8]||=e=>n.value=``}),J(oe,{type:`submit`,label:`存档全部房间`,color:`primary`})])],32)):k.value?(W(),G(`form`,{key:3,class:`dialog-form`,onSubmit:_u(ee,[`prevent`])},[J(x,{modelValue:O.value,"onUpdate:modelValue":b[9]||=e=>O.value=e,icon:`i-lucide-folder`,"aria-label":a.value===`folder`?`新文件夹名称`:`文件夹名称`,placeholder:`文件夹名称`,autofocus:``,required:``,maxlength:40,class:`w-full`,autocomplete:`off`,readonly:!!L(l),onKeydown:b[10]||=yu(_u(e=>!e.isComposing&&ee(),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`readonly`]),q(`div`,k2,[J(oe,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:b[11]||=e=>n.value=``}),J(oe,{type:`submit`,label:a.value===`folder`?`创建文件夹`:`保存名称`,class:`channel-primary-button`,loading:L(l)===`create_folder`||L(l)===`rename_folder`,disabled:!O.value.trim()||!!L(l)},null,8,[`label`,`loading`,`disabled`])])],32)):[`rename`,`archive`,`restore`,`delete`].includes(a.value)?(W(),G(`form`,{key:4,class:`dialog-form`,onSubmit:_u(A,[`prevent`])},[q(`p`,A2,[Y(F(e.targetRoom?.title)+` `,1),q(`span`,null,`· `+F(e.targetRoom?.message_count)+` 条消息`,1)]),a.value===`archive`?(W(),G(`p`,j2,`存档后可在侧栏「已存档」中查阅与恢复。已有发言安排会保留;专家需在下次检查时停止自己的定时任务。`)):X(``,!0),a.value===`restore`?(W(),G(`p`,M2,`恢复不会自动继续讨论;需要继续时,在主持设置中调整阶段。`)):X(``,!0),a.value===`delete`?(W(),G(`p`,N2,`消息、共识和发言安排将一起删除,无法撤销。`)):X(``,!0),a.value===`rename`?(W(),K(pe,{key:3,label:`房间名称`,required:``},{default:R(()=>[J(x,{modelValue:D.value,"onUpdate:modelValue":b[12]||=e=>D.value=e,autofocus:``,maxlength:80,required:``,class:`w-full`,autocomplete:`off`},null,8,[`modelValue`])]),_:1})):X(``,!0),q(`div`,P2,[J(oe,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:b[13]||=e=>n.value=``}),J(oe,{type:`submit`,label:a.value===`delete`?`永久删除`:a.value===`rename`?`保存名称`:d[a.value],color:a.value===`delete`?`error`:`primary`,loading:L(l)===`manage_channel`,disabled:a.value===`rename`&&!D.value.trim()},null,8,[`label`,`color`,`loading`,`disabled`])])],32)):a.value===`settings`?(W(),G(`div`,F2,[J(I0),b[29]||=q(`h3`,{class:`account-appearance-heading`},`外观`,-1),q(`div`,I2,[(W(),G(U,null,V(le,e=>q(`button`,{key:e.value,class:N({chosen:L(o).theme===e.value}),"aria-pressed":L(o).theme===e.value,onClick:t=>fe(e.value)},[q(`span`,{class:N([`theme-preview`,e.value]),"aria-hidden":`true`},[...b[25]||=[q(`i`,{class:`theme-preview-side`},null,-1),q(`i`,{class:`theme-preview-main`},[q(`b`),q(`b`),q(`b`)],-1)]],2),q(`span`,null,[q(`strong`,null,F(e.title),1),q(`small`,null,F(e.description),1)]),q(`span`,R2,[L(o).theme===e.value?(W(),K(ve,{key:0,name:`i-lucide-check`})):X(``,!0)])],10,L2)),64))]),q(`section`,z2,[b[26]||=q(`h3`,{id:`channel-reading-label`},`对话宽度`,-1),q(`div`,B2,[(W(!0),G(U,null,V(e.readingOptions,e=>(W(),K(oe,{key:e.value,label:e.label,color:`neutral`,variant:`ghost`,class:N({chosen:r.value===e.value}),"aria-pressed":r.value===e.value,onClick:t=>r.value=e.value},null,8,[`label`,`class`,`aria-pressed`,`onClick`]))),128))])]),q(`section`,V2,[b[27]||=q(`h3`,{id:`channel-effects-label`},`视觉效果`,-1),q(`div`,H2,[(W(!0),G(U,null,V(e.effectOptions,e=>(W(),K(oe,{key:e.value,label:e.label,color:`neutral`,variant:`ghost`,class:N({chosen:i.value===e.value}),"aria-pressed":i.value===e.value,onClick:t=>i.value=e.value},null,8,[`label`,`class`,`aria-pressed`,`onClick`]))),128))]),b[28]||=q(`p`,{class:`fine-print`},`精简模式关闭毛玻璃模糊与多层阴影,适合配置较低或需要更流畅滚动的设备。`,-1)]),J(u2)])):a.value===`create`?(W(),K(i1,{key:6,"target-folder":e.targetFolder,onSubmit:de,onCancel:b[14]||=e=>n.value=``},null,8,[`target-folder`])):a.value===`edit`?(W(),G(`form`,{key:7,class:`dialog-form`,onSubmit:_u(de,[`prevent`])},[J(pe,{label:`话题名称`,required:``},{default:R(()=>[J(x,{"model-value":L(o).fields[ue(`title`)],maxlength:80,required:``,placeholder:`这次想讨论什么?`,class:`w-full`,"onUpdate:modelValue":b[15]||=e=>L(s).write_field(ue(`title`),e)},null,8,[`model-value`])]),_:1}),J(pe,{label:`讨论目标`},{default:R(()=>[J(ye,{"model-value":L(o).fields[ue(`goal`)],maxlength:1e3,rows:2,placeholder:`希望通过讨论解决的问题`,class:`w-full`,"onUpdate:modelValue":b[16]||=e=>L(s).write_field(ue(`goal`),e)},null,8,[`model-value`])]),_:1}),a.value===`edit`?(W(),K(pe,{key:0,label:`当前焦点`},{default:R(()=>[J(x,{"model-value":L(o).fields[ue(`focus`)],maxlength:1e3,placeholder:`当前最需要回应的问题`,class:`w-full`,"onUpdate:modelValue":b[17]||=e=>L(s).write_field(ue(`focus`),e)},null,8,[`model-value`])]),_:1})):X(``,!0),q(`section`,U2,[b[30]||=q(`h3`,null,`讨论上限`,-1),J(YH,{ref_key:`topic_limits`,ref:re,rounds:Number(L(o).fields[ue(`limit-max_rounds`)]),minutes:Number(L(o).fields[ue(`limit-max_minutes`)]),disabled:ie.value,"onUpdate:rounds":b[18]||=e=>L(s).write_field(ue(`limit-max_rounds`),String(e)),"onUpdate:minutes":b[19]||=e=>L(s).write_field(ue(`limit-max_minutes`),String(e))},null,8,[`rounds`,`minutes`,`disabled`]),ie.value?(W(),G(`p`,W2,`讨论未结束时,上限不可在此修改。`)):X(``,!0)]),J(be,{open:M.value,"onUpdate:open":b[20]||=e=>M.value=e,class:`advanced-fields`},{content:R(()=>[q(`div`,G2,[(W(),G(U,null,V([{key:`user_request`,label:`用户原文`},{key:`background`,label:`背景`},{key:`boundaries`,label:`讨论边界`}],e=>J(pe,{key:e.key,label:e.label},{default:R(()=>[J(ye,{"model-value":L(o).fields[ue(e.key)],maxlength:4e3,rows:2,class:`w-full`,"onUpdate:modelValue":t=>L(s).write_field(ue(e.key),t)},null,8,[`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`label`])),64))])]),default:R(()=>[J(oe,{"trailing-icon":M.value?`i-lucide-chevron-up`:`i-lucide-chevron-down`,label:`用户原文、背景与边界`,color:`neutral`,variant:`ghost`,block:``,class:`advanced-trigger`},null,8,[`trailing-icon`])]),_:1},8,[`open`]),q(`div`,K2,[J(oe,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:b[21]||=e=>n.value=``}),J(oe,{type:`submit`,class:`channel-primary-button`,label:`保存议题`,loading:L(l)===`create`||L(l)===`save_topic`},null,8,[`loading`])])],32)):a.value===`message`?(W(),G(`div`,q2,[ce.value?(W(),G(`p`,J2,F(ce.value),1)):se.value?(W(),G(U,{key:1},[q(`div`,Y2,[q(`strong`,null,F(L(s).display_name(se.value.author)),1),q(`span`,null,`#`+F(se.value.id),1),J(xe,{color:`neutral`,variant:`subtle`},{default:R(()=>[Y(F(L(s).sources[se.value.source]),1)]),_:1})]),q(`p`,X2,F(L(s).provenance(se.value))+` · `+F(new Date(se.value.created_at).toLocaleString(`zh-CN`)),1),se.value.summary?(W(),G(`section`,Z2,[q(`small`,null,`回答摘要 · `+F(L(s).display_name(se.value.summary_by)),1),q(`p`,Q2,F(se.value.summary),1)])):X(``,!0),q(`p`,$2,F(se.value.text),1),se.value.attachments?.length?(W(),G(`div`,{key:1,onClick:me,innerHTML:L(s).attachment_markup(se.value.attachments)},null,8,e4)):X(``,!0),se.value.reply_to?(W(),K(oe,{key:2,label:`查看被回复的原文 #${se.value.reply_to}`,icon:`i-lucide-corner-up-left`,variant:`outline`,color:`neutral`,class:`channel-surface-button`,onClick:ge},null,8,[`label`])):X(``,!0)],64)):(W(),G(`p`,t4,`正在读取原文…`))])):X(``,!0)]),_:1},8,[`open`,`title`,`description`,`ui`,`content`])}}},r4={slots:{root:`relative flex gap-1.5 [&>div]:min-w-0`,list:`isolate min-w-0`,label:`w-full flex items-center gap-1.5 font-semibold text-xs/5 text-highlighted px-2.5 py-1.5`,item:`min-w-0`,link:`group relative w-full flex items-center gap-1.5 font-medium text-sm before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none focus-visible:before:outline-3`,linkLeadingIcon:`shrink-0 size-5`,linkLeadingAvatar:`shrink-0`,linkLeadingAvatarSize:`2xs`,linkLeadingChipSize:`sm`,linkTrailing:`group ms-auto inline-flex gap-1.5 items-center`,linkTrailingBadge:`shrink-0`,linkTrailingBadgeSize:`sm`,linkTrailingIcon:`size-5 transform shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200 ease-out motion-reduce:transition-none`,linkLabel:`truncate`,linkLabelExternalIcon:`inline-block size-3 align-top text-dimmed`,childList:`isolate`,childLabel:`text-xs text-highlighted`,childItem:``,childLink:`group relative size-full flex items-start text-start text-sm before:absolute before:z-[-1] before:rounded-md focus:outline-none focus-visible:outline-none focus-visible:before:outline-3`,childLinkWrapper:`min-w-0`,childLinkIcon:`size-5 shrink-0`,childLinkLabel:`truncate`,childLinkLabelExternalIcon:`inline-block size-3 align-top text-dimmed`,childLinkDescription:`text-muted`,separator:`px-2 h-px bg-border`,viewportWrapper:`absolute top-full start-0 flex w-full`,viewport:`relative overflow-hidden bg-default shadow-lg rounded-md ring ring-default h-(--reka-navigation-menu-viewport-height) w-full transition-[width,height,left,right] duration-200 ease-out motion-reduce:transition-none origin-[top_center] data-[state=open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] z-1`,content:``,indicator:`absolute left-0 data-[state=visible]:animate-[fade-in_100ms_var(--ease-out)] data-[state=hidden]:animate-[fade-out_100ms_var(--ease-out)] data-[state=hidden]:opacity-0 bottom-0 z-2 w-(--reka-navigation-menu-indicator-size) translate-x-(--reka-navigation-menu-indicator-position) flex h-2.5 items-end justify-center overflow-hidden transition-[translate,width] duration-200 ease-out motion-reduce:transition-none`,arrow:`relative top-[50%] size-2.5 rotate-45 border border-default bg-default z-1 rounded-xs`},variants:{color:{primary:{link:`before:outline-primary/25`,childLink:`before:outline-primary/25`},secondary:{link:`before:outline-secondary/25`,childLink:`before:outline-secondary/25`},success:{link:`before:outline-success/25`,childLink:`before:outline-success/25`},info:{link:`before:outline-info/25`,childLink:`before:outline-info/25`},warning:{link:`before:outline-warning/25`,childLink:`before:outline-warning/25`},error:{link:`before:outline-error/25`,childLink:`before:outline-error/25`},neutral:{link:`before:outline-inverted/25`,childLink:`before:outline-inverted/25`}},highlightColor:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},variant:{pill:``,link:``},orientation:{horizontal:{root:`items-center justify-between`,list:`flex items-center`,item:`py-2`,link:`px-2.5 py-1.5 before:inset-x-px before:inset-y-0`,childList:`grid p-2`,childLink:`px-3 py-2 gap-2 before:inset-x-px before:inset-y-0`,childLinkLabel:`font-medium`,content:`absolute top-0 start-0 w-full max-h-[70vh] overflow-y-auto`},vertical:{root:`flex-col`,link:`flex-row px-2.5 py-1.5 before:inset-y-px before:inset-x-0`,childLabel:`px-1.5 py-0.5`,childLink:`p-1.5 gap-1.5 before:inset-y-px before:inset-x-0`}},contentOrientation:{horizontal:{viewportWrapper:`justify-center`,content:`data-[motion=from-start]:animate-[enter-from-left_200ms_var(--ease-out)] data-[motion=from-end]:animate-[enter-from-right_200ms_var(--ease-out)] data-[motion=to-start]:animate-[exit-to-left_200ms_var(--ease-out)] data-[motion=to-end]:animate-[exit-to-right_200ms_var(--ease-out)]`},vertical:{viewport:`sm:w-(--reka-navigation-menu-viewport-width) left-(--reka-navigation-menu-viewport-left) rtl:left-auto rtl:right-[calc(100%-var(--reka-navigation-menu-viewport-left)-var(--reka-navigation-menu-viewport-width))]`}},active:{true:{childLink:`before:bg-elevated text-highlighted`,childLinkIcon:`text-default`},false:{link:`text-muted`,linkLeadingIcon:`text-dimmed`,childLink:[`hover:before:bg-elevated/50 text-default hover:text-highlighted`,`transition-colors before:transition-colors`],childLinkIcon:[`text-dimmed group-hover:text-default`,`transition-colors`]}},disabled:{true:{link:`cursor-not-allowed opacity-75`}},highlight:{true:``},level:{true:``},collapsed:{true:``}},compoundVariants:[{orientation:`horizontal`,contentOrientation:`horizontal`,class:{childList:`grid-cols-2 gap-2`}},{orientation:`horizontal`,contentOrientation:`vertical`,class:{childList:`gap-1`,content:`w-60`}},{orientation:`vertical`,collapsed:!1,class:{childList:`ms-5 border-s border-default`,childItem:`ps-1.5 -ms-px`,content:`data-[state=open]:animate-[collapsible-down_200ms_var(--ease-out)] data-[state=closed]:animate-[collapsible-up_200ms_var(--ease-out)] data-[state=closed]:overflow-hidden`}},{orientation:`vertical`,collapsed:!0,class:{link:`px-1.5`,linkLabel:`hidden`,linkTrailing:`hidden`,content:`shadow-sm rounded-sm min-h-6 p-1`}},{orientation:`horizontal`,highlight:!0,class:{link:[`after:absolute after:-bottom-2 after:inset-x-2.5 after:block after:h-px after:rounded-full`,`after:transition-colors`]}},{orientation:`vertical`,highlight:!0,level:!0,class:{link:[`after:absolute after:-start-1.5 after:inset-y-0.5 after:block after:w-px after:rounded-full`,`after:transition-colors`]}},{disabled:!1,active:!1,variant:`pill`,class:{link:[`hover:text-highlighted hover:before:bg-elevated/50`,`transition-colors before:transition-colors`],linkLeadingIcon:[`group-hover:text-default`,`transition-colors`]}},{disabled:!1,active:!1,variant:`pill`,orientation:`horizontal`,class:{link:`data-[state=open]:text-highlighted`,linkLeadingIcon:`group-data-[state=open]:text-default`}},{disabled:!1,variant:`pill`,highlight:!0,orientation:`horizontal`,class:{link:`data-[state=open]:before:bg-elevated/50`}},{disabled:!1,variant:`pill`,highlight:!1,active:!1,orientation:`horizontal`,class:{link:`data-[state=open]:before:bg-elevated/50`}},{color:`primary`,variant:`pill`,active:!0,class:{link:`text-primary`,linkLeadingIcon:`text-primary group-data-[state=open]:text-primary`}},{color:`secondary`,variant:`pill`,active:!0,class:{link:`text-secondary`,linkLeadingIcon:`text-secondary group-data-[state=open]:text-secondary`}},{color:`success`,variant:`pill`,active:!0,class:{link:`text-success`,linkLeadingIcon:`text-success group-data-[state=open]:text-success`}},{color:`info`,variant:`pill`,active:!0,class:{link:`text-info`,linkLeadingIcon:`text-info group-data-[state=open]:text-info`}},{color:`warning`,variant:`pill`,active:!0,class:{link:`text-warning`,linkLeadingIcon:`text-warning group-data-[state=open]:text-warning`}},{color:`error`,variant:`pill`,active:!0,class:{link:`text-error`,linkLeadingIcon:`text-error group-data-[state=open]:text-error`}},{color:`neutral`,variant:`pill`,active:!0,class:{link:`text-highlighted`,linkLeadingIcon:`text-highlighted group-data-[state=open]:text-highlighted`}},{variant:`pill`,active:!0,highlight:!1,class:{link:`before:bg-elevated`}},{variant:`pill`,active:!0,highlight:!0,disabled:!1,class:{link:[`hover:before:bg-elevated/50`,`before:transition-colors`]}},{disabled:!1,active:!1,variant:`link`,class:{link:[`hover:text-highlighted`,`transition-colors`],linkLeadingIcon:[`group-hover:text-default`,`transition-colors`]}},{disabled:!1,active:!1,variant:`link`,orientation:`horizontal`,class:{link:`data-[state=open]:text-highlighted`,linkLeadingIcon:`group-data-[state=open]:text-default`}},{color:`primary`,variant:`link`,active:!0,class:{link:`text-primary`,linkLeadingIcon:`text-primary group-data-[state=open]:text-primary`}},{color:`secondary`,variant:`link`,active:!0,class:{link:`text-secondary`,linkLeadingIcon:`text-secondary group-data-[state=open]:text-secondary`}},{color:`success`,variant:`link`,active:!0,class:{link:`text-success`,linkLeadingIcon:`text-success group-data-[state=open]:text-success`}},{color:`info`,variant:`link`,active:!0,class:{link:`text-info`,linkLeadingIcon:`text-info group-data-[state=open]:text-info`}},{color:`warning`,variant:`link`,active:!0,class:{link:`text-warning`,linkLeadingIcon:`text-warning group-data-[state=open]:text-warning`}},{color:`error`,variant:`link`,active:!0,class:{link:`text-error`,linkLeadingIcon:`text-error group-data-[state=open]:text-error`}},{color:`neutral`,variant:`link`,active:!0,class:{link:`text-highlighted`,linkLeadingIcon:`text-highlighted group-data-[state=open]:text-highlighted`}},{highlightColor:`primary`,highlight:!0,level:!0,active:!0,class:{link:`after:bg-primary`}},{highlightColor:`secondary`,highlight:!0,level:!0,active:!0,class:{link:`after:bg-secondary`}},{highlightColor:`success`,highlight:!0,level:!0,active:!0,class:{link:`after:bg-success`}},{highlightColor:`info`,highlight:!0,level:!0,active:!0,class:{link:`after:bg-info`}},{highlightColor:`warning`,highlight:!0,level:!0,active:!0,class:{link:`after:bg-warning`}},{highlightColor:`error`,highlight:!0,level:!0,active:!0,class:{link:`after:bg-error`}},{highlightColor:`neutral`,highlight:!0,level:!0,active:!0,class:{link:`after:bg-inverted`}}],defaultVariants:{color:`primary`,highlightColor:`primary`,variant:`pill`}},i4=Object.assign({inheritAttrs:!1},{__name:`NavigationMenu`,props:{as:{type:null,required:!1},type:{type:null,required:!1,default:`multiple`},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},trailingIcon:{type:null,required:!1},externalIcon:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},items:{type:null,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},orientation:{type:null,required:!1,default:`horizontal`},collapsed:{type:Boolean,required:!1},tooltip:{type:[Boolean,Object],required:!1},popover:{type:[Boolean,Object],required:!1},highlight:{type:Boolean,required:!1},highlightColor:{type:null,required:!1},content:{type:Object,required:!1},contentOrientation:{type:null,required:!1,default:`horizontal`},arrow:{type:Boolean,required:!1},valueKey:{type:null,required:!1,default:`value`},labelKey:{type:null,required:!1,default:`label`},class:{type:null,required:!1},ui:{type:Object,required:!1},delayDuration:{type:Number,required:!1,default:0},disableClickTrigger:{type:Boolean,required:!1},disableHoverTrigger:{type:Boolean,required:!1},skipDelayDuration:{type:Number,required:!1},disablePointerLeaveClose:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},disabled:{type:Boolean,required:!1},collapsible:{type:Boolean,required:!1,default:!0}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=La(),a=AE(`navigationMenu`,n),o=Am(),s=jE(Q(()=>({as:a.as,delayDuration:a.delayDuration,skipDelayDuration:a.skipDelayDuration,orientation:a.orientation,disableClickTrigger:a.disableClickTrigger,disableHoverTrigger:a.disableHoverTrigger,disablePointerLeaveClose:a.disablePointerLeaveClose,unmountOnHide:a.unmountOnHide})),r),c=jE(pm(a,`collapsible`,`disabled`,`type`,`unmountOnHide`),r),l=kn(()=>a.content),u=kn(()=>Im(typeof a.tooltip==`boolean`?{}:a.tooltip,{...a.orientation===`vertical`&&{delayDuration:0,content:{side:`right`}}})),d=kn(()=>Im(typeof a.popover==`boolean`?{}:a.popover,{mode:`hover`,content:{side:`right`,align:`start`,alignOffset:2}})),[f,p]=wm(),[m,h]=wm({props:{item:Object,index:Number,level:Number,listIndex:Number}}),g=Q(()=>Jk({extend:r4,...o.ui?.navigationMenu||{}})({orientation:a.orientation,contentOrientation:a.orientation===`vertical`?void 0:a.contentOrientation,collapsed:a.collapsed,color:a.color,variant:a.variant,highlight:a.highlight,highlightColor:a.highlightColor||a.color})),_=Q(()=>a.items?.length?eh(a.items)?a.items:[a.items]:[]);function v(e,t,n,r){let i=_.value.length>1?`group-${r}-`:``;return Ym(e,a.valueKey)??(n>0?`${i}item-${n}-${t}`:`${i}item-${t}`)}function y(e,t=0,n=0){let r=e.reduce((e,r,i)=>((r.defaultOpen||r.open)&&e.push(v(r,i,t,n)),e),[]);return a.type===`single`?r[0]:r}function b(e,t,n){t.children?.length&&(a.orientation===`horizontal`?e.preventDefault():a.orientation===`vertical`&&!a.collapsed&&n&&(e.preventDefault(),e.stopPropagation()))}return(e,t)=>(W(),G(U,null,[J(L(f),null,{default:R(({item:t,active:n,index:r,trailingTrigger:s})=>[H(e.$slots,t.slot||`item`,{item:t,index:r,active:n,ui:g.value},()=>[H(e.$slots,t.slot?`${t.slot}-leading`:`item-leading`,{item:t,active:n,index:r,ui:g.value},()=>[t.avatar?(W(),K(tA,Z({key:0,size:t.ui?.linkLeadingAvatarSize||L(a).ui?.linkLeadingAvatarSize||g.value.linkLeadingAvatarSize()},t.avatar,{"data-slot":`linkLeadingAvatar`,class:g.value.linkLeadingAvatar({class:[L(a).ui?.linkLeadingAvatar,t.ui?.linkLeadingAvatar],active:n,disabled:!!t.disabled})}),null,16,[`size`,`class`])):t.icon&&t.chip?(W(),K($k,Z({key:1,size:t.ui?.linkLeadingChipSize||L(a).ui?.linkLeadingChipSize||g.value.linkLeadingChipSize(),inset:``},typeof t.chip==`object`?t.chip:{},{"data-slot":`linkLeadingChip`}),{default:R(()=>[J(Yk,{name:t.icon,"data-slot":`linkLeadingIcon`,class:N(g.value.linkLeadingIcon({class:[L(a).ui?.linkLeadingIcon,t.ui?.linkLeadingIcon],active:n,disabled:!!t.disabled}))},null,8,[`name`,`class`])]),_:2},1040,[`size`])):t.icon?(W(),K(Yk,{key:2,name:t.icon,"data-slot":`linkLeadingIcon`,class:N(g.value.linkLeadingIcon({class:[L(a).ui?.linkLeadingIcon,t.ui?.linkLeadingIcon],active:n,disabled:!!t.disabled}))},null,8,[`name`,`class`])):X(``,!0)]),L(Ym)(t,L(a).labelKey)||i[t.slot?`${t.slot}-label`:`item-label`]?(W(),G(`span`,{key:0,"data-slot":`linkLabel`,class:N(g.value.linkLabel({class:[L(a).ui?.linkLabel,t.ui?.linkLabel]}))},[H(e.$slots,t.slot?`${t.slot}-label`:`item-label`,{item:t,active:n,index:r},()=>[Y(F(L(Ym)(t,L(a).labelKey)),1)]),t.target===`_blank`&&L(a).externalIcon!==!1?(W(),K(Yk,{key:0,name:typeof L(a).externalIcon==`string`?L(a).externalIcon:L(o).ui.icons.external,"data-slot":`linkLabelExternalIcon`,class:N(g.value.linkLabelExternalIcon({class:[L(a).ui?.linkLabelExternalIcon,t.ui?.linkLabelExternalIcon],active:n}))},null,8,[`name`,`class`])):X(``,!0)],2)):X(``,!0),t.badge||t.badge===0||L(a).orientation===`horizontal`&&(t.children?.length||i[t.slot?`${t.slot}-content`:`item-content`])||L(a).orientation===`vertical`&&t.children?.length||t.trailingIcon||i[t.slot?`${t.slot}-trailing`:`item-trailing`]?(W(),K(va(L(a).orientation===`vertical`&&t.children?.length&&!L(a).collapsed&&s?L(p_):`span`),{key:1,as:L(a).orientation===`vertical`&&t.children?.length&&!L(a).collapsed&&s?`span`:void 0,"data-slot":`linkTrailing`,class:N(g.value.linkTrailing({class:[L(a).ui?.linkTrailing,t.ui?.linkTrailing]})),onClick:e=>b(e,t,s)},{default:R(()=>[H(e.$slots,t.slot?`${t.slot}-trailing`:`item-trailing`,{item:t,active:n,index:r,ui:g.value},()=>[t.badge||t.badge===0?(W(),K(uV,Z({key:0,color:`neutral`,variant:`outline`,size:t.ui?.linkTrailingBadgeSize||L(a).ui?.linkTrailingBadgeSize||g.value.linkTrailingBadgeSize()},typeof t.badge==`string`||typeof t.badge==`number`?{label:t.badge}:t.badge,{"data-slot":`linkTrailingBadge`,class:g.value.linkTrailingBadge({class:[L(a).ui?.linkTrailingBadge,t.ui?.linkTrailingBadge]})}),null,16,[`size`,`class`])):X(``,!0),L(a).orientation===`horizontal`&&(t.children?.length||i[t.slot?`${t.slot}-content`:`item-content`])||L(a).orientation===`vertical`&&t.children?.length?(W(),K(Yk,{key:1,name:t.trailingIcon||L(a).trailingIcon||L(o).ui.icons.chevronDown,"data-slot":`linkTrailingIcon`,class:N(g.value.linkTrailingIcon({class:[L(a).ui?.linkTrailingIcon,t.ui?.linkTrailingIcon],active:n}))},null,8,[`name`,`class`])):t.trailingIcon?(W(),K(Yk,{key:2,name:t.trailingIcon,"data-slot":`linkTrailingIcon`,class:N(g.value.linkTrailingIcon({class:[L(a).ui?.linkTrailingIcon,t.ui?.linkTrailingIcon],active:n}))},null,8,[`name`,`class`])):X(``,!0)])]),_:2},1032,[`as`,`class`,`onClick`])):X(``,!0)])]),_:3}),J(L(m),null,{default:R(({item:t,index:n,level:r=0,listIndex:s=0})=>[(W(),K(va(L(a).orientation===`vertical`&&!L(a).collapsed?L(d_):L(Sw)),Z({as:`li`},L(a).orientation===`vertical`&&!L(a).collapsed?{disabled:!!t.disabled}:{},{value:v(t,n,r,s)}),{default:R(()=>[L(a).orientation===`vertical`&&t.type===`label`&&!L(a).collapsed?(W(),G(`div`,{key:0,"data-slot":`label`,class:N(g.value.label({class:[L(a).ui?.label,t.ui?.label,t.class]}))},[J(L(p),{item:t,index:n,"trailing-trigger":!0},null,8,[`item`,`index`])],2)):t.type===`label`?X(``,!0):(W(),K(vA,Z({key:1},L(a).orientation===`vertical`&&t.children?.length&&!L(a).collapsed&&t.type===`trigger`?{}:L(hA)(t),{custom:``}),{default:R(({active:s,...c})=>[(W(),K(va(L(a).orientation===`horizontal`&&(t.children?.length||i[t.slot?`${t.slot}-content`:`item-content`])?L(kw):L(a).orientation===`vertical`&&t.children?.length&&!L(a).collapsed&&!c.href?L(p_):L(Ew)),{"as-child":``,active:s||t.active,disabled:t.disabled,onSelect:t.onSelect},{default:R(()=>[L(a).orientation===`vertical`&&L(a).collapsed&&t.children?.length&&(L(a).popover||t.popover)?(W(),K(kV,Z({key:0},{...d.value,...typeof t.popover==`boolean`?{}:t.popover||{}},{ui:{content:g.value.content({class:[L(a).ui?.content,t.ui?.content]})}}),{content:R(({close:r})=>[H(e.$slots,t.slot?`${t.slot}-content`:`item-content`,{item:t,active:s||t.active,index:n,ui:g.value,close:r},()=>[q(`ul`,{"data-slot":`childList`,class:N(g.value.childList({class:[L(a).ui?.childList,t.ui?.childList]}))},[q(`li`,{"data-slot":`childLabel`,class:N(g.value.childLabel({class:[L(a).ui?.childLabel,t.ui?.childLabel]}))},F(L(Ym)(t,L(a).labelKey)),3),(W(!0),G(U,null,V(t.children,(e,n)=>(W(),G(`li`,{key:n,"data-slot":`childItem`,class:N(g.value.childItem({class:[L(a).ui?.childItem,t.ui?.childItem]}))},[J(vA,Z({ref_for:!0},L(hA)(e),{custom:``}),{default:R(({active:n,...r})=>[J(L(Ew),{"as-child":``,active:n,onSelect:e.onSelect},{default:R(()=>[J(gA,Z({ref_for:!0},r,{"data-slot":`childLink`,class:g.value.childLink({class:[L(a).ui?.childLink,t.ui?.childLink,e.class],active:n})}),{default:R(()=>[e.icon?(W(),K(Yk,{key:0,name:e.icon,"data-slot":`childLinkIcon`,class:N(g.value.childLinkIcon({class:[L(a).ui?.childLinkIcon,t.ui?.childLinkIcon],active:n}))},null,8,[`name`,`class`])):X(``,!0),q(`span`,{"data-slot":`childLinkLabel`,class:N(g.value.childLinkLabel({class:[L(a).ui?.childLinkLabel,t.ui?.childLinkLabel],active:n}))},[Y(F(L(Ym)(e,L(a).labelKey))+` `,1),e.target===`_blank`&&L(a).externalIcon!==!1?(W(),K(Yk,{key:0,name:typeof L(a).externalIcon==`string`?L(a).externalIcon:L(o).ui.icons.external,"data-slot":`childLinkLabelExternalIcon`,class:N(g.value.childLinkLabelExternalIcon({class:[L(a).ui?.childLinkLabelExternalIcon,t.ui?.childLinkLabelExternalIcon],active:n}))},null,8,[`name`,`class`])):X(``,!0)],2)]),_:2},1040,[`class`])]),_:2},1032,[`active`,`onSelect`])]),_:2},1040)],2))),128))],2)])]),default:R(()=>[J(gA,Z(c,{"data-slot":`link`,class:g.value.link({class:[L(a).ui?.link,t.ui?.link,t.class],active:s||t.active,disabled:!!t.disabled,level:r>0})}),{default:R(()=>[J(L(p),{item:t,active:s||t.active,index:n,"trailing-trigger":!!c.href},null,8,[`item`,`active`,`index`,`trailing-trigger`])]),_:2},1040,[`class`])]),_:2},1040,[`ui`])):L(a).orientation===`vertical`&&L(a).collapsed&&(L(a).tooltip||t.tooltip)||L(a).orientation===`horizontal`&&t.tooltip?(W(),K(yV,Z({key:1,text:L(Ym)(t,L(a).labelKey)},{...u.value,...typeof t.tooltip==`boolean`?{}:t.tooltip||{}}),{default:R(()=>[J(gA,Z(c,{"data-slot":`link`,class:g.value.link({class:[L(a).ui?.link,t.ui?.link,t.class],active:s||t.active,disabled:!!t.disabled,level:r>0})}),{default:R(()=>[J(L(p),{item:t,active:s||t.active,index:n,"trailing-trigger":!!c.href},null,8,[`item`,`active`,`index`,`trailing-trigger`])]),_:2},1040,[`class`])]),_:2},1040,[`text`])):(W(),K(gA,Z({key:2},c,{"data-slot":`link`,class:g.value.link({class:[L(a).ui?.link,t.ui?.link,t.class],active:s||t.active,disabled:!!t.disabled,level:L(a).orientation===`horizontal`||r>0})}),{default:R(()=>[J(L(p),{item:t,active:s||t.active,index:n,"trailing-trigger":!!c.href},null,8,[`item`,`active`,`index`,`trailing-trigger`])]),_:2},1040,[`class`]))]),_:2},1064,[`active`,`disabled`,`onSelect`])),L(a).orientation===`horizontal`&&(t.children?.length||i[t.slot?`${t.slot}-content`:`item-content`])?(W(),K(L(ww),Z({key:0},l.value,{"data-slot":`content`,class:g.value.content({class:[L(a).ui?.content,t.ui?.content]})}),{default:R(()=>[H(e.$slots,t.slot?`${t.slot}-content`:`item-content`,{item:t,active:s||t.active,index:n,ui:g.value},()=>[q(`ul`,{"data-slot":`childList`,class:N(g.value.childList({class:[L(a).ui?.childList,t.ui?.childList]}))},[(W(!0),G(U,null,V(t.children,(e,n)=>(W(),G(`li`,{key:n,"data-slot":`childItem`,class:N(g.value.childItem({class:[L(a).ui?.childItem,t.ui?.childItem]}))},[J(vA,Z({ref_for:!0},L(hA)(e),{custom:``}),{default:R(({active:n,...r})=>[J(L(Ew),{"as-child":``,active:n,onSelect:e.onSelect},{default:R(()=>[J(gA,Z({ref_for:!0},r,{"data-slot":`childLink`,class:g.value.childLink({class:[L(a).ui?.childLink,t.ui?.childLink,e.class],active:n})}),{default:R(()=>[e.icon?(W(),K(Yk,{key:0,name:e.icon,"data-slot":`childLinkIcon`,class:N(g.value.childLinkIcon({class:[L(a).ui?.childLinkIcon,t.ui?.childLinkIcon],active:n}))},null,8,[`name`,`class`])):X(``,!0),q(`div`,{"data-slot":`childLinkWrapper`,class:N(g.value.childLinkWrapper({class:[L(a).ui?.childLinkWrapper,t.ui?.childLinkWrapper]}))},[q(`p`,{"data-slot":`childLinkLabel`,class:N(g.value.childLinkLabel({class:[L(a).ui?.childLinkLabel,t.ui?.childLinkLabel],active:n}))},[Y(F(L(Ym)(e,L(a).labelKey))+` `,1),e.target===`_blank`&&L(a).externalIcon!==!1?(W(),K(Yk,{key:0,name:typeof L(a).externalIcon==`string`?L(a).externalIcon:L(o).ui.icons.external,"data-slot":`childLinkLabelExternalIcon`,class:N(g.value.childLinkLabelExternalIcon({class:[L(a).ui?.childLinkLabelExternalIcon,t.ui?.childLinkLabelExternalIcon],active:n}))},null,8,[`name`,`class`])):X(``,!0)],2),e.description?(W(),G(`p`,{key:0,"data-slot":`childLinkDescription`,class:N(g.value.childLinkDescription({class:[L(a).ui?.childLinkDescription,t.ui?.childLinkDescription],active:n}))},F(e.description),3)):X(``,!0)],2)]),_:2},1040,[`class`])]),_:2},1032,[`active`,`onSelect`])]),_:2},1040)],2))),128))],2)])]),_:2},1040,[`class`])):X(``,!0)]),_:2},1040)),L(a).orientation===`vertical`&&t.children?.length&&!L(a).collapsed?(W(),K(L(f_),{key:2,"data-slot":`content`,class:N(g.value.content({class:[L(a).ui?.content,t.ui?.content]}))},{default:R(()=>[J(L(s_),Z({...L(c),defaultValue:y(t.children,r+1,s)},{as:`ul`,"data-slot":`childList`,class:g.value.childList({class:[L(a).ui?.childList,t.ui?.childList]})}),{default:R(()=>[(W(!0),G(U,null,V(t.children,(e,t)=>(W(),K(L(h),{key:t,item:e,index:t,level:r+1,"list-index":s,"data-slot":`childItem`,class:N(g.value.childItem({class:[L(a).ui?.childItem,e.ui?.childItem]}))},null,8,[`item`,`index`,`level`,`list-index`,`class`]))),128))]),_:2},1040,[`class`])]),_:2},1032,[`class`])):X(``,!0)]),_:2},1040,[`value`]))]),_:3}),J(L(yw),Z({"data-slot":`root`},{...L(s),...L(a).orientation===`horizontal`?{modelValue:L(a).modelValue,defaultValue:L(a).defaultValue}:{},...e.$attrs},{"data-collapsed":L(a).collapsed,class:g.value.root({class:[L(a).ui?.root,L(a).class]})}),{default:R(()=>[H(e.$slots,`list-leading`),(W(!0),G(U,null,V(_.value,(e,t)=>(W(),G(U,{key:`list-${t}`},[(W(),K(va(L(a).orientation===`vertical`?L(s_):L(Dw)),Z({ref_for:!0},L(a).orientation===`vertical`&&!L(a).collapsed?{...L(c),modelValue:L(a).modelValue,defaultValue:L(a).defaultValue??y(e,0,t)}:{},{as:`ul`,"data-slot":`list`,class:g.value.list({class:L(a).ui?.list})}),{default:R(()=>[(W(!0),G(U,null,V(e,(e,n)=>(W(),K(L(h),{key:`list-${t}-${n}`,item:e,index:n,"list-index":t,"data-slot":`item`,class:N(g.value.item({class:[L(a).ui?.item,e.ui?.item]}))},null,8,[`item`,`index`,`list-index`,`class`]))),128))]),_:2},1040,[`class`])),L(a).orientation===`vertical`&&t<_.value.length-1?(W(),G(`div`,{key:0,"data-slot":`separator`,class:N(g.value.separator({class:L(a).ui?.separator}))},null,2)):X(``,!0)],64))),128)),H(e.$slots,`list-trailing`),L(a).orientation===`horizontal`?(W(),G(`div`,{key:0,"data-slot":`viewportWrapper`,class:N(g.value.viewportWrapper({class:L(a).ui?.viewportWrapper}))},[L(a).arrow?(W(),K(L(Tw),{key:0,"data-slot":`indicator`,class:N(g.value.indicator({class:L(a).ui?.indicator}))},{default:R(()=>[q(`div`,{"data-slot":`arrow`,class:N(g.value.arrow({class:L(a).ui?.arrow}))},null,2)]),_:1},8,[`class`])):X(``,!0),J(L(Aw),{"data-slot":`viewport`,class:N(g.value.viewport({class:L(a).ui?.viewport}))},null,8,[`class`])],2)):X(``,!0)]),_:3},16,[`data-collapsed`,`class`])],64))}}),a4={__name:`ContextMenuContent`,props:{items:{type:null,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0},sub:{type:Boolean,required:!1},labelKey:{type:null,required:!0},descriptionKey:{type:null,required:!0},checkedIcon:{type:null,required:!1},loadingIcon:{type:null,required:!1},externalIcon:{type:[Boolean,String],required:!1,skipCheck:!0},class:{type:null,required:!1},ui:{type:null,required:!0},uiOverride:{type:null,required:!1},loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},sideFlip:{type:Boolean,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=La(),{dir:a}=ch(),o=Am(),s=CE(kn(()=>n.portal)),c=vg(fm(n,`sub`,`items`,`portal`,`labelKey`,`descriptionKey`,`checkedIcon`,`loadingIcon`,`externalIcon`,`class`,`ui`,`uiOverride`),r),l=()=>Jm(i,[`default`]),[u,d]=wm(),f=Q(()=>a.value===`rtl`?o.ui.icons.chevronLeft:o.ui.icons.chevronRight),p=Q(()=>n.items?.length?eh(n.items)?n.items:[n.items]:[]);return(t,r)=>(W(),G(U,null,[J(L(u),null,{default:R(({item:r,active:a,index:s})=>[H(t.$slots,r.slot||`item`,{item:r,index:s,ui:e.ui},()=>[H(t.$slots,r.slot?`${r.slot}-leading`:`item-leading`,{item:r,active:a,index:s,ui:e.ui},()=>[r.loading?(W(),K(Yk,{key:0,name:e.loadingIcon||L(o).ui.icons.loading,"data-slot":`itemLeadingIcon`,class:N(e.ui.itemLeadingIcon({class:[e.uiOverride?.itemLeadingIcon,r.ui?.itemLeadingIcon],color:r?.color,loading:!0}))},null,8,[`name`,`class`])):r.icon?(W(),K(Yk,{key:1,name:r.icon,"data-slot":`itemLeadingIcon`,class:N(e.ui.itemLeadingIcon({class:[e.uiOverride?.itemLeadingIcon,r.ui?.itemLeadingIcon],color:r?.color,active:a}))},null,8,[`name`,`class`])):r.avatar?(W(),K(tA,Z({key:2,size:r.ui?.itemLeadingAvatarSize||e.uiOverride?.itemLeadingAvatarSize||e.ui.itemLeadingAvatarSize()},r.avatar,{"data-slot":`itemLeadingAvatar`,class:e.ui.itemLeadingAvatar({class:[e.uiOverride?.itemLeadingAvatar,r.ui?.itemLeadingAvatar],active:a})}),null,16,[`size`,`class`])):X(``,!0)]),L(Ym)(r,n.labelKey)||i[r.slot?`${r.slot}-label`:`item-label`]||L(Ym)(r,n.descriptionKey)||i[r.slot?`${r.slot}-description`:`item-description`]?(W(),G(`span`,{key:0,"data-slot":`itemWrapper`,class:N(e.ui.itemWrapper({class:[e.uiOverride?.itemWrapper,r.ui?.itemWrapper]}))},[q(`span`,{"data-slot":`itemLabel`,class:N(e.ui.itemLabel({class:[e.uiOverride?.itemLabel,r.ui?.itemLabel],active:a}))},[H(t.$slots,r.slot?`${r.slot}-label`:`item-label`,{item:r,active:a,index:s},()=>[Y(F(L(Ym)(r,n.labelKey)),1)]),r.target===`_blank`&&e.externalIcon!==!1?(W(),K(Yk,{key:0,name:typeof e.externalIcon==`string`?e.externalIcon:L(o).ui.icons.external,"data-slot":`itemLabelExternalIcon`,class:N(e.ui.itemLabelExternalIcon({class:[e.uiOverride?.itemLabelExternalIcon,r.ui?.itemLabelExternalIcon],color:r?.color,active:a}))},null,8,[`name`,`class`])):X(``,!0)],2),L(Ym)(r,n.descriptionKey)||i[r.slot?`${r.slot}-description`:`item-description`]?(W(),G(`span`,{key:0,"data-slot":`itemDescription`,class:N(e.ui.itemDescription({class:[e.uiOverride?.itemDescription,r.ui?.itemDescription]}))},[H(t.$slots,r.slot?`${r.slot}-description`:`item-description`,{item:r,active:a,index:s},()=>[Y(F(L(Ym)(r,n.descriptionKey)),1)])],2)):X(``,!0)],2)):X(``,!0),q(`span`,{"data-slot":`itemTrailing`,class:N(e.ui.itemTrailing({class:[e.uiOverride?.itemTrailing,r.ui?.itemTrailing]}))},[H(t.$slots,r.slot?`${r.slot}-trailing`:`item-trailing`,{item:r,active:a,index:s,ui:e.ui},()=>[r.children?.length?(W(),K(Yk,{key:0,name:f.value,"data-slot":`itemTrailingIcon`,class:N(e.ui.itemTrailingIcon({class:[e.uiOverride?.itemTrailingIcon,r.ui?.itemTrailingIcon],color:r?.color,active:a}))},null,8,[`name`,`class`])):r.kbds?.length?(W(),G(`span`,{key:1,"data-slot":`itemTrailingKbds`,class:N(e.ui.itemTrailingKbds({class:[e.uiOverride?.itemTrailingKbds,r.ui?.itemTrailingKbds]}))},[(W(!0),G(U,null,V(r.kbds,(t,n)=>(W(),K(_V,Z({key:n,size:r.ui?.itemTrailingKbdsSize||e.uiOverride?.itemTrailingKbdsSize||e.ui.itemTrailingKbdsSize()},{ref_for:!0},typeof t==`string`?{value:t}:t),null,16,[`size`]))),128))],2)):X(``,!0)]),J(L(wV).ItemIndicator,{"as-child":``},{default:R(()=>[J(Yk,{name:e.checkedIcon||L(o).ui.icons.check,"data-slot":`itemTrailingIcon`,class:N(e.ui.itemTrailingIcon({class:[e.uiOverride?.itemTrailingIcon,r.ui?.itemTrailingIcon],color:r?.color}))},null,8,[`name`,`class`])]),_:2},1024)],2)])]),_:3}),J(L(wV).Portal,P(ks(L(s))),{default:R(()=>[J(L(aA),null,{default:R(()=>[(W(),K(va(e.sub?L(wV).SubContent:L(wV).Content),Z({"data-slot":`content`,class:e.ui.content({class:[e.uiOverride?.content,n.class]})},L(c)),{default:R(()=>[H(t.$slots,`content-top`,{sub:e.sub??!1}),q(`div`,{role:`presentation`,"data-slot":`viewport`,class:N(e.ui.viewport({class:e.uiOverride?.viewport}))},[(W(!0),G(U,null,V(p.value,(r,i)=>(W(),K(L(wV).Group,{key:`group-${i}`,"data-slot":`group`,class:N(e.ui.group({class:e.uiOverride?.group}))},{default:R(()=>[(W(!0),G(U,null,V(r,(r,a)=>(W(),G(U,{key:`group-${i}-${a}`},[r.type===`label`?(W(),K(L(wV).Label,{key:0,"data-slot":`label`,class:N(e.ui.label({class:[e.uiOverride?.label,r.ui?.label,r.class]}))},{default:R(()=>[J(L(d),{item:r,index:a},null,8,[`item`,`index`])]),_:2},1032,[`class`])):r.type===`separator`?(W(),K(L(wV).Separator,{key:1,"data-slot":`separator`,class:N(e.ui.separator({class:[e.uiOverride?.separator,r.ui?.separator,r.class]}))},null,8,[`class`])):r?.children?.length?(W(),K(L(wV).Sub,{key:2,open:r.open,"default-open":r.defaultOpen},{default:R(()=>[J(L(wV).SubTrigger,{as:`button`,type:`button`,disabled:r.disabled,"text-value":L(Ym)(r,n.labelKey),"data-slot":`item`,class:N(e.ui.item({class:[e.uiOverride?.item,r.ui?.item,r.class],color:r?.color}))},{default:R(()=>[J(L(d),{item:r,index:a},null,8,[`item`,`index`])]),_:2},1032,[`disabled`,`text-value`,`class`]),J(a4,Z({sub:``,class:r.ui?.content,ui:e.ui,"ui-override":e.uiOverride,portal:e.portal,items:r.children,"align-offset":-4,"label-key":e.labelKey,"description-key":e.descriptionKey,"checked-icon":e.checkedIcon,"loading-icon":e.loadingIcon,"external-icon":e.externalIcon},{ref_for:!0},r.content),Sa({_:2},[V(l(),(e,n)=>({name:n,fn:R(e=>[H(t.$slots,n,Z({ref_for:!0},e))])}))]),1040,[`class`,`ui`,`ui-override`,`portal`,`items`,`label-key`,`description-key`,`checked-icon`,`loading-icon`,`external-icon`])]),_:2},1032,[`open`,`default-open`])):r.type===`checkbox`?(W(),K(L(wV).CheckboxItem,{key:3,"model-value":r.checked,disabled:r.disabled,"text-value":L(Ym)(r,n.labelKey),"data-slot":`item`,class:N(e.ui.item({class:[e.uiOverride?.item,r.ui?.item,r.class],color:r?.color})),"onUpdate:modelValue":r.onUpdateChecked,onSelect:r.onSelect},{default:R(()=>[J(L(d),{item:r,index:a},null,8,[`item`,`index`])]),_:2},1032,[`model-value`,`disabled`,`text-value`,`class`,`onUpdate:modelValue`,`onSelect`])):(W(),K(vA,Z({key:4,ref_for:!0},L(hA)(r),{custom:``}),{default:R(({active:t,...i})=>[J(L(wV).Item,{"as-child":``,disabled:r.disabled,"text-value":L(Ym)(r,n.labelKey),onSelect:r.onSelect},{default:R(()=>[J(gA,Z({ref_for:!0},i,{"data-slot":`item`,class:e.ui.item({class:[e.uiOverride?.item,r.ui?.item,r.class],active:t,color:r?.color})}),{default:R(()=>[J(L(d),{item:r,active:t,index:a},null,8,[`item`,`active`,`index`])]),_:2},1040,[`class`])]),_:2},1032,[`disabled`,`text-value`,`onSelect`])]),_:2},1040))],64))),128))]),_:2},1032,[`class`]))),128))],2),H(t.$slots,`default`),H(t.$slots,`content-bottom`,{sub:e.sub??!1})]),_:3},16,[`class`]))]),_:3})]),_:3},16)],64))}},o4={slots:{content:`min-w-32 max-h-(--reka-context-menu-content-available-height) bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] origin-(--reka-context-menu-content-transform-origin) flex flex-col`,viewport:`relative divide-y divide-default scroll-py-1 overflow-y-auto flex-1`,group:`p-1 isolate`,label:`w-full flex items-center font-semibold text-highlighted`,separator:`-mx-1 my-1 h-px bg-border`,item:`group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75`,itemLeadingIcon:`shrink-0`,itemLeadingAvatar:`shrink-0`,itemLeadingAvatarSize:``,itemTrailing:`ms-auto inline-flex gap-1.5 items-center`,itemTrailingIcon:`shrink-0`,itemTrailingKbds:`hidden lg:inline-flex items-center shrink-0`,itemTrailingKbdsSize:``,itemWrapper:`flex-1 flex flex-col text-start min-w-0`,itemLabel:`truncate`,itemDescription:`truncate text-muted`,itemLabelExternalIcon:`inline-block size-3 align-top text-dimmed`},variants:{color:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},active:{true:{item:`text-highlighted before:bg-elevated`,itemLeadingIcon:`text-default`},false:{item:[`text-default data-highlighted:text-highlighted data-[state=open]:text-highlighted data-highlighted:before:bg-elevated/50 data-[state=open]:before:bg-elevated/50`,`transition-colors before:transition-colors`],itemLeadingIcon:[`text-dimmed group-data-highlighted:text-default group-data-[state=open]:text-default`,`transition-colors`]}},loading:{true:{itemLeadingIcon:`animate-spin`}},size:{xs:{label:`p-1 text-xs gap-1`,item:`p-1 text-xs gap-1`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemTrailingIcon:`size-4`,itemTrailingKbds:`gap-0.5`,itemTrailingKbdsSize:`sm`},sm:{label:`p-1.5 text-xs gap-1.5`,item:`p-1.5 text-xs gap-1.5`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemTrailingIcon:`size-4`,itemTrailingKbds:`gap-0.5`,itemTrailingKbdsSize:`sm`},md:{label:`p-1.5 text-sm gap-1.5`,item:`p-1.5 text-sm gap-1.5`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemTrailingIcon:`size-5`,itemTrailingKbds:`gap-0.5`,itemTrailingKbdsSize:`md`},lg:{label:`p-2 text-sm gap-2`,item:`p-2 text-sm gap-2`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemTrailingIcon:`size-5`,itemTrailingKbds:`gap-1`,itemTrailingKbdsSize:`md`},xl:{label:`p-2 text-base gap-2`,item:`p-2 text-base gap-2`,itemLeadingIcon:`size-6`,itemLeadingAvatarSize:`xs`,itemTrailingIcon:`size-6`,itemTrailingKbds:`gap-1`,itemTrailingKbdsSize:`lg`}}},compoundVariants:[{color:`primary`,active:!1,class:{item:`text-primary data-highlighted:text-primary data-highlighted:before:bg-primary/10 data-[state=open]:before:bg-primary/10`,itemLeadingIcon:`text-primary/75 group-data-highlighted:text-primary group-data-[state=open]:text-primary`}},{color:`secondary`,active:!1,class:{item:`text-secondary data-highlighted:text-secondary data-highlighted:before:bg-secondary/10 data-[state=open]:before:bg-secondary/10`,itemLeadingIcon:`text-secondary/75 group-data-highlighted:text-secondary group-data-[state=open]:text-secondary`}},{color:`success`,active:!1,class:{item:`text-success data-highlighted:text-success data-highlighted:before:bg-success/10 data-[state=open]:before:bg-success/10`,itemLeadingIcon:`text-success/75 group-data-highlighted:text-success group-data-[state=open]:text-success`}},{color:`info`,active:!1,class:{item:`text-info data-highlighted:text-info data-highlighted:before:bg-info/10 data-[state=open]:before:bg-info/10`,itemLeadingIcon:`text-info/75 group-data-highlighted:text-info group-data-[state=open]:text-info`}},{color:`warning`,active:!1,class:{item:`text-warning data-highlighted:text-warning data-highlighted:before:bg-warning/10 data-[state=open]:before:bg-warning/10`,itemLeadingIcon:`text-warning/75 group-data-highlighted:text-warning group-data-[state=open]:text-warning`}},{color:`error`,active:!1,class:{item:`text-error data-highlighted:text-error data-highlighted:before:bg-error/10 data-[state=open]:before:bg-error/10`,itemLeadingIcon:`text-error/75 group-data-highlighted:text-error group-data-[state=open]:text-error`}},{color:`primary`,active:!0,class:{item:`text-primary before:bg-primary/10`,itemLeadingIcon:`text-primary`}},{color:`secondary`,active:!0,class:{item:`text-secondary before:bg-secondary/10`,itemLeadingIcon:`text-secondary`}},{color:`success`,active:!0,class:{item:`text-success before:bg-success/10`,itemLeadingIcon:`text-success`}},{color:`info`,active:!0,class:{item:`text-info before:bg-info/10`,itemLeadingIcon:`text-info`}},{color:`warning`,active:!0,class:{item:`text-warning before:bg-warning/10`,itemLeadingIcon:`text-warning`}},{color:`error`,active:!0,class:{item:`text-error before:bg-error/10`,itemLeadingIcon:`text-error`}}],defaultVariants:{size:`md`}},s4={__name:`ContextMenu`,props:{size:{type:null,required:!1},items:{type:null,required:!1},checkedIcon:{type:null,required:!1},loadingIcon:{type:null,required:!1},externalIcon:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},content:{type:Object,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},labelKey:{type:null,required:!1,default:`label`},descriptionKey:{type:null,required:!1,default:`description`},disabled:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},pressOpenDelay:{type:Number,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,i=La(),a=AE(`contextMenu`,n),o=Am(),s=jE(pm(a,`modal`),r),c=kn(()=>a.content),l=()=>Jm(i,[`default`]),u=Q(()=>Jk({extend:o4,...o.ui?.contextMenu||{}})({size:a.size}));return(e,t)=>(W(),K(L(aC),P(ks(L(s))),{default:R(()=>[i.default?(W(),K(L(yC),{key:0,"as-child":``,disabled:L(a).disabled,class:N(L(a).class)},{default:R(()=>[H(e.$slots,`default`)]),_:3},8,[`disabled`,`class`])):X(``,!0),J(a4,Z({class:u.value.content({class:[!i.default&&L(a).class,L(a).ui?.content]}),ui:u.value,"ui-override":L(a).ui},c.value,{items:L(a).items,portal:L(a).portal,"label-key":L(a).labelKey,"description-key":L(a).descriptionKey,"checked-icon":L(a).checkedIcon,"loading-icon":L(a).loadingIcon,"external-icon":L(a).externalIcon}),Sa({_:2},[V(l(),(t,n)=>({name:n,fn:R(t=>[H(e.$slots,n,P(ks(t)))])}))]),1040,[`class`,`ui`,`ui-override`,`items`,`portal`,`label-key`,`description-key`,`checked-icon`,`loading-icon`,`external-icon`])]),_:3},16))}},c4={key:0,class:`channel-import-reading`},l4={class:`channel-import-list`,"aria-live":`polite`},u4={class:`channel-import-head`},d4=[`title`],f4={key:0,role:`alert`,class:`channel-import-error`},p4={key:1,class:`channel-import-members`},m4=[`title`],h4={class:`dialog-actions`},g4=EH({__name:`ImportDialog`,props:{open:{type:Boolean,default:!1},openModifiers:{}},emits:[`update:open`],setup(e){let t=uo(e,`open`),{view:n}=Or(`discussion`),r=Q(()=>n.value.import_progress||{done:!1,rooms:[],errors:[]}),i={importing:{icon:`i-lucide-loader-circle`,label:`导入中`},imported:{icon:`i-lucide-check`,label:`已导入`},skipped:{icon:`i-lucide-minus`,label:`已存在,跳过`},failed:{icon:`i-lucide-x`,label:`导入失败`}},a=Q(()=>{if(!r.value.done)return`正在导入,请保持页面打开`;let e=e=>r.value.rooms.filter(t=>t.status===e).length,t=e(`failed`)+r.value.errors.length;return[`已导入 ${e(`imported`)} 个房间`,e(`skipped`)&&`跳过 ${e(`skipped`)} 个`,t&&`失败 ${t} 项`].filter(Boolean).join(`,`)});return(e,n)=>{let o=Yk,s=bA,c=$B;return W(),K(c,{content:{onInteractOutside:e=>e.preventDefault()},open:t.value,"onUpdate:open":n[1]||=e=>t.value=e,title:`导入房间`,description:a.value,dismissible:r.value.done,close:r.value.done,ui:{content:`glass-panel studio-modal channel-folder-modal channel-import-modal`,body:`dialog-body`}},{body:R(()=>[!r.value.done&&!r.value.rooms.length?(W(),G(`p`,c4,`正在读取备份文件…`)):X(``,!0),q(`ul`,l4,[(W(!0),G(U,null,V(r.value.rooms,(e,t)=>(W(),G(`li`,{key:t,class:N([`channel-import-room`,`is-${e.status}`])},[q(`div`,u4,[J(o,{name:i[e.status].icon,class:N({"animate-spin":e.status===`importing`})},null,8,[`name`,`class`]),q(`strong`,{title:e.title},F(e.title),9,d4),q(`span`,null,F(i[e.status].label),1)]),e.error?(W(),G(`p`,f4,F(e.error),1)):X(``,!0),e.members.length?(W(),G(`ul`,p4,[(W(!0),G(U,null,V(e.members,e=>(W(),G(`li`,{key:e.name,class:N({"is-failed":e.failed})},[q(`span`,null,F(e.name),1),Y(F(e.text)+` `,1),e.resume?(W(),G(`code`,{key:0,title:`没有开着的原窗口时,在 ${e.resume.cwd} 运行`},F(e.resume.command),9,m4)):X(``,!0)],2))),128))])):X(``,!0),(W(!0),G(U,null,V(e.problems,e=>(W(),G(`p`,{key:e,class:`channel-import-error`},F(e),1))),128))],2))),128))]),(W(!0),G(U,null,V(r.value.errors,e=>(W(),G(`p`,{key:e,role:`alert`,class:`channel-import-error is-file`},F(e),1))),128)),q(`div`,h4,[J(s,{label:`完成`,class:`channel-primary-button`,disabled:!r.value.done,onClick:n[0]||=e=>t.value=!1},null,8,[`disabled`])])]),_:1},8,[`content`,`open`,`description`,`dismissible`,`close`])}}},[[`__scopeId`,`data-v-c7d0eeb8`]]),_4={class:`channel-directory-manager`},v4={class:`channel-directory-heading`},y4=[`aria-expanded`],b4={class:`channel-directory-actions`},x4={"aria-label":`协作房间列表`,class:`channel-room-list`,"data-room-directory":``},S4=[`data-room-folder`,`data-drag-folder`],C4=[`disabled`,`aria-label`,`aria-expanded`,`onKeydown`,`onClick`],w4={class:`channel-folder-name`},T4={class:`channel-directory-count`,"aria-hidden":`true`},E4={class:`channel-folder-actions`},D4=[`data-drop-folder`],O4={key:0,class:`channel-directory-empty`,role:`status`},k4=[`data-drag-room`],A4=[`aria-label`,`disabled`,`onKeydown`],j4=[`title`,`aria-label`,`aria-current`,`onClick`],M4={class:`channel-room-time`,"aria-hidden":`true`},N4={class:`channel-room-actions`},P4={key:0,class:`channel-directory-empty`},F4={key:0,class:`channel-archive-count`},I4={__name:`ChannelDirectory`,emits:[`select`,`manage`,`create`,`create-folder`,`manage-folder`,`delete-folder`,`archive-folder`,`archives`],setup(e,{emit:t}){let n=t,{view:r,bridge:i,act:a,pending:o}=Or(`discussion`),s=Q(()=>r.value.rooms.filter(e=>!e.archived)),c=Q(()=>r.value.rooms.filter(e=>e.archived).length),l=Q(()=>(r.value.folder_groups||[]).map(e=>({...e,rooms:s.value.filter(t=>(t.folder_id||``)===e.id)}))),u=Q(()=>r.value.directory_sort!==`recent`),d=Q(()=>r.value.room_source||{}),f=Q(()=>d.value.computer?d.value.signed_in?d.value.remote?d.value.online===!1?`协作房间(电脑离线)`:`协作房间`:d.value.online===!1?`协作房间(电脑离线)`:`协作房间(电脑未连接)`:`协作房间(未配对)`:`协作房间`),p=Q(()=>[{label:`对话排列方式`,type:`label`},...[{value:`manual`,label:`手动排序`},{value:`recent`,label:`最近发言`}].map(e=>({label:e.label,icon:(r.value.directory_sort||`manual`)===e.value?`i-lucide-check`:void 0,onSelect:()=>a(`sort_directory`,e.value)})),{type:`separator`},{label:`导入房间…`,icon:`i-lucide-download`,disabled:r.value.backup_pending,onSelect:()=>_(null)},{label:`导出全部房间`,icon:`i-lucide-upload`,disabled:r.value.backup_pending||!r.value.rooms.length,onSelect:()=>a(`backup_rooms`,{ids:r.value.rooms.map(e=>e.id),name:`全部房间`})}]),m=I(null),h=I(!1),g=null;function _(e){g=e,m.value?.click()}function v(e){let t=[...e.target.files];e.target.value=``,t.length&&(h.value=!0,a(`import_rooms`,{files:t,folder_id:g}))}function y(e){let t=new Date(e.latest_at||e.created_at||``).getTime();if(Number.isNaN(t))return``;let n=Math.max(0,Math.floor((Date.now()-t)/6e4)),r=Math.floor(n/1440);return n<1?`刚刚`:n<60?`${n}分钟前`:n<1440?`${Math.floor(n/60)}小时前`:r<7?`${r}天前`:r<30?`${Math.floor(r/7)}周前`:r<365?`${Math.floor(r/30)}个月前`:`${Math.floor(r/365)}年前`}function b(e){let t=e=>new Date(e).toLocaleString(`zh-CN`,{hour12:!1});return[e.title,e.latest_at&&`最近发言 ${t(e.latest_at)}`,e.created_at&&`创建于 ${t(e.created_at)}`].filter(Boolean).join(`
57
57
  `)}let x=Q(()=>JSON.stringify([r.value.directory_pending,r.value.archive_pending,r.value.backup_pending,r.value.folders,r.value.room_site,u.value,r.value.room?.id,o.value]));function S(e,t,n){return{items:A(e,t,e.folder_id||null,n),active:e.id===r.value.room?.id,busy:!!o.value,archiving:r.value.archive_pending.includes(e.id),time:y(e),title:b(e)}}function C(e,t){let n=e.id?E(e,t):[],i={items:n,collapsed:T.value.has(e.id),active:r.value.room?.folder_id===e.id,creating:r.value.directory_pending.includes(`create-room`)};return i.key=JSON.stringify([e,i.collapsed,i.active,i.creating,n.map(e=>e.map(e=>[e.label,e.disabled]))]),i}let w=I(!0),T=I(O());z(()=>r.value.room?.id,()=>{let e=r.value.room?.folder_id||``;e&&T.value.has(e)&&k(e)});function E(e,t){let i=r.value.directory_pending.includes(`folder-order`)||r.value.directory_pending.includes(`create-folder`);return[...e.id?[[{label:`重命名`,icon:`i-lucide-pencil`,disabled:e.pending||r.value.directory_pending.includes(`folder-name:${e.id}`),onSelect:()=>n(`manage-folder`,e)}]]:[],[{label:`上移`,icon:`i-lucide-arrow-up`,disabled:i||t===0||!!o.value,onSelect:()=>a(`move_folder`,{id:e.order_id,direction:-1})},{label:`下移`,icon:`i-lucide-arrow-down`,disabled:i||t===l.value.length-1||!!o.value,onSelect:()=>a(`move_folder`,{id:e.order_id,direction:1})}],[{label:`导入房间…`,icon:`i-lucide-download`,disabled:e.pending||r.value.backup_pending,onSelect:()=>_(e.id||null)},D(e)],...e.id?[[{label:`存档文件夹`,icon:`i-lucide-archive`,disabled:e.pending||!e.rooms.length||e.rooms.some(e=>r.value.archive_pending.includes(e.id)),onSelect:()=>n(`archive-folder`,e)},{label:`移除文件夹`,icon:`i-lucide-folder-minus`,disabled:e.pending||i||r.value.directory_pending.includes(`folder-name:${e.id}`)||r.value.creating_room?.folder_id===e.id||r.value.rooms.some(t=>t.folder_id===e.id&&r.value.folder_pending.includes(t.id)),onSelect:()=>n(`delete-folder`,e)}]]:[]]}function D(e){let t=r.value.rooms.filter(t=>(t.folder_id||``)===e.id).map(e=>e.id);return{label:`导出文件夹`,icon:`i-lucide-upload`,disabled:r.value.backup_pending||!t.length,onSelect:()=>a(`backup_rooms`,{ids:t,name:e.name||`未分组`})}}function O(){try{return new Set(JSON.parse(localStorage.getItem(`ai-codiscuss-folders-collapsed`)||`[]`))}catch{return new Set}}function k(e){let t=new Set(T.value);t.has(e)?t.delete(e):t.add(e),T.value=t;try{localStorage.setItem(`ai-codiscuss-folders-collapsed`,JSON.stringify([...t]))}catch{}}function A(e,t,i,s){let c=r.value.directory_pending.includes(`room-order`),l=e.id===r.value.room?.id;return[[{label:`重命名`,icon:`i-lucide-pencil`,disabled:r.value.directory_pending.includes(`rename:${e.id}`),onSelect:()=>n(`manage`,{room:e,action:`rename`})},...l?[{label:`编辑议题`,icon:`i-lucide-pencil`,onSelect:()=>n(`manage`,{room:e,action:`edit`})}]:[],{label:`复制阅读入口`,icon:`i-lucide-link`,onSelect:()=>a(`copy`,`${r.value.room_site}/r/${encodeURIComponent(e.id)}`)},{label:`导出对话`,icon:`i-lucide-upload`,disabled:r.value.backup_pending||!!o.value,onSelect:()=>a(`backup`,e.id)}],...l?[[{label:`刷新消息`,icon:`i-lucide-refresh-cw`,onSelect:()=>a(`refresh`)}]]:[],[{label:`移至文件夹`,icon:`i-lucide-folder-input`,disabled:!!o.value||!e.folder_id&&!r.value.folders?.length,children:[{label:`移出文件夹`,icon:`i-lucide-folder-minus`,disabled:!e.folder_id,onSelect:()=>a(`manage_channel`,{id:e.id,action:`folder`,folder_id:null})},...(r.value.folders||[]).map(t=>({label:t.name,icon:`i-lucide-folder`,disabled:t.pending||e.folder_id===t.id,onSelect:()=>a(`manage_channel`,{id:e.id,action:`folder`,folder_id:t.id})}))]}],[{label:`上移`,icon:`i-lucide-arrow-up`,disabled:c||!u.value||t===0||!!o.value,onSelect:()=>a(`move_channel`,{id:e.id,direction:-1,folder_id:i})},{label:`下移`,icon:`i-lucide-arrow-down`,disabled:c||!u.value||t===s-1||!!o.value,onSelect:()=>a(`move_channel`,{id:e.id,direction:1,folder_id:i})}],[{label:e.archived?`恢复房间`:`存档房间`,icon:e.archived?`i-lucide-archive-restore`:`i-lucide-archive`,disabled:r.value.archive_pending.includes(e.id),onSelect:()=>n(`manage`,{room:e,action:e.archived?`restore`:`archive`})},{label:`永久删除`,icon:`i-lucide-trash-2`,disabled:r.value.directory_pending.includes(`rename:${e.id}`),onSelect:()=>n(`manage`,{room:e,action:`delete`})}]]}return(e,t)=>{let u=bA,d=Yk,g=yV,_=MV,b=s4;return W(),G(`div`,_4,[J(u,{label:`新建对话`,icon:`i-lucide-plus`,color:`neutral`,class:`channel-primary-button channel-new-conversation`,disabled:L(r).directory_pending.includes(`create-room`),onClick:t[0]||=e=>n(`create`,null)},null,8,[`disabled`]),q(`div`,v4,[q(`button`,{type:`button`,class:`channel-section-toggle`,"aria-expanded":w.value,onClick:t[1]||=e=>w.value=!w.value},[J(d,{name:w.value?`i-lucide-chevron-down`:`i-lucide-chevron-right`},null,8,[`name`]),Y(F(f.value),1)],8,y4),q(`div`,b4,[J(g,{text:`新建文件夹`},{default:R(()=>[J(u,{icon:`i-lucide-plus`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`新建文件夹`,disabled:L(r).directory_pending.includes(`create-folder`),onClick:t[2]||=e=>n(`create-folder`)},null,8,[`disabled`])]),_:1}),J(_,{items:p.value,content:{align:`end`,sideOffset:4},ui:{content:`channel-menu channel-directory-menu`}},{default:R(()=>[J(u,{icon:`i-lucide-ellipsis`,"aria-label":`房间目录选项`,title:`排列、导入与导出`,size:`xs`,color:`neutral`,variant:`ghost`})]),_:1},8,[`items`]),q(`input`,{ref_key:`import_input`,ref:m,type:`file`,accept:`.zip,.json`,multiple:``,hidden:``,"aria-label":`选择房间备份`,onChange:v},null,544)])]),Tr(q(`nav`,x4,[(W(!0),G(U,null,V(l.value,(e,s)=>(W(),G(`section`,{key:e.order_id,class:`channel-folder-section`,"data-room-folder":e.id,"data-drag-folder":e.order_id},[(W(!0),G(U,null,V([C(e,s)],r=>(W(),G(U,{key:e.order_id},[e.id?(W(),K(L(aG),{key:0,deps:[r.key]},{default:R(()=>[q(`div`,{class:N([`channel-folder-row`,{active:r.collapsed&&r.active}])},[q(`button`,{class:`channel-folder-heading`,"data-drop-folder":``,"data-drag-handle":``,type:`button`,disabled:e.pending,"aria-label":`${e.name} ${e.rooms.length}`,"aria-expanded":!r.collapsed,title:`拖动文件夹排序;上下方向键移动`,onPointerdown:t[3]||=e=>!L(o)&&L(i).start_drag(e),onKeydown:[yu(_u(t=>L(a)(`move_folder`,{id:e.order_id,direction:-1}),[`prevent`]),[`up`]),yu(_u(t=>L(a)(`move_folder`,{id:e.order_id,direction:1}),[`prevent`]),[`down`])],onClick:t=>k(e.id)},[J(d,{name:r.collapsed?`i-lucide-chevron-right`:`i-lucide-chevron-down`},null,8,[`name`]),J(d,{name:`i-lucide-folder`}),q(`span`,w4,F(e.name),1),q(`small`,T4,F(e.pending?`保存中`:e.rooms.length||``),1)],40,C4),q(`div`,E4,[J(g,{text:`在${e.name}中新建对话`},{default:R(()=>[J(u,{icon:`i-lucide-square-pen`,"aria-label":`在${e.name}中新建对话`,disabled:e.pending||r.creating,size:`xs`,color:`neutral`,variant:`ghost`,onClick:t=>n(`create`,e.id?e:null)},null,8,[`aria-label`,`disabled`,`onClick`])]),_:2},1032,[`text`]),J(_,{items:r.items,content:{align:`start`,side:`bottom`,sideOffset:6},ui:{content:`channel-menu channel-topic-menu`}},{default:R(()=>[J(u,{icon:`i-lucide-ellipsis`,"aria-label":`管理文件夹 ${e.name}`,title:`文件夹选项`,size:`xs`,color:`neutral`,variant:`ghost`},null,8,[`aria-label`])]),_:2},1032,[`items`])])],2)]),_:2},1032,[`deps`])):X(``,!0)],64))),128)),!e.id||!T.value.has(e.id)?(W(),G(`div`,{key:0,class:N(e.id?`channel-folder-rooms`:`channel-root-rooms`),"data-drop-folder":e.id?void 0:``},[L(r).creating_room&&(L(r).creating_room.folder_id||``)===e.id?(W(),G(`p`,O4,`正在创建:`+F(L(r).creating_room.title),1)):X(``,!0),(W(!0),G(U,null,V(e.rooms,(r,s)=>(W(),K(L(aG),{key:r.id,deps:[JSON.stringify(r),s,e.rooms.length,x.value,y(r)]},{default:R(()=>[(W(!0),G(U,null,V([S(r,s,e.rooms.length)],e=>(W(),K(b,{key:r.id,items:e.items,ui:{content:`channel-menu channel-topic-menu`}},{default:R(()=>[q(`div`,{class:N([`channel-room-row`,{active:e.active}]),"data-drag-room":r.id},[q(`button`,{class:`channel-room-grip`,"data-drag-handle":``,"aria-label":`拖动 ${r.title}`,title:`拖动排序;上下方向键移动`,disabled:e.busy,onPointerdown:t[4]||=e=>L(i).start_drag(e),onKeydown:[yu(_u(e=>L(a)(`move_channel`,{id:r.id,direction:-1,folder_id:r.folder_id||null}),[`prevent`]),[`up`]),yu(_u(e=>L(a)(`move_channel`,{id:r.id,direction:1,folder_id:r.folder_id||null}),[`prevent`]),[`down`])]},[J(d,{name:`i-lucide-grip-vertical`})],40,A4),q(`button`,{class:`channel-room-select`,"data-drag-title":``,title:e.title,"aria-label":r.title,"aria-current":e.active?`page`:void 0,onPointerdown:t[5]||=e=>!L(o)&&L(i).start_drag(e),onClick:e=>n(`select`,r.id)},[q(`span`,null,F(r.title),1),q(`small`,M4,F(e.time),1)],40,j4),q(`div`,N4,[J(g,{text:r.archived?`恢复房间`:`存档房间`,ui:{content:`channel-topic-tooltip`}},{default:R(()=>[J(u,{icon:r.archived?`i-lucide-archive-restore`:`i-lucide-archive`,"aria-label":`${r.archived?`恢复`:`存档`} ${r.title}`,size:`xs`,color:`neutral`,variant:`ghost`,disabled:e.busy||e.archiving,onClick:e=>n(`manage`,{room:r,action:r.archived?`restore`:`archive`})},null,8,[`icon`,`aria-label`,`disabled`,`onClick`])]),_:2},1032,[`text`]),J(_,{items:e.items,content:{align:`start`,side:`bottom`,sideOffset:6},ui:{content:`channel-menu channel-topic-menu`}},{default:R(()=>[J(u,{icon:`i-lucide-ellipsis`,"aria-label":`管理 ${r.title}`,title:`更多操作`,size:`xs`,color:`neutral`,variant:`ghost`},null,8,[`aria-label`])]),_:2},1032,[`items`])])],10,k4)]),_:2},1032,[`items`]))),128))]),_:2},1032,[`deps`]))),128))],10,D4)):X(``,!0)],8,S4))),128)),s.value.length?X(``,!0):(W(),G(`p`,P4,`暂无协作房间`))],512),[[Jc,w.value]]),Tr(J(u,{icon:`i-lucide-archive`,color:`neutral`,variant:`ghost`,class:`channel-archive-toggle`,"aria-haspopup":`dialog`,onClick:t[6]||=e=>n(`archives`)},{default:R(()=>[t[8]||=q(`span`,{class:`channel-archive-label`},`已存档`,-1),c.value?(W(),G(`small`,F4,F(c.value),1)):X(``,!0)]),_:1},512),[[Jc,w.value]]),J(g4,{open:h.value,"onUpdate:open":t[7]||=e=>h.value=e},null,8,[`open`])])}}},L4={id:`channel-sidebar`,class:`channel-sidebar`,"aria-label":`房间导航`},R4={class:`channel-sidebar-content`},z4={class:`channel-directory-heading channel-tools-heading`},B4=[`aria-expanded`],V4={class:`channel-sidebar-footer`},H4=[`aria-label`],U4={class:`channel-self`},W4=[`title`],G4={__name:`ChannelSidebar`,props:{tabs:{type:Array,required:!0}},emits:[`select`,`manage`,`create`,`create-folder`,`manage-folder`,`delete-folder`,`archive-folder`,`archives`,`tab`,`settings`],setup(e,{emit:t}){let n=e,r=t,{view:i,bridge:a,field:o}=Or(`discussion`),s=o(`author-select`),c=I(!0),l=Q(()=>i.value.room?i.value.tab:null),u=Q(()=>{let e=l.value;return n.tabs.map(t=>({...t,active:e!==null&&e===t.value,disabled:e===null||t.disabled,onSelect:()=>r(`tab`,t.value)}))}),d=Q(()=>{let e=i.value.admin;return e?.loaded?e.devices?e.logged_in?``:`未配对 · 点击配对`:e.registered?e.logged_in?``:`未登录 · 点击登录`:`设置管理员账号`:``});return(e,t)=>{let n=Yk,o=i4,l=tA,f=bA,p=yV,m=ya(`keep-reading`);return W(),G(`aside`,L4,[t[13]||=js(`<header class="channel-workspace-heading"><span class="channel-brand-icon" aria-hidden="true"><svg class="channel-brand-dark" viewBox="0 0 100 100"><defs><linearGradient id="brand-d0" gradientUnits="userSpaceOnUse" x1="4.5" y1="64" x2="95.5" y2="64"><stop offset="0.0%" stop-color="#e9ebed"></stop><stop offset="6.3%" stop-color="#e2e5e7"></stop><stop offset="12.5%" stop-color="#dcdee1"></stop><stop offset="18.8%" stop-color="#d5d8db"></stop><stop offset="25.0%" stop-color="#ced2d5"></stop><stop offset="31.3%" stop-color="#c8cbcf"></stop><stop offset="37.5%" stop-color="#c1c5ca"></stop><stop offset="43.8%" stop-color="#babfc4"></stop><stop offset="50.0%" stop-color="#b4b9be"></stop><stop offset="56.3%" stop-color="#a9aeb3"></stop><stop offset="62.5%" stop-color="#9ea3a9"></stop><stop offset="68.8%" stop-color="#93999f"></stop><stop offset="75.0%" stop-color="#888e95"></stop><stop offset="81.3%" stop-color="#7e848a"></stop><stop offset="87.5%" stop-color="#737a80"></stop><stop offset="93.8%" stop-color="#697077"></stop><stop offset="100.0%" stop-color="#5f666d"></stop></linearGradient><linearGradient id="brand-d1" gradientUnits="userSpaceOnUse" x1="8.5" y1="36" x2="91.5" y2="36"><stop offset="0.0%" stop-color="#3f86ff"></stop><stop offset="6.3%" stop-color="#5588ff"></stop><stop offset="12.5%" stop-color="#6889ff"></stop><stop offset="18.8%" stop-color="#788aff"></stop><stop offset="25.0%" stop-color="#878bff"></stop><stop offset="31.3%" stop-color="#958cff"></stop><stop offset="37.5%" stop-color="#a78aef"></stop><stop offset="43.8%" stop-color="#b986d7"></stop><stop offset="50.0%" stop-color="#ca80bf"></stop><stop offset="56.3%" stop-color="#da78a6"></stop><stop offset="62.5%" stop-color="#ea6e8c"></stop><stop offset="68.8%" stop-color="#f56d78"></stop><stop offset="75.0%" stop-color="#f77f72"></stop><stop offset="81.3%" stop-color="#f8906b"></stop><stop offset="87.5%" stop-color="#f9a163"></stop><stop offset="93.8%" stop-color="#fab058"></stop><stop offset="100.0%" stop-color="#fac04a"></stop></linearGradient><linearGradient id="brand-d2" gradientUnits="userSpaceOnUse" x1="28.021" y1="95.435" x2="39.978" y2="4.564"><stop offset="0.0%" stop-color="#d06a49"></stop><stop offset="6.3%" stop-color="#d36f4f"></stop><stop offset="12.5%" stop-color="#d67456"></stop><stop offset="18.8%" stop-color="#d97a5c"></stop><stop offset="25.0%" stop-color="#dc7f62"></stop><stop offset="31.3%" stop-color="#df8468"></stop><stop offset="37.5%" stop-color="#e2896e"></stop><stop offset="43.8%" stop-color="#e58e74"></stop><stop offset="50.0%" stop-color="#e8937a"></stop><stop offset="56.3%" stop-color="#eb9d85"></stop><stop offset="62.5%" stop-color="#eea68f"></stop><stop offset="68.8%" stop-color="#f1b09a"></stop><stop offset="75.0%" stop-color="#f4baa4"></stop><stop offset="81.3%" stop-color="#f6c3af"></stop><stop offset="87.5%" stop-color="#f9cdb9"></stop><stop offset="93.8%" stop-color="#fbd6c4"></stop><stop offset="100.0%" stop-color="#fde0cf"></stop></linearGradient><linearGradient id="brand-d3" gradientUnits="userSpaceOnUse" x1="71.978" y1="95.435" x2="60.021" y2="4.564"><stop offset="0.0%" stop-color="#4a5cff"></stop><stop offset="6.3%" stop-color="#5062ff"></stop><stop offset="12.5%" stop-color="#5768ff"></stop><stop offset="18.8%" stop-color="#5d6dff"></stop><stop offset="25.0%" stop-color="#6472ff"></stop><stop offset="31.3%" stop-color="#6b77ff"></stop><stop offset="37.5%" stop-color="#717cff"></stop><stop offset="43.8%" stop-color="#7881ff"></stop><stop offset="50.0%" stop-color="#7f86ff"></stop><stop offset="56.3%" stop-color="#8990ff"></stop><stop offset="62.5%" stop-color="#9399ff"></stop><stop offset="68.8%" stop-color="#9da2ff"></stop><stop offset="75.0%" stop-color="#a8abff"></stop><stop offset="81.3%" stop-color="#b3b4ff"></stop><stop offset="87.5%" stop-color="#bebdff"></stop><stop offset="93.8%" stop-color="#c9c5ff"></stop><stop offset="100.0%" stop-color="#d4ceff"></stop></linearGradient><clipPath id="brand-d4"><polygon points="16,46.5 84,46.5 84,25.5 16,25.5"></polygon></clipPath><clipPath id="brand-d5"><polygon points="16,48.5 84,48.5 84,23.5 16,23.5"></polygon></clipPath><clipPath id="brand-d6"><polygon points="81.410,86.630 71.410,10.630 50.589,13.369 60.589,89.369"></polygon></clipPath><clipPath id="brand-d7"><polygon points="83.393,86.369 73.393,10.369 48.606,13.630 58.606,89.630"></polygon></clipPath><clipPath id="brand-d8"><polygon points="12,74.5 88,74.5 88,53.5 12,53.5"></polygon></clipPath><clipPath id="brand-d9"><polygon points="12,76.5 88,76.5 88,51.5 12,51.5"></polygon></clipPath><clipPath id="brand-d10"><polygon points="39.410,89.369 49.410,13.369 28.589,10.630 18.589,86.630"></polygon></clipPath><clipPath id="brand-d11"><polygon points="41.393,89.630 51.393,13.630 26.606,10.369 16.606,86.369"></polygon></clipPath></defs><line x1="12" y1="64" x2="88" y2="64" stroke="url(#brand-d0)" stroke-width="15" stroke-linecap="round"></line><line x1="16" y1="36" x2="84" y2="36" stroke="url(#brand-d1)" stroke-width="15" stroke-linecap="round"></line><line x1="29" y1="88" x2="39" y2="12" stroke="url(#brand-d2)" stroke-width="15" stroke-linecap="round"></line><line x1="71" y1="88" x2="61" y2="12" stroke="url(#brand-d3)" stroke-width="15" stroke-linecap="round"></line><g clip-path="url(#brand-d4)"><line x1="29" y1="88" x2="39" y2="12" stroke="#202127" stroke-width="21" stroke-linecap="round"></line></g><g clip-path="url(#brand-d5)"><line x1="29" y1="88" x2="39" y2="12" stroke="url(#brand-d2)" stroke-width="15" stroke-linecap="round"></line></g><g clip-path="url(#brand-d6)"><line x1="16" y1="36" x2="84" y2="36" stroke="#202127" stroke-width="21" stroke-linecap="round"></line></g><g clip-path="url(#brand-d7)"><line x1="16" y1="36" x2="84" y2="36" stroke="url(#brand-d1)" stroke-width="15" stroke-linecap="round"></line></g><g clip-path="url(#brand-d8)"><line x1="71" y1="88" x2="61" y2="12" stroke="#202127" stroke-width="21" stroke-linecap="round"></line></g><g clip-path="url(#brand-d9)"><line x1="71" y1="88" x2="61" y2="12" stroke="url(#brand-d3)" stroke-width="15" stroke-linecap="round"></line></g><g clip-path="url(#brand-d10)"><line x1="12" y1="64" x2="88" y2="64" stroke="#202127" stroke-width="21" stroke-linecap="round"></line></g><g clip-path="url(#brand-d11)"><line x1="12" y1="64" x2="88" y2="64" stroke="url(#brand-d0)" stroke-width="15" stroke-linecap="round"></line></g></svg><svg class="channel-brand-light" viewBox="0 0 100 100"><defs><linearGradient id="brand-l0" gradientUnits="userSpaceOnUse" x1="4.5" y1="64" x2="95.5" y2="64"><stop offset="0.0%" stop-color="#0b0d0f"></stop><stop offset="6.3%" stop-color="#101315"></stop><stop offset="12.5%" stop-color="#16191b"></stop><stop offset="18.8%" stop-color="#1c1f22"></stop><stop offset="25.0%" stop-color="#222529"></stop><stop offset="31.3%" stop-color="#282c2f"></stop><stop offset="37.5%" stop-color="#2e3237"></stop><stop offset="43.8%" stop-color="#34393e"></stop><stop offset="50.0%" stop-color="#3b4045"></stop><stop offset="56.3%" stop-color="#484d52"></stop><stop offset="62.5%" stop-color="#555a5f"></stop><stop offset="68.8%" stop-color="#62676d"></stop><stop offset="75.0%" stop-color="#70757b"></stop><stop offset="81.3%" stop-color="#7e8389"></stop><stop offset="87.5%" stop-color="#8c9297"></stop><stop offset="93.8%" stop-color="#9aa0a6"></stop><stop offset="100.0%" stop-color="#a9afb5"></stop></linearGradient><linearGradient id="brand-l1" gradientUnits="userSpaceOnUse" x1="8.5" y1="36" x2="91.5" y2="36"><stop offset="0.0%" stop-color="#2f7bff"></stop><stop offset="6.3%" stop-color="#487cff"></stop><stop offset="12.5%" stop-color="#5a7cff"></stop><stop offset="18.8%" stop-color="#6a7dff"></stop><stop offset="25.0%" stop-color="#797dff"></stop><stop offset="31.3%" stop-color="#877dff"></stop><stop offset="37.5%" stop-color="#997cee"></stop><stop offset="43.8%" stop-color="#ae79d3"></stop><stop offset="50.0%" stop-color="#c174b8"></stop><stop offset="56.3%" stop-color="#d36b9d"></stop><stop offset="62.5%" stop-color="#e56080"></stop><stop offset="68.8%" stop-color="#f15d69"></stop><stop offset="75.0%" stop-color="#f37162"></stop><stop offset="81.3%" stop-color="#f5835a"></stop><stop offset="87.5%" stop-color="#f79550"></stop><stop offset="93.8%" stop-color="#f8a542"></stop><stop offset="100.0%" stop-color="#f8b52c"></stop></linearGradient><linearGradient id="brand-l2" gradientUnits="userSpaceOnUse" x1="28.021" y1="95.435" x2="39.978" y2="4.564"><stop offset="0.0%" stop-color="#b9502f"></stop><stop offset="6.3%" stop-color="#bd5534"></stop><stop offset="12.5%" stop-color="#c15a39"></stop><stop offset="18.8%" stop-color="#c55f3e"></stop><stop offset="25.0%" stop-color="#c96443"></stop><stop offset="31.3%" stop-color="#cd6848"></stop><stop offset="37.5%" stop-color="#d16d4d"></stop><stop offset="43.8%" stop-color="#d57252"></stop><stop offset="50.0%" stop-color="#d97757"></stop><stop offset="56.3%" stop-color="#dd8060"></stop><stop offset="62.5%" stop-color="#e08a69"></stop><stop offset="68.8%" stop-color="#e49372"></stop><stop offset="75.0%" stop-color="#e79c7b"></stop><stop offset="81.3%" stop-color="#eaa584"></stop><stop offset="87.5%" stop-color="#edae8d"></stop><stop offset="93.8%" stop-color="#f0b796"></stop><stop offset="100.0%" stop-color="#f3c09f"></stop></linearGradient><linearGradient id="brand-l3" gradientUnits="userSpaceOnUse" x1="71.978" y1="95.435" x2="60.021" y2="4.564"><stop offset="0.0%" stop-color="#2b33e6"></stop><stop offset="6.3%" stop-color="#3139e9"></stop><stop offset="12.5%" stop-color="#363fec"></stop><stop offset="18.8%" stop-color="#3c44ef"></stop><stop offset="25.0%" stop-color="#4249f3"></stop><stop offset="31.3%" stop-color="#484ef6"></stop><stop offset="37.5%" stop-color="#4e53f9"></stop><stop offset="43.8%" stop-color="#5457fc"></stop><stop offset="50.0%" stop-color="#5a5cff"></stop><stop offset="56.3%" stop-color="#6569ff"></stop><stop offset="62.5%" stop-color="#7075ff"></stop><stop offset="68.8%" stop-color="#7c80ff"></stop><stop offset="75.0%" stop-color="#888bff"></stop><stop offset="81.3%" stop-color="#9595ff"></stop><stop offset="87.5%" stop-color="#a29fff"></stop><stop offset="93.8%" stop-color="#afa9ff"></stop><stop offset="100.0%" stop-color="#bdb3ff"></stop></linearGradient><clipPath id="brand-l4"><polygon points="16,46.5 84,46.5 84,25.5 16,25.5"></polygon></clipPath><clipPath id="brand-l5"><polygon points="16,48.5 84,48.5 84,23.5 16,23.5"></polygon></clipPath><clipPath id="brand-l6"><polygon points="81.410,86.630 71.410,10.630 50.589,13.369 60.589,89.369"></polygon></clipPath><clipPath id="brand-l7"><polygon points="83.393,86.369 73.393,10.369 48.606,13.630 58.606,89.630"></polygon></clipPath><clipPath id="brand-l8"><polygon points="12,74.5 88,74.5 88,53.5 12,53.5"></polygon></clipPath><clipPath id="brand-l9"><polygon points="12,76.5 88,76.5 88,51.5 12,51.5"></polygon></clipPath><clipPath id="brand-l10"><polygon points="39.410,89.369 49.410,13.369 28.589,10.630 18.589,86.630"></polygon></clipPath><clipPath id="brand-l11"><polygon points="41.393,89.630 51.393,13.630 26.606,10.369 16.606,86.369"></polygon></clipPath></defs><line x1="12" y1="64" x2="88" y2="64" stroke="url(#brand-l0)" stroke-width="15" stroke-linecap="round"></line><line x1="16" y1="36" x2="84" y2="36" stroke="url(#brand-l1)" stroke-width="15" stroke-linecap="round"></line><line x1="29" y1="88" x2="39" y2="12" stroke="url(#brand-l2)" stroke-width="15" stroke-linecap="round"></line><line x1="71" y1="88" x2="61" y2="12" stroke="url(#brand-l3)" stroke-width="15" stroke-linecap="round"></line><g clip-path="url(#brand-l4)"><line x1="29" y1="88" x2="39" y2="12" stroke="#f6f6f6" stroke-width="21" stroke-linecap="round"></line></g><g clip-path="url(#brand-l5)"><line x1="29" y1="88" x2="39" y2="12" stroke="url(#brand-l2)" stroke-width="15" stroke-linecap="round"></line></g><g clip-path="url(#brand-l6)"><line x1="16" y1="36" x2="84" y2="36" stroke="#f6f6f6" stroke-width="21" stroke-linecap="round"></line></g><g clip-path="url(#brand-l7)"><line x1="16" y1="36" x2="84" y2="36" stroke="url(#brand-l1)" stroke-width="15" stroke-linecap="round"></line></g><g clip-path="url(#brand-l8)"><line x1="71" y1="88" x2="61" y2="12" stroke="#f6f6f6" stroke-width="21" stroke-linecap="round"></line></g><g clip-path="url(#brand-l9)"><line x1="71" y1="88" x2="61" y2="12" stroke="url(#brand-l3)" stroke-width="15" stroke-linecap="round"></line></g><g clip-path="url(#brand-l10)"><line x1="12" y1="64" x2="88" y2="64" stroke="#f6f6f6" stroke-width="21" stroke-linecap="round"></line></g><g clip-path="url(#brand-l11)"><line x1="12" y1="64" x2="88" y2="64" stroke="url(#brand-l0)" stroke-width="15" stroke-linecap="round"></line></g></svg></span><span class="channel-brand-text"><strong>共议</strong><span>AI CoDiscuss</span></span></header>`,1),Tr((W(),G(`div`,R4,[J(I4,{onSelect:t[0]||=e=>r(`select`,e),onManage:t[1]||=e=>r(`manage`,e),onCreate:t[2]||=e=>r(`create`,e),onCreateFolder:t[3]||=e=>r(`create-folder`),onManageFolder:t[4]||=e=>r(`manage-folder`,e),onDeleteFolder:t[5]||=e=>r(`delete-folder`,e),onArchiveFolder:t[6]||=e=>r(`archive-folder`,e),onArchives:t[7]||=e=>r(`archives`)}),q(`div`,z4,[q(`button`,{type:`button`,class:`channel-section-toggle`,"aria-expanded":c.value,onClick:t[8]||=e=>c.value=!c.value},[J(n,{name:c.value?`i-lucide-chevron-down`:`i-lucide-chevron-right`},null,8,[`name`]),t[12]||=Y(`频道工具`,-1)],8,B4)]),c.value?(W(),K(o,{key:0,items:u.value,orientation:`vertical`,color:`neutral`,variant:`pill`,class:`channel-directory channel-view-links`,"aria-label":`房间视图`,ui:{link:`channel-link`,linkLabel:`channel-link-label`,linkLeadingIcon:`channel-link-icon`}},null,8,[`items`])):X(``,!0)])),[[m]]),q(`footer`,V4,[q(`button`,{type:`button`,class:`channel-self-button`,"aria-label":`账号与设置:${L(a).display_name(L(s))}${d.value?`,`+d.value:``}`,onClick:t[9]||=e=>r(`settings`)},[J(l,{src:L(a).identities[L(s)]?.icon,text:L(a).identities[L(s)]?.initials,alt:L(a).display_name(L(s)),size:`sm`,class:N([`channel-avatar`,L(a).identities[L(s)]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`span`,U4,[q(`strong`,null,F(L(a).display_name(L(s))),1),q(`span`,{class:N([`channel-connection`,{"is-action":d.value}])},[q(`span`,{class:N({connected:L(i).connected}),title:L(i).connected?`网站已连接`:`网站未连接`},null,10,W4),Y(F(d.value||(L(i).connected?`网站已连接`:L(i).reconnecting?`正在重新连接…`:`网站未连接`)),1)],2)])],8,H4),L(i).connected?X(``,!0):(W(),K(p,{key:0,text:`重新连接`},{default:R(()=>[J(f,{icon:`i-lucide-refresh-cw`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-icon-button`,"aria-label":`重新连接网站`,loading:L(i).reconnecting,onClick:t[10]||=e=>L(a).reconnect()},null,8,[`loading`])]),_:1})),J(p,{text:`设置`},{default:R(()=>[J(f,{icon:`i-lucide-settings-2`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-icon-button`,"aria-label":`设置`,onClick:t[11]||=e=>r(`settings`)})]),_:1})])])}}},K4={key:0,class:`pb-invite`,"aria-label":`启动手动成员`},q4={class:`pb-invite-lead`},J4={class:`pb-invite-launches`},Y4={class:`pb-invite-footer`},X4={key:1,class:`pb-invite-cards`},Z4={key:0,class:`fine-print`},Q4=[`aria-hidden`],$4={key:3,class:`pb-invite-empty`},e3={key:4,class:`pb-invite-empty`},t3={key:5,role:`alert`,class:`fine-print`},n3={class:`pb-invite-footer`},r3=2e3,i3=`preset:`,a3=EH({__name:`InviteDialog`,props:Ha({description:{type:String,default:`新成员由程序按本机软件配置启动,或由你手动启动。`},workflowId:{type:String,default:``}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:[`update:open`],setup(e){let t=e,n=uo(e,`open`),{view:r,bridge:i,act:a,pending:o}=Or(`discussion`),s=Q(()=>r.value.room),c=e=>(s.value.members||[]).find(t=>t.name===e),l=I(``),u;async function d(e){clearTimeout(u),l.value=``,await a(`copy_member_launch`,e)&&(l.value=e,u=setTimeout(()=>{l.value=``},r3))}let f=I([]),p=0,m=I([]),h=I(!1),g=Q(()=>Object.keys(i.launch_clients)),_=Q(()=>r.value&&i.expert_presets()),v=Q(()=>(s.value.members||[]).map(e=>e.name)),y=e=>v.value.filter(t=>i.platform_of(t)===e).length,b=Q(()=>[...f.value.filter(e=>e.mode!==`manual`),...f.value.filter(e=>e.mode===`manual`)]),x=Q(()=>{let e=new Set([...v.value,...f.value.filter(e=>e.preset).map(e=>e.name)]);return new Map(b.value.map(t=>{let n=t.preset?t.name:i.unique_instance(t.name,e);return e.add(n),[t,n]}))});function S(e){let t=r.value.launch.profiles[e]||{},n=t.adapter===`api`;return(n?t.base_url&&t.api_protocol&&t.api_key_ref&&t.model:t.adapter&&(t.adapter===`antigravity`?t.ipc_directory:t.executable))?{text:n?`已配置 API`:`已配置本机软件`,tone:`ready`}:{text:n?`待补齐 API 配置`:`待补齐接入配置`,tone:`warn`}}let C=Q(()=>T.value||!f.value.length&&!w.value?.existing.length&&!Object.keys(w.value?.members||{}).length||f.value.some(e=>e.mode===`cli`&&(!r.value.launch.available||S(e.name).tone===`warn`))),w=I(null),T=I(!1);z(n,async e=>{e&&(w.value=null,f.value=[],h.value=!1,m.value=[],t.workflowId&&await A(t.workflowId))}),z(()=>s.value.id,()=>{n.value=!1,f.value=[]});function E(e){i.default_launch_entry(e),f.value=[...f.value,{id:++p,name:e,mode:`cli`}]}let D=Q(()=>[...g.value.map(e=>({value:e,name:i.display_name(e),...i.identities[e],title:y(e)?`已在场 ${y(e)} 位 · 将添加新实例`:``,aria_label:`添加 ${e} 实例`})),..._.value.map((e,t)=>({value:i3+e.name,name:e.label||e.name,...i.identities[i.platform_of(e.name)],separated:t===0,title:e.description||`专家预设`,aria_label:`添加预设 ${e.label||e.name}`,removable:!0}))]);function O(e){if(!e.startsWith(i3))return E(e);let t=_.value.find(t=>t.name===e.slice(7));t&&k(t)}function k(e){let t=i.unique_instance(e.name,new Set([...v.value,...f.value.map(e=>x.value.get(e)||e.name)]));i.apply_expert_preset(t,e),f.value=[...f.value,{id:++p,name:t,mode:`cli`,preset:!0}]}async function A(e){if(T.value)return;if(!e){f.value=f.value.filter(e=>!e.card),w.value=null;return}let t;try{t=await i.local_request(`workflows`,{action:`get`,id:e})}catch(e){return i.notify(`error`,e.message)}f.value=f.value.filter(e=>!e.card);let n=r.value.launch.room_models?.workflow,a=t.agents.map(t=>({...c(n?.id===e?n.members?.[t.card]:``),card:t.card})).filter(e=>[`active`,`away`].includes(e.status));w.value={id:e,label:t.label||e,existing:a,members:{}};for(let e of t.agents)a.some(t=>t.card===e.card)||(k(i.workflow_preset(e)),f.value.at(-1).card=e.card)}async function ee(){if(!C.value){T.value=!0;try{await j()}finally{T.value=!1}}}async function j(){h.value=!0;let e=[],t=w.value;for(let e of t?.existing||[]){if(c(e.name)?.status===`away`&&!await a(`change_member`,{member_id:e.id,name:e.name,action:`rejoin`}))return;t.members[e.card]=e.name}let i=new Map(x.value),o=f.value.length>0;for(let n of[...b.value]){let o=r.value.launch.profiles[n.name]||{},s=n.mode===`manual`,c=i.get(n);if(!await a(`invite_member`,{name:n.name,access:s?`manual`:`runner`,project_access:o.project_access||r.value.launch.workspace?.project_access||`read`,...n.card&&!s?{card:n.card,workflow_members:t.members}:{},refresh:!1})){n.card&&t.members[n.card]&&(f.value=f.value.filter(e=>e!==n));break}s&&e.push(c),f.value=f.value.filter(e=>e!==n)}if(m.value=[...m.value,...e],t&&Object.keys(t.members).length&&!f.value.some(e=>e.card)){if(!await a(`enable_room_workflow`,{id:t.id,members:t.members}))return await te(o);w.value=null}!f.value.length&&!m.value.length&&(n.value=!1),await te(o)}async function te(e){e&&await a(`refresh`)}return(t,a)=>{let s=tA,u=bA,p=$B;return W(),K(p,{content:{onInteractOutside:e=>e.preventDefault()},open:n.value,"onUpdate:open":a[3]||=e=>n.value=e,title:`邀请成员`,description:e.description,ui:{content:`glass-panel studio-modal pb-invite-modal`,body:`dialog-body`}},{body:R(()=>[m.value.length&&!f.value.length?(W(),G(`div`,K4,[q(`p`,q4,F(m.value.length>1?`${m.value.length} 位手动成员已加入`:`手动成员已加入`)+`,把启动指令交给各自的 AI 会话,注册后才算到场。`,1),q(`ul`,J4,[(W(!0),G(U,null,V(m.value,e=>(W(),G(`li`,{key:e},[J(s,{src:L(i).identities[L(i).platform_of(e)]?.icon,text:L(i).identities[L(i).platform_of(e)]?.initials,alt:e,size:`xs`,class:N([`channel-avatar`,L(i).identities[L(i).platform_of(e)]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`strong`,null,F(L(i).display_name(e)),1),q(`small`,{class:N({"is-registered":c(e)?.registered_at})},F(c(e)?.registered_at?`已注册`:`待注册`),3),J(u,{icon:l.value===e?`i-lucide-check`:`i-lucide-rocket`,label:l.value===e?`已复制`:`复制启动指令`,size:`sm`,color:l.value===e?`success`:`primary`,variant:`soft`,class:`pb-launch-button`,loading:L(o)===`copy_member_launch`,disabled:!!L(o),onClick:t=>d(e)},null,8,[`icon`,`label`,`color`,`loading`,`disabled`,`onClick`])]))),128))]),a[4]||=q(`p`,{class:`fine-print`},`指令含该成员的凭证,只交给对应的会话;关闭后仍可在参与者列表中复制。`,-1),q(`div`,Y4,[J(u,{label:`完成`,class:`channel-primary-button`,onClick:a[0]||=e=>n.value=!1})])])):(W(),G(`form`,{key:1,class:`pb-invite`,"aria-label":`邀请专家`,onSubmit:_u(ee,[`prevent`])},[w.value?X(``,!0):(W(),G(U,{key:0},[J(EQ,{label:`选择 AI(可多选)`,items:D.value,onAdd:O,onRemove:a[1]||=e=>L(i).delete_expert_preset(e.slice(7))},null,8,[`items`]),J(F$,{disabled:T.value},null,8,[`disabled`])],64)),(W(!0),G(U,null,V(w.value?.existing||[],e=>(W(),G(`p`,{key:e.card,class:`fine-print`},F(L(i).display_name(e.name))+`:`+F(c(e.name)?.status===`away`?`确认后请回,保留原会话`:`已在场,沿用原成员`),1))),128)),f.value.length?(W(),G(`div`,X4,[(W(!0),G(U,null,V(f.value,e=>(W(),G(`div`,{key:e.id,class:`pb-invite-pick`},[J(zZ,{name:e.name,mode:e.mode,choices:e.card?[`cli`]:[`cli`,`manual`],status:S(e.name),workflow:e.card&&w.value?.label||``,onMode:t=>e.mode=t,onRemove:t=>f.value=f.value.filter(t=>t!==e)},null,8,[`name`,`mode`,`choices`,`status`,`workflow`,`onMode`,`onRemove`]),x.value.get(e)===e.name?X(``,!0):(W(),G(`p`,Z4,`同一 AI 已有实例,将以 `+F(x.value.get(e))+` 加入,使用独立会话。`,1))]))),128))])):X(``,!0),f.value.length?(W(),G(`p`,{key:2,class:N([`fine-print`,{"pb-invite-reserved":!(f.value.some(e=>e.mode===`manual`)&&f.value.some(e=>e.mode!==`manual`))}]),"aria-hidden":!(f.value.some(e=>e.mode===`manual`)&&f.value.some(e=>e.mode!==`manual`))},`手动启动的成员排在程序启动的成员之后加入队列。`,10,Q4)):T.value?(W(),G(`p`,$4,`正在加入成员…`)):w.value?X(``,!0):(W(),G(`p`,e3,`选择一位或多位 AI(同一 AI 可重复添加),点卡片翻面设置软件、模型与项目权限。`)),f.value.some(e=>e.mode===`cli`)&&!L(r).launch.available?(W(),G(`p`,t3,`邀请需要本机服务,请在运行 AI 的电脑打开本机网站。`)):X(``,!0),q(`div`,n3,[J(u,{label:`取消`,color:`neutral`,variant:`ghost`,disabled:T.value,onClick:a[2]||=e=>n.value=!1},null,8,[`disabled`]),J(u,{type:`submit`,icon:`i-lucide-user-plus`,label:w.value?`确认成员并启用工作流`:f.value.length>1?`邀请 ${f.value.length} 位`:`邀请`,class:`channel-primary-button`,disabled:C.value,loading:T.value},null,8,[`label`,`disabled`,`loading`])])],32))]),_:1},8,[`content`,`open`,`description`])}}},[[`__scopeId`,`data-v-eef82567`]]),o3={class:`workflow-control-row`},s3=[`title`],c3={class:`workflow-control-state`},l3=[`disabled`],u3=[`disabled`],d3={key:0,class:`workflow-control-note is-warning`},f3={key:1,class:`workflow-control-note`},p3=EH({__name:`WorkflowControl`,props:{workflow:{type:Object,required:!0},dismissible:{type:Boolean,default:!1}},emits:[`dismiss`],setup(e){let t=e,{view:n,bridge:r,act:i,pending:a}=Or(`discussion`),o=Q(()=>n.value.room||{}),s=Q(()=>{let e=new Set(Object.values(t.workflow.members||{}));return(o.value.free?.members||[]).filter(t=>e.has(t.name)&&t.role!==`host`&&t.status===`active`)}),c=Q(()=>n.value.access?.can_manage&&!o.value.archived),l=Q(()=>s.value.map(e=>r.display_name(e.name)).join(`、`)),u=I(!1),d=Q(()=>[...s.value.length?[`${l.value} 设为离开:未处理的请求取消,正在进行的工作停止;各自的会话保留。`]:[],`工作流随之结束:主持人留在房间,下一次任务起按普通协作工作。`,`之后在输入框打 / 选它,可请回原成员,接着原来的会话。消息记录和项目文件不受影响。`]);return(t,n)=>{let o=Yk;return W(),G(`div`,{class:N([`workflow-control`,e.workflow.available?`is-success`:`is-warning`])},[q(`div`,o3,[J(o,{name:`i-lucide-workflow`,class:`workflow-control-icon`}),q(`span`,{class:`workflow-control-name`,title:e.workflow.label},F(e.workflow.label),9,s3),q(`span`,c3,[n[5]||=q(`span`,{class:`workflow-control-dot`},null,-1),Y(F(e.workflow.available?`进行中`:`不可用`),1)]),c.value&&e.workflow.available?(W(),G(`button`,{key:0,type:`button`,class:`workflow-control-action`,disabled:!!L(a),title:`按工作流库里的最新版本补齐成员:新增的卡片加入、离开的请回,已删卡片的成员转为普通成员`,onClick:n[0]||=e=>L(i)(`sync_room_workflow`)},`刷新`,8,l3)):X(``,!0),c.value?(W(),G(`button`,{key:1,type:`button`,class:`workflow-control-action`,disabled:!!L(a),title:`请离工作流带来的成员并结束工作流,会话保留`,onClick:n[1]||=e=>u.value=!0},F(s.value.length?`请离成员`:`结束`),9,u3)):X(``,!0),e.dismissible?(W(),G(`button`,{key:2,type:`button`,class:`workflow-control-close`,title:`收起此区,工作流照常进行;“成员与设置”里仍可请离成员`,"aria-label":`收起工作流区`,onClick:n[2]||=e=>t.$emit(`dismiss`)},[J(o,{name:`i-lucide-x`,class:`workflow-control-close-icon`})])):X(``,!0)]),e.workflow.available?l.value?(W(),G(`p`,f3,F(s.value.map(e=>L(r).display_name(e.name)).join(` · `)),1)):X(``,!0):(W(),G(`p`,d3,`无法读取工作流,成员沿用房间里的提示词。`)),J(ZQ,{open:u.value,"onUpdate:open":n[3]||=e=>u.value=e,title:`结束工作流「${e.workflow.label}」`,description:s.value.length?`请离它带来的成员,暂停这套做法。`:`本房间暂停这套做法。`,items:d.value,"confirm-label":s.value.length?`请离并结束`:`结束`,onConfirm:n[4]||=e=>L(i)(`move_workflow_members`,`away`)},null,8,[`open`,`title`,`description`,`items`,`confirm-label`])],2)}}},[[`__scopeId`,`data-v-53e2de42`]]),m3={class:`start-discussion-footer`},h3=3,g3=EH({__name:`StartDiscussionDialog`,props:{open:{type:Boolean,default:!1},openModifiers:{}},emits:[`update:open`],setup(e){let t=uo(e,`open`),{view:n,act:r,pending:i}=Or(`discussion`),a=I(``),o=I(h3),s=I(0),c=I(!1),l=I(null);z(t,e=>{e&&(a.value=``,o.value=n.value.room?.limits?.max_rounds||h3,s.value=n.value.room?.limits?.max_minutes??0,c.value=!1)});async function u(){l.value?.settle();let e=e=>Number.isInteger(Number(e))&&Number(e)>0?Number(e):0;await r(`start_room_discussion`,{goal:a.value.trim(),max_rounds:e(o.value),max_minutes:e(s.value),named_followup:c.value})&&(t.value=!1)}return(e,r)=>{let d=cV,f=aV,p=bA,m=$B;return W(),K(m,{content:{onInteractOutside:e=>e.preventDefault()},open:t.value,"onUpdate:open":r[5]||=e=>t.value=e,title:`开启讨论`,description:`主持人安排成员轮流发言;到上限或结束后,房间回到自由协作,记录全部保留。`,ui:{content:`glass-panel studio-modal`,body:`dialog-body`}},{body:R(()=>[q(`form`,{class:`start-discussion`,"aria-label":`开启讨论`,onSubmit:_u(u,[`prevent`])},[J(f,{label:`讨论目标`,description:`写下问题、背景和顾虑,主持人据此推进;可留空,沿用房间目标。`},{default:R(()=>[J(d,{modelValue:a.value,"onUpdate:modelValue":r[0]||=e=>a.value=e,maxlength:1e3,rows:4,autoresize:``,maxrows:10,placeholder:`例如:我们在 A、B 两个方案之间犹豫,主要顾虑是成本和上线时间……`,class:`w-full`},null,8,[`modelValue`])]),_:1}),J(YH,{ref_key:`limits`,ref:l,rounds:o.value,"onUpdate:rounds":r[1]||=e=>o.value=e,minutes:s.value,"onUpdate:minutes":r[2]||=e=>s.value=e,named_followup:c.value,"onUpdate:named_followup":r[3]||=e=>c.value=e},null,8,[`rounds`,`minutes`,`named_followup`]),q(`div`,m3,[J(p,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:r[4]||=e=>t.value=!1}),J(p,{type:`submit`,icon:`i-lucide-play`,label:`开始讨论`,class:`channel-primary-button`,loading:L(i)===`start_room_discussion`,disabled:!!L(i)||!L(n).access?.can_manage},null,8,[`loading`,`disabled`])])],32)]),_:1},8,[`content`,`open`])}}},[[`__scopeId`,`data-v-8c194097`]]),_3={class:`pb-status-line`},v3={role:`status`},y3={key:0,class:`pb-status-detail`},b3={class:`pb-meters`},x3={class:`pb-meter-label`},S3={key:0,class:`pb-bar`},C3={key:0,class:`pb-section`,"aria-label":`当前焦点`},w3={key:1,class:`pb-actions`,"aria-label":`讨论操作`},T3={class:`progress-ending`},E3=[`disabled`],D3=90,O3={__name:`ProgressBoard`,setup(e){let{view:t,bridge:n,act:r,pending:i}=Or(`discussion`),a=Q(()=>t.value.room),o=Q(()=>a.value.session),s=Q(()=>a.value.limits||{}),c=I(0);z(()=>[o.value?.id,o.value?.status,s.value.elapsed_seconds],([e,t,n],r,i)=>{if(c.value=n||0,t!==`active`||a.value.archived)return;let o=Date.now(),s=setInterval(()=>{c.value=(n||0)+Math.floor((Date.now()-o)/1e3)},1e3);i(()=>clearInterval(s))},{immediate:!0});let l=Q(()=>o.value?.status===`paused`),u=Q(()=>a.value.current_turn),d=Q(()=>!!t.value.access?.can_manage&&!a.value.archived),f=I(!1),p=I(!1),m=Q(()=>u.value?.question||a.value.focus||o.value?.goal||a.value.goal||``),h=Q(()=>{if(a.value.archived)return{tone:`neutral`,title:`已存档`,detail:``};if(l.value)return{tone:`warning`,title:`讨论已暂停`,detail:`继续后由主持人重新安排;暂停期间不计时`};let e=a.value.free?.requests||[],t=e.find(e=>e.discussion_session_id===o.value?.id&&e.cause_kind===`request_failed`&&[`pending`,`delivering`].includes(e.status));if(t){let r=e.find(e=>e.id===t.cause_request_id);return{tone:`warning`,title:`等待主持人处理`,detail:`${n.display_name(r?.member||`成员`)} 送达失败,已交回主持人`}}return{tone:`primary`,title:a.value.phase===`initial`?`独立观点`:`讨论中`,detail:u.value?`第 ${u.value.round||(s.value.completed_rounds||0)+1} 轮 · ${n.display_name(u.value.expert)} 本次发言`:`等待主持人安排下一步`}});function g(e){return e<60?`${e}秒`:e<3600?`${Math.floor(e/60)}分${String(e%60).padStart(2,`0`)}秒`:`${Math.floor(e/3600)}小时${Math.floor(e%3600/60)}分`}let _=Q(()=>{let e=s.value.completed_rounds||0,t=s.value.max_rounds||0,n=c.value,r=(s.value.max_minutes||0)*60;return[{label:`轮次`,text:t?`${e} / ${t} 轮`:`已完成 ${e} 轮`,ratio:t?e/t:null},{label:`用时`,text:`${g(n)}${r?` / ${g(r)}`:``}`,ratio:r?n/r:null}]});async function v(){await r(`end_room_discussion`)&&(f.value=!1)}return(e,t)=>{let o=bA,s=$B;return W(),G(U,null,[q(`section`,{class:N([`pb-status`,`is-${h.value.tone}`]),"aria-label":`讨论状态`},[q(`div`,_3,[t[6]||=q(`span`,{class:`pb-dot`},null,-1),q(`strong`,v3,F(h.value.title),1)]),h.value.detail?(W(),G(`p`,y3,F(h.value.detail),1)):X(``,!0),q(`div`,b3,[(W(!0),G(U,null,V(_.value,e=>(W(),G(`div`,{key:e.label,class:`pb-meter`},[q(`div`,x3,[q(`span`,null,F(e.label),1),q(`b`,null,F(e.text),1)]),e.ratio===null?X(``,!0):(W(),G(`div`,S3,[q(`i`,{style:ye({width:`${Math.min(100,Math.round(e.ratio*100))}%`})},null,4)]))]))),128))])],2),m.value?(W(),G(`section`,C3,[t[7]||=q(`h4`,null,`当前焦点`,-1),q(`p`,{class:N([`pb-focus`,{"is-expanded":p.value}])},F(m.value),3),m.value.length>D3?(W(),G(`button`,{key:0,type:`button`,class:`pb-link`,onClick:t[0]||=e=>p.value=!p.value},F(p.value?`收起`:`展开`),1)):X(``,!0)])):X(``,!0),a.value.archived?X(``,!0):(W(),G(`section`,w3,[l.value?(W(),K(o,{key:0,icon:`i-lucide-play`,label:`继续`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action`,disabled:!d.value||!!L(i),loading:L(i)===`restart_discussion`,onClick:t[1]||=e=>L(r)(`restart_discussion`)},null,8,[`disabled`,`loading`])):(W(),K(o,{key:1,icon:`i-lucide-pause`,label:`暂停`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action`,title:`停止本次讨论执行,继续时由主持人重新安排`,disabled:!d.value||!!L(i),loading:L(i)===`pause_discussion`,onClick:t[2]||=e=>L(r)(`pause_discussion`)},null,8,[`disabled`,`loading`])),u.value&&!l.value?(W(),K(o,{key:2,icon:`i-lucide-skip-forward`,label:`跳过`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action`,title:`跳过 ${L(n).display_name(u.value.expert)} 本次发言`,disabled:!d.value||!!L(i),loading:L(i)===`skip_turn`,onClick:t[3]||=e=>L(r)(`skip_turn`)},null,8,[`title`,`disabled`,`loading`])):X(``,!0),J(o,{icon:`i-lucide-flag`,label:`结束`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action pb-end`,disabled:!d.value||!!L(i),onClick:t[4]||=e=>f.value=!0},null,8,[`disabled`])])),J(s,{content:{onInteractOutside:e=>e.preventDefault()},open:f.value,"onUpdate:open":t[5]||=e=>f.value=e,title:`结束讨论`,description:`当前发言安排会被取消,已有消息全部保留。`,ui:{content:`glass-panel studio-modal`,body:`dialog-body`}},{body:R(()=>[q(`div`,T3,[q(`button`,{type:`button`,class:`progress-ending-option`,disabled:!!L(i),onClick:v},[...t[8]||=[q(`strong`,null,`结束讨论`,-1),q(`span`,null,`保留全部记录,房间回到自由协作;需要总结时可直接请主持人写一份。`,-1)]],8,E3)])]),_:1},8,[`content`,`open`])],64)}}},k3={class:`speaking-order`},A3={key:0,class:`speaking-order-divider speaking-order-relay`},j3={key:0,class:`speaking-order-divider`,"aria-hidden":`true`},M3=[`data-key`,`data-movable`],N3=[`aria-disabled`,`aria-label`,`title`,`onPointerdown`,`onKeydown`],P3={class:`speaking-order-number`},F3={key:1,class:`speaking-order-place`,title:`已发言`,"aria-label":`已发言`},I3=[`title`],L3={key:1,class:`speaking-order-later`},R3={key:2,class:`speaking-order-divider`,"aria-hidden":`true`},z3={class:`speaking-order-live`,"aria-live":`polite`},B3=`发言顺序刚有变化,已更新为最新顺序,请重新调整`,V3=EH({__name:`SpeakingOrder`,props:{away:{type:Array,default:()=>[]},round:{type:Number,default:0}},setup(e){let t=e,{view:n,bridge:r,act:i}=Or(`discussion`),a=I(!1),o=Q(()=>n.value.room),s=Q(()=>o.value.speaking_order||{kind:`default`,items:[],movable:[]}),c=Q(()=>s.value.kind==="default"?`idle`:`queued`),l=Q(()=>!!n.value.access?.can_manage&&!o.value.archived&&s.value.movable.length>1),u={queue:`不在本次依次回答中`,turns:`本轮未安排`},d=Q(()=>s.value.kind==="default"?`拖动设置默认发言顺序,@全体依次 按此顺序;聚焦后可用上下方向键`:`拖动调整还没发言的顺序,立即生效;聚焦后可用上下方向键`),f=I(null),p=I(null),m=I(null),h=I(``);z(()=>s.value.revision,()=>{m.value=null}),z(()=>o.value.id,()=>{p.value=null,m.value=null,h.value=``,document.removeEventListener(`keydown`,C,!0)});function g(e,t,n){let r=[...e];return r.splice(n,0,...r.splice(t,1)),r}let _=Q(()=>{let e=p.value?.order||s.value,t=e.items,n=t.findIndex(e=>e.state===c.value),r=m.value||e.movable,i=n<0?t:[...t.slice(0,n),...r.map(e=>({name:e,state:c.value})),...t.slice(n+r.length)],a=t=>e.kind==="default"||t.state!==`idle`,o=i.filter(a).length,l={},u=0;return i.map((e,t)=>({...e,key:`${e.name}#${l[e.name]=(l[e.name]||0)+1}`,place:a(e)&&o>1?++u:0,outside:!a(e)&&t>0&&a(i[t-1])}))}),v=e=>e-_.value.findIndex(e=>e.state===c.value);async function y(e,t,n){if(e.join(`
58
58
  `)===s.value.movable.join(`
59
59
  `))return;let r=_.value.find(e=>e.state===c.value&&e.name===t)?.key;m.value=e,await ar(),n&&r&&f.value?.querySelector(`[data-key="${CSS.escape(r)}"] .speaking-order-grip`)?.focus(),h.value=`已将 ${t} 移到第 ${_.value.find(e=>e.key===r)?.place||e.indexOf(t)+1} 位`,a.value=!0;try{await i(`reorder_speakers`,{revision:s.value.revision,order:e})}finally{a.value=!1,m.value=null}}function b(e,t){l.value&&!a.value&&e.button===0&&(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),p.value={pointer:e.pointerId,from:t,gap:t,order:s.value,grip:e.currentTarget},document.addEventListener(`keydown`,C,!0))}function x(e){if(p.value?.pointer!==e.pointerId)return;let t=[...f.value.querySelectorAll(`[data-movable]`)],n=t.findIndex(t=>{let n=t.getBoundingClientRect();return e.clientY<n.top+n.height/2});p.value={...p.value,gap:n<0?t.length:n}}function S(e,t=!1){if(p.value?.pointer!==e.pointerId)return;let{from:n,gap:i,order:a}=p.value;p.value=null,document.removeEventListener(`keydown`,C,!0);let o=i>n?i-1:i;t||n===o||(a.revision===s.value.revision?y(g(s.value.movable,n,o),s.value.movable[n],!1):r.notify(`warning`,B3))}function C(e){if(!p.value||e.key!==`Escape`)return;e.preventDefault();let{grip:t,pointer:n}=p.value;p.value=null,document.removeEventListener(`keydown`,C,!0),t.hasPointerCapture(n)&&t.releasePointerCapture(n)}function w(e){if(!p.value||_.value[e].state!==c.value)return``;let t=v(e),{from:n,gap:r}=p.value,i=t===n?`is-source`:``;return r===n||r===n+1?i:[i,t===r?`drop-before`:``,r===p.value.order.movable.length&&t===r-1?`drop-after`:``].join(` `)}function T(e,t,n){let r=t+n;!l.value||r<0||r>=s.value.movable.length||(e.preventDefault(),!a.value&&y(g(s.value.movable,t,r),s.value.movable[t],!0))}return(e,n)=>{let i=Yk;return W(),G(`div`,k3,[q(`ul`,{ref_key:`list`,ref:f,class:N([`pb-members`,{"is-dragging":p.value}])},[s.value.sequence?(W(),G(`li`,A3,[q(`span`,null,F(s.value.sequence.loop?`循环接力 · 第 ${s.value.sequence.pass} 圈`:`主持人安排的依次接力`),1)])):X(``,!0),(W(!0),G(U,null,V(_.value,(t,r)=>(W(),G(U,{key:t.key},[t.outside?(W(),G(`li`,j3,[q(`span`,null,F(u[s.value.kind]),1)])):X(``,!0),q(`li`,{class:N([`pb-member speaking-order-row`,[`is-${t.state}`,w(r),{"is-movable":t.state===c.value&&l.value}]]),"data-key":t.key,"data-movable":t.state===c.value?``:void 0},[t.state===c.value&&l.value?(W(),G(`button`,{key:0,type:`button`,class:`speaking-order-grip`,"aria-disabled":a.value,"aria-label":`${t.name},第 ${t.place} 位;拖动或用上下方向键调整发言顺序`,title:d.value,onPointerdown:e=>b(e,v(r)),onPointermove:x,onPointerup:S,onPointercancel:n[0]||=e=>S(e,!0),onLostpointercapture:n[1]||=e=>S(e,!0),onKeydown:[yu(e=>T(e,v(r),-1),[`up`]),yu(e=>T(e,v(r),1),[`down`])]},[q(`span`,P3,F(t.place),1),J(i,{name:`i-lucide-grip-vertical`,class:`speaking-order-handle`})],40,N3)):t.state===`done`?(W(),G(`span`,F3,[J(i,{name:`i-lucide-check`})])):(W(),G(`span`,{key:2,class:`speaking-order-place`,title:t.state===`speaking`?`正在发言`:void 0},F(t.place||``),9,I3)),H(e.$slots,`default`,{item:t,place:t.place},void 0,!0)],10,M3)],64))),128)),s.value.later?.length?(W(),G(`li`,L3,[q(`details`,null,[q(`summary`,null,`后续已排 `+F(s.value.later.length)+` 轮`,1),q(`ol`,null,[(W(!0),G(U,null,V(s.value.later,(e,n)=>(W(),G(`li`,{key:n},[q(`span`,null,F(t.round?`第 ${t.round+n+1} 轮`:`后续第 ${n+1} 轮`),1),Y(F(e.map(e=>L(r).display_name(e)).join(` → `)),1)]))),128))])])])):X(``,!0),t.away.length?(W(),G(`li`,R3,[...n[2]||=[q(`span`,null,`已离开`,-1)]])):X(``,!0),(W(!0),G(U,null,V(t.away,t=>(W(),G(`li`,{key:`away-${t}`,class:`pb-member speaking-order-row is-away`},[n[3]||=q(`span`,{class:`speaking-order-place`},null,-1),H(e.$slots,`default`,{item:{name:t,state:`away`},place:0},void 0,!0)]))),128))],2),q(`p`,z3,F(h.value),1)])}}},[[`__scopeId`,`data-v-fd4f0921`]]),H3=[`dispatched`,`started`],U3=e=>e.pending>0||H3.includes(e.execution?.status);function W3(e,{view:t,act:n,describe:r}){let i=t.access,a=i?.members?.find(t=>t.name===e.name)?.available,o=!i?.can_manage,s=[`active`,`paused`].includes(t.room?.session?.status)&&e.role===`host`,c=(t,r,i,a={})=>({label:t,icon:r,disabled:o,onSelect:()=>n(`change_member`,{member_id:e.id,name:e.name,action:i,...a})});return[[...e.access===`manual`?[{label:`复制启动指令(含凭证)`,icon:`i-lucide-rocket`,disabled:o||!a,onSelect:()=>n(`copy_member_launch`,e.name)}]:[],{label:`名称与描述`,icon:`i-lucide-user-pen`,disabled:o,onSelect:()=>r(e.name)},{label:`复制参与说明`,icon:`i-lucide-copy`,disabled:o,onSelect:()=>n(`copy_member_join`,e.name)},{label:`下载私有配置`,icon:`i-lucide-download`,disabled:o||!a,onSelect:()=>n(`download_member_access`,e.name)},...e.access===`manual`?[{label:`复制凭证文本`,icon:`i-lucide-key-round`,disabled:o||!a,onSelect:()=>n(`copy_member_access_text`,e.name)}]:[]],[...U3(e)?[{...c(`停止`,`i-lucide-circle-stop`,`interrupt`),color:`error`}]:[],...e.status===`active`&&e.role!==`host`?[c(`设为主持人`,`i-lucide-crown`,`role`,{role:`host`})]:[],...s?[]:[e.status===`active`?c(`离开`,`i-lucide-log-out`,`away`):{...c(`请回`,`i-lucide-log-in`,`rejoin`),disabled:o||e.access===`runner`&&!t.launch.available}]],...s?[]:[[{...c(`移除`,`i-lucide-trash-2`,`remove`),color:`error`}]]]}var G3={class:`progress-board is-docked`},K3={class:`pb-header`},q3={class:`pb-mode`},J3={class:`pb-status-line`},Y3={role:`status`},X3={key:0,class:`pb-stop-glyph`,"aria-hidden":`true`},Z3={key:0,class:`pb-status-detail`},Q3={key:1,class:`pb-meter pb-rounds`,title:`主持人连续派活的轮数;到上限自动停下,可继续`},$3={class:`pb-meter-label`},e6={key:0,class:`pb-bar`},t6={key:2,class:`pb-chain-actions`},n6={key:2,class:`pb-section`,"aria-label":`Goal`},r6={role:`status`},i6={class:`pb-goal-usage`},a6={key:1,class:`pb-goal-actions`},o6={key:3,class:`pb-section`,"aria-label":`当前任务`},s6={key:4,class:`pb-section`,"aria-label":`房间工作流`},c6={class:`pb-section`,"aria-label":`发言顺序`},l6={class:`pb-member-body`},u6=[`title`],d6={key:0,class:`member-id`},f6=[`title`],p6=[`title`],m6=[`title`],h6=[`title`],g6={key:5,class:`pb-actions pb-start-actions`,"aria-label":`操作`},_6={class:`pb-start-pair`},v6={key:0,class:`pb-free-note`},y6=90,b6=60,x6=`discuss-workflow-hidden:`,S6=2,C6=EH({__name:`FreeBoard`,setup(e){let{view:t,bridge:n,act:r,pending:i}=Or(`discussion`),a=[`dispatched`,`started`],o={runner:`本机唤醒`,manual:`手动接入`},s=Q(()=>t.value.room),c=Q(()=>s.value.free||{}),l=Q(()=>[`active`,`paused`].includes(s.value.session?.status)),u=Q(()=>[`active`,`paused`].includes(s.value.goal_state?.goal?.status)?s.value.goal_state.goal:null),d=Q(()=>{let e=u.value;return e?`${`已续跑 ${e.continues}${e.max_continues?` / ${e.max_continues}`:``} 次`} · 用时 ${GH(Math.floor((e.elapsed_seconds||0)/60))}${e.max_minutes?` / ${GH(e.max_minutes)}`:``}`:``}),f=I(!1),p=I(!1),m=Q(()=>l.value?s.value.current_turn?.round||(s.value.completed_rounds||0)+1:0),h=Q(()=>(c.value.members||[]).find(e=>e.role===`host`&&e.status===`active`)),g=Q(()=>FU(t.value.launch.room_models?.workflow,c.value.members)),_=e=>!!(g.value?.enabled&&Object.values(g.value.members||{}).includes(e)),v=I(``),y=I(!1);z(()=>[s.value.id,t.value.launch.room_models,g.value?.id],([e,t,n])=>{let r=x6+e,i=``;try{i=localStorage.getItem(r)||``}catch{}let a=t?.room_id===e&&!t.loading&&!t.error;if(i&&a&&i!==n){try{localStorage.removeItem(r)}catch{}i=``}y.value=!!n&&i===n},{immediate:!0});function b(){try{localStorage.setItem(x6+s.value.id,g.value.id)}catch{}y.value=!0}let x=e=>(c.value.members||[]).find(t=>t.name===e),S=Q(()=>(c.value.members||[]).filter(e=>e.status===`away`).map(e=>e.name)),C=e=>e.executions.join(`-`),w=new Map;function T(e,t){if(!e||!Array.isArray(t))return;let r=t.map(C),i=w.get(e);if(w.set(e,new Set([...i||[],...r])),i)for(let e of t.filter(e=>!i.has(C(e)))){let t=e.confirmed?.length?e.confirmed:e.files,r=t.slice(0,S6).join(`、`)+(t.length>S6?` 等`:``),i=e.members.map(e=>n.display_name(e)).join(` 与 `);n.notify(`warning`,e.confirmed?.length?`冲突:${i} 同时编辑了 ${t.length} 个相同文件(${r}),后保存的可能覆盖了先保存的,请核对`:`可能冲突:${i} 同时运行期间有 ${t.length} 个文件被改动(${r}),无法确认是谁改的`)}}z(()=>[s.value.id,c.value.conflicts],([e,t])=>T(e,t),{immediate:!0});let E=e=>e.access===`manual`&&e.status===`active`&&!e.registered_at;function D(e){return e.status===`away`?`neutral`:E(e)?`warning`:e.execution?.stale||e.pending&&e.adopt_error?`error`:e.held_until?`warning`:U3(e)?e.pending&&!a.includes(e.execution?.status)?`warning`:`primary`:e.execution?.status===`failed`?`error`:`success`}function O(e,t){if(e.status===`away`)return`已离开:不会被唤醒,可请回`;if(E(e))return`待注册`;let r=e.execution;return r&&a.includes(r.status)?r.stale?`执行失联,停止未确认`:`正在处理`:e.held_until?`${r?.stop_result===`unconfirmed`?`上一轮停止未确认`:`上一轮已作废,可能仍在生成`},等待结束确认或迟到回答;${e.pending?`${e.pending} 条新消息`:`新消息`}最晚 ${n.format_time(e.held_until*1e3)} 送达`:e.pending&&e.adopt_error?`无法投递 ${e.pending} 条`:e.pending?`待投递 ${e.pending} 条`:t===`queued`?l.value?`本轮排队`:`等待依次发言`:r?.status===`failed`?`执行失败`:!r&&e.access===`manual`?`已注册`:`空闲`}function k(e){return e.access===`runner`?[e.adapter===`api`?`API`:``,A(e)].filter(Boolean).join(` · `):o[e.access]}function A(e){return e.access===`runner`?n.participant_model(e.name,s.value,t.value.launch.room_models):``}function ee(e){return[e.access===`runner`?e.session_mode===`borrowed`?`借用会话`:`独立会话`:``,n.participant_files(e.name,s.value,t.value.launch.room_models)].filter(Boolean).join(` · `)}let j=Q(()=>M.value.asked_rounds?[...new Set([M.value.asked_rounds,1])]:[...new Set([1,c.value.max_rounds||1])]),te=I(0);async function ne(e,t){te.value=t;try{await n.continue_chain(e,t)}catch{}finally{te.value=0}}let M=Q(()=>{if(s.value.archived)return{tone:`neutral`,title:`已存档`,detail:``};let e=(c.value.members||[]).filter(U3);if(e.some(e=>e.execution?.stale))return{tone:`error`,title:`执行失联`,detail:`停止未确认,可在成员菜单中停止后重发`};let t=e.find(e=>e.pending&&e.adopt_error&&!a.includes(e.execution?.status));if(t)return{tone:`error`,title:`无法投递`,detail:`${n.display_name(t.name)} 的消息未送达,原因见对话区`};let r=ie.value;if(e.length)return{tone:`primary`,title:`处理中`,detail:e.map(e=>`${n.display_name(e.name)} ${a.includes(e.execution?.status)?`正在处理`:e.held_until?`等上一轮结束`:`待投递 ${e.pending} 条`}`).join(` · `)};let i=(c.value.halted_chains||[]).find(e=>e.chain_id===r);return i?.reason===`budget`&&i.asked_rounds?{tone:`warning`,title:`主持人申请轮数`,continue_chain:r,asked_rounds:i.asked_rounds,detail:`申请再给 ${i.asked_rounds} 轮:${i.asked_reason}。批准即发出暂存的派活;发新消息则重新开始`}:i?.reason===`budget`?{tone:`warning`,title:`任务链已停`,continue_chain:r,detail:`达到连续派活上限;主持人的下一次派活已暂存,继续即发出。发新消息则重新开始`}:i?{tone:`warning`,title:`任务链已停`,detail:`派出的成员都失败了;发新消息即重新开始`}:(c.value.members||[]).length?{tone:`success`,title:`空闲`,detail:h.value?`消息默认交给 ${n.display_name(h.value.name)};@ 其他成员让它们发言`:`没有主持人:消息只作留言`}:{tone:`neutral`,title:`暂无成员`,detail:`在下方邀请 AI 加入`}}),re=Q(()=>{let e=new Set((s.value.withdrawals||[]).map(e=>e.message_id));return(c.value.requests||[]).filter(t=>!e.has(t.message_id))}),ie=Q(()=>Math.max(0,...(c.value.requests||[]).map(e=>e.chain_id))),ae=Q(()=>(c.value.chain_rounds||[]).find(e=>e.chain_id===ie.value)||null),oe=Q(()=>{let e=ae.value;if(!e||!(M.value.title===`处理中`||M.value.continue_chain))return null;if(e.allowed==null)return{text:`第 ${e.used} 轮 · 不限`,ratio:null};let t=Math.min(e.used,e.allowed);return{text:`${t} / ${e.allowed} 轮`,ratio:t/e.allowed}}),se=Q(()=>{let e=re.value.filter(e=>e.created_by===`user`&&[`pending`,`delivering`].includes(e.status)).at(-1);if(!e)return``;let n=(t.value.messages||[]).find(t=>t.id===e.message_id);return n?.source===`goal`?``:n?n.text:`#${e.message_id}`}),ce=I(!1);z(()=>s.value.id,()=>{ce.value=!1});function le(e,r){let i=n.identities[e.name];return JSON.stringify([e,r,l.value,k(e),ee(e),A(e),n.participant_session_hint(e.name,s.value,t.value.launch.room_models),n.display_name(e.name),s.value.descriptions?.[e.name],_(e.name)&&g.value.label,i?.icon,i?.initials,i?.style,t.value.access,s.value.session?.status,t.value.launch.available])}function ue(e){return W3(e,{view:t.value,act:r,describe:e=>{fe.value=e}})}let de=I(!1),fe=I(``),pe=I(!1);z(()=>s.value.id,()=>{de.value=!1,fe.value=``});async function me({text:e,label:t,as_template:r}){pe.value=!0;try{await n.describe_member(fe.value,e,t),r&&n.save_description_template(fe.value,e),fe.value=``}catch{}finally{pe.value=!1}}let he=I(!1),ge=Q(()=>!!(h.value&&h.value.access===`runner`)&&t.value.launch.available);return z(()=>s.value.id,()=>{he.value=!1}),(e,a)=>{let o=bA,c=tA,C=Yk,w=MV;return W(),G(`div`,G3,[q(`header`,K3,[q(`strong`,null,F(l.value?`讨论进度`:`自由协作`),1),q(`span`,q3,F(h.value?`${L(n).display_name(h.value.name)} 主持`:`无主持人`),1)]),l.value?(W(),K(O3,{key:0})):(W(),G(`section`,{key:1,class:N([`pb-status`,`is-${M.value.tone}`]),"aria-label":`房间状态`},[q(`div`,J3,[a[13]||=q(`span`,{class:`pb-dot`},null,-1),q(`strong`,Y3,F(M.value.title),1),M.value.title===`处理中`&&L(t).access?.can_manage?(W(),K(o,{key:0,label:`全部停止`,size:`xs`,color:`error`,variant:`soft`,class:`pb-stop-all`,title:`停止所有成员正在做的工作,并取消还没投递的请求;发新消息即重新开始`,loading:L(i)===`stop_room`,disabled:!!L(i),onClick:a[0]||=e=>L(r)(`stop_room`)},{leading:R(()=>[L(i)===`stop_room`?X(``,!0):(W(),G(`span`,X3))]),_:1},8,[`loading`,`disabled`])):X(``,!0)]),M.value.detail?(W(),G(`p`,Z3,F(M.value.detail),1)):X(``,!0),oe.value?(W(),G(`div`,Q3,[q(`div`,$3,[a[14]||=q(`span`,null,`连续派活`,-1),q(`b`,null,F(oe.value.text),1)]),oe.value.ratio===null?X(``,!0):(W(),G(`div`,e6,[q(`i`,{style:ye({width:`${Math.round(oe.value.ratio*100)}%`})},null,4)]))])):X(``,!0),M.value.continue_chain&&L(t).access?.can_manage?(W(),G(`div`,t6,[(W(!0),G(U,null,V(j.value,e=>(W(),K(o,{key:e,label:e===M.value.asked_rounds?`批准 ${e} 轮`:`继续 ${e} 轮`,icon:`i-lucide-play`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action`,loading:te.value===e,disabled:!!te.value,onClick:t=>ne(M.value.continue_chain,e)},null,8,[`label`,`loading`,`disabled`,`onClick`]))),128))])):X(``,!0)],2)),u.value?(W(),G(`section`,n6,[a[16]||=q(`h4`,null,`Goal`,-1),q(`div`,{class:N([`pb-goal-status`,u.value.status===`active`?`is-success`:`is-paused`])},[a[15]||=q(`span`,{class:`pb-dot`},null,-1),q(`span`,r6,F(u.value.status===`active`?u.value.idle?`进行中 · 空闲,稍后唤醒主持人`:`进行中`:`已暂停`),1)],2),q(`p`,{class:N([`pb-focus`,{"is-expanded":f.value}])},F(u.value.objective),3),u.value.objective.length>b6?(W(),G(`button`,{key:0,type:`button`,class:`pb-link`,onClick:a[1]||=e=>f.value=!f.value},F(f.value?`收起`:`展开`),1)):X(``,!0),q(`p`,i6,F(d.value),1),L(t).access?.can_manage&&!s.value.archived?(W(),G(`div`,a6,[J(o,{label:u.value.status===`active`?`暂停`:`继续`,icon:u.value.status===`active`?`i-lucide-pause`:`i-lucide-play`,size:`xs`,color:`neutral`,variant:`outline`,title:u.value.status===`active`?`房间空闲时不再唤醒主持人,正在进行的工作不受影响`:`继续推进,房间空闲时唤醒主持人`,loading:L(i)===`goal_control`,disabled:!!L(i),onClick:a[2]||=e=>L(r)(`goal_control`,u.value.status===`active`?`pause`:`resume`)},null,8,[`label`,`icon`,`title`,`loading`,`disabled`]),J(o,{label:`编辑`,icon:`i-lucide-pencil`,size:`xs`,color:`neutral`,variant:`outline`,disabled:!!L(i),onClick:a[3]||=e=>p.value=!0},null,8,[`disabled`]),J(o,{label:`结束`,icon:`i-lucide-square`,size:`xs`,color:`neutral`,variant:`outline`,title:`结束 Goal,房间回到自由协作;正在进行的工作不受影响`,loading:L(i)===`goal_control`,disabled:!!L(i),onClick:a[4]||=e=>L(r)(`goal_control`,`clear`)},null,8,[`loading`,`disabled`])])):X(``,!0)])):X(``,!0),se.value&&!l.value?(W(),G(`section`,o6,[a[17]||=q(`h4`,null,`当前任务`,-1),q(`p`,{class:N([`pb-focus`,{"is-expanded":ce.value}])},F(se.value),3),se.value.length>y6?(W(),G(`button`,{key:0,type:`button`,class:`pb-link`,onClick:a[5]||=e=>ce.value=!ce.value},F(ce.value?`收起`:`展开`),1)):X(``,!0)])):X(``,!0),g.value&&!y.value?(W(),G(`section`,s6,[a[18]||=q(`h4`,null,`工作流`,-1),J(p3,{workflow:g.value,dismissible:``,onDismiss:b},null,8,[`workflow`])])):X(``,!0),q(`section`,c6,[a[20]||=q(`h4`,null,`发言顺序`,-1),J(V3,{away:S.value,round:m.value},{default:R(({item:e})=>[(W(!0),G(U,null,V([x(e.name)].filter(Boolean),r=>(W(),K(L(aG),{key:r.id,deps:[le(r,e.state)]},{default:R(()=>[J(c,{src:L(n).identities[r.name]?.icon,text:L(n).identities[r.name]?.initials,alt:r.name,size:`xs`,class:N([`channel-avatar`,L(n).identities[r.name]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`div`,l6,[q(`div`,{class:`pb-member-name`,title:s.value.descriptions?.[r.name]||void 0},[Y(F(L(n).display_name(r.name)),1),L(n).display_name(r.name)===r.name?X(``,!0):(W(),G(`span`,d6,F(r.name),1)),r.role===`host`?(W(),K(C,{key:1,name:`i-lucide-crown`,title:`主持人`})):X(``,!0),q(`small`,{title:A(r)||void 0},F(k(r)),9,f6)],8,u6),_(r.name)?(W(),G(`small`,{key:0,class:`pb-workflow-member`,title:`来自工作流「${g.value.label}」`},`工作流`,8,p6)):X(``,!0),ee(r)?(W(),G(`div`,{key:1,class:`pb-member-model`,title:L(n).participant_session_hint(r.name,s.value,L(t).launch.room_models)},F(ee(r)),9,m6)):X(``,!0),q(`div`,{class:N([`pb-member-status`,`is-${D(r)}`])},[a[19]||=q(`span`,{class:`pb-dot`},null,-1),q(`span`,{class:`pb-member-status-text`,title:r.execution?.status===`failed`?r.execution.result:r.held_until?O(r,e.state):void 0},F(O(r,e.state)),9,h6)],2)]),J(w,{items:ue(r),content:{align:`end`},ui:{content:`channel-menu`}},{default:R(()=>[J(o,{icon:`i-lucide-ellipsis`,color:`neutral`,variant:`ghost`,size:`xs`,class:`pb-member-more`,"aria-label":`${r.name} 的更多操作`},null,8,[`aria-label`])]),_:2},1032,[`items`])]),_:2},1032,[`deps`]))),128))]),_:1},8,[`away`,`round`]),s.value.archived?X(``,!0):(W(),K(o,{key:0,icon:`i-lucide-plus`,label:`邀请 AI 加入`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action pb-action-block pb-action-add`,onClick:a[6]||=e=>{v.value=``,de.value=!0}}))]),!s.value.archived&&!l.value&&!u.value?(W(),G(`section`,g6,[q(`div`,_6,[J(o,{icon:`i-lucide-messages-square`,label:`开启讨论`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action pb-restart`,title:`由主持人推进成员轮流发言,到上限或结束后房间回到自由协作`,disabled:!ge.value,onClick:a[7]||=e=>he.value=!0},null,8,[`disabled`]),J(o,{icon:`i-lucide-target`,label:`开启 Goal`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action pb-restart`,title:`主持人持续推进一个目标:房间空闲时自动接着做,直到完成、卡住或你结束`,disabled:!ge.value,onClick:a[8]||=e=>p.value=!0},null,8,[`disabled`])]),ge.value?X(``,!0):(W(),G(`p`,v6,`开启讨论或 Goal 需要一位由本机唤醒的 AI 主持人。`))])):X(``,!0),J(g3,{open:he.value,"onUpdate:open":a[9]||=e=>he.value=e},null,8,[`open`]),J(aU,{open:p.value,"onUpdate:open":a[10]||=e=>p.value=e,edit:!!u.value,initial:u.value},null,8,[`open`,`edit`,`initial`]),J(a3,{open:de.value,"onUpdate:open":a[11]||=e=>de.value=e,"workflow-id":v.value,description:`新成员加入后不打断其他成员;点卡片翻面可设置软件、模型、项目权限和要续接的已有会话。`},null,8,[`open`,`workflow-id`]),J(MX,{open:!!fe.value,name:fe.value||` `,platform:fe.value?L(n).default_name(L(n).platform_of(fe.value)):``,default_label:fe.value?L(n).default_name(fe.value):``,text:s.value.descriptions?.[fe.value]||``,label:s.value.labels?.[fe.value]||``,template:fe.value?L(n).description_template(fe.value):``,saving:pe.value,"onUpdate:open":a[12]||=e=>{e||(fe.value=``)},onSave:me},null,8,[`open`,`name`,`platform`,`default_label`,`text`,`label`,`template`,`saving`])])}}},[[`__scopeId`,`data-v-ae8acaed`]]),w6={class:`merged-section discussion-history`,"aria-label":`讨论记录`},T6={key:0,class:`fine-print`},E6={class:`history-timeline`},D6={key:0,class:`history-free`},O6={key:1,class:`history-discussion`},k6={class:`history-meta`},A6={key:0,class:`fine-print`},j6={key:1,class:`fine-print`},M6={key:2,class:`history-conclusion`},N6=[`onClick`],P6=[`innerHTML`],F6={key:1,class:`fine-print`},I6=[`aria-expanded`,`onClick`],L6=[`innerHTML`],R6=EH({__name:`DiscussionHistory`,emits:[`detail`],setup(e){let{view:t,bridge:n}=Or(`discussion`),r={active:{label:`进行中`,color:`primary`},paused:{label:`已暂停`,color:`neutral`},concluded:{label:`已结束`,color:`neutral`}},i=Q(()=>t.value.room),a=I(new Set),o=e=>n.render_room_markdown(e),s=e=>e?new Date(e).toLocaleString(`zh-CN`,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1}):``,c=Q(()=>{let e=[],t=0;return(i.value.discussions||[]).forEach((n,r)=>{n.messages_before>t&&e.push({key:`free-${r}`,kind:`free`,count:n.messages_before-t}),e.push({key:`discussion-${n.id}`,kind:`discussion`,number:r+1,...n,count:n.messages_through-n.messages_before,result:l(n)}),t=n.messages_through}),(i.value.message_count||0)>t&&e.push({key:`free-tail`,kind:`free`,count:i.value.message_count-t}),e.reverse()});function l(e){return e.status===`concluded`?e.state===null?{missing:!0}:e.state===i.value.state_text&&e.brief===(i.value.host_brief?.text||``)&&(e.state||e.brief)?{current:!0}:{label:`结论`,brief:e.brief,state:e.state,until:e.state_until}:null}function u(e){let t=new Set(a.value);t.has(e)?t.delete(e):t.add(e),a.value=t}return(e,t)=>{let l=uV,d=Yk;return W(),G(`section`,w6,[t[2]||=q(`div`,{class:`page-heading`},[q(`div`,null,[q(`h2`,null,`讨论记录`),q(`p`,null,`每场讨论及其结束时的结论,最新的在上;自由协作的消息按段汇总。`)])],-1),i.value.discussions?.length?X(``,!0):(W(),G(`p`,T6,`还没有开启过讨论。`)),q(`ol`,E6,[(W(!0),G(U,null,V(c.value,i=>(W(),G(`li`,{key:i.key,class:N(`is-${i.kind}`)},[t[1]||=q(`span`,{class:`history-dot`,"aria-hidden":`true`},null,-1),i.kind===`free`?(W(),G(`p`,D6,`自由协作 · `+F(i.count)+` 条消息`,1)):(W(),G(`article`,O6,[q(`header`,null,[q(`h3`,null,[q(`small`,null,`讨论 `+F(i.number),1),Y(F(i.goal||`未填写目标`),1)]),J(l,{color:r[i.status]?.color||`neutral`,variant:`subtle`,size:`sm`},{default:R(()=>[Y(F(r[i.status]?.label||i.status),1)]),_:2},1032,[`color`])]),q(`p`,k6,[Y(F(s(i.created_at))+` 开始 · `+F(i.count)+` 条消息`,1),i.status===`concluded`&&i.state!==null?(W(),G(U,{key:0},[Y(` · `+F(L(n).stop_reason_label(i)),1)],64)):X(``,!0),i.concluded_at?(W(),G(U,{key:1},[Y(` · `+F(s(i.concluded_at))+` 结束`,1)],64)):X(``,!0)]),i.result?.current?(W(),G(`p`,A6,`结论即上方的当前共识。`)):i.result?.missing?(W(),G(`p`,j6,`这场讨论结束于结论快照功能之前,没有保存当时的结论。`)):i.result?(W(),G(`div`,M6,[q(`small`,null,[Y(F(i.result.label),1),i.result.until?(W(),G(`button`,{key:0,type:`button`,class:`subtle-link`,onClick:t=>e.$emit(`detail`,i.result.until)},`整理至 #`+F(i.result.until),9,N6)):X(``,!0)]),i.result.brief?(W(),G(`div`,{key:0,class:`markdown-body`,innerHTML:o(i.result.brief)},null,8,P6)):i.result.state?X(``,!0):(W(),G(`p`,F6,`主持人没有留下简报或共识。`)),i.result.state?(W(),G(U,{key:2},[q(`button`,{type:`button`,class:`history-toggle`,"aria-expanded":a.value.has(i.id),onClick:e=>u(i.id)},[t[0]||=Y(`详细共识与进度`,-1),J(d,{name:a.value.has(i.id)?`i-lucide-chevron-up`:`i-lucide-chevron-down`},null,8,[`name`])],8,I6),a.value.has(i.id)?(W(),G(`div`,{key:0,class:`markdown-body history-state`,innerHTML:o(i.result.state)},null,8,L6)):X(``,!0)],64)):X(``,!0)])):X(``,!0)]))],2))),128))])])}}},[[`__scopeId`,`data-v-ecc64789`]]),z6={class:`merged-section room-overview`,"aria-label":`成员与设置`},B6={class:`page-heading`},V6={class:`overview-section`},H6={key:0,class:`overview-local`,role:`status`},U6={class:`member-cards`,"aria-label":`成员`},W6=[`draggable`,`onDragstart`,`onDragover`,`onDragleave`,`onDrop`],G6={class:`member-card-head`},K6={class:`member-card-name`},q6={key:0,class:`member-id`},J6=[`title`],Y6={class:`member-card-facts`},X6=[`aria-label`,`title`],Z6=[`aria-checked`,`disabled`,`onClick`],Q6={key:1},$6=[`title`],e8=[`aria-label`,`aria-busy`,`title`],t8=[`aria-checked`,`title`,`disabled`,`onClick`],n8=[`title`],r8=[`title`],i8=[`aria-label`],a8={key:0},o8={class:`overview-section`},s8={class:`overview-settings`},c8={class:`overview-workflow`},l8={key:1,class:`overview-muted`},u8={key:0},d8={key:1},f8={key:1},p8={key:2},m8={key:2},h8={key:3},g8={key:4},_8={class:`overview-directories`},v8={class:`overview-address`,title:`主目录,设置后不能更改`},y8={key:2,class:`overview-muted`},b8={key:3,class:`overview-directories-actions`},x8={class:`overview-muted`},S8={class:`overview-address`},C8={key:5},w8={key:0,class:`overview-muted`},T8={key:2,class:`overview-muted`},E8={class:`overview-model-actions`},D8=`设为主持人`,O8=EH({__name:`RoomOverview`,setup(e){let{view:t,bridge:n,act:r}=Or(`discussion`),i={manual:`手动接入`},a={active:`在场`,away:`暂离`},o=e=>e.access===`manual`&&!e.registered_at,s=[`codex_cli`,`claude`,`antigravity_cli`,`api`],c=[{value:`codex_cli`,label:`CLI`},{value:`codex`,label:`App`}],l={api:`API`,codex:`App`,antigravity:`App`},u=Q(()=>t.value.room),d=Q(()=>![`active`,`paused`].includes(u.value.session?.status)),f=Q(()=>t.value.launch.room_models?.room_id===u.value.id?t.value.launch.room_models:null),p=Q(()=>t.value.launch.available?!f.value||f.value.loading?{text:`正在读取本机配置…`}:f.value.error?{text:`读取本机配置失败:${f.value.error}`,retry:!0}:f.value.registered===!1?{text:`本机没有登记此房间,模型与权限不可见。`}:null:{text:`未连接本机服务,模型与权限暂不可见。`}),m=e=>!!f.value?.participants?.[e]?.defaults_pending,h=I(``),g=I(!1),_=I(0);z(()=>u.value.free?.max_rounds,e=>{_.value=e||0},{immediate:!0});async function v(e){_.value=e,g.value=!0;try{await n.set_chain_rounds(e),n.notify(`info`,`推进轮数已保存,进行中的任务链也按新值`)}catch{_.value=u.value.free?.max_rounds||0}finally{g.value=!1}}let y=I(!1),b=I(0);z(()=>f.value?.api_max_requests,e=>{b.value=e??0},{immediate:!0});let x=I(!1),S=I([]),C=I(``);z(()=>f.value?.extra_directories,e=>{S.value=[...e||[]]},{immediate:!0}),z(()=>f.value?.project_directory,()=>{C.value=``});let w=Q(()=>!!C.value.trim()||JSON.stringify(S.value)!==JSON.stringify(f.value?.extra_directories||[])),T=Q(()=>t.value.access?.can_manage&&!u.value.archived&&t.value.launch.available);async function E(){x.value=!0;try{C.value.trim()?await n.set_room_project_directory(C.value.trim()):await n.set_room_extra_directories(S.value.map(e=>e.trim()).filter(Boolean)),n.notify(`info`,`项目目录已保存,从各成员下一次执行起生效`)}catch{}finally{x.value=!1}}function D(){C.value=``,S.value=[...f.value?.extra_directories||[]]}async function O(e){b.value=e,y.value=!0;try{await n.set_room_api_max_requests(e),n.notify(`info`,`API 请求上限已保存,从下一次执行起生效`)}catch{b.value=f.value?.api_max_requests??0}finally{y.value=!1}}let k=Q(()=>u.value.speaking_order||{kind:`default`,movable:[],default:[]}),A=Q(()=>{let e=k.value.default||[],t=t=>e.includes(t)?e.indexOf(t):e.length;return[...u.value.members||[]].sort((e,n)=>t(e.name)-t(n.name))}),ee=Q(()=>!!t.value.access?.can_manage&&!u.value.archived&&k.value.kind==="default"&&k.value.movable.length>1),j=I(``),te=I(``),ne=I(``);function M(e,t){j.value=e.name,t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,e.name)}function re(e,t){j.value&&j.value!==e.name&&k.value.movable.includes(e.name)&&(t.preventDefault(),te.value=e.name)}function ie(e){let t=[...k.value.movable],n=t.indexOf(j.value),i=t.indexOf(e.name);ae(),!(n<0||i<0||n===i)&&(t.splice(i,0,t.splice(n,1)[0]),r(`reorder_speakers`,{revision:k.value.revision,order:t}))}function ae(){j.value=te.value=ne.value=``}let oe=Q(()=>FU(f.value?.workflow,u.value.free?.members)),se=e=>!!(oe.value?.enabled&&Object.values(oe.value.members||{}).includes(e));function ce(e){if(i[e.access])return{text:i[e.access]};let r=f.value?.participants?.[e.name]?.adapter;if(![`codex`,`codex_cli`].includes(r))return{text:r?l[r]||`CLI`:n.participant_access(e.name,u.value)};let a=!(e.pending>0||[`dispatched`,`started`].includes(e.execution?.status));return{value:r,editable:d.value&&a&&t.value.access?.can_manage&&t.value.launch.available,hint:d.value?a?`切换后沿用原会话;切回 CLI 前须让 App 释放原聊天`:`正在处理请求,完成后再切换`:`讨论进行中不能切换`}}function le(e){return(u.value.free?.members||[]).find(t=>t.name===e.name)||e}async function ue(e,t){if(!(h.value||ce(le(e)).value===t)){h.value=e.name;try{await n.set_member_adapter({name:e.name,adapter:t}),n.notify(`info`,`${n.display_name(e.name)} 已改为 ${t===`codex`?`App`:`CLI`} 接入,下次处理请求起生效。`)}catch(e){n.notify(`error`,e.message)}finally{h.value=``}}}function de(e){if(e.access===`manual`)return{text:`自行决定`,hint:`手动成员的权限由它自己的会话决定`};let n=f.value?.participants?.[e.name];return n?n.project_access===`own`?{text:`自行决定`,hint:`手动接入的成员,由本机服务投递时仍沿用它自己会话的软件权限`}:s.includes(n.adapter)?n.own_project?{text:`agy 内设置`,hint:`续接它自己的 agy 对话,权限沿用该对话所在项目`}:m(e.name)?{value:n.project_access||`read`,hint:`正在读取 agy 的配置`}:{value:n.project_access||`read`,editable:t.value.access?.can_manage&&t.value.launch.available}:{text:`App 内设置`,hint:`App 成员的权限在 App 里设置`}:{text:`—`}}async function fe(e,t){if(!(h.value||de(e).value===t)){h.value=e.name;try{await n.set_member_access({name:e.name,project_access:t}),n.notify(`info`,`${n.display_name(e.name)} 已改为${BX(t)},下次处理请求起生效。`)}catch(e){n.notify(`error`,e.message)}finally{h.value=``}}}let pe=[`codex_cli`,`claude`,`antigravity_cli`],me={low:`Low`,medium:`Medium`,high:`High`,xhigh:`Extra High`,max:`Max`,ultra:`Ultra`};function he(e){let n=f.value?.participants?.[e.name];return e.access===`runner`&&pe.includes(n?.adapter)&&n.project_access!==`own`&&!m(e.name)&&t.value.access?.can_manage&&t.value.launch.available}let ge=I(null),_e=I(!1),ve=Q(()=>ge.value&&n.launch_model_state(ge.value.name,t.value.launch,ge.value.draft)),ye=Q(()=>{let e=ve.value?.efforts;return e?.length?[{label:`默认强度`,value:``},...e.map(e=>({label:me[e]||e,value:e}))]:null});function be(e){let{adapter:t,model:r,effort:i}=f.value.participants[e.name];ge.value={name:e.name,draft:{adapter:t,model:r||``,effort:i||``}},n.load_launch_models(e.name,!1,ge.value.draft)}function xe(e){let t=ge.value.draft;t.model=e===`__default__`?``:e,t.adapter===`antigravity_cli`&&n.load_launch_models(ge.value.name,!1,t),ve.value?.efforts?.includes(t.effort)||(t.effort=``)}async function Se(){let{name:e,draft:t}=ge.value;_e.value=!0;try{await n.set_member_model({name:e,model:t.model,effort:t.effort}),n.notify(`info`,`${n.display_name(e)} 的模型与强度已更新,下次处理请求起生效,保留原会话。`),ge.value=null}catch(e){n.notify(`error`,e.message)}finally{_e.value=!1}}let Ce=Q(()=>{if(p.value)return`—`;if(!f.value.scheduler)return`未开启`;let e=t.value.launch.scheduler_providers?.[f.value.scheduler.provider]?.label||f.value.scheduler.provider,n=t.value.launch.scheduler_modes?.[f.value.scheduler.mode];return[e,f.value.scheduler.model,n].filter(Boolean).join(` · `)});function P(e){let[n,i,a]=W3(le(e),{view:t.value,act:r,describe:e=>{De.value=e}});return d.value?{taking_part:n,host:i.find(e=>e.label===D8)||null,place:[...i.filter(e=>e.label!==D8),...a]}:{taking_part:n,host:null,place:[]}}function we(e){let r=n.identities[e.name];return JSON.stringify([e,le(e),f.value?.participants?.[e.name],t.value.access,t.value.launch.available,d.value,ee.value&&k.value.movable.includes(e.name),j.value===e.name,te.value===e.name,ne.value===e.name,h.value,se(e.name)&&oe.value.label,u.value.descriptions?.[e.name],r?.icon,r?.initials,r?.style,n.display_name(e.name),n.participant_model(e.name,u.value,f.value),n.participant_access(e.name,u.value),u.value.session?.status])}let Te=I(!1),Ee=I(``),De=I(``),Oe=I(!1);z(()=>u.value.id,()=>{Te.value=!1,De.value=``});async function ke({text:e,label:t,as_template:r}){Oe.value=!0;try{await n.describe_member(De.value,e,t),r&&n.save_description_template(De.value,e),De.value=``}catch{}finally{Oe.value=!1}}let Ae=Q(()=>`${t.value.room_site}/r/${u.value.id}`),je=Q(()=>u.value.created_at?new Date(u.value.created_at).toLocaleString(`zh-CN`,{hour12:!1}):``);return(e,i)=>{let s=bA,l=Yk,pe=tA,me=uV,Me=WV,Ne=$B;return W(),G(`section`,z6,[q(`div`,B6,[i[14]||=q(`div`,null,[q(`h2`,null,`成员与设置`),q(`p`,null,`成员的接入、权限与全部操作,以及房间的协作设置;右栏成员菜单是同样操作的快捷入口。`)],-1),u.value.archived?X(``,!0):(W(),K(s,{key:0,icon:`i-lucide-plus`,label:`邀请 AI 加入`,variant:`outline`,color:`neutral`,class:`channel-surface-button`,disabled:!L(t).access?.can_manage,onClick:i[0]||=e=>Te.value=!0},null,8,[`disabled`]))]),q(`section`,V6,[i[19]||=q(`h3`,null,`成员`,-1),p.value?(W(),G(`p`,H6,[Y(F(p.value.text),1),p.value.retry?(W(),G(`button`,{key:0,type:`button`,class:`subtle-link`,onClick:i[1]||=e=>L(n).reload_room_models()},`重试`)):X(``,!0)])):X(``,!0),q(`ul`,U6,[(W(!0),G(U,null,V(A.value,e=>(W(),K(L(aG),{key:e.name,deps:[we(e)]},{default:R(()=>[q(`li`,{class:N([`member-card`,{"is-dimmed":j.value===e.name,"is-drop-target":te.value===e.name}]),draggable:ne.value===e.name,onDragstart:t=>M(e,t),onDragover:t=>re(e,t),onDragleave:t=>te.value===e.name&&(te.value=``),onDrop:_u(t=>ie(e),[`prevent`]),onDragend:ae},[q(`header`,G6,[ee.value&&k.value.movable.includes(e.name)?(W(),K(l,{key:0,name:`i-lucide-grip-vertical`,class:`member-card-grip`,title:`拖动调整成员顺序,右栏发言顺序与 @全体依次 同步`,onPointerdown:t=>ne.value=e.name,onPointerup:i[2]||=e=>ne.value=``},null,8,[`onPointerdown`])):X(``,!0),J(pe,{src:L(n).identities[e.name]?.icon,text:L(n).identities[e.name]?.initials,alt:e.name,size:`md`,class:N([`channel-avatar`,L(n).identities[e.name]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`div`,K6,[q(`strong`,null,[Y(F(L(n).display_name(e.name)),1),L(n).display_name(e.name)===e.name?X(``,!0):(W(),G(`span`,q6,F(e.name),1)),e.role===`host`?(W(),K(l,{key:1,name:`i-lucide-crown`,title:`主持人`})):X(``,!0)]),u.value.descriptions?.[e.name]?(W(),G(`small`,{key:0,title:u.value.descriptions[e.name]},F(u.value.descriptions[e.name]),9,J6)):X(``,!0)]),P(e).host?(W(),K(s,{key:1,icon:P(e).host.icon,label:P(e).host.label,size:`xs`,variant:`ghost`,color:`neutral`,disabled:P(e).host.disabled,onClick:t=>P(e).host.onSelect()},null,8,[`icon`,`label`,`disabled`,`onClick`])):X(``,!0),se(e.name)?(W(),K(me,{key:2,color:`neutral`,variant:`outline`,size:`sm`,title:`来自工作流「${oe.value.label}」,提示词按工作流卡片发送`},{default:R(()=>[...i[15]||=[Y(`工作流`,-1)]]),_:1},8,[`title`])):X(``,!0),J(me,{color:o(e)?`warning`:e.status===`active`?`success`:`neutral`,variant:`subtle`,size:`sm`},{default:R(()=>[Y(F(o(e)?`待注册`:a[e.status]||e.status),1)]),_:2},1032,[`color`])]),q(`dl`,Y6,[q(`div`,null,[i[16]||=q(`dt`,null,`接入`,-1),q(`dd`,null,[ce(le(e)).value?(W(),G(`div`,{key:0,class:N([`expert-card-modes overview-switch`,{"is-locked":!ce(le(e)).editable}]),role:`radiogroup`,"aria-label":`${e.name} 的接入方式`,title:ce(le(e)).hint},[(W(),G(U,null,V(c,t=>q(`button`,{key:t.value,type:`button`,role:`radio`,"aria-checked":ce(le(e)).value===t.value,disabled:!ce(le(e)).editable||!!h.value,onClick:n=>ue(e,t.value)},F(t.label),9,Z6)),64))],10,X6)):(W(),G(`span`,Q6,F(ce(e).text),1))])]),q(`div`,null,[i[17]||=q(`dt`,null,`模型`,-1),q(`dd`,{class:N([`overview-model`,{"overview-muted":m(e.name)}]),title:L(n).participant_model(e.name,u.value,f.value)||void 0},[q(`span`,null,F(e.access===`runner`?L(n).participant_model(e.name,u.value,f.value)||`—`:`在它自己的会话里设置`),1),he(e)?(W(),K(s,{key:0,icon:`i-lucide-pencil`,size:`xs`,variant:`ghost`,color:`neutral`,"aria-label":`更改 ${e.name} 的模型与强度`,title:`更改模型与思考强度`,onClick:t=>be(e)},null,8,[`aria-label`,`onClick`])):X(``,!0)],10,$6)]),q(`div`,null,[i[18]||=q(`dt`,null,`项目文件`,-1),q(`dd`,null,[de(e).value?(W(),G(`div`,{key:0,class:N([`expert-card-modes overview-switch`,{"is-locked":!de(e).editable}]),role:`radiogroup`,"aria-label":`${e.name} 的项目文件权限`,"aria-busy":h.value===e.name,title:de(e).hint||void 0},[(W(!0),G(U,null,V(L(zX)(f.value?.participants?.[e.name]?.adapter),t=>(W(),G(`button`,{key:t.value,type:`button`,role:`radio`,"aria-checked":de(e).value===t.value,title:t.hint,disabled:t.disabled||!de(e).editable||!!h.value,onClick:n=>fe(e,t.value)},F(t.label),9,t8))),128))],10,e8)):(W(),G(`span`,{key:1,class:`overview-muted`,title:de(e).hint},F(de(e).text),9,n8)),f.value?.participants?.[e.name]?.outside_directory?(W(),G(`p`,{key:2,class:`overview-outside`,title:f.value.participants[e.name].outside_directory},[J(l,{name:`i-lucide-triangle-alert`}),Y(`在 `+F(f.value.participants[e.name].outside_directory)+` 工作,房间目录`+F(f.value.participants[e.name].outside_enforced?`只读`:`只读(仅任务要求,程序拦不住)`),1)],8,r8)):X(``,!0)])])]),q(`footer`,{class:`member-card-actions`,"aria-label":`${e.name} 的操作`},[q(`div`,null,[(W(!0),G(U,null,V(P(e).taking_part,e=>(W(),K(s,{key:e.label,icon:e.icon,label:e.label,size:`xs`,variant:`ghost`,color:`neutral`,disabled:e.disabled,onClick:t=>e.onSelect()},null,8,[`icon`,`label`,`disabled`,`onClick`]))),128))]),P(e).place.length?(W(),G(`div`,a8,[(W(!0),G(U,null,V(P(e).place,e=>(W(),K(s,{key:e.label,icon:e.icon,label:e.label,size:`xs`,variant:`ghost`,color:e.color||`neutral`,disabled:e.disabled,onClick:t=>e.onSelect()},null,8,[`icon`,`label`,`color`,`disabled`,`onClick`]))),128))])):X(``,!0)],8,i8)],42,W6)]),_:2},1032,[`deps`]))),128))]),i[20]||=q(`p`,{class:`overview-result`},`复制说明或下载配置不代表 AI 已接入,以实际回答和运行记录为准。`,-1)]),q(`section`,o8,[i[31]||=q(`h3`,null,`协作设置`,-1),q(`dl`,s8,[q(`div`,null,[i[21]||=q(`dt`,null,`主持人`,-1),q(`dd`,null,F(u.value.host?L(n).display_name(u.value.host):`未指定`),1)]),q(`div`,null,[i[22]||=q(`dt`,null,`智能调度`,-1),q(`dd`,null,F(Ce.value),1)]),q(`div`,null,[i[23]||=q(`dt`,null,`工作流`,-1),q(`dd`,c8,[oe.value?(W(),K(p3,{key:0,workflow:oe.value},null,8,[`workflow`])):(W(),G(`span`,l8,`没有进行中的工作流;在输入框打 / 或邀请成员时选择`))])]),f.value?.registered?(W(),G(`div`,u8,[i[24]||=q(`dt`,null,`主持人自建工作流`,-1),q(`dd`,null,[J(I$,{"model-value":!!f.value.host_workflows,disabled:!L(t).access?.can_manage||u.value.archived,"onUpdate:modelValue":i[3]||=e=>L(r)(`set_room_host_workflows`,e)},null,8,[`model-value`,`disabled`])])])):X(``,!0),u.value.free?.max_rounds==null?X(``,!0):(W(),G(`div`,d8,[i[25]||=q(`dt`,null,`连续派活上限`,-1),q(`dd`,null,[L(t).access?.can_manage?(W(),K(YY,{key:0,"model-value":_.value,disabled:g.value,"onUpdate:modelValue":v},null,8,[`model-value`,`disabled`])):u.value.free.max_rounds?(W(),G(`span`,f8,`主持人收到你的一条消息后,最多连续派活 `+F(u.value.free.max_rounds)+` 轮(派活 → 成员回答 → 交回汇总为一轮),然后停下等你`,1)):(W(),G(`span`,p8,`主持人收到你的一条消息后,可一直连续派活,不限轮数`))])])),f.value?.registered?(W(),G(`div`,m8,[i[26]||=q(`dt`,null,`API 请求上限`,-1),q(`dd`,null,[J(HY,{"model-value":b.value,disabled:!L(t).access?.can_manage||u.value.archived||y.value,"onUpdate:modelValue":O},null,8,[`model-value`,`disabled`])])])):X(``,!0),d.value?X(``,!0):(W(),G(`div`,h8,[i[27]||=q(`dt`,null,`逐人追问`,-1),q(`dd`,null,F(u.value.named_followup?`开启:主持人每轮给每位专家写针对性追问`:`关闭:首轮后请专家回应上一轮观点`),1)])),f.value?.registered?(W(),G(`div`,g8,[i[28]||=q(`dt`,null,`项目目录`,-1),q(`dd`,_8,[f.value.project_directory?(W(),G(U,{key:0},[q(`div`,v8,[J(l,{name:`i-lucide-lock`,class:`overview-lock`}),q(`code`,null,F(f.value.project_directory),1),J(s,{icon:`i-lucide-copy`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`复制项目目录`,onClick:i[4]||=e=>L(r)(`copy`,f.value.project_directory)})]),J(vQ,{modelValue:S.value,"onUpdate:modelValue":i[5]||=e=>S.value=e,disabled:!T.value||x.value},null,8,[`modelValue`,`disabled`])],64)):T.value?(W(),K(pQ,{key:1,modelValue:C.value,"onUpdate:modelValue":i[6]||=e=>C.value=e,compact:``,placeholder:`为本房间设置项目目录的完整路径`,disabled:x.value},null,8,[`modelValue`,`disabled`])):(W(),G(`span`,y8,`未指定`)),w.value?(W(),G(`div`,b8,[J(s,{label:`取消`,color:`neutral`,variant:`ghost`,size:`xs`,disabled:x.value,onClick:D},null,8,[`disabled`]),J(s,{label:`保存`,size:`xs`,class:`channel-primary-button`,loading:x.value,onClick:E},null,8,[`loading`])])):X(``,!0),q(`span`,x8,F(f.value.project_directory?`成员按自己的项目权限读写其他目录,在别处工作的成员只读。改动从各成员下一次执行起生效,会话保留。`:`主目录只能设置一次,之后不能更改。已在房间的成员保留原会话,按自己的项目权限读写它;之后邀请的成员在其中工作。`),1)])])):X(``,!0),q(`div`,null,[i[29]||=q(`dt`,null,`阅读地址`,-1),q(`dd`,S8,[q(`code`,null,F(Ae.value),1),J(s,{icon:`i-lucide-copy`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`复制阅读地址`,onClick:i[7]||=e=>L(r)(`copy`,Ae.value)})])]),je.value?(W(),G(`div`,C8,[i[30]||=q(`dt`,null,`创建时间`,-1),q(`dd`,null,F(je.value),1)])):X(``,!0)])]),J(a3,{open:Te.value,"onUpdate:open":[i[8]||=e=>Te.value=e,i[9]||=e=>{e||(Ee.value=``)}],"workflow-id":Ee.value,description:d.value?`新成员加入后不打断其他成员;点卡片翻面可设置软件、模型、项目权限和要续接的已有会话。`:`新专家由程序按本机软件配置启动,或由你手动启动,加入本轮发言队列。`},null,8,[`open`,`workflow-id`,`description`]),J(Ne,{content:{onInteractOutside:e=>e.preventDefault()},open:!!ge.value,title:ge.value?`${L(n).display_name(ge.value.name)} 的模型与强度`:``,description:`下次处理请求起生效,保留原会话。`,ui:{content:`glass-panel studio-modal`,body:`dialog-body`},"onUpdate:open":i[12]||=e=>{e||(ge.value=null)}},{body:R(()=>[ge.value?(W(),G(`form`,{key:0,class:`overview-model-form`,onSubmit:_u(Se,[`prevent`])},[q(`label`,null,[i[32]||=q(`span`,null,`模型`,-1),J(Me,{"model-value":ge.value.draft.model||`__default__`,items:ve.value.items,title:ve.value.source,"aria-label":`${ge.value.name} 使用的模型`,class:`w-full`,"onUpdate:modelValue":xe},null,8,[`model-value`,`items`,`title`,`aria-label`])]),ve.value.loading||ve.value.error?(W(),G(`p`,w8,F(ve.value.loading?`正在读取软件模型列表…`:ve.value.error),1)):X(``,!0),ye.value?(W(),K(lX,{key:1,caption:`强度`,items:ye.value,"model-value":ge.value.draft.effort,label:`${ge.value.name} 的思考强度`,"onUpdate:modelValue":i[10]||=e=>ge.value.draft.effort=e},null,8,[`items`,`model-value`,`label`])):(W(),G(`p`,T8,F(ve.value.effort_note),1)),q(`div`,E8,[J(s,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:i[11]||=e=>ge.value=null}),J(s,{type:`submit`,label:`保存`,class:`channel-primary-button`,loading:_e.value},null,8,[`loading`])])],32)):X(``,!0)]),_:1},8,[`content`,`open`,`title`]),J(MX,{open:!!De.value,name:De.value||` `,platform:De.value?L(n).default_name(L(n).platform_of(De.value)):``,default_label:De.value?L(n).default_name(De.value):``,text:u.value.descriptions?.[De.value]||``,label:u.value.labels?.[De.value]||``,template:De.value?L(n).description_template(De.value):``,saving:Oe.value,"onUpdate:open":i[13]||=e=>{e||(De.value=``)},onSave:ke},null,8,[`open`,`name`,`platform`,`default_label`,`text`,`label`,`template`,`saving`])])}}},[[`__scopeId`,`data-v-e3e28daa`]]),k8={thinking:`思考`,command:`命令`,tool:`工具`,editing:`编辑`,writing:`撰写`},A8={thinking:`model`,writing:`model`,command:`tool`,tool:`tool`,editing:`tool`},j8={running:`进行中`,done:`完成`,failed:`失败`,cancelled:`已撤销`},M8=3e5,N8=.03;function P8(e){if(e<1e3)return`${Math.max(0,Math.round(e))}ms`;if(e<1e4)return`${(e/1e3).toFixed(1)}s`;let t=Math.round(e/1e3);return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m ${String(t%60).padStart(2,`0`)}s`:`${Math.floor(t/3600)}h ${String(Math.floor(t%3600/60)).padStart(2,`0`)}m`}function F8(e,t){let n=e.state===`running`,r=e.finished_at?e.finished_at*1e3:t,i=e.dispatched_at?e.dispatched_at*1e3:0,a=Math.min(e.queued_at?e.queued_at*1e3:i||r,i||r),o=i?e.segments.map((t,a)=>{let o=n&&a===e.segments.length-1,s=Math.min(i+t.end_ms,r);return{phase:t.phase,tool:t.tool,live:o,seen:s,start:Math.min(i+t.start_ms,r),end:o?r:s}}):[],s=e.started_at?e.started_at*1e3:o[0]?.start??0,c=i?Math.max(i,Math.min(s||i,r)):r,l=i?(e.notes||[]).map((e,t)=>({index:t,at:Math.min(Math.max(e*1e3,i),r)})):[];return{start:a,end:r,queue:[a,i||r],wake:i&&c>i?[i,c]:null,work:i?[c,r]:null,wake_approx:!e.started_at,segments:o,notes:l}}var I8=18e4,L8=6e5;function R8(e,t){let{item:n}=e;if(n.state===`failed`)return{tone:`failed`,text:n.reason||`执行失败`};if(n.state===`cancelled`)return{tone:`muted`,text:`已撤销`};if(n.state===`done`){let e=n.changes?` · 改动 ${n.changes} 个文件`:``;return{tone:`done`,text:`${n.result||`已完成`}${e}`}}if(!n.dispatched_at)return{tone:`muted`,text:`排队中`};let r=n.dispatched_at*1e3,i=n.segments.at(-1),a=Math.max(n.activity_at?n.activity_at*1e3:0,i?r+i.end_ms:0,...(n.notes||[]).map(e=>e*1e3)),o=a?t-a:0;return o>=18e4?i?.phase===`command`?{tone:`warn`,text:`命令已运行 ${P8(o)}`}:i?.phase===`thinking`&&o<6e5?{tone:`live`,text:`思考中,已 ${P8(o)} 无中间输出`}:{tone:`warn`,text:`已 ${P8(o)} 无输出,可能卡住`}:n.last_note?{tone:`live`,text:n.last_note}:i?{tone:`live`,text:`${k8[i.phase]}${i.tool?` · ${i.tool}`:``}中`}:{tone:`live`,text:`处理中`}}function z8(e,t){return[...e.segments.map(e=>({at:e.start,kind:`phase`,phase:e.phase,tool:e.tool,duration:e.end-e.start,live:e.live})),...e.notes.map(e=>({at:e.at,kind:`note`,text:t?.[e.index]??(t?`(未能读取)`:`读取中…`)}))].sort((e,t)=>e.at-t.at||(e.kind===`note`)-(t.kind===`note`))}function B8(e,t,n=new Map){let r=t/1e3,i=[];for(let t of e.executions){if((t.queued_at||t.dispatched_at||1/0)>r)continue;if(t.finished_at&&t.finished_at<=r){i.push(t);continue}let e=t.dispatched_at&&t.dispatched_at<=r?t.dispatched_at:0,a=e?(r-e)*1e3:0,o=(t.notes||[]).filter(e=>e<=r);i.push({...t,state:`running`,status:`started`,finished_at:0,dispatched_at:e,started_at:t.started_at&&t.started_at<=r?t.started_at:0,segments:e?t.segments.filter(e=>e.start_ms<=a).map(e=>({...e,end_ms:Math.min(e.end_ms,a)})):[],notes:o,last_note:o.length?n.get(t.id)?.[o.length-1]??null:null,activity_at:t.activity_at&&t.activity_at<=r?t.activity_at:0,reason:``,result:null,answer_id:null,changes:null})}return{...e,executions:i}}function V8(e,t,n){let r=e.filter(e=>e.at>=t&&e.at<=n);if(r.length)return{notes:r,earlier:!1};let i=e.filter(e=>e.at<t).at(-1);return{notes:i?[i]:[],earlier:!!i}}function H8(e,t){let n=e.executions.map(n=>({key:`${n.source}:${n.id}`,parent:n.parent_id?`free:${n.parent_id}`:``,item:n,truncated:n.segments.length>=e.segment_limit,...F8(n,t)})),r=new Map(n.map(e=>[e.key,e])),i=e=>{let t=r.get(e.parent);for(let n=new Set([e.key]);t?.item.member===e.item.member&&!n.has(t.key);t=r.get(t.parent))n.add(t.key);return t&&t.key!==e.key&&t.item.member!==e.item.member?t.key:``},a=new Map;for(let e of n){let t=i(e);a.has(t)||a.set(t,[]),a.get(t).push(e)}let o=[],s=new Set,c=(e,t,n)=>{for(let r of(a.get(e)||[]).sort((e,t)=>e.start-t.start||e.key.localeCompare(t.key)))s.has(r.key)||(s.add(r.key),o.push({...r,depth:t,ancestors:n,placed_parent:e,has_children:!!a.get(r.key)?.length}),c(r.key,t+1,[...n,r.key]))};c(``,0,[]);for(let e of n)s.has(e.key)||o.push({...e,depth:0,ancestors:[],placed_parent:``,has_children:!1});return o}function U8(e,t){if(e.source===`discussion`)return`run:${e.run_id||e.id}`;let n=e;for(let r=new Set([e.id]);n.parent_id&&t.has(n.parent_id)&&!r.has(n.parent_id);n=t.get(n.parent_id))r.add(n.parent_id);return n.task_id?`task:${n.task_id}`:`exec:${n.id}`}function W8(e,t){let n=new Map(e.executions.filter(e=>e.source===`free`).map(e=>[e.id,e])),r=new Map,i=new Map;for(let a of e.executions){let e=U8(a,n);i.set(`${a.source}:${a.id}`,e);let o=F8(a,t),s=r.get(e)||{key:e,source:a.source,start:o.start,end:o.end,count:0,running:!1,failed:!1,task:``,first:1/0};s.start=Math.min(s.start,o.start),s.end=Math.max(s.end,o.end),s.count+=1,s.running||=a.state===`running`,s.failed||=a.state===`failed`,a.task&&o.start<s.first&&(s.task=a.task,s.first=o.start),r.set(e,s)}return{list:[...r.values()].sort((e,t)=>t.start-e.start),of:i}}function G8(e,t){let n=new Map(e.map((e,t)=>[e.key,t])),r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};return e.forEach((r,a)=>{let o=n.get(r.placed_parent);if(o===void 0||o>=a)return;let s=t.x(r.queue[0]),c=r.item.member;i(e[o].key,{x:s,part:`start`,member:c});for(let t=o+1;t<a;t+=1)i(e[t].key,{x:s,part:`through`,member:c});i(r.key,{x:s,part:`end`,member:c,to:t.x(r.queue[1]>r.queue[0]?r.queue[0]:r.start)})}),r}var K8=[5,6,7,8,10,12,15,18,20,24,30,36,45,50,60,75,90,105,120,150,180,210,240,300,360,420,480,600,720,900,1080,1200,1500,1800,2100,2400,3e3,3600,4500,5400,6300,7200,9e3,10800,12600,14400,18e3,21600,25200,28800,36e3,43200,54e3,64800,72e3,86400].map(e=>e*1e3),q8=.75;function J8(e,t=!1){let n=e.map(e=>[e.start,e.end]).sort((e,t)=>e[0]-t[0]);if(!n.length)return{start:0,end:0,busy_ms:0,folds:[],spans:[],x:()=>0};let r=[];for(let[e,t]of n){let n=r.at(-1);n&&e<=n[1]+3e5?n[1]=Math.max(n[1],t):r.push([e,t])}let i=r.reduce((e,[t,n])=>e+(n-t),0),a=i;t&&i&&(a=K8.find(e=>e>=i/q8)??Math.ceil(i/q8),r.at(-1)[1]+=a-i);let o=Math.min(N8,.5/Math.max(1,r.length-1)),s=a?(1-o*(r.length-1))/a:0,c=[],l=0;return r.forEach(([e,t],n)=>{if(n){let t=r[n-1][1];c.push({start:t,end:e,from:l,width:o,fold:!0}),l+=o}let i=a?(t-e)*s:1/r.length;c.push({start:e,end:t,from:l,width:i,fold:!1}),l+=i}),{start:r[0][0],end:r.at(-1)[1],busy_ms:i,total_ms:a,x:e=>{let t=c.find(t=>e<=t.end)||c.at(-1);return e<=t.start?t.from:t.from+(t.end>t.start?Math.min(1,(e-t.start)/(t.end-t.start))*t.width:0)},spans:c.filter(e=>!e.fold).map(({start:e,end:t,from:n,width:r})=>({start:e,end:t,from:n,width:r})),folds:c.filter(e=>e.fold).map(({start:e,end:t,from:n,width:r})=>({start:e,end:t,from:n,width:r}))}}var Y8=[1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,10800,21600,43200,86400].map(e=>e*1e3),X8=.12;function Z8(e,t=6,n={from:0,span:1}){let r=(e.total_ms??e.busy_ms)*n.span;if(!r)return[];let i=Y8.find(e=>r/e<=t)??Y8.at(-1),a=X8*n.span,o=[];for(let t of e.spans)if(!(t.from+t.width<n.from||t.from>n.from+n.span))for(let r=Math.ceil(t.start/i)*i;r<=t.end;r+=i){let t=e.x(r);t<n.from||t>n.from+n.span||(!o.length||t-o.at(-1).x>=a)&&o.push({at:r,x:t})}return o.map(e=>({...e,seconds:i<6e4}))}var Q8=.01,$8=2e3;function e5(e,t){let n=e=>(e-t.from)/t.span;return{...e,x:t=>n(e.x(t)),spans:e.spans.map(e=>({...e,from:n(e.from),width:e.width/t.span})),folds:e.folds.map(e=>({...e,from:n(e.from),width:e.width/t.span}))}}function t5(e,t,n,r=0){let i=Math.max(Q8,r?$8/r:0),a=Math.min(1,Math.max(i,e.span*n)),o=e.from+t*e.span;return{from:Math.min(1-a,Math.max(0,o-t*a)),span:a}}function n5(e,t){return{from:Math.min(1-e.span,Math.max(0,e.from+t*e.span)),span:e.span}}function r5(e,t=Date.now()){let n=null;for(let t of e)for(let e of t.segments)(!n||e.seen-e.start>n.end-n.start)&&(n={...e,end:e.seen,row:t.key,member:t.item.member});return{executions:e.length,running:e.filter(e=>e.item.state===`running`).length,failed:e.filter(e=>e.item.state===`failed`).length,stalled:e.filter(e=>e.item.state===`running`&&R8(e,t).tone===`warn`).length,tool_segments:e.reduce((e,t)=>e+t.segments.filter(e=>[`command`,`tool`,`editing`].includes(e.phase)).length,0),slowest:n}}var i5={pending:`待投递`,delivering:`投递中`,completed:`已完成`,cancelled:`已取消`,failed:`失败`},a5={dispatched:`已派出`,started:`已开始`,completed:`已完成`,cancelled:`已作废`,failed:`失败`},o5={route:`接收`,ask:`派活`,handoff:`交还主持人`,notice:`程序通知主持人`},s5={user:`用户`,host:`主持人`,system:`程序`},c5={user_stop:`用户停止`,member_away:`成员暂离`,member_removed:`成员移除`,rerouted:`改派`,no_reply:`未回复`,archived:`房间归档`},l5={active:`在场`,away:`暂离`,removed:`移除`},u5={host:`主持人`,member:`成员`},d5={api:`输入`,message:`消息`,request:`请求`,execution:`执行`,batch:`流转`,queue:`流转`,chain:`流转`,scheduler:`调度`,member:`房间`,discussion:`房间`,room:`房间`},f5=new Set([`dispatched`,`started`]),p5=new Set([`pending`,`delivering`]),m5=[[`Mozilla`,`网页`],[`node`,`本机服务`],[`AI-CoDiscuss-CLI`,`CLI`],[`Python`,`脚本`]],h5={executions:`execution`,requests:`request`,messages:`message`};function g5(e){try{return JSON.parse(e.payload||`{}`)}catch{return{}}}function _5(e){let t=e.kind.startsWith(`api.`)?{...g5(e.data),...e.data}:e.data,n=[];t.request_id&&n.push(`request:${t.request_id}`),t.execution_id&&n.push(`execution:${t.execution_id}`);for(let e of[`message_id`,`answer_id`,`batch_id`,`reply_to`,`after_message_id`])t[e]&&n.push(`message:${t[e]}`);for(let[,e,r]of String(t.path||``).matchAll(/\/(executions|requests|messages)\/(\d+)/g))n.push(`${h5[e]}:${r}`);return[...new Set(n)]}function v5(e){let t=e.data,n=g5(t),r=t.actor===`owner`?`房主`:t.actor?.startsWith(`member:`)?t.actor.slice(7):t.actor===`none`?`无凭据`:`未知凭据`,i=m5.find(([e])=>(t.client||``).startsWith(e))?.[1]||t.client||`未知客户端`,a=n.action?` ${n.action}`:``,o=typeof n.text==`string`?`:${n.text}`:``,s=e.kind===`api.rejected`?` → 被拒 ${t.status}:${t.error}`:``;return`${r}(${i}${t.bridged?`·中转`:``})POST ${t.path}${a}${s}${o}`}function y5(e,t){let n=e.data,r=t(n.member_id),i=(e,t)=>e[t]||t;switch(e.kind){case`api.write`:case`api.rejected`:return v5(e);case`message.posted`:return`${n.author} 发言 #${n.message_id}${n.reply_to?`(回复 #${n.reply_to})`:``}:${n.text}`;case`message.withdrawn`:return`#${n.message_id} ${n.kind===`rewound`?`被回退`:`被撤回`}`;case`room.rewound`:return`回退到 #${n.message_id}`;case`member.joined`:return`${r} 加入(${i(u5,n.role)} · ${n.adapter||`未知软件`})`;case`member.changed`:return`${r}:${n.from_role===n.role?`${i(l5,n.from_status)} → ${i(l5,n.status)}`:`${i(u5,n.from_role)} → ${i(u5,n.role)}`}`;case`request.created`:return`请求 R${n.request_id} → ${r} · ${i(o5,n.purpose)} · 挂在 #${n.message_id} · 由${i(s5,n.created_by)}创建${n.batch_id?` · 批次 #${n.batch_id}`:``}`;case`request.changed`:return`请求 R${n.request_id}(${r})${n.from_status===n.status?`更新`:`${i(i5,n.from_status)} → ${i(i5,n.status)}`}${n.execution_id?` · 执行 E${n.execution_id}`:``}${n.answer_id?` · 回答 #${n.answer_id}`:``}`;case`request.cancel_reason`:return`请求 R${n.request_id}(${r})取消原因:${i(c5,n.reason)}`;case`execution.created`:return`执行 E${n.execution_id}(${r})${i(a5,n.status)}`;case`execution.changed`:return`执行 E${n.execution_id}(${r})${i(a5,n.from_status)} → ${i(a5,n.status)}${n.result?`:${n.result}`:``}`;case`execution.retry`:return n.stopped?`执行 E${n.execution_id} 停止自动重试`:`执行 E${n.execution_id} 第 ${n.attempt} 次重试${n.reason?`:${n.reason}`:``}`;case`execution.late_answer`:return`执行 E${n.execution_id} 作废后迟到的回答:${n.text}`;case`batch.opened`:return`批次 #${n.batch_id} 开启(${t(n.host_id)} 派出,链 #${n.chain_id})`;case`batch.settled`:return`批次 #${n.batch_id} 已收齐`;case`batch.handoff`:return`批次 #${n.batch_id} 交还主持人`;case`queue.added`:return`${r} 排队等候 #${n.message_id}`;case`queue.removed`:return`${r} 出队 #${n.message_id}`;case`chain.held`:return`任务链 #${n.chain_id} 到限暂停,等用户决定`;case`chain.released`:return`任务链 #${n.chain_id} 解除暂停`;case`scheduler.decided`:return`智能调度(${n.kind===`round`?`轮次`:`插话`})在 #${n.after_message_id} 后选择「${n.label}」${n.confidence==null?``:` · 置信 ${Number(n.confidence).toFixed(2)}`}${n.applied?` · 已采用`:``}`;case`scheduler.applied`:return`智能调度选择「${n.label}」${n.applied?`已采用`:`撤销采用`}`;case`discussion.created`:return`讨论 #${n.session_id} 创建:${n.goal}`;case`discussion.changed`:return`讨论 #${n.session_id}:${n.from_status} → ${n.status}`;default:return JSON.stringify(n)}}function b5(e,t){let n=new Map,r=new Map,i=new Map,a=new Map;for(let o of e.slice(0,t+1)){let e=o.data;o.kind===`request.created`?n.set(e.request_id,{...e,at:o.at}):o.kind===`request.changed`&&n.has(e.request_id)?p5.has(e.status)?n.set(e.request_id,{...n.get(e.request_id),...e}):n.delete(e.request_id):o.kind===`execution.created`?r.set(e.execution_id,{...e,at:o.at}):o.kind===`execution.changed`&&r.has(e.execution_id)?f5.has(e.status)?r.set(e.execution_id,{...r.get(e.execution_id),...e}):r.delete(e.execution_id):o.kind===`queue.added`?i.set(e.queue_id,e):o.kind===`queue.removed`?i.delete(e.queue_id):o.kind===`chain.held`?a.set(e.chain_id,e):o.kind===`chain.released`&&a.delete(e.chain_id)}return{requests:[...n.values()],executions:[...r.values()],queue:[...i.values()],chains:[...a.values()]}}var x5={class:`merged-section execution-timeline`,"aria-label":`执行时间线`},S5={key:0,role:`alert`,class:`fine-print wf-error`},C5={key:1,class:`fine-print`},w5={class:`wf-head`},T5={key:0,class:`wf-state is-replay`},E5={key:2,class:`wf-headline`},D5={class:`wf-summary`},O5=[`title`],k5=[`title`],A5={title:`连续调用同一工具合并为一段`},j5={class:`wf-legend`,"aria-label":`图例`},M5={key:0,class:`wf-legend-note`},N5={key:1,class:`wf-legend-note`},P5={class:`wf-axis-label`},F5={key:0,class:`wf-zoom`},I5={key:1,class:`wf-zoom-hint`,title:`Ctrl + 滚轮缩放;放大后按住中键或拖动时间轴平移,双击时间线还原`},L5={key:2,class:`wf-branch`},R5=[`title`],z5={key:0,class:`wf-guides`,"aria-hidden":`true`},B5=[`aria-expanded`,`aria-label`,`onClick`],V5={key:2,class:`wf-toggle-space`},H5=[`aria-expanded`,`onClick`,`onMouseenter`,`onMouseleave`],U5={class:`wf-name-line`},W5={key:0,class:`wf-spinner`,"aria-hidden":`true`},G5={key:1,class:`wf-pill is-slowest`},K5={key:0,class:`wf-live-dot`,"aria-hidden":`true`},q5=[`aria-label`,`onMouseleave`],J5={class:`wf-track`},Y5=[`data-tone`],X5=[`onMouseenter`,`onClick`],Z5=[`onMouseenter`,`onClick`],Q5=[`data-tone`,`onMouseenter`,`onClick`],$5=[`data-tone`,`onMouseenter`,`onClick`],e7=[`data-tone`,`onMouseenter`,`onClick`],t7=[`aria-label`,`onMouseenter`,`onClick`,`onFocus`,`onBlur`],n7={class:`wf-end`},r7={key:1},i7=[`aria-label`],a7={class:`wf-detail-head`},o7={key:0},s7={key:1},c7={class:`is-failed`},l7={key:2},u7={key:3},d7={key:0,class:`wf-log`,"aria-label":`过程`},f7=[`data-tone`],p7={key:1,class:`wf-log-note`},m7={key:1,class:`fine-print`},h7={key:1,class:`wf-player`},g7={key:2,class:`wf-player`},_7=[`aria-label`],v7=[`disabled`],y7=[`max`,`value`],b7={class:`wf-player-time`},x7={key:3,class:`wf-foot`},S7={key:0},C7={key:1},w7=[`role`],T7={key:1,class:`wf-card-text`},E7={key:2,class:`wf-card-reason`},D7={class:`wf-card-label`},O7=2e3,k7=6e4,A7=100,j7=60,M7=2e4,N7=600,P7=5,F7=16,I7=90,L7=2,R7=8,z7=560,B7=.0015,V7=`latest`,H7=`all`,U7=22,W7=5,G7=52,K7=EH({__name:`ExecutionTimeline`,emits:[`detail`],setup(e,{emit:t}){let n=t,{view:r,bridge:i}=Or(`discussion`),a=I8/6e4,o=L8/6e4,s=[1,2,4,8,16,32],c=typeof window<`u`&&window.matchMedia?.(`(hover: hover)`).matches!==!1,l=I(null),u=I(0),d=null,f=Q(()=>r.value.room?.id),p=I(new Map),m=I(null),h=I(``),g=I(Date.now()),_=I(Date.now()),v=I(new Set),y=I(new Map),b=I(null),x=I(``),S=I(null),C=I(null),w=0,T=0,E=!1,D=``,O=0,k=0,A=0,ee=0,j=nn({position:null,playing:!1,speed:0}),te=0;async function ne(e=!1){let t=f.value;if(!t)return;if(E){D=D===`full`||e?`full`:`next`;return}E=!0;let n=e||!w||Date.now()-T>=k7?0:w-P7;try{let e=await i.request(`/api/rooms/${t}/timeline${n?`?after=${n}`:``}`);if(t!==f.value)return;let r=n?new Map(p.value):new Map;for(let t of e.executions)r.set(`${t.source}:${t.id}`,t);p.value=r,m.value={execution_limit:e.execution_limit,segment_limit:e.segment_limit},w=e.now,_.value=Date.now(),n||(T=Date.now()),h.value=``}catch(e){h.value=`读取执行记录失败:${e.message}`}finally{E=!1;let e=D;D=``,e&&ne(e===`full`)}}let M=Q(()=>m.value&&{...m.value,executions:[...p.value.values()]});z(Q(()=>M.value?.executions.some(e=>e.state===`running`)),e=>{clearInterval(O),e&&(O=setInterval(()=>{document.hidden||ne()},O7))},{immediate:!0}),z(f,()=>{p.value=new Map,m.value=null,v.value=new Set,y.value=new Map,b.value=null,x.value=``,w=0,ne(!0)},{immediate:!0}),z(()=>r.value.room,(e,t)=>{e?.id&&e.id===t?.id&&ne()});let re=null;function ie(e){let t=l.value.getBoundingClientRect();return{share:Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),width:t.width}}function ae(e){l.value&&e.target.closest?.(`.wf-track, .wf-axis`)&&(e.ctrlKey||e.metaKey?(e.preventDefault(),je.value=t5(je.value,ie(e).share,Math.exp(e.deltaY*B7),ke.value.total_ms)):Me.value&&(e.shiftKey||Math.abs(e.deltaX)>Math.abs(e.deltaY))&&(e.preventDefault(),je.value=n5(je.value,(e.shiftKey?e.deltaY:e.deltaX)/ie(e).width)))}function oe(e){let t=e.target.closest?.(`.wf-axis`);Me.value&&(e.button===1||e.button===0&&t)&&e.target.closest?.(`.wf-track, .wf-axis`)&&(e.preventDefault(),re={x:e.clientX,from:je.value.from,width:ie(e).width},e.currentTarget.setPointerCapture(e.pointerId))}function se(e){re&&(je.value=n5({from:re.from,span:je.value.span},-(e.clientX-re.x)/re.width))}function ce(){re=null}function le(e){e.target.closest?.(`.wf-track, .wf-axis`)&&(je.value=Ae)}function ue(e){e.button===1&&e.target.closest?.(`.wf-track, .wf-axis`)&&e.preventDefault()}function de(e){b.value&&!e.target.closest?.(`.wf-card, .wf-bar, .wf-note`)&&(b.value=null),x.value&&!e.target.closest?.(`.wf-detail, .wf-names`)&&(x.value=``)}function fe(e){e.key===`Escape`&&(x.value=``,b.value=null)}aa(()=>{document.addEventListener(`pointerdown`,de),document.addEventListener(`keydown`,fe),d=new ResizeObserver(([e])=>{u.value=e.contentRect.width})}),z(l,(e,t)=>{t&&d?.unobserve(t),e&&d?.observe(e)}),ca(()=>{clearInterval(O),cancelAnimationFrame(k),document.removeEventListener(`pointerdown`,de),document.removeEventListener(`keydown`,fe),d?.disconnect()});let pe=I(V7),me=Q(()=>M.value?W8(M.value,g.value):{list:[],of:new Map}),he=Q(()=>pe.value===V7?me.value.list[0]?.key:pe.value===H7||me.value.list.some(e=>e.key===pe.value)?pe.value:me.value.list[0]?.key),ge=Q(()=>!M.value||he.value===H7?M.value:{...M.value,executions:M.value.executions.filter(e=>me.value.of.get(`${e.source}:${e.id}`)===he.value)});z(f,()=>{pe.value=V7});let _e=e=>new Date(e).toLocaleString(`zh-CN`,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1});function ve(e){let t=e.task?`${e.task.replace(/\s+/g,` `).slice(0,U7)}${e.task.length>U7?`…`:``}`:`执行`;return`${_e(e.start)} · ${t} · ${e.count} 次${e.running?` · 进行中`:e.failed?` · 有失败`:``}`}let be=Q(()=>JSON.stringify(me.value.list.map(e=>[e.key,ve(e)]))),xe=Q(()=>[{label:`最近一轮(自动跟随)`,value:V7},...JSON.parse(be.value).map(([e,t])=>({label:t,value:e})),{label:`全部执行`,value:H7}]),Se=Q(()=>ge.value?H8(ge.value,g.value):[]),Ce=Q(()=>Se.value.some(e=>e.item.state===`running`)),P=Q(()=>{let e=Math.min(...Se.value.map(e=>e.start)),t=Math.max(...Se.value.map(e=>e.end));return Number.isFinite(e)?{start:e,end:t,duration:Math.max(0,t-e)}:{start:0,end:0,duration:0}}),we=Q(()=>j.position!==null&&!Ce.value),Te=Q(()=>we.value?P.value.start+j.position:g.value),Ee=Q(()=>we.value?H8(B8(ge.value,Te.value,y.value),Te.value):Se.value),De=Q(()=>Ee.value.filter(e=>!e.ancestors.some(e=>v.value.has(e)))),Oe=Q(()=>Ee.value.some(e=>e.item.state===`running`)),ke=Q(()=>J8(Ee.value,Oe.value)),Ae={from:0,span:1},je=I(Ae),Me=Q(()=>je.value.span<1);z([he,f],()=>{je.value=Ae});let Ne=Q(()=>e5(ke.value,je.value)),Pe=Q(()=>{let e=Oe.value?Ne.value.x(Te.value):null;return e===null||e<0||e>1?null:e}),Fe=Q(()=>Math.max(1,P.value.duration/M7)),Ie=Q(()=>[{label:`自动 · ${Math.round(Fe.value)}×`,value:0},...s.map(e=>({label:`${e}×`,value:e}))]),Le=Q(()=>j.speed||Fe.value);function Re(e){let t=A?Math.min(e-A,250):0;A=e;let n=Ee.value.length<=j7||e-ee>=A7;j.playing&&(te+=t*Le.value,te>=P.value.duration?Object.assign(j,{position:null,playing:!1}):n&&(j.position=te)),Ce.value&&n&&(g.value=Date.now()),n&&(ee=e),k=Ce.value||j.playing?requestAnimationFrame(Re):0,k||(A=0)}z([Ce,()=>j.playing],()=>{!k&&(Ce.value||j.playing)&&(k=requestAnimationFrame(Re))},{immediate:!0});async function ze(){j.position===null?(te=0,Ke()):te=j.position,Object.assign(j,{position:te,playing:!0}),Be()}function Be(){for(let e of ge.value?.executions||[])ft({item:e,notes:e.notes||[]})}function Ve(){j.playing=!1}function He(){te=0,Ke(),Object.assign(j,{position:0,playing:!0})}function Ue(e){te=Number(e.target.value),Object.assign(j,{position:te,playing:!1}),Be()}z([he,f],()=>Object.assign(j,{position:null,playing:!1}));let We=I(new Set),Ge=null;function Ke(){Ge=new Set,We.value=new Set}z(()=>De.value.map(e=>e.key).join(),()=>{let e=De.value.map(e=>e.key);if(!Ge){Ge=new Set(e);return}let t=e.filter(e=>!Ge.has(e));t.forEach(e=>Ge.add(e)),t.length&&(We.value=new Set([...We.value,...t]),setTimeout(()=>{We.value=new Set([...We.value].filter(e=>!t.includes(e)))},N7))}),z([he,f],()=>{Ge=null});let qe=Q(()=>G8(De.value,Ne.value)),Je=Q(()=>Z8(ke.value,Math.min(R7,Math.max(L7,Math.round((u.value||540)/I7))),je.value).map(e=>({...e,x:(e.x-je.value.from)/je.value.span}))),Ye=Q(()=>we.value?Te.value:Math.min(Te.value,_.value)),Xe=Q(()=>r5(Ee.value,Ye.value)),Ze=Q(()=>Ee.value.filter(e=>e.has_children).map(e=>e.key)),Qe=Q(()=>Ee.value.find(e=>e.key===x.value)),$e=Q(()=>Qe.value?z8(Qe.value,y.value.get(Qe.value.item.id)):[]),et=Q(()=>{let e=Ee.value,t=new Set(e.flatMap(e=>e.segments.map(e=>A8[e.phase])));return[...e.some(e=>e.queue[1]>e.queue[0])?[[`queue`,`排队`]]:[],...e.some(e=>e.wake)?[[`wake`,`唤醒`]]:[],...t.has(`model`)?[[`model`,`模型(思考、撰写)`]]:[],...t.has(`tool`)?[[`tool`,`工具(命令、工具、编辑)`]]:[],...e.some(e=>e.work&&!e.segments.length)?[[`work`,`执行(无阶段明细)`]]:[],...e.some(e=>e.placed_parent)?[[`handoff`,`派活`]]:[],...e.some(e=>e.notes.length)?[[`note-mark`,`过程说明`]]:[],...e.some(e=>e.item.state===`failed`)?[[`failed-mark`,`失败`]]:[]]}),tt=Q(()=>Ee.value.length>0&&Ee.value.every(e=>!e.segments.length)),nt=Q(()=>{let e=new Map;for(let t of[...Ee.value].sort((e,t)=>e.start-t.start))e.has(t.item.member)||e.set(t.item.member,e.size%W7+1);return e}),rt=Q(()=>{let e=G7/(u.value||800),t=[];for(let n of Ne.value.folds){let r=n.from+n.width/2;r<0||r>1||(!t.length||r-t.at(-1).middle>=e)&&t.push({...n,middle:r})}return t}),it=Q(()=>{let e=G7/(u.value||800);return Je.value.filter(t=>!rt.value.some(n=>Math.abs(t.x-n.middle)<e))});function at(e,t){if(x.value=x.value===e.key?``:e.key,!x.value)return;let n=t.currentTarget.getBoundingClientRect(),r=C.value.getBoundingClientRect(),i=Math.min(z7,r.width-16);S.value={top:n.bottom-r.top+4,left:Math.max(8,Math.min(n.left-r.left,r.width-i-8))},b.value=null,ft(e)}z(()=>Qe.value?.notes.length,()=>{Qe.value&&ft(Qe.value)});function ot(e){let t=new Set(v.value);t.has(e)?t.delete(e):t.add(e),v.value=t}function st(e,t,n=!1){let r=Ne.value.x(e),i=Math.max(0,Ne.value.x(t)-r)*100;return{left:`${r*100}%`,width:n?`max(2px, calc(${i}% - 1px))`:`${i}%`}}function ct(e){return e.item.role===`host`?`协作 · 主持`:`协作`}function lt(e){return e.item.role===`host`?[`主持`]:[]}let ut=e=>R8(e,Ye.value);function dt(e){let t=[i.display_name(e.item.member),ct(e),j8[e.item.state],`用时 ${P8(e.end-e.start)}`];return e.wake&&t.push(`唤醒 ${P8(e.wake[1]-e.wake[0])}${e.wake_approx?`(约)`:``}`),!e.segments.length&&e.work&&t.push(`无阶段明细`),e.notes.length&&t.push(`${e.notes.length} 段过程说明`),t.join(`,`)}async function ft(e){let t=e.item.id;if(!(e.item.source!==`free`||!e.notes.length||(y.value.get(t)?.length||0)>=e.notes.length))try{let{notes:e}=await i.request(`/api/rooms/${f.value}/executions/${t}/notes`);y.value=new Map(y.value).set(t,e.map(e=>e.text))}catch{}}let pt=e=>new Date(e).toLocaleTimeString(`zh-CN`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1}),mt=e=>new Date(e.at).toLocaleTimeString(`zh-CN`,{hour:`2-digit`,minute:`2-digit`,...e.seconds?{second:`2-digit`}:{},hour12:!1});function ht(e,t,n,r=!1){let i=e.currentTarget.getBoundingClientRect(),a=n.note?{notes:[n.note],earlier:!1}:V8(t.notes,n.start,n.end),o=Math.min(360,window.innerWidth-16),s=i.bottom+6,c=s+160>window.innerHeight&&i.top>200?Math.max(8,i.top-6-200):s;b.value={key:t.key,id:gt(t,n),row:t,piece:n,related:a,pinned:r,left:Math.max(8,Math.min(i.left,window.innerWidth-o-8)),top:c},ft(t)}let gt=(e,t)=>`${e.key}:${t.kind||t.label||`note`}:${t.start}`;function _t(e,t,n){c&&ht(e,t,n)}function vt(e,t,n){c||(b.value?.id===gt(t,n)?b.value=null:ht(e,t,n,!0))}function yt(e){b.value?.key===e.key&&!b.value.pinned&&(b.value=null)}let bt=Q(()=>{let e=b.value?.piece;return e?e.note?`过程说明 · ${pt(e.note.at)}`:`${e.kind===`segment`?`${k8[e.phase]}${e.tool?` · ${e.tool}`:``}`:e.label} · ${P8(e.end-e.start)}${e.live?` · 进行中`:``}`:``}),xt=Q(()=>{if(!b.value)return[];let e=y.value.get(b.value.row.item.id);return b.value.related.notes.map(t=>({at:t.at,text:e?.[t.index]??(e?`(未能读取)`:`读取中…`)}))});return(e,t)=>{let r=WV,s=Yk,c=tA;return W(),G(`section`,x5,[t[29]||=q(`div`,{class:`page-heading`},[q(`div`,null,[q(`h2`,null,`执行时间线`),q(`p`,null,`本机接入程序唤醒的每次执行;点名字看详情,悬停条形看当时的过程说明。`)])],-1),h.value?(W(),G(`p`,S5,F(h.value),1)):X(``,!0),M.value&&!Ee.value.length?(W(),G(`p`,C5,`还没有执行记录。`)):X(``,!0),Ee.value.length?(W(),G(`div`,{key:2,ref_key:`wf_element`,ref:C,class:`wf`},[q(`header`,w5,[t[11]||=q(`span`,{class:`wf-title`},`执行瀑布`,-1),J(r,{modelValue:pe.value,"onUpdate:modelValue":t[0]||=e=>pe.value=e,items:xe.value,"trailing-icon":`i-lucide-chevrons-up-down`,variant:`none`,"aria-label":`查看哪一轮`,class:`wf-run-select`,content:{align:`start`,sideOffset:4},ui:{content:`channel-select-menu wf-run-menu`,trailing:`static shrink-0 p-0 ms-1.5`,trailingIcon:`wf-select-icon`}},null,8,[`modelValue`,`items`]),we.value?(W(),G(`span`,T5,`回放中 · `+F(pt(Te.value)),1)):(W(),G(`span`,{key:1,class:N([`wf-state`,{"is-live":Xe.value.running}])},F(Xe.value.running?`${Xe.value.running} 个进行中`:`均已结束`),3)),Xe.value.slowest?(W(),G(`span`,E5,[t[10]||=Y(`最慢一步 `,-1),q(`b`,null,[Y(F(L(i).display_name(Xe.value.slowest.member))+` · `+F(L(k8)[Xe.value.slowest.phase]),1),Xe.value.slowest.tool?(W(),G(U,{key:0},[Y(F(Xe.value.slowest.tool),1)],64)):X(``,!0)]),Y(` · `+F(L(P8)(Xe.value.slowest.end-Xe.value.slowest.start)),1)])):X(``,!0)]),q(`dl`,D5,[q(`div`,null,[t[12]||=q(`dt`,null,`执行`,-1),q(`dd`,null,[(W(),G(`span`,{key:Xe.value.executions,class:`wf-roll`},F(Xe.value.executions),1))])]),q(`div`,null,[t[13]||=q(`dt`,null,`进行中`,-1),q(`dd`,{class:N(Xe.value.running?`is-live`:`is-zero`)},[(W(),G(`span`,{key:Xe.value.running,class:`wf-roll`},F(Xe.value.running),1))],2)]),q(`div`,null,[t[14]||=q(`dt`,null,`失败`,-1),q(`dd`,{class:N(Xe.value.failed?`is-failed`:`is-zero`)},[(W(),G(`span`,{key:Xe.value.failed,class:`wf-roll`},F(Xe.value.failed),1))],2)]),q(`div`,{title:`超过 ${a} 分钟没有输出(思考中超过 ${o} 分钟)`},[t[15]||=q(`dt`,null,`可能卡住`,-1),q(`dd`,{class:N(Xe.value.stalled?`is-warn`:`is-zero`)},[(W(),G(`span`,{key:Xe.value.stalled,class:`wf-roll`},F(Xe.value.stalled),1))],2)],8,O5),q(`div`,{title:ke.value.folds.length?`已折叠 ${ke.value.folds.length} 段超过 ${L(M8)/6e4} 分钟的空闲`:void 0},[t[16]||=q(`dt`,null,`有效时长`,-1),q(`dd`,null,F(L(P8)(ke.value.busy_ms)),1)],8,k5),q(`div`,A5,[t[18]||=q(`dt`,null,`工具与命令`,-1),q(`dd`,{class:N({"is-zero":!Xe.value.tool_segments})},[(W(),G(`span`,{key:Xe.value.tool_segments,class:`wf-roll`},F(Xe.value.tool_segments),1)),t[17]||=Y(` 段`,-1)],2)])]),q(`ul`,j5,[(W(!0),G(U,null,V(et.value,([e,t])=>(W(),G(`li`,{key:e},[q(`i`,{class:N([`wf-swatch`,`is-${e}`])},null,2),Y(F(t),1)]))),128)),nt.value.size>1?(W(),G(`li`,M5,`颜色区分成员,深浅区分模型与工具`)):X(``,!0),tt.value?(W(),G(`li`,N5,`这些执行都没有阶段明细:发生在接入程序上报阶段之前,或来自手动接入、Codex App`)):X(``,!0)]),q(`div`,{class:N([`wf-grid`,{"is-zoomed":Me.value,"is-panning":L(re)}]),role:`list`,style:ye({"--wf-depth-px":`${F7}px`}),onWheel:ae,onMousedown:ue,onPointerdown:oe,onPointermove:se,onPointerup:ce,onPointercancel:ce,onDblclick:le},[q(`div`,P5,[q(`span`,null,`执行 · `+F(De.value.length)+`/`+F(Ee.value.length),1),Me.value?(W(),G(`span`,F5,[Y(`放大 `+F((1/je.value.span).toFixed(1))+`×`,1),q(`button`,{type:`button`,class:`wf-zoom-reset`,title:`双击时间线也可还原`,onClick:t[1]||=e=>je.value=Ae},[J(s,{name:`i-lucide-locate-fixed`}),Y(F(Ce.value?`重置跟随`:`重置`),1)])])):(W(),G(`span`,I5,`Ctrl + 滚轮缩放`)),Ze.value.length?(W(),G(`span`,L5,[q(`button`,{type:`button`,class:`wf-text-button`,onClick:t[2]||=e=>v.value=new Set},`展开全部`),q(`button`,{type:`button`,class:`wf-text-button`,onClick:t[3]||=e=>v.value=new Set(Ze.value)},`收起全部`)])):X(``,!0)]),q(`div`,{ref_key:`axis_element`,ref:l,class:`wf-axis`,"aria-hidden":`true`},[(W(!0),G(U,null,V(it.value,e=>(W(),G(`span`,{key:e.at,class:`wf-tick`,style:ye({left:`${e.x*100}%`})},F(mt(e)),5))),128)),(W(!0),G(U,null,V(rt.value,e=>(W(),G(`span`,{key:`fold-${e.start}`,class:`wf-fold-label`,style:ye({left:`${e.middle*100}%`}),title:`${pt(e.start)} – ${pt(e.end)} 没有执行,已折叠`},`⋯ `+F(L(P8)(e.end-e.start)),13,R5))),128)),Pe.value===null?X(``,!0):(W(),G(`span`,{key:0,class:`wf-cursor-head`,style:ye({left:`${Pe.value*100}%`})},null,4))],512),t[20]||=q(`span`,{class:`wf-axis-end`},`用时`,-1),(W(!0),G(U,null,V(De.value,e=>(W(),G(`div`,{key:e.key,role:`listitem`,class:N([`wf-row`,[`is-${e.item.state}`,{"is-open":x.value===e.key,"is-entering":We.value.has(e.key)}]])},[q(`div`,{class:`wf-label`,style:ye({"--depth":e.depth})},[e.depth?(W(),G(`span`,z5)):X(``,!0),e.has_children?(W(),G(`button`,{key:1,type:`button`,class:N([`wf-toggle`,{"is-open":!v.value.has(e.key)}]),"aria-expanded":!v.value.has(e.key),"aria-label":`${v.value.has(e.key)?`展开`:`收起`} ${L(i).display_name(e.item.member)} 派出的执行`,onClick:t=>ot(e.key)},[J(s,{name:`i-lucide-chevron-right`})],10,B5)):(W(),G(`span`,V5)),J(c,{src:L(i).identities[e.item.member]?.icon,text:L(i).identities[e.item.member]?.initials,alt:e.item.member,size:`2xs`,class:N([`channel-avatar wf-avatar`,L(i).identities[e.item.member]?.style])},null,8,[`src`,`text`,`alt`,`class`]),q(`button`,{type:`button`,class:`wf-names`,"aria-expanded":x.value===e.key,onClick:t=>at(e,t),onMouseenter:t=>_t(t,e,{label:L(j8)[e.item.state],start:e.start,end:e.end,text:ut(e).text,live:e.item.state===`running`}),onMouseleave:t=>yt(e)},[q(`span`,U5,[e.item.state===`running`?(W(),G(`i`,W5)):X(``,!0),q(`strong`,null,F(L(i).display_name(e.item.member)),1),(W(!0),G(U,null,V(lt(e),e=>(W(),G(`em`,{key:e,class:`wf-pill is-role`},F(e),1))),128)),Xe.value.slowest?.row===e.key?(W(),G(`em`,G5,`最慢`)):X(``,!0)]),q(`span`,{class:N([`wf-status`,`is-${ut(e).tone}`])},[ut(e).tone===`live`?(W(),G(`i`,K5)):X(``,!0),Y(F(ut(e).text),1)],2)],40,H5)],4),q(`div`,{class:`wf-lane`,role:`img`,"aria-label":dt(e),onMouseleave:t=>yt(e)},[q(`div`,J5,[(W(!0),G(U,null,V(it.value,e=>(W(),G(`i`,{key:e.at,class:`wf-gridline`,style:ye({left:`${e.x*100}%`})},null,4))),128)),(W(!0),G(U,null,V(Ne.value.folds,e=>(W(),G(`i`,{key:e.start,class:`wf-fold`,style:ye({left:`${e.from*100}%`,width:`${e.width*100}%`})},null,4))),128)),t[19]||=q(`i`,{class:`wf-well`},null,-1),(W(!0),G(U,null,V(qe.value.get(e.key)||[],(e,t)=>(W(),G(`i`,{key:`link-${t}`,class:N([`wf-link`,`is-${e.part}`]),"data-tone":nt.value.get(e.member),style:ye({left:`${e.x*100}%`})},null,14,Y5))),128)),Pe.value===null?X(``,!0):(W(),G(`i`,{key:0,class:`wf-cursor`,style:ye({left:`${Pe.value*100}%`})},null,4)),q(`i`,{class:`wf-bar is-queue`,style:ye(st(...e.queue)),onMouseenter:t=>_t(t,e,{label:`排队`,start:e.queue[0],end:e.queue[1]}),onClick:t=>vt(t,e,{label:`排队`,start:e.queue[0],end:e.queue[1]})},null,44,X5),e.wake?(W(),G(`i`,{key:1,class:`wf-bar is-wake`,style:ye(st(...e.wake)),onMouseenter:t=>_t(t,e,{label:e.wake_approx?`唤醒(约)`:`唤醒`,start:e.wake[0],end:e.wake[1]}),onClick:t=>vt(t,e,{label:e.wake_approx?`唤醒(约)`:`唤醒`,start:e.wake[0],end:e.wake[1]})},null,44,Z5)):X(``,!0),e.work?(W(),G(`i`,{key:2,class:N([`wf-bar is-work`,{"has-detail":e.segments.length}]),"data-tone":e.segments.length?void 0:nt.value.get(e.item.member),style:ye(st(...e.work)),onMouseenter:t=>_t(t,e,{label:e.segments.length?`执行`:`执行 · 无阶段明细`,start:e.work[0],end:e.work[1],live:e.item.state===`running`}),onClick:t=>vt(t,e,{label:e.segments.length?`执行`:`执行 · 无阶段明细`,start:e.work[0],end:e.work[1],live:e.item.state===`running`})},null,46,Q5)):X(``,!0),(W(!0),G(U,null,V(e.segments,t=>(W(),G(U,{key:t.start+t.phase},[q(`i`,{class:N([`wf-bar wf-seg`,[`is-${L(A8)[t.phase]}`,{"is-live":t.live}]]),"data-tone":nt.value.get(e.item.member),style:ye(st(t.start,t.seen,!0)),onMouseenter:n=>_t(n,e,{kind:`segment`,...t}),onClick:n=>vt(n,e,{kind:`segment`,...t})},null,46,$5),t.end>t.seen?(W(),G(`i`,{key:0,class:N([`wf-bar wf-seg is-tail`,`is-${L(A8)[t.phase]}`]),"data-tone":nt.value.get(e.item.member),style:ye(st(t.seen,t.end)),onMouseenter:n=>_t(n,e,{kind:`segment`,...t}),onClick:n=>vt(n,e,{kind:`segment`,...t})},null,46,e7)):X(``,!0)],64))),128)),(W(!0),G(U,null,V(e.notes,t=>(W(),G(`button`,{key:`note-${t.index}`,type:`button`,class:`wf-note`,style:ye({left:`${Ne.value.x(t.at)*100}%`}),"aria-label":`${L(i).display_name(e.item.member)} 的第 ${t.index+1} 段过程说明,${pt(t.at)}`,onMouseenter:n=>_t(n,e,{note:t,start:t.at,end:t.at}),onClick:n=>vt(n,e,{note:t,start:t.at,end:t.at}),onFocus:n=>_t(n,e,{note:t,start:t.at,end:t.at}),onBlur:t=>yt(e)},null,44,t7))),128))])],40,q5),q(`span`,n7,[Y(F(L(P8)(e.end-e.start))+F(e.wake_approx&&e.wake?`~`:``),1),e.item.state===`done`?X(``,!0):(W(),G(`small`,{key:0,class:N(`is-${e.item.state}`)},F(L(j8)[e.item.state]),3)),e.truncated?(W(),G(`small`,r7,`明细已截断`)):X(``,!0)])],2))),128))],38),Qe.value&&S.value?(W(),G(`div`,{key:0,class:`wf-detail`,role:`dialog`,"aria-label":`${L(i).display_name(Qe.value.item.member)} 的这次执行`,style:ye({top:`${S.value.top}px`,left:`${S.value.left}px`})},[q(`header`,a7,[q(`strong`,null,F(L(i).display_name(Qe.value.item.member)),1),q(`small`,null,F(ct(Qe.value))+` · `+F(L(j8)[Qe.value.item.state])+` · `+F(L(P8)(Qe.value.end-Qe.value.start)),1),q(`button`,{type:`button`,class:`wf-card-close`,"aria-label":`关闭`,onClick:t[4]||=e=>x.value=``},[J(s,{name:`i-lucide-x`})])]),q(`dl`,null,[Qe.value.item.task?(W(),G(`div`,o7,[t[21]||=q(`dt`,null,`任务`,-1),q(`dd`,null,[Y(F(Qe.value.item.task),1),Qe.value.item.task_id?(W(),G(`button`,{key:0,type:`button`,class:`subtle-link`,onClick:t[5]||=e=>n(`detail`,Qe.value.item.task_id)},`#`+F(Qe.value.item.task_id),1)):X(``,!0)])])):X(``,!0),Qe.value.item.state===`failed`?(W(),G(`div`,s7,[t[22]||=q(`dt`,null,`失败原因`,-1),q(`dd`,c7,F(Qe.value.item.reason||`执行失败`),1)])):Qe.value.item.result||Qe.value.item.answer_id?(W(),G(`div`,l7,[t[23]||=q(`dt`,null,`结果`,-1),q(`dd`,null,[Y(F(Qe.value.item.result),1),Qe.value.item.answer_id?(W(),G(`button`,{key:0,type:`button`,class:`subtle-link`,onClick:t[6]||=e=>n(`detail`,Qe.value.item.answer_id)},`在消息中查看 #`+F(Qe.value.item.answer_id),1)):X(``,!0)])])):X(``,!0),Qe.value.item.changes?(W(),G(`div`,u7,[t[24]||=q(`dt`,null,`改动`,-1),q(`dd`,null,F(Qe.value.item.changes)+` 个文件`,1)])):X(``,!0)]),$e.value.length?(W(),G(`ol`,d7,[(W(!0),G(U,null,V($e.value,e=>(W(),G(`li`,{key:`${e.kind}-${e.at}-${e.phase||``}`,class:N(`log-${e.kind}`)},[q(`time`,null,F(pt(e.at)),1),e.kind===`phase`?(W(),G(U,{key:0},[q(`i`,{class:N([`wf-swatch`,`is-${L(A8)[e.phase]}`]),"data-tone":nt.value.get(Qe.value.item.member),"aria-hidden":`true`},null,10,f7),q(`span`,null,[Y(F(L(k8)[e.phase]),1),e.tool?(W(),G(U,{key:0},[Y(` · `+F(e.tool),1)],64)):X(``,!0),Y(` · `+F(e.live?`进行中`:L(P8)(e.duration)),1)])],64)):(W(),G(`span`,p7,F(e.text),1))],2))),128))])):(W(),G(`p`,m7,`这次执行没有阶段明细或过程说明。`))],12,i7)):X(``,!0),he.value===H7?(W(),G(`div`,h7,[...t[25]||=[q(`span`,{class:`wf-player-note`},`回放按轮进行:在上方选一轮即可回放`,-1)]])):(W(),G(`div`,g7,[Ce.value?(W(),G(U,{key:0},[t[26]||=q(`span`,{class:`wf-state is-live`},`实时`,-1),t[27]||=q(`span`,{class:`wf-player-note`},`这一轮结束后可以回放`,-1)],64)):(W(),G(U,{key:1},[q(`button`,{type:`button`,class:`wf-player-button`,"aria-label":j.playing?`暂停回放`:`回放这一轮`,onClick:t[7]||=e=>j.playing?Ve():ze()},[J(s,{name:j.playing?`i-lucide-pause`:`i-lucide-play`},null,8,[`name`])],8,_7),q(`button`,{type:`button`,class:`wf-player-button`,"aria-label":`从头回放`,disabled:!we.value,onClick:He},[J(s,{name:`i-lucide-rotate-ccw`})],8,v7),J(r,{modelValue:j.speed,"onUpdate:modelValue":t[8]||=e=>j.speed=e,items:Ie.value,variant:`none`,"aria-label":`回放速度`,class:`wf-speed`,content:{side:`top`,align:`start`,sideOffset:4},ui:{content:`channel-select-menu wf-speed-menu`,trailing:`static shrink-0 p-0`,trailingIcon:`wf-select-icon`}},null,8,[`modelValue`,`items`]),q(`input`,{type:`range`,class:`wf-scrub`,min:`0`,max:P.value.duration,step:`100`,value:we.value?j.position:P.value.duration,"aria-label":`回放位置`,onInput:Ue},null,40,y7),q(`span`,b7,F(L(P8)(we.value?j.position:P.value.duration))+` / `+F(L(P8)(P.value.duration)),1)],64))])),ke.value.folds.length||M.value.executions.length>=M.value.execution_limit?(W(),G(`footer`,x7,[ke.value.folds.length?(W(),G(`span`,S7,[t[28]||=q(`i`,{class:`wf-swatch is-fold`,"aria-hidden":`true`},null,-1),Y(`已折叠 `+F(ke.value.folds.length)+` 段超过 `+F(L(M8)/6e4)+` 分钟的空闲`,1)])):X(``,!0),M.value.executions.length>=M.value.execution_limit?(W(),G(`span`,C7,`只列出最近 `+F(M.value.execution_limit)+` 次讨论执行与 `+F(M.value.execution_limit)+` 次协作执行`,1)):X(``,!0)])):X(``,!0)],512)):X(``,!0),b.value?(W(),G(`div`,{key:3,class:N([`wf-card`,{"is-pinned":b.value.pinned}]),role:b.value.pinned?`dialog`:`tooltip`,style:ye({left:`${b.value.left}px`,top:`${b.value.top}px`})},[q(`strong`,null,F(L(i).display_name(b.value.row.item.member))+` · `+F(bt.value),1),b.value.pinned?(W(),G(`button`,{key:0,type:`button`,class:`wf-card-close`,"aria-label":`关闭`,onClick:t[9]||=e=>b.value=null},[J(s,{name:`i-lucide-x`})])):X(``,!0),q(`small`,null,[Y(F(pt(b.value.piece.start)),1),b.value.piece.end>b.value.piece.start?(W(),G(U,{key:0},[Y(` – `+F(b.value.piece.live?`现在`:pt(b.value.piece.end)),1)],64)):X(``,!0)]),b.value.piece.text?(W(),G(`p`,T7,F(b.value.piece.text),1)):b.value.row.item.reason?(W(),G(`p`,E7,F(b.value.row.item.reason),1)):X(``,!0),xt.value.length?(W(),G(U,{key:3},[q(`small`,D7,F(b.value.related.earlier?`此前的过程说明`:`过程说明`),1),q(`ol`,null,[(W(!0),G(U,null,V(xt.value,e=>(W(),G(`li`,{key:e.at+e.text},[q(`time`,null,F(pt(e.at)),1),Y(F(e.text),1)]))),128))])],64)):X(``,!0)],14,w7)):X(``,!0)])}}},[[`__scopeId`,`data-v-8a146033`]]),q7={key:0,role:`alert`,class:`fine-print ev-error`},J7={key:1,class:`fine-print`},Y7={class:`ev-ledger`},X7={class:`ev-head`},Z7={class:`ev-title`},Q7={class:`ev-rows`,role:`listbox`,"aria-label":`事件`},$7={key:0,class:`ev-turn`,"aria-hidden":`true`},e9=[`aria-selected`,`onClick`,`onKeydown`],t9={class:`ev-time`},n9={class:`ev-tag`},r9={class:`ev-text`},i9={key:0,class:`ev-inspector`,"aria-label":`记录详情`},a9={class:`ev-head`},o9={class:`ev-title`},s9={class:`ev-actions`},c9={class:`ev-body`},l9={class:`ev-line`},u9={class:`ev-chips`},d9=[`onClick`],f9=[`onClick`],p9={class:`ev-state`},m9={key:0,class:`fine-print`},h9={class:`ev-related`},g9=[`onClick`],_9={class:`ev-time`},v9={class:`ev-raw`},y9=EH({__name:`EventLog`,emits:[`detail`],setup(e,{emit:t}){let n=t,{view:r,bridge:i}=Or(`discussion`),a=Q(()=>r.value.room?.id),o=I([]),s=I({}),c=I(!1),l=I(``),u=I(null),d=I(``),f=!1,p={first:0,last:0},m=(e,t)=>e.at-t.at||e.id-t.id;async function h(e=`reset`){let t=a.value;if(!t||f)return;let n=o.value,r=e===`older`&&n.length?`?before=${p.first}`:e===`newer`&&n.length?`?after=${p.last}`:``;f=!0;try{let u=await i.request(`/api/rooms/${t}/events${r}`);if(t!==a.value)return;if(e===`newer`&&!u.events.length){l.value=``;return}s.value=u.members,e===`reset`||!n.length?Object.assign(p,{first:u.first_id,last:u.last_id}):e===`older`?p.first=u.first_id||p.first:p.last=Math.max(p.last,u.last_id),e!==`newer`&&(c.value=u.more),o.value=e===`reset`?u.events:[...n,...u.events].sort(m),l.value=``}catch(e){l.value=`读取事件记录失败:${e.message}`}finally{f=!1}}z(a,()=>{o.value=[],u.value=null,d.value=``,h()},{immediate:!0}),z(()=>r.value.room,(e,t)=>{e?.id&&e.id===t?.id&&o.value.length&&h(`newer`)});let g=e=>e&&s.value[String(e)]?i.display_name(s.value[String(e)]):e?`成员 ${e}`:``,_=e=>new Date(e).toLocaleTimeString(`zh-CN`,{hour12:!1})+`.${String(e%1e3).padStart(3,`0`)}`,v=e=>{let[t,n]=e.split(`:`);return t===`request`?`请求 R${n}`:t===`execution`?`执行 E${n}`:`#${n}`},y=e=>e?.kind===`message.posted`&&e.data.source===`user`,b=e=>e?.kind===`api.write`&&e.data.path===`/messages`,x=Q(()=>{let e=0,t=o.value;return t.flatMap((n,r)=>{let i=b(n)&&y(t[r+1])||y(n)&&!b(t[r-1]);if(i&&(e+=1),d.value&&!_5(n).includes(d.value))return[];let a=n.kind.split(`.`)[0];return[{event:n,index:r,boundary:i&&!d.value,turn:e,group:a,label:d5[a]||a,text:y5(n,g)}]})}),S=Q(()=>o.value.findIndex(e=>e.id===u.value)),C=Q(()=>o.value[S.value]),w=Q(()=>C.value?b5(o.value,S.value):null),T=Q(()=>{if(!C.value)return[];let e=new Set(_5(C.value));return e.size?x.value.filter(t=>t.event.id!==u.value&&_5(t.event).some(t=>e.has(t))):[]});function E(e){u.value=u.value===e.event.id?null:e.event.id}function D(e){let t=x.value.findIndex(e=>e.event.id===u.value)+e;x.value[t]&&(u.value=x.value[t].event.id)}function O(e){u.value&&[`ArrowUp`,`ArrowDown`].includes(e.key)&&(e.preventDefault(),D(e.key===`ArrowUp`?-1:1))}return(e,t)=>{let r=ya(`keep-reading`);return W(),G(`section`,{class:`merged-section event-log`,"aria-label":`事件记录`,onKeydown:O},[t[8]||=q(`div`,{class:`page-heading`},[q(`div`,null,[q(`h2`,null,`事件记录`),q(`p`,null,[Y(`网站如实记下的用户与程序的每次写入(含被拒的)及其引起的状态变化,按发生顺序排列;点一行看原始记录、此刻仍未结束的请求与执行,以及同一对象的其他记录。AI 可用 `),q(`code`,null,`codiscuss room events`),Y(` 读取同一份记录。`)])])],-1),l.value?(W(),G(`p`,q7,F(l.value),1)):o.value.length?X(``,!0):(W(),G(`p`,J7,`还没有事件记录。此功能上线前的历史没有记录。`)),o.value.length?(W(),G(`div`,{key:2,class:N([`ev`,{"has-inspector":C.value}])},[q(`div`,Y7,[q(`header`,X7,[q(`span`,Z7,F(x.value.length)+` 条记录`,1),d.value?(W(),G(`button`,{key:0,type:`button`,class:`ev-chip is-active`,onClick:t[0]||=e=>d.value=``},`只看 `+F(v(d.value))+` ✕`,1)):X(``,!0),c.value&&!d.value?(W(),G(`button`,{key:1,type:`button`,class:`subtle-link`,onClick:t[1]||=e=>h(`older`)},`加载更早`)):X(``,!0)]),q(`ol`,Q7,[(W(!0),G(U,null,V(x.value,e=>(W(),G(U,{key:e.event.id},[e.boundary?(W(),G(`li`,$7,`第 `+F(e.turn)+` 轮`,1)):X(``,!0),q(`li`,{role:`option`,tabindex:`0`,class:N([`ev-row`,[`is-${e.group}`,{"is-rejected":e.event.kind===`api.rejected`,"is-selected":e.event.id===u.value,"is-after":C.value&&e.index>S.value}]]),"aria-selected":e.event.id===u.value,onClick:t=>E(e),onKeydown:yu(t=>E(e),[`enter`])},[q(`time`,t9,F(_(e.event.at)),1),q(`span`,n9,F(e.label),1),q(`span`,r9,F(e.text),1)],42,e9)],64))),128))])]),C.value?(W(),G(`aside`,i9,[q(`header`,a9,[q(`span`,o9,F(_(C.value.at))+` · `+F(C.value.kind),1),q(`span`,s9,[q(`button`,{type:`button`,class:`ev-icon`,"aria-label":`上一条`,onClick:t[2]||=e=>D(-1)},`↑`),q(`button`,{type:`button`,class:`ev-icon`,"aria-label":`下一条`,onClick:t[3]||=e=>D(1)},`↓`),q(`button`,{type:`button`,class:`ev-icon`,"aria-label":`关闭`,onClick:t[4]||=e=>u.value=null},`✕`)])]),Tr((W(),G(`div`,c9,[q(`p`,l9,F(L(y5)(C.value,g)),1),q(`div`,u9,[(W(!0),G(U,null,V(L(_5)(C.value),e=>(W(),G(U,{key:e},[q(`button`,{type:`button`,class:N([`ev-chip`,{"is-active":d.value===e}]),onClick:t=>d.value=d.value===e?``:e},`只看 `+F(v(e)),11,d9),e.startsWith(`message:`)?(W(),G(`button`,{key:0,type:`button`,class:`subtle-link`,onClick:t=>n(`detail`,Number(e.split(`:`)[1]))},`查看 `+F(v(e)),9,f9)):X(``,!0)],64))),128))]),t[6]||=q(`h3`,null,`此刻未结束的`,-1),q(`ul`,p9,[(W(!0),G(U,null,V(w.value.requests,e=>(W(),G(`li`,{key:`r${e.request_id}`},[Y(`请求 R`+F(e.request_id)+` → `+F(g(e.member_id))+` · `+F(L(o5)[e.purpose]||e.purpose)+` · 挂在 #`+F(e.message_id)+` · `+F(L(i5)[e.status]||e.status),1),e.execution_id?(W(),G(U,{key:0},[Y(` · 执行 E`+F(e.execution_id),1)],64)):X(``,!0)]))),128)),(W(!0),G(U,null,V(w.value.executions,e=>(W(),G(`li`,{key:`e${e.execution_id}`},`执行 E`+F(e.execution_id)+` · `+F(g(e.member_id))+` · `+F(L(a5)[e.status]||e.status)+` · 已过 `+F(Math.round((C.value.at-e.at)/1e3))+` 秒`,1))),128)),(W(!0),G(U,null,V(w.value.queue,e=>(W(),G(`li`,{key:`q${e.queue_id}`},F(g(e.member_id))+` 排队等候 #`+F(e.message_id),1))),128)),(W(!0),G(U,null,V(w.value.chains,e=>(W(),G(`li`,{key:`c${e.chain_id}`},`任务链 #`+F(e.chain_id)+` 到限暂停`,1))),128)),!w.value.requests.length&&!w.value.executions.length&&!w.value.queue.length&&!w.value.chains.length?(W(),G(`li`,m9,`无(只计已加载的记录)`)):X(``,!0)]),T.value.length?(W(),G(U,{key:0},[t[5]||=q(`h3`,null,`同一对象的其他记录`,-1),q(`ul`,h9,[(W(!0),G(U,null,V(T.value,e=>(W(),G(`li`,{key:e.event.id},[q(`button`,{type:`button`,class:`ev-link`,onClick:t=>u.value=e.event.id},[q(`time`,_9,F(_(e.event.at)),1),Y(` `+F(e.text),1)],8,g9)]))),128))])],64)):X(``,!0),t[7]||=q(`h3`,null,`原始记录`,-1),q(`pre`,v9,F(JSON.stringify({id:C.value.id,kind:C.value.kind,at:C.value.at,data:C.value.data},null,2)),1)])),[[r]])])):X(``,!0)],2)):X(``,!0)],32)}}},[[`__scopeId`,`data-v-521e21c6`]]),b9={class:`project-files`},x9={class:`project-files-heading`},S9=[`title`],C9={key:0,class:`project-roots`,role:`tablist`,"aria-label":`项目目录`},w9=[`aria-selected`,`title`,`onClick`],T9=[`aria-busy`],E9={class:`project-explorer-path`,"aria-label":`文件路径`},D9=[`disabled`,`aria-current`,`onClick`],O9=[`disabled`,`title`,`onClick`],k9={class:`project-file-name`},A9={class:`project-file-size`},j9=[`datetime`],M9={key:0,class:`project-files-empty`,role:`status`},N9={key:1,class:`project-files-empty`},P9={key:0,class:`project-files-footer`},F9=EH({__name:`ProjectFiles`,props:{directories:{type:Array,required:!0}},setup(e){let t=e,{view:n,bridge:r}=Or(`discussion`),i=n.value.room.id,a=HW.get(i),o=I(Math.max(0,t.directories.indexOf(a?.directory))),s=Q(()=>t.directories[o.value]||t.directories[0]),c=I(a?.directory===s.value?a.path:``),l=I(null),u=I(!1),d=0,f=e=>`${i}
60
60
  ${s.value}
61
- ${e}`;function p(e){return e.kind===`directory`?[`i-lucide-folder`,`is-folder`]:e.kind===`unavailable`?[`i-lucide-file-lock-2`,`is-muted`]:WW(e.name).slice(1)}let m=Q(()=>GW(s.value,c.value)),h=e=>String(e).split(/[\\/]+/).filter(Boolean).at(-1)||e;function g(e){e!==o.value&&(o.value=e,v(``))}function _(){let e=OW.reveal_path;return e!=null&&(OW.reveal_path=null,t.directories[OW.reveal_root]&&(o.value=OW.reveal_root),v(e),!0)}z(()=>OW.reveal_path,_),aa(()=>{_()||v(c.value)}),ca(()=>{d++});async function v(e=``,t=!1){let n=++d;t||(c.value=e,HW.set(i,{directory:s.value,path:e}),l.value=VW.get(f(e))||null),u.value=!0;try{let a=await r.read_room_files(i,e,t?l.value.next_offset:0,``,o.value);if(n!==d)return;l.value={...a,entries:t?[...l.value.entries,...a.entries]:a.entries},VW.set(f(e),l.value)}catch(e){n===d&&r.notify(`error`,`读取目录失败,${e.message}`)}finally{n===d&&(u.value=!1)}}return(t,n)=>{let r=bA,i=Yk;return W(),G(`section`,b9,[q(`header`,x9,[q(`div`,null,[n[3]||=q(`h2`,null,`项目文件`,-1),q(`p`,{title:s.value},F(s.value),9,S9)]),J(r,{icon:`i-lucide-refresh-cw`,color:`neutral`,variant:`ghost`,size:`sm`,"aria-label":`刷新`,title:`刷新`,loading:u.value,onClick:n[0]||=e=>v(c.value)},null,8,[`loading`])]),e.directories.length>1?(W(),G(`div`,C9,[(W(!0),G(U,null,V(e.directories,(e,t)=>(W(),G(`button`,{key:e,type:`button`,role:`tab`,"aria-selected":t===o.value,title:e,onClick:e=>g(t)},[J(i,{name:t?`i-lucide-folder`:`i-lucide-folder-root`},null,8,[`name`]),Y(F(h(e)),1)],8,w9))),128))])):X(``,!0),q(`div`,{class:`project-explorer`,"aria-busy":u.value},[q(`nav`,E9,[(W(!0),G(U,null,V(m.value,(e,t)=>(W(),G(U,{key:e.path},[t?(W(),K(i,{key:0,name:`i-lucide-chevron-right`,class:`project-crumb-separator`})):X(``,!0),q(`button`,{type:`button`,disabled:t===m.value.length-1,"aria-current":t===m.value.length-1?`location`:void 0,onClick:t=>v(e.path)},[t?X(``,!0):(W(),K(i,{key:0,name:`i-lucide-folder-root`})),Y(F(e.name),1)],8,D9)],64))),128))]),n[5]||=q(`div`,{class:`project-files-columns`,"aria-hidden":`true`},[q(`span`,null,`名称`),q(`span`,null,`大小`),q(`span`,null,`修改时间`)],-1),lc([l.value,u.value,s.value,o.value],()=>(W(),G(`div`,{class:`project-files-rows`},[(W(!0),G(U,null,V(l.value?.entries||[],e=>(W(),G(`button`,{key:e.path,type:`button`,class:N([`project-file-row`,{"is-hidden":e.name.startsWith(`.`)}]),disabled:e.kind===`unavailable`,title:e.kind===`unavailable`?`${e.name}(无法读取或指向项目外)`:e.name,onClick:t=>e.kind===`directory`?v(e.path):L(OW).open?.(e.path,s.value,o.value)},[q(`span`,k9,[J(i,{name:p(e)[0],class:N([`project-file-icon`,p(e)[1]])},null,8,[`name`,`class`]),q(`span`,null,F(e.name),1)]),q(`span`,A9,F(L(KW)(e.size)),1),q(`time`,{datetime:e.modified_at},F(L(qW)(e.modified_at)),9,j9)],10,O9))),128)),l.value?l.value.entries.length?X(``,!0):(W(),G(`p`,N9,[J(i,{name:`i-lucide-folder-open`}),n[4]||=Y(`此文件夹为空`,-1)])):(W(),G(`p`,M9,F(u.value?`正在读取项目目录…`:`点击刷新重新读取目录`),1))])),n,1),l.value?(W(),G(`footer`,P9,[q(`span`,null,[Y(F(l.value.total)+` 项`,1),l.value.next_offset===null?X(``,!0):(W(),G(U,{key:0},[Y(`,已显示 `+F(l.value.entries.length)+` 项`,1)],64))]),l.value.next_offset===null?X(``,!0):(W(),K(r,{key:0,label:`加载更多`,color:`neutral`,variant:`ghost`,size:`xs`,loading:u.value,disabled:u.value,onClick:n[2]||=e=>v(l.value.path,!0)},null,8,[`loading`,`disabled`]))])):X(``,!0)],8,T9)])}}},[[`__scopeId`,`data-v-c896fab1`]]),I9={class:`term`,role:`tabpanel`,"aria-label":`私聊`},kee={class:`term-tabs`,"aria-label":`成员`},Aee=[`aria-current`,`onClick`],jee={class:`term-stage`},Mee={key:0,class:`term-welcome`},Nee={key:1,class:`term-dim`},Pee={key:0,class:`term-prompt`},Fee={class:`term-body`},Iee={key:1,class:`term-sub term-warn`},Lee={class:`term-body`},Ree={key:2,class:`term-sub`},zee={key:0,class:`term-line`},Bee={class:`term-body`},L9={key:1,class:`term-prompt`},Vee={class:`term-body`},Hee={key:2,class:`term-line term-thinking`},Uee={class:`term-body`},Wee={key:3,class:`term-block`},Gee={class:`term-sub`},Kee={class:`term-body`},qee={key:4,class:`term-line term-error`},Jee={class:`term-body`},Yee={key:5,class:`term-block`},Xee={class:`term-line`},Zee={key:`step`,class:`term-body`},Qee={class:`term-tool`},$ee={key:0,class:`term-subject`},ete={class:`term-body`},tte=[`onClick`],nte={key:3,class:`term-line`},rte={class:`term-body`},ite={class:`term-body`},ate={key:0,class:`term-spin`},ote={class:`term-input`},ste=[`enterkeyhint`,`disabled`,`placeholder`,`onKeydown`],cte=[`title`,`disabled`],lte={class:`term-hint`},ute={key:0,class:`term-warn`},dte={key:1,class:`term-warn`},fte={key:2},pte=2e3,mte=4,hte=30,gte=30,R9=3,_te=120,vte=40,yte=12,bte=2e3,xte=EH({__name:`PrivateChat`,setup(e){let{view:t,bridge:n,act:r}=Or(`discussion`),i=[`dispatched`,`started`],a={command:`Bash`,search:`Search`,edit:`Update`},o=[`·`,`✢`,`✳`,`✶`,`✻`,`✽`,`✻`,`✶`,`✳`,`✢`],s=new Map,c=Q(()=>t.value.room),l=Q(()=>c.value?.free?.members||[]),u=Q(()=>l.value.find(e=>e.name===IU.member)||l.value[0]||null),d=Q(()=>u.value?.name||``),f=Q(()=>u.value?u.value.access===`runner`?AY(u.value.adapter).chat?``:`这位成员的接入方式看不到它的输出,暂不支持私聊窗`:`这位成员是手动接入的,请在它自己的窗口里对话`:`房间里还没有 AI 成员`),p=I([]),m=I(new Map),h=I(new Map),g=I(new Set),_=I(``),v=I(Date.now()/1e3),y=null,b=!0,x=0,S=I(null),C=I(null),w=I(!1),T=!1,E=null,D=0,O=0,k=0,A=0,ee=null,j=null,te=I(!1),ne=!1,M=``,re=I(null),ie=I(``),ae=null,oe=Q(()=>[...(c.value?.free?.executions||[]).filter(e=>e.member===d.value).sort((e,t)=>e.id-t.id).filter((e,t,n)=>t>=n.length-gte||e.id===re.value).map(e=>({key:`exec-${e.id}`,at:e.created_at,execution:e})),...p.value.map(e=>({key:`chat-${e.id}`,at:e.created_at,chat:e}))].sort((e,t)=>e.at-t.at)),se=e=>e.chat?e.chat.status===`running`:i.includes(e.execution.status),ce=Q(()=>[...oe.value].reverse().find(e=>se(e)||e.chat?.status===`pending`)||null),le=Q(()=>{let e=ce.value;if(!e)return`${n.display_name(d.value)} · 空闲`;if(e.chat?.status===`pending`)return`等 ${n.display_name(d.value)} 空闲后处理${RU?`(esc 撤回)`:``}`;let t=e.chat?e.chat.updated_at:e.execution.created_at;return`${e.execution&&u.value?.execution?.id===e.execution.id&&u.value.execution.activity?`${k8[u.value.execution.activity]||`处理`}中`:`处理中`}…(${ue(v.value-t)}${RU?` · esc 打断`:``})`});function ue(e){let t=Math.max(0,Math.floor(e)),n=e=>String(e).padStart(2,`0`);return t>=3600?`${Math.floor(t/3600)}:${n(Math.floor(t/60)%60)}:${n(t%60)}`:`${Math.floor(t/60)}:${n(t%60)}`}async function de(){clearTimeout(y);let e=u.value,t=c.value?.id,r=++x;if(!e||!t||document.hidden)return;try{if(!f.value||p.value.length){let r=(await n.read_member_chat(t,e.id)).chats;JSON.stringify(r)!==JSON.stringify(p.value)&&(p.value=r)}_.value=``}catch(e){r===x&&(_.value=e.message||`未能读取私聊`)}let i=Date.now()/1e3-hte,a=e=>se(e)||!m.value.has(e.key)&&!(h.value.get(e.key)?.at>i),o=[...oe.value].reverse().filter(a),s=e=>Number(e.execution?.id===re.value);o.sort((e,t)=>s(t)-s(e)),await Promise.all(Array.from({length:mte},async()=>{for(;o.length&&r===x;)await fe(o.shift(),t,r)})),r===x&&(ne=!0,y=setTimeout(de,pte))}async function fe(e,t,r){try{let i=await n.read_execution_details(t,e.execution?.id,e.chat?{chat_id:e.chat.id}:{});if(r!==x)return;if(JSON.stringify(i)!==JSON.stringify(m.value.get(e.key))&&(m.value=new Map(m.value).set(e.key,i)),h.value.has(e.key)){let t=new Map(h.value);t.delete(e.key),h.value=t}}catch(t){if(r!==x)return;h.value=new Map(h.value).set(e.key,{message:t.message||`未能读取过程`,at:Date.now()/1e3})}}function pe(){document.hidden||de()}document.addEventListener(`visibilitychange`,pe),z(()=>`${c.value?.id}\n${d.value}`,e=>{Pe(),M=e;let t=s.get(e);p.value=t?.chats||[],m.value=t?.details||new Map,h.value=new Map,g.value=t?.open_output||new Set,E=null,j=null,w.value=!1,ne=!!t,Ne(t?.scroll),de()},{immediate:!0});let me=setInterval(()=>{v.value=Date.now()/1e3},1e3),he=I(0),ge=setInterval(()=>{ce.value&&(he.value=(he.value+1)%o.length)},_te);ca(()=>{x++,clearTimeout(y),clearInterval(me),clearInterval(ge),document.removeEventListener(`visibilitychange`,pe)});function _e(e){return e&&t.value.messages?.find(t=>t.id===e)?.text||``}function ve(e){return e.chat?e.chat.text:_e(e.execution.request_message_id)||(e.execution.request_message_id?`(房间消息 #${e.execution.request_message_id})`:``)}function ye(e){return e.chat?e.chat.reply:_e(e.execution.answer_id)}function be(e){let t=ye(e)?.trim();return(m.value.get(e.key)?.entries||[]).filter(e=>!(t&&e.kind===`message`&&e.body?.trim()===t))}function xe(e){if(a[e.kind])return{tool:a[e.kind],subject:e.title||``};let[t,...n]=String(e.title||`tool`).split(` `);return{tool:t,subject:n.join(` `)}}function Se(e,t){return e.kind===`edit`?/^\+(?!\+\+)/.test(t)?`is-added`:/^-(?!--)/.test(t)?`is-removed`:``:``}function Ce(e,t){let n=String(t.body||``).replace(/\s+$/,``).split(/\r?\n/),r=g.value.has(`${e.key}/${t.id??t.title}`);return{lines:(r?n:n.slice(0,R9)).map(e=>({text:e,tone:Se(t,e)})),hidden:r?0:Math.max(0,n.length-R9)}}function P(e,t){b=!1,g.value=new Set(g.value).add(`${e.key}/${t.id??t.title}`)}function we(e){if(e.status===`interjected`){let t={pending:`待送达`,delivered:`已送达`,failed:`未送达`}[e.interjection]||`已发出`;return`作为插话进入房间任务 #${e.execution_id}:${t}${e.reason?`,${e.reason}`:``}`}return e.status===`pending`?`排队中,等它空闲后处理`:e.status===`stopped`?`已撤回`:e.status===`failed`?e.reason||`未完成`:``}function Te(e){return e.scrollHeight-e.scrollTop-e.clientHeight}function Ee(){let e=S.value;e&&(te.value=Te(e)>e.clientHeight)}function De(){A=0;let e=S.value;if(!e||!C.value||e.scrollHeight!==D||e.clientHeight!==O)return;let t=e.getBoundingClientRect().top,n=j||=C.value.querySelectorAll(`.term-welcome, .term-turn > *`),r=0,i=n.length-1,a=null;for(;r<=i;){let e=r+i>>1;n[e].getBoundingClientRect().bottom>t?(a=n[e],i=e-1):r=e+1}E=a?{line:a,top:a.getBoundingClientRect().top-t,scroll_top:e.scrollTop}:null}function Oe(){let e=S.value;Te(e)<vte?b=!0:e.scrollTop<k-1&&(b=!1),k=e.scrollTop,b&&(w.value=!1),Ee(),A||=requestAnimationFrame(De)}function ke(e){T=e}function Ae(e){e.deltaY<0&&(b=!1)}function je(){let e=S.value;if(!e)return;j=null;let t=e.scrollHeight>D;if(D=e.scrollHeight,O=e.clientHeight,b)T||(e.scrollTop=e.scrollHeight);else{if(E?.line.isConnected){let t=E.top-(e.scrollTop-E.scroll_top),n=E.line.getBoundingClientRect().top-e.getBoundingClientRect().top-t;Math.abs(n)>=1&&(e.scrollTop+=n)}t&&ne&&(w.value=!0)}Ee(),De()}function Me(){b=!0,w.value=!1,te.value=!1,ar(()=>{S.value&&(S.value.scrollTop=S.value.scrollHeight)})}function Ne(e){if(e==null)return Me();b=!1,ar(()=>{S.value&&(S.value.scrollTop=e,Ee(),De())})}function Pe(){M&&s.set(M,{chats:p.value,details:m.value,open_output:g.value,scroll:b||!S.value?null:S.value.scrollTop})}function Fe(){let e=IU.execution_id,t=e&&S.value&&C.value?.querySelector(`[data-key="exec-${e}"]`);t&&(IU.execution_id=null,b=!1,S.value.scrollTop+=t.getBoundingClientRect().top-S.value.getBoundingClientRect().top-yte,Ee(),De(),ie.value=t.dataset.key,clearTimeout(ae),ae=setTimeout(()=>{ie.value=``},bte))}z(()=>[IU.execution_id,oe.value.length],()=>{IU.execution_id&&(re.value=IU.execution_id),ar(Fe)},{immediate:!0}),aa(()=>{ee=new ResizeObserver(je),ee.observe(S.value),ee.observe(C.value)}),ca(()=>{Pe(),ee?.disconnect(),cancelAnimationFrame(A),clearTimeout(ae)});let Ie=I(``),Le=I(!1),Re=[],ze=-1,Be=``;async function Ve(){let e=Ie.value.trim();if(!(!e||Le.value||f.value)){Be||=crypto.randomUUID(),Le.value=!0;try{await n.send_member_chat(c.value.id,u.value.id,e,Be),Re.push(e),ze=-1,Ie.value=``,Be=``,Me(),await de()}catch(e){_.value=e.message||`未能发出`}finally{Le.value=!1}}}function He(e){RU&&!e.isComposing&&e.keyCode!==229&&(e.preventDefault(),Ve())}async function Ue(){let e=ce.value;if(e)try{e.chat?await n.stop_member_chat(c.value.id,e.chat.id):await r(`change_member`,{member_id:u.value.id,name:d.value,action:`interrupt`}),await de()}catch(e){_.value=e.message||`未能打断`}}function We(e,t){if(!RU)return;let n=e.target,r=t<0?!n.value.slice(0,n.selectionStart).includes(`
61
+ ${e}`;function p(e){return e.kind===`directory`?[`i-lucide-folder`,`is-folder`]:e.kind===`unavailable`?[`i-lucide-file-lock-2`,`is-muted`]:WW(e.name).slice(1)}let m=Q(()=>GW(s.value,c.value)),h=e=>String(e).split(/[\\/]+/).filter(Boolean).at(-1)||e;function g(e){e!==o.value&&(o.value=e,v(``))}function _(){let e=OW.reveal_path;return e!=null&&(OW.reveal_path=null,t.directories[OW.reveal_root]&&(o.value=OW.reveal_root),v(e),!0)}z(()=>OW.reveal_path,_),aa(()=>{_()||v(c.value)}),ca(()=>{d++});async function v(e=``,t=!1){let n=++d;t||(c.value=e,HW.set(i,{directory:s.value,path:e}),l.value=VW.get(f(e))||null),u.value=!0;try{let a=await r.read_room_files(i,e,t?l.value.next_offset:0,``,o.value);if(n!==d)return;l.value={...a,entries:t?[...l.value.entries,...a.entries]:a.entries},VW.set(f(e),l.value)}catch(e){n===d&&r.notify(`error`,`读取目录失败,${e.message}`)}finally{n===d&&(u.value=!1)}}return(t,n)=>{let r=bA,i=Yk;return W(),G(`section`,b9,[q(`header`,x9,[q(`div`,null,[n[3]||=q(`h2`,null,`项目文件`,-1),q(`p`,{title:s.value},F(s.value),9,S9)]),J(r,{icon:`i-lucide-refresh-cw`,color:`neutral`,variant:`ghost`,size:`sm`,"aria-label":`刷新`,title:`刷新`,loading:u.value,onClick:n[0]||=e=>v(c.value)},null,8,[`loading`])]),e.directories.length>1?(W(),G(`div`,C9,[(W(!0),G(U,null,V(e.directories,(e,t)=>(W(),G(`button`,{key:e,type:`button`,role:`tab`,"aria-selected":t===o.value,title:e,onClick:e=>g(t)},[J(i,{name:t?`i-lucide-folder`:`i-lucide-folder-root`},null,8,[`name`]),Y(F(h(e)),1)],8,w9))),128))])):X(``,!0),q(`div`,{class:`project-explorer`,"aria-busy":u.value},[q(`nav`,E9,[(W(!0),G(U,null,V(m.value,(e,t)=>(W(),G(U,{key:e.path},[t?(W(),K(i,{key:0,name:`i-lucide-chevron-right`,class:`project-crumb-separator`})):X(``,!0),q(`button`,{type:`button`,disabled:t===m.value.length-1,"aria-current":t===m.value.length-1?`location`:void 0,onClick:t=>v(e.path)},[t?X(``,!0):(W(),K(i,{key:0,name:`i-lucide-folder-root`})),Y(F(e.name),1)],8,D9)],64))),128))]),n[5]||=q(`div`,{class:`project-files-columns`,"aria-hidden":`true`},[q(`span`,null,`名称`),q(`span`,null,`大小`),q(`span`,null,`修改时间`)],-1),lc([l.value,u.value,s.value,o.value],()=>(W(),G(`div`,{class:`project-files-rows`},[(W(!0),G(U,null,V(l.value?.entries||[],e=>(W(),G(`button`,{key:e.path,type:`button`,class:N([`project-file-row`,{"is-hidden":e.name.startsWith(`.`)}]),disabled:e.kind===`unavailable`,title:e.kind===`unavailable`?`${e.name}(无法读取或指向项目外)`:e.name,onClick:t=>e.kind===`directory`?v(e.path):L(OW).open?.(e.path,s.value,o.value)},[q(`span`,k9,[J(i,{name:p(e)[0],class:N([`project-file-icon`,p(e)[1]])},null,8,[`name`,`class`]),q(`span`,null,F(e.name),1)]),q(`span`,A9,F(L(KW)(e.size)),1),q(`time`,{datetime:e.modified_at},F(L(qW)(e.modified_at)),9,j9)],10,O9))),128)),l.value?l.value.entries.length?X(``,!0):(W(),G(`p`,N9,[J(i,{name:`i-lucide-folder-open`}),n[4]||=Y(`此文件夹为空`,-1)])):(W(),G(`p`,M9,F(u.value?`正在读取项目目录…`:`点击刷新重新读取目录`),1))])),n,1),l.value?(W(),G(`footer`,P9,[q(`span`,null,[Y(F(l.value.total)+` 项`,1),l.value.next_offset===null?X(``,!0):(W(),G(U,{key:0},[Y(`,已显示 `+F(l.value.entries.length)+` 项`,1)],64))]),l.value.next_offset===null?X(``,!0):(W(),K(r,{key:0,label:`加载更多`,color:`neutral`,variant:`ghost`,size:`xs`,loading:u.value,disabled:u.value,onClick:n[2]||=e=>v(l.value.path,!0)},null,8,[`loading`,`disabled`]))])):X(``,!0)],8,T9)])}}},[[`__scopeId`,`data-v-c896fab1`]]),I9={class:`term`,role:`tabpanel`,"aria-label":`私聊`},kee={class:`term-tabs-bar`},Aee={class:`term-tabs`,"aria-label":`成员`},jee=[`aria-current`,`onClick`],Mee={class:`term-stage`},Nee={key:0,class:`term-welcome`},Pee={key:1,class:`term-dim`},Fee={key:0,class:`term-prompt`},Iee={class:`term-body`},Lee={key:1,class:`term-sub term-warn`},Ree={class:`term-body`},zee={key:2,class:`term-sub`},Bee={key:0,class:`term-line`},L9={class:`term-body`},Vee={key:1,class:`term-prompt`},Hee={class:`term-body`},Uee={key:2,class:`term-line term-thinking`},Wee={class:`term-body`},Gee={key:3,class:`term-block`},Kee={class:`term-sub`},qee={class:`term-body`},Jee={key:4,class:`term-line term-error`},Yee={class:`term-body`},Xee={key:5,class:`term-block`},Zee={class:`term-line`},Qee={key:`step`,class:`term-body`},$ee={class:`term-tool`},ete={key:0,class:`term-subject`},tte={class:`term-body`},nte=[`onClick`],rte={key:3,class:`term-line`},ite={class:`term-body`},ate={class:`term-body`},ote={key:0,class:`term-spin`},ste={class:`term-input`},cte=[`enterkeyhint`,`disabled`,`placeholder`,`onKeydown`],lte=[`title`,`disabled`],ute={class:`term-hint`},dte={key:0,class:`term-warn`},fte={key:1,class:`term-warn`},pte={key:2},mte=2e3,hte=4,gte=30,_te=30,R9=3,vte=120,yte=40,bte=12,xte=2e3,Ste=EH({__name:`PrivateChat`,setup(e){let{view:t,bridge:n,act:r}=Or(`discussion`),i=[`dispatched`,`started`],a={command:`Bash`,search:`Search`,edit:`Update`},o=[`·`,`✢`,`✳`,`✶`,`✻`,`✽`,`✻`,`✶`,`✳`,`✢`],s=new Map,c=Q(()=>t.value.room),l=Q(()=>c.value?.free?.members||[]),u=Q(()=>l.value.find(e=>e.name===IU.member)||l.value[0]||null),d=Q(()=>u.value?.name||``),f=Q(()=>u.value?u.value.access===`runner`?AY(u.value.adapter).chat?``:`这位成员的接入方式看不到它的输出,暂不支持私聊窗`:`这位成员是手动接入的,请在它自己的窗口里对话`:`房间里还没有 AI 成员`),p=I([]),m=I(new Map),h=I(new Map),g=I(new Set),_=I(``),v=I(Date.now()/1e3),y=null,b=!0,x=0,S=I(null),C=I(null),w=I(!1),T=!1,E=null,D=0,O=0,k=0,A=0,ee=null,j=null,te=I(!1),ne=!1,M=``,re=I(null),ie=I(``),ae=null,oe=Q(()=>[...(c.value?.free?.executions||[]).filter(e=>e.member===d.value).sort((e,t)=>e.id-t.id).filter((e,t,n)=>t>=n.length-_te||e.id===re.value).map(e=>({key:`exec-${e.id}`,at:e.created_at,execution:e})),...p.value.map(e=>({key:`chat-${e.id}`,at:e.created_at,chat:e}))].sort((e,t)=>e.at-t.at)),se=e=>e.chat?e.chat.status===`running`:i.includes(e.execution.status),ce=Q(()=>[...oe.value].reverse().find(e=>se(e)||e.chat?.status===`pending`)||null),le=Q(()=>{let e=ce.value;if(!e)return`${n.display_name(d.value)} · 空闲`;if(e.chat?.status===`pending`)return`等 ${n.display_name(d.value)} 空闲后处理${RU?`(esc 撤回)`:``}`;let t=e.chat?e.chat.updated_at:e.execution.created_at;return`${e.execution&&u.value?.execution?.id===e.execution.id&&u.value.execution.activity?`${k8[u.value.execution.activity]||`处理`}中`:`处理中`}…(${ue(v.value-t)}${RU?` · esc 打断`:``})`});function ue(e){let t=Math.max(0,Math.floor(e)),n=e=>String(e).padStart(2,`0`);return t>=3600?`${Math.floor(t/3600)}:${n(Math.floor(t/60)%60)}:${n(t%60)}`:`${Math.floor(t/60)}:${n(t%60)}`}async function de(){clearTimeout(y);let e=u.value,t=c.value?.id,r=++x;if(!e||!t||document.hidden)return;try{if(!f.value||p.value.length){let r=(await n.read_member_chat(t,e.id)).chats;JSON.stringify(r)!==JSON.stringify(p.value)&&(p.value=r)}_.value=``}catch(e){r===x&&(_.value=e.message||`未能读取私聊`)}let i=Date.now()/1e3-gte,a=e=>se(e)||!m.value.has(e.key)&&!(h.value.get(e.key)?.at>i),o=[...oe.value].reverse().filter(a),s=e=>Number(e.execution?.id===re.value);o.sort((e,t)=>s(t)-s(e)),await Promise.all(Array.from({length:hte},async()=>{for(;o.length&&r===x;)await fe(o.shift(),t,r)})),r===x&&(ne=!0,y=setTimeout(de,mte))}async function fe(e,t,r){try{let i=await n.read_execution_details(t,e.execution?.id,e.chat?{chat_id:e.chat.id}:{});if(r!==x)return;if(JSON.stringify(i)!==JSON.stringify(m.value.get(e.key))&&(m.value=new Map(m.value).set(e.key,i)),h.value.has(e.key)){let t=new Map(h.value);t.delete(e.key),h.value=t}}catch(t){if(r!==x)return;h.value=new Map(h.value).set(e.key,{message:t.message||`未能读取过程`,at:Date.now()/1e3})}}function pe(){document.hidden||de()}document.addEventListener(`visibilitychange`,pe),z(()=>`${c.value?.id}\n${d.value}`,e=>{Pe(),M=e;let t=s.get(e);p.value=t?.chats||[],m.value=t?.details||new Map,h.value=new Map,g.value=t?.open_output||new Set,E=null,j=null,w.value=!1,ne=!!t,Ne(t?.scroll),de()},{immediate:!0});let me=setInterval(()=>{v.value=Date.now()/1e3},1e3),he=I(0),ge=setInterval(()=>{ce.value&&(he.value=(he.value+1)%o.length)},vte);ca(()=>{x++,clearTimeout(y),clearInterval(me),clearInterval(ge),document.removeEventListener(`visibilitychange`,pe)});function _e(e){return e&&t.value.messages?.find(t=>t.id===e)?.text||``}function ve(e){return e.chat?e.chat.text:_e(e.execution.request_message_id)||(e.execution.request_message_id?`(房间消息 #${e.execution.request_message_id})`:``)}function ye(e){return e.chat?e.chat.reply:_e(e.execution.answer_id)}function be(e){let t=ye(e)?.trim();return(m.value.get(e.key)?.entries||[]).filter(e=>!(t&&e.kind===`message`&&e.body?.trim()===t))}function xe(e){if(a[e.kind])return{tool:a[e.kind],subject:e.title||``};let[t,...n]=String(e.title||`tool`).split(` `);return{tool:t,subject:n.join(` `)}}function Se(e,t){return e.kind===`edit`?/^\+(?!\+\+)/.test(t)?`is-added`:/^-(?!--)/.test(t)?`is-removed`:``:``}function Ce(e,t){let n=String(t.body||``).replace(/\s+$/,``).split(/\r?\n/),r=g.value.has(`${e.key}/${t.id??t.title}`);return{lines:(r?n:n.slice(0,R9)).map(e=>({text:e,tone:Se(t,e)})),hidden:r?0:Math.max(0,n.length-R9)}}function P(e,t){b=!1,g.value=new Set(g.value).add(`${e.key}/${t.id??t.title}`)}function we(e){if(e.status===`interjected`){let t={pending:`待送达`,delivered:`已送达`,failed:`未送达`}[e.interjection]||`已发出`;return`作为插话进入房间任务 #${e.execution_id}:${t}${e.reason?`,${e.reason}`:``}`}return e.status===`pending`?`排队中,等它空闲后处理`:e.status===`stopped`?`已撤回`:e.status===`failed`?e.reason||`未完成`:``}function Te(e){return e.scrollHeight-e.scrollTop-e.clientHeight}function Ee(){let e=S.value;e&&(te.value=Te(e)>e.clientHeight)}function De(){A=0;let e=S.value;if(!e||!C.value||e.scrollHeight!==D||e.clientHeight!==O)return;let t=e.getBoundingClientRect().top,n=j||=C.value.querySelectorAll(`.term-welcome, .term-turn > *`),r=0,i=n.length-1,a=null;for(;r<=i;){let e=r+i>>1;n[e].getBoundingClientRect().bottom>t?(a=n[e],i=e-1):r=e+1}E=a?{line:a,top:a.getBoundingClientRect().top-t,scroll_top:e.scrollTop}:null}function Oe(){let e=S.value;Te(e)<yte?b=!0:e.scrollTop<k-1&&(b=!1),k=e.scrollTop,b&&(w.value=!1),Ee(),A||=requestAnimationFrame(De)}function ke(e){T=e}function Ae(e){e.deltaY<0&&(b=!1)}function je(){let e=S.value;if(!e)return;j=null;let t=e.scrollHeight>D;if(D=e.scrollHeight,O=e.clientHeight,b)T||(e.scrollTop=e.scrollHeight);else{if(E?.line.isConnected){let t=E.top-(e.scrollTop-E.scroll_top),n=E.line.getBoundingClientRect().top-e.getBoundingClientRect().top-t;Math.abs(n)>=1&&(e.scrollTop+=n)}t&&ne&&(w.value=!0)}Ee(),De()}function Me(){b=!0,w.value=!1,te.value=!1,ar(()=>{S.value&&(S.value.scrollTop=S.value.scrollHeight)})}function Ne(e){if(e==null)return Me();b=!1,ar(()=>{S.value&&(S.value.scrollTop=e,Ee(),De())})}function Pe(){M&&s.set(M,{chats:p.value,details:m.value,open_output:g.value,scroll:b||!S.value?null:S.value.scrollTop})}function Fe(){let e=IU.execution_id,t=e&&S.value&&C.value?.querySelector(`[data-key="exec-${e}"]`);t&&(IU.execution_id=null,b=!1,S.value.scrollTop+=t.getBoundingClientRect().top-S.value.getBoundingClientRect().top-bte,Ee(),De(),ie.value=t.dataset.key,clearTimeout(ae),ae=setTimeout(()=>{ie.value=``},xte))}z(()=>[IU.execution_id,oe.value.length],()=>{IU.execution_id&&(re.value=IU.execution_id),ar(Fe)},{immediate:!0}),aa(()=>{ee=new ResizeObserver(je),ee.observe(S.value),ee.observe(C.value)}),ca(()=>{Pe(),ee?.disconnect(),cancelAnimationFrame(A),clearTimeout(ae)});let Ie=I(``),Le=I(!1),Re=[],ze=-1,Be=``;async function Ve(){let e=Ie.value.trim();if(!(!e||Le.value||f.value)){Be||=crypto.randomUUID(),Le.value=!0;try{await n.send_member_chat(c.value.id,u.value.id,e,Be),Re.push(e),ze=-1,Ie.value=``,Be=``,Me(),await de()}catch(e){_.value=e.message||`未能发出`}finally{Le.value=!1}}}function He(e){RU&&!e.isComposing&&e.keyCode!==229&&(e.preventDefault(),Ve())}async function Ue(){let e=ce.value;if(e)try{e.chat?await n.stop_member_chat(c.value.id,e.chat.id):await r(`change_member`,{member_id:u.value.id,name:d.value,action:`interrupt`}),await de()}catch(e){_.value=e.message||`未能打断`}}function We(e,t){if(!RU)return;let n=e.target,r=t<0?!n.value.slice(0,n.selectionStart).includes(`
62
62
  `):!n.value.slice(n.selectionEnd).includes(`
63
- `);Re.length&&r&&(e.preventDefault(),ze=ze<0?t<0?Re.length-1:-1:ze+t,ze>=Re.length&&(ze=-1),ze=Math.max(-1,ze),Ie.value=ze<0?``:Re[ze])}return(e,t)=>{let r=ya(`keep-reading`);return W(),G(`div`,I9,[q(`nav`,kee,[(W(!0),G(U,null,V(l.value,e=>(W(),G(`button`,{key:e.id,type:`button`,class:N([`term-tab`,{"is-current":e.name===d.value}]),"aria-current":e.name===d.value,onClick:t=>{L(IU).member=e.name,L(IU).execution_id=null}},[q(`span`,{class:N([`term-dot`,{"is-busy":i.includes(e.execution?.status)}])},null,2),Y(F(L(n).display_name(e.name)),1)],10,Aee))),128))]),q(`div`,jee,[Tr((W(),G(`div`,{ref_key:`screen`,ref:S,class:`term-screen`,onScrollPassive:Oe,onWheelPassive:Ae,onTouchstartPassive:t[2]||=e=>ke(!0),onTouchend:t[3]||=e=>ke(!1),onTouchcancel:t[4]||=e=>ke(!1)},[q(`div`,{ref_key:`content`,ref:C,class:`term-content`},[u.value?(W(),G(`div`,Mee,[q(`div`,null,[t[8]||=q(`span`,{class:`term-accent`},`✻`,-1),t[9]||=Y(` 和 `,-1),q(`b`,null,F(L(n).display_name(d.value)),1),t[10]||=Y(` 私聊`,-1)]),t[11]||=q(`div`,{class:`term-dim`},`用它在房间里的同一个会话回答,记录只有你看得到`,-1)])):(W(),G(`p`,Nee,`房间里还没有 AI 成员`)),(W(!0),G(U,null,V(oe.value,(e,n,r,i)=>{let a=[ve(e),ye(e),se(e),e.chat&&we(e.chat),m.value.get(e.key),h.value.get(e.key),g.value,ie.value===e.key];if(i&&i.el&&i.key===e.key&&uc(i,a))return i;let o=(W(),G(`section`,{key:e.key,class:N([`term-turn`,{"is-target":ie.value===e.key}]),"data-key":e.key},[ve(e)?(W(),G(`div`,Pee,[q(`span`,Fee,F(ve(e)),1)])):X(``,!0),h.value.get(e.key)&&!m.value.has(e.key)?(W(),G(`div`,Iee,[t[12]||=q(`span`,{class:`term-corner`},`⎿`,-1),q(`span`,Lee,`未能读取过程:`+F(h.value.get(e.key).message),1)])):!m.value.has(e.key)&&se(e)?(W(),G(`div`,Ree,[...t[13]||=[q(`span`,{class:`term-corner`},`⎿`,-1),q(`span`,{class:`term-body`},`正在读取…`,-1)]])):X(``,!0),(W(!0),G(U,null,V(be(e),(n,r)=>(W(),G(U,{key:n.id??r},[n.kind===`message`?(W(),G(`div`,zee,[t[14]||=q(`span`,{class:`term-bullet`},`●`,-1),q(`span`,Bee,F(n.body),1)])):n.kind===`interjection`?(W(),G(`div`,L9,[q(`span`,Vee,F(n.body),1)])):n.kind===`thinking`?(W(),G(`div`,Hee,[t[15]||=q(`span`,{class:`term-bullet`},`✻`,-1),q(`span`,Uee,F(n.body),1)])):n.kind===`plan`?(W(),G(`div`,Wee,[t[17]||=q(`div`,{class:`term-line`},[q(`span`,{class:`term-bullet`},`●`),q(`span`,{class:`term-body`},[q(`b`,{class:`term-tool`},`Update Todos`)])],-1),q(`div`,Gee,[t[16]||=q(`span`,{class:`term-corner`},`⎿`,-1),q(`span`,Kee,F(n.body),1)])])):n.kind===`error`?(W(),G(`div`,qee,[t[18]||=q(`span`,{class:`term-bullet`},`●`,-1),q(`span`,Jee,F(n.body||n.title),1)])):(W(),G(`div`,Yee,[q(`div`,Xee,[q(`span`,{class:N([`term-bullet`,`is-${n.state||`done`}`])},`●`,2),(W(!0),G(U,null,V([xe(n)],e=>(W(),G(`span`,Zee,[q(`b`,Qee,F(e.tool),1),e.subject?(W(),G(`span`,$ee,`(`+F(e.subject)+`)`,1)):X(``,!0)]))),128))]),n.body?(W(!0),G(U,{key:0},V([Ce(e,n)],r=>(W(),G(`div`,{key:`out`,class:N([`term-sub`,{"term-error":n.state===`failed`}])},[t[19]||=q(`span`,{class:`term-corner`},`⎿`,-1),q(`span`,ete,[(W(!0),G(U,null,V(r.lines,(e,t)=>(W(),G(`span`,{key:t,class:N([`term-out`,e.tone])},F(e.text||` `),3))),128)),r.hidden?(W(),G(`button`,{key:0,type:`button`,class:`term-more`,onClick:t=>P(e,n)},`… +`+F(r.hidden)+` 行(点击展开)`,9,tte)):X(``,!0)])],2))),128)):X(``,!0)]))],64))),128)),ye(e)?(W(),G(`div`,nte,[t[20]||=q(`span`,{class:`term-bullet`},`●`,-1),q(`span`,rte,F(ye(e)),1)])):X(``,!0),e.chat&&we(e.chat)?(W(),G(`div`,{key:4,class:N([`term-sub`,{"term-error":e.chat.status===`failed`}])},[t[21]||=q(`span`,{class:`term-corner`},`⎿`,-1),q(`span`,ite,F(we(e.chat)),1)],2)):X(``,!0)],10,[`data-key`]));return o.memo=a,o},t,0),128))],512)],32)),[[r]]),w.value||te.value?(W(),G(`button`,{key:0,type:`button`,class:`term-unread`,onClick:Me},F(w.value?`↓ 新输出`:`↓ 回到底部`),1)):X(``,!0)]),q(`div`,{class:N([`term-status`,{"is-running":ce.value}]),role:`status`},[ce.value?(W(),G(`span`,ate,F(o[he.value]),1)):X(``,!0),q(`span`,null,F(le.value),1)],2),q(`div`,ote,[t[23]||=q(`span`,{class:`term-caret`,"aria-hidden":`true`},`>`,-1),Tr(q(`textarea`,{"onUpdate:modelValue":t[5]||=e=>Ie.value=e,rows:`1`,enterkeyhint:L(RU)?`send`:`enter`,disabled:!!f.value||Le.value,placeholder:f.value?`暂不可用`:ce.value?`插话引导它…`:`输入消息…`,"aria-label":`私聊输入`,maxlength:`4000`,onKeydown:[yu(_u(He,[`exact`]),[`enter`]),yu(_u(Ue,[`prevent`]),[`esc`]),t[6]||=yu(e=>We(e,-1),[`up`]),t[7]||=yu(e=>We(e,1),[`down`])]},null,40,ste),[[nu,Ie.value]]),ce.value?(W(),G(`button`,{key:0,type:`button`,class:`term-button is-stop`,"aria-label":`打断`,title:`打断(Esc)`,onClick:Ue},[...t[22]||=[q(`span`,{class:`term-stop-square`},null,-1)]])):X(``,!0),q(`button`,{type:`button`,class:`term-button`,"aria-label":`发送`,title:L(RU)?`发送(Enter)`:`发送`,disabled:!Ie.value.trim()||Le.value||!!f.value,onClick:Ve},`↑`,8,cte)]),q(`div`,lte,[_.value?(W(),G(`span`,ute,F(_.value),1)):f.value?(W(),G(`span`,dte,F(f.value),1)):L(RU)?(W(),G(`span`,fte,`enter 发送 · shift+enter 换行 · ↑↓ 历史`+F(ce.value?` · esc 打断`:``),1)):X(``,!0)])])}}},[[`__scopeId`,`data-v-5ce1cd9f`]]),Ste={class:`project-editor-head`},Cte={class:`project-editor-tablist`,role:`tablist`,"aria-label":`已打开的文件`},wte=[`title`],Tte=[`aria-selected`,`onClick`],Ete=[`aria-label`,`onClick`],Dte={class:`project-editor-file-actions`},Ote={key:2,class:`project-editor-modes`,role:`group`,"aria-label":`显示方式`},kte=[`aria-pressed`],Ate=[`aria-pressed`],jte={class:`project-editor-window-actions`},Mte={class:`project-editor-breadcrumbs`,"aria-label":`文件位置`},Nte=[`onClick`],Pte={key:2,class:`project-crumb-file`},Fte={key:0,class:`project-editor-banner`},Ite={key:1,class:`project-editor-banner`},Lte={key:0,class:`project-editor-state`,role:`status`},Rte={key:1,class:`project-editor-state`},zte={key:2,class:`project-editor-state`},Bte={class:`project-code-number`,"aria-hidden":`true`},Vte={class:`project-code-line`},Hte={class:`project-code-gutter`,"aria-hidden":`true`},Ute={class:`project-code-text`},Wte=[`srcdoc`],Gte=[`innerHTML`],Kte=[`title`,`aria-label`,`onClick`],qte={type:`submit`,class:`selection-comment-send`,"aria-label":`添加到对话`,title:`添加到对话(Enter)`},Jte={key:10,class:`file-listen-dock`},Yte=[`aria-pressed`,`title`],Xte={class:`project-editor-status`},Zte=[`title`],Qte={class:`project-editor-encoding`},$te={key:2},ene=[`title`],tne={class:`file-float-name`},nne={key:0,class:`file-float-count`},rne=350,ine=190,ane=28,one=340,sne=40,z9=6,cne=300,lne=110,B9=240,une=12,V9=80,dne=.25,fne=.6,pne=40,mne=.15,hne=40,gne=44,_ne=6,vne=EH({__name:`FilePreview`,setup(e){let{view:t,bridge:n,act:r}=Or(`discussion`),i=I([]),a=I(``),o=I(!1),s=window.matchMedia(`(max-width: 640px)`),c=I(s.matches),l=I(s.matches),u=e=>{l.value=e.matches},d=e=>e.split(`/`).pop()||`文件预览`,f=Q(()=>i.value.find(e=>e.id===a.value)||null),p=Q(()=>f.value?.path||``),m=Q(()=>f.value?.root?`${f.value.directory.replace(/[\\/]+$/,``)}/${p.value}`:p.value),h=Q(()=>f.value?.data||null),g=Q({get:()=>!!f.value?.source,set:e=>{f.value&&(f.value.source=e)}}),_=Q(()=>GW(f.value?.directory||``,p.value)),v=Q(()=>d(p.value)),y=Q(()=>WW(v.value)),b=Q(()=>/\.(md|markdown)$/i.test(p.value)?`markdown`:/\.html?$/i.test(p.value)?`html`:`text`),x=Q(()=>b.value===`markdown`&&h.value?.text?window.discuss_markdown.render_markdown(h.value.text,[],{source_lines:!0}):``),S=Q(()=>`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src data:; font-src data:; base-uri 'none'; form-action 'none'"><meta charset="utf-8">${h.value?.text||``}`),C=Q(()=>h.value?.text!=null&&b.value!==`text`&&!(b.value===`html`&&h.value.truncated)),w=Q(()=>h.value?.text!=null&&(!C.value||g.value)),T=Q(()=>h.value?.text==null?[]:h.value.text.split(`
63
+ `);Re.length&&r&&(e.preventDefault(),ze=ze<0?t<0?Re.length-1:-1:ze+t,ze>=Re.length&&(ze=-1),ze=Math.max(-1,ze),Ie.value=ze<0?``:Re[ze])}return(e,t)=>{let r=ya(`keep-reading`);return W(),G(`div`,I9,[q(`div`,kee,[q(`nav`,Aee,[(W(!0),G(U,null,V(l.value,e=>(W(),G(`button`,{key:e.id,type:`button`,class:N([`term-tab`,{"is-current":e.name===d.value}]),"aria-current":e.name===d.value,onClick:t=>{L(IU).member=e.name,L(IU).execution_id=null}},[q(`span`,{class:N([`term-dot`,{"is-busy":i.includes(e.execution?.status)}])},null,2),Y(F(L(n).display_name(e.name)),1)],10,jee))),128))])]),q(`div`,Mee,[Tr((W(),G(`div`,{ref_key:`screen`,ref:S,class:`term-screen`,onScrollPassive:Oe,onWheelPassive:Ae,onTouchstartPassive:t[2]||=e=>ke(!0),onTouchend:t[3]||=e=>ke(!1),onTouchcancel:t[4]||=e=>ke(!1)},[q(`div`,{ref_key:`content`,ref:C,class:`term-content`},[u.value?(W(),G(`div`,Nee,[q(`div`,null,[t[8]||=q(`span`,{class:`term-accent`},`✻`,-1),t[9]||=Y(` 和 `,-1),q(`b`,null,F(L(n).display_name(d.value)),1),t[10]||=Y(` 私聊`,-1)]),t[11]||=q(`div`,{class:`term-dim`},`用它在房间里的同一个会话回答,记录只有你看得到`,-1)])):(W(),G(`p`,Pee,`房间里还没有 AI 成员`)),(W(!0),G(U,null,V(oe.value,(e,n,r,i)=>{let a=[ve(e),ye(e),se(e),e.chat&&we(e.chat),m.value.get(e.key),h.value.get(e.key),g.value,ie.value===e.key];if(i&&i.el&&i.key===e.key&&uc(i,a))return i;let o=(W(),G(`section`,{key:e.key,class:N([`term-turn`,{"is-target":ie.value===e.key}]),"data-key":e.key},[ve(e)?(W(),G(`div`,Fee,[q(`span`,Iee,F(ve(e)),1)])):X(``,!0),h.value.get(e.key)&&!m.value.has(e.key)?(W(),G(`div`,Lee,[t[12]||=q(`span`,{class:`term-corner`},`⎿`,-1),q(`span`,Ree,`未能读取过程:`+F(h.value.get(e.key).message),1)])):!m.value.has(e.key)&&se(e)?(W(),G(`div`,zee,[...t[13]||=[q(`span`,{class:`term-corner`},`⎿`,-1),q(`span`,{class:`term-body`},`正在读取…`,-1)]])):X(``,!0),(W(!0),G(U,null,V(be(e),(n,r)=>(W(),G(U,{key:n.id??r},[n.kind===`message`?(W(),G(`div`,Bee,[t[14]||=q(`span`,{class:`term-bullet`},`●`,-1),q(`span`,L9,F(n.body),1)])):n.kind===`interjection`?(W(),G(`div`,Vee,[q(`span`,Hee,F(n.body),1)])):n.kind===`thinking`?(W(),G(`div`,Uee,[t[15]||=q(`span`,{class:`term-bullet`},`✻`,-1),q(`span`,Wee,F(n.body),1)])):n.kind===`plan`?(W(),G(`div`,Gee,[t[17]||=q(`div`,{class:`term-line`},[q(`span`,{class:`term-bullet`},`●`),q(`span`,{class:`term-body`},[q(`b`,{class:`term-tool`},`Update Todos`)])],-1),q(`div`,Kee,[t[16]||=q(`span`,{class:`term-corner`},`⎿`,-1),q(`span`,qee,F(n.body),1)])])):n.kind===`error`?(W(),G(`div`,Jee,[t[18]||=q(`span`,{class:`term-bullet`},`●`,-1),q(`span`,Yee,F(n.body||n.title),1)])):(W(),G(`div`,Xee,[q(`div`,Zee,[q(`span`,{class:N([`term-bullet`,`is-${n.state||`done`}`])},`●`,2),(W(!0),G(U,null,V([xe(n)],e=>(W(),G(`span`,Qee,[q(`b`,$ee,F(e.tool),1),e.subject?(W(),G(`span`,ete,`(`+F(e.subject)+`)`,1)):X(``,!0)]))),128))]),n.body?(W(!0),G(U,{key:0},V([Ce(e,n)],r=>(W(),G(`div`,{key:`out`,class:N([`term-sub`,{"term-error":n.state===`failed`}])},[t[19]||=q(`span`,{class:`term-corner`},`⎿`,-1),q(`span`,tte,[(W(!0),G(U,null,V(r.lines,(e,t)=>(W(),G(`span`,{key:t,class:N([`term-out`,e.tone])},F(e.text||` `),3))),128)),r.hidden?(W(),G(`button`,{key:0,type:`button`,class:`term-more`,onClick:t=>P(e,n)},`… +`+F(r.hidden)+` 行(点击展开)`,9,nte)):X(``,!0)])],2))),128)):X(``,!0)]))],64))),128)),ye(e)?(W(),G(`div`,rte,[t[20]||=q(`span`,{class:`term-bullet`},`●`,-1),q(`span`,ite,F(ye(e)),1)])):X(``,!0),e.chat&&we(e.chat)?(W(),G(`div`,{key:4,class:N([`term-sub`,{"term-error":e.chat.status===`failed`}])},[t[21]||=q(`span`,{class:`term-corner`},`⎿`,-1),q(`span`,ate,F(we(e.chat)),1)],2)):X(``,!0)],10,[`data-key`]));return o.memo=a,o},t,0),128))],512)],32)),[[r]]),w.value||te.value?(W(),G(`button`,{key:0,type:`button`,class:`term-unread`,onClick:Me},F(w.value?`↓ 新输出`:`↓ 回到底部`),1)):X(``,!0)]),q(`div`,{class:N([`term-status`,{"is-running":ce.value}]),role:`status`},[ce.value?(W(),G(`span`,ote,F(o[he.value]),1)):X(``,!0),q(`span`,null,F(le.value),1)],2),q(`div`,ste,[t[23]||=q(`span`,{class:`term-caret`,"aria-hidden":`true`},`>`,-1),Tr(q(`textarea`,{"onUpdate:modelValue":t[5]||=e=>Ie.value=e,rows:`1`,enterkeyhint:L(RU)?`send`:`enter`,disabled:!!f.value||Le.value,placeholder:f.value?`暂不可用`:ce.value?`插话引导它…`:`输入消息…`,"aria-label":`私聊输入`,maxlength:`4000`,onKeydown:[yu(_u(He,[`exact`]),[`enter`]),yu(_u(Ue,[`prevent`]),[`esc`]),t[6]||=yu(e=>We(e,-1),[`up`]),t[7]||=yu(e=>We(e,1),[`down`])]},null,40,cte),[[nu,Ie.value]]),ce.value?(W(),G(`button`,{key:0,type:`button`,class:`term-button is-stop`,"aria-label":`打断`,title:`打断(Esc)`,onClick:Ue},[...t[22]||=[q(`span`,{class:`term-stop-square`},null,-1)]])):X(``,!0),q(`button`,{type:`button`,class:`term-button`,"aria-label":`发送`,title:L(RU)?`发送(Enter)`:`发送`,disabled:!Ie.value.trim()||Le.value||!!f.value,onClick:Ve},`↑`,8,lte)]),q(`div`,ute,[_.value?(W(),G(`span`,dte,F(_.value),1)):f.value?(W(),G(`span`,fte,F(f.value),1)):L(RU)?(W(),G(`span`,pte,`enter 发送 · shift+enter 换行 · ↑↓ 历史`+F(ce.value?` · esc 打断`:``),1)):X(``,!0)])])}}},[[`__scopeId`,`data-v-bef0a30d`]]),Cte={class:`project-editor-head`},wte={class:`project-editor-tablist`,role:`tablist`,"aria-label":`已打开的文件`},Tte=[`title`],Ete=[`aria-selected`,`onClick`],Dte=[`aria-label`,`onClick`],Ote={class:`project-editor-file-actions`},kte={key:2,class:`project-editor-modes`,role:`group`,"aria-label":`显示方式`},Ate=[`aria-pressed`],jte=[`aria-pressed`],Mte={class:`project-editor-window-actions`},Nte={class:`project-editor-breadcrumbs`,"aria-label":`文件位置`},Pte=[`onClick`],Fte={key:2,class:`project-crumb-file`},Ite={key:0,class:`project-editor-banner`},Lte={key:1,class:`project-editor-banner`},Rte={key:0,class:`project-editor-state`,role:`status`},zte={key:1,class:`project-editor-state`},Bte={key:2,class:`project-editor-state`},Vte={class:`project-code-number`,"aria-hidden":`true`},Hte={class:`project-code-line`},Ute={class:`project-code-gutter`,"aria-hidden":`true`},Wte={class:`project-code-text`},Gte=[`srcdoc`],Kte=[`innerHTML`],qte=[`title`,`aria-label`,`onClick`],Jte={type:`submit`,class:`selection-comment-send`,"aria-label":`添加到对话`,title:`添加到对话(Enter)`},Yte={key:10,class:`file-listen-dock`},Xte=[`aria-pressed`,`title`],Zte={class:`project-editor-status`},Qte=[`title`],$te={class:`project-editor-encoding`},ene={key:2},tne=[`title`],nne={class:`file-float-name`},rne={key:0,class:`file-float-count`},ine=350,ane=190,one=28,sne=340,cne=40,z9=6,lne=300,une=110,B9=240,dne=12,V9=80,fne=.25,pne=.6,mne=40,hne=.15,gne=40,_ne=44,vne=6,yne=EH({__name:`FilePreview`,setup(e){let{view:t,bridge:n,act:r}=Or(`discussion`),i=I([]),a=I(``),o=I(!1),s=window.matchMedia(`(max-width: 640px)`),c=I(s.matches),l=I(s.matches),u=e=>{l.value=e.matches},d=e=>e.split(`/`).pop()||`文件预览`,f=Q(()=>i.value.find(e=>e.id===a.value)||null),p=Q(()=>f.value?.path||``),m=Q(()=>f.value?.root?`${f.value.directory.replace(/[\\/]+$/,``)}/${p.value}`:p.value),h=Q(()=>f.value?.data||null),g=Q({get:()=>!!f.value?.source,set:e=>{f.value&&(f.value.source=e)}}),_=Q(()=>GW(f.value?.directory||``,p.value)),v=Q(()=>d(p.value)),y=Q(()=>WW(v.value)),b=Q(()=>/\.(md|markdown)$/i.test(p.value)?`markdown`:/\.html?$/i.test(p.value)?`html`:`text`),x=Q(()=>b.value===`markdown`&&h.value?.text?window.discuss_markdown.render_markdown(h.value.text,[],{source_lines:!0}):``),S=Q(()=>`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src data:; font-src data:; base-uri 'none'; form-action 'none'"><meta charset="utf-8">${h.value?.text||``}`),C=Q(()=>h.value?.text!=null&&b.value!==`text`&&!(b.value===`html`&&h.value.truncated)),w=Q(()=>h.value?.text!=null&&(!C.value||g.value)),T=Q(()=>h.value?.text==null?[]:h.value.text.split(`
64
64
  `)),E=Q(()=>T.value.length),D=Q(()=>Array.from({length:E.value},(e,t)=>t+1).join(`
65
- `)),O=Q(()=>(h.value?.encoding||`utf-8`).toUpperCase()),k=/^---\r?\n[\s\S]*?\r?\n---[ \t]*(?:\r?\n|$)/,A=[`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `],ee=I(null),j=I(null),te=I(null),ne=I(null),M=I(null),re=I(!1),ie=I(null),ae=I(null),oe=I(``),se=I([]),ce=I(null),le=0,ue=!1,de=()=>n.local_request(`tts-settings`,{}),fe=gW({bridge:n,container:()=>j.value,hosts:`.project-markdown-preview`,voice_for:async()=>{try{return(await de()).file_voice||``}catch{return``}},title:()=>t.value.room?.title||``}),pe=Q(()=>re.value&&b.value===`markdown`&&!g.value&&!!h.value?.text);function me(){de().then(e=>{re.value=!!e.api_key_ref},()=>{re.value=!1})}async function he(e){let t=(e.request||0)+1;Object.assign(e,{request:t,loading:!0,error:``});try{let r=await n.read_room_files(e.room_id,e.path,0,``,e.root||0);e.request===t&&(e.data=r)}catch(n){e.request===t&&(e.error=n.message)}finally{e.request===t&&(e.loading=!1)}}function ge(e,n,r=0){ve();let s=t.value.room?.id;if(!s)return;let c=`${s}\n${r}\n${e}`,l=i.value.find(e=>e.id===c);l||=(i.value.push({id:c,room_id:s,directory:n,root:r,path:e,data:null,loading:!1,error:``,source:!1,scroll:0,request:0}),i.value[i.value.length-1]),a.value=c,o.value=!0,me(),he(l)}let _e=()=>j.value||ne.value;function ve(){f.value&&o.value&&_e()&&(f.value.scroll=_e().scrollTop)}function be(e){e!==a.value&&(ve(),a.value=e)}function xe(e){let t=i.value.findIndex(t=>t.id===e);t<0||(i.value[t].request++,i.value.splice(t,1),e===a.value&&(a.value=i.value[Math.min(t,i.value.length-1)]?.id||``,i.value.length||(o.value=!1)))}function Se(){ve(),o.value=!1}let Ce=I(null),P=I({left:0,top:V9}),we=()=>window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,Te=null,Ee=!1,De=I(`right`),Oe=I(null),ke=null,Ae=null,je=!1;function Me(e){return Math.min(Math.max(e,0),Math.max(0,window.innerHeight-hne))}function Ne(){let e=document.querySelector(`.channel-content`)?.getBoundingClientRect();P.value=e?{left:e.left,top:e.top+une}:{left:0,top:V9},De.value===`right`&&(P.value.left=window.innerWidth-gne),ke!==null&&(P.value.top=Me(ke))}let Pe=Q(()=>{if(Oe.value)return{left:`${Oe.value.left}px`,top:`${Oe.value.top}px`};let e=`${P.value.top}px`;return De.value===`right`?{right:`0px`,top:e}:{left:`${P.value.left}px`,top:e}});function Fe(e){if(e.button!==0)return;let t=e.currentTarget.getBoundingClientRect();Ae={x:e.clientX,y:e.clientY,left:t.left,top:t.top,width:t.width,moved:!1}}function Ie(e){if(!Ae)return;let t=e.clientX-Ae.x,n=e.clientY-Ae.y;if(!Ae.moved){if(Math.hypot(t,n)<_ne)return;Ae.moved=!0,e.currentTarget.setPointerCapture?.(e.pointerId)}let r=Math.min(Math.max(Ae.left+t,0),Math.max(0,window.innerWidth-Ae.width));Oe.value={left:r,top:Me(Ae.top+n)}}function Le(){if(je=!!Ae?.moved,je&&Oe.value){let{left:e,top:t}=Oe.value;De.value=e+Ae.width/2<window.innerWidth/2?`left`:`right`,ke=t,Ne()}Ae=null,Oe.value=null}function Re(e){je&&(je=!1,e.stopPropagation(),e.preventDefault())}function ze(e,{opacity:t=``,radius:n=``,transition:r=!0}={}){let i=Ce.value;i&&Object.assign(i.style,{transformOrigin:`0 0`,transition:r?`transform ${B9}ms ease, opacity ${B9}ms ease, border-radius ${B9}ms ease`:`none`,transform:e,opacity:t,borderRadius:n})}function Be(e){let t=Math.max(.05,44/e.width);return`translate(${P.value.left-e.left}px, ${P.value.top-e.top}px) scale(${t})`}function Ve(e){if(Ee)return;ve(),Ne();let t=Ce.value,n=()=>{Ee=!1,Se(),typeof e==`function`&&e()};if(!t||we()){n();return}Ee=!0,ze(`none`,{transition:!1});let r=t.getBoundingClientRect();ze(t.dataset.pull||`none`,{transition:!1}),t.getBoundingClientRect(),ze(Be(r),{opacity:`0`,radius:`14px`}),window.setTimeout(n,B9)}async function He(){Ne(),o.value=!0,!we()&&(await ar(),requestAnimationFrame(()=>{let e=Ce.value;e&&(ze(Be(e.getBoundingClientRect()),{opacity:`0`,radius:`14px`,transition:!1}),e.getBoundingClientRect(),ze(``,{}))}))}function Ue(e){if(Te=null,Ee||e.touches.length!==1||!window.matchMedia(`(pointer: coarse)`).matches||ae.value||e.target.closest?.(`input, textarea, .file-selection-offer, .file-listen-dock`))return;let t=document.getSelection();if(t&&!t.isCollapsed)return;let n=_e();if(!e.target.closest?.(`.project-editor-head`)&&!(n?.contains(e.target)&&n.scrollTop<=0))return;let r=e.touches[0];Te={x:r.clientX,y:r.clientY,time:e.timeStamp,distance:0,speed:0,active:!1,height:Ce.value?.offsetHeight||window.innerHeight}}function We(e){if(!Te)return;let t=e.touches[0],n=t.clientX-Te.x,r=t.clientY-Te.y;if(!Te.active){if(r<=0||Math.abs(n)>r){Math.abs(n)+Math.abs(r)>4&&(Te=null);return}Te.active=!0}e.cancelable&&e.preventDefault();let i=Math.max(1,e.timeStamp-Te.time);Te.speed=(r-Te.distance)/i,Te.time=e.timeStamp,Te.distance=Math.max(0,r);let a=1-Math.min(1,Te.distance/Te.height)*mne,o=`translate(${(Ce.value?.offsetWidth||0)*(1-a)/2}px, ${Te.distance}px) scale(${a})`;Ce.value&&(Ce.value.dataset.pull=o),ze(o,{radius:`14px`,transition:!1})}function Ge(){let e=Te;if(Te=null,!e?.active)return;let t=Ce.value;e.distance>e.height*dne||e.speed>fne&&e.distance>pne?Ve():ze(``,{}),t&&delete t.dataset.pull}function Ke(){for(let e of i.value)e.request++;i.value=[],a.value=``,o.value=!1}async function qe(){let e=f.value?.room_id;e&&t.value.room?.id!==e&&(await r(`room`,e),await ar())}async function Je(e){Ve(),await qe(),OW.reveal_root=f.value?.root||0,OW.reveal_path=e,r(`tab`,`files`)}z([o,a,()=>!!h.value],async()=>{o.value&&f.value&&(await ar(),_e()&&(_e().scrollTop=f.value.scroll))});function Ye(){let e=k.exec(h.value?.text||``)?.[0]||``;fe.read_document(te.value,{skip:(e.match(/[\p{L}\p{N}]/gu)||[]).length,heading:v.value})}function Xe(){ie.value=null,window.clearTimeout(le),ue||(le=window.setTimeout(nt,rne))}let Ze=e=>!!e.target.closest?.(`.file-selection-offer`),Qe=e=>{Ze(e)||e.target.closest?.(`.excerpt-mark`)||(ue=!0,ce.value&&at())},$e=e=>{Ze(e)||(ue=!1,Xe())};function et(e){let t=e.commonAncestorContainer,n=[];if(t.nodeType===Node.TEXT_NODE)n.push(t);else for(let e=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);e.nextNode();)n.push(e.currentNode);let r=n.filter(t=>{if(!e.intersectsNode(t))return!1;let n=t===e.startContainer?e.startOffset:0,r=t===e.endContainer?e.endOffset:t.length;return!!t.data.slice(n,r).trim()}),i=e=>e?.parentElement?.closest(`[data-source-lines]`)?.dataset.sourceLines.split(`-`).map(Number),a=i(r[0]),o=i(r[r.length-1]);return a&&o?{start:a[0],end:Math.max(a[0],o[1])}:{start:0,end:0}}function tt(e,t,n){let r=ee.value.getBoundingClientRect(),i=e.getClientRects(),a=i[0]||e.getBoundingClientRect(),o=i[i.length-1]||a,s=a.top-r.top-n-z9,c=s>=0?a.left-r.left:o.right-r.left-t/2;return{left:Math.max(8,Math.min(c,r.width-t-8)),top:s>=0?s:o.bottom-r.top+z9}}function nt(){if(ae.value)return;let e=document.getSelection(),t=e?.rangeCount&&!e.isCollapsed?e.getRangeAt(0):null,n=te.value;if(!t||!ee.value||g.value||!n?.contains(t.startContainer))return;let r=t.toString().replace(/\r/g,``).replace(/\n{3,}/g,`
65
+ `)),O=Q(()=>(h.value?.encoding||`utf-8`).toUpperCase()),k=/^---\r?\n[\s\S]*?\r?\n---[ \t]*(?:\r?\n|$)/,A=[`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `],ee=I(null),j=I(null),te=I(null),ne=I(null),M=I(null),re=I(!1),ie=I(null),ae=I(null),oe=I(``),se=I([]),ce=I(null),le=0,ue=!1,de=()=>n.local_request(`tts-settings`,{}),fe=gW({bridge:n,container:()=>j.value,hosts:`.project-markdown-preview`,voice_for:async()=>{try{return(await de()).file_voice||``}catch{return``}},title:()=>t.value.room?.title||``}),pe=Q(()=>re.value&&b.value===`markdown`&&!g.value&&!!h.value?.text);function me(){de().then(e=>{re.value=!!e.api_key_ref},()=>{re.value=!1})}async function he(e){let t=(e.request||0)+1;Object.assign(e,{request:t,loading:!0,error:``});try{let r=await n.read_room_files(e.room_id,e.path,0,``,e.root||0);e.request===t&&(e.data=r)}catch(n){e.request===t&&(e.error=n.message)}finally{e.request===t&&(e.loading=!1)}}function ge(e,n,r=0){ve();let s=t.value.room?.id;if(!s)return;let c=`${s}\n${r}\n${e}`,l=i.value.find(e=>e.id===c);l||=(i.value.push({id:c,room_id:s,directory:n,root:r,path:e,data:null,loading:!1,error:``,source:!1,scroll:0,request:0}),i.value[i.value.length-1]),a.value=c,o.value=!0,me(),he(l)}let _e=()=>j.value||ne.value;function ve(){f.value&&o.value&&_e()&&(f.value.scroll=_e().scrollTop)}function be(e){e!==a.value&&(ve(),a.value=e)}function xe(e){let t=i.value.findIndex(t=>t.id===e);t<0||(i.value[t].request++,i.value.splice(t,1),e===a.value&&(a.value=i.value[Math.min(t,i.value.length-1)]?.id||``,i.value.length||(o.value=!1)))}function Se(){ve(),o.value=!1}let Ce=I(null),P=I({left:0,top:V9}),we=()=>window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,Te=null,Ee=!1,De=I(`right`),Oe=I(null),ke=null,Ae=null,je=!1;function Me(e){return Math.min(Math.max(e,0),Math.max(0,window.innerHeight-gne))}function Ne(){let e=document.querySelector(`.channel-content`)?.getBoundingClientRect();P.value=e?{left:e.left,top:e.top+dne}:{left:0,top:V9},De.value===`right`&&(P.value.left=window.innerWidth-_ne),ke!==null&&(P.value.top=Me(ke))}let Pe=Q(()=>{if(Oe.value)return{left:`${Oe.value.left}px`,top:`${Oe.value.top}px`};let e=`${P.value.top}px`;return De.value===`right`?{right:`0px`,top:e}:{left:`${P.value.left}px`,top:e}});function Fe(e){if(e.button!==0)return;let t=e.currentTarget.getBoundingClientRect();Ae={x:e.clientX,y:e.clientY,left:t.left,top:t.top,width:t.width,moved:!1}}function Ie(e){if(!Ae)return;let t=e.clientX-Ae.x,n=e.clientY-Ae.y;if(!Ae.moved){if(Math.hypot(t,n)<vne)return;Ae.moved=!0,e.currentTarget.setPointerCapture?.(e.pointerId)}let r=Math.min(Math.max(Ae.left+t,0),Math.max(0,window.innerWidth-Ae.width));Oe.value={left:r,top:Me(Ae.top+n)}}function Le(){if(je=!!Ae?.moved,je&&Oe.value){let{left:e,top:t}=Oe.value;De.value=e+Ae.width/2<window.innerWidth/2?`left`:`right`,ke=t,Ne()}Ae=null,Oe.value=null}function Re(e){je&&(je=!1,e.stopPropagation(),e.preventDefault())}function ze(e,{opacity:t=``,radius:n=``,transition:r=!0}={}){let i=Ce.value;i&&Object.assign(i.style,{transformOrigin:`0 0`,transition:r?`transform ${B9}ms ease, opacity ${B9}ms ease, border-radius ${B9}ms ease`:`none`,transform:e,opacity:t,borderRadius:n})}function Be(e){let t=Math.max(.05,44/e.width);return`translate(${P.value.left-e.left}px, ${P.value.top-e.top}px) scale(${t})`}function Ve(e){if(Ee)return;ve(),Ne();let t=Ce.value,n=()=>{Ee=!1,Se(),typeof e==`function`&&e()};if(!t||we()){n();return}Ee=!0,ze(`none`,{transition:!1});let r=t.getBoundingClientRect();ze(t.dataset.pull||`none`,{transition:!1}),t.getBoundingClientRect(),ze(Be(r),{opacity:`0`,radius:`14px`}),window.setTimeout(n,B9)}async function He(){Ne(),o.value=!0,!we()&&(await ar(),requestAnimationFrame(()=>{let e=Ce.value;e&&(ze(Be(e.getBoundingClientRect()),{opacity:`0`,radius:`14px`,transition:!1}),e.getBoundingClientRect(),ze(``,{}))}))}function Ue(e){if(Te=null,Ee||e.touches.length!==1||!window.matchMedia(`(pointer: coarse)`).matches||ae.value||e.target.closest?.(`input, textarea, .file-selection-offer, .file-listen-dock`))return;let t=document.getSelection();if(t&&!t.isCollapsed)return;let n=_e();if(!e.target.closest?.(`.project-editor-head`)&&!(n?.contains(e.target)&&n.scrollTop<=0))return;let r=e.touches[0];Te={x:r.clientX,y:r.clientY,time:e.timeStamp,distance:0,speed:0,active:!1,height:Ce.value?.offsetHeight||window.innerHeight}}function We(e){if(!Te)return;let t=e.touches[0],n=t.clientX-Te.x,r=t.clientY-Te.y;if(!Te.active){if(r<=0||Math.abs(n)>r){Math.abs(n)+Math.abs(r)>4&&(Te=null);return}Te.active=!0}e.cancelable&&e.preventDefault();let i=Math.max(1,e.timeStamp-Te.time);Te.speed=(r-Te.distance)/i,Te.time=e.timeStamp,Te.distance=Math.max(0,r);let a=1-Math.min(1,Te.distance/Te.height)*hne,o=`translate(${(Ce.value?.offsetWidth||0)*(1-a)/2}px, ${Te.distance}px) scale(${a})`;Ce.value&&(Ce.value.dataset.pull=o),ze(o,{radius:`14px`,transition:!1})}function Ge(){let e=Te;if(Te=null,!e?.active)return;let t=Ce.value;e.distance>e.height*fne||e.speed>pne&&e.distance>mne?Ve():ze(``,{}),t&&delete t.dataset.pull}function Ke(){for(let e of i.value)e.request++;i.value=[],a.value=``,o.value=!1}async function qe(){let e=f.value?.room_id;e&&t.value.room?.id!==e&&(await r(`room`,e),await ar())}async function Je(e){Ve(),await qe(),OW.reveal_root=f.value?.root||0,OW.reveal_path=e,r(`tab`,`files`)}z([o,a,()=>!!h.value],async()=>{o.value&&f.value&&(await ar(),_e()&&(_e().scrollTop=f.value.scroll))});function Ye(){let e=k.exec(h.value?.text||``)?.[0]||``;fe.read_document(te.value,{skip:(e.match(/[\p{L}\p{N}]/gu)||[]).length,heading:v.value})}function Xe(){ie.value=null,window.clearTimeout(le),ue||(le=window.setTimeout(nt,ine))}let Ze=e=>!!e.target.closest?.(`.file-selection-offer`),Qe=e=>{Ze(e)||e.target.closest?.(`.excerpt-mark`)||(ue=!0,ce.value&&at())},$e=e=>{Ze(e)||(ue=!1,Xe())};function et(e){let t=e.commonAncestorContainer,n=[];if(t.nodeType===Node.TEXT_NODE)n.push(t);else for(let e=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);e.nextNode();)n.push(e.currentNode);let r=n.filter(t=>{if(!e.intersectsNode(t))return!1;let n=t===e.startContainer?e.startOffset:0,r=t===e.endContainer?e.endOffset:t.length;return!!t.data.slice(n,r).trim()}),i=e=>e?.parentElement?.closest(`[data-source-lines]`)?.dataset.sourceLines.split(`-`).map(Number),a=i(r[0]),o=i(r[r.length-1]);return a&&o?{start:a[0],end:Math.max(a[0],o[1])}:{start:0,end:0}}function tt(e,t,n){let r=ee.value.getBoundingClientRect(),i=e.getClientRects(),a=i[0]||e.getBoundingClientRect(),o=i[i.length-1]||a,s=a.top-r.top-n-z9,c=s>=0?a.left-r.left:o.right-r.left-t/2;return{left:Math.max(8,Math.min(c,r.width-t-8)),top:s>=0?s:o.bottom-r.top+z9}}function nt(){if(ae.value)return;let e=document.getSelection(),t=e?.rangeCount&&!e.isCollapsed?e.getRangeAt(0):null,n=te.value;if(!t||!ee.value||g.value||!n?.contains(t.startContainer))return;let r=t.toString().replace(/\r/g,``).replace(/\n{3,}/g,`
66
66
 
67
- `).trim();if(!r)return;let i=n.contains(t.endContainer)?NW(n,t.endContainer,t.endOffset):n.textContent.length,a=NW(n,t.startContainer,t.startOffset);ie.value={range:t.cloneRange(),text:r,from:a,to:i,...et(t),touch:window.matchMedia(`(pointer: coarse)`).matches,...tt(t,ine,ane)}}function rt(){let e=te.value,t=j.value;se.value=!o.value||!e||!t?[]:OW.excerpts.flatMap((n,r)=>{let i=!n.message_id&&n.path===m.value?PW(e,t,n.to):null;return i?[{id:n.id,number:r+1,...i}]:[]})}function it(e){ut();let t=OW.excerpts.find(t=>t.id===e),n=t&&FW(te.value,t.from,t.to);n&&(IW(n),ce.value={excerpt:t,...tt(n,cne,lne)})}function at(){ce.value=null,IW(null)}function ot(e){ce.value.excerpt.comment=e,at()}function st(){let{id:e}=ce.value.excerpt;OW.excerpts=OW.excerpts.filter(t=>t.id!==e),at()}function ct(){let{range:e}=ie.value;ie.value=null,document.getSelection()?.removeAllRanges(),fe.read_document(te.value,{selection:e,heading:v.value})}async function lt(){ae.value={...ie.value,...tt(ie.value.range,one,sne)},IW(ie.value.range),ie.value=null,oe.value=``,document.getSelection()?.removeAllRanges(),await ar(),M.value?.focus()}function ut(){ae.value=null,IW(null)}async function dt(){let{text:e,start:t,end:n,from:i,to:a}=ae.value,o={path:m.value,name:v.value,start:t,end:n,text:e,from:i,to:a,comment:oe.value.trim()};ut(),document.getSelection()?.removeAllRanges(),await qe(),r(`tab`,`discussion`),Ve(()=>jW(o))}function ft(e){e.isComposing||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),ut()):e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),dt()))}function pt(e){fe.state.following&&(e.type!==`keydown`||A.includes(e.key))&&(e.type!==`pointerdown`||e.target===e.currentTarget)&&(fe.state.following=!1)}return z([o,a,g,x],()=>{ie.value=null,ut(),at()}),z([o,a,g,x,()=>OW.excerpts.map(e=>e.id).join()],()=>ar(rt),{flush:`post`}),z([a,g,x],()=>{fe.state.message_id&&fe.stop()}),z(te,e=>{e&&(fe.rebind_document(e),ar(rt))}),aa(()=>{OW.open=ge,Ne(),window.addEventListener(`resize`,Ne),s.addEventListener(`change`,u),window.addEventListener(`resize`,rt),document.addEventListener(`selectionchange`,Xe),document.addEventListener(`pointerdown`,Qe),document.addEventListener(`pointerup`,$e),document.addEventListener(`pointercancel`,$e)}),ca(()=>{OW.open===ge&&(OW.open=null),window.removeEventListener(`resize`,Ne),s.removeEventListener(`change`,u),window.removeEventListener(`resize`,rt),IW(null);for(let e of i.value)e.request++;document.removeEventListener(`selectionchange`,Xe),document.removeEventListener(`pointerdown`,Qe),document.removeEventListener(`pointerup`,$e),document.removeEventListener(`pointercancel`,$e),window.clearTimeout(le),fe.dispose()}),(e,t)=>{let n=Yk,r=bA,s=$B,u=ya(`keep-reading`);return W(),G(U,null,[J(s,{open:o.value,title:v.value,description:p.value,content:{onInteractOutside:e=>e.preventDefault()},ui:{content:`project-editor`},"onUpdate:open":t[12]||=e=>e?o.value=!0:Ve()},{content:R(()=>[q(`div`,{ref_key:`frame`,ref:Ce,class:`project-editor-frame`,onTouchstartPassive:Ue,onTouchmove:We,onTouchend:Ge,onTouchcancel:Ge},[q(`div`,Ste,[q(`div`,Cte,[(W(!0),G(U,null,V(i.value,e=>(W(),G(`div`,{key:e.id,class:N([`project-editor-tab`,{"is-active":e.id===a.value}]),title:e.path},[q(`button`,{type:`button`,role:`tab`,class:`project-editor-tab-name`,"aria-selected":e.id===a.value,onClick:t=>be(e.id)},[J(n,{name:L(WW)(d(e.path))[1],class:N([`project-file-icon`,L(WW)(d(e.path))[2]])},null,8,[`name`,`class`]),q(`span`,null,F(d(e.path)),1)],8,Tte),q(`button`,{type:`button`,class:`project-editor-tab-close`,"aria-label":`关闭 ${d(e.path)}`,title:`关闭`,onClick:t=>xe(e.id)},[J(n,{name:`i-lucide-x`})],8,Ete)],10,wte))),128))]),q(`div`,Dte,[w.value?(W(),K(r,{key:0,icon:`i-lucide-wrap-text`,color:`neutral`,variant:c.value?`soft`:`ghost`,size:`sm`,"aria-pressed":c.value,title:c.value?`关闭自动换行`:`自动换行`,"aria-label":`自动换行`,onClick:t[0]||=e=>c.value=!c.value},null,8,[`variant`,`aria-pressed`,`title`])):X(``,!0),pe.value?(W(),K(r,{key:1,icon:L(fe).state.reading?`i-lucide-square`:`i-lucide-volume-2`,color:`neutral`,variant:`ghost`,size:`sm`,title:L(fe).state.reading?`停止朗读`:`朗读`,"aria-label":L(fe).state.reading?`停止朗读`:`从头朗读此文件`,onClick:t[1]||=e=>L(fe).state.reading?L(fe).stop():Ye()},null,8,[`icon`,`title`,`aria-label`])):X(``,!0),C.value?(W(),G(`div`,Ote,[q(`button`,{type:`button`,"aria-pressed":!g.value,title:`预览`,onClick:t[2]||=e=>g.value=!1},[J(n,{name:`i-lucide-eye`,class:`project-mode-icon`}),t[13]||=q(`span`,null,`预览`,-1)],8,kte),q(`button`,{type:`button`,"aria-pressed":g.value,title:`源码`,onClick:t[3]||=e=>g.value=!0},[J(n,{name:`i-lucide-code-xml`,class:`project-mode-icon`}),t[14]||=q(`span`,null,`源码`,-1)],8,Ate)])):X(``,!0)]),q(`div`,jte,[J(r,{icon:l.value?`i-lucide-chevron-down`:`i-lucide-minus`,color:`neutral`,variant:`ghost`,size:`sm`,title:`收起为悬浮窗(手机上也可下拉收起)`,"aria-label":`收起预览`,onClick:Ve},null,8,[`icon`]),!l.value||i.value.length>1?(W(),K(r,{key:0,icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`sm`,title:i.value.length>1?`关闭全部文件`:`关闭预览`,"aria-label":i.value.length>1?`关闭全部文件`:`关闭预览`,onClick:Ke},null,8,[`title`,`aria-label`])):X(``,!0)]),q(`nav`,Mte,[(W(!0),G(U,null,V(_.value,(e,t)=>(W(),G(U,{key:e.path},[t?(W(),K(n,{key:0,name:`i-lucide-chevron-right`,class:`project-crumb-separator`})):X(``,!0),t<_.value.length-1?(W(),G(`button`,{key:1,type:`button`,title:`在列表中打开此文件夹`,onClick:t=>Je(e.path)},F(e.name),9,Nte)):(W(),G(`span`,Pte,[J(n,{name:y.value[1],class:N([`project-file-icon`,y.value[2]])},null,8,[`name`,`class`]),Y(F(e.name),1)]))],64))),128))])]),h.value?.truncated?(W(),G(`p`,Fte,[J(n,{name:`i-lucide-info`}),Y(`文件较大,仅显示前 `+F(L(KW)(h.value.limit))+`(共 `+F(L(KW)(h.value.size))+`)`,1),b.value===`html`?(W(),G(U,{key:0},[Y(`,HTML 不渲染不完整的内容`)],64)):X(``,!0)])):C.value&&!g.value&&b.value===`html`?(W(),G(`p`,Ite,[J(n,{name:`i-lucide-shield`}),t[15]||=Y(`静态预览:脚本、外部样式与外部图片不加载`,-1)])):X(``,!0),q(`div`,{ref_key:`editor_body`,ref:ee,class:`project-editor-body`},[f.value?.loading&&!h.value?(W(),G(`div`,Lte,[J(n,{name:`i-lucide-loader-circle`,class:`animate-spin`}),t[16]||=Y(`正在读取文件…`,-1)])):f.value?.error&&!h.value?(W(),G(`div`,Rte,[J(n,{name:`i-lucide-circle-alert`}),q(`p`,null,F(f.value.error),1),J(r,{label:`重试`,color:`neutral`,variant:`outline`,size:`sm`,onClick:t[4]||=e=>he(f.value)})])):h.value?.text===null?(W(),G(`div`,zte,[J(n,{name:y.value[1]},null,8,[`name`]),q(`p`,null,F(h.value.reason),1)])):w.value&&c.value?(W(),G(`div`,{key:3,ref_key:`code_scroll`,ref:ne,class:`project-code is-wrapped`,tabindex:`0`,"aria-label":`文件内容`,style:ye({"--digits":String(E.value).length})},[(W(!0),G(U,null,V(T.value,(e,t)=>(W(),G(`div`,{key:t,class:`project-code-row`},[q(`span`,Bte,F(t+1),1),q(`span`,Vte,F(e),1)]))),128))],4)):w.value?Tr((W(),G(`div`,{key:4,ref_key:`code_scroll`,ref:ne,class:`project-code`,tabindex:`0`,"aria-label":`文件内容`},[q(`pre`,Hte,F(D.value),1),q(`pre`,Ute,[q(`code`,null,F(h.value.text),1)])])),[[u]]):h.value&&b.value===`html`?(W(),G(`iframe`,{key:5,class:`project-html-preview`,sandbox:``,referrerpolicy:`no-referrer`,srcdoc:S.value,title:`HTML 文件预览`},null,8,Wte)):h.value?Tr((W(),G(`div`,{key:6,ref_key:`markdown_scroll`,ref:j,class:`project-markdown-scroll`,tabindex:`0`,onScrollPassive:Xe,onWheelPassive:pt,onTouchmovePassive:pt,onKeydown:pt,onPointerdown:pt},[q(`div`,{ref_key:`markdown_body`,ref:te,class:`markdown-body project-markdown-preview`,innerHTML:x.value},null,8,Gte),(W(!0),G(U,null,V(se.value,e=>(W(),G(`button`,{key:e.id,type:`button`,class:`excerpt-mark`,style:ye({left:`${e.left}px`,top:`${e.top}px`}),title:`摘录 ${e.number}:点击修改批注`,"aria-label":`修改摘录 ${e.number} 的批注`,onClick:t=>it(e.id)},F(e.number),13,Kte))),128))],32)),[[u]]):X(``,!0),ce.value?(W(),K(DW,{key:ce.value.excerpt.id,class:`file-selection-offer file-comment`,comment:ce.value.excerpt.comment,style:ye({left:`${ce.value.left}px`,top:`${ce.value.top}px`}),onSave:ot,onCancel:at,onRemove:st},null,8,[`comment`,`style`])):X(``,!0),ie.value&&!ie.value.touch?(W(),G(`div`,{key:8,class:`file-selection-offer file-offer-marks`,style:ye({left:`${ie.value.left}px`,top:`${ie.value.top}px`})},[q(`button`,{type:`button`,class:`channel-listen-mark`,title:`把选中的文字作为摘录添加到对话`,onMousedown:t[5]||=_u(()=>{},[`prevent`]),onClick:lt},[J(n,{name:`i-lucide-message-square-quote`}),t[17]||=Y(`添加到对话`,-1)],32),pe.value?(W(),G(`button`,{key:0,type:`button`,class:`channel-listen-mark`,title:`从选中处开始朗读`,"aria-label":`从选中处开始朗读`,onMousedown:t[6]||=_u(()=>{},[`prevent`]),onClick:ct},[J(n,{name:`i-lucide-headphones`}),t[18]||=Y(`朗读`,-1)],32)):X(``,!0)],4)):X(``,!0),ae.value?(W(),G(`form`,{key:9,class:N([`file-selection-offer selection-comment file-comment`,{"is-docked":ae.value.touch}]),style:ye(ae.value.touch?{}:{left:`${ae.value.left}px`,top:`${ae.value.top}px`}),onSubmit:_u(dt,[`prevent`])},[Tr(q(`input`,{ref_key:`comment_input`,ref:M,"onUpdate:modelValue":t[7]||=e=>oe.value=e,type:`text`,placeholder:`添加批注(可选)`,"aria-label":`摘录的批注(可选)`,enterkeyhint:`send`,onKeydown:ft},null,544),[[nu,oe.value]]),q(`button`,{type:`button`,class:`selection-comment-cancel`,"aria-label":`取消添加`,title:`取消`,onClick:ut},[J(n,{name:`i-lucide-x`})]),q(`button`,qte,[J(n,{name:`i-lucide-arrow-up`})])],38)):X(``,!0),ie.value?.touch&&!ae.value||L(fe).state.message_id?(W(),G(`div`,Jte,[ie.value?.touch?(W(),G(`button`,{key:0,type:`button`,class:`channel-listen-pill file-selection-offer`,onMousedown:t[8]||=_u(()=>{},[`prevent`]),onClick:lt},[J(n,{name:`i-lucide-message-square-quote`}),t[19]||=Y(`添加到对话`,-1)],32)):X(``,!0),ie.value?.touch&&pe.value?(W(),G(`button`,{key:1,type:`button`,class:`channel-listen-pill file-selection-offer`,"aria-label":`从选中处开始朗读`,onMousedown:t[9]||=_u(()=>{},[`prevent`]),onClick:ct},[J(n,{name:`i-lucide-headphones`}),t[20]||=Y(`听当前`,-1)],32)):X(``,!0),L(fe).state.message_id?(W(),G(`button`,{key:2,type:`button`,class:N([`channel-listen-pill`,{"is-on":L(fe).state.following}]),"aria-pressed":L(fe).state.following,title:L(fe).state.following?`手动滚动即取消跟随`:`页面跟随朗读位置滚动`,onClick:t[10]||=e=>L(fe).state.following?L(fe).state.following=!1:L(fe).follow()},[J(n,{name:`i-lucide-locate-fixed`}),Y(F(L(fe).state.following?`跟随中`:`跟随`),1)],10,Yte)):X(``,!0),L(fe).state.reading?(W(),G(`button`,{key:3,type:`button`,class:`channel-listen-pill`,"aria-label":`退出朗读`,onClick:t[11]||=e=>L(fe).stop()},[J(n,{name:`i-lucide-square`}),t[21]||=Y(`退出`,-1)])):X(``,!0)])):X(``,!0)],512),q(`footer`,Xte,[h.value?(W(),G(`span`,{key:0,class:`project-editor-modified`,title:h.value.modified_at},`修改于 `+F(L(qW)(h.value.modified_at)),9,Zte)):X(``,!0),t[22]||=q(`span`,{class:`project-editor-status-spacer`},null,-1),h.value?.text==null?X(``,!0):(W(),G(U,{key:1},[q(`span`,null,F(E.value)+` 行`,1),q(`span`,Qte,F(O.value),1)],64)),h.value?(W(),G(`span`,$te,F(L(KW)(h.value.size)),1)):X(``,!0),q(`span`,null,F(y.value[0]),1)])],544)]),_:1},8,[`open`,`title`,`description`,`content`]),(W(),K(Yr,{to:`body`},[i.value.length&&!o.value?(W(),G(`div`,{key:0,class:N([`file-float`,{"is-right":De.value===`right`&&!Oe.value,"is-dragging":Oe.value}]),style:ye(Pe.value),onPointerdown:Fe,onPointermove:Ie,onPointerup:Le,onPointercancel:Le,onClickCapture:Re},[q(`button`,{type:`button`,class:`file-float-open`,title:i.value.length>1?`回到文件预览(${i.value.length} 个文件)`:`回到文件预览:${v.value}`,onClick:He},[J(n,{name:y.value[1],class:N([`project-file-icon`,y.value[2]])},null,8,[`name`,`class`]),q(`span`,tne,F(v.value),1),i.value.length>1?(W(),G(`span`,nne,F(i.value.length),1)):X(``,!0)],8,ene),q(`button`,{type:`button`,class:`file-float-close`,"aria-label":`关闭全部文件预览`,title:`关闭`,onClick:Ke},[J(n,{name:`i-lucide-x`})])],38)):X(``,!0)]))],64)}}},[[`__scopeId`,`data-v-56d428a2`]]),yne=[`aria-valuemax`,`aria-valuenow`,`aria-valuetext`],bne={class:`channel-main`},xne={class:`channel-header`},Sne={class:`channel-title-icon`},Cne={class:`channel-title`},wne={class:`channel-title-copy`},Tne=[`title`],Ene={key:2,class:`channel-header-context`},Dne=[`datetime`,`title`],One={class:`channel-header-actions`},kne=[`title`,`aria-label`],Ane={key:0,class:`channel-work-avatars`},jne={class:`channel-work-text`,role:`status`},Mne={key:0,class:`channel-launch-recovery`,"aria-label":`未完成的创建或启动请求`},Nne={role:`status`},Pne={class:`button-row`},Fne={key:1,class:`channel-tabbar`},Ine={class:`channel-brief-inner`},Lne={class:`channel-brief-heading`},Rne=[`aria-label`,`aria-expanded`],zne={key:0,class:`channel-brief-preview`},Bne={id:`channel-brief-content`,class:`channel-brief-content`},Vne=[`innerHTML`],Hne={class:`channel-brief-footer`},Une={key:0,class:`channel-brief-status`},Wne={class:`channel-content`},Gne={key:0,class:`content-page merged-page`,role:`tabpanel`,"aria-label":`房间`},Kne={key:1,class:`content-page merged-page`,role:`tabpanel`,"aria-label":`执行`},qne={class:`timeline-switch`,role:`group`,"aria-label":`执行视图`},Jne={key:2,class:`content-page`,role:`tabpanel`,"aria-label":`文件`},Yne={key:1,class:`channel-files-unset`,role:`status`},Xne={key:3,class:`content-page private-page`},Zne={key:1,class:`channel-empty`},Qne={class:`merged-page channel-consensus-body`},$ne={class:`merged-section channel-summary`,"aria-label":`当前共识`},ere={class:`page-heading`},tre={class:`form-footer`},nre={class:`button-row`},rre={class:`consensus-card is-brief`},ire=[`innerHTML`],are={key:0,class:`consensus-card`},ore=[`innerHTML`],sre={key:2,class:`fine-print`},cre=[`aria-valuenow`,`aria-valuetext`],lre={key:4,id:`channel-member-rail`,class:`channel-member-rail`,"aria-label":`当前焦点与讨论进度`},ure={class:`channel-rail-board`},dre={key:1,class:`progress-board is-docked`},H9=`ai-codiscuss-channel-layout`,U9=220,W9=440,G9=280,K9=16,q9=180,J9=400,Y9=248,X9=16,fre=480,pre=1200,Z9=0,mre=4,hre={__name:`ChannelWorkspace`,setup(e){let{view:t,bridge:n,field:r,act:i,pending:a}=Or(`discussion`),o=Q(()=>t.value.room),s=Q(()=>{let e=new Date(o.value?.created_at||``);return Number.isNaN(e.getTime())?``:`创建于 ${e.getFullYear()===new Date().getFullYear()?``:`${e.getFullYear()}年`}${e.getMonth()+1}月${e.getDate()}日`}),c=[{value:`waterfall`,label:`瀑布`},{value:`events`,label:`事件`}],l=I(`waterfall`),u=I(``),d=I(null),f=I(null),p=I(null),m=I(!1),h=I(!1),g=r(`state-input`),_=r(`brief-input`),v=r(`search-input`),y=[{value:`full`,label:`完整`},{value:`reduced`,label:`精简`}],b={narrow:{label:`窄`,width:720},default:{label:`默认`,width:960},wide:{label:`宽`,width:1240}},x=Re(),S=I(x.reading),C=I(x.effects),w=I(x.rail),T=I(x.nav),E=I(typeof window>`u`?728:window.innerWidth),D=I(x.collapsed),O=I(!0),k=I(x.rail_collapsed),A=Q(()=>E.value>=pre),ee=Q(()=>A.value&&!D.value),j=Q(()=>t.value.tab===`discussion`&&!k.value),te=Q(()=>A.value&&t.value.tab===`discussion`?k.value?`展开房间概览`:`收起房间概览`:`讨论进度`),ne=[`dispatched`,`started`],M=Q(()=>{let e=(o.value?.free?.members||[]).filter(U3),t=e=>e.execution?.stale?`执行失联`:ne.includes(e.execution?.status)?`执行中`:`待投递`;return e.length?{tone:e.some(e=>e.execution?.stale)?`error`:`primary`,text:e.length===1?`${n.display_name(e[0].name)} ${t(e[0])}`:`${e.length} 位执行中`,members:e.slice(0,mre),title:e.map(e=>`${n.display_name(e.name)} ${t(e)}`).join(`
68
- `)}:{tone:`success`,text:`空闲`,members:[],title:`空闲`}}),re=Q(()=>!!o.value&&!o.value.archived&&!(A.value&&j.value)),ie=Q(()=>{let e=document.createElement(`template`);return e.innerHTML=o.value?.rendered_brief||``,e.content.textContent.replace(/\s+/g,` `).trim()}),ae=I(null),oe=I(0),se=null,ce=I(null),le=I(null),ue=Q(()=>Math.min(J9,Math.max(q9,E.value-fre-Z9))),de=Q(()=>Math.min(T.value,ue.value)),fe=Q(()=>({"--channel-reading-width":`${b[S.value].width}px`,"--channel-rail-width":`${w.value}px`,"--channel-topbar-height":`${oe.value}px`,"--channel-main-columns":ee.value?`${de.value}px ${Z9}px minmax(0, 1fr)`:`minmax(0, 1fr)`})),pe=Object.entries(b).map(([e,t])=>({value:e,label:t.label}));z(S,Be),z(C,e=>{document.documentElement.dataset.effects=e,Be()},{immediate:!0}),z(D,Be),z(k,Be),aa(()=>window.addEventListener(`resize`,He)),ca(()=>window.removeEventListener(`resize`,He)),aa(()=>document.addEventListener(`pointerdown`,We)),aa(()=>{for(let e of[`pointerup`,`pointercancel`])document.addEventListener(e,Ge)}),ca(()=>{for(let e of[`pointerup`,`pointercancel`])document.removeEventListener(e,Ge)}),aa(()=>{se=new ResizeObserver(([e])=>{O.value&&(oe.value=Math.round(e.target.offsetHeight))}),se.observe(ae.value)}),ca(()=>se?.disconnect()),ca(()=>document.removeEventListener(`pointerdown`,We));let me=Q({get:()=>t.value.tab,set:e=>i(`tab`,e)}),he=Q(()=>t.value.launch.room_models?.room_id===o.value?.id&&t.value.launch.room_models?.project_directory||``),ge=Q(e=>{let n=he.value?[he.value,...t.value.launch.room_models?.extra_directories||[]]:[];return e?.length===n.length&&n.every((t,n)=>Object.is(t,e[n]))?e:n}),_e=Q(()=>[{value:`discussion`,label:`消息`,icon:`i-lucide-message-square`},{value:`timeline`,label:`执行`,icon:`i-lucide-chart-gantt`},{value:`private`,label:`私聊`,icon:`i-lucide-messages-square`},{value:`overview`,label:`房间`,icon:`i-lucide-sliders-horizontal`},{value:`files`,label:`文件`,icon:`i-lucide-files`,title:he.value||``}]),ve={context:`discussion`,history:`discussion`,access:`overview`},be=Q(()=>![`active`,`paused`].includes(o.value?.session?.status));z(()=>ve[t.value.tab],e=>{e&&i(`tab`,e)},{immediate:!0});let xe=Q(()=>!!o.value&&(!be.value||!!o.value.host_brief?.text||!!o.value.state_text||!!o.value.discussions?.length)),Se=I(!1),Ce=I(!1),P=Q(()=>o.value?.state_text?n.render_room_markdown(o.value.state_text):``);z(()=>o.value?.id,()=>{Se.value=!1,Ce.value=!1});function we(e=!1){O.value=!0,Ce.value=e,Se.value=!0}function Te(e){Se.value=!1,u.value=e}function Ee(e){Se.value=!1,Me(e)}async function De(){await i(`save_context`)&&(Ce.value=!1)}function Oe({room:e,action:t}){d.value=e,m.value=!1,u.value=t}function ke(){m.value=!1,u.value=`archives`}function Ae(e){m.value=!1,i(`tab`,e)}async function je(e){m.value=!1,await i(`room`,e)}function Me(e){p.value=e,u.value=`message`}function Ne(e=null){n.reset_create_form(),f.value=e,m.value=!1,u.value=`create`}function Pe(){f.value=null,m.value=!1,u.value=`folder`}function Fe(e){f.value=e,m.value=!1,u.value=`rename-folder`}function Ie(e){f.value=e,m.value=!1,u.value=`delete-folder`}function Le(e){f.value=e,m.value=!1,u.value=`archive-folder`}function Re(){try{let e=JSON.parse(localStorage.getItem(H9))||{};return{reading:Object.hasOwn(b,e.reading)?e.reading:`default`,effects:e.effects===`reduced`?`reduced`:`full`,rail:Number.isFinite(e.rail)?Math.min(W9,Math.max(U9,e.rail)):G9,nav:Number.isFinite(e.nav)?Math.min(J9,Math.max(q9,e.nav)):ze(),collapsed:e.collapsed===!0,brief_collapsed:e.brief_collapsed===!0,rail_collapsed:e.rail_collapsed===!0}}catch{return{reading:`default`,effects:`full`,rail:G9,nav:ze(),collapsed:!1,brief_collapsed:!1,rail_collapsed:!1}}}function ze(){return typeof window>`u`?Y9:window.innerWidth>=1900?280:window.innerWidth<=980?220:Y9}function Be(){try{localStorage.setItem(H9,JSON.stringify({reading:S.value,effects:C.value,rail:w.value,nav:T.value,collapsed:D.value,brief_collapsed:O.value,rail_collapsed:k.value}))}catch{}}function Ve(){A.value&&t.value.tab===`discussion`?k.value=!k.value:h.value=!0}function He(){E.value=window.innerWidth}function Ue(){O.value=!O.value}function We(e){!O.value&&!e.target.closest?.(`.channel-host-brief`)&&(O.value=!0)}function Ge(e){e.pointerType===`touch`&&e.target.closest?.(`.channel-drawer-overlay`)&&(m.value=!1,h.value=!1)}function Ke(e){e.button===0&&(e.preventDefault(),e.currentTarget.focus(),ce.value={pointer:e.pointerId,x:e.clientX,width:w.value},e.currentTarget.setPointerCapture(e.pointerId))}function qe(e){ce.value?.pointer===e.pointerId&&(w.value=Math.round(Math.min(W9,Math.max(U9,ce.value.width+ce.value.x-e.clientX))))}function Je(e){ce.value?.pointer===e.pointerId&&(ce.value=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),Be())}function Ye(e){let t={ArrowLeft:w.value+K9,ArrowRight:w.value-K9,Home:U9,End:W9};Object.hasOwn(t,e.key)&&(e.preventDefault(),w.value=Math.min(W9,Math.max(U9,t[e.key])),Be())}function Xe(e){e.button===0&&(e.preventDefault(),e.currentTarget.focus(),le.value={pointer:e.pointerId,x:e.clientX,width:de.value},e.currentTarget.setPointerCapture(e.pointerId))}function Ze(e){le.value?.pointer===e.pointerId&&(T.value=Math.round(Math.min(ue.value,Math.max(q9,le.value.width+e.clientX-le.value.x))))}function Qe(e){le.value?.pointer===e.pointerId&&(le.value=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),Be())}function $e(e){let t={ArrowLeft:de.value-X9,ArrowRight:de.value+X9,Home:q9,End:ue.value};Object.hasOwn(t,e.key)&&(e.preventDefault(),T.value=Math.min(ue.value,Math.max(q9,t[e.key])),Be())}return(e,r)=>{let b=bA,x=yV,T=Yk,E=uV,k=tA,ne=hV,oe=fV,se=cV,ve=aV,Re=$B,ze=ZB,Be=ya(`keep-reading`);return W(),G(`div`,{class:N([`channel-shell`,{"channel-resizing":ce.value||le.value,"channel-nav-collapsed":!ee.value,"channel-has-rail":j.value}]),style:ye(fe.value)},[ee.value?(W(),K(G4,{key:0,tabs:_e.value,onSelect:je,onManage:Oe,onCreate:Ne,onCreateFolder:Pe,onManageFolder:Fe,onDeleteFolder:Ie,onArchiveFolder:Le,onArchives:ke,onTab:Ae,onSettings:r[0]||=e=>u.value=`settings`},null,8,[`tabs`])):X(``,!0),ee.value?(W(),G(`div`,{key:1,class:`channel-nav-resizer`,role:`separator`,tabindex:`0`,"aria-label":`调整房间栏宽度`,"aria-orientation":`vertical`,"aria-controls":`channel-sidebar`,"aria-valuemin":q9,"aria-valuemax":ue.value,"aria-valuenow":de.value,"aria-valuetext":`${de.value} 像素`,title:`拖动调整房间栏宽度,也可使用方向键`,onPointerdown:Xe,onPointermove:Ze,onPointerup:Qe,onPointercancel:Qe,onLostpointercapture:Qe,onKeydown:$e},null,40,yne)):X(``,!0),q(`main`,bne,[q(`div`,{ref_key:`topbar`,ref:ae,class:N([`channel-topbar`,{"is-overlay":o.value&&L(t).tab===`discussion`}])},[q(`header`,xne,[A.value?(W(),K(x,{key:0,text:D.value?`展开房间栏`:`收起房间栏`},{default:R(()=>[J(b,{icon:`i-lucide-panel-left`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-desktop-nav channel-icon-button channel-panel-toggle`,"aria-label":D.value?`展开房间栏`:`收起房间栏`,"aria-expanded":!D.value,"aria-controls":`channel-sidebar`,onClick:r[1]||=e=>D.value=!D.value},null,8,[`aria-label`,`aria-expanded`])]),_:1},8,[`text`])):(W(),K(b,{key:1,icon:`i-lucide-panel-left`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-mobile-nav channel-icon-button channel-panel-toggle`,"aria-label":`打开房间导航`,"aria-expanded":m.value,onClick:r[2]||=e=>m.value=!0},null,8,[`aria-expanded`])),q(`span`,Sne,[J(T,{name:`i-lucide-hash`})]),q(`div`,Cne,[q(`div`,wne,[q(`h1`,{title:o.value?.title},F(o.value?.title||`共议`),9,Tne)]),o.value?.archived?(W(),K(E,{key:0,color:`neutral`,variant:`subtle`,size:`sm`},{default:R(()=>[...r[25]||=[Y(`已存档`,-1)]]),_:1})):X(``,!0)]),o.value?(W(),G(`span`,Ene,[Y(F(_e.value.find(e=>e.value===L(t).tab)?.label),1),r[27]||=q(`span`,null,`·`,-1),Y(F(o.value.message_count)+` 条记录`,1),s.value?(W(),G(U,{key:0},[r[26]||=q(`span`,null,`·`,-1),q(`time`,{datetime:o.value.created_at,title:new Date(o.value.created_at).toLocaleString(`zh-CN`,{hour12:!1})},F(s.value),9,Dne)],64)):X(``,!0)])):X(``,!0),q(`div`,One,[re.value?(W(),G(`button`,{key:0,type:`button`,class:N([`channel-work-status`,`is-${M.value.tone}`]),title:M.value.title,"aria-label":`执行状态:${M.value.title.replaceAll(`
69
- `,`,`)};打开房间概览`,onClick:Ve},[M.value.members.length?(W(),G(`span`,Ane,[(W(!0),G(U,null,V(M.value.members,e=>(W(),K(k,{key:e.id,src:L(n).identities[e.name]?.icon,text:L(n).identities[e.name]?.initials,alt:e.name,size:`2xs`,class:N([`channel-avatar`,L(n).identities[e.name]?.style])},null,8,[`src`,`text`,`alt`,`class`]))),128))])):X(``,!0),r[28]||=q(`span`,{class:`pb-dot`},null,-1),q(`span`,jne,F(M.value.text),1)],10,kne)):X(``,!0),L(t).tab===`discussion`?(W(),G(`form`,{key:1,class:`channel-search`,onSubmit:r[5]||=_u(e=>L(i)(`filter`,{query:L(v)}),[`prevent`])},[J(ne,{modelValue:L(v),"onUpdate:modelValue":r[4]||=e=>gn(v)?v.value=e:null,icon:`i-lucide-search`,variant:`none`,size:`sm`,placeholder:`搜索消息`,"aria-label":`搜索讨论记录`,disabled:!o.value,class:`channel-search-input`},{trailing:R(()=>[L(v)||L(t).query?(W(),K(b,{key:0,icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`清除搜索`,onClick:r[3]||=e=>{v.value=``,L(i)(`filter`,{query:``})}})):X(``,!0),J(b,{type:`submit`,icon:`i-lucide-corner-down-left`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`搜索`,disabled:!o.value},null,8,[`disabled`])]),_:1},8,[`modelValue`,`disabled`])],32)):X(``,!0),L(t).tab===`discussion`?(W(),K(x,{key:2,text:`只看主持:主持人的发言与主持说明(含讨论总结)`},{default:R(()=>[J(b,{icon:`i-lucide-crown`,variant:L(t).host_only?`soft`:`ghost`,color:`neutral`,size:`sm`,class:`channel-icon-button channel-host-filter`,"aria-pressed":L(t).host_only,"aria-label":`只看主持`,disabled:!o.value,onClick:r[6]||=e=>L(i)(`filter`,{host:!L(t).host_only})},null,8,[`variant`,`aria-pressed`,`disabled`])]),_:1})):X(``,!0)]),J(x,{text:te.value},{default:R(()=>[J(b,{icon:`i-lucide-panel-right`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-icon-button channel-panel-toggle channel-info-button`,"aria-label":te.value,disabled:!o.value&&!(A.value&&L(t).tab===`discussion`),"aria-expanded":A.value&&L(t).tab===`discussion`?j.value:h.value,onClick:Ve},null,8,[`aria-label`,`disabled`,`aria-expanded`])]),_:1},8,[`text`])]),L(t).launch.recoveries.length?(W(),G(`section`,Mne,[r[29]||=q(`h2`,null,`继续未完成的请求`,-1),(W(!0),G(U,null,V(L(t).launch.recoveries,e=>(W(),G(`article`,{key:e.id},[q(`strong`,null,F(e.title),1),q(`p`,Nne,F(e.error||`启动结果尚未确认;原请求已保存在此浏览器中。`),1),q(`div`,Pne,[J(b,{label:e.direct?`继续创建房间`:`继续本次启动`,size:`sm`,loading:L(a)===`resume_launch`,disabled:!!L(a),onClick:t=>L(i)(`resume_launch`,e.id)},null,8,[`label`,`loading`,`disabled`,`onClick`]),e.room_id?(W(),K(b,{key:0,label:`查看原房间`,color:`neutral`,variant:`outline`,size:`sm`,onClick:t=>L(i)(`room`,e.room_id)},null,8,[`onClick`])):X(``,!0),J(b,{label:`移除待办`,color:`neutral`,variant:`ghost`,size:`sm`,disabled:!!L(a),onClick:t=>L(i)(`discard_launch`,e.id)},null,8,[`disabled`,`onClick`])])]))),128)),r[30]||=q(`small`,null,`移除待办不会删除房间或停止讨论。`,-1)])):X(``,!0),o.value?(W(),G(`div`,Fne,[J(oe,{modelValue:me.value,"onUpdate:modelValue":r[7]||=e=>me.value=e,items:_e.value,content:!1,variant:`pill`,color:`neutral`,size:`sm`,class:`channel-tabs`,"aria-label":`房间视图`},null,8,[`modelValue`,`items`])])):X(``,!0),xe.value?(W(),G(`section`,{key:2,class:N([`channel-host-brief`,{"is-collapsed":O.value}]),"aria-label":`主持简报`},[q(`div`,Ine,[q(`div`,Lne,[q(`button`,{type:`button`,class:`channel-brief-toggle`,"aria-label":O.value?`展开主持简报`:`收起主持简报`,"aria-expanded":!O.value,"aria-controls":`channel-brief-content`,onClick:Ue},[J(T,{name:O.value?`i-lucide-chevron-right`:`i-lucide-chevron-down`},null,8,[`name`]),q(`strong`,null,`主持简报`+F(O.value?`:`:``),1),O.value?(W(),G(`span`,zne,F(ie.value),1)):X(``,!0)],8,Rne),O.value?X(``,!0):(W(),G(U,{key:0},[J(b,{label:`详细共识与讨论记录`,color:`neutral`,variant:`link`,size:`xs`,class:`channel-brief-update`,onClick:r[8]||=e=>we()}),J(b,{label:`编辑`,color:`neutral`,variant:`link`,size:`xs`,class:`channel-brief-update`,onClick:r[9]||=e=>we(!0)})],64))]),Tr(q(`div`,Bne,[q(`div`,{class:`channel-brief-text markdown-body`,innerHTML:o.value.rendered_brief},null,8,Vne),q(`div`,Hne,[be.value?X(``,!0):(W(),G(`span`,Une,F(L(n).progress_speaker(o.value)),1)),q(`small`,null,F(L(n).brief_meta(o.value)),1)])],512),[[Jc,!O.value]])])],2)):X(``,!0)],2),o.value?(W(),G(`div`,{key:0,class:N([`channel-body`,{"channel-body-discussion":L(t).tab===`discussion`}])},[q(`div`,Wne,[Tr(J(nY,{onDetail:Me,onEdit:r[10]||=e=>u.value=`edit`},null,512),[[Jc,L(t).tab===`discussion`]]),L(t).tab===`overview`?Tr((W(),G(`div`,Gne,[J(O8),be.value?X(``,!0):(W(),K(xY,{key:0,section:`access`,onOpen:r[11]||=e=>u.value=e,onDetail:Me}))])),[[Be]]):X(``,!0),L(t).tab===`timeline`?Tr((W(),G(`div`,Kne,[q(`div`,qne,[(W(),G(U,null,V(c,e=>J(b,{key:e.value,label:e.label,size:`xs`,color:`neutral`,variant:l.value===e.value?`soft`:`ghost`,"aria-pressed":l.value===e.value,onClick:t=>l.value=e.value},null,8,[`label`,`variant`,`aria-pressed`,`onClick`])),64))]),l.value===`waterfall`?(W(),K(K7,{key:0,onDetail:Me})):(W(),K(y9,{key:1,onDetail:Me}))])),[[Be]]):X(``,!0),L(t).tab===`files`?Tr((W(),G(`div`,Jne,[he.value?(W(),K(F9,{key:o.value.id,directories:ge.value},null,8,[`directories`])):(W(),G(`p`,Yne,`当前未设置项目目录`))])),[[Be]]):X(``,!0),L(t).tab===`private`?Tr((W(),G(`div`,Xne,[(W(),K(xte,{key:o.value.id}))])),[[Be]]):X(``,!0),J(vne)])],2)):(W(),G(`div`,Zne,[J(T,{name:`i-lucide-hash`}),r[31]||=q(`h2`,null,`新建一个协作房间`,-1),r[32]||=q(`p`,null,`邀请 AI 一起协作,随时 @ 提问;需要时开启讨论,保留所有人的观点。`,-1),J(b,{icon:`i-lucide-plus`,label:`新建房间`,color:`neutral`,onClick:r[12]||=e=>Ne()})]))]),o.value?(W(),K(Re,{key:2,content:{onInteractOutside:e=>e.preventDefault()},open:Se.value,"onUpdate:open":r[18]||=e=>Se.value=e,title:`共识与讨论记录`,description:`主持人整理的结论、共识与分歧,以及每场讨论结束时的结论。`,ui:{content:`glass-panel studio-modal channel-consensus-modal`,body:`dialog-body`}},{body:R(()=>[q(`div`,Qne,[be.value?X(``,!0):(W(),K(xY,{key:0,section:`host`,onOpen:Te,onDetail:Ee})),q(`section`,$ne,[q(`div`,ere,[r[33]||=q(`div`,null,[q(`h2`,null,`当前共识`),q(`p`,null,`主持人整理的结论、共识与分歧,用 #消息编号 保留依据;讨论结束时保存进下方记录。`)],-1),Ce.value?X(``,!0):(W(),K(b,{key:0,icon:`i-lucide-pencil`,label:`编辑`,variant:`outline`,color:`neutral`,class:`channel-surface-button`,onClick:r[13]||=e=>Ce.value=!0}))]),Ce.value?(W(),G(`form`,{key:0,class:`summary-form`,onSubmit:_u(De,[`prevent`])},[J(ve,{label:`主持简报`,description:`简述结论、共识、歧义,以及接下来要追问或调整什么、为什么。`,class:`channel-brief-editor`},{default:R(()=>[J(se,{modelValue:L(_),"onUpdate:modelValue":r[14]||=e=>gn(_)?_.value=e:null,"aria-label":`主持简报正文`,rows:4,class:`w-full summary-brief-editor`,placeholder:`让返回房间的人快速理解讨论进展和主持意图。`},null,8,[`modelValue`])]),_:1}),J(ve,{label:`详细共识与进度`,description:`已达成的共识、尚未解决的问题与下一步,用 #消息编号 标注依据。`,class:`channel-state-field`},{default:R(()=>[J(se,{modelValue:L(g),"onUpdate:modelValue":r[15]||=e=>gn(g)?g.value=e:null,"aria-label":`共识与分歧正文`,rows:12,maxlength:4e3,class:`summary-editor`,placeholder:`已达成的共识、尚未解决的问题与下一步…`},null,8,[`modelValue`])]),_:1}),q(`div`,tre,[q(`span`,null,`依据消息截止 #`+F(L(t).snapshot_id),1),q(`div`,nre,[J(b,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:r[16]||=e=>Ce.value=!1}),J(b,{type:`submit`,color:`neutral`,icon:`i-lucide-check`,label:`保存共识`,class:`channel-primary-button`,loading:L(a)===`save_context`},null,8,[`loading`])])])],32)):o.value.host_brief?.text||o.value.state_text?(W(),G(U,{key:1},[q(`div`,rre,[q(`h3`,null,[r[34]||=Y(`主持简报`,-1),o.value.state_until?(W(),G(`button`,{key:0,type:`button`,class:`subtle-link`,onClick:r[17]||=e=>Ee(o.value.state_until)},`整理至 #`+F(o.value.state_until),1)):X(``,!0)]),q(`div`,{class:`markdown-body`,innerHTML:o.value.rendered_brief},null,8,ire)]),P.value?(W(),G(`details`,are,[q(`summary`,null,[r[35]||=q(`h3`,null,`详细共识与进度`,-1),r[36]||=q(`span`,null,`依据、已处理内容、未决问题与下一步`,-1),J(T,{name:`i-lucide-chevron-down`,class:`disclosure-icon`})]),q(`div`,{class:`markdown-body consensus-state`,innerHTML:P.value},null,8,ore)])):X(``,!0)],64)):(W(),G(`p`,sre,`还没有共识。主持人会在讨论中整理,也可以点“编辑”自己写。`))]),J(R6,{onDetail:Ee})])]),_:1},8,[`content`,`open`])):X(``,!0),j.value?(W(),G(`div`,{key:3,class:`channel-rail-resizer`,role:`separator`,tabindex:`0`,"aria-label":`调整右侧栏宽度`,"aria-orientation":`vertical`,"aria-controls":`channel-member-rail`,"aria-valuemin":U9,"aria-valuemax":W9,"aria-valuenow":w.value,"aria-valuetext":`${w.value} 像素`,title:`拖动调整右侧栏宽度,也可使用左右方向键`,onPointerdown:Ke,onPointermove:qe,onPointerup:Je,onPointercancel:Je,onLostpointercapture:Je,onKeydown:Ye},null,40,cre)):X(``,!0),j.value?Tr((W(),G(`aside`,lre,[q(`section`,ure,[o.value?(W(),K(C6,{key:0})):(W(),G(`div`,dre,[...r[37]||=[q(`header`,{class:`pb-header`},[q(`strong`,null,`讨论进度`)],-1),q(`p`,{class:`channel-rail-empty`},`暂无房间,新建讨论后在这里查看进度与参与者。`,-1)]]))])])),[[Be]]):X(``,!0),J(ze,{open:m.value,"onUpdate:open":r[20]||=e=>m.value=e,side:`left`,title:`房间导航`,ui:{overlay:`channel-drawer-overlay`,content:`channel-navigation-drawer`}},{content:R(()=>[J(G4,{tabs:_e.value,onSelect:je,onManage:Oe,onCreate:Ne,onCreateFolder:Pe,onManageFolder:Fe,onDeleteFolder:Ie,onArchiveFolder:Le,onArchives:ke,onTab:Ae,onSettings:r[19]||=e=>{m.value=!1,u.value=`settings`}},null,8,[`tabs`])]),_:1},8,[`open`]),o.value?(W(),K(ze,{key:5,open:h.value,"onUpdate:open":r[21]||=e=>h.value=e,side:`right`,title:`讨论进度`,description:o.value.title,ui:{overlay:`channel-drawer-overlay`,content:`progress-drawer`,body:`progress-drawer-body`}},{body:R(()=>[J(C6)]),_:1},8,[`open`,`description`])):X(``,!0),J(n4,{modelValue:u.value,"onUpdate:modelValue":r[22]||=e=>u.value=e,"reading-width":S.value,"onUpdate:readingWidth":r[23]||=e=>S.value=e,effects:C.value,"onUpdate:effects":r[24]||=e=>C.value=e,"reading-options":L(pe),"effect-options":y,"detail-id":p.value,"target-room":d.value,"target-folder":f.value},null,8,[`modelValue`,`reading-width`,`effects`,`reading-options`,`detail-id`,`target-room`,`target-folder`])],6)}}},gre=120,_re={__name:`App`,setup(e){let t={error:{color:`error`,icon:`i-lucide-circle-x`,duration:8e3},warning:{color:`warning`,icon:`i-lucide-triangle-alert`,duration:6e3},info:{color:`info`,icon:`i-lucide-info`,duration:4e3}};document.documentElement.dataset.motion=`on`;let n=JB();Dr(`discussion`,n);let r={onMousedown:e=>e.preventDefault(),onPointermove:e=>{e.pointerType!==`mouse`&&e.stopPropagation()}},i={close:`pointer-coarse:p-2.5 pointer-coarse:-m-2.5`},a=e=>{e.target===window&&e.stopImmediatePropagation()};window.addEventListener(`blur`,a,!0),ca(()=>window.removeEventListener(`blur`,a,!0));let o=NE();function s({detail:{level:e,message:n}}){let a=String(n);o.add({...t[e]||t.info,...r,ui:i,id:`${e}:${a}`,title:a.length>gre?`${a.slice(0,119)}…`:a})}document.addEventListener(`discuss:notice`,s),ca(()=>document.removeEventListener(`discuss:notice`,s));let c=Q(()=>n.view.value.device?.prompt),l=Q({get:()=>!!c.value,set:e=>{e||n.bridge.device.prompt_cancel()}});function u(){n.bridge.device.prompt_confirm()?.catch(e=>{e?.cancelled||s({detail:{level:`error`,message:e.message}})})}return(e,t)=>{let n=AA;return W(),K(n,{locale:L(KB),tooltip:{delayDuration:300},toaster:{position:`bottom-right`,max:5}},{default:R(()=>[J(L(yz),{"reduced-motion":`never`},{default:R(()=>[J(hre),c.value?(W(),K(ZQ,{key:0,open:l.value,"onUpdate:open":t[0]||=e=>l.value=e,title:c.value.title,description:c.value.description,"confirm-label":c.value.confirm_label,onConfirm:u},null,8,[`open`,`title`,`description`,`confirm-label`])):X(``,!0)]),_:1},8,[`reduced-motion`])]),_:1},8,[`locale`])}}};function Q9(){Du(_re).use(bh).directive(`keep-reading`,iG).mount(`#modern-root`)}var vre=120;function $9(){setTimeout(()=>{document.activeElement?.matches?.(`input, textarea, select, [contenteditable='true']`)||(window.scrollX||window.scrollY)&&window.scrollTo(0,0)},vre)}document.addEventListener(`focusout`,$9),window.visualViewport?.addEventListener(`resize`,$9);var yre=120;function bre(){let e=window.visualViewport,t=document.documentElement.style;e.scale>1.01||window.innerHeight-e.height<yre?t.removeProperty(`--keyboard-viewport-height`):(t.setProperty(`--keyboard-viewport-height`,`${Math.round(e.height)}px`),window.scrollY&&window.scrollTo(0,0))}window.visualViewport?.addEventListener(`resize`,bre),document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,Q9):Q9();
67
+ `).trim();if(!r)return;let i=n.contains(t.endContainer)?NW(n,t.endContainer,t.endOffset):n.textContent.length,a=NW(n,t.startContainer,t.startOffset);ie.value={range:t.cloneRange(),text:r,from:a,to:i,...et(t),touch:window.matchMedia(`(pointer: coarse)`).matches,...tt(t,ane,one)}}function rt(){let e=te.value,t=j.value;se.value=!o.value||!e||!t?[]:OW.excerpts.flatMap((n,r)=>{let i=!n.message_id&&n.path===m.value?PW(e,t,n.to):null;return i?[{id:n.id,number:r+1,...i}]:[]})}function it(e){ut();let t=OW.excerpts.find(t=>t.id===e),n=t&&FW(te.value,t.from,t.to);n&&(IW(n),ce.value={excerpt:t,...tt(n,lne,une)})}function at(){ce.value=null,IW(null)}function ot(e){ce.value.excerpt.comment=e,at()}function st(){let{id:e}=ce.value.excerpt;OW.excerpts=OW.excerpts.filter(t=>t.id!==e),at()}function ct(){let{range:e}=ie.value;ie.value=null,document.getSelection()?.removeAllRanges(),fe.read_document(te.value,{selection:e,heading:v.value})}async function lt(){ae.value={...ie.value,...tt(ie.value.range,sne,cne)},IW(ie.value.range),ie.value=null,oe.value=``,document.getSelection()?.removeAllRanges(),await ar(),M.value?.focus()}function ut(){ae.value=null,IW(null)}async function dt(){let{text:e,start:t,end:n,from:i,to:a}=ae.value,o={path:m.value,name:v.value,start:t,end:n,text:e,from:i,to:a,comment:oe.value.trim()};ut(),document.getSelection()?.removeAllRanges(),await qe(),r(`tab`,`discussion`),Ve(()=>jW(o))}function ft(e){e.isComposing||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),ut()):e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),dt()))}function pt(e){fe.state.following&&(e.type!==`keydown`||A.includes(e.key))&&(e.type!==`pointerdown`||e.target===e.currentTarget)&&(fe.state.following=!1)}return z([o,a,g,x],()=>{ie.value=null,ut(),at()}),z([o,a,g,x,()=>OW.excerpts.map(e=>e.id).join()],()=>ar(rt),{flush:`post`}),z([a,g,x],()=>{fe.state.message_id&&fe.stop()}),z(te,e=>{e&&(fe.rebind_document(e),ar(rt))}),aa(()=>{OW.open=ge,Ne(),window.addEventListener(`resize`,Ne),s.addEventListener(`change`,u),window.addEventListener(`resize`,rt),document.addEventListener(`selectionchange`,Xe),document.addEventListener(`pointerdown`,Qe),document.addEventListener(`pointerup`,$e),document.addEventListener(`pointercancel`,$e)}),ca(()=>{OW.open===ge&&(OW.open=null),window.removeEventListener(`resize`,Ne),s.removeEventListener(`change`,u),window.removeEventListener(`resize`,rt),IW(null);for(let e of i.value)e.request++;document.removeEventListener(`selectionchange`,Xe),document.removeEventListener(`pointerdown`,Qe),document.removeEventListener(`pointerup`,$e),document.removeEventListener(`pointercancel`,$e),window.clearTimeout(le),fe.dispose()}),(e,t)=>{let n=Yk,r=bA,s=$B,u=ya(`keep-reading`);return W(),G(U,null,[J(s,{open:o.value,title:v.value,description:p.value,content:{onInteractOutside:e=>e.preventDefault()},ui:{content:`project-editor`},"onUpdate:open":t[12]||=e=>e?o.value=!0:Ve()},{content:R(()=>[q(`div`,{ref_key:`frame`,ref:Ce,class:`project-editor-frame`,onTouchstartPassive:Ue,onTouchmove:We,onTouchend:Ge,onTouchcancel:Ge},[q(`div`,Cte,[q(`div`,wte,[(W(!0),G(U,null,V(i.value,e=>(W(),G(`div`,{key:e.id,class:N([`project-editor-tab`,{"is-active":e.id===a.value}]),title:e.path},[q(`button`,{type:`button`,role:`tab`,class:`project-editor-tab-name`,"aria-selected":e.id===a.value,onClick:t=>be(e.id)},[J(n,{name:L(WW)(d(e.path))[1],class:N([`project-file-icon`,L(WW)(d(e.path))[2]])},null,8,[`name`,`class`]),q(`span`,null,F(d(e.path)),1)],8,Ete),q(`button`,{type:`button`,class:`project-editor-tab-close`,"aria-label":`关闭 ${d(e.path)}`,title:`关闭`,onClick:t=>xe(e.id)},[J(n,{name:`i-lucide-x`})],8,Dte)],10,Tte))),128))]),q(`div`,Ote,[w.value?(W(),K(r,{key:0,icon:`i-lucide-wrap-text`,color:`neutral`,variant:c.value?`soft`:`ghost`,size:`sm`,"aria-pressed":c.value,title:c.value?`关闭自动换行`:`自动换行`,"aria-label":`自动换行`,onClick:t[0]||=e=>c.value=!c.value},null,8,[`variant`,`aria-pressed`,`title`])):X(``,!0),pe.value?(W(),K(r,{key:1,icon:L(fe).state.reading?`i-lucide-square`:`i-lucide-volume-2`,color:`neutral`,variant:`ghost`,size:`sm`,title:L(fe).state.reading?`停止朗读`:`朗读`,"aria-label":L(fe).state.reading?`停止朗读`:`从头朗读此文件`,onClick:t[1]||=e=>L(fe).state.reading?L(fe).stop():Ye()},null,8,[`icon`,`title`,`aria-label`])):X(``,!0),C.value?(W(),G(`div`,kte,[q(`button`,{type:`button`,"aria-pressed":!g.value,title:`预览`,onClick:t[2]||=e=>g.value=!1},[J(n,{name:`i-lucide-eye`,class:`project-mode-icon`}),t[13]||=q(`span`,null,`预览`,-1)],8,Ate),q(`button`,{type:`button`,"aria-pressed":g.value,title:`源码`,onClick:t[3]||=e=>g.value=!0},[J(n,{name:`i-lucide-code-xml`,class:`project-mode-icon`}),t[14]||=q(`span`,null,`源码`,-1)],8,jte)])):X(``,!0)]),q(`div`,Mte,[J(r,{icon:l.value?`i-lucide-chevron-down`:`i-lucide-minus`,color:`neutral`,variant:`ghost`,size:`sm`,title:`收起为悬浮窗(手机上也可下拉收起)`,"aria-label":`收起预览`,onClick:Ve},null,8,[`icon`]),!l.value||i.value.length>1?(W(),K(r,{key:0,icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`sm`,title:i.value.length>1?`关闭全部文件`:`关闭预览`,"aria-label":i.value.length>1?`关闭全部文件`:`关闭预览`,onClick:Ke},null,8,[`title`,`aria-label`])):X(``,!0)]),q(`nav`,Nte,[(W(!0),G(U,null,V(_.value,(e,t)=>(W(),G(U,{key:e.path},[t?(W(),K(n,{key:0,name:`i-lucide-chevron-right`,class:`project-crumb-separator`})):X(``,!0),t<_.value.length-1?(W(),G(`button`,{key:1,type:`button`,title:`在列表中打开此文件夹`,onClick:t=>Je(e.path)},F(e.name),9,Pte)):(W(),G(`span`,Fte,[J(n,{name:y.value[1],class:N([`project-file-icon`,y.value[2]])},null,8,[`name`,`class`]),Y(F(e.name),1)]))],64))),128))])]),h.value?.truncated?(W(),G(`p`,Ite,[J(n,{name:`i-lucide-info`}),Y(`文件较大,仅显示前 `+F(L(KW)(h.value.limit))+`(共 `+F(L(KW)(h.value.size))+`)`,1),b.value===`html`?(W(),G(U,{key:0},[Y(`,HTML 不渲染不完整的内容`)],64)):X(``,!0)])):C.value&&!g.value&&b.value===`html`?(W(),G(`p`,Lte,[J(n,{name:`i-lucide-shield`}),t[15]||=Y(`静态预览:脚本、外部样式与外部图片不加载`,-1)])):X(``,!0),q(`div`,{ref_key:`editor_body`,ref:ee,class:`project-editor-body`},[f.value?.loading&&!h.value?(W(),G(`div`,Rte,[J(n,{name:`i-lucide-loader-circle`,class:`animate-spin`}),t[16]||=Y(`正在读取文件…`,-1)])):f.value?.error&&!h.value?(W(),G(`div`,zte,[J(n,{name:`i-lucide-circle-alert`}),q(`p`,null,F(f.value.error),1),J(r,{label:`重试`,color:`neutral`,variant:`outline`,size:`sm`,onClick:t[4]||=e=>he(f.value)})])):h.value?.text===null?(W(),G(`div`,Bte,[J(n,{name:y.value[1]},null,8,[`name`]),q(`p`,null,F(h.value.reason),1)])):w.value&&c.value?(W(),G(`div`,{key:3,ref_key:`code_scroll`,ref:ne,class:`project-code is-wrapped`,tabindex:`0`,"aria-label":`文件内容`,style:ye({"--digits":String(E.value).length})},[(W(!0),G(U,null,V(T.value,(e,t)=>(W(),G(`div`,{key:t,class:`project-code-row`},[q(`span`,Vte,F(t+1),1),q(`span`,Hte,F(e),1)]))),128))],4)):w.value?Tr((W(),G(`div`,{key:4,ref_key:`code_scroll`,ref:ne,class:`project-code`,tabindex:`0`,"aria-label":`文件内容`},[q(`pre`,Ute,F(D.value),1),q(`pre`,Wte,[q(`code`,null,F(h.value.text),1)])])),[[u]]):h.value&&b.value===`html`?(W(),G(`iframe`,{key:5,class:`project-html-preview`,sandbox:``,referrerpolicy:`no-referrer`,srcdoc:S.value,title:`HTML 文件预览`},null,8,Gte)):h.value?Tr((W(),G(`div`,{key:6,ref_key:`markdown_scroll`,ref:j,class:`project-markdown-scroll`,tabindex:`0`,onScrollPassive:Xe,onWheelPassive:pt,onTouchmovePassive:pt,onKeydown:pt,onPointerdown:pt},[q(`div`,{ref_key:`markdown_body`,ref:te,class:`markdown-body project-markdown-preview`,innerHTML:x.value},null,8,Kte),(W(!0),G(U,null,V(se.value,e=>(W(),G(`button`,{key:e.id,type:`button`,class:`excerpt-mark`,style:ye({left:`${e.left}px`,top:`${e.top}px`}),title:`摘录 ${e.number}:点击修改批注`,"aria-label":`修改摘录 ${e.number} 的批注`,onClick:t=>it(e.id)},F(e.number),13,qte))),128))],32)),[[u]]):X(``,!0),ce.value?(W(),K(DW,{key:ce.value.excerpt.id,class:`file-selection-offer file-comment`,comment:ce.value.excerpt.comment,style:ye({left:`${ce.value.left}px`,top:`${ce.value.top}px`}),onSave:ot,onCancel:at,onRemove:st},null,8,[`comment`,`style`])):X(``,!0),ie.value&&!ie.value.touch?(W(),G(`div`,{key:8,class:`file-selection-offer file-offer-marks`,style:ye({left:`${ie.value.left}px`,top:`${ie.value.top}px`})},[q(`button`,{type:`button`,class:`channel-listen-mark`,title:`把选中的文字作为摘录添加到对话`,onMousedown:t[5]||=_u(()=>{},[`prevent`]),onClick:lt},[J(n,{name:`i-lucide-message-square-quote`}),t[17]||=Y(`添加到对话`,-1)],32),pe.value?(W(),G(`button`,{key:0,type:`button`,class:`channel-listen-mark`,title:`从选中处开始朗读`,"aria-label":`从选中处开始朗读`,onMousedown:t[6]||=_u(()=>{},[`prevent`]),onClick:ct},[J(n,{name:`i-lucide-headphones`}),t[18]||=Y(`朗读`,-1)],32)):X(``,!0)],4)):X(``,!0),ae.value?(W(),G(`form`,{key:9,class:N([`file-selection-offer selection-comment file-comment`,{"is-docked":ae.value.touch}]),style:ye(ae.value.touch?{}:{left:`${ae.value.left}px`,top:`${ae.value.top}px`}),onSubmit:_u(dt,[`prevent`])},[Tr(q(`input`,{ref_key:`comment_input`,ref:M,"onUpdate:modelValue":t[7]||=e=>oe.value=e,type:`text`,placeholder:`添加批注(可选)`,"aria-label":`摘录的批注(可选)`,enterkeyhint:`send`,onKeydown:ft},null,544),[[nu,oe.value]]),q(`button`,{type:`button`,class:`selection-comment-cancel`,"aria-label":`取消添加`,title:`取消`,onClick:ut},[J(n,{name:`i-lucide-x`})]),q(`button`,Jte,[J(n,{name:`i-lucide-arrow-up`})])],38)):X(``,!0),ie.value?.touch&&!ae.value||L(fe).state.message_id?(W(),G(`div`,Yte,[ie.value?.touch?(W(),G(`button`,{key:0,type:`button`,class:`channel-listen-pill file-selection-offer`,onMousedown:t[8]||=_u(()=>{},[`prevent`]),onClick:lt},[J(n,{name:`i-lucide-message-square-quote`}),t[19]||=Y(`添加到对话`,-1)],32)):X(``,!0),ie.value?.touch&&pe.value?(W(),G(`button`,{key:1,type:`button`,class:`channel-listen-pill file-selection-offer`,"aria-label":`从选中处开始朗读`,onMousedown:t[9]||=_u(()=>{},[`prevent`]),onClick:ct},[J(n,{name:`i-lucide-headphones`}),t[20]||=Y(`听当前`,-1)],32)):X(``,!0),L(fe).state.message_id?(W(),G(`button`,{key:2,type:`button`,class:N([`channel-listen-pill`,{"is-on":L(fe).state.following}]),"aria-pressed":L(fe).state.following,title:L(fe).state.following?`手动滚动即取消跟随`:`页面跟随朗读位置滚动`,onClick:t[10]||=e=>L(fe).state.following?L(fe).state.following=!1:L(fe).follow()},[J(n,{name:`i-lucide-locate-fixed`}),Y(F(L(fe).state.following?`跟随中`:`跟随`),1)],10,Xte)):X(``,!0),L(fe).state.reading?(W(),G(`button`,{key:3,type:`button`,class:`channel-listen-pill`,"aria-label":`退出朗读`,onClick:t[11]||=e=>L(fe).stop()},[J(n,{name:`i-lucide-square`}),t[21]||=Y(`退出`,-1)])):X(``,!0)])):X(``,!0)],512),q(`footer`,Zte,[h.value?(W(),G(`span`,{key:0,class:`project-editor-modified`,title:h.value.modified_at},`修改于 `+F(L(qW)(h.value.modified_at)),9,Qte)):X(``,!0),t[22]||=q(`span`,{class:`project-editor-status-spacer`},null,-1),h.value?.text==null?X(``,!0):(W(),G(U,{key:1},[q(`span`,null,F(E.value)+` 行`,1),q(`span`,$te,F(O.value),1)],64)),h.value?(W(),G(`span`,ene,F(L(KW)(h.value.size)),1)):X(``,!0),q(`span`,null,F(y.value[0]),1)])],544)]),_:1},8,[`open`,`title`,`description`,`content`]),(W(),K(Yr,{to:`body`},[i.value.length&&!o.value?(W(),G(`div`,{key:0,class:N([`file-float`,{"is-right":De.value===`right`&&!Oe.value,"is-dragging":Oe.value}]),style:ye(Pe.value),onPointerdown:Fe,onPointermove:Ie,onPointerup:Le,onPointercancel:Le,onClickCapture:Re},[q(`button`,{type:`button`,class:`file-float-open`,title:i.value.length>1?`回到文件预览(${i.value.length} 个文件)`:`回到文件预览:${v.value}`,onClick:He},[J(n,{name:y.value[1],class:N([`project-file-icon`,y.value[2]])},null,8,[`name`,`class`]),q(`span`,nne,F(v.value),1),i.value.length>1?(W(),G(`span`,rne,F(i.value.length),1)):X(``,!0)],8,tne),q(`button`,{type:`button`,class:`file-float-close`,"aria-label":`关闭全部文件预览`,title:`关闭`,onClick:Ke},[J(n,{name:`i-lucide-x`})])],38)):X(``,!0)]))],64)}}},[[`__scopeId`,`data-v-56d428a2`]]),bne=[`aria-valuemax`,`aria-valuenow`,`aria-valuetext`],xne={class:`channel-main`},Sne={class:`channel-header`},Cne={class:`channel-title-icon`},wne={class:`channel-title`},Tne={class:`channel-title-copy`},Ene=[`title`],Dne={key:2,class:`channel-header-context`},One=[`datetime`,`title`],kne={class:`channel-header-actions`},Ane=[`title`,`aria-label`],jne={key:0,class:`channel-work-avatars`},Mne={class:`channel-work-text`,role:`status`},Nne={key:0,class:`channel-launch-recovery`,"aria-label":`未完成的创建或启动请求`},Pne={role:`status`},Fne={class:`button-row`},Ine={key:1,class:`channel-tabbar`},Lne={class:`channel-brief-inner`},Rne={class:`channel-brief-heading`},zne=[`aria-label`,`aria-expanded`],Bne={key:0,class:`channel-brief-preview`},Vne={id:`channel-brief-content`,class:`channel-brief-content`},Hne=[`innerHTML`],Une={class:`channel-brief-footer`},Wne={key:0,class:`channel-brief-status`},Gne={class:`channel-content`},Kne={key:0,class:`content-page merged-page`,role:`tabpanel`,"aria-label":`房间`},qne={key:1,class:`content-page merged-page`,role:`tabpanel`,"aria-label":`执行`},Jne={class:`timeline-switch`,role:`group`,"aria-label":`执行视图`},Yne={key:2,class:`content-page`,role:`tabpanel`,"aria-label":`文件`},Xne={key:1,class:`channel-files-unset`,role:`status`},Zne={key:3,class:`content-page private-page`},Qne={key:1,class:`channel-empty`},$ne={class:`merged-page channel-consensus-body`},ere={class:`merged-section channel-summary`,"aria-label":`当前共识`},tre={class:`page-heading`},nre={class:`form-footer`},rre={class:`button-row`},ire={class:`consensus-card is-brief`},are=[`innerHTML`],ore={key:0,class:`consensus-card`},sre=[`innerHTML`],cre={key:2,class:`fine-print`},lre=[`aria-valuenow`,`aria-valuetext`],ure={key:4,id:`channel-member-rail`,class:`channel-member-rail`,"aria-label":`当前焦点与讨论进度`},dre={class:`channel-rail-board`},fre={key:1,class:`progress-board is-docked`},H9=`ai-codiscuss-channel-layout`,U9=220,W9=440,G9=280,K9=16,q9=180,J9=400,Y9=248,X9=16,pre=480,mre=1200,Z9=0,hre=4,gre={__name:`ChannelWorkspace`,setup(e){let{view:t,bridge:n,field:r,act:i,pending:a}=Or(`discussion`),o=Q(()=>t.value.room),s=Q(()=>{let e=new Date(o.value?.created_at||``);return Number.isNaN(e.getTime())?``:`创建于 ${e.getFullYear()===new Date().getFullYear()?``:`${e.getFullYear()}年`}${e.getMonth()+1}月${e.getDate()}日`}),c=[{value:`waterfall`,label:`瀑布`},{value:`events`,label:`事件`}],l=I(`waterfall`),u=I(``),d=I(null),f=I(null),p=I(null),m=I(!1),h=I(!1),g=r(`state-input`),_=r(`brief-input`),v=r(`search-input`),y=[{value:`full`,label:`完整`},{value:`reduced`,label:`精简`}],b={narrow:{label:`窄`,width:720},default:{label:`默认`,width:960},wide:{label:`宽`,width:1240}},x=Re(),S=I(x.reading),C=I(x.effects),w=I(x.rail),T=I(x.nav),E=I(typeof window>`u`?728:window.innerWidth),D=I(x.collapsed),O=I(!0),k=I(x.rail_collapsed),A=Q(()=>E.value>=mre),ee=Q(()=>A.value&&!D.value),j=Q(()=>t.value.tab===`discussion`&&!k.value),te=Q(()=>A.value&&t.value.tab===`discussion`?k.value?`展开房间概览`:`收起房间概览`:`讨论进度`),ne=[`dispatched`,`started`],M=Q(()=>{let e=(o.value?.free?.members||[]).filter(U3),t=e=>e.execution?.stale?`执行失联`:ne.includes(e.execution?.status)?`执行中`:`待投递`;return e.length?{tone:e.some(e=>e.execution?.stale)?`error`:`primary`,text:e.length===1?`${n.display_name(e[0].name)} ${t(e[0])}`:`${e.length} 位执行中`,members:e.slice(0,hre),title:e.map(e=>`${n.display_name(e.name)} ${t(e)}`).join(`
68
+ `)}:{tone:`success`,text:`空闲`,members:[],title:`空闲`}}),re=Q(()=>!!o.value&&!o.value.archived&&!(A.value&&j.value)),ie=Q(()=>{let e=document.createElement(`template`);return e.innerHTML=o.value?.rendered_brief||``,e.content.textContent.replace(/\s+/g,` `).trim()}),ae=I(null),oe=I(0),se=null,ce=I(null),le=I(null),ue=Q(()=>Math.min(J9,Math.max(q9,E.value-pre-Z9))),de=Q(()=>Math.min(T.value,ue.value)),fe=Q(()=>({"--channel-reading-width":`${b[S.value].width}px`,"--channel-rail-width":`${w.value}px`,"--channel-topbar-height":`${oe.value}px`,"--channel-main-columns":ee.value?`${de.value}px ${Z9}px minmax(0, 1fr)`:`minmax(0, 1fr)`})),pe=Object.entries(b).map(([e,t])=>({value:e,label:t.label}));z(S,Be),z(C,e=>{document.documentElement.dataset.effects=e,Be()},{immediate:!0}),z(D,Be),z(k,Be),aa(()=>window.addEventListener(`resize`,He)),ca(()=>window.removeEventListener(`resize`,He)),aa(()=>document.addEventListener(`pointerdown`,We)),aa(()=>{for(let e of[`pointerup`,`pointercancel`])document.addEventListener(e,Ge)}),ca(()=>{for(let e of[`pointerup`,`pointercancel`])document.removeEventListener(e,Ge)}),aa(()=>{se=new ResizeObserver(([e])=>{O.value&&(oe.value=Math.round(e.target.offsetHeight))}),se.observe(ae.value)}),ca(()=>se?.disconnect()),ca(()=>document.removeEventListener(`pointerdown`,We));let me=Q({get:()=>t.value.tab,set:e=>i(`tab`,e)}),he=Q(()=>t.value.launch.room_models?.room_id===o.value?.id&&t.value.launch.room_models?.project_directory||``),ge=Q(e=>{let n=he.value?[he.value,...t.value.launch.room_models?.extra_directories||[]]:[];return e?.length===n.length&&n.every((t,n)=>Object.is(t,e[n]))?e:n}),_e=Q(()=>[{value:`discussion`,label:`消息`,icon:`i-lucide-messages-square`},{value:`private`,label:`私聊`,icon:`i-lucide-message-square`},{value:`timeline`,label:`执行`,icon:`i-lucide-chart-gantt`},{value:`overview`,label:`房间`,icon:`i-lucide-sliders-horizontal`},{value:`files`,label:`文件`,icon:`i-lucide-files`,title:he.value||``}]),ve={context:`discussion`,history:`discussion`,access:`overview`},be=Q(()=>![`active`,`paused`].includes(o.value?.session?.status));z(()=>ve[t.value.tab],e=>{e&&i(`tab`,e)},{immediate:!0});let xe=Q(()=>!!o.value&&(!be.value||!!o.value.host_brief?.text||!!o.value.state_text||!!o.value.discussions?.length)),Se=I(!1),Ce=I(!1),P=Q(()=>o.value?.state_text?n.render_room_markdown(o.value.state_text):``);z(()=>o.value?.id,()=>{Se.value=!1,Ce.value=!1});function we(e=!1){O.value=!0,Ce.value=e,Se.value=!0}function Te(e){Se.value=!1,u.value=e}function Ee(e){Se.value=!1,Me(e)}async function De(){await i(`save_context`)&&(Ce.value=!1)}function Oe({room:e,action:t}){d.value=e,m.value=!1,u.value=t}function ke(){m.value=!1,u.value=`archives`}function Ae(e){m.value=!1,i(`tab`,e)}async function je(e){m.value=!1,await i(`room`,e)}function Me(e){p.value=e,u.value=`message`}function Ne(e=null){n.reset_create_form(),f.value=e,m.value=!1,u.value=`create`}function Pe(){f.value=null,m.value=!1,u.value=`folder`}function Fe(e){f.value=e,m.value=!1,u.value=`rename-folder`}function Ie(e){f.value=e,m.value=!1,u.value=`delete-folder`}function Le(e){f.value=e,m.value=!1,u.value=`archive-folder`}function Re(){try{let e=JSON.parse(localStorage.getItem(H9))||{};return{reading:Object.hasOwn(b,e.reading)?e.reading:`default`,effects:e.effects===`reduced`?`reduced`:`full`,rail:Number.isFinite(e.rail)?Math.min(W9,Math.max(U9,e.rail)):G9,nav:Number.isFinite(e.nav)?Math.min(J9,Math.max(q9,e.nav)):ze(),collapsed:e.collapsed===!0,brief_collapsed:e.brief_collapsed===!0,rail_collapsed:e.rail_collapsed===!0}}catch{return{reading:`default`,effects:`full`,rail:G9,nav:ze(),collapsed:!1,brief_collapsed:!1,rail_collapsed:!1}}}function ze(){return typeof window>`u`?Y9:window.innerWidth>=1900?280:window.innerWidth<=980?220:Y9}function Be(){try{localStorage.setItem(H9,JSON.stringify({reading:S.value,effects:C.value,rail:w.value,nav:T.value,collapsed:D.value,brief_collapsed:O.value,rail_collapsed:k.value}))}catch{}}function Ve(){A.value&&t.value.tab===`discussion`?k.value=!k.value:h.value=!0}function He(){E.value=window.innerWidth}function Ue(){O.value=!O.value}function We(e){!O.value&&!e.target.closest?.(`.channel-host-brief`)&&(O.value=!0)}function Ge(e){e.pointerType===`touch`&&e.target.closest?.(`.channel-drawer-overlay`)&&(m.value=!1,h.value=!1)}function Ke(e){e.button===0&&(e.preventDefault(),e.currentTarget.focus(),ce.value={pointer:e.pointerId,x:e.clientX,width:w.value},e.currentTarget.setPointerCapture(e.pointerId))}function qe(e){ce.value?.pointer===e.pointerId&&(w.value=Math.round(Math.min(W9,Math.max(U9,ce.value.width+ce.value.x-e.clientX))))}function Je(e){ce.value?.pointer===e.pointerId&&(ce.value=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),Be())}function Ye(e){let t={ArrowLeft:w.value+K9,ArrowRight:w.value-K9,Home:U9,End:W9};Object.hasOwn(t,e.key)&&(e.preventDefault(),w.value=Math.min(W9,Math.max(U9,t[e.key])),Be())}function Xe(e){e.button===0&&(e.preventDefault(),e.currentTarget.focus(),le.value={pointer:e.pointerId,x:e.clientX,width:de.value},e.currentTarget.setPointerCapture(e.pointerId))}function Ze(e){le.value?.pointer===e.pointerId&&(T.value=Math.round(Math.min(ue.value,Math.max(q9,le.value.width+e.clientX-le.value.x))))}function Qe(e){le.value?.pointer===e.pointerId&&(le.value=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),Be())}function $e(e){let t={ArrowLeft:de.value-X9,ArrowRight:de.value+X9,Home:q9,End:ue.value};Object.hasOwn(t,e.key)&&(e.preventDefault(),T.value=Math.min(ue.value,Math.max(q9,t[e.key])),Be())}return(e,r)=>{let b=bA,x=yV,T=Yk,E=uV,k=tA,ne=hV,oe=fV,se=cV,ve=aV,Re=$B,ze=ZB,Be=ya(`keep-reading`);return W(),G(`div`,{class:N([`channel-shell`,{"channel-resizing":ce.value||le.value,"channel-nav-collapsed":!ee.value,"channel-has-rail":j.value}]),style:ye(fe.value)},[ee.value?(W(),K(G4,{key:0,tabs:_e.value,onSelect:je,onManage:Oe,onCreate:Ne,onCreateFolder:Pe,onManageFolder:Fe,onDeleteFolder:Ie,onArchiveFolder:Le,onArchives:ke,onTab:Ae,onSettings:r[0]||=e=>u.value=`settings`},null,8,[`tabs`])):X(``,!0),ee.value?(W(),G(`div`,{key:1,class:`channel-nav-resizer`,role:`separator`,tabindex:`0`,"aria-label":`调整房间栏宽度`,"aria-orientation":`vertical`,"aria-controls":`channel-sidebar`,"aria-valuemin":q9,"aria-valuemax":ue.value,"aria-valuenow":de.value,"aria-valuetext":`${de.value} 像素`,title:`拖动调整房间栏宽度,也可使用方向键`,onPointerdown:Xe,onPointermove:Ze,onPointerup:Qe,onPointercancel:Qe,onLostpointercapture:Qe,onKeydown:$e},null,40,bne)):X(``,!0),q(`main`,xne,[q(`div`,{ref_key:`topbar`,ref:ae,class:N([`channel-topbar`,{"is-overlay":o.value&&L(t).tab===`discussion`}])},[q(`header`,Sne,[A.value?(W(),K(x,{key:0,text:D.value?`展开房间栏`:`收起房间栏`},{default:R(()=>[J(b,{icon:`i-lucide-panel-left`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-desktop-nav channel-icon-button channel-panel-toggle`,"aria-label":D.value?`展开房间栏`:`收起房间栏`,"aria-expanded":!D.value,"aria-controls":`channel-sidebar`,onClick:r[1]||=e=>D.value=!D.value},null,8,[`aria-label`,`aria-expanded`])]),_:1},8,[`text`])):(W(),K(b,{key:1,icon:`i-lucide-panel-left`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-mobile-nav channel-icon-button channel-panel-toggle`,"aria-label":`打开房间导航`,"aria-expanded":m.value,onClick:r[2]||=e=>m.value=!0},null,8,[`aria-expanded`])),q(`span`,Cne,[J(T,{name:`i-lucide-hash`})]),q(`div`,wne,[q(`div`,Tne,[q(`h1`,{title:o.value?.title},F(o.value?.title||`共议`),9,Ene)]),o.value?.archived?(W(),K(E,{key:0,color:`neutral`,variant:`subtle`,size:`sm`},{default:R(()=>[...r[25]||=[Y(`已存档`,-1)]]),_:1})):X(``,!0)]),o.value?(W(),G(`span`,Dne,[Y(F(_e.value.find(e=>e.value===L(t).tab)?.label),1),r[27]||=q(`span`,null,`·`,-1),Y(F(o.value.message_count)+` 条记录`,1),s.value?(W(),G(U,{key:0},[r[26]||=q(`span`,null,`·`,-1),q(`time`,{datetime:o.value.created_at,title:new Date(o.value.created_at).toLocaleString(`zh-CN`,{hour12:!1})},F(s.value),9,One)],64)):X(``,!0)])):X(``,!0),q(`div`,kne,[re.value?(W(),G(`button`,{key:0,type:`button`,class:N([`channel-work-status`,`is-${M.value.tone}`]),title:M.value.title,"aria-label":`执行状态:${M.value.title.replaceAll(`
69
+ `,`,`)};打开房间概览`,onClick:Ve},[M.value.members.length?(W(),G(`span`,jne,[(W(!0),G(U,null,V(M.value.members,e=>(W(),K(k,{key:e.id,src:L(n).identities[e.name]?.icon,text:L(n).identities[e.name]?.initials,alt:e.name,size:`2xs`,class:N([`channel-avatar`,L(n).identities[e.name]?.style])},null,8,[`src`,`text`,`alt`,`class`]))),128))])):X(``,!0),r[28]||=q(`span`,{class:`pb-dot`},null,-1),q(`span`,Mne,F(M.value.text),1)],10,Ane)):X(``,!0),L(t).tab===`discussion`?(W(),G(`form`,{key:1,class:`channel-search`,onSubmit:r[5]||=_u(e=>L(i)(`filter`,{query:L(v)}),[`prevent`])},[J(ne,{modelValue:L(v),"onUpdate:modelValue":r[4]||=e=>gn(v)?v.value=e:null,icon:`i-lucide-search`,variant:`none`,size:`sm`,placeholder:`搜索消息`,"aria-label":`搜索讨论记录`,disabled:!o.value,class:`channel-search-input`},{trailing:R(()=>[L(v)||L(t).query?(W(),K(b,{key:0,icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`清除搜索`,onClick:r[3]||=e=>{v.value=``,L(i)(`filter`,{query:``})}})):X(``,!0),J(b,{type:`submit`,icon:`i-lucide-corner-down-left`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`搜索`,disabled:!o.value},null,8,[`disabled`])]),_:1},8,[`modelValue`,`disabled`])],32)):X(``,!0),L(t).tab===`discussion`?(W(),K(x,{key:2,text:`只看主持:主持人的发言与主持说明(含讨论总结)`},{default:R(()=>[J(b,{icon:`i-lucide-crown`,variant:L(t).host_only?`soft`:`ghost`,color:`neutral`,size:`sm`,class:`channel-icon-button channel-host-filter`,"aria-pressed":L(t).host_only,"aria-label":`只看主持`,disabled:!o.value,onClick:r[6]||=e=>L(i)(`filter`,{host:!L(t).host_only})},null,8,[`variant`,`aria-pressed`,`disabled`])]),_:1})):X(``,!0)]),J(x,{text:te.value},{default:R(()=>[J(b,{icon:`i-lucide-panel-right`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-icon-button channel-panel-toggle channel-info-button`,"aria-label":te.value,disabled:!o.value&&!(A.value&&L(t).tab===`discussion`),"aria-expanded":A.value&&L(t).tab===`discussion`?j.value:h.value,onClick:Ve},null,8,[`aria-label`,`disabled`,`aria-expanded`])]),_:1},8,[`text`])]),L(t).launch.recoveries.length?(W(),G(`section`,Nne,[r[29]||=q(`h2`,null,`继续未完成的请求`,-1),(W(!0),G(U,null,V(L(t).launch.recoveries,e=>(W(),G(`article`,{key:e.id},[q(`strong`,null,F(e.title),1),q(`p`,Pne,F(e.error||`启动结果尚未确认;原请求已保存在此浏览器中。`),1),q(`div`,Fne,[J(b,{label:e.direct?`继续创建房间`:`继续本次启动`,size:`sm`,loading:L(a)===`resume_launch`,disabled:!!L(a),onClick:t=>L(i)(`resume_launch`,e.id)},null,8,[`label`,`loading`,`disabled`,`onClick`]),e.room_id?(W(),K(b,{key:0,label:`查看原房间`,color:`neutral`,variant:`outline`,size:`sm`,onClick:t=>L(i)(`room`,e.room_id)},null,8,[`onClick`])):X(``,!0),J(b,{label:`移除待办`,color:`neutral`,variant:`ghost`,size:`sm`,disabled:!!L(a),onClick:t=>L(i)(`discard_launch`,e.id)},null,8,[`disabled`,`onClick`])])]))),128)),r[30]||=q(`small`,null,`移除待办不会删除房间或停止讨论。`,-1)])):X(``,!0),o.value?(W(),G(`div`,Ine,[J(oe,{modelValue:me.value,"onUpdate:modelValue":r[7]||=e=>me.value=e,items:_e.value,content:!1,variant:`pill`,color:`neutral`,size:`sm`,class:`channel-tabs`,"aria-label":`房间视图`},null,8,[`modelValue`,`items`])])):X(``,!0),xe.value?(W(),G(`section`,{key:2,class:N([`channel-host-brief`,{"is-collapsed":O.value}]),"aria-label":`主持简报`},[q(`div`,Lne,[q(`div`,Rne,[q(`button`,{type:`button`,class:`channel-brief-toggle`,"aria-label":O.value?`展开主持简报`:`收起主持简报`,"aria-expanded":!O.value,"aria-controls":`channel-brief-content`,onClick:Ue},[J(T,{name:O.value?`i-lucide-chevron-right`:`i-lucide-chevron-down`},null,8,[`name`]),q(`strong`,null,`主持简报`+F(O.value?`:`:``),1),O.value?(W(),G(`span`,Bne,F(ie.value),1)):X(``,!0)],8,zne),O.value?X(``,!0):(W(),G(U,{key:0},[J(b,{label:`详细共识与讨论记录`,color:`neutral`,variant:`link`,size:`xs`,class:`channel-brief-update`,onClick:r[8]||=e=>we()}),J(b,{label:`编辑`,color:`neutral`,variant:`link`,size:`xs`,class:`channel-brief-update`,onClick:r[9]||=e=>we(!0)})],64))]),Tr(q(`div`,Vne,[q(`div`,{class:`channel-brief-text markdown-body`,innerHTML:o.value.rendered_brief},null,8,Hne),q(`div`,Une,[be.value?X(``,!0):(W(),G(`span`,Wne,F(L(n).progress_speaker(o.value)),1)),q(`small`,null,F(L(n).brief_meta(o.value)),1)])],512),[[Jc,!O.value]])])],2)):X(``,!0)],2),o.value?(W(),G(`div`,{key:0,class:N([`channel-body`,{"channel-body-discussion":L(t).tab===`discussion`}])},[q(`div`,Gne,[Tr(J(nY,{onDetail:Me,onEdit:r[10]||=e=>u.value=`edit`},null,512),[[Jc,L(t).tab===`discussion`]]),L(t).tab===`overview`?Tr((W(),G(`div`,Kne,[J(O8),be.value?X(``,!0):(W(),K(xY,{key:0,section:`access`,onOpen:r[11]||=e=>u.value=e,onDetail:Me}))])),[[Be]]):X(``,!0),L(t).tab===`timeline`?Tr((W(),G(`div`,qne,[q(`div`,Jne,[(W(),G(U,null,V(c,e=>J(b,{key:e.value,label:e.label,size:`xs`,color:`neutral`,variant:l.value===e.value?`soft`:`ghost`,"aria-pressed":l.value===e.value,onClick:t=>l.value=e.value},null,8,[`label`,`variant`,`aria-pressed`,`onClick`])),64))]),l.value===`waterfall`?(W(),K(K7,{key:0,onDetail:Me})):(W(),K(y9,{key:1,onDetail:Me}))])),[[Be]]):X(``,!0),L(t).tab===`files`?Tr((W(),G(`div`,Yne,[he.value?(W(),K(F9,{key:o.value.id,directories:ge.value},null,8,[`directories`])):(W(),G(`p`,Xne,`当前未设置项目目录`))])),[[Be]]):X(``,!0),L(t).tab===`private`?Tr((W(),G(`div`,Zne,[(W(),K(Ste,{key:o.value.id}))])),[[Be]]):X(``,!0),J(yne)])],2)):(W(),G(`div`,Qne,[J(T,{name:`i-lucide-hash`}),r[31]||=q(`h2`,null,`新建一个协作房间`,-1),r[32]||=q(`p`,null,`邀请 AI 一起协作,随时 @ 提问;需要时开启讨论,保留所有人的观点。`,-1),J(b,{icon:`i-lucide-plus`,label:`新建房间`,color:`neutral`,onClick:r[12]||=e=>Ne()})]))]),o.value?(W(),K(Re,{key:2,content:{onInteractOutside:e=>e.preventDefault()},open:Se.value,"onUpdate:open":r[18]||=e=>Se.value=e,title:`共识与讨论记录`,description:`主持人整理的结论、共识与分歧,以及每场讨论结束时的结论。`,ui:{content:`glass-panel studio-modal channel-consensus-modal`,body:`dialog-body`}},{body:R(()=>[q(`div`,$ne,[be.value?X(``,!0):(W(),K(xY,{key:0,section:`host`,onOpen:Te,onDetail:Ee})),q(`section`,ere,[q(`div`,tre,[r[33]||=q(`div`,null,[q(`h2`,null,`当前共识`),q(`p`,null,`主持人整理的结论、共识与分歧,用 #消息编号 保留依据;讨论结束时保存进下方记录。`)],-1),Ce.value?X(``,!0):(W(),K(b,{key:0,icon:`i-lucide-pencil`,label:`编辑`,variant:`outline`,color:`neutral`,class:`channel-surface-button`,onClick:r[13]||=e=>Ce.value=!0}))]),Ce.value?(W(),G(`form`,{key:0,class:`summary-form`,onSubmit:_u(De,[`prevent`])},[J(ve,{label:`主持简报`,description:`简述结论、共识、歧义,以及接下来要追问或调整什么、为什么。`,class:`channel-brief-editor`},{default:R(()=>[J(se,{modelValue:L(_),"onUpdate:modelValue":r[14]||=e=>gn(_)?_.value=e:null,"aria-label":`主持简报正文`,rows:4,class:`w-full summary-brief-editor`,placeholder:`让返回房间的人快速理解讨论进展和主持意图。`},null,8,[`modelValue`])]),_:1}),J(ve,{label:`详细共识与进度`,description:`已达成的共识、尚未解决的问题与下一步,用 #消息编号 标注依据。`,class:`channel-state-field`},{default:R(()=>[J(se,{modelValue:L(g),"onUpdate:modelValue":r[15]||=e=>gn(g)?g.value=e:null,"aria-label":`共识与分歧正文`,rows:12,maxlength:4e3,class:`summary-editor`,placeholder:`已达成的共识、尚未解决的问题与下一步…`},null,8,[`modelValue`])]),_:1}),q(`div`,nre,[q(`span`,null,`依据消息截止 #`+F(L(t).snapshot_id),1),q(`div`,rre,[J(b,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:r[16]||=e=>Ce.value=!1}),J(b,{type:`submit`,color:`neutral`,icon:`i-lucide-check`,label:`保存共识`,class:`channel-primary-button`,loading:L(a)===`save_context`},null,8,[`loading`])])])],32)):o.value.host_brief?.text||o.value.state_text?(W(),G(U,{key:1},[q(`div`,ire,[q(`h3`,null,[r[34]||=Y(`主持简报`,-1),o.value.state_until?(W(),G(`button`,{key:0,type:`button`,class:`subtle-link`,onClick:r[17]||=e=>Ee(o.value.state_until)},`整理至 #`+F(o.value.state_until),1)):X(``,!0)]),q(`div`,{class:`markdown-body`,innerHTML:o.value.rendered_brief},null,8,are)]),P.value?(W(),G(`details`,ore,[q(`summary`,null,[r[35]||=q(`h3`,null,`详细共识与进度`,-1),r[36]||=q(`span`,null,`依据、已处理内容、未决问题与下一步`,-1),J(T,{name:`i-lucide-chevron-down`,class:`disclosure-icon`})]),q(`div`,{class:`markdown-body consensus-state`,innerHTML:P.value},null,8,sre)])):X(``,!0)],64)):(W(),G(`p`,cre,`还没有共识。主持人会在讨论中整理,也可以点“编辑”自己写。`))]),J(R6,{onDetail:Ee})])]),_:1},8,[`content`,`open`])):X(``,!0),j.value?(W(),G(`div`,{key:3,class:`channel-rail-resizer`,role:`separator`,tabindex:`0`,"aria-label":`调整右侧栏宽度`,"aria-orientation":`vertical`,"aria-controls":`channel-member-rail`,"aria-valuemin":U9,"aria-valuemax":W9,"aria-valuenow":w.value,"aria-valuetext":`${w.value} 像素`,title:`拖动调整右侧栏宽度,也可使用左右方向键`,onPointerdown:Ke,onPointermove:qe,onPointerup:Je,onPointercancel:Je,onLostpointercapture:Je,onKeydown:Ye},null,40,lre)):X(``,!0),j.value?Tr((W(),G(`aside`,ure,[q(`section`,dre,[o.value?(W(),K(C6,{key:0})):(W(),G(`div`,fre,[...r[37]||=[q(`header`,{class:`pb-header`},[q(`strong`,null,`讨论进度`)],-1),q(`p`,{class:`channel-rail-empty`},`暂无房间,新建讨论后在这里查看进度与参与者。`,-1)]]))])])),[[Be]]):X(``,!0),J(ze,{open:m.value,"onUpdate:open":r[20]||=e=>m.value=e,side:`left`,title:`房间导航`,ui:{overlay:`channel-drawer-overlay`,content:`channel-navigation-drawer`}},{content:R(()=>[J(G4,{tabs:_e.value,onSelect:je,onManage:Oe,onCreate:Ne,onCreateFolder:Pe,onManageFolder:Fe,onDeleteFolder:Ie,onArchiveFolder:Le,onArchives:ke,onTab:Ae,onSettings:r[19]||=e=>{m.value=!1,u.value=`settings`}},null,8,[`tabs`])]),_:1},8,[`open`]),o.value?(W(),K(ze,{key:5,open:h.value,"onUpdate:open":r[21]||=e=>h.value=e,side:`right`,title:`讨论进度`,description:o.value.title,ui:{overlay:`channel-drawer-overlay`,content:`progress-drawer`,body:`progress-drawer-body`}},{body:R(()=>[J(C6)]),_:1},8,[`open`,`description`])):X(``,!0),J(n4,{modelValue:u.value,"onUpdate:modelValue":r[22]||=e=>u.value=e,"reading-width":S.value,"onUpdate:readingWidth":r[23]||=e=>S.value=e,effects:C.value,"onUpdate:effects":r[24]||=e=>C.value=e,"reading-options":L(pe),"effect-options":y,"detail-id":p.value,"target-room":d.value,"target-folder":f.value},null,8,[`modelValue`,`reading-width`,`effects`,`reading-options`,`detail-id`,`target-room`,`target-folder`])],6)}}},_re=120,vre={__name:`App`,setup(e){let t={error:{color:`error`,icon:`i-lucide-circle-x`,duration:8e3},warning:{color:`warning`,icon:`i-lucide-triangle-alert`,duration:6e3},info:{color:`info`,icon:`i-lucide-info`,duration:4e3}};document.documentElement.dataset.motion=`on`;let n=JB();Dr(`discussion`,n);let r={onMousedown:e=>e.preventDefault(),onPointermove:e=>{e.pointerType!==`mouse`&&e.stopPropagation()}},i={close:`pointer-coarse:p-2.5 pointer-coarse:-m-2.5`},a=e=>{e.target===window&&e.stopImmediatePropagation()};window.addEventListener(`blur`,a,!0),ca(()=>window.removeEventListener(`blur`,a,!0));let o=NE();function s({detail:{level:e,message:n}}){let a=String(n);o.add({...t[e]||t.info,...r,ui:i,id:`${e}:${a}`,title:a.length>_re?`${a.slice(0,119)}…`:a})}document.addEventListener(`discuss:notice`,s),ca(()=>document.removeEventListener(`discuss:notice`,s));let c=Q(()=>n.view.value.device?.prompt),l=Q({get:()=>!!c.value,set:e=>{e||n.bridge.device.prompt_cancel()}});function u(){n.bridge.device.prompt_confirm()?.catch(e=>{e?.cancelled||s({detail:{level:`error`,message:e.message}})})}return(e,t)=>{let n=AA;return W(),K(n,{locale:L(KB),tooltip:{delayDuration:300},toaster:{position:`bottom-right`,max:5}},{default:R(()=>[J(L(yz),{"reduced-motion":`never`},{default:R(()=>[J(gre),c.value?(W(),K(ZQ,{key:0,open:l.value,"onUpdate:open":t[0]||=e=>l.value=e,title:c.value.title,description:c.value.description,"confirm-label":c.value.confirm_label,onConfirm:u},null,8,[`open`,`title`,`description`,`confirm-label`])):X(``,!0)]),_:1},8,[`reduced-motion`])]),_:1},8,[`locale`])}}};function Q9(){Du(vre).use(bh).directive(`keep-reading`,iG).mount(`#modern-root`)}var yre=120;function $9(){setTimeout(()=>{document.activeElement?.matches?.(`input, textarea, select, [contenteditable='true']`)||(window.scrollX||window.scrollY)&&window.scrollTo(0,0)},yre)}document.addEventListener(`focusout`,$9),window.visualViewport?.addEventListener(`resize`,$9);var bre=120;function xre(){let e=window.visualViewport,t=document.documentElement.style;e.scale>1.01||window.innerHeight-e.height<bre?t.removeProperty(`--keyboard-viewport-height`):(t.setProperty(`--keyboard-viewport-height`,`${Math.round(e.height)}px`),window.scrollY&&window.scrollTo(0,0))}window.visualViewport?.addEventListener(`resize`,xre),document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,Q9):Q9();