ai_co_discuss 0.4.48 → 0.4.49

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
@@ -56,7 +56,7 @@ Defaulting to \`null\`.`),null)}function y_(e){return __(e)&&!Number.isNaN(e)&&e
56
56
 
57
57
  `);t&&(l.value=e.trim()?`${e.trimEnd()}\n\n${t}`:t);let n=l.value,r=bt.value,a=ij.excerpts;t&&(bt.value=[],ij.excerpts=[]);let o=await s(`send`);t&&!o&&l.value===n&&(l.value=e,bt.value=[...r,...bt.value],ij.excerpts=[...a,...ij.excerpts]),await fi()}let Ia=0;function La(e){e.key!==`Escape`||e.isComposing||e.defaultPrevented||(e.target!==qe.value?.textareaRef&&e.target!==document.body||Ct.value&&!i.value.sending_message?Ia=0:e.timeStamp-Ia>rF?Ia=e.timeStamp:(Ia=0,e.preventDefault(),a.execute(`retract_latest`)))}ia(()=>window.addEventListener(`keydown`,La)),sa(()=>window.removeEventListener(`keydown`,La));function Ra(e){e.defaultPrevented||!Rk||e.key!==`Enter`||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||e.isComposing||l.value.trim()||(i.value.attachment_drafts.length||bt.value.length||St.value.length)&&(e.preventDefault(),e.stopPropagation(),Fa())}function za(e){s(`copy`,`${i.value.room_site}/r/${Xe.value.id}/messages/${e.id}`)}return(e,t)=>{let o=Zx,h=Bx,g=Ix,_=hme,T=pme,E=VD,D=qD,O=BD,k=XD,A=zD,te=YD;return G(),K(`section`,Jj,[R(i).query||R(i).source_filter?(G(),K(`div`,Yj,[J(`span`,null,I([R(i).query&&`“${R(i).query}”`,[R(i).host_only&&`主持人`,...R(i).authors.map(e=>R(a).display_name(e)),R(i).mention_only&&`@${R(a).display_name(`用户`)}`,R(i).card_kinds.length&&`${R(i).card_kinds.length} 类卡片`].filter(Boolean).join(`、`)].filter(Boolean).join(` · `))+` · `+I(R(i).messages_loading?`正在筛选…`:`${R(i).source_filter?_r.value.length:R(i).total} 条结果`),1),Y(o,{label:`清除筛选`,size:`xs`,variant:`link`,color:`neutral`,onClick:t[0]||=e=>{f.value=``,R(s)(`filter`,{query:``,mention:!1,host:!1,authors:[],kinds:[]})}})])):Z(``,!0),R(i).messages.length?(G(),K(`nav`,{key:1,ref_key:`message_map`,ref:xe,class:`channel-message-map`,style:_e({"--nav-entry-height":`${SF}px`}),"aria-label":`发言快速导航`,onWheelPassive:nl(Li,[`stop`]),onPointerleave:Bi,onFocusout:Bi,onKeydown:rl(nl(Bi,[`stop`]),[`esc`]),onContextmenu:Ii,onPointerdown:Di,onPointermove:Oi,onPointerup:Mi,onPointercancel:Mi},[J(`div`,Zj,[(G(!0),K(W,null,H(ni.value,(e,n,r,o)=>{let s=[e,Oe.value,ei.value===e.number?Ce.value:null,Ui(e)];if(o&&o.el&&o.key===e.entries[0].key&&Ps(o,s))return o;let c=(G(),K(`div`,{key:e.entries[0].key,class:`channel-map-round`,style:_e({"--round-message-count":e.count})},[(G(!0),K(W,null,H(e.entries,(e,t,n,r)=>{let o=[e.message,e.label,e.index,Ce.value===e.message.id,e.message.id===(Ce.value||R(i).messages[0]?.id),Ke.value<0?-1:Math.min(Math.abs(e.index-Ke.value),OF),Oe.value&&Ee.value===e.key];if(r&&r.el&&r.key===e.key&&Ps(r,o))return r;let s=(G(),K(`button`,{key:e.key,type:`button`,class:F([`channel-navigation-entry`,e.round?`channel-round-range`:`channel-message-jump`]),"data-author":e.round?void 0:R(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===(Ce.value||R(i).messages[0]?.id)?0:-1,"aria-current":!e.round&&Ce.value===e.message.id?`location`:void 0,"aria-describedby":Oe.value&&Ee.value===e.key?`channel-navigation-preview`:void 0,onPointerenter:t=>Pi(e,t),onPointermove:t=>Pi(e,t),onFocus:t=>Ei(e,t),onKeydown:t=>Ci(t,e.index),onClick:t=>Fi(e,t)},[e.round?(G(),K(`span`,Qj,I(e.number||``),1)):(G(),K(`span`,{key:1,class:`channel-jump-tick`,"aria-hidden":`true`,style:_e(Wi(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,Xj)):Z(``,!0),(G(),q(Jr,{to:`body`},[Ue.value?(G(),q(R(AD).div,{key:0,id:`channel-navigation-preview`,class:`channel-nav-preview`,role:`tooltip`,"aria-hidden":!Oe.value,inert:!Oe.value,"data-open":Oe.value,style:_e({left:Ae.value,y:R(Le),x:R(Ve),opacity:R(He),scale:R(Be),height:R(Re),"--preview-gap":`${xF}px`}),onPointerleave:Bi,onFocusout:Bi,onKeydown:rl(nl(Bi,[`stop`]),[`esc`])},{default:z(()=>[J(`div`,{ref_key:`preview_content`,ref:ke,class:`channel-nav-preview-content`},[De.value?(G(),K(`h3`,$j,I(Ge.value),1)):Z(``,!0),J(`div`,eM,[Y(h,{src:R(a).identities[Ue.value.author]?.icon,text:R(a).identities[Ue.value.author]?.initials||`?`,alt:R(a).display_name(Ue.value.author),size:`sm`,class:F([`channel-avatar`,R(a).identities[Ue.value.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`strong`,null,I(R(a).display_name(Ue.value.author)),1),J(`span`,null,`#`+I(Ue.value.id),1)]),J(`div`,tM,[X(I(Ge.value)+` · `+I(R(a).sources[Ue.value.source])+` · `+I(R(a).format_time(Ue.value.created_at)),1),Ue.value.kind===`moderation`?(G(),K(`span`,nM,` · 主持人`)):Ue.value.kind===`receipt`?(G(),K(`span`,rM,` · 运行回执`)):Z(``,!0)]),J(`div`,{class:`channel-nav-preview-text markdown-body`,innerHTML:Ue.value.summary?Ue.value.rendered_summary:Ue.value.rendered_text},null,8,iM)],512)]),_:1},8,[`aria-hidden`,`inert`,`data-open`,`style`,`onKeydown`])):Z(``,!0)])),w.value&&!w.value.touch?(G(),K(`div`,{key:2,class:`channel-offer-marks`,style:_e({left:`${w.value.left}px`,top:`${w.value.top}px`})},[J(`button`,{type:`button`,class:`channel-listen-mark`,title:`把选中的文字作为摘录添加到对话`,onMousedown:t[5]||=nl(()=>{},[`prevent`]),onClick:se},[Y(g,{name:`i-lucide-message-square-quote`}),t[41]||=X(`添加到对话`,-1)],32),w.value.speech?(G(),K(`button`,{key:0,type:`button`,class:`channel-listen-mark`,title:`从选中处开始朗读`,"aria-label":`从选中处开始朗读`,onMousedown:t[6]||=nl(()=>{},[`prevent`]),onClick:ve},[Y(g,{name:`i-lucide-headphones`}),t[42]||=X(`朗读`,-1)],32)):Z(``,!0)],4)):Z(``,!0),j.value?(G(),K(`form`,{key:3,class:F([`selection-comment`,{"is-docked":j.value.touch}]),style:_e(j.value.touch?{}:{left:`${j.value.left}px`,top:`${j.value.top}px`}),onSubmit:nl(me,[`prevent`])},[wr(J(`textarea`,{ref_key:`quote_input`,ref:N,"onUpdate:modelValue":t[7]||=e=>M.value=e,rows:`1`,placeholder:`添加批注(可选)`,"aria-label":`摘录的批注(可选)`,enterkeyhint:`send`,onKeydown:he},null,544),[[Gc,M.value]]),J(`button`,{type:`button`,class:`selection-comment-cancel`,"aria-label":`取消添加`,title:`取消`,onClick:pe},[Y(g,{name:`i-lucide-x`})]),J(`button`,aM,[Y(g,{name:`i-lucide-arrow-up`})])],38)):Z(``,!0),ee.value?(G(),q(rj,{key:ee.value.excerpt.id,comment:ee.value.excerpt.comment,style:_e({left:`${ee.value.left}px`,top:`${ee.value.top}px`}),onSave:de,onCancel:ue,onRemove:fe},null,8,[`comment`,`style`])):Z(``,!0),Ns([R(Qr),R(i).messages_loading,R(i).messages_failure,R(i).sending_preview,R(i).failed_sends,R(ti),at.value,Xe.value.session,$e.value,m.value.size,R(v).state.message_id,Xe.value.title,R(i).query,R(i).source_filter,R(i).authors,R(i).card_kinds,R(xr),R(Sr),R(It),R(Lt),R(Ht),Vt.value,R(Gt),R(qt),R(c),ut.value,ht.value,va.value,R(kr),U.value,wa.size,Ta.value,ya.value,ct.value,ca.value,la.value,dt.value,Ct.value,R(i).sending_message,R(Kt),et.value,Xe.value.free],()=>(G(),K(`div`,{ref_key:`transcript`,ref:p,class:`channel-transcript`,"aria-label":`聊天记录`,onScroll:ui,onWheelPassive:t[16]||=e=>{xi(e),bi(e)},onTouchstartPassive:xi,onTouchmovePassive:bi,onTouchendPassive:Si,onTouchcancelPassive:Si,onPointerdown:bi,onKeydown:t[17]||=e=>{xi(e),bi(e)}},[!R(i).query&&!R(i).source_filter&&!R(xr)&&Fr.value===0?(G(),K(`div`,oM,[Y(tO,{ref:e=>hn(r)?r.value=e:r=e,onEdit:t[8]||=e=>n(`edit`)},null,512)])):Z(``,!0),(G(!0),K(W,null,H(R(Qr),e=>(G(),K(`div`,{key:e.key,class:`channel-message-group`},[Y(_,{label:e.label,class:`channel-date-divider`},null,8,[`label`]),(G(!0),K(W,null,H(e.messages,e=>(G(),K(W,{key:e.id},[e.id===R(Sr)&&!R(i).query&&!R(i).source_filter?(G(),q(_O,{key:0})):Z(``,!0),e.id===R(xr)&&!R(i).query&&!R(i).source_filter?(G(),q(tO,{key:1,ref_for:!0,ref:e=>hn(r)?r.value=e:r=e,onEdit:t[9]||=e=>n(`edit`)},null,512)):Z(``,!0),e.arrangement?(G(),q(ZD,{key:2,icon:`i-lucide-list-ordered`,plain:``,title:`主持人创建的发言安排`,label:`主持人安排`,"toggle-label":`展开或收起各专家的任务`},{text:z(()=>[X(`主持人安排:`+I(R(qt).get(e.arrangement.after_message_id)?.find(t=>t.id===e.arrangement.id)?.label),1),e.arrangement.after_message_id?(G(),K(`small`,sM,`耗时 `+I(Yt(Xt(e.arrangement,R(i).messages.find(t=>t.id===e.arrangement.after_message_id)))),1)):Z(``,!0)]),default:z(()=>[(G(!0),K(W,null,H(e.arrangement.turns,t=>(G(),K(`p`,{key:`${e.id}-${t.expert}-${t.question}`},[J(`span`,null,I(R(a).display_name(t.expert))+`:`+I(t.question),1)]))),128))]),_:2},1024)):e.source===`goal`?(G(),q(EO,{key:3,message:e},null,8,[`message`])):e.source===`notice`?(G(),q(ZD,{key:4,icon:`i-lucide-bell`,plain:``,expandable:!1,label:`程序通知主持人`},{text:z(()=>[X(I(e.text),1)]),_:2},1024)):e.cancelled_turn||e.cancelled_execution?(G(),q(T,{key:5,id:e.id,"data-author":R(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:z(()=>[J(`div`,cM,[Y(h,{src:R(a).identities[e.author]?.icon,text:R(a).identities[e.author]?.initials||`?`,alt:R(a).display_name(e.author),size:`md`,class:F([`channel-avatar`,R(a).identities[e.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`div`,lM,[J(`div`,uM,[J(`strong`,null,I(R(a).display_name(e.author)),1)])]),e.cancelled_turn?(G(),K(`span`,dM,`已错过 · 安排 #`+I(e.cancelled_turn.display_id||e.cancelled_turn.id),1)):(G(),K(`span`,fM,I(Pt(e.cancelled_execution).label)+` · 执行 #`+I(e.execution_id),1))]),J(`div`,pM,I(e.cancelled_turn?`本次发言已被跳过或取消,未回答。`:e.cancelled_execution.result||`本次执行已作废,未回答。`),1),(G(!0),K(W,null,H([e.cancelled_execution||(Xe.value.free?.executions||[]).find(t=>t.id===e.execution_id)].filter(e=>e&&Pt(e).note),e=>(G(),K(W,{key:e.id},[J(`p`,mM,I(Pt(e).note),1),e.late_answer&&R(i).access?.can_manage?(G(),K(`details`,{key:0,class:`channel-receipt`,onToggle:t=>ft(e.id,t)},[J(`summary`,{"aria-label":`查看 ${R(a).display_name(e.member)} 未采纳的回答`},`未采纳的回答`,8,gM),J(`div`,_M,I(dt.value.get(e.id)?.text??`正在读取…`),1)],40,hM)):Z(``,!0)],64))),128))]),_:2},1032,[`id`,`data-author`])):e.slot_card&&!e.failure&&!e.retry?(G(),K(`div`,{key:6,id:`execution-${e.id}`,class:`channel-working-strip`,"data-author":R(a).identities[e.author]?.style},[J(`div`,yM,[Y(h,{src:R(a).identities[e.author]?.icon,text:R(a).identities[e.author]?.initials||`?`,alt:R(a).display_name(e.author),size:`2xs`,class:F([`channel-avatar`,R(a).identities[e.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`strong`,bM,I(R(a).display_name(e.author)),1),e.background?(G(),q(JD,{key:0,text:`后台进行:主持人没有等它,接着在做别的`},{default:z(()=>[Y(g,{name:`i-lucide-split`,class:`channel-working-background`,role:`img`,"aria-label":`后台进行:主持人没有等它`})]),_:1})):Z(``,!0),J(`small`,xM,I(e.waiting?`手动启动${e.created_at?` · 已等 ${Yt(Math.max(0,ct.value-e.created_at))}`:``}`:`已用 ${Yt(Math.max(0,ct.value-e.created_at))}`)+I(e.steps?` · 已执行 ${e.steps} 步`:``)+I(e.attempt?` · 第 ${e.attempt}/${QF} 次重试`:``),1),R(i).access?.can_manage&&Nt(e)&&e.execution_id?(G(),q(JD,{key:1,text:`私聊:查看它正在做什么`},{default:z(()=>[Y(o,{icon:`i-lucide-message-square`,class:`channel-private-chat-key channel-corner-key`,size:`xs`,variant:`ghost`,color:`neutral`,"aria-label":`私聊 ${R(a).display_name(e.author)}:查看本次执行过程`,onClick:t=>R(Lk)(R(s),e.author,e.execution_id)},null,8,[`aria-label`,`onClick`])]),_:2},1024)):Z(``,!0),R(i).access?.can_manage?(G(),K(`span`,SM,[et.value?.expert===e.author&&e.discussion_request?(G(),K(W,{key:0},[Y(JD,{text:`暂停讨论`},{default:z(()=>[Y(o,{icon:`i-lucide-pause`,size:`xs`,variant:`ghost`,color:`neutral`,"aria-label":`暂停讨论,停止 ${R(a).display_name(e.author)} 本次发言`,disabled:!!R(c),loading:R(c)===`pause_discussion`,onClick:t[10]||=e=>R(s)(`pause_discussion`)},null,8,[`aria-label`,`disabled`,`loading`])]),_:2},1024),Y(JD,{text:`停止本次发言,轮到下一位`},{default:z(()=>[Y(o,{variant:`solid`,color:`neutral`,class:`channel-stop-button`,"aria-label":`停止 ${R(a).display_name(e.author)} 本次发言,轮到下一位`,disabled:!!R(c),loading:R(c)===`skip_turn`,onClick:t[11]||=e=>R(s)(`skip_turn`)},{default:z(()=>[...t[43]||=[J(`span`,{class:`channel-stop-square`},null,-1)]]),_:1},8,[`aria-label`,`disabled`,`loading`])]),_:2},1024)],64)):(G(),q(JD,{key:1,text:`停止`},{default:z(()=>[Y(o,{variant:`solid`,color:`neutral`,class:`channel-stop-button`,"aria-label":`停止 ${R(a).display_name(e.author)} 本次执行`,disabled:!!R(c),loading:R(c)===`change_member`&&ya.value===e.member_id,onClick:t=>ba(e)},{default:z(()=>[...t[44]||=[J(`span`,{class:`channel-stop-square`},null,-1)]]),_:1},8,[`aria-label`,`disabled`,`loading`,`onClick`])]),_:2},1024))])):Z(``,!0)]),R(i).access?.can_manage&&Nt(e)&&e.execution_id?(G(),K(`div`,CM,[J(`div`,wM,[J(`div`,TM,[Y(JD,{text:`私聊:查看它正在做什么`},{default:z(()=>[Y(o,{icon:`i-lucide-message-square`,class:`channel-private-chat-key`,size:`xs`,variant:`ghost`,color:`neutral`,"aria-label":`私聊 ${R(a).display_name(e.author)}:查看本次执行过程`,onClick:t=>R(Lk)(R(s),e.author,e.execution_id)},null,8,[`aria-label`,`onClick`])]),_:2},1024)])])])):Z(``,!0),J(`div`,EM,[(G(!0),K(W,null,H([vt(e)],t=>(G(),K(`span`,{key:e.id,class:F([`channel-working-status`,{"channel-working-warning":t.warning}]),role:`status`,title:Nt(e)?e.waiting?e.text:t.text:`此接入方式看不到进度,可在原窗口查看`},[e.waiting?(G(),K(`span`,OM,I(e.text),1)):t.live?(G(),q(HO,{key:1,text:t.text,seed:e.author,beat:e.activity_at,silent:ct.value-(e.activity_at||e.created_at),dots:``,muted:!Nt(e)},null,8,[`text`,`seed`,`beat`,`silent`,`muted`])):(G(),K(`span`,kM,I(t.text),1))],10,DM))),128))]),(G(!0),K(W,null,H([pt(e)].filter(e=>e.length),t=>(G(),K(`div`,{key:e.execution_id,class:F([`channel-working-notes`,{"is-open":ht.value.has(e.execution_id),"is-single":t.length===1}])},[ht.value.has(e.execution_id)?(G(!0),K(W,{key:0},H(t.slice(0,-1),e=>(G(),K(`p`,{key:e.seq},I(e.text),1))),128)):Z(``,!0),J(`p`,{class:`channel-working-latest`,onClick:n=>t.length===1||ht.value.has(e.execution_id)||gt(e.execution_id)},[J(`span`,jM,I(t.at(-1).text),1),t.length>1?(G(),K(`button`,{key:0,type:`button`,class:`channel-working-count`,"aria-expanded":ht.value.has(e.execution_id),"aria-label":ht.value.has(e.execution_id)?`收起过程说明`:`展开全部 ${t.length} 段过程说明`,onClick:nl(t=>gt(e.execution_id),[`stop`])},[X(I(t.length)+` 段`,1),Y(g,{name:`i-lucide-chevron-down`})],8,MM)):Z(``,!0)],8,AM)],2))),128))],8,vM)):e.slot_card&&!e.failure?(G(),q(T,{key:7,id:`execution-${e.id}`,"data-author":R(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:z(()=>[J(`div`,NM,[Y(h,{src:R(a).identities[e.author]?.icon,text:R(a).identities[e.author]?.initials||`?`,alt:R(a).display_name(e.author),size:`md`,class:F([`channel-avatar`,R(a).identities[e.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`div`,PM,[J(`div`,FM,[J(`strong`,null,I(R(a).display_name(e.author)),1)]),J(`div`,IM,[e.created_at?(G(),K(W,{key:0},[J(`time`,{title:new Date(e.created_at*1e3).toLocaleString(`zh-CN`)},I(R(a).format_time(e.created_at*1e3)),9,LM),t[45]||=X(` · `,-1)],64)):Z(``,!0),X(I(e.waiting?`手动启动${e.created_at?` · 已等 ${Yt(Math.max(0,ct.value-e.created_at))}`:``}`:`已用 ${Yt(Math.max(0,ct.value-e.created_at))}`),1)])])]),J(`div`,RM,[(G(!0),K(W,null,H([vt(e)],t=>(G(),K(`div`,{key:e.id,class:F([`channel-message-text`,{"channel-working-warning":t.warning}]),role:`status`,"aria-label":`${R(a).display_name(e.author)} ${t.text}`,title:Nt(e)?void 0:`此接入方式看不到进度,可在原窗口查看`},[e.waiting?(G(),K(`span`,BM,I(e.text),1)):t.live?(G(),q(HO,{key:1,text:t.text,seed:e.author,beat:e.activity_at,silent:ct.value-(e.activity_at||e.created_at),dots:``,muted:!Nt(e)},null,8,[`text`,`seed`,`beat`,`silent`,`muted`])):(G(),K(`span`,VM,I(t.text),1))],10,zM))),128))]),e.retry?(G(),K(W,{key:0},[J(`p`,HM,I(e.retry.reason),1),J(`div`,UM,[J(`span`,WM,I(e.retry.retry_at>ct.value?`${e.retry.retry_at-ct.value} 秒后自动重试`:`正在重试`)+`(第 `+I(e.retry.attempt)+`/`+I(QF)+` 次)`,1),R(i).access?.can_manage?(G(),K(W,{key:0},[Y(o,{label:`立即重试`,icon:`i-lucide-rotate-ccw`,size:`sm`,variant:`soft`,color:`primary`,"aria-label":`立即重新投递给 ${R(a).display_name(e.author)}`,disabled:!!R(c),onClick:t=>R(s)(`retry_delivery`,{execution_id:e.execution_id,action:`retry_now`})},null,8,[`aria-label`,`disabled`,`onClick`]),Y(o,{label:`停止`,icon:`i-lucide-circle-stop`,size:`sm`,variant:`soft`,color:`error`,"aria-label":`停止自动重试 ${R(a).display_name(e.author)} 的投递`,disabled:!!R(c),onClick:t=>R(s)(`retry_delivery`,{execution_id:e.execution_id,action:`retry_stop`})},null,8,[`aria-label`,`disabled`,`onClick`])],64)):Z(``,!0)])],64)):Z(``,!0),ut.value.get(e.execution_id)?.length?(G(),q(FO,{key:1,live:``,notes:ut.value.get(e.execution_id)},null,8,[`notes`])):Z(``,!0)]),_:2},1032,[`id`,`data-author`])):e.failure?(G(),K(`section`,{key:8,id:e.id,class:`channel-message channel-failed-execution`,"data-author":R(a).identities[e.author]?.style,"aria-label":`${R(a).display_name(e.author)} ${e.undeliverable?`无法投递`:`执行失败`}`},[J(`div`,KM,[Y(h,{src:R(a).identities[e.author]?.icon,text:R(a).identities[e.author]?.initials||`?`,alt:R(a).display_name(e.author),size:`md`,class:F([`channel-avatar`,R(a).identities[e.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`div`,qM,[J(`div`,JM,[J(`strong`,null,I(R(a).display_name(e.author)),1),e.failure.role===`host`?(G(),K(`span`,YM,`主持工作`)):Z(``,!0),Y(E,{label:e.undeliverable?`无法投递`:`执行失败`,color:`error`,variant:`soft`,size:`xs`},null,8,[`label`])]),(G(!0),K(W,null,H([e.slot_card?e.created_at*1e3:e.created_at],t=>(G(),K(`div`,{key:e.id,class:`channel-message-provenance`},[J(`time`,{title:new Date(t).toLocaleString(`zh-CN`)},I(R(a).format_time(t)),9,XM),e.failure.id?(G(),K(`span`,ZM,`执行 #`+I(e.failure.id),1)):Z(``,!0)]))),128))]),e.failure.elapsed_seconds==null?Z(``,!0):(G(),K(`span`,QM,`耗时 `+I(Yt(e.failure.elapsed_seconds)),1))]),J(`div`,$M,[J(`p`,eN,I(e.failure.result||`执行失败,未提供原因`),1),ra(e.failure)?(G(),K(`div`,tN,[Y(JD,{text:`重试`},{default:z(()=>[Y(o,{icon:`i-lucide-rotate-cw`,variant:`solid`,color:`neutral`,class:`channel-stop-button channel-retry-button`,"aria-label":`把执行 #${e.failure.id} 的请求重新派给 ${R(a).display_name(e.author)}`,disabled:!!R(c),loading:R(c)===`retry_delivery`,onClick:t=>R(s)(`retry_delivery`,{execution_id:e.failure.id,action:`retry`})},null,8,[`aria-label`,`disabled`,`loading`,`onClick`])]),_:2},1024)])):Z(``,!0)]),e.failure.notes?(G(),q(FO,{key:0,count:e.failure.notes,notes:ut.value.get(e.failure.id),load:()=>mt(e.failure.id)},null,8,[`count`,`notes`,`load`])):Z(``,!0),e.failure.denials?.length?(G(),q(AO,{key:1,denials:e.failure.denials,allowable:!!oa(e.failure),busy:ca.value===e.failure.id,error:la.value[e.failure.id],onAllow:t=>ua(e.failure)},null,8,[`denials`,`allowable`,`busy`,`error`,`onAllow`])):Z(``,!0)],8,GM)):e.withdrawn?(G(),K(`div`,{key:9,id:String(e.id),"data-message-id":e.id,class:`channel-withdrawn`,"data-author":R(a).identities[e.author]?.style},[Y(g,{name:e.withdrawn===`retracted`?`i-lucide-undo-2`:`i-lucide-history`,class:`channel-withdrawn-icon`},null,8,[`name`]),e.withdrawn===`retracted`?(G(),K(`span`,rN,I(R(a).display_name(e.author))+` 撤回了一条消息`,1)):R(kr).runs.has(e.id)&&!Or.value.has(e.id)?(G(),K(W,{key:1},[J(`span`,null,`已回退 `+I(R(kr).runs.get(e.id))+` 条记录`,1),Y(o,{label:`展开`,size:`xs`,variant:`link`,color:`neutral`,"aria-label":`展开从 #${e.id} 起已回退的记录`,onClick:t=>Ar(e.id)},null,8,[`aria-label`,`onClick`])],64)):(G(),K(W,{key:2},[J(`strong`,null,I(R(a).display_name(e.author)),1),J(`span`,iN,I(e.text),1),Y(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`]),R(kr).runs.has(e.id)?(G(),q(o,{key:0,label:`收起`,size:`xs`,variant:`link`,color:`neutral`,"aria-label":`收起从 #${e.id} 起已回退的记录`,onClick:t=>Ar(e.id)},null,8,[`aria-label`,`onClick`])):Z(``,!0)],64))],8,nN)):(G(),K(W,{key:10},[(G(!0),K(W,null,H([ka(e)],r=>(G(),q(R(qj),{key:e.id,deps:r.deps},{default:z(()=>[Y(T,{id:String(e.id),"data-message-id":e.id,"data-author":R(a).identities[e.author]?.style,tabindex:`-1`,onPointerenter:t=>r.armed||Da(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:z(()=>[J(`div`,aN,[Y(h,{src:R(a).identities[e.author]?.icon,text:R(a).identities[e.author]?.initials||`?`,alt:R(a).display_name(e.author),size:`md`,class:F([`channel-avatar`,R(a).identities[e.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`div`,oN,[J(`div`,sN,[J(`strong`,null,I(R(a).display_name(e.author)),1),J(`span`,cN,I(r.round_label),1),Y(E,{size:`xs`,color:`neutral`,variant:`soft`,class:`channel-source`},{default:z(()=>[X(I(R(a).sources[e.source]),1)]),_:2},1024),e.kind===`moderation`?(G(),q(E,{key:0,size:`xs`,color:`neutral`,variant:`soft`,class:`channel-source`},{default:z(()=>[...t[46]||=[X(`主持人`,-1)]]),_:1})):Z(``,!0),e.kind===`receipt`?(G(),q(E,{key:1,size:`xs`,color:`neutral`,variant:`soft`,class:`channel-source`},{default:z(()=>[...t[47]||=[X(`运行回执`,-1)]]),_:1})):Z(``,!0),e.proactive?(G(),q(E,{key:2,size:`xs`,color:`neutral`,variant:`soft`,class:`channel-source`,title:`成员在自己的窗口里应用户要求主动发言,不是在回答房间的请求`},{default:z(()=>[...t[48]||=[X(`主动发言`,-1)]]),_:1})):Z(``,!0),r.waits?(G(),q(E,{key:3,size:`xs`,color:`warning`,variant:`soft`,class:`channel-source`,title:r.speaking_expert?`${R(a).display_name(r.speaking_expert)} 说完后交给主持人处理`:`等待主持人处理`},{default:z(()=>[...t[49]||=[X(`待主持人处理`,-1)]]),_:1},8,[`title`])):Z(``,!0),(G(!0),K(W,null,H(r.badges,e=>(G(),q(E,{key:e.key,size:`xs`,color:e.color,variant:`soft`,class:`channel-source`,title:e.title},{default:z(()=>[X(I(e.label),1)]),_:2},1032,[`color`,`title`]))),128))]),J(`div`,lN,[J(`time`,{title:new Date(e.created_at).toLocaleString(`zh-CN`)},I(R(a).format_time(e.created_at)),9,uN),Y(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!==`用户`)?(G(),K(`span`,dN,I(R(a).display_name(e.submitted_by))+` 代发`,1)):Z(``,!0),e.source===`auto`?(G(),K(`span`,fN,`自动收录`)):Z(``,!0)])]),r.elapsed===null?Z(``,!0):(G(),K(`span`,pN,`耗时 `+I(Yt(r.elapsed)),1))]),e.reply_to?(G(),q(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`])):Z(``,!0),e.kind===`receipt`?(G(),K(`details`,mN,[J(`summary`,{"aria-label":`查看运行回执 #${e.id}`},`运行回执详情`,8,hN),J(`div`,{class:`channel-message-text markdown-body`,innerHTML:e.rendered_text},null,8,gN)])):r.editing?(G(),K(`form`,{key:2,class:`channel-edit`,"aria-label":`编辑消息 #${e.id}`,onSubmit:nl(Ma,[`prevent`])},[wr(J(`textarea`,{"onUpdate:modelValue":t[12]||=e=>va.value.text=e,rows:`3`,maxlength:R(a).max_message_length,"aria-label":`编辑后的消息`,onKeydown:[rl(nl(ja,[`prevent`]),[`esc`]),rl(nl(Ma,[`ctrl`,`prevent`]),[`enter`]),rl(nl(Ma,[`meta`,`prevent`]),[`enter`])]},null,40,vN),[[Gc,va.value.text]]),J(`p`,{class:F([`channel-edit-note`,{"is-error":r.editing_error}]),role:`status`},I(r.editing_error||(r.editing_plan?Na(r.editing_plan):`正在读取回退范围…`)),3),J(`div`,yN,[Y(o,{label:`取消`,size:`xs`,variant:`ghost`,color:`neutral`,onClick:ja}),Y(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,_N)):(G(),K(`div`,bN,[J(`div`,{id:`channel-answer-${e.id}`,class:`channel-message-text markdown-body`,innerHTML:r.expanded?e.rendered_text:r.preview.html},null,8,xN),(G(!0),K(W,null,H(r.marks,e=>(G(),K(`button`,{key:e.id,type:`button`,class:`excerpt-mark`,style:_e({left:`${e.left}px`,top:`${e.top}px`}),title:`摘录 ${e.number}:点击修改批注`,"aria-label":`修改摘录 ${e.number} 的批注`,onClick:t=>le(e.id)},I(e.number),13,SN))),128)),r.preview.truncated?(G(),q(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=>vi(e,t)},null,8,[`label`,`trailing-icon`,`aria-label`,`aria-expanded`,`aria-controls`,`onClick`])):Z(``,!0)])),e.summary?(G(),K(`div`,CN,[J(`small`,null,[t[50]||=X(`回答摘要`,-1),e.summary_by&&e.summary_by!==e.author?(G(),K(`span`,wN,` · `+I(R(a).display_name(e.summary_by))+` 整理`,1)):Z(``,!0)]),J(`div`,{class:`channel-message-text markdown-body`,innerHTML:e.rendered_summary},null,8,TN)])):Z(``,!0),r.notes_count?(G(),q(FO,{key:5,count:r.notes_count,notes:r.notes,load:()=>mt(r.execution_id)},null,8,[`count`,`notes`,`load`])):Z(``,!0),e.attachments?.length?(G(),K(`div`,{key:6,innerHTML:R(a).attachment_markup(e.attachments)},null,8,EN)):Z(``,!0),r.recommendation?(G(),K(`div`,{key:7,class:F([`channel-recommendation`,`is-${r.recommendation.status}`]),"aria-label":`智能调度推荐`,"aria-live":`polite`},[(G(!0),K(W,null,H([r.recommendation],e=>(G(),K(W,{key:e.message_id},[Y(g,{name:`i-lucide-zap`,class:`channel-recommendation-icon`}),e.status===`open`?(G(),K(`span`,DN,[t[51]||=X(`智能调度建议让 `,-1),J(`strong`,null,I(R(a).display_name(e.member)),1),t[52]||=X(` 回答`,-1),J(`small`,{title:`${e.label},置信度 ${Number(e.confidence).toFixed(2)}`},`置信度 `+I(Number(e.confidence).toFixed(2))+` · `+I(e.remaining)+` 秒`,9,ON)])):e.status===`waiting`?(G(),K(`span`,kN,`智能调度:主持人答完后请 `+I(R(a).display_name(e.member))+` 回答`,1)):(G(),K(`span`,AN,`智能调度:`+I(e.mode===`interrupt`?`已打断主持人,改由 ${R(a).display_name(e.member)} 回答`:`已请 ${R(a).display_name(e.member)} 回答`),1)),e.can_adopt?(G(),K(W,{key:3},[r.adopting?(G(),K(W,{key:1},[Y(o,{label:`打断主持人,改由 ${R(a).display_name(e.member)} 回答`,size:`xs`,variant:`soft`,color:`warning`,onClick:t=>Jt(e.message_id,`interrupt`)},null,8,[`label`,`onClick`]),Y(o,{label:`主持人答完后再请 ${R(a).display_name(e.member)}`,size:`xs`,variant:`soft`,color:`neutral`,onClick:t=>Jt(e.message_id,`after`)},null,8,[`label`,`onClick`]),Y(o,{icon:`i-lucide-x`,"aria-label":`取消采纳`,size:`xs`,variant:`ghost`,color:`neutral`,onClick:t[13]||=e=>Vt.value=0})],64)):(G(),q(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?Vt.value=e.message_id:Jt(e.message_id,`after`)},null,8,[`aria-label`,`onClick`]))],64)):Z(``,!0)],64))),128))],2)):Z(``,!0),(G(!0),K(W,null,H(r.report_rows,({report:e,allowable:t,failed:n})=>(G(),K(`section`,{key:e.id,class:`channel-execution-report`,"aria-label":`执行报告 #${e.id}`},[J(`div`,null,[J(`strong`,null,`执行 #`+I(e.id)+` · `+I(e.label),1)]),e.changes?.length?(G(),K(`p`,MN,`文件变化:`+I(e.changes.join(`、`)),1)):Z(``,!0),e.status!==`completed`&&e.result?(G(),K(`p`,NN,I(e.result),1)):Z(``,!0),e.denials?.length?(G(),q(AO,{key:2,denials:e.denials,allowable:t,busy:r.allowing===e.id,error:r.allow_errors?.[e.id],onAllow:t=>ua(e)},null,8,[`denials`,`allowable`,`busy`,`error`,`onAllow`])):Z(``,!0),n?(G(),q(o,{key:3,label:`重发`,icon:`i-lucide-rotate-ccw`,size:`xs`,variant:`soft`,color:`neutral`,"aria-label":`把执行 #${e.id} 的原消息填回输入框重发`,onClick:t=>aa(e)},null,8,[`aria-label`,`onClick`])):Z(``,!0)],8,jN))),128))]),header:z(()=>[J(`div`,PN,[J(`div`,FN,[J(`div`,IN,[r.private_chat?(G(),q(_a(r.armed?JD:Ea),{key:0,"disable-hoverable-content":``,ui:Ca,text:`私聊:查看这次执行的过程`},{default:z(()=>[Y(o,{icon:`i-lucide-message-square`,class:`channel-private-chat-key`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":`查看 #${e.id} 的执行过程`,onClick:t=>R(Lk)(R(s),e.author,r.execution_id)},null,8,[`aria-label`,`onClick`])]),_:2},1024)):Z(``,!0),!r.private_chat&&!r.can_take_back?(G(),q(_a(r.armed?JD:Ea),{key:1,"disable-hoverable-content":``,ui:Ca,text:`回复`},{default:z(()=>[Y(o,{icon:`i-lucide-corner-up-left`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":`回复 #${e.id}`,onClick:t=>Pa(e)},null,8,[`aria-label`,`onClick`])]),_:2},1024)):Z(``,!0),r.can_retract&&!r.editing?(G(),q(_a(r.armed?JD:Ea),{key:2,"disable-hoverable-content":``,ui:Ca,text:`撤回`},{default:z(()=>[Y(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)):Z(``,!0),r.can_take_back&&!r.editing?(G(),q(_a(r.armed?JD:Ea),{key:3,"disable-hoverable-content":``,ui:Ca,text:`编辑`},{default:z(()=>[Y(o,{icon:`i-lucide-pencil`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":`编辑 #${e.id},回退到它之前重新发送`,onClick:t=>Aa(e)},null,8,[`aria-label`,`onClick`])]),_:2},1024)):Z(``,!0),!r.narrow&&e.kind!==`receipt`&&!r.editing?(G(),q(_a(r.armed?JD:Ea),{key:4,"disable-hoverable-content":``,ui:Ca,text:r.reading?`停止朗读`:`朗读`},{default:z(()=>[Y(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?R(v).stop():R(v).start(e.id)},null,8,[`icon`,`aria-label`,`onClick`])]),_:2},1032,[`text`])):Z(``,!0),r.armed?(G(),q(D,{key:5,open:r.menu_open,items:r.actions,content:{align:`end`,sideOffset:5},ui:{content:`channel-menu`},"onUpdate:open":t=>Ta.value=t?e.id:0},{default:z(()=>[Y(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`])):(G(),q(o,{key:6,icon:`i-lucide-ellipsis`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-label":`消息 #${e.id} 的更多操作`,"aria-haspopup":`menu`,onClick:t=>Oa(e.id)},null,8,[`aria-label`,`onClick`]))])])])]),_:2},1032,[`id`,`data-message-id`,`data-author`,`onPointerenter`,`role`])]),_:2},1032,[`deps`]))),128)),R(Kt).has(e.id)&&!R(Gt).get(e.id)?.length?(G(),q(ZD,{key:0,icon:`i-lucide-zap`,skipped:``,label:`智能调度分析中`,expandable:!1},{text:z(()=>[Y(HO,{text:`智能调度:正在分析`,seed:`智能调度`,dots:``})]),_:1})):Z(``,!0),(G(!0),K(W,null,H(R(Gt).get(e.id)||[],e=>(G(),q(zme,{key:`decision-${e.id}`,decision:e,free:at.value},null,8,[`decision`,`free`]))),128)),R(i).source_filter?(G(),K(`div`,LN,[Y(o,{label:`在原文中定位`,icon:`i-lucide-locate`,size:`xs`,color:`neutral`,variant:`link`,onClick:t=>yr(e)},null,8,[`onClick`])])):Z(``,!0)],64))],64))),128))]))),128)),(G(!0),K(W,null,H(R(i).failed_sends,e=>(G(),K(`div`,{key:e.id,class:`channel-message-group`},[Y(T,{"data-author":R(a).identities[e.author]?.style,role:`user`,parts:[],side:`left`,variant:`naked`,color:`neutral`,class:`channel-message channel-sending-message is-failed`,ui:{header:`channel-message-header`,container:`channel-message-container`,body:`channel-message-body`}},{body:z(()=>[J(`div`,RN,[Y(h,{src:R(a).identities[e.author]?.icon,text:R(a).identities[e.author]?.initials||`?`,alt:R(a).display_name(e.author),size:`md`,class:F([`channel-avatar`,R(a).identities[e.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`div`,zN,[J(`div`,BN,[J(`strong`,null,I(R(a).display_name(e.author)),1),Y(E,{label:`发送失败`,color:`error`,variant:`soft`,size:`xs`})]),J(`div`,VN,[J(`time`,null,I(R(a).format_time(e.created_at)),1)])])]),J(`div`,HN,[J(`div`,{class:`channel-message-text markdown-body`,innerHTML:R(a).render_room_markdown(e.text)},null,8,UN)]),e.files.some(e=>e.preview_url)?(G(),K(`div`,WN,[(G(!0),K(W,null,H(e.files.filter(e=>e.preview_url),e=>(G(),K(`span`,{key:e.preview_url,class:`attachment-image`},[J(`img`,{src:e.preview_url,alt:e.name},null,8,GN)]))),128))])):Z(``,!0),e.files.some(e=>!e.preview_url)?(G(),K(`div`,KN,`附件:`+I(e.files.filter(e=>!e.preview_url).map(e=>e.name).join(`、`)),1)):Z(``,!0),J(`p`,qN,I(e.failed),1),J(`div`,JN,[Y(o,{label:`重新发送`,icon:`i-lucide-rotate-ccw`,size:`sm`,variant:`soft`,color:`primary`,"aria-label":`重新发送这条消息`,disabled:R(i).sending_message,onClick:t=>R(s)(`retry_sending`,e.id)},null,8,[`disabled`,`onClick`]),Y(o,{label:`放弃`,icon:`i-lucide-x`,size:`sm`,variant:`soft`,color:`neutral`,"aria-label":`放弃发送,移除这张卡片`,onClick:t=>R(s)(`discard_sending`,e.id)},null,8,[`onClick`])])]),_:2},1032,[`data-author`])]))),128)),R(i).sending_preview?(G(),q(R(AD).div,{key:1,class:`channel-message-group`,style:_e({opacity:R(pi),y:R(mi)})},{default:z(()=>[Y(T,{id:`channel-sending-message`,"data-author":R(a).identities[R(i).sending_preview.author]?.style,role:`user`,parts:[],side:`left`,variant:`naked`,color:`neutral`,class:`channel-message channel-sending-message`,ui:{header:`channel-message-header`,container:`channel-message-container`,body:`channel-message-body`}},{body:z(()=>[J(`div`,YN,[Y(h,{src:R(a).identities[R(i).sending_preview.author]?.icon,text:R(a).identities[R(i).sending_preview.author]?.initials||`?`,alt:R(a).display_name(R(i).sending_preview.author),size:`md`,class:F([`channel-avatar`,R(a).identities[R(i).sending_preview.author]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`div`,XN,[J(`div`,ZN,[J(`strong`,null,I(R(a).display_name(R(i).sending_preview.author)),1)]),J(`div`,QN,[J(`time`,null,I(R(a).format_time(R(i).sending_preview.created_at)),1),t[53]||=J(`span`,{class:`channel-sending-status`,role:`status`},`发送中…`,-1)])])]),J(`div`,$N,[J(`div`,{class:`channel-message-text markdown-body`,innerHTML:gi.value},null,8,eP)]),R(i).sending_preview.files.some(e=>e.preview_url)?(G(),K(`div`,tP,[(G(!0),K(W,null,H(R(i).sending_preview.files.filter(e=>e.preview_url),e=>(G(),K(`span`,{key:e.preview_url,class:`attachment-image`},[J(`img`,{src:e.preview_url,alt:e.name},null,8,nP)]))),128))])):Z(``,!0),R(i).sending_preview.files.some(e=>!e.preview_url)?(G(),K(`div`,rP,`附件:`+I(R(i).sending_preview.files.filter(e=>!e.preview_url).map(e=>e.name).join(`、`)),1)):Z(``,!0)]),_:1},8,[`data-author`])]),_:1},8,[`style`])):Z(``,!0),(R(xr)===`end`||R(Sr)===`end`)&&!R(i).query&&!R(i).source_filter?(G(),K(`div`,iP,[R(xr)===`end`?(G(),q(tO,{key:0,ref:e=>hn(r)?r.value=e:r=e,onEdit:t[14]||=e=>n(`edit`)},null,512)):Z(``,!0),R(Sr)===`end`?(G(),q(_O,{key:1})):Z(``,!0)])):Z(``,!0),R(i).messages_loading&&!_r.value.length?(G(),K(`div`,aP,[(G(),K(W,null,H(3,e=>J(`div`,{key:e,class:`grid gap-3`},[Y(O,{class:`h-5 w-28`}),Y(O,{class:`h-4 w-full`}),Y(O,{class:`h-4 w-2/3`})])),64))])):R(i).messages_failure?(G(),K(`div`,oP,[J(`p`,null,I(R(i).messages_failure),1),Y(o,{label:`重新读取消息`,icon:`i-lucide-refresh-cw`,color:`neutral`,variant:`soft`,onClick:t[15]||=e=>R(s)(`refresh`)})])):!_r.value.length&&!lt.value.length?(G(),K(`div`,sP,[Y(g,{name:R(i).query||R(i).source_filter?`i-lucide-search`:`i-lucide-hash`},null,8,[`name`]),J(`h2`,null,I(R(i).query||R(i).source_filter?`没有找到消息`:Xe.value.title),1),J(`p`,null,I(R(i).query||R(i).source_filter?`试试其他关键词,或清除筛选。`:R(a).empty_discussion_message(Xe.value)),1)])):Z(``,!0)],544)),t,18),_r.value.length&&!Je.value||w.value?.touch||R(v).state.message_id?(G(),K(`div`,cP,[w.value?.touch?(G(),K(`button`,{key:0,type:`button`,class:`channel-listen-pill`,onMousedown:t[19]||=nl(()=>{},[`prevent`]),onClick:se},[Y(g,{name:`i-lucide-message-square-quote`}),t[54]||=X(`添加到对话`,-1)],32)):Z(``,!0),w.value?.touch&&w.value.speech?(G(),K(`button`,{key:1,type:`button`,class:`channel-listen-pill`,"aria-label":`从选中处开始朗读`,onMousedown:t[20]||=nl(()=>{},[`prevent`]),onClick:ve},[Y(g,{name:`i-lucide-headphones`}),t[55]||=X(`听当前`,-1)],32)):Z(``,!0),R(v).state.message_id?(G(),K(`button`,{key:2,type:`button`,class:F([`channel-listen-pill`,{"is-on":R(v).state.following}]),"aria-pressed":R(v).state.following,title:R(v).state.following?`手动滚动即取消跟随`:`页面跟随朗读位置滚动`,onClick:t[21]||=e=>R(v).state.following?R(v).state.following=!1:R(v).follow()},[Y(g,{name:`i-lucide-locate-fixed`}),X(I(R(v).state.following?`跟随中`:`跟随`),1)],10,lP)):Z(``,!0),R(v).state.reading?(G(),K(`button`,{key:3,type:`button`,class:`channel-listen-pill`,"aria-label":`退出朗读`,onClick:t[22]||=e=>R(v).stop()},[Y(g,{name:`i-lucide-square`}),t[56]||=X(`退出`,-1)])):Z(``,!0),_r.value.length&&!Je.value?(G(),q(o,{key:4,icon:`i-lucide-arrow-down`,color:`neutral`,variant:`outline`,"aria-label":`回到最新消息`,class:`channel-latest-button`,onClick:Ri})):Z(``,!0)])):Z(``,!0),J(`div`,uP,[J(`div`,{class:`channel-composer-column`,onDragover:t[36]||=(...e)=>R(a).drop_attachments&&R(a).drop_attachments(...e),onDrop:t[37]||=(...e)=>R(a).drop_attachments&&R(a).drop_attachments(...e),onPaste:t[38]||=(...e)=>R(a).paste_attachments&&R(a).paste_attachments(...e),onKeydownCapture:t[39]||=e=>{cr(e),Ra(e)},onInputCapture:Ki,onInput:t[40]||=e=>{qi(),tr(e)},onClick:tr,onKeyup:tr,onSelect:tr,onCompositionstart:ur,onCompositionupdate:ur,onCompositionend:ur,onScrollCapture:an},[Y(k,{open:!!on.value,reference:mr.value,content:{side:`top`,align:`start`,sideOffset:8,onOpenAutoFocus:dr,onCloseAutoFocus:dr},ui:{content:`channel-select-menu channel-mention-menu`},"onUpdate:open":t[24]||=e=>!e&&(on.value=null)},{content:z(()=>[J(`div`,dP,[J(`span`,null,I(qn.value),1),t[57]||=J(`small`,null,`↑↓ 选择 · Enter 确认`,-1)]),J(`div`,{id:`channel-mention-list`,ref_key:`mention_list`,ref:pn,role:`listbox`,"aria-label":qn.value,class:`channel-mention-list`},[(G(!0),K(W,null,H(Kn.value,(e,n)=>(G(),K(W,{key:e.key},[n===0||e.group!==Kn.value[n-1].group?(G(),K(`p`,pP,I(e.group),1)):Z(``,!0),J(`button`,{id:`channel-mention-${n}`,type:`button`,role:`option`,"aria-selected":e===Yn.value,tabindex:`-1`,class:`channel-mention-option`,onPointerdown:t[23]||=nl(()=>{},[`prevent`]),onClick:t=>rr(e),onPointermove:e=>fn.value=n},[e.mode?(G(),K(W,{key:0},[Y(g,{name:e.mode.command.startsWith(`/goal`)?`i-lucide-target`:`i-lucide-messages-square`,class:`channel-mention-file-icon`},null,8,[`name`]),J(`span`,{class:F({"channel-mention-disabled":e.mode.disabled})},I(e.mode.label),3),J(`small`,{title:e.mode.description},I(e.mode.description),9,hP)],64)):e.workflow?(G(),K(W,{key:1},[Y(g,{name:e.broken?`i-lucide-triangle-alert`:`i-lucide-network`,class:F([`channel-mention-file-icon`,{"channel-mention-broken":e.broken}])},null,8,[`name`,`class`]),J(`span`,{class:F({"channel-mention-disabled":e.disabled&&!e.enabled})},I(e.workflow.label),3),J(`small`,{class:F([`channel-mention-brief`,{"channel-mention-broken":e.broken}]),title:!e.enabled&&e.disabled||e.workflow.description},I(!e.enabled&&e.disabled||e.workflow.description),11,gP),e.enabled?(G(),K(`b`,_P,`已启用`)):Z(``,!0)],64)):e.skill?(G(),K(W,{key:2},[Y(g,{name:`i-lucide-sparkles`,class:`channel-mention-file-icon`}),J(`span`,null,I(e.skill.label),1),J(`small`,{title:e.skill.description},I(e.skill.description),9,vP)],64)):e.entry?(G(),K(W,{key:3},[Y(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`]),J(`span`,{title:e.entry.path},I(e.self?`引用此文件夹`:`${e.entry.name}${e.entry.kind===`directory`?`/`:``}`),9,yP),yn.value?.search?(G(),K(`small`,{key:0,title:e.entry.path},I(e.entry.path.split(`/`).slice(0,-1).join(`/`)),9,bP)):Z(``,!0),e.entry.kind===`directory`&&!e.self?(G(),q(g,{key:1,name:`i-lucide-chevron-right`,class:`channel-mention-file-icon channel-mention-drill`})):Z(``,!0)],64)):(G(),K(W,{key:4},[ln[e.name]?(G(),q(h,{key:0,icon:ln[e.name].icon,alt:e.name,size:`xs`,class:`channel-avatar`},null,8,[`icon`,`alt`])):(G(),q(h,{key:1,src:R(a).identities[e.name]?.icon,text:R(a).identities[e.name]?.initials,alt:R(a).display_name(e.name),size:`xs`,class:F([`channel-avatar`,R(a).identities[e.name]?.style])},null,8,[`src`,`text`,`alt`,`class`])),J(`span`,null,I(ln[e.name]?e.name:R(a).display_name(e.name)),1),J(`small`,null,`@`+I(nr(e.name)),1)],64))],40,mP)],64))),128)),Un.value?(G(),K(`p`,xP,`正在读取本机技能…`)):Vn.value&&!Kn.value.length?(G(),K(`p`,SP,I(Gn.value),1)):Dn.value?(G(),K(`p`,CP,`正在读取项目目录…`)):Kn.value.length?Z(``,!0):(G(),K(`p`,wP,I(on.value?.command?`没有匹配的工作流或技能`:_n.value?`没有匹配的成员或文件`:`没有匹配的成员`),1))],8,fP)]),_:1},8,[`open`,`reference`,`content`]),Xe.value.free?.queued_messages?(G(),q(rk,{key:0,queue:Xe.value.free.queued_messages,"room-id":Xe.value.id},null,8,[`queue`,`room-id`])):Z(``,!0),Y(te,{ref_key:`prompt`,ref:qe,modelValue:R(l),"onUpdate:modelValue":t[35]||=e=>hn(l)?l.value=e:null,"submit-on-enter":R(Rk),enterkeyhint:R(Rk)?`send`:`enter`,autofocus:!1,rows:1,maxrows:tF,placeholder:`发消息到 # ${Xe.value.title}`,"aria-label":`留言正文`,role:`combobox`,"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-expanded":!!on.value,"aria-controls":on.value?`channel-mention-list`:void 0,"aria-activedescendant":on.value&&Yn.value?`channel-mention-${Kn.value.indexOf(Yn.value)}`:void 0,variant:`outline`,color:`neutral`,class:F([`channel-composer`,{"has-mentions":nn.value}]),ui:{header:`channel-composer-header`,base:`channel-editor`,footer:`channel-composer-footer`},onSubmit:Fa},{header:z(()=>[R(i).attachment_drafts.length||bt.value.length||St.value.length?(G(),K(`div`,TP,[St.value.length?(G(),q(k,{key:0,content:{side:`top`,align:`start`},"onUpdate:open":t[26]||=e=>Tt.value=0},{content:z(()=>[J(`ol`,OP,[(G(!0),K(W,null,H(St.value,(e,n)=>(G(),K(`li`,{key:e.id},[J(`span`,kP,I(n+1)+`.`,1),J(`div`,AP,[J(`small`,null,`选中文字 · `+I(R(cj)(e)),1),J(`p`,jP,I(e.text),1),Tt.value===e.id?(G(),K(W,{key:0},[t[58]||=J(`small`,null,`批注`,-1),Y(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?(G(),K(W,{key:1},[t[59]||=J(`small`,null,`批注`,-1),J(`p`,MP,I(e.comment),1)],64)):Z(``,!0)]),J(`div`,NP,[J(`button`,{type:`button`,"aria-label":`修改摘录 ${n+1} 的批注`,title:`修改批注`,onClick:t=>Tt.value=Tt.value===e.id?0:e.id},[Y(g,{name:`i-lucide-pencil`})],8,PP),J(`button`,{type:`button`,"aria-label":`移除摘录 ${n+1}`,title:`移除`,disabled:R(i).sending_message,onClick:t=>wt(e)},[Y(g,{name:`i-lucide-trash-2`})],8,FP)])]))),128))])]),default:z(()=>[J(`div`,EP,[Y(g,{name:`i-lucide-message-square-quote`}),J(`span`,null,I(St.value.length)+` 条摘录`,1),J(`button`,{type:`button`,class:`excerpt-chip-clear`,"aria-label":`移除全部摘录`,title:`移除全部摘录`,disabled:R(i).sending_message,onClick:t[25]||=nl(e=>R(ij).excerpts=[],[`stop`])},[Y(g,{name:`i-lucide-x`})],8,DP)])]),_:1})):Z(``,!0),(G(!0),K(W,null,H(bt.value,e=>(G(),K(`div`,{key:`ref:${e.path}`,class:`attachment-draft-file attachment-draft-ref`,title:e.path},[e.kind===`file`?(G(),K(`span`,{key:0,innerHTML:R(a).attachment_file_icon(e.name)},null,8,LP)):(G(),q(g,{key:1,name:`i-lucide-folder`,class:`attachment-ref-folder`})),J(`span`,RP,[J(`span`,null,I(e.name),1),J(`small`,null,I(e.kind===`directory`?`项目文件夹`:`项目文件`)+` · `+I(e.path),1)]),J(`button`,{type:`button`,class:`attachment-remove`,"aria-label":`移除 ${e.path}`,disabled:R(i).sending_message,onClick:t=>bt.value=bt.value.filter(t=>t!==e)},[Y(g,{name:`i-lucide-x`})],8,zP)],8,IP))),128)),(G(!0),K(W,null,H(R(i).attachment_drafts,e=>(G(),K(`div`,{key:e.id,class:F(e.preview_url?`attachment-draft-image`:`attachment-draft-file`)},[e.preview_url?(G(),K(`img`,{key:0,src:e.preview_url,alt:e.file_name,title:e.file_name},null,8,BP)):(G(),K(W,{key:1},[J(`span`,{innerHTML:R(a).attachment_file_icon(e.file_name)},null,8,VP),J(`span`,HP,[J(`span`,{title:e.file_name},I(e.file_name),9,UP),J(`small`,null,I(R(a).attachment_size(e.size)),1)])],64)),J(`button`,{type:`button`,class:`attachment-remove`,"aria-label":`移除 ${e.file_name}`,onClick:t=>R(s)(`remove_attachment`,e.id)},[Y(g,{name:`i-lucide-x`})],8,WP)],2))),128))])):Z(``,!0),(G(!0),K(W,null,H(rt.value,e=>(G(),K(`div`,{key:e.name,class:`channel-reply-draft channel-queue-hint`},[Y(g,{name:`i-lucide-user-round-x`}),J(`span`,null,I(R(a).display_name(e.name))+` 待注册:在其会话中粘贴启动指令`,1),R(i).access?.can_manage?(G(),q(o,{key:0,icon:Zi.value===e.name?`i-lucide-check`:`i-lucide-copy`,label:Zi.value===e.name?`已复制`:`复制启动指令`,"aria-live":`polite`,size:`xs`,color:`neutral`,variant:`ghost`,class:`channel-launch-copy`,onClick:t=>ea(e.name)},null,8,[`icon`,`label`,`onClick`])):Z(``,!0)]))),128)),it.value?(G(),K(`div`,GP,[Y(g,{name:`i-lucide-clock`}),J(`span`,null,I(it.value),1),tt(nt.value)&&R(i).access?.can_manage?(G(),q(o,{key:0,icon:Zi.value===nt.value.name?`i-lucide-check`:`i-lucide-copy`,label:Zi.value===nt.value.name?`已复制`:`复制启动指令`,"aria-live":`polite`,size:`xs`,color:`neutral`,variant:`ghost`,class:`channel-launch-copy`,onClick:t[27]||=e=>ea(nt.value.name)},null,8,[`icon`,`label`])):Z(``,!0)])):Z(``,!0),R(i).editing_queued?(G(),K(`div`,KP,[Y(g,{name:`i-lucide-pencil`}),t[60]||=J(`span`,null,`编辑排队消息:发送即保存修改,仍按原位置排队`,-1),Y(o,{icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`取消编辑排队消息`,onClick:t[28]||=e=>R(s)(`queue_cancel_edit`)})])):Z(``,!0),R(i).reply_to?(G(),K(`div`,qP,[Y(g,{name:`i-lucide-corner-up-left`}),J(`span`,null,I(`回复 #${R(i).reply_to}`),1),Y(o,{icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`取消回复`,onClick:t[29]||=e=>R(s)(`cancel_reply`)})])):Z(``,!0)]),footer:z(()=>[R(x).state.status?(G(),K(W,{key:0},[Y(JD,{text:R(Rk)?`取消 · Esc`:`取消`},{default:z(()=>[Y(o,{type:`button`,icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-voice-button`,"aria-label":`取消语音输入`,onClick:t[30]||=e=>R(x).cancel()})]),_:1},8,[`text`]),J(`span`,{class:F([`channel-voice-levels`,{"is-discarding":R(C).discard}]),role:`status`,"aria-label":R(x).state.status===`recording`?`正在录音 ${R(ej)(R(x).state.seconds)}`:`正在识别`},[R(x).state.status===`recording`?(G(),K(W,{key:0},[J(`span`,XP,[(G(!0),K(W,null,H(R(x).state.levels,(e,t)=>(G(),K(`i`,{key:t,style:_e({transform:`scaleY(${.15+e*.85})`})},null,4))),128))]),J(`small`,null,I(R(ej)(R(x).state.seconds)),1),R(C).by?(G(),K(`small`,ZP,I(R(C).discard?`松开取消`:R(C).by===`touch`?`松开转文字 · 上滑取消`:`松开空格转文字`),1)):Z(``,!0)],64)):(G(),K(`small`,QP,I(R(x).state.status===`starting`?`正在打开麦克风…`:`正在识别…`),1))],10,YP),Y(JD,{text:R(Rk)?`完成,转成文字 · Enter`:`完成,转成文字`},{default:z(()=>[Y(o,{type:`button`,icon:`i-lucide-check`,color:`neutral`,size:`sm`,class:`channel-primary-button channel-round-button`,"aria-label":`结束录音并转成文字`,loading:R(x).state.status!==`recording`,onClick:t[31]||=e=>R(x).toggle()},null,8,[`loading`])]),_:1},8,[`text`])],64)):(G(),K(W,{key:1},[Y(o,{type:`button`,icon:`i-lucide-paperclip`,"aria-label":`添加附件`,title:`图片、PDF 或其他文件 · 每个最多 20 MiB`,color:`neutral`,variant:`ghost`,size:`sm`,onClick:t[32]||=e=>R(s)(`choose_attachments`)}),b.value?(G(),q(JD,{key:0,text:R(y).on.value?`关闭语音播报`:`语音播报:新回复自动朗读摘要`},{default:z(()=>[Y(o,{type:`button`,icon:`i-lucide-radio`,color:`neutral`,variant:`ghost`,size:`sm`,class:F([`channel-voice-button channel-broadcast-button`,{"is-on":R(y).on.value}]),"aria-pressed":R(y).on.value,"aria-label":R(y).on.value?`关闭语音播报`:`开启语音播报`,onClick:t[33]||=e=>R(y).toggle()},null,8,[`class`,`aria-pressed`,`aria-label`])]),_:1},8,[`text`])):Z(``,!0),Y(JD,{text:R(Rk)?`语音输入 · 也可按住空格说话`:`按住说话,或轻点开始`},{default:z(()=>[Y(o,{type:`button`,icon:`i-lucide-mic`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-voice-button channel-voice-mic`,"aria-label":`语音输入`,disabled:R(i).sending_message,onPointerdown:R(S).pointerdown,onClick:R(S).click,onContextmenu:t[34]||=nl(()=>{},[`prevent`])},null,8,[`disabled`,`onPointerdown`,`onClick`])]),_:1},8,[`text`]),Y(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:!Ct.value,onClick:Fa},null,8,[`disabled`])],64))]),default:z(()=>[nn.value?(G(),K(`div`,{key:0,ref_key:`mirror`,ref:rn,class:`channel-editor channel-editor-mirror`,"aria-hidden":`true`,innerHTML:nn.value},null,8,JP)):Z(``,!0)]),_:1},8,[`modelValue`,`submit-on-enter`,`enterkeyhint`,`placeholder`,`aria-expanded`,`aria-controls`,`aria-activedescendant`,`class`]),J(`div`,$P,[J(`span`,null,I(yt.value),1),J(`span`,eF,[u.value?(G(),K(`span`,{key:0,class:F({"is-near-limit":d.value})},[X(I(u.value)+` / `+I(R(a).max_message_length),1),t[61]||=J(`span`,{class:`channel-note-divider`},`·`,-1)],2)):Z(``,!0),t[62]||=J(`span`,{class:`channel-key-hint`},[J(`kbd`,null,`Enter`),X(` 发送`),J(`span`,{class:`channel-note-divider`},`·`),J(`kbd`,null,`Shift`),X(`+`),J(`kbd`,null,`Enter`),X(` 换行`)],-1)])])],32)])])}}},[[`__scopeId`,`data-v-dc9ae076`]]),sI={class:`page-heading`},cI={class:`topic-brief`},lI={key:0,class:`host-progress`},uI={key:1,class:`turn-panel host-turn`},dI={class:`turn-header`},fI={class:`turn-expert`},pI={class:`turn-question`},mI={class:`fine-print`},hI={key:2,class:`host-last-turn`},gI={class:`form-footer`},_I=[`href`],vI={key:0,class:`host-progress access-evidence`,"aria-label":`实际执行进展`,role:`status`},yI={key:1,class:`access-setup access-repair`,"aria-label":`本机接入设置`},bI={class:`access-repair-heading`},xI={key:0,class:`access-repair-fields`},SI={key:2,class:`fine-print`},CI={key:3,class:`fine-print`},wI={key:4,class:`fine-print`},TI=rO({__name:`TopicPanel`,props:{section:{type:String,required:!0}},emits:[`open`,`detail`],setup(e){let t=e,{view:n,bridge:r,act:i,pending:a}=Dr(`discussion`),o=$(()=>n.value.room),s=$(()=>o.value?.current_turn),c=$(()=>s.value&&[`open`,`pending`,`notified`].includes(s.value.status)),l=$(()=>o.value?.session?.status===`paused`),u=$(()=>`${n.value.room_site}/r/${o.value?.id}`),d=$(()=>o.value?.free?.executions?.[0]),f=$(()=>n.value.launch.repair?.room_id===o.value?.id?n.value.launch.repair:null),p={dispatched:`唤醒中`,started:`执行中`,completed:`已完成`,failed:`失败`};return(e,m)=>{let h=Zx,g=VD,_=Bx,v=Ix,y=$D,b=RD,x=WD;return G(),q(R(AD).section,{class:F([`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:z(()=>[t.section===`host`?(G(),K(W,{key:0},[J(`div`,sI,[J(`div`,null,[m[3]||=J(`span`,{class:`eyebrow`},`讨论进程`,-1),m[4]||=J(`h2`,null,`当前讨论`,-1),J(`p`,null,`当前由 `+I(R(r).display_name(o.value.host))+` 主持,围绕具体问题组织下一轮发言。`,1)]),Y(h,{icon:`i-lucide-pencil`,label:`编辑议题`,variant:`outline`,color:`neutral`,class:`channel-surface-button`,onClick:m[0]||=t=>e.$emit(`open`,`edit`)})]),J(`div`,cI,[J(`div`,null,[m[5]||=J(`h3`,null,`讨论目标`,-1),J(`p`,null,I(o.value.session?.goal||o.value.goal||`待主持人根据用户原文补全`),1)]),J(`div`,null,[m[6]||=J(`h3`,null,`当前焦点`,-1),J(`p`,null,I(o.value.focus||`尚未设置当前焦点`),1)])]),o.value.limits?(G(),K(`div`,lI,[m[7]||=J(`span`,null,`进度`,-1),J(`p`,null,I(R(r).limits_label(o.value.limits)),1),Y(g,{color:l.value?`warning`:`neutral`,variant:`subtle`},{default:z(()=>[X(I(l.value?`已暂停`:`讨论中`),1)]),_:1},8,[`color`])])):Z(``,!0),c.value?(G(),K(`section`,uI,[J(`div`,dI,[m[8]||=J(`h3`,null,`当前发言安排`,-1),Y(g,{color:`primary`,variant:`subtle`},{default:z(()=>[X(I(R(r).turn_label(s.value,o.value)),1)]),_:1})]),J(`div`,fI,[Y(_,{src:R(r).identities[s.value.expert]?.icon,text:R(r).identities[s.value.expert]?.initials,alt:s.value.expert,class:F([`message-mark channel-avatar`,R(r).identities[s.value.expert]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`div`,null,[J(`strong`,null,I(s.value.expert),1),J(`small`,null,`发言安排 #`+I(s.value.id),1)])]),J(`p`,pI,I(s.value.question),1),J(`p`,mI,I(R(r).turn_guidance(s.value,o.value)),1)])):(G(),K(`p`,hI,I(l.value?`讨论已暂停,继续后由主持人重新安排。`:`等待主持人安排下一步。`),1)),J(`div`,gI,[J(`a`,{href:`${u.value}/turns`,target:`_blank`,rel:`noopener`,class:`subtle-link`},[m[9]||=X(`发言安排历史 `,-1),Y(v,{name:`i-lucide-arrow-up-right`})],8,_I)])],64)):(G(),K(W,{key:1},[m[13]||=J(`div`,{class:`page-heading access-heading`},[J(`div`,null,[J(`h2`,null,`本机连接`),J(`p`,null,`成员的接入操作在上方;讨论暂停后可修正本机软件连接。`)])],-1),d.value?(G(),K(`section`,vI,[m[10]||=J(`span`,null,`最近执行`,-1),J(`p`,null,`#`+I(d.value.id)+` `+I(R(r).display_name(d.value.member))+` · `+I(d.value.status===`cancelled`?R(r).stop_label(d.value):p[d.value.status]||d.value.status),1)])):Z(``,!0),l.value&&R(n).launch.available&&!o.value.archived&&!R(n).launch.remote?(G(),K(`section`,yI,[J(`div`,bI,[m[11]||=J(`h3`,null,`修正本场软件连接`,-1),Y(h,{label:`读取本场配置`,variant:`outline`,color:`neutral`,class:`channel-surface-button`,loading:R(a)===`load_room_configuration`,onClick:m[1]||=e=>R(i)(`load_room_configuration`)},null,8,[`loading`])]),m[12]||=J(`div`,{class:`access-repair-description`},[J(`p`,null,`修正软件路径,或切换 Codex 的 App / CLI 接入。保留原房间和会话,保存后到进度看板继续。`),J(`p`,{class:`fine-print`},`App 需保持运行,模型与文件权限沿用原聊天设置。切回 CLI 前,需让 App 释放原聊天。`)],-1),f.value?(G(),K(`div`,xI,[(G(!0),K(W,null,H(f.value.participants,(e,t)=>(G(),K(`div`,{key:t,class:`form-two-columns`},[[`codex`,`codex_cli`].includes(e.adapter)?(G(),q(b,{key:0,label:`${t} · 接入方式`},{default:z(()=>[Y(y,{"model-value":e.adapter,items:[{label:`Codex App`,value:`codex`},{label:`Codex CLI`,value:`codex_cli`}],class:`w-full`,"onUpdate:modelValue":e=>R(r).write_room_adapter(t,e)},null,8,[`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`label`])):Z(``,!0),Y(b,{label:`${t} · ${e.adapter===`antigravity`?`Sidecar 目录`:`软件路径`}`},{default:z(()=>[Y(x,{"model-value":e[e.adapter===`antigravity`?`ipc_directory`:`executable`]||``,class:`w-full`,"onUpdate:modelValue":e=>R(r).write_room_connection(t,e)},null,8,[`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`label`])]))),128)),Y(h,{label:`保存本场接入设置`,class:`channel-primary-button`,loading:R(a)===`save_room_configuration`,onClick:m[2]||=e=>R(i)(`save_room_configuration`)},null,8,[`loading`])])):Z(``,!0)])):l.value&&R(n).launch.remote?(G(),K(`p`,SI,`线上连接暂不提供已登记房间的软件路径修正。`)):l.value?(G(),K(`p`,wI,`本机服务未连接,启动后可读取配置。`)):(G(),K(`p`,CI,`讨论正在运行;需要修正连接时,先在进度看板暂停。`))],64))]),_:1},8,[`class`,`aria-label`])}}},[[`__scopeId`,`data-v-f4ac3687`]]),EI={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`}},DI={__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=Ia(),a=py(`collapsible`,n),o=Od(),s=my(bd(a,`as`,`defaultOpen`,`open`,`disabled`,`unmountOnHide`),r),c=$(()=>Fx({extend:EI,...o.ui?.collapsible||{}})());return(e,t)=>(G(),q(R(bp),Q(R(s),{"data-slot":`root`,class:c.value.root({class:[R(a).ui?.root,R(a).class]})}),{default:z(({open:t})=>[i.default?(G(),q(R(Sp),{key:0,"as-child":``},{default:z(()=>[U(e.$slots,`default`,{open:t})]),_:2},1024)):Z(``,!0),Y(R(xp),{"data-slot":`content`,class:F(c.value.content({class:R(a).ui?.content}))},{default:z(()=>[U(e.$slots,`content`)]),_:3},8,[`class`])]),_:3},16,[`class`]))}},OI=[`read`,`write`,`auto`,`full`],kI=1e3,AI={stoppable:!0,progress:!0},jI={stoppable:!1,progress:!1},MI={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:OI,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:AI,rewind:`cut`,project:!0,access_env:!0,enforces_read_only:!0,limits_directories:!0,ripgrep:!0,chat:!0,resume:!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:jI,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:OI,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:AI,rewind:`cut`,project:!0,access_env:!0,chat:!0,resume:!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:AI,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:jI,rewind:`kept`,project:!0,chat:!0}},api:{platform:``,label:`模型 API`,kind:`api`,location:``,fields:[`base_url`,`api_protocol`,`api_key_ref`],efforts:[`low`,`medium`,`high`],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:AI,rewind:`cut`,project:!0,file_tools:!0,limits_directories:!0,chat:!0}}};Object.keys(MI);function NI(e){let t=MI[e];return t?{id:e,session_family:e,windows_command:`codiscuss.cmd`,...t}:null}function PI(e){return MI[e]?.capabilities||{delivery:jI,rewind:`kept`,project:!1}}var FI=[`aria-label`],II=[`aria-label`,`disabled`],LI=[`maxlength`,`aria-label`,`value`,`disabled`],RI=[`aria-label`,`disabled`],zI=rO({__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=Ix;return G(),K(`span`,{class:`number-stepper`,role:`group`,"aria-label":e.label},[J(`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)},[Y(r,{name:`i-lucide-minus`})],8,II),J(`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:_e({width:`${String(e.max).length+1.5}ch`}),onFocus:n[1]||=e=>e.target.select(),onChange:a,onKeydown:n[2]||=rl(nl(e=>e.target.blur(),[`prevent`]),[`enter`])},null,44,LI),J(`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)},[Y(r,{name:`i-lucide-plus`})],8,RI)],8,FI)}}},[[`__scopeId`,`data-v-37a42d72`]]),BI={class:`limit-field`},VI={class:`limit-field-row`},HI={key:0,class:`limit-field-title`},UI={class:`limit-field-controls`},WI={class:`limit-field-help`},GI=0,KI=10,qI=rO({__name:`ApiRequestsField`,props:{modelValue:{type:Number,required:!0},disabled:Boolean,title:{type:String,default:``}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=L(300);return B(()=>n.modelValue,e=>{e!==GI&&(i.value=e)},{immediate:!0}),(t,n)=>{let a=nO;return G(),K(`span`,BI,[J(`span`,VI,[e.title?(G(),K(`span`,HI,I(e.title),1)):Z(``,!0),J(`span`,UI,[e.modelValue===GI?Z(``,!0):(G(),K(W,{key:0},[Y(zI,{"model-value":e.modelValue,max:R(kI),step:KI,label:`API 成员每次执行的模型请求上限`,disabled:e.disabled,"onUpdate:modelValue":n[0]||=e=>r(`update:modelValue`,e)},null,8,[`model-value`,`max`,`disabled`]),n[2]||=J(`span`,null,`次`,-1)],64)),Y(a,{"model-value":e.modelValue===GI,disabled:e.disabled,label:`不限`,"aria-label":`API 请求次数不限`,ui:{root:`items-center`},"onUpdate:modelValue":n[1]||=e=>r(`update:modelValue`,e?GI:i.value)},null,8,[`model-value`,`disabled`])])]),J(`small`,WI,[n[3]||=X(`API 成员每次执行最多调用模型几次,读写文件、读房间各算一次;快到上限会先提交已完成的部分。`,-1),e.modelValue===GI?(G(),K(W,{key:0},[X(`不限时会持续产生费用,只能手动停止。`)],64)):Z(``,!0)])])}}},[[`__scopeId`,`data-v-f85acb23`]]),JI={class:`limit-field`},YI={class:`limit-field-row`},XI={key:0,class:`limit-field-title`},ZI={class:`limit-field-controls`},QI={class:`limit-field-help`},$I=100,eL=0,tL=10,nL=rO({__name:`ChainRoundsField`,props:{modelValue:{type:Number,required:!0},disabled:Boolean,title:{type:String,default:``}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=L(tL);return B(()=>n.modelValue,e=>{e!==eL&&(i.value=e)},{immediate:!0}),(t,n)=>{let a=nO;return G(),K(`span`,JI,[J(`span`,YI,[e.title?(G(),K(`span`,XI,I(e.title),1)):Z(``,!0),J(`span`,ZI,[e.modelValue===eL?Z(``,!0):(G(),K(W,{key:0},[Y(zI,{"model-value":e.modelValue,max:$I,label:`主持人连续派活轮数`,disabled:e.disabled,"onUpdate:modelValue":n[0]||=e=>r(`update:modelValue`,e)},null,8,[`model-value`,`disabled`]),n[2]||=J(`span`,null,`轮`,-1)],64)),Y(a,{"model-value":e.modelValue===eL,disabled:e.disabled,label:`不限`,"aria-label":`主持人连续派活轮数不限`,ui:{root:`items-center`},"onUpdate:modelValue":n[1]||=e=>r(`update:modelValue`,e?eL:i.value)},null,8,[`model-value`,`disabled`])])]),J(`small`,QI,[n[3]||=X(`收到你一条消息后,主持人最多派几轮活就停下等你;派活 → 成员回答 → 交回汇总算一轮。`,-1),e.modelValue===eL?(G(),K(W,{key:0},[X(`不限时只能用“全部停止”打断。`)],64)):Z(``,!0)])])}}},[[`__scopeId`,`data-v-e8a98a5f`]]),rL={class:`effort-field`},iL={key:0,class:`effort-caption`,"aria-hidden":`true`},aL=[`aria-label`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`],oL=[`title`],sL=4.5,cL=6,lL=8,uL=1/240,dL=.001,fL=.01,pL=.05,mL=10,hL=4,gL=rO({__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=L(null),a=$(()=>n.items.length-1),o=$(()=>Math.max(0,n.items.findIndex(e=>e.value===n.modelValue))),s=tn({x:o.value,v:0,target:o.value,hand:null,pointer:null}),c=$(()=>Math.min(a.value,Math.max(0,s.x))/a.value),l=$(()=>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?sL:cL,r=(e,r)=>g(e-t,r,n)+(e<0||e>a.value?g(e-h(e),r,lL):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(pL,(e-d)/1e3);for(d=e;t>0;){let e=Math.min(uL,t);_(e),t-=e}let n=s.hand??s.target;Math.abs(s.x-n)<dL&&Math.abs(s.v)<fL?(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-mL)/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)>hL,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*sL):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 B([o,a],()=>{s.target=o.value,y()}),sa(()=>cancelAnimationFrame(u)),(t,n)=>(G(),K(`div`,rL,[e.caption?(G(),K(`div`,iL,[J(`span`,null,I(e.caption),1),Y(qs,{name:`effort-value`,mode:`out-in`},{default:z(()=>[(G(),K(`strong`,{key:l.value},I(e.items[l.value].label),1))]),_:1})])):Z(``,!0),J(`div`,{ref_key:`track`,ref:i,class:F([`effort-slider`,{"is-dragging":s.pointer!==null}]),style:_e({"--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]||=J(`span`,{class:`effort-slider-track`,"aria-hidden":`true`},[J(`span`,{class:`effort-slider-fill`})],-1),(G(!0),K(W,null,H(e.items,(e,t)=>(G(),K(`span`,{key:e.value,class:F([`effort-slider-stop`,{"is-active":t<l.value,"is-current":t===l.value}]),"aria-hidden":`true`,style:_e({"--at":t/a.value}),title:e.label},null,14,oL))),128)),n[1]||=J(`span`,{class:`effort-slider-thumb`,"aria-hidden":`true`},null,-1)],46,aL)]))}},[[`__scopeId`,`data-v-2135d88d`]]);function _L(e,t){if(typeof e!=`object`||!e)return!1;let n=zd(e,t);return n!=null&&n!==``}function vL(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 yL(e,t,n,r){let i=vL(t,!0),a=vL(t,!1);return r?()=>i:n?t=>_L(e[t],n)?i:a:()=>a}var bL={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`}},xL=Object.assign({inheritAttrs:!1},{__name:`InputMenu`,props:Va({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:Va([`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=Ia(),o=py(`inputMenu`,r),s=no(e,`searchTerm`,{type:String,default:``}),{t:c}=Jd(),l=Od(),{filterGroups:u}=FD(),d=$(()=>o.mode===`autocomplete`),f=$(()=>!!o.multiple&&!d.value),p=bd(o,`as`,`modelValue`,`defaultValue`,`open`,`defaultOpen`,`required`,`multiple`,`resetSearchTermOnBlur`,`resetSearchTermOnSelect`,`resetModelValueOnClear`,`highlightOnHover`,`openOnClick`,`openOnFocus`,`by`),m=yd(p,`multiple`,`resetSearchTermOnSelect`,`resetModelValueOnClear`,`by`),h=my($(()=>d.value?m:p),i),g=$(()=>d.value?tme:nme),_=La(),v=$(()=>f.value?_[`data-slot`]??`base`:`base`),y=oy(On(()=>o.portal)),b=On(()=>Md(o.content,{side:`bottom`,sideOffset:8,collisionPadding:8,position:`popper`})),x=On(()=>Md(o.arrow,{rounded:!0})),S=$(()=>typeof o.clear==`object`?o.clear:{}),C=On(()=>o.virtualize?Md(typeof o.virtualize==`boolean`?{}:o.virtualize,{estimateSize:yL(ye.value,ce.value??`md`,o.descriptionKey,!!a[`item-description`])}):!1),{emitFormBlur:w,emitFormFocus:T,emitFormChange:E,emitFormInput:D,size:O,color:k,id:A,name:j,highlight:M,disabled:N,ariaAttrs:ee}=qx(r),{orientation:te,size:P}=Ux(r),{isLeading:ne,isTrailing:re,leadingIconName:ie,trailingIconName:ae}=Vx($(()=>({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}))),oe=$(()=>k.value??o.color),se=$(()=>M.value??o.highlight),ce=$(()=>P.value??O.value??o.size),le=$(()=>N.value??o.disabled),[ue,de]=Td(),[fe,pe]=Td({props:{item:{type:[Object,String,Number,Boolean],required:!0},index:{type:Number,required:!1}}}),me=$(()=>Fx({extend:bL,...l.ui?.inputMenu||{}})({color:oe.value,variant:o.variant,size:ce.value,loading:o.loading,highlight:se.value,fixed:o.fixed,leading:ne.value||!!o.avatar||!!a.leading,trailing:re.value||!!a.trailing,multiple:f.value,fieldGroup:te.value,virtualize:!!o.virtualize})),he=$(()=>_e.value.flatMap(e=>e));function ge(e){return Ud(he.value,e,{labelKey:o.labelKey,valueKey:o.valueKey,by:o.by})??``}let _e=$(()=>o.items?.length?Wd(o.items)?o.items:[o.items]:[]),ve=$(()=>{if(o.ignoreFilter||!s.value)return _e.value;let e=Array.isArray(o.filterFields)?o.filterFields:[o.labelKey];return u(_e.value,s.value,{fields:e,isStructural:e=>Ie(e)&&!!e.type&&[`label`,`separator`].includes(e.type)})}),ye=$(()=>ve.value.flatMap(e=>e)),be=$(()=>{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`?!ye.value.find(t=>Vd(t,e,o.by??o.valueKey)):!ye.value.length}),xe=$(()=>typeof o.createItem==`object`?o.createItem.position:`bottom`),Ce=mi(`inputRef`);function we(){o.autofocus&&Ce.value?.$el?.focus()}let Te;ia(()=>{ir(()=>{d.value?s.value=String(o.modelValue??o.defaultValue??``):s.value=``}),Te=setTimeout(()=>{we()},o.autofocusDelay)}),ze(()=>clearTimeout(Te)),B(()=>o.modelValue,e=>{d.value&&(s.value=String(e??``))});function Ee(e){if(dn(o.modelValue)===e)return;o.modelModifiers?.trim&&(typeof e==`string`||e==null)&&(e=e?.trim()??null),o.modelModifiers?.number&&(e=Bd(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 De(e){d.value||(s.value=e)}function Oe(e){i(`blur`,e),w()}function ke(e){i(`focus`,e),T()}let Ae=L(!1),je;ze(()=>clearTimeout(je));function Me(e){if(Ae.value=e,e){let e=new FocusEvent(`focus`);i(`focus`,e),T(),clearTimeout(je)}else{let e=new FocusEvent(`blur`);i(`blur`,e),w(),!d.value&&o.resetSearchTermOnBlur&&(je=setTimeout(()=>{s.value=``},100))}}function Ne(e,t){if(o.multiple){let n=t.filter(t=>!Ld(t,e));i(`update:modelValue`,n),i(`remove-tag`,e),Ee(n)}}function Pe(e){e.preventDefault(),e.stopPropagation(),i(`create`,s.value)}function Fe(e,t){Ie(t)&&(t.disabled?e.preventDefault():t.onSelect?.(e))}function Ie(e){return typeof e==`object`&&!!e}function Le(e){return o.multiple&&Array.isArray(e)?e.length===0:e==null||e===``}function Re(){le.value||i(`clear`)}function Be(e){!e.isComposing&&s.value&&e.preventDefault()}let Ve=mi(`viewportRef`),He=mi(`comboboxRootRef`);return B(()=>o.items,async()=>{Ae.value&&o.createItem&&(await ir(),He.value?.highlightFirstItem?.())},{flush:`post`}),t({inputRef:On(()=>Ce.value?.$el),viewportRef:On(()=>Ve.value)}),(e,t)=>(G(),K(W,null,[Y(R(ue),null,{default:z(()=>[Y(R(g).Item,{"data-slot":`item`,class:F(me.value.item({class:R(o).ui?.item})),value:s.value,onSelect:Pe},{default:z(()=>[J(`span`,{"data-slot":`itemLabel`,class:F(me.value.itemLabel({class:R(o).ui?.itemLabel}))},[U(e.$slots,`create-item-label`,{item:s.value},()=>[X(I(R(c)(`inputMenu.create`,{label:s.value})),1)])],2)]),_:3},8,[`class`,`value`])]),_:3}),Y(R(fe),null,{default:z(({item:t,index:n})=>[Ie(t)&&t.type===`label`?(G(),q(R(g).Label,{key:0,"data-slot":`label`,class:F(me.value.label({class:[R(o).ui?.label,t.ui?.label,t.class]}))},{default:z(()=>[X(I(R(zd)(t,R(o).labelKey)),1)]),_:2},1032,[`class`])):Ie(t)&&t.type===`separator`?(G(),q(R(g).Separator,{key:1,"data-slot":`separator`,class:F(me.value.separator({class:[R(o).ui?.separator,t.ui?.separator,t.class]}))},null,8,[`class`])):(G(),q(R(g).Item,{key:2,"data-slot":`item`,class:F(me.value.item({class:[R(o).ui?.item,Ie(t)&&t.ui?.item,Ie(t)&&t.class]})),disabled:Ie(t)&&t.disabled,value:R(o).valueKey&&Ie(t)?R(zd)(t,R(o).valueKey):t,onSelect:e=>Fe(e,t)},{default:z(()=>[U(e.$slots,`item`,{item:t,index:n,ui:me.value},()=>[U(e.$slots,`item-leading`,{item:t,index:n,ui:me.value},()=>[Ie(t)&&t.icon?(G(),q(Ix,{key:0,name:t.icon,"data-slot":`itemLeadingIcon`,class:F(me.value.itemLeadingIcon({class:[R(o).ui?.itemLeadingIcon,t.ui?.itemLeadingIcon]}))},null,8,[`name`,`class`])):Ie(t)&&t.avatar?(G(),q(Bx,Q({key:1,size:t.ui?.itemLeadingAvatarSize||R(o).ui?.itemLeadingAvatarSize||me.value.itemLeadingAvatarSize()},t.avatar,{"data-slot":`itemLeadingAvatar`,class:me.value.itemLeadingAvatar({class:[R(o).ui?.itemLeadingAvatar,t.ui?.itemLeadingAvatar]})}),null,16,[`size`,`class`])):Ie(t)&&t.chip?(G(),q(zx,Q({key:2,size:t.ui?.itemLeadingChipSize||R(o).ui?.itemLeadingChipSize||me.value.itemLeadingChipSize(),inset:``,standalone:``},t.chip,{"data-slot":`itemLeadingChip`,class:me.value.itemLeadingChip({class:[R(o).ui?.itemLeadingChip,t.ui?.itemLeadingChip]})}),null,16,[`size`,`class`])):Z(``,!0)]),J(`span`,{"data-slot":`itemWrapper`,class:F(me.value.itemWrapper({class:[R(o).ui?.itemWrapper,Ie(t)&&t.ui?.itemWrapper]}))},[J(`span`,{"data-slot":`itemLabel`,class:F(me.value.itemLabel({class:[R(o).ui?.itemLabel,Ie(t)&&t.ui?.itemLabel]}))},[U(e.$slots,`item-label`,{item:t,index:n},()=>[X(I(Ie(t)?R(zd)(t,R(o).labelKey):t),1)])],2),Ie(t)&&(R(zd)(t,R(o).descriptionKey)||a[`item-description`])?(G(),K(`span`,{key:0,"data-slot":`itemDescription`,class:F(me.value.itemDescription({class:[R(o).ui?.itemDescription,Ie(t)&&t.ui?.itemDescription]}))},[U(e.$slots,`item-description`,{item:t,index:n},()=>[X(I(R(zd)(t,R(o).descriptionKey)),1)])],2)):Z(``,!0)],2),J(`span`,{"data-slot":`itemTrailing`,class:F(me.value.itemTrailing({class:[R(o).ui?.itemTrailing,Ie(t)&&t.ui?.itemTrailing]}))},[U(e.$slots,`item-trailing`,{item:t,index:n,ui:me.value}),d.value?Z(``,!0):(G(),q(R(g).ItemIndicator,{key:0,"as-child":``},{default:z(()=>[Y(Ix,{name:R(o).selectedIcon||R(l).ui.icons.check,"data-slot":`itemTrailingIcon`,class:F(me.value.itemTrailingIcon({class:[R(o).ui?.itemTrailingIcon,Ie(t)&&t.ui?.itemTrailingIcon]}))},null,8,[`name`,`class`])]),_:2},1024))],2)])]),_:2},1032,[`class`,`disabled`,`value`,`onSelect`]))]),_:3}),Y(R(g).Root,Q({ref_key:`comboboxRootRef`,ref:He},R(h),{name:R(j),disabled:le.value,"data-slot":e.$attrs[`data-slot`]??`root`,class:me.value.root({class:[R(o).ui?.root,R(o).class]}),"as-child":f.value,"ignore-filter":``,"onUpdate:modelValue":Ee,"onUpdate:open":Me}),{default:z(({modelValue:n,open:r})=>[Y(R(g).Anchor,{"as-child":!f.value,"data-slot":v.value,class:F(me.value.base({class:R(o).ui?.base}))},{default:z(()=>[f.value?(G(),q(R(_v),{key:0,"model-value":n,disabled:le.value,required:R(o).required,delimiter:``,"as-child":``,onBlur:Oe,onFocus:ke,onRemoveTag:e=>Ne(e,n)},{default:z(({modelValue:n})=>[(G(!0),K(W,null,H(n,(t,n)=>(G(),q(R(xv),{key:n,value:t,"data-slot":`tagsItem`,class:F(me.value.tagsItem({class:[R(o).ui?.tagsItem,Ie(t)&&t.ui?.tagsItem]}))},{default:z(()=>[Y(R(Cv),{"data-slot":`tagsItemText`,class:F(me.value.tagsItemText({class:[R(o).ui?.tagsItemText,Ie(t)&&t.ui?.tagsItemText]}))},{default:z(()=>[U(e.$slots,`tags-item-text`,{item:t,index:n},()=>[X(I(ge(t)),1)])]),_:2},1032,[`class`]),Y(R(Sv),{"data-slot":`tagsItemDelete`,class:F(me.value.tagsItemDelete({class:[R(o).ui?.tagsItemDelete,Ie(t)&&t.ui?.tagsItemDelete]})),disabled:le.value},{default:z(()=>[U(e.$slots,`tags-item-delete`,{item:t,index:n,ui:me.value},()=>[Y(Ix,{name:R(o).deleteIcon||R(l).ui.icons.close,"data-slot":`tagsItemDeleteIcon`,class:F(me.value.tagsItemDeleteIcon({class:[R(o).ui?.tagsItemDeleteIcon,Ie(t)&&t.ui?.tagsItemDeleteIcon]}))},null,8,[`name`,`class`])])]),_:2},1032,[`class`,`disabled`])]),_:2},1032,[`value`,`class`]))),128)),Y(R(g).Input,{modelValue:s.value,"onUpdate:modelValue":t[1]||=e=>s.value=e,"as-child":``},{default:z(()=>[Y(R(vv),Q({id:R(A),ref_key:`inputRef`,ref:Ce},{...e.$attrs,...R(ee)},{placeholder:R(o).placeholder,"data-slot":`tagsInput`,class:me.value.tagsInput({class:R(o).ui?.tagsInput}),onChange:t[0]||=nl(()=>{},[`stop`]),onKeydown:rl(Be,[`enter`])}),null,16,[`id`,`placeholder`,`class`])]),_:1},8,[`modelValue`])]),_:3},8,[`model-value`,`disabled`,`required`,`onRemoveTag`])):(G(),q(R(g).Input,Q({key:1,id:R(A),ref_key:`inputRef`,ref:Ce},{...d.value?{}:{displayValue:ge},...e.$attrs,...R(ee)},{"data-slot":`base`,type:R(o).type,placeholder:R(o).placeholder,required:R(o).required,onBlur:Oe,onFocus:ke,onChange:t[2]||=nl(()=>{},[`stop`]),"onUpdate:modelValue":De}),null,16,[`id`,`type`,`placeholder`,`required`])),R(ne)||R(o).avatar||a.leading?(G(),K(`span`,{key:2,"data-slot":`leading`,class:F(me.value.leading({class:R(o).ui?.leading}))},[U(e.$slots,`leading`,{modelValue:n,open:r,ui:me.value},()=>[R(ne)&&R(ie)?(G(),q(Ix,{key:0,name:R(ie),"data-slot":`leadingIcon`,class:F(me.value.leadingIcon({class:R(o).ui?.leadingIcon}))},null,8,[`name`,`class`])):R(o).avatar?(G(),q(Bx,Q({key:1,size:R(o).ui?.itemLeadingAvatarSize||me.value.itemLeadingAvatarSize()},R(o).avatar,{"data-slot":`itemLeadingAvatar`,class:me.value.itemLeadingAvatar({class:R(o).ui?.itemLeadingAvatar})}),null,16,[`size`,`class`])):Z(``,!0)])],2)):Z(``,!0),R(re)||a.trailing||R(o).clear?(G(),q(R(g).Trigger,{key:3,"data-slot":`trailing`,class:F(me.value.trailing({class:R(o).ui?.trailing}))},{default:z(()=>[U(e.$slots,`trailing`,{modelValue:n,open:r,ui:me.value},()=>[R(o).clear&&!le.value&&!Le(n)?(G(),q(R(g).Cancel,{key:0,"as-child":``},{default:z(()=>[Y(Zx,Q({as:`span`,icon:R(o).clearIcon||R(l).ui.icons.close,size:ce.value,variant:`link`,color:`neutral`,tabindex:`-1`},S.value,{"data-slot":`trailingClear`,class:me.value.trailingClear({class:R(o).ui?.trailingClear}),onClick:nl(Re,[`stop`])}),null,16,[`icon`,`size`,`class`])]),_:1})):R(ae)?(G(),q(Ix,{key:1,name:R(ae),"data-slot":`trailingIcon`,class:F(me.value.trailingIcon({class:R(o).ui?.trailingIcon}))},null,8,[`name`,`class`])):Z(``,!0)])]),_:2},1032,[`class`])):Z(``,!0)]),_:2},1032,[`as-child`,`data-slot`,`class`]),Y(R(g).Portal,Se(as(R(y))),{default:z(()=>[Y(R(Wx),null,{default:z(()=>[Y(R(g).Content,Q({"data-slot":`content`,class:me.value.content({class:R(o).ui?.content})},b.value,{onFocusOutside:t[3]||=nl(()=>{},[`prevent`])}),{default:z(()=>[U(e.$slots,`content-top`),Y(R(g).Empty,{"data-slot":`empty`,class:F(me.value.empty({class:R(o).ui?.empty}))},{default:z(()=>[U(e.$slots,`empty`,{searchTerm:s.value},()=>[X(I(s.value?R(c)(`inputMenu.noMatch`,{searchTerm:s.value}):R(c)(`inputMenu.noData`)),1)])]),_:3},8,[`class`]),J(`div`,{ref_key:`viewportRef`,ref:Ve,role:`presentation`,"data-slot":`viewport`,class:F(me.value.viewport({class:R(o).ui?.viewport}))},[R(o).virtualize?(G(),K(W,{key:0},[be.value&&xe.value===`top`?(G(),q(R(de),{key:0})):Z(``,!0),Y(R(g).Virtualizer,Q({options:ye.value,"text-content":e=>Ie(e)?R(zd)(e,R(o).labelKey):String(e)},C.value),{default:z(({option:e,virtualItem:t})=>[Y(R(pe),{item:e,index:t.index},null,8,[`item`,`index`])]),_:1},16,[`options`,`text-content`]),be.value&&xe.value===`bottom`?(G(),q(R(de),{key:1})):Z(``,!0)],64)):(G(),K(W,{key:1},[be.value&&xe.value===`top`?(G(),q(R(g).Group,{key:0,"data-slot":`group`,class:F(me.value.group({class:R(o).ui?.group}))},{default:z(()=>[Y(R(de))]),_:1},8,[`class`])):Z(``,!0),(G(!0),K(W,null,H(ve.value,(e,t)=>(G(),q(R(g).Group,{key:`group-${t}`,"data-slot":`group`,class:F(me.value.group({class:R(o).ui?.group}))},{default:z(()=>[(G(!0),K(W,null,H(e,(e,n)=>(G(),q(R(pe),{key:`group-${t}-${n}`,item:e,index:n},null,8,[`item`,`index`]))),128))]),_:2},1032,[`class`]))),128)),be.value&&xe.value===`bottom`?(G(),q(R(g).Group,{key:1,"data-slot":`group`,class:F(me.value.group({class:R(o).ui?.group}))},{default:z(()=>[Y(R(de))]),_:1},8,[`class`])):Z(``,!0)],64))],2),U(e.$slots,`content-bottom`),R(o).arrow?(G(),q(R(g).Arrow,Q({key:0},x.value,{"data-slot":`arrow`,class:me.value.arrow({class:R(o).ui?.arrow})}),null,16,[`class`])):Z(``,!0)]),_:3},16,[`class`])]),_:3})]),_:3},16)]),_:3},16,[`name`,`disabled`,`data-slot`,`class`,`as-child`])],64))}}),SL={class:`api-settings`},CL={class:`api-field`,title:`Base URL`},wL={class:`api-field`,title:`OpenRouter 等兼容服务可选 Chat Completions,并填写该服务的完整模型 ID。`},TL={key:0,class:`api-field`},EL={class:`api-provided`},DL={key:1,class:`api-field`},OL={class:`api-field`},kL={class:`api-inline`},AL={key:2,role:`alert`},jL=`••••••••••••`,ML=rO({__name:`ApiSettings`,props:{name:{type:String,required:!0}},setup(e){let t=e,{view:n,bridge:r}=Dr(`discussion`),i=$(()=>n.value.launch.profiles[t.name]||{}),a=$(()=>r.launch_model_state(t.name,n.value.launch)),o=L(``),s=L(!1),c=L(!1),l=L(``),u=[{value:`responses`,label:`OpenAI Responses`},{value:`chat`,label:`OpenAI Chat Completions`},{value:`anthropic`,label:`Anthropic Messages`},{value:`gemini`,label:`Gemini generateContent`}];B(()=>i.value.base_url,()=>{o.value=l.value=``});let d=(e,n)=>r.write_launch(t.name,e,n),f=$(()=>n.value.launch.projects_restricted&&(n.value.launch.managed_api_keys||[]).includes(i.value.api_key_ref));async function p(){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=WD,m=$D,h=Ix,g=Zx,_=xL;return G(),K(`div`,SL,[J(`label`,CL,[n[6]||=J(`span`,null,`地址`,-1),Y(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`])]),J(`div`,wL,[n[7]||=J(`span`,null,`协议`,-1),Y(m,{"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`])]),f.value?(G(),K(`div`,TL,[n[9]||=J(`span`,null,`密钥`,-1),J(`span`,EL,[Y(h,{name:`i-lucide-shield-check`}),n[8]||=X(`管理员已提供`,-1)])])):(G(),K(`div`,DL,[n[10]||=J(`span`,null,`密钥`,-1),Y(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?jL:`填写 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:p},{trailing:z(()=>[Y(g,{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`])])),J(`div`,OL,[n[11]||=J(`span`,null,`模型`,-1),J(`div`,kL,[Y(_,{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`]),Y(g,{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=>R(r).load_launch_models(e.name,!0)},null,8,[`aria-label`,`loading`,`disabled`])])]),a.value.error?(G(),K(`p`,AL,I(a.value.error),1)):Z(``,!0)])}}},[[`__scopeId`,`data-v-896c8051`]]),NL={key:0,class:`member-text-fixed`},PL={key:1,class:`member-text-source`},FL={class:`member-text-meta`},IL={class:`member-text-footer`},LL=rO({__name:`MemberTextDialog`,props:Va({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:Va([`save`],[`update:open`,`update:draft`]),setup(e,{emit:t}){let n=e,r=no(e,`open`),i=no(e,`draft`),a=t,o=$(()=>i.value.length>=n.max*.9);function s(){n.changed&&!n.saving&&!n.readonly&&a(`save`)}return(t,n)=>{let a=Ix,c=zD,l=Zx,u=LD;return G(),q(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:z(()=>[J(`form`,{class:`member-text`,onSubmit:nl(s,[`prevent`])},[U(t.$slots,`lead`,{},void 0,!0),e.fixed?(G(),K(`details`,NL,[J(`summary`,null,[Y(a,{name:`i-lucide-lock`}),X(I(e.fixed.summary),1),Y(a,{name:`i-lucide-chevron-down`,class:`member-text-fixed-chevron`})]),(G(!0),K(W,null,H(e.fixed.sections,e=>(G(),K(`section`,{key:e.label},[J(`h4`,null,I(e.label),1),J(`p`,null,I(e.text),1)]))),128))])):Z(``,!0),e.source&&!e.readonly?(G(),K(`div`,PL,[Y(a,{name:`i-lucide-bookmark`}),J(`p`,null,[J(`b`,null,I(e.source.tag),1),X(I(e.source.text),1)]),J(`button`,{type:`button`,onClick:n[0]||=t=>i.value=e.source.text},I(e.source.action),1)])):Z(``,!0),Y(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:[rl(nl(s,[`ctrl`,`prevent`]),[`enter`]),rl(nl(s,[`meta`,`prevent`]),[`enter`])]},null,8,[`modelValue`,`rows`,`maxlength`,`maxrows`,`aria-label`,`placeholder`,`readonly`,`onKeydown`]),J(`div`,FL,[J(`span`,null,I(e.note),1),J(`span`,{class:F({"is-near":o.value})},I(i.value.length)+` / `+I(e.max),3)]),J(`div`,IL,[J(`div`,null,[U(t.$slots,`extra`,{},void 0,!0)]),Y(l,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:n[2]||=e=>r.value=!1}),e.readonly?Z(``,!0):(G(),q(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`]]),RL={class:`member-label-field`},zL=500,BL=32,VL=rO({__name:`MemberDescriptionDialog`,props:Va({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:Va([`save`],[`update:open`]),setup(e,{emit:t}){let n=e,r=no(e,`open`),i=t,a=L(``),o=L(``),s=L(!1),c=L({name:``,platform:``,text:``,template:``,label:``,default:``});B(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=$(()=>a.value.trim()),u=$(()=>c.value.template&&l.value!==c.value.template?{tag:`${c.value.platform} 的默认描述`,text:c.value.template,action:`填入`}:null),d=$(()=>!!(c.value.platform&&l.value&&l.value!==c.value.template)),f=$(()=>o.value.trim()!==c.value.label),p=$(()=>l.value!==c.value.text||f.value||s.value&&d.value),m=$(()=>s.value&&d.value?`之后添加 ${c.value.platform} 时自动填入这段描述`:l.value?`标签或一段话都行,Ctrl + Enter 保存`:`留空表示不提供描述`);B(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=WD,l=nO;return G(),q(LL,{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:zL,note:m.value,source:u.value,changed:p.value,saving:e.saving,onSave:h},{lead:z(()=>[J(`label`,RL,[n[4]||=J(`span`,null,`显示名称`,-1),Y(i,{modelValue:o.value,"onUpdate:modelValue":n[0]||=e=>o.value=e,maxlength:BL,placeholder:`留空显示 ${c.value.default}`,"aria-label":`${c.value.name} 的显示名称`,class:`w-full`},null,8,[`modelValue`,`placeholder`,`aria-label`])])]),extra:z(()=>[d.value?(G(),q(l,{key:0,modelValue:s.value,"onUpdate:modelValue":n[1]||=e=>s.value=e,label:`存为 ${c.value.platform} 的默认描述`},null,8,[`modelValue`,`label`])):Z(``,!0)]),_:1},8,[`open`,`draft`,`title`,`label`,`note`,`source`,`changed`,`saving`])}}},[[`__scopeId`,`data-v-83eeada0`]]),HL=4e3,UL={},WL=`用户为你单独设置的提示(补充做法与偏好,不改变权限与技能规则):`,GL=[`read`,`write`,`auto`,`full`],KL={read:`只读`,write:`可写`,auto:`自动`,full:`全放开`};function qL(e){return NI(e)?.access_levels||GL}function JL(e){let t=qL(e),n=NI(e);return GL.map(e=>t.includes(e)?{value:e,label:KL[e],hint:n?.access_hints?.[e]||``}:{value:e,label:KL[e],hint:n?.unsupported_hints?.[e]||`该软件不支持此档位`,disabled:!0})}function YL(e){return e===`own`?`自行决定`:KL[e]||`只读`}function XL(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 ZL(e,t,n=[]){return e.project_access===`own`?`项目文件与命令权限沿用你自己会话的软件设置。`:e.project_access===`auto`?`由软件自动审批:可${t}修改项目文件并运行所需命令;被沙箱或审批拦下时按软件方式申请放行(Codex 申请提权),仍被拒绝就在回答中说明。`:e.project_access===`full`?`已跳过软件审批与沙箱,可${t}修改文件并运行所需命令。`:!e.cwd&&n.length?XL(e,n)?`用户允许${t}修改项目文件并运行所需命令。`:`项目文件只读,不修改。`:e.cwd?e.project_access===`write`?`用户允许${t}修改 cwd 中的项目文件并运行所需命令。`:`cwd 中的项目文件只读,不修改。`:`未指定项目目录。`}function QL(e,t,n=[]){return NI(e.adapter)?.task_rules?.(t,{runs_commands:XL(e,n)})||``}var $L=`读含中文的文件用 rg --encoding utf-8 . 文件路径,不用 Get-Content(Windows PowerShell 会读成乱码)。`;function eR({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=XL(r,u)?``:`命令只用 subcommands 列出的 ${i} 子命令。`,p=u.length?`extra_directories 是本房间的其他项目目录,access 为 read 的只读、不修改。`:``,m=`${QL(r,i,u)}${d}${ZL(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 tR=[`data-identity`,`data-face`],nR=[`inert`,`aria-hidden`],rR={class:`expert-card-identity`},iR={class:`expert-card-names`},aR={key:0},oR={key:0,class:`member-id`},sR={key:0,class:`expert-card-badge`},cR={key:1},lR={key:0,class:`member-id`},uR={key:0,class:`expert-card-badge`},dR=[`title`],fR=[`title`],pR={class:`expert-card-facts`},mR=[`title`],hR={key:0,"aria-hidden":`true`},gR={key:1,class:`expert-card-manual`},_R={key:0},vR={key:2,class:`expert-card-flip`},yR=[`aria-label`],bR=[`aria-checked`,`tabindex`,`data-mode`,`onClick`],xR={class:`expert-card-tools`},SR=[`aria-label`,`title`],CR=[`title`,`aria-label`],wR=[`aria-pressed`,`aria-label`,`title`],TR=[`aria-label`],ER=[`inert`,`aria-hidden`],DR={class:`expert-card-back-body nowheel nopan nodrag`},OR={class:`expert-card-heading`},kR={key:0},AR={class:`expert-card-heading-tools`},jR=[`aria-label`,`title`],MR=[`title`,`aria-label`],NR={key:0,class:`expert-card-field`},PR={key:1,class:`expert-card-field`},FR=[`aria-label`],IR=[`title`,`disabled`,`aria-checked`,`onClick`],LR={class:`expert-card-field`},RR={key:0,class:`expert-card-catalog`},zR={key:1,class:`expert-card-effort`},BR={key:2,class:`expert-card-note`},VR=[`aria-label`,`disabled`],HR={key:4,class:`expert-card-note`},UR={class:`expert-card-flip-actions`},WR=[`disabled`,`aria-label`],GR=[`aria-label`],KR=[`aria-label`],qR={class:`expert-card-naming-actions`},JR=180,YR=`[role='listbox'], [role='menu'], [data-reka-popper-content-wrapper]`,XR=rO({__name:`ExpertCard`,props:Va({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:Va([`remove`,`mode`,`host`],[`update:preset`]),setup(e,{emit:t}){let n=e,r=no(e,`preset`),i=t,{view:a,bridge:o}=Dr(`discussion`),s=PD(0,{mass:1,stiffness:270.0323764138049,damping:31.550710806760762}),c=L(null),l=L(null),u=L(null),d=L(!1),f=L(!1),p=$(()=>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=$(()=>r.value?r.value.label||o.default_name(n.name):a.value&&o.member_label(n.name)),h=$(()=>o.launch_clients[n.name]||[]),g=$(()=>a.value.launch.projects_restricted===!0),_=$(()=>n.choices.filter(e=>e!==`manual`||!g.value&&h.value.some(e=>e.value!==`api`))),v=$(()=>n.mode===`cli`),y={cli:`程序启动`,manual:`手动启动`},b=$(()=>!r.value&&v.value&&p.value.adapter===`api`),x=L({state:``});B(()=>[p.value.base_url,p.value.api_protocol,p.value.model,p.value.api_key_ref],()=>{x.value={state:``}});async function S(){x.value={state:`loading`};try{await o.check_launch_api(n.name),x.value={state:`ok`},o.notify(`info`,`检查通过:模型已响应`)}catch(e){x.value={state:`error`},o.notify(`error`,e.message)}}let C=$(()=>!a.value.launch.available&&a.value.launch.relay?.clients[o.platform_of(n.name)]),w=$(()=>h.value.find(e=>e.value===(C.value||p.value.adapter))?.label||(a.value.launch.relay&&!a.value.launch.available?`电脑上未配置`:`待选择 App / CLI`)),T=$(()=>n.mode===`manual`),E={Codex:`已实测:消息实时显示在已开窗口。`,Antigravity:`已实测:App 会话实时显示;agy CLI 窗口需重启才显示后台发言。`,Claude:`已实测:原窗口开着时消息实时送入;关闭后在后台续接同一会话。`},D=$(()=>E[o.platform_of(n.name)]||``),O=$(()=>!!p.value.session_id),k=$(()=>!r.value&&v.value&&h.value.length>0&&!(a.value.launch.relay&&!a.value.launch.available)),A=$(()=>r.value?`编辑 ${n.name} 的卡片`:`配置 ${n.name} 的启动方式`),j=$(()=>o.launch_model_state(n.name,a.value.launch,p.value)),M=$(()=>r.value&&!NI(p.value.adapter)?.models),N=$(()=>!!(r.value||v.value&&j.value.supported)),ee=$(()=>N.value&&me.value.length?`补齐上方连接后,可在这里选择模型与思考强度。`:p.value.adapter?`模型与思考强度在 App 原聊天中选择,本页不覆盖 App 设置。`:`先选择软件入口。支持启动参数的 CLI 可在这里设置模型与强度。`),te={low:`Low`,medium:`Medium`,high:`High`,xhigh:`Extra High`,max:`Max`,ultra:`Ultra`},P=$(()=>{let e=NI(p.value.adapter),t=j.value.efforts||(r.value||!e?.models?e?.efforts:null);return t?.length?[{label:`默认强度`,value:``},...t.map(e=>({label:te[e]||e,value:e}))]:null}),ne=$(()=>p.value.adapter===`antigravity_cli`&&p.value.model?``:j.value.defaults?.effort),re=$(()=>p.value.effort?te[p.value.effort]||p.value.effort:ne.value?te[ne.value]||ne.value:`默认`),ie=$(()=>!!r.value||v.value&&o.launch_can_set_access(n.name,a.value.launch)),ae=$(()=>!r.value&&v.value&&p.value.adapter!==`api`),oe=$(()=>p.value.project_access||a.value.launch.workspace?.project_access||`read`),se=$(()=>n.mode===`manual`?`你来启动 · 自主发言`:`程序启动 · ${O.value?`续接会话`:p.value.adapter===`api`?`调用 API`:`新会话`}`),ce=$(()=>`不可(须本机唤醒)`),le=$(()=>{let e=a.value.launch.card_platforms||[];return!!r.value&&e.length>0&&!e.includes(o.platform_of(n.name))}),ue=$(()=>r.value?[...r.value.needs_platform||le.value?[{label:`平台`,value:`本机未配置此软件`,tone:`warn`}]:[],{label:`模型`,value:p.value.model||`软件默认模型`},...p.value.effort?[{label:`强度`,value:re.value}]:[],{label:`项目`,value:YL(oe.value),...oe.value===`read`?{}:{tone:`warn`}}]:[...v.value?[{label:`状态`,value:n.status.text,tone:n.status.tone}]:[],{label:`启动`,value:se.value},...v.value?[{label:`软件`,value:w.value}]:[],...N.value?[{label:`模型`,value:p.value.model||j.value.defaults?.model||`软件默认模型`}]:[],...N.value&&(p.value.adapter!==`api`||p.value.effort)?[{label:`强度`,value:re.value}]:[],...ie.value?[{label:`项目`,value:YL(oe.value),...n.workflow&&oe.value!==`read`?{tone:`warn`}:{}}]:[],...n.hosting&&!n.host&&!n.hostable?[{label:`主持`,value:ce.value}]:[]]),de={executable:{label:`路径`,placeholder:`可执行文件完整路径`},ipc_directory:{label:`IPC`,placeholder:`Sidecar IPC 目录`},source_thread_id:{label:`聊天`,placeholder:`Codex App 来源聊天 ID`}},fe=L([]),pe=()=>{let e=p.value.adapter;return!ae.value||!e?[]:(e===`antigravity`?[`ipc_directory`]:e===`codex`?[`executable`,`source_thread_id`]:[`executable`]).filter(e=>!p.value[e])},me=$(()=>ae.value?[...new Set([...fe.value,...pe()])].map(e=>({field:e,...de[e]})):[]);function he(){ir(()=>{document.activeElement===c.value&&(f.value?u:l).value?.focus({preventScroll:!0})})}function ge(e){let t=e>=JR/2;f.value!==t&&(f.value=t,he())}let ve=s.on(`change`,ge),ye=s.on(`animationComplete`,he),be=null;function xe(e){(!e||k.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=$(()=>r.value?(r.value.description||``).trim():a.value&&o.description_draft(n.name).trim()),we=L(!1),Te=$(()=>Ce.value?`编辑名称与描述:${Ce.value}`:`编辑名称与描述`);function Ee({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)),we.value=!1}let De=$(()=>a.value.launch.presets.some(e=>e.name===n.name)),Oe=L(!1),ke=L(``),Ae=L(!1),je=$(()=>ke.value.trim()),Me=$(()=>!je.value||je.value===`${o.default_name(o.platform_of(n.name))}-`),Ne=$(()=>a.value&&!Me.value?o.preset_identity(n.name,je.value):``),Pe=$(()=>{if(!Ne.value)return`预设名称会显示在“预设”行和房间里,可以不带平台前缀。`;let e=o.expert_presets().find(e=>e.name===Ne.value);return[Ne.value===je.value?``:`成员 ID:${Ne.value}`,e?`将覆盖已有预设「${e.label||e.name}」`:``].filter(Boolean).join(` · `)||`预设名称即成员 ID`});function Fe(){if(Ae.value)return;if(De.value)return Le();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;ke.value=`${i}-${r}`,Oe.value=!0}async function Ie(){Me.value||Ae.value||await Le(je.value)&&(Oe.value=!1)}async function Le(e){Ae.value=!0;try{return await o.save_expert_preset(n.name,e)}finally{Ae.value=!1}}let Re=$(()=>UL[p.value.adapter]||``),ze=$(()=>r.value?!!r.value.system_prompt?.trim():Object.hasOwn(p.value,`system_prompt`)),Be=$(()=>(ze.value?p.value.system_prompt:Re.value).trim()),Ve=$(()=>Be.value?`专属提示词(${ze.value?`自定义`:`软件预设`}):${Be.value.split(`
58
58
  `)[0]}`:`专属提示词:未设置,点击添加`),He=L(!1),Ue=L(``),We=$(()=>Ue.value.trim()!==Be.value),Ge=$(()=>{let e=Ue.value.trim();return r.value?e?`保存到这张工作流卡片,Ctrl + Enter 保存`:`留空使用软件预设`:e?e===Re.value.trim()?`与软件预设一致,预设更新时自动跟随`:Re.value?`已改写,不再跟随软件预设`:`只发给这位专家,Ctrl + Enter 保存`:Re.value?`留空:这位专家不使用预设,也没有专属提示词`:`留空表示不使用`}),Ke=$(()=>Re.value&&Ue.value.trim()!==Re.value.trim()?{tag:`软件预设`,text:Re.value,action:`恢复预设`}:null),qe=$(()=>{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`?$L:`(本机装有 rg 时附加)${$L}`:``,{prompt:s,instructions:c}=eR({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:`每次唤醒随消息发送;填了专属提示词时,后面另起一段“${WL}”再接它`,text:s},{label:`任务文件中的说明(由 AI 读取)`,text:c},{label:`说明`,text:`以上是房间未开讨论时的版本;开启讨论后改用讨论版说明。{…} 为每次执行时才确定的值。`}]}});function Je(){Ue.value=Be.value,He.value=!0}function Ye(){let e=Ue.value.trim();Xe(`system_prompt`,r.value?e:e===Re.value.trim()?null:e),He.value=!1}function Xe(e,t){r.value?r.value[e]=t:o.write_launch(n.name,e,t)}function Ze(e){if(!r.value)return o.write_launch_model(n.name,e);Xe(`model`,e===`__default__`?``:e),Xe(`effort`,``)}function Qe(e=!1){return o.load_launch_models(n.name,e,p.value)}function $e(){Xe(`model`,``),Xe(`effort`,``)}function et(e){e===`cli`&&o.default_launch_entry(n.name),e===`manual`&&o.write_description_draft(n.name,``),i(`mode`,e)}function tt(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=_.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];et(a),e.currentTarget.querySelector(`[data-mode="${a}"]`)?.focus()}function nt(e){d.value&&(e.stopPropagation(),e.preventDefault(),Se())}function rt(e){He.value||we.value||Oe.value||c.value?.contains(e.target)||e.target.closest?.(YR)||xe(!1)}return B(d,e=>{e?document.addEventListener(`pointerdown`,rt,!0):document.removeEventListener(`pointerdown`,rt,!0)}),B(d,e=>s.set(e?JR:0)),B(()=>[N.value,a.value.launch.available,p.value.adapter],([e,t])=>{e&&t&&Qe()},{immediate:!0}),sa(()=>{document.removeEventListener(`pointerdown`,rt,!0),ve(),ye(),s.stop()}),(t,n)=>{let d=Bx,C=Ix,w=Zx,E=$D,O=WD,te=LD;return G(),K(`div`,{ref_key:`card`,ref:c,class:F([`expert-card`,{"is-configurable":N.value,"is-host":e.host,"is-static":!v.value,"is-manual":T.value}]),"data-identity":R(o).identities[e.name]?.style,"data-face":f.value?`back`:`front`,tabindex:`-1`,onKeydown:rl(nt,[`esc`])},[Y(R(AD).div,{class:`expert-card-turn`,style:_e({rotateY:R(s)})},{default:z(()=>[J(`div`,{class:`expert-card-face expert-card-front`,inert:f.value,"aria-hidden":f.value},[(G(),q(_a(k.value?`button`:`div`),{ref_key:`front_button`,ref:l,type:k.value?`button`:void 0,class:F([`expert-card-open`,{"is-static":!k.value,"has-modes":_.value.length>1}]),"aria-label":k.value?A.value:void 0,title:k.value?`点击翻面设置`:void 0,onClick:n[0]||=e=>xe(!0)},{default:z(()=>[J(`span`,rR,[Y(d,{src:R(o).identities[e.name]?.icon,text:R(o).identities[e.name]?.initials,alt:e.name,size:`sm`,class:F([`channel-avatar expert-card-avatar`,R(o).identities[e.name]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`span`,iR,[T.value?(G(),K(`span`,aR,[J(`strong`,null,[X(I(R(o).display_name(e.name))+`(手动)`,1),R(o).display_name(e.name)===e.name?Z(``,!0):(G(),K(`span`,oR,I(e.name),1))]),e.host&&!e.hostable?(G(),K(`span`,sR,`主持`)):Z(``,!0)])):(G(),K(`span`,cR,[J(`strong`,null,[X(I(m.value),1),m.value===e.name?Z(``,!0):(G(),K(`span`,lR,I(e.name),1))]),e.host&&!e.hostable?(G(),K(`span`,uR,`主持`)):Z(``,!0)])),Ce.value&&!r.value?(G(),K(`small`,{key:2,title:Ce.value},I(Ce.value),9,dR)):Z(``,!0)])]),r.value?(G(),K(`p`,{key:0,class:F([`expert-card-summary`,{"is-empty":!Ce.value}]),title:Ce.value},I(Ce.value||`还没有描述`),11,fR)):Z(``,!0),J(`dl`,pR,[(G(!0),K(W,null,H(ue.value,e=>(G(),K(`div`,{key:e.label},[J(`dt`,null,I(e.label),1),J(`dd`,{class:F(e.tone?[`expert-card-status`,`is-${e.tone}`]:``),title:e.value},[e.tone?(G(),K(`i`,hR)):Z(``,!0),X(I(e.value),1)],10,mR)]))),128))]),T.value?(G(),K(`div`,gR,[n[15]||=J(`p`,null,`会话自行注册后才算到场。`,-1),D.value?(G(),K(`p`,_R,I(D.value),1)):Z(``,!0)])):Z(``,!0),k.value?(G(),K(`span`,vR,[Y(C,{name:`i-lucide-settings-2`}),n[16]||=X(`设置`,-1)])):Z(``,!0)]),_:1},8,[`type`,`class`,`aria-label`,`title`])),_.value.length>1?(G(),K(`div`,{key:0,class:`expert-card-modes expert-card-front-modes`,role:`radiogroup`,"aria-label":`${e.name} 启动方式`,onKeydown:tt},[(G(!0),K(W,null,H(_.value,t=>(G(),K(`button`,{key:t,type:`button`,role:`radio`,"aria-checked":e.mode===t,tabindex:e.mode===t?0:-1,"data-mode":t,onClick:e=>et(t)},I(y[t]),9,bR))),128))],40,yR)):Z(``,!0),J(`span`,xR,[!k.value&&!T.value?(G(),K(`button`,{key:0,type:`button`,class:F({"is-set":Ce.value}),"aria-label":`编辑 ${e.name} 的名称与描述`,title:Te.value,onClick:n[1]||=e=>we.value=!0},[Y(C,{name:`i-lucide-user-pen`})],10,SR)):Z(``,!0),r.value?(G(),K(`button`,{key:1,type:`button`,class:F({"is-set":Be.value}),title:Ve.value,"aria-label":`编辑 ${e.name} 的专属提示词`,onClick:Je},[Y(C,{name:`i-lucide-scroll-text`})],10,CR)):Z(``,!0),e.hostable?(G(),K(`button`,{key:2,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`)},[Y(C,{name:`i-lucide-crown`})],8,wR)):Z(``,!0),J(`button`,{type:`button`,"aria-label":`移出 ${e.name}`,title:`移出`,onClick:n[3]||=e=>i(`remove`)},[Y(C,{name:`i-lucide-x`})],8,TR)])],8,nR),k.value?(G(),K(`div`,{key:0,class:`expert-card-face expert-card-back`,inert:!f.value,"aria-hidden":!f.value},[J(`div`,DR,[J(`div`,OR,[J(`strong`,null,[X(I(m.value),1),m.value===e.name?Z(``,!0):(G(),K(`span`,kR,I(e.name),1)),n[17]||=J(`span`,null,`设置`,-1)]),J(`span`,AR,[J(`button`,{type:`button`,class:F([`expert-card-back-tool`,{"is-set":Ce.value}]),"aria-label":`编辑 ${e.name} 的名称与描述`,title:Te.value,onClick:n[4]||=e=>we.value=!0},[Y(C,{name:`i-lucide-user-pen`})],10,jR),r.value||p.value.adapter?(G(),K(`button`,{key:0,type:`button`,class:F([`expert-card-back-tool`,{"is-set":Be.value,"is-own":ze.value&&Be.value}]),title:Ve.value,"aria-label":`编辑 ${e.name} 的专属提示词`,onClick:Je},[Y(C,{name:`i-lucide-scroll-text`})],10,MR)):Z(``,!0),b.value?(G(),q(w,{key:1,icon:`i-lucide-zap`,"aria-label":`检查 ${e.name} 的 API 配置`,title:`检查配置:发送一次极短请求,核对地址、密钥、协议与模型`,size:`xs`,color:x.value.state===`ok`?`success`:x.value.state===`error`?`error`:`neutral`,variant:`ghost`,loading:x.value.state===`loading`,disabled:!p.value.api_key_ref||!p.value.model||!R(a).launch.available,onClick:S},null,8,[`aria-label`,`color`,`loading`,`disabled`])):Z(``,!0)])]),!r.value&&v.value&&!g.value&&h.value.length>1?(G(),K(`div`,NR,[n[18]||=J(`span`,null,`接入`,-1),Y(E,{"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=>R(o).write_launch(e.name,`adapter`,t)},null,8,[`model-value`,`items`,`aria-label`])])):Z(``,!0),(G(!0),K(W,null,H(g.value?[]:me.value,t=>(G(),K(`div`,{key:t.field,class:`expert-card-field`},[J(`span`,null,I(t.label),1),Y(O,{"model-value":p.value[t.field]||``,placeholder:t.placeholder,"aria-label":`${e.name} ${t.placeholder}`,size:`xs`,class:`w-full`,"onUpdate:modelValue":n=>R(o).write_launch(e.name,t.field,n)},null,8,[`model-value`,`placeholder`,`aria-label`,`onUpdate:modelValue`])]))),128)),ie.value?(G(),K(`div`,PR,[n[19]||=J(`span`,null,`项目`,-1),J(`div`,{class:`expert-card-modes`,role:`radiogroup`,"aria-label":`${e.name} 的项目文件权限`},[(G(!0),K(W,null,H(R(JL)(p.value.adapter),t=>(G(),K(`button`,{key:t.value,type:`button`,role:`radio`,title:t.hint,disabled:e.access_locked||t.disabled,"aria-checked":oe.value===t.value,onClick:e=>Xe(`project_access`,t.value)},I(t.label),9,IR))),128))],8,FR)])):Z(``,!0),b.value?(G(),q(ML,{key:2,name:e.name},null,8,[`name`])):N.value&&!me.value.length?(G(),K(W,{key:3},[J(`div`,LR,[n[20]||=J(`span`,null,`模型`,-1),M.value?(G(),q(O,{key:0,"model-value":p.value.model||``,placeholder:`留空使用默认模型`,"aria-label":`${e.name} 使用的模型`,size:`xs`,class:`w-full`,"onUpdate:modelValue":Ze},null,8,[`model-value`,`aria-label`])):(G(),q(E,{key:1,"model-value":p.value.model||`__default__`,items:j.value.items,title:j.value.source,"aria-label":`${e.name} 使用的模型`,size:`xs`,class:`w-full`,"onUpdate:modelValue":Ze},null,8,[`model-value`,`items`,`title`,`aria-label`]))]),j.value.loading||j.value.error?(G(),K(`div`,RR,[J(`span`,null,I(j.value.loading?`正在读取软件模型列表…`:j.value.error),1),!j.value.loading&&j.value.error&&R(a).launch.available?(G(),K(`button`,{key:0,type:`button`,onClick:n[6]||=e=>Qe(!0)},`重试`)):Z(``,!0)])):Z(``,!0),P.value?(G(),K(`div`,zR,[Y(gL,{caption:`强度`,items:P.value,"model-value":p.value.effort||``,label:`${e.name} 的思考强度`,"onUpdate:modelValue":n[7]||=e=>Xe(`effort`,e)},null,8,[`items`,`model-value`,`label`])])):(G(),K(`p`,BR,I(j.value.effort_note),1)),J(`button`,{type:`button`,class:`expert-card-defaults`,title:`留空使用 CLI 默认值`,"aria-label":`恢复 ${e.name} 的默认模型与强度`,disabled:!p.value.model&&!p.value.effort,onClick:$e},`恢复默认`,8,VR)],64)):(G(),K(`p`,HR,[Y(C,{name:`i-lucide-monitor`}),X(I(ee.value),1)]))]),J(`span`,UR,[R(a).launch.available&&!e.workflow&&!r.value?(G(),K(`button`,{key:0,type:`button`,class:`expert-card-flip is-cancel`,disabled:Ae.value,"aria-label":`${De.value?`更新`:`存为`}预设「${e.name}」`,title:`存下描述、提示词、项目权限、模型与强度,之后在“预设”行一键加入`,onClick:Fe},I(Ae.value?`保存中…`:De.value?`更新预设`:`存为预设`),9,WR)):Z(``,!0),J(`button`,{type:`button`,class:`expert-card-flip is-cancel`,"aria-label":`放弃 ${e.name} 的修改`,onClick:Se},`取消`,8,GR),J(`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)},[Y(C,{name:`i-lucide-check`}),n[21]||=X(`完成`,-1)],8,KR)])],8,ER)):Z(``,!0)]),_:1},8,[`style`]),Y(VL,{open:we.value,"onUpdate:open":n[9]||=e=>we.value=e,name:e.name,platform:r.value?``:R(o).default_name(R(o).platform_of(e.name)),default_label:R(o).default_name(e.name),text:Ce.value,label:r.value?r.value.label||``:R(o).label_draft(e.name),template:r.value?``:R(o).description_template(e.name),onSave:Ee},null,8,[`open`,`name`,`platform`,`default_label`,`text`,`label`,`template`]),Y(LL,{open:He.value,"onUpdate:open":n[10]||=e=>He.value=e,draft:Ue.value,"onUpdate:draft":n[11]||=e=>Ue.value=e,title:`${e.name} 的专属提示词`,description:e.workflow?`来自工作流「${e.workflow}」,每次执行时按工作流里的这张卡片发送;请在“工作流”一行点“编辑”修改,修改会作用于所有启用它的房间。`:`只发给这位专家,补充它的做法与偏好;不改变权限和技能规则。`,label:`${e.name} 的专属提示词`,placeholder:`例如:回答先给结论,控制在三段以内。`,max:R(HL),rows:8,readonly:!!e.workflow,note:e.workflow?`只读`:Ge.value,source:Ke.value,fixed:qe.value,changed:We.value,onSave:Ye},null,8,[`open`,`draft`,`title`,`description`,`label`,`max`,`readonly`,`note`,`source`,`fixed`,`changed`]),Y(te,{content:{onInteractOutside:e=>e.preventDefault()},open:Oe.value,"onUpdate:open":n[14]||=e=>Oe.value=e,title:`存为专家预设`,description:`存下描述、提示词、项目权限、模型与强度,之后在“预设”行一键加入。`,ui:{content:`glass-panel studio-modal`,body:`dialog-body`}},{body:z(()=>[J(`form`,{class:`expert-card-naming`,onSubmit:nl(Ie,[`prevent`])},[Y(O,{modelValue:ke.value,"onUpdate:modelValue":n[12]||=e=>ke.value=e,maxlength:32,autofocus:``,class:`w-full`,"aria-label":`预设名称`,placeholder:`预设名称,如 评审官`},null,8,[`modelValue`]),J(`p`,null,I(Pe.value),1),J(`div`,qR,[Y(w,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:n[13]||=e=>Oe.value=!1}),Y(w,{type:`submit`,label:`保存`,class:`channel-primary-button`,disabled:Me.value,loading:Ae.value},null,8,[`disabled`,`loading`])])],32)]),_:1},8,[`content`,`open`])],42,tR)}}},[[`__scopeId`,`data-v-b8386db3`]]),ZR={key:0,class:`project-field`},QR=[`disabled`],$R={key:0,class:`project-note`},ez={key:1,class:`project-field`},tz=[`disabled`],nz=[`title`,`disabled`],rz={key:0},iz=[`disabled`],az={key:0},oz={key:0,class:`project-rows`,"aria-label":`常用项目`},sz={class:`project-tile`},cz={class:`project-edit`},lz={class:`project-text`},uz=[`title`],dz={class:`project-actions`},fz={key:1,class:`project-add`,role:`group`,"aria-label":`添加项目`},pz={class:`project-add-actions`},mz={key:3,role:`alert`,class:`project-error`},hz={class:`project-footer`},gz={key:0,role:`alert`,class:`project-error`},_z={class:`project-footer`},vz={class:`folder-picker`},yz={class:`folder-head`},bz=[`title`],xz=[`aria-busy`],Sz=[`disabled`,`onClick`],Cz={key:1,class:`folder-empty`},wz={key:1,class:`project-note`},Tz={key:2,role:`alert`,class:`project-error`},Ez={class:`project-footer`},Dz=rO({__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=$(()=>n.modelValue!==void 0),{view:a,bridge:o}=Dr(`discussion`),s=$(()=>a.value.launch),c=$(()=>s.value.available?null:s.value.relay),l=$(()=>c.value?c.value.projects:s.value.projects||[]),u=$(()=>s.value.available&&!s.value.remote),d=$(()=>s.value.available&&s.value.projects_restricted===!0),f=$(()=>s.value.available),p=$(()=>(i.value?n.modelValue:s.value.workspace.cwd)||``),m=$(()=>c.value?l.value.find(e=>e.id===s.value.workspace.local_project):l.value.find(e=>h(e.path,p.value)));function h(e,t){let n=e=>String(e||``).replace(/[\\/]+$/,``).toLowerCase();return!!e&&n(e)===n(t)}let g=e=>i.value?r(`update:modelValue`,e):o.write_launch(`workspace`,`cwd`,e),_=e=>c.value?o.write_launch(`workspace`,`local_project`,e?.id||``):g(e.path),v=L(!1);async function y(){if(u.value){v.value=!0;try{if(!i.value)return await o.pick_launch_directory();let e=await o.browse_local_directory();e&&g(e)}catch(e){o.notify(`error`,e.message)}finally{v.value=!1}}else{let e=await w(p.value);e&&g(e)}}let b=L({open:!1,path:``,parent:null,entries:[],next_offset:null,truncated:!1,loading:!1,error:``}),x=null,S=0;sa(()=>{S++,x?.(``)});async function C(e,t=!1){let n=++S;t||Object.assign(b.value,{path:e,parent:e.replace(/[\\/]+[^\\/]+[\\/]*$/,``),entries:[],next_offset:null,truncated:!1}),b.value.loading=!0,b.value.error=``;try{let r=await o.list_remote_directories(e,t?b.value.next_offset:0);if(n!==S)return;b.value={...b.value,...r,entries:t?[...b.value.entries,...r.entries]:r.entries}}catch(r){if(n!==S)return;if(b.value.error=r.message,e&&!t&&!b.value.entries.length)return C(``)}finally{n===S&&(b.value.loading=!1)}}function w(e){return b.value={open:!0,path:``,parent:null,entries:[],next_offset:null,truncated:!1,loading:!1,error:``},C(e||``),new Promise(e=>{x=e})}function T(e){S++,b.value.open=!1,x?.(e),x=null}let E=$(()=>[i.value?[]:[{label:`草稿空间`,description:`不指定项目,为这个房间单独建一个文件夹`,icon:`i-lucide-folder-open`,...m.value?{}:{trailingIcon:`i-lucide-check`},onSelect:()=>g(``)}],l.value.length?[{type:`label`,label:`我的项目`},...l.value.map(e=>({label:e.name,icon:`i-lucide-folder`,...m.value===e?{trailingIcon:`i-lucide-check`}:{},onSelect:()=>g(e.path)}))]:[],[{label:`新建项目…`,icon:`i-lucide-folder-plus`,onSelect:()=>{D.value={open:!0,name:``,saving:!1,error:``}}}]].filter(e=>e.length)),D=L({open:!1,name:``,saving:!1,error:``});async function O(){let e=D.value.name.trim();if(e){Object.assign(D.value,{saving:!0,error:``});try{let t=await o.create_launch_project(e);g(t.path),D.value.open=!1}catch(e){D.value.error=e.message}finally{D.value.saving=!1}}}let k=$(()=>[[{type:`label`,label:c.value?`电脑「${c.value.name}」上的项目`:`常用项目`},...l.value.map(e=>({label:e.name,description:c.value?void 0:o.display_path(e.path),icon:`i-lucide-folder`,...m.value===e?{trailingIcon:`i-lucide-check`}:{},onSelect:()=>_(e)}))],c.value?m.value?[{label:`不指定项目`,icon:`i-lucide-circle-slash`,onSelect:()=>_(null)}]:[]:[{label:`管理项目…`,icon:`i-lucide-settings-2`,onSelect:re}]].filter(e=>e.length)),A=L(!1),j=L([]),M=L(-1),N=L(null),ee=L(!1),te=L(``),P=L(``),ne=L(null);function re(){j.value=l.value.map(e=>({...e})),M.value=-1,N.value=j.value.length?null:{name:``,path:``},P.value=``,A.value=!0}function ie(){M.value=-1,N.value={name:``,path:``},ir(()=>ne.value?.inputRef?.focus())}function ae(e){return String(e).split(/[\\/]+/).filter(Boolean).at(-1)||``}async function oe(e,t){te.value=t,P.value=``;try{let t=u.value?await o.browse_local_directory():await w(e.path);t&&(e.path=t,e.name.trim()||(e.name=ae(t)))}catch(e){P.value=e.message}finally{te.value=``}}let se=e=>!!(e?.name.trim()&&e?.path.trim());function ce(){se(N.value)&&(j.value.push({name:N.value.name.trim(),path:N.value.path.trim()}),N.value=null)}function le(e){j.value.splice(e,1),M.value===e&&(M.value=-1)}async function ue(){se(N.value)&&ce(),ee.value=!0,P.value=``;try{await o.save_launch_projects(j.value),A.value=!1}catch(e){P.value=e.message}finally{ee.value=!1}}return(e,t)=>{let r=Ix,a=qD,s=WD,h=Zx,_=RD,x=LD,S=BD;return G(),K(W,null,[c.value?(G(),K(`div`,ZR,[Y(a,{items:k.value,content:{align:`start`,sideOffset:4},ui:{content:`channel-menu project-menu project-menu-field`},disabled:n.disabled||!l.value.length},{default:z(()=>[J(`button`,{type:`button`,class:F([`project-select`,{"is-empty":!m.value}]),disabled:n.disabled||!l.value.length},[Y(r,{name:m.value?`i-lucide-folder`:`i-lucide-folder-search`,class:`project-select-icon`},null,8,[`name`]),J(`span`,null,I(m.value?m.value.name:l.value.length?`选择项目`:`电脑「${c.value.name}」上还没有项目`),1),Y(r,{name:`i-lucide-chevron-down`,class:`project-select-chevron`})],10,QR)]),_:1},8,[`items`,`disabled`]),c.value.online?Z(``,!0):(G(),K(`p`,$R,[Y(r,{name:`i-lucide-moon`}),X(`电脑「`+I(c.value.name)+`」当前离线,创建请求会等它上线后执行。`,1)]))])):d.value?(G(),K(`div`,ez,[Y(a,{items:E.value,content:{align:`start`,sideOffset:4},ui:{content:`channel-menu project-menu project-menu-field`},disabled:n.disabled},{default:z(()=>[J(`button`,{type:`button`,class:F([`project-select`,{"is-empty":!m.value&&i.value}]),disabled:n.disabled},[Y(r,{name:m.value?`i-lucide-folder`:i.value?`i-lucide-folder-search`:`i-lucide-folder-open`,class:`project-select-icon`},null,8,[`name`]),J(`span`,null,I(m.value?m.value.name:i.value?`选择项目`:`草稿空间`),1),Y(r,{name:`i-lucide-chevron-down`,class:`project-select-chevron`})],10,tz)]),_:1},8,[`items`,`disabled`])])):(G(),K(`div`,{key:2,class:F([`project-box`,{"is-disabled":n.disabled,"is-chosen":m.value}])},[l.value.length?(G(),q(a,{key:0,items:k.value,content:{align:`start`,sideOffset:6},ui:{content:`channel-menu project-menu`},disabled:n.disabled},{default:z(()=>[J(`button`,{type:`button`,class:F([`project-prefix`,{"is-chosen":m.value}]),title:m.value?R(o).display_path(m.value.path):`从常用项目中选择`,"aria-label":`选择常用项目`,disabled:n.disabled},[Y(r,{name:m.value?`i-lucide-folder`:`i-lucide-folders`},null,8,[`name`]),n.compact?Z(``,!0):(G(),K(`span`,rz,I(m.value?m.value.name:`常用项目`),1)),Y(r,{name:`i-lucide-chevron-down`,class:`project-prefix-chevron`})],10,nz)]),_:1},8,[`items`,`disabled`])):(G(),K(`button`,{key:1,type:`button`,class:`project-prefix`,"aria-label":`添加常用项目`,title:`保存常用项目,之后一键选择;其他设备也能用`,disabled:n.disabled,onClick:re},[Y(r,{name:`i-lucide-plus`}),n.compact?Z(``,!0):(G(),K(`span`,az,`常用项目`))],8,iz)),Y(s,{"model-value":p.value,placeholder:n.placeholder,variant:`none`,class:`project-path`,"aria-label":`项目目录完整路径`,disabled:n.disabled,"onUpdate:modelValue":g},null,8,[`model-value`,`placeholder`,`disabled`]),U(e.$slots,`badge`,{},void 0,!0),f.value?(G(),q(h,{key:2,icon:`i-lucide-folder-open`,color:`neutral`,variant:`ghost`,size:`xs`,class:`project-browse`,"aria-label":u.value?`在本机选择项目目录`:`浏览电脑上的文件夹`,title:u.value?v.value?`目录选择窗口已打开,请在本机窗口中选择`:`在本机选择文件夹`:`浏览电脑上常用项目中的文件夹`,loading:v.value,disabled:n.disabled,onClick:y},null,8,[`aria-label`,`title`,`loading`,`disabled`])):Z(``,!0)],2)),Y(x,{content:{onInteractOutside:e=>e.preventDefault()},open:A.value,"onUpdate:open":t[7]||=e=>A.value=e,title:`常用项目`,description:`保存在运行 codiscuss 的这台电脑上。登录同一网站的手机、平板可直接选择,路径不会离开这台电脑。`,ui:{content:`glass-panel studio-modal project-modal`,body:`dialog-body`}},{body:z(()=>[J(`form`,{class:`project-manager dialog-form`,onSubmit:nl(ue,[`prevent`])},[j.value.length?(G(),K(`ul`,oz,[(G(!0),K(W,null,H(j.value,(e,n)=>(G(),K(`li`,{key:n,class:F([`project-row`,{"is-editing":M.value===n}])},[J(`span`,sz,[Y(r,{name:`i-lucide-folder`})]),M.value===n?(G(),K(W,{key:0},[J(`div`,cz,[Y(s,{modelValue:e.name,"onUpdate:modelValue":t=>e.name=t,placeholder:`项目名称`,"aria-label":`项目名称`,size:`sm`,class:`w-full`},null,8,[`modelValue`,`onUpdate:modelValue`]),Y(s,{modelValue:e.path,"onUpdate:modelValue":t=>e.path=t,placeholder:`文件夹完整路径`,"aria-label":`文件夹完整路径`,size:`sm`,class:`w-full`,ui:{trailing:`pe-1`}},xa({_:2},[f.value?{name:`trailing`,fn:z(()=>[Y(h,{icon:`i-lucide-folder-open`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`选择文件夹`,loading:te.value===`row-${n}`,onClick:t=>oe(e,`row-${n}`)},null,8,[`loading`,`onClick`])]),key:`0`}:void 0]),1032,[`modelValue`,`onUpdate:modelValue`])]),Y(h,{icon:`i-lucide-check`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`完成编辑`,disabled:!se(e),onClick:t[0]||=e=>M.value=-1},null,8,[`disabled`])],64)):(G(),K(W,{key:1},[J(`div`,lz,[J(`strong`,null,I(e.name),1),J(`small`,{title:R(o).display_path(e.path)},I(R(o).display_path(e.path)),9,uz)]),J(`div`,dz,[Y(h,{icon:`i-lucide-pencil`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`编辑 ${e.name}`,onClick:e=>{N.value=null,M.value=n}},null,8,[`aria-label`,`onClick`]),Y(h,{icon:`i-lucide-trash-2`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`移除 ${e.name}`,onClick:e=>le(n)},null,8,[`aria-label`,`onClick`])])],64))],2))),128))])):Z(``,!0),N.value?(G(),K(`div`,fz,[Y(_,{label:`文件夹`,description:u.value?``:f.value?`其他设备只能选择已有常用项目中的文件夹;更大的范围请在电脑上添加`:`运行 codiscuss 的电脑上的完整路径`},{default:z(()=>[Y(s,{modelValue:N.value.path,"onUpdate:modelValue":t[2]||=e=>N.value.path=e,placeholder:`例如 D:\\Projects\\demo`,class:`w-full`,ui:{trailing:`pe-1`},onBlur:t[3]||=e=>!N.value.name.trim()&&(N.value.name=ae(N.value.path))},xa({_:2},[f.value?{name:`trailing`,fn:z(()=>[Y(h,{icon:`i-lucide-folder-open`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`选择文件夹`,loading:te.value===`add`,onClick:t[1]||=e=>oe(N.value,`add`)},null,8,[`loading`])]),key:`0`}:void 0]),1032,[`modelValue`])]),_:1},8,[`description`]),Y(_,{label:`名称`},{default:z(()=>[Y(s,{ref_key:`add_name`,ref:ne,modelValue:N.value.name,"onUpdate:modelValue":t[4]||=e=>N.value.name=e,placeholder:`在列表中显示的名称`,maxlength:80,class:`w-full`,onKeydown:rl(nl(ce,[`prevent`]),[`enter`])},null,8,[`modelValue`,`onKeydown`])]),_:1}),J(`div`,pz,[j.value.length?(G(),q(h,{key:0,label:`取消`,color:`neutral`,variant:`ghost`,size:`sm`,onClick:t[5]||=e=>N.value=null})):Z(``,!0),Y(h,{label:`加入列表`,icon:`i-lucide-plus`,color:`neutral`,variant:`soft`,size:`sm`,disabled:!se(N.value),onClick:ce},null,8,[`disabled`])])])):(G(),K(`button`,{key:2,type:`button`,class:`project-add-trigger`,onClick:ie},[Y(r,{name:`i-lucide-plus`}),t[17]||=X(`添加项目`,-1)])),P.value?(G(),K(`p`,mz,[Y(r,{name:`i-lucide-circle-alert`}),X(I(P.value),1)])):Z(``,!0),J(`div`,hz,[Y(h,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:t[6]||=e=>A.value=!1}),Y(h,{type:`submit`,label:`保存`,class:`channel-primary-button`,loading:ee.value},null,8,[`loading`])])],32)]),_:1},8,[`content`,`open`]),Y(x,{open:D.value.open,"onUpdate:open":t[10]||=e=>D.value.open=e,title:`新建项目`,description:`在你的项目文件夹里新建一个文件夹,房间成员在其中读写文件。`,ui:{content:`glass-panel studio-modal project-modal`,body:`dialog-body`}},{body:z(()=>[J(`form`,{class:`project-manager dialog-form`,onSubmit:nl(O,[`prevent`])},[Y(_,{label:`名称`},{default:z(()=>[Y(s,{modelValue:D.value.name,"onUpdate:modelValue":t[8]||=e=>D.value.name=e,placeholder:`例如 新品方案`,maxlength:80,autofocus:``,class:`w-full`},null,8,[`modelValue`])]),_:1}),D.value.error?(G(),K(`p`,gz,[Y(r,{name:`i-lucide-circle-alert`}),X(I(D.value.error),1)])):Z(``,!0),J(`div`,_z,[Y(h,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:t[9]||=e=>D.value.open=!1}),Y(h,{type:`submit`,label:`新建`,class:`channel-primary-button`,loading:D.value.saving,disabled:!D.value.name.trim()},null,8,[`loading`,`disabled`])])],32)]),_:1},8,[`open`]),Y(x,{open:b.value.open,title:`选择电脑上的文件夹`,description:`只列出常用项目中的文件夹;范围由电脑决定。`,ui:{content:`glass-panel studio-modal project-modal`,body:`dialog-body`},"onUpdate:open":t[16]||=e=>!e&&T(``)},{body:z(()=>[J(`div`,vz,[J(`div`,yz,[Y(h,{icon:`i-lucide-arrow-left`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`上一级`,disabled:!b.value.path||b.value.loading,onClick:t[11]||=e=>C(b.value.parent||``)},null,8,[`disabled`]),J(`span`,{class:`folder-path`,title:R(o).display_path(b.value.path)},I(R(o).display_path(b.value.path)||`常用项目`),9,bz)]),J(`ul`,{class:`folder-list`,"aria-label":`文件夹`,"aria-busy":b.value.loading},[b.value.loading&&!b.value.entries.length?(G(),K(W,{key:0},H(5,e=>J(`li`,{key:`loading-${e}`,class:`folder-entry`,"aria-hidden":`true`},[Y(S,{class:`h-4 w-4 shrink-0`}),Y(S,{class:`h-4 w-2/3`})])),64)):Z(``,!0),(G(!0),K(W,null,H(b.value.entries,e=>(G(),K(`li`,{key:e.path},[J(`button`,{type:`button`,class:`folder-entry`,disabled:b.value.loading,onClick:t=>C(e.path)},[Y(r,{name:`i-lucide-folder`}),X(I(e.name),1)],8,Sz)]))),128)),!b.value.entries.length&&!b.value.loading&&!b.value.error?(G(),K(`li`,Cz,I(b.value.path?`没有子文件夹`:`电脑上还没有常用项目,请先在电脑上添加`),1)):Z(``,!0)],8,xz),b.value.next_offset===null?Z(``,!0):(G(),q(h,{key:0,label:`加载更多`,color:`neutral`,variant:`ghost`,loading:b.value.loading,onClick:t[12]||=e=>C(b.value.path,!0)},null,8,[`loading`])),b.value.truncated?(G(),K(`p`,wz,`文件夹过多,只列出了一部分`)):Z(``,!0),b.value.error?(G(),K(`p`,Tz,[Y(r,{name:`i-lucide-circle-alert`}),X(I(b.value.error),1),Y(h,{label:`重试`,color:`neutral`,variant:`link`,size:`xs`,onClick:t[13]||=e=>C(b.value.path)})])):Z(``,!0),J(`div`,Ez,[Y(h,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:t[14]||=e=>T(``)}),Y(h,{label:`选择此文件夹`,class:`channel-primary-button`,disabled:!b.value.path||b.value.loading,onClick:t[15]||=e=>T(b.value.path)},null,8,[`disabled`])])])]),_:1},8,[`open`])],64)}}},[[`__scopeId`,`data-v-0c169fd0`]]),Oz={class:`extra-directories`},kz=[`disabled`],Az={key:2,class:`extra-directory-note`},jz=8,Mz=rO({__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}=Dr(`discussion`),a=$(()=>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=Zx,i=Ix;return G(),K(`div`,Oz,[a.value?(G(!0),K(W,{key:0},H(n.modelValue,(e,t)=>(G(),K(`div`,{key:t,class:`extra-directory`},[Y(Dz,{"model-value":e,compact:``,placeholder:`另一个项目目录的完整路径`,disabled:n.disabled,"onUpdate:modelValue":e=>o(t,e)},null,8,[`model-value`,`disabled`,`onUpdate:modelValue`]),Y(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)):Z(``,!0),(G(!0),K(W,null,H(a.value?[]:n.modelValue,e=>(G(),K(`code`,{key:e,class:`extra-directory-path`},I(e),1))),128)),a.value&&n.modelValue.length<jz?(G(),K(`button`,{key:1,type:`button`,class:`extra-directory-add`,disabled:n.disabled,onClick:c},[Y(i,{name:`i-lucide-plus`}),t[0]||=X(`添加其他项目目录 `,-1)],8,kz)):Z(``,!0),a.value?Z(``,!0):(G(),K(`p`,Az,`其他项目目录须在电脑上或已连接电脑的网页中设置。`))])}}},[[`__scopeId`,`data-v-df191134`]]),Nz=[`aria-label`],Pz={class:`roster-add-label`},Fz={class:`roster-add-chips`},Iz=[`disabled`,`title`,`aria-label`,`aria-pressed`,`onClick`],Lz={class:`roster-add-name`},Rz=[`title`,`aria-label`,`onClick`],zz=[`aria-pressed`],Bz=rO({__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=L(null),o=L(!1),s=$(()=>{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=Bx,c=Ix;return G(),K(`div`,{ref_key:`row`,ref:a,class:`roster-add`,role:`group`,"aria-label":e.label},[(G(!0),K(W,null,H(s.value,e=>(G(),K(W,{key:e.label},[J(`span`,Pz,I(e.label),1),J(`div`,Fz,[(G(!0),K(W,null,H(e.items,e=>(G(),K(`span`,{key:e.value,class:F([`roster-add-chip`,{"is-selected":e.selected,"is-disabled":e.disabled,"is-removable":o.value&&e.removable}])},[J(`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)},[Y(r,{src:e.icon,text:e.initials,alt:e.name,size:`3xs`,class:F([`channel-avatar`,e.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`span`,Lz,I(e.name),1),Y(c,{name:e.selected?`i-lucide-check`:`i-lucide-plus`,class:`roster-add-mark`},null,8,[`name`])],8,Iz),o.value&&e.removable?(G(),K(`button`,{key:0,type:`button`,class:`roster-add-remove`,title:`删除预设「${e.name}」`,"aria-label":`删除预设 ${e.name}`,onClick:t=>i(`remove`,e.value)},[Y(c,{name:`i-lucide-x`})],8,Rz)):Z(``,!0)],2))),128)),e.items.some(e=>e.removable)?(G(),K(`button`,{key:0,type:`button`,class:`roster-add-manage`,"aria-pressed":o.value,onClick:n[0]||=e=>o.value=!o.value},I(o.value?`完成`:`管理`),9,zz)):Z(``,!0)])],64))),128))],8,Nz)}}},[[`__scopeId`,`data-v-a9be499f`]]),Vz={key:0,class:`scheduler-row`},Hz=[`title`],Uz={key:0,"aria-hidden":`true`},Wz={key:1},Gz={class:`scheduler-title`},Kz={class:`scheduler-description`},qz={key:3,class:`scheduler-empty`},Jz={key:4,class:`scheduler-cards`},Yz={class:`scheduler-slot`},Xz={class:`scheduler-identity`},Zz={class:`scheduler-facts`},Qz=[`title`],$z={class:`scheduler-flip`},eB={class:`scheduler-tools`},tB=[`aria-label`],nB={class:`scheduler-back`},rB={class:`scheduler-heading`},iB={class:`scheduler-field`},aB={class:`scheduler-field`},oB={class:`scheduler-flip-actions`},sB={key:5,class:`scheduler-mode`},cB={class:`expert-card-modes`,role:`radiogroup`,"aria-label":`智能调度判断方式`},lB=[`title`,`aria-checked`,`onClick`],uB=`••••••••••••`,dB=rO({__name:`SchedulerSettings`,props:{free:{type:Boolean,default:!1},blocker:{type:String,default:``},room:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(e){let t=e,{view:n,bridge:r}=Dr(`discussion`),i=$(()=>{let e=n.value.launch.room_models?.scheduler;if(!e)return{enabled:!1};let t=n.value.launch.scheduler_providers?.[e.provider]?.base_url;return{enabled:!0,...e,api_key_ref:n.value.launch.api_keys?.[t]||``}}),a=L(null),o=$(()=>t.room?a.value||i.value:n.value.launch.scheduler||{});async function s(e){if(!t.room){for(let[t,n]of Object.entries(e))r.write_scheduler(t,n);return}let s={...o.value,...e};if(`provider`in e||e.enabled&&!s.provider){let e=n.value.launch.scheduler_providers||{};s.provider||=Object.keys(e).find(t=>n.value.launch.api_keys?.[e[t].base_url])||Object.keys(e)[0]||``;let t=e[s.provider];s.model=t?.models[0]||``,s.api_key_ref=t&&n.value.launch.api_keys?.[t.base_url]||``,s.mode||=n.value.launch.scheduler_default_mode||``}if(s.enabled&&!(s.provider&&s.model&&s.api_key_ref))a.value=s;else{a.value=s;try{(s.enabled||i.value.enabled)&&await r.set_room_scheduler(s.enabled?s:null)}catch(e){r.notify(`error`,e.message)}finally{a.value===s&&(a.value=null)}}}let c=$(()=>Object.entries(n.value.launch.scheduler_providers||{}).map(([e,t])=>({value:e,label:t.label}))),l=$(()=>(n.value.launch.scheduler_providers?.[o.value.provider]?.models||[]).map(e=>({label:e,value:e}))),u={jev:{icon:`/icons/typesafe.png`},decisions:{icon:`/icons/openai.svg`,style:`codex`}},d=$(()=>!!o.value.enabled&&!t.blocker),f=L(null),p=$(()=>c.value.map(({value:e,label:n})=>{let r=d.value&&o.value.provider===e;return{value:e,name:n,initials:n.slice(0,2),...u[e],disabled:!!t.blocker,selected:r,title:r?`当前决策模型`:d.value?`替换为 ${n}`:n,aria_label:d.value&&!r?`替换决策模型为 ${n}`:`添加决策模型 ${n}`}})),m=L(``),h=L(!1),g=L(!1),_=L(!1),v=null;function y(){v={...o.value},_.value=!0}function b(){v=null,_.value=!1,t.room&&(a.value=null)}function x(){let e=v;if(v=null,m.value=``,_.value=!1,!e)return;if(!t.room){s({model:e.model,api_key_ref:e.api_key_ref});return}a.value=null;let n=i.value;if([`enabled`,`provider`,`model`,`mode`].some(t=>(e[t]||``)!==(n[t]||``))){let t=e.enabled&&e.provider&&e.model&&e.api_key_ref;r.set_room_scheduler(t?e:null).catch(e=>r.notify(`error`,e.message))}}function S(e){d.value&&o.value.provider===e||(_.value=!1,v=null,s({provider:e,enabled:!0}),t.compact&&y())}function C(){s({enabled:!1}),ir(()=>f.value?.focus_first())}async function w(e){await s({enabled:e}),e&&D.value.tone!==`ready`&&y()}let T=$(()=>d.value?D.value.tone===`ready`?[E.value,o.value.model,n.value.launch.scheduler_modes?.[j.value]].filter(Boolean).join(` · `):`${E.value} · ${D.value.text}`:[`未开启`,c.value.map(e=>e.label).join(`、`)].filter(Boolean).join(` · 可用 `)),E=$(()=>c.value.find(e=>e.value===o.value.provider)?.label||`未选择`),D=$(()=>o.value.model?o.value.api_key_ref?{tone:`ready`,text:`已配置`}:{tone:`warn`,text:`缺少密钥`}:{tone:`warn`,text:`未选模型`});B(()=>o.value.provider,()=>{m.value=``});let O=L({state:``});B(()=>[o.value.provider,o.value.model,o.value.api_key_ref],()=>{O.value={state:``}}),B(()=>o.value.enabled,e=>{e||(_.value=!1)});async function k(){O.value={state:`loading`};try{await r.check_scheduler(o.value),O.value={state:`ok`},r.notify(`info`,`检查通过:决策模型已响应`)}catch(e){O.value={state:`error`},r.notify(`error`,e.message)}}let A=$(()=>Object.entries(n.value.launch.scheduler_modes||{}).map(([e,t])=>({value:e,label:t}))),j=$(()=>o.value.mode||n.value.launch.scheduler_default_mode||``),M={guided:`试验:说明目的与依据,由模型权衡;正在打磨,可能判错`,stable:`稳定:按固定顺序逐条核对,已通过回归评测`},N=$(()=>t.free?`接入决策模型,推荐更适合回答的成员,由你一键采纳。`:`接入决策模型,自动安排插话回应与下一轮发言。`);async function ee(){if(m.value.trim()&&!g.value){g.value=!0;try{let e=await r.save_scheduler_api_key(m.value,o.value.provider);t.room&&await s({api_key_ref:e})}catch(e){r.notify(`error`,e.message)}finally{g.value=!1}}}return(t,r)=>{let i=nO,a=Zx,c=VD,v=Bx,te=Ix,P=xL,ne=WD;return G(),K(`div`,{class:F([`scheduler-settings`,{"is-compact":e.compact}])},[e.compact?(G(),K(`div`,Vz,[Y(i,{"model-value":d.value,disabled:e.disabled||!!e.blocker,label:`开启`,"aria-label":`本房间开启智能调度`,"onUpdate:modelValue":w},null,8,[`model-value`,`disabled`]),J(`span`,{class:F([`scheduler-summary`,d.value&&`is-${D.value.tone}`]),title:T.value},[d.value?(G(),K(`i`,Uz)):Z(``,!0),X(I(T.value),1)],10,Hz),d.value&&!e.disabled?(G(),q(a,{key:0,icon:_.value?`i-lucide-chevron-up`:`i-lucide-settings-2`,label:_.value?`收起`:`设置`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-expanded":_.value,"aria-label":`设置本房间的决策模型`,onClick:r[0]||=e=>_.value?b():y()},null,8,[`icon`,`label`,`aria-expanded`])):Z(``,!0)])):(G(),K(`div`,Wz,[J(`p`,Gz,[r[5]||=X(`智能调度`,-1),Y(c,{size:`xs`,variant:`soft`,class:`scheduler-badge`},{default:z(()=>[...r[4]||=[X(`决策模型`,-1)]]),_:1}),r[6]||=J(`small`,null,`可选`,-1)]),J(`p`,Kz,I(e.blocker?`${N.value}(${e.blocker})`:N.value),1)])),!e.compact||_.value?(G(),q(Bz,{key:2,ref_key:`add_row`,ref:f,label:`添加决策模型`,items:p.value,onAdd:S},null,8,[`items`])):Z(``,!0),!d.value&&!e.compact?(G(),K(`p`,qz,`未添加决策模型。只能放一个,点其他供应商会替换。`)):d.value&&(!e.compact||_.value)?(G(),K(`div`,Jz,[J(`div`,Yz,[J(`div`,{class:F([`scheduler-card`,{"is-editing":_.value}])},[_.value?(G(),K(W,{key:1},[J(`div`,nB,[J(`div`,rB,[J(`strong`,null,[X(I(E.value),1),r[11]||=J(`span`,null,`设置`,-1)]),Y(a,{icon:`i-lucide-zap`,"aria-label":`检查智能调度配置`,title:`检查配置:向决策模型发送一道极短的是非题,核对供应商、模型与密钥`,size:`xs`,variant:`ghost`,color:O.value.state===`ok`?`success`:O.value.state===`error`?`error`:`neutral`,loading:O.value.state===`loading`,disabled:!o.value.api_key_ref||!o.value.model||!R(n).launch.available,onClick:k},null,8,[`color`,`loading`,`disabled`])]),J(`div`,iB,[r[12]||=J(`span`,null,`模型`,-1),Y(P,{mode:`autocomplete`,"ignore-filter":``,"model-value":o.value.model||``,items:l.value,"value-key":`value`,"aria-label":`智能调度模型`,placeholder:`模型 ID`,size:`xs`,class:`w-full`,"onUpdate:modelValue":r[1]||=e=>s({model:e})},null,8,[`model-value`,`items`])]),J(`div`,aB,[r[13]||=J(`span`,null,`密钥`,-1),Y(ne,{modelValue:m.value,"onUpdate:modelValue":r[3]||=e=>m.value=e,type:`text`,autocomplete:`off`,spellcheck:`false`,"data-1p-ignore":``,"data-lpignore":`true`,placeholder:o.value.api_key_ref?uB:`填写所选供应商的 API Key`,title:o.value.api_key_ref&&!m.value?`已保存;本机不回传密钥,输入新 Key 可更换`:void 0,"aria-label":`智能调度 API Key`,size:`xs`,class:`w-full`,loading:g.value,ui:{base:h.value?``:`scheduler-key-masked`,trailing:`pe-0.5`},onChange:ee},{trailing:z(()=>[Y(a,{icon:h.value?`i-lucide-eye`:`i-lucide-eye-off`,disabled:!m.value,"aria-label":h.value?`隐藏密钥`:`显示密钥`,"aria-pressed":h.value,size:`xs`,color:`neutral`,variant:`link`,onClick:r[2]||=e=>h.value=!h.value},null,8,[`icon`,`disabled`,`aria-label`,`aria-pressed`])]),_:1},8,[`modelValue`,`placeholder`,`title`,`loading`,`ui`])]),r[14]||=J(`p`,{class:`scheduler-note`},`决策模型只做选择、不生成文本,只按输入计费。判断时会把房间标题和最近 10~20 条消息发给所选供应商;密钥只存本机。`,-1)]),J(`span`,oB,[J(`button`,{type:`button`,class:`scheduler-flip is-cancel`,"aria-label":`放弃决策模型的修改`,onClick:x},`取消`),J(`button`,{type:`button`,class:`scheduler-flip is-done`,"aria-label":`完成并返回决策模型卡片`,onClick:b},[Y(te,{name:`i-lucide-check`}),r[15]||=X(`完成`,-1)])])],64)):(G(),K(W,{key:0},[J(`button`,{type:`button`,class:`scheduler-open`,"aria-label":`设置智能调度的决策模型`,title:`点击设置`,onClick:y},[J(`span`,Xz,[Y(v,{src:u[o.value.provider]?.icon,text:E.value.slice(0,2),alt:E.value,size:`sm`,class:F([`channel-avatar scheduler-avatar`,u[o.value.provider]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`strong`,null,I(E.value),1)]),J(`dl`,Zz,[J(`div`,null,[r[8]||=J(`dt`,null,`状态`,-1),J(`dd`,{class:F(`is-${D.value.tone}`)},[r[7]||=J(`i`,{"aria-hidden":`true`},null,-1),X(I(D.value.text),1)],2)]),J(`div`,null,[r[9]||=J(`dt`,null,`模型`,-1),J(`dd`,{title:o.value.model},I(o.value.model||`未选择`),9,Qz)])]),J(`span`,$z,[Y(te,{name:`i-lucide-settings-2`}),r[10]||=X(`设置`,-1)])]),J(`span`,eB,[J(`button`,{type:`button`,"aria-label":`移出决策模型 ${E.value}`,title:`移出`,onClick:C},[Y(te,{name:`i-lucide-x`})],8,tB)])],64))],2)])])):Z(``,!0),d.value&&e.free&&A.value.length>1&&(!e.compact||_.value)?(G(),K(`div`,sB,[r[16]||=J(`span`,null,`判断方式`,-1),J(`div`,cB,[(G(!0),K(W,null,H(A.value,e=>(G(),K(`button`,{key:e.value,type:`button`,role:`radio`,title:M[e.value],"aria-checked":j.value===e.value,onClick:t=>s({mode:e.value})},I(e.label),9,lB))),128))])])):Z(``,!0)],2)}}},[[`__scopeId`,`data-v-6132886e`]]),fB={key:0,class:`image-row`},pB=[`title`],mB={key:0,"aria-hidden":`true`},hB={key:1},gB={class:`image-title`},_B={key:3,class:`image-empty`},vB={key:4,class:`image-cards`},yB={class:`image-slot`},bB=[`disabled`],xB={class:`image-identity`},SB={class:`image-facts`},CB=[`title`],wB={class:`image-flip`},TB={key:0,class:`image-tools`},EB=[`aria-label`],DB={class:`image-back`},OB={class:`image-field`},kB={class:`image-field`},AB={class:`image-field`},jB={class:`image-flip-actions`},MB=`OpenAI Images`,NB=`••••••••••••`,PB=rO({__name:`ImageService`,props:{enabled:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},emits:[`update:enabled`],setup(e,{emit:t}){let n=e,r=t,{bridge:i}=Dr(`discussion`),a=tn({base_url:``,model:``,api_key_ref:``,configured:!1,catalog:[]}),o=L(``),s=L(null),c=$(()=>[{value:`openai`,name:MB,initials:`OI`,icon:`/icons/openai.svg`,style:`codex`,disabled:n.disabled||!!o.value,selected:n.enabled,title:o.value?`需连接本机服务:${o.value}`:n.enabled?`已添加`:MB,aria_label:`添加生图服务 ${MB}`}]),l=$(()=>a.catalog.map(e=>({value:e,label:e}))),u=$(()=>a.model?a.api_key_ref?{tone:`ready`,text:`已配置`}:{tone:`warn`,text:`缺少密钥`}:{tone:`warn`,text:`未选模型`}),d=L(!1),f=L(``),p=L(!1),m=L(!1),h=L(``),g=null;ia(async()=>{try{Object.assign(a,await i.local_request(`image-settings`,{})),h.value=a.base_url}catch(e){o.value=e.message}});async function _(){let{base_url:e,model:t,api_key_ref:n}=a;try{Object.assign(a,await i.local_request(`image-settings`,{base_url:e,model:t,api_key_ref:n}))}catch(e){i.notify(`error`,e.message)}}function v(){g={base_url:a.base_url,model:a.model,api_key_ref:a.api_key_ref},h.value=a.base_url,d.value=!0}async function y(){g&&[`base_url`,`model`,`api_key_ref`].some(e=>g[e]!==a[e])&&(Object.assign(a,g),await _()),g=null,f.value=``,d.value=!1}function b(){let e=h.value.trim();e&&e!==a.base_url&&(a.base_url=e,a.api_key_ref=``,_())}function x(e){a.model=String(e||``).trim(),a.model&&_()}async function S(){let e=f.value.trim();if(e&&!m.value){m.value=!0;try{a.api_key_ref=(await i.local_request(`api-key`,{base_url:a.base_url,api_key:e})).api_key_ref,await _()}catch(e){i.notify(`error`,e.message)}finally{m.value=!1}}}function C(){n.enabled||r(`update:enabled`,!0)}function w(e){r(`update:enabled`,e),e&&u.value.tone!==`ready`&&v(),e||(d.value=!1)}let T=$(()=>n.enabled?u.value.tone===`ready`?`${MB} · ${a.model}`:`${MB} · ${u.value.text}`:o.value?`未开启 · 需连接本机服务`:`未开启 · 可用 ${MB}`);function E(){d.value=!1,r(`update:enabled`,!1),ir(()=>s.value?.focus_first())}return(t,n)=>{let r=nO,i=Zx,g=VD,_=Bx,D=Ix,O=WD,k=xL;return G(),K(`div`,{class:F([`image-service`,{"is-compact":e.compact}])},[e.compact?(G(),K(`div`,fB,[Y(r,{"model-value":e.enabled,disabled:e.disabled||!!o.value,label:`开启`,"aria-label":`本房间开启生图`,title:o.value?`需连接本机服务:${o.value}`:void 0,"onUpdate:modelValue":w},null,8,[`model-value`,`disabled`,`title`]),J(`span`,{class:F([`image-summary`,e.enabled&&`is-${u.value.tone}`]),title:T.value},[e.enabled?(G(),K(`i`,mB)):Z(``,!0),X(I(T.value),1)],10,pB),e.enabled&&!e.disabled&&!o.value?(G(),q(i,{key:0,icon:d.value?`i-lucide-chevron-up`:`i-lucide-settings-2`,label:d.value?`收起`:`设置`,size:`xs`,color:`neutral`,variant:`ghost`,"aria-expanded":d.value,"aria-label":`设置生图服务`,onClick:n[0]||=e=>d.value?d.value=!1:v()},null,8,[`icon`,`label`,`aria-expanded`])):Z(``,!0)])):(G(),K(`div`,hB,[J(`p`,gB,[n[6]||=X(`生图`,-1),Y(g,{size:`xs`,variant:`soft`,class:`image-badge`},{default:z(()=>[...n[5]||=[X(`图片模型`,-1)]]),_:1}),n[7]||=J(`small`,null,`可选`,-1)]),n[8]||=J(`p`,{class:`image-description`},`接入图片模型,房间里的成员都能按需出图、改图,图片随回答发出;按张计费。`,-1)])),e.compact?Z(``,!0):(G(),q(Bz,{key:2,ref_key:`add_row`,ref:s,label:`添加生图服务`,items:c.value,onAdd:C},null,8,[`items`])),!e.enabled&&!e.compact?(G(),K(`p`,_B,`未添加。房间里的成员不能画图。`)):e.enabled&&(!e.compact||d.value)?(G(),K(`div`,vB,[J(`div`,yB,[J(`div`,{class:F([`image-card`,{"is-editing":d.value}])},[d.value?(G(),K(W,{key:1},[J(`div`,DB,[J(`div`,{class:`image-heading`},[J(`strong`,null,[X(I(MB)),n[13]||=J(`span`,null,`设置`,-1)])]),J(`div`,OB,[n[14]||=J(`span`,null,`地址`,-1),Y(O,{modelValue:h.value,"onUpdate:modelValue":n[1]||=e=>h.value=e,"aria-label":`图片接口 Base URL`,placeholder:`https://api.openai.com/v1`,size:`xs`,class:`w-full`,onChange:b},null,8,[`modelValue`])]),J(`div`,kB,[n[15]||=J(`span`,null,`密钥`,-1),Y(O,{modelValue:f.value,"onUpdate:modelValue":n[3]||=e=>f.value=e,type:`text`,autocomplete:`off`,spellcheck:`false`,"data-1p-ignore":``,"data-lpignore":`true`,placeholder:a.api_key_ref?NB:`填写图片接口的 API Key`,title:a.api_key_ref&&!f.value?`已保存;本机不回传密钥,输入新 Key 可更换`:void 0,"aria-label":`生图 API Key`,size:`xs`,class:`w-full`,loading:m.value,ui:{base:p.value?``:`image-key-masked`,trailing:`pe-0.5`},onChange:S},{trailing:z(()=>[Y(i,{icon:p.value?`i-lucide-eye`:`i-lucide-eye-off`,disabled:!f.value,"aria-label":p.value?`隐藏密钥`:`显示密钥`,"aria-pressed":p.value,size:`xs`,color:`neutral`,variant:`link`,onClick:n[2]||=e=>p.value=!p.value},null,8,[`icon`,`disabled`,`aria-label`,`aria-pressed`])]),_:1},8,[`modelValue`,`placeholder`,`title`,`loading`,`ui`])]),J(`div`,AB,[n[16]||=J(`span`,null,`模型`,-1),Y(k,{mode:`autocomplete`,"ignore-filter":``,"model-value":a.model,items:l.value,"value-key":`value`,"aria-label":`图片模型 ID`,placeholder:`选择或填写图片模型`,size:`xs`,class:`w-full min-w-0`,"onUpdate:modelValue":x},null,8,[`model-value`,`items`])]),n[17]||=J(`p`,{class:`image-note`},`地址、密钥和模型存在这台电脑,所有房间共用;每张图按所配账号计费。`,-1)]),J(`span`,jB,[J(`button`,{type:`button`,class:`image-flip is-cancel`,"aria-label":`放弃生图服务的修改`,onClick:y},`取消`),J(`button`,{type:`button`,class:`image-flip is-done`,"aria-label":`完成并返回生图服务卡片`,onClick:n[4]||=e=>d.value=!1},[Y(D,{name:`i-lucide-check`}),n[18]||=X(`完成`,-1)])])],64)):(G(),K(W,{key:0},[J(`button`,{type:`button`,class:`image-open`,"aria-label":`设置生图服务`,title:`点击设置`,disabled:e.disabled,onClick:v},[J(`span`,xB,[Y(_,{src:`/icons/openai.svg`,text:`OI`,alt:MB,size:`sm`,class:`channel-avatar image-avatar codex`}),J(`strong`,null,I(MB))]),J(`dl`,SB,[J(`div`,null,[n[10]||=J(`dt`,null,`状态`,-1),J(`dd`,{class:F(`is-${u.value.tone}`)},[n[9]||=J(`i`,{"aria-hidden":`true`},null,-1),X(I(u.value.text),1)],2)]),J(`div`,null,[n[11]||=J(`dt`,null,`模型`,-1),J(`dd`,{title:a.model},I(a.model||`未选择`),9,CB)])]),J(`span`,wB,[Y(D,{name:`i-lucide-settings-2`}),n[12]||=X(`设置`,-1)])],8,bB),e.disabled?Z(``,!0):(G(),K(`span`,TB,[J(`button`,{type:`button`,"aria-label":`移出生图服务 ${MB}`,title:`移出`,onClick:E},[Y(D,{name:`i-lucide-x`})],8,EB)]))],64))],2)])])):Z(``,!0)],2)}}},[[`__scopeId`,`data-v-30eea07f`]]),FB={__name:`HostWorkflowSwitch`,props:{modelValue:Boolean,disabled:Boolean},emits:[`update:modelValue`],setup(e,{emit:t}){let n=t;return(t,r)=>{let i=nO;return G(),q(i,{"model-value":e.modelValue,disabled:e.disabled,label:`主持人完整权限`,"aria-label":`主持人完整权限`,description:`主持人可自行处理问题、持续推进:打断、插话、重试成员,换模型,邀请、移除成员,调整发言顺序,开启讨论与 Goal,保存并启用工作流;成员项目权限最高可写。`,"onUpdate:modelValue":r[0]||=e=>n(`update:modelValue`,e)},null,8,[`model-value`,`disabled`])}}},IB={class:`create-discussion`},LB={key:0,class:`create-connect`,role:`status`},RB={class:`create-connect-command`},zB={key:1,class:`channel-create-location`},BB={class:`create-section`},VB={class:`create-section`},HB={key:0,class:`create-experts`,role:`group`,"aria-label":`参与的 AI`},UB={key:1,class:`create-experts-empty`},WB={key:2,class:`fine-print create-hint create-host-hint`},GB={class:`create-section`},KB={class:`create-drive`},qB={class:`expert-card-modes`,role:`radiogroup`,"aria-label":`创建后的推进方式`},JB=[`aria-checked`,`onClick`],YB={class:`fine-print create-drive-hint`},XB=[`open`],ZB={class:`create-footer`},QB={class:`create-footer-row`},$B=[`title`],eV=`new-expert-modes`,tV=3e3,nV=`preset:`,rV=rO({__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}=Dr(`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=$(()=>!!r.value.create_discussion),f=$(()=>r.value.create_goal),p=$(()=>d.value||!!f.value),m=L(null),h=$(()=>r.value.experts[eV]||{}),g=L([]),_=$(()=>Object.keys(h.value).filter(e=>h.value[e]));B(_,e=>{g.value=[...g.value.filter(t=>e.includes(t)),...e.filter(e=>!g.value.includes(e))]},{immediate:!0});let v=$(()=>[..._.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=L(null),x=$(()=>l(`host`)),S=$(()=>v.value.filter(e=>!p.value||h.value[e]!==`manual`)),C=L(null),w=$(()=>v.value.filter(e=>h.value[e]===`cli`)),T=$(()=>w.value.length>0||N.value||O.value),E=$(()=>r.value.launch.available?null:r.value.launch.relay),D=$(()=>r.value.launch.available||!!E.value),O=$(()=>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=$(()=>T.value&&D.value),j=$(()=>v.value.length>0&&w.value.every(k)&&(!w.value.length||D.value)),M=$(()=>r.value.launch.available),N=$(()=>M.value&&!!r.value.launch.scheduler?.enabled),ee=$(()=>r.value.launch.available?``:`连接本机服务后可开启`),te=$(()=>{let e=r.value.launch.scheduler||{};return M.value&&e.enabled&&!(e.provider&&e.model&&e.api_key_ref)}),P=$(()=>T.value&&!D.value),ne=0,re=$(()=>{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(P.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(`、`)} 的接入配置`:te.value?`补齐决策模型配置,或移出决策模型`:``}),ie=$(()=>!j.value||!!re.value||te.value||a.value===`create`);function ae(){S.value.includes(x.value)||u(`host`,S.value[0]||``)}ia(()=>{ae(),ne=window.setInterval(()=>{P.value&&!document.hidden&&o(`check_launch_connection`)},tV)}),sa(()=>window.clearInterval(ne));let oe=[{value:`free`,label:`不开启`},{value:`discussion`,label:`开启讨论`},{value:`goal`,label:`开启 Goal`}],se={free:`成员被点名时工作,做完就停下等你。讨论和 Goal 都可以建房后再开启。`,discussion:`主持人安排成员轮流发言,到上限或结束时停止。`,goal:`主持人持续推进一个目标,房间空闲时自动接着做,直到完成、卡住或你结束。`},ce=$(()=>d.value?`discussion`:f.value?`goal`:`free`);function le(e){e===`goal`?i.write_create_goal({}):e===`discussion`?i.write_create_discussion(!0):(i.write_create_discussion(!1),i.write_create_goal(null)),ir(ae)}let ue=e=>i.launch_clients[e]?.some(e=>e.value!==`api`),de=e=>p.value&&e===x.value?[]:[`cli`,`manual`];function fe(e,t){i.write_expert(eV,e,t),ae()}function pe(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 me(e){return y(e)?`已加入 ${y(e)} 位 · 可继续添加`:ue(e)?`API / 本地 App / CLI / 手动启动`:`API / 手动启动`}let he=$(()=>[...s.map(e=>({value:e,name:i.default_name(e),...i.identities[e],disabled:!i.launch_clients[e],title:me(e),aria_label:`添加 ${e} 实例`})),...r.value&&i.expert_presets().map((e,t)=>({value:nV+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 ge(e){if(e.startsWith(nV)){let t=i.expert_presets().find(t=>t.name===e.slice(7));return t&&i.add_preset(eV,t,`cli`),ae()}i.launch_clients[e]&&(i.default_launch_entry(e),y(e)?i.add_instance(eV,e,`cli`):fe(e,`cli`),ae())}function _e(e){fe(e,``),ir(()=>b.value?.focus_first())}function ve(){ie.value||(C.value?.settle(),m.value?.settle(),n(`submit`))}let ye=$(()=>{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)?dO(Number(n)):`不限时长`].join(` / `))}return f.value&&t.push(`开启 Goal`),t.join(` · `)});return(t,s)=>{let c=Ix,g=Zx,_=WD,y=RD,w=zD,O=va(`keep-reading`);return G(),K(`div`,IB,[wr((G(),K(`form`,{id:`create-discussion-form`,class:`create-scroll dialog-form`,onSubmit:nl(ve,[`prevent`])},[P.value?(G(),K(`div`,LB,[J(`p`,null,[Y(c,{name:`i-lucide-plug-zap`}),s[17]||=X(`本机服务未连接,连接后才能唤醒本机 AI。在运行 AI 的电脑上执行下面的命令并完成网页授权,连上后自动检测。`,-1)]),J(`div`,RB,[J(`code`,null,I(R(r).launch.connect_command),1),Y(g,{icon:`i-lucide-copy`,"aria-label":`复制本机连接命令`,variant:`ghost`,color:`neutral`,onClick:s[0]||=e=>R(o)(`copy`,R(r).launch.connect_command)})])])):Z(``,!0),e.targetFolder?.id?(G(),K(`p`,zB,[Y(c,{name:`i-lucide-folder`}),X(I(e.targetFolder.name),1)])):Z(``,!0),J(`section`,BB,[s[18]||=J(`h3`,null,[J(`span`,null,`1`),X(`这次做什么`)],-1),Y(y,{label:`话题名称`,required:``},{default:z(()=>[Y(_,{"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}),Y(y,{label:`项目目录(可选)`,description:R(r).launch.available?`本机唤醒的成员在此目录读写文件;不选则使用草稿空间,为这个房间单独建一个文件夹。`:E.value?`由电脑「${E.value.name}」唤醒的成员在所选项目中读写文件;不选则各用软件默认目录。`:`连接本机服务后可指定:本机唤醒的成员将在此目录读写文件。`},{default:z(()=>[Y(Dz,{disabled:!D.value},null,8,[`disabled`]),R(r).launch.available&&R(r).launch.workspace.cwd?(G(),q(Mz,{key:0,class:`create-extra-directories`,"model-value":R(r).launch.workspace.extra_directories||[],"onUpdate:modelValue":s[2]||=e=>R(i).write_launch(`workspace`,`extra_directories`,e.length?e:void 0)},null,8,[`model-value`])):Z(``,!0)]),_:1},8,[`description`])]),J(`section`,VB,[s[19]||=J(`h3`,null,[J(`span`,null,`2`),X(`谁来参与`)],-1),Y(Bz,{ref_key:`library`,ref:b,label:`添加 AI`,items:he.value,onAdd:ge,onRemove:s[3]||=e=>R(i).delete_expert_preset(e.slice(7))},null,8,[`items`]),v.value.length?(G(),K(`div`,HB,[(G(!0),K(W,null,H(v.value,e=>(G(),q(XR,{key:e,name:e,mode:h.value[e],choices:de(e),status:pe(e),host:x.value===e,hostable:S.value.includes(e),hosting:``,onHost:t=>u(`host`,e),onRemove:t=>_e(e),onMode:t=>fe(e,t)},null,8,[`name`,`mode`,`choices`,`status`,`host`,`hostable`,`onHost`,`onRemove`,`onMode`]))),128))])):(G(),K(`p`,UB,`请至少添加一位成员。同一平台可添加多位,各自独立会话。`)),v.value.length?(G(),K(`div`,WB,[Y(c,{name:`i-lucide-crown`}),J(`span`,null,I(S.value.length?`点卡片上的皇冠指定主持人:没 @ 任何人的消息由它分配;其他成员只在被你或主持人点名时发言。`:`需要一位本地 AI 做主持人,没 @ 的消息才有人接。`),1)])):Z(``,!0),Y(dB,{free:!0,blocker:ee.value},null,8,[`blocker`]),R(r).launch.available||R(r).launch.remote?(G(),q(PB,{key:3,enabled:R(r).create_image_generation,"onUpdate:enabled":R(i).write_create_image_generation},null,8,[`enabled`,`onUpdate:enabled`])):Z(``,!0)]),J(`section`,GB,[s[21]||=J(`h3`,null,[J(`span`,null,`3`),X(`协作方式(可选)`)],-1),R(r).launch.available||R(r).launch.remote?(G(),q(FB,{key:0,"model-value":!!R(r).create_host_workflows,"onUpdate:modelValue":s[4]||=e=>R(i).write_create_host_workflows(e)},null,8,[`model-value`])):Z(``,!0),J(`div`,KB,[s[20]||=J(`span`,null,`创建后`,-1),J(`div`,qB,[(G(),K(W,null,H(oe,e=>J(`button`,{key:e.value,type:`button`,role:`radio`,"aria-checked":ce.value===e.value,onClick:t=>le(e.value)},I(e.label),9,JB)),64))])]),J(`p`,YB,I(se[ce.value]),1),d.value?(G(),K(W,{key:1},[Y(y,{label:`讨论目标`,description:`写下问题、背景和顾虑,主持人据此推进。`},{default:z(()=>[Y(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}),Y(hO,{ref_key:`limit_picker`,ref:C,rounds:Number(l(`limit-max_rounds`)),minutes:Number(l(`limit-max_minutes`)),named_followup:!!R(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=>R(i).write_named_followup(e)},null,8,[`rounds`,`minutes`,`named_followup`])],64)):Z(``,!0),f.value?(G(),q(CO,{key:2,ref_key:`goal_config`,ref:m,objective:f.value.objective,continues:f.value.max_continues,minutes:f.value.max_minutes,idle:f.value.idle_seconds??120,"onUpdate:objective":s[9]||=e=>R(i).write_create_goal({objective:e}),"onUpdate:continues":s[10]||=e=>R(i).write_create_goal({max_continues:e}),"onUpdate:minutes":s[11]||=e=>R(i).write_create_goal({max_minutes:e}),"onUpdate:idle":s[12]||=e=>R(i).write_create_goal({idle_seconds:e})},null,8,[`objective`,`continues`,`minutes`,`idle`])):Z(``,!0)]),J(`details`,{class:`create-advanced`,open:!!R(r).launch.create_preferences?.advanced_open,onToggle:s[15]||=e=>R(i).write_create_preferences({advanced_open:e.target.open})},[J(`summary`,null,[Y(c,{name:`i-lucide-chevron-right`,class:`create-advanced-icon`}),s[22]||=X(`高级设置`,-1),J(`small`,null,`派活 `+I(R(r).create_chain_rounds?`${R(r).create_chain_rounds} 轮`:`不限`)+I(R(r).launch.available||R(r).launch.remote?` · API ${R(r).create_api_max_requests?`${R(r).create_api_max_requests} 次`:`不限`}`:``),1)]),Y(nL,{title:`连续派活上限`,"model-value":R(r).create_chain_rounds,"onUpdate:modelValue":s[13]||=e=>R(i).write_create_chain_rounds(e)},null,8,[`model-value`]),R(r).launch.available||R(r).launch.remote?(G(),q(qI,{key:0,title:`API 请求上限`,class:`create-advanced-field`,"model-value":R(r).create_api_max_requests,"onUpdate:modelValue":s[14]||=e=>R(i).write_create_api_max_requests(e)},null,8,[`model-value`])):Z(``,!0),s[23]||=J(`p`,{class:`create-advanced-note`},`建房后可在房间页修改。`,-1)],40,XB)],32)),[[O]]),J(`footer`,ZB,[J(`div`,QB,[J(`span`,{class:F([`create-summary`,{"is-blocked":re.value}]),title:re.value||ye.value,role:`status`},[re.value?(G(),q(c,{key:0,name:`i-lucide-circle-alert`})):Z(``,!0),X(I(re.value?`还差:${re.value}`:v.value.length||p.value?ye.value:``),1)],10,$B),Y(g,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:s[16]||=e=>n(`cancel`)}),Y(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:ie.value,loading:R(a)===`create`},null,8,[`icon`,`label`,`disabled`,`loading`])])])])}}},[[`__scopeId`,`data-v-ce9e19ec`]]),iV=(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))(iV||{}),aV=Object.defineProperty,oV=(e,t,n)=>t in e?aV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sV=(e,t,n)=>(oV(e,typeof t==`symbol`?t:t+``,n),n),cV=[0,1],lV=[1,0],uV=[2,3],dV=[3,2],fV={L:cV,M:lV,Q:uV,H:dV},pV=/^[0-9]*$/,mV=/^[A-Z0-9 $%*+.\/:-]*$/,hV=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`,gV=1,_V=40,vV=3,yV=3,bV=40,xV=10,SV=[[-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]],CV=[[-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]],wV=class{constructor(e,t,n,r){if(this.version=e,this.ecc=t,sV(this,`size`),sV(this,`mask`),sV(this,`modules`,[]),sV(this,`types`,[]),e<gV||e>_V)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,iV.Timing),this.setFunctionModule(e,6,e%2==0,iV.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,EV(r,e));this.setFunctionModule(8,7,EV(r,6)),this.setFunctionModule(8,8,EV(r,7)),this.setFunctionModule(7,8,EV(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,EV(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,EV(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,EV(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=EV(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,iV.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,iV.Alignment)}setFunctionModule(e,t,n,r=iV.Function){this.modules[t][e]=n,this.types[t][e]=r}addEccAndInterleave(e){let t=this.version,n=this.ecc;if(e.length!==VV(t,n))throw RangeError(`Invalid argument`);let r=CV[n[0]][t],i=SV[n[0]][t],a=Math.floor(BV(t)/8),o=r-a%r,s=Math.floor(a/r),c=[],l=HV(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=UV(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(BV(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]=EV(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+=vV:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*bV),n=this.modules[t][a],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*bV}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+=vV:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*bV),n=this.modules[a][t],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*bV}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+=yV)}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*xV,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 TV(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 EV(e,t){return!!(e>>>t&1)}var DV=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()}},OV=[1,10,12,14],kV=[2,9,11,13],AV=[4,8,16,16];function jV(e,t){return e[Math.floor((t+7)/17)+1]}function MV(e){let t=[];for(let n of e)TV(n,8,t);return new DV(AV,e.length,t)}function NV(e){if(!IV(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);TV(Number.parseInt(e.substring(n,n+r),10),r*3+1,t),n+=r}return new DV(OV,e.length,t)}function PV(e){if(!LV(e))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let t=[],n=0;for(;n+2<=e.length;n+=2){let r=hV.indexOf(e.charAt(n))*45;r+=hV.indexOf(e.charAt(n+1)),TV(r,11,t)}return n<e.length&&TV(hV.indexOf(e.charAt(n)),6,t),new DV(kV,e.length,t)}function FV(e){return e===``?[]:IV(e)?[NV(e)]:LV(e)?[PV(e)]:[MV(zV(e))]}function IV(e){return pV.test(e)}function LV(e){return mV.test(e)}function RV(e,t){let n=0;for(let r of e){let e=jV(r.mode,t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}function zV(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 BV(e){if(e<gV||e>_V)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 VV(e,t){return Math.floor(BV(e)/8)-SV[t[0]][e]*CV[t[0]][e]}function HV(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]=WV(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=WV(n,2)}return t}function UV(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]^=WV(t,e))}return n}function WV(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 GV(e,t,n=1,r=40,i=-1,a=!0){if(!(gV<=n&&n<=r&&r<=_V)||i<-1||i>7)throw RangeError(`Invalid value`);let o,s;for(o=n;;o++){let n=VV(o,t)*8,i=RV(e,o);if(i<=n){s=i;break}if(o>=r)throw RangeError(`Data too long`)}for(let e of[lV,uV,dV])a&&s<=VV(o,e)*8&&(t=e);let c=[];for(let t of e){TV(t.mode[0],4,c),TV(t.numChars,jV(t.mode,o),c);for(let e of t.getData())c.push(e)}let l=VV(o,t)*8;TV(0,Math.min(4,l-c.length),c),TV(0,(8-c.length%8)%8,c);for(let e=236;c.length<l;e^=253)TV(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 wV(o,t,u,i)}function KV(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`?FV(e):Array.isArray(e)?[MV(e)]:void 0;if(!c)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let l=GV(c,fV[n],i,a,o,r),u=qV({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 qV(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=iV.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 JV(e,t={}){let n=KV(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 YV=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 j=-2;j<=2;j++)b+=_.get(O+A,k+j);for(var M=b/25,A=0;A<i;A++)for(var j=0;j<i;j++){var u=y*i+A,d=v*i+j,N=l.get(u,d);E.set(u,d,N<=M),c&&D.set(u,d,!(N<=M))}}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})}))()),XV={key:0,class:`confirm-dialog-items`},ZV={class:`dialog-actions`},QV=rO({__name:`ConfirmDialog`,props:Va({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:Va([`confirm`],[`update:open`]),setup(e,{emit:t}){let n=no(e,`open`),r=t;function i(){r(`confirm`),n.value=!1}return(t,r)=>{let a=Zx,o=LD;return G(),q(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:z(()=>[e.items.length?(G(),K(`ul`,XV,[(G(!0),K(W,null,H(e.items,e=>(G(),K(`li`,{key:e},I(e),1))),128))])):Z(``,!0),J(`div`,ZV,[Y(a,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:r[0]||=e=>n.value=!1}),Y(a,{label:e.confirmLabel,color:e.danger?`error`:`primary`,onClick:i},null,8,[`label`,`color`])])]),_:1},8,[`open`,`title`,`description`])}}},[[`__scopeId`,`data-v-39a60d6d`]]),$V={key:0,class:`device-settings`,"aria-labelledby":`device-heading`},eH={key:0,class:`fine-print`},tH={class:`device-pair-row`},nH={key:0,class:`device-scan`},rH={key:0,class:`fine-print`,role:`status`},iH={class:`account-actions`},aH={key:2,class:`account-message is-error`,role:`status`},oH={class:`device-actions`},sH={key:0,class:`device-invite`,role:`status`},cH=[`innerHTML`],lH={key:0,class:`fine-print device-expired-note`},uH={key:1,class:`fine-print`},dH={key:1,class:`account-device-list`},fH={class:`device-row`},pH={key:0,class:`device-audit`},mH=[`aria-label`],hH={key:0,class:`device-empty`},gH={key:1,class:`device-revoked`},_H={class:`device-row`},vH={key:0,class:`device-audit`},yH={"aria-label":`已解绑设备的记录`},bH=6048e5,xH=3e3,SH=rO({__name:`DeviceSettings`,setup(e){let{view:t,bridge:n}=Dr(`discussion`),r=$(()=>t.value.admin.local),i=$(()=>!r.value&&t.value.launch.available&&t.value.launch.remote),a=$(()=>t.value.device),o=L(null),s=L([]),c=L(``),l=L(``),u=L(``),d=L(!1),f=L(!1),p=L(null),m=L(null),h=L(!1),g=null;B(()=>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||[]})}ia(v),B(i,e=>{e&&v()});let y=$(()=>o.value?.find(e=>e.current)),b=$(()=>!r.value&&t.value.admin.devices&&!t.value.admin.logged_in),x=$(()=>y.value&&!y.value.temporary&&y.value.expires_at-Date.now()<bH);async function S(){await _(`pair`,()=>n.device.pair(u.value))&&await v()}let C=L(!1),w=L(!1),T=0,E=L(null),D=null;function O(){T++,D?.getTracks().forEach(e=>e.stop()),D=null,C.value=!1,w.value=!1}async function k(){if(C.value)return;let e=++T;C.value=!0;try{let t=await navigator.mediaDevices.getUserMedia({video:{facingMode:`environment`},audio:!1});if(e!==T){t.getTracks().forEach(e=>e.stop());return}D=t}catch{if(e!==T)return;O(),n.notify(`error`,`无法打开相机:请允许本网站使用相机,或用系统相机扫码`);return}if(await new Promise(requestAnimationFrame),e!==T||!E.value||(E.value.srcObject=D,await E.value.play().catch(()=>{}),e!==T))return;w.value=!0;let t=document.createElement(`canvas`),r=t.getContext(`2d`,{willReadFrequently:!0}),i=()=>{if(!C.value)return;let{videoWidth:e,videoHeight:a}=E.value;if(e&&a){Object.assign(t,{width:e,height:a}),r.drawImage(E.value,0,0,e,a);let i=(0,YV.default)(r.getImageData(0,0,e,a).data,e,a,{inversionAttempts:`dontInvert`}),o=i&&n.device.take_scanned(i.data);if(o)return O(),u.value=o,S()}requestAnimationFrame(i)};requestAnimationFrame(i)}function A(){return _(`invite`,async()=>{let e=await n.device.invite(d.value,f.value);p.value={...e,svg:e.url?JV(e.url,{border:1}):``,expired:!1},j(o.value?.length||0)})}function j(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{}},xH)}ca(()=>{clearInterval(g),O()});function M(e){m.value=e,h.value=!0}let N=$(()=>m.value?.current?[`这台设备会立即退出,要再用须回到电脑前重新扫码配对。`,`已经在运行的工作和已改动的文件不会撤回。`]:[`该设备会立即无法访问房间,要再用须在电脑前重新扫码配对。`,`已经在运行的工作和已改动的文件不会撤回。`]);async function ee(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":`撤销远程可写`},P=e=>e?o.value?.find(t=>t.id===e)?.label||`已解绑的设备(${e.slice(0,6)})`:`电脑本机`;function ne(e,t){let n=t?`${P(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=$(()=>s.value.filter(e=>e.event!==`pairing.started`)),ie=e=>re.value.filter(t=>t.device===e),ae=$(()=>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=WD,g=Zx,y=nO;return r.value||i.value||b.value||a.value.needs?(G(),K(`section`,$V,[t[13]||=J(`h4`,{id:`device-heading`},`已配对的设备`,-1),b.value?Z(``,!0):(G(),K(`p`,eH,`新设备须在电脑前扫码配对。`)),b.value?(G(),K(`form`,{key:1,class:`dialog-form device-pair`,"aria-label":`配对这台设备`,onSubmit:nl(S,[`prevent`])},[t[8]||=J(`p`,{class:`fine-print`},`扫描电脑本机网页 设置 → 添加设备 的二维码,或输入配对码。`,-1),J(`div`,tH,[Y(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`]),Y(g,{icon:`i-lucide-scan-line`,color:`neutral`,variant:`outline`,"aria-label":`扫码`,title:`扫码`,disabled:!!l.value||C.value,loading:C.value&&!w.value,onClick:k},null,8,[`disabled`,`loading`])]),C.value?(G(),K(`div`,nH,[w.value?Z(``,!0):(G(),K(`p`,rH,`正在打开相机…`)),J(`video`,{ref_key:`video`,ref:E,muted:``,playsinline:``,"aria-label":`相机画面`},null,512),Y(g,{label:`取消`,color:`neutral`,variant:`soft`,size:`xs`,onClick:O})])):Z(``,!0),J(`div`,iH,[Y(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`?(G(),K(`p`,aH,[t[9]||=X(` 这台设备的授权已到期。`,-1),Y(g,{label:`用通行密钥续期`,color:`neutral`,variant:`soft`,size:`xs`,loading:l.value===`renew`,disabled:!!l.value,onClick:t[1]||=e=>{_(`renew`,async()=>{await R(n).device.renew(),await v()})}},null,8,[`loading`,`disabled`])])):(G(),K(W,{key:3},[J(`div`,oH,[i.value&&x.value?(G(),q(g,{key:0,label:`续期这台设备`,color:`neutral`,variant:`soft`,size:`sm`,loading:l.value===`renew`,disabled:!!l.value,onClick:t[2]||=e=>{_(`renew`,async()=>{await R(n).device.renew(),await v()})}},null,8,[`loading`,`disabled`])):Z(``,!0),r.value?(G(),q(g,{key:1,label:`添加设备`,icon:`i-lucide-qr-code`,color:`neutral`,variant:`outline`,size:`sm`,loading:l.value===`invite`,disabled:!!l.value,onClick:A},null,8,[`loading`,`disabled`])):Z(``,!0),r.value?(G(),q(y,{key:2,modelValue:f.value,"onUpdate:modelValue":t[3]||=e=>f.value=e,label:`允许不用通行密钥`},null,8,[`modelValue`])):Z(``,!0),r.value?(G(),q(y,{key:3,modelValue:d.value,"onUpdate:modelValue":t[4]||=e=>d.value=e,label:`临时设备(只授权 1 天)`},null,8,[`modelValue`])):Z(``,!0)]),p.value?(G(),K(`div`,sH,[p.value.svg?(G(),K(`div`,{key:0,class:F([`device-qr`,{"device-expired":p.value.expired}]),"aria-label":`配对二维码`,innerHTML:p.value.svg},null,10,cH)):Z(``,!0),J(`div`,null,[t[10]||=J(`p`,null,`用新设备的相机扫描二维码;没有摄像头就在新设备打开网站,输入配对码:`,-1),J(`p`,{class:F([`device-code`,{"device-expired":p.value.expired}])},I(p.value.code),3),p.value.expired?(G(),K(`p`,lH,`已过期,不能再用。`)):(G(),K(`p`,uH,I(ce(p.value.expires_at))+` 前有效(2 分钟),只能用一次`+I(p.value.temporary?`;临时设备只授权 1 天`:``)+I(p.value.without_passkey?`;允许不用通行密钥`:``)+`。`,1)),Y(g,{label:`重新生成`,icon:`i-lucide-refresh-cw`,color:`neutral`,variant:`outline`,size:`xs`,loading:l.value===`invite`,disabled:!!l.value,onClick:A},null,8,[`loading`,`disabled`])])])):Z(``,!0),o.value?(G(),K(`ul`,dH,[(G(!0),K(W,null,H(o.value,e=>(G(),K(`li`,{key:e.id},[J(`div`,fH,[J(`span`,null,[J(`strong`,null,[X(I(e.label),1),e.current?(G(),K(W,{key:0},[X(` · 当前设备`)],64)):Z(``,!0),e.temporary?(G(),K(W,{key:1},[X(` · 临时`)],64)):Z(``,!0)]),J(`small`,null,I(e.expires_at>Date.now()?`授权至 ${ce(e.expires_at)}`:`授权已到期`)+I(e.passkeys?``:` · 未创建通行密钥`),1)]),ie(e.id).length?(G(),q(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`])):Z(``,!0),Y(g,{icon:`i-lucide-unlink`,color:`error`,variant:`ghost`,size:`xs`,"aria-label":`解绑`,title:e.current?`解绑这台设备`:`解绑`,disabled:!!l.value,onClick:t=>M(e)},null,8,[`title`,`disabled`,`onClick`])]),c.value===e.id?(G(),K(`div`,pH,[J(`ul`,{"aria-label":`${e.label} 的记录`},[(G(!0),K(W,null,H(ie(e.id),(e,t)=>(G(),K(`li`,{key:t},[J(`small`,null,I(ce(e.at)),1),X(` `+I(ne(e,!1)),1)]))),128))],8,mH),t[11]||=J(`p`,{class:`fine-print`},`记录由电脑保存。看到不是你做的操作,立即解绑这台设备。`,-1)])):Z(``,!0)]))),128)),o.value.length?Z(``,!0):(G(),K(`li`,hH,`还没有配对的设备`)),ae.value.length?(G(),K(`li`,gH,[J(`div`,_H,[t[12]||=J(`span`,null,[J(`small`,null,`已解绑设备的记录`)],-1),Y(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`?(G(),K(`div`,vH,[J(`ul`,yH,[(G(!0),K(W,null,H(ae.value,(e,t)=>(G(),K(`li`,{key:t},[J(`small`,null,I(ce(e.at)),1),X(` `+I(ne(e,!0)),1)]))),128))])])):Z(``,!0)])):Z(``,!0)])):Z(``,!0),Y(QV,{open:h.value,"onUpdate:open":t[6]||=e=>h.value=e,title:m.value?.current?`解绑这台设备`:`解绑「${m.value?.label||``}」`,items:N.value,"confirm-label":`解绑`,danger:``,onConfirm:t[7]||=e=>ee(m.value)},null,8,[`open`,`title`,`items`])],64))])):Z(``,!0)}}},[[`__scopeId`,`data-v-0b4d98ba`]]),CH={class:`account-settings`,"aria-labelledby":`account-heading`},wH={key:0,class:`fine-print`,role:`status`},TH=[`aria-label`],EH={class:`fine-print account-intro`},DH={key:0,class:`account-message is-error`,role:`status`},OH={key:1,class:`fine-print`},kH={key:1,class:`fine-print`},AH={class:`account-actions`},jH={key:3,class:`account-profile`},MH={class:`account-identity`},NH={class:`account-avatar-actions`},PH={class:`account-name-row`},FH={key:0,class:`account-devices`,"aria-labelledby":`account-entry-heading`},IH={method:`post`,action:`/_entry/logout`},LH={class:`account-devices`,"aria-labelledby":`account-devices-heading`},RH={class:`account-device-list`},zH={class:`account-actions`},BH={class:`account-signout account-actions`},VH=rO({__name:`AccountSettings`,setup(e){let{view:t,bridge:n}=Dr(`discussion`),r=$(()=>t.value.admin),i=$(()=>r.value.profile),a=$(()=>r.value.loaded?r.value.devices?r.value.logged_in?`profile`:`unpaired`:r.value.registered?r.value.logged_in?`profile`:`login`:`register`:`loading`),o=L(``),s=tn({username:``,password:``,confirm:``,setup_key:``}),c=L(``),l=L(null),u=$(()=>c.value.trim()!==(i.value?.username||``)),d=$(()=>a.value===`register`&&!r.value.setup_available),f=L(!1);ia(async()=>{try{f.value=(await fetch(`/_entry/session`,{credentials:`same-origin`})).ok}catch{f.value=!1}}),B(()=>i.value?.username,e=>{c.value=e||``},{immediate:!0}),B(a,()=>{Object.assign(s,{password:``,confirm:``,setup_key:``})});async function p(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 m(){let e=a.value===`register`;if(!(e&&d.value))return p(e?`register`:`login`,()=>e?n.admin.register({...s}):n.admin.login({...s}),e?`管理员账号已创建,并已登录。`:`已登录。`)}function h(){if(u.value)return p(`name`,()=>n.admin.update_profile({username:c.value}),`名称已更新。`)}async function g(e){let t=e.target.files?.[0];e.target.value=``,t&&await p(`avatar`,async()=>n.admin.update_profile({avatar:await n.admin.avatar_from_file(t)}),`头像已更新。`)}function _(){return p(`avatar`,()=>n.admin.update_profile({avatar:``}),`已恢复默认头像。`)}async function v(){await p(`logout`,()=>n.admin.logout(),`已退出登录。`)}let y=L(null);function b(){return p(`sessions`,async()=>{y.value=await n.admin.sessions()})}async function x(e,t){await p(`revoke`,()=>n.admin.revoke(e),t)&&await b()}let S=e=>n.device.label(e);function C(e){return new Date(e*1e3).toLocaleString(`zh-CN`,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}let w=tn({current_password:``,password:``,confirm:``});async function T(){await p(`password`,()=>n.admin.change_password({...w}),`密码已更改,其他设备已退出登录。`)&&(Object.assign(w,{current_password:``,password:``,confirm:``}),y.value&&await b())}return(e,p)=>{let E=WD,D=RD,O=Zx,k=Bx;return G(),K(`section`,CH,[p[18]||=J(`h3`,{id:`account-heading`},`账号`,-1),a.value===`loading`?(G(),K(`p`,wH,`正在读取账号状态…`)):a.value===`unpaired`?(G(),q(SH,{key:1})):a.value===`register`||a.value===`login`?(G(),K(`form`,{key:2,class:`dialog-form account-form`,"aria-label":a.value===`register`?`设置管理员账号`:`登录管理员账号`,onSubmit:nl(m,[`prevent`])},[J(`p`,EH,[a.value===`register`?(G(),K(W,{key:0},[X(`设置站点管理员账号:名称和头像对所有访客可见,登录后可在没有房间凭据的浏览器中存档、恢复、删除房间。`)],64)):(G(),K(W,{key:1},[X(`登录后可管理房间;未登录时仍可阅读并使用本浏览器创建的房间。`)],64))]),Y(D,{label:`用户名`,description:a.value===`register`?`1–30 个字符,也是公开显示的名称`:void 0,required:``},{default:z(()=>[Y(E,{modelValue:s.username,"onUpdate:modelValue":p[0]||=e=>s.username=e,autocomplete:`username`,maxlength:30,required:``,class:`w-full`,"aria-label":`用户名`},null,8,[`modelValue`])]),_:1},8,[`description`]),Y(D,{label:`密码`,description:a.value===`register`?`8–128 个字符`:void 0,required:``},{default:z(()=>[Y(E,{modelValue:s.password,"onUpdate:modelValue":p[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`?(G(),K(W,{key:0},[Y(D,{label:`确认密码`,required:``},{default:z(()=>[Y(E,{modelValue:s.confirm,"onUpdate:modelValue":p[2]||=e=>s.confirm=e,type:`password`,autocomplete:`new-password`,maxlength:128,required:``,class:`w-full`,"aria-label":`确认密码`},null,8,[`modelValue`])]),_:1}),Y(D,{label:`注册令牌`,required:``},{default:z(()=>[Y(E,{modelValue:s.setup_key,"onUpdate:modelValue":p[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?(G(),K(`p`,DH,[...p[10]||=[X(`尚无可用的注册令牌。请在部署网站的电脑上运行 `,-1),J(`code`,null,`codiscuss token`,-1),X(`,再刷新本页;本地版也可设置环境变量 DISCUSS_ADMIN_SETUP_KEY 后重启。`,-1)]])):(G(),K(`p`,OH,[...p[11]||=[X(`首个注册者需要令牌,防止他人抢注:在部署网站的电脑上运行 `,-1),J(`code`,null,`codiscuss token`,-1),X(` 获取(一次性);本地版也可用服务端启动日志里的安装令牌。密码只由你自己保管,本机不保存。忘记密码:本地版运行 `,-1),J(`code`,null,`python server.py --reset-admin`,-1),X(` 后重新注册;Cloudflare 版需清空管理员表(见部署文档)。`,-1)]]))],64)):(G(),K(`p`,kH,[...p[12]||=[X(`忘记密码:本地版运行 `,-1),J(`code`,null,`python server.py --reset-admin`,-1),X(` 后重新注册;Cloudflare 版需清空管理员表(见部署文档)。`,-1)]])),J(`div`,AH,[Y(O,{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,TH)):(G(),K(`div`,jH,[J(`div`,MH,[Y(k,{src:R(n).identities.用户.icon,alt:`${R(n).display_name(`用户`)} 的头像`,size:`lg`,class:`channel-avatar user account-avatar`},null,8,[`src`,`alt`]),J(`div`,NH,[J(`input`,{ref_key:`avatar_input`,ref:l,type:`file`,accept:`image/*`,class:`account-file`,tabindex:`-1`,"aria-hidden":`true`,onChange:g},null,544),Y(O,{label:`更换头像`,icon:`i-lucide-image-up`,color:`neutral`,variant:`outline`,size:`sm`,loading:o.value===`avatar`,disabled:!!o.value,onClick:p[4]||=e=>l.value.click()},null,8,[`loading`,`disabled`]),Y(O,{label:`恢复默认头像`,color:`neutral`,variant:`ghost`,size:`sm`,disabled:!!o.value||!i.value?.avatar,onClick:_},null,8,[`disabled`])])]),J(`form`,{class:`dialog-form account-form`,"aria-label":`显示名称`,onSubmit:nl(h,[`prevent`])},[Y(D,{label:`显示名称`,description:`即用户名,对所有访客可见`},{default:z(()=>[J(`div`,PH,[Y(E,{modelValue:c.value,"onUpdate:modelValue":p[5]||=e=>c.value=e,autocomplete:`username`,maxlength:30,required:``,class:`w-full`,"aria-label":`显示名称`},null,8,[`modelValue`]),Y(O,{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),R(t).launch.projects_restricted&&f.value?(G(),K(`section`,FH,[p[13]||=J(`h4`,{id:`account-entry-heading`},`登录`,-1),p[14]||=J(`p`,{class:`fine-print`},`你用开通时拿到的账号名和密码登录。忘记密码或想换密码,请联系为你开通服务的人重设;重设后所有设备上的登录都会失效。`,-1),J(`form`,IH,[Y(O,{type:`submit`,label:`退出登录`,icon:`i-lucide-log-out`,color:`neutral`,variant:`outline`,size:`sm`})])])):R(t).launch.projects_restricted?Z(``,!0):(G(),q(SH,{key:1})),!r.value.local&&!r.value.devices?(G(),K(W,{key:2},[J(`section`,LH,[p[15]||=J(`h4`,{id:`account-devices-heading`},`网站登录`,-1),p[16]||=J(`p`,{class:`fine-print`},`登录一周不用或满一个月会自动失效。看到不认识的登录时,退出它并更改密码。没有配对的设备即使登录了网站,也操作不了电脑。`,-1),y.value?(G(),K(W,{key:1},[J(`ul`,RH,[(G(!0),K(W,null,H(y.value,e=>(G(),K(`li`,{key:e.id},[J(`span`,null,[J(`strong`,null,I(S(e.label)),1),J(`small`,null,I(e.current?`当前设备`:`最近使用 ${C(e.last_seen)}`),1)]),e.current?Z(``,!0):(G(),q(O,{key:0,label:`退出`,color:`neutral`,variant:`ghost`,size:`xs`,disabled:!!o.value,onClick:t=>x({id:e.id},`该设备已退出登录。`)},null,8,[`disabled`,`onClick`]))]))),128))]),y.value.length>1?(G(),q(O,{key:0,label:`退出其他所有设备`,color:`neutral`,variant:`outline`,size:`sm`,loading:o.value===`revoke`,disabled:!!o.value,onClick:p[6]||=e=>x({others:!0},`其他设备已全部退出登录。`)},null,8,[`loading`,`disabled`])):Z(``,!0)],64)):(G(),q(O,{key:0,label:`查看网站登录`,color:`neutral`,variant:`soft`,size:`sm`,loading:o.value===`sessions`,disabled:!!o.value,onClick:b},null,8,[`loading`,`disabled`]))]),J(`form`,{class:`dialog-form account-form`,"aria-label":`更改密码`,onSubmit:nl(T,[`prevent`])},[p[17]||=J(`h4`,null,`更改密码`,-1),Y(D,{label:`当前密码`,required:``},{default:z(()=>[Y(E,{modelValue:w.current_password,"onUpdate:modelValue":p[7]||=e=>w.current_password=e,type:`password`,autocomplete:`current-password`,maxlength:128,required:``,class:`w-full`,"aria-label":`当前密码`},null,8,[`modelValue`])]),_:1}),Y(D,{label:`新密码`,description:`8–128 个字符;更改后其他设备都会退出登录`,required:``},{default:z(()=>[Y(E,{modelValue:w.password,"onUpdate:modelValue":p[8]||=e=>w.password=e,type:`password`,autocomplete:`new-password`,maxlength:128,required:``,class:`w-full`,"aria-label":`新密码`},null,8,[`modelValue`])]),_:1}),Y(D,{label:`确认新密码`,required:``},{default:z(()=>[Y(E,{modelValue:w.confirm,"onUpdate:modelValue":p[9]||=e=>w.confirm=e,type:`password`,autocomplete:`new-password`,maxlength:128,required:``,class:`w-full`,"aria-label":`确认新密码`},null,8,[`modelValue`])]),_:1}),J(`div`,zH,[Y(O,{type:`submit`,label:`更改密码`,color:`neutral`,variant:`soft`,loading:o.value===`password`,disabled:!!o.value||!w.current_password||!w.password},null,8,[`loading`,`disabled`])])],32),J(`div`,BH,[Y(O,{label:`退出登录`,icon:`i-lucide-log-out`,color:`neutral`,variant:`outline`,size:`sm`,loading:o.value===`logout`,disabled:!!o.value,onClick:v},null,8,[`loading`,`disabled`])])],64)):Z(``,!0)]))])}}},[[`__scopeId`,`data-v-30eaebb0`]]),HH={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`}},UH=Object.assign({inheritAttrs:!1},{__name:`SelectMenu`,props:Va({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:Va([`change`,`blur`,`focus`,`create`,`clear`,`highlight`,`update:modelValue`,`update:open`],[`update:searchTerm`]),setup(e,{expose:t,emit:n}){let r=e,i=n,a=Ia(),o=py(`selectMenu`,r),s=no(e,`searchTerm`,{type:String,default:``}),{t:c}=Jd(),l=Od(),{filterGroups:u}=FD(),d=my(bd(o,`modelValue`,`defaultValue`,`open`,`defaultOpen`,`required`,`multiple`,`resetSearchTermOnBlur`,`resetSearchTermOnSelect`,`resetModelValueOnClear`,`highlightOnHover`,`by`),i),f=oy(On(()=>o.portal)),p=On(()=>Md(o.content,{side:`bottom`,sideOffset:8,collisionPadding:8,position:`popper`})),m=On(()=>Md(o.arrow,{rounded:!0})),h=$(()=>typeof o.clear==`object`?o.clear:{}),g=On(()=>o.virtualize?Md(typeof o.virtualize==`boolean`?{}:o.virtualize,{estimateSize:yL(pe.value,ne.value??`md`,o.descriptionKey,!!a[`item-description`])}):!1),_=On(()=>Md(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}=qx(r),{orientation:k,size:A}=Ux(r),{isLeading:j,isTrailing:M,leadingIconName:N,trailingIconName:ee}=Vx($(()=>({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}))),te=$(()=>C.value??o.color),P=$(()=>E.value??o.highlight),ne=$(()=>A.value??S.value??o.size),re=$(()=>D.value??o.disabled),[ie,ae]=Td(),[oe,se]=Td({props:{item:{type:[Object,String,Number,Boolean],required:!0},index:{type:Number,required:!1}}}),ce=$(()=>Fx({extend:HH,...l.ui?.selectMenu||{}})({color:te.value,variant:o.variant,size:ne.value,loading:o.loading,highlight:P.value,fixed:o.fixed,leading:j.value||!!o.avatar||!!a.leading,trailing:M.value||!!a.trailing,fieldGroup:k.value,virtualize:!!o.virtualize,multiple:o.multiple}));function le(e){if(o.multiple&&Array.isArray(e)){let t=e.map(e=>Ud(de.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 Ud(de.value,e,{labelKey:o.labelKey,valueKey:o.valueKey,by:o.by})}let ue=$(()=>o.items?.length?Wd(o.items)?o.items:[o.items]:[]),de=$(()=>ue.value.flatMap(e=>e)),fe=$(()=>{if(o.ignoreFilter||!s.value)return ue.value;let e=Array.isArray(o.filterFields)?o.filterFields:[o.labelKey];return u(ue.value,s.value,{fields:e,isStructural:e=>De(e)&&!!e.type&&[`label`,`separator`].includes(e.type)})}),pe=$(()=>fe.value.flatMap(e=>e)),me=$(()=>{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`?!pe.value.find(t=>Vd(t,e,o.by??o.valueKey)):!pe.value.length}),he=$(()=>typeof o.createItem==`object`?o.createItem.position:`bottom`),ge=mi(`triggerRef`);function _e(){o.autofocus&&ge.value?.$el?.focus({focusVisible:!0})}let ve;ia(()=>{ve=setTimeout(()=>{_e()},o.autofocusDelay)}),ze(()=>clearTimeout(ve));function ye(e){if(dn(o.modelValue)===e)return;o.modelModifiers?.trim&&(typeof e==`string`||e==null)&&(e=e?.trim()??null),o.modelModifiers?.number&&(e=Bd(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 be=L(!1),xe;ze(()=>clearTimeout(xe));function Ce(e){if(be.value=e,e){let e=new FocusEvent(`focus`);i(`focus`,e),y(),clearTimeout(xe)}else{let e=new FocusEvent(`blur`);i(`blur`,e),v(),o.resetSearchTermOnBlur&&(xe=setTimeout(()=>{s.value=``},100))}}function we(e){if(be.value)return;let t=e.currentTarget;e.preventDefault(),t.click()}function Te(e){e.preventDefault(),e.stopPropagation(),i(`create`,s.value)}function Ee(e,t){De(t)&&(t.disabled?e.preventDefault():t.onSelect?.(e))}function De(e){return typeof e==`object`&&!!e}function Oe(e){return o.multiple&&Array.isArray(e)?e.length===0:e==null||e===``}function ke(){re.value||i(`clear`)}function Ae(e){_.value.autofocus===!1&&e.preventDefault()}function je(e){let t=document.activeElement;t&&t!==document.body&&!e.target.contains(t)&&e.preventDefault()}let Me=mi(`viewportRef`),Ne=mi(`comboboxRootRef`);return B(()=>o.items,async()=>{be.value&&o.createItem&&(await ir(),Ne.value?.highlightFirstItem?.())},{flush:`post`}),t({triggerRef:On(()=>ge.value?.$el),viewportRef:On(()=>Me.value)}),(e,t)=>(G(),K(W,null,[Y(R(ie),null,{default:z(()=>[Y(R(rg),{"data-slot":`item`,class:F(ce.value.item({class:R(o).ui?.item})),value:s.value,onSelect:Te},{default:z(()=>[J(`span`,{"data-slot":`itemLabel`,class:F(ce.value.itemLabel({class:R(o).ui?.itemLabel}))},[U(e.$slots,`create-item-label`,{item:s.value},()=>[X(I(R(c)(`selectMenu.create`,{label:s.value})),1)])],2)]),_:3},8,[`class`,`value`])]),_:3}),Y(R(oe),null,{default:z(({item:t,index:n})=>[De(t)&&t.type===`label`?(G(),q(R(ag),{key:0,"data-slot":`label`,class:F(ce.value.label({class:[R(o).ui?.label,t.ui?.label,t.class]}))},{default:z(()=>[X(I(R(zd)(t,R(o).labelKey)),1)]),_:2},1032,[`class`])):De(t)&&t.type===`separator`?(G(),q(R(sg),{key:1,"data-slot":`separator`,class:F(ce.value.separator({class:[R(o).ui?.separator,t.ui?.separator,t.class]}))},null,8,[`class`])):(G(),q(R(rg),{key:2,"data-slot":`item`,class:F(ce.value.item({class:[R(o).ui?.item,De(t)&&t.ui?.item,De(t)&&t.class]})),disabled:De(t)&&t.disabled,value:R(o).valueKey&&De(t)?R(zd)(t,R(o).valueKey):t,onSelect:e=>Ee(e,t)},{default:z(()=>[U(e.$slots,`item`,{item:t,index:n,ui:ce.value},()=>[U(e.$slots,`item-leading`,{item:t,index:n,ui:ce.value},()=>[De(t)&&t.icon?(G(),q(Ix,{key:0,name:t.icon,"data-slot":`itemLeadingIcon`,class:F(ce.value.itemLeadingIcon({class:[R(o).ui?.itemLeadingIcon,t.ui?.itemLeadingIcon]}))},null,8,[`name`,`class`])):De(t)&&t.avatar?(G(),q(Bx,Q({key:1,size:t.ui?.itemLeadingAvatarSize||R(o).ui?.itemLeadingAvatarSize||ce.value.itemLeadingAvatarSize()},t.avatar,{"data-slot":`itemLeadingAvatar`,class:ce.value.itemLeadingAvatar({class:[R(o).ui?.itemLeadingAvatar,t.ui?.itemLeadingAvatar]})}),null,16,[`size`,`class`])):De(t)&&t.chip?(G(),q(zx,Q({key:2,size:t.ui?.itemLeadingChipSize||R(o).ui?.itemLeadingChipSize||ce.value.itemLeadingChipSize(),inset:``,standalone:``},t.chip,{"data-slot":`itemLeadingChip`,class:ce.value.itemLeadingChip({class:[R(o).ui?.itemLeadingChip,t.ui?.itemLeadingChip]})}),null,16,[`size`,`class`])):Z(``,!0)]),J(`span`,{"data-slot":`itemWrapper`,class:F(ce.value.itemWrapper({class:[R(o).ui?.itemWrapper,De(t)&&t.ui?.itemWrapper]}))},[J(`span`,{"data-slot":`itemLabel`,class:F(ce.value.itemLabel({class:[R(o).ui?.itemLabel,De(t)&&t.ui?.itemLabel]}))},[U(e.$slots,`item-label`,{item:t,index:n},()=>[X(I(De(t)?R(zd)(t,R(o).labelKey):t),1)])],2),De(t)&&(R(zd)(t,R(o).descriptionKey)||a[`item-description`])?(G(),K(`span`,{key:0,"data-slot":`itemDescription`,class:F(ce.value.itemDescription({class:[R(o).ui?.itemDescription,De(t)&&t.ui?.itemDescription]}))},[U(e.$slots,`item-description`,{item:t,index:n},()=>[X(I(R(zd)(t,R(o).descriptionKey)),1)])],2)):Z(``,!0)],2),J(`span`,{"data-slot":`itemTrailing`,class:F(ce.value.itemTrailing({class:[R(o).ui?.itemTrailing,De(t)&&t.ui?.itemTrailing]}))},[U(e.$slots,`item-trailing`,{item:t,index:n,ui:ce.value}),Y(R(ig),{"as-child":``},{default:z(()=>[Y(Ix,{name:R(o).selectedIcon||R(l).ui.icons.check,"data-slot":`itemTrailingIcon`,class:F(ce.value.itemTrailingIcon({class:[R(o).ui?.itemTrailingIcon,De(t)&&t.ui?.itemTrailingIcon]}))},null,8,[`name`,`class`])]),_:2},1024)],2)])]),_:2},1032,[`class`,`disabled`,`value`,`onSelect`]))]),_:3}),Y(R(Jh),Q({ref_key:`comboboxRootRef`,ref:Ne},R(d),{"ignore-filter":``,"as-child":``,name:R(T),disabled:re.value,"onUpdate:modelValue":ye,"onUpdate:open":Ce}),{default:z(({modelValue:n,open:r})=>[Y(R(Yh),{"as-child":``},{default:z(()=>[Y(R(cg),Q({id:R(w),ref_key:`triggerRef`,ref:ge,"data-slot":`base`,class:ce.value.base({class:[R(o).ui?.base,R(o).class]}),tabindex:`0`},{"aria-label":void 0,...e.$attrs,...R(O)},{onKeydown:[rl(we,[`down`]),rl(we,[`up`])]}),{default:z(()=>[R(j)||R(o).avatar||a.leading?(G(),K(`span`,{key:0,"data-slot":`leading`,class:F(ce.value.leading({class:R(o).ui?.leading}))},[U(e.$slots,`leading`,{modelValue:n,open:r,ui:ce.value},()=>[R(j)&&R(N)?(G(),q(Ix,{key:0,name:R(N),"data-slot":`leadingIcon`,class:F(ce.value.leadingIcon({class:R(o).ui?.leadingIcon}))},null,8,[`name`,`class`])):R(o).avatar?(G(),q(Bx,Q({key:1,size:R(o).ui?.itemLeadingAvatarSize||ce.value.itemLeadingAvatarSize()},R(o).avatar,{"data-slot":`itemLeadingAvatar`,class:ce.value.itemLeadingAvatar({class:R(o).ui?.itemLeadingAvatar})}),null,16,[`size`,`class`])):Z(``,!0)])],2)):Z(``,!0),U(e.$slots,`default`,{modelValue:n,open:r,ui:ce.value},()=>[(G(!0),K(W,null,H([le(n)],e=>(G(),K(W,{key:e},[e==null?(G(),K(`span`,{key:1,"data-slot":`placeholder`,class:F(ce.value.placeholder({class:R(o).ui?.placeholder}))},I(R(o).placeholder??`\xA0`),3)):(G(),K(`span`,{key:0,"data-slot":`value`,class:F(ce.value.value({class:R(o).ui?.value}))},I(e),3))],64))),128))]),R(M)||a.trailing||R(o).clear?(G(),K(`span`,{key:1,"data-slot":`trailing`,class:F(ce.value.trailing({class:R(o).ui?.trailing}))},[U(e.$slots,`trailing`,{modelValue:n,open:r,ui:ce.value},()=>[R(o).clear&&!re.value&&!Oe(n)?(G(),q(R(Zh),{key:0,"as-child":``},{default:z(()=>[Y(Zx,Q({as:`span`,icon:R(o).clearIcon||R(l).ui.icons.close,size:ne.value,variant:`link`,color:`neutral`,tabindex:`-1`},h.value,{"data-slot":`trailingClear`,class:ce.value.trailingClear({class:R(o).ui?.trailingClear}),onClick:nl(ke,[`stop`])}),null,16,[`icon`,`size`,`class`])]),_:1})):R(ee)?(G(),q(Ix,{key:1,name:R(ee),"data-slot":`trailingIcon`,class:F(ce.value.trailingIcon({class:R(o).ui?.trailingIcon}))},null,8,[`name`,`class`])):Z(``,!0)])],2)):Z(``,!0)]),_:2},1040,[`id`,`class`])]),_:2},1024),Y(R(og),Se(as(R(f))),{default:z(()=>[Y(R(Wx),null,{default:z(()=>[Y(R(Qh),Q({"data-slot":`content`,class:ce.value.content({class:R(o).ui?.content})},p.value),{default:z(()=>[Y(R(Gp),{loop:``,"data-slot":`focusScope`,class:F(ce.value.focusScope({class:R(o).ui?.focusScope})),onMountAutoFocus:Ae,onUnmountAutoFocus:je},{default:z(()=>[U(e.$slots,`content-top`),R(o).searchInput?(G(),q(R(ng),{key:0,modelValue:s.value,"onUpdate:modelValue":t[1]||=e=>s.value=e,"display-value":()=>s.value,"as-child":``},{default:z(()=>[Y(WD,Q({autofocus:``,autocomplete:`off`,size:ne.value},_.value,{"model-modifiers":{trim:R(o).modelModifiers?.trim},"data-slot":`input`,class:ce.value.input({class:R(o).ui?.input}),onChange:t[0]||=nl(()=>{},[`stop`])}),null,16,[`size`,`model-modifiers`,`class`])]),_:1},8,[`modelValue`,`display-value`])):Z(``,!0),Y(R($h),{"data-slot":`empty`,class:F(ce.value.empty({class:R(o).ui?.empty}))},{default:z(()=>[U(e.$slots,`empty`,{searchTerm:s.value},()=>[X(I(s.value?R(c)(`selectMenu.noMatch`,{searchTerm:s.value}):R(c)(`selectMenu.noData`)),1)])]),_:3},8,[`class`]),J(`div`,{ref_key:`viewportRef`,ref:Me,role:`presentation`,"data-slot":`viewport`,class:F(ce.value.viewport({class:R(o).ui?.viewport}))},[R(o).virtualize?(G(),K(W,{key:0},[me.value&&he.value===`top`?(G(),q(R(ae),{key:0})):Z(``,!0),Y(R(dg),Q({options:pe.value,"text-content":e=>De(e)?R(zd)(e,R(o).labelKey):String(e)},g.value),{default:z(({option:e,virtualItem:t})=>[Y(R(se),{item:e,index:t.index},null,8,[`item`,`index`])]),_:1},16,[`options`,`text-content`]),me.value&&he.value===`bottom`?(G(),q(R(ae),{key:1})):Z(``,!0)],64)):(G(),K(W,{key:1},[me.value&&he.value===`top`?(G(),q(R(tg),{key:0,"data-slot":`group`,class:F(ce.value.group({class:R(o).ui?.group}))},{default:z(()=>[Y(R(ae))]),_:1},8,[`class`])):Z(``,!0),(G(!0),K(W,null,H(fe.value,(e,t)=>(G(),q(R(tg),{key:`group-${t}`,"data-slot":`group`,class:F(ce.value.group({class:R(o).ui?.group}))},{default:z(()=>[(G(!0),K(W,null,H(e,(e,n)=>(G(),q(R(se),{key:`group-${t}-${n}`,item:e,index:n},null,8,[`item`,`index`]))),128))]),_:2},1032,[`class`]))),128)),me.value&&he.value===`bottom`?(G(),q(R(tg),{key:1,"data-slot":`group`,class:F(ce.value.group({class:R(o).ui?.group}))},{default:z(()=>[Y(R(ae))]),_:1},8,[`class`])):Z(``,!0)],64))],2),U(e.$slots,`content-bottom`)]),_:3},8,[`class`]),R(o).arrow?(G(),q(R(Xh),Q({key:0},m.value,{"data-slot":`arrow`,class:ce.value.arrow({class:R(o).ui?.arrow})}),null,16,[`class`])):Z(``,!0)]),_:3},16,[`class`])]),_:3})]),_:3},16)]),_:3},16,[`name`,`disabled`])],64))}}),WH={class:`channel-reading-setting`},GH=[`aria-expanded`],KH={class:`speech-settings`},qH={key:0,class:`fine-print`},JH={class:`speech-row`},YH={class:`speech-rates`,role:`group`,"aria-label":`朗读语音服务`},XH=[`title`],ZH=[`href`],QH={class:`speech-row`},$H={class:`speech-row`},eU={class:`speech-row`},tU={class:`speech-inline`},nU={class:`speech-row`},rU={class:`speech-inline`},iU=[`title`],aU={class:`speech-inline`},oU={class:`speech-row`},sU=[`title`],cU={class:`speech-row`},lU={class:`speech-row`},uU={class:`speech-inline speech-process`},dU=[`title`],fU={class:`speech-row`},pU={class:`speech-rates`,role:`group`,"aria-label":`语音输入服务`},mU=[`title`],hU={class:`speech-row`},gU={class:`speech-row`},_U={class:`speech-inline speech-process`},vU=[`title`],yU={key:2,class:`fine-print`},bU=`••••••••••••`,xU=`你好,我会用这个声音为你朗读房间里的消息。`,SU=`:file`,CU=`:general`,wU=1e4,TU=rO({__name:`SpeechSettings`,setup(e){let{bridge:t}=Dr(`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=tn({provider:`volcengine`,speech_rate:0,providers:{},catalog:[],api_key_ref:``,stt_provider:`volcengine`,stt_catalog:[],stt_key_ref:``}),i=Object.keys(t.launch_clients).map(e=>({name:e,label:t.identities[e]?.label||e})),a=L(!1),o=L(``),s=L(``),c=L(``),l=null,u=tn({}),d=tn({}),f=L(!1),p=$(()=>r.catalog.find(e=>e.id===r.provider)||{}),m=$(()=>r.providers[r.provider]||{member_voices:{}}),h=$(()=>o.value?`需连接本机服务`:a.value?r.api_key_ref?`已配置 · ${p.value.label} · ${D.value.find(e=>e.value===m.value.speaker)?.label||m.value.speaker}`:`${p.value.label} · 未配置`:`读取中…`),g=$(()=>r.stt_catalog.find(e=>e.id===r.stt_provider)||{}),_=$(()=>r.provider===r.stt_provider?null:r.catalog.find(e=>e.id===r.stt_provider));ia(async()=>{try{Object.assign(r,await t.local_request(`tts-settings`,{})),a.value=!0}catch(e){o.value=e.message}});let v=L({}),y=0;async function b(){try{v.value=await t.local_request(`local-speech`,{})}catch{}}B([f,a],([e,t])=>{clearInterval(y),e&&t&&(b(),y=setInterval(b,wU))}),sa(()=>clearInterval(y));function x(e){let t=v.value[e];return t?t.state===`running`?t.pid?`运行中 · ${t.name} · PID ${t.pid}`:`运行中`:t.state===`other`?`端口 ${t.port} 被 ${t.name}(PID ${t.pid})占用`:t.installed?`未运行`:`未安装`:`读取中…`}async function S(e){if(!s.value){s.value=`stop:${e}`;try{v.value=await t.local_request(`local-speech`,{stop:e})}catch(e){t.notify(`error`,e.message)}finally{s.value=``}}}async function C(e){let{speech_rate:n,providers:i}=r;try{Object.assign(r,await t.local_request(`tts-settings`,{speech_rate:n,providers:i,...e}))}catch(e){t.notify(`error`,e.message)}}let w=()=>C({});function T(e){e!==r.stt_provider&&(r.stt_provider=e,C({stt_provider:e}))}function E(e){e!==r.provider&&(r.provider=e,C({provider:e}))}let D=$(()=>{let e=(p.value.voices||[]).map(e=>({label:e.label,value:e.id})),t=[m.value.speaker,m.value.file_voice,...Object.values(m.value.member_voices||{})].filter(t=>t&&!e.some(e=>e.value===t));return[...e,...[...new Set(t)].map(e=>({label:e,value:e}))]}),O=$(()=>[{label:`跟随通用`,value:``},...D.value]),k=e=>(e===SU?m.value.file_voice:e?m.value.member_voices[e]:``)||m.value.speaker;function A(e,t){let n=String(t||``).trim(),r=m.value;e===SU?r.file_voice=n:e?r.member_voices={...r.member_voices,[e]:n}:n&&(r.speaker=n),w()}async function j(e){let n=String(u[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,u[e.id]=``,await w()}catch(e){t.notify(`error`,e.message)}finally{s.value=``}}}async function M(e){if(c.value===e)return N();N();let n=new Audio;n.play().catch(()=>{}),s.value=`preview:${e}`;try{let r=k(e),{audio:i,format:a}=await kA(t,{text:xU,speaker:r});n.src=URL.createObjectURL(new Blob([Uint8Array.from(atob(i),e=>e.charCodeAt(0))],{type:a===`m4a`?`audio/mp4`:`audio/mpeg`})),n.onended=()=>{l===n&&N()},l=n,c.value=e,await n.play();let o=D.value.find(e=>e.value===r)?.label||r;t.notify(`info`,`正在试听:${o}。听不到声音时,请检查这台设备的音量和声音输出(耳机或音箱)`)}catch(e){l===n&&N(),t.notify(`error`,e.message)}finally{s.value=``}}function N(){l&&(l.pause(),URL.revokeObjectURL(l.src)),l=null,c.value=``}return sa(N),(e,t)=>{let l=Ix,y=Zx,b=WD,C=UH,k=zD,N=DI;return G(),K(`section`,WH,[Y(N,{open:f.value,"onUpdate:open":t[16]||=e=>f.value=e},{content:z(()=>[J(`div`,KH,[o.value?(G(),K(`p`,qH,`语音由这台电脑的本机服务调用语音服务,需要连接本机服务或已配对电脑:`+I(o.value),1)):a.value?(G(),K(W,{key:1},[t[30]||=J(`h4`,null,`朗读`,-1),J(`div`,JH,[t[19]||=J(`span`,null,`服务`,-1),J(`div`,YH,[(G(!0),K(W,null,H(r.catalog,e=>(G(),q(y,{key:e.id,label:e.label,color:`neutral`,variant:`ghost`,size:`xs`,class:F({chosen:r.provider===e.id}),"aria-pressed":r.provider===e.id,onClick:t=>E(e.id)},null,8,[`label`,`class`,`aria-pressed`,`onClick`]))),128))])]),J(`p`,{class:`fine-print speech-note`,title:p.value.note},[X(I(p.value.note)+` · `,1),J(`a`,{href:p.value.console_url,target:`_blank`,rel:`noopener`},`控制台`,8,ZH)],8,XH),J(`div`,QH,[t[20]||=J(`span`,null,`密钥`,-1),p.value.local?(G(),q(b,{key:0,disabled:``,placeholder:m.value.api_key_ref?`已由安装技能配置,无需填写`:`尚未安装:让本机 AI 按 local-tts-setup 技能安装`,"aria-label":`本机语音令牌`,size:`sm`,class:`w-full`},null,8,[`placeholder`])):(G(),q(b,{key:1,modelValue:u[p.value.id],"onUpdate:modelValue":t[1]||=e=>u[p.value.id]=e,type:`text`,autocomplete:`off`,spellcheck:`false`,"data-1p-ignore":``,"data-lpignore":`true`,placeholder:m.value.api_key_ref?bU:`粘贴 API Key,只存这台电脑`,title:m.value.api_key_ref&&!u[p.value.id]?`已保存;本机不回传密钥,输入新 Key 可更换`:void 0,"aria-label":`${p.value.label} API Key`,size:`sm`,class:`w-full`,loading:s.value===`key:${p.value.id}`,ui:{base:d[p.value.id]?``:`speech-key-masked`,trailing:`pe-0.5`},onChange:t[2]||=e=>j(p.value)},{trailing:z(()=>[Y(y,{icon:d[p.value.id]?`i-lucide-eye`:`i-lucide-eye-off`,disabled:!u[p.value.id],"aria-label":d[p.value.id]?`隐藏密钥`:`显示密钥`,"aria-pressed":!!d[p.value.id],size:`xs`,color:`neutral`,variant:`link`,onClick:t[0]||=e=>d[p.value.id]=!d[p.value.id]},null,8,[`icon`,`disabled`,`aria-label`,`aria-pressed`])]),_:1},8,[`modelValue`,`placeholder`,`title`,`aria-label`,`loading`,`ui`]))]),J(`div`,$H,[t[21]||=J(`span`,null,`区域`,-1),p.value.region?(G(),q(b,{key:0,modelValue:m.value.region,"onUpdate:modelValue":t[3]||=e=>m.value.region=e,placeholder:`语音资源所在区域,如 eastasia`,"aria-label":`Azure 区域`,size:`sm`,class:`w-full`,onChange:w},null,8,[`modelValue`])):(G(),q(b,{key:1,disabled:``,placeholder:`此服务无需区域`,"aria-label":`区域`,size:`sm`,class:`w-full`}))]),J(`div`,eU,[t[22]||=J(`span`,null,`通用`,-1),J(`div`,tU,[Y(C,{"model-value":m.value.speaker,items:D.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=>A(``,e),onCreate:t[5]||=e=>A(``,e)},null,8,[`model-value`,`items`]),Y(y,{icon:c.value===CU?`i-lucide-square`:`i-lucide-volume-2`,"aria-label":c.value===CU?`停止试听`:`试听通用音色`,color:`neutral`,variant:`ghost`,size:`sm`,loading:s.value===`preview:${CU}`,disabled:!r.api_key_ref||!!s.value,onClick:t[6]||=e=>M(CU)},null,8,[`icon`,`aria-label`,`loading`,`disabled`])])]),J(`div`,nU,[t[23]||=J(`span`,null,`文件`,-1),J(`div`,rU,[Y(C,{"model-value":m.value.file_voice||``,items:O.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=>A(SU,e),onCreate:t[8]||=e=>A(SU,e)},null,8,[`model-value`,`items`]),Y(y,{icon:c.value===SU?`i-lucide-square`:`i-lucide-volume-2`,"aria-label":c.value===SU?`停止试听`:`试听朗读文件的音色`,color:`neutral`,variant:`ghost`,size:`sm`,loading:s.value===`preview:${SU}`,disabled:!r.api_key_ref||!!s.value,onClick:t[9]||=e=>M(SU)},null,8,[`icon`,`aria-label`,`loading`,`disabled`])])]),(G(!0),K(W,null,H(R(i),e=>(G(),K(`div`,{key:e.name,class:`speech-row`},[J(`span`,{title:e.label},I(e.label),9,iU),J(`div`,aU,[Y(C,{"model-value":m.value.member_voices[e.name]||``,items:O.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=>A(e.name,t),onCreate:t=>A(e.name,t)},null,8,[`model-value`,`items`,`aria-label`,`onUpdate:modelValue`,`onCreate`]),Y(y,{icon:c.value===e.name?`i-lucide-square`:`i-lucide-volume-2`,"aria-label":c.value===e.name?`停止试听`:`试听 ${e.label} 的音色`,color:`neutral`,variant:`ghost`,size:`sm`,loading:s.value===`preview:${e.name}`,disabled:!r.api_key_ref||!!s.value,onClick:t=>M(e.name)},null,8,[`icon`,`aria-label`,`loading`,`disabled`,`onClick`])])]))),128)),t[31]||=J(`p`,{class:`fine-print speech-note`},`未单独设置的 AI 与其他消息用通用音色`,-1),J(`div`,oU,[t[24]||=J(`span`,null,`语速`,-1),J(`div`,{class:`speech-rates`,role:`group`,"aria-label":`朗读语速`,title:p.value.rate===!1?`当前接入不支持调节语速`:void 0},[(G(),K(W,null,H(n,e=>Y(y,{key:e.value,label:e.label,color:`neutral`,variant:`ghost`,size:`xs`,disabled:p.value.rate===!1,class:F({chosen:r.speech_rate===e.value}),"aria-pressed":r.speech_rate===e.value,onClick:t=>{r.speech_rate=e.value,w()}},null,8,[`label`,`disabled`,`class`,`aria-pressed`,`onClick`])),64))],8,sU)]),J(`div`,cU,[t[25]||=J(`span`,null,`语气`,-1),p.value.context?(G(),q(k,{key:0,modelValue:m.value.context,"onUpdate:modelValue":t[10]||=e=>m.value.context=e,maxlength:200,rows:1,autoresize:``,maxrows:4,placeholder:`可选,如:像朋友聊天一样自然地读`,"aria-label":`朗读语气提示`,size:`sm`,class:`w-full`,onChange:w},null,8,[`modelValue`])):(G(),q(b,{key:1,disabled:``,placeholder:`当前接入不支持自定义语气`,"aria-label":`朗读语气提示`,size:`sm`,class:`w-full`}))]),t[32]||=J(`p`,{class:`fine-print speech-note`},`输入框右下角的播报按钮自动读新回复摘要`,-1),J(`div`,lU,[t[26]||=J(`span`,null,`本机进程`,-1),J(`div`,uU,[J(`span`,{class:F([`speech-process-state`,v.value.tts?.state]),title:x(`tts`)},I(x(`tts`)),11,dU),v.value.tts?.state===`running`?(G(),q(y,{key:0,icon:`i-lucide-power`,"aria-label":`强行停止本机朗读服务`,title:`强行停止本机朗读服务(连同子进程)`,color:`error`,variant:`ghost`,size:`sm`,loading:s.value===`stop:tts`,disabled:!!s.value,onClick:t[11]||=e=>S(`tts`)},null,8,[`loading`,`disabled`])):Z(``,!0)])]),t[33]||=J(`h4`,null,`语音输入`,-1),J(`div`,fU,[t[27]||=J(`span`,null,`服务`,-1),J(`div`,pU,[(G(!0),K(W,null,H(r.stt_catalog,e=>(G(),q(y,{key:e.id,label:e.label,color:`neutral`,variant:`ghost`,size:`xs`,class:F({chosen:r.stt_provider===e.id}),"aria-pressed":r.stt_provider===e.id,onClick:t=>T(e.id)},null,8,[`label`,`class`,`aria-pressed`,`onClick`]))),128))])]),J(`p`,{class:`fine-print speech-note`,title:g.value.note},I(g.value.note),9,mU),J(`div`,hU,[t[28]||=J(`span`,null,`密钥`,-1),g.value.local?(G(),q(b,{key:0,disabled:``,placeholder:r.stt_key_ref?`已由安装技能配置,无需填写`:`尚未安装:让本机 AI 按 local-stt-setup 技能安装`,"aria-label":`本机语音识别令牌`,size:`sm`,class:`w-full`},null,8,[`placeholder`])):_.value?(G(),q(b,{key:1,modelValue:u[_.value.id],"onUpdate:modelValue":t[13]||=e=>u[_.value.id]=e,type:`text`,autocomplete:`off`,spellcheck:`false`,"data-1p-ignore":``,"data-lpignore":`true`,placeholder:r.providers[_.value.id]?.api_key_ref?bU:`粘贴${_.value.label} API Key`,title:r.providers[_.value.id]?.api_key_ref&&!u[_.value.id]?`已保存;本机不回传密钥,输入新 Key 可更换`:void 0,"aria-label":`语音输入的${_.value.label} API Key`,size:`sm`,class:`w-full`,loading:s.value===`key:${_.value.id}`,ui:{base:d[_.value.id]?``:`speech-key-masked`,trailing:`pe-0.5`},onChange:t[14]||=e=>j(_.value)},{trailing:z(()=>[Y(y,{icon:d[_.value.id]?`i-lucide-eye`:`i-lucide-eye-off`,disabled:!u[_.value.id],"aria-label":d[_.value.id]?`隐藏密钥`:`显示密钥`,"aria-pressed":!!d[_.value.id],size:`xs`,color:`neutral`,variant:`link`,onClick:t[12]||=e=>d[_.value.id]=!d[_.value.id]},null,8,[`icon`,`disabled`,`aria-label`,`aria-pressed`])]),_:1},8,[`modelValue`,`placeholder`,`title`,`aria-label`,`loading`,`ui`])):(G(),q(b,{key:2,disabled:``,placeholder:`与朗读共用上方的${g.value.label} Key`,"aria-label":`语音输入的${g.value.label} API Key`,size:`sm`,class:`w-full`},null,8,[`placeholder`,`aria-label`]))]),J(`div`,gU,[t[29]||=J(`span`,null,`本机进程`,-1),J(`div`,_U,[J(`span`,{class:F([`speech-process-state`,v.value.stt?.state]),title:x(`stt`)},I(x(`stt`)),11,vU),v.value.stt?.state===`running`?(G(),q(y,{key:0,icon:`i-lucide-power`,"aria-label":`强行停止本机语音识别服务`,title:`强行停止本机语音识别服务(连同子进程)`,color:`error`,variant:`ghost`,size:`sm`,loading:s.value===`stop:stt`,disabled:!!s.value,onClick:t[15]||=e=>S(`stt`)},null,8,[`loading`,`disabled`])):Z(``,!0)])])],64)):(G(),K(`p`,yU,`正在读取语音设置…`))])]),default:z(()=>[J(`button`,{type:`button`,class:`speech-header`,"aria-expanded":f.value},[t[17]||=J(`h3`,null,`语音`,-1),t[18]||=J(`small`,null,`朗读与语音输入`,-1),J(`span`,{class:F({"is-ready":r.api_key_ref})},I(h.value),3),Y(l,{name:f.value?`i-lucide-chevron-up`:`i-lucide-chevron-down`},null,8,[`name`])],8,GH)]),_:1},8,[`open`])])}}},[[`__scopeId`,`data-v-a08ccc7e`]]),EU={class:`channel-reading-setting`},DU=[`aria-expanded`],OU={class:`weixin-settings`},kU={key:0,class:`fine-print`},AU=[`innerHTML`],jU={key:1,class:`fine-print weixin-warning`},MU={key:2,class:`fine-print weixin-warning`},NU={class:`weixin-actions`},PU=rO({__name:`WeixinSettings`,setup(e){let{bridge:t}=Dr(`discussion`),n=L(null),r=L(``),i=L(``),a=L(!1),o=L(``),s=!1,c=$(()=>r.value?`需连接本机服务`:n.value?n.value.bound?n.value.context_ready?`已绑定`:`已绑定 · 待你发一条消息`:`未绑定`:`读取中…`);async function l(e){return t.local_request(`weixin`,{action:e})}ia(async()=>{try{n.value=await l(`status`)}catch(e){r.value=e.message}}),sa(()=>{s=!1});async function u(){i.value=`bind`;try{let e=await l(`login`);for(o.value=JV(e.qr_content,{border:1}),s=!0;s;){let e=await l(`complete`);if(e.status===`connected`){n.value=e,t.notify(`info`,`微信已绑定;请在微信里给机器人发一条消息,之后就能收到通知`);break}if(e.status!==`waiting`){t.notify(`warning`,e.status===`expired`?`二维码已过期,请重新绑定`:`微信未完成绑定(${e.status})`);break}}}catch(e){t.notify(`error`,e.message)}finally{s=!1,o.value=``,i.value=``}}async function d(e,r){i.value=e;try{n.value=await l(e),r&&t.notify(`info`,r)}catch(e){t.notify(`error`,e.message)}finally{i.value=``}}return(e,t)=>{let s=Ix,l=Zx,f=DI;return G(),K(`section`,EU,[Y(f,{open:a.value,"onUpdate:open":t[3]||=e=>a.value=e},{content:z(()=>[J(`div`,OU,[r.value?(G(),K(`p`,kU,`微信通知由这台电脑的本机服务收发,需要连接本机服务或已配对电脑:`+I(r.value),1)):n.value?(G(),K(W,{key:1},[t[7]||=J(`p`,{class:`fine-print`},`主持人声明 Goal 待你确认后,5 分钟内你没在房间回复,就发到微信;直接回复微信消息即作为你的发言发回该房间,引用某条通知回复则发回那条通知的房间。只转发文字,登录凭据只存这台电脑。`,-1),o.value?(G(),K(W,{key:0},[J(`div`,{class:`weixin-qr`,"aria-label":`微信绑定二维码`,innerHTML:o.value},null,8,AU),t[6]||=J(`p`,{class:`fine-print`},`用微信扫码并在手机上确认。`,-1)],64)):n.value.bound&&!n.value.context_ready?(G(),K(`p`,jU,`请先在微信里给机器人发一条任意消息:微信要求先收到你的消息,才能给你发通知。`)):Z(``,!0),n.value.last_error?(G(),K(`p`,MU,`上次失败:`+I(n.value.last_error),1)):Z(``,!0),J(`div`,NU,[n.value.bound?(G(),K(W,{key:1},[Y(l,{label:`发送测试`,icon:`i-lucide-send`,size:`sm`,color:`neutral`,variant:`outline`,loading:i.value===`test`,disabled:!!i.value,onClick:t[0]||=e=>d(`test`,`测试通知已发出`)},null,8,[`loading`,`disabled`]),Y(l,{label:`刷新状态`,icon:`i-lucide-refresh-cw`,size:`sm`,color:`neutral`,variant:`ghost`,loading:i.value===`status`,disabled:!!i.value,onClick:t[1]||=e=>d(`status`)},null,8,[`loading`,`disabled`]),Y(l,{label:`解除绑定`,size:`sm`,color:`neutral`,variant:`ghost`,loading:i.value===`unbind`,disabled:!!i.value,onClick:t[2]||=e=>d(`unbind`,`已解除微信绑定`)},null,8,[`loading`,`disabled`])],64)):(G(),q(l,{key:0,label:`扫码绑定`,icon:`i-lucide-qr-code`,size:`sm`,loading:i.value===`bind`,disabled:!!i.value,onClick:u},null,8,[`loading`,`disabled`]))])],64)):Z(``,!0)])]),default:z(()=>[J(`button`,{type:`button`,class:`weixin-header`,"aria-expanded":a.value},[t[4]||=J(`h3`,null,`微信通知`,-1),t[5]||=J(`small`,null,`Goal 等你确认时`,-1),J(`span`,{class:F({"is-ready":n.value?.context_ready})},I(c.value),3),Y(s,{name:a.value?`i-lucide-chevron-up`:`i-lucide-chevron-down`},null,8,[`name`])],8,DU)]),_:1},8,[`open`])])}}},[[`__scopeId`,`data-v-f5e3532d`]]),FU={key:0,class:`channel-archive-manager`},IU={class:`channel-archive-toolbar`},LU={key:0,class:`channel-archive-confirm channel-archive-bulk`,role:`alert`},RU={class:`channel-archive-results`},zU={key:0,class:`channel-archive-list`,"aria-label":`已存档房间列表`},BU={class:`channel-archive-row`},VU={class:`channel-archive-info`},HU=[`title`,`disabled`,`onClick`],UU={key:0},WU=[`datetime`],GU={class:`channel-archive-actions`},KU={key:0,class:`channel-archive-confirm channel-archive-bulk`,role:`alert`},qU={key:1,class:`channel-archive-empty`},JU={class:`fine-print`},YU={key:0,class:`fine-print`},XU={class:`dialog-actions`},ZU={class:`fine-print`},QU={class:`dialog-actions`},$U={key:0,class:`channel-folder-directories`},eW={class:`channel-folder-directory`},tW={key:1,class:`channel-folder-directories`},nW={class:`dialog-actions`},rW={class:`channel-management-target`},iW={key:0,class:`fine-print`},aW={key:1,class:`fine-print`},oW={class:`dialog-actions`},sW={key:5},cW={class:`theme-choices`},lW=[`aria-pressed`,`onClick`],uW={class:`theme-check`},dW={class:`channel-reading-setting`},fW={class:`channel-reading-options`,role:`group`,"aria-labelledby":`channel-reading-label`},pW={class:`channel-reading-setting`},mW={class:`channel-reading-options channel-effect-options`,role:`group`,"aria-labelledby":`channel-effects-label`},hW={class:`advanced-content`},gW={key:0,class:`fine-print`},_W={class:`advanced-content`},vW={class:`dialog-actions`},yW={key:8,class:`original-message`},bW={key:0,role:`alert`},xW={class:`original-meta`},SW={class:`fine-print`},CW={key:0,class:`channel-answer-summary`},wW={class:`message-prose`},TW={class:`message-prose`},EW=[`innerHTML`],DW={key:2,class:`grid gap-4 py-2`,role:`status`,"aria-label":`正在读取原文`},OW={__name:`WorkspaceDialogs`,props:Va({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=no(e,`modelValue`),r=no(e,`readingWidth`),i=no(e,`effects`),a=L(n.value);B(n,e=>{e&&(a.value=e)});let{view:o,bridge:s,act:c,pending:l}=Dr(`discussion`),u=$({get:()=>!!n.value,set:e=>{e||(n.value=``)}}),d={settings:`设置`,create:`新建房间`,folder:`新建文件夹`,"rename-folder":`编辑文件夹`,"delete-folder":`移除文件夹`,"archive-folder":`存档文件夹`,edit:`编辑议题`,message:`消息原文`};Object.assign(d,{rename:`重命名房间`,restore:`恢复房间`,delete:`删除房间`});let f={settings:`管理员账号与界面外观。`,create:`邀请 AI 一起协作;需要深入讨论时,可在创建时或之后随时开启。`,edit:`维护话题目标、背景与讨论默认上限。`,message:`保留作者、来源、提交人和引用关系。`};Object.assign(f,{rename:`名称变化不会影响讨论记录和阅读地址。`,restore:`移回讨论列表,保持当前讨论阶段。`,delete:`永久删除房间及其所有记录,无法撤销。`}),d.archives=`已存档房间`,f.archives=`查看记录、恢复房间或彻底删除。`;let p=$(()=>o.value.rooms.filter(e=>e.archived)),m=L(``),h=L(`all`),g=[{label:`全部房间`,value:`all`},{label:`有消息`,value:`messages`},{label:`无消息`,value:`empty`}],_=$(()=>x(o.value.rooms,{query:m.value,content:h.value})),v=L(null),y=L(!1),b=$(()=>p.value.find(e=>e.id===v.value));B(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=L(``),O=L(``),k=L(``),A=L([]);B(()=>[n.value,t.targetFolder?.id],()=>{let e=n.value===`rename-folder`,[r=``,...i]=e&&t.targetFolder?.directories||[];O.value=e&&t.targetFolder?.name||``,k.value=r,A.value=i});let j=$(()=>[`folder`,`rename-folder`,`delete-folder`,`archive-folder`].includes(a.value));B(()=>[n.value,t.targetRoom?.id],()=>{D.value=n.value===`rename`&&t.targetRoom?.title||``});async function M(){let e={id:t.targetRoom.id,action:n.value,title:D.value};n.value=``,await c(`manage_channel`,e)}function N(){let[e=``,...t]=A.value;k.value=e,A.value=t}async function ee(){let e=O.value.trim();if(!e||l.value)return;let r=n.value===`rename-folder`,i=k.value.trim(),a=i?[i,...A.value.map(e=>e.trim()).filter(Boolean)]:[],o=r?{id:t.targetFolder.id,name:e,directories:a}:{name:e,directories:a};n.value=``,await c(r?`rename_folder`:`create_folder`,o)}let te=$(()=>o.value.rooms.filter(e=>!e.archived&&t.targetFolder?.id&&e.folder_id===t.targetFolder.id));async function P(e){let r=t.targetFolder.id,i=e?te.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=te.value;n.value=``;for(let t of e)await c(`manage_channel`,{id:t.id,action:`archive`})}let re=L(!1),ie=L(null),ae=$(()=>[`active`,`paused`].includes(o.value.room?.session?.status)),oe=L(null),se=L(null),ce=L(null),le=L(``),ue=0,de=null;sa(()=>{ue++});let fe=[{value:`channel`,title:`协作频道`,description:`深灰界面 · 房间导航 · 成员侧栏`},{value:`channel-light`,title:`协作频道 · 浅色`,description:`纯白界面 · 中性灰阶 · 清晰阅读`}];function pe(e){return`topic-${e}-${e===`host`?`select`:`input`}`}async function me(){ie.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 he(e){oe.value=e,n.value=``}function ge(){oe.value&&=(s.theme(oe.value),null)}function _e(e){let t=e.target.closest(`[data-preview-attachment]`);t&&(e.stopPropagation(),se.value={...t.dataset,room_id:t.dataset.attachmentRoom,id:t.dataset.previewAttachment},n.value=``)}function ve(){if(ge(),!se.value)return;let e=se.value;se.value=null,c(`preview_attachment`,e)}B(()=>[n.value,t.detailId,o.value.room?.id],([e,t])=>{ue++,e===`message`&&t&&o.value.room&&ye(t)});async function ye(e){let t=++ue,n=o.value.room.id;de=e,ce.value=null,le.value=``;try{let r=await s.request(`/api/rooms/${n}/messages/${e}`);t===ue&&(ce.value=r)}catch(e){t===ue&&(le.value=e.message)}}function be(){ye(ce.value.reply_to)}let xe=e=>e.preventDefault();return(t,b)=>{let x=WD,oe=$D,se=Zx,ue=RD,ge=Ix,Se=zD,Ce=DI,we=VD,Te=BD,Ee=LD,De=va(`keep-reading`);return G(),q(Ee,{open:u.value,"onUpdate:open":b[25]||=e=>u.value=e,title:d[a.value]||`讨论`,description:f[a.value],ui:{content:[`glass-panel studio-modal`,j.value&&`channel-folder-modal`,[`rename`,`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:xe},"onAfter:leave":ve},{body:z(()=>[a.value===`archives`?(G(),K(`section`,FU,[J(`div`,IU,[Y(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`]),Y(oe,{modelValue:h.value,"onUpdate:modelValue":b[1]||=e=>h.value=e,items:g,icon:`i-lucide-list-filter`,"aria-label":`筛选房间内容`},null,8,[`modelValue`]),Y(se,{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?(G(),K(`div`,LU,[J(`span`,null,`将永久删除当前列表中的 `+I(_.value.length)+` 个房间及其全部记录,无法撤销。`,1),Y(se,{label:`取消`,color:`neutral`,variant:`ghost`,size:`xs`,onClick:b[3]||=e=>y.value=!1}),Y(se,{label:`全部删除`,color:`error`,size:`xs`,onClick:E})])):Z(``,!0),wr((G(),K(`div`,RU,[_.value.length?(G(),K(`ul`,zU,[(G(!0),K(W,null,H(_.value,e=>(G(),K(`li`,{key:e.id,class:`channel-archive-item`},[J(`div`,BU,[J(`div`,VU,[J(`button`,{class:`channel-archive-title`,title:e.title,disabled:!!R(l),onClick:t=>w(e)},I(e.title),9,HU),J(`small`,null,[e.created_at?(G(),K(`span`,UU,[b[26]||=X(`创建于 `,-1),J(`time`,{datetime:e.created_at},I(S(e.created_at)),9,WU),b[27]||=X(` · `,-1)])):Z(``,!0),X(I(e.message_count)+` 条消息`,1)])]),J(`div`,GU,[Y(se,{"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`]),Y(se,{label:`恢复`,"aria-label":`恢复 ${e.title}`,color:`neutral`,variant:`soft`,size:`xs`,class:`channel-archive-restore`,disabled:C(e),onClick:t=>R(c)(`manage_channel`,{id:e.id,action:`restore`})},null,8,[`aria-label`,`disabled`,`onClick`])])]),v.value===e.id?(G(),K(`div`,KU,[J(`span`,null,`永久删除「`+I(e.title)+`」及其全部记录,无法撤销。`,1),Y(se,{label:`取消`,color:`neutral`,variant:`ghost`,size:`xs`,onClick:b[4]||=e=>v.value=null}),Y(se,{label:`删除`,color:`error`,size:`xs`,disabled:C(e),onClick:T},null,8,[`disabled`])])):Z(``,!0)]))),128))])):(G(),K(`p`,qU,I(p.value.length?`没有匹配的存档房间`:`暂无已存档房间`),1))])),[[De]])])):a.value===`delete-folder`?(G(),K(`form`,{key:1,class:`dialog-form`,onSubmit:b[7]||=nl(e=>P(!1),[`prevent`])},[J(`p`,JU,`仅移除「`+I(e.targetFolder?.name)+`」时,房间变为未分组,所有消息和存档状态都会保留。`,1),te.value.length?(G(),K(`p`,YU,`也可以连同其中的 `+I(te.value.length)+` 个房间一起永久删除,无法撤销。`,1)):Z(``,!0),J(`div`,XU,[Y(se,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:b[5]||=e=>n.value=``}),te.value.length?(G(),q(se,{key:0,label:`连同 ${te.value.length} 个房间删除`,color:`error`,variant:`soft`,onClick:b[6]||=e=>P(!0)},null,8,[`label`])):Z(``,!0),Y(se,{type:`submit`,label:`仅移除文件夹`,color:`neutral`,variant:`solid`})])],32)):a.value===`archive-folder`?(G(),K(`form`,{key:2,class:`dialog-form`,onSubmit:nl(ne,[`prevent`])},[J(`p`,ZU,`存档「`+I(e.targetFolder?.name)+`」中的 `+I(te.value.length)+` 个房间,文件夹保留。存档后可在侧栏「已存档」中查阅与恢复;尚未收束的讨论会暂停。`,1),J(`div`,QU,[Y(se,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:b[8]||=e=>n.value=``}),Y(se,{type:`submit`,label:`存档全部房间`,color:`primary`})])],32)):j.value?(G(),K(`form`,{key:3,class:`dialog-form`,onSubmit:nl(ee,[`prevent`])},[Y(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:!!R(l),onKeydown:b[10]||=rl(nl(e=>!e.isComposing&&ee(),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`readonly`]),[`folder`,`rename-folder`].includes(a.value)?(G(),q(ue,{key:0,label:`项目路径(可选)`,description:`在此文件夹中新建对话时自动带入,已有对话不受影响。`},{default:z(()=>[R(o).launch.available?(G(),K(`div`,$U,[J(`div`,eW,[Y(Dz,{modelValue:k.value,"onUpdate:modelValue":b[11]||=e=>k.value=e,compact:``,placeholder:`主目录的完整路径,或选择项目`,disabled:!!R(l)},xa({_:2},[k.value.trim()?{name:`badge`,fn:z(()=>[b[28]||=J(`span`,{class:`channel-folder-primary`},`主目录`,-1)]),key:`0`}:void 0]),1032,[`modelValue`,`disabled`]),Y(se,{icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`移除主目录 ${k.value}`,class:F({invisible:!k.value.trim()}),disabled:!!R(l),onClick:N},null,8,[`aria-label`,`class`,`disabled`])]),k.value.trim()?(G(),q(Mz,{key:0,modelValue:A.value,"onUpdate:modelValue":b[12]||=e=>A.value=e,disabled:!!R(l)},null,8,[`modelValue`,`disabled`])):Z(``,!0)])):(G(),K(`div`,tW,[(G(!0),K(W,null,H([k.value,...A.value].filter(Boolean),e=>(G(),K(`code`,{key:e,class:`channel-folder-path`},I(e),1))),128)),b[29]||=J(`p`,{class:`fine-print`},`项目路径须在电脑上或已连接电脑的网页中设置。`,-1)]))]),_:1})):Z(``,!0),J(`div`,nW,[Y(se,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:b[13]||=e=>n.value=``}),Y(se,{type:`submit`,label:a.value===`folder`?`创建文件夹`:`保存`,class:`channel-primary-button`,loading:R(l)===`create_folder`||R(l)===`rename_folder`,disabled:!O.value.trim()||!!R(l)},null,8,[`label`,`loading`,`disabled`])])],32)):[`rename`,`restore`,`delete`].includes(a.value)?(G(),K(`form`,{key:4,class:`dialog-form`,onSubmit:nl(M,[`prevent`])},[J(`p`,rW,[X(I(e.targetRoom?.title)+` `,1),J(`span`,null,`· `+I(e.targetRoom?.message_count)+` 条消息`,1)]),a.value===`restore`?(G(),K(`p`,iW,`恢复不会自动继续讨论;需要继续时,在主持设置中调整阶段。`)):Z(``,!0),a.value===`delete`?(G(),K(`p`,aW,`消息、共识和发言安排将一起删除,无法撤销。`)):Z(``,!0),a.value===`rename`?(G(),q(ue,{key:2,label:`房间名称`,required:``},{default:z(()=>[Y(x,{modelValue:D.value,"onUpdate:modelValue":b[14]||=e=>D.value=e,autofocus:``,maxlength:80,required:``,class:`w-full`,autocomplete:`off`},null,8,[`modelValue`])]),_:1})):Z(``,!0),J(`div`,oW,[Y(se,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:b[15]||=e=>n.value=``}),Y(se,{type:`submit`,label:a.value===`delete`?`永久删除`:a.value===`rename`?`保存名称`:d[a.value],color:a.value===`delete`?`error`:`primary`,loading:R(l)===`manage_channel`,disabled:a.value===`rename`&&!D.value.trim()},null,8,[`label`,`color`,`loading`,`disabled`])])],32)):a.value===`settings`?(G(),K(`div`,sW,[Y(VH),b[34]||=J(`h3`,{class:`account-appearance-heading`},`外观`,-1),J(`div`,cW,[(G(),K(W,null,H(fe,e=>J(`button`,{key:e.value,class:F({chosen:R(o).theme===e.value}),"aria-pressed":R(o).theme===e.value,onClick:t=>he(e.value)},[J(`span`,{class:F([`theme-preview`,e.value]),"aria-hidden":`true`},[...b[30]||=[J(`i`,{class:`theme-preview-side`},null,-1),J(`i`,{class:`theme-preview-main`},[J(`b`),J(`b`),J(`b`)],-1)]],2),J(`span`,null,[J(`strong`,null,I(e.title),1),J(`small`,null,I(e.description),1)]),J(`span`,uW,[R(o).theme===e.value?(G(),q(ge,{key:0,name:`i-lucide-check`})):Z(``,!0)])],10,lW)),64))]),J(`section`,dW,[b[31]||=J(`h3`,{id:`channel-reading-label`},`对话宽度`,-1),J(`div`,fW,[(G(!0),K(W,null,H(e.readingOptions,e=>(G(),q(se,{key:e.value,label:e.label,color:`neutral`,variant:`ghost`,class:F({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))])]),J(`section`,pW,[b[32]||=J(`h3`,{id:`channel-effects-label`},`视觉效果`,-1),J(`div`,mW,[(G(!0),K(W,null,H(e.effectOptions,e=>(G(),q(se,{key:e.value,label:e.label,color:`neutral`,variant:`ghost`,class:F({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[33]||=J(`p`,{class:`fine-print`},`精简模式关闭毛玻璃模糊与多层阴影,适合配置较低或需要更流畅滚动的设备。`,-1)]),Y(TU),Y(PU)])):a.value===`create`?(G(),q(rV,{key:6,"target-folder":e.targetFolder,onSubmit:me,onCancel:b[16]||=e=>n.value=``},null,8,[`target-folder`])):a.value===`edit`?(G(),K(`form`,{key:7,class:`dialog-form`,onSubmit:nl(me,[`prevent`])},[Y(ue,{label:`话题名称`,required:``},{default:z(()=>[Y(x,{"model-value":R(o).fields[pe(`title`)],maxlength:80,required:``,placeholder:`这次想讨论什么?`,class:`w-full`,"onUpdate:modelValue":b[17]||=e=>R(s).write_field(pe(`title`),e)},null,8,[`model-value`])]),_:1}),Y(ue,{label:`讨论目标`},{default:z(()=>[Y(Se,{"model-value":R(o).fields[pe(`goal`)],maxlength:1e3,rows:2,placeholder:`希望通过讨论解决的问题`,class:`w-full`,"onUpdate:modelValue":b[18]||=e=>R(s).write_field(pe(`goal`),e)},null,8,[`model-value`])]),_:1}),a.value===`edit`?(G(),q(ue,{key:0,label:`当前焦点`},{default:z(()=>[Y(x,{"model-value":R(o).fields[pe(`focus`)],maxlength:1e3,placeholder:`当前最需要回应的问题`,class:`w-full`,"onUpdate:modelValue":b[19]||=e=>R(s).write_field(pe(`focus`),e)},null,8,[`model-value`])]),_:1})):Z(``,!0),J(`section`,hW,[b[35]||=J(`h3`,null,`讨论上限`,-1),Y(hO,{ref_key:`topic_limits`,ref:ie,rounds:Number(R(o).fields[pe(`limit-max_rounds`)]),minutes:Number(R(o).fields[pe(`limit-max_minutes`)]),disabled:ae.value,"onUpdate:rounds":b[20]||=e=>R(s).write_field(pe(`limit-max_rounds`),String(e)),"onUpdate:minutes":b[21]||=e=>R(s).write_field(pe(`limit-max_minutes`),String(e))},null,8,[`rounds`,`minutes`,`disabled`]),ae.value?(G(),K(`p`,gW,`讨论未结束时,上限不可在此修改。`)):Z(``,!0)]),Y(Ce,{open:re.value,"onUpdate:open":b[22]||=e=>re.value=e,class:`advanced-fields`},{content:z(()=>[J(`div`,_W,[(G(),K(W,null,H([{key:`user_request`,label:`用户原文`},{key:`background`,label:`背景`},{key:`boundaries`,label:`讨论边界`}],e=>Y(ue,{key:e.key,label:e.label},{default:z(()=>[Y(Se,{"model-value":R(o).fields[pe(e.key)],maxlength:4e3,rows:2,class:`w-full`,"onUpdate:modelValue":t=>R(s).write_field(pe(e.key),t)},null,8,[`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`label`])),64))])]),default:z(()=>[Y(se,{"trailing-icon":re.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`]),J(`div`,vW,[Y(se,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:b[23]||=e=>n.value=``}),Y(se,{type:`submit`,class:`channel-primary-button`,label:`保存议题`,loading:R(l)===`create`||R(l)===`save_topic`},null,8,[`loading`])])],32)):a.value===`message`?(G(),K(`div`,yW,[le.value?(G(),K(`p`,bW,[X(I(le.value),1),Y(se,{label:`重试`,color:`neutral`,variant:`link`,size:`xs`,onClick:b[24]||=e=>ye(R(de))})])):ce.value?(G(),K(W,{key:1},[J(`div`,xW,[J(`strong`,null,I(R(s).display_name(ce.value.author)),1),J(`span`,null,`#`+I(ce.value.id),1),Y(we,{color:`neutral`,variant:`subtle`},{default:z(()=>[X(I(R(s).sources[ce.value.source]),1)]),_:1})]),J(`p`,SW,I(R(s).provenance(ce.value))+` · `+I(new Date(ce.value.created_at).toLocaleString(`zh-CN`)),1),ce.value.summary?(G(),K(`section`,CW,[J(`small`,null,`回答摘要 · `+I(R(s).display_name(ce.value.summary_by)),1),J(`p`,wW,I(ce.value.summary),1)])):Z(``,!0),J(`p`,TW,I(ce.value.text),1),ce.value.attachments?.length?(G(),K(`div`,{key:1,onClick:_e,innerHTML:R(s).attachment_markup(ce.value.attachments)},null,8,EW)):Z(``,!0),ce.value.reply_to?(G(),q(se,{key:2,label:`查看被回复的原文 #${ce.value.reply_to}`,icon:`i-lucide-corner-up-left`,variant:`outline`,color:`neutral`,class:`channel-surface-button`,onClick:be},null,8,[`label`])):Z(``,!0)],64)):(G(),K(`div`,DW,[Y(Te,{class:`h-5 w-36`}),(G(),K(W,null,H(6,e=>Y(Te,{key:e,class:F([`h-4`,e%3?`w-full`:`w-2/3`])},null,8,[`class`])),64))]))])):Z(``,!0)]),_:1},8,[`open`,`title`,`description`,`ui`,`content`])}}},kW={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`}},AW=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=Ia(),a=py(`navigationMenu`,n),o=Od(),s=my($(()=>({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=my(bd(a,`collapsible`,`disabled`,`type`,`unmountOnHide`),r),l=On(()=>a.content),u=On(()=>Md(typeof a.tooltip==`boolean`?{}:a.tooltip,{...a.orientation===`vertical`&&{delayDuration:0,content:{side:`right`}}})),d=On(()=>Md(typeof a.popover==`boolean`?{}:a.popover,{mode:`hover`,content:{side:`right`,align:`start`,alignOffset:2}})),[f,p]=Td(),[m,h]=Td({props:{item:Object,index:Number,level:Number,listIndex:Number}}),g=$(()=>Fx({extend:kW,...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})),_=$(()=>a.items?.length?Wd(a.items)?a.items:[a.items]:[]);function v(e,t,n,r){let i=_.value.length>1?`group-${r}-`:``;return zd(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)=>(G(),K(W,null,[Y(R(f),null,{default:z(({item:t,active:n,index:r,trailingTrigger:s})=>[U(e.$slots,t.slot||`item`,{item:t,index:r,active:n,ui:g.value},()=>[U(e.$slots,t.slot?`${t.slot}-leading`:`item-leading`,{item:t,active:n,index:r,ui:g.value},()=>[t.avatar?(G(),q(Bx,Q({key:0,size:t.ui?.linkLeadingAvatarSize||R(a).ui?.linkLeadingAvatarSize||g.value.linkLeadingAvatarSize()},t.avatar,{"data-slot":`linkLeadingAvatar`,class:g.value.linkLeadingAvatar({class:[R(a).ui?.linkLeadingAvatar,t.ui?.linkLeadingAvatar],active:n,disabled:!!t.disabled})}),null,16,[`size`,`class`])):t.icon&&t.chip?(G(),q(zx,Q({key:1,size:t.ui?.linkLeadingChipSize||R(a).ui?.linkLeadingChipSize||g.value.linkLeadingChipSize(),inset:``},typeof t.chip==`object`?t.chip:{},{"data-slot":`linkLeadingChip`}),{default:z(()=>[Y(Ix,{name:t.icon,"data-slot":`linkLeadingIcon`,class:F(g.value.linkLeadingIcon({class:[R(a).ui?.linkLeadingIcon,t.ui?.linkLeadingIcon],active:n,disabled:!!t.disabled}))},null,8,[`name`,`class`])]),_:2},1040,[`size`])):t.icon?(G(),q(Ix,{key:2,name:t.icon,"data-slot":`linkLeadingIcon`,class:F(g.value.linkLeadingIcon({class:[R(a).ui?.linkLeadingIcon,t.ui?.linkLeadingIcon],active:n,disabled:!!t.disabled}))},null,8,[`name`,`class`])):Z(``,!0)]),R(zd)(t,R(a).labelKey)||i[t.slot?`${t.slot}-label`:`item-label`]?(G(),K(`span`,{key:0,"data-slot":`linkLabel`,class:F(g.value.linkLabel({class:[R(a).ui?.linkLabel,t.ui?.linkLabel]}))},[U(e.$slots,t.slot?`${t.slot}-label`:`item-label`,{item:t,active:n,index:r},()=>[X(I(R(zd)(t,R(a).labelKey)),1)]),t.target===`_blank`&&R(a).externalIcon!==!1?(G(),q(Ix,{key:0,name:typeof R(a).externalIcon==`string`?R(a).externalIcon:R(o).ui.icons.external,"data-slot":`linkLabelExternalIcon`,class:F(g.value.linkLabelExternalIcon({class:[R(a).ui?.linkLabelExternalIcon,t.ui?.linkLabelExternalIcon],active:n}))},null,8,[`name`,`class`])):Z(``,!0)],2)):Z(``,!0),t.badge||t.badge===0||R(a).orientation===`horizontal`&&(t.children?.length||i[t.slot?`${t.slot}-content`:`item-content`])||R(a).orientation===`vertical`&&t.children?.length||t.trailingIcon||i[t.slot?`${t.slot}-trailing`:`item-trailing`]?(G(),q(_a(R(a).orientation===`vertical`&&t.children?.length&&!R(a).collapsed&&s?R(jp):`span`),{key:1,as:R(a).orientation===`vertical`&&t.children?.length&&!R(a).collapsed&&s?`span`:void 0,"data-slot":`linkTrailing`,class:F(g.value.linkTrailing({class:[R(a).ui?.linkTrailing,t.ui?.linkTrailing]})),onClick:e=>b(e,t,s)},{default:z(()=>[U(e.$slots,t.slot?`${t.slot}-trailing`:`item-trailing`,{item:t,active:n,index:r,ui:g.value},()=>[t.badge||t.badge===0?(G(),q(VD,Q({key:0,color:`neutral`,variant:`outline`,size:t.ui?.linkTrailingBadgeSize||R(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:[R(a).ui?.linkTrailingBadge,t.ui?.linkTrailingBadge]})}),null,16,[`size`,`class`])):Z(``,!0),R(a).orientation===`horizontal`&&(t.children?.length||i[t.slot?`${t.slot}-content`:`item-content`])||R(a).orientation===`vertical`&&t.children?.length?(G(),q(Ix,{key:1,name:t.trailingIcon||R(a).trailingIcon||R(o).ui.icons.chevronDown,"data-slot":`linkTrailingIcon`,class:F(g.value.linkTrailingIcon({class:[R(a).ui?.linkTrailingIcon,t.ui?.linkTrailingIcon],active:n}))},null,8,[`name`,`class`])):t.trailingIcon?(G(),q(Ix,{key:2,name:t.trailingIcon,"data-slot":`linkTrailingIcon`,class:F(g.value.linkTrailingIcon({class:[R(a).ui?.linkTrailingIcon,t.ui?.linkTrailingIcon],active:n}))},null,8,[`name`,`class`])):Z(``,!0)])]),_:2},1032,[`as`,`class`,`onClick`])):Z(``,!0)])]),_:3}),Y(R(m),null,{default:z(({item:t,index:n,level:r=0,listIndex:s=0})=>[(G(),q(_a(R(a).orientation===`vertical`&&!R(a).collapsed?R(Ire):R(xse)),Q({as:`li`},R(a).orientation===`vertical`&&!R(a).collapsed?{disabled:!!t.disabled}:{},{value:v(t,n,r,s)}),{default:z(()=>[R(a).orientation===`vertical`&&t.type===`label`&&!R(a).collapsed?(G(),K(`div`,{key:0,"data-slot":`label`,class:F(g.value.label({class:[R(a).ui?.label,t.ui?.label,t.class]}))},[Y(R(p),{item:t,index:n,"trailing-trigger":!0},null,8,[`item`,`index`])],2)):t.type===`label`?Z(``,!0):(G(),q(Xx,Q({key:1},R(a).orientation===`vertical`&&t.children?.length&&!R(a).collapsed&&t.type===`trigger`?{}:R(Jx)(t),{custom:``}),{default:z(({active:s,...c})=>[(G(),q(_a(R(a).orientation===`horizontal`&&(t.children?.length||i[t.slot?`${t.slot}-content`:`item-content`])?R(f_):R(a).orientation===`vertical`&&t.children?.length&&!R(a).collapsed&&!c.href?R(jp):R(l_)),{"as-child":``,active:s||t.active,disabled:t.disabled,onSelect:t.onSelect},{default:z(()=>[R(a).orientation===`vertical`&&R(a).collapsed&&t.children?.length&&(R(a).popover||t.popover)?(G(),q(XD,Q({key:0},{...d.value,...typeof t.popover==`boolean`?{}:t.popover||{}},{ui:{content:g.value.content({class:[R(a).ui?.content,t.ui?.content]})}}),{content:z(({close:r})=>[U(e.$slots,t.slot?`${t.slot}-content`:`item-content`,{item:t,active:s||t.active,index:n,ui:g.value,close:r},()=>[J(`ul`,{"data-slot":`childList`,class:F(g.value.childList({class:[R(a).ui?.childList,t.ui?.childList]}))},[J(`li`,{"data-slot":`childLabel`,class:F(g.value.childLabel({class:[R(a).ui?.childLabel,t.ui?.childLabel]}))},I(R(zd)(t,R(a).labelKey)),3),(G(!0),K(W,null,H(t.children,(e,n)=>(G(),K(`li`,{key:n,"data-slot":`childItem`,class:F(g.value.childItem({class:[R(a).ui?.childItem,t.ui?.childItem]}))},[Y(Xx,Q({ref_for:!0},R(Jx)(e),{custom:``}),{default:z(({active:n,...r})=>[Y(R(l_),{"as-child":``,active:n,onSelect:e.onSelect},{default:z(()=>[Y(Yx,Q({ref_for:!0},r,{"data-slot":`childLink`,class:g.value.childLink({class:[R(a).ui?.childLink,t.ui?.childLink,e.class],active:n})}),{default:z(()=>[e.icon?(G(),q(Ix,{key:0,name:e.icon,"data-slot":`childLinkIcon`,class:F(g.value.childLinkIcon({class:[R(a).ui?.childLinkIcon,t.ui?.childLinkIcon],active:n}))},null,8,[`name`,`class`])):Z(``,!0),J(`span`,{"data-slot":`childLinkLabel`,class:F(g.value.childLinkLabel({class:[R(a).ui?.childLinkLabel,t.ui?.childLinkLabel],active:n}))},[X(I(R(zd)(e,R(a).labelKey))+` `,1),e.target===`_blank`&&R(a).externalIcon!==!1?(G(),q(Ix,{key:0,name:typeof R(a).externalIcon==`string`?R(a).externalIcon:R(o).ui.icons.external,"data-slot":`childLinkLabelExternalIcon`,class:F(g.value.childLinkLabelExternalIcon({class:[R(a).ui?.childLinkLabelExternalIcon,t.ui?.childLinkLabelExternalIcon],active:n}))},null,8,[`name`,`class`])):Z(``,!0)],2)]),_:2},1040,[`class`])]),_:2},1032,[`active`,`onSelect`])]),_:2},1040)],2))),128))],2)])]),default:z(()=>[Y(Yx,Q(c,{"data-slot":`link`,class:g.value.link({class:[R(a).ui?.link,t.ui?.link,t.class],active:s||t.active,disabled:!!t.disabled,level:r>0})}),{default:z(()=>[Y(R(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`])):R(a).orientation===`vertical`&&R(a).collapsed&&(R(a).tooltip||t.tooltip)||R(a).orientation===`horizontal`&&t.tooltip?(G(),q(JD,Q({key:1,text:R(zd)(t,R(a).labelKey)},{...u.value,...typeof t.tooltip==`boolean`?{}:t.tooltip||{}}),{default:z(()=>[Y(Yx,Q(c,{"data-slot":`link`,class:g.value.link({class:[R(a).ui?.link,t.ui?.link,t.class],active:s||t.active,disabled:!!t.disabled,level:r>0})}),{default:z(()=>[Y(R(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`])):(G(),q(Yx,Q({key:2},c,{"data-slot":`link`,class:g.value.link({class:[R(a).ui?.link,t.ui?.link,t.class],active:s||t.active,disabled:!!t.disabled,level:R(a).orientation===`horizontal`||r>0})}),{default:z(()=>[Y(R(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`])),R(a).orientation===`horizontal`&&(t.children?.length||i[t.slot?`${t.slot}-content`:`item-content`])?(G(),q(R(Cse),Q({key:0},l.value,{"data-slot":`content`,class:g.value.content({class:[R(a).ui?.content,t.ui?.content]})}),{default:z(()=>[U(e.$slots,t.slot?`${t.slot}-content`:`item-content`,{item:t,active:s||t.active,index:n,ui:g.value},()=>[J(`ul`,{"data-slot":`childList`,class:F(g.value.childList({class:[R(a).ui?.childList,t.ui?.childList]}))},[(G(!0),K(W,null,H(t.children,(e,n)=>(G(),K(`li`,{key:n,"data-slot":`childItem`,class:F(g.value.childItem({class:[R(a).ui?.childItem,t.ui?.childItem]}))},[Y(Xx,Q({ref_for:!0},R(Jx)(e),{custom:``}),{default:z(({active:n,...r})=>[Y(R(l_),{"as-child":``,active:n,onSelect:e.onSelect},{default:z(()=>[Y(Yx,Q({ref_for:!0},r,{"data-slot":`childLink`,class:g.value.childLink({class:[R(a).ui?.childLink,t.ui?.childLink,e.class],active:n})}),{default:z(()=>[e.icon?(G(),q(Ix,{key:0,name:e.icon,"data-slot":`childLinkIcon`,class:F(g.value.childLinkIcon({class:[R(a).ui?.childLinkIcon,t.ui?.childLinkIcon],active:n}))},null,8,[`name`,`class`])):Z(``,!0),J(`div`,{"data-slot":`childLinkWrapper`,class:F(g.value.childLinkWrapper({class:[R(a).ui?.childLinkWrapper,t.ui?.childLinkWrapper]}))},[J(`p`,{"data-slot":`childLinkLabel`,class:F(g.value.childLinkLabel({class:[R(a).ui?.childLinkLabel,t.ui?.childLinkLabel],active:n}))},[X(I(R(zd)(e,R(a).labelKey))+` `,1),e.target===`_blank`&&R(a).externalIcon!==!1?(G(),q(Ix,{key:0,name:typeof R(a).externalIcon==`string`?R(a).externalIcon:R(o).ui.icons.external,"data-slot":`childLinkLabelExternalIcon`,class:F(g.value.childLinkLabelExternalIcon({class:[R(a).ui?.childLinkLabelExternalIcon,t.ui?.childLinkLabelExternalIcon],active:n}))},null,8,[`name`,`class`])):Z(``,!0)],2),e.description?(G(),K(`p`,{key:0,"data-slot":`childLinkDescription`,class:F(g.value.childLinkDescription({class:[R(a).ui?.childLinkDescription,t.ui?.childLinkDescription],active:n}))},I(e.description),3)):Z(``,!0)],2)]),_:2},1040,[`class`])]),_:2},1032,[`active`,`onSelect`])]),_:2},1040)],2))),128))],2)])]),_:2},1040,[`class`])):Z(``,!0)]),_:2},1040)),R(a).orientation===`vertical`&&t.children?.length&&!R(a).collapsed?(G(),q(R(Lre),{key:2,"data-slot":`content`,class:F(g.value.content({class:[R(a).ui?.content,t.ui?.content]}))},{default:z(()=>[Y(R(Op),Q({...R(c),defaultValue:y(t.children,r+1,s)},{as:`ul`,"data-slot":`childList`,class:g.value.childList({class:[R(a).ui?.childList,t.ui?.childList]})}),{default:z(()=>[(G(!0),K(W,null,H(t.children,(e,t)=>(G(),q(R(h),{key:t,item:e,index:t,level:r+1,"list-index":s,"data-slot":`childItem`,class:F(g.value.childItem({class:[R(a).ui?.childItem,e.ui?.childItem]}))},null,8,[`item`,`index`,`level`,`list-index`,`class`]))),128))]),_:2},1040,[`class`])]),_:2},1032,[`class`])):Z(``,!0)]),_:2},1040,[`value`]))]),_:3}),Y(R(yse),Q({"data-slot":`root`},{...R(s),...R(a).orientation===`horizontal`?{modelValue:R(a).modelValue,defaultValue:R(a).defaultValue}:{},...e.$attrs},{"data-collapsed":R(a).collapsed,class:g.value.root({class:[R(a).ui?.root,R(a).class]})}),{default:z(()=>[U(e.$slots,`list-leading`),(G(!0),K(W,null,H(_.value,(e,t)=>(G(),K(W,{key:`list-${t}`},[(G(),q(_a(R(a).orientation===`vertical`?R(Op):R(u_)),Q({ref_for:!0},R(a).orientation===`vertical`&&!R(a).collapsed?{...R(c),modelValue:R(a).modelValue,defaultValue:R(a).defaultValue??y(e,0,t)}:{},{as:`ul`,"data-slot":`list`,class:g.value.list({class:R(a).ui?.list})}),{default:z(()=>[(G(!0),K(W,null,H(e,(e,n)=>(G(),q(R(h),{key:`list-${t}-${n}`,item:e,index:n,"list-index":t,"data-slot":`item`,class:F(g.value.item({class:[R(a).ui?.item,e.ui?.item]}))},null,8,[`item`,`index`,`list-index`,`class`]))),128))]),_:2},1040,[`class`])),R(a).orientation===`vertical`&&t<_.value.length-1?(G(),K(`div`,{key:0,"data-slot":`separator`,class:F(g.value.separator({class:R(a).ui?.separator}))},null,2)):Z(``,!0)],64))),128)),U(e.$slots,`list-trailing`),R(a).orientation===`horizontal`?(G(),K(`div`,{key:0,"data-slot":`viewportWrapper`,class:F(g.value.viewportWrapper({class:R(a).ui?.viewportWrapper}))},[R(a).arrow?(G(),q(R(c_),{key:0,"data-slot":`indicator`,class:F(g.value.indicator({class:R(a).ui?.indicator}))},{default:z(()=>[J(`div`,{"data-slot":`arrow`,class:F(g.value.arrow({class:R(a).ui?.arrow}))},null,2)]),_:1},8,[`class`])):Z(``,!0),Y(R(p_),{"data-slot":`viewport`,class:F(g.value.viewport({class:R(a).ui?.viewport}))},null,8,[`class`])],2)):Z(``,!0)]),_:3},16,[`data-collapsed`,`class`])],64))}}),jW={__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=Ia(),{dir:a}=Jd(),o=Od(),s=oy(On(()=>n.portal)),c=Rf(yd(n,`sub`,`items`,`portal`,`labelKey`,`descriptionKey`,`checkedIcon`,`loadingIcon`,`externalIcon`,`class`,`ui`,`uiOverride`),r),l=()=>Rd(i,[`default`]),[u,d]=Td(),f=$(()=>a.value===`rtl`?o.ui.icons.chevronLeft:o.ui.icons.chevronRight),p=$(()=>n.items?.length?Wd(n.items)?n.items:[n.items]:[]);return(t,r)=>(G(),K(W,null,[Y(R(u),null,{default:z(({item:r,active:a,index:s})=>[U(t.$slots,r.slot||`item`,{item:r,index:s,ui:e.ui},()=>[U(t.$slots,r.slot?`${r.slot}-leading`:`item-leading`,{item:r,active:a,index:s,ui:e.ui},()=>[r.loading?(G(),q(Ix,{key:0,name:e.loadingIcon||R(o).ui.icons.loading,"data-slot":`itemLeadingIcon`,class:F(e.ui.itemLeadingIcon({class:[e.uiOverride?.itemLeadingIcon,r.ui?.itemLeadingIcon],color:r?.color,loading:!0}))},null,8,[`name`,`class`])):r.icon?(G(),q(Ix,{key:1,name:r.icon,"data-slot":`itemLeadingIcon`,class:F(e.ui.itemLeadingIcon({class:[e.uiOverride?.itemLeadingIcon,r.ui?.itemLeadingIcon],color:r?.color,active:a}))},null,8,[`name`,`class`])):r.avatar?(G(),q(Bx,Q({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`])):Z(``,!0)]),R(zd)(r,n.labelKey)||i[r.slot?`${r.slot}-label`:`item-label`]||R(zd)(r,n.descriptionKey)||i[r.slot?`${r.slot}-description`:`item-description`]?(G(),K(`span`,{key:0,"data-slot":`itemWrapper`,class:F(e.ui.itemWrapper({class:[e.uiOverride?.itemWrapper,r.ui?.itemWrapper]}))},[J(`span`,{"data-slot":`itemLabel`,class:F(e.ui.itemLabel({class:[e.uiOverride?.itemLabel,r.ui?.itemLabel],active:a}))},[U(t.$slots,r.slot?`${r.slot}-label`:`item-label`,{item:r,active:a,index:s},()=>[X(I(R(zd)(r,n.labelKey)),1)]),r.target===`_blank`&&e.externalIcon!==!1?(G(),q(Ix,{key:0,name:typeof e.externalIcon==`string`?e.externalIcon:R(o).ui.icons.external,"data-slot":`itemLabelExternalIcon`,class:F(e.ui.itemLabelExternalIcon({class:[e.uiOverride?.itemLabelExternalIcon,r.ui?.itemLabelExternalIcon],color:r?.color,active:a}))},null,8,[`name`,`class`])):Z(``,!0)],2),R(zd)(r,n.descriptionKey)||i[r.slot?`${r.slot}-description`:`item-description`]?(G(),K(`span`,{key:0,"data-slot":`itemDescription`,class:F(e.ui.itemDescription({class:[e.uiOverride?.itemDescription,r.ui?.itemDescription]}))},[U(t.$slots,r.slot?`${r.slot}-description`:`item-description`,{item:r,active:a,index:s},()=>[X(I(R(zd)(r,n.descriptionKey)),1)])],2)):Z(``,!0)],2)):Z(``,!0),J(`span`,{"data-slot":`itemTrailing`,class:F(e.ui.itemTrailing({class:[e.uiOverride?.itemTrailing,r.ui?.itemTrailing]}))},[U(t.$slots,r.slot?`${r.slot}-trailing`:`item-trailing`,{item:r,active:a,index:s,ui:e.ui},()=>[r.children?.length?(G(),q(Ix,{key:0,name:f.value,"data-slot":`itemTrailingIcon`,class:F(e.ui.itemTrailingIcon({class:[e.uiOverride?.itemTrailingIcon,r.ui?.itemTrailingIcon],color:r?.color,active:a}))},null,8,[`name`,`class`])):r.kbds?.length?(G(),K(`span`,{key:1,"data-slot":`itemTrailingKbds`,class:F(e.ui.itemTrailingKbds({class:[e.uiOverride?.itemTrailingKbds,r.ui?.itemTrailingKbds]}))},[(G(!0),K(W,null,H(r.kbds,(t,n)=>(G(),q(GD,Q({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)):Z(``,!0)]),Y(R(HD).ItemIndicator,{"as-child":``},{default:z(()=>[Y(Ix,{name:e.checkedIcon||R(o).ui.icons.check,"data-slot":`itemTrailingIcon`,class:F(e.ui.itemTrailingIcon({class:[e.uiOverride?.itemTrailingIcon,r.ui?.itemTrailingIcon],color:r?.color}))},null,8,[`name`,`class`])]),_:2},1024)],2)])]),_:3}),Y(R(HD).Portal,Se(as(R(s))),{default:z(()=>[Y(R(Wx),null,{default:z(()=>[(G(),q(_a(e.sub?R(HD).SubContent:R(HD).Content),Q({"data-slot":`content`,class:e.ui.content({class:[e.uiOverride?.content,n.class]})},R(c)),{default:z(()=>[U(t.$slots,`content-top`,{sub:e.sub??!1}),J(`div`,{role:`presentation`,"data-slot":`viewport`,class:F(e.ui.viewport({class:e.uiOverride?.viewport}))},[(G(!0),K(W,null,H(p.value,(r,i)=>(G(),q(R(HD).Group,{key:`group-${i}`,"data-slot":`group`,class:F(e.ui.group({class:e.uiOverride?.group}))},{default:z(()=>[(G(!0),K(W,null,H(r,(r,a)=>(G(),K(W,{key:`group-${i}-${a}`},[r.type===`label`?(G(),q(R(HD).Label,{key:0,"data-slot":`label`,class:F(e.ui.label({class:[e.uiOverride?.label,r.ui?.label,r.class]}))},{default:z(()=>[Y(R(d),{item:r,index:a},null,8,[`item`,`index`])]),_:2},1032,[`class`])):r.type===`separator`?(G(),q(R(HD).Separator,{key:1,"data-slot":`separator`,class:F(e.ui.separator({class:[e.uiOverride?.separator,r.ui?.separator,r.class]}))},null,8,[`class`])):r?.children?.length?(G(),q(R(HD).Sub,{key:2,open:r.open,"default-open":r.defaultOpen},{default:z(()=>[Y(R(HD).SubTrigger,{as:`button`,type:`button`,disabled:r.disabled,"text-value":R(zd)(r,n.labelKey),"data-slot":`item`,class:F(e.ui.item({class:[e.uiOverride?.item,r.ui?.item,r.class],color:r?.color}))},{default:z(()=>[Y(R(d),{item:r,index:a},null,8,[`item`,`index`])]),_:2},1032,[`disabled`,`text-value`,`class`]),Y(jW,Q({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),xa({_:2},[H(l(),(e,n)=>({name:n,fn:z(e=>[U(t.$slots,n,Q({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`?(G(),q(R(HD).CheckboxItem,{key:3,"model-value":r.checked,disabled:r.disabled,"text-value":R(zd)(r,n.labelKey),"data-slot":`item`,class:F(e.ui.item({class:[e.uiOverride?.item,r.ui?.item,r.class],color:r?.color})),"onUpdate:modelValue":r.onUpdateChecked,onSelect:r.onSelect},{default:z(()=>[Y(R(d),{item:r,index:a},null,8,[`item`,`index`])]),_:2},1032,[`model-value`,`disabled`,`text-value`,`class`,`onUpdate:modelValue`,`onSelect`])):(G(),q(Xx,Q({key:4,ref_for:!0},R(Jx)(r),{custom:``}),{default:z(({active:t,...i})=>[Y(R(HD).Item,{"as-child":``,disabled:r.disabled,"text-value":R(zd)(r,n.labelKey),onSelect:r.onSelect},{default:z(()=>[Y(Yx,Q({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:z(()=>[Y(R(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),U(t.$slots,`default`),U(t.$slots,`content-bottom`,{sub:e.sub??!1})]),_:3},16,[`class`]))]),_:3})]),_:3},16)],64))}},MW={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`}},NW={__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=Ia(),a=py(`contextMenu`,n),o=Od(),s=my(bd(a,`modal`),r),c=On(()=>a.content),l=()=>Rd(i,[`default`]),u=$(()=>Fx({extend:MW,...o.ui?.contextMenu||{}})({size:a.size}));return(e,t)=>(G(),q(R(Vg),Se(as(R(s))),{default:z(()=>[i.default?(G(),q(R(Ug),{key:0,"as-child":``,disabled:R(a).disabled,class:F(R(a).class)},{default:z(()=>[U(e.$slots,`default`)]),_:3},8,[`disabled`,`class`])):Z(``,!0),Y(jW,Q({class:u.value.content({class:[!i.default&&R(a).class,R(a).ui?.content]}),ui:u.value,"ui-override":R(a).ui},c.value,{items:R(a).items,portal:R(a).portal,"label-key":R(a).labelKey,"description-key":R(a).descriptionKey,"checked-icon":R(a).checkedIcon,"loading-icon":R(a).loadingIcon,"external-icon":R(a).externalIcon}),xa({_:2},[H(l(),(t,n)=>({name:n,fn:z(t=>[U(e.$slots,n,Se(as(t)))])}))]),1040,[`class`,`ui`,`ui-override`,`items`,`portal`,`label-key`,`description-key`,`checked-icon`,`loading-icon`,`external-icon`])]),_:3},16))}},PW={key:0,class:`channel-import-reading`},FW={class:`channel-import-list`,"aria-live":`polite`},IW={class:`channel-import-head`},LW=[`title`],RW={key:0,role:`alert`,class:`channel-import-error`},zW={key:1,class:`channel-import-members`},BW=[`title`],VW={class:`dialog-actions`},HW=rO({__name:`ImportDialog`,props:{open:{type:Boolean,default:!1},openModifiers:{}},emits:[`update:open`],setup(e){let t=no(e,`open`),{view:n}=Dr(`discussion`),r=$(()=>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=$(()=>{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=Ix,s=Zx,c=LD;return G(),q(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:z(()=>[!r.value.done&&!r.value.rooms.length?(G(),K(`p`,PW,`正在读取备份文件…`)):Z(``,!0),J(`ul`,FW,[(G(!0),K(W,null,H(r.value.rooms,(e,t)=>(G(),K(`li`,{key:t,class:F([`channel-import-room`,`is-${e.status}`])},[J(`div`,IW,[Y(o,{name:i[e.status].icon,class:F({"animate-spin":e.status===`importing`})},null,8,[`name`,`class`]),J(`strong`,{title:e.title},I(e.title),9,LW),J(`span`,null,I(i[e.status].label),1)]),e.error?(G(),K(`p`,RW,I(e.error),1)):Z(``,!0),e.members.length?(G(),K(`ul`,zW,[(G(!0),K(W,null,H(e.members,e=>(G(),K(`li`,{key:e.name,class:F({"is-failed":e.failed})},[J(`span`,null,I(e.name),1),X(I(e.text)+` `,1),e.resume?(G(),K(`code`,{key:0,title:`没有开着的原窗口时,在 ${e.resume.cwd} 运行`},I(e.resume.command),9,BW)):Z(``,!0)],2))),128))])):Z(``,!0),(G(!0),K(W,null,H(e.problems,e=>(G(),K(`p`,{key:e,class:`channel-import-error`},I(e),1))),128))],2))),128))]),(G(!0),K(W,null,H(r.value.errors,e=>(G(),K(`p`,{key:e,role:`alert`,class:`channel-import-error is-file`},I(e),1))),128)),J(`div`,VW,[Y(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`]]),UW={class:`channel-directory-manager`},WW={class:`channel-directory-heading`},GW=[`aria-expanded`],KW={class:`channel-directory-actions`},qW={"aria-label":`协作房间列表`,class:`channel-room-list`,"data-room-directory":``},JW=[`data-room-folder`,`data-drag-folder`],YW=[`disabled`,`aria-label`,`aria-expanded`,`onKeydown`,`onClick`],XW={class:`channel-folder-name`},ZW={class:`channel-directory-count`,"aria-hidden":`true`},QW={class:`channel-folder-actions`},$W=[`data-drop-folder`],eG={key:0,class:`channel-directory-empty`,role:`status`},tG=[`data-drag-room`],nG=[`aria-label`,`disabled`,`onKeydown`],rG=[`title`,`aria-label`,`aria-current`,`onClick`],iG={class:`channel-room-time`,"aria-hidden":`true`},aG={key:0,class:`channel-room-running`,title:`正在执行`},oG={class:`channel-room-actions`},sG={key:0,class:`channel-directory-empty`},cG={key:0,class:`channel-archive-count`},lG=`ai-codiscuss-folders-expanded`,uG={__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}=Dr(`discussion`),{page_open:s}=Mk(),c=$(()=>r.value.rooms.filter(e=>!e.archived)),l=$(()=>r.value.rooms.filter(e=>e.archived).length),u=$(()=>(r.value.folder_groups||[]).map(e=>({...e,rooms:c.value.filter(t=>(t.folder_id||``)===e.id)}))),d=$(()=>r.value.directory_sort!==`recent`),f=$(()=>r.value.room_source||{}),p=$(()=>f.value.computer?f.value.signed_in?f.value.remote?f.value.online===!1?`协作房间(电脑离线)`:`协作房间`:f.value.online===!1?`协作房间(电脑离线)`:`协作房间(电脑未连接)`:`协作房间(未配对)`:`协作房间`),m=$(()=>[{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:()=>v(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:`全部房间`})}]),h=L(null),g=L(!1),_=null;function v(e){_=e,h.value?.click()}function y(e){let t=[...e.target.files];e.target.value=``,t.length&&(g.value=!0,a(`import_rooms`,{files:t,folder_id:_}))}function b(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 x(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(`
59
- `)}let S=$(()=>JSON.stringify([r.value.directory_pending,r.value.archive_pending,r.value.backup_pending,r.value.folders,r.value.room_site,d.value,r.value.room?.id,o.value,s.value,C.value])),C=$(()=>(r.value.room?.free?.members||[]).some(e=>[`dispatched`,`started`].includes(e.execution?.status)));function w(e,t,n){return{items:ee(e,t,e.folder_id||null,n),active:!s.value&&e.id===r.value.room?.id,busy:!!o.value,archiving:r.value.archive_pending.includes(e.id),time:b(e),title:x(e),running:e.id===r.value.room?.id?C.value:!!e.running}}function T(e,t){let n=e.id?A(e,t):[],i={items:n,collapsed:!k(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 E=L(!0),D=L(M()),O=L(``);B(()=>r.value.room?.id,(e,t)=>{t&&(O.value=r.value.room?.folder_id||``)});function k(e){return!e||D.value.has(e)||O.value===e}function A(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===u.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:()=>v(e.id||null)},j(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 j(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 M(){try{return new Set(JSON.parse(localStorage.getItem(lG)||`[]`))}catch{return new Set}}function N(e){let t=k(e),n=new Set(D.value);t?n.delete(e):n.add(e),t&&O.value===e&&(O.value=``),D.value=n;try{localStorage.setItem(lG,JSON.stringify([...n]))}catch{}}function ee(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||!d.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||!d.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 s=Zx,d=Ix,f=JD,_=qD,v=NW;return G(),K(`div`,UW,[Y(s,{label:`新建对话`,icon:`i-lucide-plus`,color:`neutral`,class:`channel-primary-button channel-new-conversation`,disabled:R(r).directory_pending.includes(`create-room`),onClick:t[0]||=e=>n(`create`,null)},null,8,[`disabled`]),J(`div`,WW,[J(`button`,{type:`button`,class:`channel-section-toggle`,"aria-expanded":E.value,onClick:t[1]||=e=>E.value=!E.value},[Y(d,{name:E.value?`i-lucide-chevron-down`:`i-lucide-chevron-right`},null,8,[`name`]),X(I(p.value),1)],8,GW),J(`div`,KW,[Y(f,{text:`新建文件夹`},{default:z(()=>[Y(s,{icon:`i-lucide-plus`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`新建文件夹`,disabled:R(r).directory_pending.includes(`create-folder`),onClick:t[2]||=e=>n(`create-folder`)},null,8,[`disabled`])]),_:1}),Y(_,{items:m.value,content:{align:`end`,sideOffset:4},ui:{content:`channel-menu channel-directory-menu`}},{default:z(()=>[Y(s,{icon:`i-lucide-ellipsis`,"aria-label":`房间目录选项`,title:`排列、导入与导出`,size:`xs`,color:`neutral`,variant:`ghost`})]),_:1},8,[`items`]),J(`input`,{ref_key:`import_input`,ref:h,type:`file`,accept:`.zip,.json`,multiple:``,hidden:``,"aria-label":`选择房间备份`,onChange:y},null,544)])]),wr(J(`nav`,qW,[(G(!0),K(W,null,H(u.value,(e,c)=>(G(),K(`section`,{key:e.order_id,class:`channel-folder-section`,"data-room-folder":e.id,"data-drag-folder":e.order_id},[(G(!0),K(W,null,H([T(e,c)],r=>(G(),K(W,{key:e.order_id},[e.id?(G(),q(R(qj),{key:0,deps:[r.key]},{default:z(()=>[J(`div`,{class:F([`channel-folder-row`,{active:r.collapsed&&r.active}])},[J(`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=>!R(o)&&R(i).start_drag(e),onKeydown:[rl(nl(t=>R(a)(`move_folder`,{id:e.order_id,direction:-1}),[`prevent`]),[`up`]),rl(nl(t=>R(a)(`move_folder`,{id:e.order_id,direction:1}),[`prevent`]),[`down`])],onClick:t=>N(e.id)},[Y(d,{name:r.collapsed?`i-lucide-chevron-right`:`i-lucide-chevron-down`},null,8,[`name`]),Y(d,{name:`i-lucide-folder`}),J(`span`,XW,I(e.name),1),J(`small`,ZW,I(e.pending?`保存中`:e.rooms.length||``),1)],40,YW),J(`div`,QW,[Y(f,{text:`在${e.name}中新建对话`},{default:z(()=>[Y(s,{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`]),Y(_,{items:r.items,content:{align:`start`,side:`bottom`,sideOffset:6},ui:{content:`channel-menu channel-topic-menu`}},{default:z(()=>[Y(s,{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`])):Z(``,!0)],64))),128)),k(e.id)?(G(),K(`div`,{key:0,class:F(e.id?`channel-folder-rooms`:`channel-root-rooms`),"data-drop-folder":e.id?void 0:``},[R(r).creating_room&&(R(r).creating_room.folder_id||``)===e.id?(G(),K(`p`,eG,`正在创建:`+I(R(r).creating_room.title),1)):Z(``,!0),(G(!0),K(W,null,H(e.rooms,(r,c)=>(G(),q(R(qj),{key:r.id,deps:[JSON.stringify(r),c,e.rooms.length,S.value,b(r)]},{default:z(()=>[(G(!0),K(W,null,H([w(r,c,e.rooms.length)],e=>(G(),q(v,{key:r.id,items:e.items,ui:{content:`channel-menu channel-topic-menu`}},{default:z(()=>[J(`div`,{class:F([`channel-room-row`,{active:e.active}]),"data-drag-room":r.id},[J(`button`,{class:`channel-room-grip`,"data-drag-handle":``,"aria-label":`拖动 ${r.title}`,title:`拖动排序;上下方向键移动`,disabled:e.busy,onPointerdown:t[4]||=e=>R(i).start_drag(e),onKeydown:[rl(nl(e=>R(a)(`move_channel`,{id:r.id,direction:-1,folder_id:r.folder_id||null}),[`prevent`]),[`up`]),rl(nl(e=>R(a)(`move_channel`,{id:r.id,direction:1,folder_id:r.folder_id||null}),[`prevent`]),[`down`])]},[Y(d,{name:`i-lucide-grip-vertical`})],40,nG),J(`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=>!R(o)&&R(i).start_drag(e),onClick:e=>n(`select`,r.id)},[J(`span`,null,I(r.title),1),J(`small`,iG,I(e.time),1),e.running?(G(),K(`i`,aG)):Z(``,!0)],40,rG),J(`div`,oG,[Y(f,{text:r.archived?`恢复房间`:`存档房间`,ui:{content:`channel-topic-tooltip`}},{default:z(()=>[Y(s,{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`]),Y(_,{items:e.items,content:{align:`start`,side:`bottom`,sideOffset:6},ui:{content:`channel-menu channel-topic-menu`}},{default:z(()=>[Y(s,{icon:`i-lucide-ellipsis`,"aria-label":`管理 ${r.title}`,title:`更多操作`,size:`xs`,color:`neutral`,variant:`ghost`},null,8,[`aria-label`])]),_:2},1032,[`items`])])],10,tG)]),_:2},1032,[`items`]))),128))]),_:2},1032,[`deps`]))),128))],10,$W)):Z(``,!0)],8,JW))),128)),c.value.length?Z(``,!0):(G(),K(`p`,sG,`暂无协作房间`))],512),[[cc,E.value]]),wr(Y(s,{icon:`i-lucide-archive`,color:`neutral`,variant:`ghost`,class:`channel-archive-toggle`,"aria-haspopup":`dialog`,onClick:t[6]||=e=>n(`archives`)},{default:z(()=>[t[8]||=J(`span`,{class:`channel-archive-label`},`已存档`,-1),l.value?(G(),K(`small`,cG,I(l.value),1)):Z(``,!0)]),_:1},512),[[cc,E.value]]),Y(HW,{open:g.value,"onUpdate:open":t[7]||=e=>g.value=e},null,8,[`open`])])}}},dG={id:`channel-sidebar`,class:`channel-sidebar`,"aria-label":`房间导航`},fG={class:`channel-workspace-heading`},pG={class:`channel-brand-text`},mG={class:`channel-sidebar-content`},hG={class:`channel-directory-heading channel-tools-heading`},gG=[`aria-expanded`],_G={class:`channel-directory-heading channel-tools-heading`},vG=[`aria-expanded`],yG={key:0,class:`channel-directory-actions`},bG={"aria-label":`工作流列表`,class:`channel-room-list channel-workflow-list`},xG=[`aria-current`],SG={key:0,class:`channel-workflow-rename`},CG=[`title`,`aria-current`,`onClick`,`onDblclick`],wG={class:`channel-room-time`},TG={key:2,class:`channel-room-actions`},EG={key:1,class:`channel-directory-empty`},DG={key:2,class:`channel-directory-empty`},OG={class:`channel-sidebar-footer`},kG=[`aria-label`],AG={class:`channel-self`},jG=[`title`],MG={__name:`ChannelSidebar`,props:{tabs:{type:Array,required:!0}},emits:[`select`,`manage`,`create`,`create-folder`,`manage-folder`,`delete-folder`,`archive-folder`,`archives`,`workflows`,`tab`,`settings`],setup(e,{emit:t}){let n=e,r=t,{view:i,bridge:a,field:o}=Dr(`discussion`),s=o(`author-select`),c=L(!0),l=L(!0),u=Mk(),{workflows:d,available:f,draft:p,saved_id:m,page_open:h,renaming:g,rename_text:_,pending_items:v}=u;function y(e){u.select(e),r(`workflows`)}let b=u.add_items.map(e=>e.map(e=>({...e,onSelect:()=>{e.onSelect(),r(`workflows`)}}))),x=$(()=>i.value.room?`${i.value.tab}:${h.value}`:null),S=$(()=>{let e=x.value;return n.tabs.map(t=>{let n=e!==null;return{...t,active:n&&!h.value&&i.value.tab===t.value,disabled:!n||t.disabled,onSelect:()=>r(`tab`,t.value)}})}),C=$(()=>{let e=i.value.admin;return e?.loaded?e.devices?e.logged_in?``:`未配对 · 点击配对`:e.registered?e.logged_in?``:`未登录 · 点击登录`:`设置管理员账号`:``});return(e,t)=>{let n=Ix,o=AW,x=Zx,w=qD,T=Bx,E=JD,D=va(`keep-reading`);return G(),K(`aside`,dG,[J(`header`,fG,[t[19]||=ss(`<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>`,1),J(`span`,pG,[t[18]||=J(`strong`,null,`共议`,-1),J(`span`,null,`AI CoDiscuss · v`+I(R(`0.4.48`)),1)])]),wr((G(),K(`div`,mG,[Y(uG,{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`)}),J(`div`,hG,[J(`button`,{type:`button`,class:`channel-section-toggle`,"aria-expanded":c.value,onClick:t[8]||=e=>c.value=!c.value},[Y(n,{name:c.value?`i-lucide-chevron-down`:`i-lucide-chevron-right`},null,8,[`name`]),t[20]||=X(`频道工具`,-1)],8,gG)]),c.value?(G(),q(o,{key:0,items:S.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`])):Z(``,!0),J(`div`,_G,[J(`button`,{type:`button`,class:`channel-section-toggle`,"aria-expanded":l.value,onClick:t[9]||=e=>l.value=!l.value},[Y(n,{name:l.value?`i-lucide-chevron-down`:`i-lucide-chevron-right`},null,8,[`name`]),t[21]||=X(`工作流`,-1)],8,vG),R(f)?(G(),K(`div`,yG,[Y(w,{items:R(b),content:{align:`end`,sideOffset:4},ui:{content:`channel-menu`}},{default:z(()=>[Y(x,{icon:`i-lucide-plus`,"aria-label":`新建或导入工作流`,title:`新建或导入`,size:`xs`,color:`neutral`,variant:`ghost`})]),_:1},8,[`items`])])):Z(``,!0)]),wr(J(`nav`,bG,[R(p)&&!R(m)?(G(),K(`div`,{key:0,class:F([`channel-room-row`,{active:R(h)}])},[J(`button`,{type:`button`,class:`channel-room-select`,"aria-current":R(h)?`page`:void 0,onClick:t[10]||=e=>{R(u).page_open.value=!0,r(`workflows`)}},[Y(n,{name:`i-lucide-file-plus-2`}),J(`span`,null,I(R(p).label||`未命名工作流`),1),t[22]||=J(`small`,{class:`channel-room-time`},`未保存`,-1)],8,xG)],2)):Z(``,!0),(G(!0),K(W,null,H(R(d),e=>(G(),K(`div`,{key:e.id,class:F([`channel-room-row`,{active:R(h)&&R(m)===e.id,"is-disabled":e.disabled,"is-broken":R(jk)(e)}])},[R(g)===e.id?(G(),K(`span`,SG,[Y(n,{name:`i-lucide-network`}),wr(J(`input`,{"onUpdate:modelValue":t[11]||=e=>hn(_)?_.value=e:null,"data-workflow-rename":``,maxlength:32,"aria-label":`新名称`,onKeydown:[t[12]||=rl(nl((...e)=>R(u).commit_rename&&R(u).commit_rename(...e),[`prevent`]),[`enter`]),t[13]||=rl(nl(e=>g.value=``,[`prevent`]),[`esc`])],onBlur:t[14]||=(...e)=>R(u).commit_rename&&R(u).commit_rename(...e)},null,544),[[Gc,R(_)]])])):(G(),K(`button`,{key:1,type:`button`,class:`channel-room-select`,title:R(jk)(e)||e.description,"aria-current":R(h)&&R(m)===e.id?`page`:void 0,onClick:t=>y(e.id),onDblclick:t=>!e.error&&!R(v).has(e.id)&&R(u).start_rename(e)},[Y(n,{name:R(v).has(e.id)?`i-lucide-loader-circle`:R(jk)(e)?`i-lucide-triangle-alert`:e.disabled?`i-lucide-circle-pause`:`i-lucide-network`,class:F({"animate-spin":R(v).has(e.id)})},null,8,[`name`,`class`]),J(`span`,null,I(e.label),1),J(`small`,wG,I(e.error?`无法读取`:e.disabled?`已停用`:e.unavailable?.length?`${e.unavailable.length} 张卡片不可用`:`${e.cards} 位成员`),1)],40,CG)),R(f)&&R(g)!==e.id?(G(),K(`div`,TG,[Y(w,{disabled:R(v).has(e.id),items:R(u).item_menu(e),content:{align:`start`,side:`bottom`,sideOffset:6},ui:{content:`channel-menu channel-topic-menu`}},{default:z(()=>[Y(x,{icon:`i-lucide-ellipsis`,disabled:R(v).has(e.id),"aria-label":`「${e.label}」的更多操作`,title:`更多操作`,size:`xs`,color:`neutral`,variant:`ghost`},null,8,[`disabled`,`aria-label`])]),_:2},1032,[`disabled`,`items`])])):Z(``,!0)],2))),128)),R(f)?!R(d).length&&!R(p)?(G(),K(`p`,DG,`暂无工作流`)):Z(``,!0):(G(),K(`p`,EG,`连接本机服务后管理工作流`))],512),[[cc,l.value]])])),[[D]]),J(`footer`,OG,[J(`button`,{type:`button`,class:`channel-self-button`,"aria-label":`账号与设置:${R(a).display_name(R(s))}${C.value?`,`+C.value:``}`,onClick:t[15]||=e=>r(`settings`)},[Y(T,{src:R(a).identities[R(s)]?.icon,text:R(a).identities[R(s)]?.initials,alt:R(a).display_name(R(s)),size:`sm`,class:F([`channel-avatar`,R(a).identities[R(s)]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`span`,AG,[J(`strong`,null,I(R(a).display_name(R(s))),1),J(`span`,{class:F([`channel-connection`,{"is-action":C.value}])},[J(`span`,{class:F({connected:R(i).connected}),title:R(i).connected?`网站已连接`:`网站未连接`},null,10,jG),X(I(C.value||(R(i).connected?`网站已连接`:R(i).reconnecting?`正在重新连接…`:`网站未连接`)),1)],2)])],8,kG),R(i).connected?Z(``,!0):(G(),q(E,{key:0,text:`重新连接`},{default:z(()=>[Y(x,{icon:`i-lucide-refresh-cw`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-icon-button`,"aria-label":`重新连接网站`,loading:R(i).reconnecting,onClick:t[16]||=e=>R(a).reconnect()},null,8,[`loading`])]),_:1})),Y(E,{text:`设置`},{default:z(()=>[Y(x,{icon:`i-lucide-settings-2`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-icon-button`,"aria-label":`设置`,onClick:t[17]||=e=>r(`settings`)})]),_:1})])])}}},NG={key:0,class:`pb-invite-cards`,role:`status`,"aria-label":`正在读取工作流成员`},PG={key:1,class:`pb-invite`,role:`status`},FG={key:2,class:`pb-invite`,"aria-label":`启动手动成员`},IG={class:`pb-invite-lead`},LG={class:`pb-invite-launches`},RG={class:`pb-invite-footer`},zG={key:1,class:`pb-invite-cards`},BG={key:0,class:`fine-print`},VG=[`aria-hidden`],HG={key:3,class:`pb-invite-empty`},UG={key:4,class:`pb-invite-empty`},WG={key:5,role:`alert`,class:`fine-print`},GG={class:`pb-invite-footer`},KG=2e3,qG=`preset:`,JG=rO({__name:`InviteDialog`,props:Va({description:{type:String,default:`新成员由程序按本机软件配置启动,或由你手动启动。`},workflowId:{type:String,default:``}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:[`update:open`],setup(e){let t=e,n=no(e,`open`),{view:r,bridge:i,act:a,pending:o}=Dr(`discussion`),s=$(()=>r.value.room),c=e=>(s.value.members||[]).find(t=>t.name===e),l=L(``),u;async function d(e){clearTimeout(u),l.value=``,await a(`copy_member_launch`,e)&&(l.value=e,u=setTimeout(()=>{l.value=``},KG))}let f=L([]),p=0,m=L([]),h=L(!1),g=$(()=>Object.keys(i.launch_clients)),_=$(()=>r.value&&i.expert_presets()),v=$(()=>(s.value.members||[]).map(e=>e.name)),y=e=>v.value.filter(t=>i.platform_of(t)===e).length,b=$(()=>[...f.value.filter(e=>e.mode!==`manual`),...f.value.filter(e=>e.mode===`manual`)]),x=$(()=>{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=$(()=>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=L(null),T=L(!1),E=L(!1),D=L(``),O=0;sa(()=>{O++}),B(n,async e=>{O++,E.value=!1,D.value=``,e&&(w.value=null,f.value=[],h.value=!1,m.value=[],t.workflowId&&await N(t.workflowId))}),B(()=>s.value.id,()=>{n.value=!1,f.value=[]});function k(e){i.default_launch_entry(e),f.value=[...f.value,{id:++p,name:e,mode:`cli`}]}let A=$(()=>[...g.value.map(e=>({value:e,name:i.default_name(e),...i.identities[e],title:y(e)?`已在场 ${y(e)} 位 · 将添加新实例`:``,aria_label:`添加 ${e} 实例`})),..._.value.map((e,t)=>({value:qG+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 j(e){if(!e.startsWith(qG))return k(e);let t=_.value.find(t=>t.name===e.slice(7));t&&M(t)}function M(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 N(e){if(T.value)return;if(!e){f.value=f.value.filter(e=>!e.card),w.value=null;return}let t=++O;E.value=!0,D.value=``;let n;try{n=await i.local_request(`workflows`,{action:`get`,id:e})}catch(e){t===O&&(D.value=e.message);return}finally{t===O&&(E.value=!1)}if(t!==O)return;f.value=f.value.filter(e=>!e.card);let a=r.value.launch.room_models?.workflow,o=n.agents.map(t=>({...c(a?.id===e?a.members?.[t.card]:``),card:t.card})).filter(e=>[`active`,`away`].includes(e.status));w.value={id:e,label:n.label||e,existing:o,members:{}};for(let e of n.agents)o.some(t=>t.card===e.card)||(M(i.workflow_preset(e)),f.value.at(-1).card=e.card)}async function ee(){if(!C.value){T.value=!0;try{await te()}finally{T.value=!1}}}async function te(){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 P(o);w.value=null}!f.value.length&&!m.value.length&&(n.value=!1),await P(o)}async function P(e){e&&await a(`refresh`)}return(t,a)=>{let s=BD,u=Zx,p=Bx,h=LD;return G(),q(h,{content:{onInteractOutside:e=>e.preventDefault()},open:n.value,"onUpdate:open":a[4]||=e=>n.value=e,title:`邀请成员`,description:e.description,ui:{content:`glass-panel studio-modal pb-invite-modal`,body:`dialog-body`}},{body:z(()=>[E.value?(G(),K(`div`,NG,[(G(),K(W,null,H(2,e=>Y(s,{key:e,class:`pb-invite-skeleton w-full`})),64))])):D.value?(G(),K(`div`,PG,[J(`p`,null,I(D.value),1),Y(u,{label:`重试`,icon:`i-lucide-refresh-cw`,color:`neutral`,variant:`soft`,onClick:a[0]||=t=>N(e.workflowId)})])):m.value.length&&!f.value.length?(G(),K(`div`,FG,[J(`p`,IG,I(m.value.length>1?`${m.value.length} 位手动成员已加入`:`手动成员已加入`)+`,把启动指令交给各自的 AI 会话,注册后才算到场。`,1),J(`ul`,LG,[(G(!0),K(W,null,H(m.value,e=>(G(),K(`li`,{key:e},[Y(p,{src:R(i).identities[R(i).platform_of(e)]?.icon,text:R(i).identities[R(i).platform_of(e)]?.initials,alt:e,size:`xs`,class:F([`channel-avatar`,R(i).identities[R(i).platform_of(e)]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`strong`,null,I(R(i).display_name(e)),1),J(`small`,{class:F({"is-registered":c(e)?.registered_at})},I(c(e)?.registered_at?`已注册`:`待注册`),3),Y(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:R(o)===`copy_member_launch`,disabled:!!R(o),onClick:t=>d(e)},null,8,[`icon`,`label`,`color`,`loading`,`disabled`,`onClick`])]))),128))]),a[5]||=J(`p`,{class:`fine-print`},`指令含该成员的凭证,只交给对应的会话;关闭后仍可在参与者列表中复制。`,-1),J(`div`,RG,[Y(u,{label:`完成`,class:`channel-primary-button`,onClick:a[1]||=e=>n.value=!1})])])):(G(),K(`form`,{key:3,class:`pb-invite`,"aria-label":`邀请专家`,onSubmit:nl(ee,[`prevent`])},[w.value?Z(``,!0):(G(),q(Bz,{key:0,label:`选择 AI(可多选)`,items:A.value,onAdd:j,onRemove:a[2]||=e=>R(i).delete_expert_preset(e.slice(7))},null,8,[`items`])),(G(!0),K(W,null,H(w.value?.existing||[],e=>(G(),K(`p`,{key:e.card,class:`fine-print`},I(R(i).display_name(e.name))+`:`+I(c(e.name)?.status===`away`?`确认后请回,保留原会话`:`已在场,沿用原成员`),1))),128)),f.value.length?(G(),K(`div`,zG,[(G(!0),K(W,null,H(f.value,e=>(G(),K(`div`,{key:e.id,class:`pb-invite-pick`},[Y(XR,{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?Z(``,!0):(G(),K(`p`,BG,`同一 AI 已有实例,将以 `+I(x.value.get(e))+` 加入,使用独立会话。`,1))]))),128))])):Z(``,!0),f.value.length?(G(),K(`p`,{key:2,class:F([`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,VG)):T.value?(G(),K(`p`,HG,`正在加入成员…`)):w.value?Z(``,!0):(G(),K(`p`,UG,`选择一位或多位 AI(同一 AI 可重复添加),点卡片翻面设置软件、模型与项目权限。`)),f.value.some(e=>e.mode===`cli`)&&!R(r).launch.available?(G(),K(`p`,WG,`邀请需要本机服务,请在运行 AI 的电脑打开本机网站。`)):Z(``,!0),J(`div`,GG,[Y(u,{label:`取消`,color:`neutral`,variant:`ghost`,disabled:T.value,onClick:a[3]||=e=>n.value=!1},null,8,[`disabled`]),Y(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-7fc6bf7e`]]),YG={class:`workflow-control-row`},XG=[`title`],ZG={class:`workflow-control-state`},QG=[`disabled`],$G=[`disabled`,`title`,`aria-label`],eK={key:0,class:`workflow-control-note is-warning`},tK={key:1,class:`workflow-control-note`},nK=rO({__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}=Dr(`discussion`),o=$(()=>n.value.room||{}),s=$(()=>{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=$(()=>n.value.access?.can_manage&&!o.value.archived),l=$(()=>{let e=t.workflow.cards;if(!t.workflow.available||!Array.isArray(e))return!1;let n=t.workflow.members||{},r=new Set((o.value.free?.members||[]).filter(e=>e.status===`active`).map(e=>e.name)),i=[...e,...(t.workflow.sub_workflows||[]).flatMap(e=>e.cards||[])];return e.some(e=>!r.has(n[e]))||Object.keys(n).some(e=>!i.includes(e))}),u=$(()=>s.value.map(e=>r.display_name(e.name)).join(`、`)),d=L(!1),f=$(()=>[...s.value.length?[`${u.value} 设为离开:未处理的请求取消,正在进行的工作停止;各自的会话保留。`]:[],`工作流随之结束:主持人留在房间,下一次任务起按普通协作工作。`,`之后在输入框打 / 选它,可请回原成员,接着原来的会话。消息记录和项目文件不受影响。`]);return(t,n)=>{let o=Ix;return G(),K(`div`,{class:F([`workflow-control`,e.workflow.available?`is-success`:`is-warning`])},[J(`div`,YG,[Y(o,{name:`i-lucide-network`,class:`workflow-control-icon`}),J(`span`,{class:`workflow-control-name`,title:e.workflow.label},I(e.workflow.label),9,XG),J(`span`,ZG,[n[5]||=J(`span`,{class:`workflow-control-dot`},null,-1),X(I(e.workflow.available?`进行中`:`不可用`),1)]),c.value&&l.value?(G(),K(`button`,{key:0,type:`button`,class:`workflow-control-action`,disabled:!!R(a),title:`刷新:按工作流库里的最新版本补齐成员:新增的卡片加入、离开的请回,已删卡片的成员转为普通成员`,"aria-label":`刷新工作流`,onClick:n[0]||=e=>R(i)(`sync_room_workflow`)},[Y(o,{name:`i-lucide-refresh-cw`,class:F([`workflow-control-action-icon`,{"animate-spin":R(a)===`sync_room_workflow`}])},null,8,[`class`])],8,QG)):Z(``,!0),c.value&&!e.dismissible?(G(),K(`button`,{key:1,type:`button`,class:`workflow-control-action`,disabled:!!R(a),title:s.value.length?`请离成员:请离工作流带来的成员并结束工作流,会话保留`:`结束工作流`,"aria-label":s.value.length?`请离成员`:`结束工作流`,onClick:n[1]||=e=>d.value=!0},[Y(o,{name:s.value.length?`i-lucide-user-minus`:`i-lucide-square`,class:`workflow-control-action-icon`},null,8,[`name`])],8,$G)):Z(``,!0),e.dismissible?(G(),K(`button`,{key:2,type:`button`,class:`workflow-control-close`,title:`收起此区,工作流照常进行;“成员与设置”里仍可请离成员`,"aria-label":`收起工作流区`,onClick:n[2]||=e=>t.$emit(`dismiss`)},[Y(o,{name:`i-lucide-x`,class:`workflow-control-close-icon`})])):Z(``,!0)]),e.workflow.available?u.value?(G(),K(`p`,tK,I(s.value.map(e=>R(r).display_name(e.name)).join(` · `)),1)):Z(``,!0):(G(),K(`p`,eK,`无法读取工作流,成员沿用房间里的提示词。`)),Y(QV,{open:d.value,"onUpdate:open":n[3]||=e=>d.value=e,title:`结束工作流「${e.workflow.label}」`,description:s.value.length?`请离它带来的成员,暂停这套做法。`:`本房间暂停这套做法。`,items:f.value,"confirm-label":s.value.length?`请离并结束`:`结束`,onConfirm:n[4]||=e=>R(i)(`move_workflow_members`,`away`)},null,8,[`open`,`title`,`description`,`items`,`confirm-label`])],2)}}},[[`__scopeId`,`data-v-292024c9`]]),rK={class:`start-discussion-footer`},iK=3,aK=rO({__name:`StartDiscussionDialog`,props:{open:{type:Boolean,default:!1},openModifiers:{}},emits:[`update:open`],setup(e){let t=no(e,`open`),{view:n,act:r,pending:i}=Dr(`discussion`),a=L(``),o=L(iK),s=L(0),c=L(!1),l=L(null);B(t,e=>{e&&(a.value=``,o.value=n.value.room?.limits?.max_rounds||iK,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=zD,f=RD,p=Zx,m=LD;return G(),q(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:z(()=>[J(`form`,{class:`start-discussion`,"aria-label":`开启讨论`,onSubmit:nl(u,[`prevent`])},[Y(f,{label:`讨论目标`,description:`写下问题、背景和顾虑,主持人据此推进;可留空,沿用房间目标。`},{default:z(()=>[Y(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}),Y(hO,{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`]),J(`div`,rK,[Y(p,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:r[4]||=e=>t.value=!1}),Y(p,{type:`submit`,icon:`i-lucide-play`,label:`开始讨论`,class:`channel-primary-button`,loading:R(i)===`start_room_discussion`,disabled:!!R(i)||!R(n).access?.can_manage},null,8,[`loading`,`disabled`])])],32)]),_:1},8,[`content`,`open`])}}},[[`__scopeId`,`data-v-1057202c`]]),oK={class:`pb-status-line`},sK={role:`status`},cK={key:0,class:`pb-status-detail`},lK={class:`pb-meters`},uK={class:`pb-meter-label`},dK={key:0,class:`pb-bar`},fK={key:0,class:`pb-section`,"aria-label":`当前焦点`},pK={key:1,class:`pb-actions`,"aria-label":`讨论操作`},mK={class:`progress-ending`},hK=[`disabled`],gK=90,_K={__name:`ProgressBoard`,setup(e){let{view:t,bridge:n,act:r,pending:i}=Dr(`discussion`),a=$(()=>t.value.room),o=$(()=>a.value.session),s=$(()=>a.value.limits||{}),c=L(0);B(()=>[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=$(()=>o.value?.status===`paused`),u=$(()=>a.value.current_turn),d=$(()=>!!t.value.access?.can_manage&&!a.value.archived),f=L(!1),p=L(!1),m=$(()=>u.value?.question||a.value.focus||o.value?.goal||a.value.goal||``),h=$(()=>{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 _=$(()=>{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=Zx,s=LD;return G(),K(W,null,[J(`section`,{class:F([`pb-status`,`is-${h.value.tone}`]),"aria-label":`讨论状态`},[J(`div`,oK,[t[6]||=J(`span`,{class:`pb-dot`},null,-1),J(`strong`,sK,I(h.value.title),1)]),h.value.detail?(G(),K(`p`,cK,I(h.value.detail),1)):Z(``,!0),J(`div`,lK,[(G(!0),K(W,null,H(_.value,e=>(G(),K(`div`,{key:e.label,class:`pb-meter`},[J(`div`,uK,[J(`span`,null,I(e.label),1),J(`b`,null,I(e.text),1)]),e.ratio===null?Z(``,!0):(G(),K(`div`,dK,[J(`i`,{style:_e({width:`${Math.min(100,Math.round(e.ratio*100))}%`})},null,4)]))]))),128))])],2),m.value?(G(),K(`section`,fK,[t[7]||=J(`h4`,null,`当前焦点`,-1),J(`p`,{class:F([`pb-focus`,{"is-expanded":p.value}])},I(m.value),3),m.value.length>gK?(G(),K(`button`,{key:0,type:`button`,class:`pb-link`,onClick:t[0]||=e=>p.value=!p.value},I(p.value?`收起`:`展开`),1)):Z(``,!0)])):Z(``,!0),a.value.archived?Z(``,!0):(G(),K(`section`,pK,[l.value?(G(),q(o,{key:0,icon:`i-lucide-play`,label:`继续`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action`,disabled:!d.value||!!R(i),loading:R(i)===`restart_discussion`,onClick:t[1]||=e=>R(r)(`restart_discussion`)},null,8,[`disabled`,`loading`])):(G(),q(o,{key:1,icon:`i-lucide-pause`,label:`暂停`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action`,title:`停止本次讨论执行,继续时由主持人重新安排`,disabled:!d.value||!!R(i),loading:R(i)===`pause_discussion`,onClick:t[2]||=e=>R(r)(`pause_discussion`)},null,8,[`disabled`,`loading`])),u.value&&!l.value?(G(),q(o,{key:2,icon:`i-lucide-skip-forward`,label:`跳过`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action`,title:`跳过 ${R(n).display_name(u.value.expert)} 本次发言`,disabled:!d.value||!!R(i),loading:R(i)===`skip_turn`,onClick:t[3]||=e=>R(r)(`skip_turn`)},null,8,[`title`,`disabled`,`loading`])):Z(``,!0),Y(o,{icon:`i-lucide-flag`,label:`结束`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action pb-end`,disabled:!d.value||!!R(i),onClick:t[4]||=e=>f.value=!0},null,8,[`disabled`])])),Y(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:z(()=>[J(`div`,mK,[J(`button`,{type:`button`,class:`progress-ending-option`,disabled:!!R(i),onClick:v},[...t[8]||=[J(`strong`,null,`结束讨论`,-1),J(`span`,null,`保留全部记录;需要总结时可直接请主持人写一份。`,-1)]],8,hK)])]),_:1},8,[`content`,`open`])],64)}}},vK={class:`speaking-order`},yK={key:0,class:`speaking-order-divider speaking-order-relay`},bK={key:0,class:`speaking-order-divider`,"aria-hidden":`true`},xK=[`data-key`,`data-movable`],SK=[`aria-disabled`,`aria-label`,`title`,`onPointerdown`,`onKeydown`],CK={class:`speaking-order-number`},wK={key:1,class:`speaking-order-place`,title:`已发言`,"aria-label":`已发言`},TK=[`title`],EK={key:1,class:`speaking-order-later`},DK={key:2,class:`speaking-order-divider`,"aria-hidden":`true`},OK={class:`speaking-order-live`,"aria-live":`polite`},kK=`发言顺序刚有变化,已更新为最新顺序,请重新调整`,AK=rO({__name:`SpeakingOrder`,props:{away:{type:Array,default:()=>[]},round:{type:Number,default:0}},setup(e){let t=e,{view:n,bridge:r,act:i}=Dr(`discussion`),a=L(!1),o=$(()=>n.value.room),s=$(()=>o.value.speaking_order||{kind:`default`,items:[],movable:[]}),c=$(()=>s.value.kind==="default"?`idle`:`queued`),l=$(()=>!!n.value.access?.can_manage&&!o.value.archived&&s.value.movable.length>1),u={queue:`不在本次依次回答中`,turns:`本轮未安排`},d=$(()=>s.value.kind==="default"?`拖动设置默认发言顺序,@全体依次 按此顺序;聚焦后可用上下方向键`:`拖动调整还没发言的顺序,立即生效;聚焦后可用上下方向键`),f=L(null),p=L(null),m=L(null),h=L(``);B(()=>s.value.revision,()=>{m.value=null}),B(()=>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 _=$(()=>{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?e.step&&e.step===i[t-1]?.step?u:++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(`
59
+ `)}let S=$(()=>JSON.stringify([r.value.directory_pending,r.value.archive_pending,r.value.backup_pending,r.value.folders,r.value.room_site,d.value,r.value.room?.id,o.value,s.value,C.value])),C=$(()=>(r.value.room?.free?.members||[]).some(e=>[`dispatched`,`started`].includes(e.execution?.status)));function w(e,t,n){return{items:ee(e,t,e.folder_id||null,n),active:!s.value&&e.id===r.value.room?.id,busy:!!o.value,archiving:r.value.archive_pending.includes(e.id),time:b(e),title:x(e),running:e.id===r.value.room?.id?C.value:!!e.running}}function T(e,t){let n=e.id?A(e,t):[],i={items:n,collapsed:!k(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 E=L(!0),D=L(M()),O=L(``);B(()=>r.value.room?.id,(e,t)=>{t&&(O.value=r.value.room?.folder_id||``)});function k(e){return!e||D.value.has(e)||O.value===e}function A(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===u.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:()=>v(e.id||null)},j(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 j(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 M(){try{return new Set(JSON.parse(localStorage.getItem(lG)||`[]`))}catch{return new Set}}function N(e){let t=k(e),n=new Set(D.value);t?n.delete(e):n.add(e),t&&O.value===e&&(O.value=``),D.value=n;try{localStorage.setItem(lG,JSON.stringify([...n]))}catch{}}function ee(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||!d.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||!d.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 s=Zx,d=Ix,f=JD,_=qD,v=NW;return G(),K(`div`,UW,[Y(s,{label:`新建对话`,icon:`i-lucide-plus`,color:`neutral`,class:`channel-primary-button channel-new-conversation`,disabled:R(r).directory_pending.includes(`create-room`),onClick:t[0]||=e=>n(`create`,null)},null,8,[`disabled`]),J(`div`,WW,[J(`button`,{type:`button`,class:`channel-section-toggle`,"aria-expanded":E.value,onClick:t[1]||=e=>E.value=!E.value},[Y(d,{name:E.value?`i-lucide-chevron-down`:`i-lucide-chevron-right`},null,8,[`name`]),X(I(p.value),1)],8,GW),J(`div`,KW,[Y(f,{text:`新建文件夹`},{default:z(()=>[Y(s,{icon:`i-lucide-plus`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`新建文件夹`,disabled:R(r).directory_pending.includes(`create-folder`),onClick:t[2]||=e=>n(`create-folder`)},null,8,[`disabled`])]),_:1}),Y(_,{items:m.value,content:{align:`end`,sideOffset:4},ui:{content:`channel-menu channel-directory-menu`}},{default:z(()=>[Y(s,{icon:`i-lucide-ellipsis`,"aria-label":`房间目录选项`,title:`排列、导入与导出`,size:`xs`,color:`neutral`,variant:`ghost`})]),_:1},8,[`items`]),J(`input`,{ref_key:`import_input`,ref:h,type:`file`,accept:`.zip,.json`,multiple:``,hidden:``,"aria-label":`选择房间备份`,onChange:y},null,544)])]),wr(J(`nav`,qW,[(G(!0),K(W,null,H(u.value,(e,c)=>(G(),K(`section`,{key:e.order_id,class:`channel-folder-section`,"data-room-folder":e.id,"data-drag-folder":e.order_id},[(G(!0),K(W,null,H([T(e,c)],r=>(G(),K(W,{key:e.order_id},[e.id?(G(),q(R(qj),{key:0,deps:[r.key]},{default:z(()=>[J(`div`,{class:F([`channel-folder-row`,{active:r.collapsed&&r.active}])},[J(`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=>!R(o)&&R(i).start_drag(e),onKeydown:[rl(nl(t=>R(a)(`move_folder`,{id:e.order_id,direction:-1}),[`prevent`]),[`up`]),rl(nl(t=>R(a)(`move_folder`,{id:e.order_id,direction:1}),[`prevent`]),[`down`])],onClick:t=>N(e.id)},[Y(d,{name:r.collapsed?`i-lucide-chevron-right`:`i-lucide-chevron-down`},null,8,[`name`]),Y(d,{name:`i-lucide-folder`}),J(`span`,XW,I(e.name),1),J(`small`,ZW,I(e.pending?`保存中`:e.rooms.length||``),1)],40,YW),J(`div`,QW,[Y(f,{text:`在${e.name}中新建对话`},{default:z(()=>[Y(s,{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`]),Y(_,{items:r.items,content:{align:`start`,side:`bottom`,sideOffset:6},ui:{content:`channel-menu channel-topic-menu`}},{default:z(()=>[Y(s,{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`])):Z(``,!0)],64))),128)),k(e.id)?(G(),K(`div`,{key:0,class:F(e.id?`channel-folder-rooms`:`channel-root-rooms`),"data-drop-folder":e.id?void 0:``},[R(r).creating_room&&(R(r).creating_room.folder_id||``)===e.id?(G(),K(`p`,eG,`正在创建:`+I(R(r).creating_room.title),1)):Z(``,!0),(G(!0),K(W,null,H(e.rooms,(r,c)=>(G(),q(R(qj),{key:r.id,deps:[JSON.stringify(r),c,e.rooms.length,S.value,b(r)]},{default:z(()=>[(G(!0),K(W,null,H([w(r,c,e.rooms.length)],e=>(G(),q(v,{key:r.id,items:e.items,ui:{content:`channel-menu channel-topic-menu`}},{default:z(()=>[J(`div`,{class:F([`channel-room-row`,{active:e.active}]),"data-drag-room":r.id},[J(`button`,{class:`channel-room-grip`,"data-drag-handle":``,"aria-label":`拖动 ${r.title}`,title:`拖动排序;上下方向键移动`,disabled:e.busy,onPointerdown:t[4]||=e=>R(i).start_drag(e),onKeydown:[rl(nl(e=>R(a)(`move_channel`,{id:r.id,direction:-1,folder_id:r.folder_id||null}),[`prevent`]),[`up`]),rl(nl(e=>R(a)(`move_channel`,{id:r.id,direction:1,folder_id:r.folder_id||null}),[`prevent`]),[`down`])]},[Y(d,{name:`i-lucide-grip-vertical`})],40,nG),J(`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=>!R(o)&&R(i).start_drag(e),onClick:e=>n(`select`,r.id)},[J(`span`,null,I(r.title),1),J(`small`,iG,I(e.time),1),e.running?(G(),K(`i`,aG)):Z(``,!0)],40,rG),J(`div`,oG,[Y(f,{text:r.archived?`恢复房间`:`存档房间`,ui:{content:`channel-topic-tooltip`}},{default:z(()=>[Y(s,{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`]),Y(_,{items:e.items,content:{align:`start`,side:`bottom`,sideOffset:6},ui:{content:`channel-menu channel-topic-menu`}},{default:z(()=>[Y(s,{icon:`i-lucide-ellipsis`,"aria-label":`管理 ${r.title}`,title:`更多操作`,size:`xs`,color:`neutral`,variant:`ghost`},null,8,[`aria-label`])]),_:2},1032,[`items`])])],10,tG)]),_:2},1032,[`items`]))),128))]),_:2},1032,[`deps`]))),128))],10,$W)):Z(``,!0)],8,JW))),128)),c.value.length?Z(``,!0):(G(),K(`p`,sG,`暂无协作房间`))],512),[[cc,E.value]]),wr(Y(s,{icon:`i-lucide-archive`,color:`neutral`,variant:`ghost`,class:`channel-archive-toggle`,"aria-haspopup":`dialog`,onClick:t[6]||=e=>n(`archives`)},{default:z(()=>[t[8]||=J(`span`,{class:`channel-archive-label`},`已存档`,-1),l.value?(G(),K(`small`,cG,I(l.value),1)):Z(``,!0)]),_:1},512),[[cc,E.value]]),Y(HW,{open:g.value,"onUpdate:open":t[7]||=e=>g.value=e},null,8,[`open`])])}}},dG={id:`channel-sidebar`,class:`channel-sidebar`,"aria-label":`房间导航`},fG={class:`channel-workspace-heading`},pG={class:`channel-brand-text`},mG={class:`channel-sidebar-content`},hG={class:`channel-directory-heading channel-tools-heading`},gG=[`aria-expanded`],_G={class:`channel-directory-heading channel-tools-heading`},vG=[`aria-expanded`],yG={key:0,class:`channel-directory-actions`},bG={"aria-label":`工作流列表`,class:`channel-room-list channel-workflow-list`},xG=[`aria-current`],SG={key:0,class:`channel-workflow-rename`},CG=[`title`,`aria-current`,`onClick`,`onDblclick`],wG={class:`channel-room-time`},TG={key:2,class:`channel-room-actions`},EG={key:1,class:`channel-directory-empty`},DG={key:2,class:`channel-directory-empty`},OG={class:`channel-sidebar-footer`},kG=[`aria-label`],AG={class:`channel-self`},jG=[`title`],MG={__name:`ChannelSidebar`,props:{tabs:{type:Array,required:!0}},emits:[`select`,`manage`,`create`,`create-folder`,`manage-folder`,`delete-folder`,`archive-folder`,`archives`,`workflows`,`tab`,`settings`],setup(e,{emit:t}){let n=e,r=t,{view:i,bridge:a,field:o}=Dr(`discussion`),s=o(`author-select`),c=L(!0),l=L(!0),u=Mk(),{workflows:d,available:f,draft:p,saved_id:m,page_open:h,renaming:g,rename_text:_,pending_items:v}=u;function y(e){u.select(e),r(`workflows`)}let b=u.add_items.map(e=>e.map(e=>({...e,onSelect:()=>{e.onSelect(),r(`workflows`)}}))),x=$(()=>i.value.room?`${i.value.tab}:${h.value}`:null),S=$(()=>{let e=x.value;return n.tabs.map(t=>{let n=e!==null;return{...t,active:n&&!h.value&&i.value.tab===t.value,disabled:!n||t.disabled,onSelect:()=>r(`tab`,t.value)}})}),C=$(()=>{let e=i.value.admin;return e?.loaded?e.devices?e.logged_in?``:`未配对 · 点击配对`:e.registered?e.logged_in?``:`未登录 · 点击登录`:`设置管理员账号`:``});return(e,t)=>{let n=Ix,o=AW,x=Zx,w=qD,T=Bx,E=JD,D=va(`keep-reading`);return G(),K(`aside`,dG,[J(`header`,fG,[t[19]||=ss(`<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>`,1),J(`span`,pG,[t[18]||=J(`strong`,null,`共议`,-1),J(`span`,null,`AI CoDiscuss · v`+I(R(`0.4.49`)),1)])]),wr((G(),K(`div`,mG,[Y(uG,{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`)}),J(`div`,hG,[J(`button`,{type:`button`,class:`channel-section-toggle`,"aria-expanded":c.value,onClick:t[8]||=e=>c.value=!c.value},[Y(n,{name:c.value?`i-lucide-chevron-down`:`i-lucide-chevron-right`},null,8,[`name`]),t[20]||=X(`频道工具`,-1)],8,gG)]),c.value?(G(),q(o,{key:0,items:S.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`])):Z(``,!0),J(`div`,_G,[J(`button`,{type:`button`,class:`channel-section-toggle`,"aria-expanded":l.value,onClick:t[9]||=e=>l.value=!l.value},[Y(n,{name:l.value?`i-lucide-chevron-down`:`i-lucide-chevron-right`},null,8,[`name`]),t[21]||=X(`工作流`,-1)],8,vG),R(f)?(G(),K(`div`,yG,[Y(w,{items:R(b),content:{align:`end`,sideOffset:4},ui:{content:`channel-menu`}},{default:z(()=>[Y(x,{icon:`i-lucide-plus`,"aria-label":`新建或导入工作流`,title:`新建或导入`,size:`xs`,color:`neutral`,variant:`ghost`})]),_:1},8,[`items`])])):Z(``,!0)]),wr(J(`nav`,bG,[R(p)&&!R(m)?(G(),K(`div`,{key:0,class:F([`channel-room-row`,{active:R(h)}])},[J(`button`,{type:`button`,class:`channel-room-select`,"aria-current":R(h)?`page`:void 0,onClick:t[10]||=e=>{R(u).page_open.value=!0,r(`workflows`)}},[Y(n,{name:`i-lucide-file-plus-2`}),J(`span`,null,I(R(p).label||`未命名工作流`),1),t[22]||=J(`small`,{class:`channel-room-time`},`未保存`,-1)],8,xG)],2)):Z(``,!0),(G(!0),K(W,null,H(R(d),e=>(G(),K(`div`,{key:e.id,class:F([`channel-room-row`,{active:R(h)&&R(m)===e.id,"is-disabled":e.disabled,"is-broken":R(jk)(e)}])},[R(g)===e.id?(G(),K(`span`,SG,[Y(n,{name:`i-lucide-network`}),wr(J(`input`,{"onUpdate:modelValue":t[11]||=e=>hn(_)?_.value=e:null,"data-workflow-rename":``,maxlength:32,"aria-label":`新名称`,onKeydown:[t[12]||=rl(nl((...e)=>R(u).commit_rename&&R(u).commit_rename(...e),[`prevent`]),[`enter`]),t[13]||=rl(nl(e=>g.value=``,[`prevent`]),[`esc`])],onBlur:t[14]||=(...e)=>R(u).commit_rename&&R(u).commit_rename(...e)},null,544),[[Gc,R(_)]])])):(G(),K(`button`,{key:1,type:`button`,class:`channel-room-select`,title:R(jk)(e)||e.description,"aria-current":R(h)&&R(m)===e.id?`page`:void 0,onClick:t=>y(e.id),onDblclick:t=>!e.error&&!R(v).has(e.id)&&R(u).start_rename(e)},[Y(n,{name:R(v).has(e.id)?`i-lucide-loader-circle`:R(jk)(e)?`i-lucide-triangle-alert`:e.disabled?`i-lucide-circle-pause`:`i-lucide-network`,class:F({"animate-spin":R(v).has(e.id)})},null,8,[`name`,`class`]),J(`span`,null,I(e.label),1),J(`small`,wG,I(e.error?`无法读取`:e.disabled?`已停用`:e.unavailable?.length?`${e.unavailable.length} 张卡片不可用`:`${e.cards} 位成员`),1)],40,CG)),R(f)&&R(g)!==e.id?(G(),K(`div`,TG,[Y(w,{disabled:R(v).has(e.id),items:R(u).item_menu(e),content:{align:`start`,side:`bottom`,sideOffset:6},ui:{content:`channel-menu channel-topic-menu`}},{default:z(()=>[Y(x,{icon:`i-lucide-ellipsis`,disabled:R(v).has(e.id),"aria-label":`「${e.label}」的更多操作`,title:`更多操作`,size:`xs`,color:`neutral`,variant:`ghost`},null,8,[`disabled`,`aria-label`])]),_:2},1032,[`disabled`,`items`])])):Z(``,!0)],2))),128)),R(f)?!R(d).length&&!R(p)?(G(),K(`p`,DG,`暂无工作流`)):Z(``,!0):(G(),K(`p`,EG,`连接本机服务后管理工作流`))],512),[[cc,l.value]])])),[[D]]),J(`footer`,OG,[J(`button`,{type:`button`,class:`channel-self-button`,"aria-label":`账号与设置:${R(a).display_name(R(s))}${C.value?`,`+C.value:``}`,onClick:t[15]||=e=>r(`settings`)},[Y(T,{src:R(a).identities[R(s)]?.icon,text:R(a).identities[R(s)]?.initials,alt:R(a).display_name(R(s)),size:`sm`,class:F([`channel-avatar`,R(a).identities[R(s)]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`span`,AG,[J(`strong`,null,I(R(a).display_name(R(s))),1),J(`span`,{class:F([`channel-connection`,{"is-action":C.value}])},[J(`span`,{class:F({connected:R(i).connected}),title:R(i).connected?`网站已连接`:`网站未连接`},null,10,jG),X(I(C.value||(R(i).connected?`网站已连接`:R(i).reconnecting?`正在重新连接…`:`网站未连接`)),1)],2)])],8,kG),R(i).connected?Z(``,!0):(G(),q(E,{key:0,text:`重新连接`},{default:z(()=>[Y(x,{icon:`i-lucide-refresh-cw`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-icon-button`,"aria-label":`重新连接网站`,loading:R(i).reconnecting,onClick:t[16]||=e=>R(a).reconnect()},null,8,[`loading`])]),_:1})),Y(E,{text:`设置`},{default:z(()=>[Y(x,{icon:`i-lucide-settings-2`,color:`neutral`,variant:`ghost`,size:`sm`,class:`channel-icon-button`,"aria-label":`设置`,onClick:t[17]||=e=>r(`settings`)})]),_:1})])])}}},NG={key:0,class:`pb-invite-cards`,role:`status`,"aria-label":`正在读取工作流成员`},PG={key:1,class:`pb-invite`,role:`status`},FG={key:2,class:`pb-invite`,"aria-label":`启动手动成员`},IG={class:`pb-invite-lead`},LG={class:`pb-invite-launches`},RG={class:`pb-invite-footer`},zG={key:1,class:`pb-invite-cards`},BG={key:0,class:`fine-print`},VG=[`aria-hidden`],HG={key:3,class:`pb-invite-empty`},UG={key:4,class:`pb-invite-empty`},WG={key:5,role:`alert`,class:`fine-print`},GG={class:`pb-invite-footer`},KG=2e3,qG=`preset:`,JG=rO({__name:`InviteDialog`,props:Va({description:{type:String,default:`新成员由程序按本机软件配置启动,或由你手动启动。`},workflowId:{type:String,default:``}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:[`update:open`],setup(e){let t=e,n=no(e,`open`),{view:r,bridge:i,act:a,pending:o}=Dr(`discussion`),s=$(()=>r.value.room),c=e=>(s.value.members||[]).find(t=>t.name===e),l=L(``),u;async function d(e){clearTimeout(u),l.value=``,await a(`copy_member_launch`,e)&&(l.value=e,u=setTimeout(()=>{l.value=``},KG))}let f=L([]),p=0,m=L([]),h=L(!1),g=$(()=>Object.keys(i.launch_clients)),_=$(()=>r.value&&i.expert_presets()),v=$(()=>(s.value.members||[]).map(e=>e.name)),y=e=>v.value.filter(t=>i.platform_of(t)===e).length,b=$(()=>[...f.value.filter(e=>e.mode!==`manual`),...f.value.filter(e=>e.mode===`manual`)]),x=$(()=>{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=$(()=>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=L(null),T=L(!1),E=L(!1),D=L(``),O=0;sa(()=>{O++}),B(n,async e=>{O++,E.value=!1,D.value=``,e&&(w.value=null,f.value=[],h.value=!1,m.value=[],t.workflowId&&await N(t.workflowId))}),B(()=>s.value.id,()=>{n.value=!1,f.value=[]});function k(e){i.default_launch_entry(e),f.value=[...f.value,{id:++p,name:e,mode:`cli`}]}let A=$(()=>[...g.value.map(e=>({value:e,name:i.default_name(e),...i.identities[e],title:y(e)?`已在场 ${y(e)} 位 · 将添加新实例`:``,aria_label:`添加 ${e} 实例`})),..._.value.map((e,t)=>({value:qG+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 j(e){if(!e.startsWith(qG))return k(e);let t=_.value.find(t=>t.name===e.slice(7));t&&M(t)}function M(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 N(e){if(T.value)return;if(!e){f.value=f.value.filter(e=>!e.card),w.value=null;return}let t=++O;E.value=!0,D.value=``;let n;try{n=await i.local_request(`workflows`,{action:`get`,id:e})}catch(e){t===O&&(D.value=e.message);return}finally{t===O&&(E.value=!1)}if(t!==O)return;f.value=f.value.filter(e=>!e.card);let a=r.value.launch.room_models?.workflow,o=n.agents.map(t=>({...c(a?.id===e?a.members?.[t.card]:``),card:t.card})).filter(e=>[`active`,`away`].includes(e.status));w.value={id:e,label:n.label||e,existing:o,members:{}};for(let e of n.agents)o.some(t=>t.card===e.card)||(M(i.workflow_preset(e)),f.value.at(-1).card=e.card)}async function ee(){if(!C.value){T.value=!0;try{await te()}finally{T.value=!1}}}async function te(){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 P(o);w.value=null}!f.value.length&&!m.value.length&&(n.value=!1),await P(o)}async function P(e){e&&await a(`refresh`)}return(t,a)=>{let s=BD,u=Zx,p=Bx,h=LD;return G(),q(h,{content:{onInteractOutside:e=>e.preventDefault()},open:n.value,"onUpdate:open":a[4]||=e=>n.value=e,title:`邀请成员`,description:e.description,ui:{content:`glass-panel studio-modal pb-invite-modal`,body:`dialog-body`}},{body:z(()=>[E.value?(G(),K(`div`,NG,[(G(),K(W,null,H(2,e=>Y(s,{key:e,class:`pb-invite-skeleton w-full`})),64))])):D.value?(G(),K(`div`,PG,[J(`p`,null,I(D.value),1),Y(u,{label:`重试`,icon:`i-lucide-refresh-cw`,color:`neutral`,variant:`soft`,onClick:a[0]||=t=>N(e.workflowId)})])):m.value.length&&!f.value.length?(G(),K(`div`,FG,[J(`p`,IG,I(m.value.length>1?`${m.value.length} 位手动成员已加入`:`手动成员已加入`)+`,把启动指令交给各自的 AI 会话,注册后才算到场。`,1),J(`ul`,LG,[(G(!0),K(W,null,H(m.value,e=>(G(),K(`li`,{key:e},[Y(p,{src:R(i).identities[R(i).platform_of(e)]?.icon,text:R(i).identities[R(i).platform_of(e)]?.initials,alt:e,size:`xs`,class:F([`channel-avatar`,R(i).identities[R(i).platform_of(e)]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`strong`,null,I(R(i).display_name(e)),1),J(`small`,{class:F({"is-registered":c(e)?.registered_at})},I(c(e)?.registered_at?`已注册`:`待注册`),3),Y(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:R(o)===`copy_member_launch`,disabled:!!R(o),onClick:t=>d(e)},null,8,[`icon`,`label`,`color`,`loading`,`disabled`,`onClick`])]))),128))]),a[5]||=J(`p`,{class:`fine-print`},`指令含该成员的凭证,只交给对应的会话;关闭后仍可在参与者列表中复制。`,-1),J(`div`,RG,[Y(u,{label:`完成`,class:`channel-primary-button`,onClick:a[1]||=e=>n.value=!1})])])):(G(),K(`form`,{key:3,class:`pb-invite`,"aria-label":`邀请专家`,onSubmit:nl(ee,[`prevent`])},[w.value?Z(``,!0):(G(),q(Bz,{key:0,label:`选择 AI(可多选)`,items:A.value,onAdd:j,onRemove:a[2]||=e=>R(i).delete_expert_preset(e.slice(7))},null,8,[`items`])),(G(!0),K(W,null,H(w.value?.existing||[],e=>(G(),K(`p`,{key:e.card,class:`fine-print`},I(R(i).display_name(e.name))+`:`+I(c(e.name)?.status===`away`?`确认后请回,保留原会话`:`已在场,沿用原成员`),1))),128)),f.value.length?(G(),K(`div`,zG,[(G(!0),K(W,null,H(f.value,e=>(G(),K(`div`,{key:e.id,class:`pb-invite-pick`},[Y(XR,{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?Z(``,!0):(G(),K(`p`,BG,`同一 AI 已有实例,将以 `+I(x.value.get(e))+` 加入,使用独立会话。`,1))]))),128))])):Z(``,!0),f.value.length?(G(),K(`p`,{key:2,class:F([`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,VG)):T.value?(G(),K(`p`,HG,`正在加入成员…`)):w.value?Z(``,!0):(G(),K(`p`,UG,`选择一位或多位 AI(同一 AI 可重复添加),点卡片翻面设置软件、模型与项目权限。`)),f.value.some(e=>e.mode===`cli`)&&!R(r).launch.available?(G(),K(`p`,WG,`邀请需要本机服务,请在运行 AI 的电脑打开本机网站。`)):Z(``,!0),J(`div`,GG,[Y(u,{label:`取消`,color:`neutral`,variant:`ghost`,disabled:T.value,onClick:a[3]||=e=>n.value=!1},null,8,[`disabled`]),Y(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-7fc6bf7e`]]),YG={class:`workflow-control-row`},XG=[`title`],ZG={class:`workflow-control-state`},QG=[`disabled`],$G=[`disabled`,`title`,`aria-label`],eK={key:0,class:`workflow-control-note is-warning`},tK={key:1,class:`workflow-control-note`},nK=rO({__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}=Dr(`discussion`),o=$(()=>n.value.room||{}),s=$(()=>{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=$(()=>n.value.access?.can_manage&&!o.value.archived),l=$(()=>{let e=t.workflow.cards;if(!t.workflow.available||!Array.isArray(e))return!1;let n=t.workflow.members||{},r=new Set((o.value.free?.members||[]).filter(e=>e.status===`active`).map(e=>e.name)),i=[...e,...(t.workflow.sub_workflows||[]).flatMap(e=>e.cards||[])];return e.some(e=>!r.has(n[e]))||Object.keys(n).some(e=>!i.includes(e))}),u=$(()=>s.value.map(e=>r.display_name(e.name)).join(`、`)),d=L(!1),f=$(()=>[...s.value.length?[`${u.value} 设为离开:未处理的请求取消,正在进行的工作停止;各自的会话保留。`]:[],`工作流随之结束:主持人留在房间,下一次任务起按普通协作工作。`,`之后在输入框打 / 选它,可请回原成员,接着原来的会话。消息记录和项目文件不受影响。`]);return(t,n)=>{let o=Ix;return G(),K(`div`,{class:F([`workflow-control`,e.workflow.available?`is-success`:`is-warning`])},[J(`div`,YG,[Y(o,{name:`i-lucide-network`,class:`workflow-control-icon`}),J(`span`,{class:`workflow-control-name`,title:e.workflow.label},I(e.workflow.label),9,XG),J(`span`,ZG,[n[5]||=J(`span`,{class:`workflow-control-dot`},null,-1),X(I(e.workflow.available?`进行中`:`不可用`),1)]),c.value&&l.value?(G(),K(`button`,{key:0,type:`button`,class:`workflow-control-action`,disabled:!!R(a),title:`刷新:按工作流库里的最新版本补齐成员:新增的卡片加入、离开的请回,已删卡片的成员转为普通成员`,"aria-label":`刷新工作流`,onClick:n[0]||=e=>R(i)(`sync_room_workflow`)},[Y(o,{name:`i-lucide-refresh-cw`,class:F([`workflow-control-action-icon`,{"animate-spin":R(a)===`sync_room_workflow`}])},null,8,[`class`])],8,QG)):Z(``,!0),c.value&&!e.dismissible?(G(),K(`button`,{key:1,type:`button`,class:`workflow-control-action`,disabled:!!R(a),title:s.value.length?`请离成员:请离工作流带来的成员并结束工作流,会话保留`:`结束工作流`,"aria-label":s.value.length?`请离成员`:`结束工作流`,onClick:n[1]||=e=>d.value=!0},[Y(o,{name:s.value.length?`i-lucide-user-minus`:`i-lucide-square`,class:`workflow-control-action-icon`},null,8,[`name`])],8,$G)):Z(``,!0),e.dismissible?(G(),K(`button`,{key:2,type:`button`,class:`workflow-control-close`,title:`收起此区,工作流照常进行;“成员与设置”里仍可请离成员`,"aria-label":`收起工作流区`,onClick:n[2]||=e=>t.$emit(`dismiss`)},[Y(o,{name:`i-lucide-x`,class:`workflow-control-close-icon`})])):Z(``,!0)]),e.workflow.available?u.value?(G(),K(`p`,tK,I(s.value.map(e=>R(r).display_name(e.name)).join(` · `)),1)):Z(``,!0):(G(),K(`p`,eK,`无法读取工作流,成员沿用房间里的提示词。`)),Y(QV,{open:d.value,"onUpdate:open":n[3]||=e=>d.value=e,title:`结束工作流「${e.workflow.label}」`,description:s.value.length?`请离它带来的成员,暂停这套做法。`:`本房间暂停这套做法。`,items:f.value,"confirm-label":s.value.length?`请离并结束`:`结束`,onConfirm:n[4]||=e=>R(i)(`move_workflow_members`,`away`)},null,8,[`open`,`title`,`description`,`items`,`confirm-label`])],2)}}},[[`__scopeId`,`data-v-292024c9`]]),rK={class:`start-discussion-footer`},iK=3,aK=rO({__name:`StartDiscussionDialog`,props:{open:{type:Boolean,default:!1},openModifiers:{}},emits:[`update:open`],setup(e){let t=no(e,`open`),{view:n,act:r,pending:i}=Dr(`discussion`),a=L(``),o=L(iK),s=L(0),c=L(!1),l=L(null);B(t,e=>{e&&(a.value=``,o.value=n.value.room?.limits?.max_rounds||iK,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=zD,f=RD,p=Zx,m=LD;return G(),q(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:z(()=>[J(`form`,{class:`start-discussion`,"aria-label":`开启讨论`,onSubmit:nl(u,[`prevent`])},[Y(f,{label:`讨论目标`,description:`写下问题、背景和顾虑,主持人据此推进;可留空,沿用房间目标。`},{default:z(()=>[Y(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}),Y(hO,{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`]),J(`div`,rK,[Y(p,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:r[4]||=e=>t.value=!1}),Y(p,{type:`submit`,icon:`i-lucide-play`,label:`开始讨论`,class:`channel-primary-button`,loading:R(i)===`start_room_discussion`,disabled:!!R(i)||!R(n).access?.can_manage},null,8,[`loading`,`disabled`])])],32)]),_:1},8,[`content`,`open`])}}},[[`__scopeId`,`data-v-1057202c`]]),oK={class:`pb-status-line`},sK={role:`status`},cK={key:0,class:`pb-status-detail`},lK={class:`pb-meters`},uK={class:`pb-meter-label`},dK={key:0,class:`pb-bar`},fK={key:0,class:`pb-section`,"aria-label":`当前焦点`},pK={key:1,class:`pb-actions`,"aria-label":`讨论操作`},mK={class:`progress-ending`},hK=[`disabled`],gK=90,_K={__name:`ProgressBoard`,setup(e){let{view:t,bridge:n,act:r,pending:i}=Dr(`discussion`),a=$(()=>t.value.room),o=$(()=>a.value.session),s=$(()=>a.value.limits||{}),c=L(0);B(()=>[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=$(()=>o.value?.status===`paused`),u=$(()=>a.value.current_turn),d=$(()=>!!t.value.access?.can_manage&&!a.value.archived),f=L(!1),p=L(!1),m=$(()=>u.value?.question||a.value.focus||o.value?.goal||a.value.goal||``),h=$(()=>{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 _=$(()=>{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=Zx,s=LD;return G(),K(W,null,[J(`section`,{class:F([`pb-status`,`is-${h.value.tone}`]),"aria-label":`讨论状态`},[J(`div`,oK,[t[6]||=J(`span`,{class:`pb-dot`},null,-1),J(`strong`,sK,I(h.value.title),1)]),h.value.detail?(G(),K(`p`,cK,I(h.value.detail),1)):Z(``,!0),J(`div`,lK,[(G(!0),K(W,null,H(_.value,e=>(G(),K(`div`,{key:e.label,class:`pb-meter`},[J(`div`,uK,[J(`span`,null,I(e.label),1),J(`b`,null,I(e.text),1)]),e.ratio===null?Z(``,!0):(G(),K(`div`,dK,[J(`i`,{style:_e({width:`${Math.min(100,Math.round(e.ratio*100))}%`})},null,4)]))]))),128))])],2),m.value?(G(),K(`section`,fK,[t[7]||=J(`h4`,null,`当前焦点`,-1),J(`p`,{class:F([`pb-focus`,{"is-expanded":p.value}])},I(m.value),3),m.value.length>gK?(G(),K(`button`,{key:0,type:`button`,class:`pb-link`,onClick:t[0]||=e=>p.value=!p.value},I(p.value?`收起`:`展开`),1)):Z(``,!0)])):Z(``,!0),a.value.archived?Z(``,!0):(G(),K(`section`,pK,[l.value?(G(),q(o,{key:0,icon:`i-lucide-play`,label:`继续`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action`,disabled:!d.value||!!R(i),loading:R(i)===`restart_discussion`,onClick:t[1]||=e=>R(r)(`restart_discussion`)},null,8,[`disabled`,`loading`])):(G(),q(o,{key:1,icon:`i-lucide-pause`,label:`暂停`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action`,title:`停止本次讨论执行,继续时由主持人重新安排`,disabled:!d.value||!!R(i),loading:R(i)===`pause_discussion`,onClick:t[2]||=e=>R(r)(`pause_discussion`)},null,8,[`disabled`,`loading`])),u.value&&!l.value?(G(),q(o,{key:2,icon:`i-lucide-skip-forward`,label:`跳过`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action`,title:`跳过 ${R(n).display_name(u.value.expert)} 本次发言`,disabled:!d.value||!!R(i),loading:R(i)===`skip_turn`,onClick:t[3]||=e=>R(r)(`skip_turn`)},null,8,[`title`,`disabled`,`loading`])):Z(``,!0),Y(o,{icon:`i-lucide-flag`,label:`结束`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action pb-end`,disabled:!d.value||!!R(i),onClick:t[4]||=e=>f.value=!0},null,8,[`disabled`])])),Y(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:z(()=>[J(`div`,mK,[J(`button`,{type:`button`,class:`progress-ending-option`,disabled:!!R(i),onClick:v},[...t[8]||=[J(`strong`,null,`结束讨论`,-1),J(`span`,null,`保留全部记录;需要总结时可直接请主持人写一份。`,-1)]],8,hK)])]),_:1},8,[`content`,`open`])],64)}}},vK={class:`speaking-order`},yK={key:0,class:`speaking-order-divider speaking-order-relay`},bK={key:0,class:`speaking-order-divider`,"aria-hidden":`true`},xK=[`data-key`,`data-movable`],SK=[`aria-disabled`,`aria-label`,`title`,`onPointerdown`,`onKeydown`],CK={class:`speaking-order-number`},wK={key:1,class:`speaking-order-place`,title:`已发言`,"aria-label":`已发言`},TK=[`title`],EK={key:1,class:`speaking-order-later`},DK={key:2,class:`speaking-order-divider`,"aria-hidden":`true`},OK={class:`speaking-order-live`,"aria-live":`polite`},kK=`发言顺序刚有变化,已更新为最新顺序,请重新调整`,AK=rO({__name:`SpeakingOrder`,props:{away:{type:Array,default:()=>[]},round:{type:Number,default:0}},setup(e){let t=e,{view:n,bridge:r,act:i}=Dr(`discussion`),a=L(!1),o=$(()=>n.value.room),s=$(()=>o.value.speaking_order||{kind:`default`,items:[],movable:[]}),c=$(()=>s.value.kind==="default"?`idle`:`queued`),l=$(()=>!!n.value.access?.can_manage&&!o.value.archived&&s.value.movable.length>1),u={queue:`不在本次依次回答中`,turns:`本轮未安排`},d=$(()=>s.value.kind==="default"?`拖动设置默认发言顺序,@全体依次 按此顺序;聚焦后可用上下方向键`:`拖动调整还没发言的顺序,立即生效;聚焦后可用上下方向键`),f=L(null),p=L(null),m=L(null),h=L(``);B(()=>s.value.revision,()=>{m.value=null}),B(()=>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 _=$(()=>{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?e.step&&e.step===i[t-1]?.step?u:++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(`
60
60
  `)===s.value.movable.join(`
61
61
  `))return;let r=_.value.find(e=>e.state===c.value&&e.name===t)?.key;m.value=e,await ir(),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`,kK))}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=Ix;return G(),K(`div`,vK,[J(`ul`,{ref_key:`list`,ref:f,class:F([`pb-members`,{"is-dragging":p.value}])},[s.value.sequence?(G(),K(`li`,yK,[J(`span`,null,I(s.value.sequence.loop?`循环接力 · 第 ${s.value.sequence.pass} 圈`:`主持人安排的依次接力`),1)])):Z(``,!0),(G(!0),K(W,null,H(_.value,(t,r)=>(G(),K(W,{key:t.key},[t.outside?(G(),K(`li`,bK,[J(`span`,null,I(u[s.value.kind]),1)])):Z(``,!0),J(`li`,{class:F([`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?(G(),K(`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:[rl(e=>T(e,v(r),-1),[`up`]),rl(e=>T(e,v(r),1),[`down`])]},[J(`span`,CK,I(t.place),1),Y(i,{name:`i-lucide-grip-vertical`,class:`speaking-order-handle`})],40,SK)):t.state===`done`?(G(),K(`span`,wK,[Y(i,{name:`i-lucide-check`})])):(G(),K(`span`,{key:2,class:`speaking-order-place`,title:t.step?`与同序号的成员同时做`:t.state===`speaking`?`正在发言`:void 0},I(t.place||``),9,TK)),U(e.$slots,`default`,{item:t,place:t.place},void 0,!0)],10,xK)],64))),128)),s.value.later?.length?(G(),K(`li`,EK,[J(`details`,null,[J(`summary`,null,`后续已排 `+I(s.value.later.length)+` 轮`,1),J(`ol`,null,[(G(!0),K(W,null,H(s.value.later,(e,n)=>(G(),K(`li`,{key:n},[J(`span`,null,I(t.round?`第 ${t.round+n+1} 轮`:`后续第 ${n+1} 轮`),1),X(I(e.map(e=>R(r).display_name(e)).join(` → `)),1)]))),128))])])])):Z(``,!0),t.away.length?(G(),K(`li`,DK,[...n[2]||=[J(`span`,null,`已离开`,-1)]])):Z(``,!0),(G(!0),K(W,null,H(t.away,t=>(G(),K(`li`,{key:`away-${t}`,class:`pb-member speaking-order-row is-away`},[n[3]||=J(`span`,{class:`speaking-order-place`},null,-1),U(e.$slots,`default`,{item:{name:t,state:`away`},place:0},void 0,!0)]))),128))],2),J(`p`,OK,I(h.value),1)])}}},[[`__scopeId`,`data-v-ce2635f9`]]),jK=[`dispatched`,`started`],MK=e=>e.pending>0||jK.includes(e.execution?.status);function NK(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)}]:[]],[...MK(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 PK={class:`progress-board is-docked`},FK={class:`pb-header`},IK={class:`pb-mode`},LK={class:`pb-status-line`},RK={role:`status`},zK={key:0,class:`pb-stop-glyph`,"aria-hidden":`true`},BK={key:0,class:`pb-status-detail`},VK={key:1,class:`pb-meter pb-rounds`,title:`主持人连续派活的轮数;到上限自动停下,可继续`},HK={class:`pb-meter-label`},UK={key:0,class:`pb-bar`},WK={key:2,class:`pb-checkin`,title:`主持人给自己设的定时检查:房间还有进行中的工作时按间隔唤醒它查看进展,房间空闲后自动结束`},GK={key:3,class:`pb-chain-actions`},KK={key:2,class:`pb-section`,"aria-label":`Goal`},qK={role:`status`},JK={key:0,class:`pb-goal-usage`},YK={class:`pb-goal-usage`},XK={key:2,class:`pb-goal-actions`},ZK={key:3,class:`pb-section`,"aria-label":`当前任务`},QK={key:4,class:`pb-section`,"aria-label":`房间工作流`},$K={class:`pb-section`,"aria-label":`发言顺序`},eq={class:`pb-member-body`},tq=[`title`],nq={key:0,class:`member-id`},rq=[`title`],iq=[`title`],aq=[`title`],oq=[`title`],sq={key:5,class:`pb-actions pb-start-actions`,"aria-label":`操作`},cq={class:`pb-start-pair`},lq={key:0,class:`pb-free-note`},uq=90,dq=60,fq=`discuss-workflow-hidden:`,pq=2,mq=rO({__name:`FreeBoard`,setup(e){let{view:t,bridge:n,act:r,pending:i}=Dr(`discussion`),a=[`dispatched`,`started`],o={runner:`本机唤醒`,manual:`手动接入`},s=$(()=>t.value.room),c=$(()=>s.value.free||{}),l=$(()=>[`active`,`paused`].includes(s.value.session?.status)),u=$(()=>[`active`,`paused`].includes(s.value.goal_state?.goal?.status)?s.value.goal_state.goal:null),d=$(()=>{let e=u.value;return e?`${`已续跑 ${e.continues}${e.max_continues?` / ${e.max_continues}`:``} 次`} · 用时 ${dO(Math.floor((e.elapsed_seconds||0)/60))}${e.max_minutes?` / ${dO(e.max_minutes)}`:``}`:``}),f=$(()=>{let e=u.value;if(!e)return``;if(e.status!==`active`)return`已暂停`;let t=e.phase_until?`,${new Date(e.phase_until*1e3).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})} 兜底唤醒`:``;return e.phase===`pending`?`待你确认${t||`,等你回复`}`:e.phase===`waiting`?`等待后台工作${t}`:e.idle?`进行中 · 空闲,稍后唤醒主持人`:`进行中`}),p=L(!1),m=L(!1),h=$(()=>l.value?s.value.current_turn?.round||(s.value.completed_rounds||0)+1:0),g=$(()=>(c.value.members||[]).find(e=>e.role===`host`&&e.status===`active`)),_=$(()=>ik(t.value.launch.room_models?.workflow,c.value.members)),v=e=>!!(_.value?.enabled&&Object.values(_.value.members||{}).includes(e)),y=L(``),b=L(!1);B(()=>[s.value.id,t.value.launch.room_models,_.value?.id],([e,t,n])=>{let r=fq+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=``}b.value=!!n&&i===n},{immediate:!0});function x(){try{localStorage.setItem(fq+s.value.id,_.value.id)}catch{}b.value=!0}let S=e=>(c.value.members||[]).find(t=>t.name===e),C=$(()=>(c.value.members||[]).filter(e=>e.status===`away`).map(e=>e.name)),w=e=>e.executions.join(`-`),T=new Map;function E(e,t){if(!e||!Array.isArray(t))return;let r=t.map(w),i=T.get(e);if(T.set(e,new Set([...i||[],...r])),i)for(let e of t.filter(e=>!i.has(w(e)))){let t=e.files,r=t.slice(0,pq).join(`、`)+(t.length>pq?` 等`:``),i=e.members.map(e=>n.display_name(e)).join(` 与 `);n.notify(`warning`,`冲突:${i} 同时编辑了 ${t.length} 个相同文件(${r}),后保存的可能覆盖了先保存的,请核对`)}}B(()=>[s.value.id,c.value.conflicts],([e,t])=>E(e,t),{immediate:!0});let D=e=>e.access===`manual`&&e.status===`active`&&!e.registered_at;function O(e){return e.status===`away`?`neutral`:D(e)?`warning`:e.execution?.stale||e.pending&&e.adopt_error?`error`:e.held_until?`warning`:MK(e)?e.pending&&!a.includes(e.execution?.status)?`warning`:`primary`:e.execution?.status===`failed`?`error`:`success`}function k(e,t){if(e.status===`away`)return`已离开:不会被唤醒,可请回`;if(D(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 A(e){return e.access===`runner`?[e.adapter===`api`?`API`:``,j(e)].filter(Boolean).join(` · `):o[e.access]}function j(e){return e.access===`runner`?n.participant_model(e.name,s.value,t.value.launch.room_models):``}function M(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 N=$(()=>P.value.asked_rounds?[...new Set([P.value.asked_rounds,1])]:[...new Set([1,c.value.max_rounds||1])]),ee=L(0);async function te(e,t){ee.value=t;try{await n.continue_chain(e,t)}catch{}finally{ee.value=0}}let P=$(()=>{if(s.value.archived)return{tone:`neutral`,title:`已存档`,detail:``};let e=(c.value.members||[]).filter(MK);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=re.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:g.value?`消息默认交给 ${n.display_name(g.value.name)};@ 其他成员让它们发言`:`没有主持人:消息只作留言`}:{tone:`neutral`,title:`暂无成员`,detail:`在下方邀请 AI 加入`}}),ne=$(()=>{let e=new Set((s.value.withdrawals||[]).map(e=>e.message_id));return(c.value.requests||[]).filter(t=>!e.has(t.message_id))}),re=$(()=>Math.max(0,...(c.value.requests||[]).map(e=>e.chain_id))),ie=$(()=>(c.value.chain_rounds||[]).find(e=>e.chain_id===re.value)||null),ae=$(()=>{let e=ie.value;if(!e||!(P.value.title===`处理中`||P.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}}),oe=$(()=>{let e=ne.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}`}),se=L(!1);B(()=>s.value.id,()=>{se.value=!1});function ce(e,r){let i=n.identities[e.name];return JSON.stringify([e,r,l.value,A(e),M(e),j(e),n.participant_session_hint(e.name,s.value,t.value.launch.room_models),n.display_name(e.name),s.value.descriptions?.[e.name],v(e.name)&&_.value.label,i?.icon,i?.initials,i?.style,t.value.access,s.value.session?.status,t.value.launch.available])}function le(e){return NK(e,{view:t.value,act:r,describe:e=>{de.value=e}})}let ue=L(!1),de=L(``),fe=L(!1);B(()=>s.value.id,()=>{ue.value=!1,de.value=``});async function pe({text:e,label:t,as_template:r}){fe.value=!0;try{await n.describe_member(de.value,e,t),r&&n.save_description_template(de.value,e),de.value=``}catch{}finally{fe.value=!1}}let me=$(()=>s.value.free?.host_checkin||null),he=L(!1),ge=$(()=>!!(g.value&&g.value.access===`runner`)&&t.value.launch.available);return B(()=>s.value.id,()=>{he.value=!1}),(e,a)=>{let o=Zx,c=Bx,w=Ix,T=qD;return G(),K(`div`,PK,[J(`header`,FK,[J(`strong`,null,I(l.value?`讨论进度`:`房间`),1),J(`span`,IK,I(g.value?`${R(n).display_name(g.value.name)} 主持`:`无主持人`),1)]),l.value?(G(),q(_K,{key:0})):(G(),K(`section`,{key:1,class:F([`pb-status`,`is-${P.value.tone}`]),"aria-label":`房间状态`},[J(`div`,LK,[a[14]||=J(`span`,{class:`pb-dot`},null,-1),J(`strong`,RK,I(P.value.title),1),P.value.title===`处理中`&&R(t).access?.can_manage?(G(),q(o,{key:0,label:`全部停止`,size:`xs`,color:`error`,variant:`soft`,class:`pb-stop-all`,title:`停止所有成员正在做的工作,并取消还没投递的请求;发新消息即重新开始`,loading:R(i)===`stop_room`,disabled:!!R(i),onClick:a[0]||=e=>R(r)(`stop_room`)},{leading:z(()=>[R(i)===`stop_room`?Z(``,!0):(G(),K(`span`,zK))]),_:1},8,[`loading`,`disabled`])):Z(``,!0)]),P.value.detail?(G(),K(`p`,BK,I(P.value.detail),1)):Z(``,!0),ae.value?(G(),K(`div`,VK,[J(`div`,HK,[a[15]||=J(`span`,null,`连续派活`,-1),J(`b`,null,I(ae.value.text),1)]),ae.value.ratio===null?Z(``,!0):(G(),K(`div`,UK,[J(`i`,{style:_e({width:`${Math.round(ae.value.ratio*100)}%`})},null,4)]))])):Z(``,!0),me.value?(G(),K(`div`,WK,[J(`span`,null,`定时检查 · 每 `+I(me.value.minutes)+` 分钟 · 下次 `+I(R(n).format_time(me.value.due_at*1e3)),1),R(t).access?.can_manage?(G(),q(o,{key:0,label:`关闭`,size:`xs`,color:`neutral`,variant:`ghost`,loading:R(i)===`stop_host_checkin`,disabled:!!R(i),onClick:a[1]||=e=>R(r)(`stop_host_checkin`)},null,8,[`loading`,`disabled`])):Z(``,!0)])):Z(``,!0),P.value.continue_chain&&R(t).access?.can_manage?(G(),K(`div`,GK,[(G(!0),K(W,null,H(N.value,e=>(G(),q(o,{key:e,label:e===P.value.asked_rounds?`批准 ${e} 轮`:`继续 ${e} 轮`,icon:`i-lucide-play`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action`,loading:ee.value===e,disabled:!!ee.value,onClick:t=>te(P.value.continue_chain,e)},null,8,[`label`,`loading`,`disabled`,`onClick`]))),128))])):Z(``,!0)],2)),u.value?(G(),K(`section`,KK,[a[17]||=J(`h4`,null,`Goal`,-1),J(`div`,{class:F([`pb-goal-status`,u.value.status===`active`?u.value.phase===`pending`?`is-warning`:`is-success`:`is-paused`])},[a[16]||=J(`span`,{class:`pb-dot`},null,-1),J(`span`,qK,I(f.value),1)],2),u.value.status===`active`&&u.value.phase!==`doing`&&u.value.phase_note?(G(),K(`p`,JK,I(u.value.phase_note),1)):Z(``,!0),J(`p`,{class:F([`pb-focus`,{"is-expanded":p.value}])},I(u.value.objective),3),u.value.objective.length>dq?(G(),K(`button`,{key:1,type:`button`,class:`pb-link`,onClick:a[2]||=e=>p.value=!p.value},I(p.value?`收起`:`展开`),1)):Z(``,!0),J(`p`,YK,I(d.value),1),R(t).access?.can_manage&&!s.value.archived?(G(),K(`div`,XK,[Y(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:R(i)===`goal_control`,disabled:!!R(i),onClick:a[3]||=e=>R(r)(`goal_control`,u.value.status===`active`?`pause`:`resume`)},null,8,[`label`,`icon`,`title`,`loading`,`disabled`]),Y(o,{label:`编辑`,icon:`i-lucide-pencil`,size:`xs`,color:`neutral`,variant:`outline`,disabled:!!R(i),onClick:a[4]||=e=>m.value=!0},null,8,[`disabled`]),Y(o,{label:`结束`,icon:`i-lucide-square`,size:`xs`,color:`neutral`,variant:`outline`,title:`结束 Goal,主持人不再自动推进;正在进行的工作不受影响`,loading:R(i)===`goal_control`,disabled:!!R(i),onClick:a[5]||=e=>R(r)(`goal_control`,`clear`)},null,8,[`loading`,`disabled`])])):Z(``,!0)])):Z(``,!0),oe.value&&!l.value?(G(),K(`section`,ZK,[a[18]||=J(`h4`,null,`当前任务`,-1),J(`p`,{class:F([`pb-focus`,{"is-expanded":se.value}])},I(oe.value),3),oe.value.length>uq?(G(),K(`button`,{key:0,type:`button`,class:`pb-link`,onClick:a[6]||=e=>se.value=!se.value},I(se.value?`收起`:`展开`),1)):Z(``,!0)])):Z(``,!0),_.value&&!b.value?(G(),K(`section`,QK,[a[19]||=J(`h4`,null,`工作流`,-1),Y(nK,{workflow:_.value,dismissible:``,onDismiss:x},null,8,[`workflow`])])):Z(``,!0),J(`section`,$K,[a[21]||=J(`h4`,null,`发言顺序`,-1),Y(AK,{away:C.value,round:h.value},{default:z(({item:e})=>[(G(!0),K(W,null,H([S(e.name)].filter(Boolean),r=>(G(),q(R(qj),{key:r.id,deps:[ce(r,e.state)]},{default:z(()=>[Y(c,{src:R(n).identities[r.name]?.icon,text:R(n).identities[r.name]?.initials,alt:r.name,size:`xs`,class:F([`channel-avatar`,R(n).identities[r.name]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`div`,eq,[J(`div`,{class:`pb-member-name`,title:s.value.descriptions?.[r.name]||void 0},[X(I(R(n).display_name(r.name)),1),R(n).display_name(r.name)===r.name?Z(``,!0):(G(),K(`span`,nq,I(r.name),1)),r.role===`host`?(G(),q(w,{key:1,name:`i-lucide-crown`,title:`主持人`})):Z(``,!0),J(`small`,{title:A(r)||void 0},I(A(r)),9,rq)],8,tq),v(r.name)?(G(),K(`small`,{key:0,class:`pb-workflow-member`,title:`来自工作流「${_.value.label}」`},`工作流`,8,iq)):Z(``,!0),M(r)?(G(),K(`div`,{key:1,class:`pb-member-model`,title:R(n).participant_session_hint(r.name,s.value,R(t).launch.room_models)},I(M(r)),9,aq)):Z(``,!0),J(`div`,{class:F([`pb-member-status`,`is-${O(r)}`])},[a[20]||=J(`span`,{class:`pb-dot`},null,-1),J(`span`,{class:`pb-member-status-text`,title:r.execution?.status===`failed`?r.execution.result:r.held_until?k(r,e.state):void 0},I(k(r,e.state)),9,oq)],2)]),Y(T,{items:le(r),content:{align:`end`},ui:{content:`channel-menu`}},{default:z(()=>[Y(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?Z(``,!0):(G(),q(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[7]||=e=>{y.value=``,ue.value=!0}}))]),!s.value.archived&&!l.value&&!u.value?(G(),K(`section`,sq,[J(`div`,cq,[Y(o,{icon:`i-lucide-messages-square`,label:`开启讨论`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action pb-restart`,title:`由主持人推进成员轮流发言,到上限或结束时停止`,disabled:!ge.value,onClick:a[8]||=e=>he.value=!0},null,8,[`disabled`]),Y(o,{icon:`i-lucide-target`,label:`开启 Goal`,size:`sm`,color:`neutral`,variant:`outline`,class:`pb-action pb-restart`,title:`主持人持续推进一个目标:房间空闲时自动接着做,直到完成、卡住或你结束`,disabled:!ge.value,onClick:a[9]||=e=>m.value=!0},null,8,[`disabled`])]),ge.value?Z(``,!0):(G(),K(`p`,lq,`开启讨论或 Goal 需要一位由本机唤醒的 AI 主持人。`))])):Z(``,!0),Y(aK,{open:he.value,"onUpdate:open":a[10]||=e=>he.value=e},null,8,[`open`]),Y(TO,{open:m.value,"onUpdate:open":a[11]||=e=>m.value=e,edit:!!u.value,initial:u.value},null,8,[`open`,`edit`,`initial`]),Y(JG,{open:ue.value,"onUpdate:open":a[12]||=e=>ue.value=e,"workflow-id":y.value,description:`新成员加入后不打断其他成员;点卡片翻面可设置软件、模型、项目权限和要续接的已有会话。`},null,8,[`open`,`workflow-id`]),Y(VL,{open:!!de.value,name:de.value||` `,platform:de.value?R(n).default_name(R(n).platform_of(de.value)):``,default_label:de.value?R(n).default_name(de.value):``,text:s.value.descriptions?.[de.value]||``,label:s.value.labels?.[de.value]||``,template:de.value?R(n).description_template(de.value):``,saving:fe.value,"onUpdate:open":a[13]||=e=>{e||(de.value=``)},onSave:pe},null,8,[`open`,`name`,`platform`,`default_label`,`text`,`label`,`template`,`saving`])])}}},[[`__scopeId`,`data-v-f2a8d519`]]),hq={class:`merged-section discussion-history`,"aria-label":`讨论记录`},gq={key:0,class:`fine-print`},_q={class:`history-timeline`},vq={key:0,class:`history-free`},yq={key:1,class:`history-discussion`},bq={class:`history-meta`},xq={key:0,class:`fine-print`},Sq={key:1,class:`fine-print`},Cq={key:2,class:`history-conclusion`},wq=[`onClick`],Tq=[`innerHTML`],Eq={key:1,class:`fine-print`},Dq=[`aria-expanded`,`onClick`],Oq=[`innerHTML`],kq=rO({__name:`DiscussionHistory`,emits:[`detail`],setup(e){let{view:t,bridge:n}=Dr(`discussion`),r={active:{label:`进行中`,color:`primary`},paused:{label:`已暂停`,color:`neutral`},concluded:{label:`已结束`,color:`neutral`}},i=$(()=>t.value.room),a=L(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=$(()=>{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=VD,d=Ix;return G(),K(`section`,hq,[t[2]||=J(`div`,{class:`page-heading`},[J(`div`,null,[J(`h2`,null,`讨论记录`),J(`p`,null,`每场讨论及其结束时的结论,最新的在上;讨论之外的消息按段汇总。`)])],-1),i.value.discussions?.length?Z(``,!0):(G(),K(`p`,gq,`还没有开启过讨论。`)),J(`ol`,_q,[(G(!0),K(W,null,H(c.value,i=>(G(),K(`li`,{key:i.key,class:F(`is-${i.kind}`)},[t[1]||=J(`span`,{class:`history-dot`,"aria-hidden":`true`},null,-1),i.kind===`free`?(G(),K(`p`,vq,`讨论之外 · `+I(i.count)+` 条消息`,1)):(G(),K(`article`,yq,[J(`header`,null,[J(`h3`,null,[J(`small`,null,`讨论 `+I(i.number),1),X(I(i.goal||`未填写目标`),1)]),Y(l,{color:r[i.status]?.color||`neutral`,variant:`subtle`,size:`sm`},{default:z(()=>[X(I(r[i.status]?.label||i.status),1)]),_:2},1032,[`color`])]),J(`p`,bq,[X(I(s(i.created_at))+` 开始 · `+I(i.count)+` 条消息`,1),i.status===`concluded`&&i.state!==null?(G(),K(W,{key:0},[X(` · `+I(R(n).stop_reason_label(i)),1)],64)):Z(``,!0),i.concluded_at?(G(),K(W,{key:1},[X(` · `+I(s(i.concluded_at))+` 结束`,1)],64)):Z(``,!0)]),i.result?.current?(G(),K(`p`,xq,`结论即上方的当前共识。`)):i.result?.missing?(G(),K(`p`,Sq,`这场讨论结束于结论快照功能之前,没有保存当时的结论。`)):i.result?(G(),K(`div`,Cq,[J(`small`,null,[X(I(i.result.label),1),i.result.until?(G(),K(`button`,{key:0,type:`button`,class:`subtle-link`,onClick:t=>e.$emit(`detail`,i.result.until)},`整理至 #`+I(i.result.until),9,wq)):Z(``,!0)]),i.result.brief?(G(),K(`div`,{key:0,class:`markdown-body`,innerHTML:o(i.result.brief)},null,8,Tq)):i.result.state?Z(``,!0):(G(),K(`p`,Eq,`主持人没有留下简报或共识。`)),i.result.state?(G(),K(W,{key:2},[J(`button`,{type:`button`,class:`history-toggle`,"aria-expanded":a.value.has(i.id),onClick:e=>u(i.id)},[t[0]||=X(`详细共识与进度`,-1),Y(d,{name:a.value.has(i.id)?`i-lucide-chevron-up`:`i-lucide-chevron-down`},null,8,[`name`])],8,Dq),a.value.has(i.id)?(G(),K(`div`,{key:0,class:`markdown-body history-state`,innerHTML:o(i.result.state)},null,8,Oq)):Z(``,!0)],64)):Z(``,!0)])):Z(``,!0)]))],2))),128))])])}}},[[`__scopeId`,`data-v-9837033c`]]),Aq={class:`merged-section room-overview`,"aria-label":`成员与设置`},jq={key:0,class:`overview-section overview-project`,"aria-label":`项目目录`},Mq={class:`overview-project-head`},Nq={class:`overview-muted`},Pq={class:`overview-directories`},Fq={class:`overview-main-directory`},Iq={class:`overview-main-box`,title:`主目录,设置后不能更改`},Lq={class:`overview-main-prefix`},Rq={class:`overview-main-path`},zq={key:2,class:`overview-muted`},Bq={key:3,class:`overview-directories-actions`},Vq={class:`page-heading`},Hq={class:`overview-section`},Uq={key:0,class:`overview-local`,role:`status`},Wq={class:`member-cards`,"aria-label":`成员`},Gq=[`draggable`,`onDragstart`,`onDragover`,`onDragleave`,`onDrop`],Kq={class:`member-card-head`},qq={class:`member-card-name`},Jq={key:0,class:`member-id`},Yq=[`title`],Xq={class:`member-card-facts`},Zq=[`aria-label`,`title`],Qq=[`aria-checked`,`disabled`,`onClick`],$q={key:1},eJ=[`title`],tJ=[`aria-label`,`aria-busy`,`title`],nJ=[`aria-checked`,`title`,`disabled`,`onClick`],rJ=[`title`],iJ=[`title`],aJ=[`aria-label`],oJ={key:0},sJ={class:`overview-section`},cJ={class:`overview-settings`},lJ={key:0},uJ={class:`overview-workflow`},dJ={key:1,class:`overview-muted`},fJ={key:1},pJ={key:2},mJ={key:1},hJ={key:2},gJ={key:3},_J={key:4},vJ={class:`overview-address`},yJ={key:5},bJ={key:0},xJ={key:1},SJ={key:2,class:`overview-muted`},CJ={key:4,class:`overview-muted`},wJ={class:`overview-model-actions`},TJ=`设为主持人`,EJ=rO({__name:`RoomOverview`,setup(e){let{view:t,bridge:n,act:r}=Dr(`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=$(()=>t.value.room),d=$(()=>![`active`,`paused`].includes(u.value.session?.status)),f=$(()=>t.value.launch.room_models?.room_id===u.value.id?t.value.launch.room_models:null),p=$(()=>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=L(``),g=L(!1),_=L(0);B(()=>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=L(!1),b=L(0);B(()=>f.value?.api_max_requests,e=>{b.value=e??0},{immediate:!0});let x=L(!1),S=L([]),C=L(``);B(()=>f.value?.extra_directories,e=>{S.value=[...e||[]]},{immediate:!0}),B(()=>f.value?.project_directory,()=>{C.value=``});let w=$(()=>!!C.value.trim()||JSON.stringify(S.value)!==JSON.stringify(f.value?.extra_directories||[])),T=$(()=>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=$(()=>u.value.speaking_order||{kind:`default`,movable:[],default:[]}),A=$(()=>{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))}),j=$(()=>!!t.value.access?.can_manage&&!u.value.archived&&k.value.kind==="default"&&k.value.movable.length>1),M=L(``),N=L(``),ee=L(``);function te(e,t){M.value=e.name,t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,e.name)}function P(e,t){M.value&&M.value!==e.name&&k.value.movable.includes(e.name)&&(t.preventDefault(),N.value=e.name)}function ne(e){let t=[...k.value.movable],n=t.indexOf(M.value),i=t.indexOf(e.name);re(),!(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 re(){M.value=N.value=ee.value=``}let ie=$(()=>ik(f.value?.workflow,u.value.free?.members)),ae=e=>!!(ie.value?.enabled&&Object.values(ie.value.members||{}).includes(e));function oe(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 se(e){return(u.value.free?.members||[]).find(t=>t.name===e.name)||e}async function ce(e,t){if(!(h.value||oe(se(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 le(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 ue(e,t){if(!(h.value||le(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)} 已改为${YL(t)},下次处理请求起生效。`)}catch(e){n.notify(`error`,e.message)}finally{h.value=``}}}let de={low:`Low`,medium:`Medium`,high:`High`,xhigh:`Extra High`,max:`Max`,ultra:`Ultra`};function fe(e){let n=f.value?.participants?.[e.name],r=NI(n?.adapter)?.kind;return e.access===`runner`&&!!r&&r!==`app`&&n.project_access!==`own`&&!m(e.name)&&t.value.access?.can_manage&&t.value.launch.available}let pe=L(null),me=L(!1),he=$(()=>pe.value&&n.launch_model_state(pe.value.name,t.value.launch,pe.value.draft)),ge=$(()=>pe.value&&!NI(pe.value.draft.adapter)?.models),_e=$(()=>{let e=he.value?.efforts||(ge.value?NI(pe.value.draft.adapter)?.efforts:null);return e?.length?[{label:`默认强度`,value:``},...e.map(e=>({label:de[e]||e,value:e}))]:null});function ve(e){let{adapter:t,model:r,effort:i}=f.value.participants[e.name];pe.value={name:e.name,draft:{adapter:t,model:r||``,effort:i||``}},ge.value||n.load_launch_models(e.name,!1,pe.value.draft)}function ye(e){let t=pe.value.draft;t.model=e===`__default__`?``:e,t.adapter===`antigravity_cli`&&n.load_launch_models(pe.value.name,!1,t),he.value?.efforts?.includes(t.effort)||(t.effort=``)}async function be(){let{name:e,draft:t}=pe.value;me.value=!0;try{await n.set_member_model({name:e,model:t.model,effort:t.effort}),n.notify(`info`,`${n.display_name(e)} 的模型与强度已更新,下次处理请求起生效,保留原会话。`),pe.value=null}catch(e){n.notify(`error`,e.message)}finally{me.value=!1}}let xe=$(()=>{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 Se(e){let[n,i,a]=NK(se(e),{view:t.value,act:r,describe:e=>{Ee.value=e}});return d.value?{taking_part:n,host:i.find(e=>e.label===TJ)||null,place:[...i.filter(e=>e.label!==TJ),...a]}:{taking_part:n,host:null,place:[]}}function Ce(e){let r=n.identities[e.name];return JSON.stringify([e,se(e),f.value?.participants?.[e.name],t.value.access,t.value.launch.available,d.value,j.value&&k.value.movable.includes(e.name),M.value===e.name,N.value===e.name,ee.value===e.name,h.value,ae(e.name)&&ie.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 we=L(!1),Te=L(``),Ee=L(``),De=L(!1);B(()=>u.value.id,()=>{we.value=!1,Ee.value=``});async function Oe({text:e,label:t,as_template:r}){De.value=!0;try{await n.describe_member(Ee.value,e,t),r&&n.save_description_template(Ee.value,e),Ee.value=``}catch{}finally{De.value=!1}}let ke=$(()=>`${t.value.room_site}/r/${u.value.id}`),Ae=$(()=>u.value.created_at?new Date(u.value.created_at).toLocaleString(`zh-CN`,{hour12:!1}):``);return(e,i)=>{let s=Ix,l=Zx,de=Bx,je=VD,Me=WD,Ne=$D,Pe=LD;return G(),K(`section`,Aq,[f.value?.registered?(G(),K(`section`,jq,[J(`header`,Mq,[Y(s,{name:`i-lucide-folder-tree`}),i[16]||=J(`h3`,null,`项目目录`,-1),J(`span`,Nq,I(f.value.project_directory?`成员按自己的项目权限读写其他目录,在别处工作的成员只读。改动从各成员下一次执行起生效,会话保留。`:`主目录只能设置一次,之后不能更改。已在房间的成员保留原会话,按自己的项目权限读写它;之后邀请的成员在其中工作。`),1)]),J(`div`,Pq,[f.value.project_directory?(G(),K(W,{key:0},[J(`div`,Fq,[J(`div`,Iq,[J(`span`,Lq,[Y(s,{name:`i-lucide-lock`})]),J(`span`,Rq,I(R(n).display_path(f.value.project_directory)),1),i[17]||=J(`span`,{class:`overview-main-tag`},`主目录`,-1)]),R(t).launch.projects_restricted?Z(``,!0):(G(),q(l,{key:0,icon:`i-lucide-copy`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`复制项目目录`,title:`复制路径`,onClick:i[0]||=e=>R(r)(`copy`,f.value.project_directory)}))]),Y(Mz,{modelValue:S.value,"onUpdate:modelValue":i[1]||=e=>S.value=e,disabled:!T.value||x.value},null,8,[`modelValue`,`disabled`])],64)):T.value?(G(),q(Dz,{key:1,modelValue:C.value,"onUpdate:modelValue":i[2]||=e=>C.value=e,compact:``,placeholder:`为本房间设置项目目录的完整路径`,disabled:x.value},null,8,[`modelValue`,`disabled`])):(G(),K(`span`,zq,`未指定`)),w.value?(G(),K(`div`,Bq,[Y(l,{label:`取消`,color:`neutral`,variant:`ghost`,size:`xs`,disabled:x.value,onClick:D},null,8,[`disabled`]),Y(l,{label:`保存`,size:`xs`,class:`channel-primary-button`,loading:x.value,onClick:E},null,8,[`loading`])])):Z(``,!0)])])):Z(``,!0),J(`div`,Vq,[i[18]||=J(`div`,null,[J(`h2`,null,`成员与设置`),J(`p`,null,`成员的接入、权限与全部操作,以及房间的协作设置;右栏成员菜单是同样操作的快捷入口。`)],-1),u.value.archived?Z(``,!0):(G(),q(l,{key:0,icon:`i-lucide-plus`,label:`邀请 AI 加入`,variant:`outline`,color:`neutral`,class:`channel-surface-button`,disabled:!R(t).access?.can_manage,onClick:i[3]||=e=>we.value=!0},null,8,[`disabled`]))]),J(`section`,Hq,[i[23]||=J(`h3`,null,`成员`,-1),p.value?(G(),K(`p`,Uq,[X(I(p.value.text),1),p.value.retry?(G(),K(`button`,{key:0,type:`button`,class:`subtle-link`,onClick:i[4]||=e=>R(n).reload_room_models()},`重试`)):Z(``,!0)])):Z(``,!0),J(`ul`,Wq,[(G(!0),K(W,null,H(A.value,e=>(G(),q(R(qj),{key:e.name,deps:[Ce(e)]},{default:z(()=>[J(`li`,{class:F([`member-card`,{"is-dimmed":M.value===e.name,"is-drop-target":N.value===e.name}]),draggable:ee.value===e.name,onDragstart:t=>te(e,t),onDragover:t=>P(e,t),onDragleave:t=>N.value===e.name&&(N.value=``),onDrop:nl(t=>ne(e),[`prevent`]),onDragend:re},[J(`header`,Kq,[j.value&&k.value.movable.includes(e.name)?(G(),q(s,{key:0,name:`i-lucide-grip-vertical`,class:`member-card-grip`,title:`拖动调整成员顺序,右栏发言顺序与 @全体依次 同步`,onPointerdown:t=>ee.value=e.name,onPointerup:i[5]||=e=>ee.value=``},null,8,[`onPointerdown`])):Z(``,!0),Y(de,{src:R(n).identities[e.name]?.icon,text:R(n).identities[e.name]?.initials,alt:e.name,size:`md`,class:F([`channel-avatar`,R(n).identities[e.name]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`div`,qq,[J(`strong`,null,[X(I(R(n).display_name(e.name)),1),R(n).display_name(e.name)===e.name?Z(``,!0):(G(),K(`span`,Jq,I(e.name),1)),e.role===`host`?(G(),q(s,{key:1,name:`i-lucide-crown`,title:`主持人`})):Z(``,!0)]),u.value.descriptions?.[e.name]?(G(),K(`small`,{key:0,title:u.value.descriptions[e.name]},I(u.value.descriptions[e.name]),9,Yq)):Z(``,!0)]),Se(e).host?(G(),q(l,{key:1,class:`member-card-host`,title:Se(e).host.label,icon:Se(e).host.icon,label:Se(e).host.label,size:`xs`,variant:`ghost`,color:`neutral`,disabled:Se(e).host.disabled,onClick:t=>Se(e).host.onSelect()},null,8,[`title`,`icon`,`label`,`disabled`,`onClick`])):Z(``,!0),ae(e.name)?(G(),q(je,{key:2,color:`neutral`,variant:`outline`,size:`sm`,title:`来自工作流「${ie.value.label}」,提示词按工作流卡片发送`},{default:z(()=>[...i[19]||=[X(`工作流`,-1)]]),_:1},8,[`title`])):Z(``,!0),Y(je,{color:o(e)?`warning`:e.status===`active`?`success`:`neutral`,variant:`subtle`,size:`sm`},{default:z(()=>[X(I(o(e)?`待注册`:a[e.status]||e.status),1)]),_:2},1032,[`color`])]),J(`dl`,Xq,[J(`div`,null,[i[20]||=J(`dt`,null,`接入`,-1),J(`dd`,null,[oe(se(e)).value?(G(),K(`div`,{key:0,class:F([`expert-card-modes overview-switch`,{"is-locked":!oe(se(e)).editable}]),role:`radiogroup`,"aria-label":`${e.name} 的接入方式`,title:oe(se(e)).hint},[(G(),K(W,null,H(c,t=>J(`button`,{key:t.value,type:`button`,role:`radio`,"aria-checked":oe(se(e)).value===t.value,disabled:!oe(se(e)).editable||!!h.value,onClick:n=>ce(e,t.value)},I(t.label),9,Qq)),64))],10,Zq)):(G(),K(`span`,$q,I(oe(e).text),1))])]),J(`div`,null,[i[21]||=J(`dt`,null,`模型`,-1),J(`dd`,{class:F([`overview-model`,{"overview-muted":m(e.name)}]),title:R(n).participant_model(e.name,u.value,f.value)||void 0},[J(`span`,null,I(e.access===`runner`?R(n).participant_model(e.name,u.value,f.value)||`—`:`在它自己的会话里设置`),1),fe(e)?(G(),q(l,{key:0,icon:`i-lucide-pencil`,size:`xs`,variant:`ghost`,color:`neutral`,"aria-label":`更改 ${e.name} 的模型与强度`,title:`更改模型与思考强度`,onClick:t=>ve(e)},null,8,[`aria-label`,`onClick`])):Z(``,!0)],10,eJ)]),J(`div`,null,[i[22]||=J(`dt`,null,`项目文件`,-1),J(`dd`,null,[le(e).value?(G(),K(`div`,{key:0,class:F([`expert-card-modes overview-switch`,{"is-locked":!le(e).editable}]),role:`radiogroup`,"aria-label":`${e.name} 的项目文件权限`,"aria-busy":h.value===e.name,title:le(e).hint||void 0},[(G(!0),K(W,null,H(R(JL)(f.value?.participants?.[e.name]?.adapter),t=>(G(),K(`button`,{key:t.value,type:`button`,role:`radio`,"aria-checked":le(e).value===t.value,title:t.hint,disabled:t.disabled||!le(e).editable||!!h.value,onClick:n=>ue(e,t.value)},I(t.label),9,nJ))),128))],10,tJ)):(G(),K(`span`,{key:1,class:`overview-muted`,title:le(e).hint},I(le(e).text),9,rJ))])]),f.value?.participants?.[e.name]?.outside_directory?(G(),K(`div`,{key:0,class:`overview-outside`,title:R(n).display_path(f.value.participants[e.name].outside_directory)},[Y(s,{name:`i-lucide-triangle-alert`}),J(`span`,null,`在 `+I(R(n).display_path(f.value.participants[e.name].outside_directory))+` 工作,房间目录`+I(f.value.participants[e.name].outside_enforced?`只读`:`只读(仅任务要求,程序拦不住)`),1)],8,iJ)):Z(``,!0)]),J(`footer`,{class:`member-card-actions`,"aria-label":`${e.name} 的操作`},[J(`div`,null,[(G(!0),K(W,null,H(Se(e).taking_part,e=>(G(),q(l,{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))]),Se(e).place.length?(G(),K(`div`,oJ,[(G(!0),K(W,null,H(Se(e).place,e=>(G(),q(l,{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))])):Z(``,!0)],8,aJ)],42,Gq)]),_:2},1032,[`deps`]))),128))]),i[24]||=J(`p`,{class:`overview-result`},`复制说明或下载配置不代表 AI 已接入,以实际回答和运行记录为准。`,-1)]),J(`section`,sJ,[i[35]||=J(`h3`,null,`协作设置`,-1),J(`dl`,cJ,[J(`div`,null,[i[25]||=J(`dt`,null,`主持人`,-1),J(`dd`,null,I(u.value.host?R(n).display_name(u.value.host):`未指定`),1)]),J(`div`,null,[i[26]||=J(`dt`,null,`智能调度`,-1),J(`dd`,null,[f.value?.registered?(G(),q(dB,{key:0,room:``,compact:``,free:d.value,disabled:!R(t).access?.can_manage||u.value.archived},null,8,[`free`,`disabled`])):(G(),K(W,{key:1},[X(I(xe.value),1)],64))])]),f.value?.registered?(G(),K(`div`,lJ,[i[27]||=J(`dt`,null,`生图`,-1),J(`dd`,null,[Y(PB,{compact:``,enabled:!!f.value.image_generation,disabled:!R(t).access?.can_manage||u.value.archived,"onUpdate:enabled":i[6]||=e=>R(n).set_room_image_generation(e).catch(()=>{})},null,8,[`enabled`,`disabled`])])])):Z(``,!0),J(`div`,null,[i[28]||=J(`dt`,null,`工作流`,-1),J(`dd`,uJ,[ie.value?(G(),q(nK,{key:0,workflow:ie.value},null,8,[`workflow`])):(G(),K(`span`,dJ,`没有进行中的工作流;在输入框打 / 或邀请成员时选择`))])]),f.value?.registered?(G(),K(`div`,fJ,[i[29]||=J(`dt`,null,`主持人自建工作流`,-1),J(`dd`,null,[Y(FB,{"model-value":!!f.value.host_workflows,disabled:!R(t).access?.can_manage||u.value.archived,"onUpdate:modelValue":i[7]||=e=>R(r)(`set_room_host_workflows`,e)},null,8,[`model-value`,`disabled`])])])):Z(``,!0),u.value.free?.max_rounds==null?Z(``,!0):(G(),K(`div`,pJ,[i[30]||=J(`dt`,null,`连续派活上限`,-1),J(`dd`,null,[R(t).access?.can_manage?(G(),q(nL,{key:0,"model-value":_.value,disabled:g.value,"onUpdate:modelValue":v},null,8,[`model-value`,`disabled`])):u.value.free.max_rounds?(G(),K(`span`,mJ,I(u.value.free.max_rounds)+` 轮后停下等你`,1)):(G(),K(`span`,hJ,`不限轮数`))])])),f.value?.registered?(G(),K(`div`,gJ,[i[31]||=J(`dt`,null,`API 请求上限`,-1),J(`dd`,null,[Y(qI,{"model-value":b.value,disabled:!R(t).access?.can_manage||u.value.archived||y.value,"onUpdate:modelValue":O},null,8,[`model-value`,`disabled`])])])):Z(``,!0),d.value?Z(``,!0):(G(),K(`div`,_J,[i[32]||=J(`dt`,null,`逐人追问`,-1),J(`dd`,null,I(u.value.named_followup?`开启:主持人每轮给每位专家写针对性追问`:`关闭:首轮后请专家回应上一轮观点`),1)])),J(`div`,null,[i[33]||=J(`dt`,null,`阅读地址`,-1),J(`dd`,vJ,[J(`code`,null,I(ke.value),1),Y(l,{icon:`i-lucide-copy`,color:`neutral`,variant:`ghost`,size:`xs`,"aria-label":`复制阅读地址`,onClick:i[8]||=e=>R(r)(`copy`,ke.value)})])]),Ae.value?(G(),K(`div`,yJ,[i[34]||=J(`dt`,null,`创建时间`,-1),J(`dd`,null,I(Ae.value),1)])):Z(``,!0)])]),Y(JG,{open:we.value,"onUpdate:open":[i[9]||=e=>we.value=e,i[10]||=e=>{e||(Te.value=``)}],"workflow-id":Te.value,description:d.value?`新成员加入后不打断其他成员;点卡片翻面可设置软件、模型、项目权限和要续接的已有会话。`:`新专家由程序按本机软件配置启动,或由你手动启动,加入本轮发言队列。`},null,8,[`open`,`workflow-id`,`description`]),Y(Pe,{content:{onInteractOutside:e=>e.preventDefault()},open:!!pe.value,title:pe.value?`${R(n).display_name(pe.value.name)} 的模型与强度`:``,description:`下次处理请求起生效,保留原会话。`,ui:{content:`glass-panel studio-modal`,body:`dialog-body`},"onUpdate:open":i[14]||=e=>{e||(pe.value=null)}},{body:z(()=>[pe.value?(G(),K(`form`,{key:0,class:`overview-model-form`,onSubmit:nl(be,[`prevent`])},[ge.value?(G(),K(`label`,bJ,[i[36]||=J(`span`,null,`模型 ID`,-1),Y(Me,{modelValue:pe.value.draft.model,"onUpdate:modelValue":i[11]||=e=>pe.value.draft.model=e,modelModifiers:{trim:!0},"aria-label":`${pe.value.name} 使用的模型 ID`,class:`w-full`},null,8,[`modelValue`,`aria-label`])])):(G(),K(`label`,xJ,[i[37]||=J(`span`,null,`模型`,-1),Y(Ne,{"model-value":pe.value.draft.model||`__default__`,items:he.value.items,title:he.value.source,"aria-label":`${pe.value.name} 使用的模型`,class:`w-full`,"onUpdate:modelValue":ye},null,8,[`model-value`,`items`,`title`,`aria-label`])])),!ge.value&&(he.value.loading||he.value.error)?(G(),K(`p`,SJ,I(he.value.loading?`正在读取软件模型列表…`:he.value.error),1)):Z(``,!0),_e.value?(G(),q(gL,{key:3,caption:`强度`,items:_e.value,"model-value":pe.value.draft.effort,label:`${pe.value.name} 的思考强度`,"onUpdate:modelValue":i[12]||=e=>pe.value.draft.effort=e},null,8,[`items`,`model-value`,`label`])):(G(),K(`p`,CJ,I(he.value.effort_note),1)),J(`div`,wJ,[Y(l,{label:`取消`,color:`neutral`,variant:`ghost`,onClick:i[13]||=e=>pe.value=null}),Y(l,{type:`submit`,label:`保存`,class:`channel-primary-button`,loading:me.value},null,8,[`loading`])])],32)):Z(``,!0)]),_:1},8,[`content`,`open`,`title`]),Y(VL,{open:!!Ee.value,name:Ee.value||` `,platform:Ee.value?R(n).default_name(R(n).platform_of(Ee.value)):``,default_label:Ee.value?R(n).default_name(Ee.value):``,text:u.value.descriptions?.[Ee.value]||``,label:u.value.labels?.[Ee.value]||``,template:Ee.value?R(n).description_template(Ee.value):``,saving:De.value,"onUpdate:open":i[15]||=e=>{e||(Ee.value=``)},onSave:Oe},null,8,[`open`,`name`,`platform`,`default_label`,`text`,`label`,`template`,`saving`])])}}},[[`__scopeId`,`data-v-40e04545`]]),DJ={thinking:`思考`,command:`命令`,tool:`工具`,editing:`编辑`,writing:`撰写`},OJ={thinking:`model`,writing:`model`,command:`tool`,tool:`tool`,editing:`tool`},kJ={running:`进行中`,done:`完成`,failed:`失败`,cancelled:`已撤销`},AJ=3e5,jJ=.03;function MJ(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 NJ(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}}function PJ(e){let t=e.work?e.work[0]:e.end,n=new Map;for(let t of e.segments)n.set(t.phase,(n.get(t.phase)||0)+Math.max(0,t.seen-t.start));return{wait:Math.max(0,t-e.queue[0]),work:e.work?e.work[1]-e.work[0]:0,phases:[...n].map(([e,t])=>({phase:e,ms:t})).sort((e,t)=>t.ms-e.ms)}}var FJ=1e3,IJ=1e4,LJ=3;function RJ(e,t){let{item:n}=e;if(n.source===`user`)return{tone:`done`,text:e.end>e.start?`阅读与思考 ${MJ(e.end-e.start)}`:`发出消息`};if(n.state===`failed`)return{tone:`failed`,text:`失败:${n.reason||`执行失败`}`};if(n.state===`cancelled`)return{tone:`muted`,text:`已撤销`};if(n.state===`done`){let{wait:t,work:n,phases:r}=PJ(e),i=r.filter(e=>e.ms>=FJ).slice(0,LJ).map(e=>`${DJ[e.phase]} ${MJ(e.ms)}`);return i.length||i.push(`执行 ${MJ(n)}${e.segments.length?``:`(无阶段明细)`}`),t>=IJ&&i.push(`等待 ${MJ(t)}`),{tone:`done`,text:i.join(` · `)}}if(!n.dispatched_at)return{tone:`muted`,text:`排队中 · 已 ${MJ(t-e.queue[0])}`};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));if(!a)return{tone:`live`,text:`处理中 · 这种接入方式不上报进度`};let o=Math.max(0,t-a),s=i?`${DJ[i.phase]}${i.tool?` ${i.tool}`:``}中`:`处理中`;return o>=18e4?i?.phase===`command`?{tone:`warn`,text:`${s} · 命令已运行 ${MJ(o)}`}:i?.phase===`thinking`&&o<6e5?{tone:`live`,text:`${s} · 已 ${MJ(o)} 无中间输出`}:{tone:`warn`,text:`可能卡住 · 已 ${MJ(o)} 无输出`}:{tone:`live`,text:`${s} · 距上次输出 ${MJ(o)}`}}function zJ(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 BJ(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 VJ(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 HJ(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,...NJ(n,t)})),r=new Map(n.map(e=>[e.key,e])),i=e=>{let t=[];for(let n=r.get(e.parent),i=new Set([e.key]);n&&!i.has(n.key);n=r.get(n.parent))i.add(n.key),t.push(n);return t},a=new Map,o=new Set,s=e=>{if(a.has(e.key))return a.get(e.key).under;if(o.has(e.key))return``;o.add(e.key);let t=i(e),n=t[0],r=null;for(let n of t){if(n.item.member===e.item.member){r=n;break}if(!s(n))break}let c=``;return r?c=s(r):n&&(c=s(n)||n.key),c===e.key&&(c=``),o.delete(e.key),a.set(e.key,{under:c,dispatched_by:n&&n.item.member!==e.item.member?n.key:``}),c},c=new Map;for(let e of n){let t=s(e);c.has(t)||c.set(t,[]),c.get(t).push(e)}let l=[],u=new Set,d=(e,t,n)=>{for(let r of(c.get(e)||[]).sort((e,t)=>e.start-t.start||(t.item.source===`user`)-(e.item.source===`user`)||e.key.localeCompare(t.key)))u.has(r.key)||(u.add(r.key),l.push({...r,depth:t,ancestors:n,placed_parent:e,dispatched_by:a.get(r.key)?.dispatched_by||``,has_children:!!c.get(r.key)?.length}),d(r.key,t+1,[...n,r.key]))};d(``,0,[]);for(let e of n)u.has(e.key)||l.push({...e,depth:0,ancestors:[],placed_parent:``,dispatched_by:``,has_children:!1});return l}var UJ=e=>e.queued_at||e.dispatched_at||0;function WJ(e,t){let n=new Set([...e].sort((e,t)=>UJ(t)-UJ(e)).slice(0,t)),r=new Map(e.filter(e=>e.source===`free`).map(e=>[e.id,e]));for(let e of[...n])for(let t=r.get(e.parent_id);t&&!n.has(t);t=r.get(t.parent_id))n.add(t);return e.filter(e=>n.has(e))}function GJ(e,t){let n=e.map(e=>({item:e,stages:NJ(e,t)})).sort((e,t)=>e.stages.queue[0]-t.stages.queue[0]||e.item.id-t.item.id),r=[],i=new Set,a=-1/0;for(let e of n){let{item:t,stages:n}=e,o=`${t.source}:${t.id}`,s=t.task_author===`用户`&&t.task_id!=null&&!i.has(t.task_id);!r.length||s&&n.queue[0]>=a?r.push({key:o,opener:t,opened:s,items:[],keys:new Set,interjections:[]}):s&&r.at(-1).interjections.push({key:o,task_id:t.task_id,task:t.task||``,at:n.queue[0]});let c=r.at(-1);c.items.push(e),c.keys.add(o),t.task_id!=null&&i.add(t.task_id),a=Math.max(a,n.end)}return r}var KJ=`用户`,qJ=e=>e.item.source===`user`;function uhe(e,t){let n=0;return e.map(e=>{let r=(e,t,n,r=n)=>({source:`user`,id:e,member:KJ,role:`user`,state:`done`,parent_id:null,queued_at:r/1e3,dispatched_at:r/1e3,started_at:r/1e3,finished_at:n/1e3,segments:[],notes:[],task:t,task_id:e,task_author:KJ}),i=[];if(e.opened&&e.opener.task_id!=null){let a=NJ(e.opener,t).queue[0];i.push(r(e.opener.task_id,e.opener.task||``,a,n&&n<a?n:a))}for(let t of e.interjections)t.task_id!=null&&i.push({...r(t.task_id,t.task,t.at),aside:!0});let a=i.map(e=>({item:e,stages:NJ(e,t)}));return n=Math.max(...e.items.map(({stages:e})=>e.end)),{...e,users:i,items:[...a,...e.items],keys:new Set([...i.map(e=>`user:${e.id}`),...e.keys])}})}function dhe(e){return e.map(e=>{let t=new Map;for(let{item:n,stages:r}of e.items)t.set(n.member,(t.get(n.member)||0)+(r.work?r.work[1]-r.work[0]:0));let n=e.items.filter(({item:e})=>e.source!==`user`),r=[...n].sort((e,t)=>e.stages.start-t.stages.start).map(({item:e,stages:t})=>({key:`${e.source}:${e.id}`,member:e.member,role:e.role,state:e.state,ask:e.task||``,reason:e.reason||``,ms:t.end-t.start})),i=n.filter(({item:e})=>e.state===`done`&&e.result).sort((e,t)=>t.stages.end-e.stages.end)[0];return{steps:r,outcome:i?{member:i.item.member,text:i.item.result}:null,changes:n.reduce((e,{item:t})=>e+(t.changes||0),0),key:e.key,opened:e.opened,task:e.opener.task||``,task_id:e.opener.task_id||null,result:e.opener.result||``,interjections:e.interjections,start:Math.min(...n.map(({stages:e})=>e.start)),end:Math.max(...n.map(({stages:e})=>e.end)),count:n.length,running:n.some(({item:e})=>e.state===`running`),failed:n.some(({item:e})=>e.state===`failed`),work:[...t].map(([e,t])=>({member:e,ms:t})).filter(e=>e.ms>0).sort((e,t)=>t.ms-e.ms),...YJ(n)}}).reverse()}function JJ(e,t,n){let r=e.filter(e=>e.item.state===`running`),i={running:r,failed:e.filter(e=>e.item.state===`failed`).length,stalled:r.filter(e=>RJ(e,n).tone===`warn`).length},a=e.filter(e=>t.has(e.key)),o=a.filter(e=>!qJ(e));if(!o.length)return{...i,keys:t,start:0,end:0,total:0,members:[],wait:0,slowest:null};let s=Math.min(...o.map(e=>e.start)),c=Math.max(...o.map(e=>e.end)),l=new Map;for(let e of a)l.set(e.item.member,(l.get(e.item.member)||0)+(e.work?e.work[1]-e.work[0]:0));let{wait:u}=YJ(a.map(e=>({item:e.item,stages:e})));return{...i,keys:t,start:s,end:c,total:c-s,wait:u,slowest:xhe(a).slowest,members:[...l].map(([e,t])=>({member:e,ms:t})).sort((e,t)=>t.ms-e.ms)}}function YJ(e){let t=e.flatMap(({item:e,stages:t})=>[...t.work?[{from:t.work[0],to:t.work[1],member:e.member}]:[],{from:t.queue[0],to:t.work?t.work[0]:t.end,wait:!0}]).filter(e=>e.to>e.from),n=[...new Set(t.flatMap(e=>[e.from,e.to]))].sort((e,t)=>e-t),r=new Map,i=0,a=0;for(let e=0;e+1<n.length;e+=1){let[o,s]=[n[e],n[e+1]],c=t.filter(e=>e.from<=o&&e.to>=s),l=[...new Set(c.filter(e=>e.member!==void 0).map(e=>e.member))];if(l.length)for(let e of l)r.set(e,(r.get(e)||0)+(s-o)/l.length);else c.length?i+=s-o:a+=s-o}return{wait:i,parts:[...[...r].map(([e,t])=>({member:e,ms:t})).sort((e,t)=>t.ms-e.ms),...i?[{wait:!0,ms:i}]:[],...a?[{idle:!0,ms:a}]:[]]}}function fhe(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.dispatched_by);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 phe=[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),XJ=.85;function mhe(e,t=!1){let n=e.map(e=>qJ(e)?[e.end,e.end]:[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=phe.find(e=>e>=i/XJ)??Math.ceil(i/XJ),r.at(-1)[1]+=a-i);let o=Math.min(jJ,.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 ZJ=[1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,10800,21600,43200,86400].map(e=>e*1e3),hhe=.12;function ghe(e,t=6,n={from:0,span:1}){let r=(e.total_ms??e.busy_ms)*n.span;if(!r)return[];let i=ZJ.find(e=>r/e<=t)??ZJ.at(-1),a=hhe*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 _he=.01,vhe=2e3;function yhe(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 bhe(e,t,n,r=0){let i=Math.max(_he,r?vhe/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 QJ(e,t){return{from:Math.min(1-e.span,Math.max(0,e.from+t*e.span)),span:e.span}}function xhe(e){let t=null;for(let n of e)for(let e of n.segments)(!t||e.seen-e.start>t.end-t.start)&&(t={...e,end:e.seen,row:n.key,member:n.item.member});return{executions:e.length,running:e.filter(e=>e.item.state===`running`).length,slowest:t}}var $J={pending:`待投递`,delivering:`投递中`,completed:`已完成`,cancelled:`已取消`,failed:`失败`},eY={dispatched:`已派出`,started:`已开始`,completed:`已完成`,cancelled:`已作废`,failed:`失败`},tY={route:`接收`,ask:`派活`,handoff:`交还主持人`,notice:`程序通知主持人`,keep_working:`主持人接着工作`},She={user:`用户`,host:`主持人`,system:`程序`},Che={user_stop:`用户停止`,member_away:`成员暂离`,member_removed:`成员移除`,rerouted:`改派`,no_reply:`未回复`,archived:`房间归档`},nY={active:`在场`,away:`暂离`,removed:`移除`},rY={host:`主持人`,member:`成员`},whe={api:`输入`,message:`消息`,request:`请求`,execution:`执行`,batch:`流转`,queue:`流转`,chain:`流转`,scheduler:`调度`,member:`房间`,discussion:`房间`,room:`房间`},The=new Set([`dispatched`,`started`]),Ehe=new Set([`pending`,`delivering`]),Dhe=[[`Mozilla`,`网页`],[`node`,`本机服务`],[`AI-CoDiscuss-CLI`,`CLI`],[`Python`,`脚本`]],Ohe={executions:`execution`,requests:`request`,messages:`message`};function iY(e){try{return JSON.parse(e.payload||`{}`)}catch{return{}}}function aY(e){let t=e.kind.startsWith(`api.`)?{...iY(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(`${Ohe[e]}:${r}`);return[...new Set(n)]}function khe(e){let t=e.data,n=iY(t),r=t.actor===`owner`?`房主`:t.actor?.startsWith(`member:`)?t.actor.slice(7):t.actor===`none`?`无凭据`:`未知凭据`,i=Dhe.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 oY(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 khe(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(rY,n.role)} · ${n.adapter||`未知软件`})`;case`member.changed`:return`${r}:${n.from_role===n.role?`${i(nY,n.from_status)} → ${i(nY,n.status)}`:`${i(rY,n.from_role)} → ${i(rY,n.role)}`}`;case`request.created`:return`请求 R${n.request_id} → ${r} · ${i(tY,n.purpose)} · 挂在 #${n.message_id} · 由${i(She,n.created_by)}创建${n.batch_id?` · 批次 #${n.batch_id}`:``}`;case`request.changed`:return`请求 R${n.request_id}(${r})${n.from_status===n.status?`更新`:`${i($J,n.from_status)} → ${i($J,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(Che,n.reason)}`;case`execution.created`:return`执行 E${n.execution_id}(${r})${i(eY,n.status)}`;case`execution.changed`:return`执行 E${n.execution_id}(${r})${i(eY,n.from_status)} → ${i(eY,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 Ahe(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)?Ehe.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)?The.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 jhe={key:0,class:`page-heading`},Mhe={key:1,class:`grid gap-4 py-4`,role:`status`,"aria-label":`正在读取执行时间线`},Nhe={key:2,role:`alert`,class:`fine-print wf-error`},Phe={key:3,class:`fine-print`},Fhe={class:`wf-head`},Ihe={class:`wf-head-line`},Lhe={class:`wf-modes`,role:`tablist`,"aria-label":`查看方式`},Rhe=[`aria-selected`],zhe=[`aria-selected`],Bhe={key:0,class:`wf-state is-replay`},Vhe={key:0,class:`wf-headline`},Hhe={key:0,class:`wf-now`,"aria-label":`需要关注`},Uhe=[`onClick`],Whe={class:`wf-now-line`},Ghe={key:0,class:`wf-spinner`,"aria-hidden":`true`},Khe={class:`wf-now-time`},qhe={key:0,class:`wf-now-note`},Jhe={key:1,class:`wf-earlier`},Yhe={key:2,class:`wf-runs`,"aria-label":`任务概览`},Xhe=[`aria-expanded`,`onClick`],Zhe={class:`wf-run-line`},Qhe={class:`wf-run-meta`},$he={key:0,class:`wf-pill is-live`},ege={key:1,class:`wf-pill is-failed`},tge={key:0,class:`wf-run-note`},nge={key:0,class:`wf-run-body`},rge={class:`wf-run-text`},ige={key:0,class:`wf-segment-asides`},age={class:`wf-run-aside`},oge={class:`wf-run-steps`},sge={class:`wf-run-step-line`},cge=[`data-tone`],lge={key:0,class:`wf-pill is-role`},uge={class:`wf-run-meta`},dge={key:0,class:`wf-run-more`},fge={key:0},pge={key:0,class:`wf-run-text`},mge={key:1,class:`wf-run-text is-muted`},hge=[`onClick`],gge={key:0,class:`wf-axis-label`,title:`Ctrl + 滚轮缩放;放大后按住中键或拖动时间轴平移,双击时间线还原`},_ge={class:`wf-axis-count`},vge={key:0,class:`wf-zoom`,title:`当前放大倍数`},yge=[`title`,`aria-label`],bge={key:1,class:`wf-branch`},xge=[`title`],Sge={key:1,class:`wf-axis-end`},Cge={class:`wf-segment-line`},wge=[`aria-expanded`,`onClick`],Tge={key:1},Ege={key:0,class:`wf-segment-note`},Dge={key:1,class:`wf-segment-asides`},Oge=[`data-row`],kge={key:0,class:`wf-guides`,"aria-hidden":`true`},Age=[`aria-expanded`,`aria-label`,`onClick`],jge={key:2,class:`wf-toggle-space`},Mge=[`aria-expanded`,`onClick`,`onMouseenter`],Nge={class:`wf-name-line`},Pge={key:0,class:`wf-spinner`,"aria-hidden":`true`},Fge={key:1,class:`wf-clock`},Ige={key:2,class:`wf-pill is-aside`},Lge={key:3,class:`wf-pill is-slowest`},Rge={key:4,class:`wf-name-end`},zge=[`role`,`tabindex`,`aria-label`,`onClick`,`onKeydown`],Bge={class:`wf-track`},Vge=[`data-tone`],Hge=[`onClick`,`onMouseenter`],Uge=[`onClick`,`onMouseenter`],Wge=[`data-tone`,`onClick`,`onMouseenter`],Gge=[`data-tone`,`onClick`,`onMouseenter`],Kge=[`data-tone`,`onClick`,`onMouseenter`],qge=[`aria-label`,`onClick`,`onMouseenter`],Jge={key:0,class:`wf-end`},Yge={key:1},Xge=[`aria-label`],Zge={class:`wf-detail-head`},Qge={class:`wf-detail-title`},$ge={class:`wf-detail-name`},e_e={class:`wf-detail-total`},t_e={key:0,class:`wf-detail-piece`},n_e={class:`wf-detail-piece-label`},r_e={key:2,class:`wf-detail-block`,"aria-label":`时间分布`},i_e=[`data-tone`],a_e=[`data-tone`],o_e={key:3,class:`wf-detail-block`},s_e=[`onClick`],c_e={key:4,class:`wf-detail-actions`},l_e=[`onClick`],u_e={key:1,class:`wf-detail-chip`},d_e={key:5,class:`wf-detail-block`},f_e={key:0},p_e=[`data-tone`],m_e={class:`wf-log-phase`},h_e={key:0,class:`wf-log-tool`},g_e={class:`wf-log-dur`},__e={class:`wf-log-note`},v_e={key:1,class:`fine-print`},y_e={key:4,class:`wf-foot`},b_e={key:0},x_e={key:1},S_e={key:2},C_e={key:5,class:`wf-player`},w_e=[`aria-label`],T_e=[`disabled`],E_e=[`max`,`value`],D_e={class:`wf-player-time`},O_e=2e3,k_e=6e4,A_e=100,j_e=60,M_e=520,N_e=2e4,P_e=5,F_e=14,I_e=12,L_e=640,R_e=90,z_e=64,B_e=2,V_e=8,H_e=560,U_e=.0015,sY=20,W_e=10,cY=12,lY=56,G_e=44,K_e=200,q_e=5,J_e=rO({__name:`ExecutionTimeline`,emits:[`detail`],setup(e,{emit:t}){let n=t,{view:r,bridge:i}=Dr(`discussion`),a=[1,2,4,8,16,32],o=L(null),s=L(0),c=L(null),l=L(0),u=null,d=$(()=>r.value.room?.id),f=L(new Map),p=L(null),m=L(``),h=L(Date.now()),g=L(Date.now()),_=L(new Set),v=L(new Map),y=L(null),b=L(``),x=L(null),S=L(null),C=$(()=>s.value>0&&s.value<=L_e),w=0,T=0,E=L(!1),D=``,O=0;sa(()=>{O++,k=``});let k=``,A=0,j=0,M=0,N=0,ee=tn({position:null,playing:!1,speed:0}),te=L(!1),P=0;async function ne(e=!1){let t=d.value;if(!t)return;if(E.value&&D===t){k=k===`full`||e?`full`:`next`;return}let n=++O;E.value=!0,D=t;let r=e||!w||Date.now()-T>=k_e?0:w-P_e;try{let e=await i.request(`/api/rooms/${t}/timeline${r?`?after=${r}`:``}`);if(n!==O||t!==d.value)return;let a=r?new Map(f.value):new Map;for(let t of e.executions)a.set(`${t.source}:${t.id}`,t);f.value=a,p.value={execution_limit:e.execution_limit,segment_limit:e.segment_limit},w=e.now,g.value=Date.now(),h.value=Date.now(),r||(T=Date.now()),m.value=``}catch(e){n===O&&(m.value=`读取执行记录失败:${e.message}`)}finally{if(n===O){E.value=!1;let e=k;k=``,e&&ne(e===`full`)}}}let re=$(()=>p.value&&{...p.value,executions:[...f.value.values()]}),ie=$(()=>re.value?.executions.some(e=>e.state===`running`));B(ie,e=>{clearInterval(A),e&&(A=setInterval(()=>{document.hidden||ne()},O_e))},{immediate:!0}),B(d,()=>{f.value=new Map,p.value=null,_.value=new Set,v.value=new Map,b.value=``,w=0,m.value=``,k=``,ne(!0)},{immediate:!0}),B(()=>r.value.room,(e,t)=>{e?.id&&e.id===t?.id&&ne()});let ae=null;function oe(e){let t=c.value.getBoundingClientRect();return{share:Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),width:t.width}}function se(e){!C.value&&c.value&&e.target.closest?.(`.wf-track, .wf-axis`)&&(e.ctrlKey||e.metaKey?(e.preventDefault(),Ze.value=bhe(Ze.value,oe(e).share,Math.exp(e.deltaY*U_e),Ye.value.total_ms)):Qe.value&&(e.shiftKey||Math.abs(e.deltaX)>Math.abs(e.deltaY))&&(e.preventDefault(),Ze.value=QJ(Ze.value,(e.shiftKey?e.deltaY:e.deltaX)/oe(e).width)))}function ce(e){let t=e.target.closest?.(`.wf-axis`);Qe.value&&(e.button===1||e.button===0&&t)&&e.target.closest?.(`.wf-track, .wf-axis`)&&(e.preventDefault(),ae={x:e.clientX,from:Ze.value.from,width:oe(e).width},e.currentTarget.setPointerCapture(e.pointerId))}function le(e){ae&&(Ze.value=QJ({from:ae.from,span:Ze.value.span},-(e.clientX-ae.x)/ae.width))}function ue(){ae=null}function de(e){e.target.closest?.(`.wf-track, .wf-axis`)&&(Ze.value=Xe)}function fe(e){e.button===1&&e.target.closest?.(`.wf-track, .wf-axis`)&&e.preventDefault()}function pe(e){b.value&&!e.target.closest?.(`.wf-detail, .wf-names, .wf-bar, .wf-note, .wf.is-compact .wf-lane, .wf-now-card`)&&(b.value=``)}function me(e){e.key===`Escape`&&(b.value=``)}ia(()=>{document.addEventListener(`pointerdown`,pe),document.addEventListener(`keydown`,me),u=new ResizeObserver(e=>{for(let t of e)t.target===o.value?s.value=t.contentRect.width:t.target===c.value&&(l.value=t.contentRect.width)}),o.value&&u.observe(o.value),c.value&&u.observe(c.value)}),B(c,(e,t)=>{t&&u?.unobserve(t),e&&u?.observe(e)}),sa(()=>{clearInterval(A),cancelAnimationFrame(j),document.removeEventListener(`pointerdown`,pe),document.removeEventListener(`keydown`,me),u?.disconnect()});let he=L(sY),ge=L(`timeline`),ve=$(()=>ge.value===`tasks`);B(d,()=>{he.value=sY,ge.value=`timeline`});let ye=$(()=>re.value?uhe(GJ(re.value.executions,h.value),h.value):[]),be=$(()=>re.value?[...re.value.executions,...ye.value.flatMap(e=>e.users)]:[]),xe=$(()=>{let e=new Map;for(let t of ye.value)for(let n of t.keys)e.set(n,t);return e}),Se=$(()=>{if(!re.value||ve.value)return re.value;let e=new Set;for(let t of WJ(re.value.executions,he.value))for(let n of xe.value.get(`${t.source}:${t.id}`)?.keys||[`${t.source}:${t.id}`])e.add(n);return{...re.value,executions:be.value.filter(t=>e.has(`${t.source}:${t.id}`))}}),Ce=$(()=>re.value&&!ve.value?re.value.executions.length-Se.value.executions.filter(e=>e.source!==`user`).length:0),we=e=>new Date(e).toLocaleString(`zh-CN`,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1}),Te=$(()=>ve.value?dhe(ye.value):[]),Ee=$(()=>!!(re.value&&re.value.executions.length>=re.value.execution_limit)),De=e=>!e.opened&&Ee.value,Oe=e=>e||`(没有记录起因)`,ke=(e,t)=>[...e||``].length<W_e&&t||``,Ae=$(()=>{let e=new Map,t=null;for(let n of qe.value){let r=xe.value.get(n.key);!n.depth&&r&&r!==t&&(e.set(n.key,r),t=r)}return e}),je=e=>Math.min(...e.items.map(({stages:e})=>e.start)),Me=$(()=>new Set(ye.value.flatMap(e=>e.interjections.map(e=>e.key)))),Ne=L(new Set);function Pe(e){let t=new Set(Ne.value);t.has(e)?t.delete(e):t.add(e),Ne.value=t}let Fe=L(new Set);function Ie(e){let t=new Set(Fe.value);t.has(e)?t.delete(e):t.add(e),Fe.value=t}let Le=(e,t)=>t.state===`failed`?t.reason:t.ask&&t.ask!==e.task?t.ask:``,Re=e=>Rt({key:e.key}),ze=$(()=>Se.value&&!ve.value?HJ(Se.value,h.value):[]),Be=$(()=>ze.value.some(e=>e.item.state===`running`)),Ve=$(()=>ye.value.at(-1)?.keys||new Set),He=$(()=>JJ(ze.value,Ve.value,h.value)),Ue=$(()=>{let{start:e,end:t}=He.value;return e?{start:e,end:t,duration:Math.max(0,t-e)}:{start:0,end:0,duration:0}}),We=$(()=>ee.position!==null&&!Be.value),Ge=$(()=>We.value?Ue.value.start+ee.position:h.value),Ke=$(()=>We.value?HJ(BJ(Se.value,Ge.value,v.value),Ge.value):ze.value),qe=$(()=>Ke.value.filter(e=>!e.ancestors.some(e=>_.value.has(e)))),Je=$(()=>Ke.value.some(e=>e.item.state===`running`)),Ye=$(()=>mhe(Ke.value,Je.value)),Xe={from:0,span:1},Ze=L(Xe),Qe=$(()=>Ze.value.span<1);B(d,()=>{Ze.value=Xe});let $e=$(()=>yhe(Ye.value,Ze.value)),et=$(()=>{let e=Je.value?$e.value.x(Ge.value):null;return e===null||e<0||e>1?null:e}),tt=$(()=>Math.max(1,Ue.value.duration/N_e)),nt=$(()=>[{label:`自动 · ${Math.round(tt.value)}×`,value:0},...a.map(e=>({label:`${e}×`,value:e}))]),rt=$(()=>ee.speed||tt.value),it=$(()=>!ve.value&&!Be.value&&Ue.value.duration>0);function at(e){let t=M?Math.min(e-M,250):0;M=e;let n=Ke.value.length<=j_e||e-N>=A_e;ee.playing&&(P+=t*rt.value,P>=Ue.value.duration?Object.assign(ee,{position:null,playing:!1}):n&&(ee.position=P)),ie.value&&n&&(h.value=Date.now()),n&&(N=e),j=ie.value||ee.playing?requestAnimationFrame(at):0,j||(M=0)}B([ie,()=>ee.playing],()=>{!j&&(ie.value||ee.playing)&&(j=requestAnimationFrame(at))},{immediate:!0});function ot(){P=ee.position===null?0:ee.position,Object.assign(ee,{position:P,playing:!0}),st()}function st(){for(let e of Se.value?.executions||[])Zt({item:e,notes:e.notes||[]})}function ct(){ee.playing=!1}function lt(){P=0,Object.assign(ee,{position:0,playing:!0})}function ut(e){P=Number(e.target.value),Object.assign(ee,{position:P,playing:!1}),st()}function dt(){te.value=!1,Object.assign(ee,{position:null,playing:!1})}B(d,dt);let ft=L(new Set),pt=null;B(()=>qe.value.map(e=>e.key).join(),()=>{let e=qe.value.map(e=>e.key);if(!pt){pt=new Set(e);return}let t=e.filter(e=>!pt.has(e));t.forEach(e=>pt.add(e)),t.length&&(ft.value=new Set([...ft.value,...t]),setTimeout(()=>{ft.value=new Set([...ft.value].filter(e=>!t.includes(e)))},M_e))}),B([d,ge],()=>{pt=null}),B(()=>ee.position===0,e=>{e&&(pt=new Set)});let mt=$(()=>C.value?new Map:fhe(qe.value,$e.value)),ht=$(()=>ghe(Ye.value,Math.min(V_e,Math.max(B_e,Math.round((l.value||540)/(C.value?z_e:R_e)))),Ze.value).map(e=>({...e,x:(e.x-Ze.value.from)/Ze.value.span}))),gt=$(()=>{let e=lY/(l.value||800),t=[];for(let n of $e.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}),_t=$(()=>{let e=lY/(l.value||800),t=1-G_e/(l.value||800);return ht.value.filter(n=>n.x<=t&&!gt.value.some(t=>Math.abs(n.x-t.middle)<e))}),vt=$(()=>We.value?Ge.value:Math.min(Ge.value,g.value)),yt=$(()=>JJ(Ke.value,Ve.value,vt.value)),bt=$(()=>Ke.value.filter(e=>e.has_children).map(e=>e.key)),xt=$(()=>Ke.value.find(e=>e.key===b.value)),St=$(()=>xt.value?zJ(xt.value,v.value.get(xt.value.item.id)):[]),Ct=e=>i.display_name(e),wt=$(()=>{if(ve.value)return[{text:`${Te.value.length} 个任务 · ${re.value?.executions.length||0} 次执行`},{text:`点开任务看要求、过程与结果`}];let{running:e,members:t,wait:n,failed:r,stalled:i,total:a,keys:o}=yt.value,s=[];if(!C.value&&e.length){let t=e.find(e=>o.has(e.key))||e[0],n=Yt(t);s.push({text:`${Ct(t.item.member)} 已运行 ${MJ(vt.value-t.start)}`},{text:n.text,tone:n.tone}),e.length>1&&s.push({text:`另 ${e.length-1} 个进行中`})}else C.value||(s.push({text:`最近一次任务${e.length?`已进行`:`用时`} ${MJ(a)}`}),t.length>1&&s.push({text:t.slice(0,2).map(e=>`${Ct(e.member)} ${MJ(e.ms)}`).join(`、`)}));return(n>=12e4||!e.length&&n>=6e4)&&s.push({text:`等待 ${MJ(n)}`,tone:n>=12e4?`warn`:``}),i&&!C.value&&(e.length!==1||i!==1)&&s.push({text:`可能卡住 ${i}`,tone:`warn`}),r&&s.push({text:`这 ${Ke.value.length} 次里失败 ${r} 次`,tone:`failed`}),s}),Tt=typeof window<`u`&&window.matchMedia?.(`(hover: hover) and (pointer: fine)`).matches===!0,Et=()=>Tt&&!C.value,Dt=0;function Ot(e,t,n=null){Et()&&(clearTimeout(Dt),(b.value!==e.key||(y.value?.id||``)!==(n?nn(e,n):``))&&Mt(e,t,n))}function kt(){Et()&&(clearTimeout(Dt),Dt=setTimeout(()=>{b.value=``},K_e))}function At(){clearTimeout(Dt)}sa(()=>clearTimeout(Dt));function jt(e,t,n=null){let r=n?nn(e,n):``;Et()?(clearTimeout(Dt),(b.value!==e.key||(y.value?.id||``)!==r)&&Mt(e,t,n)):b.value===e.key&&(y.value?.id||``)===r?b.value=``:Mt(e,t,n)}function Mt(e,t,n){let r=n?nn(e,n):``;if(b.value=e.key,y.value=n?{id:r,piece:n,related:n.note?{notes:[n.note],earlier:!1}:VJ(e.notes,n.start,n.end)}:null,Zt(e),C.value)return;let i=t.currentTarget.getBoundingClientRect(),a=S.value.getBoundingClientRect(),o=Math.min(H_e,a.width-16);x.value={top:i.bottom-a.top+4,left:Math.max(8,Math.min(i.left-a.left,a.width-o-8))}}B(()=>xt.value?.notes.length,()=>{xt.value&&Zt(xt.value)});let Nt=$(()=>Math.min(h.value,g.value)),Pt=$(()=>{let e=C.value&&re.value?.executions.filter(e=>e.state===`running`)||[];return e.length?HJ({...re.value,executions:e},h.value).sort((e,t)=>e.start-t.start):[]}),Ft=e=>RJ(e,Nt.value),It=$(()=>C.value?[...Pt.value,...Ke.value.filter(e=>e.item.state===`failed`&&yt.value.keys.has(e.key)).sort((e,t)=>t.end-e.end)]:[]),Lt=e=>e.item.state===`running`?Ft(e):Yt(e);function Rt(e){ge.value=`timeline`,Se.value.executions.some(t=>`${t.source}:${t.id}`===e.key)||(he.value=re.value.executions.length),ir(()=>{let t=Ke.value.find(t=>t.key===e.key);t&&(t.ancestors.some(e=>_.value.has(e))&&(_.value=new Set([..._.value].filter(e=>!t.ancestors.includes(e)))),b.value=t.key,y.value=null,Zt(t),ir(()=>S.value?.querySelector(`[data-row="${CSS.escape(t.key)}"]`)?.scrollIntoView({block:`start`,behavior:`smooth`})))})}function zt(e){let t=new Set(_.value);t.has(e)?t.delete(e):t.add(e),_.value=t}function Bt(e,t,n){return[$e.value.x(t),$e.value.x(n)]}function Vt(e,t,n,r=!1){let[i,a]=Bt(e,t,n),o=Math.max(0,a-i)*100;return{left:`${i*100}%`,width:r?`max(2px, calc(${o}% - 1px))`:`${o}%`}}let Ht=e=>({label:`排队`,start:e.queue[0],end:e.queue[1],text:`从请求发出到投递给成员`}),Ut=e=>({label:e.wake_approx?`唤醒(约)`:`唤醒`,start:e.wake[0],end:e.wake[1],text:`从投递到成员开始工作`}),Wt=e=>({label:`${DJ[e.phase]}${e.tool?` · ${e.tool}`:``}`,start:e.start,end:e.end,live:e.live}),Gt=e=>({note:e,start:e.at,end:e.at}),Kt=$(()=>{let e=new Map;for(let t of[...re.value?.executions||[]].sort((e,t)=>UJ(e)-UJ(t)))e.has(t.member)||e.set(t.member,e.size%q_e+1);return e});function qt(e){return qJ(e)?e.item.aside?[`插话`]:[]:e.item.role===`host`?[`主持`]:[]}let Jt=e=>qJ(e)?e.item.aside?`用户 · 插话`:`用户`:e.item.role===`host`?`协作 · 主持`:`协作`,Yt=e=>RJ(e,vt.value);function Xt(e){let{wait:t}=PJ(e),n=[Ct(e.item.member),Jt(e),kJ[e.item.state],`用时 ${MJ(e.end-e.start)}`,`等待 ${MJ(t)}`];return!e.segments.length&&e.work&&n.push(`无阶段明细`),e.notes.length&&n.push(`${e.notes.length} 段过程说明`),n.join(`,`)}async function Zt(e){let t=e.item.id;if(!(e.item.source!==`free`||!e.notes.length||(v.value.get(t)?.length||0)>=e.notes.length))try{let{notes:e}=await i.request(`/api/rooms/${d.value}/executions/${t}/notes`);v.value=new Map(v.value).set(t,e.map(e=>e.text))}catch{}}let Qt=e=>new Date(e).toLocaleTimeString(`zh-CN`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1}),$t=e=>new Date(e).toLocaleTimeString(`zh-CN`,{hour:`2-digit`,minute:`2-digit`,hour12:!1}),en=e=>new Date(e.at).toLocaleTimeString(`zh-CN`,{hour:`2-digit`,minute:`2-digit`,...e.seconds?{second:`2-digit`}:{},hour12:!1}),nn=(e,t)=>`${e.key}:${t.note?`note`:t.label}:${t.start}`,rn=e=>({label:qJ(e)?e.work[1]>e.work[0]?`阅读与思考`:`发出消息`:e.segments.length?`执行`:`执行 · 无阶段明细`,start:e.work[0],end:e.work[1],live:e.item.state===`running`}),an=$(()=>{let e=y.value?.piece;return e?e.note?`过程说明 · ${Qt(e.note.at)}`:`${e.label} · ${MJ(e.end-e.start)}${e.live?` · 进行中`:``}`:``}),on=$(()=>{let e=xt.value;if(!e||qJ(e))return[];let{wait:t,work:n,phases:r}=PJ(e),i=Math.max(1,e.end-e.start),a=r.reduce((e,t)=>e+t.ms,0);return[...t>0?[{key:`wait`,kind:`wait`,label:`等待`,ms:t}]:[],...r.map(e=>({key:e.phase,kind:OJ[e.phase],label:DJ[e.phase],ms:e.ms})),...n-a>0?[{key:`other`,kind:`other`,label:e.segments.length?`未上报`:`执行`,ms:n-a}]:[]].map(e=>({...e,share:e.ms/i}))}),sn=e=>e>=.995?`100%`:e<.01?`<1%`:`${Math.round(e*100)}%`,cn=L(!1);B(b,()=>{cn.value=!1});let ln=$(()=>{if(!y.value||!xt.value)return[];let e=v.value.get(xt.value.item.id);return y.value.related.notes.map(t=>({at:t.at,text:e?.[t.index]??(e?`(未能读取)`:`读取中…`)}))});return(e,t)=>{let r=BD,a=Zx,s=Bx,l=Ix,u=$D;return G(),K(`section`,{ref_key:`section_element`,ref:o,class:`merged-section execution-timeline`,"aria-label":`执行时间线`},[C.value?Z(``,!0):(G(),K(`div`,jhe,[...t[12]||=[J(`div`,null,[J(`h2`,null,`执行时间线`),J(`p`,null,`每次执行的时间花在哪、谁在等谁;点名字看详情。`)],-1)]])),E.value&&!re.value?(G(),K(`div`,Mhe,[(G(),K(W,null,H(6,e=>J(`div`,{key:e,class:`flex items-center gap-6`},[Y(r,{class:`h-5 w-24 shrink-0`}),Y(r,{class:F([`h-6`,e%2?`w-2/3`:`w-1/3`])},null,8,[`class`])])),64))])):m.value?(G(),K(`p`,Nhe,[X(I(m.value),1),Y(a,{label:`重试`,color:`neutral`,variant:`link`,size:`xs`,loading:E.value,onClick:t[0]||=e=>ne(!0)},null,8,[`loading`])])):Z(``,!0),re.value&&!re.value.executions.length?(G(),K(`p`,Phe,`还没有执行记录。`)):Z(``,!0),re.value?.executions.length?(G(),K(`div`,{key:4,ref_key:`wf_element`,ref:S,class:F([`wf`,{"is-compact":C.value}]),style:_e({"--wf-depth-px":`${C.value?I_e:F_e}px`})},[J(`header`,Fhe,[J(`div`,Ihe,[J(`span`,Lhe,[J(`button`,{type:`button`,role:`tab`,"aria-selected":!ve.value,class:F({"is-active":!ve.value}),onClick:t[1]||=e=>ge.value=`timeline`},`时间线`,10,Rhe),J(`button`,{type:`button`,role:`tab`,"aria-selected":ve.value,class:F({"is-active":ve.value}),onClick:t[2]||=e=>ge.value=`tasks`},`任务概览`,10,zhe)]),We.value?(G(),K(`span`,Bhe,`回放中 · `+I(Qt(Ge.value)),1)):ve.value?Z(``,!0):(G(),K(`span`,{key:1,class:F([`wf-state`,{"is-live":yt.value.running.length}])},I(yt.value.running.length?`${yt.value.running.length} 个进行中`:`均已结束`),3))]),wt.value.length?(G(),K(`p`,Vhe,[(G(!0),K(W,null,H(wt.value,(e,t)=>(G(),K(`span`,{key:t,class:F(e.tone&&`is-${e.tone}`)},I(e.text),3))),128))])):Z(``,!0)]),It.value.length?(G(),K(`section`,Hhe,[(G(!0),K(W,null,H(It.value,e=>(G(),K(`button`,{key:e.key,type:`button`,class:F([`wf-now-card`,[`is-${e.item.state}`,{"is-stalled":e.item.state===`running`&&Lt(e).tone===`warn`}]]),onClick:t=>Rt(e)},[J(`span`,Whe,[e.item.state===`running`?(G(),K(`i`,Ghe)):Z(``,!0),Y(s,{src:R(i).identities[e.item.member]?.icon,text:R(i).identities[e.item.member]?.initials,alt:e.item.member,size:`2xs`,class:F([`channel-avatar wf-avatar`,R(i).identities[e.item.member]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`strong`,null,I(Ct(e.item.member)),1),(G(!0),K(W,null,H(qt(e),e=>(G(),K(`em`,{key:e,class:`wf-pill is-role`},I(e),1))),128)),J(`span`,Khe,I(e.item.state===`running`?`已运行 ${R(MJ)(Nt.value-e.start)}`:`${R(MJ)(Math.max(0,vt.value-e.end))} 前失败`),1)]),J(`span`,{class:F([`wf-now-status wf-status`,`is-${Lt(e).tone}`])},I(Lt(e).text),3),e.item.state===`running`&&e.item.last_note?(G(),K(`span`,qhe,I(e.item.last_note),1)):Z(``,!0)],10,Uhe))),128))])):Z(``,!0),Ce.value?(G(),K(`p`,Jhe,[X(`显示最近 `+I(Se.value.executions.length)+` 次执行`,1),J(`button`,{type:`button`,class:`wf-text-button`,onClick:t[3]||=e=>he.value+=sY},`显示更早的 `+I(Math.min(sY,Ce.value))+` 次`,1)])):Z(``,!0),ve.value?(G(),K(`ol`,Yhe,[(G(!0),K(W,null,H(Te.value,e=>(G(),K(`li`,{key:e.key,class:F({"is-open":Fe.value.has(e.key)})},[J(`button`,{type:`button`,class:`wf-run`,"aria-expanded":Fe.value.has(e.key),onClick:t=>Ie(e.key)},[J(`span`,Zhe,[Y(l,{name:`i-lucide-chevron-right`,class:`wf-run-caret`}),J(`time`,null,I(we(e.start)),1),J(`strong`,null,I(Oe(e.task)),1),J(`span`,Qhe,I(e.count)+` 次 · 用时 `+I(R(MJ)(e.end-e.start)),1),e.running?(G(),K(`em`,$he,`进行中`)):e.failed?(G(),K(`em`,ege,`有失败`)):Z(``,!0)]),e.interjections.length||De(e)?(G(),K(`span`,tge,[e.interjections.length?(G(),K(W,{key:0},[X(`插话 `+I(e.interjections.length)+` 条`,1)],64)):Z(``,!0),e.interjections.length&&De(e)?(G(),K(W,{key:1},[X(` · `)],64)):Z(``,!0),De(e)?(G(),K(W,{key:2},[X(`更早部分未加载`)],64)):Z(``,!0)])):Z(``,!0)],8,Xhe),Fe.value.has(e.key)?(G(),K(`div`,nge,[J(`section`,null,[t[13]||=J(`h4`,null,`要求`,-1),J(`p`,rge,I(Oe(e.task)),1),e.interjections.length?(G(),K(`ol`,ige,[(G(!0),K(W,null,H(e.interjections,e=>(G(),K(`li`,{key:e.key},[J(`time`,null,I($t(e.at)),1),J(`span`,age,I(e.task),1)]))),128))])):Z(``,!0)]),J(`section`,null,[J(`h4`,null,[t[14]||=X(`过程`,-1),J(`small`,null,I(e.steps.length)+` 次执行`,1)]),J(`ol`,oge,[(G(!0),K(W,null,H(e.steps.slice(0,cY),t=>(G(),K(`li`,{key:t.key},[J(`span`,sge,[J(`i`,{class:`wf-run-dot`,"data-tone":Kt.value.get(t.member)},null,8,cge),J(`strong`,null,I(Ct(t.member)),1),t.role===`host`?(G(),K(`em`,lge,`主持`)):Z(``,!0),J(`span`,{class:F([`wf-run-step-state`,`is-${t.state}`])},I(R(kJ)[t.state]),3),J(`span`,uge,I(R(MJ)(t.ms)),1)]),Le(e,t)?(G(),K(`span`,{key:0,class:F([`wf-run-step-note`,{"is-failed":t.state===`failed`}])},I(Le(e,t)),3)):Z(``,!0)]))),128))]),e.steps.length>cY?(G(),K(`p`,dge,`另 `+I(e.steps.length-cY)+` 次执行,在时间线中查看`,1)):Z(``,!0)]),J(`section`,null,[J(`h4`,null,[t[15]||=X(`结果`,-1),e.changes?(G(),K(`small`,fge,`改动 `+I(e.changes)+` 个文件`,1)):Z(``,!0)]),e.outcome?(G(),K(`p`,pge,[J(`strong`,null,I(Ct(e.outcome.member))+`:`,1),X(I(e.outcome.text),1)])):(G(),K(`p`,mge,I(e.running?`仍在进行,还没有结果`:`没有记录到回答`),1))]),J(`button`,{type:`button`,class:`wf-text-button wf-run-jump`,onClick:t=>Re(e)},[Y(l,{name:`i-lucide-arrow-right`}),t[16]||=X(`在时间线中查看`,-1)],8,hge)])):Z(``,!0)],2))),128))])):(G(),K(`div`,{key:3,class:F([`wf-grid`,{"is-zoomed":Qe.value,"is-panning":R(ae)}]),role:`list`,onWheel:se,onMousedown:fe,onPointerdown:ce,onPointermove:le,onPointerup:ue,onPointercancel:ue,onDblclick:de},[C.value?Z(``,!0):(G(),K(`div`,gge,[J(`span`,_ge,`执行 · `+I(qe.value.length)+`/`+I(Ke.value.length),1),Qe.value?(G(),K(`span`,vge,[X(I((1/Ze.value.span).toFixed(1))+`×`,1),J(`button`,{type:`button`,class:`wf-zoom-reset`,title:`${Be.value?`重置跟随`:`重置`}(双击时间线也可还原)`,"aria-label":Be.value?`重置跟随`:`重置`,onClick:t[4]||=e=>Ze.value=Xe},[Y(l,{name:`i-lucide-locate-fixed`})],8,yge)])):Z(``,!0),bt.value.length?(G(),K(`span`,bge,[J(`button`,{type:`button`,class:`wf-text-button`,onClick:t[5]||=e=>_.value=new Set},`展开`),J(`button`,{type:`button`,class:`wf-text-button`,onClick:t[6]||=e=>_.value=new Set(bt.value)},`收起`)])):Z(``,!0)])),J(`div`,{ref_key:`axis_element`,ref:c,class:`wf-axis`,"aria-hidden":`true`},[(G(!0),K(W,null,H(_t.value,e=>(G(),K(`span`,{key:e.at,class:`wf-tick`,style:_e({left:`${e.x*100}%`})},I(en(e)),5))),128)),(G(!0),K(W,null,H(gt.value,e=>(G(),K(`span`,{key:`fold-${e.start}`,class:`wf-fold-label`,style:_e({left:`${(e.from+e.width/2)*100}%`}),title:`${Qt(e.start)} – ${Qt(e.end)} 没有执行,已折叠`},`⋯ `+I(R(MJ)(e.end-e.start)),13,xge))),128)),et.value===null?Z(``,!0):(G(),K(`span`,{key:0,class:`wf-cursor-head`,style:_e({left:`${et.value*100}%`})},null,4))],512),C.value?Z(``,!0):(G(),K(`span`,Sge,`用时`)),(G(!0),K(W,null,H(qe.value,e=>(G(),K(W,{key:e.key},[(G(!0),K(W,null,H(Ae.value.has(e.key)?[Ae.value.get(e.key)]:[],e=>(G(),K(`div`,{key:e.key,class:`wf-segment`},[J(`span`,Cge,[J(`time`,null,I(we(je(e))),1),J(`strong`,null,I(Oe(e.opener.task)),1),e.interjections.length?(G(),K(`button`,{key:0,type:`button`,class:`wf-text-button`,"aria-expanded":Ne.value.has(e.key),onClick:t=>Pe(e.key)},`插话 `+I(e.interjections.length)+` 条`,9,wge)):Z(``,!0),De(e)?(G(),K(`small`,Tge,`更早部分未加载`)):Z(``,!0)]),ke(e.opener.task,e.opener.result)?(G(),K(`span`,Ege,I(ke(e.opener.task,e.opener.result)),1)):Z(``,!0),Ne.value.has(e.key)?(G(),K(`ol`,Dge,[(G(!0),K(W,null,H(e.interjections,e=>(G(),K(`li`,{key:e.key},[J(`time`,null,I($t(e.at)),1),X(I(e.task),1)]))),128))])):Z(``,!0)]))),128)),J(`div`,{role:`listitem`,class:F([`wf-row`,[`is-${e.item.state}`,{"is-open":b.value===e.key,"is-stalled":e.item.state===`running`&&Yt(e).tone===`warn`,"is-entering":ft.value.has(e.key),"is-instant":R(qJ)(e)&&e.end<=e.start}]])},[J(`div`,{class:`wf-label`,"data-row":e.key,style:_e({"--depth":e.depth})},[e.depth?(G(),K(`span`,kge)):Z(``,!0),e.has_children?(G(),K(`button`,{key:1,type:`button`,class:F([`wf-toggle`,{"is-open":!_.value.has(e.key)}]),"aria-expanded":!_.value.has(e.key),"aria-label":`${_.value.has(e.key)?`展开`:`收起`} ${Ct(e.item.member)} 派出的执行`,onClick:t=>zt(e.key)},[Y(l,{name:`i-lucide-chevron-right`})],10,Age)):(G(),K(`span`,jge)),Y(s,{src:R(i).identities[e.item.member]?.icon,text:R(i).identities[e.item.member]?.initials,alt:e.item.member,size:`2xs`,class:F([`channel-avatar wf-avatar`,R(i).identities[e.item.member]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`button`,{type:`button`,class:`wf-names`,"aria-expanded":b.value===e.key,onClick:t=>jt(e,t),onMouseenter:t=>Ot(e,t),onMouseleave:kt},[J(`span`,Nge,[e.item.state===`running`?(G(),K(`i`,Pge)):Z(``,!0),C.value?(G(),K(`time`,Fge,I($t(e.start)),1)):Z(``,!0),J(`strong`,null,I(Ct(e.item.member)),1),(G(!0),K(W,null,H(qt(e),e=>(G(),K(`em`,{key:e,class:`wf-pill is-role`},I(e),1))),128)),Me.value.has(e.key)?(G(),K(`em`,Ige,`插话`)):Z(``,!0),yt.value.slowest?.row===e.key?(G(),K(`em`,Lge,`最慢`)):Z(``,!0),C.value?(G(),K(`span`,Rge,[X(I(R(MJ)(e.end-e.start)),1),e.item.state===`done`?Z(``,!0):(G(),K(`small`,{key:0,class:F(`is-${e.item.state}`)},I(R(kJ)[e.item.state]),3))])):Z(``,!0)]),C.value?Z(``,!0):(G(),K(`span`,{key:0,class:F([`wf-status`,`is-${Yt(e).tone}`])},I(Yt(e).text),3))],40,Mge)],12,Oge),J(`div`,{class:`wf-lane`,role:C.value?`button`:`img`,tabindex:C.value?0:void 0,"aria-label":Xt(e),onClick:t=>C.value&&jt(e,t),onKeydown:rl(t=>C.value&&jt(e,t),[`enter`])},[J(`div`,Bge,[(G(!0),K(W,null,H(_t.value,e=>(G(),K(`i`,{key:e.at,class:`wf-gridline`,style:_e({left:`${e.x*100}%`})},null,4))),128)),(G(!0),K(W,null,H($e.value.folds,e=>(G(),K(`i`,{key:e.start,class:`wf-fold`,style:_e({left:`${e.from*100}%`,width:`${e.width*100}%`})},null,4))),128)),t[17]||=J(`i`,{class:`wf-well`},null,-1),(G(!0),K(W,null,H(mt.value.get(e.key)||[],(e,t)=>(G(),K(`i`,{key:`link-${t}`,class:F([`wf-link`,`is-${e.part}`]),"data-tone":Kt.value.get(e.member),style:_e({left:`${e.x*100}%`})},null,14,Vge))),128)),et.value===null?Z(``,!0):(G(),K(`i`,{key:0,class:`wf-cursor`,style:_e({left:`${et.value*100}%`})},null,4)),J(`i`,{class:`wf-bar is-queue`,style:_e(Vt(e,...e.queue)),onClick:t=>jt(e,t,Ht(e)),onMouseenter:t=>Ot(e,t,Ht(e)),onMouseleave:kt},null,44,Hge),e.wake?(G(),K(`i`,{key:1,class:`wf-bar is-wake`,style:_e(Vt(e,...e.wake)),onClick:t=>jt(e,t,Ut(e)),onMouseenter:t=>Ot(e,t,Ut(e)),onMouseleave:kt},null,44,Uge)):Z(``,!0),e.work?(G(),K(`i`,{key:2,class:F([`wf-bar is-work`,{"has-detail":e.segments.length,"is-user":R(qJ)(e)}]),"data-tone":e.segments.length?void 0:Kt.value.get(e.item.member),style:_e(Vt(e,...e.work)),onClick:t=>jt(e,t,rn(e)),onMouseenter:t=>Ot(e,t,rn(e)),onMouseleave:kt},null,46,Wge)):Z(``,!0),(G(!0),K(W,null,H(e.segments,t=>(G(),K(W,{key:t.start+t.phase},[J(`i`,{class:F([`wf-bar wf-seg`,[`is-${R(OJ)[t.phase]}`,{"is-live":t.live}]]),"data-tone":Kt.value.get(e.item.member),style:_e(Vt(e,t.start,t.seen,!0)),onClick:n=>jt(e,n,Wt(t)),onMouseenter:n=>Ot(e,n,Wt(t)),onMouseleave:kt},null,46,Gge),t.end>t.seen?(G(),K(`i`,{key:0,class:F([`wf-bar wf-seg is-tail`,`is-${R(OJ)[t.phase]}`]),"data-tone":Kt.value.get(e.item.member),style:_e(Vt(e,t.seen,t.end)),onClick:n=>jt(e,n,Wt(t)),onMouseenter:n=>Ot(e,n,Wt(t)),onMouseleave:kt},null,46,Kge)):Z(``,!0)],64))),128)),(G(!0),K(W,null,H(e.notes,t=>(G(),K(`button`,{key:`note-${t.index}`,type:`button`,class:`wf-note`,style:_e({left:`${Bt(e,t.at,t.at)[0]*100}%`}),"aria-label":`${Ct(e.item.member)} 的第 ${t.index+1} 段过程说明,${Qt(t.at)}`,onClick:n=>jt(e,n,Gt(t)),onMouseenter:n=>Ot(e,n,Gt(t)),onMouseleave:kt},null,44,qge))),128))])],40,zge),C.value?e.item.state===`running`||e.item.state===`failed`?(G(),K(`span`,{key:1,class:F([`wf-row-status wf-status`,`is-${Yt(e).tone}`])},I(Yt(e).text),3)):Z(``,!0):(G(),K(`span`,Jge,[X(I(R(MJ)(e.end-e.start)),1),e.item.state===`done`?Z(``,!0):(G(),K(`small`,{key:0,class:F(`is-${e.item.state}`)},I(R(kJ)[e.item.state]),3)),e.truncated?(G(),K(`small`,Yge,`明细已截断`)):Z(``,!0)])),b.value===e.key&&(C.value||x.value)?(G(),K(`div`,{key:2,class:`wf-detail`,role:`dialog`,onMouseenter:At,onMouseleave:kt,"aria-label":R(qJ)(e)?`${Ct(e.item.member)} 的这条消息`:`${Ct(e.item.member)} 的这次执行`,style:_e(C.value?void 0:{top:`${x.value.top}px`,left:`${x.value.left}px`})},[J(`header`,Zge,[Y(s,{src:R(i).identities[e.item.member]?.icon,text:R(i).identities[e.item.member]?.initials,alt:e.item.member,size:`sm`,class:F([`channel-avatar wf-avatar`,R(i).identities[e.item.member]?.style])},null,8,[`src`,`text`,`alt`,`class`]),J(`div`,Qge,[J(`span`,$ge,[J(`strong`,null,I(Ct(e.item.member)),1),J(`em`,{class:F([`wf-pill wf-state-pill`,`is-${e.item.state}`])},I(R(kJ)[e.item.state]),3)]),J(`small`,null,I(Jt(e))+` · `+I(Qt(e.start))+` 起`,1)]),J(`span`,e_e,I(R(MJ)(e.end-e.start)),1),J(`button`,{type:`button`,class:`wf-card-close`,"aria-label":`关闭`,onClick:t[7]||=e=>b.value=``},[Y(l,{name:`i-lucide-x`})])]),y.value?(G(),K(`section`,t_e,[J(`strong`,null,I(an.value),1),J(`small`,null,[X(I(Qt(y.value.piece.start)),1),y.value.piece.end>y.value.piece.start?(G(),K(W,{key:0},[X(` – `+I(y.value.piece.live?`现在`:Qt(y.value.piece.end)),1)],64)):Z(``,!0),y.value.piece.text?(G(),K(W,{key:1},[X(` · `+I(y.value.piece.text),1)],64)):Z(``,!0)]),ln.value.length?(G(),K(W,{key:0},[J(`small`,n_e,I(y.value.related.earlier?`此前的过程说明`:`这段时间的过程说明`),1),J(`ol`,null,[(G(!0),K(W,null,H(ln.value,e=>(G(),K(`li`,{key:e.at+e.text},[J(`time`,null,I(Qt(e.at)),1),X(I(e.text),1)]))),128))])],64)):Z(``,!0)])):Z(``,!0),e.item.state===`done`?Z(``,!0):(G(),K(`p`,{key:1,class:F([`wf-detail-status wf-status`,`is-${Yt(e).tone}`])},I(Yt(e).text),3)),on.value.length?(G(),K(`section`,r_e,[J(`span`,{class:`wf-dist`,"data-tone":Kt.value.get(e.item.member)},[(G(!0),K(W,null,H(on.value,e=>(G(),K(`i`,{key:e.key,class:F(`is-${e.kind}`),style:_e({flexGrow:e.ms})},null,6))),128))],8,i_e),J(`ul`,{class:`wf-dist-key`,"data-tone":Kt.value.get(e.item.member)},[(G(!0),K(W,null,H(on.value,e=>(G(),K(`li`,{key:e.key},[J(`i`,{class:F([`wf-swatch`,`is-${e.kind}`]),"aria-hidden":`true`},null,2),X(I(e.label)+` `,1),J(`b`,null,I(R(MJ)(e.ms)),1),J(`small`,null,I(sn(e.share)),1)]))),128))],8,a_e)])):Z(``,!0),e.item.task?(G(),K(`section`,o_e,[J(`h4`,null,[t[18]||=X(`任务`,-1),e.item.task_id?(G(),K(`button`,{key:0,type:`button`,class:`wf-detail-link`,onClick:t=>n(`detail`,e.item.task_id)},[X(`#`+I(e.item.task_id),1),Y(l,{name:`i-lucide-arrow-up-right`})],8,s_e)):Z(``,!0)]),J(`p`,{class:F([`wf-detail-task`,{"is-open":cn.value}])},I(e.item.task),3),e.item.task.length>80?(G(),K(`button`,{key:0,type:`button`,class:`wf-text-button wf-detail-more`,onClick:t[8]||=e=>cn.value=!cn.value},I(cn.value?`收起`:`展开全文`),1)):Z(``,!0)])):Z(``,!0),e.item.answer_id||e.item.changes?(G(),K(`div`,c_e,[e.item.answer_id?(G(),K(`button`,{key:0,type:`button`,class:`wf-detail-chip is-link`,onClick:t=>n(`detail`,e.item.answer_id)},[Y(l,{name:`i-lucide-message-square-text`}),X(`查看回答 #`+I(e.item.answer_id),1)],8,l_e)):Z(``,!0),e.item.changes?(G(),K(`span`,u_e,[Y(l,{name:`i-lucide-file-diff`}),X(`改动 `+I(e.item.changes)+` 个文件`,1)])):Z(``,!0)])):Z(``,!0),R(qJ)(e)?Z(``,!0):(G(),K(`section`,d_e,[J(`h4`,null,[t[19]||=X(`过程`,-1),St.value.length?(G(),K(`small`,f_e,I(St.value.length)+` 条`,1)):Z(``,!0)]),St.value.length?(G(),K(`ol`,{key:0,class:`wf-log`,"aria-label":`过程`,"data-tone":Kt.value.get(e.item.member)},[(G(!0),K(W,null,H(St.value,e=>(G(),K(`li`,{key:`${e.kind}-${e.at}-${e.phase||``}`,class:F([`log-${e.kind}`,e.kind===`phase`&&`kind-${R(OJ)[e.phase]}`,{"is-live":e.live}])},[t[20]||=J(`i`,{class:`wf-log-dot`,"aria-hidden":`true`},null,-1),e.kind===`phase`?(G(),K(W,{key:0},[J(`span`,m_e,[J(`b`,null,I(R(DJ)[e.phase]),1),e.tool?(G(),K(`span`,h_e,I(e.tool),1)):Z(``,!0)]),J(`span`,g_e,I(e.live?`进行中`:R(MJ)(e.duration)),1),J(`time`,null,I(Qt(e.at)),1)],64)):(G(),K(W,{key:1},[J(`p`,__e,I(e.text),1),J(`time`,null,I(Qt(e.at)),1)],64))],2))),128))],8,p_e)):(G(),K(`p`,v_e,`这次执行没有阶段明细或过程说明。`))]))],44,Xge)):Z(``,!0)],2)],64))),128))],34)),ve.value?Z(``,!0):(G(),K(`footer`,y_e,[t[23]||=ss(`<span class="wf-key" data-v-2709857c><i class="wf-swatch is-queue" data-v-2709857c></i>排队<i class="wf-swatch is-wake" data-v-2709857c></i>唤醒<i class="wf-swatch is-model" data-v-2709857c></i>模型<i class="wf-swatch is-tool" data-v-2709857c></i>工具</span>`,1),Kt.value.size>1?(G(),K(`span`,b_e,`颜色区分成员,深浅区分模型与工具`)):Z(``,!0),Ye.value.folds.length&&!C.value?(G(),K(`span`,x_e,[t[21]||=J(`i`,{class:`wf-swatch is-fold`,"aria-hidden":`true`},null,-1),X(`已折叠 `+I(Ye.value.folds.length)+` 段超过 `+I(R(AJ)/6e4)+` 分钟的空闲`,1)])):Z(``,!0),re.value.executions.length>=re.value.execution_limit?(G(),K(`span`,S_e,`只列出最近 `+I(re.value.execution_limit)+` 次讨论执行与 `+I(re.value.execution_limit)+` 次协作执行`,1)):Z(``,!0),it.value&&!te.value?(G(),K(`button`,{key:3,type:`button`,class:`wf-text-button wf-replay-open`,onClick:t[9]||=e=>te.value=!0},[Y(l,{name:`i-lucide-play`}),t[22]||=X(`回放最近这次任务`,-1)])):Z(``,!0)])),it.value&&te.value?(G(),K(`div`,C_e,[J(`button`,{type:`button`,class:`wf-player-button`,"aria-label":ee.playing?`暂停回放`:`回放最近这次任务`,onClick:t[10]||=e=>ee.playing?ct():ot()},[Y(l,{name:ee.playing?`i-lucide-pause`:`i-lucide-play`},null,8,[`name`])],8,w_e),J(`button`,{type:`button`,class:`wf-player-button`,"aria-label":`从头回放`,disabled:!We.value,onClick:lt},[Y(l,{name:`i-lucide-rotate-ccw`})],8,T_e),Y(u,{modelValue:ee.speed,"onUpdate:modelValue":t[11]||=e=>ee.speed=e,items:nt.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`]),J(`input`,{type:`range`,class:`wf-scrub`,min:`0`,max:Ue.value.duration,step:`100`,value:We.value?ee.position:Ue.value.duration,"aria-label":`回放位置`,onInput:ut},null,40,E_e),J(`span`,D_e,I(R(MJ)(We.value?ee.position:Ue.value.duration))+` / `+I(R(MJ)(Ue.value.duration)),1),J(`button`,{type:`button`,class:`wf-player-button`,"aria-label":`关闭回放`,onClick:dt},[Y(l,{name:`i-lucide-x`})])])):Z(``,!0)],6)):Z(``,!0)],512)}}},[[`__scopeId`,`data-v-2709857c`]]),Y_e={key:0,class:`grid gap-3 py-4`,role:`status`,"aria-label":`正在读取事件记录`},X_e={key:1,role:`alert`,class:`fine-print ev-error`},Z_e={key:2,class:`fine-print`},Q_e={class:`ev-ledger`},$_e={class:`ev-head`},eve={class:`ev-title`},tve={class:`ev-rows`,role:`listbox`,"aria-label":`事件`},nve={key:0,class:`ev-turn`,"aria-hidden":`true`},rve=[`aria-selected`,`onClick`,`onKeydown`],ive={class:`ev-time`},ave={class:`ev-tag`},ove={class:`ev-text`},sve={key:0,class:`ev-inspector`,"aria-label":`记录详情`},cve={class:`ev-head`},lve={class:`ev-title`},uve={class:`ev-actions`},dve={class:`ev-body`},fve={class:`ev-line`},pve={class:`ev-chips`},mve=[`onClick`],hve=[`onClick`],gve={class:`ev-state`},_ve={key:0,class:`fine-print`},vve={class:`ev-related`},yve=[`onClick`],bve={class:`ev-time`},xve={class:`ev-raw`},Sve=rO({__name:`EventLog`,emits:[`detail`],setup(e,{emit:t}){let n=t,{view:r,bridge:i}=Dr(`discussion`),a=$(()=>r.value.room?.id),o=L([]),s=L({}),c=L(!1),l=L(``),u=L(null),d=L(``),f=L(!1),p=0;sa(()=>{p++});let m={first:0,last:0},h=(e,t)=>e.at-t.at||e.id-t.id;async function g(e=`reset`){let t=a.value;if(!t||f.value&&e!==`reset`)return;let n=++p,r=o.value,u=e===`older`&&r.length?`?before=${m.first}`:e===`newer`&&r.length?`?after=${m.last}`:``;f.value=!0;try{let d=await i.request(`/api/rooms/${t}/events${u}`);if(n!==p||t!==a.value)return;if(e===`newer`&&!d.events.length){l.value=``;return}s.value=d.members,e===`reset`||!r.length?Object.assign(m,{first:d.first_id,last:d.last_id}):e===`older`?m.first=d.first_id||m.first:m.last=Math.max(m.last,d.last_id),e!==`newer`&&(c.value=d.more),o.value=e===`reset`?d.events:[...r,...d.events].sort(h),l.value=``}catch(e){n===p&&(l.value=`读取事件记录失败:${e.message}`)}finally{n===p&&(f.value=!1)}}B(a,()=>{o.value=[],u.value=null,d.value=``,l.value=``,g()},{immediate:!0}),B(()=>r.value.room,(e,t)=>{e?.id&&e.id===t?.id&&o.value.length&&g(`newer`)});let _=e=>e&&s.value[String(e)]?i.display_name(s.value[String(e)]):e?`成员 ${e}`:``,v=e=>new Date(e).toLocaleTimeString(`zh-CN`,{hour12:!1})+`.${String(e%1e3).padStart(3,`0`)}`,y=e=>{let[t,n]=e.split(`:`);return t===`request`?`请求 R${n}`:t===`execution`?`执行 E${n}`:`#${n}`},b=e=>e?.kind===`message.posted`&&e.data.source===`user`,x=e=>e?.kind===`api.write`&&e.data.path===`/messages`,S=$(()=>{let e=0,t=o.value;return t.flatMap((n,r)=>{let i=x(n)&&b(t[r+1])||b(n)&&!x(t[r-1]);if(i&&(e+=1),d.value&&!aY(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:whe[a]||a,text:oY(n,_)}]})}),C=$(()=>o.value.findIndex(e=>e.id===u.value)),w=$(()=>o.value[C.value]),T=$(()=>w.value?Ahe(o.value,C.value):null),E=$(()=>{if(!w.value)return[];let e=new Set(aY(w.value));return e.size?S.value.filter(t=>t.event.id!==u.value&&aY(t.event).some(t=>e.has(t))):[]});function D(e){u.value=u.value===e.event.id?null:e.event.id}function O(e){let t=S.value.findIndex(e=>e.event.id===u.value)+e;S.value[t]&&(u.value=S.value[t].event.id)}function k(e){u.value&&[`ArrowUp`,`ArrowDown`].includes(e.key)&&(e.preventDefault(),O(e.key===`ArrowUp`?-1:1))}return(e,t)=>{let r=BD,i=Zx,a=va(`keep-reading`);return G(),K(`section`,{class:`merged-section event-log`,"aria-label":`事件记录`,onKeydown:k},[t[9]||=J(`div`,{class:`page-heading`},[J(`div`,null,[J(`h2`,null,`事件记录`),J(`p`,null,[X(`网站如实记下的用户与程序的每次写入(含被拒的)及其引起的状态变化,按发生顺序排列;点一行看原始记录、此刻仍未结束的请求与执行,以及同一对象的其他记录。AI 可用 `),J(`code`,null,`codiscuss room events`),X(` 读取同一份记录。`)])])],-1),f.value&&!o.value.length?(G(),K(`div`,Y_e,[(G(),K(W,null,H(8,e=>Y(r,{key:e,class:F([`h-5`,e%3?`w-full`:`w-2/3`])},null,8,[`class`])),64))])):l.value?(G(),K(`p`,X_e,[X(I(l.value),1),Y(i,{label:`重试`,color:`neutral`,variant:`link`,size:`xs`,loading:f.value,onClick:t[0]||=e=>g()},null,8,[`loading`])])):o.value.length?Z(``,!0):(G(),K(`p`,Z_e,`还没有事件记录。此功能上线前的历史没有记录。`)),o.value.length?(G(),K(`div`,{key:3,class:F([`ev`,{"has-inspector":w.value}])},[J(`div`,Q_e,[J(`header`,$_e,[J(`span`,eve,I(S.value.length)+` 条记录`,1),d.value?(G(),K(`button`,{key:0,type:`button`,class:`ev-chip is-active`,onClick:t[1]||=e=>d.value=``},`只看 `+I(y(d.value))+` ✕`,1)):Z(``,!0),c.value&&!d.value?(G(),q(i,{key:1,label:`加载更早`,color:`neutral`,variant:`link`,size:`xs`,loading:f.value,onClick:t[2]||=e=>g(`older`)},null,8,[`loading`])):Z(``,!0)]),J(`ol`,tve,[(G(!0),K(W,null,H(S.value,e=>(G(),K(W,{key:e.event.id},[e.boundary?(G(),K(`li`,nve,`第 `+I(e.turn)+` 轮`,1)):Z(``,!0),J(`li`,{role:`option`,tabindex:`0`,class:F([`ev-row`,[`is-${e.group}`,{"is-rejected":e.event.kind===`api.rejected`,"is-selected":e.event.id===u.value,"is-after":w.value&&e.index>C.value}]]),"aria-selected":e.event.id===u.value,onClick:t=>D(e),onKeydown:rl(t=>D(e),[`enter`])},[J(`time`,ive,I(v(e.event.at)),1),J(`span`,ave,I(e.label),1),J(`span`,ove,I(e.text),1)],42,rve)],64))),128))])]),w.value?(G(),K(`aside`,sve,[J(`header`,cve,[J(`span`,lve,I(v(w.value.at))+` · `+I(w.value.kind),1),J(`span`,uve,[J(`button`,{type:`button`,class:`ev-icon`,"aria-label":`上一条`,onClick:t[3]||=e=>O(-1)},`↑`),J(`button`,{type:`button`,class:`ev-icon`,"aria-label":`下一条`,onClick:t[4]||=e=>O(1)},`↓`),J(`button`,{type:`button`,class:`ev-icon`,"aria-label":`关闭`,onClick:t[5]||=e=>u.value=null},`✕`)])]),wr((G(),K(`div`,dve,[J(`p`,fve,I(R(oY)(w.value,_)),1),J(`div`,pve,[(G(!0),K(W,null,H(R(aY)(w.value),e=>(G(),K(W,{key:e},[J(`button`,{type:`button`,class:F([`ev-chip`,{"is-active":d.value===e}]),onClick:t=>d.value=d.value===e?``:e},`只看 `+I(y(e)),11,mve),e.startsWith(`message:`)?(G(),K(`button`,{key:0,type:`button`,class:`subtle-link`,onClick:t=>n(`detail`,Number(e.split(`:`)[1]))},`查看 `+I(y(e)),9,hve)):Z(``,!0)],64))),128))]),t[7]||=J(`h3`,null,`此刻未结束的`,-1),J(`ul`,gve,[(G(!0),K(W,null,H(T.value.requests,e=>(G(),K(`li`,{key:`r${e.request_id}`},[X(`请求 R`+I(e.request_id)+` → `+I(_(e.member_id))+` · `+I(R(tY)[e.purpose]||e.purpose)+` · 挂在 #`+I(e.message_id)+` · `+I(R($J)[e.status]||e.status),1),e.execution_id?(G(),K(W,{key:0},[X(` · 执行 E`+I(e.execution_id),1)],64)):Z(``,!0)]))),128)),(G(!0),K(W,null,H(T.value.executions,e=>(G(),K(`li`,{key:`e${e.execution_id}`},`执行 E`+I(e.execution_id)+` · `+I(_(e.member_id))+` · `+I(R(eY)[e.status]||e.status)+` · 已过 `+I(Math.round((w.value.at-e.at)/1e3))+` 秒`,1))),128)),(G(!0),K(W,null,H(T.value.queue,e=>(G(),K(`li`,{key:`q${e.queue_id}`},I(_(e.member_id))+` 排队等候 #`+I(e.message_id),1))),128)),(G(!0),K(W,null,H(T.value.chains,e=>(G(),K(`li`,{key:`c${e.chain_id}`},`任务链 #`+I(e.chain_id)+` 到限暂停`,1))),128)),!T.value.requests.length&&!T.value.executions.length&&!T.value.queue.length&&!T.value.chains.length?(G(),K(`li`,_ve,`无(只计已加载的记录)`)):Z(``,!0)]),E.value.length?(G(),K(W,{key:0},[t[6]||=J(`h3`,null,`同一对象的其他记录`,-1),J(`ul`,vve,[(G(!0),K(W,null,H(E.value,e=>(G(),K(`li`,{key:e.event.id},[J(`button`,{type:`button`,class:`ev-link`,onClick:t=>u.value=e.event.id},[J(`time`,bve,I(v(e.event.at)),1),X(` `+I(e.text),1)],8,yve)]))),128))])],64)):Z(``,!0),t[8]||=J(`h3`,null,`原始记录`,-1),J(`pre`,xve,I(JSON.stringify({id:w.value.id,kind:w.value.kind,at:w.value.at,data:w.value.data},null,2)),1)])),[[a]])])):Z(``,!0)],2)):Z(``,!0)],32)}}},[[`__scopeId`,`data-v-d7c1ea47`]]),Cve={class:`project-files`},wve={class:`project-files-heading`},Tve={key:0,class:`project-roots`,role:`tablist`,"aria-label":`项目目录`},Eve=[`aria-selected`,`title`,`onClick`],Dve=[`aria-busy`],Ove={class:`project-explorer-path`,"aria-label":`文件路径`},kve=[`disabled`,`aria-current`,`onClick`],Ave=[`disabled`,`title`,`onClick`],jve={class:`project-file-name`},Mve={class:`project-file-size`},Nve=[`datetime`],Pve={key:0,role:`status`,"aria-label":`正在读取项目目录`},Fve={class:`project-file-name`},Ive={key:1,class:`project-files-empty`},Lve={key:2,class:`project-files-empty`},Rve={key:0,class:`project-files-footer`},zve=rO({__name:`ProjectFiles`,props:{directories:{type:Array,required:!0}},setup(e){let t=e,{view:n,bridge:r}=Dr(`discussion`),i=n.value.room.id,a=vj.get(i),o=L(Math.max(0,t.directories.indexOf(a?.directory))),s=$(()=>t.directories[o.value]||t.directories[0]),c=L(a?.directory===s.value?a.path:``),l=L(null),u=L(!1),d=0,f=e=>`${i}
62
62
  ${s.value}